tdesign-react 0.37.2-alpha.2 → 0.37.2-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. package/dist/tdesign.css +23 -0
  2. package/dist/tdesign.css.map +1 -1
  3. package/dist/tdesign.js +277 -41
  4. package/dist/tdesign.js.map +1 -1
  5. package/dist/tdesign.min.css +1 -1
  6. package/dist/tdesign.min.css.map +1 -1
  7. package/dist/tdesign.min.js +3 -3
  8. package/dist/tdesign.min.js.map +1 -1
  9. package/{esm/_chunks/dep-b0e383a7.js → es/_chunks/dep-4bc86630.js} +1 -1
  10. package/{esm/_chunks/dep-b0e383a7.js.map → es/_chunks/dep-4bc86630.js.map} +1 -1
  11. package/es/_chunks/{dep-890db007.js → dep-63330981.js} +1 -1
  12. package/es/_chunks/{dep-890db007.js.map → dep-63330981.js.map} +1 -1
  13. package/{esm/_chunks/dep-c6af222f.js → es/_chunks/dep-a7ee72fa.js} +1 -1
  14. package/es/_chunks/{dep-c6af222f.js.map → dep-a7ee72fa.js.map} +1 -1
  15. package/es/avatar/AvararGroup.js +1 -1
  16. package/es/avatar/Avatar.js +1 -1
  17. package/es/avatar/index.js +1 -1
  18. package/es/calendar/Calendar.js +1 -1
  19. package/es/calendar/index.js +1 -1
  20. package/es/cascader/Cascader.js +1 -1
  21. package/es/cascader/CascaderPanel.js +1 -1
  22. package/es/cascader/components/Item.js +1 -1
  23. package/es/cascader/components/Panel.js +1 -1
  24. package/es/cascader/index.js +1 -1
  25. package/es/checkbox/Checkbox.js +1 -1
  26. package/es/checkbox/CheckboxGroup.js +1 -1
  27. package/es/checkbox/index.js +1 -1
  28. package/es/color-picker/ColorPicker.js +1 -1
  29. package/es/color-picker/ColorPickerPanel.js +1 -1
  30. package/es/color-picker/components/panel/header.js +1 -1
  31. package/es/color-picker/components/panel/index.js +1 -1
  32. package/es/color-picker/components/panel/index.js.map +1 -1
  33. package/es/color-picker/index.js +1 -1
  34. package/es/date-picker/DatePicker.js +1 -0
  35. package/es/date-picker/DatePicker.js.map +1 -1
  36. package/es/date-picker/DatePickerPanel.js +1 -0
  37. package/es/date-picker/DatePickerPanel.js.map +1 -1
  38. package/es/date-picker/DateRangePicker.js +3 -2
  39. package/es/date-picker/DateRangePicker.js.map +1 -1
  40. package/es/date-picker/DateRangePickerPanel.js +1 -0
  41. package/es/date-picker/DateRangePickerPanel.js.map +1 -1
  42. package/es/date-picker/hooks/useFormat.js +28 -0
  43. package/es/date-picker/hooks/useFormat.js.map +1 -1
  44. package/es/date-picker/hooks/useRangeValue.d.ts +6 -1
  45. package/es/date-picker/hooks/useRangeValue.js +7 -9
  46. package/es/date-picker/hooks/useRangeValue.js.map +1 -1
  47. package/es/date-picker/hooks/useSingle.d.ts +6 -2
  48. package/es/date-picker/hooks/useSingleValue.d.ts +6 -2
  49. package/es/date-picker/hooks/useSingleValue.js.map +1 -1
  50. package/es/date-picker/hooks/useTableData.js +3 -1
  51. package/es/date-picker/hooks/useTableData.js.map +1 -1
  52. package/es/date-picker/panel/PanelContent.js +2 -1
  53. package/es/date-picker/panel/PanelContent.js.map +1 -1
  54. package/es/date-picker/type.d.ts +2 -2
  55. package/es/form/Form.js +1 -1
  56. package/es/form/FormItem.js +1 -1
  57. package/es/form/index.js +1 -1
  58. package/es/form/useInitialData.js +1 -1
  59. package/es/hooks/useControlled.d.ts +6 -1
  60. package/es/hooks/useControlled.js +2 -2
  61. package/es/hooks/useControlled.js.map +1 -1
  62. package/es/index.d.ts +1 -0
  63. package/es/index.js +8 -3
  64. package/es/index.js.map +1 -1
  65. package/es/radio/Radio.js +1 -1
  66. package/es/radio/RadioGroup.js +1 -1
  67. package/es/radio/index.js +1 -1
  68. package/es/rate/Rate.d.ts +9 -0
  69. package/es/rate/Rate.js +249 -0
  70. package/es/rate/Rate.js.map +1 -0
  71. package/es/rate/defaultProps.js +3 -2
  72. package/es/rate/defaultProps.js.map +1 -1
  73. package/es/rate/index.d.ts +10 -0
  74. package/es/rate/index.js +88 -0
  75. package/es/rate/index.js.map +1 -0
  76. package/es/rate/style/css.d.ts +1 -0
  77. package/es/rate/style/css.js +1 -0
  78. package/es/rate/style/index.css +22 -0
  79. package/es/rate/style/index.d.ts +1 -0
  80. package/es/rate/style/index.js +7 -0
  81. package/es/rate/style/index.js.map +1 -0
  82. package/es/rate/type.d.ts +1 -1
  83. package/es/select/base/Select.js +29 -29
  84. package/es/select/base/Select.js.map +1 -1
  85. package/es/select/defaultProps.js +0 -2
  86. package/es/select/defaultProps.js.map +1 -1
  87. package/es/table/EnhancedTable.js +2 -2
  88. package/es/table/FilterController.js +2 -2
  89. package/es/table/PrimaryTable.js +2 -2
  90. package/es/table/hooks/useColumnController.js +1 -1
  91. package/es/table/hooks/useFilter.js +2 -2
  92. package/es/table/hooks/useRowSelect.js +2 -2
  93. package/es/table/index.js +2 -2
  94. package/es/transfer/Transfer.js +1 -1
  95. package/es/transfer/TransferList.js +1 -1
  96. package/es/transfer/index.js +1 -1
  97. package/es/tree/Tree.js +1 -1
  98. package/es/tree/TreeItem.js +1 -1
  99. package/es/tree/index.js +1 -1
  100. package/es/tree-select/TreeSelect.js +1 -1
  101. package/es/tree-select/index.js +1 -1
  102. package/{es/_chunks/dep-b0e383a7.js → esm/_chunks/dep-4bc86630.js} +1 -1
  103. package/{es/_chunks/dep-b0e383a7.js.map → esm/_chunks/dep-4bc86630.js.map} +1 -1
  104. package/esm/_chunks/{dep-890db007.js → dep-63330981.js} +1 -1
  105. package/esm/_chunks/{dep-890db007.js.map → dep-63330981.js.map} +1 -1
  106. package/{es/_chunks/dep-c6af222f.js → esm/_chunks/dep-a7ee72fa.js} +1 -1
  107. package/esm/_chunks/{dep-c6af222f.js.map → dep-a7ee72fa.js.map} +1 -1
  108. package/esm/_common/style/web/components/_index.less +0 -2
  109. package/esm/avatar/AvararGroup.js +1 -1
  110. package/esm/avatar/Avatar.js +1 -1
  111. package/esm/avatar/index.js +1 -1
  112. package/esm/calendar/Calendar.js +1 -1
  113. package/esm/calendar/index.js +1 -1
  114. package/esm/cascader/Cascader.js +1 -1
  115. package/esm/cascader/CascaderPanel.js +1 -1
  116. package/esm/cascader/components/Item.js +1 -1
  117. package/esm/cascader/components/Panel.js +1 -1
  118. package/esm/cascader/index.js +1 -1
  119. package/esm/checkbox/Checkbox.js +1 -1
  120. package/esm/checkbox/CheckboxGroup.js +1 -1
  121. package/esm/checkbox/index.js +1 -1
  122. package/esm/color-picker/ColorPicker.js +1 -1
  123. package/esm/color-picker/ColorPickerPanel.js +1 -1
  124. package/esm/color-picker/components/panel/header.js +1 -1
  125. package/esm/color-picker/components/panel/index.js +1 -1
  126. package/esm/color-picker/components/panel/index.js.map +1 -1
  127. package/esm/color-picker/index.js +1 -1
  128. package/esm/date-picker/DatePicker.js +1 -0
  129. package/esm/date-picker/DatePicker.js.map +1 -1
  130. package/esm/date-picker/DatePickerPanel.js +1 -0
  131. package/esm/date-picker/DatePickerPanel.js.map +1 -1
  132. package/esm/date-picker/DateRangePicker.js +3 -2
  133. package/esm/date-picker/DateRangePicker.js.map +1 -1
  134. package/esm/date-picker/DateRangePickerPanel.js +1 -0
  135. package/esm/date-picker/DateRangePickerPanel.js.map +1 -1
  136. package/esm/date-picker/hooks/useFormat.js +28 -0
  137. package/esm/date-picker/hooks/useFormat.js.map +1 -1
  138. package/esm/date-picker/hooks/useRangeValue.d.ts +6 -1
  139. package/esm/date-picker/hooks/useRangeValue.js +7 -9
  140. package/esm/date-picker/hooks/useRangeValue.js.map +1 -1
  141. package/esm/date-picker/hooks/useSingle.d.ts +6 -2
  142. package/esm/date-picker/hooks/useSingleValue.d.ts +6 -2
  143. package/esm/date-picker/hooks/useSingleValue.js.map +1 -1
  144. package/esm/date-picker/hooks/useTableData.js +3 -1
  145. package/esm/date-picker/hooks/useTableData.js.map +1 -1
  146. package/esm/date-picker/panel/PanelContent.js +2 -1
  147. package/esm/date-picker/panel/PanelContent.js.map +1 -1
  148. package/esm/date-picker/type.d.ts +2 -2
  149. package/esm/form/Form.js +1 -1
  150. package/esm/form/FormItem.js +1 -1
  151. package/esm/form/index.js +1 -1
  152. package/esm/form/useInitialData.js +1 -1
  153. package/esm/hooks/useControlled.d.ts +6 -1
  154. package/esm/hooks/useControlled.js +2 -2
  155. package/esm/hooks/useControlled.js.map +1 -1
  156. package/esm/index.d.ts +1 -0
  157. package/esm/index.js +8 -3
  158. package/esm/index.js.map +1 -1
  159. package/esm/radio/Radio.js +1 -1
  160. package/esm/radio/RadioGroup.js +1 -1
  161. package/esm/radio/index.js +1 -1
  162. package/esm/rate/Rate.d.ts +9 -0
  163. package/esm/rate/Rate.js +249 -0
  164. package/esm/rate/Rate.js.map +1 -0
  165. package/esm/rate/defaultProps.js +3 -2
  166. package/esm/rate/defaultProps.js.map +1 -1
  167. package/esm/rate/index.d.ts +10 -0
  168. package/esm/rate/index.js +88 -0
  169. package/esm/rate/index.js.map +1 -0
  170. package/esm/rate/style/css.d.ts +1 -0
  171. package/esm/rate/style/index.d.ts +1 -0
  172. package/esm/rate/style/index.js +1 -0
  173. package/esm/rate/type.d.ts +1 -1
  174. package/esm/select/base/Select.js +29 -29
  175. package/esm/select/base/Select.js.map +1 -1
  176. package/esm/select/defaultProps.js +0 -2
  177. package/esm/select/defaultProps.js.map +1 -1
  178. package/esm/table/EnhancedTable.js +2 -2
  179. package/esm/table/FilterController.js +2 -2
  180. package/esm/table/PrimaryTable.js +2 -2
  181. package/esm/table/hooks/useColumnController.js +1 -1
  182. package/esm/table/hooks/useFilter.js +2 -2
  183. package/esm/table/hooks/useRowSelect.js +2 -2
  184. package/esm/table/index.js +2 -2
  185. package/esm/transfer/Transfer.js +1 -1
  186. package/esm/transfer/TransferList.js +1 -1
  187. package/esm/transfer/index.js +1 -1
  188. package/esm/tree/Tree.js +1 -1
  189. package/esm/tree/TreeItem.js +1 -1
  190. package/esm/tree/index.js +1 -1
  191. package/esm/tree-select/TreeSelect.js +1 -1
  192. package/esm/tree-select/index.js +1 -1
  193. package/lib/_chunks/{dep-982647a2.js → dep-1976c9fc.js} +1 -1
  194. package/lib/_chunks/{dep-982647a2.js.map → dep-1976c9fc.js.map} +1 -1
  195. package/lib/_chunks/{dep-4991ff57.js → dep-28416881.js} +1 -1
  196. package/lib/_chunks/{dep-4991ff57.js.map → dep-28416881.js.map} +1 -1
  197. package/lib/_chunks/{dep-096a9275.js → dep-9d52544c.js} +1 -1
  198. package/lib/_chunks/{dep-096a9275.js.map → dep-9d52544c.js.map} +1 -1
  199. package/lib/avatar/AvararGroup.js +1 -1
  200. package/lib/avatar/Avatar.js +1 -1
  201. package/lib/avatar/index.js +1 -1
  202. package/lib/calendar/Calendar.js +1 -1
  203. package/lib/calendar/index.js +1 -1
  204. package/lib/cascader/Cascader.js +1 -1
  205. package/lib/cascader/CascaderPanel.js +1 -1
  206. package/lib/cascader/components/Item.js +1 -1
  207. package/lib/cascader/components/Panel.js +1 -1
  208. package/lib/cascader/index.js +1 -1
  209. package/lib/checkbox/Checkbox.js +1 -1
  210. package/lib/checkbox/CheckboxGroup.js +1 -1
  211. package/lib/checkbox/index.js +1 -1
  212. package/lib/color-picker/ColorPicker.js +1 -1
  213. package/lib/color-picker/ColorPickerPanel.js +1 -1
  214. package/lib/color-picker/components/panel/header.js +1 -1
  215. package/lib/color-picker/components/panel/index.js +1 -1
  216. package/lib/color-picker/components/panel/index.js.map +1 -1
  217. package/lib/color-picker/index.js +1 -1
  218. package/lib/date-picker/DatePicker.js +1 -0
  219. package/lib/date-picker/DatePicker.js.map +1 -1
  220. package/lib/date-picker/DatePickerPanel.js +1 -0
  221. package/lib/date-picker/DatePickerPanel.js.map +1 -1
  222. package/lib/date-picker/DateRangePicker.js +3 -2
  223. package/lib/date-picker/DateRangePicker.js.map +1 -1
  224. package/lib/date-picker/DateRangePickerPanel.js +1 -0
  225. package/lib/date-picker/DateRangePickerPanel.js.map +1 -1
  226. package/lib/date-picker/hooks/useFormat.js +28 -0
  227. package/lib/date-picker/hooks/useFormat.js.map +1 -1
  228. package/lib/date-picker/hooks/useRangeValue.d.ts +6 -1
  229. package/lib/date-picker/hooks/useRangeValue.js +6 -7
  230. package/lib/date-picker/hooks/useRangeValue.js.map +1 -1
  231. package/lib/date-picker/hooks/useSingle.d.ts +6 -2
  232. package/lib/date-picker/hooks/useSingleValue.d.ts +6 -2
  233. package/lib/date-picker/hooks/useSingleValue.js.map +1 -1
  234. package/lib/date-picker/hooks/useTableData.js +2 -0
  235. package/lib/date-picker/hooks/useTableData.js.map +1 -1
  236. package/lib/date-picker/panel/PanelContent.js +2 -1
  237. package/lib/date-picker/panel/PanelContent.js.map +1 -1
  238. package/lib/date-picker/type.d.ts +2 -2
  239. package/lib/form/Form.js +1 -1
  240. package/lib/form/FormItem.js +1 -1
  241. package/lib/form/index.js +1 -1
  242. package/lib/form/useInitialData.js +1 -1
  243. package/lib/hooks/useControlled.d.ts +6 -1
  244. package/lib/hooks/useControlled.js +2 -2
  245. package/lib/hooks/useControlled.js.map +1 -1
  246. package/lib/index-lib.js +7 -3
  247. package/lib/index-lib.js.map +1 -1
  248. package/lib/index.d.ts +1 -0
  249. package/lib/index.js +7 -3
  250. package/lib/index.js.map +1 -1
  251. package/lib/radio/Radio.js +1 -1
  252. package/lib/radio/RadioGroup.js +1 -1
  253. package/lib/radio/index.js +1 -1
  254. package/lib/rate/Rate.d.ts +9 -0
  255. package/lib/rate/Rate.js +249 -0
  256. package/lib/rate/Rate.js.map +1 -0
  257. package/lib/rate/defaultProps.js +3 -2
  258. package/lib/rate/defaultProps.js.map +1 -1
  259. package/lib/rate/index.d.ts +10 -0
  260. package/lib/rate/index.js +83 -0
  261. package/lib/rate/index.js.map +1 -0
  262. package/lib/rate/style/css.d.ts +1 -0
  263. package/lib/rate/style/index.d.ts +1 -0
  264. package/lib/rate/type.d.ts +1 -1
  265. package/lib/select/base/Select.js +29 -29
  266. package/lib/select/base/Select.js.map +1 -1
  267. package/lib/select/defaultProps.js +0 -2
  268. package/lib/select/defaultProps.js.map +1 -1
  269. package/lib/table/EnhancedTable.js +2 -2
  270. package/lib/table/FilterController.js +2 -2
  271. package/lib/table/PrimaryTable.js +2 -2
  272. package/lib/table/hooks/useColumnController.js +1 -1
  273. package/lib/table/hooks/useFilter.js +2 -2
  274. package/lib/table/hooks/useRowSelect.js +2 -2
  275. package/lib/table/index.js +2 -2
  276. package/lib/transfer/Transfer.js +1 -1
  277. package/lib/transfer/TransferList.js +1 -1
  278. package/lib/transfer/index.js +1 -1
  279. package/lib/tree/Tree.js +1 -1
  280. package/lib/tree/TreeItem.js +1 -1
  281. package/lib/tree/index.js +1 -1
  282. package/lib/tree-select/TreeSelect.js +1 -1
  283. package/lib/tree-select/index.js +1 -1
  284. package/package.json +1 -1
