tntd 3.0.9 → 3.0.11-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (418) hide show
  1. package/es/array-input/index.js +10 -1
  2. package/es/array-input/index.js.map +1 -1
  3. package/es/index.js +3 -1
  4. package/es/index.js.map +1 -1
  5. package/es/locale/en_US.js +17 -1
  6. package/es/locale/en_US.js.map +1 -1
  7. package/es/locale/zh_CN.js +16 -0
  8. package/es/locale/zh_CN.js.map +1 -1
  9. package/es/prev-locale.js +32 -2
  10. package/es/prev-locale.js.map +1 -1
  11. package/es/query-form-v3/Field/Checkbox.js +23 -0
  12. package/es/query-form-v3/Field/Checkbox.js.map +1 -0
  13. package/es/query-form-v3/Field/Composition/FieldPopover.js +330 -0
  14. package/es/query-form-v3/Field/Composition/FieldPopover.js.map +1 -0
  15. package/es/query-form-v3/Field/Composition/FieldPopover.less +35 -0
  16. package/es/query-form-v3/Field/Composition/Select.js +107 -0
  17. package/es/query-form-v3/Field/Composition/Select.js.map +1 -0
  18. package/es/query-form-v3/Field/Composition/index.js +208 -0
  19. package/es/query-form-v3/Field/Composition/index.js.map +1 -0
  20. package/es/query-form-v3/Field/Composition/index.less +118 -0
  21. package/es/query-form-v3/Field/Composition/utils.js +132 -0
  22. package/es/query-form-v3/Field/Composition/utils.js.map +1 -0
  23. package/es/query-form-v3/Field/Select.js +59 -0
  24. package/es/query-form-v3/Field/Select.js.map +1 -0
  25. package/es/query-form-v3/Field/SelectInput.js +87 -0
  26. package/es/query-form-v3/Field/SelectInput.js.map +1 -0
  27. package/es/query-form-v3/Field/fieldsMap.js +28 -0
  28. package/es/query-form-v3/Field/fieldsMap.js.map +1 -0
  29. package/es/query-form-v3/Field/index.js +117 -0
  30. package/es/query-form-v3/Field/index.js.map +1 -0
  31. package/es/query-form-v3/createActions.js +47 -0
  32. package/es/query-form-v3/createActions.js.map +1 -0
  33. package/es/query-form-v3/index.js +175 -0
  34. package/es/query-form-v3/index.js.map +1 -0
  35. package/es/query-form-v3/index.less +91 -0
  36. package/es/query-form-v3/useForm.js +6 -0
  37. package/es/query-form-v3/useForm.js.map +1 -0
  38. package/es/query-list-scene/QueryForm.js +6 -3
  39. package/es/query-list-scene/QueryForm.js.map +1 -1
  40. package/es/query-list-scene/index.less +4 -0
  41. package/es/svg-components/illustration-offline.js +11 -29
  42. package/es/svg-components/illustration-offline.js.map +1 -1
  43. package/es/table/index.js +2 -2
  44. package/es/table/index.js.map +1 -1
  45. package/es/table/resizableTable/index.js +87 -0
  46. package/es/table/resizableTable/index.js.map +1 -0
  47. package/es/table/resizableTable/index.less +36 -0
  48. package/es/table/table-hoc.js +26 -0
  49. package/es/table/table-hoc.js.map +1 -0
  50. package/es/tabs/tabs.less +23 -0
  51. package/es/title/index.js +18 -4
  52. package/es/title/index.js.map +1 -1
  53. package/es/title/index.less +88 -34
  54. package/es/tntd-reference/AHref/index.js +39 -0
  55. package/es/tntd-reference/AHref/index.js.map +1 -0
  56. package/es/tntd-reference/ReferenceBatchCheck/index.js +153 -0
  57. package/es/tntd-reference/ReferenceBatchCheck/index.js.map +1 -0
  58. package/es/tntd-reference/ReferenceBatchCheck/index.less +21 -0
  59. package/es/tntd-reference/ReferenceBatchDrawer/index.js +102 -0
  60. package/es/tntd-reference/ReferenceBatchDrawer/index.js.map +1 -0
  61. package/es/tntd-reference/ReferenceBatchDrawer/index.less +0 -0
  62. package/es/tntd-reference/ReferenceCheck/index.js +117 -0
  63. package/es/tntd-reference/ReferenceCheck/index.js.map +1 -0
  64. package/es/tntd-reference/ReferenceCheck/index.less +10 -0
  65. package/es/tntd-reference/ReferenceDrawer/index.js +69 -0
  66. package/es/tntd-reference/ReferenceDrawer/index.js.map +1 -0
  67. package/es/tntd-reference/ReferenceDrawer/index.less +0 -0
  68. package/es/tntd-reference/ReferenceInfo/index.js +150 -0
  69. package/es/tntd-reference/ReferenceInfo/index.js.map +1 -0
  70. package/es/tntd-reference/ReferenceInfo/index.less +31 -0
  71. package/es/tntd-reference/index.js +13 -0
  72. package/es/tntd-reference/index.js.map +1 -0
  73. package/es/tntd-virtual-tree/index.js +229 -0
  74. package/es/tntd-virtual-tree/index.js.map +1 -0
  75. package/es/tntd-virtual-tree/index.less +59 -0
  76. package/es/tntd-virtual-tree/utils.js +296 -0
  77. package/es/tntd-virtual-tree/utils.js.map +1 -0
  78. package/es/tntd-virtual-tree-select/index.js +98 -22
  79. package/es/tntd-virtual-tree-select/index.js.map +1 -1
  80. package/es/tntd-virtual-tree-select/utils.js +20 -124
  81. package/es/tntd-virtual-tree-select/utils.js.map +1 -1
  82. package/lib/_util/context.js +1 -1
  83. package/lib/_util/defaultRenderEmpty.js +1 -1
  84. package/lib/_util/hooks/useFlexGapSupport.js +4 -4
  85. package/lib/_util/hooks/useForceUpdate.js +4 -4
  86. package/lib/_util/responsiveObserve.js +1 -1
  87. package/lib/_util/styleChecker.js +1 -1
  88. package/lib/actions/index.js +1 -1
  89. package/lib/alert/alert.js +2 -2
  90. package/lib/alert/index.js +1 -1
  91. package/lib/array-input/index.d.ts.map +1 -1
  92. package/lib/array-input/index.js +23 -10
  93. package/lib/array-input/index.js.map +1 -1
  94. package/lib/button/button.js +2 -2
  95. package/lib/cascader/cascader.js +1 -1
  96. package/lib/check-card/group.js +8 -8
  97. package/lib/check-card/index.js +6 -6
  98. package/lib/checkbox/checkbox.js +1 -1
  99. package/lib/color-picker/ColorPicker.js +6 -6
  100. package/lib/color-picker/index.js +1 -1
  101. package/lib/columns/index.js +1 -1
  102. package/lib/config-provider/config-provider.js +1 -1
  103. package/lib/date-picker/DatePicker.js +1 -1
  104. package/lib/descriptions/descriptions.js +5 -5
  105. package/lib/development-login/LoginModal.js +6 -6
  106. package/lib/development-login/index.js +4 -4
  107. package/lib/drawer/drawer.js +2 -2
  108. package/lib/ellipsis/Svg/CopySVG.js +1 -1
  109. package/lib/ellipsis/Svg/TickSVG.js +1 -1
  110. package/lib/ellipsis/index.js +5 -5
  111. package/lib/empty/empty.js +2 -2
  112. package/lib/empty/empty.stories.js +2 -2
  113. package/lib/exception/exception.js +1 -1
  114. package/lib/form/form.js +2 -2
  115. package/lib/grid-v4/col.js +2 -2
  116. package/lib/grid-v4/hooks/useBreakpoint.js +1 -1
  117. package/lib/grid-v4/index.js +1 -1
  118. package/lib/grid-v4/row.js +6 -6
  119. package/lib/handle/index.js +1 -1
  120. package/lib/handle-icon/index.js +11 -11
  121. package/lib/icon/IconFont.js +1 -1
  122. package/lib/icon/components/Icon.js +9 -9
  123. package/lib/icon/components/index.js +1 -1
  124. package/lib/icon/components/utils.js +3 -3
  125. package/lib/icon/index.js +7 -7
  126. package/lib/icon/twoTonePrimaryColor.js +1 -1
  127. package/lib/icon/utils.js +1 -1
  128. package/lib/img/Contain.js +1 -1
  129. package/lib/img/Cover.js +5 -5
  130. package/lib/img/index.js +5 -5
  131. package/lib/index.d.ts +3 -1
  132. package/lib/index.d.ts.map +1 -1
  133. package/lib/index.js +17 -3
  134. package/lib/index.js.map +1 -1
  135. package/lib/input/input.js +2 -2
  136. package/lib/input-number/inputNumber.js +1 -1
  137. package/lib/label/index.js +2 -2
  138. package/lib/loading-button/index.js +5 -5
  139. package/lib/locale/default.d.ts +16 -0
  140. package/lib/locale/default.d.ts.map +1 -1
  141. package/lib/locale/default.js +1 -1
  142. package/lib/locale/en_US.d.ts +16 -0
  143. package/lib/locale/en_US.d.ts.map +1 -1
  144. package/lib/locale/en_US.js +18 -2
  145. package/lib/locale/en_US.js.map +1 -1
  146. package/lib/locale/zh_CN.d.ts +16 -0
  147. package/lib/locale/zh_CN.d.ts.map +1 -1
  148. package/lib/locale/zh_CN.js +17 -1
  149. package/lib/locale/zh_CN.js.map +1 -1
  150. package/lib/modal/modal.js +1 -1
  151. package/lib/notification/assets/index.js +1 -1
  152. package/lib/notification/index.js +1 -1
  153. package/lib/notification/notification.js +1 -1
  154. package/lib/page/Box.js +1 -1
  155. package/lib/page/index.js +7 -7
  156. package/lib/page-container/index.js +1 -1
  157. package/lib/page-loading/index.js +1 -1
  158. package/lib/popconfirm/popconfirm.js +1 -1
  159. package/lib/popover/popover.js +1 -1
  160. package/lib/prev-locale.d.ts +42 -0
  161. package/lib/prev-locale.d.ts.map +1 -1
  162. package/lib/prev-locale.js +32 -2
  163. package/lib/prev-locale.js.map +1 -1
  164. package/lib/preview-text/index.js +7 -7
  165. package/lib/progress/progress.js +2 -2
  166. package/lib/query-form/Field/Checkbox.js +1 -1
  167. package/lib/query-form/Field/Select.js +6 -6
  168. package/lib/query-form/Field/SelectInput.js +6 -6
  169. package/lib/query-form/Field/fieldsMap.js +1 -1
  170. package/lib/query-form/Field/index.js +10 -10
  171. package/lib/query-form/createActions.js +1 -1
  172. package/lib/query-form/index.js +10 -10
  173. package/lib/query-form/useForm.js +1 -1
  174. package/lib/query-form-v3/Field/Checkbox.d.ts +8 -0
  175. package/lib/query-form-v3/Field/Checkbox.d.ts.map +1 -0
  176. package/lib/query-form-v3/Field/Checkbox.js +28 -0
  177. package/lib/query-form-v3/Field/Checkbox.js.map +1 -0
  178. package/lib/query-form-v3/Field/Composition/FieldPopover.d.ts +19 -0
  179. package/lib/query-form-v3/Field/Composition/FieldPopover.d.ts.map +1 -0
  180. package/lib/query-form-v3/Field/Composition/FieldPopover.js +370 -0
  181. package/lib/query-form-v3/Field/Composition/FieldPopover.js.map +1 -0
  182. package/lib/query-form-v3/Field/Composition/FieldPopover.less +35 -0
  183. package/lib/query-form-v3/Field/Composition/Select.d.ts +4 -0
  184. package/lib/query-form-v3/Field/Composition/Select.d.ts.map +1 -0
  185. package/lib/query-form-v3/Field/Composition/Select.js +131 -0
  186. package/lib/query-form-v3/Field/Composition/Select.js.map +1 -0
  187. package/lib/query-form-v3/Field/Composition/index.d.ts +10 -0
  188. package/lib/query-form-v3/Field/Composition/index.d.ts.map +1 -0
  189. package/lib/query-form-v3/Field/Composition/index.js +255 -0
  190. package/lib/query-form-v3/Field/Composition/index.js.map +1 -0
  191. package/lib/query-form-v3/Field/Composition/index.less +118 -0
  192. package/lib/query-form-v3/Field/Composition/utils.d.ts +22 -0
  193. package/lib/query-form-v3/Field/Composition/utils.d.ts.map +1 -0
  194. package/lib/query-form-v3/Field/Composition/utils.js +147 -0
  195. package/lib/query-form-v3/Field/Composition/utils.js.map +1 -0
  196. package/lib/query-form-v3/Field/Select.d.ts +4 -0
  197. package/lib/query-form-v3/Field/Select.d.ts.map +1 -0
  198. package/lib/query-form-v3/Field/Select.js +80 -0
  199. package/lib/query-form-v3/Field/Select.js.map +1 -0
  200. package/lib/query-form-v3/Field/SelectInput.d.ts +4 -0
  201. package/lib/query-form-v3/Field/SelectInput.d.ts.map +1 -0
  202. package/lib/query-form-v3/Field/SelectInput.js +100 -0
  203. package/lib/query-form-v3/Field/SelectInput.js.map +1 -0
  204. package/lib/query-form-v3/Field/fieldsMap.d.ts +27 -0
  205. package/lib/query-form-v3/Field/fieldsMap.d.ts.map +1 -0
  206. package/lib/query-form-v3/Field/fieldsMap.js +35 -0
  207. package/lib/query-form-v3/Field/fieldsMap.js.map +1 -0
  208. package/lib/query-form-v3/Field/index.d.ts +14 -0
  209. package/lib/query-form-v3/Field/index.d.ts.map +1 -0
  210. package/lib/query-form-v3/Field/index.js +147 -0
  211. package/lib/query-form-v3/Field/index.js.map +1 -0
  212. package/lib/query-form-v3/createActions.d.ts +14 -0
  213. package/lib/query-form-v3/createActions.d.ts.map +1 -0
  214. package/lib/query-form-v3/createActions.js +54 -0
  215. package/lib/query-form-v3/createActions.js.map +1 -0
  216. package/lib/query-form-v3/index.d.ts +27 -0
  217. package/lib/query-form-v3/index.d.ts.map +1 -0
  218. package/lib/query-form-v3/index.js +206 -0
  219. package/lib/query-form-v3/index.js.map +1 -0
  220. package/lib/query-form-v3/index.less +91 -0
  221. package/lib/query-form-v3/useForm.d.ts +13 -0
  222. package/lib/query-form-v3/useForm.d.ts.map +1 -0
  223. package/lib/query-form-v3/useForm.js +13 -0
  224. package/lib/query-form-v3/useForm.js.map +1 -0
  225. package/lib/query-list-scene/List.js +13 -13
  226. package/lib/query-list-scene/QueryForm.d.ts +2 -2
  227. package/lib/query-list-scene/QueryForm.d.ts.map +1 -1
  228. package/lib/query-list-scene/QueryForm.js +19 -17
  229. package/lib/query-list-scene/QueryForm.js.map +1 -1
  230. package/lib/query-list-scene/QueryListScene.js +10 -10
  231. package/lib/query-list-scene/Title.js +1 -1
  232. package/lib/query-list-scene/Toolbar.js +2 -2
  233. package/lib/query-list-scene/createActions.js +1 -1
  234. package/lib/query-list-scene/index.js +1 -1
  235. package/lib/query-list-scene/index.less +4 -0
  236. package/lib/query-list-scene/useActions.js +1 -1
  237. package/lib/radio/radio.js +1 -1
  238. package/lib/render-empty/render-empty.js +1 -1
  239. package/lib/segmented/index.d.ts +1 -1
  240. package/lib/segmented/index.js +2 -2
  241. package/lib/select/select.js +2 -2
  242. package/lib/spin/spin.js +1 -1
  243. package/lib/steps/steps.js +2 -2
  244. package/lib/svg-components/illustration-offline.d.ts.map +1 -1
  245. package/lib/svg-components/illustration-offline.js +11 -29
  246. package/lib/svg-components/illustration-offline.js.map +1 -1
  247. package/lib/svg-components/index.js +1 -1
  248. package/lib/table/hooks/use-column-setting.js +4 -4
  249. package/lib/table/hooks/use-expand-fixed.js +6 -6
  250. package/lib/table/index.d.ts +2 -2
  251. package/lib/table/index.d.ts.map +1 -1
  252. package/lib/table/index.js +7 -7
  253. package/lib/table/index.js.map +1 -1
  254. package/lib/table/resizableTable/index.d.ts +12 -0
  255. package/lib/table/resizableTable/index.d.ts.map +1 -0
  256. package/lib/table/resizableTable/index.js +110 -0
  257. package/lib/table/resizableTable/index.js.map +1 -0
  258. package/lib/table/resizableTable/index.less +36 -0
  259. package/lib/table/table-hoc.d.ts +7 -0
  260. package/lib/table/table-hoc.d.ts.map +1 -0
  261. package/lib/table/table-hoc.js +34 -0
  262. package/lib/table/table-hoc.js.map +1 -0
  263. package/lib/table/table.js +9 -9
  264. package/lib/table/table.stories.d.ts +1 -1
  265. package/lib/table/table.stories.js +2 -2
  266. package/lib/table/total-shower.js +1 -1
  267. package/lib/table/utils.js +1 -1
  268. package/lib/table-container/index.js +1 -1
  269. package/lib/tabs/tabs.js +2 -2
  270. package/lib/tabs/tabs.less +23 -0
  271. package/lib/tabs-container/index.js +1 -1
  272. package/lib/tag/tag.js +2 -2
  273. package/lib/time-picker/TimePicker.js +1 -1
  274. package/lib/time-picker/index.js +1 -1
  275. package/lib/title/index.d.ts +1 -0
  276. package/lib/title/index.d.ts.map +1 -1
  277. package/lib/title/index.js +19 -5
  278. package/lib/title/index.js.map +1 -1
  279. package/lib/title/index.less +88 -34
  280. package/lib/tntd-action/Action.js +9 -9
  281. package/lib/tntd-action/index.js +8 -8
  282. package/lib/tntd-cascader/AntdCascader/component/context.js +1 -1
  283. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +1 -1
  284. package/lib/tntd-cascader/AntdCascader/component/getIcons.js +1 -1
  285. package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +2 -2
  286. package/lib/tntd-cascader/AntdCascader/config/utils.js +2 -2
  287. package/lib/tntd-cascader/AntdCascader/index.js +7 -7
  288. package/lib/tntd-cascader/index.js +1 -1
  289. package/lib/tntd-cascader/rc-cascader/Cascader.js +8 -8
  290. package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +2 -2
  291. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +7 -7
  292. package/lib/tntd-cascader/rc-cascader/OptionList/index.js +9 -9
  293. package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -5
  294. package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +8 -8
  295. package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +5 -5
  296. package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +1 -1
  297. package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +6 -6
  298. package/lib/tntd-cascader/rc-cascader/index.js +1 -1
  299. package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +4 -4
  300. package/lib/tntd-form/ErrorList.js +7 -7
  301. package/lib/tntd-form/Form.js +6 -6
  302. package/lib/tntd-form/FormItem/ItemHolder.js +6 -6
  303. package/lib/tntd-form/FormItem/index.js +8 -8
  304. package/lib/tntd-form/FormItemInput.js +1 -1
  305. package/lib/tntd-form/FormItemLabel.js +2 -2
  306. package/lib/tntd-form/FormList.js +1 -1
  307. package/lib/tntd-form/context.js +1 -1
  308. package/lib/tntd-form/hooks/useDebounce.js +4 -4
  309. package/lib/tntd-form/hooks/useForm.js +5 -5
  310. package/lib/tntd-form/hooks/useFormItemStatus.js +1 -1
  311. package/lib/tntd-form/hooks/useFrameState.js +5 -5
  312. package/lib/tntd-form/index.js +1 -1
  313. package/lib/tntd-icon/index.js +1 -1
  314. package/lib/tntd-layout/AppList.js +6 -6
  315. package/lib/tntd-layout/Application.js +6 -6
  316. package/lib/tntd-layout/Avatar.js +2 -2
  317. package/lib/tntd-layout/CompatibleLanguage.js +6 -6
  318. package/lib/tntd-layout/EnterpriseLayout/Avatar.js +2 -2
  319. package/lib/tntd-layout/EnterpriseLayout/Language.js +6 -6
  320. package/lib/tntd-layout/EnterpriseLayout/Theme.js +6 -6
  321. package/lib/tntd-layout/EnterpriseLayout/index.js +1 -1
  322. package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +6 -6
  323. package/lib/tntd-layout/GlobalNavigation/index.js +9 -9
  324. package/lib/tntd-layout/Header.js +2 -2
  325. package/lib/tntd-layout/HeaderActions.js +2 -2
  326. package/lib/tntd-layout/HeaderNavs.js +6 -6
  327. package/lib/tntd-layout/HeaderTabs.js +7 -7
  328. package/lib/tntd-layout/Iconfont.js +1 -1
  329. package/lib/tntd-layout/Language.js +6 -6
  330. package/lib/tntd-layout/Layout.js +6 -6
  331. package/lib/tntd-layout/Logo.js +2 -2
  332. package/lib/tntd-layout/OrgAppList.js +6 -6
  333. package/lib/tntd-layout/SideMenu.js +6 -6
  334. package/lib/tntd-layout/Theme.js +6 -6
  335. package/lib/tntd-layout/createActions.js +1 -1
  336. package/lib/tntd-layout/images/index.js +1 -1
  337. package/lib/tntd-layout/index.js +1 -1
  338. package/lib/tntd-layout/paaslayout/CompactSideMenu.js +6 -6
  339. package/lib/tntd-layout/paaslayout/Header.js +2 -2
  340. package/lib/tntd-layout/paaslayout/Logo.js +2 -2
  341. package/lib/tntd-layout/paaslayout/SideMenu.js +6 -6
  342. package/lib/tntd-layout/paaslayout/index.js +6 -6
  343. package/lib/tntd-layout/storage.js +1 -1
  344. package/lib/tntd-modal/index.js +6 -6
  345. package/lib/tntd-rc-select/_util/PurePanel.js +5 -5
  346. package/lib/tntd-rc-select/_util/context.js +1 -1
  347. package/lib/tntd-rc-select/_util/defaultRenderEmpty.js +1 -1
  348. package/lib/tntd-rc-select/_util/getIcons.js +1 -1
  349. package/lib/tntd-rc-select/_util/useCompactItemContext.js +2 -2
  350. package/lib/tntd-rc-select/index.js +2 -2
  351. package/lib/tntd-reference/AHref/index.d.ts +4 -0
  352. package/lib/tntd-reference/AHref/index.d.ts.map +1 -0
  353. package/lib/tntd-reference/AHref/index.js +44 -0
  354. package/lib/tntd-reference/AHref/index.js.map +1 -0
  355. package/lib/tntd-reference/ReferenceBatchCheck/index.d.ts +3 -0
  356. package/lib/tntd-reference/ReferenceBatchCheck/index.d.ts.map +1 -0
  357. package/lib/tntd-reference/ReferenceBatchCheck/index.js +165 -0
  358. package/lib/tntd-reference/ReferenceBatchCheck/index.js.map +1 -0
  359. package/lib/tntd-reference/ReferenceBatchCheck/index.less +21 -0
  360. package/lib/tntd-reference/ReferenceBatchDrawer/index.d.ts +4 -0
  361. package/lib/tntd-reference/ReferenceBatchDrawer/index.d.ts.map +1 -0
  362. package/lib/tntd-reference/ReferenceBatchDrawer/index.js +126 -0
  363. package/lib/tntd-reference/ReferenceBatchDrawer/index.js.map +1 -0
  364. package/lib/tntd-reference/ReferenceBatchDrawer/index.less +0 -0
  365. package/lib/tntd-reference/ReferenceCheck/index.d.ts +3 -0
  366. package/lib/tntd-reference/ReferenceCheck/index.d.ts.map +1 -0
  367. package/lib/tntd-reference/ReferenceCheck/index.js +126 -0
  368. package/lib/tntd-reference/ReferenceCheck/index.js.map +1 -0
  369. package/lib/tntd-reference/ReferenceCheck/index.less +10 -0
  370. package/lib/tntd-reference/ReferenceDrawer/index.d.ts +4 -0
  371. package/lib/tntd-reference/ReferenceDrawer/index.d.ts.map +1 -0
  372. package/lib/tntd-reference/ReferenceDrawer/index.js +93 -0
  373. package/lib/tntd-reference/ReferenceDrawer/index.js.map +1 -0
  374. package/lib/tntd-reference/ReferenceDrawer/index.less +0 -0
  375. package/lib/tntd-reference/ReferenceInfo/index.d.ts +4 -0
  376. package/lib/tntd-reference/ReferenceInfo/index.d.ts.map +1 -0
  377. package/lib/tntd-reference/ReferenceInfo/index.js +164 -0
  378. package/lib/tntd-reference/ReferenceInfo/index.js.map +1 -0
  379. package/lib/tntd-reference/ReferenceInfo/index.less +31 -0
  380. package/lib/tntd-reference/index.d.ts +15 -0
  381. package/lib/tntd-reference/index.d.ts.map +1 -0
  382. package/lib/tntd-reference/index.js +20 -0
  383. package/lib/tntd-reference/index.js.map +1 -0
  384. package/lib/tntd-second-page/index.js +1 -1
  385. package/lib/tntd-select/DropDownWrap.js +8 -8
  386. package/lib/tntd-select/index.js +10 -9
  387. package/lib/tntd-virtual-tree/index.d.ts +20 -0
  388. package/lib/tntd-virtual-tree/index.d.ts.map +1 -0
  389. package/lib/tntd-virtual-tree/index.js +263 -0
  390. package/lib/tntd-virtual-tree/index.js.map +1 -0
  391. package/lib/tntd-virtual-tree/index.less +59 -0
  392. package/lib/tntd-virtual-tree/utils.d.ts +17 -0
  393. package/lib/tntd-virtual-tree/utils.d.ts.map +1 -0
  394. package/lib/tntd-virtual-tree/utils.js +353 -0
  395. package/lib/tntd-virtual-tree/utils.js.map +1 -0
  396. package/lib/tntd-virtual-tree-select/index.d.ts +13 -4
  397. package/lib/tntd-virtual-tree-select/index.d.ts.map +1 -1
  398. package/lib/tntd-virtual-tree-select/index.js +103 -22
  399. package/lib/tntd-virtual-tree-select/index.js.map +1 -1
  400. package/lib/tntd-virtual-tree-select/utils.d.ts +2 -9
  401. package/lib/tntd-virtual-tree-select/utils.d.ts.map +1 -1
  402. package/lib/tntd-virtual-tree-select/utils.js +28 -147
  403. package/lib/tntd-virtual-tree-select/utils.js.map +1 -1
  404. package/lib/tooltip/tooltip.js +1 -1
  405. package/lib/upload/index.js +1 -1
  406. package/lib/utils/checkAuth.js +4 -4
  407. package/lib/utils/index.js +9 -9
  408. package/lib/utils/lang.js +3 -3
  409. package/lib/water-mark/index.js +5 -5
  410. package/package.json +4 -2
  411. package/es/tntd-virtual-tree-select/VirtualTree.js +0 -125
  412. package/es/tntd-virtual-tree-select/VirtualTree.js.map +0 -1
  413. package/es/tntd-virtual-tree-select/tree.less +0 -29
  414. package/lib/tntd-virtual-tree-select/VirtualTree.d.ts +0 -13
  415. package/lib/tntd-virtual-tree-select/VirtualTree.d.ts.map +0 -1
  416. package/lib/tntd-virtual-tree-select/VirtualTree.js +0 -155
  417. package/lib/tntd-virtual-tree-select/VirtualTree.js.map +0 -1
  418. package/lib/tntd-virtual-tree-select/tree.less +0 -29
