cnhis-design-vue 3.1.49-release.2 → 3.1.50-beta.0
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/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/classification/src/index.vue2.js +1 -1
- package/es/components/expand-field/index.d.ts +1622 -0
- package/es/components/expand-field/index.js +1 -0
- package/es/components/expand-field/src/components/FormBatchOptionsModal.vue.d.ts +54 -0
- package/es/components/expand-field/src/components/FormBatchOptionsModal.vue.js +1 -0
- package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -0
- package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +841 -0
- package/es/components/expand-field/src/components/FormItemPerson.vue.js +1 -0
- package/es/components/expand-field/src/components/FormItemPerson.vue2.js +1 -0
- package/es/components/expand-field/src/components/PersonModal.vue.d.ts +777 -0
- package/es/components/expand-field/src/components/PersonModal.vue.js +1 -0
- package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -0
- package/es/components/expand-field/src/components/form.vue.d.ts +1494 -0
- package/es/components/expand-field/src/components/form.vue.js +1 -0
- package/es/components/expand-field/src/components/form.vue2.js +1 -0
- package/es/components/expand-field/src/constants/index.d.ts +3 -0
- package/es/components/expand-field/src/constants/index.js +1 -0
- package/es/components/expand-field/src/hooks/useAsyncData.d.ts +6 -0
- package/es/components/expand-field/src/hooks/useAsyncData.js +1 -0
- package/es/components/expand-field/src/index.vue.d.ts +1624 -0
- package/es/components/expand-field/src/index.vue.js +1 -0
- package/es/components/expand-field/src/index.vue2.js +1 -0
- package/es/components/expand-field/src/types/index.d.ts +1 -0
- package/es/components/expand-field/src/types/index.js +1 -0
- package/es/components/expand-field/src/utils/constant.d.ts +17 -0
- package/es/components/expand-field/src/utils/constant.js +1 -0
- package/es/components/expand-field/src/utils/index.d.ts +6 -0
- package/es/components/expand-field/src/utils/index.js +1 -0
- package/es/components/expand-field/src/utils/tool.d.ts +2 -0
- package/es/components/expand-field/src/utils/tool.js +1 -0
- package/es/components/expand-field/style/expand-field-iconfont.ttf +0 -0
- package/es/components/expand-field/style/index.css +1 -0
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +1 -1
- package/es/components/field-set/index.d.ts +177 -16
- package/es/components/field-set/src/FieldSet.vue.d.ts +161 -17
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/components/Row.vue.d.ts +116 -15
- package/es/components/field-set/src/components/Row.vue2.js +1 -1
- package/es/components/field-set/src/types/index.d.ts +1 -1
- package/es/components/field-set/src/utils/index.js +1 -1
- package/es/components/field-set/style/index.css +1 -1
- package/es/components/form-config/index.d.ts +593 -5
- package/es/components/form-config/src/FormConfig.vue.d.ts +593 -5
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +17 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +296 -4
- package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
- package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
- package/es/components/form-render/index.d.ts +17 -1
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +17 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +17 -1
- package/es/components/form-render/src/components/renderer/complex.js +1 -1
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.d.ts +7 -2
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/renderer/inputNumber.js +1 -1
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +16 -0
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/components/renderer/simpleComponent.d.ts +3 -1
- package/es/components/form-render/src/components/renderer/simpleComponent.js +1 -1
- package/es/components/form-render/src/components/renderer/switch.js +1 -1
- package/es/components/form-render/src/components/renderer/textarea.js +1 -1
- package/es/components/form-render/src/constants/index.d.ts +2 -1
- package/es/components/form-render/src/constants/index.js +1 -1
- package/es/components/form-render/src/hooks/useAnchor.js +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
- package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.d.ts +4 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +4 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/hooks/useFormContext.js +1 -1
- package/es/components/form-render/src/hooks/useFormItemDeps.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +4 -0
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +9 -5
- package/es/components/form-render/src/types/index.d.ts +1 -0
- package/es/components/form-render/src/utils/index.d.ts +2 -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/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +297 -3
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterVisibleEventPlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterVisibleEventPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +2 -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/hooks/useAutoFocus.d.ts +6 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useAutoFocus.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +6 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +2 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +1 -0
- package/es/components/iho-table/style/index.css +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 +42 -3
- package/es/components/info-header/src/InfoHeader.vue.d.ts +42 -3
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +4 -1
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +4 -1
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +21 -2
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +17 -1
- package/es/components/keyboard/index.d.ts +3 -3
- package/es/components/keyboard/src/Keyboard.vue.d.ts +3 -3
- package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
- package/es/components/multi-chat/src/components/ChatMain.vue2.js +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 +0 -6
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/select-person/style/index.css +1 -1
- package/es/components/shortcut-setter/index.d.ts +21 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +21 -1
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +3 -0
- 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/components/CancelRadio/CancelRadio.d.ts +10 -0
- package/es/shared/components/CancelRadio/CancelRadio.js +1 -0
- package/es/shared/components/CancelRadio/index.d.ts +2 -0
- package/es/shared/components/CancelRadio/index.js +1 -0
- package/es/shared/components/InputNumberSlash/InputNumberSlash.d.ts +40 -0
- package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -0
- package/es/shared/components/InputNumberSlash/index.d.ts +2 -0
- package/es/shared/components/InputNumberSlash/index.js +1 -0
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/hooks/useDateTime.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/anime.d.ts +2 -1
- package/es/shared/utils/anime.js +1 -1
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as j,createElementVNode as b,withKeys as k,toDisplayString as v,renderSlot as F}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as S,cloneDeep as H,isObject as x,isBoolean as A}from"lodash-es";import{createForm as L,onFieldValueChange as O,onFieldMount as R,onFieldUnmount as
|
|
1
|
+
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as j,createElementVNode as b,withKeys as k,toDisplayString as v,renderSlot as F}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as S,cloneDeep as H,isObject as x,isBoolean as A}from"lodash-es";import{createForm as L,onFieldValueChange as O,onFieldMount as R,onFieldUnmount as B,onFieldReact as w,onFormMount as _}from"@formily/core";import{FormProvider as D,FormConsumer as V}from"@formily/vue";import{NForm as I,NTabs as N,NTabPane as q,NConfigProvider as W}from"naive-ui";import{InjectionFormLifeCycleCaller as E,InjectionFormGraph as K}from"./constants/index.js";import{useAutoHidden as T}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as U}from"./hooks/useComplexOptions.js";import{useFormDomEvent as G,useFormExposeEvent as M}from"./hooks/useFormEvent.js";import{useFormGraph as P}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as J}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as $}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as z}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as Q}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as X}from"./hooks/useOperationalForm.js";import{useWordbookSetting as Y}from"./hooks/useWordbookSetting.js";import"../../../shared/utils/index.js";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"../index.js";import{createObjSchema as Z}from"./utils/schema.js";import{useFieldListAdaptor as ee}from"./hooks/useFieldListAdaptor.js";import{useFieldVisitor as oe}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as te}from"./hooks/useFormValidator.js";import{useAnchor as re}from"./hooks/useAnchor.js";import{useFormContext as se}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";const ae={key:0,style:{height:"54px"}},ie={style:{"white-space":"pre"}};var le=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:Object},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},outBordered:{type:Boolean,default:!1},uniqueCacheData:{type:Boolean,default:!1}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:le,emit:ne}){const me=e,de=C(),{nuiThemeOverrides:pe}=Q();te();const ue=o(),ce=t((()=>S(me.maxHeight)?me.maxHeight+"px":me.maxHeight)),{SchemaField:fe,businessCollector:he,formItemDepsCollector:ye,changeContextCollector:ge,formUUID:je}=se(me,ne),{anchorBarRef:be,currentAnchor:ke,updateAnchorList:ve,anchorIdList:Fe,onScroll:Ce}=re(me,ne,ue,ye),{callLifeCycle:Se}=J(me);r(E,Se),Se("onSetup");const{trigger:He}=T(),{observeFormGraph:xe,setGraph:Ae,removeGraph:Le}=P();r(K,xe);const{lowCodeEventTrigger:Oe}=$(),Re=L({initialValues:me.initialData,effects(e){O("*",(o=>{const t=o.props.name.toString();he.trigger(e,t),ye.trigger(t),ne("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:ge.getContext(t,o.value)}),Oe(o),Be(t,o.value),_e(t),Ve(t,o.value)})),R("*",Ae),B("*",Le),me.linebarAutoHidden&&(w("*",He),_((e=>e.query("*").forEach(He)))),me.anchor&&w("*",ve)}}),{lowCodeReactionsHandler:Be,triggerAllReactionsHandler:we}=z(t((()=>me.lowCodeReactions)),Re),{operationalFormHandler:_e,triggerAllOperationalFormHandler:De}=X(t((()=>me.operationalForm)),Re),{wordbookSettingHandler:Ve}=Y(Re,ge);s(we),s(De);const{schemaAdaptor:Ie}=ee(he);let Ne=me.fieldList||[];const qe=t((()=>me.schema?me.schema:me.fieldList?(Ne=oe().traverse(H(me.fieldList),me.fieldVisitor),Z(Ie(Ne,me))):Z({}))),{onKeydown:We}=G({formModel:Re,formRenderRef:ue,props:me}),{clearSpan:Ee}=U();a((()=>Ee(je)));const Ke=M({formModel:Re,formRenderRef:ue,formItemDepsCollector:ye,getFieldList:()=>Ne,formUUID:je});return le({formModel:Re,validate:(e="*")=>Ke.validate(e),getFormValues:(e=!0)=>Ke.getFormValues(e),async setFormValues(e,o={},t=!1,r=!0){var s,a,l,n;let m=!0,d=!0;x(o)?(d=null==(s=o.needSplitExtendKey)||s,m=null==(a=o.avoidDependKeyConnection)||a,t=null!=(l=o.avoidBusinessConnection)&&l,r=null==(n=o.overwrite)||n):A(o)&&(d=o),t&&(he.triggerLock=!0),m&&(ye.triggerDisabled=!0),Ke.setFormValues(e,d,r),await i(),he.triggerLock=!1,ye.triggerDisabled=!1},setFieldState(e,o){Ke.setFieldState(e,o)},resetFields(e="*"){Ke.resetFields(e)},queryWidget:async e=>Ke.queryWidget(e),getFieldList:()=>Ne,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(I),{class:d(["form-render",{"form-render--out-border":e.outBordered}]),"require-mark-placement":"left",style:p(m(de))},{default:u((()=>[e.anchor?(l(),c("section",ae,[f(m(N),{value:m(ke),"onUpdate:value":t[0]||(t[0]=e=>h(ke)?ke.value=e:null),type:"line",ref_key:"anchorBarRef",ref:be},{default:u((()=>[(l(!0),c(y,null,g(m(Fe),(e=>(l(),n(m(q),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):j("v-if",!0),f(m(W),{"theme-overrides":m(pe)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":m(ce)}),ref_key:"formRenderRef",ref:ue,onScroll:t[1]||(t[1]=(...e)=>m(Ce)&&m(Ce)(...e)),onKeydownCapture:t[2]||(t[2]=k(((...e)=>m(We)&&m(We)(...e)),["enter"]))},[f(m(D),{form:m(Re)},{default:u((()=>[f(m(fe),{schema:m(qe)},null,8,["schema"]),e.consumer?(l(),n(m(V),{key:0},{default:u((({form:e})=>[b("div",ie,v(JSON.stringify(e.values,null,2)),1)])),_:1})):j("v-if",!0),F(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}});export{le as default};
|
|
@@ -141,6 +141,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
141
141
|
type: (BooleanConstructor | StringConstructor)[];
|
|
142
142
|
default: boolean;
|
|
143
143
|
};
|
|
144
|
+
outBordered: {
|
|
145
|
+
type: BooleanConstructor;
|
|
146
|
+
default: boolean;
|
|
147
|
+
};
|
|
144
148
|
uniqueCacheData: {
|
|
145
149
|
type: BooleanConstructor;
|
|
146
150
|
default: boolean;
|
|
@@ -281,6 +285,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
281
285
|
type: (BooleanConstructor | StringConstructor)[];
|
|
282
286
|
default: boolean;
|
|
283
287
|
};
|
|
288
|
+
outBordered: {
|
|
289
|
+
type: BooleanConstructor;
|
|
290
|
+
default: boolean;
|
|
291
|
+
};
|
|
284
292
|
uniqueCacheData: {
|
|
285
293
|
type: BooleanConstructor;
|
|
286
294
|
default: boolean;
|
|
@@ -334,7 +342,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
334
342
|
operationalFormHandler: (field: string) => void;
|
|
335
343
|
triggerAllOperationalFormHandler: () => void;
|
|
336
344
|
wordbookSettingHandler: (fieldKey: string, value: unknown) => void;
|
|
337
|
-
schemaAdaptor: (fieldList: import("../../../../es/components/form-render").FieldItem[]
|
|
345
|
+
schemaAdaptor: (fieldList: import("../../../../es/components/form-render").FieldItem[], options?: {
|
|
346
|
+
column: number;
|
|
347
|
+
outBordered?: boolean | undefined;
|
|
348
|
+
}) => Record<string, import("@formily/json-schema").Stringify<{
|
|
338
349
|
[key: symbol]: any;
|
|
339
350
|
[key: `x-${string}`]: any;
|
|
340
351
|
[key: `x-${number}`]: any;
|
|
@@ -750,6 +761,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
750
761
|
type: (BooleanConstructor | StringConstructor)[];
|
|
751
762
|
default: boolean;
|
|
752
763
|
};
|
|
764
|
+
outBordered: {
|
|
765
|
+
type: BooleanConstructor;
|
|
766
|
+
default: boolean;
|
|
767
|
+
};
|
|
753
768
|
uniqueCacheData: {
|
|
754
769
|
type: BooleanConstructor;
|
|
755
770
|
default: boolean;
|
|
@@ -771,6 +786,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
771
786
|
linebarAutoHidden: boolean;
|
|
772
787
|
bordered: string | boolean;
|
|
773
788
|
uniqueCacheData: boolean;
|
|
789
|
+
outBordered: boolean;
|
|
774
790
|
}>;
|
|
775
791
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
776
792
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,createVNode as r}from"vue";import{connect as t,mapProps as o}from"@formily/vue";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"../../../index.js";import"date-fns";import{assignUpdateValue as
|
|
1
|
+
import{defineComponent as e,createVNode as r}from"vue";import{connect as t,mapProps as o}from"@formily/vue";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"naive-ui";import"../../../index.js";import"date-fns";import{assignUpdateValue as i}from"../../utils/schema.js";const p=t(e({props:{onChange:{},span:{type:Number,default:6},display:{type:String,default:"grid"},wrapperStyle:{type:Object,default:()=>({})}},setup:(e,{slots:t})=>()=>r("section",{class:"form-render__complex"},[r("section",{class:`form-render__complexContent--${e.display}`,style:e.wrapperStyle},[t.default&&t.default()])])}),o(i));export{p as COMPLEX};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,watch as
|
|
1
|
+
import{defineComponent as e,computed as t,watch as o,createVNode as a,mergeProps as r}from"vue";import{generateTimeFormat as i}from"../../../../../shared/utils/index.js";import{connect as n,mapProps as u}from"@formily/vue";import{isObject as s}from"@vueuse/core";import{format as m}from"date-fns";import l from"../../../../date-picker/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"../../../index.js";import{assignUpdateValue as v,assignClearBindVisited as c}from"../../utils/schema.js";const p=n(e({props:{onChange:{},value:{type:String},validate:{type:Object},valueFormat:{type:String,default:"yyyy-MM-dd"}},emits:["update:value"],setup(e,{emit:n}){const{injectValueValidate:u,injectValueBindKey:v}=d();function c(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.min_date)}function p(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.max_date)}function f(e){return c()&&e<Date.now()-864e5||p()&&e>Date.now()}function y(e){const t=new Date(e),o=new Date,a=new Date(t);a.setHours(0),a.setMinutes(0),a.setSeconds(0);const r=new Date(t);r.setHours(23),r.setMinutes(59),r.setSeconds(59);const i=a>o,n=r<o,u=t.getHours(),s=o.getHours(),m=o.getMinutes();return{isHourDisabled:function(e){return c()&&!i&&e<s||p()&&!n&&e>s},isMinuteDisabled:function(e){if(u===s)return c()&&!i&&e<m||p()&&!n&&e>m;return c()&&!i&&u<s||p()&&!n&&u>s}}}u((()=>e.value));const D=t((()=>{const t={};if(s(e.validate)){const{min_date:o,max_date:a}=e.validate;(o||a)&&(t.isDateDisabled=f,t.isTimeDisabled=y)}return t})),j=t((()=>({valueFormat:e.valueFormat,format:e.valueFormat,timePickerProps:{format:i(e.valueFormat)}})));function g(t){return t?m(new Date(t),e.valueFormat):t}o((()=>e.value),(e=>{e&&g(e)!==e&&n("update:value",g(e))}));const h=t({get:()=>g(e.value),set:e=>{n("update:value",e)}}),w=v(h);return()=>a(l,r({key:w.value},D.value,j.value,{"formatted-value":h.value,"onUpdate:formatted-value":e=>h.value=e}),null)}}),u(v,c));export{p as DATE};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
+
import { FieldItem } from '../../../../../../es/components/form-render';
|
|
2
3
|
export declare const FORM_ITEM: import("vue").DefineComponent<{
|
|
3
4
|
label: StringConstructor;
|
|
4
5
|
propertyKey: StringConstructor;
|
|
@@ -12,7 +13,9 @@ export declare const FORM_ITEM: import("vue").DefineComponent<{
|
|
|
12
13
|
};
|
|
13
14
|
labelRender: FunctionConstructor;
|
|
14
15
|
annotation: {};
|
|
15
|
-
fieldItem: {
|
|
16
|
+
fieldItem: {
|
|
17
|
+
type: PropType<FieldItem>;
|
|
18
|
+
};
|
|
16
19
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
20
|
label: StringConstructor;
|
|
18
21
|
propertyKey: StringConstructor;
|
|
@@ -26,7 +29,9 @@ export declare const FORM_ITEM: import("vue").DefineComponent<{
|
|
|
26
29
|
};
|
|
27
30
|
labelRender: FunctionConstructor;
|
|
28
31
|
annotation: {};
|
|
29
|
-
fieldItem: {
|
|
32
|
+
fieldItem: {
|
|
33
|
+
type: PropType<FieldItem>;
|
|
34
|
+
};
|
|
30
35
|
}>>, {
|
|
31
36
|
span: number;
|
|
32
37
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as r,computed as o,ref as l,onUnmounted as t,createVNode as
|
|
1
|
+
import{defineComponent as e,inject as r,computed as o,ref as l,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 j,InjectionFormGraph as I,InjectionAnnotation as k,InjectionFormGlobalProps as F}from"../../constants/index.js";import{useComplexOptionsSpan as h}from"../../hooks/useComplexOptions.js";import{dotEscape as R}from"../../utils/schema.js";import{validateMessageParser as L}from"../../utils/index.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(),L=r(j),K=o((()=>R(`${L}-${c.value}`))),S=l(!1);if(m(f.value)&&b(e.suffixFields)){const o=r(I);t(u(o,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(k),E=o({get(){var r,o;return null!=(o=null==(r=A.value)?void 0:r[e.propertyKey])?o:""},set(r){A.value={property:e.propertyKey,value:r}}});const O=o((()=>A.value&&!1!==e.annotation)),V=o((()=>e.label&&" "!==e.label)),$=o((()=>{let r=0;return O.value&&(r+=18),e.remark&&(r+=18),r})),w=r(F,{}),C=o((()=>{var r;const o=null==(r=e.fieldItem)?void 0:r.bordered;return null==o?w.bordered:o}));function M(){return V.value?n("section",{class:"form-render__formItemLabel"},[n("span",{class:"form-render__formItemLabel--text",style:{marginRight:s($.value)}},[y(e.labelRender)?e.labelRender(e.label):e.label]),$.value?n("section",{class:"form-render__formItemLabel--operation"},[e.remark?n("div",{class:"form-render__formItemLabel--tooltip"},[n(x,{message:e.remark},null)]):null,O.value?n(g,{class:"form-render__formItemLabel--annotation",modelValue:E.value,"onUpdate:modelValue":e=>E.value=e},null):null]):null]):null}const{getSpan:N}=h();return()=>n(_,i({class:["form-render__formItem",{"form-render--no-border":!C.value,"form-render--underline":"underline"===C.value}],style:{"--form-item-column":N(L,f.value.address,!1)+e.span}},{id:K.value,uuid:L,"widget-type":f.value.componentType,"field-key":R(p.value),"field-address":R(c.value),required:S.value}),{...a,label:M})}}),p({title:"label"},((e,r)=>{const o=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=>L(e,r))).join(",");return L(r.defined_error_msg,r)}(a(r.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:o,"validation-status":o?"error":void 0}})));export{K as FORM_ITEM};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,watch as
|
|
1
|
+
import{defineComponent as e,watch as t,computed as n,createVNode as u,mergeProps as o}from"vue";import r from"../../../../../shared/components/InputNumberSlash/InputNumberSlash.js";import{connect as i,mapProps as a}from"@formily/vue";import{isString as l,isNumber as p}from"lodash-es";import{NInputNumber as s}from"naive-ui";import{useCommonInjection as m}from"../../hooks/useCommonInjection.js";import{createInputSlot as c,parseNumberFromMaybeString as v}from"../../utils/index.js";import{assignUpdateValue as f,assignClearBindVisited as y}from"../../utils/schema.js";const g=i(e({props:{value:{type:[Number,String]},onChange:{type:Function,required:!0},prefix:{type:[String,Function,Object]},suffix:{type:[String,Function,Object]}},setup(e){const o=c(e);m().injectValueValidate((()=>e.value)),t((()=>e.value),(t=>{if(null!=t)return!l(t)&&!p(t)||Number.isNaN(+t)?e.onChange(null):void e.onChange(+t)}));const r=n({get:()=>v(e.value),set:t=>{var n;return null==(n=e.onChange)?void 0:n.call(e,t)}}),i=m().injectValueBindKey(r);return()=>u(s,{key:i.value,value:r.value,"onUpdate:value":e=>r.value=e,"show-button":!1},o.value)}}),a(f,y)),h=i(e({props:{value:{type:[Number,String]},onChange:{type:Function,required:!0},prefix:{type:[String,Function,Object]},suffix:{type:[String,Function,Object]},precision:{type:Number}},setup(e){const t=m().injectValueBindKey((()=>e.value));return()=>u(r,o(e,{key:t.value}),null)}}),a(f,y));export{g as INPUT_NUMBER,h as INPUT_NUMBER_SLASH};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,
|
|
1
|
+
import{defineComponent as e,computed as t,createVNode as o,isVNode as a}from"vue";import l from"../../../../../shared/components/CancelRadio/CancelRadio.js";import{connect as r,mapProps as i}from"@formily/vue";import{isNumber as u}from"lodash-es";import{NSpace as n,NRadioGroup as p,NCheckbox as s,NCheckboxGroup as c}from"naive-ui";import"../../../index.js";import{useComplexOptions as d}from"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"date-fns";import{assignUpdateValue as m,createVisitedSetter as v}from"../../utils/schema.js";import{useUrlConfigOptions as f,useAutographOptions as y}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as h}from"../../hooks/useCommonInjection.js";import{useFormField as b}from"../../hooks/useFormField.js";function j(l,r,i){return e({name:l,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},urlConfig:{type:Object},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},wordbook:{type:Object},vertical:{type:Boolean,default:!1},childFieldStrategy:{type:String,default:"checked"},clearable:Boolean,onChange:{}},emits:["update:value"],setup(e,{emit:l}){const{field:p}=b();const s=t({get(){return t=e.value,u(t)?t+"":t;var t},set(e){l("update:value",e)}}),{renderComplexOption:c}=d(e,s),{labelKey:m,valueKey:j,fullOptions:g}=e.urlConfig?f(e,s):y(e,s),{injectValueBindKey:C,injectValueValidate:S}=h();S(s);const k=C(s);function F(){s.value=null}return()=>o(r,{key:k.value,value:s.value,"onUpdate:value":e=>s.value=e,onClick:v(p)},{default:()=>[o(n,{vertical:e.vertical,"vertical-space":e.vertical},{default:()=>{var t;return[null==(t=g.value)?void 0:t.map((t=>{let l;return o(i,{key:t[j.value],value:t[j.value],disabled:t.disabled,currentValue:s.value,cancelable:e.clearable,onCancel:F},"function"==typeof(r=l=c({value:s.value,option:t,valueKey:j.value,labelKey:m.value,childFieldStrategy:e.childFieldStrategy}))||"[object Object]"===Object.prototype.toString.call(r)&&!a(r)?l:{default:()=>[l]});var r}))]}})]})}})}const g=r(j("FormRadio",p,l),i({dataSource:"options"},m)),C=r(j("FormCheckbox",c,s),i({dataSource:"options"},m));export{C as CHECKBOX,g as RADIO};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,computed as a,inject as u,watch as
|
|
1
|
+
import{defineComponent as e,ref as l,computed as a,inject as u,watch as n,createVNode as o}from"vue";import{connect as t,mapProps as r}from"@formily/vue";import{HelpCircleSharp as i}from"@vicons/ionicons5";import{useVModel as s,useDebounceFn as v}from"@vueuse/core";import{isString as p,isArray as d,cloneDeep as m,isEqual as c}from"lodash-es";import{NSelect as f,NSpin as y,NEmpty as g,NTooltip as C,NIcon as h}from"naive-ui";import"../../../index.js";import{InjectionAsyncQueue as j,InjectionChangeContextCollector as F,InjectionFormItemDepsCollector as x}from"../../constants/index.js";import{createUrlConfigParams as b,formRenderLog as w}from"../../utils/index.js";import{useCommonInjection as K,useSelectOptionProps as S}from"../../hooks/useCommonInjection.js";import{assignUpdateValue as k,assignClearBindVisited as B,createVisitedSetter as L}from"../../utils/schema.js";import{useFormField as V}from"../../hooks/useFormField.js";const q=t(e({name:"FormRemoteSearch",props:{value:{type:String},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},allowCreate:Boolean,labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},urlConfig:{type:Object},onChange:{},useLoading:{type:Boolean,default:!0}},emits:["update:value"],setup(e,{slots:t,emit:r}){const k=s(e,"value",r),{field:B,fieldKey:q}=V(),A=l(null),I=a((()=>{var l,a,u;return null!=(u=null!=(a=null==(l=e.urlConfig)?void 0:l.nameKey)?a:e.labelField)?u:"text"})),O=a((()=>{var l,a,u;return null!=(u=null!=(a=null==(l=e.urlConfig)?void 0:l.valueKey)?a:e.valueField)?u:"value"})),P=u(j),U=l(""),D=l(!1),R=v((async(l="",a="label")=>{if(U.value=l,!e.urlConfig)return A.value=null;try{D.value=!0,A.value=[],A.value=await P.addAsync(await b({config:{...e.urlConfig,params:{...e.urlConfig.params,["value"===a?O.value:"keyword"]:l}},cache:e.requestCache,field:B.value}))}catch(e){p(e)&&w(e)}finally{D.value=!1}})),z=a((()=>d(A.value)?A.value:d(e.options)?e.options:[])),{injectValueValidate:E,injectValueBindKey:G}=K();E(k);const H=G(k);n(k,(e=>{if(e&&!z.value.find((l=>l[O.value]===e)))return R(e,"value")}));u(F).setContext(q.value,(e=>{return{currentOption:m((l=e,z.value.find((e=>e[O.value]===l))))};var l}));const J=u(x);n((()=>e.urlConfig),((e,l)=>{c(e,l)||(A.value=null,e&&(J.setDeps(q.value,e.dependKey||[],(async()=>{A.value=null,k.value=null})),k.value&&R(k.value,"value")))}),{immediate:!0});const{menuProps:M,nodeProps:N}=S(),Q=a((()=>z.value.length||!e.allowCreate?z.value:U.value?[{[I.value]:U.value,[O.value]:U.value},...z.value]:z.value));async function T(e){D.value=e,e&&R()}function W(e){const l=e.alias||e[I.value];if(!l||!p(l))return"";const a=l;return e.desc?o("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[a,e.desc?o(C,null,{trigger:()=>o(h,{component:i},null),default:()=>e.desc}):null]):a}return()=>o(f,{remote:!0,filterable:!0,key:H.value,value:k.value,"onUpdate:value":e=>k.value=e,labelField:I.value,valueField:O.value,"menu-props":M,"node-props":N,onSearch:R,"onUpdate:show":T,options:Q.value,onFocus:L(B),renderLabel:W},{empty:()=>e.useLoading&&D.value?o(y,null,null):o(g,{description:"无数据"},null),...t})}}),r(k,B));export{q as REMOTE_SEARCH};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as o,nextTick as n}from"vue";import{isEqual as u,isArray as i,isString as s}from"lodash-es";import"../../../index.js";import{useCommonInjection as c}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as p,InjectionFormUUID as d}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"date-fns";import{assignUpdateValue as
|
|
1
|
+
import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as o,nextTick as n}from"vue";import{isEqual as u,isArray as i,isString as s}from"lodash-es";import"../../../index.js";import{useCommonInjection as c}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as p,InjectionFormUUID as d}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import{NCascader as m}from"naive-ui";import"date-fns";import{assignUpdateValue as v,createVisitedSetter as f,traverseDependKey as y}from"../../utils/schema.js";import{useFormField as h}from"../../hooks/useFormField.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import{connect as k,mapProps as j}from"@formily/vue";import"./index.js";import"../../hooks/useFormRenderOptions.js";const g=k(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:v,emit:k}){const j=t(),{field:g,title:b}=h(),S=t(1),C=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){k("update:value",i(a)?a.map((function(e){return{...e,label:e[w.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const q=l(p);async function x(t){e.filterable?await async function(){if(!e.urlConfig||j.value&&e.requestCache)return;const t=await q.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:b.value,cache:e.requestCache});function a(e,t,r){const o=[...r,...l(e)],n={[w.value]:e[w.value],[F.value]:e[F.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:o};return i(e.children)&&(n.children=e.children.map((e=>a(e,t+1,o))),n.isLeaf=!e.children.length),S.value=Math.max(S.value,t+1),n}function l(e){let t=[];if(s(e[w.value])&&(t=[...t,e[w.value]]),s(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}j.value=t.map((e=>a(e,0,[])))}():await async function(t){if(r(e,t))return;const a=await q.addAsync(o(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 r(e,t){return!i(e)||!t&&j.value&&e.requestCache||s(t)>=s(e)-1}function o(t,a,l,r){const o={lvlnr:t+1+""};return r&&a.dependKey&&y(a.dependKey,((e,t)=>{o[t]=r[e]})),{params:o,...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:j.value=l}(t),await B()}const V=`form-render__cascade--menu-${l(d)}`;async function B(){await n();const e=document.querySelector(`.${V} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function L(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;if(e.checkStrategy.includes("child")&&a.depth<S.value)return!1;return l.length>0&&l.some((e=>e.includes(t.trim())))}const{injectValueValidate:K,injectValueWatchFromEmpty:I,injectValueBindKey:E}=c();I((()=>e.value),x),K((()=>e.value)),r((()=>e.urlConfig),(async(t,a)=>{u(t,a)||(j.value=null,C.value?e.lazyRequest||(x(),C.value=!C.value):await x())}),{immediate:!0});const O=t(!1);function R(e){O.value=!!e,e&&x()}const W=a((()=>j.value||e.options||[])),z=a((()=>!e.filterable)),N=E(A);return()=>o(m,{key:N.value,remote:z.value,filterable:e.filterable,"menu-props":{class:V,onClick:B},"check-strategy":e.checkStrategy,show:!!O.value,"onUpdate:show":R,value:A.value,filter:L,"onUpdate:value":H,labelField:w.value,valueField:F.value,options:W.value,onLoad:x,onFocus:f(g)},v)}}),j({dataSource:"options"},v));export{g as SEARCH_CASCADER};
|
|
@@ -28,8 +28,12 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
28
28
|
type: StringConstructor;
|
|
29
29
|
default: string;
|
|
30
30
|
};
|
|
31
|
+
showField: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
};
|
|
31
34
|
allowCreate: BooleanConstructor;
|
|
32
35
|
shouldSave: BooleanConstructor;
|
|
36
|
+
allowModify: BooleanConstructor;
|
|
33
37
|
urlConfig: {
|
|
34
38
|
type: PropType<UrlConfig>;
|
|
35
39
|
};
|
|
@@ -90,6 +94,9 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
90
94
|
type: BooleanConstructor;
|
|
91
95
|
default: boolean;
|
|
92
96
|
};
|
|
97
|
+
multiple: {
|
|
98
|
+
type: BooleanConstructor;
|
|
99
|
+
};
|
|
93
100
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:value" | "postRecommend")[], "update:value" | "postRecommend", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
94
101
|
value: {
|
|
95
102
|
type: PropType<ArrayAble<string | number> | null>;
|
|
@@ -115,8 +122,12 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
115
122
|
type: StringConstructor;
|
|
116
123
|
default: string;
|
|
117
124
|
};
|
|
125
|
+
showField: {
|
|
126
|
+
type: StringConstructor;
|
|
127
|
+
};
|
|
118
128
|
allowCreate: BooleanConstructor;
|
|
119
129
|
shouldSave: BooleanConstructor;
|
|
130
|
+
allowModify: BooleanConstructor;
|
|
120
131
|
urlConfig: {
|
|
121
132
|
type: PropType<UrlConfig>;
|
|
122
133
|
};
|
|
@@ -177,13 +188,18 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
177
188
|
type: BooleanConstructor;
|
|
178
189
|
default: boolean;
|
|
179
190
|
};
|
|
191
|
+
multiple: {
|
|
192
|
+
type: BooleanConstructor;
|
|
193
|
+
};
|
|
180
194
|
}>> & {
|
|
181
195
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
182
196
|
onPostRecommend?: ((...args: any[]) => any) | undefined;
|
|
183
197
|
}, {
|
|
184
198
|
options: AnyObject[];
|
|
199
|
+
multiple: boolean;
|
|
185
200
|
labelField: string;
|
|
186
201
|
valueField: string;
|
|
202
|
+
allowModify: boolean;
|
|
187
203
|
lazyRequest: boolean;
|
|
188
204
|
requestCache: boolean;
|
|
189
205
|
recommend: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as
|
|
1
|
+
import{defineComponent as e,computed as l,inject as o,useAttrs as t,ref as a,createVNode as u,mergeProps as n,toRaw as r,nextTick as s}from"vue";import{arrayed as i}from"../../../../../shared/utils/index.js";import{HelpCircleSharp as p}from"@vicons/ionicons5";import{cloneDeep as m,isArray as c,isString as d,isObject as v,omit as f}from"lodash-es";import{useCommonInjection as y,useSelectOptionProps as h}from"../../hooks/useCommonInjection.js";import{useComplexOptions as j,useComplexOptionsSpan as g}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as b,InjectionFormUUID as S}from"../../constants/index.js";import"../../../index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import{NSelect as C,NTooltip as k,NIcon as w,NTag as F}from"naive-ui";import"date-fns";import{assignUpdateValue as B,assignClearBindVisited as x,createVisitedSetter as O}from"../../utils/schema.js";import{useFormField as A}from"../../hooks/useFormField.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import{connect as H,mapProps as K}from"@formily/vue";import"./index.js";import{useUrlConfigOptions as L,useAutographOptions as P,useRecommendOptions as E,searchContentMatcher as R}from"../../hooks/useFormRenderOptions.js";const V=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,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}},emits:["update:value","postRecommend"],setup(e,{slots:B,emit:x}){const H=l({get:()=>e.value,async set(e){x("update:value",e),J(e)}}),K=l((()=>(e.multiple&&e.allowModify&&console.warn("多选模式下不支持allowModify"),!e.multiple&&e.allowModify))),{labelKey:V,valueKey:_,showKey:I,fetchData:N,searchContent:M,fullOptions:W,filterOptions:q,remoteOptions:U,loading:z}=e.urlConfig?L(e,H):P(e,H),{renderComplexOption:D,hasComplexOption:T}=j(e,H),{getRecommend:G,postRecommend:J,sortedOptions:Q}=E(e,q,x,V,_),{field:X,fieldKey:Y}=A();o(b).setContext(Y.value,(e=>({currentOption:m(function(e){const l=ne(W.value);return c(e)?function(e){const o=l.reduce(((e,l)=>(e[l[_.value]]=l,e)),{});return e.map((e=>o[e]))}(e):(o=e,l.find((e=>e[_.value]===o)));var o}(e))})));const Z=async(e="")=>(M.value=e,Promise.allSettled([N(e),G(e)])),{injectValueValidate:$,injectValueWatchFromEmpty:ee,injectValueBindKey:le}=y();ee(H,Z),$(H);const oe=le(H),{menuProps:te,nodeProps:ae}=h();function ue(e){const l=e[V.value];if(!l||!d(l))return"";const o=M.value?R(M.value,l):null,t=o?u("section",null,[o.map(((e,l)=>0!==l&&e?u("span",{style:{color:l%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):l;return e.desc?u("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[t,e.desc?u(k,null,{trigger:()=>u(w,{component:p},null),default:()=>e.desc}):null]):t}function ne(l){return e.allowCreate&&M.value&&!l.some((e=>e[V.value]===M.value))?[...l,{[V.value]:M.value,[_.value]:M.value,created:!0,shouldSave:e.shouldSave}]:l}const re=l((()=>ne(K.value?W.value:Q.value))),se=t(),ie=l((()=>{if(e.allowCreate)return H.value;const l=e.multiple&&c(H.value);return W.value.find((e=>l?H.value.includes(e[_.value]):e[_.value]===H.value))?H.value:null})),pe=a(!1);async function me(e){e&&await Z(),pe.value=e}let ce=null;async function de(e,l){H.value=e,ce&&v(l)&&K.value&&(ce.focus(),await s(),ce.value=l[V.value]||"",ce.dispatchEvent(new CustomEvent("input"))),U.value&&l&&i(l).forEach((e=>{if(!v(e))return;const l=e;l.created&&l.shouldSave&&U.value.push(f(r(l),["created","shouldSave"]))}))}const ve=o(S),{getSpan:fe}=g(),ye=O(X,(async e=>{var l,o;K.value&&(ce=e.target,ce&&H.value&&(await s(),ce.value=null!=(o=null==(l=W.value.find((e=>e[_.value]===H.value)))?void 0:l[V.value])?o:"",ce.dispatchEvent(new CustomEvent("input"))))}));function he(e){if(!K.value)return;if(ce=e.target,!ce)return;if(!ce.value)return H.value=null;const l=W.value.find((e=>e[V.value]===ce.value));l?H.value=l[_.value]:(M.value=ce.value,H.value=ce.value)}function je({option:l,handleClose:o}){var t;const a=null!=(t=I.value&&l[I.value])?t:l[V.value];return e.multiple?u(F,{closable:!0,onClose:e=>{e.stopPropagation(),o()}},{default:()=>a}):a}function ge(l){return u(C,n({key:oe.value,multiple:e.multiple,remote:!0,filterable:!0,loading:z.value,value:ie.value,onUpdateValue:de,"menu-props":te,"node-props":ae,labelField:V.value,valueField:_.value,options:re.value,onSearch:Z,show:pe.value,"onUpdate:show":me,onFocus:ye,onBlur:he,renderLabel:ue,renderTag:je},l,se),B)}return()=>{var e,l;if(!T.value)return ge();const o=null!=(l=null==(e=X.value.decoratorProps)?void 0:e.span)?l:6,t=fe(ve,X.value.address);return u("section",{class:"form-render__selectChildField",style:{"--column":t+o}},[ge({class:"form-render__selectChildFieldItem",style:{"--form-item-column":o}}),W.value.map((e=>D({option:e,value:H.value,valueKey:_.value,labelKey:V.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}})))])}}}),K({dataSource:"options"},B,x));export{V as SELECT};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as n}from"vue";import{connect as t,mapProps as o}from"@formily/vue";import{isFunction as e}from"lodash-es";import{NButton as l}from"naive-ui";import{createSlot as r}from"../../utils/index.js";const i=t=>{var o,e,l;return n("div",null,[null==(l=(e=r(null!=(o=t.content)?o:t.value,t)).default)?void 0:l.call(e)])};i.props={content:{},fieldItem:{},value:{}};const u=t(i,o((n=>{var t;return{...n,content:null==(t=n.fieldItem)?void 0:t.content}}))),c=t=>{const o=function(n){return t=>{var o;return null==(o=n.fieldItem)?void 0:o[t]}}(t);return n(l,{onClick:function(){var n;const l=o("onClick")||(null==(n=o("componentProps"))?void 0:n.onClick);return()=>e(l)&&l(t.fieldItem)}()},r(t.content,t))};c.props={onClick:{},fieldItem:{},content:{}};const m=t(c,o((n=>{var t,o,e;return{...n,content:null!=(e=null==(t=n.fieldItem)?void 0:t.content)?e:null==(o=n.fieldItem)?void 0:o.alias}}))),d=()
|
|
1
|
+
import{createVNode as n}from"vue";import{connect as t,mapProps as o}from"@formily/vue";import{isFunction as e}from"lodash-es";import{NButton as l}from"naive-ui";import{createSlot as r}from"../../utils/index.js";const i=t=>{var o,e,l;return n("div",null,[null==(l=(e=r(null!=(o=t.content)?o:t.value,t)).default)?void 0:l.call(e)])};i.props={content:{},fieldItem:{},value:{}};const u=t(i,o((n=>{var t;return{...n,content:null==(t=n.fieldItem)?void 0:t.content}}))),c=t=>{const o=function(n){return t=>{var o;return null==(o=n.fieldItem)?void 0:o[t]}}(t);return n(l,{onClick:function(){var n;const l=o("onClick")||(null==(n=o("componentProps"))?void 0:n.onClick);return()=>e(l)&&l(t.fieldItem)}()},r(t.content,t))};c.props={onClick:{},fieldItem:{},content:{}};const m=t(c,o((n=>{var t,o,e;return{...n,content:null!=(e=null==(t=n.fieldItem)?void 0:t.content)?e:null==(o=n.fieldItem)?void 0:o.alias}}))),d=t((t=>{const o=t.border?{background:"rgb(31,34,37)",margin:"0 -8px"}:null;return n("section",{class:"form-render__linebreaks",style:{"--form-item-column":999,height:"1px",...o}},null)}));export{m as BUTTON,d as LINE_BREAKS,u as TEXT};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as r,createVNode as o,createTextVNode as i}from"vue";import{NSwitch as t}from"naive-ui";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"../../../index.js";import"date-fns";import{assignUpdateValue as n,assignValueBindKey as l}from"../../utils/schema.js";import{connect as u,mapProps as
|
|
1
|
+
import{defineComponent as e,computed as r,createVNode as o,createTextVNode as i}from"vue";import{NSwitch as t}from"naive-ui";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"../../../index.js";import"date-fns";import{assignUpdateValue as n,assignValueBindKey as l}from"../../utils/schema.js";import{connect as u,mapProps as c}from"@formily/vue";const p=u(e({name:"FormSwitch",props:{openDescription:{type:Object},closeDescription:{type:Object},onChange:{}},setup:e=>()=>{const n=r((()=>{var r,o;return null==(o=null==(r=e.openDescription)?void 0:r.value)||o})),l=r((()=>{var r,o;return null!=(o=null==(r=e.closeDescription)?void 0:r.value)&&o}));return o(t,{checkedValue:n.value,uncheckedValue:l.value},{checked:()=>{var r,o;return i(null!=(o=null==(r=e.openDescription)?void 0:r.describe)?o:"")},unchecked:()=>{var r,o;return i(null!=(o=null==(r=e.closeDescription)?void 0:r.describe)?o:"")}})}}),c(n,l));export{p as SWITCH};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as
|
|
1
|
+
import{defineComponent as e,computed as o,createVNode as t}from"vue";import{useCommonInjection as r}from"../../hooks/useCommonInjection.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import{NInput as i}from"naive-ui";import"../../../index.js";import"date-fns";import{assignUpdateValue as m,assignClearBindVisited as a}from"../../utils/schema.js";import{connect as p,mapProps as u}from"@formily/vue";const s=p(e({name:"FormTextarea",props:{value:{type:String}},emits:["update:value"],setup(e,{emit:m}){const a=o({get:()=>e.value,set:e=>m("update:value",e)}),p=r().injectValueBindKey(a);return()=>t(i,{type:"textarea",key:p.value,value:a.value,"onUpdate:value":e=>a.value=e},null)}}),u(m,a));export{s as TEXTAREA};
|
|
@@ -4,7 +4,7 @@ import { AnnotationItem } from '../../../../../es/components/annotation-edit/src
|
|
|
4
4
|
import { ContextCollector } from '../../../../../es/components/form-render/src/hooks/useChangeContext';
|
|
5
5
|
import { useFormRenderLifeCycle } from '../../../../../es/components/form-render/src/hooks/useFormRenderLifeCycle';
|
|
6
6
|
import { BusinessCollector, FormItemDepsCollector } from '../hooks';
|
|
7
|
-
import { FormAsyncQueue } from '../types';
|
|
7
|
+
import { FormAsyncQueue, FormRenderProps } from '../types';
|
|
8
8
|
import { Component, InjectionKey, WritableComputedRef } from 'vue';
|
|
9
9
|
export declare const InjectionAsyncQueue: InjectionKey<FormAsyncQueue>;
|
|
10
10
|
export declare const InjectionSchemaField: InjectionKey<Component>;
|
|
@@ -15,6 +15,7 @@ export declare const InjectionFormLifeCycleCaller: InjectionKey<ReturnType<typeo
|
|
|
15
15
|
export declare const InjectionFormUUID: InjectionKey<string>;
|
|
16
16
|
export declare const InjectionFormGraph: InjectionKey<Record<string, GeneralField>>;
|
|
17
17
|
export declare const InjectionAnnotation: InjectionKey<WritableComputedRef<Nullable<Record<string, AnnotationItem>>>>;
|
|
18
|
+
export declare const InjectionFormGlobalProps: InjectionKey<Readonly<FormRenderProps>>;
|
|
18
19
|
export declare const FormItemLineBarDepKeyPrepend = "__dep_LINEBAR_";
|
|
19
20
|
export declare enum FIELD_BUSINESS_TYPE {
|
|
20
21
|
PASSWORD = "password",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const o=Symbol("InjectionAsyncQueue"),e=Symbol("InjectionSchemaField"),n=Symbol("InjectionBusinessCollector"),t=Symbol("InjectionChangeContextCollector"),l=Symbol("InjectionFormItemDepsCollector"),E=Symbol("InjectionFormLifeCycleCaller"),I=Symbol("InjectionFormUUID"),i=Symbol("InjectionFormGraph"),A=Symbol("InjectionAnnotation"),a=Symbol("InjectionFormGlobalProps"),c="__dep_LINEBAR_";var m=(o=>(o.PASSWORD="password",o.ID_CARD="id_card",o.AGE="age",o.AGE_UNIT="age_unit",o.MOBILE="mobile",o.TELEPHONE="telephone",o.EMAIL="email",o.SEX="sex",o.BIRTHDAY="birthday",o.BANK_CARD="bank_card",o.WEBSITE="website",o.GESTATIONAL_WEEKS="gestational_weeks",o.GESTATIONAL_STAGE="gestational_stage",o.CUSTOMER_NAME="customer_name",o))(m||{}),S=(o=>(o.MALE="1",o.FEMALE="2",o))(S||{}),r=(o=>(o.DAY="D",o.MONTH="M",o.YEAR="Y",o.HOUR="H",o.WEEK="W",o.MINUTE="N",o))(r||{});const s=["COMPLEX","COMBINATION"];export{r as FIELD_AGE_UNIT,m as FIELD_BUSINESS_TYPE,S as FIELD_SEX_VALUE,c as FormItemLineBarDepKeyPrepend,A as InjectionAnnotation,o as InjectionAsyncQueue,n as InjectionBusinessCollector,t as InjectionChangeContextCollector,a as InjectionFormGlobalProps,i as InjectionFormGraph,l as InjectionFormItemDepsCollector,E as InjectionFormLifeCycleCaller,I as InjectionFormUUID,e as InjectionSchemaField,s as NESTED_FORM_ITEM_TYPE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{doAnimation as e}from"../../../../shared/utils/anime.js";import{useDebounceFn as
|
|
1
|
+
import{doAnimation as e}from"../../../../shared/utils/anime.js";import{useDebounceFn as o,watchOnce as t}from"@vueuse/core";import{ref as r,computed as n,nextTick as i}from"vue";import{FormItemLineBarDepKeyPrepend as l}from"../constants/index.js";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"lodash-es";import"naive-ui";import"../../index.js";import"date-fns";import{createLinebarId as a}from"../utils/schema.js";function s(s,u,c,m){const v=r(),p=r(""),f=r([]),d=async function(e){var o;f.value=Object.values(e.fields).reduce(((e,o)=>{var t,r;return"LINEBAR"===o.componentType&&"visible"===o.selfDisplay&&e.push({title:null!=(r=null==(t=o.componentProps)?void 0:t.title)?r:o.title,name:o.address.toString()}),e}),[]),await i(),null==(o=v.value)||o.syncBarPosition()};let h=!1;async function y(o){h=!0;try{if(!c.value)return;m.trigger(l+o,!0),await i();const t=c.value.querySelector(`#${a(o)}`);if(!t)return;await new Promise((o=>{e(c.value.scrollTop,t.offsetTop,300,(e=>{var o;null==(o=c.value)||o.scrollTo({top:e})}),"easeInSine",(()=>setTimeout(o,300)))}))}finally{h=!1}}const T=o((function(e){var o;if(h||!c.value)return;const{scrollTop:t,clientHeight:r}=c.value,n=f.value.find(((e,o,n)=>{const i=n[o+1];if(!i)return!0;const l=c.value.querySelector(`#${a(i.name)}`);return l?l.offsetTop>t+r/2:void 0}))||f.value[f.value.length-1];p.value=null!=(o=null==n?void 0:n.name)?o:"",u("scroll",e)}),300);t(f,(e=>{var o,t;p.value=null!=(t=null==(o=e[0])?void 0:o.name)?t:""}));return{currentAnchor:n({get:()=>p.value,async set(e){p.value=e,await new Promise((e=>setTimeout(e,100))),await y(e)}}),onScroll:T,anchorIdList:f,generateAnchorList:d,updateAnchorList:function(e){"LINEBAR"===e.componentType&&e.selfDisplay&&d(e.form)},scrollTo:y,anchorBarRef:v}}export{s as useAnchor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isField as e}from"@formily/core";import{isString as t}from"@vueuse/core";import{format as s}from"date-fns";import{isFunction as i,isNumber as r}from"lodash-es";import{FIELD_BUSINESS_TYPE as n}from"../constants/index.js";import"vue";import"../../../../shared/utils/index.js";import"@formily/path";import"@vue/shared";import"../../index.js";import{isIdCard as a,parseIdCard as l,parseAgeFromContext as o,parseBirthday as u,parseAge2Birthday as h}from"../utils/business.js";class y{constructor(e){this.businessFormatter=e,this.triggerLock=!1,this.typeLockMap=new Map,this.typeCollector=new Map,this.fieldNameCollector=new Map,this.changeHandlerMap=new Map([])}formatter(...e){return i(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,t,s,i){const n=this.getField(t);n&&e.setFieldState(n.val_key,(e=>{if(e.value===s)return;const a=this.typeLockMap.get(t);this.typeLockMap.set(t,r(a)?a+1:1),e.value=this.formatter({value:s,type:t,fieldKey:n.val_key,from:i})}))}registerChangeBusiness(e,t){return this.changeHandlerMap.set(e,t),this}trigger(e,t,s="change"){var i;if(this.triggerLock)return;const r=this.getType(t);if(!r)return;if("change"===s&&this.typeLockMap.get(r)>0)return this.typeLockMap.set(r,this.typeLockMap.get(r)-1);const n="change"===s?this.changeHandlerMap:null;n&&(null==(i=n.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 i(i){const r=this.getValueByType(i,n.ID_CARD);if(!r||!t(r)||!a(r))return;const u=l(r),{age:h,ageUnit:y}=o(u);this.setValueByType(i,n.AGE_UNIT,y,n.ID_CARD),this.setValueByType(i,n.AGE,h,n.ID_CARD),this.setValueByType(i,n.SEX,u.sex,n.ID_CARD),this.setValueByType(i,n.BIRTHDAY,s(new Date(u.birthday),e.call(this)),n.ID_CARD)}function c(e){const s=this.getValueByType(e,n.BIRTHDAY);if(!t(s))return;const{age:i,ageUnit:r}=o(u(s));this.setValueByType(e,n.AGE_UNIT,r,n.BIRTHDAY),this.setValueByType(e,n.AGE,i,n.BIRTHDAY)}function p(s){return function(i){const a=this.getValueByType(i,n.AGE),l=this.getValueByType(i,n.AGE_UNIT);(t(a)||r(a))&&""!==a&&t(l)&&""!==l&&this.setValueByType(i,n.BIRTHDAY,h(+a,l,e.call(this)),s)}}return{create:function(e){return new y(e).registerChangeBusiness(n.ID_CARD,i).registerChangeBusiness(n.AGE_UNIT,p(n.AGE_UNIT)).registerChangeBusiness(n.AGE,p(n.AGE)).registerChangeBusiness(n.BIRTHDAY,c)}}}export{y as BusinessCollector,c as useBusinessBinding};
|
|
1
|
+
import{isField as e}from"@formily/core";import{isString as t}from"@vueuse/core";import{format as s}from"date-fns";import{isFunction as i,isNumber as r}from"lodash-es";import{FIELD_BUSINESS_TYPE as n}from"../constants/index.js";import"vue";import"../../../../shared/utils/index.js";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"naive-ui";import"../../index.js";import{isIdCard as a,parseIdCard as l,parseAgeFromContext as o,parseBirthday as u,parseAge2Birthday as h}from"../utils/business.js";class y{constructor(e){this.businessFormatter=e,this.triggerLock=!1,this.typeLockMap=new Map,this.typeCollector=new Map,this.fieldNameCollector=new Map,this.changeHandlerMap=new Map([])}formatter(...e){return i(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,t,s,i){const n=this.getField(t);n&&e.setFieldState(n.val_key,(e=>{if(e.value===s)return;const a=this.typeLockMap.get(t);this.typeLockMap.set(t,r(a)?a+1:1),e.value=this.formatter({value:s,type:t,fieldKey:n.val_key,from:i})}))}registerChangeBusiness(e,t){return this.changeHandlerMap.set(e,t),this}trigger(e,t,s="change"){var i;if(this.triggerLock)return;const r=this.getType(t);if(!r)return;if("change"===s&&this.typeLockMap.get(r)>0)return this.typeLockMap.set(r,this.typeLockMap.get(r)-1);const n="change"===s?this.changeHandlerMap:null;n&&(null==(i=n.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 i(i){const r=this.getValueByType(i,n.ID_CARD);if(!r||!t(r)||!a(r))return;const u=l(r),{age:h,ageUnit:y}=o(u);this.setValueByType(i,n.AGE_UNIT,y,n.ID_CARD),this.setValueByType(i,n.AGE,h,n.ID_CARD),this.setValueByType(i,n.SEX,u.sex,n.ID_CARD),this.setValueByType(i,n.BIRTHDAY,s(new Date(u.birthday),e.call(this)),n.ID_CARD)}function c(e){const s=this.getValueByType(e,n.BIRTHDAY);if(!t(s))return;const{age:i,ageUnit:r}=o(u(s));this.setValueByType(e,n.AGE_UNIT,r,n.BIRTHDAY),this.setValueByType(e,n.AGE,i,n.BIRTHDAY)}function p(s){return function(i){const a=this.getValueByType(i,n.AGE),l=this.getValueByType(i,n.AGE_UNIT);(t(a)||r(a))&&""!==a&&t(l)&&""!==l&&this.setValueByType(i,n.BIRTHDAY,h(+a,l,e.call(this)),s)}}return{create:function(e){return new y(e).registerChangeBusiness(n.ID_CARD,i).registerChangeBusiness(n.AGE_UNIT,p(n.AGE_UNIT)).registerChangeBusiness(n.AGE,p(n.AGE)).registerChangeBusiness(n.BIRTHDAY,c)}}}export{y as BusinessCollector,c as useBusinessBinding};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,computed as t,createVNode as r,mergeProps as n,defineComponent as l,inject as o,provide as
|
|
1
|
+
import{reactive as e,computed as t,createVNode as r,mergeProps as n,defineComponent as l,inject as o,provide as i,watch as s,onUnmounted as a,onMounted as c,withModifiers as u}from"vue";import{checkInSetupEnv as d}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as f}from"@formily/vue";import{isArray as v,noop as h}from"lodash-es";import"../../index.js";import{InjectionFormUUID as y,InjectionBusinessCollector as g}from"../constants/index.js";import{renderDescOption as b}from"../utils/index.js";import{useFieldListAdaptor as F}from"./useFieldListAdaptor.js";import{createObjSchema as x}from"../utils/schema.js";const j=e(new Map);function S(e,t,r=0){j.set(e,j.get(e)||{});j.get(e)[t+""]=r}function O(e,t,r=!0){const n=j.get(e);return n?Object.entries(n).reduce(((e,[n,l])=>r&&n===`${t}`||n.startsWith(`${t}.`)?e+l:e),0):0}function $(e,t){const r=j.get(e);r&&Reflect.deleteProperty(r,t+"")}function k(e){j.delete(e)}const E=l({props:{fieldItems:{type:Array,default:()=>[]},childFieldStrategy:{type:String,default:"checked"},name:{type:String,required:!0}},setup(e){const l=o(y),d=o(g),v=p(),b=o(l+"_virtualParent",""),j=`${b?b+".":""}${v.value.address}`;function k(e){return`${j}.${e}`}i(l+"_virtualParent",j);const{schemaAdaptor:E}=F(d);function K(t){var r,n;return Object.assign(t,{"x-decorator-props":{...t["x-decorator-props"],labelPlacement:"left",showFeedback:!1},"x-component-props":{...t["x-component-props"],childFieldStrategy:null!=(n=null==(r=t["x-component-props"])?void 0:r.childFieldStrategy)?n:e.childFieldStrategy,size:"small"}})}const P=t((()=>{const t=E(e.fieldItems);return Object.values(t).forEach(K),x(t)}));s(P,(()=>{return e=P.value,void Object.values(e.properties||{}).forEach((e=>{var t;S(l,k(e.name),null==(t=null==e?void 0:e["x-decorator-props"])?void 0:t.span)}));var e}),{immediate:!0});const _=m();function I(){return e.fieldItems.map((e=>_.value.query(e.val_key).take()))}a((()=>{var e;I().forEach((e=>{e&&e.setDisplay("none")})),e=P.value,Object.values(e.properties||{}).forEach((e=>{$(l,k(e.name))}))})),c((()=>{I().forEach((e=>{e&&e.setDisplay("visible")}))}));const w=u(h,["stop"]),A=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=w,e)),{});return()=>{return r("section",n({class:"form-render__labelField",style:{"--column":(e=P.value,Object.values(e.properties||{}).reduce(((e,t)=>e+O(l,k(t.name))),0))}},A),[r(f,{basePath:".",schema:P.value},null)]);var e}}});function K(e,l){d();const o=t((()=>e.options.some((e=>v(e.childrenFields)&&e.childrenFields.length))));function i(e,t,r="value"){if(v(e)?e.includes(t[r]):e===t[r])return v(t.childrenFields)&&t.childrenFields.length}return{renderComplexOption:function({value:e,option:t,valueKey:l="value",labelKey:s="label",childFieldStrategy:a,renderLabel:c=!0,attrs:u}){return[c?t.desc?b(t[s],t):t[s]:null,o.value&&("all"===a||i(e,t,l))?r(E,n({fieldItems:t.childrenFields,name:t[l],childFieldStrategy:a},u),null):null]},valueRef:l,hasComplexOption:o}}function P(){return{getSpan:O,setSpan:S,deleteSpan:$,clearSpan:k}}export{K as useComplexOptions,P as useComplexOptionsSpan};
|
|
@@ -4,7 +4,10 @@ import { FieldItem } from '../types';
|
|
|
4
4
|
* @description 胶水层, 将低代码平台中的fieldList转换为JSONSchema
|
|
5
5
|
*/
|
|
6
6
|
export declare function useFieldListAdaptor(collector?: BusinessCollector): {
|
|
7
|
-
schemaAdaptor: (fieldList: FieldItem[]
|
|
7
|
+
schemaAdaptor: (fieldList: FieldItem[], options?: {
|
|
8
|
+
column: number;
|
|
9
|
+
outBordered?: boolean;
|
|
10
|
+
}) => Record<string, import("@formily/json-schema/esm/types").Stringify<{
|
|
8
11
|
[key: symbol]: any;
|
|
9
12
|
[key: `x-${string}`]: any;
|
|
10
13
|
[key: `x-${number}`]: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as i,formRenderLog as r}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function d(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig","wordbook"])})}function u(u){const{createValidatorSchema:f}=l(),_=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=f(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},x=e=>{var o;const t=_(e);e.urlConfig?d(t,e):e.autograph&&m(t,e);const r=!!e.__multiple;return Object.assign(t["x-component-props"],{multiple:r,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowCreate:"1"===e.free_entry||!!t["x-component-props"].allowCreate,shouldSave:"1"===e.save_free_entry,maxTagCount:i(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),r&&(t.type="array"),t},h=e=>{const o=_(e);return Object.assign(o["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,vertical:e.__vertical}),e.urlConfig?d(o,e):e.autograph&&m(o,e),o},g=e=>{const t=_(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},
|
|
1
|
+
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as i,formRenderLog as r}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function d(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig","wordbook"])})}function u(u){const{createValidatorSchema:f}=l(),_=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=f(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},x=e=>{var o;const t=_(e);e.urlConfig?d(t,e):e.autograph&&m(t,e);const r=!!e.__multiple;return Object.assign(t["x-component-props"],{multiple:r,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowModify:"1"===e.allowModify,allowCreate:"1"===e.free_entry||!!t["x-component-props"].allowCreate||"1"===e.allowModify,shouldSave:"1"===e.save_free_entry,showField:e.show_key,maxTagCount:i(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),r&&(t.type="array"),t},h=e=>{const o=_(e);return Object.assign(o["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,vertical:e.__vertical}),e.urlConfig?d(o,e):e.autograph&&m(o,e),o},g=e=>{const t=_(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},y=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{disabled:"1"===e.is_not_fold,id:p(e.val_key),show:"0"!==e.is_show,remark:e.remark}}),b=new Map([["LINEBAR",y],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=_(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=_(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=_(e),{decimal_length:t,validate:n,allowSlash:i}=e;return i&&(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:null!=t?t:null==n?void 0:n.decimal_length,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",x],["REMOTE_SEARCH",x],["DATE",e=>{const o=_(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=_(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=_(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=_(e);return o.type="array",!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",h],["CHECKBOX",h],["SWITCH",e=>{const o=_(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=_(e);return Object.assign(o["x-component-props"],{step:i(e.step_length),max:i(e.max_length),min:i(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=_(e);Array.isArray(e.properties)&&r("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?j(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],n(e,["wrapperStyle","display"])),o}]]),v=e=>{if(e.suffixConfig)return w(e);return(b.get(e.html_type)||g)(e)},w=o=>{if(!o.suffixConfig&&!o.prefixConfig)return v(o);const t=o.suffixConfig?e(o.suffixConfig):[],n=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"}))),{...o,is_show:"1",hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...t.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"})))],i=_(o),r=n.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(i,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...i["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:j(n)}),i},{FieldNormalizeWaterfallHook:C,FieldListNormalizeWaterfallHook:O}=s();function j(o,n={column:9999}){let i=null;return O.call(t(o),n).reduce(((e,o,n)=>{var a;const p=null==(a=(o=C.call(o)).validate)?void 0:a.obj_type;return p&&u&&u.collect(p,t(o)),"LINEBAR"===o.html_type?(e[s(o)]=r(y(o),n),i=e[s(o)].properties={}):i?i[s(o)]=r(v(o),n):(i=null,e[s(o)]=r(v(o),n)),e}),{});function r(e,o){return e["x-index"]=o,e}function s(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:j}}export{u as useFieldListAdaptor};
|
|
@@ -2,5 +2,8 @@ import { SyncWaterfallHook } from '../../../../../es/shared/utils/tapable';
|
|
|
2
2
|
import { FieldItem } from '../types';
|
|
3
3
|
export declare function useFieldNormalize(): {
|
|
4
4
|
FieldNormalizeWaterfallHook: SyncWaterfallHook<FieldItem, import("../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
5
|
-
FieldListNormalizeWaterfallHook: SyncWaterfallHook<[FieldItem[]
|
|
5
|
+
FieldListNormalizeWaterfallHook: SyncWaterfallHook<[FieldItem[], {
|
|
6
|
+
column: number;
|
|
7
|
+
outBordered?: boolean | undefined;
|
|
8
|
+
}], import("../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
6
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,traverse as
|
|
1
|
+
import{arrayed as e,uuidGenerator as t,traverse as l}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import r from"../../../../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{last as o,isString as i}from"lodash-es";import{FIELD_BUSINESS_TYPE as s}from"../constants/index.js";function a(){const a=new r(["fieldList","options"]),p=new r(["fieldItem"]);p.tap("__block",(e=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(e.html_type)&&(e.__vertical=!0),e))),p.tap("__age",(t=>("AGE"===t.html_type&&(t.html_type="INPUT_NUMBER",t.reactions=t.reactions?e(t.reactions):[],t.reactions.push({target:t.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),t.suffixConfig=[{validate:{obj_type:s.AGE_UNIT},val_key:t.val_key_unit,html_type:"SELECT",option:t.option,urlConfig:t.urlConfig}]),t))),p.tap("__multiple_select",(e=>{const{html_type:t,multi_select:l,__multiple:r}=e;return e.__multiple="SEARCH"!==t&&("SEARCH_MORE"===t||("SELECT"===t?"0"===l:r)),e}));const _=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];p.tap("__normalize",(e=>(_.some((([t,l])=>(Array.isArray(t)?t.includes(e.html_type):t===e.html_type)&&(e.html_type=l))),e)));const n=new Map([[["SELECT","SEARCH","SEARCH_MORE"],new Map([["H_TILE",e=>e.html_type=e.__multiple?"CHECKBOX":"RADIO"],["V_TILE",e=>{e.html_type=e.__multiple?"CHECKBOX":"RADIO",e.__vertical=!0}]])],["RADIO",new Map([["DROPDOWN",e=>e.html_type="SELECT"]])],["CHECKBOX",new Map([["DROPDOWN",e=>{e.__multiple=!0,e.html_type="SELECT"}]])]]);return p.tap({stage:9999,name:"__show_mode"},(t=>t.show_mode?([...n].some((([l,r])=>{if(!e(l).includes(t.html_type))return;const o=r.get(t.show_mode);return o&&o(t),!0})),t):t)),a.tap("__out_bordered",((e,{column:l,outBordered:r})=>{if(!r)return e;let i=0;return e.reduce(((r,s,a)=>{const p=2*(s.elem_width||3);return i+=p,i===l&&a<e.length-1?(i=0,r.push(s),r.push({val_key:`${t()}`,html_type:"LINE_BREAKS",lineBreaksBorder:!0})):i>l?(i=p,r.push({val_key:`${t()}`,html_type:"LINE_BREAKS",lineBreaksBorder:!0}),r.push(s)):(o(r)&&(o(r).fieldItemBorder=!0),r.push(s)),r}),[])})),a.tap("__prefix/suffix",(e=>{const t=[];return l(e,(r=>{["prefix","suffix"].forEach((o=>{const s=r[o];if(!i(s))return;const a=s.match("#{(.+)}");if(!a)return;const p=i(a[1])&&function(t){let r=null;return l(e,((e,l)=>{e.val_key===t&&(r=e,l())}),["children","properties"]),r}(a[1].trim());p&&(Reflect.deleteProperty(r,o),r[`${o}Config`]=r[`${o}Config`]||[],r[`${o}Config`].push(p),t.push(p))}))}),["children","properties"]),t.length?function e(l){return l.reduce(((l,r)=>(t.includes(r)||(l.push(r),r.properties&&(r.properties=e(r.properties)),r.children&&(r.children=e(r.children))),l)),[])}(e):e})),{FieldNormalizeWaterfallHook:p,FieldListNormalizeWaterfallHook:a}}export{a as useFieldNormalize};
|