cnhis-design-vue 3.1.42-beta.8 → 3.1.42-beta.80

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 (289) hide show
  1. package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
  2. package/es/components/base-search/index.d.ts +2 -2
  3. package/es/components/base-search/src/index.vue.d.ts +2 -2
  4. package/es/components/base-search/style/index.css +1 -1
  5. package/es/components/big-table/index.d.ts +3 -4
  6. package/es/components/big-table/src/BigTable.vue.d.ts +3 -4
  7. package/es/components/big-table/src/BigTable.vue2.js +1 -1
  8. package/es/components/big-table/src/components/edit-form/edit-select-table.d.ts +1 -1
  9. package/es/components/big-table/src/components/edit-form/edit-select.js +1 -1
  10. package/es/components/big-table/src/hooks/useEvent.js +1 -1
  11. package/es/components/big-table/src/hooks/useFormat.js +1 -1
  12. package/es/components/big-table/src/hooks/useNestTable.js +1 -1
  13. package/es/components/big-table/src/hooks/useTableParse.js +1 -1
  14. package/es/components/big-table/src/utils.d.ts +11 -1
  15. package/es/components/big-table/src/utils.js +1 -1
  16. package/es/components/big-table/style/index.css +1 -1
  17. package/es/components/bpmn-workflow/index.d.ts +12 -0
  18. package/es/components/bpmn-workflow/src/BpmnWorkflow.vue.d.ts +12 -0
  19. package/es/components/bpmn-workflow/src/BpmnWorkflow.vue.js +1 -1
  20. package/es/components/button-print/index.d.ts +32 -7
  21. package/es/components/button-print/src/ButtonPrint.vue.d.ts +32 -8
  22. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  23. package/es/components/button-print/src/components/EditFormat.vue.d.ts +4 -4
  24. package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +4 -4
  25. package/es/components/button-print/src/utils/print.js +1 -1
  26. package/es/components/classification/index.d.ts +13 -13
  27. package/es/components/classification/src/components/set-classification/index.vue.d.ts +9 -9
  28. package/es/components/classification/src/components/set-classification/index.vue.js +1 -1
  29. package/es/components/classification/src/components/table-modal/index.vue.d.ts +9 -9
  30. package/es/components/classification/src/components/table-modal/index.vue.js +1 -1
  31. package/es/components/classification/src/index.vue.d.ts +14 -14
  32. package/es/components/classification/src/index.vue.js +1 -1
  33. package/es/components/classification/style/index.css +1 -1
  34. package/es/components/config-provider/src/ConfigProvider.js +1 -1
  35. package/es/components/config-provider/src/interface.d.ts +4 -4
  36. package/es/components/date-picker/index.d.ts +4 -0
  37. package/es/components/date-picker/src/DatePicker.vue.d.ts +4 -0
  38. package/es/components/date-picker/src/DatePicker.vue.js +1 -1
  39. package/es/components/fabric-chart/index.d.ts +2 -2
  40. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +2 -2
  41. package/es/components/fabric-chart/src/hooks/useBirthProcess.d.ts +1 -0
  42. package/es/components/fabric-chart/src/hooks/useBirthProcess.js +1 -1
  43. package/es/components/fabric-chart/src/hooks/useBirthProcessChart.js +1 -1
  44. package/es/components/fabric-chart/src/hooks/useCenter.js +1 -1
  45. package/es/components/fabric-chart/src/hooks/useLeft.js +1 -1
  46. package/es/components/fabric-chart/src/hooks/useScaleColumn.d.ts +16 -0
  47. package/es/components/fabric-chart/src/hooks/useScaleColumn.js +1 -0
  48. package/es/components/field-set/index.d.ts +26 -81
  49. package/es/components/field-set/src/FieldSet.vue.d.ts +28 -32
  50. package/es/components/field-set/src/FieldSet.vue.js +1 -1
  51. package/es/components/field-set/style/index.css +1 -1
  52. package/es/components/form-config/index.d.ts +88 -42
  53. package/es/components/form-config/src/FormConfig.vue.d.ts +88 -42
  54. package/es/components/form-config/src/FormConfig.vue.js +1 -1
  55. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +27 -13
  56. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +47 -23
  57. package/es/components/form-config/src/components/FormConfigEdit.vue.js +1 -1
  58. package/es/components/form-config/src/components/renderer/DefaultNode.vue.js +1 -1
  59. package/es/components/form-config/src/constants/index.d.ts +19 -1
  60. package/es/components/form-config/src/constants/index.js +1 -1
  61. package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
  62. package/es/components/form-config/src/types/index.d.ts +1 -0
  63. package/es/components/form-render/index.d.ts +27 -13
  64. package/es/components/form-render/index.js +1 -1
  65. package/es/components/form-render/src/FormRender.vue.d.ts +27 -13
  66. package/es/components/form-render/src/FormRender.vue.js +1 -1
  67. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +27 -13
  68. package/es/components/form-render/src/components/renderer/combination.js +1 -1
  69. package/es/components/form-render/src/components/renderer/complex.d.ts +1 -1
  70. package/es/components/form-render/src/components/renderer/date.d.ts +4 -0
  71. package/es/components/form-render/src/components/renderer/date.js +1 -1
  72. package/es/components/form-render/src/components/renderer/jsonCombination/index.js +1 -1
  73. package/es/components/form-render/src/components/renderer/levelSearchCascader.d.ts +18 -0
  74. package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
  75. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +1 -1
  76. package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +1 -1
  77. package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +56 -2
  78. package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
  79. package/es/components/form-render/src/components/renderer/remoteSearch.d.ts +18 -0
  80. package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
  81. package/es/components/form-render/src/components/renderer/searchCascade.d.ts +36 -0
  82. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  83. package/es/components/form-render/src/components/renderer/select.d.ts +32 -5
  84. package/es/components/form-render/src/components/renderer/select.js +1 -1
  85. package/es/components/form-render/src/hooks/index.d.ts +1 -1
  86. package/es/components/form-render/src/hooks/index.js +1 -1
  87. package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +1 -0
  88. package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
  89. package/es/components/form-render/src/hooks/useComplexOptions.d.ts +2 -1
  90. package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
  91. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  92. package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
  93. package/es/components/form-render/src/hooks/useFormAsyncQueue.d.ts +16 -0
  94. package/es/components/form-render/src/hooks/useFormAsyncQueue.js +1 -0
  95. package/es/components/form-render/src/hooks/useFormContext.js +1 -1
  96. package/es/components/form-render/src/hooks/useFormEvent.d.ts +1 -1
  97. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  98. package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +13 -8
  99. package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
  100. package/es/components/form-render/src/types/fieldItem.d.ts +15 -5
  101. package/es/components/form-render/src/types/index.d.ts +4 -3
  102. package/es/components/form-render/style/index.css +1 -1
  103. package/es/components/iho-table/index.d.ts +26 -5
  104. package/es/components/iho-table/src/IhoTable.vue.d.ts +26 -5
  105. package/es/components/iho-table/src/IhoTable.vue.js +1 -1
  106. package/es/components/iho-table/src/constants/index.d.ts +3 -2
  107. package/es/components/iho-table/src/constants/index.js +1 -1
  108. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +4 -4
  109. package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
  110. package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.d.ts +24 -21
  111. package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.js +1 -1
  112. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +60 -237
  113. package/es/components/iho-table/src/hooks/tapHooks/useExposeHooks.d.ts +1 -4
  114. package/es/components/iho-table/src/hooks/tapHooks/useFieldHooks.d.ts +4 -16
  115. package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.d.ts +2 -2
  116. package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.js +1 -1
  117. package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
  118. package/es/components/iho-table/src/plugins/anchorPlugin/tableAnchor.js +1 -1
  119. package/es/components/iho-table/src/plugins/anchorPlugin/useAnchor.js +1 -1
  120. package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +1 -1
  121. package/es/components/iho-table/src/plugins/fieldConnectionPlugin/fieldConnectionUtils.d.ts +11 -0
  122. package/es/components/iho-table/src/plugins/fieldConnectionPlugin/fieldConnectionUtils.js +1 -0
  123. package/es/components/iho-table/src/plugins/fieldConnectionPlugin/index.d.ts +1 -0
  124. package/es/components/iho-table/src/plugins/fieldConnectionPlugin/index.js +1 -0
  125. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +48 -0
  126. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.js +1 -0
  127. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/index.d.ts +1 -0
  128. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/index.js +1 -0
  129. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +1 -1
  130. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.js +1 -1
  131. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  132. package/es/components/iho-table/src/plugins/highLightSetPlugin.d.ts +1 -0
  133. package/es/components/iho-table/src/plugins/highLightSetPlugin.js +1 -0
  134. package/es/components/iho-table/src/plugins/index.js +1 -1
  135. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
  136. package/es/components/iho-table/src/plugins/maxCheckSizePlugin.d.ts +1 -0
  137. package/es/components/iho-table/src/plugins/maxCheckSizePlugin.js +1 -0
  138. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +4 -0
  139. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useTriggerEvent.d.ts +0 -0
  140. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useTriggerEvent.js +1 -0
  141. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +25 -3
  142. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  143. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  144. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +2 -1
  145. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
  146. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +2 -1
  147. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.js +1 -1
  148. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
  149. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/seqRendererPlugin.js +1 -1
  150. package/es/components/iho-table/src/plugins/rowClickPlugin/index.js +1 -1
  151. package/es/components/iho-table/src/plugins/rowDragPlugin/index.d.ts +1 -0
  152. package/es/components/iho-table/src/plugins/rowDragPlugin/index.js +1 -0
  153. package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.js +1 -1
  154. package/es/components/iho-table/src/types/index.d.ts +48 -5
  155. package/es/components/iho-table/src/types/pluginType.d.ts +32 -39
  156. package/es/components/iho-table/src/utils/index.d.ts +8 -3
  157. package/es/components/iho-table/src/utils/index.js +1 -1
  158. package/es/components/iho-table/style/iconfont.ttf +0 -0
  159. package/es/components/iho-table/style/index.css +1 -1
  160. package/es/components/index.css +1 -1
  161. package/es/components/index.d.ts +1 -0
  162. package/es/components/index.js +1 -1
  163. package/es/components/info-header/index.d.ts +56 -27
  164. package/es/components/info-header/src/InfoHeader.vue.d.ts +56 -27
  165. package/es/components/info-header/src/InfoHeader.vue.js +1 -1
  166. package/es/components/info-header/src/components/infoDescription/HiddenContent.vue.js +1 -1
  167. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +27 -13
  168. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +28 -13
  169. package/es/components/info-header/src/components/patientInfo/index.vue.js +1 -1
  170. package/es/components/info-header/style/index.css +1 -1
  171. package/es/components/keyboard/index.d.ts +4 -2
  172. package/es/components/keyboard/src/Keyboard.vue.d.ts +4 -2
  173. package/es/components/keyboard/src/Keyboard.vue.js +1 -1
  174. package/es/components/keyboard/src/components/NumberPanel.vue.d.ts +3 -1
  175. package/es/components/keyboard/src/components/NumberPanel.vue.js +1 -1
  176. package/es/components/keyboard/src/constants/index.js +1 -1
  177. package/es/components/keyboard/style/index.css +1 -1
  178. package/es/components/map/index.d.ts +2 -14
  179. package/es/components/map/src/Map.vue.d.ts +1 -14
  180. package/es/components/map/src/types/index.d.ts +19 -0
  181. package/es/components/map/src/types/index.js +1 -0
  182. package/es/components/recommend-search/index.d.ts +13 -128
  183. package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +15 -130
  184. package/es/components/recommend-search/src/RecommendSearch.vue.js +1 -1
  185. package/es/components/recommend-search/src/components/BaseSearch.d.ts +84 -0
  186. package/es/components/recommend-search/src/components/BaseSearch.js +1 -0
  187. package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +3 -63
  188. package/es/components/recommend-search/src/components/RecommendInput.vue.js +1 -1
  189. package/es/components/recommend-search/src/components/RecommendMenu.vue.d.ts +1 -3
  190. package/es/components/recommend-search/src/components/RecommendMenu.vue.js +1 -1
  191. package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +4 -62
  192. package/es/components/recommend-search/src/components/RecommendSelect.vue.js +1 -1
  193. package/es/components/recommend-search/src/constant/index.d.ts +3 -0
  194. package/es/components/recommend-search/src/constant/index.js +1 -1
  195. package/es/components/scale-view/index.d.ts +38 -224
  196. package/es/components/scale-view/index.js +1 -1
  197. package/es/components/scale-view/src/ScaleView.vue.d.ts +37 -224
  198. package/es/components/scale-view/src/ScaleView.vue.js +1 -1
  199. package/es/components/scale-view/src/components/AnswerParse.vue.d.ts +1 -43
  200. package/es/components/scale-view/src/components/AnswerParse.vue.js +1 -1
  201. package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +0 -42
  202. package/es/components/scale-view/src/components/EvaluateCountdown.vue.js +1 -1
  203. package/es/components/scale-view/src/components/formitem/r-address.js +1 -1
  204. package/es/components/scale-view/src/components/formitem/r-checkbox.js +1 -1
  205. package/es/components/scale-view/src/components/formitem/r-datetime.js +1 -1
  206. package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
  207. package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
  208. package/es/components/scale-view/src/components/formitem/standard-modal.d.ts +8 -8
  209. package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
  210. package/es/components/scale-view/src/components/formitem/text-over-tooltip/TextOverTooltip.vue.d.ts +1 -1
  211. package/es/components/scale-view/src/hooks/scaleview-computed.d.ts +1 -1
  212. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  213. package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
  214. package/es/components/scale-view/src/hooks/scaleview-submit.d.ts +5 -1
  215. package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
  216. package/es/components/scale-view/src/hooks/scaleview-validate.js +1 -1
  217. package/es/components/scale-view/src/hooks/use-component.d.ts +74 -4
  218. package/es/components/scale-view/src/hooks/use-evaluate.js +1 -1
  219. package/es/components/scale-view/src/hooks/use-event.js +1 -1
  220. package/es/components/scale-view/src/types/index.d.ts +7 -0
  221. package/es/components/scale-view/src/types/index.js +1 -0
  222. package/es/components/scale-view/style/index.css +1 -1
  223. package/es/components/scale-view/style/scale-view-iconfont.ttf +0 -0
  224. package/es/components/search-cascader/index.d.ts +12 -1
  225. package/es/components/search-cascader/src/SearchCascader.vue.d.ts +12 -1
  226. package/es/components/search-cascader/src/SearchCascader.vue.js +1 -1
  227. package/es/components/search-cascader/src/components/SearchMenu.d.ts +8 -1
  228. package/es/components/search-cascader/src/components/SearchMenu.js +1 -1
  229. package/es/components/search-cascader/src/constants/index.d.ts +1 -0
  230. package/es/components/search-cascader/src/constants/index.js +1 -1
  231. package/es/components/select-label/index.d.ts +1 -1
  232. package/es/components/select-label/src/LabelFormContent.vue.js +1 -1
  233. package/es/components/select-label/src/SelectLabel.vue.d.ts +1 -1
  234. package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
  235. package/es/components/select-label/style/index.css +1 -1
  236. package/es/components/select-person/index.d.ts +199 -10
  237. package/es/components/select-person/src/SearchMultiple.vue.d.ts +125 -0
  238. package/es/components/select-person/src/SearchMultiple.vue.js +1 -0
  239. package/es/components/select-person/src/SearchMultiple.vue2.js +1 -0
  240. package/es/components/select-person/src/SelectPerson.vue.d.ts +186 -9
  241. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  242. package/es/components/select-person/src/utils/index.js +1 -1
  243. package/es/components/select-person/style/index.css +1 -1
  244. package/es/components/shortcut-setter/index.d.ts +33 -16
  245. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +33 -16
  246. package/es/components/steps-wheel/src/StepsWheel.vue.js +1 -1
  247. package/es/components/steps-wheel/src/constants/index.js +1 -1
  248. package/es/components/steps-wheel/style/index.css +1 -1
  249. package/es/components/table-filter/src/components/render-widget/components/CheckboxGroup.vue.d.ts +4 -4
  250. package/es/components/table-filter/src/components/render-widget/components/CheckboxGroup.vue.js +1 -1
  251. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +5 -5
  252. package/es/components/table-filter/src/types/index.d.ts +11 -2
  253. package/es/components/time-picker/src/TimePicker.vue.js +1 -1
  254. package/es/components/vod-chunk-upload/index.d.ts +73 -3
  255. package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.d.ts +73 -3
  256. package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.js +1 -1
  257. package/es/env.d.ts +1 -0
  258. package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.d.ts +1 -1
  259. package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.js +1 -1
  260. package/es/shared/{mixins → hooks}/index.d.ts +1 -0
  261. package/es/shared/{mixins → hooks}/index.js +1 -1
  262. package/es/{components/form-render/src → shared}/hooks/useAsyncQueue.d.ts +0 -14
  263. package/es/shared/hooks/useAsyncQueue.js +1 -0
  264. package/es/shared/{mixins → hooks}/useDateTime.d.ts +2 -2
  265. package/es/shared/hooks/useDateTime.js +1 -0
  266. package/es/shared/package.json.js +1 -0
  267. package/es/shared/utils/anime.d.ts +1 -1
  268. package/es/shared/utils/anime.js +1 -1
  269. package/es/shared/utils/index.d.ts +3 -14
  270. package/es/shared/utils/index.js +1 -1
  271. package/es/shared/utils/vexutils.d.ts +2 -2
  272. package/es/shared/utils/vexutils.js +1 -1
  273. package/es/shared/utils/vexutilsExpand.d.ts +254 -0
  274. package/es/shared/utils/vexutilsExpand.js +1 -0
  275. package/package.json +2 -2
  276. package/es/components/form-render/src/hooks/useAsyncQueue.js +0 -1
  277. package/es/components/recommend-search/src/components/BaseSearch.vue.d.ts +0 -143
  278. package/es/components/recommend-search/src/components/BaseSearch.vue.js +0 -1
  279. package/es/components/scale-view/src/hooks/scaleview-props.d.ts +0 -115
  280. package/es/components/scale-view/src/hooks/scaleview-props.js +0 -1
  281. package/es/shared/mixins/useDateTime.js +0 -1
  282. package/es/shared/utils/colorLog.d.ts +0 -31
  283. package/es/shared/utils/colorLog.js +0 -1
  284. /package/es/components/base-search/style/{iconfont.ttf → base-search-iconfont.ttf} +0 -0
  285. /package/es/components/classification/style/{iconfont.ttf → classification-iconfont.ttf} +0 -0
  286. /package/es/components/info-header/style/{iconfont.ttf → info-header-font.ttf} +0 -0
  287. /package/es/components/select-label/style/{iconfont.ttf → select-label-iconfont.ttf} +0 -0
  288. /package/es/shared/{mixins → hooks}/useTheme.d.ts +0 -0
  289. /package/es/shared/{mixins → hooks}/useTheme.js +0 -0
