cnhis-design-vue 3.3.1-beta.3 → 3.3.1-beta.44
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/ai-chat/index.d.ts +289 -68
- package/es/components/ai-chat/src/Index.vue.d.ts +289 -68
- package/es/components/ai-chat/src/Index.vue2.js +1 -1
- package/es/components/ai-chat/src/api/index.d.ts +5 -3
- package/es/components/ai-chat/src/api/index.js +1 -1
- package/es/components/ai-chat/src/components/ChatAudio.vue.d.ts +9 -15
- package/es/components/ai-chat/src/components/ChatAudio.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatBI.vue.d.ts +2 -2
- package/es/components/ai-chat/src/components/ChatBI.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatCard.js +1 -1
- package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +46 -55
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/src/components/ChatMainDefault.js +1 -0
- package/es/components/ai-chat/src/components/ChatPatient.vue.d.ts +2 -2
- package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatPrompt.vue.d.ts +2 -2
- package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatRight.vue.d.ts +6 -5
- package/es/components/ai-chat/src/components/ChatRight.vue2.js +1 -1
- package/es/components/ai-chat/src/components/card/JsonCard.js +1 -1
- package/es/components/ai-chat/src/components/{card/SelectIcon.d.ts → message-render/CardRender.d.ts} +9 -7
- package/es/components/ai-chat/src/components/message-render/CardRender.js +1 -0
- package/es/components/ai-chat/src/components/message-render/FormRender.d.ts +16 -0
- package/es/components/ai-chat/src/components/message-render/FormRender.js +1 -0
- package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue.d.ts +36 -0
- package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue.js +1 -0
- package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue2.js +1 -0
- package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue.d.ts +105 -0
- package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue.js +1 -0
- package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue2.js +1 -0
- package/es/components/ai-chat/src/components/svgs/AddIcon.vue.js +1 -0
- package/es/components/ai-chat/src/components/svgs/AudioIcon.vue.js +1 -0
- package/es/components/ai-chat/src/components/svgs/KeyboardIcon.vue.js +1 -0
- package/es/components/ai-chat/src/components/svgs/MicroPhone.vue.js +1 -0
- package/es/components/ai-chat/src/hooks/index.d.ts +2 -0
- package/es/components/ai-chat/src/hooks/index.js +1 -0
- package/es/components/ai-chat/src/hooks/useChartAudioContext.d.ts +18 -0
- package/es/components/ai-chat/src/hooks/useChartAudioContext.js +1 -0
- package/es/components/ai-chat/src/hooks/useData.d.ts +77 -0
- package/es/components/ai-chat/src/hooks/useData.js +1 -0
- package/es/components/ai-chat/src/hooks/useFooterContext.d.ts +38 -0
- package/es/components/ai-chat/src/hooks/useFooterContext.js +1 -0
- package/es/components/ai-chat/src/hooks/useProgram.d.ts +12 -4
- package/es/components/ai-chat/src/hooks/useProgram.js +1 -1
- package/es/components/ai-chat/src/hooks/useSSE.d.ts +9 -0
- package/es/components/ai-chat/src/hooks/useSSE.js +1 -0
- package/es/components/ai-chat/src/hooks/useWebsocket.d.ts +3 -1
- package/es/components/ai-chat/src/hooks/useWebsocket.js +1 -1
- package/es/components/ai-chat/src/types/index.d.ts +1 -3
- package/es/components/ai-chat/src/types/index.js +1 -1
- package/es/components/ai-chat/src/utils/index.d.ts +6 -1
- package/es/components/ai-chat/src/utils/index.js +1 -1
- package/es/components/ai-chat/style/index.css +1 -1
- package/es/components/audio-sdk/index.d.ts +274 -2
- package/es/components/audio-sdk/index.js +1 -1
- package/es/components/audio-sdk/src/Index.vue.d.ts +274 -0
- package/es/components/audio-sdk/src/Index.vue.js +1 -0
- package/es/components/audio-sdk/src/Index.vue2.js +1 -0
- package/es/components/audio-sdk/src/audioSDK.d.ts +59 -26
- package/es/components/audio-sdk/src/audioSDK.js +1 -1
- package/es/components/audio-sdk/src/components/form.vue.d.ts +51 -0
- package/es/components/audio-sdk/src/components/recording-modal.vue.d.ts +100 -0
- package/es/components/audio-sdk/src/components/recording-modal.vue.js +1 -0
- package/es/components/audio-sdk/src/components/recording-modal.vue2.js +1 -0
- package/es/components/audio-sdk/src/components/recording.vue.d.ts +53 -4
- package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
- package/es/components/audio-sdk/src/utils/index.d.ts +7 -0
- package/es/components/audio-sdk/src/utils/index.js +1 -0
- package/es/components/audio-sdk/src/utils/recordingModal.d.ts +7 -4
- package/es/components/audio-sdk/src/utils/recordingModal.js +1 -1
- package/es/components/audio-sdk/style/index.css +1 -1
- package/es/components/button-print/index.d.ts +30 -0
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +30 -0
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +9 -0
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +9 -0
- package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
- package/es/components/button-print/src/utils/print.d.ts +2 -2
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/calendar/index.d.ts +126 -3
- package/es/components/calendar/src/Calendar.vue.d.ts +126 -2
- package/es/components/callback/src/components/render/popupMaps.d.ts +7 -1
- package/es/components/card-reader-sdk/src/cardReaderSDK.d.ts +4 -8
- package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
- package/es/components/card-render/src/components/Button.vue.d.ts +3 -0
- package/es/components/card-render/src/components/Button.vue2.js +1 -1
- package/es/components/card-render/src/components/ScaleView.vue.d.ts +39 -0
- package/es/components/card-render/src/components/ScaleView.vue.js +1 -0
- package/es/components/card-render/src/components/ScaleView.vue2.js +1 -0
- package/es/components/card-render/src/components/Table.vue.d.ts +104 -0
- package/es/components/card-render/src/components/Table.vue.js +1 -0
- package/es/components/card-render/src/components/Table.vue2.js +1 -0
- package/es/components/card-render/src/components/Text.vue.d.ts +1 -0
- package/es/components/card-render/src/components/Text.vue2.js +1 -1
- package/es/components/card-render/src/components/index.d.ts +139 -0
- package/es/components/card-render/src/components/index.js +1 -1
- package/es/components/card-render/src/constants/index.d.ts +4 -1
- package/es/components/card-render/src/constants/index.js +1 -1
- package/es/components/card-render/style/index.css +1 -1
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/fabric-chart/index.d.ts +6 -2
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +6 -2
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/field-editor/index.d.ts +7 -1
- package/es/components/field-editor/src/FieldEditor.vue.d.ts +7 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/components/form-config/index.d.ts +73 -13
- package/es/components/form-config/src/FormConfig.vue.d.ts +73 -13
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +7 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +45 -9
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +15 -3
- package/es/components/form-render/index.d.ts +7 -1
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +7 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +7 -1
- package/es/components/form-render/src/components/renderer/date.d.ts +4 -2
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.d.ts +2 -0
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/renderer/input.d.ts +5 -0
- package/es/components/form-render/src/components/renderer/input.js +1 -1
- package/es/components/form-render/src/components/renderer/levelSearchCascader/index.d.ts +9 -0
- package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +14 -1
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +14 -1
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +5 -0
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/components/tooltipMessage.vue.d.ts +12 -1
- package/es/components/form-render/src/components/tooltipMessage.vue2.js +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +4 -0
- package/es/components/form-render/src/hooks/useLowCodeReactions.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +9 -3
- package/es/components/form-render/src/types/index.d.ts +2 -0
- package/es/components/form-render/src/utils/index.d.ts +1 -0
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/form-render/style/index.css +1 -1
- package/es/components/guide/src/renderer.d.ts +2 -2
- package/es/components/iho-chat/index.d.ts +206 -4
- package/es/components/iho-chat/src/Index.vue.d.ts +206 -4
- package/es/components/iho-chat/src/api/index.d.ts +1 -0
- package/es/components/iho-chat/src/api/index.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +8 -0
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +11 -3
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +7 -0
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +96 -2
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +77 -0
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +71 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +8 -2
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +10 -0
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MessageMergeForward.vue.d.ts +70 -1
- package/es/components/iho-chat/src/components/MessageMergeForward.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +7 -0
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +3 -0
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +3 -1
- package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/iho-chat/src/constants/index.d.ts +9 -2
- package/es/components/iho-chat/src/constants/index.js +1 -1
- package/es/components/iho-chat/src/hooks/useSearchPatientList.d.ts +11 -0
- package/es/components/iho-chat/src/hooks/useSearchPatientList.js +1 -0
- package/es/components/iho-chat/src/utils/chatSock.js +1 -1
- package/es/components/iho-chat/src/utils/index.d.ts +6 -0
- package/es/components/iho-chat/src/utils/index.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/index.d.ts +3 -0
- package/es/components/iho-table/index.js +1 -1
- package/es/components/iho-table/src/IhoTable.vue2.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 -3
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
- package/es/components/iho-table/src/hooks/useTablePlugin.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/headerPlugin/index.d.ts +1 -1
- package/es/components/iho-table/src/plugins/headerPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/highLightSetPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/index.d.ts +79 -3
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.d.ts +7 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.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 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/stickyFixedPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +1 -0
- package/es/components/iho-table/src/types/pluginType.d.ts +2 -2
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +24 -2
- package/es/components/info-header/src/InfoHeader.vue.d.ts +24 -2
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +2 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +2 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +9 -1
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +7 -1
- package/es/components/scale-view/index.d.ts +17 -3
- package/es/components/scale-view/src/ScaleView.vue.d.ts +17 -3
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +1 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-init.d.ts +3 -1
- package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-props.d.ts +4 -0
- package/es/components/scale-view/src/hooks/scaleview-props.js +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +1 -2189
- package/es/components/shortcut-provider/src/ShortcutProvider.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +15 -3
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +15 -3
- package/es/components/steps-wheel/index.d.ts +18 -0
- package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +18 -0
- package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
- package/es/shared/assets/img/use.png.js +1 -1
- package/es/shared/components/ArrowIcon/ArrowIcon.vue.js +1 -0
- package/es/shared/components/ArrowIcon/index.d.ts +2 -0
- package/es/shared/components/ArrowIcon/index.js +1 -0
- package/es/shared/components/DateIcon/DateIcon.vue.js +1 -0
- package/es/shared/components/DateIcon/index.d.ts +2 -0
- package/es/shared/components/DateIcon/index.js +1 -0
- package/es/shared/hooks/useLevelSearchCascader.d.ts +1 -0
- package/es/shared/hooks/useLevelSearchCascader.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +5 -3
- package/es/components/ai-chat/src/components/ChatMainInner.js +0 -1
- package/es/components/ai-chat/src/components/card/SelectIcon.js +0 -1
- /package/es/components/ai-chat/src/components/{ChatMainInner.d.ts → ChatMainDefault.d.ts} +0 -0
@@ -98,7 +98,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
98
98
|
placeholder?: string | undefined;
|
99
99
|
validate?: Partial<{
|
100
100
|
[key: string]: any;
|
101
|
-
obj_type: "password" | "sex" | "age" | "email" | "
|
101
|
+
obj_type: "password" | "sex" | "age" | "email" | "mobile" | "birthday" | "id_card" | "age_unit" | "telephone" | "bank_card" | "website" | "gestational_weeks" | "gestational_stage" | "customer_name";
|
102
102
|
vali_obj: string;
|
103
103
|
max_value: string | number;
|
104
104
|
min_value: string | number;
|
@@ -150,6 +150,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
150
150
|
extendKey?: string | undefined;
|
151
151
|
is_not_fold?: string | undefined;
|
152
152
|
remark?: string | undefined;
|
153
|
+
remarkTo?: string | HTMLElement | undefined;
|
153
154
|
free_entry?: import("../../../../components/form-render").FormCommonState | undefined;
|
154
155
|
save_free_entry?: import("../../../../components/form-render").FormCommonState | undefined;
|
155
156
|
initialize_high?: number | undefined;
|
@@ -190,7 +191,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
190
191
|
wrapperStyle?: Record<string, string | number> | undefined;
|
191
192
|
childFieldStrategy?: "checked" | "all" | undefined;
|
192
193
|
childWidthMode?: "inner" | "outer" | undefined;
|
193
|
-
validator?: ((value: unknown, fieldItem: import("../../../../components/form-render").FieldItem,
|
194
|
+
validator?: ((value: unknown, fieldItem: import("../../../../components/form-render").FieldItem, context: {
|
195
|
+
field: import("@formily/core").Field<any, any, any, any>;
|
196
|
+
form: import("@formily/core").Form<any>;
|
197
|
+
value: unknown;
|
198
|
+
validator: import("../../../../shared/types").AnyFn;
|
199
|
+
}) => string | void) | undefined;
|
194
200
|
reactions?: import("../../../../shared/types").ArrayAble<import("../../../../components/form-render").ReactionType> | undefined;
|
195
201
|
}[];
|
196
202
|
removeSetValueField: (item: LowCodeTypes.reactionConfig, index: number) => void;
|
@@ -428,6 +434,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
428
434
|
fixMemoLeak: {
|
429
435
|
type: BooleanConstructor;
|
430
436
|
};
|
437
|
+
lazyRender: BooleanConstructor;
|
431
438
|
}, {
|
432
439
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
433
440
|
fieldList: {
|
@@ -630,6 +637,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
630
637
|
fixMemoLeak: {
|
631
638
|
type: BooleanConstructor;
|
632
639
|
};
|
640
|
+
lazyRender: BooleanConstructor;
|
633
641
|
}>> & {
|
634
642
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
635
643
|
onScroll?: ((...args: any[]) => any) | undefined;
|
@@ -804,6 +812,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
804
812
|
linebarTextDirection: "horizontal" | "vertical";
|
805
813
|
autoWidth: number | boolean;
|
806
814
|
feedbackType: "default" | "tooltip";
|
815
|
+
fixMemoLeak: boolean;
|
816
|
+
lazyRender: boolean;
|
807
817
|
}>) => Record<string, import("@formily/json-schema").Stringify<{
|
808
818
|
[key: symbol]: any;
|
809
819
|
[key: `x-${string}`]: any;
|
@@ -1190,6 +1200,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1190
1200
|
fixMemoLeak: {
|
1191
1201
|
type: BooleanConstructor;
|
1192
1202
|
};
|
1203
|
+
lazyRender: BooleanConstructor;
|
1193
1204
|
}>> & {
|
1194
1205
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
1195
1206
|
onScroll?: ((...args: any[]) => any) | undefined;
|
@@ -1221,9 +1232,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
1221
1232
|
linebarTextDirection: "horizontal" | "vertical";
|
1222
1233
|
autoWidth: number | boolean;
|
1223
1234
|
feedbackType: "default" | "tooltip";
|
1235
|
+
fixMemoLeak: boolean;
|
1236
|
+
lazyRender: boolean;
|
1224
1237
|
operationalFormInit: boolean;
|
1225
1238
|
incrementalRender: boolean;
|
1226
|
-
fixMemoLeak: boolean;
|
1227
1239
|
}>;
|
1228
1240
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
1229
1241
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "validateFailure")[], "update:modelValue" | "validateFailure", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -209,6 +209,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
209
209
|
fixMemoLeak: {
|
210
210
|
type: BooleanConstructor;
|
211
211
|
};
|
212
|
+
lazyRender: BooleanConstructor;
|
212
213
|
}, {
|
213
214
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
214
215
|
fieldList: {
|
@@ -411,6 +412,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
411
412
|
fixMemoLeak: {
|
412
413
|
type: BooleanConstructor;
|
413
414
|
};
|
415
|
+
lazyRender: BooleanConstructor;
|
414
416
|
}>> & {
|
415
417
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
416
418
|
onScroll?: ((...args: any[]) => any) | undefined;
|
@@ -585,6 +587,8 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
585
587
|
linebarTextDirection: "horizontal" | "vertical";
|
586
588
|
autoWidth: number | boolean;
|
587
589
|
feedbackType: "default" | "tooltip";
|
590
|
+
fixMemoLeak: boolean;
|
591
|
+
lazyRender: boolean;
|
588
592
|
}>) => Record<string, import("@formily/json-schema").Stringify<{
|
589
593
|
[key: symbol]: any;
|
590
594
|
[key: `x-${string}`]: any;
|
@@ -971,6 +975,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
971
975
|
fixMemoLeak: {
|
972
976
|
type: BooleanConstructor;
|
973
977
|
};
|
978
|
+
lazyRender: BooleanConstructor;
|
974
979
|
}>> & {
|
975
980
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
976
981
|
onScroll?: ((...args: any[]) => any) | undefined;
|
@@ -1002,9 +1007,10 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
1002
1007
|
linebarTextDirection: "horizontal" | "vertical";
|
1003
1008
|
autoWidth: number | boolean;
|
1004
1009
|
feedbackType: "default" | "tooltip";
|
1010
|
+
fixMemoLeak: boolean;
|
1011
|
+
lazyRender: boolean;
|
1005
1012
|
operationalFormInit: boolean;
|
1006
1013
|
incrementalRender: boolean;
|
1007
|
-
fixMemoLeak: boolean;
|
1008
1014
|
}>;
|
1009
1015
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
1010
1016
|
export default FormRender;
|
@@ -1 +1 @@
|
|
1
|
-
import{COMPONENT_NAMESPACE as e}from"../../shared/global/variable.js";import{safeComponentRegister as o}from"../../shared/utils/index.js";import s from"./src/FormRenderWrapper.vue.js";export{useAnchor}from"./src/hooks/useAnchor.js";export{BusinessCollector,useBusinessBinding}from"./src/hooks/useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./src/hooks/useChangeContext.js";export{useCommonInjection,useSelectOptionProps}from"./src/hooks/useCommonInjection.js";export{useCommonLog}from"./src/hooks/useCommonLog.js";export{useComplexOptions,useComplexOptionsSpan}from"./src/hooks/useComplexOptions.js";export{useFieldListAdaptor}from"./src/hooks/useFieldListAdaptor.js";export{useFieldNormalize}from"./src/hooks/useFieldNormalize.js";export{useFieldVisitor}from"./src/hooks/useFieldVisitor.js";export{useFormContext}from"./src/hooks/useFormContext.js";export{useFormDomEvent,useFormExposeEvent}from"./src/hooks/useFormEvent.js";export{useFormField}from"./src/hooks/useFormField.js";export{useFormGraph}from"./src/hooks/useFormGraph.js";export{FormItemDepsCollector,useFormItemDeps}from"./src/hooks/useFormItemDeps.js";export{useFormRenderLifeCycle}from"./src/hooks/useFormRenderLifeCycle.js";export{useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./src/hooks/useFormRenderOptions.js";export{useFormValidator,validateMessageLocale}from"./src/hooks/useFormValidator.js";export{useLowCodeEvent}from"./src/hooks/useLowCodeEvent.js";export{useLowCodeReactions}from"./src/hooks/useLowCodeReactions.js";export{useNuiThemeOverrides}from"./src/hooks/useNuiThemeOverrides.js";export{useOperationalForm}from"./src/hooks/useOperationalForm.js";export{usePresetScope}from"./src/hooks/usePresetScope.js";export{useWordbookSetting,wordbookSettingHandler}from"./src/hooks/useWordbookSetting.js";export{useNewLowCodeReactions}from"./src/hooks/useNewLowCodeReactions.js";export{useSelectedSetting}from"./src/hooks/useSelectedSetting.js";export{FieldListFilter,combineExtendKey,createInputSlot,createSlot,editorUnescape,findItemByValCondition,formRenderLog,getAbsoluteKey,injectOrProvide,isEnter,isNegative,isNestedFieldType,isNestedType,isPositive,mergeDeepProperties,parseEnhanceText,parseNumberFromMaybeString,renderDescOption,renderOptionLabel,replace2Any,splitExtendKey,validateMessageParser}from"./src/utils/index.js";export{businessDateParser,isForeignerID,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,createFieldAddressId,createLinebarId,createObjSchema,createVisitedSetter,dotEscape,fieldKeyEscape,getParentLinebar,traverseDependKey,traverseSchema}from"./src/utils/schema.js";const r=s;r.install=function(s){o(s,r,e+"FormRender")};export{r as default};
|
1
|
+
import{COMPONENT_NAMESPACE as e}from"../../shared/global/variable.js";import{safeComponentRegister as o}from"../../shared/utils/index.js";import s from"./src/FormRenderWrapper.vue.js";export{useAnchor}from"./src/hooks/useAnchor.js";export{BusinessCollector,useBusinessBinding}from"./src/hooks/useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./src/hooks/useChangeContext.js";export{useCommonInjection,useSelectOptionProps}from"./src/hooks/useCommonInjection.js";export{useCommonLog}from"./src/hooks/useCommonLog.js";export{useComplexOptions,useComplexOptionsSpan}from"./src/hooks/useComplexOptions.js";export{useFieldListAdaptor}from"./src/hooks/useFieldListAdaptor.js";export{useFieldNormalize}from"./src/hooks/useFieldNormalize.js";export{useFieldVisitor}from"./src/hooks/useFieldVisitor.js";export{useFormContext}from"./src/hooks/useFormContext.js";export{useFormDomEvent,useFormExposeEvent}from"./src/hooks/useFormEvent.js";export{useFormField}from"./src/hooks/useFormField.js";export{useFormGraph}from"./src/hooks/useFormGraph.js";export{FormItemDepsCollector,useFormItemDeps}from"./src/hooks/useFormItemDeps.js";export{useFormRenderLifeCycle}from"./src/hooks/useFormRenderLifeCycle.js";export{useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./src/hooks/useFormRenderOptions.js";export{useFormValidator,validateMessageLocale}from"./src/hooks/useFormValidator.js";export{useLowCodeEvent}from"./src/hooks/useLowCodeEvent.js";export{useLowCodeReactions}from"./src/hooks/useLowCodeReactions.js";export{useNuiThemeOverrides}from"./src/hooks/useNuiThemeOverrides.js";export{useOperationalForm}from"./src/hooks/useOperationalForm.js";export{usePresetScope}from"./src/hooks/usePresetScope.js";export{useWordbookSetting,wordbookSettingHandler}from"./src/hooks/useWordbookSetting.js";export{useNewLowCodeReactions}from"./src/hooks/useNewLowCodeReactions.js";export{useSelectedSetting}from"./src/hooks/useSelectedSetting.js";export{FieldListFilter,combineExtendKey,createInputSlot,createSlot,editorUnescape,findItemByValCondition,formRenderLog,getAbsoluteKey,injectOrProvide,isEnter,isNegative,isNestedFieldType,isNestedType,isPositive,isValidWidgetCombination,mergeDeepProperties,parseEnhanceText,parseNumberFromMaybeString,renderDescOption,renderOptionLabel,replace2Any,splitExtendKey,validateMessageParser}from"./src/utils/index.js";export{businessDateParser,isForeignerID,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,createFieldAddressId,createLinebarId,createObjSchema,createVisitedSetter,dotEscape,fieldKeyEscape,getParentLinebar,traverseDependKey,traverseSchema}from"./src/utils/schema.js";const r=s;r.install=function(s){o(s,r,e+"FormRender")};export{r as default};
|
@@ -204,6 +204,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
204
204
|
fixMemoLeak: {
|
205
205
|
type: BooleanConstructor;
|
206
206
|
};
|
207
|
+
lazyRender: BooleanConstructor;
|
207
208
|
}, {
|
208
209
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
209
210
|
fieldList: {
|
@@ -406,6 +407,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
406
407
|
fixMemoLeak: {
|
407
408
|
type: BooleanConstructor;
|
408
409
|
};
|
410
|
+
lazyRender: BooleanConstructor;
|
409
411
|
}>> & {
|
410
412
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
411
413
|
onScroll?: ((...args: any[]) => any) | undefined;
|
@@ -580,6 +582,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
580
582
|
linebarTextDirection: "horizontal" | "vertical";
|
581
583
|
autoWidth: number | boolean;
|
582
584
|
feedbackType: "default" | "tooltip";
|
585
|
+
fixMemoLeak: boolean;
|
586
|
+
lazyRender: boolean;
|
583
587
|
}>) => Record<string, import("@formily/vue").Stringify<{
|
584
588
|
[key: symbol]: any;
|
585
589
|
[key: `x-${string}`]: any;
|
@@ -966,6 +970,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
966
970
|
fixMemoLeak: {
|
967
971
|
type: BooleanConstructor;
|
968
972
|
};
|
973
|
+
lazyRender: BooleanConstructor;
|
969
974
|
}>> & {
|
970
975
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
971
976
|
onScroll?: ((...args: any[]) => any) | undefined;
|
@@ -997,8 +1002,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
997
1002
|
linebarTextDirection: "horizontal" | "vertical";
|
998
1003
|
autoWidth: number | boolean;
|
999
1004
|
feedbackType: "default" | "tooltip";
|
1005
|
+
fixMemoLeak: boolean;
|
1006
|
+
lazyRender: boolean;
|
1000
1007
|
operationalFormInit: boolean;
|
1001
1008
|
incrementalRender: boolean;
|
1002
|
-
fixMemoLeak: boolean;
|
1003
1009
|
}>;
|
1004
1010
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as o,provide as t,computed as r,nextTick as a,onBeforeUnmount as s,openBlock as i,createBlock as l,unref as n,mergeProps as m,withCtx as p,createElementBlock as d,createVNode as u,isRef as c,Fragment as f,renderList as h,createCommentVNode as y,createElementVNode as g,normalizeStyle as v,toDisplayString as b,renderSlot as j}from"vue";import{useTheme as k}from"../../../shared/hooks/useTheme.js";import{useElementSize as C}from"@vueuse/core";import"date-fns";import{isNumber as F,cloneDeep as S}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NForm as x,NTabs as w,NTabPane as L,NConfigProvider as B}from"naive-ui";import{useVersion as A}from"../../../shared/hooks/useVersion.js";import"../../../shared/hooks/useScrollLoading.js";import{createForm as R,onFormMount as H,onFieldValueChange as O,onFieldMount as T,onFieldUnmount as I,onFieldReact as V}from"@formily/core";import{Path as N}from"@formily/path";import{FormProvider as _,FormConsumer as D}from"@formily/vue";import{InjectionFormColumnWidth as W,InjectionFormLifeCycleCaller as U,InjectionFormGraph as E}from"./constants/index.js";import"./components/renderer/text.js";import"./utils/business.js";import{createObjSchema as M}from"./utils/schema.js";import{useAnchor as q}from"./hooks/useAnchor.js";import"../index.js";import{useComplexOptionsSpan as P}from"./hooks/useComplexOptions.js";import{useFieldListAdaptor as G}from"./hooks/useFieldListAdaptor.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{useFieldVisitor as K}from"./hooks/useFieldVisitor.js";import{useFormContext as z}from"./hooks/useFormContext.js";import{useFormDomEvent as J,useFormExposeEvent as Q}from"./hooks/useFormEvent.js";import{useFormGraph as $}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as X}from"./hooks/useFormRenderLifeCycle.js";import{validateMessageLocale as Y}from"./hooks/useFormValidator.js";import{useLowCodeEvent as Z}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as ee}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as oe}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as te}from"./hooks/useOperationalForm.js";import{useWordbookSetting as re}from"./hooks/useWordbookSetting.js";import{useNewLowCodeReactions as ae}from"./hooks/useNewLowCodeReactions.js";import{GlobalState as se}from"@formily/core/esm/shared/constants";const ie={key:0,style:{height:"54px"}},le={style:{"white-space":"pre"}};var ne=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:5},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},annotationShortcuts:{type:Array},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},autoExpand:Boolean,lowCodeReactions:{type:Array},newLowCodeReactions:{type:Array},operationalForm:{type:Array},dateOperationalForm:{type:Object},operationalFormInit:{type:Boolean,default:!0},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},labelPlacementOverwrite:Boolean,outBordered:{type:Boolean,default:!1},uniqueCacheData:{type:Boolean,default:!1},forceClearable:Boolean,wordSplitFilter:{type:Boolean,default:!0},selectMode:Boolean,selectedFields:{type:Array},linebarDirection:{type:String,default:"vertical"},linebarTextDirection:{type:String,default:"horizontal"},linebarWidth:{type:[Number,String],default:120},autoWidth:{type:[Boolean,Number],default:!1},incrementalRender:{type:Boolean,default:!1},feedbackType:{type:String,default:"default"},fixMemoLeak:{type:Boolean}},emits:["formChange","annotationChange","scroll","update:selectedFields","linebarChange","ready"],setup(e,{expose:ne,emit:me}){const pe=e,de=k(),{nuiThemeOverrides:ue}=oe();Y();const ce=o(),{width:fe}=C(ce);t(W,r((()=>fe.value?(fe.value-16*(pe.column-1))/24:0)));const he=r((()=>F(pe.maxHeight)?pe.maxHeight+"px":pe.maxHeight)),{SchemaField:ye,businessCollector:ge,formItemDepsCollector:ve,changeContextCollector:be,asyncQueue:je,formUUID:ke}=z(pe,me),{anchorBarRef:Ce,currentAnchor:Fe,updateAnchorList:Se,anchorIdList:xe,onScroll:we,generateAnchorList:Le}=q(pe,me,ce,ve),{callLifeCycle:Be}=X(pe);t(U,Be),Be("onSetup");const{observeFormGraph:Ae,setGraph:Re,removeGraph:He}=$();t(E,Ae);const{lowCodeEventTrigger:Oe}=Z(),Te=o(!0),Ie=R({initialValues:pe.initialData,effects(e){const o={};H((()=>{Object.assign(o,S(e.values))})),O("*",(t=>{const r=N.getIn(o,t.path);N.setIn(o,t.path,t.value);const a=t.props.name.toString();ge.trigger(e,a),ve.trigger(t.path),Te.value&&me("formChange",{fieldInstance:t,fieldKey:a,oldValue:r,fieldName:t.title,value:t.value,context:be.getContext(a,t.value)}),Oe(t),Ve(a),Ne(a),_e.trigger(a),De.trigger(a,t.value)})),T("*",Re),T("*",(e=>{const o=e.props.name.toString();Ve(o),Ne(o),pe.operationalFormInit&&_e.trigger(o)})),I("*",He),pe.anchor&&V("*",Se)}}),{lowCodeReactionsHandler:Ve}=ee(r((()=>pe.lowCodeReactions)),Ie),{newLowCodeReactionsHandler:Ne}=ae(r((()=>pe.newLowCodeReactions)),Ie),_e=te(pe,Ie),De=re().create(Ie,be),{schemaAdaptor:We}=G(ge,pe.lifeCycle);let Ue=pe.fieldList||[],Ee=[];const Me=r((()=>{var e;let o=!1;const t=pe.schema?pe.schema:pe.fieldList?(Ue!==pe.fieldList&&0!==Ue.length||(o=!0),Ue=K().traverse(S(pe.fieldList),pe.fieldVisitor),M(We(Ue,pe))):M({});return pe.incrementalRender&&(null==(e=pe.fieldList)?void 0:e.length)&&o&&(Ee=[],Object.values(t.properties).forEach((e=>{var o;"visible"===e["x-display"]&&"LINEBAR"===e["x-component"]&&!1!==(null==(o=e["x-component-props"])?void 0:o.show)&&(Ee.push(e),e["x-component-props"].show=!1)})),qe()),t}));function qe(){Ee.length?setTimeout((()=>{const e=Ee.shift();e&&(ve.trigger(N.parse(e.name),!0),Ie.setFieldState(e.name,(e=>{e.componentProps.show=!0})),Ee.length?qe():a().then((()=>{me("ready")})))}),300):me("ready")}const{onKeydown:Pe}=J({formModel:Ie,formRenderRef:ce,props:pe,formUUID:ke}),{clearSpan:Ge}=P();s((()=>{Ge(ke),pe.fixMemoLeak&&(se.lifecycles.length=0)}));const Ke=Q({formModel:Ie,formRenderRef:ce,formItemDepsCollector:ve,businessCollector:ge,wordbookSettingHandler:De,operationalFormHandler:_e,getFieldList:()=>Ue,formUUID:ke,changeContextCollector:be,emitFormChange:Te});return ne({formModel:Ie,validate:(e="*",o={})=>Ke.validate(e,o),getFormValues:(e=!0)=>Ke.getFormValues(e),setFormValues:async(e,o={})=>Ke.setFormValues(e,o),setFieldState(e,o){Ke.setFieldState(e,o)},resetFields(e="*"){Ke.resetFields(e)},queryWidget:async e=>Ke.queryWidget(e),getFieldList:()=>Ue,applySelectedSetting:e=>Ke.applySelectedSetting(e),async reload(){console.error("reload function is abstract,it should be overwrite!")},async optionInited(e={}){if(await a(),je.activeTasks)return new Promise((o=>{var t;const r=()=>{o(),je.onActiveTaskChange=null};je.onActiveTaskChange=()=>{je.activeTasks||r()},setTimeout(r,null!=(t=e.timeout)?t:5e3)}))},updateAnchor(){Le(Ie)},getTextFormValues:()=>Ke.getTextFormValues()}),(o,t)=>(i(),l(n(x),m({class:["form-render",{"form-render--out-border":e.outBordered}],"require-mark-placement":"left",style:n(de)},n(A)(),{uuid:n(ke)}),{default:p((()=>[e.anchor&&n(xe).length?(i(),d("section",ie,[u(n(w),{value:n(Fe),"onUpdate:value":t[0]||(t[0]=e=>c(Fe)?Fe.value=e:null),type:"line",ref_key:"anchorBarRef",ref:Ce},{default:p((()=>[(i(!0),d(f,null,h(n(xe),(e=>(i(),l(n(L),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):y("v-if",!0),u(n(B),{"theme-overrides":n(ue)},{default:p((()=>[g("section",{class:"form-render__wrapper",style:v({"--column":e.column,"--form-height":n(he)}),ref_key:"formRenderRef",ref:ce,onScroll:t[1]||(t[1]=(...e)=>n(we)&&n(we)(...e)),onKeydownCapture:t[2]||(t[2]=(...e)=>n(Pe)&&n(Pe)(...e))},[u(n(_),{form:n(Ie)},{default:p((()=>[u(n(ye),{schema:n(Me)},null,8,["schema"]),e.consumer?(i(),l(n(D),{key:0},{default:p((({form:e})=>[g("div",le,b(JSON.stringify(e.values,null,2)),1)])),_:1})):y("v-if",!0),j(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},16,["class","style","uuid"]))}});export{ne as default};
|
1
|
+
import{defineComponent as e,ref as o,provide as t,computed as r,nextTick as a,onBeforeUnmount as s,openBlock as i,createBlock as l,unref as n,mergeProps as m,withCtx as p,createElementBlock as d,createVNode as u,isRef as c,Fragment as f,renderList as h,createCommentVNode as y,createElementVNode as g,normalizeStyle as v,toDisplayString as b,renderSlot as j}from"vue";import{useTheme as k}from"../../../shared/hooks/useTheme.js";import{useElementSize as C}from"@vueuse/core";import"date-fns";import{isNumber as F,cloneDeep as S}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NForm as x,NTabs as w,NTabPane as L,NConfigProvider as B}from"naive-ui";import{useVersion as A}from"../../../shared/hooks/useVersion.js";import"../../../shared/hooks/useScrollLoading.js";import{createForm as R,onFormMount as H,onFieldValueChange as O,onFieldMount as T,onFieldUnmount as I,onFieldReact as V}from"@formily/core";import{Path as N}from"@formily/path";import{FormProvider as _,FormConsumer as D}from"@formily/vue";import{InjectionFormColumnWidth as W,InjectionFormLifeCycleCaller as U,InjectionFormGraph as E}from"./constants/index.js";import"./components/renderer/text.js";import"./utils/business.js";import{createObjSchema as M}from"./utils/schema.js";import{useAnchor as q}from"./hooks/useAnchor.js";import"../index.js";import{useComplexOptionsSpan as P}from"./hooks/useComplexOptions.js";import{useFieldListAdaptor as G}from"./hooks/useFieldListAdaptor.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{useFieldVisitor as K}from"./hooks/useFieldVisitor.js";import{useFormContext as z}from"./hooks/useFormContext.js";import{useFormDomEvent as J,useFormExposeEvent as Q}from"./hooks/useFormEvent.js";import{useFormGraph as $}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as X}from"./hooks/useFormRenderLifeCycle.js";import{validateMessageLocale as Y}from"./hooks/useFormValidator.js";import{useLowCodeEvent as Z}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as ee}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as oe}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as te}from"./hooks/useOperationalForm.js";import{useWordbookSetting as re}from"./hooks/useWordbookSetting.js";import{useNewLowCodeReactions as ae}from"./hooks/useNewLowCodeReactions.js";import{GlobalState as se}from"@formily/core/esm/shared/constants";const ie={key:0,style:{height:"54px"}},le={style:{"white-space":"pre"}};var ne=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:5},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},annotationShortcuts:{type:Array},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},autoExpand:Boolean,lowCodeReactions:{type:Array},newLowCodeReactions:{type:Array},operationalForm:{type:Array},dateOperationalForm:{type:Object},operationalFormInit:{type:Boolean,default:!0},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},labelPlacementOverwrite:Boolean,outBordered:{type:Boolean,default:!1},uniqueCacheData:{type:Boolean,default:!1},forceClearable:Boolean,wordSplitFilter:{type:Boolean,default:!0},selectMode:Boolean,selectedFields:{type:Array},linebarDirection:{type:String,default:"vertical"},linebarTextDirection:{type:String,default:"horizontal"},linebarWidth:{type:[Number,String],default:120},autoWidth:{type:[Boolean,Number],default:!1},incrementalRender:{type:Boolean,default:!1},feedbackType:{type:String,default:"default"},fixMemoLeak:{type:Boolean},lazyRender:Boolean},emits:["formChange","annotationChange","scroll","update:selectedFields","linebarChange","ready"],setup(e,{expose:ne,emit:me}){const pe=e,de=k(),{nuiThemeOverrides:ue}=oe();Y();const ce=o(),{width:fe}=C(ce);t(W,r((()=>fe.value?(fe.value-16*(pe.column-1))/24:0)));const he=r((()=>F(pe.maxHeight)?pe.maxHeight+"px":pe.maxHeight)),{SchemaField:ye,businessCollector:ge,formItemDepsCollector:ve,changeContextCollector:be,asyncQueue:je,formUUID:ke}=z(pe,me),{anchorBarRef:Ce,currentAnchor:Fe,updateAnchorList:Se,anchorIdList:xe,onScroll:we,generateAnchorList:Le}=q(pe,me,ce,ve),{callLifeCycle:Be}=X(pe);t(U,Be),Be("onSetup");const{observeFormGraph:Ae,setGraph:Re,removeGraph:He}=$();t(E,Ae);const{lowCodeEventTrigger:Oe}=Z(),Te=o(!0),Ie=R({initialValues:pe.initialData,effects(e){const o={};H((()=>{Object.assign(o,S(e.values))})),O("*",(t=>{const r=N.getIn(o,t.path);N.setIn(o,t.path,t.value);const a=t.props.name.toString();ge.trigger(e,a),ve.trigger(t.path),Te.value&&me("formChange",{fieldInstance:t,fieldKey:a,oldValue:r,fieldName:t.title,value:t.value,context:be.getContext(a,t.value)}),Oe(t),Ve(a),Ne(a),_e.trigger(a),De.trigger(a,t.value)})),T("*",Re),T("*",(e=>{const o=e.props.name.toString();Ve(o),Ne(o),pe.operationalFormInit&&_e.trigger(o)})),I("*",He),pe.anchor&&V("*",Se)}}),{lowCodeReactionsHandler:Ve}=ee(r((()=>pe.lowCodeReactions)),Ie),{newLowCodeReactionsHandler:Ne}=ae(r((()=>pe.newLowCodeReactions)),Ie),_e=te(pe,Ie),De=re().create(Ie,be),{schemaAdaptor:We}=G(ge,pe.lifeCycle);let Ue=pe.fieldList||[],Ee=[];const Me=r((()=>{var e;let o=!1;const t=pe.schema?pe.schema:pe.fieldList?(Ue!==pe.fieldList&&0!==Ue.length||(o=!0),Ue=K().traverse(S(pe.fieldList),pe.fieldVisitor),M(We(Ue,pe))):M({});return pe.incrementalRender&&(null==(e=pe.fieldList)?void 0:e.length)&&o&&(Ee=[],Object.values(t.properties).forEach((e=>{var o;"visible"===e["x-display"]&&"LINEBAR"===e["x-component"]&&!1!==(null==(o=e["x-component-props"])?void 0:o.show)&&(Ee.push(e),e["x-component-props"].show=!1)})),qe()),t}));function qe(){Ee.length?setTimeout((()=>{const e=Ee.shift();e&&(ve.trigger(N.parse(e.name),!0),Ie.setFieldState(e.name,(e=>{e.componentProps.show=!0})),Ee.length?qe():a().then((()=>{me("ready")})))}),300):me("ready")}const{onKeydown:Pe}=J({formModel:Ie,formRenderRef:ce,props:pe,formUUID:ke}),{clearSpan:Ge}=P();s((()=>{Ge(ke),pe.fixMemoLeak&&(se.lifecycles.length=0)}));const Ke=Q({formModel:Ie,formRenderRef:ce,formItemDepsCollector:ve,businessCollector:ge,wordbookSettingHandler:De,operationalFormHandler:_e,getFieldList:()=>Ue,formUUID:ke,changeContextCollector:be,emitFormChange:Te});return ne({formModel:Ie,validate:(e="*",o={})=>Ke.validate(e,o),getFormValues:(e=!0)=>Ke.getFormValues(e),setFormValues:async(e,o={})=>Ke.setFormValues(e,o),setFieldState(e,o){Ke.setFieldState(e,o)},resetFields(e="*"){Ke.resetFields(e)},queryWidget:async e=>Ke.queryWidget(e),getFieldList:()=>Ue,applySelectedSetting:e=>Ke.applySelectedSetting(e),async reload(){console.error("reload function is abstract,it should be overwrite!")},async optionInited(e={}){if(await a(),je.activeTasks)return new Promise((o=>{var t;const r=()=>{o(),je.onActiveTaskChange=null};je.onActiveTaskChange=()=>{je.activeTasks||r()},setTimeout(r,null!=(t=e.timeout)?t:5e3)}))},updateAnchor(){Le(Ie)},getTextFormValues:()=>Ke.getTextFormValues()}),(o,t)=>(i(),l(n(x),m({class:["form-render",{"form-render--out-border":e.outBordered}],"require-mark-placement":"left",style:n(de)},n(A)(),{uuid:n(ke)}),{default:p((()=>[e.anchor&&n(xe).length?(i(),d("section",ie,[u(n(w),{value:n(Fe),"onUpdate:value":t[0]||(t[0]=e=>c(Fe)?Fe.value=e:null),type:"line",ref_key:"anchorBarRef",ref:Ce},{default:p((()=>[(i(!0),d(f,null,h(n(xe),(e=>(i(),l(n(L),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):y("v-if",!0),u(n(B),{"theme-overrides":n(ue)},{default:p((()=>[g("section",{class:"form-render__wrapper",style:v({"--column":e.column,"--form-height":n(he)}),ref_key:"formRenderRef",ref:ce,onScroll:t[1]||(t[1]=(...e)=>n(we)&&n(we)(...e)),onKeydownCapture:t[2]||(t[2]=(...e)=>n(Pe)&&n(Pe)(...e))},[u(n(_),{form:n(Ie)},{default:p((()=>[u(n(ye),{schema:n(Me)},null,8,["schema"]),e.consumer?(i(),l(n(D),{key:0},{default:p((({form:e})=>[g("div",le,b(JSON.stringify(e.values,null,2)),1)])),_:1})):y("v-if",!0),j(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},16,["class","style","uuid"]))}});export{ne as default};
|
@@ -207,6 +207,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
207
207
|
fixMemoLeak: {
|
208
208
|
type: BooleanConstructor;
|
209
209
|
};
|
210
|
+
lazyRender: BooleanConstructor;
|
210
211
|
}, {
|
211
212
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
212
213
|
fieldList: {
|
@@ -409,6 +410,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
409
410
|
fixMemoLeak: {
|
410
411
|
type: BooleanConstructor;
|
411
412
|
};
|
413
|
+
lazyRender: BooleanConstructor;
|
412
414
|
}>> & {
|
413
415
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
414
416
|
onScroll?: ((...args: any[]) => any) | undefined;
|
@@ -583,6 +585,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
583
585
|
linebarTextDirection: "horizontal" | "vertical";
|
584
586
|
autoWidth: number | boolean;
|
585
587
|
feedbackType: "default" | "tooltip";
|
588
|
+
fixMemoLeak: boolean;
|
589
|
+
lazyRender: boolean;
|
586
590
|
}>) => Record<string, import("@formily/json-schema").Stringify<{
|
587
591
|
[key: symbol]: any;
|
588
592
|
[key: `x-${string}`]: any;
|
@@ -969,6 +973,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
969
973
|
fixMemoLeak: {
|
970
974
|
type: BooleanConstructor;
|
971
975
|
};
|
976
|
+
lazyRender: BooleanConstructor;
|
972
977
|
}>> & {
|
973
978
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
974
979
|
onScroll?: ((...args: any[]) => any) | undefined;
|
@@ -1000,9 +1005,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
1000
1005
|
linebarTextDirection: "horizontal" | "vertical";
|
1001
1006
|
autoWidth: number | boolean;
|
1002
1007
|
feedbackType: "default" | "tooltip";
|
1008
|
+
fixMemoLeak: boolean;
|
1009
|
+
lazyRender: boolean;
|
1003
1010
|
operationalFormInit: boolean;
|
1004
1011
|
incrementalRender: boolean;
|
1005
|
-
fixMemoLeak: boolean;
|
1006
1012
|
}>;
|
1007
1013
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
1008
1014
|
export default _default;
|
@@ -10,7 +10,7 @@ export declare const DATE: import("vue").DefineComponent<{
|
|
10
10
|
validate: {
|
11
11
|
type: PropType<Partial<{
|
12
12
|
[key: string]: any;
|
13
|
-
obj_type: "password" | "sex" | "age" | "email" | "
|
13
|
+
obj_type: "password" | "sex" | "age" | "email" | "mobile" | "birthday" | "id_card" | "age_unit" | "telephone" | "bank_card" | "website" | "gestational_weeks" | "gestational_stage" | "customer_name";
|
14
14
|
vali_obj: string;
|
15
15
|
max_value: string | number;
|
16
16
|
min_value: string | number;
|
@@ -32,6 +32,7 @@ export declare const DATE: import("vue").DefineComponent<{
|
|
32
32
|
type: StringConstructor;
|
33
33
|
default: string;
|
34
34
|
};
|
35
|
+
placeholder: StringConstructor;
|
35
36
|
dbclickToCurrent: {
|
36
37
|
type: BooleanConstructor;
|
37
38
|
default: boolean;
|
@@ -47,7 +48,7 @@ export declare const DATE: import("vue").DefineComponent<{
|
|
47
48
|
validate: {
|
48
49
|
type: PropType<Partial<{
|
49
50
|
[key: string]: any;
|
50
|
-
obj_type: "password" | "sex" | "age" | "email" | "
|
51
|
+
obj_type: "password" | "sex" | "age" | "email" | "mobile" | "birthday" | "id_card" | "age_unit" | "telephone" | "bank_card" | "website" | "gestational_weeks" | "gestational_stage" | "customer_name";
|
51
52
|
vali_obj: string;
|
52
53
|
max_value: string | number;
|
53
54
|
min_value: string | number;
|
@@ -69,6 +70,7 @@ export declare const DATE: import("vue").DefineComponent<{
|
|
69
70
|
type: StringConstructor;
|
70
71
|
default: string;
|
71
72
|
};
|
73
|
+
placeholder: StringConstructor;
|
72
74
|
dbclickToCurrent: {
|
73
75
|
type: BooleanConstructor;
|
74
76
|
default: boolean;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,computed as t,watch as a,ref as
|
1
|
+
import{defineComponent as e,computed as t,watch as a,ref as n,onMounted as o,inject as r,createVNode as i,mergeProps as l}from"vue";import{generateTimeFormat as u}from"../../../../../shared/utils/index.js";import{connect as s,mapProps as d}from"@formily/vue";import{isObject as c,useEventListener as m}from"@vueuse/core";import{promiseTimeout as v}from"@vueuse/shared";import{format as p}from"date-fns";import f from"naive-ui/es/_mixins/use-locale";import y from"../../../../date-picker/index.js";import{InjectionFormGlobalProps as b}from"../../constants/index.js";import{useCommonInjection as D}from"../../hooks/useCommonInjection.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"lodash-es";import"naive-ui";import"./text.js";import"../../utils/business.js";import{assignUpdateValue as h,assignClearBindVisited as w}from"../../utils/schema.js";import x from"../../../../../shared/components/DateIcon/DateIcon.vue.js";const _=s(e({props:{onChange:{},disabled:{type:Boolean},value:{type:String},validate:{type:Object},valueFormat:{type:String,default:"yyyy-MM-dd"},allowedInvalidValue:{type:String,default:"-"},placeholder:String,dbclickToCurrent:{type:Boolean,default:!0}},emits:["update:value"],setup(e,{emit:s,attrs:d}){const{injectValueValidate:h,injectValueBindKey:w}=D();function _(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.min_date)}function j(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.max_date)}function k(e){return _()&&e<Date.now()-864e5||j()&&e>Date.now()}function M(e){const t=new Date(e),a=new Date,n=new Date(t);n.setHours(0),n.setMinutes(0),n.setSeconds(0);const o=new Date(t);o.setHours(23),o.setMinutes(59),o.setSeconds(59);const r=n>a,i=o<a,l=t.getHours(),u=a.getHours(),s=a.getMinutes();return{isHourDisabled:function(e){return _()&&!r&&e<u||j()&&!i&&e>u},isMinuteDisabled:function(e){if(l===u)return _()&&!r&&e<s||j()&&!i&&e>s;return _()&&!r&&l<u||j()&&!i&&l>u}}}h((()=>e.value));const g=t((()=>{const t={};if(c(e.validate)){const{min_date:a,max_date:n}=e.validate;(a||n)&&(t.isDateDisabled=k,t.isTimeDisabled=M)}return t})),F=t((()=>({valueFormat:e.valueFormat,format:e.valueFormat,timePickerProps:{format:u(e.valueFormat)}})));function I(t){return t?t===e.allowedInvalidValue?t:p(new Date(t),e.valueFormat):null}a((()=>e.value),(e=>{e&&I(e)!==e&&s("update:value",I(e))}));const S=t({get:()=>I(e.value),set:e=>{s("update:value",e)}}),V=w(S),H=n();let P=!1;function T(){var t;if(!e.dbclickToCurrent||P)return;const a=null==(t=H.value)?void 0:t.$el;if(!a)return;const n=a.querySelector("input");n&&(m(a,"dblclick",(()=>function(t){e.disabled||(t.value=p(Date.now(),e.valueFormat),t.dispatchEvent(new Event("input")))}(n))),P=!0)}o(T);const C=r(b),B=n(!0);async function q(){var e;B.value=!1,await v(0);const t=null==(e=H.value)?void 0:e.$el;if(!t)return;const a=t.querySelector("input");a&&(a.click(),T())}const{localeRef:E}=f("DatePicker");return()=>{var t;return(null==C?void 0:C.lazyRender)&&B.value?i("div",{class:["form-render__textMode--input n-input",{"form-render__textMode--inputDisabled":e.disabled}],tabindex:0,onFocus:q},[[S.value?i("span",null,[S.value]):i("span",{class:"form-render__textMode--inputPlaceholder"},[e.placeholder||(null==(t=E.value)?void 0:t.datetimePlaceholder)]),i(x,{class:"form-render__textMode--dateIcon n-base-icon n-date-picker-icon"},null)]]):i(y,l({ref:H,key:V.value,disabled:e.disabled,allowedInvalidValue:e.allowedInvalidValue},g.value,F.value,{"formatted-value":S.value,"onUpdate:formatted-value":e=>S.value=e}),null)}}}),d(h,w));export{_ as DATE};
|
@@ -4,6 +4,7 @@ export declare const FORM_ITEM: import("vue").DefineComponent<{
|
|
4
4
|
label: StringConstructor;
|
5
5
|
propertyKey: StringConstructor;
|
6
6
|
remark: StringConstructor;
|
7
|
+
remarkTo: {};
|
7
8
|
span: {
|
8
9
|
type: NumberConstructor;
|
9
10
|
default: number;
|
@@ -30,6 +31,7 @@ export declare const FORM_ITEM: import("vue").DefineComponent<{
|
|
30
31
|
label: StringConstructor;
|
31
32
|
propertyKey: StringConstructor;
|
32
33
|
remark: StringConstructor;
|
34
|
+
remarkTo: {};
|
33
35
|
span: {
|
34
36
|
type: NumberConstructor;
|
35
37
|
default: number;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as l,computed as t,ref as r,onUnmounted as o,createVNode as
|
1
|
+
import{defineComponent as e,inject as l,computed as t,ref as r,onUnmounted as o,createVNode as a,mergeProps as i,unref as n,withModifiers as d,createTextVNode as u}from"vue";import{arrayed as s,getStringWidth as m,widthAppend as f}from"../../../../../shared/utils/index.js";import{isVoidField as v}from"@formily/core";import{observe as c,autorun as p}from"@formily/reactive";import{connect as b,mapProps as h}from"@formily/vue";import{useDebounceFn as _}from"@vueuse/core";import{isString as y,isArray as g,isObject as k,isNumber as I,isFunction as x,uniq as F}from"lodash-es";import{NFormItem as T,NTooltip as w,NButton as O}from"naive-ui";import P from"../../../../annotation-edit/index.js";import"../../../index.js";import R from"../tooltipMessage.vue.js";import{InjectionFormGlobalProps as j,InjectionFormGlobalEmit as E,InjectionFormUUID as L,InjectionFormGraph as M,InjectionAnnotation as S,InjectionAnnotationShortcuts as C,InjectionFormColumnWidth as A}from"../../constants/index.js";import{useComplexOptionsSpan as U}from"../../hooks/useComplexOptions.js";import{validateMessageParser as W,editorUnescape as N}from"../../utils/index.js";import{dotEscape as q,createFieldAddressId as B}from"../../utils/schema.js";import{useFormField as H}from"../../hooks/useFormField.js";const K=b(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,remarkTo:{},span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},isOptionChildField:Boolean,feedback:String,showFeedback:{type:Boolean,default:void 0},fieldItem:{type:Object},showTooltipFeedback:{type:Boolean,default:!0}},setup(e,{slots:s,attrs:b}){const h=l(j),W=l(E),{field:K,fieldKey:V,fieldAddress:D}=H(),G=l(L),$=t((()=>q(`${G}-${D.value}`))),z=r(!1);if(v(K.value)&&g(e.suffixFields)){const t=l(M);o(c(t,_((()=>{v(K.value)&&g(e.suffixFields)&&(z.value=e.suffixFields.some((e=>{const l=K.value.form.query(e).take();return l&&Reflect.get(l,"required")})))}),100)))}else o(p((()=>{z.value=Reflect.get(K.value,"required")})));const Y=l(S),J=t({get(){var l,t;return null!=(t=null==(l=Y.value)?void 0:l[e.propertyKey])?t:""},set(l){Y.value={property:e.propertyKey,value:l}}}),Q=l(C);const X=t((()=>{var l;const t={color:null==(l=e.fieldItem)?void 0:l.labelColor};return k(b.labelStyle)&&Object.assign(t,b.labelStyle),t})),Z=t((()=>Y.value&&!1!==e.annotation)),ee=t((()=>{var l;return y(null==(l=e.fieldItem)?void 0:l.editor_title)&&e.fieldItem.editor_title&&["POPUP_ALERT","HOVER_TOOLTIP"].includes(e.fieldItem.editor_title_mode)})),le=r(!1);const te=t((()=>e.label&&" "!==e.label)),re=t((()=>{let l=0;return Z.value&&(l+=18),e.remark&&(l+=18),ee.value&&(l+=32),l})),oe=l(j,{}),ae=t((()=>{var l;const t=null==(l=e.fieldItem)?void 0:l.bordered;return null==t?oe.bordered:t})),ie=l("n-form",{}),ne=t((()=>{var e,l,t,r;if("left"!==(null!=(l=b.labelPlacement)?l:null==(e=ie.props)?void 0:e.labelPlacement))return"";let o=null!=(r=b.labelWidth)?r:null==(t=ie.props)?void 0:t.labelWidth;return o&&"auto"!==o?(o=parseInt(o+""),isNaN(o)||!I(o)?"":o-12-re.value-(z.value?11:0)):""})),de=t((()=>x(e.labelRender)?"":y(e.label)?e.label:"")),ue=t((()=>{var l;return null==(l=e.fieldItem)?void 0:l.fieldTitleColor}));function se(){return te.value?a("section",{class:"form-render__formItemLabel"},[a("span",{class:"form-render__formItemLabel--text",style:{marginRight:f(re.value),maxWidth:f(ne.value),color:ue.value},title:de.value},[x(e.labelRender)?e.labelRender(e.label):e.label]),re.value?a("section",{class:"form-render__formItemLabel--operation"},[e.remark?a("div",{class:"form-render__formItemLabel--tooltip"},[a(R,{message:e.remark,to:e.remarkTo},null)]):null,Z.value?a(P,{class:"form-render__formItemLabel--annotation",modelValue:J.value,"onUpdate:modelValue":e=>J.value=e,shortcuts:n(Q)},null):null,ee.value?a(w,{zIndex:3e3,raw:!0,showArrow:!1,trigger:"POPUP_ALERT"===e.fieldItem.editor_title_mode?"manual":"hover",placement:"top-start",show:"HOVER_TOOLTIP"===e.fieldItem.editor_title_mode?void 0:le.value,contentStyle:"background-color:white;color:rgb(51, 54, 57);padding:8px;position:relative;"},{trigger:()=>a(O,{onClick:d((()=>le.value=!le.value),["stop","prev"]),text:!0,type:"primary"},{default:()=>[a("span",{style:"display:inline-block;margin-left:4px"},[u("提示")])]}),default:()=>{var l,t;return[a("div",{innerHTML:N(null!=(t=null==(l=e.fieldItem)?void 0:l.editor_title)?t:"")},null),a(O,{text:!0,onClick:()=>le.value=!le.value,style:"position:absolute;right:2px;top:2px;line-height:1;height:12px;transform:scaleY(0.9)"},{default:()=>[u("x")]})]}}):null]):null]):null}const me=t((()=>{let l=re.value;return z.value&&(l+=11),y(e.label)&&(l+=ne.value||m(e.label)),l})),fe=l(A),{getSpan:ve}=U();function ce(){var l,t,r,o,a,i,d;const u="inner"===(null==(l=e.fieldItem)?void 0:l.childWidthMode)?e.span:ve(G,K.value.address,!1)+e.span;if("left"!==(null!=(r=b.labelPlacement)?r:null==(t=ie.props)?void 0:t.labelPlacement)||!n(fe)||!(null==h?void 0:h.autoWidth)||"INPUT_GROUP"===(null==(a=null==(o=K.value.parent)?void 0:o.component)?void 0:a[0]))return u;if("INPUT_GROUP"===(null==(d=null==(i=K.value.parent)?void 0:i.component)?void 0:d[0]))return u;const s=16+fe.value;let m=u*s-16-me.value;const f=I(null==h?void 0:h.autoWidth)?h.autoWidth:120;let v=u;for(;m<f&&v<12;)v++,m+=s;return v}function pe(){var l;return"tooltip"!==(null==h?void 0:h.feedbackType)?null==(l=s.default)?void 0:l.call(s):a(w,{to:"body",trigger:"manual",show:!!e.feedback&&e.showTooltipFeedback,raw:!0,animated:!1,showArrow:!1,placement:"top-start",contentStyle:"background-color:#e88080;color:white;padding:8px;border-radius:4px"},{trigger(){var e;return null==(e=s.default)?void 0:e.call(s)},default:()=>e.feedback})}function be(){var l,t,r;const o=null==(l=e.fieldItem)?void 0:l.editor_title,i=!(null==(t=e.fieldItem)?void 0:t.editor_title_mode)||"EMBEDDED_FORM"===(null==(r=e.fieldItem)?void 0:r.editor_title_mode);return y(o)&&o&&i?a("section",{style:"display:flex;flex-direction:column;gap:4px;width:100%"},[pe(),a("div",{innerHTML:N(o)},null)]):pe()}function he(){const e=[K.value.path+""];return K.value.form.query("*").forEach((l=>{(l.address+"").includes(K.value.address+"")&&((l.path+"").includes(K.value.path+"")||e.push(l.path+""))})),e}const _e=t({get:()=>!(!(null==h?void 0:h.selectMode)||!g(null==h?void 0:h.selectedFields))&&h.selectedFields.includes(K.value.path+""),set(e){if(!g(null==h?void 0:h.selectedFields))return;let l=[...h.selectedFields];e?(l.push(...he()),l=F(l)):he().forEach((e=>{const t=l.indexOf(e);t>-1&&l.splice(t,1)})),null==W||W("update:selectedFields",l)}}),ye=t((()=>(null==h?void 0:h.selectMode)&&!(K.value.parent&&"LINEBAR"!==K.value.parent.componentType)));function ge(){(null==h?void 0:h.selectMode)&&(_e.value=!_e.value)}const ke=t((()=>e.isOptionChildField?!!e.feedback&&" "!==e.feedback&&e.showFeedback:e.showFeedback));return()=>a(T,i({class:["form-render__formItem",{"form-render--no-border":!ae.value,"form-render--underline":"underline"===ae.value,"form-render__formItemMask":ye.value,"form-render__formItemMask--selected":ye.value&&_e.value}],style:{"--form-item-column":ce()},showFeedback:ke.value,feedback:"tooltip"===(null==h?void 0:h.feedbackType)?"":e.feedback,labelStyle:X.value},{id:$.value,uuid:G,onClick:ge,"widget-type":K.value.componentType,"field-key":q(V.value),"field-address":B(D.value),required:z.value}),{...s,default:be,label:se})}}),h({title:"label"},((e,l)=>{const t=v(l)?void 0:s(l.selfErrors).length?function(e,l){if(!y(l.defined_error_msg)||!l.defined_error_msg)return e.map((e=>W(e,l))).join(",");return W(l.defined_error_msg,l)}(s(l.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:t,"validation-status":t?"error":void 0}})));export{K as FORM_ITEM};
|
@@ -8,6 +8,8 @@ export declare const INPUT: import("vue").DefineComponent<{
|
|
8
8
|
suffix: {
|
9
9
|
type: (ObjectConstructor | StringConstructor | FunctionConstructor)[];
|
10
10
|
};
|
11
|
+
placeholder: StringConstructor;
|
12
|
+
disabled: BooleanConstructor;
|
11
13
|
password: {
|
12
14
|
type: BooleanConstructor;
|
13
15
|
};
|
@@ -21,6 +23,8 @@ export declare const INPUT: import("vue").DefineComponent<{
|
|
21
23
|
suffix: {
|
22
24
|
type: (ObjectConstructor | StringConstructor | FunctionConstructor)[];
|
23
25
|
};
|
26
|
+
placeholder: StringConstructor;
|
27
|
+
disabled: BooleanConstructor;
|
24
28
|
password: {
|
25
29
|
type: BooleanConstructor;
|
26
30
|
};
|
@@ -28,4 +32,5 @@ export declare const INPUT: import("vue").DefineComponent<{
|
|
28
32
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
29
33
|
}, {
|
30
34
|
password: boolean;
|
35
|
+
disabled: boolean;
|
31
36
|
}>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,createVNode as t}from"vue";import{useVModel as
|
1
|
+
import{defineComponent as e,inject as o,createVNode as t,ref as r,createTextVNode as n,nextTick as l}from"vue";import{useVModel as a}from"@vueuse/core";import{InjectionFormGlobalProps as i}from"../../constants/index.js";import{useCommonInjection as u}from"../../hooks/useCommonInjection.js";import{createInputSlot as s}from"../../utils/index.js";import{connect as p,mapProps as d}from"@formily/vue";import{NInput as c}from"naive-ui";import m from"naive-ui/es/_mixins/use-locale";import{assignUpdateValue as v,assignClearBindVisited as f}from"../../utils/schema.js";const x=p(e({name:"FormInput",props:{value:{type:String},prefix:{type:[String,Function,Object]},suffix:{type:[String,Function,Object]},placeholder:String,disabled:Boolean,password:{type:Boolean}},emits:["update:value"],setup(e,{emit:p}){const d=o(i),v=a(e,"value",p),f=u().injectValueBindKey(v),x=s(e,(e=>[t("i",{style:{color:"rgba(33,33,33,.4)"}},[e])]));function y(o){var r;return(null==(r=x.value)?void 0:r[o])?t("div",{class:`n-input__${o}`},[n(" "),x.value[o](e)]):""}const h=r(!0),b=r();async function _(){h.value=!1,await l(),b.value.focus()}const{localeRef:j}=m("Input");return()=>{var o;return(null==d?void 0:d.lazyRender)&&h.value?t("div",{class:["form-render__textMode--input n-input",{"form-render__textMode--inputDisabled":e.disabled}],tabindex:0,onFocus:_},[[y("prefix"),v.value?t("span",null,[v.value]):t("span",{class:"form-render__textMode--inputPlaceholder"},[e.placeholder||(null==(o=j.value)?void 0:o.placeholder)]),y("suffix")]]):t(c,{ref:b,type:e.password?"password":"text",key:f.value,disabled:e.disabled,placeholder:e.placeholder,value:v.value,"onUpdate:value":e=>v.value=e},x.value)}}}),d(((e,o)=>{const t=v(e,o);return t.allowInput=e=>!e.startsWith(" ")&&!e.endsWith(" "),t}),f));export{x as INPUT};
|
@@ -56,6 +56,10 @@ export declare const LEVEL_SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
56
56
|
default: string;
|
57
57
|
};
|
58
58
|
onChange: {};
|
59
|
+
validateLastNode: {
|
60
|
+
type: (BooleanConstructor | StringConstructor)[];
|
61
|
+
default: boolean;
|
62
|
+
};
|
59
63
|
value: {
|
60
64
|
type: PropType<string | AnyObject[]>;
|
61
65
|
};
|
@@ -115,6 +119,10 @@ export declare const LEVEL_SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
115
119
|
default: string;
|
116
120
|
};
|
117
121
|
onChange: {};
|
122
|
+
validateLastNode: {
|
123
|
+
type: (BooleanConstructor | StringConstructor)[];
|
124
|
+
default: boolean;
|
125
|
+
};
|
118
126
|
value: {
|
119
127
|
type: PropType<string | AnyObject[]>;
|
120
128
|
};
|
@@ -127,4 +135,5 @@ export declare const LEVEL_SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
127
135
|
lazyRequest: boolean;
|
128
136
|
requestCache: boolean;
|
129
137
|
checkAbleLevel: number | "last";
|
138
|
+
validateLastNode: string | boolean;
|
130
139
|
}>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as
|
1
|
+
import{defineComponent as e,inject as a,onMounted as t,createVNode as o}from"vue";import l from"../../../../../../shared/components/no-data/NoData.vue.js";import"../../../../../../shared/utils/index.js";import"naive-ui";import"@vueuse/core";import"date-fns";import{castArray as r,isArray as i,last as s,isString as u}from"lodash-es";import{isObject as n}from"@vue/shared";import{useLevelSearchCascader as d}from"../../../../../../shared/hooks/useLevelSearchCascader.js";import"@vueuse/shared";import"../../../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../../../../shared/hooks/useScrollLoading.js";import{isField as v}from"@formily/core";import{connect as m,mapProps as p}from"@formily/vue";import"../../../../index.js";import{InjectionAsyncQueue as c,InjectionChangeContextCollector as f}from"../../../constants/index.js";import{useCommonInjection as h}from"../../../hooks/useCommonInjection.js";import y from"../../../../../search-cascader/index.js";import{assignUpdateValue as j}from"../../../utils/schema.js";import{useFormField as g}from"../../../hooks/useFormField.js";const k=m(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},checkAbleLevel:{type:[Number,String],default:"last"},onChange:{},validateLastNode:{type:[Boolean,String],default:!1},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:m}){const p=a(c),{field:j,fieldKey:k}=g(),{valueRef:L,nodeHasChild:S,labelKey:b,valueKey:C,optionsRef:F,showRef:x,fetchData:K,menuWidth:N,searchCascaderRef:R}=d(e,m,{fieldKey:k,asyncQueue:p,getRequestPayload:()=>({field:j.value})}),q=a(f),w=b.value,A=C.value;function V(){N.value=150}q.setContext(k.value,(()=>({labelField:w,valueField:A})));const{injectValueValidate:B,injectValueBindKey:O}=h();B(L);const D=O(L);return t((()=>{if(!e.validateLastNode||!v(j.value))return;const a=j.value.validator?r(j.value.validator):[];a.some((e=>n(e)&&e.isLastOptionValidator))||(j.value.validator=[{async validator(){if(i(L.value)&&L.value.length)try{if(await S(s(L.value)))return u(e.validateLastNode)?e.validateLastNode:"请选择最后一级选项"}catch(e){return""}},isLastOptionValidator:!0},...a])})),()=>o(y,{ref:R,value:L.value,"onUpdate:value":e=>L.value=e,show:x.value,"onUpdate:show":e=>x.value=e,options:F.value,key:D.value,checkAbleLevel:e.checkAbleLevel,labelKey:b.value,valueKey:C.value,search:K,onFocus:V,menuWidth:N.value},{empty:()=>o(l,null,null)})}}),p({dataSource:"options"},j));export{k as LEVEL_SEARCH_CASCADER};
|
@@ -157,6 +157,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
157
157
|
linebarTextDirection: "horizontal" | "vertical";
|
158
158
|
autoWidth: number | boolean;
|
159
159
|
feedbackType: "default" | "tooltip";
|
160
|
+
fixMemoLeak: boolean;
|
161
|
+
lazyRender: boolean;
|
160
162
|
}>>;
|
161
163
|
isVerticalLinebar: import("vue").ComputedRef<boolean>;
|
162
164
|
wrapperClass: import("vue").ComputedRef<string[] | "">;
|
@@ -175,16 +177,27 @@ declare const _default: import("vue").DefineComponent<{
|
|
175
177
|
textStyle: import("vue").ComputedRef<CSSProperties>;
|
176
178
|
TooltipMessage: import("vue").DefineComponent<{
|
177
179
|
message: StringConstructor;
|
180
|
+
to: {
|
181
|
+
default: string;
|
182
|
+
};
|
178
183
|
}, {
|
179
184
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
180
185
|
message: StringConstructor;
|
186
|
+
to: {
|
187
|
+
default: string;
|
188
|
+
};
|
181
189
|
}>> & {}>>;
|
182
190
|
parsedMessages: import("vue").ComputedRef<string[]>;
|
183
191
|
HelpCircleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
184
192
|
NTooltip: any;
|
185
193
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
186
194
|
message: StringConstructor;
|
187
|
-
|
195
|
+
to: {
|
196
|
+
default: string;
|
197
|
+
};
|
198
|
+
}>>, {
|
199
|
+
to: string;
|
200
|
+
}>;
|
188
201
|
ChevronDown: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
189
202
|
ChevronUp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
190
203
|
NCollapseTransition: any;
|
@@ -156,6 +156,8 @@ export declare const LINEBAR: import("@vue/runtime-core").DefineComponent<{
|
|
156
156
|
linebarTextDirection: "horizontal" | "vertical";
|
157
157
|
autoWidth: number | boolean;
|
158
158
|
feedbackType: "default" | "tooltip";
|
159
|
+
fixMemoLeak: boolean;
|
160
|
+
lazyRender: boolean;
|
159
161
|
}>>;
|
160
162
|
isVerticalLinebar: import("vue").ComputedRef<boolean>;
|
161
163
|
wrapperClass: import("vue").ComputedRef<string[] | "">;
|
@@ -174,16 +176,27 @@ export declare const LINEBAR: import("@vue/runtime-core").DefineComponent<{
|
|
174
176
|
textStyle: import("vue").ComputedRef<import("vue").CSSProperties>;
|
175
177
|
TooltipMessage: import("@vue/runtime-core").DefineComponent<{
|
176
178
|
message: StringConstructor;
|
179
|
+
to: {
|
180
|
+
default: string;
|
181
|
+
};
|
177
182
|
}, {
|
178
183
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
179
184
|
message: StringConstructor;
|
185
|
+
to: {
|
186
|
+
default: string;
|
187
|
+
};
|
180
188
|
}>> & {}>>;
|
181
189
|
parsedMessages: import("vue").ComputedRef<string[]>;
|
182
190
|
HelpCircleOutline: import("@vue/runtime-core").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
183
191
|
NTooltip: any;
|
184
192
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
185
193
|
message: StringConstructor;
|
186
|
-
|
194
|
+
to: {
|
195
|
+
default: string;
|
196
|
+
};
|
197
|
+
}>>, {
|
198
|
+
to: string;
|
199
|
+
}>;
|
187
200
|
ChevronDown: import("@vue/runtime-core").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
188
201
|
ChevronUp: import("@vue/runtime-core").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
189
202
|
NCollapseTransition: any;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as a,inject as l,watch as o,createVNode as r,nextTick as n}from"vue";import{connect as u,mapProps as i}from"@formily/vue";import{last as s,isEqual as c,isArray as p,isString as d}from"lodash-es";import{NCascader as
|
1
|
+
import{defineComponent as e,ref as t,computed as a,inject as l,watch as o,createVNode as r,nextTick as n}from"vue";import{connect as u,mapProps as i}from"@formily/vue";import{last as s,isEqual as c,isArray as p,isString as d}from"lodash-es";import{NCascader as m}from"naive-ui";import"../../../index.js";import{useCommonInjection as v}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as f,InjectionAsyncQueue as h,InjectionFormUUID as y}from"../../constants/index.js";import"@formily/path";import"@vueuse/core";import"../../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"./text.js";import"../../utils/business.js";import{assignUpdateValue as k,createVisitedSetter as j,traverseDependKey as g}from"../../utils/schema.js";import"date-fns";import"../../hooks/useComplexOptions.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"@vueuse/shared";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../../shared/hooks/useScrollLoading.js";import"./index.js";import{useFormField as b}from"../../hooks/useFormField.js";import"@formily/reactive";import"../../hooks/useFormValidator.js";import"min-dash";const C=u(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},checkStrategy:{type:String,default:"child"},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:u,emit:i}){const k=t(),{field:C,title:S,fieldKey:F}=b(),w=t(1),A=t(!0);const x=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),H=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"}));l(f).setContext(F.value,(()=>({labelField:x.value,valueField:H.value})));const q=a((()=>{var t;try{const a=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");if(!Array.isArray(a)||!a.length)return null;const l=null==(t=s(a))?void 0:t[H.value];return null!=l?l:a.map((e=>e[x.value])).join(" / ")}catch(e){return null}}));function K(e,t,a){i("update:value",p(a)?a.map((function(e){return{...e,label:e[x.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const L=l(h);async function V(t){e.filterable?await async function(){if(!e.urlConfig||k.value&&e.requestCache)return;const t=await L.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:F.value,cache:e.requestCache,payload:{field:C.value,labelKey:x.value,valueKey:H.value}});function a(e,t,o){const r=[...o,...l(e)],n={[x.value]:e[x.value],[H.value]:e[H.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:r};return p(e.children)&&(n.children=e.children.map((e=>a(e,t+1,r))),n.isLeaf=!e.children.length),w.value=Math.max(w.value,t+1),n}function l(e){let t=[];if(d(e[x.value])&&(t=[...t,e[x.value]]),d(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}k.value=t.map((e=>a(e,0,[])))}():await async function(t){if(o(e,t))return;const a=await L.addAsync(r(s(t),i(e),S.value,t));if(!a.length&&t)return t.isLeaf=!0,K(0,0,n(t)),void(N.value=!1);const l=a.map((e=>u(e,s(t))));function o(e,t){return!i(e)||!t&&k.value&&e.requestCache||s(t)>=s(e)-1}function r(t,a,l,o){const r={lvlnr:t+1+""};return o&&a.dependKey&&g(a.dependKey,((e,t)=>{r[t]=o[e]})),{params:r,...a,key:l,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 u(a,l){return{[x.value]:a[x.value],[H.value]:a[H.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function i(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:k.value=l}(t),await I()}const B=`form-render__cascade--menu-${l(y)}`;async function I(){await n();const e=document.querySelector(`.${B} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function E(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;return!(e.checkStrategy.includes("child")&&a.depth<w.value)&&(l.length>0&&l.some((e=>e.includes(t.trim()))))}const{injectValueValidate:O,injectValueWatchFromEmpty:W,injectValueBindKey:z}=v();W((()=>e.value),V),O((()=>e.value)),o((()=>e.urlConfig),(async(t,a)=>{c(t,a)||(k.value=null,A.value?e.lazyRequest||(V(),A.value=!A.value):await V())}),{immediate:!0});const N=t(!1);function P(e){N.value=!!e,e&&V()}const R=a((()=>k.value||e.options||[])),U=a((()=>!e.filterable)),$=z(q);return()=>r(m,{key:$.value,remote:U.value,filterable:e.filterable,"menu-props":{class:B,onClick:I},"check-strategy":e.checkStrategy,show:!!N.value,"onUpdate:show":P,value:q.value,filter:E,"onUpdate:value":K,labelField:x.value,valueField:H.value,options:R.value,onLoad:V,onFocus:j(C)},u)}}),i({dataSource:"options"},k));export{C as SEARCH_CASCADER};
|