@nutui/nutui-react 2.6.1 → 2.6.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 (38) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/esm/Address/style/style.css +1 -1
  3. package/dist/esm/Badge/style/style.css +1 -1
  4. package/dist/esm/Cascader/style/style.css +1 -1
  5. package/dist/esm/Cell/style/style.css +1 -1
  6. package/dist/esm/CellGroup/style/style.css +1 -1
  7. package/dist/esm/DatePicker.js +13 -5
  8. package/dist/esm/FixedNav/style/style.css +1 -1
  9. package/dist/esm/Form/style/style.css +1 -1
  10. package/dist/esm/InputNumber.js +1 -1
  11. package/dist/esm/NavBar/style/style.css +1 -1
  12. package/dist/esm/Signature.js +0 -1
  13. package/dist/esm/TabPane/style/style.css +1 -1
  14. package/dist/esm/Tabbar/style/style.css +1 -1
  15. package/dist/esm/TabbarItem/style/style.css +1 -1
  16. package/dist/esm/Tabs/style/style.css +1 -1
  17. package/dist/esm/tabs2.js +9 -6
  18. package/dist/locales/base.js +1 -1
  19. package/dist/locales/en-US.js +1 -1
  20. package/dist/locales/id-ID.js +1 -1
  21. package/dist/locales/tr-TR.js +1 -1
  22. package/dist/locales/zh-CN.js +1 -1
  23. package/dist/locales/zh-TW.js +1 -1
  24. package/dist/locales/zh-UG.js +1 -1
  25. package/dist/nutui.react.es.js +27 -13
  26. package/dist/nutui.react.umd.js +27 -13
  27. package/dist/packages/badge/badge.scss +1 -1
  28. package/dist/packages/cellgroup/cellgroup.scss +1 -1
  29. package/dist/packages/fixednav/fixednav.scss +4 -2
  30. package/dist/packages/navbar/navbar.scss +1 -0
  31. package/dist/packages/tabpane/tabpane.scss +1 -1
  32. package/dist/style.css +1 -1
  33. package/dist/style.mjs +1 -1
  34. package/dist/styles/theme-jmapp.scss +97 -10
  35. package/dist/styles/variables-jmapp.scss +111 -103
  36. package/dist/styles/variables.scss +3 -0
  37. package/dist/types/packages/configprovider/types.d.ts +1 -1
  38. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.6.1 Fri Apr 19 2024 14:49:58 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.3 Tue Apr 30 2024 14:15:52 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.6.1 Fri Apr 19 2024 14:49:31 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.6.3 Tue Apr 30 2024 14:15:24 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -11399,7 +11399,6 @@ const Tabs = (props) => {
11399
11399
  finalValue: 0,
11400
11400
  onChange
11401
11401
  });
11402
- const [contentStyle, setContentStyle] = useState({});
11403
11402
  const titleItemsRef = useRef([]);
11404
11403
  const navRef = useRef(null);
