frappe-ui 0.0.91 → 0.0.92

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.91",
3
+ "version": "0.0.92",
4
4
  "description": "A set of components and utilities for rapid UI development",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -48,7 +48,7 @@ export function createDocumentResource(options, vm) {
48
48
  doctype: options.doctype,
49
49
  name: options.name,
50
50
  doc: null,
51
- auto: true,
51
+ auto: options.auto || true,
52
52
  get: createResource(
53
53
  {
54
54
  url: 'frappe.client.get',
@@ -103,7 +103,7 @@ export function createDocumentResource(options, vm) {
103
103
  let methodOptions = options.whitelistedMethods[methodKey]
104
104
  if (typeof methodOptions == 'string') {
105
105
  methodOptions = {
106
- url: methodOptions,
106
+ method: methodOptions,
107
107
  }
108
108
  }
109
109
  let { method, onSuccess, ...otherOptions } = methodOptions
@@ -183,6 +183,11 @@ export function createDocumentResource(options, vm) {
183
183
  out.doc = transform(data)
184
184
  }
185
185
  })
186
+
187
+ if (out.auto) {
188
+ out.get.fetch()
189
+ }
190
+
186
191
  return out
187
192
  }
188
193
 
@@ -21,7 +21,7 @@ function createMixin() {
21
21
  let debugInfo = `${this.$options.name} (${
22
22
  this.$options.__file || ''
23
23
  })`
24
- if (import.meta.env.DEV) {
24
+ if (process.env.NODE_ENV === 'development') {
25
25
  console.warn('Failed to parse pageMeta in', debugInfo)
26
26
  }
27
27
  return null