cnhis-design-vue 3.1.45-beta.9 → 3.1.45-release.1

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 (204) hide show
  1. package/README.md +87 -87
  2. package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
  3. package/es/components/base-search/index.d.ts +0 -2
  4. package/es/components/base-search/src/index.vue.d.ts +0 -2
  5. package/es/components/base-search/style/index.css +1 -1
  6. package/es/components/classification/index.d.ts +11 -165
  7. package/es/components/classification/src/components/search-filter/index.vue.d.ts +11 -165
  8. package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
  9. package/es/components/classification/src/components/set-classification/index.vue.d.ts +11 -165
  10. package/es/components/classification/src/index.vue.d.ts +11 -165
  11. package/es/components/fabric-chart/index.d.ts +5 -40
  12. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +5 -40
  13. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  14. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +0 -20
  15. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  16. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  17. package/es/components/fabric-chart/src/hooks/temperature/useRight.js +1 -1
  18. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  19. package/es/components/fabric-chart/src/hooks/useDraw.d.ts +1 -1
  20. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  21. package/es/components/fabric-chart/src/hooks/useGrid.d.ts +1 -1
  22. package/es/components/fabric-chart/src/hooks/useGrid.js +1 -1
  23. package/es/components/fabric-chart/src/interface.d.ts +0 -13
  24. package/es/components/fabric-chart/src/utils/index.d.ts +1 -2
  25. package/es/components/fabric-chart/src/utils/index.js +1 -1
  26. package/es/components/field-set/index.d.ts +38 -157
  27. package/es/components/field-set/src/FieldSet.vue.d.ts +23 -160
  28. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  29. package/es/components/field-set/src/types/index.d.ts +0 -1
  30. package/es/components/field-set/style/index.css +1 -1
  31. package/es/components/form-config/index.d.ts +48 -3561
  32. package/es/components/form-config/src/FormConfig.vue.d.ts +48 -3561
  33. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  34. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +4 -31
  35. package/es/components/form-config/src/components/FormConfigDragDisplay.vue2.js +1 -1
  36. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +4 -33
  37. package/es/components/form-config/src/components/FormConfigMaterialItem.d.ts +1 -11
  38. package/es/components/form-config/src/components/FormConfigMaterialItem.js +1 -1
  39. package/es/components/form-config/src/components/renderer/DefaultNode.vue.d.ts +0 -2
  40. package/es/components/form-config/src/components/renderer/DefaultNode.vue2.js +1 -1
  41. package/es/components/form-config/src/constants/index.d.ts +0 -1
  42. package/es/components/form-config/src/constants/index.js +1 -1
  43. package/es/components/form-config/src/hooks/useSortalbeConfig.js +1 -1
  44. package/es/components/form-config/src/types/index.d.ts +0 -2
  45. package/es/components/form-config/style/index.css +1 -1
  46. package/es/components/form-render/index.d.ts +4 -31
  47. package/es/components/form-render/src/FormRender.vue.d.ts +4 -31
  48. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  49. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +4 -31
  50. package/es/components/form-render/src/components/renderer/combination.d.ts +5 -5
  51. package/es/components/form-render/src/components/renderer/combination.js +1 -1
  52. package/es/components/form-render/src/components/renderer/jsonCombination/index.d.ts +5 -5
  53. package/es/components/form-render/src/components/renderer/jsonCombination/index.js +1 -1
  54. package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
  55. package/es/components/form-render/src/constants/index.d.ts +0 -2
  56. package/es/components/form-render/src/constants/index.js +1 -1
  57. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  58. package/es/components/form-render/src/hooks/useFormAsyncQueue.d.ts +1 -1
  59. package/es/components/form-render/src/hooks/useFormAsyncQueue.js +1 -1
  60. package/es/components/form-render/src/hooks/useFormContext.js +1 -1
  61. package/es/components/form-render/src/hooks/useFormRenderLifeCycle.d.ts +1 -3
  62. package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +1 -1
  63. package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
  64. package/es/components/form-render/src/hooks/useNuiThemeOverrides.js +1 -1
  65. package/es/components/form-render/src/types/index.d.ts +0 -2
  66. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
  67. package/es/components/index.css +1 -1
  68. package/es/components/info-header/index.d.ts +10 -72
  69. package/es/components/info-header/src/InfoHeader.vue.d.ts +10 -72
  70. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +4 -31
  71. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +4 -31
  72. package/es/components/keyboard/index.d.ts +1 -1
  73. package/es/components/keyboard/src/Keyboard.vue.d.ts +1 -1
  74. package/es/components/quick-search/index.d.ts +0 -2
  75. package/es/components/quick-search/src/index.vue.d.ts +0 -2
  76. package/es/components/quick-search/style/index.css +1 -1
  77. package/es/components/recommend-search/index.d.ts +2 -2
  78. package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +2 -2
  79. package/es/components/recommend-search/src/components/BaseSearch.d.ts +1 -1
  80. package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +1 -1
  81. package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +1 -1
  82. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  83. package/es/components/search-cascader/index.d.ts +3 -16
  84. package/es/components/search-cascader/src/SearchCascader.vue.d.ts +3 -16
  85. package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
  86. package/es/components/search-cascader/src/hooks/index.d.ts +1 -0
  87. package/es/components/search-cascader/src/hooks/index.js +1 -0
  88. package/es/components/search-cascader/src/hooks/useCssVariable.d.ts +3 -0
  89. package/es/components/search-cascader/src/hooks/useCssVariable.js +1 -0
  90. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  91. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  92. package/es/components/shortcut-setter/index.d.ts +4 -31
  93. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +4 -31
  94. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +10 -165
  95. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +1 -1
  96. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +1 -16
  97. package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +1 -1
  98. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +0 -18
  99. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +1 -1
  100. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue.d.ts +10 -128
  101. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue2.js +1 -1
  102. package/es/components/table-filter/src/components/classify-filter/components/SelectLabel.vue.d.ts +0 -1
  103. package/es/components/table-filter/src/components/classify-filter/components/SelectLabel.vue2.js +1 -1
  104. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +10 -163
  105. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +10 -165
  106. package/es/components/table-filter/src/components/render-widget/basicData.d.ts +4 -0
  107. package/es/components/table-filter/src/components/render-widget/basicData.js +1 -0
  108. package/es/components/table-filter/src/components/render-widget/components/{DateOut.vue.d.ts → Date.vue.d.ts} +2 -21
  109. package/es/components/table-filter/src/components/render-widget/components/Date.vue.js +1 -0
  110. package/es/components/table-filter/src/components/render-widget/components/Date.vue2.js +1 -0
  111. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +5 -99
  112. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue2.js +1 -1
  113. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +9 -13
  114. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue2.js +1 -1
  115. package/es/components/table-filter/src/components/render-widget/components/LabelInner.vue.d.ts +5 -7
  116. package/es/components/table-filter/src/components/render-widget/components/LabelInner.vue2.js +1 -1
  117. package/es/components/table-filter/src/components/render-widget/components/LabelOut.vue.d.ts +5 -6
  118. package/es/components/table-filter/src/components/render-widget/components/LabelOut.vue2.js +1 -1
  119. package/es/components/table-filter/src/components/render-widget/components/Select.vue.d.ts +25 -15
  120. package/es/components/table-filter/src/components/render-widget/components/Select.vue2.js +1 -1
  121. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +25 -520
  122. package/es/components/table-filter/src/components/render-widget/components/index.js +1 -1
  123. package/es/components/table-filter/src/components/render-widget/enums.d.ts +3 -10
  124. package/es/components/table-filter/src/components/render-widget/enums.js +1 -1
  125. package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.d.ts +6 -2
  126. package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js +1 -1
  127. package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
  128. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +24 -548
  129. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
  130. package/es/components/table-filter/src/hooks/useAdvanced.d.ts +0 -2
  131. package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
  132. package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
  133. package/es/components/table-filter/src/tool/baseOptions.js +1 -1
  134. package/es/components/table-filter/src/types/enums.d.ts +0 -2
  135. package/es/components/table-filter/src/types/enums.js +1 -1
  136. package/es/env.d.ts +25 -25
  137. package/es/shared/assets/img/failure.png.js +1 -1
  138. package/es/shared/assets/img/no-permission.png.js +1 -1
  139. package/es/shared/assets/img/nodata.png.js +1 -1
  140. package/es/shared/assets/img/notfound.png.js +1 -1
  141. package/es/shared/assets/img/qr.png.js +1 -1
  142. package/es/shared/assets/img/success.png.js +1 -1
  143. package/es/shared/assets/img/video.png.js +1 -1
  144. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  145. package/es/shared/assets/img/xb_big.png.js +1 -1
  146. package/es/shared/assets/img/xb_small.png.js +1 -1
  147. package/es/shared/hooks/useAsyncQueue.d.ts +1 -3
  148. package/es/shared/hooks/useAsyncQueue.js +1 -1
  149. package/es/shared/package.json.js +1 -1
  150. package/package.json +2 -2
  151. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  152. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  153. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  154. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  155. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/index.d.ts +0 -2
  156. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/index.js +0 -1
  157. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +0 -4
  158. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +0 -1
  159. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +0 -4
  160. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +0 -1
  161. package/es/components/field-set/src/components/Row.vue.d.ts +0 -132
  162. package/es/components/field-set/src/components/Row.vue.js +0 -1
  163. package/es/components/field-set/src/components/Row.vue2.js +0 -1
  164. package/es/components/field-set/src/utils/index.d.ts +0 -7
  165. package/es/components/field-set/src/utils/index.js +0 -1
  166. package/es/components/form-render/src/components/renderer/dist/levelSearchCascader.d.ts +0 -77
  167. package/es/components/form-render/src/components/renderer/dist/searchCascade.d.ts +0 -93
  168. package/es/components/iho-table/src/plugins/dist/highLightSetPlugin.d.ts +0 -3
  169. package/es/components/iho-table/src/plugins/filterRenderPlugin/dist/index.d.ts +0 -3
  170. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/dist/index.d.ts +0 -3
  171. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/dist/defaultRendererPlugin.d.ts +0 -3
  172. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/dist/seqRendererPlugin.d.ts +0 -3
  173. package/es/components/iho-table/src/plugins/varialbleHeightPlugin/dist/index.d.ts +0 -3
  174. package/es/components/iho-table/src/utils/dist/index.d.ts +0 -44
  175. package/es/components/scale-view/src/components/formitem/dist/r-address.d.ts +0 -36
  176. package/es/components/scale-view/src/components/formitem/dist/r-sign.d.ts +0 -36
  177. package/es/components/scale-view/src/components/formitem/dist/standard-modal.d.ts +0 -82
  178. package/es/components/search-cascader/src/components/dist/SearchMenu.d.ts +0 -57
  179. package/es/components/search-cascader/src/components/dist/SearchMenu1.d.ts +0 -57
  180. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic1.vue.d.ts +0 -61
  181. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +0 -218
  182. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.js +0 -1
  183. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue2.js +0 -1
  184. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.js +0 -1
  185. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue2.js +0 -1
  186. package/es/components/table-filter/src/components/render-widget/components/DateQuickBtn/index.vue.d.ts +0 -71
  187. package/es/components/table-filter/src/components/render-widget/components/DateQuickBtn/index.vue.js +0 -1
  188. package/es/components/table-filter/src/components/render-widget/components/DateQuickBtn/index.vue2.js +0 -1
  189. package/es/components/table-filter/src/components/render-widget/components/Select1.vue.d.ts +0 -45
  190. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +0 -175
  191. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.js +0 -1
  192. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +0 -1
  193. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue.d.ts +0 -114
  194. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue.js +0 -1
  195. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +0 -1
  196. package/es/components/table-filter/src/components/render-widget/helpers/dateDisabled.d.ts +0 -27
  197. package/es/components/table-filter/src/components/render-widget/helpers/dateDisabled.js +0 -1
  198. package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.d.ts +0 -55
  199. package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +0 -1
  200. package/es/components/table-filter/src/components/render-widget/helpers/enums.d.ts +0 -56
  201. package/es/components/table-filter/src/components/render-widget/helpers/enums.js +0 -1
  202. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  203. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  204. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -114,7 +114,6 @@ declare const _default: import("vue").DefineComponent<{
114
114
  onSetup(): void;
115
115
  beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<AnyObject>;
116
116
  afterRequest(fieldKey: string, payload?: any): AnyObject[];
117
- afterOptionInit(fieldKey: string, options: AnyObject[]): void;
118
117
  }>>;
119
118
  };
