tntd 2.7.23 → 2.7.24

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 (370) hide show
  1. package/es/index.js +1 -0
  2. package/es/index.js.map +1 -1
  3. package/es/locale/en_US.js +5 -2
  4. package/es/locale/en_US.js.map +1 -1
  5. package/es/locale/zh_CN.js +4 -1
  6. package/es/locale/zh_CN.js.map +1 -1
  7. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +1 -1
  8. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
  9. package/es/tntd-rc-select/_util/DisabledContext.js +8 -0
  10. package/es/tntd-rc-select/_util/DisabledContext.js.map +1 -0
  11. package/es/tntd-rc-select/_util/FormItemInputContext.js +3 -0
  12. package/es/tntd-rc-select/_util/FormItemInputContext.js.map +1 -0
  13. package/es/tntd-rc-select/_util/PurePanel.js +55 -0
  14. package/es/tntd-rc-select/_util/PurePanel.js.map +1 -0
  15. package/es/tntd-rc-select/_util/SizeContext.js +3 -0
  16. package/es/tntd-rc-select/_util/SizeContext.js.map +1 -0
  17. package/es/tntd-rc-select/_util/context.js +14 -0
  18. package/es/tntd-rc-select/_util/context.js.map +1 -0
  19. package/es/tntd-rc-select/_util/defaultRenderEmpty.js +20 -0
  20. package/es/tntd-rc-select/_util/defaultRenderEmpty.js.map +1 -0
  21. package/es/tntd-rc-select/_util/getIcons.js +52 -0
  22. package/es/tntd-rc-select/_util/getIcons.js.map +1 -0
  23. package/es/tntd-rc-select/_util/interface.js +5 -0
  24. package/es/tntd-rc-select/_util/interface.js.map +1 -0
  25. package/es/tntd-rc-select/_util/motion.js +38 -0
  26. package/es/tntd-rc-select/_util/motion.js.map +1 -0
  27. package/es/tntd-rc-select/_util/type.js +4 -0
  28. package/es/tntd-rc-select/_util/type.js.map +1 -0
  29. package/es/tntd-rc-select/_util/useCompactItemContext.js +24 -0
  30. package/es/tntd-rc-select/_util/useCompactItemContext.js.map +1 -0
  31. package/es/tntd-rc-select/_util/warning.js +15 -0
  32. package/es/tntd-rc-select/_util/warning.js.map +1 -0
  33. package/es/tntd-rc-select/img/no-data-s.png +0 -0
  34. package/es/tntd-rc-select/index.js +103 -0
  35. package/es/tntd-rc-select/index.js.map +1 -0
  36. package/es/tntd-rc-select/style/index.less +1657 -0
  37. package/es/tntd-select/_util/DisabledContext.js +8 -0
  38. package/es/tntd-select/_util/DisabledContext.js.map +1 -0
  39. package/es/tntd-select/_util/FormItemInputContext.js +3 -0
  40. package/es/tntd-select/_util/FormItemInputContext.js.map +1 -0
  41. package/es/tntd-select/_util/PurePanel.js +4 -17
  42. package/es/tntd-select/_util/PurePanel.js.map +1 -1
  43. package/es/tntd-select/_util/SizeContext.js +3 -0
  44. package/es/tntd-select/_util/SizeContext.js.map +1 -0
  45. package/es/tntd-select/_util/context.js +14 -0
  46. package/es/tntd-select/_util/context.js.map +1 -0
  47. package/es/tntd-select/_util/defaultRenderEmpty.js +20 -0
  48. package/es/tntd-select/_util/defaultRenderEmpty.js.map +1 -0
  49. package/es/tntd-select/_util/getIcons.js +52 -0
  50. package/es/tntd-select/_util/getIcons.js.map +1 -0
  51. package/es/tntd-select/_util/interface.js +5 -0
  52. package/es/tntd-select/_util/interface.js.map +1 -0
  53. package/es/tntd-select/_util/motion.js +15 -8
  54. package/es/tntd-select/_util/motion.js.map +1 -1
  55. package/es/tntd-select/_util/type.js +4 -0
  56. package/es/tntd-select/_util/type.js.map +1 -0
  57. package/es/tntd-select/_util/useCompactItemContext.js +24 -0
  58. package/es/tntd-select/_util/useCompactItemContext.js.map +1 -0
  59. package/es/tntd-select/_util/warning.js +14 -5
  60. package/es/tntd-select/_util/warning.js.map +1 -1
  61. package/es/tntd-select/index.js +7 -1
  62. package/es/tntd-select/index.js.map +1 -1
  63. package/es/tntd-select/rc-select/BaseSelect.js +429 -0
  64. package/es/tntd-select/rc-select/BaseSelect.js.map +1 -0
  65. package/es/tntd-select/rc-select/OptGroup.js +5 -0
  66. package/es/tntd-select/rc-select/OptGroup.js.map +1 -0
  67. package/es/tntd-select/rc-select/Option.js +5 -0
  68. package/es/tntd-select/rc-select/Option.js.map +1 -0
  69. package/es/tntd-select/rc-select/OptionList.js +257 -0
  70. package/es/tntd-select/rc-select/OptionList.js.map +1 -0
  71. package/es/tntd-select/rc-select/Select.js +428 -0
  72. package/es/tntd-select/rc-select/Select.js.map +1 -0
  73. package/es/tntd-select/rc-select/SelectContext.js +4 -0
  74. package/es/tntd-select/rc-select/SelectContext.js.map +1 -0
  75. package/es/tntd-select/rc-select/SelectTrigger.js +91 -0
  76. package/es/tntd-select/rc-select/SelectTrigger.js.map +1 -0
  77. package/es/tntd-select/rc-select/Selector/Input.js +47 -0
  78. package/es/tntd-select/rc-select/Selector/Input.js.map +1 -0
  79. package/es/tntd-select/rc-select/Selector/MultipleSelector.js +97 -0
  80. package/es/tntd-select/rc-select/Selector/MultipleSelector.js.map +1 -0
  81. package/es/tntd-select/rc-select/Selector/SingleSelector.js +45 -0
  82. package/es/tntd-select/rc-select/Selector/SingleSelector.js.map +1 -0
  83. package/es/tntd-select/rc-select/Selector/index.js +136 -0
  84. package/es/tntd-select/rc-select/Selector/index.js.map +1 -0
  85. package/es/tntd-select/rc-select/TransBtn.js +22 -0
  86. package/es/tntd-select/rc-select/TransBtn.js.map +1 -0
  87. package/es/tntd-select/rc-select/hooks/useAllowClear.js +25 -0
  88. package/es/tntd-select/rc-select/hooks/useAllowClear.js.map +1 -0
  89. package/es/tntd-select/rc-select/hooks/useBaseProps.js +10 -0
  90. package/es/tntd-select/rc-select/hooks/useBaseProps.js.map +1 -0
  91. package/es/tntd-select/rc-select/hooks/useCache.js +34 -0
  92. package/es/tntd-select/rc-select/hooks/useCache.js.map +1 -0
  93. package/es/tntd-select/rc-select/hooks/useDelayReset.js +24 -0
  94. package/es/tntd-select/rc-select/hooks/useDelayReset.js.map +1 -0
  95. package/es/tntd-select/rc-select/hooks/useFilterOptions.js +55 -0
  96. package/es/tntd-select/rc-select/hooks/useFilterOptions.js.map +1 -0
  97. package/es/tntd-select/rc-select/hooks/useId.js +28 -0
  98. package/es/tntd-select/rc-select/hooks/useId.js.map +1 -0
  99. package/es/tntd-select/rc-select/hooks/useLayoutEffect.js +18 -0
  100. package/es/tntd-select/rc-select/hooks/useLayoutEffect.js.map +1 -0
  101. package/es/tntd-select/rc-select/hooks/useLock.js +26 -0
  102. package/es/tntd-select/rc-select/hooks/useLock.js.map +1 -0
  103. package/es/tntd-select/rc-select/hooks/useOptions.js +45 -0
  104. package/es/tntd-select/rc-select/hooks/useOptions.js.map +1 -0
  105. package/es/tntd-select/rc-select/hooks/useRefFunc.js +14 -0
  106. package/es/tntd-select/rc-select/hooks/useRefFunc.js.map +1 -0
  107. package/es/tntd-select/rc-select/hooks/useSelectTriggerControl.js +32 -0
  108. package/es/tntd-select/rc-select/hooks/useSelectTriggerControl.js.map +1 -0
  109. package/es/tntd-select/rc-select/index.js +8 -0
  110. package/es/tntd-select/rc-select/index.js.map +1 -0
  111. package/es/tntd-select/rc-select/interface.js +2 -0
  112. package/es/tntd-select/rc-select/interface.js.map +1 -0
  113. package/es/tntd-select/rc-select/utils/commonUtil.js +32 -0
  114. package/es/tntd-select/rc-select/utils/commonUtil.js.map +1 -0
  115. package/es/tntd-select/rc-select/utils/keyUtil.js +34 -0
  116. package/es/tntd-select/rc-select/utils/keyUtil.js.map +1 -0
  117. package/es/tntd-select/rc-select/utils/legacyUtil.js +32 -0
  118. package/es/tntd-select/rc-select/utils/legacyUtil.js.map +1 -0
  119. package/es/tntd-select/rc-select/utils/platformUtil.js +5 -0
  120. package/es/tntd-select/rc-select/utils/platformUtil.js.map +1 -0
  121. package/es/tntd-select/rc-select/utils/valueUtil.js +99 -0
  122. package/es/tntd-select/rc-select/utils/valueUtil.js.map +1 -0
  123. package/es/tntd-select/rc-select/utils/warningPropsUtil.js +100 -0
  124. package/es/tntd-select/rc-select/utils/warningPropsUtil.js.map +1 -0
  125. package/lib/index.d.ts +1 -0
  126. package/lib/index.d.ts.map +1 -1
  127. package/lib/index.js +3 -1
  128. package/lib/index.js.map +1 -1
  129. package/lib/locale/default.d.ts +4 -1
  130. package/lib/locale/default.d.ts.map +1 -1
  131. package/lib/locale/en_US.d.ts +4 -1
  132. package/lib/locale/en_US.d.ts.map +1 -1
  133. package/lib/locale/en_US.js +5 -2
  134. package/lib/locale/en_US.js.map +1 -1
  135. package/lib/locale/zh_CN.d.ts +4 -1
  136. package/lib/locale/zh_CN.d.ts.map +1 -1
  137. package/lib/locale/zh_CN.js +4 -1
  138. package/lib/locale/zh_CN.js.map +1 -1
  139. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +1 -1
  140. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
  141. package/lib/tntd-rc-select/_util/DisabledContext.d.ts +10 -0
  142. package/lib/tntd-rc-select/_util/DisabledContext.d.ts.map +1 -0
  143. package/lib/tntd-rc-select/_util/DisabledContext.js +35 -0
  144. package/lib/tntd-rc-select/_util/DisabledContext.js.map +1 -0
  145. package/lib/tntd-rc-select/_util/FormItemInputContext.d.ts +4 -0
  146. package/lib/tntd-rc-select/_util/FormItemInputContext.d.ts.map +1 -0
  147. package/lib/tntd-rc-select/_util/FormItemInputContext.js +29 -0
  148. package/lib/tntd-rc-select/_util/FormItemInputContext.js.map +1 -0
  149. package/lib/tntd-rc-select/_util/PurePanel.d.ts +9 -0
  150. package/lib/tntd-rc-select/_util/PurePanel.d.ts.map +1 -0
  151. package/lib/tntd-rc-select/_util/PurePanel.js +84 -0
  152. package/lib/tntd-rc-select/_util/PurePanel.js.map +1 -0
  153. package/lib/tntd-rc-select/_util/SizeContext.d.ts +4 -0
  154. package/lib/tntd-rc-select/_util/SizeContext.d.ts.map +1 -0
  155. package/lib/tntd-rc-select/_util/SizeContext.js +29 -0
  156. package/lib/tntd-rc-select/_util/SizeContext.js.map +1 -0
  157. package/lib/tntd-rc-select/_util/context.d.ts +42 -0
  158. package/lib/tntd-rc-select/_util/context.d.ts.map +1 -0
  159. package/lib/tntd-rc-select/_util/context.js +20 -0
  160. package/lib/tntd-rc-select/_util/context.js.map +1 -0
  161. package/lib/tntd-rc-select/_util/defaultRenderEmpty.d.ts +5 -0
  162. package/lib/tntd-rc-select/_util/defaultRenderEmpty.d.ts.map +1 -0
  163. package/lib/tntd-rc-select/_util/defaultRenderEmpty.js +48 -0
  164. package/lib/tntd-rc-select/_util/defaultRenderEmpty.js.map +1 -0
  165. package/lib/tntd-rc-select/_util/getIcons.d.ts +25 -0
  166. package/lib/tntd-rc-select/_util/getIcons.d.ts.map +1 -0
  167. package/lib/tntd-rc-select/_util/getIcons.js +78 -0
  168. package/lib/tntd-rc-select/_util/getIcons.js.map +1 -0
  169. package/lib/tntd-rc-select/_util/interface.d.ts +25 -0
  170. package/lib/tntd-rc-select/_util/interface.d.ts.map +1 -0
  171. package/lib/tntd-rc-select/_util/interface.js +9 -0
  172. package/lib/tntd-rc-select/_util/interface.js.map +1 -0
  173. package/lib/tntd-rc-select/_util/motion.d.ts +9 -0
  174. package/lib/tntd-rc-select/_util/motion.d.ts.map +1 -0
  175. package/lib/tntd-rc-select/_util/motion.js +42 -0
  176. package/lib/tntd-rc-select/_util/motion.js.map +1 -0
  177. package/lib/tntd-rc-select/_util/type.d.ts +10 -0
  178. package/lib/tntd-rc-select/_util/type.d.ts.map +1 -0
  179. package/lib/tntd-rc-select/_util/type.js +9 -0
  180. package/lib/tntd-rc-select/_util/type.js.map +1 -0
  181. package/lib/tntd-rc-select/_util/useCompactItemContext.d.ts +9 -0
  182. package/lib/tntd-rc-select/_util/useCompactItemContext.d.ts.map +1 -0
  183. package/lib/tntd-rc-select/_util/useCompactItemContext.js +54 -0
  184. package/lib/tntd-rc-select/_util/useCompactItemContext.js.map +1 -0
  185. package/lib/tntd-rc-select/_util/warning.d.ts +4 -0
  186. package/lib/tntd-rc-select/_util/warning.d.ts.map +1 -0
  187. package/lib/tntd-rc-select/_util/warning.js +40 -0
  188. package/lib/tntd-rc-select/_util/warning.js.map +1 -0
  189. package/lib/tntd-rc-select/img/no-data-s.png +0 -0
  190. package/lib/tntd-rc-select/index.d.ts +44 -0
  191. package/lib/tntd-rc-select/index.d.ts.map +1 -0
  192. package/lib/tntd-rc-select/index.js +131 -0
  193. package/lib/tntd-rc-select/index.js.map +1 -0
  194. package/lib/tntd-rc-select/style/index.less +1657 -0
  195. package/lib/tntd-select/_util/DisabledContext.d.ts +10 -0
  196. package/lib/tntd-select/_util/DisabledContext.d.ts.map +1 -0
  197. package/lib/tntd-select/_util/DisabledContext.js +35 -0
  198. package/lib/tntd-select/_util/DisabledContext.js.map +1 -0
  199. package/lib/tntd-select/_util/FormItemInputContext.d.ts +4 -0
  200. package/lib/tntd-select/_util/FormItemInputContext.d.ts.map +1 -0
  201. package/lib/tntd-select/_util/FormItemInputContext.js +29 -0
  202. package/lib/tntd-select/_util/FormItemInputContext.js.map +1 -0
  203. package/lib/tntd-select/_util/PurePanel.d.ts +3 -2
  204. package/lib/tntd-select/_util/PurePanel.d.ts.map +1 -1
  205. package/lib/tntd-select/_util/PurePanel.js +4 -19
  206. package/lib/tntd-select/_util/PurePanel.js.map +1 -1
  207. package/lib/tntd-select/_util/SizeContext.d.ts +4 -0
  208. package/lib/tntd-select/_util/SizeContext.d.ts.map +1 -0
  209. package/lib/tntd-select/_util/SizeContext.js +29 -0
  210. package/lib/tntd-select/_util/SizeContext.js.map +1 -0
  211. package/lib/tntd-select/_util/context.d.ts +42 -0
  212. package/lib/tntd-select/_util/context.d.ts.map +1 -0
  213. package/lib/tntd-select/_util/context.js +20 -0
  214. package/lib/tntd-select/_util/context.js.map +1 -0
  215. package/lib/tntd-select/_util/defaultRenderEmpty.d.ts +5 -0
  216. package/lib/tntd-select/_util/defaultRenderEmpty.d.ts.map +1 -0
  217. package/lib/tntd-select/_util/defaultRenderEmpty.js +48 -0
  218. package/lib/tntd-select/_util/defaultRenderEmpty.js.map +1 -0
  219. package/lib/tntd-select/_util/getIcons.d.ts +25 -0
  220. package/lib/tntd-select/_util/getIcons.d.ts.map +1 -0
  221. package/lib/tntd-select/_util/getIcons.js +78 -0
  222. package/lib/tntd-select/_util/getIcons.js.map +1 -0
  223. package/lib/tntd-select/_util/interface.d.ts +25 -0
  224. package/lib/tntd-select/_util/interface.d.ts.map +1 -0
  225. package/lib/tntd-select/_util/interface.js +9 -0
  226. package/lib/tntd-select/_util/interface.js.map +1 -0
  227. package/lib/tntd-select/_util/motion.d.ts +5 -4
  228. package/lib/tntd-select/_util/motion.d.ts.map +1 -1
  229. package/lib/tntd-select/_util/motion.js +16 -8
  230. package/lib/tntd-select/_util/motion.js.map +1 -1
  231. package/lib/tntd-select/_util/type.d.ts +10 -0
  232. package/lib/tntd-select/_util/type.d.ts.map +1 -0
  233. package/lib/tntd-select/_util/type.js +9 -0
  234. package/lib/tntd-select/_util/type.js.map +1 -0
  235. package/lib/tntd-select/_util/useCompactItemContext.d.ts +9 -0
  236. package/lib/tntd-select/_util/useCompactItemContext.d.ts.map +1 -0
  237. package/lib/tntd-select/_util/useCompactItemContext.js +54 -0
  238. package/lib/tntd-select/_util/useCompactItemContext.js.map +1 -0
  239. package/lib/tntd-select/_util/warning.d.ts +3 -4
  240. package/lib/tntd-select/_util/warning.d.ts.map +1 -1
  241. package/lib/tntd-select/_util/warning.js +13 -5
  242. package/lib/tntd-select/_util/warning.js.map +1 -1
  243. package/lib/tntd-select/index.d.ts.map +1 -1
  244. package/lib/tntd-select/index.js +7 -1
  245. package/lib/tntd-select/index.js.map +1 -1
  246. package/lib/tntd-select/rc-select/BaseSelect.d.ts +114 -0
  247. package/lib/tntd-select/rc-select/BaseSelect.d.ts.map +1 -0
  248. package/lib/tntd-select/rc-select/BaseSelect.js +459 -0
  249. package/lib/tntd-select/rc-select/BaseSelect.js.map +1 -0
  250. package/lib/tntd-select/rc-select/OptGroup.d.ts +13 -0
  251. package/lib/tntd-select/rc-select/OptGroup.d.ts.map +1 -0
  252. package/lib/tntd-select/rc-select/OptGroup.js +7 -0
  253. package/lib/tntd-select/rc-select/OptGroup.js.map +1 -0
  254. package/lib/tntd-select/rc-select/Option.d.ts +15 -0
  255. package/lib/tntd-select/rc-select/Option.d.ts.map +1 -0
  256. package/lib/tntd-select/rc-select/Option.js +7 -0
  257. package/lib/tntd-select/rc-select/Option.js.map +1 -0
  258. package/lib/tntd-select/rc-select/OptionList.d.ts +11 -0
  259. package/lib/tntd-select/rc-select/OptionList.d.ts.map +1 -0
  260. package/lib/tntd-select/rc-select/OptionList.js +285 -0
  261. package/lib/tntd-select/rc-select/OptionList.js.map +1 -0
  262. package/lib/tntd-select/rc-select/Select.d.ts +115 -0
  263. package/lib/tntd-select/rc-select/Select.d.ts.map +1 -0
  264. package/lib/tntd-select/rc-select/Select.js +456 -0
  265. package/lib/tntd-select/rc-select/Select.js.map +1 -0
  266. package/lib/tntd-select/rc-select/SelectContext.d.ts +23 -0
  267. package/lib/tntd-select/rc-select/SelectContext.d.ts.map +1 -0
  268. package/lib/tntd-select/rc-select/SelectContext.js +29 -0
  269. package/lib/tntd-select/rc-select/SelectContext.js.map +1 -0
  270. package/lib/tntd-select/rc-select/SelectTrigger.d.ts +31 -0
  271. package/lib/tntd-select/rc-select/SelectTrigger.d.ts.map +1 -0
  272. package/lib/tntd-select/rc-select/SelectTrigger.js +119 -0
  273. package/lib/tntd-select/rc-select/SelectTrigger.js.map +1 -0
  274. package/lib/tntd-select/rc-select/Selector/Input.d.ts +27 -0
  275. package/lib/tntd-select/rc-select/Selector/Input.d.ts.map +1 -0
  276. package/lib/tntd-select/rc-select/Selector/Input.js +75 -0
  277. package/lib/tntd-select/rc-select/Selector/Input.js.map +1 -0
  278. package/lib/tntd-select/rc-select/Selector/MultipleSelector.d.ts +17 -0
  279. package/lib/tntd-select/rc-select/Selector/MultipleSelector.d.ts.map +1 -0
  280. package/lib/tntd-select/rc-select/Selector/MultipleSelector.js +125 -0
  281. package/lib/tntd-select/rc-select/Selector/MultipleSelector.js.map +1 -0
  282. package/lib/tntd-select/rc-select/Selector/SingleSelector.d.ts +9 -0
  283. package/lib/tntd-select/rc-select/Selector/SingleSelector.d.ts.map +1 -0
  284. package/lib/tntd-select/rc-select/Selector/SingleSelector.js +73 -0
  285. package/lib/tntd-select/rc-select/Selector/SingleSelector.js.map +1 -0
  286. package/lib/tntd-select/rc-select/Selector/index.d.ts +83 -0
  287. package/lib/tntd-select/rc-select/Selector/index.d.ts.map +1 -0
  288. package/lib/tntd-select/rc-select/Selector/index.js +164 -0
  289. package/lib/tntd-select/rc-select/Selector/index.js.map +1 -0
  290. package/lib/tntd-select/rc-select/TransBtn.d.ts +13 -0
  291. package/lib/tntd-select/rc-select/TransBtn.d.ts.map +1 -0
  292. package/lib/tntd-select/rc-select/TransBtn.js +50 -0
  293. package/lib/tntd-select/rc-select/TransBtn.js.map +1 -0
  294. package/lib/tntd-select/rc-select/hooks/useAllowClear.d.ts +9 -0
  295. package/lib/tntd-select/rc-select/hooks/useAllowClear.d.ts.map +1 -0
  296. package/lib/tntd-select/rc-select/hooks/useAllowClear.js +32 -0
  297. package/lib/tntd-select/rc-select/hooks/useAllowClear.js.map +1 -0
  298. package/lib/tntd-select/rc-select/hooks/useBaseProps.d.ts +14 -0
  299. package/lib/tntd-select/rc-select/hooks/useBaseProps.d.ts.map +1 -0
  300. package/lib/tntd-select/rc-select/hooks/useBaseProps.js +37 -0
  301. package/lib/tntd-select/rc-select/hooks/useBaseProps.js.map +1 -0
  302. package/lib/tntd-select/rc-select/hooks/useCache.d.ts +8 -0
  303. package/lib/tntd-select/rc-select/hooks/useCache.d.ts.map +1 -0
  304. package/lib/tntd-select/rc-select/hooks/useCache.js +59 -0
  305. package/lib/tntd-select/rc-select/hooks/useCache.js.map +1 -0
  306. package/lib/tntd-select/rc-select/hooks/useDelayReset.d.ts +6 -0
  307. package/lib/tntd-select/rc-select/hooks/useDelayReset.d.ts.map +1 -0
  308. package/lib/tntd-select/rc-select/hooks/useDelayReset.js +50 -0
  309. package/lib/tntd-select/rc-select/hooks/useDelayReset.js.map +1 -0
  310. package/lib/tntd-select/rc-select/hooks/useFilterOptions.d.ts +4 -0
  311. package/lib/tntd-select/rc-select/hooks/useFilterOptions.d.ts.map +1 -0
  312. package/lib/tntd-select/rc-select/hooks/useFilterOptions.js +80 -0
  313. package/lib/tntd-select/rc-select/hooks/useFilterOptions.js.map +1 -0
  314. package/lib/tntd-select/rc-select/hooks/useId.d.ts +6 -0
  315. package/lib/tntd-select/rc-select/hooks/useId.d.ts.map +1 -0
  316. package/lib/tntd-select/rc-select/hooks/useId.js +59 -0
  317. package/lib/tntd-select/rc-select/hooks/useId.js.map +1 -0
  318. package/lib/tntd-select/rc-select/hooks/useLayoutEffect.d.ts +6 -0
  319. package/lib/tntd-select/rc-select/hooks/useLayoutEffect.d.ts.map +1 -0
  320. package/lib/tntd-select/rc-select/hooks/useLayoutEffect.js +44 -0
  321. package/lib/tntd-select/rc-select/hooks/useLayoutEffect.js.map +1 -0
  322. package/lib/tntd-select/rc-select/hooks/useLock.d.ts +8 -0
  323. package/lib/tntd-select/rc-select/hooks/useLock.d.ts.map +1 -0
  324. package/lib/tntd-select/rc-select/hooks/useLock.js +52 -0
  325. package/lib/tntd-select/rc-select/hooks/useLock.js.map +1 -0
  326. package/lib/tntd-select/rc-select/hooks/useOptions.d.ts +12 -0
  327. package/lib/tntd-select/rc-select/hooks/useOptions.d.ts.map +1 -0
  328. package/lib/tntd-select/rc-select/hooks/useOptions.js +71 -0
  329. package/lib/tntd-select/rc-select/hooks/useOptions.js.map +1 -0
  330. package/lib/tntd-select/rc-select/hooks/useRefFunc.d.ts +6 -0
  331. package/lib/tntd-select/rc-select/hooks/useRefFunc.d.ts.map +1 -0
  332. package/lib/tntd-select/rc-select/hooks/useRefFunc.js +40 -0
  333. package/lib/tntd-select/rc-select/hooks/useRefFunc.js.map +1 -0
  334. package/lib/tntd-select/rc-select/hooks/useSelectTriggerControl.d.ts +2 -0
  335. package/lib/tntd-select/rc-select/hooks/useSelectTriggerControl.d.ts.map +1 -0
  336. package/lib/tntd-select/rc-select/hooks/useSelectTriggerControl.js +58 -0
  337. package/lib/tntd-select/rc-select/hooks/useSelectTriggerControl.js.map +1 -0
  338. package/lib/tntd-select/rc-select/index.d.ts +11 -0
  339. package/lib/tntd-select/rc-select/index.d.ts.map +1 -0
  340. package/lib/tntd-select/rc-select/index.js +17 -0
  341. package/lib/tntd-select/rc-select/index.js.map +1 -0
  342. package/lib/tntd-select/rc-select/interface.d.ts +23 -0
  343. package/lib/tntd-select/rc-select/interface.d.ts.map +1 -0
  344. package/lib/tntd-select/rc-select/interface.js +3 -0
  345. package/lib/tntd-select/rc-select/interface.js.map +1 -0
  346. package/lib/tntd-select/rc-select/utils/commonUtil.d.ts +10 -0
  347. package/lib/tntd-select/rc-select/utils/commonUtil.d.ts.map +1 -0
  348. package/lib/tntd-select/rc-select/utils/commonUtil.js +39 -0
  349. package/lib/tntd-select/rc-select/utils/commonUtil.js.map +1 -0
  350. package/lib/tntd-select/rc-select/utils/keyUtil.d.ts +3 -0
  351. package/lib/tntd-select/rc-select/utils/keyUtil.d.ts.map +1 -0
  352. package/lib/tntd-select/rc-select/utils/keyUtil.js +41 -0
  353. package/lib/tntd-select/rc-select/utils/keyUtil.js.map +1 -0
  354. package/lib/tntd-select/rc-select/utils/legacyUtil.d.ts +4 -0
  355. package/lib/tntd-select/rc-select/utils/legacyUtil.d.ts.map +1 -0
  356. package/lib/tntd-select/rc-select/utils/legacyUtil.js +62 -0
  357. package/lib/tntd-select/rc-select/utils/legacyUtil.js.map +1 -0
  358. package/lib/tntd-select/rc-select/utils/platformUtil.d.ts +2 -0
  359. package/lib/tntd-select/rc-select/utils/platformUtil.d.ts.map +1 -0
  360. package/lib/tntd-select/rc-select/utils/platformUtil.js +9 -0
  361. package/lib/tntd-select/rc-select/utils/platformUtil.js.map +1 -0
  362. package/lib/tntd-select/rc-select/utils/valueUtil.d.ts +24 -0
  363. package/lib/tntd-select/rc-select/utils/valueUtil.d.ts.map +1 -0
  364. package/lib/tntd-select/rc-select/utils/valueUtil.js +109 -0
  365. package/lib/tntd-select/rc-select/utils/valueUtil.js.map +1 -0
  366. package/lib/tntd-select/rc-select/utils/warningPropsUtil.d.ts +5 -0
  367. package/lib/tntd-select/rc-select/utils/warningPropsUtil.d.ts.map +1 -0
  368. package/lib/tntd-select/rc-select/utils/warningPropsUtil.js +130 -0
  369. package/lib/tntd-select/rc-select/utils/warningPropsUtil.js.map +1 -0
  370. package/package.json +1 -1
