@nutui/nutui-react 3.0.13-beta.1 → 3.0.14

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 (74) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  3. package/dist/cjs/packages/datepicker/utils.js +1 -1
  4. package/dist/cjs/packages/elevator/elevator.d.ts +3 -20
  5. package/dist/cjs/packages/elevator/elevator.js +35 -22
  6. package/dist/cjs/packages/elevator/index.d.ts +1 -1
  7. package/dist/cjs/packages/elevator/style/elevator.scss +61 -33
  8. package/dist/cjs/packages/elevator/style/style.css +65 -40
  9. package/dist/cjs/packages/elevator/style-jmapp/elevator.scss +61 -33
  10. package/dist/cjs/packages/elevator/style-jmapp/style.css +56 -31
  11. package/dist/cjs/packages/elevator/style-jrkf/elevator.scss +61 -33
  12. package/dist/cjs/packages/elevator/style-jrkf/style.css +56 -31
  13. package/dist/cjs/packages/image/image.js +11 -15
  14. package/dist/cjs/packages/navbar/style/navbar.scss +2 -0
  15. package/dist/cjs/packages/navbar/style/style.css +2 -0
  16. package/dist/cjs/packages/navbar/style-jmapp/navbar.scss +2 -0
  17. package/dist/cjs/packages/navbar/style-jmapp/style.css +2 -0
  18. package/dist/cjs/packages/navbar/style-jrkf/navbar.scss +2 -0
  19. package/dist/cjs/packages/navbar/style-jrkf/style.css +2 -0
  20. package/dist/cjs/packages/price/style/price.scss +9 -0
  21. package/dist/cjs/packages/price/style/style.css +9 -0
  22. package/dist/cjs/packages/price/style-jmapp/price.scss +9 -0
  23. package/dist/cjs/packages/price/style-jmapp/style.css +9 -0
  24. package/dist/cjs/packages/price/style-jrkf/price.scss +9 -0
  25. package/dist/cjs/packages/price/style-jrkf/style.css +9 -0
  26. package/dist/cjs/packages/tabpane/style/style.css +1 -1
  27. package/dist/cjs/packages/tabpane/style/tabpane.scss +1 -1
  28. package/dist/cjs/packages/tabpane/style-jmapp/style.css +1 -1
  29. package/dist/cjs/packages/tabpane/style-jmapp/tabpane.scss +1 -1
  30. package/dist/cjs/packages/tabpane/style-jrkf/style.css +1 -1
  31. package/dist/cjs/packages/tabpane/style-jrkf/tabpane.scss +1 -1
  32. package/dist/cjs/types/spec/elevator/base.d.ts +5 -2
  33. package/dist/es/packages/configprovider/types.d.ts +1 -1
  34. package/dist/es/packages/datepicker/utils.js +1 -1
  35. package/dist/es/packages/elevator/elevator.d.ts +3 -20
  36. package/dist/es/packages/elevator/elevator.js +35 -22
  37. package/dist/es/packages/elevator/index.d.ts +1 -1
  38. package/dist/es/packages/elevator/style/elevator.scss +61 -33
  39. package/dist/es/packages/elevator/style/style.css +65 -40
  40. package/dist/es/packages/elevator/style-jmapp/elevator.scss +61 -33
  41. package/dist/es/packages/elevator/style-jmapp/style.css +56 -31
  42. package/dist/es/packages/elevator/style-jrkf/elevator.scss +61 -33
  43. package/dist/es/packages/elevator/style-jrkf/style.css +56 -31
  44. package/dist/es/packages/image/image.js +11 -15
  45. package/dist/es/packages/navbar/style/navbar.scss +2 -0
  46. package/dist/es/packages/navbar/style/style.css +2 -0
  47. package/dist/es/packages/navbar/style-jmapp/navbar.scss +2 -0
  48. package/dist/es/packages/navbar/style-jmapp/style.css +2 -0
  49. package/dist/es/packages/navbar/style-jrkf/navbar.scss +2 -0
  50. package/dist/es/packages/navbar/style-jrkf/style.css +2 -0
  51. package/dist/es/packages/price/style/price.scss +9 -0
  52. package/dist/es/packages/price/style/style.css +9 -0
  53. package/dist/es/packages/price/style-jmapp/price.scss +9 -0
  54. package/dist/es/packages/price/style-jmapp/style.css +9 -0
  55. package/dist/es/packages/price/style-jrkf/price.scss +9 -0
  56. package/dist/es/packages/price/style-jrkf/style.css +9 -0
  57. package/dist/es/packages/tabpane/style/style.css +1 -1
  58. package/dist/es/packages/tabpane/style/tabpane.scss +1 -1
  59. package/dist/es/packages/tabpane/style-jmapp/style.css +1 -1
  60. package/dist/es/packages/tabpane/style-jmapp/tabpane.scss +1 -1
  61. package/dist/es/packages/tabpane/style-jrkf/style.css +1 -1
  62. package/dist/es/packages/tabpane/style-jrkf/tabpane.scss +1 -1
  63. package/dist/es/types/spec/elevator/base.d.ts +15 -6
  64. package/dist/nutui.react.umd.js +240 -233
  65. package/dist/style-jmapp.css +1 -1
  66. package/dist/style-jmapp.scss +21 -21
  67. package/dist/style-jrkf.css +1 -1
  68. package/dist/style-jrkf.scss +36 -36
  69. package/dist/style.css +1 -1
  70. package/dist/style.scss +40 -40
  71. package/dist/styles/variables-jmapp.scss +14 -2
  72. package/dist/styles/variables-jrkf.scss +14 -2
  73. package/dist/styles/variables.scss +24 -43
  74. package/package.json +1 -1