@@ -19,6 +19,14 @@ export declare const RADIO: import("vue").DefineComponent<{
19
19
  type: BooleanConstructor;
20
20
  default: boolean;
21
21
  };
22
+ labelField: {
23
+ type: StringConstructor;
24
+ default: string;
25
+ };
26
+ valueField: {
27
+ type: StringConstructor;
28
+ default: string;
29
+ };
22
30
  wordbook: {
23
31
  type: PropType<Partial<{
24
32
  level_num: number;
@@ -41,6 +49,10 @@ export declare const RADIO: import("vue").DefineComponent<{
41
49
  type: BooleanConstructor;
42
50
  default: boolean;
43
51
  };
52
+ childFieldStrategy: {
53
+ type: PropType<"checked" | "all">;
54
+ default: string;
55
+ };
44
56
  onChange: {};
45
57
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
46
58
  value: {
@@ -61,6 +73,14 @@ export declare const RADIO: import("vue").DefineComponent<{
61
73
  type: BooleanConstructor;
62
74
  default: boolean;
63
75
  };
76
+ labelField: {
77
+ type: StringConstructor;
78
+ default: string;
79
+ };
80
+ valueField: {
81
+ type: StringConstructor;
82
+ default: string;
83
+ };
64
84
  wordbook: {
65
85
  type: PropType<Partial<{
66
86
  level_num: number;
@@ -83,14 +103,21 @@ export declare const RADIO: import("vue").DefineComponent<{
83
103
  type: BooleanConstructor;
84
104
  default: boolean;
85
105
  };
106
+ childFieldStrategy: {
107
+ type: PropType<"checked" | "all">;
108
+ default: string;
109
+ };
86
110
  onChange: {};
87
111
  }>> & {
88
112
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
89
113
  }, {
90
- vertical: boolean;
91
114
  options: AnyObject[];
115
+ vertical: boolean;
116
+ labelField: string;
117
+ valueField: string;
92
118
  lazyRequest: boolean;
93
119
  requestCache: boolean;
120
+ childFieldStrategy: "checked" | "all";
94
121
  }>;
95
122
  export declare const CHECKBOX: import("vue").DefineComponent<{
96
123
  value: {
@@ -111,6 +138,14 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
111
138
  type: BooleanConstructor;
112
139
  default: boolean;
113
140
  };
141
+ labelField: {
142
+ type: StringConstructor;
143
+ default: string;
144
+ };
145
+ valueField: {
146
+ type: StringConstructor;
147
+ default: string;
148
+ };
114
149
  wordbook: {
115
150
  type: PropType<Partial<{
116
151
  level_num: number;
@@ -133,6 +168,10 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
133
168
  type: BooleanConstructor;
134
169
  default: boolean;
135
170
  };
171
+ childFieldStrategy: {
172
+ type: PropType<"checked" | "all">;
173
+ default: string;
174
+ };
136
175
  onChange: {};
137
176
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
138
177
  value: {
@@ -153,6 +192,14 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
153
192
  type: BooleanConstructor;
154
193
  default: boolean;
155
194
  };
195
+ labelField: {
196
+ type: StringConstructor;
197
+ default: string;
198
+ };
199
+ valueField: {
200
+ type: StringConstructor;
201
+ default: string;
202
+ };
156
203
  wordbook: {
157
204
  type: PropType<Partial<{
158
205
  level_num: number;
@@ -175,12 +222,19 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
175
222
  type: BooleanConstructor;
176
223
  default: boolean;
177
224
  };
225
+ childFieldStrategy: {
226
+ type: PropType<"checked" | "all">;
227
+ default: string;
228
+ };
178
229
  onChange: {};
179
230
  }>> & {
180
231
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
181
232
  }, {
182
- vertical: boolean;
183
233
  options: AnyObject[];
234
+ vertical: boolean;
235
+ labelField: string;
236
+ valueField: string;
184
237
  lazyRequest: boolean;
185
238
  requestCache: boolean;
239
+ childFieldStrategy: "checked" | "all";
186
240
  }>;
@@ -1 +1 @@
1
- import{defineComponent as e,createVNode as o,isVNode as t}from"vue";import{connect as a,mapProps as l}from"@formily/vue";import{NSpace as r,NRadio as u,NRadioGroup as i,NCheckbox as n,NCheckboxGroup as p}from"naive-ui";import"../../../index.js";import{useComplexOptions as s}from"../../hooks/useComplexOptions.js";import"../../utils/index.js";import{useAutographOptions as m}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as v}from"../../hooks/useCommonInjection.js";import{assignUpdateValue as c,createVisitedSetter as d}from"../../utils/schema.js";import{useFormField as f}from"../../hooks/useFormField.js";function y(a,l,u){return e({name:a,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},wordbook:{type:Object},vertical:{type:Boolean,default:!1},onChange:{}},emits:["update:value"],setup(e,{emit:a}){const{field:i}=f(),{renderComplexOption:n,valueRef:p}=s(e,a),{labelKey:c,valueKey:y,fullOptions:j}=m(e,p),{injectValueBindKey:b,injectValueValidate:h}=v();h(p);const k=b(p);return()=>o(l,{key:k.value,value:p.value,"onUpdate:value":e=>p.value=e,onClick:d(i)},{default:()=>[o(r,{vertical:e.vertical,"vertical-space":e.vertical},{default:()=>{var e;return[null==(e=j.value)?void 0:e.map((e=>{let a;return o(u,{key:e[y.value],value:e[y.value],disabled:e.disabled},"function"==typeof(l=a=n({value:p.value,option:e,valueKey:y.value,labelKey:c.value}))||"[object Object]"===Object.prototype.toString.call(l)&&!t(l)?a:{default:()=>[a]});var l}))]}})]})}})}const j=a(y("FormRadio",i,u),l({dataSource:"options"},c)),b=a(y("FormCheckbox",p,n),l({dataSource:"options"},c));export{b as CHECKBOX,j as RADIO};
1
+ import{defineComponent as e,createVNode as t,isVNode as o}from"vue";import{connect as l,mapProps as a}from"@formily/vue";import{NSpace as r,NRadio as i,NRadioGroup as u,NCheckbox as n,NCheckboxGroup as p}from"naive-ui";import"../../../index.js";import{useComplexOptions as d}from"../../hooks/useComplexOptions.js";import"../../utils/index.js";import{useAutographOptions as s}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as m}from"../../hooks/useCommonInjection.js";import{assignUpdateValue as c,createVisitedSetter as v}from"../../utils/schema.js";import{useFormField as y}from"../../hooks/useFormField.js";function f(l,a,i){return e({name:l,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},wordbook:{type:Object},vertical:{type:Boolean,default:!1},childFieldStrategy:{type:String,default:"checked"},onChange:{}},emits:["update:value"],setup(e,{emit:l}){const{field:u}=y(),{renderComplexOption:n,valueRef:p}=d(e,l),{labelKey:c,valueKey:f,fullOptions:j}=s(e,p),{injectValueBindKey:b,injectValueValidate:h}=m();h(p);const g=b(p);return()=>t(a,{key:g.value,value:p.value,"onUpdate:value":e=>p.value=e,onClick:v(u)},{default:()=>[t(r,{vertical:e.vertical,"vertical-space":e.vertical},{default:()=>{var l;return[null==(l=j.value)?void 0:l.map((l=>{let a;return t(i,{key:l[f.value],value:l[f.value],disabled:l.disabled},"function"==typeof(r=a=n({value:p.value,option:l,valueKey:f.value,labelKey:c.value,childFieldStrategy:e.childFieldStrategy}))||"[object Object]"===Object.prototype.toString.call(r)&&!o(r)?a:{default:()=>[a]});var r}))]}})]})}})}const j=l(f("FormRadio",u,i),a({dataSource:"options"},c)),b=l(f("FormCheckbox",p,n),a({dataSource:"options"},c));export{b as CHECKBOX,j as RADIO};
@@ -13,6 +13,14 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
13
13
  type: PropType<AnyObject[]>;
