cnhis-design-vue 3.2.15-release.5 → 3.2.16-beta.7

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.
Files changed (75) hide show
  1. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  2. package/es/components/branch-notice/src/canstants.js +1 -1
  3. package/es/components/button-print/index.d.ts +6 -13
  4. package/es/components/button-print/src/ButtonPrint.vue.d.ts +6 -13
  5. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +6 -13
  6. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  7. package/es/components/button-print/style/index.css +1 -1
  8. package/es/components/callback/src/components/render/popupMaps.d.ts +10 -0
  9. package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
  10. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  11. package/es/components/expand-field/index.d.ts +26 -0
  12. package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +26 -0
  13. package/es/components/expand-field/src/components/PersonModal.vue.d.ts +26 -0
  14. package/es/components/expand-field/src/components/form.vue.d.ts +26 -0
  15. package/es/components/expand-field/src/index.vue.d.ts +26 -0
  16. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
  17. package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
  18. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  19. package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
  20. package/es/components/form-config/index.d.ts +30 -0
  21. package/es/components/form-config/src/FormConfig.vue.d.ts +30 -0
  22. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +10 -0
  23. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +10 -0
  24. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +10 -0
  25. package/es/components/form-render/index.d.ts +10 -0
  26. package/es/components/form-render/src/FormRender.vue.d.ts +10 -0
  27. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  28. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +10 -0
  29. package/es/components/form-render/src/components/renderer/input.d.ts +9 -1
  30. package/es/components/form-render/src/components/renderer/input.js +1 -1
  31. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  32. package/es/components/iho-chat/index.d.ts +181 -23
  33. package/es/components/iho-chat/src/Index.vue.d.ts +181 -23
  34. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  35. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  36. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  37. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +24 -12
  38. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +150 -7
  39. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  40. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +12 -6
  41. package/es/components/iho-chat/src/components/MessageEvent.vue.d.ts +137 -0
  42. package/es/components/iho-chat/src/components/MessageEvent.vue.js +1 -0
  43. package/es/components/iho-chat/src/components/MessageEvent.vue2.js +1 -0
  44. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +6 -3
  45. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
  46. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +13 -6
  47. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  48. package/es/components/iho-chat/src/components/Video.vue.d.ts +1 -1
  49. package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
  50. package/es/components/iho-chat/src/constants/index.d.ts +2 -1
  51. package/es/components/iho-chat/src/constants/index.js +1 -1
  52. package/es/components/iho-chat/src/hooks/useVideo.d.ts +2 -2
  53. package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
  54. package/es/components/iho-chat/src/utils/asyncQueue.d.ts +10 -0
  55. package/es/components/iho-chat/src/utils/asyncQueue.js +1 -0
  56. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  57. package/es/components/iho-table/src/types/index.d.ts +14 -0
  58. package/es/components/iho-table/src/utils/index.js +1 -1
  59. package/es/components/index.css +1 -1
  60. package/es/components/info-header/index.d.ts +20 -0
  61. package/es/components/info-header/src/InfoHeader.vue.d.ts +20 -0
  62. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +10 -0
  63. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +10 -0
  64. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  65. package/es/components/select-person/index.d.ts +26 -0
  66. package/es/components/select-person/src/SelectPerson.vue.d.ts +14 -0
  67. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  68. package/es/components/select-person/src/index.vue.d.ts +26 -0
  69. package/es/components/select-person/src/index.vue2.js +1 -1
  70. package/es/components/shortcut-setter/index.d.ts +10 -0
  71. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +10 -0
  72. package/es/env.d.ts +25 -25
  73. package/es/shared/hooks/useDateTime.js +1 -1
  74. package/es/shared/package.json.js +1 -1
  75. package/package.json +2 -2
@@ -220,6 +220,9 @@ declare const _default: import("vue").DefineComponent<{}, {
220
220
  type: import("vue").PropType<"default" | "tooltip">;
221
221
  default: string;
222
222
  };