@@ -2904,26 +2904,21 @@ Check the top-level render call using <` + t + ">.");
2904
2904
  onClick: function(e2) {
2905
2905
  imageClick(e2);
2906
2906
  }
2907
- }, lazy ? /* @__PURE__ */ React.createElement("img", {
2907
+ }, /* @__PURE__ */ React.createElement("img", _object_spread_props(_object_spread({
2908
2908
  ref: imgRef,
2909
- className: "".concat(classPrefix$s, "-default lazyload"),
2910
- style: imgStyle,
2909
+ className: classNames("".concat(classPrefix$s, "-default"), lazy && "lazyload", _define_property({}, "".concat(classPrefix$s, "-error"), isError)),
2910
+ style: imgStyle
2911
+ }, lazy ? {
2911
2912
  "data-src": src,
2912
- alt,
2913
- loading: "lazy",
2914
- onLoad: handleLoad,
2915
- onError: handleError,
2916
- draggable
2917
- }) : /* @__PURE__ */ React.createElement("img", {
2918
- ref: imgRef,
2919
- className: "".concat(classPrefix$s, "-default"),
2920
- style: imgStyle,
2921
- src,
2913
+ loading: "lazy"
2914
+ } : {
2915
+ src
2916
+ }), {
2922
2917
  alt,
2923
2918
  onLoad: handleLoad,
2924
2919
  onError: handleError,
2925
2920
  draggable
2926
- }), renderLoading(), renderErrorImg());
2921
+ })), renderLoading(), renderErrorImg());
2927
2922
  };
2928
2923
  Image$1.displayName = "NutImage";
2929
2924
  function _extends$4() {
@@ -10414,26 +10409,225 @@ Please add \`${key2}Action\` when creating your handler.`);
10414
10409
  }
10415
10410
  });
10416
10411
  const animated = host.animated;
