@nutui/nutui-react 1.5.8-beta.0 → 1.5.9-beta.0

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.
@@ -6,7 +6,7 @@ var __publicField = (obj, key, value) => {
6
6
  };
7
7
  var _a;
8
8
  /*!
9
- * @nutui/nutui-react v1.5.8-beta.0 Wed Jun 07 2023 09:51:25 GMT+0800 (中国标准时间)
9
+ * @nutui/nutui-react v1.5.9-beta.0 Tue Jun 13 2023 14:37:59 GMT+0800 (China Standard Time)
10
10
  * (c) 2023 @jdf2e.
11
11
  * Released under the MIT License.
12
12
  */
@@ -15,10 +15,15 @@ import React__default, { useCallback, useState, useEffect, createContext, useMem
15
15
  import * as ReactDOM from "react-dom";
16
16
  import ReactDOM__default, { createPortal, unstable_batchedUpdates } from "react-dom";
17
17
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
18
- function getDefaultExportFromCjs(x) {
19
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
20
- }
21
- var classname = { exports: {} };
18
+ var classnameExports = {};
19
+ var classname = {
20
+ get exports() {
21
+ return classnameExports;
22
+ },
23
+ set exports(v) {
24
+ classnameExports = v;
25
+ }
26
+ };
22
27
  var classname_production_min = {};
23
28
  var hasRequiredClassname_production_min;
24
29
  function requireClassname_production_min() {
@@ -26,37 +31,37 @@ function requireClassname_production_min() {
26
31
  return classname_production_min;
27
32
  hasRequiredClassname_production_min = 1;
28
33
  function r(r2) {
29
- function t2(t3, i, a, o) {
30
- var f = i ? e + t3 + r2.e + i : e + t3, v = f;
34
+ function e2(e3, i, a, o) {
35
+ var f = i ? t + e3 + r2.e + i : t + e3, v = f;
31
36
  if (a) {
32
- var s = " " + v + r2.m;
33
- for (var u in a)
34
- if (a.hasOwnProperty(u)) {
35
- var p = a[u];
36
- true === p ? v += s + u : p && (v += s + u + n + p);
37
+ var u = " " + v + r2.m;
38
+ for (var s in a)
39
+ if (a.hasOwnProperty(s)) {
40
+ var p = a[s];
41
+ true === p ? v += u + s : p && (v += u + s + n + p);
37
42
  }
38
43
  }
39
44
  if (void 0 !== o)
40
- for (var y = 0, c = (o = Array.isArray(o) ? o : [o]).length; y < c; y++) {
41
- var l = o[y];
42
- if (l && "string" == typeof l.valueOf())
43
- for (var g = l.valueOf().split(" "), d = 0; d < g.length; d++) {
45
+ for (var c = 0, l = o.length; c < l; c++) {
46
+ var y = o[c];
47
+ if (y && "string" == typeof y.valueOf())
48
+ for (var g = y.valueOf().split(" "), d = 0; d < g.length; d++) {
44
49
  var h = g[d];
45
50
  h !== f && (v += " " + h);
46
51
  }
47
52
  }
48
53
  return v;
49
54
  }
50
- var e = r2.n || "", n = r2.v || r2.m;
51
- return function(r3, e2) {
55
+ var t = r2.n || "", n = r2.v || r2.m;
56
+ return function(r3, t2) {
52
57
  return function(n2, i, a) {
53
- return "string" == typeof n2 ? "string" == typeof i || Array.isArray(i) ? t2(r3, n2, void 0, i) : t2(r3, n2, i, a) : t2(r3, e2, n2, i);
58
+ return "string" == typeof n2 ? Array.isArray(i) ? e2(r3, n2, void 0, i) : e2(r3, n2, i, a) : e2(r3, t2, n2, i);
54
59
  };
55
60
  };
56
61
  }
57
62
  Object.defineProperty(classname_production_min, "__esModule", { value: true });
58
- var t = r({ e: "-", m: "_" });
59
- classname_production_min.cn = t, classname_production_min.withNaming = r;
63
+ var e = r({ e: "-", m: "_" });
64
+ classname_production_min.cn = e, classname_production_min.withNaming = r;
60
65
  return classname_production_min;
61
66
  }
62
67
  var classname_development = {};
@@ -86,7 +91,6 @@ function requireClassname_development() {
86
91
  }
87
92
  }
88
93
  if (mix !== void 0) {
89
- mix = Array.isArray(mix) ? mix : [mix];
90
94
  for (var i = 0, len = mix.length; i < len; i++) {
91
95
  var value = mix[i];
92
96
  if (!value || typeof value.valueOf() !== "string")
@@ -105,7 +109,7 @@ function requireClassname_development() {
105
109
  return function cnGenerator(b2, e) {
106
110
  return function(elemOrMods, elemModsOrBlockMix, elemMix) {
107
111
  if (typeof elemOrMods === "string") {
108
- if (typeof elemModsOrBlockMix === "string" || Array.isArray(elemModsOrBlockMix)) {
112
+ if (Array.isArray(elemModsOrBlockMix)) {
109
113
  return stringify(b2, elemOrMods, void 0, elemModsOrBlockMix);
110
114
  }
111
115
  return stringify(b2, elemOrMods, elemModsOrBlockMix, elemMix);
@@ -122,12 +126,13 @@ function requireClassname_development() {
122
126
  classname_development.withNaming = withNaming;
123
127
  return classname_development;
124
128
  }
125
- if (process.env.NODE_ENV === "production") {
126
- classname.exports = requireClassname_production_min();
127
- } else {
128
- classname.exports = requireClassname_development();
129
- }
130
- var classnameExports = classname.exports;
129
+ (function(module) {
130
+ if (process.env.NODE_ENV === "production") {
131
+ module.exports = requireClassname_production_min();
132
+ } else {
133
+ module.exports = requireClassname_development();
134
+ }
135
+ })(classname);
131
136
  const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
132
137
  const defaultProps$1s = {
133
138
  name: "",
@@ -739,7 +744,6 @@ function words(string3, pattern4, guard) {
739
744
  return string3.match(pattern4) || [];
740
745
  }
741
746
  var lodash_kebabcase = kebabCase;
742
- const kebabCase$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodash_kebabcase);
743
747
  const zhCN = {
744
748
  save: "保存",
745
749
  confirm: "确认",
@@ -887,7 +891,7 @@ const useConfig = () => {
887
891
  function convertThemeVarsToCSSVars(themeVars) {
888
892
  const cssVars = {};
889
893
  Object.keys(themeVars).forEach((key) => {
890
- cssVars[`--${kebabCase$1(key)}`] = themeVars[key];
894
+ cssVars[`--${lodash_kebabcase(key)}`] = themeVars[key];
891
895
  });
892
896
  return cssVars;
893
897
  }
@@ -1065,7 +1069,15 @@ const Image$1 = (props) => {
1065
1069
  };
1066
1070
  Image$1.defaultProps = defaultProps$1n;
1067
1071
  Image$1.displayName = "NutImage";
1068
- var classnames = { exports: {} };
1072
+ var classnamesExports = {};
1073
+ var classnames = {
1074
+ get exports() {
1075
+ return classnamesExports;
1076
+ },
1077
+ set exports(v) {
1078
+ classnamesExports = v;
1079
+ }
1080
+ };
1069
1081
  /*!
1070
1082
  Copyright (c) 2018 Jed Watson.
1071
1083
  Licensed under the MIT License (MIT), see
@@ -1112,8 +1124,7 @@ var classnames = { exports: {} };
1112
1124
  }
1113
1125
  })();
1114
1126
  })(classnames);
1115
- var classnamesExports = classnames.exports;
1116
- const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
1127
+ const classNames = classnamesExports;
1117
1128
  const defaultOverlayProps = {
1118
1129
  zIndex: 1e3,
1119
1130
  duration: 0.3,
@@ -1228,8 +1239,24 @@ function _inheritsLoose$1(subClass, superClass) {
1228
1239
  subClass.prototype.constructor = subClass;
1229
1240
  _setPrototypeOf$1(subClass, superClass);
1230
1241
  }
1231
- var propTypes = { exports: {} };
1232
- var reactIs = { exports: {} };
1242
+ var propTypesExports = {};
1243
+ var propTypes = {
1244
+ get exports() {
1245
+ return propTypesExports;
1246
+ },
1247
+ set exports(v) {
1248
+ propTypesExports = v;
1249
+ }
1250
+ };
1251
+ var reactIsExports = {};
1252
+ var reactIs = {
1253
+ get exports() {
1254
+ return reactIsExports;
1255
+ },
1256
+ set exports(v) {
1257
+ reactIsExports = v;
1258
+ }
1259
+ };
1233
1260
  var reactIs_production_min = {};
1234
1261
  /** @license React v16.13.1
1235
1262
  * react-is.production.min.js
@@ -1500,14 +1527,16 @@ function requireReactIs_development() {
1500
1527
  var hasRequiredReactIs;
1501
1528
  function requireReactIs() {
1502
1529
  if (hasRequiredReactIs)
1503
- return reactIs.exports;
1530
+ return reactIsExports;
1504
1531
  hasRequiredReactIs = 1;
1505
- if (process.env.NODE_ENV === "production") {
1506
- reactIs.exports = requireReactIs_production_min();
1507
- } else {
1508
- reactIs.exports = requireReactIs_development();
1509
- }
1510
- return reactIs.exports;
1532
+ (function(module) {
1533
+ if (process.env.NODE_ENV === "production") {
1534
+ module.exports = requireReactIs_production_min();
1535
+ } else {
1536
+ module.exports = requireReactIs_development();
1537
+ }
1538
+ })(reactIs);
1539
+ return reactIsExports;
1511
1540
  }
1512
1541
  /*
1513
1542
  object-assign
@@ -2174,8 +2203,6 @@ if (process.env.NODE_ENV !== "production") {
2174
2203
  } else {
2175
2204
  propTypes.exports = requireFactoryWithThrowingShims()();
2176
2205
  }
2177
- var propTypesExports = propTypes.exports;
2178
- const PropTypes = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
2179
2206
  function hasClass(element, className) {
2180
2207
  if (element.classList)
2181
2208
  return !!className && element.classList.contains(className);
@@ -2205,22 +2232,22 @@ function removeClass$1(element, className) {
2205
2232
  const config$1 = {
2206
2233
  disabled: false
2207
2234
  };
2208
- var timeoutsShape = process.env.NODE_ENV !== "production" ? PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
2209
- enter: PropTypes.number,
2210
- exit: PropTypes.number,
2211
- appear: PropTypes.number
2235
+ var timeoutsShape = process.env.NODE_ENV !== "production" ? propTypesExports.oneOfType([propTypesExports.number, propTypesExports.shape({
2236
+ enter: propTypesExports.number,
2237
+ exit: propTypesExports.number,
2238
+ appear: propTypesExports.number
2212
2239
  }).isRequired]) : null;
2213
- var classNamesShape = process.env.NODE_ENV !== "production" ? PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
2214
- enter: PropTypes.string,
2215
- exit: PropTypes.string,
2216
- active: PropTypes.string
2217
- }), PropTypes.shape({
2218
- enter: PropTypes.string,
2219
- enterDone: PropTypes.string,
2220
- enterActive: PropTypes.string,
2221
- exit: PropTypes.string,
2222
- exitDone: PropTypes.string,
2223
- exitActive: PropTypes.string
2240
+ var classNamesShape = process.env.NODE_ENV !== "production" ? propTypesExports.oneOfType([propTypesExports.string, propTypesExports.shape({
2241
+ enter: propTypesExports.string,
2242
+ exit: propTypesExports.string,
2243
+ active: propTypesExports.string
2244
+ }), propTypesExports.shape({
2245
+ enter: propTypesExports.string,
2246
+ enterDone: propTypesExports.string,
2247
+ enterActive: propTypesExports.string,
2248
+ exit: propTypesExports.string,
2249
+ exitDone: propTypesExports.string,
2250
+ exitActive: propTypesExports.string
2224
2251
  })]) : null;
2225
2252
  const TransitionGroupContext = React__default.createContext(null);
2226
2253
  var forceReflow = function forceReflow2(node) {
@@ -2470,10 +2497,10 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
2470
2497
  * (see
2471
2498
  * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
2472
2499
  */
2473
- nodeRef: PropTypes.shape({
2474
- current: typeof Element === "undefined" ? PropTypes.any : function(propValue, key, componentName, location, propFullName, secret) {
2500
+ nodeRef: propTypesExports.shape({
2501
+ current: typeof Element === "undefined" ? propTypesExports.any : function(propValue, key, componentName, location, propFullName, secret) {
2475
2502
  var value = propValue[key];
2476
- return PropTypes.instanceOf(value && "ownerDocument" in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);
2503
+ return propTypesExports.instanceOf(value && "ownerDocument" in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);
2477
2504
  }
2478
2505
  }),
2479
2506
  /**
@@ -2490,23 +2517,23 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
2490
2517
  * </Transition>
2491
2518
  * ```
2492
2519
  */
2493
- children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,
2520
+ children: propTypesExports.oneOfType([propTypesExports.func.isRequired, propTypesExports.element.isRequired]).isRequired,
2494
2521
  /**
2495
2522
  * Show the component; triggers the enter or exit states
2496
2523
  */
2497
- in: PropTypes.bool,
2524
+ in: propTypesExports.bool,
2498
2525
  /**
2499
2526
  * By default the child component is mounted immediately along with
2500
2527
  * the parent `Transition` component. If you want to "lazy mount" the component on the
2501
2528
  * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
2502
2529
  * mounted, even on "exited", unless you also specify `unmountOnExit`.
2503
2530
  */
2504
- mountOnEnter: PropTypes.bool,
2531
+ mountOnEnter: propTypesExports.bool,
2505
2532
  /**
2506
2533
  * By default the child component stays mounted after it reaches the `'exited'` state.
2507
2534
  * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
2508
2535
  */
2509
- unmountOnExit: PropTypes.bool,
2536
+ unmountOnExit: propTypesExports.bool,
2510
2537
  /**
2511
2538
  * By default the child component does not perform the enter transition when
2512
2539
  * it first mounts, regardless of the value of `in`. If you want this
@@ -2518,15 +2545,15 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
2518
2545
  * > additional `.appear-*` classes, that way you can choose to style it
2519
2546
  * > differently.
2520
2547
  */
2521
- appear: PropTypes.bool,
2548
+ appear: propTypesExports.bool,
2522
2549
  /**
2523
2550
  * Enable or disable enter transitions.
2524
2551
  */
2525
- enter: PropTypes.bool,
2552
+ enter: propTypesExports.bool,
2526
2553
  /**
2527
2554
  * Enable or disable exit transitions.
2528
2555
  */
2529
- exit: PropTypes.bool,
2556
+ exit: propTypesExports.bool,
2530
2557
  /**
2531
2558
  * The duration of the transition, in milliseconds.
2532
2559
  * Required unless `addEndListener` is provided.
@@ -2576,7 +2603,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
2576
2603
  * }}
2577
2604
  * ```
2578
2605
  */
2579
- addEndListener: PropTypes.func,
2606
+ addEndListener: propTypesExports.func,
2580
2607
  /**
2581
2608
  * Callback fired before the "entering" status is applied. An extra parameter
2582
2609
  * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
@@ -2585,7 +2612,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
2585
2612
  *
2586
2613
  * @type Function(node: HtmlElement, isAppearing: bool) -> void
2587
2614
  */
2588
- onEnter: PropTypes.func,
2615
+ onEnter: propTypesExports.func,
2589
2616
  /**
2590
2617
  * Callback fired after the "entering" status is applied. An extra parameter
2591
2618
  * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
@@ -2594,7 +2621,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
2594
2621
  *
2595
2622
  * @type Function(node: HtmlElement, isAppearing: bool)
2596
2623
  */
2597
- onEntering: PropTypes.func,
2624
+ onEntering: propTypesExports.func,
2598
2625
  /**
2599
2626
  * Callback fired after the "entered" status is applied. An extra parameter
2600
2627
  * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
@@ -2603,7 +2630,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
2603
2630
  *
2604
2631
  * @type Function(node: HtmlElement, isAppearing: bool) -> void
2605
2632
  */
2606
- onEntered: PropTypes.func,
2633
+ onEntered: propTypesExports.func,
2607
2634
  /**
2608
2635
  * Callback fired before the "exiting" status is applied.
2609
2636
  *
@@ -2611,7 +2638,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
2611
2638
  *
2612
2639
  * @type Function(node: HtmlElement) -> void
2613
2640
  */
2614
- onExit: PropTypes.func,
2641
+ onExit: propTypesExports.func,
2615
2642
  /**
2616
2643
  * Callback fired after the "exiting" status is applied.
2617
2644
  *
@@ -2619,7 +2646,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
2619
2646
  *
2620
2647
  * @type Function(node: HtmlElement) -> void
2621
2648
  */
2622
- onExiting: PropTypes.func,
2649
+ onExiting: propTypesExports.func,
2623
2650
  /**
2624
2651
  * Callback fired after the "exited" status is applied.
2625
2652
  *
@@ -2627,7 +2654,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
2627
2654
  *
2628
2655
  * @type Function(node: HtmlElement) -> void
2629
2656
  */
2630
- onExited: PropTypes.func
2657
+ onExited: propTypesExports.func
2631
2658
  } : {};
2632
2659
  function noop$2() {
2633
2660
  }
@@ -2866,7 +2893,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$4({},
2866
2893
  *
2867
2894
  * @type Function(node: HtmlElement, isAppearing: bool)
2868
2895
  */
2869
- onEnter: PropTypes.func,
2896
+ onEnter: propTypesExports.func,
2870
2897
  /**
2871
2898
  * A `<Transition>` callback fired immediately after the 'enter-active' or
2872
2899
  * 'appear-active' class is applied.
@@ -2875,7 +2902,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$4({},
2875
2902
  *
2876
2903
  * @type Function(node: HtmlElement, isAppearing: bool)
2877
2904
  */
2878
- onEntering: PropTypes.func,
2905
+ onEntering: propTypesExports.func,
2879
2906
  /**
2880
2907
  * A `<Transition>` callback fired immediately after the 'enter' or
2881
2908
  * 'appear' classes are **removed** and the `done` class is added to the DOM node.
@@ -2884,7 +2911,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$4({},
2884
2911
  *
2885
2912
  * @type Function(node: HtmlElement, isAppearing: bool)
2886
2913
  */
2887
- onEntered: PropTypes.func,
2914
+ onEntered: propTypesExports.func,
2888
2915
  /**
2889
2916
  * A `<Transition>` callback fired immediately after the 'exit' class is
2890
2917
  * applied.
@@ -2893,7 +2920,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$4({},
2893
2920
  *
2894
2921
  * @type Function(node: HtmlElement)
2895
2922
  */
2896
- onExit: PropTypes.func,
2923
+ onExit: propTypesExports.func,
2897
2924
  /**
2898
2925
  * A `<Transition>` callback fired immediately after the 'exit-active' is applied.
2899
2926
  *
@@ -2901,7 +2928,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$4({},
2901
2928
  *
2902
2929
  * @type Function(node: HtmlElement)
2903
2930
  */
2904
- onExiting: PropTypes.func,
2931
+ onExiting: propTypesExports.func,
2905
2932
  /**
2906
2933
  * A `<Transition>` callback fired immediately after the 'exit' classes
2907
2934
  * are **removed** and the `exit-done` class is added to the DOM node.
@@ -2910,7 +2937,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$4({},
2910
2937
  *
2911
2938
  * @type Function(node: HtmlElement)
2912
2939
  */
2913
- onExited: PropTypes.func
2940
+ onExited: propTypesExports.func
2914
2941
  }) : {};
2915
2942
  const CSSTransition$1 = CSSTransition;
2916
2943
  const defaultProps$1m = {
@@ -9324,99 +9351,116 @@ const MenuItem = forwardRef((props, ref) => {
9324
9351
  return { display: "none" };
9325
9352
  };
9326
9353
  const getPosition = () => {
9327
- return direction === "down" ? { top: `${position.top + position.height}px` } : { bottom: `${window.innerHeight - position.top}px`, top: "auto" };
9354
+ return direction === "down" ? { position: "absolute", height: `${window.innerHeight}px` } : {
9355
+ position: "absolute",
9356
+ bottom: "100%",
9357
+ top: "auto",
9358
+ height: `${window.innerHeight}px`
9359
+ };
9328
9360
  };
9329
9361
  const placeholderStyle = () => {
9330
9362
  if (direction === "down") {
9331
9363
  return {
9332
9364
  height: `${position.top + position.height}px`,
9365
+ top: "auto",
9366
+ bottom: "-100%",
9333
9367
  ...isShow(),
9334
9368
  ...style
9335
9369
  };
9336
9370
  }
9337
9371
  return {
9338
9372
  height: `${window.innerHeight - position.top}px`,
9339
- top: "auto",
9373
+ bottom: `auto`,
9374
+ top: "0",
9340
9375
  ...isShow(),
9341
9376
  ...style
9342
9377
  };
9343
9378
  };
9344
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
9379
+ return /* @__PURE__ */ React__default.createElement(
9345
9380
  "div",
9346
9381
  {
9347
- className: `placeholder-element ${classNames({
9348
- up: direction === "up"
9349
- })}`,
9350
- style: placeholderStyle(),
9351
- onClick: () => parent.toggleItemShow(orderKey)
9352
- }
9353
- ), /* @__PURE__ */ React__default.createElement(
9354
- Overlay,
9355
- {
9356
- overlayClass: "nut-menu__overlay",
9357
- style: getPosition(),
9358
- lockScroll: parent.lockScroll,
9359
- visible: _showPopup,
9360
- closeOnClickOverlay: parent.closeOnClickOverlay,
9361
- onClick: () => {
9362
- parent.closeOnClickOverlay && parent.toggleItemShow(orderKey);
9382
+ className: "nut-menu-item-container",
9383
+ style: { position: "absolute", left: 0, right: 0 }
9384
+ },
9385
+ /* @__PURE__ */ React__default.createElement(
9386
+ "div",
9387
+ {
9388
+ className: `placeholder-element ${classNames({
9389
+ up: direction === "up"
9390
+ })}`,
9391
+ style: placeholderStyle(),
9392
+ onClick: () => parent.toggleItemShow(orderKey)
9363
9393
  }
9364
- }
9365
- ), /* @__PURE__ */ React__default.createElement(
9366
- "div",
9367
- {
9368
- className: direction === "down" ? "nut-menu-item__wrap" : "nut-menu-item__wrap-up",
9369
- style: {
9370
- // ...getPosition(),
9371
- ...isShow()
9394
+ ),
9395
+ /* @__PURE__ */ React__default.createElement(
9396
+ Overlay,
9397
+ {
9398
+ overlayClass: "nut-menu__overlay",
9399
+ style: getPosition(),
9400
+ lockScroll: parent.lockScroll,
9401
+ visible: _showPopup,
9402
+ closeOnClickOverlay: parent.closeOnClickOverlay,
9403
+ onClick: () => {
9404
+ parent.closeOnClickOverlay && parent.toggleItemShow(orderKey);
9405
+ }
9372
9406
  }
9373
- },
9407
+ ),
9374
9408
  /* @__PURE__ */ React__default.createElement(
9375
- CSSTransition$1,
9409
+ "div",
9376
9410
  {
9377
- in: _showPopup,
9378
- timeout: 100,
9379
- classNames: direction === "down" ? "menu-item" : "menu-item-up"
9411
+ className: direction === "down" ? "nut-menu-item__wrap" : "nut-menu-item__wrap-up",
9412
+ style: {
9413
+ // ...getPosition(),
9414
+ ...isShow()
9415
+ }
9380
9416
  },
9381
- /* @__PURE__ */ React__default.createElement("div", { className: "nut-menu-item__content" }, options2 == null ? void 0 : options2.map((item, index) => {
9382
- return /* @__PURE__ */ React__default.createElement(
9383
- "div",
9384
- {
9385
- className: `nut-menu-item__option ${classNames({
9386
- active: item.value === _value
9387
- })}`,
9388
- key: item.text,
9389
- style: {
9390
- flexBasis: `${100 / columns}%`
9391
- },
9392
- onClick: () => {
9393
- handleClick2(item);
9394
- }
9395
- },
9396
- item.value === _value ? /* @__PURE__ */ React__default.createElement(
9397
- Icon,
9398
- {
9399
- classPrefix: iconClassPrefix,
9400
- fontClassName: iconFontClassName,
9401
- className: getIconCName(item.value, value),
9402
- name: optionsIcon,
9403
- color: activeColor
9404
- }
9405
- ) : null,
9406
- /* @__PURE__ */ React__default.createElement(
9417
+ /* @__PURE__ */ React__default.createElement(
9418
+ CSSTransition$1,
9419
+ {
9420
+ in: _showPopup,
9421
+ timeout: 100,
9422
+ classNames: direction === "down" ? "menu-item" : "menu-item-up"
9423
+ },
9424
+ /* @__PURE__ */ React__default.createElement("div", { className: "nut-menu-item__content" }, options2 == null ? void 0 : options2.map((item, index) => {
9425
+ return /* @__PURE__ */ React__default.createElement(
9407
9426
  "div",
9408
9427
  {
9409
- className: getIconCName(item.value, value),
9428
+ className: `nut-menu-item__option ${classNames({
9429
+ active: item.value === _value
9430
+ })}`,
9431
+ key: item.text,
9410
9432
  style: {
9411
- color: `${item.value === _value ? activeColor : ""}`
9433
+ flexBasis: `${100 / columns}%`
9434
+ },
9435
+ onClick: () => {
9436
+ handleClick2(item);
9412
9437
  }
9413
9438
  },
9414
- item.text
9415
- )
9416
- );
9417
- }), children)
9439
+ item.value === _value ? /* @__PURE__ */ React__default.createElement(
9440
+ Icon,
9441
+ {
9442
+ classPrefix: iconClassPrefix,
9443
+ fontClassName: iconFontClassName,
9444
+ className: getIconCName(item.value, value),
9445
+ name: optionsIcon,
9446
+ color: activeColor
9447
+ }
9448
+ ) : null,
9449
+ /* @__PURE__ */ React__default.createElement(
9450
+ "div",
9451
+ {
9452
+ className: getIconCName(item.value, value),
9453
+ style: {
9454
+ color: `${item.value === _value ? activeColor : ""}`
9455
+ }
9456
+ },
9457
+ item.text
9458
+ )
9459
+ );
9460
+ }), children)
9461
+ )
9418
9462
  )
9419
- ));
9463
+ );
9420
9464
  });
9421
9465
  MenuItem.defaultProps = defaultProps$1a;
9422
9466
  MenuItem.displayName = "NutMenuItem";
@@ -19302,6 +19346,7 @@ const defaultProps$q = {
19302
19346
  paused: false,
19303
19347
  startTime: Date.now(),
19304
19348
  endTime: Date.now(),
19349
+ remainingTime: 0,
19305
19350
  millisecond: false,
19306
19351
  format: "HH:mm:ss",
19307
19352
  autoStart: true,
@@ -19314,6 +19359,7 @@ const InternalCountDown = (props, ref) => {
19314
19359
  paused,
19315
19360
  startTime,
19316
19361
  endTime,
19362
+ remainingTime,
19317
19363
  millisecond,
19318
19364
  format: format2,
19319
19365
  autoStart,
@@ -19353,8 +19399,12 @@ const InternalCountDown = (props, ref) => {
19353
19399
  return new Date(t).getTime();
19354
19400
  };
19355
19401
  const initTime = () => {
19356
- stateRef.current.handleEndTime = endTime;
19357
- stateRef.current.diffTime = Date.now() - getTimeStamp(startTime);
19402
+ if (remainingTime) {
19403
+ stateRef.current.handleEndTime = Date.now() + Number(remainingTime);
19404
+ } else {
19405
+ stateRef.current.handleEndTime = endTime;
19406
+ stateRef.current.diffTime = Date.now() - getTimeStamp(startTime);
19407
+ }
19358
19408
  if (!stateRef.current.counting)
19359
19409
  stateRef.current.counting = true;
19360
19410
  tick();
@@ -19496,7 +19546,7 @@ const InternalCountDown = (props, ref) => {
19496
19546
  if (stateRef.current.isIninted) {
19497
19547
  initTime();
19498
19548
  }
19499
- }, [endTime, startTime]);
19549
+ }, [endTime, startTime, remainingTime]);
19500
19550
  useEffect(() => {
19501
19551
  if (autoStart) {
19502
19552
  initTime();