@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.
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
9
9
  return value;
10
10
  };
11
11
  /*!
12
- * @nutui/nutui-react v2.0.0-alpha.0 Wed Apr 19 2023 21:29:36 GMT+0800 (China Standard Time)
12
+ * @nutui/nutui-react v2.0.0-alpha.1 Fri Apr 21 2023 18:04:48 GMT+0800 (China Standard Time)
13
13
  * (c) 2023 @jdf2e.
14
14
  * Released under the MIT License.
15
15
  */
@@ -3301,7 +3301,7 @@ Check the top-level render call using <` + t + ">.");
3301
3301
  onClick: (event) => {
3302
3302
  }
3303
3303
  };
3304
- const classPrefix$7 = "nut-cell";
3304
+ const classPrefix$8 = "nut-cell";
3305
3305
  const Cell = (props) => {
3306
3306
  const {
3307
3307
  children,
@@ -3330,26 +3330,26 @@ Check the top-level render call using <` + t + ">.");
3330
3330
  flex: 1
3331
3331
  };
3332
3332
  return /* @__PURE__ */ jsx("div", {
3333
- className: classNames(classPrefix$7, className),
3333
+ className: classNames(classPrefix$8, className),
3334
3334
  onClick: (event) => handleClick2(event),
3335
3335
  style: baseStyle,
3336
3336
  ...rest,
3337
3337
  children: children || /* @__PURE__ */ jsxs(Fragment, {
3338
3338
  children: [title || description ? /* @__PURE__ */ jsxs("div", {
3339
- className: `${classPrefix$7}__left`,
3339
+ className: `${classPrefix$8}__left`,
3340
3340
  children: [title ? /* @__PURE__ */ jsx("div", {
3341
- className: `${classPrefix$7}__title`,
3341
+ className: `${classPrefix$8}__title`,
3342
3342
  children: title
3343
3343
  }) : null, description ? /* @__PURE__ */ jsx("div", {
3344
- className: `${classPrefix$7}__description`,
3344
+ className: `${classPrefix$8}__description`,
3345
3345
  children: description
3346
3346
  }) : null]
3347
3347
  }) : null, extra ? /* @__PURE__ */ jsx("div", {
3348
- className: `${classPrefix$7}__extra`,
3348
+ className: `${classPrefix$8}__extra`,
3349
3349
  style: styles,
3350
3350
  children: extra
3351
3351
  }) : null, /* @__PURE__ */ jsx("div", {
3352
- className: `${classPrefix$7}__divider`
3352
+ className: `${classPrefix$8}__divider`
3353
3353
  })]
3354
3354
  })
3355
3355
  });
@@ -3361,7 +3361,7 @@ Check the top-level render call using <` + t + ">.");
3361
3361
  title: "",
3362
3362
  description: ""
3363
3363
  };
3364
- const classPrefix$6 = "nut-cell-group";
3364
+ const classPrefix$7 = "nut-cell-group";
3365
3365
  const CellGroup = (props) => {
3366
3366
  const {
3367
3367
  children,
@@ -3375,16 +3375,16 @@ Check the top-level render call using <` + t + ">.");
3375
3375
  ...props
3376
3376
  };
3377
3377
  return /* @__PURE__ */ jsxs("div", {
3378
- className: classNames(classPrefix$6, className),
3378
+ className: classNames(classPrefix$7, className),
3379
3379
  ...rest,
3380
3380
  children: [title ? /* @__PURE__ */ jsx("div", {
3381
- className: `${classPrefix$6}__title`,
3381
+ className: `${classPrefix$7}__title`,
3382
3382
  children: title
3383
3383
  }) : null, description ? /* @__PURE__ */ jsx("div", {
3384
- className: `${classPrefix$6}__description`,
3384
+ className: `${classPrefix$7}__description`,
3385
3385
  children: description
3386
3386
  }) : null, /* @__PURE__ */ jsx("div", {
3387
- className: `${classPrefix$6}__wrap`,
3387
+ className: `${classPrefix$7}__wrap`,
3388
3388
  children
3389
3389
  })]
3390
3390
  });
@@ -3864,7 +3864,7 @@ Check the top-level render call using <` + t + ">.");
3864
3864
  loading: true,
3865
3865
  lazy: false
3866
3866
  };
3867
- const classPrefix$5 = "nut-image";
3867
+ const classPrefix$6 = "nut-image";
3868
3868
  const Image$1 = (props) => {
3869
3869
  const {
3870
3870
  className,
@@ -3993,7 +3993,7 @@ Check the top-level render call using <` + t + ">.");
3993
3993
  return null;
3994
3994
  }, [loading, innerLoading]);
