shineout 3.8.0-beta.43 → 3.8.0-beta.45
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/cjs/index.js +1 -1
- package/dist/shineout.js +58 -18
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/dist/shineout.min.js.map +1 -1
- package/esm/index.js +1 -1
- package/package.json +5 -5
package/cjs/index.js
CHANGED
|
@@ -522,5 +522,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
522
522
|
// 此文件由脚本自动生成,请勿直接修改。
|
|
523
523
|
// This file was generated automatically by a script. Please do not modify it directly.
|
|
524
524
|
var _default = exports.default = {
|
|
525
|
-
version: '3.8.0-beta.
|
|
525
|
+
version: '3.8.0-beta.45'
|
|
526
526
|
};
|
package/dist/shineout.js
CHANGED
|
@@ -12386,7 +12386,7 @@ var handleStyle = function handleStyle(style) {
|
|
|
12386
12386
|
};
|
|
12387
12387
|
/* harmony default export */ var jss_style_handleStyle = (handleStyle);
|
|
12388
12388
|
;// CONCATENATED MODULE: ../shineout-style/src/version.ts
|
|
12389
|
-
/* harmony default export */ var version = ('3.8.0-beta.
|
|
12389
|
+
/* harmony default export */ var version = ('3.8.0-beta.45');
|
|
12390
12390
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
12391
12391
|
|
|
12392
12392
|
|
|
@@ -42712,6 +42712,7 @@ var Cascader = function Cascader(props0) {
|
|
|
42712
42712
|
}
|
|
42713
42713
|
handleChange([]);
|
|
42714
42714
|
if (open) closePop();
|
|
42715
|
+
if (props.onClear) props.onClear();
|
|
42715
42716
|
};
|
|
42716
42717
|
var handleResultItemClick = function handleResultItemClick(e, item) {
|
|
42717
42718
|
e.stopPropagation();
|
|
@@ -49222,7 +49223,23 @@ function _ReactUnmount() {
|
|
|
49222
49223
|
|
|
49223
49224
|
|
|
49224
49225
|
|
|
49226
|
+
|
|
49225
49227
|
var hasMask = false;
|
|
49228
|
+
var modal_content_config = {
|
|
49229
|
+
instanceIds: []
|
|
49230
|
+
};
|
|
49231
|
+
var modal_content_state = createWithHooks(modal_content_config);
|
|
49232
|
+
var useModalConfig = function useModalConfig() {
|
|
49233
|
+
return modal_content_state.useSnapshot();
|
|
49234
|
+
};
|
|
49235
|
+
var addModalInstance = function addModalInstance(instanceId) {
|
|
49236
|
+
modal_content_state.mutate.instanceIds.push(instanceId);
|
|
49237
|
+
};
|
|
49238
|
+
var removeModalInstance = function removeModalInstance(instanceId) {
|
|
49239
|
+
modal_content_state.mutate.instanceIds = modal_content_state.mutate.instanceIds.filter(function (id) {
|
|
49240
|
+
return id !== instanceId;
|
|
49241
|
+
});
|
|
49242
|
+
};
|
|
49226
49243
|
var mousePosition = null;
|
|
49227
49244
|
var getClickPosition = function getClickPosition(e) {
|
|
49228
49245
|
mousePosition = {
|
|
@@ -49265,12 +49282,11 @@ var Modal = function Modal(props) {
|
|
|
49265
49282
|
mouseDownTarget: null,
|
|
49266
49283
|
mouseUpTarget: null,
|
|
49267
49284
|
content: null,
|
|
49268
|
-
originDocumentStyle:
|
|
49269
|
-
|
|
49270
|
-
paddingRight: ''
|
|
49271
|
-
}
|
|
49285
|
+
originDocumentStyle: null,
|
|
49286
|
+
instanceId: generateUUID()
|
|
49272
49287
|
}),
|
|
49273
49288
|
context = _useRef.current;
|
|
49289
|
+
var config = useModalConfig();
|
|
49274
49290
|
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(props.visible || props.autoShow),
|
|
49275
49291
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
49276
49292
|
animation = _useState4[0],
|
|
@@ -49285,6 +49301,10 @@ var Modal = function Modal(props) {
|
|
|
49285
49301
|
defaultHeight: height,
|
|
49286
49302
|
panelRef: panelRef
|
|
49287
49303
|
});
|
|
49304
|
+
var showMask = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
49305
|
+
if (props.forceMask) return config.instanceIds.includes(context.instanceId);
|
|
49306
|
+
return config.instanceIds[0] === context.instanceId;
|
|
49307
|
+
}, [config.instanceIds, props.forceMask]);
|
|
49288
49308
|
var rerender = useRender();
|
|
49289
49309
|
var handleMaskVisible = function handleMaskVisible() {
|
|
49290
49310
|
// 多个moal 只有第一个显示的时候才显示遮罩
|
|
@@ -49295,6 +49315,15 @@ var Modal = function Modal(props) {
|
|
|
49295
49315
|
rerender();
|
|
49296
49316
|
}
|
|
49297
49317
|
};
|
|
49318
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
49319
|
+
var index = config.instanceIds.indexOf(context.instanceId);
|
|
49320
|
+
if (visible && index === -1) {
|
|
49321
|
+
addModalInstance(context.instanceId);
|
|
49322
|
+
}
|
|
49323
|
+
if (!visible && index > -1 && !animation) {
|
|
49324
|
+
removeModalInstance(context.instanceId);
|
|
49325
|
+
}
|
|
49326
|
+
}, [visible, animation, config.instanceIds]);
|
|
49298
49327
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(handleMaskVisible, [visible]);
|
|
49299
49328
|
var updateOrigin = function updateOrigin() {
|
|
49300
49329
|
// 更新transform-origin
|
|
@@ -49372,9 +49401,11 @@ var Modal = function Modal(props) {
|
|
|
49372
49401
|
// 设置 document.body.style.overflow 和 document.body.style.paddingRight,并记录原始值到 context 中
|
|
49373
49402
|
var setDocumentOverflow = usePersistFn(function () {
|
|
49374
49403
|
var doc = document.body.parentNode;
|
|
49375
|
-
if (context.isMask) {
|
|
49376
|
-
context.originDocumentStyle
|
|
49377
|
-
|
|
49404
|
+
if (context.isMask && !context.originDocumentStyle) {
|
|
49405
|
+
context.originDocumentStyle = {
|
|
49406
|
+
overflow: doc.style.overflow,
|
|
49407
|
+
paddingRight: doc.style.paddingRight
|
|
49408
|
+
};
|
|
49378
49409
|
}
|
|
49379
49410
|
doc.style.overflow = 'hidden';
|
|
49380
49411
|
if (!doc.style.paddingRight) {
|
|
@@ -49385,19 +49416,21 @@ var Modal = function Modal(props) {
|
|
|
49385
49416
|
// 还原 document.body.style.overflow 和 document.body.style.paddingRight
|
|
49386
49417
|
var resetDocumentOverflow = usePersistFn(function () {
|
|
49387
49418
|
var doc = document.body.parentNode;
|
|
49388
|
-
|
|
49389
|
-
|
|
49419
|
+
if (context.originDocumentStyle) {
|
|
49420
|
+
doc.style.overflow = context.originDocumentStyle.overflow;
|
|
49421
|
+
doc.style.paddingRight = context.originDocumentStyle.paddingRight;
|
|
49422
|
+
}
|
|
49390
49423
|
});
|
|
49391
49424
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
49392
49425
|
if (!props.hideMask) {
|
|
49393
49426
|
if (visible) {
|
|
49394
49427
|
setDocumentOverflow();
|
|
49395
49428
|
} else {
|
|
49396
|
-
if (
|
|
49429
|
+
if (config.instanceIds.length && config.instanceIds[config.instanceIds.length - 1] === context.instanceId) return;
|
|
49397
49430
|
resetDocumentOverflow();
|
|
49398
49431
|
}
|
|
49399
49432
|
}
|
|
49400
|
-
}, [visible]);
|
|
49433
|
+
}, [visible, config.instanceIds]);
|
|
49401
49434
|
var canDestroy = !visible && !animation;
|
|
49402
49435
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
49403
49436
|
var _props$shouldDestroy;
|
|
@@ -49408,6 +49441,7 @@ var Modal = function Modal(props) {
|
|
|
49408
49441
|
// unmount
|
|
49409
49442
|
return function () {
|
|
49410
49443
|
var _props$shouldDestroy2;
|
|
49444
|
+
removeModalInstance(context.instanceId);
|
|
49411
49445
|
if (context.isMask) {
|
|
49412
49446
|
resetDocumentOverflow();
|
|
49413
49447
|
}
|
|
@@ -49537,7 +49571,7 @@ var Modal = function Modal(props) {
|
|
|
49537
49571
|
onClick: function onClick(e) {
|
|
49538
49572
|
e.stopPropagation();
|
|
49539
49573
|
},
|
|
49540
|
-
className: classnames_default()(props.rootClassName, modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.rootClass, modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapper, animation && (modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapperAnimation), visible ? modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapperShow : modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapperHide,
|
|
49574
|
+
className: classnames_default()(props.rootClassName, modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.rootClass, modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapper, animation && (modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapperAnimation), visible ? modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapperShow : modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapperHide, showMask && (modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapperIsMask), props.fullScreen && (modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapperFullScreen), props.moveable && (modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapperMoveable), props.hideMask && (modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapperHideMask), props.zoom && !props.moveable && (modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapperZoom), (isPositionX || isPositionY) && (modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapperDrawer), props.position === 'left' && (modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapperDrawerLeft), props.position === 'right' && (modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapperDrawerRight), props.position === 'top' && (modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapperDrawerTop), props.position === 'bottom' && (modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.wrapperDrawerBottom)),
|
|
49541
49575
|
onAnimationEnd: handleAnimationEnd,
|
|
49542
49576
|
style: {
|
|
49543
49577
|
background: props.maskBackground,
|
|
@@ -57643,20 +57677,24 @@ function Select(props0) {
|
|
|
57643
57677
|
if (!open) return;
|
|
57644
57678
|
setControlType('keyboard');
|
|
57645
57679
|
switch (e.keyCode || e.code) {
|
|
57646
|
-
case 38
|
|
57680
|
+
case 38:
|
|
57681
|
+
case 'ArrowUp':
|
|
57647
57682
|
if ((_optionListRef$curren3 = optionListRef.current) !== null && _optionListRef$curren3 !== void 0 && _optionListRef$curren3.hoverHover) (_optionListRef$curren4 = optionListRef.current) === null || _optionListRef$curren4 === void 0 || _optionListRef$curren4.hoverMove(-1);
|
|
57648
57683
|
e.preventDefault();
|
|
57649
57684
|
break;
|
|
57650
|
-
case 40
|
|
57685
|
+
case 40:
|
|
57686
|
+
case 'ArrowDown':
|
|
57651
57687
|
if ((_optionListRef$curren5 = optionListRef.current) !== null && _optionListRef$curren5 !== void 0 && _optionListRef$curren5.hoverHover) (_optionListRef$curren6 = optionListRef.current) === null || _optionListRef$curren6 === void 0 || _optionListRef$curren6.hoverMove(1);
|
|
57652
57688
|
e.preventDefault();
|
|
57653
57689
|
break;
|
|
57654
|
-
case 13
|
|
57690
|
+
case 13:
|
|
57691
|
+
case 'Enter':
|
|
57655
57692
|
handleEnter();
|
|
57656
57693
|
e.preventDefault();
|
|
57657
57694
|
e.stopPropagation();
|
|
57658
57695
|
break;
|
|
57659
|
-
case 8
|
|
57696
|
+
case 8:
|
|
57697
|
+
case 'Backspace':
|
|
57660
57698
|
handleDelete(e);
|
|
57661
57699
|
break;
|
|
57662
57700
|
}
|
|
@@ -57669,6 +57707,7 @@ function Select(props0) {
|
|
|
57669
57707
|
onFilter === null || onFilter === void 0 || onFilter('');
|
|
57670
57708
|
}
|
|
57671
57709
|
if (open) closePop();
|
|
57710
|
+
if (props.onClear) props.onClear();
|
|
57672
57711
|
};
|
|
57673
57712
|
var getRenderResult = function getRenderResult(data, index) {
|
|
57674
57713
|
if (!renderResultProp) return renderItem(data, index);
|
|
@@ -68842,6 +68881,7 @@ var TreeSelect = function TreeSelect(props0) {
|
|
|
68842
68881
|
});
|
|
68843
68882
|
}
|
|
68844
68883
|
if (open) closePop();
|
|
68884
|
+
if (props.onClear) props.onClear();
|
|
68845
68885
|
};
|
|
68846
68886
|
var renderClearable = function renderClearable() {
|
|
68847
68887
|
if (!multiple !== undefined && !showArrow) return null;
|
|
@@ -72959,7 +72999,7 @@ var upload_interface = __webpack_require__(8821);
|
|
|
72959
72999
|
|
|
72960
73000
|
|
|
72961
73001
|
/* harmony default export */ var src_0 = ({
|
|
72962
|
-
version: '3.8.0-beta.
|
|
73002
|
+
version: '3.8.0-beta.45'
|
|
72963
73003
|
});
|
|
72964
73004
|
}();
|
|
72965
73005
|
/******/ return __webpack_exports__;
|