@nutui/nutui-react 3.0.6 → 3.0.8
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 +51 -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/avatar/style/style.css +4 -0
- 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/cascader.js +2 -1
- 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/dialog.scss +1 -0
- package/dist/cjs/packages/dialog/style/style.css +5 -16
- package/dist/cjs/packages/empty/style/style.css +4 -16
- package/dist/cjs/packages/image/style/image.scss +4 -1
- package/dist/cjs/packages/image/style/style.css +4 -0
- package/dist/cjs/packages/imagepreview/style/style.css +8 -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/skeleton/skeleton.js +1 -2
- package/dist/cjs/packages/switch/switch.js +53 -8
- 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/avatar/style/style.css +4 -0
- 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/cascader.js +2 -1
- 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/dialog.scss +1 -0
- package/dist/es/packages/dialog/style/style.css +5 -16
- package/dist/es/packages/empty/style/style.css +4 -16
- package/dist/es/packages/image/style/image.scss +4 -1
- package/dist/es/packages/image/style/style.css +4 -0
- package/dist/es/packages/imagepreview/style/style.css +8 -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/skeleton/skeleton.js +1 -2
- package/dist/es/packages/switch/switch.js +53 -8
- 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 +278 -258
- package/dist/style.css +1 -1
- package/dist/style.scss +46 -46
- package/dist/styles/theme-jmapp.scss +1 -0
- package/dist/styles/themes/dark.css +1 -1
- package/dist/styles/themes/default.css +1 -1
- package/dist/styles/themes/jmapp.css +1 -1
- package/dist/styles/themes/jrkf.css +1 -1
- package/dist/styles/variables-jmapp.scss +215 -49
- package/dist/styles/variables-jrkf.scss +2 -13
- package/dist/styles/variables.scss +7 -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: {},
|
|
@@ -11090,6 +11090,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
11090
11090
|
});
|
|
11091
11091
|
next.push({
|
|
11092
11092
|
selected: val2,
|
|
11093
|
+
selectedText: opt === null || opt === void 0 ? void 0 : opt.text,
|
|
11093
11094
|
pane: currentOptions
|
|
11094
11095
|
});
|
|
11095
11096
|
pathNodes.current[index2] = opt;
|
|
@@ -11377,7 +11378,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
11377
11378
|
}
|
|
11378
11379
|
}, levels.map(function(pane, index2) {
|
|
11379
11380
|
return /* @__PURE__ */ React.createElement(Tabs.TabPane, {
|
|
11380
|
-
title: pane.
|
|
11381
|
+
title: pane.selectedText || locale.select,
|
|
11381
11382
|
key: index2
|
|
11382
11383
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
11383
11384
|
className: classPane
|
|
@@ -18476,9 +18477,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
18476
18477
|
loadingIcon: /* @__PURE__ */ React.createElement(d$3, null)
|
|
18477
18478
|
});
|
|
18478
18479
|
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, [
|
|
18480
|
+
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
18481
|
"checked",
|
|
18483
18482
|
"defaultChecked",
|
|
18484
18483
|
"disabled",
|
|
@@ -18509,14 +18508,56 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
18509
18508
|
(_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)
|
|
18510
18509
|
]);
|
|
18511
18510
|
};
|
|
18512
|
-
var onClick = function() {
|
|
18513
|
-
|
|
18514
|
-
|
|
18515
|
-
|
|
18516
|
-
|
|
18517
|
-
|
|
18518
|
-
|
|
18519
|
-
|
|
18511
|
+
var onClick = /* @__PURE__ */ function() {
|
|
18512
|
+
var _ref2 = _async_to_generator(function() {
|
|
18513
|
+
return __generator(this, function(_state) {
|
|
18514
|
+
switch (_state.label) {
|
|
18515
|
+
case 0:
|
|
18516
|
+
if (disabled || changing) return [
|
|
18517
|
+
2
|
|
18518
|
+
];
|
|
18519
|
+
if (!onChange) return [
|
|
18520
|
+
3,
|
|
18521
|
+
4
|
|
18522
|
+
];
|
|
18523
|
+
setChanging(true);
|
|
18524
|
+
_state.label = 1;
|
|
18525
|
+
case 1:
|
|
18526
|
+
_state.trys.push([
|
|
18527
|
+
1,
|
|
18528
|
+
3,
|
|
18529
|
+
,
|
|
18530
|
+
4
|
|
18531
|
+
]);
|
|
18532
|
+
return [
|
|
18533
|
+
4,
|
|
18534
|
+
onChange(!value2)
|
|
18535
|
+
];
|
|
18536
|
+
case 2:
|
|
18537
|
+
_state.sent();
|
|
18538
|
+
return [
|
|
18539
|
+
3,
|
|
18540
|
+
4
|
|
18541
|
+
];
|
|
18542
|
+
case 3:
|
|
18543
|
+
_state.sent();
|
|
18544
|
+
setChanging(false);
|
|
18545
|
+
return [
|
|
18546
|
+
3,
|
|
18547
|
+
4
|
|
18548
|
+
];
|
|
18549
|
+
case 4:
|
|
18550
|
+
setValue(!value2);
|
|
18551
|
+
return [
|
|
18552
|
+
2
|
|
18553
|
+
];
|
|
18554
|
+
}
|
|
18555
|
+
});
|
|
18556
|
+
});
|
|
18557
|
+
return function onClick2() {
|
|
18558
|
+
return _ref2.apply(this, arguments);
|
|
18559
|
+
};
|
|
18560
|
+
}();
|
|
18520
18561
|
var _obj, _obj1;
|
|
18521
18562
|
return /* @__PURE__ */ React.createElement("div", _object_spread({
|
|
18522
18563
|
className: classes(),
|
|
@@ -19319,6 +19360,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19319
19360
|
}));
|
|
19320
19361
|
};
|
|
19321
19362
|
ActionSheet.displayName = "NutActionSheet";
|
|
19363
|
+
var destroyList = [];
|
|
19322
19364
|
var fullClone = _object_spread({}, ReactDOM__namespace);
|
|
19323
19365
|
var version = fullClone.version, reactRender = fullClone.render, unmountComponentAtNode = fullClone.unmountComponentAtNode;
|
|
19324
19366
|
var createRoot;
|
|
@@ -19383,10 +19425,6 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19383
19425
|
function ConfirmDialog(props) {
|
|
19384
19426
|
return /* @__PURE__ */ React.createElement(Dialog, props, props.content);
|
|
19385
19427
|
}
|
|
19386
|
-
var normalizeConfig = function(config2) {
|
|
19387
|
-
config2.hideCancelButton = config2.isNotice;
|
|
19388
|
-
return config2;
|
|
19389
|
-
};
|
|
19390
19428
|
var confirm = function(config2, renderFunc) {
|
|
19391
19429
|
var div2 = document.createElement("div");
|
|
19392
19430
|
document.body.appendChild(div2);
|
|
@@ -19419,7 +19457,6 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19419
19457
|
}
|
|
19420
19458
|
};
|
|
19421
19459
|
dialogConfig.onConfirm = onConfirm;
|
|
19422
|
-
dialogConfig = normalizeConfig(dialogConfig);
|
|
19423
19460
|
dialogConfig.visible = true;
|
|
19424
19461
|
renderFunction(dialogConfig);
|
|
19425
19462
|
var destroy = function() {
|
|
@@ -19427,6 +19464,13 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19427
19464
|
if (div2 === null || div2 === void 0 ? void 0 : div2.parentNode) {
|
|
19428
19465
|
div2.parentNode.removeChild(div2);
|
|
19429
19466
|
}
|
|
19467
|
+
for (var i2 = 0; i2 < destroyList.length; i2++) {
|
|
19468
|
+
var fn = destroyList[i2];
|
|
19469
|
+
if (fn === close) {
|
|
19470
|
+
destroyList.splice(i2, 1);
|
|
19471
|
+
break;
|
|
19472
|
+
}
|
|
19473
|
+
}
|
|
19430
19474
|
};
|
|
19431
19475
|
var onCancel = function(confirm2) {
|
|
19432
19476
|
!confirm2 && config2.onCancel && config2.onCancel();
|
|
@@ -19440,7 +19484,6 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19440
19484
|
};
|
|
19441
19485
|
var update2 = function(newConfig) {
|
|
19442
19486
|
dialogConfig = _object_spread({}, dialogConfig, newConfig);
|
|
19443
|
-
dialogConfig = normalizeConfig(dialogConfig);
|
|
19444
19487
|
renderFunction(dialogConfig);
|
|
19445
19488
|
};
|
|
19446
19489
|
var close = function() {
|
|
@@ -19451,6 +19494,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19451
19494
|
};
|
|
19452
19495
|
renderFunction(dialogConfig);
|
|
19453
19496
|
};
|
|
19497
|
+
destroyList.push(close);
|
|
19454
19498
|
return {
|
|
19455
19499
|
close,
|
|
19456
19500
|
update: update2
|
|
@@ -19496,64 +19540,13 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19496
19540
|
}, children), renderFooter()));
|
|
19497
19541
|
};
|
|
19498
19542
|
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), {
|
|
19543
|
+
var defaultProps$H = _object_spread_props(_object_spread({}, defaultOverlayProps, defaultContentProps), {
|
|
19544
|
+
title: "",
|
|
19545
|
+
content: "",
|
|
19546
|
+
header: "",
|
|
19547
|
+
footer: "",
|
|
19554
19548
|
confirmText: "",
|
|
19555
19549
|
cancelText: "",
|
|
19556
|
-
overlay: true,
|
|
19557
19550
|
closeOnOverlayClick: true,
|
|
19558
19551
|
hideConfirmButton: false,
|
|
19559
19552
|
hideCancelButton: false,
|
|
@@ -19562,38 +19555,28 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19562
19555
|
lockScroll: true,
|
|
19563
19556
|
closeIconPosition: "bottom",
|
|
19564
19557
|
closeIcon: false,
|
|
19558
|
+
overlay: true,
|
|
19559
|
+
overlayStyle: {},
|
|
19560
|
+
overlayClassName: "nut-dialog-overlay",
|
|
19565
19561
|
zIndex: 1200,
|
|
19566
19562
|
beforeCancel: function() {
|
|
19567
19563
|
return true;
|
|
19568
19564
|
},
|
|
19569
19565
|
beforeClose: function() {
|
|
19570
19566
|
return true;
|
|
19567
|
+
},
|
|
19568
|
+
onCancel: function() {
|
|
19569
|
+
},
|
|
19570
|
+
onClose: function() {
|
|
19571
|
+
},
|
|
19572
|
+
onOverlayClick: function() {
|
|
19573
|
+
return true;
|
|
19571
19574
|
}
|
|
19572
19575
|
});
|
|
19573
19576
|
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
|
-
]);
|
|
19577
|
+
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
19578
|
var classPrefix2 = "nut-dialog";
|
|
19579
|
+
var locale = useConfig().locale;
|
|
19597
19580
|
var _useState = _sliced_to_array(React.useState(false), 2), loading = _useState[0], setLoading = _useState[1];
|
|
19598
19581
|
var renderFooter = function() {
|
|
19599
19582
|
if (footer === null) return "";
|
|
@@ -19601,11 +19584,11 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19601
19584
|
e2.stopPropagation();
|
|
19602
19585
|
if (!(beforeCancel === null || beforeCancel === void 0 ? void 0 : beforeCancel())) return;
|
|
19603
19586
|
if (!(beforeClose === null || beforeClose === void 0 ? void 0 : beforeClose())) return;
|
|
19604
|
-
onClose
|
|
19605
|
-
onCancel
|
|
19587
|
+
onClose();
|
|
19588
|
+
onCancel();
|
|
19606
19589
|
};
|
|
19607
19590
|
var handleOk = /* @__PURE__ */ function() {
|
|
19608
|
-
var
|
|
19591
|
+
var _ref = _async_to_generator(function(e2) {
|
|
19609
19592
|
return __generator(this, function(_state) {
|
|
19610
19593
|
switch (_state.label) {
|
|
19611
19594
|
case 0:
|
|
@@ -19626,7 +19609,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19626
19609
|
case 2:
|
|
19627
19610
|
_state.sent();
|
|
19628
19611
|
setLoading(false);
|
|
19629
|
-
onClose
|
|
19612
|
+
onClose();
|
|
19630
19613
|
return [
|
|
19631
19614
|
3,
|
|
19632
19615
|
4
|
|
@@ -19646,45 +19629,54 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19646
19629
|
});
|
|
19647
19630
|
});
|
|
19648
19631
|
return function handleOk2(e2) {
|
|
19649
|
-
return
|
|
19632
|
+
return _ref.apply(this, arguments);
|
|
19650
19633
|
};
|
|
19651
19634
|
}();
|
|
19652
19635
|
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
|
-
|
|
19636
|
+
var renderCancelOfVertical = function() {
|
|
19637
|
+
return !hideCancelButton && /* @__PURE__ */ React.createElement("div", {
|
|
19638
|
+
style: {
|
|
19639
|
+
order: 2
|
|
19640
|
+
},
|
|
19641
|
+
className: "".concat(classPrefix2, "-footer-cancel ").concat(btnClass),
|
|
19642
|
+
onClick: function(e2) {
|
|
19643
|
+
return handleCancel(e2);
|
|
19644
|
+
}
|
|
19645
|
+
}, cancelText || locale.cancel);
|
|
19646
|
+
};
|
|
19647
|
+
var renderCancel = function() {
|
|
19648
|
+
return !hideCancelButton && /* @__PURE__ */ React.createElement(Button, {
|
|
19649
|
+
type: "default",
|
|
19650
|
+
size: "large",
|
|
19651
|
+
className: "".concat(classPrefix2, "-footer-cancel ").concat(btnClass),
|
|
19652
|
+
onClick: function(e2) {
|
|
19653
|
+
return handleCancel(e2);
|
|
19654
|
+
}
|
|
19655
|
+
}, cancelText || locale.cancel);
|
|
19656
|
+
};
|
|
19657
|
+
var renderConfirm = function() {
|
|
19658
|
+
return !hideConfirmButton && /* @__PURE__ */ React.createElement(Button, {
|
|
19659
|
+
type: "primary",
|
|
19660
|
+
size: "large",
|
|
19661
|
+
className: classNames("".concat(classPrefix2, "-footer-ok ").concat(btnClass), {
|
|
19662
|
+
disabled: disableConfirmButton
|
|
19663
|
+
}),
|
|
19664
|
+
disabled: disableConfirmButton,
|
|
19665
|
+
onClick: function(e2) {
|
|
19666
|
+
return handleOk(e2);
|
|
19667
|
+
},
|
|
19668
|
+
loading
|
|
19669
|
+
}, confirmText || locale.confirm);
|
|
19670
|
+
};
|
|
19671
|
+
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
19672
|
};
|
|
19681
19673
|
var renderCloseIcon = function() {
|
|
19682
19674
|
if (!closeIcon) return null;
|
|
19683
19675
|
var handleCancel = function() {
|
|
19684
19676
|
if (!(beforeCancel === null || beforeCancel === void 0 ? void 0 : beforeCancel())) return;
|
|
19685
19677
|
if (!(beforeClose === null || beforeClose === void 0 ? void 0 : beforeClose())) return;
|
|
19686
|
-
onClose
|
|
19687
|
-
onCancel
|
|
19678
|
+
onClose();
|
|
19679
|
+
onCancel();
|
|
19688
19680
|
};
|
|
19689
19681
|
var _obj;
|
|
19690
19682
|
var closeClasses = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-close"), true), _define_property(_obj, "".concat(classPrefix2, "-close-").concat(closeIconPosition), true), _obj));
|
|
@@ -19694,19 +19686,46 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19694
19686
|
onClick: handleCancel
|
|
19695
19687
|
}, /* @__PURE__ */ React.isValidElement(closeIcon) ? closeIcon : systomIcon);
|
|
19696
19688
|
};
|
|
19689
|
+
var onHandleClickOverlay = function(e2) {
|
|
19690
|
+
if (closeOnOverlayClick && visible && e2.target === e2.currentTarget) {
|
|
19691
|
+
var closed = onOverlayClick && onOverlayClick(e2);
|
|
19692
|
+
closed && onClose();
|
|
19693
|
+
closed && onCancel();
|
|
19694
|
+
}
|
|
19695
|
+
};
|
|
19696
|
+
var renderContent = function() {
|
|
19697
|
+
return /* @__PURE__ */ React.createElement(CSSTransition, {
|
|
19698
|
+
in: visible,
|
|
19699
|
+
timeout: 300,
|
|
19700
|
+
classNames: "fadeDialog",
|
|
19701
|
+
unmountOnExit: true,
|
|
19702
|
+
appear: true
|
|
19703
|
+
}, /* @__PURE__ */ React.createElement(Content, {
|
|
19704
|
+
className,
|
|
19705
|
+
style: _object_spread({
|
|
19706
|
+
zIndex
|
|
19707
|
+
}, style),
|
|
19708
|
+
title,
|
|
19709
|
+
header,
|
|
19710
|
+
close: renderCloseIcon(),
|
|
19711
|
+
footer: renderFooter(),
|
|
19712
|
+
footerDirection,
|
|
19713
|
+
visible
|
|
19714
|
+
}, content2 || children));
|
|
19715
|
+
};
|
|
19697
19716
|
return /* @__PURE__ */ React.createElement("div", {
|
|
19698
19717
|
style: {
|
|
19699
19718
|
display: visible ? "block" : "none"
|
|
19700
19719
|
}
|
|
19701
|
-
}, /* @__PURE__ */ React.createElement(
|
|
19720
|
+
}, overlay && /* @__PURE__ */ React.createElement(Overlay, {
|
|
19721
|
+
zIndex,
|
|
19702
19722
|
visible,
|
|
19723
|
+
style: overlayStyle,
|
|
19724
|
+
className: overlayClassName,
|
|
19725
|
+
closeOnOverlayClick,
|
|
19703
19726
|
lockScroll,
|
|
19704
|
-
|
|
19705
|
-
|
|
19706
|
-
close: renderCloseIcon(),
|
|
19707
|
-
onClose,
|
|
19708
|
-
onCancel
|
|
19709
|
-
})));
|
|
19727
|
+
onClick: onHandleClickOverlay
|
|
19728
|
+
}), renderContent());
|
|
19710
19729
|
};
|
|
19711
19730
|
var Dialog = /* @__PURE__ */ React.forwardRef(BaseDialog);
|
|
19712
19731
|
Dialog.confirm = function(props) {
|
|
@@ -19714,12 +19733,9 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19714
19733
|
};
|
|
19715
19734
|
[
|
|
19716
19735
|
"alert"
|
|
19717
|
-
].forEach(function(
|
|
19718
|
-
Dialog
|
|
19719
|
-
return confirm(
|
|
19720
|
-
isNotice: false,
|
|
19721
|
-
noticeType: type2
|
|
19722
|
-
}));
|
|
19736
|
+
].forEach(function() {
|
|
19737
|
+
Dialog.alert = function(props) {
|
|
19738
|
+
return confirm(_object_spread({}, props));
|
|
19723
19739
|
};
|
|
19724
19740
|
});
|
|
19725
19741
|
Dialog.displayName = "NutDialog";
|
|
@@ -37634,12 +37650,12 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37634
37650
|
var popoverRef = React.useRef(null);
|
|
37635
37651
|
var popoverContentRef = React.useRef(null);
|
|
37636
37652
|
var _useState = _sliced_to_array(React.useState(false), 2), showPopup = _useState[0], setShowPopup = _useState[1];
|
|
37637
|
-
var _useState1 = _sliced_to_array(React.useState(), 2),
|
|
37653
|
+
var _useState1 = _sliced_to_array(React.useState(), 2), wrapperPosition = _useState1[0], setWrapperPosition = _useState1[1];
|
|
37638
37654
|
React.useEffect(function() {
|
|
37639
37655
|
setShowPopup(visible);
|
|
37640
37656
|
if (visible) {
|
|
37641
37657
|
setTimeout(function() {
|
|
37642
|
-
|
|
37658
|
+
getWrapperPosition();
|
|
37643
37659
|
}, 0);
|
|
37644
37660
|
}
|
|
37645
37661
|
}, [
|
|
@@ -37647,25 +37663,10 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37647
37663
|
location
|
|
37648
37664
|
]);
|
|
37649
37665
|
var update2 = React.useRef(function(e2) {
|
|
37650
|
-
|
|
37666
|
+
getWrapperPosition();
|
|
37651
37667
|
});
|
|
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
37668
|
var targetSet = [];
|
|
37669
|
+
var element = null;
|
|
37669
37670
|
if (canUseDom && targetId) {
|
|
37670
37671
|
element = document.querySelector("#".concat(targetId));
|
|
37671
37672
|
targetSet = [
|
|
@@ -37678,39 +37679,59 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37678
37679
|
popoverContentRef.current
|
|
37679
37680
|
];
|
|
37680
37681
|
}
|
|
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
37682
|
var scrollableParents = React.useMemo(function() {
|
|
37686
37683
|
return getAllScrollableParents(element || popoverRef.current);
|
|
37687
37684
|
}, [
|
|
37688
37685
|
element,
|
|
37689
37686
|
popoverRef.current
|
|
37690
37687
|
]);
|
|
37691
|
-
|
|
37688
|
+
React.useEffect(function() {
|
|
37689
|
+
if (visible) {
|
|
37690
|
+
scrollableParents.forEach(function(parent2) {
|
|
37691
|
+
parent2.addEventListener("scroll", update2.current, {
|
|
37692
|
+
passive: true
|
|
37693
|
+
});
|
|
37694
|
+
});
|
|
37695
|
+
} else {
|
|
37696
|
+
scrollableParents.forEach(function(parent2) {
|
|
37697
|
+
return parent2.removeEventListener("scroll", update2.current);
|
|
37698
|
+
});
|
|
37699
|
+
}
|
|
37700
|
+
}, [
|
|
37701
|
+
visible
|
|
37702
|
+
]);
|
|
37703
|
+
useClickAway(function() {
|
|
37704
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
37705
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
37706
|
+
}, targetSet, "touchstart", true, visible, closeOnOutsideClick);
|
|
37707
|
+
var getWrapperPosition = function() {
|
|
37692
37708
|
var rect = getRect(targetId ? document.querySelector("#".concat(targetId)) : popoverRef.current);
|
|
37693
|
-
|
|
37694
|
-
|
|
37695
|
-
|
|
37696
|
-
|
|
37697
|
-
|
|
37698
|
-
|
|
37709
|
+
var distance = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
|
|
37710
|
+
var width2 = rect.width, height2 = rect.height, right = rect.right, left = rect.left, top = rect.top;
|
|
37711
|
+
setWrapperPosition({
|
|
37712
|
+
width: width2,
|
|
37713
|
+
height: height2,
|
|
37714
|
+
left: rtl ? right : left,
|
|
37715
|
+
top: top + distance,
|
|
37716
|
+
right: rtl ? left : right
|
|
37699
37717
|
});
|
|
37700
37718
|
};
|
|
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);
|
|
37719
|
+
var classes = classNames(classPrefix$b, _define_property({}, "".concat(classPrefix$b, "-").concat(theme), theme === "dark"), className);
|
|
37703
37720
|
var popoverArrow = function() {
|
|
37704
37721
|
var prefixCls2 = "nut-popover-arrow";
|
|
37705
|
-
|
|
37722
|
+
var direction = location.split("-")[0];
|
|
37723
|
+
return "".concat(prefixCls2, " ").concat(prefixCls2, "-").concat(direction, " ").concat(prefixCls2, "-").concat(location);
|
|
37706
37724
|
};
|
|
37707
|
-
var
|
|
37725
|
+
var getPopoverPosition = function() {
|
|
37708
37726
|
var _popoverContentRef_current, _popoverContentRef_current1;
|
|
37709
37727
|
var styles = {};
|
|
37710
|
-
if (!
|
|
37711
|
-
|
|
37712
|
-
|
|
37713
|
-
|
|
37728
|
+
if (!wrapperPosition) {
|
|
37729
|
+
styles.visibility = "hidden";
|
|
37730
|
+
return styles;
|
|
37731
|
+
}
|
|
37732
|
+
var popWidth = (_popoverContentRef_current = popoverContentRef.current) === null || _popoverContentRef_current === void 0 ? void 0 : _popoverContentRef_current.clientWidth;
|
|
37733
|
+
var popHeight = (_popoverContentRef_current1 = popoverContentRef.current) === null || _popoverContentRef_current1 === void 0 ? void 0 : _popoverContentRef_current1.clientHeight;
|
|
37734
|
+
var width2 = wrapperPosition.width, height2 = wrapperPosition.height, left = wrapperPosition.left, top = wrapperPosition.top, right = wrapperPosition.right;
|
|
37714
37735
|
var direction = location.split("-")[0];
|
|
37715
37736
|
var skew = location.split("-")[1];
|
|
37716
37737
|
var cross = 0;
|
|
@@ -37726,15 +37747,15 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37726
37747
|
"bottom",
|
|
37727
37748
|
"top"
|
|
37728
37749
|
].includes(direction)) {
|
|
37729
|
-
var h = direction === "bottom" ? height2 + cross : -(
|
|
37750
|
+
var h = direction === "bottom" ? height2 + cross : -(popHeight + cross);
|
|
37730
37751
|
styles.top = "".concat(top + h, "px");
|
|
37731
37752
|
if (!skew) {
|
|
37732
|
-
styles[dir] = "".concat(-(
|
|
37753
|
+
styles[dir] = "".concat(-(popWidth - width2) / 2 + wrapperPosition[dir] + parallel, "px");
|
|
37733
37754
|
}
|
|
37734
|
-
if (skew === "
|
|
37755
|
+
if (skew === "left") {
|
|
37735
37756
|
styles.left = "".concat(left + parallel, "px");
|
|
37736
37757
|
}
|
|
37737
|
-
if (skew === "
|
|
37758
|
+
if (skew === "right") {
|
|
37738
37759
|
styles.left = "".concat(right + parallel, "px");
|
|
37739
37760
|
}
|
|
37740
37761
|
}
|
|
@@ -37742,22 +37763,23 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37742
37763
|
"left",
|
|
37743
37764
|
"right"
|
|
37744
37765
|
].includes(direction)) {
|
|
37745
|
-
var contentW = direction === "left" ? -(
|
|
37766
|
+
var contentW = direction === "left" ? -(popWidth + cross) : width2 + cross;
|
|
37746
37767
|
styles.left = "".concat(left + contentW, "px");
|
|
37747
37768
|
if (!skew) {
|
|
37748
|
-
styles.top = "".concat(top -
|
|
37769
|
+
styles.top = "".concat(top - popHeight / 2 + height2 / 2 - 4 + parallel, "px");
|
|
37749
37770
|
}
|
|
37750
|
-
if (skew === "
|
|
37771
|
+
if (skew === "top") {
|
|
37751
37772
|
styles.top = "".concat(top + parallel, "px");
|
|
37752
37773
|
}
|
|
37753
|
-
if (skew === "
|
|
37774
|
+
if (skew === "bottom") {
|
|
37754
37775
|
styles.top = "".concat(top + height2 + parallel, "px");
|
|
37755
37776
|
}
|
|
37756
37777
|
}
|
|
37757
37778
|
}
|
|
37779
|
+
styles.visibility = popWidth === 0 ? "hidden" : "initial";
|
|
37758
37780
|
return styles;
|
|
37759
37781
|
};
|
|
37760
|
-
var
|
|
37782
|
+
var popoverArrowStyle = function() {
|
|
37761
37783
|
var styles = {};
|
|
37762
37784
|
var direction = location.split("-")[0];
|
|
37763
37785
|
var skew = location.split("-")[1];
|
|
@@ -37772,10 +37794,10 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37772
37794
|
if (!skew) {
|
|
37773
37795
|
styles[dir] = "calc(50% + ".concat(arrowOffset, "px)");
|
|
37774
37796
|
}
|
|
37775
|
-
if (skew === "
|
|
37797
|
+
if (skew === "left") {
|
|
37776
37798
|
styles[dir] = "".concat(base + arrowOffset, "px");
|
|
37777
37799
|
}
|
|
37778
|
-
if (skew === "
|
|
37800
|
+
if (skew === "right") {
|
|
37779
37801
|
styles[dir2] = "".concat(base - arrowOffset, "px");
|
|
37780
37802
|
}
|
|
37781
37803
|
}
|
|
@@ -37786,10 +37808,10 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37786
37808
|
if (!skew) {
|
|
37787
37809
|
styles.top = "calc(50% - ".concat(arrowOffset, "px)");
|
|
37788
37810
|
}
|
|
37789
|
-
if (skew === "
|
|
37811
|
+
if (skew === "top") {
|
|
37790
37812
|
styles.top = "".concat(base - arrowOffset, "px");
|
|
37791
37813
|
}
|
|
37792
|
-
if (skew === "
|
|
37814
|
+
if (skew === "bottom") {
|
|
37793
37815
|
styles.bottom = "".concat(base + arrowOffset, "px");
|
|
37794
37816
|
}
|
|
37795
37817
|
}
|
|
@@ -37798,28 +37820,28 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37798
37820
|
};
|
|
37799
37821
|
var handleSelect = function(item, index2) {
|
|
37800
37822
|
if (!item.disabled) {
|
|
37801
|
-
onSelect
|
|
37823
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(item, index2);
|
|
37802
37824
|
}
|
|
37803
37825
|
if (closeOnActionClick) {
|
|
37804
|
-
onClick
|
|
37805
|
-
onClose
|
|
37826
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
37827
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
37806
37828
|
}
|
|
37807
37829
|
};
|
|
37808
37830
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, !targetId && /* @__PURE__ */ React.createElement("div", {
|
|
37809
37831
|
className: "nut-popover-wrapper",
|
|
37810
37832
|
ref: popoverRef,
|
|
37811
37833
|
onClick: function() {
|
|
37812
|
-
onClick
|
|
37834
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
37813
37835
|
if (!visible) {
|
|
37814
|
-
onOpen
|
|
37836
|
+
onOpen === null || onOpen === void 0 ? void 0 : onOpen();
|
|
37815
37837
|
} else {
|
|
37816
|
-
onClose
|
|
37838
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
37817
37839
|
}
|
|
37818
37840
|
},
|
|
37819
37841
|
style
|
|
37820
37842
|
}, Array.isArray(children) ? children[0] : children), /* @__PURE__ */ ReactDOM.createPortal(/* @__PURE__ */ React.createElement("div", {
|
|
37821
37843
|
className: classes,
|
|
37822
|
-
style:
|
|
37844
|
+
style: _object_spread({}, getPopoverPosition(), style)
|
|
37823
37845
|
}, /* @__PURE__ */ React.createElement(Popup, _object_spread({
|
|
37824
37846
|
className: "nut-popover-content nut-popover-content-".concat(location),
|
|
37825
37847
|
visible: showPopup,
|
|
@@ -37831,29 +37853,30 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
37831
37853
|
ref: popoverContentRef
|
|
37832
37854
|
}, showArrow && /* @__PURE__ */ React.createElement("div", {
|
|
37833
37855
|
className: popoverArrow(),
|
|
37834
|
-
style:
|
|
37856
|
+
style: popoverArrowStyle()
|
|
37835
37857
|
}, /* @__PURE__ */ React.createElement(i$1, {
|
|
37836
37858
|
width: 8,
|
|
37837
37859
|
height: 4
|
|
37838
37860
|
})), Array.isArray(children) ? children[1] : null, list.map(function(item, index2) {
|
|
37861
|
+
var _item_action;
|
|
37839
37862
|
return /* @__PURE__ */ React.createElement("div", {
|
|
37840
37863
|
className: classNames({
|
|
37841
|
-
"nut-popover-
|
|
37842
|
-
"nut-popover-
|
|
37864
|
+
"nut-popover-item": true,
|
|
37865
|
+
"nut-popover-item-disabled": item.disabled
|
|
37843
37866
|
}, item.className),
|
|
37844
37867
|
key: item.key || index2,
|
|
37845
37868
|
onClick: function() {
|
|
37846
37869
|
return handleSelect(item, index2);
|
|
37847
37870
|
}
|
|
37848
37871
|
}, item.icon && /* @__PURE__ */ React.createElement("div", {
|
|
37849
|
-
className: "nut-popover-
|
|
37872
|
+
className: "nut-popover-item-icon"
|
|
37850
37873
|
}, item.icon), /* @__PURE__ */ React.createElement("div", {
|
|
37851
|
-
className: "nut-popover-
|
|
37852
|
-
}, item.name), item.action
|
|
37853
|
-
className: "nut-popover-
|
|
37874
|
+
className: "nut-popover-item-name"
|
|
37875
|
+
}, item.name), ((_item_action = item.action) === null || _item_action === void 0 ? void 0 : _item_action.icon) && /* @__PURE__ */ React.createElement("div", {
|
|
37876
|
+
className: "nut-popover-item-action-icon",
|
|
37854
37877
|
onClick: function(e2) {
|
|
37855
|
-
var _item_action_onClick,
|
|
37856
|
-
return (
|
|
37878
|
+
var _item_action_onClick, _item_action2;
|
|
37879
|
+
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
37880
|
}
|
|
37858
37881
|
}, item.action.icon));
|
|
37859
37882
|
})))), document.body));
|
|
@@ -38187,8 +38210,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
38187
38210
|
visible: false,
|
|
38188
38211
|
size: "normal",
|
|
38189
38212
|
shape: "round",
|
|
38190
|
-
duration: 0.6
|
|
38191
|
-
inline: false
|
|
38213
|
+
duration: 0.6
|
|
38192
38214
|
});
|
|
38193
38215
|
var Skeleton = function(props) {
|
|
38194
38216
|
var shapeStyle = function shapeStyle2() {
|
|
@@ -39389,57 +39411,50 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
39389
39411
|
expanded,
|
|
39390
39412
|
rotate
|
|
39391
39413
|
]);
|
|
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
|
-
}
|
|
39414
|
+
var _useState = _sliced_to_array(React.useState(0), 2), tran = _useState[0], setTran = _useState[1];
|
|
39415
|
+
var _useRefState = _sliced_to_array(useRefState(0), 2), currentHeight = _useRefState[0], setCurrentHeight = _useRefState[1];
|
|
39416
|
+
var _useState1 = _sliced_to_array(React.useState(0), 2), wrapperHeight = _useState1[0], setWrapperHeight = _useState1[1];
|
|
39417
|
+
var updateRectHeight = /* @__PURE__ */ function() {
|
|
39418
|
+
var _ref2 = _async_to_generator(function() {
|
|
39419
|
+
var height2;
|
|
39420
|
+
return __generator(this, function(_state) {
|
|
39421
|
+
height2 = contentRef.current.offsetHeight;
|
|
39422
|
+
setCurrentHeight(height2);
|
|
39423
|
+
setWrapperHeight(expanded ? height2 : 0);
|
|
39424
|
+
setTimeout(function() {
|
|
39425
|
+
setTran(1);
|
|
39426
|
+
});
|
|
39427
|
+
return [
|
|
39428
|
+
2
|
|
39429
|
+
];
|
|
39420
39430
|
});
|
|
39421
39431
|
});
|
|
39422
|
-
|
|
39423
|
-
|
|
39432
|
+
return function updateRectHeight2() {
|
|
39433
|
+
return _ref2.apply(this, arguments);
|
|
39434
|
+
};
|
|
39435
|
+
}();
|
|
39424
39436
|
React.useEffect(function() {
|
|
39425
|
-
|
|
39426
|
-
init.current = false;
|
|
39427
|
-
if (!expanded) {
|
|
39428
|
-
wrapperRef.current.style.height = "0px";
|
|
39429
|
-
}
|
|
39430
|
-
} else {
|
|
39431
|
-
toggle();
|
|
39432
|
-
}
|
|
39437
|
+
updateRectHeight();
|
|
39433
39438
|
}, [
|
|
39439
|
+
children,
|
|
39434
39440
|
expanded
|
|
39435
39441
|
]);
|
|
39442
|
+
var toggle = function() {
|
|
39443
|
+
var end = !expanded ? currentHeight.current : 0;
|
|
39444
|
+
setWrapperHeight(end);
|
|
39445
|
+
};
|
|
39446
|
+
var handleClick = function() {
|
|
39447
|
+
if (!disabled) {
|
|
39448
|
+
context2.updateValue(name2);
|
|
39449
|
+
toggle();
|
|
39450
|
+
}
|
|
39451
|
+
};
|
|
39452
|
+
var _obj;
|
|
39436
39453
|
return /* @__PURE__ */ React.createElement("div", _object_spread({
|
|
39437
39454
|
className: classNames(classPrefix2, className),
|
|
39438
39455
|
style
|
|
39439
39456
|
}, rest), /* @__PURE__ */ React.createElement("div", {
|
|
39440
|
-
className: classNames("".concat(classPrefix2, "-header"), {
|
|
39441
|
-
disabled
|
|
39442
|
-
}),
|
|
39457
|
+
className: classNames("".concat(classPrefix2, "-header"), _define_property({}, "".concat(classPrefix2, "-header-disabled"), disabled)),
|
|
39443
39458
|
onClick: handleClick
|
|
39444
39459
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
39445
39460
|
className: "".concat(classPrefix2, "-title")
|
|
@@ -39451,13 +39466,17 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
39451
39466
|
className: "".concat(classPrefix2, "-icon"),
|
|
39452
39467
|
style: iconStyle
|
|
39453
39468
|
}, expandIcon || context2.expandIcon))), /* @__PURE__ */ React.createElement("div", {
|
|
39454
|
-
className: "".concat(classPrefix2, "-content"),
|
|
39455
|
-
|
|
39469
|
+
className: classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-content-wrapper"), true), _define_property(_obj, "".concat(classPrefix2, "-content-wrapper-tran"), true), _obj)),
|
|
39470
|
+
style: tran ? {
|
|
39471
|
+
height: wrapperHeight
|
|
39472
|
+
} : {},
|
|
39456
39473
|
ref: wrapperRef
|
|
39474
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
39475
|
+
className: "".concat(classPrefix2, "-content")
|
|
39457
39476
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
39458
39477
|
ref: contentRef,
|
|
39459
39478
|
className: "".concat(classPrefix2, "-content-text")
|
|
39460
|
-
}, children)));
|
|
39479
|
+
}, children))));
|
|
39461
39480
|
};
|
|
39462
39481
|
CollapseItem.displayName = "NutCollapseItem";
|
|
39463
39482
|
var defaultProps$n = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
@@ -42863,6 +42882,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
42863
42882
|
exports.Video = Video;
|
|
42864
42883
|
exports.VirtualList = VirtualList;
|
|
42865
42884
|
exports.WaterMark = WaterMark;
|
|
42885
|
+
exports.destroyList = destroyList;
|
|
42866
42886
|
exports.getDefaultConfig = getDefaultConfig;
|
|
42867
42887
|
exports.setDefaultConfig = setDefaultConfig;
|
|
42868
42888
|
exports.useConfig = useConfig;
|