first commit
This commit is contained in:
27
frontend/node_modules/antd/lib/rate/style/index.d.ts
generated
vendored
Normal file
27
frontend/node_modules/antd/lib/rate/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import type { CSSObject } from '@ant-design/cssinjs';
|
||||
import type { GetDefaultToken } from '../../theme/internal';
|
||||
export interface ComponentToken {
|
||||
/**
|
||||
* @desc 星星颜色
|
||||
* @descEN Star color
|
||||
*/
|
||||
starColor: string;
|
||||
/**
|
||||
* @desc 星星大小
|
||||
* @descEN Star size
|
||||
*/
|
||||
starSize: number;
|
||||
/**
|
||||
* @desc 星星悬浮时的缩放
|
||||
* @descEN Scale of star when hover
|
||||
*/
|
||||
starHoverScale: CSSObject['transform'];
|
||||
/**
|
||||
* @desc 星星背景色
|
||||
* @descEN Star background color
|
||||
*/
|
||||
starBg: string;
|
||||
}
|
||||
export declare const prepareComponentToken: GetDefaultToken<'Rate'>;
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
99
frontend/node_modules/antd/lib/rate/style/index.js
generated
vendored
Normal file
99
frontend/node_modules/antd/lib/rate/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.prepareComponentToken = exports.default = void 0;
|
||||
var _cssinjs = require("@ant-design/cssinjs");
|
||||
var _style = require("../../style");
|
||||
var _internal = require("../../theme/internal");
|
||||
const genRateStarStyle = token => {
|
||||
const {
|
||||
componentCls
|
||||
} = token;
|
||||
return {
|
||||
[`${componentCls}-star`]: {
|
||||
position: 'relative',
|
||||
display: 'inline-block',
|
||||
color: 'inherit',
|
||||
cursor: 'pointer',
|
||||
'&:not(:last-child)': {
|
||||
marginInlineEnd: token.marginXS
|
||||
},
|
||||
'> div': {
|
||||
transition: `all ${token.motionDurationMid}, outline 0s`,
|
||||
'&:hover': {
|
||||
transform: token.starHoverScale
|
||||
},
|
||||
'&:focus': {
|
||||
outline: 0
|
||||
},
|
||||
'&:focus-visible': {
|
||||
outline: `${(0, _cssinjs.unit)(token.lineWidth)} dashed ${token.starColor}`,
|
||||
transform: token.starHoverScale
|
||||
}
|
||||
},
|
||||
'&-first, &-second': {
|
||||
color: token.starBg,
|
||||
transition: `all ${token.motionDurationMid}`,
|
||||
userSelect: 'none'
|
||||
},
|
||||
'&-first': {
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
insetInlineStart: 0,
|
||||
width: '50%',
|
||||
height: '100%',
|
||||
overflow: 'hidden',
|
||||
opacity: 0
|
||||
},
|
||||
[`&-half ${componentCls}-star-first, &-half ${componentCls}-star-second`]: {
|
||||
opacity: 1
|
||||
},
|
||||
[`&-half ${componentCls}-star-first, &-full ${componentCls}-star-second`]: {
|
||||
color: 'inherit'
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const genRateRtlStyle = token => ({
|
||||
[`&-rtl${token.componentCls}`]: {
|
||||
direction: 'rtl'
|
||||
}
|
||||
});
|
||||
const genRateStyle = token => {
|
||||
const {
|
||||
componentCls
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, (0, _style.resetComponent)(token)), {
|
||||
display: 'inline-block',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
color: token.starColor,
|
||||
fontSize: token.starSize,
|
||||
lineHeight: 1,
|
||||
listStyle: 'none',
|
||||
outline: 'none',
|
||||
// disable styles
|
||||
[`&-disabled${componentCls} ${componentCls}-star`]: {
|
||||
cursor: 'default',
|
||||
'> div:hover': {
|
||||
transform: 'scale(1)'
|
||||
}
|
||||
}
|
||||
}), genRateStarStyle(token)), genRateRtlStyle(token))
|
||||
};
|
||||
};
|
||||
// ============================== Export ==============================
|
||||
const prepareComponentToken = token => ({
|
||||
starColor: token.yellow6,
|
||||
starSize: token.controlHeightLG * 0.5,
|
||||
starHoverScale: 'scale(1.1)',
|
||||
starBg: token.colorFillContent
|
||||
});
|
||||
exports.prepareComponentToken = prepareComponentToken;
|
||||
var _default = exports.default = (0, _internal.genStyleHooks)('Rate', token => {
|
||||
const rateToken = (0, _internal.mergeToken)(token, {});
|
||||
return genRateStyle(rateToken);
|
||||
}, prepareComponentToken);
|
||||
Reference in New Issue
Block a user