fis-component 0.0.11 → 0.0.13
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.js +72 -73
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Button/Button.stories.d.ts +12 -0
- package/dist/cjs/types/components/Button/index.d.ts +1 -1
- package/dist/cjs/types/components/MyComponent/index.d.ts +1 -1
- package/dist/cjs/types/components/Page/Page.stories.d.ts +35 -0
- package/dist/esm/index.js +105 -106
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Button/Button.stories.d.ts +12 -0
- package/dist/esm/types/components/Button/index.d.ts +1 -1
- package/dist/esm/types/components/MyComponent/index.d.ts +1 -1
- package/dist/esm/types/components/Page/Page.stories.d.ts +35 -0
- package/dist/index.d.ts +3 -3
- package/package.json +1 -6
package/dist/cjs/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var React = require('react');
|
|
3
|
+
var React$1 = require('react');
|
|
5
4
|
var ReactDOM = require('react-dom');
|
|
6
5
|
|
|
7
6
|
function _interopNamespaceDefault(e) {
|
|
@@ -21,11 +20,11 @@ function _interopNamespaceDefault(e) {
|
|
|
21
20
|
return Object.freeze(n);
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
23
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React$1);
|
|
25
24
|
var ReactDOM__namespace = /*#__PURE__*/_interopNamespaceDefault(ReactDOM);
|
|
26
25
|
|
|
27
26
|
const MyComponent = () => {
|
|
28
|
-
return
|
|
27
|
+
return React.createElement("div", null, "Hello from my React component!");
|
|
29
28
|
};
|
|
30
29
|
|
|
31
30
|
function getDefaultExportFromCjs (x) {
|
|
@@ -538,7 +537,7 @@ function findDOMNode(node) {
|
|
|
538
537
|
if (domNode) {
|
|
539
538
|
return domNode;
|
|
540
539
|
}
|
|
541
|
-
if (node instanceof React.Component) {
|
|
540
|
+
if (node instanceof React$1.Component) {
|
|
542
541
|
var _ReactDOM$findDOMNode;
|
|
543
542
|
return (_ReactDOM$findDOMNode = ReactDOM.findDOMNode) === null || _ReactDOM$findDOMNode === void 0 ? void 0 : _ReactDOM$findDOMNode.call(ReactDOM, node);
|
|
544
543
|
}
|
|
@@ -595,7 +594,7 @@ var supportRef = function supportRef(nodeOrComponent) {
|
|
|
595
594
|
return true;
|
|
596
595
|
};
|
|
597
596
|
function isReactElement(node) {
|
|
598
|
-
return /*#__PURE__*/React.isValidElement(node) && !reactIsExports.isFragment(node);
|
|
597
|
+
return /*#__PURE__*/React$1.isValidElement(node) && !reactIsExports.isFragment(node);
|
|
599
598
|
}
|
|
600
599
|
|
|
601
600
|
/**
|
|
@@ -603,7 +602,7 @@ function isReactElement(node) {
|
|
|
603
602
|
* But a property from `props.ref`.
|
|
604
603
|
* To check if `props.ref` exist or fallback to `ref`.
|
|
605
604
|
*/
|
|
606
|
-
Number(React.version.split('.')[0]) >= 19 ?
|
|
605
|
+
Number(React$1.version.split('.')[0]) >= 19 ?
|
|
607
606
|
// >= React 19
|
|
608
607
|
function (node) {
|
|
609
608
|
if (isReactElement(node)) {
|
|
@@ -1784,7 +1783,7 @@ var TOKEN_PREFIX = 'token';
|
|
|
1784
1783
|
*/
|
|
1785
1784
|
function useCacheToken(theme, tokens) {
|
|
1786
1785
|
var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1787
|
-
var _useContext = React.useContext(StyleContext$1),
|
|
1786
|
+
var _useContext = React$1.useContext(StyleContext$1),
|
|
1788
1787
|
instanceId = _useContext.cache.instanceId,
|
|
1789
1788
|
container = _useContext.container;
|
|
1790
1789
|
var _option$salt = option.salt,
|
|
@@ -2957,7 +2956,7 @@ var useCSSVarRegister = function useCSSVarRegister(config, fn) {
|
|
|
2957
2956
|
token = config.token,
|
|
2958
2957
|
_config$scope = config.scope,
|
|
2959
2958
|
scope = _config$scope === void 0 ? '' : _config$scope;
|
|
2960
|
-
var _useContext = React.useContext(StyleContext$1),
|
|
2959
|
+
var _useContext = React$1.useContext(StyleContext$1),
|
|
2961
2960
|
instanceId = _useContext.cache.instanceId,
|
|
2962
2961
|
container = _useContext.container;
|
|
2963
2962
|
var tokenKey = token._tokenKey;
|
|
@@ -3089,7 +3088,7 @@ function noSplit(list) {
|
|
|
3089
3088
|
borderEndEndRadius: ['borderBottomRightRadius']
|
|
3090
3089
|
});
|
|
3091
3090
|
|
|
3092
|
-
var IconContext = /*#__PURE__*/React.createContext({});
|
|
3091
|
+
var IconContext = /*#__PURE__*/React$1.createContext({});
|
|
3093
3092
|
var Context$1 = IconContext;
|
|
3094
3093
|
|
|
3095
3094
|
function _toArray(r) {
|
|
@@ -3247,7 +3246,7 @@ var warning$2 = warning$1;
|
|
|
3247
3246
|
// ZombieJ: We export single file here since
|
|
3248
3247
|
// ConfigProvider use this which will make loop deps
|
|
3249
3248
|
// to import whole `rc-field-form`
|
|
3250
|
-
var ValidateMessagesContext = /*#__PURE__*/React.createContext(undefined);
|
|
3249
|
+
var ValidateMessagesContext = /*#__PURE__*/React$1.createContext(undefined);
|
|
3251
3250
|
|
|
3252
3251
|
var locale$3 = {
|
|
3253
3252
|
// Options
|
|
@@ -3485,7 +3484,7 @@ function changeConfirmLocale(newLocale) {
|
|
|
3485
3484
|
Object.assign({}, defaultLocale.Modal);
|
|
3486
3485
|
}
|
|
3487
3486
|
|
|
3488
|
-
const LocaleContext = /*#__PURE__*/React.createContext(undefined);
|
|
3487
|
+
const LocaleContext = /*#__PURE__*/React$1.createContext(undefined);
|
|
3489
3488
|
var LocaleContext$1 = LocaleContext;
|
|
3490
3489
|
|
|
3491
3490
|
const ANT_MARK = 'internalMark';
|
|
@@ -5259,7 +5258,7 @@ const defaultConfig = {
|
|
|
5259
5258
|
},
|
|
5260
5259
|
hashed: true
|
|
5261
5260
|
};
|
|
5262
|
-
const DesignTokenContext = /*#__PURE__*/React.createContext(defaultConfig);
|
|
5261
|
+
const DesignTokenContext = /*#__PURE__*/React$1.createContext(defaultConfig);
|
|
5263
5262
|
|
|
5264
5263
|
const defaultPrefixCls = 'ant';
|
|
5265
5264
|
const defaultIconPrefixCls = 'anticon';
|
|
@@ -5375,8 +5374,8 @@ const SizeContextProvider = _ref => {
|
|
|
5375
5374
|
var SizeContext$1 = SizeContext;
|
|
5376
5375
|
|
|
5377
5376
|
function useConfig() {
|
|
5378
|
-
const componentDisabled = React.useContext(DisabledContext$1);
|
|
5379
|
-
const componentSize = React.useContext(SizeContext$1);
|
|
5377
|
+
const componentDisabled = React$1.useContext(DisabledContext$1);
|
|
5378
|
+
const componentSize = React$1.useContext(SizeContext$1);
|
|
5380
5379
|
return {
|
|
5381
5380
|
componentDisabled,
|
|
5382
5381
|
componentSize
|
|
@@ -5828,7 +5827,7 @@ var uniqueMap = new ArrayKeyMap();
|
|
|
5828
5827
|
* Like `useMemo`, but this hook result will be shared across all instances.
|
|
5829
5828
|
*/
|
|
5830
5829
|
function useUniqueMemo(memoFn, deps) {
|
|
5831
|
-
return React.useMemo(function () {
|
|
5830
|
+
return React$1.useMemo(function () {
|
|
5832
5831
|
var cachedValue = uniqueMap.get(deps);
|
|
5833
5832
|
if (cachedValue) {
|
|
5834
5833
|
return cachedValue;
|
|
@@ -5927,7 +5926,7 @@ function genStyleUtils(config) {
|
|
|
5927
5926
|
var _useToken2 = useToken(),
|
|
5928
5927
|
cssVar = _useToken2.cssVar;
|
|
5929
5928
|
return [function (node) {
|
|
5930
|
-
return injectStyle && cssVar ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CSSVarRegister, {
|
|
5929
|
+
return injectStyle && cssVar ? /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(CSSVarRegister, {
|
|
5931
5930
|
rootCls: rootCls,
|
|
5932
5931
|
cssVar: cssVar,
|
|
5933
5932
|
component: component
|
|
@@ -6379,7 +6378,7 @@ function useToken() {
|
|
|
6379
6378
|
theme,
|
|
6380
6379
|
override,
|
|
6381
6380
|
cssVar
|
|
6382
|
-
} = React.useContext(DesignTokenContext);
|
|
6381
|
+
} = React$1.useContext(DesignTokenContext);
|
|
6383
6382
|
const salt = `${version$1}-${hashed || ''}`;
|
|
6384
6383
|
const mergedTheme = theme || defaultTheme;
|
|
6385
6384
|
const [token, hashId, realToken] = useCacheToken(mergedTheme, [seedToken$1, rootDesignToken], {
|
|
@@ -6514,7 +6513,7 @@ const {
|
|
|
6514
6513
|
const {
|
|
6515
6514
|
getPrefixCls,
|
|
6516
6515
|
iconPrefixCls
|
|
6517
|
-
} = React.useContext(ConfigContext);
|
|
6516
|
+
} = React$1.useContext(ConfigContext);
|
|
6518
6517
|
const rootPrefixCls = getPrefixCls();
|
|
6519
6518
|
return {
|
|
6520
6519
|
rootPrefixCls,
|
|
@@ -6535,7 +6534,7 @@ const {
|
|
|
6535
6534
|
const {
|
|
6536
6535
|
csp,
|
|
6537
6536
|
iconPrefixCls
|
|
6538
|
-
} = React.useContext(ConfigContext);
|
|
6537
|
+
} = React$1.useContext(ConfigContext);
|
|
6539
6538
|
// Generate style for icons
|
|
6540
6539
|
useStyle$2(iconPrefixCls, csp);
|
|
6541
6540
|
return csp !== null && csp !== void 0 ? csp : {};
|
|
@@ -6728,7 +6727,7 @@ function getTransitionName(transitionName, transitionType) {
|
|
|
6728
6727
|
}
|
|
6729
6728
|
|
|
6730
6729
|
var useDomMotionEvents = (function (onInternalMotionEnd) {
|
|
6731
|
-
var cacheElementRef = React.useRef();
|
|
6730
|
+
var cacheElementRef = React$1.useRef();
|
|
6732
6731
|
|
|
6733
6732
|
// Remove events
|
|
6734
6733
|
function removeMotionEvents(element) {
|
|
@@ -6762,7 +6761,7 @@ var useDomMotionEvents = (function (onInternalMotionEnd) {
|
|
|
6762
6761
|
});
|
|
6763
6762
|
|
|
6764
6763
|
// It's safe to use `useLayoutEffect` but the warning is annoying
|
|
6765
|
-
var useIsomorphicLayoutEffect = canUseDom() ? React.useLayoutEffect : React.useEffect;
|
|
6764
|
+
var useIsomorphicLayoutEffect = canUseDom() ? React$1.useLayoutEffect : React$1.useEffect;
|
|
6766
6765
|
|
|
6767
6766
|
var useNextFrame = (function () {
|
|
6768
6767
|
var nextFrameRef = React__namespace.useRef(null);
|
|
@@ -6886,8 +6885,8 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
6886
6885
|
style = _useState4[0],
|
|
6887
6886
|
setStyle = _useState4[1];
|
|
6888
6887
|
var currentStatus = getStatus();
|
|
6889
|
-
var mountedRef = React.useRef(false);
|
|
6890
|
-
var deadlineRef = React.useRef(null);
|
|
6888
|
+
var mountedRef = React$1.useRef(false);
|
|
6889
|
+
var deadlineRef = React$1.useRef(null);
|
|
6891
6890
|
|
|
6892
6891
|
// =========================== Dom Node ===========================
|
|
6893
6892
|
function getDomElement() {
|
|
@@ -6895,7 +6894,7 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
6895
6894
|
}
|
|
6896
6895
|
|
|
6897
6896
|
// ========================== Motion End ==========================
|
|
6898
|
-
var activeRef = React.useRef(false);
|
|
6897
|
+
var activeRef = React$1.useRef(false);
|
|
6899
6898
|
|
|
6900
6899
|
/**
|
|
6901
6900
|
* Clean up status & style
|
|
@@ -7032,7 +7031,7 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
7032
7031
|
|
|
7033
7032
|
// ============================ Effect ============================
|
|
7034
7033
|
// Reset when motion changed
|
|
7035
|
-
React.useEffect(function () {
|
|
7034
|
+
React$1.useEffect(function () {
|
|
7036
7035
|
if (
|
|
7037
7036
|
// Cancel appear
|
|
7038
7037
|
currentStatus === STATUS_APPEAR && !motionAppear ||
|
|
@@ -7043,7 +7042,7 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
7043
7042
|
setStatus(STATUS_NONE);
|
|
7044
7043
|
}
|
|
7045
7044
|
}, [motionAppear, motionEnter, motionLeave]);
|
|
7046
|
-
React.useEffect(function () {
|
|
7045
|
+
React$1.useEffect(function () {
|
|
7047
7046
|
return function () {
|
|
7048
7047
|
mountedRef.current = false;
|
|
7049
7048
|
clearTimeout(deadlineRef.current);
|
|
@@ -7052,7 +7051,7 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
7052
7051
|
|
|
7053
7052
|
// Trigger `onVisibleChanged`
|
|
7054
7053
|
var firstMountChangeRef = React__namespace.useRef(false);
|
|
7055
|
-
React.useEffect(function () {
|
|
7054
|
+
React$1.useEffect(function () {
|
|
7056
7055
|
// [visible & motion not end] => [!visible & motion end] still need trigger onVisibleChanged
|
|
7057
7056
|
if (asyncVisible) {
|
|
7058
7057
|
firstMountChangeRef.current = true;
|
|
@@ -7103,9 +7102,9 @@ function genCSSMotion(config) {
|
|
|
7103
7102
|
var supportMotion = isSupportTransition(props, contextMotion);
|
|
7104
7103
|
|
|
7105
7104
|
// Ref to the react node, it may be a HTMLElement
|
|
7106
|
-
var nodeRef = React.useRef();
|
|
7105
|
+
var nodeRef = React$1.useRef();
|
|
7107
7106
|
// Ref to the dom wrapper in case ref can not pass to HTMLElement
|
|
7108
|
-
var wrapperNodeRef = React.useRef();
|
|
7107
|
+
var wrapperNodeRef = React$1.useRef();
|
|
7109
7108
|
function getDomElement() {
|
|
7110
7109
|
try {
|
|
7111
7110
|
// Here we're avoiding call for findDOMNode since it's deprecated
|
|
@@ -7857,13 +7856,13 @@ function normalizeAttrs() {
|
|
|
7857
7856
|
}
|
|
7858
7857
|
function generate(node, key, rootProps) {
|
|
7859
7858
|
if (!rootProps) {
|
|
7860
|
-
return /*#__PURE__*/React.createElement(node.tag, _objectSpread2({
|
|
7859
|
+
return /*#__PURE__*/React$1.createElement(node.tag, _objectSpread2({
|
|
7861
7860
|
key: key
|
|
7862
7861
|
}, normalizeAttrs(node.attrs)), (node.children || []).map(function (child, index) {
|
|
7863
7862
|
return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
|
|
7864
7863
|
}));
|
|
7865
7864
|
}
|
|
7866
|
-
return /*#__PURE__*/React.createElement(node.tag, _objectSpread2(_objectSpread2({
|
|
7865
|
+
return /*#__PURE__*/React$1.createElement(node.tag, _objectSpread2(_objectSpread2({
|
|
7867
7866
|
key: key
|
|
7868
7867
|
}, normalizeAttrs(node.attrs)), rootProps), (node.children || []).map(function (child, index) {
|
|
7869
7868
|
return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
|
|
@@ -7881,14 +7880,14 @@ function normalizeTwoToneColors(twoToneColor) {
|
|
|
7881
7880
|
}
|
|
7882
7881
|
var iconStyles = "\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";
|
|
7883
7882
|
var useInsertStyles = function useInsertStyles(eleRef) {
|
|
7884
|
-
var _useContext = React.useContext(Context$1),
|
|
7883
|
+
var _useContext = React$1.useContext(Context$1),
|
|
7885
7884
|
csp = _useContext.csp,
|
|
7886
7885
|
prefixCls = _useContext.prefixCls;
|
|
7887
7886
|
var mergedStyleStr = iconStyles;
|
|
7888
7887
|
if (prefixCls) {
|
|
7889
7888
|
mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls);
|
|
7890
7889
|
}
|
|
7891
|
-
React.useEffect(function () {
|
|
7890
|
+
React$1.useEffect(function () {
|
|
7892
7891
|
var ele = eleRef.current;
|
|
7893
7892
|
var shadowRoot = getShadowRoot(ele);
|
|
7894
7893
|
updateCSS(mergedStyleStr, '@ant-design-icons', {
|
|
@@ -8032,13 +8031,13 @@ Icon.setTwoToneColor = setTwoToneColor;
|
|
|
8032
8031
|
var AntdIcon = Icon;
|
|
8033
8032
|
|
|
8034
8033
|
function isFragment(child) {
|
|
8035
|
-
return child && /*#__PURE__*/React.isValidElement(child) && child.type === React.Fragment;
|
|
8034
|
+
return child && /*#__PURE__*/React$1.isValidElement(child) && child.type === React$1.Fragment;
|
|
8036
8035
|
}
|
|
8037
8036
|
const replaceElement = (element, replacement, props) => {
|
|
8038
|
-
if (! /*#__PURE__*/React.isValidElement(element)) {
|
|
8037
|
+
if (! /*#__PURE__*/React$1.isValidElement(element)) {
|
|
8039
8038
|
return replacement;
|
|
8040
8039
|
}
|
|
8041
|
-
return /*#__PURE__*/React.cloneElement(element, typeof props === 'function' ? props(element.props || {}) : props);
|
|
8040
|
+
return /*#__PURE__*/React$1.cloneElement(element, typeof props === 'function' ? props(element.props || {}) : props);
|
|
8042
8041
|
};
|
|
8043
8042
|
function cloneElement(element, props) {
|
|
8044
8043
|
return replaceElement(element, element, props);
|
|
@@ -8739,15 +8738,15 @@ const Wave = props => {
|
|
|
8739
8738
|
} = props;
|
|
8740
8739
|
const {
|
|
8741
8740
|
getPrefixCls
|
|
8742
|
-
} = React.useContext(ConfigContext);
|
|
8743
|
-
const containerRef = React.useRef(null);
|
|
8741
|
+
} = React$1.useContext(ConfigContext);
|
|
8742
|
+
const containerRef = React$1.useRef(null);
|
|
8744
8743
|
// ============================== Style ===============================
|
|
8745
8744
|
const prefixCls = getPrefixCls('wave');
|
|
8746
8745
|
const [, hashId] = useStyle$1(prefixCls);
|
|
8747
8746
|
// =============================== Wave ===============================
|
|
8748
8747
|
const showWave = useWave$1(containerRef, classNames(prefixCls, hashId), component);
|
|
8749
8748
|
// ============================== Effect ==============================
|
|
8750
|
-
React.useEffect(() => {
|
|
8749
|
+
React$1.useEffect(() => {
|
|
8751
8750
|
const node = containerRef.current;
|
|
8752
8751
|
if (!node || node.nodeType !== 1 || disabled) {
|
|
8753
8752
|
return;
|
|
@@ -8769,7 +8768,7 @@ const Wave = props => {
|
|
|
8769
8768
|
};
|
|
8770
8769
|
}, [disabled]);
|
|
8771
8770
|
// ============================== Render ==============================
|
|
8772
|
-
if (! /*#__PURE__*/React.isValidElement(children)) {
|
|
8771
|
+
if (! /*#__PURE__*/React$1.isValidElement(children)) {
|
|
8773
8772
|
return children !== null && children !== void 0 ? children : null;
|
|
8774
8773
|
}
|
|
8775
8774
|
const ref = supportRef(children) ? composeRef(children.ref, containerRef) : containerRef;
|
|
@@ -8783,8 +8782,8 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
8783
8782
|
var Wave$1 = Wave;
|
|
8784
8783
|
|
|
8785
8784
|
const useSize = customSize => {
|
|
8786
|
-
const size = React.useContext(SizeContext$1);
|
|
8787
|
-
const mergedSize = React.useMemo(() => {
|
|
8785
|
+
const size = React$1.useContext(SizeContext$1);
|
|
8786
|
+
const mergedSize = React$1.useMemo(() => {
|
|
8788
8787
|
if (!customSize) {
|
|
8789
8788
|
return size;
|
|
8790
8789
|
}
|
|
@@ -8901,17 +8900,17 @@ function splitCNCharsBySpace(child, needInserted) {
|
|
|
8901
8900
|
});
|
|
8902
8901
|
}
|
|
8903
8902
|
if (isString(child)) {
|
|
8904
|
-
return isTwoCNChar(child) ? /*#__PURE__*/React.createElement("span", null, child.split('').join(SPACE)) : /*#__PURE__*/React.createElement("span", null, child);
|
|
8903
|
+
return isTwoCNChar(child) ? /*#__PURE__*/React$1.createElement("span", null, child.split('').join(SPACE)) : /*#__PURE__*/React$1.createElement("span", null, child);
|
|
8905
8904
|
}
|
|
8906
8905
|
if (isFragment(child)) {
|
|
8907
|
-
return /*#__PURE__*/React.createElement("span", null, child);
|
|
8906
|
+
return /*#__PURE__*/React$1.createElement("span", null, child);
|
|
8908
8907
|
}
|
|
8909
8908
|
return child;
|
|
8910
8909
|
}
|
|
8911
8910
|
function spaceChildren(children, needInserted) {
|
|
8912
8911
|
let isPrevChildPure = false;
|
|
8913
8912
|
const childList = [];
|
|
8914
|
-
React.Children.forEach(children, child => {
|
|
8913
|
+
React$1.Children.forEach(children, child => {
|
|
8915
8914
|
const type = typeof child;
|
|
8916
8915
|
const isCurrentChildPure = type === 'string' || type === 'number';
|
|
8917
8916
|
if (isPrevChildPure && isCurrentChildPure) {
|
|
@@ -8923,10 +8922,10 @@ function spaceChildren(children, needInserted) {
|
|
|
8923
8922
|
}
|
|
8924
8923
|
isPrevChildPure = isCurrentChildPure;
|
|
8925
8924
|
});
|
|
8926
|
-
return React.Children.map(childList, child => splitCNCharsBySpace(child, needInserted));
|
|
8925
|
+
return React$1.Children.map(childList, child => splitCNCharsBySpace(child, needInserted));
|
|
8927
8926
|
}
|
|
8928
8927
|
|
|
8929
|
-
const IconWrapper = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
8928
|
+
const IconWrapper = /*#__PURE__*/React$1.forwardRef((props, ref) => {
|
|
8930
8929
|
const {
|
|
8931
8930
|
className,
|
|
8932
8931
|
style,
|
|
@@ -8934,7 +8933,7 @@ const IconWrapper = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
8934
8933
|
prefixCls
|
|
8935
8934
|
} = props;
|
|
8936
8935
|
const iconWrapperCls = classNames(`${prefixCls}-icon`, className);
|
|
8937
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
8936
|
+
return /*#__PURE__*/React$1.createElement("span", {
|
|
8938
8937
|
ref: ref,
|
|
8939
8938
|
className: iconWrapperCls,
|
|
8940
8939
|
style: style
|
|
@@ -8942,7 +8941,7 @@ const IconWrapper = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
8942
8941
|
});
|
|
8943
8942
|
var IconWrapper$1 = IconWrapper;
|
|
8944
8943
|
|
|
8945
|
-
const InnerLoadingIcon = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
8944
|
+
const InnerLoadingIcon = /*#__PURE__*/React$1.forwardRef((props, ref) => {
|
|
8946
8945
|
const {
|
|
8947
8946
|
prefixCls,
|
|
8948
8947
|
className,
|
|
@@ -8950,12 +8949,12 @@ const InnerLoadingIcon = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
8950
8949
|
iconClassName
|
|
8951
8950
|
} = props;
|
|
8952
8951
|
const mergedIconCls = classNames(`${prefixCls}-loading-icon`, className);
|
|
8953
|
-
return /*#__PURE__*/React.createElement(IconWrapper$1, {
|
|
8952
|
+
return /*#__PURE__*/React$1.createElement(IconWrapper$1, {
|
|
8954
8953
|
prefixCls: prefixCls,
|
|
8955
8954
|
className: mergedIconCls,
|
|
8956
8955
|
style: style,
|
|
8957
8956
|
ref: ref
|
|
8958
|
-
}, /*#__PURE__*/React.createElement(LoadingOutlined$1, {
|
|
8957
|
+
}, /*#__PURE__*/React$1.createElement(LoadingOutlined$1, {
|
|
8959
8958
|
className: iconClassName
|
|
8960
8959
|
}));
|
|
8961
8960
|
});
|
|
@@ -8979,13 +8978,13 @@ const LoadingIcon = props => {
|
|
|
8979
8978
|
} = props;
|
|
8980
8979
|
const visible = !!loading;
|
|
8981
8980
|
if (existIcon) {
|
|
8982
|
-
return /*#__PURE__*/React.createElement(InnerLoadingIcon, {
|
|
8981
|
+
return /*#__PURE__*/React$1.createElement(InnerLoadingIcon, {
|
|
8983
8982
|
prefixCls: prefixCls,
|
|
8984
8983
|
className: className,
|
|
8985
8984
|
style: style
|
|
8986
8985
|
});
|
|
8987
8986
|
}
|
|
8988
|
-
return /*#__PURE__*/React.createElement(CSSMotion, {
|
|
8987
|
+
return /*#__PURE__*/React$1.createElement(CSSMotion, {
|
|
8989
8988
|
visible: visible,
|
|
8990
8989
|
// We do not really use this motionName
|
|
8991
8990
|
motionName: `${prefixCls}-loading-icon-motion`,
|
|
@@ -9002,7 +9001,7 @@ const LoadingIcon = props => {
|
|
|
9002
9001
|
className: motionCls,
|
|
9003
9002
|
style: motionStyle
|
|
9004
9003
|
} = _ref;
|
|
9005
|
-
return /*#__PURE__*/React.createElement(InnerLoadingIcon, {
|
|
9004
|
+
return /*#__PURE__*/React$1.createElement(InnerLoadingIcon, {
|
|
9006
9005
|
prefixCls: prefixCls,
|
|
9007
9006
|
className: className,
|
|
9008
9007
|
style: Object.assign(Object.assign({}, style), motionStyle),
|
|
@@ -9663,7 +9662,7 @@ function getLoadingConfig(loading) {
|
|
|
9663
9662
|
delay: 0
|
|
9664
9663
|
};
|
|
9665
9664
|
}
|
|
9666
|
-
const InternalCompoundedButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
9665
|
+
const InternalCompoundedButton = /*#__PURE__*/React$1.forwardRef((props, ref) => {
|
|
9667
9666
|
var _a, _b, _c;
|
|
9668
9667
|
const {
|
|
9669
9668
|
loading = false,
|
|
@@ -9695,20 +9694,20 @@ const InternalCompoundedButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
9695
9694
|
getPrefixCls,
|
|
9696
9695
|
direction,
|
|
9697
9696
|
button
|
|
9698
|
-
} = React.useContext(ConfigContext);
|
|
9697
|
+
} = React$1.useContext(ConfigContext);
|
|
9699
9698
|
const mergedInsertSpace = (_a = autoInsertSpace !== null && autoInsertSpace !== void 0 ? autoInsertSpace : button === null || button === void 0 ? void 0 : button.autoInsertSpace) !== null && _a !== void 0 ? _a : true;
|
|
9700
9699
|
const prefixCls = getPrefixCls('btn', customizePrefixCls);
|
|
9701
9700
|
const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);
|
|
9702
|
-
const disabled = React.useContext(DisabledContext$1);
|
|
9701
|
+
const disabled = React$1.useContext(DisabledContext$1);
|
|
9703
9702
|
const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
9704
|
-
const groupSize = React.useContext(GroupSizeContext);
|
|
9705
|
-
const loadingOrDelay = React.useMemo(() => getLoadingConfig(loading), [loading]);
|
|
9706
|
-
const [innerLoading, setLoading] = React.useState(loadingOrDelay.loading);
|
|
9707
|
-
const [hasTwoCNChar, setHasTwoCNChar] = React.useState(false);
|
|
9708
|
-
const internalRef = /*#__PURE__*/React.createRef();
|
|
9703
|
+
const groupSize = React$1.useContext(GroupSizeContext);
|
|
9704
|
+
const loadingOrDelay = React$1.useMemo(() => getLoadingConfig(loading), [loading]);
|
|
9705
|
+
const [innerLoading, setLoading] = React$1.useState(loadingOrDelay.loading);
|
|
9706
|
+
const [hasTwoCNChar, setHasTwoCNChar] = React$1.useState(false);
|
|
9707
|
+
const internalRef = /*#__PURE__*/React$1.createRef();
|
|
9709
9708
|
const buttonRef = composeRef(ref, internalRef);
|
|
9710
|
-
const needInserted = React.Children.count(children) === 1 && !icon && !isUnBorderedButtonType(mergedType);
|
|
9711
|
-
React.useEffect(() => {
|
|
9709
|
+
const needInserted = React$1.Children.count(children) === 1 && !icon && !isUnBorderedButtonType(mergedType);
|
|
9710
|
+
React$1.useEffect(() => {
|
|
9712
9711
|
let delayTimer = null;
|
|
9713
9712
|
if (loadingOrDelay.delay > 0) {
|
|
9714
9713
|
delayTimer = setTimeout(() => {
|
|
@@ -9726,7 +9725,7 @@ const InternalCompoundedButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
9726
9725
|
}
|
|
9727
9726
|
return cleanupTimer;
|
|
9728
9727
|
}, [loadingOrDelay]);
|
|
9729
|
-
React.useEffect(() => {
|
|
9728
|
+
React$1.useEffect(() => {
|
|
9730
9729
|
// FIXME: for HOC usage like <FormatMessage />
|
|
9731
9730
|
if (!buttonRef || !buttonRef.current || !mergedInsertSpace) {
|
|
9732
9731
|
return;
|
|
@@ -9788,18 +9787,18 @@ const InternalCompoundedButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
9788
9787
|
const fullStyle = Object.assign(Object.assign({}, button === null || button === void 0 ? void 0 : button.style), customStyle);
|
|
9789
9788
|
const iconClasses = classNames(customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames.icon, (_b = button === null || button === void 0 ? void 0 : button.classNames) === null || _b === void 0 ? void 0 : _b.icon);
|
|
9790
9789
|
const iconStyle = Object.assign(Object.assign({}, (styles === null || styles === void 0 ? void 0 : styles.icon) || {}), ((_c = button === null || button === void 0 ? void 0 : button.styles) === null || _c === void 0 ? void 0 : _c.icon) || {});
|
|
9791
|
-
const iconNode = icon && !innerLoading ? (/*#__PURE__*/React.createElement(IconWrapper$1, {
|
|
9790
|
+
const iconNode = icon && !innerLoading ? (/*#__PURE__*/React$1.createElement(IconWrapper$1, {
|
|
9792
9791
|
prefixCls: prefixCls,
|
|
9793
9792
|
className: iconClasses,
|
|
9794
9793
|
style: iconStyle
|
|
9795
|
-
}, icon)) : (/*#__PURE__*/React.createElement(LoadingIcon$1, {
|
|
9794
|
+
}, icon)) : (/*#__PURE__*/React$1.createElement(LoadingIcon$1, {
|
|
9796
9795
|
existIcon: !!icon,
|
|
9797
9796
|
prefixCls: prefixCls,
|
|
9798
9797
|
loading: innerLoading
|
|
9799
9798
|
}));
|
|
9800
9799
|
const kids = children || children === 0 ? spaceChildren(children, needInserted && mergedInsertSpace) : null;
|
|
9801
9800
|
if (linkButtonRestProps.href !== undefined) {
|
|
9802
|
-
return wrapCSSVar(/*#__PURE__*/React.createElement("a", Object.assign({}, linkButtonRestProps, {
|
|
9801
|
+
return wrapCSSVar(/*#__PURE__*/React$1.createElement("a", Object.assign({}, linkButtonRestProps, {
|
|
9803
9802
|
className: classNames(classes, {
|
|
9804
9803
|
[`${prefixCls}-disabled`]: mergedDisabled
|
|
9805
9804
|
}),
|
|
@@ -9810,19 +9809,19 @@ const InternalCompoundedButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
9810
9809
|
tabIndex: mergedDisabled ? -1 : 0
|
|
9811
9810
|
}), iconNode, kids));
|
|
9812
9811
|
}
|
|
9813
|
-
let buttonNode = /*#__PURE__*/React.createElement("button", Object.assign({}, rest, {
|
|
9812
|
+
let buttonNode = /*#__PURE__*/React$1.createElement("button", Object.assign({}, rest, {
|
|
9814
9813
|
type: htmlType,
|
|
9815
9814
|
className: classes,
|
|
9816
9815
|
style: fullStyle,
|
|
9817
9816
|
onClick: handleClick,
|
|
9818
9817
|
disabled: mergedDisabled,
|
|
9819
9818
|
ref: buttonRef
|
|
9820
|
-
}), iconNode, kids, !!compactItemClassnames && /*#__PURE__*/React.createElement(CompactCmp, {
|
|
9819
|
+
}), iconNode, kids, !!compactItemClassnames && /*#__PURE__*/React$1.createElement(CompactCmp, {
|
|
9821
9820
|
key: "compact",
|
|
9822
9821
|
prefixCls: prefixCls
|
|
9823
9822
|
}));
|
|
9824
9823
|
if (!isUnBorderedButtonType(mergedType)) {
|
|
9825
|
-
buttonNode = /*#__PURE__*/React.createElement(Wave$1, {
|
|
9824
|
+
buttonNode = /*#__PURE__*/React$1.createElement(Wave$1, {
|
|
9826
9825
|
component: "Button",
|
|
9827
9826
|
disabled: innerLoading
|
|
9828
9827
|
}, buttonNode);
|
|
@@ -9838,7 +9837,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
9838
9837
|
var Button$1 = Button;
|
|
9839
9838
|
|
|
9840
9839
|
const FisButton = () => {
|
|
9841
|
-
return
|
|
9840
|
+
return React.createElement(Button$1, null, "Hello from my React component!");
|
|
9842
9841
|
};
|
|
9843
9842
|
|
|
9844
9843
|
exports.FisButton = FisButton;
|