@nutui/nutui-react-taro 1.4.9-beta.1 → 1.4.9

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 (108) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/esm/ActionSheet.js +3 -3
  3. package/dist/esm/Address.js +3 -3
  4. package/dist/esm/Badge.js +3 -2
  5. package/dist/esm/Calendar.js +4 -4
  6. package/dist/esm/CalendarItem.js +3 -2
  7. package/dist/esm/Card.js +3 -3
  8. package/dist/esm/Cascader.js +4 -4
  9. package/dist/esm/Checkbox.js +2 -2
  10. package/dist/esm/CheckboxGroup.js +2 -2
  11. package/dist/esm/CircleProgress.js +3 -2
  12. package/dist/esm/Collapse.js +3 -2
  13. package/dist/esm/DatePicker.js +5 -4
  14. package/dist/esm/Form/style/index.js +1 -1
  15. package/dist/esm/FormItem/style/index.js +1 -1
  16. package/dist/esm/Grid.js +3 -2
  17. package/dist/esm/GridItem.js +3 -2
  18. package/dist/esm/ImagePreview.js +3 -3
  19. package/dist/esm/Indicator.js +2 -2
  20. package/dist/esm/MenuItem/style/index.js +1 -1
  21. package/dist/esm/NavBar/style/index.js +1 -1
  22. package/dist/esm/NumberKeyboard/style/index.js +1 -1
  23. package/dist/esm/NumberKeyboard.js +3 -3
  24. package/dist/esm/Picker.js +3 -3
  25. package/dist/esm/Popover/style/index.js +2 -1
  26. package/dist/esm/Popup.js +2 -2
  27. package/dist/esm/Rate.js +3 -2
  28. package/dist/esm/SearchBar/style/index.js +1 -1
  29. package/dist/esm/ShortPassword.js +3 -3
  30. package/dist/esm/SideNavBar/style/index.js +1 -1
  31. package/dist/esm/SideNavBar.js +3 -3
  32. package/dist/esm/Skeleton/style/index.js +1 -1
  33. package/dist/esm/Sticky.js +6 -3
  34. package/dist/esm/Swipe.js +3 -2
  35. package/dist/esm/Table/style/index.js +1 -1
  36. package/dist/esm/Tabs/style/index.js +2 -1
  37. package/dist/esm/Tabs.js +3 -2
  38. package/dist/esm/TimeSelect/style/index.js +1 -0
  39. package/dist/esm/TimeSelect.js +3 -3
  40. package/dist/esm/Uploader/style/index.js +1 -0
  41. package/dist/esm/Uploader.js +4 -2
  42. package/dist/esm/{actionsheet.taro-166ce936.js → actionsheet.taro-c5ccaf4e.js} +1 -1
  43. package/dist/esm/{address.taro-55f308f1.js → address.taro-f977bad0.js} +1 -1
  44. package/dist/esm/{badge.taro-116b2521.js → badge.taro-a2e7dd5a.js} +5 -2
  45. package/dist/esm/{calendar.taro-c95e6998.js → calendar.taro-2dee4f90.js} +2 -2
  46. package/dist/esm/{calendaritem.taro-86412398.js → calendaritem.taro-f5da0936.js} +6 -2
  47. package/dist/esm/{card.taro-a03f0dfc.js → card.taro-4fb6bc4e.js} +2 -1
  48. package/dist/esm/{cascader.taro-e0fb7e63.js → cascader.taro-a2ee549c.js} +2 -2
  49. package/dist/esm/{checkbox.taro-b76b1c82.js → checkbox.taro-6aab93c3.js} +60 -69
  50. package/dist/esm/{circleprogress.taro-47db537c.js → circleprogress.taro-897ea24b.js} +1 -2
  51. package/dist/esm/{collapse.taro-af58206c.js → collapse.taro-c903a060.js} +2 -1
  52. package/dist/esm/{datepicker.taro-324d9d98.js → datepicker.taro-e5f3aa90.js} +11 -10
  53. package/dist/esm/{grid.taro-e6decfce.js → grid.taro-9410ff69.js} +4 -1
  54. package/dist/esm/{griditem.taro-5406bd2c.js → griditem.taro-26863577.js} +9 -2
  55. package/dist/esm/{imagepreview.taro-2d23d0ae.js → imagepreview.taro-3a5722e8.js} +1 -1
  56. package/dist/esm/index-a90733f9.js +7 -0
  57. package/dist/esm/{indicator.taro-183ea169.js → indicator.taro-25682172.js} +1 -1
  58. package/dist/esm/{numberkeyboard.taro-c6b5b0e1.js → numberkeyboard.taro-78224b3a.js} +1 -1
  59. package/dist/esm/nutui-react.es.js +28 -27
  60. package/dist/esm/{picker.taro-33e33120.js → picker.taro-4298ce4e.js} +1 -1
  61. package/dist/esm/{popup.taro-4c18f46c.js → popup.taro-6e81162a.js} +1 -1
  62. package/dist/esm/{rate.taro-17b84a51.js → rate.taro-f18381f3.js} +5 -2
  63. package/dist/esm/{shortpassword.taro-53b7ee7b.js → shortpassword.taro-e8ea4593.js} +1 -1
  64. package/dist/esm/{sidenavbar.taro-51a133e6.js → sidenavbar.taro-e03a5287.js} +1 -1
  65. package/dist/esm/{sticky.taro-2d9b2804.js → sticky.taro-b15d1173.js} +9 -4
  66. package/dist/esm/{swipe.taro-6532405d.js → swipe.taro-9375a9a1.js} +2 -1
  67. package/dist/esm/{tabs.taro-4629d66c.js → tabs.taro-95edd45d.js} +2 -0
  68. package/dist/esm/{timeselect.taro-4fb46162.js → timeselect.taro-f276b0a9.js} +1 -1
  69. package/dist/esm/types/src/packages/checkbox/checkbox.d.ts +2 -7
  70. package/dist/esm/types/src/packages/checkbox/checkbox.taro.d.ts +2 -7
  71. package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.d.ts +4 -5
  72. package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.taro.d.ts +4 -5
  73. package/dist/esm/types/src/packages/checkboxgroup/context.d.ts +10 -0
  74. package/dist/esm/types/src/packages/tabs/tabs.d.ts +4 -1
  75. package/dist/esm/types/src/packages/tabs/tabs.taro.d.ts +4 -1
  76. package/dist/esm/types/src/packages/uploader/upload.d.ts +3 -0
  77. package/dist/esm/types/src/packages/uploader/uploader.d.ts +4 -1
  78. package/dist/esm/types/src/packages/uploader/uploader.taro.d.ts +15 -6
  79. package/dist/esm/types/src/utils/Interceptor.d.ts +6 -0
  80. package/dist/esm/types/src/utils/index.d.ts +2 -0
  81. package/dist/esm/{uploader.taro-c830b573.js → uploader.taro-77396b5d.js} +183 -81
  82. package/dist/locales/base.js +1 -1
  83. package/dist/locales/en-US.js +1 -1
  84. package/dist/locales/id-ID.js +1 -1
  85. package/dist/locales/zh-CN.js +1 -1
  86. package/dist/locales/zh-TW.js +1 -1
  87. package/dist/locales/zh-UG.js +1 -1
  88. package/dist/nutui.react.es.js +319 -218
  89. package/dist/nutui.react.umd.js +318 -217
  90. package/dist/packages/datepicker/datepicker.scss +0 -3
  91. package/dist/packages/form/form.scss +1 -0
  92. package/dist/packages/formitem/formitem.scss +13 -0
  93. package/dist/packages/menuitem/menuitem.scss +4 -0
  94. package/dist/packages/navbar/navbar.scss +24 -0
  95. package/dist/packages/numberkeyboard/numberkeyboard.scss +1 -0
  96. package/dist/packages/searchbar/searchbar.scss +1 -0
  97. package/dist/packages/sidenavbar/sidenavbar.scss +13 -0
  98. package/dist/packages/skeleton/skeleton.scss +7 -0
  99. package/dist/packages/table/table.scss +22 -0
  100. package/dist/packages/tabs/tabs.scss +44 -2
  101. package/dist/packages/timeselect/timeselect.scss +7 -0
  102. package/dist/packages/uploader/uploader.scss +85 -28
  103. package/dist/style.css +1 -1
  104. package/dist/style.es.js +1 -1
  105. package/dist/styles/variables.scss +62 -0
  106. package/dist/types/index.d.ts +28 -21
  107. package/package.json +1 -1
  108. package/dist/esm/types/src/packages/tabbar/use-props-value.d.ts +0 -7
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v1.4.9-beta.1 Fri Feb 24 2023 14:33:09 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v1.4.9 Wed Mar 01 2023 15:41:27 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import * as React from "react";
7
7
  import React__default, { useCallback, useState, useEffect, createContext, useContext, useMemo, useRef, forwardRef, useImperativeHandle, useLayoutEffect, Component, memo } from "react";