10412
+ var getTargetElement = function(target) {
10413
+ var targetElement;
10414
+ if (isFunction(target)) {
10415
+ targetElement = target();
10416
+ } else if ("current" in target) {
10417
+ targetElement = target.current;
10418
+ } else {
10419
+ targetElement = target;
10420
+ }
10421
+ return targetElement;
10422
+ };
10423
+ function useClickAway(onClickAway, target) {
10424
+ var eventName = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "click", useCapture = arguments.length > 3 ? arguments[3] : void 0, isListener = arguments.length > 4 ? arguments[4] : void 0, outerVar = arguments.length > 5 ? arguments[5] : void 0;
10425
+ var handler = function(event) {
10426
+ var targets = Array.isArray(target) ? target : [
10427
+ target
10428
+ ];
10429
+ if (targets.some(function(item) {
10430
+ var targetElement = getTargetElement(item);
10431
+ return !targetElement || targetElement.contains(event.target);
10432
+ })) {
10433
+ return;
10434
+ }
10435
+ if (outerVar) {
10436
+ onClickAway();
10437
+ }
10438
+ };
10439
+ React.useEffect(function() {
10440
+ if (isListener) {
10441
+ window.addEventListener(eventName, handler, useCapture);
10442
+ } else {
10443
+ window.removeEventListener(eventName, handler, useCapture);
10444
+ }
10445
+ return function() {
10446
+ window.removeEventListener(eventName, handler, useCapture);
10447
+ };
10448
+ }, [
10449
+ target
10450
+ ]);
10451
+ }
10452
+ function useForceUpdate() {
10453
+ var _React_useState = _sliced_to_array(React.useState(), 2), updateState = _React_useState[1];
10454
+ return React.useCallback(function() {
10455
+ return updateState({});
10456
+ }, []);
10457
+ }
10458
+ var useIsomorphicLayoutEffect = canUseDom ? React.useLayoutEffect : React.useEffect;
10459
+ var defaultPaginationOptions = {
10460
+ current: 0,
10461
+ itemsPerPage: 10,
10462
+ displayCount: 5,
10463
+ ellipse: false
10464
+ };
10465
+ function human2Machine(number2) {
10466
+ return --number2;
10467
+ }
10468
+ function calculateNodes(options2, nodesCount) {
10469
+ var halfIndex = Math.floor(options2.displayCount / 2);
10470
+ var buttonsCountIndex = human2Machine(nodesCount);
10471
+ var displayCountIndex = human2Machine(options2.displayCount);
10472
+ var currentIndex = human2Machine(options2.current);
10473
+ var start2;
10474
+ var end;
10475
+ if (buttonsCountIndex <= displayCountIndex) {
10476
+ start2 = 0;
10477
+ end = buttonsCountIndex;
10478
+ } else {
10479
+ start2 = Math.max(0, currentIndex - halfIndex);
10480
+ end = Math.min(buttonsCountIndex, currentIndex + halfIndex);
10481
+ if (end - start2 < displayCountIndex) {
10482
+ if (start2 === 0) {
10483
+ end = Math.min(start2 + displayCountIndex, buttonsCountIndex);
10484
+ } else if (end === buttonsCountIndex) {
10485
+ start2 = Math.max(end - displayCountIndex, 1);
10486
+ }
10487
+ } else if (end - start2 > displayCountIndex) {
10488
+ end = start2 + displayCountIndex;
10489
+ }
10490
+ }
10491
+ var buttons = [];
10492
+ for (var i2 = start2; i2 <= end; i2++) {
10493
+ var humanPageNumber = i2 + 1;
10494
+ buttons.push({
10495
+ number: humanPageNumber,
10496
+ text: humanPageNumber.toString(),
10497
+ selected: options2.current === humanPageNumber
10498
+ });
10499
+ }
10500
+ return addEllipses(buttons, {
10501
+ nodesCount,
10502
+ ellipse: options2.ellipse,
10503
+ displayCount: options2.displayCount
10504
+ });
10505
+ }
10506
+ function addEllipses(nodes, param) {
10507
+ var displayCount = param.displayCount, nodesCount = param.nodesCount, ellipse = param.ellipse;
10508
+ if (nodesCount <= displayCount || !ellipse) return nodes;
10509
+ var start2 = nodes[0];
10510
+ var end = nodes[nodes.length - 1];
10511
+ var leftEllipse = start2.number > 1;
10512
+ var rightEllipse = end.number < nodesCount;
10513
+ if (leftEllipse) {
10514
+ nodes.unshift({
10515
+ number: start2.number - 1,
10516
+ text: "..."
10517
+ });
10518
+ }
10519
+ if (rightEllipse) {
10520
+ nodes.push({
10521
+ number: end.number + 1,
10522
+ text: "..."
10523
+ });
10524
+ }
10525
+ return nodes;
10526
+ }
10527
+ var usePagination = function(options2) {
10528
+ var mergedOptions = _object_spread({}, defaultPaginationOptions, options2);
10529
+ var total = mergedOptions.total, itemsPerPage = mergedOptions.itemsPerPage;
10530
+ var nodesCount = Math.ceil((total || 0) / itemsPerPage) || 1;
10531
+ return [
10532
+ calculateNodes(mergedOptions, nodesCount),
10533
+ nodesCount
10534
+ ];
10535
+ };
10536
+ function usePropsValue(param) {
10537
+ var value2 = param.value, defaultValue = param.defaultValue, finalValue = param.finalValue, _param_onChange = param.onChange, onChange = _param_onChange === void 0 ? function(value3) {
10538
+ } : _param_onChange;
10539
+ var forceUpdate = useForceUpdate();
10540
+ var dfValue = defaultValue !== void 0 ? defaultValue : finalValue;
10541
+ var stateRef = React.useRef(value2 !== void 0 ? value2 : dfValue);
10542
+ if (value2 !== void 0) {
10543
+ stateRef.current = value2;
10544
+ }
10545
+ var setState = React.useCallback(function(v) {
10546
+ var forceTrigger = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
10547
+ var prevState = stateRef.current;
10548
+ stateRef.current = v;
10549
+ if (prevState !== stateRef.current || forceTrigger) {
10550
+ forceUpdate();
10551
+ onChange === null || onChange === void 0 ? void 0 : onChange(v);
10552
+ }
10553
+ }, [
10554
+ value2,
10555
+ onChange
10556
+ ]);
10557
+ return [
10558
+ stateRef.current,
10559
+ setState
10560
+ ];
10561
+ }
10562
+ var getRefValue = function(ref) {
10563
+ return ref.current;
10564
+ };
10565
+ var useRefState = function(param) {
10566
+ var ref = React.useRef(param);
10567
+ var _useState = _sliced_to_array(React.useState(param), 2), setState = _useState[1];
10568
+ var updateState = function(p2) {
10569
+ ref.current = p2;
10570
+ setState(p2);
10571
+ };
10572
+ return [
10573
+ ref,
10574
+ updateState
10575
+ ];
10576
+ };
10577
+ function useRefs() {
10578
+ var refs = React.useRef([]);
10579
+ var setRefs = React.useCallback(function(index2) {
10580
+ return function(el) {
10581
+ if (el) refs.current[index2] = el;
10582
+ };
10583
+ }, []);
10584
+ var reset = React.useCallback(function() {
10585
+ refs.current = [];
10586
+ }, []);
10587
+ return [
10588
+ refs.current,
10589
+ setRefs,
10590
+ reset
10591
+ ];
10592
+ }
10593
+ var idCounter = {};
10594
+ function uniqueId() {
10595
+ var prefix2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "$nut$";
10596
+ if (!idCounter[prefix2]) {
10597
+ idCounter[prefix2] = 0;
10598
+ }
10599
+ var id = ++idCounter[prefix2];
10600
+ if (prefix2 === "$nut$") {
10601
+ return "".concat(id);
10602
+ }
10603
+ return "".concat(prefix2).concat(id);
10604
+ }
10605
+ function useUuid() {
10606
+ var idRef = React.useRef(uniqueId());
10607
+ return idRef.current;
10608
+ }
10417
10609
  var elevatorContext = /* @__PURE__ */ React.createContext({});
