@chaoswise/ui 3.1.6 → 3.1.8

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 (357) hide show
  1. package/lib/Antd5/_util/PurePanel.js +9 -1
  2. package/lib/Antd5/_util/convertToTooltipProps.js +15 -0
  3. package/lib/Antd5/_util/extendsObject.js +14 -23
  4. package/lib/Antd5/_util/hooks/useClosable.js +25 -31
  5. package/lib/Antd5/_util/hooks/useMergeSemantic/index.js +89 -0
  6. package/lib/Antd5/_util/hooks/useMergeSemantic/interface.js +1 -0
  7. package/lib/Antd5/_util/isPrimitive.js +5 -0
  8. package/lib/Antd5/_util/mediaQueryUtil.js +16 -0
  9. package/lib/Antd5/_util/responsiveObserver.js +41 -33
  10. package/lib/Antd5/_util/toList.js +6 -3
  11. package/lib/Antd5/_util/warning.js +0 -1
  12. package/lib/Antd5/_util/wave/WaveEffect.js +29 -16
  13. package/lib/Antd5/_util/wave/index.js +2 -2
  14. package/lib/Antd5/_util/wave/useWave.js +1 -1
  15. package/lib/Antd5/affix/index.js +13 -11
  16. package/lib/Antd5/alert/Alert.js +19 -18
  17. package/lib/Antd5/anchor/Anchor.js +9 -7
  18. package/lib/Antd5/anchor/AnchorLink.js +16 -3
  19. package/lib/Antd5/app/App.js +90 -0
  20. package/lib/Antd5/app/index.js +3 -92
  21. package/lib/Antd5/app/useApp.js +6 -0
  22. package/lib/Antd5/auto-complete/AutoComplete.js +142 -0
  23. package/lib/Antd5/auto-complete/index.js +8 -106
  24. package/lib/Antd5/avatar/{avatar.js → Avatar.js} +25 -29
  25. package/lib/Antd5/avatar/{group.js → AvatarGroup.js} +14 -9
  26. package/lib/Antd5/avatar/index.js +3 -4
  27. package/lib/Antd5/breadcrumb/Breadcrumb.js +1 -0
  28. package/lib/Antd5/breadcrumb/style/index.js +1 -1
  29. package/lib/Antd5/button/{LoadingIcon.js → DefaultLoadingIcon.js} +12 -9
  30. package/lib/Antd5/button/button-group.js +11 -11
  31. package/lib/Antd5/button/button.js +60 -26
  32. package/lib/Antd5/button/buttonHelpers.js +8 -1
  33. package/lib/Antd5/button/style/compact.js +9 -10
  34. package/lib/Antd5/button/style/index.js +127 -41
  35. package/lib/Antd5/button/style/token.js +19 -8
  36. package/lib/Antd5/calendar/Header.js +4 -4
  37. package/lib/Antd5/calendar/generateCalendar.js +17 -12
  38. package/lib/Antd5/calendar/style/index.js +8 -2
  39. package/lib/Antd5/card/Card.js +9 -5
  40. package/lib/Antd5/card/style/index.js +22 -15
  41. package/lib/Antd5/carousel/index.js +21 -11
  42. package/lib/Antd5/carousel/style/index.js +39 -12
  43. package/lib/Antd5/cascader/index.js +54 -18
  44. package/lib/Antd5/cascader/style/columns.js +4 -2
  45. package/lib/Antd5/cascader/style/index.js +2 -1
  46. package/lib/Antd5/collapse/Collapse.js +32 -25
  47. package/lib/Antd5/collapse/style/index.js +14 -10
  48. package/lib/Antd5/color-picker/ColorPicker.js +13 -8
  49. package/lib/Antd5/color-picker/components/ColorAlphaInput.js +8 -13
  50. package/lib/Antd5/color-picker/components/ColorHexInput.js +1 -1
  51. package/lib/Antd5/color-picker/components/ColorHsbInput.js +8 -13
  52. package/lib/Antd5/color-picker/components/ColorInput.js +7 -7
  53. package/lib/Antd5/color-picker/components/ColorPresets.js +15 -12
  54. package/lib/Antd5/color-picker/components/ColorRgbInput.js +8 -13
  55. package/lib/Antd5/color-picker/components/ColorSteppers.js +6 -13
  56. package/lib/Antd5/color-picker/interface.js +3 -6
  57. package/lib/Antd5/color-picker/style/color-block.js +2 -1
  58. package/lib/Antd5/config-provider/MotionWrapper.js +12 -4
  59. package/lib/Antd5/config-provider/UnstableContext.js +29 -0
  60. package/lib/Antd5/config-provider/context.js +32 -2
  61. package/lib/Antd5/config-provider/cssVariables.js +7 -7
  62. package/lib/Antd5/config-provider/hooks/useSize.js +1 -1
  63. package/lib/Antd5/config-provider/index.js +12 -3
  64. package/lib/Antd5/date-picker/generatePicker/generateRangePicker.js +33 -12
  65. package/lib/Antd5/date-picker/generatePicker/generateSinglePicker.js +32 -13
  66. package/lib/Antd5/date-picker/hooks/useMergedPickerSemantic.js +47 -0
  67. package/lib/Antd5/date-picker/index.js +2 -2
  68. package/lib/Antd5/date-picker/locale/ar_EG.js +1 -8
  69. package/lib/Antd5/date-picker/locale/example.json +5 -8
  70. package/lib/Antd5/date-picker/locale/ko_KR.js +11 -1
  71. package/lib/Antd5/date-picker/locale/pl_PL.js +0 -3
  72. package/lib/Antd5/date-picker/locale/pt_PT.js +0 -3
  73. package/lib/Antd5/date-picker/locale/sl_SI.js +1 -3
  74. package/lib/Antd5/date-picker/style/index.js +9 -6
  75. package/lib/Antd5/date-picker/style/panel.js +12 -8
  76. package/lib/Antd5/date-picker/style/token.js +3 -3
  77. package/lib/Antd5/date-picker/style/variants.js +6 -2
  78. package/lib/Antd5/descriptions/Cell.js +14 -8
  79. package/lib/Antd5/descriptions/Item.js +2 -0
  80. package/lib/Antd5/descriptions/Row.js +10 -6
  81. package/lib/Antd5/descriptions/hooks/useRow.js +1 -1
  82. package/lib/Antd5/descriptions/index.js +45 -18
  83. package/lib/Antd5/descriptions/style/index.js +11 -2
  84. package/lib/Antd5/divider/index.js +32 -15
  85. package/lib/Antd5/divider/style/index.js +20 -7
  86. package/lib/Antd5/drawer/DrawerPanel.js +8 -10
  87. package/lib/Antd5/drawer/index.js +20 -17
  88. package/lib/Antd5/dropdown/dropdown-button.js +9 -3
  89. package/lib/Antd5/dropdown/dropdown.js +33 -35
  90. package/lib/Antd5/dropdown/style/index.js +1 -1
  91. package/lib/Antd5/empty/empty.js +2 -2
  92. package/lib/Antd5/empty/index.js +41 -23
  93. package/lib/Antd5/empty/simple.js +4 -4
  94. package/lib/Antd5/flex/style/index.js +2 -0
  95. package/lib/Antd5/float-button/FloatButton.js +12 -15
  96. package/lib/Antd5/float-button/FloatButtonContent.js +13 -7
  97. package/lib/Antd5/float-button/FloatButtonGroup.js +6 -6
  98. package/lib/Antd5/float-button/style/keyframes.js +4 -4
  99. package/lib/Antd5/form/ErrorList.js +1 -3
  100. package/lib/Antd5/form/Form.js +19 -19
  101. package/lib/Antd5/form/FormItem/index.js +1 -1
  102. package/lib/Antd5/form/FormItemLabel.js +12 -14
  103. package/lib/Antd5/form/context.js +3 -4
  104. package/lib/Antd5/form/hooks/useForm.js +16 -5
  105. package/lib/Antd5/form/hooks/useFormInstance.js +3 -3
  106. package/lib/Antd5/form/hooks/useFormItemStatus.js +7 -7
  107. package/lib/Antd5/form/hooks/useFormWarning.js +2 -2
  108. package/lib/Antd5/form/hooks/useFrameState.js +3 -4
  109. package/lib/Antd5/form/hooks/useItemRef.js +3 -2
  110. package/lib/Antd5/form/hooks/useVariants.js +5 -5
  111. package/lib/Antd5/form/style/index.js +22 -15
  112. package/lib/Antd5/grid/hooks/useBreakpoint.js +2 -1
  113. package/lib/Antd5/grid/hooks/useGutter.js +29 -0
  114. package/lib/Antd5/grid/row.js +8 -63
  115. package/lib/Antd5/grid/style/index.js +14 -8
  116. package/lib/Antd5/image/PreviewGroup.js +9 -2
  117. package/lib/Antd5/image/index.js +26 -17
  118. package/lib/Antd5/image/style/index.js +10 -10
  119. package/lib/Antd5/index.js +3 -1
  120. package/lib/Antd5/input/Group.js +5 -3
  121. package/lib/Antd5/input/Input.js +27 -20
  122. package/lib/Antd5/input/OTP/OTPInput.js +36 -19
  123. package/lib/Antd5/input/OTP/index.js +40 -19
  124. package/lib/Antd5/input/Password.js +7 -9
  125. package/lib/Antd5/input/Search.js +16 -9
  126. package/lib/Antd5/input/TextArea.js +90 -33
  127. package/lib/Antd5/input/style/index.js +31 -82
  128. package/lib/Antd5/input/style/otp.js +22 -6
  129. package/lib/Antd5/input/style/textarea.js +80 -0
  130. package/lib/Antd5/input/style/token.js +16 -7
  131. package/lib/Antd5/input/style/variants.js +67 -12
  132. package/lib/Antd5/input-number/index.js +1 -1
  133. package/lib/Antd5/input-number/style/index.js +10 -7
  134. package/lib/Antd5/input-number/style/token.js +6 -4
  135. package/lib/Antd5/layout/Sider.js +58 -68
  136. package/lib/Antd5/layout/layout.js +7 -5
  137. package/lib/Antd5/layout/style/sider.js +33 -42
  138. package/lib/Antd5/list/index.js +45 -45
  139. package/lib/Antd5/locale/ar_EG.js +7 -1
  140. package/lib/Antd5/locale/az_AZ.js +3 -2
  141. package/lib/Antd5/locale/bg_BG.js +8 -0
  142. package/lib/Antd5/locale/bn_BD.js +7 -1
  143. package/lib/Antd5/locale/by_BY.js +8 -2
  144. package/lib/Antd5/locale/ca_ES.js +7 -1
  145. package/lib/Antd5/locale/cs_CZ.js +19 -2
  146. package/lib/Antd5/locale/da_DK.js +8 -0
  147. package/lib/Antd5/locale/de_DE.js +4 -2
  148. package/lib/Antd5/locale/el_GR.js +3 -2
  149. package/lib/Antd5/locale/en_GB.js +8 -2
  150. package/lib/Antd5/locale/en_US.js +3 -2
  151. package/lib/Antd5/locale/es_ES.js +3 -2
  152. package/lib/Antd5/locale/et_EE.js +8 -2
  153. package/lib/Antd5/locale/eu_ES.js +3 -2
  154. package/lib/Antd5/locale/fa_IR.js +17 -7
  155. package/lib/Antd5/locale/fi_FI.js +8 -0
  156. package/lib/Antd5/locale/fr_BE.js +4 -1
  157. package/lib/Antd5/locale/fr_CA.js +9 -1
  158. package/lib/Antd5/locale/fr_FR.js +4 -1
  159. package/lib/Antd5/locale/ga_IE.js +7 -1
  160. package/lib/Antd5/locale/gl_ES.js +7 -1
  161. package/lib/Antd5/locale/he_IL.js +10 -1
  162. package/lib/Antd5/locale/hi_IN.js +7 -1
  163. package/lib/Antd5/locale/hr_HR.js +7 -1
  164. package/lib/Antd5/locale/hu_HU.js +8 -0
  165. package/lib/Antd5/locale/hy_AM.js +8 -3
  166. package/lib/Antd5/locale/id_ID.js +3 -2
  167. package/lib/Antd5/locale/is_IS.js +8 -0
  168. package/lib/Antd5/locale/it_IT.js +3 -2
  169. package/lib/Antd5/locale/ja_JP.js +3 -2
  170. package/lib/Antd5/locale/ka_GE.js +7 -1
  171. package/lib/Antd5/locale/kk_KZ.js +7 -1
  172. package/lib/Antd5/locale/km_KH.js +3 -0
  173. package/lib/Antd5/locale/kmr_IQ.js +8 -0
  174. package/lib/Antd5/locale/kn_IN.js +8 -2
  175. package/lib/Antd5/locale/ko_KR.js +3 -2
  176. package/lib/Antd5/locale/ku_IQ.js +8 -0
  177. package/lib/Antd5/locale/lt_LT.js +3 -2
  178. package/lib/Antd5/locale/lv_LV.js +8 -0
  179. package/lib/Antd5/locale/mk_MK.js +7 -1
  180. package/lib/Antd5/locale/ml_IN.js +7 -1
  181. package/lib/Antd5/locale/mn_MN.js +8 -2
  182. package/lib/Antd5/locale/ms_MY.js +3 -2
  183. package/lib/Antd5/locale/my_MM.js +3 -2
  184. package/lib/Antd5/locale/nb_NO.js +7 -1
  185. package/lib/Antd5/locale/ne_NP.js +3 -2
  186. package/lib/Antd5/locale/nl_BE.js +2 -1
  187. package/lib/Antd5/locale/nl_NL.js +2 -1
  188. package/lib/Antd5/locale/pl_PL.js +3 -2
  189. package/lib/Antd5/locale/pt_BR.js +3 -2
  190. package/lib/Antd5/locale/pt_PT.js +3 -2
  191. package/lib/Antd5/locale/ro_RO.js +7 -1
  192. package/lib/Antd5/locale/ru_RU.js +4 -3
  193. package/lib/Antd5/locale/si_LK.js +8 -2
  194. package/lib/Antd5/locale/sk_SK.js +8 -2
  195. package/lib/Antd5/locale/sl_SI.js +8 -0
  196. package/lib/Antd5/locale/sr_RS.js +7 -1
  197. package/lib/Antd5/locale/sv_SE.js +3 -2
  198. package/lib/Antd5/locale/ta_IN.js +8 -2
  199. package/lib/Antd5/locale/th_TH.js +3 -2
  200. package/lib/Antd5/locale/tk_TK.js +7 -1
  201. package/lib/Antd5/locale/tr_TR.js +8 -2
  202. package/lib/Antd5/locale/uk_UA.js +3 -2
  203. package/lib/Antd5/locale/ur_PK.js +7 -1
  204. package/lib/Antd5/locale/uz_UZ.js +5 -4
  205. package/lib/Antd5/locale/vi_VN.js +3 -2
  206. package/lib/Antd5/locale/zh_CN.js +3 -2
  207. package/lib/Antd5/locale/zh_HK.js +11 -3
  208. package/lib/Antd5/locale/zh_TW.js +11 -3
  209. package/lib/Antd5/mentions/index.js +1 -1
  210. package/lib/Antd5/mentions/style/index.js +12 -7
  211. package/lib/Antd5/menu/MenuItem.js +3 -1
  212. package/lib/Antd5/menu/OverrideContext.js +2 -2
  213. package/lib/Antd5/menu/menu.js +1 -7
  214. package/lib/Antd5/menu/style/index.js +9 -6
  215. package/lib/Antd5/menu/style/theme.js +4 -3
  216. package/lib/Antd5/menu/style/vertical.js +1 -1
  217. package/lib/Antd5/message/style/index.js +4 -3
  218. package/lib/Antd5/modal/ConfirmDialog.js +2 -19
  219. package/lib/Antd5/modal/Modal.js +67 -35
  220. package/lib/Antd5/modal/confirm.js +5 -3
  221. package/lib/Antd5/modal/style/confirm.js +3 -1
  222. package/lib/Antd5/modal/style/index.js +21 -1
  223. package/lib/Antd5/modal/useModal/HookModal.js +2 -1
  224. package/lib/Antd5/notification/PurePanel.js +13 -6
  225. package/lib/Antd5/notification/index.js +3 -4
  226. package/lib/Antd5/notification/style/index.js +4 -3
  227. package/lib/Antd5/notification/style/stack.js +2 -1
  228. package/lib/Antd5/notification/useNotification.js +9 -4
  229. package/lib/Antd5/notification/util.js +9 -0
  230. package/lib/Antd5/pagination/Pagination.js +87 -20
  231. package/lib/Antd5/pagination/style/index.js +2 -10
  232. package/lib/Antd5/pagination/useShowSizeChanger.js +13 -0
  233. package/lib/Antd5/popconfirm/index.js +21 -6
  234. package/lib/Antd5/popover/index.js +21 -8
  235. package/lib/Antd5/progress/Steps.js +6 -2
  236. package/lib/Antd5/progress/progress.js +2 -2
  237. package/lib/Antd5/progress/utils.js +3 -3
  238. package/lib/Antd5/qr-code/style/index.js +2 -2
  239. package/lib/Antd5/segmented/index.js +16 -8
  240. package/lib/Antd5/segmented/style/index.js +14 -6
  241. package/lib/Antd5/select/index.js +45 -16
  242. package/lib/Antd5/select/style/dropdown.js +10 -9
  243. package/lib/Antd5/select/style/index.js +14 -10
  244. package/lib/Antd5/select/style/single.js +6 -3
  245. package/lib/Antd5/select/style/variants.js +55 -1
  246. package/lib/Antd5/skeleton/Paragraph.js +5 -8
  247. package/lib/Antd5/skeleton/Skeleton.js +8 -7
  248. package/lib/Antd5/slider/SliderTooltip.js +3 -2
  249. package/lib/Antd5/slider/index.js +43 -17
  250. package/lib/Antd5/slider/style/index.js +3 -3
  251. package/lib/Antd5/slider/useRafLock.js +1 -1
  252. package/lib/Antd5/space/Compact.js +8 -6
  253. package/lib/Antd5/space/index.js +16 -12
  254. package/lib/Antd5/spin/index.js +11 -9
  255. package/lib/Antd5/spin/style/index.js +1 -3
  256. package/lib/Antd5/spin/usePercent.js +1 -1
  257. package/lib/Antd5/splitter/SplitBar.js +56 -7
  258. package/lib/Antd5/splitter/Splitter.js +27 -17
  259. package/lib/Antd5/splitter/hooks/useResizable.js +3 -3
  260. package/lib/Antd5/splitter/hooks/useResize.js +17 -6
  261. package/lib/Antd5/splitter/style/index.js +32 -6
  262. package/lib/Antd5/statistic/Countdown.js +8 -61
  263. package/lib/Antd5/statistic/Statistic.js +17 -9
  264. package/lib/Antd5/statistic/Timer.js +91 -0
  265. package/lib/Antd5/statistic/index.js +2 -0
  266. package/lib/Antd5/statistic/utils.js +2 -2
  267. package/lib/Antd5/steps/index.js +8 -7
  268. package/lib/Antd5/steps/style/index.js +1 -1
  269. package/lib/Antd5/style/index.js +9 -4
  270. package/lib/Antd5/switch/style/index.js +2 -2
  271. package/lib/Antd5/table/InternalTable.js +6 -5
  272. package/lib/Antd5/table/hooks/useFilter/FilterDropdown.js +15 -11
  273. package/lib/Antd5/table/hooks/useFilter/FilterSearch.js +1 -1
  274. package/lib/Antd5/table/hooks/useFilter/index.js +3 -2
  275. package/lib/Antd5/table/hooks/useSelection.js +11 -3
  276. package/lib/Antd5/table/hooks/useSorter.js +4 -3
  277. package/lib/Antd5/table/style/filter.js +2 -2
  278. package/lib/Antd5/table/style/index.js +9 -9
  279. package/lib/Antd5/table/style/sorter.js +2 -1
  280. package/lib/Antd5/table/style/sticky.js +1 -1
  281. package/lib/Antd5/tabs/hooks/useLegacyItems.js +11 -4
  282. package/lib/Antd5/tabs/index.js +9 -2
  283. package/lib/Antd5/tabs/style/index.js +44 -23
  284. package/lib/Antd5/tag/style/index.js +3 -3
  285. package/lib/Antd5/theme/context.js +1 -3
  286. package/lib/Antd5/theme/getDesignToken.js +2 -2
  287. package/lib/Antd5/theme/themes/dark/colorAlgorithm.js +3 -3
  288. package/lib/Antd5/theme/themes/dark/index.js +13 -3
  289. package/lib/Antd5/theme/themes/default/colorAlgorithm.js +3 -3
  290. package/lib/Antd5/theme/themes/default/index.js +5 -1
  291. package/lib/Antd5/theme/themes/default/theme.js +4 -0
  292. package/lib/Antd5/theme/themes/shared/genColorMapToken.js +3 -3
  293. package/lib/Antd5/theme/themes/shared/genFontSizes.js +3 -1
  294. package/lib/Antd5/theme/util/alias.js +2 -2
  295. package/lib/Antd5/theme/util/genStyleUtils.js +9 -11
  296. package/lib/Antd5/theme/util/getAlphaColor.js +12 -12
  297. package/lib/Antd5/theme/util/useResetIconStyle.js +2 -10
  298. package/lib/Antd5/time-picker/index.js +1 -1
  299. package/lib/Antd5/timeline/TimelineItemList.js +1 -1
  300. package/lib/Antd5/tooltip/index.js +46 -31
  301. package/lib/Antd5/tooltip/style/index.js +13 -4
  302. package/lib/Antd5/tour/index.js +4 -2
  303. package/lib/Antd5/tour/panelRender.js +42 -27
  304. package/lib/Antd5/tour/style/index.js +3 -3
  305. package/lib/Antd5/transfer/ListItem.js +1 -1
  306. package/lib/Antd5/transfer/hooks/useData.js +8 -4
  307. package/lib/Antd5/transfer/hooks/useSelection.js +5 -4
  308. package/lib/Antd5/transfer/index.js +6 -2
  309. package/lib/Antd5/transfer/list.js +32 -13
  310. package/lib/Antd5/transfer/search.js +1 -1
  311. package/lib/Antd5/transfer/style/index.js +3 -1
  312. package/lib/Antd5/tree/DirectoryTree.js +2 -2
  313. package/lib/Antd5/tree/style/index.js +9 -3
  314. package/lib/Antd5/tree-select/index.js +61 -18
  315. package/lib/Antd5/tree-select/style/index.js +1 -1
  316. package/lib/Antd5/typography/Base/Ellipsis.js +3 -3
  317. package/lib/Antd5/typography/Base/index.js +20 -13
  318. package/lib/Antd5/typography/Editable.js +1 -1
  319. package/lib/Antd5/typography/Typography.js +8 -7
  320. package/lib/Antd5/typography/hooks/useCopyClick.js +24 -25
  321. package/lib/Antd5/typography/hooks/usePrevious.js +1 -1
  322. package/lib/Antd5/typography/style/index.js +5 -5
  323. package/lib/Antd5/typography/style/mixins.js +1 -1
  324. package/lib/Antd5/upload/Upload.js +22 -24
  325. package/lib/Antd5/version/index.js +0 -1
  326. package/lib/Antd5/version/token-meta.json +1 -0
  327. package/lib/Antd5/version/token.json +1 -0
  328. package/lib/Antd5/version/version.js +1 -1
  329. package/lib/Antd5/watermark/context.js +1 -1
  330. package/lib/Antd5/watermark/index.js +20 -13
  331. package/lib/Antd5/watermark/useClips.js +18 -16
  332. package/lib/Antd5/watermark/useRafDebounce.js +1 -1
  333. package/lib/Antd5/watermark/useSingletonCache.js +19 -0
  334. package/lib/Antd5/watermark/useWatermark.js +9 -18
  335. package/lib/CWCascader/rc-cascader/OptionList/Column.js +17 -18
  336. package/lib/CWMessage/MessageContent/TabList/index.js +10 -10
  337. package/lib/CWMessage/MessageContent/index.js +26 -28
  338. package/lib/CWMessage/index.js +42 -46
  339. package/lib/CWRangePicker/index.js +15 -15
  340. package/lib/CWRangePicker/utils/generate/dayjs.js +112 -23
  341. package/lib/CWRangePicker/utils/generate/moment.js +109 -21
  342. package/lib/CWSelect/index.js +423 -150
  343. package/lib/CWTable/CWTable.js +11 -11
  344. package/lib/Joyride/index.js +3 -3
  345. package/lib/ModuleFederation/react-dynamic-remote-component/RemoteComponent.js +38 -39
  346. package/lib/ModuleFederation/react-dynamic-remote-component/load-module.js +22 -23
  347. package/lib/QuickTransfer/index.js +13 -13
  348. package/lib/SearchBar/index.js +7 -7
  349. package/lib/SingleSpa/index.js +22 -24
  350. package/lib/TimeRangeSlider/TimeRangeSliderCmp/hooks/useMouse.js +3 -3
  351. package/lib/TimeRangeSlider/index.js +6 -6
  352. package/lib/TimeRangeSlider/utils/generate/dayjs.js +109 -20
  353. package/lib/TimeRangeSlider/utils/generate/moment.js +109 -20
  354. package/lib/TimeZoneSelect/index.js +21 -22
  355. package/package.json +35 -34
  356. package/lib/Antd5/_util/isNumeric.js +0 -4
  357. package/lib/Antd5/pagination/Select.js +0 -24