@@ -0,0 +1,353 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getNodeValuess = exports.getNodeStr = exports.getNodeParentChoosed = exports.getNodeNoDisabledLastestChildrenValues = exports.getNodeNoDisabledChildrenValues = exports.getIndeterminate = exports.getFullExpandedKeys = exports.getFullCheckedKeys = exports.flatTreeData = exports.findNodeDetail = exports.addTreeNodeAttrs = void 0;
7
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
8
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
9
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
11
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
12
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
13
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
15
+ var t = {};
16
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
22
+ /**
23
+ * 初始化给树的每个节点增加以下属性字段
24
+ * childrenValues: 当前节点下的所有子节点的value和(包含了disabled节点)用户展开/收起
25
+ * titleTotal: 当前节点下的所有子节点的title和 (包含了disabled节点)用于搜索
26
+ * needCheckedChildrenValues: 当前节点下的节点(即无children)的value和(不包含了disabled节点),用于选中/取消选中
27
+ * needCheckedLastestChildrenValues: 当前节点下的最底层节点(即无children)的value和(不包含了disabled节点),用于选中/取消选中
28
+ * needCheckedSiblingsValue: 当前节点所有上级节点的兄弟节点, [{ key: '上级节点value', list: [xx] }] list包含非disabled节点 用于选中/取消选中
29
+ * 用于判断后续展开/收起
30
+ * @param {*} treeData
31
+ */
32
+ var _addTreeNodeAttrs = exports.addTreeNodeAttrs = function addTreeNodeAttrs(treeData) {
33
+ var fieldNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
34
+ title: 'title',
35
+ value: 'value',
36
+ children: 'children',
37
+ disabled: 'disabled'
38
+ };
39
+ var needCheckedSiblingsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
40
+ if (Array.isArray(treeData) && !!treeData.length) {
41
+ return treeData.map(function (item) {
42
+ item.children = item[fieldNames['children']];
43
+ item.title = item[fieldNames['title']];
44
+ item.value = item[fieldNames['value']];
45
+ var children = item.children,
46
+ query = __rest(item, ["children"]);
47
+ if (Array.isArray(children) && !!children.length) {
48
+ var siblingsSum = needCheckedSiblingsValue;
49
+ if (!item[fieldNames['disabled']]) {
50
+ // 这里注意要逆序,要不然校验的时候会出问题
51
+ siblingsSum = [{
52
+ key: item[fieldNames['value']],
53
+ list: children.reduce(function (total, item) {
54
+ if (!item[fieldNames['disabled']]) {
55
+ total.push(item[fieldNames['value']]);
56
+ }
57
+ return total;
58
+ }, [])
59
+ }].concat(_toConsumableArray(siblingsSum));
60
+ } else {
61
+ siblingsSum = [];
62
+ }
63
+ query.children = _addTreeNodeAttrs(children, fieldNames, siblingsSum);
64
+ }
65
+ return Object.assign(Object.assign({}, query), {
66
+ title: query[fieldNames['title']],
67
+ value: query[fieldNames['value']],
68
+ disabled: query[fieldNames['disabled']],
69
+ childrenValues: _getNodeValuess(query, false),
70
+ titleTotal: _getNodeStr(query, fieldNames['title']),
71
+ needCheckedLastestChildrenValues: !item[fieldNames['disabled']] ? _getNodeNoDisabledLastestChildrenValues(item, fieldNames) : [],
72
+ needCheckedChildrenValues: !item[fieldNames['disabled']] ? _getNodeNoDisabledChildrenValues(item, fieldNames) : [],
73
+ needCheckedSiblingsValue: !item[fieldNames['disabled']] ? needCheckedSiblingsValue : []
74
+ });
75
+ });
76
+ }
77
+ return [];
78
+ };
79
+ var _getNodeStr = exports.getNodeStr = function getNodeStr(node, key) {
80
+ var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
81
+ result.push(node[key]);
82
+ if (Array.isArray(node.children) && !!node.children.length) {
83
+ node.children.forEach(function (element) {
84
+ result = [].concat(_toConsumableArray(result), _toConsumableArray(_getNodeStr(element, key)));
85
+ });
86
+ }
87
+ return result;
88
+ };
89
+ /**
90
+ * 获取每个节点下面所有子节点的value值
91
+ * @param {*} node
92
+ * @param {*} widthSelf 是否包含自己
93
+ * @param {*} result
94
+ * @returns []
95
+ */
96
+ var _getNodeValuess = exports.getNodeValuess = function getNodeValuess(node) {
97
+ var widthSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
98
+ var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
99
+ if (widthSelf) {
100
+ result.push(node.value);
101
+ }
102
+ if (Array.isArray(node.children) && !!node.children.length) {
103
+ node.children.forEach(function (element) {
104
+ result = [].concat(_toConsumableArray(result), _toConsumableArray(_getNodeValuess(element)));
105
+ });
106
+ }
107
+ return result;
108
+ };
109
+ /**
110
+ * 扁平树
111
+ * @param {*} treeData
112
+ * @param {*} expandedKeys 展开的节点
113
+ * @param {*} treeDefaultExpandAll
114
+ * @param {*} level
115
+ * @param {*} result
116
+ * @returns
117
+ */
118
+ var _flatTreeData = exports.flatTreeData = function flatTreeData(treeData) {
119
+ var filterKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
120
+ var expandedKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
121
+ var treeDefaultExpandAll = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
122
+ var level = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
123
+ var result = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : [];
124
+ if (Array.isArray(treeData)) {
125
+ var _iterator = _createForOfIteratorHelper(treeData),
126
+ _step;
127
+ try {
128
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
129
+ var i = _step.value;
130
+ var value = i.value,
131
+ children = i.children,
132
+ titleTotal = i.titleTotal,
133
+ title = i.title,
134
+ rest = __rest(i, ["value", "children", "titleTotal", "title"]);
135
+ // 判断是否命中过滤
136
+ var bingo = true;
137
+ var transFilterKey = !['', null, undefined].includes(filterKey);
138
+ if (transFilterKey) {
139
+ bingo = Array.isArray(titleTotal) ? titleTotal.some(function (i) {
140
+ return i.includes(filterKey);
141
+ }) : false;
142
+ }
143
+ if (bingo) {
144
+ result.push(Object.assign({
145
+ level: level
146
+ }, i));
147
+ }
148
+ var selfIn = Array.isArray(expandedKeys) ? expandedKeys.includes(value) : false;
149
+ if ((treeDefaultExpandAll || selfIn || transFilterKey && bingo) && Array.isArray(children) && !!children.length) {
150
+ result = [].concat(_toConsumableArray(result), _toConsumableArray(_flatTreeData(children, filterKey, expandedKeys, treeDefaultExpandAll, level + 1)));
151
+ }
152
+ }
153
+ } catch (err) {
154
+ _iterator.e(err);
155
+ } finally {
156
+ _iterator.f();
157
+ }
158
+ }
159
+ return result;
160
+ };
161
+ /**
162
+ * 获取所有展开的节点 (组件传入最后一层,需要将其上层全部加入到expandedKeys)
163
+ * @param {*} treeDataWithKeys
164
+ * @param {*} treeExpandedKeys
165
+ * @param {*} result
166
+ * @returns
167
+ */
168
+ var _getFullExpandedKeys = exports.getFullExpandedKeys = function getFullExpandedKeys(treeDataWithKeys) {
169
+ var treeExpandedKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
170
+ var treeDefaultExpandAll = arguments.length > 2 ? arguments[2] : undefined;
171
+ var result = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
172
+ if (!treeDefaultExpandAll && (!Array.isArray(treeDataWithKeys) || !treeDataWithKeys.length || !Array.isArray(treeExpandedKeys) || !treeExpandedKeys.length)) {
173
+ return [];
174
+ }
175
+ treeDataWithKeys.forEach(function (i) {
176
+ var childrenValues = i.childrenValues,
177
+ value = i.value,
178
+ children = i.children;
179
+ if (treeDefaultExpandAll || Array.isArray(childrenValues) && [].concat(_toConsumableArray(childrenValues), [value]).some(function (el) {
180
+ return treeExpandedKeys.includes(el);
181
+ })) {
182
+ result.push(value);
183
+ if (Array.isArray(children) && !!children.length) {
184
+ result = [].concat(_toConsumableArray(result), _toConsumableArray(_getFullExpandedKeys(children, treeExpandedKeys, treeDefaultExpandAll)));
185
+ }
186
+ }
187
+ });
188
+ return result;
189
+ };
190
+ /**
191
+ * 初始化根据用户传入的值获取其关联节点是否要在checkList
192
+ * @param {*} treeDataWithKeys
193
+ * @param {*} transCheckedKeys
194
+ * @param {*} result
195
+ * @returns
196
+ */
197
+ var _getFullCheckedKeys = exports.getFullCheckedKeys = function getFullCheckedKeys(treeDataWithKeys, transCheckedKeys) {
198
+ var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
199
+ if (!Array.isArray(treeDataWithKeys) || !treeDataWithKeys.length || !Array.isArray(transCheckedKeys) || !transCheckedKeys.length) {
200
+ return [];
201
+ }
202
+ treeDataWithKeys.forEach(function (i) {
203
+ var value = i.value,
204
+ children = i.children,
205
+ disabled = i.disabled;
206
+ var bingo = transCheckedKeys.includes(value);
207
+ if (bingo) {
208
+ result.push(value);
209
+ }
210
+ if (Array.isArray(children) && !!children.length) {
211
+ var lastestUnDisabledChildrenValues = i.needCheckedLastestChildrenValues;
212
+ // 如果当前节点是被命中,就将其下面所有子节点都选中
213
+ if (Array.isArray(lastestUnDisabledChildrenValues) && !!lastestUnDisabledChildrenValues.length && lastestUnDisabledChildrenValues.every(function (el) {
214
+ return transCheckedKeys.includes(el);
215
+ })) {
216
+ result.push(value);
217
+ }
218
+ result = [].concat(_toConsumableArray(result), _toConsumableArray(_getFullCheckedKeys(children, transCheckedKeys)));
219
+ }
220
+ });
221
+ return result;
222
+ };
223
+ /**
224
+ * 递归获取某个节点所有最下层(没有children)的values集合,递归遇到disable的节点就不继续往下递归了
225
+ * @param {*} node
226
+ * @param {*} node
227
+ * @returns
228
+ */
229
+ var _getNodeNoDisabledLastestChildrenValues = exports.getNodeNoDisabledLastestChildrenValues = function getNodeNoDisabledLastestChildrenValues(node, fieldNames) {
230
+ var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
231
+ if (Array.isArray(node.children) && !!node.children.length) {
232
+ node.children.forEach(function (element) {
233
+ if (!element[fieldNames['disabled']]) {
234
+ result = [].concat(_toConsumableArray(result), _toConsumableArray(_getNodeNoDisabledLastestChildrenValues(element, fieldNames)));
235
+ }
236
+ });
237
+ } else {
238
+ if (!node[fieldNames['disabled']]) {
239
+ result.push(node[fieldNames['value']]);
240
+ }
241
+ }
242
+ return result;
243
+ };
244
+ /**
245
+ * 递归获取某个节点所有下层(没有children)的values集合,递归遇到disable的节点就不继续往下递归了
246
+ * @param {*} node
247
+ * @param {*} node
248
+ * @returns
249
+ */
250
+ var _getNodeNoDisabledChildrenValues = exports.getNodeNoDisabledChildrenValues = function getNodeNoDisabledChildrenValues(node, fieldNames) {
251
+ var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
252
+ if (Array.isArray(node.children) && !!node.children.length) {
253
+ node.children.forEach(function (element) {
254
+ if (!element[fieldNames['disabled']]) {
255
+ result.push(element[fieldNames['value']]);
256
+ result = [].concat(_toConsumableArray(result), _toConsumableArray(_getNodeNoDisabledChildrenValues(element, fieldNames)));
257
+ }
258
+ });
259
+ } else {
260
+ if (!node[fieldNames['disabled']]) {
261
+ result.push(node[fieldNames['value']]);
262
+ }
263
+ }
264
+ return result;
265
+ };
266
+ /**
267
+ * 判断当前节点是否半选
268
+ * @param {*} item
269
+ * @param {*} checkedList
270
+ */
271
+ var getIndeterminate = exports.getIndeterminate = function getIndeterminate(item, checkedList, disabledList) {
272
+ // 如果没有子节点,就没有半选情况
273
+ if (!Array.isArray(item.children) || !item.children.length) {
274
+ return false;
275
+ }
276
+ if (!Array.isArray(checkedList) || !checkedList.length) {
277
+ return false;
278
+ }
279
+ // 当前节点下的去掉disabled的所有末级节点
280
+ var list = Array.isArray(item.needCheckedLastestChildrenValues) ? item.needCheckedLastestChildrenValues : [];
281
+ var childrenCheckedList = list.filter(function (i) {
282
+ return checkedList === null || checkedList === void 0 ? void 0 : checkedList.includes(i);
283
+ });
284
+ return childrenCheckedList.length > 0 && childrenCheckedList.length < list.length;
285
+ };
286
+ /**
287
+ * 获取当前节点的父亲节点是否需要被选中
288
+ * @param {*} needCheckedSiblingsValue
289
+ * @param {*} checkedList
290
+ * @returns
291
+ */
292
+ var getNodeParentChoosed = exports.getNodeParentChoosed = function getNodeParentChoosed(needCheckedSiblingsValue, checkedList) {
293
+ if (!Array.isArray(checkedList) || !checkedList.length) {
294
+ return [];
295
+ }
296
+ var result = [];
297
+ var _iterator2 = _createForOfIteratorHelper(needCheckedSiblingsValue),
298
+ _step2;
299
+ try {
300
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
301
+ var item = _step2.value;
302
+ var _ref = item || {},
303
+ key = _ref.key,
304
+ list = _ref.list;
305
+ // 过滤掉子节点为disabled的
306
+ var bool = Array.isArray(list) ? list.every(function (it) {
307
+ return checkedList.includes(it);
308
+ }) : false;
309
+ if (bool) {
310
+ checkedList.push(key);
311
+ result.push(key);
312
+ }
313
+ }
314
+ } catch (err) {
315
+ _iterator2.e(err);
316
+ } finally {
317
+ _iterator2.f();
318
+ }
319
+ return result;
320
+ };
321
+ /**
322
+ * 获取节点的信息
323
+ * @param {*} tree
324
+ * @param {*} key
325
+ * @param {*} result
326
+ * @returns
327
+ */
328
+ var _findNodeDetail = exports.findNodeDetail = function findNodeDetail(tree, key, result) {
329
+ if (Array.isArray(tree) && !!key) {
330
+ var _iterator3 = _createForOfIteratorHelper(tree),
331
+ _step3;
332
+ try {
333
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
334
+ var i = _step3.value;
335
+ if (i.value === key) {
336
+ result = i;
337
+ break;
338
+ }
339
+ if (Array.isArray(i.children) && !!i.children.length) {
340
+ result = _findNodeDetail(i.children, key);
341
+ if (result) {
342
+ break;
343
+ }
344
+ }
345
+ }
346
+ } catch (err) {
347
+ _iterator3.e(err);
348
+ } finally {
349
+ _iterator3.f();
350
+ }
351
+ }
352
+ return result;
353
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/tntd-virtual-tree/utils.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;GASG;AACI,MAAM,gBAAgB,GAAG,CAC9B,QAAQ,EACR,UAAU,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,EAC3F,wBAAwB,GAAG,EAAE,EAC7B,EAAE;IACF,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE;QAChD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAC3B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;YAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;YACvC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,C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E,GAAG,EAAE,MAAM,EAAE,EAAE;IAClD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE;QAChC,KAAK,IAAI,CAAC,IAAI,IAAI,EAAE;YAClB,IAAI,CAAC,CAAC,KAAK,KAAK,GAAG,EAAE;gBACnB,MAAM,GAAG,CAAC,CAAC;gBACX,MAAM;aACP;YACD,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE;gBACpD,MAAM,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;gBACzC,IAAI,MAAM,EAAE;oBACV,MAAM;iBACP;aACF;SACF;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAjBW,QAAA,cAAc,kBAiBzB","sourcesContent":["/**\n * 初始化给树的每个节点增加以下属性字段\n * childrenValues: 当前节点下的所有子节点的value和(包含了disabled节点)用户展开/收起\n * titleTotal: 当前节点下的所有子节点的title和 (包含了disabled节点)用于搜索\n * needCheckedChildrenValues: 当前节点下的节点(即无children)的value和(不包含了disabled节点),用于选中/取消选中\n * needCheckedLastestChildrenValues: 当前节点下的最底层节点(即无children)的value和(不包含了disabled节点),用于选中/取消选中\n * needCheckedSiblingsValue: 当前节点所有上级节点的兄弟节点, [{ key: '上级节点value', list: [xx] }] list包含非disabled节点 用于选中/取消选中\n * 用于判断后续展开/收起\n * @param {*} treeData\n */\nexport const addTreeNodeAttrs = (\n treeData,\n fieldNames = { title: 'title', value: 'value', children: 'children', disabled: 'disabled' },\n needCheckedSiblingsValue = []\n) => {\n if (Array.isArray(treeData) && !!treeData.length) {\n return treeData.map((item) => {\n item.children = item[fieldNames['children']];\n item.title = item[fieldNames['title']];\n item.value = item[fieldNames['value']];\n const { children, ...query } = item;\n if (Array.isArray(children) && !!children.length) {\n let siblingsSum = needCheckedSiblingsValue;\n if (!item[fieldNames['disabled']]) {\n // 这里注意要逆序,要不然校验的时候会出问题\n siblingsSum = [\n {\n key: item[fieldNames['value']],\n list: children.reduce((total, item) => {\n if (!item[fieldNames['disabled']]) {\n total.push(item[fieldNames['value']]);\n }\n return total;\n }, [])\n },\n ...siblingsSum\n ];\n } else {\n siblingsSum = [];\n }\n query.children = addTreeNodeAttrs(children, fieldNames, siblingsSum);\n }\n return {\n ...query,\n title: query[fieldNames['title']],\n value: query[fieldNames['value']],\n disabled: query[fieldNames['disabled']],\n childrenValues: getNodeValuess(query, false),\n titleTotal: getNodeStr(query, fieldNames['title']),\n needCheckedLastestChildrenValues: !item[fieldNames['disabled']] ? getNodeNoDisabledLastestChildrenValues(item, fieldNames) : [],\n needCheckedChildrenValues: !item[fieldNames['disabled']] ? getNodeNoDisabledChildrenValues(item, fieldNames) : [],\n needCheckedSiblingsValue: !item[fieldNames['disabled']] ? needCheckedSiblingsValue : []\n };\n });\n }\n\n return [];\n};\n\nexport const getNodeStr = (node, key, result = []) => {\n result.push(node[key]);\n\n if (Array.isArray(node.children) && !!node.children.length) {\n node.children.forEach((element) => {\n result = [...result, ...getNodeStr(element, key)];\n });\n }\n\n return result;\n};\n\n/**\n * 获取每个节点下面所有子节点的value值\n * @param {*} node\n * @param {*} widthSelf 是否包含自己\n * @param {*} result\n * @returns []\n */\nexport const getNodeValuess = (node, widthSelf = true, result = []) => {\n if (widthSelf) {\n result.push(node.value);\n }\n\n if (Array.isArray(node.children) && !!node.children.length) {\n node.children.forEach((element) => {\n result = [...result, ...getNodeValuess(element)];\n });\n }\n\n return result;\n};\n\n/**\n * 扁平树\n * @param {*} treeData\n * @param {*} expandedKeys 展开的节点\n * @param {*} treeDefaultExpandAll\n * @param {*} level\n * @param {*} result\n * @returns\n */\nexport const flatTreeData = (treeData, filterKey = '', expandedKeys = [], treeDefaultExpandAll = false, level = 0, result = []) => {\n if (Array.isArray(treeData)) {\n for (const i of treeData) {\n const { value, children, titleTotal, title, ...rest } = i;\n\n // 判断是否命中过滤\n let bingo = true;\n const transFilterKey = !['', null, undefined].includes(filterKey);\n if (transFilterKey) {\n bingo = Array.isArray(titleTotal) ? titleTotal.some((i) => i.includes(filterKey)) : false;\n }\n\n if (bingo) {\n result.push({ level, ...i });\n }\n\n const selfIn = Array.isArray(expandedKeys) ? expandedKeys.includes(value) : false;\n if ((treeDefaultExpandAll || selfIn || (transFilterKey && bingo)) && Array.isArray(children) && !!children.length) {\n result = [...result, ...flatTreeData(children, filterKey, expandedKeys, treeDefaultExpandAll, level + 1)];\n }\n }\n }\n return result;\n};\n\n/**\n * 获取所有展开的节点 (组件传入最后一层,需要将其上层全部加入到expandedKeys)\n * @param {*} treeDataWithKeys\n * @param {*} treeExpandedKeys\n * @param {*} result\n * @returns\n */\nexport const getFullExpandedKeys = (treeDataWithKeys, treeExpandedKeys = [], treeDefaultExpandAll, result = []) => {\n if (\n !treeDefaultExpandAll &&\n (!Array.isArray(treeDataWithKeys) || !treeDataWithKeys.length || !Array.isArray(treeExpandedKeys) || !treeExpandedKeys.length)\n ) {\n return [];\n }\n\n treeDataWithKeys.forEach((i) => {\n const { childrenValues, value, children } = i;\n\n if (treeDefaultExpandAll || (Array.isArray(childrenValues) && [...childrenValues, value].some((el) => treeExpandedKeys.includes(el)))) {\n result.push(value);\n\n if (Array.isArray(children) && !!children.length) {\n result = [...result, ...getFullExpandedKeys(children, treeExpandedKeys, treeDefaultExpandAll)];\n }\n }\n });\n\n return result;\n};\n\n/**\n * 初始化根据用户传入的值获取其关联节点是否要在checkList\n * @param {*} treeDataWithKeys\n * @param {*} transCheckedKeys\n * @param {*} result\n * @returns\n */\nexport const getFullCheckedKeys = (treeDataWithKeys, transCheckedKeys, result = []) => {\n if (!Array.isArray(treeDataWithKeys) || !treeDataWithKeys.length || !Array.isArray(transCheckedKeys) || !transCheckedKeys.length) {\n return [];\n }\n\n treeDataWithKeys.forEach((i) => {\n const { value, children, disabled } = i;\n const bingo = transCheckedKeys.includes(value);\n if (bingo) {\n result.push(value);\n }\n\n if (Array.isArray(children) && !!children.length) {\n const lastestUnDisabledChildrenValues = i.needCheckedLastestChildrenValues;\n // 如果当前节点是被命中,就将其下面所有子节点都选中\n if (\n Array.isArray(lastestUnDisabledChildrenValues) &&\n !!lastestUnDisabledChildrenValues.length &&\n lastestUnDisabledChildrenValues.every((el) => transCheckedKeys.includes(el))\n ) {\n result.push(value);\n }\n result = [...result, ...getFullCheckedKeys(children, transCheckedKeys)];\n }\n });\n\n return result;\n};\n\n/**\n * 递归获取某个节点所有最下层(没有children)的values集合,递归遇到disable的节点就不继续往下递归了\n * @param {*} node\n * @param {*} node\n * @returns\n */\nexport const getNodeNoDisabledLastestChildrenValues = (node, fieldNames, result = []) => {\n if (Array.isArray(node.children) && !!node.children.length) {\n node.children.forEach((element) => {\n if (!element[fieldNames['disabled']]) {\n result = [...result, ...getNodeNoDisabledLastestChildrenValues(element, fieldNames)];\n }\n });\n } else {\n if (!node[fieldNames['disabled']]) {\n result.push(node[fieldNames['value']]);\n }\n }\n return result;\n};\n\n/**\n * 递归获取某个节点所有下层(没有children)的values集合,递归遇到disable的节点就不继续往下递归了\n * @param {*} node\n * @param {*} node\n * @returns\n */\nexport const getNodeNoDisabledChildrenValues = (node, fieldNames, result = []) => {\n if (Array.isArray(node.children) && !!node.children.length) {\n node.children.forEach((element) => {\n if (!element[fieldNames['disabled']]) {\n result.push(element[fieldNames['value']]);\n result = [...result, ...getNodeNoDisabledChildrenValues(element, fieldNames)];\n }\n });\n } else {\n if (!node[fieldNames['disabled']]) {\n result.push(node[fieldNames['value']]);\n }\n }\n return result;\n}\n\n/**\n * 判断当前节点是否半选\n * @param {*} item\n * @param {*} checkedList\n */\nexport const getIndeterminate = (item, checkedList, disabledList) => {\n // 如果没有子节点,就没有半选情况\n if (!Array.isArray(item.children) || !item.children.length) {\n return false;\n }\n\n if (!Array.isArray(checkedList) || !checkedList.length) {\n return false;\n }\n\n // 当前节点下的去掉disabled的所有末级节点\n const list = Array.isArray(item.needCheckedLastestChildrenValues) ? item.needCheckedLastestChildrenValues : [];\n const childrenCheckedList = list.filter((i) => checkedList?.includes(i));\n\n return childrenCheckedList.length > 0 && childrenCheckedList.length < list.length;\n};\n\n/**\n * 获取当前节点的父亲节点是否需要被选中\n * @param {*} needCheckedSiblingsValue\n * @param {*} checkedList\n * @returns\n */\nexport const getNodeParentChoosed = (needCheckedSiblingsValue, checkedList) => {\n if (!Array.isArray(checkedList) || !checkedList.length) {\n return [];\n }\n let result = [];\n for (let item of needCheckedSiblingsValue) {\n const { key, list } = item || {};\n // 过滤掉子节点为disabled的\n const bool = Array.isArray(list) ? list.every((it) => checkedList.includes(it)) : false;\n if (bool) {\n checkedList.push(key);\n result.push(key);\n }\n }\n\n return result;\n};\n\n/**\n * 获取节点的信息\n * @param {*} tree \n * @param {*} key \n * @param {*} result \n * @returns \n */\nexport const findNodeDetail = (tree, key, result) => {\n if (Array.isArray(tree) && !!key) {\n for (let i of tree) {\n if (i.value === key) {\n result = i;\n break;\n }\n if (Array.isArray(i.children) && !!i.children.length) {\n result = findNodeDetail(i.children, key);\n if (result) {\n break;\n }\n }\n }\n }\n\n return result;\n};\n"]}
@@ -1,16 +1,25 @@
1
1
  export default TntdVirtualTreeSelect;
2
- declare function TntdVirtualTreeSelect({ value, onChange, renderItem, treeData, showSearch, treeDefaultExpandAll, treeExpandedKeys, fieldNames, dropdownMatchSelectWidth, dropdownStyle, ...restProps }: {
2
+ declare function TntdVirtualTreeSelect({ value, onChange, treeData, showSearch, fieldNames, dropdownMatchSelectWidth, dropdownStyle, showCheckedStrategy, treeCheckable, treeCheckStrictly, treeDefaultExpandAll, treeExpandedKeys, onTreeCheck, onTreeExpand, treeTitleRender, ...restProps }: {
3
3
  [x: string]: any;
4
4
  value: any;
5
5
  onChange: any;
6
- renderItem: any;
7
6
  treeData: any;
8
7
  showSearch: any;
9
- treeDefaultExpandAll: any;
10
- treeExpandedKeys: any;
11
8
  fieldNames: any;
12
9
  dropdownMatchSelectWidth: any;
13
10
  dropdownStyle: any;
11
+ showCheckedStrategy: any;
12
+ treeCheckable: any;
13
+ treeCheckStrictly: any;
14
+ treeDefaultExpandAll: any;
15
+ treeExpandedKeys: any;
16
+ onTreeCheck: any;
17
+ onTreeExpand: any;
18
+ treeTitleRender: any;
14
19
  }): React.JSX.Element;
20
+ declare namespace TntdVirtualTreeSelect {
21
+ const SHOW_CHILD: string;
22
+ const SHOW_ALL: string;
23
+ }
15
24
  import React from "react";
16
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tntd-virtual-tree-select/index.jsx"],"names":[],"mappings":";AAYA;;;;;;;;;;;;sBA0BC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tntd-virtual-tree-select/index.jsx"],"names":[],"mappings":";AAaA;;;;;;;;;;;;;;;;;sBAoHC"}
@@ -7,11 +7,18 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports["default"] = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _tntdRcSelect = _interopRequireDefault(require("../tntd-rc-select"));
10
- var _VirtualTree = _interopRequireDefault(require("./VirtualTree"));
10
+ var _tntdVirtualTree = _interopRequireDefault(require("../tntd-virtual-tree"));
11
+ var _utils = require("./utils.js");
11
12
  require("./index.less");
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
13
14
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
14
15
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
16
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
17
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
19
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
20
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
21
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
15
22
  var __rest = void 0 && (void 0).__rest || function (s, e) {
16
23
  var t = {};
17
24
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
@@ -25,50 +32,124 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
25
32
  * @Author: 郑泳健
26
33
  * @Date: 2024-08-05 10:50:17
27
34
  * @LastEditors: 郑泳健
28
- * @LastEditTime: 2024-08-05 15:00:41
35
+ * @LastEditTime: 2024-08-20 15:03:16
29
36
  */
30
37
 
31
- var TntdVirtualTreeSelect = function TntdVirtualTreeSelect(_a) {
38
+ var _TntdVirtualTreeSelect = function TntdVirtualTreeSelect(_a) {
32
39
  var value = _a.value,
33
40
  onChange = _a.onChange,
34
- renderItem = _a.renderItem,
35
41
  treeData = _a.treeData,
36
42
  showSearch = _a.showSearch,
37
- treeDefaultExpandAll = _a.treeDefaultExpandAll,
38
- treeExpandedKeys = _a.treeExpandedKeys,
39
43
  fieldNames = _a.fieldNames,
40
44
  dropdownMatchSelectWidth = _a.dropdownMatchSelectWidth,
41
45
  dropdownStyle = _a.dropdownStyle,
42
- restProps = __rest(_a, ["value", "onChange", "renderItem", "treeData", "showSearch", "treeDefaultExpandAll", "treeExpandedKeys", "fieldNames", "dropdownMatchSelectWidth", "dropdownStyle"]);
46
+ showCheckedStrategy = _a.showCheckedStrategy,
47
+ treeCheckable = _a.treeCheckable,
48
+ treeCheckStrictly = _a.treeCheckStrictly,
49
+ treeDefaultExpandAll = _a.treeDefaultExpandAll,
50
+ treeExpandedKeys = _a.treeExpandedKeys,
51
+ onTreeCheck = _a.onTreeCheck,
52
+ onTreeExpand = _a.onTreeExpand,
53
+ treeTitleRender = _a.treeTitleRender,
54
+ restProps = __rest(_a, ["value", "onChange", "treeData", "showSearch", "fieldNames", "dropdownMatchSelectWidth", "dropdownStyle", "showCheckedStrategy", "treeCheckable", "treeCheckStrictly", "treeDefaultExpandAll", "treeExpandedKeys", "onTreeCheck", "onTreeExpand", "treeTitleRender"]);
55
+ var selectRef = (0, _react.useRef)(null);
56
+ var _useState = (0, _react.useState)(undefined),
57
+ _useState2 = _slicedToArray(_useState, 2),
58
+ filterKey = _useState2[0],
59
+ setFilterKey = _useState2[1];
43
60
  var mergeDropdownStyle = (0, _react.useMemo)(function () {
44
61
  return Array.isArray(treeData) && treeData.length ? dropdownStyle : {};
45
62
  }, [dropdownStyle, treeData]);
46
63
  var mergeDropdownMatchSelectWidth = (0, _react.useMemo)(function () {
47
64
  return Array.isArray(treeData) && treeData.length ? dropdownMatchSelectWidth : true;
48
65
  }, [dropdownMatchSelectWidth, treeData]);
49
- var handleRender = function handleRender(rest) {
66
+ var treeNodeWithParents = (0, _react.useMemo)(function () {
67
+ return (0, _utils.flatWithParents)(treeData, fieldNames);
68
+ }, [treeData, fieldNames]);
69
+ var selectValue = (0, _react.useMemo)(function () {
70
+ if (!treeCheckable) {
71
+ return value;
72
+ }
73
+ if (Array.isArray(value)) {
74
+ if (showCheckedStrategy === _TntdVirtualTreeSelect.SHOW_ALL) {
75
+ return value;
76
+ }
77
+ // 过滤掉有子节点,
78
+ return value.filter(function (i) {
79
+ return (0, _utils.filterLastestNode)(treeNodeWithParents, i, value);
80
+ });
81
+ }
82
+ return undefined;
83
+ }, [treeCheckable, treeNodeWithParents, value, showCheckedStrategy]);
84
+ var mergeMode = (0, _react.useMemo)(function () {
85
+ if (treeCheckable) {
86
+ return {
87
+ multiple: true,
88
+ mode: 'tags'
89
+ };
90
+ }
91
+ return {};
92
+ }, [treeCheckable]);
93
+ var handleRender = function handleRender(_a) {
94
+ var showSearch = _a.showSearch,
95
+ rest = __rest(_a, ["showSearch"]);
50
96
  return _react["default"].createElement("div", {
51
- className: 'virtual-tree-options'
52
- }, _react["default"].createElement(_VirtualTree["default"], Object.assign({}, rest)));
97
+ className: "virtual-tree-options"
98
+ }, _react["default"].createElement(_tntdVirtualTree["default"], Object.assign({}, rest)));
99
+ };
100
+ var handleChange = function handleChange(val) {
101
+ onChange(val);
102
+ };
103
+ var handleSearch = function handleSearch(val) {
104
+ setFilterKey(val);
53
105
  };
54
- return _react["default"].createElement(_tntdRcSelect["default"], Object.assign({}, restProps, {
106
+ var handleSelect = function handleSelect(val) {
107
+ var _a;
108
+ onChange === null || onChange === void 0 ? void 0 : onChange(val);
109
+ if (selectRef.current) {
110
+ // 主动触发下拉框消失
111
+ (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.blur();
112
+ }
113
+ };
114
+ return _react["default"].createElement(_tntdRcSelect["default"], Object.assign({
115
+ ref: selectRef,
116
+ value: selectValue,
117
+ onChange: handleChange,
118
+ showSearch: showSearch,
119
+ onSearch: handleSearch
120
+ }, mergeMode, restProps, {
55
121
  dropdownMatchSelectWidth: mergeDropdownMatchSelectWidth,
56
122
  dropdownStyle: Object.assign({
57
123
  maxHeight: '100vh',
58
124
  overflow: 'auto'
59
125
  }, mergeDropdownStyle),
60
126
  dropdownRender: function dropdownRender() {
61
- return handleRender({
62
- value: value,
63
- onChange: onChange,
64
- renderItem: renderItem,
127
+ var obj = {
65
128
  treeData: treeData,
66
- showSearch: showSearch,
67
- treeDefaultExpandAll: treeDefaultExpandAll,
68
- treeExpandedKeys: treeExpandedKeys,
69
- fieldNames: fieldNames
70
- });
129
+ filterKey: filterKey,
130
+ defaultExpandAll: treeDefaultExpandAll,
131
+ expandedKeys: treeExpandedKeys,
132
+ fieldNames: fieldNames,
133
+ onExpand: onTreeExpand,
134
+ titleRender: treeTitleRender,
135
+ onSelect: handleSelect
136
+ };
137
+ if (treeCheckable) {
138
+ obj = Object.assign(Object.assign({}, obj), {
139
+ checkedKeys: value,
140
+ checkStrictly: treeCheckStrictly,
141
+ checkable: treeCheckable,
142
+ onCheck: onTreeCheck
143
+ });
144
+ } else {
145
+ obj = Object.assign(Object.assign({}, obj), {
146
+ value: value
147
+ });
148
+ }
149
+ return handleRender(obj);
71
150
  }
72
151
  }));
73
152
  };
74
- var _default = exports["default"] = TntdVirtualTreeSelect;
153
+ _TntdVirtualTreeSelect.SHOW_CHILD = 'SHOW_CHILD';
154
+ _TntdVirtualTreeSelect.SHOW_ALL = 'SHOW_ALL';
155
+ var _default = exports["default"] = _TntdVirtualTreeSelect;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","s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AAG,EAAE,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAC,IAC7I,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,qBAAqB,CAAA","sourcesContent":["/*\n * @Descripttion: 用select包裹虚拟树\n * @Author: 郑泳健\n * @Date: 2024-08-05 10:50:17\n * @LastEditors: 郑泳健\n * @LastEditTime: 2024-08-05 15:00:41\n */\nimport React, { useState, useMemo } from 'react';\nimport RcSelect from '../tntd-rc-select'\nimport VirtualTree from './VirtualTree';\nimport './index.less';\n\nconst TntdVirtualTreeSelect = ({ value, onChange, renderItem, treeData, showSearch, treeDefaultExpandAll, treeExpandedKeys, fieldNames, dropdownMatchSelectWidth, dropdownStyle, ...restProps }) => {\n \n const mergeDropdownStyle = useMemo(() => {\n return Array.isArray(treeData) && treeData.length ? dropdownStyle : {}\n }, [dropdownStyle, treeData])\n\n const mergeDropdownMatchSelectWidth = useMemo(() => {\n return Array.isArray(treeData) && treeData.length ? dropdownMatchSelectWidth : true\n }, [dropdownMatchSelectWidth, treeData])\n\n const handleRender = (rest) => {\n return (\n <div className='virtual-tree-options'>\n <VirtualTree {...rest} />\n </div>\n )\n }\n\n return (\n <RcSelect\n {...restProps}\n dropdownMatchSelectWidth={mergeDropdownMatchSelectWidth}\n dropdownStyle={{ maxHeight: '100vh', overflow: 'auto', ...mergeDropdownStyle }}\n dropdownRender={() => handleRender({ value, onChange, renderItem, treeData, showSearch, treeDefaultExpandAll, treeExpandedKeys, fieldNames })}\n />\n );\n};\n\nexport default TntdVirtualTreeSelect\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tntd-virtual-tree-select/index.jsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,+CAAyD;AACzD,uEAAyC;AACzC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AAC,CAAC;QAChB,IAAI,SAAS,CAAC,OAAO,EAAE;YACrB,YAAY;YACZ,MAAA,SAAS,CAAC,OAAO,0CAAE,IAAI,EAAE,CAAC;SAC3B;IACH,CAAC,CAAC;IAEF,OAAO,CACL,8BAAC,wBAAQ,kBACP,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,YAAY,EACtB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,YAAY,IAClB,SAAS,EACT,SAAS,IACb,wBAAwB,EAAE,6BAA6B,EACvD,aAAa,kBAAI,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAK,kBAAkB,GAC5E,cAAc,EAAE,GAAG,EAAE;YACnB,IAAI,GAAG,GAAG;gBACR,QAAQ;gBACR,SAAS;gBACT,gBAAgB,EAAE,oBAAoB;gBACtC,YAAY,EAAE,gBAAgB;gBAC9B,UAAU;gBACV,QAAQ,EAAE,YAAY;gBACtB,WAAW,EAAE,eAAe;gBAC5B,QAAQ,EAAE,YAAY;aACvB,CAAC;YACF,IAAI,aAAa,EAAE;gBACjB,GAAG,mCAAQ,GAAG,KAAE,WAAW,EAAE,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,GAAE,CAAC;aACxH;iBAAM;gBACL,GAAG,mCAAQ,GAAG,KAAE,KAAK,GAAE,CAAC;aACzB;YACD,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC,IACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,qBAAqB,CAAC,UAAU,GAAG,YAAY,CAAA;AAC/C,qBAAqB,CAAC,QAAQ,GAAG,UAAU,CAAA;AAE3C,kBAAe,qBAAqB,CAAC","sourcesContent":["/*\n * @Descripttion: 用select包裹虚拟树\n * @Author: 郑泳健\n * @Date: 2024-08-05 10:50:17\n * @LastEditors: 郑泳健\n * @LastEditTime: 2024-08-20 15:03:16\n */\nimport React, { useState, useRef, useMemo } from 'react';\nimport RcSelect from '../tntd-rc-select';\nimport TntdVirtualTree from '../tntd-virtual-tree';\nimport { filterLastestNode, flatWithParents } from './utils.js'\nimport './index.less';\n\nconst TntdVirtualTreeSelect = ({\n value,\n onChange,\n treeData,\n showSearch,\n fieldNames,\n dropdownMatchSelectWidth,\n dropdownStyle,\n showCheckedStrategy,\n treeCheckable,\n treeCheckStrictly,\n treeDefaultExpandAll,\n treeExpandedKeys,\n onTreeCheck,\n onTreeExpand,\n treeTitleRender,\n ...restProps\n}) => {\n const selectRef = useRef(null);\n const [filterKey, setFilterKey] = useState(undefined);\n\n const mergeDropdownStyle = useMemo(() => {\n return Array.isArray(treeData) && treeData.length ? dropdownStyle : {};\n }, [dropdownStyle, treeData]);\n\n const mergeDropdownMatchSelectWidth = useMemo(() => {\n return Array.isArray(treeData) && treeData.length ? dropdownMatchSelectWidth : true;\n }, [dropdownMatchSelectWidth, treeData]);\n\n const treeNodeWithParents = useMemo(() => {\n return flatWithParents(treeData, fieldNames)\n }, [treeData, fieldNames])\n\n const selectValue = useMemo(() => {\n if(!treeCheckable) {\n return value\n }\n\n if(Array.isArray(value)) {\n if(showCheckedStrategy === TntdVirtualTreeSelect.SHOW_ALL) {\n return value;\n }\n // 过滤掉有子节点,\n return value.filter(i => {\n return filterLastestNode(treeNodeWithParents, i, value)\n })\n }\n return undefined\n\n }, [treeCheckable, treeNodeWithParents, value, showCheckedStrategy])\n\n const mergeMode = useMemo(() => {\n if(treeCheckable) {\n return {\n multiple: true,\n mode: 'tags'\n }\n }\n return {}\n }, [treeCheckable])\n\n const handleRender = ({ showSearch, ...rest }) => {\n return (\n <div className=\"virtual-tree-options\">\n <TntdVirtualTree {...rest} />\n </div>\n );\n };\n\n const handleChange = (val) => {\n onChange(val);\n };\n\n const handleSearch = (val) => {\n setFilterKey(val);\n };\n\n const handleSelect = (val) => {\n onChange?.(val);\n if (selectRef.current) {\n // 主动触发下拉框消失\n selectRef.current?.blur();\n }\n };\n\n return (\n <RcSelect\n ref={selectRef}\n value={selectValue}\n onChange={handleChange}\n showSearch={showSearch}\n onSearch={handleSearch}\n {...mergeMode}\n {...restProps}\n dropdownMatchSelectWidth={mergeDropdownMatchSelectWidth}\n dropdownStyle={{ maxHeight: '100vh', overflow: 'auto', ...mergeDropdownStyle }}\n dropdownRender={() => {\n let obj = {\n treeData,\n filterKey,\n defaultExpandAll: treeDefaultExpandAll,\n expandedKeys: treeExpandedKeys,\n fieldNames,\n onExpand: onTreeExpand,\n titleRender: treeTitleRender,\n onSelect: handleSelect\n };\n if (treeCheckable) {\n obj = { ...obj, checkedKeys: value, checkStrictly: treeCheckStrictly, checkable: treeCheckable, onCheck: onTreeCheck };\n } else {\n obj = { ...obj, value };\n }\n return handleRender(obj);\n }}\n />\n );\n};\n\nTntdVirtualTreeSelect.SHOW_CHILD = 'SHOW_CHILD'\nTntdVirtualTreeSelect.SHOW_ALL = 'SHOW_ALL'\n\nexport default TntdVirtualTreeSelect;\n"]}
@@ -1,10 +1,3 @@
1
- export function addTreeNodeKeys(treeData: any, fieldNames?: {
2
- title: string;
3
- value: string;
4
- children: string;
5
- }): any[];
6
- export function getNodeStr(node: any, key: any, result?: any[]): any[];
7
- export function getNodeKeys(node: any, widthSelf?: any, result?: any): any;
8
- export function flatTreeData(treeData: any, filterKey?: string, expandedKeys?: any, treeDefaultExpandAll?: any, level?: any, result?: any): any;
9
- export function getFullExpandedKeys(treeDataWithKeys: any, treeExpandedKeys: any, treeDefaultExpandAll: any, result?: any): any;
1
+ export function flatWithParents(treeData: any, fieldNames?: any, parents?: any, result?: {}): {};
2
+ export function filterLastestNode(treeNodeWithParents: any, item: any, list: any): boolean;
10
3
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/tntd-virtual-tree-select/utils.js"],"names":[],"mappings":"AAKO;;;;UAqBN;AAEM,uEAUN;AASM,2EAYN;AAWM,gJAuBN;AASM,gIAkBN"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/tntd-virtual-tree-select/utils.js"],"names":[],"mappings":"AAOO,iGAaN;AAEM,2FAQN"}