10418
10610
  var defaultProps$1n = _object_spread_props(_object_spread({}, ComponentDefaults), {
10611
+ mode: "horizontal",
10419
10612
  height: "200px",
10420
10613
  floorKey: "title",
10421
10614
  list: [],
10422
10615
  sticky: false,
10423
- spaceHeight: 23,
10424
- titleHeight: 35,
10425
- showKeys: true
10616
+ spaceHeight: 18,
10617
+ showKeys: true,
10618
+ defaultValue: void 0,
10619
+ value: void 0
10426
10620
  });
10427
10621
  var Elevator = function(props) {
10428
- var _ref = _object_spread({}, defaultProps$1n, props), height2 = _ref.height, floorKey = _ref.floorKey, list = _ref.list, sticky = _ref.sticky, spaceHeight = _ref.spaceHeight;
10429
- _ref.titleHeight;
10430
- var showKeys = _ref.showKeys, className = _ref.className, style = _ref.style, onItemClick = _ref.onItemClick, onIndexClick = _ref.onIndexClick, children = _ref.children, rest = _object_without_properties(_ref, [
10622
+ var _ref = _object_spread({}, defaultProps$1n, props), value2 = _ref.value, defaultValue = _ref.defaultValue, mode = _ref.mode, height2 = _ref.height, floorKey = _ref.floorKey, list = _ref.list, sticky = _ref.sticky, spaceHeight = _ref.spaceHeight, showKeys = _ref.showKeys, className = _ref.className, style = _ref.style, onItemClick = _ref.onItemClick, onIndexClick = _ref.onIndexClick, children = _ref.children, rest = _object_without_properties(_ref, [
10623
+ "value",
10624
+ "defaultValue",
10625
+ "mode",
10431
10626
  "height",
10432
10627
  "floorKey",
10433
10628
  "list",
10434
10629
  "sticky",
10435
10630
  "spaceHeight",
10436
- "titleHeight",
10437
10631
  "showKeys",
10438
10632
  "className",
10439
10633
  "style",
@@ -10454,18 +10648,23 @@ Please add \`${key2}Action\` when creating your handler.`);
10454
10648
  y2: 0
10455
10649
  });
10456
10650
  var _useState = _sliced_to_array(React.useState(0), 2), scrollY = _useState[0], setScrollY = _useState[1];
10457
- var _useState1 = _sliced_to_array(React.useState({}), 2), currentData = _useState1[0], setCurrentData = _useState1[1];
10458
- var _useState2 = _sliced_to_array(React.useState(""), 2), currentKey = _useState2[0], setCurrentKey = _useState2[1];
10459
- var _useState3 = _sliced_to_array(React.useState(0), 2), currentIndex = _useState3[0], setCurrentIndex = _useState3[1];
10460
- var _useState4 = _sliced_to_array(React.useState(0), 2), codeIndex = _useState4[0], setCodeIndex = _useState4[1];
10461
- var _useState5 = _sliced_to_array(React.useState(false), 2), scrollStart = _useState5[0], setScrollStart = _useState5[1];
10651
+ var _usePropsValue = _sliced_to_array(usePropsValue({
10652
+ value: value2,
10653
+ defaultValue: defaultValue || {}
10654
+ }), 2), currentData = _usePropsValue[0], setCurrentData = _usePropsValue[1];
10655
+ var _useState1 = _sliced_to_array(React.useState(0), 2), currentIndex = _useState1[0], setCurrentIndex = _useState1[1];
10656
+ var _useState2 = _sliced_to_array(React.useState(0), 2), codeIndex = _useState2[0], setCodeIndex = _useState2[1];
10657
+ var _useState3 = _sliced_to_array(React.useState(false), 2), scrollStart = _useState3[0], setScrollStart = _useState3[1];
10462
10658
  var state = React.useRef(initData);
10463
10659
  var resetScrollState = function() {
10464
10660
  setScrollStart(false);
10465
10661
  };
10466
10662
  var getData = function(el, name2) {
10467
10663
  var prefix2 = "data-";
10468
- return el.getAttribute(prefix2 + name2);
10664
+ if (el.hasAttribute("data-index")) {
10665
+ return el.getAttribute(prefix2 + name2);
10666
+ }
10667
+ return "-1";
10469
10668
  };
10470
10669
  var calculateHeight = function() {
10471
10670
  var height3 = 0;
@@ -10500,6 +10699,10 @@ Please add \`${key2}Action\` when creating your handler.`);
10500
10699
  var target = param.target, offset = param.offset;
10501
10700
  setScrollStart(true);
10502
10701
  var index2 = Number(getData(target, "index"));
10702
+ if (index2 < 0) {
10703
+ setScrollStart(false);
10704
+ return;
10705
+ }
10503
10706
  touchState.current.y1 = offset[1];
10504
10707
  state.current.anchorIndex = +index2;
10505
10708
  setCodeIndex(function(codeIndex2) {
@@ -10520,7 +10723,6 @@ Please add \`${key2}Action\` when creating your handler.`);
10520
10723
  var handleClickItem = function(key2, item) {
10521
10724
  onItemClick && onItemClick(key2, item);
10522
10725
  setCurrentData(item);
10523
- setCurrentKey(key2);
10524
10726
  };
10525
10727
  var handleClickIndex = function(key2) {
10526
10728
  onIndexClick && onIndexClick(key2);
@@ -10565,13 +10767,13 @@ Please add \`${key2}Action\` when creating your handler.`);
10565
10767
  ]);
10566
10768
  var _obj;
10567
10769
  return /* @__PURE__ */ React.createElement("div", _object_spread({
10568
- className: "".concat(classPrefix2, " ").concat(className),
10770
+ className: "".concat(classPrefix2, " ").concat(classPrefix2, "-").concat(mode, " ").concat(className),
10569
10771
  style
10570
- }, rest), sticky && scrollY > 0 ? /* @__PURE__ */ React.createElement("div", {
10772
+ }, rest), mode === "vertical" && sticky && scrollY > 0 ? /* @__PURE__ */ React.createElement("div", {
10571
10773
  className: "".concat(classPrefix2, "-list-fixed")
10572
10774
  }, /* @__PURE__ */ React.createElement("span", {
10573
10775
  className: "".concat(classPrefix2, "-list-fixed-title")
10574
- }, list[currentIndex][floorKey])) : null, /* @__PURE__ */ React.createElement("div", {
10776
+ }, list[currentIndex] && String(list[currentIndex][floorKey]))) : null, /* @__PURE__ */ React.createElement("div", {
10575
10777
  className: "".concat(classPrefix2, "-list"),
10576
10778
  style: {
10577
10779
  height: Number.isNaN(+height2) ? height2 : "".concat(height2, "px")
@@ -10585,10 +10787,12 @@ Please add \`${key2}Action\` when creating your handler.`);
10585
10787
  key: idx
10586
10788
  }, /* @__PURE__ */ React.createElement("div", {
10587
10789
  className: "".concat(classPrefix2, "-list-item-code")
10588
- }, item[floorKey]), /* @__PURE__ */ React.createElement(React.Fragment, null, item.list.map(function(subitem) {
10790
+ }, item[floorKey]), /* @__PURE__ */ React.createElement("div", {
10791
+ className: "".concat(classPrefix2, "-list-item-sublist")
10792
+ }, item.list.map(function(subitem) {
10589
10793
  var _obj2;
10590
10794
  return /* @__PURE__ */ React.createElement("div", {
10591
- className: classNames((_obj2 = {}, _define_property(_obj2, "".concat(classPrefix2, "-list-item-name"), true), _define_property(_obj2, "".concat(classPrefix2, "-list-item-name-highcolor"), currentData.id === subitem.id && currentKey === item[floorKey]), _obj2)),
10795
+ className: classNames((_obj2 = {}, _define_property(_obj2, "".concat(classPrefix2, "-list-item-name"), true), _define_property(_obj2, "".concat(classPrefix2, "-list-item-name-highcolor"), currentData.id === subitem.id), _obj2)),
10592
10796
  key: subitem.id,
10593
10797
  onClick: function() {
10594
10798
  return handleClickItem(item[floorKey], subitem);
@@ -10599,7 +10803,7 @@ Please add \`${key2}Action\` when creating your handler.`);
10599
10803
  })));
10600
10804
  }))), showKeys ? /* @__PURE__ */ React.createElement(React.Fragment, null, list.length && scrollStart ? /* @__PURE__ */ React.createElement("div", {
10601
10805
  className: classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-code-current"), true), _define_property(_obj, "".concat(classPrefix2, "-code-current-current"), true), _obj))
10602
- }, list[codeIndex][floorKey]) : null, /* @__PURE__ */ React.createElement("div", {
10806
+ }, list[codeIndex] && String(list[codeIndex][floorKey])) : null, /* @__PURE__ */ React.createElement("div", {
10603
10807
  className: "".concat(classPrefix2, "-bars")
10604
10808
  }, /* @__PURE__ */ React.createElement(animated.div, _object_spread_props(_object_spread({
10605
10809
  className: "".concat(classPrefix2, "-bars-inner")
@@ -10617,7 +10821,7 @@ Please add \`${key2}Action\` when creating your handler.`);
10617
10821
  onClick: function() {
10618
10822
  return handleClickIndex(item[floorKey]);
10619
10823
  }
10620
- }, item[floorKey]);
10824
+ }, String(item[floorKey]));
10621
10825
  })))) : null);
