cnhis-design-vue 3.1.56-release.0 → 3.1.56-release.2

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 (135) hide show
  1. package/README.md +87 -87
  2. package/es/components/annotation-edit/index.d.ts +18 -0
  3. package/es/components/annotation-edit/src/AnnotationEdit.d.ts +18 -0
  4. package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
  5. package/es/components/annotation-edit/src/type.d.ts +4 -0
  6. package/es/components/audio-sdk/src/audioSDK.d.ts +20 -6
  7. package/es/components/audio-sdk/src/audioSDK.js +1 -1
  8. package/es/components/audio-sdk/src/components/recordingDialog.vue.d.ts +14 -0
  9. package/es/components/audio-sdk/src/components/recordingDialog.vue2.js +1 -1
  10. package/es/components/audio-sdk/src/utils/recordingDialog.d.ts +5 -2
  11. package/es/components/audio-sdk/src/utils/recordingDialog.js +1 -1
  12. package/es/components/audio-sdk/style/index.css +1 -1
  13. package/es/components/base-search/index.d.ts +14 -0
  14. package/es/components/base-search/src/index.vue.d.ts +14 -0
  15. package/es/components/base-search/src/index.vue2.js +1 -1
  16. package/es/components/base-search/style/index.css +1 -1
  17. package/es/components/big-table/index.js +1 -1
  18. package/es/components/callback/src/components/render/popupMaps.d.ts +26 -4
  19. package/es/components/classification/index.d.ts +20 -7
  20. package/es/components/classification/src/components/search-filter/index.vue.d.ts +14 -0
  21. package/es/components/classification/src/components/set-classification/index.vue.d.ts +20 -7
  22. package/es/components/classification/src/components/set-classification/index.vue2.js +1 -1
  23. package/es/components/classification/src/components/table-modal/index.vue.d.ts +6 -5
  24. package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
  25. package/es/components/classification/src/index.vue.d.ts +20 -7
  26. package/es/components/classification/src/index.vue2.js +1 -1
  27. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  28. package/es/components/fabric-chart/index.d.ts +4 -2
  29. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +4 -2
  30. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  31. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  32. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  33. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  34. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  35. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  36. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  37. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  38. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  39. package/es/components/form-config/index.d.ts +82 -14
  40. package/es/components/form-config/src/FormConfig.vue.d.ts +82 -14
  41. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +26 -4
  42. package/es/components/form-config/src/components/FormConfigCreator.vue2.js +1 -1
  43. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +41 -7
  44. package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
  45. package/es/components/form-render/index.d.ts +26 -4
  46. package/es/components/form-render/src/FormRender.vue.d.ts +27 -4
  47. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  48. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +26 -4
  49. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  50. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  51. package/es/components/form-render/src/components/renderer/select.js +1 -1
  52. package/es/components/form-render/src/constants/index.d.ts +1 -0
  53. package/es/components/form-render/src/constants/index.js +1 -1
  54. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +10 -2
  55. package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
  56. package/es/components/form-render/src/hooks/useFormContext.js +1 -1
  57. package/es/components/form-render/src/types/index.d.ts +3 -1
  58. package/es/components/iho-table/index.js +1 -1
  59. package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.js +1 -1
  60. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
  61. package/es/components/iho-table/src/hooks/tapHooks/useDomInsertHooks.js +1 -1
  62. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.js +1 -1
  63. package/es/components/iho-table/src/hooks/tapHooks/useExposeHooks.js +1 -1
  64. package/es/components/iho-table/src/hooks/tapHooks/useFieldHooks.js +1 -1
  65. package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.js +1 -1
  66. package/es/components/iho-table/src/plugins/defaultValuePlugin.js +1 -1
  67. package/es/components/iho-table/src/plugins/headerPlugin.js +1 -1
  68. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  69. package/es/components/iho-table/src/utils/index.js +1 -1
  70. package/es/components/index.css +1 -1
  71. package/es/components/index.js +1 -1
  72. package/es/components/info-header/index.d.ts +77 -13
  73. package/es/components/info-header/src/InfoHeader.vue.d.ts +77 -13
  74. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +5 -1
  75. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +5 -1
  76. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +31 -5
  77. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +26 -4
  78. package/es/components/recommend-search/index.d.ts +8 -8
  79. package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +8 -8
  80. package/es/components/recommend-search/src/components/BaseSearch.d.ts +1 -1
  81. package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +3 -3
  82. package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +3 -3
  83. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  84. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  85. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  86. package/es/components/shortcut-setter/index.d.ts +26 -4
  87. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +26 -4
  88. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
  89. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +14 -0
  90. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue.d.ts +14 -0
  91. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +14 -0
  92. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +14 -0
  93. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +15 -0
  94. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
  95. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue.d.ts +14 -0
  96. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
  97. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +15 -0
  98. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +15 -0
  99. package/es/components/vod-chunk-upload/src/vod-chunk-upload/index.js +1 -1
  100. package/es/env.d.ts +25 -25
  101. package/es/shared/assets/img/failure.png.js +1 -1
  102. package/es/shared/assets/img/no-permission.png.js +1 -1
  103. package/es/shared/assets/img/nodata.png.js +1 -1
  104. package/es/shared/assets/img/notfound.png.js +1 -1
  105. package/es/shared/assets/img/qr.png.js +1 -1
  106. package/es/shared/assets/img/success.png.js +1 -1
  107. package/es/shared/assets/img/video.png.js +1 -1
  108. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  109. package/es/shared/assets/img/xb_big.png.js +1 -1
  110. package/es/shared/assets/img/xb_small.png.js +1 -1
  111. package/es/shared/components/CancelRadio/index.js +1 -1
  112. package/es/shared/components/InputNumberSlash/index.js +1 -1
  113. package/es/shared/components/SelectPage/index.js +1 -1
  114. package/es/shared/components/SlotRender/index.js +1 -1
  115. package/es/shared/components/SvgIcon/index.js +1 -1
  116. package/es/shared/components/TextOverTooltip/index.js +1 -1
  117. package/es/shared/components/VueDraggable/index.js +1 -1
  118. package/es/shared/components/no-data/index.js +1 -1
  119. package/es/shared/package.json.js +1 -1
  120. package/es/shared/utils/business.js +1 -1
  121. package/es/shared/utils/tapable/AsyncParallelBailHook.js +1 -0
  122. package/es/shared/utils/tapable/AsyncSeriesBailHook.js +1 -0
  123. package/es/shared/utils/tapable/AsyncSeriesLoopHook.js +1 -0
  124. package/es/shared/utils/tapable/AsyncSeriesWaterfallHook.js +1 -0
  125. package/es/shared/utils/tapable/SyncBailHook.js +1 -0
  126. package/es/shared/utils/tapable/SyncLoopHook.js +1 -0
  127. package/es/shared/utils/vexutils.js +1 -1
  128. package/package.json +2 -2
  129. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  130. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  131. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  132. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  133. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  134. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  135. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -1 +1 @@
1
- import{defineComponent as e,computed as i,ref as r,inject as o,watch as t,toRaw as s,openBlock as n,createElementBlock as d,Fragment as a,createVNode as l,unref as m,mergeProps as p,nextTick as u}from"vue";import{cloneDeep as c}from"lodash-es";import{InjectionActiveFieldItem as j}from"../constants/index.js";import"../../../../shared/components/VueDraggable/src/vuedraggable.js";import{findFieldItemByKey as x}from"../utils/index.js";import"@vicons/ionicons5";import{NModal as f}from"naive-ui";import"../../../../shared/utils/index.js";import{useConfigurationField as v}from"../hooks/useConfigurationField.js";import"../../../grid/index.js";import"../../../big-table/index.js";import"../../../field-set/index.js";import"../../../button-print/index.js";import"../../../select-person/index.js";import"../../../select-label/index.js";import"../../../map/index.js";import"../../../vod-chunk-upload/index.js";import"../../../scale-view/index.js";import"../../../info-header/index.js";import"../../../time-line/index.js";import"../../../base-search/index.js";import"../../../quick-search/index.js";import"../../../classification/index.js";import"../../../bpmn-workflow/index.js";import"../../../steps-wheel/index.js";import"../../../editor/index.js";import h from"../../../form-render/index.js";import"../../../fabric-chart/index.js";import"../../../shortcut-provider/index.js";import"../../../shortcut-setter/index.js";import"../../index.js";import"../../../iho-table/index.js";import"../../../keyboard/index.js";import"../../../search-cascader/index.js";import"../../../recommend-search/index.js";import"../../../date-picker/index.js";import"../../../time-picker/index.js";import"../../../config-provider/index.js";import"../../../picture-clipper/index.js";import"../../../table-export-field/index.js";import"../../../expand-field/index.js";import"../../../biunique-chat/index.js";import"../../../callback/index.js";import"../../../slider-tree/index.js";import"../../../body-select/index.js";import"axios";import"../../../card-reader-sdk/src/utils/index.js";import"../../../card-reader-sdk/src/cardReaderSDK.js";import"../../../table-filter/src/components/render-widget/helpers/presetValToTimestamp.js";import"../../../table-filter/src/components/render-widget/enums.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../audio-sdk/src/audioSDK.js";var b=e({__name:"FormConfigEdit",props:{uuid:{type:String,required:!0},bindFormRenderRef:{type:Object},formProps:{type:Object}},setup(e,{expose:b}){const g=e,k=i((()=>`#${g.uuid} .form-config__config`)),w=r(),y=o(j),F=r([]),R=r({}),{generateFieldListByFormConfigItem:C}=v(),P=r(!1);async function _(){var e;y.value=S,await u(),null==(e=w.value)||e.validate()}let S=null;function q({fieldKey:e,value:i}){y.value&&(y.value[e]=i)}return t(y,(async(e,i)=>{var r,o,t;if(!e)return F.value=[];if(i&&e!==S)try{await(null==(r=w.value)?void 0:r.validate())}catch(e){return P.value=!0}S=e,R.value={editable:!0,show:!0,...c(s(e))};const n=null==(o=g.bindFormRenderRef)?void 0:o.getFieldList();F.value=C(e,x(n,e.key)).map((e=>({...e,componentProps:{...e.componentProps,to:k.value}}))),null==(t=w.value)||t.reload()}),{immediate:!0}),b({validate(){var e;return null==(e=w.value)?void 0:e.validate()}}),(i,r)=>(n(),d(a,null,[l(m(h),p({size:"small"},e.formProps,{column:12,ref_key:"formRenderRef",ref:w,onFormChange:q,"field-list":F.value,"initial-data":R.value}),null,16,["field-list","initial-data"]),l(m(f),{show:P.value,"onUpdate:show":r[0]||(r[0]=e=>P.value=e),preset:"dialog",to:m(k),"close-on-esc":!1,"mask-closable":!1,closable:!1,title:"存在填写错误的字段","positive-text":"继续编辑",onPositiveClick:_},null,8,["show","to"])],64))}});export{b as default};
1
+ import{defineComponent as e,computed as o,ref as i,inject as t,watch as l,toRaw as a,openBlock as r,createElementBlock as n,Fragment as s,createVNode as u,unref as d,mergeProps as m,nextTick as v}from"vue";import{cloneDeep as f}from"lodash-es";import{InjectionActiveFieldItem as p}from"../constants/index.js";import"../../../../shared/components/VueDraggable/src/vuedraggable.js";import{findFieldItemByKey as c}from"../utils/index.js";import"@vicons/ionicons5";import{NModal as g}from"naive-ui";import"../../../../shared/utils/index.js";import{useConfigurationField as h}from"../hooks/useConfigurationField.js";import"../../../index.js";import y from"../../../form-render/index.js";var b=e({__name:"FormConfigEdit",props:{uuid:{type:String,required:!0},bindFormRenderRef:{type:Object},formProps:{type:Object}},setup(e,{expose:b}){const j=e,x=o((()=>`#${j.uuid} .form-config__config`)),F=i(),w=t(p),R=i([]),k=i({}),{generateFieldListByFormConfigItem:C}=h(),P=i(!1);async function _(){var e;w.value=L,await v(),null==(e=F.value)||e.validate()}let L=null;function O({fieldKey:e,value:o}){w.value&&(w.value[e]=o)}return l(w,(async(e,o)=>{var i,t,l;if(!e)return R.value=[];if(o&&e!==L)try{await(null==(i=F.value)?void 0:i.validate())}catch(e){return P.value=!0}L=e,k.value={editable:!0,show:!0,...f(a(e))};const r=null==(t=j.bindFormRenderRef)?void 0:t.getFieldList();R.value=C(e,c(r,e.key)).map((e=>({...e,componentProps:{...e.componentProps,to:x.value}}))),null==(l=F.value)||l.reload()}),{immediate:!0}),b({validate(){var e;return null==(e=F.value)?void 0:e.validate()}}),(o,i)=>(r(),n(s,null,[u(d(y),m({size:"small"},e.formProps,{column:12,ref_key:"formRenderRef",ref:F,onFormChange:O,"field-list":R.value,"initial-data":k.value}),null,16,["field-list","initial-data"]),u(d(g),{show:P.value,"onUpdate:show":i[0]||(i[0]=e=>P.value=e),preset:"dialog",to:d(x),"close-on-esc":!1,"mask-closable":!1,closable:!1,title:"存在填写错误的字段","positive-text":"继续编辑",onPositiveClick:_},null,8,["show","to"])],64))}});export{b as default};
@@ -106,7 +106,13 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
106
106
  default: () => {};
