tntd 2.0.1 → 2.0.3

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 (415) hide show
  1. package/es/ellipsis/index.js +1 -1
  2. package/es/ellipsis/index.js.map +1 -1
  3. package/es/exception/exception.js +34 -0
  4. package/es/exception/exception.js.map +1 -0
  5. package/es/exception/exception.less +29 -0
  6. package/es/exception/index.js +5 -0
  7. package/es/exception/index.js.map +1 -0
  8. package/es/handle/index.js +52 -33
  9. package/es/handle/index.js.map +1 -1
  10. package/es/index.js +2 -0
  11. package/es/index.js.map +1 -1
  12. package/es/locale/default.js +3 -2
  13. package/es/locale/default.js.map +1 -1
  14. package/es/locale/en_US.js +13 -1
  15. package/es/locale/en_US.js.map +1 -1
  16. package/es/locale/zh_CN.js +13 -1
  17. package/es/locale/zh_CN.js.map +1 -1
  18. package/es/page/index.js +1 -1
  19. package/es/page/index.js.map +1 -1
  20. package/es/prev-locale.js +7 -1
  21. package/es/prev-locale.js.map +1 -1
  22. package/es/steps/index.js +3 -2
  23. package/es/steps/index.js.map +1 -1
  24. package/es/steps/steps.js +46 -0
  25. package/es/steps/steps.js.map +1 -0
  26. package/es/steps/style/index.less +11 -0
  27. package/es/steps/style/nav.less +273 -0
  28. package/es/steps/style/small.less +5 -0
  29. package/es/tntd-cascader/AntdCascader/component/DisabledContext.js +8 -0
  30. package/es/tntd-cascader/AntdCascader/component/DisabledContext.js.map +1 -0
  31. package/es/tntd-cascader/AntdCascader/component/FormItemInputContext.js +3 -0
  32. package/es/tntd-cascader/AntdCascader/component/FormItemInputContext.js.map +1 -0
  33. package/es/tntd-cascader/AntdCascader/component/SizeContext.js +3 -0
  34. package/es/tntd-cascader/AntdCascader/component/SizeContext.js.map +1 -0
  35. package/es/tntd-cascader/AntdCascader/component/context.js +14 -0
  36. package/es/tntd-cascader/AntdCascader/component/context.js.map +1 -0
  37. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +20 -0
  38. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -0
  39. package/es/tntd-cascader/AntdCascader/component/getIcons.js +52 -0
  40. package/es/tntd-cascader/AntdCascader/component/getIcons.js.map +1 -0
  41. package/es/tntd-cascader/AntdCascader/component/useCompactItemContext.js +24 -0
  42. package/es/tntd-cascader/AntdCascader/component/useCompactItemContext.js.map +1 -0
  43. package/es/tntd-cascader/AntdCascader/config/utils.js +24 -0
  44. package/es/tntd-cascader/AntdCascader/config/utils.js.map +1 -0
  45. package/es/tntd-cascader/AntdCascader/config/warning.js +15 -0
  46. package/es/tntd-cascader/AntdCascader/config/warning.js.map +1 -0
  47. package/es/tntd-cascader/AntdCascader/index.css +2327 -0
  48. package/es/tntd-cascader/AntdCascader/index.js +149 -0
  49. package/es/tntd-cascader/AntdCascader/index.js.map +1 -0
  50. package/es/tntd-cascader/AntdCascader/interface.js +5 -0
  51. package/es/tntd-cascader/AntdCascader/interface.js.map +1 -0
  52. package/es/tntd-cascader/img/no-data-s.png +0 -0
  53. package/es/tntd-cascader/index.js +2 -0
  54. package/es/tntd-cascader/index.js.map +1 -0
  55. package/es/tntd-cascader/rc-cascader/Cascader.js +270 -0
  56. package/es/tntd-cascader/rc-cascader/Cascader.js.map +1 -0
  57. package/es/tntd-cascader/rc-cascader/OptionList/Checkbox.js +14 -0
  58. package/es/tntd-cascader/rc-cascader/OptionList/Checkbox.js.map +1 -0
  59. package/es/tntd-cascader/rc-cascader/OptionList/Column.js +126 -0
  60. package/es/tntd-cascader/rc-cascader/OptionList/Column.js.map +1 -0
  61. package/es/tntd-cascader/rc-cascader/OptionList/index.js +140 -0
  62. package/es/tntd-cascader/rc-cascader/OptionList/index.js.map +1 -0
  63. package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +24 -0
  64. package/es/tntd-cascader/rc-cascader/OptionList/useActive.js.map +1 -0
  65. package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +145 -0
  66. package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js.map +1 -0
  67. package/es/tntd-cascader/rc-cascader/context.js +4 -0
  68. package/es/tntd-cascader/rc-cascader/context.js.map +1 -0
  69. package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +41 -0
  70. package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js.map +1 -0
  71. package/es/tntd-cascader/rc-cascader/hooks/useEntities.js +30 -0
  72. package/es/tntd-cascader/rc-cascader/hooks/useEntities.js.map +1 -0
  73. package/es/tntd-cascader/rc-cascader/hooks/useMissingValues.js +19 -0
  74. package/es/tntd-cascader/rc-cascader/hooks/useMissingValues.js.map +1 -0
  75. package/es/tntd-cascader/rc-cascader/hooks/useRefFunc.js +15 -0
  76. package/es/tntd-cascader/rc-cascader/hooks/useRefFunc.js.map +1 -0
  77. package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +26 -0
  78. package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js.map +1 -0
  79. package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +46 -0
  80. package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js.map +1 -0
  81. package/es/tntd-cascader/rc-cascader/index.js +3 -0
  82. package/es/tntd-cascader/rc-cascader/index.js.map +1 -0
  83. package/es/tntd-cascader/rc-cascader/index.less +19 -0
  84. package/es/tntd-cascader/rc-cascader/utils/commonUtil.js +41 -0
  85. package/es/tntd-cascader/rc-cascader/utils/commonUtil.js.map +1 -0
  86. package/es/tntd-cascader/rc-cascader/utils/treeUtil.js +37 -0
  87. package/es/tntd-cascader/rc-cascader/utils/treeUtil.js.map +1 -0
  88. package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +30 -0
  89. package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js.map +1 -0
  90. package/es/tntd-layout/Avatar.js +25 -19
  91. package/es/tntd-layout/Avatar.js.map +1 -1
  92. package/es/tntd-layout/EnterpriseLayout/Avatar.js +10 -8
  93. package/es/tntd-layout/EnterpriseLayout/Avatar.js.map +1 -1
  94. package/es/tntd-layout/EnterpriseLayout/Language.js +5 -4
  95. package/es/tntd-layout/EnterpriseLayout/Language.js.map +1 -1
  96. package/es/tntd-layout/EnterpriseLayout/Theme.js +7 -6
  97. package/es/tntd-layout/EnterpriseLayout/Theme.js.map +1 -1
  98. package/es/tntd-layout/HeaderActions.js +5 -4
  99. package/es/tntd-layout/HeaderActions.js.map +1 -1
  100. package/es/tntd-layout/Layout.js +2 -2
  101. package/es/tntd-layout/Layout.js.map +1 -1
  102. package/es/tntd-layout/SideMenu.js.map +1 -1
  103. package/es/tntd-layout/index.js +2 -2
  104. package/es/tntd-layout/index.js.map +1 -1
  105. package/es/tntd-layout/storage.js +10 -2
  106. package/es/tntd-layout/storage.js.map +1 -1
  107. package/lib/ellipsis/index.js +1 -1
  108. package/lib/ellipsis/index.js.map +1 -1
  109. package/lib/exception/exception.d.ts +16 -0
  110. package/lib/exception/exception.d.ts.map +1 -0
  111. package/lib/exception/exception.js +41 -0
  112. package/lib/exception/exception.js.map +1 -0
  113. package/lib/exception/exception.less +29 -0
  114. package/lib/exception/index.d.ts +5 -0
  115. package/lib/exception/index.d.ts.map +1 -0
  116. package/lib/exception/index.js +21 -0
  117. package/lib/exception/index.js.map +1 -0
  118. package/lib/handle/index.d.ts.map +1 -1
  119. package/lib/handle/index.js +52 -33
  120. package/lib/handle/index.js.map +1 -1
  121. package/lib/index.d.ts +2 -0
  122. package/lib/index.d.ts.map +1 -1
  123. package/lib/index.js +5 -1
  124. package/lib/index.js.map +1 -1
  125. package/lib/locale/default.d.ts +13 -1
  126. package/lib/locale/default.d.ts.map +1 -1
  127. package/lib/locale/default.js +3 -3
  128. package/lib/locale/default.js.map +1 -1
  129. package/lib/locale/en_US.d.ts +13 -1
  130. package/lib/locale/en_US.d.ts.map +1 -1
  131. package/lib/locale/en_US.js +13 -2
  132. package/lib/locale/en_US.js.map +1 -1
  133. package/lib/locale/zh_CN.d.ts +13 -1
  134. package/lib/locale/zh_CN.d.ts.map +1 -1
  135. package/lib/locale/zh_CN.js +13 -2
  136. package/lib/locale/zh_CN.js.map +1 -1
  137. package/lib/page/index.js +1 -1
  138. package/lib/page/index.js.map +1 -1
  139. package/lib/prev-locale.d.ts +6 -0
  140. package/lib/prev-locale.d.ts.map +1 -1
  141. package/lib/prev-locale.js +7 -1
  142. package/lib/prev-locale.js.map +1 -1
  143. package/lib/steps/index.d.ts +3 -2
  144. package/lib/steps/index.d.ts.map +1 -1
  145. package/lib/steps/index.js +4 -6
  146. package/lib/steps/index.js.map +1 -1
  147. package/lib/steps/steps.d.ts +12 -0
  148. package/lib/steps/steps.d.ts.map +1 -0
  149. package/lib/steps/steps.js +67 -0
  150. package/lib/steps/steps.js.map +1 -0
  151. package/lib/steps/style/index.less +11 -0
  152. package/lib/steps/style/nav.less +273 -0
  153. package/lib/steps/style/small.less +5 -0
  154. package/lib/tntd-cascader/AntdCascader/component/DisabledContext.d.ts +10 -0
  155. package/lib/tntd-cascader/AntdCascader/component/DisabledContext.d.ts.map +1 -0
  156. package/lib/tntd-cascader/AntdCascader/component/DisabledContext.js +35 -0
  157. package/lib/tntd-cascader/AntdCascader/component/DisabledContext.js.map +1 -0
  158. package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.d.ts +4 -0
  159. package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.d.ts.map +1 -0
  160. package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.js +29 -0
  161. package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.js.map +1 -0
  162. package/lib/tntd-cascader/AntdCascader/component/SizeContext.d.ts +4 -0
  163. package/lib/tntd-cascader/AntdCascader/component/SizeContext.d.ts.map +1 -0
  164. package/lib/tntd-cascader/AntdCascader/component/SizeContext.js +29 -0
  165. package/lib/tntd-cascader/AntdCascader/component/SizeContext.js.map +1 -0
  166. package/lib/tntd-cascader/AntdCascader/component/context.d.ts +42 -0
  167. package/lib/tntd-cascader/AntdCascader/component/context.d.ts.map +1 -0
  168. package/lib/tntd-cascader/AntdCascader/component/context.js +20 -0
  169. package/lib/tntd-cascader/AntdCascader/component/context.js.map +1 -0
  170. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.d.ts +5 -0
  171. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.d.ts.map +1 -0
  172. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +48 -0
  173. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -0
  174. package/lib/tntd-cascader/AntdCascader/component/getIcons.d.ts +25 -0
  175. package/lib/tntd-cascader/AntdCascader/component/getIcons.d.ts.map +1 -0
  176. package/lib/tntd-cascader/AntdCascader/component/getIcons.js +78 -0
  177. package/lib/tntd-cascader/AntdCascader/component/getIcons.js.map +1 -0
  178. package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.d.ts +9 -0
  179. package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.d.ts.map +1 -0
  180. package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +54 -0
  181. package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js.map +1 -0
  182. package/lib/tntd-cascader/AntdCascader/config/utils.d.ts +6 -0
  183. package/lib/tntd-cascader/AntdCascader/config/utils.d.ts.map +1 -0
  184. package/lib/tntd-cascader/AntdCascader/config/utils.js +34 -0
  185. package/lib/tntd-cascader/AntdCascader/config/utils.js.map +1 -0
  186. package/lib/tntd-cascader/AntdCascader/config/warning.d.ts +4 -0
  187. package/lib/tntd-cascader/AntdCascader/config/warning.d.ts.map +1 -0
  188. package/lib/tntd-cascader/AntdCascader/config/warning.js +40 -0
  189. package/lib/tntd-cascader/AntdCascader/config/warning.js.map +1 -0
  190. package/lib/tntd-cascader/AntdCascader/index.css +2327 -0
  191. package/lib/tntd-cascader/AntdCascader/index.d.ts +44 -0
  192. package/lib/tntd-cascader/AntdCascader/index.d.ts.map +1 -0
  193. package/lib/tntd-cascader/AntdCascader/index.js +177 -0
  194. package/lib/tntd-cascader/AntdCascader/index.js.map +1 -0
  195. package/lib/tntd-cascader/AntdCascader/interface.d.ts +25 -0
  196. package/lib/tntd-cascader/AntdCascader/interface.d.ts.map +1 -0
  197. package/lib/tntd-cascader/AntdCascader/interface.js +9 -0
  198. package/lib/tntd-cascader/AntdCascader/interface.js.map +1 -0
  199. package/lib/tntd-cascader/img/no-data-s.png +0 -0
  200. package/lib/tntd-cascader/index.d.ts +2 -0
  201. package/lib/tntd-cascader/index.d.ts.map +1 -0
  202. package/lib/tntd-cascader/index.js +9 -0
  203. package/lib/tntd-cascader/index.js.map +1 -0
  204. package/lib/tntd-cascader/rc-cascader/Cascader.d.ts +92 -0
  205. package/lib/tntd-cascader/rc-cascader/Cascader.d.ts.map +1 -0
  206. package/lib/tntd-cascader/rc-cascader/Cascader.js +298 -0
  207. package/lib/tntd-cascader/rc-cascader/Cascader.js.map +1 -0
  208. package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.d.ts +10 -0
  209. package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.d.ts.map +1 -0
  210. package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +43 -0
  211. package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js.map +1 -0
  212. package/lib/tntd-cascader/rc-cascader/OptionList/Column.d.ts +26 -0
  213. package/lib/tntd-cascader/rc-cascader/OptionList/Column.d.ts.map +1 -0
  214. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +156 -0
  215. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js.map +1 -0
  216. package/lib/tntd-cascader/rc-cascader/OptionList/index.d.ts +5 -0
  217. package/lib/tntd-cascader/rc-cascader/OptionList/index.d.ts.map +1 -0
  218. package/lib/tntd-cascader/rc-cascader/OptionList/index.js +168 -0
  219. package/lib/tntd-cascader/rc-cascader/OptionList/index.js.map +1 -0
  220. package/lib/tntd-cascader/rc-cascader/OptionList/useActive.d.ts +7 -0
  221. package/lib/tntd-cascader/rc-cascader/OptionList/useActive.d.ts.map +1 -0
  222. package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +52 -0
  223. package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js.map +1 -0
  224. package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.d.ts +6 -0
  225. package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.d.ts.map +1 -0
  226. package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +173 -0
  227. package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js.map +1 -0
  228. package/lib/tntd-cascader/rc-cascader/context.d.ts +26 -0
  229. package/lib/tntd-cascader/rc-cascader/context.d.ts.map +1 -0
  230. package/lib/tntd-cascader/rc-cascader/context.js +29 -0
  231. package/lib/tntd-cascader/rc-cascader/context.js.map +1 -0
  232. package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.d.ts +11 -0
  233. package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.d.ts.map +1 -0
  234. package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +66 -0
  235. package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js.map +1 -0
  236. package/lib/tntd-cascader/rc-cascader/hooks/useEntities.d.ts +11 -0
  237. package/lib/tntd-cascader/rc-cascader/hooks/useEntities.d.ts.map +1 -0
  238. package/lib/tntd-cascader/rc-cascader/hooks/useEntities.js +55 -0
  239. package/lib/tntd-cascader/rc-cascader/hooks/useEntities.js.map +1 -0
  240. package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.d.ts +4 -0
  241. package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.d.ts.map +1 -0
  242. package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.js +44 -0
  243. package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.js.map +1 -0
  244. package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.d.ts +6 -0
  245. package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.d.ts.map +1 -0
  246. package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.js +41 -0
  247. package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.js.map +1 -0
  248. package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.d.ts +3 -0
  249. package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.d.ts.map +1 -0
  250. package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +55 -0
  251. package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js.map +1 -0
  252. package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.d.ts +5 -0
  253. package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.d.ts.map +1 -0
  254. package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +72 -0
  255. package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js.map +1 -0
  256. package/lib/tntd-cascader/rc-cascader/index.d.ts +4 -0
  257. package/lib/tntd-cascader/rc-cascader/index.d.ts.map +1 -0
  258. package/lib/tntd-cascader/rc-cascader/index.js +8 -0
  259. package/lib/tntd-cascader/rc-cascader/index.js.map +1 -0
  260. package/lib/tntd-cascader/rc-cascader/index.less +19 -0
  261. package/lib/tntd-cascader/rc-cascader/utils/commonUtil.d.ts +11 -0
  262. package/lib/tntd-cascader/rc-cascader/utils/commonUtil.d.ts.map +1 -0
  263. package/lib/tntd-cascader/rc-cascader/utils/commonUtil.js +50 -0
  264. package/lib/tntd-cascader/rc-cascader/utils/commonUtil.js.map +1 -0
  265. package/lib/tntd-cascader/rc-cascader/utils/treeUtil.d.ts +10 -0
  266. package/lib/tntd-cascader/rc-cascader/utils/treeUtil.d.ts.map +1 -0
  267. package/lib/tntd-cascader/rc-cascader/utils/treeUtil.js +42 -0
  268. package/lib/tntd-cascader/rc-cascader/utils/treeUtil.js.map +1 -0
  269. package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.d.ts +5 -0
  270. package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.d.ts.map +1 -0
  271. package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +37 -0
  272. package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js.map +1 -0
  273. package/lib/tntd-layout/Avatar.d.ts.map +1 -1
  274. package/lib/tntd-layout/Avatar.js +25 -19
  275. package/lib/tntd-layout/Avatar.js.map +1 -1
  276. package/lib/tntd-layout/EnterpriseLayout/Avatar.d.ts.map +1 -1
  277. package/lib/tntd-layout/EnterpriseLayout/Avatar.js +10 -8
  278. package/lib/tntd-layout/EnterpriseLayout/Avatar.js.map +1 -1
  279. package/lib/tntd-layout/EnterpriseLayout/Language.js +4 -3
  280. package/lib/tntd-layout/EnterpriseLayout/Language.js.map +1 -1
  281. package/lib/tntd-layout/EnterpriseLayout/Theme.js +6 -5
  282. package/lib/tntd-layout/EnterpriseLayout/Theme.js.map +1 -1
  283. package/lib/tntd-layout/HeaderActions.js +5 -4
  284. package/lib/tntd-layout/HeaderActions.js.map +1 -1
  285. package/lib/tntd-layout/Layout.js +2 -2
  286. package/lib/tntd-layout/Layout.js.map +1 -1
  287. package/lib/tntd-layout/SideMenu.js.map +1 -1
  288. package/lib/tntd-layout/index.d.ts.map +1 -1
  289. package/lib/tntd-layout/index.js +2 -2
  290. package/lib/tntd-layout/index.js.map +1 -1
  291. package/lib/tntd-layout/storage.d.ts +3 -2
  292. package/lib/tntd-layout/storage.d.ts.map +1 -1
  293. package/lib/tntd-layout/storage.js +15 -3
  294. package/lib/tntd-layout/storage.js.map +1 -1
  295. package/package.json +11 -2
  296. package/es/array-input/style/index.js +0 -2
  297. package/es/array-input/style/index.js.map +0 -1
  298. package/es/auth-context/style/index.js +0 -2
  299. package/es/auth-context/style/index.js.map +0 -1
  300. package/es/development-login/style/index.js +0 -2
  301. package/es/development-login/style/index.js.map +0 -1
  302. package/es/ellipsis/style/index.js +0 -2
  303. package/es/ellipsis/style/index.js.map +0 -1
  304. package/es/empty/render-empty.js +0 -19
  305. package/es/empty/render-empty.js.map +0 -1
  306. package/es/empty/style/index.js +0 -3
  307. package/es/empty/style/index.js.map +0 -1
  308. package/es/handle/style/index.js +0 -2
  309. package/es/handle/style/index.js.map +0 -1
  310. package/es/icon-list/style/index.js +0 -120
  311. package/es/icon-list/style/index.js.map +0 -1
  312. package/es/img/style/index.js +0 -2
  313. package/es/img/style/index.js.map +0 -1
  314. package/es/loading-button/style/index.js +0 -2
  315. package/es/loading-button/style/index.js.map +0 -1
  316. package/es/page/style/index.js +0 -2
  317. package/es/page/style/index.js.map +0 -1
  318. package/es/query-form/style/index.js +0 -2
  319. package/es/query-form/style/index.js.map +0 -1
  320. package/es/query-list-scene/style/index.js +0 -2
  321. package/es/query-list-scene/style/index.js.map +0 -1
  322. package/es/render-empty/style/index.js +0 -2
  323. package/es/render-empty/style/index.js.map +0 -1
  324. package/es/table/style/index.js +0 -3
  325. package/es/table/style/index.js.map +0 -1
  326. package/es/title/style/index.js +0 -2
  327. package/es/title/style/index.js.map +0 -1
  328. package/es/tntd-icon/style/index.js +0 -2
  329. package/es/tntd-icon/style/index.js.map +0 -1
  330. package/es/tntd-layout/style/index.js +0 -2
  331. package/es/tntd-layout/style/index.js.map +0 -1
  332. package/es/tntd-modal/style/index.js +0 -2
  333. package/es/tntd-modal/style/index.js.map +0 -1
  334. package/es/tntd-select/style/index.js +0 -2
  335. package/es/tntd-select/style/index.js.map +0 -1
  336. package/lib/array-input/style/index.d.ts +0 -1
  337. package/lib/array-input/style/index.d.ts.map +0 -1
  338. package/lib/array-input/style/index.js +0 -2
  339. package/lib/array-input/style/index.js.map +0 -1
  340. package/lib/auth-context/style/index.d.ts +0 -1
  341. package/lib/auth-context/style/index.d.ts.map +0 -1
  342. package/lib/auth-context/style/index.js +0 -2
  343. package/lib/auth-context/style/index.js.map +0 -1
  344. package/lib/development-login/style/index.d.ts +0 -1
  345. package/lib/development-login/style/index.d.ts.map +0 -1
  346. package/lib/development-login/style/index.js +0 -2
  347. package/lib/development-login/style/index.js.map +0 -1
  348. package/lib/ellipsis/style/index.d.ts +0 -1
  349. package/lib/ellipsis/style/index.d.ts.map +0 -1
  350. package/lib/ellipsis/style/index.js +0 -2
  351. package/lib/ellipsis/style/index.js.map +0 -1
  352. package/lib/empty/render-empty.d.ts +0 -3
  353. package/lib/empty/render-empty.d.ts.map +0 -1
  354. package/lib/empty/render-empty.js +0 -26
  355. package/lib/empty/render-empty.js.map +0 -1
  356. package/lib/empty/style/index.d.ts +0 -3
  357. package/lib/empty/style/index.d.ts.map +0 -1
  358. package/lib/empty/style/index.js +0 -5
  359. package/lib/empty/style/index.js.map +0 -1
  360. package/lib/handle/style/index.d.ts +0 -1
  361. package/lib/handle/style/index.d.ts.map +0 -1
  362. package/lib/handle/style/index.js +0 -2
  363. package/lib/handle/style/index.js.map +0 -1
  364. package/lib/icon-list/style/index.d.ts +0 -3
  365. package/lib/icon-list/style/index.d.ts.map +0 -1
  366. package/lib/icon-list/style/index.js +0 -122
  367. package/lib/icon-list/style/index.js.map +0 -1
  368. package/lib/img/style/index.d.ts +0 -1
  369. package/lib/img/style/index.d.ts.map +0 -1
  370. package/lib/img/style/index.js +0 -2
  371. package/lib/img/style/index.js.map +0 -1
  372. package/lib/loading-button/style/index.d.ts +0 -1
  373. package/lib/loading-button/style/index.d.ts.map +0 -1
  374. package/lib/loading-button/style/index.js +0 -2
  375. package/lib/loading-button/style/index.js.map +0 -1
  376. package/lib/page/style/index.d.ts +0 -1
  377. package/lib/page/style/index.d.ts.map +0 -1
  378. package/lib/page/style/index.js +0 -2
  379. package/lib/page/style/index.js.map +0 -1
  380. package/lib/query-form/style/index.d.ts +0 -1
  381. package/lib/query-form/style/index.d.ts.map +0 -1
  382. package/lib/query-form/style/index.js +0 -2
  383. package/lib/query-form/style/index.js.map +0 -1
  384. package/lib/query-list-scene/style/index.d.ts +0 -1
  385. package/lib/query-list-scene/style/index.d.ts.map +0 -1
  386. package/lib/query-list-scene/style/index.js +0 -2
  387. package/lib/query-list-scene/style/index.js.map +0 -1
  388. package/lib/render-empty/style/index.d.ts +0 -2
  389. package/lib/render-empty/style/index.d.ts.map +0 -1
  390. package/lib/render-empty/style/index.js +0 -4
  391. package/lib/render-empty/style/index.js.map +0 -1
  392. package/lib/table/style/index.d.ts +0 -3
  393. package/lib/table/style/index.d.ts.map +0 -1
  394. package/lib/table/style/index.js +0 -5
  395. package/lib/table/style/index.js.map +0 -1
  396. package/lib/title/style/index.d.ts +0 -1
  397. package/lib/title/style/index.d.ts.map +0 -1
  398. package/lib/title/style/index.js +0 -2
  399. package/lib/title/style/index.js.map +0 -1
  400. package/lib/tntd-icon/style/index.d.ts +0 -1
  401. package/lib/tntd-icon/style/index.d.ts.map +0 -1
  402. package/lib/tntd-icon/style/index.js +0 -2
  403. package/lib/tntd-icon/style/index.js.map +0 -1
  404. package/lib/tntd-layout/style/index.d.ts +0 -1
  405. package/lib/tntd-layout/style/index.d.ts.map +0 -1
  406. package/lib/tntd-layout/style/index.js +0 -2
  407. package/lib/tntd-layout/style/index.js.map +0 -1
  408. package/lib/tntd-modal/style/index.d.ts +0 -1
  409. package/lib/tntd-modal/style/index.d.ts.map +0 -1
  410. package/lib/tntd-modal/style/index.js +0 -2
  411. package/lib/tntd-modal/style/index.js.map +0 -1
  412. package/lib/tntd-select/style/index.d.ts +0 -1
  413. package/lib/tntd-select/style/index.d.ts.map +0 -1
  414. package/lib/tntd-select/style/index.js +0 -2
  415. package/lib/tntd-select/style/index.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDisplayValues.js","sourceRoot":"","sources":["../../../../src/tntd-cascader/rc-cascader/hooks/useDisplayValues.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,gDAAkD;AAClD,6CAA+B;AAO/B,oDAAgD;AAEhD,kBAAe,CACb,SAA4B,EAC5B,OAA4B,EAC5B,UAA8B,EAC9B,QAAiB,EACjB,aAA6C,EAC7C,EAAE;IACF,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACxB,MAAM,mBAAmB,GACvB,aAAa;YACb,wBAAwB;YACxB,CAAC,CAAC,MAAM,EAAE,EAAE;gBACV,MAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;gBAC1D,MAAM,KAAK,GAAG,KAAK,CAAC;gBAEpB,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAC,EAAE;oBAC9E,OAAO,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBACjC;gBAED,mDAAmD;gBACnD,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;oBAChD,MAAM,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;wBAC5C,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;wBAC3C,CAAC,CAAC,KAAK,CAAC;oBAEV,IAAI,KAAK,KAAK,CAAC,EAAE;wBACf,OAAO,CAAC,UAAU,CAAC,CAAC;qBACrB;oBAED,OAAO,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;gBACtC,CAAC,EAAE,EAAE,CAAC,CAAC;YACT,CAAC,CAAC,CAAC;QAEL,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;;YAClC,MAAM,YAAY,GAAG,IAAA,wBAAa,EAAC,UAAU,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAEpE,MAAM,KAAK,GAAG,mBAAmB,CAC/B,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,WAAC,OAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,UAAU,CAAC,KAAK,CAAC,mCAAI,KAAK,CAAA,EAAA,CAAC,EAC5E,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,CACzC,CAAC;YAEF,MAAM,KAAK,GAAG,IAAA,sBAAS,EAAC,UAAU,CAAC,CAAC;YAEpC,OAAO;gBACL,KAAK;gBACL,KAAK;gBACL,GAAG,EAAE,KAAK;gBACV,UAAU;gBACV,QAAQ,EAAE,MAAA,MAAA,YAAY,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,0CAAE,MAAM,0CAAE,QAAQ;aAClE,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;AAChE,CAAC,CAAC","sourcesContent":["// @ts-nocheck\nimport { toPathOptions } from '../utils/treeUtil';\nimport * as React from 'react';\nimport type {\n DefaultOptionType,\n SingleValueType,\n CascaderProps,\n InternalFieldNames,\n} from '../Cascader';\nimport { toPathKey } from '../utils/commonUtil';\n\nexport default (\n rawValues: SingleValueType[],\n options: DefaultOptionType[],\n fieldNames: InternalFieldNames,\n multiple: boolean,\n displayRender: CascaderProps['displayRender'],\n) => {\n return React.useMemo(() => {\n const mergedDisplayRender =\n displayRender ||\n // Default displayRender\n ((labels) => {\n const mergedLabels = multiple ? labels.slice(-1) : labels;\n const SPLIT = ' / ';\n\n if (mergedLabels.every((label) => ['string', 'number'].includes(typeof label))) {\n return mergedLabels.join(SPLIT);\n }\n\n // If exist non-string value, use ReactNode instead\n return mergedLabels.reduce((list, label, index) => {\n const keyedLabel = React.isValidElement(label)\n ? React.cloneElement(label, { key: index })\n : label;\n\n if (index === 0) {\n return [keyedLabel];\n }\n\n return [...list, SPLIT, keyedLabel];\n }, []);\n });\n\n return rawValues.map((valueCells) => {\n const valueOptions = toPathOptions(valueCells, options, fieldNames);\n\n const label = mergedDisplayRender(\n valueOptions.map(({ option, value }) => option?.[fieldNames.label] ?? value),\n valueOptions.map(({ option }) => option),\n );\n\n const value = toPathKey(valueCells);\n\n return {\n label,\n value,\n key: value,\n valueCells,\n disabled: valueOptions[valueOptions.length - 1]?.option?.disabled,\n };\n });\n }, [rawValues, options, fieldNames, displayRender, multiple]);\n};\n"]}