10622
10826
  };
10623
10827
  Elevator.displayName = "NutElevator";
@@ -10833,38 +11037,6 @@ Please add \`${key2}Action\` when creating your handler.`);
10833
11037
  className: classes
10834
11038
  }, !disabled && children) : null;
10835
11039
  };
10836
- function useForceUpdate() {
10837
- var _React_useState = _sliced_to_array(React.useState(), 2), updateState = _React_useState[1];
10838
- return React.useCallback(function() {
10839
- return updateState({});
10840
- }, []);
10841
- }
10842
- function usePropsValue(param) {
10843
- var value2 = param.value, defaultValue = param.defaultValue, finalValue = param.finalValue, _param_onChange = param.onChange, onChange = _param_onChange === void 0 ? function(value3) {
10844
- } : _param_onChange;
10845
- var forceUpdate = useForceUpdate();
10846
- var dfValue = defaultValue !== void 0 ? defaultValue : finalValue;
10847
- var stateRef = React.useRef(value2 !== void 0 ? value2 : dfValue);
10848
- if (value2 !== void 0) {
10849
- stateRef.current = value2;
10850
- }
10851
- var setState = React.useCallback(function(v) {
10852
- var forceTrigger = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
10853
- var prevState = stateRef.current;
10854
- stateRef.current = v;
10855
- if (prevState !== stateRef.current || forceTrigger) {
10856
- forceUpdate();
10857
- onChange === null || onChange === void 0 ? void 0 : onChange(v);
10858
- }
10859
- }, [
10860
- value2,
10861
- onChange
10862
- ]);
10863
- return [
10864
- stateRef.current,
10865
- setState
10866
- ];
10867
- }
10868
11040
  var defaultProps$1i = _object_spread_props(_object_spread({}, ComponentDefaults), {
10869
11041
  contentDuration: 0,
10870
11042
  sidebarDuration: 0
@@ -11550,21 +11722,6 @@ Please add \`${key2}Action\` when creating your handler.`);
11550
11722
  }
