@nutui/nutui-react-taro 2.0.0 → 2.0.1

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 (100) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/esm/Address.js +4 -4
  3. package/dist/esm/Audio.js +3 -3
  4. package/dist/esm/Barrage.js +1 -1
  5. package/dist/esm/Calendar.js +3 -3
  6. package/dist/esm/CalendarItem.js +2 -2
  7. package/dist/esm/Card/style/style.css +1 -1
  8. package/dist/esm/Cascader.js +3 -3
  9. package/dist/esm/Checkbox.js +2 -2
  10. package/dist/esm/CheckboxGroup.js +2 -2
  11. package/dist/esm/CircleProgress.js +1 -1
  12. package/dist/esm/Collapse.js +2 -2
  13. package/dist/esm/DatePicker.js +3 -3
  14. package/dist/esm/Ellipsis/style/style.css +1 -1
  15. package/dist/esm/Form.js +1 -1
  16. package/dist/esm/ImagePreview.js +2 -2
  17. package/dist/esm/InfiniteLoading.js +1 -1
  18. package/dist/esm/Input.js +2 -2
  19. package/dist/esm/InputNumber.js +2 -2
  20. package/dist/esm/Pagination.js +2 -2
  21. package/dist/esm/Picker.js +2 -2
  22. package/dist/esm/Radio.js +2 -2
  23. package/dist/esm/RadioGroup.js +2 -2
  24. package/dist/esm/Range.js +2 -2
  25. package/dist/esm/Rate.js +2 -2
  26. package/dist/esm/SearchBar/style/style.css +1 -1
  27. package/dist/esm/SearchBar.js +1 -1
  28. package/dist/esm/ShortPassword.js +2 -2
  29. package/dist/esm/Switch.js +2 -2
  30. package/dist/esm/Tabbar.js +2 -2
  31. package/dist/esm/Tabs.js +2 -2
  32. package/dist/esm/Tag/style/style.css +1 -1
  33. package/dist/esm/TextArea.js +2 -2
  34. package/dist/esm/Uploader.js +1 -1
  35. package/dist/esm/{address.taro-d4299225.js → address.taro-3e9addcc.js} +1 -1
  36. package/dist/esm/{audio.taro-e4e33cdd.js → audio.taro-38889f9d.js} +1 -1
  37. package/dist/esm/{barrage.taro-e87bc58e.js → barrage.taro-1de16de1.js} +9 -9
  38. package/dist/esm/{calendar.taro-8bb4cb34.js → calendar.taro-eedfb0ac.js} +1 -1
  39. package/dist/esm/{calendaritem.taro-0262d6ab.js → calendaritem.taro-22e09e6d.js} +1 -1
  40. package/dist/esm/{cascader.taro-e929f24d.js → cascader.taro-cb5ead51.js} +2 -2
  41. package/dist/esm/{checkbox.taro-303276d7.js → checkbox.taro-ab8ef36e.js} +1 -1
  42. package/dist/esm/{circleprogress.taro-7149e09d.js → circleprogress.taro-fd2326fc.js} +2 -2
  43. package/dist/esm/{collapse.taro-1d9e3bb2.js → collapse.taro-5aa2b225.js} +1 -1
  44. package/dist/esm/{datepicker.taro-604222f0.js → datepicker.taro-a6b0ae2d.js} +33 -26
  45. package/dist/esm/{form.taro-1fcc5143.js → form.taro-1a66c97a.js} +1 -1
  46. package/dist/esm/{imagepreview.taro-2d18f096.js → imagepreview.taro-71d57d47.js} +1 -1
  47. package/dist/esm/{infiniteloading.taro-59778aef.js → infiniteloading.taro-1b43b959.js} +2 -2
  48. package/dist/esm/{input.taro-a4c8fecb.js → input.taro-c611c122.js} +1 -1
  49. package/dist/esm/{inputnumber.taro-c4c0cfb3.js → inputnumber.taro-96165704.js} +7 -7
  50. package/dist/esm/nutui-react.es.js +28 -28
  51. package/dist/esm/{pagination.taro-0d851480.js → pagination.taro-2c68b943.js} +1 -1
  52. package/dist/esm/{picker.taro-86564e14.js → picker.taro-539089cb.js} +1 -1
  53. package/dist/esm/{radio.taro-5d6ca4ad.js → radio.taro-410f7b07.js} +1 -1
  54. package/dist/esm/{range.taro-a1d1ad25.js → range.taro-e88b568c.js} +1 -1
  55. package/dist/esm/{rate.taro-78c66969.js → rate.taro-2e2898ec.js} +1 -1
  56. package/dist/esm/{searchbar.taro-842e985f.js → searchbar.taro-5d83279d.js} +1 -1
  57. package/dist/esm/{shortpassword.taro-b1b6c076.js → shortpassword.taro-9c3be7da.js} +1 -1
  58. package/dist/esm/{switch.taro-f0da73a3.js → switch.taro-81197983.js} +1 -1
  59. package/dist/esm/{tabbar.taro-4f49ed90.js → tabbar.taro-978c27b0.js} +1 -1
  60. package/dist/esm/{tabs.taro-66164782.js → tabs.taro-67bdf3bb.js} +1 -5
  61. package/dist/esm/{textarea.taro-6b6142cc.js → textarea.taro-a09e8563.js} +1 -1
  62. package/dist/esm/types/src/packages/animatingnumbers/animatingnumbers.d.ts +1 -3
  63. package/dist/esm/types/src/packages/animatingnumbers/animatingnumbers.taro.d.ts +1 -3
  64. package/dist/esm/types/src/packages/circleprogress/circleprogress.d.ts +1 -1
  65. package/dist/esm/types/src/packages/circleprogress/circleprogress.taro.d.ts +1 -1
  66. package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -1
  67. package/dist/esm/types/src/packages/datepicker/datepicker.d.ts +2 -2
  68. package/dist/esm/types/src/packages/datepicker/datepicker.taro.d.ts +2 -2
  69. package/dist/esm/types/src/packages/tag/tag.d.ts +1 -1
  70. package/dist/esm/types/src/packages/tag/tag.taro.d.ts +1 -1
  71. package/dist/esm/types/src/packages/uploader/upload.d.ts +6 -6
  72. package/dist/esm/types/src/packages/uploader/uploader.taro.d.ts +2 -2
  73. package/dist/esm/{uploader.taro-d9add90e.js → uploader.taro-3bbe2503.js} +33 -35
  74. package/dist/esm/use-props-value-1f54346f.js +27 -0
  75. package/dist/locales/base.js +1 -1
  76. package/dist/locales/en-US.js +1 -1
  77. package/dist/locales/id-ID.js +1 -1
  78. package/dist/locales/tr-TR.js +1 -1
  79. package/dist/locales/zh-CN.js +1 -1
  80. package/dist/locales/zh-TW.js +1 -1
  81. package/dist/locales/zh-UG.js +1 -1
  82. package/dist/nutui.react.es.js +113 -100
  83. package/dist/nutui.react.umd.js +113 -100
  84. package/dist/packages/searchbar/searchbar.scss +2 -0
  85. package/dist/packages/tag/tag.scss +5 -0
  86. package/dist/style.css +1 -1
  87. package/dist/style.mjs +1 -1
  88. package/dist/styles/theme-dark.scss +1 -0
  89. package/dist/styles/theme-default.scss +1 -0
  90. package/dist/styles/variables.scss +6 -6
  91. package/dist/types/packages/animatingnumbers/animatingnumbers.taro.d.ts +1 -3
  92. package/dist/types/packages/circleprogress/circleprogress.taro.d.ts +1 -1
  93. package/dist/types/packages/configprovider/types.d.ts +1 -1
  94. package/dist/types/packages/datepicker/datepicker.taro.d.ts +2 -2
  95. package/dist/types/packages/swiper/swiper.taro.d.ts +1 -1
  96. package/dist/types/packages/tag/tag.taro.d.ts +1 -1
  97. package/dist/types/packages/uploader/upload.d.ts +6 -6
  98. package/dist/types/packages/uploader/uploader.taro.d.ts +2 -2
  99. package/package.json +2 -3
  100. package/dist/esm/use-props-value-7ac1b1b5.js +0 -16
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  /*!
8
- * @nutui/nutui-react-taro v2.0.0 Fri Jun 30 2023 14:40:12 GMT+0800 (China Standard Time)
8
+ * @nutui/nutui-react-taro v2.0.1 Wed Jul 05 2023 14:33:13 GMT+0800 (China Standard Time)
9
9
  * (c) 2023 @jdf2e.
10
10
  * Released under the MIT License.
11
11
  */
