@nutui/nutui-react 2.0.0-alpha.0 → 2.0.0-alpha.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.
@@ -6,7 +6,7 @@ var __publicField = (obj, key, value) => {
6
6
  };
7
7
  var _a;
8
8
  /*!
9
- * @nutui/nutui-react v2.0.0-alpha.0 Wed Apr 19 2023 21:29:36 GMT+0800 (China Standard Time)
9
+ * @nutui/nutui-react v2.0.0-alpha.1 Fri Apr 21 2023 18:04:48 GMT+0800 (China Standard Time)
10
10
  * (c) 2023 @jdf2e.
11
11
  * Released under the MIT License.
12
12
  */
@@ -3283,7 +3283,7 @@ const defaultProps$1q = {
3283
3283
  onClick: (event) => {
3284
3284
  }
3285
3285
  };
3286
- const classPrefix$7 = "nut-cell";
3286
+ const classPrefix$8 = "nut-cell";
3287
3287
  const Cell = (props) => {
3288
3288
  const {
3289
3289
  children,
@@ -3312,26 +3312,26 @@ const Cell = (props) => {
3312
3312
  flex: 1
3313
3313
  };
3314
3314
  return /* @__PURE__ */ jsx("div", {
3315
- className: classNames(classPrefix$7, className),
3315
+ className: classNames(classPrefix$8, className),
3316
3316
  onClick: (event) => handleClick2(event),
3317
3317
  style: baseStyle,
3318
3318
  ...rest,
3319
3319
  children: children || /* @__PURE__ */ jsxs(Fragment, {
3320
3320
  children: [title || description ? /* @__PURE__ */ jsxs("div", {
3321
- className: `${classPrefix$7}__left`,
3321
+ className: `${classPrefix$8}__left`,
3322
3322
  children: [title ? /* @__PURE__ */ jsx("div", {
3323
- className: `${classPrefix$7}__title`,
3323
+ className: `${classPrefix$8}__title`,
3324
3324
  children: title
3325
3325
  }) : null, description ? /* @__PURE__ */ jsx("div", {
3326
- className: `${classPrefix$7}__description`,
3326
+ className: `${classPrefix$8}__description`,
3327
3327
  children: description
3328
3328
  }) : null]
3329
3329
  }) : null, extra ? /* @__PURE__ */ jsx("div", {
3330
- className: `${classPrefix$7}__extra`,
3330
+ className: `${classPrefix$8}__extra`,
3331
3331
  style: styles,
3332
3332
  children: extra
3333
3333
  }) : null, /* @__PURE__ */ jsx("div", {
3334
- className: `${classPrefix$7}__divider`
3334
+ className: `${classPrefix$8}__divider`
3335
3335
  })]
3336
3336
  })
3337
3337
  });
@@ -3343,7 +3343,7 @@ const defaultProps$1p = {
3343
3343
  title: "",
3344
3344
  description: ""
3345
3345
  };
3346
- const classPrefix$6 = "nut-cell-group";
3346
+ const classPrefix$7 = "nut-cell-group";
3347
3347
  const CellGroup = (props) => {
3348
3348
  const {
3349
3349
  children,
@@ -3357,16 +3357,16 @@ const CellGroup = (props) => {
3357
3357
  ...props
3358
3358
  };
3359
3359
  return /* @__PURE__ */ jsxs("div", {
3360
- className: classNames(classPrefix$6, className),
3360
+ className: classNames(classPrefix$7, className),
3361
3361
  ...rest,
3362
3362
  children: [title ? /* @__PURE__ */ jsx("div", {
3363
- className: `${classPrefix$6}__title`,
3363
+ className: `${classPrefix$7}__title`,
3364
3364
  children: title
3365
3365
  }) : null, description ? /* @__PURE__ */ jsx("div", {
3366
- className: `${classPrefix$6}__description`,
3366
+ className: `${classPrefix$7}__description`,
3367
3367
  children: description
3368
3368
  }) : null, /* @__PURE__ */ jsx("div", {
3369
- className: `${classPrefix$6}__wrap`,
3369
+ className: `${classPrefix$7}__wrap`,
3370
3370
  children
3371
3371
  })]
3372
3372
  });
@@ -3846,7 +3846,7 @@ const defaultProps$1n = {
3846
3846
  loading: true,
3847
3847
  lazy: false
3848
3848
  };
3849
- const classPrefix$5 = "nut-image";
3849
+ const classPrefix$6 = "nut-image";
3850
3850
  const Image$1 = (props) => {
3851
3851
  const {
3852
3852
  className,
@@ -3975,7 +3975,7 @@ const Image$1 = (props) => {
3975
3975
  return null;
3976
3976
  }, [loading, innerLoading]);
3977
3977
  return /* @__PURE__ */ jsxs("div", {
3978
- className: classNames(classPrefix$5, className),
3978
+ className: classNames(classPrefix$6, className),
3979
3979
  style: containerStyle,
3980
3980
  onClick: (e) => {
3981
3981
  imageClick(e);
@@ -4010,7 +4010,7 @@ const defaultOverlayProps = {
4010
4010
  visible: false,
4011
4011
  lockScroll: true
4012
4012
  };
4013
- const classPrefix$4 = `nut-overlay`;
4013
+ const classPrefix$5 = `nut-overlay`;
4014
4014
  const Overlay = (props) => {
4015
4015
  const {
4016
4016
  children,
@@ -4053,7 +4053,7 @@ const Overlay = (props) => {
4053
4053
  "overlay-fade-enter-active": visible,
4054
4054
  "first-render": renderRef.current && !visible,
4055
4055
  "hidden-render": !visible
4056
- }, className, classPrefix$4);
4056
+ }, className, classPrefix$5);
4057
4057
  const styles = {
4058
4058
  zIndex,
4059
4059
  animationDuration: `${props.duration}s`,
@@ -5829,138 +5829,17 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$4({},
5829
5829
  onExited: propTypesExports.func
5830
5830
  }) : {};
5831
5831
  const CSSTransition$1 = CSSTransition;
5832
- var classnameExports = {};
5833
- var classname = {
5834
- get exports() {
5835
- return classnameExports;
5836
- },
5837
- set exports(v) {
5838
- classnameExports = v;
5839
- }
5840
- };
5841
- var classname_production_min = {};
5842
- var hasRequiredClassname_production_min;
5843
- function requireClassname_production_min() {
5844
- if (hasRequiredClassname_production_min)
5845
- return classname_production_min;
5846
- hasRequiredClassname_production_min = 1;
5847
- function r(r2) {
5848
- function t2(t3, i, a2, o) {
5849
- var f = i ? e + t3 + r2.e + i : e + t3, v = f;
5850
- if (a2) {
5851
- var s = " " + v + r2.m;
5852
- for (var u in a2)
5853
- if (a2.hasOwnProperty(u)) {
5854
- var p = a2[u];
5855
- true === p ? v += s + u : p && (v += s + u + n + p);
5856
- }
5857
- }
5858
- if (void 0 !== o)
5859
- for (var y2 = 0, c = (o = Array.isArray(o) ? o : [o]).length; y2 < c; y2++) {
5860
- var l2 = o[y2];
5861
- if (l2 && "string" == typeof l2.valueOf())
5862
- for (var g = l2.valueOf().split(" "), d = 0; d < g.length; d++) {
5863
- var h = g[d];
5864
- h !== f && (v += " " + h);
5865
- }
5866
- }
5867
- return v;
5868
- }
5869
- var e = r2.n || "", n = r2.v || r2.m;
5870
- return function(r3, e2) {
5871
- return function(n2, i, a2) {
5872
- return "string" == typeof n2 ? "string" == typeof i || Array.isArray(i) ? t2(r3, n2, void 0, i) : t2(r3, n2, i, a2) : t2(r3, e2, n2, i);
5873
- };
5874
- };
5875
- }
5876
- Object.defineProperty(classname_production_min, "__esModule", { value: true });
5877
- var t = r({ e: "-", m: "_" });
5878
- classname_production_min.cn = t, classname_production_min.withNaming = r;
5879
- return classname_production_min;
5880
- }
5881
- var classname_development = {};
5882
- var hasRequiredClassname_development;
5883
- function requireClassname_development() {
5884
- if (hasRequiredClassname_development)
5885
- return classname_development;
5886
- hasRequiredClassname_development = 1;
5887
- Object.defineProperty(classname_development, "__esModule", { value: true });
5888
- function withNaming(preset) {
5889
- var nameSpace = preset.n || "";
5890
- var modValueDelimiter = preset.v || preset.m;
5891
- function stringify(b2, e, m, mix) {
5892
- var entityName = e ? nameSpace + b2 + preset.e + e : nameSpace + b2;
5893
- var className = entityName;
5894
- if (m) {
5895
- var modPrefix = " " + className + preset.m;
5896
- for (var k2 in m) {
5897
- if (m.hasOwnProperty(k2)) {
5898
- var modVal = m[k2];
5899
- if (modVal === true) {
5900
- className += modPrefix + k2;
5901
- } else if (modVal) {
5902
- className += modPrefix + k2 + modValueDelimiter + modVal;
5903
- }
5904
- }
5905
- }
5906
- }
5907
- if (mix !== void 0) {
5908
- mix = Array.isArray(mix) ? mix : [mix];
5909
- for (var i = 0, len = mix.length; i < len; i++) {
5910
- var value = mix[i];
5911
- if (!value || typeof value.valueOf() !== "string")
5912
- continue;
5913
- var mixes = value.valueOf().split(" ");
5914
- for (var j = 0; j < mixes.length; j++) {
5915
- var val = mixes[j];
5916
- if (val !== entityName) {
5917
- className += " " + val;
5918
- }
5919
- }
5920
- }
5921
- }
5922
- return className;
5923
- }
5924
- return function cnGenerator(b2, e) {
5925
- return function(elemOrMods, elemModsOrBlockMix, elemMix) {
5926
- if (typeof elemOrMods === "string") {
5927
- if (typeof elemModsOrBlockMix === "string" || Array.isArray(elemModsOrBlockMix)) {
5928
- return stringify(b2, elemOrMods, void 0, elemModsOrBlockMix);
5929
- }
5930
- return stringify(b2, elemOrMods, elemModsOrBlockMix, elemMix);
5931
- }
5932
- return stringify(b2, e, elemOrMods, elemModsOrBlockMix);
5933
- };
5934
- };
5935
- }
5936
- var cn2 = withNaming({
5937
- e: "-",
5938
- m: "_"
5939
- });
5940
- classname_development.cn = cn2;
5941
- classname_development.withNaming = withNaming;
5942
- return classname_development;
5943
- }
5944
- (function(module) {
5945
- if (process.env.NODE_ENV === "production") {
5946
- module.exports = requireClassname_production_min();
5947
- } else {
5948
- module.exports = requireClassname_development();
5949
- }
5950
- })(classname);
5951
- const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
5952
5832
  const defaultProps$1m = {
5953
5833
  ...ComponentDefaults,
5954
5834
  position: "center",
5955
5835
  transition: "",
5956
5836
  overlayStyle: {},
5957
- overlayClass: "",
5958
- popClass: "",
5837
+ overlayClassName: "",
5959
5838
  closeable: false,
5960
5839
  closeIconPosition: "top-right",
5961
5840
  closeIcon: "close",
5962
- destroyOnClose: true,
5963
- teleport: null,
5841
+ destroyOnClose: false,
5842
+ portal: null,
5964
5843
  overlay: true,
5965
5844
  round: false,
5966
5845
  onOpen: () => {
@@ -5969,14 +5848,8 @@ const defaultProps$1m = {
5969
5848
  },
5970
5849
  onClick: (e) => {
5971
5850
  },
5972
- onOpened: (e) => {
5973
- },
5974
- onClosed: (e) => {
5975
- },
5976
- onClickOverlay: (e) => {
5977
- },
5978
- onClickCloseIcon: (e) => {
5979
- },
5851
+ onClickOverlay: (e) => true,
5852
+ onClickCloseIcon: (e) => true,
5980
5853
  ...defaultOverlayProps
5981
5854
  };
5982
5855
  let _zIndex = 1e3;
@@ -5987,7 +5860,7 @@ const Popup = (props) => {
5987
5860
  overlay,
5988
5861
  closeOnOverlayClick,
5989
5862
  overlayStyle,
5990
- overlayClass,
5863
+ overlayClassName,
5991
5864
  zIndex,
5992
5865
  lockScroll,
5993
5866
  duration,
@@ -5998,23 +5871,22 @@ const Popup = (props) => {
5998
5871
  transition,
5999
5872
  round,
6000
5873
  position,
6001
- popClass,
6002
5874
  className,
6003
5875
  destroyOnClose,
6004
- teleport,
5876
+ portal,
6005
5877
  onOpen,
6006
5878
  onClose,
6007
5879
  onClickOverlay,
6008
5880
  onClickCloseIcon,
6009
- onOpened,
6010
- onClosed,
5881
+ afterShow,
5882
+ afterClose,
6011
5883
  onClick
6012
5884
  } = props;
6013
5885
  const [index, setIndex] = useState(zIndex || _zIndex);
6014
5886
  const [innerVisible, setInnerVisible] = useState(visible);
6015
5887
  const [showChildren, setShowChildren] = useState(true);
6016
5888
  const [transitionName, setTransitionName] = useState("");
6017
- const b2 = cn("popup");
5889
+ const classPrefix2 = "nut-popup";
6018
5890
  const baseStyle = {
6019
5891
  zIndex: index,
6020
5892
  animationDuration: `${duration}s`
@@ -6027,15 +5899,15 @@ const Popup = (props) => {
6027
5899
  ...style,
6028
5900
  ...baseStyle
6029
5901
  };
6030
- const classes = classNames({
5902
+ const popClassName = classNames({
6031
5903
  round,
6032
- [`nut-popup-${position}`]: true,
6033
- [`${popClass}`]: true,
5904
+ [`${classPrefix2}`]: true,
5905
+ [`${classPrefix2}-${position}`]: true,
6034
5906
  [`${className || ""}`]: true
6035
- }, b2(""));
5907
+ });
6036
5908
  const closeClasses = classNames({
6037
- "nut-popup__close-icon": true,
6038
- [`nut-popup__close-icon--${closeIconPosition}`]: true
5909
+ [`${classPrefix2}__close-icon`]: true,
5910
+ [`${classPrefix2}__close-icon--${closeIconPosition}`]: true
6039
5911
  });
6040
5912
  const open = () => {
6041
5913
  if (!innerVisible) {
@@ -6053,29 +5925,29 @@ const Popup = (props) => {
6053
5925
  if (destroyOnClose) {
6054
5926
  setTimeout(() => {
6055
5927
  setShowChildren(false);
6056
- onClose && onClose();
6057
5928
  }, Number(duration) * 1e3);
6058
5929
  }
5930
+ onClose && onClose();
6059
5931
  }
6060
5932
  };
6061
5933
  const onHandleClickOverlay = (e) => {
6062
5934
  if (closeOnOverlayClick) {
6063
- onClickOverlay && onClickOverlay(e);
6064
- close();
5935
+ const closed = onClickOverlay && onClickOverlay(e);
5936
+ closed && close();
6065
5937
  }
6066
5938
  };
6067
5939
  const onHandleClick = (e) => {
6068
5940
  onClick && onClick(e);
6069
5941
  };
6070
5942
  const onHandleClickCloseIcon = (e) => {
6071
- onClickCloseIcon && onClickCloseIcon(e);
6072
- close();
5943
+ const closed = onClickCloseIcon && onClickCloseIcon(e);
5944
+ closed && close();
6073
5945
  };
6074
5946
  const onHandleOpened = (e) => {
6075
- onOpened && onOpened(e);
5947
+ afterShow && afterShow();
6076
5948
  };
6077
5949
  const onHandleClosed = (e) => {
6078
- onClosed && onClosed(e);
5950
+ afterClose && afterClose();
6079
5951
  };
6080
5952
  const resolveContainer = (getContainer) => {
6081
5953
  const container = typeof getContainer === "function" ? getContainer() : getContainer;
@@ -6111,7 +5983,7 @@ const Popup = (props) => {
6111
5983
  onExited: onHandleClosed,
6112
5984
  children: /* @__PURE__ */ jsxs("div", {
6113
5985
  style: popStyles,
6114
- className: classes,
5986
+ className: popClassName,
6115
5987
  onClick: onHandleClick,
6116
5988
  children: [showChildren ? children : "", renderIcon()]
6117
5989
  })
@@ -6122,7 +5994,7 @@ const Popup = (props) => {
6122
5994
  children: overlay ? /* @__PURE__ */ jsxs(Fragment, {
6123
5995
  children: [/* @__PURE__ */ jsx(Overlay, {
6124
5996
  style: overlayStyles,
6125
- className: overlayClass,
5997
+ className: overlayClassName,
6126
5998
  visible: innerVisible,
6127
5999
  closeOnOverlayClick,
6128
6000
  zIndex,
@@ -6140,16 +6012,17 @@ const Popup = (props) => {
6140
6012
  !visible && close();
6141
6013
  }, [visible]);
6142
6014
  useEffect(() => {
6143
- setTransitionName(transition || `nut-popup-slide-${position}`);
6144
- }, [position]);
6015
+ setTransitionName(transition || `${classPrefix2}-slide-${position}`);
6016
+ }, [position, transition]);
6145
6017
  return /* @__PURE__ */ jsx(Fragment, {
6146
- children: renderToContainer(teleport, renderNode())
6018
+ children: renderToContainer(portal, renderNode())
6147
6019
  });
6148
6020
  };
6149
6021
  Popup.defaultProps = defaultProps$1m;
6150
6022
  Popup.displayName = "NutPopup";
6151
6023
  const DataContext$2 = createContext({});
6152
6024
  const defaultProps$1l = {
6025
+ ...ComponentDefaults,
6153
6026
  span: "24",
6154
6027
  offset: "0",
6155
6028
  gutter: "0"
@@ -6157,7 +6030,7 @@ const defaultProps$1l = {
6157
6030
  const Col = (props) => {
6158
6031
  const {
6159
6032
  className,
6160
- style = {},
6033
+ style,
6161
6034
  span,
6162
6035
  offset,
6163
6036
  children,
@@ -6203,7 +6076,7 @@ const defaultProps$1k = {
6203
6076
  contentPosition: "center",
6204
6077
  direction: "horizontal"
6205
6078
  };
6206
- const classPrefix$3 = `nut-divider`;
6079
+ const classPrefix$4 = `nut-divider`;
6207
6080
  const Divider = (props) => {
6208
6081
  const {
6209
6082
  children,
@@ -6217,14 +6090,14 @@ const Divider = (props) => {
6217
6090
  ...props
6218
6091
  };
6219
6092
  const classes = direction === "horizontal" ? classNames({
6220
- [`${classPrefix$3}`]: true,
6221
- [`${classPrefix$3}__center`]: children,
6222
- [`${classPrefix$3}__left`]: contentPosition === "left",
6223
- [`${classPrefix$3}__right`]: contentPosition === "right",
6224
- [`${classPrefix$3}__hairline`]: true
6093
+ [`${classPrefix$4}`]: true,
6094
+ [`${classPrefix$4}__center`]: children,
6095
+ [`${classPrefix$4}__left`]: contentPosition === "left",
6096
+ [`${classPrefix$4}__right`]: contentPosition === "right",
6097
+ [`${classPrefix$4}__hairline`]: true
6225
6098
  }) : classNames({
6226
- [`${classPrefix$3}`]: true,
6227
- [`${classPrefix$3}__vertical`]: direction === "vertical"
6099
+ [`${classPrefix$4}`]: true,
6100
+ [`${classPrefix$4}__vertical`]: direction === "vertical"
6228
6101
  });
6229
6102
  return /* @__PURE__ */ jsx("div", {
6230
6103
  className: `${classes} ${className || ""}`,
@@ -6408,7 +6281,9 @@ const Layout = (props) => {
6408
6281
  };
6409
6282
  Layout.defaultProps = defaultProps$1h;
6410
6283
  Layout.displayName = "NutLayout";
6284
+ const classPrefix$3 = "nut-row";
6411
6285
  const defaultProps$1g = {
6286
+ ...ComponentDefaults,
6412
6287
  type: "",
6413
6288
  justify: "start",
6414
6289
  align: "flex-start",
@@ -6418,7 +6293,7 @@ const defaultProps$1g = {
6418
6293
  const Row = (props) => {
6419
6294
  const {
6420
6295
  className,
6421
- style = {},
6296
+ style,
6422
6297
  children,
6423
6298
  type: type4,
6424
6299
  justify,
@@ -6430,7 +6305,6 @@ const Row = (props) => {
6430
6305
  ...defaultProps$1g,
6431
6306
  ...props
6432
6307
  };
6433
- const prefixCls2 = "nut-row";
6434
6308
  const getClass = (prefix2, type22) => {
6435
6309
  const classType = type22 ? `nut-row-${prefix2}-${type22}` : "";
6436
6310
  const className2 = prefix2 ? classType : `nut-row-${type22}`;
@@ -6442,7 +6316,7 @@ const Row = (props) => {
6442
6316
  ${getClass("justify", justify)}
6443
6317
  ${getClass("align", align)}
6444
6318
  ${getClass("flex", wrap)}
6445
- ${prefixCls2}
6319
+ ${classPrefix$3}
6446
6320
  `;
6447
6321
  };
6448
6322
  const parentRow = {
@@ -11801,6 +11675,126 @@ const host = createHost(primitives, {
11801
11675
  }
11802
11676
  });
11803
11677
  const animated = host.animated;
11678
+ var classnameExports = {};
11679
+ var classname = {
11680
+ get exports() {
11681
+ return classnameExports;
11682
+ },
11683
+ set exports(v) {
11684
+ classnameExports = v;
11685
+ }
11686
+ };
11687
+ var classname_production_min = {};
11688
+ var hasRequiredClassname_production_min;
11689
+ function requireClassname_production_min() {
11690
+ if (hasRequiredClassname_production_min)
11691
+ return classname_production_min;
11692
+ hasRequiredClassname_production_min = 1;
11693
+ function r(r2) {
11694
+ function t2(t3, i, a2, o) {
11695
+ var f = i ? e + t3 + r2.e + i : e + t3, v = f;
11696
+ if (a2) {
11697
+ var s = " " + v + r2.m;
11698
+ for (var u in a2)
11699
+ if (a2.hasOwnProperty(u)) {
11700
+ var p = a2[u];
11701
+ true === p ? v += s + u : p && (v += s + u + n + p);
11702
+ }
11703
+ }
11704
+ if (void 0 !== o)
11705
+ for (var y2 = 0, c = (o = Array.isArray(o) ? o : [o]).length; y2 < c; y2++) {
11706
+ var l2 = o[y2];
11707
+ if (l2 && "string" == typeof l2.valueOf())
11708
+ for (var g = l2.valueOf().split(" "), d = 0; d < g.length; d++) {
11709
+ var h = g[d];
11710
+ h !== f && (v += " " + h);
11711
+ }
11712
+ }
11713
+ return v;
11714
+ }
11715
+ var e = r2.n || "", n = r2.v || r2.m;
11716
+ return function(r3, e2) {
11717
+ return function(n2, i, a2) {
11718
+ return "string" == typeof n2 ? "string" == typeof i || Array.isArray(i) ? t2(r3, n2, void 0, i) : t2(r3, n2, i, a2) : t2(r3, e2, n2, i);
11719
+ };
11720
+ };
11721
+ }
11722
+ Object.defineProperty(classname_production_min, "__esModule", { value: true });
11723
+ var t = r({ e: "-", m: "_" });
11724
+ classname_production_min.cn = t, classname_production_min.withNaming = r;
11725
+ return classname_production_min;
11726
+ }
11727
+ var classname_development = {};
11728
+ var hasRequiredClassname_development;
11729
+ function requireClassname_development() {
11730
+ if (hasRequiredClassname_development)
11731
+ return classname_development;
11732
+ hasRequiredClassname_development = 1;
11733
+ Object.defineProperty(classname_development, "__esModule", { value: true });
11734
+ function withNaming(preset) {
11735
+ var nameSpace = preset.n || "";
11736
+ var modValueDelimiter = preset.v || preset.m;
11737
+ function stringify(b2, e, m, mix) {
11738
+ var entityName = e ? nameSpace + b2 + preset.e + e : nameSpace + b2;
11739
+ var className = entityName;
11740
+ if (m) {
11741
+ var modPrefix = " " + className + preset.m;
11742
+ for (var k2 in m) {
11743
+ if (m.hasOwnProperty(k2)) {
11744
+ var modVal = m[k2];
11745
+ if (modVal === true) {
11746
+ className += modPrefix + k2;
11747
+ } else if (modVal) {
11748
+ className += modPrefix + k2 + modValueDelimiter + modVal;
11749
+ }
11750
+ }
11751
+ }
11752
+ }
11753
+ if (mix !== void 0) {
11754
+ mix = Array.isArray(mix) ? mix : [mix];
11755
+ for (var i = 0, len = mix.length; i < len; i++) {
11756
+ var value = mix[i];
11757
+ if (!value || typeof value.valueOf() !== "string")
11758
+ continue;
11759
+ var mixes = value.valueOf().split(" ");
11760
+ for (var j = 0; j < mixes.length; j++) {
11761
+ var val = mixes[j];
11762
+ if (val !== entityName) {
11763
+ className += " " + val;
11764
+ }
11765
+ }
11766
+ }
11767
+ }
11768
+ return className;
11769
+ }
11770
+ return function cnGenerator(b2, e) {
11771
+ return function(elemOrMods, elemModsOrBlockMix, elemMix) {
11772
+ if (typeof elemOrMods === "string") {
11773
+ if (typeof elemModsOrBlockMix === "string" || Array.isArray(elemModsOrBlockMix)) {
11774
+ return stringify(b2, elemOrMods, void 0, elemModsOrBlockMix);
11775
+ }
11776
+ return stringify(b2, elemOrMods, elemModsOrBlockMix, elemMix);
11777
+ }
11778
+ return stringify(b2, e, elemOrMods, elemModsOrBlockMix);
11779
+ };
11780
+ };
11781
+ }
11782
+ var cn2 = withNaming({
11783
+ e: "-",
11784
+ m: "_"
11785
+ });
11786
+ classname_development.cn = cn2;
11787
+ classname_development.withNaming = withNaming;
11788
+ return classname_development;
11789
+ }
11790
+ (function(module) {
11791
+ if (process.env.NODE_ENV === "production") {
11792
+ module.exports = requireClassname_production_min();
11793
+ } else {
11794
+ module.exports = requireClassname_development();
11795
+ }
11796
+ })(classname);
11797
+ const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
11804
11798
  const elevatorContext = createContext({});
11805
11799
  const defaultProps$1e = {
11806
11800
  height: "200px",
@@ -12735,7 +12729,6 @@ const defaultProps$17 = {
12735
12729
  width: "80%"
12736
12730
  };
12737
12731
  const SideNavBar = (props) => {
12738
- useConfig();
12739
12732
  const {
12740
12733
  title,
12741
12734
  visible,
@@ -14641,7 +14634,7 @@ const InternalCascader = (props, ref) => {
14641
14634
  };
14642
14635
  return /* @__PURE__ */ jsx(Fragment, {
14643
14636
  children: poppable ? /* @__PURE__ */ jsx(Popup, {
14644
- popClass: "cascadar-popup",
14637
+ className: "cascadar-popup",
14645
14638
  visible,
14646
14639
  position: "bottom",
14647
14640
  round: true,
@@ -17826,7 +17819,7 @@ const NumberKeyboard = (props) => {
17826
17819
  children: /* @__PURE__ */ jsx(Popup, {
17827
17820
  visible: show,
17828
17821
  position: "bottom",
17829
- popClass,
17822
+ className: popClass,
17830
17823
  onClickOverlay: onClose,
17831
17824
  overlay,
17832
17825
  onClickCloseIcon: onClose,
@@ -19719,29 +19712,26 @@ const funcInterceptor = (interceptor, {
19719
19712
  const defaultProps$J = {
19720
19713
  ...ComponentDefaults,
19721
19714
  url: "",
19722
- maximum: 1,
19723
- uploadIcon: null,
19724
- uploadIconSize: "",
19725
- uploadIconTip: "",
19726
- listType: "picture",
19715
+ maxCount: 1,
19716
+ previewType: "picture",
19717
+ imageFit: "cover",
19727
19718
  name: "file",
19728
19719
  accept: "*",
19729
19720
  disabled: false,
19730
19721
  autoUpload: true,
19731
19722
  multiple: false,
19732
- maximize: Number.MAX_VALUE,
19723
+ maxFileSize: Number.MAX_VALUE,
19733
19724
  data: {},
19734
19725
  headers: {},
19735
19726
  method: "post",
19736
- defaultImg: "",
19737
19727
  xhrState: 200,
19738
19728
  timeout: 1e3 * 30,
19739
19729
  withCredentials: false,
19740
19730
  clearInput: true,
19741
- isPreview: true,
19742
- isDeletable: true,
19731
+ preview: true,
19732
+ deletable: true,
19743
19733
  capture: false,
19744
- onBeforeDelete: (file, files) => {
19734
+ beforeDelete: (file, files) => {
19745
19735
  return true;
19746
19736
  }
19747
19737
  };
@@ -19765,32 +19755,33 @@ const InternalUploader = (props, ref) => {
19765
19755
  const {
19766
19756
  children,
19767
19757
  uploadIcon,
19768
- uploadIconSize,
19769
- uploadIconTip,
19758
+ uploadLabel,
19770
19759
  name,
19771
19760
  accept,
19772
- defaultFileList,
19773
- listType,
19761
+ defaultValue,
19762
+ value,
19763
+ previewType,
19764
+ imageFit,
19774
19765
  disabled,
19775
19766
  multiple,
19776
19767
  url: url2,
19777
- defaultImg,
19768
+ previewUrl,
19778
19769
  headers,
19779
19770
  timeout: timeout2,
19780
19771
  method: method4,
19781
19772
  xhrState,
19782
19773
  withCredentials,
19783
19774
  data,
19784
- isPreview,
19785
- isDeletable,
19786
- maximum,
19775
+ preview,
19776
+ deletable,
19777
+ maxCount,
19787
19778
  capture,
19788
- maximize,
19779
+ maxFileSize,
19789
19780
  className,
19790
19781
  autoUpload,
19791
19782
  clearInput,
19792
19783
  onStart,
19793
- onRemove,
19784
+ onDelete,
19794
19785
  onChange,
19795
19786
  onFileItemClick,
19796
19787
  onProgress,
@@ -19798,23 +19789,22 @@ const InternalUploader = (props, ref) => {
19798
19789
  onUpdate,
19799
19790
  onFailure,
19800
19791
  onOversize,
19801
- onBeforeUpload,
19802
- onBeforeXhrUpload,
19803
- onBeforeDelete,
19792
+ beforeUpload,
19793
+ beforeXhrUpload,
19794
+ beforeDelete,
19804
19795
  ...restProps
19805
19796
  } = {
19806
19797
  ...defaultProps$J,
19807
19798
  ...props
19808
19799
  };
19809
- const [fileList, setFileList] = useState([]);
19800
+ const [fileList, setFileList] = useState(defaultValue || []);
19810
19801
  const [uploadQueue, setUploadQueue] = useState([]);
19811
19802
  useEffect(() => {
19812
- if (defaultFileList) {
19813
- setFileList(defaultFileList);
19803
+ if (value) {
19804
+ setFileList(value);
19814
19805
  }
19815
- }, [defaultFileList]);
19816
- const b2 = cn("uploader");
19817
- const classes = classNames(className, b2(""));
19806
+ }, [value]);
19807
+ const classes = classNames(className, "nut-uploader");
19818
19808
  useImperativeHandle(ref, () => ({
19819
19809
  submit: () => {
19820
19810
  Promise.all(uploadQueue).then((res) => {
@@ -19841,8 +19831,8 @@ const InternalUploader = (props, ref) => {
19841
19831
  const executeUpload = (fileItem, index) => {
19842
19832
  const uploadOption = new UploadOptions();
19843
19833
  uploadOption.url = url2;
19844
- for (const [key, value] of Object.entries(data)) {
19845
- fileItem.formData.append(key, value);
19834
+ for (const [key, value2] of Object.entries(data)) {
19835
+ fileItem.formData.append(key, value2);
19846
19836
  }
19847
19837
  uploadOption.formData = fileItem.formData;
19848
19838
  uploadOption.timeout = timeout2 * 1;
@@ -19850,7 +19840,7 @@ const InternalUploader = (props, ref) => {
19850
19840
  uploadOption.xhrState = xhrState;
19851
19841
  uploadOption.headers = headers;
19852
19842
  uploadOption.withCredentials = withCredentials;
19853
- uploadOption.beforeXhrUpload = onBeforeXhrUpload;
19843
+ uploadOption.beforeXhrUpload = beforeXhrUpload;
19854
19844
  try {
19855
19845
  uploadOption.sourceFile = fileItem.formData.get(name);
19856
19846
  } catch (error) {
@@ -19948,7 +19938,7 @@ const InternalUploader = (props, ref) => {
19948
19938
  fileItem.message = locale.uploader.waitingUpload;
19949
19939
  }
19950
19940
  executeUpload(fileItem, index);
19951
- if (isPreview && file.type.includes("image")) {
19941
+ if (preview && file.type.includes("image")) {
19952
19942
  const reader = new FileReader();
19953
19943
  reader.onload = (event) => {
19954
19944
  fileItem.url = event.target.result;
@@ -19963,10 +19953,10 @@ const InternalUploader = (props, ref) => {
19963
19953
  });
19964
19954
  };
19965
19955
  const filterFiles = (files) => {
19966
- const maximum2 = props.maximum * 1;
19956
+ const maximum = props.maxCount * 1;
19967
19957
  const oversizes = new Array();
19968
19958
  const filterFile = files.filter((file) => {
19969
- if (file.size > maximize) {
19959
+ if (file.size > maxFileSize) {
19970
19960
  oversizes.push(file);
19971
19961
  return false;
19972
19962
  }
@@ -19975,23 +19965,23 @@ const InternalUploader = (props, ref) => {
19975
19965
  if (oversizes.length) {
19976
19966
  onOversize && onOversize(files);
19977
19967
  }
19978
- if (filterFile.length > maximum2) {
19979
- filterFile.splice(maximum2, filterFile.length - maximum2);
19968
+ if (filterFile.length > maximum) {
19969
+ filterFile.splice(maximum, filterFile.length - maximum);
19980
19970
  }
19981
19971
  if (fileList.length !== 0) {
19982
- const index = maximum2 - fileList.length;
19972
+ const index = maximum - fileList.length;
19983
19973
  filterFile.splice(index, filterFile.length - index);
19984
19974
  }
19985
19975
  return filterFile;
19986
19976
  };
19987
19977
  const deleted = (file, index) => {
19988
19978
  fileList.splice(index, 1);
19989
- onRemove && onRemove(file, fileList);
19979
+ onDelete && onDelete(file, fileList);
19990
19980
  setFileList([...fileList]);
19991
19981
  };
19992
- const onDelete = (file, index) => {
19982
+ const onDeleteItem = (file, index) => {
19993
19983
  clearUploadQueue(index);
19994
- funcInterceptor(onBeforeDelete, {
19984
+ funcInterceptor(beforeDelete, {
19995
19985
  args: [file, fileList],
19996
19986
  done: () => deleted(file, index)
19997
19987
  });
@@ -20004,8 +19994,8 @@ const InternalUploader = (props, ref) => {
20004
19994
  const {
20005
19995
  files
20006
19996
  } = $el;
20007
- if (onBeforeUpload) {
20008
- onBeforeUpload(new Array().slice.call(files)).then((f) => {
19997
+ if (beforeUpload) {
19998
+ beforeUpload(new Array().slice.call(files)).then((f) => {
20009
19999
  const _files = filterFiles(new Array().slice.call(f));
20010
20000
  readFile(_files);
20011
20001
  });
@@ -20030,7 +20020,7 @@ const InternalUploader = (props, ref) => {
20030
20020
  children: [children && /* @__PURE__ */ jsx("div", {
20031
20021
  className: "nut-uploader__slot",
20032
20022
  children: /* @__PURE__ */ jsxs(Fragment, {
20033
- children: [children, maximum > fileList.length && /* @__PURE__ */ jsx(Fragment, {
20023
+ children: [children, maxCount > fileList.length && /* @__PURE__ */ jsx(Fragment, {
20034
20024
  children: capture ? /* @__PURE__ */ jsx("input", {
20035
20025
  className: "nut-uploader__input",
20036
20026
  type: "file",
@@ -20053,13 +20043,13 @@ const InternalUploader = (props, ref) => {
20053
20043
  })
20054
20044
  }), fileList.length !== 0 && fileList.map((item, index) => {
20055
20045
  return /* @__PURE__ */ jsxs("div", {
20056
- className: `nut-uploader__preview ${listType}`,
20057
- children: [listType === "picture" && !children && /* @__PURE__ */ jsxs("div", {
20046
+ className: `nut-uploader__preview ${previewType}`,
20047
+ children: [previewType === "picture" && !children && /* @__PURE__ */ jsxs("div", {
20058
20048
  className: "nut-uploader__preview-img",
20059
- children: [isDeletable && /* @__PURE__ */ jsx(x$8, {
20049
+ children: [deletable && /* @__PURE__ */ jsx(x$8, {
20060
20050
  color: "rgba(0,0,0,0.6)",
20061
20051
  className: "close",
20062
- onClick: () => onDelete(item, index)
20052
+ onClick: () => onDeleteItem(item, index)
20063
20053
  }), item.status === "ready" ? /* @__PURE__ */ jsx("div", {
20064
20054
  className: "nut-uploader__preview__progress",
20065
20055
  children: /* @__PURE__ */ jsx("div", {
@@ -20071,6 +20061,7 @@ const InternalUploader = (props, ref) => {
20071
20061
  children: [item.failIcon !== " " && item.loadingIcon !== " " && (item.status === "error" ? item.failIcon || /* @__PURE__ */ jsx(x$8, {
20072
20062
  color: "#fff"
20073
20063
  }) : item.loadingIcon || /* @__PURE__ */ jsx(k$2, {
20064
+ className: "nut-icon-loading",
20074
20065
  color: "#fff"
20075
20066
  })), /* @__PURE__ */ jsx("div", {
20076
20067
  className: "nut-uploader__preview__progress__msg",
@@ -20079,14 +20070,17 @@ const InternalUploader = (props, ref) => {
20079
20070
  }), item.type.includes("image") ? /* @__PURE__ */ jsx(Fragment, {
20080
20071
  children: item.url && /* @__PURE__ */ jsx("img", {
20081
20072
  className: "nut-uploader__preview-img__c",
20073
+ style: {
20074
+ objectFit: imageFit
20075
+ },
20082
20076
  src: item.url,
20083
20077
  alt: "",
20084
20078
  onClick: () => handleItemClick(item)
20085
20079
  })
20086
20080
  }) : /* @__PURE__ */ jsx(Fragment, {
20087
- children: defaultImg ? /* @__PURE__ */ jsx("img", {
20081
+ children: previewUrl ? /* @__PURE__ */ jsx("img", {
20088
20082
  className: "nut-uploader__preview-img__c",
20089
- src: defaultImg,
20083
+ src: previewUrl,
20090
20084
  alt: "",
20091
20085
  onClick: () => handleItemClick(item)
20092
20086
  }) : /* @__PURE__ */ jsx("div", {
@@ -20103,16 +20097,16 @@ const InternalUploader = (props, ref) => {
20103
20097
  className: "tips",
20104
20098
  children: item.name
20105
20099
  }) : null]
20106
- }), listType === "list" && /* @__PURE__ */ jsxs("div", {
20100
+ }), previewType === "list" && /* @__PURE__ */ jsxs("div", {
20107
20101
  className: "nut-uploader__preview-list",
20108
20102
  children: [/* @__PURE__ */ jsxs("div", {
20109
20103
  className: `nut-uploader__preview-img__file__name ${item.status}`,
20110
20104
  onClick: () => handleItemClick(item),
20111
20105
  children: [/* @__PURE__ */ jsx(x$6, {}), " ", item.name]
20112
- }), isDeletable && /* @__PURE__ */ jsx(y$6, {
20106
+ }), deletable && /* @__PURE__ */ jsx(y$6, {
20113
20107
  color: "#808080",
20114
20108
  className: "nut-uploader__preview-img__file__del",
20115
- onClick: () => onDelete(item, index)
20109
+ onClick: () => onDeleteItem(item, index)
20116
20110
  }), item.status === "uploading" && /* @__PURE__ */ jsx(Progress, {
20117
20111
  size: "small",
20118
20112
  percentage: item.percentage,
@@ -20121,17 +20115,17 @@ const InternalUploader = (props, ref) => {
20121
20115
  })]
20122
20116
  })]
20123
20117
  }, item.uid);
20124
- }), maximum > fileList.length && listType === "picture" && !children && /* @__PURE__ */ jsxs("div", {
20125
- className: `nut-uploader__upload ${listType} ${disabled ? "nut-uploader__upload-disabled" : ""}`,
20118
+ }), maxCount > fileList.length && previewType === "picture" && !children && /* @__PURE__ */ jsxs("div", {
20119
+ className: `nut-uploader__upload ${previewType} ${disabled ? "nut-uploader__upload-disabled" : ""}`,
20126
20120
  children: [/* @__PURE__ */ jsxs("div", {
20127
20121
  className: "nut-uploader__icon",
20128
20122
  children: [uploadIcon || /* @__PURE__ */ jsx(x$3, {
20129
- width: uploadIconSize,
20130
- height: uploadIconSize,
20123
+ width: "20px",
20124
+ height: "20px",
20131
20125
  color: "#808080"
20132
20126
  }), /* @__PURE__ */ jsx("span", {
20133
20127
  className: "nut-uploader__icon-tip",
20134
- children: uploadIconTip
20128
+ children: uploadLabel
20135
20129
  })]
20136
20130
  }), capture ? /* @__PURE__ */ jsx("input", {
20137
20131
  className: "nut-uploader__input",
@@ -21859,15 +21853,13 @@ __publicField(AnimatingNumbers, "CountUp", CountUp);
21859
21853
  AnimatingNumbers.CountUp = CountUp;
21860
21854
  const defaultProps$x = {
21861
21855
  ...ComponentDefaults,
21862
- className: "",
21863
- url: "",
21864
- style: {},
21856
+ src: "",
21865
21857
  muted: false,
21866
21858
  autoplay: false,
21867
21859
  loop: false,
21868
21860
  preload: "auto",
21869
21861
  type: "progress",
21870
- onFastBack: (e) => {
21862
+ onBack: (e) => {
21871
21863
  },
21872
21864
  // type 为 progress时生效
21873
21865
  onForward: (e) => {
@@ -21875,7 +21867,7 @@ const defaultProps$x = {
21875
21867
  // type 为 progress时生效
21876
21868
  onPause: (e) => {
21877
21869
  },
21878
- onPlayEnd: (e) => {
21870
+ onEnd: (e) => {
21879
21871
  },
21880
21872
  onMute: (e) => {
21881
21873
  },
@@ -21888,17 +21880,17 @@ const Audio = (props) => {
21888
21880
  } = useConfig();
21889
21881
  const {
21890
21882
  className,
21891
- url: url2,
21883
+ src,
21892
21884
  style,
21893
21885
  muted,
21894
21886
  autoplay,
21895
21887
  loop: loop2,
21896
21888
  preload,
21897
21889
  type: type4,
21898
- onFastBack,
21890
+ onBack,
21899
21891
  onForward,
21900
21892
  onPause,
21901
- onPlayEnd,
21893
+ onEnd,
21902
21894
  onMute,
21903
21895
  onCanPlay,
21904
21896
  children,
@@ -21922,13 +21914,13 @@ const Audio = (props) => {
21922
21914
  playing: props.autoplay,
21923
21915
  handPlaying: false
21924
21916
  });
21925
- const b2 = cn("audio");
21917
+ const classPrefix2 = "nut-audio";
21926
21918
  const warn = console.warn;
21927
21919
  const handleEnded = (e) => {
21928
21920
  if (props.loop) {
21929
21921
  warn(locale.audio.tips || "onPlayEnd事件在loop=false时才会触发");
21930
21922
  } else {
21931
- props.onPlayEnd && props.onPlayEnd(e);
21923
+ props.onEnd && props.onEnd(e);
21932
21924
  }
21933
21925
  };
21934
21926
  function watch() {
@@ -21953,15 +21945,13 @@ const Audio = (props) => {
21953
21945
  }
21954
21946
  };
21955
21947
  const renderIcon = () => {
21956
- return /* @__PURE__ */ jsx(Fragment, {
21948
+ return /* @__PURE__ */ jsx("div", {
21949
+ className: `${classPrefix2}__icon`,
21957
21950
  children: /* @__PURE__ */ jsx("div", {
21958
- className: b2("icon"),
21959
- children: /* @__PURE__ */ jsx("div", {
21960
- className: `${b2("icon-box")} ${playing ? b2("icon-play") : b2("icon-stop")}`,
21961
- onClick: handleStatusChange,
21962
- children: /* @__PURE__ */ jsx(k, {
21963
- className: playing ? "nut-icon-loading" : ""
21964
- })
21951
+ className: classNames(`${classPrefix2}__icon-box`, playing ? `${classPrefix2}__icon-play` : `${classPrefix2}__icon-stop`),
21952
+ onClick: handleStatusChange,
21953
+ children: /* @__PURE__ */ jsx(k, {
21954
+ className: playing ? "nut-icon-loading" : ""
21965
21955
  })
21966
21956
  })
21967
21957
  });
@@ -21970,7 +21960,7 @@ const Audio = (props) => {
21970
21960
  if (statusRef.current.currentTime > 0 && AudioRef.current) {
21971
21961
  statusRef.current.currentTime--;
21972
21962
  AudioRef.current.currentTime = statusRef.current.currentTime;
21973
- props.onFastBack && props.onFastBack(AudioRef.current);
21963
+ props.onBack && props.onBack(AudioRef.current);
21974
21964
  }
21975
21965
  };
21976
21966
  const handleForward = () => {
@@ -22007,12 +21997,12 @@ const Audio = (props) => {
22007
21997
  const renderProgerss = () => {
22008
21998
  return /* @__PURE__ */ jsxs(Fragment, {
22009
21999
  children: [/* @__PURE__ */ jsxs("div", {
22010
- className: b2("progress"),
22000
+ className: `${classPrefix2}__progress`,
22011
22001
  children: [/* @__PURE__ */ jsx("div", {
22012
22002
  className: "time",
22013
22003
  children: currentDuration
22014
22004
  }), /* @__PURE__ */ jsx("div", {
22015
- className: b2("progress-bar-wrapper"),
22005
+ className: `${classPrefix2}__progress-bar-wrapper`,
22016
22006
  children: /* @__PURE__ */ jsx(Range, {
22017
22007
  modelValue: percent,
22018
22008
  hiddenTag: true,
@@ -22054,7 +22044,7 @@ const Audio = (props) => {
22054
22044
  };
22055
22045
  const renderNone = () => {
22056
22046
  return /* @__PURE__ */ jsx("div", {
22057
- className: b2("none-container"),
22047
+ className: `${classPrefix2}__none-container`,
22058
22048
  onClick: handleStatusChange,
22059
22049
  children
22060
22050
  });
@@ -22090,14 +22080,14 @@ const Audio = (props) => {
22090
22080
  statusRef.current.currentTime = time;
22091
22081
  };
22092
22082
  return /* @__PURE__ */ jsxs("div", {
22093
- className: `${b2()} ${className}`,
22083
+ className: classNames(classPrefix2, className),
22094
22084
  style,
22095
22085
  ...rest,
22096
22086
  children: [renderAudio(), /* @__PURE__ */ jsx("audio", {
22097
22087
  className: "audioMain",
22098
22088
  controls: type4 === "controls",
22099
22089
  ref: AudioRef,
22100
- src: url2,
22090
+ src,
22101
22091
  muted,
22102
22092
  preload,
22103
22093
  loop: loop2,
@@ -23851,7 +23841,7 @@ const ImagePreview = (props) => {
23851
23841
  };
23852
23842
  return /* @__PURE__ */ jsxs(Popup, {
23853
23843
  visible: showPop,
23854
- popClass: "custom-pop",
23844
+ className: "custom-pop",
23855
23845
  style: {
23856
23846
  width: "100%"
23857
23847
  },