120
119
  requestInstance: {
@@ -134,10 +133,6 @@ declare const _default: import("vue").DefineComponent<{
134
133
  type: (BooleanConstructor | StringConstructor)[];
135
134
  default: boolean;
136
135
  };
137
- uniqueCacheData: {
138
- type: BooleanConstructor;
139
- default: boolean;
140
- };
141
136
  }, {
142
137
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
143
138
  fieldList: {
@@ -251,7 +246,6 @@ declare const _default: import("vue").DefineComponent<{
251
246
  onSetup(): void;
252
247
  beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<AnyObject>;
253
248
  afterRequest(fieldKey: string, payload?: any): AnyObject[];
254
- afterOptionInit(fieldKey: string, options: AnyObject[]): void;
255
249
  }>>;
256
250
  };
257
251
  requestInstance: {
@@ -271,16 +265,12 @@ declare const _default: import("vue").DefineComponent<{
271
265
  type: (BooleanConstructor | StringConstructor)[];
272
266
  default: boolean;
273
267
  };
274
- uniqueCacheData: {
275
- type: BooleanConstructor;
276
- default: boolean;
277
- };
278
268
  }>> & {
279
269
  onFormChange?: ((...args: any[]) => any) | undefined;
280
270
  onScroll?: ((...args: any[]) => any) | undefined;
281
271
  onAnnotationChange?: ((...args: any[]) => any) | undefined;
282
272
  }>>;
283
- emit: (event: "formChange" | "scroll" | "annotationChange", ...args: any[]) => void;
273
+ emit: (event: "scroll" | "formChange" | "annotationChange", ...args: any[]) => void;
284
274
  cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
285
275
  nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
286
276
  formRenderRef: import("vue").Ref<HTMLElement | undefined>;
@@ -300,17 +290,6 @@ declare const _default: import("vue").DefineComponent<{
300
290
  title: string;
301
291
  }[]>;
302
292
  onScroll: (scrollEvent: Event) => void;
303
- callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
304
- onSetup(): void;
305
- beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<AnyObject>;
306
- afterRequest(fieldKey: string, payload?: any): AnyObject[];
307
- afterOptionInit(fieldKey: string, options: AnyObject[]): void;
308
- }>>[T]> | undefined) => import("../../../../es/shared/types").UndefinedAble<ReturnType<Required<Partial<{
309
- onSetup(): void;
310
- beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<AnyObject>;
311
- afterRequest(fieldKey: string, payload?: any): AnyObject[];
312
- afterOptionInit(fieldKey: string, options: AnyObject[]): void;
313
- }>>[T]>>;
314
293
  triggerAutoHidden: (field: import("@formily/core").GeneralField) => Promise<void>;
315
294
  observeFormGraph: Record<string, import("@formily/core").GeneralField>;
316
295
  setGraph: (field: import("@formily/core").GeneralField) => void;