@@ -0,0 +1,55 @@
1
+ import * as React from 'react';
2
+ import { toArray } from '../utils/commonUtil';
3
+ import { injectPropsWithOption } from '../utils/valueUtil';
4
+ function includes(test, search) {
5
+ return toArray(test).join('').toUpperCase().includes(search);
6
+ }
7
+ export default (options, fieldNames, searchValue, filterOption, optionFilterProp) => React.useMemo(() => {
8
+ if (!searchValue || filterOption === false) {
9
+ return options;
10
+ }
11
+ const { options: fieldOptions, label: fieldLabel, value: fieldValue } = fieldNames;
12
+ const filteredOptions = [];
13
+ const customizeFilter = typeof filterOption === 'function';
14
+ const upperSearch = searchValue.toUpperCase();
15
+ const filterFunc = customizeFilter
16
+ ? filterOption
17
+ : (_, option) => {
18
+ // Use provided `optionFilterProp`
19
+ if (optionFilterProp) {
20
+ return includes(option[optionFilterProp], upperSearch);
21
+ }
22
+ // Auto select `label` or `value` by option type
23
+ if (option[fieldOptions]) {
24
+ // hack `fieldLabel` since `OptionGroup` children is not `label`
25
+ return includes(option[fieldLabel !== 'children' ? fieldLabel : 'label'], upperSearch);
26
+ }
27
+ return includes(option[fieldValue], upperSearch);
28
+ };
29
+ const wrapOption = customizeFilter
30
+ ? (opt) => injectPropsWithOption(opt)
31
+ : (opt) => opt;
32
+ options.forEach((item) => {
33
+ // Group should check child options
34
+ if (item[fieldOptions]) {
35
+ // Check group first
36
+ const matchGroup = filterFunc(searchValue, wrapOption(item));
37
+ if (matchGroup) {
38
+ filteredOptions.push(item);
39
+ }
40
+ else {
41
+ // Check option
42
+ const subOptions = item[fieldOptions].filter((subItem) => filterFunc(searchValue, wrapOption(subItem)));
43
+ if (subOptions.length) {
44
+ filteredOptions.push(Object.assign(Object.assign({}, item), { [fieldOptions]: subOptions }));
45
+ }
46
+ }
47
+ return;
48
+ }
49
+ if (filterFunc(searchValue, wrapOption(item))) {
50
+ filteredOptions.push(item);
51
+ }
52
+ });
53
+ return filteredOptions;
54
+ }, [options, filterOption, optionFilterProp, searchValue, fieldNames]);
55
+ //# sourceMappingURL=useFilterOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFilterOptions.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useFilterOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,SAAS,QAAQ,CAAC,IAAqB,EAAE,MAAc;IACrD,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC/D,CAAC;AAED,eAAe,CACb,OAA4B,EAC5B,UAAsB,EACtB,WAAoB,EACpB,YAA0C,EAC1C,gBAAyB,EACzB,EAAE,CACF,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;IACjB,IAAI,CAAC,WAAW,IAAI,YAAY,KAAK,KAAK,EAAE;QAC1C,OAAO,OAAO,CAAC;KAChB;IAED,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC;IACnF,MAAM,eAAe,GAAwB,EAAE,CAAC;IAEhD,MAAM,eAAe,GAAG,OAAO,YAAY,KAAK,UAAU,CAAC;IAE3D,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,E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,eAAe,CAAC,IAAI,iCACf,IAAI,KACP,CAAC,YAAY,CAAC,EAAE,UAAU,IAC1B,CAAC;iBACJ;aACF;YAED,OAAO;SACR;QAED,IAAI,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE;YAC7C,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC5B;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC;AACzB,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { toArray } from '../utils/commonUtil';\nimport type { FieldNames, DefaultOptionType, SelectProps } from '../Select';\nimport { injectPropsWithOption } from '../utils/valueUtil';\n\nfunction includes(test: React.ReactNode, search: string) {\n return toArray(test).join('').toUpperCase().includes(search);\n}\n\nexport default (\n options: DefaultOptionType[],\n fieldNames: FieldNames,\n searchValue?: string,\n filterOption?: SelectProps['filterOption'],\n optionFilterProp?: string,\n) =>\n React.useMemo(() => {\n if (!searchValue || filterOption === false) {\n return options;\n }\n\n const { options: fieldOptions, label: fieldLabel, value: fieldValue } = fieldNames;\n const filteredOptions: DefaultOptionType[] = [];\n\n const customizeFilter = typeof filterOption === 'function';\n\n const upperSearch = searchValue.toUpperCase();\n const filterFunc = customizeFilter\n ? filterOption\n : (_: string, option: DefaultOptionType) => {\n // Use provided `optionFilterProp`\n if (optionFilterProp) {\n return includes(option[optionFilterProp], upperSearch);\n }\n\n // Auto select `label` or `value` by option type\n if (option[fieldOptions]) {\n // hack `fieldLabel` since `OptionGroup` children is not `label`\n return includes(option[fieldLabel !== 'children' ? fieldLabel : 'label'], upperSearch);\n }\n\n return includes(option[fieldValue], upperSearch);\n };\n\n const wrapOption: (opt: DefaultOptionType) => DefaultOptionType = customizeFilter\n ? (opt) => injectPropsWithOption(opt)\n : (opt) => opt;\n\n options.forEach((item) => {\n // Group should check child options\n if (item[fieldOptions]) {\n // Check group first\n const matchGroup = filterFunc(searchValue, wrapOption(item));\n if (matchGroup) {\n filteredOptions.push(item);\n } else {\n // Check option\n const subOptions = item[fieldOptions].filter((subItem: DefaultOptionType) =>\n filterFunc(searchValue, wrapOption(subItem)),\n );\n if (subOptions.length) {\n filteredOptions.push({\n ...item,\n [fieldOptions]: subOptions,\n });\n }\n }\n\n return;\n }\n\n if (filterFunc(searchValue, wrapOption(item))) {\n filteredOptions.push(item);\n }\n });\n\n return filteredOptions;\n }, [options, filterOption, optionFilterProp, searchValue, fieldNames]);\n"]}
@@ -0,0 +1,28 @@
1
+ import * as React from 'react';
2
+ import canUseDom from 'rc-util/lib/Dom/canUseDom';
3
+ let uuid = 0;
4
+ /** Is client side and not jsdom */
5
+ export const isBrowserClient = process.env.NODE_ENV !== 'test' && canUseDom();
6
+ /** Get unique id for accessibility usage */
7
+ export function getUUID() {
8
+ let retId;
9
+ // Test never reach
10
+ /* istanbul ignore if */
11
+ if (isBrowserClient) {
12
+ retId = uuid;
13
+ uuid += 1;
14
+ }
15
+ else {
16
+ retId = 'TEST_OR_SSR';
17
+ }
18
+ return retId;
19
+ }
20
+ export default function useId(id) {
21
+ // Inner id for accessibility usage. Only work in client side
22
+ const [innerId, setInnerId] = React.useState();
23
+ React.useEffect(() => {
24
+ setInnerId(`rc_select_${getUUID()}`);
25
+ }, []);
26
+ return id || innerId;
27
+ }
28
+ //# sourceMappingURL=useId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useId.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAElD,IAAI,IAAI,GAAG,CAAC,CAAC;AAEb,mCAAmC;AACnC,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,IAAI,SAAS,EAAE,CAAC;AAE9E,4CAA4C;AAC5C,MAAM,UAAU,OAAO;IACrB,IAAI,KAAsB,CAAC;IAE3B,mBAAmB;IACnB,wBAAwB;IACxB,IAAI,eAAe,EAAE;QACnB,KAAK,GAAG,IAAI,CAAC;QACb,IAAI,IAAI,CAAC,CAAC;KACX;SAAM;QACL,KAAK,GAAG,aAAa,CAAC;KACvB;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAW;IACvC,6DAA6D;IAC7D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IACvD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,UAAU,CAAC,aAAa,OAAO,EAAE,EAAE,CAAC,CAAC;IACvC,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,EAAE,IAAI,OAAO,CAAC;AACvB,CAAC","sourcesContent":["import * as React from 'react';\nimport canUseDom from 'rc-util/lib/Dom/canUseDom';\n\nlet uuid = 0;\n\n/** Is client side and not jsdom */\nexport const isBrowserClient = process.env.NODE_ENV !== 'test' && canUseDom();\n\n/** Get unique id for accessibility usage */\nexport function getUUID(): number | string {\n let retId: string | number;\n\n // Test never reach\n /* istanbul ignore if */\n if (isBrowserClient) {\n retId = uuid;\n uuid += 1;\n } else {\n retId = 'TEST_OR_SSR';\n }\n\n return retId;\n}\n\nexport default function useId(id?: string) {\n // Inner id for accessibility usage. Only work in client side\n const [innerId, setInnerId] = React.useState<string>();\n React.useEffect(() => {\n setInnerId(`rc_select_${getUUID()}`);\n }, []);\n return id || innerId;\n}\n"]}
@@ -0,0 +1,18 @@
1
+ /* eslint-disable react-hooks/rules-of-hooks */
2
+ import * as React from 'react';
3
+ import { isBrowserClient } from '../utils/commonUtil';
4
+ /**
5
+ * Wrap `React.useLayoutEffect` which will not throw warning message in test env
6
+ */
7
+ export default function useLayoutEffect(effect, deps) {
8
+ // Never happen in test env
9
+ if (isBrowserClient) {
10
+ /* istanbul ignore next */
11
+ React.useLayoutEffect(effect, deps);
12
+ }
13
+ else {
14
+ React.useEffect(effect, deps);
15
+ }
16
+ }
17
+ /* eslint-enable */
18
+ //# sourceMappingURL=useLayoutEffect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLayoutEffect.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useLayoutEffect.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,MAA4B,EAAE,IAA2B;IAC/F,2BAA2B;IAC3B,IAAI,eAAe,EAAE;QACnB,0BAA0B;QAC1B,KAAK,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;KACrC;SAAM;QACL,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;KAC/B;AACH,CAAC;AACD,mBAAmB","sourcesContent":["/* eslint-disable react-hooks/rules-of-hooks */\nimport * as React from 'react';\nimport { isBrowserClient } from '../utils/commonUtil';\n\n/**\n * Wrap `React.useLayoutEffect` which will not throw warning message in test env\n */\nexport default function useLayoutEffect(effect: React.EffectCallback, deps?: React.DependencyList) {\n // Never happen in test env\n if (isBrowserClient) {\n /* istanbul ignore next */\n React.useLayoutEffect(effect, deps);\n } else {\n React.useEffect(effect, deps);\n }\n}\n/* eslint-enable */\n"]}
@@ -0,0 +1,26 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Locker return cached mark.
4
+ * If set to `true`, will return `true` in a short time even if set `false`.
5
+ * If set to `false` and then set to `true`, will change to `true`.
6
+ * And after time duration, it will back to `null` automatically.
7
+ */
8
+ export default function useLock(duration = 250) {
9
+ const lockRef = React.useRef(null);
10
+ const timeoutRef = React.useRef(null);
11
+ // Clean up
12
+ React.useEffect(() => () => {
13
+ window.clearTimeout(timeoutRef.current);
14
+ }, []);
15
+ function doLock(locked) {
16
+ if (locked || lockRef.current === null) {
17
+ lockRef.current = locked;
18
+ }
19
+ window.clearTimeout(timeoutRef.current);
20
+ timeoutRef.current = window.setTimeout(() => {
21
+ lockRef.current = null;
22
+ }, duration);
23
+ }
24
+ return [() => lockRef.current, doLock];
25
+ }
26
+ //# sourceMappingURL=useLock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLock.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useLock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,WAAmB,GAAG;IACpD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAU,IAAI,CAAC,CAAC;IAC5C,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAS,IAAI,CAAC,CAAC;IAE9C,WAAW;IACX,KAAK,CAAC,SAAS,CACb,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC,EACD,EAAE,CACH,CAAC;IAEF,SAAS,MAAM,CAAC,MAAe;QAC7B,IAAI,MAAM,IAAI,OAAO,CAAC,OAAO,KAAK,IAAI,EAAE;YACtC,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;SAC1B;QAED,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACxC,UAAU,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;YAC1C,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;QACzB,CAAC,EAAE,QAAQ,CAAC,CAAC;IACf,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC","sourcesContent":["import * as React from 'react';\n\n/**\n * Locker return cached mark.\n * If set to `true`, will return `true` in a short time even if set `false`.\n * If set to `false` and then set to `true`, will change to `true`.\n * And after time duration, it will back to `null` automatically.\n */\nexport default function useLock(duration: number = 250): [() => boolean, (lock: boolean) => void] {\n const lockRef = React.useRef<boolean>(null);\n const timeoutRef = React.useRef<number>(null);\n\n // Clean up\n React.useEffect(\n () => () => {\n window.clearTimeout(timeoutRef.current);\n },\n [],\n );\n\n function doLock(locked: boolean) {\n if (locked || lockRef.current === null) {\n lockRef.current = locked;\n }\n\n window.clearTimeout(timeoutRef.current);\n timeoutRef.current = window.setTimeout(() => {\n lockRef.current = null;\n }, duration);\n }\n\n return [() => lockRef.current, doLock];\n}\n"]}
@@ -0,0 +1,45 @@
1
+ import * as React from 'react';
2
+ import { convertChildrenToData } from '../utils/legacyUtil';
3
+ /**
4
+ * Parse `children` to `options` if `options` is not provided.
5
+ * Then flatten the `options`.
6
+ */
7
+ export default function useOptions(options, children, fieldNames, optionFilterProp, optionLabelProp) {
8
+ return React.useMemo(() => {
9
+ let mergedOptions = options;
10
+ const childrenAsData = !options;
11
+ if (childrenAsData) {
12
+ mergedOptions = convertChildrenToData(children);
13
+ }
14
+ const valueOptions = new Map();
15
+ const labelOptions = new Map();
16
+ const setLabelOptions = (labelOptionsMap, option, key) => {
17
+ if (key && typeof key === 'string') {
18
+ labelOptionsMap.set(option[key], option);
19
+ }
20
+ };
21
+ function dig(optionList, isChildren = false) {
22
+ // for loop to speed up collection speed
23
+ for (let i = 0; i < optionList.length; i += 1) {
24
+ const option = optionList[i];
25
+ if (!option[fieldNames.options] || isChildren) {
26
+ valueOptions.set(option[fieldNames.value], option);
27
+ setLabelOptions(labelOptions, option, fieldNames.label);
28
+ // https://github.com/ant-design/ant-design/issues/35304
29
+ setLabelOptions(labelOptions, option, optionFilterProp);
30
+ setLabelOptions(labelOptions, option, optionLabelProp);
31
+ }
32
+ else {
33
+ dig(option[fieldNames.options], true);
34
+ }
35
+ }
36
+ }
37
+ dig(mergedOptions);
38
+ return {
39
+ options: mergedOptions,
40
+ valueOptions,
41
+ labelOptions,
42
+ };
43
+ }, [options, children, fieldNames, optionFilterProp, optionLabelProp]);
44
+ }
45
+ //# sourceMappingURL=useOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOptions.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,OAAqB,EACrB,QAAyB,EACzB,UAAsB,EACtB,gBAAwB,EACxB,eAAuB;IAEvB,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACxB,IAAI,aAAa,GAAG,OAAO,CAAC;QAC5B,MAAM,cAAc,GAAG,CAAC,OAAO,CAAC;QAEhC,IAAI,cAAc,EAAE;YAClB,aAAa,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;SACjD;QAED,MAAM,YAAY,GAAG,IAAI,GAAG,EAA4B,CAAC;QACzD,MAAM,YAAY,GAAG,IAAI,GAAG,EAA+B,CAAC;QAE5D,MAAM,eAAe,GAAG,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;YACvD,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;gBAClC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;aAC1C;QACH,CAAC,CAAC;QAEF,SAAS,GAAG,CAAC,UAAwB,EAAE,UAAU,GAAG,KAAK;YACvD,wCAAwC;YACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;gBAC7C,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC7B,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,UAAU,EAAE;oBAC7C,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;oBACnD,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;oBACxD,wDAAwD;oBACxD,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;oBACxD,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;iBACxD;qBAAM;oBACL,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;iBACvC;aACF;QACH,CAAC;QACD,GAAG,CAAC,aAAa,CAAC,CAAC;QAEnB,OAAO;YACL,OAAO,EAAE,aAAa;YACtB,YAAY;YACZ,YAAY;SACb,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAAC,CAAC;AACzE,CAAC","sourcesContent":["import * as React from 'react';\nimport type { FieldNames, RawValueType } from '../Select';\nimport { convertChildrenToData } from '../utils/legacyUtil';\n\n/**\n * Parse `children` to `options` if `options` is not provided.\n * Then flatten the `options`.\n */\nexport default function useOptions<OptionType>(\n options: OptionType[],\n children: React.ReactNode,\n fieldNames: FieldNames,\n optionFilterProp: string,\n optionLabelProp: string,\n) {\n return React.useMemo(() => {\n let mergedOptions = options;\n const childrenAsData = !options;\n\n if (childrenAsData) {\n mergedOptions = convertChildrenToData(children);\n }\n\n const valueOptions = new Map<RawValueType, OptionType>();\n const labelOptions = new Map<React.ReactNode, OptionType>();\n\n const setLabelOptions = (labelOptionsMap, option, key) => {\n if (key && typeof key === 'string') {\n labelOptionsMap.set(option[key], option);\n }\n };\n\n function dig(optionList: OptionType[], isChildren = false) {\n // for loop to speed up collection speed\n for (let i = 0; i < optionList.length; i += 1) {\n const option = optionList[i];\n if (!option[fieldNames.options] || isChildren) {\n valueOptions.set(option[fieldNames.value], option);\n setLabelOptions(labelOptions, option, fieldNames.label);\n // https://github.com/ant-design/ant-design/issues/35304\n setLabelOptions(labelOptions, option, optionFilterProp);\n setLabelOptions(labelOptions, option, optionLabelProp);\n } else {\n dig(option[fieldNames.options], true);\n }\n }\n }\n dig(mergedOptions);\n\n return {\n options: mergedOptions,\n valueOptions,\n labelOptions,\n };\n }, [options, children, fieldNames, optionFilterProp, optionLabelProp]);\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Same as `React.useCallback` but always return a memoized function
4
+ * but redirect to real function.
5
+ */
6
+ export default function useRefFunc(callback) {
7
+ const funcRef = React.useRef();
8
+ funcRef.current = callback;
9
+ const cacheFn = React.useCallback((...args) => {
10
+ return funcRef.current(...args);
11
+ }, []);
12
+ return cacheFn;
13
+ }
14
+ //# sourceMappingURL=useRefFunc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRefFunc.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useRefFunc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,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","sourcesContent":["import * 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,32 @@
1
+ import * as React from 'react';
2
+ export default function useSelectTriggerControl(elements, open, triggerOpen, customizedTrigger) {
3
+ const propsRef = React.useRef(null);
4
+ propsRef.current = {
5
+ open,
6
+ triggerOpen,
7
+ customizedTrigger,
8
+ };
9
+ React.useEffect(() => {
10
+ function onGlobalMouseDown(event) {
11
+ var _a;
12
+ // If trigger is customized, Trigger will take control of popupVisible
13
+ if ((_a = propsRef.current) === null || _a === void 0 ? void 0 : _a.customizedTrigger) {
14
+ return;
15
+ }
16
+ let target = event.target;
17
+ if (target.shadowRoot && event.composed) {
18
+ target = (event.composedPath()[0] || target);
19
+ }
20
+ if (propsRef.current.open &&
21
+ elements()
22
+ .filter((element) => element)
23
+ .every((element) => !element.contains(target) && element !== target)) {
24
+ // Should trigger close
25
+ propsRef.current.triggerOpen(false);
26
+ }
27
+ }
28
+ window.addEventListener('mousedown', onGlobalMouseDown);
29
+ return () => window.removeEventListener('mousedown', onGlobalMouseDown);
30
+ }, []);
31
+ }
32
+ //# sourceMappingURL=useSelectTriggerControl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSelectTriggerControl.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useSelectTriggerControl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAC7C,QAA2C,EAC3C,IAAa,EACb,WAAoC,EACpC,iBAA0B;IAE1B,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACpC,QAAQ,CAAC,OAAO,GAAG;QACjB,IAAI;QACJ,WAAW;QACX,iBAAiB;KAClB,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,SAAS,iBAAiB,CAAC,KAAiB;;YAC1C,sEAAsE;YACtE,IAAI,MAAA,QAAQ,CAAC,OAAO,0CAAE,iBAAiB,EAAE;gBACvC,OAAO;aACR;YAED,IAAI,MAAM,GAAG,KAAK,CAAC,MAAqB,CAAC;YAEzC,IAAI,MAAM,CAAC,UAAU,IAAI,KAAK,CAAC,QAAQ,EAAE;gBACvC,MAAM,GAAG,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,CAAgB,CAAC;aAC7D;YAED,IACE,QAAQ,CAAC,OAAO,CAAC,IAAI;gBACrB,QAAQ,EAAE;qBACP,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;qBAC5B,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,OAAO,KAAK,MAAM,CAAC,EACtE;gBACA,uBAAuB;gBACvB,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;aACrC;QACH,CAAC;QAED,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;QACxD,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;IAC1E,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC","sourcesContent":["import * as React from 'react';\n\nexport default function useSelectTriggerControl(\n elements: () => (HTMLElement | undefined)[],\n open: boolean,\n triggerOpen: (open: boolean) => void,\n customizedTrigger: boolean,\n) {\n const propsRef = React.useRef(null);\n propsRef.current = {\n open,\n triggerOpen,\n customizedTrigger,\n };\n\n React.useEffect(() => {\n function onGlobalMouseDown(event: MouseEvent) {\n // If trigger is customized, Trigger will take control of popupVisible\n if (propsRef.current?.customizedTrigger) {\n return;\n }\n\n let target = event.target as HTMLElement;\n\n if (target.shadowRoot && event.composed) {\n target = (event.composedPath()[0] || target) as HTMLElement;\n }\n\n if (\n propsRef.current.open &&\n elements()\n .filter((element) => element)\n .every((element) => !element.contains(target) && element !== target)\n ) {\n // Should trigger close\n propsRef.current.triggerOpen(false);\n }\n }\n\n window.addEventListener('mousedown', onGlobalMouseDown);\n return () => window.removeEventListener('mousedown', onGlobalMouseDown);\n }, []);\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import Select from './Select';
2
+ import Option from './Option';
3
+ import OptGroup from './OptGroup';
4
+ import BaseSelect from './BaseSelect';
5
+ import useBaseProps from './hooks/useBaseProps';
6
+ export { Option, OptGroup, BaseSelect, useBaseProps };
7
+ export default Select;
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tntd-select/rc-select/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AAGtD,eAAe,MAAM,CAAC","sourcesContent":["import Select from './Select';\nimport Option from './Option';\nimport OptGroup from './OptGroup';\nimport type { SelectProps } from './Select';\nimport BaseSelect from './BaseSelect';\nimport type { BaseSelectProps, BaseSelectRef, BaseSelectPropsWithoutPrivate } from './BaseSelect';\nimport useBaseProps from './hooks/useBaseProps';\n\nexport { Option, OptGroup, BaseSelect, useBaseProps };\nexport type { SelectProps, BaseSelectProps, BaseSelectRef, BaseSelectPropsWithoutPrivate };\n\nexport default Select;\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/tntd-select/rc-select/interface.ts"],"names":[],"mappings":"","sourcesContent":["import type * as React from 'react';\n\nexport type RawValueType = string | number;\nexport interface FlattenOptionData<OptionType> {\n label?: React.ReactNode;\n data: OptionType;\n key: React.Key;\n value?: RawValueType;\n groupOption?: boolean;\n group?: boolean;\n}\n\nexport interface DisplayValueType {\n key?: React.Key;\n value?: RawValueType;\n label?: React.ReactNode;\n title?: string | number;\n disabled?: boolean;\n}\n\nexport type RenderNode = React.ReactNode | ((props: any) => React.ReactNode);\n\nexport type RenderDOMFunc = (props: any) => HTMLElement;\n\nexport type Mode = 'multiple' | 'tags' | 'combobox';\n\nexport type Placement = 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight';\n\nexport type DisplayInfoType = 'add' | 'remove' | 'clear';\n\n"]}
@@ -0,0 +1,32 @@
1
+ export function toArray(value) {
2
+ if (Array.isArray(value)) {
3
+ return value;
4
+ }
5
+ return value !== undefined ? [value] : [];
6
+ }
7
+ export const isClient = typeof window !== 'undefined' && window.document && window.document.documentElement;
8
+ /** Is client side and not jsdom */
9
+ export const isBrowserClient = process.env.NODE_ENV !== 'test' && isClient;
10
+ export function hasValue(value) {
11
+ return value !== undefined && value !== null;
12
+ }
13
+ /** combo mode no value judgment function */
14
+ export function isComboNoValue(value) {
15
+ return !value && value !== 0;
16
+ }
17
+ function isTitleType(title) {
18
+ return ['string', 'number'].includes(typeof title);
19
+ }
20
+ export function getTitle(item) {
21
+ let title = undefined;
22
+ if (item) {
23
+ if (isTitleType(item.title)) {
24
+ title = item.title.toString();
25
+ }
26
+ else if (isTitleType(item.label)) {
27
+ title = item.label.toString();
28
+ }
29
+ }
30
+ return title;
31
+ }
32
+ //# sourceMappingURL=commonUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commonUtil.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/utils/commonUtil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C","sourcesContent":["import type { DisplayValueType } from '../BaseSelect';\n\nexport function toArray<T>(value: T | T[]): T[] {\n if (Array.isArray(value)) {\n return value;\n }\n return value !== undefined ? [value] : [];\n}\n\nexport const isClient =\n typeof window !== 'undefined' && window.document && window.document.documentElement;\n\n/** Is client side and not jsdom */\nexport const isBrowserClient = process.env.NODE_ENV !== 'test' && isClient;\n\nexport function hasValue(value) {\n return value !== undefined && value !== null;\n}\n\n/** combo mode no value judgment function */\nexport function isComboNoValue(value) {\n return !value && value !== 0;\n}\n\nfunction isTitleType(title: any) {\n return ['string', 'number'].includes(typeof title);\n}\n\nexport function getTitle(item: DisplayValueType): string {\n let title: string = undefined;\n if (item) {\n if (isTitleType(item.title)) {\n title = item.title.toString();\n } else if (isTitleType(item.label)) {\n title = item.label.toString();\n }\n }\n\n return title;\n}\n"]}
@@ -0,0 +1,34 @@
1
+ import KeyCode from 'rc-util/lib/KeyCode';
2
+ /** keyCode Judgment function */
3
+ export function isValidateOpenKey(currentKeyCode) {
4
+ return ![
5
+ // System function button
6
+ KeyCode.ESC,
7
+ KeyCode.SHIFT,
8
+ KeyCode.BACKSPACE,
9
+ KeyCode.TAB,
10
+ KeyCode.WIN_KEY,
11
+ KeyCode.ALT,
12
+ KeyCode.META,
13
+ KeyCode.WIN_KEY_RIGHT,
14
+ KeyCode.CTRL,
15
+ KeyCode.SEMICOLON,
16
+ KeyCode.EQUALS,
17
+ KeyCode.CAPS_LOCK,
18
+ KeyCode.CONTEXT_MENU,
19
+ // F1-F12
20
+ KeyCode.F1,
21
+ KeyCode.F2,
22
+ KeyCode.F3,
23
+ KeyCode.F4,
24
+ KeyCode.F5,
25
+ KeyCode.F6,
26
+ KeyCode.F7,
27
+ KeyCode.F8,
28
+ KeyCode.F9,
29
+ KeyCode.F10,
30
+ KeyCode.F11,
31
+ KeyCode.F12,
32
+ ].includes(currentKeyCode);
33
+ }
34
+ //# sourceMappingURL=keyUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyUtil.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/utils/keyUtil.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAE1C,gCAAgC;AAChC,MAAM,UAAU,iBAAiB,CAAC,cAAsB;IACtD,OAAO,CAAC;QACN,yBAAyB;QACzB,OAAO,CAAC,GAAG;QACX,OAAO,CAAC,KAAK;QACb,OAAO,CAAC,SAAS;QACjB,OAAO,CAAC,GAAG;QACX,OAAO,CAAC,OAAO;QACf,OAAO,CAAC,GAAG;QACX,OAAO,CAAC,IAAI;QACZ,OAAO,CAAC,aAAa;QACrB,OAAO,CAAC,IAAI;QACZ,OAAO,CAAC,SAAS;QACjB,OAAO,CAAC,MAAM;QACd,OAAO,CAAC,SAAS;QACjB,OAAO,CAAC,YAAY;QACpB,SAAS;QACT,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,GAAG;QACX,OAAO,CAAC,GAAG;QACX,OAAO,CAAC,GAAG;KACZ,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["import KeyCode from 'rc-util/lib/KeyCode';\n\n/** keyCode Judgment function */\nexport function isValidateOpenKey(currentKeyCode: number): boolean {\n return ![\n // System function button\n KeyCode.ESC,\n KeyCode.SHIFT,\n KeyCode.BACKSPACE,\n KeyCode.TAB,\n KeyCode.WIN_KEY,\n KeyCode.ALT,\n KeyCode.META,\n KeyCode.WIN_KEY_RIGHT,\n KeyCode.CTRL,\n KeyCode.SEMICOLON,\n KeyCode.EQUALS,\n KeyCode.CAPS_LOCK,\n KeyCode.CONTEXT_MENU,\n // F1-F12\n KeyCode.F1,\n KeyCode.F2,\n KeyCode.F3,\n KeyCode.F4,\n KeyCode.F5,\n KeyCode.F6,\n KeyCode.F7,\n KeyCode.F8,\n KeyCode.F9,\n KeyCode.F10,\n KeyCode.F11,\n KeyCode.F12,\n ].includes(currentKeyCode);\n}\n"]}
@@ -0,0 +1,32 @@
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)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import * as React from 'react';
13
+ import toArray from 'rc-util/lib/Children/toArray';
14
+ function convertNodeToOption(node) {
15
+ const _a = node, { key } = _a, _b = _a.props, { children, value } = _b, restProps = __rest(_b, ["children", "value"]);
16
+ return Object.assign({ key, value: value !== undefined ? value : key, children }, restProps);
17
+ }
18
+ export function convertChildrenToData(nodes, optionOnly = false) {
19
+ return toArray(nodes)
20
+ .map((node, index) => {
21
+ if (!React.isValidElement(node) || !node.type) {
22
+ return null;
23
+ }
24
+ const _a = node, { type: { isSelectOptGroup }, key } = _a, _b = _a.props, { children } = _b, restProps = __rest(_b, ["children"]);
25
+ if (optionOnly || !isSelectOptGroup) {
26
+ return convertNodeToOption(node);
27
+ }
28
+ return Object.assign(Object.assign({ key: `__RC_SELECT_GRP__${key === null ? index : key}__`, label: key }, restProps), { options: convertChildrenToData(children) });
29
+ })
30
+ .filter((data) => data);
31
+ }
32
+ //# sourceMappingURL=legacyUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacyUtil.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/utils/legacyUtil.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM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from 'rc-util/lib/Children/toArray';\nimport type { BaseOptionType, DefaultOptionType } from '../Select';\n\nfunction convertNodeToOption<OptionType extends BaseOptionType = DefaultOptionType>(\n node: React.ReactElement,\n): OptionType {\n const {\n key,\n props: { children, value, ...restProps },\n } = node as React.ReactElement;\n\n return { key, value: value !== undefined ? value : key, children, ...restProps };\n}\n\nexport function convertChildrenToData<OptionType extends BaseOptionType = DefaultOptionType>(\n nodes: React.ReactNode,\n optionOnly: boolean = false,\n): OptionType[] {\n return toArray(nodes)\n .map((node: React.ReactElement, index: number): OptionType | null => {\n if (!React.isValidElement(node) || !node.type) {\n return null;\n }\n\n const {\n type: { isSelectOptGroup },\n key,\n props: { children, ...restProps },\n } = node as React.ReactElement & {\n type: { isSelectOptGroup?: boolean };\n };\n\n if (optionOnly || !isSelectOptGroup) {\n return convertNodeToOption(node);\n }\n\n return {\n key: `__RC_SELECT_GRP__${key === null ? index : key}__`,\n label: key,\n ...restProps,\n options: convertChildrenToData(children),\n };\n })\n .filter((data) => data);\n}\n"]}
@@ -0,0 +1,5 @@
1
+ /* istanbul ignore file */
2
+ export function isPlatformMac() {
3
+ return /(mac\sos|macintosh)/i.test(navigator.appVersion);
4
+ }
5
+ //# sourceMappingURL=platformUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platformUtil.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/utils/platformUtil.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,MAAM,UAAU,aAAa;IAC3B,OAAO,sBAAsB,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["/* istanbul ignore file */\nexport function isPlatformMac(): boolean {\n return /(mac\\sos|macintosh)/i.test(navigator.appVersion);\n}\n"]}
@@ -0,0 +1,99 @@
1
+ import warning from 'rc-util/lib/warning';
2
+ function getKey(data, index) {
3
+ const { key } = data;
4
+ let value;
5
+ if ('value' in data) {
6
+ ({ value } = data);
7
+ }
8
+ if (key !== null && key !== undefined) {
9
+ return key;
10
+ }
11
+ if (value !== undefined) {
12
+ return value;
13
+ }
14
+ return `rc-index-key-${index}`;
15
+ }
16
+ export function fillFieldNames(fieldNames, childrenAsData) {
17
+ const { label, value, options, groupLabel } = fieldNames || {};
18
+ const mergedLabel = label || (childrenAsData ? 'children' : 'label');
19
+ return {
20
+ label: mergedLabel,
21
+ value: value || 'value',
22
+ options: options || 'options',
23
+ groupLabel: groupLabel || mergedLabel,
24
+ };
25
+ }
26
+ /**
27
+ * Flat options into flatten list.
28
+ * We use `optionOnly` here is aim to avoid user use nested option group.
29
+ * Here is simply set `key` to the index if not provided.
30
+ */
31
+ export function flattenOptions(options, { fieldNames, childrenAsData } = {}) {
32
+ const flattenList = [];
33
+ const { label: fieldLabel, value: fieldValue, options: fieldOptions, groupLabel } = fillFieldNames(fieldNames, false);
34
+ function dig(list, isGroupOption) {
35
+ list.forEach((data) => {
36
+ if (isGroupOption || !(fieldOptions in data)) {
37
+ const value = data[fieldValue];
38
+ // Option
39
+ flattenList.push({
40
+ key: getKey(data, flattenList.length),
41
+ groupOption: isGroupOption,
42
+ data,
43
+ label: data[fieldLabel],
44
+ value,
45
+ });
46
+ }
47
+ else {
48
+ let grpLabel = data[groupLabel];
49
+ if (grpLabel === undefined && childrenAsData) {
50
+ grpLabel = data.label;
51
+ }
52
+ // Option Group
53
+ flattenList.push({
54
+ key: getKey(data, flattenList.length),
55
+ group: true,
56
+ data,
57
+ label: grpLabel,
58
+ });
59
+ dig(data[fieldOptions], true);
60
+ }
61
+ });
62
+ }
63
+ dig(options, false);
64
+ return flattenList;
65
+ }
66
+ /**
67
+ * Inject `props` into `option` for legacy usage
68
+ */
69
+ export function injectPropsWithOption(option) {
70
+ const newOption = Object.assign({}, option);
71
+ if (!('props' in newOption)) {
72
+ Object.defineProperty(newOption, 'props', {
73
+ get() {
74
+ warning(false, 'Return type is option instead of Option instance. Please read value directly instead of reading from `props`.');
75
+ return newOption;
76
+ },
77
+ });
78
+ }
79
+ return newOption;
80
+ }
81
+ export function getSeparatedContent(text, tokens) {
82
+ if (!tokens || !tokens.length) {
83
+ return null;
84
+ }
85
+ let match = false;
86
+ function separate(str, [token, ...restTokens]) {
87
+ if (!token) {
88
+ return [str];
89
+ }
90
+ const list = str.split(token);
91
+ match = match || list.length > 1;
92
+ return list
93
+ .reduce((prevList, unitStr) => [...prevList, ...separate(unitStr, restTokens)], [])
94
+ .filter((unit) => unit);
95
+ }
96
+ const list = separate(text, tokens);
97
+ return match ? list : null;
98
+ }
99
+ //# sourceMappingURL=valueUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valueUtil.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/utils/valueUtil.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAI1C,SAAS,MAAM,CAAC,IAAoB,EAAE,KAAa;IACjD,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IACrB,IAAI,KAAmB,CAAC;IAExB,IAAI,OAAO,IAAI,IAAI,EAAE;QACnB,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;KACpB;IAED,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE;QACrC,OAAO,GAAG,CAAC;KACZ;IACD,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,OAAO,KAAK,CAAC;KACd;IACD,OAAO,gBAAgB,KAAK,EAAE,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,UAAkC,EAAE,cAAuB;IACxF,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,UAAU,IAAI,EAAE,CAAC;IAC/D,MAAM,WAAW,GAAG,KAAK,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAErE,OAAO;QACL,KAAK,EAAE,WAAW;QAClB,KAAK,EAAE,K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IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpC,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7B,CAAC","sourcesContent":["import type { BaseOptionType, DefaultOptionType } from '../Select';\nimport warning from 'rc-util/lib/warning';\nimport type { RawValueType, FieldNames } from '../Select';\nimport type { FlattenOptionData } from '../interface';\n\nfunction getKey(data: BaseOptionType, index: number) {\n const { key } = data;\n let value: RawValueType;\n\n if ('value' in data) {\n ({ value } = data);\n }\n\n if (key !== null && key !== undefined) {\n return key;\n }\n if (value !== undefined) {\n return value;\n }\n return `rc-index-key-${index}`;\n}\n\nexport function fillFieldNames(fieldNames: FieldNames | undefined, childrenAsData: boolean) {\n const { label, value, options, groupLabel } = fieldNames || {};\n const mergedLabel = label || (childrenAsData ? 'children' : 'label');\n\n return {\n label: mergedLabel,\n value: value || 'value',\n options: options || 'options',\n groupLabel: groupLabel || mergedLabel,\n };\n}\n\n/**\n * Flat options into flatten list.\n * We use `optionOnly` here is aim to avoid user use nested option group.\n * Here is simply set `key` to the index if not provided.\n */\nexport function flattenOptions<OptionType extends BaseOptionType = DefaultOptionType>(\n options: OptionType[],\n { fieldNames, childrenAsData }: { fieldNames?: FieldNames; childrenAsData?: boolean } = {},\n): FlattenOptionData<OptionType>[] {\n const flattenList: FlattenOptionData<OptionType>[] = [];\n\n const {\n label: fieldLabel,\n value: fieldValue,\n options: fieldOptions,\n groupLabel\n } = fillFieldNames(fieldNames, false);\n\n function dig(list: OptionType[], isGroupOption: boolean) {\n list.forEach((data) => {\n if (isGroupOption || !(fieldOptions in data)) {\n const value = data[fieldValue];\n\n // Option\n flattenList.push({\n key: getKey(data, flattenList.length),\n groupOption: isGroupOption,\n data,\n label: data[fieldLabel],\n value,\n });\n } else {\n let grpLabel = data[groupLabel];\n if (grpLabel === undefined && childrenAsData) {\n grpLabel = data.label;\n }\n\n // Option Group\n flattenList.push({\n key: getKey(data, flattenList.length),\n group: true,\n data,\n label: grpLabel,\n });\n\n dig(data[fieldOptions], true);\n }\n });\n }\n\n dig(options, false);\n\n return flattenList;\n}\n\n/**\n * Inject `props` into `option` for legacy usage\n */\nexport function injectPropsWithOption<T extends object>(option: T): T {\n const newOption = { ...option };\n if (!('props' in newOption)) {\n Object.defineProperty(newOption, 'props', {\n get() {\n warning(\n false,\n 'Return type is option instead of Option instance. Please read value directly instead of reading from `props`.',\n );\n return newOption;\n },\n });\n }\n\n return newOption;\n}\n\nexport function getSeparatedContent(text: string, tokens: string[]): string[] {\n if (!tokens || !tokens.length) {\n return null;\n }\n\n let match = false;\n\n function separate(str: string, [token, ...restTokens]: string[]) {\n if (!token) {\n return [str];\n }\n\n const list = str.split(token);\n match = match || list.length > 1;\n\n return list\n .reduce((prevList, unitStr) => [...prevList, ...separate(unitStr, restTokens)], [])\n .filter((unit) => unit);\n }\n\n const list = separate(text, tokens);\n return match ? list : null;\n}\n"]}