11405
11404
  const scrollDirection = (nav, to2, duration2, direction2) => {
@@ -11480,13 +11479,17 @@ const Tabs = (props) => {
11480
11479
  color: activeType === "smile" ? activeColor : "",
11481
11480
  background: activeType === "line" ? activeColor : ""
11482
11481
  };
11483
- useEffect(() => {
11482
+ const getContentStyle = () => {
11484
11483
  let index = titles.current.findIndex((t2) => t2.value == value);
11485
11484
  index = index < 0 ? 0 : index;
11486
- setContentStyle({
11485
+ return {
11487
11486
  transform: direction === "horizontal" ? `translate3d(${rtl ? "" : "-"}${index * 100}%, 0, 0)` : `translate3d( 0,-${index * 100}%, 0)`,
11488
11487
  transitionDuration: `${duration}ms`
11489
- });
11488
+ };
11489
+ };
11490
+ useEffect(() => {
11491
+ let index = titles.current.findIndex((t2) => t2.value == value);
11492
+ index = index < 0 ? 0 : index;
11490
11493
  setTimeout(() => {
11491
11494
  scrollIntoView(index);
11492
11495
  });
@@ -11541,7 +11544,7 @@ const Tabs = (props) => {
11541
11544
  item.title
11542
11545
  )
11543
11546
  );
11544
- })), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$j}-content-wrap` }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$j}-content`, style: contentStyle }, React__default.Children.map(children, (child, idx) => {
11547
+ })), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$j}-content-wrap` }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$j}-content`, style: getContentStyle() }, React__default.Children.map(children, (child, idx) => {
11545
11548
  if (!React__default.isValidElement(child)) {
11546
11549
  return null;
11547
11550
  }
@@ -14656,10 +14659,23 @@ const DatePicker = (props) => {
14656
14659
  return result;
14657
14660
  }
14658
14661
  };
14659
- const compareDateChange = (currentDate, newDate) => {
14662
+ const compareDateChange = (currentDate, newDate, selectedOptions, index) => {
14660
14663
  var _a;
14661
14664
  const isEqual2 = ((_a = new Date(currentDate)) == null ? void 0 : _a.getTime()) === (newDate == null ? void 0 : newDate.getTime());
14662
- newDate && isDate(newDate) && !isEqual2 && setSelectedDate(formatValue(newDate));
14665
+ if (newDate && isDate(newDate)) {
14666
+ if (!isEqual2) {
14667
+ setSelectedDate(formatValue(newDate));
14668
+ }
14669
+ props.onChange && props.onChange(
14670
+ selectedOptions,
14671
+ [
14672
+ String(newDate.getFullYear()),
14673
+ String(newDate.getMonth() + 1),
14674
+ String(newDate.getDate())
14675
+ ],
14676
+ index
14677
+ );
14678
+ }
14663
14679
  };
14664
14680
  const handlePickerChange = (selectedOptions, selectedValue, index) => {
14665
14681
  const rangeType = type4.toLocaleLowerCase();
@@ -14700,7 +14716,7 @@ const DatePicker = (props) => {
14700
14716
  } else if (rangeType === "datehour") {
14701
14717
  date4 = new Date(year, month, day, Number(formatDate[3]));
14702
14718
  }
14703
- compareDateChange(selectedDate, date4);
14719
+ compareDateChange(selectedDate, date4, selectedOptions, index);
14704
14720
  } else {
14705
14721
  const [hour, minute, seconds] = selectedValue;
14706
14722
  const currentDate = new Date(selectedDate);
@@ -14715,9 +14731,8 @@ const DatePicker = (props) => {
14715
14731
  Number(minute),
14716
14732
  rangeType === "time" ? Number(seconds) : 0
14717
14733
  );
14718
- compareDateChange(selectedDate, date4);
14734
+ compareDateChange(selectedDate, date4, selectedOptions, index);
14719
14735
  }
14720
- props.onChange && props.onChange(selectedOptions, selectedValue, index);
14721
14736
  };
14722
14737
  const formatOption = (type22, value) => {
14723
14738
  if (formatter) {
@@ -16549,7 +16564,7 @@ const InputNumber = (props) => {
16549
16564
  ...defaultProps$U,
16550
16565
  ...props
16551
16566
  };
16552
- const classes = classNames(classPrefix$g, {
16567
+ const classes = classNames(classPrefix$g, className, {
16553
16568
  [`${classPrefix$g}-disabled`]: disabled
16554
16569
  });
16555
16570
  const [focused, setFocused] = useState(false);
@@ -18372,7 +18387,6 @@ const InternalSignature = (props, ref) => {
18372
18387
  default:
18373
18388
  dataurl = canvas.toDataURL("image/png");
18374
18389
  }
18375
- handleClearBtn();
18376
18390
  onConfirm && onConfirm(canvas, dataurl);
18377
18391
  };
18378
18392
  useImperativeHandle(ref, () => ({
@@ -2,7 +2,7 @@
2
2
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react-dom")) : typeof define === "function" && define.amd ? define(["exports", "react", "react-dom"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory((global2.nutui = global2.nutui || {}, global2.nutui.react = {}), global2.React, global2.ReactDOM));
3
3
  })(this, function(exports2, React, ReactDOM) {
4
4
  "use strict";/*!
5
- * @nutui/nutui-react v2.6.1 Fri Apr 19 2024 14:49:31 GMT+0800 (China Standard Time)
5
+ * @nutui/nutui-react v2.6.3 Tue Apr 30 2024 14:15:24 GMT+0800 (China Standard Time)
6
6
  * (c) 2023 @jdf2e.
7
7
  * Released under the MIT License.
8
8
  */
@@ -11417,7 +11417,6 @@ Please add \`${key}Action\` when creating your handler.`);
11417
11417
  finalValue: 0,
11418
11418
  onChange
11419
11419
  });
11420
- const [contentStyle, setContentStyle] = React.useState({});
11421
11420
  const titleItemsRef = React.useRef([]);
11422
11421
  const navRef = React.useRef(null);
11423
11422
  const scrollDirection = (nav, to2, duration2, direction2) => {
@@ -11498,13 +11497,17 @@ Please add \`${key}Action\` when creating your handler.`);
11498
11497
  color: activeType === "smile" ? activeColor : "",
11499
11498
  background: activeType === "line" ? activeColor : ""
11500
11499
  };
11501
- React.useEffect(() => {
11500
+ const getContentStyle = () => {
11502
11501
  let index = titles.current.findIndex((t2) => t2.value == value);
11503
11502
  index = index < 0 ? 0 : index;
11504
- setContentStyle({
11503
+ return {
11505
11504
  transform: direction === "horizontal" ? `translate3d(${rtl ? "" : "-"}${index * 100}%, 0, 0)` : `translate3d( 0,-${index * 100}%, 0)`,
11506
11505
  transitionDuration: `${duration}ms`
11507
- });
11506
+ };
11507
+ };
11508
+ React.useEffect(() => {
11509
+ let index = titles.current.findIndex((t2) => t2.value == value);
11510
+ index = index < 0 ? 0 : index;
11508
11511
  setTimeout(() => {
11509
11512
  scrollIntoView(index);
11510
11513
  });
@@ -11559,7 +11562,7 @@ Please add \`${key}Action\` when creating your handler.`);
11559
11562
  item.title
11560
11563
  )
11561
11564
  );
11562
- })), /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$j}-content-wrap` }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$j}-content`, style: contentStyle }, React.Children.map(children, (child, idx) => {
11565
+ })), /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$j}-content-wrap` }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$j}-content`, style: getContentStyle() }, React.Children.map(children, (child, idx) => {
11563
11566
  if (!React.isValidElement(child)) {
11564
11567
  return null;
11565
11568
  }
@@ -14674,10 +14677,23 @@ Please add \`${key}Action\` when creating your handler.`);
14674
14677
  return result;
14675
14678
  }
