cnhis-design-vue 3.1.42-beta.1 → 3.1.42-beta.11
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/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
- package/es/components/base-search/index.d.ts +0 -22
- package/es/components/base-search/src/index.vue.d.ts +0 -22
- package/es/components/base-search/src/index.vue.js +1 -1
- package/es/components/base-search/style/index.css +1 -1
- package/es/components/big-table/index.d.ts +3 -4
- package/es/components/big-table/src/BigTable.vue.d.ts +3 -4
- package/es/components/big-table/src/BigTable.vue2.js +1 -1
- package/es/components/big-table/style/index.css +1 -1
- package/es/components/button-print/index.d.ts +4 -4
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +4 -4
- package/es/components/button-print/src/components/EditFormat.vue.d.ts +4 -4
- package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +4 -4
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/classification/src/index.vue.js +1 -1
- package/es/components/config-provider/src/ConfigProvider.js +1 -1
- package/es/components/config-provider/src/interface.d.ts +4 -4
- package/es/components/date-picker/index.d.ts +5 -13
- package/es/components/date-picker/src/DatePicker.vue.d.ts +5 -13
- package/es/components/date-picker/src/DatePicker.vue.js +1 -1
- package/es/components/fabric-chart/index.d.ts +2 -2
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +2 -2
- package/es/components/field-set/index.d.ts +84 -15
- package/es/components/field-set/src/FieldSet.vue.d.ts +80 -29
- package/es/components/field-set/src/types/index.d.ts +18 -0
- package/es/components/field-set/src/types/index.js +1 -0
- package/es/components/form-config/index.d.ts +24 -24
- package/es/components/form-config/src/FormConfig.vue.d.ts +24 -24
- package/es/components/form-config/src/FormConfig.vue.js +1 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +12 -12
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +12 -12
- package/es/components/form-render/index.d.ts +12 -12
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +12 -12
- package/es/components/form-render/src/FormRender.vue.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +12 -12
- package/es/components/form-render/src/components/renderer/complex.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +2 -2
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/index.d.ts +1 -1
- package/es/components/form-render/src/hooks/index.js +1 -1
- package/es/components/form-render/src/hooks/useFormAsyncQueue.d.ts +16 -0
- package/es/components/form-render/src/hooks/useFormAsyncQueue.js +1 -0
- package/es/components/form-render/src/hooks/useFormContext.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +2 -1
- package/es/components/iho-table/index.d.ts +1523 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +1523 -0
- package/es/components/iho-table/src/IhoTable.vue.js +1 -1
- package/es/components/iho-table/src/constants/index.d.ts +2 -1
- package/es/components/iho-table/src/constants/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +3 -1
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
- package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +5 -13
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +4 -10
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.js +1 -0
- package/es/components/iho-table/src/types/index.d.ts +1 -0
- package/es/components/iho-table/src/types/pluginType.d.ts +3 -1
- package/es/components/iho-table/src/utils/index.d.ts +1 -0
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +1 -0
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +28 -28
- package/es/components/info-header/src/InfoHeader.vue.d.ts +28 -28
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +3 -3
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +3 -3
- package/es/components/info-header/src/components/infoDescription/HiddenContent.vue.d.ts +2 -2
- package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue.d.ts +1 -1
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +15 -15
- package/es/components/info-header/src/components/infoDescription/index.vue.js +1 -1
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +12 -12
- package/es/components/info-header/style/index.css +1 -1
- package/es/components/keyboard/index.d.ts +1 -1
- package/es/components/keyboard/src/Keyboard.vue.d.ts +1 -1
- package/es/components/keyboard/src/Keyboard.vue.js +1 -1
- package/es/components/keyboard/src/constants/index.js +1 -1
- package/es/components/keyboard/style/index.css +1 -1
- package/es/components/scale-view/src/components/formitem/standard-modal.d.ts +1 -1
- package/es/components/select-person/index.d.ts +1 -1
- package/es/components/select-person/src/SelectPerson.vue.d.ts +1 -1
- package/es/components/shortcut-setter/index.d.ts +12 -12
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +12 -12
- package/es/components/steps-wheel/src/StepsWheel.vue.js +1 -1
- package/es/components/steps-wheel/src/constants/index.js +1 -1
- package/es/components/steps-wheel/style/index.css +1 -1
- package/es/components/table-filter/index.d.ts +0 -1
- package/es/components/table-filter/index.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/CheckboxGroup.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
- package/es/components/table-filter/src/hooks/useMixins.js +1 -1
- package/es/components/table-filter/src/tool/baseOptions.d.ts +0 -10
- package/es/components/table-filter/src/tool/baseOptions.js +1 -1
- package/es/components/table-filter/src/tool/generateDefOptions.d.ts +0 -7
- package/es/components/table-filter/src/tool/generateDefOptions.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +0 -74
- package/es/components/time-picker/index.d.ts +4 -10
- package/es/components/time-picker/src/TimePicker.vue.d.ts +4 -10
- package/es/components/time-picker/src/TimePicker.vue.js +1 -1
- package/es/shared/hooks/index.d.ts +3 -0
- package/es/shared/hooks/index.js +1 -0
- package/es/{components/form-render/src → shared}/hooks/useAsyncQueue.d.ts +0 -14
- package/es/shared/hooks/useAsyncQueue.js +1 -0
- package/es/shared/hooks/useDateTime.d.ts +6 -0
- package/es/shared/hooks/useDateTime.js +1 -0
- package/package.json +2 -2
- package/es/components/base-search/src/directive/resize.d.ts +0 -4
- package/es/components/base-search/src/directive/resize.js +0 -1
- package/es/components/base-search/src/tool/resizeSensor.d.ts +0 -16
- package/es/components/base-search/src/tool/resizeSensor.js +0 -1
- package/es/components/form-render/src/hooks/useAsyncQueue.js +0 -1
- package/es/components/table-filter/src/hooks/export.d.ts +0 -1
- package/es/components/table-filter/src/hooks/export.js +0 -1
- package/es/components/table-filter/src/tool/getWidgetType.d.ts +0 -1
- package/es/components/table-filter/src/tool/getWidgetType.js +0 -1
- package/es/shared/mixins/index.d.ts +0 -1
- package/es/shared/mixins/index.js +0 -1
- package/es/shared/utils/colorLog.d.ts +0 -31
- package/es/shared/utils/colorLog.js +0 -1
- /package/es/shared/{mixins → hooks}/useTheme.d.ts +0 -0
- /package/es/shared/{mixins → hooks}/useTheme.js +0 -0
|
@@ -5355,7 +5355,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5355
5355
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
5356
5356
|
onAnnotationChange?: ((...args: any[]) => any) | undefined;
|
|
5357
5357
|
}>>;
|
|
5358
|
-
emit: (event: "
|
|
5358
|
+
emit: (event: "formChange" | "scroll" | "annotationChange", ...args: any[]) => void;
|
|
5359
5359
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
5360
5360
|
formRenderRef: import("vue").Ref<HTMLElement | undefined>;
|
|
5361
5361
|
formHeight: import("vue").ComputedRef<string>;
|
|
@@ -5511,32 +5511,32 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5511
5511
|
data: any;
|
|
5512
5512
|
loading: boolean;
|
|
5513
5513
|
required: boolean;
|
|
5514
|
-
hidden: boolean;
|
|
5515
|
-
visible: boolean;
|
|
5516
|
-
content: any;
|
|
5517
|
-
reset: (options?: import("../../../../../es/components/form-render").IFieldResetOptions | undefined) => Promise<void>;
|
|
5518
|
-
active: boolean;
|
|
5519
|
-
disabled: boolean;
|
|
5520
|
-
display: import("../../../../../es/components/form-render").FieldDisplayTypes;
|
|
5521
5514
|
value: string;
|
|
5522
5515
|
readonly index: string | number;
|
|
5516
|
+
disabled: boolean;
|
|
5523
5517
|
onFocus: (...args: any[]) => Promise<void>;
|
|
5524
5518
|
onBlur: (...args: any[]) => Promise<void>;
|
|
5525
5519
|
onInput: (...args: any[]) => Promise<void>;
|
|
5520
|
+
reset: (options?: import("../../../../../es/components/form-render").IFieldResetOptions | undefined) => Promise<void>;
|
|
5521
|
+
visible: boolean;
|
|
5526
5522
|
submit: <T>(onSubmit?: ((values: any) => void | Promise<T>) | undefined) => Promise<T>;
|
|
5527
5523
|
validator: import("../../../../../es/components/form-render").FieldValidator;
|
|
5528
5524
|
pattern: import("../../../../../es/components/form-render").FieldPatternTypes;
|
|
5529
5525
|
title: string;
|
|
5530
5526
|
form: import("../../../../../es/components/form-render").Form<any>;
|
|
5527
|
+
content: any;
|
|
5531
5528
|
componentProps: Record<string, any>;
|
|
5532
5529
|
decoratorProps: Record<string, any>;
|
|
5530
|
+
display: import("../../../../../es/components/form-render").FieldDisplayTypes;
|
|
5533
5531
|
description: string;
|
|
5534
5532
|
readOnly: boolean;
|
|
5535
5533
|
editable: boolean;
|
|
5534
|
+
hidden: boolean;
|
|
5536
5535
|
component: import("../../../../../es/components/form-render").FieldComponent<any, any>;
|
|
5537
5536
|
decorator: import("../../../../../es/components/form-render").FieldDecorator<any, any>;
|
|
5538
5537
|
validating: boolean;
|
|
5539
5538
|
submitting: boolean;
|
|
5539
|
+
active: boolean;
|
|
5540
5540
|
visited: boolean;
|
|
5541
5541
|
selfModified: boolean;
|
|
5542
5542
|
modified: boolean;
|
|
@@ -5623,7 +5623,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5623
5623
|
};
|
|
5624
5624
|
readonly disabled: BooleanConstructor;
|
|
5625
5625
|
readonly displayDirective: {
|
|
5626
|
-
readonly type: PropType<"
|
|
5626
|
+
readonly type: PropType<"if" | "show" | "show:lazy">;
|
|
5627
5627
|
readonly default: "if";
|
|
5628
5628
|
};
|
|
5629
5629
|
readonly closable: {
|
|
@@ -5648,7 +5648,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5648
5648
|
};
|
|
5649
5649
|
readonly disabled: BooleanConstructor;
|
|
5650
5650
|
readonly displayDirective: {
|
|
5651
|
-
readonly type: PropType<"
|
|
5651
|
+
readonly type: PropType<"if" | "show" | "show:lazy">;
|
|
5652
5652
|
readonly default: "if";
|
|
5653
5653
|
};
|
|
5654
5654
|
readonly closable: {
|
|
@@ -5662,10 +5662,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5662
5662
|
}>>, {
|
|
5663
5663
|
readonly disabled: boolean;
|
|
5664
5664
|
readonly closable: boolean | undefined;
|
|
5665
|
-
readonly displayDirective: "
|
|
5665
|
+
readonly displayDirective: "if" | "show" | "show:lazy";
|
|
5666
5666
|
}>;
|
|
5667
5667
|
NTabs: any;
|
|
5668
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
5668
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("formChange" | "scroll" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
5669
5669
|
fieldList: {
|
|
5670
5670
|
type: PropType<FieldItem[]>;
|
|
5671
5671
|
};
|
|
@@ -268,7 +268,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
268
268
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
269
269
|
onAnnotationChange?: ((...args: any[]) => any) | undefined;
|
|
270
270
|
}>>;
|
|
271
|
-
emit: (event: "
|
|
271
|
+
emit: (event: "formChange" | "scroll" | "annotationChange", ...args: any[]) => void;
|
|
272
272
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
273
273
|
formRenderRef: import("vue").Ref<HTMLElement | undefined>;
|
|
274
274
|
formHeight: import("vue").ComputedRef<string>;
|
|
@@ -424,32 +424,32 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
424
424
|
data: any;
|
|
425
425
|
loading: boolean;
|
|
426
426
|
required: boolean;
|
|
427
|
-
hidden: boolean;
|
|
428
|
-
visible: boolean;
|
|
429
|
-
content: any;
|
|
430
|
-
reset: (options?: import("@formily/core/esm/types").IFieldResetOptions | undefined) => Promise<void>;
|
|
431
|
-
active: boolean;
|
|
432
|
-
disabled: boolean;
|
|
433
|
-
display: import("@formily/core/esm/types").FieldDisplayTypes;
|
|
434
427
|
value: string;
|
|
435
428
|
readonly index: string | number;
|
|
429
|
+
disabled: boolean;
|
|
436
430
|
onFocus: (...args: any[]) => Promise<void>;
|
|
437
431
|
onBlur: (...args: any[]) => Promise<void>;
|
|
438
432
|
onInput: (...args: any[]) => Promise<void>;
|
|
433
|
+
reset: (options?: import("@formily/core/esm/types").IFieldResetOptions | undefined) => Promise<void>;
|
|
434
|
+
visible: boolean;
|
|
439
435
|
submit: <T>(onSubmit?: ((values: any) => void | Promise<T>) | undefined) => Promise<T>;
|
|
440
436
|
validator: import("@formily/core/esm/types").FieldValidator;
|
|
441
437
|
pattern: import("@formily/core/esm/types").FieldPatternTypes;
|
|
442
438
|
title: string;
|
|
443
439
|
form: import("@formily/core/esm/models/Form").Form<any>;
|
|
440
|
+
content: any;
|
|
444
441
|
componentProps: Record<string, any>;
|
|
445
442
|
decoratorProps: Record<string, any>;
|
|
443
|
+
display: import("@formily/core/esm/types").FieldDisplayTypes;
|
|
446
444
|
description: string;
|
|
447
445
|
readOnly: boolean;
|
|
448
446
|
editable: boolean;
|
|
447
|
+
hidden: boolean;
|
|
449
448
|
component: import("@formily/core/esm/types").FieldComponent<any, any>;
|
|
450
449
|
decorator: import("@formily/core/esm/types").FieldDecorator<any, any>;
|
|
451
450
|
validating: boolean;
|
|
452
451
|
submitting: boolean;
|
|
452
|
+
active: boolean;
|
|
453
453
|
visited: boolean;
|
|
454
454
|
selfModified: boolean;
|
|
455
455
|
modified: boolean;
|
|
@@ -536,7 +536,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
536
536
|
};
|
|
537
537
|
readonly disabled: BooleanConstructor;
|
|
538
538
|
readonly displayDirective: {
|
|
539
|
-
readonly type: import("vue").PropType<"
|
|
539
|
+
readonly type: import("vue").PropType<"if" | "show" | "show:lazy">;
|
|
540
540
|
readonly default: "if";
|
|
541
541
|
};
|
|
542
542
|
readonly closable: {
|
|
@@ -561,7 +561,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
561
561
|
};
|
|
562
562
|
readonly disabled: BooleanConstructor;
|
|
563
563
|
readonly displayDirective: {
|
|
564
|
-
readonly type: import("vue").PropType<"
|
|
564
|
+
readonly type: import("vue").PropType<"if" | "show" | "show:lazy">;
|
|
565
565
|
readonly default: "if";
|
|
566
566
|
};
|
|
567
567
|
readonly closable: {
|
|
@@ -575,10 +575,10 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
575
575
|
}>>, {
|
|
576
576
|
readonly disabled: boolean;
|
|
577
577
|
readonly closable: boolean | undefined;
|
|
578
|
-
readonly displayDirective: "
|
|
578
|
+
readonly displayDirective: "if" | "show" | "show:lazy";
|
|
579
579
|
}>;
|
|
580
580
|
NTabs: any;
|
|
581
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
581
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("formChange" | "scroll" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
582
582
|
fieldList: {
|
|
583
583
|
type: import("vue").PropType<import("./src/types").FieldItem[]>;
|
|
584
584
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{COMPONENT_NAMESPACE as e}from"../../shared/global/variable.js";import{safeComponentRegister as s}from"../../shared/utils/index.js";import r from"./src/FormRenderWrapper.vue.js";export{useFieldListAdaptor}from"./src/hooks/useFieldListAdaptor.js";export{useFormRequest}from"./src/hooks/useFormRequest.js";export{useCommonLog}from"./src/hooks/useCommonLog.js";export{useFormField}from"./src/hooks/useFormField.js";export{
|
|
1
|
+
import{COMPONENT_NAMESPACE as e}from"../../shared/global/variable.js";import{safeComponentRegister as s}from"../../shared/utils/index.js";import r from"./src/FormRenderWrapper.vue.js";export{useFieldListAdaptor}from"./src/hooks/useFieldListAdaptor.js";export{useFormRequest}from"./src/hooks/useFormRequest.js";export{useCommonLog}from"./src/hooks/useCommonLog.js";export{useFormField}from"./src/hooks/useFormField.js";export{useFormAsyncQueue}from"./src/hooks/useFormAsyncQueue.js";export{useFieldVisitor}from"./src/hooks/useFieldVisitor.js";export{useFieldNormalize}from"./src/hooks/useFieldNormalize.js";export{useFormValidator,validateMessageLocale}from"./src/hooks/useFormValidator.js";export{BusinessCollector,useBusinessBinding}from"./src/hooks/useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./src/hooks/useChangeContext.js";export{FormItemDepsCollector,useFormItemDeps}from"./src/hooks/useFormItemDeps.js";export{useAnchor}from"./src/hooks/useAnchor.js";export{useFormContext}from"./src/hooks/useFormContext.js";export{useCommonInjection,useSelectOptionProps}from"./src/hooks/useCommonInjection.js";export{searchContentMatcher,useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./src/hooks/useFormRenderOptions.js";export{combineExtendKey,createInputSlot,createSlot,createUrlConfigParams,formRenderLog,injectOrProvide,isNestedFieldType,isNestedType,keywordMatcher,mergeDeepProperties,parseNumberFromMaybeString,presetRequestHandler,splitExtendKey,validateMessageParser}from"./src/utils/index.js";export*from"@formily/core";export{businessDateParser,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./src/utils/business.js";export{findNextWidget,queryDecoratorByAddress,queryDecoratorByFieldKey,queryInput}from"./src/utils/dom.js";export{assignClearBindVisited,assignUpdateValue,assignValueBindKey,createLinebarId,createObjSchema,createVisitedSetter,dotEscape,fieldKeyEscape,getParentLinebar,traverseDependKey,traverseSchema}from"./src/utils/schema.js";const o=r;o.install=function(r){s(r,o,e+"FormRender")};export{o as default};
|
|
@@ -262,7 +262,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
262
262
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
263
263
|
onAnnotationChange?: ((...args: any[]) => any) | undefined;
|
|
264
264
|
}>>;
|
|
265
|
-
emit: (event: "
|
|
265
|
+
emit: (event: "formChange" | "scroll" | "annotationChange", ...args: any[]) => void;
|
|
266
266
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
267
267
|
formRenderRef: import("vue").Ref<HTMLElement | undefined>;
|
|
268
268
|
formHeight: import("vue").ComputedRef<string>;
|
|
@@ -418,32 +418,32 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
418
418
|
data: any;
|
|
419
419
|
loading: boolean;
|
|
420
420
|
required: boolean;
|
|
421
|
-
hidden: boolean;
|
|
422
|
-
visible: boolean;
|
|
423
|
-
content: any;
|
|
424
|
-
reset: (options?: import("@formily/core").IFieldResetOptions | undefined) => Promise<void>;
|
|
425
|
-
active: boolean;
|
|
426
|
-
disabled: boolean;
|
|
427
|
-
display: import("@formily/core").FieldDisplayTypes;
|
|
428
421
|
value: string;
|
|
429
422
|
readonly index: string | number;
|
|
423
|
+
disabled: boolean;
|
|
430
424
|
onFocus: (...args: any[]) => Promise<void>;
|
|
431
425
|
onBlur: (...args: any[]) => Promise<void>;
|
|
432
426
|
onInput: (...args: any[]) => Promise<void>;
|
|
427
|
+
reset: (options?: import("@formily/core").IFieldResetOptions | undefined) => Promise<void>;
|
|
428
|
+
visible: boolean;
|
|
433
429
|
submit: <T>(onSubmit?: ((values: any) => void | Promise<T>) | undefined) => Promise<T>;
|
|
434
430
|
validator: import("@formily/core").FieldValidator;
|
|
435
431
|
pattern: import("@formily/core").FieldPatternTypes;
|
|
436
432
|
title: string;
|
|
437
433
|
form: import("@formily/core").Form<any>;
|
|
434
|
+
content: any;
|
|
438
435
|
componentProps: Record<string, any>;
|
|
439
436
|
decoratorProps: Record<string, any>;
|
|
437
|
+
display: import("@formily/core").FieldDisplayTypes;
|
|
440
438
|
description: string;
|
|
441
439
|
readOnly: boolean;
|
|
442
440
|
editable: boolean;
|
|
441
|
+
hidden: boolean;
|
|
443
442
|
component: import("@formily/core").FieldComponent<any, any>;
|
|
444
443
|
decorator: import("@formily/core").FieldDecorator<any, any>;
|
|
445
444
|
validating: boolean;
|
|
446
445
|
submitting: boolean;
|
|
446
|
+
active: boolean;
|
|
447
447
|
visited: boolean;
|
|
448
448
|
selfModified: boolean;
|
|
449
449
|
modified: boolean;
|
|
@@ -530,7 +530,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
530
530
|
};
|
|
531
531
|
readonly disabled: BooleanConstructor;
|
|
532
532
|
readonly displayDirective: {
|
|
533
|
-
readonly type: PropType<"
|
|
533
|
+
readonly type: PropType<"if" | "show" | "show:lazy">;
|
|
534
534
|
readonly default: "if";
|
|
535
535
|
};
|
|
536
536
|
readonly closable: {
|
|
@@ -555,7 +555,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
555
555
|
};
|
|
556
556
|
readonly disabled: BooleanConstructor;
|
|
557
557
|
readonly displayDirective: {
|
|
558
|
-
readonly type: PropType<"
|
|
558
|
+
readonly type: PropType<"if" | "show" | "show:lazy">;
|
|
559
559
|
readonly default: "if";
|
|
560
560
|
};
|
|
561
561
|
readonly closable: {
|
|
@@ -569,10 +569,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
569
569
|
}>>, {
|
|
570
570
|
readonly disabled: boolean;
|
|
571
571
|
readonly closable: boolean | undefined;
|
|
572
|
-
readonly displayDirective: "
|
|
572
|
+
readonly displayDirective: "if" | "show" | "show:lazy";
|
|
573
573
|
}>;
|
|
574
574
|
NTabs: any;
|
|
575
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
575
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("formChange" | "scroll" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
576
576
|
fieldList: {
|
|
577
577
|
type: PropType<FieldItem[]>;
|
|
578
578
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,openBlock as i,createBlock as l,unref as n,withCtx as m,createElementBlock as p,createVNode as u,isRef as d,Fragment as c,renderList as f,createCommentVNode as h,createElementVNode as y,normalizeStyle as j,withKeys as g,withModifiers as v,toDisplayString as b,renderSlot as k}from"vue";import{createForm as F,onFieldValueChange as x,onFieldMount as C,onFieldUnmount as H,onFieldReact as S,onFormMount as A}from"@formily/core";import{FormProvider as R,FormConsumer as L}from"@formily/vue";import{isNumber as _,cloneDeep as O}from"lodash-es";import{NForm as w,NTabs as B,NTabPane as V,NConfigProvider as I}from"naive-ui";import{InjectionFormGraph as N}from"./constants/index.js";import{useAutoHidden as D}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as q}from"./hooks/useComplexOptions.js";import{useFormDomEvent as U,useFormExposeEvent as W}from"./hooks/useFormEvent.js";import{useFormGraph as G}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as K}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeReactions as M}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as T}from"./hooks/useNuiThemeOverrides.js";import"./utils/index.js";import{useFieldListAdaptor as E}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as P}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as J}from"./hooks/useFormValidator.js";import"
|
|
1
|
+
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,openBlock as i,createBlock as l,unref as n,withCtx as m,createElementBlock as p,createVNode as u,isRef as d,Fragment as c,renderList as f,createCommentVNode as h,createElementVNode as y,normalizeStyle as j,withKeys as g,withModifiers as v,toDisplayString as b,renderSlot as k}from"vue";import{createForm as F,onFieldValueChange as x,onFieldMount as C,onFieldUnmount as H,onFieldReact as S,onFormMount as A}from"@formily/core";import{FormProvider as R,FormConsumer as L}from"@formily/vue";import{isNumber as _,cloneDeep as O}from"lodash-es";import{NForm as w,NTabs as B,NTabPane as V,NConfigProvider as I}from"naive-ui";import{InjectionFormGraph as N}from"./constants/index.js";import{useAutoHidden as D}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as q}from"./hooks/useComplexOptions.js";import{useFormDomEvent as U,useFormExposeEvent as W}from"./hooks/useFormEvent.js";import{useFormGraph as G}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as K}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeReactions as M}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as T}from"./hooks/useNuiThemeOverrides.js";import"./utils/index.js";import{useFieldListAdaptor as E}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"@vueuse/core";import"../index.js";import{useFieldVisitor as P}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as J}from"./hooks/useFormValidator.js";import"date-fns";import{useAnchor as $}from"./hooks/useAnchor.js";import{useFormContext as z}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import Q from"../../../_virtual/plugin-vue_export-helper.js";import{createObjSchema as X}from"./utils/schema.js";const Y={key:0,style:{height:"54px"}},Z={style:{"white-space":"pre"}};var ee=Q(e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},linebarAutoHidden:{type:Boolean}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:Q,emit:ee}){const oe=e,{nuiThemeOverrides:te}=T();J();const re=o(),se=t((()=>_(oe.maxHeight)?oe.maxHeight+"px":oe.maxHeight)),{SchemaField:ae,businessCollector:ie,formItemDepsCollector:le,changeContextCollector:ne,formUUID:me}=z(oe,ee),{anchorBarRef:pe,currentAnchor:ue,generateAnchorList:de,updateAnchorList:ce,anchorIdList:fe,onScroll:he}=$(oe,ee,re,le);K(oe).callLifeCycle("onSetup");const{trigger:ye}=D(),{observeFormGraph:je,setGraph:ge,removeGraph:ve}=G();r(N,je);const be=F({initialValues:oe.initialData,effects(e){x("*",(o=>{const t=o.props.name.toString();ie.trigger(e,t),le.trigger(t),ee("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:ne.getContext(t,o.value)}),ke(t,o.value)})),C("*",ge),H("*",ve),oe.linebarAutoHidden&&(S("*",ye),A((e=>e.query("*").forEach(ye)))),oe.anchor&&(S("*",ce),A(de))}}),{lowCodeReactionsHandler:ke,triggerAllReactionsHandler:Fe}=M(t((()=>oe.lowCodeReactions)),be);s(Fe);const{schemaAdaptor:xe}=E(ie);let Ce=oe.fieldList||[];const He=t((()=>oe.schema?oe.schema:oe.fieldList?(Ce=P().traverse(O(oe.fieldList),oe.fieldVisitor),X(xe(Ce))):X({}))),{onKeydown:Se}=U({formModel:be,formRenderRef:re,props:oe}),{clearSpan:Ae}=q();a((()=>Ae(me)));const Re=W({formModel:be,formRenderRef:re,formItemDepsCollector:le,getFieldList:()=>Ce,formUUID:me});return Q({formModel:be,validate:(e="*")=>Re.validate(e),getFormValues:(e=!0)=>Re.getFormValues(e),setFormValues:(e,o=!0)=>Re.setFormValues(e,o),setFieldState(e,o){Re.setFieldState(e,o)},resetFields(e="*"){Re.resetFields(e)},queryWidget:async e=>Re.queryWidget(e),getFieldList:()=>Ce,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(i(),l(n(w),{class:"form-render","require-mark-placement":"left"},{default:m((()=>[e.anchor?(i(),p("section",Y,[u(n(B),{value:n(ue),"onUpdate:value":t[0]||(t[0]=e=>d(ue)?ue.value=e:null),type:"line",ref_key:"anchorBarRef",ref:pe},{default:m((()=>[(i(!0),p(c,null,f(n(fe),(e=>(i(),l(n(V),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):h("v-if",!0),u(n(I),{"theme-overrides":n(te)},{default:m((()=>[y("section",{class:"form-render__wrapper",style:j({"--column":e.column,"--form-height":n(se)}),ref_key:"formRenderRef",ref:re,onScroll:t[1]||(t[1]=(...e)=>n(he)&&n(he)(...e)),onKeydownCapture:t[2]||(t[2]=g(v(((...e)=>n(Se)&&n(Se)(...e)),["prevent"]),["enter"]))},[u(n(R),{form:n(be)},{default:m((()=>[u(n(ae),{schema:n(He)},null,8,["schema"]),e.consumer?(i(),l(n(L),{key:0},{default:m((({form:e})=>[y("div",Z,b(JSON.stringify(e.values,null,2)),1)])),_:1})):h("v-if",!0),k(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3}))}}),[["__file","FormRender.vue"]]);export{ee as default};
|
|
@@ -266,7 +266,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
266
266
|
onScroll?: ((...args: any[]) => any) | undefined;
|
|
267
267
|
onAnnotationChange?: ((...args: any[]) => any) | undefined;
|
|
268
268
|
}>>;
|
|
269
|
-
emit: (event: "
|
|
269
|
+
emit: (event: "formChange" | "scroll" | "annotationChange", ...args: any[]) => void;
|
|
270
270
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
271
271
|
formRenderRef: import("vue").Ref<HTMLElement | undefined>;
|
|
272
272
|
formHeight: import("vue").ComputedRef<string>;
|
|
@@ -422,32 +422,32 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
422
422
|
data: any;
|
|
423
423
|
loading: boolean;
|
|
424
424
|
required: boolean;
|
|
425
|
-
hidden: boolean;
|
|
426
|
-
visible: boolean;
|
|
427
|
-
content: any;
|
|
428
|
-
reset: (options?: import("../../../../es/components/form-render").IFieldResetOptions | undefined) => Promise<void>;
|
|
429
|
-
active: boolean;
|
|
430
|
-
disabled: boolean;
|
|
431
|
-
display: import("../../../../es/components/form-render").FieldDisplayTypes;
|
|
432
425
|
value: string;
|
|
433
426
|
readonly index: string | number;
|
|
427
|
+
disabled: boolean;
|
|
434
428
|
onFocus: (...args: any[]) => Promise<void>;
|
|
435
429
|
onBlur: (...args: any[]) => Promise<void>;
|
|
436
430
|
onInput: (...args: any[]) => Promise<void>;
|
|
431
|
+
reset: (options?: import("../../../../es/components/form-render").IFieldResetOptions | undefined) => Promise<void>;
|
|
432
|
+
visible: boolean;
|
|
437
433
|
submit: <T>(onSubmit?: ((values: any) => void | Promise<T>) | undefined) => Promise<T>;
|
|
438
434
|
validator: import("../../../../es/components/form-render").FieldValidator;
|
|
439
435
|
pattern: import("../../../../es/components/form-render").FieldPatternTypes;
|
|
440
436
|
title: string;
|
|
441
437
|
form: import("../../../../es/components/form-render").Form<any>;
|
|
438
|
+
content: any;
|
|
442
439
|
componentProps: Record<string, any>;
|
|
443
440
|
decoratorProps: Record<string, any>;
|
|
441
|
+
display: import("../../../../es/components/form-render").FieldDisplayTypes;
|
|
444
442
|
description: string;
|
|
445
443
|
readOnly: boolean;
|
|
446
444
|
editable: boolean;
|
|
445
|
+
hidden: boolean;
|
|
447
446
|
component: import("../../../../es/components/form-render").FieldComponent<any, any>;
|
|
448
447
|
decorator: import("../../../../es/components/form-render").FieldDecorator<any, any>;
|
|
449
448
|
validating: boolean;
|
|
450
449
|
submitting: boolean;
|
|
450
|
+
active: boolean;
|
|
451
451
|
visited: boolean;
|
|
452
452
|
selfModified: boolean;
|
|
453
453
|
modified: boolean;
|
|
@@ -534,7 +534,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
534
534
|
};
|
|
535
535
|
readonly disabled: BooleanConstructor;
|
|
536
536
|
readonly displayDirective: {
|
|
537
|
-
readonly type: import("vue").PropType<"
|
|
537
|
+
readonly type: import("vue").PropType<"if" | "show" | "show:lazy">;
|
|
538
538
|
readonly default: "if";
|
|
539
539
|
};
|
|
540
540
|
readonly closable: {
|
|
@@ -559,7 +559,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
559
559
|
};
|
|
560
560
|
readonly disabled: BooleanConstructor;
|
|
561
561
|
readonly displayDirective: {
|
|
562
|
-
readonly type: import("vue").PropType<"
|
|
562
|
+
readonly type: import("vue").PropType<"if" | "show" | "show:lazy">;
|
|
563
563
|
readonly default: "if";
|
|
564
564
|
};
|
|
565
565
|
readonly closable: {
|
|
@@ -573,10 +573,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
573
573
|
}>>, {
|
|
574
574
|
readonly disabled: boolean;
|
|
575
575
|
readonly closable: boolean | undefined;
|
|
576
|
-
readonly displayDirective: "
|
|
576
|
+
readonly displayDirective: "if" | "show" | "show:lazy";
|
|
577
577
|
}>;
|
|
578
578
|
NTabs: any;
|
|
579
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
579
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("formChange" | "scroll" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
580
580
|
fieldList: {
|
|
581
581
|
type: import("vue").PropType<import("../../../../es/components/form-render").FieldItem[]>;
|
|
582
582
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,watch as r,createVNode as n,mergeProps as
|
|
1
|
+
import{defineComponent as e,computed as t,watch as r,createVNode as n,mergeProps as a}from"vue";import{generateTimeFormat as u}from"../../../../../shared/utils/index.js";import{connect as o,mapProps as i}from"@formily/vue";import{isObject as l}from"@vueuse/core";import{format as s}from"date-fns";import{useCommonInjection as m}from"../../hooks/useCommonInjection.js";import"../../utils/index.js";import d from"../../../../date-picker/index.js";import{assignUpdateValue as v,assignClearBindVisited as c}from"../../utils/schema.js";const f=o(e({props:{onChange:{},value:{type:String},validate:{type:Object},valueFormat:{type:String,default:"yyyy-MM-dd"}},emits:["update:value"],setup(e,{emit:o}){const{injectValueValidate:i,injectValueBindKey:v}=m();function c(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.min_date)}function f(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.max_date)}function p(e){return c()&&e<Date.now()-864e5||f()&&e>Date.now()}function D(e){const t=new Date(e),r=new Date,n=new Date(t);return n.setHours(0),n.setMinutes(0),n.setSeconds(0),{isHourDisabled:function(e){return!i()&&(c()&&e<u()||f()&&e>u())},isMinuteDisabled:function(e){if(i())return!1;if(a()===u())return c()&&e<o()||f()&&e>o();return c()&&a()<u()||f()&&a()>u()}};function a(){return t.getHours()}function u(){return r.getHours()}function o(){return r.getMinutes()}function i(){return n>r}}i((()=>e.value));const y=t((()=>{const t={};if(l(e.validate)){const{min_date:r,max_date:n}=e.validate;(r||n)&&(t.isDateDisabled=p,t.isTimeDisabled=D)}return t})),j=t((()=>({valueFormat:e.valueFormat,format:e.valueFormat,timePickerProps:{format:u(e.valueFormat)}})));function g(t){return t?s(new Date(t),e.valueFormat):t}r((()=>e.value),(e=>{e&&g(e)!==e&&o("update:value",g(e))}));const w=t({get:()=>g(e.value),set:e=>{o("update:value",e)}}),x=v(w);return()=>n(d,a({key:x.value},y.value,j.value,{"formatted-value":w.value,"onUpdate:formatted-value":e=>w.value=e}),null)}}),i(v,c));export{f as DATE};
|
|
@@ -87,10 +87,10 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
87
87
|
}>> & {
|
|
88
88
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
89
89
|
}, {
|
|
90
|
-
vertical: boolean;
|
|
91
90
|
options: AnyObject[];
|
|
92
91
|
lazyRequest: boolean;
|
|
93
92
|
requestCache: boolean;
|
|
93
|
+
vertical: boolean;
|
|
94
94
|
}>;
|
|
95
95
|
export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
96
96
|
value: {
|
|
@@ -179,8 +179,8 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
179
179
|
}>> & {
|
|
180
180
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
181
181
|
}, {
|
|
182
|
-
vertical: boolean;
|
|
183
182
|
options: AnyObject[];
|
|
184
183
|
lazyRequest: boolean;
|
|
185
184
|
requestCache: boolean;
|
|
185
|
+
vertical: boolean;
|
|
186
186
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,computed as a,inject as o,watch as r,createVNode as l,nextTick as n}from"vue";import{isEqual as i,isArray as u}from"lodash-es";import"../../../index.js";import{useCommonInjection as s}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as c,InjectionFormUUID as p}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import"@vueuse/core";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@formily/core";import"date-fns";import"@formily/reactive";import{connect as
|
|
1
|
+
import{defineComponent as e,ref as t,computed as a,inject as o,watch as r,createVNode as l,nextTick as n}from"vue";import{isEqual as i,isArray as u}from"lodash-es";import"../../../index.js";import{useCommonInjection as s}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as c,InjectionFormUUID as p}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import{NCascader as d}from"naive-ui";import"@vueuse/core";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@formily/core";import"date-fns";import"@formily/reactive";import{connect as v,mapProps as f}from"@formily/vue";import"@vue/shared";import"./index.js";import"../../hooks/useFormRenderOptions.js";import{createVisitedSetter as h,assignUpdateValue as y,traverseDependKey as j}from"../../utils/schema.js";const b=v(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:v,emit:f}){const y=t(),{field:b,title:k}=m(),C=a((()=>{var t,a;return null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:"text"})),g=a((()=>{var t,a;return null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:"value"})),A=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");return Array.isArray(t)&&t.length?t.map((e=>e[C.value])).join(" / "):null}catch(e){return null}}));function S(e,t,a){f("update:value",a.map((function(e){return{...e,label:e[C.value],children:void 0,parent:void 0}})))}const F=o(c);async function w(t){e.filterable?await async function(){if(!e.urlConfig||y.value&&e.requestCache)return;const t=await F.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:k.value,cache:e.requestCache});function a(e,t){const o={[C.value]:e[C.value],[g.value]:e[g.value],depth:t+1,isLeaf:!0};return u(e.children)&&(o.children=e.children.map((e=>a(e,t+1))),o.isLeaf=!e.children.length),o}y.value=t.map((e=>a(e,0)))}():await async function(t){if(r(e,t))return;const a=await F.addAsync(l(s(t),u(e),k.value,t));if(!a.length&&t)return t.isLeaf=!0,S(0,0,n(t)),void(K.value=!1);const o=a.map((e=>i(e,s(t))));function r(e,t){return!u(e)||!t&&y.value&&e.requestCache||s(t)>=s(e)-1}function l(t,a,o,r){const l={lvlnr:t+1+""};return r&&a.dependKey&&j(a.dependKey,((e,t)=>{l[t]=r[e]})),{params:l,...a,key:o,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function i(a,o){return{[C.value]:a[C.value],[g.value]:a[g.value],depth:o+1,parent:t,isLeaf:o+2>=s(e)}}function u(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=o:y.value=o}(t),await x()}const H=`form-render__cascade--menu-${o(p)}`;async function x(){await n();const e=document.querySelector(`.${H} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}const{injectValueValidate:L,injectValueWatchFromEmpty:q,injectValueBindKey:B}=s();q((()=>e.value),w),L((()=>e.value)),r((()=>e.urlConfig),(async(e,t)=>{i(e,t)||(y.value=null,await w())}));const K=t(!1);function V(e){K.value=!!e,e&&w()}const E=a((()=>y.value||e.options||[])),O=a((()=>!e.filterable)),W=B(A);return()=>l(d,{key:W.value,remote:O.value,filterable:e.filterable,"menu-props":{class:H,onClick:x},checkStrategy:"child",show:!!K.value,"onUpdate:show":V,value:A.value,"onUpdate:value":S,labelField:C.value,valueField:g.value,options:E.value,onLoad:w,onFocus:h(b)},v)}}),f({dataSource:"options"},y));export{b as SEARCH_CASCADER};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as o,inject as t,ref as a,createVNode as r}from"vue";import{useDebounceFn as l}from"@vueuse/core";import{cloneDeep as s,isString as i}from"lodash-es";import{useCommonInjection as n,useSelectOptionProps as u}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as p}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../../index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@formily/core";import"date-fns";import"@formily/reactive";import{connect as
|
|
1
|
+
import{defineComponent as e,computed as o,inject as t,ref as a,createVNode as r}from"vue";import{useDebounceFn as l}from"@vueuse/core";import{cloneDeep as s,isString as i}from"lodash-es";import{useCommonInjection as n,useSelectOptionProps as u}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as p}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../../index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import{NSelect as c}from"naive-ui";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@formily/core";import"date-fns";import"@formily/reactive";import{connect as d,mapProps as y}from"@formily/vue";import"@vue/shared";import"./index.js";import{useUrlConfigOptions as v,useAutographOptions as f,useRecommendOptions as h,searchContentMatcher as j}from"../../hooks/useFormRenderOptions.js";import{createVisitedSetter as b,assignUpdateValue as k,assignClearBindVisited as S}from"../../utils/schema.js";const g=d(e({name:"FormSelect",props:{value:{type:[String,Array]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},allowCreate:Boolean,urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},recommendNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1}},emits:["update:value","postRecommend"],setup(e,{slots:d,emit:y}){const k=o({get:()=>e.value,async set(e){y("update:value",e),C(e)}}),{labelKey:S,valueKey:g,fetchData:A,fullOptions:F,filterOptions:H}=e.urlConfig?v(e,k):f(e,k),{getRecommend:B,postRecommend:C,sortedOptions:x}=h(e,H,y,S,g),{field:O,fieldKey:R}=m();t(p).setContext(R.value,(e=>{return{currentOption:s((o=e,F.value.find((e=>e[g.value]===o))))};var o}));const L=a(""),V=l((async(e="")=>{L.value=e,A(e),B(e)}),300),{injectValueValidate:w,injectValueWatchFromEmpty:K,injectValueBindKey:P}=n();K(k,V),w(k);const W=P(k),{menuProps:q,nodeProps:I}=u();function N(e){const o=e[S.value];if(!o||!i(o))return"";const t=j(L.value,o);return t?r("section",null,[t.map(((e,o)=>0!==o&&e?r("span",{style:{color:o%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):o}const U=o((()=>x.value.length||!e.allowCreate?x.value:L.value?[{[S.value]:L.value,[g.value]:L.value},...x.value]:x.value));return()=>r(c,{key:W.value,remote:!0,filterable:!0,value:k.value,"onUpdate:value":e=>k.value=e,"menu-props":q,"node-props":I,labelField:S.value,valueField:g.value,options:U.value,onSearch:V,"onUpdate:show":e=>e&&V(),onFocus:b(O),renderLabel:N},d)}}),y({dataSource:"options"},k,S));export{g as SELECT};
|
|
@@ -2,7 +2,7 @@ export * from './useFieldListAdaptor';
|
|
|
2
2
|
export * from './useFormRequest';
|
|
3
3
|
export * from './useCommonLog';
|
|
4
4
|
export * from './useFormField';
|
|
5
|
-
export * from './
|
|
5
|
+
export * from './useFormAsyncQueue';
|
|
6
6
|
export * from './useFieldVisitor';
|
|
7
7
|
export * from './useFieldNormalize';
|
|
8
8
|
export * from './useFormValidator';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{useFieldListAdaptor}from"./useFieldListAdaptor.js";export{useFormRequest}from"./useFormRequest.js";export{useCommonLog}from"./useCommonLog.js";export{useFormField}from"./useFormField.js";export{
|
|
1
|
+
export{useFieldListAdaptor}from"./useFieldListAdaptor.js";export{useFormRequest}from"./useFormRequest.js";export{useCommonLog}from"./useCommonLog.js";export{useFormField}from"./useFormField.js";export{useFormAsyncQueue}from"./useFormAsyncQueue.js";export{useFieldVisitor}from"./useFieldVisitor.js";export{useFieldNormalize}from"./useFieldNormalize.js";export{useFormValidator,validateMessageLocale}from"./useFormValidator.js";export{BusinessCollector,useBusinessBinding}from"./useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./useChangeContext.js";export{FormItemDepsCollector,useFormItemDeps}from"./useFormItemDeps.js";export{useAnchor}from"./useAnchor.js";export{useFormContext}from"./useFormContext.js";export{useCommonInjection,useSelectOptionProps}from"./useCommonInjection.js";export{searchContentMatcher,useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./useFormRenderOptions.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AsyncQueue } from '../../../../../es/shared/hooks';
|
|
2
|
+
import { AnyObject, UndefinedAble } from '../../../../../es/shared/types';
|
|
3
|
+
import { ComputedRef } from 'vue';
|
|
4
|
+
import { FormAsyncQueueItem } from '../types';
|
|
5
|
+
import { RequestInstance } from '../../../../../es/components/form-render';
|
|
6
|
+
declare type ProcessorOption = Partial<{
|
|
7
|
+
afterRequest(key: string, payload?: unknown): AnyObject[];
|
|
8
|
+
beforeRequest(key: string, params?: unknown): UndefinedAble<AnyObject> | void;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function useFormAsyncQueue(requestInstance: ComputedRef<UndefinedAble<RequestInstance>>): {
|
|
11
|
+
create: (parallelism?: number, option?: ProcessorOption) => AsyncQueue<FormAsyncQueueItem, any, {
|
|
12
|
+
label: string;
|
|
13
|
+
value: unknown;
|
|
14
|
+
}[]>;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{uuidGenerator as e}from"../../../../shared/utils/index.js";import{isFunction as r}from"lodash-es";import"naive-ui";import{unref as t}from"vue";import"@vueuse/core";import{AsyncQueue as o}from"../../../../shared/hooks/useAsyncQueue.js";import"../../index.js";import{useCommonLog as s}from"./useCommonLog.js";import{useFormRequest as n}from"./useFormRequest.js";function u(u){const{getHttpInstance:a}=n();return{create:function(n=3,i){return new o({name:"FormRenderAsyncQueue",parallelism:n,async processor({key:e,method:o="post",cache:n,params:m,url:c},p,f){var l,d;const h=null!=(l=t(u))?l:a();if(!h)return s().invalidHttpInstanceLog(),p(),void f();try{i&&r(i.beforeRequest)&&(m=null!=(d=i.beforeRequest(e,m))?d:{});let t=await h[o](c,m);i&&r(i.afterRequest)&&(t=i.afterRequest(e,t)),p(void 0,Array.isArray(t)?t:[]),!n&&f()}catch(e){p(new Error(`Request error => ${e}`)),f()}},getKey:({url:r,method:t="post",cache:o,params:s})=>o?r+t+JSON.stringify(s||{}):e()})}}}export{u as useFormAsyncQueue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{uuidGenerator as e}from"../../../../shared/utils/index.js";import{createSchemaField as o}from"@formily/vue";import{isObject as t}from"@vue/shared";import{cloneDeep as r}from"lodash-es";import{computed as s,provide as n,readonly as i}from"vue";import"../../index.js";import m from"../components/renderer/index.js";import{InjectionAsyncQueue as a,InjectionSchemaField as u,InjectionBusinessCollector as p,InjectionChangeContextCollector as c,InjectionFormItemDepsCollector as l,InjectionFormUUID as f,InjectionAnnotation as d}from"../constants/index.js";import{useFormRenderLifeCycle as j}from"./useFormRenderLifeCycle.js";import{usePresetScope as y}from"./usePresetScope.js";import{injectOrProvide as C,presetRequestHandler as h}from"../utils/index.js";import{
|
|
1
|
+
import{uuidGenerator as e}from"../../../../shared/utils/index.js";import{createSchemaField as o}from"@formily/vue";import{isObject as t}from"@vue/shared";import{cloneDeep as r}from"lodash-es";import{computed as s,provide as n,readonly as i}from"vue";import"../../index.js";import m from"../components/renderer/index.js";import{InjectionAsyncQueue as a,InjectionSchemaField as u,InjectionBusinessCollector as p,InjectionChangeContextCollector as c,InjectionFormItemDepsCollector as l,InjectionFormUUID as f,InjectionAnnotation as d}from"../constants/index.js";import{useFormRenderLifeCycle as j}from"./useFormRenderLifeCycle.js";import{usePresetScope as y}from"./usePresetScope.js";import{injectOrProvide as C,presetRequestHandler as h}from"../utils/index.js";import{useFormAsyncQueue as x}from"./useFormAsyncQueue.js";import{useBusinessBinding as g}from"./useBusinessBinding.js";import{useChangeContext as v}from"./useChangeContext.js";import{useFormItemDeps as F}from"./useFormItemDeps.js";function b(b,q){const{callLifeCycle:R}=j(b),I=C(a,(()=>x(s((()=>b.requestInstance))).create(b.parallelism,{beforeRequest:(...e)=>R("beforeRequest",r(e))||e[1],afterRequest:(...e)=>R("afterRequest",r(e))||h(e[1])}))),D=C(u,(()=>o({components:{...m,...b.components},scope:Object.assign({},y(),b.scope)}).SchemaField)),S=g().create(b.businessFormatter);n(p,S);const B=v().create();n(c,B);const L=F().create();n(l,L);const Q=b.uuid||e();return n(f,Q),n(d,s({get:()=>b.annotation?i(b.annotation):null,set(e){if(!t(b.annotation)||!t(e))return;const o=b.annotation[e.property];b.annotation[e.property]=e.value,q("annotationChange",{fieldKey:e.property,value:e.value,oldValue:o})}})),{asyncQueue:I,SchemaField:D,businessCollector:S,changeContextCollector:B,formItemDepsCollector:L,formUUID:Q}}export{b as useFormContext};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AsyncQueue } from '../../../../../es/shared/hooks';
|
|
1
2
|
import { AnyObject, UndefinedAble } from '../../../../../es/shared/types';
|
|
2
3
|
import { LOW_CODE_VALUE_RELATION } from '../../../../../es/shared/utils';
|
|
3
4
|
import { DataField, Field, Form } from '@formily/core';
|
|
@@ -5,7 +6,7 @@ import { ISchema } from '@formily/json-schema/esm/types';
|
|
|
5
6
|
import { Component, FunctionalComponent } from 'vue';
|
|
6
7
|
import { FIELD_BUSINESS_TYPE } from '../../../../../es/components/form-render/src/constants';
|
|
7
8
|
import { FieldItem } from '../types';
|
|
8
|
-
import {
|
|
9
|
+
import { RequestInstance } from '../hooks';
|
|
9
10
|
export * from './fieldItem';
|
|
10
11
|
export declare type FormCommonState = '0' | '1';
|
|
11
12
|
export interface FieldVisitorContext {
|