223
+ fixMemoLeak: {
224
+ type: BooleanConstructor;
225
+ };
223
226
  }, {
224
227
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
225
228
  fieldList: {
@@ -419,6 +422,9 @@ declare const _default: import("vue").DefineComponent<{}, {
419
422
  type: import("vue").PropType<"default" | "tooltip">;
420
423
  default: string;
421
424
  };
425
+ fixMemoLeak: {
426
+ type: BooleanConstructor;
427
+ };
422
428
  }>> & {
423
429
  onFormChange?: ((...args: any[]) => any) | undefined;
424
430
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -976,6 +982,9 @@ declare const _default: import("vue").DefineComponent<{}, {
976
982
  type: import("vue").PropType<"default" | "tooltip">;
977
983
  default: string;
978
984
  };
985
+ fixMemoLeak: {
986
+ type: BooleanConstructor;
987
+ };
979
988
  }>> & {
980
989
  onFormChange?: ((...args: any[]) => any) | undefined;
981
990
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -1009,6 +1018,7 @@ declare const _default: import("vue").DefineComponent<{}, {
1009
1018
  feedbackType: "default" | "tooltip";
1010
1019
  operationalFormInit: boolean;
1011
1020
  incrementalRender: boolean;
1021
+ fixMemoLeak: boolean;
1012
1022
  }>;
1013
1023
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
1014
1024
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -1367,6 +1367,9 @@ declare const _default: import("vue").DefineComponent<{
1367
1367
  type: PropType<"default" | "tooltip">;
1368
1368
  default: string;
1369
1369
  };
1370
+ fixMemoLeak: {
1371
+ type: BooleanConstructor;
1372
+ };
1370
1373
  }, {
1371
1374
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
1372
1375
  fieldList: {
@@ -1566,6 +1569,9 @@ declare const _default: import("vue").DefineComponent<{
1566
1569
  type: PropType<"default" | "tooltip">;
1567
1570
  default: string;
1568
1571
  };
1572
+ fixMemoLeak: {
1573
+ type: BooleanConstructor;
1574
+ };
1569
1575
  }>> & {
1570
1576
  onFormChange?: ((...args: any[]) => any) | undefined;
1571
1577
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -2123,6 +2129,9 @@ declare const _default: import("vue").DefineComponent<{
2123
2129
  type: PropType<"default" | "tooltip">;
2124
2130
  default: string;
2125
2131
  };
2132
+ fixMemoLeak: {
2133
+ type: BooleanConstructor;
2134
+ };
2126
2135
  }>> & {
2127
2136
  onFormChange?: ((...args: any[]) => any) | undefined;
2128
2137
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -2156,6 +2165,7 @@ declare const _default: import("vue").DefineComponent<{
2156
2165
  feedbackType: "default" | "tooltip";
2157
2166
  operationalFormInit: boolean;
2158
2167
  incrementalRender: boolean;
2168
+ fixMemoLeak: boolean;
2159
2169
  }>;
2160
2170
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
2161
2171
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -314,6 +314,9 @@ declare const _default: import("vue").DefineComponent<{
314
314
  type: PropType<"default" | "tooltip">;
315
315
  default: string;
316
316
  };
317
+ fixMemoLeak: {
318
+ type: BooleanConstructor;
319
+ };
317
320
  }, {
318
321
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
319
322
  fieldList: {
@@ -513,6 +516,9 @@ declare const _default: import("vue").DefineComponent<{
513
516
  type: PropType<"default" | "tooltip">;
514
517
  default: string;
515
518
  };
519
+ fixMemoLeak: {
520
+ type: BooleanConstructor;
521
+ };
516
522
  }>> & {
517
523
  onFormChange?: ((...args: any[]) => any) | undefined;
518
524
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -1070,6 +1076,9 @@ declare const _default: import("vue").DefineComponent<{
1070
1076
  type: PropType<"default" | "tooltip">;
1071
1077
  default: string;
1072
1078
  };
1079
+ fixMemoLeak: {
1080
+ type: BooleanConstructor;
1081
+ };
1073
1082
  }>> & {
1074
1083
  onFormChange?: ((...args: any[]) => any) | undefined;
1075
1084
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -1103,6 +1112,7 @@ declare const _default: import("vue").DefineComponent<{
1103
1112
  feedbackType: "default" | "tooltip";
1104
1113
  operationalFormInit: boolean;
1105
1114
  incrementalRender: boolean;
1115
+ fixMemoLeak: boolean;
1106
1116
  }>;
1107
1117
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
1108
1118
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "validateFailure")[], "update:modelValue" | "validateFailure", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -206,6 +206,9 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
206
206
  type: import("vue").PropType<"default" | "tooltip">;
207
207
  default: string;
208
208
  };
209
+ fixMemoLeak: {
210
+ type: BooleanConstructor;
211
+ };
209
212
  }, {
210
213
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
211
214
  fieldList: {
@@ -405,6 +408,9 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
405
408
  type: import("vue").PropType<"default" | "tooltip">;
406
409
  default: string;
407
410
  };
411
+ fixMemoLeak: {
412
+ type: BooleanConstructor;
413
+ };
408
414
  }>> & {
409
415
  onFormChange?: ((...args: any[]) => any) | undefined;
410
416
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -962,6 +968,9 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
962
968
  type: import("vue").PropType<"default" | "tooltip">;
963
969
  default: string;
964
970
  };
971
+ fixMemoLeak: {
972
+ type: BooleanConstructor;
973
+ };
965
974
  }>> & {
966
975
  onFormChange?: ((...args: any[]) => any) | undefined;
967
976
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -995,6 +1004,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
995
1004
  feedbackType: "default" | "tooltip";
996
1005
  operationalFormInit: boolean;
997
1006
  incrementalRender: boolean;
1007
+ fixMemoLeak: boolean;
998
1008
  }>;
999
1009
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
1000
1010
  export default FormRender;
@@ -201,6 +201,9 @@ declare const _default: import("vue").DefineComponent<{
201
201
  type: PropType<"default" | "tooltip">;
202
202
  default: string;
203
203
  };