11551
11723
  return map[topId];
11552
11724
  };
11553
- var getRefValue = function(ref) {
11554
- return ref.current;
11555
- };
11556
- var useRefState = function(param) {
11557
- var ref = React.useRef(param);
11558
- var _useState = _sliced_to_array(React.useState(param), 2), setState = _useState[1];
11559
- var updateState = function(p2) {
11560
- ref.current = p2;
11561
- setState(p2);
11562
- };
11563
- return [
11564
- ref,
11565
- updateState
11566
- ];
11567
- };
11568
11725
  var defaultProps$1c = _object_spread_props(_object_spread({}, ComponentDefaults), {
11569
11726
  activeColor: "",
11570
11727
  activeIcon: "checklist",
@@ -14364,22 +14521,6 @@ Please add \`${key2}Action\` when creating your handler.`);
14364
14521
  })) : null);
14365
14522
  };
14366
14523
  var PickerView = /* @__PURE__ */ React.forwardRef(InternalPickerView);
14367
- function useRefs() {
14368
- var refs = React.useRef([]);
14369
- var setRefs = React.useCallback(function(index2) {
14370
- return function(el) {
14371
- if (el) refs.current[index2] = el;
14372
- };
14373
- }, []);
14374
- var reset = React.useCallback(function() {
14375
- refs.current = [];
14376
- }, []);
14377
- return [
14378
- refs.current,
14379
- setRefs,
14380
- reset
14381
- ];
14382
- }
14383
14524
  var defaultProps$11 = _object_spread_props(_object_spread({}, ComponentDefaults), {
14384
14525
  title: "",
14385
14526
  options: [],
@@ -14570,7 +14711,7 @@ Please add \`${key2}Action\` when creating your handler.`);
14570
14711
  return _obj = {}, _define_property(_obj, "".concat(type2, "Year"), year), _define_property(_obj, "".concat(type2, "Month"), month), _define_property(_obj, "".concat(type2, "Date"), date2), _define_property(_obj, "".concat(type2, "Hour"), hour), _define_property(_obj, "".concat(type2, "Minute"), minute), _define_property(_obj, "".concat(type2, "Seconds"), minute), _obj;
14571
14712
  };