@@ -1,18 +1,18 @@
1
- var _excluded = ["prefixCls", "shape", "size", "src", "srcSet", "icon", "className", "rootClassName", "alt", "draggable", "children", "crossOrigin"];
1
+ var _excluded = ["prefixCls", "shape", "size", "src", "srcSet", "icon", "className", "rootClassName", "style", "alt", "draggable", "children", "crossOrigin", "gap", "onError"];
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
8
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
9
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
10
8
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
11
9
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
10
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
11
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
12
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
15
13
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
14
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
15
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
16
16
  import { jsx as _jsx } from "react/jsx-runtime";
17
17
  import * as React from 'react';
18
18
  import classNames from 'classnames';
@@ -26,7 +26,24 @@ import useSize from '../config-provider/hooks/useSize';
26
26
  import useBreakpoint from '../grid/hooks/useBreakpoint';
27
27
  import AvatarContext from './AvatarContext';
28
28
  import useStyle from './style';
29
- var InternalAvatar = function InternalAvatar(props, ref) {
29
+ var Avatar = /*#__PURE__*/React.forwardRef(function (props, ref) {
30
+ var customizePrefixCls = props.prefixCls,
31
+ shape = props.shape,
32
+ customSize = props.size,
33
+ src = props.src,
34
+ srcSet = props.srcSet,
35
+ icon = props.icon,
36
+ className = props.className,
37
+ rootClassName = props.rootClassName,
38
+ style = props.style,
39
+ alt = props.alt,
40
+ draggable = props.draggable,
41
+ children = props.children,
42
+ crossOrigin = props.crossOrigin,
43
+ _props$gap = props.gap,
44
+ gap = _props$gap === void 0 ? 4 : _props$gap,
45
+ onError = props.onError,
46
+ others = _objectWithoutProperties(props, _excluded);
30
47
  var _React$useState = React.useState(1),
31
48
  _React$useState2 = _slicedToArray(_React$useState, 2),
32
49
  scale = _React$useState2[0],
@@ -54,8 +71,6 @@ var InternalAvatar = function InternalAvatar(props, ref) {
54
71
  var nodeWidth = avatarNodeRef.current.offsetWidth;
55
72
  // denominator is 0 is no meaning
56
73
  if (childrenWidth !== 0 && nodeWidth !== 0) {
57
- var _props$gap = props.gap,
58
- gap = _props$gap === void 0 ? 4 : _props$gap;
59
74
  if (gap * 2 < nodeWidth) {
60
75
  setScale(nodeWidth - gap * 2 < childrenWidth ? (nodeWidth - gap * 2) / childrenWidth : 1);
61
76
  }
@@ -67,28 +82,14 @@ var InternalAvatar = function InternalAvatar(props, ref) {
67
82
  React.useEffect(function () {
68
83
  setIsImgExist(true);
69
84
  setScale(1);
70
- }, [props.src]);
71
- React.useEffect(setScaleParam, [props.gap]);
85
+ }, [src]);
86
+ React.useEffect(setScaleParam, [gap]);
72
87
  var handleImgLoadError = function handleImgLoadError() {
73
- var onError = props.onError;
74
88
  var errorFlag = onError === null || onError === void 0 ? void 0 : onError();
75
89
  if (errorFlag !== false) {
76
90
  setIsImgExist(false);
77
91
  }
78
92
  };
79
- var customizePrefixCls = props.prefixCls,
80
- shape = props.shape,
81
- customSize = props.size,
82
- src = props.src,
83
- srcSet = props.srcSet,
84
- icon = props.icon,
85
- className = props.className,
86
- rootClassName = props.rootClassName,
87
- alt = props.alt,
88
- draggable = props.draggable,
89
- children = props.children,
90
- crossOrigin = props.crossOrigin,
91
- others = _objectWithoutProperties(props, _excluded);
92
93
  var size = useSize(function (ctxSize) {
93
94
  var _ref, _ref2;
94
95
  return (_ref = (_ref2 = customSize !== null && customSize !== void 0 ? customSize : avatarCtx === null || avatarCtx === void 0 ? void 0 : avatarCtx.size) !== null && _ref2 !== void 0 ? _ref2 : ctxSize) !== null && _ref !== void 0 ? _ref : 'default';
@@ -171,18 +172,13 @@ var InternalAvatar = function InternalAvatar(props, ref) {
171
172
  children: children
172
173
  });
173
174
  }
174
- // The event is triggered twice from bubbling up the DOM tree.
175
- // see https://codesandbox.io/s/kind-snow-9lidz
176
- delete others.onError;
177
- delete others.gap;
178
175
  return wrapCSSVar(_jsx("span", _objectSpread(_objectSpread({}, others), {}, {
179
- style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, sizeStyle), responsiveSizeStyle), avatar === null || avatar === void 0 ? void 0 : avatar.style), others.style),
176
+ style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, sizeStyle), responsiveSizeStyle), avatar === null || avatar === void 0 ? void 0 : avatar.style), style),
180
177
  className: classString,