package/dist/tdesign.js CHANGED
@@ -9049,7 +9049,7 @@
9049
9049
 
9050
9050
  var noop$1 = (function () {});
9051
9051
 
9052
- function useControlled() {
9052
+ var useControlled = function useControlled() {
9053
9053
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9054
9054
  var valueKey = arguments.length > 1 ? arguments[1] : undefined;
9055
9055
  var onChange = arguments.length > 2 ? arguments[2] : undefined;
@@ -9073,7 +9073,7 @@
9073
9073
 
9074
9074
  onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [newValue].concat(args));
9075
9075
  }];
9076
- }
9076
+ };
9077
9077
 
9078
9078
  function useAnimation() {
9079
9079
  var _useConfig = useConfig$1(),
@@ -19319,8 +19319,6 @@
19319
19319
  max: 0,
19320
19320
  minCollapsedNum: 0,
19321
19321
  multiple: false,
19322
- placeholder: void 0,
19323
- popupVisible: void 0,
19324
19322
  readonly: false,
19325
19323
  reserveKeyword: false,
19326
19324
  showArrow: true,
@@ -30302,8 +30300,6 @@
30302
30300
  loadingText = _props$loadingText === void 0 ? emptyText : _props$loadingText,
30303
30301
  max = props.max,
30304
30302
  popupProps = props.popupProps,
30305
- popupVisible = props.popupVisible,
30306
- onPopupVisibleChange = props.onPopupVisibleChange,
30307
30303
  reserveKeyword = props.reserveKeyword,
30308
30304
  className = props.className,
30309
30305
  style = props.style,
@@ -30355,35 +30351,35 @@
30355
30351
 
30356
30352
  var name = "".concat(classPrefix, "-select");
30357
30353
 
30358
- var _useState = React.useState(popupVisible || false),
30359
- _useState2 = _slicedToArray(_useState, 2),
30360
- showPopup = _useState2[0],
30361
- setShowPopup = _useState2[1];
30362
-
30363
- var _useControlled3 = useControlled(props, "inputValue", props.onInputChange),
30354
+ var _useControlled3 = useControlled(props, "popupVisible", props.onPopupVisibleChange),
30364
30355
  _useControlled4 = _slicedToArray(_useControlled3, 2),
30365
- inputValue = _useControlled4[0],
30366
- onInputChange = _useControlled4[1];
30356
+ showPopup = _useControlled4[0],
30357
+ setShowPopup = _useControlled4[1];
30358
+
30359
+ var _useControlled5 = useControlled(props, "inputValue", props.onInputChange),
30360
+ _useControlled6 = _slicedToArray(_useControlled5, 2),
30361
+ inputValue = _useControlled6[0],
30362
+ onInputChange = _useControlled6[1];
30363
+
30364
+ var _useState = React.useState([]),
30365
+ _useState2 = _slicedToArray(_useState, 2),
30366
+ currentOptions = _useState2[0],
30367
+ setCurrentOptions = _useState2[1];
30367
30368
 
30368
30369
  var _useState3 = React.useState([]),
30369
30370
  _useState4 = _slicedToArray(_useState3, 2),
30370
- currentOptions = _useState4[0],
30371
- setCurrentOptions = _useState4[1];
30371
+ tmpPropOptions = _useState4[0],
30372
+ setTmpPropOptions = _useState4[1];
30372
30373
 
30373
- var _useState5 = React.useState([]),
30374
+ var _useState5 = React.useState({}),
30374
30375
  _useState6 = _slicedToArray(_useState5, 2),
30375
- tmpPropOptions = _useState6[0],
30376
- setTmpPropOptions = _useState6[1];
30376
+ valueToOption = _useState6[0],
30377
+ setValueToOption = _useState6[1];
30377
30378
 
30378
- var _useState7 = React.useState({}),
30379
+ var _useState7 = React.useState([]),
30379
30380
  _useState8 = _slicedToArray(_useState7, 2),
30380
- valueToOption = _useState8[0],
30381
- setValueToOption = _useState8[1];
30382
-
30383
- var _useState9 = React.useState([]),
30384
- _useState10 = _slicedToArray(_useState9, 2),
30385
- selectedOptions = _useState10[0],
30386
- setSelectedOptions = _useState10[1];
30381
+ selectedOptions = _useState8[0],
30382
+ setSelectedOptions = _useState8[1];
30387
30383
 
30388
30384
  React.useEffect(function () {
30389
30385
  if (keys) {
@@ -30446,9 +30442,9 @@
30446
30442
  return get_1(selectedOptions[0] || {}, (keys === null || keys === void 0 ? void 0 : keys.label) || "label") || void 0;
30447
30443
  }, [selectedOptions, keys, multiple]);
30448
30444
 
30449
- var handleShowPopup = function handleShowPopup(visible) {
30445
+ var handleShowPopup = function handleShowPopup(visible, ctx) {
30450
30446
  if (disabled) return;
30451
- setShowPopup(visible);
30447
+ setShowPopup(visible, ctx);
30452
30448
  onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(visible);
30453
30449
  visible && onInputChange("");
30454
30450
  };
@@ -30598,7 +30594,7 @@
30598
30594
  };
30599
30595
 
30600
30596
  React.useEffect(function () {
30601
- if (inputValue) {
30597
+ if (typeof inputValue !== "undefined") {
30602
30598
  handleFilter(String(inputValue));
30603
30599
  }
30604
30600
  }, [inputValue]);
@@ -30627,7 +30623,9 @@
30627
30623
  size: size,
30628
30624
  multiple: multiple,
30629
30625
  showPopup: showPopup,
30630
- setShowPopup: setShowPopup,
30626
+ setShowPopup: function setShowPopup(show) {
30627
+ return handleShowPopup(show, {});
30628
+ },
30631
30629
  options: currentOptions,
30632
30630
  empty: empty,
30633
30631
  max: max,
@@ -30741,7 +30739,7 @@
30741
30739
  suffixIcon: renderSuffixIcon(),
30742
30740
  panel: renderContent(),
30743
30741
  placeholder: !multiple && showPopup && selectedLabel ? selectedLabel : placeholder || t(local.placeholder),
30744
- inputValue: showPopup ? inputValue : "",
30742
+ inputValue: inputValue,
30745
30743
  tagInputProps: _objectSpread$1v({
30746
30744
  autoWidth: true
30747
30745
  }, tagInputProps),
@@ -30755,7 +30753,7 @@
30755
30753
  overlayClassName: ["".concat(name, "__dropdown"), ["narrow-scrollbar"], overlayClassName]
30756
30754
  }, restPopupProps),
30757
30755
  popupVisible: showPopup,
30758
- onPopupVisibleChange: onPopupVisibleChange || handleShowPopup,
30756
+ onPopupVisibleChange: handleShowPopup,
30759
30757
  onTagChange: onTagChange,
30760
30758
  onInputChange: handleInputChange,
30761
30759
  onFocus: onFocus,
@@ -54198,6 +54196,29 @@
54198
54196
 
54199
54197
  return dataList;
54200
54198
  }
