frappe-ui 0.1.200 → 0.1.202

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.1.200",
3
+ "version": "0.1.202",
4
4
  "description": "A set of components and utilities for rapid UI development",
5
5
  "main": "./src/index.ts",
6
6
  "type": "module",
@@ -74,7 +74,7 @@ const lowlight = createLowlight(common)
74
74
  function defaultUploadFunction(file: File) {
75
75
  // useFileUpload is frappe specific
76
76
  let fileUpload = useFileUpload()
77
- return fileUpload.upload(file)
77
+ return fileUpload.upload(file, props.uploadArgs || {})
78
78
  }
79
79
 
80
80
  const props = withDefaults(defineProps<TextEditorProps>(), {
@@ -25,6 +25,7 @@ export interface TextEditorProps {
25
25
  mentions?: ConfigureMentionOptions
26
26
  tags?: any[]
27
27
  uploadFunction?: (file: File) => Promise<UploadedFile>
28
+ uploadArgs?: object
28
29
  }
29
30
 
30
31
  export interface TextEditorEmits {
@@ -40,6 +40,9 @@ export function createDocumentResource(options, vm) {
40
40
  fieldname: values,
41
41
  }
42
42
  },
43
+ validate(data) {
44
+ options.setValue?.validate?.call(vm, data)
45
+ },
43
46
  beforeSubmit(params) {
44
47
  out.previousDoc = JSON.stringify(out.doc)
45
48
  Object.assign(out.doc, params.fieldname || {})