@@ -454,11 +433,11 @@ declare const _default: import("vue").DefineComponent<{
454
433
  onFocus: (...args: any[]) => Promise<void>;
455
434
  onBlur: (...args: any[]) => Promise<void>;
456
435
  onInput: (...args: any[]) => Promise<void>;
457
- editable: boolean;
458
436
  reset: (options?: import("@formily/core").IFieldResetOptions | undefined) => Promise<void>;
459
437
  title: string;
438
+ editable: boolean;
460
439
  visible: boolean;
461
- submit: <T_1>(onSubmit?: ((values: any) => void | Promise<T_1>) | undefined) => Promise<T_1>;
440
+ submit: <T>(onSubmit?: ((values: any) => void | Promise<T>) | undefined) => Promise<T>;
462
441
  validator: import("@formily/core").FieldValidator;
463
442
  pattern: import("@formily/core").FieldPatternTypes;
464
443
  content: any;
@@ -602,7 +581,7 @@ declare const _default: import("vue").DefineComponent<{
602
581
  readonly displayDirective: "if" | "show" | "show:lazy";
603
582
  }>;
604
583
  NTabs: any;
605
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("formChange" | "scroll" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
584
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("scroll" | "formChange" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
606
585
  fieldList: {
607
586
  type: PropType<FieldItem[]>;
608
587
  };
@@ -714,7 +693,6 @@ declare const _default: import("vue").DefineComponent<{
714
693
  onSetup(): void;
715
694
  beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<AnyObject>;
716
695
  afterRequest(fieldKey: string, payload?: any): AnyObject[];
717
- afterOptionInit(fieldKey: string, options: AnyObject[]): void;
718
696
  }>>;
719
697
  };
720
698
  requestInstance: {
@@ -734,10 +712,6 @@ declare const _default: import("vue").DefineComponent<{
734
712
  type: (BooleanConstructor | StringConstructor)[];
735
713
  default: boolean;
736
714
  };
737
- uniqueCacheData: {
738
- type: BooleanConstructor;
739
- default: boolean;
740
- };
741
715
  }>> & {
742
716
  onFormChange?: ((...args: any[]) => any) | undefined;
743
717
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -754,6 +728,5 @@ declare const _default: import("vue").DefineComponent<{
754
728
  enterToNextWidget: boolean | ((fieldItem: FieldItem) => boolean | void);
755
729
  linebarAutoHidden: boolean;
756
730
  bordered: string | boolean;
757
- uniqueCacheData: boolean;
758
731
  }>;
759
732
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as j,createCommentVNode as g,createElementVNode as b,withKeys as k,withModifiers as v,toDisplayString as F,renderSlot as C}from"vue";import{useTheme as S}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as H,cloneDeep as x}from"lodash-es";import{createForm as A,onFieldValueChange as L,onFieldMount as R,onFieldUnmount as O,onFieldReact as w,onFormMount as B}from"@formily/core";import{FormProvider as _,FormConsumer as V}from"@formily/vue";import{NForm as D,NTabs as I,NTabPane as N,NConfigProvider as q}from"naive-ui";import{InjectionFormLifeCycleCaller as T,InjectionFormGraph as U}from"./constants/index.js";import{useAutoHidden as W}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as E}from"./hooks/useComplexOptions.js";import{useFormDomEvent as G,useFormExposeEvent as K}from"./hooks/useFormEvent.js";import{useFormGraph as M}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as P}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as J}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as $}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as z}from"./hooks/useNuiThemeOverrides.js";import"./utils/index.js";import{useFieldListAdaptor as Q}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as X}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as Y}from"./hooks/useFormValidator.js";import{useAnchor as Z}from"./hooks/useAnchor.js";import{useFormContext as ee}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import{createObjSchema as oe}from"./utils/schema.js";const te={key:0,style:{height:"54px"}},re={style:{"white-space":"pre"}};var se=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},uniqueCacheData:{type:Boolean,default:!1}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:se,emit:ae}){const ie=e,le=S(),{nuiThemeOverrides:ne}=z();Y();const me=o(),de=t((()=>H(ie.maxHeight)?ie.maxHeight+"px":ie.maxHeight)),{SchemaField:pe,businessCollector:ue,formItemDepsCollector:ce,changeContextCollector:fe,formUUID:he}=ee(ie,ae),{anchorBarRef:ye,currentAnchor:je,updateAnchorList:ge,anchorIdList:be,onScroll:ke}=Z(ie,ae,me,ce),{callLifeCycle:ve}=P(ie);r(T,ve),ve("onSetup");const{trigger:Fe}=W(),{observeFormGraph:Ce,setGraph:Se,removeGraph:He}=M();r(U,Ce);const{lowCodeEventTrigger:xe}=J(),Ae=A({initialValues:ie.initialData,effects(e){L("*",(o=>{const t=o.props.name.toString();ue.trigger(e,t),ce.trigger(t),ae("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:fe.getContext(t,o.value)}),xe(o),Le(t,o.value)})),R("*",Se),O("*",He),ie.linebarAutoHidden&&(w("*",Fe),B((e=>e.query("*").forEach(Fe)))),ie.anchor&&w("*",ge)}}),{lowCodeReactionsHandler:Le,triggerAllReactionsHandler:Re}=$(t((()=>ie.lowCodeReactions)),Ae);s(Re);const{schemaAdaptor:Oe}=Q(ue);let we=ie.fieldList||[];const Be=t((()=>ie.schema?ie.schema:ie.fieldList?(we=X().traverse(x(ie.fieldList),ie.fieldVisitor),oe(Oe(we))):oe({}))),{onKeydown:_e}=G({formModel:Ae,formRenderRef:me,props:ie}),{clearSpan:Ve}=E();a((()=>Ve(he)));const De=K({formModel:Ae,formRenderRef:me,formItemDepsCollector:ce,getFieldList:()=>we,formUUID:he});return se({formModel:Ae,validate:(e="*")=>De.validate(e),getFormValues:(e=!0)=>De.getFormValues(e),async setFormValues(e,o=!0,t=!1,r=!0){t&&(ue.triggerLock=!0),De.setFormValues(e,o,r),await i(),ue.triggerLock=!1},setFieldState(e,o){De.setFieldState(e,o)},resetFields(e="*"){De.resetFields(e)},queryWidget:async e=>De.queryWidget(e),getFieldList:()=>we,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(D),{class:d(["form-render",{"form-render--no-border":!e.bordered,"form-render--underline":"underline"===e.bordered}]),"require-mark-placement":"left",style:p(m(le))},{default:u((()=>[e.anchor?(l(),c("section",te,[f(m(I),{value:m(je),"onUpdate:value":t[0]||(t[0]=e=>h(je)?je.value=e:null),type:"line",ref_key:"anchorBarRef",ref:ye},{default:u((()=>[(l(!0),c(y,null,j(m(be),(e=>(l(),n(m(N),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):g("v-if",!0),f(m(q),{"theme-overrides":m(ne)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":m(de)}),ref_key:"formRenderRef",ref:me,onScroll:t[1]||(t[1]=(...e)=>m(ke)&&m(ke)(...e)),onKeydownCapture:t[2]||(t[2]=k(v(((...e)=>m(_e)&&m(_e)(...e)),["prevent"]),["enter"]))},[f(m(_),{form:m(Ae)},{default:u((()=>[f(m(pe),{schema:m(Be)},null,8,["schema"]),e.consumer?(l(),n(m(V),{key:0},{default:u((({form:e})=>[b("div",re,F(JSON.stringify(e.values,null,2)),1)])),_:1})):g("v-if",!0),C(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}});export{se as default};
1
+ import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as j,createCommentVNode as g,createElementVNode as b,withKeys as k,withModifiers as v,toDisplayString as F,renderSlot as C}from"vue";import{useTheme as S}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as H,cloneDeep as x}from"lodash-es";import{createForm as A,onFieldValueChange as L,onFieldMount as R,onFieldUnmount as O,onFieldReact as w,onFormMount as _}from"@formily/core";import{FormProvider as B,FormConsumer as V}from"@formily/vue";import{NForm as I,NTabs as N,NTabPane as D,NConfigProvider as q}from"naive-ui";import{InjectionFormGraph as T}from"./constants/index.js";import{useAutoHidden as U}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as W}from"./hooks/useComplexOptions.js";import{useFormDomEvent as E,useFormExposeEvent as G}from"./hooks/useFormEvent.js";import{useFormGraph as K}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as M}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as P}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as J}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as $}from"./hooks/useNuiThemeOverrides.js";import"./utils/index.js";import{useFieldListAdaptor as z}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as Q}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as X}from"./hooks/useFormValidator.js";import{useAnchor as Y}from"./hooks/useAnchor.js";import{useFormContext as Z}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import{createObjSchema as ee}from"./utils/schema.js";const oe={key:0,style:{height:"54px"}},te={style:{"white-space":"pre"}};var re=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:re,emit:se}){const ae=e,ie=S(),{nuiThemeOverrides:le}=$();X();const ne=o(),me=t((()=>H(ae.maxHeight)?ae.maxHeight+"px":ae.maxHeight)),{SchemaField:de,businessCollector:pe,formItemDepsCollector:ue,changeContextCollector:ce,formUUID:fe}=Z(ae,se),{anchorBarRef:he,currentAnchor:ye,updateAnchorList:je,anchorIdList:ge,onScroll:be}=Y(ae,se,ne,ue);M(ae).callLifeCycle("onSetup");const{trigger:ke}=U(),{observeFormGraph:ve,setGraph:Fe,removeGraph:Ce}=K();r(T,ve);const{lowCodeEventTrigger:Se}=P(),He=A({initialValues:ae.initialData,effects(e){L("*",(o=>{const t=o.props.name.toString();pe.trigger(e,t),ue.trigger(t),se("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:ce.getContext(t,o.value)}),Se(o),xe(t,o.value)})),R("*",Fe),O("*",Ce),ae.linebarAutoHidden&&(w("*",ke),_((e=>e.query("*").forEach(ke)))),ae.anchor&&w("*",je)}}),{lowCodeReactionsHandler:xe,triggerAllReactionsHandler:Ae}=J(t((()=>ae.lowCodeReactions)),He);s(Ae);const{schemaAdaptor:Le}=z(pe);let Re=ae.fieldList||[];const Oe=t((()=>ae.schema?ae.schema:ae.fieldList?(Re=Q().traverse(x(ae.fieldList),ae.fieldVisitor),ee(Le(Re))):ee({}))),{onKeydown:we}=E({formModel:He,formRenderRef:ne,props:ae}),{clearSpan:_e}=W();a((()=>_e(fe)));const Be=G({formModel:He,formRenderRef:ne,formItemDepsCollector:ue,getFieldList:()=>Re,formUUID:fe});return re({formModel:He,validate:(e="*")=>Be.validate(e),getFormValues:(e=!0)=>Be.getFormValues(e),async setFormValues(e,o=!0,t=!1,r=!0){t&&(pe.triggerLock=!0),Be.setFormValues(e,o,r),await i(),pe.triggerLock=!1},setFieldState(e,o){Be.setFieldState(e,o)},resetFields(e="*"){Be.resetFields(e)},queryWidget:async e=>Be.queryWidget(e),getFieldList:()=>Re,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(I),{class:d(["form-render",{"form-render--no-border":!e.bordered,"form-render--underline":"underline"===e.bordered}]),"require-mark-placement":"left",style:p(m(ie))},{default:u((()=>[e.anchor?(l(),c("section",oe,[f(m(N),{value:m(ye),"onUpdate:value":t[0]||(t[0]=e=>h(ye)?ye.value=e:null),type:"line",ref_key:"anchorBarRef",ref:he},{default:u((()=>[(l(!0),c(y,null,j(m(ge),(e=>(l(),n(m(D),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):g("v-if",!0),f(m(q),{"theme-overrides":m(le)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":m(me)}),ref_key:"formRenderRef",ref:ne,onScroll:t[1]||(t[1]=(...e)=>m(be)&&m(be)(...e)),onKeydownCapture:t[2]||(t[2]=k(v(((...e)=>m(we)&&m(we)(...e)),["prevent"]),["enter"]))},[f(m(B),{form:m(He)},{default:u((()=>[f(m(de),{schema:m(Oe)},null,8,["schema"]),e.consumer?(l(),n(m(V),{key:0},{default:u((({form:e})=>[b("div",te,F(JSON.stringify(e.values,null,2)),1)])),_:1})):g("v-if",!0),C(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}});export{re as default};
@@ -118,7 +118,6 @@ declare const _default: import("vue").DefineComponent<{}, {
118
118
  onSetup(): void;
119
119
  beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
120
120
  afterRequest(fieldKey: string, payload?: any): import("../../../../es/shared/types").AnyObject[];
121
- afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[]): void;
122
121
  }>>;
123
122
  };
124
123
  requestInstance: {
@@ -138,10 +137,6 @@ declare const _default: import("vue").DefineComponent<{}, {
138
137
  type: (BooleanConstructor | StringConstructor)[];
139
138
  default: boolean;
140
139
  };
141
- uniqueCacheData: {
142
- type: BooleanConstructor;
143
- default: boolean;
144
- };
145
140
  }, {
146
141
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
147
142
  fieldList: {
@@ -255,7 +250,6 @@ declare const _default: import("vue").DefineComponent<{}, {
255
250
  onSetup(): void;
256
251
  beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
257
252
  afterRequest(fieldKey: string, payload?: any): import("../../../../es/shared/types").AnyObject[];
258
- afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[]): void;
259
253
  }>>;
260
254
  };
261
255
  requestInstance: {
@@ -275,16 +269,12 @@ declare const _default: import("vue").DefineComponent<{}, {
275
269
  type: (BooleanConstructor | StringConstructor)[];
276
270
  default: boolean;
277
271
  };
278
- uniqueCacheData: {
279
- type: BooleanConstructor;
280
- default: boolean;
281
- };
282
272
  }>> & {
283
273
  onFormChange?: ((...args: any[]) => any) | undefined;
284
274
  onScroll?: ((...args: any[]) => any) | undefined;
285
275
  onAnnotationChange?: ((...args: any[]) => any) | undefined;
286
276
  }>>;
287
- emit: (event: "formChange" | "scroll" | "annotationChange", ...args: any[]) => void;
277
+ emit: (event: "scroll" | "formChange" | "annotationChange", ...args: any[]) => void;
288
278
  cssVars: import("vue").ComputedRef<import("vue").CSSProperties>;
289
279
  nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
290
280
  formRenderRef: import("vue").Ref<HTMLElement | undefined>;
@@ -304,17 +294,6 @@ declare const _default: import("vue").DefineComponent<{}, {
304
294
  title: string;
305
295
  }[]>;
306
296
  onScroll: (scrollEvent: Event) => void;
307
- callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
308
- onSetup(): void;
309
- beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
310
- afterRequest(fieldKey: string, payload?: any): import("../../../../es/shared/types").AnyObject[];
311
- afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[]): void;
312
- }>>[T]> | undefined) => import("../../../../es/shared/types").UndefinedAble<ReturnType<Required<Partial<{
313
- onSetup(): void;
314
- beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
315
- afterRequest(fieldKey: string, payload?: any): import("../../../../es/shared/types").AnyObject[];
316
- afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[]): void;
317
- }>>[T]>>;
318
297
  triggerAutoHidden: (field: import("../../../../es/components/form-render").GeneralField) => Promise<void>;
319
298
  observeFormGraph: Record<string, import("../../../../es/components/form-render").GeneralField>;
320
299
  setGraph: (field: import("../../../../es/components/form-render").GeneralField) => void;
@@ -458,11 +437,11 @@ declare const _default: import("vue").DefineComponent<{}, {
458
437
  onFocus: (...args: any[]) => Promise<void>;
459
438
  onBlur: (...args: any[]) => Promise<void>;
460
439
  onInput: (...args: any[]) => Promise<void>;
461
- editable: boolean;
462
440
  reset: (options?: import("../../../../es/components/form-render").IFieldResetOptions | undefined) => Promise<void>;
463
441
  title: string;
442
+ editable: boolean;
464
443
  visible: boolean;
465
- submit: <T_1>(onSubmit?: ((values: any) => void | Promise<T_1>) | undefined) => Promise<T_1>;
444
+ submit: <T>(onSubmit?: ((values: any) => void | Promise<T>) | undefined) => Promise<T>;
466
445
  validator: import("../../../../es/components/form-render").FieldValidator;
467
446
  pattern: import("../../../../es/components/form-render").FieldPatternTypes;
468
447
  content: any;
@@ -606,7 +585,7 @@ declare const _default: import("vue").DefineComponent<{}, {
606
585
  readonly displayDirective: "if" | "show" | "show:lazy";
607
586
  }>;
608
587
  NTabs: any;
609
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("formChange" | "scroll" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
588
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("scroll" | "formChange" | "annotationChange")[], "scroll" | "formChange" | "annotationChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
610
589
  fieldList: {
611
590
  type: import("vue").PropType<import("../../../../es/components/form-render").FieldItem[]>;
612
591
  };
@@ -718,7 +697,6 @@ declare const _default: import("vue").DefineComponent<{}, {
718
697
  onSetup(): void;
719
698
  beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
720
699
  afterRequest(fieldKey: string, payload?: any): import("../../../../es/shared/types").AnyObject[];
721
- afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[]): void;
722
700
  }>>;
723
701
  };
724
702
  requestInstance: {
@@ -738,10 +716,6 @@ declare const _default: import("vue").DefineComponent<{}, {
738
716
  type: (BooleanConstructor | StringConstructor)[];
739
717
  default: boolean;
740
718
  };
741
- uniqueCacheData: {
742
- type: BooleanConstructor;
743
- default: boolean;
744
- };
745
719
  }>> & {
746
720
  onFormChange?: ((...args: any[]) => any) | undefined;
747
721
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -758,7 +732,6 @@ declare const _default: import("vue").DefineComponent<{}, {
758
732
  enterToNextWidget: boolean | ((fieldItem: import("../../../../es/components/form-render").FieldItem) => boolean | void);
759
733
  linebarAutoHidden: boolean;
760
734
  bordered: string | boolean;
761
- uniqueCacheData: boolean;
762
735
  }>;
763
736
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
764
737
  export default _default;
@@ -14,8 +14,8 @@ export declare const COMBINATION: import("vue").DefineComponent<{
14
14
  disabled: {
15
15
  type: BooleanConstructor;
16
16
  };
17
- properties: {
18
- type: PropType<FieldItem[]>;
17
+ getProperties: {
18
+ type: PropType<() => FieldItem[]>;
19
19
  default: () => never[];
20
20
  };
21
21
  combinationItemDeletable: {
@@ -39,8 +39,8 @@ export declare const COMBINATION: import("vue").DefineComponent<{
39
39
  disabled: {
40
40
  type: BooleanConstructor;
41
41
  };
42
- properties: {
43
- type: PropType<FieldItem[]>;
42
+ getProperties: {
43
+ type: PropType<() => FieldItem[]>;
44
44
  default: () => never[];
45
45
  };
46
46
  combinationItemDeletable: {
@@ -56,5 +56,5 @@ export declare const COMBINATION: import("vue").DefineComponent<{
56
56
  disabled: boolean;
57
57
  title: string;
58
58
  combinationItemDeletable: boolean | CombinationItemDeletableFn;
59
- properties: FieldItem[];
59
+ getProperties: () => FieldItem[];
60
60
  }>;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,computed as t,watch as a,inject as r,onBeforeUnmount as i,createVNode as n}from"vue";import{isObjectField as m}from"@formily/core";import{autorun as l}from"@formily/reactive";import{connect as u,RecursionField as s}from"@formily/vue";import{AddCircleOutline as c,RemoveCircle as p}from"@vicons/ionicons5";import{isNumber as d,isArray as f,isFunction as v,range as b}from"lodash-es";import{NButton as y,NIcon as x}from"naive-ui";import"../../../index.js";import{InjectionBusinessCollector as h}from"../../constants/index.js";import"../../utils/index.js";import{useFormField as _}from"../../hooks/useFormField.js";import{useFieldListAdaptor as j}from"../../hooks/useFieldListAdaptor.js";import{createObjSchema as C}from"../../utils/schema.js";const k=u(e({name:"FormCombination",props:{title:{type:String,default:""},value:{type:Array},maxGroupNum:{type:Number},disabled:{type:Boolean},properties:{type:Array,default:()=>[]},combinationItemDeletable:{type:[Boolean,Function],default:!0},onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e){const{field:u,fieldKey:k}=_(),F=o(1),I=t((()=>d(e.maxGroupNum)?e.maxGroupNum<1?0:~~e.maxGroupNum:1/0));function N(){F.value++}a((()=>e.value),(e=>{f(e)&&(F.value=Math.min(Math.max(e.length,1),I.value))}),{immediate:!0});const A=r(h),{schemaAdaptor:D}=j(A),G=o([]);return i(l((()=>{f(u.value.value)&&(G.value=u.value.value.map(((o,t)=>v(e.combinationItemDeletable)?e.combinationItemDeletable(o||{},t):e.combinationItemDeletable)))}))),()=>n("section",{class:"form-render__combination"},[n("header",{class:"form-render__combinationHeader"},[n("div",{class:"form-render__combinationHeaderText"},[e.title]),n(y,{onClick:N,text:!0,style:{"--n-text-color":"var(--c-primary-color)"},disabled:F.value>=I.value||e.disabled},{icon:()=>n(x,{component:c},null),default:()=>"新增"})]),b(F.value).map(((o,t)=>n("section",{class:"form-render__combinationContent"},[n(s,{schema:C(D(e.properties)),name:t},null),n(y,{text:!0,disabled:!G.value[t],type:"error",class:"form-render__combinationClose",onClick:()=>async function(e){if(F.value>1)F.value--,await u.value.remove(e);else{const o=u.value.query(`${k.value}.${e}`).take();if(!o||!m(o))return;await o.reset()}}(t)},{icon:()=>n(x,{component:p},null)})])))])}}));export{k as COMBINATION};
1
+ import{defineComponent as e,ref as o,computed as t,watch as a,inject as i,onBeforeUnmount as r,createVNode as n}from"vue";import{isObjectField as m}from"@formily/core";import{autorun as l}from"@formily/reactive";import{connect as u,RecursionField as s}from"@formily/vue";import{AddCircleOutline as c,RemoveCircle as p}from"@vicons/ionicons5";import{isNumber as d,isArray as f,isFunction as v,range as b}from"lodash-es";import{NButton as y,NIcon as x}from"naive-ui";import"../../../index.js";import{InjectionBusinessCollector as h}from"../../constants/index.js";import"../../utils/index.js";import{useFormField as _}from"../../hooks/useFormField.js";import{useFieldListAdaptor as j}from"../../hooks/useFieldListAdaptor.js";import{createObjSchema as C}from"../../utils/schema.js";const F=u(e({name:"FormCombination",props:{title:{type:String,default:""},value:{type:Array},maxGroupNum:{type:Number},disabled:{type:Boolean},getProperties:{type:Function,default:()=>[]},combinationItemDeletable:{type:[Boolean,Function],default:!0},onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e){const{field:u,fieldKey:F}=_(),g=o(1),k=t((()=>d(e.maxGroupNum)?e.maxGroupNum<1?0:~~e.maxGroupNum:1/0));function I(){g.value++}a((()=>e.value),(e=>{f(e)&&(g.value=Math.min(Math.max(e.length,1),k.value))}),{immediate:!0});const N=i(h),{schemaAdaptor:D}=j(N),G=o([]);return r(l((()=>{f(u.value.value)&&(G.value=u.value.value.map(((o,t)=>v(e.combinationItemDeletable)?e.combinationItemDeletable(o||{},t):e.combinationItemDeletable)))}))),()=>n("section",{class:"form-render__combination"},[n("header",{class:"form-render__combinationHeader"},[n("div",{class:"form-render__combinationHeaderText"},[e.title]),n(y,{onClick:I,text:!0,style:{"--n-text-color":"var(--c-primary-color)"},disabled:g.value>=k.value||e.disabled},{icon:()=>n(x,{component:c},null),default:()=>"新增"})]),b(g.value).map(((o,t)=>n("section",{class:"form-render__combinationContent"},[n(s,{schema:C(D(e.getProperties())),name:t},null),n(y,{text:!0,disabled:!G.value[t],type:"error",class:"form-render__combinationClose",onClick:()=>async function(e){if(g.value>1)g.value--,await u.value.remove(e);else{const o=u.value.query(`${F.value}.${e}`).take();if(!o||!m(o))return;await o.reset()}}(t)},{icon:()=>n(x,{component:p},null)})])))])}}));export{F as COMBINATION};
@@ -11,8 +11,8 @@ export declare const JSON_COMBINATION: import("vue").DefineComponent<{
11
11
  maxGroupNum: {
12
12
  type: NumberConstructor;
13
13
  };
14
- properties: {
15
- type: PropType<FieldItem[]>;
14
+ getProperties: {
15
+ type: PropType<() => FieldItem[]>;
16
16
  default: () => never[];
17
17
  };
18
18
  onInput: {};
@@ -29,8 +29,8 @@ export declare const JSON_COMBINATION: import("vue").DefineComponent<{
29
29
  maxGroupNum: {
30
30
  type: NumberConstructor;
31
31
  };
32
- properties: {
33
- type: PropType<FieldItem[]>;
32
+ getProperties: {
33
+ type: PropType<() => FieldItem[]>;
34
34
  default: () => never[];
35
35
  };
36
36
  onInput: {};
@@ -40,5 +40,5 @@ export declare const JSON_COMBINATION: import("vue").DefineComponent<{
40
40
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
41
41
  }, {
42
42
  title: string;
43
- properties: FieldItem[];
43
+ getProperties: () => FieldItem[];
44
44
  }>;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,computed as r,watch as t,onMounted as n,createVNode as i}from"vue";import{isField as l}from"@formily/core";import{Path as a}from"@formily/path";import{AddCircleOutline as u,RemoveCircle as s}from"@vicons/ionicons5";import{isNumber as m,range as p,isArray as c,isEqual as f}from"lodash-es";import{useDeepValidate as v}from"./hooks/useDeepValidate.js";import{formRenderLog as d,mergeDeepProperties as y}from"../../../utils/index.js";import{connect as h,mapProps as g}from"@formily/vue";import{useDebounceFn as b,isObject as x}from"@vueuse/core";import{NButton as N,NIcon as _}from"naive-ui";import C from"../../../FormRender.vue.js";import{assignUpdateValue as j}from"../../../utils/schema.js";const I=h(e({name:"FormJsonCombination",props:{title:{type:String,default:""},value:{type:[String,Array]},maxGroupNum:{type:Number},properties:{type:Array,default:()=>[]},onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e,{emit:h}){d("当前COMBINATION控件为json模式,推荐使用非json模式,FieldItem.jsonCombination=false");const g=b((function(){h("update:value",JSON.stringify(j.value))}),300),j=o([]),I=r((()=>j.value.length));function S(o,r=!1){c(o)&&(o.length||o.push({}),o=JSON.stringify(o));const t=function(e){try{if(!e)return null;const o=JSON.parse(e);return Array.isArray(o)?o:null}catch(e){return null}}(o);var n;(n=t)&&!f(n,j.value)&&(t.splice(O.value),t.forEach((function(o,t){if(!x(o))return;j.value[t]=o,r&&y(o,e.properties)})),j.value.splice(t.length),j.value.forEach(F))}t((()=>e.value),(e=>S(e))),n((()=>{S(e.value||"[{}]",!0),g()}));const A=o([]);function F(e,o){var r;null==(r=A.value[o])||r.setFieldState("*",(o=>{l(o)&&(o.value=a.getIn(e,o.path))}))}function J(){j.value.push(y({},e.properties)),g()}v().bindDeepValidate(A);const O=r((()=>m(e.maxGroupNum)?e.maxGroupNum<1?0:~~e.maxGroupNum:1/0));t(O,(e=>{I.value<=e||(j.value.splice(e),g(),A.value.splice(e))}),{immediate:!0});const G=C;return()=>i("section",{class:"form-render__combination"},[i("header",{class:"form-render__combinationHeader"},[i("div",{class:"form-render__combinationHeaderText"},[e.title]),i(N,{onClick:J,style:{"--n-text-color":"var(--c-primary-color)"},text:!0,disabled:I.value>=O.value},{icon:()=>i(_,{component:u},null),default:()=>"新增"})]),p(I.value).map(((o,r)=>i("section",{class:"form-render__combinationContentJson"},[i(G,{ref:e=>function(e,o){A.value[e]=o,F(j.value[e]||{},e)}(r,e),fieldList:e.properties,onFormChange:e=>function(e,{fieldKey:o,value:r}){!j.value[e]&&(j.value[e]={}),a.setIn(j.value[e],o,r),g()}(r,e)},null),i(N,{text:!0,class:"form-render__combinationClose",type:"error",onClick:()=>function(e){j.value.length>1?(j.value.splice(e,1),A.value.splice(e,1)):j.value.splice(e,1,{}),g()}(r)},{icon:()=>i(_,{component:s},null)})])))])}}),g(j));export{I as JSON_COMBINATION};
1
+ import{defineComponent as e,ref as o,computed as t,watch as r,onMounted as n,createVNode as i}from"vue";import{isField as l}from"@formily/core";import{Path as a}from"@formily/path";import{AddCircleOutline as u,RemoveCircle as s}from"@vicons/ionicons5";import{isNumber as m,range as c,isArray as p,isEqual as f}from"lodash-es";import{useDeepValidate as v}from"./hooks/useDeepValidate.js";import{formRenderLog as d,mergeDeepProperties as h}from"../../../utils/index.js";import{connect as y,mapProps as g}from"@formily/vue";import{useDebounceFn as b,isObject as x}from"@vueuse/core";import{NButton as N,NIcon as _}from"naive-ui";import C from"../../../FormRender.vue.js";import{assignUpdateValue as j}from"../../../utils/schema.js";const F=y(e({name:"FormJsonCombination",props:{title:{type:String,default:""},value:{type:[String,Array]},maxGroupNum:{type:Number},getProperties:{type:Function,default:()=>[]},onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e,{emit:y}){d("当前COMBINATION控件为json模式,推荐使用非json模式,FieldItem.jsonCombination=false");const g=b((function(){y("update:value",JSON.stringify(j.value))}),300),j=o([]),F=t((()=>j.value.length));function I(o,t=!1){p(o)&&(o.length||o.push({}),o=JSON.stringify(o));const r=function(e){try{if(!e)return null;const o=JSON.parse(e);return Array.isArray(o)?o:null}catch(e){return null}}(o);var n;(n=r)&&!f(n,j.value)&&(r.splice(A.value),r.forEach((function(o,r){if(!x(o))return;j.value[r]=o,t&&h(o,e.getProperties())})),j.value.splice(r.length),j.value.forEach(J))}r((()=>e.value),(e=>I(e))),n((()=>{I(e.value||"[{}]",!0),g()}));const S=o([]);function J(e,o){var t;null==(t=S.value[o])||t.setFieldState("*",(o=>{l(o)&&(o.value=a.getIn(e,o.path))}))}function O(){j.value.push(h({},e.getProperties())),g()}v().bindDeepValidate(S);const A=t((()=>m(e.maxGroupNum)?e.maxGroupNum<1?0:~~e.maxGroupNum:1/0));r(A,(e=>{F.value<=e||(j.value.splice(e),g(),S.value.splice(e))}),{immediate:!0});const G=C;return()=>i("section",{class:"form-render__combination"},[i("header",{class:"form-render__combinationHeader"},[i("div",{class:"form-render__combinationHeaderText"},[e.title]),i(N,{onClick:O,style:{"--n-text-color":"var(--c-primary-color)"},text:!0,disabled:F.value>=A.value},{icon:()=>i(_,{component:u},null),default:()=>"新增"})]),c(F.value).map(((o,t)=>i("section",{class:"form-render__combinationContentJson"},[i(G,{ref:e=>function(e,o){S.value[e]=o,J(j.value[e]||{},e)}(t,e),fieldList:e.getProperties(),onFormChange:e=>function(e,{fieldKey:o,value:t}){!j.value[e]&&(j.value[e]={}),a.setIn(j.value[e],o,t),g()}(t,e)},null),i(N,{text:!0,class:"form-render__combinationClose",type:"error",onClick:()=>function(e){j.value.length>1?(j.value.splice(e,1),S.value.splice(e,1)):j.value.splice(e,1,{}),g()}(t)},{icon:()=>i(_,{component:s},null)})])))])}}),g(j));export{F as JSON_COMBINATION};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as r,computed as t,inject as o,watch as a,createVNode as n}from"vue";import{useVModel as u}from"@vueuse/core";import{isEqual as l,isString as i,isNumber as s,isEmpty as c,isFunction as d,omit as v}from"lodash-es";import"../../../index.js";import{InjectionAsyncQueue as p}from"../../constants/index.js";import{useCommonInjection as f}from"../../hooks/useCommonInjection.js";import{formRenderLog as m}from"../../utils/index.js";import{connect as y,mapProps as h}from"@formily/vue";import k from"../../../../search-cascader/index.js";import j from"../../../../../shared/components/no-data/NoData.vue.js";import{assignUpdateValue as _,createVisitedSetter as w}from"../../utils/schema.js";import{useFormField as b}from"../../hooks/useFormField.js";import{useFormRequest as g}from"../../hooks/useFormRequest.js";const F=y(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},onChange:{},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:y}){const h=u(e,"value",y),_=r(!1),F=r([]),{field:K,fieldKey:O}=b(),q=t((()=>{var r,t,o;return null!=(o=null==(t=null==(r=e.wordbook)?void 0:r.show_key)?void 0:t[0])?o:e.labelField})),S=t((()=>{var r,t;return null!=(t=null==(r=e.wordbook)?void 0:r.value_key)?t:e.valueField})),x=t((()=>{var r,t;return null==(t=null==(r=e.wordbook)?void 0:r.render_key)?void 0:t[0]})),C=t((()=>{var r;return(null==(r=e.wordbook)?void 0:r.level_num)||1/0})),L=o(p),{getSearchRequestInfo:V}=g(),A=r(150),I=r();async function P(r,t){var o;try{if(r&&!r.__keyword&&r.isLeaf)return a(r);if(null==r?void 0:r.__keyword){if(!i(r.id_link))return Promise.reject();const t=r.id_link.split("_").filter((e=>e));s(C.value)&&C.value!==1/0&&t.splice(C.value);const o=await async function(r){if(!V().primaryKeyUrl)return[];try{return await L.addAsync(t(e.wordbook,e.autograph,r,O.value))}catch(e){i(e)&&m(e)}function t(r,t,o,a){const n=V();return{key:a,params:{autograph:t,tableId:r.id,primaryKeyValue:o.join(","),page:1},...n,url:n.primaryKeyUrl,cache:e.requestCache}}}(t);if(!o)return Promise.reject();const{lastOption:a,options:n}=function(e,r){let t=e[0];return{options:r.reduce(((r,a,n)=>{const u=o(e,a);return 0===n?(t=u,[u]):(Object.assign(u,{parent:t,isLeaf:n+1>=C.value}),t.children=[u],t=u,r)}),[]),lastOption:t};function o(e,r){return e.find((e=>e[S.value]===r))}}(o,t);return n.length<C.value&&(await P(a),c(a.children))?(h.value=function(e,r){return r.map((r=>e.find((e=>e[S.value]===r))))}(o,t),_.value=!1,Promise.reject()):(F.value=n,a)}{const u=await L.addAsync(function(r,o,a,n,u){const l={autograph:()=>o,wordbookId:"id",wordbookType:"type",fieldKeys:()=>r.search_key?JSON.stringify(r.search_key):void 0,conObj:()=>JSON.stringify(function(e,r,t){return r?e.conObj||[]:t?[{con:"EQ",is_compare_field:!1,field_key:e.level_key,value:t[S.value]}]:e.conObjFirstLevel||[]}(r,t,n)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>t,page:()=>1},s=Object.entries(l).reduce(((e,[t,o])=>(e[t]=i(o)?r[o]:d(o)?o():void 0,e)),{});return{...V(),params:s,key:u,cache:e.requestCache}}(e.wordbook,e.autograph,K.value,r,O.value));if(r){if(!u.length)return a(r);r.children=u.map((e=>function(e,r,t){return{...e,parent:r,isLeaf:n(r)+1>=t}}(e,r,C.value)))}else F.value=u.map((e=>function(e,r){e.__keyword=!!r,e.isLeaf=!!r,r&&(e[q.value]=e[x.value||q.value]||e[q.value]);return e}(e,t))),A.value=t&&(null==(o=I.value)?void 0:o.getWidth())||150}}catch(e){i(e)&&m(e)}function a(e){return h.value=function(e){const r=[];let t=e;for(;t;)r.unshift(v(t,["parent","isLeaf","__keyword","children"])),t=t.parent;return r}(e),_.value=!1,Promise.reject()}function n(e){let r=1,t=e.parent;for(;t;)r++,t=t.parent;return r}}a((()=>e.wordbook),((r,t)=>{l(r,t)||(F.value=[],r&&(h.value||!e.lazyRequest)&&P())}),{immediate:!0});const{injectValueValidate:R,injectValueWatchFromEmpty:U,injectValueBindKey:B}=f();U(h,P),R(h);const N=B(h);return()=>n(k,{ref:I,value:h.value,"onUpdate:value":e=>h.value=e,show:_.value,"onUpdate:show":e=>_.value=e,options:F.value,key:N.value,labelKey:q.value,valueKey:S.value,search:P,onFocus:w(K),menuWidth:A.value},{empty:()=>n(j,null,null)})}}),h({dataSource:"options"},_));export{F as LEVEL_SEARCH_CASCADER};
1
+ import{defineComponent as e,ref as r,computed as t,inject as o,watch as a,createVNode as n}from"vue";import{useVModel as u}from"@vueuse/core";import{isEqual as l,isString as i,isNumber as s,isEmpty as c,isFunction as d,omit as p}from"lodash-es";import"../../../index.js";import{InjectionAsyncQueue as v}from"../../constants/index.js";import{useCommonInjection as f}from"../../hooks/useCommonInjection.js";import{formRenderLog as m}from"../../utils/index.js";import{connect as y,mapProps as h}from"@formily/vue";import k from"../../../../search-cascader/index.js";import j from"../../../../../shared/components/no-data/NoData.vue.js";import{assignUpdateValue as _,createVisitedSetter as w}from"../../utils/schema.js";import{useFormField as b}from"../../hooks/useFormField.js";import{useFormRequest as g}from"../../hooks/useFormRequest.js";const F=y(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},onChange:{},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:y}){const h=u(e,"value",y),_=r(!1),F=r([]),{field:K,fieldKey:O}=b(),q=t((()=>{var r,t,o;return null!=(o=null==(t=null==(r=e.wordbook)?void 0:r.show_key)?void 0:t[0])?o:e.labelField})),S=t((()=>{var r,t;return null!=(t=null==(r=e.wordbook)?void 0:r.value_key)?t:e.valueField})),x=t((()=>{var r,t;return null==(t=null==(r=e.wordbook)?void 0:r.render_key)?void 0:t[0]})),C=t((()=>{var r;return(null==(r=e.wordbook)?void 0:r.level_num)||1/0})),L=o(v),{getSearchRequestInfo:V}=g();async function A(r,t){try{if(r&&!r.__keyword&&r.isLeaf)return o(r);if(null==r?void 0:r.__keyword){if(!i(r.id_link))return Promise.reject();const t=r.id_link.split("_").filter((e=>e));s(C.value)&&C.value!==1/0&&t.splice(C.value);const o=await async function(r){if(!V().primaryKeyUrl)return[];try{return await L.addAsync(t(e.wordbook,e.autograph,r,O.value))}catch(e){i(e)&&m(e)}function t(r,t,o,a){const n=V();return{key:a,params:{autograph:t,tableId:r.id,primaryKeyValue:o.join(","),page:1},...n,url:n.primaryKeyUrl,cache:e.requestCache}}}(t);if(!o)return Promise.reject();const{lastOption:a,options:n}=function(e,r){let t=e[0];return{options:r.reduce(((r,a,n)=>{const u=o(e,a);return 0===n?(t=u,[u]):(Object.assign(u,{parent:t,isLeaf:n+1>=C.value}),t.children=[u],t=u,r)}),[]),lastOption:t};function o(e,r){return e.find((e=>e[S.value]===r))}}(o,t);return n.length<C.value&&(await A(a),c(a.children))?(h.value=function(e,r){return r.map((r=>e.find((e=>e[S.value]===r))))}(o,t),_.value=!1,Promise.reject()):(F.value=n,a)}{const n=await L.addAsync(function(r,o,a,n,u){const l={autograph:()=>o,wordbookId:"id",wordbookType:"type",fieldKeys:()=>r.search_key?JSON.stringify(r.search_key):void 0,conObj:()=>JSON.stringify(function(e,r,t){return r?e.conObj||[]:t?[{con:"EQ",is_compare_field:!1,field_key:e.level_key,value:t[S.value]}]:e.conObjFirstLevel||[]}(r,t,n)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>t,page:()=>1},s=Object.entries(l).reduce(((e,[t,o])=>(e[t]=i(o)?r[o]:d(o)?o():void 0,e)),{});return{...V(),params:s,key:u,cache:e.requestCache}}(e.wordbook,e.autograph,K.value,r,O.value));if(r){if(!n.length)return o(r);r.children=n.map((e=>function(e,r,t){return{...e,parent:r,isLeaf:a(r)+1>=t}}(e,r,C.value)))}else F.value=n.map((e=>function(e,r){e.__keyword=!!r,e.isLeaf=!!r,r&&(e[q.value]=e[x.value||q.value]||e[q.value]);return e}(e,t)))}}catch(e){i(e)&&m(e)}function o(e){return h.value=function(e){const r=[];let t=e;for(;t;)r.unshift(p(t,["parent","isLeaf","__keyword","children"])),t=t.parent;return r}(e),_.value=!1,Promise.reject()}function a(e){let r=1,t=e.parent;for(;t;)r++,t=t.parent;return r}}a((()=>e.wordbook),((r,t)=>{l(r,t)||(F.value=[],r&&(h.value||!e.lazyRequest)&&A())}),{immediate:!0});const{injectValueValidate:I,injectValueWatchFromEmpty:P,injectValueBindKey:R}=f();P(h,A),I(h);const U=R(h);return()=>n(k,{value:h.value,"onUpdate:value":e=>h.value=e,show:_.value,"onUpdate:show":e=>_.value=e,options:F.value,key:U.value,labelKey:q.value,valueKey:S.value,search:A,onFocus:w(K)},{empty:()=>n(j,null,null)})}}),h({dataSource:"options"},_));export{F as LEVEL_SEARCH_CASCADER};
@@ -2,7 +2,6 @@ import { Nullable } from '../../../../../es/shared/types';
2
2
  import { GeneralField } from '@formily/core';
3
3
  import { AnnotationItem } from '../../../../../es/components/annotation-edit/src/type';
4
4
  import { ContextCollector } from '../../../../../es/components/form-render/src/hooks/useChangeContext';
5
- import { useFormRenderLifeCycle } from '../../../../../es/components/form-render/src/hooks/useFormRenderLifeCycle';
6
5
  import { BusinessCollector, FormItemDepsCollector } from '../hooks';
7
6
  import { FormAsyncQueue } from '../types';
8
7
  import { Component, InjectionKey, WritableComputedRef } from 'vue';
@@ -11,7 +10,6 @@ export declare const InjectionSchemaField: InjectionKey<Component>;
11
10
  export declare const InjectionBusinessCollector: InjectionKey<BusinessCollector>;
12
11
  export declare const InjectionChangeContextCollector: InjectionKey<ContextCollector>;
13
12
  export declare const InjectionFormItemDepsCollector: InjectionKey<FormItemDepsCollector>;
14
- export declare const InjectionFormLifeCycleCaller: InjectionKey<ReturnType<typeof useFormRenderLifeCycle>['callLifeCycle']>;
15
13
  export declare const InjectionFormUUID: InjectionKey<string>;
16
14
  export declare const InjectionFormGraph: InjectionKey<Record<string, GeneralField>>;
17
15
  export declare const InjectionAnnotation: InjectionKey<WritableComputedRef<Nullable<Record<string, AnnotationItem>>>>;
@@ -1 +1 @@
1
- const e=Symbol("InjectionAsyncQueue"),o=Symbol("InjectionSchemaField"),n=Symbol("InjectionBusinessCollector"),t=Symbol("InjectionChangeContextCollector"),E=Symbol("InjectionFormItemDepsCollector"),l=Symbol("InjectionFormLifeCycleCaller"),I=Symbol("InjectionFormUUID"),A=Symbol("InjectionFormGraph"),i=Symbol("InjectionAnnotation"),a="__dep_LINEBAR_";var c=(e=>(e.PASSWORD="password",e.ID_CARD="id_card",e.AGE="age",e.AGE_UNIT="age_unit",e.MOBILE="mobile",e.TELEPHONE="telephone",e.EMAIL="email",e.SEX="sex",e.BIRTHDAY="birthday",e.BANK_CARD="bank_card",e.WEBSITE="website",e.GESTATIONAL_WEEKS="gestational_weeks",e.GESTATIONAL_STAGE="gestational_stage",e.CUSTOMER_NAME="customer_name",e))(c||{}),m=(e=>(e.MALE="1",e.FEMALE="2",e))(m||{}),S=(e=>(e.DAY="D",e.MONTH="M",e.YEAR="Y",e.HOUR="H",e.WEEK="W",e.MINUTE="N",e))(S||{});const r=["COMPLEX","COMBINATION"];export{S as FIELD_AGE_UNIT,c as FIELD_BUSINESS_TYPE,m as FIELD_SEX_VALUE,a as FormItemLineBarDepKeyPrepend,i as InjectionAnnotation,e as InjectionAsyncQueue,n as InjectionBusinessCollector,t as InjectionChangeContextCollector,A as InjectionFormGraph,E as InjectionFormItemDepsCollector,l as InjectionFormLifeCycleCaller,I as InjectionFormUUID,o as InjectionSchemaField,r as NESTED_FORM_ITEM_TYPE};
1
+ const e=Symbol("InjectionAsyncQueue"),o=Symbol("InjectionSchemaField"),n=Symbol("InjectionBusinessCollector"),t=Symbol("InjectionChangeContextCollector"),E=Symbol("InjectionFormItemDepsCollector"),A=Symbol("InjectionFormUUID"),I=Symbol("InjectionFormGraph"),l=Symbol("InjectionAnnotation"),a="__dep_LINEBAR_";var i=(e=>(e.PASSWORD="password",e.ID_CARD="id_card",e.AGE="age",e.AGE_UNIT="age_unit",e.MOBILE="mobile",e.TELEPHONE="telephone",e.EMAIL="email",e.SEX="sex",e.BIRTHDAY="birthday",e.BANK_CARD="bank_card",e.WEBSITE="website",e.GESTATIONAL_WEEKS="gestational_weeks",e.GESTATIONAL_STAGE="gestational_stage",e.CUSTOMER_NAME="customer_name",e))(i||{}),c=(e=>(e.MALE="1",e.FEMALE="2",e))(c||{}),S=(e=>(e.DAY="D",e.MONTH="M",e.YEAR="Y",e.HOUR="H",e.WEEK="W",e.MINUTE="N",e))(S||{});const m=["COMPLEX","COMBINATION"];export{S as FIELD_AGE_UNIT,i as FIELD_BUSINESS_TYPE,c as FIELD_SEX_VALUE,a as FormItemLineBarDepKeyPrepend,l as InjectionAnnotation,e as InjectionAsyncQueue,n as InjectionBusinessCollector,t as InjectionChangeContextCollector,I as InjectionFormGraph,E as InjectionFormItemDepsCollector,A as InjectionFormUUID,o as InjectionSchemaField,m as NESTED_FORM_ITEM_TYPE};
@@ -1 +1 @@
1
- import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as i}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function d(d){const{createValidatorSchema:u}=l(),x=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=u(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},f=e=>{var o;const t=x(e);e.urlConfig?function(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig"])})}(t,e):e.autograph&&m(t,e);const i=!!e.__multiple;return Object.assign(t["x-component-props"],{multiple:i,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowCreate:"1"===e.free_entry||!!t["x-component-props"].allowCreate,maxTagCount:r(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),i&&(t.type="array"),t},_=e=>{const o=x(e);return Object.assign(o["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,vertical:e.__vertical}),m(o,e),o},h=e=>{const t=x(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},g=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{disabled:"1"===e.is_not_fold,id:p(e.val_key),show:"0"!==e.is_show,remark:e.remark}}),b=new Map([["LINEBAR",g],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=x(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=x(e),{decimal_length:t,validate:n}=e;return Object.assign(o["x-component-props"],{precision:null!=t?t:null==n?void 0:n.decimal_length,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",f],["REMOTE_SEARCH",f],["DATE",e=>{const o=x(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),o}],["SEARCH_CASCADER",e=>{var o;const t=x(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=x(e);return o.type="array",!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",_],["CHECKBOX",_],["SWITCH",e=>{const o=x(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=x(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=x(e);Array.isArray(e.properties)&&i("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?C(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],n(e,["wrapperStyle","display"])),o}]]),y=e=>{if(e.suffixConfig)return v(e);return(b.get(e.html_type)||h)(e)},v=o=>{if(!o.suffixConfig)return y(o);const t=e(o.suffixConfig),n=[{...o,is_show:"1",hide_title:"1",suffixConfig:void 0}].concat(t.map((e=>({...e,hide_title:"1",is_show:"1"})))),r=x(o);return Object.assign(r,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:2*(o.elem_width||3)},"x-decorator-props":{...r["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:C(n)}),r},{FieldNormalizeWaterfallHook:O}=s();function C(o){let n=null;return o.reduce(((e,o,s)=>{var a;const p=null==(a=(o=O.call(t(o))).validate)?void 0:a.obj_type;return p&&d&&d.collect(p,t(o)),"LINEBAR"===o.html_type?(e[i(o)]=r(g(o),s),n=e[i(o)].properties={}):n?n[i(o)]=r(y(o),s):(n=null,e[i(o)]=r(y(o),s)),e}),{});function r(e,o){return e["x-index"]=o,e}function i(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:C}}export{d as useFieldListAdaptor};
1
+ import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as i}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function d(d){const{createValidatorSchema:u}=l(),x=e=>{var t;const n={name:e.val_key,type:null!=(t=e.fieldType)?t:"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"};e.reactions&&(n["x-reactions"]=e.reactions),e.noDecorator||Object.assign(n,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:o(e,["reactions"]),span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const r=u(e);return r&&(n["x-validator"]=r),"0"===e.is_null&&(n.required=!0),n},f=e=>{var o;const t=x(e);e.urlConfig?function(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig"])})}(t,e):e.autograph&&m(t,e);const i=!!e.__multiple;return Object.assign(t["x-component-props"],{multiple:i,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowCreate:"1"===e.free_entry||!!t["x-component-props"].allowCreate,maxTagCount:r(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),i&&(t.type="array"),t},_=e=>{const o=x(e);return Object.assign(o["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,vertical:e.__vertical}),m(o,e),o},h=e=>{const t=x(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},g=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{disabled:"1"===e.is_not_fold,id:p(e.val_key),show:"0"!==e.is_show,remark:e.remark}}),b=new Map([["LINEBAR",g],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=x(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=x(e),{decimal_length:t,validate:n}=e;return Object.assign(o["x-component-props"],{precision:null!=t?t:null==n?void 0:n.decimal_length,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",f],["REMOTE_SEARCH",f],["DATE",e=>{const o=x(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),o}],["SEARCH_CASCADER",e=>{var o;const t=x(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=x(e);return o.type="array",!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,getProperties:()=>e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",_],["CHECKBOX",_],["SWITCH",e=>{const o=x(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=x(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=x(e);Array.isArray(e.properties)&&i("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?C(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],n(e,["wrapperStyle","display"])),o}]]),y=e=>{if(e.suffixConfig)return v(e);return(b.get(e.html_type)||h)(e)},v=o=>{if(!o.suffixConfig)return y(o);const t=e(o.suffixConfig),n=[{...o,is_show:"1",hide_title:"1",suffixConfig:void 0}].concat(t.map((e=>({...e,hide_title:"1",is_show:"1"})))),r=x(o);return Object.assign(r,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:2*(o.elem_width||3)},"x-decorator-props":{...r["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:C(n)}),r},{FieldNormalizeWaterfallHook:O}=s();function C(o){let n=null;return o.reduce(((e,o,s)=>{var a;const p=null==(a=(o=O.call(t(o))).validate)?void 0:a.obj_type;return p&&d&&d.collect(p,t(o)),"LINEBAR"===o.html_type?(e[i(o)]=r(g(o),s),n=e[i(o)].properties={}):n?n[i(o)]=r(y(o),s):(n=null,e[i(o)]=r(y(o),s)),e}),{});function r(e,o){return e["x-index"]=o,e}function i(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:C}}export{d as useFieldListAdaptor};
@@ -7,7 +7,7 @@ declare type ProcessorOption = Partial<{
7
7
  afterRequest(key: string, payload?: unknown): AnyObject[];
8
8
  beforeRequest(key: string, params?: unknown): UndefinedAble<AnyObject> | void;
9
9
  }>;
10
- export declare function useFormAsyncQueue(requestInstance: ComputedRef<UndefinedAble<RequestInstance>>, uniqueData: ComputedRef<boolean>): {
10
+ export declare function useFormAsyncQueue(requestInstance: ComputedRef<UndefinedAble<RequestInstance>>): {
11
11
  create: (parallelism?: number, option?: ProcessorOption) => AsyncQueue<FormAsyncQueueItem, any, {
12
12
  label: string;
13
13
  value: unknown;
@@ -1 +1 @@
1
- import{uuidGenerator as e}from"../../../../shared/utils/index.js";import{isFunction as r}from"lodash-es";import"naive-ui";import{unref as t}from"vue";import"@vueuse/core";import"date-fns";import{AsyncQueue as o}from"../../../../shared/hooks/useAsyncQueue.js";import"../../index.js";import{useCommonLog as s}from"./useCommonLog.js";import{useFormRequest as a}from"./useFormRequest.js";function n(n,u){const{getHttpInstance:i}=a();return{create:function(a=3,m){return new o({name:"FormRenderAsyncQueue",uniqueData:u.value,parallelism:a,async processor({key:e,method:o="post",cache:a,params:u,url:p},c,f){var l,d;const h=null!=(l=t(n))?l:i();if(!h)return s().invalidHttpInstanceLog(),c(),void f();try{m&&r(m.beforeRequest)&&(u=null!=(d=m.beforeRequest(e,u))?d:{});let t=await h[o](p,u);m&&r(m.afterRequest)&&(t=m.afterRequest(e,t)),c(void 0,Array.isArray(t)?t:[]),!a&&f()}catch(e){c(new Error(`Request error => ${e}`)),f()}},getKey:({url:r,method:t="post",cache:o,params:s})=>o?r+t+JSON.stringify(s||{}):e()})}}}export{n as useFormAsyncQueue};
1
+ import{uuidGenerator as e}from"../../../../shared/utils/index.js";import{isFunction as r}from"lodash-es";import"naive-ui";import{unref as t}from"vue";import"@vueuse/core";import"date-fns";import{AsyncQueue as o}from"../../../../shared/hooks/useAsyncQueue.js";import"../../index.js";import{useCommonLog as s}from"./useCommonLog.js";import{useFormRequest as n}from"./useFormRequest.js";function a(a){const{getHttpInstance:i}=n();return{create:function(n=3,u){return new o({name:"FormRenderAsyncQueue",parallelism:n,async processor({key:e,method:o="post",cache:n,params:m,url:p},c,f){var l,d;const h=null!=(l=t(a))?l:i();if(!h)return s().invalidHttpInstanceLog(),c(),void f();try{u&&r(u.beforeRequest)&&(m=null!=(d=u.beforeRequest(e,m))?d:{});let t=await h[o](p,m);u&&r(u.afterRequest)&&(t=u.afterRequest(e,t)),c(void 0,Array.isArray(t)?t:[]),!n&&f()}catch(e){c(new Error(`Request error => ${e}`)),f()}},getKey:({url:r,method:t="post",cache:o,params:s})=>o?r+t+JSON.stringify(s||{}):e()})}}}export{a as useFormAsyncQueue};
@@ -1 +1 @@
1
- import{uuidGenerator as e}from"../../../../shared/utils/index.js";import{createSchemaField as o}from"@formily/vue";import{isObject as t}from"@vue/shared";import{cloneDeep as r}from"lodash-es";import{computed as n,provide as s,readonly as i}from"vue";import"../../index.js";import m from"../components/renderer/index.js";import{InjectionAsyncQueue as a,InjectionSchemaField as u,InjectionBusinessCollector as c,InjectionChangeContextCollector as p,InjectionFormItemDepsCollector as l,InjectionFormUUID as f,InjectionAnnotation as d}from"../constants/index.js";import{useFormRenderLifeCycle as j}from"./useFormRenderLifeCycle.js";import{usePresetScope as C}from"./usePresetScope.js";import{injectOrProvide as h,presetRequestHandler as y}from"../utils/index.js";import{useFormAsyncQueue as x}from"./useFormAsyncQueue.js";import{useBusinessBinding as g}from"./useBusinessBinding.js";import{useChangeContext as q}from"./useChangeContext.js";import{useFormItemDeps as v}from"./useFormItemDeps.js";function F(F,b){const{callLifeCycle:R}=j(F),D=h(a,(()=>x(n((()=>F.requestInstance)),n((()=>!!F.uniqueCacheData))).create(F.parallelism,{beforeRequest:(...e)=>R("beforeRequest",r(e))||e[1],afterRequest:(...e)=>R("afterRequest",r(e))||y(e[1])}))),I=h(u,(()=>o({components:{...m,...F.components},scope:Object.assign({},C(),F.scope)}).SchemaField)),S=g().create(F.businessFormatter);s(c,S);const B=q().create();s(p,B);const L=v().create();s(l,L);const Q=F.uuid||e();return s(f,Q),s(d,n({get:()=>F.annotation?i(F.annotation):null,set(e){if(!t(F.annotation)||!t(e))return;const o=F.annotation[e.property];F.annotation[e.property]=e.value,b("annotationChange",{fieldKey:e.property,value:e.value,oldValue:o})}})),{asyncQueue:D,SchemaField:I,businessCollector:S,changeContextCollector:B,formItemDepsCollector:L,formUUID:Q}}export{F as useFormContext};
1
+ import{uuidGenerator as e}from"../../../../shared/utils/index.js";import{createSchemaField as o}from"@formily/vue";import{isObject as t}from"@vue/shared";import{cloneDeep as r}from"lodash-es";import{computed as s,provide as n,readonly as i}from"vue";import"../../index.js";import m from"../components/renderer/index.js";import{InjectionAsyncQueue as a,InjectionSchemaField as u,InjectionBusinessCollector as p,InjectionChangeContextCollector as c,InjectionFormItemDepsCollector as l,InjectionFormUUID as f,InjectionAnnotation as d}from"../constants/index.js";import{useFormRenderLifeCycle as j}from"./useFormRenderLifeCycle.js";import{usePresetScope as y}from"./usePresetScope.js";import{injectOrProvide as C,presetRequestHandler as h}from"../utils/index.js";import{useFormAsyncQueue as x}from"./useFormAsyncQueue.js";import{useBusinessBinding as g}from"./useBusinessBinding.js";import{useChangeContext as v}from"./useChangeContext.js";import{useFormItemDeps as F}from"./useFormItemDeps.js";function b(b,q){const{callLifeCycle:R}=j(b),I=C(a,(()=>x(s((()=>b.requestInstance))).create(b.parallelism,{beforeRequest:(...e)=>R("beforeRequest",r(e))||e[1],afterRequest:(...e)=>R("afterRequest",r(e))||h(e[1])}))),D=C(u,(()=>o({components:{...m,...b.components},scope:Object.assign({},y(),b.scope)}).SchemaField)),S=g().create(b.businessFormatter);n(p,S);const B=v().create();n(c,B);const L=F().create();n(l,L);const Q=b.uuid||e();return n(f,Q),n(d,s({get:()=>b.annotation?i(b.annotation):null,set(e){if(!t(b.annotation)||!t(e))return;const o=b.annotation[e.property];b.annotation[e.property]=e.value,q("annotationChange",{fieldKey:e.property,value:e.value,oldValue:o})}})),{asyncQueue:I,SchemaField:D,businessCollector:S,changeContextCollector:B,formItemDepsCollector:L,formUUID:Q}}export{b as useFormContext};
@@ -1,15 +1,13 @@
1
1
  import { UndefinedAble } from '../../../../../es/shared/types';
2
2
  import { FormRenderLifeCycle, FormRenderProps } from '../../../../../es/components/form-render';
3
3
  export declare function useFormRenderLifeCycle(props: FormRenderProps): {
4
- callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
4
+ callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
5
5
  onSetup(): void;
6
6
  beforeRequest(fieldKey: string, params?: import("../../../../../es/shared/types").AnyObject | undefined): void | UndefinedAble<import("../../../../../es/shared/types").AnyObject>;
7
7
  afterRequest(fieldKey: string, payload?: any): import("../../../../../es/shared/types").AnyObject[];
8
- afterOptionInit(fieldKey: string, options: import("../../../../../es/shared/types").AnyObject[]): void;
9
8
  }>>[T]> | undefined) => UndefinedAble<ReturnType<Required<Partial<{
10
9
  onSetup(): void;
11
10
  beforeRequest(fieldKey: string, params?: import("../../../../../es/shared/types").AnyObject | undefined): void | UndefinedAble<import("../../../../../es/shared/types").AnyObject>;
12
11
  afterRequest(fieldKey: string, payload?: any): import("../../../../../es/shared/types").AnyObject[];
13
- afterOptionInit(fieldKey: string, options: import("../../../../../es/shared/types").AnyObject[]): void;
14
12
  }>>[T]>>;
15
13
  };
@@ -2,7 +2,7 @@ import { AnyObject, Func } from '../../../../../es/shared/types';
2
2
  import { Ref } from 'vue';
3
3
  import { FormWordbook, RecommendIds, UrlConfig } from '../../../../../es/components/form-render';
4
4
  import { RecommendItem } from '../../../../../es/components/recommend-search/src/types';
5
- export declare const searchContentMatcher: (searchContent: string, label: string) => RegExpMatchArray | null;
5
+ export declare const searchContentMatcher: (searchContent: string, label: string) => string[] | null;
6
6
  export declare function useRecommendOptions(props: {
7
7
  recommend: boolean;
8
8
  commonList?: RecommendItem[];
@@ -1 +1 @@
1
- import{checkInSetupEnv as e,jsonParse as n}from"../../../../shared/utils/index.js";import{useMemoize as t,useDebounceFn as l}from"@vueuse/core";import{identity as u,uniqBy as o,isString as r,isEqual as a,omit as i,isArray as c,isFunction as s}from"lodash-es";import{computed as v,inject as m,ref as d,toRaw as f,watch as y}from"vue";import"../../index.js";import{InjectionAsyncQueue as p,InjectionFormLifeCycleCaller as h,InjectionFormItemDepsCollector as g}from"../constants/index.js";import{createUrlConfigParams as w,formRenderLog as k,keywordMatcher as b}from"../utils/index.js";import{useFormField as R}from"./useFormField.js";import{useFormRequest as C}from"./useFormRequest.js";function K(e,n){const t=d();return v({get:()=>t.value?t.value:e[n],set(e){t.value=e}})}const F=(()=>{const e=t((e=>new RegExp(`(.*)${e.split("").map((e=>`(${function(e){return e.match(/[()\[\]{}$^\/]/)?"\\"+e:e}(e)})`)).join("(.*)")}(.*)`)),{getKey:u});return(n,t)=>t.match(e(n))})();function O(){const e=d();return{searchContent:e,optionSearchFilter:function(n,t,l){if(!e.value)return n;const u=c(l)?l.filter((e=>e&&r(e))):[];return n.filter((n=>function(n,t,l){if(!e.value)return!0;const u=n?n[t]:"";return!!r(u)&&(!!F(e.value,u)||!!b(e.value,n.keyword)||!!l.length&&l.some((t=>r(n[t])&&n[t].includes(e.value))))}(n,t,u)))}}}function j(e,t,l,u,r){const a=K(e,"commonList"),c=K(e,"recentList"),{searchContent:d,optionSearchFilter:f}=O();function y(e){return n(e.itemObj)}const h=v((()=>{var e,n;return null!=(n=null==(e=a.value)?void 0:e.map(y))?n:[]})),g=v((()=>{var e,n;return null!=(n=null==(e=c.value)?void 0:e.map(y))?n:[]})),w=v((()=>{if(!e.recommend||!h.value.length&&!g.value.length)return t.value;const n=o(h.value.concat(g.value),(e=>e[r.value])),l=t.value.filter((e=>n.every((function(n){return n[r.value]!==e[r.value]}))));return[...f(n,u.value),...l]})),{getRecommendRequestInfo:k,getHttpInstance:b}=C();function F(n){const{url:t,getRecommendIds:l}=k(),u=s(l)?l():{},o=s(e.getRecommendInfo)?e.getRecommendInfo():{};return{url:t[n],info:Object.assign({},u,o)}}const{fieldKey:j}=R(),I=m(p);return{postRecommend:async function(n){if(!e.recommend)return;const t=b();if(!t)return;const{url:u,info:o}=F("post"),a=w.value.find((e=>e[r.value]===n));a&&l("postRecommend",await t.post(u,{...o,keyword:"",itemId:r.value,itemObj:JSON.stringify(a)}))},getRecommend:async function(n){if(!e.recommend)return;if(d.value=n,a.value&&c.value&&e.recommendCache)return;const t=await I.addAsync(function(n,t){const{url:l,info:u}=F("get");return{url:l,method:"get",key:n,cache:t,params:{...u,recNum:Math.max(e.commonNum,e.recentNum),keyword:""}}}(j.value,e.recommendCache)),{commonly:l,recently:u}=t.reduce(((e,n)=>("commonly"===n.type?e.commonly.push(i(n,["type"])):"recently"===n.type&&e.recently.push(i(n,["type"])),e)),{commonly:[],recently:[]});a.value=l.slice(0,e.commonNum),c.value=u.slice(0,e.recentNum)},sortedOptions:w}}function I(n,t){e();const u=m(p),o=m(h),i=v((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.urlConfig)?void 0:e.nameKey)?t:n.labelField)?l:"text"})),c=v((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.urlConfig)?void 0:e.valueKey)?t:n.valueField)?l:"value"})),{searchContent:s,optionSearchFilter:b}=O(),C=d(null),{field:K,fieldKey:F}=R(),j=l((async function(e){if(s.value=e||"",!n.urlConfig)return C.value=null;try{const e=await u.addAsync(await w({config:n.urlConfig,cache:n.requestCache,field:K.value}));f(C.value)!==e&&(C.value=e,o("afterOptionInit",[F.value,C.value]))}catch(e){r(e)&&k(e)}}),300),I=v((()=>C.value?b(C.value,i.value):Array.isArray(n.options)?b(n.options,i.value):[])),x=v((()=>C.value||n.options||[])),q=m(g);return y((()=>n.urlConfig),((e,l)=>{a(e,l)||(C.value=null,e&&(q.setDeps(F.value,e.dependKey||[],(async()=>{C.value=null,t.value=null,!n.lazyRequest&&await j()})),(t.value||!n.lazyRequest)&&j()))}),{immediate:!0}),{labelKey:i,valueKey:c,filterOptions:I,fullOptions:x,fetchData:j}}function x(n,t){e();const u=m(p),o=m(h),i=v((()=>{var e,t,l,u;return null!=(u=null!=(l=null==(t=null==(e=n.wordbook)?void 0:e.render_key)?void 0:t[0])?l:n.labelField)?u:"text"})),c=v((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.wordbook)?void 0:e.value_key)?t:n.valueField)?l:"value"})),s=v((()=>{var e;return(null==(e=n.wordbook)?void 0:e.search_key)||[]})),{searchContent:g,optionSearchFilter:w}=O(),b=d(null),{fieldKey:K}=R(),{getSearchRequestInfo:F}=C(),j=l((async function(e){if(g.value=e||"",!n.autograph||!n.wordbook)return b.value=null;try{const e=await u.addAsync(function(e,t,l){const u={autograph:t,wordbookId:e.id,wordbookType:e.type,fieldKeys:e.search_key,keyword:"",page:1};return{...F(),params:u,key:l,cache:n.requestCache}}(n.wordbook,n.autograph,K.value));f(b.value)!==e&&(b.value=e,o("afterOptionInit",[K.value,b.value]))}catch(e){r(e)&&k(e)}}),300),I=v((()=>b.value?w(b.value,i.value,s.value):Array.isArray(n.options)?w(n.options,i.value):[])),x=v((()=>b.value||n.options||[]));return y((()=>n.wordbook),((e,l)=>{a(e,l)||(b.value=null,e&&(t.value||!n.lazyRequest)&&j())}),{immediate:!0}),{labelKey:i,valueKey:c,filterOptions:I,fullOptions:x,fetchData:j}}export{F as searchContentMatcher,x as useAutographOptions,j as useRecommendOptions,I as useUrlConfigOptions};
1
+ import{checkInSetupEnv as e,jsonParse as n}from"../../../../shared/utils/index.js";import{useMemoize as t,useDebounceFn as l}from"@vueuse/core";import{identity as u,uniqBy as o,isString as r,isEqual as a,omit as i,isArray as c,isFunction as s}from"lodash-es";import{computed as v,inject as m,ref as d,watch as f}from"vue";import"../../index.js";import{InjectionAsyncQueue as y,InjectionFormItemDepsCollector as p}from"../constants/index.js";import{createUrlConfigParams as h,formRenderLog as g,keywordMatcher as w}from"../utils/index.js";import{useFormField as k}from"./useFormField.js";import{useFormRequest as b}from"./useFormRequest.js";function R(e,n){const t=d();return v({get:()=>t.value?t.value:e[n],set(e){t.value=e}})}const C=(()=>{const e=new Map,n=t((e=>new RegExp(`(.*)${e.split("").map((e=>`(${function(e){return e.match(/[()\[\]{}$^\/]/)?"\\"+e:e}(e)})`)).join("(.*)")}(.*)`)),{getKey:u});return(t,l)=>{const u=e.get(t)||{};return e.set(t,u),Reflect.has(u,l)?u[l]:u[l]=l.match(n(t))}})();function K(){const e=d();return{searchContent:e,optionSearchFilter:function(n,t,l){if(!e.value)return n;const u=c(l)?l.filter((e=>e&&r(e))):[];return n.filter((n=>function(n,t,l){if(!e.value)return!0;const u=n?n[t]:"";return!!r(u)&&(!!C(e.value,u)||!!w(e.value,n.keyword)||!!l.length&&l.some((t=>r(n[t])&&n[t].includes(e.value))))}(n,t,u)))}}}function F(e,t,l,u,r){const a=R(e,"commonList"),c=R(e,"recentList"),{searchContent:d,optionSearchFilter:f}=K();function p(e){return n(e.itemObj)}const h=v((()=>{var e,n;return null!=(n=null==(e=a.value)?void 0:e.map(p))?n:[]})),g=v((()=>{var e,n;return null!=(n=null==(e=c.value)?void 0:e.map(p))?n:[]})),w=v((()=>{if(!e.recommend||!h.value.length&&!g.value.length)return t.value;const n=o(h.value.concat(g.value),(e=>e[r.value])),l=t.value.filter((e=>n.every((function(n){return n[r.value]!==e[r.value]}))));return[...f(n,u.value),...l]})),{getRecommendRequestInfo:C,getHttpInstance:F}=b();function j(n){const{url:t,getRecommendIds:l}=C(),u=s(l)?l():{},o=s(e.getRecommendInfo)?e.getRecommendInfo():{};return{url:t[n],info:Object.assign({},u,o)}}const{fieldKey:x}=k(),O=m(y);return{postRecommend:async function(n){if(!e.recommend)return;const t=F();if(!t)return;const{url:u,info:o}=j("post"),a=w.value.find((e=>e[r.value]===n));a&&l("postRecommend",await t.post(u,{...o,keyword:"",itemId:r.value,itemObj:JSON.stringify(a)}))},getRecommend:async function(n){if(!e.recommend)return;if(d.value=n,a.value&&c.value&&e.recommendCache)return;const t=await O.addAsync(function(n,t){const{url:l,info:u}=j("get");return{url:l,method:"get",key:n,cache:t,params:{...u,recNum:Math.max(e.commonNum,e.recentNum),keyword:""}}}(x.value,e.recommendCache)),{commonly:l,recently:u}=t.reduce(((e,n)=>("commonly"===n.type?e.commonly.push(i(n,["type"])):"recently"===n.type&&e.recently.push(i(n,["type"])),e)),{commonly:[],recently:[]});a.value=l.slice(0,e.commonNum),c.value=u.slice(0,e.recentNum)},sortedOptions:w}}function j(n,t){e();const u=m(y),o=v((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.urlConfig)?void 0:e.nameKey)?t:n.labelField)?l:"text"})),i=v((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.urlConfig)?void 0:e.valueKey)?t:n.valueField)?l:"value"})),{searchContent:c,optionSearchFilter:s}=K(),w=d(null),{field:b,fieldKey:R}=k(),C=l((async function(e){if(c.value=e||"",!n.urlConfig)return w.value=null;try{w.value=await u.addAsync(await h({config:n.urlConfig,cache:n.requestCache,field:b.value}))}catch(e){r(e)&&g(e)}}),300),F=v((()=>w.value?s(w.value,o.value):Array.isArray(n.options)?s(n.options,o.value):[])),j=v((()=>w.value||n.options||[])),x=m(p);return f((()=>n.urlConfig),((e,l)=>{a(e,l)||(w.value=null,e&&(x.setDeps(R.value,e.dependKey||[],(async()=>{w.value=null,t.value=null,!n.lazyRequest&&await C()})),(t.value||!n.lazyRequest)&&C()))}),{immediate:!0}),{labelKey:o,valueKey:i,filterOptions:F,fullOptions:j,fetchData:C}}function x(n,t){e();const u=m(y),o=v((()=>{var e,t,l,u;return null!=(u=null!=(l=null==(t=null==(e=n.wordbook)?void 0:e.render_key)?void 0:t[0])?l:n.labelField)?u:"text"})),i=v((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.wordbook)?void 0:e.value_key)?t:n.valueField)?l:"value"})),c=v((()=>{var e;return(null==(e=n.wordbook)?void 0:e.search_key)||[]})),{searchContent:s,optionSearchFilter:p}=K(),h=d(null),{fieldKey:w}=k(),{getSearchRequestInfo:R}=b(),C=l((async function(e){if(s.value=e||"",!n.autograph||!n.wordbook)return h.value=null;try{h.value=await u.addAsync(function(e,t,l){const u={autograph:t,wordbookId:e.id,wordbookType:e.type,fieldKeys:e.search_key,keyword:"",page:1};return{...R(),params:u,key:l,cache:n.requestCache}}(n.wordbook,n.autograph,w.value))}catch(e){r(e)&&g(e)}}),300),F=v((()=>h.value?p(h.value,o.value,c.value):Array.isArray(n.options)?p(n.options,o.value):[])),j=v((()=>h.value||n.options||[]));return f((()=>n.wordbook),((e,l)=>{a(e,l)||(h.value=null,e&&(t.value||!n.lazyRequest)&&C())}),{immediate:!0}),{labelKey:o,valueKey:i,filterOptions:F,fullOptions:j,fetchData:C}}export{C as searchContentMatcher,x as useAutographOptions,F as useRecommendOptions,j as useUrlConfigOptions};
@@ -1 +1 @@
1
- function e(){return{nuiThemeOverrides:{common:{inputColorDisabled:"#F5F5F5",textColorDisabled:"#000000",placeholderColorDisabled:"#000000",borderColor:"#D5D5D5",errorColor:"#DE1919",placeholderColor:"rgba(0,0,0,0.4)"},Input:{paddingMedium:"8px",paddingSmall:"8px",paddingLarge:"8px",paddingTiny:"8px"},DatePicker:{itemTextColorDisabled:"rgba(194, 194, 194, 1)"},InternalSelection:{paddingSingle:"8px",paddingMultiple:"2px"},Form:{feedbackHeightMedium:"16px",feedbackHeightLarge:"16px",feedbackHeightSmall:"16px",feedbackFontSizeLarge:"12px",feedbackFontSizeMedium:"12px",feedbackFontSizeSmall:"12px",feedbackPadding:"0px"}}}}export{e as useNuiThemeOverrides};
1
+ function e(){return{nuiThemeOverrides:{common:{inputColorDisabled:"#F5F5F5",textColorDisabled:"#000000",placeholderColorDisabled:"#000000",borderColor:"#D5D5D5",errorColor:"#DE1919",placeholderColor:"rgba(0,0,0,0.4)"},Input:{paddingMedium:"8px",paddingSmall:"8px",paddingLarge:"8px",paddingTiny:"8px"},InternalSelection:{paddingSingle:"8px",paddingMultiple:"2px"},Form:{feedbackHeightMedium:"16px",feedbackHeightLarge:"16px",feedbackHeightSmall:"16px",feedbackFontSizeLarge:"12px",feedbackFontSizeMedium:"12px",feedbackFontSizeSmall:"12px",feedbackPadding:"0px"}}}}export{e as useNuiThemeOverrides};
@@ -60,7 +60,6 @@ export declare type FormRenderLifeCycle = Partial<{
60
60
  onSetup(): void;
61
61
  beforeRequest(fieldKey: string, params?: AnyObject): UndefinedAble<AnyObject> | void;
62
62
  afterRequest(fieldKey: string, payload?: any): AnyObject[];
63
- afterOptionInit(fieldKey: string, options: AnyObject[]): void;
64
63
  }>;
