@univerjs/ui 0.4.0-nightly.202410171606 → 0.4.1
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/LICENSE +176 -0
- package/lib/cjs/index.js +8 -7
- package/lib/es/index.js +194 -91
- package/lib/umd/index.js +8 -7
- package/package.json +6 -6
package/lib/es/index.js
CHANGED
|
@@ -2602,7 +2602,7 @@ ShortcutPanelController = __decorateClass$c([
|
|
|
2602
2602
|
__decorateParam$c(4, ICommandService)
|
|
2603
2603
|
], ShortcutPanelController);
|
|
2604
2604
|
const IUIController = createIdentifier("univer.ui.ui-controller");
|
|
2605
|
-
var render$1 = {}, interopRequireWildcard = { exports: {} }, _typeof$
|
|
2605
|
+
var render$1 = {}, interopRequireWildcard = { exports: {} }, _typeof$2 = { exports: {} };
|
|
2606
2606
|
(function(module) {
|
|
2607
2607
|
function _typeof3(o) {
|
|
2608
2608
|
"@babel/helpers - typeof";
|
|
@@ -2613,8 +2613,8 @@ var render$1 = {}, interopRequireWildcard = { exports: {} }, _typeof$1 = { expor
|
|
|
2613
2613
|
}, module.exports.__esModule = !0, module.exports.default = module.exports, _typeof3(o);
|
|
2614
2614
|
}
|
|
2615
2615
|
__name(_typeof3, "_typeof"), module.exports = _typeof3, module.exports.__esModule = !0, module.exports.default = module.exports;
|
|
2616
|
-
})(_typeof$
|
|
2617
|
-
var _typeofExports = _typeof$
|
|
2616
|
+
})(_typeof$2);
|
|
2617
|
+
var _typeofExports = _typeof$2.exports;
|
|
2618
2618
|
(function(module) {
|
|
2619
2619
|
var _typeof3 = _typeofExports.default;
|
|
2620
2620
|
function _getRequireWildcardCache(e2) {
|
|
@@ -2984,7 +2984,7 @@ var regeneratorRuntimeExports = regeneratorRuntime.exports, asyncToGenerator = {
|
|
|
2984
2984
|
}
|
|
2985
2985
|
__name(_asyncToGenerator, "_asyncToGenerator"), module.exports = _asyncToGenerator, module.exports.__esModule = !0, module.exports.default = module.exports;
|
|
2986
2986
|
})(asyncToGenerator);
|
|
2987
|
-
var asyncToGeneratorExports = asyncToGenerator.exports, objectSpread2 = { exports: {} }, defineProperty = { exports: {} }, toPropertyKey$
|
|
2987
|
+
var asyncToGeneratorExports = asyncToGenerator.exports, objectSpread2 = { exports: {} }, defineProperty = { exports: {} }, toPropertyKey$2 = { exports: {} }, toPrimitive$2 = { exports: {} };
|
|
2988
2988
|
(function(module) {
|
|
2989
2989
|
var _typeof3 = _typeofExports.default;
|
|
2990
2990
|
function toPrimitive2(t2, r2) {
|
|
@@ -2998,8 +2998,8 @@ var asyncToGeneratorExports = asyncToGenerator.exports, objectSpread2 = { export
|
|
|
2998
2998
|
return (r2 === "string" ? String : Number)(t2);
|
|
2999
2999
|
}
|
|
3000
3000
|
__name(toPrimitive2, "toPrimitive"), module.exports = toPrimitive2, module.exports.__esModule = !0, module.exports.default = module.exports;
|
|
3001
|
-
})(toPrimitive$
|
|
3002
|
-
var toPrimitiveExports = toPrimitive$
|
|
3001
|
+
})(toPrimitive$2);
|
|
3002
|
+
var toPrimitiveExports = toPrimitive$2.exports;
|
|
3003
3003
|
(function(module) {
|
|
3004
3004
|
var _typeof3 = _typeofExports.default, toPrimitive2 = toPrimitiveExports;
|
|
3005
3005
|
function toPropertyKey2(t2) {
|
|
@@ -3007,8 +3007,8 @@ var toPrimitiveExports = toPrimitive$1.exports;
|
|
|
3007
3007
|
return _typeof3(i) == "symbol" ? i : i + "";
|
|
3008
3008
|
}
|
|
3009
3009
|
__name(toPropertyKey2, "toPropertyKey"), module.exports = toPropertyKey2, module.exports.__esModule = !0, module.exports.default = module.exports;
|
|
3010
|
-
})(toPropertyKey$
|
|
3011
|
-
var toPropertyKeyExports = toPropertyKey$
|
|
3010
|
+
})(toPropertyKey$2);
|
|
3011
|
+
var toPropertyKeyExports = toPropertyKey$2.exports;
|
|
3012
3012
|
(function(module) {
|
|
3013
3013
|
var toPropertyKey2 = toPropertyKeyExports;
|
|
3014
3014
|
function _defineProperty2(e2, r2, t2) {
|
|
@@ -3054,7 +3054,7 @@ Object.defineProperty(render$1, "__esModule", {
|
|
|
3054
3054
|
});
|
|
3055
3055
|
render$1._r = _r;
|
|
3056
3056
|
render$1._u = _u;
|
|
3057
|
-
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$2 = _interopRequireDefault(objectSpread2Exports), ReactDOM = _interopRequireWildcard(ReactDOM$1), fullClone = (0, _objectSpread2$2.default)({}, ReactDOM), version = fullClone.version, reactRender = fullClone.render, unmountComponentAtNode = fullClone.unmountComponentAtNode, createRoot;
|
|
3058
3058
|
try {
|
|
3059
3059
|
var mainVersion = Number((version || "").split(".")[0]);
|
|
3060
3060
|
mainVersion >= 18 && (createRoot = fullClone.createRoot);
|
|
@@ -6453,42 +6453,42 @@ const _DesktopMessageService = class _DesktopMessageService {
|
|
|
6453
6453
|
};
|
|
6454
6454
|
__name(_DesktopMessageService, "DesktopMessageService");
|
|
6455
6455
|
let DesktopMessageService = _DesktopMessageService;
|
|
6456
|
-
function _arrayLikeToArray(r2, a) {
|
|
6456
|
+
function _arrayLikeToArray$1(r2, a) {
|
|
6457
6457
|
(a == null || a > r2.length) && (a = r2.length);
|
|
6458
6458
|
for (var e2 = 0, n2 = Array(a); e2 < a; e2++) n2[e2] = r2[e2];
|
|
6459
6459
|
return n2;
|
|
6460
6460
|
}
|
|
6461
|
-
__name(_arrayLikeToArray, "_arrayLikeToArray");
|
|
6461
|
+
__name(_arrayLikeToArray$1, "_arrayLikeToArray$1");
|
|
6462
6462
|
function _arrayWithoutHoles(r2) {
|
|
6463
|
-
if (Array.isArray(r2)) return _arrayLikeToArray(r2);
|
|
6463
|
+
if (Array.isArray(r2)) return _arrayLikeToArray$1(r2);
|
|
6464
6464
|
}
|
|
6465
6465
|
__name(_arrayWithoutHoles, "_arrayWithoutHoles");
|
|
6466
6466
|
function _iterableToArray(r2) {
|
|
6467
6467
|
if (typeof Symbol < "u" && r2[Symbol.iterator] != null || r2["@@iterator"] != null) return Array.from(r2);
|
|
6468
6468
|
}
|
|
6469
6469
|
__name(_iterableToArray, "_iterableToArray");
|
|
6470
|
-
function _unsupportedIterableToArray(r2, a) {
|
|
6470
|
+
function _unsupportedIterableToArray$1(r2, a) {
|
|
6471
6471
|
if (r2) {
|
|
6472
|
-
if (typeof r2 == "string") return _arrayLikeToArray(r2, a);
|
|
6472
|
+
if (typeof r2 == "string") return _arrayLikeToArray$1(r2, a);
|
|
6473
6473
|
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
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;
|
|
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$1(r2, a) : void 0;
|
|
6475
6475
|
}
|
|
6476
6476
|
}
|
|
6477
|
-
__name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
|
|
6477
|
+
__name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray$1");
|
|
6478
6478
|
function _nonIterableSpread() {
|
|
6479
6479
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
6480
6480
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
6481
6481
|
}
|
|
6482
6482
|
__name(_nonIterableSpread, "_nonIterableSpread");
|
|
6483
6483
|
function _toConsumableArray(r2) {
|
|
6484
|
-
return _arrayWithoutHoles(r2) || _iterableToArray(r2) || _unsupportedIterableToArray(r2) || _nonIterableSpread();
|
|
6484
|
+
return _arrayWithoutHoles(r2) || _iterableToArray(r2) || _unsupportedIterableToArray$1(r2) || _nonIterableSpread();
|
|
6485
6485
|
}
|
|
6486
6486
|
__name(_toConsumableArray, "_toConsumableArray");
|
|
6487
|
-
function _arrayWithHoles(r2) {
|
|
6487
|
+
function _arrayWithHoles$1(r2) {
|
|
6488
6488
|
if (Array.isArray(r2)) return r2;
|
|
6489
6489
|
}
|
|
6490
|
-
__name(_arrayWithHoles, "_arrayWithHoles");
|
|
6491
|
-
function _iterableToArrayLimit(r2, l2) {
|
|
6490
|
+
__name(_arrayWithHoles$1, "_arrayWithHoles$1");
|
|
6491
|
+
function _iterableToArrayLimit$1(r2, l2) {
|
|
6492
6492
|
var t2 = r2 == null ? null : typeof Symbol < "u" && r2[Symbol.iterator] || r2["@@iterator"];
|
|
6493
6493
|
if (t2 != null) {
|
|
6494
6494
|
var e2, n2, i, u2, a = [], f2 = !0, o = !1;
|
|
@@ -6509,16 +6509,16 @@ function _iterableToArrayLimit(r2, l2) {
|
|
|
6509
6509
|
return a;
|
|
6510
6510
|
}
|
|
6511
6511
|
}
|
|
6512
|
-
__name(_iterableToArrayLimit, "_iterableToArrayLimit");
|
|
6513
|
-
function _nonIterableRest() {
|
|
6512
|
+
__name(_iterableToArrayLimit$1, "_iterableToArrayLimit$1");
|
|
6513
|
+
function _nonIterableRest$1() {
|
|
6514
6514
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
6515
6515
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
6516
6516
|
}
|
|
6517
|
-
__name(_nonIterableRest, "_nonIterableRest");
|
|
6518
|
-
function _slicedToArray(r2, e2) {
|
|
6519
|
-
return _arrayWithHoles(r2) || _iterableToArrayLimit(r2, e2) || _unsupportedIterableToArray(r2, e2) || _nonIterableRest();
|
|
6517
|
+
__name(_nonIterableRest$1, "_nonIterableRest$1");
|
|
6518
|
+
function _slicedToArray$1(r2, e2) {
|
|
6519
|
+
return _arrayWithHoles$1(r2) || _iterableToArrayLimit$1(r2, e2) || _unsupportedIterableToArray$1(r2, e2) || _nonIterableRest$1();
|
|
6520
6520
|
}
|
|
6521
|
-
__name(_slicedToArray, "_slicedToArray");
|
|
6521
|
+
__name(_slicedToArray$1, "_slicedToArray$1");
|
|
6522
6522
|
function _objectWithoutPropertiesLoose(r2, e2) {
|
|
6523
6523
|
if (r2 == null) return {};
|
|
6524
6524
|
var t2 = {};
|
|
@@ -6539,41 +6539,41 @@ function _objectWithoutProperties(e2, t2) {
|
|
|
6539
6539
|
return i;
|
|
6540
6540
|
}
|
|
6541
6541
|
__name(_objectWithoutProperties, "_objectWithoutProperties");
|
|
6542
|
-
function _typeof(o) {
|
|
6542
|
+
function _typeof$1(o) {
|
|
6543
6543
|
"@babel/helpers - typeof";
|
|
6544
|
-
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o2) {
|
|
6544
|
+
return _typeof$1 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o2) {
|
|
6545
6545
|
return typeof o2;
|
|
6546
6546
|
} : function(o2) {
|
|
6547
6547
|
return o2 && typeof Symbol == "function" && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
6548
|
-
}, _typeof(o);
|
|
6548
|
+
}, _typeof$1(o);
|
|
6549
6549
|
}
|
|
6550
|
-
__name(_typeof, "_typeof");
|
|
6551
|
-
function toPrimitive(t2, r2) {
|
|
6552
|
-
if (_typeof(t2) != "object" || !t2) return t2;
|
|
6550
|
+
__name(_typeof$1, "_typeof$1");
|
|
6551
|
+
function toPrimitive$1(t2, r2) {
|
|
6552
|
+
if (_typeof$1(t2) != "object" || !t2) return t2;
|
|
6553
6553
|
var e2 = t2[Symbol.toPrimitive];
|
|
6554
6554
|
if (e2 !== void 0) {
|
|
6555
6555
|
var i = e2.call(t2, r2 || "default");
|
|
6556
|
-
if (_typeof(i) != "object") return i;
|
|
6556
|
+
if (_typeof$1(i) != "object") return i;
|
|
6557
6557
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
6558
6558
|
}
|
|
6559
6559
|
return (r2 === "string" ? String : Number)(t2);
|
|
6560
6560
|
}
|
|
6561
|
-
__name(toPrimitive, "toPrimitive");
|
|
6562
|
-
function toPropertyKey(t2) {
|
|
6563
|
-
var i = toPrimitive(t2, "string");
|
|
6564
|
-
return _typeof(i) == "symbol" ? i : i + "";
|
|
6561
|
+
__name(toPrimitive$1, "toPrimitive$1");
|
|
6562
|
+
function toPropertyKey$1(t2) {
|
|
6563
|
+
var i = toPrimitive$1(t2, "string");
|
|
6564
|
+
return _typeof$1(i) == "symbol" ? i : i + "";
|
|
6565
6565
|
}
|
|
6566
|
-
__name(toPropertyKey, "toPropertyKey");
|
|
6567
|
-
function _defineProperty(e2, r2, t2) {
|
|
6568
|
-
return (r2 = toPropertyKey(r2)) in e2 ? Object.defineProperty(e2, r2, {
|
|
6566
|
+
__name(toPropertyKey$1, "toPropertyKey$1");
|
|
6567
|
+
function _defineProperty$1(e2, r2, t2) {
|
|
6568
|
+
return (r2 = toPropertyKey$1(r2)) in e2 ? Object.defineProperty(e2, r2, {
|
|
6569
6569
|
value: t2,
|
|
6570
6570
|
enumerable: !0,
|
|
6571
6571
|
configurable: !0,
|
|
6572
6572
|
writable: !0
|
|
6573
6573
|
}) : e2[r2] = t2, e2;
|
|
6574
6574
|
}
|
|
6575
|
-
__name(_defineProperty, "_defineProperty");
|
|
6576
|
-
function ownKeys(e2, r2) {
|
|
6575
|
+
__name(_defineProperty$1, "_defineProperty$1");
|
|
6576
|
+
function ownKeys$1(e2, r2) {
|
|
6577
6577
|
var t2 = Object.keys(e2);
|
|
6578
6578
|
if (Object.getOwnPropertySymbols) {
|
|
6579
6579
|
var o = Object.getOwnPropertySymbols(e2);
|
|
@@ -6583,19 +6583,19 @@ function ownKeys(e2, r2) {
|
|
|
6583
6583
|
}
|
|
6584
6584
|
return t2;
|
|
6585
6585
|
}
|
|
6586
|
-
__name(ownKeys, "ownKeys");
|
|
6587
|
-
function _objectSpread2(e2) {
|
|
6586
|
+
__name(ownKeys$1, "ownKeys$1");
|
|
6587
|
+
function _objectSpread2$1(e2) {
|
|
6588
6588
|
for (var r2 = 1; r2 < arguments.length; r2++) {
|
|
6589
6589
|
var t2 = arguments[r2] != null ? arguments[r2] : {};
|
|
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) {
|
|
6590
|
+
r2 % 2 ? ownKeys$1(Object(t2), !0).forEach(function(r3) {
|
|
6591
|
+
_defineProperty$1(e2, r3, t2[r3]);
|
|
6592
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$1(Object(t2)).forEach(function(r3) {
|
|
6593
6593
|
Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
|
|
6594
6594
|
});
|
|
6595
6595
|
}
|
|
6596
6596
|
return e2;
|
|
6597
6597
|
}
|
|
6598
|
-
__name(_objectSpread2, "_objectSpread2");
|
|
6598
|
+
__name(_objectSpread2$1, "_objectSpread2$1");
|
|
6599
6599
|
function _extends() {
|
|
6600
6600
|
return _extends = Object.assign ? Object.assign.bind() : function(n2) {
|
|
6601
6601
|
for (var e2 = 1; e2 < arguments.length; e2++) {
|
|
@@ -6646,6 +6646,15 @@ var classnames = { exports: {} };
|
|
|
6646
6646
|
})(classnames);
|
|
6647
6647
|
var classnamesExports = classnames.exports;
|
|
6648
6648
|
const clsx = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
6649
|
+
function _typeof(o) {
|
|
6650
|
+
"@babel/helpers - typeof";
|
|
6651
|
+
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o2) {
|
|
6652
|
+
return typeof o2;
|
|
6653
|
+
} : function(o2) {
|
|
6654
|
+
return o2 && typeof Symbol == "function" && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
6655
|
+
}, _typeof(o);
|
|
6656
|
+
}
|
|
6657
|
+
__name(_typeof, "_typeof");
|
|
6649
6658
|
function isDOM(node) {
|
|
6650
6659
|
return node instanceof HTMLElement || node instanceof SVGElement;
|
|
6651
6660
|
}
|
|
@@ -6786,7 +6795,7 @@ __name(_classCallCheck, "_classCallCheck");
|
|
|
6786
6795
|
function _defineProperties(e2, r2) {
|
|
6787
6796
|
for (var t2 = 0; t2 < r2.length; t2++) {
|
|
6788
6797
|
var o = r2[t2];
|
|
6789
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e2, toPropertyKey(o.key), o);
|
|
6798
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e2, toPropertyKey$1(o.key), o);
|
|
6790
6799
|
}
|
|
6791
6800
|
}
|
|
6792
6801
|
__name(_defineProperties, "_defineProperties");
|
|
@@ -6838,7 +6847,7 @@ function _assertThisInitialized(e2) {
|
|
|
6838
6847
|
}
|
|
6839
6848
|
__name(_assertThisInitialized, "_assertThisInitialized");
|
|
6840
6849
|
function _possibleConstructorReturn(t2, e2) {
|
|
6841
|
-
if (e2 && (_typeof(e2) == "object" || typeof e2 == "function")) return e2;
|
|
6850
|
+
if (e2 && (_typeof$1(e2) == "object" || typeof e2 == "function")) return e2;
|
|
6842
6851
|
if (e2 !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
6843
6852
|
return _assertThisInitialized(t2);
|
|
6844
6853
|
}
|
|
@@ -6879,6 +6888,52 @@ function useEvent(callback) {
|
|
|
6879
6888
|
return memoFn;
|
|
6880
6889
|
}
|
|
6881
6890
|
__name(useEvent, "useEvent");
|
|
6891
|
+
function _arrayWithHoles(r2) {
|
|
6892
|
+
if (Array.isArray(r2)) return r2;
|
|
6893
|
+
}
|
|
6894
|
+
__name(_arrayWithHoles, "_arrayWithHoles");
|
|
6895
|
+
function _iterableToArrayLimit(r2, l2) {
|
|
6896
|
+
var t2 = r2 == null ? null : typeof Symbol < "u" && r2[Symbol.iterator] || r2["@@iterator"];
|
|
6897
|
+
if (t2 != null) {
|
|
6898
|
+
var e2, n2, i, u2, a = [], f2 = !0, o = !1;
|
|
6899
|
+
try {
|
|
6900
|
+
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) ;
|
|
6901
|
+
} catch (r3) {
|
|
6902
|
+
o = !0, n2 = r3;
|
|
6903
|
+
} finally {
|
|
6904
|
+
try {
|
|
6905
|
+
if (!f2 && t2.return != null && (u2 = t2.return(), Object(u2) !== u2)) return;
|
|
6906
|
+
} finally {
|
|
6907
|
+
if (o) throw n2;
|
|
6908
|
+
}
|
|
6909
|
+
}
|
|
6910
|
+
return a;
|
|
6911
|
+
}
|
|
6912
|
+
}
|
|
6913
|
+
__name(_iterableToArrayLimit, "_iterableToArrayLimit");
|
|
6914
|
+
function _arrayLikeToArray(r2, a) {
|
|
6915
|
+
(a == null || a > r2.length) && (a = r2.length);
|
|
6916
|
+
for (var e2 = 0, n2 = Array(a); e2 < a; e2++) n2[e2] = r2[e2];
|
|
6917
|
+
return n2;
|
|
6918
|
+
}
|
|
6919
|
+
__name(_arrayLikeToArray, "_arrayLikeToArray");
|
|
6920
|
+
function _unsupportedIterableToArray(r2, a) {
|
|
6921
|
+
if (r2) {
|
|
6922
|
+
if (typeof r2 == "string") return _arrayLikeToArray(r2, a);
|
|
6923
|
+
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
6924
|
+
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;
|
|
6925
|
+
}
|
|
6926
|
+
}
|
|
6927
|
+
__name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
|
|
6928
|
+
function _nonIterableRest() {
|
|
6929
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
6930
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
6931
|
+
}
|
|
6932
|
+
__name(_nonIterableRest, "_nonIterableRest");
|
|
6933
|
+
function _slicedToArray(r2, e2) {
|
|
6934
|
+
return _arrayWithHoles(r2) || _iterableToArrayLimit(r2, e2) || _unsupportedIterableToArray(r2, e2) || _nonIterableRest();
|
|
6935
|
+
}
|
|
6936
|
+
__name(_slicedToArray, "_slicedToArray");
|
|
6882
6937
|
function canUseDom() {
|
|
6883
6938
|
return !!(typeof window < "u" && window.document && window.document.createElement);
|
|
6884
6939
|
}
|
|
@@ -6896,6 +6951,54 @@ function useSafeState(defaultValue) {
|
|
|
6896
6951
|
return __name(safeSetState, "safeSetState"), [value, safeSetState];
|
|
6897
6952
|
}
|
|
6898
6953
|
__name(useSafeState, "useSafeState");
|
|
6954
|
+
function toPrimitive(t2, r2) {
|
|
6955
|
+
if (_typeof(t2) != "object" || !t2) return t2;
|
|
6956
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
6957
|
+
if (e2 !== void 0) {
|
|
6958
|
+
var i = e2.call(t2, r2 || "default");
|
|
6959
|
+
if (_typeof(i) != "object") return i;
|
|
6960
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
6961
|
+
}
|
|
6962
|
+
return (r2 === "string" ? String : Number)(t2);
|
|
6963
|
+
}
|
|
6964
|
+
__name(toPrimitive, "toPrimitive");
|
|
6965
|
+
function toPropertyKey(t2) {
|
|
6966
|
+
var i = toPrimitive(t2, "string");
|
|
6967
|
+
return _typeof(i) == "symbol" ? i : i + "";
|
|
6968
|
+
}
|
|
6969
|
+
__name(toPropertyKey, "toPropertyKey");
|
|
6970
|
+
function _defineProperty(e2, r2, t2) {
|
|
6971
|
+
return (r2 = toPropertyKey(r2)) in e2 ? Object.defineProperty(e2, r2, {
|
|
6972
|
+
value: t2,
|
|
6973
|
+
enumerable: !0,
|
|
6974
|
+
configurable: !0,
|
|
6975
|
+
writable: !0
|
|
6976
|
+
}) : e2[r2] = t2, e2;
|
|
6977
|
+
}
|
|
6978
|
+
__name(_defineProperty, "_defineProperty");
|
|
6979
|
+
function ownKeys(e2, r2) {
|
|
6980
|
+
var t2 = Object.keys(e2);
|
|
6981
|
+
if (Object.getOwnPropertySymbols) {
|
|
6982
|
+
var o = Object.getOwnPropertySymbols(e2);
|
|
6983
|
+
r2 && (o = o.filter(function(r3) {
|
|
6984
|
+
return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
|
|
6985
|
+
})), t2.push.apply(t2, o);
|
|
6986
|
+
}
|
|
6987
|
+
return t2;
|
|
6988
|
+
}
|
|
6989
|
+
__name(ownKeys, "ownKeys");
|
|
6990
|
+
function _objectSpread2(e2) {
|
|
6991
|
+
for (var r2 = 1; r2 < arguments.length; r2++) {
|
|
6992
|
+
var t2 = arguments[r2] != null ? arguments[r2] : {};
|
|
6993
|
+
r2 % 2 ? ownKeys(Object(t2), !0).forEach(function(r3) {
|
|
6994
|
+
_defineProperty(e2, r3, t2[r3]);
|
|
6995
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r3) {
|
|
6996
|
+
Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
|
|
6997
|
+
});
|
|
6998
|
+
}
|
|
6999
|
+
return e2;
|
|
7000
|
+
}
|
|
7001
|
+
__name(_objectSpread2, "_objectSpread2");
|
|
6899
7002
|
function useSyncState(defaultValue) {
|
|
6900
7003
|
var _React$useReducer = React.useReducer(function(x) {
|
|
6901
7004
|
return x + 1;
|
|
@@ -6943,7 +7046,7 @@ __name(getVendorPrefixedEventName, "getVendorPrefixedEventName");
|
|
|
6943
7046
|
var internalAnimationEndName = getVendorPrefixedEventName("animationend"), internalTransitionEndName = getVendorPrefixedEventName("transitionend"), supportTransition = !!(internalAnimationEndName && internalTransitionEndName), animationEndName = internalAnimationEndName || "animationend", transitionEndName = internalTransitionEndName || "transitionend";
|
|
6944
7047
|
function getTransitionName(transitionName, transitionType) {
|
|
6945
7048
|
if (!transitionName) return null;
|
|
6946
|
-
if (_typeof(transitionName) === "object") {
|
|
7049
|
+
if (_typeof$1(transitionName) === "object") {
|
|
6947
7050
|
var type = transitionType.replace(/-\w/g, function(match2) {
|
|
6948
7051
|
return match2[1].toUpperCase();
|
|
6949
7052
|
});
|
|
@@ -7032,7 +7135,7 @@ function isActive(step) {
|
|
|
7032
7135
|
}
|
|
7033
7136
|
__name(isActive, "isActive");
|
|
7034
7137
|
const useStepQueue = /* @__PURE__ */ __name(function(status, prepareOnly, callback) {
|
|
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];
|
|
7138
|
+
var _useState = useSafeState(STEP_NONE), _useState2 = _slicedToArray$1(_useState, 2), step = _useState2[0], setStep = _useState2[1], _useNextFrame = useNextFrame(), _useNextFrame2 = _slicedToArray$1(_useNextFrame, 2), nextFrame = _useNextFrame2[0], cancelNextFrame = _useNextFrame2[1];
|
|
7036
7139
|
function startQueue() {
|
|
7037
7140
|
setStep(STEP_PREPARE, !0);
|
|
7038
7141
|
}
|
|
@@ -7055,7 +7158,7 @@ const useStepQueue = /* @__PURE__ */ __name(function(status, prepareOnly, callba
|
|
|
7055
7158
|
}, []), [startQueue, step];
|
|
7056
7159
|
}, "useStepQueue");
|
|
7057
7160
|
function useStatus(supportMotion, visible, getElement, _ref) {
|
|
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);
|
|
7161
|
+
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$1(_useState, 2), asyncVisible = _useState2[0], setAsyncVisible = _useState2[1], _useSyncState = useSyncState(STATUS_NONE), _useSyncState2 = _slicedToArray$1(_useSyncState, 2), getStatus = _useSyncState2[0], setStatus = _useSyncState2[1], _useState3 = useSafeState(null), _useState4 = _slicedToArray$1(_useState3, 2), style2 = _useState4[0], setStyle = _useState4[1], currentStatus = getStatus(), mountedRef = useRef(!1), deadlineRef = useRef(null);
|
|
7059
7162
|
function getDomElement() {
|
|
7060
7163
|
return getElement();
|
|
7061
7164
|
}
|
|
@@ -7074,14 +7177,14 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
7074
7177
|
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();
|
|
7075
7178
|
}
|
|
7076
7179
|
}
|
|
7077
|
-
}), _useDomMotionEvents = useDomMotionEvents(onInternalMotionEnd), _useDomMotionEvents2 = _slicedToArray(_useDomMotionEvents, 1), patchMotionEvents = _useDomMotionEvents2[0], getEventHandlers = /* @__PURE__ */ __name(function(targetStatus) {
|
|
7180
|
+
}), _useDomMotionEvents = useDomMotionEvents(onInternalMotionEnd), _useDomMotionEvents2 = _slicedToArray$1(_useDomMotionEvents, 1), patchMotionEvents = _useDomMotionEvents2[0], getEventHandlers = /* @__PURE__ */ __name(function(targetStatus) {
|
|
7078
7181
|
switch (targetStatus) {
|
|
7079
7182
|
case STATUS_APPEAR:
|
|
7080
|
-
return _defineProperty(_defineProperty(_defineProperty({}, STEP_PREPARE, onAppearPrepare), STEP_START, onAppearStart), STEP_ACTIVE, onAppearActive);
|
|
7183
|
+
return _defineProperty$1(_defineProperty$1(_defineProperty$1({}, STEP_PREPARE, onAppearPrepare), STEP_START, onAppearStart), STEP_ACTIVE, onAppearActive);
|
|
7081
7184
|
case STATUS_ENTER:
|
|
7082
|
-
return _defineProperty(_defineProperty(_defineProperty({}, STEP_PREPARE, onEnterPrepare), STEP_START, onEnterStart), STEP_ACTIVE, onEnterActive);
|
|
7185
|
+
return _defineProperty$1(_defineProperty$1(_defineProperty$1({}, STEP_PREPARE, onEnterPrepare), STEP_START, onEnterStart), STEP_ACTIVE, onEnterActive);
|
|
7083
7186
|
case STATUS_LEAVE:
|
|
7084
|
-
return _defineProperty(_defineProperty(_defineProperty({}, STEP_PREPARE, onLeavePrepare), STEP_START, onLeaveStart), STEP_ACTIVE, onLeaveActive);
|
|
7187
|
+
return _defineProperty$1(_defineProperty$1(_defineProperty$1({}, STEP_PREPARE, onLeavePrepare), STEP_START, onLeaveStart), STEP_ACTIVE, onLeaveActive);
|
|
7085
7188
|
default:
|
|
7086
7189
|
return {};
|
|
7087
7190
|
}
|
|
@@ -7101,7 +7204,7 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
7101
7204
|
deadline: !0
|
|
7102
7205
|
});
|
|
7103
7206
|
}, motionDeadline))), step === STEP_PREPARED && updateMotionEndStatus(), DoStep;
|
|
7104
|
-
}), _useStepQueue2 = _slicedToArray(_useStepQueue, 2), startStep = _useStepQueue2[0], step = _useStepQueue2[1], active = isActive(step);
|
|
7207
|
+
}), _useStepQueue2 = _slicedToArray$1(_useStepQueue, 2), startStep = _useStepQueue2[0], step = _useStepQueue2[1], active = isActive(step);
|
|
7105
7208
|
activeRef.current = active, useIsomorphicLayoutEffect(function() {
|
|
7106
7209
|
setAsyncVisible(visible);
|
|
7107
7210
|
var isMounted = mountedRef.current;
|
|
@@ -7125,14 +7228,14 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
7125
7228
|
asyncVisible && (firstMountChangeRef.current = !0), asyncVisible !== void 0 && currentStatus === STATUS_NONE && ((firstMountChangeRef.current || asyncVisible) && (onVisibleChanged == null || onVisibleChanged(asyncVisible)), firstMountChangeRef.current = !0);
|
|
7126
7229
|
}, [asyncVisible, currentStatus]);
|
|
7127
7230
|
var mergedStyle = style2;
|
|
7128
|
-
return eventHandlers[STEP_PREPARE] && step === STEP_START && (mergedStyle = _objectSpread2({
|
|
7231
|
+
return eventHandlers[STEP_PREPARE] && step === STEP_START && (mergedStyle = _objectSpread2$1({
|
|
7129
7232
|
transition: "none"
|
|
7130
7233
|
}, mergedStyle)), [currentStatus, step, mergedStyle, asyncVisible != null ? asyncVisible : visible];
|
|
7131
7234
|
}
|
|
7132
7235
|
__name(useStatus, "useStatus");
|
|
7133
7236
|
function genCSSMotion(config) {
|
|
7134
7237
|
var transitionSupport = config;
|
|
7135
|
-
_typeof(config) === "object" && (transitionSupport = config.transitionSupport);
|
|
7238
|
+
_typeof$1(config) === "object" && (transitionSupport = config.transitionSupport);
|
|
7136
7239
|
function isSupportTransition(props, contextMotion) {
|
|
7137
7240
|
return !!(props.motionName && transitionSupport && contextMotion !== !1);
|
|
7138
7241
|
}
|
|
@@ -7147,19 +7250,19 @@ function genCSSMotion(config) {
|
|
|
7147
7250
|
}
|
|
7148
7251
|
}
|
|
7149
7252
|
__name(getDomElement, "getDomElement");
|
|
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);
|
|
7253
|
+
var _useStatus = useStatus(supportMotion, visible, getDomElement, props), _useStatus2 = _slicedToArray$1(_useStatus, 4), status = _useStatus2[0], statusStep = _useStatus2[1], statusStyle = _useStatus2[2], mergedVisible = _useStatus2[3], renderedRef = React.useRef(mergedVisible);
|
|
7151
7254
|
mergedVisible && (renderedRef.current = !0);
|
|
7152
7255
|
var setNodeRef = React.useCallback(function(node) {
|
|
7153
7256
|
nodeRef.current = node, fillRef(ref, node);
|
|
7154
|
-
}, [ref]), motionChildren, mergedProps = _objectSpread2(_objectSpread2({}, eventProps), {}, {
|
|
7257
|
+
}, [ref]), motionChildren, mergedProps = _objectSpread2$1(_objectSpread2$1({}, eventProps), {}, {
|
|
7155
7258
|
visible
|
|
7156
7259
|
});
|
|
7157
7260
|
if (!children)
|
|
7158
7261
|
motionChildren = null;
|
|
7159
7262
|
else if (status === STATUS_NONE)
|
|
7160
|
-
mergedVisible ? motionChildren = children(_objectSpread2({}, mergedProps), setNodeRef) : !removeOnLeave && renderedRef.current && leavedClassName ? motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, {
|
|
7263
|
+
mergedVisible ? motionChildren = children(_objectSpread2$1({}, mergedProps), setNodeRef) : !removeOnLeave && renderedRef.current && leavedClassName ? motionChildren = children(_objectSpread2$1(_objectSpread2$1({}, mergedProps), {}, {
|
|
7161
7264
|
className: leavedClassName
|
|
7162
|
-
}), setNodeRef) : forceRender || !removeOnLeave && !leavedClassName ? motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, {
|
|
7265
|
+
}), setNodeRef) : forceRender || !removeOnLeave && !leavedClassName ? motionChildren = children(_objectSpread2$1(_objectSpread2$1({}, mergedProps), {}, {
|
|
7163
7266
|
style: {
|
|
7164
7267
|
display: "none"
|
|
7165
7268
|
}
|
|
@@ -7168,8 +7271,8 @@ function genCSSMotion(config) {
|
|
|
7168
7271
|
var statusSuffix;
|
|
7169
7272
|
statusStep === STEP_PREPARE ? statusSuffix = "prepare" : isActive(statusStep) ? statusSuffix = "active" : statusStep === STEP_START && (statusSuffix = "start");
|
|
7170
7273
|
var motionCls = getTransitionName(motionName, "".concat(status, "-").concat(statusSuffix));
|
|
7171
|
-
motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, {
|
|
7172
|
-
className: clsx(getTransitionName(motionName, status), _defineProperty(_defineProperty({}, motionCls, motionCls && statusSuffix), motionName, typeof motionName == "string")),
|
|
7274
|
+
motionChildren = children(_objectSpread2$1(_objectSpread2$1({}, mergedProps), {}, {
|
|
7275
|
+
className: clsx(getTransitionName(motionName, status), _defineProperty$1(_defineProperty$1({}, motionCls, motionCls && statusSuffix), motionName, typeof motionName == "string")),
|
|
7173
7276
|
style: statusStyle
|
|
7174
7277
|
}), setNodeRef);
|
|
7175
7278
|
}
|
|
@@ -7190,9 +7293,9 @@ const CSSMotion = genCSSMotion(supportTransition);
|
|
|
7190
7293
|
var STATUS_ADD = "add", STATUS_KEEP = "keep", STATUS_REMOVE = "remove", STATUS_REMOVED = "removed";
|
|
7191
7294
|
function wrapKeyToObject(key) {
|
|
7192
7295
|
var keyObj;
|
|
7193
|
-
return key && _typeof(key) === "object" && "key" in key ? keyObj = key : keyObj = {
|
|
7296
|
+
return key && _typeof$1(key) === "object" && "key" in key ? keyObj = key : keyObj = {
|
|
7194
7297
|
key
|
|
7195
|
-
}, _objectSpread2(_objectSpread2({}, keyObj), {}, {
|
|
7298
|
+
}, _objectSpread2$1(_objectSpread2$1({}, keyObj), {}, {
|
|
7196
7299
|
key: String(keyObj.key)
|
|
7197
7300
|
});
|
|
7198
7301
|
}
|
|
@@ -7209,20 +7312,20 @@ function diffKeys() {
|
|
|
7209
7312
|
var currentKeyObj = currentKeyObjects[i];
|
|
7210
7313
|
if (currentKeyObj.key === keyObj.key) {
|
|
7211
7314
|
currentIndex < i && (list = list.concat(currentKeyObjects.slice(currentIndex, i).map(function(obj) {
|
|
7212
|
-
return _objectSpread2(_objectSpread2({}, obj), {}, {
|
|
7315
|
+
return _objectSpread2$1(_objectSpread2$1({}, obj), {}, {
|
|
7213
7316
|
status: STATUS_ADD
|
|
7214
7317
|
});
|
|
7215
|
-
})), currentIndex = i), list.push(_objectSpread2(_objectSpread2({}, currentKeyObj), {}, {
|
|
7318
|
+
})), currentIndex = i), list.push(_objectSpread2$1(_objectSpread2$1({}, currentKeyObj), {}, {
|
|
7216
7319
|
status: STATUS_KEEP
|
|
7217
7320
|
})), currentIndex += 1, hit = !0;
|
|
7218
7321
|
break;
|
|
7219
7322
|
}
|
|
7220
7323
|
}
|
|
7221
|
-
hit || list.push(_objectSpread2(_objectSpread2({}, keyObj), {}, {
|
|
7324
|
+
hit || list.push(_objectSpread2$1(_objectSpread2$1({}, keyObj), {}, {
|
|
7222
7325
|
status: STATUS_REMOVE
|
|
7223
7326
|
}));
|
|
7224
7327
|
}), currentIndex < currentLen && (list = list.concat(currentKeyObjects.slice(currentIndex).map(function(obj) {
|
|
7225
|
-
return _objectSpread2(_objectSpread2({}, obj), {}, {
|
|
7328
|
+
return _objectSpread2$1(_objectSpread2$1({}, obj), {}, {
|
|
7226
7329
|
status: STATUS_ADD
|
|
7227
7330
|
});
|
|
7228
7331
|
})));
|
|
@@ -7254,11 +7357,11 @@ function genCSSMotionList(transitionSupport) {
|
|
|
7254
7357
|
_classCallCheck(this, CSSMotionList3);
|
|
7255
7358
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)
|
|
7256
7359
|
args[_key] = arguments[_key];
|
|
7257
|
-
return _this = _super.call.apply(_super, [this].concat(args)), _defineProperty(_assertThisInitialized(_this), "state", {
|
|
7360
|
+
return _this = _super.call.apply(_super, [this].concat(args)), _defineProperty$1(_assertThisInitialized(_this), "state", {
|
|
7258
7361
|
keyEntities: []
|
|
7259
|
-
}), _defineProperty(_assertThisInitialized(_this), "removeKey", function(removeKey) {
|
|
7362
|
+
}), _defineProperty$1(_assertThisInitialized(_this), "removeKey", function(removeKey) {
|
|
7260
7363
|
var keyEntities = _this.state.keyEntities, nextKeyEntities = keyEntities.map(function(entity) {
|
|
7261
|
-
return entity.key !== removeKey ? entity : _objectSpread2(_objectSpread2({}, entity), {}, {
|
|
7364
|
+
return entity.key !== removeKey ? entity : _objectSpread2$1(_objectSpread2$1({}, entity), {}, {
|
|
7262
7365
|
status: STATUS_REMOVED
|
|
7263
7366
|
});
|
|
7264
7367
|
});
|
|
@@ -7291,7 +7394,7 @@ function genCSSMotionList(transitionSupport) {
|
|
|
7291
7394
|
}
|
|
7292
7395
|
}, "onVisibleChanged")
|
|
7293
7396
|
}), function(props, ref) {
|
|
7294
|
-
return children(_objectSpread2(_objectSpread2({}, props), {}, {
|
|
7397
|
+
return children(_objectSpread2$1(_objectSpread2$1({}, props), {}, {
|
|
7295
7398
|
index
|
|
7296
7399
|
}), ref);
|
|
7297
7400
|
});
|
|
@@ -7313,7 +7416,7 @@ function genCSSMotionList(transitionSupport) {
|
|
|
7313
7416
|
}, "getDerivedStateFromProps")
|
|
7314
7417
|
}]), CSSMotionList3;
|
|
7315
7418
|
}(React.Component);
|
|
7316
|
-
return _defineProperty(CSSMotionList2, "defaultProps", {
|
|
7419
|
+
return _defineProperty$1(CSSMotionList2, "defaultProps", {
|
|
7317
7420
|
component: "div"
|
|
7318
7421
|
}), CSSMotionList2;
|
|
7319
7422
|
}
|
|
@@ -7873,7 +7976,7 @@ function pickAttrs(props) {
|
|
|
7873
7976
|
}
|
|
7874
7977
|
__name(pickAttrs, "pickAttrs");
|
|
7875
7978
|
var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
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() {
|
|
7979
|
+
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$1(_React$useState, 2), hovering = _React$useState2[0], setHovering = _React$useState2[1], _React$useState3 = React.useState(0), _React$useState4 = _slicedToArray$1(_React$useState3, 2), percent = _React$useState4[0], setPercent = _React$useState4[1], _React$useState5 = React.useState(0), _React$useState6 = _slicedToArray$1(_React$useState5, 2), spentTime = _React$useState6[0], setSpentTime = _React$useState6[1], mergedHovering = forcedHovering || hovering, mergedShowProgress = duration > 0 && showProgress, onInternalClose = /* @__PURE__ */ __name(function() {
|
|
7877
7980
|
onNoticeClose(eventKey);
|
|
7878
7981
|
}, "onInternalClose"), onCloseKeyDown = /* @__PURE__ */ __name(function(e2) {
|
|
7879
7982
|
(e2.key === "Enter" || e2.code === "Enter" || e2.keyCode === KeyCode.ENTER) && onInternalClose();
|
|
@@ -7901,13 +8004,13 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
7901
8004
|
}
|
|
7902
8005
|
}, [duration, spentTime, mergedHovering, mergedShowProgress, times]);
|
|
7903
8006
|
var closableObj = React.useMemo(function() {
|
|
7904
|
-
return _typeof(closable) === "object" && closable !== null ? closable : closable ? {
|
|
8007
|
+
return _typeof$1(closable) === "object" && closable !== null ? closable : closable ? {
|
|
7905
8008
|
closeIcon
|
|
7906
8009
|
} : {};
|
|
7907
8010
|
}, [closable, closeIcon]), ariaProps = pickAttrs(closableObj, !0), validPercent = 100 - (!percent || percent < 0 ? 0 : percent > 100 ? 100 : percent), noticePrefixCls = "".concat(prefixCls, "-notice");
|
|
7908
8011
|
return /* @__PURE__ */ React.createElement("div", _extends({}, divProps, {
|
|
7909
8012
|
ref,
|
|
7910
|
-
className: clsx(noticePrefixCls, className, _defineProperty({}, "".concat(noticePrefixCls, "-closable"), closable)),
|
|
8013
|
+
className: clsx(noticePrefixCls, className, _defineProperty$1({}, "".concat(noticePrefixCls, "-closable"), closable)),
|
|
7911
8014
|
style: style2,
|
|
7912
8015
|
onMouseEnter: /* @__PURE__ */ __name(function(e2) {
|
|
7913
8016
|
var _divProps$onMouseEnte;
|
|
@@ -7940,18 +8043,18 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
7940
8043
|
threshold: DEFAULT_THRESHOLD,
|
|
7941
8044
|
gap: DEFAULT_GAP
|
|
7942
8045
|
};
|
|
7943
|
-
if (config && _typeof(config) === "object") {
|
|
8046
|
+
if (config && _typeof$1(config) === "object") {
|
|
7944
8047
|
var _config$offset, _config$threshold, _config$gap;
|
|
7945
8048
|
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;
|
|
7946
8049
|
}
|
|
7947
8050
|
return [!!config, result];
|
|
7948
8051
|
}, "useStack"), _excluded$1 = ["className", "style", "classNames", "styles"], NoticeList = /* @__PURE__ */ __name(function(props) {
|
|
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) {
|
|
8052
|
+
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$1(_useState, 2), latestNotice = _useState2[0], setLatestNotice = _useState2[1], _useState3 = useState([]), _useState4 = _slicedToArray$1(_useState3, 2), hoverKeys = _useState4[0], setHoverKeys = _useState4[1], keys = configList.map(function(config) {
|
|
7950
8053
|
return {
|
|
7951
8054
|
config,
|
|
7952
8055
|
key: String(config.key)
|
|
7953
8056
|
};
|
|
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;
|
|
8057
|
+
}), _useStack = useStack(stackConfig), _useStack2 = _slicedToArray$1(_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;
|
|
7955
8058
|
return useEffect(function() {
|
|
7956
8059
|
stack && hoverKeys.length > 1 && setHoverKeys(function(prev) {
|
|
7957
8060
|
return prev.filter(function(key) {
|
|
@@ -7969,7 +8072,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
7969
8072
|
}
|
|
7970
8073
|
}, [keys, stack]), /* @__PURE__ */ React__default.createElement(CSSMotionList, _extends({
|
|
7971
8074
|
key: placement,
|
|
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)),
|
|
8075
|
+
className: clsx(prefixCls, "".concat(prefixCls, "-").concat(placement), ctxCls == null ? void 0 : ctxCls.list, className, _defineProperty$1(_defineProperty$1({}, "".concat(prefixCls, "-stack"), !!stack), "".concat(prefixCls, "-stack-expanded"), expanded)),
|
|
7973
8076
|
style: style2,
|
|
7974
8077
|
keys,
|
|
7975
8078
|
motionAppear: !0
|
|
@@ -7998,7 +8101,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
7998
8101
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
7999
8102
|
ref: nodeRef,
|
|
8000
8103
|
className: clsx("".concat(prefixCls, "-notice-wrapper"), motionClassName, configClassNames == null ? void 0 : configClassNames.wrapper),
|
|
8001
|
-
style: _objectSpread2(_objectSpread2(_objectSpread2({}, motionStyle), stackStyle), configStyles == null ? void 0 : configStyles.wrapper),
|
|
8104
|
+
style: _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, motionStyle), stackStyle), configStyles == null ? void 0 : configStyles.wrapper),
|
|
8002
8105
|
onMouseEnter: /* @__PURE__ */ __name(function() {
|
|
8003
8106
|
return setHoverKeys(function(prev) {
|
|
8004
8107
|
return prev.includes(strKey) ? prev : [].concat(_toConsumableArray(prev), [strKey]);
|
|
@@ -8028,7 +8131,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8028
8131
|
})));
|
|
8029
8132
|
});
|
|
8030
8133
|
}, "NoticeList2"), Notifications = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
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) {
|
|
8134
|
+
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$1(_React$useState, 2), configList = _React$useState2[0], setConfigList = _React$useState2[1], onNoticeClose = /* @__PURE__ */ __name(function(key) {
|
|
8032
8135
|
var _config$onClose, config = configList.find(function(item) {
|
|
8033
8136
|
return item.key === key;
|
|
8034
8137
|
});
|
|
@@ -8044,7 +8147,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8044
8147
|
setConfigList(function(list) {
|
|
8045
8148
|
var clone = _toConsumableArray(list), index = clone.findIndex(function(item) {
|
|
8046
8149
|
return item.key === config.key;
|
|
8047
|
-
}), innerConfig = _objectSpread2({}, config);
|
|
8150
|
+
}), innerConfig = _objectSpread2$1({}, config);
|
|
8048
8151
|
if (index >= 0) {
|
|
8049
8152
|
var _list$index;
|
|
8050
8153
|
innerConfig.times = (((_list$index = list[index]) === null || _list$index === void 0 ? void 0 : _list$index.times) || 0) + 1, clone[index] = innerConfig;
|
|
@@ -8061,7 +8164,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8061
8164
|
}, "destroy")
|
|
8062
8165
|
};
|
|
8063
8166
|
});
|
|
8064
|
-
var _React$useState3 = React.useState({}), _React$useState4 = _slicedToArray(_React$useState3, 2), placements = _React$useState4[0], setPlacements = _React$useState4[1];
|
|
8167
|
+
var _React$useState3 = React.useState({}), _React$useState4 = _slicedToArray$1(_React$useState3, 2), placements = _React$useState4[0], setPlacements = _React$useState4[1];
|
|
8065
8168
|
React.useEffect(function() {
|
|
8066
8169
|
var nextPlacements = {};
|
|
8067
8170
|
configList.forEach(function(config) {
|
|
@@ -8073,7 +8176,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8073
8176
|
}, [configList]);
|
|
8074
8177
|
var onAllNoticeRemoved = /* @__PURE__ */ __name(function(placement) {
|
|
8075
8178
|
setPlacements(function(originPlacements) {
|
|
8076
|
-
var clone = _objectSpread2({}, originPlacements), list = clone[placement] || [];
|
|
8179
|
+
var clone = _objectSpread2$1({}, originPlacements), list = clone[placement] || [];
|
|
8077
8180
|
return list.length || delete clone[placement], clone;
|
|
8078
8181
|
});
|
|
8079
8182
|
}, "onAllNoticeRemoved2"), emptyRef = React.useRef(!1);
|
|
@@ -8115,7 +8218,7 @@ function mergeConfig() {
|
|
|
8115
8218
|
}
|
|
8116
8219
|
__name(mergeConfig, "mergeConfig");
|
|
8117
8220
|
function useNotification() {
|
|
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, {
|
|
8221
|
+
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$1(_React$useState, 2), container = _React$useState2[0], setContainer = _React$useState2[1], notificationsRef = React.useRef(), contextHolder = /* @__PURE__ */ React.createElement(Notifications, {
|
|
8119
8222
|
container,
|
|
8120
8223
|
ref: notificationsRef,
|
|
8121
8224
|
prefixCls,
|
|
@@ -8126,7 +8229,7 @@ function useNotification() {
|
|
|
8126
8229
|
onAllRemoved,
|
|
8127
8230
|
stack,
|
|
8128
8231
|
renderNotifications
|
|
8129
|
-
}), _React$useState3 = React.useState([]), _React$useState4 = _slicedToArray(_React$useState3, 2), taskQueue = _React$useState4[0], setTaskQueue = _React$useState4[1], api = React.useMemo(function() {
|
|
8232
|
+
}), _React$useState3 = React.useState([]), _React$useState4 = _slicedToArray$1(_React$useState3, 2), taskQueue = _React$useState4[0], setTaskQueue = _React$useState4[1], api = React.useMemo(function() {
|
|
8130
8233
|
return {
|
|
8131
8234
|
open: /* @__PURE__ */ __name(function(config) {
|
|
8132
8235
|
var mergedConfig = mergeConfig(shareConfig, config);
|