@univerjs/ui 0.4.0-alpha.1 → 0.4.0-experimental.20241017-da434a2
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/lib/es/index.js
CHANGED
|
@@ -9,9 +9,9 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
9
9
|
import { toDisposable, IUniverInstanceService, DocumentFlavor, useDependency, LocaleService, ColorKit, createIdentifier, Disposable, Workbook, UniverInstanceType, DocumentDataModel, SlideDataModel, remove, FOCUSING_UNIVER_EDITOR, IContextService, Inject, Injector, Tools, IConfigService, isRealNum, ErrorService, CommandType, IUndoRedoService, UndoCommand, RedoCommand, Optional, ICommandService, useInjector, ILogService, useObservable as useObservable$1, ThemeService, LifecycleService, connectInjector, isInternalEditorID, LifecycleStages, DependentOn, Plugin, mergeOverrideWithDependencies, ILocalStorageService, BaselineOffset, getBorderStyleType, BorderStyleTypes } from "@univerjs/core";
|
|
10
10
|
import * as React from "react";
|
|
11
11
|
import React__default, { forwardRef, useRef, createElement, cloneElement, useEffect, useState, useMemo, useCallback, memo, createContext, useContext, version as version$1, isValidElement, useLayoutEffect } from "react";
|
|
12
|
-
import { Observable, switchMap, BehaviorSubject, isObservable, fromEvent, Subject, combineLatest,
|
|
12
|
+
import { Observable, switchMap, BehaviorSubject, isObservable, fromEvent, Subject, combineLatest, distinctUntilChanged, throttleTime, animationFrameScheduler, filter, debounceTime, map as map$1, startWith, take, ReplaySubject } from "rxjs";
|
|
13
13
|
import { InputNumber, resizeObserverCtor, Menu as Menu$1, MenuItemGroup, MenuItem as MenuItem$1, SubMenu, MessageType, RectPopup, Popup, Tooltip, Dropdown, defaultTheme, themeInstance, ConfigProvider, ConfigContext, Confirm, Dialog, Message } from "@univerjs/design";
|
|
14
|
-
import { map
|
|
14
|
+
import { map } from "rxjs/operators";
|
|
15
15
|
import { IRenderManagerService, UniverRenderEnginePlugin, ptToPx } from "@univerjs/engine-render";
|
|
16
16
|
import ReactDOM$1, { createPortal } from "react-dom";
|
|
17
17
|
var __assign = function() {
|
|
@@ -1890,14 +1890,12 @@ function MenuWrapper(props) {
|
|
|
1890
1890
|
var _a19;
|
|
1891
1891
|
if (!item.children) return item;
|
|
1892
1892
|
let hasChildren = !1;
|
|
1893
|
-
const hiddenObservables = (_a19 = item.children) == null ? void 0 : _a19.map((
|
|
1893
|
+
const hiddenObservables = (_a19 = item.children) == null ? void 0 : _a19.map((subItem) => {
|
|
1894
1894
|
var _a20, _b;
|
|
1895
|
-
return (_b = (_a20 =
|
|
1895
|
+
return (_b = (_a20 = subItem.item) == null ? void 0 : _a20.hidden$) != null ? _b : new Observable((s) => (s.next(!1), s.unsubscribe()));
|
|
1896
1896
|
});
|
|
1897
|
-
return combineLatest(hiddenObservables).
|
|
1898
|
-
|
|
1899
|
-
).subscribe((allHidden) => {
|
|
1900
|
-
allHidden || (hasChildren = !0);
|
|
1897
|
+
return combineLatest(hiddenObservables).subscribe((hiddenValues) => {
|
|
1898
|
+
hasChildren = hiddenValues.every((hidden) => hidden === !0), hasChildren || (hasChildren = !0);
|
|
1901
1899
|
}).unsubscribe(), hasChildren;
|
|
1902
1900
|
}), [menuItems]);
|
|
1903
1901
|
return filteredMenuItems && filteredMenuItems.map((item) => {
|
|
@@ -2240,7 +2238,7 @@ function UndoMenuItemFactory(accessor) {
|
|
|
2240
2238
|
icon: "UndoSingle",
|
|
2241
2239
|
title: "Undo",
|
|
2242
2240
|
tooltip: "toolbar.undo",
|
|
2243
|
-
disabled$: undoRedoService.undoRedoStatus$.pipe(map
|
|
2241
|
+
disabled$: undoRedoService.undoRedoStatus$.pipe(map((v2) => v2.undos <= 0))
|
|
2244
2242
|
};
|
|
2245
2243
|
}
|
|
2246
2244
|
__name(UndoMenuItemFactory, "UndoMenuItemFactory");
|
|
@@ -2252,7 +2250,7 @@ function RedoMenuItemFactory(accessor) {
|
|
|
2252
2250
|
icon: "RedoSingle",
|
|
2253
2251
|
title: "Redo",
|
|
2254
2252
|
tooltip: "toolbar.redo",
|
|
2255
|
-
disabled$: undoRedoService.undoRedoStatus$.pipe(map
|
|
2253
|
+
disabled$: undoRedoService.undoRedoStatus$.pipe(map((v2) => v2.redos <= 0))
|
|
2256
2254
|
};
|
|
2257
2255
|
}
|
|
2258
2256
|
__name(RedoMenuItemFactory, "RedoMenuItemFactory");
|
|
@@ -2604,7 +2602,7 @@ ShortcutPanelController = __decorateClass$c([
|
|
|
2604
2602
|
__decorateParam$c(4, ICommandService)
|
|
2605
2603
|
], ShortcutPanelController);
|
|
2606
2604
|
const IUIController = createIdentifier("univer.ui.ui-controller");
|
|
2607
|
-
var render$1 = {}, interopRequireWildcard = { exports: {} }, _typeof$
|
|
2605
|
+
var render$1 = {}, interopRequireWildcard = { exports: {} }, _typeof$1 = { exports: {} };
|
|
2608
2606
|
(function(module) {
|
|
2609
2607
|
function _typeof3(o) {
|
|
2610
2608
|
"@babel/helpers - typeof";
|
|
@@ -2615,8 +2613,8 @@ var render$1 = {}, interopRequireWildcard = { exports: {} }, _typeof$2 = { expor
|
|
|
2615
2613
|
}, module.exports.__esModule = !0, module.exports.default = module.exports, _typeof3(o);
|
|
2616
2614
|
}
|
|
2617
2615
|
__name(_typeof3, "_typeof"), module.exports = _typeof3, module.exports.__esModule = !0, module.exports.default = module.exports;
|
|
2618
|
-
})(_typeof$
|
|
2619
|
-
var _typeofExports = _typeof$
|
|
2616
|
+
})(_typeof$1);
|
|
2617
|
+
var _typeofExports = _typeof$1.exports;
|
|
2620
2618
|
(function(module) {
|
|
2621
2619
|
var _typeof3 = _typeofExports.default;
|
|
2622
2620
|
function _getRequireWildcardCache(e2) {
|
|
@@ -2986,7 +2984,7 @@ var regeneratorRuntimeExports = regeneratorRuntime.exports, asyncToGenerator = {
|
|
|
2986
2984
|
}
|
|
2987
2985
|
__name(_asyncToGenerator, "_asyncToGenerator"), module.exports = _asyncToGenerator, module.exports.__esModule = !0, module.exports.default = module.exports;
|
|
2988
2986
|
})(asyncToGenerator);
|
|
2989
|
-
var asyncToGeneratorExports = asyncToGenerator.exports, objectSpread2 = { exports: {} }, defineProperty = { exports: {} }, toPropertyKey$
|
|
2987
|
+
var asyncToGeneratorExports = asyncToGenerator.exports, objectSpread2 = { exports: {} }, defineProperty = { exports: {} }, toPropertyKey$1 = { exports: {} }, toPrimitive$1 = { exports: {} };
|
|
2990
2988
|
(function(module) {
|
|
2991
2989
|
var _typeof3 = _typeofExports.default;
|
|
2992
2990
|
function toPrimitive2(t2, r2) {
|
|
@@ -3000,8 +2998,8 @@ var asyncToGeneratorExports = asyncToGenerator.exports, objectSpread2 = { export
|
|
|
3000
2998
|
return (r2 === "string" ? String : Number)(t2);
|
|
3001
2999
|
}
|
|
3002
3000
|
__name(toPrimitive2, "toPrimitive"), module.exports = toPrimitive2, module.exports.__esModule = !0, module.exports.default = module.exports;
|
|
3003
|
-
})(toPrimitive$
|
|
3004
|
-
var toPrimitiveExports = toPrimitive$
|
|
3001
|
+
})(toPrimitive$1);
|
|
3002
|
+
var toPrimitiveExports = toPrimitive$1.exports;
|
|
3005
3003
|
(function(module) {
|
|
3006
3004
|
var _typeof3 = _typeofExports.default, toPrimitive2 = toPrimitiveExports;
|
|
3007
3005
|
function toPropertyKey2(t2) {
|
|
@@ -3009,8 +3007,8 @@ var toPrimitiveExports = toPrimitive$2.exports;
|
|
|
3009
3007
|
return _typeof3(i) == "symbol" ? i : i + "";
|
|
3010
3008
|
}
|
|
3011
3009
|
__name(toPropertyKey2, "toPropertyKey"), module.exports = toPropertyKey2, module.exports.__esModule = !0, module.exports.default = module.exports;
|
|
3012
|
-
})(toPropertyKey$
|
|
3013
|
-
var toPropertyKeyExports = toPropertyKey$
|
|
3010
|
+
})(toPropertyKey$1);
|
|
3011
|
+
var toPropertyKeyExports = toPropertyKey$1.exports;
|
|
3014
3012
|
(function(module) {
|
|
3015
3013
|
var toPropertyKey2 = toPropertyKeyExports;
|
|
3016
3014
|
function _defineProperty2(e2, r2, t2) {
|
|
@@ -3056,7 +3054,7 @@ Object.defineProperty(render$1, "__esModule", {
|
|
|
3056
3054
|
});
|
|
3057
3055
|
render$1._r = _r;
|
|
3058
3056
|
render$1._u = _u;
|
|
3059
|
-
var render_2 = render$1.render = render, unmount_1 = render$1.unmount = unmount, _regeneratorRuntime2 = _interopRequireDefault(regeneratorRuntimeExports), _asyncToGenerator2 = _interopRequireDefault(asyncToGeneratorExports), _typeof2 = _interopRequireDefault(_typeofExports), _objectSpread2$
|
|
3057
|
+
var render_2 = render$1.render = render, unmount_1 = render$1.unmount = unmount, _regeneratorRuntime2 = _interopRequireDefault(regeneratorRuntimeExports), _asyncToGenerator2 = _interopRequireDefault(asyncToGeneratorExports), _typeof2 = _interopRequireDefault(_typeofExports), _objectSpread2$1 = _interopRequireDefault(objectSpread2Exports), ReactDOM = _interopRequireWildcard(ReactDOM$1), fullClone = (0, _objectSpread2$1.default)({}, ReactDOM), version = fullClone.version, reactRender = fullClone.render, unmountComponentAtNode = fullClone.unmountComponentAtNode, createRoot;
|
|
3060
3058
|
try {
|
|
3061
3059
|
var mainVersion = Number((version || "").split(".")[0]);
|
|
3062
3060
|
mainVersion >= 18 && (createRoot = fullClone.createRoot);
|
|
@@ -3356,7 +3354,7 @@ function useComponentsOfPart(part, injector) {
|
|
|
3356
3354
|
() => uiPartsService.componentRegistered$.pipe(
|
|
3357
3355
|
filter((key) => key === part),
|
|
3358
3356
|
debounceTime(200),
|
|
3359
|
-
map(() => updateCounterRef.current += 1),
|
|
3357
|
+
map$1(() => updateCounterRef.current += 1),
|
|
3360
3358
|
startWith(updateCounterRef.current += 1)
|
|
3361
3359
|
// trigger update when subscribe
|
|
3362
3360
|
),
|
|
@@ -3662,7 +3660,7 @@ function useToolbarGroups(categories, initCategory) {
|
|
|
3662
3660
|
var _a20;
|
|
3663
3661
|
return (_a20 = item.hidden$) != null ? _a20 : new Observable((observer) => observer.next(!1));
|
|
3664
3662
|
})
|
|
3665
|
-
).pipe(map((hiddenValues) => activeItems.filter((_, index) => !hiddenValues[index]))).subscribe((items) => setVisibleItems(items));
|
|
3663
|
+
).pipe(map$1((hiddenValues) => activeItems.filter((_, index) => !hiddenValues[index]))).subscribe((items) => setVisibleItems(items));
|
|
3666
3664
|
return () => s.unsubscribe();
|
|
3667
3665
|
}, [groups, category]), useEffect(() => {
|
|
3668
3666
|
const s = menuService.menuChanged$.subscribe(() => {
|
|
@@ -3941,7 +3939,22 @@ function Ribbon(props) {
|
|
|
3941
3939
|
visibleGroups,
|
|
3942
3940
|
hiddenGroups
|
|
3943
3941
|
};
|
|
3944
|
-
}, [ribbon, category, collapsedIds])
|
|
3942
|
+
}, [ribbon, category, collapsedIds]), fakeToolbarContent = useMemo(() => activeGroup.allGroups.map((groupItem) => {
|
|
3943
|
+
var _a19;
|
|
3944
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$7.toolbarGroup, children: (_a19 = groupItem.children) == null ? void 0 : _a19.map((child) => child.item && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3945
|
+
ToolbarItem,
|
|
3946
|
+
{
|
|
3947
|
+
ref: /* @__PURE__ */ __name((ref) => {
|
|
3948
|
+
toolbarItemRefs.current[child.key] = {
|
|
3949
|
+
el: ref == null ? void 0 : ref.nativeElement,
|
|
3950
|
+
key: child.key
|
|
3951
|
+
};
|
|
3952
|
+
}, "ref"),
|
|
3953
|
+
...child.item
|
|
3954
|
+
},
|
|
3955
|
+
child.key
|
|
3956
|
+
)) }, groupItem.key);
|
|
3957
|
+
}), [activeGroup.allGroups]);
|
|
3945
3958
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
3946
3959
|
hasHeaderMenu && /* @__PURE__ */ jsxRuntimeExports.jsxs("header", { className: styles$7.headerbar, children: [
|
|
3947
3960
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$7.menubar, children: ribbon.length > 1 && ribbon.map((group) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -3990,22 +4003,7 @@ function Ribbon(props) {
|
|
|
3990
4003
|
// left: 0,
|
|
3991
4004
|
// opacity: 1,
|
|
3992
4005
|
},
|
|
3993
|
-
children:
|
|
3994
|
-
var _a19;
|
|
3995
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$7.toolbarGroup, children: (_a19 = groupItem.children) == null ? void 0 : _a19.map((child) => child.item && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3996
|
-
ToolbarItem,
|
|
3997
|
-
{
|
|
3998
|
-
ref: /* @__PURE__ */ __name((ref) => {
|
|
3999
|
-
toolbarItemRefs.current[child.key] = {
|
|
4000
|
-
el: ref == null ? void 0 : ref.nativeElement,
|
|
4001
|
-
key: child.key
|
|
4002
|
-
};
|
|
4003
|
-
}, "ref"),
|
|
4004
|
-
...child.item
|
|
4005
|
-
},
|
|
4006
|
-
child.key
|
|
4007
|
-
)) }, groupItem.key);
|
|
4008
|
-
})
|
|
4006
|
+
children: fakeToolbarContent
|
|
4009
4007
|
}
|
|
4010
4008
|
)
|
|
4011
4009
|
] });
|
|
@@ -4727,7 +4725,7 @@ let DesktopConfirmService = (_a12 = class extends Disposable {
|
|
|
4727
4725
|
constructor(_injector, _uiPartsService) {
|
|
4728
4726
|
super();
|
|
4729
4727
|
__publicField(this, "_confirmOptions", []);
|
|
4730
|
-
__publicField(this, "confirmOptions$", new
|
|
4728
|
+
__publicField(this, "confirmOptions$", new BehaviorSubject([]));
|
|
4731
4729
|
this._injector = _injector, this._uiPartsService = _uiPartsService, this._initUIPart();
|
|
4732
4730
|
}
|
|
4733
4731
|
open(option) {
|
|
@@ -6455,42 +6453,42 @@ const _DesktopMessageService = class _DesktopMessageService {
|
|
|
6455
6453
|
};
|
|
6456
6454
|
__name(_DesktopMessageService, "DesktopMessageService");
|
|
6457
6455
|
let DesktopMessageService = _DesktopMessageService;
|
|
6458
|
-
function _arrayLikeToArray
|
|
6456
|
+
function _arrayLikeToArray(r2, a) {
|
|
6459
6457
|
(a == null || a > r2.length) && (a = r2.length);
|
|
6460
6458
|
for (var e2 = 0, n2 = Array(a); e2 < a; e2++) n2[e2] = r2[e2];
|
|
6461
6459
|
return n2;
|
|
6462
6460
|
}
|
|
6463
|
-
__name(_arrayLikeToArray
|
|
6461
|
+
__name(_arrayLikeToArray, "_arrayLikeToArray");
|
|
6464
6462
|
function _arrayWithoutHoles(r2) {
|
|
6465
|
-
if (Array.isArray(r2)) return _arrayLikeToArray
|
|
6463
|
+
if (Array.isArray(r2)) return _arrayLikeToArray(r2);
|
|
6466
6464
|
}
|
|
6467
6465
|
__name(_arrayWithoutHoles, "_arrayWithoutHoles");
|
|
6468
6466
|
function _iterableToArray(r2) {
|
|
6469
6467
|
if (typeof Symbol < "u" && r2[Symbol.iterator] != null || r2["@@iterator"] != null) return Array.from(r2);
|
|
6470
6468
|
}
|
|
6471
6469
|
__name(_iterableToArray, "_iterableToArray");
|
|
6472
|
-
function _unsupportedIterableToArray
|
|
6470
|
+
function _unsupportedIterableToArray(r2, a) {
|
|
6473
6471
|
if (r2) {
|
|
6474
|
-
if (typeof r2 == "string") return _arrayLikeToArray
|
|
6472
|
+
if (typeof r2 == "string") return _arrayLikeToArray(r2, a);
|
|
6475
6473
|
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
6476
|
-
return t2 === "Object" && r2.constructor && (t2 = r2.constructor.name), t2 === "Map" || t2 === "Set" ? Array.from(r2) : t2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray
|
|
6474
|
+
return t2 === "Object" && r2.constructor && (t2 = r2.constructor.name), t2 === "Map" || t2 === "Set" ? Array.from(r2) : t2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray(r2, a) : void 0;
|
|
6477
6475
|
}
|
|
6478
6476
|
}
|
|
6479
|
-
__name(_unsupportedIterableToArray
|
|
6477
|
+
__name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
|
|
6480
6478
|
function _nonIterableSpread() {
|
|
6481
6479
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
6482
6480
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
6483
6481
|
}
|
|
6484
6482
|
__name(_nonIterableSpread, "_nonIterableSpread");
|
|
6485
6483
|
function _toConsumableArray(r2) {
|
|
6486
|
-
return _arrayWithoutHoles(r2) || _iterableToArray(r2) || _unsupportedIterableToArray
|
|
6484
|
+
return _arrayWithoutHoles(r2) || _iterableToArray(r2) || _unsupportedIterableToArray(r2) || _nonIterableSpread();
|
|
6487
6485
|
}
|
|
6488
6486
|
__name(_toConsumableArray, "_toConsumableArray");
|
|
6489
|
-
function _arrayWithHoles
|
|
6487
|
+
function _arrayWithHoles(r2) {
|
|
6490
6488
|
if (Array.isArray(r2)) return r2;
|
|
6491
6489
|
}
|
|
6492
|
-
__name(_arrayWithHoles
|
|
6493
|
-
function _iterableToArrayLimit
|
|
6490
|
+
__name(_arrayWithHoles, "_arrayWithHoles");
|
|
6491
|
+
function _iterableToArrayLimit(r2, l2) {
|
|
6494
6492
|
var t2 = r2 == null ? null : typeof Symbol < "u" && r2[Symbol.iterator] || r2["@@iterator"];
|
|
6495
6493
|
if (t2 != null) {
|
|
6496
6494
|
var e2, n2, i, u2, a = [], f2 = !0, o = !1;
|
|
@@ -6511,16 +6509,16 @@ function _iterableToArrayLimit$1(r2, l2) {
|
|
|
6511
6509
|
return a;
|
|
6512
6510
|
}
|
|
6513
6511
|
}
|
|
6514
|
-
__name(_iterableToArrayLimit
|
|
6515
|
-
function _nonIterableRest
|
|
6512
|
+
__name(_iterableToArrayLimit, "_iterableToArrayLimit");
|
|
6513
|
+
function _nonIterableRest() {
|
|
6516
6514
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
6517
6515
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
6518
6516
|
}
|
|
6519
|
-
__name(_nonIterableRest
|
|
6520
|
-
function _slicedToArray
|
|
6521
|
-
return _arrayWithHoles
|
|
6517
|
+
__name(_nonIterableRest, "_nonIterableRest");
|
|
6518
|
+
function _slicedToArray(r2, e2) {
|
|
6519
|
+
return _arrayWithHoles(r2) || _iterableToArrayLimit(r2, e2) || _unsupportedIterableToArray(r2, e2) || _nonIterableRest();
|
|
6522
6520
|
}
|
|
6523
|
-
__name(_slicedToArray
|
|
6521
|
+
__name(_slicedToArray, "_slicedToArray");
|
|
6524
6522
|
function _objectWithoutPropertiesLoose(r2, e2) {
|
|
6525
6523
|
if (r2 == null) return {};
|
|
6526
6524
|
var t2 = {};
|
|
@@ -6541,41 +6539,41 @@ function _objectWithoutProperties(e2, t2) {
|
|
|
6541
6539
|
return i;
|
|
6542
6540
|
}
|
|
6543
6541
|
__name(_objectWithoutProperties, "_objectWithoutProperties");
|
|
6544
|
-
function _typeof
|
|
6542
|
+
function _typeof(o) {
|
|
6545
6543
|
"@babel/helpers - typeof";
|
|
6546
|
-
return _typeof
|
|
6544
|
+
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o2) {
|
|
6547
6545
|
return typeof o2;
|
|
6548
6546
|
} : function(o2) {
|
|
6549
6547
|
return o2 && typeof Symbol == "function" && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
6550
|
-
}, _typeof
|
|
6548
|
+
}, _typeof(o);
|
|
6551
6549
|
}
|
|
6552
|
-
__name(_typeof
|
|
6553
|
-
function toPrimitive
|
|
6554
|
-
if (_typeof
|
|
6550
|
+
__name(_typeof, "_typeof");
|
|
6551
|
+
function toPrimitive(t2, r2) {
|
|
6552
|
+
if (_typeof(t2) != "object" || !t2) return t2;
|
|
6555
6553
|
var e2 = t2[Symbol.toPrimitive];
|
|
6556
6554
|
if (e2 !== void 0) {
|
|
6557
6555
|
var i = e2.call(t2, r2 || "default");
|
|
6558
|
-
if (_typeof
|
|
6556
|
+
if (_typeof(i) != "object") return i;
|
|
6559
6557
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
6560
6558
|
}
|
|
6561
6559
|
return (r2 === "string" ? String : Number)(t2);
|
|
6562
6560
|
}
|
|
6563
|
-
__name(toPrimitive
|
|
6564
|
-
function toPropertyKey
|
|
6565
|
-
var i = toPrimitive
|
|
6566
|
-
return _typeof
|
|
6561
|
+
__name(toPrimitive, "toPrimitive");
|
|
6562
|
+
function toPropertyKey(t2) {
|
|
6563
|
+
var i = toPrimitive(t2, "string");
|
|
6564
|
+
return _typeof(i) == "symbol" ? i : i + "";
|
|
6567
6565
|
}
|
|
6568
|
-
__name(toPropertyKey
|
|
6569
|
-
function _defineProperty
|
|
6570
|
-
return (r2 = toPropertyKey
|
|
6566
|
+
__name(toPropertyKey, "toPropertyKey");
|
|
6567
|
+
function _defineProperty(e2, r2, t2) {
|
|
6568
|
+
return (r2 = toPropertyKey(r2)) in e2 ? Object.defineProperty(e2, r2, {
|
|
6571
6569
|
value: t2,
|
|
6572
6570
|
enumerable: !0,
|
|
6573
6571
|
configurable: !0,
|
|
6574
6572
|
writable: !0
|
|
6575
6573
|
}) : e2[r2] = t2, e2;
|
|
6576
6574
|
}
|
|
6577
|
-
__name(_defineProperty
|
|
6578
|
-
function ownKeys
|
|
6575
|
+
__name(_defineProperty, "_defineProperty");
|
|
6576
|
+
function ownKeys(e2, r2) {
|
|
6579
6577
|
var t2 = Object.keys(e2);
|
|
6580
6578
|
if (Object.getOwnPropertySymbols) {
|
|
6581
6579
|
var o = Object.getOwnPropertySymbols(e2);
|
|
@@ -6585,19 +6583,19 @@ function ownKeys$1(e2, r2) {
|
|
|
6585
6583
|
}
|
|
6586
6584
|
return t2;
|
|
6587
6585
|
}
|
|
6588
|
-
__name(ownKeys
|
|
6589
|
-
function _objectSpread2
|
|
6586
|
+
__name(ownKeys, "ownKeys");
|
|
6587
|
+
function _objectSpread2(e2) {
|
|
6590
6588
|
for (var r2 = 1; r2 < arguments.length; r2++) {
|
|
6591
6589
|
var t2 = arguments[r2] != null ? arguments[r2] : {};
|
|
6592
|
-
r2 % 2 ? ownKeys
|
|
6593
|
-
_defineProperty
|
|
6594
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys
|
|
6590
|
+
r2 % 2 ? ownKeys(Object(t2), !0).forEach(function(r3) {
|
|
6591
|
+
_defineProperty(e2, r3, t2[r3]);
|
|
6592
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r3) {
|
|
6595
6593
|
Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
|
|
6596
6594
|
});
|
|
6597
6595
|
}
|
|
6598
6596
|
return e2;
|
|
6599
6597
|
}
|
|
6600
|
-
__name(_objectSpread2
|
|
6598
|
+
__name(_objectSpread2, "_objectSpread2");
|
|
6601
6599
|
function _extends() {
|
|
6602
6600
|
return _extends = Object.assign ? Object.assign.bind() : function(n2) {
|
|
6603
6601
|
for (var e2 = 1; e2 < arguments.length; e2++) {
|
|
@@ -6648,15 +6646,6 @@ var classnames = { exports: {} };
|
|
|
6648
6646
|
})(classnames);
|
|
6649
6647
|
var classnamesExports = classnames.exports;
|
|
6650
6648
|
const clsx = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
6651
|
-
function _typeof(o) {
|
|
6652
|
-
"@babel/helpers - typeof";
|
|
6653
|
-
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o2) {
|
|
6654
|
-
return typeof o2;
|
|
6655
|
-
} : function(o2) {
|
|
6656
|
-
return o2 && typeof Symbol == "function" && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
6657
|
-
}, _typeof(o);
|
|
6658
|
-
}
|
|
6659
|
-
__name(_typeof, "_typeof");
|
|
6660
6649
|
function isDOM(node) {
|
|
6661
6650
|
return node instanceof HTMLElement || node instanceof SVGElement;
|
|
6662
6651
|
}
|
|
@@ -6797,7 +6786,7 @@ __name(_classCallCheck, "_classCallCheck");
|
|
|
6797
6786
|
function _defineProperties(e2, r2) {
|
|
6798
6787
|
for (var t2 = 0; t2 < r2.length; t2++) {
|
|
6799
6788
|
var o = r2[t2];
|
|
6800
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e2, toPropertyKey
|
|
6789
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e2, toPropertyKey(o.key), o);
|
|
6801
6790
|
}
|
|
6802
6791
|
}
|
|
6803
6792
|
__name(_defineProperties, "_defineProperties");
|
|
@@ -6849,7 +6838,7 @@ function _assertThisInitialized(e2) {
|
|
|
6849
6838
|
}
|
|
6850
6839
|
__name(_assertThisInitialized, "_assertThisInitialized");
|
|
6851
6840
|
function _possibleConstructorReturn(t2, e2) {
|
|
6852
|
-
if (e2 && (_typeof
|
|
6841
|
+
if (e2 && (_typeof(e2) == "object" || typeof e2 == "function")) return e2;
|
|
6853
6842
|
if (e2 !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
6854
6843
|
return _assertThisInitialized(t2);
|
|
6855
6844
|
}
|
|
@@ -6890,52 +6879,6 @@ function useEvent(callback) {
|
|
|
6890
6879
|
return memoFn;
|
|
6891
6880
|
}
|
|
6892
6881
|
__name(useEvent, "useEvent");
|
|
6893
|
-
function _arrayWithHoles(r2) {
|
|
6894
|
-
if (Array.isArray(r2)) return r2;
|
|
6895
|
-
}
|
|
6896
|
-
__name(_arrayWithHoles, "_arrayWithHoles");
|
|
6897
|
-
function _iterableToArrayLimit(r2, l2) {
|
|
6898
|
-
var t2 = r2 == null ? null : typeof Symbol < "u" && r2[Symbol.iterator] || r2["@@iterator"];
|
|
6899
|
-
if (t2 != null) {
|
|
6900
|
-
var e2, n2, i, u2, a = [], f2 = !0, o = !1;
|
|
6901
|
-
try {
|
|
6902
|
-
if (i = (t2 = t2.call(r2)).next, l2 !== 0) for (; !(f2 = (e2 = i.call(t2)).done) && (a.push(e2.value), a.length !== l2); f2 = !0) ;
|
|
6903
|
-
} catch (r3) {
|
|
6904
|
-
o = !0, n2 = r3;
|
|
6905
|
-
} finally {
|
|
6906
|
-
try {
|
|
6907
|
-
if (!f2 && t2.return != null && (u2 = t2.return(), Object(u2) !== u2)) return;
|
|
6908
|
-
} finally {
|
|
6909
|
-
if (o) throw n2;
|
|
6910
|
-
}
|
|
6911
|
-
}
|
|
6912
|
-
return a;
|
|
6913
|
-
}
|
|
6914
|
-
}
|
|
6915
|
-
__name(_iterableToArrayLimit, "_iterableToArrayLimit");
|
|
6916
|
-
function _arrayLikeToArray(r2, a) {
|
|
6917
|
-
(a == null || a > r2.length) && (a = r2.length);
|
|
6918
|
-
for (var e2 = 0, n2 = Array(a); e2 < a; e2++) n2[e2] = r2[e2];
|
|
6919
|
-
return n2;
|
|
6920
|
-
}
|
|
6921
|
-
__name(_arrayLikeToArray, "_arrayLikeToArray");
|
|
6922
|
-
function _unsupportedIterableToArray(r2, a) {
|
|
6923
|
-
if (r2) {
|
|
6924
|
-
if (typeof r2 == "string") return _arrayLikeToArray(r2, a);
|
|
6925
|
-
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
6926
|
-
return t2 === "Object" && r2.constructor && (t2 = r2.constructor.name), t2 === "Map" || t2 === "Set" ? Array.from(r2) : t2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray(r2, a) : void 0;
|
|
6927
|
-
}
|
|
6928
|
-
}
|
|
6929
|
-
__name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
|
|
6930
|
-
function _nonIterableRest() {
|
|
6931
|
-
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
6932
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
6933
|
-
}
|
|
6934
|
-
__name(_nonIterableRest, "_nonIterableRest");
|
|
6935
|
-
function _slicedToArray(r2, e2) {
|
|
6936
|
-
return _arrayWithHoles(r2) || _iterableToArrayLimit(r2, e2) || _unsupportedIterableToArray(r2, e2) || _nonIterableRest();
|
|
6937
|
-
}
|
|
6938
|
-
__name(_slicedToArray, "_slicedToArray");
|
|
6939
6882
|
function canUseDom() {
|
|
6940
6883
|
return !!(typeof window < "u" && window.document && window.document.createElement);
|
|
6941
6884
|
}
|
|
@@ -6953,54 +6896,6 @@ function useSafeState(defaultValue) {
|
|
|
6953
6896
|
return __name(safeSetState, "safeSetState"), [value, safeSetState];
|
|
6954
6897
|
}
|
|
6955
6898
|
__name(useSafeState, "useSafeState");
|
|
6956
|
-
function toPrimitive(t2, r2) {
|
|
6957
|
-
if (_typeof(t2) != "object" || !t2) return t2;
|
|
6958
|
-
var e2 = t2[Symbol.toPrimitive];
|
|
6959
|
-
if (e2 !== void 0) {
|
|
6960
|
-
var i = e2.call(t2, r2 || "default");
|
|
6961
|
-
if (_typeof(i) != "object") return i;
|
|
6962
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
6963
|
-
}
|
|
6964
|
-
return (r2 === "string" ? String : Number)(t2);
|
|
6965
|
-
}
|
|
6966
|
-
__name(toPrimitive, "toPrimitive");
|
|
6967
|
-
function toPropertyKey(t2) {
|
|
6968
|
-
var i = toPrimitive(t2, "string");
|
|
6969
|
-
return _typeof(i) == "symbol" ? i : i + "";
|
|
6970
|
-
}
|
|
6971
|
-
__name(toPropertyKey, "toPropertyKey");
|
|
6972
|
-
function _defineProperty(e2, r2, t2) {
|
|
6973
|
-
return (r2 = toPropertyKey(r2)) in e2 ? Object.defineProperty(e2, r2, {
|
|
6974
|
-
value: t2,
|
|
6975
|
-
enumerable: !0,
|
|
6976
|
-
configurable: !0,
|
|
6977
|
-
writable: !0
|
|
6978
|
-
}) : e2[r2] = t2, e2;
|
|
6979
|
-
}
|
|
6980
|
-
__name(_defineProperty, "_defineProperty");
|
|
6981
|
-
function ownKeys(e2, r2) {
|
|
6982
|
-
var t2 = Object.keys(e2);
|
|
6983
|
-
if (Object.getOwnPropertySymbols) {
|
|
6984
|
-
var o = Object.getOwnPropertySymbols(e2);
|
|
6985
|
-
r2 && (o = o.filter(function(r3) {
|
|
6986
|
-
return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
|
|
6987
|
-
})), t2.push.apply(t2, o);
|
|
6988
|
-
}
|
|
6989
|
-
return t2;
|
|
6990
|
-
}
|
|
6991
|
-
__name(ownKeys, "ownKeys");
|
|
6992
|
-
function _objectSpread2(e2) {
|
|
6993
|
-
for (var r2 = 1; r2 < arguments.length; r2++) {
|
|
6994
|
-
var t2 = arguments[r2] != null ? arguments[r2] : {};
|
|
6995
|
-
r2 % 2 ? ownKeys(Object(t2), !0).forEach(function(r3) {
|
|
6996
|
-
_defineProperty(e2, r3, t2[r3]);
|
|
6997
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r3) {
|
|
6998
|
-
Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
|
|
6999
|
-
});
|
|
7000
|
-
}
|
|
7001
|
-
return e2;
|
|
7002
|
-
}
|
|
7003
|
-
__name(_objectSpread2, "_objectSpread2");
|
|
7004
6899
|
function useSyncState(defaultValue) {
|
|
7005
6900
|
var _React$useReducer = React.useReducer(function(x) {
|
|
7006
6901
|
return x + 1;
|
|
@@ -7048,7 +6943,7 @@ __name(getVendorPrefixedEventName, "getVendorPrefixedEventName");
|
|
|
7048
6943
|
var internalAnimationEndName = getVendorPrefixedEventName("animationend"), internalTransitionEndName = getVendorPrefixedEventName("transitionend"), supportTransition = !!(internalAnimationEndName && internalTransitionEndName), animationEndName = internalAnimationEndName || "animationend", transitionEndName = internalTransitionEndName || "transitionend";
|
|
7049
6944
|
function getTransitionName(transitionName, transitionType) {
|
|
7050
6945
|
if (!transitionName) return null;
|
|
7051
|
-
if (_typeof
|
|
6946
|
+
if (_typeof(transitionName) === "object") {
|
|
7052
6947
|
var type = transitionType.replace(/-\w/g, function(match2) {
|
|
7053
6948
|
return match2[1].toUpperCase();
|
|
7054
6949
|
});
|
|
@@ -7137,7 +7032,7 @@ function isActive(step) {
|
|
|
7137
7032
|
}
|
|
7138
7033
|
__name(isActive, "isActive");
|
|
7139
7034
|
const useStepQueue = /* @__PURE__ */ __name(function(status, prepareOnly, callback) {
|
|
7140
|
-
var _useState = useSafeState(STEP_NONE), _useState2 = _slicedToArray
|
|
7035
|
+
var _useState = useSafeState(STEP_NONE), _useState2 = _slicedToArray(_useState, 2), step = _useState2[0], setStep = _useState2[1], _useNextFrame = useNextFrame(), _useNextFrame2 = _slicedToArray(_useNextFrame, 2), nextFrame = _useNextFrame2[0], cancelNextFrame = _useNextFrame2[1];
|
|
7141
7036
|
function startQueue() {
|
|
7142
7037
|
setStep(STEP_PREPARE, !0);
|
|
7143
7038
|
}
|
|
@@ -7160,7 +7055,7 @@ const useStepQueue = /* @__PURE__ */ __name(function(status, prepareOnly, callba
|
|
|
7160
7055
|
}, []), [startQueue, step];
|
|
7161
7056
|
}, "useStepQueue");
|
|
7162
7057
|
function useStatus(supportMotion, visible, getElement, _ref) {
|
|
7163
|
-
var _ref$motionEnter = _ref.motionEnter, motionEnter = _ref$motionEnter === void 0 ? !0 : _ref$motionEnter, _ref$motionAppear = _ref.motionAppear, motionAppear = _ref$motionAppear === void 0 ? !0 : _ref$motionAppear, _ref$motionLeave = _ref.motionLeave, motionLeave = _ref$motionLeave === void 0 ? !0 : _ref$motionLeave, motionDeadline = _ref.motionDeadline, motionLeaveImmediately = _ref.motionLeaveImmediately, onAppearPrepare = _ref.onAppearPrepare, onEnterPrepare = _ref.onEnterPrepare, onLeavePrepare = _ref.onLeavePrepare, onAppearStart = _ref.onAppearStart, onEnterStart = _ref.onEnterStart, onLeaveStart = _ref.onLeaveStart, onAppearActive = _ref.onAppearActive, onEnterActive = _ref.onEnterActive, onLeaveActive = _ref.onLeaveActive, onAppearEnd = _ref.onAppearEnd, onEnterEnd = _ref.onEnterEnd, onLeaveEnd = _ref.onLeaveEnd, onVisibleChanged = _ref.onVisibleChanged, _useState = useSafeState(), _useState2 = _slicedToArray
|
|
7058
|
+
var _ref$motionEnter = _ref.motionEnter, motionEnter = _ref$motionEnter === void 0 ? !0 : _ref$motionEnter, _ref$motionAppear = _ref.motionAppear, motionAppear = _ref$motionAppear === void 0 ? !0 : _ref$motionAppear, _ref$motionLeave = _ref.motionLeave, motionLeave = _ref$motionLeave === void 0 ? !0 : _ref$motionLeave, motionDeadline = _ref.motionDeadline, motionLeaveImmediately = _ref.motionLeaveImmediately, onAppearPrepare = _ref.onAppearPrepare, onEnterPrepare = _ref.onEnterPrepare, onLeavePrepare = _ref.onLeavePrepare, onAppearStart = _ref.onAppearStart, onEnterStart = _ref.onEnterStart, onLeaveStart = _ref.onLeaveStart, onAppearActive = _ref.onAppearActive, onEnterActive = _ref.onEnterActive, onLeaveActive = _ref.onLeaveActive, onAppearEnd = _ref.onAppearEnd, onEnterEnd = _ref.onEnterEnd, onLeaveEnd = _ref.onLeaveEnd, onVisibleChanged = _ref.onVisibleChanged, _useState = useSafeState(), _useState2 = _slicedToArray(_useState, 2), asyncVisible = _useState2[0], setAsyncVisible = _useState2[1], _useSyncState = useSyncState(STATUS_NONE), _useSyncState2 = _slicedToArray(_useSyncState, 2), getStatus = _useSyncState2[0], setStatus = _useSyncState2[1], _useState3 = useSafeState(null), _useState4 = _slicedToArray(_useState3, 2), style2 = _useState4[0], setStyle = _useState4[1], currentStatus = getStatus(), mountedRef = useRef(!1), deadlineRef = useRef(null);
|
|
7164
7059
|
function getDomElement() {
|
|
7165
7060
|
return getElement();
|
|
7166
7061
|
}
|
|
@@ -7179,14 +7074,14 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
7179
7074
|
status === STATUS_APPEAR && currentActive ? canEnd = onAppearEnd == null ? void 0 : onAppearEnd(element2, event) : status === STATUS_ENTER && currentActive ? canEnd = onEnterEnd == null ? void 0 : onEnterEnd(element2, event) : status === STATUS_LEAVE && currentActive && (canEnd = onLeaveEnd == null ? void 0 : onLeaveEnd(element2, event)), currentActive && canEnd !== !1 && updateMotionEndStatus();
|
|
7180
7075
|
}
|
|
7181
7076
|
}
|
|
7182
|
-
}), _useDomMotionEvents = useDomMotionEvents(onInternalMotionEnd), _useDomMotionEvents2 = _slicedToArray
|
|
7077
|
+
}), _useDomMotionEvents = useDomMotionEvents(onInternalMotionEnd), _useDomMotionEvents2 = _slicedToArray(_useDomMotionEvents, 1), patchMotionEvents = _useDomMotionEvents2[0], getEventHandlers = /* @__PURE__ */ __name(function(targetStatus) {
|
|
7183
7078
|
switch (targetStatus) {
|
|
7184
7079
|
case STATUS_APPEAR:
|
|
7185
|
-
return _defineProperty
|
|
7080
|
+
return _defineProperty(_defineProperty(_defineProperty({}, STEP_PREPARE, onAppearPrepare), STEP_START, onAppearStart), STEP_ACTIVE, onAppearActive);
|
|
7186
7081
|
case STATUS_ENTER:
|
|
7187
|
-
return _defineProperty
|
|
7082
|
+
return _defineProperty(_defineProperty(_defineProperty({}, STEP_PREPARE, onEnterPrepare), STEP_START, onEnterStart), STEP_ACTIVE, onEnterActive);
|
|
7188
7083
|
case STATUS_LEAVE:
|
|
7189
|
-
return _defineProperty
|
|
7084
|
+
return _defineProperty(_defineProperty(_defineProperty({}, STEP_PREPARE, onLeavePrepare), STEP_START, onLeaveStart), STEP_ACTIVE, onLeaveActive);
|
|
7190
7085
|
default:
|
|
7191
7086
|
return {};
|
|
7192
7087
|
}
|
|
@@ -7206,7 +7101,7 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
7206
7101
|
deadline: !0
|
|
7207
7102
|
});
|
|
7208
7103
|
}, motionDeadline))), step === STEP_PREPARED && updateMotionEndStatus(), DoStep;
|
|
7209
|
-
}), _useStepQueue2 = _slicedToArray
|
|
7104
|
+
}), _useStepQueue2 = _slicedToArray(_useStepQueue, 2), startStep = _useStepQueue2[0], step = _useStepQueue2[1], active = isActive(step);
|
|
7210
7105
|
activeRef.current = active, useIsomorphicLayoutEffect(function() {
|
|
7211
7106
|
setAsyncVisible(visible);
|
|
7212
7107
|
var isMounted = mountedRef.current;
|
|
@@ -7230,14 +7125,14 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
7230
7125
|
asyncVisible && (firstMountChangeRef.current = !0), asyncVisible !== void 0 && currentStatus === STATUS_NONE && ((firstMountChangeRef.current || asyncVisible) && (onVisibleChanged == null || onVisibleChanged(asyncVisible)), firstMountChangeRef.current = !0);
|
|
7231
7126
|
}, [asyncVisible, currentStatus]);
|
|
7232
7127
|
var mergedStyle = style2;
|
|
7233
|
-
return eventHandlers[STEP_PREPARE] && step === STEP_START && (mergedStyle = _objectSpread2
|
|
7128
|
+
return eventHandlers[STEP_PREPARE] && step === STEP_START && (mergedStyle = _objectSpread2({
|
|
7234
7129
|
transition: "none"
|
|
7235
7130
|
}, mergedStyle)), [currentStatus, step, mergedStyle, asyncVisible != null ? asyncVisible : visible];
|
|
7236
7131
|
}
|
|
7237
7132
|
__name(useStatus, "useStatus");
|
|
7238
7133
|
function genCSSMotion(config) {
|
|
7239
7134
|
var transitionSupport = config;
|
|
7240
|
-
_typeof
|
|
7135
|
+
_typeof(config) === "object" && (transitionSupport = config.transitionSupport);
|
|
7241
7136
|
function isSupportTransition(props, contextMotion) {
|
|
7242
7137
|
return !!(props.motionName && transitionSupport && contextMotion !== !1);
|
|
7243
7138
|
}
|
|
@@ -7252,19 +7147,19 @@ function genCSSMotion(config) {
|
|
|
7252
7147
|
}
|
|
7253
7148
|
}
|
|
7254
7149
|
__name(getDomElement, "getDomElement");
|
|
7255
|
-
var _useStatus = useStatus(supportMotion, visible, getDomElement, props), _useStatus2 = _slicedToArray
|
|
7150
|
+
var _useStatus = useStatus(supportMotion, visible, getDomElement, props), _useStatus2 = _slicedToArray(_useStatus, 4), status = _useStatus2[0], statusStep = _useStatus2[1], statusStyle = _useStatus2[2], mergedVisible = _useStatus2[3], renderedRef = React.useRef(mergedVisible);
|
|
7256
7151
|
mergedVisible && (renderedRef.current = !0);
|
|
7257
7152
|
var setNodeRef = React.useCallback(function(node) {
|
|
7258
7153
|
nodeRef.current = node, fillRef(ref, node);
|
|
7259
|
-
}, [ref]), motionChildren, mergedProps = _objectSpread2
|
|
7154
|
+
}, [ref]), motionChildren, mergedProps = _objectSpread2(_objectSpread2({}, eventProps), {}, {
|
|
7260
7155
|
visible
|
|
7261
7156
|
});
|
|
7262
7157
|
if (!children)
|
|
7263
7158
|
motionChildren = null;
|
|
7264
7159
|
else if (status === STATUS_NONE)
|
|
7265
|
-
mergedVisible ? motionChildren = children(_objectSpread2
|
|
7160
|
+
mergedVisible ? motionChildren = children(_objectSpread2({}, mergedProps), setNodeRef) : !removeOnLeave && renderedRef.current && leavedClassName ? motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, {
|
|
7266
7161
|
className: leavedClassName
|
|
7267
|
-
}), setNodeRef) : forceRender || !removeOnLeave && !leavedClassName ? motionChildren = children(_objectSpread2
|
|
7162
|
+
}), setNodeRef) : forceRender || !removeOnLeave && !leavedClassName ? motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, {
|
|
7268
7163
|
style: {
|
|
7269
7164
|
display: "none"
|
|
7270
7165
|
}
|
|
@@ -7273,8 +7168,8 @@ function genCSSMotion(config) {
|
|
|
7273
7168
|
var statusSuffix;
|
|
7274
7169
|
statusStep === STEP_PREPARE ? statusSuffix = "prepare" : isActive(statusStep) ? statusSuffix = "active" : statusStep === STEP_START && (statusSuffix = "start");
|
|
7275
7170
|
var motionCls = getTransitionName(motionName, "".concat(status, "-").concat(statusSuffix));
|
|
7276
|
-
motionChildren = children(_objectSpread2
|
|
7277
|
-
className: clsx(getTransitionName(motionName, status), _defineProperty
|
|
7171
|
+
motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, {
|
|
7172
|
+
className: clsx(getTransitionName(motionName, status), _defineProperty(_defineProperty({}, motionCls, motionCls && statusSuffix), motionName, typeof motionName == "string")),
|
|
7278
7173
|
style: statusStyle
|
|
7279
7174
|
}), setNodeRef);
|
|
7280
7175
|
}
|
|
@@ -7295,9 +7190,9 @@ const CSSMotion = genCSSMotion(supportTransition);
|
|
|
7295
7190
|
var STATUS_ADD = "add", STATUS_KEEP = "keep", STATUS_REMOVE = "remove", STATUS_REMOVED = "removed";
|
|
7296
7191
|
function wrapKeyToObject(key) {
|
|
7297
7192
|
var keyObj;
|
|
7298
|
-
return key && _typeof
|
|
7193
|
+
return key && _typeof(key) === "object" && "key" in key ? keyObj = key : keyObj = {
|
|
7299
7194
|
key
|
|
7300
|
-
}, _objectSpread2
|
|
7195
|
+
}, _objectSpread2(_objectSpread2({}, keyObj), {}, {
|
|
7301
7196
|
key: String(keyObj.key)
|
|
7302
7197
|
});
|
|
7303
7198
|
}
|
|
@@ -7314,20 +7209,20 @@ function diffKeys() {
|
|
|
7314
7209
|
var currentKeyObj = currentKeyObjects[i];
|
|
7315
7210
|
if (currentKeyObj.key === keyObj.key) {
|
|
7316
7211
|
currentIndex < i && (list = list.concat(currentKeyObjects.slice(currentIndex, i).map(function(obj) {
|
|
7317
|
-
return _objectSpread2
|
|
7212
|
+
return _objectSpread2(_objectSpread2({}, obj), {}, {
|
|
7318
7213
|
status: STATUS_ADD
|
|
7319
7214
|
});
|
|
7320
|
-
})), currentIndex = i), list.push(_objectSpread2
|
|
7215
|
+
})), currentIndex = i), list.push(_objectSpread2(_objectSpread2({}, currentKeyObj), {}, {
|
|
7321
7216
|
status: STATUS_KEEP
|
|
7322
7217
|
})), currentIndex += 1, hit = !0;
|
|
7323
7218
|
break;
|
|
7324
7219
|
}
|
|
7325
7220
|
}
|
|
7326
|
-
hit || list.push(_objectSpread2
|
|
7221
|
+
hit || list.push(_objectSpread2(_objectSpread2({}, keyObj), {}, {
|
|
7327
7222
|
status: STATUS_REMOVE
|
|
7328
7223
|
}));
|
|
7329
7224
|
}), currentIndex < currentLen && (list = list.concat(currentKeyObjects.slice(currentIndex).map(function(obj) {
|
|
7330
|
-
return _objectSpread2
|
|
7225
|
+
return _objectSpread2(_objectSpread2({}, obj), {}, {
|
|
7331
7226
|
status: STATUS_ADD
|
|
7332
7227
|
});
|
|
7333
7228
|
})));
|
|
@@ -7359,33 +7254,26 @@ function genCSSMotionList(transitionSupport) {
|
|
|
7359
7254
|
_classCallCheck(this, CSSMotionList3);
|
|
7360
7255
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)
|
|
7361
7256
|
args[_key] = arguments[_key];
|
|
7362
|
-
return _this = _super.call.apply(_super, [this].concat(args)), _defineProperty
|
|
7257
|
+
return _this = _super.call.apply(_super, [this].concat(args)), _defineProperty(_assertThisInitialized(_this), "state", {
|
|
7363
7258
|
keyEntities: []
|
|
7364
|
-
}), _defineProperty
|
|
7365
|
-
_this.
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
status: STATUS_REMOVED
|
|
7369
|
-
});
|
|
7259
|
+
}), _defineProperty(_assertThisInitialized(_this), "removeKey", function(removeKey) {
|
|
7260
|
+
var keyEntities = _this.state.keyEntities, nextKeyEntities = keyEntities.map(function(entity) {
|
|
7261
|
+
return entity.key !== removeKey ? entity : _objectSpread2(_objectSpread2({}, entity), {}, {
|
|
7262
|
+
status: STATUS_REMOVED
|
|
7370
7263
|
});
|
|
7371
|
-
return {
|
|
7372
|
-
keyEntities: nextKeyEntities
|
|
7373
|
-
};
|
|
7374
|
-
}, function() {
|
|
7375
|
-
var keyEntities = _this.state.keyEntities, restKeysCount = keyEntities.filter(function(_ref) {
|
|
7376
|
-
var status = _ref.status;
|
|
7377
|
-
return status !== STATUS_REMOVED;
|
|
7378
|
-
}).length;
|
|
7379
|
-
restKeysCount === 0 && _this.props.onAllRemoved && _this.props.onAllRemoved();
|
|
7380
7264
|
});
|
|
7265
|
+
return _this.setState({
|
|
7266
|
+
keyEntities: nextKeyEntities
|
|
7267
|
+
}), nextKeyEntities.filter(function(_ref) {
|
|
7268
|
+
var status = _ref.status;
|
|
7269
|
+
return status !== STATUS_REMOVED;
|
|
7270
|
+
}).length;
|
|
7381
7271
|
}), _this;
|
|
7382
7272
|
}
|
|
7383
7273
|
return __name(CSSMotionList3, "CSSMotionList"), _createClass(CSSMotionList3, [{
|
|
7384
7274
|
key: "render",
|
|
7385
7275
|
value: /* @__PURE__ */ __name(function() {
|
|
7386
|
-
var _this2 = this, keyEntities = this.state.keyEntities, _this$props = this.props, component = _this$props.component, children = _this$props.children, _onVisibleChanged = _this$props.onVisibleChanged;
|
|
7387
|
-
_this$props.onAllRemoved;
|
|
7388
|
-
var restProps = _objectWithoutProperties(_this$props, _excluded$2), Component = component || React.Fragment, motionProps = {};
|
|
7276
|
+
var _this2 = this, keyEntities = this.state.keyEntities, _this$props = this.props, component = _this$props.component, children = _this$props.children, _onVisibleChanged = _this$props.onVisibleChanged, onAllRemoved = _this$props.onAllRemoved, restProps = _objectWithoutProperties(_this$props, _excluded$2), Component = component || React.Fragment, motionProps = {};
|
|
7389
7277
|
return MOTION_PROP_NAMES.forEach(function(prop) {
|
|
7390
7278
|
motionProps[prop] = restProps[prop], delete restProps[prop];
|
|
7391
7279
|
}), delete restProps.keys, /* @__PURE__ */ React.createElement(Component, restProps, keyEntities.map(function(_ref2, index) {
|
|
@@ -7395,12 +7283,15 @@ function genCSSMotionList(transitionSupport) {
|
|
|
7395
7283
|
visible,
|
|
7396
7284
|
eventProps,
|
|
7397
7285
|
onVisibleChanged: /* @__PURE__ */ __name(function(changedVisible) {
|
|
7398
|
-
_onVisibleChanged == null || _onVisibleChanged(changedVisible, {
|
|
7286
|
+
if (_onVisibleChanged == null || _onVisibleChanged(changedVisible, {
|
|
7399
7287
|
key: eventProps.key
|
|
7400
|
-
}), changedVisible
|
|
7288
|
+
}), !changedVisible) {
|
|
7289
|
+
var restKeysCount = _this2.removeKey(eventProps.key);
|
|
7290
|
+
restKeysCount === 0 && onAllRemoved && onAllRemoved();
|
|
7291
|
+
}
|
|
7401
7292
|
}, "onVisibleChanged")
|
|
7402
7293
|
}), function(props, ref) {
|
|
7403
|
-
return children(_objectSpread2
|
|
7294
|
+
return children(_objectSpread2(_objectSpread2({}, props), {}, {
|
|
7404
7295
|
index
|
|
7405
7296
|
}), ref);
|
|
7406
7297
|
});
|
|
@@ -7422,7 +7313,7 @@ function genCSSMotionList(transitionSupport) {
|
|
|
7422
7313
|
}, "getDerivedStateFromProps")
|
|
7423
7314
|
}]), CSSMotionList3;
|
|
7424
7315
|
}(React.Component);
|
|
7425
|
-
return _defineProperty
|
|
7316
|
+
return _defineProperty(CSSMotionList2, "defaultProps", {
|
|
7426
7317
|
component: "div"
|
|
7427
7318
|
}), CSSMotionList2;
|
|
7428
7319
|
}
|
|
@@ -7982,7 +7873,7 @@ function pickAttrs(props) {
|
|
|
7982
7873
|
}
|
|
7983
7874
|
__name(pickAttrs, "pickAttrs");
|
|
7984
7875
|
var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
7985
|
-
var prefixCls = props.prefixCls, style2 = props.style, className = props.className, _props$duration = props.duration, duration = _props$duration === void 0 ? 4.5 : _props$duration, showProgress = props.showProgress, _props$pauseOnHover = props.pauseOnHover, pauseOnHover = _props$pauseOnHover === void 0 ? !0 : _props$pauseOnHover, eventKey = props.eventKey, content = props.content, closable = props.closable, _props$closeIcon = props.closeIcon, closeIcon = _props$closeIcon === void 0 ? "x" : _props$closeIcon, divProps = props.props, onClick = props.onClick, onNoticeClose = props.onNoticeClose, times = props.times, forcedHovering = props.hovering, _React$useState = React.useState(!1), _React$useState2 = _slicedToArray
|
|
7876
|
+
var prefixCls = props.prefixCls, style2 = props.style, className = props.className, _props$duration = props.duration, duration = _props$duration === void 0 ? 4.5 : _props$duration, showProgress = props.showProgress, _props$pauseOnHover = props.pauseOnHover, pauseOnHover = _props$pauseOnHover === void 0 ? !0 : _props$pauseOnHover, eventKey = props.eventKey, content = props.content, closable = props.closable, _props$closeIcon = props.closeIcon, closeIcon = _props$closeIcon === void 0 ? "x" : _props$closeIcon, divProps = props.props, onClick = props.onClick, onNoticeClose = props.onNoticeClose, times = props.times, forcedHovering = props.hovering, _React$useState = React.useState(!1), _React$useState2 = _slicedToArray(_React$useState, 2), hovering = _React$useState2[0], setHovering = _React$useState2[1], _React$useState3 = React.useState(0), _React$useState4 = _slicedToArray(_React$useState3, 2), percent = _React$useState4[0], setPercent = _React$useState4[1], _React$useState5 = React.useState(0), _React$useState6 = _slicedToArray(_React$useState5, 2), spentTime = _React$useState6[0], setSpentTime = _React$useState6[1], mergedHovering = forcedHovering || hovering, mergedShowProgress = duration > 0 && showProgress, onInternalClose = /* @__PURE__ */ __name(function() {
|
|
7986
7877
|
onNoticeClose(eventKey);
|
|
7987
7878
|
}, "onInternalClose"), onCloseKeyDown = /* @__PURE__ */ __name(function(e2) {
|
|
7988
7879
|
(e2.key === "Enter" || e2.code === "Enter" || e2.keyCode === KeyCode.ENTER) && onInternalClose();
|
|
@@ -8010,13 +7901,13 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8010
7901
|
}
|
|
8011
7902
|
}, [duration, spentTime, mergedHovering, mergedShowProgress, times]);
|
|
8012
7903
|
var closableObj = React.useMemo(function() {
|
|
8013
|
-
return _typeof
|
|
7904
|
+
return _typeof(closable) === "object" && closable !== null ? closable : closable ? {
|
|
8014
7905
|
closeIcon
|
|
8015
7906
|
} : {};
|
|
8016
7907
|
}, [closable, closeIcon]), ariaProps = pickAttrs(closableObj, !0), validPercent = 100 - (!percent || percent < 0 ? 0 : percent > 100 ? 100 : percent), noticePrefixCls = "".concat(prefixCls, "-notice");
|
|
8017
7908
|
return /* @__PURE__ */ React.createElement("div", _extends({}, divProps, {
|
|
8018
7909
|
ref,
|
|
8019
|
-
className: clsx(noticePrefixCls, className, _defineProperty
|
|
7910
|
+
className: clsx(noticePrefixCls, className, _defineProperty({}, "".concat(noticePrefixCls, "-closable"), closable)),
|
|
8020
7911
|
style: style2,
|
|
8021
7912
|
onMouseEnter: /* @__PURE__ */ __name(function(e2) {
|
|
8022
7913
|
var _divProps$onMouseEnte;
|
|
@@ -8049,18 +7940,18 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8049
7940
|
threshold: DEFAULT_THRESHOLD,
|
|
8050
7941
|
gap: DEFAULT_GAP
|
|
8051
7942
|
};
|
|
8052
|
-
if (config && _typeof
|
|
7943
|
+
if (config && _typeof(config) === "object") {
|
|
8053
7944
|
var _config$offset, _config$threshold, _config$gap;
|
|
8054
7945
|
result.offset = (_config$offset = config.offset) !== null && _config$offset !== void 0 ? _config$offset : DEFAULT_OFFSET, result.threshold = (_config$threshold = config.threshold) !== null && _config$threshold !== void 0 ? _config$threshold : DEFAULT_THRESHOLD, result.gap = (_config$gap = config.gap) !== null && _config$gap !== void 0 ? _config$gap : DEFAULT_GAP;
|
|
8055
7946
|
}
|
|
8056
7947
|
return [!!config, result];
|
|
8057
7948
|
}, "useStack"), _excluded$1 = ["className", "style", "classNames", "styles"], NoticeList = /* @__PURE__ */ __name(function(props) {
|
|
8058
|
-
var configList = props.configList, placement = props.placement, prefixCls = props.prefixCls, className = props.className, style2 = props.style, motion = props.motion, onAllNoticeRemoved = props.onAllNoticeRemoved, onNoticeClose = props.onNoticeClose, stackConfig = props.stack, _useContext = useContext(NotificationContext), ctxCls = _useContext.classNames, dictRef = useRef({}), _useState = useState(null), _useState2 = _slicedToArray
|
|
7949
|
+
var configList = props.configList, placement = props.placement, prefixCls = props.prefixCls, className = props.className, style2 = props.style, motion = props.motion, onAllNoticeRemoved = props.onAllNoticeRemoved, onNoticeClose = props.onNoticeClose, stackConfig = props.stack, _useContext = useContext(NotificationContext), ctxCls = _useContext.classNames, dictRef = useRef({}), _useState = useState(null), _useState2 = _slicedToArray(_useState, 2), latestNotice = _useState2[0], setLatestNotice = _useState2[1], _useState3 = useState([]), _useState4 = _slicedToArray(_useState3, 2), hoverKeys = _useState4[0], setHoverKeys = _useState4[1], keys = configList.map(function(config) {
|
|
8059
7950
|
return {
|
|
8060
7951
|
config,
|
|
8061
7952
|
key: String(config.key)
|
|
8062
7953
|
};
|
|
8063
|
-
}), _useStack = useStack(stackConfig), _useStack2 = _slicedToArray
|
|
7954
|
+
}), _useStack = useStack(stackConfig), _useStack2 = _slicedToArray(_useStack, 2), stack = _useStack2[0], _useStack2$ = _useStack2[1], offset = _useStack2$.offset, threshold = _useStack2$.threshold, gap = _useStack2$.gap, expanded = stack && (hoverKeys.length > 0 || keys.length <= threshold), placementMotion = typeof motion == "function" ? motion(placement) : motion;
|
|
8064
7955
|
return useEffect(function() {
|
|
8065
7956
|
stack && hoverKeys.length > 1 && setHoverKeys(function(prev) {
|
|
8066
7957
|
return prev.filter(function(key) {
|
|
@@ -8078,7 +7969,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8078
7969
|
}
|
|
8079
7970
|
}, [keys, stack]), /* @__PURE__ */ React__default.createElement(CSSMotionList, _extends({
|
|
8080
7971
|
key: placement,
|
|
8081
|
-
className: clsx(prefixCls, "".concat(prefixCls, "-").concat(placement), ctxCls == null ? void 0 : ctxCls.list, className, _defineProperty
|
|
7972
|
+
className: clsx(prefixCls, "".concat(prefixCls, "-").concat(placement), ctxCls == null ? void 0 : ctxCls.list, className, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-stack"), !!stack), "".concat(prefixCls, "-stack-expanded"), expanded)),
|
|
8082
7973
|
style: style2,
|
|
8083
7974
|
keys,
|
|
8084
7975
|
motionAppear: !0
|
|
@@ -8107,7 +7998,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8107
7998
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
8108
7999
|
ref: nodeRef,
|
|
8109
8000
|
className: clsx("".concat(prefixCls, "-notice-wrapper"), motionClassName, configClassNames == null ? void 0 : configClassNames.wrapper),
|
|
8110
|
-
style: _objectSpread2
|
|
8001
|
+
style: _objectSpread2(_objectSpread2(_objectSpread2({}, motionStyle), stackStyle), configStyles == null ? void 0 : configStyles.wrapper),
|
|
8111
8002
|
onMouseEnter: /* @__PURE__ */ __name(function() {
|
|
8112
8003
|
return setHoverKeys(function(prev) {
|
|
8113
8004
|
return prev.includes(strKey) ? prev : [].concat(_toConsumableArray(prev), [strKey]);
|
|
@@ -8137,7 +8028,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8137
8028
|
})));
|
|
8138
8029
|
});
|
|
8139
8030
|
}, "NoticeList2"), Notifications = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
8140
|
-
var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-notification" : _props$prefixCls, container = props.container, motion = props.motion, maxCount = props.maxCount, className = props.className, style2 = props.style, onAllRemoved = props.onAllRemoved, stack = props.stack, renderNotifications = props.renderNotifications, _React$useState = React.useState([]), _React$useState2 = _slicedToArray
|
|
8031
|
+
var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-notification" : _props$prefixCls, container = props.container, motion = props.motion, maxCount = props.maxCount, className = props.className, style2 = props.style, onAllRemoved = props.onAllRemoved, stack = props.stack, renderNotifications = props.renderNotifications, _React$useState = React.useState([]), _React$useState2 = _slicedToArray(_React$useState, 2), configList = _React$useState2[0], setConfigList = _React$useState2[1], onNoticeClose = /* @__PURE__ */ __name(function(key) {
|
|
8141
8032
|
var _config$onClose, config = configList.find(function(item) {
|
|
8142
8033
|
return item.key === key;
|
|
8143
8034
|
});
|
|
@@ -8153,7 +8044,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8153
8044
|
setConfigList(function(list) {
|
|
8154
8045
|
var clone = _toConsumableArray(list), index = clone.findIndex(function(item) {
|
|
8155
8046
|
return item.key === config.key;
|
|
8156
|
-
}), innerConfig = _objectSpread2
|
|
8047
|
+
}), innerConfig = _objectSpread2({}, config);
|
|
8157
8048
|
if (index >= 0) {
|
|
8158
8049
|
var _list$index;
|
|
8159
8050
|
innerConfig.times = (((_list$index = list[index]) === null || _list$index === void 0 ? void 0 : _list$index.times) || 0) + 1, clone[index] = innerConfig;
|
|
@@ -8170,7 +8061,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8170
8061
|
}, "destroy")
|
|
8171
8062
|
};
|
|
8172
8063
|
});
|
|
8173
|
-
var _React$useState3 = React.useState({}), _React$useState4 = _slicedToArray
|
|
8064
|
+
var _React$useState3 = React.useState({}), _React$useState4 = _slicedToArray(_React$useState3, 2), placements = _React$useState4[0], setPlacements = _React$useState4[1];
|
|
8174
8065
|
React.useEffect(function() {
|
|
8175
8066
|
var nextPlacements = {};
|
|
8176
8067
|
configList.forEach(function(config) {
|
|
@@ -8182,7 +8073,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8182
8073
|
}, [configList]);
|
|
8183
8074
|
var onAllNoticeRemoved = /* @__PURE__ */ __name(function(placement) {
|
|
8184
8075
|
setPlacements(function(originPlacements) {
|
|
8185
|
-
var clone = _objectSpread2
|
|
8076
|
+
var clone = _objectSpread2({}, originPlacements), list = clone[placement] || [];
|
|
8186
8077
|
return list.length || delete clone[placement], clone;
|
|
8187
8078
|
});
|
|
8188
8079
|
}, "onAllNoticeRemoved2"), emptyRef = React.useRef(!1);
|
|
@@ -8224,7 +8115,7 @@ function mergeConfig() {
|
|
|
8224
8115
|
}
|
|
8225
8116
|
__name(mergeConfig, "mergeConfig");
|
|
8226
8117
|
function useNotification() {
|
|
8227
|
-
var rootConfig = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _rootConfig$getContai = rootConfig.getContainer, getContainer = _rootConfig$getContai === void 0 ? defaultGetContainer : _rootConfig$getContai, motion = rootConfig.motion, prefixCls = rootConfig.prefixCls, maxCount = rootConfig.maxCount, className = rootConfig.className, style2 = rootConfig.style, onAllRemoved = rootConfig.onAllRemoved, stack = rootConfig.stack, renderNotifications = rootConfig.renderNotifications, shareConfig = _objectWithoutProperties(rootConfig, _excluded), _React$useState = React.useState(), _React$useState2 = _slicedToArray
|
|
8118
|
+
var rootConfig = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _rootConfig$getContai = rootConfig.getContainer, getContainer = _rootConfig$getContai === void 0 ? defaultGetContainer : _rootConfig$getContai, motion = rootConfig.motion, prefixCls = rootConfig.prefixCls, maxCount = rootConfig.maxCount, className = rootConfig.className, style2 = rootConfig.style, onAllRemoved = rootConfig.onAllRemoved, stack = rootConfig.stack, renderNotifications = rootConfig.renderNotifications, shareConfig = _objectWithoutProperties(rootConfig, _excluded), _React$useState = React.useState(), _React$useState2 = _slicedToArray(_React$useState, 2), container = _React$useState2[0], setContainer = _React$useState2[1], notificationsRef = React.useRef(), contextHolder = /* @__PURE__ */ React.createElement(Notifications, {
|
|
8228
8119
|
container,
|
|
8229
8120
|
ref: notificationsRef,
|
|
8230
8121
|
prefixCls,
|
|
@@ -8235,7 +8126,7 @@ function useNotification() {
|
|
|
8235
8126
|
onAllRemoved,
|
|
8236
8127
|
stack,
|
|
8237
8128
|
renderNotifications
|
|
8238
|
-
}), _React$useState3 = React.useState([]), _React$useState4 = _slicedToArray
|
|
8129
|
+
}), _React$useState3 = React.useState([]), _React$useState4 = _slicedToArray(_React$useState3, 2), taskQueue = _React$useState4[0], setTaskQueue = _React$useState4[1], api = React.useMemo(function() {
|
|
8239
8130
|
return {
|
|
8240
8131
|
open: /* @__PURE__ */ __name(function(config) {
|
|
8241
8132
|
var mergedConfig = mergeConfig(shareConfig, config);
|