181
178
  ref: avatarNodeMergedRef,
182
179
  children: childrenToRender
183
180
  })));
184
- };
185
- var Avatar = /*#__PURE__*/React.forwardRef(InternalAvatar);
181
+ });
186
182
  if (process.env.NODE_ENV !== 'production') {
187
183
  Avatar.displayName = 'Avatar';
188
184
  }
@@ -19,7 +19,7 @@ import { devUseWarning } from '../_util/warning';
19
19
  import { ConfigContext } from '../config-provider';
20
20
  import useCSSVarCls from '../config-provider/hooks/useCSSVarCls';
21
21
  import Popover from '../popover';
22
- import Avatar from './avatar';
22
+ import Avatar from './Avatar';
23
23
  import AvatarContext from './AvatarContext';
24
24
  import useStyle from './style';
25
25
  var AvatarContextProvider = function AvatarContextProvider(props) {
@@ -37,7 +37,7 @@ var AvatarContextProvider = function AvatarContextProvider(props) {
37
37
  children: props.children
38
38
  });
39
39
  };
40
- var Group = function Group(props) {
40
+ var AvatarGroup = function AvatarGroup(props) {
41
41
  var _React$useContext2 = React.useContext(ConfigContext),
42
42
  getPrefixCls = _React$useContext2.getPrefixCls,
43
43
  direction = _React$useContext2.direction;
@@ -55,10 +55,12 @@ var Group = function Group(props) {
55
55
  max = props.max;
56
56
  if (process.env.NODE_ENV !== 'production') {
57
57
  var warning = devUseWarning('Avatar.Group');
58
- warning.deprecated(!maxCount, 'maxCount', 'max={{ count: number }}');
59
- warning.deprecated(!maxStyle, 'maxStyle', 'max={{ style: CSSProperties }}');
60
- warning.deprecated(!maxPopoverPlacement, 'maxPopoverPlacement', 'max={{ popover: PopoverProps }}');
61
- warning.deprecated(!maxPopoverTrigger, 'maxPopoverTrigger', 'max={{ popover: PopoverProps }}');
58
+ [['maxCount', 'max={{ count: number }}'], ['maxStyle', 'max={{ style: CSSProperties }}'], ['maxPopoverPlacement', 'max={{ popover: PopoverProps }}'], ['maxPopoverTrigger', 'max={{ popover: PopoverProps }}']].forEach(function (_ref) {
59
+ var _ref2 = _slicedToArray(_ref, 2),
60
+ deprecatedName = _ref2[0],
61
+ newName = _ref2[1];
62
+ warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
63
+ });
62
64
  }
63
65
  var prefixCls = getPrefixCls('avatar', customizePrefixCls);
64
66
  var groupPrefixCls = "".concat(prefixCls, "-group");
@@ -71,6 +73,7 @@ var Group = function Group(props) {
71
73
  var cls = classNames(groupPrefixCls, _defineProperty({}, "".concat(groupPrefixCls, "-rtl"), direction === 'rtl'), cssVarCls, rootCls, className, rootClassName, hashId);
72
74
  var childrenWithProps = toArray(children).map(function (child, index) {
73
75
  return cloneElement(child, {
76
+ // eslint-disable-next-line react/no-array-index-key
74
77
  key: "avatar-key-".concat(index)
75
78
  });
76
79
  });
@@ -86,12 +89,14 @@ var Group = function Group(props) {
86
89
  var mergeProps = _objectSpread(_objectSpread({
87
90
  content: childrenHidden
88
91
  }, max === null || max === void 0 ? void 0 : max.popover), {}, {
89
- overlayClassName: classNames("".concat(groupPrefixCls, "-popover"), max === null || max === void 0 || (_max$popover3 = max.popover) === null || _max$popover3 === void 0 ? void 0 : _max$popover3.overlayClassName),
92
+ classNames: {
93
+ root: classNames("".concat(groupPrefixCls, "-popover"), max === null || max === void 0 || (_max$popover3 = max.popover) === null || _max$popover3 === void 0 || (_max$popover3 = _max$popover3.classNames) === null || _max$popover3 === void 0 ? void 0 : _max$popover3.root)
94
+ },
90
95
  placement: mergePopoverPlacement,
91
96
  trigger: mergePopoverTrigger
92
97
  });
93
98
  childrenShow.push(_jsx(Popover, _objectSpread(_objectSpread({
94
- destroyTooltipOnHide: true
99
+ destroyOnHidden: true
95
100
  }, mergeProps), {}, {
96
101
  children: _jsx(Avatar, {
97
102
  style: mergeStyle,
@@ -118,4 +123,4 @@ var Group = function Group(props) {
118
123
  })
119
124
  }));
120
125
  };
121
- export default Group;
126
+ export default AvatarGroup;
@@ -1,6 +1,5 @@
1
- import InternalAvatar from './avatar';
2
- import Group from './group';
3
- export { Group };
1
+ import InternalAvatar from './Avatar';
2
+ import AvatarGroup from './AvatarGroup';
4
3
  var Avatar = InternalAvatar;
5
- Avatar.Group = Group;
4
+ Avatar.Group = AvatarGroup;
6
5
  export default Avatar;
@@ -134,6 +134,7 @@ var Breadcrumb = function Breadcrumb(props) {
134
134
  var isLastItem = index === childrenLength - 1;
135
135
  return cloneElement(element, {
136
136
  separator: isLastItem ? '' : separator,
137
+ // eslint-disable-next-line react/no-array-index-key
137
138
  key: index
138
139
  });
139
140
  });
@@ -34,7 +34,7 @@ var genBreadcrumbStyle = function genBreadcrumbStyle(token) {
34
34
  color: token.linkHoverColor,
35
35
  backgroundColor: token.colorBgTextHover
36
36
  }
37
- }, genFocusStyle(token))), "li:last-child", {
37
+ }, genFocusStyle(token))), 'li:last-child', {
38
38
  color: token.lastItemColor
39
39
  }), "".concat(componentCls, "-separator"), {
40
40
  marginInline: token.separatorMargin,
@@ -40,12 +40,13 @@ var getRealWidth = function getRealWidth(node) {
40
40
  transform: 'scale(1)'
41
41
  };
42
42
  };