54199
+ function getQuarters(year, _ref6) {
54200
+ var _ref6$disableDate = _ref6.disableDate,
54201
+ disableDate = _ref6$disableDate === void 0 ? function () {
54202
+ return false;
54203
+ } : _ref6$disableDate,
54204
+ minDate = _ref6.minDate,
54205
+ maxDate = _ref6.maxDate;
54206
+ var quarterArr = [];
54207
+ var today = getToday();
54208
+
54209
+ for (var i = 1; i <= 4; i++) {
54210
+ var date = dayjs(new Date(year, 0)).quarter(i).toDate();
54211
+ quarterArr.push({
54212
+ value: date,
54213
+ now: isSame(date, today, "quarter"),
54214
+ disabled: typeof disableDate === "function" && disableDate(date) || outOfRanges(date, minDate, maxDate),
54215
+ active: false,
54216
+ text: "Q".concat(i)
54217
+ });
54218
+ }
54219
+
54220
+ return chunk_1(quarterArr, 4);
54221
+ }
54201
54222
  function getYears(year, _ref7) {
54202
54223
  var _ref7$disableDate = _ref7.disableDate,
54203
54224
  disableDate = _ref7$disableDate === void 0 ? function () {
@@ -54540,6 +54561,26 @@
54540
54561
  }
54541
54562
  }
