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
@@ -11,53 +11,129 @@ var __rest = this && this.__rest || function (s, e) {
11
11
  * @Author: 郑泳健
12
12
  * @Date: 2024-08-05 10:50:17
13
13
  * @LastEditors: 郑泳健
14
- * @LastEditTime: 2024-08-05 15:00:41
14
+ * @LastEditTime: 2024-08-20 15:03:16
15
15
  */
16
- import React, { useMemo } from 'react';
16
+ import React, { useState, useRef, useMemo } from 'react';
17
17
  import RcSelect from '../tntd-rc-select';
18
- import VirtualTree from './VirtualTree';
18
+ import TntdVirtualTree from '../tntd-virtual-tree';
19
+ import { filterLastestNode, flatWithParents } from './utils.js';
19
20
  import './index.less';
20
21
  const TntdVirtualTreeSelect = _a => {
21
22
  var {
22
23
  value,
23
24
  onChange,
24
- renderItem,
25
25
  treeData,
26
26
  showSearch,
27
- treeDefaultExpandAll,
28
- treeExpandedKeys,
29
27
  fieldNames,
30
28
  dropdownMatchSelectWidth,
31
- dropdownStyle
29
+ dropdownStyle,
30
+ showCheckedStrategy,
31
+ treeCheckable,
32
+ treeCheckStrictly,
33
+ treeDefaultExpandAll,
34
+ treeExpandedKeys,
35
+ onTreeCheck,
36
+ onTreeExpand,
37
+ treeTitleRender
32
38
  } = _a,
33
- restProps = __rest(_a, ["value", "onChange", "renderItem", "treeData", "showSearch", "treeDefaultExpandAll", "treeExpandedKeys", "fieldNames", "dropdownMatchSelectWidth", "dropdownStyle"]);
39
+ restProps = __rest(_a, ["value", "onChange", "treeData", "showSearch", "fieldNames", "dropdownMatchSelectWidth", "dropdownStyle", "showCheckedStrategy", "treeCheckable", "treeCheckStrictly", "treeDefaultExpandAll", "treeExpandedKeys", "onTreeCheck", "onTreeExpand", "treeTitleRender"]);
40
+ const selectRef = useRef(null);
41
+ const [filterKey, setFilterKey] = useState(undefined);
34
42
  const mergeDropdownStyle = useMemo(() => {
35
43
  return Array.isArray(treeData) && treeData.length ? dropdownStyle : {};
36
44
  }, [dropdownStyle, treeData]);
37
45
  const mergeDropdownMatchSelectWidth = useMemo(() => {
38
46
  return Array.isArray(treeData) && treeData.length ? dropdownMatchSelectWidth : true;
39
47
  }, [dropdownMatchSelectWidth, treeData]);
40
- const handleRender = rest => {
48
+ const treeNodeWithParents = useMemo(() => {
49
+ return flatWithParents(treeData, fieldNames);
50
+ }, [treeData, fieldNames]);
51
+ const selectValue = useMemo(() => {
52
+ if (!treeCheckable) {
53
+ return value;
54
+ }
55
+ if (Array.isArray(value)) {
56
+ if (showCheckedStrategy === TntdVirtualTreeSelect.SHOW_ALL) {
57
+ return value;
58
+ }
59
+ // 过滤掉有子节点,
60
+ return value.filter(i => {
61
+ return filterLastestNode(treeNodeWithParents, i, value);
62
+ });
63
+ }
64
+ return undefined;
65
+ }, [treeCheckable, treeNodeWithParents, value, showCheckedStrategy]);
66
+ const mergeMode = useMemo(() => {
67
+ if (treeCheckable) {
68
+ return {
69
+ multiple: true,
70
+ mode: 'tags'
71
+ };
72
+ }
73
+ return {};
74
+ }, [treeCheckable]);
75
+ const handleRender = _a => {
76
+ var {
77
+ showSearch
78
+ } = _a,
79
+ rest = __rest(_a, ["showSearch"]);
41
80
  return React.createElement("div", {
42
- className: 'virtual-tree-options'
43
- }, React.createElement(VirtualTree, Object.assign({}, rest)));
81
+ className: "virtual-tree-options"
82
+ }, React.createElement(TntdVirtualTree, Object.assign({}, rest)));
83
+ };
84
+ const handleChange = val => {
85
+ onChange(val);
86
+ };
87
+ const handleSearch = val => {
88
+ setFilterKey(val);
89
+ };
90
+ const handleSelect = val => {
91
+ var _a;
92
+ onChange === null || onChange === void 0 ? void 0 : onChange(val);
93
+ if (selectRef.current) {
94
+ // 主动触发下拉框消失
95
+ (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.blur();
96
+ }
44
97
  };
45
- return React.createElement(RcSelect, Object.assign({}, restProps, {
98
+ return React.createElement(RcSelect, Object.assign({
99
+ ref: selectRef,
100
+ value: selectValue,
101
+ onChange: handleChange,
102
+ showSearch: showSearch,
103
+ onSearch: handleSearch
104
+ }, mergeMode, restProps, {
46
105
  dropdownMatchSelectWidth: mergeDropdownMatchSelectWidth,
47
106
  dropdownStyle: Object.assign({
48
107
  maxHeight: '100vh',
49
108
  overflow: 'auto'
50
109
  }, mergeDropdownStyle),
51
- dropdownRender: () => handleRender({
52
- value,
53
- onChange,
54
- renderItem,
55
- treeData,
56
- showSearch,
57
- treeDefaultExpandAll,
58
- treeExpandedKeys,
59
- fieldNames
60
- })
110
+ dropdownRender: () => {
111
+ let obj = {
112
+ treeData,
113
+ filterKey,
114
+ defaultExpandAll: treeDefaultExpandAll,
115
+ expandedKeys: treeExpandedKeys,
116
+ fieldNames,
117
+ onExpand: onTreeExpand,
118
+ titleRender: treeTitleRender,
119
+ onSelect: handleSelect
120
+ };
121
+ if (treeCheckable) {
122
+ obj = Object.assign(Object.assign({}, obj), {
123
+ checkedKeys: value,
124
+ checkStrictly: treeCheckStrictly,
125
+ checkable: treeCheckable,
126
+ onCheck: onTreeCheck
127
+ });
128
+ } else {
129
+ obj = Object.assign(Object.assign({}, obj), {
130
+ value
131
+ });
132
+ }
133
+ return handleRender(obj);
134
+ }
61
135
  }));
62
136
  };
137
+ TntdVirtualTreeSelect.SHOW_CHILD = 'SHOW_CHILD';
138
+ TntdVirtualTreeSelect.SHOW_ALL = 'SHOW_ALL';
63
139
  export default TntdVirtualTreeSelect;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tntd-virtual-tree-select/index.jsx"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,EAAY,OAAO,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AACxC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,CAAC,EAAgK,EAAE,EAAE;QAApK,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,UAAU,EAAE,wBAAwB,EAAE,aAAa,OAAgB,EAAX,SAAS,cAA9J,oKAAgK,CAAF;IAE3L,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,EAAE;QACtC,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAA;IACzE,CAAC,EAAE,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAA;IAE7B,MAAM,6BAA6B,GAAG,OAAO,CAAC,GAAG,EAAE;QACjD,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAE,wBAAwB,CAAC,CAAC,CAAC,IAAI,CAAA;IACtF,CAAC,EAAE,CAAC,wBAAwB,EAAE,QAAQ,CAAC,CAAC,CAAA;IAExC,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,EAAE;QAC5B,OAAO,CACL,6BAAK,SAAS,EAAC,sBAAsB;YACnC,oBAAC,WAAW,oBAAK,IAAI,EAAI,CACrB,CACP,CAAA;IACH,CAAC,CAAA;IAED,OAAO,CACL,oBAAC,QAAQ,oBACH,SAAS,IACb,wBAAwB,EAAE,6BAA6B,EACvD,aAAa,kBAAI,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAK,kBAAkB,GAC5E,cAAc,EAAE,GAAG,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,eAAe,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,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC/D,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,CAAC,EAiB9B,EAAE,EAAE;QAjB0B,EAC7B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,eAAe,OAEhB,EADI,SAAS,cAhBiB,qQAiB9B,CADa;IAEZ,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IAEtD,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,EAAE;QACtC,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IACzE,CAAC,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,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,eAAe,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,135 +1,31 @@
1
- var __rest = this && this.__rest || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
4
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
5
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
6
- }
7
- return t;
8
- };
9
1
  /**
10
- * 初始化给树的每个节点增加一个keys字段(数组),keys的值是当前节点下的所有子节点的value和
11
- * 用于判断后续展开/收起
2
+ * 给每个节点增加一个parent字段,记录其父节点用于showCheckedStrategy
12
3
  * @param {*} treeData
4
+ * @param {*} fieldNames
5
+ * @param {*} parents
6
+ * @returns
13
7
  */
14
- export const addTreeNodeKeys = (treeData, fieldNames = {
8
+ export const flatWithParents = (treeData, fieldNames = {
15
9
  title: 'title',
16
10
  value: 'value',
17
- children: 'children'
18
- }) => {
19
- if (Array.isArray(treeData) && !!treeData.length) {
20
- return treeData.map(item => {
21
- item.children = item[fieldNames['children']];
22
- item.title = item[fieldNames['title']];
23
- item.value = item[fieldNames['value']];
24
- const {
25
- children
26
- } = item,
27
- query = __rest(item, ["children"]);
28
- if (Array.isArray(children) && !!children.length) {
29
- query.children = addTreeNodeKeys(children, fieldNames);
30
- }
31
- return Object.assign(Object.assign({}, query), {
32
- title: query[fieldNames['title']],
33
- value: query[fieldNames['value']],
34
- keys: getNodeKeys(query),
35
- titleTotal: getNodeStr(query, fieldNames['title'])
36
- });
37
- });
38
- }
39
- return [];
40
- };
41
- export const getNodeStr = (node, key, result = []) => {
42
- result.push(node[key]);
43
- if (Array.isArray(node.children) && !!node.children.length) {
44
- node.children.forEach(element => {
45
- result = [...result, ...getNodeStr(element, key)];
46
- });
47
- }
48
- return result;
49
- };
50
- /**
51
- * 获取每个节点下面所有子节点的value值
52
- * @param {*} node
53
- * @param {*} widthSelf 是否包含自己
54
- * @param {*} result
55
- * @returns []
56
- */
57
- export const getNodeKeys = (node, widthSelf = true, result = []) => {
58
- if (widthSelf) {
59
- result.push(node.value);
60
- }
61
- if (Array.isArray(node.children) && !!node.children.length) {
62
- node.children.forEach(element => {
63
- result = [...result, ...getNodeKeys(element)];
64
- });
65
- }
66
- return result;
67
- };
68
- /**
69
- * 扁平树
70
- * @param {*} treeData
71
- * @param {*} expandedKeys 展开的节点
72
- * @param {*} treeDefaultExpandAll
73
- * @param {*} level
74
- * @param {*} result
75
- * @returns
76
- */
77
- export const flatTreeData = (treeData, filterKey = '', expandedKeys = [], treeDefaultExpandAll = false, level = 0, result = []) => {
11
+ children: 'children',
12
+ disabled: 'disabled'
13
+ }, parents = [], result = {}) => {
78
14
  if (Array.isArray(treeData)) {
79
- for (const i of treeData) {
80
- const {
81
- value,
82
- children,
83
- titleTotal,
84
- title
85
- } = i,
86
- rest = __rest(i, ["value", "children", "titleTotal", "title"]);
87
- // 判断是否命中过滤
88
- let bingo = true;
89
- const transFilterKey = !['', null, undefined].includes(filterKey);
90
- if (transFilterKey) {
91
- bingo = Array.isArray(titleTotal) ? titleTotal.some(i => i.includes(filterKey)) : false;
92
- }
93
- if (bingo) {
94
- result.push({
95
- value,
96
- children,
97
- title,
98
- level,
99
- titleTotal
100
- });
101
- }
102
- const selfIn = Array.isArray(expandedKeys) ? expandedKeys.includes(value) : false;
103
- if ((treeDefaultExpandAll || selfIn || transFilterKey && bingo) && Array.isArray(children) && !!children.length) {
104
- result = [...result, ...flatTreeData(children, filterKey, expandedKeys, treeDefaultExpandAll, level + 1)];
105
- }
106
- }
15
+ treeData.forEach(i => {
16
+ result[i[fieldNames['value']]] = parents;
17
+ if (Array.isArray(i[fieldNames['children']])) {
18
+ const list = flatWithParents(i[fieldNames['children']], fieldNames, [...parents, i[fieldNames['value']]]);
19
+ result = Object.assign(Object.assign({}, result), list);
20
+ } else {}
21
+ });
107
22
  }
108
23
  return result;
109
24
  };
110
- /**
111
- * 获取所有展开的节点 (组件传入最后一层,需要将其上层全部加入到expandedKeys)
112
- * @param {*} treeDataWithKeys
113
- * @param {*} treeExpandedKeys
114
- * @param {*} result
115
- * @returns
116
- */
117
- export const getFullExpandedKeys = (treeDataWithKeys, treeExpandedKeys = [], treeDefaultExpandAll, result = []) => {
118
- if (!treeDefaultExpandAll && (!Array.isArray(treeDataWithKeys) || !treeDataWithKeys.length || !Array.isArray(treeExpandedKeys) || !treeExpandedKeys.length)) {
119
- return [];
25
+ export const filterLastestNode = (treeNodeWithParents, item, list) => {
26
+ const parents = treeNodeWithParents[item] || {};
27
+ if (Array.isArray(parents) && !!parents.length && Array.isArray(list) && !!list.length) {
28
+ return parents.every(el => !list.includes(el));
120
29
  }
121
- treeDataWithKeys.forEach(i => {
122
- const {
123
- keys,
124
- value,
125
- children
126
- } = i;
127
- if (treeDefaultExpandAll || Array.isArray(keys) && keys.some(el => treeExpandedKeys.includes(el))) {
128
- result.push(value);
129
- if (Array.isArray(children) && !!children.length) {
130
- result = [...result, ...getFullExpandedKeys(children, treeExpandedKeys, treeDefaultExpandAll)];
131
- }
132
- }
133
- });
134
- return result;
30
+ return false;
135
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/tntd-virtual-tree-select/utils.js"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,UAAU,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;IACjH,IAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE;QAC/C,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAC3B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAA;YAC5C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAA;YACtC,IAA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IAAG,oBAAoB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;YAClG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAElB,IAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE;gBAC/C,MAAM,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,oBAAoB,CAAC,CAAC,CAAA;aAC/F;SACF;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC,CAAA","sourcesContent":["/**\n * 初始化给树的每个节点增加一个keys字段(数组),keys的值是当前节点下的所有子节点的value和\n * 用于判断后续展开/收起\n * @param {*} treeData \n */\nexport const addTreeNodeKeys = (treeData, fieldNames = { title: 'title', value: 'value', children: 'children' }) => {\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 query.children = addTreeNodeKeys(children, fieldNames)\n } \n return {\n ...query,\n title: query[fieldNames['title']],\n value: query[fieldNames['value']],\n keys: getNodeKeys(query),\n titleTotal: getNodeStr(query, fieldNames['title'])\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 getNodeKeys = (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, ...getNodeKeys(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({ value, children, title, level, titleTotal })\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(!treeDefaultExpandAll && (!Array.isArray(treeDataWithKeys) || !treeDataWithKeys.length || !Array.isArray(treeExpandedKeys) || !treeExpandedKeys.length)) {\n return []\n }\n \n treeDataWithKeys.forEach(i => {\n const { keys, value, children } = i;\n\n if(treeDefaultExpandAll || (Array.isArray(keys) && keys.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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IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE;QACrF,OAAO,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA;KAC/C;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA","sourcesContent":["/**\n * 给每个节点增加一个parent字段,记录其父节点用于showCheckedStrategy\n * @param {*} treeData \n * @param {*} fieldNames \n * @param {*} parents \n * @returns \n */\nexport const flatWithParents = (treeData, fieldNames = { title: 'title', value: 'value', children: 'children', disabled: 'disabled' }, parents = [], result = {}) => {\n if(Array.isArray(treeData)) {\n treeData.forEach(i => {\n result[i[fieldNames['value']]] = parents;\n if(Array.isArray(i[fieldNames['children']])){\n const list = flatWithParents(i[fieldNames['children']], fieldNames, [...parents, i[fieldNames['value']]])\n result = {...result, ...list}\n }else{\n \n }\n })\n }\n return result\n}\n\nexport const filterLastestNode = (treeNodeWithParents, item, list) => {\n const parents = treeNodeWithParents[item] || {}\n \n if(Array.isArray(parents) && !!parents.length && Array.isArray(list) && !!list.length) {\n return parents.every(el => !list.includes(el))\n }\n\n return false\n}\n\n"]}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.defaultIconPrefixCls = exports.ConfigContext = exports.ConfigConsumer = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
9
  var defaultGetPrefixCls = function defaultGetPrefixCls(suffixCls, customizePrefixCls) {
10
10
  if (customizePrefixCls) return customizePrefixCls;
11
11
  return "tnt-".concat(suffixCls);
@@ -8,7 +8,7 @@ exports["default"] = void 0;
8
8
  var React = _interopRequireWildcard(require("react"));
9
9
  var _context = require("./context");
10
10
  var _LocaleReceiver = _interopRequireDefault(require("antd/lib/locale-provider/LocaleReceiver"));
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
12
12
  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); }
13
13
  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; }
14
14
  /*
@@ -9,12 +9,12 @@ var React = _interopRequireWildcard(require("react"));
9
9
  var _styleChecker = require("../styleChecker");
10
10
  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); }
11
11
  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; }
12
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
13
13
  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."); }
14
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
+ 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; } }
15
+ 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; }
16
16
  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; } }
17
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
18
18
  var _default = exports["default"] = function _default() {
19
19
  var _React$useState = React.useState(false),
20
20
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -8,12 +8,12 @@ exports["default"] = useForceUpdate;
8
8
  var React = _interopRequireWildcard(require("react"));
9
9
  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); }
10
10
  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; }
11
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
12
12
  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."); }
13
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
13
+ 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; } }
14
+ 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; }
15
15
  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; } }
16
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
17
17
  function useForceUpdate() {
18
18
  var _React$useReducer = React.useReducer(function (x) {
19
19
  return x + 1;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.responsiveMap = exports.responsiveArray = exports["default"] = void 0;
7
7
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
8
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
9
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
10
10
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
11
  var responsiveArray = exports.responsiveArray = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "isStyleSupport", {
12
12
  });
13
13
  var _canUseDom = _interopRequireDefault(require("rc-util/lib/Dom/canUseDom"));
14
14
  var _styleChecker = require("rc-util/lib/Dom/styleChecker");
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
16
16
  var canUseDocElement = exports.canUseDocElement = function canUseDocElement() {
17
17
  return (0, _canUseDom["default"])() && window.document.documentElement;
18
18
  };
@@ -7,7 +7,7 @@ exports["default"] = void 0;
7
7
  var _classnames = _interopRequireDefault(require("classnames"));
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  require("./index.less");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
11
  var ProCardActions = function ProCardActions(props) {
12
12
  var actions = props.actions,
13
13
  prefixCls = props.prefixCls;
@@ -23,11 +23,11 @@ Object.keys(_alert).forEach(function (key) {
23
23
  });
24
24
  });
25
25
  var _classnames = _interopRequireDefault(require("classnames"));
26
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
26
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
27
27
  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); }
28
28
  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; }
29
29
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
30
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
30
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
31
31
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
32
32
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
33
33
  var __rest = void 0 && (void 0).__rest || function (s, e) {
@@ -19,5 +19,5 @@ Object.keys(_alert2).forEach(function (key) {
19
19
  }
20
20
  });
21
21
  });
22
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
22
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
23
23
  var _default = exports["default"] = _alert["default"];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/array-input/index.js"],"names":[],"mappings":"AA+TA,sEAQC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/array-input/index.js"],"names":[],"mappings":"AAsUA,sEAQC"}
@@ -26,20 +26,20 @@ var _tooltip = _interopRequireDefault(require("../tooltip"));
26
26
  require("./index.less");
27
27
  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); }
28
28
  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; }
29
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
30
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
29
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
30
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
31
31
  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."); }
32
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
33
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
34
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
32
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
33
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
34
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
35
35
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
36
36
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
37
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
37
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
38
38
  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."); }
39
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
40
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
39
+ 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; } }
40
+ 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; }
41
41
  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; } }
42
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
42
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
43
43
  var __rest = void 0 && (void 0).__rest || function (s, e) {
44
44
  var t = {};
45
45
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
@@ -130,7 +130,20 @@ function ArrayInput(_ref) {
130
130
  _value = _useState2[0],
131
131
  setValue = _useState2[1];
132
132
  (0, _react.useEffect)(function () {
133
- setValue(value);
133
+ var newValue = value;
134
+ // 如果数组没有key
135
+ if (Array.isArray(value) && value.some(function (obj) {
136
+ return !obj.key;
137
+ })) {
138
+ newValue = value.map(function (obj) {
139
+ return Object.assign(Object.assign({}, obj), {
140
+ key: obj.key || key++
141
+ });
142
+ });
143
+ _onChange(newValue);
144
+ } else {
145
+ setValue(newValue);
146
+ }
134
147
  }, [value]);
135
148
  var _onChange = (0, _react.useCallback)(function (value) {
136
149
  if (onChange) {