|
@@ -1,11 +1,11 @@
|
|
|
-import is, {hasProperty} from '@form-create/utils/lib/type';
|
|
|
-import {parseFn} from '@form-create/utils/lib/json';
|
|
|
-import toCase from '@form-create/utils/lib/tocase';
|
|
|
-import {computed, isRef, ref, unref} from 'vue';
|
|
|
-import ZhCn from '../locale/zh-cn';
|
|
|
-import {message} from './message';
|
|
|
+import is, { hasProperty } from '@form-create/utils/lib/type'
|
|
|
+import { parseFn } from '@form-create/utils/lib/json'
|
|
|
+import toCase from '@form-create/utils/lib/tocase'
|
|
|
+import { computed, isRef, ref, unref } from 'vue'
|
|
|
+import ZhCn from '../locale/zh-cn'
|
|
|
+import { message } from './message'
|
|
|
|
|
|
-export {formTemplate, formTemplateV3, htmlTemplate} from './template';
|
|
|
+export { formTemplate, formTemplateV3, htmlTemplate } from './template'
|
|
|
|
|
|
|
|
|
export function makeRequiredRule() {
|
|
@@ -352,6 +352,25 @@ export function getInjectArg(t) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+export function getOptionArg(t) {
|
|
|
+ return {
|
|
|
+ name: '$inject',
|
|
|
+
|
|
|
+ columns: [
|
|
|
+ {label: 'action', info: t('event.option.action'), type: 'string'},
|
|
|
+ {label: 'method', info: t('event.option.method'), type: 'string'},
|
|
|
+ {label: 'data', info: t('event.option.data'), type: 'Record<string, string | Blob | [Blob, string]>'},
|
|
|
+ {label: 'filename', info: t('event.option.filename'), type: 'string'},
|
|
|
+ {label: 'file', info: t('event.option.file'), type: 'UploadRawFile'},
|
|
|
+ {label: 'headers', info: t('event.option.headers'), type: 'Headers | Record<string, string | number | null | undefined>'},
|
|
|
+ {label: 'onError', info: t('event.option.onError'), type: 'function'},
|
|
|
+ {label: 'onProgress', info: t('event.option.onProgress'), type: 'function'},
|
|
|
+ {label: 'onSuccess', info: t('event.option.onSuccess'), type: 'function'},
|
|
|
+ {label: 'withCredentials', info: t('event.option.withCredentials'), type: 'boolean'},
|
|
|
+ ]
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
export function isElementInside(x, y, element) {
|
|
|
const rect = element.getBoundingClientRect();
|
|
|
return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom;
|
|
@@ -409,4 +428,4 @@ export function copyTextToClipboard(text) {
|
|
|
|
|
|
export function uniqueArray(arr) {
|
|
|
return arr.filter((item, index) => arr.indexOf(item) === index);
|
|
|
-}
|
|
|
+}
|