43
- var LoadingIcon = function LoadingIcon(props) {
43
+ var DefaultLoadingIcon = function DefaultLoadingIcon(props) {
44
44
  var prefixCls = props.prefixCls,
45
45
  loading = props.loading,
46
46
  existIcon = props.existIcon,
47
47
  className = props.className,
48
- style = props.style;
48
+ style = props.style,
49
+ mount = props.mount;
49
50
  var visible = !!loading;
50
51
  if (existIcon) {
51
52
  return _jsx(InnerLoadingIcon, {
@@ -56,9 +57,11 @@ var LoadingIcon = function LoadingIcon(props) {
56
57
  }
57
58
  return _jsx(CSSMotion, {
58
59
  visible: visible,
59
- // We do not really use this motionName
60
+ // Used for minus flex gap style only
60
61
  motionName: "".concat(prefixCls, "-loading-icon-motion"),
61
- motionLeave: visible,
62
+ motionAppear: !mount,
63
+ motionEnter: !mount,
64
+ motionLeave: !mount,
62
65
  removeOnLeave: true,
63
66
  onAppearStart: getCollapsedWidth,
64
67
  onAppearActive: getRealWidth,
@@ -69,14 +72,14 @@ var LoadingIcon = function LoadingIcon(props) {
69
72
  children: function children(_ref, ref) {
70
73
  var motionCls = _ref.className,
71
74
  motionStyle = _ref.style;
75
+ var mergedStyle = _objectSpread(_objectSpread({}, style), motionStyle);
72
76
  return _jsx(InnerLoadingIcon, {
73
77
  prefixCls: prefixCls,
74
- className: className,
75
- style: _objectSpread(_objectSpread({}, style), motionStyle),
76
- ref: ref,
77
- iconClassName: motionCls
78
+ className: classNames(className, motionCls),
79
+ style: mergedStyle,
80
+ ref: ref
78
81
  });
79
82
  }
80
83
  });
81
84
  };
82
- export default LoadingIcon;
85
+ export default DefaultLoadingIcon;
@@ -32,19 +32,19 @@ var ButtonGroup = function ButtonGroup(props) {
32
32
  var _useToken = useToken(),
33
33
  _useToken2 = _slicedToArray(_useToken, 3),
34
34
  hashId = _useToken2[2];
35
- var sizeCls = '';
36
- switch (size) {
37
- case 'large':
38
- sizeCls = 'lg';
39
- break;
40
- case 'small':
41
- sizeCls = 'sm';
42
- break;
43
- default:
44
- // Do nothing
45
- }
35
+ var sizeCls = React.useMemo(function () {
36
+ switch (size) {
37
+ case 'large':
38
+ return 'lg';
39
+ case 'small':
40
+ return 'sm';
41
+ default:
42
+ return '';
43
+ }
44
+ }, [size]);
46
45
  if (process.env.NODE_ENV !== 'production') {
47
46
  var warning = devUseWarning('Button.Group');
47
+ warning.deprecated(false, 'Button.Group', 'Space.Compact');
48
48
  warning(!size || ['large', 'small', 'middle'].includes(size), 'usage', 'Invalid prop `size`.');
49
49
  }
50
50
  var classes = classNames(prefixCls, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-").concat(sizeCls), sizeCls), "".concat(prefixCls, "-rtl"), direction === 'rtl'), className, hashId);
@@ -14,20 +14,20 @@ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i
14
14
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
15
15
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
16
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
- import React, { Children, useContext, useEffect, useMemo, useRef, useState } from 'react';
17
+ import React, { Children, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
18
18
  import classNames from 'classnames';
19
19
  import omit from 'rc-util/lib/omit';
20
20
  import { useComposeRef } from 'rc-util/lib/ref';
21
21
  import { devUseWarning } from '../_util/warning';
22
22
  import Wave from '../_util/wave';
23
- import { ConfigContext } from '../config-provider';
23
+ import { ConfigContext, useComponentConfig } from '../config-provider/context';
24
24
  import DisabledContext from '../config-provider/DisabledContext';
25
25
  import useSize from '../config-provider/hooks/useSize';
26
26
  import { useCompactItemContext } from '../space/Compact';
27
27
  import Group, { GroupSizeContext } from './button-group';
28
28
  import { isTwoCNChar, isUnBorderedButtonVariant, spaceChildren } from './buttonHelpers';
29
+ import DefaultLoadingIcon from './DefaultLoadingIcon';
29
30
  import IconWrapper from './IconWrapper';
30
- import LoadingIcon from './LoadingIcon';
31
31
  import useStyle from './style';
32
32
  import Compact from './style/compact';
33
33
  function getLoadingConfig(loading) {
@@ -48,11 +48,12 @@ var ButtonTypeMap = {
48
48
  "default": ['default', 'outlined'],
49
49
  primary: ['primary', 'solid'],
50
50
  dashed: ['default', 'dashed'],
51
- link: ['primary', 'link'],
51
+ // `link` is not a real color but we should compatible with it
52
+ link: ['link', 'link'],
52
53
  text: ['default', 'text']
53
54
  };
54
55
  var InternalCompoundedButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
55
- var _ref, _sizeClassNameMap$siz, _classNames, _button$classNames, _button$styles;
56
+ var _ref, _sizeClassNameMap$siz, _classNames;
56
57
  var _props$loading = props.loading,
57
58
  loading = _props$loading === void 0 ? false : _props$loading,
58
59
  customizePrefixCls = props.prefixCls,
@@ -87,26 +88,42 @@ var InternalCompoundedButton = /*#__PURE__*/React.forwardRef(function (props, re
87
88
  // https://github.com/ant-design/ant-design/issues/47605
88
89
  // Compatible with original `type` behavior
89
90
  var mergedType = type || 'default';
91
+ var _React$useContext = React.useContext(ConfigContext),
92
+ button = _React$useContext.button;
90
93
  var _useMemo = useMemo(function () {
94
+ // >>>>> Local
95
+ // Color & Variant
91
96
  if (color && variant) {
92
97
  return [color, variant];
93
98
  }
94
- var colorVariantPair = ButtonTypeMap[mergedType] || [];
95
- if (danger) {
96
- return ['danger', colorVariantPair[1]];
99
+ // Sugar syntax
100
+ if (type || danger) {
101
+ var colorVariantPair = ButtonTypeMap[mergedType] || [];
102
+ if (danger) {
103
+ return ['danger', colorVariantPair[1]];
104
+ }
105
+ return colorVariantPair;
97
106
  }
98
- return colorVariantPair;
99
- }, [type, color, variant, danger]),
107
+ // >>> Context fallback
108
+ if (button !== null && button !== void 0 && button.color && button !== null && button !== void 0 && button.variant) {
109
+ return [button.color, button.variant];
110
+ }
111
+ return ['default', 'outlined'];
112
+ }, [type, color, variant, danger, button === null || button === void 0 ? void 0 : button.variant, button === null || button === void 0 ? void 0 : button.color]),
100
113
  _useMemo2 = _slicedToArray(_useMemo, 2),
101
114
  mergedColor = _useMemo2[0],
102
115
  mergedVariant = _useMemo2[1];
103
116
  var isDanger = mergedColor === 'danger';
104
117
  var mergedColorText = isDanger ? 'dangerous' : mergedColor;
105
- var _useContext = useContext(ConfigContext),
106
- getPrefixCls = _useContext.getPrefixCls,
107
- direction = _useContext.direction,
108
- button = _useContext.button;
109
- var mergedInsertSpace = (_ref = autoInsertSpace !== null && autoInsertSpace !== void 0 ? autoInsertSpace : button === null || button === void 0 ? void 0 : button.autoInsertSpace) !== null && _ref !== void 0 ? _ref : true;
118
+ var _useComponentConfig = useComponentConfig('button'),
119
+ getPrefixCls = _useComponentConfig.getPrefixCls,
120
+ direction = _useComponentConfig.direction,
121
+ contextAutoInsertSpace = _useComponentConfig.autoInsertSpace,
122
+ contextClassName = _useComponentConfig.className,
123
+ contextStyle = _useComponentConfig.style,
124
+ contextClassNames = _useComponentConfig.classNames,
125
+ contextStyles = _useComponentConfig.styles;
126
+ var mergedInsertSpace = (_ref = autoInsertSpace !== null && autoInsertSpace !== void 0 ? autoInsertSpace : contextAutoInsertSpace) !== null && _ref !== void 0 ? _ref : true;
110
127
  var prefixCls = getPrefixCls('btn', customizePrefixCls);
111
128
  var _useStyle = useStyle(prefixCls),
112
129
  _useStyle2 = _slicedToArray(_useStyle, 3),
@@ -127,12 +144,23 @@ var InternalCompoundedButton = /*#__PURE__*/React.forwardRef(function (props, re
127
144
  _useState4 = _slicedToArray(_useState3, 2),
128
145
  hasTwoCNChar = _useState4[0],
129
146
  setHasTwoCNChar = _useState4[1];
130
- var buttonRef = useRef();
147
+ var buttonRef = useRef(null);
131
148
  var mergedRef = useComposeRef(ref, buttonRef);
132
149
  var needInserted = Children.count(children) === 1 && !icon && !isUnBorderedButtonVariant(mergedVariant);
150
+ // ========================= Mount ==========================
151
+ // Record for mount status.
152
+ // This will help to no to show the animation of loading on the first mount.
153
+ var isMountRef = useRef(true);
154
+ React.useEffect(function () {
155
+ isMountRef.current = false;
156
+ return function () {
157
+ isMountRef.current = true;
158
+ };
159
+ }, []);
133
160
  // ========================= Effect =========================
134
- // Loading
135
- useEffect(function () {
161
+ // Loading. Should use `useLayoutEffect` to avoid low perf multiple click issue.
162
+ // https://github.com/ant-design/ant-design/issues/51325
163
+ useLayoutEffect(function () {
136
164
  var delayTimer = null;
137
165
  if (loadingOrDelay.delay > 0) {
138
166
  delayTimer = setTimeout(function () {
@@ -149,7 +177,7 @@ var InternalCompoundedButton = /*#__PURE__*/React.forwardRef(function (props, re
149
177
  }
150
178
  }
151
179
  return cleanupTimer;
152
- }, [loadingOrDelay]);
180
+ }, [loadingOrDelay.delay, loadingOrDelay.loading]);
153
181
  // Two chinese characters check
154
182
  useEffect(function () {
155
183
  // FIXME: for HOC usage like <FormatMessage />
@@ -179,7 +207,7 @@ var InternalCompoundedButton = /*#__PURE__*/React.forwardRef(function (props, re
179
207
  e.preventDefault();
180
208
  return;
181
209
  }
182
- (_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, e);
210
+ (_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, 'href' in props ? e : e);
183
211
  }, [props.onClick, innerLoading, mergedDisabled]);
184
212
  // ========================== Warn ==========================
185
213
  if (process.env.NODE_ENV !== 'production') {
@@ -204,19 +232,25 @@ var InternalCompoundedButton = /*#__PURE__*/React.forwardRef(function (props, re
204
232
  var iconType = innerLoading ? 'loading' : icon;
205
233
  var linkButtonRestProps = omit(rest, ['navigate']);
206
234
  // ========================= Render =========================
207
- var classes = classNames(prefixCls, hashId, cssVarCls, (_classNames = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_classNames, "".concat(prefixCls, "-").concat(shape), shape !== 'default' && shape), "".concat(prefixCls, "-").concat(mergedType), mergedType), "".concat(prefixCls, "-dangerous"), danger), "".concat(prefixCls, "-color-").concat(mergedColorText), mergedColorText), "".concat(prefixCls, "-variant-").concat(mergedVariant), mergedVariant), "".concat(prefixCls, "-").concat(sizeCls), sizeCls), "".concat(prefixCls, "-icon-only"), !children && children !== 0 && !!iconType), "".concat(prefixCls, "-background-ghost"), ghost && !isUnBorderedButtonVariant(mergedVariant)), "".concat(prefixCls, "-loading"), innerLoading), "".concat(prefixCls, "-two-chinese-chars"), hasTwoCNChar && mergedInsertSpace && !innerLoading), _defineProperty(_defineProperty(_defineProperty(_classNames, "".concat(prefixCls, "-block"), block), "".concat(prefixCls, "-rtl"), direction === 'rtl'), "".concat(prefixCls, "-icon-end"), iconPosition === 'end')), compactItemClassnames, className, rootClassName, button === null || button === void 0 ? void 0 : button.className);
208
- var fullStyle = _objectSpread(_objectSpread({}, button === null || button === void 0 ? void 0 : button.style), customStyle);
209
- var iconClasses = classNames(customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames.icon, button === null || button === void 0 || (_button$classNames = button.classNames) === null || _button$classNames === void 0 ? void 0 : _button$classNames.icon);
210
- var iconStyle = _objectSpread(_objectSpread({}, (styles === null || styles === void 0 ? void 0 : styles.icon) || {}), (button === null || button === void 0 || (_button$styles = button.styles) === null || _button$styles === void 0 ? void 0 : _button$styles.icon) || {});
235
+ var classes = classNames(prefixCls, hashId, cssVarCls, (_classNames = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_classNames, "".concat(prefixCls, "-").concat(shape), shape !== 'default' && shape), "".concat(prefixCls, "-").concat(mergedType), mergedType), "".concat(prefixCls, "-dangerous"), danger), "".concat(prefixCls, "-color-").concat(mergedColorText), mergedColorText), "".concat(prefixCls, "-variant-").concat(mergedVariant), mergedVariant), "".concat(prefixCls, "-").concat(sizeCls), sizeCls), "".concat(prefixCls, "-icon-only"), !children && children !== 0 && !!iconType), "".concat(prefixCls, "-background-ghost"), ghost && !isUnBorderedButtonVariant(mergedVariant)), "".concat(prefixCls, "-loading"), innerLoading), "".concat(prefixCls, "-two-chinese-chars"), hasTwoCNChar && mergedInsertSpace && !innerLoading), _defineProperty(_defineProperty(_defineProperty(_classNames, "".concat(prefixCls, "-block"), block), "".concat(prefixCls, "-rtl"), direction === 'rtl'), "".concat(prefixCls, "-icon-end"), iconPosition === 'end')), compactItemClassnames, className, rootClassName, contextClassName);
236
+ var fullStyle = _objectSpread(_objectSpread({}, contextStyle), customStyle);
237
+ var iconClasses = classNames(customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames.icon, contextClassNames.icon);
238
+ var iconStyle = _objectSpread(_objectSpread({}, (styles === null || styles === void 0 ? void 0 : styles.icon) || {}), contextStyles.icon || {});
211
239
  var iconNode = icon && !innerLoading ? _jsx(IconWrapper, {
212
240
  prefixCls: prefixCls,
213
241
  className: iconClasses,
214
242
  style: iconStyle,
215
243
  children: icon
216
- }) : _jsx(LoadingIcon, {
244
+ }) : loading && _typeof(loading) === 'object' && loading.icon ? _jsx(IconWrapper, {
245
+ prefixCls: prefixCls,
246
+ className: iconClasses,
247
+ style: iconStyle,
248
+ children: loading.icon
249
+ }) : _jsx(DefaultLoadingIcon, {
217
250
  existIcon: !!icon,
218
251
  prefixCls: prefixCls,
219
- loading: innerLoading
252
+ loading: innerLoading,
253
+ mount: isMountRef.current
220
254
  });
