cnhis-design-vue 3.1.14 → 3.1.15-beta.10

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 (221) hide show
  1. package/es/packages/annotation-edit/src/AnnotationEdit.js +2 -1
  2. package/es/packages/big-table/index.d.ts +8 -11
  3. package/es/packages/big-table/src/BigTable.vue.d.ts +24 -19
  4. package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +17 -11
  5. package/es/packages/big-table/src/bigTableProps.d.ts +4 -3
  6. package/es/packages/big-table/src/bigTableProps.js +1 -1
  7. package/es/packages/big-table/src/components/edit-form/edit-date.js +13 -4
  8. package/es/packages/big-table/src/components/edit-form/edit-select.js +2 -1
  9. package/es/packages/big-table/src/components/edit-form/edit-separate.js +18 -9
  10. package/es/packages/big-table/src/components/edit-form/edit-separate.vue.d.ts +3 -1
  11. package/es/packages/big-table/src/hooks/useAnnotation.d.ts +4 -0
  12. package/es/packages/big-table/src/hooks/useAnnotation.js +21 -0
  13. package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +51 -36
  14. package/es/packages/big-table/src/hooks/useEdit.d.ts +3 -1
  15. package/es/packages/big-table/src/hooks/useFormat.js +8 -1
  16. package/es/packages/big-table/style/index.css +38 -1
  17. package/es/packages/bpmn-workflow/src/BpmnWorkflow.js +2 -2
  18. package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/BpmnRenderer.js +8 -8
  19. package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomContextPadProvider.js +2 -2
  20. package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomPalette.js +1 -1
  21. package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomRenderer.js +4 -3
  22. package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomRules.js +2 -2
  23. package/es/packages/bpmn-workflow/src/custom/customModeler/index.js +1 -1
  24. package/es/packages/bpmn-workflow/src/custom/customOtherModule/CustomPopupMenu.js +2 -2
  25. package/es/packages/bpmn-workflow/src/custom/customOtherModule/zoomScroll.js +3 -3
  26. package/es/packages/button-print/src/utils/print.d.ts +1 -1
  27. package/es/packages/button-print/src/utils/print.js +1 -1
  28. package/es/packages/fabric-chart/index.d.ts +1 -0
  29. package/es/packages/fabric-chart/src/FabricChart.js +17 -17
  30. package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +12 -10
  31. package/es/packages/fabric-chart/src/hooks/useCenter.js +35 -73
  32. package/es/packages/fabric-chart/src/hooks/useCumputedPoint.js +4 -2
  33. package/es/packages/fabric-chart/src/hooks/useDraw.js +1 -0
  34. package/es/packages/fabric-chart/src/hooks/useLeft.js +5 -4
  35. package/es/packages/field-set/index.d.ts +4365 -0
  36. package/es/packages/field-set/src/FieldSet.js +53 -54
  37. package/es/packages/field-set/src/FieldSet.vue.d.ts +4365 -0
  38. package/es/packages/field-set/style/index.css +0 -9
  39. package/es/packages/form-config/index.d.ts +12111 -0
  40. package/es/packages/form-config/index.js +10 -0
  41. package/es/packages/form-config/src/FormConfig.js +113 -0
  42. package/es/packages/form-config/src/FormConfig.vue.d.ts +12113 -0
  43. package/es/packages/form-config/src/components/FormConfigCreator.js +97 -0
  44. package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +5094 -0
  45. package/es/packages/form-config/src/components/FormConfigEdit.js +81 -0
  46. package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +3591 -0
  47. package/es/packages/form-config/src/constants/index.d.ts +28 -0
  48. package/es/packages/form-config/src/constants/index.js +28 -0
  49. package/es/packages/form-config/src/hooks/index.d.ts +2 -0
  50. package/es/packages/form-config/src/hooks/index.js +2 -0
  51. package/es/packages/form-config/src/hooks/useConfigurationField.d.ts +6 -0
  52. package/es/packages/form-config/src/hooks/useConfigurationField.js +103 -0
  53. package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +5 -0
  54. package/es/packages/form-config/src/hooks/usePresetRenderer.js +117 -0
  55. package/es/packages/form-config/src/hooks/useSortable.d.ts +11 -0
  56. package/es/packages/form-config/src/hooks/useSortable.js +31 -0
  57. package/es/packages/form-config/src/types/index.d.ts +18 -0
  58. package/es/packages/form-config/src/types/index.js +1 -0
  59. package/es/packages/form-config/style/index.css +108 -0
  60. package/es/packages/form-render/index.d.ts +24 -3
  61. package/es/packages/form-render/src/FormRender.js +25 -6
  62. package/es/packages/form-render/src/FormRender.vue.d.ts +24 -3
  63. package/es/packages/form-render/src/components/renderer/cascader.js +7 -7
  64. package/es/packages/form-render/src/components/renderer/combination/hooks/useDeepValidate.d.ts +5 -0
  65. package/es/packages/form-render/src/components/renderer/combination/hooks/useDeepValidate.js +32 -0
  66. package/es/packages/form-render/src/components/renderer/{combination.d.ts → combination/index.d.ts} +7 -1
  67. package/es/packages/form-render/src/components/renderer/combination/index.js +157 -0
  68. package/es/packages/form-render/src/components/renderer/complex.d.ts +2 -0
  69. package/es/packages/form-render/src/components/renderer/complex.js +2 -5
  70. package/es/packages/form-render/src/components/renderer/date.d.ts +29 -0
  71. package/es/packages/form-render/src/components/renderer/date.js +63 -56
  72. package/es/packages/form-render/src/components/renderer/formItem.js +3 -3
  73. package/es/packages/form-render/src/components/renderer/index.js +1 -1
  74. package/es/packages/form-render/src/components/renderer/radio.js +4 -1
  75. package/es/packages/form-render/src/components/renderer/select.d.ts +9 -0
  76. package/es/packages/form-render/src/components/renderer/select.js +28 -17
  77. package/es/packages/form-render/src/constants/index.d.ts +2 -1
  78. package/es/packages/form-render/src/hooks/useAnchor.d.ts +7 -6
  79. package/es/packages/form-render/src/hooks/useAnchor.js +1 -2
  80. package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +6 -1
  81. package/es/packages/form-render/src/hooks/useAsyncQueue.js +12 -7
  82. package/es/packages/form-render/src/hooks/useCommonInjection.d.ts +6 -0
  83. package/es/packages/form-render/src/hooks/useCommonInjection.js +19 -0
  84. package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +9 -7
  85. package/es/packages/form-render/src/hooks/useFormContext.d.ts +3 -3
  86. package/es/packages/form-render/src/hooks/useFormContext.js +21 -3
  87. package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.d.ts +13 -0
  88. package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.js +10 -0
  89. package/es/packages/form-render/src/types/fieldItem.d.ts +33 -4
  90. package/es/packages/form-render/src/types/index.d.ts +30 -2
  91. package/es/packages/form-render/src/utils/index.d.ts +8 -5
  92. package/es/packages/form-render/src/utils/index.js +64 -13
  93. package/es/packages/form-render/style/index.css +11 -10
  94. package/es/packages/form-table/src/hooks/useNuiThemeOverrides.js +1 -1
  95. package/es/packages/index.css +158 -21
  96. package/es/packages/index.d.ts +3 -1
  97. package/es/packages/index.js +4 -1
  98. package/es/packages/info-header/index.d.ts +1 -3
  99. package/es/packages/info-header/src/HiddenContent.js +1 -1
  100. package/es/packages/info-header/src/HiddenContent.vue.d.ts +1 -3
  101. package/es/packages/info-header/src/InfoHeader.vue.d.ts +1 -3
  102. package/es/packages/info-header/style/index.css +1 -1
  103. package/es/packages/shortcut-provider/index.d.ts +2 -11
  104. package/es/packages/shortcut-provider/src/ShortcutProvider.js +1 -5
  105. package/es/packages/shortcut-provider/src/ShortcutProvider.vue.d.ts +2 -11
  106. package/es/packages/shortcut-provider/src/hooks/useShortcuts.d.ts +11 -8
  107. package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +44 -28
  108. package/es/packages/shortcut-provider/src/types/index.d.ts +32 -4
  109. package/es/packages/shortcut-provider/src/utils/index.d.ts +3 -0
  110. package/es/packages/shortcut-provider/src/utils/index.js +15 -5
  111. package/es/packages/shortcut-setter/index.d.ts +32 -9
  112. package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +32 -9
  113. package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +8 -6
  114. package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +8 -6
  115. package/es/src/utils/state.d.ts +29 -0
  116. package/es/src/utils/state.js +44 -0
  117. package/package.json +10 -1
  118. package/es/_virtual/_commonjsHelpers.js +0 -7
  119. package/es/_virtual/css.escape.js +0 -3
  120. package/es/_virtual/inherits.js +0 -3
  121. package/es/_virtual/inherits_browser.js +0 -3
  122. package/es/node_modules/@formily/path/esm/contexts.js +0 -22
  123. package/es/node_modules/@formily/path/esm/destructor.js +0 -124
  124. package/es/node_modules/@formily/path/esm/index.js +0 -579
  125. package/es/node_modules/@formily/path/esm/matcher.js +0 -199
  126. package/es/node_modules/@formily/path/esm/parser.js +0 -402
  127. package/es/node_modules/@formily/path/esm/shared.js +0 -73
  128. package/es/node_modules/@formily/path/esm/tokenizer.js +0 -287
  129. package/es/node_modules/@formily/path/esm/tokens.js +0 -240
  130. package/es/node_modules/@formily/path/esm/types.js +0 -17
  131. package/es/node_modules/css.escape/css.escape.js +0 -110
  132. package/es/node_modules/date-fns/esm/_lib/defaultOptions/index.js +0 -6
  133. package/es/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js +0 -18
  134. package/es/node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js +0 -17
  135. package/es/node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js +0 -27
  136. package/es/node_modules/date-fns/esm/_lib/getUTCWeek/index.js +0 -17
  137. package/es/node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js +0 -38
  138. package/es/node_modules/date-fns/esm/_lib/requiredArgs/index.js +0 -7
  139. package/es/node_modules/date-fns/esm/_lib/setUTCDay/index.js +0 -27
  140. package/es/node_modules/date-fns/esm/_lib/setUTCISODay/index.js +0 -23
  141. package/es/node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js +0 -15
  142. package/es/node_modules/date-fns/esm/_lib/setUTCWeek/index.js +0 -15
  143. package/es/node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js +0 -15
  144. package/es/node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js +0 -15
  145. package/es/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js +0 -25
  146. package/es/node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js +0 -21
  147. package/es/node_modules/date-fns/esm/_lib/toInteger/index.js +0 -15
  148. package/es/node_modules/date-fns/esm/compareAsc/index.js +0 -52
  149. package/es/node_modules/date-fns/esm/constants/index.js +0 -40
  150. package/es/node_modules/date-fns/esm/differenceInCalendarDays/index.js +0 -49
  151. package/es/node_modules/date-fns/esm/differenceInCalendarMonths/index.js +0 -35
  152. package/es/node_modules/date-fns/esm/differenceInCalendarYears/index.js +0 -33
  153. package/es/node_modules/date-fns/esm/differenceInDays/index.js +0 -86
  154. package/es/node_modules/date-fns/esm/differenceInMonths/index.js +0 -59
  155. package/es/node_modules/date-fns/esm/differenceInYears/index.js +0 -43
  156. package/es/node_modules/date-fns/esm/endOfDay/index.js +0 -30
  157. package/es/node_modules/date-fns/esm/endOfMonth/index.js +0 -32
  158. package/es/node_modules/date-fns/esm/isLastDayOfMonth/index.js +0 -30
  159. package/es/node_modules/date-fns/esm/parse/_lib/Parser.js +0 -32
  160. package/es/node_modules/date-fns/esm/parse/_lib/Setter.js +0 -37
  161. package/es/node_modules/date-fns/esm/parse/_lib/constants.js +0 -48
  162. package/es/node_modules/date-fns/esm/parse/_lib/parsers/AMPMMidnightParser.js +0 -55
  163. package/es/node_modules/date-fns/esm/parse/_lib/parsers/AMPMParser.js +0 -55
  164. package/es/node_modules/date-fns/esm/parse/_lib/parsers/DateParser.js +0 -55
  165. package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayOfYearParser.js +0 -52
  166. package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayParser.js +0 -80
  167. package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayPeriodParser.js +0 -56
  168. package/es/node_modules/date-fns/esm/parse/_lib/parsers/EraParser.js +0 -53
  169. package/es/node_modules/date-fns/esm/parse/_lib/parsers/ExtendedYearParser.js +0 -30
  170. package/es/node_modules/date-fns/esm/parse/_lib/parsers/FractionOfSecondParser.js +0 -29
  171. package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour0To11Parser.js +0 -48
  172. package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour0to23Parser.js +0 -41
  173. package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour1To24Parser.js +0 -42
  174. package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour1to12Parser.js +0 -50
  175. package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISODayParser.js +0 -99
  176. package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneParser.js +0 -46
  177. package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneWithZParser.js +0 -46
  178. package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekParser.js +0 -43
  179. package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekYearParser.js +0 -33
  180. package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalDayParser.js +0 -96
  181. package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekParser.js +0 -43
  182. package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekYearParser.js +0 -61
  183. package/es/node_modules/date-fns/esm/parse/_lib/parsers/MinuteParser.js +0 -41
  184. package/es/node_modules/date-fns/esm/parse/_lib/parsers/MonthParser.js +0 -80
  185. package/es/node_modules/date-fns/esm/parse/_lib/parsers/QuarterParser.js +0 -73
  186. package/es/node_modules/date-fns/esm/parse/_lib/parsers/SecondParser.js +0 -41
  187. package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneLocalDayParser.js +0 -96
  188. package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneMonthParser.js +0 -80
  189. package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneQuarterParser.js +0 -73
  190. package/es/node_modules/date-fns/esm/parse/_lib/parsers/TimestampMillisecondsParser.js +0 -26
  191. package/es/node_modules/date-fns/esm/parse/_lib/parsers/TimestampSecondsParser.js +0 -26
  192. package/es/node_modules/date-fns/esm/parse/_lib/parsers/YearParser.js +0 -66
  193. package/es/node_modules/date-fns/esm/parse/_lib/parsers/index.js +0 -109
  194. package/es/node_modules/date-fns/esm/parse/_lib/utils.js +0 -133
  195. package/es/node_modules/date-fns/esm/startOfDay/index.js +0 -30
  196. package/es/node_modules/date-fns/esm/toDate/index.js +0 -55
  197. package/es/node_modules/diagram-js/lib/command/CommandInterceptor.js +0 -139
  198. package/es/node_modules/diagram-js/lib/draw/BaseRenderer.js +0 -88
  199. package/es/node_modules/diagram-js/lib/features/popup-menu/PopupMenu.js +0 -591
  200. package/es/node_modules/diagram-js/lib/features/rules/RuleProvider.js +0 -88
  201. package/es/node_modules/diagram-js/lib/navigation/movecanvas/MoveCanvas.js +0 -120
  202. package/es/node_modules/diagram-js/lib/navigation/movecanvas/index.js +0 -8
  203. package/es/node_modules/diagram-js/lib/navigation/zoomscroll/ZoomScroll.js +0 -227
  204. package/es/node_modules/diagram-js/lib/navigation/zoomscroll/ZoomUtil.js +0 -24
  205. package/es/node_modules/diagram-js/lib/util/ClickTrap.js +0 -23
  206. package/es/node_modules/diagram-js/lib/util/Cursor.js +0 -20
  207. package/es/node_modules/diagram-js/lib/util/Event.js +0 -22
  208. package/es/node_modules/diagram-js/lib/util/Math.js +0 -9
  209. package/es/node_modules/diagram-js/lib/util/Mouse.js +0 -30
  210. package/es/node_modules/diagram-js/lib/util/Platform.js +0 -5
  211. package/es/node_modules/diagram-js/lib/util/PositionUtil.js +0 -8
  212. package/es/node_modules/diagram-js/lib/util/RenderUtil.js +0 -25
  213. package/es/node_modules/diagram-js/lib/util/SvgTransformUtil.js +0 -48
  214. package/es/node_modules/ids/dist/index.esm.js +0 -164
  215. package/es/node_modules/inherits/inherits.js +0 -19
  216. package/es/node_modules/inherits/inherits_browser.js +0 -38
  217. package/es/node_modules/inherits-browser/dist/index.es.js +0 -3
  218. package/es/node_modules/min-dash/dist/index.esm.js +0 -169
  219. package/es/node_modules/min-dom/dist/index.esm.js +0 -588
  220. package/es/node_modules/tiny-svg/dist/index.esm.js +0 -525
  221. package/es/packages/form-render/src/components/renderer/combination.js +0 -148