54542
54563
 
54564
+ if (/Q/g.test(format)) {
54565
+ if (typeof dateText !== "string") {
54566
+ dateText = dayjs(dateText).format(format);
54567
+ }
54568
+
54569
+ var _yearStr = dateText.split(/[-/.]/)[0];
54570
+ var quarterStr = dateText.split(/[-/.]/)[1];
54571
+ var quarterFormatStr = format.split(/[-/.]/)[1];
54572
+
54573
+ var _firstWeek = dayjs(_yearStr, "YYYY").startOf("year");
54574
+
54575
+ for (var _i = 0; _i <= 52; _i += 1) {
54576
+ var nextQuarter = _firstWeek.add(_i, "quarter");
54577
+
54578
+ if (nextQuarter.format(quarterFormatStr) === quarterStr) {
54579
+ return nextQuarter;
54580
+ }
54581
+ }
54582
+ }
54583
+
54543
54584
  return dayjs(dateText, format).isValid() ? dayjs(dateText, format) : dayjs(dateText);
54544
54585
  }
54545
54586
  function getDefaultFormat(_ref4) {
@@ -54565,6 +54606,14 @@
54565
54606
  };
54566
54607
  }
54567
54608
 
54609
+ if (mode === "quarter") {
54610
+ return {
54611
+ format: format || "YYYY-[Q]Q",
54612
+ valueType: valueType || "YYYY-[Q]Q",
54613
+ timeFormat: TIME_FORMAT$1
54614
+ };
54615
+ }
54616
+
54568
54617
  if (mode === "week") {
54569
54618
  return {
54570
54619
  format: format || "YYYY-wo",
@@ -55756,6 +55805,7 @@
55756
55805
  }),
