first commit
This commit is contained in:
37
frontend/node_modules/antd/lib/switch/index.d.ts
generated
vendored
Normal file
37
frontend/node_modules/antd/lib/switch/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
import * as React from 'react';
|
||||
import type { SwitchChangeEventHandler, SwitchClickEventHandler } from 'rc-switch';
|
||||
export type SwitchSize = 'small' | 'default';
|
||||
export type { SwitchChangeEventHandler, SwitchClickEventHandler };
|
||||
export interface SwitchProps {
|
||||
prefixCls?: string;
|
||||
size?: SwitchSize;
|
||||
className?: string;
|
||||
rootClassName?: string;
|
||||
checked?: boolean;
|
||||
defaultChecked?: boolean;
|
||||
/**
|
||||
* Alias for `checked`.
|
||||
* @since 5.12.0
|
||||
*/
|
||||
value?: boolean;
|
||||
/**
|
||||
* Alias for `defaultChecked`.
|
||||
* @since 5.12.0
|
||||
*/
|
||||
defaultValue?: boolean;
|
||||
onChange?: SwitchChangeEventHandler;
|
||||
onClick?: SwitchClickEventHandler;
|
||||
checkedChildren?: React.ReactNode;
|
||||
unCheckedChildren?: React.ReactNode;
|
||||
disabled?: boolean;
|
||||
loading?: boolean;
|
||||
autoFocus?: boolean;
|
||||
style?: React.CSSProperties;
|
||||
title?: string;
|
||||
tabIndex?: number;
|
||||
id?: string;
|
||||
}
|
||||
declare const InternalSwitch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
|
||||
type CompoundedComponent = typeof InternalSwitch & {};
|
||||
declare const Switch: CompoundedComponent;
|
||||
export default Switch;
|
||||
94
frontend/node_modules/antd/lib/switch/index.js
generated
vendored
Normal file
94
frontend/node_modules/antd/lib/switch/index.js
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _LoadingOutlined = _interopRequireDefault(require("@ant-design/icons/LoadingOutlined"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _rcSwitch = _interopRequireDefault(require("rc-switch"));
|
||||
var _useMergedState = _interopRequireDefault(require("rc-util/lib/hooks/useMergedState"));
|
||||
var _wave = _interopRequireDefault(require("../_util/wave"));
|
||||
var _configProvider = require("../config-provider");
|
||||
var _DisabledContext = _interopRequireDefault(require("../config-provider/DisabledContext"));
|
||||
var _useSize = _interopRequireDefault(require("../config-provider/hooks/useSize"));
|
||||
var _style = _interopRequireDefault(require("./style"));
|
||||
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const InternalSwitch = /*#__PURE__*/React.forwardRef((props, ref) => {
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
size: customizeSize,
|
||||
disabled: customDisabled,
|
||||
loading,
|
||||
className,
|
||||
rootClassName,
|
||||
style,
|
||||
checked: checkedProp,
|
||||
value,
|
||||
defaultChecked: defaultCheckedProp,
|
||||
defaultValue,
|
||||
onChange
|
||||
} = props,
|
||||
restProps = __rest(props, ["prefixCls", "size", "disabled", "loading", "className", "rootClassName", "style", "checked", "value", "defaultChecked", "defaultValue", "onChange"]);
|
||||
const [checked, setChecked] = (0, _useMergedState.default)(false, {
|
||||
value: checkedProp !== null && checkedProp !== void 0 ? checkedProp : value,
|
||||
defaultValue: defaultCheckedProp !== null && defaultCheckedProp !== void 0 ? defaultCheckedProp : defaultValue
|
||||
});
|
||||
const {
|
||||
getPrefixCls,
|
||||
direction,
|
||||
switch: SWITCH
|
||||
} = React.useContext(_configProvider.ConfigContext);
|
||||
// ===================== Disabled =====================
|
||||
const disabled = React.useContext(_DisabledContext.default);
|
||||
const mergedDisabled = (customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled) || loading;
|
||||
const prefixCls = getPrefixCls('switch', customizePrefixCls);
|
||||
const loadingIcon = /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-handle`
|
||||
}, loading && /*#__PURE__*/React.createElement(_LoadingOutlined.default, {
|
||||
className: `${prefixCls}-loading-icon`
|
||||
}));
|
||||
// Style
|
||||
const [wrapCSSVar, hashId, cssVarCls] = (0, _style.default)(prefixCls);
|
||||
const mergedSize = (0, _useSize.default)(customizeSize);
|
||||
const classes = (0, _classnames.default)(SWITCH === null || SWITCH === void 0 ? void 0 : SWITCH.className, {
|
||||
[`${prefixCls}-small`]: mergedSize === 'small',
|
||||
[`${prefixCls}-loading`]: loading,
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl'
|
||||
}, className, rootClassName, hashId, cssVarCls);
|
||||
const mergedStyle = Object.assign(Object.assign({}, SWITCH === null || SWITCH === void 0 ? void 0 : SWITCH.style), style);
|
||||
const changeHandler = (...args) => {
|
||||
setChecked(args[0]);
|
||||
onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, args);
|
||||
};
|
||||
return wrapCSSVar(/*#__PURE__*/React.createElement(_wave.default, {
|
||||
component: "Switch",
|
||||
disabled: mergedDisabled
|
||||
}, /*#__PURE__*/React.createElement(_rcSwitch.default, Object.assign({}, restProps, {
|
||||
checked: checked,
|
||||
onChange: changeHandler,
|
||||
prefixCls: prefixCls,
|
||||
className: classes,
|
||||
style: mergedStyle,
|
||||
disabled: mergedDisabled,
|
||||
ref: ref,
|
||||
loadingIcon: loadingIcon
|
||||
}))));
|
||||
});
|
||||
const Switch = InternalSwitch;
|
||||
Switch.__ANT_SWITCH = true;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Switch.displayName = 'Switch';
|
||||
}
|
||||
var _default = exports.default = Switch;
|
||||
71
frontend/node_modules/antd/lib/switch/style/index.d.ts
generated
vendored
Normal file
71
frontend/node_modules/antd/lib/switch/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
import type { GetDefaultToken } from '../../theme/internal';
|
||||
export interface ComponentToken {
|
||||
/**
|
||||
* @desc 开关高度
|
||||
* @descEN Height of Switch
|
||||
*/
|
||||
trackHeight: number | string;
|
||||
/**
|
||||
* @desc 小号开关高度
|
||||
* @descEN Height of small Switch
|
||||
*/
|
||||
trackHeightSM: number | string;
|
||||
/**
|
||||
* @desc 开关最小宽度
|
||||
* @descEN Minimum width of Switch
|
||||
*/
|
||||
trackMinWidth: number | string;
|
||||
/**
|
||||
* @desc 小号开关最小宽度
|
||||
* @descEN Minimum width of small Switch
|
||||
*/
|
||||
trackMinWidthSM: number | string;
|
||||
/**
|
||||
* @desc 开关内边距
|
||||
* @descEN Padding of Switch
|
||||
*/
|
||||
trackPadding: number;
|
||||
/**
|
||||
* @desc 开关把手背景色
|
||||
* @descEN Background color of Switch handle
|
||||
*/
|
||||
handleBg: string;
|
||||
/**
|
||||
* @desc 开关把手阴影
|
||||
* @descEN Shadow of Switch handle
|
||||
*/
|
||||
handleShadow: string;
|
||||
/**
|
||||
* @desc 开关把手大小
|
||||
* @descEN Size of Switch handle
|
||||
*/
|
||||
handleSize: number;
|
||||
/**
|
||||
* @desc 小号开关把手大小
|
||||
* @descEN Size of small Switch handle
|
||||
*/
|
||||
handleSizeSM: number;
|
||||
/**
|
||||
* @desc 内容区域最小边距
|
||||
* @descEN Minimum margin of content area
|
||||
*/
|
||||
innerMinMargin: number;
|
||||
/**
|
||||
* @desc 内容区域最大边距
|
||||
* @descEN Maximum margin of content area
|
||||
*/
|
||||
innerMaxMargin: number;
|
||||
/**
|
||||
* @desc 小号开关内容区域最小边距
|
||||
* @descEN Minimum margin of content area of small Switch
|
||||
*/
|
||||
innerMinMarginSM: number;
|
||||
/**
|
||||
* @desc 小号开关内容区域最大边距
|
||||
* @descEN Maximum margin of content area of small Switch
|
||||
*/
|
||||
innerMaxMarginSM: number;
|
||||
}
|
||||
export declare const prepareComponentToken: GetDefaultToken<'Switch'>;
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
323
frontend/node_modules/antd/lib/switch/style/index.js
generated
vendored
Normal file
323
frontend/node_modules/antd/lib/switch/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,323 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.prepareComponentToken = exports.default = void 0;
|
||||
var _cssinjs = require("@ant-design/cssinjs");
|
||||
var _fastColor = require("@ant-design/fast-color");
|
||||
var _style = require("../../style");
|
||||
var _internal = require("../../theme/internal");
|
||||
const genSwitchSmallStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
trackHeightSM,
|
||||
trackPadding,
|
||||
trackMinWidthSM,
|
||||
innerMinMarginSM,
|
||||
innerMaxMarginSM,
|
||||
handleSizeSM,
|
||||
calc
|
||||
} = token;
|
||||
const switchInnerCls = `${componentCls}-inner`;
|
||||
const trackPaddingCalc = (0, _cssinjs.unit)(calc(handleSizeSM).add(calc(trackPadding).mul(2)).equal());
|
||||
const innerMaxMarginCalc = (0, _cssinjs.unit)(calc(innerMaxMarginSM).mul(2).equal());
|
||||
return {
|
||||
[componentCls]: {
|
||||
[`&${componentCls}-small`]: {
|
||||
minWidth: trackMinWidthSM,
|
||||
height: trackHeightSM,
|
||||
lineHeight: (0, _cssinjs.unit)(trackHeightSM),
|
||||
[`${componentCls}-inner`]: {
|
||||
paddingInlineStart: innerMaxMarginSM,
|
||||
paddingInlineEnd: innerMinMarginSM,
|
||||
[`${switchInnerCls}-checked, ${switchInnerCls}-unchecked`]: {
|
||||
minHeight: trackHeightSM
|
||||
},
|
||||
[`${switchInnerCls}-checked`]: {
|
||||
marginInlineStart: `calc(-100% + ${trackPaddingCalc} - ${innerMaxMarginCalc})`,
|
||||
marginInlineEnd: `calc(100% - ${trackPaddingCalc} + ${innerMaxMarginCalc})`
|
||||
},
|
||||
[`${switchInnerCls}-unchecked`]: {
|
||||
marginTop: calc(trackHeightSM).mul(-1).equal(),
|
||||
marginInlineStart: 0,
|
||||
marginInlineEnd: 0
|
||||
}
|
||||
},
|
||||
[`${componentCls}-handle`]: {
|
||||
width: handleSizeSM,
|
||||
height: handleSizeSM
|
||||
},
|
||||
[`${componentCls}-loading-icon`]: {
|
||||
top: calc(calc(handleSizeSM).sub(token.switchLoadingIconSize)).div(2).equal(),
|
||||
fontSize: token.switchLoadingIconSize
|
||||
},
|
||||
[`&${componentCls}-checked`]: {
|
||||
[`${componentCls}-inner`]: {
|
||||
paddingInlineStart: innerMinMarginSM,
|
||||
paddingInlineEnd: innerMaxMarginSM,
|
||||
[`${switchInnerCls}-checked`]: {
|
||||
marginInlineStart: 0,
|
||||
marginInlineEnd: 0
|
||||
},
|
||||
[`${switchInnerCls}-unchecked`]: {
|
||||
marginInlineStart: `calc(100% - ${trackPaddingCalc} + ${innerMaxMarginCalc})`,
|
||||
marginInlineEnd: `calc(-100% + ${trackPaddingCalc} - ${innerMaxMarginCalc})`
|
||||
}
|
||||
},
|
||||
[`${componentCls}-handle`]: {
|
||||
insetInlineStart: `calc(100% - ${(0, _cssinjs.unit)(calc(handleSizeSM).add(trackPadding).equal())})`
|
||||
}
|
||||
},
|
||||
[`&:not(${componentCls}-disabled):active`]: {
|
||||
[`&:not(${componentCls}-checked) ${switchInnerCls}`]: {
|
||||
[`${switchInnerCls}-unchecked`]: {
|
||||
marginInlineStart: calc(token.marginXXS).div(2).equal(),
|
||||
marginInlineEnd: calc(token.marginXXS).mul(-1).div(2).equal()
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-checked ${switchInnerCls}`]: {
|
||||
[`${switchInnerCls}-checked`]: {
|
||||
marginInlineStart: calc(token.marginXXS).mul(-1).div(2).equal(),
|
||||
marginInlineEnd: calc(token.marginXXS).div(2).equal()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const genSwitchLoadingStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
handleSize,
|
||||
calc
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: {
|
||||
[`${componentCls}-loading-icon${token.iconCls}`]: {
|
||||
position: 'relative',
|
||||
top: calc(calc(handleSize).sub(token.fontSize)).div(2).equal(),
|
||||
color: token.switchLoadingIconColor,
|
||||
verticalAlign: 'top'
|
||||
},
|
||||
[`&${componentCls}-checked ${componentCls}-loading-icon`]: {
|
||||
color: token.switchColor
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const genSwitchHandleStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
trackPadding,
|
||||
handleBg,
|
||||
handleShadow,
|
||||
handleSize,
|
||||
calc
|
||||
} = token;
|
||||
const switchHandleCls = `${componentCls}-handle`;
|
||||
return {
|
||||
[componentCls]: {
|
||||
[switchHandleCls]: {
|
||||
position: 'absolute',
|
||||
top: trackPadding,
|
||||
insetInlineStart: trackPadding,
|
||||
width: handleSize,
|
||||
height: handleSize,
|
||||
transition: `all ${token.switchDuration} ease-in-out`,
|
||||
'&::before': {
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
insetInlineEnd: 0,
|
||||
bottom: 0,
|
||||
insetInlineStart: 0,
|
||||
backgroundColor: handleBg,
|
||||
borderRadius: calc(handleSize).div(2).equal(),
|
||||
boxShadow: handleShadow,
|
||||
transition: `all ${token.switchDuration} ease-in-out`,
|
||||
content: '""'
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-checked ${switchHandleCls}`]: {
|
||||
insetInlineStart: `calc(100% - ${(0, _cssinjs.unit)(calc(handleSize).add(trackPadding).equal())})`
|
||||
},
|
||||
[`&:not(${componentCls}-disabled):active`]: {
|
||||
[`${switchHandleCls}::before`]: {
|
||||
insetInlineEnd: token.switchHandleActiveInset,
|
||||
insetInlineStart: 0
|
||||
},
|
||||
[`&${componentCls}-checked ${switchHandleCls}::before`]: {
|
||||
insetInlineEnd: 0,
|
||||
insetInlineStart: token.switchHandleActiveInset
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const genSwitchInnerStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
trackHeight,
|
||||
trackPadding,
|
||||
innerMinMargin,
|
||||
innerMaxMargin,
|
||||
handleSize,
|
||||
calc
|
||||
} = token;
|
||||
const switchInnerCls = `${componentCls}-inner`;
|
||||
const trackPaddingCalc = (0, _cssinjs.unit)(calc(handleSize).add(calc(trackPadding).mul(2)).equal());
|
||||
const innerMaxMarginCalc = (0, _cssinjs.unit)(calc(innerMaxMargin).mul(2).equal());
|
||||
return {
|
||||
[componentCls]: {
|
||||
[switchInnerCls]: {
|
||||
display: 'block',
|
||||
overflow: 'hidden',
|
||||
borderRadius: 100,
|
||||
height: '100%',
|
||||
paddingInlineStart: innerMaxMargin,
|
||||
paddingInlineEnd: innerMinMargin,
|
||||
transition: `padding-inline-start ${token.switchDuration} ease-in-out, padding-inline-end ${token.switchDuration} ease-in-out`,
|
||||
[`${switchInnerCls}-checked, ${switchInnerCls}-unchecked`]: {
|
||||
display: 'block',
|
||||
color: token.colorTextLightSolid,
|
||||
fontSize: token.fontSizeSM,
|
||||
transition: `margin-inline-start ${token.switchDuration} ease-in-out, margin-inline-end ${token.switchDuration} ease-in-out`,
|
||||
pointerEvents: 'none',
|
||||
minHeight: trackHeight
|
||||
},
|
||||
[`${switchInnerCls}-checked`]: {
|
||||
marginInlineStart: `calc(-100% + ${trackPaddingCalc} - ${innerMaxMarginCalc})`,
|
||||
marginInlineEnd: `calc(100% - ${trackPaddingCalc} + ${innerMaxMarginCalc})`
|
||||
},
|
||||
[`${switchInnerCls}-unchecked`]: {
|
||||
marginTop: calc(trackHeight).mul(-1).equal(),
|
||||
marginInlineStart: 0,
|
||||
marginInlineEnd: 0
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-checked ${switchInnerCls}`]: {
|
||||
paddingInlineStart: innerMinMargin,
|
||||
paddingInlineEnd: innerMaxMargin,
|
||||
[`${switchInnerCls}-checked`]: {
|
||||
marginInlineStart: 0,
|
||||
marginInlineEnd: 0
|
||||
},
|
||||
[`${switchInnerCls}-unchecked`]: {
|
||||
marginInlineStart: `calc(100% - ${trackPaddingCalc} + ${innerMaxMarginCalc})`,
|
||||
marginInlineEnd: `calc(-100% + ${trackPaddingCalc} - ${innerMaxMarginCalc})`
|
||||
}
|
||||
},
|
||||
[`&:not(${componentCls}-disabled):active`]: {
|
||||
[`&:not(${componentCls}-checked) ${switchInnerCls}`]: {
|
||||
[`${switchInnerCls}-unchecked`]: {
|
||||
marginInlineStart: calc(trackPadding).mul(2).equal(),
|
||||
marginInlineEnd: calc(trackPadding).mul(-1).mul(2).equal()
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-checked ${switchInnerCls}`]: {
|
||||
[`${switchInnerCls}-checked`]: {
|
||||
marginInlineStart: calc(trackPadding).mul(-1).mul(2).equal(),
|
||||
marginInlineEnd: calc(trackPadding).mul(2).equal()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const genSwitchStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
trackHeight,
|
||||
trackMinWidth
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, (0, _style.resetComponent)(token)), {
|
||||
position: 'relative',
|
||||
display: 'inline-block',
|
||||
boxSizing: 'border-box',
|
||||
minWidth: trackMinWidth,
|
||||
height: trackHeight,
|
||||
lineHeight: (0, _cssinjs.unit)(trackHeight),
|
||||
verticalAlign: 'middle',
|
||||
background: token.colorTextQuaternary,
|
||||
border: '0',
|
||||
borderRadius: 100,
|
||||
cursor: 'pointer',
|
||||
transition: `all ${token.motionDurationMid}`,
|
||||
userSelect: 'none',
|
||||
[`&:hover:not(${componentCls}-disabled)`]: {
|
||||
background: token.colorTextTertiary
|
||||
}
|
||||
}), (0, _style.genFocusStyle)(token)), {
|
||||
[`&${componentCls}-checked`]: {
|
||||
background: token.switchColor,
|
||||
[`&:hover:not(${componentCls}-disabled)`]: {
|
||||
background: token.colorPrimaryHover
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-loading, &${componentCls}-disabled`]: {
|
||||
cursor: 'not-allowed',
|
||||
opacity: token.switchDisabledOpacity,
|
||||
'*': {
|
||||
boxShadow: 'none',
|
||||
cursor: 'not-allowed'
|
||||
}
|
||||
},
|
||||
// rtl style
|
||||
[`&${componentCls}-rtl`]: {
|
||||
direction: 'rtl'
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
// ============================== Export ==============================
|
||||
const prepareComponentToken = token => {
|
||||
const {
|
||||
fontSize,
|
||||
lineHeight,
|
||||
controlHeight,
|
||||
colorWhite
|
||||
} = token;
|
||||
const height = fontSize * lineHeight;
|
||||
const heightSM = controlHeight / 2;
|
||||
const padding = 2; // Fixed value
|
||||
const handleSize = height - padding * 2;
|
||||
const handleSizeSM = heightSM - padding * 2;
|
||||
return {
|
||||
trackHeight: height,
|
||||
trackHeightSM: heightSM,
|
||||
trackMinWidth: handleSize * 2 + padding * 4,
|
||||
trackMinWidthSM: handleSizeSM * 2 + padding * 2,
|
||||
trackPadding: padding,
|
||||
// Fixed value
|
||||
handleBg: colorWhite,
|
||||
handleSize,
|
||||
handleSizeSM,
|
||||
handleShadow: `0 2px 4px 0 ${new _fastColor.FastColor('#00230b').setA(0.2).toRgbString()}`,
|
||||
innerMinMargin: handleSize / 2,
|
||||
innerMaxMargin: handleSize + padding + padding * 2,
|
||||
innerMinMarginSM: handleSizeSM / 2,
|
||||
innerMaxMarginSM: handleSizeSM + padding + padding * 2
|
||||
};
|
||||
};
|
||||
exports.prepareComponentToken = prepareComponentToken;
|
||||
var _default = exports.default = (0, _internal.genStyleHooks)('Switch', token => {
|
||||
const switchToken = (0, _internal.mergeToken)(token, {
|
||||
switchDuration: token.motionDurationMid,
|
||||
switchColor: token.colorPrimary,
|
||||
switchDisabledOpacity: token.opacityLoading,
|
||||
switchLoadingIconSize: token.calc(token.fontSizeIcon).mul(0.75).equal(),
|
||||
switchLoadingIconColor: `rgba(0, 0, 0, ${token.opacityLoading})`,
|
||||
switchHandleActiveInset: '-30%'
|
||||
});
|
||||
return [genSwitchStyle(switchToken),
|
||||
// inner style
|
||||
genSwitchInnerStyle(switchToken),
|
||||
// handle style
|
||||
genSwitchHandleStyle(switchToken),
|
||||
// loading style
|
||||
genSwitchLoadingStyle(switchToken),
|
||||
// small style
|
||||
genSwitchSmallStyle(switchToken)];
|
||||
}, prepareComponentToken);
|
||||
Reference in New Issue
Block a user