@@ -109,6 +109,13 @@ declare const _default: import("vue").DefineComponent<{
109
109
  uuid: {
110
110
  type: StringConstructor;
111
111
  };
112
+ lifeCycle: {
113
+ type: PropType<Partial<{
114
+ onSetup(): void;
115
+ beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject>;
116
+ afterRequest(fieldKey: string, payload?: any): AnyObject[];
117
+ }>>;
118
+ };
112
119
  }, {
113
120
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
114
121
  fieldList: {
@@ -217,6 +224,13 @@ declare const _default: import("vue").DefineComponent<{
217
224
  uuid: {
218
225
  type: StringConstructor;
219
226
  };
227
+ lifeCycle: {
228
+ type: PropType<Partial<{
229
+ onSetup(): void;
230
+ beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject>;
231
+ afterRequest(fieldKey: string, payload?: any): AnyObject[];
232
+ }>>;
233
+ };
220
234
  }>> & {
221
235
  onFormChange?: ((...args: any[]) => any) | undefined;
222
236
  }>>;
@@ -226,10 +240,11 @@ declare const _default: import("vue").DefineComponent<{
226
240
  businessCollector: import("./hooks").BusinessCollector;
227
241
  formItemDepsCollector: import("./hooks").FormItemDepsCollector;
228
242
  changeContextCollector: import("./hooks").ContextCollector;
229
- formUUID: any;
243
+ formUUID: string;
230
244
  formModel: import("@formily/core").Form<{
231
245
  [x: string]: any;
232
246
  }>;
247
+ scrollbarRef: import("vue").Ref<HTMLElement | undefined>;
233
248
  schemaAdaptor: (fieldList: FieldItem[]) => Record<string, import("@formily/vue").Stringify<{
234
249
  [key: symbol]: any;
235
250
  [key: `x-${string}`]: any;
@@ -345,7 +360,6 @@ declare const _default: import("vue").DefineComponent<{
345
360
  "x-compile-omitted"?: string[] | undefined;
346
361
  }>>;
347
362
  currentAnchor: import("vue").WritableComputedRef<string>;
348
- scrollbarRef: import("vue").Ref<HTMLElement | undefined>;
349
363
  generateAnchorList: (schema: import("@formily/vue").Stringify<{
350
364
  [key: symbol]: any;
351
365
  [key: `x-${string}`]: any;
@@ -407,7 +421,7 @@ declare const _default: import("vue").DefineComponent<{
407
421
  name: string;
408
422
  title: string;
409
423
  }[]>;
410
- formHeight: import("vue").ComputedRef<any>;
424
+ formHeight: import("vue").ComputedRef<string | undefined>;
411
425
  onScroll: () => void;
412
426
  queryWidget: (key: string, wrapperElement: HTMLElement, fieldList: FieldItem[]) => Promise<{
413
427
  widgetElement: HTMLInputElement | null | undefined;
@@ -1712,6 +1726,13 @@ declare const _default: import("vue").DefineComponent<{
1712
1726
  uuid: {
1713
1727
  type: StringConstructor;
1714
1728
  };
1729
+ lifeCycle: {
1730
+ type: PropType<Partial<{
1731
+ onSetup(): void;
1732
+ beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject>;
1733
+ afterRequest(fieldKey: string, payload?: any): AnyObject[];
1734
+ }>>;
1735
+ };
1715
1736
  }>> & {
1716
1737
  onFormChange?: ((...args: any[]) => any) | undefined;
1717
1738
  }, {
@@ -1,6 +1,7 @@
1
1
  import { defineComponent, ref, computed, inject, watch, createVNode } from 'vue';
2
2
  import { isField } from '@formily/core';
3
3
  import { isEqual } from 'lodash-es';
4
+ import { useCommonInjection } from '../../../../../packages/form-render/src/hooks/useCommonInjection';
4
5
  import { InjectAsyncQueue } from '../../constants/index.js';
5
6
  import { assignUpdateValue, traverseDependKey } from '../../utils/index.js';
6
7
  import { connect, mapProps } from '@formily/vue';
@@ -123,13 +124,12 @@ const script = defineComponent({
123
124
  return (_a = target == null ? void 0 : target.depth) != null ? _a : -1;
124
125
  }
125
126
  }
126
- watch(() => props.value, (n, o) => {
127
- var _a, _b;
128
- n != null && o == null && fetchData();
129
- isField(field.value) && field.value.visited && ((_b = (_a = field.value).validate) == null ? void 0 : _b.call(_a));
130
- }, {
131
- immediate: true
132
- });
127
+ const {
128
+ injectValueValidate,
129
+ injectValueWatchFromEmpty
130
+ } = useCommonInjection();
131
+ injectValueWatchFromEmpty(() => props.value, fetchData);
132
+ injectValueValidate(() => props.value);
133
133
  watch(() => props.urlConfig, async (config, oldConfig) => {
134
134
  if (isEqual(config, oldConfig))
135
135
  return;
@@ -0,0 +1,5 @@
1
+ import { Ref } from 'vue';
2
+ import { FormRenderExpose } from '../../../../../../../../es/packages/form-render';
3
+ export declare function useDeepValidate(): {
4
+ bindDeepValidate: (formRenderRefs: Ref<FormRenderExpose[]>) => void;
5
+ };
@@ -0,0 +1,32 @@
1
+ import { isField } from '@formily/core';
2
+ import { flatten } from 'lodash-es';
3
+ import { onMounted } from 'vue';
4
+ import { useFormField } from '../../../../../../../packages/form-render';
5
+ import { arrayed } from '../../../../../../../packages/form-render/src/utils';
6
+
7
+ function useDeepValidate() {
8
+ function bindDeepValidate(formRenderRefs) {
9
+ const { field } = useFormField();
10
+ onMounted(() => {
11
+ if (!isField(field.value))
12
+ return;
13
+ const tempValidator = field.value.validator;
14
+ field.value.validator = [
15
+ {
16
+ async validator() {
17
+ return Promise.allSettled(formRenderRefs.value.map((formRenderRef) => formRenderRef.validate())).then((resultList) => {
18
+ const rejected = resultList.filter((res) => res.status === "rejected");
19
+ if (!rejected.length)
20
+ return "";
21
+ return flatten(rejected.map((res) => res.reason));
22
+ });
23
+ }
24
+ },
25
+ ...tempValidator ? arrayed(tempValidator) : []
26
+ ];
27
+ });
28
+ }
29
+ return { bindDeepValidate };
30
+ }
31
+
32
+ export { useDeepValidate };
@@ -1,4 +1,4 @@
1
- import { FieldItem } from '../../types';
1
+ import { FieldItem } from '../../../../../../../es/packages/form-render';
2
2
  import { PropType } from 'vue';
3
3
  export declare const COMBINATION: import("vue").DefineComponent<{
4
4
  title: {
@@ -15,6 +15,9 @@ export declare const COMBINATION: import("vue").DefineComponent<{
15
15
  type: PropType<() => FieldItem[]>;
16
16
  default: () => never[];
17
17
  };
18
+ onInput: {};
19
+ onBlur: {};
20
+ onChange: {};
18
21
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
19
22
  title: {
20
23
  type: StringConstructor;
@@ -30,6 +33,9 @@ export declare const COMBINATION: import("vue").DefineComponent<{
30
33
  type: PropType<() => FieldItem[]>;
31
34
  default: () => never[];
32
35
  };
36
+ onInput: {};
37
+ onBlur: {};
38
+ onChange: {};
33
39
  }>> & {
34
40
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
35
41
  }, {
@@ -0,0 +1,157 @@
1
+ import { defineComponent, ref, computed, watch, onMounted, createVNode, createTextVNode } from 'vue';
2
+ import { isField } from '@formily/core';
3
+ import { Path } from '@formily/path';
4
+ import { isNumber, isEqual } from 'lodash-es';
5
+ import { useDeepValidate } from '../../../../../../packages/form-render/src/components/renderer/combination/hooks/useDeepValidate';
6
+ import { assignUpdateValue, mergeDeepProperties, formRenderLog } from '../../../utils/index.js';
7
+ import { connect, mapProps } from '@formily/vue';
8
+ import { useDebounceFn, isObject } from '@vueuse/core';
9
+ import { NButton } from 'naive-ui';
10
+ import FormRender from '../../../FormRender.js';
11
+
12
+ const script = defineComponent({
13
+ name: "FormCombination",
14
+ props: {
15
+ title: {
16
+ type: String,
17
+ default: ""
18
+ },
19
+ value: {
20
+ type: String
21
+ },
22
+ maxGroupNum: {
23
+ type: Number
24
+ },
25
+ getProperties: {
26
+ type: Function,
27
+ default: () => []
28
+ },
29
+ onInput: {},
30
+ onBlur: {},
31
+ onChange: {}
32
+ },
33
+ emits: ["update:value"],
34
+ setup(props, {
35
+ emit
36
+ }) {
37
+ const emitChange = useDebounceFn(function emitChange2() {
38
+ emit("update:value", JSON.stringify(combinationData.value));
39
+ }, 300);
40
+ const combinationData = ref([]);
41
+ const currentGroupNum = computed(() => combinationData.value.length);
42
+ function setCombinationData(data, withInitialData = false) {
43
+ const parsedData = getParsedData(data);
44
+ if (!needLoad(parsedData))
45
+ return;
46
+ parsedData.splice(maxGroupNum.value);
47
+ parsedData.forEach(setCombinationItemData);
48
+ combinationData.value.splice(parsedData.length);
49
+ combinationData.value.forEach(setFormRenderData);
50
+ function needLoad(_data) {
51
+ return !!_data && !isEqual(_data, combinationData.value);
52
+ }
53
+ function setCombinationItemData(v, idx) {
54
+ if (!isObject(v))
55
+ return;
56
+ combinationData.value[idx] = v;
57
+ withInitialData && mergeDeepProperties(v, props.getProperties());
58
+ }
59
+ function getParsedData(data2) {
60
+ try {
61
+ if (!data2)
62
+ return null;
63
+ const result = JSON.parse(data2);
64
+ if (!Array.isArray(result))
65
+ return null;
66
+ return result;
67
+ } catch (e) {
68
+ formRenderLog(`invalid JSON value ${data2} in COMBINATION => ${props.title}`, "warn");
69
+ return null;
70
+ }
71
+ }
72
+ }
73
+ watch(() => props.value, (value) => setCombinationData(value));
74
+ onMounted(() => {
75
+ setCombinationData(props.value || "[{}]", true);
76
+ emitChange();
77
+ });
78
+ const formRenderRefs = ref([]);
79
+ useDeepValidate().bindDeepValidate(formRenderRefs);
80
+ function setFormRenderData(item, idx) {
81
+ var _a;
82
+ (_a = formRenderRefs.value[idx]) == null ? void 0 : _a.setFieldState("*", (state) => {
83
+ if (!isField(state))
84
+ return;
85
+ state.value = Path.getIn(item, state.path);
86
+ });
87
+ }
88
+ function setFormRenderRef(idx, _ref) {
89
+ formRenderRefs.value[idx] = _ref;
90
+ setFormRenderData(combinationData.value[idx] || {}, idx);
91
+ }
92
+ function addGroup() {
93
+ combinationData.value.push(mergeDeepProperties({}, props.getProperties()));
94
+ emitChange();
95
+ }
96
+ function removeGroup(idx) {
97
+ combinationData.value.splice(idx, 1);
98
+ formRenderRefs.value.splice(idx, 1);
99
+ emitChange();
100
+ }
101
+ const maxGroupNum = computed(() => {
102
+ if (!isNumber(props.maxGroupNum))
103
+ return Infinity;
104
+ if (props.maxGroupNum < 1)
105
+ return 0;
106
+ return ~~props.maxGroupNum;
107
+ });
108
+ watch(maxGroupNum, (value) => {
109
+ if (currentGroupNum.value <= value)
110
+ return;
111
+ combinationData.value.splice(value);
112
+ emitChange();
113
+ formRenderRefs.value.splice(value);
114
+ }, {
115
+ immediate: true
116
+ });
117
+ function onChange(idx, {
118
+ fieldKey,
119
+ value
120
+ }) {
121
+ !combinationData.value[idx] && (combinationData.value[idx] = {});
122
+ Path.setIn(combinationData.value[idx], fieldKey, value);
123
+ emitChange();
124
+ }
125
+ const FormRenderComponent = FormRender;
126
+ return () => {
127
+ return createVNode("section", {
128
+ "class": "form-render__combination"
129
+ }, [createVNode("header", {
130
+ "class": "form-render__combinationHeader"
131
+ }, [createVNode("div", {
132
+ "class": "form-render__combinationHeaderText"
133
+ }, [props.title]), createVNode(NButton, {
134
+ "onClick": addGroup,
135
+ "type": "info",
136
+ "text": true,
137
+ "disabled": currentGroupNum.value >= maxGroupNum.value
138
+ }, {
139
+ default: () => [createTextVNode("\u65B0\u589E")]
140
+ })]), Array.from({
141
+ length: currentGroupNum.value
142
+ }).map((_, idx) => createVNode("section", {
143
+ "class": "form-render__combinationContent"
144
+ }, [createVNode(FormRenderComponent, {
145
+ "ref": (_ref) => setFormRenderRef(idx, _ref),
146
+ "fieldList": props.getProperties(),
147
+ "onFormChange": (payload) => onChange(idx, payload)
148
+ }, null), idx === 0 ? null : createVNode("i", {
149
+ "class": "form-render__combinationClose",
150
+ "onClick": () => removeGroup(idx)
151
+ }, ["-"])]))]);
152
+ };
153
+ }
154
+ });
155
+ const COMBINATION = connect(script, mapProps(assignUpdateValue));
156
+
157
+ export { COMBINATION };
@@ -1,5 +1,6 @@
1
1
  import { CSSProperties, PropType } from 'vue';
2
2
  export declare const COMPLEX: import("vue").DefineComponent<{
3
+ onChange: {};
3
4
  span: {
4
5
  type: NumberConstructor;
5
6
  default: number;
@@ -13,6 +14,7 @@ export declare const COMPLEX: import("vue").DefineComponent<{
13
14
  default: () => {};
14
15
  };
15
16
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
17
+ onChange: {};
16
18
  span: {
17
19
  type: NumberConstructor;
18
20
  default: number;
@@ -4,6 +4,7 @@ import { assignUpdateValue } from '../../utils/index.js';
4
4
 
5
5
  const script = defineComponent({
6
6
  props: {
7
+ onChange: {},
7
8
  span: {
8
9
  type: Number,
9
10
  default: 6
@@ -20,16 +21,12 @@ const script = defineComponent({
20
21
  setup(props, {
21
22
  slots
22
23
  }) {
23
- function onChange(e) {
24
- e.stopPropagation();
25
- }
26
24
  return () => {
27
25
  return createVNode("section", {
28
26
  "class": "form-render__complex"
29
27
  }, [createVNode("section", {
30
28
  "class": `form-render__complexContent--${props.display}`,
31
- "style": props.wrapperStyle,
32
- "onChange": onChange
29
+ "style": props.wrapperStyle
33
30
  }, [slots.default && slots.default()])]);
34
31
  };
35
32
  }
@@ -1,7 +1,36 @@
1
+ import { PropType } from 'vue';
1
2
  export declare const DATE: import("vue").DefineComponent<{
2
3
  onChange: {};
3
4
  value: {};
5
+ validate: {
6
+ type: PropType<Partial<{
7
+ [key: string]: any;
8
+ obj_type: "password" | "sex" | "age" | "email" | "id_card" | "age_unit" | "mobile" | "telephone" | "birthday" | "bank_card" | "website" | "gestational_weeks" | "gestational_stage" | "customer_name";
9
+ vali_obj: string;
10
+ max_value: string | number;
11
+ min_value: string | number;
12
+ min_length: string | number;
13
+ max_length: string | number;
14
+ decimal_length: string | number;
15
+ regular_expression: string | RegExp;
16
+ regular_error_tip: string;
17
+ }>>;
18
+ };
4
19
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
5
20
  onChange: {};
6
21
  value: {};
22
+ validate: {
23
+ type: PropType<Partial<{
24
+ [key: string]: any;
25
+ obj_type: "password" | "sex" | "age" | "email" | "id_card" | "age_unit" | "mobile" | "telephone" | "birthday" | "bank_card" | "website" | "gestational_weeks" | "gestational_stage" | "customer_name";
26
+ vali_obj: string;
27
+ max_value: string | number;
28
+ min_value: string | number;
29
+ min_length: string | number;
30
+ max_length: string | number;
31
+ decimal_length: string | number;
32
+ regular_expression: string | RegExp;
33
+ regular_error_tip: string;
34
+ }>>;
35
+ };
7
36
  }>>, {}>;
@@ -1,18 +1,75 @@
1
- import { defineComponent, createVNode } from 'vue';
1
+ import { defineComponent, computed, createVNode } from 'vue';
2
2
  import { isField } from '@formily/core';
3
3
  import { connect, mapProps } from '@formily/vue';
4
4
  import { isObject } from '@vueuse/core';
5
5
  import { NDatePicker } from 'naive-ui';
6
+ import { useCommonInjection } from '../../../../../packages/form-render/src/hooks/useCommonInjection';
6
7
 
7
8
  const script = defineComponent({
8
9
  props: {
9
10
  onChange: {},
10
- value: {}
11
+ value: {},
12
+ validate: {
13
+ type: Object
14
+ }
11
15
  },
12
- setup(_) {
13
- return () => {
14
- return createVNode(NDatePicker, null, null);
15
- };
16
+ setup(props) {
17
+ useCommonInjection().injectValueValidate(() => props.value);
18
+ function minCurrentDate() {
19
+ var _a;
20
+ return ((_a = props.validate) == null ? void 0 : _a.min_date) === "currTime";
21
+ }
22
+ function maxCurrentDate() {
23
+ var _a;
24
+ return ((_a = props.validate) == null ? void 0 : _a.max_date) === "currTime";
25
+ }
26
+ function isDateDisabled(time) {
27
+ return minCurrentDate() && time < yesterday() || maxCurrentDate() && time > Date.now();
28
+ function yesterday() {
29
+ return Date.now() - 24 * 60 * 60 * 1e3;
30
+ }
31
+ }
32
+ function isTimeDisabled(time) {
33
+ const checkDate = new Date(time);
34
+ const currentDate = new Date();
35
+ return {
36
+ isHourDisabled,
37
+ isMinuteDisabled
38
+ };
39
+ function checkHour() {
40
+ return checkDate.getHours();
41
+ }
42
+ function currentHour() {
43
+ return currentDate.getHours();
44
+ }
45
+ function currentMinute() {
46
+ return currentDate.getMinutes();
47
+ }
48
+ function isHourDisabled(hour) {
49
+ return minCurrentDate() && hour < currentHour() || maxCurrentDate() && hour > currentHour();
50
+ }
51
+ function isMinuteDisabled(minute) {
52
+ if (checkHour() === currentHour()) {
53
+ return minCurrentDate() && minute < currentMinute() || maxCurrentDate() && minute > currentMinute();
54
+ }
55
+ return minCurrentDate() && checkHour() < currentHour() || maxCurrentDate() && checkHour() > currentHour();
56
+ }
57
+ }
58
+ const validateConfig = computed(() => {
59
+ const result = {};
60
+ if (isObject(props.validate)) {
61
+ const {
62
+ min_date,
63
+ max_date
64
+ } = props.validate;
65
+ if (min_date || max_date) {
66
+ result.isDateDisabled = isDateDisabled;
67
+ result.isTimeDisabled = isTimeDisabled;
68
+ }
69
+ }
70
+ return result;
71
+ });
72
+ return () => createVNode(NDatePicker, validateConfig.value, null);
16
73
  }
17
74
  });
18
75
  const DATE = connect(script, mapProps((props, field) => {
@@ -26,58 +83,8 @@ const DATE = connect(script, mapProps((props, field) => {
26
83
  field.setValue(v);
27
84
  }
28
85
  });
29
- if (isObject(props.validate)) {
30
- const {
31
- min_date,
32
- max_date
33
- } = props.validate;
34
- if (min_date || max_date) {
35
- _props.isDateDisabled = isDateDisabled;
36
- _props.isTimeDisabled = isTimeDisabled;
37
- }
38
- }
39
86
  }
40
87
  return _props;
41
- function minCurrentDate() {
42
- var _a;
43
- return ((_a = props.validate) == null ? void 0 : _a.min_date) === "currTime";
44
- }
45
- function maxCurrentDate() {
46
- var _a;
47
- return ((_a = props.validate) == null ? void 0 : _a.max_date) === "currTime";
48
- }
49
- function isDateDisabled(time) {
50
- return minCurrentDate() && time < yesterday() || maxCurrentDate() && time > Date.now();
51
- function yesterday() {
52
- return Date.now() - 24 * 60 * 60 * 1e3;
53
- }
54
- }
55
- function isTimeDisabled(time) {
56
- const checkDate = new Date(time);
57
- const currentDate = new Date();
58
- return {
59
- isHourDisabled,
60
- isMinuteDisabled
61
- };
62
- function checkHour() {
63
- return checkDate.getHours();
64
- }
65
- function currentHour() {
66
- return currentDate.getHours();
67
- }
68
- function currentMinute() {
69
- return currentDate.getMinutes();
70
- }
71
- function isHourDisabled(hour) {
72
- return minCurrentDate() && hour < currentHour() || maxCurrentDate() && hour > currentHour();
73
- }
74
- function isMinuteDisabled(minute) {
75
- if (checkHour() === currentHour()) {
76
- return minCurrentDate() && minute < currentMinute() || maxCurrentDate() && minute > currentMinute();
77
- }
78
- return minCurrentDate() && checkHour() < currentHour() || maxCurrentDate() && checkHour() > currentHour();
79
- }
80
- }
81
88
  }));
82
89
 
83
90
  export { DATE };
@@ -1,7 +1,6 @@
1
1
  import { defineComponent, inject, computed, createVNode } from 'vue';
2
2
  import { isVoidField } from '@formily/core';
3
3
  import { connect, mapProps } from '@formily/vue';
4
- import { isBoolean } from 'lodash-es';
5
4
  import { NFormItem } from 'naive-ui';
6
5
  import AnnotationEdit from '../../../../../packages/annotation-edit';
7
6
  import { InjectionAnnotation } from '../../../../../packages/form-render/src/constants';
@@ -18,7 +17,8 @@ const script = defineComponent({
18
17
  const annotation = inject(InjectionAnnotation);
19
18
  const annotationContent = computed({
20
19
  get() {
21
- return annotation.value[props.propertyKey];
20
+ var _a, _b;
21
+ return (_b = (_a = annotation.value) == null ? void 0 : _a[props.propertyKey]) != null ? _b : "";
22
22
  },
23
23
  set(value) {
24
24
  annotation.value = {
@@ -35,7 +35,7 @@ const script = defineComponent({
35
35
  }, null);
36
36
  }
37
37
  const showAnnotation = computed(() => {
38
- return annotation.value && (!isBoolean(props.annotation) || props.annotation);
38
+ return annotation.value && props.annotation !== false;
39
39
  });
40
40
  const showLabel = computed(() => props.label && props.label !== " ");
41
41
  function renderLabel() {
@@ -7,7 +7,7 @@ export { LINEBAR } from './linebar.js';
7
7
  export { INPUT_GROUP } from './inputGroup.js';
8
8
  export { DATE } from './date.js';
9
9
  export { SEARCH_CASCADE } from './cascader.js';
10
- export { COMBINATION } from './combination.js';
10
+ export { COMBINATION } from './combination/index.js';
11
11
  export { CHECKBOX } from './checkbox.js';
12
12
  export { SWITCH } from './switch.js';
13
13
  export { RADIO } from './radio.js';
@@ -1,5 +1,6 @@
1
1
  import { defineComponent, computed, createVNode } from 'vue';
2
2
  import { connect, mapProps } from '@formily/vue';
3
+ import { isNumber } from 'lodash-es';
3
4
  import { NRadioGroup, NSpace, NRadio } from 'naive-ui';
4
5
  import { assignUpdateValue } from '../../utils/index.js';
5
6
 
@@ -23,7 +24,9 @@ const script = defineComponent({
23
24
  emit
24
25
  }) {
25
26
  function dangerousTypeTransform(value) {
26
- return value + "";
27
+ if (isNumber(value))
28
+ return value + "";
29
+ return value;
27
30
  }
28
31
  const valueRef = computed({
29
32
  get() {
@@ -13,6 +13,10 @@ export declare const SELECT: import("vue").DefineComponent<{
13
13
  value: {
14
14
  type: StringConstructor;
15
15
  };
16
+ lazyRequest: {
17
+ type: BooleanConstructor;
18
+ default: boolean;
19
+ };
16
20
  options: {
17
21
  type: PropType<AnyObject[]>;
18
22
  default: () => never[];
@@ -28,6 +32,10 @@ export declare const SELECT: import("vue").DefineComponent<{
28
32
  value: {
29
33
  type: StringConstructor;
30
34
  };
35
+ lazyRequest: {
36
+ type: BooleanConstructor;
37
+ default: boolean;
38
+ };
31
39
  options: {
32
40
  type: PropType<AnyObject[]>;
33
41
  default: () => never[];
@@ -43,5 +51,6 @@ export declare const SELECT: import("vue").DefineComponent<{
43
51
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
44
52
  }, {
45
53
  options: AnyObject[];
54
+ lazyRequest: boolean;
46
55
  }>;
47
56
  export {};