107
107
  };
108
108
  annotation: {
109
- type: import("vue").PropType<import("../../shared/types").AnyObject>;
109
+ type: import("vue").PropType<Record<string, import("../annotation-edit/src/type").AnnotationItem>>;
110
+ };
111
+ annotationShortcuts: {
112
+ type: import("vue").PropType<(string | {
113
+ label: string;
114
+ value: string;
115
+ })[] | undefined>;
110
116
  };
111
117
  consumer: {
112
118
  type: BooleanConstructor;
@@ -262,7 +268,13 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
262
268
  default: () => {};
263
269
  };
264
270
  annotation: {
265
- type: import("vue").PropType<import("../../shared/types").AnyObject>;
271
+ type: import("vue").PropType<Record<string, import("../annotation-edit/src/type").AnnotationItem>>;
272
+ };
273
+ annotationShortcuts: {
274
+ type: import("vue").PropType<(string | {
275
+ label: string;
276
+ value: string;
277
+ })[] | undefined>;
266
278
  };
267
279
  consumer: {
268
280
  type: BooleanConstructor;
@@ -456,7 +468,11 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
456
468
  }>;
457
469
  components: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>>;
458
470
  scope: import("../../shared/types").AnyObject;
459
- annotation: import("../../shared/types").AnyObject;
471
+ annotation: Record<string, import("../annotation-edit/src/type").AnnotationItem>;
472
+ annotationShortcuts: (string | {
473
+ label: string;
474
+ value: string;
475
+ })[] | undefined;
460
476
  consumer: boolean;
461
477
  uuid: string;
462
478
  lifeCycle: Partial<{
@@ -754,7 +770,13 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
754
770
  default: () => {};
755
771
  };
756
772
  annotation: {
757
- type: import("vue").PropType<import("../../shared/types").AnyObject>;
773
+ type: import("vue").PropType<Record<string, import("../annotation-edit/src/type").AnnotationItem>>;
774
+ };
775
+ annotationShortcuts: {
776
+ type: import("vue").PropType<(string | {
777
+ label: string;
778
+ value: string;
779
+ })[] | undefined>;
758
780
  };
