@nutui/nutui-react 3.0.5 → 3.0.6
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.
- package/CHANGELOG.md +40 -1
- package/dist/cjs/packages/badge/badge.js +4 -3
- package/dist/cjs/packages/badge/style/badge.scss +4 -0
- package/dist/cjs/packages/badge/style/style.css +9 -6
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/datepicker/style/style.css +3 -0
- package/dist/cjs/packages/datepickerview/style/style.css +3 -0
- package/dist/cjs/packages/fixednav/style/style.css +9 -6
- package/dist/cjs/packages/indicator/indicator.js +1 -1
- package/dist/cjs/packages/lottie/index.d.ts +1 -1
- package/dist/cjs/packages/lottie/index.js +2 -2
- package/dist/cjs/packages/notify/Notification.d.ts +3 -9
- package/dist/cjs/packages/notify/Notification.js +27 -7
- package/dist/cjs/packages/notify/notify.d.ts +0 -4
- package/dist/cjs/packages/notify/notify.js +6 -34
- package/dist/cjs/packages/notify/style/notify.scss +39 -36
- package/dist/cjs/packages/notify/style/style.css +36 -31
- package/dist/cjs/packages/picker/style/style.css +3 -0
- package/dist/cjs/packages/pickerview/style/pickerview.scss +3 -0
- package/dist/cjs/packages/pickerview/style/style.css +3 -0
- package/dist/cjs/packages/skeleton/skeleton.js +64 -49
- package/dist/cjs/packages/skeleton/style/index.js +0 -1
- package/dist/cjs/packages/skeleton/style/skeleton.scss +40 -46
- package/dist/cjs/packages/skeleton/style/style.css +32 -175
- package/dist/cjs/packages/switch/style/style.css +5 -0
- package/dist/cjs/packages/switch/style/switch.scss +5 -0
- package/dist/cjs/packages/switch/switch.js +22 -11
- package/dist/cjs/packages/tabbar/style/style.css +54 -45
- package/dist/cjs/packages/tabbar/style/tabbar.scss +28 -19
- package/dist/cjs/packages/tabbar/tabbar.js +28 -10
- package/dist/cjs/packages/tabbaritem/style/style.css +30 -27
- package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +32 -29
- package/dist/cjs/packages/tabbaritem/tabbaritem.js +34 -13
- package/dist/cjs/types/spec/badge/base.d.ts +1 -0
- package/dist/cjs/types/spec/indicator/base.d.ts +1 -1
- package/dist/cjs/types/spec/notify/base.d.ts +7 -2
- package/dist/cjs/types/spec/searchbar/taro.d.ts +10 -7
- package/dist/cjs/types/spec/skeleton/base.d.ts +7 -5
- package/dist/cjs/types/spec/switch/base.d.ts +3 -2
- package/dist/cjs/types/spec/switch/h5.d.ts +1 -1
- package/dist/cjs/types/spec/switch/taro.d.ts +1 -4
- package/dist/cjs/types/spec/tabbar/base.d.ts +7 -4
- package/dist/es/packages/badge/badge.js +4 -3
- package/dist/es/packages/badge/style/badge.scss +4 -0
- package/dist/es/packages/badge/style/style.css +9 -6
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/datepicker/style/style.css +3 -0
- package/dist/es/packages/datepickerview/style/style.css +3 -0
- package/dist/es/packages/fixednav/style/style.css +9 -6
- package/dist/es/packages/indicator/indicator.js +1 -1
- package/dist/es/packages/lottie/index.d.ts +1 -1
- package/dist/es/packages/lottie/index.js +1 -1
- package/dist/es/packages/notify/Notification.d.ts +3 -9
- package/dist/es/packages/notify/Notification.js +27 -7
- package/dist/es/packages/notify/notify.d.ts +0 -4
- package/dist/es/packages/notify/notify.js +6 -34
- package/dist/es/packages/notify/style/notify.scss +39 -36
- package/dist/es/packages/notify/style/style.css +36 -31
- package/dist/es/packages/picker/style/style.css +3 -0
- package/dist/es/packages/pickerview/style/pickerview.scss +3 -0
- package/dist/es/packages/pickerview/style/style.css +3 -0
- package/dist/es/packages/skeleton/skeleton.js +63 -49
- package/dist/es/packages/skeleton/style/index.js +0 -1
- package/dist/es/packages/skeleton/style/skeleton.scss +40 -46
- package/dist/es/packages/skeleton/style/style.css +32 -175
- package/dist/es/packages/switch/style/style.css +5 -0
- package/dist/es/packages/switch/style/switch.scss +5 -0
- package/dist/es/packages/switch/switch.js +21 -11
- package/dist/es/packages/tabbar/style/style.css +54 -45
- package/dist/es/packages/tabbar/style/tabbar.scss +28 -19
- package/dist/es/packages/tabbar/tabbar.js +27 -10
- package/dist/es/packages/tabbaritem/style/style.css +30 -27
- package/dist/es/packages/tabbaritem/style/tabbaritem.scss +32 -29
- package/dist/es/packages/tabbaritem/tabbaritem.js +34 -13
- package/dist/es/types/spec/badge/base.d.ts +4 -0
- package/dist/es/types/spec/indicator/base.d.ts +1 -1
- package/dist/es/types/spec/notify/base.d.ts +22 -5
- package/dist/es/types/spec/searchbar/taro.d.ts +10 -7
- package/dist/es/types/spec/skeleton/base.d.ts +19 -14
- package/dist/es/types/spec/switch/base.d.ts +6 -2
- package/dist/es/types/spec/switch/h5.d.ts +1 -1
- package/dist/es/types/spec/switch/taro.d.ts +1 -4
- package/dist/es/types/spec/tabbar/base.d.ts +7 -4
- package/dist/nutui.react.umd.js +334 -284
- package/dist/style.css +1 -1
- package/dist/style.scss +45 -45
- package/dist/styles/variables-jmapp.scss +23 -1
- package/dist/styles/variables-jrkf.scss +23 -1
- package/dist/styles/variables.scss +35 -37
- package/package.json +1 -1
- /package/dist/cjs/packages/lottie/{web.d.ts → lottie.d.ts} +0 -0
- /package/dist/cjs/packages/lottie/{web.js → lottie.js} +0 -0
- /package/dist/es/packages/lottie/{web.d.ts → lottie.d.ts} +0 -0
- /package/dist/es/packages/lottie/{web.js → lottie.js} +0 -0
package/dist/nutui.react.umd.js
CHANGED
|
@@ -9967,7 +9967,8 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
9967
9967
|
top: 0,
|
|
9968
9968
|
right: 0,
|
|
9969
9969
|
fill: "solid",
|
|
9970
|
-
size: "large"
|
|
9970
|
+
size: "large",
|
|
9971
|
+
disabled: false
|
|
9971
9972
|
});
|
|
9972
9973
|
var Badge = function(props) {
|
|
9973
9974
|
var isIcon = function isIcon2() {
|
|
@@ -9981,7 +9982,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
9981
9982
|
};
|
|
9982
9983
|
var _this;
|
|
9983
9984
|
var rtl = useRtl();
|
|
9984
|
-
var _$_object_spread = _object_spread({}, defaultProps$1l, props), className = _$_object_spread.className, style = _$_object_spread.style, value2 = _$_object_spread.value, max = _$_object_spread.max, children = _$_object_spread.children, dot = _$_object_spread.dot, top = _$_object_spread.top, right = _$_object_spread.right, fill = _$_object_spread.fill, size = _$_object_spread.size;
|
|
9985
|
+
var _$_object_spread = _object_spread({}, defaultProps$1l, props), className = _$_object_spread.className, style = _$_object_spread.style, value2 = _$_object_spread.value, max = _$_object_spread.max, children = _$_object_spread.children, dot = _$_object_spread.dot, top = _$_object_spread.top, right = _$_object_spread.right, fill = _$_object_spread.fill, size = _$_object_spread.size, disabled = _$_object_spread.disabled;
|
|
9985
9986
|
var classPrefix2 = "nut-badge";
|
|
9986
9987
|
var classes = classNames(classPrefix2, className);
|
|
9987
9988
|
var getContent = function() {
|
|
@@ -9992,7 +9993,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
9992
9993
|
return value2;
|
|
9993
9994
|
};
|
|
9994
9995
|
var _obj;
|
|
9995
|
-
var contentClasses = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-sup"), isNumber() || isString() || dot), _define_property(_obj, "".concat(classPrefix2, "-number"), isNumber()), _define_property(_obj, "".concat(classPrefix2, "-one"), typeof getContent() === "string" && ((_this = "".concat(getContent())) === null || _this === void 0 ? void 0 : _this.length) === 1), _define_property(_obj, "".concat(classPrefix2, "-dot"), dot), _define_property(_obj, "".concat(classPrefix2, "-dot-").concat(size), dot), _define_property(_obj, "".concat(classPrefix2, "-").concat(fill), fill === "outline"), _define_property(_obj, "".concat(classPrefix2, "-content"), children), _obj));
|
|
9996
|
+
var contentClasses = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-sup"), isNumber() || isString() || dot), _define_property(_obj, "".concat(classPrefix2, "-number"), isNumber()), _define_property(_obj, "".concat(classPrefix2, "-one"), typeof getContent() === "string" && ((_this = "".concat(getContent())) === null || _this === void 0 ? void 0 : _this.length) === 1), _define_property(_obj, "".concat(classPrefix2, "-dot"), dot), _define_property(_obj, "".concat(classPrefix2, "-dot-").concat(size), dot), _define_property(_obj, "".concat(classPrefix2, "-").concat(fill), fill === "outline"), _define_property(_obj, "".concat(classPrefix2, "-content"), children), _define_property(_obj, "".concat(classPrefix2, "-disabled"), disabled), _obj));
|
|
9996
9997
|
var getPositionStyle = function() {
|
|
9997
9998
|
return _define_property({
|
|
9998
9999
|
top: "".concat(Number(top) || 0, "px")
|
|
@@ -10371,11 +10372,12 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10371
10372
|
dot: false,
|
|
10372
10373
|
max: 99,
|
|
10373
10374
|
top: "0",
|
|
10374
|
-
right: "0"
|
|
10375
|
+
right: "0",
|
|
10376
|
+
direction: "vertical"
|
|
10375
10377
|
});
|
|
10376
10378
|
var TabbarItem = function(props) {
|
|
10377
10379
|
var ctx2 = React.useContext(TabbarContext);
|
|
10378
|
-
var _ref = _object_spread({}, defaultProps$1g, props), className = _ref.className, style = _ref.style, title = _ref.title, icon = _ref.icon, value2 = _ref.value, dot = _ref.dot, max = _ref.max, top = _ref.top, right = _ref.right, index2 = _ref.index, rest = _object_without_properties(_ref, [
|
|
10380
|
+
var _ref = _object_spread({}, defaultProps$1g, props), className = _ref.className, style = _ref.style, title = _ref.title, icon = _ref.icon, value2 = _ref.value, dot = _ref.dot, max = _ref.max, top = _ref.top, right = _ref.right, index2 = _ref.index, direction = _ref.direction, onActiveClick = _ref.onActiveClick, rest = _object_without_properties(_ref, [
|
|
10379
10381
|
"className",
|
|
10380
10382
|
"style",
|
|
10381
10383
|
"title",
|
|
@@ -10385,15 +10387,19 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10385
10387
|
"max",
|
|
10386
10388
|
"top",
|
|
10387
10389
|
"right",
|
|
10388
|
-
"index"
|
|
10390
|
+
"index",
|
|
10391
|
+
"direction",
|
|
10392
|
+
"onActiveClick"
|
|
10389
10393
|
]);
|
|
10390
10394
|
var active2 = index2 === (ctx2 === null || ctx2 === void 0 ? void 0 : ctx2.selectIndex);
|
|
10391
10395
|
var classPrefix2 = "nut-tabbar-item";
|
|
10392
|
-
var
|
|
10393
|
-
var
|
|
10394
|
-
var
|
|
10396
|
+
var _obj;
|
|
10397
|
+
var tabbarItemClass = classNames(classPrefix2, (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-active"), active2), _define_property(_obj, "".concat(classPrefix2, "-large"), !icon || !title), _obj), className);
|
|
10398
|
+
var renderNodeWithActive = function(node) {
|
|
10399
|
+
return node && typeof node === "function" ? node(active2) : node;
|
|
10400
|
+
};
|
|
10395
10401
|
var badgeProps = {
|
|
10396
|
-
value: value2,
|
|
10402
|
+
value: renderNodeWithActive(value2),
|
|
10397
10403
|
dot,
|
|
10398
10404
|
max,
|
|
10399
10405
|
top,
|
|
@@ -10402,8 +10408,26 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10402
10408
|
};
|
|
10403
10409
|
var renderTitleText = function() {
|
|
10404
10410
|
return title && /* @__PURE__ */ React.createElement("div", {
|
|
10405
|
-
className:
|
|
10406
|
-
}, title);
|
|
10411
|
+
className: "".concat(classPrefix2, "-text")
|
|
10412
|
+
}, renderNodeWithActive(title));
|
|
10413
|
+
};
|
|
10414
|
+
var renderTitle = function() {
|
|
10415
|
+
return /* @__PURE__ */ React.createElement(Badge, _object_spread({
|
|
10416
|
+
size: "normal"
|
|
10417
|
+
}, badgeProps), renderTitleText());
|
|
10418
|
+
};
|
|
10419
|
+
var renderIcon = function() {
|
|
10420
|
+
return renderNodeWithActive(icon);
|
|
10421
|
+
};
|
|
10422
|
+
var renderIconAndTitle = function() {
|
|
10423
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Badge, _object_spread_props(_object_spread({
|
|
10424
|
+
size: "normal"
|
|
10425
|
+
}, badgeProps), {
|
|
10426
|
+
top: 3
|
|
10427
|
+
}), renderIcon()), renderTitleText());
|
|
10428
|
+
};
|
|
10429
|
+
var renderDualItem = function() {
|
|
10430
|
+
return dot ? null : /* @__PURE__ */ React.createElement(React.Fragment, null, renderIcon(), renderTitleText(), /* @__PURE__ */ React.createElement(Badge, badgeProps));
|
|
10407
10431
|
};
|
|
10408
10432
|
return /* @__PURE__ */ React.createElement("div", _object_spread({
|
|
10409
10433
|
className: tabbarItemClass,
|
|
@@ -10411,23 +10435,22 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10411
10435
|
color: active2 ? ctx2 === null || ctx2 === void 0 ? void 0 : ctx2.activeColor : ctx2 === null || ctx2 === void 0 ? void 0 : ctx2.inactiveColor
|
|
10412
10436
|
}, style),
|
|
10413
10437
|
onClick: function() {
|
|
10414
|
-
return ctx2 === null || ctx2 === void 0 ? void 0 : ctx2.handleClick(index2);
|
|
10438
|
+
return active2 ? onActiveClick === null || onActiveClick === void 0 ? void 0 : onActiveClick() : ctx2 === null || ctx2 === void 0 ? void 0 : ctx2.handleClick(index2);
|
|
10415
10439
|
}
|
|
10416
|
-
}, rest),
|
|
10417
|
-
className: boxPrefix
|
|
10418
|
-
}, icon)), renderTitleText()) : /* @__PURE__ */ React.createElement(Badge, badgeProps, renderTitleText()));
|
|
10440
|
+
}, rest), direction === "horizontal" && !dot ? renderDualItem() : /* @__PURE__ */ React.createElement(React.Fragment, null, icon && renderIconAndTitle(), !icon && renderTitle()));
|
|
10419
10441
|
};
|
|
10420
10442
|
var defaultProps$1f = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
10421
10443
|
defaultValue: 0,
|
|
10422
10444
|
fixed: false,
|
|
10423
10445
|
inactiveColor: "",
|
|
10424
10446
|
activeColor: "",
|
|
10447
|
+
direction: "vertical",
|
|
10425
10448
|
safeArea: false,
|
|
10426
|
-
onSwitch: function(
|
|
10449
|
+
onSwitch: function() {
|
|
10427
10450
|
}
|
|
10428
10451
|
});
|
|
10429
10452
|
var Tabbar = function(props) {
|
|
10430
|
-
var _$_object_spread = _object_spread({}, defaultProps$1f, props), children = _$_object_spread.children, defaultValue = _$_object_spread.defaultValue, value2 = _$_object_spread.value, fixed = _$_object_spread.fixed, activeColor = _$_object_spread.activeColor, inactiveColor = _$_object_spread.inactiveColor, safeArea = _$_object_spread.safeArea, className = _$_object_spread.className, style = _$_object_spread.style, onSwitch = _$_object_spread.onSwitch;
|
|
10453
|
+
var _$_object_spread = _object_spread({}, defaultProps$1f, props), children = _$_object_spread.children, defaultValue = _$_object_spread.defaultValue, value2 = _$_object_spread.value, fixed = _$_object_spread.fixed, activeColor = _$_object_spread.activeColor, inactiveColor = _$_object_spread.inactiveColor, direction = _$_object_spread.direction, safeArea = _$_object_spread.safeArea, className = _$_object_spread.className, style = _$_object_spread.style, onSwitch = _$_object_spread.onSwitch;
|
|
10431
10454
|
var classPrefix2 = "nut-tabbar";
|
|
10432
10455
|
var _usePropsValue = _sliced_to_array(usePropsValue({
|
|
10433
10456
|
value: value2,
|
|
@@ -10435,11 +10458,26 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10435
10458
|
finalValue: 0,
|
|
10436
10459
|
onChange: onSwitch
|
|
10437
10460
|
}), 2), selectIndex = _usePropsValue[0], setSelectIndex = _usePropsValue[1];
|
|
10461
|
+
var sizeCls = React.useMemo(function() {
|
|
10462
|
+
var size = React.Children.count(children);
|
|
10463
|
+
var _obj;
|
|
10464
|
+
return size > 3 ? "" : classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-wrap-3"), size === 3), _define_property(_obj, "".concat(classPrefix2, "-wrap-2"), size === 2), _define_property(_obj, "".concat(classPrefix2, "-wrap-").concat(direction), size === 2 && direction !== "vertical"), _obj));
|
|
10465
|
+
}, [
|
|
10466
|
+
children,
|
|
10467
|
+
direction
|
|
10468
|
+
]);
|
|
10469
|
+
var itemDirection = React.useMemo(function() {
|
|
10470
|
+
var size = React.Children.count(children);
|
|
10471
|
+
return size === 2 && direction !== "vertical" && direction;
|
|
10472
|
+
}, [
|
|
10473
|
+
direction,
|
|
10474
|
+
children
|
|
10475
|
+
]);
|
|
10438
10476
|
return /* @__PURE__ */ React.createElement("div", {
|
|
10439
10477
|
className: classNames(classPrefix2, _define_property({}, "".concat(classPrefix2, "-fixed"), fixed), className),
|
|
10440
10478
|
style
|
|
10441
10479
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
10442
|
-
className: "".concat(classPrefix2, "-wrap")
|
|
10480
|
+
className: "".concat(classPrefix2, "-wrap ").concat(sizeCls)
|
|
10443
10481
|
}, /* @__PURE__ */ React.createElement(TabbarContext.Provider, {
|
|
10444
10482
|
value: {
|
|
10445
10483
|
selectIndex,
|
|
@@ -10448,12 +10486,12 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10448
10486
|
handleClick: setSelectIndex
|
|
10449
10487
|
}
|
|
10450
10488
|
}, React.Children.map(children, function(child, index2) {
|
|
10451
|
-
|
|
10452
|
-
|
|
10453
|
-
|
|
10454
|
-
}));
|
|
10455
|
-
}))), (fixed || safeArea) && /* @__PURE__ */ React.createElement(
|
|
10456
|
-
|
|
10489
|
+
return /* @__PURE__ */ React.isValidElement(child) ? /* @__PURE__ */ React.cloneElement(child, _object_spread_props(_object_spread({}, child.props), {
|
|
10490
|
+
index: index2,
|
|
10491
|
+
direction: itemDirection
|
|
10492
|
+
})) : null;
|
|
10493
|
+
}))), (fixed || safeArea) && /* @__PURE__ */ React.createElement(SafeArea, {
|
|
10494
|
+
position: "bottom"
|
|
10457
10495
|
}));
|
|
10458
10496
|
};
|
|
10459
10497
|
Tabbar.displayName = "NutTabbar";
|
|
@@ -18434,15 +18472,19 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
18434
18472
|
var defaultProps$M = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
18435
18473
|
disabled: false,
|
|
18436
18474
|
activeText: "",
|
|
18437
|
-
inactiveText: ""
|
|
18475
|
+
inactiveText: "",
|
|
18476
|
+
loadingIcon: /* @__PURE__ */ React.createElement(d$3, null)
|
|
18438
18477
|
});
|
|
18439
18478
|
var Switch = function(props) {
|
|
18440
|
-
var _ref = _object_spread({}, defaultProps$M, props), checked = _ref.checked, defaultChecked = _ref.defaultChecked, disabled = _ref.disabled, activeText = _ref.activeText, inactiveText = _ref.inactiveText,
|
|
18479
|
+
var _ref = _object_spread({}, defaultProps$M, props), checked = _ref.checked, defaultChecked = _ref.defaultChecked, disabled = _ref.disabled, activeText = _ref.activeText, inactiveText = _ref.inactiveText, loadingIcon = _ref.loadingIcon, className = _ref.className, style = _ref.style;
|
|
18480
|
+
_ref.onChange;
|
|
18481
|
+
var rest = _object_without_properties(_ref, [
|
|
18441
18482
|
"checked",
|
|
18442
18483
|
"defaultChecked",
|
|
18443
18484
|
"disabled",
|
|
18444
18485
|
"activeText",
|
|
18445
18486
|
"inactiveText",
|
|
18487
|
+
"loadingIcon",
|
|
18446
18488
|
"className",
|
|
18447
18489
|
"style",
|
|
18448
18490
|
"onChange"
|
|
@@ -18453,6 +18495,12 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
18453
18495
|
value: checked,
|
|
18454
18496
|
defaultValue: defaultChecked
|
|
18455
18497
|
}), 2), value2 = _usePropsValue[0], setValue = _usePropsValue[1];
|
|
18498
|
+
React.useEffect(function() {
|
|
18499
|
+
changing && setChanging(false);
|
|
18500
|
+
}, [
|
|
18501
|
+
value2
|
|
18502
|
+
]);
|
|
18503
|
+
var _useState = _sliced_to_array(React.useState(false), 2), changing = _useState[0], setChanging = _useState[1];
|
|
18456
18504
|
var classes = function() {
|
|
18457
18505
|
var _obj2;
|
|
18458
18506
|
return classNames([
|
|
@@ -18461,17 +18509,18 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
18461
18509
|
(_obj2 = {}, _define_property(_obj2, "".concat(classPrefix2, "-close"), !value2), _define_property(_obj2, "".concat(classPrefix2, "-disabled"), disabled), _define_property(_obj2, "".concat(classPrefix2, "-disabled-close"), disabled && !value2), _obj2)
|
|
18462
18510
|
]);
|
|
18463
18511
|
};
|
|
18464
|
-
var onClick = function(
|
|
18465
|
-
if (disabled) return;
|
|
18466
|
-
|
|
18512
|
+
var onClick = function() {
|
|
18513
|
+
if (disabled || changing) return;
|
|
18514
|
+
if (props.onChange) {
|
|
18515
|
+
setChanging(true);
|
|
18516
|
+
props.onChange(!value2);
|
|
18517
|
+
}
|
|
18467
18518
|
setValue(!value2);
|
|
18468
18519
|
};
|
|
18469
18520
|
var _obj, _obj1;
|
|
18470
18521
|
return /* @__PURE__ */ React.createElement("div", _object_spread({
|
|
18471
18522
|
className: classes(),
|
|
18472
|
-
onClick
|
|
18473
|
-
return onClick(e2);
|
|
18474
|
-
},
|
|
18523
|
+
onClick,
|
|
18475
18524
|
style
|
|
18476
18525
|
}, rest), /* @__PURE__ */ React.createElement("div", {
|
|
18477
18526
|
className: classNames([
|
|
@@ -18483,9 +18532,9 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
18483
18532
|
],
|
|
18484
18533
|
(_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-button-open-rtl"), rtl && value2), _define_property(_obj, "".concat(classPrefix2, "-button-close-rtl"), rtl && !value2), _obj)
|
|
18485
18534
|
])
|
|
18486
|
-
}, !value2 && !activeText && /* @__PURE__ */ React.createElement("div", {
|
|
18535
|
+
}, changing && loadingIcon ? /* @__PURE__ */ React.createElement(React.Fragment, null, loadingIcon) : /* @__PURE__ */ React.createElement(React.Fragment, null, !value2 && !activeText && /* @__PURE__ */ React.createElement("div", {
|
|
18487
18536
|
className: "".concat(classPrefix2, "-close-line")
|
|
18488
|
-
})), activeText && /* @__PURE__ */ React.createElement("div", {
|
|
18537
|
+
}))), activeText && /* @__PURE__ */ React.createElement("div", {
|
|
18489
18538
|
className: classNames("".concat(classPrefix2, "-label"), (_obj1 = {}, _define_property(_obj1, "".concat(classPrefix2, "-label-open"), value2), _define_property(_obj1, "".concat(classPrefix2, "-label-close"), !value2), _define_property(_obj1, "".concat(classPrefix2, "-label-open-rtl"), rtl && value2), _define_property(_obj1, "".concat(classPrefix2, "-label-close-rtl"), rtl && !value2), _define_property(_obj1, "".concat(classPrefix2, "-label-close-disabled"), disabled && !value2), _obj1))
|
|
18490
18539
|
}, value2 ? activeText : inactiveText));
|
|
18491
18540
|
};
|
|
@@ -37366,6 +37415,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37366
37415
|
{
|
|
37367
37416
|
key: "close",
|
|
37368
37417
|
value: function close() {
|
|
37418
|
+
var _this_props;
|
|
37369
37419
|
this.setState({
|
|
37370
37420
|
show: false
|
|
37371
37421
|
});
|
|
@@ -37374,7 +37424,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37374
37424
|
var element = document.getElementById(this.props.id);
|
|
37375
37425
|
element && element.parentNode && element.parentNode.removeChild(element);
|
|
37376
37426
|
}
|
|
37377
|
-
this.props.onClose();
|
|
37427
|
+
(_this_props = this.props) === null || _this_props === void 0 ? void 0 : _this_props.onClose();
|
|
37378
37428
|
}
|
|
37379
37429
|
},
|
|
37380
37430
|
{
|
|
@@ -37419,22 +37469,40 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37419
37469
|
{
|
|
37420
37470
|
key: "render",
|
|
37421
37471
|
value: function render2() {
|
|
37422
|
-
var _this_props = this.props, style = _this_props.style, message = _this_props.message,
|
|
37472
|
+
var _this_props = this.props, id = _this_props.id, style = _this_props.style, message = _this_props.message, leftIcon = _this_props.leftIcon, rightIcon = _this_props.rightIcon, closeable = _this_props.closeable, className = _this_props.className, position2 = _this_props.position, distance = _this_props.distance, navHeight = _this_props.navHeight;
|
|
37423
37473
|
var show2 = this.state.show;
|
|
37474
|
+
var classes = classNames(classPrefix$c, className);
|
|
37475
|
+
var getDistance = function() {
|
|
37476
|
+
if (position2 === "top") {
|
|
37477
|
+
return {
|
|
37478
|
+
top: "".concat(distance + navHeight, "px")
|
|
37479
|
+
};
|
|
37480
|
+
}
|
|
37481
|
+
return {
|
|
37482
|
+
bottom: "".concat(distance, "px")
|
|
37483
|
+
};
|
|
37484
|
+
};
|
|
37424
37485
|
var _obj;
|
|
37425
|
-
var classes = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix$c, "-popup-top"), position2 === "top"), _define_property(_obj, "".concat(classPrefix$c, "-popup-bottom"), position2 === "bottom"), _define_property(_obj, "".concat(classPrefix$c), true), _define_property(_obj, "".concat(classPrefix$c, "-").concat(type2), true), _obj));
|
|
37426
37486
|
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(CSSTransition, {
|
|
37427
37487
|
in: show2,
|
|
37428
37488
|
timeout: 300,
|
|
37429
37489
|
classNames: "fade",
|
|
37430
37490
|
unmountOnExit: true,
|
|
37431
37491
|
appear: true,
|
|
37432
|
-
position: position2
|
|
37492
|
+
position: position2,
|
|
37493
|
+
id
|
|
37433
37494
|
}, /* @__PURE__ */ React__namespace.createElement("div", {
|
|
37434
|
-
className:
|
|
37435
|
-
style,
|
|
37495
|
+
className: classes,
|
|
37496
|
+
style: _object_spread({}, style, getDistance()),
|
|
37436
37497
|
onClick: this.clickCover
|
|
37437
|
-
},
|
|
37498
|
+
}, leftIcon ? /* @__PURE__ */ React__namespace.createElement("div", {
|
|
37499
|
+
className: "".concat(classPrefix$c, "-left-icon")
|
|
37500
|
+
}, leftIcon) : null, /* @__PURE__ */ React__namespace.createElement("div", {
|
|
37501
|
+
className: classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix$c, "-content"), true), _define_property(_obj, "".concat(classPrefix$c, "-ellipsis"), closeable || rightIcon), _define_property(_obj, "".concat(classPrefix$c, "-layout-left"), leftIcon || rightIcon), _obj))
|
|
37502
|
+
}, message), rightIcon || closeable ? /* @__PURE__ */ React__namespace.createElement("div", {
|
|
37503
|
+
className: "".concat(classPrefix$c, "-right-icon"),
|
|
37504
|
+
onClick: this.close
|
|
37505
|
+
}, rightIcon || (closeable ? /* @__PURE__ */ React__namespace.createElement(n$6, null) : null)) : null)));
|
|
37438
37506
|
}
|
|
37439
37507
|
}
|
|
37440
37508
|
]);
|
|
@@ -37470,9 +37538,13 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37470
37538
|
var messageInstance$1 = null;
|
|
37471
37539
|
var options = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
37472
37540
|
id: "",
|
|
37473
|
-
duration: 3e3,
|
|
37474
|
-
type: "danger",
|
|
37475
37541
|
position: "top",
|
|
37542
|
+
distance: 8,
|
|
37543
|
+
navHeight: 57,
|
|
37544
|
+
closeable: false,
|
|
37545
|
+
leftIcon: null,
|
|
37546
|
+
rightIcon: null,
|
|
37547
|
+
duration: 3e3,
|
|
37476
37548
|
onClose: function() {
|
|
37477
37549
|
},
|
|
37478
37550
|
onClick: function() {
|
|
@@ -37507,38 +37579,6 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37507
37579
|
type: "base"
|
|
37508
37580
|
}, option));
|
|
37509
37581
|
},
|
|
37510
|
-
success: function success(message) {
|
|
37511
|
-
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
37512
|
-
errorMsg$1(message);
|
|
37513
|
-
return notice$1(_object_spread({
|
|
37514
|
-
message,
|
|
37515
|
-
type: "success"
|
|
37516
|
-
}, option));
|
|
37517
|
-
},
|
|
37518
|
-
primary: function primary(message) {
|
|
37519
|
-
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
37520
|
-
errorMsg$1(message);
|
|
37521
|
-
return notice$1(_object_spread({
|
|
37522
|
-
message,
|
|
37523
|
-
type: "primary"
|
|
37524
|
-
}, option));
|
|
37525
|
-
},
|
|
37526
|
-
danger: function danger(message) {
|
|
37527
|
-
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
37528
|
-
errorMsg$1(message);
|
|
37529
|
-
return notice$1(_object_spread({
|
|
37530
|
-
message,
|
|
37531
|
-
type: "danger"
|
|
37532
|
-
}, option));
|
|
37533
|
-
},
|
|
37534
|
-
warn: function warn(message) {
|
|
37535
|
-
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
37536
|
-
errorMsg$1(message);
|
|
37537
|
-
return notice$1(_object_spread({
|
|
37538
|
-
message,
|
|
37539
|
-
type: "warning"
|
|
37540
|
-
}, option));
|
|
37541
|
-
},
|
|
37542
37582
|
hide: function hide() {
|
|
37543
37583
|
if (messageInstance$1) {
|
|
37544
37584
|
messageInstance$1.destroy();
|
|
@@ -38141,212 +38181,83 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38141
38181
|
})) : null, children);
|
|
38142
38182
|
};
|
|
38143
38183
|
ResultPage.displayName = "NutResultPage";
|
|
38144
|
-
var AvatarContext = React.createContext({});
|
|
38145
38184
|
var defaultProps$y = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
38146
|
-
maxContent: "",
|
|
38147
|
-
max: "",
|
|
38148
|
-
maxBackground: "#eee",
|
|
38149
|
-
maxColor: "#666",
|
|
38150
|
-
gap: "-8",
|
|
38151
|
-
level: "left"
|
|
38152
|
-
});
|
|
38153
|
-
var classPrefix$a = "nut-avatar-group";
|
|
38154
|
-
var AvatarGroup = function(props) {
|
|
38155
|
-
var propAvatarGroup = _object_spread({}, defaultProps$y, props);
|
|
38156
|
-
var className = propAvatarGroup.className, style = propAvatarGroup.style, children = propAvatarGroup.children;
|
|
38157
|
-
var avatarGroupRef = React.useRef(null);
|
|
38158
|
-
var cls = classNames(classPrefix$a, className);
|
|
38159
|
-
var parentAvatar = {
|
|
38160
|
-
propAvatarGroup,
|
|
38161
|
-
avatarGroupRef
|
|
38162
|
-
};
|
|
38163
|
-
return /* @__PURE__ */ React.createElement(AvatarContext.Provider, {
|
|
38164
|
-
value: parentAvatar
|
|
38165
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
38166
|
-
className: cls,
|
|
38167
|
-
style,
|
|
38168
|
-
ref: avatarGroupRef
|
|
38169
|
-
}, children));
|
|
38170
|
-
};
|
|
38171
|
-
AvatarGroup.displayName = "NutAvatarGroup";
|
|
38172
|
-
var defaultProps$x = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
38173
|
-
size: "",
|
|
38174
|
-
shape: "round",
|
|
38175
|
-
icon: "",
|
|
38176
|
-
background: "#eee",
|
|
38177
|
-
color: "#666",
|
|
38178
|
-
fit: "cover",
|
|
38179
|
-
src: "",
|
|
38180
|
-
alt: ""
|
|
38181
|
-
});
|
|
38182
|
-
var classPrefix$9 = "nut-avatar";
|
|
38183
|
-
var Avatar = function(props) {
|
|
38184
|
-
var _ref = _object_spread({}, defaultProps$x, props), children = _ref.children, size = _ref.size, shape = _ref.shape, background = _ref.background, color = _ref.color, src = _ref.src, alt = _ref.alt, icon = _ref.icon, fit = _ref.fit, className = _ref.className, style = _ref.style, onClick = _ref.onClick, onError = _ref.onError, rest = _object_without_properties(_ref, [
|
|
38185
|
-
"children",
|
|
38186
|
-
"size",
|
|
38187
|
-
"shape",
|
|
38188
|
-
"background",
|
|
38189
|
-
"color",
|
|
38190
|
-
"src",
|
|
38191
|
-
"alt",
|
|
38192
|
-
"icon",
|
|
38193
|
-
"fit",
|
|
38194
|
-
"className",
|
|
38195
|
-
"style",
|
|
38196
|
-
"onClick",
|
|
38197
|
-
"onError"
|
|
38198
|
-
]);
|
|
38199
|
-
var _useState = _sliced_to_array(React.useState(0), 2), maxSum = _useState[0], setMaxSum = _useState[1];
|
|
38200
|
-
var _useState1 = _sliced_to_array(React.useState(false), 2), showMax = _useState1[0], setShowMax = _useState1[1];
|
|
38201
|
-
var _useState2 = _sliced_to_array(React.useState(1), 2), avatarIndex = _useState2[0], setAvatarIndex = _useState2[1];
|
|
38202
|
-
var avatarRef = React.useRef(null);
|
|
38203
|
-
var parent2 = React.useContext(AvatarContext);
|
|
38204
|
-
var sizeValue = [
|
|
38205
|
-
"large",
|
|
38206
|
-
"normal",
|
|
38207
|
-
"small"
|
|
38208
|
-
];
|
|
38209
|
-
var propAvatarGroup = parent2.propAvatarGroup, avatarGroupRef = parent2.avatarGroupRef;
|
|
38210
|
-
var _obj;
|
|
38211
|
-
var classes = classNames((_obj = {}, _define_property(_obj, "nut-avatar-".concat((propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.size) || size || "normal"), true), _define_property(_obj, "nut-avatar-".concat((propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.shape) || shape), true), _define_property(_obj, "nut-avatar-".concat((propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.size) || size || "normal", "-round"), shape === "round" && true), _obj));
|
|
38212
|
-
var cls = classNames(classPrefix$9, classes, className);
|
|
38213
|
-
var styles = _object_spread({
|
|
38214
|
-
width: sizeValue.indexOf(size) > -1 ? "" : "".concat(size, "px"),
|
|
38215
|
-
height: sizeValue.indexOf(size) > -1 ? "" : "".concat(size, "px"),
|
|
38216
|
-
backgroundColor: "".concat(background),
|
|
38217
|
-
color,
|
|
38218
|
-
marginLeft: avatarIndex !== 1 && (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.gap) ? "".concat(propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.gap, "px") : "",
|
|
38219
|
-
zIndex: (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.level) === "right" ? "".concat(Math.abs(maxSum - avatarIndex)) : ""
|
|
38220
|
-
}, style);
|
|
38221
|
-
var maxStyles = {
|
|
38222
|
-
backgroundColor: "".concat(propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.maxBackground),
|
|
38223
|
-
color: "".concat(propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.maxColor)
|
|
38224
|
-
};
|
|
38225
|
-
var avatarLength = React.useCallback(function(children2) {
|
|
38226
|
-
var _avatarRef_current_dataset, _avatarRef_current;
|
|
38227
|
-
for (var i2 = 0; i2 < children2.length; i2++) {
|
|
38228
|
-
if (children2[i2] && children2[i2].classList && children2[i2].classList[0] === "nut-avatar") {
|
|
38229
|
-
children2[i2].setAttribute("data-index", i2 + 1);
|
|
38230
|
-
}
|
|
38231
|
-
}
|
|
38232
|
-
var index2 = Number(avatarRef === null || avatarRef === void 0 ? void 0 : (_avatarRef_current = avatarRef.current) === null || _avatarRef_current === void 0 ? void 0 : (_avatarRef_current_dataset = _avatarRef_current.dataset) === null || _avatarRef_current_dataset === void 0 ? void 0 : _avatarRef_current_dataset.index);
|
|
38233
|
-
var maxCount = (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.max) || children2.length;
|
|
38234
|
-
setMaxSum(children2.length);
|
|
38235
|
-
setAvatarIndex(index2);
|
|
38236
|
-
if (index2 === children2.length && index2 !== maxCount && children2.length > maxCount) {
|
|
38237
|
-
setShowMax(true);
|
|
38238
|
-
}
|
|
38239
|
-
}, [
|
|
38240
|
-
propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.max
|
|
38241
|
-
]);
|
|
38242
|
-
React.useEffect(function() {
|
|
38243
|
-
var avatarChildren = avatarGroupRef === null || avatarGroupRef === void 0 ? void 0 : avatarGroupRef.current.children;
|
|
38244
|
-
if (avatarChildren) {
|
|
38245
|
-
avatarLength(avatarChildren);
|
|
38246
|
-
}
|
|
38247
|
-
}, [
|
|
38248
|
-
avatarLength,
|
|
38249
|
-
avatarGroupRef
|
|
38250
|
-
]);
|
|
38251
|
-
var errorEvent = function() {
|
|
38252
|
-
onError && onError();
|
|
38253
|
-
};
|
|
38254
|
-
var clickAvatar = function(e2) {
|
|
38255
|
-
onClick && onClick(e2);
|
|
38256
|
-
};
|
|
38257
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, (showMax || !(propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.max) || avatarIndex <= (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.max)) && /* @__PURE__ */ React.createElement("div", _object_spread_props(_object_spread({
|
|
38258
|
-
className: cls
|
|
38259
|
-
}, rest), {
|
|
38260
|
-
style: !showMax ? styles : maxStyles,
|
|
38261
|
-
onClick: clickAvatar,
|
|
38262
|
-
ref: avatarRef
|
|
38263
|
-
}), (!(propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.max) || avatarIndex <= (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.max)) && /* @__PURE__ */ React.createElement(React.Fragment, null, src && /* @__PURE__ */ React.createElement(Image$1, {
|
|
38264
|
-
className: "nut-avatar-img",
|
|
38265
|
-
src,
|
|
38266
|
-
alt,
|
|
38267
|
-
style: {
|
|
38268
|
-
objectFit: fit
|
|
38269
|
-
},
|
|
38270
|
-
onError: errorEvent
|
|
38271
|
-
}), /* @__PURE__ */ React.isValidElement(icon) ? /* @__PURE__ */ React.cloneElement(icon, _object_spread_props(_object_spread({}, icon.props), {
|
|
38272
|
-
className: "".concat(icon.props.className || "", " nut-avatar-icon")
|
|
38273
|
-
})) : null, children && /* @__PURE__ */ React.createElement("span", {
|
|
38274
|
-
className: "nut-avatar-text"
|
|
38275
|
-
}, children), !src && !icon && !children && /* @__PURE__ */ React.createElement(m, {
|
|
38276
|
-
className: "nut-avatar-icon"
|
|
38277
|
-
})), showMax && /* @__PURE__ */ React.createElement("div", {
|
|
38278
|
-
className: "nut-avatar-text"
|
|
38279
|
-
}, (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.maxContent) ? propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.maxContent : "+ ".concat(avatarIndex - Number((propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.max) || 0)))));
|
|
38280
|
-
};
|
|
38281
|
-
Avatar.displayName = "NutAvatar";
|
|
38282
|
-
Avatar.Group = AvatarGroup;
|
|
38283
|
-
var defaultProps$w = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
38284
38185
|
rows: 1,
|
|
38285
|
-
animated:
|
|
38286
|
-
title: false,
|
|
38287
|
-
avatar: false,
|
|
38288
|
-
avatarSize: "50px",
|
|
38186
|
+
animated: true,
|
|
38289
38187
|
visible: false,
|
|
38290
|
-
|
|
38188
|
+
size: "normal",
|
|
38189
|
+
shape: "round",
|
|
38190
|
+
duration: 0.6,
|
|
38191
|
+
inline: false
|
|
38291
38192
|
});
|
|
38292
38193
|
var Skeleton = function(props) {
|
|
38293
|
-
var
|
|
38194
|
+
var shapeStyle = function shapeStyle2() {
|
|
38195
|
+
if (shape === "circle") return {
|
|
38196
|
+
borderRadius: "50%"
|
|
38197
|
+
};
|
|
38198
|
+
if (shape === "square") return {
|
|
38199
|
+
borderRadius: "0"
|
|
38200
|
+
};
|
|
38201
|
+
return {};
|
|
38202
|
+
};
|
|
38203
|
+
var durationStyle = function durationStyle2() {
|
|
38204
|
+
if (typeof duration !== "undefined") return {
|
|
38205
|
+
animationDuration: "".concat(duration, "s")
|
|
38206
|
+
};
|
|
38207
|
+
return {};
|
|
38208
|
+
};
|
|
38209
|
+
var _ref = _object_spread({}, defaultProps$y, props), className = _ref.className, width2 = _ref.width, height2 = _ref.height, shape = _ref.shape, animated2 = _ref.animated, rows = _ref.rows, visible = _ref.visible, size = _ref.size, duration = _ref.duration, children = _ref.children, rest = _object_without_properties(_ref, [
|
|
38294
38210
|
"className",
|
|
38211
|
+
"width",
|
|
38212
|
+
"height",
|
|
38213
|
+
"shape",
|
|
38295
38214
|
"animated",
|
|
38296
38215
|
"rows",
|
|
38297
|
-
"title",
|
|
38298
|
-
"avatar",
|
|
38299
|
-
"avatarSize",
|
|
38300
38216
|
"visible",
|
|
38301
|
-
"
|
|
38302
|
-
"
|
|
38217
|
+
"size",
|
|
38218
|
+
"duration",
|
|
38219
|
+
"children"
|
|
38303
38220
|
]);
|
|
38304
38221
|
var classPrefix2 = "nut-skeleton";
|
|
38305
38222
|
var classes = classNames(classPrefix2, className);
|
|
38306
|
-
var
|
|
38307
|
-
var avatarClass = classNames((_obj = {}, _define_property(_obj, "nut-avatar", true), _define_property(_obj, "nut-skeleton-content-avatar", true), _define_property(_obj, "avatar-".concat(avatarShape), avatarShape), _obj));
|
|
38308
|
-
var repeatLines = function(num) {
|
|
38223
|
+
var repeatCount = function(num) {
|
|
38309
38224
|
return Array.from({
|
|
38310
38225
|
length: num
|
|
38311
38226
|
}, function(v, i2) {
|
|
38312
38227
|
return i2;
|
|
38313
38228
|
});
|
|
38314
38229
|
};
|
|
38315
|
-
var
|
|
38316
|
-
|
|
38317
|
-
|
|
38318
|
-
|
|
38319
|
-
|
|
38320
|
-
|
|
38321
|
-
}
|
|
38322
|
-
return {
|
|
38323
|
-
width: "50px",
|
|
38324
|
-
height: "50px"
|
|
38325
|
-
};
|
|
38230
|
+
var _useState = _sliced_to_array(React.useState(false), 2), animate = _useState[0], setAnimate = _useState[1];
|
|
38231
|
+
var playAnimation = function() {
|
|
38232
|
+
setAnimate(false);
|
|
38233
|
+
setTimeout(function() {
|
|
38234
|
+
setAnimate(true);
|
|
38235
|
+
}, 10);
|
|
38326
38236
|
};
|
|
38327
|
-
|
|
38237
|
+
React.useEffect(function() {
|
|
38238
|
+
if (!animated2) return;
|
|
38239
|
+
playAnimation();
|
|
38240
|
+
var intervalId = setInterval(playAnimation, 1e3 + duration * 1e3);
|
|
38241
|
+
return function() {
|
|
38242
|
+
return clearInterval(intervalId);
|
|
38243
|
+
};
|
|
38244
|
+
}, []);
|
|
38245
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, visible ? children : /* @__PURE__ */ React.createElement("div", _object_spread({
|
|
38328
38246
|
className: classes
|
|
38329
|
-
}, rest),
|
|
38330
|
-
|
|
38331
|
-
}), /* @__PURE__ */ React.createElement("div", {
|
|
38332
|
-
className: "".concat(classPrefix2, "-content")
|
|
38333
|
-
}, avatar && /* @__PURE__ */ React.createElement(Avatar, {
|
|
38334
|
-
className: avatarClass,
|
|
38335
|
-
shape: avatarShape,
|
|
38336
|
-
style: getStyle(),
|
|
38337
|
-
icon: "null"
|
|
38338
|
-
}), rows === 1 ? /* @__PURE__ */ React.createElement("div", {
|
|
38339
|
-
className: "".concat(classPrefix2, "-content-block")
|
|
38340
|
-
}) : /* @__PURE__ */ React.createElement("div", {
|
|
38341
|
-
className: "".concat(classPrefix2, "-content-line")
|
|
38342
|
-
}, title && /* @__PURE__ */ React.createElement("div", {
|
|
38343
|
-
className: "".concat(classPrefix2, "-content-title")
|
|
38344
|
-
}), repeatLines(rows).map(function(item, index2) {
|
|
38247
|
+
}, rest), repeatCount(rows).map(function(item, index2) {
|
|
38248
|
+
var contentClass = "".concat(classPrefix2, "-content ").concat(classPrefix2, "-content-").concat(size, " ").concat(classPrefix2, "-content-").concat(size, "-").concat(index2);
|
|
38345
38249
|
return /* @__PURE__ */ React.createElement("div", {
|
|
38346
|
-
className: "".concat(
|
|
38347
|
-
key: index2
|
|
38348
|
-
|
|
38349
|
-
|
|
38250
|
+
className: "".concat(contentClass),
|
|
38251
|
+
key: index2,
|
|
38252
|
+
style: _object_spread({
|
|
38253
|
+
width: width2,
|
|
38254
|
+
height: height2
|
|
38255
|
+
}, shapeStyle())
|
|
38256
|
+
}, animated2 && /* @__PURE__ */ React.createElement("div", {
|
|
38257
|
+
className: "".concat(classPrefix2, "-animated ").concat(animate ? "".concat(classPrefix2, "-animation") : ""),
|
|
38258
|
+
style: durationStyle()
|
|
38259
|
+
}));
|
|
38260
|
+
})));
|
|
38350
38261
|
};
|
|
38351
38262
|
Skeleton.displayName = "NutSkeleton";
|
|
38352
38263
|
function preventDefault(event, isStopPropagation) {
|
|
@@ -38357,13 +38268,13 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38357
38268
|
event.stopPropagation();
|
|
38358
38269
|
}
|
|
38359
38270
|
}
|
|
38360
|
-
var defaultProps$
|
|
38271
|
+
var defaultProps$x = {
|
|
38361
38272
|
name: ""
|
|
38362
38273
|
};
|
|
38363
38274
|
var Swipe = /* @__PURE__ */ React.forwardRef(function(props, instanceRef) {
|
|
38364
38275
|
var classPrefix2 = "nut-swipe";
|
|
38365
38276
|
var touch = useTouch();
|
|
38366
|
-
var _$_object_spread = _object_spread({}, defaultProps$
|
|
38277
|
+
var _$_object_spread = _object_spread({}, defaultProps$x, props), children = _$_object_spread.children, className = _$_object_spread.className, style = _$_object_spread.style;
|
|
38367
38278
|
var root2 = React.useRef();
|
|
38368
38279
|
var opened = React.useRef(false);
|
|
38369
38280
|
var lockClick = React.useRef(false);
|
|
@@ -38563,7 +38474,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38563
38474
|
}, renderActionContent("left", leftRef), children, renderActionContent("right", rightRef)));
|
|
38564
38475
|
});
|
|
38565
38476
|
Swipe.displayName = "NutSwipe";
|
|
38566
|
-
var classPrefix$
|
|
38477
|
+
var classPrefix$a = "nut-toast";
|
|
38567
38478
|
var Notification = /* @__PURE__ */ function(_superClass) {
|
|
38568
38479
|
_inherits(Notification2, _superClass);
|
|
38569
38480
|
function Notification2(props) {
|
|
@@ -38640,7 +38551,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38640
38551
|
})
|
|
38641
38552
|
}[icon];
|
|
38642
38553
|
return /* @__PURE__ */ React__namespace.createElement("p", {
|
|
38643
|
-
className: "".concat(classPrefix$
|
|
38554
|
+
className: "".concat(classPrefix$a, "-icon-wrapper")
|
|
38644
38555
|
}, iconNode);
|
|
38645
38556
|
}
|
|
38646
38557
|
return icon;
|
|
@@ -38671,22 +38582,22 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38671
38582
|
visible: show2,
|
|
38672
38583
|
style,
|
|
38673
38584
|
zIndex,
|
|
38674
|
-
className: "".concat(classPrefix$
|
|
38585
|
+
className: "".concat(classPrefix$a, "-overlay-default ").concat(className),
|
|
38675
38586
|
onClick: function() {
|
|
38676
38587
|
return _this.clickCover();
|
|
38677
38588
|
},
|
|
38678
38589
|
closeOnOverlayClick,
|
|
38679
38590
|
lockScroll
|
|
38680
38591
|
}, /* @__PURE__ */ React__namespace.createElement("div", {
|
|
38681
|
-
className: "".concat(classPrefix$
|
|
38592
|
+
className: "".concat(classPrefix$a, " ").concat(classes),
|
|
38682
38593
|
id: "toast-".concat(id)
|
|
38683
38594
|
}, /* @__PURE__ */ React__namespace.createElement("div", {
|
|
38684
|
-
className: classNames("".concat(classPrefix$
|
|
38595
|
+
className: classNames("".concat(classPrefix$a, "-inner"), "".concat(classPrefix$a, "-").concat(position2), contentClassName, "".concat(classPrefix$a, "-inner-").concat(size), "".concat(classPrefix$a, "-inner-").concat(wordBreak), _define_property({}, "".concat(classPrefix$a, "-inner-descrption"), content2)),
|
|
38685
38596
|
style: _object_spread({}, contentStyle)
|
|
38686
38597
|
}, this.renderIcon(), title && /* @__PURE__ */ React__namespace.createElement("div", {
|
|
38687
|
-
className: "".concat(classPrefix$
|
|
38598
|
+
className: "".concat(classPrefix$a, "-title")
|
|
38688
38599
|
}, title), content2 && /* @__PURE__ */ React__namespace.createElement("span", {
|
|
38689
|
-
className: "".concat(classPrefix$
|
|
38600
|
+
className: "".concat(classPrefix$a, "-text")
|
|
38690
38601
|
}, content2))));
|
|
38691
38602
|
}
|
|
38692
38603
|
}
|
|
@@ -38719,7 +38630,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38719
38630
|
})), element);
|
|
38720
38631
|
};
|
|
38721
38632
|
var messageInstance = null;
|
|
38722
|
-
var defaultProps$
|
|
38633
|
+
var defaultProps$w = _object_spread_props(_object_spread({}, defaultOverlayProps), {
|
|
38723
38634
|
id: "",
|
|
38724
38635
|
position: "middle",
|
|
38725
38636
|
title: "",
|
|
@@ -38753,7 +38664,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38753
38664
|
opts2.onClose && opts2.onClose();
|
|
38754
38665
|
}
|
|
38755
38666
|
}
|
|
38756
|
-
var opts22 = _object_spread_props(_object_spread({}, defaultProps$
|
|
38667
|
+
var opts22 = _object_spread_props(_object_spread({}, defaultProps$w, opts2), {
|
|
38757
38668
|
onClose: close
|
|
38758
38669
|
});
|
|
38759
38670
|
getInstance(opts22, function(notification) {
|
|
@@ -38776,7 +38687,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38776
38687
|
return notice(_object_spread({}, option));
|
|
38777
38688
|
}
|
|
38778
38689
|
function config(config2) {
|
|
38779
|
-
defaultProps$
|
|
38690
|
+
defaultProps$w = _object_spread({}, defaultProps$w, config2);
|
|
38780
38691
|
}
|
|
38781
38692
|
const Toast = {
|
|
38782
38693
|
show,
|
|
@@ -38788,16 +38699,16 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38788
38699
|
}
|
|
38789
38700
|
}
|
|
38790
38701
|
};
|
|
38791
|
-
var defaultProps$
|
|
38702
|
+
var defaultProps$v = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
38792
38703
|
type: "shake",
|
|
38793
38704
|
action: "initial",
|
|
38794
38705
|
loop: false,
|
|
38795
38706
|
onClick: function(event) {
|
|
38796
38707
|
}
|
|
38797
38708
|
});
|
|
38798
|
-
var classPrefix$
|
|
38709
|
+
var classPrefix$9 = "nut-animate";
|
|
38799
38710
|
var Animate = function(props) {
|
|
38800
|
-
var _ref = _object_spread({}, defaultProps$
|
|
38711
|
+
var _ref = _object_spread({}, defaultProps$v, props), className = _ref.className, type2 = _ref.type, action = _ref.action, loop2 = _ref.loop, onClick = _ref.onClick, children = _ref.children, rest = _object_without_properties(_ref, [
|
|
38801
38712
|
"className",
|
|
38802
38713
|
"type",
|
|
38803
38714
|
"action",
|
|
@@ -38809,7 +38720,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38809
38720
|
var _obj;
|
|
38810
38721
|
var classes = classNames((_obj = {
|
|
38811
38722
|
"nut-ani-container": true
|
|
38812
|
-
}, _define_property(_obj, "".concat(classPrefix$
|
|
38723
|
+
}, _define_property(_obj, "".concat(classPrefix$9, "-").concat(type2), action === "initial" || clicked), _define_property(_obj, "loop", loop2), _obj), className);
|
|
38813
38724
|
var handleClick = function(event) {
|
|
38814
38725
|
setClicked(true);
|
|
38815
38726
|
if (!loop2) {
|
|
@@ -38827,7 +38738,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38827
38738
|
}, rest), children));
|
|
38828
38739
|
};
|
|
38829
38740
|
Animate.displayName = "NutAnimate";
|
|
38830
|
-
var defaultProps$
|
|
38741
|
+
var defaultProps$u = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
38831
38742
|
length: 0,
|
|
38832
38743
|
value: "",
|
|
38833
38744
|
delay: 300,
|
|
@@ -38835,7 +38746,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38835
38746
|
thousands: false
|
|
38836
38747
|
});
|
|
38837
38748
|
var CountUp = function(props) {
|
|
38838
|
-
var _mergeProps = mergeProps(defaultProps$
|
|
38749
|
+
var _mergeProps = mergeProps(defaultProps$u, props), length2 = _mergeProps.length, value2 = _mergeProps.value, delay = _mergeProps.delay, duration = _mergeProps.duration, className = _mergeProps.className, thousands = _mergeProps.thousands;
|
|
38839
38750
|
_mergeProps.style;
|
|
38840
38751
|
_object_without_properties(_mergeProps, [
|
|
38841
38752
|
"length",
|
|
@@ -38922,7 +38833,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38922
38833
|
})));
|
|
38923
38834
|
};
|
|
38924
38835
|
CountUp.displayName = "NutCountUp";
|
|
38925
|
-
var defaultProps$
|
|
38836
|
+
var defaultProps$t = {};
|
|
38926
38837
|
var AnimatingNumbers = /* @__PURE__ */ function(Component) {
|
|
38927
38838
|
_inherits(AnimatingNumbers2, Component);
|
|
38928
38839
|
function AnimatingNumbers2(props) {
|
|
@@ -38946,11 +38857,11 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38946
38857
|
]);
|
|
38947
38858
|
return AnimatingNumbers2;
|
|
38948
38859
|
}(React.Component);
|
|
38949
|
-
_define_property(AnimatingNumbers, "defaultProps", defaultProps$
|
|
38860
|
+
_define_property(AnimatingNumbers, "defaultProps", defaultProps$t);
|
|
38950
38861
|
_define_property(AnimatingNumbers, "displayName", "NutAnimatingNumbers");
|
|
38951
38862
|
_define_property(AnimatingNumbers, "CountUp", CountUp);
|
|
38952
38863
|
AnimatingNumbers.CountUp = CountUp;
|
|
38953
|
-
var defaultProps$
|
|
38864
|
+
var defaultProps$s = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
38954
38865
|
src: "",
|
|
38955
38866
|
muted: false,
|
|
38956
38867
|
autoPlay: false,
|
|
@@ -38980,7 +38891,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38980
38891
|
}
|
|
38981
38892
|
};
|
|
38982
38893
|
var locale = useConfig().locale;
|
|
38983
|
-
var _ref = _object_spread({}, defaultProps$
|
|
38894
|
+
var _ref = _object_spread({}, defaultProps$s, props), className = _ref.className, src = _ref.src, style = _ref.style, muted = _ref.muted, autoPlay = _ref.autoPlay, loop2 = _ref.loop, preload = _ref.preload, type2 = _ref.type, onBack = _ref.onBack, onForward = _ref.onForward, onPause = _ref.onPause, onEnd = _ref.onEnd, onMute = _ref.onMute, onCanPlay = _ref.onCanPlay, children = _ref.children, rest = _object_without_properties(_ref, [
|
|
38984
38895
|
"className",
|
|
38985
38896
|
"src",
|
|
38986
38897
|
"style",
|
|
@@ -39188,6 +39099,145 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
39188
39099
|
})));
|
|
39189
39100
|
};
|
|
39190
39101
|
Audio.displayName = "NutAudio";
|
|
39102
|
+
var AvatarContext = React.createContext({});
|
|
39103
|
+
var defaultProps$r = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
39104
|
+
maxContent: "",
|
|
39105
|
+
max: "",
|
|
39106
|
+
maxBackground: "#eee",
|
|
39107
|
+
maxColor: "#666",
|
|
39108
|
+
gap: "-8",
|
|
39109
|
+
level: "left"
|
|
39110
|
+
});
|
|
39111
|
+
var classPrefix$8 = "nut-avatar-group";
|
|
39112
|
+
var AvatarGroup = function(props) {
|
|
39113
|
+
var propAvatarGroup = _object_spread({}, defaultProps$r, props);
|
|
39114
|
+
var className = propAvatarGroup.className, style = propAvatarGroup.style, children = propAvatarGroup.children;
|
|
39115
|
+
var avatarGroupRef = React.useRef(null);
|
|
39116
|
+
var cls = classNames(classPrefix$8, className);
|
|
39117
|
+
var parentAvatar = {
|
|
39118
|
+
propAvatarGroup,
|
|
39119
|
+
avatarGroupRef
|
|
39120
|
+
};
|
|
39121
|
+
return /* @__PURE__ */ React.createElement(AvatarContext.Provider, {
|
|
39122
|
+
value: parentAvatar
|
|
39123
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
39124
|
+
className: cls,
|
|
39125
|
+
style,
|
|
39126
|
+
ref: avatarGroupRef
|
|
39127
|
+
}, children));
|
|
39128
|
+
};
|
|
39129
|
+
AvatarGroup.displayName = "NutAvatarGroup";
|
|
39130
|
+
var defaultProps$q = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
39131
|
+
size: "",
|
|
39132
|
+
shape: "round",
|
|
39133
|
+
icon: "",
|
|
39134
|
+
background: "#eee",
|
|
39135
|
+
color: "#666",
|
|
39136
|
+
fit: "cover",
|
|
39137
|
+
src: "",
|
|
39138
|
+
alt: ""
|
|
39139
|
+
});
|
|
39140
|
+
var classPrefix$7 = "nut-avatar";
|
|
39141
|
+
var Avatar = function(props) {
|
|
39142
|
+
var _ref = _object_spread({}, defaultProps$q, props), children = _ref.children, size = _ref.size, shape = _ref.shape, background = _ref.background, color = _ref.color, src = _ref.src, alt = _ref.alt, icon = _ref.icon, fit = _ref.fit, className = _ref.className, style = _ref.style, onClick = _ref.onClick, onError = _ref.onError, rest = _object_without_properties(_ref, [
|
|
39143
|
+
"children",
|
|
39144
|
+
"size",
|
|
39145
|
+
"shape",
|
|
39146
|
+
"background",
|
|
39147
|
+
"color",
|
|
39148
|
+
"src",
|
|
39149
|
+
"alt",
|
|
39150
|
+
"icon",
|
|
39151
|
+
"fit",
|
|
39152
|
+
"className",
|
|
39153
|
+
"style",
|
|
39154
|
+
"onClick",
|
|
39155
|
+
"onError"
|
|
39156
|
+
]);
|
|
39157
|
+
var _useState = _sliced_to_array(React.useState(0), 2), maxSum = _useState[0], setMaxSum = _useState[1];
|
|
39158
|
+
var _useState1 = _sliced_to_array(React.useState(false), 2), showMax = _useState1[0], setShowMax = _useState1[1];
|
|
39159
|
+
var _useState2 = _sliced_to_array(React.useState(1), 2), avatarIndex = _useState2[0], setAvatarIndex = _useState2[1];
|
|
39160
|
+
var avatarRef = React.useRef(null);
|
|
39161
|
+
var parent2 = React.useContext(AvatarContext);
|
|
39162
|
+
var sizeValue = [
|
|
39163
|
+
"large",
|
|
39164
|
+
"normal",
|
|
39165
|
+
"small"
|
|
39166
|
+
];
|
|
39167
|
+
var propAvatarGroup = parent2.propAvatarGroup, avatarGroupRef = parent2.avatarGroupRef;
|
|
39168
|
+
var _obj;
|
|
39169
|
+
var classes = classNames((_obj = {}, _define_property(_obj, "nut-avatar-".concat((propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.size) || size || "normal"), true), _define_property(_obj, "nut-avatar-".concat((propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.shape) || shape), true), _define_property(_obj, "nut-avatar-".concat((propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.size) || size || "normal", "-round"), shape === "round" && true), _obj));
|
|
39170
|
+
var cls = classNames(classPrefix$7, classes, className);
|
|
39171
|
+
var styles = _object_spread({
|
|
39172
|
+
width: sizeValue.indexOf(size) > -1 ? "" : "".concat(size, "px"),
|
|
39173
|
+
height: sizeValue.indexOf(size) > -1 ? "" : "".concat(size, "px"),
|
|
39174
|
+
backgroundColor: "".concat(background),
|
|
39175
|
+
color,
|
|
39176
|
+
marginLeft: avatarIndex !== 1 && (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.gap) ? "".concat(propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.gap, "px") : "",
|
|
39177
|
+
zIndex: (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.level) === "right" ? "".concat(Math.abs(maxSum - avatarIndex)) : ""
|
|
39178
|
+
}, style);
|
|
39179
|
+
var maxStyles = {
|
|
39180
|
+
backgroundColor: "".concat(propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.maxBackground),
|
|
39181
|
+
color: "".concat(propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.maxColor)
|
|
39182
|
+
};
|
|
39183
|
+
var avatarLength = React.useCallback(function(children2) {
|
|
39184
|
+
var _avatarRef_current_dataset, _avatarRef_current;
|
|
39185
|
+
for (var i2 = 0; i2 < children2.length; i2++) {
|
|
39186
|
+
if (children2[i2] && children2[i2].classList && children2[i2].classList[0] === "nut-avatar") {
|
|
39187
|
+
children2[i2].setAttribute("data-index", i2 + 1);
|
|
39188
|
+
}
|
|
39189
|
+
}
|
|
39190
|
+
var index2 = Number(avatarRef === null || avatarRef === void 0 ? void 0 : (_avatarRef_current = avatarRef.current) === null || _avatarRef_current === void 0 ? void 0 : (_avatarRef_current_dataset = _avatarRef_current.dataset) === null || _avatarRef_current_dataset === void 0 ? void 0 : _avatarRef_current_dataset.index);
|
|
39191
|
+
var maxCount = (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.max) || children2.length;
|
|
39192
|
+
setMaxSum(children2.length);
|
|
39193
|
+
setAvatarIndex(index2);
|
|
39194
|
+
if (index2 === children2.length && index2 !== maxCount && children2.length > maxCount) {
|
|
39195
|
+
setShowMax(true);
|
|
39196
|
+
}
|
|
39197
|
+
}, [
|
|
39198
|
+
propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.max
|
|
39199
|
+
]);
|
|
39200
|
+
React.useEffect(function() {
|
|
39201
|
+
var avatarChildren = avatarGroupRef === null || avatarGroupRef === void 0 ? void 0 : avatarGroupRef.current.children;
|
|
39202
|
+
if (avatarChildren) {
|
|
39203
|
+
avatarLength(avatarChildren);
|
|
39204
|
+
}
|
|
39205
|
+
}, [
|
|
39206
|
+
avatarLength,
|
|
39207
|
+
avatarGroupRef
|
|
39208
|
+
]);
|
|
39209
|
+
var errorEvent = function() {
|
|
39210
|
+
onError && onError();
|
|
39211
|
+
};
|
|
39212
|
+
var clickAvatar = function(e2) {
|
|
39213
|
+
onClick && onClick(e2);
|
|
39214
|
+
};
|
|
39215
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, (showMax || !(propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.max) || avatarIndex <= (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.max)) && /* @__PURE__ */ React.createElement("div", _object_spread_props(_object_spread({
|
|
39216
|
+
className: cls
|
|
39217
|
+
}, rest), {
|
|
39218
|
+
style: !showMax ? styles : maxStyles,
|
|
39219
|
+
onClick: clickAvatar,
|
|
39220
|
+
ref: avatarRef
|
|
39221
|
+
}), (!(propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.max) || avatarIndex <= (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.max)) && /* @__PURE__ */ React.createElement(React.Fragment, null, src && /* @__PURE__ */ React.createElement(Image$1, {
|
|
39222
|
+
className: "nut-avatar-img",
|
|
39223
|
+
src,
|
|
39224
|
+
alt,
|
|
39225
|
+
style: {
|
|
39226
|
+
objectFit: fit
|
|
39227
|
+
},
|
|
39228
|
+
onError: errorEvent
|
|
39229
|
+
}), /* @__PURE__ */ React.isValidElement(icon) ? /* @__PURE__ */ React.cloneElement(icon, _object_spread_props(_object_spread({}, icon.props), {
|
|
39230
|
+
className: "".concat(icon.props.className || "", " nut-avatar-icon")
|
|
39231
|
+
})) : null, children && /* @__PURE__ */ React.createElement("span", {
|
|
39232
|
+
className: "nut-avatar-text"
|
|
39233
|
+
}, children), !src && !icon && !children && /* @__PURE__ */ React.createElement(m, {
|
|
39234
|
+
className: "nut-avatar-icon"
|
|
39235
|
+
})), showMax && /* @__PURE__ */ React.createElement("div", {
|
|
39236
|
+
className: "nut-avatar-text"
|
|
39237
|
+
}, (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.maxContent) ? propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.maxContent : "+ ".concat(avatarIndex - Number((propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.max) || 0)))));
|
|
39238
|
+
};
|
|
39239
|
+
Avatar.displayName = "NutAvatar";
|
|
39240
|
+
Avatar.Group = AvatarGroup;
|
|
39191
39241
|
var defaultProps$p = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
39192
39242
|
strokeWidth: 5,
|
|
39193
39243
|
radius: 50,
|
|
@@ -39992,7 +40042,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
39992
40042
|
var classPrefix$3 = "nut-indicator";
|
|
39993
40043
|
var Indicator = function(props) {
|
|
39994
40044
|
var maybeFixedWidth = function maybeFixedWidth2() {
|
|
39995
|
-
if (
|
|
40045
|
+
if (type2 === "dualScreen" || type2 === "slide") {
|
|
39996
40046
|
return "".concat(classPrefix$3, "-fixed-width");
|
|
39997
40047
|
}
|
|
39998
40048
|
return "";
|