65
64
  export declare type FormRenderProps = Partial<{
66
65
  fieldList: FieldItem[];
@@ -83,7 +82,6 @@ export declare type FormRenderProps = Partial<{
83
82
  lowCodeReactions: FormLowCodeReactions.Config[];
84
83
  linebarAutoHidden: boolean;
85
84
  bordered: boolean | string;
86
- uniqueCacheData: boolean;
87
85
  }>;
88
86
  export declare type FormBusinessFormatter = (payload: {
89
87
  fieldKey: string;
@@ -1 +1 @@
1
- import{toRaw as e,h as t,inject as l,createVNode as i}from"vue";import{arrayed as o,widthAppend as s}from"../../../../../shared/utils/index.js";import{isObject as n,isFunction as d,cloneDeep as a,isString as r}from"lodash-es";import{NEllipsis as u}from"naive-ui";import f from"../../../../annotation-edit/index.js";import{HIGHEST_PRIORITY as m,IHO_TABLE_FIXED_STATUS as c,LOWEST_PRIORITY as p,WIDGET_TYPE as h,InjectionIhoTableAnnotation as v,InjectionIhoTableConfig as b}from"../../constants/index.js";import{defineTablePlugin as g}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as R,IhoTableUtils as j,IhoTableRenderHelper as x}from"../../utils/index.js";import{getDefaultValue as P}from"../rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js";function F(){const F="lowCodeFieldAdaptorPlugin";return g({name:F,apply(g){g.fieldHooks.field.tap({name:F,stage:m},((m,p,g)=>{const F=m,S={className:F.bold?"iho-table__boldCell":"",field:F.columnName,showOverflow:"tooltip",visible:R.notNegative(F.isShow),minWidth:F.colWidth,sortable:R.isPositive(F.isSort),fixed:c[F.isFixed],...F,title:F.alias||F.title};return function(e,a){const m={default:a.slotFn,header:a.headerSlotFn,edit:a.editSlotFn,footer:a.footerSlotFn,...a.slots};if(d(a.checkEditStatus)){const{default:e}=m;d(e)&&(m.default=l=>a.checkEditStatus(l)?e(l):[t("span",null,P(l.row,l.column.editRender.props))])}const c=m.header;m.header=e=>function(e,t,a){var m;const c=l(v),p=l(b),h=e.column||{},g=n(null==c?void 0:c.value)&&!1!==t.annotation,R=x.isEditableColumn(p.value,h),j=x.hasFilter(t)||x.hasDateFiler(t),P=null==(m=t.titlePrefix)?void 0:m.content,F=r(a)?a:d(a)?a(e):null;let S=!1;if(p.value){const e=p.value.editRules&&p.value.editRules[h.field];e&&(S=o(e).some((e=>e.required)))}return i("section",{class:"iho-table__headerWrapper"},[i("section",{style:{width:s(Math.max(0,h.renderWidth-20-(S?14:0)-(g?18:0)-(j?23:0)-(R?22:0)-(P?20:0)-(h.sortable?23:0)))}},[null!=F?F:i(u,{style:{maxWidth:"100%"}},{default:()=>h.title})]),g?i(f,{modelValue:c.value[h.field],"onUpdate:modelValue":e=>c.value[h.field]=e},null):null])}(e,a,c),e.slots=m}(S,F),function(t,l,i){var o,s;const r=a(e(l));r.componentProps={size:"mini"===i.size?"small":i.size,...r.componentProps},t.editRender={autofocus:"input",name:j.getCellType(l),props:r},t.editRender.enabled=!Reflect.get(h,t.editRender.name),d(null==(o=t.slots)?void 0:o.default)&&(t.editRender.enabled=t.editRender.enabled&&d(null==(s=t.slots)?void 0:s.edit));if(!n(l.settingObj))return;Reflect.has(l.settingObj,"isHide")&&(t.visible=t.visible&&R.notPositive(l.settingObj.isHide))}(S,F,g),S})),g.fieldHooks.field.tap({name:F+"After",stage:p},(e=>(n(e.slots)&&Object.entries(e.slots).forEach((([t,l])=>{null==l&&Reflect.deleteProperty(e.slots,t)})),e)))}})}export{F as lowCodeFieldAdaptorPlugin};
1
+ import{toRaw as e,h as t,inject as l,createVNode as i}from"vue";import{arrayed as o,widthAppend as s}from"../../../../../shared/utils/index.js";import{isObject as n,isFunction as d,cloneDeep as a,isString as r}from"lodash-es";import{NEllipsis as u}from"naive-ui";import f from"../../../../annotation-edit/index.js";import{HIGHEST_PRIORITY as m,IHO_TABLE_FIXED_STATUS as c,LOWEST_PRIORITY as p,WIDGET_TYPE as h,InjectionIhoTableAnnotation as v,InjectionIhoTableConfig as b}from"../../constants/index.js";import{defineTablePlugin as g}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as R,IhoTableUtils as j,IhoTableRenderHelper as x}from"../../utils/index.js";import{getDefaultValue as P}from"../rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js";function F(){const F="lowCodeFieldAdaptorPlugin";return g({name:F,apply(g){g.fieldHooks.field.tap({name:F,stage:m},((m,p,g)=>{const F=m,S={className:F.bold?"iho-table__boldCell":"",field:F.columnName,showOverflow:"tooltip",visible:R.notNegative(F.isShow),minWidth:F.colWidth,sortable:R.isPositive(F.isSort),fixed:c[F.isFixed],...F,title:F.alias||F.title};return function(e,a){const m={default:a.slotFn,header:a.headerSlotFn,edit:a.editSlotFn,footer:a.footerSlotFn,...a.slots};if(d(a.checkEditStatus)){const{default:e}=m;d(e)&&(m.default=l=>a.checkEditStatus(l)?e(l):[t("span",null,P(l.row,l.column.editRender.props))])}const c=m.header;m.header=e=>function(e,t,a){const m=l(v),c=l(b),p=e.column||{},h=n(null==m?void 0:m.value)&&!1!==t.annotation,g=x.isEditableColumn(c.value,p),R=x.hasFilter(t)||x.hasDateFiler(t),j=r(a)?a:d(a)?a(e):null;let P=!1;if(c.value){const e=c.value.editRules&&c.value.editRules[p.field];e&&(P=o(e).some((e=>e.required)))}return i("section",{class:"iho-table__headerWrapper"},[i("section",{style:{width:s(Math.max(0,p.renderWidth-20-(P?14:0)-(h?18:0)-(R?23:0)-(g?22:0)-(p.sortable?23:0)))}},[null!=j?j:i(u,{style:{maxWidth:"100%"}},{default:()=>p.title})]),h?i(f,{modelValue:m.value[p.field],"onUpdate:modelValue":e=>m.value[p.field]=e},null):null])}(e,a,c),e.slots=m}(S,F),function(t,l,i){var o,s;const r=a(e(l));r.componentProps={size:"mini"===i.size?"small":i.size,...r.componentProps},t.editRender={autofocus:"input",name:j.getCellType(l),props:r},t.editRender.enabled=!Reflect.get(h,t.editRender.name),d(null==(o=t.slots)?void 0:o.default)&&(t.editRender.enabled=t.editRender.enabled&&d(null==(s=t.slots)?void 0:s.edit));if(!n(l.settingObj))return;Reflect.has(l.settingObj,"isHide")&&(t.visible=t.visible&&R.notPositive(l.settingObj.isHide))}(S,F,g),S})),g.fieldHooks.field.tap({name:F+"After",stage:p},(e=>(n(e.slots)&&Object.entries(e.slots).forEach((([t,l])=>{null==l&&Reflect.deleteProperty(e.slots,t)})),e)))}})}export{F as lowCodeFieldAdaptorPlugin};