@nutui/nutui-react-taro 2.6.0 → 2.6.2

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 (47) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/esm/Badge/style/style.css +1 -1
  3. package/dist/esm/Cell/style/style.css +1 -1
  4. package/dist/esm/Cell.js +1 -1
  5. package/dist/esm/CellGroup/style/style.css +1 -1
  6. package/dist/esm/CellGroup.js +1 -1
  7. package/dist/esm/DatePicker.js +1 -1
  8. package/dist/esm/Ellipsis.js +1 -1
  9. package/dist/esm/FixedNav/style/style.css +1 -1
  10. package/dist/esm/Form/style/style.css +1 -1
  11. package/dist/esm/Form.js +2 -2
  12. package/dist/esm/FormItem.js +1 -1
  13. package/dist/esm/InputNumber.js +1 -1
  14. package/dist/esm/NavBar/style/style.css +1 -1
  15. package/dist/esm/Signature.js +1 -1
  16. package/dist/esm/Swiper.js +14 -8
  17. package/dist/esm/Tabbar/style/style.css +1 -1
  18. package/dist/esm/TabbarItem/style/style.css +1 -1
  19. package/dist/esm/{cell.taro-CCnLF6RC.js → cell.taro-CmI4m0SC.js} +1 -1
  20. package/dist/esm/{cellgroup.taro-Dz69kT6e.js → cellgroup.taro-CYsSk-Bt.js} +1 -1
  21. package/dist/esm/{datepicker.taro-Bgq3ZNDe.js → datepicker.taro-DEwb5whP.js} +13 -5
  22. package/dist/esm/{ellipsis.taro-uVc3En9l.js → ellipsis.taro-3gDXpBmX.js} +1 -1
  23. package/dist/esm/{formitem.taro-Brz5dj_8.js → formitem.taro-DDNlpN_O.js} +1 -1
  24. package/dist/esm/{inputnumber.taro-CQiAPZgS.js → inputnumber.taro-HU_Ndna2.js} +1 -1
  25. package/dist/esm/nutui-react.es.js +7 -7
  26. package/dist/esm/{signature.taro-KPm_xs66.js → signature.taro-Bn9VNn62.js} +0 -1
  27. package/dist/locales/base.js +1 -1
  28. package/dist/locales/en-US.js +1 -1
  29. package/dist/locales/id-ID.js +1 -1
  30. package/dist/locales/tr-TR.js +1 -1
  31. package/dist/locales/zh-CN.js +1 -1
  32. package/dist/locales/zh-TW.js +1 -1
  33. package/dist/locales/zh-UG.js +1 -1
  34. package/dist/nutui.react.es.js +34 -17
  35. package/dist/nutui.react.umd.js +34 -17
  36. package/dist/packages/badge/badge.scss +1 -1
  37. package/dist/packages/cellgroup/cellgroup.scss +1 -1
  38. package/dist/packages/fixednav/fixednav.scss +4 -2
  39. package/dist/packages/navbar/navbar.scss +1 -0
  40. package/dist/style.css +1 -1
  41. package/dist/style.mjs +1 -1
  42. package/dist/styles/theme-jmapp.scss +97 -10
  43. package/dist/styles/variables-jmapp.scss +110 -103
  44. package/dist/styles/variables.scss +2 -0
  45. package/dist/types/packages/configprovider/types.d.ts +1 -1
  46. package/dist/types/utils/use-lock-fn.d.ts +2 -0
  47. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v2.6.0 Fri Apr 12 2024 16:18:09 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v2.6.2 Fri Apr 26 2024 15:05:09 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -305,7 +305,7 @@ const defaultProps$1v = {
305
305
  };
306
306
  const classPrefix$r = "nut-cell-group";