55757
55806
  timeFormat = _getDefaultFormat.timeFormat;
55758
55807
 
55808
+ var showTimePicker = enableTimePicker && mode === "date";
55759
55809
  var defaultTime = "00:00:00";
55760
55810
  return /* @__PURE__ */React__default["default"].createElement("div", {
55761
55811
  className: "".concat(panelName, "-content")
@@ -55802,7 +55852,7 @@
55802
55852
  });
55803
55853
  },
55804
55854
  onCellMouseLeave: onCellMouseLeave
55805
- })), enableTimePicker && /* @__PURE__ */React__default["default"].createElement("div", {
55855
+ })), showTimePicker && /* @__PURE__ */React__default["default"].createElement("div", {
55806
55856
  className: "".concat(panelName, "-time")
55807
55857
  }, /* @__PURE__ */React__default["default"].createElement("div", {
55808
55858
  className: "".concat(panelName, "-time-viewer")
@@ -55921,6 +55971,8 @@
55921
55971
  year: year,
55922
55972
  month: month
55923
55973
  }, options);
55974
+ } else if (mode === "quarter") {
55975
+ data = getQuarters(year, options);
55924
55976
  } else if (mode === "month") {
55925
55977
  data = getMonths(year, options);
55926
55978
  } else if (mode === "year") {
@@ -56180,9 +56232,9 @@
56180
56232
 
56181
56233
  if (mode === "year") {
56182
56234
  defaultYearMonthTime.year[1] += 10;
56183
- } else if (mode === "month") {
56235
+ } else if (mode === "month" || mode === "quarter") {
56184
56236
  defaultYearMonthTime.year[1] += 1;
56185
- } else if (mode === "date") {
56237
+ } else if (mode === "date" || mode === "week") {
56186
56238
  defaultYearMonthTime.month[1] += 1;
56187
56239
  }
56188
56240
 
@@ -56192,17 +56244,16 @@
56192
56244
 
56193
56245
  return {
56194
56246
  year: value.map(function (v) {
56195
- return dayjs(v, format).year() || dayjs(v).year();
56247
+ return parseToDayjs(v, format).year();
56196
56248
  }),
56197
56249
  month: value.map(function (v) {
56198
- return dayjs(v, format).month() || dayjs(v).month();
56250
+ return parseToDayjs(v, format).month();
56199
56251
  }),
56200
56252
  time: value.map(function (v) {
56201
- return dayjs(v, format).format(timeFormat) || dayjs(v).format(timeFormat);
56253
+ return parseToDayjs(v, format).format(timeFormat);
56202
56254
  })
56203
56255
  };
56204
56256
  }
