frappe-ui 0.0.71 → 0.0.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frappe-ui",
3
- "version": "0.0.71",
3
+ "version": "0.0.72",
4
4
  "description": "A set of components and utilities for rapid UI development",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -28,7 +28,7 @@ export default {
28
28
  let color = this.getBadgeColor()
29
29
 
30
30
  let cssClasses = {
31
- gray: 'text-gray-700 bg-gray-50',
31
+ gray: 'text-gray-700 bg-gray-100',
32
32
  green: 'text-green-700 bg-green-50',
33
33
  red: 'text-red-700 bg-red-50',
34
34
  yellow: 'text-yellow-700 bg-yellow-50',
@@ -126,6 +126,8 @@ export function createDocumentResource(options, vm) {
126
126
  doc.name.toString() === out.name.toString()
127
127
  ) {
128
128
  out.doc = transform(doc)
129
+ // update data in list resources
130
+ updateRowInListResource(out.doctype, out.doc)
129
131
  break
130
132
  }
131
133
  }
@@ -150,6 +150,27 @@ export function createListResource(options, vm, getResource) {
150
150
  },
151
151
  vm
152
152
  ),
153
+ runDocMethod: createResource(
154
+ {
155
+ method: 'run_doc_method',
156
+ makeParams({ method, name, ...values }) {
157
+ return {
158
+ dt: out.doctype,
159
+ dn: name,
160
+ method: method,
161
+ args: JSON.stringify(values),
162
+ }
163
+ },
164
+ onSuccess(data) {
165
+ if (data.docs) {
166
+ for (let doc of data.docs) {
167
+ updateRowInListResource(doc.doctype, doc)
168
+ }
169
+ }
170
+ },
171
+ },
172
+ vm
173
+ ),
153
174
  update,
154
175
  reload,
155
176
  setData,