307
307
  const CellGroup = (props) => {
308
- const { children, className, style, title, description, divider, ...rest } = {
308
+ const { children, className, title, description, divider, ...rest } = {
309
309
  ...defaultProps$1v,
310
310
  ...props
311
311
  };
@@ -8606,10 +8606,23 @@ const DatePicker = (props) => {
8606
8606
  return result;
8607
8607
  }
8608
8608
  };
8609
- const compareDateChange = (currentDate, newDate) => {
8609
+ const compareDateChange = (currentDate, newDate, selectedOptions, index) => {
8610
8610
  var _a;
8611
8611
  const isEqual = ((_a = new Date(currentDate)) == null ? void 0 : _a.getTime()) === (newDate == null ? void 0 : newDate.getTime());
8612
- newDate && isDate(newDate) && !isEqual && setSelectedDate(formatValue(newDate));
8612
+ if (newDate && isDate(newDate)) {
8613
+ if (!isEqual) {
8614
+ setSelectedDate(formatValue(newDate));
8615
+ }
8616
+ props.onChange && props.onChange(
8617
+ selectedOptions,
8618
+ [
8619
+ String(newDate.getFullYear()),
8620
+ String(newDate.getMonth() + 1),
8621
+ String(newDate.getDate())
8622
+ ],
8623
+ index
8624
+ );
8625
+ }
8613
8626
  };
8614
8627
  const handlePickerChange = (selectedOptions, selectedValue, index) => {
8615
8628
  const rangeType = type4.toLocaleLowerCase();
@@ -8650,7 +8663,7 @@ const DatePicker = (props) => {
8650
8663
  } else if (rangeType === "datehour") {
8651
8664
  date4 = new Date(year, month, day, Number(formatDate[3]));
8652
8665
  }
8653
- compareDateChange(selectedDate, date4);
8666
+ compareDateChange(selectedDate, date4, selectedOptions, index);
8654
8667
  } else {
8655
8668
  const [hour, minute, seconds] = selectedValue;
8656
8669
  const currentDate = new Date(selectedDate);
@@ -8665,9 +8678,8 @@ const DatePicker = (props) => {
8665
8678
  Number(minute),
8666
8679
  rangeType === "time" ? Number(seconds) : 0
8667
8680
  );
8668
- compareDateChange(selectedDate, date4);
8681
+ compareDateChange(selectedDate, date4, selectedOptions, index);
8669
8682
  }
8670
- props.onChange && props.onChange(selectedOptions, selectedValue, index);
8671
8683
  };
8672
8684
  const formatOption = (type22, value) => {
8673
8685
  if (formatter) {
@@ -10528,7 +10540,7 @@ const InputNumber = (props) => {
10528
10540
  ...defaultProps$W,
10529
10541
  ...props
10530
10542
  };
10531
- const classes = classNames(classPrefix$h, {
10543
+ const classes = classNames(classPrefix$h, className, {
10532
10544
  [`${classPrefix$h}-disabled`]: disabled
10533
10545
  });
10534
10546
  const [focused, setFocused] = useState(false);
@@ -12248,7 +12260,6 @@ const InternalSignature = (props, ref) => {
12248
12260
  fileType: props.type,
12249
12261
  canvasId: `${canvasId}`,
12250
12262
  success: (res2) => {
12251
- handleClearBtn();
12252
12263
  onConfirm && onConfirm(res2.tempFilePath);
12253
12264
  },
12254
12265
  fail: (res2) => {
@@ -16534,7 +16545,7 @@ const Ellipsis = (props) => {
16534
16545
  bsize * 0.4,
16535
16546
  bsize * 0.75
16536
16547
  ];
16537
- if (rootContain.current) {
16548
+ if (rootContain.current && rootContain.current.style) {
16538
16549
  rootContain.current.style.fontSize = `${bsize}px`;
16539
16550
  }
16540
16551
  calcEllipse();
@@ -16806,14 +16817,20 @@ const Swiper = forwardRef((props, ref) => {
16806
16817
  ...props
16807
16818
  };
16808
16819
  const [current, setCurrent] = useState(defaultValue);
16809
- const childrenCount = useRef(Children.toArray(children).length);
16820
+ const childrenCount = useMemo$1(() => {
16821
+ let c2 = 0;
16822
+ React__default.Children.map(children, (child, index) => {
16823
+ c2 += 1;
16824
+ });
16825
+ return c2;
16826
+ }, [children]);
16810
16827
  useEffect(() => {
16811
16828
  setCurrent(defaultValue);
16812
16829
  }, [defaultValue]);
16813
16830
  const renderIndicator = () => {
16814
16831
  if (React__default.isValidElement(indicator))
16815
16832
  return indicator;
16816
- if (indicator === true) {
16833
+ if (indicator) {
16817
16834
  return /* @__PURE__ */ React__default.createElement(
16818
16835
  "div",
16819
16836
  {
@@ -16826,7 +16843,7 @@ const Swiper = forwardRef((props, ref) => {
16826
16843
  Indicator,
16827
16844
  {
16828
16845
  current,
16829
- total: childrenCount.current,
16846
+ total: childrenCount,
16830
16847
  direction
16831
16848
  }
16832
16849
  )
@@ -16843,16 +16860,16 @@ const Swiper = forwardRef((props, ref) => {
16843
16860
  },
16844
16861
  next: () => {
16845
16862
  if (loop) {
16846
- setCurrent((current + 1) % childrenCount.current);
16863
+ setCurrent((current + 1) % childrenCount);
16847
16864
  } else {
16848
- setCurrent(current + 1 >= childrenCount.current ? current : current + 1);
16865
+ setCurrent(current + 1 >= childrenCount ? current : current + 1);
16849
16866
  }
16850
16867
  },
16851
16868
  prev: () => {
16852
16869
  if (loop) {
16853
16870
  let next = current - 1;
16854
- next = next < 0 ? childrenCount.current + next : next;
16855
- setCurrent(next % childrenCount.current);
16871
+ next = next < 0 ? childrenCount + next : next;
16872
+ setCurrent(next % childrenCount);
16856
16873
  } else {
16857
16874
  setCurrent(current - 1 <= 0 ? 0 : current - 1);
16858
16875
  }
@@ -2,7 +2,7 @@
2
2
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("@tarojs/taro"), require("@tarojs/components"), require("react-dom")) : typeof define === "function" && define.amd ? define(["exports", "react", "@tarojs/taro", "@tarojs/components", "react-dom"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory((global2.nutui = global2.nutui || {}, global2.nutui.react = {}), global2.React, global2.Taro, global2.components, global2.ReactDOM));
3
3
  })(this, function(exports2, React, Taro, components, ReactDOM) {
4
4
  "use strict";/*!
5
- * @nutui/nutui-react-taro v2.6.0 Fri Apr 12 2024 16:18:09 GMT+0800 (China Standard Time)
5
+ * @nutui/nutui-react-taro v2.6.2 Fri Apr 26 2024 15:05:09 GMT+0800 (China Standard Time)
6
6
  * (c) 2023 @jdf2e.
7
7
  * Released under the MIT License.
8
8
  */
@@ -321,7 +321,7 @@
321
321
  };
322
322
  const classPrefix$r = "nut-cell-group";
323
323
  const CellGroup = (props) => {
324
- const { children, className, style, title, description, divider, ...rest } = {
324
+ const { children, className, title, description, divider, ...rest } = {
325
325
  ...defaultProps$1v,
326
326
  ...props
327
327
  };
@@ -8622,10 +8622,23 @@
8622
8622
  return result;
8623
8623
  }
8624
8624
  };
8625
- const compareDateChange = (currentDate, newDate) => {
8625
+ const compareDateChange = (currentDate, newDate, selectedOptions, index) => {
8626
8626
  var _a;
8627
8627
  const isEqual = ((_a = new Date(currentDate)) == null ? void 0 : _a.getTime()) === (newDate == null ? void 0 : newDate.getTime());
8628
- newDate && isDate(newDate) && !isEqual && setSelectedDate(formatValue(newDate));
8628
+ if (newDate && isDate(newDate)) {
8629
+ if (!isEqual) {
8630
+ setSelectedDate(formatValue(newDate));
8631
+ }
8632
+ props.onChange && props.onChange(
8633
+ selectedOptions,
8634
+ [
8635
+ String(newDate.getFullYear()),
8636
+ String(newDate.getMonth() + 1),
8637
+ String(newDate.getDate())
8638
+ ],
8639
+ index
8640
+ );
8641
+ }
8629
8642
  };
8630
8643
  const handlePickerChange = (selectedOptions, selectedValue, index) => {
8631
8644
  const rangeType = type2.toLocaleLowerCase();
@@ -8666,7 +8679,7 @@
8666
8679
  } else if (rangeType === "datehour") {
8667
8680
  date2 = new Date(year, month, day, Number(formatDate[3]));
8668
8681
  }
8669
- compareDateChange(selectedDate, date2);
8682
+ compareDateChange(selectedDate, date2, selectedOptions, index);
8670
8683
  } else {
8671
8684
  const [hour, minute, seconds] = selectedValue;
8672
8685
  const currentDate = new Date(selectedDate);
@@ -8681,9 +8694,8 @@
8681
8694
  Number(minute),
8682
8695
  rangeType === "time" ? Number(seconds) : 0
8683
8696
  );
8684
- compareDateChange(selectedDate, date2);
8697
+ compareDateChange(selectedDate, date2, selectedOptions, index);
8685
8698
  }
8686
- props.onChange && props.onChange(selectedOptions, selectedValue, index);
8687
8699
  };
8688
8700
  const formatOption = (type22, value) => {
8689
8701
  if (formatter) {
@@ -10544,7 +10556,7 @@
10544
10556
  ...defaultProps$W,
10545
10557
  ...props
10546
10558
  };
10547
- const classes = classNames(classPrefix$h, {
10559
+ const classes = classNames(classPrefix$h, className, {
10548
10560
  [`${classPrefix$h}-disabled`]: disabled
10549
10561
  });
10550
10562
  const [focused, setFocused] = React.useState(false);
@@ -12264,7 +12276,6 @@
12264
12276
  fileType: props.type,
12265
12277
  canvasId: `${canvasId}`,
12266
12278
  success: (res2) => {
12267
- handleClearBtn();
12268
12279
  onConfirm && onConfirm(res2.tempFilePath);
12269
12280
  },
12270
12281
  fail: (res2) => {
@@ -16550,7 +16561,7 @@
16550
16561
  bsize * 0.4,
16551
16562
  bsize * 0.75
16552
16563
  ];
16553
- if (rootContain.current) {
16564
+ if (rootContain.current && rootContain.current.style) {
16554
16565
  rootContain.current.style.fontSize = `${bsize}px`;
16555
16566
  }
16556
16567
  calcEllipse();
@@ -16822,14 +16833,20 @@
16822
16833
  ...props
16823
16834
  };
16824
16835
  const [current, setCurrent] = React.useState(defaultValue);
16825
- const childrenCount = React.useRef(React.Children.toArray(children).length);
16836
+ const childrenCount = React.useMemo(() => {
16837
+ let c2 = 0;
16838
+ React.Children.map(children, (child, index) => {
16839
+ c2 += 1;
16840
+ });
16841
+ return c2;
16842
+ }, [children]);
16826
16843
  React.useEffect(() => {
16827
16844
  setCurrent(defaultValue);
16828
16845
  }, [defaultValue]);
16829
16846
  const renderIndicator = () => {
16830
16847
  if (React.isValidElement(indicator))
16831
16848
  return indicator;
16832
- if (indicator === true) {
16849
+ if (indicator) {
16833
16850
  return /* @__PURE__ */ React.createElement(
16834
16851
  "div",
16835
16852
  {
@@ -16842,7 +16859,7 @@
16842
16859
  Indicator,
16843
16860
  {
16844
16861
  current,
16845
- total: childrenCount.current,
16862
+ total: childrenCount,
16846
16863
  direction
16847
16864
  }
16848
16865
  )
@@ -16859,16 +16876,16 @@
16859
16876
  },
16860
16877
  next: () => {
16861
16878
  if (loop) {
16862
- setCurrent((current + 1) % childrenCount.current);
16879
+ setCurrent((current + 1) % childrenCount);
16863
16880
  } else {
16864
- setCurrent(current + 1 >= childrenCount.current ? current : current + 1);
16881
+ setCurrent(current + 1 >= childrenCount ? current : current + 1);
16865
16882
  }
16866
16883
  },
16867
16884
  prev: () => {
16868
16885
  if (loop) {
16869
16886
  let next = current - 1;
16870
- next = next < 0 ? childrenCount.current + next : next;
16871
- setCurrent(next % childrenCount.current);
16887
+ next = next < 0 ? childrenCount + next : next;
16888
+ setCurrent(next % childrenCount);
16872
16889
  } else {
16873
16890
  setCurrent(current - 1 <= 0 ? 0 : current - 1);
16874
16891
  }
@@ -55,7 +55,7 @@
55
55
  &-dot {
56
56
  width: $badge-dot-width;
57
57
  height: $badge-dot-width;
58
- border: $badge-border;
58
+ border: $badge-dot-border;
59
59
  border-radius: $badge-dot-width;
60
60
  padding: 0;
61
61
  }
@@ -26,7 +26,7 @@
26
26
  border-radius: $cell-border-radius;
27
27
  overflow: hidden;
28
28
  background-color: $cell-group-background-color;
29
- margin: 10px 0;
29
+ margin: $cell-group-wrap-margin;
30
30
 
31
31
  .nut-cell {
32
32
  margin: 0;
@@ -7,8 +7,10 @@
7
7
  right: 0;
8
8
 
9
9
  &.active {
10
- .nut-icon {
11
- transform: rotate(180deg);
10
+ .nut-fixednav-btn{
11
+ .nut-icon {
12
+ transform: rotate(180deg);
13
+ }
12
14
  }
13
15
 
14
16
  .nut-fixednav-list {
@@ -129,6 +129,7 @@
129
129
  flex: 1;
130
130
  justify-content: flex-start;
131
131
  padding: 0 8px;
132
+ text-align: left;
132
133
  }
133
134
  }
134
135
  }