14
14
  default: () => never[];
15
15
  };
16
+ labelField: {
17
+ type: StringConstructor;
18
+ default: string;
19
+ };
20
+ valueField: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ };
16
24
  urlConfig: {
17
25
  type: PropType<UrlConfig>;
18
26
  };
@@ -29,6 +37,14 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
29
37
  type: PropType<AnyObject[]>;
30
38
  default: () => never[];
31
39
  };
40
+ labelField: {
41
+ type: StringConstructor;
42
+ default: string;
43
+ };
44
+ valueField: {
45
+ type: StringConstructor;
46
+ default: string;
47
+ };
32
48
  urlConfig: {
33
49
  type: PropType<UrlConfig>;
34
50
  };
@@ -37,5 +53,7 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
37
53
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
38
54
  }, {
39
55
  options: AnyObject[];
56
+ labelField: string;
57
+ valueField: string;
40
58
  requestCache: boolean;
41
59
  }>;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,computed as o,inject as u,watch as a,createVNode as r}from"vue";import{connect as t,mapProps as n}from"@formily/vue";import{useVModel as i,useDebounceFn as s}from"@vueuse/core";import{isString as v,isArray as m,cloneDeep as p,isEqual as d}from"lodash-es";import{NSelect as f}from"naive-ui";import"../../../index.js";import{InjectionAsyncQueue as c,InjectionChangeContextCollector as y,InjectionFormItemDepsCollector as h}from"../../constants/index.js";import{createUrlConfigParams as C,formRenderLog as g}from"../../utils/index.js";import{useCommonInjection as j,useSelectOptionProps as x}from"../../hooks/useCommonInjection.js";import{useFormField as F}from"../../hooks/useFormField.js";import{createVisitedSetter as K,assignUpdateValue as b,assignClearBindVisited as k}from"../../utils/schema.js";const w=t(e({name:"FormRemoteSearch",props:{value:{type:String},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},urlConfig:{type:Object},onChange:{}},emits:["update:value"],setup(e,{slots:t,emit:n}){const b=i(e,"value",n),{field:k,fieldKey:w}=F(),S=l(null),V=o((()=>{var l,o;return null!=(o=null==(l=e.urlConfig)?void 0:l.nameKey)?o:"text"})),q=o((()=>{var l,o;return null!=(o=null==(l=e.urlConfig)?void 0:l.valueKey)?o:"value"})),A=u(c),B=s((async(l="",o="label")=>{if(!e.urlConfig)return S.value=null;try{S.value=await A.addAsync(await C({config:{...e.urlConfig,params:{...e.urlConfig.params,["value"===o?q.value:"keyword"]:l}},cache:e.requestCache,field:k.value}))}catch(e){v(e)&&g(e)}})),O=o((()=>m(S.value)?S.value:m(e.options)?e.options:[])),{injectValueValidate:P,injectValueBindKey:U}=j();P(b);const D=U(b);a(b,(e=>{if(e&&!O.value.find((l=>l[q.value]===e)))return B(e,"value")}));u(y).setContext(w.value,(e=>{return{currentOption:p((l=e,O.value.find((e=>e[q.value]===l))))};var l}));const I=u(h);a((()=>e.urlConfig),((e,l)=>{d(e,l)||(S.value=null,e&&(I.setDeps(w.value,e.dependKey||[],(async()=>{S.value=null,b.value=null})),b.value&&B(b.value,"value")))}),{immediate:!0});const{menuProps:R,nodeProps:z}=x();return()=>r(f,{remote:!0,filterable:!0,key:D.value,value:b.value,"onUpdate:value":e=>b.value=e,labelField:V.value,valueField:q.value,"menu-props":R,"node-props":z,onSearch:B,"onUpdate:show":e=>e&&B(),options:O.value,onFocus:K(k)},t)}}),n(b,k));export{w as REMOTE_SEARCH};
