@dazhicheng/ui 1.4.17 → 1.4.19

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 (463) hide show
  1. package/dist/components/tt-area/TtArea.vue.d.ts +0 -1
  2. package/dist/components/tt-area/index.d.ts +0 -1
  3. package/dist/components/tt-button/index.d.ts +231 -232
  4. package/dist/components/tt-button/index.vue.d.ts +132 -133
  5. package/dist/components/tt-checkbox/index.d.ts +0 -1
  6. package/dist/components/tt-checkbox/index.vue.d.ts +0 -1
  7. package/dist/components/tt-checkbox/type.d.ts +0 -1
  8. package/dist/components/tt-empty/index.d.ts +0 -1
  9. package/dist/components/tt-form/index.d.ts +8 -10
  10. package/dist/components/tt-form/src/components/ExpandableArrow.vue.d.ts +2 -5
  11. package/dist/components/tt-form/src/components/Slot.d.ts +0 -1
  12. package/dist/components/tt-form/src/components/{FormActions.vue.d.ts → formActions.vue.d.ts} +8 -15
  13. package/dist/components/tt-form/src/config.d.ts +2 -6
  14. package/dist/components/tt-form/src/form/FormControl.vue.d.ts +0 -1
  15. package/dist/components/tt-form/src/form/FormDescription.vue.d.ts +0 -1
  16. package/dist/components/tt-form/src/form/FormItem.vue.d.ts +0 -1
  17. package/dist/components/tt-form/src/form/FormLabel.vue.d.ts +0 -1
  18. package/dist/components/tt-form/src/form/FormMessage.vue.d.ts +1 -16
  19. package/dist/components/tt-form/src/form/FormMessageToolTip.vue.d.ts +8 -0
  20. package/dist/components/tt-form/src/form/FormWarnMessage.vue.d.ts +1 -2
  21. package/dist/components/tt-form/src/form/RenderContent.vue.d.ts +0 -1
  22. package/dist/components/tt-form/src/form/index.d.ts +3 -3
  23. package/dist/components/tt-form/src/form/injectionKeys.d.ts +0 -1
  24. package/dist/components/tt-form/src/form/useFormField.d.ts +1 -2
  25. package/dist/components/tt-form/src/form-render/FormField.vue.d.ts +28 -0
  26. package/dist/components/tt-form/src/form-render/FormLabel.vue.d.ts +27 -0
  27. package/dist/components/tt-form/src/form-render/context.d.ts +6 -53
  28. package/dist/components/tt-form/src/form-render/dependencies.d.ts +156 -168
  29. package/dist/components/tt-form/src/form-render/expandable.d.ts +2 -3
  30. package/dist/components/tt-form/src/form-render/form.vue.d.ts +10 -45
  31. package/dist/components/tt-form/src/form-render/helper.d.ts +2 -8
  32. package/dist/components/tt-form/src/form-render/index.d.ts +2 -3
  33. package/dist/components/tt-form/src/formApi.d.ts +71 -0
  34. package/dist/components/tt-form/src/hooks/useEmitAsProps.d.ts +0 -1
  35. package/dist/components/tt-form/src/hooks/useFormFieldBus.d.ts +2 -2
  36. package/dist/components/tt-form/src/hooks/useForwardPriorityValues.d.ts +0 -1
  37. package/dist/components/tt-form/src/hooks/useForwardProps.d.ts +0 -1
  38. package/dist/components/tt-form/src/hooks/useForwardPropsEmits.d.ts +0 -1
  39. package/dist/components/tt-form/src/shared/createContext.d.ts +0 -1
  40. package/dist/components/tt-form/src/shared/global-state.d.ts +0 -1
  41. package/dist/components/tt-form/src/shared/store.d.ts +0 -1
  42. package/dist/components/tt-form/src/shared/zod-defaults.d.ts +0 -1
  43. package/dist/components/tt-form/src/types/common.d.ts +11 -0
  44. package/dist/components/tt-form/src/types/forms.d.ts +280 -0
  45. package/dist/components/tt-form/src/types/index.d.ts +3 -0
  46. package/dist/components/tt-form/src/types/paths.d.ts +142 -0
  47. package/dist/components/tt-form/src/types/shared.d.ts +19 -0
  48. package/dist/components/tt-form/src/types.d.ts +382 -0
  49. package/dist/components/tt-form/src/useForm.d.ts +2 -0
  50. package/dist/components/tt-form/src/useForm.vue.d.ts +27 -0
  51. package/dist/components/tt-form/src/useFormContext.d.ts +12 -0
  52. package/dist/components/tt-form-adapter/component/index.d.ts +1 -2
  53. package/dist/components/tt-form-adapter/index.d.ts +1 -2
  54. package/dist/components/tt-form-item-error-tooltip/index.d.ts +8 -9
  55. package/dist/components/tt-form-item-error-tooltip/index.vue.d.ts +4 -5
  56. package/dist/components/tt-icon/index.d.ts +3 -4
  57. package/dist/components/tt-icon/index.vue.d.ts +1 -2
  58. package/dist/components/tt-image/index.d.ts +5 -6
  59. package/dist/components/tt-image/src/components/ImageViewer.d.ts +4 -5
  60. package/dist/components/tt-image/tt-image.d.ts +5 -6
  61. package/dist/components/tt-loading/index.d.ts +2 -3
  62. package/dist/components/tt-loading/src/directive.d.ts +0 -1
  63. package/dist/components/tt-loading/src/loading.vue.d.ts +2 -3
  64. package/dist/components/tt-loading/src/service.d.ts +0 -1
  65. package/dist/components/tt-loading/src/type.d.ts +0 -1
  66. package/dist/components/tt-modal/index.d.ts +104 -105
  67. package/dist/components/tt-modal/src/RenderModal.vue.d.ts +49 -50
  68. package/dist/components/tt-modal/src/components/ModalFooter.vue.d.ts +0 -1
  69. package/dist/components/tt-modal/src/components/ModalHeader.vue.d.ts +0 -1
  70. package/dist/components/tt-modal/src/components/ModalWrapper.vue.d.ts +4 -5
  71. package/dist/components/tt-modal/src/hooks/useModalRender.d.ts +24 -25
  72. package/dist/components/tt-modal/src/index.d.ts +0 -1
  73. package/dist/components/tt-modal/src/props.d.ts +0 -1
  74. package/dist/components/tt-modal/src/typing.d.ts +0 -1
  75. package/dist/components/tt-modal/src/utils/modal-api.d.ts +0 -1
  76. package/dist/components/tt-part/index.d.ts +9 -10
  77. package/dist/components/tt-part/index.vue.d.ts +3 -4
  78. package/dist/components/tt-part/type.d.ts +0 -1
  79. package/dist/components/tt-part-item/index.d.ts +3 -4
  80. package/dist/components/tt-part-item/index.vue.d.ts +1 -2
  81. package/dist/components/tt-part-item/type.d.ts +0 -1
  82. package/dist/components/tt-select/index.d.ts +0 -1
  83. package/dist/components/tt-select/src/Select.vue.d.ts +33 -34
  84. package/dist/components/tt-select/src/components/SelectTable.vue.d.ts +3 -4
  85. package/dist/components/tt-select/src/components/Table.vue.d.ts +3 -4
  86. package/dist/components/tt-select/src/const.d.ts +0 -1
  87. package/dist/components/tt-select/src/hooks/useDataSource.d.ts +0 -1
  88. package/dist/components/tt-select/src/hooks/useGrid.d.ts +0 -1
  89. package/dist/components/tt-select/src/hooks/useKeyboard.d.ts +0 -1
  90. package/dist/components/tt-select/src/hooks/usePagination.d.ts +0 -1
  91. package/dist/components/tt-select/src/hooks/useSelect.d.ts +0 -1
  92. package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +0 -1
  93. package/dist/components/tt-select/src/props.d.ts +0 -1
  94. package/dist/components/tt-select/src/types/index.d.ts +0 -1
  95. package/dist/components/tt-select/src/utils/index.d.ts +0 -1
  96. package/dist/components/tt-table/index.d.ts +0 -1
  97. package/dist/components/tt-table/src/Table.vue.d.ts +129 -157
  98. package/dist/components/tt-table/src/componentMap.d.ts +0 -1
  99. package/dist/components/tt-table/src/components/RowContext.d.ts +0 -1
  100. package/dist/components/tt-table/src/components/TableAction.vue.d.ts +0 -1
  101. package/dist/components/tt-table/src/components/TableButtons.d.ts +0 -1
  102. package/dist/components/tt-table/src/components/TableColumnModal.vue.d.ts +0 -1
  103. package/dist/components/tt-table/src/components/TableToobalTools.vue.d.ts +57 -58
  104. package/dist/components/tt-table/src/emits.d.ts +0 -1
  105. package/dist/components/tt-table/src/enum.d.ts +0 -1
  106. package/dist/components/tt-table/src/hooks/useCache.d.ts +0 -1
  107. package/dist/components/tt-table/src/hooks/useCellArea.d.ts +0 -1
  108. package/dist/components/tt-table/src/hooks/useColumns.d.ts +0 -1
  109. package/dist/components/tt-table/src/hooks/useCustomColumns.d.ts +0 -1
  110. package/dist/components/tt-table/src/hooks/useDataSource.d.ts +2 -3
  111. package/dist/components/tt-table/src/hooks/useLeftRightSlot.d.ts +92 -93
  112. package/dist/components/tt-table/src/hooks/usePagination.d.ts +0 -1
  113. package/dist/components/tt-table/src/hooks/useRowSelection.d.ts +0 -1
  114. package/dist/components/tt-table/src/hooks/useTable.d.ts +0 -1
  115. package/dist/components/tt-table/src/hooks/useTableContext.d.ts +0 -1
  116. package/dist/components/tt-table/src/hooks/useTableEvent.d.ts +0 -1
  117. package/dist/components/tt-table/src/hooks/useTableForm.d.ts +2 -2
  118. package/dist/components/tt-table/src/hooks/useTableFormEvent.d.ts +0 -1
  119. package/dist/components/tt-table/src/hooks/useTableHeight.d.ts +0 -1
  120. package/dist/components/tt-table/src/hooks/useTableRender.d.ts +1 -3
  121. package/dist/components/tt-table/src/hooks/useTableSlot.d.ts +0 -1
  122. package/dist/components/tt-table/src/props.d.ts +5 -21
  123. package/dist/components/tt-table/src/toolProps.d.ts +0 -1
  124. package/dist/components/tt-table/src/types/table.d.ts +2 -5
  125. package/dist/components/tt-table/src/types/tableAction.d.ts +0 -1
  126. package/dist/components/tt-table/src/types/tableForm.d.ts +4 -5
  127. package/dist/components/tt-table/src/types/tableTools.d.ts +0 -1
  128. package/dist/components/tt-table/src/utils/context.d.ts +0 -1
  129. package/dist/components/tt-table/src/utils/filters.d.ts +0 -1
  130. package/dist/components/tt-table/src/utils/table-api.d.ts +0 -16
  131. package/dist/components/tt-table/src/utils/table-form-api.d.ts +4 -5
  132. package/dist/components/tt-table/src/utils/vxeTable.d.ts +0 -1
  133. package/dist/components/tt-text/index.d.ts +3 -4
  134. package/dist/components/tt-text/index.vue.d.ts +1 -2
  135. package/dist/components/tt-tree-select/index.d.ts +0 -1
  136. package/dist/components/tt-tree-select/src/TtTreeSelect.vue.d.ts +0 -1
  137. package/dist/components/tt-tree-select/src/cache-options.d.ts +1 -2
  138. package/dist/components/tt-tree-select/src/select.d.ts +0 -1
  139. package/dist/components/tt-tree-select/src/tree.d.ts +0 -1
  140. package/dist/components/tt-tree-select/src/utils.d.ts +0 -1
  141. package/dist/components/tt-validate/index.d.ts +0 -1
  142. package/dist/components/tt-validate/src/ErrorMessage.d.ts +0 -1
  143. package/dist/components/tt-validate/src/Field.d.ts +7 -8
  144. package/dist/components/tt-validate/src/FieldArray.d.ts +0 -1
  145. package/dist/components/tt-validate/src/Form.d.ts +3 -4
  146. package/dist/components/tt-validate/src/config.d.ts +0 -1
  147. package/dist/components/tt-validate/src/defineRule.d.ts +0 -1
  148. package/dist/components/tt-validate/src/index.d.ts +0 -1
  149. package/dist/components/tt-validate/src/symbols.d.ts +0 -1
  150. package/dist/components/tt-validate/src/types/common.d.ts +0 -1
  151. package/dist/components/tt-validate/src/types/forms.d.ts +0 -1
  152. package/dist/components/tt-validate/src/types/index.d.ts +0 -1
  153. package/dist/components/tt-validate/src/types/paths.d.ts +0 -1
  154. package/dist/components/tt-validate/src/types/shared.d.ts +0 -1
  155. package/dist/components/tt-validate/src/useField.d.ts +0 -1
  156. package/dist/components/tt-validate/src/useFieldArray.d.ts +0 -1
  157. package/dist/components/tt-validate/src/useFieldError.d.ts +0 -1
  158. package/dist/components/tt-validate/src/useFieldState.d.ts +0 -1
  159. package/dist/components/tt-validate/src/useFieldValue.d.ts +0 -1
  160. package/dist/components/tt-validate/src/useForm.d.ts +0 -1
  161. package/dist/components/tt-validate/src/useFormErrors.d.ts +0 -1
  162. package/dist/components/tt-validate/src/useFormValues.d.ts +0 -1
  163. package/dist/components/tt-validate/src/useIsFieldDirty.d.ts +0 -1
  164. package/dist/components/tt-validate/src/useIsFieldTouched.d.ts +0 -1
  165. package/dist/components/tt-validate/src/useIsFieldValid.d.ts +0 -1
  166. package/dist/components/tt-validate/src/useIsFormDirty.d.ts +0 -1
  167. package/dist/components/tt-validate/src/useIsFormTouched.d.ts +0 -1
  168. package/dist/components/tt-validate/src/useIsFormValid.d.ts +0 -1
  169. package/dist/components/tt-validate/src/useIsSubmitting.d.ts +0 -1
  170. package/dist/components/tt-validate/src/useIsValidating.d.ts +0 -1
  171. package/dist/components/tt-validate/src/useResetForm.d.ts +0 -1
  172. package/dist/components/tt-validate/src/useSetFieldError.d.ts +0 -1
  173. package/dist/components/tt-validate/src/useSetFieldTouched.d.ts +0 -1
  174. package/dist/components/tt-validate/src/useSetFieldValue.d.ts +0 -1
  175. package/dist/components/tt-validate/src/useSetFormErrors.d.ts +0 -1
  176. package/dist/components/tt-validate/src/useSetFormTouched.d.ts +0 -1
  177. package/dist/components/tt-validate/src/useSetFormValues.d.ts +0 -1
  178. package/dist/components/tt-validate/src/useSubmitCount.d.ts +0 -1
  179. package/dist/components/tt-validate/src/useSubmitForm.d.ts +0 -1
  180. package/dist/components/tt-validate/src/useValidateField.d.ts +0 -1
  181. package/dist/components/tt-validate/src/useValidateForm.d.ts +0 -1
  182. package/dist/components/tt-validate/src/utils/assertions.d.ts +0 -1
  183. package/dist/components/tt-validate/src/utils/common.d.ts +0 -1
  184. package/dist/components/tt-validate/src/utils/events.d.ts +0 -1
  185. package/dist/components/tt-validate/src/utils/index.d.ts +0 -1
  186. package/dist/components/tt-validate/src/utils/rules.d.ts +0 -1
  187. package/dist/components/tt-validate/src/utils/shared.d.ts +0 -1
  188. package/dist/components/tt-validate/src/utils/vnode.d.ts +0 -1
  189. package/dist/components/tt-validate/src/validate.d.ts +0 -1
  190. package/dist/components/tt-validate/zod/index.d.ts +0 -1
  191. package/dist/components/types.d.ts +10 -10
  192. package/dist/directives/auto-tip/index.d.ts +0 -1
  193. package/dist/directives/dialog-resize/index.d.ts +0 -1
  194. package/dist/directives/dialog-resize/use-css-variable.d.ts +0 -1
  195. package/dist/directives/dialog-resize/use-draggable.d.ts +0 -1
  196. package/dist/directives/dialog-resize/use-fullscreen.d.ts +0 -1
  197. package/dist/directives/dialog-resize/use-parse-translate.d.ts +0 -1
  198. package/dist/directives/dialog-resize/use-resizer.d.ts +0 -1
  199. package/dist/directives/disabled-tip/index.d.ts +0 -1
  200. package/dist/directives/index.d.ts +0 -1
  201. package/dist/hooks/useFormat.d.ts +0 -1
  202. package/dist/hooks/useLoading.d.ts +0 -1
  203. package/dist/hooks/useSetup.d.ts +0 -1
  204. package/dist/hooks/useTable.d.ts +0 -1
  205. package/dist/hooks/useTemplateSlot.d.ts +0 -1
  206. package/dist/index.d.ts +15 -8
  207. package/dist/index.js +33045 -32
  208. package/dist/style.css +1 -1
  209. package/package.json +8 -5
  210. package/dist/components/tt-area/TtArea.vue.d.ts.map +0 -1
  211. package/dist/components/tt-area/index.d.ts.map +0 -1
  212. package/dist/components/tt-button/index.d.ts.map +0 -1
  213. package/dist/components/tt-button/index.vue.d.ts.map +0 -1
  214. package/dist/components/tt-checkbox/index.d.ts.map +0 -1
  215. package/dist/components/tt-checkbox/index.vue.d.ts.map +0 -1
  216. package/dist/components/tt-checkbox/type.d.ts.map +0 -1
  217. package/dist/components/tt-empty/index.d.ts.map +0 -1
  218. package/dist/components/tt-form/index.d.ts.map +0 -1
  219. package/dist/components/tt-form/src/compare.d.ts +0 -15
  220. package/dist/components/tt-form/src/compare.d.ts.map +0 -1
  221. package/dist/components/tt-form/src/components/ExpandableArrow.vue.d.ts.map +0 -1
  222. package/dist/components/tt-form/src/components/FormActions.vue.d.ts.map +0 -1
  223. package/dist/components/tt-form/src/components/FormFilter.vue.d.ts +0 -23
  224. package/dist/components/tt-form/src/components/FormFilter.vue.d.ts.map +0 -1
  225. package/dist/components/tt-form/src/components/Slot.d.ts.map +0 -1
  226. package/dist/components/tt-form/src/config.d.ts.map +0 -1
  227. package/dist/components/tt-form/src/form/FormControl.vue.d.ts.map +0 -1
  228. package/dist/components/tt-form/src/form/FormDescription.vue.d.ts.map +0 -1
  229. package/dist/components/tt-form/src/form/FormItem.vue.d.ts.map +0 -1
  230. package/dist/components/tt-form/src/form/FormLabel.vue.d.ts.map +0 -1
  231. package/dist/components/tt-form/src/form/FormMessage.vue.d.ts.map +0 -1
  232. package/dist/components/tt-form/src/form/FormWarnMessage.vue.d.ts.map +0 -1
  233. package/dist/components/tt-form/src/form/RenderContent.vue.d.ts.map +0 -1
  234. package/dist/components/tt-form/src/form/index.d.ts.map +0 -1
  235. package/dist/components/tt-form/src/form/injectionKeys.d.ts.map +0 -1
  236. package/dist/components/tt-form/src/form/useFormField.d.ts.map +0 -1
  237. package/dist/components/tt-form/src/form-api.d.ts +0 -163
  238. package/dist/components/tt-form/src/form-api.d.ts.map +0 -1
  239. package/dist/components/tt-form/src/form-render/context.d.ts.map +0 -1
  240. package/dist/components/tt-form/src/form-render/dependencies.d.ts.map +0 -1
  241. package/dist/components/tt-form/src/form-render/expandable.d.ts.map +0 -1
  242. package/dist/components/tt-form/src/form-render/form-field.vue.d.ts +0 -33
  243. package/dist/components/tt-form/src/form-render/form-field.vue.d.ts.map +0 -1
  244. package/dist/components/tt-form/src/form-render/form-label.vue.d.ts +0 -44
  245. package/dist/components/tt-form/src/form-render/form-label.vue.d.ts.map +0 -1
  246. package/dist/components/tt-form/src/form-render/form.vue.d.ts.map +0 -1
  247. package/dist/components/tt-form/src/form-render/helper.d.ts.map +0 -1
  248. package/dist/components/tt-form/src/form-render/index.d.ts.map +0 -1
  249. package/dist/components/tt-form/src/hooks/useEmitAsProps.d.ts.map +0 -1
  250. package/dist/components/tt-form/src/hooks/useFormFieldBus.d.ts.map +0 -1
  251. package/dist/components/tt-form/src/hooks/useForwardPriorityValues.d.ts.map +0 -1
  252. package/dist/components/tt-form/src/hooks/useForwardProps.d.ts.map +0 -1
  253. package/dist/components/tt-form/src/hooks/useForwardPropsEmits.d.ts.map +0 -1
  254. package/dist/components/tt-form/src/index.vue.d.ts +0 -344
  255. package/dist/components/tt-form/src/index.vue.d.ts.map +0 -1
  256. package/dist/components/tt-form/src/shared/createContext.d.ts.map +0 -1
  257. package/dist/components/tt-form/src/shared/global-state.d.ts.map +0 -1
  258. package/dist/components/tt-form/src/shared/store.d.ts.map +0 -1
  259. package/dist/components/tt-form/src/shared/zod-defaults.d.ts.map +0 -1
  260. package/dist/components/tt-form/src/types/types.d.ts +0 -503
  261. package/dist/components/tt-form/src/types/types.d.ts.map +0 -1
  262. package/dist/components/tt-form/src/use-form-context.d.ts +0 -41
  263. package/dist/components/tt-form/src/use-form-context.d.ts.map +0 -1
  264. package/dist/components/tt-form/src/use-form-v2.d.ts +0 -19
  265. package/dist/components/tt-form/src/use-form-v2.d.ts.map +0 -1
  266. package/dist/components/tt-form-adapter/component/index.d.ts.map +0 -1
  267. package/dist/components/tt-form-adapter/index.d.ts.map +0 -1
  268. package/dist/components/tt-form-item-error-tooltip/index.d.ts.map +0 -1
  269. package/dist/components/tt-form-item-error-tooltip/index.vue.d.ts.map +0 -1
  270. package/dist/components/tt-icon/index.d.ts.map +0 -1
  271. package/dist/components/tt-icon/index.vue.d.ts.map +0 -1
  272. package/dist/components/tt-image/index.d.ts.map +0 -1
  273. package/dist/components/tt-image/src/components/ImageViewer.d.ts.map +0 -1
  274. package/dist/components/tt-image/tt-image.d.ts.map +0 -1
  275. package/dist/components/tt-loading/index.d.ts.map +0 -1
  276. package/dist/components/tt-loading/src/directive.d.ts.map +0 -1
  277. package/dist/components/tt-loading/src/loading.vue.d.ts.map +0 -1
  278. package/dist/components/tt-loading/src/service.d.ts.map +0 -1
  279. package/dist/components/tt-loading/src/type.d.ts.map +0 -1
  280. package/dist/components/tt-modal/index.d.ts.map +0 -1
  281. package/dist/components/tt-modal/src/RenderModal.vue.d.ts.map +0 -1
  282. package/dist/components/tt-modal/src/components/ModalFooter.vue.d.ts.map +0 -1
  283. package/dist/components/tt-modal/src/components/ModalHeader.vue.d.ts.map +0 -1
  284. package/dist/components/tt-modal/src/components/ModalWrapper.vue.d.ts.map +0 -1
  285. package/dist/components/tt-modal/src/hooks/useModalRender.d.ts.map +0 -1
  286. package/dist/components/tt-modal/src/index.d.ts.map +0 -1
  287. package/dist/components/tt-modal/src/props.d.ts.map +0 -1
  288. package/dist/components/tt-modal/src/typing.d.ts.map +0 -1
  289. package/dist/components/tt-modal/src/utils/modal-api.d.ts.map +0 -1
  290. package/dist/components/tt-part/index.d.ts.map +0 -1
  291. package/dist/components/tt-part/index.vue.d.ts.map +0 -1
  292. package/dist/components/tt-part/type.d.ts.map +0 -1
  293. package/dist/components/tt-part-item/index.d.ts.map +0 -1
  294. package/dist/components/tt-part-item/index.vue.d.ts.map +0 -1
  295. package/dist/components/tt-part-item/type.d.ts.map +0 -1
  296. package/dist/components/tt-select/index.d.ts.map +0 -1
  297. package/dist/components/tt-select/src/Select.vue.d.ts.map +0 -1
  298. package/dist/components/tt-select/src/components/SelectTable.vue.d.ts.map +0 -1
  299. package/dist/components/tt-select/src/components/Table.vue.d.ts.map +0 -1
  300. package/dist/components/tt-select/src/const.d.ts.map +0 -1
  301. package/dist/components/tt-select/src/hooks/useDataSource.d.ts.map +0 -1
  302. package/dist/components/tt-select/src/hooks/useGrid.d.ts.map +0 -1
  303. package/dist/components/tt-select/src/hooks/useKeyboard.d.ts.map +0 -1
  304. package/dist/components/tt-select/src/hooks/usePagination.d.ts.map +0 -1
  305. package/dist/components/tt-select/src/hooks/useSelect.d.ts.map +0 -1
  306. package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts.map +0 -1
  307. package/dist/components/tt-select/src/props.d.ts.map +0 -1
  308. package/dist/components/tt-select/src/types/index.d.ts.map +0 -1
  309. package/dist/components/tt-select/src/utils/index.d.ts.map +0 -1
  310. package/dist/components/tt-table/index.d.ts.map +0 -1
  311. package/dist/components/tt-table/src/Table.vue.d.ts.map +0 -1
  312. package/dist/components/tt-table/src/componentMap.d.ts.map +0 -1
  313. package/dist/components/tt-table/src/components/RowContext.d.ts.map +0 -1
  314. package/dist/components/tt-table/src/components/TableAction.vue.d.ts.map +0 -1
  315. package/dist/components/tt-table/src/components/TableButtons.d.ts.map +0 -1
  316. package/dist/components/tt-table/src/components/TableColumnModal.vue.d.ts.map +0 -1
  317. package/dist/components/tt-table/src/components/TableToobalTools.vue.d.ts.map +0 -1
  318. package/dist/components/tt-table/src/emits.d.ts.map +0 -1
  319. package/dist/components/tt-table/src/enum.d.ts.map +0 -1
  320. package/dist/components/tt-table/src/hooks/useCache.d.ts.map +0 -1
  321. package/dist/components/tt-table/src/hooks/useCellArea.d.ts.map +0 -1
  322. package/dist/components/tt-table/src/hooks/useColumns.d.ts.map +0 -1
  323. package/dist/components/tt-table/src/hooks/useCustomColumns.d.ts.map +0 -1
  324. package/dist/components/tt-table/src/hooks/useDataSource.d.ts.map +0 -1
  325. package/dist/components/tt-table/src/hooks/useLeftRightSlot.d.ts.map +0 -1
  326. package/dist/components/tt-table/src/hooks/usePagination.d.ts.map +0 -1
  327. package/dist/components/tt-table/src/hooks/useRowSelection.d.ts.map +0 -1
  328. package/dist/components/tt-table/src/hooks/useTable.d.ts.map +0 -1
  329. package/dist/components/tt-table/src/hooks/useTableContext.d.ts.map +0 -1
  330. package/dist/components/tt-table/src/hooks/useTableEvent.d.ts.map +0 -1
  331. package/dist/components/tt-table/src/hooks/useTableForm.d.ts.map +0 -1
  332. package/dist/components/tt-table/src/hooks/useTableFormEvent.d.ts.map +0 -1
  333. package/dist/components/tt-table/src/hooks/useTableHeight.d.ts.map +0 -1
  334. package/dist/components/tt-table/src/hooks/useTableRender.d.ts.map +0 -1
  335. package/dist/components/tt-table/src/hooks/useTableSlot.d.ts.map +0 -1
  336. package/dist/components/tt-table/src/props.d.ts.map +0 -1
  337. package/dist/components/tt-table/src/toolProps.d.ts.map +0 -1
  338. package/dist/components/tt-table/src/types/table.d.ts.map +0 -1
  339. package/dist/components/tt-table/src/types/tableAction.d.ts.map +0 -1
  340. package/dist/components/tt-table/src/types/tableForm.d.ts.map +0 -1
  341. package/dist/components/tt-table/src/types/tableTools.d.ts.map +0 -1
  342. package/dist/components/tt-table/src/utils/context.d.ts.map +0 -1
  343. package/dist/components/tt-table/src/utils/filters.d.ts.map +0 -1
  344. package/dist/components/tt-table/src/utils/table-api.d.ts.map +0 -1
  345. package/dist/components/tt-table/src/utils/table-form-api.d.ts.map +0 -1
  346. package/dist/components/tt-table/src/utils/vxeTable.d.ts.map +0 -1
  347. package/dist/components/tt-text/index.d.ts.map +0 -1
  348. package/dist/components/tt-text/index.vue.d.ts.map +0 -1
  349. package/dist/components/tt-tree-select/index.d.ts.map +0 -1
  350. package/dist/components/tt-tree-select/src/TtTreeSelect.vue.d.ts.map +0 -1
  351. package/dist/components/tt-tree-select/src/cache-options.d.ts.map +0 -1
  352. package/dist/components/tt-tree-select/src/select.d.ts.map +0 -1
  353. package/dist/components/tt-tree-select/src/tree.d.ts.map +0 -1
  354. package/dist/components/tt-tree-select/src/utils.d.ts.map +0 -1
  355. package/dist/components/tt-validate/index.d.ts.map +0 -1
  356. package/dist/components/tt-validate/src/ErrorMessage.d.ts.map +0 -1
  357. package/dist/components/tt-validate/src/Field.d.ts.map +0 -1
  358. package/dist/components/tt-validate/src/FieldArray.d.ts.map +0 -1
  359. package/dist/components/tt-validate/src/Form.d.ts.map +0 -1
  360. package/dist/components/tt-validate/src/config.d.ts.map +0 -1
  361. package/dist/components/tt-validate/src/defineRule.d.ts.map +0 -1
  362. package/dist/components/tt-validate/src/index.d.ts.map +0 -1
  363. package/dist/components/tt-validate/src/symbols.d.ts.map +0 -1
  364. package/dist/components/tt-validate/src/types/common.d.ts.map +0 -1
  365. package/dist/components/tt-validate/src/types/forms.d.ts.map +0 -1
  366. package/dist/components/tt-validate/src/types/index.d.ts.map +0 -1
  367. package/dist/components/tt-validate/src/types/paths.d.ts.map +0 -1
  368. package/dist/components/tt-validate/src/types/shared.d.ts.map +0 -1
  369. package/dist/components/tt-validate/src/useField.d.ts.map +0 -1
  370. package/dist/components/tt-validate/src/useFieldArray.d.ts.map +0 -1
  371. package/dist/components/tt-validate/src/useFieldError.d.ts.map +0 -1
  372. package/dist/components/tt-validate/src/useFieldState.d.ts.map +0 -1
  373. package/dist/components/tt-validate/src/useFieldValue.d.ts.map +0 -1
  374. package/dist/components/tt-validate/src/useForm.d.ts.map +0 -1
  375. package/dist/components/tt-validate/src/useFormErrors.d.ts.map +0 -1
  376. package/dist/components/tt-validate/src/useFormValues.d.ts.map +0 -1
  377. package/dist/components/tt-validate/src/useIsFieldDirty.d.ts.map +0 -1
  378. package/dist/components/tt-validate/src/useIsFieldTouched.d.ts.map +0 -1
  379. package/dist/components/tt-validate/src/useIsFieldValid.d.ts.map +0 -1
  380. package/dist/components/tt-validate/src/useIsFormDirty.d.ts.map +0 -1
  381. package/dist/components/tt-validate/src/useIsFormTouched.d.ts.map +0 -1
  382. package/dist/components/tt-validate/src/useIsFormValid.d.ts.map +0 -1
  383. package/dist/components/tt-validate/src/useIsSubmitting.d.ts.map +0 -1
  384. package/dist/components/tt-validate/src/useIsValidating.d.ts.map +0 -1
  385. package/dist/components/tt-validate/src/useResetForm.d.ts.map +0 -1
  386. package/dist/components/tt-validate/src/useSetFieldError.d.ts.map +0 -1
  387. package/dist/components/tt-validate/src/useSetFieldTouched.d.ts.map +0 -1
  388. package/dist/components/tt-validate/src/useSetFieldValue.d.ts.map +0 -1
  389. package/dist/components/tt-validate/src/useSetFormErrors.d.ts.map +0 -1
  390. package/dist/components/tt-validate/src/useSetFormTouched.d.ts.map +0 -1
  391. package/dist/components/tt-validate/src/useSetFormValues.d.ts.map +0 -1
  392. package/dist/components/tt-validate/src/useSubmitCount.d.ts.map +0 -1
  393. package/dist/components/tt-validate/src/useSubmitForm.d.ts.map +0 -1
  394. package/dist/components/tt-validate/src/useValidateField.d.ts.map +0 -1
  395. package/dist/components/tt-validate/src/useValidateForm.d.ts.map +0 -1
  396. package/dist/components/tt-validate/src/utils/assertions.d.ts.map +0 -1
  397. package/dist/components/tt-validate/src/utils/common.d.ts.map +0 -1
  398. package/dist/components/tt-validate/src/utils/events.d.ts.map +0 -1
  399. package/dist/components/tt-validate/src/utils/index.d.ts.map +0 -1
  400. package/dist/components/tt-validate/src/utils/rules.d.ts.map +0 -1
  401. package/dist/components/tt-validate/src/utils/shared.d.ts.map +0 -1
  402. package/dist/components/tt-validate/src/utils/vnode.d.ts.map +0 -1
  403. package/dist/components/tt-validate/src/validate.d.ts.map +0 -1
  404. package/dist/components/tt-validate/zod/index.d.ts.map +0 -1
  405. package/dist/components/types.d.ts.map +0 -1
  406. package/dist/css-B-NBzuuu.js +0 -1
  407. package/dist/css-B2XtZxnv.js +0 -2
  408. package/dist/css-BizbCFH3.js +0 -4
  409. package/dist/css-ByWw4KN5.js +0 -2
  410. package/dist/css-CIkg43yy.js +0 -1
  411. package/dist/css-COykwHo1.js +0 -2
  412. package/dist/css-Cgfo87Gs.js +0 -1
  413. package/dist/css-Chse_8b2.js +0 -3
  414. package/dist/css-CvjpN3r9.js +0 -1
  415. package/dist/css-D8FPIJO1.js +0 -1
  416. package/dist/css-DGumj5iO.js +0 -1
  417. package/dist/css-DLZxzZoB.js +0 -1
  418. package/dist/css-Dd6Nw96X.js +0 -1
  419. package/dist/css-DhJ-Bn4t.js +0 -4
  420. package/dist/css-sQ8IZeHP.js +0 -4
  421. package/dist/directives/auto-tip/index.d.ts.map +0 -1
  422. package/dist/directives/dialog-resize/index.d.ts.map +0 -1
  423. package/dist/directives/dialog-resize/use-css-variable.d.ts.map +0 -1
  424. package/dist/directives/dialog-resize/use-draggable.d.ts.map +0 -1
  425. package/dist/directives/dialog-resize/use-fullscreen.d.ts.map +0 -1
  426. package/dist/directives/dialog-resize/use-parse-translate.d.ts.map +0 -1
  427. package/dist/directives/dialog-resize/use-resizer.d.ts.map +0 -1
  428. package/dist/directives/disabled-tip/index.d.ts.map +0 -1
  429. package/dist/directives/index.d.ts.map +0 -1
  430. package/dist/event-BpZD5QYv.js +0 -52
  431. package/dist/hooks/useFormat.d.ts.map +0 -1
  432. package/dist/hooks/useLoading.d.ts.map +0 -1
  433. package/dist/hooks/useSetup.d.ts.map +0 -1
  434. package/dist/hooks/useTable.d.ts.map +0 -1
  435. package/dist/hooks/useTemplateSlot.d.ts.map +0 -1
  436. package/dist/icon-C8mOBgGn.js +0 -15
  437. package/dist/index-Ay_e-Mu_.js +0 -658
  438. package/dist/index-BQ2KedE7.js +0 -392
  439. package/dist/index-BQfVaV7A.js +0 -216
  440. package/dist/index-BR3sT_rT.js +0 -334
  441. package/dist/index-BY-Xyp5q.js +0 -832
  442. package/dist/index-BiA7AsUl.js +0 -22
  443. package/dist/index-BsKcOBVC.js +0 -1273
  444. package/dist/index-By3DWh_m.js +0 -3559
  445. package/dist/index-CDw4vJ_J.js +0 -432
  446. package/dist/index-CQEli-Vx.js +0 -27
  447. package/dist/index-D1S5IgHw.js +0 -2502
  448. package/dist/index-DARbDgFW.js +0 -909
  449. package/dist/index-DftzFo8M.js +0 -46
  450. package/dist/index-DtD9KW7p.js +0 -436
  451. package/dist/index-HEvFEYVF.js +0 -32433
  452. package/dist/index-iDdpdLyC.js +0 -84
  453. package/dist/index-kCYWgqco.js +0 -3471
  454. package/dist/index-qhJRQdTJ.js +0 -21
  455. package/dist/index-tQY6pN96.js +0 -90
  456. package/dist/index-zMyxrv4a.js +0 -408
  457. package/dist/index.d.ts.map +0 -1
  458. package/dist/panel-time-pick.vue2-3mXww5KZ.js +0 -1603
  459. package/dist/typescript-BpuhIBuJ.js +0 -4
  460. package/dist/use-form-common-props-Co2xJKSS.js +0 -98
  461. package/dist/use-form-item-BHXTK2Pf.js +0 -71
  462. package/dist/useProps-m8gnZipa.js +0 -215
  463. package/dist/util-BFu351R4.js +0 -2259
