@univerjs/ui 0.4.0-alpha.2 → 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/cjs/index.js +7 -8
- package/lib/es/index.js +91 -194
- package/lib/umd/index.js +7 -8
- package/package.json +5 -5
- package/LICENSE +0 -176
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$1 = { 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$2 = { 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$1);
|
|
2617
|
+
var _typeofExports = _typeof$1.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$1 = { exports: {} }, toPrimitive$1 = { 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$1);
|
|
3002
|
+
var toPrimitiveExports = toPrimitive$1.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$2.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$1);
|
|
3011
|
+
var toPropertyKeyExports = toPropertyKey$1.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$1 = _interopRequireDefault(objectSpread2Exports), ReactDOM = _interopRequireWildcard(ReactDOM$1), fullClone = (0, _objectSpread2$1.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
|
|
6456
|
+
function _arrayLikeToArray(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
|
|
6461
|
+
__name(_arrayLikeToArray, "_arrayLikeToArray");
|
|
6462
6462
|
function _arrayWithoutHoles(r2) {
|
|
6463
|
-
if (Array.isArray(r2)) return _arrayLikeToArray
|
|
6463
|
+
if (Array.isArray(r2)) return _arrayLikeToArray(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
|
|
6470
|
+
function _unsupportedIterableToArray(r2, a) {
|
|
6471
6471
|
if (r2) {
|
|
6472
|
-
if (typeof r2 == "string") return _arrayLikeToArray
|
|
6472
|
+
if (typeof r2 == "string") return _arrayLikeToArray(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
|
|
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;
|
|
6475
6475
|
}
|
|
6476
6476
|
}
|
|
6477
|
-
__name(_unsupportedIterableToArray
|
|
6477
|
+
__name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
|
|
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
|
|
6484
|
+
return _arrayWithoutHoles(r2) || _iterableToArray(r2) || _unsupportedIterableToArray(r2) || _nonIterableSpread();
|
|
6485
6485
|
}
|
|
6486
6486
|
__name(_toConsumableArray, "_toConsumableArray");
|
|
6487
|
-
function _arrayWithHoles
|
|
6487
|
+
function _arrayWithHoles(r2) {
|
|
6488
6488
|
if (Array.isArray(r2)) return r2;
|
|
6489
6489
|
}
|
|
6490
|
-
__name(_arrayWithHoles
|
|
6491
|
-
function _iterableToArrayLimit
|
|
6490
|
+
__name(_arrayWithHoles, "_arrayWithHoles");
|
|
6491
|
+
function _iterableToArrayLimit(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$1(r2, l2) {
|
|
|
6509
6509
|
return a;
|
|
6510
6510
|
}
|
|
6511
6511
|
}
|
|
6512
|
-
__name(_iterableToArrayLimit
|
|
6513
|
-
function _nonIterableRest
|
|
6512
|
+
__name(_iterableToArrayLimit, "_iterableToArrayLimit");
|
|
6513
|
+
function _nonIterableRest() {
|
|
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
|
|
6518
|
-
function _slicedToArray
|
|
6519
|
-
return _arrayWithHoles
|
|
6517
|
+
__name(_nonIterableRest, "_nonIterableRest");
|
|
6518
|
+
function _slicedToArray(r2, e2) {
|
|
6519
|
+
return _arrayWithHoles(r2) || _iterableToArrayLimit(r2, e2) || _unsupportedIterableToArray(r2, e2) || _nonIterableRest();
|
|
6520
6520
|
}
|
|
6521
|
-
__name(_slicedToArray
|
|
6521
|
+
__name(_slicedToArray, "_slicedToArray");
|
|
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
|
|
6542
|
+
function _typeof(o) {
|
|
6543
6543
|
"@babel/helpers - typeof";
|
|
6544
|
-
return _typeof
|
|
6544
|
+
return _typeof = 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
|
|
6548
|
+
}, _typeof(o);
|
|
6549
6549
|
}
|
|
6550
|
-
__name(_typeof
|
|
6551
|
-
function toPrimitive
|
|
6552
|
-
if (_typeof
|
|
6550
|
+
__name(_typeof, "_typeof");
|
|
6551
|
+
function toPrimitive(t2, r2) {
|
|
6552
|
+
if (_typeof(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
|
|
6556
|
+
if (_typeof(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
|
|
6562
|
-
function toPropertyKey
|
|
6563
|
-
var i = toPrimitive
|
|
6564
|
-
return _typeof
|
|
6561
|
+
__name(toPrimitive, "toPrimitive");
|
|
6562
|
+
function toPropertyKey(t2) {
|
|
6563
|
+
var i = toPrimitive(t2, "string");
|
|
6564
|
+
return _typeof(i) == "symbol" ? i : i + "";
|
|
6565
6565
|
}
|
|
6566
|
-
__name(toPropertyKey
|
|
6567
|
-
function _defineProperty
|
|
6568
|
-
return (r2 = toPropertyKey
|
|
6566
|
+
__name(toPropertyKey, "toPropertyKey");
|
|
6567
|
+
function _defineProperty(e2, r2, t2) {
|
|
6568
|
+
return (r2 = toPropertyKey(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
|
|
6576
|
-
function ownKeys
|
|
6575
|
+
__name(_defineProperty, "_defineProperty");
|
|
6576
|
+
function ownKeys(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$1(e2, r2) {
|
|
|
6583
6583
|
}
|
|
6584
6584
|
return t2;
|
|
6585
6585
|
}
|
|
6586
|
-
__name(ownKeys
|
|
6587
|
-
function _objectSpread2
|
|
6586
|
+
__name(ownKeys, "ownKeys");
|
|
6587
|
+
function _objectSpread2(e2) {
|
|
6588
6588
|
for (var r2 = 1; r2 < arguments.length; r2++) {
|
|
6589
6589
|
var t2 = arguments[r2] != null ? arguments[r2] : {};
|
|
6590
|
-
r2 % 2 ? ownKeys
|
|
6591
|
-
_defineProperty
|
|
6592
|
-
}) : 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) {
|
|
6593
6593
|
Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
|
|
6594
6594
|
});
|
|
6595
6595
|
}
|
|
6596
6596
|
return e2;
|
|
6597
6597
|
}
|
|
6598
|
-
__name(_objectSpread2
|
|
6598
|
+
__name(_objectSpread2, "_objectSpread2");
|
|
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,15 +6646,6 @@ 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");
|
|
6658
6649
|
function isDOM(node) {
|
|
6659
6650
|
return node instanceof HTMLElement || node instanceof SVGElement;
|
|
6660
6651
|
}
|
|
@@ -6795,7 +6786,7 @@ __name(_classCallCheck, "_classCallCheck");
|
|
|
6795
6786
|
function _defineProperties(e2, r2) {
|
|
6796
6787
|
for (var t2 = 0; t2 < r2.length; t2++) {
|
|
6797
6788
|
var o = r2[t2];
|
|
6798
|
-
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);
|
|
6799
6790
|
}
|
|
6800
6791
|
}
|
|
6801
6792
|
__name(_defineProperties, "_defineProperties");
|
|
@@ -6847,7 +6838,7 @@ function _assertThisInitialized(e2) {
|
|
|
6847
6838
|
}
|
|
6848
6839
|
__name(_assertThisInitialized, "_assertThisInitialized");
|
|
6849
6840
|
function _possibleConstructorReturn(t2, e2) {
|
|
6850
|
-
if (e2 && (_typeof
|
|
6841
|
+
if (e2 && (_typeof(e2) == "object" || typeof e2 == "function")) return e2;
|
|
6851
6842
|
if (e2 !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
6852
6843
|
return _assertThisInitialized(t2);
|
|
6853
6844
|
}
|
|
@@ -6888,52 +6879,6 @@ function useEvent(callback) {
|
|
|
6888
6879
|
return memoFn;
|
|
6889
6880
|
}
|
|
6890
6881
|
__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");
|
|
6937
6882
|
function canUseDom() {
|
|
6938
6883
|
return !!(typeof window < "u" && window.document && window.document.createElement);
|
|
6939
6884
|
}
|
|
@@ -6951,54 +6896,6 @@ function useSafeState(defaultValue) {
|
|
|
6951
6896
|
return __name(safeSetState, "safeSetState"), [value, safeSetState];
|
|
6952
6897
|
}
|
|
6953
6898
|
__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");
|
|
7002
6899
|
function useSyncState(defaultValue) {
|
|
7003
6900
|
var _React$useReducer = React.useReducer(function(x) {
|
|
7004
6901
|
return x + 1;
|
|
@@ -7046,7 +6943,7 @@ __name(getVendorPrefixedEventName, "getVendorPrefixedEventName");
|
|
|
7046
6943
|
var internalAnimationEndName = getVendorPrefixedEventName("animationend"), internalTransitionEndName = getVendorPrefixedEventName("transitionend"), supportTransition = !!(internalAnimationEndName && internalTransitionEndName), animationEndName = internalAnimationEndName || "animationend", transitionEndName = internalTransitionEndName || "transitionend";
|
|
7047
6944
|
function getTransitionName(transitionName, transitionType) {
|
|
7048
6945
|
if (!transitionName) return null;
|
|
7049
|
-
if (_typeof
|
|
6946
|
+
if (_typeof(transitionName) === "object") {
|
|
7050
6947
|
var type = transitionType.replace(/-\w/g, function(match2) {
|
|
7051
6948
|
return match2[1].toUpperCase();
|
|
7052
6949
|
});
|
|
@@ -7135,7 +7032,7 @@ function isActive(step) {
|
|
|
7135
7032
|
}
|
|
7136
7033
|
__name(isActive, "isActive");
|
|
7137
7034
|
const useStepQueue = /* @__PURE__ */ __name(function(status, prepareOnly, callback) {
|
|
7138
|
-
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];
|
|
7139
7036
|
function startQueue() {
|
|
7140
7037
|
setStep(STEP_PREPARE, !0);
|
|
7141
7038
|
}
|
|
@@ -7158,7 +7055,7 @@ const useStepQueue = /* @__PURE__ */ __name(function(status, prepareOnly, callba
|
|
|
7158
7055
|
}, []), [startQueue, step];
|
|
7159
7056
|
}, "useStepQueue");
|
|
7160
7057
|
function useStatus(supportMotion, visible, getElement, _ref) {
|
|
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
|
|
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);
|
|
7162
7059
|
function getDomElement() {
|
|
7163
7060
|
return getElement();
|
|
7164
7061
|
}
|
|
@@ -7177,14 +7074,14 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
7177
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();
|
|
7178
7075
|
}
|
|
7179
7076
|
}
|
|
7180
|
-
}), _useDomMotionEvents = useDomMotionEvents(onInternalMotionEnd), _useDomMotionEvents2 = _slicedToArray
|
|
7077
|
+
}), _useDomMotionEvents = useDomMotionEvents(onInternalMotionEnd), _useDomMotionEvents2 = _slicedToArray(_useDomMotionEvents, 1), patchMotionEvents = _useDomMotionEvents2[0], getEventHandlers = /* @__PURE__ */ __name(function(targetStatus) {
|
|
7181
7078
|
switch (targetStatus) {
|
|
7182
7079
|
case STATUS_APPEAR:
|
|
7183
|
-
return _defineProperty
|
|
7080
|
+
return _defineProperty(_defineProperty(_defineProperty({}, STEP_PREPARE, onAppearPrepare), STEP_START, onAppearStart), STEP_ACTIVE, onAppearActive);
|
|
7184
7081
|
case STATUS_ENTER:
|
|
7185
|
-
return _defineProperty
|
|
7082
|
+
return _defineProperty(_defineProperty(_defineProperty({}, STEP_PREPARE, onEnterPrepare), STEP_START, onEnterStart), STEP_ACTIVE, onEnterActive);
|
|
7186
7083
|
case STATUS_LEAVE:
|
|
7187
|
-
return _defineProperty
|
|
7084
|
+
return _defineProperty(_defineProperty(_defineProperty({}, STEP_PREPARE, onLeavePrepare), STEP_START, onLeaveStart), STEP_ACTIVE, onLeaveActive);
|
|
7188
7085
|
default:
|
|
7189
7086
|
return {};
|
|
7190
7087
|
}
|
|
@@ -7204,7 +7101,7 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
7204
7101
|
deadline: !0
|
|
7205
7102
|
});
|
|
7206
7103
|
}, motionDeadline))), step === STEP_PREPARED && updateMotionEndStatus(), DoStep;
|
|
7207
|
-
}), _useStepQueue2 = _slicedToArray
|
|
7104
|
+
}), _useStepQueue2 = _slicedToArray(_useStepQueue, 2), startStep = _useStepQueue2[0], step = _useStepQueue2[1], active = isActive(step);
|
|
7208
7105
|
activeRef.current = active, useIsomorphicLayoutEffect(function() {
|
|
7209
7106
|
setAsyncVisible(visible);
|
|
7210
7107
|
var isMounted = mountedRef.current;
|
|
@@ -7228,14 +7125,14 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
7228
7125
|
asyncVisible && (firstMountChangeRef.current = !0), asyncVisible !== void 0 && currentStatus === STATUS_NONE && ((firstMountChangeRef.current || asyncVisible) && (onVisibleChanged == null || onVisibleChanged(asyncVisible)), firstMountChangeRef.current = !0);
|
|
7229
7126
|
}, [asyncVisible, currentStatus]);
|
|
7230
7127
|
var mergedStyle = style2;
|
|
7231
|
-
return eventHandlers[STEP_PREPARE] && step === STEP_START && (mergedStyle = _objectSpread2
|
|
7128
|
+
return eventHandlers[STEP_PREPARE] && step === STEP_START && (mergedStyle = _objectSpread2({
|
|
7232
7129
|
transition: "none"
|
|
7233
7130
|
}, mergedStyle)), [currentStatus, step, mergedStyle, asyncVisible != null ? asyncVisible : visible];
|
|
7234
7131
|
}
|
|
7235
7132
|
__name(useStatus, "useStatus");
|
|
7236
7133
|
function genCSSMotion(config) {
|
|
7237
7134
|
var transitionSupport = config;
|
|
7238
|
-
_typeof
|
|
7135
|
+
_typeof(config) === "object" && (transitionSupport = config.transitionSupport);
|
|
7239
7136
|
function isSupportTransition(props, contextMotion) {
|
|
7240
7137
|
return !!(props.motionName && transitionSupport && contextMotion !== !1);
|
|
7241
7138
|
}
|
|
@@ -7250,19 +7147,19 @@ function genCSSMotion(config) {
|
|
|
7250
7147
|
}
|
|
7251
7148
|
}
|
|
7252
7149
|
__name(getDomElement, "getDomElement");
|
|
7253
|
-
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);
|
|
7254
7151
|
mergedVisible && (renderedRef.current = !0);
|
|
7255
7152
|
var setNodeRef = React.useCallback(function(node) {
|
|
7256
7153
|
nodeRef.current = node, fillRef(ref, node);
|
|
7257
|
-
}, [ref]), motionChildren, mergedProps = _objectSpread2
|
|
7154
|
+
}, [ref]), motionChildren, mergedProps = _objectSpread2(_objectSpread2({}, eventProps), {}, {
|
|
7258
7155
|
visible
|
|
7259
7156
|
});
|
|
7260
7157
|
if (!children)
|
|
7261
7158
|
motionChildren = null;
|
|
7262
7159
|
else if (status === STATUS_NONE)
|
|
7263
|
-
mergedVisible ? motionChildren = children(_objectSpread2
|
|
7160
|
+
mergedVisible ? motionChildren = children(_objectSpread2({}, mergedProps), setNodeRef) : !removeOnLeave && renderedRef.current && leavedClassName ? motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, {
|
|
7264
7161
|
className: leavedClassName
|
|
7265
|
-
}), setNodeRef) : forceRender || !removeOnLeave && !leavedClassName ? motionChildren = children(_objectSpread2
|
|
7162
|
+
}), setNodeRef) : forceRender || !removeOnLeave && !leavedClassName ? motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, {
|
|
7266
7163
|
style: {
|
|
7267
7164
|
display: "none"
|
|
7268
7165
|
}
|
|
@@ -7271,8 +7168,8 @@ function genCSSMotion(config) {
|
|
|
7271
7168
|
var statusSuffix;
|
|
7272
7169
|
statusStep === STEP_PREPARE ? statusSuffix = "prepare" : isActive(statusStep) ? statusSuffix = "active" : statusStep === STEP_START && (statusSuffix = "start");
|
|
7273
7170
|
var motionCls = getTransitionName(motionName, "".concat(status, "-").concat(statusSuffix));
|
|
7274
|
-
motionChildren = children(_objectSpread2
|
|
7275
|
-
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")),
|
|
7276
7173
|
style: statusStyle
|
|
7277
7174
|
}), setNodeRef);
|
|
7278
7175
|
}
|
|
@@ -7293,9 +7190,9 @@ const CSSMotion = genCSSMotion(supportTransition);
|
|
|
7293
7190
|
var STATUS_ADD = "add", STATUS_KEEP = "keep", STATUS_REMOVE = "remove", STATUS_REMOVED = "removed";
|
|
7294
7191
|
function wrapKeyToObject(key) {
|
|
7295
7192
|
var keyObj;
|
|
7296
|
-
return key && _typeof
|
|
7193
|
+
return key && _typeof(key) === "object" && "key" in key ? keyObj = key : keyObj = {
|
|
7297
7194
|
key
|
|
7298
|
-
}, _objectSpread2
|
|
7195
|
+
}, _objectSpread2(_objectSpread2({}, keyObj), {}, {
|
|
7299
7196
|
key: String(keyObj.key)
|
|
7300
7197
|
});
|
|
7301
7198
|
}
|
|
@@ -7312,20 +7209,20 @@ function diffKeys() {
|
|
|
7312
7209
|
var currentKeyObj = currentKeyObjects[i];
|
|
7313
7210
|
if (currentKeyObj.key === keyObj.key) {
|
|
7314
7211
|
currentIndex < i && (list = list.concat(currentKeyObjects.slice(currentIndex, i).map(function(obj) {
|
|
7315
|
-
return _objectSpread2
|
|
7212
|
+
return _objectSpread2(_objectSpread2({}, obj), {}, {
|
|
7316
7213
|
status: STATUS_ADD
|
|
7317
7214
|
});
|
|
7318
|
-
})), currentIndex = i), list.push(_objectSpread2
|
|
7215
|
+
})), currentIndex = i), list.push(_objectSpread2(_objectSpread2({}, currentKeyObj), {}, {
|
|
7319
7216
|
status: STATUS_KEEP
|
|
7320
7217
|
})), currentIndex += 1, hit = !0;
|
|
7321
7218
|
break;
|
|
7322
7219
|
}
|
|
7323
7220
|
}
|
|
7324
|
-
hit || list.push(_objectSpread2
|
|
7221
|
+
hit || list.push(_objectSpread2(_objectSpread2({}, keyObj), {}, {
|
|
7325
7222
|
status: STATUS_REMOVE
|
|
7326
7223
|
}));
|
|
7327
7224
|
}), currentIndex < currentLen && (list = list.concat(currentKeyObjects.slice(currentIndex).map(function(obj) {
|
|
7328
|
-
return _objectSpread2
|
|
7225
|
+
return _objectSpread2(_objectSpread2({}, obj), {}, {
|
|
7329
7226
|
status: STATUS_ADD
|
|
7330
7227
|
});
|
|
7331
7228
|
})));
|
|
@@ -7357,11 +7254,11 @@ function genCSSMotionList(transitionSupport) {
|
|
|
7357
7254
|
_classCallCheck(this, CSSMotionList3);
|
|
7358
7255
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)
|
|
7359
7256
|
args[_key] = arguments[_key];
|
|
7360
|
-
return _this = _super.call.apply(_super, [this].concat(args)), _defineProperty
|
|
7257
|
+
return _this = _super.call.apply(_super, [this].concat(args)), _defineProperty(_assertThisInitialized(_this), "state", {
|
|
7361
7258
|
keyEntities: []
|
|
7362
|
-
}), _defineProperty
|
|
7259
|
+
}), _defineProperty(_assertThisInitialized(_this), "removeKey", function(removeKey) {
|
|
7363
7260
|
var keyEntities = _this.state.keyEntities, nextKeyEntities = keyEntities.map(function(entity) {
|
|
7364
|
-
return entity.key !== removeKey ? entity : _objectSpread2
|
|
7261
|
+
return entity.key !== removeKey ? entity : _objectSpread2(_objectSpread2({}, entity), {}, {
|
|
7365
7262
|
status: STATUS_REMOVED
|
|
7366
7263
|
});
|
|
7367
7264
|
});
|
|
@@ -7394,7 +7291,7 @@ function genCSSMotionList(transitionSupport) {
|
|
|
7394
7291
|
}
|
|
7395
7292
|
}, "onVisibleChanged")
|
|
7396
7293
|
}), function(props, ref) {
|
|
7397
|
-
return children(_objectSpread2
|
|
7294
|
+
return children(_objectSpread2(_objectSpread2({}, props), {}, {
|
|
7398
7295
|
index
|
|
7399
7296
|
}), ref);
|
|
7400
7297
|
});
|
|
@@ -7416,7 +7313,7 @@ function genCSSMotionList(transitionSupport) {
|
|
|
7416
7313
|
}, "getDerivedStateFromProps")
|
|
7417
7314
|
}]), CSSMotionList3;
|
|
7418
7315
|
}(React.Component);
|
|
7419
|
-
return _defineProperty
|
|
7316
|
+
return _defineProperty(CSSMotionList2, "defaultProps", {
|
|
7420
7317
|
component: "div"
|
|
7421
7318
|
}), CSSMotionList2;
|
|
7422
7319
|
}
|
|
@@ -7976,7 +7873,7 @@ function pickAttrs(props) {
|
|
|
7976
7873
|
}
|
|
7977
7874
|
__name(pickAttrs, "pickAttrs");
|
|
7978
7875
|
var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
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
|
|
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() {
|
|
7980
7877
|
onNoticeClose(eventKey);
|
|
7981
7878
|
}, "onInternalClose"), onCloseKeyDown = /* @__PURE__ */ __name(function(e2) {
|
|
7982
7879
|
(e2.key === "Enter" || e2.code === "Enter" || e2.keyCode === KeyCode.ENTER) && onInternalClose();
|
|
@@ -8004,13 +7901,13 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8004
7901
|
}
|
|
8005
7902
|
}, [duration, spentTime, mergedHovering, mergedShowProgress, times]);
|
|
8006
7903
|
var closableObj = React.useMemo(function() {
|
|
8007
|
-
return _typeof
|
|
7904
|
+
return _typeof(closable) === "object" && closable !== null ? closable : closable ? {
|
|
8008
7905
|
closeIcon
|
|
8009
7906
|
} : {};
|
|
8010
7907
|
}, [closable, closeIcon]), ariaProps = pickAttrs(closableObj, !0), validPercent = 100 - (!percent || percent < 0 ? 0 : percent > 100 ? 100 : percent), noticePrefixCls = "".concat(prefixCls, "-notice");
|
|
8011
7908
|
return /* @__PURE__ */ React.createElement("div", _extends({}, divProps, {
|
|
8012
7909
|
ref,
|
|
8013
|
-
className: clsx(noticePrefixCls, className, _defineProperty
|
|
7910
|
+
className: clsx(noticePrefixCls, className, _defineProperty({}, "".concat(noticePrefixCls, "-closable"), closable)),
|
|
8014
7911
|
style: style2,
|
|
8015
7912
|
onMouseEnter: /* @__PURE__ */ __name(function(e2) {
|
|
8016
7913
|
var _divProps$onMouseEnte;
|
|
@@ -8043,18 +7940,18 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8043
7940
|
threshold: DEFAULT_THRESHOLD,
|
|
8044
7941
|
gap: DEFAULT_GAP
|
|
8045
7942
|
};
|
|
8046
|
-
if (config && _typeof
|
|
7943
|
+
if (config && _typeof(config) === "object") {
|
|
8047
7944
|
var _config$offset, _config$threshold, _config$gap;
|
|
8048
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;
|
|
8049
7946
|
}
|
|
8050
7947
|
return [!!config, result];
|
|
8051
7948
|
}, "useStack"), _excluded$1 = ["className", "style", "classNames", "styles"], NoticeList = /* @__PURE__ */ __name(function(props) {
|
|
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
|
|
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) {
|
|
8053
7950
|
return {
|
|
8054
7951
|
config,
|
|
8055
7952
|
key: String(config.key)
|
|
8056
7953
|
};
|
|
8057
|
-
}), _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;
|
|
8058
7955
|
return useEffect(function() {
|
|
8059
7956
|
stack && hoverKeys.length > 1 && setHoverKeys(function(prev) {
|
|
8060
7957
|
return prev.filter(function(key) {
|
|
@@ -8072,7 +7969,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8072
7969
|
}
|
|
8073
7970
|
}, [keys, stack]), /* @__PURE__ */ React__default.createElement(CSSMotionList, _extends({
|
|
8074
7971
|
key: placement,
|
|
8075
|
-
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)),
|
|
8076
7973
|
style: style2,
|
|
8077
7974
|
keys,
|
|
8078
7975
|
motionAppear: !0
|
|
@@ -8101,7 +7998,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8101
7998
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
8102
7999
|
ref: nodeRef,
|
|
8103
8000
|
className: clsx("".concat(prefixCls, "-notice-wrapper"), motionClassName, configClassNames == null ? void 0 : configClassNames.wrapper),
|
|
8104
|
-
style: _objectSpread2
|
|
8001
|
+
style: _objectSpread2(_objectSpread2(_objectSpread2({}, motionStyle), stackStyle), configStyles == null ? void 0 : configStyles.wrapper),
|
|
8105
8002
|
onMouseEnter: /* @__PURE__ */ __name(function() {
|
|
8106
8003
|
return setHoverKeys(function(prev) {
|
|
8107
8004
|
return prev.includes(strKey) ? prev : [].concat(_toConsumableArray(prev), [strKey]);
|
|
@@ -8131,7 +8028,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8131
8028
|
})));
|
|
8132
8029
|
});
|
|
8133
8030
|
}, "NoticeList2"), Notifications = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
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
|
|
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) {
|
|
8135
8032
|
var _config$onClose, config = configList.find(function(item) {
|
|
8136
8033
|
return item.key === key;
|
|
8137
8034
|
});
|
|
@@ -8147,7 +8044,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8147
8044
|
setConfigList(function(list) {
|
|
8148
8045
|
var clone = _toConsumableArray(list), index = clone.findIndex(function(item) {
|
|
8149
8046
|
return item.key === config.key;
|
|
8150
|
-
}), innerConfig = _objectSpread2
|
|
8047
|
+
}), innerConfig = _objectSpread2({}, config);
|
|
8151
8048
|
if (index >= 0) {
|
|
8152
8049
|
var _list$index;
|
|
8153
8050
|
innerConfig.times = (((_list$index = list[index]) === null || _list$index === void 0 ? void 0 : _list$index.times) || 0) + 1, clone[index] = innerConfig;
|
|
@@ -8164,7 +8061,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8164
8061
|
}, "destroy")
|
|
8165
8062
|
};
|
|
8166
8063
|
});
|
|
8167
|
-
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];
|
|
8168
8065
|
React.useEffect(function() {
|
|
8169
8066
|
var nextPlacements = {};
|
|
8170
8067
|
configList.forEach(function(config) {
|
|
@@ -8176,7 +8073,7 @@ var Notify = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
|
8176
8073
|
}, [configList]);
|
|
8177
8074
|
var onAllNoticeRemoved = /* @__PURE__ */ __name(function(placement) {
|
|
8178
8075
|
setPlacements(function(originPlacements) {
|
|
8179
|
-
var clone = _objectSpread2
|
|
8076
|
+
var clone = _objectSpread2({}, originPlacements), list = clone[placement] || [];
|
|
8180
8077
|
return list.length || delete clone[placement], clone;
|
|
8181
8078
|
});
|
|
8182
8079
|
}, "onAllNoticeRemoved2"), emptyRef = React.useRef(!1);
|
|
@@ -8218,7 +8115,7 @@ function mergeConfig() {
|
|
|
8218
8115
|
}
|
|
8219
8116
|
__name(mergeConfig, "mergeConfig");
|
|
8220
8117
|
function useNotification() {
|
|
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
|
|
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, {
|
|
8222
8119
|
container,
|
|
8223
8120
|
ref: notificationsRef,
|
|
8224
8121
|
prefixCls,
|
|
@@ -8229,7 +8126,7 @@ function useNotification() {
|
|
|
8229
8126
|
onAllRemoved,
|
|
8230
8127
|
stack,
|
|
8231
8128
|
renderNotifications
|
|
8232
|
-
}), _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() {
|
|
8233
8130
|
return {
|
|
8234
8131
|
open: /* @__PURE__ */ __name(function(config) {
|
|
8235
8132
|
var mergedConfig = mergeConfig(shareConfig, config);
|