@scalant/components 2.0.2 → 2.0.3
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/components.es.js +85 -81
- package/dist/components.umd.js +3 -3
- package/package.json +2 -2
package/dist/components.es.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
2
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -14,6 +16,7 @@ var __spreadValues = (a, b) => {
|
|
|
14
16
|
}
|
|
15
17
|
return a;
|
|
16
18
|
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
17
20
|
var __objRest = (source, exclude) => {
|
|
18
21
|
var target = {};
|
|
19
22
|
for (var prop in source)
|
|
@@ -26,7 +29,8 @@ var __objRest = (source, exclude) => {
|
|
|
26
29
|
}
|
|
27
30
|
return target;
|
|
28
31
|
};
|
|
29
|
-
import
|
|
32
|
+
import { jsx } from "react/jsx-runtime";
|
|
33
|
+
import * as React from "react";
|
|
30
34
|
import React__default, { isValidElement, version as version$2, useContext, createContext, useRef, useLayoutEffect as useLayoutEffect$1, useEffect, forwardRef, useState, useMemo as useMemo$1, Children } from "react";
|
|
31
35
|
import * as ReactDOM from "react-dom";
|
|
32
36
|
import ReactDOM__default from "react-dom";
|
|
@@ -545,7 +549,7 @@ function requireReactIs() {
|
|
|
545
549
|
}
|
|
546
550
|
var reactIsExports = requireReactIs();
|
|
547
551
|
function useMemo(getValue2, condition, shouldUpdate) {
|
|
548
|
-
var cacheRef = React
|
|
552
|
+
var cacheRef = React.useRef({});
|
|
549
553
|
if (!("value" in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {
|
|
550
554
|
cacheRef.current.value = getValue2();
|
|
551
555
|
cacheRef.current.condition = condition;
|
|
@@ -1033,7 +1037,7 @@ function createCache() {
|
|
|
1033
1037
|
}
|
|
1034
1038
|
return new Entity(cssinjsInstanceId);
|
|
1035
1039
|
}
|
|
1036
|
-
var StyleContext = /* @__PURE__ */ React
|
|
1040
|
+
var StyleContext = /* @__PURE__ */ React.createContext({
|
|
1037
1041
|
hashPriority: "low",
|
|
1038
1042
|
cache: createCache(),
|
|
1039
1043
|
defaultCache: true
|
|
@@ -1294,9 +1298,9 @@ var transformToken = function transformToken2(token2, themeKey, config) {
|
|
|
1294
1298
|
scope: config === null || config === void 0 ? void 0 : config.scope
|
|
1295
1299
|
})];
|
|
1296
1300
|
};
|
|
1297
|
-
var useInternalLayoutEffect = process.env.NODE_ENV !== "test" && canUseDom() ? React
|
|
1301
|
+
var useInternalLayoutEffect = process.env.NODE_ENV !== "test" && canUseDom() ? React.useLayoutEffect : React.useEffect;
|
|
1298
1302
|
var useLayoutEffect = function useLayoutEffect2(callback, deps) {
|
|
1299
|
-
var firstMountRef = React
|
|
1303
|
+
var firstMountRef = React.useRef(true);
|
|
1300
1304
|
useInternalLayoutEffect(function() {
|
|
1301
1305
|
return callback(firstMountRef.current);
|
|
1302
1306
|
}, deps);
|
|
@@ -1314,10 +1318,10 @@ var useLayoutUpdateEffect = function useLayoutUpdateEffect2(callback, deps) {
|
|
|
1314
1318
|
}
|
|
1315
1319
|
}, deps);
|
|
1316
1320
|
};
|
|
1317
|
-
var fullClone$2 = _objectSpread2({}, React
|
|
1321
|
+
var fullClone$2 = _objectSpread2({}, React);
|
|
1318
1322
|
var useInsertionEffect$1 = fullClone$2.useInsertionEffect;
|
|
1319
1323
|
var useInsertionEffectPolyfill = function useInsertionEffectPolyfill2(renderEffect, effect, deps) {
|
|
1320
|
-
React
|
|
1324
|
+
React.useMemo(renderEffect, deps);
|
|
1321
1325
|
useLayoutEffect(function() {
|
|
1322
1326
|
return effect(true);
|
|
1323
1327
|
}, deps);
|
|
@@ -1328,7 +1332,7 @@ var useCompatibleInsertionEffect = useInsertionEffect$1 ? function(renderEffect,
|
|
|
1328
1332
|
return effect();
|
|
1329
1333
|
}, deps);
|
|
1330
1334
|
} : useInsertionEffectPolyfill;
|
|
1331
|
-
var fullClone$1 = _objectSpread2({}, React
|
|
1335
|
+
var fullClone$1 = _objectSpread2({}, React);
|
|
1332
1336
|
var useInsertionEffect = fullClone$1.useInsertionEffect;
|
|
1333
1337
|
var useCleanupRegister = function useCleanupRegister2(deps) {
|
|
1334
1338
|
var effectCleanups = [];
|
|
@@ -1342,7 +1346,7 @@ var useCleanupRegister = function useCleanupRegister2(deps) {
|
|
|
1342
1346
|
}
|
|
1343
1347
|
effectCleanups.push(fn);
|
|
1344
1348
|
}
|
|
1345
|
-
React
|
|
1349
|
+
React.useEffect(function() {
|
|
1346
1350
|
cleanupFlag = false;
|
|
1347
1351
|
return function() {
|
|
1348
1352
|
cleanupFlag = true;
|
|
@@ -1383,7 +1387,7 @@ if (process.env.NODE_ENV !== "production" && typeof module !== "undefined" && mo
|
|
|
1383
1387
|
}
|
|
1384
1388
|
}
|
|
1385
1389
|
function useGlobalCache(prefix, keyPath, cacheFn, onCacheRemove, onCacheEffect) {
|
|
1386
|
-
var _React$useContext = React
|
|
1390
|
+
var _React$useContext = React.useContext(StyleContext), globalCache = _React$useContext.cache;
|
|
1387
1391
|
var fullPath = [prefix].concat(_toConsumableArray(keyPath));
|
|
1388
1392
|
var fullPathStr = pathKey(fullPath);
|
|
1389
1393
|
var register = useEffectCleanupRegister([fullPathStr]);
|
|
@@ -1401,7 +1405,7 @@ function useGlobalCache(prefix, keyPath, cacheFn, onCacheRemove, onCacheEffect)
|
|
|
1401
1405
|
return updater ? updater(data) : data;
|
|
1402
1406
|
});
|
|
1403
1407
|
};
|
|
1404
|
-
React
|
|
1408
|
+
React.useMemo(
|
|
1405
1409
|
function() {
|
|
1406
1410
|
buildCache();
|
|
1407
1411
|
},
|
|
@@ -2163,7 +2167,7 @@ function Empty() {
|
|
|
2163
2167
|
var STYLE_PREFIX = "style";
|
|
2164
2168
|
function useStyleRegister(info, styleFn) {
|
|
2165
2169
|
var token2 = info.token, path = info.path, hashId = info.hashId, layer = info.layer, nonce = info.nonce, clientOnly = info.clientOnly, _info$order = info.order, order = _info$order === void 0 ? 0 : _info$order;
|
|
2166
|
-
var _React$useContext = React
|
|
2170
|
+
var _React$useContext = React.useContext(StyleContext), autoClear = _React$useContext.autoClear, mock = _React$useContext.mock, defaultCache = _React$useContext.defaultCache, hashPriority = _React$useContext.hashPriority, container = _React$useContext.container, ssrInline = _React$useContext.ssrInline, transformers = _React$useContext.transformers, linters = _React$useContext.linters, cache = _React$useContext.cache, enableLayer = _React$useContext.layer;
|
|
2167
2171
|
var tokenKey = token2._tokenKey;
|
|
2168
2172
|
var fullPath = [tokenKey];
|
|
2169
2173
|
if (enableLayer) {
|
|
@@ -2255,16 +2259,16 @@ function useStyleRegister(info, styleFn) {
|
|
|
2255
2259
|
return function(node2) {
|
|
2256
2260
|
var styleNode;
|
|
2257
2261
|
if (!ssrInline || isMergedClientSide || !defaultCache) {
|
|
2258
|
-
styleNode = /* @__PURE__ */ React
|
|
2262
|
+
styleNode = /* @__PURE__ */ React.createElement(Empty, null);
|
|
2259
2263
|
} else {
|
|
2260
2264
|
var _ref6;
|
|
2261
|
-
styleNode = /* @__PURE__ */ React
|
|
2265
|
+
styleNode = /* @__PURE__ */ React.createElement("style", _extends({}, (_ref6 = {}, _defineProperty(_ref6, ATTR_TOKEN, cachedTokenKey), _defineProperty(_ref6, ATTR_MARK, cachedStyleId), _ref6), {
|
|
2262
2266
|
dangerouslySetInnerHTML: {
|
|
2263
2267
|
__html: cachedStyleStr
|
|
2264
2268
|
}
|
|
2265
2269
|
}));
|
|
2266
2270
|
}
|
|
2267
|
-
return /* @__PURE__ */ React
|
|
2271
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, styleNode, node2);
|
|
2268
2272
|
};
|
|
2269
2273
|
}
|
|
2270
2274
|
var extract$1 = function extract2(cache, effectStyles, options) {
|
|
@@ -2380,11 +2384,11 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
2380
2384
|
}
|
|
2381
2385
|
};
|
|
2382
2386
|
}
|
|
2383
|
-
const WarningContext = /* @__PURE__ */ React
|
|
2387
|
+
const WarningContext = /* @__PURE__ */ React.createContext({});
|
|
2384
2388
|
const devUseWarning = process.env.NODE_ENV !== "production" ? (component) => {
|
|
2385
2389
|
const {
|
|
2386
2390
|
strict
|
|
2387
|
-
} = React
|
|
2391
|
+
} = React.useContext(WarningContext);
|
|
2388
2392
|
const typeWarning = (valid, type, message) => {
|
|
2389
2393
|
if (!valid) {
|
|
2390
2394
|
if (strict === false && type === "deprecated") {
|
|
@@ -3438,7 +3442,7 @@ const defaultGetPrefixCls = (suffixCls, customizePrefixCls) => {
|
|
|
3438
3442
|
}
|
|
3439
3443
|
return suffixCls ? `${defaultPrefixCls}-${suffixCls}` : defaultPrefixCls;
|
|
3440
3444
|
};
|
|
3441
|
-
const ConfigContext = /* @__PURE__ */ React
|
|
3445
|
+
const ConfigContext = /* @__PURE__ */ React.createContext({
|
|
3442
3446
|
// We provide a default function for Context without provider
|
|
3443
3447
|
getPrefixCls: defaultGetPrefixCls,
|
|
3444
3448
|
iconPrefixCls: defaultIconPrefixCls
|
|
@@ -3448,7 +3452,7 @@ const {
|
|
|
3448
3452
|
} = ConfigContext;
|
|
3449
3453
|
const EMPTY_OBJECT = {};
|
|
3450
3454
|
function useComponentConfig(propName) {
|
|
3451
|
-
const context = React
|
|
3455
|
+
const context = React.useContext(ConfigContext);
|
|
3452
3456
|
const {
|
|
3453
3457
|
getPrefixCls,
|
|
3454
3458
|
direction,
|
|
@@ -3464,8 +3468,8 @@ function useComponentConfig(propName) {
|
|
|
3464
3468
|
getPopupContainer
|
|
3465
3469
|
});
|
|
3466
3470
|
}
|
|
3467
|
-
const DisabledContext = /* @__PURE__ */ React
|
|
3468
|
-
const SizeContext = /* @__PURE__ */ React
|
|
3471
|
+
const DisabledContext = /* @__PURE__ */ React.createContext(false);
|
|
3472
|
+
const SizeContext = /* @__PURE__ */ React.createContext(void 0);
|
|
3469
3473
|
var AbstractCalculator = /* @__PURE__ */ _createClass(function AbstractCalculator2() {
|
|
3470
3474
|
_classCallCheck(this, AbstractCalculator2);
|
|
3471
3475
|
});
|
|
@@ -3648,9 +3652,9 @@ var getCompVarPrefix = function getCompVarPrefix2(component, prefix) {
|
|
|
3648
3652
|
return "".concat([prefix, component.replace(/([A-Z]+)([A-Z][a-z]+)/g, "$1-$2").replace(/([a-z])([A-Z])/g, "$1-$2")].filter(Boolean).join("-"));
|
|
3649
3653
|
};
|
|
3650
3654
|
function useEvent(callback) {
|
|
3651
|
-
var fnRef = React
|
|
3655
|
+
var fnRef = React.useRef();
|
|
3652
3656
|
fnRef.current = callback;
|
|
3653
|
-
var memoFn = React
|
|
3657
|
+
var memoFn = React.useCallback(function() {
|
|
3654
3658
|
var _fnRef$current;
|
|
3655
3659
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3656
3660
|
args[_key] = arguments[_key];
|
|
@@ -3660,9 +3664,9 @@ function useEvent(callback) {
|
|
|
3660
3664
|
return memoFn;
|
|
3661
3665
|
}
|
|
3662
3666
|
function useSafeState(defaultValue) {
|
|
3663
|
-
var destroyRef = React
|
|
3664
|
-
var _React$useState = React
|
|
3665
|
-
React
|
|
3667
|
+
var destroyRef = React.useRef(false);
|
|
3668
|
+
var _React$useState = React.useState(defaultValue), _React$useState2 = _slicedToArray(_React$useState, 2), value = _React$useState2[0], setValue = _React$useState2[1];
|
|
3669
|
+
React.useEffect(function() {
|
|
3666
3670
|
destroyRef.current = false;
|
|
3667
3671
|
return function() {
|
|
3668
3672
|
destroyRef.current = true;
|
|
@@ -4536,7 +4540,7 @@ const {
|
|
|
4536
4540
|
getCommonStyle: genCommonStyle,
|
|
4537
4541
|
getCompUnitless: () => unitless
|
|
4538
4542
|
});
|
|
4539
|
-
var Context = /* @__PURE__ */ React
|
|
4543
|
+
var Context = /* @__PURE__ */ React.createContext({});
|
|
4540
4544
|
var DomWrapper = /* @__PURE__ */ function(_React$Component) {
|
|
4541
4545
|
_inherits(DomWrapper2, _React$Component);
|
|
4542
4546
|
var _super = _createSuper(DomWrapper2);
|
|
@@ -4551,12 +4555,12 @@ var DomWrapper = /* @__PURE__ */ function(_React$Component) {
|
|
|
4551
4555
|
}
|
|
4552
4556
|
}]);
|
|
4553
4557
|
return DomWrapper2;
|
|
4554
|
-
}(React
|
|
4558
|
+
}(React.Component);
|
|
4555
4559
|
function useSyncState(defaultValue) {
|
|
4556
|
-
var _React$useReducer = React
|
|
4560
|
+
var _React$useReducer = React.useReducer(function(x) {
|
|
4557
4561
|
return x + 1;
|
|
4558
4562
|
}, 0), _React$useReducer2 = _slicedToArray(_React$useReducer, 2), forceUpdate = _React$useReducer2[1];
|
|
4559
|
-
var currentValueRef = React
|
|
4563
|
+
var currentValueRef = React.useRef(defaultValue);
|
|
4560
4564
|
var getValue2 = useEvent(function() {
|
|
4561
4565
|
return currentValueRef.current;
|
|
4562
4566
|
});
|
|
@@ -4658,7 +4662,7 @@ const useDomMotionEvents = function(onInternalMotionEnd) {
|
|
|
4658
4662
|
cacheElementRef.current = element;
|
|
4659
4663
|
}
|
|
4660
4664
|
}
|
|
4661
|
-
React
|
|
4665
|
+
React.useEffect(function() {
|
|
4662
4666
|
return function() {
|
|
4663
4667
|
removeMotionEvents(cacheElementRef.current);
|
|
4664
4668
|
};
|
|
@@ -4667,7 +4671,7 @@ const useDomMotionEvents = function(onInternalMotionEnd) {
|
|
|
4667
4671
|
};
|
|
4668
4672
|
var useIsomorphicLayoutEffect = canUseDom() ? useLayoutEffect$1 : useEffect;
|
|
4669
4673
|
const useNextFrame = function() {
|
|
4670
|
-
var nextFrameRef = React
|
|
4674
|
+
var nextFrameRef = React.useRef(null);
|
|
4671
4675
|
function cancelNextFrame() {
|
|
4672
4676
|
wrapperRaf.cancel(nextFrameRef.current);
|
|
4673
4677
|
}
|
|
@@ -4687,7 +4691,7 @@ const useNextFrame = function() {
|
|
|
4687
4691
|
});
|
|
4688
4692
|
nextFrameRef.current = nextFrameId;
|
|
4689
4693
|
}
|
|
4690
|
-
React
|
|
4694
|
+
React.useEffect(function() {
|
|
4691
4695
|
return function() {
|
|
4692
4696
|
cancelNextFrame();
|
|
4693
4697
|
};
|
|
@@ -4730,7 +4734,7 @@ const useStepQueue = function(status, prepareOnly, callback) {
|
|
|
4730
4734
|
}
|
|
4731
4735
|
}
|
|
4732
4736
|
}, [status, step]);
|
|
4733
|
-
React
|
|
4737
|
+
React.useEffect(function() {
|
|
4734
4738
|
return function() {
|
|
4735
4739
|
cancelNextFrame();
|
|
4736
4740
|
};
|
|
@@ -4788,7 +4792,7 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
4788
4792
|
return {};
|
|
4789
4793
|
}
|
|
4790
4794
|
};
|
|
4791
|
-
var eventHandlers = React
|
|
4795
|
+
var eventHandlers = React.useMemo(function() {
|
|
4792
4796
|
return getEventHandlers(currentStatus);
|
|
4793
4797
|
}, [currentStatus]);
|
|
4794
4798
|
var _useStepQueue = useStepQueue(currentStatus, !supportMotion, function(newStep) {
|
|
@@ -4864,7 +4868,7 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
4864
4868
|
clearTimeout(deadlineRef.current);
|
|
4865
4869
|
};
|
|
4866
4870
|
}, []);
|
|
4867
|
-
var firstMountChangeRef = React
|
|
4871
|
+
var firstMountChangeRef = React.useRef(false);
|
|
4868
4872
|
useEffect(function() {
|
|
4869
4873
|
if (asyncVisible) {
|
|
4870
4874
|
firstMountChangeRef.current = true;
|
|
@@ -4892,9 +4896,9 @@ function genCSSMotion(config) {
|
|
|
4892
4896
|
function isSupportTransition(props, contextMotion) {
|
|
4893
4897
|
return !!(props.motionName && transitionSupport && contextMotion !== false);
|
|
4894
4898
|
}
|
|
4895
|
-
var CSSMotion2 = /* @__PURE__ */ React
|
|
4899
|
+
var CSSMotion2 = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
4896
4900
|
var _props$visible = props.visible, visible = _props$visible === void 0 ? true : _props$visible, _props$removeOnLeave = props.removeOnLeave, removeOnLeave = _props$removeOnLeave === void 0 ? true : _props$removeOnLeave, forceRender = props.forceRender, children = props.children, motionName = props.motionName, leavedClassName = props.leavedClassName, eventProps = props.eventProps;
|
|
4897
|
-
var _React$useContext = React
|
|
4901
|
+
var _React$useContext = React.useContext(Context), contextMotion = _React$useContext.motion;
|
|
4898
4902
|
var supportMotion = isSupportTransition(props, contextMotion);
|
|
4899
4903
|
var nodeRef = useRef();
|
|
4900
4904
|
var wrapperNodeRef = useRef();
|
|
@@ -4906,11 +4910,11 @@ function genCSSMotion(config) {
|
|
|
4906
4910
|
}
|
|
4907
4911
|
}
|
|
4908
4912
|
var _useStatus = useStatus(supportMotion, visible, getDomElement, props), _useStatus2 = _slicedToArray(_useStatus, 4), status = _useStatus2[0], statusStep = _useStatus2[1], statusStyle = _useStatus2[2], mergedVisible = _useStatus2[3];
|
|
4909
|
-
var renderedRef = React
|
|
4913
|
+
var renderedRef = React.useRef(mergedVisible);
|
|
4910
4914
|
if (mergedVisible) {
|
|
4911
4915
|
renderedRef.current = true;
|
|
4912
4916
|
}
|
|
4913
|
-
var setNodeRef = React
|
|
4917
|
+
var setNodeRef = React.useCallback(function(node2) {
|
|
4914
4918
|
nodeRef.current = node2;
|
|
4915
4919
|
fillRef(ref, node2);
|
|
4916
4920
|
}, [ref]);
|
|
@@ -4951,15 +4955,15 @@ function genCSSMotion(config) {
|
|
|
4951
4955
|
style: statusStyle
|
|
4952
4956
|
}), setNodeRef);
|
|
4953
4957
|
}
|
|
4954
|
-
if (/* @__PURE__ */ React
|
|
4958
|
+
if (/* @__PURE__ */ React.isValidElement(motionChildren) && supportRef(motionChildren)) {
|
|
4955
4959
|
var originNodeRef = getNodeRef(motionChildren);
|
|
4956
4960
|
if (!originNodeRef) {
|
|
4957
|
-
motionChildren = /* @__PURE__ */ React
|
|
4961
|
+
motionChildren = /* @__PURE__ */ React.cloneElement(motionChildren, {
|
|
4958
4962
|
ref: setNodeRef
|
|
4959
4963
|
});
|
|
4960
4964
|
}
|
|
4961
4965
|
}
|
|
4962
|
-
return /* @__PURE__ */ React
|
|
4966
|
+
return /* @__PURE__ */ React.createElement(DomWrapper, {
|
|
4963
4967
|
ref: wrapperNodeRef
|
|
4964
4968
|
}, motionChildren);
|
|
4965
4969
|
});
|
|
@@ -5100,17 +5104,17 @@ function genCSSMotionList(transitionSupport) {
|
|
|
5100
5104
|
var _this$props = this.props, component = _this$props.component, children = _this$props.children, _onVisibleChanged = _this$props.onVisibleChanged;
|
|
5101
5105
|
_this$props.onAllRemoved;
|
|
5102
5106
|
var restProps = _objectWithoutProperties(_this$props, _excluded$3);
|
|
5103
|
-
var Component = component || React
|
|
5107
|
+
var Component = component || React.Fragment;
|
|
5104
5108
|
var motionProps = {};
|
|
5105
5109
|
MOTION_PROP_NAMES.forEach(function(prop) {
|
|
5106
5110
|
motionProps[prop] = restProps[prop];
|
|
5107
5111
|
delete restProps[prop];
|
|
5108
5112
|
});
|
|
5109
5113
|
delete restProps.keys;
|
|
5110
|
-
return /* @__PURE__ */ React
|
|
5114
|
+
return /* @__PURE__ */ React.createElement(Component, restProps, keyEntities.map(function(_ref2, index) {
|
|
5111
5115
|
var status = _ref2.status, eventProps = _objectWithoutProperties(_ref2, _excluded2$1);
|
|
5112
5116
|
var visible = status === STATUS_ADD || status === STATUS_KEEP;
|
|
5113
|
-
return /* @__PURE__ */ React
|
|
5117
|
+
return /* @__PURE__ */ React.createElement(CSSMotion$1, _extends({}, motionProps, {
|
|
5114
5118
|
key: eventProps.key,
|
|
5115
5119
|
visible,
|
|
5116
5120
|
eventProps,
|
|
@@ -5151,7 +5155,7 @@ function genCSSMotionList(transitionSupport) {
|
|
|
5151
5155
|
}
|
|
5152
5156
|
}]);
|
|
5153
5157
|
return CSSMotionList2;
|
|
5154
|
-
}(React
|
|
5158
|
+
}(React.Component);
|
|
5155
5159
|
_defineProperty(CSSMotionList, "defaultProps", {
|
|
5156
5160
|
component: "div"
|
|
5157
5161
|
});
|
|
@@ -5255,7 +5259,7 @@ function getTwoToneColors() {
|
|
|
5255
5259
|
}
|
|
5256
5260
|
var IconBase = function IconBase2(props) {
|
|
5257
5261
|
var icon = props.icon, className = props.className, onClick = props.onClick, style2 = props.style, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, restProps = _objectWithoutProperties(props, _excluded$2);
|
|
5258
|
-
var svgRef = React
|
|
5262
|
+
var svgRef = React.useRef();
|
|
5259
5263
|
var colors = twoToneColorPalette;
|
|
5260
5264
|
if (primaryColor) {
|
|
5261
5265
|
colors = {
|
|
@@ -5306,9 +5310,9 @@ function getTwoToneColor() {
|
|
|
5306
5310
|
}
|
|
5307
5311
|
var _excluded$1 = ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"];
|
|
5308
5312
|
setTwoToneColor(blue.primary);
|
|
5309
|
-
var Icon = /* @__PURE__ */ React
|
|
5313
|
+
var Icon = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
5310
5314
|
var className = props.className, icon = props.icon, spin = props.spin, rotate = props.rotate, tabIndex = props.tabIndex, onClick = props.onClick, twoToneColor = props.twoToneColor, restProps = _objectWithoutProperties(props, _excluded$1);
|
|
5311
|
-
var _React$useContext = React
|
|
5315
|
+
var _React$useContext = React.useContext(IconContext), _React$useContext$pre = _React$useContext.prefixCls, prefixCls = _React$useContext$pre === void 0 ? "anticon" : _React$useContext$pre, rootClassName = _React$useContext.rootClassName;
|
|
5312
5316
|
var classString = classNames(rootClassName, prefixCls, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-").concat(icon.name), !!icon.name), "".concat(prefixCls, "-spin"), !!spin || icon.name === "loading"), className);
|
|
5313
5317
|
var iconTabIndex = tabIndex;
|
|
5314
5318
|
if (iconTabIndex === void 0 && onClick) {
|
|
@@ -5319,7 +5323,7 @@ var Icon = /* @__PURE__ */ React$1.forwardRef(function(props, ref) {
|
|
|
5319
5323
|
transform: "rotate(".concat(rotate, "deg)")
|
|
5320
5324
|
} : void 0;
|
|
5321
5325
|
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1];
|
|
5322
|
-
return /* @__PURE__ */ React
|
|
5326
|
+
return /* @__PURE__ */ React.createElement("span", _extends({
|
|
5323
5327
|
role: "img",
|
|
5324
5328
|
"aria-label": icon.name
|
|
5325
5329
|
}, restProps, {
|
|
@@ -5327,7 +5331,7 @@ var Icon = /* @__PURE__ */ React$1.forwardRef(function(props, ref) {
|
|
|
5327
5331
|
tabIndex: iconTabIndex,
|
|
5328
5332
|
onClick,
|
|
5329
5333
|
className: classString
|
|
5330
|
-
}), /* @__PURE__ */ React
|
|
5334
|
+
}), /* @__PURE__ */ React.createElement(IconBase, {
|
|
5331
5335
|
icon,
|
|
5332
5336
|
primaryColor,
|
|
5333
5337
|
secondaryColor,
|
|
@@ -5351,12 +5355,12 @@ function cloneElement(element, props) {
|
|
|
5351
5355
|
}
|
|
5352
5356
|
var LoadingOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, "name": "loading", "theme": "outlined" };
|
|
5353
5357
|
var LoadingOutlined = function LoadingOutlined2(props, ref) {
|
|
5354
|
-
return /* @__PURE__ */ React
|
|
5358
|
+
return /* @__PURE__ */ React.createElement(Icon, _extends({}, props, {
|
|
5355
5359
|
ref,
|
|
5356
5360
|
icon: LoadingOutlined$1
|
|
5357
5361
|
}));
|
|
5358
5362
|
};
|
|
5359
|
-
var RefIcon = /* @__PURE__ */ React
|
|
5363
|
+
var RefIcon = /* @__PURE__ */ React.forwardRef(LoadingOutlined);
|
|
5360
5364
|
if (process.env.NODE_ENV !== "production") {
|
|
5361
5365
|
RefIcon.displayName = "LoadingOutlined";
|
|
5362
5366
|
}
|
|
@@ -5722,7 +5726,7 @@ function _unmount() {
|
|
|
5722
5726
|
}
|
|
5723
5727
|
const defaultReactRender = (node2, container) => {
|
|
5724
5728
|
if (process.env.NODE_ENV !== "production") {
|
|
5725
|
-
const majorVersion = parseInt(React
|
|
5729
|
+
const majorVersion = parseInt(React.version.split(".")[0], 10);
|
|
5726
5730
|
const fullKeys = Object.keys(ReactDOM);
|
|
5727
5731
|
process.env.NODE_ENV !== "production" ? warning$2(majorVersion < 19 || fullKeys.includes("createRoot"), "compatible", "antd v5 support React is 16 ~ 18. see https://u.ant.design/v5-for-19 for compatible.") : void 0;
|
|
5728
5732
|
}
|
|
@@ -5828,18 +5832,18 @@ const WaveEffect = (props) => {
|
|
|
5828
5832
|
component,
|
|
5829
5833
|
registerUnmount
|
|
5830
5834
|
} = props;
|
|
5831
|
-
const divRef = React
|
|
5832
|
-
const unmountRef = React
|
|
5833
|
-
React
|
|
5835
|
+
const divRef = React.useRef(null);
|
|
5836
|
+
const unmountRef = React.useRef(null);
|
|
5837
|
+
React.useEffect(() => {
|
|
5834
5838
|
unmountRef.current = registerUnmount();
|
|
5835
5839
|
}, []);
|
|
5836
|
-
const [color, setWaveColor] = React
|
|
5837
|
-
const [borderRadius, setBorderRadius] = React
|
|
5838
|
-
const [left, setLeft] = React
|
|
5839
|
-
const [top, setTop] = React
|
|
5840
|
-
const [width, setWidth] = React
|
|
5841
|
-
const [height, setHeight] = React
|
|
5842
|
-
const [enabled, setEnabled] = React
|
|
5840
|
+
const [color, setWaveColor] = React.useState(null);
|
|
5841
|
+
const [borderRadius, setBorderRadius] = React.useState([]);
|
|
5842
|
+
const [left, setLeft] = React.useState(0);
|
|
5843
|
+
const [top, setTop] = React.useState(0);
|
|
5844
|
+
const [width, setWidth] = React.useState(0);
|
|
5845
|
+
const [height, setHeight] = React.useState(0);
|
|
5846
|
+
const [enabled, setEnabled] = React.useState(false);
|
|
5843
5847
|
const waveStyle = {
|
|
5844
5848
|
left,
|
|
5845
5849
|
top,
|
|
@@ -5870,7 +5874,7 @@ const WaveEffect = (props) => {
|
|
|
5870
5874
|
} = nodeStyle;
|
|
5871
5875
|
setBorderRadius([borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius].map((radius) => validateNum(parseFloat(radius))));
|
|
5872
5876
|
}
|
|
5873
|
-
React
|
|
5877
|
+
React.useEffect(() => {
|
|
5874
5878
|
if (target) {
|
|
5875
5879
|
const id = wrapperRaf(() => {
|
|
5876
5880
|
syncPos();
|
|
@@ -5891,7 +5895,7 @@ const WaveEffect = (props) => {
|
|
|
5891
5895
|
return null;
|
|
5892
5896
|
}
|
|
5893
5897
|
const isSmallComponent = (component === "Checkbox" || component === "Radio") && (target === null || target === void 0 ? void 0 : target.classList.contains(TARGET_CLS));
|
|
5894
|
-
return /* @__PURE__ */ React
|
|
5898
|
+
return /* @__PURE__ */ React.createElement(CSSMotion, {
|
|
5895
5899
|
visible: true,
|
|
5896
5900
|
motionAppear: true,
|
|
5897
5901
|
motionName: "wave-motion",
|
|
@@ -5910,7 +5914,7 @@ const WaveEffect = (props) => {
|
|
|
5910
5914
|
let {
|
|
5911
5915
|
className: motionClassName
|
|
5912
5916
|
} = _ref;
|
|
5913
|
-
return /* @__PURE__ */ React
|
|
5917
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
5914
5918
|
ref: composeRef(divRef, ref),
|
|
5915
5919
|
className: classNames(className, motionClassName, {
|
|
5916
5920
|
"wave-quick": isSmallComponent
|
|
@@ -5937,7 +5941,7 @@ const showWaveEffect = (target, info) => {
|
|
|
5937
5941
|
function registerUnmount() {
|
|
5938
5942
|
return unmountCallback;
|
|
5939
5943
|
}
|
|
5940
|
-
unmountCallback = reactRender2(/* @__PURE__ */ React
|
|
5944
|
+
unmountCallback = reactRender2(/* @__PURE__ */ React.createElement(WaveEffect, Object.assign({}, info, {
|
|
5941
5945
|
target,
|
|
5942
5946
|
registerUnmount
|
|
5943
5947
|
})), holder);
|
|
@@ -5945,7 +5949,7 @@ const showWaveEffect = (target, info) => {
|
|
|
5945
5949
|
const useWave = (nodeRef, className, component) => {
|
|
5946
5950
|
const {
|
|
5947
5951
|
wave
|
|
5948
|
-
} = React
|
|
5952
|
+
} = React.useContext(ConfigContext);
|
|
5949
5953
|
const [, token2, hashId] = useToken();
|
|
5950
5954
|
const showWave = useEvent((event) => {
|
|
5951
5955
|
const node2 = nodeRef.current;
|
|
@@ -5964,7 +5968,7 @@ const useWave = (nodeRef, className, component) => {
|
|
|
5964
5968
|
hashId
|
|
5965
5969
|
});
|
|
5966
5970
|
});
|
|
5967
|
-
const rafId = React
|
|
5971
|
+
const rafId = React.useRef(null);
|
|
5968
5972
|
const showDebounceWave = (event) => {
|
|
5969
5973
|
wrapperRaf.cancel(rafId.current);
|
|
5970
5974
|
rafId.current = wrapperRaf(() => {
|
|
@@ -6038,10 +6042,10 @@ const useSize = (customSize) => {
|
|
|
6038
6042
|
}
|
|
6039
6043
|
return t;
|
|
6040
6044
|
});
|
|
6041
|
-
const SpaceCompactItemContext = /* @__PURE__ */ React
|
|
6045
|
+
const SpaceCompactItemContext = /* @__PURE__ */ React.createContext(null);
|
|
6042
6046
|
const useCompactItemContext = (prefixCls, direction) => {
|
|
6043
|
-
const compactItemContext = React
|
|
6044
|
-
const compactItemClassnames = React
|
|
6047
|
+
const compactItemContext = React.useContext(SpaceCompactItemContext);
|
|
6048
|
+
const compactItemClassnames = React.useMemo(() => {
|
|
6045
6049
|
if (!compactItemContext) {
|
|
6046
6050
|
return "";
|
|
6047
6051
|
}
|
|
@@ -6071,12 +6075,12 @@ var __rest$1 = function(s, e) {
|
|
|
6071
6075
|
}
|
|
6072
6076
|
return t;
|
|
6073
6077
|
};
|
|
6074
|
-
const GroupSizeContext = /* @__PURE__ */ React
|
|
6078
|
+
const GroupSizeContext = /* @__PURE__ */ React.createContext(void 0);
|
|
6075
6079
|
const ButtonGroup = (props) => {
|
|
6076
6080
|
const {
|
|
6077
6081
|
getPrefixCls,
|
|
6078
6082
|
direction
|
|
6079
|
-
} = React
|
|
6083
|
+
} = React.useContext(ConfigContext);
|
|
6080
6084
|
const {
|
|
6081
6085
|
prefixCls: customizePrefixCls,
|
|
6082
6086
|
size,
|
|
@@ -6084,7 +6088,7 @@ const ButtonGroup = (props) => {
|
|
|
6084
6088
|
} = props, others = __rest$1(props, ["prefixCls", "size", "className"]);
|
|
6085
6089
|
const prefixCls = getPrefixCls("btn-group", customizePrefixCls);
|
|
6086
6090
|
const [, , hashId] = useToken();
|
|
6087
|
-
const sizeCls = React
|
|
6091
|
+
const sizeCls = React.useMemo(() => {
|
|
6088
6092
|
switch (size) {
|
|
6089
6093
|
case "large":
|
|
6090
6094
|
return "lg";
|
|
@@ -6103,9 +6107,9 @@ const ButtonGroup = (props) => {
|
|
|
6103
6107
|
[`${prefixCls}-${sizeCls}`]: sizeCls,
|
|
6104
6108
|
[`${prefixCls}-rtl`]: direction === "rtl"
|
|
6105
6109
|
}, className, hashId);
|
|
6106
|
-
return /* @__PURE__ */ React
|
|
6110
|
+
return /* @__PURE__ */ React.createElement(GroupSizeContext.Provider, {
|
|
6107
6111
|
value: size
|
|
6108
|
-
}, /* @__PURE__ */ React
|
|
6112
|
+
}, /* @__PURE__ */ React.createElement("div", Object.assign({}, others, {
|
|
6109
6113
|
className: classes
|
|
6110
6114
|
})));
|
|
6111
6115
|
};
|
|
@@ -6688,7 +6692,7 @@ var Slider = function Slider2(props) {
|
|
|
6688
6692
|
})));
|
|
6689
6693
|
};
|
|
6690
6694
|
function useComponent(components) {
|
|
6691
|
-
return React
|
|
6695
|
+
return React.useMemo(function() {
|
|
6692
6696
|
var _ref = components || {}, slider = _ref.slider;
|
|
6693
6697
|
return [slider || Slider];
|
|
6694
6698
|
}, [components]);
|
|
@@ -7843,7 +7847,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
7843
7847
|
}
|
|
7844
7848
|
const Button = (_a) => {
|
|
7845
7849
|
var _b = _a, { children, onClick } = _b, props = __objRest(_b, ["children", "onClick"]);
|
|
7846
|
-
return /* @__PURE__ */
|
|
7850
|
+
return /* @__PURE__ */ jsx(Button$1, __spreadProps(__spreadValues({ type: "primary", onClick }, props), { children }));
|
|
7847
7851
|
};
|
|
7848
7852
|
export {
|
|
7849
7853
|
Button
|