1
+ import{defineComponent as e,ref as l,computed as u,inject as a,watch as o,createVNode as t}from"vue";import{connect as n,mapProps as r}from"@formily/vue";import{useVModel as i,useDebounceFn as s}from"@vueuse/core";import{isString as v,isArray as m,cloneDeep as p,isEqual as d}from"lodash-es";import{NSelect as f}from"naive-ui";import"../../../index.js";import{InjectionAsyncQueue as c,InjectionChangeContextCollector as y,InjectionFormItemDepsCollector as g}from"../../constants/index.js";import{createUrlConfigParams as h,formRenderLog as C}from"../../utils/index.js";import{useCommonInjection as j,useSelectOptionProps as F}from"../../hooks/useCommonInjection.js";import{useFormField as x}from"../../hooks/useFormField.js";import{createVisitedSetter as b,assignUpdateValue as K,assignClearBindVisited as S}from"../../utils/schema.js";const k=n(e({name:"FormRemoteSearch",props:{value:{type:String},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},urlConfig:{type:Object},onChange:{}},emits:["update:value"],setup(e,{slots:n,emit:r}){const K=i(e,"value",r),{field:S,fieldKey:k}=x(),w=l(null),V=u((()=>{var l,u,a;return null!=(a=null!=(u=null==(l=e.urlConfig)?void 0:l.nameKey)?u:e.labelField)?a:"text"})),q=u((()=>{var l,u,a;return null!=(a=null!=(u=null==(l=e.urlConfig)?void 0:l.valueKey)?u:e.valueField)?a:"value"})),A=a(c),B=s((async(l="",u="label")=>{if(!e.urlConfig)return w.value=null;try{w.value=await A.addAsync(await h({config:{...e.urlConfig,params:{...e.urlConfig.params,["value"===u?q.value:"keyword"]:l}},cache:e.requestCache,field:S.value}))}catch(e){v(e)&&C(e)}})),O=u((()=>m(w.value)?w.value:m(e.options)?e.options:[])),{injectValueValidate:P,injectValueBindKey:U}=j();P(K);const D=U(K);o(K,(e=>{if(e&&!O.value.find((l=>l[q.value]===e)))return B(e,"value")}));a(y).setContext(k.value,(e=>{return{currentOption:p((l=e,O.value.find((e=>e[q.value]===l))))};var l}));const I=a(g);o((()=>e.urlConfig),((e,l)=>{d(e,l)||(w.value=null,e&&(I.setDeps(k.value,e.dependKey||[],(async()=>{w.value=null,K.value=null})),K.value&&B(K.value,"value")))}),{immediate:!0});const{menuProps:R,nodeProps:z}=F();return()=>t(f,{remote:!0,filterable:!0,key:D.value,value:K.value,"onUpdate:value":e=>K.value=e,labelField:V.value,valueField:q.value,"menu-props":R,"node-props":z,onSearch:B,"onUpdate:show":e=>e&&B(),options:O.value,onFocus:b(S)},n)}}),r(K,S));export{k as REMOTE_SEARCH};
@@ -12,6 +12,10 @@ export declare const SEARCH_CASCADER: import("vue").DefineComponent<{
12
12
  urlConfig: {
13
13
  type: PropType<UrlConfig>;
14
14
  };
15
+ lazyRequest: {
16
+ type: BooleanConstructor;
17
+ default: boolean;
18
+ };
15
19
  requestCache: {
16
20
  type: BooleanConstructor;
17
21
  default: boolean;
@@ -23,6 +27,18 @@ export declare const SEARCH_CASCADER: import("vue").DefineComponent<{
23
27
  type: BooleanConstructor;
24
28
  default: boolean;
25
29
  };
30
+ checkStrategy: {
31
+ type: StringConstructor;
32
+ default: string;
33
+ };
34
+ labelField: {
35
+ type: StringConstructor;
36
+ default: string;
37
+ };
38
+ valueField: {
39
+ type: StringConstructor;
40
+ default: string;
41
+ };
26
42
  onChange: {};
27
43
  value: {};
28
44
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -36,6 +52,10 @@ export declare const SEARCH_CASCADER: import("vue").DefineComponent<{
36
52
  urlConfig: {
37
53
  type: PropType<UrlConfig>;
38
54
  };
55
+ lazyRequest: {
56
+ type: BooleanConstructor;
57
+ default: boolean;
58
+ };
39
59
  requestCache: {
40
60
  type: BooleanConstructor;
41
61
  default: boolean;
@@ -47,12 +67,28 @@ export declare const SEARCH_CASCADER: import("vue").DefineComponent<{
47
67
  type: BooleanConstructor;
48
68
  default: boolean;
49
69
  };
70
+ checkStrategy: {
71
+ type: StringConstructor;
72
+ default: string;
73
+ };
74
+ labelField: {
75
+ type: StringConstructor;
76
+ default: string;
77
+ };
78
+ valueField: {
79
+ type: StringConstructor;
80
+ default: string;
81
+ };
50
82
  onChange: {};
51
83
  value: {};
52
84
  }>> & {
53
85
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
54
86
  }, {
55
87
  options: AnyObject[];
88
+ checkStrategy: string;
89
+ labelField: string;
90
+ valueField: string;
91
+ lazyRequest: boolean;
56
92
  requestCache: boolean;
57
93
  filterable: boolean;
58
94
  }>;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as a,inject as o,watch as r,createVNode as l,nextTick as n}from"vue";import{isEqual as i,isArray as u}from"lodash-es";import"../../../index.js";import{useCommonInjection as s}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as c,InjectionFormUUID as p}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import"@vueuse/core";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"../../hooks/useFormValidator.js";import"@formily/core";import"date-fns";import"@formily/reactive";import{connect as d,mapProps as v}from"@formily/vue";import"@vue/shared";import"./index.js";import"../../hooks/useFormRenderOptions.js";import{NCascader as f}from"naive-ui";import{createVisitedSetter as h,assignUpdateValue as y,traverseDependKey as j}from"../../utils/schema.js";const b=d(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:d,emit:v}){const y=t(),{field:b,title:k}=m(),C=a((()=>{var t,a;return null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:"text"})),g=a((()=>{var t,a;return null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:"value"})),A=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");return Array.isArray(t)&&t.length?t.map((e=>e[C.value])).join(" / "):null}catch(e){return null}}));function S(e,t,a){v("update:value",a.map((function(e){return{...e,label:e[C.value],children:void 0,parent:void 0}})))}const F=o(c);async function w(t){e.filterable?await async function(){if(!e.urlConfig||y.value&&e.requestCache)return;const t=await F.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:k.value,cache:e.requestCache});function a(e,t){const o={[C.value]:e[C.value],[g.value]:e[g.value],depth:t+1,isLeaf:!0};return u(e.children)&&(o.children=e.children.map((e=>a(e,t+1))),o.isLeaf=!e.children.length),o}y.value=t.map((e=>a(e,0)))}():await async function(t){if(r(e,t))return;const a=await F.addAsync(l(s(t),u(e),k.value,t));if(!a.length&&t)return t.isLeaf=!0,S(0,0,n(t)),void(K.value=!1);const o=a.map((e=>i(e,s(t))));function r(e,t){return!u(e)||!t&&y.value&&e.requestCache||s(t)>=s(e)-1}function l(t,a,o,r){const l={lvlnr:t+1+""};return r&&a.dependKey&&j(a.dependKey,((e,t)=>{l[t]=r[e]})),{params:l,...a,key:o,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function i(a,o){return{[C.value]:a[C.value],[g.value]:a[g.value],depth:o+1,parent:t,isLeaf:o+2>=s(e)}}function u(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=o:y.value=o}(t),await x()}const H=`form-render__cascade--menu-${o(p)}`;async function x(){await n();const e=document.querySelector(`.${H} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}const{injectValueValidate:L,injectValueWatchFromEmpty:q,injectValueBindKey:B}=s();q((()=>e.value),w),L((()=>e.value)),r((()=>e.urlConfig),(async(e,t)=>{i(e,t)||(y.value=null,await w())}));const K=t(!1);function V(e){K.value=!!e,e&&w()}const E=a((()=>y.value||e.options||[])),O=a((()=>!e.filterable)),W=B(A);return()=>l(f,{key:W.value,remote:O.value,filterable:e.filterable,"menu-props":{class:H,onClick:x},checkStrategy:"child",show:!!K.value,"onUpdate:show":V,value:A.value,"onUpdate:value":S,labelField:C.value,valueField:g.value,options:E.value,onLoad:w,onFocus:h(b)},d)}}),v({dataSource:"options"},y));export{b as SEARCH_CASCADER};
1
+ import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as o,nextTick as n}from"vue";import{isEqual as u,isArray as i,isString as s}from"lodash-es";import"../../../index.js";import{useCommonInjection as c}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as p,InjectionFormUUID as d}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import{NCascader as v}from"naive-ui";import"@vueuse/core";import"date-fns";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"../../hooks/useFormValidator.js";import"@formily/core";import"@formily/reactive";import{connect as f,mapProps as y}from"@formily/vue";import"@vue/shared";import"./index.js";import"../../hooks/useFormRenderOptions.js";import{createVisitedSetter as h,assignUpdateValue as j,traverseDependKey as k}from"../../utils/schema.js";const g=f(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},checkStrategy:{type:String,default:"child"},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:f,emit:y}){const j=t(),{field:g,title:b}=m(),S=t(1),C=t(!0);const w=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),F=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"})),A=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");if(!Array.isArray(t)||!t.length)return null;const a=t.map((e=>e[F.value])).slice(-1).join(""),l=t.map((e=>e[w.value])).join(" / ");return a||l}catch(e){return null}}));function H(e,t,a){y("update:value",i(a)?a.map((function(e){return{...e,label:e[w.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const x=l(p);async function q(t){e.filterable?await async function(){if(!e.urlConfig||j.value&&e.requestCache)return;const t=await x.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:b.value,cache:e.requestCache});function a(e,t,r){const o=[...r,...l(e)],n={[w.value]:e[w.value],[F.value]:e[F.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:o};return i(e.children)&&(n.children=e.children.map((e=>a(e,t+1,o))),n.isLeaf=!e.children.length),S.value=Math.max(S.value,t+1),n}function l(e){let t=[];if(s(e[w.value])&&(t=[...t,e[w.value]]),s(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}j.value=t.map((e=>a(e,0,[])))}():await async function(t){if(r(e,t))return;const a=await x.addAsync(o(s(t),i(e),b.value,t));if(!a.length&&t)return t.isLeaf=!0,H(0,0,n(t)),void(O.value=!1);const l=a.map((e=>u(e,s(t))));function r(e,t){return!i(e)||!t&&j.value&&e.requestCache||s(t)>=s(e)-1}function o(t,a,l,r){const o={lvlnr:t+1+""};return r&&a.dependKey&&k(a.dependKey,((e,t)=>{o[t]=r[e]})),{params:o,...a,key:l,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function u(a,l){return{[w.value]:a[w.value],[F.value]:a[F.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function i(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:j.value=l}(t),await B()}const V=`form-render__cascade--menu-${l(d)}`;async function B(){await n();const e=document.querySelector(`.${V} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function L(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;if(e.checkStrategy.includes("child")&&a.depth<S.value)return!1;return l.length>0&&l.some((e=>e.includes(t.trim())))}const{injectValueValidate:K,injectValueWatchFromEmpty:I,injectValueBindKey:E}=c();I((()=>e.value),q),K((()=>e.value)),r((()=>e.urlConfig),(async(t,a)=>{u(t,a)||(j.value=null,C.value?e.lazyRequest||(q(),C.value=!C.value):await q())}),{immediate:!0});const O=t(!1);function R(e){O.value=!!e,e&&q()}const W=a((()=>j.value||e.options||[])),z=a((()=>!e.filterable)),N=E(A);return()=>o(v,{key:N.value,remote:z.value,filterable:e.filterable,"menu-props":{class:V,onClick:B},"check-strategy":e.checkStrategy,show:!!O.value,"onUpdate:show":R,value:A.value,filter:L,"onUpdate:value":H,labelField:w.value,valueField:F.value,options:W.value,onLoad:q,onFocus:h(g)},f)}}),y({dataSource:"options"},j));export{g as SEARCH_CASCADER};
@@ -5,7 +5,7 @@ import { UrlConfig } from '../../types';
5
5
  import { PropType } from 'vue';
6
6
  export declare const SELECT: import("vue").DefineComponent<{
7
7
  value: {
8
- type: PropType<ArrayAble<string> | null>;
8
+ type: PropType<ArrayAble<string | number> | null>;
9
9
  };
10
10
  lazyRequest: {
11
11
  type: BooleanConstructor;
@@ -20,6 +20,14 @@ export declare const SELECT: import("vue").DefineComponent<{
20
20
  default: () => never[];
21
21
  };
22
22
  onChange: {};
23
+ labelField: {
24
+ type: StringConstructor;
25
+ default: string;
26
+ };
27
+ valueField: {
28
+ type: StringConstructor;
29
+ default: string;
30
+ };
23
31
  allowCreate: BooleanConstructor;
24
32
  urlConfig: {
25
33
  type: PropType<UrlConfig>;
@@ -58,7 +66,11 @@ export declare const SELECT: import("vue").DefineComponent<{
58
66
  getRecommendInfo: {
59
67
  type: PropType<() => RecommendIds>;
60
68
  };
61
- recommendNum: {
69
+ commonNum: {
70
+ type: NumberConstructor;
71
+ default: number;
72
+ };
73
+ recentNum: {
62
74
  type: NumberConstructor;
63
75
  default: number;
64
76
  };
@@ -68,7 +80,7 @@ export declare const SELECT: import("vue").DefineComponent<{
68
80
  };
69
81
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:value" | "postRecommend")[], "update:value" | "postRecommend", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
70
82
  value: {
71
- type: PropType<ArrayAble<string> | null>;
83
+ type: PropType<ArrayAble<string | number> | null>;
72
84
  };
73
85
  lazyRequest: {
74
86
  type: BooleanConstructor;
@@ -83,6 +95,14 @@ export declare const SELECT: import("vue").DefineComponent<{
83
95
  default: () => never[];
84
96
  };
85
97
  onChange: {};
98
+ labelField: {
99
+ type: StringConstructor;
100
+ default: string;
101
+ };
102
+ valueField: {
103
+ type: StringConstructor;
104
+ default: string;
105
+ };
86
106
  allowCreate: BooleanConstructor;
87
107
  urlConfig: {
88
108
  type: PropType<UrlConfig>;
@@ -121,7 +141,11 @@ export declare const SELECT: import("vue").DefineComponent<{
121
141
  getRecommendInfo: {
122
142
  type: PropType<() => RecommendIds>;
123
143
  };
124
- recommendNum: {
144
+ commonNum: {
145
+ type: NumberConstructor;
146
+ default: number;
147
+ };
148
+ recentNum: {
125
149
  type: NumberConstructor;
126
150
  default: number;
127
151
  };
@@ -134,10 +158,13 @@ export declare const SELECT: import("vue").DefineComponent<{
134
158
  onPostRecommend?: ((...args: any[]) => any) | undefined;
135
159
  }, {
136
160
  options: AnyObject[];
161
+ labelField: string;
162
+ valueField: string;
137
163
  lazyRequest: boolean;
138
164
  requestCache: boolean;
139
165
  recommend: boolean;
140
166
  recommendCache: boolean;
141
- recommendNum: number;
167
+ commonNum: number;
168
+ recentNum: number;
142
169
  allowCreate: boolean;
143
170
  }>;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as o,inject as t,ref as a,createVNode as r}from"vue";import{useDebounceFn as l}from"@vueuse/core";import{cloneDeep as s,isString as i}from"lodash-es";import{useCommonInjection as n,useSelectOptionProps as u}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as p}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../../index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.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"../../hooks/useFormValidator.js";import"@formily/core";import"date-fns";import"@formily/reactive";import{connect as c,mapProps as d}from"@formily/vue";import"@vue/shared";import"./index.js";import{useUrlConfigOptions as y,useAutographOptions as v,useRecommendOptions as f,searchContentMatcher as h}from"../../hooks/useFormRenderOptions.js";import{NSelect as j}from"naive-ui";import{createVisitedSetter as b,assignUpdateValue as k,assignClearBindVisited as S}from"../../utils/schema.js";const g=c(e({name:"FormSelect",props:{value:{type:[String,Array]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},allowCreate:Boolean,urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},recommendNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1}},emits:["update:value","postRecommend"],setup(e,{slots:c,emit:d}){const k=o({get:()=>e.value,async set(e){d("update:value",e),C(e)}}),{labelKey:S,valueKey:g,fetchData:A,fullOptions:F,filterOptions:H}=e.urlConfig?y(e,k):v(e,k),{getRecommend:B,postRecommend:C,sortedOptions:x}=f(e,H,d,S,g),{field:O,fieldKey:R}=m();t(p).setContext(R.value,(e=>{return{currentOption:s((o=e,F.value.find((e=>e[g.value]===o))))};var o}));const L=a(""),V=l((async(e="")=>{L.value=e,A(e),B(e)}),300),{injectValueValidate:w,injectValueWatchFromEmpty:K,injectValueBindKey:P}=n();K(k,V),w(k);const W=P(k),{menuProps:q,nodeProps:I}=u();function N(e){const o=e[S.value];if(!o||!i(o))return"";const t=h(L.value,o);return t?r("section",null,[t.map(((e,o)=>0!==o&&e?r("span",{style:{color:o%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):o}const U=o((()=>x.value.length||!e.allowCreate?x.value:L.value?[{[S.value]:L.value,[g.value]:L.value},...x.value]:x.value));return()=>r(j,{key:W.value,remote:!0,filterable:!0,value:k.value,"onUpdate:value":e=>k.value=e,"menu-props":q,"node-props":I,labelField:S.value,valueField:g.value,options:U.value,onSearch:V,"onUpdate:show":e=>e&&V(),onFocus:b(O),renderLabel:N},c)}}),d({dataSource:"options"},k,S));export{g as SELECT};
1
+ import{defineComponent as e,computed as o,inject as t,ref as a,createVNode as r}from"vue";import{useDebounceFn as l}from"@vueuse/core";import{cloneDeep as s,isArray as i,isString as n}from"lodash-es";import{useCommonInjection as u,useSelectOptionProps as p}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as m}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../../index.js";import"../../utils/index.js";import{useFormField as c}from"../../hooks/useFormField.js";import{NSelect as d}from"naive-ui";import"date-fns";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"../../hooks/useFormValidator.js";import"@formily/core";import"@formily/reactive";import{connect as y,mapProps as v}from"@formily/vue";import"@vue/shared";import"./index.js";import{useUrlConfigOptions as f,useAutographOptions as h,useRecommendOptions as j,searchContentMatcher as b}from"../../hooks/useFormRenderOptions.js";import{createVisitedSetter as k,assignUpdateValue as S,assignClearBindVisited as g}from"../../utils/schema.js";const F=y(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},allowCreate:Boolean,urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1}},emits:["update:value","postRecommend"],setup(e,{slots:y,emit:v}){const S=o({get:()=>e.value,async set(e){v("update:value",e),C(e)}}),{labelKey:g,valueKey:F,fetchData:A,fullOptions:H,filterOptions:x}=e.urlConfig?f(e,S):h(e,S),{getRecommend:B,postRecommend:C,sortedOptions:O}=j(e,x,v,g,F),{field:R,fieldKey:L}=c();t(m).setContext(L.value,(e=>{return{currentOption:s((o=e,i(o)?function(e){const o=H.value.reduce(((e,o)=>(e[o[F.value]]=o,e)),{});return e.map((e=>o[e]))}(o):(t=o,H.value.find((e=>e[F.value]===t)))))};var o,t}));const N=a(""),V=l((async(e="")=>{N.value=e,A(e),B(e)}),300),{injectValueValidate:w,injectValueWatchFromEmpty:K,injectValueBindKey:P}=u();K(S,V),w(S);const W=P(S),{menuProps:q,nodeProps:I}=p();function U(e){const o=e[g.value];if(!o||!n(o))return"";const t=b(N.value,o);return t?r("section",null,[t.map(((e,o)=>0!==o&&e?r("span",{style:{color:o%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):o}const z=o((()=>O.value.length||!e.allowCreate?O.value:N.value?[{[g.value]:N.value,[F.value]:N.value},...O.value]:O.value));return()=>r(d,{key:W.value,remote:!0,filterable:!0,value:S.value,"onUpdate:value":e=>S.value=e,"menu-props":q,"node-props":I,labelField:g.value,valueField:F.value,options:z.value,onSearch:V,"onUpdate:show":e=>e&&V(),onFocus:k(R),renderLabel:U},y)}}),v({dataSource:"options"},S,g));export{F as SELECT};
@@ -2,7 +2,7 @@ export * from './useFieldListAdaptor';
2
2
  export * from './useFormRequest';
3
3
  export * from './useCommonLog';
4
4
  export * from './useFormField';
5
- export * from './useAsyncQueue';
5
+ export * from './useFormAsyncQueue';
6
6
  export * from './useFieldVisitor';
7
7
  export * from './useFieldNormalize';
8
8
  export * from './useFormValidator';
@@ -1 +1 @@
1
- export{useFieldListAdaptor}from"./useFieldListAdaptor.js";export{useFormRequest}from"./useFormRequest.js";export{useCommonLog}from"./useCommonLog.js";export{useFormField}from"./useFormField.js";export{AsyncQueue,useAsyncQueue}from"./useAsyncQueue.js";export{useFieldVisitor}from"./useFieldVisitor.js";export{useFieldNormalize}from"./useFieldNormalize.js";export{useFormValidator,validateMessageLocale}from"./useFormValidator.js";export{BusinessCollector,useBusinessBinding}from"./useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./useChangeContext.js";export{FormItemDepsCollector,useFormItemDeps}from"./useFormItemDeps.js";export{useAnchor}from"./useAnchor.js";export{useFormContext}from"./useFormContext.js";export{useCommonInjection,useSelectOptionProps}from"./useCommonInjection.js";export{searchContentMatcher,useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./useFormRenderOptions.js";
1
+ export{useFieldListAdaptor}from"./useFieldListAdaptor.js";export{useFormRequest}from"./useFormRequest.js";export{useCommonLog}from"./useCommonLog.js";export{useFormField}from"./useFormField.js";export{useFormAsyncQueue}from"./useFormAsyncQueue.js";export{useFieldVisitor}from"./useFieldVisitor.js";export{useFieldNormalize}from"./useFieldNormalize.js";export{useFormValidator,validateMessageLocale}from"./useFormValidator.js";export{BusinessCollector,useBusinessBinding}from"./useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./useChangeContext.js";export{FormItemDepsCollector,useFormItemDeps}from"./useFormItemDeps.js";export{useAnchor}from"./useAnchor.js";export{useFormContext}from"./useFormContext.js";export{useCommonInjection,useSelectOptionProps}from"./useCommonInjection.js";export{searchContentMatcher,useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./useFormRenderOptions.js";
@@ -3,6 +3,7 @@ import { FieldItem, FormBusinessFormatter } from '../../../../../es/components/f
3
3
  import { FIELD_BUSINESS_TYPE } from '../constants';
4
4
  export declare class BusinessCollector {
5
5
  private businessFormatter?;
6
+ triggerLock: boolean;
6
7
  private readonly typeLockMap;
7
8
  private readonly typeCollector;
8
9
  private readonly fieldNameCollector;
@@ -1 +1 @@
1
- import{isField as e}from"@formily/core";import{isString as t}from"@vueuse/core";import{format as s}from"date-fns";import{isFunction as i,isNumber as r}from"lodash-es";import{FIELD_BUSINESS_TYPE as n}from"../constants/index.js";import"../utils/index.js";import{isIdCard as a,parseIdCard as l,parseAgeFromContext as o,parseBirthday as u,parseAge2Birthday as y}from"../utils/business.js";class h{constructor(e){this.businessFormatter=e,this.typeLockMap=new Map,this.typeCollector=new Map,this.fieldNameCollector=new Map,this.changeHandlerMap=new Map([])}formatter(...e){return i(this.businessFormatter)?this.businessFormatter(...e):e[0].value}collect(e,t){this.typeCollector.set(e,t),this.fieldNameCollector.set(t.val_key,e)}getField(e){return this.typeCollector.get(e)}getFieldInstanceByType(e,t){const s=this.getField(t);return s?e.query(s.val_key).take():null}getType(e){return this.fieldNameCollector.get(e)}getValueByField(t,s){const i=t.query(s).take();return e(i)?i.value:null}getValueByType(e,t){const s=this.getField(t);return s?this.getValueByField(e,s.val_key):null}setValueByType(e,t,s){const i=this.getField(t);i&&e.setFieldState(i.val_key,(e=>{if(e.value===s)return;const n=this.typeLockMap.get(t);this.typeLockMap.set(t,r(n)?n+1:1),e.value=this.formatter({value:s,type:t,fieldKey:i.val_key})}))}registerChangeBusiness(e,t){return this.changeHandlerMap.set(e,t),this}trigger(e,t,s="change"){var i;const r=this.getType(t);if(!r)return;if("change"===s&&this.typeLockMap.get(r)>0)return this.typeLockMap.set(r,this.typeLockMap.get(r)-1);const n="change"===s?this.changeHandlerMap:null;n&&(null==(i=n.get(r))||i.call(this,e))}}function c(){function e(){var e;const t=this.getField(n.BIRTHDAY);return null!=(e=null==t?void 0:t.date_format)?e:"yyyy-MM-dd HH:mm"}function i(i){const r=this.getValueByType(i,n.ID_CARD);if(!r||!t(r)||!a(r))return;const u=l(r),{age:y,ageUnit:h}=o(u);this.setValueByType(i,n.AGE_UNIT,h),this.setValueByType(i,n.AGE,y),this.setValueByType(i,n.SEX,u.sex),this.setValueByType(i,n.BIRTHDAY,s(new Date(u.birthday),e.call(this)))}function c(e){const s=this.getValueByType(e,n.BIRTHDAY);if(!t(s))return;const{age:i,ageUnit:r}=o(u(s));this.setValueByType(e,n.AGE_UNIT,r),this.setValueByType(e,n.AGE,i)}function p(s){const i=this.getValueByType(s,n.AGE),a=this.getValueByType(s,n.AGE_UNIT);(t(i)||r(i))&&""!==i&&t(a)&&""!==a&&this.setValueByType(s,n.BIRTHDAY,y(+i,a,e.call(this)))}return{create:function(e){return new h(e).registerChangeBusiness(n.ID_CARD,i).registerChangeBusiness(n.AGE_UNIT,p).registerChangeBusiness(n.AGE,p).registerChangeBusiness(n.BIRTHDAY,c)}}}export{h as BusinessCollector,c as useBusinessBinding};
1
+ import{isField as e}from"@formily/core";import{isString as t}from"@vueuse/core";import{format as s}from"date-fns";import{isFunction as i,isNumber as r}from"lodash-es";import{FIELD_BUSINESS_TYPE as n}from"../constants/index.js";import"../utils/index.js";import{isIdCard as a,parseIdCard as l,parseAgeFromContext as o,parseBirthday as u,parseAge2Birthday as y}from"../utils/business.js";class h{constructor(e){this.businessFormatter=e,this.triggerLock=!1,this.typeLockMap=new Map,this.typeCollector=new Map,this.fieldNameCollector=new Map,this.changeHandlerMap=new Map([])}formatter(...e){return i(this.businessFormatter)?this.businessFormatter(...e):e[0].value}collect(e,t){this.typeCollector.set(e,t),this.fieldNameCollector.set(t.val_key,e)}getField(e){return this.typeCollector.get(e)}getFieldInstanceByType(e,t){const s=this.getField(t);return s?e.query(s.val_key).take():null}getType(e){return this.fieldNameCollector.get(e)}getValueByField(t,s){const i=t.query(s).take();return e(i)?i.value:null}getValueByType(e,t){const s=this.getField(t);return s?this.getValueByField(e,s.val_key):null}setValueByType(e,t,s){const i=this.getField(t);i&&e.setFieldState(i.val_key,(e=>{if(e.value===s)return;const n=this.typeLockMap.get(t);this.typeLockMap.set(t,r(n)?n+1:1),e.value=this.formatter({value:s,type:t,fieldKey:i.val_key})}))}registerChangeBusiness(e,t){return this.changeHandlerMap.set(e,t),this}trigger(e,t,s="change"){var i;if(this.triggerLock)return;const r=this.getType(t);if(!r)return;if("change"===s&&this.typeLockMap.get(r)>0)return this.typeLockMap.set(r,this.typeLockMap.get(r)-1);const n="change"===s?this.changeHandlerMap:null;n&&(null==(i=n.get(r))||i.call(this,e))}}function c(){function e(){var e;const t=this.getField(n.BIRTHDAY);return null!=(e=null==t?void 0:t.date_format)?e:"yyyy-MM-dd HH:mm"}function i(i){const r=this.getValueByType(i,n.ID_CARD);if(!r||!t(r)||!a(r))return;const u=l(r),{age:y,ageUnit:h}=o(u);this.setValueByType(i,n.AGE_UNIT,h),this.setValueByType(i,n.AGE,y),this.setValueByType(i,n.SEX,u.sex),this.setValueByType(i,n.BIRTHDAY,s(new Date(u.birthday),e.call(this)))}function c(e){const s=this.getValueByType(e,n.BIRTHDAY);if(!t(s))return;const{age:i,ageUnit:r}=o(u(s));this.setValueByType(e,n.AGE_UNIT,r),this.setValueByType(e,n.AGE,i)}function g(s){const i=this.getValueByType(s,n.AGE),a=this.getValueByType(s,n.AGE_UNIT);(t(i)||r(i))&&""!==i&&t(a)&&""!==a&&this.setValueByType(s,n.BIRTHDAY,y(+i,a,e.call(this)))}return{create:function(e){return new h(e).registerChangeBusiness(n.ID_CARD,i).registerChangeBusiness(n.AGE_UNIT,g).registerChangeBusiness(n.AGE,g).registerChangeBusiness(n.BIRTHDAY,c)}}}export{h as BusinessCollector,c as useBusinessBinding};
@@ -9,11 +9,12 @@ export declare function useComplexOptions(props: {
9
9
  options: AnyObject[];
10
10
  value: unknown;
11
11
  }, emit: Func): {
12
- renderComplexOption: ({ value, option, valueKey, labelKey }: {
12
+ renderComplexOption: ({ value, option, valueKey, labelKey, childFieldStrategy }: {
13
13
  value: unknown;
14
14
  option: FormOptionItem;
15
15
  valueKey: string;
16
16
  labelKey: string;
17
+ childFieldStrategy: 'checked' | 'all';
17
18
  }) => any[];
18
19
  valueRef: import("vue").WritableComputedRef<unknown>;
19
20
  hasComplexOption: import("vue").ComputedRef<boolean>;
@@ -1 +1 @@
1
- import{reactive as e,defineComponent as t,inject as r,provide as n,computed as o,watch as l,onUnmounted as s,onMounted as a,withModifiers as i,createVNode as u,mergeProps as c}from"vue";import{checkInSetupEnv as p}from"../../../../shared/utils/index.js";import{useField as d,useForm as m,RecursionField as f}from"@formily/vue";import{noop as v,isArray as h,isNumber as y}from"lodash-es";import"../../index.js";import{InjectionFormUUID as b,InjectionBusinessCollector as j}from"../constants/index.js";import{useFieldListAdaptor as x}from"./useFieldListAdaptor.js";import{createObjSchema as g}from"../utils/schema.js";const F=e(new Map);function O(e,t,r=0){F.set(e,F.get(e)||{});F.get(e)[t+""]=r}function $(e,t,r=!0){const n=F.get(e);return n?Object.entries(n).reduce(((e,[n,o])=>r&&n===`${t}`||n.startsWith(`${t}.`)?e+o:e),0):0}function E(e,t){const r=F.get(e);r&&Reflect.deleteProperty(r,t+"")}function K(e){F.delete(e)}const P=t({props:{fieldItems:{type:Array,default:()=>[]},name:{type:String,required:!0}},setup(e){const t=r(b),p=r(j),h=d(),y=r(t+"_virtualParent",""),F=`${y?y+".":""}${h.value.address}`;function K(e){return`${F}.${e}`}n(t+"_virtualParent",F);const{schemaAdaptor:P}=x(p);function S(e){return Object.assign(e,{"x-decorator-props":{...e["x-decorator-props"],labelPlacement:"left",showFeedback:!1,showLabel:!!e.title},"x-component-props":{...e["x-component-props"],size:"small"}})}const _=o((()=>{const t=P(e.fieldItems);return Object.values(t).forEach(S),g(t)}));l(_,(()=>{return e=_.value,void Object.values(e.properties||{}).forEach((e=>{var r;O(t,K(e.name),null==(r=null==e?void 0:e["x-decorator-props"])?void 0:r.span)}));var e}),{immediate:!0});const k=m();function w(){return e.fieldItems.map((e=>k.value.query(e.val_key).take()))}s((()=>{var e;w().forEach((e=>{e&&(e.display="none")})),e=_.value,Object.values(e.properties||{}).forEach((e=>{E(t,K(e.name))}))})),a((()=>{w().forEach((e=>{e&&(e.display="visible")}))}));const I=i(v,["stop"]),A=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=I,e)),{});return()=>{return u("section",c({class:"form-render__labelField",style:{"--column":(e=_.value,Object.values(e.properties||{}).reduce(((e,r)=>e+$(t,K(r.name))),0))}},A),[u(f,{basePath:".",schema:_.value},null)]);var e}}});function S(e,t){p();const r=o((()=>e.options.some((e=>h(e.childrenFields)&&e.childrenFields.length))));function n(e,t,r="value"){if(h(e)?e.includes(t[r]):e===t[r])return h(t.childrenFields)&&t.childrenFields.length}return{renderComplexOption:function({value:e,option:t,valueKey:o="value",labelKey:l="label"}){return[t[l],r.value&&n(e,t,o)?u(P,{fieldItems:t.childrenFields,name:t[o]},null):null]},valueRef:o({get(){return t=e.value,y(t)?t+"":t;var t},set(e){t("update:value",e)}}),hasComplexOption:r}}function _(){return{getSpan:$,setSpan:O,deleteSpan:E,clearSpan:K}}export{S as useComplexOptions,_ as useComplexOptionsSpan};
1
+ import{reactive as e,defineComponent as t,inject as r,provide as n,computed as l,watch as o,onUnmounted as a,onMounted as i,withModifiers as s,createVNode as c,mergeProps as u}from"vue";import{checkInSetupEnv as d}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as f}from"@formily/vue";import{noop as v,isArray as h,isNumber as y}from"lodash-es";import"../../index.js";import{InjectionFormUUID as g,InjectionBusinessCollector as b}from"../constants/index.js";import{useFieldListAdaptor as F}from"./useFieldListAdaptor.js";import{createObjSchema as x}from"../utils/schema.js";const S=e(new Map);function j(e,t,r=0){S.set(e,S.get(e)||{});S.get(e)[t+""]=r}function O(e,t,r=!0){const n=S.get(e);return n?Object.entries(n).reduce(((e,[n,l])=>r&&n===`${t}`||n.startsWith(`${t}.`)?e+l:e),0):0}function $(e,t){const r=S.get(e);r&&Reflect.deleteProperty(r,t+"")}function k(e){S.delete(e)}const E=t({props:{fieldItems:{type:Array,default:()=>[]},childFieldStrategy:{type:String,default:"checked"},name:{type:String,required:!0}},setup(e){const t=r(g),d=r(b),h=p(),y=r(t+"_virtualParent",""),S=`${y?y+".":""}${h.value.address}`;function k(e){return`${S}.${e}`}n(t+"_virtualParent",S);const{schemaAdaptor:E}=F(d);function K(t){var r,n;return Object.assign(t,{"x-decorator-props":{...t["x-decorator-props"],labelPlacement:"left",showFeedback:!1,showLabel:!!t.title},"x-component-props":{...t["x-component-props"],childFieldStrategy:null!=(n=null==(r=t["x-component-props"])?void 0:r.childFieldStrategy)?n:e.childFieldStrategy,size:"small"}})}const P=l((()=>{const t=E(e.fieldItems);return Object.values(t).forEach(K),x(t)}));o(P,(()=>{return e=P.value,void Object.values(e.properties||{}).forEach((e=>{var r;j(t,k(e.name),null==(r=null==e?void 0:e["x-decorator-props"])?void 0:r.span)}));var e}),{immediate:!0});const _=m();function w(){return e.fieldItems.map((e=>_.value.query(e.val_key).take()))}a((()=>{var e;w().forEach((e=>{e&&(e.display="none")})),e=P.value,Object.values(e.properties||{}).forEach((e=>{$(t,k(e.name))}))})),i((()=>{w().forEach((e=>{e&&(e.display="visible")}))}));const I=s(v,["stop"]),A=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=I,e)),{});return()=>{return c("section",u({class:"form-render__labelField",style:{"--column":(e=P.value,Object.values(e.properties||{}).reduce(((e,r)=>e+O(t,k(r.name))),0))}},A),[c(f,{basePath:".",schema:P.value},null)]);var e}}});function K(e,t){d();const r=l((()=>e.options.some((e=>h(e.childrenFields)&&e.childrenFields.length))));function n(e,t,r="value"){if(h(e)?e.includes(t[r]):e===t[r])return h(t.childrenFields)&&t.childrenFields.length}return{renderComplexOption:function({value:e,option:t,valueKey:l="value",labelKey:o="label",childFieldStrategy:a}){return[t[o],r.value&&("all"===a||n(e,t,l))?c(E,{fieldItems:t.childrenFields,name:t[l],childFieldStrategy:a},null):null]},valueRef:l({get(){return t=e.value,y(t)?t+"":t;var t},set(e){t("update:value",e)}}),hasComplexOption:r}}function P(){return{getSpan:O,setSpan:j,deleteSpan:$,clearSpan:k}}export{K as useComplexOptions,P as useComplexOptionsSpan};
@@ -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 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="0"===e.multi_select;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,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}}),y=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}],["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||[]}),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)?O(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}]]),b=e=>{if(e.suffixConfig)return v(e);return(y.get(e.html_type)||h)(e)},v=o=>{if(!o.suffixConfig)return b(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:O(n)}),r},{FieldNormalizeWaterfallHook:C}=s();function O(o){let n=null;return o.reduce(((e,o,s)=>{var a;const p=null==(a=(o=C.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(b(o),s):(n=null,e[i(o)]=r(b(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:O}}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}}),y=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||[]}),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}]]),b=e=>{if(e.suffixConfig)return v(e);return(y.get(e.html_type)||h)(e)},v=o=>{if(!o.suffixConfig)return b(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(b(o),s):(n=null,e[i(o)]=r(b(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 +1 @@
1
- import{arrayed as t}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import e from"../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{FIELD_BUSINESS_TYPE as a}from"../constants/index.js";function l(){const l=new e(["fieldItem"]);l.tap("__block",(t=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(t.html_type)&&(t.__vertical=!0),t))),l.tap("__age",(e=>("AGE"===e.html_type&&(e.html_type="INPUT_NUMBER",e.reactions=e.reactions?t(e.reactions):[],e.reactions.push({target:e.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),e.suffixConfig=[{validate:{obj_type:a.AGE_UNIT},val_key:e.val_key_unit,html_type:"SELECT",option:e.option,urlConfig:e.urlConfig}]),e)));const o=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];return l.tap("__normalize",(t=>(o.some((([e,a])=>(Array.isArray(e)?e.includes(t.html_type):e===t.html_type)&&(t.html_type=a))),t))),{FieldNormalizeWaterfallHook:l}}export{l as useFieldNormalize};
1
+ import{arrayed as t}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import e from"../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{FIELD_BUSINESS_TYPE as l}from"../constants/index.js";function a(){const a=new e(["fieldItem"]);a.tap("__block",(t=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(t.html_type)&&(t.__vertical=!0),t))),a.tap("__age",(e=>("AGE"===e.html_type&&(e.html_type="INPUT_NUMBER",e.reactions=e.reactions?t(e.reactions):[],e.reactions.push({target:e.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),e.suffixConfig=[{validate:{obj_type:l.AGE_UNIT},val_key:e.val_key_unit,html_type:"SELECT",option:e.option,urlConfig:e.urlConfig}]),e))),a.tap("__multiple_select",(t=>{const{html_type:e,multi_select:l,__multiple:a}=t;return t.__multiple="SEARCH"!==e&&("SEARCH_MORE"===e||("SELECT"===e?"0"===l:a)),t}));const s=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];return a.tap("__normalize",(t=>(s.some((([e,l])=>(Array.isArray(e)?e.includes(t.html_type):e===t.html_type)&&(t.html_type=l))),t))),{FieldNormalizeWaterfallHook:a}}export{a as useFieldNormalize};
@@ -0,0 +1,16 @@
1
+ import { AsyncQueue } from '../../../../../es/shared/hooks';
2
+ import { AnyObject, UndefinedAble } from '../../../../../es/shared/types';
3
+ import { ComputedRef } from 'vue';
4
+ import { FormAsyncQueueItem } from '../types';
5
+ import { RequestInstance } from '../../../../../es/components/form-render';
6
+ declare type ProcessorOption = Partial<{
7
+ afterRequest(key: string, payload?: unknown): AnyObject[];
8
+ beforeRequest(key: string, params?: unknown): UndefinedAble<AnyObject> | void;
9
+ }>;
10
+ export declare function useFormAsyncQueue(requestInstance: ComputedRef<UndefinedAble<RequestInstance>>): {
11
+ create: (parallelism?: number, option?: ProcessorOption) => AsyncQueue<FormAsyncQueueItem, any, {
12
+ label: string;
13
+ value: unknown;
14
+ }[]>;
15
+ };
16
+ export {};
@@ -0,0 +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 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 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{useAsyncQueue as x}from"./useAsyncQueue.js";import{useBusinessBinding as g}from"./useBusinessBinding.js";import{useChangeContext as v}from"./useChangeContext.js";import{useFormItemDeps as b}from"./useFormItemDeps.js";function q(q,F){const{callLifeCycle:R}=j(q),I=C(a,(()=>x(s((()=>q.requestInstance))).create(q.parallelism,{beforeRequest:(...e)=>R("beforeRequest",r(e))||e[1],afterRequest:(...e)=>R("afterRequest",r(e))||h(e[1])}))),D=C(u,(()=>o({components:{...m,...q.components},scope:Object.assign({},y(),q.scope)}).SchemaField)),S=g().create(q.businessFormatter);n(p,S);const B=v().create();n(c,B);const L=b().create();n(l,L);const Q=q.uuid||e();return n(f,Q),n(d,s({get:()=>q.annotation?i(q.annotation):null,set(e){if(!t(q.annotation)||!t(e))return;const o=q.annotation[e.property];q.annotation[e.property]=e.value,F("annotationChange",{fieldKey:e.property,value:e.value,oldValue:o})}})),{asyncQueue:I,SchemaField:D,businessCollector:S,changeContextCollector:B,formItemDepsCollector:L,formUUID:Q}}export{q 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};
@@ -11,7 +11,7 @@ export declare function useFormExposeEvent({ formModel, formRenderRef, formUUID,
11
11
  }): {
12
12
  validate(path?: string): Promise<void>;
13
13
  getFormValues(needCombineExtendKey?: boolean): any;
14
- setFormValues(values: AnyObject, needSplitExtendKey?: boolean): void;
14
+ setFormValues(values: AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
15
15
  setFieldState(path: string, handler: (field: IFieldState) => void): void;
16
16
  resetFields(path?: string): Promise<void>;
17
17
  queryWidget(key: string): Promise<{
@@ -1 +1 @@
1
- import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isArray as s,isFunction as a}from"lodash-es";import{nextTick as m}from"vue";import"../../index.js";import{FormItemLineBarDepKeyPrepend as u,NESTED_FORM_ITEM_TYPE as f}from"../constants/index.js";import{queryDecoratorByAddress as l,queryInput as d,queryDecoratorByFieldKey as c,findNextWidget as p}from"../utils/dom.js";import{validateMessageParser as g,combineExtendKey as v,splitExtendKey as y}from"../utils/index.js";import{getParentLinebar as h}from"../utils/schema.js";function I({formModel:t,formRenderRef:n,formUUID:a,getFieldList:f,formItemDepsCollector:p}){return{validate(r="*"){return t.validate(r).catch((e=>Promise.reject(Array.isArray(e)?e.reduce(o,[]):e)));function o(t,r){if(!i(r))return t;let o=!1;return s(r.messages)&&r.messages.forEach((r=>{i(r)&&(t.push(...e(r).map(m)),o=!0)})),!o&&t.push(m(r)),t}function m(e){if(e.decoratorElement)return e;const r=t.query(e.path),o=r.get("title"),s=e.messages.map((e=>function(e,t){var r;return t&&i(t.fieldItem)?g(null!=(r=t.fieldItem.defined_error_msg)?r:e,t.fieldItem):e}(e,r.get("decoratorProps")))),m=l(e.address,n.value,a);return{...e,messages:s,title:o,decoratorElement:m,...d(m)}}},getFormValues(e=!0){let r=t.getFormState().values;return e&&(r=v(f(),r)),r},setFormValues(e,i=!0){i&&(e=y(f(),e)),t.setFieldState("*",(t=>{r(t)&&(t.value=o.getIn(e,t.path))}))},setFieldState(e,r){t.setFieldState(e,r)},resetFields:(e="*")=>t.reset(e),queryWidget:async e=>n.value?await async function(e,t,r){if(!n.value)return s();const o=c(e,t,a);if(o)return s(o);const i=h(e,r);return i?(p.trigger(u+i,!0),await m(),s(c(e,t,a))):s();function s(e){return{decoratorElement:e,...d(e)}}}(e,n.value,f()):null}}function x({props:e,formRenderRef:r,formModel:o}){return{onKeydown:function i(s){var m;if(!e.enterToNextWidget||!r.value)return;const u=t(s.target,(e=>e.classList.contains("form-render__formItem")));if(!u)return;const l=`.form-render__formItem${f.map((e=>`:not([widget-type=${e}])`)).join("")}`,d=Array.from(r.value.querySelectorAll(l)),c=d.findIndex((e=>e.id===u.id));if(!~c)return;const{widget:g,field:v}=p(d,c,s.target);if(g)if(a(e.enterToNextWidget)){const t=v&&o.query(v).take();!t||e.enterToNextWidget(null==(m=t.decoratorProps)?void 0:m.fieldItem)?y():i({target:g})}else y();async function y(){await n(0),g.focus()}}}}export{x as useFormDomEvent,I as useFormExposeEvent};
1
+ import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isArray as s,isFunction as a}from"lodash-es";import{nextTick as m}from"vue";import"../../index.js";import{FormItemLineBarDepKeyPrepend as u,NESTED_FORM_ITEM_TYPE as f}from"../constants/index.js";import{queryDecoratorByAddress as l,queryInput as d,queryDecoratorByFieldKey as c,findNextWidget as p}from"../utils/dom.js";import{validateMessageParser as g,combineExtendKey as v,splitExtendKey as y}from"../utils/index.js";import{getParentLinebar as h}from"../utils/schema.js";function I({formModel:t,formRenderRef:n,formUUID:a,getFieldList:f,formItemDepsCollector:p}){return{validate(r="*"){return t.validate(r).catch((e=>Promise.reject(Array.isArray(e)?e.reduce(o,[]):e)));function o(t,r){if(!i(r))return t;let o=!1;return s(r.messages)&&r.messages.forEach((r=>{i(r)&&(t.push(...e(r).map(m)),o=!0)})),!o&&t.push(m(r)),t}function m(e){if(e.decoratorElement)return e;const r=t.query(e.path),o=r.get("title"),s=e.messages.map((e=>function(e,t){var r;return t&&i(t.fieldItem)?g(null!=(r=t.fieldItem.defined_error_msg)?r:e,t.fieldItem):e}(e,r.get("decoratorProps")))),m=l(e.address,n.value,a);return{...e,messages:s,title:o,decoratorElement:m,...d(m)}}},getFormValues(e=!0){let r=t.getFormState().values;return e&&(r=v(f(),r)),r},setFormValues(e,i=!0,n=!0){i&&(e=y(f(),e)),t.setFieldState("*",(t=>{r(t)&&(n||o.existIn(e,t.path))&&(t.value=o.getIn(e,t.path))}))},setFieldState(e,r){t.setFieldState(e,r)},resetFields:(e="*")=>t.reset(e),queryWidget:async e=>n.value?await async function(e,t,r){if(!n.value)return s();const o=c(e,t,a);if(o)return s(o);const i=h(e,r);return i?(p.trigger(u+i,!0),await m(),s(c(e,t,a))):s();function s(e){return{decoratorElement:e,...d(e)}}}(e,n.value,f()):null}}function x({props:e,formRenderRef:r,formModel:o}){return{onKeydown:function i(s){var m;if(!e.enterToNextWidget||!r.value)return;const u=t(s.target,(e=>e.classList.contains("form-render__formItem")));if(!u)return;const l=`.form-render__formItem${f.map((e=>`:not([widget-type=${e}])`)).join("")}`,d=Array.from(r.value.querySelectorAll(l)),c=d.findIndex((e=>e.id===u.id));if(!~c)return;const{widget:g,field:v}=p(d,c,s.target);if(g)if(a(e.enterToNextWidget)){const t=v&&o.query(v).take();!t||e.enterToNextWidget(null==(m=t.decoratorProps)?void 0:m.fieldItem)?y():i({target:g})}else y();async function y(){await n(0),g.focus()}}}}export{x as useFormDomEvent,I as useFormExposeEvent};