@@ -1,3559 +0,0 @@
1
- import { isVNode as st, inject as ce, computed as w, getCurrentInstance as we, toRaw as ll, watch as P, defineComponent as oe, unref as at, toRefs as Ye, reactive as he, onBeforeUnmount as Dt, nextTick as q, withDirectives as Ee, createElementBlock as M, openBlock as D, withModifiers as ne, normalizeClass as K, renderSlot as j, createElementVNode as F, toDisplayString as ie, vShow as Me, ref as V, onMounted as Oe, normalizeStyle as Ve, createCommentVNode as z, useSlots as ol, watchEffect as sl, provide as Se, resolveComponent as X, resolveDirective as al, mergeProps as it, toHandlerKey as il, createVNode as re, withCtx as H, createBlock as W, Fragment as Ne, renderList as Ie, createTextVNode as Xt, resolveDynamicComponent as je, Transition as rl, toHandlers as dl, onUpdated as an, useAttrs as ul, h as qe } from "vue";
2
- import { castArray as pe, get as $e, isEqual as ve, isNil as Ue, findLastIndex as cl, clamp as fl, pick as ut } from "lodash-es";
3
- import { _ as Be, b as hl, u as pl, a as xt, E as vl, c as gl } from "./util-BFu351R4.js";
4
- import { s as yl, E as ml } from "./index-DtD9KW7p.js";
5
- import { B as bl, M as Cl, d as Nl, t as _t, E as kl, a as El, u as Sl } from "./useProps-m8gnZipa.js";
6
- import { E as rn, r as mt, b as wl } from "./index-iDdpdLyC.js";
7
- import { b as ft, t as Ol, j as Dl, d as bt, h as dn, p as un, g as ae, e as Kl, a as _, u as Tl, w as Qe, o as cn, l as Ct, n as en, k as Il, c as $l } from "./use-form-common-props-Co2xJKSS.js";
8
- import { a as Q, o as de, G as fn, d as le, i as ue, F as Vl, U as se, C as hn, g as Kt, e as Ll, c as Ml, r as Nt, N as Bl, l as Pl, H as Al } from "./index-HEvFEYVF.js";
9
- import { b as pn, u as Rl, a as Hl } from "./use-form-item-BHXTK2Pf.js";
10
- import { isClient as Tt, useResizeObserver as Te, isIOS as tn, useDebounceFn as Fl, useMutationObserver as zl, useEventListener as vn } from "@vueuse/core";
11
- import { u as gn } from "./index-BQfVaV7A.js";
12
- import { b as Wl, u as jl } from "./index-tQY6pN96.js";
13
- import { V as ql, i as kt } from "./icon-C8mOBgGn.js";
14
- import { g as ct, E as A } from "./event-BpZD5QYv.js";
15
- import { u as Ul } from "./index-BiA7AsUl.js";
16
- import { C as Gl } from "./index-DftzFo8M.js";
17
- import { ElCheckbox as Yl } from "./index-Ay_e-Mu_.js";
18
- function Ql(e, t) {
19
- if (!Tt) return;
20
- if (!t) {
21
- e.scrollTop = 0;
22
- return;
23
- }
24
- const l = [];
25
- let o = t.offsetParent;
26
- for (; o !== null && e !== o && e.contains(o); )
27
- l.push(o), o = o.offsetParent;
28
- const n = t.offsetTop + l.reduce((f, h) => f + h.offsetTop, 0), i = n + t.offsetHeight, r = e.scrollTop, s = r + e.clientHeight;
29
- n < r ? e.scrollTop = n : i > s && (e.scrollTop = i - e.clientHeight);
30
- }
31
- const ze = (e) => {
32
- const t = Q(e) ? e : [e], l = [];
33
- return t.forEach((o) => {
34
- var n;
35
- Q(o) ? l.push(...ze(o)) : st(o) && ((n = o.component) != null && n.subTree) ? l.push(o, ...ze(o.component.subTree)) : st(o) && Q(o.children) ? l.push(...ze(o.children)) : st(o) && o.shapeFlag === 2 ? l.push(...ze(o.type())) : l.push(o);
36
- }), l;
37
- }, yn = /* @__PURE__ */ Symbol("ElSelectGroup"), Je = /* @__PURE__ */ Symbol("ElSelect"), Et = "ElOption", Jl = ft({
38
- /**
39
- * @description value of option
40
- */
41
- value: {
42
- type: [String, Number, Boolean, Object],
43
- required: !0
44
- },
45
- /**
46
- * @description label of option, same as `value` if omitted
47
- */
48
- label: {
49
- type: [String, Number]
50
- },
51
- created: Boolean,
52
- /**
53
- * @description whether option is disabled
54
- */
55
- disabled: Boolean
56
- });
57
- function Zl(e, t) {
58
- const l = ce(Je);
59
- l || Ol(Et, "usage: <el-select><el-option /></el-select/>");
60
- const o = ce(yn, { disabled: !1 }), n = w(() => c(pe(l.props.modelValue), e.value)), i = w(() => {
61
- var u;
62
- if (l.props.multiple) {
63
- const g = pe((u = l.props.modelValue) != null ? u : []);
64
- return !n.value && g.length >= l.props.multipleLimit && l.props.multipleLimit > 0;
65
- } else
66
- return !1;
67
- }), r = w(() => {
68
- var u;
69
- return (u = e.label) != null ? u : de(e.value) ? "" : e.value;
70
- }), s = w(() => e.value || e.label || ""), f = w(() => e.disabled || t.groupDisabled || i.value), h = we(), c = (u = [], g) => {
71
- if (de(e.value)) {
72
- const y = l.props.valueKey;
73
- return u && u.some((p) => ll($e(p, y)) === $e(g, y));
74
- } else
75
- return u && u.includes(g);
76
- }, m = () => {
77
- f.value || (l.states.hoveringIndex = l.optionsArray.indexOf(h.proxy));
78
- }, d = (u) => {
79
- const g = new RegExp(fn(u), "i");
80
- t.visible = g.test(String(r.value)) || e.created;
81
- };
82
- return P(
83
- () => r.value,
84
- () => {
85
- !e.created && !l.props.remote && l.setSelected();
86
- }
87
- ), P(
88
- () => e.value,
89
- (u, g) => {
90
- const { remote: y, valueKey: p } = l.props;
91
- if ((y ? u !== g : !ve(u, g)) && (l.onOptionDestroy(g, h.proxy), l.onOptionCreate(h.proxy)), !e.created && !y) {
92
- if (p && de(u) && de(g) && u[p] === g[p])
93
- return;
94
- l.setSelected();
95
- }
96
- }
97
- ), P(
98
- () => o.disabled,
99
- () => {
100
- t.groupDisabled = o.disabled;
101
- },
102
- { immediate: !0 }
103
- ), {
104
- select: l,
105
- currentLabel: r,
106
- currentValue: s,
107
- itemSelected: n,
108
- isDisabled: f,
109
- hoverItem: m,
110
- updateOption: d
111
- };
112
- }
113
- var Xl = oe({
114
- name: Et,
115
- componentName: Et,
116
- props: Jl,
117
- setup(e) {
118
- const t = le("select"), l = pn(), o = w(() => [
119
- t.be("dropdown", "item"),
120
- t.is("disabled", at(s)),
121
- t.is("selected", at(r)),
122
- t.is("hovering", at(d))
123
- ]), n = he({
124
- index: -1,
125
- groupDisabled: !1,
126
- visible: !0,
127
- hover: !1
128
- }), {
129
- currentLabel: i,
130
- itemSelected: r,
131
- isDisabled: s,
132
- select: f,
133
- hoverItem: h,
134
- updateOption: c
135
- } = Zl(e, n), { visible: m, hover: d } = Ye(n), u = we().proxy;
136
- f.onOptionCreate(u), Dt(() => {
137
- const y = u.value;
138
- q(() => {
139
- const { selected: p } = f.states, O = p.some((C) => C.value === u.value);
140
- f.states.cachedOptions.get(y) === u && !O && f.states.cachedOptions.delete(y);
141
- }), f.onOptionDestroy(y, u);
142
- });
143
- function g() {
144
- s.value || f.handleOptionSelect(u);
145
- }
146
- return {
147
- ns: t,
148
- id: l,
149
- containerKls: o,
150
- currentLabel: i,
151
- itemSelected: r,
152
- isDisabled: s,
153
- select: f,
154
- visible: m,
155
- hover: d,
156
- states: n,
157
- hoverItem: h,
158
- updateOption: c,
159
- selectOptionClick: g
160
- };
161
- }
162
- });
163
- const xl = ["id", "aria-disabled", "aria-selected"];
164
- function _l(e, t, l, o, n, i) {
165
- return Ee((D(), M("li", {
166
- id: e.id,
167
- class: K(e.containerKls),
168
- role: "option",
169
- "aria-disabled": e.isDisabled || void 0,
170
- "aria-selected": e.itemSelected,
171
- onMousemove: t[0] || (t[0] = (...r) => e.hoverItem && e.hoverItem(...r)),
172
- onClick: t[1] || (t[1] = ne((...r) => e.selectOptionClick && e.selectOptionClick(...r), ["stop"]))
173
- }, [
174
- j(e.$slots, "default", {}, () => [
175
- F(
176
- "span",
177
- null,
178
- ie(e.currentLabel),
179
- 1
180
- /* TEXT */
181
- )
182
- ])
183
- ], 42, xl)), [
184
- [Me, e.visible]
185
- ]);
186
- }
187
- var It = /* @__PURE__ */ Be(Xl, [["render", _l]]), eo = oe({
188
- name: "ElSelectDropdown",
189
- componentName: "ElSelectDropdown",
190
- setup() {
191
- const e = ce(Je), t = le("select"), l = w(() => e.props.popperClass), o = w(() => e.props.multiple), n = w(() => e.props.fitInputWidth), i = V("");
192
- function r() {
193
- var s;
194
- const f = (s = e.selectRef) == null ? void 0 : s.offsetWidth;
195
- f ? i.value = `${f - bl}px` : i.value = "";
196
- }
197
- return Oe(() => {
198
- r(), Te(e.selectRef, r);
199
- }), {
200
- ns: t,
201
- minWidth: i,
202
- popperClass: l,
203
- isMultiple: o,
204
- isFitInputWidth: n
205
- };
206
- }
207
- });
208
- function to(e, t, l, o, n, i) {
209
- return D(), M(
210
- "div",
211
- {
212
- class: K([e.ns.b("dropdown"), e.ns.is("multiple", e.isMultiple), e.popperClass]),
213
- style: Ve({ [e.isFitInputWidth ? "width" : "minWidth"]: e.minWidth })
214
- },
215
- [
216
- e.$slots.header ? (D(), M(
217
- "div",
218
- {
219
- key: 0,
220
- class: K(e.ns.be("dropdown", "header"))
221
- },
222
- [
223
- j(e.$slots, "header")
224
- ],
225
- 2
226
- /* CLASS */
227
- )) : z("v-if", !0),
228
- j(e.$slots, "default"),
229
- e.$slots.footer ? (D(), M(
230
- "div",
231
- {
232
- key: 1,
233
- class: K(e.ns.be("dropdown", "footer"))
234
- },
235
- [
236
- j(e.$slots, "footer")
237
- ],
238
- 2
239
- /* CLASS */
240
- )) : z("v-if", !0)
241
- ],
242
- 6
243
- /* CLASS, STYLE */
244
- );
245
- }
246
- var no = /* @__PURE__ */ Be(eo, [["render", to]]);
247
- const lo = (e, t) => {
248
- const { t: l } = gn(), o = ol(), n = pn(), i = le("select"), r = le("input"), s = he({
249
- inputValue: "",
250
- options: /* @__PURE__ */ new Map(),
251
- cachedOptions: /* @__PURE__ */ new Map(),
252
- optionValues: [],
253
- // sorted value of options
254
- selected: [],
255
- selectionWidth: 0,
256
- collapseItemWidth: 0,
257
- selectedLabel: "",
258
- hoveringIndex: -1,
259
- previousQuery: null,
260
- inputHovering: !1,
261
- menuVisibleOnFocus: !1,
262
- isBeforeHide: !1
263
- }), f = V(), h = V(), c = V(), m = V(), d = V(), u = V(), g = V(), y = V(), p = V(), O = V(), C = V(), E = V(!1), k = V(), U = V(!1), { form: ee, formItem: T } = Rl(), { inputId: ge } = Hl(e, {
264
- formItemContext: T
265
- }), { valueOnClear: S, isEmptyValue: $ } = hl(e), {
266
- isComposing: R,
267
- handleCompositionStart: G,
268
- handleCompositionUpdate: De,
269
- handleCompositionEnd: ht
270
- } = Wl({
271
- afterComposition: (a) => zt(a)
272
- }), ye = Dl(), { wrapperRef: Ze, isFocused: Pe, handleBlur: pt } = jl(d, {
273
- disabled: ye,
274
- afterFocus() {
275
- e.automaticDropdown && !E.value && (E.value = !0, s.menuVisibleOnFocus = !0);
276
- },
277
- beforeBlur(a) {
278
- var v, N;
279
- return ((v = c.value) == null ? void 0 : v.isFocusInsideContent(a)) || ((N = m.value) == null ? void 0 : N.isFocusInsideContent(a));
280
- },
281
- afterBlur() {
282
- var a;
283
- E.value = !1, s.menuVisibleOnFocus = !1, e.validateEvent && ((a = T == null ? void 0 : T.validate) == null || a.call(T, "blur").catch((v) => bt(v)));
284
- }
285
- }), Ae = w(() => Q(e.modelValue) ? e.modelValue.length > 0 : !$(e.modelValue)), b = w(() => {
286
- var a;
287
- return (a = ee == null ? void 0 : ee.statusIcon) != null ? a : !1;
288
- }), I = w(() => e.clearable && !ye.value && Ae.value && (Pe.value || s.inputHovering)), fe = w(
289
- () => e.remote && e.filterable && !e.remoteShowSuffix ? "" : e.suffixIcon
290
- ), me = w(
291
- () => i.is("reverse", !!(fe.value && E.value))
292
- ), vt = w(() => (T == null ? void 0 : T.validateState) || ""), On = w(
293
- () => vt.value && ql[vt.value]
294
- ), Dn = w(() => e.remote ? e.debounce : 0), Kn = w(
295
- () => e.remote && !s.inputValue && s.options.size === 0
296
- ), Tn = w(() => e.loading ? e.loadingText || l("el.select.loading") : e.filterable && s.inputValue && s.options.size > 0 && Re.value === 0 ? e.noMatchText || l("el.select.noMatch") : s.options.size === 0 ? e.noDataText || l("el.select.noData") : null), Re = w(
297
- () => J.value.filter((a) => a.visible).length
298
- ), J = w(() => {
299
- const a = Array.from(s.options.values()), v = [];
300
- return s.optionValues.forEach((N) => {
301
- const L = a.findIndex((B) => B.value === N);
302
- L > -1 && v.push(a[L]);
303
- }), v.length >= a.length ? v : a;
304
- }), In = w(
305
- () => Array.from(s.cachedOptions.values())
306
- ), $n = w(() => {
307
- const a = J.value.filter((v) => !v.created).some((v) => v.currentLabel === s.inputValue);
308
- return e.filterable && e.allowCreate && s.inputValue !== "" && !a;
309
- }), Bt = () => {
310
- e.filterable && ue(e.filterMethod) || e.filterable && e.remote && ue(e.remoteMethod) || J.value.forEach((a) => {
311
- var v;
312
- (v = a.updateOption) == null || v.call(a, s.inputValue);
313
- });
314
- }, Pt = dn(), Vn = w(
315
- () => ["small"].includes(Pt.value) ? "small" : "default"
316
- ), At = w({
317
- get() {
318
- return E.value && (e.loading || !Kn.value || e.remote && !!o.empty) && (!U.value || !un(s.previousQuery));
319
- },
320
- set(a) {
321
- E.value = a;
322
- }
323
- }), Ln = w(() => {
324
- if (e.multiple && !ae(e.modelValue))
325
- return pe(e.modelValue).length === 0 && !s.inputValue;
326
- const a = Q(e.modelValue) ? e.modelValue[0] : e.modelValue;
327
- return e.filterable || ae(a) ? !s.inputValue : !0;
328
- }), Mn = w(() => {
329
- var a;
330
- const v = (a = e.placeholder) != null ? a : l("el.select.placeholder");
331
- return e.multiple || !Ae.value ? v : s.selectedLabel;
332
- }), Bn = w(() => tn ? null : "mouseenter");
333
- P(
334
- () => e.modelValue,
335
- (a, v) => {
336
- e.multiple && e.filterable && !e.reserveKeyword && (s.inputValue = "", Xe("")), xe(), !ve(a, v) && e.validateEvent && (T == null || T.validate("change").catch((N) => bt(N)));
337
- },
338
- {
339
- flush: "post",
340
- deep: !0
341
- }
342
- ), P(
343
- () => E.value,
344
- (a) => {
345
- a ? Xe(s.inputValue) : (s.inputValue = "", s.previousQuery = null, s.isBeforeHide = !0, s.menuVisibleOnFocus = !1);
346
- }
347
- ), P(
348
- // fix `Array.prototype.push/splice/..` cannot trigger non-deep watcher
349
- // https://github.com/vuejs/vue-next/issues/2116
350
- () => s.options.entries(),
351
- () => {
352
- Tt && (xe(), e.defaultFirstOption && (e.filterable || e.remote) && Re.value && Rt());
353
- },
354
- {
355
- flush: "post"
356
- }
357
- ), P([() => s.hoveringIndex, J], ([a]) => {
358
- Kl(a) && a > -1 ? k.value = J.value[a] || {} : k.value = {}, J.value.forEach((v) => {
359
- v.hover = k.value === v;
360
- });
361
- }), sl(() => {
362
- s.isBeforeHide || Bt();
363
- });
364
- const Xe = (a) => {
365
- s.previousQuery === a || R.value || (s.previousQuery = a, e.filterable && ue(e.filterMethod) ? e.filterMethod(a) : e.filterable && e.remote && ue(e.remoteMethod) && e.remoteMethod(a), e.defaultFirstOption && (e.filterable || e.remote) && Re.value ? q(Rt) : q(Pn));
366
- }, Rt = () => {
367
- const a = J.value.filter(
368
- (B) => B.visible && !B.disabled && !B.states.groupDisabled
369
- ), v = a.find((B) => B.created), N = a[0], L = J.value.map((B) => B.value);
370
- s.hoveringIndex = Gt(
371
- L,
372
- v || N
373
- );
374
- }, xe = () => {
375
- if (e.multiple)
376
- s.selectedLabel = "";
377
- else {
378
- const v = Q(e.modelValue) ? e.modelValue[0] : e.modelValue, N = gt(v);
379
- s.selectedLabel = N.currentLabel, s.selected = [N];
380
- return;
381
- }
382
- const a = [];
383
- ae(e.modelValue) || pe(e.modelValue).forEach((v) => {
384
- a.push(gt(v));
385
- }), s.selected = a;
386
- }, gt = (a) => {
387
- let v;
388
- const N = Vl(a);
389
- for (let x = s.cachedOptions.size - 1; x >= 0; x--) {
390
- const te = In.value[x];
391
- if (N ? $e(te.value, e.valueKey) === $e(a, e.valueKey) : te.value === a) {
392
- v = {
393
- index: J.value.filter((Ce) => !Ce.created).indexOf(te),
394
- value: a,
395
- currentLabel: te.currentLabel,
396
- get isDisabled() {
397
- return te.isDisabled;
398
- }
399
- };
400
- break;
401
- }
402
- }
403
- if (v) return v;
404
- const L = N ? a.label : a ?? "";
405
- return {
406
- index: -1,
407
- value: a,
408
- currentLabel: L
409
- };
410
- }, Pn = () => {
411
- const a = s.selected.length;
412
- if (a > 0) {
413
- const v = s.selected[a - 1];
414
- s.hoveringIndex = J.value.findIndex(
415
- (N) => et(v) === et(N)
416
- );
417
- } else
418
- s.hoveringIndex = -1;
419
- }, An = () => {
420
- s.selectionWidth = Number.parseFloat(
421
- window.getComputedStyle(h.value).width
422
- );
423
- }, Rn = () => {
424
- s.collapseItemWidth = O.value.getBoundingClientRect().width;
425
- }, yt = () => {
426
- var a, v;
427
- (v = (a = c.value) == null ? void 0 : a.updatePopper) == null || v.call(a);
428
- }, Ht = () => {
429
- var a, v;
430
- (v = (a = m.value) == null ? void 0 : a.updatePopper) == null || v.call(a);
431
- }, Ft = () => {
432
- s.inputValue.length > 0 && !E.value && (E.value = !0), Xe(s.inputValue);
433
- }, zt = (a) => {
434
- if (s.inputValue = a.target.value, e.remote)
435
- U.value = !0, Wt();
436
- else
437
- return Ft();
438
- }, Wt = Fl(() => {
439
- Ft(), U.value = !1;
440
- }, Dn), He = (a) => {
441
- ve(e.modelValue, a) || t(hn, a);
442
- }, Hn = (a) => cl(a, (v) => {
443
- const N = s.cachedOptions.get(v);
444
- return !(N != null && N.disabled) && !(N != null && N.states.groupDisabled);
445
- }), jt = (a) => {
446
- const v = ct(a);
447
- if (e.multiple && v !== A.delete && a.target.value.length <= 0) {
448
- const N = pe(e.modelValue).slice(), L = Hn(N);
449
- if (L < 0) return;
450
- const B = N[L];
451
- N.splice(L, 1), t(se, N), He(N), t("remove-tag", B);
452
- }
453
- }, Fn = (a, v) => {
454
- const N = s.selected.indexOf(v);
455
- if (N > -1 && !ye.value) {
456
- const L = pe(e.modelValue).slice();
457
- L.splice(N, 1), t(se, L), He(L), t("remove-tag", v.value);
458
- }
459
- a.stopPropagation(), _e();
460
- }, qt = (a) => {
461
- a.stopPropagation();
462
- const v = e.multiple ? [] : S.value;
463
- if (e.multiple)
464
- for (const N of s.selected)
465
- N.isDisabled && v.push(N.value);
466
- t(se, v), He(v), s.hoveringIndex = -1, E.value = !1, t("clear"), _e();
467
- }, Ut = (a) => {
468
- var v;
469
- if (e.multiple) {
470
- const N = pe((v = e.modelValue) != null ? v : []).slice(), L = Gt(N, a);
471
- L > -1 ? N.splice(L, 1) : (e.multipleLimit <= 0 || N.length < e.multipleLimit) && N.push(a.value), t(se, N), He(N), a.created && Xe(""), e.filterable && !e.reserveKeyword && (s.inputValue = "");
472
- } else
473
- !ve(e.modelValue, a.value) && t(se, a.value), He(a.value), E.value = !1;
474
- _e(), !E.value && q(() => {
475
- Fe(a);
476
- });
477
- }, Gt = (a, v) => ae(v) ? -1 : de(v.value) ? a.findIndex((N) => ve($e(N, e.valueKey), et(v))) : a.indexOf(v.value), Fe = (a) => {
478
- var v, N, L, B, x;
479
- const te = Q(a) ? a[a.length - 1] : a;
480
- let be = null;
481
- if (!Ue(te == null ? void 0 : te.value)) {
482
- const Ce = J.value.filter(
483
- (nl) => nl.value === te.value
484
- );
485
- Ce.length > 0 && (be = Ce[0].$el);
486
- }
487
- if (c.value && be) {
488
- const Ce = (B = (L = (N = (v = c.value) == null ? void 0 : v.popperRef) == null ? void 0 : N.contentRef) == null ? void 0 : L.querySelector) == null ? void 0 : B.call(
489
- L,
490
- `.${i.be("dropdown", "wrap")}`
491
- );
492
- Ce && Ql(Ce, be);
493
- }
494
- (x = C.value) == null || x.handleScroll();
495
- }, zn = (a) => {
496
- s.options.set(a.value, a), s.cachedOptions.set(a.value, a);
497
- }, Wn = (a, v) => {
498
- s.options.get(a) === v && s.options.delete(a);
499
- }, jn = w(() => {
500
- var a, v;
501
- return (v = (a = c.value) == null ? void 0 : a.popperRef) == null ? void 0 : v.contentRef;
502
- }), qn = () => {
503
- s.isBeforeHide = !1, q(() => {
504
- var a;
505
- (a = C.value) == null || a.update(), Fe(s.selected);
506
- });
507
- }, _e = () => {
508
- var a;
509
- (a = d.value) == null || a.focus();
510
- }, Un = () => {
511
- var a;
512
- if (E.value) {
513
- E.value = !1, q(() => {
514
- var v;
515
- return (v = d.value) == null ? void 0 : v.blur();
516
- });
517
- return;
518
- }
519
- (a = d.value) == null || a.blur();
520
- }, Gn = (a) => {
521
- qt(a);
522
- }, Yn = (a) => {
523
- if (E.value = !1, Pe.value) {
524
- const v = new FocusEvent("blur", a);
525
- q(() => pt(v));
526
- }
527
- }, Yt = () => {
528
- s.inputValue.length > 0 ? s.inputValue = "" : E.value = !1;
529
- }, Qt = (a) => {
530
- var v;
531
- ye.value || e.filterable && E.value && a && !((v = g.value) != null && v.contains(a.target)) || (tn && (s.inputHovering = !0), s.menuVisibleOnFocus ? s.menuVisibleOnFocus = !1 : E.value = !E.value);
532
- }, Jt = () => {
533
- if (!E.value)
534
- Qt();
535
- else {
536
- const a = J.value[s.hoveringIndex];
537
- a && !a.isDisabled && Ut(a);
538
- }
539
- }, et = (a) => de(a.value) ? $e(a.value, e.valueKey) : a.value, Qn = w(
540
- () => J.value.filter((a) => a.visible).every((a) => a.isDisabled)
541
- ), Jn = w(() => e.multiple ? e.collapseTags ? s.selected.slice(0, e.maxCollapseTags) : s.selected : []), Zn = w(() => e.multiple ? e.collapseTags ? s.selected.slice(e.maxCollapseTags) : [] : []), tt = (a) => {
542
- if (!E.value) {
543
- E.value = !0;
544
- return;
545
- }
546
- if (!(s.options.size === 0 || Re.value === 0 || R.value) && !Qn.value) {
547
- a === "next" ? (s.hoveringIndex++, s.hoveringIndex === s.options.size && (s.hoveringIndex = 0)) : a === "prev" && (s.hoveringIndex--, s.hoveringIndex < 0 && (s.hoveringIndex = s.options.size - 1));
548
- const v = J.value[s.hoveringIndex];
549
- (v.isDisabled || !v.visible) && tt(a), q(() => Fe(k.value));
550
- }
551
- }, Zt = (a, v, N, L) => {
552
- for (let B = v; B >= 0 && B < L; B += N) {
553
- const x = a[B];
554
- if (!(x != null && x.isDisabled) && (x != null && x.visible))
555
- return B;
556
- }
557
- return null;
558
- }, nt = (a, v) => {
559
- var N;
560
- const L = s.options.size;
561
- if (L === 0) return;
562
- const B = fl(a, 0, L - 1), x = J.value, te = v === "up" ? -1 : 1, be = (N = Zt(x, B, te, L)) != null ? N : Zt(x, B - te, -te, L);
563
- be != null && (s.hoveringIndex = be, q(() => Fe(k.value)));
564
- }, Xn = (a) => {
565
- const v = ct(a);
566
- let N = !0;
567
- switch (v) {
568
- case A.up:
569
- tt("prev");
570
- break;
571
- case A.down:
572
- tt("next");
573
- break;
574
- case A.enter:
575
- case A.numpadEnter:
576
- R.value || Jt();
577
- break;
578
- case A.esc:
579
- Yt();
580
- break;
581
- case A.backspace:
582
- N = !1, jt(a);
583
- return;
584
- case A.home:
585
- if (!E.value) return;
586
- nt(0, "down");
587
- break;
588
- case A.end:
589
- if (!E.value) return;
590
- nt(s.options.size - 1, "up");
591
- break;
592
- case A.pageUp:
593
- if (!E.value) return;
594
- nt(s.hoveringIndex - 10, "up");
595
- break;
596
- case A.pageDown:
597
- if (!E.value) return;
598
- nt(s.hoveringIndex + 10, "down");
599
- break;
600
- default:
601
- N = !1;
602
- break;
603
- }
604
- N && (a.preventDefault(), a.stopPropagation());
605
- }, xn = () => {
606
- if (!h.value) return 0;
607
- const a = window.getComputedStyle(h.value);
608
- return Number.parseFloat(a.gap || "6px");
609
- }, _n = w(() => {
610
- const a = xn(), v = e.filterable ? a + Cl : 0;
611
- return { maxWidth: `${O.value && e.maxCollapseTags === 1 ? s.selectionWidth - s.collapseItemWidth - a - v : s.selectionWidth - v}px` };
612
- }), el = w(() => ({ maxWidth: `${s.selectionWidth}px` })), tl = (a) => {
613
- t("popup-scroll", a);
614
- };
615
- Te(h, An), Te(Ze, yt), Te(p, Ht), Te(O, Rn);
616
- let lt;
617
- return P(
618
- () => At.value,
619
- (a) => {
620
- a ? lt = Te(y, yt).stop : (lt == null || lt(), lt = void 0), t("visible-change", a);
621
- }
622
- ), Oe(() => {
623
- xe();
624
- }), {
625
- inputId: ge,
626
- contentId: n,
627
- nsSelect: i,
628
- nsInput: r,
629
- states: s,
630
- isFocused: Pe,
631
- expanded: E,
632
- optionsArray: J,
633
- hoverOption: k,
634
- selectSize: Pt,
635
- filteredOptionsCount: Re,
636
- updateTooltip: yt,
637
- updateTagTooltip: Ht,
638
- debouncedOnInputChange: Wt,
639
- onInput: zt,
640
- deletePrevTag: jt,
641
- deleteTag: Fn,
642
- deleteSelected: qt,
643
- handleOptionSelect: Ut,
644
- scrollToOption: Fe,
645
- hasModelValue: Ae,
646
- shouldShowPlaceholder: Ln,
647
- currentPlaceholder: Mn,
648
- mouseEnterEventName: Bn,
649
- needStatusIcon: b,
650
- showClearBtn: I,
651
- iconComponent: fe,
652
- iconReverse: me,
653
- validateState: vt,
654
- validateIcon: On,
655
- showNewOption: $n,
656
- updateOptions: Bt,
657
- collapseTagSize: Vn,
658
- setSelected: xe,
659
- selectDisabled: ye,
660
- emptyText: Tn,
661
- handleCompositionStart: G,
662
- handleCompositionUpdate: De,
663
- handleCompositionEnd: ht,
664
- handleKeydown: Xn,
665
- onOptionCreate: zn,
666
- onOptionDestroy: Wn,
667
- handleMenuEnter: qn,
668
- focus: _e,
669
- blur: Un,
670
- handleClearClick: Gn,
671
- handleClickOutside: Yn,
672
- handleEsc: Yt,
673
- toggleMenu: Qt,
674
- selectOption: Jt,
675
- getValueKey: et,
676
- navigateOptions: tt,
677
- dropdownMenuVisible: At,
678
- showTagList: Jn,
679
- collapseTagList: Zn,
680
- popupScroll: tl,
681
- getOption: gt,
682
- // computed style
683
- tagStyle: _n,
684
- collapseTagStyle: el,
685
- // DOM ref
686
- popperRef: jn,
687
- inputRef: d,
688
- tooltipRef: c,
689
- tagTooltipRef: m,
690
- prefixRef: u,
691
- suffixRef: g,
692
- selectRef: f,
693
- wrapperRef: Ze,
694
- selectionRef: h,
695
- scrollbarRef: C,
696
- menuRef: y,
697
- tagMenuRef: p,
698
- collapseItemRef: O
699
- };
700
- };
701
- var oo = oe({
702
- name: "ElOptions",
703
- setup(e, { slots: t }) {
704
- const l = ce(Je);
705
- let o = [];
706
- return () => {
707
- var n, i;
708
- const r = (n = t.default) == null ? void 0 : n.call(t), s = [];
709
- function f(h) {
710
- Q(h) && h.forEach((c) => {
711
- var m, d, u, g;
712
- const y = (m = (c == null ? void 0 : c.type) || {}) == null ? void 0 : m.name;
713
- y === "ElOptionGroup" ? f(
714
- !Kt(c.children) && !Q(c.children) && ue((d = c.children) == null ? void 0 : d.default) ? (u = c.children) == null ? void 0 : u.default() : c.children
715
- ) : y === "ElOption" ? s.push((g = c.props) == null ? void 0 : g.value) : Q(c.children) && f(c.children);
716
- });
717
- }
718
- return r.length && f((i = r[0]) == null ? void 0 : i.children), ve(s, o) || (o = s, l && (l.states.optionValues = s)), r;
719
- };
720
- }
721
- });
722
- const mn = ft({
723
- /**
724
- * @description the name attribute of select input
725
- */
726
- name: String,
727
- /**
728
- * @description native input id
729
- */
730
- id: String,
731
- /**
732
- * @description binding value
733
- */
734
- modelValue: {
735
- type: _([
736
- Array,
737
- String,
738
- Number,
739
- Boolean,
740
- Object
741
- ]),
742
- default: void 0
743
- },
744
- /**
745
- * @description the autocomplete attribute of select input
746
- */
747
- autocomplete: {
748
- type: String,
749
- default: "off"
750
- },
751
- /**
752
- * @description for non-filterable Select, this prop decides if the option menu pops up when the input is focused
753
- */
754
- automaticDropdown: Boolean,
755
- /**
756
- * @description size of Input
757
- */
758
- size: Tl,
759
- /**
760
- * @description tooltip theme, built-in theme: `dark` / `light`
761
- */
762
- effect: {
763
- type: _(String),
764
- default: "light"
765
- },
766
- /**
767
- * @description whether Select is disabled
768
- */
769
- disabled: {
770
- type: Boolean,
771
- default: void 0
772
- },
773
- /**
774
- * @description whether select can be cleared
775
- */
776
- clearable: Boolean,
777
- /**
778
- * @description whether Select is filterable
779
- */
780
- filterable: Boolean,
781
- /**
782
- * @description whether creating new items is allowed. To use this, `filterable` must be true
783
- */
784
- allowCreate: Boolean,
785
- /**
786
- * @description whether Select is loading data from server
787
- */
788
- loading: Boolean,
789
- /**
790
- * @description custom class name for Select's dropdown
791
- */
792
- popperClass: {
793
- type: String,
794
- default: ""
795
- },
796
- /**
797
- * @description custom style for Select's dropdown
798
- */
799
- popperStyle: {
800
- type: _([String, Object])
801
- },
802
- /**
803
- * @description [popper.js](https://popper.js.org/docs/v2/) parameters
804
- */
805
- popperOptions: {
806
- type: _(Object),
807
- default: () => ({})
808
- },
809
- /**
810
- * @description whether options are loaded from server
811
- */
812
- remote: Boolean,
813
- /**
814
- * @description debounce delay during remote search, in milliseconds
815
- */
816
- debounce: {
817
- type: Number,
818
- default: 300
819
- },
820
- /**
821
- * @description displayed text while loading data from server, default is 'Loading'
822
- */
823
- loadingText: String,
824
- /**
825
- * @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data'
826
- */
827
- noMatchText: String,
828
- /**
829
- * @description displayed text when there is no options, you can also use slot `empty`, default is 'No data'
830
- */
831
- noDataText: String,
832
- /**
833
- * @description function that gets called when the input value changes. Its parameter is the current input value. To use this, `filterable` must be true
834
- */
835
- remoteMethod: {
836
- type: _(Function)
837
- },
838
- /**
839
- * @description custom filter method, the first parameter is the current input value. To use this, `filterable` must be true
840
- */
841
- filterMethod: {
842
- type: _(Function)
843
- },
844
- /**
845
- * @description whether multiple-select is activated
846
- */
847
- multiple: Boolean,
848
- /**
849
- * @description maximum number of options user can select when `multiple` is `true`. No limit when set to 0
850
- */
851
- multipleLimit: {
852
- type: Number,
853
- default: 0
854
- },
855
- /**
856
- * @description placeholder, default is 'Select'
857
- */
858
- placeholder: {
859
- type: String
860
- },
861
- /**
862
- * @description select first matching option on enter key. Use with `filterable` or `remote`
863
- */
864
- defaultFirstOption: Boolean,
865
- /**
866
- * @description when `multiple` and `filter` is true, whether to reserve current keyword after selecting an option
867
- */
868
- reserveKeyword: {
869
- type: Boolean,
870
- default: !0
871
- },
872
- /**
873
- * @description unique identity key name for value, required when value is an object
874
- */
875
- valueKey: {
876
- type: String,
877
- default: "value"
878
- },
879
- /**
880
- * @description whether to collapse tags to a text when multiple selecting
881
- */
882
- collapseTags: Boolean,
883
- /**
884
- * @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true
885
- */
886
- collapseTagsTooltip: Boolean,
887
- /**
888
- * @description the max tags number to be shown. To use this, `collapse-tags` must be true
889
- */
890
- maxCollapseTags: {
891
- type: Number,
892
- default: 1
893
- },
894
- /**
895
- * @description whether select dropdown is teleported, if `true` it will be teleported to where `append-to` sets
896
- */
897
- teleported: xt.teleported,
898
- /**
899
- * @description when select dropdown is inactive and `persistent` is `false`, select dropdown will be destroyed
900
- */
901
- persistent: {
902
- type: Boolean,
903
- default: !0
904
- },
905
- /**
906
- * @description custom clear icon component
907
- */
908
- clearIcon: {
909
- type: kt,
910
- default: Ml
911
- },
912
- /**
913
- * @description whether the width of the dropdown is the same as the input
914
- */
915
- fitInputWidth: Boolean,
916
- /**
917
- * @description custom suffix icon component
918
- */
919
- suffixIcon: {
920
- type: kt,
921
- default: Ll
922
- },
923
- /**
924
- * @description tag type
925
- */
926
- tagType: { ..._t.type, default: "info" },
927
- /**
928
- * @description tag effect
929
- */
930
- tagEffect: { ..._t.effect, default: "light" },
931
- /**
932
- * @description whether to trigger form validation
933
- */
934
- validateEvent: {
935
- type: Boolean,
936
- default: !0
937
- },
938
- /**
939
- * @description in remote search method show suffix icon
940
- */
941
- remoteShowSuffix: Boolean,
942
- /**
943
- * @description determines whether the arrow is displayed
944
- */
945
- showArrow: {
946
- type: Boolean,
947
- default: !0
948
- },
949
- /**
950
- * @description offset of the dropdown
951
- */
952
- offset: {
953
- type: Number,
954
- default: 12
955
- },
956
- /**
957
- * @description position of dropdown
958
- */
959
- placement: {
960
- type: _(String),
961
- values: vl,
962
- default: "bottom-start"
963
- },
964
- /**
965
- * @description list of possible positions for dropdown
966
- */
967
- fallbackPlacements: {
968
- type: _(Array),
969
- default: ["bottom-start", "top-start", "right", "left"]
970
- },
971
- /**
972
- * @description tabindex for input
973
- */
974
- tabindex: {
975
- type: [String, Number],
976
- default: 0
977
- },
978
- /**
979
- * @description which element the selection dropdown appends to
980
- */
981
- appendTo: xt.appendTo,
982
- options: {
983
- type: _(Array)
984
- },
985
- props: {
986
- type: _(Object),
987
- default: () => Nl
988
- },
989
- ...pl,
990
- ...Ul(["ariaLabel"])
991
- });
992
- yl.scroll;
993
- var so = oe({
994
- name: "ElOptionGroup",
995
- componentName: "ElOptionGroup",
996
- props: {
997
- /**
998
- * @description name of the group
999
- */
1000
- label: String,
1001
- /**
1002
- * @description whether to disable all options in this group
1003
- */
1004
- disabled: Boolean
1005
- },
1006
- setup(e) {
1007
- const t = le("select"), l = V(), o = we(), n = V([]);
1008
- Se(
1009
- yn,
1010
- he({
1011
- ...Ye(e)
1012
- })
1013
- );
1014
- const i = w(
1015
- () => n.value.some((h) => h.visible === !0)
1016
- ), r = (h) => {
1017
- var c;
1018
- return h.type.name === "ElOption" && !!((c = h.component) != null && c.proxy);
1019
- }, s = (h) => {
1020
- const c = pe(h), m = [];
1021
- return c.forEach((d) => {
1022
- var u;
1023
- st(d) && (r(d) ? m.push(d.component.proxy) : Q(d.children) && d.children.length ? m.push(...s(d.children)) : (u = d.component) != null && u.subTree && m.push(...s(d.component.subTree)));
1024
- }), m;
1025
- }, f = () => {
1026
- n.value = s(o.subTree);
1027
- };
1028
- return Oe(() => {
1029
- f();
1030
- }), zl(l, f, {
1031
- attributes: !0,
1032
- subtree: !0,
1033
- childList: !0
1034
- }), {
1035
- groupRef: l,
1036
- visible: i,
1037
- ns: t
1038
- };
1039
- }
1040
- });
1041
- function ao(e, t, l, o, n, i) {
1042
- return Ee((D(), M(
1043
- "ul",
1044
- {
1045
- ref: "groupRef",
1046
- class: K(e.ns.be("group", "wrap"))
1047
- },
1048
- [
1049
- F(
1050
- "li",
1051
- {
1052
- class: K(e.ns.be("group", "title"))
1053
- },
1054
- ie(e.label),
1055
- 3
1056
- /* TEXT, CLASS */
1057
- ),
1058
- F("li", null, [
1059
- F(
1060
- "ul",
1061
- {
1062
- class: K(e.ns.b("group"))
1063
- },
1064
- [
1065
- j(e.$slots, "default")
1066
- ],
1067
- 2
1068
- /* CLASS */
1069
- )
1070
- ])
1071
- ],
1072
- 2
1073
- /* CLASS */
1074
- )), [
1075
- [Me, e.visible]
1076
- ]);
1077
- }
1078
- var $t = /* @__PURE__ */ Be(so, [["render", ao]]);
1079
- const nn = "ElSelect", Ge = /* @__PURE__ */ new WeakMap(), io = (e) => (...t) => {
1080
- var l, o;
1081
- const n = t[0];
1082
- if (!n || n.includes(
1083
- 'Slot "default" invoked outside of the render function'
1084
- ) && ((l = t[2]) != null && l.includes("ElTreeSelect")))
1085
- return;
1086
- const i = (o = Ge.get(e)) == null ? void 0 : o.originalWarnHandler;
1087
- if (i) {
1088
- i(...t);
1089
- return;
1090
- }
1091
- console.warn(...t);
1092
- }, ro = (e) => {
1093
- let t = Ge.get(e);
1094
- return t || (t = {
1095
- originalWarnHandler: e.config.warnHandler,
1096
- handler: io(e),
1097
- count: 0
1098
- }, Ge.set(e, t)), t;
1099
- };
1100
- var uo = oe({
1101
- name: nn,
1102
- componentName: nn,
1103
- components: {
1104
- ElSelectMenu: no,
1105
- ElOption: It,
1106
- ElOptions: oo,
1107
- ElOptionGroup: $t,
1108
- ElTag: kl,
1109
- ElScrollbar: ml,
1110
- ElTooltip: gl,
1111
- ElIcon: rn
1112
- },
1113
- directives: { ClickOutside: Gl },
1114
- props: mn,
1115
- emits: [
1116
- se,
1117
- hn,
1118
- "remove-tag",
1119
- "clear",
1120
- "visible-change",
1121
- "focus",
1122
- "blur",
1123
- "popup-scroll"
1124
- ],
1125
- setup(e, { emit: t, slots: l }) {
1126
- const o = we(), n = ro(o.appContext);
1127
- n.count += 1, o.appContext.config.warnHandler = n.handler;
1128
- const i = w(() => {
1129
- const { modelValue: C, multiple: E } = e, k = E ? [] : void 0;
1130
- return Q(C) ? E ? C : k : E ? k : C;
1131
- }), r = he({
1132
- ...Ye(e),
1133
- modelValue: i
1134
- }), s = lo(r, t), { calculatorRef: f, inputStyle: h } = El(), { getLabel: c, getValue: m, getOptions: d, getDisabled: u } = Sl(e), g = (C) => ({
1135
- label: c(C),
1136
- value: m(C),
1137
- disabled: u(C)
1138
- }), y = (C) => C.reduce((E, k) => (E.push(k), k.children && k.children.length > 0 && E.push(...y(k.children)), E), []), p = (C) => {
1139
- ze(C || []).forEach((k) => {
1140
- var U;
1141
- if (de(k) && // @ts-expect-error
1142
- (k.type.name === "ElOption" || k.type.name === "ElTree")) {
1143
- const ee = k.type.name;
1144
- if (ee === "ElTree") {
1145
- const T = ((U = k.props) == null ? void 0 : U.data) || [];
1146
- y(T).forEach((S) => {
1147
- S.currentLabel = S.label || (de(S.value) ? "" : S.value), s.onOptionCreate(S);
1148
- });
1149
- } else if (ee === "ElOption") {
1150
- const T = { ...k.props };
1151
- T.currentLabel = T.label || (de(T.value) ? "" : T.value), s.onOptionCreate(T);
1152
- }
1153
- }
1154
- });
1155
- };
1156
- P(
1157
- () => {
1158
- var C;
1159
- return [(C = l.default) == null ? void 0 : C.call(l), i.value];
1160
- },
1161
- () => {
1162
- var C;
1163
- e.persistent || s.expanded.value || (s.states.options.clear(), p((C = l.default) == null ? void 0 : C.call(l)));
1164
- },
1165
- {
1166
- immediate: !0
1167
- }
1168
- ), Se(
1169
- Je,
1170
- he({
1171
- props: r,
1172
- states: s.states,
1173
- selectRef: s.selectRef,
1174
- optionsArray: s.optionsArray,
1175
- setSelected: s.setSelected,
1176
- handleOptionSelect: s.handleOptionSelect,
1177
- onOptionCreate: s.onOptionCreate,
1178
- onOptionDestroy: s.onOptionDestroy
1179
- })
1180
- );
1181
- const O = w(() => e.multiple ? s.states.selected.map((C) => C.currentLabel) : s.states.selectedLabel);
1182
- return Dt(() => {
1183
- const C = Ge.get(o.appContext);
1184
- C && (C.count -= 1, C.count <= 0 && (o.appContext.config.warnHandler = C.originalWarnHandler, Ge.delete(o.appContext)));
1185
- }), {
1186
- ...s,
1187
- modelValue: i,
1188
- selectedLabel: O,
1189
- calculatorRef: f,
1190
- inputStyle: h,
1191
- getLabel: c,
1192
- getValue: m,
1193
- getOptions: d,
1194
- getDisabled: u,
1195
- getOptionProps: g
1196
- };
1197
- }
1198
- });
1199
- const co = ["id", "value", "name", "disabled", "autocomplete", "tabindex", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label"], fo = ["textContent"], ho = { key: 1 };
1200
- function po(e, t, l, o, n, i) {
1201
- const r = X("el-tag"), s = X("el-tooltip"), f = X("el-icon"), h = X("el-option"), c = X("el-option-group"), m = X("el-options"), d = X("el-scrollbar"), u = X("el-select-menu"), g = al("click-outside");
1202
- return Ee((D(), M(
1203
- "div",
1204
- it({
1205
- ref: "selectRef",
1206
- class: [e.nsSelect.b(), e.nsSelect.m(e.selectSize)]
1207
- }, {
1208
- [il(e.mouseEnterEventName)]: t[10] || (t[10] = (y) => e.states.inputHovering = !0)
1209
- }, {
1210
- onMouseleave: t[11] || (t[11] = (y) => e.states.inputHovering = !1)
1211
- }),
1212
- [
1213
- re(s, {
1214
- ref: "tooltipRef",
1215
- visible: e.dropdownMenuVisible,
1216
- placement: e.placement,
1217
- teleported: e.teleported,
1218
- "popper-class": [e.nsSelect.e("popper"), e.popperClass],
1219
- "popper-style": e.popperStyle,
1220
- "popper-options": e.popperOptions,
1221
- "fallback-placements": e.fallbackPlacements,
1222
- effect: e.effect,
1223
- pure: "",
1224
- trigger: "click",
1225
- transition: `${e.nsSelect.namespace.value}-zoom-in-top`,
1226
- "stop-popper-mouse-event": !1,
1227
- "gpu-acceleration": !1,
1228
- persistent: e.persistent,
1229
- "append-to": e.appendTo,
1230
- "show-arrow": e.showArrow,
1231
- offset: e.offset,
1232
- onBeforeShow: e.handleMenuEnter,
1233
- onHide: t[9] || (t[9] = (y) => e.states.isBeforeHide = !1)
1234
- }, {
1235
- default: H(() => {
1236
- var y;
1237
- return [
1238
- F(
1239
- "div",
1240
- {
1241
- ref: "wrapperRef",
1242
- class: K([
1243
- e.nsSelect.e("wrapper"),
1244
- e.nsSelect.is("focused", e.isFocused),
1245
- e.nsSelect.is("hovering", e.states.inputHovering),
1246
- e.nsSelect.is("filterable", e.filterable),
1247
- e.nsSelect.is("disabled", e.selectDisabled)
1248
- ]),
1249
- onClick: t[6] || (t[6] = ne((...p) => e.toggleMenu && e.toggleMenu(...p), ["prevent"]))
1250
- },
1251
- [
1252
- e.$slots.prefix ? (D(), M(
1253
- "div",
1254
- {
1255
- key: 0,
1256
- ref: "prefixRef",
1257
- class: K(e.nsSelect.e("prefix"))
1258
- },
1259
- [
1260
- j(e.$slots, "prefix")
1261
- ],
1262
- 2
1263
- /* CLASS */
1264
- )) : z("v-if", !0),
1265
- F(
1266
- "div",
1267
- {
1268
- ref: "selectionRef",
1269
- class: K([
1270
- e.nsSelect.e("selection"),
1271
- e.nsSelect.is(
1272
- "near",
1273
- e.multiple && !e.$slots.prefix && !!e.states.selected.length
1274
- )
1275
- ])
1276
- },
1277
- [
1278
- e.multiple ? j(e.$slots, "tag", {
1279
- key: 0,
1280
- data: e.states.selected,
1281
- deleteTag: e.deleteTag,
1282
- selectDisabled: e.selectDisabled
1283
- }, () => [
1284
- (D(!0), M(
1285
- Ne,
1286
- null,
1287
- Ie(e.showTagList, (p) => (D(), M(
1288
- "div",
1289
- {
1290
- key: e.getValueKey(p),
1291
- class: K(e.nsSelect.e("selected-item"))
1292
- },
1293
- [
1294
- re(r, {
1295
- closable: !e.selectDisabled && !p.isDisabled,
1296
- size: e.collapseTagSize,
1297
- type: e.tagType,
1298
- effect: e.tagEffect,
1299
- "disable-transitions": "",
1300
- style: Ve(e.tagStyle),
1301
- onClose: (O) => e.deleteTag(O, p)
1302
- }, {
1303
- default: H(() => [
1304
- F(
1305
- "span",
1306
- {
1307
- class: K(e.nsSelect.e("tags-text"))
1308
- },
1309
- [
1310
- j(e.$slots, "label", {
1311
- index: p.index,
1312
- label: p.currentLabel,
1313
- value: p.value
1314
- }, () => [
1315
- Xt(
1316
- ie(p.currentLabel),
1317
- 1
1318
- /* TEXT */
1319
- )
1320
- ])
1321
- ],
1322
- 2
1323
- /* CLASS */
1324
- )
1325
- ]),
1326
- _: 2
1327
- /* DYNAMIC */
1328
- }, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
1329
- ],
1330
- 2
1331
- /* CLASS */
1332
- ))),
1333
- 128
1334
- /* KEYED_FRAGMENT */
1335
- )),
1336
- e.collapseTags && e.states.selected.length > e.maxCollapseTags ? (D(), W(s, {
1337
- key: 0,
1338
- ref: "tagTooltipRef",
1339
- disabled: e.dropdownMenuVisible || !e.collapseTagsTooltip,
1340
- "fallback-placements": ["bottom", "top", "right", "left"],
1341
- effect: e.effect,
1342
- placement: "bottom",
1343
- "popper-class": e.popperClass,
1344
- "popper-style": e.popperStyle,
1345
- teleported: e.teleported,
1346
- "popper-options": e.popperOptions
1347
- }, {
1348
- default: H(() => [
1349
- F(
1350
- "div",
1351
- {
1352
- ref: "collapseItemRef",
1353
- class: K(e.nsSelect.e("selected-item"))
1354
- },
1355
- [
1356
- re(r, {
1357
- closable: !1,
1358
- size: e.collapseTagSize,
1359
- type: e.tagType,
1360
- effect: e.tagEffect,
1361
- "disable-transitions": "",
1362
- style: Ve(e.collapseTagStyle)
1363
- }, {
1364
- default: H(() => [
1365
- F(
1366
- "span",
1367
- {
1368
- class: K(e.nsSelect.e("tags-text"))
1369
- },
1370
- " + " + ie(e.states.selected.length - e.maxCollapseTags),
1371
- 3
1372
- /* TEXT, CLASS */
1373
- )
1374
- ]),
1375
- _: 1
1376
- /* STABLE */
1377
- }, 8, ["size", "type", "effect", "style"])
1378
- ],
1379
- 2
1380
- /* CLASS */
1381
- )
1382
- ]),
1383
- content: H(() => [
1384
- F(
1385
- "div",
1386
- {
1387
- ref: "tagMenuRef",
1388
- class: K(e.nsSelect.e("selection"))
1389
- },
1390
- [
1391
- (D(!0), M(
1392
- Ne,
1393
- null,
1394
- Ie(e.collapseTagList, (p) => (D(), M(
1395
- "div",
1396
- {
1397
- key: e.getValueKey(p),
1398
- class: K(e.nsSelect.e("selected-item"))
1399
- },
1400
- [
1401
- re(r, {
1402
- class: "in-tooltip",
1403
- closable: !e.selectDisabled && !p.isDisabled,
1404
- size: e.collapseTagSize,
1405
- type: e.tagType,
1406
- effect: e.tagEffect,
1407
- "disable-transitions": "",
1408
- onClose: (O) => e.deleteTag(O, p)
1409
- }, {
1410
- default: H(() => [
1411
- F(
1412
- "span",
1413
- {
1414
- class: K(e.nsSelect.e("tags-text"))
1415
- },
1416
- [
1417
- j(e.$slots, "label", {
1418
- index: p.index,
1419
- label: p.currentLabel,
1420
- value: p.value
1421
- }, () => [
1422
- Xt(
1423
- ie(p.currentLabel),
1424
- 1
1425
- /* TEXT */
1426
- )
1427
- ])
1428
- ],
1429
- 2
1430
- /* CLASS */
1431
- )
1432
- ]),
1433
- _: 2
1434
- /* DYNAMIC */
1435
- }, 1032, ["closable", "size", "type", "effect", "onClose"])
1436
- ],
1437
- 2
1438
- /* CLASS */
1439
- ))),
1440
- 128
1441
- /* KEYED_FRAGMENT */
1442
- ))
1443
- ],
1444
- 2
1445
- /* CLASS */
1446
- )
1447
- ]),
1448
- _: 3
1449
- /* FORWARDED */
1450
- }, 8, ["disabled", "effect", "popper-class", "popper-style", "teleported", "popper-options"])) : z("v-if", !0)
1451
- ]) : z("v-if", !0),
1452
- F(
1453
- "div",
1454
- {
1455
- class: K([
1456
- e.nsSelect.e("selected-item"),
1457
- e.nsSelect.e("input-wrapper"),
1458
- e.nsSelect.is("hidden", !e.filterable || e.selectDisabled)
1459
- ])
1460
- },
1461
- [
1462
- F("input", {
1463
- id: e.inputId,
1464
- ref: "inputRef",
1465
- value: e.states.inputValue,
1466
- type: "text",
1467
- name: e.name,
1468
- class: K([e.nsSelect.e("input"), e.nsSelect.is(e.selectSize)]),
1469
- disabled: e.selectDisabled,
1470
- autocomplete: e.autocomplete,
1471
- style: Ve(e.inputStyle),
1472
- tabindex: e.tabindex,
1473
- role: "combobox",
1474
- readonly: !e.filterable,
1475
- spellcheck: "false",
1476
- "aria-activedescendant": ((y = e.hoverOption) == null ? void 0 : y.id) || "",
1477
- "aria-controls": e.contentId,
1478
- "aria-expanded": e.dropdownMenuVisible,
1479
- "aria-label": e.ariaLabel,
1480
- "aria-autocomplete": "none",
1481
- "aria-haspopup": "listbox",
1482
- onKeydown: t[0] || (t[0] = (...p) => e.handleKeydown && e.handleKeydown(...p)),
1483
- onCompositionstart: t[1] || (t[1] = (...p) => e.handleCompositionStart && e.handleCompositionStart(...p)),
1484
- onCompositionupdate: t[2] || (t[2] = (...p) => e.handleCompositionUpdate && e.handleCompositionUpdate(...p)),
1485
- onCompositionend: t[3] || (t[3] = (...p) => e.handleCompositionEnd && e.handleCompositionEnd(...p)),
1486
- onInput: t[4] || (t[4] = (...p) => e.onInput && e.onInput(...p)),
1487
- onClick: t[5] || (t[5] = ne((...p) => e.toggleMenu && e.toggleMenu(...p), ["stop"]))
1488
- }, null, 46, co),
1489
- e.filterable ? (D(), M("span", {
1490
- key: 0,
1491
- ref: "calculatorRef",
1492
- "aria-hidden": "true",
1493
- class: K(e.nsSelect.e("input-calculator")),
1494
- textContent: ie(e.states.inputValue)
1495
- }, null, 10, fo)) : z("v-if", !0)
1496
- ],
1497
- 2
1498
- /* CLASS */
1499
- ),
1500
- e.shouldShowPlaceholder ? (D(), M(
1501
- "div",
1502
- {
1503
- key: 1,
1504
- class: K([
1505
- e.nsSelect.e("selected-item"),
1506
- e.nsSelect.e("placeholder"),
1507
- e.nsSelect.is(
1508
- "transparent",
1509
- !e.hasModelValue || e.expanded && !e.states.inputValue
1510
- )
1511
- ])
1512
- },
1513
- [
1514
- e.hasModelValue ? j(e.$slots, "label", {
1515
- key: 0,
1516
- index: e.getOption(e.modelValue).index,
1517
- label: e.currentPlaceholder,
1518
- value: e.modelValue
1519
- }, () => [
1520
- F(
1521
- "span",
1522
- null,
1523
- ie(e.currentPlaceholder),
1524
- 1
1525
- /* TEXT */
1526
- )
1527
- ]) : (D(), M(
1528
- "span",
1529
- ho,
1530
- ie(e.currentPlaceholder),
1531
- 1
1532
- /* TEXT */
1533
- ))
1534
- ],
1535
- 2
1536
- /* CLASS */
1537
- )) : z("v-if", !0)
1538
- ],
1539
- 2
1540
- /* CLASS */
1541
- ),
1542
- F(
1543
- "div",
1544
- {
1545
- ref: "suffixRef",
1546
- class: K(e.nsSelect.e("suffix"))
1547
- },
1548
- [
1549
- e.iconComponent && !e.showClearBtn ? (D(), W(f, {
1550
- key: 0,
1551
- class: K([e.nsSelect.e("caret"), e.nsSelect.e("icon"), e.iconReverse])
1552
- }, {
1553
- default: H(() => [
1554
- (D(), W(je(e.iconComponent)))
1555
- ]),
1556
- _: 1
1557
- /* STABLE */
1558
- }, 8, ["class"])) : z("v-if", !0),
1559
- e.showClearBtn && e.clearIcon ? (D(), W(f, {
1560
- key: 1,
1561
- class: K([
1562
- e.nsSelect.e("caret"),
1563
- e.nsSelect.e("icon"),
1564
- e.nsSelect.e("clear")
1565
- ]),
1566
- onClick: e.handleClearClick
1567
- }, {
1568
- default: H(() => [
1569
- (D(), W(je(e.clearIcon)))
1570
- ]),
1571
- _: 1
1572
- /* STABLE */
1573
- }, 8, ["class", "onClick"])) : z("v-if", !0),
1574
- e.validateState && e.validateIcon && e.needStatusIcon ? (D(), W(f, {
1575
- key: 2,
1576
- class: K([
1577
- e.nsInput.e("icon"),
1578
- e.nsInput.e("validateIcon"),
1579
- e.nsInput.is("loading", e.validateState === "validating")
1580
- ])
1581
- }, {
1582
- default: H(() => [
1583
- (D(), W(je(e.validateIcon)))
1584
- ]),
1585
- _: 1
1586
- /* STABLE */
1587
- }, 8, ["class"])) : z("v-if", !0)
1588
- ],
1589
- 2
1590
- /* CLASS */
1591
- )
1592
- ],
1593
- 2
1594
- /* CLASS */
1595
- )
1596
- ];
1597
- }),
1598
- content: H(() => [
1599
- re(
1600
- u,
1601
- { ref: "menuRef" },
1602
- {
1603
- default: H(() => [
1604
- e.$slots.header ? (D(), M(
1605
- "div",
1606
- {
1607
- key: 0,
1608
- class: K(e.nsSelect.be("dropdown", "header")),
1609
- onClick: t[7] || (t[7] = ne(() => {
1610
- }, ["stop"]))
1611
- },
1612
- [
1613
- j(e.$slots, "header")
1614
- ],
1615
- 2
1616
- /* CLASS */
1617
- )) : z("v-if", !0),
1618
- Ee(re(d, {
1619
- id: e.contentId,
1620
- ref: "scrollbarRef",
1621
- tag: "ul",
1622
- "wrap-class": e.nsSelect.be("dropdown", "wrap"),
1623
- "view-class": e.nsSelect.be("dropdown", "list"),
1624
- class: K([e.nsSelect.is("empty", e.filteredOptionsCount === 0)]),
1625
- role: "listbox",
1626
- "aria-label": e.ariaLabel,
1627
- "aria-orientation": "vertical",
1628
- onScroll: e.popupScroll
1629
- }, {
1630
- default: H(() => [
1631
- e.showNewOption ? (D(), W(h, {
1632
- key: 0,
1633
- value: e.states.inputValue,
1634
- created: !0
1635
- }, null, 8, ["value"])) : z("v-if", !0),
1636
- re(m, null, {
1637
- default: H(() => [
1638
- j(e.$slots, "default", {}, () => [
1639
- (D(!0), M(
1640
- Ne,
1641
- null,
1642
- Ie(e.options, (y, p) => {
1643
- var O;
1644
- return D(), M(
1645
- Ne,
1646
- { key: p },
1647
- [
1648
- (O = e.getOptions(y)) != null && O.length ? (D(), W(c, {
1649
- key: 0,
1650
- label: e.getLabel(y),
1651
- disabled: e.getDisabled(y)
1652
- }, {
1653
- default: H(() => [
1654
- (D(!0), M(
1655
- Ne,
1656
- null,
1657
- Ie(e.getOptions(y), (C) => (D(), W(
1658
- h,
1659
- it({
1660
- key: e.getValue(C)
1661
- }, { ref_for: !0 }, e.getOptionProps(C)),
1662
- null,
1663
- 16
1664
- /* FULL_PROPS */
1665
- ))),
1666
- 128
1667
- /* KEYED_FRAGMENT */
1668
- ))
1669
- ]),
1670
- _: 2
1671
- /* DYNAMIC */
1672
- }, 1032, ["label", "disabled"])) : (D(), W(
1673
- h,
1674
- it({
1675
- key: 1,
1676
- ref_for: !0
1677
- }, e.getOptionProps(y)),
1678
- null,
1679
- 16
1680
- /* FULL_PROPS */
1681
- ))
1682
- ],
1683
- 64
1684
- /* STABLE_FRAGMENT */
1685
- );
1686
- }),
1687
- 128
1688
- /* KEYED_FRAGMENT */
1689
- ))
1690
- ])
1691
- ]),
1692
- _: 3
1693
- /* FORWARDED */
1694
- })
1695
- ]),
1696
- _: 3
1697
- /* FORWARDED */
1698
- }, 8, ["id", "wrap-class", "view-class", "class", "aria-label", "onScroll"]), [
1699
- [Me, e.states.options.size > 0 && !e.loading]
1700
- ]),
1701
- e.$slots.loading && e.loading ? (D(), M(
1702
- "div",
1703
- {
1704
- key: 1,
1705
- class: K(e.nsSelect.be("dropdown", "loading"))
1706
- },
1707
- [
1708
- j(e.$slots, "loading")
1709
- ],
1710
- 2
1711
- /* CLASS */
1712
- )) : e.loading || e.filteredOptionsCount === 0 ? (D(), M(
1713
- "div",
1714
- {
1715
- key: 2,
1716
- class: K(e.nsSelect.be("dropdown", "empty"))
1717
- },
1718
- [
1719
- j(e.$slots, "empty", {}, () => [
1720
- F(
1721
- "span",
1722
- null,
1723
- ie(e.emptyText),
1724
- 1
1725
- /* TEXT */
1726
- )
1727
- ])
1728
- ],
1729
- 2
1730
- /* CLASS */
1731
- )) : z("v-if", !0),
1732
- e.$slots.footer ? (D(), M(
1733
- "div",
1734
- {
1735
- key: 3,
1736
- class: K(e.nsSelect.be("dropdown", "footer")),
1737
- onClick: t[8] || (t[8] = ne(() => {
1738
- }, ["stop"]))
1739
- },
1740
- [
1741
- j(e.$slots, "footer")
1742
- ],
1743
- 2
1744
- /* CLASS */
1745
- )) : z("v-if", !0)
1746
- ]),
1747
- _: 3
1748
- /* FORWARDED */
1749
- },
1750
- 512
1751
- /* NEED_PATCH */
1752
- )
1753
- ]),
1754
- _: 3
1755
- /* FORWARDED */
1756
- }, 8, ["visible", "placement", "teleported", "popper-class", "popper-style", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "show-arrow", "offset", "onBeforeShow"])
1757
- ],
1758
- 16
1759
- /* FULL_PROPS */
1760
- )), [
1761
- [g, e.handleClickOutside, e.popperRef]
1762
- ]);
1763
- }
1764
- var vo = /* @__PURE__ */ Be(uo, [["render", po]]);
1765
- const bn = Qe(vo, {
1766
- Option: It,
1767
- OptionGroup: $t
1768
- }), ln = cn(It);
1769
- cn($t);
1770
- const Le = "$treeNodeId", on = function(e, t) {
1771
- !t || t[Le] || Object.defineProperty(t, Le, {
1772
- value: e.id,
1773
- enumerable: !1,
1774
- configurable: !1,
1775
- writable: !1
1776
- });
1777
- }, Vt = (e, t) => t == null ? void 0 : t[e || Le], St = (e, t, l) => {
1778
- const o = e.value.currentNode;
1779
- l();
1780
- const n = e.value.currentNode;
1781
- o !== n && t("current-change", n ? n.data : null, n);
1782
- };
1783
- var go = Object.defineProperty, yo = (e, t, l) => t in e ? go(e, t, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[t] = l, Y = (e, t, l) => yo(e, typeof t != "symbol" ? t + "" : t, l);
1784
- const Cn = (e) => {
1785
- let t = !0, l = !0, o = !0, n = !0;
1786
- for (let i = 0, r = e.length; i < r; i++) {
1787
- const s = e[i];
1788
- (s.checked !== !0 || s.indeterminate) && (t = !1, s.disabled || (o = !1)), (s.checked !== !1 || s.indeterminate) && (l = !1), s.isEffectivelyChecked || (n = !1);
1789
- }
1790
- return {
1791
- all: t,
1792
- none: l,
1793
- allWithoutDisable: o,
1794
- half: !t && !l,
1795
- isEffectivelyChecked: n
1796
- };
1797
- }, We = function(e) {
1798
- if (e.childNodes.length === 0 || e.loading) {
1799
- e.isEffectivelyChecked = e.disabled || e.checked;
1800
- return;
1801
- }
1802
- const { all: t, none: l, half: o, isEffectivelyChecked: n } = Cn(
1803
- e.childNodes
1804
- );
1805
- e.isEffectivelyChecked = n, t ? (e.checked = !0, e.indeterminate = !1) : o ? (e.checked = !1, e.indeterminate = !0) : l && (e.checked = !1, e.indeterminate = !1);
1806
- const i = e.parent;
1807
- !i || i.level === 0 || e.store.checkStrictly || We(i);
1808
- }, ot = function(e, t) {
1809
- const l = e.store.props, o = e.data || {}, n = l[t];
1810
- if (ue(n))
1811
- return n(o, e);
1812
- if (Kt(n))
1813
- return o[n];
1814
- if (ae(n)) {
1815
- const i = o[t];
1816
- return ae(i) ? "" : i;
1817
- }
1818
- }, wt = function(e, t) {
1819
- e.forEach((l) => {
1820
- l.canFocus = t, wt(l.childNodes, t);
1821
- });
1822
- };
1823
- let mo = 0;
1824
- class ke {
1825
- constructor(t) {
1826
- Y(this, "id"), Y(this, "text"), Y(this, "checked"), Y(this, "indeterminate"), Y(this, "data"), Y(this, "expanded"), Y(this, "parent"), Y(this, "visible"), Y(this, "isCurrent"), Y(this, "store"), Y(this, "isLeafByUser"), Y(this, "isLeaf"), Y(this, "canFocus"), Y(this, "level"), Y(this, "loaded"), Y(this, "childNodes"), Y(this, "loading"), Y(this, "isEffectivelyChecked", !1), this.id = mo++, this.text = null, this.checked = !1, this.indeterminate = !1, this.data = null, this.expanded = !1, this.parent = null, this.visible = !0, this.isCurrent = !1, this.canFocus = !1;
1827
- for (const l in t)
1828
- Nt(t, l) && (this[l] = t[l]);
1829
- this.level = 0, this.loaded = !1, this.childNodes = [], this.loading = !1, this.parent && (this.level = this.parent.level + 1);
1830
- }
1831
- initialize() {
1832
- var t;
1833
- const l = this.store;
1834
- if (!l)
1835
- throw new Error("[Node]store is required!");
1836
- l.registerNode(this);
1837
- const o = l.props;
1838
- if (o && typeof o.isLeaf < "u") {
1839
- const r = ot(this, "isLeaf");
1840
- Ct(r) && (this.isLeafByUser = r);
1841
- }
1842
- if (l.lazy !== !0 && this.data ? (this.setData(this.data), l.defaultExpandAll && (this.expanded = !0, this.canFocus = !0)) : this.level > 0 && l.lazy && l.defaultExpandAll && !this.isLeafByUser && this.expand(), Q(this.data) || on(this, this.data), !this.data) return;
1843
- const n = l.defaultExpandedKeys, i = l.key;
1844
- i && !Ue(this.key) && n && n.includes(this.key) && this.expand(null, l.autoExpandParent), i && l.currentNodeKey !== void 0 && this.key === l.currentNodeKey && (l.currentNode && (l.currentNode.isCurrent = !1), l.currentNode = this, l.currentNode.isCurrent = !0), l.lazy && l._initDefaultCheckedNode(this), this.updateLeafState(), (this.level === 1 || ((t = this.parent) == null ? void 0 : t.expanded) === !0) && (this.canFocus = !0);
1845
- }
1846
- setData(t) {
1847
- Q(t) || on(this, t), this.data = t, this.childNodes = [];
1848
- let l;
1849
- this.level === 0 && Q(this.data) ? l = this.data : l = ot(this, "children") || [];
1850
- for (let o = 0, n = l.length; o < n; o++)
1851
- this.insertChild({ data: l[o] });
1852
- }
1853
- get label() {
1854
- return ot(this, "label");
1855
- }
1856
- get key() {
1857
- const t = this.store.key;
1858
- return this.data ? this.data[t] : null;
1859
- }
1860
- get disabled() {
1861
- return ot(this, "disabled");
1862
- }
1863
- get nextSibling() {
1864
- const t = this.parent;
1865
- if (t) {
1866
- const l = t.childNodes.indexOf(this);
1867
- if (l > -1)
1868
- return t.childNodes[l + 1];
1869
- }
1870
- return null;
1871
- }
1872
- get previousSibling() {
1873
- const t = this.parent;
1874
- if (t) {
1875
- const l = t.childNodes.indexOf(this);
1876
- if (l > -1)
1877
- return l > 0 ? t.childNodes[l - 1] : null;
1878
- }
1879
- return null;
1880
- }
1881
- contains(t, l = !0) {
1882
- return (this.childNodes || []).some(
1883
- (o) => o === t || l && o.contains(t)
1884
- );
1885
- }
1886
- remove() {
1887
- const t = this.parent;
1888
- t && t.removeChild(this);
1889
- }
1890
- insertChild(t, l, o) {
1891
- if (!t) throw new Error("InsertChild error: child is required.");
1892
- if (!(t instanceof ke)) {
1893
- if (!o) {
1894
- const n = this.getChildren(!0);
1895
- n != null && n.includes(t.data) || (ae(l) || l < 0 ? n == null || n.push(t.data) : n == null || n.splice(l, 0, t.data));
1896
- }
1897
- Object.assign(t, {
1898
- parent: this,
1899
- store: this.store
1900
- }), t = he(new ke(t)), t instanceof ke && t.initialize();
1901
- }
1902
- t.level = this.level + 1, ae(l) || l < 0 ? this.childNodes.push(t) : this.childNodes.splice(l, 0, t), this.updateLeafState();
1903
- }
1904
- insertBefore(t, l) {
1905
- let o;
1906
- l && (o = this.childNodes.indexOf(l)), this.insertChild(t, o);
1907
- }
1908
- insertAfter(t, l) {
1909
- let o;
1910
- l && (o = this.childNodes.indexOf(l), o !== -1 && (o += 1)), this.insertChild(t, o);
1911
- }
1912
- removeChild(t) {
1913
- const l = this.getChildren() || [], o = l.indexOf(t.data);
1914
- o > -1 && l.splice(o, 1);
1915
- const n = this.childNodes.indexOf(t);
1916
- n > -1 && (this.store && this.store.deregisterNode(t), t.parent = null, this.childNodes.splice(n, 1)), this.updateLeafState();
1917
- }
1918
- removeChildByData(t) {
1919
- const l = this.childNodes.find((o) => o.data === t);
1920
- l && this.removeChild(l);
1921
- }
1922
- expand(t, l) {
1923
- const o = () => {
1924
- if (l) {
1925
- let n = this.parent;
1926
- for (; n && n.level > 0; )
1927
- n.expanded = !0, n = n.parent;
1928
- }
1929
- this.expanded = !0, t && t(), wt(this.childNodes, !0);
1930
- };
1931
- this.shouldLoadData() ? this.loadData((n) => {
1932
- Q(n) && (this.checked ? this.setChecked(!0, !0) : this.store.checkStrictly || We(this), o());
1933
- }) : o();
1934
- }
1935
- doCreateChildren(t, l = {}) {
1936
- t.forEach((o) => {
1937
- this.insertChild(
1938
- Object.assign({ data: o }, l),
1939
- void 0,
1940
- !0
1941
- );
1942
- });
1943
- }
1944
- collapse() {
1945
- this.expanded = !1, wt(this.childNodes, !1);
1946
- }
1947
- shouldLoadData() {
1948
- return !!(this.store.lazy === !0 && this.store.load && !this.loaded);
1949
- }
1950
- updateLeafState() {
1951
- if (this.store.lazy === !0 && this.loaded !== !0 && typeof this.isLeafByUser < "u") {
1952
- this.isLeaf = this.isLeafByUser, this.isEffectivelyChecked = this.isLeaf && this.disabled;
1953
- return;
1954
- }
1955
- const t = this.childNodes;
1956
- if (!this.store.lazy || this.store.lazy === !0 && this.loaded === !0) {
1957
- this.isLeaf = !t || t.length === 0, this.isEffectivelyChecked = this.isLeaf && this.disabled;
1958
- return;
1959
- }
1960
- this.isLeaf = !1;
1961
- }
1962
- setChecked(t, l, o, n) {
1963
- if (this.indeterminate = t === "half", this.checked = t === !0, this.isEffectivelyChecked = !this.childNodes.length && (this.disabled || this.checked), this.store.checkStrictly) return;
1964
- if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
1965
- const r = () => {
1966
- if (l) {
1967
- const s = this.childNodes;
1968
- for (let m = 0, d = s.length; m < d; m++) {
1969
- const u = s[m];
1970
- n = n || t !== !1;
1971
- const g = u.disabled && u.isLeaf ? u.checked : n;
1972
- u.setChecked(g, l, !0, n);
1973
- }
1974
- const { half: f, all: h, isEffectivelyChecked: c } = Cn(s);
1975
- h || (this.checked = h, this.indeterminate = f), this.isEffectivelyChecked = this.childNodes.length ? c : this.disabled || this.checked;
1976
- }
1977
- };
1978
- if (this.shouldLoadData()) {
1979
- this.loadData(
1980
- () => {
1981
- r(), We(this);
1982
- },
1983
- {
1984
- checked: t !== !1
1985
- }
1986
- );
1987
- return;
1988
- } else
1989
- r();
1990
- }
1991
- const i = this.parent;
1992
- !i || i.level === 0 || o || We(i);
1993
- }
1994
- getChildren(t = !1) {
1995
- if (this.level === 0) return this.data;
1996
- const l = this.data;
1997
- if (!l) return null;
1998
- const o = this.store.props;
1999
- let n = "children";
2000
- return o && (n = o.children || "children"), ae(l[n]) && (l[n] = null), t && !l[n] && (l[n] = []), l[n];
2001
- }
2002
- updateChildren() {
2003
- const t = this.getChildren() || [], l = this.childNodes.map((i) => i.data), o = {}, n = [];
2004
- t.forEach((i, r) => {
2005
- const s = i[Le];
2006
- !!s && l.some((h) => (h == null ? void 0 : h[Le]) === s) ? o[s] = { index: r, data: i } : n.push({ index: r, data: i });
2007
- }), this.store.lazy || l.forEach((i) => {
2008
- o[i == null ? void 0 : i[Le]] || this.removeChildByData(i);
2009
- }), n.forEach(({ index: i, data: r }) => {
2010
- this.insertChild({ data: r }, i);
2011
- }), this.updateLeafState();
2012
- }
2013
- loadData(t, l = {}) {
2014
- if (this.store.lazy === !0 && this.store.load && !this.loaded && (!this.loading || Object.keys(l).length)) {
2015
- this.loading = !0;
2016
- const o = (i) => {
2017
- this.childNodes = [], this.doCreateChildren(i, l), this.loaded = !0, this.loading = !1, this.updateLeafState(), t && t.call(this, i);
2018
- }, n = () => {
2019
- this.loading = !1;
2020
- };
2021
- this.store.load(this, o, n);
2022
- } else
2023
- t && t.call(this);
2024
- }
2025
- eachNode(t) {
2026
- const l = [this];
2027
- for (; l.length; ) {
2028
- const o = l.shift();
2029
- l.unshift(...o.childNodes), t(o);
2030
- }
2031
- }
2032
- reInitChecked() {
2033
- this.store.checkStrictly || We(this);
2034
- }
2035
- }
2036
- var bo = Object.defineProperty, Co = (e, t, l) => t in e ? bo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[t] = l, Z = (e, t, l) => Co(e, typeof t != "symbol" ? t + "" : t, l);
2037
- class No {
2038
- constructor(t) {
2039
- Z(this, "currentNode"), Z(this, "currentNodeKey"), Z(this, "nodesMap"), Z(this, "root"), Z(this, "data"), Z(this, "lazy", !1), Z(this, "load"), Z(this, "filterNodeMethod"), Z(this, "key"), Z(this, "defaultCheckedKeys"), Z(this, "checkStrictly", !1), Z(this, "defaultExpandedKeys"), Z(this, "autoExpandParent", !1), Z(this, "defaultExpandAll", !1), Z(this, "checkDescendants", !1), Z(this, "props"), this.currentNode = null, this.currentNodeKey = null;
2040
- for (const l in t)
2041
- Nt(t, l) && (this[l] = t[l]);
2042
- this.nodesMap = {};
2043
- }
2044
- initialize() {
2045
- if (this.root = new ke({
2046
- data: this.data,
2047
- store: this
2048
- }), this.root.initialize(), this.lazy && this.load) {
2049
- const t = this.load;
2050
- t(
2051
- this.root,
2052
- (l) => {
2053
- this.root.doCreateChildren(l), this._initDefaultCheckedNodes();
2054
- },
2055
- Bl
2056
- );
2057
- } else
2058
- this._initDefaultCheckedNodes();
2059
- }
2060
- filter(t) {
2061
- const l = this.filterNodeMethod, o = this.lazy, n = async function(i) {
2062
- const r = i.root ? i.root.childNodes : i.childNodes;
2063
- for (const [s, f] of r.entries())
2064
- f.visible = !!(l != null && l.call(
2065
- f,
2066
- t,
2067
- f.data,
2068
- f
2069
- )), s % 80 === 0 && s > 0 && await q(), await n(f);
2070
- if (!i.visible && r.length) {
2071
- let s = !0;
2072
- s = !r.some((f) => f.visible), i.root ? i.root.visible = s === !1 : i.visible = s === !1;
2073
- }
2074
- t && i.visible && !i.isLeaf && (!o || i.loaded) && i.expand();
2075
- };
2076
- n(this);
2077
- }
2078
- setData(t) {
2079
- t !== this.root.data ? (this.nodesMap = {}, this.root.setData(t), this._initDefaultCheckedNodes(), this.setCurrentNodeKey(this.currentNodeKey)) : this.root.updateChildren();
2080
- }
2081
- getNode(t) {
2082
- if (t instanceof ke) return t;
2083
- const l = de(t) ? Vt(this.key, t) : t;
2084
- return this.nodesMap[l] || null;
2085
- }
2086
- insertBefore(t, l) {
2087
- var o;
2088
- const n = this.getNode(l);
2089
- (o = n.parent) == null || o.insertBefore({ data: t }, n);
2090
- }
2091
- insertAfter(t, l) {
2092
- var o;
2093
- const n = this.getNode(l);
2094
- (o = n.parent) == null || o.insertAfter({ data: t }, n);
2095
- }
2096
- remove(t) {
2097
- const l = this.getNode(t);
2098
- l && l.parent && (l === this.currentNode && (this.currentNode = null), l.parent.removeChild(l));
2099
- }
2100
- append(t, l) {
2101
- const o = en(l) ? this.root : this.getNode(l);
2102
- o && o.insertChild({ data: t });
2103
- }
2104
- _initDefaultCheckedNodes() {
2105
- const t = this.defaultCheckedKeys || [], l = this.nodesMap;
2106
- t.forEach((o) => {
2107
- const n = l[o];
2108
- n && n.setChecked(!0, !this.checkStrictly);
2109
- });
2110
- }
2111
- _initDefaultCheckedNode(t) {
2112
- const l = this.defaultCheckedKeys || [];
2113
- !Ue(t.key) && l.includes(t.key) && t.setChecked(!0, !this.checkStrictly);
2114
- }
2115
- setDefaultCheckedKey(t) {
2116
- t !== this.defaultCheckedKeys && (this.defaultCheckedKeys = t, this._initDefaultCheckedNodes());
2117
- }
2118
- registerNode(t) {
2119
- const l = this.key;
2120
- if (!(!t || !t.data))
2121
- if (!l)
2122
- this.nodesMap[t.id] = t;
2123
- else {
2124
- const o = t.key;
2125
- Ue(o) || (this.nodesMap[o] = t);
2126
- }
2127
- }
2128
- deregisterNode(t) {
2129
- !this.key || !t || !t.data || (t.childNodes.forEach((o) => {
2130
- this.deregisterNode(o);
2131
- }), delete this.nodesMap[t.key]);
2132
- }
2133
- getCheckedNodes(t = !1, l = !1) {
2134
- const o = [], n = function(i) {
2135
- (i.root ? i.root.childNodes : i.childNodes).forEach((s) => {
2136
- (s.checked || l && s.indeterminate) && (!t || t && s.isLeaf) && o.push(s.data), n(s);
2137
- });
2138
- };
2139
- return n(this), o;
2140
- }
2141
- getCheckedKeys(t = !1) {
2142
- return this.getCheckedNodes(t).map((l) => (l || {})[this.key]);
2143
- }
2144
- getHalfCheckedNodes() {
2145
- const t = [], l = function(o) {
2146
- (o.root ? o.root.childNodes : o.childNodes).forEach((i) => {
2147
- i.indeterminate && t.push(i.data), l(i);
2148
- });
2149
- };
2150
- return l(this), t;
2151
- }
2152
- getHalfCheckedKeys() {
2153
- return this.getHalfCheckedNodes().map((t) => (t || {})[this.key]);
2154
- }
2155
- _getAllNodes() {
2156
- const t = [], l = this.nodesMap;
2157
- for (const o in l)
2158
- Nt(l, o) && t.push(l[o]);
2159
- return t;
2160
- }
2161
- updateChildren(t, l) {
2162
- const o = this.nodesMap[t];
2163
- if (!o) return;
2164
- const n = o.childNodes;
2165
- for (let i = n.length - 1; i >= 0; i--) {
2166
- const r = n[i];
2167
- this.remove(r.data);
2168
- }
2169
- for (let i = 0, r = l.length; i < r; i++) {
2170
- const s = l[i];
2171
- this.append(s, o.data);
2172
- }
2173
- }
2174
- _setCheckedKeys(t, l = !1, o) {
2175
- const n = this._getAllNodes().sort((f, h) => f.level - h.level), i = /* @__PURE__ */ Object.create(null), r = Object.keys(o);
2176
- n.forEach((f) => f.setChecked(!1, !1));
2177
- const s = (f) => {
2178
- f.childNodes.forEach((h) => {
2179
- var c;
2180
- i[h.data[t]] = !0, (c = h.childNodes) != null && c.length && s(h);
2181
- });
2182
- };
2183
- for (let f = 0, h = n.length; f < h; f++) {
2184
- const c = n[f], m = c.data[t].toString();
2185
- if (!r.includes(m)) {
2186
- c.checked && !i[m] && c.setChecked(!1, !1);
2187
- continue;
2188
- }
2189
- if (c.childNodes.length && s(c), c.isLeaf || this.checkStrictly) {
2190
- c.setChecked(!0, !1);
2191
- continue;
2192
- }
2193
- if (c.setChecked(!0, !0), l) {
2194
- c.setChecked(!1, !1);
2195
- const u = function(g) {
2196
- g.childNodes.forEach((p) => {
2197
- p.isLeaf || p.setChecked(!1, !1), u(p);
2198
- });
2199
- };
2200
- u(c);
2201
- }
2202
- }
2203
- }
2204
- setCheckedNodes(t, l = !1) {
2205
- const o = this.key, n = {};
2206
- t.forEach((i) => {
2207
- n[(i || {})[o]] = !0;
2208
- }), this._setCheckedKeys(o, l, n);
2209
- }
2210
- setCheckedKeys(t, l = !1) {
2211
- this.defaultCheckedKeys = t;
2212
- const o = this.key, n = {};
2213
- t.forEach((i) => {
2214
- n[i] = !0;
2215
- }), this._setCheckedKeys(o, l, n);
2216
- }
2217
- setDefaultExpandedKeys(t) {
2218
- t = t || [], this.defaultExpandedKeys = t, t.forEach((l) => {
2219
- const o = this.getNode(l);
2220
- o && o.expand(null, this.autoExpandParent);
2221
- });
2222
- }
2223
- setChecked(t, l, o) {
2224
- const n = this.getNode(t);
2225
- n && n.setChecked(!!l, o);
2226
- }
2227
- getCurrentNode() {
2228
- return this.currentNode;
2229
- }
2230
- setCurrentNode(t) {
2231
- const l = this.currentNode;
2232
- l && (l.isCurrent = !1), this.currentNode = t, this.currentNode.isCurrent = !0;
2233
- }
2234
- setUserCurrentNode(t, l = !0) {
2235
- var o;
2236
- const n = t[this.key], i = this.nodesMap[n];
2237
- this.setCurrentNode(i), l && this.currentNode && this.currentNode.level > 1 && ((o = this.currentNode.parent) == null || o.expand(null, !0));
2238
- }
2239
- setCurrentNodeKey(t, l = !0) {
2240
- var o;
2241
- if (this.currentNodeKey = t, en(t)) {
2242
- this.currentNode && (this.currentNode.isCurrent = !1), this.currentNode = null;
2243
- return;
2244
- }
2245
- const n = this.getNode(t);
2246
- n && (this.setCurrentNode(n), l && this.currentNode && this.currentNode.level > 1 && ((o = this.currentNode.parent) == null || o.expand(null, !0)));
2247
- }
2248
- }
2249
- var ko = /* @__PURE__ */ oe({
2250
- name: "ElCollapseTransition",
2251
- __name: "collapse-transition",
2252
- setup(e) {
2253
- const t = le("collapse-transition"), l = (n) => {
2254
- n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom;
2255
- }, o = {
2256
- beforeEnter(n) {
2257
- n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.style.height && (n.dataset.elExistsHeight = n.style.height), n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0;
2258
- },
2259
- enter(n) {
2260
- requestAnimationFrame(() => {
2261
- n.dataset.oldOverflow = n.style.overflow, n.dataset.elExistsHeight ? n.style.maxHeight = n.dataset.elExistsHeight : n.scrollHeight !== 0 ? n.style.maxHeight = `${n.scrollHeight}px` : n.style.maxHeight = 0, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom, n.style.overflow = "hidden";
2262
- });
2263
- },
2264
- afterEnter(n) {
2265
- n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow;
2266
- },
2267
- enterCancelled(n) {
2268
- l(n);
2269
- },
2270
- beforeLeave(n) {
2271
- n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.dataset.oldOverflow = n.style.overflow, n.style.maxHeight = `${n.scrollHeight}px`, n.style.overflow = "hidden";
2272
- },
2273
- leave(n) {
2274
- n.scrollHeight !== 0 && (n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0);
2275
- },
2276
- afterLeave(n) {
2277
- l(n);
2278
- },
2279
- leaveCancelled(n) {
2280
- l(n);
2281
- }
2282
- };
2283
- return (n, i) => (D(), W(rl, it({
2284
- name: at(t).b()
2285
- }, dl(o)), {
2286
- default: H(() => [
2287
- j(n.$slots, "default")
2288
- ]),
2289
- _: 3
2290
- /* FORWARDED */
2291
- }, 16, ["name"]));
2292
- }
2293
- });
2294
- const Eo = Qe(ko), So = ft({
2295
- /**
2296
- * @description text type
2297
- */
2298
- type: {
2299
- type: String,
2300
- values: ["primary", "success", "info", "warning", "danger", ""],
2301
- default: ""
2302
- },
2303
- /**
2304
- * @description text size
2305
- */
2306
- size: {
2307
- type: String,
2308
- values: Il,
2309
- default: ""
2310
- },
2311
- /**
2312
- * @description render ellipsis
2313
- */
2314
- truncated: Boolean,
2315
- /**
2316
- * @description maximum lines
2317
- */
2318
- lineClamp: {
2319
- type: [String, Number]
2320
- },
2321
- /**
2322
- * @description custom element tag
2323
- */
2324
- tag: {
2325
- type: String,
2326
- default: "span"
2327
- }
2328
- });
2329
- var wo = /* @__PURE__ */ oe({
2330
- name: "ElText",
2331
- __name: "text",
2332
- props: So,
2333
- setup(e) {
2334
- const t = e, l = V(), o = dn(), n = le("text"), i = w(() => [
2335
- n.b(),
2336
- n.m(t.type),
2337
- n.m(o.value),
2338
- n.is("truncated", t.truncated),
2339
- n.is("line-clamp", !ae(t.lineClamp))
2340
- ]), r = () => {
2341
- var s, f, h, c, m, d, u;
2342
- if (ul().title) return;
2343
- let y = !1;
2344
- const p = ((s = l.value) == null ? void 0 : s.textContent) || "";
2345
- if (t.truncated) {
2346
- const O = (f = l.value) == null ? void 0 : f.offsetWidth, C = (h = l.value) == null ? void 0 : h.scrollWidth;
2347
- O && C && C > O && (y = !0);
2348
- } else if (!ae(t.lineClamp)) {
2349
- const O = (c = l.value) == null ? void 0 : c.offsetHeight, C = (m = l.value) == null ? void 0 : m.scrollHeight;
2350
- O && C && C > O && (y = !0);
2351
- }
2352
- y ? (d = l.value) == null || d.setAttribute("title", p) : (u = l.value) == null || u.removeAttribute("title");
2353
- };
2354
- return Oe(r), an(r), (s, f) => (D(), W(je(e.tag), {
2355
- ref_key: "textRef",
2356
- ref: l,
2357
- class: K(i.value),
2358
- style: Ve({ "-webkit-line-clamp": e.lineClamp })
2359
- }, {
2360
- default: H(() => [
2361
- j(s.$slots, "default")
2362
- ]),
2363
- _: 3
2364
- /* FORWARDED */
2365
- }, 8, ["class", "style"]));
2366
- }
2367
- });
2368
- const Oo = Qe(wo), Lt = "RootTree", Nn = "NodeInstance", sn = "TreeNodeMap";
2369
- var Do = oe({
2370
- name: "ElTreeNodeContent",
2371
- props: {
2372
- node: {
2373
- type: Object,
2374
- required: !0
2375
- },
2376
- renderContent: Function
2377
- },
2378
- setup(e) {
2379
- const t = le("tree"), l = ce(
2380
- Nn
2381
- ), o = ce(Lt);
2382
- return () => {
2383
- const n = e.node, { data: i, store: r } = n;
2384
- return e.renderContent ? e.renderContent(qe, { _self: l, node: n, data: i, store: r }) : j(o.ctx.slots, "default", { node: n, data: i }, () => [
2385
- qe(
2386
- Oo,
2387
- { tag: "span", truncated: !0, class: t.be("node", "label") },
2388
- () => [n.label]
2389
- )
2390
- ]);
2391
- };
2392
- }
2393
- });
2394
- function kn(e) {
2395
- const t = ce(
2396
- sn,
2397
- null
2398
- );
2399
- let l = {
2400
- treeNodeExpand: (o) => {
2401
- var n;
2402
- e.node !== o && ((n = e.node) == null || n.collapse());
2403
- },
2404
- children: /* @__PURE__ */ new Set()
2405
- };
2406
- return t && t.children.add(l), Dt(() => {
2407
- t && t.children.delete(l), l = null;
2408
- }), Se(sn, l), {
2409
- broadcastExpanded: (o) => {
2410
- if (e.accordion)
2411
- for (const n of l.children)
2412
- n.treeNodeExpand(o);
2413
- }
2414
- };
2415
- }
2416
- const En = /* @__PURE__ */ Symbol("dragEvents");
2417
- function Ko({
2418
- props: e,
2419
- ctx: t,
2420
- el$: l,
2421
- dropIndicator$: o,
2422
- store: n
2423
- }) {
2424
- const i = le("tree"), r = V({
2425
- showDropIndicator: !1,
2426
- draggingNode: null,
2427
- dropNode: null,
2428
- allowDrop: !0,
2429
- dropType: null
2430
- });
2431
- return Se(En, {
2432
- treeNodeDragStart: ({ event: c, treeNode: m }) => {
2433
- if (c.dataTransfer) {
2434
- if (ue(e.allowDrag) && !e.allowDrag(m.node))
2435
- return c.preventDefault(), !1;
2436
- c.dataTransfer.effectAllowed = "move";
2437
- try {
2438
- c.dataTransfer.setData("text/plain", "");
2439
- } catch {
2440
- }
2441
- r.value.draggingNode = m, t.emit("node-drag-start", m.node, c);
2442
- }
2443
- },
2444
- treeNodeDragOver: ({ event: c, treeNode: m }) => {
2445
- if (!c.dataTransfer) return;
2446
- const d = m, u = r.value.dropNode;
2447
- u && u.node.id !== d.node.id && mt(u.$el, i.is("drop-inner"));
2448
- const g = r.value.draggingNode;
2449
- if (!g || !d) return;
2450
- let y = !0, p = !0, O = !0, C = !0;
2451
- ue(e.allowDrop) && (y = e.allowDrop(g.node, d.node, "prev"), C = p = e.allowDrop(
2452
- g.node,
2453
- d.node,
2454
- "inner"
2455
- ), O = e.allowDrop(g.node, d.node, "next")), c.dataTransfer.dropEffect = p || y || O ? "move" : "none", (y || p || O) && (u == null ? void 0 : u.node.id) !== d.node.id && (u && t.emit("node-drag-leave", g.node, u.node, c), t.emit("node-drag-enter", g.node, d.node, c)), y || p || O ? r.value.dropNode = d : r.value.dropNode = null, d.node.nextSibling === g.node && (O = !1), d.node.previousSibling === g.node && (y = !1), d.node.contains(g.node, !1) && (p = !1), (g.node === d.node || g.node.contains(d.node)) && (y = !1, p = !1, O = !1);
2456
- const E = d.$el, k = E.querySelector(`.${i.be("node", "content")}`).getBoundingClientRect(), U = l.value.getBoundingClientRect(), ee = l.value.scrollTop;
2457
- let T;
2458
- const ge = y ? p ? 0.25 : O ? 0.45 : 1 : Number.NEGATIVE_INFINITY, S = O ? p ? 0.75 : y ? 0.55 : 0 : Number.POSITIVE_INFINITY;
2459
- let $ = -9999;
2460
- const R = c.clientY - k.top;
2461
- R < k.height * ge ? T = "before" : R > k.height * S ? T = "after" : p ? T = "inner" : T = "none";
2462
- const G = E.querySelector(`.${i.be("node", "expand-icon")}`).getBoundingClientRect(), De = o.value;
2463
- T === "before" ? $ = G.top - U.top + ee : T === "after" && ($ = G.bottom - U.top + ee), De.style.top = `${$}px`, De.style.left = `${G.right - U.left}px`, T === "inner" ? wl(E, i.is("drop-inner")) : mt(E, i.is("drop-inner")), r.value.showDropIndicator = T === "before" || T === "after", r.value.allowDrop = r.value.showDropIndicator || C, r.value.dropType = T, t.emit("node-drag-over", g.node, d.node, c);
2464
- },
2465
- treeNodeDragEnd: (c) => {
2466
- var m, d;
2467
- const { draggingNode: u, dropType: g, dropNode: y } = r.value;
2468
- if (c.preventDefault(), c.dataTransfer && (c.dataTransfer.dropEffect = "move"), u != null && u.node.data && y) {
2469
- const p = { data: u.node.data };
2470
- g !== "none" && u.node.remove(), g === "before" ? (m = y.node.parent) == null || m.insertBefore(p, y.node) : g === "after" ? (d = y.node.parent) == null || d.insertAfter(p, y.node) : g === "inner" && y.node.insertChild(p), g !== "none" && (n.value.registerNode(p), n.value.key && u.node.eachNode((O) => {
2471
- var C;
2472
- (C = n.value.nodesMap[O.data[n.value.key]]) == null || C.setChecked(
2473
- O.checked,
2474
- !n.value.checkStrictly
2475
- );
2476
- })), mt(y.$el, i.is("drop-inner")), t.emit(
2477
- "node-drag-end",
2478
- u.node,
2479
- y.node,
2480
- g,
2481
- c
2482
- ), g !== "none" && t.emit(
2483
- "node-drop",
2484
- u.node,
2485
- y.node,
2486
- g,
2487
- c
2488
- );
2489
- }
2490
- u && !y && t.emit("node-drag-end", u.node, null, g, c), r.value.showDropIndicator = !1, r.value.draggingNode = null, r.value.dropNode = null, r.value.allowDrop = !0;
2491
- }
2492
- }), {
2493
- dragState: r
2494
- };
2495
- }
2496
- var To = oe({
2497
- name: "ElTreeNode",
2498
- components: {
2499
- ElCollapseTransition: Eo,
2500
- ElCheckbox: Yl,
2501
- NodeContent: Do,
2502
- ElIcon: rn,
2503
- Loading: Pl
2504
- },
2505
- props: {
2506
- node: {
2507
- type: ke,
2508
- default: () => ({})
2509
- },
2510
- props: {
2511
- type: Object,
2512
- default: () => ({})
2513
- },
2514
- accordion: Boolean,
2515
- renderContent: Function,
2516
- renderAfterExpand: Boolean,
2517
- showCheckbox: Boolean
2518
- },
2519
- emits: ["node-expand"],
2520
- setup(e, t) {
2521
- const l = le("tree"), { broadcastExpanded: o } = kn(e), n = ce(Lt), i = V(!1), r = V(!1), s = V(), f = V(), h = V(), c = ce(En), m = we();
2522
- Se(Nn, m), n || bt("Tree", "Can not find node's tree."), e.node.expanded && (i.value = !0, r.value = !0);
2523
- const d = n.props.props.children || "children";
2524
- P(
2525
- () => {
2526
- var S;
2527
- const $ = (S = e.node.data) == null ? void 0 : S[d];
2528
- return $ && [...$];
2529
- },
2530
- () => {
2531
- e.node.updateChildren();
2532
- }
2533
- ), P(
2534
- () => e.node.indeterminate,
2535
- (S) => {
2536
- y(e.node.checked, S);
2537
- }
2538
- ), P(
2539
- () => e.node.checked,
2540
- (S) => {
2541
- y(S, e.node.indeterminate);
2542
- }
2543
- ), P(
2544
- () => e.node.childNodes.length,
2545
- () => e.node.reInitChecked()
2546
- ), P(
2547
- () => e.node.expanded,
2548
- (S) => {
2549
- q(() => i.value = S), S && (r.value = !0);
2550
- }
2551
- );
2552
- const u = (S) => Vt(n.props.nodeKey, S.data), g = (S) => {
2553
- const $ = e.props.class;
2554
- if (!$)
2555
- return {};
2556
- let R;
2557
- if (ue($)) {
2558
- const { data: G } = S;
2559
- R = $(G, S);
2560
- } else
2561
- R = $;
2562
- return Kt(R) ? { [R]: !0 } : R;
2563
- }, y = (S, $) => {
2564
- (s.value !== S || f.value !== $) && n.ctx.emit("check-change", e.node.data, S, $), s.value = S, f.value = $;
2565
- }, p = (S) => {
2566
- St(n.store, n.ctx.emit, () => {
2567
- var $;
2568
- if (($ = n == null ? void 0 : n.props) == null ? void 0 : $.nodeKey) {
2569
- const G = u(e.node);
2570
- n.store.value.setCurrentNodeKey(G);
2571
- } else
2572
- n.store.value.setCurrentNode(e.node);
2573
- }), n.currentNode.value = e.node, n.props.expandOnClickNode && C(), (n.props.checkOnClickNode || e.node.isLeaf && n.props.checkOnClickLeaf && e.showCheckbox) && !e.node.disabled && E(!e.node.checked), n.ctx.emit("node-click", e.node.data, e.node, m, S);
2574
- }, O = (S) => {
2575
- var $;
2576
- ($ = n.instance.vnode.props) != null && $.onNodeContextmenu && (S.stopPropagation(), S.preventDefault()), n.ctx.emit(
2577
- "node-contextmenu",
2578
- S,
2579
- e.node.data,
2580
- e.node,
2581
- m
2582
- );
2583
- }, C = () => {
2584
- e.node.isLeaf || (i.value ? (n.ctx.emit("node-collapse", e.node.data, e.node, m), e.node.collapse()) : e.node.expand(() => {
2585
- t.emit("node-expand", e.node.data, e.node, m);
2586
- }));
2587
- }, E = (S) => {
2588
- const $ = n == null ? void 0 : n.props.checkStrictly, R = e.node.childNodes;
2589
- !$ && R.length && (S = R.some((G) => !G.isEffectivelyChecked)), e.node.setChecked(S, !$), q(() => {
2590
- const G = n.store.value;
2591
- n.ctx.emit("check", e.node.data, {
2592
- checkedNodes: G.getCheckedNodes(),
2593
- checkedKeys: G.getCheckedKeys(),
2594
- halfCheckedNodes: G.getHalfCheckedNodes(),
2595
- halfCheckedKeys: G.getHalfCheckedKeys()
2596
- });
2597
- });
2598
- };
2599
- return {
2600
- ns: l,
2601
- node$: h,
2602
- tree: n,
2603
- expanded: i,
2604
- childNodeRendered: r,
2605
- oldChecked: s,
2606
- oldIndeterminate: f,
2607
- getNodeKey: u,
2608
- getNodeClass: g,
2609
- handleSelectChange: y,
2610
- handleClick: p,
2611
- handleContextMenu: O,
2612
- handleExpandIconClick: C,
2613
- handleCheckChange: E,
2614
- handleChildNodeExpand: (S, $, R) => {
2615
- o($), n.ctx.emit("node-expand", S, $, R);
2616
- },
2617
- handleDragStart: (S) => {
2618
- n.props.draggable && c.treeNodeDragStart({ event: S, treeNode: e });
2619
- },
2620
- handleDragOver: (S) => {
2621
- S.preventDefault(), n.props.draggable && c.treeNodeDragOver({
2622
- event: S,
2623
- treeNode: { $el: h.value, node: e.node }
2624
- });
2625
- },
2626
- handleDrop: (S) => {
2627
- S.preventDefault();
2628
- },
2629
- handleDragEnd: (S) => {
2630
- n.props.draggable && c.treeNodeDragEnd(S);
2631
- },
2632
- CaretRight: Al
2633
- };
2634
- }
2635
- });
2636
- const Io = ["aria-expanded", "aria-disabled", "aria-checked", "draggable", "data-key"], $o = ["aria-expanded"];
2637
- function Vo(e, t, l, o, n, i) {
2638
- const r = X("el-icon"), s = X("el-checkbox"), f = X("loading"), h = X("node-content"), c = X("el-tree-node"), m = X("el-collapse-transition");
2639
- return Ee((D(), M("div", {
2640
- ref: "node$",
2641
- class: K([
2642
- e.ns.b("node"),
2643
- e.ns.is("expanded", e.expanded),
2644
- e.ns.is("current", e.node.isCurrent),
2645
- e.ns.is("hidden", !e.node.visible),
2646
- e.ns.is("focusable", !e.node.disabled),
2647
- e.ns.is("checked", !e.node.disabled && e.node.checked),
2648
- e.getNodeClass(e.node)
2649
- ]),
2650
- role: "treeitem",
2651
- tabindex: "-1",
2652
- "aria-expanded": e.expanded,
2653
- "aria-disabled": e.node.disabled,
2654
- "aria-checked": e.node.checked,
2655
- draggable: e.tree.props.draggable,
2656
- "data-key": e.getNodeKey(e.node),
2657
- onClick: t[2] || (t[2] = ne((...d) => e.handleClick && e.handleClick(...d), ["stop"])),
2658
- onContextmenu: t[3] || (t[3] = (...d) => e.handleContextMenu && e.handleContextMenu(...d)),
2659
- onDragstart: t[4] || (t[4] = ne((...d) => e.handleDragStart && e.handleDragStart(...d), ["stop"])),
2660
- onDragover: t[5] || (t[5] = ne((...d) => e.handleDragOver && e.handleDragOver(...d), ["stop"])),
2661
- onDragend: t[6] || (t[6] = ne((...d) => e.handleDragEnd && e.handleDragEnd(...d), ["stop"])),
2662
- onDrop: t[7] || (t[7] = ne((...d) => e.handleDrop && e.handleDrop(...d), ["stop"]))
2663
- }, [
2664
- F(
2665
- "div",
2666
- {
2667
- class: K(e.ns.be("node", "content")),
2668
- style: Ve({ paddingLeft: (e.node.level - 1) * e.tree.props.indent + "px" })
2669
- },
2670
- [
2671
- e.tree.props.icon || e.CaretRight ? (D(), W(r, {
2672
- key: 0,
2673
- class: K([
2674
- e.ns.be("node", "expand-icon"),
2675
- e.ns.is("leaf", e.node.isLeaf),
2676
- {
2677
- expanded: !e.node.isLeaf && e.expanded
2678
- }
2679
- ]),
2680
- onClick: ne(e.handleExpandIconClick, ["stop"])
2681
- }, {
2682
- default: H(() => [
2683
- (D(), W(je(e.tree.props.icon || e.CaretRight)))
2684
- ]),
2685
- _: 1
2686
- /* STABLE */
2687
- }, 8, ["class", "onClick"])) : z("v-if", !0),
2688
- e.showCheckbox ? (D(), W(s, {
2689
- key: 1,
2690
- "model-value": e.node.checked,
2691
- indeterminate: e.node.indeterminate,
2692
- disabled: !!e.node.disabled,
2693
- onClick: t[0] || (t[0] = ne(() => {
2694
- }, ["stop"])),
2695
- onChange: e.handleCheckChange
2696
- }, null, 8, ["model-value", "indeterminate", "disabled", "onChange"])) : z("v-if", !0),
2697
- e.node.loading ? (D(), W(r, {
2698
- key: 2,
2699
- class: K([e.ns.be("node", "loading-icon"), e.ns.is("loading")])
2700
- }, {
2701
- default: H(() => [
2702
- re(f)
2703
- ]),
2704
- _: 1
2705
- /* STABLE */
2706
- }, 8, ["class"])) : z("v-if", !0),
2707
- re(h, {
2708
- node: e.node,
2709
- "render-content": e.renderContent
2710
- }, null, 8, ["node", "render-content"])
2711
- ],
2712
- 6
2713
- /* CLASS, STYLE */
2714
- ),
2715
- re(m, null, {
2716
- default: H(() => [
2717
- !e.renderAfterExpand || e.childNodeRendered ? Ee((D(), M("div", {
2718
- key: 0,
2719
- class: K(e.ns.be("node", "children")),
2720
- role: "group",
2721
- "aria-expanded": e.expanded,
2722
- onClick: t[1] || (t[1] = ne(() => {
2723
- }, ["stop"]))
2724
- }, [
2725
- (D(!0), M(
2726
- Ne,
2727
- null,
2728
- Ie(e.node.childNodes, (d) => (D(), W(c, {
2729
- key: e.getNodeKey(d),
2730
- "render-content": e.renderContent,
2731
- "render-after-expand": e.renderAfterExpand,
2732
- "show-checkbox": e.showCheckbox,
2733
- node: d,
2734
- accordion: e.accordion,
2735
- props: e.props,
2736
- onNodeExpand: e.handleChildNodeExpand
2737
- }, null, 8, ["render-content", "render-after-expand", "show-checkbox", "node", "accordion", "props", "onNodeExpand"]))),
2738
- 128
2739
- /* KEYED_FRAGMENT */
2740
- ))
2741
- ], 10, $o)), [
2742
- [Me, e.expanded]
2743
- ]) : z("v-if", !0)
2744
- ]),
2745
- _: 1
2746
- /* STABLE */
2747
- })
2748
- ], 42, Io)), [
2749
- [Me, e.node.visible]
2750
- ]);
2751
- }
2752
- var Lo = /* @__PURE__ */ Be(To, [["render", Vo]]);
2753
- function Mo({ el$: e }, t) {
2754
- const l = le("tree");
2755
- Oe(() => {
2756
- i();
2757
- }), an(() => {
2758
- var r;
2759
- (r = e.value) == null || r.querySelectorAll("input[type=checkbox]").forEach((s) => {
2760
- s.setAttribute("tabindex", "-1");
2761
- });
2762
- });
2763
- function o(r, s) {
2764
- var f, h;
2765
- const c = t.value.getNode(r[s].dataset.key);
2766
- return c.canFocus && c.visible && (((f = c.parent) == null ? void 0 : f.expanded) || ((h = c.parent) == null ? void 0 : h.level) === 0);
2767
- }
2768
- vn(e, "keydown", (r) => {
2769
- const s = r.target;
2770
- if (!s.className.includes(l.b("node"))) return;
2771
- const f = ct(r), h = Array.from(
2772
- e.value.querySelectorAll(`.${l.is("focusable")}[role=treeitem]`)
2773
- ), c = h.indexOf(s);
2774
- let m;
2775
- if ([A.up, A.down].includes(f)) {
2776
- if (r.preventDefault(), f === A.up) {
2777
- m = c === -1 ? 0 : c !== 0 ? c - 1 : h.length - 1;
2778
- const u = m;
2779
- for (; !o(h, m); ) {
2780
- if (m--, m === u) {
2781
- m = -1;
2782
- break;
2783
- }
2784
- m < 0 && (m = h.length - 1);
2785
- }
2786
- } else {
2787
- m = c === -1 ? 0 : c < h.length - 1 ? c + 1 : 0;
2788
- const u = m;
2789
- for (; !o(h, m); ) {
2790
- if (m++, m === u) {
2791
- m = -1;
2792
- break;
2793
- }
2794
- m >= h.length && (m = 0);
2795
- }
2796
- }
2797
- m !== -1 && h[m].focus();
2798
- }
2799
- [A.left, A.right].includes(f) && (r.preventDefault(), s.click());
2800
- const d = s.querySelector(
2801
- '[type="checkbox"]'
2802
- );
2803
- [A.enter, A.numpadEnter, A.space].includes(
2804
- f
2805
- ) && d && (r.preventDefault(), d.click());
2806
- });
2807
- const i = () => {
2808
- var r;
2809
- if (!e.value) return;
2810
- const s = Array.from(
2811
- e.value.querySelectorAll(`.${l.is("focusable")}[role=treeitem]`)
2812
- );
2813
- Array.from(
2814
- e.value.querySelectorAll("input[type=checkbox]")
2815
- ).forEach((c) => {
2816
- c.setAttribute("tabindex", "-1");
2817
- });
2818
- const h = e.value.querySelectorAll(
2819
- `.${l.is("checked")}[role=treeitem]`
2820
- );
2821
- if (h.length) {
2822
- h[0].setAttribute("tabindex", "0");
2823
- return;
2824
- }
2825
- (r = s[0]) == null || r.setAttribute("tabindex", "0");
2826
- };
2827
- }
2828
- const Sn = ft({
2829
- data: {
2830
- type: _(Array),
2831
- default: () => []
2832
- },
2833
- emptyText: {
2834
- type: String
2835
- },
2836
- renderAfterExpand: {
2837
- type: Boolean,
2838
- default: !0
2839
- },
2840
- nodeKey: String,
2841
- checkStrictly: Boolean,
2842
- defaultExpandAll: Boolean,
2843
- expandOnClickNode: {
2844
- type: Boolean,
2845
- default: !0
2846
- },
2847
- checkOnClickNode: Boolean,
2848
- checkOnClickLeaf: {
2849
- type: Boolean,
2850
- default: !0
2851
- },
2852
- checkDescendants: Boolean,
2853
- autoExpandParent: {
2854
- type: Boolean,
2855
- default: !0
2856
- },
2857
- defaultCheckedKeys: {
2858
- type: Array
2859
- },
2860
- defaultExpandedKeys: {
2861
- type: Array
2862
- },
2863
- currentNodeKey: {
2864
- type: [String, Number]
2865
- },
2866
- renderContent: {
2867
- type: _(Function)
2868
- },
2869
- showCheckbox: Boolean,
2870
- draggable: Boolean,
2871
- allowDrag: {
2872
- type: _(Function)
2873
- },
2874
- allowDrop: {
2875
- type: _(Function)
2876
- },
2877
- props: {
2878
- type: Object,
2879
- default: () => ({
2880
- children: "children",
2881
- label: "label",
2882
- disabled: "disabled"
2883
- })
2884
- },
2885
- lazy: Boolean,
2886
- highlightCurrent: Boolean,
2887
- load: {
2888
- type: Function
2889
- },
2890
- filterNodeMethod: {
2891
- type: Function
2892
- },
2893
- accordion: Boolean,
2894
- indent: {
2895
- type: Number,
2896
- default: 18
2897
- },
2898
- icon: {
2899
- type: kt
2900
- }
2901
- }), Bo = {
2902
- "check-change": (e, t, l) => e && Ct(t) && Ct(l),
2903
- "current-change": (e, t) => !0,
2904
- "node-click": (e, t, l, o) => e && t && o instanceof Event,
2905
- "node-contextmenu": (e, t, l, o) => e instanceof Event && t && l,
2906
- "node-collapse": (e, t, l) => e && t,
2907
- "node-expand": (e, t, l) => e && t,
2908
- check: (e, t) => e && t,
2909
- "node-drag-start": (e, t) => e && t,
2910
- "node-drag-end": (e, t, l, o) => e && o,
2911
- "node-drop": (e, t, l, o) => e && t && o,
2912
- "node-drag-leave": (e, t, l) => e && t && l,
2913
- "node-drag-enter": (e, t, l) => e && t && l,
2914
- "node-drag-over": (e, t, l) => e && t && l
2915
- };
2916
- var Po = oe({
2917
- name: "ElTree",
2918
- components: { ElTreeNode: Lo },
2919
- props: Sn,
2920
- emits: Bo,
2921
- setup(e, t) {
2922
- const { t: l } = gn(), o = le("tree"), n = V(
2923
- new No({
2924
- key: e.nodeKey,
2925
- data: e.data,
2926
- lazy: e.lazy,
2927
- props: e.props,
2928
- load: e.load,
2929
- currentNodeKey: e.currentNodeKey,
2930
- checkStrictly: e.checkStrictly,
2931
- checkDescendants: e.checkDescendants,
2932
- defaultCheckedKeys: e.defaultCheckedKeys,
2933
- defaultExpandedKeys: e.defaultExpandedKeys,
2934
- autoExpandParent: e.autoExpandParent,
2935
- defaultExpandAll: e.defaultExpandAll,
2936
- filterNodeMethod: e.filterNodeMethod
2937
- })
2938
- );
2939
- n.value.initialize();
2940
- const i = V(n.value.root), r = V(null), s = V(null), f = V(null), { broadcastExpanded: h } = kn(e), { dragState: c } = Ko({
2941
- props: e,
2942
- ctx: t,
2943
- el$: s,
2944
- dropIndicator$: f,
2945
- store: n
2946
- });
2947
- Mo({ el$: s }, n);
2948
- const m = we(), d = w(() => {
2949
- let b = m == null ? void 0 : m.parent;
2950
- for (; b; ) {
2951
- if (b.type.name === "ElTreeSelect")
2952
- return !0;
2953
- b = b.parent;
2954
- }
2955
- return !1;
2956
- }), u = w(() => {
2957
- const { childNodes: b } = i.value;
2958
- return (!b || b.length === 0 || b.every(({ visible: I }) => !I)) && !d.value;
2959
- });
2960
- P(
2961
- () => e.currentNodeKey,
2962
- (b) => {
2963
- n.value.setCurrentNodeKey(b ?? null);
2964
- }
2965
- ), P(
2966
- () => e.defaultCheckedKeys,
2967
- (b, I) => {
2968
- ve(b, I) || n.value.setDefaultCheckedKey(b ?? []);
2969
- }
2970
- ), P(
2971
- () => e.defaultExpandedKeys,
2972
- (b) => {
2973
- n.value.setDefaultExpandedKeys(b ?? []);
2974
- }
2975
- ), P(
2976
- () => e.data,
2977
- (b) => {
2978
- n.value.setData(b);
2979
- },
2980
- { deep: !0 }
2981
- ), P(
2982
- () => e.checkStrictly,
2983
- (b) => {
2984
- n.value.checkStrictly = b;
2985
- }
2986
- );
2987
- const g = (b) => {
2988
- if (!e.filterNodeMethod)
2989
- throw new Error("[Tree] filterNodeMethod is required when filter");
2990
- n.value.filter(b);
2991
- }, y = (b) => Vt(e.nodeKey, b.data), p = (b) => {
2992
- if (!e.nodeKey)
2993
- throw new Error(`[Tree] nodeKey is required in ${b}`);
2994
- }, O = (b) => {
2995
- p("getNodePath");
2996
- const I = n.value.getNode(b);
2997
- if (!I) return [];
2998
- const fe = [I.data];
2999
- let me = I.parent;
3000
- for (; me && me !== i.value; )
3001
- fe.push(me.data), me = me.parent;
3002
- return fe.reverse();
3003
- }, C = (b, I) => n.value.getCheckedNodes(b, I), E = (b) => n.value.getCheckedKeys(b), k = () => {
3004
- const b = n.value.getCurrentNode();
3005
- return b ? b.data : null;
3006
- }, U = () => {
3007
- p("getCurrentKey");
3008
- const b = k();
3009
- return b ? b[e.nodeKey] : null;
3010
- }, ee = (b, I) => {
3011
- p("setCheckedNodes"), n.value.setCheckedNodes(b, I);
3012
- }, T = (b, I) => {
3013
- p("setCheckedKeys"), n.value.setCheckedKeys(b, I);
3014
- }, ge = (b, I, fe) => {
3015
- n.value.setChecked(b, I, fe);
3016
- }, S = () => n.value.getHalfCheckedNodes(), $ = () => n.value.getHalfCheckedKeys(), R = (b, I = !0) => {
3017
- p("setCurrentNode"), St(n, t.emit, () => {
3018
- h(b), n.value.setUserCurrentNode(b, I);
3019
- });
3020
- }, G = (b = null, I = !0) => {
3021
- p("setCurrentKey"), St(n, t.emit, () => {
3022
- h(), n.value.setCurrentNodeKey(b, I);
3023
- });
3024
- }, De = (b) => n.value.getNode(b), ht = (b) => {
3025
- n.value.remove(b);
3026
- }, ye = (b, I) => {
3027
- n.value.append(b, I);
3028
- }, Ze = (b, I) => {
3029
- n.value.insertBefore(b, I);
3030
- }, Pe = (b, I) => {
3031
- n.value.insertAfter(b, I);
3032
- }, pt = (b, I, fe) => {
3033
- h(I), t.emit("node-expand", b, I, fe);
3034
- }, Ae = (b, I) => {
3035
- p("updateKeyChild"), n.value.updateChildren(b, I);
3036
- };
3037
- return Se(Lt, {
3038
- ctx: t,
3039
- props: e,
3040
- store: n,
3041
- root: i,
3042
- currentNode: r,
3043
- instance: m
3044
- }), Se($l, void 0), {
3045
- ns: o,
3046
- // ref
3047
- store: n,
3048
- root: i,
3049
- currentNode: r,
3050
- dragState: c,
3051
- el$: s,
3052
- dropIndicator$: f,
3053
- // computed
3054
- isEmpty: u,
3055
- // methods
3056
- filter: g,
3057
- getNodeKey: y,
3058
- getNodePath: O,
3059
- getCheckedNodes: C,
3060
- getCheckedKeys: E,
3061
- getCurrentNode: k,
3062
- getCurrentKey: U,
3063
- setCheckedNodes: ee,
3064
- setCheckedKeys: T,
3065
- setChecked: ge,
3066
- getHalfCheckedNodes: S,
3067
- getHalfCheckedKeys: $,
3068
- setCurrentNode: R,
3069
- setCurrentKey: G,
3070
- t: l,
3071
- getNode: De,
3072
- remove: ht,
3073
- append: ye,
3074
- insertBefore: Ze,
3075
- insertAfter: Pe,
3076
- handleNodeExpand: pt,
3077
- updateKeyChildren: Ae
3078
- };
3079
- }
3080
- });
3081
- function Ao(e, t, l, o, n, i) {
3082
- const r = X("el-tree-node");
3083
- return D(), M(
3084
- "div",
3085
- {
3086
- ref: "el$",
3087
- class: K([
3088
- e.ns.b(),
3089
- e.ns.is("dragging", !!e.dragState.draggingNode),
3090
- e.ns.is("drop-not-allow", !e.dragState.allowDrop),
3091
- e.ns.is("drop-inner", e.dragState.dropType === "inner"),
3092
- { [e.ns.m("highlight-current")]: e.highlightCurrent }
3093
- ]),
3094
- role: "tree"
3095
- },
3096
- [
3097
- (D(!0), M(
3098
- Ne,
3099
- null,
3100
- Ie(e.root.childNodes, (s) => (D(), W(r, {
3101
- key: e.getNodeKey(s),
3102
- node: s,
3103
- props: e.props,
3104
- accordion: e.accordion,
3105
- "render-after-expand": e.renderAfterExpand,
3106
- "show-checkbox": e.showCheckbox,
3107
- "render-content": e.renderContent,
3108
- onNodeExpand: e.handleNodeExpand
3109
- }, null, 8, ["node", "props", "accordion", "render-after-expand", "show-checkbox", "render-content", "onNodeExpand"]))),
3110
- 128
3111
- /* KEYED_FRAGMENT */
3112
- )),
3113
- e.isEmpty ? (D(), M(
3114
- "div",
3115
- {
3116
- key: 0,
3117
- class: K(e.ns.e("empty-block"))
3118
- },
3119
- [
3120
- j(e.$slots, "empty", {}, () => {
3121
- var s;
3122
- return [
3123
- F(
3124
- "span",
3125
- {
3126
- class: K(e.ns.e("empty-text"))
3127
- },
3128
- ie((s = e.emptyText) != null ? s : e.t("el.tree.emptyText")),
3129
- 3
3130
- /* TEXT, CLASS */
3131
- )
3132
- ];
3133
- })
3134
- ],
3135
- 2
3136
- /* CLASS */
3137
- )) : z("v-if", !0),
3138
- Ee(F(
3139
- "div",
3140
- {
3141
- ref: "dropIndicator$",
3142
- class: K(e.ns.e("drop-indicator"))
3143
- },
3144
- null,
3145
- 2
3146
- /* CLASS */
3147
- ), [
3148
- [Me, e.dragState.showDropIndicator]
3149
- ])
3150
- ],
3151
- 2
3152
- /* CLASS */
3153
- );
3154
- }
3155
- var Ro = /* @__PURE__ */ Be(Po, [["render", Ao]]);
3156
- const wn = Qe(Ro), Ho = (e, { attrs: t, emit: l }, {
3157
- select: o,
3158
- tree: n,
3159
- key: i
3160
- }) => {
3161
- const r = le("tree-select");
3162
- P(
3163
- () => e.data,
3164
- () => {
3165
- e.filterable && q(() => {
3166
- var h, c;
3167
- (c = n.value) == null || c.filter((h = o.value) == null ? void 0 : h.states.inputValue);
3168
- });
3169
- },
3170
- { flush: "post" }
3171
- );
3172
- const s = (h) => {
3173
- var c;
3174
- const m = h.at(-1);
3175
- if (m.expanded && m.childNodes.at(-1))
3176
- s([m.childNodes.at(-1)]);
3177
- else {
3178
- const d = (c = n.value.el$) == null ? void 0 : c.querySelector(
3179
- `[data-key="${h.at(-1).key}"]`
3180
- );
3181
- d == null || d.focus({ preventScroll: !0 });
3182
- return;
3183
- }
3184
- };
3185
- return Oe(() => {
3186
- vn(
3187
- () => {
3188
- var h;
3189
- return (h = o.value) == null ? void 0 : h.$el;
3190
- },
3191
- "keydown",
3192
- async (h) => {
3193
- const c = ct(h), { dropdownMenuVisible: m } = o.value;
3194
- [A.down, A.up].includes(c) && m && (await q(), setTimeout(() => {
3195
- var d, u, g;
3196
- if (A.up === c) {
3197
- const y = n.value.store.root.childNodes;
3198
- s(y);
3199
- return;
3200
- }
3201
- (g = (u = (d = o.value.optionsArray[o.value.states.hoveringIndex].$el) == null ? void 0 : d.parentNode) == null ? void 0 : u.parentNode) == null || g.focus({ preventScroll: !0 });
3202
- }));
3203
- },
3204
- {
3205
- capture: !0
3206
- }
3207
- );
3208
- }), {
3209
- ...ut(Ye(e), Object.keys(bn.props)),
3210
- ...t,
3211
- class: w(() => t.class),
3212
- style: w(() => t.style),
3213
- // attrs is not reactive, when v-model binding source changes,
3214
- // this listener is still old, see the bug(or test 'v-model source change'):
3215
- // https://github.com/element-plus/element-plus/issues/14204
3216
- "onUpdate:modelValue": (h) => l(se, h),
3217
- valueKey: i,
3218
- popperClass: w(() => {
3219
- const h = [r.e("popper")];
3220
- return e.popperClass && h.push(e.popperClass), h.join(" ");
3221
- }),
3222
- filterMethod: (h = "") => {
3223
- var c;
3224
- e.filterMethod ? e.filterMethod(h) : e.remoteMethod ? e.remoteMethod(h) : (c = n.value) == null || c.filter(h);
3225
- }
3226
- };
3227
- }, Fo = oe({
3228
- extends: ln,
3229
- setup(e, t) {
3230
- const l = ln.setup(e, t);
3231
- delete l.selectOptionClick;
3232
- const o = we().proxy;
3233
- return q(() => {
3234
- l.select.states.cachedOptions.get(o.value) || l.select.onOptionCreate(o);
3235
- }), P(
3236
- () => t.attrs.visible,
3237
- (n) => {
3238
- q(() => {
3239
- l.states.visible = n;
3240
- });
3241
- },
3242
- {
3243
- immediate: !0
3244
- }
3245
- ), l;
3246
- },
3247
- methods: {
3248
- selectOptionClick() {
3249
- this.$el.parentElement.click();
3250
- }
3251
- }
3252
- });
3253
- function Ot(e) {
3254
- return e || e === 0;
3255
- }
3256
- function Mt(e) {
3257
- return Q(e) && e.length;
3258
- }
3259
- function Ke(e) {
3260
- return Q(e) ? e : Ot(e) ? [e] : [];
3261
- }
3262
- function rt(e, t, l, o, n) {
3263
- for (let i = 0; i < e.length; i++) {
3264
- const r = e[i];
3265
- if (t(r, i, e, n))
3266
- return o ? o(r, i, e, n) : r;
3267
- {
3268
- const s = l(r);
3269
- if (Mt(s)) {
3270
- const f = rt(
3271
- s,
3272
- t,
3273
- l,
3274
- o,
3275
- r
3276
- );
3277
- if (f) return f;
3278
- }
3279
- }
3280
- }
3281
- }
3282
- function dt(e, t, l, o) {
3283
- for (let n = 0; n < e.length; n++) {
3284
- const i = e[n];
3285
- t(i, n, e, o);
3286
- const r = l(i);
3287
- Mt(r) && dt(r, t, l, i);
3288
- }
3289
- }
3290
- const zo = (e, { attrs: t, slots: l, emit: o }, {
3291
- select: n,
3292
- tree: i,
3293
- key: r
3294
- }) => {
3295
- P(
3296
- [() => e.modelValue, i],
3297
- () => {
3298
- e.showCheckbox && q(() => {
3299
- const d = i.value;
3300
- d && !ve(
3301
- d.getCheckedKeys(),
3302
- Ke(e.modelValue)
3303
- ) && d.setCheckedKeys(Ke(e.modelValue));
3304
- });
3305
- },
3306
- {
3307
- immediate: !0,
3308
- deep: !0
3309
- }
3310
- );
3311
- const s = w(() => ({
3312
- value: r.value,
3313
- label: "label",
3314
- children: "children",
3315
- disabled: "disabled",
3316
- isLeaf: "isLeaf",
3317
- ...e.props
3318
- })), f = (d, u) => {
3319
- var g;
3320
- const y = s.value[d];
3321
- return ue(y) ? y(
3322
- u,
3323
- (g = i.value) == null ? void 0 : g.getNode(f("value", u))
3324
- ) : u[y];
3325
- }, h = Ke(e.modelValue).map((d) => rt(
3326
- e.data || [],
3327
- (u) => f("value", u) === d,
3328
- (u) => f("children", u),
3329
- (u, g, y, p) => p && f("value", p)
3330
- )).filter((d) => Ot(d)), c = w(() => {
3331
- if (!e.renderAfterExpand && !e.lazy) return [];
3332
- const d = [];
3333
- return dt(
3334
- e.data.concat(e.cacheData),
3335
- (u) => {
3336
- const g = f("value", u);
3337
- d.push({
3338
- value: g,
3339
- currentLabel: f("label", u),
3340
- isDisabled: f("disabled", u)
3341
- });
3342
- },
3343
- (u) => f("children", u)
3344
- ), d;
3345
- }), m = () => {
3346
- var d;
3347
- return (d = i.value) == null ? void 0 : d.getCheckedKeys().filter((u) => {
3348
- var g;
3349
- const y = (g = i.value) == null ? void 0 : g.getNode(u);
3350
- return !Ue(y) && un(y.childNodes);
3351
- });
3352
- };
3353
- return {
3354
- ...ut(Ye(e), Object.keys(wn.props)),
3355
- ...t,
3356
- nodeKey: r,
3357
- // only expand on click node when the `check-strictly` is false
3358
- expandOnClickNode: w(() => !e.checkStrictly && e.expandOnClickNode),
3359
- // show current selected node only first time,
3360
- // fix the problem of expanding multiple nodes when checking multiple nodes
3361
- defaultExpandedKeys: w(() => e.defaultExpandedKeys ? e.defaultExpandedKeys.concat(h) : h),
3362
- renderContent: (d, { node: u, data: g, store: y }) => d(
3363
- Fo,
3364
- {
3365
- value: f("value", g),
3366
- label: f("label", g),
3367
- disabled: f("disabled", g),
3368
- visible: u.visible
3369
- },
3370
- e.renderContent ? () => e.renderContent(d, { node: u, data: g, store: y }) : l.default ? () => l.default({ node: u, data: g, store: y }) : void 0
3371
- ),
3372
- filterNodeMethod: (d, u, g) => e.filterNodeMethod ? e.filterNodeMethod(d, u, g) : d ? new RegExp(fn(d), "i").test(f("label", u) || "") : !0,
3373
- onNodeClick: (d, u, g) => {
3374
- var y, p, O;
3375
- if ((y = t.onNodeClick) == null || y.call(t, d, u, g), !(e.showCheckbox && e.checkOnClickNode))
3376
- if (!e.showCheckbox && (e.checkStrictly || u.isLeaf)) {
3377
- if (!f("disabled", d)) {
3378
- const C = (p = n.value) == null ? void 0 : p.states.options.get(
3379
- f("value", d)
3380
- );
3381
- (O = n.value) == null || O.handleOptionSelect(C);
3382
- }
3383
- } else e.expandOnClickNode && g.proxy.handleExpandIconClick();
3384
- },
3385
- onCheck: (d, u) => {
3386
- var g;
3387
- if (!e.showCheckbox) return;
3388
- const y = f("value", d), p = {};
3389
- dt(
3390
- [i.value.store.root],
3391
- (k) => p[k.key] = k,
3392
- (k) => k.childNodes
3393
- );
3394
- const O = u.checkedKeys, C = e.multiple ? Ke(e.modelValue).filter(
3395
- (k) => !(k in p) && !O.includes(k)
3396
- ) : [], E = C.concat(O);
3397
- if (e.checkStrictly)
3398
- o(
3399
- se,
3400
- // Checking for changes may come from `check-on-node-click`
3401
- e.multiple ? E : E.includes(y) ? y : void 0
3402
- );
3403
- else if (e.multiple) {
3404
- const k = m();
3405
- o(se, C.concat(k));
3406
- } else {
3407
- const k = rt(
3408
- [d],
3409
- (T) => !Mt(f("children", T)) && !f("disabled", T),
3410
- (T) => f("children", T)
3411
- ), U = k ? f("value", k) : void 0, ee = Ot(e.modelValue) && !!rt(
3412
- [d],
3413
- (T) => f("value", T) === e.modelValue,
3414
- (T) => f("children", T)
3415
- );
3416
- o(
3417
- se,
3418
- U === e.modelValue || ee ? void 0 : U
3419
- );
3420
- }
3421
- q(() => {
3422
- var k;
3423
- const U = Ke(e.modelValue);
3424
- i.value.setCheckedKeys(U), (k = t.onCheck) == null || k.call(t, d, {
3425
- checkedKeys: i.value.getCheckedKeys(),
3426
- checkedNodes: i.value.getCheckedNodes(),
3427
- halfCheckedKeys: i.value.getHalfCheckedKeys(),
3428
- halfCheckedNodes: i.value.getHalfCheckedNodes()
3429
- });
3430
- }), (g = n.value) == null || g.focus();
3431
- },
3432
- onNodeExpand: (d, u, g) => {
3433
- var y;
3434
- (y = t.onNodeExpand) == null || y.call(t, d, u, g), q(() => {
3435
- if (!e.checkStrictly && e.lazy && e.multiple && u.checked) {
3436
- const p = {}, O = i.value.getCheckedKeys();
3437
- dt(
3438
- [i.value.store.root],
3439
- (k) => p[k.key] = k,
3440
- (k) => k.childNodes
3441
- );
3442
- const C = Ke(e.modelValue).filter(
3443
- (k) => !(k in p) && !O.includes(k)
3444
- ), E = m();
3445
- o(se, C.concat(E));
3446
- }
3447
- });
3448
- },
3449
- // else
3450
- cacheOptions: c
3451
- };
3452
- };
3453
- var Wo = oe({
3454
- props: {
3455
- data: {
3456
- type: Array,
3457
- default: () => []
3458
- }
3459
- },
3460
- setup(e) {
3461
- const t = ce(Je);
3462
- return P(
3463
- () => e.data,
3464
- () => {
3465
- var l;
3466
- e.data.forEach((n) => {
3467
- t.states.cachedOptions.has(n.value) || t.states.cachedOptions.set(n.value, n);
3468
- });
3469
- const o = ((l = t.selectRef) == null ? void 0 : l.querySelectorAll("input")) || [];
3470
- Tt && !Array.from(o).includes(
3471
- document.activeElement
3472
- ) && t.setSelected();
3473
- },
3474
- { flush: "post", immediate: !0 }
3475
- ), () => {
3476
- };
3477
- }
3478
- }), jo = oe({
3479
- name: "ElTreeSelect",
3480
- // disable `ElSelect` inherit current attrs
3481
- inheritAttrs: !1,
3482
- props: {
3483
- ...mn,
3484
- ...Sn,
3485
- /**
3486
- * @description The cached data of the lazy node, the structure is the same as the data, used to get the label of the unloaded data
3487
- */
3488
- cacheData: {
3489
- type: Array,
3490
- default: () => []
3491
- }
3492
- },
3493
- setup(e, t) {
3494
- const { slots: l, expose: o } = t, n = V(), i = V(), r = w(() => e.nodeKey || e.valueKey || "value"), s = Ho(e, t, { select: n, tree: i, key: r }), { cacheOptions: f, ...h } = zo(e, t, {
3495
- select: n,
3496
- tree: i,
3497
- key: r
3498
- }), c = he({});
3499
- return o(c), Oe(() => {
3500
- Object.assign(c, {
3501
- //TODO: let only tree and select in 3.0
3502
- ...ut(i.value, [
3503
- "filter",
3504
- "updateKeyChildren",
3505
- "getCheckedNodes",
3506
- "setCheckedNodes",
3507
- "getCheckedKeys",
3508
- "setCheckedKeys",
3509
- "setChecked",
3510
- "getHalfCheckedNodes",
3511
- "getHalfCheckedKeys",
3512
- "getCurrentKey",
3513
- "getCurrentNode",
3514
- "setCurrentKey",
3515
- "setCurrentNode",
3516
- "getNode",
3517
- "remove",
3518
- "append",
3519
- "insertBefore",
3520
- "insertAfter"
3521
- ]),
3522
- ...ut(n.value, ["focus", "blur", "selectedLabel"]),
3523
- treeRef: i.value,
3524
- selectRef: n.value
3525
- });
3526
- }), () => qe(
3527
- bn,
3528
- /**
3529
- * 1. The `props` is processed into `Refs`, but `v-bind` and
3530
- * render function props cannot read `Refs`, so use `reactive`
3531
- * unwrap the `Refs` and keep reactive.
3532
- * 2. The keyword `ref` requires `Ref`, but `reactive` broke it,
3533
- * so use function.
3534
- */
3535
- he({
3536
- ...s,
3537
- ref: (m) => n.value = m
3538
- }),
3539
- {
3540
- ...l,
3541
- default: () => [
3542
- qe(Wo, { data: f.value }),
3543
- qe(
3544
- wn,
3545
- he({
3546
- ...h,
3547
- ref: (m) => i.value = m
3548
- })
3549
- )
3550
- ]
3551
- }
3552
- );
3553
- }
3554
- });
3555
- const is = Qe(jo);
3556
- export {
3557
- is as ElTreeSelect,
3558
- is as default
3559
- };