shineout 3.9.1 → 3.9.2-beta.2
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 +148 -46
- 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.9.
|
|
525
|
+
version: '3.9.2-beta.2'
|
|
526
526
|
};
|
package/dist/shineout.js
CHANGED
|
@@ -12400,7 +12400,7 @@ var handleStyle = function handleStyle(style) {
|
|
|
12400
12400
|
};
|
|
12401
12401
|
/* harmony default export */ var jss_style_handleStyle = (handleStyle);
|
|
12402
12402
|
;// CONCATENATED MODULE: ../shineout-style/src/version.ts
|
|
12403
|
-
/* harmony default export */ var version = ('3.9.
|
|
12403
|
+
/* harmony default export */ var version = ('3.9.2-beta.2');
|
|
12404
12404
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
12405
12405
|
|
|
12406
12406
|
|
|
@@ -21325,17 +21325,21 @@ var menuStyle = {
|
|
|
21325
21325
|
flexDirection: 'row'
|
|
21326
21326
|
},
|
|
21327
21327
|
wrapperHasOpen: {},
|
|
21328
|
+
wrapperInlineAnimate: {},
|
|
21328
21329
|
children: {
|
|
21329
21330
|
padding: '0',
|
|
21330
21331
|
margin: '0',
|
|
21331
|
-
display: 'none',
|
|
21332
21332
|
minWidth: '100%',
|
|
21333
21333
|
whiteSpace: 'nowrap',
|
|
21334
|
-
'$
|
|
21334
|
+
'$childrenShow&': {
|
|
21335
21335
|
display: 'block'
|
|
21336
|
+
},
|
|
21337
|
+
'$childrenHidden&': {
|
|
21338
|
+
display: 'none'
|
|
21336
21339
|
}
|
|
21337
21340
|
},
|
|
21338
21341
|
childrenShow: {},
|
|
21342
|
+
childrenHidden: {},
|
|
21339
21343
|
childrenUp: {},
|
|
21340
21344
|
item: {
|
|
21341
21345
|
listStyle: 'none',
|
|
@@ -21344,6 +21348,7 @@ var menuStyle = {
|
|
|
21344
21348
|
itemActive: {},
|
|
21345
21349
|
itemDisabled: {},
|
|
21346
21350
|
itemOpen: {},
|
|
21351
|
+
itemClosing: {},
|
|
21347
21352
|
itemInPath: {},
|
|
21348
21353
|
itemHasChildren: {},
|
|
21349
21354
|
childrenHasExpand: {},
|
|
@@ -21629,8 +21634,14 @@ var menuStyle = {
|
|
|
21629
21634
|
alignItems: 'center',
|
|
21630
21635
|
display: 'flex',
|
|
21631
21636
|
minHeight: "calc(".concat(src.lineHeightDynamic, " + ").concat(src.menuTitlePaddingY, "*2)"),
|
|
21637
|
+
'$wrapperInlineAnimate$wrapper:not($wrapperVertical) &': {
|
|
21638
|
+
transition: 'transform 240ms cubic-bezier(.2,0,0,1)'
|
|
21639
|
+
},
|
|
21632
21640
|
'$wrapper:not($wrapperVertical) $itemOpen > $itemContent &': {
|
|
21633
21641
|
transform: 'rotate(180deg)'
|
|
21642
|
+
},
|
|
21643
|
+
'$wrapper:not($wrapperVertical) $itemClosing > $itemContent &': {
|
|
21644
|
+
transform: 'rotate(0deg)'
|
|
21634
21645
|
}
|
|
21635
21646
|
}
|
|
21636
21647
|
},
|
|
@@ -36740,6 +36751,26 @@ var getCompleteFieldKeys = function getCompleteFieldKeys(fields, allFields) {
|
|
|
36740
36751
|
return Array.from(new Set(completeFields));
|
|
36741
36752
|
};
|
|
36742
36753
|
|
|
36754
|
+
/**
|
|
36755
|
+
* 获取字段的所有父级key数组
|
|
36756
|
+
* @param field 字段key
|
|
36757
|
+
* @description 获取字段的所有父级key数组,并去掉数组下标部分, 结果按从近及远排序
|
|
36758
|
+
* @example a.b[0].c => ['a.b', 'a']
|
|
36759
|
+
*/
|
|
36760
|
+
var getParentKeys = function getParentKeys(field) {
|
|
36761
|
+
if (!field) return [];
|
|
36762
|
+
var parts = field.split('.');
|
|
36763
|
+
var parentKeys = [];
|
|
36764
|
+
for (var i = parts.length - 1; i > 0; i--) {
|
|
36765
|
+
var parentKey = parts.slice(0, i).join('.');
|
|
36766
|
+
var cleanedKey = parentKey.replace(/\[\d+\]/g, '');
|
|
36767
|
+
if (cleanedKey && !parentKeys.includes(cleanedKey)) {
|
|
36768
|
+
parentKeys.push(cleanedKey);
|
|
36769
|
+
}
|
|
36770
|
+
}
|
|
36771
|
+
return parentKeys;
|
|
36772
|
+
};
|
|
36773
|
+
|
|
36743
36774
|
/**
|
|
36744
36775
|
* 将对象中的所有值设置为空, 如果值是数组,重置为空数组,如果是对象,重置为空对象,如果是基础类型,重置为undefined
|
|
36745
36776
|
* @param obj 对象
|
|
@@ -44578,13 +44609,14 @@ function useFormControl(props) {
|
|
|
44578
44609
|
if (isArray(e)) {
|
|
44579
44610
|
e.forEach(function (error, index) {
|
|
44580
44611
|
if (error) {
|
|
44581
|
-
var
|
|
44582
|
-
|
|
44583
|
-
|
|
44584
|
-
|
|
44585
|
-
|
|
44586
|
-
|
|
44587
|
-
|
|
44612
|
+
var keys = Object.keys(error);
|
|
44613
|
+
keys.forEach(function (fieldName) {
|
|
44614
|
+
var fieldError = error === null || error === void 0 ? void 0 : error[fieldName];
|
|
44615
|
+
var na = "".concat(name, "[").concat(index, "].").concat(fieldName);
|
|
44616
|
+
if (fieldName && fieldError) {
|
|
44617
|
+
formFunc === null || formFunc === void 0 || formFunc.setError(na, fieldError);
|
|
44618
|
+
}
|
|
44619
|
+
});
|
|
44588
44620
|
}
|
|
44589
44621
|
});
|
|
44590
44622
|
} else {
|
|
@@ -50651,7 +50683,7 @@ var method = function method(type, jssStyle) {
|
|
|
50651
50683
|
});
|
|
50652
50684
|
if (!root) return;
|
|
50653
50685
|
var destroyModal = function destroyModal() {
|
|
50654
|
-
innerClose();
|
|
50686
|
+
if (innerClose) innerClose();
|
|
50655
50687
|
setTimeout(function () {
|
|
50656
50688
|
destroy(root);
|
|
50657
50689
|
}, 300);
|
|
@@ -52507,6 +52539,7 @@ var useForm = function useForm(props) {
|
|
|
52507
52539
|
ignoreValidateFields: [],
|
|
52508
52540
|
updateMap: {},
|
|
52509
52541
|
flowMap: {},
|
|
52542
|
+
rulesMap: {},
|
|
52510
52543
|
removeArr: new Set(),
|
|
52511
52544
|
names: new Set(),
|
|
52512
52545
|
submitLock: false,
|
|
@@ -52606,18 +52639,30 @@ var useForm = function useForm(props) {
|
|
|
52606
52639
|
var update = function update(name) {
|
|
52607
52640
|
var _context$flowMap$glob;
|
|
52608
52641
|
if (!name) {
|
|
52642
|
+
var needValidateParentKeys = new Set();
|
|
52609
52643
|
Object.keys(context.updateMap).forEach(function (key) {
|
|
52610
52644
|
var _context$updateMap$ke;
|
|
52611
|
-
(_context$updateMap$ke = context.updateMap[key]) === null || _context$updateMap$ke === void 0 || _context$updateMap$ke.forEach(function (
|
|
52612
|
-
|
|
52645
|
+
(_context$updateMap$ke = context.updateMap[key]) === null || _context$updateMap$ke === void 0 || _context$updateMap$ke.forEach(function (updateFn) {
|
|
52646
|
+
updateFn(context.value, context.errors, context.serverErrors);
|
|
52613
52647
|
if (context.errors[key]) {
|
|
52614
52648
|
validateFields(key).catch(function () {});
|
|
52649
|
+
getParentKeys(key).forEach(function (parentKey) {
|
|
52650
|
+
if (context.validateMap[parentKey] && context.rulesMap[parentKey]) {
|
|
52651
|
+
needValidateParentKeys.add(parentKey);
|
|
52652
|
+
}
|
|
52653
|
+
});
|
|
52615
52654
|
}
|
|
52616
52655
|
});
|
|
52617
52656
|
});
|
|
52657
|
+
// fix issue's playground id: 0898fabb-a1b4-4453-a2aa-f5a92e7777c0
|
|
52658
|
+
if (needValidateParentKeys.size > 0) {
|
|
52659
|
+
needValidateParentKeys.forEach(function (parentKey) {
|
|
52660
|
+
validateFields(parentKey).catch(function () {});
|
|
52661
|
+
});
|
|
52662
|
+
}
|
|
52618
52663
|
Object.keys(context.flowMap).forEach(function (key) {
|
|
52619
|
-
context.flowMap[key].forEach(function (
|
|
52620
|
-
|
|
52664
|
+
context.flowMap[key].forEach(function (updateFn) {
|
|
52665
|
+
updateFn();
|
|
52621
52666
|
});
|
|
52622
52667
|
});
|
|
52623
52668
|
} else {
|
|
@@ -52629,22 +52674,22 @@ var useForm = function useForm(props) {
|
|
|
52629
52674
|
if (!context.updateMap[key]) {
|
|
52630
52675
|
var _context$updateMap$pa;
|
|
52631
52676
|
var parentKey = key.split('.')[0];
|
|
52632
|
-
(_context$updateMap$pa = context.updateMap[parentKey]) === null || _context$updateMap$pa === void 0 || _context$updateMap$pa.forEach(function (
|
|
52633
|
-
|
|
52677
|
+
(_context$updateMap$pa = context.updateMap[parentKey]) === null || _context$updateMap$pa === void 0 || _context$updateMap$pa.forEach(function (updateFn) {
|
|
52678
|
+
updateFn(context.value, context.errors, context.serverErrors);
|
|
52634
52679
|
});
|
|
52635
52680
|
} else {
|
|
52636
52681
|
var _context$updateMap$ke2;
|
|
52637
|
-
(_context$updateMap$ke2 = context.updateMap[key]) === null || _context$updateMap$ke2 === void 0 || _context$updateMap$ke2.forEach(function (
|
|
52638
|
-
|
|
52682
|
+
(_context$updateMap$ke2 = context.updateMap[key]) === null || _context$updateMap$ke2 === void 0 || _context$updateMap$ke2.forEach(function (updateFn) {
|
|
52683
|
+
updateFn(context.value, context.errors, context.serverErrors);
|
|
52639
52684
|
});
|
|
52640
52685
|
}
|
|
52641
|
-
(_context$flowMap$key = context.flowMap[key]) === null || _context$flowMap$key === void 0 || _context$flowMap$key.forEach(function (
|
|
52642
|
-
|
|
52686
|
+
(_context$flowMap$key = context.flowMap[key]) === null || _context$flowMap$key === void 0 || _context$flowMap$key.forEach(function (updateFn) {
|
|
52687
|
+
updateFn();
|
|
52643
52688
|
});
|
|
52644
52689
|
});
|
|
52645
52690
|
}
|
|
52646
|
-
(_context$flowMap$glob = context.flowMap[globalKey]) === null || _context$flowMap$glob === void 0 || _context$flowMap$glob.forEach(function (
|
|
52647
|
-
|
|
52691
|
+
(_context$flowMap$glob = context.flowMap[globalKey]) === null || _context$flowMap$glob === void 0 || _context$flowMap$glob.forEach(function (updateFn) {
|
|
52692
|
+
updateFn();
|
|
52648
52693
|
});
|
|
52649
52694
|
};
|
|
52650
52695
|
var updateFieldsets = use_persist_fn(function (name) {
|
|
@@ -52975,6 +53020,7 @@ var useForm = function useForm(props) {
|
|
|
52975
53020
|
if (validateFieldSet.size === 0 && updateFieldSet.size === 0) {
|
|
52976
53021
|
context.names.delete(n);
|
|
52977
53022
|
delete context.defaultValues[n];
|
|
53023
|
+
delete context.rulesMap[n];
|
|
52978
53024
|
}
|
|
52979
53025
|
var finalReserveAble = (_props$reserveAble = props.reserveAble) !== null && _props$reserveAble !== void 0 ? _props$reserveAble : reserveAble;
|
|
52980
53026
|
if (!finalReserveAble && !context.removeLock) {
|
|
@@ -52989,22 +53035,25 @@ var useForm = function useForm(props) {
|
|
|
52989
53035
|
if (isArray(propRules)) {
|
|
52990
53036
|
newRules = newRules.concat(propRules);
|
|
52991
53037
|
}
|
|
53038
|
+
if (newRules.length > 0) {
|
|
53039
|
+
context.rulesMap[name] = newRules;
|
|
53040
|
+
}
|
|
52992
53041
|
return newRules;
|
|
52993
53042
|
},
|
|
52994
53043
|
watch: function watch() {
|
|
52995
53044
|
var names = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [globalKey];
|
|
52996
|
-
var
|
|
53045
|
+
var updateFn = arguments.length > 1 ? arguments[1] : undefined;
|
|
52997
53046
|
names.forEach(function (name) {
|
|
52998
53047
|
context.flowMap[name] = context.flowMap[name] || new Set();
|
|
52999
|
-
context.flowMap[name].add(
|
|
53048
|
+
context.flowMap[name].add(updateFn);
|
|
53000
53049
|
});
|
|
53001
53050
|
},
|
|
53002
53051
|
unWatch: function unWatch() {
|
|
53003
53052
|
var names = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [globalKey];
|
|
53004
|
-
var
|
|
53053
|
+
var updateFn = arguments.length > 1 ? arguments[1] : undefined;
|
|
53005
53054
|
names.forEach(function (name) {
|
|
53006
|
-
if (
|
|
53007
|
-
context.flowMap[name].delete(
|
|
53055
|
+
if (updateFn) {
|
|
53056
|
+
context.flowMap[name].delete(updateFn);
|
|
53008
53057
|
} else {
|
|
53009
53058
|
delete context.flowMap[name];
|
|
53010
53059
|
}
|
|
@@ -60472,16 +60521,18 @@ var useMenuItem = function useMenuItem(props) {
|
|
|
60472
60521
|
/* harmony default export */ var use_menu_item = (useMenuItem);
|
|
60473
60522
|
;// CONCATENATED MODULE: ../hooks/src/common/use-collapse-animation/use-collapse-animation.ts
|
|
60474
60523
|
|
|
60524
|
+
|
|
60475
60525
|
/**
|
|
60476
60526
|
* 为元素添加折叠/展开动画的 Hook
|
|
60477
60527
|
*
|
|
60478
60528
|
* @example
|
|
60479
60529
|
* ```tsx
|
|
60480
60530
|
* const ref = useRef<HTMLDivElement>(null);
|
|
60481
|
-
* useCollapseAnimation(ref, { isOpen: true });
|
|
60531
|
+
* const { shouldHide, shouldKeepOpen } = useCollapseAnimation(ref, { isOpen: true });
|
|
60482
60532
|
*
|
|
60483
|
-
* return <div ref={ref}>Content</div>;
|
|
60533
|
+
* return <div ref={ref} className={shouldHide ? 'hide' : ''}>Content</div>;
|
|
60484
60534
|
* ```
|
|
60535
|
+
* @returns 动画状态对象
|
|
60485
60536
|
*/
|
|
60486
60537
|
function useCollapseAnimation(elementRef, options) {
|
|
60487
60538
|
var isOpen = options.isOpen,
|
|
@@ -60490,8 +60541,17 @@ function useCollapseAnimation(elementRef, options) {
|
|
|
60490
60541
|
_options$disabled = options.disabled,
|
|
60491
60542
|
disabled = _options$disabled === void 0 ? false : _options$disabled,
|
|
60492
60543
|
_options$timingFuncti = options.timingFunction,
|
|
60493
|
-
timingFunction = _options$timingFuncti === void 0 ? 'cubic-bezier(.2,0,0,1)' : _options$timingFuncti
|
|
60544
|
+
timingFunction = _options$timingFuncti === void 0 ? 'cubic-bezier(.2,0,0,1)' : _options$timingFuncti,
|
|
60545
|
+
parentOpenClassName = options.parentOpenClassName;
|
|
60494
60546
|
var isFirstRenderRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(true);
|
|
60547
|
+
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(!isOpen),
|
|
60548
|
+
_useState2 = slicedToArray_default()(_useState, 2),
|
|
60549
|
+
shouldHide = _useState2[0],
|
|
60550
|
+
setShouldHide = _useState2[1];
|
|
60551
|
+
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
60552
|
+
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
60553
|
+
isAnimating = _useState4[0],
|
|
60554
|
+
setIsAnimating = _useState4[1];
|
|
60495
60555
|
|
|
60496
60556
|
// 当 disabled 状态变化时,重置首次渲染标记
|
|
60497
60557
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
@@ -60499,6 +60559,8 @@ function useCollapseAnimation(elementRef, options) {
|
|
|
60499
60559
|
isFirstRenderRef.current = true;
|
|
60500
60560
|
}
|
|
60501
60561
|
}, [disabled]);
|
|
60562
|
+
|
|
60563
|
+
// 使用 useLayoutEffect 确保动画状态在 DOM 更新前同步设置
|
|
60502
60564
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
60503
60565
|
if (!elementRef.current) return;
|
|
60504
60566
|
var el = elementRef.current;
|
|
@@ -60513,9 +60575,6 @@ function useCollapseAnimation(elementRef, options) {
|
|
|
60513
60575
|
}
|
|
60514
60576
|
var timer = null;
|
|
60515
60577
|
|
|
60516
|
-
// 设置 display: block,让元素始终可见,由高度控制折叠
|
|
60517
|
-
el.style.display = 'block';
|
|
60518
|
-
|
|
60519
60578
|
// 首次渲染时,直接设置初始状态,不做动画
|
|
60520
60579
|
if (isFirstRenderRef.current) {
|
|
60521
60580
|
isFirstRenderRef.current = false;
|
|
@@ -60526,9 +60585,13 @@ function useCollapseAnimation(elementRef, options) {
|
|
|
60526
60585
|
return;
|
|
60527
60586
|
}
|
|
60528
60587
|
if (isOpen) {
|
|
60529
|
-
// 展开动画
|
|
60588
|
+
// 展开动画 - 先显示元素
|
|
60589
|
+
setShouldHide(false);
|
|
60590
|
+
setIsAnimating(true);
|
|
60591
|
+
el.style.display = 'block';
|
|
60530
60592
|
el.style.height = '0px';
|
|
60531
60593
|
el.style.overflow = 'hidden';
|
|
60594
|
+
el.style.opacity = '0';
|
|
60532
60595
|
|
|
60533
60596
|
// 强制重绘
|
|
60534
60597
|
void el.offsetHeight;
|
|
@@ -60538,8 +60601,9 @@ function useCollapseAnimation(elementRef, options) {
|
|
|
60538
60601
|
|
|
60539
60602
|
// 启动动画
|
|
60540
60603
|
requestAnimationFrame(function () {
|
|
60541
|
-
el.style.transition = "height ".concat(duration, "ms ").concat(timingFunction);
|
|
60604
|
+
el.style.transition = "height ".concat(duration, "ms ").concat(timingFunction, ", opacity ").concat(duration, "ms ").concat(timingFunction);
|
|
60542
60605
|
el.style.height = "".concat(scrollHeight, "px");
|
|
60606
|
+
el.style.opacity = '1';
|
|
60543
60607
|
|
|
60544
60608
|
// 动画结束后恢复 auto
|
|
60545
60609
|
timer = setTimeout(function () {
|
|
@@ -60547,20 +60611,45 @@ function useCollapseAnimation(elementRef, options) {
|
|
|
60547
60611
|
el.style.height = '';
|
|
60548
60612
|
el.style.overflow = '';
|
|
60549
60613
|
el.style.transition = '';
|
|
60614
|
+
el.style.opacity = '';
|
|
60615
|
+
setIsAnimating(false);
|
|
60550
60616
|
}
|
|
60551
60617
|
}, duration);
|
|
60552
60618
|
});
|
|
60553
60619
|
} else {
|
|
60554
60620
|
// 收起动画
|
|
60621
|
+
setIsAnimating(true);
|
|
60622
|
+
|
|
60623
|
+
// 临时添加父元素的 open class,确保用户依赖此 class 的布局样式在获取高度时生效
|
|
60624
|
+
var parentElement = el.parentElement;
|
|
60625
|
+
var needTempClass = parentOpenClassName && parentElement;
|
|
60626
|
+
if (needTempClass) {
|
|
60627
|
+
parentElement.classList.add(parentOpenClassName);
|
|
60628
|
+
}
|
|
60629
|
+
|
|
60630
|
+
// 强制重绘,确保临时 class 生效
|
|
60631
|
+
void el.offsetHeight;
|
|
60555
60632
|
var _scrollHeight = el.scrollHeight;
|
|
60556
60633
|
el.style.height = "".concat(_scrollHeight, "px");
|
|
60557
60634
|
el.style.overflow = 'hidden';
|
|
60635
|
+
el.style.opacity = '1';
|
|
60558
60636
|
|
|
60559
60637
|
// 强制重绘
|
|
60560
60638
|
void el.offsetHeight;
|
|
60561
60639
|
requestAnimationFrame(function () {
|
|
60562
|
-
el.style.transition = "height ".concat(duration, "ms ").concat(timingFunction);
|
|
60640
|
+
el.style.transition = "height ".concat(duration, "ms ").concat(timingFunction, ", opacity ").concat(duration, "ms ").concat(timingFunction);
|
|
60563
60641
|
el.style.height = '0px';
|
|
60642
|
+
el.style.opacity = '0';
|
|
60643
|
+
|
|
60644
|
+
// 动画结束后隐藏元素
|
|
60645
|
+
timer = setTimeout(function () {
|
|
60646
|
+
// 移除临时 class
|
|
60647
|
+
if (needTempClass) {
|
|
60648
|
+
parentElement.classList.remove(parentOpenClassName);
|
|
60649
|
+
}
|
|
60650
|
+
setShouldHide(true);
|
|
60651
|
+
setIsAnimating(false);
|
|
60652
|
+
}, duration);
|
|
60564
60653
|
});
|
|
60565
60654
|
}
|
|
60566
60655
|
|
|
@@ -60571,6 +60660,16 @@ function useCollapseAnimation(elementRef, options) {
|
|
|
60571
60660
|
}
|
|
60572
60661
|
};
|
|
60573
60662
|
}, [isOpen, disabled, duration, timingFunction]);
|
|
60663
|
+
if (disabled) {
|
|
60664
|
+
return {
|
|
60665
|
+
shouldHide: !isOpen,
|
|
60666
|
+
shouldKeepOpen: false
|
|
60667
|
+
};
|
|
60668
|
+
}
|
|
60669
|
+
return {
|
|
60670
|
+
shouldHide: shouldHide,
|
|
60671
|
+
shouldKeepOpen: isAnimating && !isOpen
|
|
60672
|
+
};
|
|
60574
60673
|
}
|
|
60575
60674
|
;// CONCATENATED MODULE: ../base/src/menu/item.tsx
|
|
60576
60675
|
|
|
@@ -60644,10 +60743,13 @@ var MenuItem = function MenuItem(props) {
|
|
|
60644
60743
|
handleMouseLeave = _useMenuItem.handleMouseLeave;
|
|
60645
60744
|
|
|
60646
60745
|
// 为 inline 模式添加折叠动画(仅当 inlineAnimate 为 true 时启用)
|
|
60647
|
-
useCollapseAnimation(childrenRef, {
|
|
60648
|
-
|
|
60649
|
-
|
|
60650
|
-
|
|
60746
|
+
var _useCollapseAnimation = useCollapseAnimation(childrenRef, {
|
|
60747
|
+
isOpen: isOpen,
|
|
60748
|
+
disabled: !props.inlineAnimate || shoudPop || !children.length,
|
|
60749
|
+
parentOpenClassName: classes === null || classes === void 0 ? void 0 : classes.itemOpen
|
|
60750
|
+
}),
|
|
60751
|
+
shouldHideChildren = _useCollapseAnimation.shouldHide,
|
|
60752
|
+
shouldKeepOpen = _useCollapseAnimation.shouldKeepOpen;
|
|
60651
60753
|
var renderChildren = function renderChildren() {
|
|
60652
60754
|
var _items;
|
|
60653
60755
|
var items = children;
|
|
@@ -60662,8 +60764,8 @@ var MenuItem = function MenuItem(props) {
|
|
|
60662
60764
|
}
|
|
60663
60765
|
var content = function content(close) {
|
|
60664
60766
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("ul", {
|
|
60665
|
-
ref:
|
|
60666
|
-
className: classnames_default()(shoudPop && (classes === null || classes === void 0 ? void 0 : classes.childrenShow), classes === null || classes === void 0 ? void 0 : classes.children, isUp && (classes === null || classes === void 0 ? void 0 : classes.childrenUp), hasExpandAbleChildren && (classes === null || classes === void 0 ? void 0 : classes.childrenHasExpand))
|
|
60767
|
+
ref: childrenRef,
|
|
60768
|
+
className: classnames_default()(shoudPop && (classes === null || classes === void 0 ? void 0 : classes.childrenShow), classes === null || classes === void 0 ? void 0 : classes.children, isUp && (classes === null || classes === void 0 ? void 0 : classes.childrenUp), hasExpandAbleChildren && (classes === null || classes === void 0 ? void 0 : classes.childrenHasExpand), shouldHideChildren && (classes === null || classes === void 0 ? void 0 : classes.childrenHidden))
|
|
60667
60769
|
// 子菜单点击弹出
|
|
60668
60770
|
,
|
|
60669
60771
|
onClick: close,
|
|
@@ -60800,7 +60902,7 @@ var MenuItem = function MenuItem(props) {
|
|
|
60800
60902
|
}
|
|
60801
60903
|
};
|
|
60802
60904
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
60803
|
-
className: classnames_default()(classes === null || classes === void 0 ? void 0 : classes.item, isDisabled && (classes === null || classes === void 0 ? void 0 : classes.itemDisabled), isInPath && (classes === null || classes === void 0 ? void 0 : classes.itemInPath), (isOpen || popOpen) && (classes === null || classes === void 0 ? void 0 : classes.itemOpen), isChecked && (classes === null || classes === void 0 ? void 0 : classes.itemActive), expandAble && (classes === null || classes === void 0 ? void 0 : classes.itemHasChildren)),
|
|
60905
|
+
className: classnames_default()(classes === null || classes === void 0 ? void 0 : classes.item, isDisabled && (classes === null || classes === void 0 ? void 0 : classes.itemDisabled), isInPath && (classes === null || classes === void 0 ? void 0 : classes.itemInPath), (isOpen || popOpen || shouldKeepOpen) && (classes === null || classes === void 0 ? void 0 : classes.itemOpen), shouldKeepOpen && (classes === null || classes === void 0 ? void 0 : classes.itemClosing), isChecked && (classes === null || classes === void 0 ? void 0 : classes.itemActive), expandAble && (classes === null || classes === void 0 ? void 0 : classes.itemHasChildren)),
|
|
60804
60906
|
onMouseEnter: handleMouseEnter,
|
|
60805
60907
|
onMouseLeave: handleMouseLeave,
|
|
60806
60908
|
dir: config.direction,
|
|
@@ -60889,7 +60991,7 @@ var Menu = function Menu(props) {
|
|
|
60889
60991
|
}
|
|
60890
60992
|
}, [data, openKeys]);
|
|
60891
60993
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({
|
|
60892
|
-
className: classnames_default()(props.className, classes === null || classes === void 0 ? void 0 : classes.rootClass, classes === null || classes === void 0 ? void 0 : classes.wrapper, mode === 'inline' && (classes === null || classes === void 0 ? void 0 : classes.wrapperInline), (mode === 'vertical' || mode === 'vertical-auto') && (classes === null || classes === void 0 ? void 0 : classes.wrapperVertical), mode === 'horizontal' && (classes === null || classes === void 0 ? void 0 : classes.wrapperHorizontal), hasOpen && (classes === null || classes === void 0 ? void 0 : classes.wrapperHasOpen), theme === 'dark' ? classes === null || classes === void 0 ? void 0 : classes.wrapperDark : classes === null || classes === void 0 ? void 0 : classes.wrapperLight, collapse && (classes === null || classes === void 0 ? void 0 : classes.wrapperCollapse), context.inTransition && (classes === null || classes === void 0 ? void 0 : classes.wrapperInTransition))
|
|
60994
|
+
className: classnames_default()(props.className, classes === null || classes === void 0 ? void 0 : classes.rootClass, classes === null || classes === void 0 ? void 0 : classes.wrapper, mode === 'inline' && (classes === null || classes === void 0 ? void 0 : classes.wrapperInline), (mode === 'vertical' || mode === 'vertical-auto') && (classes === null || classes === void 0 ? void 0 : classes.wrapperVertical), mode === 'horizontal' && (classes === null || classes === void 0 ? void 0 : classes.wrapperHorizontal), hasOpen && (classes === null || classes === void 0 ? void 0 : classes.wrapperHasOpen), theme === 'dark' ? classes === null || classes === void 0 ? void 0 : classes.wrapperDark : classes === null || classes === void 0 ? void 0 : classes.wrapperLight, collapse && (classes === null || classes === void 0 ? void 0 : classes.wrapperCollapse), context.inTransition && (classes === null || classes === void 0 ? void 0 : classes.wrapperInTransition), props.inlineAnimate && (classes === null || classes === void 0 ? void 0 : classes.wrapperInlineAnimate))
|
|
60893
60995
|
}, getDataAttribute({
|
|
60894
60996
|
theme: theme,
|
|
60895
60997
|
mode: isVertical ? 'vertical' : mode
|
|
@@ -74423,7 +74525,7 @@ var upload_interface = __webpack_require__(8821);
|
|
|
74423
74525
|
|
|
74424
74526
|
|
|
74425
74527
|
/* harmony default export */ var src_0 = ({
|
|
74426
|
-
version: '3.9.
|
|
74528
|
+
version: '3.9.2-beta.2'
|
|
74427
74529
|
});
|
|
74428
74530
|
}();
|
|
74429
74531
|
/******/ return __webpack_exports__;
|