@@ -5653,6 +5653,10 @@ const SubSideNavBar = (props) => {
5653
5653
  const iconClass = subShow ? "arrow-icon arrow-down" : "arrow-icon arrow-up";
5654
5654
  return /* @__PURE__ */ React.createElement("div", { className: divClass, ref: listRef, onClick: clickFn, ...rest }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__title ${classPrefix2}-border-bt` }, title, " ", /* @__PURE__ */ React.createElement("i", { className: iconClass })), /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__content` }, children));
5655
5655
  };
5656
+ function useForceUpdate() {
5657
+ const [, updateState] = React.useState();
5658
+ return React.useCallback(() => updateState({}), []);
5659
+ }
5656
5660
  function usePropsValue({
5657
5661
  value,
5658
5662
  defaultValue,
@@ -5660,17 +5664,24 @@ function usePropsValue({
5660
5664
  onChange = (value2) => {
5661
5665
  }
5662
5666
  }) {
5663
- const [uncontrolled, setUncontrolled] = useState(
5664
- defaultValue !== void 0 ? defaultValue : finalValue
5665
- );
5666
- const handleUncontrolledChange = (val) => {
5667
- setUncontrolled(val);
5668
- onChange == null ? void 0 : onChange(val);
5669
- };
5667
+ const forceUpdate = useForceUpdate();
5668
+ const dfValue = defaultValue !== void 0 ? defaultValue : finalValue;
5669
+ const stateRef = useRef(value !== void 0 ? value : dfValue);
5670
5670
  if (value !== void 0) {
5671
- return [value, onChange];
5671
+ stateRef.current = value;
5672
5672
  }
5673
- return [uncontrolled, handleUncontrolledChange];
5673
+ const setState = useCallback(
5674
+ (v) => {
5675
+ const prevState = stateRef.current;
5676
+ stateRef.current = v;
5677
+ if (prevState !== stateRef.current) {
5678
+ forceUpdate();
5679
+ }
5680
+ onChange == null ? void 0 : onChange(v);
5681
+ },
5682
+ [value, onChange]
5683
+ );
5684
+ return [stateRef.current, setState];
5674
5685
  }
5675
5686
  const defaultProps$19 = {
5676
5687
  ...ComponentDefaults,
@@ -5855,10 +5866,6 @@ const TabPane = (props) => {
5855
5866
  );
5856
5867
  return children ? /* @__PURE__ */ React.createElement("div", { className: classes }, !disabled && children) : null;
5857
5868
  };
5858
- function useForceUpdate() {
5859
- const [, updateState] = React.useState();
5860
- return React.useCallback(() => updateState({}), []);
5861
- }
5862
5869
  const defaultProps$15 = {
5863
5870
  ...ComponentDefaults,
5864
5871
  tabStyle: {},
@@ -8657,12 +8664,12 @@ const DatePicker = (props) => {
8657
8664
  }
8658
8665
  let timestmp = Math.max(cvalue.getTime(), startDate.getTime());
8659
8666
  timestmp = Math.min(timestmp, endDate.getTime());
8660
- return new Date(timestmp);
8667
+ return timestmp;
8661
8668
  };
8662
8669
  const [currentDate, setCurrentDate] = usePropsValue({
8663
8670
  value: props.value && formatValue(props.value),
8664
8671
  defaultValue: formatValue(props.defaultValue || null),
8665
- finalValue: null,
8672
+ finalValue: 0,
8666
8673
  onChange: (val) => {
8667
8674
  }
8668
8675
  });
@@ -8705,7 +8712,7 @@ const DatePicker = (props) => {
8705
8712
  };
8706
8713
  };
8707
8714
  const ranges = () => {
8708
- const curDate = currentDate;
8715
+ const curDate = new Date(currentDate);
8709
8716
  if (!curDate)
8710
8717
  return [];
8711
8718
  const { maxYear, maxDate, maxMonth, maxHour, maxMinute, maxSeconds } = getBoundary("max", curDate);
@@ -8762,19 +8769,21 @@ const DatePicker = (props) => {
8762
8769
  return result;
8763
8770
  };
8764
8771
  const updateChooseValueCustmer = (selectedOptions, selectedValue, index) => {
8772
+ var _a;
8773
+ const rangeType = type4.toLocaleLowerCase();
8765
8774
  if (["date", "datetime", "datehour", "month-day", "year-month"].includes(
8766
- type4.toLocaleLowerCase()
8775
+ rangeType
8767
8776
  )) {
8768
8777
  const formatDate = [];
8769
8778
  selectedValue.forEach((item) => {
8770
8779
  formatDate.push(item);
8771
8780
  });
8772
- if (type4.toLocaleLowerCase() === "month-day" && formatDate.length < 3) {
8781
+ if (rangeType === "month-day" && formatDate.length < 3) {
8773
8782
  formatDate.unshift(
8774
8783
  new Date(defaultValue || startDate || endDate).getFullYear()
8775
8784
  );
8776
8785
  }
8777
- if (type4.toLocaleLowerCase() === "year-month" && formatDate.length < 3) {
8786
+ if (rangeType === "year-month" && formatDate.length < 3) {
8778
8787
  formatDate.push(
8779
8788
  new Date(defaultValue || startDate || endDate).getDate()
8780
8789
  );
@@ -8786,9 +8795,9 @@ const DatePicker = (props) => {
8786
8795
  getMonthEndDay(Number(formatDate[0]), Number(formatDate[1]))
8787
8796
  );
8788
8797
  let date4 = null;
8789
- if (type4.toLocaleLowerCase() === "date" || type4.toLocaleLowerCase() === "month-day" || type4.toLocaleLowerCase() === "year-month") {
8798
+ if (rangeType === "date" || rangeType === "month-day" || rangeType === "year-month") {
8790
8799
  date4 = new Date(year, month, day);
8791
- } else if (type4.toLocaleLowerCase() === "datetime") {
8800
+ } else if (rangeType === "datetime") {
8792
8801
  date4 = new Date(
8793
8802
  year,
8794
8803
  month,
@@ -8796,10 +8805,10 @@ const DatePicker = (props) => {
8796
8805
  Number(formatDate[3]),
8797
8806
  Number(formatDate[4])
8798
8807
  );
8799
- } else if (type4.toLocaleLowerCase() === "datehour") {
8808
+ } else if (rangeType === "datehour") {
8800
8809
  date4 = new Date(year, month, day, Number(formatDate[3]));
8801
8810
  }
8802
- const isEqual = (currentDate == null ? void 0 : currentDate.getTime()) === (date4 == null ? void 0 : date4.getTime());
8811
+ const isEqual = ((_a = new Date(currentDate)) == null ? void 0 : _a.getTime()) === (date4 == null ? void 0 : date4.getTime());
8803
8812
  date4 && isDate(date4) && !isEqual && setCurrentDate(formatValue(date4));
8804
8813
  }
8805
8814
  props.onChange && props.onChange(selectedOptions, selectedValue, index);
@@ -8849,23 +8858,28 @@ const DatePicker = (props) => {
8849
8858
  return arr;
8850
8859
  };
8851
8860
  const getDateIndex = (type22) => {
8861
+ const date4 = new Date(currentDate);
8852
8862
  if (!currentDate)
8853
8863
  return 0;
8854
- let d = 0;
8855
8864
  if (type22 === "year") {
8856
- d = currentDate.getFullYear();
8857
- } else if (type22 === "month") {
8858
- d = currentDate.getMonth() + 1;
8859
- } else if (type22 === "day") {
8860
- d = currentDate.getDate();
8861
- } else if (type22 === "hour") {
8862
- d = currentDate.getHours();
8863
- } else if (type22 === "minute") {
8864
- d = currentDate.getMinutes();
8865
- } else if (type22 === "seconds") {
8866
- d = currentDate.getSeconds();
8867
- }
8868
- return d;
8865
+ return date4.getFullYear();
8866
+ }
8867
+ if (type22 === "month") {
8868
+ return date4.getMonth() + 1;
8869
+ }
8870
+ if (type22 === "day") {
8871
+ return date4.getDate();
8872
+ }
8873
+ if (type22 === "hour") {
8874
+ return date4.getHours();
8875
+ }
8876
+ if (type22 === "minute") {
8877
+ return date4.getMinutes();
8878
+ }
8879
+ if (type22 === "seconds") {
8880
+ return date4.getSeconds();
8881
+ }
8882
+ return 0;
8869
8883
  };
8870
8884
  const columns = () => {
8871
8885
  const val = ranges().map((res, columnIndex) => {
@@ -8883,7 +8897,7 @@ const DatePicker = (props) => {
8883
8897
  if (currentDate) {
8884
8898
  setOptions(columns());
8885
8899
  }
8886
- }, []);
8900
+ }, [currentDate]);
8887
8901
  return /* @__PURE__ */ React.createElement(
8888
8902
  View,
8889
8903
  {
@@ -9981,7 +9995,7 @@ class FormStore {
9981
9995
  __publicField(this, "registerField", (field) => {
9982
9996
  this.fieldEntities.push(field);
9983
9997
  return () => {
9984
- this.fieldEntities = this.fieldEntities.filter((item) => item != field);
9998
+ this.fieldEntities = this.fieldEntities.filter((item) => item !== field);
9985
9999
  if (this.store) {
9986
10000
  delete this.store[field.props.name];
9987
10001
  }
@@ -10588,14 +10602,14 @@ const InputNumber = (props) => {
10588
10602
  };
10589
10603
  const addAllow = (value2 = _checked) => {
10590
10604
  if (formatter) {
10591
- const numValue = String(value2).replace(/[^0-9|\.]/gi, "");
10605
+ const numValue = String(value2).replace(/[^0-9|.]/gi, "");
10592
10606
  return Number(numValue) < Number(max) && !disabled;
10593
10607
  }
10594
10608
  return Number(value2) < Number(max) && !disabled;
10595
10609
  };
10596
10610
  const reduceAllow = (value2 = _checked) => {
10597
10611
  if (formatter) {
10598
- const numValue = String(value2).replace(/[^0-9|\.]/gi, "");
10612
+ const numValue = String(value2).replace(/[^0-9|.]/gi, "");
10599
10613
  return Number(numValue) > Number(min) && !disabled;
10600
10614
  }
10601
10615
  return Number(value2) > Number(min) && !disabled;
@@ -10626,7 +10640,7 @@ const InputNumber = (props) => {
10626
10640
  onMinus && onMinus(e);
10627
10641
  if (reduceAllow()) {
10628
10642
  if (formatter) {
10629
- const numValue = String(_checked).replace(/[^0-9|\.]/gi, "");
10643
+ const numValue = String(_checked).replace(/[^0-9|.]/gi, "");
10630
10644
  const outputValue = Number(numValue) - Number(step);
10631
10645
  inputRef.current = formatter(outputValue);
10632
10646
  emitChange(outputValue, e);
@@ -10642,7 +10656,7 @@ const InputNumber = (props) => {
10642
10656
  onPlus && onPlus(e);
10643
10657
  if (addAllow()) {
10644
10658
  if (formatter) {
10645
- const numValue = String(_checked).replace(/[^0-9|\.]/gi, "");
10659
+ const numValue = String(_checked).replace(/[^0-9|.]/gi, "");
10646
10660
  const outputValue = Number(numValue) + Number(step);
10647
10661
  inputRef.current = formatter(outputValue);
10648
10662
  emitChange(outputValue, e);
@@ -10664,7 +10678,7 @@ const InputNumber = (props) => {
10664
10678
  const changeFormatValue = (e) => {
10665
10679
  const input = e.target.value;
10666
10680
  const numReg = new RegExp("^[0-9]*$");
10667
- const numValue = input.replace(/[^0-9|\.]/gi, "");
10681
+ const numValue = input.replace(/[^0-9|.]/gi, "");
10668
10682
  if (formatter) {
10669
10683
  if (!numReg.test(input[0]) && numValue) {
10670
10684
  setChecked(formatter(numValue));
@@ -10683,7 +10697,7 @@ const InputNumber = (props) => {
10683
10697
  const burFormatValue = (e) => {
10684
10698
  const input = e.target.value;
10685
10699
  const numReg = new RegExp("^[0-9]*$");
10686
- const numValue = input.replace(/[^0-9|\.]/gi, "");
10700
+ const numValue = input.replace(/[^0-9|.]/gi, "");
10687
10701
  if (formatter) {
10688
10702
  if (formatter(numValue) === input) {
10689
10703
  emitChange(numValue, e);
@@ -11967,7 +11981,7 @@ const SearchBar = (props) => {
11967
11981
  forceFocus();
11968
11982
  };
11969
11983
  const onKeypress = (e) => {
11970
- if (e.keyCode === 13) {
11984
+ if (e.key === "Enter" || e.keyCode === 13) {
11971
11985
  if (typeof e.cancelable !== "boolean" || e.cancelable) {
11972
11986
  e.preventDefault();
11973
11987
  }
@@ -12553,42 +12567,40 @@ class UploaderTaro extends Upload {
12553
12567
  const options = this.options;
12554
12568
  if (env === "WEB") {
12555
12569
  this.upload();
12570
+ } else if (options.beforeXhrUpload) {
12571
+ options.beforeXhrUpload(uploadFile2, options);
12556
12572
  } else {
12557
- if (options.beforeXhrUpload) {
12558
- options.beforeXhrUpload(uploadFile2, options);
12559
- } else {
12560
- const uploadTask = uploadFile2({
12561
- url: options.url,
12562
- filePath: options.taroFilePath,
12563
- fileType: options.fileType,
12564
- header: {
12565
- "Content-Type": "multipart/form-data",
12566
- ...options.headers
12567
- },
12568
- //
12569
- formData: options.formData,
12570
- name: options.name,
12571
- success(response) {
12572
- var _a2, _b;
12573
- if (options.xhrState == response.statusCode) {
12574
- (_a2 = options.onSuccess) == null ? void 0 : _a2.call(options, response, options);
12575
- } else {
12576
- (_b = options.onFailure) == null ? void 0 : _b.call(options, response, options);
12577
- }
12578
- },
12579
- fail(e) {
12580
- var _a2;
12581
- (_a2 = options.onFailure) == null ? void 0 : _a2.call(options, e, options);
12582
- }
12583
- });
12584
- (_a = options.onStart) == null ? void 0 : _a.call(options, options);
12585
- uploadTask.progress(
12586
- (res) => {
12587
- var _a2;
12588
- (_a2 = options.onProgress) == null ? void 0 : _a2.call(options, res, options);
12573
+ const uploadTask = uploadFile2({
12574
+ url: options.url,
12575
+ filePath: options.taroFilePath,
12576
+ fileType: options.fileType,
12577
+ header: {
12578
+ "Content-Type": "multipart/form-data",
12579
+ ...options.headers
12580
+ },
12581
+ //
12582
+ formData: options.formData,
12583
+ name: options.name,
12584
+ success(response) {
12585
+ var _a2, _b;
12586
+ if (options.xhrState === response.statusCode) {
12587
+ (_a2 = options.onSuccess) == null ? void 0 : _a2.call(options, response, options);
12588
+ } else {
12589
+ (_b = options.onFailure) == null ? void 0 : _b.call(options, response, options);
12589
12590
  }
12590
- );
12591
- }
12591
+ },
12592
+ fail(e) {
12593
+ var _a2;
12594
+ (_a2 = options.onFailure) == null ? void 0 : _a2.call(options, e, options);
12595
+ }
12596
+ });
12597
+ (_a = options.onStart) == null ? void 0 : _a.call(options, options);
12598
+ uploadTask.progress(
12599
+ (res) => {
12600
+ var _a2;
12601
+ (_a2 = options.onProgress) == null ? void 0 : _a2.call(options, res, options);
12602
+ }
12603
+ );
12592
12604
  }
12593
12605
  }
12594
12606
  }
@@ -12809,7 +12821,7 @@ const InternalUploader = (props, ref) => {
12809
12821
  uploadOption.onStart = (option) => {
12810
12822
  clearUploadQueue(index);
12811
12823
  setFileList((fileList2) => {
12812
- fileList2.map((item) => {
12824
+ fileList2.forEach((item) => {
12813
12825
  if (item.uid === fileItem.uid) {
12814
12826
  item.status = "ready";
12815
12827
  item.message = locale.uploader.readyUpload;
@@ -12821,7 +12833,7 @@ const InternalUploader = (props, ref) => {
12821
12833
  };
12822
12834
  uploadOption.onProgress = (e, option) => {
12823
12835
  setFileList((fileList2) => {
12824
- fileList2.map((item) => {
12836
+ fileList2.forEach((item) => {
12825
12837
  if (item.uid === fileItem.uid) {
12826
12838
  item.status = "uploading";
12827
12839
  item.message = locale.uploader.uploading;
@@ -12835,7 +12847,7 @@ const InternalUploader = (props, ref) => {
12835
12847
  uploadOption.onSuccess = (responseText, option) => {
12836
12848
  setFileList((fileList2) => {
12837
12849
  onUpdate && onUpdate(fileList2);
12838
- fileList2.map((item) => {
12850
+ fileList2.forEach((item) => {
12839
12851
  if (item.uid === fileItem.uid) {
12840
12852
  item.status = "success";
12841
12853
  item.message = locale.uploader.success;
@@ -12851,7 +12863,7 @@ const InternalUploader = (props, ref) => {
12851
12863
  };
12852
12864
  uploadOption.onFailure = (responseText, option) => {
12853
12865
  setFileList((fileList2) => {
12854
- fileList2.map((item) => {
12866
+ fileList2.forEach((item) => {
12855
12867
  if (item.uid === fileItem.uid) {
12856
12868
  item.status = "error";
12857
12869
  item.message = locale.uploader.error;
@@ -12913,7 +12925,7 @@ const InternalUploader = (props, ref) => {
12913
12925
  fileItem.formData = data;
12914
12926
  }
12915
12927
  if (preview) {
12916
- fileItem.url = fileType == "video" ? file.thumbTempFilePath : filepath;
12928
+ fileItem.url = fileType === "video" ? file.thumbTempFilePath : filepath;
12917
12929
  }
12918
12930
  fileList.push(fileItem);
12919
12931
  setFileList([...fileList]);
@@ -13547,14 +13559,14 @@ const InfiniteLoading = (props) => {
13547
13559
  onScroll && onScroll(e.detail.scrollTop);
13548
13560
  };
13549
13561
  const lower = () => {
13550
- if (direction.current == "up" || !hasMore || isInfiniting) {
13562
+ if (direction.current === "up" || !hasMore || isInfiniting) {
13551
13563
  return false;
13552
13564
  }
13553
13565
  setIsInfiniting(true);
13554
13566
  onLoadMore && onLoadMore(infiniteDone);
13555
13567
  };
13556
13568
  const touchStart = (event) => {
13557
- if (scrollTop.current == 0 && !isTouching.current && pullRefresh) {
13569
+ if (scrollTop.current === 0 && !isTouching.current && pullRefresh) {
13558
13570
  y2.current = event.touches[0].pageY;
13559
13571
  isTouching.current = true;
13560
13572
  }
@@ -15396,7 +15408,7 @@ const CircleProgress = (props) => {
15396
15408
  (a2, b) => parseFloat(a2) - parseFloat(b)
15397
15409
  );
15398
15410
  const stopArr = [];
15399
- colorArr.map((item) => {
15411
+ colorArr.forEach((item) => {
15400
15412
  const obj = {
15401
15413
  key: "",
15402
15414
  value: ""
@@ -15415,7 +15427,7 @@ const CircleProgress = (props) => {
15415
15427
  const stopArr = stop();
15416
15428
  const stopDom = [];
15417
15429
  if (stopArr) {
15418
- stopArr.map((item) => {
15430
+ stopArr.forEach((item) => {
15419
15431
  let obj = "";
15420
15432
  obj = `%3Cstop offset='${item.key}' stop-color='${transColor(
15421
15433
  item.value
@@ -17487,21 +17499,21 @@ const InternalBarrage = (props, ref) => {
17487
17499
  const query = createSelectorQuery();
17488
17500
  setTimeout(() => {
17489
17501
  let width = 100;
17490
- query.select(`.${classPrefix}__body` + timeId.current).boundingClientRect((rec) => {
17502
+ query.select(`.${classPrefix}__body${timeId.current}`).boundingClientRect((rec) => {
17491
17503
  width = rec.width || 300;
17492
17504
  });
17493
- query.select(`.${classPrefix}__item` + index).boundingClientRect((recs) => {
17494
- let height = recs.height;
17495
- let nodeTop = index % rows * (height + gapY) + 20 + "px";
17505
+ query.select(`.${classPrefix}__item${index}`).boundingClientRect((recs) => {
17506
+ const height = recs.height;
17507
+ const nodeTop = `${index % rows * (height + gapY) + 20}px`;
17496
17508
  styleInfo(index, nodeTop, width);
17497
17509
  }).exec();
17498
17510
  }, 500);
17499
17511
  };
17500
17512
  const styleInfo = (index, nodeTop, width) => {
17501
- let timeIndex = index - rows > 0 ? index - rows : 0;
17502
- let list2 = styleList;
17503
- let time = list2[timeIndex] ? Number(list2[timeIndex]["--time"]) : 0;
17504
- let obj = {
17513
+ const timeIndex = index - rows > 0 ? index - rows : 0;
17514
+ const list2 = styleList;
17515
+ const time = list2[timeIndex] ? Number(list2[timeIndex]["--time"]) : 0;
17516
+ const obj = {
17505
17517
  top: nodeTop,
17506
17518
  "--time": `${interval * index + time}`,
17507
17519
  animationDuration: `${duration}ms`,
@@ -17517,9 +17529,10 @@ const InternalBarrage = (props, ref) => {
17517
17529
  "div",
17518
17530
  {
17519
17531
  className: `barrage-item ${classPrefix}__item${index} move`,
17520
- style: styleList[index]
17532
+ style: styleList[index],
17533
+ key: index
17521
17534
  },
17522
- item.length > 8 ? item.substr(0, 8) + "..." : item
17535
+ item.length > 8 ? `${item.substr(0, 8)}...` : item
17523
17536
  );
17524
17537
  })));
17525
17538
  };