759
781
  consumer: {
760
782
  type: BooleanConstructor;
@@ -1,6 +1,7 @@
1
1
  import { FormRequestDefine, useVersion } from '../../../shared/hooks';
2
2
  import { AnyObject, LowCodeTypes } from '../../../shared/types';
3
3
  import { Component, FunctionalComponent, PropType } from 'vue';
4
+ import { AnnotationItem } from '../../../components/annotation-edit/src/type';
4
5
  import { FieldItem, FieldVisitor, FormBusinessFormatter, FormRenderExpose } from './types';
5
6
  declare const _default: import("vue").DefineComponent<{
6
7
  fieldList: {
@@ -100,7 +101,13 @@ declare const _default: import("vue").DefineComponent<{
100
101
  default: () => {};
101
102
  };
102
103
  annotation: {
103
- type: PropType<AnyObject>;
104
+ type: PropType<Record<string, AnnotationItem>>;
105
+ };
106
+ annotationShortcuts: {
107
+ type: PropType<(string | {
108
+ label: string;
109
+ value: string;
110
+ })[] | undefined>;
104
111
  };
105
112
  consumer: {
106
113
  type: BooleanConstructor;
@@ -256,7 +263,13 @@ declare const _default: import("vue").DefineComponent<{
256
263
  default: () => {};
257
264
  };
258
265
  annotation: {
259
- type: PropType<AnyObject>;
266
+ type: PropType<Record<string, AnnotationItem>>;
267
+ };
268
+ annotationShortcuts: {
269
+ type: PropType<(string | {
270
+ label: string;
271
+ value: string;
272
+ })[] | undefined>;
260
273
  };
261
274
  consumer: {
262
275
  type: BooleanConstructor;
@@ -450,7 +463,11 @@ declare const _default: import("vue").DefineComponent<{
450
463
  }>;
451
464
  components: Record<string, Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | FunctionalComponent<{}, {}>>;
452
465
  scope: AnyObject;
453
- annotation: AnyObject;
466
+ annotation: Record<string, AnnotationItem>;
467
+ annotationShortcuts: (string | {
468
+ label: string;
469
+ value: string;
470
+ })[] | undefined;
454
471
  consumer: boolean;
455
472
  uuid: string;
456
473
  lifeCycle: Partial<{
@@ -748,7 +765,13 @@ declare const _default: import("vue").DefineComponent<{
748
765
  default: () => {};
749
766
  };
750
767
  annotation: {
751
- type: PropType<AnyObject>;
768
+ type: PropType<Record<string, AnnotationItem>>;
769
+ };
770
+ annotationShortcuts: {
771
+ type: PropType<(string | {
772
+ label: string;
773
+ value: string;
774
+ })[] | undefined>;
752
775
  };
753
776
  consumer: {
754
777
  type: BooleanConstructor;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,openBlock as i,createBlock as l,unref as n,mergeProps as m,withCtx as d,createElementBlock as p,createVNode as u,isRef as c,Fragment as f,renderList as h,createCommentVNode as y,createElementVNode as g,normalizeStyle as j,withKeys as v,toDisplayString as b,renderSlot as k}from"vue";import{useTheme as F}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as C,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 H,NTabPane as O,NConfigProvider as A}from"naive-ui";import{useVersion as R}from"../../../shared/hooks/useVersion.js";import{createForm as B,onFormMount as L,onFieldValueChange as w,onFieldMount as I,onFieldUnmount as V,onFieldReact as _}from"@formily/core";import{Path as D}from"@formily/path";import{FormProvider as N,FormConsumer as q}from"@formily/vue";import{InjectionFormLifeCycleCaller as T,InjectionFormGraph as U}from"./constants/index.js";import{createObjSchema as W}from"./utils/schema.js";import{useAnchor as E}from"./hooks/useAnchor.js";import{useAutoHidden as G}from"./hooks/useAutoHidden.js";import"../index.js";import{useComplexOptionsSpan as K}from"./hooks/useComplexOptions.js";import{useFieldListAdaptor as M}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/Hook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import{useFieldVisitor as J}from"./hooks/useFieldVisitor.js";import{useFormContext as P}from"./hooks/useFormContext.js";import{useFormDomEvent as $,useFormExposeEvent as z}from"./hooks/useFormEvent.js";import{useFormGraph as Q}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as X}from"./hooks/useFormRenderLifeCycle.js";import{validateMessageLocale as Y}from"./hooks/useFormValidator.js";import{useLowCodeEvent as Z}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as ee}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as oe}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as te}from"./hooks/useOperationalForm.js";import{useWordbookSetting as re}from"./hooks/useWordbookSetting.js";const se={key:0,style:{height:"54px"}},ae={style:{"white-space":"pre"}};var ie=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},operationalForm:{type:Array},dateOperationalForm:{type:Object},operationalFormInit:{type:Boolean,default:!0},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},outBordered:{type:Boolean,default:!1},uniqueCacheData:{type:Boolean,default:!1},forceClearable:Boolean},emits:["formChange","annotationChange","scroll"],setup(e,{expose:ie,emit:le}){const ne=e,me=F(),{nuiThemeOverrides:de}=oe();Y();const pe=o(),ue=t((()=>C(ne.maxHeight)?ne.maxHeight+"px":ne.maxHeight)),{SchemaField:ce,businessCollector:fe,formItemDepsCollector:he,changeContextCollector:ye,formUUID:ge}=P(ne,le),{anchorBarRef:je,currentAnchor:ve,updateAnchorList:be,anchorIdList:ke,onScroll:Fe}=E(ne,le,pe,he),{callLifeCycle:Ce}=X(ne);r(T,Ce),Ce("onSetup");const{trigger:Se}=G(),{observeFormGraph:xe,setGraph:He,removeGraph:Oe}=Q();r(U,xe);const{lowCodeEventTrigger:Ae}=Z(),Re=B({initialValues:ne.initialData,effects(e){const o={};L((()=>{Object.assign(o,S(e.values))})),w("*",(t=>{const r=D.getIn(o,t.path);D.setIn(o,t.path,t.value);const s=t.props.name.toString();fe.trigger(e,s),he.trigger(t.path),le("formChange",{fieldInstance:t,fieldKey:s,oldValue:r,fieldName:t.title,value:t.value,context:ye.getContext(s,t.value)}),Ae(t),Be(s),we.trigger(s),Ie.trigger(s,t.value)})),I("*",He),V("*",Oe),ne.linebarAutoHidden&&(_("*",Se),L((e=>e.query("*").forEach(Se)))),ne.anchor&&_("*",be)}}),{lowCodeReactionsHandler:Be,triggerAllReactionsHandler:Le}=ee(t((()=>ne.lowCodeReactions)),Re),we=te(ne,Re),Ie=re().create(Re,ye);s(Le),s((()=>ne.operationalFormInit&&we.triggerAll()));const{schemaAdaptor:Ve}=M(fe,ne.lifeCycle);let _e=ne.fieldList||[];const De=t((()=>ne.schema?ne.schema:ne.fieldList?(_e=J().traverse(S(ne.fieldList),ne.fieldVisitor),W(Ve(_e,ne))):W({}))),{onKeydown:Ne}=$({formModel:Re,formRenderRef:pe,props:ne}),{clearSpan:qe}=K();a((()=>qe(ge)));const Te=z({formModel:Re,formRenderRef:pe,formItemDepsCollector:he,businessCollector:fe,wordbookSettingHandler:Ie,operationalFormHandler:we,getFieldList:()=>_e,formUUID:ge});return ie({formModel:Re,validate:(e="*",o={})=>Te.validate(e,o),getFormValues:(e=!0)=>Te.getFormValues(e),setFormValues:async(e,o={})=>Te.setFormValues(e,o),setFieldState(e,o){Te.setFieldState(e,o)},resetFields(e="*"){Te.resetFields(e)},queryWidget:async e=>Te.queryWidget(e),getFieldList:()=>_e,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(i(),l(n(x),m({class:["form-render",{"form-render--out-border":e.outBordered}],"require-mark-placement":"left",style:n(me)},n(R)()),{default:d((()=>[e.anchor?(i(),p("section",se,[u(n(H),{value:n(ve),"onUpdate:value":t[0]||(t[0]=e=>c(ve)?ve.value=e:null),type:"line",ref_key:"anchorBarRef",ref:je},{default:d((()=>[(i(!0),p(f,null,h(n(ke),(e=>(i(),l(n(O),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):y("v-if",!0),u(n(A),{"theme-overrides":n(de)},{default:d((()=>[g("section",{class:"form-render__wrapper",style:j({"--column":e.column,"--form-height":n(ue)}),ref_key:"formRenderRef",ref:pe,onScroll:t[1]||(t[1]=(...e)=>n(Fe)&&n(Fe)(...e)),onKeydownCapture:t[2]||(t[2]=v(((...e)=>n(Ne)&&n(Ne)(...e)),["enter"]))},[u(n(N),{form:n(Re)},{default:d((()=>[u(n(ce),{schema:n(De)},null,8,["schema"]),e.consumer?(i(),l(n(q),{key:0},{default:d((({form:e})=>[g("div",ae,b(JSON.stringify(e.values,null,2)),1)])),_:1})):y("v-if",!0),k(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},16,["class","style"]))}});export{ie as default};
1
+ import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,openBlock as i,createBlock as l,unref as n,mergeProps as m,withCtx as p,createElementBlock as d,createVNode as u,isRef as c,Fragment as f,renderList as h,createCommentVNode as y,createElementVNode as g,normalizeStyle as j,withKeys as b,toDisplayString as k,renderSlot as v}from"vue";import{useTheme as F}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as C,cloneDeep as 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 H,NTabs as A,NTabPane as x,NConfigProvider as B}from"naive-ui";import{useVersion as O}from"../../../shared/hooks/useVersion.js";import{createForm as L,onFormMount as R,onFieldValueChange as w,onFieldMount as I,onFieldUnmount as V,onFieldReact as _}from"@formily/core";import{Path as D}from"@formily/path";import{FormProvider as N,FormConsumer as q}from"@formily/vue";import{InjectionFormLifeCycleCaller as W,InjectionFormGraph as T}from"./constants/index.js";import{createObjSchema as U}from"./utils/schema.js";import{useAnchor as E}from"./hooks/useAnchor.js";import{useAutoHidden as G}from"./hooks/useAutoHidden.js";import"../index.js";import{useComplexOptionsSpan as K}from"./hooks/useComplexOptions.js";import{useFieldListAdaptor as M}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{useFieldVisitor as P}from"./hooks/useFieldVisitor.js";import{useFormContext as J}from"./hooks/useFormContext.js";import{useFormDomEvent as $,useFormExposeEvent as z}from"./hooks/useFormEvent.js";import{useFormGraph as Q}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as X}from"./hooks/useFormRenderLifeCycle.js";import{validateMessageLocale as Y}from"./hooks/useFormValidator.js";import{useLowCodeEvent as Z}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as ee}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as oe}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as te}from"./hooks/useOperationalForm.js";import{useWordbookSetting as re}from"./hooks/useWordbookSetting.js";const se={key:0,style:{height:"54px"}},ae={style:{"white-space":"pre"}};var ie=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},annotationShortcuts:{type:Array},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},operationalForm:{type:Array},dateOperationalForm:{type:Object},operationalFormInit:{type:Boolean,default:!0},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},outBordered:{type:Boolean,default:!1},uniqueCacheData:{type:Boolean,default:!1},forceClearable:Boolean},emits:["formChange","annotationChange","scroll"],setup(e,{expose:ie,emit:le}){const ne=e,me=F(),{nuiThemeOverrides:pe}=oe();Y();const de=o(),ue=t((()=>C(ne.maxHeight)?ne.maxHeight+"px":ne.maxHeight)),{SchemaField:ce,businessCollector:fe,formItemDepsCollector:he,changeContextCollector:ye,formUUID:ge}=J(ne,le),{anchorBarRef:je,currentAnchor:be,updateAnchorList:ke,anchorIdList:ve,onScroll:Fe}=E(ne,le,de,he),{callLifeCycle:Ce}=X(ne);r(W,Ce),Ce("onSetup");const{trigger:Se}=G(),{observeFormGraph:He,setGraph:Ae,removeGraph:xe}=Q();r(T,He);const{lowCodeEventTrigger:Be}=Z(),Oe=L({initialValues:ne.initialData,effects(e){const o={};R((()=>{Object.assign(o,S(e.values))})),w("*",(t=>{const r=D.getIn(o,t.path);D.setIn(o,t.path,t.value);const s=t.props.name.toString();fe.trigger(e,s),he.trigger(t.path),le("formChange",{fieldInstance:t,fieldKey:s,oldValue:r,fieldName:t.title,value:t.value,context:ye.getContext(s,t.value)}),Be(t),Le(s),we.trigger(s),Ie.trigger(s,t.value)})),I("*",Ae),V("*",xe),ne.linebarAutoHidden&&(_("*",Se),R((e=>e.query("*").forEach(Se)))),ne.anchor&&_("*",ke)}}),{lowCodeReactionsHandler:Le,triggerAllReactionsHandler:Re}=ee(t((()=>ne.lowCodeReactions)),Oe),we=te(ne,Oe),Ie=re().create(Oe,ye);s(Re),s((()=>ne.operationalFormInit&&we.triggerAll()));const{schemaAdaptor:Ve}=M(fe,ne.lifeCycle);let _e=ne.fieldList||[];const De=t((()=>ne.schema?ne.schema:ne.fieldList?(_e=P().traverse(S(ne.fieldList),ne.fieldVisitor),U(Ve(_e,ne))):U({}))),{onKeydown:Ne}=$({formModel:Oe,formRenderRef:de,props:ne}),{clearSpan:qe}=K();a((()=>qe(ge)));const We=z({formModel:Oe,formRenderRef:de,formItemDepsCollector:he,businessCollector:fe,wordbookSettingHandler:Ie,operationalFormHandler:we,getFieldList:()=>_e,formUUID:ge});return ie({formModel:Oe,validate:(e="*",o={})=>We.validate(e,o),getFormValues:(e=!0)=>We.getFormValues(e),setFormValues:async(e,o={})=>We.setFormValues(e,o),setFieldState(e,o){We.setFieldState(e,o)},resetFields(e="*"){We.resetFields(e)},queryWidget:async e=>We.queryWidget(e),getFieldList:()=>_e,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(i(),l(n(H),m({class:["form-render",{"form-render--out-border":e.outBordered}],"require-mark-placement":"left",style:n(me)},n(O)()),{default:p((()=>[e.anchor?(i(),d("section",se,[u(n(A),{value:n(be),"onUpdate:value":t[0]||(t[0]=e=>c(be)?be.value=e:null),type:"line",ref_key:"anchorBarRef",ref:je},{default:p((()=>[(i(!0),d(f,null,h(n(ve),(e=>(i(),l(n(x),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):y("v-if",!0),u(n(B),{"theme-overrides":n(pe)},{default:p((()=>[g("section",{class:"form-render__wrapper",style:j({"--column":e.column,"--form-height":n(ue)}),ref_key:"formRenderRef",ref:de,onScroll:t[1]||(t[1]=(...e)=>n(Fe)&&n(Fe)(...e)),onKeydownCapture:t[2]||(t[2]=b(((...e)=>n(Ne)&&n(Ne)(...e)),["enter"]))},[u(n(N),{form:n(Oe)},{default:p((()=>[u(n(ce),{schema:n(De)},null,8,["schema"]),e.consumer?(i(),l(n(q),{key:0},{default:p((({form:e})=>[g("div",ae,k(JSON.stringify(e.values,null,2)),1)])),_:1})):y("v-if",!0),v(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},16,["class","style"]))}});export{ie as default};
@@ -104,7 +104,13 @@ declare const _default: import("vue").DefineComponent<{}, {
104
104
  default: () => {};
105
105
  };
106
106
  annotation: {
107
- type: import("vue").PropType<import("../../../shared/types").AnyObject>;
107
+ type: import("vue").PropType<Record<string, import("../../annotation-edit/src/type").AnnotationItem>>;
108
+ };
109
+ annotationShortcuts: {
110
+ type: import("vue").PropType<(string | {
111
+ label: string;
112
+ value: string;
113
+ })[] | undefined>;
108
114
  };
109
115
  consumer: {
110
116
  type: BooleanConstructor;
@@ -260,7 +266,13 @@ declare const _default: import("vue").DefineComponent<{}, {
260
266
  default: () => {};
261
267
  };
262
268
  annotation: {
263
- type: import("vue").PropType<import("../../../shared/types").AnyObject>;
269
+ type: import("vue").PropType<Record<string, import("../../annotation-edit/src/type").AnnotationItem>>;
270
+ };
271
+ annotationShortcuts: {
272
+ type: import("vue").PropType<(string | {
273
+ label: string;
274
+ value: string;
275
+ })[] | undefined>;
264
276
  };
265
277
  consumer: {
266
278
  type: BooleanConstructor;
@@ -454,7 +466,11 @@ declare const _default: import("vue").DefineComponent<{}, {
454
466
  }>;
455
467
  components: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>>;
456
468
  scope: import("../../../shared/types").AnyObject;
457
- annotation: import("../../../shared/types").AnyObject;
469
+ annotation: Record<string, import("../../annotation-edit/src/type").AnnotationItem>;
470
+ annotationShortcuts: (string | {
471
+ label: string;
472
+ value: string;
473
+ })[] | undefined;
458
474
  consumer: boolean;
459
475
  uuid: string;
460
476
  lifeCycle: Partial<{
@@ -752,7 +768,13 @@ declare const _default: import("vue").DefineComponent<{}, {
752
768
  default: () => {};
753
769
  };
754
770
  annotation: {
755
- type: import("vue").PropType<import("../../../shared/types").AnyObject>;
771
+ type: import("vue").PropType<Record<string, import("../../annotation-edit/src/type").AnnotationItem>>;
772
+ };
773
+ annotationShortcuts: {
774
+ type: import("vue").PropType<(string | {
775
+ label: string;
776
+ value: string;
777
+ })[] | undefined>;
756
778
  };
757
779
  consumer: {
758
780
  type: BooleanConstructor;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as r,computed as l,ref as o,onUnmounted as t,createVNode as n,mergeProps as i}from"vue";import{arrayed as a,widthAppend as s}from"../../../../../shared/utils/index.js";import{isVoidField as m}from"@formily/core";import{observe as u,autorun as d}from"@formily/reactive";import{connect as f,mapProps as p}from"@formily/vue";import{useDebounceFn as v}from"@vueuse/core";import{isString as c,isArray as b,isFunction as y}from"lodash-es";import{NFormItem as _}from"naive-ui";import g from"../../../../annotation-edit/index.js";import"../../../index.js";import x from"../tooltipMessage.vue.js";import{InjectionFormUUID as I,InjectionFormGraph as j,InjectionAnnotation as h,InjectionFormGlobalProps as k}from"../../constants/index.js";import{useComplexOptionsSpan as F}from"../../hooks/useComplexOptions.js";import{validateMessageParser as R}from"../../utils/index.js";import{dotEscape as L}from"../../utils/schema.js";import{useFormField as q}from"../../hooks/useFormField.js";const K=f(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},fieldItem:{type:Object}},setup(e,{slots:a}){const{field:f,fieldKey:p,fieldAddress:c}=q(),R=r(I),K=l((()=>L(`${R}-${c.value}`))),S=o(!1);if(m(f.value)&&b(e.suffixFields)){const l=r(j);t(u(l,v((()=>{m(f.value)&&b(e.suffixFields)&&(S.value=e.suffixFields.some((e=>{const r=f.value.form.query(e).take();return r&&Reflect.get(r,"required")})))}),100)))}else t(d((()=>{S.value=Reflect.get(f.value,"required")})));const A=r(h),E=l({get(){var r,l;return null!=(l=null==(r=A.value)?void 0:r[e.propertyKey])?l:""},set(r){A.value={property:e.propertyKey,value:r}}});const M=l((()=>A.value&&!1!==e.annotation)),O=l((()=>e.label&&" "!==e.label)),V=l((()=>{let r=0;return M.value&&(r+=18),e.remark&&(r+=18),r})),$=r(k,{}),w=l((()=>{var r;const l=null==(r=e.fieldItem)?void 0:r.bordered;return null==l?$.bordered:l}));function C(){return O.value?n("section",{class:"form-render__formItemLabel"},[n("span",{class:"form-render__formItemLabel--text",style:{marginRight:s(V.value)}},[y(e.labelRender)?e.labelRender(e.label):e.label]),V.value?n("section",{class:"form-render__formItemLabel--operation"},[e.remark?n("div",{class:"form-render__formItemLabel--tooltip"},[n(x,{message:e.remark},null)]):null,M.value?n(g,{class:"form-render__formItemLabel--annotation",modelValue:E.value,"onUpdate:modelValue":e=>E.value=e},null):null]):null]):null}const{getSpan:N}=F();return()=>{return n(_,i({class:["form-render__formItem",{"form-render--no-border":!w.value,"form-render--underline":"underline"===w.value}],style:{"--form-item-column":"inner"===(null==(r=e.fieldItem)?void 0:r.childWidthMode)?e.span:N(R,f.value.address,!1)+e.span}},{id:K.value,uuid:R,"widget-type":f.value.componentType,"field-key":L(p.value),"field-address":L(c.value),required:S.value}),{...a,label:C});var r}}}),p({title:"label"},((e,r)=>{const l=m(r)?void 0:a(r.selfErrors).length?function(e,r){if(!c(r.defined_error_msg)||!r.defined_error_msg)return e.map((e=>R(e,r))).join(",");return R(r.defined_error_msg,r)}(a(r.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:l,"validation-status":l?"error":void 0}})));export{K as FORM_ITEM};
1
+ import{defineComponent as e,inject as r,computed as l,ref as o,onUnmounted as t,createVNode as n,mergeProps as i,unref as a}from"vue";import{arrayed as s,widthAppend as m}from"../../../../../shared/utils/index.js";import{isVoidField as u}from"@formily/core";import{observe as d,autorun as f}from"@formily/reactive";import{connect as p,mapProps as v}from"@formily/vue";import{useDebounceFn as c}from"@vueuse/core";import{isString as b,isArray as y,isFunction as _}from"lodash-es";import{NFormItem as g}from"naive-ui";import x from"../../../../annotation-edit/index.js";import"../../../index.js";import I from"../tooltipMessage.vue.js";import{InjectionFormUUID as j,InjectionFormGraph as h,InjectionAnnotation as k,InjectionAnnotationShortcuts as F,InjectionFormGlobalProps as R}from"../../constants/index.js";import{useComplexOptionsSpan as L}from"../../hooks/useComplexOptions.js";import{validateMessageParser as q}from"../../utils/index.js";import{dotEscape as K}from"../../utils/schema.js";import{useFormField as S}from"../../hooks/useFormField.js";const A=p(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:s}){const{field:p,fieldKey:v,fieldAddress:b}=S(),q=r(j),A=l((()=>K(`${q}-${b.value}`))),E=o(!1);if(u(p.value)&&y(e.suffixFields)){const l=r(h);t(d(l,c((()=>{u(p.value)&&y(e.suffixFields)&&(E.value=e.suffixFields.some((e=>{const r=p.value.form.query(e).take();return r&&Reflect.get(r,"required")})))}),100)))}else t(f((()=>{E.value=Reflect.get(p.value,"required")})));const M=r(k),O=l({get(){var r,l;return null!=(l=null==(r=M.value)?void 0:r[e.propertyKey])?l:""},set(r){M.value={property:e.propertyKey,value:r}}}),V=r(F);const $=l((()=>M.value&&!1!==e.annotation)),w=l((()=>e.label&&" "!==e.label)),C=l((()=>{let r=0;return $.value&&(r+=18),e.remark&&(r+=18),r})),N=r(R,{}),T=l((()=>{var r;const l=null==(r=e.fieldItem)?void 0:r.bordered;return null==l?N.bordered:l}));function U(){return w.value?n("section",{class:"form-render__formItemLabel"},[n("span",{class:"form-render__formItemLabel--text",style:{marginRight:m(C.value)}},[_(e.labelRender)?e.labelRender(e.label):e.label]),C.value?n("section",{class:"form-render__formItemLabel--operation"},[e.remark?n("div",{class:"form-render__formItemLabel--tooltip"},[n(I,{message:e.remark},null)]):null,$.value?n(x,{class:"form-render__formItemLabel--annotation",modelValue:O.value,"onUpdate:modelValue":e=>O.value=e,shortcuts:a(V)},null):null]):null]):null}const{getSpan:W}=L();return()=>{return n(g,i({class:["form-render__formItem",{"form-render--no-border":!T.value,"form-render--underline":"underline"===T.value}],style:{"--form-item-column":"inner"===(null==(r=e.fieldItem)?void 0:r.childWidthMode)?e.span:W(q,p.value.address,!1)+e.span}},{id:A.value,uuid:q,"widget-type":p.value.componentType,"field-key":K(v.value),"field-address":K(b.value),required:E.value}),{...s,label:U});var r}}}),v({title:"label"},((e,r)=>{const l=u(r)?void 0:s(r.selfErrors).length?function(e,r){if(!b(r.defined_error_msg)||!r.defined_error_msg)return e.map((e=>q(e,r))).join(",");return q(r.defined_error_msg,r)}(s(r.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:l,"validation-status":l?"error":void 0}})));export{A as FORM_ITEM};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as n,nextTick as o}from"vue";import{connect as u,mapProps as i}from"@formily/vue";import{isEqual as s,isArray as c,isString as p}from"lodash-es";import{NCascader as d}from"naive-ui";import"../../../index.js";import{useCommonInjection as v}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as m,InjectionFormUUID as f}from"../../constants/index.js";import"@formily/path";import"@vueuse/core";import"../../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"date-fns";import{assignUpdateValue as h,createVisitedSetter as y,traverseDependKey as g}from"../../utils/schema.js";import"@formily/reactive";import"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"@vueuse/shared";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import"./index.js";import{useFormField as k}from"../../hooks/useFormField.js";import"../../hooks/useFormValidator.js";const j=u(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},checkStrategy:{type:String,default:"child"},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:u,emit:i}){const h=t(),{field:j,title:C}=k(),b=t(1),w=t(!0);const F=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),S=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"})),x=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[S.value])).slice(-1).join(""),l=t.map((e=>e[F.value])).join(" / ");return a||l}catch(e){return null}}));function A(e,t,a){i("update:value",c(a)?a.map((function(e){return{...e,label:e[F.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const q=l(m);async function V(t){e.filterable?await async function(){if(!e.urlConfig||h.value&&e.requestCache)return;const t=await q.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:C.value,cache:e.requestCache,payload:{field:j.value,labelKey:F.value,valueKey:S.value}});function a(e,t,r){const n=[...r,...l(e)],o={[F.value]:e[F.value],[S.value]:e[S.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:n};return c(e.children)&&(o.children=e.children.map((e=>a(e,t+1,n))),o.isLeaf=!e.children.length),b.value=Math.max(b.value,t+1),o}function l(e){let t=[];if(p(e[F.value])&&(t=[...t,e[F.value]]),p(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}h.value=t.map((e=>a(e,0,[])))}():await async function(t){if(r(e,t))return;const a=await q.addAsync(n(s(t),i(e),C.value,t));if(!a.length&&t)return t.isLeaf=!0,A(0,0,o(t)),void(O.value=!1);const l=a.map((e=>u(e,s(t))));function r(e,t){return!i(e)||!t&&h.value&&e.requestCache||s(t)>=s(e)-1}function n(t,a,l,r){const n={lvlnr:t+1+""};return r&&a.dependKey&&g(a.dependKey,((e,t)=>{n[t]=r[e]})),{params:n,...a,key:l,cache:e.requestCache}}function o(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function u(a,l){return{[F.value]:a[F.value],[S.value]:a[S.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:h.value=l}(t),await H()}const K=`form-render__cascade--menu-${l(f)}`;async function H(){await o();const e=document.querySelector(`.${K} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function L(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;return!(e.checkStrategy.includes("child")&&a.depth<b.value)&&(l.length>0&&l.some((e=>e.includes(t.trim()))))}const{injectValueValidate:B,injectValueWatchFromEmpty:I,injectValueBindKey:E}=v();I((()=>e.value),V),B((()=>e.value)),r((()=>e.urlConfig),(async(t,a)=>{s(t,a)||(h.value=null,w.value?e.lazyRequest||(V(),w.value=!w.value):await V())}),{immediate:!0});const O=t(!1);function z(e){O.value=!!e,e&&V()}const N=a((()=>h.value||e.options||[])),R=a((()=>!e.filterable)),U=E(x);return()=>n(d,{key:U.value,remote:R.value,filterable:e.filterable,"menu-props":{class:K,onClick:H},"check-strategy":e.checkStrategy,show:!!O.value,"onUpdate:show":z,value:x.value,filter:L,"onUpdate:value":A,labelField:F.value,valueField:S.value,options:N.value,onLoad:V,onFocus:y(j)},u)}}),i({dataSource:"options"},h));export{j as SEARCH_CASCADER};
1
+ import{defineComponent as e,ref as t,computed as a,inject as l,watch as o,createVNode as r,nextTick as n}from"vue";import{connect as u,mapProps as i}from"@formily/vue";import{isEqual as s,isArray as c,isString as p}from"lodash-es";import{NCascader as d}from"naive-ui";import"../../../index.js";import{useCommonInjection as m}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as v,InjectionFormUUID as f}from"../../constants/index.js";import"@formily/path";import"@vueuse/core";import"../../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"date-fns";import{assignUpdateValue as y,createVisitedSetter as h,traverseDependKey as k}from"../../utils/schema.js";import"@formily/reactive";import"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"@vueuse/shared";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import"./index.js";import{useFormField as j}from"../../hooks/useFormField.js";import"../../hooks/useFormValidator.js";const g=u(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},checkStrategy:{type:String,default:"child"},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:u,emit:i}){const y=t(),{field:g,title:b}=j(),C=t(1),S=t(!0);const w=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),F=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"})),A=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");if(!Array.isArray(t)||!t.length)return null;const a=t.map((e=>e[F.value])).slice(-1).join(""),l=t.map((e=>e[w.value])).join(" / ");return a||l}catch(e){return null}}));function H(e,t,a){i("update:value",c(a)?a.map((function(e){return{...e,label:e[w.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const x=l(v);async function q(t){e.filterable?await async function(){if(!e.urlConfig||y.value&&e.requestCache)return;const t=await x.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:b.value,cache:e.requestCache,payload:{field:g.value,labelKey:w.value,valueKey:F.value}});function a(e,t,o){const r=[...o,...l(e)],n={[w.value]:e[w.value],[F.value]:e[F.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:r};return c(e.children)&&(n.children=e.children.map((e=>a(e,t+1,r))),n.isLeaf=!e.children.length),C.value=Math.max(C.value,t+1),n}function l(e){let t=[];if(p(e[w.value])&&(t=[...t,e[w.value]]),p(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}y.value=t.map((e=>a(e,0,[])))}():await async function(t){if(o(e,t))return;const a=await x.addAsync(r(s(t),i(e),b.value,t));if(!a.length&&t)return t.isLeaf=!0,H(0,0,n(t)),void(O.value=!1);const l=a.map((e=>u(e,s(t))));function o(e,t){return!i(e)||!t&&y.value&&e.requestCache||s(t)>=s(e)-1}function r(t,a,l,o){const r={lvlnr:t+1+""};return o&&a.dependKey&&k(a.dependKey,((e,t)=>{r[t]=o[e]})),{params:r,...a,key:l,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function u(a,l){return{[w.value]:a[w.value],[F.value]:a[F.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function i(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:y.value=l}(t),await B()}const V=`form-render__cascade--menu-${l(f)}`;async function B(){await n();const e=document.querySelector(`.${V} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function K(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;return!(e.checkStrategy.includes("child")&&a.depth<C.value)&&(l.length>0&&l.some((e=>e.includes(t.trim()))))}const{injectValueValidate:L,injectValueWatchFromEmpty:I,injectValueBindKey:E}=m();I((()=>e.value),q),L((()=>e.value)),o((()=>e.urlConfig),(async(t,a)=>{s(t,a)||(y.value=null,S.value?e.lazyRequest||(q(),S.value=!S.value):await q())}),{immediate:!0});const O=t(!1);function W(e){O.value=!!e,e&&q()}const z=a((()=>y.value||e.options||[])),N=a((()=>!e.filterable)),P=E(A);return()=>r(d,{key:P.value,remote:N.value,filterable:e.filterable,"menu-props":{class:V,onClick:B},"check-strategy":e.checkStrategy,show:!!O.value,"onUpdate:show":W,value:A.value,filter:K,"onUpdate:value":H,labelField:w.value,valueField:F.value,options:z.value,onLoad:q,onFocus:h(g)},u)}}),i({dataSource:"options"},y));export{g as SEARCH_CASCADER};
@@ -1 +1 @@
1
- import{defineComponent as e,computed as o,inject as t,useAttrs as l,ref as a,createVNode as r,mergeProps as n,toRaw as s}from"vue";import{arrayed as u}from"../../../../../shared/utils/index.js";import{cloneDeep as i,isArray as m,isObject as p,omit as d,xor as c}from"lodash-es";import{NSelect as f}from"naive-ui";import"@vueuse/core";import"date-fns";import"@vue/shared";import{useSelectAllowModify as v}from"../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as y}from"../../../../../shared/hooks/selectHooks/useSelectRenders.js";import{connect as h,mapProps as b}from"@formily/vue";import{useCommonInjection as j,useSelectOptionProps as g}from"../../hooks/useCommonInjection.js";import{useComplexOptions as C,useComplexOptionsSpan as S}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as k,InjectionFormUUID as F}from"../../constants/index.js";import"@formily/path";import"@formily/core";import"@vicons/ionicons5";import{assignUpdateValue as B,assignClearBindVisited as w,createVisitedSetter as O}from"../../utils/schema.js";import"@formily/reactive";import"../../../index.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"./index.js";import"@vueuse/shared";import{useFormField as K}from"../../hooks/useFormField.js";import{useUrlConfigOptions as R,useAutographOptions as A,useRecommendOptions as x}from"../../hooks/useFormRenderOptions.js";import"../../hooks/useFormValidator.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,showCustomValue:Boolean,cursorPlacement:{type:String,default:"end"},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean},searchByValue:{type:Boolean}},emits:["update:value","postRecommend"],setup(e,{slots:h,emit:b}){const B=o({get:()=>e.value,async set(e){b("update:value",e),D(e)}}),{labelKey:w,valueKey:V,showKey:H,fetchData:L,searchContent:P,fullOptions:_,filterOptions:N,remoteOptions:I,loading:q}=e.urlConfig?R(e,B):A(e,B),{modifyEvent:E,modifyAbleRef:W,getOptionsWithCreated:z}=v(e,{searchContent:P,labelKey:w,valueKey:V,valueRef:B,fullOptions:_}),{renderComplexOption:M,hasComplexOption:T}=C(e,B),{getRecommend:U,postRecommend:D,sortedOptions:G}=x(e,N,b,w,V),{field:J,fieldKey:Q}=K();t(k).setContext(Q.value,(e=>({currentOption:i(function(e){const o=z(_.value);return m(e)?function(e){const t=o.reduce(((e,o)=>(e[o[V.value]]=o,e)),{});return e.map((e=>t[e]))}(e):(t=e,o.find((e=>e[V.value]===t)));var t}(e))})));const X=async e=>(P.value=e,Promise.allSettled([L(e),U(e)])),{injectValueValidate:Y,injectValueWatchFromEmpty:Z,injectValueBindKey:$}=j();Z(B,(()=>e.lazyRequest&&X())),Y(B);const ee=$(B),{menuProps:oe,nodeProps:te}=g(),{renderTag:le,renderLabel:ae,renderSelectAll:re,titleRef:ne}=y(e,{labelKey:w,valueKey:V,valueRef:B,showKey:H,searchContent:P}),se=o((()=>z(W.value?_.value:G.value))),ue=l(),ie=o((()=>{if(e.allowCreate||e.showCustomValue)return B.value;const o=e.multiple&&m(B.value);return _.value.find((e=>o?B.value.includes(e[V.value]):e[V.value]===B.value))?B.value:null})),me=a(!1);async function pe(e){e&&await X(),me.value=e}async function de(e,o){await E.updateValue(e,o),I.value&&o&&u(o).forEach((e=>{if(!p(e))return;const o=e;o.created&&o.shouldSave&&I.value.push(d(s(o),["created","shouldSave"]))}))}const ce=t(F),{getSpan:fe}=S(),ve=O(J,E.focus);function ye(o){if(!e.multiple)return;const t=o?se.value.map((e=>e[V.value])):[];c(t,e.value).length&&(B.value=t)}function he(o){let t=h;return e.multiple&&e.selectAll&&(t={action:()=>re(ye),...h}),r(f,n({title:ne.value,key:ee.value,multiple:e.multiple,remote:!0,filterable:!0,loading:q.value,value:ie.value,onUpdateValue:de,"menu-props":oe,"node-props":te,labelField:w.value,valueField:V.value,options:se.value,onSearch:X,show:me.value,"onUpdate:show":pe,onFocus:ve,onBlur:E.blur,renderLabel:ae,renderTag:le},o,ue),t)}return()=>{var e,o;if(!T.value)return he();const t=null!=(o=null==(e=J.value.decoratorProps)?void 0:e.span)?o:6,l=fe(ce,J.value.address);return r("section",{class:"form-render__selectChildField",style:{"--column":l+t}},[he({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),_.value.map((e=>M({option:e,value:B.value,valueKey:V.value,labelKey:w.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":l}}})))])}}}),b({dataSource:"options"},B,w));export{V as SELECT};
1
+ import{defineComponent as e,computed as o,inject as t,useAttrs as l,ref as a,createVNode as r,mergeProps as s,toRaw as n}from"vue";import{arrayed as u}from"../../../../../shared/utils/index.js";import{cloneDeep as i,isArray as p,isObject as m,omit as d,xor as c}from"lodash-es";import{NSelect as y}from"naive-ui";import"@vueuse/core";import"date-fns";import"@vue/shared";import{useSelectAllowModify as f}from"../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as v}from"../../../../../shared/hooks/selectHooks/useSelectRenders.js";import{connect as h,mapProps as b}from"@formily/vue";import{useCommonInjection as j,useSelectOptionProps as S}from"../../hooks/useCommonInjection.js";import{useComplexOptions as k,useComplexOptionsSpan as g}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as C,InjectionFormUUID as B}from"../../constants/index.js";import"@formily/path";import"@formily/core";import"@vicons/ionicons5";import{assignUpdateValue as F,assignClearBindVisited as A,createVisitedSetter as w}from"../../utils/schema.js";import"@formily/reactive";import"../../../index.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"./index.js";import"@vueuse/shared";import{useFormField as H}from"../../hooks/useFormField.js";import{useUrlConfigOptions as O,useAutographOptions as K,useRecommendOptions as R}from"../../hooks/useFormRenderOptions.js";import"../../hooks/useFormValidator.js";const x=h(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},showField:{type:String},allowCreate:Boolean,shouldSave:Boolean,allowModify:Boolean,showCustomValue:Boolean,cursorPlacement:{type:String,default:"end"},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean},searchByValue:{type:Boolean}},emits:["update:value","postRecommend"],setup(e,{slots:h,emit:b}){const F=o({get:()=>e.value,async set(e){b("update:value",e),D(e)}}),{labelKey:A,valueKey:x,showKey:V,fetchData:L,searchContent:P,fullOptions:_,filterOptions:N,remoteOptions:I,loading:W}=e.urlConfig?O(e,F):K(e,F),{modifyEvent:q,modifyAbleRef:E,getOptionsWithCreated:z}=f(e,{searchContent:P,labelKey:A,valueKey:x,valueRef:F,fullOptions:_}),{renderComplexOption:M,hasComplexOption:T}=k(e,F),{getRecommend:U,postRecommend:D,sortedOptions:G}=R(e,N,b,A,x),{field:J,fieldKey:Q}=H();t(C).setContext(Q.value,(e=>({currentOption:i(function(e){const o=z(_.value);return p(e)?function(e){const t=o.reduce(((e,o)=>(e[o[x.value]]=o,e)),{});return e.map((e=>t[e]))}(e):(t=e,o.find((e=>e[x.value]===t)));var t}(e))})));const X=async e=>(P.value=e,Promise.allSettled([L(e),U(e)])),{injectValueValidate:Y,injectValueWatchFromEmpty:Z,injectValueBindKey:$}=j();Z(F,(()=>e.lazyRequest&&X())),Y(F);const ee=$(F),{menuProps:oe,nodeProps:te}=S(),{renderTag:le,renderLabel:ae,renderSelectAll:re,titleRef:se}=v(e,{labelKey:A,valueKey:x,valueRef:F,showKey:V,searchContent:P}),ne=o((()=>z(E.value?_.value:G.value))),ue=l(),ie=o((()=>{if(e.allowCreate||e.showCustomValue)return F.value;const o=e.multiple&&p(F.value);return _.value.find((e=>o?F.value.includes(e[x.value]):e[x.value]===F.value))?F.value:null})),pe=a(!1);async function me(e){e&&await X(),pe.value=e}async function de(e,o){await q.updateValue(e,o),I.value&&o&&u(o).forEach((e=>{if(!m(e))return;const o=e;o.created&&o.shouldSave&&I.value.push(d(n(o),["created","shouldSave"]))}))}const ce=t(B),{getSpan:ye}=g(),fe=w(J,q.focus);function ve(o){if(!e.multiple)return;const t=o?ne.value.map((e=>e[x.value])):[];c(t,e.value).length&&(F.value=t)}function he(o){let t=h;return e.multiple&&e.selectAll&&(t={action:()=>re(ve),...h}),r(y,s({title:se.value,key:ee.value,multiple:e.multiple,remote:!0,filterable:!0,loading:W.value,value:ie.value,onUpdateValue:de,"menu-props":oe,"node-props":te,labelField:A.value,valueField:x.value,options:ne.value,onSearch:X,show:pe.value,"onUpdate:show":me,onFocus:fe,onBlur:q.blur,renderLabel:ae,renderTag:le},o,ue),t)}return()=>{var e,o;if(!T.value)return he();const t=null!=(o=null==(e=J.value.decoratorProps)?void 0:e.span)?o:6,l=ye(ce,J.value.address);return r("section",{class:"form-render__selectChildField",style:{"--column":l+t}},[he({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),_.value.map((e=>M({option:e,value:F.value,valueKey:x.value,labelKey:A.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":l}}})))])}}}),b({dataSource:"options"},F,A));export{x as SELECT};
@@ -16,6 +16,7 @@ export declare const InjectionFormLifeCycleCaller: InjectionKey<ReturnType<typeo
16
16
  export declare const InjectionFormUUID: InjectionKey<string>;
17
17
  export declare const InjectionFormGraph: InjectionKey<Record<string, GeneralField>>;
18
18
  export declare const InjectionAnnotation: InjectionKey<WritableComputedRef<Nullable<Record<string, AnnotationItem>>>>;
19
+ export declare const InjectionAnnotationShortcuts: InjectionKey<WritableComputedRef<Exclude<NonNullable<AnnotationItem>, string>['shortcuts']>>;
19
20
  export declare const InjectionFormGlobalProps: InjectionKey<Readonly<FormRenderProps>>;
20
21
  export declare enum FIELD_BUSINESS_TYPE {
21
22
  PASSWORD = "password",
@@ -1 +1 @@
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"),c=Symbol("InjectionFormGlobalProps");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||{}),A=(o=>(o.MALE="1",o.FEMALE="2",o))(A||{}),S=(o=>(o.DAY="D",o.MONTH="M",o.YEAR="Y",o.HOUR="H",o.WEEK="W",o.MINUTE="N",o))(S||{});const r=["COMPLEX","COMBINATION"];export{S as FIELD_AGE_UNIT,m as FIELD_BUSINESS_TYPE,A as FIELD_SEX_VALUE,a as InjectionAnnotation,o as InjectionAsyncQueue,n as InjectionBusinessCollector,t as InjectionChangeContextCollector,c as InjectionFormGlobalProps,i as InjectionFormGraph,l as InjectionFormItemDepsCollector,E as InjectionFormLifeCycleCaller,I as InjectionFormUUID,e as InjectionSchemaField,r as NESTED_FORM_ITEM_TYPE};
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"),c=Symbol("InjectionAnnotation"),a=Symbol("InjectionAnnotationShortcuts"),m=Symbol("InjectionFormGlobalProps");var A=(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))(A||{}),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,A as FIELD_BUSINESS_TYPE,S as FIELD_SEX_VALUE,c as InjectionAnnotation,a as InjectionAnnotationShortcuts,o as InjectionAsyncQueue,n as InjectionBusinessCollector,t as InjectionChangeContextCollector,m as InjectionFormGlobalProps,I as InjectionFormGraph,l as InjectionFormItemDepsCollector,E as InjectionFormLifeCycleCaller,i as InjectionFormUUID,e as InjectionSchemaField,s as NESTED_FORM_ITEM_TYPE};
@@ -68,7 +68,11 @@ export declare function useFieldNormalize(): {
68
68
  }>;
69
69
  components: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>>;
70
70
  scope: import("../../../../shared/types").AnyObject;
71
- annotation: import("../../../../shared/types").AnyObject;
71
+ annotation: Record<string, import("../../../annotation-edit/src/type").AnnotationItem>;
72
+ annotationShortcuts: (string | {
73
+ label: string;
74
+ value: string;
75
+ })[] | undefined;
72
76
  consumer: boolean;
73
77
  uuid: string;
74
78
  lifeCycle: Partial<{
@@ -159,7 +163,11 @@ export declare function useFieldNormalize(): {
159
163
  }>;
160
164
  components: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>>;
161
165
  scope: import("../../../../shared/types").AnyObject;
162
- annotation: import("../../../../shared/types").AnyObject;
166
+ annotation: Record<string, import("../../../annotation-edit/src/type").AnnotationItem>;
167
+ annotationShortcuts: (string | {
168
+ label: string;
169
+ value: string;
170
+ })[] | undefined;
163
171
  consumer: boolean;
164
172
  uuid: string;
165
173
  lifeCycle: Partial<{
@@ -1 +1 @@
1
- import{arrayed as e,uuidGenerator as t,traverse as r}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/Hook.js";import l from"../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../shared/utils/tapable/AsyncSeriesHook.js";import{last as o,isString as i}from"lodash-es";import{FIELD_BUSINESS_TYPE as _}from"../constants/index.js";function s(){const s=new l(["fieldList","props"]),p=new l(["fieldItem","props"]);p.tap("__forceClearable",((e,t)=>(t.forceClearable&&(e.componentProps={...e.componentProps,clearable:!0}),e))),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:_.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:r,__multiple:l}=e;return e.__multiple="SEARCH"!==t&&("SEARCH_MORE"===t||("SELECT"===t?"0"===r:l)),e}));const n=[[["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=>(n.some((([t,r])=>(Array.isArray(t)?t.includes(e.html_type):t===e.html_type)&&(e.html_type=r))),e)));const a=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?([...a].some((([r,l])=>{if(!e(r).includes(t.html_type))return;const o=l.get(t.show_mode);return o&&o(t),!0})),t):t)),s.tap("__out_bordered",((e,{column:r,outBordered:l})=>{if(!l)return e;let i=0;return e.reduce(((l,_,s)=>{const p=2*(_.elem_width||3);return i+=p,i===r&&s<e.length-1?(i=0,l.push(_),l.push({val_key:`${t()}`,html_type:"LINE_BREAKS",lineBreaksBorder:!0})):i>r?(i=p,l.push({val_key:`${t()}`,html_type:"LINE_BREAKS",lineBreaksBorder:!0}),l.push(_)):(o(l)&&(o(l).fieldItemBorder=!0),l.push(_)),l}),[])})),s.tap("__prefix/suffix",(e=>{const t=[];return r(e,(l=>{["prefix","suffix"].forEach((o=>{const _=l[o];if(!i(_))return;const s=_.match("#{(.+)}");if(!s)return;const p=i(s[1])&&function(t){let l=null;return r(e,((e,r)=>{e.val_key===t&&(l=e,r())}),["children","properties"]),l}(s[1].trim());p&&(Reflect.deleteProperty(l,o),l[`${o}Config`]=l[`${o}Config`]||[],l[`${o}Config`].push(p),t.push(p))}))}),["children","properties"]),t.length?function e(r){return r.reduce(((r,l)=>(t.includes(l)||(r.push(l),l.properties&&(l.properties=e(l.properties)),l.children&&(l.children=e(l.children))),r)),[])}(e):e})),{FieldNormalizeWaterfallHook:p,FieldListNormalizeWaterfallHook:s}}export{s as useFieldNormalize};
1
+ import{arrayed as e,uuidGenerator as t,traverse as r}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import l 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 s}from"lodash-es";import{FIELD_BUSINESS_TYPE as i}from"../constants/index.js";function a(){const a=new l(["fieldList","props"]),p=new l(["fieldItem","props"]);p.tap("__forceClearable",((e,t)=>(t.forceClearable&&(e.componentProps={...e.componentProps,clearable:!0}),e))),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:i.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:r,__multiple:l}=e;return e.__multiple="SEARCH"!==t&&("SEARCH_MORE"===t||("SELECT"===t?"0"===r:l)),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,r])=>(Array.isArray(t)?t.includes(e.html_type):t===e.html_type)&&(e.html_type=r))),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((([r,l])=>{if(!e(r).includes(t.html_type))return;const o=l.get(t.show_mode);return o&&o(t),!0})),t):t)),a.tap("__out_bordered",((e,{column:r,outBordered:l})=>{if(!l)return e;let s=0;return e.reduce(((l,i,a)=>{const p=2*(i.elem_width||3);return s+=p,s===r&&a<e.length-1?(s=0,l.push(i),l.push({val_key:`${t()}`,html_type:"LINE_BREAKS",lineBreaksBorder:!0})):s>r?(s=p,l.push({val_key:`${t()}`,html_type:"LINE_BREAKS",lineBreaksBorder:!0}),l.push(i)):(o(l)&&(o(l).fieldItemBorder=!0),l.push(i)),l}),[])})),a.tap("__prefix/suffix",(e=>{const t=[];return r(e,(l=>{["prefix","suffix"].forEach((o=>{const i=l[o];if(!s(i))return;const a=i.match("#{(.+)}");if(!a)return;const p=s(a[1])&&function(t){let l=null;return r(e,((e,r)=>{e.val_key===t&&(l=e,r())}),["children","properties"]),l}(a[1].trim());p&&(Reflect.deleteProperty(l,o),l[`${o}Config`]=l[`${o}Config`]||[],l[`${o}Config`].push(p),t.push(p))}))}),["children","properties"]),t.length?function e(r){return r.reduce(((r,l)=>(t.includes(l)||(r.push(l),l.properties&&(l.properties=e(l.properties)),l.children&&(l.children=e(l.children))),r)),[])}(e):e})),{FieldNormalizeWaterfallHook:p,FieldListNormalizeWaterfallHook:a}}export{a as useFieldNormalize};
@@ -1 +1 @@
1
- import{uuidGenerator as e}from"../../../../shared/utils/index.js";import"lodash-es";import"naive-ui";import{computed as o,provide as t,readonly as r}from"vue";import"@vueuse/core";import"date-fns";import{useFormAsyncQueue as s,presetRequestHandler as n}from"../../../../shared/hooks/useFormRequest/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{createSchemaField as i}from"@formily/vue";import{isObject as a}from"@vue/shared";import"../../index.js";import m from"../components/renderer/index.js";import{InjectionAsyncQueue as u,InjectionSchemaField as c,InjectionBusinessCollector as p,InjectionChangeContextCollector as l,InjectionFormItemDepsCollector as f,InjectionFormUUID as d,InjectionAnnotation as h,InjectionFormGlobalProps as j}from"../constants/index.js";import{useFormRenderLifeCycle as C}from"./useFormRenderLifeCycle.js";import{usePresetScope as v}from"./usePresetScope.js";import{useBusinessBinding as x}from"./useBusinessBinding.js";import{useChangeContext as y}from"./useChangeContext.js";import{useFormItemDeps as q}from"./useFormItemDeps.js";function g(g,F){const{callLifeCycle:R}=C(g),b=s(o((()=>g.requestInstance)),o((()=>!!g.uniqueCacheData))).create(g.parallelism,{beforeRequest:(...e)=>R("beforeRequest",e)||e[1],afterRequest:(...e)=>R("afterRequest",e)||n(e[1])});t(u,b);const D=i({components:{...m,...g.components},scope:Object.assign({},v(),g.scope)}).SchemaField;t(c,D);const I=x().create(g.businessFormatter);t(p,I);const S=y().create();t(l,S);const k=q().create();t(f,k);const B=g.uuid||e();return t(d,B),t(h,o({get:()=>g.annotation?r(g.annotation):null,set(e){if(!a(g.annotation)||!a(e))return;const o=g.annotation[e.property];g.annotation[e.property]=e.value,F("annotationChange",{fieldKey:e.property,value:e.value,oldValue:o})}})),t(j,g),{asyncQueue:b,SchemaField:D,businessCollector:I,changeContextCollector:S,formItemDepsCollector:k,formUUID:B}}export{g as useFormContext};
1
+ import{uuidGenerator as e}from"../../../../shared/utils/index.js";import"lodash-es";import"naive-ui";import{computed as o,provide as t,readonly as r}from"vue";import"@vueuse/core";import"date-fns";import{useFormAsyncQueue as s,presetRequestHandler as n}from"../../../../shared/hooks/useFormRequest/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{createSchemaField as i}from"@formily/vue";import{isObject as a}from"@vue/shared";import"../../index.js";import m from"../components/renderer/index.js";import{InjectionAsyncQueue as u,InjectionSchemaField as c,InjectionBusinessCollector as p,InjectionChangeContextCollector as l,InjectionFormItemDepsCollector as f,InjectionFormUUID as d,InjectionAnnotation as h,InjectionAnnotationShortcuts as j,InjectionFormGlobalProps as C}from"../constants/index.js";import{useFormRenderLifeCycle as v}from"./useFormRenderLifeCycle.js";import{usePresetScope as x}from"./usePresetScope.js";import{useBusinessBinding as y}from"./useBusinessBinding.js";import{useChangeContext as q}from"./useChangeContext.js";import{useFormItemDeps as g}from"./useFormItemDeps.js";function F(F,R){const{callLifeCycle:b}=v(F),S=s(o((()=>F.requestInstance)),o((()=>!!F.uniqueCacheData))).create(F.parallelism,{beforeRequest:(...e)=>b("beforeRequest",e)||e[1],afterRequest:(...e)=>b("afterRequest",e)||n(e[1])});t(u,S);const D=i({components:{...m,...F.components},scope:Object.assign({},x(),F.scope)}).SchemaField;t(c,D);const I=y().create(F.businessFormatter);t(p,I);const k=q().create();t(l,k);const B=g().create();t(f,B);const L=F.uuid||e();return t(d,L),t(h,o({get:()=>F.annotation?r(F.annotation):null,set(e){if(!a(F.annotation)||!a(e))return;const o=F.annotation[e.property];F.annotation[e.property]=e.value,R("annotationChange",{fieldKey:e.property,value:e.value,oldValue:o})}})),t(j,o((()=>F.annotationShortcuts))),t(C,F),{asyncQueue:S,SchemaField:D,businessCollector:I,changeContextCollector:k,formItemDepsCollector:B,formUUID:L}}export{F as useFormContext};
@@ -3,6 +3,7 @@ import { AnyObject, LowCodeTypes, UndefinedAble } from '../../../../shared/types
3
3
  import { DataField, Field, Form, GeneralField } from '@formily/core';
4
4
  import { ISchema } from '@formily/json-schema/esm/types';
5
5
  import { Component, FunctionalComponent } from 'vue';
6
+ import { AnnotationItem } from '../../../../components/annotation-edit/src/type';
6
7
  import { FIELD_BUSINESS_TYPE } from '../../../../components/form-render/src/constants';
7
8
  import { FieldItem } from '../types';
8
9
  export * from './fieldItem';
@@ -134,7 +135,8 @@ export declare type FormRenderProps = Partial<{
134
135
  schema: ISchema;
135
136
  components: Record<string, Component | FunctionalComponent>;
136
137
  scope: AnyObject;
137
- annotation: AnyObject;
138
+ annotation: Record<string, AnnotationItem>;
139
+ annotationShortcuts: Exclude<NonNullable<AnnotationItem>, string>['shortcuts'];
138
140
  consumer: boolean;
139
141
  uuid: string;
140
142
  lifeCycle: FormRenderLifeCycle;
@@ -1 +1 @@
1
- import{COMPONENT_NAMESPACE as s}from"../../shared/global/variable.js";import{safeComponentRegister as o}from"../../shared/utils/index.js";import{once as t}from"lodash-es";import r from"./src/IhoTable.vue.js";import e from"./src/plugins/index.js";import"vue";import"./src/constants/index.js";import"@vueuse/shared";import"date-fns";import"./src/utils/separateMap.js";import"../../shared/utils/tapable/SyncHook.js";import"../../shared/utils/tapable/Hook.js";import"../../shared/utils/tapable/SyncWaterfallHook.js";import"../../shared/utils/tapable/AsyncParallelHook.js";import"../../shared/utils/tapable/AsyncSeriesHook.js";export{AbstractConfigHooks,AbstractDataHooks,AbstractDomInsertHooks,AbstractEventHooks,AbstractExposeHooks,AbstractFieldHooks,AbstractSetupHooks}from"./src/types/pluginType.js";import{useTablePlugin as a}from"./src/hooks/useTablePlugin.js";export{defineTablePlugin}from"./src/hooks/useTablePlugin.js";export{useColumnConfigAdaptor}from"./src/hooks/useColumnConfigAdaptor.js";const{use:i}=a(),l=t((s=>{i(Object.values(e).map((s=>s())),s)})),p=r;p.install=function(t){o(t,p,s+"IhoTable")};export{p as default,l as useIhoTablePresetPlugins,a as useTablePlugin};
1
+ import{COMPONENT_NAMESPACE as s}from"../../shared/global/variable.js";import{safeComponentRegister as o}from"../../shared/utils/index.js";import{once as t}from"lodash-es";import a from"./src/IhoTable.vue.js";import e from"./src/plugins/index.js";import"vue";import"./src/constants/index.js";import"@vueuse/shared";import"date-fns";import"./src/utils/separateMap.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";export{AbstractConfigHooks,AbstractDataHooks,AbstractDomInsertHooks,AbstractEventHooks,AbstractExposeHooks,AbstractFieldHooks,AbstractSetupHooks}from"./src/types/pluginType.js";import{useTablePlugin as r}from"./src/hooks/useTablePlugin.js";export{defineTablePlugin,useTablePlugin}from"./src/hooks/useTablePlugin.js";export{useColumnConfigAdaptor}from"./src/hooks/useColumnConfigAdaptor.js";const{use:l}=r(),i=t((s=>{l(Object.values(e).map((s=>s())),s)})),p=a;p.install=function(t){o(t,p,s+"IhoTable")};export{p as default,i as useIhoTablePresetPlugins};
@@ -1 +1 @@
1
- import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import o from"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import{AbstractConfigHooks as n}from"../../types/pluginType.js";class t extends n{constructor(){super(...arguments),this.config=new o(["config","context"]),this.rowConfig=new o(["rowConfig","config","context"]),this.editConfig=new o(["editConfig","config","context"]),this.columnConfig=new o(["columnConfig","config","context"]),this.resizableConfig=new o(["resizableConfig","config","context"]),this.seqConfig=new o(["seqConfig","config","context"]),this.sortConfig=new o(["sortConfig","config","context"]),this.filterConfig=new o(["filterConfig","config","context"]),this.radioConfig=new o(["radioConfig","config","context"]),this.checkboxConfig=new o(["checkboxConfig","config","context"]),this.expandConfig=new o(["expandConfig","config","context"]),this.treeConfig=new o(["treeConfig","config","context"]),this.mouseConfig=new o(["mouseConfig","config","context"]),this.menuConfig=new o(["menuConfig","config","context"]),this.keyboardConfig=new o(["keyboardConfig","config","context"]),this.scrollY=new o(["scrollY","config","context"]),this.scrollX=new o(["scrollX","config","context"]),this.editRules=new o(["editRules","config","context"])}}function i(){return{create:function(){return new t}}}export{i as useConfigHooks};
1
+ import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import o 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{AbstractConfigHooks as n}from"../../types/pluginType.js";class e extends n{constructor(){super(...arguments),this.config=new o(["config","context"]),this.rowConfig=new o(["rowConfig","config","context"]),this.editConfig=new o(["editConfig","config","context"]),this.columnConfig=new o(["columnConfig","config","context"]),this.resizableConfig=new o(["resizableConfig","config","context"]),this.seqConfig=new o(["seqConfig","config","context"]),this.sortConfig=new o(["sortConfig","config","context"]),this.filterConfig=new o(["filterConfig","config","context"]),this.radioConfig=new o(["radioConfig","config","context"]),this.checkboxConfig=new o(["checkboxConfig","config","context"]),this.expandConfig=new o(["expandConfig","config","context"]),this.treeConfig=new o(["treeConfig","config","context"]),this.mouseConfig=new o(["mouseConfig","config","context"]),this.menuConfig=new o(["menuConfig","config","context"]),this.keyboardConfig=new o(["keyboardConfig","config","context"]),this.scrollY=new o(["scrollY","config","context"]),this.scrollX=new o(["scrollX","config","context"]),this.editRules=new o(["editRules","config","context"])}}function t(){return{create:function(){return new e}}}export{t as useConfigHooks};
@@ -1 +1 @@
1
- import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import t from"../../../../../shared/utils/tapable/AsyncParallelHook.js";import a from"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import{AbstractDataHooks as e}from"../../types/pluginType.js";class o extends e{constructor(){super(...arguments),this.dataStart=new t(["config"]),this.data=new a(["rowData","context","config"]),this.dataEnd=new t(["config"])}}function r(){return{create:function(){return new o}}}export{r as useDataHooks};
1
+ 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 t from"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import a from"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{AbstractDataHooks as s}from"../../types/pluginType.js";class o extends s{constructor(){super(...arguments),this.dataStart=new t(["config"]),this.data=new a(["rowData","context","config"]),this.dataEnd=new t(["config"])}}function e(){return{create:function(){return new o}}}export{e as useDataHooks};
@@ -1 +1 @@
1
- import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import e from"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import{AbstractDomInsertHooks as t}from"../../types/pluginType.js";class s extends t{constructor(){super(...arguments),this.header=new e(["nodes"]),this.footer=new e(["nodes"])}}function o(){return{create:function(){return new s}}}export{o as useDomInsertHooks};
1
+ import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import s 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{AbstractDomInsertHooks as e}from"../../types/pluginType.js";class o extends e{constructor(){super(...arguments),this.header=new s(["nodes"]),this.footer=new s(["nodes"])}}function t(){return{create:function(){return new o}}}export{t as useDomInsertHooks};
@@ -1 +1 @@
1
- import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import e from"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import{getCurrentInstance as n,onMounted as t,onBeforeUnmount as o,provide as i}from"vue";import{InjectionIhoTableEventListener as c}from"../../constants/index.js";import{AbstractEventHooks as l}from"../../types/pluginType.js";class s extends l{constructor(){super(...arguments),this.onKeydownStart=new e(["event","context","config"]),this.onKeydown=new e(["event","context","config"]),this.onKeydownEnd=new e(["event","context","config"]),this.onPaste=new e(["event","context","config"]),this.onCopy=new e(["event","context","config"]),this.onCut=new e(["event","context","config"]),this.onCurrentChange=new e(["event","context","config"]),this.onRadioChange=new e(["event","context","config"]),this.onCheckboxChange=new e(["event","context","config"]),this.onCheckboxAll=new e(["event","context","config"]),this.onCheckboxRangeStart=new e(["event","context","config"]),this.onCheckboxRangeChange=new e(["event","context","config"]),this.onCheckboxRangeEnd=new e(["event","context","config"]),this.onCellClick=new e(["event","context","config"]),this.onCellDblclick=new e(["event","context","config"]),this.onCellMenu=new e(["event","context","config"]),this.onCellMouseenter=new e(["event","context","config"]),this.onCellMouseleave=new e(["event","context","config"]),this.onHeaderCellClick=new e(["event","context","config"]),this.onHeaderCellDblclick=new e(["event","context","config"]),this.onHeaderCellMenu=new e(["event","context","config"]),this.onFooterCellClick=new e(["event","context","config"]),this.onFooterCellDblclick=new e(["event","context","config"]),this.onFooterCellMenu=new e(["event","context","config"]),this.onSortChange=new e(["event","context","config"]),this.onFilterChange=new e(["event","context","config"]),this.onFilterVisible=new e(["event","context","config"]),this.onResizableChange=new e(["event","context","config"]),this.onToggleRowExpand=new e(["event","context","config"]),this.onToggleTreeExpand=new e(["event","context","config"]),this.onMenuClick=new e(["event","context","config"]),this.onEditClosed=new e(["event","context","config"]),this.onEditActived=new e(["event","context","config"]),this.onEditDisabled=new e(["event","context","config"]),this.onValidError=new e(["event","context","config"]),this.onScroll=new e(["event","context","config"]),this.onCustom=new e(["event","context","config"]),this.onOpenFnr=new e(["event","context","config"]),this.onFnrChange=new e(["event","context","config"]),this.onFnrFind=new e(["event","context","config"]),this.onFnrFindAll=new e(["event","context","config"]),this.onFnrReplace=new e(["event","context","config"]),this.onFnrReplaceAll=new e(["event","context","config"]),this.onCellAreaCopy=new e(["event","context","config"]),this.onCellAreaCut=new e(["event","context","config"]),this.onCellAreaPaste=new e(["event","context","config"]),this.onCellAreaMerge=new e(["event","context","config"]),this.onClearCellAreaMerge=new e(["event","context","config"]),this.onHeaderCellAreaSelection=new e(["event","context","config"]),this.onCellAreaSelectionStart=new e(["event","context","config"]),this.onCellAreaSelectionDrag=new e(["event","context","config"]),this.onCellAreaSelectionEnd=new e(["event","context","config"]),this.onCellAreaExtensionStart=new e(["event","context","config"]),this.onCellAreaExtensionDrag=new e(["event","context","config"]),this.onCellAreaExtensionEnd=new e(["event","context","config"]),this.onCellAreaArrowsStart=new e(["event","context","config"]),this.onCellAreaArrowsEnd=new e(["event","context","config"]),this.onActiveCellChangeStart=new e(["event","context","config"]),this.onActiveCellChangeEnd=new e(["event","context","config"]),this.onCellAreaSelectionAllStart=new e(["event","context","config"]),this.onCellAreaSelectionAllEnd=new e(["event","context","config"]),this.onPageChange=new e(["event","context","config"])}}function r(){return{create:function(){return new s}}}class a{constructor(){this.eventMap=new Map}addEventListener(e,i){if(!n())throw new Error("addEventListener can only used in setup environment!");const c=this.eventMap.get(e)||new Set;this.eventMap.set(e,c),t((()=>c.add(i))),o((()=>c.delete(i)))}trigger(e,...n){var t;null==(t=this.eventMap.get(e))||t.forEach((e=>{e(...n)}))}}function h(){if(!n())throw new Error("provideIhoTableEventListener can only used in setup environment!");const e=new a;return i(c,e),e}export{a as IhoTableEventListener,h as provideIhoTableEventListener,r as useEventHooks};
1
+ 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 e from"../../../../../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{getCurrentInstance as n,onMounted as t,onBeforeUnmount as o,provide as i}from"vue";import{InjectionIhoTableEventListener as c}from"../../constants/index.js";import{AbstractEventHooks as s}from"../../types/pluginType.js";class l extends s{constructor(){super(...arguments),this.onKeydownStart=new e(["event","context","config"]),this.onKeydown=new e(["event","context","config"]),this.onKeydownEnd=new e(["event","context","config"]),this.onPaste=new e(["event","context","config"]),this.onCopy=new e(["event","context","config"]),this.onCut=new e(["event","context","config"]),this.onCurrentChange=new e(["event","context","config"]),this.onRadioChange=new e(["event","context","config"]),this.onCheckboxChange=new e(["event","context","config"]),this.onCheckboxAll=new e(["event","context","config"]),this.onCheckboxRangeStart=new e(["event","context","config"]),this.onCheckboxRangeChange=new e(["event","context","config"]),this.onCheckboxRangeEnd=new e(["event","context","config"]),this.onCellClick=new e(["event","context","config"]),this.onCellDblclick=new e(["event","context","config"]),this.onCellMenu=new e(["event","context","config"]),this.onCellMouseenter=new e(["event","context","config"]),this.onCellMouseleave=new e(["event","context","config"]),this.onHeaderCellClick=new e(["event","context","config"]),this.onHeaderCellDblclick=new e(["event","context","config"]),this.onHeaderCellMenu=new e(["event","context","config"]),this.onFooterCellClick=new e(["event","context","config"]),this.onFooterCellDblclick=new e(["event","context","config"]),this.onFooterCellMenu=new e(["event","context","config"]),this.onSortChange=new e(["event","context","config"]),this.onFilterChange=new e(["event","context","config"]),this.onFilterVisible=new e(["event","context","config"]),this.onResizableChange=new e(["event","context","config"]),this.onToggleRowExpand=new e(["event","context","config"]),this.onToggleTreeExpand=new e(["event","context","config"]),this.onMenuClick=new e(["event","context","config"]),this.onEditClosed=new e(["event","context","config"]),this.onEditActived=new e(["event","context","config"]),this.onEditDisabled=new e(["event","context","config"]),this.onValidError=new e(["event","context","config"]),this.onScroll=new e(["event","context","config"]),this.onCustom=new e(["event","context","config"]),this.onOpenFnr=new e(["event","context","config"]),this.onFnrChange=new e(["event","context","config"]),this.onFnrFind=new e(["event","context","config"]),this.onFnrFindAll=new e(["event","context","config"]),this.onFnrReplace=new e(["event","context","config"]),this.onFnrReplaceAll=new e(["event","context","config"]),this.onCellAreaCopy=new e(["event","context","config"]),this.onCellAreaCut=new e(["event","context","config"]),this.onCellAreaPaste=new e(["event","context","config"]),this.onCellAreaMerge=new e(["event","context","config"]),this.onClearCellAreaMerge=new e(["event","context","config"]),this.onHeaderCellAreaSelection=new e(["event","context","config"]),this.onCellAreaSelectionStart=new e(["event","context","config"]),this.onCellAreaSelectionDrag=new e(["event","context","config"]),this.onCellAreaSelectionEnd=new e(["event","context","config"]),this.onCellAreaExtensionStart=new e(["event","context","config"]),this.onCellAreaExtensionDrag=new e(["event","context","config"]),this.onCellAreaExtensionEnd=new e(["event","context","config"]),this.onCellAreaArrowsStart=new e(["event","context","config"]),this.onCellAreaArrowsEnd=new e(["event","context","config"]),this.onActiveCellChangeStart=new e(["event","context","config"]),this.onActiveCellChangeEnd=new e(["event","context","config"]),this.onCellAreaSelectionAllStart=new e(["event","context","config"]),this.onCellAreaSelectionAllEnd=new e(["event","context","config"]),this.onPageChange=new e(["event","context","config"])}}function r(){return{create:function(){return new l}}}class a{constructor(){this.eventMap=new Map}addEventListener(e,i){if(!n())throw new Error("addEventListener can only used in setup environment!");const c=this.eventMap.get(e)||new Set;this.eventMap.set(e,c),t((()=>c.add(i))),o((()=>c.delete(i)))}trigger(e,...n){var t;null==(t=this.eventMap.get(e))||t.forEach((e=>{e(...n)}))}}function h(){if(!n())throw new Error("provideIhoTableEventListener can only used in setup environment!");const e=new a;return i(c,e),e}export{a as IhoTableEventListener,h as provideIhoTableEventListener,r as useEventHooks};
@@ -1 +1 @@
1
- import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import e from"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import{AbstractExposeHooks as t}from"../../types/pluginType.js";class s extends t{constructor(){super(...arguments),this.expose=new e(["expose","config","context"])}}function o(){return{create:function(){return new s}}}export{o as useExposeHooks};
1
+ import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import s 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{AbstractExposeHooks as e}from"../../types/pluginType.js";class o extends e{constructor(){super(...arguments),this.expose=new s(["expose","config","context"])}}function t(){return{create:function(){return new o}}}export{t as useExposeHooks};
@@ -1 +1 @@
1
- import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import t from"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import e from"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import{AbstractFieldHooks as o}from"../../types/pluginType.js";class i extends o{constructor(){super(...arguments),this.fieldStart=new e(["config","context"]),this.field=new t(["fieldItem","context","config","tableContext"]),this.fieldList=new t(["fieldList","config","context"]),this.fieldEnd=new e(["config","context"])}}function s(){return{create:function(){return new i}}}export{s as useFieldHooks};
1
+ import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import t from"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import e from"../../../../../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{AbstractFieldHooks as s}from"../../types/pluginType.js";class o extends s{constructor(){super(...arguments),this.fieldStart=new e(["config","context"]),this.field=new t(["fieldItem","context","config","tableContext"]),this.fieldList=new t(["fieldList","config","context"]),this.fieldEnd=new e(["config","context"])}}function i(){return{create:function(){return new o}}}export{i as useFieldHooks};
@@ -1 +1 @@
1
- import t from"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import{AbstractSetupHooks as e}from"../../types/pluginType.js";class s extends e{constructor(){super(...arguments),this.setup=new t(["config","fieldList","context"])}}function o(){return{create:function(){return new s}}}export{o as useSetupHooks};
1
+ import s from"../../../../../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{AbstractSetupHooks as t}from"../../types/pluginType.js";class e extends t{constructor(){super(...arguments),this.setup=new s(["config","fieldList","context"])}}function o(){return{create:function(){return new e}}}export{o as useSetupHooks};
@@ -1 +1 @@
1
- import{format as e}from"date-fns";import"../../index.js";import{EDITABLE_WIDGET_TYPE as t}from"../constants/index.js";import{getLowCodeFieldFromField as a}from"../utils/index.js";import{defineTablePlugin as n}from"../hooks/useTablePlugin.js";function l(){const l="defaultValuePlugin",o=new Map([[t.TIME,({defaultValue:t,valueFormat:a="HH:mm"})=>"current"===t?e(Date.now(),a):t],[t.DATE,({defaultValue:t,valueFormat:a="yyyy-MM-dd HH:mm:ss"})=>"current"===t?e(Date.now(),a):t]]);function u(e){var t;const n=a(e);if(!n||null==n.defaultValue)return null;const l=null==(t=e.editRender)?void 0:t.name,u=l&&o.get(l);return u?u(n):n.defaultValue}return n({name:l,apply(e){const t=Object.freeze([]);let a=t;e.fieldHooks.field.tap(l,(e=>(e.editRender={defaultValue:({column:e})=>u(e),...e.editRender},e))),e.fieldHooks.fieldList.tap(l,(e=>a=e)),e.dataHooks.data.tap(l,(e=>{a.length&&a.forEach((t=>{if(null!=e[t.field])return;const a=u(t);null!=a&&(e[t.field]=a)}))})),e.dataHooks.dataEnd.tap(l,(()=>a=t))}})}export{l as defaultValuePlugin};
1
+ import{format as e}from"date-fns";import"../../index.js";import{EDITABLE_WIDGET_TYPE as t}from"../constants/index.js";import{getLowCodeFieldFromField as n}from"../utils/index.js";import{defineTablePlugin as u}from"../hooks/useTablePlugin.js";function l(){const l="defaultValuePlugin",a=new Map([[t.TIME,({defaultValue:t,valueFormat:n="HH:mm"})=>"current"===t?e(Date.now(),n):t],[t.DATE,({defaultValue:t,valueFormat:n="yyyy-MM-dd HH:mm:ss"})=>"current"===t?e(Date.now(),n):t]]);return u({name:l,apply(e){e.fieldHooks.field.tap(l,(e=>(e.editRender={defaultValue:({column:e})=>function(e){var t;const u=n(e);if(!u||null==u.defaultValue)return null;const l=null==(t=e.editRender)?void 0:t.name,o=l&&a.get(l);return o?o(u):u.defaultValue}(e),...e.editRender},e)))}})}export{l as defaultValuePlugin};