cnhis-design-vue 3.1.54-beta.2 → 3.1.54-beta.21
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/README.md +87 -87
- package/es/components/body-select/src/hooks/renderCanvas.js +1 -1
- package/es/components/body-select/src/index.vue2.js +1 -1
- package/es/components/button-print/index.d.ts +13 -0
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +16 -1
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +54 -14
- package/es/components/chat-sdk/index.d.ts +2 -0
- package/es/components/chat-sdk/index.js +1 -0
- package/es/components/chat-sdk/src/chatSDK.d.ts +7 -0
- package/es/components/chat-sdk/src/chatSDK.js +1 -0
- package/es/components/classification/index.d.ts +498 -1
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +485 -1
- package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +485 -1
- package/es/components/classification/src/index.vue.d.ts +500 -1
- package/es/components/classification/src/index.vue2.js +1 -1
- package/es/components/classification/style/index.css +1 -1
- package/es/components/expand-field/src/components/form.vue2.js +1 -1
- package/es/components/fabric-chart/index.d.ts +1 -0
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +1 -0
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/constants/index.d.ts +1 -0
- package/es/components/fabric-chart/src/constants/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.d.ts +18 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +5 -0
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
- package/es/components/fabric-chart/src/hooks/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.d.ts +10 -4
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
- package/es/components/form-config/index.d.ts +135 -111
- package/es/components/form-config/src/FormConfig.vue.d.ts +136 -112
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +26 -14
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +53 -41
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +17 -17
- package/es/components/form-config/src/constants/index.d.ts +4 -4
- package/es/components/form-config/src/types/index.d.ts +3 -3
- package/es/components/form-render/index.d.ts +26 -14
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +27 -15
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +26 -14
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- 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 +20 -9
- package/es/components/form-render/src/hooks/index.js +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +4 -4
- package/es/components/form-render/src/hooks/useFieldVisitor.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.d.ts +12 -3
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/hooks/useFormItemDeps.d.ts +1 -1
- package/es/components/form-render/src/hooks/useFormItemDeps.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +2 -2
- package/es/components/form-render/src/hooks/useLowCodeReactions.d.ts +2 -2
- package/es/components/form-render/src/hooks/useOperationalForm.d.ts +7 -5
- package/es/components/form-render/src/hooks/useOperationalForm.js +1 -1
- package/es/components/form-render/src/hooks/useWordbookSetting.d.ts +13 -4
- package/es/components/form-render/src/hooks/useWordbookSetting.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +3 -3
- package/es/components/form-render/src/types/index.d.ts +6 -6
- package/es/components/iho-table/index.d.ts +28 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +28 -0
- package/es/components/iho-table/src/plugins/bindEventSettingPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/operationalFormPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +8 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +7 -5
- 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 +62 -38
- package/es/components/info-header/src/InfoHeader.vue.d.ts +62 -38
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +2 -2
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +2 -2
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +28 -16
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +26 -14
- package/es/components/quick-search/style/index.css +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
- package/es/components/shortcut-setter/index.d.ts +33 -21
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +33 -21
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +332 -0
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue2.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +127 -0
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue2.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/InputFilter.vue.d.ts +41 -0
- package/es/components/table-filter/src/components/bi-filter/components/InputFilter.vue.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/InputFilter.vue2.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/InputNumber.vue.d.ts +28 -0
- package/es/components/table-filter/src/components/bi-filter/components/InputNumber.vue.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/InputNumber.vue2.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue.d.ts +51 -0
- package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue2.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +244 -0
- package/es/components/table-filter/src/components/bi-filter/components/index.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/helpers/options.d.ts +14 -0
- package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/hooks/useBiConditions.d.ts +13 -0
- package/es/components/table-filter/src/components/bi-filter/hooks/useBiConditions.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +486 -0
- package/es/components/table-filter/src/components/bi-filter/index.vue.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/index.vue2.js +1 -0
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +1 -1
- package/es/components/table-filter/src/constants/index.d.ts +1 -0
- package/es/components/table-filter/src/constants/index.js +1 -1
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/hooks/useLevelSearchCascader.d.ts +2 -2
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/business.d.ts +61 -53
- package/es/shared/utils/business.d.ts +11 -7
- package/es/shared/utils/business.js +1 -1
- package/es/shared/utils/index.js +1 -1
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/constants/index.d.ts +0 -2
- package/es/components/fabric-chart/src/hooks/electrocardiogram/constants/index.js +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormRequestDefine, useVersion } from '../../../../es/shared/hooks';
|
|
2
|
-
import { AnyObject,
|
|
2
|
+
import { AnyObject, LowCodeTypes } from '../../../../es/shared/types';
|
|
3
3
|
import { Field } from '@formily/core';
|
|
4
4
|
import { Component, FunctionalComponent, PropType } from 'vue';
|
|
5
5
|
import { FieldItem, FieldVisitor, FormBusinessFormatter } from './types';
|
|
@@ -130,10 +130,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
130
130
|
default: boolean;
|
|
131
131
|
};
|
|
132
132
|
lowCodeReactions: {
|
|
133
|
-
type: PropType<
|
|
133
|
+
type: PropType<LowCodeTypes.reactionsConfig[]>;
|
|
134
134
|
};
|
|
135
135
|
operationalForm: {
|
|
136
|
-
type: PropType<
|
|
136
|
+
type: PropType<LowCodeTypes.operationalConfig[]>;
|
|
137
|
+
};
|
|
138
|
+
dateOperationalForm: {
|
|
139
|
+
type: PropType<LowCodeTypes.dateOperationalConfig[]>;
|
|
137
140
|
};
|
|
138
141
|
linebarAutoHidden: {
|
|
139
142
|
type: BooleanConstructor;
|
|
@@ -279,10 +282,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
279
282
|
default: boolean;
|
|
280
283
|
};
|
|
281
284
|
lowCodeReactions: {
|
|
282
|
-
type: PropType<
|
|
285
|
+
type: PropType<LowCodeTypes.reactionsConfig[]>;
|
|
283
286
|
};
|
|
284
287
|
operationalForm: {
|
|
285
|
-
type: PropType<
|
|
288
|
+
type: PropType<LowCodeTypes.operationalConfig[]>;
|
|
289
|
+
};
|
|
290
|
+
dateOperationalForm: {
|
|
291
|
+
type: PropType<LowCodeTypes.dateOperationalConfig[]>;
|
|
286
292
|
};
|
|
287
293
|
linebarAutoHidden: {
|
|
288
294
|
type: BooleanConstructor;
|
|
@@ -364,12 +370,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
364
370
|
}>;
|
|
365
371
|
lowCodeReactionsHandler: (field: string) => void;
|
|
366
372
|
triggerAllReactionsHandler: () => void;
|
|
367
|
-
operationalFormHandler: (
|
|
373
|
+
operationalFormHandler: (fieldKey: string) => void;
|
|
368
374
|
triggerAllOperationalFormHandler: () => void;
|
|
369
|
-
wordbookSettingHandler:
|
|
370
|
-
trigger: (fieldKey: string, value: unknown) => void;
|
|
371
|
-
setDisabled: (value: boolean) => void;
|
|
372
|
-
};
|
|
375
|
+
wordbookSettingHandler: import("./hooks").wordbookSettingHandler;
|
|
373
376
|
schemaAdaptor: (fieldList: FieldItem[], options?: Partial<{
|
|
374
377
|
fieldList: FieldItem[];
|
|
375
378
|
initialData: AnyObject;
|
|
@@ -453,11 +456,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
453
456
|
businessFormatter: FormBusinessFormatter;
|
|
454
457
|
requestInstance: FormRequestDefine.RequestInstance;
|
|
455
458
|
enterToNextWidget: boolean | ((fieldItem: FieldItem) => boolean | void);
|
|
456
|
-
lowCodeReactions:
|
|
459
|
+
lowCodeReactions: LowCodeTypes.reactionsConfig[];
|
|
457
460
|
linebarAutoHidden: boolean;
|
|
458
461
|
bordered: string | boolean;
|
|
459
462
|
uniqueCacheData: boolean;
|
|
460
|
-
operationalForm:
|
|
463
|
+
operationalForm: LowCodeTypes.operationalConfig[];
|
|
461
464
|
outBordered: boolean;
|
|
462
465
|
forceClearable: boolean;
|
|
463
466
|
}>) => Record<string, import("@formily/vue").Stringify<{
|
|
@@ -582,7 +585,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
582
585
|
force?: boolean | undefined;
|
|
583
586
|
}): Promise<void>;
|
|
584
587
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
585
|
-
setFormValues(values: AnyObject,
|
|
588
|
+
setFormValues(values: AnyObject, options?: boolean | {
|
|
589
|
+
needSplitExtendKey?: boolean | undefined;
|
|
590
|
+
avoidBusinessConnection?: string | boolean | undefined;
|
|
591
|
+
avoidDependKeyConnection?: string | boolean | undefined;
|
|
592
|
+
avoidWordbookSettingConnection?: string | boolean | undefined;
|
|
593
|
+
overwrite?: boolean | undefined;
|
|
594
|
+
}, avoidBusinessConnection?: string | boolean, overwrite?: boolean): Promise<void>;
|
|
586
595
|
setFieldState(path: string, setter: (field: Partial<Pick<Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
|
|
587
596
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
588
597
|
validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
|
|
@@ -871,10 +880,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
871
880
|
default: boolean;
|
|
872
881
|
};
|
|
873
882
|
lowCodeReactions: {
|
|
874
|
-
type: PropType<
|
|
883
|
+
type: PropType<LowCodeTypes.reactionsConfig[]>;
|
|
875
884
|
};
|
|
876
885
|
operationalForm: {
|
|
877
|
-
type: PropType<
|
|
886
|
+
type: PropType<LowCodeTypes.operationalConfig[]>;
|
|
887
|
+
};
|
|
888
|
+
dateOperationalForm: {
|
|
889
|
+
type: PropType<LowCodeTypes.dateOperationalConfig[]>;
|
|
878
890
|
};
|
|
879
891
|
linebarAutoHidden: {
|
|
880
892
|
type: BooleanConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,
|
|
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,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 j,normalizeStyle as g,withKeys as b,toDisplayString as k,renderSlot as v}from"vue";import{useTheme as F}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as C,cloneDeep as H}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 S,NTabs as A,NTabPane as x,NConfigProvider as O}from"naive-ui";import{useVersion as B}from"../../../shared/hooks/useVersion.js";import{createForm as L,onFormMount as R,onFieldValueChange as w,onFieldMount as V,onFieldUnmount as _,onFieldReact as I}from"@formily/core";import{Path as D}from"@formily/path";import{FormProvider as N,FormConsumer as q}from"@formily/vue";import{InjectionFormLifeCycleCaller as W,InjectionFormGraph as T}from"./constants/index.js";import"../index.js";import{createObjSchema as U}from"./utils/schema.js";import{useAnchor as E}from"./hooks/useAnchor.js";import{useAutoHidden as G}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as K}from"./hooks/useComplexOptions.js";import{useFieldListAdaptor as M}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 P}from"./hooks/useFieldVisitor.js";import{useFormContext as J}from"./hooks/useFormContext.js";import{useFormDomEvent as $,useFormExposeEvent as z}from"./hooks/useFormEvent.js";import{useFormGraph as Q}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";const se={key:0,style:{height:"54px"}},ae={style:{"white-space":"pre"}};var ie=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},operationalForm:{type:Array},dateOperationalForm:{type:Object},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},outBordered:{type:Boolean,default:!1},uniqueCacheData:{type:Boolean,default:!1},forceClearable:Boolean},emits:["formChange","annotationChange","scroll"],setup(e,{expose:ie,emit:le}){const ne=e,me=F(),{nuiThemeOverrides:pe}=oe();Y();const de=o(),ue=t((()=>C(ne.maxHeight)?ne.maxHeight+"px":ne.maxHeight)),{SchemaField:ce,businessCollector:fe,formItemDepsCollector:he,changeContextCollector:ye,formUUID:je}=J(ne,le),{anchorBarRef:ge,currentAnchor:be,updateAnchorList:ke,anchorIdList:ve,onScroll:Fe}=E(ne,le,de,he),{callLifeCycle:Ce}=X(ne);r(W,Ce),Ce("onSetup");const{trigger:He}=G(),{observeFormGraph:Se,setGraph:Ae,removeGraph:xe}=Q();r(T,Se);const{lowCodeEventTrigger:Oe}=Z(),Be=L({initialValues:ne.initialData,effects(e){const o={};R((()=>{Object.assign(o,H(e.values))})),w("*",(t=>{const r=D.getIn(o,t.path);D.setIn(o,t.path,t.value);const s=t.props.name.toString();fe.trigger(e,s),he.trigger(s),le("formChange",{fieldInstance:t,fieldKey:s,oldValue:r,fieldName:t.title,value:t.value,context:ye.getContext(s,t.value)}),Oe(t),Le(s),we(s),_e.trigger(s,t.value)})),V("*",Ae),_("*",xe),ne.linebarAutoHidden&&(I("*",He),R((e=>e.query("*").forEach(He)))),ne.anchor&&I("*",ke)}}),{lowCodeReactionsHandler:Le,triggerAllReactionsHandler:Re}=ee(t((()=>ne.lowCodeReactions)),Be),{operationalFormHandler:we,triggerAllOperationalFormHandler:Ve}=te(ne,Be),_e=re().create(Be,ye);s(Re),s(Ve);const{schemaAdaptor:Ie}=M(fe,ne.lifeCycle);let De=ne.fieldList||[];const Ne=t((()=>ne.schema?ne.schema:ne.fieldList?(De=P().traverse(H(ne.fieldList),ne.fieldVisitor),U(Ie(De,ne))):U({}))),{onKeydown:qe}=$({formModel:Be,formRenderRef:de,props:ne}),{clearSpan:We}=K();a((()=>We(je)));const Te=z({formModel:Be,formRenderRef:de,formItemDepsCollector:he,businessCollector:fe,wordbookSettingHandler:_e,getFieldList:()=>De,formUUID:je});return ie({formModel:Be,validate:(e="*",o={})=>Te.validate(e,o),getFormValues:(e=!0)=>Te.getFormValues(e),setFormValues:async(e,o={},t=!1,r=!0)=>Te.setFormValues(e,o,t,r),setFieldState(e,o){Te.setFieldState(e,o)},resetFields(e="*"){Te.resetFields(e)},queryWidget:async e=>Te.queryWidget(e),getFieldList:()=>De,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(i(),l(n(S),m({class:["form-render",{"form-render--out-border":e.outBordered}],"require-mark-placement":"left",style:n(me)},n(B)()),{default:p((()=>[e.anchor?(i(),d("section",se,[u(n(A),{value:n(be),"onUpdate:value":t[0]||(t[0]=e=>c(be)?be.value=e:null),type:"line",ref_key:"anchorBarRef",ref:ge},{default:p((()=>[(i(!0),d(f,null,h(n(ve),(e=>(i(),l(n(x),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):y("v-if",!0),u(n(O),{"theme-overrides":n(pe)},{default:p((()=>[j("section",{class:"form-render__wrapper",style:g({"--column":e.column,"--form-height":n(ue)}),ref_key:"formRenderRef",ref:de,onScroll:t[1]||(t[1]=(...e)=>n(Fe)&&n(Fe)(...e)),onKeydownCapture:t[2]||(t[2]=b(((...e)=>n(qe)&&n(qe)(...e)),["enter"]))},[u(n(N),{form:n(Be)},{default:p((()=>[u(n(ce),{schema:n(Ne)},null,8,["schema"]),e.consumer?(i(),l(n(q),{key:0},{default:p((({form:e})=>[j("div",ae,k(JSON.stringify(e.values,null,2)),1)])),_:1})):y("v-if",!0),v(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},16,["class","style"]))}});export{ie as default};
|
|
@@ -133,10 +133,13 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
133
133
|
default: boolean;
|
|
134
134
|
};
|
|
135
135
|
lowCodeReactions: {
|
|
136
|
-
type: import("vue").PropType<import("../../../../es/shared/types").
|
|
136
|
+
type: import("vue").PropType<import("../../../../es/shared/types").LowCodeTypes.reactionsConfig[]>;
|
|
137
137
|
};
|
|
138
138
|
operationalForm: {
|
|
139
|
-
type: import("vue").PropType<import("../../../../es/shared/types").
|
|
139
|
+
type: import("vue").PropType<import("../../../../es/shared/types").LowCodeTypes.operationalConfig[]>;
|
|
140
|
+
};
|
|
141
|
+
dateOperationalForm: {
|
|
142
|
+
type: import("vue").PropType<import("../../../../es/shared/types").LowCodeTypes.dateOperationalConfig[]>;
|
|
140
143
|
};
|
|
141
144
|
linebarAutoHidden: {
|
|
142
145
|
type: BooleanConstructor;
|
|
@@ -282,10 +285,13 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
282
285
|
default: boolean;
|
|
283
286
|
};
|
|
284
287
|
lowCodeReactions: {
|
|
285
|
-
type: import("vue").PropType<import("../../../../es/shared/types").
|
|
288
|
+
type: import("vue").PropType<import("../../../../es/shared/types").LowCodeTypes.reactionsConfig[]>;
|
|
286
289
|
};
|
|
287
290
|
operationalForm: {
|
|
288
|
-
type: import("vue").PropType<import("../../../../es/shared/types").
|
|
291
|
+
type: import("vue").PropType<import("../../../../es/shared/types").LowCodeTypes.operationalConfig[]>;
|
|
292
|
+
};
|
|
293
|
+
dateOperationalForm: {
|
|
294
|
+
type: import("vue").PropType<import("../../../../es/shared/types").LowCodeTypes.dateOperationalConfig[]>;
|
|
289
295
|
};
|
|
290
296
|
linebarAutoHidden: {
|
|
291
297
|
type: BooleanConstructor;
|
|
@@ -367,12 +373,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
367
373
|
}>;
|
|
368
374
|
lowCodeReactionsHandler: (field: string) => void;
|
|
369
375
|
triggerAllReactionsHandler: () => void;
|
|
370
|
-
operationalFormHandler: (
|
|
376
|
+
operationalFormHandler: (fieldKey: string) => void;
|
|
371
377
|
triggerAllOperationalFormHandler: () => void;
|
|
372
|
-
wordbookSettingHandler:
|
|
373
|
-
trigger: (fieldKey: string, value: unknown) => void;
|
|
374
|
-
setDisabled: (value: boolean) => void;
|
|
375
|
-
};
|
|
378
|
+
wordbookSettingHandler: import("../../../../es/components/form-render").wordbookSettingHandler;
|
|
376
379
|
schemaAdaptor: (fieldList: import("../../../../es/components/form-render").FieldItem[], options?: Partial<{
|
|
377
380
|
fieldList: import("../../../../es/components/form-render").FieldItem[];
|
|
378
381
|
initialData: import("../../../../es/shared/types").AnyObject;
|
|
@@ -456,11 +459,11 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
456
459
|
businessFormatter: import("../../../../es/components/form-render").FormBusinessFormatter;
|
|
457
460
|
requestInstance: import("../..").FormRequestDefine.RequestInstance;
|
|
458
461
|
enterToNextWidget: boolean | ((fieldItem: import("../../../../es/components/form-render").FieldItem) => boolean | void);
|
|
459
|
-
lowCodeReactions: import("../../../../es/shared/types").
|
|
462
|
+
lowCodeReactions: import("../../../../es/shared/types").LowCodeTypes.reactionsConfig[];
|
|
460
463
|
linebarAutoHidden: boolean;
|
|
461
464
|
bordered: string | boolean;
|
|
462
465
|
uniqueCacheData: boolean;
|
|
463
|
-
operationalForm: import("../../../../es/shared/types").
|
|
466
|
+
operationalForm: import("../../../../es/shared/types").LowCodeTypes.operationalConfig[];
|
|
464
467
|
outBordered: boolean;
|
|
465
468
|
forceClearable: boolean;
|
|
466
469
|
}>) => Record<string, import("@formily/json-schema").Stringify<{
|
|
@@ -585,7 +588,13 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
585
588
|
force?: boolean | undefined;
|
|
586
589
|
}): Promise<void>;
|
|
587
590
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
588
|
-
setFormValues(values: import("../../../../es/shared/types").AnyObject,
|
|
591
|
+
setFormValues(values: import("../../../../es/shared/types").AnyObject, options?: boolean | {
|
|
592
|
+
needSplitExtendKey?: boolean | undefined;
|
|
593
|
+
avoidBusinessConnection?: string | boolean | undefined;
|
|
594
|
+
avoidDependKeyConnection?: string | boolean | undefined;
|
|
595
|
+
avoidWordbookSettingConnection?: string | boolean | undefined;
|
|
596
|
+
overwrite?: boolean | undefined;
|
|
597
|
+
}, avoidBusinessConnection?: string | boolean, overwrite?: boolean): Promise<void>;
|
|
589
598
|
setFieldState(path: string, setter: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
|
|
590
599
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
591
600
|
validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
|
|
@@ -874,10 +883,13 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
874
883
|
default: boolean;
|
|
875
884
|
};
|
|
876
885
|
lowCodeReactions: {
|
|
877
|
-
type: import("vue").PropType<import("../../../../es/shared/types").
|
|
886
|
+
type: import("vue").PropType<import("../../../../es/shared/types").LowCodeTypes.reactionsConfig[]>;
|
|
878
887
|
};
|
|
879
888
|
operationalForm: {
|
|
880
|
-
type: import("vue").PropType<import("../../../../es/shared/types").
|
|
889
|
+
type: import("vue").PropType<import("../../../../es/shared/types").LowCodeTypes.operationalConfig[]>;
|
|
890
|
+
};
|
|
891
|
+
dateOperationalForm: {
|
|
892
|
+
type: import("vue").PropType<import("../../../../es/shared/types").LowCodeTypes.dateOperationalConfig[]>;
|
|
881
893
|
};
|
|
882
894
|
linebarAutoHidden: {
|
|
883
895
|
type: BooleanConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,watch as a,ref as o,onMounted as
|
|
1
|
+
import{defineComponent as e,computed as t,watch as a,ref as o,onMounted as n,createVNode as i,mergeProps as r}from"vue";import{generateTimeFormat as u}from"../../../../../shared/utils/index.js";import{connect as l,mapProps as s}from"@formily/vue";import{isObject as d,useEventListener as m}from"@vueuse/core";import{format as v}from"date-fns";import c from"../../../../date-picker/index.js";import{useCommonInjection as p}from"../../hooks/useCommonInjection.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"lodash-es";import"naive-ui";import"../../../index.js";import{assignUpdateValue as f,assignClearBindVisited as y}from"../../utils/schema.js";const w=l(e({props:{onChange:{},disabled:{type:Boolean},value:{type:String},validate:{type:Object},valueFormat:{type:String,default:"yyyy-MM-dd"},allowedInvalidValue:{type:String,default:"-"},dbclickToCurrent:{type:Boolean,default:!0}},emits:["update:value"],setup(e,{emit:l}){const{injectValueValidate:s,injectValueBindKey:f}=p();function y(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.min_date)}function w(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.max_date)}function D(e){return y()&&e<Date.now()-864e5||w()&&e>Date.now()}function b(e){const t=new Date(e),a=new Date,o=new Date(t);o.setHours(0),o.setMinutes(0),o.setSeconds(0);const n=new Date(t);n.setHours(23),n.setMinutes(59),n.setSeconds(59);const i=o>a,r=n<a,u=t.getHours(),l=a.getHours(),s=a.getMinutes();return{isHourDisabled:function(e){return y()&&!i&&e<l||w()&&!r&&e>l},isMinuteDisabled:function(e){if(u===l)return y()&&!i&&e<s||w()&&!r&&e>s;return y()&&!i&&u<l||w()&&!r&&u>l}}}s((()=>e.value));const j=t((()=>{const t={};if(d(e.validate)){const{min_date:a,max_date:o}=e.validate;(a||o)&&(t.isDateDisabled=D,t.isTimeDisabled=b)}return t})),g=t((()=>({valueFormat:e.valueFormat,format:e.valueFormat,timePickerProps:{format:u(e.valueFormat)}})));function h(t){return t?t===e.allowedInvalidValue?t:v(new Date(t),e.valueFormat):null}a((()=>e.value),(e=>{e&&h(e)!==e&&l("update:value",h(e))}));const k=t({get:()=>h(e.value),set:e=>{l("update:value",e)}}),F=f(k),V=o();return n((()=>{var t;if(!e.dbclickToCurrent)return;const a=null==(t=V.value)?void 0:t.$el;if(!a)return;const o=a.querySelector("input");o&&m(a,"dblclick",(()=>function(t){e.disabled||(t.value=v(Date.now(),e.valueFormat),t.dispatchEvent(new Event("input")))}(o)))})),()=>i(c,r({ref:V,key:F.value,disabled:e.disabled,allowedInvalidValue:e.allowedInvalidValue},j.value,g.value,{"formatted-value":k.value,"onUpdate:formatted-value":e=>k.value=e}),null)}}),s(f,y));export{w as DATE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as r,computed as l,ref as o,onUnmounted as t,createVNode as n,mergeProps as i}from"vue";import{arrayed as a,widthAppend as s}from"../../../../../shared/utils/index.js";import{isVoidField as m}from"@formily/core";import{observe as u,autorun as d}from"@formily/reactive";import{connect as f,mapProps as p}from"@formily/vue";import{useDebounceFn as v}from"@vueuse/core";import{isString as c,isArray as b,isFunction as y}from"lodash-es";import{NFormItem as _}from"naive-ui";import g from"../../../../annotation-edit/index.js";import"../../../index.js";import x from"../tooltipMessage.vue.js";import{InjectionFormUUID as I,InjectionFormGraph as j,InjectionAnnotation as h,InjectionFormGlobalProps as k}from"../../constants/index.js";import{useComplexOptionsSpan as F}from"../../hooks/useComplexOptions.js";import{
|
|
1
|
+
import{defineComponent as e,inject as r,computed as l,ref as o,onUnmounted as t,createVNode as n,mergeProps as i}from"vue";import{arrayed as a,widthAppend as s}from"../../../../../shared/utils/index.js";import{isVoidField as m}from"@formily/core";import{observe as u,autorun as d}from"@formily/reactive";import{connect as f,mapProps as p}from"@formily/vue";import{useDebounceFn as v}from"@vueuse/core";import{isString as c,isArray as b,isFunction as y}from"lodash-es";import{NFormItem as _}from"naive-ui";import g from"../../../../annotation-edit/index.js";import"../../../index.js";import x from"../tooltipMessage.vue.js";import{InjectionFormUUID as I,InjectionFormGraph as j,InjectionAnnotation as h,InjectionFormGlobalProps as k}from"../../constants/index.js";import{useComplexOptionsSpan as F}from"../../hooks/useComplexOptions.js";import{validateMessageParser as R}from"../../utils/index.js";import{dotEscape as L}from"../../utils/schema.js";import{useFormField as q}from"../../hooks/useFormField.js";const K=f(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},fieldItem:{type:Object}},setup(e,{slots:a}){const{field:f,fieldKey:p,fieldAddress:c}=q(),R=r(I),K=l((()=>L(`${R}-${c.value}`))),S=o(!1);if(m(f.value)&&b(e.suffixFields)){const l=r(j);t(u(l,v((()=>{m(f.value)&&b(e.suffixFields)&&(S.value=e.suffixFields.some((e=>{const r=f.value.form.query(e).take();return r&&Reflect.get(r,"required")})))}),100)))}else t(d((()=>{S.value=Reflect.get(f.value,"required")})));const A=r(h),E=l({get(){var r,l;return null!=(l=null==(r=A.value)?void 0:r[e.propertyKey])?l:""},set(r){A.value={property:e.propertyKey,value:r}}});const M=l((()=>A.value&&!1!==e.annotation)),O=l((()=>e.label&&" "!==e.label)),V=l((()=>{let r=0;return M.value&&(r+=18),e.remark&&(r+=18),r})),$=r(k,{}),w=l((()=>{var r;const l=null==(r=e.fieldItem)?void 0:r.bordered;return null==l?$.bordered:l}));function C(){return O.value?n("section",{class:"form-render__formItemLabel"},[n("span",{class:"form-render__formItemLabel--text",style:{marginRight:s(V.value)}},[y(e.labelRender)?e.labelRender(e.label):e.label]),V.value?n("section",{class:"form-render__formItemLabel--operation"},[e.remark?n("div",{class:"form-render__formItemLabel--tooltip"},[n(x,{message:e.remark},null)]):null,M.value?n(g,{class:"form-render__formItemLabel--annotation",modelValue:E.value,"onUpdate:modelValue":e=>E.value=e},null):null]):null]):null}const{getSpan:N}=F();return()=>{return n(_,i({class:["form-render__formItem",{"form-render--no-border":!w.value,"form-render--underline":"underline"===w.value}],style:{"--form-item-column":"inner"===(null==(r=e.fieldItem)?void 0:r.childWidthMode)?e.span:N(R,f.value.address,!1)+e.span}},{id:K.value,uuid:R,"widget-type":f.value.componentType,"field-key":L(p.value),"field-address":L(c.value),required:S.value}),{...a,label:C});var r}}}),p({title:"label"},((e,r)=>{const l=m(r)?void 0:a(r.selfErrors).length?function(e,r){if(!c(r.defined_error_msg)||!r.defined_error_msg)return e.map((e=>R(e,r))).join(",");return R(r.defined_error_msg,r)}(a(r.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:l,"validation-status":l?"error":void 0}})));export{K as FORM_ITEM};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,computed as a,inject as l,watch 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{isEqual as s,isArray as c,isString as p}from"lodash-es";import{NCascader as d}from"naive-ui";import"../../../index.js";import{useCommonInjection as m}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as v,InjectionFormUUID as f}from"../../constants/index.js";import"@vueuse/core";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"date-fns";import{assignUpdateValue as y,createVisitedSetter as h,traverseDependKey as k}from"../../utils/schema.js";import"@formily/reactive";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"./index.js";import{useFormField as j}from"../../hooks/useFormField.js";import"../../hooks/useFormValidator.js";const g=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 y=t(),{field:g,title:b}=j(),C=t(1),S=t(!0);const w=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),F=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"})),A=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");if(!Array.isArray(t)||!t.length)return null;const a=t.map((e=>e[F.value])).slice(-1).join(""),l=t.map((e=>e[w.value])).join(" / ");return a||l}catch(e){return null}}));function H(e,t,a){i("update:value",c(a)?a.map((function(e){return{...e,label:e[w.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const x=l(v);async function q(t){e.filterable?await async function(){if(!e.urlConfig||y.value&&e.requestCache)return;const t=await x.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:b.value,cache:e.requestCache,payload:{field:g.value,labelKey:w.value,valueKey:F.value}});function a(e,t,o){const r=[...o,...l(e)],n={[w.value]:e[w.value],[F.value]:e[F.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:r};return c(e.children)&&(n.children=e.children.map((e=>a(e,t+1,r))),n.isLeaf=!e.children.length),C.value=Math.max(C.value,t+1),n}function l(e){let t=[];if(p(e[w.value])&&(t=[...t,e[w.value]]),p(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}y.value=t.map((e=>a(e,0,[])))}():await async function(t){if(o(e,t))return;const a=await x.addAsync(r(s(t),i(e),b.value,t));if(!a.length&&t)return t.isLeaf=!0,H(0,0,n(t)),void(O.value=!1);const l=a.map((e=>u(e,s(t))));function o(e,t){return!i(e)||!t&&y.value&&e.requestCache||s(t)>=s(e)-1}function r(t,a,l,o){const r={lvlnr:t+1+""};return o&&a.dependKey&&k(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{[w.value]:a[w.value],[F.value]:a[F.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:y.value=l}(t),await B()}const V=`form-render__cascade--menu-${l(f)}`;async function B(){await n();const e=document.querySelector(`.${V} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function K(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;return!(e.checkStrategy.includes("child")&&a.depth<C.value)&&(l.length>0&&l.some((e=>e.includes(t.trim()))))}const{injectValueValidate:L,injectValueWatchFromEmpty:I,injectValueBindKey:E}=m();I((()=>e.value),q),L((()=>e.value)),o((()=>e.urlConfig),(async(t,a)=>{s(t,a)||(y.value=null,S.value?e.lazyRequest||(q(),S.value=!S.value):await q())}),{immediate:!0});const O=t(!1);function W(e){O.value=!!e,e&&q()}const z=a((()=>y.value||e.options||[])),N=a((()=>!e.filterable)),P=E(A);return()=>r(d,{key:P.value,remote:N.value,filterable:e.filterable,"menu-props":{class:V,onClick:B},"check-strategy":e.checkStrategy,show:!!O.value,"onUpdate:show":W,value:A.value,filter:K,"onUpdate:value":H,labelField:w.value,valueField:F.value,options:z.value,onLoad:q,onFocus:h(g)},u)}}),i({dataSource:"options"},y));export{g as SEARCH_CASCADER};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as o,inject as t,useAttrs as l,ref as a,createVNode as r,mergeProps as s,toRaw as n}from"vue";import{arrayed as u}from"../../../../../shared/utils/index.js";import{cloneDeep as i,isArray as p,isObject as m,omit as d,xor as c}from"lodash-es";import{NSelect as f}from"naive-ui";import"@vueuse/core";import"date-fns";import"@vue/shared";import{useSelectAllowModify as y}from"../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as v}from"../../../../../shared/hooks/selectHooks/useSelectRenders.js";import{connect as h,mapProps as b}from"@formily/vue";import{useCommonInjection as j,useSelectOptionProps as S}from"../../hooks/useCommonInjection.js";import{useComplexOptions as k,useComplexOptionsSpan as g}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as C,InjectionFormUUID as B}from"../../constants/index.js";import"
|
|
1
|
+
import{defineComponent as e,computed as o,inject as t,useAttrs as l,ref as a,createVNode as r,mergeProps as s,toRaw as n}from"vue";import{arrayed as u}from"../../../../../shared/utils/index.js";import{cloneDeep as i,isArray as p,isObject as m,omit as d,xor as c}from"lodash-es";import{NSelect as f}from"naive-ui";import"@vueuse/core";import"date-fns";import"@vue/shared";import{useSelectAllowModify as y}from"../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as v}from"../../../../../shared/hooks/selectHooks/useSelectRenders.js";import{connect as h,mapProps as b}from"@formily/vue";import{useCommonInjection as j,useSelectOptionProps as S}from"../../hooks/useCommonInjection.js";import{useComplexOptions as k,useComplexOptionsSpan as g}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as C,InjectionFormUUID as B}from"../../constants/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"../../../index.js";import{assignUpdateValue as F,assignClearBindVisited as A,createVisitedSetter as w}from"../../utils/schema.js";import"@formily/reactive";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"./index.js";import"@vueuse/shared";import{useFormField as H}from"../../hooks/useFormField.js";import{useUrlConfigOptions as O,useAutographOptions as K,useRecommendOptions as R}from"../../hooks/useFormRenderOptions.js";import"../../hooks/useFormValidator.js";const x=h(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},showField:{type:String},allowCreate:Boolean,shouldSave:Boolean,allowModify:Boolean,showCustomValue:Boolean,cursorPlacement:{type:String,default:"end"},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean},searchByValue:{type:Boolean}},emits:["update:value","postRecommend"],setup(e,{slots:h,emit:b}){const F=o({get:()=>e.value,async set(e){b("update:value",e),D(e)}}),{labelKey:A,valueKey:x,showKey:V,fetchData:L,searchContent:P,fullOptions:_,filterOptions:N,remoteOptions:I,loading:W}=e.urlConfig?O(e,F):K(e,F),{modifyEvent:E,modifyAbleRef:q,getOptionsWithCreated:M}=y(e,{searchContent:P,labelKey:A,valueKey:x,valueRef:F,fullOptions:_}),{renderComplexOption:T,hasComplexOption:U}=k(e,F),{getRecommend:z,postRecommend:D,sortedOptions:G}=R(e,N,b,A,x),{field:J,fieldKey:Q}=H();t(C).setContext(Q.value,(e=>({currentOption:i(function(e){const o=M(_.value);return p(e)?function(e){const t=o.reduce(((e,o)=>(e[o[x.value]]=o,e)),{});return e.map((e=>t[e]))}(e):(t=e,o.find((e=>e[x.value]===t)));var t}(e))})));const X=async e=>(P.value=e,Promise.allSettled([L(e),z(e)])),{injectValueValidate:Y,injectValueWatchFromEmpty:Z,injectValueBindKey:$}=j();Z(F,X),Y(F);const ee=$(F),{menuProps:oe,nodeProps:te}=S(),{renderTag:le,renderLabel:ae,renderSelectAll:re,titleRef:se}=v(e,{labelKey:A,valueKey:x,valueRef:F,showKey:V,searchContent:P}),ne=o((()=>M(q.value?_.value:G.value))),ue=l(),ie=o((()=>{if(e.allowCreate||e.showCustomValue)return F.value;const o=e.multiple&&p(F.value);return _.value.find((e=>o?F.value.includes(e[x.value]):e[x.value]===F.value))?F.value:null})),pe=a(!1);async function me(e){e&&await X(),pe.value=e}async function de(e,o){await E.updateValue(e,o),I.value&&o&&u(o).forEach((e=>{if(!m(e))return;const o=e;o.created&&o.shouldSave&&I.value.push(d(n(o),["created","shouldSave"]))}))}const ce=t(B),{getSpan:fe}=g(),ye=w(J,E.focus);function ve(o){if(!e.multiple)return;const t=o?ne.value.map((e=>e[x.value])):[];c(t,e.value).length&&(F.value=t)}function he(o){let t=h;return e.multiple&&e.selectAll&&(t={action:()=>re(ve),...h}),r(f,s({title:se.value,key:ee.value,multiple:e.multiple,remote:!0,filterable:!0,loading:W.value,value:ie.value,onUpdateValue:de,"menu-props":oe,"node-props":te,labelField:A.value,valueField:x.value,options:ne.value,onSearch:X,show:pe.value,"onUpdate:show":me,onFocus:ye,onBlur:E.blur,renderLabel:ae,renderTag:le},o,ue),t)}return()=>{var e,o;if(!U.value)return he();const t=null!=(o=null==(e=J.value.decoratorProps)?void 0:e.span)?o:6,l=fe(ce,J.value.address);return r("section",{class:"form-render__selectChildField",style:{"--column":l+t}},[he({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),_.value.map((e=>T({option:e,value:F.value,valueKey:x.value,labelKey:A.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":l}}})))])}}}),b({dataSource:"options"},F,A));export{x as SELECT};
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './useFormField';
|
|
4
|
-
export * from './useFieldVisitor';
|
|
5
|
-
export * from './useFieldNormalize';
|
|
6
|
-
export * from './useFormValidator';
|
|
1
|
+
export * from './useAnchor';
|
|
2
|
+
export * from './useAutoHidden';
|
|
7
3
|
export * from './useBusinessBinding';
|
|
8
4
|
export * from './useChangeContext';
|
|
9
|
-
export * from './useFormItemDeps';
|
|
10
|
-
export * from './useAnchor';
|
|
11
|
-
export * from './useFormContext';
|
|
12
5
|
export * from './useCommonInjection';
|
|
6
|
+
export * from './useCommonLog';
|
|
7
|
+
export * from './useComplexOptions';
|
|
8
|
+
export * from './useFieldListAdaptor';
|
|
9
|
+
export * from './useFieldNormalize';
|
|
10
|
+
export * from './useFieldVisitor';
|
|
11
|
+
export * from './useFormContext';
|
|
12
|
+
export * from './useFormEvent';
|
|
13
|
+
export * from './useFormField';
|
|
14
|
+
export * from './useFormGraph';
|
|
15
|
+
export * from './useFormItemDeps';
|
|
16
|
+
export * from './useFormRenderLifeCycle';
|
|
13
17
|
export * from './useFormRenderOptions';
|
|
18
|
+
export * from './useFormValidator';
|
|
19
|
+
export * from './useLowCodeEvent';
|
|
20
|
+
export * from './useLowCodeReactions';
|
|
21
|
+
export * from './useNuiThemeOverrides';
|
|
22
|
+
export * from './useOperationalForm';
|
|
23
|
+
export * from './usePresetScope';
|
|
24
|
+
export * from './useWordbookSetting';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{useAnchor}from"./useAnchor.js";export{useAutoHidden}from"./useAutoHidden.js";export{BusinessCollector,useBusinessBinding}from"./useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./useChangeContext.js";export{useCommonInjection,useSelectOptionProps}from"./useCommonInjection.js";export{useCommonLog}from"./useCommonLog.js";export{useComplexOptions,useComplexOptionsSpan}from"./useComplexOptions.js";export{useFieldListAdaptor}from"./useFieldListAdaptor.js";export{useFieldNormalize}from"./useFieldNormalize.js";export{useFieldVisitor}from"./useFieldVisitor.js";export{useFormContext}from"./useFormContext.js";export{useFormDomEvent,useFormExposeEvent}from"./useFormEvent.js";export{useFormField}from"./useFormField.js";export{useFormGraph}from"./useFormGraph.js";export{FormItemDepsCollector,useFormItemDeps}from"./useFormItemDeps.js";export{useFormRenderLifeCycle}from"./useFormRenderLifeCycle.js";export{useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./useFormRenderOptions.js";export{useFormValidator,validateMessageLocale}from"./useFormValidator.js";export{useLowCodeEvent}from"./useLowCodeEvent.js";export{useLowCodeReactions}from"./useLowCodeReactions.js";export{useNuiThemeOverrides}from"./useNuiThemeOverrides.js";export{useOperationalForm}from"./useOperationalForm.js";export{usePresetScope}from"./usePresetScope.js";export{useWordbookSetting,wordbookSettingHandler}from"./useWordbookSetting.js";
|
|
@@ -3,7 +3,7 @@ import { FieldItem, FormBusinessFormatter } from '../../../../../es/components/f
|
|
|
3
3
|
import { FIELD_BUSINESS_TYPE } from '../constants';
|
|
4
4
|
export declare class BusinessCollector {
|
|
5
5
|
private businessFormatter?;
|
|
6
|
-
|
|
6
|
+
triggerDisabled: boolean | string;
|
|
7
7
|
private readonly typeLockMap;
|
|
8
8
|
private readonly typeCollector;
|
|
9
9
|
private readonly fieldNameCollector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isField as e}from"@formily/core";import{
|
|
1
|
+
import{isField as e}from"@formily/core";import{Path as t}from"@formily/path";import{isString as s}from"@vueuse/core";import{format as i}from"date-fns";import{isFunction as r,isNumber as a}from"lodash-es";import{FIELD_BUSINESS_TYPE as n}from"../constants/index.js";import"vue";import"../../../../shared/utils/index.js";import"@vicons/ionicons5";import"@vue/shared";import"naive-ui";import"../../index.js";import{isIdCard as l,parseIdCard as o,parseAgeFromContext as u,parseBirthday as h,parseAge2Birthday as y}from"../utils/business.js";class p{constructor(e){this.businessFormatter=e,this.triggerDisabled=!1,this.typeLockMap=new Map,this.typeCollector=new Map,this.fieldNameCollector=new Map,this.changeHandlerMap=new Map([])}formatter(...e){return r(this.businessFormatter)?this.businessFormatter(...e):e[0].value}collect(e,t){this.typeCollector.set(e,t),this.fieldNameCollector.set(t.val_key,e)}getField(e){return this.typeCollector.get(e)}getFieldInstanceByType(e,t){const s=this.getField(t);return s?e.query(s.val_key).take():null}getType(e){return this.fieldNameCollector.get(e)}getValueByField(t,s){const i=t.query(s).take();return e(i)?i.value:null}getValueByType(e,t){const s=this.getField(t);return s?this.getValueByField(e,s.val_key):null}setValueByType(e,i,r,a){const n=this.getField(i);n&&e.setFieldState(n.val_key,(e=>{e.value!==r&&(!this.typeLockMap.get(i)&&this.typeLockMap.set(i,1),this.triggerDisabled&&s(this.triggerDisabled)&&t.parse(this.triggerDisabled).match(n.val_key)||(e.value=this.formatter({value:r,type:i,fieldKey:n.val_key,from:a})))}))}registerChangeBusiness(e,t){return this.changeHandlerMap.set(e,t),this}trigger(e,t,s="change"){var i;if(!0===this.triggerDisabled)return;const r=this.getType(t);if(!r)return;if("change"===s&&this.typeLockMap.get(r))return this.typeLockMap.set(r,0);const a="change"===s?this.changeHandlerMap:null;a&&(null==(i=a.get(r))||i.call(this,e))}}function c(){function e(){var e;const t=this.getField(n.BIRTHDAY);return null!=(e=null==t?void 0:t.date_format)?e:"yyyy-MM-dd HH:mm"}function t(t){const r=this.getValueByType(t,n.ID_CARD);if(!r||!s(r)||!l(r))return;const a=o(r),{age:h,ageUnit:y}=u(a);this.setValueByType(t,n.AGE_UNIT,y,n.ID_CARD),this.setValueByType(t,n.AGE,h,n.ID_CARD),this.setValueByType(t,n.SEX,a.sex,n.ID_CARD),this.setValueByType(t,n.BIRTHDAY,i(new Date(a.birthday),e.call(this)),n.ID_CARD)}function r(e){const t=this.getValueByType(e,n.BIRTHDAY);if(!s(t))return;const{age:i,ageUnit:r}=u(h(t));this.setValueByType(e,n.AGE_UNIT,r,n.BIRTHDAY),this.setValueByType(e,n.AGE,i,n.BIRTHDAY)}function c(t){return function(i){const r=this.getValueByType(i,n.AGE),l=this.getValueByType(i,n.AGE_UNIT);(s(r)||a(r))&&""!==r&&s(l)&&""!==l&&this.setValueByType(i,n.BIRTHDAY,y(+r,l,e.call(this)),t)}}return{create:function(e){return new p(e).registerChangeBusiness(n.ID_CARD,t).registerChangeBusiness(n.AGE_UNIT,c(n.AGE_UNIT)).registerChangeBusiness(n.AGE,c(n.AGE)).registerChangeBusiness(n.BIRTHDAY,r)}}}export{p as BusinessCollector,c as useBusinessBinding};
|
|
@@ -84,11 +84,11 @@ export declare function useFieldNormalize(): {
|
|
|
84
84
|
businessFormatter: import("../types").FormBusinessFormatter;
|
|
85
85
|
requestInstance: import("../../..").FormRequestDefine.RequestInstance;
|
|
86
86
|
enterToNextWidget: boolean | ((fieldItem: FieldItem) => boolean | void);
|
|
87
|
-
lowCodeReactions: import("../../../../../es/shared/types").
|
|
87
|
+
lowCodeReactions: import("../../../../../es/shared/types").LowCodeTypes.reactionsConfig[];
|
|
88
88
|
linebarAutoHidden: boolean;
|
|
89
89
|
bordered: string | boolean;
|
|
90
90
|
uniqueCacheData: boolean;
|
|
91
|
-
operationalForm: import("../../../../../es/shared/types").
|
|
91
|
+
operationalForm: import("../../../../../es/shared/types").LowCodeTypes.operationalConfig[];
|
|
92
92
|
outBordered: boolean;
|
|
93
93
|
forceClearable: boolean;
|
|
94
94
|
}>], import("../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
@@ -175,11 +175,11 @@ export declare function useFieldNormalize(): {
|
|
|
175
175
|
businessFormatter: import("../types").FormBusinessFormatter;
|
|
176
176
|
requestInstance: import("../../..").FormRequestDefine.RequestInstance;
|
|
177
177
|
enterToNextWidget: boolean | ((fieldItem: FieldItem) => boolean | void);
|
|
178
|
-
lowCodeReactions: import("../../../../../es/shared/types").
|
|
178
|
+
lowCodeReactions: import("../../../../../es/shared/types").LowCodeTypes.reactionsConfig[];
|
|
179
179
|
linebarAutoHidden: boolean;
|
|
180
180
|
bordered: string | boolean;
|
|
181
181
|
uniqueCacheData: boolean;
|
|
182
|
-
operationalForm: import("../../../../../es/shared/types").
|
|
182
|
+
operationalForm: import("../../../../../es/shared/types").LowCodeTypes.operationalConfig[];
|
|
183
183
|
outBordered: boolean;
|
|
184
184
|
forceClearable: boolean;
|
|
185
185
|
}>], import("../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as r}from"../../../../shared/utils/index.js";import{isFunction as e}from"@vueuse/core";function i(){return{traverse:function i(t,n,s="val_key"){return n?t.reduce(((t,o)=>{Array.isArray(o.children)&&(o.children=i(o.children,n,s)),Array.isArray(o.properties)&&(o.properties=i(o.properties,n,s)),o.suffixConfig&&(o.suffixConfig=i(r(o.suffixConfig),n,s));const f=Object.keys(n).
|
|
1
|
+
import{arrayed as r}from"../../../../shared/utils/index.js";import{isFunction as e}from"@vueuse/core";function i(){return{traverse:function i(t,n,s="val_key"){return n?t.reduce(((t,o)=>{Array.isArray(o.children)&&(o.children=i(o.children,n,s)),Array.isArray(o.properties)&&(o.properties=i(o.properties,n,s)),o.suffixConfig&&(o.suffixConfig=i(r(o.suffixConfig),n,s));const f=Object.keys(n).filter((r=>function(r,e){return"*"===r||r.split("|").some((r=>r.trim()===e))}(r,o[s]))),u=f.length&&f.map((r=>n[r]));let c=o;const p=[],a=[];return u&&u.forEach((i=>{e(i)&&i({field:o,replace(r){c=r},insertBefore(e){p.push(...r(e))},insertAfter(e){a.push(...r(e))}})})),t.concat([...p,c,...a])}),[]):t}}}export{i as useFieldVisitor};
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
import { AnyObject } from '../../../../../es/shared/types';
|
|
2
2
|
import { Field, Form, IFieldState } from '@formily/core';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
|
-
import { FieldItem, FormItemDepsCollector, FormRenderProps } from '../../../../../es/components/form-render';
|
|
5
|
-
|
|
4
|
+
import { BusinessCollector, FieldItem, FormItemDepsCollector, FormRenderProps } from '../../../../../es/components/form-render';
|
|
5
|
+
import { wordbookSettingHandler } from '../../../../../es/components/form-render/src/hooks';
|
|
6
|
+
export declare function useFormExposeEvent({ formModel, formRenderRef, formUUID, getFieldList, formItemDepsCollector, businessCollector, wordbookSettingHandler }: {
|
|
6
7
|
formModel: Form;
|
|
7
8
|
formRenderRef: Ref<HTMLElement | undefined>;
|
|
8
9
|
formUUID: string;
|
|
9
10
|
getFieldList: () => FieldItem[];
|
|
10
11
|
formItemDepsCollector: FormItemDepsCollector;
|
|
12
|
+
businessCollector: BusinessCollector;
|
|
13
|
+
wordbookSettingHandler: wordbookSettingHandler;
|
|
11
14
|
}): {
|
|
12
15
|
validate(path?: string | ((field: Field) => boolean), { force }?: {
|
|
13
16
|
force?: boolean | undefined;
|
|
14
17
|
}): Promise<void>;
|
|
15
18
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
16
|
-
setFormValues(values: AnyObject,
|
|
19
|
+
setFormValues(values: AnyObject, options?: boolean | {
|
|
20
|
+
needSplitExtendKey?: boolean | undefined;
|
|
21
|
+
avoidBusinessConnection?: string | boolean | undefined;
|
|
22
|
+
avoidDependKeyConnection?: string | boolean | undefined;
|
|
23
|
+
avoidWordbookSettingConnection?: string | boolean | undefined;
|
|
24
|
+
overwrite?: boolean | undefined;
|
|
25
|
+
}, avoidBusinessConnection?: string | boolean, overwrite?: boolean): Promise<void>;
|
|
17
26
|
setFieldState(path: string, setter: (field: IFieldState) => void): void;
|
|
18
27
|
resetFields(path?: string): Promise<void>;
|
|
19
28
|
queryWidget(key: string): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isFunction as s,isArray as a,isString as
|
|
1
|
+
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isFunction as s,isArray as a,isString as l,isBoolean as d}from"lodash-es";import{nextTick as u}from"vue";import"../../index.js";import{FormItemLineBarDepKeyPrepend as f,NESTED_FORM_ITEM_TYPE as m}from"../constants/index.js";import{queryDecoratorByAddress as c,queryInput as g,queryDecoratorByFieldKey as p,findNextWidget as v}from"../utils/dom.js";import{validateMessageParser as y,combineExtendKey as h,splitExtendKey as b}from"../utils/index.js";import{getParentLinebar as x}from"../utils/schema.js";function I({formModel:t,formRenderRef:n,formUUID:m,getFieldList:v,formItemDepsCollector:I,businessCollector:j,wordbookSettingHandler:w}){return{validate(o="*",{force:d}={}){if(s(o)){const e=Object.entries(t.fields).reduce(((e,[t,r])=>(o(r)&&e.push(t),e)),[]);if(!e.length)return Promise.resolve();o=e.length?`*(${e.join(",")})`:"*"}const u=[];d&&t.setFieldState(o,(e=>{"visible"===e.display&&"editable"!==e.pattern&&r(e)&&(u.push({pattern:e.pattern,state:e}),e.pattern="editable")}));const f=t.validate(o).catch((e=>Promise.reject(Array.isArray(e)?e.reduce(p,[]):e)));return d&&u.forEach((({pattern:e,state:t})=>t.pattern=e)),f;function p(t,r){if(!i(r))return t;let o=!1;return a(r.messages)&&r.messages.forEach((r=>{i(r)&&(t.push(...e(r).map(v)),o=!0)})),!o&&t.push(v(r)),t}function v(e){if(e.decoratorElement)return e;const r=t.query(e.path),o=r.get("title"),s=e.messages.map((e=>function(e,t){if(!t||!i(t.fieldItem))return e;const r=t.fieldItem.defined_error_msg;return y(r&&l(r)?r:e,t.fieldItem)}(e,r.get("decoratorProps")))),a=c(e.address,n.value,m);return{...e,messages:s,title:o,decoratorElement:a,...g(a)}}},getFormValues(e=!0){let r=t.getFormState().values;return e&&(r=h(v(),r)),r},async setFormValues(e,n={},s=!1,a=!0){var l,f,m,c,g;let p=!0,y=!0,h=!0;i(n)?(y=null==(l=n.needSplitExtendKey)||l,p=null==(f=n.avoidDependKeyConnection)||f,s=null!=(m=n.avoidBusinessConnection)&&m,h=null==(c=n.avoidWordbookSettingConnection)||c,a=null==(g=n.overwrite)||g):d(n)&&(y=n),j.triggerDisabled=s,I.triggerDisabled=p,w.triggerDisabled=h,y&&(e=b(v(),e)),t.setFieldState("*",(t=>{r(t)&&(a||o.existIn(e,t.path))&&(t.value=o.getIn(e,t.path))})),await u(),j.triggerDisabled=!1,I.triggerDisabled=!1,w.triggerDisabled=!1},setFieldState(e,r){t.setFieldState(e,r)},resetFields:(e="*")=>t.reset(e),queryWidget:async e=>n.value?await async function(e,t,r){if(!n.value)return s();const o=p(e,t,m);if(o)return s(o);const i=x(e,r);return i?(I.trigger(f+i,!0),await u(),s(p(e,t,m))):s();function s(e){return{decoratorElement:e,...g(e)}}}(e,n.value,v()):null}}function j({props:e,formRenderRef:r,formModel:o}){return{onKeydown:async function i(a){var l;if(e.enterToNextWidget&&a.target){if("TEXTAREA"===a.target.tagName&&!a.ctrlKey)return;a.preventDefault()}if(await n(0),Reflect.get(a,"stopCapture")||!e.enterToNextWidget||!r.value)return;const d=t(a.target,(e=>e.classList.contains("form-render__formItem")));if(!d)return;const u=`.form-render__formItem${m.map((e=>`:not([widget-type=${e}])`)).join("")}`,f=Array.from(r.value.querySelectorAll(u)),c=f.findIndex((e=>e.id===d.id));if(!~c)return;const{widget:g,field:p}=v(f,c,a.target);if(g)if(s(e.enterToNextWidget)){const t=p&&o.query(p).take();!t||e.enterToNextWidget(null==(l=t.decoratorProps)?void 0:l.fieldItem)?y():i({target:g})}else y();async function y(){await n(0),g.focus()}}}}export{j as useFormDomEvent,I as useFormExposeEvent};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnyFn } from '../../../../../es/shared/types';
|
|
2
2
|
import { DependKeyType } from '../../../../../es/components/form-render';
|
|
3
3
|
export declare class FormItemDepsCollector {
|
|
4
|
-
triggerDisabled: boolean;
|
|
4
|
+
triggerDisabled: string | boolean;
|
|
5
5
|
private readonly collector;
|
|
6
6
|
setDeps(key: string, dependKeys: DependKeyType, callback: AnyFn): void;
|
|
7
7
|
getDeps(dependKey: string): Map<string, AnyFn<any[], any>> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Path as t}from"@formily/path";import{isFunction as e,isString as r}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import"../../index.js";import"date-fns";import{traverseDependKey as i}from"../utils/schema.js";class s{constructor(){this.triggerDisabled=!1,this.collector=new Map}setDeps(t,e,r){i(e,(e=>{const i=this.collector.get(e)||new Map;i.set(t,r),this.collector.set(e,i)}))}getDeps(t){return this.collector.get(t)}trigger(i,s){if(!0===this.triggerDisabled)return;const o=this.getDeps(i);o&&[...o.entries()].forEach((([i,o])=>{!e(o)||this.triggerDisabled&&r(this.triggerDisabled)&&t.parse(this.triggerDisabled).match(i)||o(s)}))}}function o(){return{create:function(){return new s}}}export{s as FormItemDepsCollector,o as useFormItemDeps};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormRequestDefine } from '../../../../../es/shared/hooks';
|
|
2
|
-
import { AnyObject,
|
|
2
|
+
import { AnyObject, AnyFn, LowCodeTypes } from '../../../../../es/shared/types';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
4
|
import { UrlConfig } from '../../../../../es/components/form-render';
|
|
5
5
|
import { RecommendItem } from '../../../../../es/components/recommend-search/src/types';
|
|
@@ -46,7 +46,7 @@ export declare function useAutographOptions(props: Partial<{
|
|
|
46
46
|
valueField: string;
|
|
47
47
|
showField: string;
|
|
48
48
|
requestCache: boolean;
|
|
49
|
-
wordbook:
|
|
49
|
+
wordbook: LowCodeTypes.wordbook;
|
|
50
50
|
autograph: string;
|
|
51
51
|
lazyRequest: boolean;
|
|
52
52
|
options: AnyObject[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LowCodeTypes } from '../../../../../es/shared/types';
|
|
2
2
|
import { Form } from '@formily/core';
|
|
3
3
|
import { MaybeRef } from '@vueuse/core';
|
|
4
|
-
export declare function useLowCodeReactions(configListRef: MaybeRef<
|
|
4
|
+
export declare function useLowCodeReactions(configListRef: MaybeRef<LowCodeTypes.reactionsConfig[] | undefined>, formModel: Form): {
|
|
5
5
|
lowCodeReactionsHandler: (field: string) => void;
|
|
6
6
|
triggerAllReactionsHandler: () => void;
|
|
7
7
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LowCodeTypes } from '../../../../../es/shared/types';
|
|
2
2
|
import { Form } from '@formily/core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export declare function useOperationalForm(props: {
|
|
4
|
+
operationalForm?: LowCodeTypes.operationalConfig[];
|
|
5
|
+
dateOperationalForm?: LowCodeTypes.dateOperationalConfig[];
|
|
6
|
+
}, formModel: Form): {
|
|
7
|
+
operationalFormHandler(fieldKey: string): void;
|
|
8
|
+
triggerAllOperationalFormHandler(): void;
|
|
7
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../../shared/utils/index.js";import{getOperationalFormHandler as
|
|
1
|
+
import"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{format as e}from"date-fns";import{isNumber as o,isDate as t}from"lodash-es";import{computed as a}from"vue";import{getOperationalFormHandler as l,getDateOperationalFormHandler as n}from"../../../../shared/utils/business.js";function i(i,m){const s=r=>m.getValuesIn(r),{triggerAllOperationalFormHandler:d,operationalFormHandler:p}=l(a((()=>i.operationalForm)),s,((r,e)=>m.setValuesIn(r,e))),{triggerAllDateOperationalFormHandler:u,dateOperationalFormHandler:f}=n(a((()=>i.dateOperationalForm)),s,((a,l)=>{var n,i,s;const d=m.query(a).take();if(!r(d))return;const[p]=d.component||[];if(["DATE","TIME"].includes(p)){const r=null!=(s=null==(i=null==(n=d.decoratorProps)?void 0:n.fieldItem)?void 0:i.date_format)?s:"yyyy-MM-dd";l=o(l)||t(l)?e(new Date(l),r):l}d.setValue(l)}));return{operationalFormHandler(r){p(r),f(r)},triggerAllOperationalFormHandler(){d(),u()}}}export{i as useOperationalForm};
|