@@ -0,0 +1,11 @@
1
+ import type { DefaultOptionType, InternalFieldNames } from '../Cascader';
2
+ import type { DataEntity } from 'rc-tree/lib/interface';
3
+ export interface OptionsInfo {
4
+ keyEntities: Record<string, DataEntity>;
5
+ pathKeyEntities: Record<string, DataEntity>;
6
+ }
7
+ export declare type GetEntities = () => OptionsInfo['pathKeyEntities'];
8
+ declare const _default: (options: DefaultOptionType[], fieldNames: InternalFieldNames) => GetEntities;
9
+ /** Lazy parse options data into conduct-able info to avoid perf issue in single mode */
10
+ export default _default;
11
+ //# sourceMappingURL=useEntities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEntities.d.ts","sourceRoot":"","sources":["../../../../src/tntd-cascader/rc-cascader/hooks/useEntities.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGxD,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CAC7C;AAED,oBAAY,WAAW,GAAG,MAAM,WAAW,CAAC,iBAAiB,CAAC,CAAC;kCAGtC,iBAAiB,EAAE,cAAc,kBAAkB;AAD5E,wFAAwF;AACxF,wBAkCE"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ // @ts-nocheck
27
+ const React = __importStar(require("react"));
28
+ const treeUtil_1 = require("rc-tree/lib/utils/treeUtil");
29
+ const commonUtil_1 = require("../utils/commonUtil");
30
+ /** Lazy parse options data into conduct-able info to avoid perf issue in single mode */
31
+ exports.default = (options, fieldNames) => {
32
+ const cacheRef = React.useRef({
33
+ options: null,
34
+ info: null,
35
+ });
36
+ const getEntities = React.useCallback(() => {
37
+ if (cacheRef.current.options !== options) {
38
+ cacheRef.current.options = options;
39
+ cacheRef.current.info = (0, treeUtil_1.convertDataToEntities)(options, {
40
+ fieldNames,
41
+ initWrapper: (wrapper) => (Object.assign(Object.assign({}, wrapper), { pathKeyEntities: {} })),
42
+ processEntity: (entity, wrapper) => {
43
+ const pathKey = entity.nodes.map((node) => node[fieldNames.value]).join(commonUtil_1.VALUE_SPLIT);
44
+ wrapper.pathKeyEntities[pathKey] = entity;
45
+ // Overwrite origin key.
46
+ // this is very hack but we need let conduct logic work with connect path
47
+ entity.key = pathKey;
48
+ },
49
+ });
50
+ }
51
+ return cacheRef.current.info.pathKeyEntities;
52
+ }, [fieldNames, options]);
53
+ return getEntities;
54
+ };
55
+ //# sourceMappingURL=useEntities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEntities.js","sourceRoot":"","sources":["../../../../src/tntd-cascader/rc-cascader/hooks/useEntities.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,6CAA+B;AAC/B,yDAAmE;AAGnE,oDAAkD;AASlD,wFAAwF;AACxF,kBAAe,CAAC,OAA4B,EAAE,UAA8B,EAAE,EAAE;IAC9E,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAG1B;QACD,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,IAAI;KACX,CAAC,CAAC;IAEH,MAAM,WAAW,GAAgB,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACtD,IAAI,QAAQ,CAAC,OAAO,CAAC,OAAO,KAAK,OAAO,EAAE;YACxC,QAAQ,CAAC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;YACnC,QAAQ,CAAC,OAAO,CAAC,IAAI,GAAG,IAAA,gCAAqB,EAAC,OAAc,EAAE;gBAC5D,UAAU;gBACV,WAAW,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,iCACrB,OAAO,KACV,eAAe,EAAE,EAAE,IACnB;gBACF,aAAa,EAAE,CAAC,MAAM,EAAE,OAAY,EAAE,EAAE;oBACtC,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAW,CAAC,CAAC;oBAErF,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC;oBAE1C,wBAAwB;oBACxB,yEAAyE;oBACzE,MAAM,CAAC,GAAG,GAAG,OAAO,CAAC;gBACvB,CAAC;aACF,CAAQ,CAAC;SACX;QAED,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC;IAC/C,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;IAE1B,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC","sourcesContent":["// @ts-nocheck\nimport * as React from 'react';\nimport { convertDataToEntities } from 'rc-tree/lib/utils/treeUtil';\nimport type { DefaultOptionType, InternalFieldNames } from '../Cascader';\nimport type { DataEntity } from 'rc-tree/lib/interface';\nimport { VALUE_SPLIT } from '../utils/commonUtil';\n\nexport interface OptionsInfo {\n keyEntities: Record<string, DataEntity>;\n pathKeyEntities: Record<string, DataEntity>;\n}\n\nexport type GetEntities = () => OptionsInfo['pathKeyEntities'];\n\n/** Lazy parse options data into conduct-able info to avoid perf issue in single mode */\nexport default (options: DefaultOptionType[], fieldNames: InternalFieldNames) => {\n const cacheRef = React.useRef<{\n options: DefaultOptionType[];\n info: OptionsInfo;\n }>({\n options: null,\n info: null,\n });\n\n const getEntities: GetEntities = React.useCallback(() => {\n if (cacheRef.current.options !== options) {\n cacheRef.current.options = options;\n cacheRef.current.info = convertDataToEntities(options as any, {\n fieldNames,\n initWrapper: (wrapper) => ({\n ...wrapper,\n pathKeyEntities: {},\n }),\n processEntity: (entity, wrapper: any) => {\n const pathKey = entity.nodes.map((node) => node[fieldNames.value]).join(VALUE_SPLIT);\n\n wrapper.pathKeyEntities[pathKey] = entity;\n\n // Overwrite origin key.\n // this is very hack but we need let conduct logic work with connect path\n entity.key = pathKey;\n },\n }) as any;\n }\n\n return cacheRef.current.info.pathKeyEntities;\n }, [fieldNames, options]);\n\n return getEntities;\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import type { SingleValueType, DefaultOptionType, InternalFieldNames } from '../Cascader';
2
+ declare const _default: (options: DefaultOptionType[], fieldNames: InternalFieldNames) => (rawValues: SingleValueType[]) => [SingleValueType[], SingleValueType[]];
3
+ export default _default;
4
+ //# sourceMappingURL=useMissingValues.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMissingValues.d.ts","sourceRoot":"","sources":["../../../../src/tntd-cascader/rc-cascader/hooks/useMissingValues.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;kCAGjE,iBAAiB,EAAE,cAAc,kBAAkB,iBAE5D,eAAe,EAAE,KAAG,CAAC,eAAe,EAAE,EAAE,eAAe,EAAE,CAAC;AAF1E,wBAmBE"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const React = __importStar(require("react"));
27
+ const treeUtil_1 = require("../utils/treeUtil");
28
+ exports.default = (options, fieldNames) => {
29
+ return React.useCallback((rawValues) => {
30
+ const missingValues = [];
31
+ const existsValues = [];
32
+ rawValues.forEach((valueCell) => {
33
+ const pathOptions = (0, treeUtil_1.toPathOptions)(valueCell, options, fieldNames);
34
+ if (pathOptions.every((opt) => opt.option)) {
35
+ existsValues.push(valueCell);
36
+ }
37
+ else {
38
+ missingValues.push(valueCell);
39
+ }
40
+ });
41
+ return [existsValues, missingValues];
42
+ }, [options, fieldNames]);
43
+ };
44
+ //# sourceMappingURL=useMissingValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMissingValues.js","sourceRoot":"","sources":["../../../../src/tntd-cascader/rc-cascader/hooks/useMissingValues.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAE/B,gDAAkD;AAElD,kBAAe,CAAC,OAA4B,EAAE,UAA8B,EAAE,EAAE;IAC9E,OAAO,KAAK,CAAC,WAAW,CACtB,CAAC,SAA4B,EAA0C,EAAE;QACvE,MAAM,aAAa,GAAsB,EAAE,CAAC;QAC5C,MAAM,YAAY,GAAsB,EAAE,CAAC;QAE3C,SAAS,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YAC9B,MAAM,WAAW,GAAG,IAAA,wBAAa,EAAC,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAClE,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;gBAC1C,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC9B;iBAAM;gBACL,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC/B;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;IACvC,CAAC,EACD,CAAC,OAAO,EAAE,UAAU,CAAC,CACtB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport type { SingleValueType, DefaultOptionType, InternalFieldNames } from '../Cascader';\nimport { toPathOptions } from '../utils/treeUtil';\n\nexport default (options: DefaultOptionType[], fieldNames: InternalFieldNames) => {\n return React.useCallback(\n (rawValues: SingleValueType[]): [SingleValueType[], SingleValueType[]] => {\n const missingValues: SingleValueType[] = [];\n const existsValues: SingleValueType[] = [];\n\n rawValues.forEach((valueCell) => {\n const pathOptions = toPathOptions(valueCell, options, fieldNames);\n if (pathOptions.every((opt) => opt.option)) {\n existsValues.push(valueCell);\n } else {\n missingValues.push(valueCell);\n }\n });\n\n return [existsValues, missingValues];\n },\n [options, fieldNames],\n );\n};\n"]}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Same as `React.useCallback` but always return a memoized function
3
+ * but redirect to real function.
4
+ */
5
+ export default function useRefFunc<T extends (...args: any[]) => any>(callback: T): T;
6
+ //# sourceMappingURL=useRefFunc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRefFunc.d.ts","sourceRoot":"","sources":["../../../../src/tntd-cascader/rc-cascader/hooks/useRefFunc.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CASpF"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ // @ts-nocheck
27
+ const React = __importStar(require("react"));
28
+ /**
29
+ * Same as `React.useCallback` but always return a memoized function
30
+ * but redirect to real function.
31
+ */
32
+ function useRefFunc(callback) {
33
+ const funcRef = React.useRef();
34
+ funcRef.current = callback;
35
+ const cacheFn = React.useCallback((...args) => {
36
+ return funcRef.current(...args);
37
+ }, []);
38
+ return cacheFn;
39
+ }
40
+ exports.default = useRefFunc;
41
+ //# sourceMappingURL=useRefFunc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRefFunc.js","sourceRoot":"","sources":["../../../../src/tntd-cascader/rc-cascader/hooks/useRefFunc.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,6CAA+B;AAE/B;;;GAGG;AACH,SAAwB,UAAU,CAAoC,QAAW;IAC/E,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,EAAK,CAAC;IAClC,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAC;IAE3B,MAAM,OAAO,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,IAAW,EAAE,EAAE;QACnD,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IAClC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,OAAc,CAAC;AACxB,CAAC;AATD,6BASC","sourcesContent":["// @ts-nocheck\nimport * as React from 'react';\n\n/**\n * Same as `React.useCallback` but always return a memoized function\n * but redirect to real function.\n */\nexport default function useRefFunc<T extends (...args: any[]) => any>(callback: T): T {\n const funcRef = React.useRef<T>();\n funcRef.current = callback;\n\n const cacheFn = React.useCallback((...args: any[]) => {\n return funcRef.current(...args);\n }, []);\n\n return cacheFn as any;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import type { CascaderProps, ShowSearchType } from '../Cascader';
2
+ export default function useSearchConfig(showSearch?: CascaderProps['showSearch']): [boolean, ShowSearchType<import("../Cascader").DefaultOptionType>];
3
+ //# sourceMappingURL=useSearchConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearchConfig.d.ts","sourceRoot":"","sources":["../../../../src/tntd-cascader/rc-cascader/hooks/useSearchConfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGjE,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,sEA4B/E"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ // @ts-nocheck
30
+ const React = __importStar(require("react"));
31
+ const warning_1 = __importDefault(require("rc-util/lib/warning"));
32
+ // Convert `showSearch` to unique config
33
+ function useSearchConfig(showSearch) {
34
+ return React.useMemo(() => {
35
+ if (!showSearch) {
36
+ return [false, {}];
37
+ }
38
+ let searchConfig = {
39
+ matchInputWidth: true,
40
+ limit: 50,
41
+ };
42
+ if (showSearch && typeof showSearch === 'object') {
43
+ searchConfig = Object.assign(Object.assign({}, searchConfig), showSearch);
44
+ }
45
+ if (searchConfig.limit <= 0) {
46
+ delete searchConfig.limit;
47
+ if (process.env.NODE_ENV !== 'production') {
48
+ (0, warning_1.default)(false, "'limit' of showSearch should be positive number or false.");
49
+ }
50
+ }
51
+ return [true, searchConfig];
52
+ }, [showSearch]);
53
+ }
54
+ exports.default = useSearchConfig;
55
+ //# sourceMappingURL=useSearchConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearchConfig.js","sourceRoot":"","sources":["../../../../src/tntd-cascader/rc-cascader/hooks/useSearchConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,6CAA+B;AAC/B,kEAA0C;AAG1C,wCAAwC;AACxC,SAAwB,eAAe,CAAC,UAAwC;IAC9E,OAAO,KAAK,CAAC,OAAO,CAA4B,GAAG,EAAE;QACnD,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;SACpB;QAED,IAAI,YAAY,GAAmB;YACjC,eAAe,EAAE,IAAI;YACrB,KAAK,EAAE,EAAE;SACV,CAAC;QAEF,IAAI,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;YAChD,YAAY,mCACP,YAAY,GACZ,UAAU,CACd,CAAC;SACH;QAED,IAAI,YAAY,CAAC,KAAK,IAAI,CAAC,EAAE;YAC3B,OAAO,YAAY,CAAC,KAAK,CAAC;YAE1B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;gBACzC,IAAA,iBAAO,EAAC,KAAK,EAAE,2DAA2D,CAAC,CAAC;aAC7E;SACF;QAED,OAAO,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAC9B,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;AACnB,CAAC;AA5BD,kCA4BC","sourcesContent":["// @ts-nocheck\nimport * as React from 'react';\nimport warning from 'rc-util/lib/warning';\nimport type { CascaderProps, ShowSearchType } from '../Cascader';\n\n// Convert `showSearch` to unique config\nexport default function useSearchConfig(showSearch?: CascaderProps['showSearch']) {\n return React.useMemo<[boolean, ShowSearchType]>(() => {\n if (!showSearch) {\n return [false, {}];\n }\n\n let searchConfig: ShowSearchType = {\n matchInputWidth: true,\n limit: 50,\n };\n\n if (showSearch && typeof showSearch === 'object') {\n searchConfig = {\n ...searchConfig,\n ...showSearch,\n };\n }\n\n if (searchConfig.limit <= 0) {\n delete searchConfig.limit;\n\n if (process.env.NODE_ENV !== 'production') {\n warning(false, \"'limit' of showSearch should be positive number or false.\");\n }\n }\n\n return [true, searchConfig];\n }, [showSearch]);\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { DefaultOptionType, ShowSearchType, InternalFieldNames } from '../Cascader';
2
+ export declare const SEARCH_MARK = "__rc_cascader_search_mark__";
3
+ declare const _default: (search: string, options: DefaultOptionType[], fieldNames: InternalFieldNames, prefixCls: string, config: ShowSearchType, changeOnSelect: boolean) => DefaultOptionType[];
4
+ export default _default;
5
+ //# sourceMappingURL=useSearchOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearchOptions.d.ts","sourceRoot":"","sources":["../../../../src/tntd-cascader/rc-cascader/hooks/useSearchOptions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGzF,eAAO,MAAM,WAAW,gCAAgC,CAAC;iCAS/C,MAAM,WACL,iBAAiB,EAAE,cAChB,kBAAkB,aACnB,MAAM,UACT,cAAc,kBACN,OAAO;AANzB,wBAiEE"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.SEARCH_MARK = void 0;
27
+ const React = __importStar(require("react"));
28
+ exports.SEARCH_MARK = '__rc_cascader_search_mark__';
29
+ const defaultFilter = (search, options, { label }) => options.some((opt) => String(opt[label]).toLowerCase().includes(search.toLowerCase()));
30
+ const defaultRender = (inputValue, path, prefixCls, fieldNames) => path.map((opt) => opt[fieldNames.label]).join(' / ');
31
+ exports.default = (search, options, fieldNames, prefixCls, config, changeOnSelect) => {
32
+ const { filter = defaultFilter, render = defaultRender, limit = 50, sort } = config;
33
+ return React.useMemo(() => {
34
+ const filteredOptions = [];
35
+ if (!search) {
36
+ return [];
37
+ }
38
+ function dig(list, pathOptions) {
39
+ list.forEach((option) => {
40
+ // Perf saving when `sort` is disabled and `limit` is provided
41
+ if (!sort && limit > 0 && filteredOptions.length >= limit) {
42
+ return;
43
+ }
44
+ const connectedPathOptions = [...pathOptions, option];
45
+ const children = option[fieldNames.children];
46
+ // If current option is filterable
47
+ if (
48
+ // If is leaf option
49
+ !children ||
50
+ children.length === 0 ||
51
+ // If is changeOnSelect
52
+ changeOnSelect) {
53
+ if (filter(search, connectedPathOptions, { label: fieldNames.label })) {
54
+ filteredOptions.push(Object.assign(Object.assign({}, option), { [fieldNames.label]: render(search, connectedPathOptions, prefixCls, fieldNames), [exports.SEARCH_MARK]: connectedPathOptions }));
55
+ }
56
+ }
57
+ if (children) {
58
+ dig(option[fieldNames.children], connectedPathOptions);
59
+ }
60
+ });
61
+ }
62
+ dig(options, []);
63
+ // Do sort
64
+ if (sort) {
65
+ filteredOptions.sort((a, b) => {
66
+ return sort(a[exports.SEARCH_MARK], b[exports.SEARCH_MARK], search, fieldNames);
67
+ });
68
+ }
69
+ return limit > 0 ? filteredOptions.slice(0, limit) : filteredOptions;
70
+ }, [search, options, fieldNames, prefixCls, render, changeOnSelect, filter, sort, limit]);
71
+ };
72
+ //# sourceMappingURL=useSearchOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearchOptions.js","sourceRoot":"","sources":["../../../../src/tntd-cascader/rc-cascader/hooks/useSearchOptions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,6CAA+B;AAElB,QAAA,WAAW,GAAG,6BAA6B,CAAC;AAEzD,MAAM,aAAa,GAA6B,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAC7E,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AAEzF,MAAM,aAAa,GAA6B,CAAC,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,CAC1F,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAEvD,kBAAe,CACb,MAAc,EACd,OAA4B,EAC5B,UAA8B,EAC9B,SAAiB,EACjB,MAAsB,EACtB,cAAuB,EACvB,EAAE;IACF,MAAM,EAAE,MAAM,GAAG,aAAa,EAAE,MAAM,GAAG,aAAa,EAAE,KAAK,GAAG,EAAE,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAEpF,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACxB,MAAM,eAAe,GAAwB,EAAE,CAAC;QAChD,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,EAAE,CAAC;SACX;QAED,SAAS,GAAG,CAAC,IAAyB,EAAE,WAAgC;YACtE,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;gBACtB,8DAA8D;gBAC9D,IAAI,CAAC,IAAI,IAAI,KAAK,GAAG,CAAC,IAAI,eAAe,CAAC,MAAM,IAAI,KAAK,EAAE;oBACzD,OAAO;iBACR;gBAED,MAAM,oBAAoB,GAAG,CAAC,GAAG,WAAW,EAAE,MAAM,CAAC,CAAC;gBACtD,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;gBAE7C,kCAAkC;gBAClC;gBACE,oBAAoB;gBACpB,CAAC,QAAQ;oBACT,QAAQ,CAAC,MAAM,KAAK,CAAC;oBACrB,uBAAuB;oBACvB,cAAc,EACd;oBACA,IAAI,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE;wBACrE,eAAe,CAAC,IAAI,iCACf,MAAM,KACT,CAAC,UAAU,CAAC,KAAgB,CAAC,EAAE,MAAM,CACnC,MAAM,EACN,oBAAoB,EACpB,SAAS,EACT,UAAU,CACX,EACD,CAAC,mBAAW,CAAC,EAAE,oBAAoB,IACnC,CAAC;qBACJ;iBACF;gBAED,IAAI,QAAQ,EAAE;oBACZ,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAwB,EAAE,oBAAoB,CAAC,CAAC;iBAC/E;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QAED,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAEjB,UAAU;QACV,IAAI,IAAI,EAAE;YACR,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBAC5B,OAAO,IAAI,CAAC,CAAC,CAAC,mBAAW,CAAC,EAAE,CAAC,CAAC,mBAAW,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;YAClE,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,KAAe,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC;IACjF,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;AAC5F,CAAC,CAAC","sourcesContent":["// @ts-nocheck\nimport type { DefaultOptionType, ShowSearchType, InternalFieldNames } from '../Cascader';\nimport * as React from 'react';\n\nexport const SEARCH_MARK = '__rc_cascader_search_mark__';\n\nconst defaultFilter: ShowSearchType['filter'] = (search, options, { label }) =>\n options.some((opt) => String(opt[label]).toLowerCase().includes(search.toLowerCase()));\n\nconst defaultRender: ShowSearchType['render'] = (inputValue, path, prefixCls, fieldNames) =>\n path.map((opt) => opt[fieldNames.label]).join(' / ');\n\nexport default (\n search: string,\n options: DefaultOptionType[],\n fieldNames: InternalFieldNames,\n prefixCls: string,\n config: ShowSearchType,\n changeOnSelect: boolean,\n) => {\n const { filter = defaultFilter, render = defaultRender, limit = 50, sort } = config;\n\n return React.useMemo(() => {\n const filteredOptions: DefaultOptionType[] = [];\n if (!search) {\n return [];\n }\n\n function dig(list: DefaultOptionType[], pathOptions: DefaultOptionType[]) {\n list.forEach((option) => {\n // Perf saving when `sort` is disabled and `limit` is provided\n if (!sort && limit > 0 && filteredOptions.length >= limit) {\n return;\n }\n\n const connectedPathOptions = [...pathOptions, option];\n const children = option[fieldNames.children];\n\n // If current option is filterable\n if (\n // If is leaf option\n !children ||\n children.length === 0 ||\n // If is changeOnSelect\n changeOnSelect\n ) {\n if (filter(search, connectedPathOptions, { label: fieldNames.label })) {\n filteredOptions.push({\n ...option,\n [fieldNames.label as 'label']: render(\n search,\n connectedPathOptions,\n prefixCls,\n fieldNames,\n ),\n [SEARCH_MARK]: connectedPathOptions,\n });\n }\n }\n\n if (children) {\n dig(option[fieldNames.children] as DefaultOptionType[], connectedPathOptions);\n }\n });\n }\n\n dig(options, []);\n\n // Do sort\n if (sort) {\n filteredOptions.sort((a, b) => {\n return sort(a[SEARCH_MARK], b[SEARCH_MARK], search, fieldNames);\n });\n }\n\n return limit > 0 ? filteredOptions.slice(0, limit as number) : filteredOptions;\n }, [search, options, fieldNames, prefixCls, render, changeOnSelect, filter, sort, limit]);\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import Cascader from './Cascader';
2
+ export type { CascaderProps, FieldNames, ShowSearchType, DefaultOptionType, BaseOptionType, SingleCascaderProps, MultipleCascaderProps, } from './Cascader';
3
+ export default Cascader;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tntd-cascader/rc-cascader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,YAAY,EACV,aAAa,EACb,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AACpB,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Cascader_1 = __importDefault(require("./Cascader"));
7
+ exports.default = Cascader_1.default;
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tntd-cascader/rc-cascader/index.tsx"],"names":[],"mappings":";;;;;AAAA,0DAAkC;AAWlC,kBAAe,kBAAQ,CAAC","sourcesContent":["import Cascader from './Cascader';\n\nexport type {\n CascaderProps,\n FieldNames,\n ShowSearchType,\n DefaultOptionType,\n BaseOptionType,\n SingleCascaderProps,\n MultipleCascaderProps,\n} from './Cascader';\nexport default Cascader;\n"]}
@@ -0,0 +1,19 @@
1
+ .tntd-cascader-menu {
2
+ .rc-virtual-list {
3
+ width: 120px;
4
+ }
5
+
6
+ .rc-virtual-list-full {
7
+ width: auto;
8
+ }
9
+
10
+ .tntd-cascader-menu-item {
11
+ display: flex;
12
+ .tntd-cascader-menu-item-content {
13
+ flex: 1;
14
+ overflow: hidden;
15
+ white-space: nowrap;
16
+ text-overflow: ellipsis;
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,11 @@
1
+ import type { DefaultOptionType, FieldNames, InternalFieldNames, SingleValueType } from '../Cascader';
2
+ export declare const VALUE_SPLIT = "__RC_CASCADER_SPLIT__";
3
+ export declare const SHOW_PARENT = "SHOW_PARENT";
4
+ export declare const SHOW_CHILD = "SHOW_CHILD";
5
+ export declare function toPathKey(value: SingleValueType): string;
6
+ export declare function toPathKeys(value: SingleValueType[]): string[];
7
+ export declare function toPathValueStr(pathKey: string): string[];
8
+ export declare function fillFieldNames(fieldNames?: FieldNames): InternalFieldNames;
9
+ export declare function isLeaf(option: DefaultOptionType, fieldNames: FieldNames): any;
10
+ export declare function scrollIntoParentView(element: HTMLElement): void;
11
+ //# sourceMappingURL=commonUtil.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commonUtil.d.ts","sourceRoot":"","sources":["../../../../src/tntd-cascader/rc-cascader/utils/commonUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,kBAAkB,EAClB,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,WAAW,0BAA0B,CAAC;AACnD,eAAO,MAAM,WAAW,gBAAgB,CAAC;AACzC,eAAO,MAAM,UAAU,eAAe,CAAC;AAEvC,wBAAgB,SAAS,CAAC,KAAK,EAAE,eAAe,UAE/C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,YAElD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,YAE7C;AAED,wBAAgB,cAAc,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,kBAAkB,CAS1E;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,OAGvE;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,WAAW,QAYxD"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.scrollIntoParentView = exports.isLeaf = exports.fillFieldNames = exports.toPathValueStr = exports.toPathKeys = exports.toPathKey = exports.SHOW_CHILD = exports.SHOW_PARENT = exports.VALUE_SPLIT = void 0;
4
+ exports.VALUE_SPLIT = '__RC_CASCADER_SPLIT__';
5
+ exports.SHOW_PARENT = 'SHOW_PARENT';
6
+ exports.SHOW_CHILD = 'SHOW_CHILD';
7
+ function toPathKey(value) {
8
+ return value.join(exports.VALUE_SPLIT);
9
+ }
10
+ exports.toPathKey = toPathKey;
11
+ function toPathKeys(value) {
12
+ return value.map(toPathKey);
13
+ }
14
+ exports.toPathKeys = toPathKeys;
15
+ function toPathValueStr(pathKey) {
16
+ return pathKey.split(exports.VALUE_SPLIT);
17
+ }
18
+ exports.toPathValueStr = toPathValueStr;
19
+ function fillFieldNames(fieldNames) {
20
+ const { label, value, children } = fieldNames || {};
21
+ const val = value || 'value';
22
+ return {
23
+ label: label || 'label',
24
+ value: val,
25
+ key: val,
26
+ children: children || 'children',
27
+ };
28
+ }
29
+ exports.fillFieldNames = fillFieldNames;
30
+ function isLeaf(option, fieldNames) {
31
+ var _a, _b;
32
+ // @ts-ignore
33
+ return (_a = option.isLeaf) !== null && _a !== void 0 ? _a : !((_b = option[fieldNames.children]) === null || _b === void 0 ? void 0 : _b.length);
34
+ }
35
+ exports.isLeaf = isLeaf;
36
+ function scrollIntoParentView(element) {
37
+ const parent = element.parentElement;
38
+ if (!parent) {
39
+ return;
40
+ }
41
+ const elementToParent = element.offsetTop - parent.offsetTop; // offsetParent may not be parent.
42
+ if (elementToParent - parent.scrollTop < 0) {
43
+ parent.scrollTo({ top: elementToParent });
44
+ }
45
+ else if (elementToParent + element.offsetHeight - parent.scrollTop > parent.offsetHeight) {
46
+ parent.scrollTo({ top: elementToParent + element.offsetHeight - parent.offsetHeight });
47
+ }
48
+ }
49
+ exports.scrollIntoParentView = scrollIntoParentView;
50
+ //# sourceMappingURL=commonUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commonUtil.js","sourceRoot":"","sources":["../../../../src/tntd-cascader/rc-cascader/utils/commonUtil.ts"],"names":[],"mappings":";;;AAOa,QAAA,WAAW,GAAG,uBAAuB,CAAC;AACtC,QAAA,WAAW,GAAG,aAAa,CAAC;AAC5B,QAAA,UAAU,GAAG,YAAY,CAAC;AAEvC,SAAgB,SAAS,CAAC,KAAsB;IAC9C,OAAO,KAAK,CAAC,IAAI,CAAC,mBAAW,CAAC,CAAC;AACjC,CAAC;AAFD,8BAEC;AAED,SAAgB,UAAU,CAAC,KAAwB;IACjD,OAAO,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAC9B,CAAC;AAFD,gCAEC;AAED,SAAgB,cAAc,CAAC,OAAe;IAC5C,OAAO,OAAO,CAAC,KAAK,CAAC,mBAAW,CAAC,CAAC;AACpC,CAAC;AAFD,wCAEC;AAED,SAAgB,cAAc,CAAC,UAAuB;IACpD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,UAAU,IAAI,EAAE,CAAC;IACpD,MAAM,GAAG,GAAG,KAAK,IAAI,OAAO,CAAC;IAC7B,OAAO;QACL,KAAK,EAAE,KAAK,IAAI,OAAO;QACvB,KAAK,EAAE,GAAG;QACV,GAAG,EAAE,GAAG;QACR,QAAQ,EAAE,QAAQ,IAAI,UAAU;KACjC,CAAC;AACJ,CAAC;AATD,wCASC;AAED,SAAgB,MAAM,CAAC,MAAyB,EAAE,UAAsB;;IACtE,aAAa;IACb,OAAO,MAAA,MAAM,CAAC,MAAM,mCAAI,CAAC,CAAA,MAAA,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,0CAAE,MAAM,CAAA,CAAC;AAC/D,CAAC;AAHD,wBAGC;AAED,SAAgB,oBAAoB,CAAC,OAAoB;IACvD,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IACrC,IAAI,CAAC,MAAM,EAAE;QACX,OAAO;KACR;IAED,MAAM,eAAe,GAAG,OAAO,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,kCAAkC;IAChG,IAAI,eAAe,GAAG,MAAM,CAAC,SAAS,GAAG,CAAC,EAAE;QAC1C,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE,CAAC,CAAC;KAC3C;SAAM,IAAI,eAAe,GAAG,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,YAAY,EAAE;QAC1F,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;KACxF;AACH,CAAC;AAZD,oDAYC","sourcesContent":["import type {\n DefaultOptionType,\n FieldNames,\n InternalFieldNames,\n SingleValueType,\n} from '../Cascader';\n\nexport const VALUE_SPLIT = '__RC_CASCADER_SPLIT__';\nexport const SHOW_PARENT = 'SHOW_PARENT';\nexport const SHOW_CHILD = 'SHOW_CHILD';\n\nexport function toPathKey(value: SingleValueType) {\n return value.join(VALUE_SPLIT);\n}\n\nexport function toPathKeys(value: SingleValueType[]) {\n return value.map(toPathKey);\n}\n\nexport function toPathValueStr(pathKey: string) {\n return pathKey.split(VALUE_SPLIT);\n}\n\nexport function fillFieldNames(fieldNames?: FieldNames): InternalFieldNames {\n const { label, value, children } = fieldNames || {};\n const val = value || 'value';\n return {\n label: label || 'label',\n value: val,\n key: val,\n children: children || 'children',\n };\n}\n\nexport function isLeaf(option: DefaultOptionType, fieldNames: FieldNames) {\n // @ts-ignore\n return option.isLeaf ?? !option[fieldNames.children]?.length;\n}\n\nexport function scrollIntoParentView(element: HTMLElement) {\n const parent = element.parentElement;\n if (!parent) {\n return;\n }\n\n const elementToParent = element.offsetTop - parent.offsetTop; // offsetParent may not be parent.\n if (elementToParent - parent.scrollTop < 0) {\n parent.scrollTo({ top: elementToParent });\n } else if (elementToParent + element.offsetHeight - parent.scrollTop > parent.offsetHeight) {\n parent.scrollTo({ top: elementToParent + element.offsetHeight - parent.offsetHeight });\n }\n}\n"]}
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import type { SingleValueType, DefaultOptionType, InternalFieldNames, ShowCheckedStrategy } from '../Cascader';
3
+ import type { GetEntities } from '../hooks/useEntities';
4
+ export declare function formatStrategyValues(pathKeys: React.Key[], getKeyPathEntities: GetEntities, showCheckedStrategy: ShowCheckedStrategy): import("react").Key[];
5
+ export declare function toPathOptions(valueCells: SingleValueType, options: DefaultOptionType[], fieldNames: InternalFieldNames, stringMode?: boolean): {
6
+ value: SingleValueType[number];
7
+ index: number;
8
+ option: DefaultOptionType;
9
+ }[];
10
+ //# sourceMappingURL=treeUtil.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treeUtil.d.ts","sourceRoot":"","sources":["../../../../src/tntd-cascader/rc-cascader/utils/treeUtil.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,KAAK,CAAC,GAAG,EAAE,EACrB,kBAAkB,EAAE,WAAW,EAC/B,mBAAmB,EAAE,mBAAmB,yBAczC;AAED,wBAAgB,aAAa,CAC3B,UAAU,EAAE,eAAe,EAC3B,OAAO,EAAE,iBAAiB,EAAE,EAC5B,UAAU,EAAE,kBAAkB,EAE9B,UAAU,UAAQ;WAIT,eAAe,CAAC,MAAM,CAAC;WACvB,MAAM;YACL,iBAAiB;IAsB5B"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toPathOptions = exports.formatStrategyValues = void 0;
4
+ const commonUtil_1 = require("./commonUtil");
5
+ function formatStrategyValues(pathKeys, getKeyPathEntities, showCheckedStrategy) {
6
+ const valueSet = new Set(pathKeys);
7
+ const keyPathEntities = getKeyPathEntities();
8
+ return pathKeys.filter((key) => {
9
+ const entity = keyPathEntities[key];
10
+ const parent = entity ? entity.parent : null;
11
+ const children = entity ? entity.children : null;
12
+ return showCheckedStrategy === commonUtil_1.SHOW_CHILD
13
+ ? !(children && children.some((child) => child.key && valueSet.has(child.key)))
14
+ : !(parent && !parent.node.disabled && valueSet.has(parent.key));
15
+ });
16
+ }
17
+ exports.formatStrategyValues = formatStrategyValues;
18
+ function toPathOptions(valueCells, options, fieldNames,
19
+ // Used for loadingKeys which saved loaded keys as string
20
+ stringMode = false) {
21
+ var _a;
22
+ let currentList = options;
23
+ const valueOptions = [];
24
+ for (let i = 0; i < valueCells.length; i += 1) {
25
+ const valueCell = valueCells[i];
26
+ const foundIndex = currentList === null || currentList === void 0 ? void 0 : currentList.findIndex((option) => {
27
+ const val = option[fieldNames.value];
28
+ return stringMode ? String(val) === String(valueCell) : val === valueCell;
29
+ });
30
+ const foundOption = foundIndex !== -1 ? currentList === null || currentList === void 0 ? void 0 : currentList[foundIndex] : null;
31
+ valueOptions.push({
32
+ value: (_a = foundOption === null || foundOption === void 0 ? void 0 : foundOption[fieldNames.value]) !== null && _a !== void 0 ? _a : valueCell,
33
+ index: foundIndex,
34
+ // @ts-ignore
35
+ option: foundOption,
36
+ });
37
+ currentList = foundOption === null || foundOption === void 0 ? void 0 : foundOption[fieldNames.children];
38
+ }
39
+ return valueOptions;
40
+ }
41
+ exports.toPathOptions = toPathOptions;
42
+ //# sourceMappingURL=treeUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treeUtil.js","sourceRoot":"","sources":["../../../../src/tntd-cascader/rc-cascader/utils/treeUtil.ts"],"names":[],"mappings":";;;AAOA,6CAA0C;AAE1C,SAAgB,oBAAoB,CAClC,QAAqB,EACrB,kBAA+B,EAC/B,mBAAwC;IAExC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;IAE7C,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;QAC7B,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;QACpC,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QAC7C,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;QAEjD,OAAO,mBAAmB,KAAK,uBAAU;YACvC,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;YAC/E,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;AACL,CAAC;AAjBD,oDAiBC;AAED,SAAgB,aAAa,CAC3B,UAA2B,EAC3B,OAA4B,EAC5B,UAA8B;AAC9B,yDAAyD;AACzD,UAAU,GAAG,KAAK;;IAElB,IAAI,WAAW,GAAG,OAAO,CAAC;IAC1B,MAAM,YAAY,GAIZ,EAAE,CAAC;IAET,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;QAC7C,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAChC,MAAM,UAAU,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE;YACnD,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YACrC,OAAO,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,SAAS,CAAC;QAC5E,CAAC,CAAC,CAAC;QACH,MAAM,WAAW,GAAG,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAEzE,YAAY,CAAC,IAAI,CAAC;YAChB,KAAK,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,UAAU,CAAC,KAAK,CAAC,mCAAI,SAAS;YACnD,KAAK,EAAE,UAAU;YACjB,aAAa;YACb,MAAM,EAAE,WAAW;SACpB,CAAC,CAAC;QAEH,WAAW,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;KAClD;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAjCD,sCAiCC","sourcesContent":["import type {\n SingleValueType,\n DefaultOptionType,\n InternalFieldNames,\n ShowCheckedStrategy,\n} from '../Cascader';\nimport type { GetEntities } from '../hooks/useEntities';\nimport { SHOW_CHILD } from './commonUtil';\n\nexport function formatStrategyValues(\n pathKeys: React.Key[],\n getKeyPathEntities: GetEntities,\n showCheckedStrategy: ShowCheckedStrategy,\n) {\n const valueSet = new Set(pathKeys);\n const keyPathEntities = getKeyPathEntities();\n\n return pathKeys.filter((key) => {\n const entity = keyPathEntities[key];\n const parent = entity ? entity.parent : null;\n const children = entity ? entity.children : null;\n\n return showCheckedStrategy === SHOW_CHILD\n ? !(children && children.some((child) => child.key && valueSet.has(child.key)))\n : !(parent && !parent.node.disabled && valueSet.has(parent.key));\n });\n}\n\nexport function toPathOptions(\n valueCells: SingleValueType,\n options: DefaultOptionType[],\n fieldNames: InternalFieldNames,\n // Used for loadingKeys which saved loaded keys as string\n stringMode = false,\n) {\n let currentList = options;\n const valueOptions: {\n value: SingleValueType[number];\n index: number;\n option: DefaultOptionType;\n }[] = [];\n\n for (let i = 0; i < valueCells.length; i += 1) {\n const valueCell = valueCells[i];\n const foundIndex = currentList?.findIndex((option) => {\n const val = option[fieldNames.value];\n return stringMode ? String(val) === String(valueCell) : val === valueCell;\n });\n const foundOption = foundIndex !== -1 ? currentList?.[foundIndex] : null;\n\n valueOptions.push({\n value: foundOption?.[fieldNames.value] ?? valueCell,\n index: foundIndex,\n // @ts-ignore\n option: foundOption,\n });\n\n currentList = foundOption?.[fieldNames.children];\n }\n\n return valueOptions;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { DefaultOptionType, FieldNames, InternalCascaderProps } from '../Cascader';
2
+ declare function warningProps(props: InternalCascaderProps): void;
3
+ export declare function warningNullOptions(options: DefaultOptionType[], fieldNames: FieldNames): void;
4
+ export default warningProps;
5
+ //# sourceMappingURL=warningPropsUtil.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"warningPropsUtil.d.ts","sourceRoot":"","sources":["../../../../src/tntd-cascader/rc-cascader/utils/warningPropsUtil.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAExF,iBAAS,YAAY,CAAC,KAAK,EAAE,qBAAqB,QAgBjD;AAGD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,UAAU,EAAE,UAAU,QAsBtF;AAED,eAAe,YAAY,CAAC"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.warningNullOptions = void 0;
7
+ // @ts-nocheck
8
+ const warning_1 = __importDefault(require("rc-util/lib/warning"));
9
+ function warningProps(props) {
10
+ const { onPopupVisibleChange, popupVisible, popupClassName, popupPlacement } = props;
11
+ (0, warning_1.default)(!onPopupVisibleChange, '`onPopupVisibleChange` is deprecated. Please use `onDropdownVisibleChange` instead.');
12
+ (0, warning_1.default)(popupVisible === undefined, '`popupVisible` is deprecated. Please use `open` instead.');
13
+ (0, warning_1.default)(popupClassName === undefined, '`popupClassName` is deprecated. Please use `dropdownClassName` instead.');
14
+ (0, warning_1.default)(popupPlacement === undefined, '`popupPlacement` is deprecated. Please use `placement` instead.');
15
+ }
16
+ // value in Cascader options should not be null
17
+ function warningNullOptions(options, fieldNames) {
18
+ if (options) {
19
+ const recursiveOptions = (optionsList) => {
20
+ for (let i = 0; i < optionsList.length; i++) {
21
+ const option = optionsList[i];
22
+ if (option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value] === null) {
23
+ (0, warning_1.default)(false, '`value` in Cascader options should not be `null`.');
24
+ return true;
25
+ }
26
+ if (Array.isArray(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]) &&
27
+ recursiveOptions(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children])) {
28
+ return true;
29
+ }
30
+ }
31
+ };
32
+ recursiveOptions(options);
33
+ }
34
+ }
35
+ exports.warningNullOptions = warningNullOptions;
36
+ exports.default = warningProps;
37
+ //# sourceMappingURL=warningPropsUtil.js.map