14572
14713
  var generateDatePickerRanges = function(type2, selectedDate, startDate, endDate) {
14573
- var selected = new Date(selectedDate);
14714
+ var selected = selectedDate ? new Date(selectedDate) : new Date(startDate);
14574
14715
  if (!selected) return [];
14575
14716
  var _calculateDateBoundary = calculateDateBoundary("max", selected, startDate, endDate), maxYear = _calculateDateBoundary.maxYear, maxDate = _calculateDateBoundary.maxDate, maxMonth = _calculateDateBoundary.maxMonth, maxHour = _calculateDateBoundary.maxHour, maxMinute = _calculateDateBoundary.maxMinute, maxSeconds = _calculateDateBoundary.maxSeconds;
14576
14717
  var _calculateDateBoundary1 = calculateDateBoundary("min", selected, startDate, endDate), minYear = _calculateDateBoundary1.minYear, minDate = _calculateDateBoundary1.minDate, minMonth = _calculateDateBoundary1.minMonth, minHour = _calculateDateBoundary1.minHour, minMinute = _calculateDateBoundary1.minMinute, minSeconds = _calculateDateBoundary1.minSeconds;
@@ -17151,46 +17292,6 @@ Please add \`${key2}Action\` when creating your handler.`);
17151
17292
  })));
17152
17293
  };
17153
17294
  InputNumber.displayName = "NutInputNumber";
17154
- var getTargetElement = function(target) {
17155
- var targetElement;
17156
- if (isFunction(target)) {
17157
- targetElement = target();
17158
- } else if ("current" in target) {
17159
- targetElement = target.current;
17160
- } else {
17161
- targetElement = target;
17162
- }
17163
- return targetElement;
17164
- };
17165
- function useClickAway(onClickAway, target) {
17166
- var eventName = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "click", useCapture = arguments.length > 3 ? arguments[3] : void 0, isListener = arguments.length > 4 ? arguments[4] : void 0, outerVar = arguments.length > 5 ? arguments[5] : void 0;
17167
- var handler = function(event) {
17168
- var targets = Array.isArray(target) ? target : [
17169
- target
17170
- ];
17171
- if (targets.some(function(item) {
17172
- var targetElement = getTargetElement(item);
17173
- return !targetElement || targetElement.contains(event.target);
17174
- })) {
17175
- return;
17176
- }
17177
- if (outerVar) {
17178
- onClickAway();
17179
- }
17180
- };
17181
- React.useEffect(function() {
17182
- if (isListener) {
17183
- window.addEventListener(eventName, handler, useCapture);
17184
- } else {
17185
- window.removeEventListener(eventName, handler, useCapture);
17186
- }
17187
- return function() {
17188
- window.removeEventListener(eventName, handler, useCapture);
17189
- };
17190
- }, [
17191
- target
17192
- ]);
17193
- }
17194
17295
  var defaultProps$W = _object_spread_props(_object_spread({}, ComponentDefaults), {
17195
17296
  titleIcon: null,
17196
17297
  columns: 1,
@@ -23509,7 +23610,6 @@ Please add \`${key2}Action\` when creating your handler.`);
23509
23610
  };
23510
23611
  var CountDown = /* @__PURE__ */ React.forwardRef(InternalCountDown);
23511
23612
  CountDown.displayName = "NutCountDown";