221
255
  var kids = children || children === 0 ? spaceChildren(children, needInserted && mergedInsertSpace) : null;
222
256
  if (linkButtonRestProps.href !== undefined) {
@@ -1,7 +1,14 @@
1
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
5
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
6
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1
7
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
8
  import { jsx as _jsx } from "react/jsx-runtime";
3
9
  import React from 'react';
4
10
  import { cloneElement, isFragment } from '../_util/reactNode';
11
+ import { PresetColors } from '../theme/interface';
5
12
  var rxTwoCNChar = /^[\u4E00-\u9FA5]{2}$/;
6
13
  export var isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar);
7
14
  export function convertLegacyProps(type) {
@@ -67,4 +74,4 @@ var _ButtonTypes = ['default', 'primary', 'dashed', 'link', 'text'];
67
74
  var _ButtonShapes = ['default', 'circle', 'round'];
68
75
  var _ButtonHTMLTypes = ['submit', 'button', 'reset'];
69
76
  export var _ButtonVariantTypes = ['outlined', 'dashed', 'solid', 'filled', 'text', 'link'];
70
- export var _ButtonColorTypes = ['default', 'primary', 'danger'];
77
+ export var _ButtonColorTypes = ['default', 'primary', 'danger'].concat(_toConsumableArray(PresetColors));
@@ -15,16 +15,15 @@ var genButtonCompactStyle = function genButtonCompactStyle(token) {
15
15
  calc = token.calc;
16
16
  var insetOffset = calc(lineWidth).mul(-1).equal();
17
17
  var getCompactBorderStyle = function getCompactBorderStyle(vertical) {
18
- return _defineProperty({}, "".concat(componentCls, "-compact").concat(vertical ? '-vertical' : '', "-item").concat(componentCls, "-primary:not([disabled])"), {
19
- '& + &::before': {
20
- position: 'absolute',
21
- top: vertical ? insetOffset : 0,
22
- insetInlineStart: vertical ? 0 : insetOffset,
23
- backgroundColor: colorPrimaryHover,
24
- content: '""',
25
- width: vertical ? '100%' : lineWidth,
26
- height: vertical ? lineWidth : '100%'
27
- }
18
+ var selector = "".concat(componentCls, "-compact").concat(vertical ? '-vertical' : '', "-item").concat(componentCls, "-primary:not([disabled])");
19
+ return _defineProperty({}, "".concat(selector, " + ").concat(selector, "::before"), {
20
+ position: 'absolute',
21
+ top: vertical ? insetOffset : 0,
22
+ insetInlineStart: vertical ? 0 : insetOffset,
23
+ backgroundColor: colorPrimaryHover,
24
+ content: '""',
25
+ width: vertical ? '100%' : lineWidth,
26
+ height: vertical ? lineWidth : '100%'
28
27
  });
29
28
  };
30
29
  // Special styles for Primary Button