204
+ fixMemoLeak: {
205
+ type: BooleanConstructor;
206
+ };
204
207
  }, {
205
208
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
206
209
  fieldList: {
@@ -400,6 +403,9 @@ declare const _default: import("vue").DefineComponent<{
400
403
  type: PropType<"default" | "tooltip">;
401
404
  default: string;
402
405
  };
406
+ fixMemoLeak: {
407
+ type: BooleanConstructor;
408
+ };
403
409
  }>> & {
404
410
  onFormChange?: ((...args: any[]) => any) | undefined;
405
411
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -957,6 +963,9 @@ declare const _default: import("vue").DefineComponent<{
957
963
  type: PropType<"default" | "tooltip">;
958
964
  default: string;
959
965
  };
966
+ fixMemoLeak: {
967
+ type: BooleanConstructor;
968
+ };
960
969
  }>> & {
961
970
  onFormChange?: ((...args: any[]) => any) | undefined;
962
971
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -990,5 +999,6 @@ declare const _default: import("vue").DefineComponent<{
990
999
  feedbackType: "default" | "tooltip";
991
1000
  operationalFormInit: boolean;
992
1001
  incrementalRender: boolean;
1002
+ fixMemoLeak: boolean;
993
1003
  }>;
994
1004
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,provide as t,computed as r,nextTick as a,onUnmounted as s,openBlock as i,createBlock as l,unref as n,mergeProps as m,withCtx as p,createElementBlock as d,createVNode as u,isRef as c,Fragment as f,renderList as h,createCommentVNode as y,createElementVNode as g,normalizeStyle as v,toDisplayString as b,renderSlot as j}from"vue";import{useTheme as k}from"../../../shared/hooks/useTheme.js";import{useElementSize as C}from"@vueuse/core";import"date-fns";import{isNumber as F,cloneDeep as S}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NForm as w,NTabs as x,NTabPane as A,NConfigProvider as B}from"naive-ui";import{useVersion as L}from"../../../shared/hooks/useVersion.js";import"../../../shared/hooks/useScrollLoading.js";import{createForm as R,onFormMount as H,onFieldValueChange as O,onFieldMount as T,onFieldUnmount as I,onFieldReact as V}from"@formily/core";import{Path as N}from"@formily/path";import{FormProvider as _,FormConsumer as D}from"@formily/vue";import{InjectionFormColumnWidth as W,InjectionFormLifeCycleCaller as U,InjectionFormGraph as E}from"./constants/index.js";import"./components/renderer/text.js";import"./utils/business.js";import{createObjSchema as q}from"./utils/schema.js";import{useAnchor as P}from"./hooks/useAnchor.js";import"../index.js";import{useComplexOptionsSpan as G}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 K}from"./hooks/useFieldVisitor.js";import{useFormContext as z}from"./hooks/useFormContext.js";import{useFormDomEvent as J,useFormExposeEvent as Q}from"./hooks/useFormEvent.js";import{useFormGraph as $}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as X}from"./hooks/useFormRenderLifeCycle.js";import{validateMessageLocale as Y}from"./hooks/useFormValidator.js";import{useLowCodeEvent as Z}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as ee}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as oe}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as te}from"./hooks/useOperationalForm.js";import{useWordbookSetting as re}from"./hooks/useWordbookSetting.js";import{useNewLowCodeReactions as ae}from"./hooks/useNewLowCodeReactions.js";const se={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:5},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},annotationShortcuts:{type:Array},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},autoExpand:Boolean,lowCodeReactions:{type:Array},newLowCodeReactions:{type:Array},operationalForm:{type:Array},dateOperationalForm:{type:Object},operationalFormInit:{type:Boolean,default:!0},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},labelPlacementOverwrite:Boolean,outBordered:{type:Boolean,default:!1},uniqueCacheData:{type:Boolean,default:!1},forceClearable:Boolean,wordSplitFilter:{type:Boolean,default:!0},selectMode:Boolean,selectedFields:{type:Array},linebarDirection:{type:String,default:"vertical"},linebarTextDirection:{type:String,default:"horizontal"},linebarWidth:{type:[Number,String],default:120},autoWidth:{type:[Boolean,Number],default:!1},incrementalRender:{type:Boolean,default:!1},feedbackType:{type:String,default:"default"}},emits:["formChange","annotationChange","scroll","update:selectedFields","linebarChange","ready"],setup(e,{expose:le,emit:ne}){const me=e,pe=k(),{nuiThemeOverrides:de}=oe();Y();const ue=o(),{width:ce}=C(ue);t(W,r((()=>ce.value?(ce.value-16*(me.column-1))/24:0)));const fe=r((()=>F(me.maxHeight)?me.maxHeight+"px":me.maxHeight)),{SchemaField:he,businessCollector:ye,formItemDepsCollector:ge,changeContextCollector:ve,asyncQueue:be,formUUID:je}=z(me,ne),{anchorBarRef:ke,currentAnchor:Ce,updateAnchorList:Fe,anchorIdList:Se,onScroll:we,generateAnchorList:xe}=P(me,ne,ue,ge),{callLifeCycle:Ae}=X(me);t(U,Ae),Ae("onSetup");const{observeFormGraph:Be,setGraph:Le,removeGraph:Re}=$();t(E,Be);const{lowCodeEventTrigger:He}=Z(),Oe=o(!0),Te=R({initialValues:me.initialData,effects(e){const o={};H((()=>{Object.assign(o,S(e.values))})),O("*",(t=>{const r=N.getIn(o,t.path);N.setIn(o,t.path,t.value);const a=t.props.name.toString();ye.trigger(e,a),ge.trigger(t.path),Oe.value&&ne("formChange",{fieldInstance:t,fieldKey:a,oldValue:r,fieldName:t.title,value:t.value,context:ve.getContext(a,t.value)}),He(t),Ie(a),Ve(a),Ne.trigger(a),_e.trigger(a,t.value)})),T("*",Le),T("*",(e=>{const o=e.props.name.toString();Ie(o),Ve(o),me.operationalFormInit&&Ne.trigger(o)})),I("*",Re),me.anchor&&V("*",Fe)}}),{lowCodeReactionsHandler:Ie}=ee(r((()=>me.lowCodeReactions)),Te),{newLowCodeReactionsHandler:Ve}=ae(r((()=>me.newLowCodeReactions)),Te),Ne=te(me,Te),_e=re().create(Te,ve),{schemaAdaptor:De}=M(ye,me.lifeCycle);let We=me.fieldList||[],Ue=[];const Ee=r((()=>{let e=!1;const o=me.schema?me.schema:me.fieldList?(We!==me.fieldList&&0!==We.length||(e=!0),We=K().traverse(S(me.fieldList),me.fieldVisitor),q(De(We,me))):q({});return me.incrementalRender&&e&&(Ue=[],Object.values(o.properties).forEach((e=>{var o;"visible"===e["x-display"]&&"LINEBAR"===e["x-component"]&&!1!==(null==(o=e["x-component-props"])?void 0:o.show)&&(Ue.push(e),e["x-component-props"].show=!1)})),qe()),o}));function qe(){Ue.length&&setTimeout((()=>{const e=Ue.shift();e&&(ge.trigger(N.parse(e.name),!0),Te.setFieldState(e.name,(e=>{e.componentProps.show=!0})),Ue.length?qe():a().then((()=>{ne("ready")})))}),300)}const{onKeydown:Pe}=J({formModel:Te,formRenderRef:ue,props:me,formUUID:je}),{clearSpan:Ge}=G();s((()=>Ge(je)));const Me=Q({formModel:Te,formRenderRef:ue,formItemDepsCollector:ge,businessCollector:ye,wordbookSettingHandler:_e,operationalFormHandler:Ne,getFieldList:()=>We,formUUID:je,changeContextCollector:ve,emitFormChange:Oe});return le({formModel:Te,validate:(e="*",o={})=>Me.validate(e,o),getFormValues:(e=!0)=>Me.getFormValues(e),setFormValues:async(e,o={})=>Me.setFormValues(e,o),setFieldState(e,o){Me.setFieldState(e,o)},resetFields(e="*"){Me.resetFields(e)},queryWidget:async e=>Me.queryWidget(e),getFieldList:()=>We,applySelectedSetting:e=>Me.applySelectedSetting(e),async reload(){console.error("reload function is abstract,it should be overwrite!")},async optionInited(e={}){if(await a(),be.activeTasks)return new Promise((o=>{var t;const r=()=>{o(),be.onActiveTaskChange=null};be.onActiveTaskChange=()=>{be.activeTasks||r()},setTimeout(r,null!=(t=e.timeout)?t:5e3)}))},updateAnchor(){xe(Te)},getTextFormValues:()=>Me.getTextFormValues()}),(o,t)=>(i(),l(n(w),m({class:["form-render",{"form-render--out-border":e.outBordered}],"require-mark-placement":"left",style:n(pe)},n(L)(),{uuid:n(je)}),{default:p((()=>[e.anchor?(i(),d("section",se,[u(n(x),{value:n(Ce),"onUpdate:value":t[0]||(t[0]=e=>c(Ce)?Ce.value=e:null),type:"line",ref_key:"anchorBarRef",ref:ke},{default:p((()=>[(i(!0),d(f,null,h(n(Se),(e=>(i(),l(n(A),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):y("v-if",!0),u(n(B),{"theme-overrides":n(de)},{default:p((()=>[g("section",{class:"form-render__wrapper",style:v({"--column":e.column,"--form-height":n(fe)}),ref_key:"formRenderRef",ref:ue,onScroll:t[1]||(t[1]=(...e)=>n(we)&&n(we)(...e)),onKeydownCapture:t[2]||(t[2]=(...e)=>n(Pe)&&n(Pe)(...e))},[u(n(_),{form:n(Te)},{default:p((()=>[u(n(he),{schema:n(Ee)},null,8,["schema"]),e.consumer?(i(),l(n(D),{key:0},{default:p((({form:e})=>[g("div",ie,b(JSON.stringify(e.values,null,2)),1)])),_:1})):y("v-if",!0),j(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},16,["class","style","uuid"]))}});export{le as default};
1
+ import{defineComponent as e,ref as o,provide as t,computed as r,nextTick as a,onBeforeUnmount as s,openBlock as i,createBlock as l,unref as n,mergeProps as m,withCtx as p,createElementBlock as d,createVNode as u,isRef as c,Fragment as f,renderList as h,createCommentVNode as y,createElementVNode as g,normalizeStyle as v,toDisplayString as b,renderSlot as j}from"vue";import{useTheme as k}from"../../../shared/hooks/useTheme.js";import{useElementSize as C}from"@vueuse/core";import"date-fns";import{isNumber as F,cloneDeep as S}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NForm as x,NTabs as w,NTabPane as L,NConfigProvider as B}from"naive-ui";import{useVersion as A}from"../../../shared/hooks/useVersion.js";import"../../../shared/hooks/useScrollLoading.js";import{createForm as R,onFormMount as H,onFieldValueChange as O,onFieldMount as T,onFieldUnmount as I,onFieldReact as V}from"@formily/core";import{Path as N}from"@formily/path";import{FormProvider as _,FormConsumer as D}from"@formily/vue";import{InjectionFormColumnWidth as W,InjectionFormLifeCycleCaller as U,InjectionFormGraph as E}from"./constants/index.js";import"./components/renderer/text.js";import"./utils/business.js";import{createObjSchema as M}from"./utils/schema.js";import{useAnchor as q}from"./hooks/useAnchor.js";import"../index.js";import{useComplexOptionsSpan as P}from"./hooks/useComplexOptions.js";import{useFieldListAdaptor as G}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{useFieldVisitor as K}from"./hooks/useFieldVisitor.js";import{useFormContext as z}from"./hooks/useFormContext.js";import{useFormDomEvent as J,useFormExposeEvent as Q}from"./hooks/useFormEvent.js";import{useFormGraph as $}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as X}from"./hooks/useFormRenderLifeCycle.js";import{validateMessageLocale as Y}from"./hooks/useFormValidator.js";import{useLowCodeEvent as Z}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as ee}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as oe}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as te}from"./hooks/useOperationalForm.js";import{useWordbookSetting as re}from"./hooks/useWordbookSetting.js";import{useNewLowCodeReactions as ae}from"./hooks/useNewLowCodeReactions.js";import{GlobalState as se}from"@formily/core/esm/shared/constants";const ie={key:0,style:{height:"54px"}},le={style:{"white-space":"pre"}};var ne=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:5},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},annotationShortcuts:{type:Array},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},autoExpand:Boolean,lowCodeReactions:{type:Array},newLowCodeReactions:{type:Array},operationalForm:{type:Array},dateOperationalForm:{type:Object},operationalFormInit:{type:Boolean,default:!0},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},labelPlacementOverwrite:Boolean,outBordered:{type:Boolean,default:!1},uniqueCacheData:{type:Boolean,default:!1},forceClearable:Boolean,wordSplitFilter:{type:Boolean,default:!0},selectMode:Boolean,selectedFields:{type:Array},linebarDirection:{type:String,default:"vertical"},linebarTextDirection:{type:String,default:"horizontal"},linebarWidth:{type:[Number,String],default:120},autoWidth:{type:[Boolean,Number],default:!1},incrementalRender:{type:Boolean,default:!1},feedbackType:{type:String,default:"default"},fixMemoLeak:{type:Boolean}},emits:["formChange","annotationChange","scroll","update:selectedFields","linebarChange","ready"],setup(e,{expose:ne,emit:me}){const pe=e,de=k(),{nuiThemeOverrides:ue}=oe();Y();const ce=o(),{width:fe}=C(ce);t(W,r((()=>fe.value?(fe.value-16*(pe.column-1))/24:0)));const he=r((()=>F(pe.maxHeight)?pe.maxHeight+"px":pe.maxHeight)),{SchemaField:ye,businessCollector:ge,formItemDepsCollector:ve,changeContextCollector:be,asyncQueue:je,formUUID:ke}=z(pe,me),{anchorBarRef:Ce,currentAnchor:Fe,updateAnchorList:Se,anchorIdList:xe,onScroll:we,generateAnchorList:Le}=q(pe,me,ce,ve),{callLifeCycle:Be}=X(pe);t(U,Be),Be("onSetup");const{observeFormGraph:Ae,setGraph:Re,removeGraph:He}=$();t(E,Ae);const{lowCodeEventTrigger:Oe}=Z(),Te=o(!0),Ie=R({initialValues:pe.initialData,effects(e){const o={};H((()=>{Object.assign(o,S(e.values))})),O("*",(t=>{const r=N.getIn(o,t.path);N.setIn(o,t.path,t.value);const a=t.props.name.toString();ge.trigger(e,a),ve.trigger(t.path),Te.value&&me("formChange",{fieldInstance:t,fieldKey:a,oldValue:r,fieldName:t.title,value:t.value,context:be.getContext(a,t.value)}),Oe(t),Ve(a),Ne(a),_e.trigger(a),De.trigger(a,t.value)})),T("*",Re),T("*",(e=>{const o=e.props.name.toString();Ve(o),Ne(o),pe.operationalFormInit&&_e.trigger(o)})),I("*",He),pe.anchor&&V("*",Se)}}),{lowCodeReactionsHandler:Ve}=ee(r((()=>pe.lowCodeReactions)),Ie),{newLowCodeReactionsHandler:Ne}=ae(r((()=>pe.newLowCodeReactions)),Ie),_e=te(pe,Ie),De=re().create(Ie,be),{schemaAdaptor:We}=G(ge,pe.lifeCycle);let Ue=pe.fieldList||[],Ee=[];const Me=r((()=>{let e=!1;const o=pe.schema?pe.schema:pe.fieldList?(Ue!==pe.fieldList&&0!==Ue.length||(e=!0),Ue=K().traverse(S(pe.fieldList),pe.fieldVisitor),M(We(Ue,pe))):M({});return pe.incrementalRender&&e&&(Ee=[],Object.values(o.properties).forEach((e=>{var o;"visible"===e["x-display"]&&"LINEBAR"===e["x-component"]&&!1!==(null==(o=e["x-component-props"])?void 0:o.show)&&(Ee.push(e),e["x-component-props"].show=!1)})),qe()),o}));function qe(){Ee.length&&setTimeout((()=>{const e=Ee.shift();e&&(ve.trigger(N.parse(e.name),!0),Ie.setFieldState(e.name,(e=>{e.componentProps.show=!0})),Ee.length?qe():a().then((()=>{me("ready")})))}),300)}const{onKeydown:Pe}=J({formModel:Ie,formRenderRef:ce,props:pe,formUUID:ke}),{clearSpan:Ge}=P();s((()=>{Ge(ke),pe.fixMemoLeak&&(se.lifecycles.length=0)}));const Ke=Q({formModel:Ie,formRenderRef:ce,formItemDepsCollector:ve,businessCollector:ge,wordbookSettingHandler:De,operationalFormHandler:_e,getFieldList:()=>Ue,formUUID:ke,changeContextCollector:be,emitFormChange:Te});return ne({formModel:Ie,validate:(e="*",o={})=>Ke.validate(e,o),getFormValues:(e=!0)=>Ke.getFormValues(e),setFormValues:async(e,o={})=>Ke.setFormValues(e,o),setFieldState(e,o){Ke.setFieldState(e,o)},resetFields(e="*"){Ke.resetFields(e)},queryWidget:async e=>Ke.queryWidget(e),getFieldList:()=>Ue,applySelectedSetting:e=>Ke.applySelectedSetting(e),async reload(){console.error("reload function is abstract,it should be overwrite!")},async optionInited(e={}){if(await a(),je.activeTasks)return new Promise((o=>{var t;const r=()=>{o(),je.onActiveTaskChange=null};je.onActiveTaskChange=()=>{je.activeTasks||r()},setTimeout(r,null!=(t=e.timeout)?t:5e3)}))},updateAnchor(){Le(Ie)},getTextFormValues:()=>Ke.getTextFormValues()}),(o,t)=>(i(),l(n(x),m({class:["form-render",{"form-render--out-border":e.outBordered}],"require-mark-placement":"left",style:n(de)},n(A)(),{uuid:n(ke)}),{default:p((()=>[e.anchor?(i(),d("section",ie,[u(n(w),{value:n(Fe),"onUpdate:value":t[0]||(t[0]=e=>c(Fe)?Fe.value=e:null),type:"line",ref_key:"anchorBarRef",ref:Ce},{default:p((()=>[(i(!0),d(f,null,h(n(xe),(e=>(i(),l(n(L),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):y("v-if",!0),u(n(B),{"theme-overrides":n(ue)},{default:p((()=>[g("section",{class:"form-render__wrapper",style:v({"--column":e.column,"--form-height":n(he)}),ref_key:"formRenderRef",ref:ce,onScroll:t[1]||(t[1]=(...e)=>n(we)&&n(we)(...e)),onKeydownCapture:t[2]||(t[2]=(...e)=>n(Pe)&&n(Pe)(...e))},[u(n(_),{form:n(Ie)},{default:p((()=>[u(n(ye),{schema:n(Me)},null,8,["schema"]),e.consumer?(i(),l(n(D),{key:0},{default:p((({form:e})=>[g("div",le,b(JSON.stringify(e.values,null,2)),1)])),_:1})):y("v-if",!0),j(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},16,["class","style","uuid"]))}});export{ne as default};
@@ -204,6 +204,9 @@ declare const _default: import("vue").DefineComponent<{}, {
204
204
  type: import("vue").PropType<"default" | "tooltip">;
205
205
  default: string;
206
206
  };
207
+ fixMemoLeak: {
208
+ type: BooleanConstructor;
209
+ };
207
210
  }, {
208
211
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
209
212
  fieldList: {
@@ -403,6 +406,9 @@ declare const _default: import("vue").DefineComponent<{}, {
403
406
  type: import("vue").PropType<"default" | "tooltip">;
404
407
  default: string;
405
408
  };
409
+ fixMemoLeak: {
410
+ type: BooleanConstructor;
411
+ };
406
412
  }>> & {
407
413
  onFormChange?: ((...args: any[]) => any) | undefined;
408
414
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -960,6 +966,9 @@ declare const _default: import("vue").DefineComponent<{}, {
960
966
  type: import("vue").PropType<"default" | "tooltip">;
961
967
  default: string;
962
968
  };
969
+ fixMemoLeak: {
970
+ type: BooleanConstructor;
971
+ };
963
972
  }>> & {
964
973
  onFormChange?: ((...args: any[]) => any) | undefined;
965
974
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -993,6 +1002,7 @@ declare const _default: import("vue").DefineComponent<{}, {
993
1002
  feedbackType: "default" | "tooltip";
994
1003
  operationalFormInit: boolean;
995
1004
  incrementalRender: boolean;
1005
+ fixMemoLeak: boolean;
996
1006
  }>;
997
1007
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
998
1008
  export default _default;
@@ -8,6 +8,9 @@ export declare const INPUT: import("vue").DefineComponent<{
8
8
  suffix: {
9
9
  type: (ObjectConstructor | StringConstructor | FunctionConstructor)[];
10
10
  };
11
+ password: {
12
+ type: BooleanConstructor;
13
+ };
11
14
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
12
15
  value: {
13
16
  type: StringConstructor;
@@ -18,6 +21,11 @@ export declare const INPUT: import("vue").DefineComponent<{
18
21
  suffix: {
19
22
  type: (ObjectConstructor | StringConstructor | FunctionConstructor)[];
20
23
  };
24
+ password: {
25
+ type: BooleanConstructor;
26
+ };
21
27
  }>> & {
22
28
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
23
- }, {}>;
29
+ }, {
30
+ password: boolean;
31
+ }>;
@@ -1 +1 @@
1
- import{defineComponent as e,createVNode as t}from"vue";import{useVModel as o}from"@vueuse/core";import{useCommonInjection as r}from"../../hooks/useCommonInjection.js";import{createInputSlot as i}from"../../utils/index.js";import{connect as u,mapProps as n}from"@formily/vue";import{NInput as m}from"naive-ui";import{assignUpdateValue as s,assignClearBindVisited as p}from"../../utils/schema.js";const a=u(e({name:"FormInput",props:{value:{type:String},prefix:{type:[String,Function,Object]},suffix:{type:[String,Function,Object]}},emits:["update:value"],setup(e,{emit:u}){const n=o(e,"value",u),s=r().injectValueBindKey(n),p=i(e,(e=>[t("i",{style:{color:"rgba(33,33,33,.4)"}},[e])]));return()=>t(m,{key:s.value,value:n.value,"onUpdate:value":e=>n.value=e},p.value)}}),n(((e,t)=>{const o=s(e,t);return o.allowInput=e=>!e.startsWith(" ")&&!e.endsWith(" "),o}),p));export{a as INPUT};
1
+ import{defineComponent as e,createVNode as t}from"vue";import{useVModel as o}from"@vueuse/core";import{useCommonInjection as r}from"../../hooks/useCommonInjection.js";import{createInputSlot as i}from"../../utils/index.js";import{connect as u,mapProps as s}from"@formily/vue";import{NInput as n}from"naive-ui";import{assignUpdateValue as p,assignClearBindVisited as a}from"../../utils/schema.js";const m=u(e({name:"FormInput",props:{value:{type:String},prefix:{type:[String,Function,Object]},suffix:{type:[String,Function,Object]},password:{type:Boolean}},emits:["update:value"],setup(e,{emit:u}){const s=o(e,"value",u),p=r().injectValueBindKey(s),a=i(e,(e=>[t("i",{style:{color:"rgba(33,33,33,.4)"}},[e])]));return()=>t(n,{type:e.password?"password":"text",key:p.value,value:s.value,"onUpdate:value":e=>s.value=e},a.value)}}),s(((e,t)=>{const o=p(e,t);return o.allowInput=e=>!e.startsWith(" ")&&!e.endsWith(" "),o}),a));export{m as INPUT};
@@ -1 +1 @@
1
- import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{isPositive as r,isNegative as s,parseNumberFromMaybeString as l,formRenderLog as a}from"../utils/index.js";import{useFieldNormalize as p}from"./useFieldNormalize.js";import{traverseSchema as c,fieldKeyEscape as d,createLinebarId as m}from"../utils/schema.js";import{useFormValidator as u}from"./useFormValidator.js";import{transformDateFormat as f}from"../utils/business.js";function x(e,o){Object.assign(e["x-component-props"],{...i(o,["wordbook","autograph"])})}function _(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function h(n,h){const{createValidatorSchema:g}=u(),v=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:s(e.is_empty),...e.componentProps||{}},"x-content":e.slots,"x-display":s(e.is_show)?"hidden":"visible","x-pattern":s(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,beforeSetValue:null==h?void 0:h.beforeSetValue,span:2*(e.elem_width||3),showLabel:!r(e.hide_title),remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=g(e);return n&&(t["x-validator"]=n),s(e.is_null)&&(t.required=!0),t},y=e=>{var o,t,n,s,a,p,c,d,m,u,f,h,b,g;const y=v(e);e.urlConfig?_(y,e):e.autograph&&x(y,e);const w=!!e.__multiple,C=r(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=r(null!=(s=null==(n=e.componentProps)?void 0:n.selectAll)?s:e.selectAll),A=r(null!=(p=null==(a=e.componentProps)?void 0:a.shouldSave)?p:e.save_free_entry),j=r(null!=(d=null==(c=e.componentProps)?void 0:c.allowCreate)?d:e.free_entry),E=null!=(u=null==(m=e.componentProps)?void 0:m.showField)?u:e.show_key,k=null!=(h=null==(f=e.componentProps)?void 0:f.options)?h:e.option,N=null!=(g=l(e.multi_select_value))?g:null==(b=e.componentProps)?void 0:b.maxTagCount;return Object.assign(y["x-component-props"],{multiple:w,options:k,allowModify:C,allowCreate:j||C,shouldSave:A,showField:E,maxTagCount:N,selectAll:O,...i(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},w=e=>{var o,t;const n=v(e),i=null!=(t=null==(o=e.componentProps)?void 0:o.selectAll)?t:e.selectAll;return Object.assign(n["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode,vertical:e.__vertical,selectAll:r(i)}),e.urlConfig?_(n,e):e.autograph&&x(n,e),n},C=e=>{const t=v(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},O=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{linebarTextDirection:e.linebarTextDirection,linebarDirection:e.linebarDirection,linebarWidth:e.linebarWidth,disabled:r(e.is_not_fold),id:m(e.val_key),show:!s(e.is_show),remark:e.remark},"x-content":e.slots}),A=new Map([["LINEBAR",O],["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":s(e.is_show)?"hidden":"visible"})],["INPUT",e=>{const o=v(e);return Object.assign(o["x-component-props"],{...i(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=v(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=v(e),{decimal_length:t,validate:n,allowSlash:i}=e;return r(i)&&(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:l(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",y],["REMOTE_SEARCH",y],["DATE",e=>{const o=v(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:f(e.date_format),validate:e.validate}),o}],["TIME",e=>{const o=v(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:f(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=v(e);return Object.assign(o["x-component-props"],{...i(e,["wordbook","lazyRequest","autograph"])}),r(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=v(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=v(e);return o.type="array","table"===e.displayMode?o["x-component"]="TABLE_COMBINATION":!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,minGroupNum:e.minGroupNum,showLabel:!r(e.hide_title),properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",w],["CHECKBOX",w],["SWITCH",e=>{const o=v(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=v(e);return Object.assign(o["x-component-props"],{step:l(e.step_length),max:l(e.max_length),min:l(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=v(e);Array.isArray(e.properties)&&a("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?I(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"],i(e,["wrapperStyle","display"])),o}]]),j=e=>{if(e.suffixConfig||e.prefixConfig)return E(e);return(A.get(e.html_type)||C)(e)},E=o=>{if(!o.suffixConfig&&!o.prefixConfig)return j(o);const t=v(o),n=o.suffixConfig?e(o.suffixConfig):[],i=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:s(e.is_show)?"0":o.is_show}))),{...o,hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...n.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:s(e.is_show)?"0":o.is_show})))],r=i.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(t,{type:"void",name:d(i),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...t["x-decorator-props"],showFeedback:!1,suffixFields:i.map((e=>e.val_key))},properties:I(i)}),t},{FieldNormalizeWaterfallHook:k,FieldListNormalizeWaterfallHook:N}=p();function I(o,i={column:9999}){let r=null;const s=N.call(t(o),i).reduce(((e,o,s)=>{var p;const c=null==(p=(o=k.call(o,i)).validate)?void 0:p.obj_type;return c&&n&&n.collect(c,t(o)),"LINEBAR"===o.html_type?(e[a(o)]=l(O(o),s),r=e[a(o)].properties={}):r?r[a(o)]=l(j(o),s):(r=null,e[a(o)]=l(j(o),s)),e}),{});return i.linebarAutoHidden&&Object.values(s).forEach((e=>{"LINEBAR"===e["x-component"]&&b(e)})),c({properties:s,"x-root":!0},((e,o)=>{"INPUT_GROUP"===e["x-component"]&&b(e,!!o&&!o["x-root"])})),s;function l(e,o){return e["x-index"]=o,e["x-decorator-props"]={_index:o,...e["x-decorator-props"]},e}function a(o){if(o.suffixConfig||o.prefixConfig){const t=[...e(o.prefixConfig),o,...e(o.suffixConfig)].filter(Boolean);return d(t)}return o.val_key}}return{schemaAdaptor:I}}function b(e,o=!1){e["x-reactions"]?e["x-reactions"]=n(e["x-reactions"]):e["x-reactions"]=[];const t=Object.keys(e.properties||{}).map((t=>`${o?"*.":"."}${e.name}.${t}#selfDisplay`)).concat(Object.keys(e.properties||{}).map((t=>`${o?"*.":"."}${e.name}.${t}#component`)));e["x-reactions"].push({dependencies:t,fulfill:{state:{visible:"{{hasVisible($deps)}}"}}})}export{h as useFieldListAdaptor};
1
+ import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{isPositive as r,isNegative as s,parseNumberFromMaybeString as l,formRenderLog as a}from"../utils/index.js";import{useFieldNormalize as p}from"./useFieldNormalize.js";import{traverseSchema as c,fieldKeyEscape as d,createLinebarId as m}from"../utils/schema.js";import{useFormValidator as u}from"./useFormValidator.js";import{transformDateFormat as f}from"../utils/business.js";function x(e,o){Object.assign(e["x-component-props"],{...i(o,["wordbook","autograph"])})}function _(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function h(n,h){const{createValidatorSchema:g}=u(),v=o=>{var t;const n={name:o.val_key,type:null!=(t=o.fieldType)?t:"string",title:o.alias||o.name,"x-component":o.html_type,default:o.default_val,"x-component-props":{placeholder:o.placeholder,clearable:s(o.is_empty),...o.componentProps||{}},"x-content":o.slots,"x-display":s(o.is_show)?"hidden":"visible","x-pattern":s(o.is_edit)?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};o.reactions&&(n["x-reactions"]=e(o.reactions).map((e=>{var o;return e.target?{...e,effects:null!=(o=e.effects)?o:["onFieldInit","onFieldValueChange"]}:e}))),o.noDecorator||Object.assign(n,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:o,beforeSetValue:null==h?void 0:h.beforeSetValue,span:2*(o.elem_width||3),showLabel:!r(o.hide_title),remark:o.remark,propertyKey:o.val_key,annotation:o.annotation,...o.decoratorProps||{}}});const i=g(o);return i&&(n["x-validator"]=i),s(o.is_null)&&(n.required=!0),n},y=e=>{var o,t,n,s,a,p,c,d,m,u,f,h,b,g;const y=v(e);e.urlConfig?_(y,e):e.autograph&&x(y,e);const w=!!e.__multiple,C=r(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=r(null!=(s=null==(n=e.componentProps)?void 0:n.selectAll)?s:e.selectAll),A=r(null!=(p=null==(a=e.componentProps)?void 0:a.shouldSave)?p:e.save_free_entry),j=r(null!=(d=null==(c=e.componentProps)?void 0:c.allowCreate)?d:e.free_entry),E=null!=(u=null==(m=e.componentProps)?void 0:m.showField)?u:e.show_key,k=null!=(h=null==(f=e.componentProps)?void 0:f.options)?h:e.option,I=null!=(g=l(e.multi_select_value))?g:null==(b=e.componentProps)?void 0:b.maxTagCount;return Object.assign(y["x-component-props"],{multiple:w,options:k,allowModify:C,allowCreate:j||C,shouldSave:A,showField:E,maxTagCount:I,selectAll:O,...i(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},w=e=>{var o,t;const n=v(e),i=null!=(t=null==(o=e.componentProps)?void 0:o.selectAll)?t:e.selectAll;return Object.assign(n["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode,vertical:e.__vertical,selectAll:r(i)}),e.urlConfig?_(n,e):e.autograph&&x(n,e),n},C=e=>{const t=v(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},O=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{linebarTextDirection:e.linebarTextDirection,linebarDirection:e.linebarDirection,linebarWidth:e.linebarWidth,disabled:r(e.is_not_fold),id:m(e.val_key),show:!s(e.is_show),remark:e.remark},"x-content":e.slots}),A=new Map([["LINEBAR",O],["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":s(e.is_show)?"hidden":"visible"})],["INPUT",e=>{var o;const t=v(e);return Object.assign(t["x-component-props"],{...i(e,["prefix","suffix"]),password:"password"===(null==(o=e.validate)?void 0:o.obj_type)}),t}],["TEXTAREA",e=>{const o=v(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=v(e),{decimal_length:t,validate:n,allowSlash:i}=e;return r(i)&&(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:l(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",y],["REMOTE_SEARCH",y],["DATE",e=>{const o=v(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:f(e.date_format),validate:e.validate}),o}],["TIME",e=>{const o=v(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:f(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=v(e);return Object.assign(o["x-component-props"],{...i(e,["wordbook","lazyRequest","autograph"])}),r(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=v(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=v(e);return o.type="array","table"===e.displayMode?o["x-component"]="TABLE_COMBINATION":!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,minGroupNum:e.minGroupNum,showLabel:!r(e.hide_title),properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",w],["CHECKBOX",w],["SWITCH",e=>{const o=v(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=v(e);return Object.assign(o["x-component-props"],{step:l(e.step_length),max:l(e.max_length),min:l(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=v(e);Array.isArray(e.properties)&&a("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?N(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"],i(e,["wrapperStyle","display"])),o}]]),j=e=>{if(e.suffixConfig||e.prefixConfig)return E(e);return(A.get(e.html_type)||C)(e)},E=o=>{if(!o.suffixConfig&&!o.prefixConfig)return j(o);const t=v(o),n=o.suffixConfig?e(o.suffixConfig):[],i=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:s(e.is_show)?"0":o.is_show}))),{...o,hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...n.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:s(e.is_show)?"0":o.is_show})))],r=i.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(t,{type:"void",name:d(i),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...t["x-decorator-props"],showFeedback:!1,suffixFields:i.map((e=>e.val_key))},properties:N(i)}),t},{FieldNormalizeWaterfallHook:k,FieldListNormalizeWaterfallHook:I}=p();function N(o,i={column:9999}){let r=null;const s=I.call(t(o),i).reduce(((e,o,s)=>{var p;const c=null==(p=(o=k.call(o,i)).validate)?void 0:p.obj_type;return c&&n&&n.collect(c,t(o)),"LINEBAR"===o.html_type?(e[a(o)]=l(O(o),s),r=e[a(o)].properties={}):r?r[a(o)]=l(j(o),s):(r=null,e[a(o)]=l(j(o),s)),e}),{});return i.linebarAutoHidden&&Object.values(s).forEach((e=>{"LINEBAR"===e["x-component"]&&b(e)})),c({properties:s,"x-root":!0},((e,o)=>{"INPUT_GROUP"===e["x-component"]&&b(e,!!o&&!o["x-root"])})),s;function l(e,o){return e["x-index"]=o,e["x-decorator-props"]={_index:o,...e["x-decorator-props"]},e}function a(o){if(o.suffixConfig||o.prefixConfig){const t=[...e(o.prefixConfig),o,...e(o.suffixConfig)].filter(Boolean);return d(t)}return o.val_key}}return{schemaAdaptor:N}}function b(e,o=!1){e["x-reactions"]?e["x-reactions"]=n(e["x-reactions"]):e["x-reactions"]=[];const t=Object.keys(e.properties||{}).map((t=>`${o?"*.":"."}${e.name}.${t}#selfDisplay`)).concat(Object.keys(e.properties||{}).map((t=>`${o?"*.":"."}${e.name}.${t}#component`)));e["x-reactions"].push({dependencies:t,fulfill:{state:{visible:"{{hasVisible($deps)}}"}}})}export{h as useFieldListAdaptor};