@itilite/lumina-ui 0.0.6 → 0.0.31
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/dist/cjs/index.css +1 -1
- package/dist/cjs/index.js +754 -396
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Button/types.d.ts +0 -2
- package/dist/cjs/types/components/Tag/Tag.d.ts +4 -0
- package/dist/cjs/types/components/Tag/index.d.ts +1 -0
- package/dist/cjs/types/components/Tag/type.d.ts +7 -0
- package/dist/cjs/types/components/index.d.ts +1 -0
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.js +754 -397
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Button/types.d.ts +0 -2
- package/dist/esm/types/components/Tag/Tag.d.ts +4 -0
- package/dist/esm/types/components/Tag/index.d.ts +1 -0
- package/dist/esm/types/components/Tag/type.d.ts +7 -0
- package/dist/esm/types/components/index.d.ts +1 -0
- package/dist/types/components/Button/Button.d.ts +4 -0
- package/dist/types/components/Button/Button.test.d.ts +1 -0
- package/dist/types/components/Button/index.d.ts +1 -0
- package/dist/types/components/Button/types.d.ts +16 -0
- package/dist/types/components/Checkbox/Checkbox.d.ts +4 -0
- package/dist/types/components/Checkbox/index.d.ts +1 -0
- package/dist/types/components/Checkbox/types.d.ts +11 -0
- package/dist/types/components/Modal/Modal.d.ts +3 -0
- package/dist/types/components/Modal/index.d.ts +1 -0
- package/dist/types/components/Modal/types.d.ts +21 -0
- package/dist/types/components/Radio/Radio.d.ts +4 -0
- package/dist/types/components/Radio/index.d.ts +1 -0
- package/dist/types/components/Radio/types.d.ts +11 -0
- package/dist/types/components/Switch/Switch.d.ts +4 -0
- package/dist/types/components/Switch/index.d.ts +1 -0
- package/dist/types/components/Switch/types.d.ts +7 -0
- package/dist/types/components/Tag/Tag.d.ts +4 -0
- package/dist/types/components/Tag/index.d.ts +1 -0
- package/dist/types/components/Tag/type.d.ts +7 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +3 -0
- package/dist/types/components/Tooltip/index.d.ts +1 -0
- package/dist/types/components/Tooltip/types.d.ts +8 -0
- package/dist/types/components/index.d.ts +7 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +16 -11
- package/src/components/Button/Button.module.scss +4 -10
- package/src/components/Button/Button.tsx +0 -7
- package/src/components/Button/types.ts +0 -3
- package/src/components/Tag/Tag.module.scss +61 -0
- package/src/components/Tag/Tag.tsx +34 -0
- package/src/components/Tag/index.ts +1 -0
- package/src/components/Tag/type.ts +7 -0
- package/src/components/index.ts +2 -1
package/dist/esm/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import classNames from 'classnames';
|
|
|
6
6
|
import { isMemo, ForwardRef } from 'react-is';
|
|
7
7
|
import * as ReactDOM from 'react-dom';
|
|
8
8
|
import ReactDOM__default, { createPortal } from 'react-dom';
|
|
9
|
+
import 'scroll-into-view-if-needed';
|
|
9
10
|
|
|
10
11
|
function _extends() {
|
|
11
12
|
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
@@ -45,7 +46,7 @@ function isFragment$1(object) {
|
|
|
45
46
|
);
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
function toArray$
|
|
49
|
+
function toArray$3(children) {
|
|
49
50
|
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
50
51
|
var ret = [];
|
|
51
52
|
React__default.Children.forEach(children, function (child) {
|
|
@@ -53,9 +54,9 @@ function toArray$2(children) {
|
|
|
53
54
|
return;
|
|
54
55
|
}
|
|
55
56
|
if (Array.isArray(child)) {
|
|
56
|
-
ret = ret.concat(toArray$
|
|
57
|
+
ret = ret.concat(toArray$3(child));
|
|
57
58
|
} else if (isFragment$1(child) && child.props) {
|
|
58
|
-
ret = ret.concat(toArray$
|
|
59
|
+
ret = ret.concat(toArray$3(child.props.children, option));
|
|
59
60
|
} else {
|
|
60
61
|
ret.push(child);
|
|
61
62
|
}
|
|
@@ -1501,7 +1502,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
1501
1502
|
var INTERNAL_PREFIX_KEY = 'rc-observer-key';
|
|
1502
1503
|
function ResizeObserver$1(props, ref) {
|
|
1503
1504
|
var children = props.children;
|
|
1504
|
-
var childNodes = typeof children === 'function' ? [children] : toArray$
|
|
1505
|
+
var childNodes = typeof children === 'function' ? [children] : toArray$3(children);
|
|
1505
1506
|
if (process.env.NODE_ENV !== 'production') {
|
|
1506
1507
|
if (childNodes.length > 1) {
|
|
1507
1508
|
warning$3(false, 'Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead.');
|
|
@@ -3998,10 +3999,9 @@ function resetWarned() {
|
|
|
3998
3999
|
deprecatedWarnList = null;
|
|
3999
4000
|
resetWarned$1();
|
|
4000
4001
|
}
|
|
4001
|
-
|
|
4002
|
-
let warning$2 = noop$1;
|
|
4002
|
+
let _warning = noop$1;
|
|
4003
4003
|
if (process.env.NODE_ENV !== 'production') {
|
|
4004
|
-
|
|
4004
|
+
_warning = (valid, component, message) => {
|
|
4005
4005
|
warningOnce(valid, `[antd: ${component}] ${message}`);
|
|
4006
4006
|
// StrictMode will inject console which will not throw warning in React 17.
|
|
4007
4007
|
if (process.env.NODE_ENV === 'test') {
|
|
@@ -4009,6 +4009,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
4009
4009
|
}
|
|
4010
4010
|
};
|
|
4011
4011
|
}
|
|
4012
|
+
const warning$2 = _warning;
|
|
4012
4013
|
const WarningContext = /*#__PURE__*/React.createContext({});
|
|
4013
4014
|
/**
|
|
4014
4015
|
* This is a hook but we not named as `useWarning`
|
|
@@ -5425,7 +5426,6 @@ function derivative(token) {
|
|
|
5425
5426
|
return prev;
|
|
5426
5427
|
}, {});
|
|
5427
5428
|
}).reduce((prev, cur) => {
|
|
5428
|
-
// biome-ignore lint/style/noParameterAssign: it is a reduce
|
|
5429
5429
|
prev = Object.assign(Object.assign({}, prev), cur);
|
|
5430
5430
|
return prev;
|
|
5431
5431
|
}, {});
|
|
@@ -6353,7 +6353,7 @@ function genStyleUtils(config) {
|
|
|
6353
6353
|
|
|
6354
6354
|
const PresetColors = ['blue', 'purple', 'cyan', 'green', 'magenta', 'pink', 'red', 'orange', 'yellow', 'volcano', 'geekblue', 'lime', 'gold'];
|
|
6355
6355
|
|
|
6356
|
-
var version$1 = '5.
|
|
6356
|
+
var version$1 = '5.26.5';
|
|
6357
6357
|
|
|
6358
6358
|
function isStableColor(color) {
|
|
6359
6359
|
return color >= 0 && color <= 255;
|
|
@@ -6396,7 +6396,7 @@ function getAlphaColor(frontColor, backgroundColor) {
|
|
|
6396
6396
|
}).toRgbString();
|
|
6397
6397
|
}
|
|
6398
6398
|
|
|
6399
|
-
var __rest$
|
|
6399
|
+
var __rest$g = undefined && undefined.__rest || function (s, e) {
|
|
6400
6400
|
var t = {};
|
|
6401
6401
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
6402
6402
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -6413,7 +6413,7 @@ function formatToken(derivativeToken) {
|
|
|
6413
6413
|
const {
|
|
6414
6414
|
override
|
|
6415
6415
|
} = derivativeToken,
|
|
6416
|
-
restToken = __rest$
|
|
6416
|
+
restToken = __rest$g(derivativeToken, ["override"]);
|
|
6417
6417
|
const overrideTokens = Object.assign({}, override);
|
|
6418
6418
|
Object.keys(seedToken).forEach(token => {
|
|
6419
6419
|
delete overrideTokens[token];
|
|
@@ -6570,7 +6570,7 @@ function formatToken(derivativeToken) {
|
|
|
6570
6570
|
return aliasToken;
|
|
6571
6571
|
}
|
|
6572
6572
|
|
|
6573
|
-
var __rest$
|
|
6573
|
+
var __rest$f = undefined && undefined.__rest || function (s, e) {
|
|
6574
6574
|
var t = {};
|
|
6575
6575
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
6576
6576
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -6632,7 +6632,7 @@ const getComputedToken = (originToken, overrideToken, theme) => {
|
|
|
6632
6632
|
const {
|
|
6633
6633
|
override
|
|
6634
6634
|
} = overrideToken,
|
|
6635
|
-
components = __rest$
|
|
6635
|
+
components = __rest$f(overrideToken, ["override"]);
|
|
6636
6636
|
// Merge with override
|
|
6637
6637
|
let mergedDerivativeToken = Object.assign(Object.assign({}, derivativeToken), {
|
|
6638
6638
|
override
|
|
@@ -6644,7 +6644,7 @@ const getComputedToken = (originToken, overrideToken, theme) => {
|
|
|
6644
6644
|
const {
|
|
6645
6645
|
theme: componentTheme
|
|
6646
6646
|
} = value,
|
|
6647
|
-
componentTokens = __rest$
|
|
6647
|
+
componentTokens = __rest$f(value, ["theme"]);
|
|
6648
6648
|
let mergedComponentToken = componentTokens;
|
|
6649
6649
|
if (componentTheme) {
|
|
6650
6650
|
mergedComponentToken = getComputedToken(Object.assign(Object.assign({}, mergedDerivativeToken), componentTokens), {
|
|
@@ -7754,7 +7754,12 @@ function genCSSMotionList(transitionSupport) {
|
|
|
7754
7754
|
}
|
|
7755
7755
|
genCSSMotionList(supportTransition);
|
|
7756
7756
|
|
|
7757
|
+
const MotionCacheContext = /*#__PURE__*/React.createContext(true);
|
|
7758
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
7759
|
+
MotionCacheContext.displayName = 'MotionCacheContext';
|
|
7760
|
+
}
|
|
7757
7761
|
function MotionWrapper(props) {
|
|
7762
|
+
const parentMotion = React.useContext(MotionCacheContext);
|
|
7758
7763
|
const {
|
|
7759
7764
|
children
|
|
7760
7765
|
} = props;
|
|
@@ -7763,11 +7768,13 @@ function MotionWrapper(props) {
|
|
|
7763
7768
|
motion
|
|
7764
7769
|
} = token;
|
|
7765
7770
|
const needWrapMotionProviderRef = React.useRef(false);
|
|
7766
|
-
needWrapMotionProviderRef.current
|
|
7771
|
+
needWrapMotionProviderRef.current || (needWrapMotionProviderRef.current = parentMotion !== motion);
|
|
7767
7772
|
if (needWrapMotionProviderRef.current) {
|
|
7768
|
-
return /*#__PURE__*/React.createElement(
|
|
7773
|
+
return /*#__PURE__*/React.createElement(MotionCacheContext.Provider, {
|
|
7774
|
+
value: motion
|
|
7775
|
+
}, /*#__PURE__*/React.createElement(MotionProvider, {
|
|
7769
7776
|
motion: motion
|
|
7770
|
-
}, children);
|
|
7777
|
+
}, children));
|
|
7771
7778
|
}
|
|
7772
7779
|
return children;
|
|
7773
7780
|
}
|
|
@@ -7788,7 +7795,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
7788
7795
|
}
|
|
7789
7796
|
var PropWarning$1 = process.env.NODE_ENV !== 'production' ? PropWarning : () => null;
|
|
7790
7797
|
|
|
7791
|
-
var __rest$
|
|
7798
|
+
var __rest$e = undefined && undefined.__rest || function (s, e) {
|
|
7792
7799
|
var t = {};
|
|
7793
7800
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
7794
7801
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -8118,7 +8125,7 @@ const ProviderChildren = props => {
|
|
|
8118
8125
|
components,
|
|
8119
8126
|
cssVar
|
|
8120
8127
|
} = _a,
|
|
8121
|
-
rest = __rest$
|
|
8128
|
+
rest = __rest$e(_a, ["algorithm", "token", "components", "cssVar"]);
|
|
8122
8129
|
const themeObj = algorithm && (!Array.isArray(algorithm) || algorithm.length > 0) ? createTheme(algorithm) : defaultTheme;
|
|
8123
8130
|
const parsedComponents = {};
|
|
8124
8131
|
Object.entries(components || {}).forEach(([componentName, componentToken]) => {
|
|
@@ -8682,274 +8689,259 @@ function usePatchElement() {
|
|
|
8682
8689
|
return [elements, patchElement];
|
|
8683
8690
|
}
|
|
8684
8691
|
|
|
8685
|
-
function
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
e = Object.prototype,
|
|
8692
|
-
n = e.hasOwnProperty,
|
|
8693
|
-
o = "function" == typeof Symbol ? Symbol : {},
|
|
8694
|
-
i = o.iterator || "@@iterator",
|
|
8695
|
-
a = o.asyncIterator || "@@asyncIterator",
|
|
8696
|
-
u = o.toStringTag || "@@toStringTag";
|
|
8697
|
-
function c(t, r, e, n) {
|
|
8698
|
-
Object.defineProperty(t, r, {
|
|
8699
|
-
value: e,
|
|
8700
|
-
enumerable: !n,
|
|
8701
|
-
configurable: !n,
|
|
8702
|
-
writable: !n
|
|
8703
|
-
});
|
|
8704
|
-
}
|
|
8692
|
+
function _OverloadYield(e, d) {
|
|
8693
|
+
this.v = e, this.k = d;
|
|
8694
|
+
}
|
|
8695
|
+
|
|
8696
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
8697
|
+
var i = Object.defineProperty;
|
|
8705
8698
|
try {
|
|
8706
|
-
|
|
8707
|
-
} catch (
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
|
|
8722
|
-
|
|
8723
|
-
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8699
|
+
i({}, "", {});
|
|
8700
|
+
} catch (e) {
|
|
8701
|
+
i = 0;
|
|
8702
|
+
}
|
|
8703
|
+
_regeneratorDefine = function regeneratorDefine(e, r, n, t) {
|
|
8704
|
+
if (r) i ? i(e, r, {
|
|
8705
|
+
value: n,
|
|
8706
|
+
enumerable: !t,
|
|
8707
|
+
configurable: !t,
|
|
8708
|
+
writable: !t
|
|
8709
|
+
}) : e[r] = n;else {
|
|
8710
|
+
var o = function o(r, n) {
|
|
8711
|
+
_regeneratorDefine(e, r, function (e) {
|
|
8712
|
+
return this._invoke(r, n, e);
|
|
8713
|
+
});
|
|
8714
|
+
};
|
|
8715
|
+
o("next", 0), o("throw", 1), o("return", 2);
|
|
8716
|
+
}
|
|
8717
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
8718
|
+
}
|
|
8719
|
+
|
|
8720
|
+
function _regenerator() {
|
|
8721
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
8722
|
+
var e,
|
|
8723
|
+
t,
|
|
8724
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
8725
|
+
n = r.iterator || "@@iterator",
|
|
8726
|
+
o = r.toStringTag || "@@toStringTag";
|
|
8727
|
+
function i(r, n, o, i) {
|
|
8728
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
8729
|
+
u = Object.create(c.prototype);
|
|
8730
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
8731
|
+
var i,
|
|
8732
|
+
c,
|
|
8733
|
+
u,
|
|
8734
|
+
f = 0,
|
|
8735
|
+
p = o || [],
|
|
8736
|
+
y = false,
|
|
8737
|
+
G = {
|
|
8738
|
+
p: 0,
|
|
8739
|
+
n: 0,
|
|
8740
|
+
v: e,
|
|
8741
|
+
a: d,
|
|
8742
|
+
f: d.bind(e, 4),
|
|
8743
|
+
d: function d(t, r) {
|
|
8744
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
8734
8745
|
}
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8746
|
+
};
|
|
8747
|
+
function d(r, n) {
|
|
8748
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
8749
|
+
var o,
|
|
8750
|
+
i = p[t],
|
|
8751
|
+
d = G.p,
|
|
8752
|
+
l = i[2];
|
|
8753
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
8754
|
+
}
|
|
8755
|
+
if (o || r > 1) return a;
|
|
8756
|
+
throw y = true, n;
|
|
8757
|
+
}
|
|
8758
|
+
return function (o, p, l) {
|
|
8759
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
8760
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
8761
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
8762
|
+
try {
|
|
8763
|
+
if (f = 2, i) {
|
|
8764
|
+
if (c || (o = "next"), t = i[o]) {
|
|
8765
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
8766
|
+
if (!t.done) return t;
|
|
8767
|
+
u = t.value, c < 2 && (c = 0);
|
|
8768
|
+
} else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
8769
|
+
i = e;
|
|
8770
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
8771
|
+
} catch (t) {
|
|
8772
|
+
i = e, c = 1, u = t;
|
|
8773
|
+
} finally {
|
|
8774
|
+
f = 1;
|
|
8747
8775
|
}
|
|
8748
|
-
"throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg);
|
|
8749
8776
|
}
|
|
8777
|
+
return {
|
|
8778
|
+
value: t,
|
|
8779
|
+
done: y
|
|
8780
|
+
};
|
|
8750
8781
|
};
|
|
8751
|
-
}(r,
|
|
8752
|
-
}
|
|
8753
|
-
function s(t, r, e) {
|
|
8754
|
-
try {
|
|
8755
|
-
return {
|
|
8756
|
-
type: "normal",
|
|
8757
|
-
arg: t.call(r, e)
|
|
8758
|
-
};
|
|
8759
|
-
} catch (t) {
|
|
8760
|
-
return {
|
|
8761
|
-
type: "throw",
|
|
8762
|
-
arg: t
|
|
8763
|
-
};
|
|
8764
|
-
}
|
|
8782
|
+
}(r, o, i), true), u;
|
|
8765
8783
|
}
|
|
8766
|
-
|
|
8767
|
-
var f = {};
|
|
8784
|
+
var a = {};
|
|
8768
8785
|
function Generator() {}
|
|
8769
8786
|
function GeneratorFunction() {}
|
|
8770
8787
|
function GeneratorFunctionPrototype() {}
|
|
8771
|
-
|
|
8772
|
-
c(
|
|
8788
|
+
t = Object.getPrototypeOf;
|
|
8789
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
8790
|
+
return this;
|
|
8791
|
+
}), t),
|
|
8792
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
8793
|
+
function f(e) {
|
|
8794
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
8795
|
+
}
|
|
8796
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
8773
8797
|
return this;
|
|
8774
|
-
})
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8798
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
8799
|
+
return "[object Generator]";
|
|
8800
|
+
}), (_regenerator = function _regenerator() {
|
|
8801
|
+
return {
|
|
8802
|
+
w: i,
|
|
8803
|
+
m: f
|
|
8804
|
+
};
|
|
8805
|
+
})();
|
|
8806
|
+
}
|
|
8807
|
+
|
|
8808
|
+
function AsyncIterator(t, e) {
|
|
8809
|
+
function n(r, o, i, f) {
|
|
8810
|
+
try {
|
|
8811
|
+
var c = t[r](o),
|
|
8812
|
+
u = c.value;
|
|
8813
|
+
return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) {
|
|
8814
|
+
n("next", t, i, f);
|
|
8815
|
+
}, function (t) {
|
|
8816
|
+
n("throw", t, i, f);
|
|
8817
|
+
}) : e.resolve(u).then(function (t) {
|
|
8818
|
+
c.value = t, i(c);
|
|
8819
|
+
}, function (t) {
|
|
8820
|
+
return n("throw", t, i, f);
|
|
8783
8821
|
});
|
|
8784
|
-
})
|
|
8785
|
-
|
|
8786
|
-
function AsyncIterator(t, r) {
|
|
8787
|
-
function e(o, i, a, u) {
|
|
8788
|
-
var c = s(t[o], t, i);
|
|
8789
|
-
if ("throw" !== c.type) {
|
|
8790
|
-
var h = c.arg,
|
|
8791
|
-
f = h.value;
|
|
8792
|
-
return f && "object" == _typeof(f) && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) {
|
|
8793
|
-
e("next", t, a, u);
|
|
8794
|
-
}, function (t) {
|
|
8795
|
-
e("throw", t, a, u);
|
|
8796
|
-
}) : r.resolve(f).then(function (t) {
|
|
8797
|
-
h.value = t, a(h);
|
|
8798
|
-
}, function (t) {
|
|
8799
|
-
return e("throw", t, a, u);
|
|
8800
|
-
});
|
|
8801
|
-
}
|
|
8802
|
-
u(c.arg);
|
|
8803
|
-
}
|
|
8804
|
-
var o;
|
|
8805
|
-
c(this, "_invoke", function (t, n) {
|
|
8806
|
-
function i() {
|
|
8807
|
-
return new r(function (r, o) {
|
|
8808
|
-
e(t, n, r, o);
|
|
8809
|
-
});
|
|
8810
|
-
}
|
|
8811
|
-
return o = o ? o.then(i, i) : i();
|
|
8812
|
-
}, true);
|
|
8813
|
-
}
|
|
8814
|
-
function d(r, e) {
|
|
8815
|
-
var n = e.method,
|
|
8816
|
-
o = r.i[n];
|
|
8817
|
-
if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f;
|
|
8818
|
-
var i = s(o, r.i, e.arg);
|
|
8819
|
-
if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f;
|
|
8820
|
-
var a = i.arg;
|
|
8821
|
-
return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f);
|
|
8822
|
-
}
|
|
8823
|
-
function w(t) {
|
|
8824
|
-
this.tryEntries.push(t);
|
|
8825
|
-
}
|
|
8826
|
-
function m(r) {
|
|
8827
|
-
var e = r[4] || {};
|
|
8828
|
-
e.type = "normal", e.arg = t, r[4] = e;
|
|
8829
|
-
}
|
|
8830
|
-
function Context(t) {
|
|
8831
|
-
this.tryEntries = [[-1]], t.forEach(w, this), this.reset(true);
|
|
8832
|
-
}
|
|
8833
|
-
function x(r) {
|
|
8834
|
-
if (null != r) {
|
|
8835
|
-
var e = r[i];
|
|
8836
|
-
if (e) return e.call(r);
|
|
8837
|
-
if ("function" == typeof r.next) return r;
|
|
8838
|
-
if (!isNaN(r.length)) {
|
|
8839
|
-
var o = -1,
|
|
8840
|
-
a = function e() {
|
|
8841
|
-
for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = false, e;
|
|
8842
|
-
return e.value = t, e.done = true, e;
|
|
8843
|
-
};
|
|
8844
|
-
return a.next = a;
|
|
8845
|
-
}
|
|
8822
|
+
} catch (t) {
|
|
8823
|
+
f(t);
|
|
8846
8824
|
}
|
|
8847
|
-
throw new TypeError(_typeof(r) + " is not iterable");
|
|
8848
8825
|
}
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name));
|
|
8852
|
-
}, r.mark = function (t) {
|
|
8853
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t;
|
|
8854
|
-
}, r.awrap = function (t) {
|
|
8855
|
-
return {
|
|
8856
|
-
__await: t
|
|
8857
|
-
};
|
|
8858
|
-
}, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () {
|
|
8859
|
-
return this;
|
|
8860
|
-
}), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) {
|
|
8861
|
-
void 0 === i && (i = Promise);
|
|
8862
|
-
var a = new AsyncIterator(h(t, e, n, o), i);
|
|
8863
|
-
return r.isGeneratorFunction(e) ? a : a.next().then(function (t) {
|
|
8864
|
-
return t.done ? t.value : a.next();
|
|
8865
|
-
});
|
|
8866
|
-
}, g(v), c(v, u, "Generator"), c(v, i, function () {
|
|
8826
|
+
var r;
|
|
8827
|
+
this.next || (_regeneratorDefine(AsyncIterator.prototype), _regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
|
|
8867
8828
|
return this;
|
|
8868
|
-
}),
|
|
8869
|
-
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
return
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
|
|
8881
|
-
|
|
8882
|
-
|
|
8883
|
-
|
|
8884
|
-
|
|
8885
|
-
|
|
8886
|
-
|
|
8887
|
-
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
|
|
8894
|
-
|
|
8895
|
-
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
|
|
8900
|
-
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8829
|
+
})), _regeneratorDefine(this, "_invoke", function (t, o, i) {
|
|
8830
|
+
function f() {
|
|
8831
|
+
return new e(function (e, r) {
|
|
8832
|
+
n(t, i, e, r);
|
|
8833
|
+
});
|
|
8834
|
+
}
|
|
8835
|
+
return r = r ? r.then(f, f) : f();
|
|
8836
|
+
}, true);
|
|
8837
|
+
}
|
|
8838
|
+
|
|
8839
|
+
function _regeneratorAsyncGen(r, e, t, o, n) {
|
|
8840
|
+
return new AsyncIterator(_regenerator().w(r, e, t, o), n || Promise);
|
|
8841
|
+
}
|
|
8842
|
+
|
|
8843
|
+
function _regeneratorAsync(n, e, r, t, o) {
|
|
8844
|
+
var a = _regeneratorAsyncGen(n, e, r, t, o);
|
|
8845
|
+
return a.next().then(function (n) {
|
|
8846
|
+
return n.done ? n.value : a.next();
|
|
8847
|
+
});
|
|
8848
|
+
}
|
|
8849
|
+
|
|
8850
|
+
function _regeneratorKeys(e) {
|
|
8851
|
+
var n = Object(e),
|
|
8852
|
+
r = [];
|
|
8853
|
+
for (var t in n) r.unshift(t);
|
|
8854
|
+
return function e() {
|
|
8855
|
+
for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = false, e;
|
|
8856
|
+
return e.done = true, e;
|
|
8857
|
+
};
|
|
8858
|
+
}
|
|
8859
|
+
|
|
8860
|
+
function _regeneratorValues(e) {
|
|
8861
|
+
if (null != e) {
|
|
8862
|
+
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
|
|
8863
|
+
r = 0;
|
|
8864
|
+
if (t) return t.call(e);
|
|
8865
|
+
if ("function" == typeof e.next) return e;
|
|
8866
|
+
if (!isNaN(e.length)) return {
|
|
8867
|
+
next: function next() {
|
|
8868
|
+
return e && r >= e.length && (e = void 0), {
|
|
8869
|
+
value: e && e[r++],
|
|
8870
|
+
done: !e
|
|
8871
|
+
};
|
|
8907
8872
|
}
|
|
8908
|
-
}
|
|
8909
|
-
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
|
|
8913
|
-
|
|
8914
|
-
|
|
8873
|
+
};
|
|
8874
|
+
}
|
|
8875
|
+
throw new TypeError(_typeof(e) + " is not iterable");
|
|
8876
|
+
}
|
|
8877
|
+
|
|
8878
|
+
function _regeneratorRuntime() {
|
|
8879
|
+
|
|
8880
|
+
var r = _regenerator(),
|
|
8881
|
+
e = r.m(_regeneratorRuntime),
|
|
8882
|
+
t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
|
|
8883
|
+
function n(r) {
|
|
8884
|
+
var e = "function" == typeof r && r.constructor;
|
|
8885
|
+
return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
|
|
8886
|
+
}
|
|
8887
|
+
var o = {
|
|
8888
|
+
"throw": 1,
|
|
8889
|
+
"return": 2,
|
|
8890
|
+
"break": 3,
|
|
8891
|
+
"continue": 3
|
|
8892
|
+
};
|
|
8893
|
+
function a(r) {
|
|
8894
|
+
var e, t;
|
|
8895
|
+
return function (n) {
|
|
8896
|
+
e || (e = {
|
|
8897
|
+
stop: function stop() {
|
|
8898
|
+
return t(n.a, 2);
|
|
8899
|
+
},
|
|
8900
|
+
"catch": function _catch() {
|
|
8901
|
+
return n.v;
|
|
8902
|
+
},
|
|
8903
|
+
abrupt: function abrupt(r, e) {
|
|
8904
|
+
return t(n.a, o[r], e);
|
|
8905
|
+
},
|
|
8906
|
+
delegateYield: function delegateYield(r, o, a) {
|
|
8907
|
+
return e.resultName = o, t(n.d, _regeneratorValues(r), a);
|
|
8908
|
+
},
|
|
8909
|
+
finish: function finish(r) {
|
|
8910
|
+
return t(n.f, r);
|
|
8915
8911
|
}
|
|
8916
|
-
}
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
if ("throw" === t.type) throw t.arg;
|
|
8923
|
-
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f;
|
|
8924
|
-
},
|
|
8925
|
-
finish: function finish(t) {
|
|
8926
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
8927
|
-
var e = this.tryEntries[r];
|
|
8928
|
-
if (e[2] === t) return this.complete(e[4], e[3]), m(e), f;
|
|
8929
|
-
}
|
|
8930
|
-
},
|
|
8931
|
-
"catch": function _catch(t) {
|
|
8932
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
8933
|
-
var e = this.tryEntries[r];
|
|
8934
|
-
if (e[0] === t) {
|
|
8935
|
-
var n = e[4];
|
|
8936
|
-
if ("throw" === n.type) {
|
|
8937
|
-
var o = n.arg;
|
|
8938
|
-
m(e);
|
|
8939
|
-
}
|
|
8940
|
-
return o;
|
|
8912
|
+
}, t = function t(r, _t, o) {
|
|
8913
|
+
n.p = e.prev, n.n = e.next;
|
|
8914
|
+
try {
|
|
8915
|
+
return r(_t, o);
|
|
8916
|
+
} finally {
|
|
8917
|
+
e.next = n.n;
|
|
8941
8918
|
}
|
|
8919
|
+
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
|
|
8920
|
+
try {
|
|
8921
|
+
return r.call(this, e);
|
|
8922
|
+
} finally {
|
|
8923
|
+
n.p = e.prev, n.n = e.next;
|
|
8942
8924
|
}
|
|
8943
|
-
|
|
8944
|
-
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
r
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8925
|
+
};
|
|
8926
|
+
}
|
|
8927
|
+
return (_regeneratorRuntime = function _regeneratorRuntime() {
|
|
8928
|
+
return {
|
|
8929
|
+
wrap: function wrap(e, t, n, o) {
|
|
8930
|
+
return r.w(a(e), t, n, o && o.reverse());
|
|
8931
|
+
},
|
|
8932
|
+
isGeneratorFunction: n,
|
|
8933
|
+
mark: r.m,
|
|
8934
|
+
awrap: function awrap(r, e) {
|
|
8935
|
+
return new _OverloadYield(r, e);
|
|
8936
|
+
},
|
|
8937
|
+
AsyncIterator: AsyncIterator,
|
|
8938
|
+
async: function async(r, e, t, o, u) {
|
|
8939
|
+
return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u);
|
|
8940
|
+
},
|
|
8941
|
+
keys: _regeneratorKeys,
|
|
8942
|
+
values: _regeneratorValues
|
|
8943
|
+
};
|
|
8944
|
+
})();
|
|
8953
8945
|
}
|
|
8954
8946
|
|
|
8955
8947
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
@@ -9165,7 +9157,7 @@ const genWaveStyle = token => {
|
|
|
9165
9157
|
}
|
|
9166
9158
|
};
|
|
9167
9159
|
};
|
|
9168
|
-
var useStyle$
|
|
9160
|
+
var useStyle$8 = genComponentStyleHook('Wave', token => [genWaveStyle(token)]);
|
|
9169
9161
|
|
|
9170
9162
|
const TARGET_CLS = `${defaultPrefixCls}-wave-target`;
|
|
9171
9163
|
|
|
@@ -9370,7 +9362,7 @@ const Wave = props => {
|
|
|
9370
9362
|
const containerRef = useRef(null);
|
|
9371
9363
|
// ============================== Style ===============================
|
|
9372
9364
|
const prefixCls = getPrefixCls('wave');
|
|
9373
|
-
const [, hashId] = useStyle$
|
|
9365
|
+
const [, hashId] = useStyle$8(prefixCls);
|
|
9374
9366
|
// =============================== Wave ===============================
|
|
9375
9367
|
const showWave = useWave(containerRef, classNames(prefixCls, hashId), component);
|
|
9376
9368
|
// ============================== Effect ==============================
|
|
@@ -9467,7 +9459,7 @@ const NoCompactStyle = props => {
|
|
|
9467
9459
|
}, children);
|
|
9468
9460
|
};
|
|
9469
9461
|
|
|
9470
|
-
var __rest$
|
|
9462
|
+
var __rest$d = undefined && undefined.__rest || function (s, e) {
|
|
9471
9463
|
var t = {};
|
|
9472
9464
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
9473
9465
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -9486,7 +9478,7 @@ const ButtonGroup = props => {
|
|
|
9486
9478
|
size,
|
|
9487
9479
|
className
|
|
9488
9480
|
} = props,
|
|
9489
|
-
others = __rest$
|
|
9481
|
+
others = __rest$d(props, ["prefixCls", "size", "className"]);
|
|
9490
9482
|
const prefixCls = getPrefixCls('btn-group', customizePrefixCls);
|
|
9491
9483
|
const [,, hashId] = useToken();
|
|
9492
9484
|
const sizeCls = React.useMemo(() => {
|
|
@@ -10721,7 +10713,7 @@ const isBright = (value, bgColorToken) => {
|
|
|
10721
10713
|
return r * 0.299 + g * 0.587 + b * 0.114 > 192;
|
|
10722
10714
|
};
|
|
10723
10715
|
|
|
10724
|
-
const prepareToken$
|
|
10716
|
+
const prepareToken$2 = token => {
|
|
10725
10717
|
const {
|
|
10726
10718
|
paddingInline,
|
|
10727
10719
|
onlyIconSize
|
|
@@ -10733,7 +10725,7 @@ const prepareToken$1 = token => {
|
|
|
10733
10725
|
});
|
|
10734
10726
|
return buttonToken;
|
|
10735
10727
|
};
|
|
10736
|
-
const prepareComponentToken$
|
|
10728
|
+
const prepareComponentToken$6 = token => {
|
|
10737
10729
|
var _a, _b, _c, _d, _e, _f;
|
|
10738
10730
|
const contentFontSize = (_a = token.contentFontSize) !== null && _a !== void 0 ? _a : token.fontSize;
|
|
10739
10731
|
const contentFontSizeSM = (_b = token.contentFontSizeSM) !== null && _b !== void 0 ? _b : token.fontSize;
|
|
@@ -11236,8 +11228,8 @@ const genBlockButtonStyle = token => {
|
|
|
11236
11228
|
};
|
|
11237
11229
|
};
|
|
11238
11230
|
// ============================== Export ==============================
|
|
11239
|
-
var useStyle$
|
|
11240
|
-
const buttonToken = prepareToken$
|
|
11231
|
+
var useStyle$7 = genStyleHooks('Button', token => {
|
|
11232
|
+
const buttonToken = prepareToken$2(token);
|
|
11241
11233
|
return [
|
|
11242
11234
|
// Shared
|
|
11243
11235
|
genSharedButtonStyle(buttonToken),
|
|
@@ -11251,7 +11243,7 @@ var useStyle$6 = genStyleHooks('Button', token => {
|
|
|
11251
11243
|
genCompatibleButtonStyle(buttonToken),
|
|
11252
11244
|
// Button Group
|
|
11253
11245
|
genGroupStyle(buttonToken)];
|
|
11254
|
-
}, prepareComponentToken$
|
|
11246
|
+
}, prepareComponentToken$6, {
|
|
11255
11247
|
unitless: {
|
|
11256
11248
|
fontWeight: true,
|
|
11257
11249
|
contentLineHeight: true,
|
|
@@ -11393,13 +11385,13 @@ const genButtonCompactStyle = token => {
|
|
|
11393
11385
|
};
|
|
11394
11386
|
// ============================== Export ==============================
|
|
11395
11387
|
var Compact = genSubStyleComponent(['Button', 'compact'], token => {
|
|
11396
|
-
const buttonToken = prepareToken$
|
|
11388
|
+
const buttonToken = prepareToken$2(token);
|
|
11397
11389
|
return [
|
|
11398
11390
|
// Space Compact
|
|
11399
11391
|
genCompactItemStyle(buttonToken), genCompactItemVerticalStyle(buttonToken), genButtonCompactStyle(buttonToken)];
|
|
11400
|
-
}, prepareComponentToken$
|
|
11392
|
+
}, prepareComponentToken$6);
|
|
11401
11393
|
|
|
11402
|
-
var __rest$
|
|
11394
|
+
var __rest$c = undefined && undefined.__rest || function (s, e) {
|
|
11403
11395
|
var t = {};
|
|
11404
11396
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
11405
11397
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -11456,7 +11448,7 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
11456
11448
|
autoInsertSpace,
|
|
11457
11449
|
autoFocus
|
|
11458
11450
|
} = props,
|
|
11459
|
-
rest = __rest$
|
|
11451
|
+
rest = __rest$c(props, ["loading", "prefixCls", "color", "variant", "type", "danger", "shape", "size", "styles", "disabled", "className", "rootClassName", "children", "icon", "iconPosition", "ghost", "block", "htmlType", "classNames", "style", "autoInsertSpace", "autoFocus"]);
|
|
11460
11452
|
// https://github.com/ant-design/ant-design/issues/47605
|
|
11461
11453
|
// Compatible with original `type` behavior
|
|
11462
11454
|
const mergedType = type || 'default';
|
|
@@ -11496,7 +11488,7 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
11496
11488
|
} = useComponentConfig('button');
|
|
11497
11489
|
const mergedInsertSpace = (_a = autoInsertSpace !== null && autoInsertSpace !== void 0 ? autoInsertSpace : contextAutoInsertSpace) !== null && _a !== void 0 ? _a : true;
|
|
11498
11490
|
const prefixCls = getPrefixCls('btn', customizePrefixCls);
|
|
11499
|
-
const [wrapCSSVar, hashId, cssVarCls] = useStyle$
|
|
11491
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$7(prefixCls);
|
|
11500
11492
|
const disabled = useContext(DisabledContext);
|
|
11501
11493
|
const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
11502
11494
|
const groupSize = useContext(GroupSizeContext);
|
|
@@ -11517,8 +11509,9 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
11517
11509
|
};
|
|
11518
11510
|
}, []);
|
|
11519
11511
|
// ========================= Effect =========================
|
|
11520
|
-
// Loading
|
|
11521
|
-
|
|
11512
|
+
// Loading. Should use `useLayoutEffect` to avoid low perf multiple click issue.
|
|
11513
|
+
// https://github.com/ant-design/ant-design/issues/51325
|
|
11514
|
+
useLayoutEffect$1(() => {
|
|
11522
11515
|
let delayTimer = null;
|
|
11523
11516
|
if (loadingOrDelay.delay > 0) {
|
|
11524
11517
|
delayTimer = setTimeout(() => {
|
|
@@ -11535,7 +11528,7 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
|
|
|
11535
11528
|
}
|
|
11536
11529
|
}
|
|
11537
11530
|
return cleanupTimer;
|
|
11538
|
-
}, [loadingOrDelay]);
|
|
11531
|
+
}, [loadingOrDelay.delay, loadingOrDelay.loading]);
|
|
11539
11532
|
// Two chinese characters check
|
|
11540
11533
|
useEffect(() => {
|
|
11541
11534
|
// FIXME: for HOC usage like <FormatMessage />
|
|
@@ -12676,7 +12669,7 @@ var Context = /*#__PURE__*/React.createContext({
|
|
|
12676
12669
|
|
|
12677
12670
|
var ListContext = /*#__PURE__*/React.createContext(null);
|
|
12678
12671
|
|
|
12679
|
-
function toArray$
|
|
12672
|
+
function toArray$2(value) {
|
|
12680
12673
|
if (value === undefined || value === null) {
|
|
12681
12674
|
return [];
|
|
12682
12675
|
}
|
|
@@ -14142,7 +14135,7 @@ function _finishOnFirstFailed() {
|
|
|
14142
14135
|
* ['a', 123] => ['a', 123]
|
|
14143
14136
|
*/
|
|
14144
14137
|
function getNamePath(path) {
|
|
14145
|
-
return toArray$
|
|
14138
|
+
return toArray$2(path);
|
|
14146
14139
|
}
|
|
14147
14140
|
function cloneByNamePathList(store, namePathList) {
|
|
14148
14141
|
var newStore = {};
|
|
@@ -14503,7 +14496,7 @@ var Field = /*#__PURE__*/function (_React$Component) {
|
|
|
14503
14496
|
if (!validateTrigger) {
|
|
14504
14497
|
return true;
|
|
14505
14498
|
}
|
|
14506
|
-
var triggerList = toArray$
|
|
14499
|
+
var triggerList = toArray$2(validateTrigger);
|
|
14507
14500
|
return triggerList.includes(triggerName);
|
|
14508
14501
|
});
|
|
14509
14502
|
}
|
|
@@ -14633,7 +14626,7 @@ var Field = /*#__PURE__*/function (_React$Component) {
|
|
|
14633
14626
|
}
|
|
14634
14627
|
|
|
14635
14628
|
// Filed element only
|
|
14636
|
-
var childList = toArray$
|
|
14629
|
+
var childList = toArray$3(children);
|
|
14637
14630
|
if (childList.length !== 1 || ! /*#__PURE__*/React.isValidElement(childList[0])) {
|
|
14638
14631
|
return {
|
|
14639
14632
|
child: childList,
|
|
@@ -14714,7 +14707,7 @@ var Field = /*#__PURE__*/function (_React$Component) {
|
|
|
14714
14707
|
};
|
|
14715
14708
|
|
|
14716
14709
|
// Add validateTrigger
|
|
14717
|
-
var validateTriggerList = toArray$
|
|
14710
|
+
var validateTriggerList = toArray$2(mergedValidateTrigger || []);
|
|
14718
14711
|
validateTriggerList.forEach(function (triggerName) {
|
|
14719
14712
|
// Wrap additional function of component, so that we can get latest value from store
|
|
14720
14713
|
var originTrigger = control[triggerName];
|
|
@@ -16388,6 +16381,7 @@ function useClosable(propCloseCollection, contextCloseCollection, fallbackCloseC
|
|
|
16388
16381
|
}, [propCloseConfig, contextCloseConfig, mergedFallbackCloseCollection]);
|
|
16389
16382
|
// Calculate the final closeIcon
|
|
16390
16383
|
return React__default.useMemo(() => {
|
|
16384
|
+
var _a, _b;
|
|
16391
16385
|
if (mergedClosableConfig === false) {
|
|
16392
16386
|
return [false, null, closeBtnIsDisabled, {}];
|
|
16393
16387
|
}
|
|
@@ -16405,9 +16399,9 @@ function useClosable(propCloseCollection, contextCloseCollection, fallbackCloseC
|
|
|
16405
16399
|
if (closeIconRender) {
|
|
16406
16400
|
mergedCloseIcon = closeIconRender(closeIcon);
|
|
16407
16401
|
}
|
|
16408
|
-
mergedCloseIcon = /*#__PURE__*/React__default.isValidElement(mergedCloseIcon) ? (/*#__PURE__*/React__default.cloneElement(mergedCloseIcon, Object.assign({
|
|
16409
|
-
'aria-label': contextLocale.close
|
|
16410
|
-
}, ariaOrDataProps))) : (/*#__PURE__*/React__default.createElement("span", Object.assign({
|
|
16402
|
+
mergedCloseIcon = /*#__PURE__*/React__default.isValidElement(mergedCloseIcon) ? (/*#__PURE__*/React__default.cloneElement(mergedCloseIcon, Object.assign(Object.assign(Object.assign({}, mergedCloseIcon.props), {
|
|
16403
|
+
'aria-label': (_b = (_a = mergedCloseIcon.props) === null || _a === void 0 ? void 0 : _a['aria-label']) !== null && _b !== void 0 ? _b : contextLocale.close
|
|
16404
|
+
}), ariaOrDataProps))) : (/*#__PURE__*/React__default.createElement("span", Object.assign({
|
|
16411
16405
|
"aria-label": contextLocale.close
|
|
16412
16406
|
}, ariaOrDataProps), mergedCloseIcon));
|
|
16413
16407
|
}
|
|
@@ -16595,7 +16589,7 @@ const genSkeletonElementButton = token => {
|
|
|
16595
16589
|
}), genSkeletonElementButtonShape(token, controlHeightSM, `${skeletonButtonCls}-sm`));
|
|
16596
16590
|
};
|
|
16597
16591
|
// =============================== Base ===============================
|
|
16598
|
-
const genBaseStyle = token => {
|
|
16592
|
+
const genBaseStyle$1 = token => {
|
|
16599
16593
|
const {
|
|
16600
16594
|
componentCls,
|
|
16601
16595
|
skeletonAvatarCls,
|
|
@@ -16713,7 +16707,7 @@ const genBaseStyle = token => {
|
|
|
16713
16707
|
};
|
|
16714
16708
|
};
|
|
16715
16709
|
// ============================== Export ==============================
|
|
16716
|
-
const prepareComponentToken$
|
|
16710
|
+
const prepareComponentToken$5 = token => {
|
|
16717
16711
|
const {
|
|
16718
16712
|
colorFillContent,
|
|
16719
16713
|
colorFill
|
|
@@ -16731,7 +16725,7 @@ const prepareComponentToken$4 = token => {
|
|
|
16731
16725
|
paragraphLiHeight: token.controlHeight / 2
|
|
16732
16726
|
};
|
|
16733
16727
|
};
|
|
16734
|
-
var useStyle$
|
|
16728
|
+
var useStyle$6 = genStyleHooks('Skeleton', token => {
|
|
16735
16729
|
const {
|
|
16736
16730
|
componentCls,
|
|
16737
16731
|
calc
|
|
@@ -16749,8 +16743,8 @@ var useStyle$5 = genStyleHooks('Skeleton', token => {
|
|
|
16749
16743
|
skeletonLoadingBackground: `linear-gradient(90deg, ${token.gradientFromColor} 25%, ${token.gradientToColor} 37%, ${token.gradientFromColor} 63%)`,
|
|
16750
16744
|
skeletonLoadingMotionDuration: '1.4s'
|
|
16751
16745
|
});
|
|
16752
|
-
return [genBaseStyle(skeletonToken)];
|
|
16753
|
-
}, prepareComponentToken$
|
|
16746
|
+
return [genBaseStyle$1(skeletonToken)];
|
|
16747
|
+
}, prepareComponentToken$5, {
|
|
16754
16748
|
deprecatedTokens: [['color', 'gradientFromColor'], ['colorGradientEnd', 'gradientToColor']]
|
|
16755
16749
|
});
|
|
16756
16750
|
|
|
@@ -16767,7 +16761,7 @@ const SkeletonAvatar = props => {
|
|
|
16767
16761
|
getPrefixCls
|
|
16768
16762
|
} = React.useContext(ConfigContext);
|
|
16769
16763
|
const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
|
|
16770
|
-
const [wrapCSSVar, hashId, cssVarCls] = useStyle$
|
|
16764
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$6(prefixCls);
|
|
16771
16765
|
const otherProps = omit(props, ['prefixCls', 'className']);
|
|
16772
16766
|
const cls = classNames(prefixCls, `${prefixCls}-element`, {
|
|
16773
16767
|
[`${prefixCls}-active`]: active
|
|
@@ -16794,7 +16788,7 @@ const SkeletonButton = props => {
|
|
|
16794
16788
|
getPrefixCls
|
|
16795
16789
|
} = React.useContext(ConfigContext);
|
|
16796
16790
|
const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
|
|
16797
|
-
const [wrapCSSVar, hashId, cssVarCls] = useStyle$
|
|
16791
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$6(prefixCls);
|
|
16798
16792
|
const otherProps = omit(props, ['prefixCls']);
|
|
16799
16793
|
const cls = classNames(prefixCls, `${prefixCls}-element`, {
|
|
16800
16794
|
[`${prefixCls}-active`]: active,
|
|
@@ -16821,7 +16815,7 @@ const SkeletonImage = props => {
|
|
|
16821
16815
|
getPrefixCls
|
|
16822
16816
|
} = React.useContext(ConfigContext);
|
|
16823
16817
|
const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
|
|
16824
|
-
const [wrapCSSVar, hashId, cssVarCls] = useStyle$
|
|
16818
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$6(prefixCls);
|
|
16825
16819
|
const cls = classNames(prefixCls, `${prefixCls}-element`, {
|
|
16826
16820
|
[`${prefixCls}-active`]: active
|
|
16827
16821
|
}, className, rootClassName, hashId, cssVarCls);
|
|
@@ -16853,7 +16847,7 @@ const SkeletonInput = props => {
|
|
|
16853
16847
|
getPrefixCls
|
|
16854
16848
|
} = React.useContext(ConfigContext);
|
|
16855
16849
|
const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
|
|
16856
|
-
const [wrapCSSVar, hashId, cssVarCls] = useStyle$
|
|
16850
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$6(prefixCls);
|
|
16857
16851
|
const otherProps = omit(props, ['prefixCls']);
|
|
16858
16852
|
const cls = classNames(prefixCls, `${prefixCls}-element`, {
|
|
16859
16853
|
[`${prefixCls}-active`]: active,
|
|
@@ -16880,7 +16874,7 @@ const SkeletonNode = props => {
|
|
|
16880
16874
|
getPrefixCls
|
|
16881
16875
|
} = React.useContext(ConfigContext);
|
|
16882
16876
|
const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
|
|
16883
|
-
const [wrapCSSVar, hashId, cssVarCls] = useStyle$
|
|
16877
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$6(prefixCls);
|
|
16884
16878
|
const cls = classNames(prefixCls, `${prefixCls}-element`, {
|
|
16885
16879
|
[`${prefixCls}-active`]: active
|
|
16886
16880
|
}, hashId, className, rootClassName, cssVarCls);
|
|
@@ -17012,7 +17006,7 @@ const Skeleton = props => {
|
|
|
17012
17006
|
style: contextStyle
|
|
17013
17007
|
} = useComponentConfig('skeleton');
|
|
17014
17008
|
const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
|
|
17015
|
-
const [wrapCSSVar, hashId, cssVarCls] = useStyle$
|
|
17009
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$6(prefixCls);
|
|
17016
17010
|
if (loading || !('loading' in props)) {
|
|
17017
17011
|
const hasAvatar = !!avatar;
|
|
17018
17012
|
const hasTitle = !!title;
|
|
@@ -17562,23 +17556,30 @@ const genResponsiveWidthStyle = token => {
|
|
|
17562
17556
|
const {
|
|
17563
17557
|
componentCls
|
|
17564
17558
|
} = token;
|
|
17565
|
-
const
|
|
17559
|
+
const oriGridMediaSizesMap = getMediaSize(token);
|
|
17560
|
+
const gridMediaSizesMap = Object.assign({}, oriGridMediaSizesMap);
|
|
17566
17561
|
delete gridMediaSizesMap.xs;
|
|
17562
|
+
const cssVarPrefix = `--${componentCls.replace('.', '')}-`;
|
|
17567
17563
|
const responsiveStyles = Object.keys(gridMediaSizesMap).map(key => ({
|
|
17568
17564
|
[`@media (min-width: ${unit$1(gridMediaSizesMap[key])})`]: {
|
|
17569
|
-
width: `var(
|
|
17565
|
+
width: `var(${cssVarPrefix}${key}-width)`
|
|
17570
17566
|
}
|
|
17571
17567
|
}));
|
|
17572
17568
|
return {
|
|
17573
17569
|
[`${componentCls}-root`]: {
|
|
17574
|
-
[componentCls]: [{
|
|
17575
|
-
|
|
17576
|
-
|
|
17570
|
+
[componentCls]: [].concat(_toConsumableArray(Object.keys(oriGridMediaSizesMap).map((currentKey, index) => {
|
|
17571
|
+
const previousKey = Object.keys(oriGridMediaSizesMap)[index - 1];
|
|
17572
|
+
return previousKey ? {
|
|
17573
|
+
[`${cssVarPrefix}${currentKey}-width`]: `var(${cssVarPrefix}${previousKey}-width)`
|
|
17574
|
+
} : null;
|
|
17575
|
+
})), [{
|
|
17576
|
+
width: `var(${cssVarPrefix}xs-width)`
|
|
17577
|
+
}], _toConsumableArray(responsiveStyles))
|
|
17577
17578
|
}
|
|
17578
17579
|
};
|
|
17579
17580
|
};
|
|
17580
17581
|
// ============================== Export ==============================
|
|
17581
|
-
const prepareToken = token => {
|
|
17582
|
+
const prepareToken$1 = token => {
|
|
17582
17583
|
const headerPaddingVertical = token.padding;
|
|
17583
17584
|
const headerFontSize = token.fontSizeHeading5;
|
|
17584
17585
|
const headerLineHeight = token.lineHeightHeading5;
|
|
@@ -17595,7 +17596,7 @@ const prepareToken = token => {
|
|
|
17595
17596
|
});
|
|
17596
17597
|
return modalToken;
|
|
17597
17598
|
};
|
|
17598
|
-
const prepareComponentToken$
|
|
17599
|
+
const prepareComponentToken$4 = token => ({
|
|
17599
17600
|
footerBg: 'transparent',
|
|
17600
17601
|
headerBg: token.colorBgElevated,
|
|
17601
17602
|
titleLineHeight: token.lineHeightHeading5,
|
|
@@ -17616,16 +17617,16 @@ const prepareComponentToken$3 = token => ({
|
|
|
17616
17617
|
confirmIconMarginInlineEnd: token.wireframe ? token.margin : token.marginSM,
|
|
17617
17618
|
confirmBtnsMarginTop: token.wireframe ? token.marginLG : token.marginSM
|
|
17618
17619
|
});
|
|
17619
|
-
var useStyle$
|
|
17620
|
-
const modalToken = prepareToken(token);
|
|
17620
|
+
var useStyle$5 = genStyleHooks('Modal', token => {
|
|
17621
|
+
const modalToken = prepareToken$1(token);
|
|
17621
17622
|
return [genModalStyle(modalToken), genRTLStyle(modalToken), genModalMaskStyle(modalToken), initZoomMotion(modalToken, 'zoom'), genResponsiveWidthStyle(modalToken)];
|
|
17622
|
-
}, prepareComponentToken$
|
|
17623
|
+
}, prepareComponentToken$4, {
|
|
17623
17624
|
unitless: {
|
|
17624
17625
|
titleLineHeight: true
|
|
17625
17626
|
}
|
|
17626
17627
|
});
|
|
17627
17628
|
|
|
17628
|
-
var __rest$
|
|
17629
|
+
var __rest$b = undefined && undefined.__rest || function (s, e) {
|
|
17629
17630
|
var t = {};
|
|
17630
17631
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
17631
17632
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -17678,7 +17679,7 @@ const Modal$2 = props => {
|
|
|
17678
17679
|
destroyOnHidden,
|
|
17679
17680
|
destroyOnClose
|
|
17680
17681
|
} = props,
|
|
17681
|
-
restProps = __rest$
|
|
17682
|
+
restProps = __rest$b(props, ["prefixCls", "className", "rootClassName", "open", "wrapClassName", "centered", "getContainer", "focusTriggerAfterClose", "style", "visible", "width", "footer", "classNames", "styles", "children", "loading", "confirmLoading", "zIndex", "mousePosition", "onOk", "onCancel", "destroyOnHidden", "destroyOnClose"]);
|
|
17682
17683
|
const {
|
|
17683
17684
|
getPopupContainer: getContextPopupContainer,
|
|
17684
17685
|
getPrefixCls,
|
|
@@ -17704,7 +17705,7 @@ const Modal$2 = props => {
|
|
|
17704
17705
|
const rootPrefixCls = getPrefixCls();
|
|
17705
17706
|
// Style
|
|
17706
17707
|
const rootCls = useCSSVarCls(prefixCls);
|
|
17707
|
-
const [wrapCSSVar, hashId, cssVarCls] = useStyle$
|
|
17708
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$5(prefixCls, rootCls);
|
|
17708
17709
|
const wrapClassNameExtended = classNames(wrapClassName, {
|
|
17709
17710
|
[`${prefixCls}-centered`]: centered !== null && centered !== void 0 ? centered : modalContext === null || modalContext === void 0 ? void 0 : modalContext.centered,
|
|
17710
17711
|
[`${prefixCls}-wrap-rtl`]: direction === 'rtl'
|
|
@@ -17880,14 +17881,14 @@ const genModalConfirmStyle = token => {
|
|
|
17880
17881
|
};
|
|
17881
17882
|
// ============================== Export ==============================
|
|
17882
17883
|
var Confirm = genSubStyleComponent(['Modal', 'confirm'], token => {
|
|
17883
|
-
const modalToken = prepareToken(token);
|
|
17884
|
+
const modalToken = prepareToken$1(token);
|
|
17884
17885
|
return [genModalConfirmStyle(modalToken)];
|
|
17885
|
-
}, prepareComponentToken$
|
|
17886
|
+
}, prepareComponentToken$4, {
|
|
17886
17887
|
// confirm is weak than modal since no conflict here
|
|
17887
17888
|
order: -1e3
|
|
17888
17889
|
});
|
|
17889
17890
|
|
|
17890
|
-
var __rest$
|
|
17891
|
+
var __rest$a = undefined && undefined.__rest || function (s, e) {
|
|
17891
17892
|
var t = {};
|
|
17892
17893
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
17893
17894
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -17908,7 +17909,7 @@ function ConfirmContent(props) {
|
|
|
17908
17909
|
// Legacy for static function usage
|
|
17909
17910
|
locale: staticLocale
|
|
17910
17911
|
} = props,
|
|
17911
|
-
resetProps = __rest$
|
|
17912
|
+
resetProps = __rest$a(props, ["prefixCls", "icon", "okText", "cancelText", "confirmPrefixCls", "type", "okCancel", "footer", "locale"]);
|
|
17912
17913
|
if (process.env.NODE_ENV !== 'production') {
|
|
17913
17914
|
const warning = devUseWarning('Modal');
|
|
17914
17915
|
process.env.NODE_ENV !== "production" ? warning(!(typeof icon === 'string' && icon.length > 2), 'breaking', `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${icon}\` at https://ant.design/components/icon`) : void 0;
|
|
@@ -18208,7 +18209,7 @@ function modalGlobalConfig({
|
|
|
18208
18209
|
defaultRootPrefixCls = rootPrefixCls;
|
|
18209
18210
|
}
|
|
18210
18211
|
|
|
18211
|
-
var __rest$
|
|
18212
|
+
var __rest$9 = undefined && undefined.__rest || function (s, e) {
|
|
18212
18213
|
var t = {};
|
|
18213
18214
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
18214
18215
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -18222,7 +18223,7 @@ const HookModal = (_a, ref) => {
|
|
|
18222
18223
|
afterClose: hookAfterClose,
|
|
18223
18224
|
config
|
|
18224
18225
|
} = _a,
|
|
18225
|
-
restProps = __rest$
|
|
18226
|
+
restProps = __rest$9(_a, ["afterClose", "config"]);
|
|
18226
18227
|
const [open, setOpen] = React.useState(true);
|
|
18227
18228
|
const [innerConfig, setInnerConfig] = React.useState(config);
|
|
18228
18229
|
const {
|
|
@@ -18248,7 +18249,10 @@ const HookModal = (_a, ref) => {
|
|
|
18248
18249
|
React.useImperativeHandle(ref, () => ({
|
|
18249
18250
|
destroy: close,
|
|
18250
18251
|
update: newConfig => {
|
|
18251
|
-
setInnerConfig(originConfig =>
|
|
18252
|
+
setInnerConfig(originConfig => {
|
|
18253
|
+
const nextConfig = typeof newConfig === 'function' ? newConfig(originConfig) : newConfig;
|
|
18254
|
+
return Object.assign(Object.assign({}, originConfig), nextConfig);
|
|
18255
|
+
});
|
|
18252
18256
|
}
|
|
18253
18257
|
}));
|
|
18254
18258
|
const mergedOkCancel = (_b = innerConfig.okCancel) !== null && _b !== void 0 ? _b : innerConfig.type === 'confirm';
|
|
@@ -18663,13 +18667,13 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
18663
18667
|
|
|
18664
18668
|
var TriggerContext = /*#__PURE__*/React.createContext(null);
|
|
18665
18669
|
|
|
18666
|
-
function toArray(val) {
|
|
18670
|
+
function toArray$1(val) {
|
|
18667
18671
|
return val ? Array.isArray(val) ? val : [val] : [];
|
|
18668
18672
|
}
|
|
18669
18673
|
function useAction(mobile, action, showAction, hideAction) {
|
|
18670
18674
|
return React.useMemo(function () {
|
|
18671
|
-
var mergedShowAction = toArray(showAction !== null && showAction !== void 0 ? showAction : action);
|
|
18672
|
-
var mergedHideAction = toArray(hideAction !== null && hideAction !== void 0 ? hideAction : action);
|
|
18675
|
+
var mergedShowAction = toArray$1(showAction !== null && showAction !== void 0 ? showAction : action);
|
|
18676
|
+
var mergedHideAction = toArray$1(hideAction !== null && hideAction !== void 0 ? hideAction : action);
|
|
18673
18677
|
var showActionSet = new Set(mergedShowAction);
|
|
18674
18678
|
var hideActionSet = new Set(mergedHideAction);
|
|
18675
18679
|
if (mobile) {
|
|
@@ -18945,8 +18949,6 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
18945
18949
|
var doc = popupElement.ownerDocument;
|
|
18946
18950
|
var win = getWin(popupElement);
|
|
18947
18951
|
var _win$getComputedStyle = win.getComputedStyle(popupElement),
|
|
18948
|
-
width = _win$getComputedStyle.width,
|
|
18949
|
-
height = _win$getComputedStyle.height,
|
|
18950
18952
|
popupPosition = _win$getComputedStyle.position;
|
|
18951
18953
|
var originLeft = popupElement.style.left;
|
|
18952
18954
|
var originTop = popupElement.style.top;
|
|
@@ -18995,6 +18997,9 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
18995
18997
|
};
|
|
18996
18998
|
}
|
|
18997
18999
|
var popupRect = popupElement.getBoundingClientRect();
|
|
19000
|
+
var _win$getComputedStyle2 = win.getComputedStyle(popupElement),
|
|
19001
|
+
height = _win$getComputedStyle2.height,
|
|
19002
|
+
width = _win$getComputedStyle2.width;
|
|
18998
19003
|
popupRect.x = (_popupRect$x = popupRect.x) !== null && _popupRect$x !== void 0 ? _popupRect$x : popupRect.left;
|
|
18999
19004
|
popupRect.y = (_popupRect$y = popupRect.y) !== null && _popupRect$y !== void 0 ? _popupRect$y : popupRect.top;
|
|
19000
19005
|
var _doc$documentElement = doc.documentElement,
|
|
@@ -20655,7 +20660,7 @@ const genTooltipStyle = token => {
|
|
|
20655
20660
|
}];
|
|
20656
20661
|
};
|
|
20657
20662
|
// ============================== Export ==============================
|
|
20658
|
-
const prepareComponentToken$
|
|
20663
|
+
const prepareComponentToken$3 = token => Object.assign(Object.assign({
|
|
20659
20664
|
zIndexPopup: token.zIndexPopupBase + 70
|
|
20660
20665
|
}, getArrowOffsetToken({
|
|
20661
20666
|
contentRadius: token.borderRadius,
|
|
@@ -20663,7 +20668,7 @@ const prepareComponentToken$2 = token => Object.assign(Object.assign({
|
|
|
20663
20668
|
})), getArrowToken(merge(token, {
|
|
20664
20669
|
borderRadiusOuter: Math.min(token.borderRadiusOuter, 4)
|
|
20665
20670
|
})));
|
|
20666
|
-
var useStyle$
|
|
20671
|
+
var useStyle$4 = (prefixCls, injectStyle = true) => {
|
|
20667
20672
|
const useStyle = genStyleHooks('Tooltip', token => {
|
|
20668
20673
|
const {
|
|
20669
20674
|
borderRadius,
|
|
@@ -20678,7 +20683,7 @@ var useStyle$3 = (prefixCls, injectStyle = true) => {
|
|
|
20678
20683
|
tooltipBg: colorBgSpotlight
|
|
20679
20684
|
});
|
|
20680
20685
|
return [genTooltipStyle(TooltipToken), initZoomMotion(token, 'zoom-big-fast')];
|
|
20681
|
-
}, prepareComponentToken$
|
|
20686
|
+
}, prepareComponentToken$3, {
|
|
20682
20687
|
resetStyle: false,
|
|
20683
20688
|
// Popover use Tooltip as internal component. We do not need to handle this.
|
|
20684
20689
|
injectStyle
|
|
@@ -20687,6 +20692,7 @@ var useStyle$3 = (prefixCls, injectStyle = true) => {
|
|
|
20687
20692
|
};
|
|
20688
20693
|
|
|
20689
20694
|
const inverseColors = PresetColors.map(color => `${color}-inverse`);
|
|
20695
|
+
const PresetStatusColorTypes = ['success', 'processing', 'error', 'default', 'warning'];
|
|
20690
20696
|
/**
|
|
20691
20697
|
* determine if the color keyword belongs to the `Ant Design` {@link PresetColors}.
|
|
20692
20698
|
* @param color color to be judged
|
|
@@ -20698,6 +20704,9 @@ function isPresetColor(color, includeInverse = true) {
|
|
|
20698
20704
|
}
|
|
20699
20705
|
return PresetColors.includes(color);
|
|
20700
20706
|
}
|
|
20707
|
+
function isPresetStatusColor(color) {
|
|
20708
|
+
return PresetStatusColorTypes.includes(color);
|
|
20709
|
+
}
|
|
20701
20710
|
|
|
20702
20711
|
function parseColor(prefixCls, color) {
|
|
20703
20712
|
const isInternalColor = isPresetColor(color);
|
|
@@ -20732,7 +20741,7 @@ const PurePanel$2 = props => {
|
|
|
20732
20741
|
getPrefixCls
|
|
20733
20742
|
} = React.useContext(ConfigContext);
|
|
20734
20743
|
const prefixCls = getPrefixCls('tooltip', customizePrefixCls);
|
|
20735
|
-
const [wrapCSSVar, hashId, cssVarCls] = useStyle$
|
|
20744
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$4(prefixCls);
|
|
20736
20745
|
// Color
|
|
20737
20746
|
const colorInfo = parseColor(prefixCls, color);
|
|
20738
20747
|
const arrowContentStyle = colorInfo.arrowStyle;
|
|
@@ -20750,7 +20759,7 @@ const PurePanel$2 = props => {
|
|
|
20750
20759
|
}), title)));
|
|
20751
20760
|
};
|
|
20752
20761
|
|
|
20753
|
-
var __rest$
|
|
20762
|
+
var __rest$8 = undefined && undefined.__rest || function (s, e) {
|
|
20754
20763
|
var t = {};
|
|
20755
20764
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
20756
20765
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -20788,7 +20797,7 @@ const InternalTooltip = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
20788
20797
|
styles,
|
|
20789
20798
|
classNames: tooltipClassNames
|
|
20790
20799
|
} = props,
|
|
20791
|
-
restProps = __rest$
|
|
20800
|
+
restProps = __rest$8(props, ["prefixCls", "openClassName", "getTooltipContainer", "color", "overlayInnerStyle", "children", "afterOpenChange", "afterVisibleChange", "destroyTooltipOnHide", "destroyOnHidden", "arrow", "title", "overlay", "builtinPlacements", "arrowPointAtCenter", "autoAdjustOverflow", "motion", "getPopupContainer", "placement", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "rootClassName", "overlayClassName", "styles", "classNames"]);
|
|
20792
20801
|
const mergedShowArrow = !!arrow;
|
|
20793
20802
|
const [, token] = useToken();
|
|
20794
20803
|
const {
|
|
@@ -20876,7 +20885,7 @@ const InternalTooltip = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
20876
20885
|
const childProps = child.props;
|
|
20877
20886
|
const childCls = !childProps.className || typeof childProps.className === 'string' ? classNames(childProps.className, openClassName || `${prefixCls}-open`) : childProps.className;
|
|
20878
20887
|
// Style
|
|
20879
|
-
const [wrapCSSVar, hashId, cssVarCls] = useStyle$
|
|
20888
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$4(prefixCls, !injectFromPopover);
|
|
20880
20889
|
// Color
|
|
20881
20890
|
const colorInfo = parseColor(prefixCls, color);
|
|
20882
20891
|
const arrowContentStyle = colorInfo.arrowStyle;
|
|
@@ -21438,7 +21447,7 @@ const getRadioButtonStyle = token => {
|
|
|
21438
21447
|
};
|
|
21439
21448
|
};
|
|
21440
21449
|
// ============================== Export ==============================
|
|
21441
|
-
const prepareComponentToken$
|
|
21450
|
+
const prepareComponentToken$2 = token => {
|
|
21442
21451
|
const {
|
|
21443
21452
|
wireframe,
|
|
21444
21453
|
padding,
|
|
@@ -21480,7 +21489,7 @@ const prepareComponentToken$1 = token => {
|
|
|
21480
21489
|
radioBgColor: wireframe ? colorBgContainer : colorPrimary
|
|
21481
21490
|
};
|
|
21482
21491
|
};
|
|
21483
|
-
var useStyle$
|
|
21492
|
+
var useStyle$3 = genStyleHooks('Radio', token => {
|
|
21484
21493
|
const {
|
|
21485
21494
|
controlOutline,
|
|
21486
21495
|
controlOutlineWidth
|
|
@@ -21492,14 +21501,14 @@ var useStyle$2 = genStyleHooks('Radio', token => {
|
|
|
21492
21501
|
radioButtonFocusShadow
|
|
21493
21502
|
});
|
|
21494
21503
|
return [getGroupRadioStyle(radioToken), getRadioBasicStyle(radioToken), getRadioButtonStyle(radioToken)];
|
|
21495
|
-
}, prepareComponentToken$
|
|
21504
|
+
}, prepareComponentToken$2, {
|
|
21496
21505
|
unitless: {
|
|
21497
21506
|
radioSize: true,
|
|
21498
21507
|
dotSize: true
|
|
21499
21508
|
}
|
|
21500
21509
|
});
|
|
21501
21510
|
|
|
21502
|
-
var __rest$
|
|
21511
|
+
var __rest$7 = undefined && undefined.__rest || function (s, e) {
|
|
21503
21512
|
var t = {};
|
|
21504
21513
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
21505
21514
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -21538,13 +21547,13 @@ const InternalRadio = (props, ref) => {
|
|
|
21538
21547
|
style,
|
|
21539
21548
|
title
|
|
21540
21549
|
} = props,
|
|
21541
|
-
restProps = __rest$
|
|
21550
|
+
restProps = __rest$7(props, ["prefixCls", "className", "rootClassName", "children", "style", "title"]);
|
|
21542
21551
|
const radioPrefixCls = getPrefixCls('radio', customizePrefixCls);
|
|
21543
21552
|
const isButtonType = ((groupContext === null || groupContext === void 0 ? void 0 : groupContext.optionType) || radioOptionTypeContext) === 'button';
|
|
21544
21553
|
const prefixCls = isButtonType ? `${radioPrefixCls}-button` : radioPrefixCls;
|
|
21545
21554
|
// Style
|
|
21546
21555
|
const rootCls = useCSSVarCls(radioPrefixCls);
|
|
21547
|
-
const [wrapCSSVar, hashId, cssVarCls] = useStyle$
|
|
21556
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$3(radioPrefixCls, rootCls);
|
|
21548
21557
|
const radioProps = Object.assign({}, restProps);
|
|
21549
21558
|
// ===================== Disabled =====================
|
|
21550
21559
|
const disabled = React.useContext(DisabledContext);
|
|
@@ -21592,12 +21601,35 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
21592
21601
|
Radio$2.displayName = 'Radio';
|
|
21593
21602
|
}
|
|
21594
21603
|
|
|
21604
|
+
// form item name black list. in form ,you can use form.id get the form item element.
|
|
21605
|
+
// use object hasOwnProperty will get better performance if black list is longer.
|
|
21606
|
+
function toArray(candidate) {
|
|
21607
|
+
if (candidate === undefined || candidate === false) return [];
|
|
21608
|
+
return Array.isArray(candidate) ? candidate : [candidate];
|
|
21609
|
+
}
|
|
21610
|
+
|
|
21611
|
+
undefined && undefined.__rest || function (s, e) {
|
|
21612
|
+
var t = {};
|
|
21613
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
21614
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
21615
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
21616
|
+
}
|
|
21617
|
+
return t;
|
|
21618
|
+
};
|
|
21619
|
+
function toNamePathStr(name) {
|
|
21620
|
+
const namePath = toArray(name);
|
|
21621
|
+
return namePath.join('_');
|
|
21622
|
+
}
|
|
21623
|
+
|
|
21595
21624
|
const RadioGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
21596
21625
|
const {
|
|
21597
21626
|
getPrefixCls,
|
|
21598
21627
|
direction
|
|
21599
21628
|
} = React.useContext(ConfigContext);
|
|
21600
|
-
const
|
|
21629
|
+
const {
|
|
21630
|
+
name: formItemName
|
|
21631
|
+
} = React.useContext(FormItemInputContext);
|
|
21632
|
+
const defaultName = useId(toNamePathStr(formItemName));
|
|
21601
21633
|
const {
|
|
21602
21634
|
prefixCls: customizePrefixCls,
|
|
21603
21635
|
className,
|
|
@@ -21637,7 +21669,7 @@ const RadioGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
21637
21669
|
const groupPrefixCls = `${prefixCls}-group`;
|
|
21638
21670
|
// Style
|
|
21639
21671
|
const rootCls = useCSSVarCls(prefixCls);
|
|
21640
|
-
const [wrapCSSVar, hashId, cssVarCls] = useStyle$
|
|
21672
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$3(prefixCls, rootCls);
|
|
21641
21673
|
let childrenToRender = children;
|
|
21642
21674
|
// 如果存在 options, 优先使用
|
|
21643
21675
|
if (options && options.length > 0) {
|
|
@@ -21699,7 +21731,7 @@ const RadioGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
21699
21731
|
});
|
|
21700
21732
|
var Group = /*#__PURE__*/React.memo(RadioGroup);
|
|
21701
21733
|
|
|
21702
|
-
var __rest$
|
|
21734
|
+
var __rest$6 = undefined && undefined.__rest || function (s, e) {
|
|
21703
21735
|
var t = {};
|
|
21704
21736
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
21705
21737
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -21714,7 +21746,7 @@ const RadioButton = (props, ref) => {
|
|
|
21714
21746
|
const {
|
|
21715
21747
|
prefixCls: customizePrefixCls
|
|
21716
21748
|
} = props,
|
|
21717
|
-
radioProps = __rest$
|
|
21749
|
+
radioProps = __rest$6(props, ["prefixCls"]);
|
|
21718
21750
|
const prefixCls = getPrefixCls('radio', customizePrefixCls);
|
|
21719
21751
|
return /*#__PURE__*/React.createElement(RadioOptionTypeContextProvider, {
|
|
21720
21752
|
value: "button"
|
|
@@ -21883,26 +21915,28 @@ const genCheckboxStyle = token => {
|
|
|
21883
21915
|
{
|
|
21884
21916
|
[checkboxCls]: {
|
|
21885
21917
|
'&-indeterminate': {
|
|
21886
|
-
|
|
21887
|
-
|
|
21888
|
-
|
|
21889
|
-
|
|
21890
|
-
|
|
21891
|
-
|
|
21892
|
-
|
|
21893
|
-
|
|
21894
|
-
|
|
21895
|
-
|
|
21896
|
-
|
|
21897
|
-
|
|
21898
|
-
|
|
21899
|
-
|
|
21918
|
+
'&': {
|
|
21919
|
+
// Wrapper > Checkbox > inner
|
|
21920
|
+
[`${checkboxCls}-inner`]: {
|
|
21921
|
+
backgroundColor: `${token.colorBgContainer}`,
|
|
21922
|
+
borderColor: `${token.colorBorder}`,
|
|
21923
|
+
'&:after': {
|
|
21924
|
+
top: '50%',
|
|
21925
|
+
insetInlineStart: '50%',
|
|
21926
|
+
width: token.calc(token.fontSizeLG).div(2).equal(),
|
|
21927
|
+
height: token.calc(token.fontSizeLG).div(2).equal(),
|
|
21928
|
+
backgroundColor: token.colorPrimary,
|
|
21929
|
+
border: 0,
|
|
21930
|
+
transform: 'translate(-50%, -50%) scale(1)',
|
|
21931
|
+
opacity: 1,
|
|
21932
|
+
content: '""'
|
|
21933
|
+
}
|
|
21934
|
+
},
|
|
21935
|
+
// https://github.com/ant-design/ant-design/issues/50074
|
|
21936
|
+
[`&:hover ${checkboxCls}-inner`]: {
|
|
21937
|
+
backgroundColor: `${token.colorBgContainer}`,
|
|
21938
|
+
borderColor: `${token.colorPrimary}`
|
|
21900
21939
|
}
|
|
21901
|
-
},
|
|
21902
|
-
// https://github.com/ant-design/ant-design/issues/50074
|
|
21903
|
-
[`&:hover ${checkboxCls}-inner`]: {
|
|
21904
|
-
backgroundColor: `${token.colorBgContainer} !important`,
|
|
21905
|
-
borderColor: `${token.colorPrimary} !important`
|
|
21906
21940
|
}
|
|
21907
21941
|
}
|
|
21908
21942
|
}
|
|
@@ -21950,13 +21984,13 @@ function getStyle(prefixCls, token) {
|
|
|
21950
21984
|
});
|
|
21951
21985
|
return [genCheckboxStyle(checkboxToken)];
|
|
21952
21986
|
}
|
|
21953
|
-
var useStyle$
|
|
21987
|
+
var useStyle$2 = genStyleHooks('Checkbox', (token, {
|
|
21954
21988
|
prefixCls
|
|
21955
21989
|
}) => [getStyle(prefixCls, token)]);
|
|
21956
21990
|
|
|
21957
21991
|
const GroupContext = /*#__PURE__*/React__default.createContext(null);
|
|
21958
21992
|
|
|
21959
|
-
var __rest$
|
|
21993
|
+
var __rest$5 = undefined && undefined.__rest || function (s, e) {
|
|
21960
21994
|
var t = {};
|
|
21961
21995
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
21962
21996
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -21978,7 +22012,7 @@ const InternalCheckbox = (props, ref) => {
|
|
|
21978
22012
|
skipGroup = false,
|
|
21979
22013
|
disabled
|
|
21980
22014
|
} = props,
|
|
21981
|
-
restProps = __rest$
|
|
22015
|
+
restProps = __rest$5(props, ["prefixCls", "className", "rootClassName", "children", "indeterminate", "style", "onMouseEnter", "onMouseLeave", "skipGroup", "disabled"]);
|
|
21982
22016
|
const {
|
|
21983
22017
|
getPrefixCls,
|
|
21984
22018
|
direction,
|
|
@@ -22019,7 +22053,7 @@ const InternalCheckbox = (props, ref) => {
|
|
|
22019
22053
|
}, [indeterminate]);
|
|
22020
22054
|
const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
22021
22055
|
const rootCls = useCSSVarCls(prefixCls);
|
|
22022
|
-
const [wrapCSSVar, hashId, cssVarCls] = useStyle$
|
|
22056
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$2(prefixCls, rootCls);
|
|
22023
22057
|
const checkboxProps = Object.assign({}, restProps);
|
|
22024
22058
|
if (checkboxGroup && !skipGroup) {
|
|
22025
22059
|
checkboxProps.onChange = (...args) => {
|
|
@@ -22072,7 +22106,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
22072
22106
|
Checkbox$2.displayName = 'Checkbox';
|
|
22073
22107
|
}
|
|
22074
22108
|
|
|
22075
|
-
var __rest$
|
|
22109
|
+
var __rest$4 = undefined && undefined.__rest || function (s, e) {
|
|
22076
22110
|
var t = {};
|
|
22077
22111
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
22078
22112
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -22091,7 +22125,7 @@ const CheckboxGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
22091
22125
|
style,
|
|
22092
22126
|
onChange
|
|
22093
22127
|
} = props,
|
|
22094
|
-
restProps = __rest$
|
|
22128
|
+
restProps = __rest$4(props, ["defaultValue", "children", "options", "prefixCls", "className", "rootClassName", "style", "onChange"]);
|
|
22095
22129
|
const {
|
|
22096
22130
|
getPrefixCls,
|
|
22097
22131
|
direction
|
|
@@ -22138,7 +22172,7 @@ const CheckboxGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
22138
22172
|
const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
22139
22173
|
const groupPrefixCls = `${prefixCls}-group`;
|
|
22140
22174
|
const rootCls = useCSSVarCls(prefixCls);
|
|
22141
|
-
const [wrapCSSVar, hashId, cssVarCls] = useStyle$
|
|
22175
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$2(prefixCls, rootCls);
|
|
22142
22176
|
const domProps = omit(restProps, ['value', 'disabled']);
|
|
22143
22177
|
const childrenNode = options.length ? memoizedOptions.map(option => (/*#__PURE__*/React.createElement(Checkbox$2, {
|
|
22144
22178
|
prefixCls: prefixCls,
|
|
@@ -22182,7 +22216,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
22182
22216
|
Checkbox$1.displayName = 'Checkbox';
|
|
22183
22217
|
}
|
|
22184
22218
|
|
|
22185
|
-
var __rest$
|
|
22219
|
+
var __rest$3 = undefined && undefined.__rest || function (s, e) {
|
|
22186
22220
|
var t = {};
|
|
22187
22221
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
22188
22222
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -22201,14 +22235,14 @@ const PurePanel = props => {
|
|
|
22201
22235
|
children,
|
|
22202
22236
|
footer
|
|
22203
22237
|
} = props,
|
|
22204
|
-
restProps = __rest$
|
|
22238
|
+
restProps = __rest$3(props, ["prefixCls", "className", "closeIcon", "closable", "type", "title", "children", "footer"]);
|
|
22205
22239
|
const {
|
|
22206
22240
|
getPrefixCls
|
|
22207
22241
|
} = React.useContext(ConfigContext);
|
|
22208
22242
|
const rootPrefixCls = getPrefixCls();
|
|
22209
22243
|
const prefixCls = customizePrefixCls || getPrefixCls('modal');
|
|
22210
22244
|
const rootCls = useCSSVarCls(rootPrefixCls);
|
|
22211
|
-
const [wrapCSSVar, hashId, cssVarCls] = useStyle$
|
|
22245
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$5(prefixCls, rootCls);
|
|
22212
22246
|
const confirmPrefixCls = `${prefixCls}-confirm`;
|
|
22213
22247
|
// Choose target props by confirm mark
|
|
22214
22248
|
let additionalProps = {};
|
|
@@ -22604,7 +22638,7 @@ const genSwitchStyle = token => {
|
|
|
22604
22638
|
};
|
|
22605
22639
|
};
|
|
22606
22640
|
// ============================== Export ==============================
|
|
22607
|
-
const prepareComponentToken = token => {
|
|
22641
|
+
const prepareComponentToken$1 = token => {
|
|
22608
22642
|
const {
|
|
22609
22643
|
fontSize,
|
|
22610
22644
|
lineHeight,
|
|
@@ -22633,7 +22667,7 @@ const prepareComponentToken = token => {
|
|
|
22633
22667
|
innerMaxMarginSM: handleSizeSM + padding + padding * 2
|
|
22634
22668
|
};
|
|
22635
22669
|
};
|
|
22636
|
-
var useStyle = genStyleHooks('Switch', token => {
|
|
22670
|
+
var useStyle$1 = genStyleHooks('Switch', token => {
|
|
22637
22671
|
const switchToken = merge(token, {
|
|
22638
22672
|
switchDuration: token.motionDurationMid,
|
|
22639
22673
|
switchColor: token.colorPrimary,
|
|
@@ -22651,9 +22685,9 @@ var useStyle = genStyleHooks('Switch', token => {
|
|
|
22651
22685
|
genSwitchLoadingStyle(switchToken),
|
|
22652
22686
|
// small style
|
|
22653
22687
|
genSwitchSmallStyle(switchToken)];
|
|
22654
|
-
}, prepareComponentToken);
|
|
22688
|
+
}, prepareComponentToken$1);
|
|
22655
22689
|
|
|
22656
|
-
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
22690
|
+
var __rest$2 = undefined && undefined.__rest || function (s, e) {
|
|
22657
22691
|
var t = {};
|
|
22658
22692
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
22659
22693
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -22676,7 +22710,7 @@ const InternalSwitch = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
22676
22710
|
defaultValue,
|
|
22677
22711
|
onChange
|
|
22678
22712
|
} = props,
|
|
22679
|
-
restProps = __rest(props, ["prefixCls", "size", "disabled", "loading", "className", "rootClassName", "style", "checked", "value", "defaultChecked", "defaultValue", "onChange"]);
|
|
22713
|
+
restProps = __rest$2(props, ["prefixCls", "size", "disabled", "loading", "className", "rootClassName", "style", "checked", "value", "defaultChecked", "defaultValue", "onChange"]);
|
|
22680
22714
|
const [checked, setChecked] = useMergedState(false, {
|
|
22681
22715
|
value: checkedProp !== null && checkedProp !== void 0 ? checkedProp : value,
|
|
22682
22716
|
defaultValue: defaultCheckedProp !== null && defaultCheckedProp !== void 0 ? defaultCheckedProp : defaultValue
|
|
@@ -22696,7 +22730,7 @@ const InternalSwitch = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
22696
22730
|
className: `${prefixCls}-loading-icon`
|
|
22697
22731
|
}));
|
|
22698
22732
|
// Style
|
|
22699
|
-
const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);
|
|
22733
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle$1(prefixCls);
|
|
22700
22734
|
const mergedSize = useSize(customizeSize);
|
|
22701
22735
|
const classes = classNames(SWITCH === null || SWITCH === void 0 ? void 0 : SWITCH.className, {
|
|
22702
22736
|
[`${prefixCls}-small`]: mergedSize === 'small',
|
|
@@ -22727,12 +22761,327 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
22727
22761
|
Switch$1.displayName = 'Switch';
|
|
22728
22762
|
}
|
|
22729
22763
|
|
|
22764
|
+
// ============================== Styles ==============================
|
|
22765
|
+
const genBaseStyle = token => {
|
|
22766
|
+
const {
|
|
22767
|
+
paddingXXS,
|
|
22768
|
+
lineWidth,
|
|
22769
|
+
tagPaddingHorizontal,
|
|
22770
|
+
componentCls,
|
|
22771
|
+
calc
|
|
22772
|
+
} = token;
|
|
22773
|
+
const paddingInline = calc(tagPaddingHorizontal).sub(lineWidth).equal();
|
|
22774
|
+
const iconMarginInline = calc(paddingXXS).sub(lineWidth).equal();
|
|
22775
|
+
return {
|
|
22776
|
+
// Result
|
|
22777
|
+
[componentCls]: Object.assign(Object.assign({}, resetComponent(token)), {
|
|
22778
|
+
display: 'inline-block',
|
|
22779
|
+
height: 'auto',
|
|
22780
|
+
// https://github.com/ant-design/ant-design/pull/47504
|
|
22781
|
+
marginInlineEnd: token.marginXS,
|
|
22782
|
+
paddingInline,
|
|
22783
|
+
fontSize: token.tagFontSize,
|
|
22784
|
+
lineHeight: token.tagLineHeight,
|
|
22785
|
+
whiteSpace: 'nowrap',
|
|
22786
|
+
background: token.defaultBg,
|
|
22787
|
+
border: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
|
|
22788
|
+
borderRadius: token.borderRadiusSM,
|
|
22789
|
+
opacity: 1,
|
|
22790
|
+
transition: `all ${token.motionDurationMid}`,
|
|
22791
|
+
textAlign: 'start',
|
|
22792
|
+
position: 'relative',
|
|
22793
|
+
// RTL
|
|
22794
|
+
[`&${componentCls}-rtl`]: {
|
|
22795
|
+
direction: 'rtl'
|
|
22796
|
+
},
|
|
22797
|
+
'&, a, a:hover': {
|
|
22798
|
+
color: token.defaultColor
|
|
22799
|
+
},
|
|
22800
|
+
[`${componentCls}-close-icon`]: {
|
|
22801
|
+
marginInlineStart: iconMarginInline,
|
|
22802
|
+
fontSize: token.tagIconSize,
|
|
22803
|
+
color: token.colorIcon,
|
|
22804
|
+
cursor: 'pointer',
|
|
22805
|
+
transition: `all ${token.motionDurationMid}`,
|
|
22806
|
+
'&:hover': {
|
|
22807
|
+
color: token.colorTextHeading
|
|
22808
|
+
}
|
|
22809
|
+
},
|
|
22810
|
+
[`&${componentCls}-has-color`]: {
|
|
22811
|
+
borderColor: 'transparent',
|
|
22812
|
+
[`&, a, a:hover, ${token.iconCls}-close, ${token.iconCls}-close:hover`]: {
|
|
22813
|
+
color: token.colorTextLightSolid
|
|
22814
|
+
}
|
|
22815
|
+
},
|
|
22816
|
+
'&-checkable': {
|
|
22817
|
+
backgroundColor: 'transparent',
|
|
22818
|
+
borderColor: 'transparent',
|
|
22819
|
+
cursor: 'pointer',
|
|
22820
|
+
[`&:not(${componentCls}-checkable-checked):hover`]: {
|
|
22821
|
+
color: token.colorPrimary,
|
|
22822
|
+
backgroundColor: token.colorFillSecondary
|
|
22823
|
+
},
|
|
22824
|
+
'&:active, &-checked': {
|
|
22825
|
+
color: token.colorTextLightSolid
|
|
22826
|
+
},
|
|
22827
|
+
'&-checked': {
|
|
22828
|
+
backgroundColor: token.colorPrimary,
|
|
22829
|
+
'&:hover': {
|
|
22830
|
+
backgroundColor: token.colorPrimaryHover
|
|
22831
|
+
}
|
|
22832
|
+
},
|
|
22833
|
+
'&:active': {
|
|
22834
|
+
backgroundColor: token.colorPrimaryActive
|
|
22835
|
+
}
|
|
22836
|
+
},
|
|
22837
|
+
'&-hidden': {
|
|
22838
|
+
display: 'none'
|
|
22839
|
+
},
|
|
22840
|
+
// To ensure that a space will be placed between character and `Icon`.
|
|
22841
|
+
[`> ${token.iconCls} + span, > span + ${token.iconCls}`]: {
|
|
22842
|
+
marginInlineStart: paddingInline
|
|
22843
|
+
}
|
|
22844
|
+
}),
|
|
22845
|
+
[`${componentCls}-borderless`]: {
|
|
22846
|
+
borderColor: 'transparent',
|
|
22847
|
+
background: token.tagBorderlessBg
|
|
22848
|
+
}
|
|
22849
|
+
};
|
|
22850
|
+
};
|
|
22851
|
+
// ============================== Export ==============================
|
|
22852
|
+
const prepareToken = token => {
|
|
22853
|
+
const {
|
|
22854
|
+
lineWidth,
|
|
22855
|
+
fontSizeIcon,
|
|
22856
|
+
calc
|
|
22857
|
+
} = token;
|
|
22858
|
+
const tagFontSize = token.fontSizeSM;
|
|
22859
|
+
const tagToken = merge(token, {
|
|
22860
|
+
tagFontSize,
|
|
22861
|
+
tagLineHeight: unit$1(calc(token.lineHeightSM).mul(tagFontSize).equal()),
|
|
22862
|
+
tagIconSize: calc(fontSizeIcon).sub(calc(lineWidth).mul(2)).equal(),
|
|
22863
|
+
// Tag icon is much smaller
|
|
22864
|
+
tagPaddingHorizontal: 8,
|
|
22865
|
+
// Fixed padding.
|
|
22866
|
+
tagBorderlessBg: token.defaultBg
|
|
22867
|
+
});
|
|
22868
|
+
return tagToken;
|
|
22869
|
+
};
|
|
22870
|
+
const prepareComponentToken = token => ({
|
|
22871
|
+
defaultBg: new FastColor(token.colorFillQuaternary).onBackground(token.colorBgContainer).toHexString(),
|
|
22872
|
+
defaultColor: token.colorText
|
|
22873
|
+
});
|
|
22874
|
+
var useStyle = genStyleHooks('Tag', token => {
|
|
22875
|
+
const tagToken = prepareToken(token);
|
|
22876
|
+
return genBaseStyle(tagToken);
|
|
22877
|
+
}, prepareComponentToken);
|
|
22878
|
+
|
|
22879
|
+
var __rest$1 = undefined && undefined.__rest || function (s, e) {
|
|
22880
|
+
var t = {};
|
|
22881
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
22882
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22883
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
22884
|
+
}
|
|
22885
|
+
return t;
|
|
22886
|
+
};
|
|
22887
|
+
const CheckableTag = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
22888
|
+
const {
|
|
22889
|
+
prefixCls: customizePrefixCls,
|
|
22890
|
+
style,
|
|
22891
|
+
className,
|
|
22892
|
+
checked,
|
|
22893
|
+
onChange,
|
|
22894
|
+
onClick
|
|
22895
|
+
} = props,
|
|
22896
|
+
restProps = __rest$1(props, ["prefixCls", "style", "className", "checked", "onChange", "onClick"]);
|
|
22897
|
+
const {
|
|
22898
|
+
getPrefixCls,
|
|
22899
|
+
tag
|
|
22900
|
+
} = React.useContext(ConfigContext);
|
|
22901
|
+
const handleClick = e => {
|
|
22902
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(!checked);
|
|
22903
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
22904
|
+
};
|
|
22905
|
+
const prefixCls = getPrefixCls('tag', customizePrefixCls);
|
|
22906
|
+
// Style
|
|
22907
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);
|
|
22908
|
+
const cls = classNames(prefixCls, `${prefixCls}-checkable`, {
|
|
22909
|
+
[`${prefixCls}-checkable-checked`]: checked
|
|
22910
|
+
}, tag === null || tag === void 0 ? void 0 : tag.className, className, hashId, cssVarCls);
|
|
22911
|
+
return wrapCSSVar(/*#__PURE__*/React.createElement("span", Object.assign({}, restProps, {
|
|
22912
|
+
ref: ref,
|
|
22913
|
+
style: Object.assign(Object.assign({}, style), tag === null || tag === void 0 ? void 0 : tag.style),
|
|
22914
|
+
className: cls,
|
|
22915
|
+
onClick: handleClick
|
|
22916
|
+
})));
|
|
22917
|
+
});
|
|
22918
|
+
|
|
22919
|
+
// Style as status component
|
|
22920
|
+
// ============================== Preset ==============================
|
|
22921
|
+
const genPresetStyle = token => genPresetColor(token, (colorKey, {
|
|
22922
|
+
textColor,
|
|
22923
|
+
lightBorderColor,
|
|
22924
|
+
lightColor,
|
|
22925
|
+
darkColor
|
|
22926
|
+
}) => ({
|
|
22927
|
+
[`${token.componentCls}${token.componentCls}-${colorKey}`]: {
|
|
22928
|
+
color: textColor,
|
|
22929
|
+
background: lightColor,
|
|
22930
|
+
borderColor: lightBorderColor,
|
|
22931
|
+
// Inverse color
|
|
22932
|
+
'&-inverse': {
|
|
22933
|
+
color: token.colorTextLightSolid,
|
|
22934
|
+
background: darkColor,
|
|
22935
|
+
borderColor: darkColor
|
|
22936
|
+
},
|
|
22937
|
+
[`&${token.componentCls}-borderless`]: {
|
|
22938
|
+
borderColor: 'transparent'
|
|
22939
|
+
}
|
|
22940
|
+
}
|
|
22941
|
+
}));
|
|
22942
|
+
// ============================== Export ==============================
|
|
22943
|
+
var PresetCmp = genSubStyleComponent(['Tag', 'preset'], token => {
|
|
22944
|
+
const tagToken = prepareToken(token);
|
|
22945
|
+
return genPresetStyle(tagToken);
|
|
22946
|
+
}, prepareComponentToken);
|
|
22947
|
+
|
|
22948
|
+
function capitalize(str) {
|
|
22949
|
+
if (typeof str !== 'string') {
|
|
22950
|
+
return str;
|
|
22951
|
+
}
|
|
22952
|
+
const ret = str.charAt(0).toUpperCase() + str.slice(1);
|
|
22953
|
+
return ret;
|
|
22954
|
+
}
|
|
22955
|
+
|
|
22956
|
+
const genTagStatusStyle = (token, status, cssVariableType) => {
|
|
22957
|
+
const capitalizedCssVariableType = capitalize(cssVariableType);
|
|
22958
|
+
return {
|
|
22959
|
+
[`${token.componentCls}${token.componentCls}-${status}`]: {
|
|
22960
|
+
color: token[`color${cssVariableType}`],
|
|
22961
|
+
background: token[`color${capitalizedCssVariableType}Bg`],
|
|
22962
|
+
borderColor: token[`color${capitalizedCssVariableType}Border`],
|
|
22963
|
+
[`&${token.componentCls}-borderless`]: {
|
|
22964
|
+
borderColor: 'transparent'
|
|
22965
|
+
}
|
|
22966
|
+
}
|
|
22967
|
+
};
|
|
22968
|
+
};
|
|
22969
|
+
// ============================== Export ==============================
|
|
22970
|
+
var StatusCmp = genSubStyleComponent(['Tag', 'status'], token => {
|
|
22971
|
+
const tagToken = prepareToken(token);
|
|
22972
|
+
return [genTagStatusStyle(tagToken, 'success', 'Success'), genTagStatusStyle(tagToken, 'processing', 'Info'), genTagStatusStyle(tagToken, 'error', 'Error'), genTagStatusStyle(tagToken, 'warning', 'Warning')];
|
|
22973
|
+
}, prepareComponentToken);
|
|
22974
|
+
|
|
22975
|
+
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
22976
|
+
var t = {};
|
|
22977
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
22978
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22979
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
22980
|
+
}
|
|
22981
|
+
return t;
|
|
22982
|
+
};
|
|
22983
|
+
const InternalTag = /*#__PURE__*/React.forwardRef((tagProps, ref) => {
|
|
22984
|
+
const {
|
|
22985
|
+
prefixCls: customizePrefixCls,
|
|
22986
|
+
className,
|
|
22987
|
+
rootClassName,
|
|
22988
|
+
style,
|
|
22989
|
+
children,
|
|
22990
|
+
icon,
|
|
22991
|
+
color,
|
|
22992
|
+
onClose,
|
|
22993
|
+
bordered = true,
|
|
22994
|
+
visible: deprecatedVisible
|
|
22995
|
+
} = tagProps,
|
|
22996
|
+
props = __rest(tagProps, ["prefixCls", "className", "rootClassName", "style", "children", "icon", "color", "onClose", "bordered", "visible"]);
|
|
22997
|
+
const {
|
|
22998
|
+
getPrefixCls,
|
|
22999
|
+
direction,
|
|
23000
|
+
tag: tagContext
|
|
23001
|
+
} = React.useContext(ConfigContext);
|
|
23002
|
+
const [visible, setVisible] = React.useState(true);
|
|
23003
|
+
const domProps = omit(props, ['closeIcon', 'closable']);
|
|
23004
|
+
// Warning for deprecated usage
|
|
23005
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
23006
|
+
const warning = devUseWarning('Tag');
|
|
23007
|
+
warning.deprecated(!('visible' in tagProps), 'visible', 'visible && <Tag />');
|
|
23008
|
+
}
|
|
23009
|
+
React.useEffect(() => {
|
|
23010
|
+
if (deprecatedVisible !== undefined) {
|
|
23011
|
+
setVisible(deprecatedVisible);
|
|
23012
|
+
}
|
|
23013
|
+
}, [deprecatedVisible]);
|
|
23014
|
+
const isPreset = isPresetColor(color);
|
|
23015
|
+
const isStatus = isPresetStatusColor(color);
|
|
23016
|
+
const isInternalColor = isPreset || isStatus;
|
|
23017
|
+
const tagStyle = Object.assign(Object.assign({
|
|
23018
|
+
backgroundColor: color && !isInternalColor ? color : undefined
|
|
23019
|
+
}, tagContext === null || tagContext === void 0 ? void 0 : tagContext.style), style);
|
|
23020
|
+
const prefixCls = getPrefixCls('tag', customizePrefixCls);
|
|
23021
|
+
const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);
|
|
23022
|
+
// Style
|
|
23023
|
+
const tagClassName = classNames(prefixCls, tagContext === null || tagContext === void 0 ? void 0 : tagContext.className, {
|
|
23024
|
+
[`${prefixCls}-${color}`]: isInternalColor,
|
|
23025
|
+
[`${prefixCls}-has-color`]: color && !isInternalColor,
|
|
23026
|
+
[`${prefixCls}-hidden`]: !visible,
|
|
23027
|
+
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
23028
|
+
[`${prefixCls}-borderless`]: !bordered
|
|
23029
|
+
}, className, rootClassName, hashId, cssVarCls);
|
|
23030
|
+
const handleCloseClick = e => {
|
|
23031
|
+
e.stopPropagation();
|
|
23032
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(e);
|
|
23033
|
+
if (e.defaultPrevented) {
|
|
23034
|
+
return;
|
|
23035
|
+
}
|
|
23036
|
+
setVisible(false);
|
|
23037
|
+
};
|
|
23038
|
+
const [, mergedCloseIcon] = useClosable(pickClosable(tagProps), pickClosable(tagContext), {
|
|
23039
|
+
closable: false,
|
|
23040
|
+
closeIconRender: iconNode => {
|
|
23041
|
+
const replacement = /*#__PURE__*/React.createElement("span", {
|
|
23042
|
+
className: `${prefixCls}-close-icon`,
|
|
23043
|
+
onClick: handleCloseClick
|
|
23044
|
+
}, iconNode);
|
|
23045
|
+
return replaceElement(iconNode, replacement, originProps => ({
|
|
23046
|
+
onClick: e => {
|
|
23047
|
+
var _a;
|
|
23048
|
+
(_a = originProps === null || originProps === void 0 ? void 0 : originProps.onClick) === null || _a === void 0 ? void 0 : _a.call(originProps, e);
|
|
23049
|
+
handleCloseClick(e);
|
|
23050
|
+
},
|
|
23051
|
+
className: classNames(originProps === null || originProps === void 0 ? void 0 : originProps.className, `${prefixCls}-close-icon`)
|
|
23052
|
+
}));
|
|
23053
|
+
}
|
|
23054
|
+
});
|
|
23055
|
+
const isNeedWave = typeof props.onClick === 'function' || children && children.type === 'a';
|
|
23056
|
+
const iconNode = icon || null;
|
|
23057
|
+
const kids = iconNode ? (/*#__PURE__*/React.createElement(React.Fragment, null, iconNode, children && /*#__PURE__*/React.createElement("span", null, children))) : children;
|
|
23058
|
+
const tagNode = /*#__PURE__*/React.createElement("span", Object.assign({}, domProps, {
|
|
23059
|
+
ref: ref,
|
|
23060
|
+
className: tagClassName,
|
|
23061
|
+
style: tagStyle
|
|
23062
|
+
}), kids, mergedCloseIcon, isPreset && /*#__PURE__*/React.createElement(PresetCmp, {
|
|
23063
|
+
key: "preset",
|
|
23064
|
+
prefixCls: prefixCls
|
|
23065
|
+
}), isStatus && /*#__PURE__*/React.createElement(StatusCmp, {
|
|
23066
|
+
key: "status",
|
|
23067
|
+
prefixCls: prefixCls
|
|
23068
|
+
}));
|
|
23069
|
+
return wrapCSSVar(isNeedWave ? /*#__PURE__*/React.createElement(Wave, {
|
|
23070
|
+
component: "Tag"
|
|
23071
|
+
}, tagNode) : tagNode);
|
|
23072
|
+
});
|
|
23073
|
+
const Tag$1 = InternalTag;
|
|
23074
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
23075
|
+
Tag$1.displayName = 'Tag';
|
|
23076
|
+
}
|
|
23077
|
+
Tag$1.CheckableTag = CheckableTag;
|
|
23078
|
+
|
|
22730
23079
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
22731
23080
|
|
|
22732
|
-
var classes$
|
|
23081
|
+
var classes$6 = {"button":"Button-module__button___18Bed","size_large":"Button-module__size_large___Gohrm","shape_circle":"Button-module__shape_circle___1CtM2","size_normal":"Button-module__size_normal___Ym8Ah","size_small":"Button-module__size_small___mGHht","type_primary":"Button-module__type_primary___WbRH0","variant_subtle":"Button-module__variant_subtle___G4bvs","variant_text":"Button-module__variant_text___r7oFS","variant_link":"Button-module__variant_link___mo-UB","type_secondary":"Button-module__type_secondary___HXHdT","type_critical":"Button-module__type_critical___Y0vJw","onHoverUnderline":"Button-module__onHoverUnderline___OyHzj"};
|
|
22733
23082
|
|
|
22734
23083
|
const Button = (props) => {
|
|
22735
|
-
const { type = "primary", variant = "default", size = "normal", shape = "default", className = "", icon = null, iconPosition = "start", children, onClick = () => { }, href = "", disabled = false, loading = false, onHoverUnderline = false,
|
|
23084
|
+
const { type = "primary", variant = "default", size = "normal", shape = "default", className = "", icon = null, iconPosition = "start", children, onClick = () => { }, href = "", disabled = false, loading = false, onHoverUnderline = false, } = props;
|
|
22736
23085
|
const buttonMap = {
|
|
22737
23086
|
default: "primary",
|
|
22738
23087
|
subtle: "default",
|
|
@@ -22745,10 +23094,10 @@ const Button = (props) => {
|
|
|
22745
23094
|
normal: "middle", // Map "default" to "middle"
|
|
22746
23095
|
large: "large",
|
|
22747
23096
|
};
|
|
22748
|
-
return (jsx(Button$2, {
|
|
23097
|
+
return (jsx(Button$2, { className: clsx(classes$6.button, classes$6[`size_${size}`], classes$6[`variant_${variant}`], classes$6[`shape_${shape}`], classes$6[`type_${type}`], `size_${size}`, `variant_${variant}`, `shape_${shape}`, `type_${type}`, className, {
|
|
22749
23098
|
"tw-cursor-not-allowed": disabled,
|
|
22750
23099
|
"tw-opacity-40": disabled,
|
|
22751
|
-
}, disabled && classes$
|
|
23100
|
+
}, disabled && classes$6.disabled, onHoverUnderline && classes$6.onHoverUnderline), icon: icon, iconPosition: iconPosition, onClick: onClick, size: sizeMap[size], shape: shape, type: buttonMap[variant], disabled: disabled, loading: loading, href: href || undefined, "data-testid": 'lumina-button', children: children }));
|
|
22752
23101
|
};
|
|
22753
23102
|
Button.propTypes = {
|
|
22754
23103
|
type: PropTypes.oneOf(["primary", "secondary", "critical"]),
|
|
@@ -22766,10 +23115,10 @@ Button.propTypes = {
|
|
|
22766
23115
|
};
|
|
22767
23116
|
Button.displayName = "Button";
|
|
22768
23117
|
|
|
22769
|
-
var classes$
|
|
23118
|
+
var classes$5 = {"switch":"Switch-module__switch___PKzsW"};
|
|
22770
23119
|
|
|
22771
23120
|
const Switch = ({ className, onChange = () => { }, size = "default", disabled = false, checked = false, ...rest }) => {
|
|
22772
|
-
return (jsx(Switch$1, { className: clsx(className, classes$
|
|
23121
|
+
return (jsx(Switch$1, { className: clsx(className, classes$5.switch, classes$5[size]), onChange: onChange, size: size, disabled: disabled, checked: checked, ...rest }));
|
|
22773
23122
|
};
|
|
22774
23123
|
Switch.propTypes = {
|
|
22775
23124
|
onChange: PropTypes.func,
|
|
@@ -22779,13 +23128,13 @@ Switch.propTypes = {
|
|
|
22779
23128
|
};
|
|
22780
23129
|
Switch.displayName = "Switch";
|
|
22781
23130
|
|
|
22782
|
-
var classes$
|
|
23131
|
+
var classes$4 = {"modal":"Modal-module__modal___yNG-7"};
|
|
22783
23132
|
|
|
22784
23133
|
const Close = ({ size = 14, color = "#B6BAC3", ...rest }) => {
|
|
22785
23134
|
return (jsx("svg", { width: size, height: size, viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: jsx("path", { d: "M0.292893 0.292893C0.683417 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L7 5.58579L12.2929 0.292893C12.6834 -0.0976311 13.3166 -0.0976311 13.7071 0.292893C14.0976 0.683417 14.0976 1.31658 13.7071 1.70711L8.41421 7L13.7071 12.2929C14.0976 12.6834 14.0976 13.3166 13.7071 13.7071C13.3166 14.0976 12.6834 14.0976 12.2929 13.7071L7 8.41421L1.70711 13.7071C1.31658 14.0976 0.683417 14.0976 0.292893 13.7071C-0.0976311 13.3166 -0.0976311 12.6834 0.292893 12.2929L5.58579 7L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683417 0.292893 0.292893Z", fill: color }) }));
|
|
22786
23135
|
};
|
|
22787
23136
|
const Modal = ({ className = "", title = "", children, open = false, handleOk, handleCancel, okText = "", cancelText = "", closeIcon = jsx(Close, { color: "#6B7280" }), bodyClassName = "modalBody", outsideClickDisable = false, hideCross = false, okButtonLoading = false, okButtonDisabled = false, variant = "primary", okBtnClasses = "", cancelButtonAnalytics = {}, okButtonAnalytics = {}, footerMargintopDisable = true, ...rest }) => {
|
|
22788
|
-
return (jsx("div", { onClick: (e) => e.stopPropagation(), children: jsx(Modal$1, { title: title, open: open, onOk: handleOk, onCancel: handleCancel, className: clsx(classes$
|
|
23137
|
+
return (jsx("div", { onClick: (e) => e.stopPropagation(), children: jsx(Modal$1, { title: title, open: open, onOk: handleOk, onCancel: handleCancel, className: clsx(classes$4.modal, className, {
|
|
22789
23138
|
footerMargintopDisable: footerMargintopDisable,
|
|
22790
23139
|
}), okText: okText, cancelText: cancelText, closeIcon: closeIcon, closable: !hideCross, maskClosable: !outsideClickDisable, footer: okText || cancelText ? (jsxs("div", { className: clsx({
|
|
22791
23140
|
primaryFooter: variant === "primary",
|
|
@@ -22793,17 +23142,17 @@ const Modal = ({ className = "", title = "", children, open = false, handleOk, h
|
|
|
22793
23142
|
}), children: [cancelText && (jsx(Button, { onClick: handleCancel, type: "secondary", className: "cancelBtn", variant: 'subtle', ...cancelButtonAnalytics, children: cancelText })), okText && (jsx(Button, { onClick: handleOk, className: clsx(okBtnClasses, "okBtn"), loading: okButtonLoading, disabled: okButtonDisabled, ...okButtonAnalytics, children: okText }))] })) : null, ...rest, children: jsx("div", { className: bodyClassName, children: children }) }) }));
|
|
22794
23143
|
};
|
|
22795
23144
|
|
|
22796
|
-
var classes$
|
|
23145
|
+
var classes$3 = {"light":"Tooltip-module__light___KHW7i"};
|
|
22797
23146
|
|
|
22798
23147
|
const Tooltip = ({ children, title = "", placement = "top", color = "#1F2937", className, mode = "dark", ...rest }) => {
|
|
22799
|
-
return (jsx(Tooltip$1, { className: className, color: color, title: title, placement: placement, overlayClassName: mode === "light" ? classes$
|
|
23148
|
+
return (jsx(Tooltip$1, { className: className, color: color, title: title, placement: placement, overlayClassName: mode === "light" ? classes$3.light : "", ...rest, children: children }));
|
|
22800
23149
|
};
|
|
22801
23150
|
|
|
22802
|
-
var classes$
|
|
23151
|
+
var classes$2 = {"checkbox":"Checkbox-module__checkbox___D0D4S","size_small":"Checkbox-module__size_small___xrnwa","size_medium":"Checkbox-module__size_medium___V0L7S","size_large":"Checkbox-module__size_large___3FuMo","type_checked":"Checkbox-module__type_checked___pQSFb","disabled":"Checkbox-module__disabled___WagIC","type_unchecked":"Checkbox-module__type_unchecked___nhedk","variant_normal":"Checkbox-module__variant_normal___2gugg","variant_emphasized":"Checkbox-module__variant_emphasized___tLXw0","variant_indeterminate":"Checkbox-module__variant_indeterminate___swxxo"};
|
|
22803
23152
|
|
|
22804
23153
|
const Checkbox = (props) => {
|
|
22805
23154
|
const { className = "", children = null, onChange = () => { }, checked = false, disabled = false, size = "small", variant = "normal", indeterminate = false, ...rest } = props;
|
|
22806
|
-
return (jsx(Checkbox$1, { className: clsx(classes$
|
|
23155
|
+
return (jsx(Checkbox$1, { className: clsx(classes$2.checkbox, classes$2[`size_${size}`], classes$2[`variant_${variant}`], checked ? classes$2.type_checked : classes$2.type_unchecked, disabled && classes$2.disabled, indeterminate && classes$2[`variant_indeterminate`], className), onChange: onChange, checked: checked, disabled: disabled, indeterminate: indeterminate, ...rest, children: children }));
|
|
22807
23156
|
};
|
|
22808
23157
|
Checkbox.propTypes = {
|
|
22809
23158
|
checked: PropTypes.bool,
|
|
@@ -22817,9 +23166,9 @@ Checkbox.propTypes = {
|
|
|
22817
23166
|
};
|
|
22818
23167
|
Checkbox.displayName = "Checkbox";
|
|
22819
23168
|
|
|
22820
|
-
var classes = {"radio":"Radio-module__radio___qhO7H","size_small":"Radio-module__size_small___SUyKK","size_medium":"Radio-module__size_medium___ew0Kp","size_large":"Radio-module__size_large___DOsUo","type_checked":"Radio-module__type_checked___amYVs","disabled":"Radio-module__disabled___RZ0be","type_unchecked":"Radio-module__type_unchecked___GQtug","variant_normal":"Radio-module__variant_normal___fJgIP","variant_emphasized":"Radio-module__variant_emphasized___Ih1mU"};
|
|
23169
|
+
var classes$1 = {"radio":"Radio-module__radio___qhO7H","size_small":"Radio-module__size_small___SUyKK","size_medium":"Radio-module__size_medium___ew0Kp","size_large":"Radio-module__size_large___DOsUo","type_checked":"Radio-module__type_checked___amYVs","disabled":"Radio-module__disabled___RZ0be","type_unchecked":"Radio-module__type_unchecked___GQtug","variant_normal":"Radio-module__variant_normal___fJgIP","variant_emphasized":"Radio-module__variant_emphasized___Ih1mU"};
|
|
22821
23170
|
|
|
22822
|
-
const Radio = ({ checked = true, className = "", size = "small", variant = "normal", children, onChange = () => { }, disabled = false, extra = null, ...rest }) => (jsxs(Fragment, { children: [jsx(Radio$1, { className: clsx(classes.radio, classes[`size_${size}`], classes[`variant_${variant}`], checked ? classes.type_checked : classes.type_unchecked, disabled && classes.disabled, className), onChange: onChange, checked: checked, disabled: disabled, ...rest, children: children }), checked && extra] }));
|
|
23171
|
+
const Radio = ({ checked = true, className = "", size = "small", variant = "normal", children, onChange = () => { }, disabled = false, extra = null, ...rest }) => (jsxs(Fragment, { children: [jsx(Radio$1, { className: clsx(classes$1.radio, classes$1[`size_${size}`], classes$1[`variant_${variant}`], checked ? classes$1.type_checked : classes$1.type_unchecked, disabled && classes$1.disabled, className), onChange: onChange, checked: checked, disabled: disabled, ...rest, children: children }), checked && extra] }));
|
|
22823
23172
|
Radio.propTypes = {
|
|
22824
23173
|
checked: PropTypes.bool,
|
|
22825
23174
|
className: PropTypes.string,
|
|
@@ -22832,5 +23181,13 @@ Radio.propTypes = {
|
|
|
22832
23181
|
};
|
|
22833
23182
|
Radio.displayName = "Radio";
|
|
22834
23183
|
|
|
22835
|
-
|
|
23184
|
+
var classes = {"tag":"Tag-module__tag___0Cfjz","small":"Tag-module__small___-vgjh","success":"Tag-module__success___Lq3l5","blue":"Tag-module__blue___OZprV","warning":"Tag-module__warning___QjEQv","processing":"Tag-module__processing___IKFXM","bookingConfirmed":"Tag-module__bookingConfirmed___j8eIs","bookingRescheduled":"Tag-module__bookingRescheduled___tZRjg","bookingRescheduledPending":"Tag-module__bookingRescheduledPending___4N6Vl","failed":"Tag-module__failed___3CqXv","bookingPending":"Tag-module__bookingPending___3i6Ai"};
|
|
23185
|
+
|
|
23186
|
+
const Tag = (props) => {
|
|
23187
|
+
const { type = "success", className = "", title = "", icon = null, size = "", ...rest } = props;
|
|
23188
|
+
return (jsx(Tag$1, { className: clsx(classes.tag, size === "small" && classes.small, classes[type], className), icon: icon, ...rest, children: title }));
|
|
23189
|
+
};
|
|
23190
|
+
Tag.displayName = "Tag";
|
|
23191
|
+
|
|
23192
|
+
export { Button, Checkbox, Modal, Radio, Switch, Tag, Tooltip };
|
|
22836
23193
|
//# sourceMappingURL=index.js.map
|