@nutui/nutui-react 3.0.6 → 3.0.7
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 +34 -15
- package/dist/cjs/packages/actionsheet/style/style.css +4 -4
- package/dist/cjs/packages/address/style/style.css +4 -4
- package/dist/cjs/packages/audio/style/style.css +4 -16
- package/dist/cjs/packages/button/style/button.scss +4 -20
- package/dist/cjs/packages/button/style/style.css +4 -16
- package/dist/cjs/packages/calendar/style/style.css +4 -4
- package/dist/cjs/packages/cascader/style/style.css +4 -4
- package/dist/cjs/packages/collapse/style/style.css +22 -7
- package/dist/cjs/packages/collapseitem/collapseitem.js +46 -44
- package/dist/cjs/packages/collapseitem/style/collapseitem.scss +22 -5
- package/dist/cjs/packages/collapseitem/style/style.css +22 -7
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/datepicker/style/style.css +4 -4
- package/dist/cjs/packages/dialog/confirm.d.ts +2 -3
- package/dist/cjs/packages/dialog/confirm.js +4 -18
- package/dist/cjs/packages/dialog/content.d.ts +11 -3
- package/dist/cjs/packages/dialog/dialog.d.ts +1 -1
- package/dist/cjs/packages/dialog/dialog.js +98 -69
- package/dist/cjs/packages/dialog/index.d.ts +1 -1
- package/dist/cjs/packages/dialog/style/style.css +4 -16
- package/dist/cjs/packages/empty/style/style.css +4 -16
- package/dist/cjs/packages/imagepreview/style/style.css +4 -4
- package/dist/cjs/packages/numberkeyboard/style/style.css +4 -4
- package/dist/cjs/packages/picker/style/style.css +4 -4
- package/dist/cjs/packages/popover/popover.js +72 -65
- package/dist/cjs/packages/popover/style/popover.scss +48 -51
- package/dist/cjs/packages/popover/style/style.css +64 -70
- package/dist/cjs/packages/popup/style/popup.scss +4 -4
- package/dist/cjs/packages/popup/style/style.css +4 -4
- package/dist/cjs/packages/resultpage/style/style.css +4 -16
- package/dist/cjs/packages/shortpassword/style/style.css +4 -4
- package/dist/cjs/packages/switch/switch.js +2 -2
- package/dist/cjs/packages/tabpane/tabpane.js +2 -2
- package/dist/cjs/packages/timeselect/style/style.css +4 -4
- package/dist/cjs/packages/tour/style/style.css +64 -70
- package/dist/cjs/types/spec/dialog/base.d.ts +50 -1
- package/dist/cjs/types/spec/dialog/base.js +7 -0
- package/dist/cjs/types/spec/dialog/h5.d.ts +4 -1
- package/dist/cjs/types/spec/dialog/taro.d.ts +8 -2
- package/dist/cjs/types/spec/popover/base.d.ts +7 -0
- package/dist/cjs/utils/get-rect-by-taro.js +10 -0
- package/dist/cjs/utils/lru.d.ts +8 -0
- package/dist/cjs/utils/lru.js +58 -0
- package/dist/es/packages/actionsheet/style/style.css +4 -4
- package/dist/es/packages/address/style/style.css +4 -4
- package/dist/es/packages/audio/style/style.css +4 -16
- package/dist/es/packages/button/style/button.scss +4 -20
- package/dist/es/packages/button/style/style.css +4 -16
- package/dist/es/packages/calendar/style/style.css +4 -4
- package/dist/es/packages/cascader/style/style.css +4 -4
- package/dist/es/packages/collapse/style/style.css +22 -7
- package/dist/es/packages/collapseitem/collapseitem.js +47 -45
- package/dist/es/packages/collapseitem/style/collapseitem.scss +22 -5
- package/dist/es/packages/collapseitem/style/style.css +22 -7
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/datepicker/style/style.css +4 -4
- package/dist/es/packages/dialog/confirm.d.ts +2 -3
- package/dist/es/packages/dialog/confirm.js +1 -8
- package/dist/es/packages/dialog/content.d.ts +11 -3
- package/dist/es/packages/dialog/dialog.d.ts +1 -1
- package/dist/es/packages/dialog/dialog.js +98 -69
- package/dist/es/packages/dialog/index.d.ts +1 -1
- package/dist/es/packages/dialog/style/style.css +4 -16
- package/dist/es/packages/empty/style/style.css +4 -16
- package/dist/es/packages/imagepreview/style/style.css +4 -4
- package/dist/es/packages/numberkeyboard/style/style.css +4 -4
- package/dist/es/packages/picker/style/style.css +4 -4
- package/dist/es/packages/popover/popover.js +72 -65
- package/dist/es/packages/popover/style/popover.scss +48 -51
- package/dist/es/packages/popover/style/style.css +64 -70
- package/dist/es/packages/popup/style/popup.scss +4 -4
- package/dist/es/packages/popup/style/style.css +4 -4
- package/dist/es/packages/resultpage/style/style.css +4 -16
- package/dist/es/packages/shortpassword/style/style.css +4 -4
- package/dist/es/packages/switch/switch.js +2 -2
- package/dist/es/packages/tabpane/tabpane.js +2 -2
- package/dist/es/packages/timeselect/style/style.css +4 -4
- package/dist/es/packages/tour/style/style.css +64 -70
- package/dist/es/types/spec/dialog/base.d.ts +83 -1
- package/dist/es/types/spec/dialog/base.js +1 -1
- package/dist/es/types/spec/dialog/h5.d.ts +4 -1
- package/dist/es/types/spec/dialog/taro.d.ts +8 -2
- package/dist/es/types/spec/popover/base.d.ts +7 -0
- package/dist/es/utils/get-rect-by-taro.js +9 -0
- package/dist/es/utils/lru.d.ts +8 -0
- package/dist/es/utils/lru.js +49 -0
- package/dist/nutui.react.umd.js +227 -249
- package/dist/style.css +1 -1
- package/dist/style.scss +42 -42
- package/dist/styles/theme-jmapp.scss +1 -0
- package/dist/styles/themes/jmapp.css +1 -1
- package/dist/styles/variables-jmapp.scss +214 -49
- package/dist/styles/variables-jrkf.scss +2 -13
- package/dist/styles/variables.scss +3 -14
- package/package.json +1 -1
- package/dist/cjs/packages/dialog/dialogwrap.d.ts +0 -4
- package/dist/cjs/packages/dialog/dialogwrap.js +0 -79
- package/dist/cjs/packages/dialog/types.d.ts +0 -57
- package/dist/cjs/packages/dialog/types.js +0 -11
- package/dist/es/packages/dialog/dialogwrap.d.ts +0 -4
- package/dist/es/packages/dialog/dialogwrap.js +0 -60
- package/dist/es/packages/dialog/types.d.ts +0 -57
- package/dist/es/packages/dialog/types.js +0 -1
package/dist/nutui.react.umd.js
CHANGED
|
@@ -10507,9 +10507,9 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
10507
10507
|
var classes = classNames(classPrefix2, {
|
|
10508
10508
|
active: !disabled && props.active
|
|
10509
10509
|
}, autoHeightClassName, className);
|
|
10510
|
-
return children
|
|
10510
|
+
return children ? /* @__PURE__ */ React.createElement("div", {
|
|
10511
10511
|
className: classes
|
|
10512
|
-
}, !disabled && children);
|
|
10512
|
+
}, !disabled && children) : null;
|
|
10513
10513
|
};
|
|
10514
10514
|
var defaultProps$1d = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
10515
10515
|
tabStyle: {},
|
|
@@ -18476,9 +18476,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
18476
18476
|
loadingIcon: /* @__PURE__ */ React.createElement(d$3, null)
|
|
18477
18477
|
});
|
|
18478
18478
|
var Switch = function(props) {
|
|
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, [
|
|
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, onChange = _ref.onChange, rest = _object_without_properties(_ref, [
|
|
18482
18480
|
"checked",
|
|
18483
18481
|
"defaultChecked",
|
|
18484
18482
|
"disabled",
|
|
@@ -18511,9 +18509,9 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
18511
18509
|
};
|
|
18512
18510
|
var onClick = function() {
|
|
18513
18511
|
if (disabled || changing) return;
|
|
18514
|
-
if (
|
|
18512
|
+
if (onChange) {
|
|
18515
18513
|
setChanging(true);
|
|
18516
|
-
|
|
18514
|
+
onChange(!value2);
|
|
18517
18515
|
}
|
|
18518
18516
|
setValue(!value2);
|
|
18519
18517
|
};
|
|
@@ -19319,6 +19317,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19319
19317
|
}));
|
|
19320
19318
|
};
|
|
19321
19319
|
ActionSheet.displayName = "NutActionSheet";
|
|
19320
|
+
var destroyList = [];
|
|
19322
19321
|
var fullClone = _object_spread({}, ReactDOM__namespace);
|
|
19323
19322
|
var version = fullClone.version, reactRender = fullClone.render, unmountComponentAtNode = fullClone.unmountComponentAtNode;
|
|
19324
19323
|
var createRoot;
|
|
@@ -19383,10 +19382,6 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19383
19382
|
function ConfirmDialog(props) {
|
|
19384
19383
|
return /* @__PURE__ */ React.createElement(Dialog, props, props.content);
|
|
19385
19384
|
}
|
|
19386
|
-
var normalizeConfig = function(config2) {
|
|
19387
|
-
config2.hideCancelButton = config2.isNotice;
|
|
19388
|
-
return config2;
|
|
19389
|
-
};
|
|
19390
19385
|
var confirm = function(config2, renderFunc) {
|
|
19391
19386
|
var div2 = document.createElement("div");
|
|
19392
19387
|
document.body.appendChild(div2);
|
|
@@ -19419,7 +19414,6 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19419
19414
|
}
|
|
19420
19415
|
};
|
|
19421
19416
|
dialogConfig.onConfirm = onConfirm;
|
|
19422
|
-
dialogConfig = normalizeConfig(dialogConfig);
|
|
19423
19417
|
dialogConfig.visible = true;
|
|
19424
19418
|
renderFunction(dialogConfig);
|
|
19425
19419
|
var destroy = function() {
|
|
@@ -19427,6 +19421,13 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19427
19421
|
if (div2 === null || div2 === void 0 ? void 0 : div2.parentNode) {
|
|
19428
19422
|
div2.parentNode.removeChild(div2);
|
|
19429
19423
|
}
|
|
19424
|
+
for (var i2 = 0; i2 < destroyList.length; i2++) {
|
|
19425
|
+
var fn = destroyList[i2];
|
|
19426
|
+
if (fn === close) {
|
|
19427
|
+
destroyList.splice(i2, 1);
|
|
19428
|
+
break;
|
|
19429
|
+
}
|
|
19430
|
+
}
|
|
19430
19431
|
};
|
|
19431
19432
|
var onCancel = function(confirm2) {
|
|
19432
19433
|
!confirm2 && config2.onCancel && config2.onCancel();
|
|
@@ -19440,7 +19441,6 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19440
19441
|
};
|
|
19441
19442
|
var update2 = function(newConfig) {
|
|
19442
19443
|
dialogConfig = _object_spread({}, dialogConfig, newConfig);
|
|
19443
|
-
dialogConfig = normalizeConfig(dialogConfig);
|
|
19444
19444
|
renderFunction(dialogConfig);
|
|
19445
19445
|
};
|
|
19446
19446
|
var close = function() {
|
|
@@ -19451,6 +19451,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19451
19451
|
};
|
|
19452
19452
|
renderFunction(dialogConfig);
|
|
19453
19453
|
};
|
|
19454
|
+
destroyList.push(close);
|
|
19454
19455
|
return {
|
|
19455
19456
|
close,
|
|
19456
19457
|
update: update2
|
|
@@ -19496,64 +19497,13 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19496
19497
|
}, children), renderFooter()));
|
|
19497
19498
|
};
|
|
19498
19499
|
Content.displayName = "NutContent";
|
|
19499
|
-
var
|
|
19500
|
-
|
|
19501
|
-
|
|
19502
|
-
|
|
19503
|
-
|
|
19504
|
-
},
|
|
19505
|
-
onClose: function() {
|
|
19506
|
-
},
|
|
19507
|
-
onOverlayClick: function() {
|
|
19508
|
-
return true;
|
|
19509
|
-
}
|
|
19510
|
-
});
|
|
19511
|
-
var DialogWrap = function(props) {
|
|
19512
|
-
var _ref = _object_spread({}, defaultDialogWrapProps, props), visible = _ref.visible, overlay = _ref.overlay, overlayStyle = _ref.overlayStyle, overlayClassName = _ref.overlayClassName, closeOnOverlayClick = _ref.closeOnOverlayClick, lockScroll = _ref.lockScroll, zIndex = _ref.zIndex, onClose = _ref.onClose, onCancel = _ref.onCancel, onOverlayClick = _ref.onOverlayClick, restProps = _object_without_properties(_ref, [
|
|
19513
|
-
"visible",
|
|
19514
|
-
"overlay",
|
|
19515
|
-
"overlayStyle",
|
|
19516
|
-
"overlayClassName",
|
|
19517
|
-
"closeOnOverlayClick",
|
|
19518
|
-
"lockScroll",
|
|
19519
|
-
"zIndex",
|
|
19520
|
-
"onClose",
|
|
19521
|
-
"onCancel",
|
|
19522
|
-
"onOverlayClick"
|
|
19523
|
-
]);
|
|
19524
|
-
var onHandleClickOverlay = function(e2) {
|
|
19525
|
-
if (closeOnOverlayClick && visible && e2.target === e2.currentTarget) {
|
|
19526
|
-
var closed = onOverlayClick && onOverlayClick(e2);
|
|
19527
|
-
closed && (onClose === null || onClose === void 0 ? void 0 : onClose());
|
|
19528
|
-
closed && (onCancel === null || onCancel === void 0 ? void 0 : onCancel());
|
|
19529
|
-
}
|
|
19530
|
-
};
|
|
19531
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, overlay && /* @__PURE__ */ React.createElement(Overlay, {
|
|
19532
|
-
zIndex,
|
|
19533
|
-
style: overlayStyle,
|
|
19534
|
-
className: overlayClassName,
|
|
19535
|
-
visible,
|
|
19536
|
-
closeOnOverlayClick,
|
|
19537
|
-
lockScroll,
|
|
19538
|
-
onClick: onHandleClickOverlay
|
|
19539
|
-
}), /* @__PURE__ */ React.createElement(CSSTransition, {
|
|
19540
|
-
in: visible,
|
|
19541
|
-
timeout: 300,
|
|
19542
|
-
classNames: "fadeDialog",
|
|
19543
|
-
unmountOnExit: true,
|
|
19544
|
-
appear: true
|
|
19545
|
-
}, /* @__PURE__ */ React.createElement(Content, _object_spread_props(_object_spread({}, restProps), {
|
|
19546
|
-
style: {
|
|
19547
|
-
zIndex
|
|
19548
|
-
},
|
|
19549
|
-
visible
|
|
19550
|
-
}))));
|
|
19551
|
-
};
|
|
19552
|
-
DialogWrap.displayName = "NutDialogWrap";
|
|
19553
|
-
var defaultProps$H = _object_spread_props(_object_spread({}, defaultDialogWrapProps), {
|
|
19500
|
+
var defaultProps$H = _object_spread_props(_object_spread({}, defaultOverlayProps, defaultContentProps), {
|
|
19501
|
+
title: "",
|
|
19502
|
+
content: "",
|
|
19503
|
+
header: "",
|
|
19504
|
+
footer: "",
|
|
19554
19505
|
confirmText: "",
|
|
19555
19506
|
cancelText: "",
|
|
19556
|
-
overlay: true,
|
|
19557
19507
|
closeOnOverlayClick: true,
|
|
19558
19508
|
hideConfirmButton: false,
|
|
19559
19509
|
hideCancelButton: false,
|
|
@@ -19562,38 +19512,28 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19562
19512
|
lockScroll: true,
|
|
19563
19513
|
closeIconPosition: "bottom",
|
|
19564
19514
|
closeIcon: false,
|
|
19515
|
+
overlay: true,
|
|
19516
|
+
overlayStyle: {},
|
|
19517
|
+
overlayClassName: "nut-dialog-overlay",
|
|
19565
19518
|
zIndex: 1200,
|
|
19566
19519
|
beforeCancel: function() {
|
|
19567
19520
|
return true;
|
|
19568
19521
|
},
|
|
19569
19522
|
beforeClose: function() {
|
|
19570
19523
|
return true;
|
|
19524
|
+
},
|
|
19525
|
+
onCancel: function() {
|
|
19526
|
+
},
|
|
19527
|
+
onClose: function() {
|
|
19528
|
+
},
|
|
19529
|
+
onOverlayClick: function() {
|
|
19530
|
+
return true;
|
|
19571
19531
|
}
|
|
19572
19532
|
});
|
|
19573
19533
|
var BaseDialog = function(props, ref) {
|
|
19574
|
-
var
|
|
19575
|
-
var _ref = _object_spread({}, defaultProps$H, props), visible = _ref.visible, footer = _ref.footer, hideConfirmButton = _ref.hideConfirmButton, hideCancelButton = _ref.hideCancelButton, lockScroll = _ref.lockScroll, disableConfirmButton = _ref.disableConfirmButton;
|
|
19576
|
-
_ref.closeOnOverlayClick;
|
|
19577
|
-
var confirmText = _ref.confirmText, cancelText = _ref.cancelText, closeIconPosition = _ref.closeIconPosition, closeIcon = _ref.closeIcon, footerDirection = _ref.footerDirection, onClose = _ref.onClose, onCancel = _ref.onCancel, onConfirm = _ref.onConfirm, beforeCancel = _ref.beforeCancel, beforeClose = _ref.beforeClose, restProps = _object_without_properties(_ref, [
|
|
19578
|
-
"visible",
|
|
19579
|
-
"footer",
|
|
19580
|
-
"hideConfirmButton",
|
|
19581
|
-
"hideCancelButton",
|
|
19582
|
-
"lockScroll",
|
|
19583
|
-
"disableConfirmButton",
|
|
19584
|
-
"closeOnOverlayClick",
|
|
19585
|
-
"confirmText",
|
|
19586
|
-
"cancelText",
|
|
19587
|
-
"closeIconPosition",
|
|
19588
|
-
"closeIcon",
|
|
19589
|
-
"footerDirection",
|
|
19590
|
-
"onClose",
|
|
19591
|
-
"onCancel",
|
|
19592
|
-
"onConfirm",
|
|
19593
|
-
"beforeCancel",
|
|
19594
|
-
"beforeClose"
|
|
19595
|
-
]);
|
|
19534
|
+
var _mergeProps = mergeProps(defaultProps$H, props), closeOnOverlayClick = _mergeProps.closeOnOverlayClick, confirmText = _mergeProps.confirmText, cancelText = _mergeProps.cancelText, children = _mergeProps.children, className = _mergeProps.className, closeIconPosition = _mergeProps.closeIconPosition, closeIcon = _mergeProps.closeIcon, content2 = _mergeProps.content, disableConfirmButton = _mergeProps.disableConfirmButton, footer = _mergeProps.footer, footerDirection = _mergeProps.footerDirection, header = _mergeProps.header, hideConfirmButton = _mergeProps.hideConfirmButton, hideCancelButton = _mergeProps.hideCancelButton, lockScroll = _mergeProps.lockScroll, overlay = _mergeProps.overlay, overlayStyle = _mergeProps.overlayStyle, overlayClassName = _mergeProps.overlayClassName, style = _mergeProps.style, title = _mergeProps.title, visible = _mergeProps.visible, zIndex = _mergeProps.zIndex, beforeCancel = _mergeProps.beforeCancel, beforeClose = _mergeProps.beforeClose, onClose = _mergeProps.onClose, onCancel = _mergeProps.onCancel, onConfirm = _mergeProps.onConfirm, onOverlayClick = _mergeProps.onOverlayClick;
|
|
19596
19535
|
var classPrefix2 = "nut-dialog";
|
|
19536
|
+
var locale = useConfig().locale;
|
|
19597
19537
|
var _useState = _sliced_to_array(React.useState(false), 2), loading = _useState[0], setLoading = _useState[1];
|
|
19598
19538
|
var renderFooter = function() {
|
|
19599
19539
|
if (footer === null) return "";
|
|
@@ -19601,11 +19541,11 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19601
19541
|
e2.stopPropagation();
|
|
19602
19542
|
if (!(beforeCancel === null || beforeCancel === void 0 ? void 0 : beforeCancel())) return;
|
|
19603
19543
|
if (!(beforeClose === null || beforeClose === void 0 ? void 0 : beforeClose())) return;
|
|
19604
|
-
onClose
|
|
19605
|
-
onCancel
|
|
19544
|
+
onClose();
|
|
19545
|
+
onCancel();
|
|
19606
19546
|
};
|
|
19607
19547
|
var handleOk = /* @__PURE__ */ function() {
|
|
19608
|
-
var
|
|
19548
|
+
var _ref = _async_to_generator(function(e2) {
|
|
19609
19549
|
return __generator(this, function(_state) {
|
|
19610
19550
|
switch (_state.label) {
|
|
19611
19551
|
case 0:
|
|
@@ -19626,7 +19566,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19626
19566
|
case 2:
|
|
19627
19567
|
_state.sent();
|
|
19628
19568
|
setLoading(false);
|
|
19629
|
-
onClose
|
|
19569
|
+
onClose();
|
|
19630
19570
|
return [
|
|
19631
19571
|
3,
|
|
19632
19572
|
4
|
|
@@ -19646,45 +19586,54 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19646
19586
|
});
|
|
19647
19587
|
});
|
|
19648
19588
|
return function handleOk2(e2) {
|
|
19649
|
-
return
|
|
19589
|
+
return _ref.apply(this, arguments);
|
|
19650
19590
|
};
|
|
19651
19591
|
}();
|
|
19652
19592
|
var btnClass = hideCancelButton || hideConfirmButton ? "".concat(classPrefix2, "-footer-block") : "";
|
|
19653
|
-
|
|
19654
|
-
|
|
19655
|
-
|
|
19656
|
-
|
|
19657
|
-
|
|
19658
|
-
|
|
19659
|
-
|
|
19660
|
-
|
|
19661
|
-
|
|
19662
|
-
|
|
19663
|
-
|
|
19664
|
-
|
|
19665
|
-
|
|
19666
|
-
|
|
19667
|
-
|
|
19668
|
-
|
|
19669
|
-
|
|
19670
|
-
|
|
19671
|
-
|
|
19672
|
-
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
|
|
19676
|
-
|
|
19677
|
-
|
|
19678
|
-
|
|
19679
|
-
|
|
19593
|
+
var renderCancelOfVertical = function() {
|
|
19594
|
+
return !hideCancelButton && /* @__PURE__ */ React.createElement("div", {
|
|
19595
|
+
style: {
|
|
19596
|
+
order: 2
|
|
19597
|
+
},
|
|
19598
|
+
className: "".concat(classPrefix2, "-footer-cancel ").concat(btnClass),
|
|
19599
|
+
onClick: function(e2) {
|
|
19600
|
+
return handleCancel(e2);
|
|
19601
|
+
}
|
|
19602
|
+
}, cancelText || locale.cancel);
|
|
19603
|
+
};
|
|
19604
|
+
var renderCancel = function() {
|
|
19605
|
+
return !hideCancelButton && /* @__PURE__ */ React.createElement(Button, {
|
|
19606
|
+
type: "default",
|
|
19607
|
+
size: "large",
|
|
19608
|
+
className: "".concat(classPrefix2, "-footer-cancel ").concat(btnClass),
|
|
19609
|
+
onClick: function(e2) {
|
|
19610
|
+
return handleCancel(e2);
|
|
19611
|
+
}
|
|
19612
|
+
}, cancelText || locale.cancel);
|
|
19613
|
+
};
|
|
19614
|
+
var renderConfirm = function() {
|
|
19615
|
+
return !hideConfirmButton && /* @__PURE__ */ React.createElement(Button, {
|
|
19616
|
+
type: "primary",
|
|
19617
|
+
size: "large",
|
|
19618
|
+
className: classNames("".concat(classPrefix2, "-footer-ok ").concat(btnClass), {
|
|
19619
|
+
disabled: disableConfirmButton
|
|
19620
|
+
}),
|
|
19621
|
+
disabled: disableConfirmButton,
|
|
19622
|
+
onClick: function(e2) {
|
|
19623
|
+
return handleOk(e2);
|
|
19624
|
+
},
|
|
19625
|
+
loading
|
|
19626
|
+
}, confirmText || locale.confirm);
|
|
19627
|
+
};
|
|
19628
|
+
return footer || /* @__PURE__ */ React.createElement(React.Fragment, null, footerDirection === "vertical" ? /* @__PURE__ */ React.createElement(React.Fragment, null, renderConfirm(), renderCancelOfVertical()) : /* @__PURE__ */ React.createElement(React.Fragment, null, renderCancel(), renderConfirm()));
|
|
19680
19629
|
};
|
|
19681
19630
|
var renderCloseIcon = function() {
|
|
19682
19631
|
if (!closeIcon) return null;
|
|
19683
19632
|
var handleCancel = function() {
|
|
19684
19633
|
if (!(beforeCancel === null || beforeCancel === void 0 ? void 0 : beforeCancel())) return;
|
|
19685
19634
|
if (!(beforeClose === null || beforeClose === void 0 ? void 0 : beforeClose())) return;
|
|
19686
|
-
onClose
|
|
19687
|
-
onCancel
|
|
19635
|
+
onClose();
|
|
19636
|
+
onCancel();
|
|
19688
19637
|
};
|
|
19689
19638
|
var _obj;
|
|
19690
19639
|
var closeClasses = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-close"), true), _define_property(_obj, "".concat(classPrefix2, "-close-").concat(closeIconPosition), true), _obj));
|
|
@@ -19694,19 +19643,46 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19694
19643
|
onClick: handleCancel
|
|
19695
19644
|
}, /* @__PURE__ */ React.isValidElement(closeIcon) ? closeIcon : systomIcon);
|
|
19696
19645
|
};
|
|
19646
|
+
var onHandleClickOverlay = function(e2) {
|
|
19647
|
+
if (closeOnOverlayClick && visible && e2.target === e2.currentTarget) {
|
|
19648
|
+
var closed = onOverlayClick && onOverlayClick(e2);
|
|
19649
|
+
closed && onClose();
|
|
19650
|
+
closed && onCancel();
|
|
19651
|
+
}
|
|
19652
|
+
};
|
|
19653
|
+
var renderContent = function() {
|
|
19654
|
+
return /* @__PURE__ */ React.createElement(CSSTransition, {
|
|
19655
|
+
in: visible,
|
|
19656
|
+
timeout: 300,
|
|
19657
|
+
classNames: "fadeDialog",
|
|
19658
|
+
unmountOnExit: true,
|
|
19659
|
+
appear: true
|
|
19660
|
+
}, /* @__PURE__ */ React.createElement(Content, {
|
|
19661
|
+
className,
|
|
19662
|
+
style: _object_spread({
|
|
19663
|
+
zIndex
|
|
19664
|
+
}, style),
|
|
19665
|
+
title,
|
|
19666
|
+
header,
|
|
19667
|
+
close: renderCloseIcon(),
|
|
19668
|
+
footer: renderFooter(),
|
|
19669
|
+
footerDirection,
|
|
19670
|
+
visible
|
|
19671
|
+
}, content2 || children));
|
|
19672
|
+
};
|
|
19697
19673
|
return /* @__PURE__ */ React.createElement("div", {
|
|
19698
19674
|
style: {
|
|
19699
19675
|
display: visible ? "block" : "none"
|
|
19700
19676
|
}
|
|
19701
|
-
}, /* @__PURE__ */ React.createElement(
|
|
19677
|
+
}, overlay && /* @__PURE__ */ React.createElement(Overlay, {
|
|
19678
|
+
zIndex,
|
|
19702
19679
|
visible,
|
|
19680
|
+
style: overlayStyle,
|
|
19681
|
+
className: overlayClassName,
|
|
19682
|
+
closeOnOverlayClick,
|
|
19703
19683
|
lockScroll,
|
|
19704
|
-
|
|
19705
|
-
|
|
19706
|
-
close: renderCloseIcon(),
|
|
19707
|
-
onClose,
|
|
19708
|
-
onCancel
|
|
19709
|
-
})));
|
|
19684
|
+
onClick: onHandleClickOverlay
|
|
19685
|
+
}), renderContent());
|
|
19710
19686
|
};
|
|
19711
19687
|
var Dialog = /* @__PURE__ */ React.forwardRef(BaseDialog);
|
|
19712
19688
|
Dialog.confirm = function(props) {
|
|
@@ -19714,12 +19690,9 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19714
19690
|
};
|
|
19715
19691
|
[
|
|
19716
19692
|
"alert"
|
|
19717
|
-
].forEach(function(
|
|
19718
|
-
Dialog
|
|
19719
|
-
return confirm(
|
|
19720
|
-
isNotice: false,
|
|
19721
|
-
noticeType: type2
|
|
19722
|
-
}));
|
|
19693
|
+
].forEach(function() {
|
|
19694
|
+
Dialog.alert = function(props) {
|
|
19695
|
+
return confirm(_object_spread({}, props));
|
|
19723
19696
|
};
|
|
19724
19697
|
});
|
|
19725
19698
|
Dialog.displayName = "NutDialog";
|
|
@@ -37634,12 +37607,12 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37634
37607
|
var popoverRef = React.useRef(null);
|
|
37635
37608
|
var popoverContentRef = React.useRef(null);
|
|
37636
37609
|
var _useState = _sliced_to_array(React.useState(false), 2), showPopup = _useState[0], setShowPopup = _useState[1];
|
|
37637
|
-
var _useState1 = _sliced_to_array(React.useState(), 2),
|
|
37610
|
+
var _useState1 = _sliced_to_array(React.useState(), 2), wrapperPosition = _useState1[0], setWrapperPosition = _useState1[1];
|
|
37638
37611
|
React.useEffect(function() {
|
|
37639
37612
|
setShowPopup(visible);
|
|
37640
37613
|
if (visible) {
|
|
37641
37614
|
setTimeout(function() {
|
|
37642
|
-
|
|
37615
|
+
getWrapperPosition();
|
|
37643
37616
|
}, 0);
|
|
37644
37617
|
}
|
|
37645
37618
|
}, [
|
|
@@ -37647,25 +37620,10 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37647
37620
|
location
|
|
37648
37621
|
]);
|
|
37649
37622
|
var update2 = React.useRef(function(e2) {
|
|
37650
|
-
|
|
37623
|
+
getWrapperPosition();
|
|
37651
37624
|
});
|
|
37652
|
-
React.useEffect(function() {
|
|
37653
|
-
if (visible) {
|
|
37654
|
-
scrollableParents.forEach(function(parent2) {
|
|
37655
|
-
parent2.addEventListener("scroll", update2.current, {
|
|
37656
|
-
passive: true
|
|
37657
|
-
});
|
|
37658
|
-
});
|
|
37659
|
-
} else {
|
|
37660
|
-
scrollableParents.forEach(function(parent2) {
|
|
37661
|
-
return parent2.removeEventListener("scroll", update2.current);
|
|
37662
|
-
});
|
|
37663
|
-
}
|
|
37664
|
-
}, [
|
|
37665
|
-
visible
|
|
37666
|
-
]);
|
|
37667
|
-
var element = null;
|
|
37668
37625
|
var targetSet = [];
|
|
37626
|
+
var element = null;
|
|
37669
37627
|
if (canUseDom && targetId) {
|
|
37670
37628
|
element = document.querySelector("#".concat(targetId));
|
|
37671
37629
|
targetSet = [
|
|
@@ -37678,39 +37636,59 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37678
37636
|
popoverContentRef.current
|
|
37679
37637
|
];
|
|
37680
37638
|
}
|
|
37681
|
-
useClickAway(function() {
|
|
37682
|
-
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
37683
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
37684
|
-
}, targetSet, "touchstart", true, visible, closeOnOutsideClick);
|
|
37685
37639
|
var scrollableParents = React.useMemo(function() {
|
|
37686
37640
|
return getAllScrollableParents(element || popoverRef.current);
|
|
37687
37641
|
}, [
|
|
37688
37642
|
element,
|
|
37689
37643
|
popoverRef.current
|
|
37690
37644
|
]);
|
|
37691
|
-
|
|
37645
|
+
React.useEffect(function() {
|
|
37646
|
+
if (visible) {
|
|
37647
|
+
scrollableParents.forEach(function(parent2) {
|
|
37648
|
+
parent2.addEventListener("scroll", update2.current, {
|
|
37649
|
+
passive: true
|
|
37650
|
+
});
|
|
37651
|
+
});
|
|
37652
|
+
} else {
|
|
37653
|
+
scrollableParents.forEach(function(parent2) {
|
|
37654
|
+
return parent2.removeEventListener("scroll", update2.current);
|
|
37655
|
+
});
|
|
37656
|
+
}
|
|
37657
|
+
}, [
|
|
37658
|
+
visible
|
|
37659
|
+
]);
|
|
37660
|
+
useClickAway(function() {
|
|
37661
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
37662
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
37663
|
+
}, targetSet, "touchstart", true, visible, closeOnOutsideClick);
|
|
37664
|
+
var getWrapperPosition = function() {
|
|
37692
37665
|
var rect = getRect(targetId ? document.querySelector("#".concat(targetId)) : popoverRef.current);
|
|
37693
|
-
|
|
37694
|
-
|
|
37695
|
-
|
|
37696
|
-
|
|
37697
|
-
|
|
37698
|
-
|
|
37666
|
+
var distance = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
|
|
37667
|
+
var width2 = rect.width, height2 = rect.height, right = rect.right, left = rect.left, top = rect.top;
|
|
37668
|
+
setWrapperPosition({
|
|
37669
|
+
width: width2,
|
|
37670
|
+
height: height2,
|
|
37671
|
+
left: rtl ? right : left,
|
|
37672
|
+
top: top + distance,
|
|
37673
|
+
right: rtl ? left : right
|
|
37699
37674
|
});
|
|
37700
37675
|
};
|
|
37701
|
-
var
|
|
37702
|
-
var classes = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix$b), true), _define_property(_obj, "".concat(classPrefix$b, "-").concat(theme), theme === "dark"), _obj), className);
|
|
37676
|
+
var classes = classNames(classPrefix$b, _define_property({}, "".concat(classPrefix$b, "-").concat(theme), theme === "dark"), className);
|
|
37703
37677
|
var popoverArrow = function() {
|
|
37704
37678
|
var prefixCls2 = "nut-popover-arrow";
|
|
37705
|
-
|
|
37679
|
+
var direction = location.split("-")[0];
|
|
37680
|
+
return "".concat(prefixCls2, " ").concat(prefixCls2, "-").concat(direction, " ").concat(prefixCls2, "-").concat(location);
|
|
37706
37681
|
};
|
|
37707
|
-
var
|
|
37682
|
+
var getPopoverPosition = function() {
|
|
37708
37683
|
var _popoverContentRef_current, _popoverContentRef_current1;
|
|
37709
37684
|
var styles = {};
|
|
37710
|
-
if (!
|
|
37711
|
-
|
|
37712
|
-
|
|
37713
|
-
|
|
37685
|
+
if (!wrapperPosition) {
|
|
37686
|
+
styles.visibility = "hidden";
|
|
37687
|
+
return styles;
|
|
37688
|
+
}
|
|
37689
|
+
var popWidth = (_popoverContentRef_current = popoverContentRef.current) === null || _popoverContentRef_current === void 0 ? void 0 : _popoverContentRef_current.clientWidth;
|
|
37690
|
+
var popHeight = (_popoverContentRef_current1 = popoverContentRef.current) === null || _popoverContentRef_current1 === void 0 ? void 0 : _popoverContentRef_current1.clientHeight;
|
|
37691
|
+
var width2 = wrapperPosition.width, height2 = wrapperPosition.height, left = wrapperPosition.left, top = wrapperPosition.top, right = wrapperPosition.right;
|
|
37714
37692
|
var direction = location.split("-")[0];
|
|
37715
37693
|
var skew = location.split("-")[1];
|
|
37716
37694
|
var cross = 0;
|
|
@@ -37726,15 +37704,15 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37726
37704
|
"bottom",
|
|
37727
37705
|
"top"
|
|
37728
37706
|
].includes(direction)) {
|
|
37729
|
-
var h = direction === "bottom" ? height2 + cross : -(
|
|
37707
|
+
var h = direction === "bottom" ? height2 + cross : -(popHeight + cross);
|
|
37730
37708
|
styles.top = "".concat(top + h, "px");
|
|
37731
37709
|
if (!skew) {
|
|
37732
|
-
styles[dir] = "".concat(-(
|
|
37710
|
+
styles[dir] = "".concat(-(popWidth - width2) / 2 + wrapperPosition[dir] + parallel, "px");
|
|
37733
37711
|
}
|
|
37734
|
-
if (skew === "
|
|
37712
|
+
if (skew === "left") {
|
|
37735
37713
|
styles.left = "".concat(left + parallel, "px");
|
|
37736
37714
|
}
|
|
37737
|
-
if (skew === "
|
|
37715
|
+
if (skew === "right") {
|
|
37738
37716
|
styles.left = "".concat(right + parallel, "px");
|
|
37739
37717
|
}
|
|
37740
37718
|
}
|
|
@@ -37742,22 +37720,23 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37742
37720
|
"left",
|
|
37743
37721
|
"right"
|
|
37744
37722
|
].includes(direction)) {
|
|
37745
|
-
var contentW = direction === "left" ? -(
|
|
37723
|
+
var contentW = direction === "left" ? -(popWidth + cross) : width2 + cross;
|
|
37746
37724
|
styles.left = "".concat(left + contentW, "px");
|
|
37747
37725
|
if (!skew) {
|
|
37748
|
-
styles.top = "".concat(top -
|
|
37726
|
+
styles.top = "".concat(top - popHeight / 2 + height2 / 2 - 4 + parallel, "px");
|
|
37749
37727
|
}
|
|
37750
|
-
if (skew === "
|
|
37728
|
+
if (skew === "top") {
|
|
37751
37729
|
styles.top = "".concat(top + parallel, "px");
|
|
37752
37730
|
}
|
|
37753
|
-
if (skew === "
|
|
37731
|
+
if (skew === "bottom") {
|
|
37754
37732
|
styles.top = "".concat(top + height2 + parallel, "px");
|
|
37755
37733
|
}
|
|
37756
37734
|
}
|
|
37757
37735
|
}
|
|
37736
|
+
styles.visibility = popWidth === 0 ? "hidden" : "initial";
|
|
37758
37737
|
return styles;
|
|
37759
37738
|
};
|
|
37760
|
-
var
|
|
37739
|
+
var popoverArrowStyle = function() {
|
|
37761
37740
|
var styles = {};
|
|
37762
37741
|
var direction = location.split("-")[0];
|
|
37763
37742
|
var skew = location.split("-")[1];
|
|
@@ -37772,10 +37751,10 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37772
37751
|
if (!skew) {
|
|
37773
37752
|
styles[dir] = "calc(50% + ".concat(arrowOffset, "px)");
|
|
37774
37753
|
}
|
|
37775
|
-
if (skew === "
|
|
37754
|
+
if (skew === "left") {
|
|
37776
37755
|
styles[dir] = "".concat(base + arrowOffset, "px");
|
|
37777
37756
|
}
|
|
37778
|
-
if (skew === "
|
|
37757
|
+
if (skew === "right") {
|
|
37779
37758
|
styles[dir2] = "".concat(base - arrowOffset, "px");
|
|
37780
37759
|
}
|
|
37781
37760
|
}
|
|
@@ -37786,10 +37765,10 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37786
37765
|
if (!skew) {
|
|
37787
37766
|
styles.top = "calc(50% - ".concat(arrowOffset, "px)");
|
|
37788
37767
|
}
|
|
37789
|
-
if (skew === "
|
|
37768
|
+
if (skew === "top") {
|
|
37790
37769
|
styles.top = "".concat(base - arrowOffset, "px");
|
|
37791
37770
|
}
|
|
37792
|
-
if (skew === "
|
|
37771
|
+
if (skew === "bottom") {
|
|
37793
37772
|
styles.bottom = "".concat(base + arrowOffset, "px");
|
|
37794
37773
|
}
|
|
37795
37774
|
}
|
|
@@ -37798,28 +37777,28 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37798
37777
|
};
|
|
37799
37778
|
var handleSelect = function(item, index2) {
|
|
37800
37779
|
if (!item.disabled) {
|
|
37801
|
-
onSelect
|
|
37780
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(item, index2);
|
|
37802
37781
|
}
|
|
37803
37782
|
if (closeOnActionClick) {
|
|
37804
|
-
onClick
|
|
37805
|
-
onClose
|
|
37783
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
37784
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
37806
37785
|
}
|
|
37807
37786
|
};
|
|
37808
37787
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, !targetId && /* @__PURE__ */ React.createElement("div", {
|
|
37809
37788
|
className: "nut-popover-wrapper",
|
|
37810
37789
|
ref: popoverRef,
|
|
37811
37790
|
onClick: function() {
|
|
37812
|
-
onClick
|
|
37791
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
37813
37792
|
if (!visible) {
|
|
37814
|
-
onOpen
|
|
37793
|
+
onOpen === null || onOpen === void 0 ? void 0 : onOpen();
|
|
37815
37794
|
} else {
|
|
37816
|
-
onClose
|
|
37795
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
37817
37796
|
}
|
|
37818
37797
|
},
|
|
37819
37798
|
style
|
|
37820
37799
|
}, Array.isArray(children) ? children[0] : children), /* @__PURE__ */ ReactDOM.createPortal(/* @__PURE__ */ React.createElement("div", {
|
|
37821
37800
|
className: classes,
|
|
37822
|
-
style:
|
|
37801
|
+
style: _object_spread({}, getPopoverPosition(), style)
|
|
37823
37802
|
}, /* @__PURE__ */ React.createElement(Popup, _object_spread({
|
|
37824
37803
|
className: "nut-popover-content nut-popover-content-".concat(location),
|
|
37825
37804
|
visible: showPopup,
|
|
@@ -37831,29 +37810,30 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37831
37810
|
ref: popoverContentRef
|
|
37832
37811
|
}, showArrow && /* @__PURE__ */ React.createElement("div", {
|
|
37833
37812
|
className: popoverArrow(),
|
|
37834
|
-
style:
|
|
37813
|
+
style: popoverArrowStyle()
|
|
37835
37814
|
}, /* @__PURE__ */ React.createElement(i$1, {
|
|
37836
37815
|
width: 8,
|
|
37837
37816
|
height: 4
|
|
37838
37817
|
})), Array.isArray(children) ? children[1] : null, list.map(function(item, index2) {
|
|
37818
|
+
var _item_action;
|
|
37839
37819
|
return /* @__PURE__ */ React.createElement("div", {
|
|
37840
37820
|
className: classNames({
|
|
37841
|
-
"nut-popover-
|
|
37842
|
-
"nut-popover-
|
|
37821
|
+
"nut-popover-item": true,
|
|
37822
|
+
"nut-popover-item-disabled": item.disabled
|
|
37843
37823
|
}, item.className),
|
|
37844
37824
|
key: item.key || index2,
|
|
37845
37825
|
onClick: function() {
|
|
37846
37826
|
return handleSelect(item, index2);
|
|
37847
37827
|
}
|
|
37848
37828
|
}, item.icon && /* @__PURE__ */ React.createElement("div", {
|
|
37849
|
-
className: "nut-popover-
|
|
37829
|
+
className: "nut-popover-item-icon"
|
|
37850
37830
|
}, item.icon), /* @__PURE__ */ React.createElement("div", {
|
|
37851
|
-
className: "nut-popover-
|
|
37852
|
-
}, item.name), item.action
|
|
37853
|
-
className: "nut-popover-
|
|
37831
|
+
className: "nut-popover-item-name"
|
|
37832
|
+
}, item.name), ((_item_action = item.action) === null || _item_action === void 0 ? void 0 : _item_action.icon) && /* @__PURE__ */ React.createElement("div", {
|
|
37833
|
+
className: "nut-popover-item-action-icon",
|
|
37854
37834
|
onClick: function(e2) {
|
|
37855
|
-
var _item_action_onClick,
|
|
37856
|
-
return (
|
|
37835
|
+
var _item_action_onClick, _item_action2;
|
|
37836
|
+
return (_item_action2 = item.action) === null || _item_action2 === void 0 ? void 0 : (_item_action_onClick = _item_action2.onClick) === null || _item_action_onClick === void 0 ? void 0 : _item_action_onClick.call(_item_action2, e2);
|
|
37857
37837
|
}
|
|
37858
37838
|
}, item.action.icon));
|
|
37859
37839
|
})))), document.body));
|
|
@@ -39389,57 +39369,50 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
39389
39369
|
expanded,
|
|
39390
39370
|
rotate
|
|
39391
39371
|
]);
|
|
39392
|
-
var
|
|
39393
|
-
|
|
39394
|
-
|
|
39395
|
-
|
|
39396
|
-
|
|
39397
|
-
|
|
39398
|
-
|
|
39399
|
-
|
|
39400
|
-
|
|
39401
|
-
|
|
39402
|
-
|
|
39403
|
-
|
|
39404
|
-
|
|
39405
|
-
|
|
39406
|
-
|
|
39407
|
-
|
|
39408
|
-
};
|
|
39409
|
-
var toggle = function() {
|
|
39410
|
-
var start2 = expanded ? "0px" : getOffsetHeight();
|
|
39411
|
-
if (wrapperRef.current) {
|
|
39412
|
-
wrapperRef.current.style.height = start2;
|
|
39413
|
-
}
|
|
39414
|
-
requestAnimationFrame(function() {
|
|
39415
|
-
requestAnimationFrame(function() {
|
|
39416
|
-
var end = expanded ? getOffsetHeight() : "0px";
|
|
39417
|
-
if (wrapperRef.current) {
|
|
39418
|
-
wrapperRef.current.style.height = end;
|
|
39419
|
-
}
|
|
39372
|
+
var _useState = _sliced_to_array(React.useState(0), 2), tran = _useState[0], setTran = _useState[1];
|
|
39373
|
+
var _useRefState = _sliced_to_array(useRefState(0), 2), currentHeight = _useRefState[0], setCurrentHeight = _useRefState[1];
|
|
39374
|
+
var _useState1 = _sliced_to_array(React.useState(0), 2), wrapperHeight = _useState1[0], setWrapperHeight = _useState1[1];
|
|
39375
|
+
var updateRectHeight = /* @__PURE__ */ function() {
|
|
39376
|
+
var _ref2 = _async_to_generator(function() {
|
|
39377
|
+
var height2;
|
|
39378
|
+
return __generator(this, function(_state) {
|
|
39379
|
+
height2 = contentRef.current.offsetHeight;
|
|
39380
|
+
setCurrentHeight(height2);
|
|
39381
|
+
setWrapperHeight(expanded ? height2 : 0);
|
|
39382
|
+
setTimeout(function() {
|
|
39383
|
+
setTran(1);
|
|
39384
|
+
});
|
|
39385
|
+
return [
|
|
39386
|
+
2
|
|
39387
|
+
];
|
|
39420
39388
|
});
|
|
39421
39389
|
});
|
|
39422
|
-
|
|
39423
|
-
|
|
39390
|
+
return function updateRectHeight2() {
|
|
39391
|
+
return _ref2.apply(this, arguments);
|
|
39392
|
+
};
|
|
39393
|
+
}();
|
|
39424
39394
|
React.useEffect(function() {
|
|
39425
|
-
|
|
39426
|
-
init.current = false;
|
|
39427
|
-
if (!expanded) {
|
|
39428
|
-
wrapperRef.current.style.height = "0px";
|
|
39429
|
-
}
|
|
39430
|
-
} else {
|
|
39431
|
-
toggle();
|
|
39432
|
-
}
|
|
39395
|
+
updateRectHeight();
|
|
39433
39396
|
}, [
|
|
39397
|
+
children,
|
|
39434
39398
|
expanded
|
|
39435
39399
|
]);
|
|
39400
|
+
var toggle = function() {
|
|
39401
|
+
var end = !expanded ? currentHeight.current : 0;
|
|
39402
|
+
setWrapperHeight(end);
|
|
39403
|
+
};
|
|
39404
|
+
var handleClick = function() {
|
|
39405
|
+
if (!disabled) {
|
|
39406
|
+
context2.updateValue(name2);
|
|
39407
|
+
toggle();
|
|
39408
|
+
}
|
|
39409
|
+
};
|
|
39410
|
+
var _obj;
|
|
39436
39411
|
return /* @__PURE__ */ React.createElement("div", _object_spread({
|
|
39437
39412
|
className: classNames(classPrefix2, className),
|
|
39438
39413
|
style
|
|
39439
39414
|
}, rest), /* @__PURE__ */ React.createElement("div", {
|
|
39440
|
-
className: classNames("".concat(classPrefix2, "-header"), {
|
|
39441
|
-
disabled
|
|
39442
|
-
}),
|
|
39415
|
+
className: classNames("".concat(classPrefix2, "-header"), _define_property({}, "".concat(classPrefix2, "-header-disabled"), disabled)),
|
|
39443
39416
|
onClick: handleClick
|
|
39444
39417
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
39445
39418
|
className: "".concat(classPrefix2, "-title")
|
|
@@ -39451,13 +39424,17 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
39451
39424
|
className: "".concat(classPrefix2, "-icon"),
|
|
39452
39425
|
style: iconStyle
|
|
39453
39426
|
}, expandIcon || context2.expandIcon))), /* @__PURE__ */ React.createElement("div", {
|
|
39454
|
-
className: "".concat(classPrefix2, "-content"),
|
|
39455
|
-
|
|
39427
|
+
className: classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-content-wrapper"), true), _define_property(_obj, "".concat(classPrefix2, "-content-wrapper-tran"), true), _obj)),
|
|
39428
|
+
style: tran ? {
|
|
39429
|
+
height: wrapperHeight
|
|
39430
|
+
} : {},
|
|
39456
39431
|
ref: wrapperRef
|
|
39432
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
39433
|
+
className: "".concat(classPrefix2, "-content")
|
|
39457
39434
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
39458
39435
|
ref: contentRef,
|
|
39459
39436
|
className: "".concat(classPrefix2, "-content-text")
|
|
39460
|
-
}, children)));
|
|
39437
|
+
}, children))));
|
|
39461
39438
|
};
|
|
39462
39439
|
CollapseItem.displayName = "NutCollapseItem";
|
|
39463
39440
|
var defaultProps$n = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
@@ -42863,6 +42840,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
42863
42840
|
exports.Video = Video;
|
|
42864
42841
|
exports.VirtualList = VirtualList;
|
|
42865
42842
|
exports.WaterMark = WaterMark;
|
|
42843
|
+
exports.destroyList = destroyList;
|
|
42866
42844
|
exports.getDefaultConfig = getDefaultConfig;
|
|
42867
42845
|
exports.setDefaultConfig = setDefaultConfig;
|
|
42868
42846
|
exports.useConfig = useConfig;
|