8
- import Taro, { redirectTo, navigateTo, getEnv, usePageScroll, getSystemInfoSync, nextTick, createSelectorQuery, uploadFile, chooseImage, pageScrollTo, useReady, createInnerAudioContext, getSystemInfo, createOffscreenCanvas, canvasToTempFilePath } from "@tarojs/taro";
8
+ import Taro, { redirectTo, navigateTo, getEnv, usePageScroll, getSystemInfoSync, nextTick, createSelectorQuery, uploadFile, chooseMedia, chooseImage, pageScrollTo, useReady, createInnerAudioContext, getSystemInfo, createOffscreenCanvas, canvasToTempFilePath } from "@tarojs/taro";
9
9
  import ReactDOM, { createPortal, unstable_batchedUpdates } from "react-dom";
10
10
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
11
11
  function getAugmentedNamespace(n) {
@@ -1605,7 +1605,7 @@ const Popup = (props) => {
1605
1605
  round,
1606
1606
  [`nut-popup-${position}`]: true,
1607
1607
  [`${popClass}`]: true,
1608
- [`${className}`]: true
1608
+ [`${className || ""}`]: true
1609
1609
  },
1610
1610
  b2("")
1611
1611
  );
@@ -1835,7 +1835,9 @@ const Grid = (props) => {
1835
1835
  const b2 = cn("grid");
1836
1836
  const rootClass = () => {
1837
1837
  const prefixCls = b2();
1838
- return `${className} ${prefixCls} ${border && !gutter ? `${b2("border")}` : ""}`;
1838
+ return classNames(className, prefixCls, {
1839
+ [b2("border")]: border && !gutter
1840
+ });
1839
1841
  };
1840
1842
  const rootStyle = () => {
1841
1843
  let styleSelf = {};
@@ -1936,8 +1938,14 @@ const GridItem = (props) => {
1936
1938
  return style;
1937
1939
  };
1938
1940
  const contentClass = () => {
1939
- return `${b2("content")} ${border && b2("content--border")} ${border && gutter && b2("content--surround")} ${center && b2("content--center")} ${square && b2("content--square")} ${reverse && b2("content--reverse")} ${!!direction && b2(`content--${direction}`)}
1940
- `;
1941
+ return classNames(b2("content"), {
1942
+ [b2("content--border")]: border,
1943
+ [b2("content--surround")]: border && gutter,
1944
+ [b2("content--center")]: center,
1945
+ [b2("content--square")]: square,
1946
+ [b2("content--reverse")]: reverse,
1947
+ [b2(`content--${direction}`)]: !!direction
1948
+ });
1941
1949
  };
1942
1950
  const isIconName = () => {
1943
1951
  return typeof icon === "string";
@@ -2108,6 +2116,7 @@ const defaultProps$1i = {
2108
2116
  bottom: 0,
2109
2117
  zIndex: 2e3
2110
2118
  };
2119
+ const b$2 = cn("sticky");
2111
2120
  const Sticky = (props) => {
2112
2121
  const {
2113
2122
  position = "top",
@@ -2208,10 +2217,10 @@ const Sticky = (props) => {
2208
2217
  return /* @__PURE__ */ React__default.createElement("div", {
2209
2218
  ref: rootRef,
2210
2219
  style: rootStyle,
2211
- className: `nut-sticky ${className}`,
2220
+ className: classNames(b$2(), className),
2212
2221
  ...rest
2213
2222
  }, /* @__PURE__ */ React__default.createElement("div", {
2214
- className: `nut-sticky-box ${fixed ? "nut-sticky-fixed" : ""}`,
2223
+ className: classNames("nut-sticky-box", { "nut-sticky-fixed": fixed }),
2215
2224
  ref: stickyRef,
2216
2225
  style: stickyStyle
2217
2226
  }, children));
@@ -2582,7 +2591,7 @@ const Indicator = (props) => {
2582
2591
  useEffect(() => {
2583
2592
  }, []);
2584
2593
  return /* @__PURE__ */ React__default.createElement("div", {
2585
- className: `${classes} ${className}`,
2594
+ className: classNames(classes, className),
2586
2595
  ...rest
2587
2596
  }, renderEles());
2588
2597
  };
@@ -3591,6 +3600,7 @@ const Tabs = (props) => {
3591
3600
  };
3592
3601
  Tabs.defaultProps = defaultProps$15;
3593
3602
  Tabs.displayName = "NutTabs";
3603
+ Tabs.TabPane = TabPane;
3594
3604
  const Utils = {
3595
3605
  isLeapYear(y) {
3596
3606
  return y % 4 == 0 && y % 100 != 0 || y % 400 == 0;
@@ -3738,6 +3748,7 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
3738
3748
  const [monthsData, setMonthsData] = useState([]);
3739
3749
  const [translateY, setTranslateY] = useState(0);
3740
3750
  const [monthDefaultRange, setMonthDefaultRange] = useState([]);
3751
+ const [scrollTop, setScrollTop] = useState(0);
3741
3752
  const [state] = useState({
3742
3753
  currDate: "",
3743
3754
  propStartDate: "",
@@ -4034,7 +4045,7 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
4034
4045
  setMonthDefaultRange([start2, end]);
4035
4046
  setTranslateY(state.monthsData[start2].cssScrollHeight);
4036
4047
  };
4037
- const mothsViewScroll = (e2) => {
4048
+ const monthsViewScroll = (e2) => {
4038
4049
  if (state.monthsData.length <= 1) {
4039
4050
  return;
4040
4051
  }
@@ -4234,11 +4245,13 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
4234
4245
  clearInterval(interval);
4235
4246
  if (months.current) {
4236
4247
  months.current.scrollTop = state.monthsData[index].cssScrollHeight;
4248
+ setScrollTop(months.current.scrollTop);
4237
4249
  }
4238
4250
  }
4239
4251
  }, 40);
4240
4252
  } else {
4241
4253
  months.current.scrollTop = state.monthsData[index].cssScrollHeight;
4254
+ setScrollTop(months.current.scrollTop);
4242
4255
  }
4243
4256
  }
4244
4257
  }
@@ -4269,9 +4282,12 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
4269
4282
  }, weeks.map((item) => /* @__PURE__ */ React__default.createElement("div", {
4270
4283
  className: "calendar-week-item",
4271
4284
  key: item
4272
- }, item)))), /* @__PURE__ */ React__default.createElement("div", {
4285
+ }, item)))), /* @__PURE__ */ React__default.createElement(index_cjs.ScrollView, {
4286
+ scrollTop,
4287
+ scrollY: true,
4288
+ scrollWithAnimation: true,
4273
4289
  className: "nut-calendar-content",
4274
- onScroll: mothsViewScroll,
4290
+ onScroll: monthsViewScroll,
4275
4291
  ref: months
4276
4292
  }, /* @__PURE__ */ React__default.createElement("div", {
4277
4293
  className: "calendar-months-panel",
@@ -4931,6 +4947,7 @@ const InternalCascader = (props, ref) => {
4931
4947
  const Cascader = React__default.forwardRef(InternalCascader);
4932
4948
  Cascader.defaultProps = defaultProps$11;
4933
4949
  Cascader.displayName = "NutCascader";
4950
+ const CheckboxGroupContext = createContext(null);
4934
4951
  const defaultProps$10 = {
4935
4952
  disabled: false,
4936
4953
  checkedValue: [],
@@ -4956,8 +4973,6 @@ const CheckboxGroup = React__default.forwardRef(
4956
4973
  options,
4957
4974
  ...rest
4958
4975
  } = props;
4959
- const [innerDisabled, setInnerDisabled] = useState(disabled);
4960
- const [innerValue, setInnerValue] = useState(checkedValue);
4961
4976
  useImperativeHandle(ref, () => ({
4962
4977
  toggleAll(state) {
4963
4978
  if (state === false) {
@@ -4983,75 +4998,41 @@ const CheckboxGroup = React__default.forwardRef(
4983
4998
  setInnerValue(reverse);
4984
4999
  }
4985
5000
  }));
5001
+ const [innerValue, setInnerValue] = useState(checkedValue || []);
4986
5002
  useEffect(() => {
4987
- setInnerDisabled(disabled);
4988
- setInnerValue(checkedValue);
4989
- }, [disabled, checkedValue]);
4990
- function handleChildChange(state, label) {
4991
- if (max !== void 0 && innerValue && innerValue.length > max)
4992
- return;
4993
- if (innerValue) {
4994
- let clippedValue = [];
4995
- if (state) {
4996
- clippedValue = [...innerValue, label];
4997
- } else {
4998
- innerValue == null ? void 0 : innerValue.splice(innerValue == null ? void 0 : innerValue.indexOf(label), 1);
4999
- clippedValue = [...innerValue];
5000
- }
5001
- setInnerValue(clippedValue);
5002
- onChange && onChange(clippedValue);
5003
- }
5004
- }
5005
- function validateChildChecked(child) {
5006
- if (!innerValue)
5007
- return false;
5008
- return (innerValue == null ? void 0 : innerValue.indexOf(child.props.label || child.children)) > -1;
5009
- }
5010
- function validateChecked(value) {
5011
- if (!innerValue)
5012
- return false;
5013
- return (innerValue == null ? void 0 : innerValue.indexOf(value)) > -1;
5014
- }
5015
- function getParentVals() {
5016
- return innerValue;
5017
- }
5018
- function cloneChildren() {
5019
- return React__default.Children.map(children, (child) => {
5020
- const childChecked = validateChildChecked(child);
5021
- if (child.type.displayName !== "NutCheckBox") {
5022
- return React__default.cloneElement(child);
5023
- }
5024
- return React__default.cloneElement(child, {
5025
- disabled: innerDisabled,
5026
- checked: childChecked,
5027
- onChange: handleChildChange,
5028
- getParentVals,
5029
- max,
5030
- textPosition
5031
- });
5032
- });
5033
- }
5034
- const renderOptionsChildren = useCallback(() => {
5003
+ setInnerValue(checkedValue || []);
5004
+ }, [checkedValue]);
5005
+ const renderOptions = useCallback(() => {
5035
5006
  return options == null ? void 0 : options.map(({ label, value, disabled: disabled2, onChange: onChange2, ...rest2 }) => {
5036
- const childChecked = validateChecked(value);
5037
5007
  return /* @__PURE__ */ React__default.createElement(Checkbox, {
5038
5008
  key: value == null ? void 0 : value.toString(),
5039
5009
  children: label,
5040
5010
  label: value,
5041
- disabled: innerDisabled ? true : disabled2,
5042
- onChange: handleChildChange,
5043
- ...rest2,
5044
- max,
5045
- textPosition,
5046
- getParentVals,
5047
- checked: childChecked
5011
+ ...rest2
5048
5012
  });
5049
5013
  });
5050
- }, [innerValue, options, innerDisabled, max]);
5051
- return /* @__PURE__ */ React__default.createElement("div", {
5014
+ }, [options, max]);
5015
+ return /* @__PURE__ */ React__default.createElement(CheckboxGroupContext.Provider, {
5016
+ value: {
5017
+ textPosition: textPosition || "left",
5018
+ disabled,
5019
+ max,
5020
+ checkedValue: innerValue || [],
5021
+ check: (value) => {
5022
+ const combined = [...innerValue, value];
5023
+ setInnerValue(combined);
5024
+ onChange && onChange(combined);
5025
+ },
5026
+ uncheck: (value) => {
5027
+ const reduced = innerValue.filter((item) => item !== value);
5028
+ setInnerValue(reduced);
5029
+ onChange && onChange(reduced);
5030
+ }
5031
+ }
5032
+ }, /* @__PURE__ */ React__default.createElement("div", {
5052
5033
  className: `${b2()} nut-checkboxgroup--${props.direction} ${className || ""}`,
5053
5034
  ...rest
5054
- }, (options == null ? void 0 : options.length) ? renderOptionsChildren() : cloneChildren());
5035
+ }, (options == null ? void 0 : options.length) ? renderOptions() : children));
5055
5036
  }
5056
5037
  );
5057
5038
  CheckboxGroup.defaultProps = defaultProps$10;
@@ -5081,7 +5062,6 @@ const Checkbox = (props) => {
5081
5062
  iconSize,
5082
5063
  label,
5083
5064
  className,
5084
- textPosition,
5085
5065
  iconActiveName,
5086
5066
  checked,
5087
5067
  disabled,
@@ -5090,20 +5070,33 @@ const Checkbox = (props) => {
5090
5070
  iconClassPrefix,
5091
5071
  iconFontClassName,
5092
5072
  iconIndeterminateName,
5093
- getParentVals,
5094
- max,
5095
- ...rest
5073
+ ...others
5096
5074
  } = props;
5097
- const [innerChecked, setInnerChecked] = useState(checked);
5098
- const [innerDisabled, setDisabled] = useState(disabled);
5075
+ let { textPosition, ...rest } = others;
5076
+ const ctx2 = useContext(CheckboxGroupContext);
5077
+ let [innerChecked, setInnerChecked] = useState(checked);
5078
+ let [innerDisabled, setDisabled] = useState(disabled);
5099
5079
  const [_indeterminate, setIndeterminate] = useState(indeterminate);
5100
5080
  useEffect(() => {
5101
- setInnerChecked(checked);
5081
+ !ctx2 && setInnerChecked(checked);
5102
5082
  setDisabled(disabled);
5103
- }, [disabled, checked]);
5104
- useEffect(() => {
5105
5083
  setIndeterminate(indeterminate);
5106
- }, [indeterminate]);
5084
+ }, [disabled, checked, indeterminate]);
5085
+ if (ctx2) {
5086
+ if (ctx2.textPosition !== void 0) {
5087
+ textPosition = ctx2.textPosition;
5088
+ }
5089
+ innerDisabled = ctx2.disabled;
5090
+ innerChecked = ctx2.checkedValue.includes(label);
5091
+ setInnerChecked = (checked2) => {
5092
+ if (ctx2.disabled)
5093
+ return;
5094
+ if (checked2)
5095
+ ctx2.check(label);
5096
+ if (!checked2)
5097
+ ctx2.uncheck(label);
5098
+ };
5099
+ }
5107
5100
  const getIconName = () => {
5108
5101
  if (!innerChecked) {
5109
5102
  return iconName;
@@ -5140,13 +5133,15 @@ const Checkbox = (props) => {
5140
5133
  }, children || label);
5141
5134
  };
5142
5135
  const handleClick = () => {
5143
- if (!disabled) {
5144
- const latest = !innerChecked;
5145
- if (max !== void 0 && latest && getParentVals().length >= max)
5136
+ if (disabled)
5137
+ return;
5138
+ const latestChecked = !innerChecked;
5139
+ if (ctx2 && ctx2.max !== void 0) {
5140
+ if (latestChecked && ctx2.checkedValue.length >= ctx2.max)
5146
5141
  return;
5147
- onChange && onChange(latest, label || children);
5148
- setInnerChecked(latest);
5149
5142
  }
5143
+ onChange && onChange(latestChecked, label || children);
5144
+ setInnerChecked(latestChecked);
5150
5145
  };
5151
5146
  return /* @__PURE__ */ React__default.createElement("div", {
5152
5147
  className: `${b2({ reverse: textPosition === "left" })} ${className || ""}`,
@@ -5663,6 +5658,19 @@ const InternalPicker = (props, ref) => {
5663
5658
  }))));
5664
5659
  };