56205
-
56206
56257
  function useRange$1(props) {
56207
56258
  var _useControlled = useControlled(props, "value", props.onChange),
56208
56259
  _useControlled2 = _slicedToArray(_useControlled, 2),
@@ -56622,7 +56673,7 @@
56622
56673
  setTime(formatTime(value || [dayjs().format(timeFormat), dayjs().format(timeFormat)], timeFormat));
56623
56674
 
56624
56675
  if (!value.length) {
56625
- setYear([dayjs().year(), dayjs().year()]);
56676
+ setYear(initYearMonthTime(value, mode, format).year);
56626
56677
  setMonth([dayjs().month(), dayjs().month() + 1]);
56627
56678
  } else if (value.length === 2 && !enableTimePicker) {
56628
56679
  var nextMonth = value.map(function (v) {
@@ -56725,6 +56776,7 @@
56725
56776
  date: 1,
56726
56777
  week: 1,
56727
56778
  month: 12,
56779
+ quarter: 12,
56728
56780
  year: 120
56729
56781
  };
56730
56782
  var monthCount = monthCountMap[mode] || 0;
@@ -60334,6 +60386,7 @@
60334
60386
  date: 1,
60335
60387
  week: 1,
60336
60388
  month: 12,
60389
+ quarter: 12,
60337
60390
  year: 120
60338
60391
  };
60339
60392
  var monthCount = monthCountMap[mode] || 0;
@@ -60546,6 +60599,7 @@
60546
60599
  date: 1,
60547
60600
  week: 1,
60548
60601
  month: 12,
60602
+ quarter: 12,
60549
60603
  year: 120
60550
60604
  };
60551
60605
  var monthCount = monthCountMap[mode] || 0;
@@ -60834,6 +60888,7 @@
60834
60888
  date: 1,
60835
60889
  week: 1,
60836
60890
  month: 12,
60891
+ quarter: 12,
60837
60892
  year: 120
60838
60893
  };