3995
3995
  return /* @__PURE__ */ jsxs("div", {
3996
- className: classNames(classPrefix$5, className),
3996
+ className: classNames(classPrefix$6, className),
3997
3997
  style: containerStyle,
3998
3998
  onClick: (e) => {
3999
3999
  imageClick(e);
@@ -4028,7 +4028,7 @@ Check the top-level render call using <` + t + ">.");
4028
4028
  visible: false,
4029
4029
  lockScroll: true
4030
4030
  };
4031
- const classPrefix$4 = `nut-overlay`;
4031
+ const classPrefix$5 = `nut-overlay`;
4032
4032
  const Overlay = (props) => {
4033
4033
  const {
4034
4034
  children,
@@ -4071,7 +4071,7 @@ Check the top-level render call using <` + t + ">.");
4071
4071
  "overlay-fade-enter-active": visible,
4072
4072
  "first-render": renderRef.current && !visible,
4073
4073
  "hidden-render": !visible
4074
- }, className, classPrefix$4);
4074
+ }, className, classPrefix$5);
4075
4075
  const styles = {
4076
4076
  zIndex,
4077
4077
  animationDuration: `${props.duration}s`,
@@ -5847,138 +5847,17 @@ Check the top-level render call using <` + t + ">.");
5847
5847
  onExited: propTypesExports.func
5848
5848
  }) : {};
5849
5849
  const CSSTransition$1 = CSSTransition;
5850
- var classnameExports = {};
5851
- var classname = {
5852
- get exports() {
5853
- return classnameExports;
5854
- },
5855
- set exports(v) {
5856
- classnameExports = v;
5857
- }
5858
- };
5859
- var classname_production_min = {};
5860
- var hasRequiredClassname_production_min;
5861
- function requireClassname_production_min() {
5862
- if (hasRequiredClassname_production_min)
5863
- return classname_production_min;
5864
- hasRequiredClassname_production_min = 1;
5865
- function r(r2) {
5866
- function t2(t3, i, a2, o) {
5867
- var f = i ? e + t3 + r2.e + i : e + t3, v = f;
5868
- if (a2) {
5869
- var s = " " + v + r2.m;
5870
- for (var u in a2)
5871
- if (a2.hasOwnProperty(u)) {
5872
- var p = a2[u];
5873
- true === p ? v += s + u : p && (v += s + u + n + p);
5874
- }
5875
- }
5876
- if (void 0 !== o)
5877
- for (var y2 = 0, c = (o = Array.isArray(o) ? o : [o]).length; y2 < c; y2++) {
5878
- var l2 = o[y2];
5879
- if (l2 && "string" == typeof l2.valueOf())
5880
- for (var g = l2.valueOf().split(" "), d = 0; d < g.length; d++) {
5881
- var h = g[d];
5882
- h !== f && (v += " " + h);
5883
- }
5884
- }
5885
- return v;
5886
- }
5887
- var e = r2.n || "", n = r2.v || r2.m;
5888
- return function(r3, e2) {
5889
- return function(n2, i, a2) {
5890
- 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);
5891
- };
5892
- };
5893
- }
5894
- Object.defineProperty(classname_production_min, "__esModule", { value: true });
5895
- var t = r({ e: "-", m: "_" });
5896
- classname_production_min.cn = t, classname_production_min.withNaming = r;
5897
- return classname_production_min;
5898
- }
5899
- var classname_development = {};
5900
- var hasRequiredClassname_development;
5901
- function requireClassname_development() {
5902
- if (hasRequiredClassname_development)
5903
- return classname_development;
5904
- hasRequiredClassname_development = 1;
5905
- Object.defineProperty(classname_development, "__esModule", { value: true });
5906
- function withNaming(preset) {
5907
- var nameSpace = preset.n || "";
5908
- var modValueDelimiter = preset.v || preset.m;
5909
- function stringify(b2, e, m, mix) {
5910
- var entityName = e ? nameSpace + b2 + preset.e + e : nameSpace + b2;
5911
- var className = entityName;
5912
- if (m) {
5913
- var modPrefix = " " + className + preset.m;
5914
- for (var k2 in m) {
5915
- if (m.hasOwnProperty(k2)) {
5916
- var modVal = m[k2];
5917
- if (modVal === true) {
5918
- className += modPrefix + k2;
5919
- } else if (modVal) {
5920
- className += modPrefix + k2 + modValueDelimiter + modVal;
5921
- }
5922
- }
5923
- }
5924
- }
5925
- if (mix !== void 0) {
5926
- mix = Array.isArray(mix) ? mix : [mix];
5927
- for (var i = 0, len = mix.length; i < len; i++) {
5928
- var value = mix[i];
5929
- if (!value || typeof value.valueOf() !== "string")
5930
- continue;
5931
- var mixes = value.valueOf().split(" ");
5932
- for (var j = 0; j < mixes.length; j++) {
5933
- var val = mixes[j];
5934
- if (val !== entityName) {
5935
- className += " " + val;
5936
- }
5937
- }
5938
- }
5939
- }
5940
- return className;
5941
- }
5942
- return function cnGenerator(b2, e) {
5943
- return function(elemOrMods, elemModsOrBlockMix, elemMix) {
5944
- if (typeof elemOrMods === "string") {
5945
- if (typeof elemModsOrBlockMix === "string" || Array.isArray(elemModsOrBlockMix)) {
5946
- return stringify(b2, elemOrMods, void 0, elemModsOrBlockMix);
5947
- }
5948
- return stringify(b2, elemOrMods, elemModsOrBlockMix, elemMix);
5949
- }
5950
- return stringify(b2, e, elemOrMods, elemModsOrBlockMix);
5951
- };
5952
- };
5953
- }
5954
- var cn2 = withNaming({
5955
- e: "-",
5956
- m: "_"
5957
- });
5958
- classname_development.cn = cn2;
5959
- classname_development.withNaming = withNaming;
5960
- return classname_development;
5961
- }
5962
- (function(module2) {
5963
- if (process.env.NODE_ENV === "production") {
5964
- module2.exports = requireClassname_production_min();
5965
- } else {
5966
- module2.exports = requireClassname_development();
5967
- }
5968
- })(classname);
5969
- const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
5970
5850
  const defaultProps$1m = {
5971
5851
  ...ComponentDefaults,
5972
5852
  position: "center",
5973
5853
  transition: "",
5974
5854
  overlayStyle: {},
5975
- overlayClass: "",
5976
- popClass: "",
5855
+ overlayClassName: "",
5977
5856
  closeable: false,
5978
5857
  closeIconPosition: "top-right",
5979
5858
  closeIcon: "close",
5980
- destroyOnClose: true,
5981
- teleport: null,
5859
+ destroyOnClose: false,
5860
+ portal: null,
5982
5861
  overlay: true,
5983
5862
  round: false,
5984
5863
  onOpen: () => {
@@ -5987,14 +5866,8 @@ Check the top-level render call using <` + t + ">.");
5987
5866
  },
5988
5867
  onClick: (e) => {
5989
5868
  },
5990
- onOpened: (e) => {
5991
- },
5992
- onClosed: (e) => {
5993
- },
5994
- onClickOverlay: (e) => {
5995
- },
5996
- onClickCloseIcon: (e) => {
5997
- },
5869
+ onClickOverlay: (e) => true,
5870
+ onClickCloseIcon: (e) => true,
5998
5871
  ...defaultOverlayProps
5999
5872
  };
6000
5873
  let _zIndex = 1e3;
@@ -6005,7 +5878,7 @@ Check the top-level render call using <` + t + ">.");
6005
5878
  overlay,
6006
5879
  closeOnOverlayClick,
6007
5880
  overlayStyle,
6008
- overlayClass,
5881
+ overlayClassName,
6009
5882
  zIndex,
6010
5883
  lockScroll,
6011
5884
  duration,
@@ -6016,23 +5889,22 @@ Check the top-level render call using <` + t + ">.");
6016
5889
  transition,
