cnhis-design-vue 3.2.7-beta.2 → 3.2.7-beta.20

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 (115) hide show
  1. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  2. package/es/components/classification/index.d.ts +60 -5
  3. package/es/components/classification/src/components/search-filter/index.vue.d.ts +60 -5
  4. package/es/components/classification/src/components/set-classification/index.vue.d.ts +60 -5
  5. package/es/components/classification/src/index.vue.d.ts +60 -5
  6. package/es/components/date-picker/index.d.ts +13 -0
  7. package/es/components/date-picker/src/DatePicker.vue.d.ts +13 -0
  8. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  9. package/es/components/fabric-chart/src/constants/index.d.ts +3 -1
  10. package/es/components/fabric-chart/src/constants/index.js +1 -1
  11. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  12. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +8 -3
  13. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  14. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +9 -6
  15. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  16. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
  17. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.d.ts +0 -2
  18. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
  19. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +8 -3
  20. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  21. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  22. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  23. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +8 -3
  24. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  25. package/es/components/fabric-chart/src/hooks/useScaleColumn.d.ts +1 -1
  26. package/es/components/fabric-chart/src/hooks/useScaleColumn.js +1 -1
  27. package/es/components/fabric-chart/src/interface.d.ts +11 -1
  28. package/es/components/field-set/src/FieldColor.vue.d.ts +26 -0
  29. package/es/components/field-set/src/components/condition.vue.d.ts +13 -0
  30. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +26 -0
  31. package/es/components/field-set/src/components/edit-filter.vue.d.ts +13 -0
  32. package/es/components/form-config/index.d.ts +6 -3
  33. package/es/components/form-config/src/FormConfig.vue.d.ts +6 -3
  34. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +6 -3
  35. package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
  36. package/es/components/form-render/src/components/renderer/combination/tableCombination.js +1 -1
  37. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  38. package/es/components/form-render/src/components/tooltipMessage.vue2.js +1 -1
  39. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  40. package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
  41. package/es/components/form-render/src/types/fieldItem.d.ts +3 -1
  42. package/es/components/form-render/src/types/index.d.ts +1 -1
  43. package/es/components/form-render/src/utils/business.js +1 -1
  44. package/es/components/form-render/src/utils/schema.d.ts +1 -1
  45. package/es/components/form-render/src/utils/schema.js +1 -1
  46. package/es/components/iho-chat/index.d.ts +236 -74
  47. package/es/components/iho-chat/src/Index.vue.d.ts +236 -74
  48. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  49. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +34 -13
  50. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  51. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +39 -14
  52. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  53. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +48 -14
  54. package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
  55. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +24 -4
  56. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  57. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +13 -0
  58. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  59. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +3 -10
  60. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  61. package/es/components/iho-chat/src/components/ContextMenu.d.ts +15 -2
  62. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  63. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +61 -24
  64. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
  65. package/es/components/iho-chat/src/components/Video.vue.d.ts +14 -2
  66. package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
  67. package/es/components/iho-chat/src/hooks/useScrollLoading.d.ts +1 -1
  68. package/es/components/iho-chat/src/hooks/useScrollLoading.js +1 -1
  69. package/es/components/iho-chat/src/hooks/useSearchUserList.d.ts +11 -0
  70. package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -0
  71. package/es/components/iho-chat/src/hooks/useState.js +1 -1
  72. package/es/components/iho-chat/src/hooks/useVideo.d.ts +11 -0
  73. package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
  74. package/es/components/iho-chat/src/types/index.d.ts +0 -1
  75. package/es/components/iho-chat/src/utils/index.js +1 -1
  76. package/es/components/iho-chat/style/index.css +1 -1
  77. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +13 -0
  78. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +13 -0
  79. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +20 -2
  80. package/es/components/index.css +1 -1
  81. package/es/components/shortcut-setter/index.d.ts +2 -1
  82. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +2 -1
  83. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +13 -0
  84. package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +13 -0
  85. package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +13 -0
  86. package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +13 -0
  87. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +47 -5
  88. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +13 -0
  89. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +13 -0
  90. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue.d.ts +37 -19
  91. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue2.js +1 -1
  92. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +47 -5
  93. package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +1 -1
  94. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +47 -5
  95. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +13 -0
  96. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +13 -0
  97. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +13 -0
  98. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +13 -0
  99. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +33 -18
  100. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
  101. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue.d.ts +13 -0
  102. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
  103. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +69 -4
  104. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +69 -4
  105. package/es/components/table-filter/src/tool/transformData.js +1 -1
  106. package/es/components/table-filter/src/types/index.d.ts +1 -0
  107. package/es/components/time-line/index.d.ts +4 -4
  108. package/es/components/time-line/src/TimeLine.vue.d.ts +1 -1
  109. package/es/components/time-line/src/TimeLine.vue2.js +1 -1
  110. package/es/components/time-picker/index.d.ts +20 -2
  111. package/es/components/time-picker/src/TimePicker.vue.d.ts +21 -2
  112. package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
  113. package/es/shared/package.json.js +1 -1
  114. package/es/shared/utils/business.js +1 -1
  115. package/package.json +2 -2