60839
60894
  var monthCount = monthCountMap[mode] || 0;
@@ -66385,6 +66440,186 @@
66385
66440
 
66386
66441
  var Space = Space$1;
66387
66442
 
66443
+ var rateDefaultProps = {
66444
+ defaultValue: 0,
66445
+ allowHalf: false,
66446
+ color: "#ED7B2F",
66447
+ disabled: false,
66448
+ size: "20",
66449
+ count: 5,
66450
+ gap: 6,
66451
+ showText: false,
66452
+ texts: ["\u6781\u5DEE", "\u5931\u671B", "\u4E00\u822C", "\u6EE1\u610F", "\u60CA\u559C"]
66453
+ };
66454
+
66455
+ var getFilledStarSvg = function getFilledStarSvg(size) {
66456
+ return /* @__PURE__ */React__default["default"].createElement("svg", {
66457
+ fill: "none",
66458
+ viewBox: "0 0 16 16",
66459
+ width: "".concat(size),
66460
+ height: "".concat(size)
66461
+ }, /* @__PURE__ */React__default["default"].createElement("path", {
66462
+ fill: "currentColor",
66463
+ d: "M7.73 1.55a.3.3 0 01.54 0l1.94 3.92 4.32.62a.3.3 0 01.17.52l-3.13 3.05.74 4.3a.3.3 0 01-.44.32L8 12.25l-3.87 2.03a.3.3 0 01-.43-.31l.73-4.31L1.3 6.6a.3.3 0 01.17-.52l4.33-.62 1.93-3.92z",
66464
+ fillOpacity: "0.9"
66465
+ }));
66466
+ };
66467
+
66468
+ var getFilledHalfStarSvg = function getFilledHalfStarSvg(size) {
66469
+ return /* @__PURE__ */React__default["default"].createElement("svg", {
66470
+ fill: "none",
66471
+ viewBox: "0 0 16 16",
66472
+ width: "".concat(size),
66473
+ height: "".concat(size)
66474
+ }, /* @__PURE__ */React__default["default"].createElement("defs", null, /* @__PURE__ */React__default["default"].createElement("linearGradient", {
66475
+ id: "half_grad"
66476
+ }, /* @__PURE__ */React__default["default"].createElement("stop", {
66477
+ offset: "50%",
66478
+ stopColor: "currentColor"
66479
+ }), /* @__PURE__ */React__default["default"].createElement("stop", {
66480
+ offset: "50%",
66481
+ stopColor: "white",
66482
+ stopOpacity: "1"
66483
+ }))), /* @__PURE__ */React__default["default"].createElement("path", {
66484
+ fill: "url(#half_grad)",
66485
+ d: "M7.73 1.55a.3.3 0 01.54 0l1.94 3.92 4.32.62a.3.3 0 01.17.52l-3.13 3.05.74 4.3a.3.3 0 01-.44.32L8 12.25l-3.87 2.03a.3.3 0 01-.43-.31l.73-4.31L1.3 6.6a.3.3 0 01.17-.52l4.33-.62 1.93-3.92z",
66486
+ fillOpacity: "0.9"
66487
+ }));
66488
+ };
66489
+
66490
+ var Rate$1 = function Rate(props) {
66491
+ var allowHalf = props.allowHalf,
66492
+ color = props.color,
66493
+ count = props.count,
66494
+ disabled = props.disabled,
66495
+ gap = props.gap,
66496
+ showText = props.showText,
66497
+ size = props.size,
66498
+ texts = props.texts,
66499
+ onChange = props.onChange;
66500
+
66501
+ var _useControlled = useControlled(props, "value", onChange),
66502
+ _useControlled2 = _slicedToArray(_useControlled, 2),
66503
+ _useControlled2$ = _useControlled2[0],
66504
+ starValue = _useControlled2$ === void 0 ? 0 : _useControlled2$,
66505
+ setStarValue = _useControlled2[1];
66506
+
66507
+ var _useState = React.useState(void 0),
66508
+ _useState2 = _slicedToArray(_useState, 2),
66509
+ _useState2$ = _useState2[0],
66510
+ hoverValue = _useState2$ === void 0 ? void 0 : _useState2$,
66511
+ setHoverValue = _useState2[1];
66512
+
66513
+ var rootRef = React__default["default"].useRef(null);
66514
+
66515
+ var _useConfig = useConfig$1(),
66516
+ classPrefix = _useConfig.classPrefix;
66517
+
66518
+ var getStarValue = function getStarValue(event, index) {
66519
+ if (allowHalf) {
66520
+ var rootNode = rootRef.current;
66521
+
66522
+ var _rootNode$getBounding = rootNode.getBoundingClientRect(),
66523
+ left = _rootNode$getBounding.left;
66524
+
66525
+ var firstStar = rootNode.firstChild;
66526
+
66527
+ var _firstStar$getBoundin = firstStar.getBoundingClientRect(),
66528
+ width = _firstStar$getBoundin.width;
66529
+
66530
+ var clientX = event.clientX;
66531
+ var starMiddle = width * (index - 0.5) + gap * (index - 1);
66532
+
66533
+ if (clientX - left < starMiddle) {
66534
+ return index - 0.5;
66535
+ }
66536
+
66537
+ if (clientX - left >= starMiddle) {
66538
+ return index;
66539
+ }
66540
+ } else {
66541
+ return index;
66542
+ }
66543
+ };
66544
+
66545
+ var mouseEnterHandler = function mouseEnterHandler(event, index) {
66546
+ setHoverValue(getStarValue(event, index));
66547
+ };
66548
+
66549
+ var mouseLeaveHandler = function mouseLeaveHandler() {
66550
+ setHoverValue(void 0);
66551
+ };
66552
+
66553
+ var clickHandler = function clickHandler(event, index) {
66554
+ setStarValue(getStarValue(event, index));
66555
+ };
66556
+
66557
+ var getStarStyle = React.useCallback(function (index, count2, displayValue2) {
66558
+ var filledColor = Array.isArray(color) ? color[0] : color || "#ED7B2F";
66559
+ var defaultColor = Array.isArray(color) ? color[1] : "#E7E7E7";
66560
+ return {
66561
+ marginRight: index < count2 - 1 ? gap : "",
66562
+ width: size,
66563
+ height: size,
66564
+ color: index < displayValue2 ? filledColor : defaultColor
66565
+ };
66566
+ }, [size, color, gap]);
66567
+ var getStar = React.useCallback(function (allowHalf2, index, displayValue2) {
66568
+ if (allowHalf2 && index + 0.5 === displayValue2) {
66569
+ return getFilledHalfStarSvg(size);
66570
+ }
66571
+
66572
+ if (index >= displayValue2) {
66573
+ return getFilledStarSvg(size);
66574
+ }
66575
+
66576
+ if (index < displayValue2) {
66577
+ return getFilledStarSvg(size);
66578
+ }
66579
+ }, [size]);
66580
+ var displayValue = hoverValue || starValue;
66581
+ return /* @__PURE__ */React__default["default"].createElement("div", {
66582
+ className: "".concat(classPrefix, "-rate"),
66583
+ ref: rootRef,
66584
+ onMouseLeave: function onMouseLeave() {
66585
+ return !disabled && mouseLeaveHandler();
66586
+ }
66587
+ }, _toConsumableArray(Array(count)).map(function (_, index) {
66588
+ return showText ? /* @__PURE__ */React__default["default"].createElement(Tooltip, {
66589
+ key: index,
66590
+ content: texts[displayValue - 1],
66591
+ className: "".concat(classPrefix, "-rate__wrapper")
66592
+ }, /* @__PURE__ */React__default["default"].createElement("div", {
66593
+ key: index,
66594
+ onMouseMove: function onMouseMove(event) {
66595
+ return !disabled && mouseEnterHandler(event, index + 1);
66596
+ },
66597
+ onClick: function onClick(event) {
66598
+ return !disabled && clickHandler(event, index + 1);
66599
+ },
66600
+ style: getStarStyle(index, count, displayValue),
66601
+ className: "".concat(classPrefix, "-rate__wrapper")
66602
+ }, getStar(allowHalf, index, displayValue))) : /* @__PURE__ */React__default["default"].createElement("div", {
66603
+ key: index,
66604
+ onMouseMove: function onMouseMove(event) {
66605
+ return !disabled && mouseEnterHandler(event, index + 1);
66606
+ },
66607
+ onClick: function onClick(event) {
66608
+ return !disabled && clickHandler(event, index + 1);
66609
+ },
66610
+ style: getStarStyle(index, count, displayValue),
66611
+ className: "".concat(classPrefix, "-rate__wrapper")
66612
+ }, getStar(allowHalf, index, displayValue));
66613
+ }), showText && /* @__PURE__ */React__default["default"].createElement("div", {
66614
+ className: "".concat(classPrefix, "-rate__text")
66615
+ }, texts[displayValue - 1]));
66616
+ };
66617
+
66618
+ Rate$1.displayName = "Rate";
66619
+ Rate$1.defaultProps = rateDefaultProps;
66620
+
66621
+ var Rate = Rate$1;
66622
+
66388
66623
  if (typeof console !== "undefined" && console.warn && typeof window !== "undefined") {
66389
66624
  console.warn("You are using a whole package of TDesign!");
66390
66625
  }
@@ -66441,6 +66676,7 @@
66441
66676
  exports.Radio = Radio;
66442
66677
  exports.RangeInput = RangeInput;
66443
66678
  exports.RangeInputPopup = RangeInputPopup;
66679
+ exports.Rate = Rate;
66444
66680
  exports.Row = Row;
66445
66681
  exports.Select = Select;
66446
66682
  exports.SelectInput = SelectInput;