6017
5890
  round,
6018
5891
  position,
6019
- popClass,
6020
5892
  className,
6021
5893
  destroyOnClose,
6022
- teleport,
5894
+ portal,
6023
5895
  onOpen,
6024
5896
  onClose,
6025
5897
  onClickOverlay,
6026
5898
  onClickCloseIcon,
6027
- onOpened,
6028
- onClosed,
5899
+ afterShow,
5900
+ afterClose,
6029
5901
  onClick
6030
5902
  } = props;
6031
5903
  const [index, setIndex] = React.useState(zIndex || _zIndex);
6032
5904
  const [innerVisible, setInnerVisible] = React.useState(visible);
6033
5905
  const [showChildren, setShowChildren] = React.useState(true);
6034
5906
  const [transitionName, setTransitionName] = React.useState("");
6035
- const b2 = cn("popup");
5907
+ const classPrefix2 = "nut-popup";
6036
5908
  const baseStyle = {
6037
5909
  zIndex: index,
6038
5910
  animationDuration: `${duration}s`
@@ -6045,15 +5917,15 @@ Check the top-level render call using <` + t + ">.");
6045
5917
  ...style,
6046
5918
  ...baseStyle
6047
5919
  };
6048
- const classes = classNames({
5920
+ const popClassName = classNames({
6049
5921
  round,
6050
- [`nut-popup-${position}`]: true,
6051
- [`${popClass}`]: true,
5922
+ [`${classPrefix2}`]: true,
5923
+ [`${classPrefix2}-${position}`]: true,
6052
5924
  [`${className || ""}`]: true
6053
- }, b2(""));
5925
+ });
6054
5926
  const closeClasses = classNames({
6055
- "nut-popup__close-icon": true,
6056
- [`nut-popup__close-icon--${closeIconPosition}`]: true
5927
+ [`${classPrefix2}__close-icon`]: true,
5928
+ [`${classPrefix2}__close-icon--${closeIconPosition}`]: true
6057
5929
  });
6058
5930
  const open = () => {
6059
5931
  if (!innerVisible) {
@@ -6071,29 +5943,29 @@ Check the top-level render call using <` + t + ">.");
6071
5943
  if (destroyOnClose) {
6072
5944
  setTimeout(() => {
6073
5945
  setShowChildren(false);
6074
- onClose && onClose();
6075
5946
  }, Number(duration) * 1e3);
6076
5947
  }
5948
+ onClose && onClose();
6077
5949
  }
6078
5950
  };
6079
5951
  const onHandleClickOverlay = (e) => {
6080
5952
  if (closeOnOverlayClick) {
6081
- onClickOverlay && onClickOverlay(e);
6082
- close();
5953
+ const closed = onClickOverlay && onClickOverlay(e);
5954
+ closed && close();
6083
5955
  }
6084
5956
  };
6085
5957
  const onHandleClick = (e) => {
6086
5958
  onClick && onClick(e);
6087
5959
  };
6088
5960
  const onHandleClickCloseIcon = (e) => {
6089
- onClickCloseIcon && onClickCloseIcon(e);
6090
- close();
5961
+ const closed = onClickCloseIcon && onClickCloseIcon(e);
5962
+ closed && close();
6091
5963
  };
6092
5964
  const onHandleOpened = (e) => {
6093
- onOpened && onOpened(e);
5965
+ afterShow && afterShow();
6094
5966
  };
6095
5967
  const onHandleClosed = (e) => {
6096
- onClosed && onClosed(e);
5968
+ afterClose && afterClose();
6097
5969
  };