23512
- var useIsomorphicLayoutEffect = canUseDom ? React.useLayoutEffect : React.useEffect;
23513
23613
  var defaultProps$l = _object_spread_props(_object_spread({}, ComponentDefaults), {
23514
23614
  content: "",
23515
23615
  direction: "end",
@@ -41188,83 +41288,6 @@ Please add \`${key2}Action\` when creating your handler.`);
41188
41288
  }));
41189
41289
  });
41190
41290
  Lottie.displayName = "NutLottie";
41191
- var defaultPaginationOptions = {
41192
- current: 0,
41193
- itemsPerPage: 10,
41194
- displayCount: 5,
41195
- ellipse: false
41196
- };
41197
- function human2Machine(number2) {
41198
- return --number2;
41199
- }
41200
- function calculateNodes(options2, nodesCount) {
41201
- var halfIndex = Math.floor(options2.displayCount / 2);
41202
- var buttonsCountIndex = human2Machine(nodesCount);
41203
- var displayCountIndex = human2Machine(options2.displayCount);
41204
- var currentIndex = human2Machine(options2.current);
41205
- var start2;
41206
- var end;
41207
- if (buttonsCountIndex <= displayCountIndex) {
41208
- start2 = 0;
41209
- end = buttonsCountIndex;
41210
- } else {
41211
- start2 = Math.max(0, currentIndex - halfIndex);
41212
- end = Math.min(buttonsCountIndex, currentIndex + halfIndex);
41213
- if (end - start2 < displayCountIndex) {
41214
- if (start2 === 0) {
41215
- end = Math.min(start2 + displayCountIndex, buttonsCountIndex);
41216
- } else if (end === buttonsCountIndex) {
41217
- start2 = Math.max(end - displayCountIndex, 1);
41218
- }
41219
- } else if (end - start2 > displayCountIndex) {
41220
- end = start2 + displayCountIndex;
41221
- }
41222
- }
41223
- var buttons = [];
41224
- for (var i2 = start2; i2 <= end; i2++) {
41225
- var humanPageNumber = i2 + 1;
41226
- buttons.push({
41227
- number: humanPageNumber,
41228
- text: humanPageNumber.toString(),
41229
- selected: options2.current === humanPageNumber
41230
- });
41231
- }
41232
- return addEllipses(buttons, {
41233
- nodesCount,
41234
- ellipse: options2.ellipse,
41235
- displayCount: options2.displayCount
41236
- });
41237
- }
41238
- function addEllipses(nodes, param) {
41239
- var displayCount = param.displayCount, nodesCount = param.nodesCount, ellipse = param.ellipse;
41240
- if (nodesCount <= displayCount || !ellipse) return nodes;
41241
- var start2 = nodes[0];
41242
- var end = nodes[nodes.length - 1];
41243
- var leftEllipse = start2.number > 1;
41244
- var rightEllipse = end.number < nodesCount;
41245
- if (leftEllipse) {
41246
- nodes.unshift({
41247
- number: start2.number - 1,
41248
- text: "..."
41249
- });
41250
- }
41251
- if (rightEllipse) {
41252
- nodes.push({
41253
- number: end.number + 1,
41254
- text: "..."
41255
- });
41256
- }
41257
- return nodes;
41258
- }
41259
- var usePagination = function(options2) {
41260
- var mergedOptions = _object_spread({}, defaultPaginationOptions, options2);
41261
- var total = mergedOptions.total, itemsPerPage = mergedOptions.itemsPerPage;
41262
- var nodesCount = Math.ceil((total || 0) / itemsPerPage) || 1;
41263
- return [
41264
- calculateNodes(mergedOptions, nodesCount),
41265
- nodesCount
41266
- ];
41267
- };
41268
41291
  var defaultProps$f = _object_spread_props(_object_spread({}, ComponentDefaults), {
41269
41292
  defaultValue: 1,
41270
41293
  mode: "multi",
@@ -43361,22 +43384,6 @@ Please add \`${key2}Action\` when creating your handler.`);
43361
43384
  });
43362
43385
  };
43363
43386
  WaterMark.displayName = "NutWaterMark";
43364
- var idCounter = {};
43365
- function uniqueId() {
43366
- var prefix2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "$nut$";
43367
- if (!idCounter[prefix2]) {
43368
- idCounter[prefix2] = 0;
43369
- }
43370
- var id = ++idCounter[prefix2];
43371
- if (prefix2 === "$nut$") {
43372
- return "".concat(id);
43373
- }
43374
- return "".concat(prefix2).concat(id);
43375
- }
43376
- function useUuid() {
43377
- var idRef = React.useRef(uniqueId());
43378
- return idRef.current;
43379
- }
43380
43387
  exports.ActionSheet = ActionSheet;
43381
43388
  exports.Address = Address;
43382
43389
  exports.Animate = Animate;