5665
5660
  const Picker = React__default.forwardRef(InternalPicker);
5661
+ const defaultConfigRef = {
5662
+ current: {
5663
+ locale: zhCN
5664
+ }
5665
+ };
5666
+ const getDefaultConfig = () => {
5667
+ return defaultConfigRef.current;
5668
+ };
5669
+ const ConfigContext = createContext(null);
5670
+ const useConfig = () => {
5671
+ var _a;
5672
+ return (_a = useContext(ConfigContext)) != null ? _a : getDefaultConfig();
5673
+ };
5666
5674
  const currentYear = new Date().getFullYear();
5667
5675
  const defaultProps$_ = {
5668
5676
  modelValue: null,
@@ -5698,6 +5706,7 @@ const DatePicker = (props) => {
5698
5706
  ...defaultProps$_,
5699
5707
  ...props
5700
5708
  };
5709
+ const { locale } = useConfig();
5701
5710
  const [show, setShow] = useState(false);
5702
5711
  const [currentDate, setCurrentDate] = useState(modelValue);
5703
5712
  const [defaultValue, setDefaultValue] = useState([]);
@@ -5706,13 +5715,14 @@ const DatePicker = (props) => {
5706
5715
  const isDate = (val) => {
5707
5716
  return Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
5708
5717
  };
5718
+ const datepickerLang = locale.datepicker;
5709
5719
  const zhCNType = {
5710
- day: "\u65E5",
5711
- year: "\u5E74",
5712
- month: "\u6708",
5713
- hour: "\u65F6",
5714
- minute: "\u5206",
5715
- seconds: "\u79D2"
5720
+ day: datepickerLang.day,
5721
+ year: datepickerLang.year,
5722
+ month: datepickerLang.month,
5723
+ hour: datepickerLang.hour,
5724
+ minute: datepickerLang.min,
5725
+ seconds: datepickerLang.seconds
5716
5726
  };
5717
5727
  const formatValue = (value) => {
5718
5728
  let cvalue = value;
@@ -5763,7 +5773,6 @@ const DatePicker = (props) => {
5763
5773
  };
5764
5774
  const ranges = (date) => {
5765
5775
  const curDate = date || currentDate;
5766
- console.log(11, currentDate);
5767
5776
  if (!curDate)
5768
5777
  return [];
5769
5778
  const { maxYear, maxDate: maxDate2, maxMonth, maxHour, maxMinute, maxSeconds } = getBoundary("max", curDate);
@@ -5950,6 +5959,7 @@ const DatePicker = (props) => {
5950
5959
  style,
5951
5960
  ...rest
5952
5961
  }, listData.length > 0 && /* @__PURE__ */ React__default.createElement(Picker, {
5962
+ title,
5953
5963
  isVisible: show,
5954
5964
  listData,
5955
5965
  onClose: onCloseDatePicker,
@@ -7793,7 +7803,7 @@ const Rate = (props) => {
7793
7803
  onChange && onChange(value);
7794
7804
  };
7795
7805
  return /* @__PURE__ */ React__default.createElement("div", {
7796
- className: `${b2()} ${className}`,
7806
+ className: classNames(b2(), className),
7797
7807
  style
7798
7808
  }, countArray.map((n) => {
7799
7809
  return /* @__PURE__ */ React__default.createElement("div", {
@@ -7805,7 +7815,9 @@ const Rate = (props) => {
7805
7815
  classPrefix: iconClassPrefix,
7806
7816
  fontClassName: iconFontClassName,
7807
7817
  size: iconSize,
7808
- className: `${bi("icon")} ${disabled || n > score ? bi("icon--disabled") : ""}`,
7818
+ className: classNames(bi("icon"), {
7819
+ [bi("icon--disabled")]: disabled || n > score
7820
+ }),
7809
7821
  name: n <= score ? checkedIcon : uncheckedIcon,
7810
7822
  color: n <= score ? activeColor : voidColor
7811
7823
  }), allowHalf && score > n - 1 && /* @__PURE__ */ React__default.createElement(Icon, {
@@ -8480,57 +8492,98 @@ class Upload {
8480
8492
  console.warn("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 XMLHttpRequest");
8481
8493
  }
8482
8494
  }
8495
+ }
8496
+ class UploaderTaro extends Upload {
8497
+ constructor(options) {
8498
+ super(options);
8499
+ }
8483
8500
  uploadTaro(uploadFile2, env) {
8484
8501
  var _a;
8485
8502
  const options = this.options;
8486
8503
  if (env === "WEB") {
8487
8504
  this.upload();
8488
- } else if (options.beforeXhrUpload) {
8489
- options.beforeXhrUpload(uploadFile2, options);
8490
8505
  } else {
8491
- const uploadTask = uploadFile2({
8492
- url: options.url,
8493
- filePath: options.taroFilePath,
8494
- fileType: options.fileType,
8495
- header: {
8496
- "Content-Type": "multipart/form-data",
8497
- ...options.headers
8498
- },
8499
- formData: options.formData,
8500
- name: options.name,
8501
- success(response) {
8502
- var _a2, _b;
8503
- if (options.xhrState == response.statusCode) {
8504
- (_a2 = options.onSuccess) == null ? void 0 : _a2.call(options, response, options);
8505
- } else {
8506
- (_b = options.onFailure) == null ? void 0 : _b.call(options, response, options);
8506
+ if (options.beforeXhrUpload) {
8507
+ options.beforeXhrUpload(uploadFile2, options);
8508
+ } else {
8509
+ const uploadTask = uploadFile2({
8510
+ url: options.url,
8511
+ filePath: options.taroFilePath,
8512
+ fileType: options.fileType,
8513
+ header: {
8514
+ "Content-Type": "multipart/form-data",
8515
+ ...options.headers
8516
+ },
8517
+ formData: options.formData,
8518
+ name: options.name,
8519
+ success(response) {
8520
+ var _a2, _b;
8521
+ if (options.xhrState == response.statusCode) {
8522
+ (_a2 = options.onSuccess) == null ? void 0 : _a2.call(options, response, options);
8523
+ } else {
8524
+ (_b = options.onFailure) == null ? void 0 : _b.call(options, response, options);
8525
+ }
8526
+ },
8527
+ fail(e2) {
8528
+ var _a2;
8529
+ (_a2 = options.onFailure) == null ? void 0 : _a2.call(options, e2, options);
8507
8530
  }
8508
- },
8509
- fail(e2) {
8510
- var _a2;
8511
- (_a2 = options.onFailure) == null ? void 0 : _a2.call(options, e2, options);
8531
+ });
8532
+ (_a = options.onStart) == null ? void 0 : _a.call(options, options);
8533
+ uploadTask.progress(
8534
+ (res) => {
8535
+ var _a2;
8536
+ (_a2 = options.onProgress) == null ? void 0 : _a2.call(options, res, options);
8537
+ }
8538
+ );
8539
+ }
8540
+ }
8541
+ }
8542
+ }
8543
+ const isObject = (val) => val !== null && typeof val === "object";
8544
+ const isFunction = (val) => typeof val === "function";
8545
+ const isPromise = (val) => {
8546
+ return isObject(val) && isFunction(val.then) && isFunction(val.catch);
8547
+ };
8548
+ const funcInterceptor = (interceptor, {
8549
+ args = [],
8550
+ done,
8551
+ canceled
8552
+ }) => {
8553
+ if (interceptor) {
8554
+ const returnVal = interceptor.apply(null, args);
8555
+ if (isPromise(returnVal)) {
8556
+ returnVal.then((value) => {
8557
+ if (value) {
8558
+ done(value);
8559
+ } else if (canceled) {
8560
+ canceled();
8512
8561
  }
8562
+ }).catch(() => {
8513
8563
  });
8514
- (_a = options.onStart) == null ? void 0 : _a.call(options, options);
8515
- uploadTask.progress(
8516
- (res) => {
8517
- var _a2;
8518
- (_a2 = options.onProgress) == null ? void 0 : _a2.call(options, res, options);
8519
- }
8520
- );
8564
+ } else if (returnVal) {
8565
+ done();
8566
+ } else if (canceled) {
8567
+ canceled();
8521
8568
  }
8569
+ } else {
8570
+ done();
8522
8571
  }
8523
- }
8572
+ };
8524
8573
  const defaultProps$K = {
8525
8574
  ...ComponentDefaults,
8526
8575
  url: "",
8527
- maximum: 9,
8576
+ maximum: 1,
8528
8577
  sizeType: ["original", "compressed"],
8529
8578
  sourceType: ["album", "camera"],
8579
+ mediaType: ["image", "video"],
8580
+ camera: "back",
8530
8581
  uploadIcon: "photograph",
8531
8582
  uploadIconSize: "",
8583
+ uploadIconTip: "",
8532
8584
  listType: "picture",
8533
8585
  name: "file",
8586
+ accept: "*",
8534
8587
  disabled: false,
8535
8588
  autoUpload: true,
8536
8589
  multiple: false,
@@ -8543,6 +8596,7 @@ const defaultProps$K = {
8543
8596
  timeout: 1e3 * 30,
8544
8597
  isPreview: true,
8545
8598
  isDeletable: true,
8599
+ maxDuration: 10,
8546
8600
  onBeforeDelete: (file, files) => {
8547
8601
  return true;
8548
8602
  }
@@ -8562,10 +8616,14 @@ const InternalUploader = (props, ref) => {
8562
8616
  children,
8563
8617
  uploadIcon,
8564
8618
  uploadIconSize,
8619
+ uploadIconTip,
8620
+ accept,
8565
8621
  name,
8622
+ camera,
8566
8623
  defaultFileList,
8567
8624
  listType,
8568
8625
  disabled,
8626
+ multiple,
8569
8627
  url,
8570
8628
  defaultImg,
8571
8629
  headers,
@@ -8577,11 +8635,14 @@ const InternalUploader = (props, ref) => {
8577
8635
  isDeletable,
8578
8636
  maximum,
8579
8637
  maximize,
8580
- multiple,
8638
+ mediaType,
8581
8639
  className,
8582
8640
  autoUpload,
8583
8641
  sizeType,
8584
8642
  sourceType,
8643
+ maxDuration,
8644
+ iconClassPrefix,
8645
+ iconFontClassName,
8585
8646
  onStart,
8586
8647
  onRemove,
8587
8648
  onChange,
@@ -8591,7 +8652,6 @@ const InternalUploader = (props, ref) => {
8591
8652
  onUpdate,
8592
8653
  onFailure,
8593
8654
  onOversize,
8594
- onBeforeUpload,
8595
8655
  onBeforeXhrUpload,
8596
8656
  onBeforeDelete,
8597
8657
  ...restProps
@@ -8610,6 +8670,9 @@ const InternalUploader = (props, ref) => {
8610
8670
  Promise.all(uploadQueue).then((res) => {
8611
8671
  res.forEach((i) => i.uploadTaro(uploadFile, getEnv()));
8612
8672
  });
8673
+ },
8674
+ clear: () => {
8675
+ clearUploadQueue();
8613
8676
  }
8614
8677
  }));
8615
8678
  const clearUploadQueue = (index = -1) => {
@@ -8618,18 +8681,54 @@ const InternalUploader = (props, ref) => {
8618
8681
  setUploadQueue(uploadQueue);
8619
8682
  } else {
8620
8683
  setUploadQueue([]);
8684
+ fileList.splice(0, fileList.length);
8685
+ setFileList([...fileList]);
8621
8686
  }
8622
8687
  };
8623
8688
  const _chooseImage = () => {
8624
8689
  if (disabled) {
8625
8690
  return;
8626
8691
  }
8627
- chooseImage({
8628
- count: multiple ? maximum * 1 - fileList.length : 1,
8629
- sizeType,
8630
- sourceType,
8631
- success: onChangeFn
8632
- });
8692
+ if (Taro.getEnv() == "WEB") {
8693
+ let el = document.getElementById("taroChooseImage");
8694
+ if (el) {
8695
+ el == null ? void 0 : el.setAttribute("accept", accept);
8696
+ } else {
8697
+ const obj = document.createElement("input");
8698
+ obj.setAttribute("type", "file");
8699
+ obj.setAttribute("id", "taroChooseImage");
8700
+ obj.setAttribute("accept", accept);
8701
+ obj.setAttribute(
8702
+ "style",
8703
+ "position: fixed; top: -4000px; left: -3000px; z-index: -300;"
8704
+ );
8705
+ document.body.appendChild(obj);
8706
+ }
8707
+ }
8708
+ if (getEnv() == "WEAPP") {
8709
+ chooseMedia({
8710
+ count: multiple ? maximum * 1 - fileList.length : 1,
8711
+ mediaType,
8712
+ sourceType,
8713
+ maxDuration,
8714
+ sizeType: [],
8715
+ camera,
8716
+ fail: (res) => {
8717
+ onFailure && onFailure(res);
8718
+ },
8719
+ success: onChangeMedia
8720
+ });
8721
+ } else {
8722
+ chooseImage({
8723
+ count: multiple ? maximum * 1 - fileList.length : 1,
8724
+ sizeType,
8725
+ sourceType,
8726
+ success: onChangeImage,
8727
+ fail: (res) => {
8728
+ onFailure && onFailure(res);
8729
+ }
8730
+ });
8731
+ }
8633
8732
  };
8634
8733
  const executeUpload = (fileItem, index) => {
8635
8734
  const uploadOption = new UploadOptions();
@@ -8682,7 +8781,8 @@ const InternalUploader = (props, ref) => {
8682
8781
  });
8683
8782
  onSuccess && onSuccess({
8684
8783
  responseText,
8685
- option
8784
+ option,
8785
+ fileList
8686
8786
  });
8687
8787
  };
8688
8788
  uploadOption.onFailure = (responseText, option) => {
@@ -8697,10 +8797,11 @@ const InternalUploader = (props, ref) => {
8697
8797
  });
8698
8798
  onFailure && onFailure({
8699
8799
  responseText,
8700
- option
8800
+ option,
8801
+ fileList
8701
8802
  });
8702
8803
  };
8703
- const task = new Upload(uploadOption);
8804
+ const task = new UploaderTaro(uploadOption);
8704
8805
  if (props.autoUpload) {
8705
8806
  task.uploadTaro(uploadFile, getEnv());
8706
8807
  } else {
@@ -8713,20 +8814,28 @@ const InternalUploader = (props, ref) => {
8713
8814
  }
8714
8815
  };
8715
8816
  const readFile = (files) => {
8716
- const imgReg = /\.(png|jpeg|jpg|webp|gif)$/i;
8717
8817
  files.forEach((file, index) => {
8718
8818
  var _a, _b;
8719
- console.log("file", file);
8720
8819
  let fileType = file.type;
8820
+ let filepath = file.tempFilePath || file.path;
8721
8821
  const fileItem = new FileItem();
8722
- if (!fileType && imgReg.test(file.path)) {
8723
- fileType = "image";
8822
+ if (file.fileType) {
8823
+ fileType = file.fileType;
8824
+ } else {
8825
+ const imgReg = /\.(png|jpeg|jpg|webp|gif)$/i;
8826
+ if (!fileType && (imgReg.test(filepath) || filepath.includes("data:image"))) {
8827
+ fileType = "image";
8828
+ }
8724
8829
  }
8725
- fileItem.path = file.path;
8726
- fileItem.name = file.path;
8830
+ fileItem.path = filepath;
8831
+ fileItem.name = filepath;
8727
8832
  fileItem.status = "ready";
8728
- fileItem.message = locale.uploader.readyUpload;
8729
8833
  fileItem.type = fileType;
8834
+ if (autoUpload) {
8835
+ fileItem.message = locale.uploader.readyUpload;
8836
+ } else {
8837
+ fileItem.message = locale.uploader.waitingUpload;
8838
+ }
8730
8839
  if (getEnv() === "WEB") {
8731
8840
  const formData = new FormData();
8732
8841
  for (const [key, value] of Object.entries(data)) {
@@ -8740,7 +8849,7 @@ const InternalUploader = (props, ref) => {
8740
8849
  fileItem.formData = data;
8741
8850
  }
8742
8851
  if (isPreview) {
8743
- fileItem.url = file.path;
8852
+ fileItem.url = fileType == "video" ? file.thumbTempFilePath : filepath;
8744
8853
  }
8745
8854
  fileList.push(fileItem);
8746
8855
  setFileList([...fileList]);
@@ -8767,27 +8876,28 @@ const InternalUploader = (props, ref) => {
8767
8876
  }
8768
8877
  return filterFile;
8769
8878
  };
8879
+ const deleted = (file, index) => {
8880
+ fileList.splice(index, 1);
8881
+ onRemove && onRemove(file, fileList);
8882
+ setFileList([...fileList]);
8883
+ };
8770
8884
  const onDelete = (file, index) => {
8771
8885
  clearUploadQueue(index);
8772
- if (onBeforeDelete && onBeforeDelete(file, fileList)) {
8773
- fileList.splice(index, 1);
8774
- onRemove && onRemove(file, fileList);
8775
- setFileList([...fileList]);
8776
- } else {
8777
- console.log(locale.uploader.deleteWord);
8778
- }
8886
+ funcInterceptor(onBeforeDelete, {
8887
+ args: [file, fileList],
8888
+ done: () => deleted(file, index)
8889
+ });
8779
8890
  };
8780
- const onChangeFn = (res) => {
8891
+ const onChangeMedia = (res) => {
8781
8892
  const { tempFiles } = res;
8782
- if (onBeforeUpload) {
8783
- onBeforeUpload(tempFiles).then((f) => {
8784
- const _files = filterFiles(f);
8785
- readFile(_files);
8786
- });
8787
- } else {
8788
- const _files = filterFiles(tempFiles);
8789
- readFile(_files);
8790
- }
8893
+ const _files = filterFiles(tempFiles);
8894
+ readFile(_files);
8895
+ onChange && onChange({ fileList });
8896
+ };
8897
+ const onChangeImage = (res) => {
8898
+ const { tempFiles } = res;
8899
+ const _files = filterFiles(tempFiles);
8900
+ readFile(_files);
8791
8901
  onChange && onChange({ fileList });
8792
8902
  };
8793
8903
  const handleItemClick = (file) => {
@@ -8807,35 +8917,35 @@ const InternalUploader = (props, ref) => {
8807
8917
  key: item.uid
8808
8918
  }, listType === "picture" && !children && /* @__PURE__ */ React__default.createElement("div", {
8809
8919
  className: "nut-uploader__preview-img"
8810
- }, item.status === "ready" ? /* @__PURE__ */ React__default.createElement("div", {
8920
+ }, isDeletable && /* @__PURE__ */ React__default.createElement(Icon$1, {
8921
+ classPrefix: iconClassPrefix,
8922
+ fontClassName: iconFontClassName,
8923
+ color: "rgba(0,0,0,0.6)",
8924
+ className: "close",
8925
+ name: "failure",
8926
+ onClick: () => onDelete(item, index)
8927
+ }), item.status === "ready" ? /* @__PURE__ */ React__default.createElement("div", {
8811
8928
  className: "nut-uploader__preview__progress"
8812
8929
  }, /* @__PURE__ */ React__default.createElement("div", {
8813
8930
  className: "nut-uploader__preview__progress__msg"
8814
8931
  }, item.message)) : item.status !== "success" && /* @__PURE__ */ React__default.createElement("div", {
8815
8932
  className: "nut-uploader__preview__progress"
8816
- }, /* @__PURE__ */ React__default.createElement(Icon$1, {
8817
- classPrefix: props.iconClassPrefix,
8818
- fontClassName: props.iconFontClassName,
8933
+ }, item.failIcon === " " || item.loadingIcon === " " ? null : /* @__PURE__ */ React__default.createElement(Icon$1, {
8934
+ classPrefix: iconClassPrefix,
8935
+ fontClassName: iconFontClassName,
8819
8936
  color: "#fff",
8820
- name: `${item.status === "error" ? "failure" : "loading"}`
8937
+ name: `${item.status === "error" ? `${item.failIcon || "failure"}` : `${item.loadingIcon || "loading"}`}`
8821
8938
  }), /* @__PURE__ */ React__default.createElement("div", {
8822
8939
  className: "nut-uploader__preview__progress__msg"
8823
- }, item.message)), isDeletable && /* @__PURE__ */ React__default.createElement(Icon$1, {
8824
- classPrefix: props.iconClassPrefix,
8825
- fontClassName: props.iconFontClassName,
8826
- color: "rgba(0,0,0,0.6)",
8827
- className: "close",
8828
- name: "failure",
8829
- onClick: () => onDelete(item, index)
8830
- }), item.type.includes("image") ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.url && /* @__PURE__ */ React__default.createElement("img", {
8940
+ }, item.message)), item.type.includes("image") ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.url && /* @__PURE__ */ React__default.createElement(index_cjs.Image, {
8831
8941
  className: "nut-uploader__preview-img__c",
8942
+ mode: "aspectFit",
8832
8943
  src: item.url,
8833
- alt: "",
8834
8944
  onClick: () => handleItemClick(item)
8835
- })) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, defaultImg ? /* @__PURE__ */ React__default.createElement("img", {
8945
+ })) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, defaultImg ? /* @__PURE__ */ React__default.createElement(index_cjs.Image, {
8836
8946
  className: "nut-uploader__preview-img__c",
8947
+ mode: "aspectFit",
8837
8948
  src: defaultImg,
8838
- alt: "",
8839
8949
  onClick: () => handleItemClick(item)
8840
8950
  }) : /* @__PURE__ */ React__default.createElement("div", {
8841
8951
  className: "nut-uploader__preview-img__file"
@@ -8843,24 +8953,24 @@ const InternalUploader = (props, ref) => {
8843
8953
  onClick: () => handleItemClick(item),
8844
8954
  className: "nut-uploader__preview-img__file__name"
8845
8955
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
8846
- classPrefix: props.iconClassPrefix,
8847
- fontClassName: props.iconFontClassName,
8956
+ classPrefix: iconClassPrefix,
8957
+ fontClassName: iconFontClassName,
8848
8958
  color: "#808080",
8849
8959
  name: "link"
8850
- }), "\xA0", item.name))), /* @__PURE__ */ React__default.createElement("div", {
8960
+ }), "\xA0", item.name))), item.status === "success" ? /* @__PURE__ */ React__default.createElement("div", {
8851
8961
  className: "tips"
8852
- }, item.name)), listType === "list" && /* @__PURE__ */ React__default.createElement("div", {
8962
+ }, item.name) : null), listType === "list" && /* @__PURE__ */ React__default.createElement("div", {
8853
8963
  className: "nut-uploader__preview-list"
8854
8964
  }, /* @__PURE__ */ React__default.createElement("div", {
8855
8965
  className: `nut-uploader__preview-img__file__name ${item.status}`,
8856
8966
  onClick: () => handleItemClick(item)
8857
8967
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
8858
- classPrefix: props.iconClassPrefix,
8859
- fontClassName: props.iconFontClassName,
8968
+ classPrefix: iconClassPrefix,
8969
+ fontClassName: iconFontClassName,
8860
8970
  name: "link"
8861
8971
  }), "\xA0", item.name), isDeletable && /* @__PURE__ */ React__default.createElement(Icon$1, {
8862
- classPrefix: props.iconClassPrefix,
8863
- fontClassName: props.iconFontClassName,
8972
+ classPrefix: iconClassPrefix,
8973
+ fontClassName: iconFontClassName,
8864
8974
  color: "#808080",
8865
8975
  className: "nut-uploader__preview-img__file__del",
8866
8976
  name: "del",
@@ -8872,14 +8982,18 @@ const InternalUploader = (props, ref) => {
8872
8982
  showText: false
8873
8983
  })));
8874
8984
  }), maximum > fileList.length && listType === "picture" && !children && /* @__PURE__ */ React__default.createElement("div", {
8875
- className: `nut-uploader__upload ${listType}`
8985
+ className: `nut-uploader__upload ${listType} ${disabled ? "nut-uploader__upload-disabled" : ""}`
8986
+ }, /* @__PURE__ */ React__default.createElement("div", {
8987
+ className: "nut-uploader__icon"
8876
8988
  }, /* @__PURE__ */ React__default.createElement(Icon$1, {
8877
- classPrefix: props.iconClassPrefix,
8878
- fontClassName: props.iconFontClassName,
8989
+ classPrefix: iconClassPrefix,
8990
+ fontClassName: iconFontClassName,
8879
8991
  size: uploadIconSize,
8880
8992
  color: "#808080",
8881
8993
  name: uploadIcon
8882
- }), /* @__PURE__ */ React__default.createElement(Button, {
8994
+ }), /* @__PURE__ */ React__default.createElement("span", {
8995
+ className: "nut-uploader__icon-tip"
8996
+ }, uploadIconTip)), /* @__PURE__ */ React__default.createElement(Button, {
8883
8997
  className: "nut-uploader__input",
8884
8998
  onClick: _chooseImage
8885
8999
  })));
@@ -14435,7 +14549,7 @@ const Swipe = forwardRef((props, instanceRef) => {
14435
14549
  }, []);
14436
14550
  return /* @__PURE__ */ React__default.createElement("div", {
14437
14551
  ref: root2,
14438
- className: `${swipeBem()} ${className}`,
14552
+ className: classNames(swipeBem(), className),
14439
14553
  onTouchStart: (e2) => onTouchStart(e2),
14440
14554
  onTouchMove: (e2) => onTouchMove(e2),
14441
14555
  onTouchEnd: (e2) => onTouchEnd(e2),
@@ -14663,7 +14777,7 @@ class AnimatingNumbers extends Component {
14663
14777
  AnimatingNumbers.defaultProps = defaultProps$y;
14664
14778
  AnimatingNumbers.displayName = "NutAnimatingNumbers";
14665
14779
  AnimatingNumbers.CountUp = CountUp;
14666
- const b = cn("audio");
14780
+ const b$1 = cn("audio");
14667
14781
  const warn = console.warn;
14668
14782
  const defaultProps$x = {
14669
14783
  ...ComponentDefaults,
@@ -14798,9 +14912,9 @@ const Audio = (props) => {
14798
14912
  };
14799
14913
  const renderIcon = () => {
14800
14914
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
14801
- className: b("icon")
14915
+ className: b$1("icon")
14802
14916
  }, /* @__PURE__ */ React__default.createElement("div", {
14803
- className: `${b("icon-box")} ${playing ? b("icon-play") : b("icon-stop")}`,
14917
+ className: `${b$1("icon-box")} ${playing ? b$1("icon-play") : b$1("icon-stop")}`,
14804
14918
  onClick: handleStatusChange
14805
14919
  }, playing ? /* @__PURE__ */ React__default.createElement(Icon$1, {
14806
14920
  classPrefix: iconClassPrefix,
@@ -14815,11 +14929,11 @@ const Audio = (props) => {
14815
14929
  };
14816
14930
  const renderProgerss = () => {
14817
14931
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
14818
- className: b("progress")
14932
+ className: b$1("progress")
14819
14933
  }, /* @__PURE__ */ React__default.createElement("div", {
14820
14934
  className: "time"
14821
14935
  }, currentDuration), /* @__PURE__ */ React__default.createElement("div", {
14822
- className: b("progress-bar-wrapper")
14936
+ className: b$1("progress-bar-wrapper")
14823
14937
  }, /* @__PURE__ */ React__default.createElement(Range, {
14824
14938
  modelValue: percent,
14825
14939
  hiddenTag: true,
@@ -14848,7 +14962,7 @@ const Audio = (props) => {
14848
14962
  };
14849
14963
  const renderNone = () => {
14850
14964
  return /* @__PURE__ */ React__default.createElement("div", {
14851
- className: b("none-container"),
14965
+ className: b$1("none-container"),
14852
14966
  onClick: handleStatusChange
14853
14967
  }, children);
14854
14968
  };
@@ -14865,7 +14979,7 @@ const Audio = (props) => {
14865
14979
  }
14866
14980
  };
14867
14981
  return /* @__PURE__ */ React__default.createElement("div", {
14868
- className: `${b()} ${className}`,
14982
+ className: `${b$1()} ${className}`,
14869
14983
  style,
14870
14984
  ...rest
14871
14985
  }, renderAudio());
@@ -14988,19 +15102,6 @@ const Avatar = (props) => {
14988
15102
  };
14989
15103
  Avatar.defaultProps = defaultProps$w;
14990
15104
  Avatar.displayName = "NutAvatar";
14991
- const defaultConfigRef = {
14992
- current: {
14993
- locale: zhCN
14994
- }
14995
- };
14996
- const getDefaultConfig = () => {
14997
- return defaultConfigRef.current;
14998
- };
14999
- const ConfigContext = createContext(null);
15000
- const useConfig = () => {
15001
- var _a;
15002
- return (_a = useContext(ConfigContext)) != null ? _a : getDefaultConfig();
15003
- };
15004
15105
  const defaultProps$v = {
15005
15106
  maxContent: "",
15006
15107
  maxCount: "",
@@ -15032,6 +15133,7 @@ const AvatarGroup = (props) => {
15032
15133
  };
15033
15134
  AvatarGroup.defaultProps = defaultProps$v;
15034
15135
  AvatarGroup.displayName = "NutAvatarGroup";
15136
+ const b = cn("badge");
15035
15137
  const defaultProps$u = {
15036
15138
  ...ComponentDefaults,
15037
15139
  className: "",
@@ -15080,7 +15182,7 @@ const Badge = (props) => {
15080
15182
  return style2;
15081
15183
  };
15082
15184
  return /* @__PURE__ */ React__default.createElement("div", {
15083
- className: `nut-badge ${className}`,
15185
+ className: classNames(b(), className),
15084
15186
  style
15085
15187
  }, icons !== "" && /* @__PURE__ */ React__default.createElement("div", {
15086
15188
  className: "slot-icons"
@@ -15092,13 +15194,12 @@ const Badge = (props) => {
15092
15194
  color: "#ffffff",
15093
15195
  size: "12"
15094
15196
  })), /* @__PURE__ */ React__default.createElement("div", null, children), /* @__PURE__ */ React__default.createElement("div", {
15095
- className: `${dot ? "is-dot" : ""} nut-badge__content sup`,
15197
+ className: classNames({ "is-dot": dot }, b("content"), "sup"),
15096
15198
  style: getStyle()
15097
15199
  }, content()));
15098
15200
  };
15099
15201
  Badge.defaultProps = defaultProps$u;
15100
15202
  Badge.displayName = "NutBadge";
15101
- const isObject = (val) => val !== null && typeof val === "object";
15102
15203
  const defaultProps$t = {
15103
15204
  strokeWidth: 5,
15104
15205
  radius: 50,
@@ -15291,7 +15392,7 @@ const Collapse = memo(
15291
15392
  onChange && onChange(!isOpen, name);
15292
15393
  };
15293
15394
  return /* @__PURE__ */ React__default.createElement("div", {
15294
- className: `${colBem()} ${className}`,
15395
+ className: classNames(colBem(), className),
15295
15396
  style
15296
15397
  }, childrenDom.map((item) => {
15297
15398
  return React__default.cloneElement(item, {
@@ -19026,7 +19127,7 @@ const Card = (props) => {
19026
19127
  };
19027
19128
  const b2 = cn("card");
19028
19129
  return /* @__PURE__ */ React__default.createElement("div", {
19029
- className: `${b2()} ${className}`,
19130
+ className: classNames(b2(), className),
19030
19131
  style,
19031
19132
  ...rest
19032
19133
  }, /* @__PURE__ */ React__default.createElement("div", {