6098
5970
  const resolveContainer = (getContainer) => {
6099
5971
  const container = typeof getContainer === "function" ? getContainer() : getContainer;
@@ -6129,7 +6001,7 @@ Check the top-level render call using <` + t + ">.");
6129
6001
  onExited: onHandleClosed,
6130
6002
  children: /* @__PURE__ */ jsxs("div", {
6131
6003
  style: popStyles,
6132
- className: classes,
6004
+ className: popClassName,
6133
6005
  onClick: onHandleClick,
6134
6006
  children: [showChildren ? children : "", renderIcon()]
6135
6007
  })
@@ -6140,7 +6012,7 @@ Check the top-level render call using <` + t + ">.");
6140
6012
  children: overlay ? /* @__PURE__ */ jsxs(Fragment, {
6141
6013
  children: [/* @__PURE__ */ jsx(Overlay, {
6142
6014
  style: overlayStyles,
6143
- className: overlayClass,
6015
+ className: overlayClassName,
6144
6016
  visible: innerVisible,
6145
6017
  closeOnOverlayClick,
6146
6018
  zIndex,
@@ -6158,16 +6030,17 @@ Check the top-level render call using <` + t + ">.");
6158
6030
  !visible && close();
6159
6031
  }, [visible]);
6160
6032
  React.useEffect(() => {
6161
- setTransitionName(transition || `nut-popup-slide-${position}`);
6162
- }, [position]);
6033
+ setTransitionName(transition || `${classPrefix2}-slide-${position}`);
6034
+ }, [position, transition]);
6163
6035
  return /* @__PURE__ */ jsx(Fragment, {
6164
- children: renderToContainer(teleport, renderNode())
6036
+ children: renderToContainer(portal, renderNode())
6165
6037
  });
6166
6038
  };
6167
6039
  Popup.defaultProps = defaultProps$1m;
6168
6040
  Popup.displayName = "NutPopup";
6169
6041
  const DataContext$2 = React.createContext({});
6170
6042
  const defaultProps$1l = {
6043
+ ...ComponentDefaults,
6171
6044
  span: "24",
6172
6045
  offset: "0",
6173
6046
  gutter: "0"
@@ -6175,7 +6048,7 @@ Check the top-level render call using <` + t + ">.");
6175
6048
  const Col = (props) => {
6176
6049
  const {
6177
6050
  className,
6178
- style = {},
6051
+ style,
6179
6052
  span,
6180
6053
  offset,
6181
6054
  children,
@@ -6221,7 +6094,7 @@ Check the top-level render call using <` + t + ">.");
6221
6094
  contentPosition: "center",
6222
6095
  direction: "horizontal"
6223
6096
  };
6224
- const classPrefix$3 = `nut-divider`;
6097
+ const classPrefix$4 = `nut-divider`;
6225
6098
  const Divider = (props) => {
6226
6099
  const {
6227
6100
  children,
@@ -6235,14 +6108,14 @@ Check the top-level render call using <` + t + ">.");
6235
6108
  ...props
6236
6109
  };
6237
6110
  const classes = direction === "horizontal" ? classNames({
6238
- [`${classPrefix$3}`]: true,
6239
- [`${classPrefix$3}__center`]: children,
6240
- [`${classPrefix$3}__left`]: contentPosition === "left",
6241
- [`${classPrefix$3}__right`]: contentPosition === "right",
6242
- [`${classPrefix$3}__hairline`]: true
6111
+ [`${classPrefix$4}`]: true,
6112
+ [`${classPrefix$4}__center`]: children,
6113
+ [`${classPrefix$4}__left`]: contentPosition === "left",
6114
+ [`${classPrefix$4}__right`]: contentPosition === "right",
6115
+ [`${classPrefix$4}__hairline`]: true
6243
6116
  }) : classNames({
6244
- [`${classPrefix$3}`]: true,
6245
- [`${classPrefix$3}__vertical`]: direction === "vertical"
6117
+ [`${classPrefix$4}`]: true,
6118
+ [`${classPrefix$4}__vertical`]: direction === "vertical"
6246
6119
  });
6247
6120
  return /* @__PURE__ */ jsx("div", {
6248
6121
  className: `${classes} ${className || ""}`,
@@ -6426,7 +6299,9 @@ Check the top-level render call using <` + t + ">.");
6426
6299
  };
6427
6300
  Layout.defaultProps = defaultProps$1h;
6428
6301
  Layout.displayName = "NutLayout";
6302
+ const classPrefix$3 = "nut-row";
6429
6303
  const defaultProps$1g = {
6304
+ ...ComponentDefaults,
6430
6305
  type: "",
6431
6306
  justify: "start",
6432
6307
  align: "flex-start",
@@ -6436,7 +6311,7 @@ Check the top-level render call using <` + t + ">.");
6436
6311
  const Row = (props) => {
6437
6312
  const {
6438
6313
  className,
6439
- style = {},
6314
+ style,
6440
6315
  children,
6441
6316
  type: type2,
6442
6317
  justify,
@@ -6448,7 +6323,6 @@ Check the top-level render call using <` + t + ">.");
6448
6323
  ...defaultProps$1g,
6449
6324
  ...props
6450
6325
  };
6451
- const prefixCls2 = "nut-row";
6452
6326
  const getClass = (prefix2, type22) => {
6453
6327
  const classType = type22 ? `nut-row-${prefix2}-${type22}` : "";
6454
6328
  const className2 = prefix2 ? classType : `nut-row-${type22}`;
@@ -6460,7 +6334,7 @@ Check the top-level render call using <` + t + ">.");
6460
6334
  ${getClass("justify", justify)}
6461
6335
  ${getClass("align", align)}
6462
6336
  ${getClass("flex", wrap)}
6463
- ${prefixCls2}
6337
+ ${classPrefix$3}
6464
6338
  `;
6465
6339
  };
6466
6340
  const parentRow = {
@@ -11819,6 +11693,126 @@ Please add \`${key}Action\` when creating your handler.`);
11819
11693
  }
11820
11694
  });
11821
11695
  const animated = host.animated;
11696
+ var classnameExports = {};
11697
+ var classname = {
11698
+ get exports() {
11699
+ return classnameExports;
11700
+ },
11701
+ set exports(v) {
11702
+ classnameExports = v;
11703
+ }
11704
+ };
11705
+ var classname_production_min = {};
11706
+ var hasRequiredClassname_production_min;
11707
+ function requireClassname_production_min() {
11708
+ if (hasRequiredClassname_production_min)
11709
+ return classname_production_min;
11710
+ hasRequiredClassname_production_min = 1;
11711
+ function r(r2) {
11712
+ function t2(t3, i, a2, o) {
11713
+ var f = i ? e + t3 + r2.e + i : e + t3, v = f;
11714
+ if (a2) {
11715
+ var s = " " + v + r2.m;
11716
+ for (var u in a2)
11717
+ if (a2.hasOwnProperty(u)) {
11718
+ var p = a2[u];
11719
+ true === p ? v += s + u : p && (v += s + u + n + p);
11720
+ }
11721
+ }
11722
+ if (void 0 !== o)
11723
+ for (var y2 = 0, c = (o = Array.isArray(o) ? o : [o]).length; y2 < c; y2++) {
11724
+ var l2 = o[y2];
11725
+ if (l2 && "string" == typeof l2.valueOf())
11726
+ for (var g = l2.valueOf().split(" "), d = 0; d < g.length; d++) {
11727
+ var h = g[d];
11728
+ h !== f && (v += " " + h);
11729
+ }
11730
+ }
11731
+ return v;
11732
+ }
11733
+ var e = r2.n || "", n = r2.v || r2.m;
11734
+ return function(r3, e2) {
11735
+ return function(n2, i, a2) {
11736
+ 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);
11737
+ };
11738
+ };
11739
+ }
11740
+ Object.defineProperty(classname_production_min, "__esModule", { value: true });
11741
+ var t = r({ e: "-", m: "_" });
11742
+ classname_production_min.cn = t, classname_production_min.withNaming = r;
11743
+ return classname_production_min;
11744
+ }
11745
+ var classname_development = {};
11746
+ var hasRequiredClassname_development;
11747
+ function requireClassname_development() {
11748
+ if (hasRequiredClassname_development)
11749
+ return classname_development;
11750
+ hasRequiredClassname_development = 1;
11751
+ Object.defineProperty(classname_development, "__esModule", { value: true });
11752
+ function withNaming(preset) {
11753
+ var nameSpace = preset.n || "";
11754
+ var modValueDelimiter = preset.v || preset.m;
11755
+ function stringify(b2, e, m, mix) {
11756
+ var entityName = e ? nameSpace + b2 + preset.e + e : nameSpace + b2;
11757
+ var className = entityName;
11758
+ if (m) {
11759
+ var modPrefix = " " + className + preset.m;
11760
+ for (var k2 in m) {
11761
+ if (m.hasOwnProperty(k2)) {
11762
+ var modVal = m[k2];
11763
+ if (modVal === true) {
11764
+ className += modPrefix + k2;
11765
+ } else if (modVal) {
11766
+ className += modPrefix + k2 + modValueDelimiter + modVal;
11767
+ }
11768
+ }
11769
+ }
11770
+ }
11771
+ if (mix !== void 0) {
11772
+ mix = Array.isArray(mix) ? mix : [mix];
11773
+ for (var i = 0, len = mix.length; i < len; i++) {
11774
+ var value = mix[i];
11775
+ if (!value || typeof value.valueOf() !== "string")
11776
+ continue;
11777
+ var mixes = value.valueOf().split(" ");
11778
+ for (var j = 0; j < mixes.length; j++) {
11779
+ var val = mixes[j];
11780
+ if (val !== entityName) {
11781
+ className += " " + val;
11782
+ }
11783
+ }
11784
+ }
11785
+ }
11786
+ return className;
11787
+ }
11788
+ return function cnGenerator(b2, e) {
11789
+ return function(elemOrMods, elemModsOrBlockMix, elemMix) {
11790
+ if (typeof elemOrMods === "string") {
11791
+ if (typeof elemModsOrBlockMix === "string" || Array.isArray(elemModsOrBlockMix)) {
11792
+ return stringify(b2, elemOrMods, void 0, elemModsOrBlockMix);
11793
+ }
11794
+ return stringify(b2, elemOrMods, elemModsOrBlockMix, elemMix);
11795
+ }
11796
+ return stringify(b2, e, elemOrMods, elemModsOrBlockMix);
11797
+ };
11798
+ };
11799
+ }
11800
+ var cn2 = withNaming({
11801
+ e: "-",
11802
+ m: "_"
11803
+ });
11804
+ classname_development.cn = cn2;
11805
+ classname_development.withNaming = withNaming;
11806
+ return classname_development;
11807
+ }
11808
+ (function(module2) {
11809
+ if (process.env.NODE_ENV === "production") {
11810
+ module2.exports = requireClassname_production_min();
11811
+ } else {
11812
+ module2.exports = requireClassname_development();
11813
+ }
11814
+ })(classname);
11815
+ const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
11822
11816
  const elevatorContext = React.createContext({});
11823
11817
  const defaultProps$1e = {
11824
11818
  height: "200px",
@@ -12753,7 +12747,6 @@ Please add \`${key}Action\` when creating your handler.`);
12753
12747
  width: "80%"
12754
12748
  };