@@ -200,6 +200,10 @@ declare const _default: import("vue").DefineComponent<{
200
200
  allowedInvalidValue: {
201
201
  type: StringConstructor;
202
202
  };
203
+ to: {
204
+ type: PropType<string | false | HTMLElement>;
205
+ default: string;
206
+ };
203
207
  }, {
204
208
  attrs: {
205
209
  [x: string]: unknown;
@@ -220,6 +224,10 @@ declare const _default: import("vue").DefineComponent<{
220
224
  allowedInvalidValue: {
221
225
  type: StringConstructor;
222
226
  };
227
+ to: {
228
+ type: PropType<string | false | HTMLElement>;
229
+ default: string;
230
+ };
223
231
  }>> & {
224
232
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
225
233
  }>>;
@@ -256,10 +264,15 @@ declare const _default: import("vue").DefineComponent<{
256
264
  allowedInvalidValue: {
257
265
  type: StringConstructor;
258
266
  };
267
+ to: {
268
+ type: PropType<string | false | HTMLElement>;
269
+ default: string;
270
+ };
259
271
  }>> & {
260
272
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
261
273
  }, {
262
274
  updateUnchangedValue: boolean;
275
+ to: string | false | HTMLElement;
263
276
  }>>;
264
277
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
265
278
  data: {
@@ -1887,6 +1887,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
1887
1887
  bordered?: string | boolean | undefined;
1888
1888
  displayMode?: "form" | "table" | undefined;
1889
1889
  editor_title?: string | undefined;
1890
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
1890
1891
  linebarWidth?: string | undefined;
1891
1892
  linebarDirection?: "horizontal" | "vertical" | undefined;
1892
1893
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -1911,7 +1912,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
1911
1912
  wrapperStyle?: Record<string, string> | undefined;
1912
1913
  childFieldStrategy?: "checked" | "all" | undefined;
1913
1914
  childWidthMode?: "inner" | "outer" | undefined;
1914
- validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
1915
+ validator?: ((value: unknown, fieldItem: import("..").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
1915
1916
  reactions?: {
1916
1917
  [x: string]: any;
1917
1918
  dependencies?: string[] | undefined;
@@ -2134,6 +2135,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
2134
2135
  bordered?: string | boolean | undefined;
2135
2136
  displayMode?: "form" | "table" | undefined;
2136
2137
  editor_title?: string | undefined;
2138
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
2137
2139
  linebarWidth?: string | undefined;
2138
2140
  linebarDirection?: "horizontal" | "vertical" | undefined;
2139
2141
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -2158,7 +2160,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
2158
2160
  wrapperStyle?: Record<string, string> | undefined;
2159
2161
  childFieldStrategy?: "checked" | "all" | undefined;
2160
2162
  childWidthMode?: "inner" | "outer" | undefined;
2161
- validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
2163
+ validator?: ((value: unknown, fieldItem: import("..").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
2162
2164
  reactions?: {
2163
2165
  [x: string]: any;
2164
2166
  dependencies?: string[] | undefined;
@@ -2352,6 +2354,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
2352
2354
  bordered?: string | boolean | undefined;
2353
2355
  displayMode?: "form" | "table" | undefined;
2354
2356
  editor_title?: string | undefined;
2357
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
2355
2358
  linebarWidth?: string | undefined;
2356
2359
  linebarDirection?: "horizontal" | "vertical" | undefined;
2357
2360
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -2376,7 +2379,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
2376
2379
  wrapperStyle?: Record<string, string> | undefined;
2377
2380
  childFieldStrategy?: "checked" | "all" | undefined;
2378
2381
  childWidthMode?: "inner" | "outer" | undefined;
2379
- validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
2382
+ validator?: ((value: unknown, fieldItem: import("..").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
2380
2383
  reactions?: {
2381
2384
  [x: string]: any;
2382
2385
  dependencies?: string[] | undefined;
@@ -1890,6 +1890,7 @@ declare const _default: import("vue").DefineComponent<{
1890
1890
  bordered?: string | boolean | undefined;
1891
1891
  displayMode?: "form" | "table" | undefined;
1892
1892
  editor_title?: string | undefined;
1893
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
1893
1894
  linebarWidth?: string | undefined;
1894
1895
  linebarDirection?: "horizontal" | "vertical" | undefined;
1895
1896
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -1914,7 +1915,7 @@ declare const _default: import("vue").DefineComponent<{
1914
1915
  wrapperStyle?: Record<string, string> | undefined;
1915
1916
  childFieldStrategy?: "checked" | "all" | undefined;
1916
1917
  childWidthMode?: "inner" | "outer" | undefined;
1917
- validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem) => string | void) | undefined;
1918
+ validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
1918
1919
  reactions?: {
1919
1920
  [x: string]: any;
1920
1921
  dependencies?: string[] | undefined;
@@ -2137,6 +2138,7 @@ declare const _default: import("vue").DefineComponent<{
2137
2138
  bordered?: string | boolean | undefined;
2138
2139
  displayMode?: "form" | "table" | undefined;
2139
2140
  editor_title?: string | undefined;
2141
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
2140
2142
  linebarWidth?: string | undefined;
2141
2143
  linebarDirection?: "horizontal" | "vertical" | undefined;
2142
2144
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -2161,7 +2163,7 @@ declare const _default: import("vue").DefineComponent<{
2161
2163
  wrapperStyle?: Record<string, string> | undefined;
2162
2164
  childFieldStrategy?: "checked" | "all" | undefined;
2163
2165
  childWidthMode?: "inner" | "outer" | undefined;
2164
- validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem) => string | void) | undefined;
2166
+ validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
2165
2167
  reactions?: {
2166
2168
  [x: string]: any;
2167
2169
  dependencies?: string[] | undefined;
@@ -2355,6 +2357,7 @@ declare const _default: import("vue").DefineComponent<{
2355
2357
  bordered?: string | boolean | undefined;
2356
2358
  displayMode?: "form" | "table" | undefined;
2357
2359
  editor_title?: string | undefined;
2360
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
2358
2361
  linebarWidth?: string | undefined;
2359
2362
  linebarDirection?: "horizontal" | "vertical" | undefined;
2360
2363
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -2379,7 +2382,7 @@ declare const _default: import("vue").DefineComponent<{
2379
2382
  wrapperStyle?: Record<string, string> | undefined;
2380
2383
  childFieldStrategy?: "checked" | "all" | undefined;
2381
2384
  childWidthMode?: "inner" | "outer" | undefined;
2382
- validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem) => string | void) | undefined;
2385
+ validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
2383
2386
  reactions?: {
2384
2387
  [x: string]: any;
2385
2388
  dependencies?: string[] | undefined;
@@ -393,6 +393,7 @@ declare const _default: import("vue").DefineComponent<{
393
393
  bordered?: string | boolean | undefined;
394
394
  displayMode?: "form" | "table" | undefined;
395
395
  editor_title?: string | undefined;
396
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
396
397
  linebarWidth?: string | undefined;
397
398
  linebarDirection?: "horizontal" | "vertical" | undefined;
398
399
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -417,7 +418,7 @@ declare const _default: import("vue").DefineComponent<{
417
418
  wrapperStyle?: Record<string, string> | undefined;
418
419
  childFieldStrategy?: "checked" | "all" | undefined;
419
420
  childWidthMode?: "inner" | "outer" | undefined;
420
- validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
421
+ validator?: ((value: unknown, fieldItem: FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
421
422
  reactions?: {
422
423
  [x: string]: any;
423
424
  dependencies?: string[] | undefined;
@@ -640,6 +641,7 @@ declare const _default: import("vue").DefineComponent<{
640
641
  bordered?: string | boolean | undefined;
641
642
  displayMode?: "form" | "table" | undefined;
642
643
  editor_title?: string | undefined;
644
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
643
645
  linebarWidth?: string | undefined;
644
646
  linebarDirection?: "horizontal" | "vertical" | undefined;
645
647
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -664,7 +666,7 @@ declare const _default: import("vue").DefineComponent<{
664
666
  wrapperStyle?: Record<string, string> | undefined;
665
667
  childFieldStrategy?: "checked" | "all" | undefined;
666
668
  childWidthMode?: "inner" | "outer" | undefined;
667
- validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
669
+ validator?: ((value: unknown, fieldItem: FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
668
670
  reactions?: {
669
671
  [x: string]: any;
670
672
  dependencies?: string[] | undefined;
@@ -858,6 +860,7 @@ declare const _default: import("vue").DefineComponent<{
858
860
  bordered?: string | boolean | undefined;
859
861
  displayMode?: "form" | "table" | undefined;
860
862
  editor_title?: string | undefined;
863
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
861
864
  linebarWidth?: string | undefined;
862
865
  linebarDirection?: "horizontal" | "vertical" | undefined;
863
866
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -882,7 +885,7 @@ declare const _default: import("vue").DefineComponent<{
882
885
  wrapperStyle?: Record<string, string> | undefined;
883
886
  childFieldStrategy?: "checked" | "all" | undefined;
884
887
  childWidthMode?: "inner" | "outer" | undefined;
885
- validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
888
+ validator?: ((value: unknown, fieldItem: FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
886
889
  reactions?: {
887
890
  [x: string]: any;
888
891
  dependencies?: string[] | undefined;
@@ -1 +1 @@
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};
1
+ import{defineComponent as e,computed as i,ref as o,inject as l,watch as t,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=i((()=>`#${j.uuid} .form-config__config`)),F=o(),w=l(p),R=o([]),k=o({}),{generateFieldListByFormConfigItem:C}=h(),_=o(!1);async function P(){var e;w.value=L,await v(),null==(e=F.value)||e.validate()}let L=null;function O({fieldKey:e,value:i}){w.value&&(w.value[e]=i)}return t(w,(async(e,i)=>{var o,l,t;if(!e)return R.value=[];if(i&&e!==L)try{await(null==(o=F.value)?void 0:o.validate())}catch(e){return _.value=!0}L=e,k.value={editable:!0,show:!0,...f(a(e))};const r=null==(l=j.bindFormRenderRef)?void 0:l.getFieldList();R.value=C(e,c(r,e.key)),null==(t=F.value)||t.reload()}),{immediate:!0}),b({validate(){var e;return null==(e=F.value)?void 0:e.validate()}}),(i,o)=>(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:_.value,"onUpdate:show":o[0]||(o[0]=e=>_.value=e),preset:"dialog",to:d(x),"close-on-esc":!1,"mask-closable":!1,closable:!1,title:"存在填写错误的字段","positive-text":"继续编辑",onPositiveClick:P},null,8,["show","to"])],64))}});export{b as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,onMounted as a,createVNode as t}from"vue";import{arrayed as l}from"../../../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{connect as u,mapProps as i}from"@formily/vue";import{isArray as n,property as m}from"lodash-es";import"../../../../index.js";import"../../../../../iho-table/index.js";import s from"../../../../../iho-table/src/IhoTable.vue.js";import{useCombination as p}from"./hooks/useCombination.js";import{assignUpdateValue as f}from"../../../utils/schema.js";import{useColumnConfigAdaptor as d}from"../../../../../iho-table/src/hooks/useColumnConfigAdaptor.js";import{useFormField as v}from"../../../hooks/useFormField.js";const c=u(e({name:"FormTableCombination",props:{title:{type:String,default:""},value:{type:Array},maxGroupNum:{type:Number},minGroupNum:{type:Number,default:1},disabled:{type:Boolean},properties:{type:Array,default:()=>[]},combinationItemDeletable:{type:[Boolean,Function],default:!0},onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e,{emit:u}){const{formConfigLikeAdaptor:i}=d(),{fieldList:f,editRules:c}=i({fieldList:e.properties}),{currentGroupNum:b,renderRemoveBtn:h,renderHeader:y}=p(e),j=o({editRules:c}),g=o(e.value);async function C(){b.value++,n(g.value)?g.value.push({}):(g.value=[{}],u("update:value",g.value))}const N=f.concat({alias:"操作",columnName:"operation",width:60,isFixed:2,align:"center",slots:{default:({rowIndex:e})=>h({onClick:()=>async function(e){if(n(g.value))if(b.value>1)b.value--,g.value.splice(e,1);else if(1===g.value.length){const e=g.value[0];f.forEach((o=>{o.columnName&&(o.defaultValue?e[o.columnName]=o.defaultValue:Reflect.deleteProperty(e,o.columnName))}))}}(e)},e)}});a((()=>{if(!n(g.value))return g.value=[{}],void u("update:value",g.value);g.value.length||g.value.push({})}));const{field:x}=v(),k=o();async function F(){if(!k.value)return;const e=await k.value.$table.validate(!0);return e?Object.values(e).map((e=>e.map(m("rule.message")))).join(","):""}return a((()=>{if(!r(x.value))return;const e=x.value.validator;x.value.validator=[{validator:F},...e?l(e):[]]})),()=>t("section",{class:"form-render__combination"},[y({onClick:C}),t(s,{ref:k,fieldList:N,tableConfig:j.value,tableData:g.value},null)])}}),i(f));export{c as TABLE_COMBINATION};
1
+ import{defineComponent as e,ref as a,watch as o,onMounted as t,createVNode as l}from"vue";import{arrayed as u}from"../../../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{connect as i,mapProps as n}from"@formily/vue";import{isArray as m,property as s}from"lodash-es";import"../../../../index.js";import"../../../../../iho-table/index.js";import p from"../../../../../iho-table/src/IhoTable.vue.js";import{useCombination as f}from"./hooks/useCombination.js";import{assignUpdateValue as v}from"../../../utils/schema.js";import{useColumnConfigAdaptor as d}from"../../../../../iho-table/src/hooks/useColumnConfigAdaptor.js";import{useFormField as c}from"../../../hooks/useFormField.js";const b=i(e({name:"FormTableCombination",props:{title:{type:String,default:""},value:{type:Array},maxGroupNum:{type:Number},minGroupNum:{type:Number,default:1},disabled:{type:Boolean},properties:{type:Array,default:()=>[]},combinationItemDeletable:{type:[Boolean,Function],default:!0},onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e,{emit:i}){const{formConfigLikeAdaptor:n}=d(),{fieldList:v,editRules:b}=n({fieldList:e.properties}),{currentGroupNum:h,renderRemoveBtn:y,renderHeader:j}=f(e),g=a({editRules:b}),C=a(e.value);async function N(){h.value++,m(C.value)?C.value.push({}):(C.value=[{}],i("update:value",C.value))}o((()=>e.value),(e=>{C.value=e}));const x=v.concat({alias:"操作",columnName:"operation",width:60,isFixed:2,align:"center",slots:{default:({rowIndex:e})=>y({onClick:()=>async function(e){if(m(C.value))if(h.value>1)h.value--,C.value.splice(e,1);else if(1===C.value.length){const e=C.value[0];v.forEach((a=>{a.columnName&&(a.defaultValue?e[a.columnName]=a.defaultValue:Reflect.deleteProperty(e,a.columnName))}))}}(e)},e)}});t((()=>{if(!m(C.value))return C.value=[{}],void i("update:value",C.value);C.value.length||C.value.push({})}));const{field:k}=c(),F=a();async function A(){if(!F.value)return;const e=await F.value.$table.validate(!0);return e?Object.values(e).map((e=>e.map(s("rule.message")))).join(","):""}return t((()=>{if(!r(k.value))return;const e=k.value.validator;k.value.validator=[{validator:A},...e?u(e):[]]})),()=>l("section",{class:"form-render__combination"},[j({onClick:N}),l(p,{ref:F,fieldList:x,tableConfig:g.value,tableData:C.value},null)])}}),n(v));export{b as TABLE_COMBINATION};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as l,computed as r,ref as t,onUnmounted as o,createVNode as a,mergeProps as n,unref as i}from"vue";import{arrayed as u,getStringWidth as d,widthAppend as s}from"../../../../../shared/utils/index.js";import{isVoidField as m}from"@formily/core";import{observe as f,autorun as v}from"@formily/reactive";import{connect as c,mapProps as p}from"@formily/vue";import{useDebounceFn as b}from"@vueuse/core";import{isString as h,isArray as y,isObject as _,isNumber as k,isFunction as g,uniq as F}from"lodash-es";import{NFormItem as I}from"naive-ui";import x from"../../../../annotation-edit/index.js";import"../../../index.js";import j from"../tooltipMessage.vue.js";import{InjectionFormGlobalProps as R,InjectionFormGlobalEmit as M,InjectionFormUUID as S,InjectionFormGraph as L,InjectionAnnotation as W,InjectionAnnotationShortcuts as O,InjectionFormColumnWidth as q}from"../../constants/index.js";import{useComplexOptionsSpan as w}from"../../hooks/useComplexOptions.js";import{validateMessageParser as C,editorUnescape as E}from"../../utils/index.js";import{dotEscape as K,createFieldAddressId as N}from"../../utils/schema.js";import{useFormField as P}from"../../hooks/useFormField.js";const A=c(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},isOptionChildField:Boolean,feedback:String,showFeedback:{type:Boolean,default:void 0},fieldItem:{type:Object}},setup(e,{slots:u,attrs:c}){const p=l(R),C=l(M),{field:A,fieldKey:B,fieldAddress:T}=P(),V=l(S),$=r((()=>K(`${V}-${T.value}`))),H=t(!1);if(m(A.value)&&y(e.suffixFields)){const r=l(L);o(f(r,b((()=>{m(A.value)&&y(e.suffixFields)&&(H.value=e.suffixFields.some((e=>{const l=A.value.form.query(e).take();return l&&Reflect.get(l,"required")})))}),100)))}else o(v((()=>{H.value=Reflect.get(A.value,"required")})));const U=l(W),z=r({get(){var l,r;return null!=(r=null==(l=U.value)?void 0:l[e.propertyKey])?r:""},set(l){U.value={property:e.propertyKey,value:l}}}),D=l(O);const G=r((()=>{var l;const r={color:null==(l=e.fieldItem)?void 0:l.labelColor};return _(c.labelStyle)&&Object.assign(r,c.labelStyle),r})),J=r((()=>U.value&&!1!==e.annotation)),Q=r((()=>e.label&&" "!==e.label)),X=r((()=>{let l=0;return J.value&&(l+=18),e.remark&&(l+=18),l})),Y=l(R,{}),Z=r((()=>{var l;const r=null==(l=e.fieldItem)?void 0:l.bordered;return null==r?Y.bordered:r})),ee=l("n-form",{}),le=r((()=>{var e,l,r,t;if("left"!==(null!=(l=c.labelPlacement)?l:null==(e=ee.props)?void 0:e.labelPlacement))return"";let o=null!=(t=c.labelWidth)?t:null==(r=ee.props)?void 0:r.labelWidth;return o&&"auto"!==o?(o=parseInt(o+""),isNaN(o)||!k(o)?"":o-12-X.value-(H.value?11:0)):""})),re=r((()=>g(e.labelRender)?"":h(e.label)?e.label:""));function te(){return Q.value?a("section",{class:"form-render__formItemLabel"},[a("span",{class:"form-render__formItemLabel--text",style:{marginRight:s(X.value),maxWidth:s(le.value)},title:re.value},[g(e.labelRender)?e.labelRender(e.label):e.label]),X.value?a("section",{class:"form-render__formItemLabel--operation"},[e.remark?a("div",{class:"form-render__formItemLabel--tooltip"},[a(j,{message:e.remark},null)]):null,J.value?a(x,{class:"form-render__formItemLabel--annotation",modelValue:z.value,"onUpdate:modelValue":e=>z.value=e,shortcuts:i(D)},null):null]):null]):null}const oe=r((()=>{let l=X.value;return H.value&&(l+=11),h(e.label)&&(l+=le.value||d(e.label)),l})),ae=l(q),{getSpan:ne}=w();function ie(){var l,r,t;const o="inner"===(null==(l=e.fieldItem)?void 0:l.childWidthMode)?e.span:ne(V,A.value.address,!1)+e.span;if("left"!==(null!=(t=c.labelPlacement)?t:null==(r=ee.props)?void 0:r.labelPlacement)||!i(ae)||!(null==p?void 0:p.autoWidth))return o;const a=16+ae.value;let n=o*a-16-oe.value;const u=k(null==p?void 0:p.autoWidth)?p.autoWidth:120;let d=o;for(;n<u&&d<12;)d++,n+=a;return d}function ue(){var l,r,t;const o=null==(l=e.fieldItem)?void 0:l.editor_title;return h(o)&&o?a("section",{style:"display:flex;flex-direction:column;gap:4px"},[null==(t=u.default)?void 0:t.call(u),a("div",{innerHTML:E(o)},null)]):null==(r=u.default)?void 0:r.call(u)}function de(){const e=[A.value.path+""];return A.value.form.query("*").forEach((l=>{(l.address+"").includes(A.value.address+"")&&((l.path+"").includes(A.value.path+"")||e.push(l.path+""))})),e}const se=r({get:()=>!(!(null==p?void 0:p.selectMode)||!y(null==p?void 0:p.selectedFields))&&p.selectedFields.includes(A.value.path+""),set(e){if(!y(null==p?void 0:p.selectedFields))return;let l=[...p.selectedFields];e?(l.push(...de()),l=F(l)):de().forEach((e=>{const r=l.indexOf(e);r>-1&&l.splice(r,1)})),null==C||C("update:selectedFields",l)}}),me=r((()=>(null==p?void 0:p.selectMode)&&!(A.value.parent&&"LINEBAR"!==A.value.parent.componentType)));function fe(){(null==p?void 0:p.selectMode)&&(se.value=!se.value)}const ve=r((()=>e.isOptionChildField?!!e.feedback&&" "!==e.feedback&&e.showFeedback:e.showFeedback));return()=>a(I,n({class:["form-render__formItem",{"form-render--no-border":!Z.value,"form-render--underline":"underline"===Z.value,"form-render__formItemMask":me.value,"form-render__formItemMask--selected":me.value&&se.value}],style:{"--form-item-column":ie()},showFeedback:ve.value,feedback:e.feedback,labelStyle:G.value},{id:$.value,uuid:V,onClick:fe,"widget-type":A.value.componentType,"field-key":K(B.value),"field-address":N(T.value),required:H.value}),{...u,default:ue,label:te})}}),p({title:"label"},((e,l)=>{const r=m(l)?void 0:u(l.selfErrors).length?function(e,l){if(!h(l.defined_error_msg)||!l.defined_error_msg)return e.map((e=>C(e,l))).join(",");return C(l.defined_error_msg,l)}(u(l.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:r,"validation-status":r?"error":void 0}})));export{A as FORM_ITEM};
1
+ import{defineComponent as e,inject as l,computed as t,ref as r,onUnmounted as o,createVNode as n,mergeProps as a,withModifiers as i,createTextVNode as u,unref as d}from"vue";import{arrayed as s,getStringWidth as m,widthAppend as f}from"../../../../../shared/utils/index.js";import{isVoidField as v}from"@formily/core";import{observe as c,autorun as p}from"@formily/reactive";import{connect as b,mapProps as h}from"@formily/vue";import{useDebounceFn as _}from"@vueuse/core";import{isString as y,isArray as g,isObject as I,isNumber as x,isFunction as k,uniq as F}from"lodash-es";import{NFormItem as R,NTooltip as j,NButton as M}from"naive-ui";import P from"../../../../annotation-edit/index.js";import"../../../index.js";import w from"../tooltipMessage.vue.js";import{InjectionFormGlobalProps as O,InjectionFormGlobalEmit as E,InjectionFormUUID as L,InjectionFormGraph as S,InjectionAnnotation as C,InjectionAnnotationShortcuts as T,InjectionFormColumnWidth as W}from"../../constants/index.js";import{useComplexOptionsSpan as N}from"../../hooks/useComplexOptions.js";import{validateMessageParser as U,editorUnescape as q}from"../../utils/index.js";import{dotEscape as A,createFieldAddressId as B}from"../../utils/schema.js";import{useFormField as K}from"../../hooks/useFormField.js";const D=b(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},isOptionChildField:Boolean,feedback:String,showFeedback:{type:Boolean,default:void 0},fieldItem:{type:Object}},setup(e,{slots:s,attrs:b}){const h=l(O),U=l(E),{field:D,fieldKey:G,fieldAddress:H}=K(),V=l(L),$=t((()=>A(`${V}-${H.value}`))),z=r(!1);if(v(D.value)&&g(e.suffixFields)){const t=l(S);o(c(t,_((()=>{v(D.value)&&g(e.suffixFields)&&(z.value=e.suffixFields.some((e=>{const l=D.value.form.query(e).take();return l&&Reflect.get(l,"required")})))}),100)))}else o(p((()=>{z.value=Reflect.get(D.value,"required")})));const Y=l(C),J=t({get(){var l,t;return null!=(t=null==(l=Y.value)?void 0:l[e.propertyKey])?t:""},set(l){Y.value={property:e.propertyKey,value:l}}}),Q=l(T);const X=t((()=>{var l;const t={color:null==(l=e.fieldItem)?void 0:l.labelColor};return I(b.labelStyle)&&Object.assign(t,b.labelStyle),t})),Z=t((()=>Y.value&&!1!==e.annotation)),ee=t((()=>{var l,t;return y(null==(l=e.fieldItem)?void 0:l.editor_title)&&e.fieldItem.editor_title&&"POPUP_ALERT"===(null==(t=e.fieldItem)?void 0:t.editor_title_mode)})),le=r(!1),te=t((()=>e.label&&" "!==e.label)),re=t((()=>{let l=0;return Z.value&&(l+=18),e.remark&&(l+=18),ee.value&&(l+=32),l})),oe=l(O,{}),ne=t((()=>{var l;const t=null==(l=e.fieldItem)?void 0:l.bordered;return null==t?oe.bordered:t})),ae=l("n-form",{}),ie=t((()=>{var e,l,t,r;if("left"!==(null!=(l=b.labelPlacement)?l:null==(e=ae.props)?void 0:e.labelPlacement))return"";let o=null!=(r=b.labelWidth)?r:null==(t=ae.props)?void 0:t.labelWidth;return o&&"auto"!==o?(o=parseInt(o+""),isNaN(o)||!x(o)?"":o-12-re.value-(z.value?11:0)):""})),ue=t((()=>k(e.labelRender)?"":y(e.label)?e.label:""));function de(){return te.value?n("section",{class:"form-render__formItemLabel"},[n("span",{class:"form-render__formItemLabel--text",style:{marginRight:f(re.value),maxWidth:f(ie.value)},title:ue.value},[k(e.labelRender)?e.labelRender(e.label):e.label]),re.value?n("section",{class:"form-render__formItemLabel--operation"},[e.remark?n("div",{class:"form-render__formItemLabel--tooltip"},[n(w,{message:e.remark},null)]):null,Z.value?n(P,{class:"form-render__formItemLabel--annotation",modelValue:J.value,"onUpdate:modelValue":e=>J.value=e,shortcuts:d(Q)},null):null,ee.value?n(j,{zIndex:3e3,raw:!0,showArrow:!1,trigger:"manual",placement:"top-start",show:le.value,contentStyle:"background-color:white;color:rgb(51, 54, 57);padding:8px;position:relative;"},{trigger:()=>n(M,{onClick:i((()=>le.value=!le.value),["stop","prev"]),text:!0,type:"primary"},{default:()=>[n("span",{style:"display:inline-block;margin-left:4px"},[u("提示")])]}),default:()=>{var l,t;return[n("div",{innerHTML:q(null!=(t=null==(l=e.fieldItem)?void 0:l.editor_title)?t:"")},null),n(M,{text:!0,onClick:()=>le.value=!le.value,style:"position:absolute;right:2px;top:2px;line-height:1;height:12px;transform:scaleY(0.9)"},{default:()=>[u("x")]})]}}):null]):null]):null}const se=t((()=>{let l=re.value;return z.value&&(l+=11),y(e.label)&&(l+=ie.value||m(e.label)),l})),me=l(W),{getSpan:fe}=N();function ve(){var l,t,r,o,n,a,i;const u="inner"===(null==(l=e.fieldItem)?void 0:l.childWidthMode)?e.span:fe(V,D.value.address,!1)+e.span;if("left"!==(null!=(r=b.labelPlacement)?r:null==(t=ae.props)?void 0:t.labelPlacement)||!d(me)||!(null==h?void 0:h.autoWidth)||"INPUT_GROUP"===(null==(n=null==(o=D.value.parent)?void 0:o.component)?void 0:n[0]))return u;if("INPUT_GROUP"===(null==(i=null==(a=D.value.parent)?void 0:a.component)?void 0:i[0]))return u;const s=16+me.value;let m=u*s-16-se.value;const f=x(null==h?void 0:h.autoWidth)?h.autoWidth:120;let v=u;for(;m<f&&v<12;)v++,m+=s;return v}function ce(){var l,t,r,o,a;const i=null==(l=e.fieldItem)?void 0:l.editor_title,u=!(null==(t=e.fieldItem)?void 0:t.editor_title_mode)||"EMBEDDED_FORM"===(null==(r=e.fieldItem)?void 0:r.editor_title_mode);return y(i)&&i&&u?n("section",{style:"display:flex;flex-direction:column;gap:4px"},[null==(a=s.default)?void 0:a.call(s),n("div",{innerHTML:q(i)},null)]):null==(o=s.default)?void 0:o.call(s)}function pe(){const e=[D.value.path+""];return D.value.form.query("*").forEach((l=>{(l.address+"").includes(D.value.address+"")&&((l.path+"").includes(D.value.path+"")||e.push(l.path+""))})),e}const be=t({get:()=>!(!(null==h?void 0:h.selectMode)||!g(null==h?void 0:h.selectedFields))&&h.selectedFields.includes(D.value.path+""),set(e){if(!g(null==h?void 0:h.selectedFields))return;let l=[...h.selectedFields];e?(l.push(...pe()),l=F(l)):pe().forEach((e=>{const t=l.indexOf(e);t>-1&&l.splice(t,1)})),null==U||U("update:selectedFields",l)}}),he=t((()=>(null==h?void 0:h.selectMode)&&!(D.value.parent&&"LINEBAR"!==D.value.parent.componentType)));function _e(){(null==h?void 0:h.selectMode)&&(be.value=!be.value)}const ye=t((()=>e.isOptionChildField?!!e.feedback&&" "!==e.feedback&&e.showFeedback:e.showFeedback));return()=>n(R,a({class:["form-render__formItem",{"form-render--no-border":!ne.value,"form-render--underline":"underline"===ne.value,"form-render__formItemMask":he.value,"form-render__formItemMask--selected":he.value&&be.value}],style:{"--form-item-column":ve()},showFeedback:ye.value,feedback:e.feedback,labelStyle:X.value},{id:$.value,uuid:V,onClick:_e,"widget-type":D.value.componentType,"field-key":A(G.value),"field-address":B(H.value),required:z.value}),{...s,default:ce,label:de})}}),h({title:"label"},((e,l)=>{const t=v(l)?void 0:s(l.selfErrors).length?function(e,l){if(!y(l.defined_error_msg)||!l.defined_error_msg)return e.map((e=>U(e,l))).join(",");return U(l.defined_error_msg,l)}(s(l.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:t,"validation-status":t?"error":void 0}})));export{D as FORM_ITEM};
@@ -1 +1 @@
1
- import{defineComponent as e,computed as o,openBlock as s,createBlock as r,unref as i,withCtx as t,createVNode as n,createElementVNode as a,createElementBlock as l,Fragment as m,renderList as p,toDisplayString as g}from"vue";import{HelpCircleOutline as f}from"@vicons/ionicons5";import{isString as u}from"lodash-es";import{NTooltip as c}from"naive-ui";const d={style:{display:"inline-flex","flex-direction":"column"}};var v=e({__name:"tooltipMessage",props:{message:String},setup(e){const v=e,x=o((()=>u(v.message)?v.message.split("<br>"):[]));return(e,o)=>(s(),r(i(c),{trigger:"hover"},{trigger:t((()=>[n(i(f))])),default:t((()=>[a("section",d,[(s(!0),l(m,null,p(i(x),(e=>(s(),l("span",{key:e},g(e),1)))),128))])])),_:1}))}});export{v as default};
1
+ import{defineComponent as e,computed as s,openBlock as o,createBlock as r,unref as t,withCtx as i,renderSlot as n,createVNode as l,createElementVNode as a,createElementBlock as m,Fragment as p,renderList as g,toDisplayString as f}from"vue";import{HelpCircleOutline as u}from"@vicons/ionicons5";import{isString as c}from"lodash-es";import{NTooltip as d}from"naive-ui";const v={style:{display:"inline-flex","flex-direction":"column"}};var x=e({__name:"tooltipMessage",props:{message:String},setup(e){const x=e,y=s((()=>c(x.message)?x.message.split("<br>"):[]));return(e,s)=>(o(),r(t(d),{trigger:"hover"},{trigger:i((()=>[n(e.$slots,"trigger",{},(()=>[l(t(u))]))])),default:i((()=>[a("section",v,[(o(!0),m(p,null,g(t(y),(e=>(o(),m("span",{key:e},f(e),1)))),128))])])),_:3}))}});export{x as default};
@@ -1 +1 @@
1
- import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as l}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as c}from"./useFormValidator.js";import{transformDateFormat as d}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...i(o,["wordbook","autograph"])})}function u(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function f(e){return"1"===e||!0===e}function x(x,_){const{createValidatorSchema:h}=c(),b=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,beforeSetValue:null==_?void 0:_.beforeSetValue,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=h(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},v=e=>{var o,t,n,l,s,a,p,c,d,x,_,h,v,g;const y=b(e);e.urlConfig?u(y,e):e.autograph&&m(y,e);const w=!!e.__multiple,C=f(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=f(null!=(l=null==(n=e.componentProps)?void 0:n.selectAll)?l:e.selectAll),A=f(null!=(a=null==(s=e.componentProps)?void 0:s.shouldSave)?a:e.save_free_entry),E=f(null!=(c=null==(p=e.componentProps)?void 0:p.allowCreate)?c:e.free_entry),j=null!=(x=null==(d=e.componentProps)?void 0:d.showField)?x:e.show_key,k=null!=(h=null==(_=e.componentProps)?void 0:_.options)?h:e.option,N=null!=(g=r(e.multi_select_value))?g:null==(v=e.componentProps)?void 0:v.maxTagCount;return Object.assign(y["x-component-props"],{multiple:w,options:k,allowModify:C,allowCreate:E||C,shouldSave:A,showField:j,maxTagCount:N,selectAll:O,...i(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},g=e=>{var o,t;const n=b(e),i=null!=(t=null==(o=e.componentProps)?void 0:o.selectAll)?t:e.selectAll;return Object.assign(n["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode,vertical:e.__vertical,selectAll:"1"===i||!0===i}),e.urlConfig?u(n,e):e.autograph&&m(n,e),n},y=e=>{const t=b(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},w=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{linebarTextDirection:e.linebarTextDirection,linebarDirection:e.linebarDirection,linebarWidth:e.linebarWidth,disabled:"1"===e.is_not_fold,id:p(e.val_key),show:"0"!==e.is_show,remark:e.remark},"x-content":e.slots}),C=new Map([["LINEBAR",w],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=b(e);return Object.assign(o["x-component-props"],{...i(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=b(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=b(e),{decimal_length:t,validate:n,allowSlash:i}=e;return!0!==i&&"1"!==i||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:r(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",v],["REMOTE_SEARCH",v],["DATE",e=>{const o=b(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:d(e.date_format),validate:e.validate}),o}],["TIME",e=>{const o=b(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:d(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=b(e);return Object.assign(o["x-component-props"],{...i(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=b(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=b(e);return o.type="array","table"===e.displayMode?o["x-component"]="TABLE_COMBINATION":!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,minGroupNum:e.minGroupNum,showLabel:"1"!==e.hide_title,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",g],["CHECKBOX",g],["SWITCH",e=>{const o=b(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=b(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=b(e);Array.isArray(e.properties)&&l("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?k(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],i(e,["wrapperStyle","display"])),o}]]),O=e=>{if(e.suffixConfig)return A(e);return(C.get(e.html_type)||y)(e)},A=o=>{if(!o.suffixConfig&&!o.prefixConfig)return O(o);const t=o.suffixConfig?e(o.suffixConfig):[],n=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"}))),{...o,is_show:"1",hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...t.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"})))],i=b(o),r=n.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(i,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...i["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:k(n)}),i},{FieldNormalizeWaterfallHook:E,FieldListNormalizeWaterfallHook:j}=s();function k(o,i={column:9999}){let r=null;const l=j.call(t(o),i).reduce(((e,o,n)=>{var l;const a=null==(l=(o=E.call(o,i)).validate)?void 0:l.obj_type;return a&&x&&x.collect(a,t(o)),"LINEBAR"===o.html_type?(e[p(o)]=s(w(o),n),r=e[p(o)].properties={}):r?r[p(o)]=s(O(o),n):(r=null,e[p(o)]=s(O(o),n)),e}),{});return i.linebarAutoHidden&&Object.values(l).forEach((e=>{if("LINEBAR"!==e["x-component"])return;e["x-reactions"]?e["x-reactions"]=n(e["x-reactions"]):e["x-reactions"]=[];const o=Object.keys(e.properties||{}).map((o=>`${e.name}.${o}#selfDisplay`));e["x-reactions"].push({dependencies:o,fulfill:{state:{visible:"{{hasVisible($deps)}}"}}})})),l;function s(e,o){return e["x-index"]=o,e["x-decorator-props"]={_index:o,...e["x-decorator-props"]},e}function p(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:k}}export{x as useFieldListAdaptor};
1
+ import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as l}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{traverseSchema as a,fieldKeyEscape as p,createLinebarId as c}from"../utils/schema.js";import{useFormValidator as d}from"./useFormValidator.js";import{transformDateFormat as m}from"../utils/business.js";function u(e,o){Object.assign(e["x-component-props"],{...i(o,["wordbook","autograph"])})}function f(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function x(e){return"1"===e||!0===e}function _(n,_){const{createValidatorSchema:b}=d(),v=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,beforeSetValue:null==_?void 0:_.beforeSetValue,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=b(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},g=e=>{var o,t,n,l,s,a,p,c,d,m,_,h,b,g;const y=v(e);e.urlConfig?f(y,e):e.autograph&&u(y,e);const w=!!e.__multiple,C=x(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=x(null!=(l=null==(n=e.componentProps)?void 0:n.selectAll)?l:e.selectAll),A=x(null!=(a=null==(s=e.componentProps)?void 0:s.shouldSave)?a:e.save_free_entry),E=x(null!=(c=null==(p=e.componentProps)?void 0:p.allowCreate)?c:e.free_entry),j=null!=(m=null==(d=e.componentProps)?void 0:d.showField)?m:e.show_key,k=null!=(h=null==(_=e.componentProps)?void 0:_.options)?h:e.option,N=null!=(g=r(e.multi_select_value))?g:null==(b=e.componentProps)?void 0:b.maxTagCount;return Object.assign(y["x-component-props"],{multiple:w,options:k,allowModify:C,allowCreate:E||C,shouldSave:A,showField:j,maxTagCount:N,selectAll:O,...i(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},y=e=>{var o,t;const n=v(e),i=null!=(t=null==(o=e.componentProps)?void 0:o.selectAll)?t:e.selectAll;return Object.assign(n["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode,vertical:e.__vertical,selectAll:"1"===i||!0===i}),e.urlConfig?f(n,e):e.autograph&&u(n,e),n},w=e=>{const t=v(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},C=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{linebarTextDirection:e.linebarTextDirection,linebarDirection:e.linebarDirection,linebarWidth:e.linebarWidth,disabled:"1"===e.is_not_fold,id:c(e.val_key),show:"0"!==e.is_show,remark:e.remark},"x-content":e.slots}),O=new Map([["LINEBAR",C],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=v(e);return Object.assign(o["x-component-props"],{...i(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=v(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=v(e),{decimal_length:t,validate:n,allowSlash:i}=e;return!0!==i&&"1"!==i||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:r(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",g],["REMOTE_SEARCH",g],["DATE",e=>{const o=v(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["TIME",e=>{const o=v(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=v(e);return Object.assign(o["x-component-props"],{...i(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=v(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=v(e);return o.type="array","table"===e.displayMode?o["x-component"]="TABLE_COMBINATION":!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,minGroupNum:e.minGroupNum,showLabel:"1"!==e.hide_title,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",y],["CHECKBOX",y],["SWITCH",e=>{const o=v(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=v(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=v(e);Array.isArray(e.properties)&&l("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?N(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],i(e,["wrapperStyle","display"])),o}]]),A=e=>{if(e.suffixConfig)return E(e);return(O.get(e.html_type)||w)(e)},E=o=>{if(!o.suffixConfig&&!o.prefixConfig)return A(o);const t=o.suffixConfig?e(o.suffixConfig):[],n=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"}))),{...o,is_show:"1",hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...t.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"})))],i=v(o),r=n.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(i,{type:"void",name:p(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...i["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:N(n)}),i},{FieldNormalizeWaterfallHook:j,FieldListNormalizeWaterfallHook:k}=s();function N(o,i={column:9999}){let r=null;const l=k.call(t(o),i).reduce(((e,o,l)=>{var a;const p=null==(a=(o=j.call(o,i)).validate)?void 0:a.obj_type;return p&&n&&n.collect(p,t(o)),"LINEBAR"===o.html_type?(e[c(o)]=s(C(o),l),r=e[c(o)].properties={}):r?r[c(o)]=s(A(o),l):(r=null,e[c(o)]=s(A(o),l)),e}),{});return i.linebarAutoHidden&&Object.values(l).forEach((e=>{"LINEBAR"===e["x-component"]&&h(e)})),a({properties:l,"x-root":!0},((e,o)=>{"INPUT_GROUP"===e["x-component"]&&h(e,!!o&&!o["x-root"])})),l;function s(e,o){return e["x-index"]=o,e["x-decorator-props"]={_index:o,...e["x-decorator-props"]},e}function c(o){return o.suffixConfig?p([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:N}}function h(e,o=!1){e["x-reactions"]?e["x-reactions"]=n(e["x-reactions"]):e["x-reactions"]=[];const t=Object.keys(e.properties||{}).map((t=>`${o?"*.":""}${e.name}.${t}#selfDisplay`));e["x-reactions"].push({dependencies:t,fulfill:{state:{visible:'{{hasVisible($deps) && $self.selfDisplay==="visible"}}'}}})}export{_ as useFieldListAdaptor};
@@ -1 +1 @@
1
- import{arrayed as e}from"../../../../shared/utils/index.js";import{once as a,isNumber as i,isString as m}from"lodash-es";import"vue";import{registerValidateLocale as r,registerValidateRules as s}from"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import{isFunction as l}from"@vueuse/core";import"naive-ui";import{isIdCard as u}from"../utils/business.js";function n(){const a=new Map([["mobile",({validate:e})=>({format:"phone",message:null==e?void 0:e.message})],["integer",({validate:e})=>({format:"integer",message:null==e?void 0:e.message})],["number",({validate:e})=>({format:"number",message:null==e?void 0:e.message})],["id_card",({validate:e})=>({validator(a){var i;if(null!=a&&""!==a)return m(a)&&u(a)?void 0:null!=(i=null==e?void 0:e.message)?i:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:a,regular_error_tip:i})=>({pattern:a||(null==e?void 0:e.regular_expression)||"",message:i||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),i={triggerType:"onBlur"};return{createValidatorSchema:function(m){const r=[],{validate:{vali_obj:s,max_length:u,min_length:n,message:o,max_value:t,min_value:g,decimal_length:v}={},validator:d}=m;if(d&&e(d).forEach((e=>{l(e)&&r.push({validator:a=>e(a,m)})})),u&&r.push({max:u,message:o}),n&&r.push({min:n,message:o}),t&&r.push({maximum:t,message:o}),g&&r.push({minimum:g,message:o}),null!=v&&r.push(((e,a)=>{const i=null!=a?a:`小数位数最多${e}位`;return{validator(a){var m;return(null==(m=String(a).split(".")[1])?void 0:m.length)>e?i:""}}})(+v,o)),s){const e=a.get(s)||(({validate:e})=>({format:s,message:null==e?void 0:e.message}));r.push(Object.assign({},i,e(m)))}return r}}}const o=a((()=>{r({"zh-CN":{required:"${alias||name}为必填"}}),s({maximum:(e,a)=>i(Number(a.maximum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e>Number(a.maximum)&&a.message||""):"",minimum:(e,a)=>i(Number(a.minimum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e<Number(a.minimum)&&a.message||""):""})}));export{n as useFormValidator,o as validateMessageLocale};
1
+ import{arrayed as e}from"../../../../shared/utils/index.js";import{once as a,isNumber as i,isString as m}from"lodash-es";import"vue";import{registerValidateLocale as r,registerValidateRules as s}from"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import{isFunction as l}from"@vueuse/core";import"naive-ui";import{isIdCard as u}from"../utils/business.js";function n(){const a=new Map([["mobile",({validate:e})=>({format:"phone",message:null==e?void 0:e.message})],["integer",({validate:e})=>({format:"integer",message:null==e?void 0:e.message})],["number",({validate:e})=>({format:"number",message:null==e?void 0:e.message})],["id_card",({validate:e})=>({validator(a){var i;if(null!=a&&""!==a)return m(a)&&u(a)?void 0:null!=(i=null==e?void 0:e.message)?i:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:a,regular_error_tip:i})=>({pattern:a||(null==e?void 0:e.regular_expression)||"",message:i||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),i={triggerType:"onBlur"};return{createValidatorSchema:function(m){const r=[],{validate:{vali_obj:s,max_length:u,min_length:n,message:o,max_value:t,min_value:g,decimal_length:v}={},validator:d}=m;if(d&&e(d).forEach((e=>{l(e)&&r.push({validator:(a,i,r)=>e(a,m,r)})})),u&&r.push({max:u,message:o}),n&&r.push({min:n,message:o}),t&&r.push({maximum:t,message:o}),g&&r.push({minimum:g,message:o}),null!=v&&r.push(((e,a)=>{const i=null!=a?a:`小数位数最多${e}位`;return{validator(a){var m;return(null==(m=String(a).split(".")[1])?void 0:m.length)>e?i:""}}})(+v,o)),s){const e=a.get(s)||(({validate:e})=>({format:s,message:null==e?void 0:e.message}));r.push(Object.assign({},i,e(m)))}return r}}}const o=a((()=>{r({"zh-CN":{required:"${alias||name}为必填"}}),s({maximum:(e,a)=>i(Number(a.maximum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e>Number(a.maximum)&&a.message||""):"",minimum:(e,a)=>i(Number(a.minimum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e<Number(a.minimum)&&a.message||""):""})}));export{n as useFormValidator,o as validateMessageLocale};
@@ -1,5 +1,6 @@
1
1
  import { FormRequestDefine } from '../../../../shared/hooks';
2
2
  import { AnyObject, ArrayAble, LowCodeTypes } from '../../../../shared/types';
3
+ import { Field } from '@formily/core';
3
4
  import { SchemaEffectTypes, SchemaTypes } from '@formily/vue';
4
5
  import { VNode } from 'vue';
5
6
  import { DependKeyType, FormCommonState } from '../../../../components/form-render';
@@ -130,6 +131,7 @@ export type FieldItem = {
130
131
  bordered: boolean | string;
131
132
  displayMode: 'table' | 'form';
132
133
  editor_title: string;
134
+ editor_title_mode: 'EMBEDDED_FORM' | 'HOVER_TOOLTIP' | 'POPUP_ALERT';
133
135
  linebarWidth: string;
134
136
  linebarDirection: 'horizontal' | 'vertical';
135
137
  linebarTextDirection: 'horizontal' | 'vertical';
@@ -158,7 +160,7 @@ export type FieldItem = {
158
160
  * @param fieldItem 配置参数
159
161
  * @return {void|string} 返回校验信息
160
162
  */
161
- validator: (value: unknown, fieldItem: FieldItem) => void | string;
163
+ validator: (value: unknown, fieldItem: FieldItem, field: Field) => void | string;
162
164
  reactions: ArrayAble<ReactionType>;
163
165
  [key: string]: any;
164
166
  }>;
@@ -15,7 +15,7 @@ export interface FieldVisitorContext {
15
15
  insertAfter(f: FieldItem | FieldItem[]): void;
16
16
  }
17
17
  export type FieldVisitor = Record<string, (context: FieldVisitorContext) => void>;
18
- export type AgeContext = Record<'age' | 'day' | 'month' | 'year' | 'hours', number>;
18
+ export type AgeContext = Record<'age' | 'day' | 'month' | 'year' | 'hours' | 'minutes', number>;
19
19
  export type IdCardParseInfo = Record<'sex' | 'birthday', string> & AgeContext;
20
20
  export type FormRenderExpose = {
21
21
  formModel: Form;
@@ -1 +1 @@
1
- import{differenceInDays as t,differenceInMonths as e,differenceInYears as n,differenceInHours as a,format as r}from"date-fns";import{isString as s}from"lodash-es";import{FIELD_AGE_UNIT as o,FIELD_SEX_VALUE as u}from"../constants/index.js";function d(t){return((t,e,n)=>{const a={},r=1-t.substr(e,1)%2;a.sex=1===r?u.FEMALE:u.MALE;const s=(2==n?"19":"")+t.substr(6,n),o=t.substr(6+n,2),d=t.substr(8+n,2);a.birthday=s+"-"+o+"-"+d+" 00:00";const c=new Date,i=c.getMonth()+1<parseInt(o,10)||c.getMonth()+1==parseInt(o,10)&&c.getDate()<parseInt(d,10)?1:0;return Object.assign(a,g(a.birthday)),a.age=a.year=c.getFullYear()-parseInt(s,10)-i,a})(t,15==t.length?14:16,15==t.length?2:4)}function c(t=""){if(!s(t)||!t)return"date";const e=t.includes("y"),n=t.includes("M"),a=t.includes("d"),r=t.includes("H"),o=t.includes("m"),u=t.includes("s");return e||n||a||!(r||o||u)?r||o||u?"datetime":!e||n||a?!e&&n&&a?"month":"date":"year":"time"}const i=/^\d{6}(((19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}(\d|x|X))|(\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}))$/,h=/^[1-9]\d{5}\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}$/;function f(t){return i.test(t)&&function(t){if(!t||18!==t.length)return!1;const e=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let n=0;for(let a=0;a<17;a++)n+=+t[a]*e[a];return t.charAt(17).toUpperCase()===["1","0","X","9","8","7","6","5","4","3","2"][n%11]}(t)||h.test(t)}function l(t){return/^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test(t)}function g(r){const s={},o=new Date,u=new Date(r);return s.day=t(o,u),s.month=e(o,u),s.age=s.year=n(o,u),s.hours=a(o,u),s}function m(t,e,n="yyyy-MM-dd HH:mm"){var a;const s=new Date,u={[o.MINUTE]:()=>d(s,"Minutes",t),[o.HOUR]:()=>d(s,"Hours",t),[o.DAY]:()=>d(s,"Date",t),[o.WEEK]:()=>d(s,"Date",7*t),[o.MONTH]:()=>d(s,"Month",t),[o.YEAR]:()=>d(s,"FullYear",t)};return null==(a=u[e])||a.call(u),r(function(t,e){const n=[{[o.DAY]:"Date",[o.WEEK]:"Date",[o.MONTH]:"Date",[o.YEAR]:"Date"},{[o.HOUR]:"Hours"},{[o.MINUTE]:"Minutes"}],a=n.findIndex((t=>Reflect.has(t,e)));~a&&n.slice(a+1).forEach((e=>{Object.values(e).forEach((e=>{t[`set${e}`]("Date"===e?1:0)}))}));return t.setSeconds(0),t}(s,e),n);function d(t,e,n){t[`set${e}`](t[`get${e}`]()-n)}}function M(t){const e=t.hours<24?{ageUnit:o.HOUR,age:Math.max(t.hours,1)}:t.day<30?{ageUnit:o.DAY,age:Math.max(t.day,1)}:t.day<365?{ageUnit:o.MONTH,age:Math.max(t.month,1)}:{ageUnit:o.YEAR,age:Math.max(t.year,1)};return e.age=Math.max(e.age,1),e}const D=/^(\d{4})-?(\d{2})-?(\d{2})?\s?(\d{2})?:?(\d{2})?:?(\d{2})?$/;function y(t){if(!s(t))return;const e=t.match(D);if(!e)return;const[,n,a,r,o,u,d]=e;return new Date(`${n}-${a}-${r||"01"} ${o||"00"}:${u||"00"}:${d||"00"}`)}export{y as businessDateParser,f as isIdCard,l as isMobile,m as parseAge2Birthday,M as parseAgeFromContext,g as parseBirthday,d as parseIdCard,c as transformDateFormat};
1
+ import{format as t,differenceInDays as e,differenceInMonths as n,differenceInYears as r,differenceInHours as s,differenceInMinutes as a}from"date-fns";import{isString as u}from"lodash-es";import{FIELD_AGE_UNIT as o,FIELD_SEX_VALUE as d}from"../constants/index.js";function i(t){return((t,e,n)=>{const r={},s=1-t.substr(e,1)%2;r.sex=1===s?d.FEMALE:d.MALE;const a=(2==n?"19":"")+t.substr(6,n),u=t.substr(6+n,2),o=t.substr(8+n,2);r.birthday=a+"-"+u+"-"+o+" 00:00";const i=new Date,c=i.getMonth()+1<parseInt(u,10)||i.getMonth()+1==parseInt(u,10)&&i.getDate()<parseInt(o,10)?1:0;return Object.assign(r,m(r.birthday)),r.age=r.year=i.getFullYear()-parseInt(a,10)-c,r})(t,15==t.length?14:16,15==t.length?2:4)}function c(t=""){if(!u(t)||!t)return"date";const e=t.includes("y"),n=t.includes("M"),r=t.includes("d"),s=t.includes("H"),a=t.includes("m"),o=t.includes("s");return e||n||r||!(s||a||o)?s||a||o?"datetime":!e||n||r?!e&&n&&r?"month":"date":"year":"time"}const l=/^\d{6}(((19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}(\d|x|X))|(\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}))$/,f=/^[1-9]\d{5}\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}$/;function g(t){return l.test(t)&&function(t){if(!t||18!==t.length)return!1;const e=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let n=0;for(let r=0;r<17;r++)n+=+t[r]*e[r];return t.charAt(17).toUpperCase()===["1","0","X","9","8","7","6","5","4","3","2"][n%11]}(t)||f.test(t)}function h(t){return/^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test(t)}function m(t){const u={},o=new Date,d=new Date(t),i=[["day",e],["month",n],["year",r],["hours",s],["minutes",a]];return Object.defineProperties(u,i.reduce(((t,[e,n])=>(t[e]={get:(()=>{let t=null;return()=>(null===t&&(t=n(o,d)),t)})()},t)),{})),u}function M(e,n,r="yyyy-MM-dd HH:mm"){var s;const a=new Date,u={[o.MINUTE]:()=>d(a,"Minutes",e),[o.HOUR]:()=>d(a,"Hours",e),[o.DAY]:()=>d(a,"Date",e),[o.WEEK]:()=>d(a,"Date",7*e),[o.MONTH]:()=>d(a,"Month",e),[o.YEAR]:()=>d(a,"FullYear",e)};return null==(s=u[n])||s.call(u),t(function(t,e){const n=[{[o.DAY]:"Date",[o.WEEK]:"Date",[o.MONTH]:"Date",[o.YEAR]:"Date"},{[o.HOUR]:"Hours"},{[o.MINUTE]:"Minutes"}],r=n.findIndex((t=>Reflect.has(t,e)));~r&&n.slice(r+1).forEach((e=>{Object.values(e).forEach((e=>{t[`set${e}`]("Date"===e?1:0)}))}));return t.setSeconds(0),t}(a,n),r);function d(t,e,n){t[`set${e}`](t[`get${e}`]()-n)}}function D(t){const e=t.minutes<60?{ageUnit:o.MINUTE,age:t.minutes}:t.hours<24?{ageUnit:o.HOUR,age:t.hours}:t.day<30?{ageUnit:o.DAY,age:t.day}:t.day<365?{ageUnit:o.MONTH,age:t.month}:{ageUnit:o.YEAR,age:t.year};return e.age=Math.max(e.age,1),e}const y=/^(\d{4})-?(\d{2})-?(\d{2})?\s?(\d{2})?:?(\d{2})?:?(\d{2})?$/;function E(t){if(!u(t))return;const e=t.match(y);if(!e)return;const[,n,r,s,a,o,d]=e;return new Date(`${n}-${r}-${s||"01"} ${a||"00"}:${o||"00"}:${d||"00"}`)}export{E as businessDateParser,g as isIdCard,h as isMobile,M as parseAge2Birthday,D as parseAgeFromContext,m as parseBirthday,i as parseIdCard,c as transformDateFormat};
@@ -3,7 +3,7 @@ import { GeneralField } from '@formily/core';
3
3
  import { ISchema } from '@formily/json-schema/esm/types';
4
4
  import { Ref } from 'vue';
5
5
  import { DependKeyType, FieldItem, ObjectDependKey } from '../../../../components/form-render';
6
- export declare function traverseSchema(schema: ISchema, handler: (_s: ISchema) => void): void;
6
+ export declare function traverseSchema(schema: ISchema, handler: (_s: ISchema, parent?: ISchema) => void, parent?: ISchema): void;
7
7
  export declare function fieldKeyEscape(fieldList: FieldItem[]): string;
8
8
  export declare function dotEscape(id: string): string;
9
9
  export declare function createFieldAddressId(id: string): string;
@@ -1 +1 @@
1
- import{isField as e}from"@formily/core";import{isObject as t,isPromise as r}from"@vue/shared";import{isString as n,isArray as o,isFunction as u,noop as a}from"lodash-es";function i(e,r){r(e),t(e.properties)&&Object.values(e.properties).forEach((e=>{i(e,r)}))}function c(e){return l(e.map((e=>e.val_key)).join("-"))}function l(e){return e.replace(/[.]/g,"-")}function f(e){return l(`address-${e}`)}function s(e){return l(`id-${e}`)}function p(e,r){e&&function(){const r=new Map;o(e)?e.forEach((e=>{var n;t(e)?r.set(e.paramName,{key:null!=(n=e.paramValue)?n:e.paramName,dependKey:e}):r.set(e,e)})):t(e)?Object.entries(e).forEach((([e,t])=>{r.set(e,t)})):n(e)&&r.set(e,e);return r}().forEach(((e,t)=>{if(n(e))return r(t,e);r(t,e.key,e.dependKey)}))}function d(e,t){let r=null;for(const o of t){if(o.val_key===e){n(o)&&(r=null);break}n(o)&&(r=o.val_key)}return r;function n(e){return"LINEBAR"===e.html_type}}function v(t,n){const o={...t};return e(n)&&Object.assign(o,{"onUpdate:value"(e){var t;const o=null==(t=n.decoratorProps)?void 0:t.beforeSetValue;if(u(o)){const t=o(n.path.toString(),e,{field:n,oldValue:n.value});return r(t)?t.then((e=>n.setValue(e)),a):n.setValue(t)}n.setValue(e)}}),o}function m(t,r){const n={...t};return e(r)&&(n.key=void 0===n.value?0:1),n}function y(t,r){const n={...t};return e(r)&&(n.onClear=()=>r.visited=!0),n}function h(e){return{type:"object",properties:e}}function k(t,r){return(...n)=>(e(t.value)&&(t.value.visited=!0),u(r)?r(...n):void 0)}export{y as assignClearBindVisited,v as assignUpdateValue,m as assignValueBindKey,f as createFieldAddressId,s as createLinebarId,h as createObjSchema,k as createVisitedSetter,l as dotEscape,c as fieldKeyEscape,d as getParentLinebar,p as traverseDependKey,i as traverseSchema};
1
+ import{isField as e}from"@formily/core";import{isObject as t,isPromise as r}from"@vue/shared";import{isString as n,isArray as o,isFunction as u,noop as a}from"lodash-es";function i(e,r,n){r(e,n),t(e.properties)&&Object.values(e.properties).forEach((t=>{i(t,r,e)}))}function c(e){return l(e.map((e=>e.val_key)).join("-"))}function l(e){return e.replace(/[.]/g,"-")}function f(e){return l(`address-${e}`)}function s(e){return l(`id-${e}`)}function p(e,r){e&&function(){const r=new Map;o(e)?e.forEach((e=>{var n;t(e)?r.set(e.paramName,{key:null!=(n=e.paramValue)?n:e.paramName,dependKey:e}):r.set(e,e)})):t(e)?Object.entries(e).forEach((([e,t])=>{r.set(e,t)})):n(e)&&r.set(e,e);return r}().forEach(((e,t)=>{if(n(e))return r(t,e);r(t,e.key,e.dependKey)}))}function d(e,t){let r=null;for(const o of t){if(o.val_key===e){n(o)&&(r=null);break}n(o)&&(r=o.val_key)}return r;function n(e){return"LINEBAR"===e.html_type}}function v(t,n){const o={...t};return e(n)&&Object.assign(o,{"onUpdate:value"(e){var t;const o=null==(t=n.decoratorProps)?void 0:t.beforeSetValue;if(u(o)){const t=o(n.path.toString(),e,{field:n,oldValue:n.value});return r(t)?t.then((e=>n.setValue(e)),a):n.setValue(t)}n.setValue(e)}}),o}function m(t,r){const n={...t};return e(r)&&(n.key=void 0===n.value?0:1),n}function y(t,r){const n={...t};return e(r)&&(n.onClear=()=>r.visited=!0),n}function h(e){return{type:"object",properties:e}}function k(t,r){return(...n)=>(e(t.value)&&(t.value.visited=!0),u(r)?r(...n):void 0)}export{y as assignClearBindVisited,v as assignUpdateValue,m as assignValueBindKey,f as createFieldAddressId,s as createLinebarId,h as createObjSchema,k as createVisitedSetter,l as dotEscape,c as fieldKeyEscape,d as getParentLinebar,p as traverseDependKey,i as traverseSchema};