14676
14679
  };
14677
- const compareDateChange = (currentDate, newDate) => {
14680
+ const compareDateChange = (currentDate, newDate, selectedOptions, index) => {
14678
14681
  var _a;
14679
14682
  const isEqual2 = ((_a = new Date(currentDate)) == null ? void 0 : _a.getTime()) === (newDate == null ? void 0 : newDate.getTime());
14680
- newDate && isDate(newDate) && !isEqual2 && setSelectedDate(formatValue(newDate));
14683
+ if (newDate && isDate(newDate)) {
14684
+ if (!isEqual2) {
14685
+ setSelectedDate(formatValue(newDate));
14686
+ }
14687
+ props.onChange && props.onChange(
14688
+ selectedOptions,
14689
+ [
14690
+ String(newDate.getFullYear()),
14691
+ String(newDate.getMonth() + 1),
14692
+ String(newDate.getDate())
14693
+ ],
14694
+ index
14695
+ );
14696
+ }
14681
14697
  };
14682
14698
  const handlePickerChange = (selectedOptions, selectedValue, index) => {
14683
14699
  const rangeType = type2.toLocaleLowerCase();
@@ -14718,7 +14734,7 @@ Please add \`${key}Action\` when creating your handler.`);
14718
14734
  } else if (rangeType === "datehour") {
14719
14735
  date2 = new Date(year, month, day, Number(formatDate[3]));
14720
14736
  }
14721
- compareDateChange(selectedDate, date2);
14737
+ compareDateChange(selectedDate, date2, selectedOptions, index);
14722
14738
  } else {
14723
14739
  const [hour, minute, seconds] = selectedValue;
14724
14740
  const currentDate = new Date(selectedDate);
@@ -14733,9 +14749,8 @@ Please add \`${key}Action\` when creating your handler.`);
14733
14749
  Number(minute),
14734
14750
  rangeType === "time" ? Number(seconds) : 0
14735
14751
  );
14736
- compareDateChange(selectedDate, date2);
14752
+ compareDateChange(selectedDate, date2, selectedOptions, index);
14737
14753
  }
14738
- props.onChange && props.onChange(selectedOptions, selectedValue, index);
14739
14754
  };
14740
14755
  const formatOption = (type22, value) => {
14741
14756
  if (formatter) {
@@ -16567,7 +16582,7 @@ Please add \`${key}Action\` when creating your handler.`);
16567
16582
  ...defaultProps$U,
16568
16583
  ...props
16569
16584
  };
16570
- const classes = classNames(classPrefix$g, {
16585
+ const classes = classNames(classPrefix$g, className, {
16571
16586
  [`${classPrefix$g}-disabled`]: disabled
16572
16587
  });
16573
16588
  const [focused, setFocused] = React.useState(false);
@@ -18390,7 +18405,6 @@ Please add \`${key}Action\` when creating your handler.`);
18390
18405
  default:
18391
18406
  dataurl = canvas.toDataURL("image/png");
18392
18407
  }
18393
- handleClearBtn();
18394
18408
  onConfirm && onConfirm(canvas, dataurl);
18395
18409
  };
18396
18410
  React.useImperativeHandle(ref, () => ({
@@ -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
  }
@@ -4,7 +4,7 @@
4
4
  display: block;
5
5
  background-color: $color-background-overlay;
6
6
  color: $color-title;
7
- padding: 24px 20px;
7
+ padding: $tabs-tabpane-padding;
8
8
  box-sizing: border-box;
9
9
  overflow: auto;
10
10