12755
12749
  const SideNavBar = (props) => {
12756
- useConfig();
12757
12750
  const {
12758
12751
  title,
12759
12752
  visible,
@@ -14659,7 +14652,7 @@ Please add \`${key}Action\` when creating your handler.`);
14659
14652
  };
14660
14653
  return /* @__PURE__ */ jsx(Fragment, {
14661
14654
  children: poppable ? /* @__PURE__ */ jsx(Popup, {
14662
- popClass: "cascadar-popup",
14655
+ className: "cascadar-popup",
14663
14656
  visible,
14664
14657
  position: "bottom",
14665
14658
  round: true,
@@ -17844,7 +17837,7 @@ Please add \`${key}Action\` when creating your handler.`);
17844
17837
  children: /* @__PURE__ */ jsx(Popup, {
17845
17838
  visible: show,
17846
17839
  position: "bottom",
17847
- popClass,
17840
+ className: popClass,
17848
17841
  onClickOverlay: onClose,
17849
17842
  overlay,
17850
17843
  onClickCloseIcon: onClose,
@@ -19737,29 +19730,26 @@ Please add \`${key}Action\` when creating your handler.`);
19737
19730
  const defaultProps$J = {
19738
19731
  ...ComponentDefaults,
19739
19732
  url: "",
19740
- maximum: 1,
19741
- uploadIcon: null,
19742
- uploadIconSize: "",
19743
- uploadIconTip: "",
19744
- listType: "picture",
19733
+ maxCount: 1,
19734
+ previewType: "picture",
19735
+ imageFit: "cover",
19745
19736
  name: "file",
19746
19737
  accept: "*",
19747
19738
  disabled: false,
19748
19739
  autoUpload: true,
19749
19740
  multiple: false,
19750
- maximize: Number.MAX_VALUE,
19741
+ maxFileSize: Number.MAX_VALUE,
19751
19742
  data: {},
19752
19743
  headers: {},
19753
19744
  method: "post",
19754
- defaultImg: "",
19755
19745
  xhrState: 200,
19756
19746
  timeout: 1e3 * 30,
19757
19747
  withCredentials: false,
19758
19748
  clearInput: true,
19759
- isPreview: true,
19760
- isDeletable: true,
19749
+ preview: true,
19750
+ deletable: true,
19761
19751
  capture: false,
19762
- onBeforeDelete: (file, files) => {
19752
+ beforeDelete: (file, files) => {
19763
19753
  return true;
19764
19754
  }
19765
19755
  };
@@ -19783,32 +19773,33 @@ Please add \`${key}Action\` when creating your handler.`);
19783
19773
  const {
19784
19774
  children,
19785
19775
  uploadIcon,
19786
- uploadIconSize,
19787
- uploadIconTip,
19776
+ uploadLabel,
19788
19777
  name,
19789
19778
  accept,
19790
- defaultFileList,
19791
- listType,
19779
+ defaultValue,
19780
+ value,
19781
+ previewType,
19782
+ imageFit,
19792
19783
  disabled,
19793
19784
  multiple,
19794
19785
  url,
19795
- defaultImg,
19786
+ previewUrl,
19796
19787
  headers,
19797
19788
  timeout,
19798
19789
  method: method2,
19799
19790
  xhrState,
19800
19791
  withCredentials,
19801
19792
  data,
19802
- isPreview,
19803
- isDeletable,
19804
- maximum,
19793
+ preview,
19794
+ deletable,
19795
+ maxCount,
19805
19796
  capture,
19806
- maximize,
19797
+ maxFileSize,
19807
19798
  className,
19808
19799
  autoUpload,
19809
19800
  clearInput,
19810
19801
  onStart,
19811
- onRemove,
19802
+ onDelete,
19812
19803
  onChange,
19813
19804
  onFileItemClick,
19814
19805
  onProgress,
@@ -19816,23 +19807,22 @@ Please add \`${key}Action\` when creating your handler.`);
19816
19807
  onUpdate,
19817
19808
  onFailure,
19818
19809
  onOversize,
19819
- onBeforeUpload,
19820
- onBeforeXhrUpload,
19821
- onBeforeDelete,
19810
+ beforeUpload,
19811
+ beforeXhrUpload,
19812
+ beforeDelete,
19822
19813
  ...restProps
19823
19814
  } = {
19824
19815
  ...defaultProps$J,
19825
19816
  ...props
19826
19817
  };
19827
- const [fileList, setFileList] = React.useState([]);
19818
+ const [fileList, setFileList] = React.useState(defaultValue || []);
19828
19819
  const [uploadQueue, setUploadQueue] = React.useState([]);
19829
19820
  React.useEffect(() => {
19830
- if (defaultFileList) {
19831
- setFileList(defaultFileList);
19821
+ if (value) {
19822
+ setFileList(value);
19832
19823
  }
19833
- }, [defaultFileList]);
19834
- const b2 = cn("uploader");
19835
- const classes = classNames(className, b2(""));
19824
+ }, [value]);
19825
+ const classes = classNames(className, "nut-uploader");
19836
19826
  React.useImperativeHandle(ref, () => ({
19837
19827
  submit: () => {
19838
19828
  Promise.all(uploadQueue).then((res) => {
@@ -19859,8 +19849,8 @@ Please add \`${key}Action\` when creating your handler.`);
19859
19849
  const executeUpload = (fileItem, index) => {
19860
19850
  const uploadOption = new UploadOptions();
19861
19851
  uploadOption.url = url;
19862
- for (const [key, value] of Object.entries(data)) {
19863
- fileItem.formData.append(key, value);
19852
+ for (const [key, value2] of Object.entries(data)) {
19853
+ fileItem.formData.append(key, value2);
19864
19854
  }
19865
19855
  uploadOption.formData = fileItem.formData;
19866
19856
  uploadOption.timeout = timeout * 1;
@@ -19868,7 +19858,7 @@ Please add \`${key}Action\` when creating your handler.`);
19868
19858
  uploadOption.xhrState = xhrState;
19869
19859
  uploadOption.headers = headers;
19870
19860
  uploadOption.withCredentials = withCredentials;
19871
- uploadOption.beforeXhrUpload = onBeforeXhrUpload;
19861
+ uploadOption.beforeXhrUpload = beforeXhrUpload;
19872
19862
  try {
19873
19863
  uploadOption.sourceFile = fileItem.formData.get(name);
19874
19864
  } catch (error) {
@@ -19966,7 +19956,7 @@ Please add \`${key}Action\` when creating your handler.`);
19966
19956
  fileItem.message = locale.uploader.waitingUpload;
19967
19957
  }
19968
19958
  executeUpload(fileItem, index);
19969
- if (isPreview && file.type.includes("image")) {
19959
+ if (preview && file.type.includes("image")) {
19970
19960
  const reader = new FileReader();
19971
19961
  reader.onload = (event) => {
19972
19962
  fileItem.url = event.target.result;
@@ -19981,10 +19971,10 @@ Please add \`${key}Action\` when creating your handler.`);
19981
19971
  });
19982
19972
  };
19983
19973
  const filterFiles = (files) => {
19984
- const maximum2 = props.maximum * 1;
19974
+ const maximum = props.maxCount * 1;
19985
19975
  const oversizes = new Array();
19986
19976
  const filterFile = files.filter((file) => {
19987
- if (file.size > maximize) {
19977
+ if (file.size > maxFileSize) {
19988
19978
  oversizes.push(file);
19989
19979
  return false;
19990
19980
  }
@@ -19993,23 +19983,23 @@ Please add \`${key}Action\` when creating your handler.`);
19993
19983
  if (oversizes.length) {
19994
19984
  onOversize && onOversize(files);
19995
19985
  }
19996
- if (filterFile.length > maximum2) {
19997
- filterFile.splice(maximum2, filterFile.length - maximum2);
19986
+ if (filterFile.length > maximum) {
19987
+ filterFile.splice(maximum, filterFile.length - maximum);
19998
19988
  }
19999
19989
  if (fileList.length !== 0) {
20000
- const index = maximum2 - fileList.length;
19990
+ const index = maximum - fileList.length;
20001
19991
  filterFile.splice(index, filterFile.length - index);
20002
19992
  }
20003
19993
  return filterFile;
20004
19994
  };
20005
19995
  const deleted = (file, index) => {
20006
19996
  fileList.splice(index, 1);
20007
- onRemove && onRemove(file, fileList);
19997
+ onDelete && onDelete(file, fileList);
20008
19998
  setFileList([...fileList]);
20009
19999
  };
20010
- const onDelete = (file, index) => {
20000
+ const onDeleteItem = (file, index) => {
20011
20001
  clearUploadQueue(index);
20012
- funcInterceptor(onBeforeDelete, {
20002
+ funcInterceptor(beforeDelete, {
20013
20003
  args: [file, fileList],
20014
20004
  done: () => deleted(file, index)
20015
20005
  });
@@ -20022,8 +20012,8 @@ Please add \`${key}Action\` when creating your handler.`);
20022
20012
  const {
20023
20013
  files
20024
20014
  } = $el;
20025
- if (onBeforeUpload) {
20026
- onBeforeUpload(new Array().slice.call(files)).then((f) => {
20015
+ if (beforeUpload) {
20016
+ beforeUpload(new Array().slice.call(files)).then((f) => {
20027
20017
  const _files = filterFiles(new Array().slice.call(f));
20028
20018
  readFile(_files);
20029
20019
  });
@@ -20048,7 +20038,7 @@ Please add \`${key}Action\` when creating your handler.`);
20048
20038
  children: [children && /* @__PURE__ */ jsx("div", {
20049
20039
  className: "nut-uploader__slot",
20050
20040
  children: /* @__PURE__ */ jsxs(Fragment, {
20051
- children: [children, maximum > fileList.length && /* @__PURE__ */ jsx(Fragment, {
20041
+ children: [children, maxCount > fileList.length && /* @__PURE__ */ jsx(Fragment, {
20052
20042
  children: capture ? /* @__PURE__ */ jsx("input", {
20053
20043
  className: "nut-uploader__input",
20054
20044
  type: "file",
@@ -20071,13 +20061,13 @@ Please add \`${key}Action\` when creating your handler.`);
20071
20061
  })
20072
20062
  }), fileList.length !== 0 && fileList.map((item, index) => {
20073
20063
  return /* @__PURE__ */ jsxs("div", {
20074
- className: `nut-uploader__preview ${listType}`,
20075
- children: [listType === "picture" && !children && /* @__PURE__ */ jsxs("div", {
20064
+ className: `nut-uploader__preview ${previewType}`,
20065
+ children: [previewType === "picture" && !children && /* @__PURE__ */ jsxs("div", {
20076
20066
  className: "nut-uploader__preview-img",
20077
- children: [isDeletable && /* @__PURE__ */ jsx(x$8, {
20067
+ children: [deletable && /* @__PURE__ */ jsx(x$8, {
20078
20068
  color: "rgba(0,0,0,0.6)",
20079
20069
  className: "close",
20080
- onClick: () => onDelete(item, index)
20070
+ onClick: () => onDeleteItem(item, index)
20081
20071
  }), item.status === "ready" ? /* @__PURE__ */ jsx("div", {
20082
20072
  className: "nut-uploader__preview__progress",
20083
20073
  children: /* @__PURE__ */ jsx("div", {
@@ -20089,6 +20079,7 @@ Please add \`${key}Action\` when creating your handler.`);
20089
20079
  children: [item.failIcon !== " " && item.loadingIcon !== " " && (item.status === "error" ? item.failIcon || /* @__PURE__ */ jsx(x$8, {
20090
20080
  color: "#fff"
20091
20081
  }) : item.loadingIcon || /* @__PURE__ */ jsx(k$2, {
20082
+ className: "nut-icon-loading",
20092
20083
  color: "#fff"
20093
20084
  })), /* @__PURE__ */ jsx("div", {
20094
20085
  className: "nut-uploader__preview__progress__msg",
@@ -20097,14 +20088,17 @@ Please add \`${key}Action\` when creating your handler.`);
20097
20088
  }), item.type.includes("image") ? /* @__PURE__ */ jsx(Fragment, {
20098
20089
  children: item.url && /* @__PURE__ */ jsx("img", {
20099
20090
  className: "nut-uploader__preview-img__c",
20091
+ style: {
20092
+ objectFit: imageFit
20093
+ },
20100
20094
  src: item.url,
20101
20095
  alt: "",
20102
20096
  onClick: () => handleItemClick(item)
20103
20097
  })
20104
20098
  }) : /* @__PURE__ */ jsx(Fragment, {
20105
- children: defaultImg ? /* @__PURE__ */ jsx("img", {
20099
+ children: previewUrl ? /* @__PURE__ */ jsx("img", {
20106
20100
  className: "nut-uploader__preview-img__c",
20107
- src: defaultImg,
20101
+ src: previewUrl,
20108
20102
  alt: "",
20109
20103
  onClick: () => handleItemClick(item)
20110
20104
  }) : /* @__PURE__ */ jsx("div", {
@@ -20121,16 +20115,16 @@ Please add \`${key}Action\` when creating your handler.`);
20121
20115
  className: "tips",
20122
20116
  children: item.name
20123
20117
  }) : null]
20124
- }), listType === "list" && /* @__PURE__ */ jsxs("div", {
20118
+ }), previewType === "list" && /* @__PURE__ */ jsxs("div", {
20125
20119
  className: "nut-uploader__preview-list",
20126
20120
  children: [/* @__PURE__ */ jsxs("div", {
20127
20121
  className: `nut-uploader__preview-img__file__name ${item.status}`,
20128
20122
  onClick: () => handleItemClick(item),
20129
20123
  children: [/* @__PURE__ */ jsx(x$6, {}), " ", item.name]
20130
- }), isDeletable && /* @__PURE__ */ jsx(y$6, {
20124
+ }), deletable && /* @__PURE__ */ jsx(y$6, {
20131
20125
  color: "#808080",
20132
20126
  className: "nut-uploader__preview-img__file__del",
20133
- onClick: () => onDelete(item, index)
20127
+ onClick: () => onDeleteItem(item, index)
20134
20128
  }), item.status === "uploading" && /* @__PURE__ */ jsx(Progress, {
20135
20129
  size: "small",
20136
20130
  percentage: item.percentage,
@@ -20139,17 +20133,17 @@ Please add \`${key}Action\` when creating your handler.`);
20139
20133
  })]
20140
20134
  })]
20141
20135
  }, item.uid);
20142
- }), maximum > fileList.length && listType === "picture" && !children && /* @__PURE__ */ jsxs("div", {
20143
- className: `nut-uploader__upload ${listType} ${disabled ? "nut-uploader__upload-disabled" : ""}`,
20136
+ }), maxCount > fileList.length && previewType === "picture" && !children && /* @__PURE__ */ jsxs("div", {
20137
+ className: `nut-uploader__upload ${previewType} ${disabled ? "nut-uploader__upload-disabled" : ""}`,
20144
20138
  children: [/* @__PURE__ */ jsxs("div", {
20145
20139
  className: "nut-uploader__icon",
20146
20140
  children: [uploadIcon || /* @__PURE__ */ jsx(x$3, {
20147
- width: uploadIconSize,
20148
- height: uploadIconSize,
20141
+ width: "20px",
20142
+ height: "20px",
20149
20143
  color: "#808080"
20150
20144
  }), /* @__PURE__ */ jsx("span", {
20151
20145
  className: "nut-uploader__icon-tip",
20152
- children: uploadIconTip
20146
+ children: uploadLabel
20153
20147
  })]
20154
20148
  }), capture ? /* @__PURE__ */ jsx("input", {
20155
20149
  className: "nut-uploader__input",
@@ -21877,15 +21871,13 @@ Please add \`${key}Action\` when creating your handler.`);
21877
21871
  AnimatingNumbers.CountUp = CountUp;
21878
21872
  const defaultProps$x = {
21879
21873
  ...ComponentDefaults,
21880
- className: "",
21881
- url: "",
21882
- style: {},
21874
+ src: "",
21883
21875
  muted: false,
21884
21876
  autoplay: false,
21885
21877
  loop: false,
21886
21878
  preload: "auto",
21887
21879
  type: "progress",
21888
- onFastBack: (e) => {
21880
+ onBack: (e) => {
21889
21881
  },
21890
21882
  // type 为 progress时生效
21891
21883
  onForward: (e) => {
@@ -21893,7 +21885,7 @@ Please add \`${key}Action\` when creating your handler.`);
21893
21885
  // type 为 progress时生效
21894
21886
  onPause: (e) => {
21895
21887
  },
21896
- onPlayEnd: (e) => {
21888
+ onEnd: (e) => {
21897
21889
  },
21898
21890
  onMute: (e) => {
21899
21891
  },
@@ -21906,17 +21898,17 @@ Please add \`${key}Action\` when creating your handler.`);
21906
21898
  } = useConfig();
21907
21899
  const {
21908
21900
  className,
21909
- url,
21901
+ src,
21910
21902
  style,
21911
21903
  muted,
21912
21904
  autoplay,
21913
21905
  loop: loop2,
21914
21906
  preload,
21915
21907
  type: type2,
21916
- onFastBack,
21908
+ onBack,
21917
21909
  onForward,
21918
21910
  onPause,
21919
- onPlayEnd,
21911
+ onEnd,
21920
21912
  onMute,
21921
21913
  onCanPlay,
21922
21914
  children,
@@ -21940,13 +21932,13 @@ Please add \`${key}Action\` when creating your handler.`);
21940
21932
  playing: props.autoplay,
21941
21933
  handPlaying: false
21942
21934
  });
21943
- const b2 = cn("audio");
21935
+ const classPrefix2 = "nut-audio";
21944
21936
  const warn = console.warn;
21945
21937
  const handleEnded = (e) => {
21946
21938
  if (props.loop) {
21947
21939
  warn(locale.audio.tips || "onPlayEnd事件在loop=false时才会触发");
21948
21940
  } else {
21949
- props.onPlayEnd && props.onPlayEnd(e);
21941
+ props.onEnd && props.onEnd(e);
21950
21942
  }
21951
21943
  };
21952
21944
  function watch() {
@@ -21971,15 +21963,13 @@ Please add \`${key}Action\` when creating your handler.`);
21971
21963
  }
21972
21964
  };
21973
21965
  const renderIcon = () => {
21974
- return /* @__PURE__ */ jsx(Fragment, {
21966
+ return /* @__PURE__ */ jsx("div", {
21967
+ className: `${classPrefix2}__icon`,
21975
21968
  children: /* @__PURE__ */ jsx("div", {
21976
- className: b2("icon"),
21977
- children: /* @__PURE__ */ jsx("div", {
21978
- className: `${b2("icon-box")} ${playing ? b2("icon-play") : b2("icon-stop")}`,
21979
- onClick: handleStatusChange,
21980
- children: /* @__PURE__ */ jsx(k, {
21981
- className: playing ? "nut-icon-loading" : ""
21982
- })
21969
+ className: classNames(`${classPrefix2}__icon-box`, playing ? `${classPrefix2}__icon-play` : `${classPrefix2}__icon-stop`),
21970
+ onClick: handleStatusChange,
21971
+ children: /* @__PURE__ */ jsx(k, {
21972
+ className: playing ? "nut-icon-loading" : ""
21983
21973
  })
21984
21974
  })
21985
21975
  });
@@ -21988,7 +21978,7 @@ Please add \`${key}Action\` when creating your handler.`);
21988
21978
  if (statusRef.current.currentTime > 0 && AudioRef.current) {
21989
21979
  statusRef.current.currentTime--;
21990
21980
  AudioRef.current.currentTime = statusRef.current.currentTime;
21991
- props.onFastBack && props.onFastBack(AudioRef.current);
21981
+ props.onBack && props.onBack(AudioRef.current);
21992
21982
  }
21993
21983
  };
21994
21984
  const handleForward = () => {
@@ -22025,12 +22015,12 @@ Please add \`${key}Action\` when creating your handler.`);
22025
22015
  const renderProgerss = () => {
22026
22016
  return /* @__PURE__ */ jsxs(Fragment, {
22027
22017
  children: [/* @__PURE__ */ jsxs("div", {
22028
- className: b2("progress"),
22018
+ className: `${classPrefix2}__progress`,
22029
22019
  children: [/* @__PURE__ */ jsx("div", {
22030
22020
  className: "time",
22031
22021
  children: currentDuration
22032
22022
  }), /* @__PURE__ */ jsx("div", {
22033
- className: b2("progress-bar-wrapper"),
22023
+ className: `${classPrefix2}__progress-bar-wrapper`,
22034
22024
  children: /* @__PURE__ */ jsx(Range, {
22035
22025
  modelValue: percent,
22036
22026
  hiddenTag: true,
@@ -22072,7 +22062,7 @@ Please add \`${key}Action\` when creating your handler.`);
22072
22062
  };
22073
22063
  const renderNone = () => {
22074
22064
  return /* @__PURE__ */ jsx("div", {
22075
- className: b2("none-container"),
22065
+ className: `${classPrefix2}__none-container`,
22076
22066
  onClick: handleStatusChange,
22077
22067
  children
22078
22068
  });
@@ -22108,14 +22098,14 @@ Please add \`${key}Action\` when creating your handler.`);
22108
22098
  statusRef.current.currentTime = time;
22109
22099
  };
22110
22100
  return /* @__PURE__ */ jsxs("div", {
22111
- className: `${b2()} ${className}`,
22101
+ className: classNames(classPrefix2, className),
22112
22102
  style,
22113
22103
  ...rest,
22114
22104
  children: [renderAudio(), /* @__PURE__ */ jsx("audio", {
22115
22105
  className: "audioMain",
22116
22106
  controls: type2 === "controls",
22117
22107
  ref: AudioRef,
22118
- src: url,
22108
+ src,
22119
22109
  muted,
22120
22110
  preload,
22121
22111
  loop: loop2,
@@ -23869,7 +23859,7 @@ Please add \`${key}Action\` when creating your handler.`);
23869
23859
  };
23870
23860
  return /* @__PURE__ */ jsxs(Popup, {
23871
23861
  visible: showPop,
23872
- popClass: "custom-pop",
23862
+ className: "custom-pop",
23873
23863
  style: {
23874
23864
  width: "100%"
23875
23865
  },