first commit
This commit is contained in:
18
frontend/node_modules/antd/lib/typography/style/index.d.ts
generated
vendored
Normal file
18
frontend/node_modules/antd/lib/typography/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { FullToken, GetDefaultToken } from '../../theme/internal';
|
||||
/** Component only token. Which will handle additional calculation of alias token */
|
||||
export interface ComponentToken {
|
||||
/**
|
||||
* @desc 标题上间距
|
||||
* @descEN Margin top of title
|
||||
*/
|
||||
titleMarginTop: number | string;
|
||||
/**
|
||||
* @desc 标题下间距
|
||||
* @descEN Margin bottom of title
|
||||
*/
|
||||
titleMarginBottom: number | string;
|
||||
}
|
||||
export type TypographyToken = FullToken<'Typography'>;
|
||||
export declare const prepareComponentToken: GetDefaultToken<'Typography'>;
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
102
frontend/node_modules/antd/lib/typography/style/index.js
generated
vendored
Normal file
102
frontend/node_modules/antd/lib/typography/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.prepareComponentToken = exports.default = void 0;
|
||||
var _style = require("../../style");
|
||||
var _internal = require("../../theme/internal");
|
||||
var _mixins = require("./mixins");
|
||||
const genTypographyStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
titleMarginTop
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
|
||||
color: token.colorText,
|
||||
wordBreak: 'break-word',
|
||||
lineHeight: token.lineHeight,
|
||||
[`&${componentCls}-secondary`]: {
|
||||
color: token.colorTextDescription
|
||||
},
|
||||
[`&${componentCls}-success`]: {
|
||||
color: token.colorSuccessText
|
||||
},
|
||||
[`&${componentCls}-warning`]: {
|
||||
color: token.colorWarningText
|
||||
},
|
||||
[`&${componentCls}-danger`]: {
|
||||
color: token.colorErrorText,
|
||||
'a&:active, a&:focus': {
|
||||
color: token.colorErrorTextActive
|
||||
},
|
||||
'a&:hover': {
|
||||
color: token.colorErrorTextHover
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-disabled`]: {
|
||||
color: token.colorTextDisabled,
|
||||
cursor: 'not-allowed',
|
||||
userSelect: 'none'
|
||||
},
|
||||
[`
|
||||
div&,
|
||||
p
|
||||
`]: {
|
||||
marginBottom: '1em'
|
||||
}
|
||||
}, (0, _mixins.getTitleStyles)(token)), {
|
||||
[`
|
||||
& + h1${componentCls},
|
||||
& + h2${componentCls},
|
||||
& + h3${componentCls},
|
||||
& + h4${componentCls},
|
||||
& + h5${componentCls}
|
||||
`]: {
|
||||
marginTop: titleMarginTop
|
||||
},
|
||||
[`
|
||||
div,
|
||||
ul,
|
||||
li,
|
||||
p,
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5`]: {
|
||||
[`
|
||||
+ h1,
|
||||
+ h2,
|
||||
+ h3,
|
||||
+ h4,
|
||||
+ h5
|
||||
`]: {
|
||||
marginTop: titleMarginTop
|
||||
}
|
||||
}
|
||||
}), (0, _mixins.getResetStyles)(token)), (0, _mixins.getLinkStyles)(token)), {
|
||||
// Operation
|
||||
[`
|
||||
${componentCls}-expand,
|
||||
${componentCls}-collapse,
|
||||
${componentCls}-edit,
|
||||
${componentCls}-copy
|
||||
`]: Object.assign(Object.assign({}, (0, _style.operationUnit)(token)), {
|
||||
marginInlineStart: token.marginXXS
|
||||
})
|
||||
}), (0, _mixins.getEditableStyles)(token)), (0, _mixins.getCopyableStyles)(token)), (0, _mixins.getEllipsisStyles)()), {
|
||||
'&-rtl': {
|
||||
direction: 'rtl'
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
const prepareComponentToken = () => ({
|
||||
titleMarginTop: '1.2em',
|
||||
titleMarginBottom: '0.5em'
|
||||
});
|
||||
// ============================== Export ==============================
|
||||
exports.prepareComponentToken = prepareComponentToken;
|
||||
var _default = exports.default = (0, _internal.genStyleHooks)('Typography', genTypographyStyle, prepareComponentToken);
|
||||
9
frontend/node_modules/antd/lib/typography/style/mixins.d.ts
generated
vendored
Normal file
9
frontend/node_modules/antd/lib/typography/style/mixins.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { CSSObject } from '@ant-design/cssinjs';
|
||||
import type { TypographyToken } from '.';
|
||||
import type { GenerateStyle } from '../../theme/internal';
|
||||
export declare const getTitleStyles: GenerateStyle<TypographyToken, CSSObject>;
|
||||
export declare const getLinkStyles: GenerateStyle<TypographyToken, CSSObject>;
|
||||
export declare const getResetStyles: GenerateStyle<TypographyToken, CSSObject>;
|
||||
export declare const getEditableStyles: GenerateStyle<TypographyToken, CSSObject>;
|
||||
export declare const getCopyableStyles: GenerateStyle<TypographyToken, CSSObject>;
|
||||
export declare const getEllipsisStyles: () => CSSObject;
|
||||
239
frontend/node_modules/antd/lib/typography/style/mixins.js
generated
vendored
Normal file
239
frontend/node_modules/antd/lib/typography/style/mixins.js
generated
vendored
Normal file
@@ -0,0 +1,239 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getTitleStyles = exports.getResetStyles = exports.getLinkStyles = exports.getEllipsisStyles = exports.getEditableStyles = exports.getCopyableStyles = void 0;
|
||||
var _colors = require("@ant-design/colors");
|
||||
var _style = require("../../style");
|
||||
/*
|
||||
.typography-title(@fontSize; @fontWeight; @lineHeight; @headingColor; @headingMarginBottom;) {
|
||||
margin-bottom: @headingMarginBottom;
|
||||
color: @headingColor;
|
||||
font-weight: @fontWeight;
|
||||
fontSize: @fontSize;
|
||||
line-height: @lineHeight;
|
||||
}
|
||||
*/
|
||||
|
||||
const getTitleStyle = (fontSize, lineHeight, color, token) => {
|
||||
const {
|
||||
titleMarginBottom,
|
||||
fontWeightStrong
|
||||
} = token;
|
||||
return {
|
||||
marginBottom: titleMarginBottom,
|
||||
color,
|
||||
fontWeight: fontWeightStrong,
|
||||
fontSize,
|
||||
lineHeight
|
||||
};
|
||||
};
|
||||
const getTitleStyles = token => {
|
||||
const headings = [1, 2, 3, 4, 5];
|
||||
const styles = {};
|
||||
headings.forEach(headingLevel => {
|
||||
styles[`
|
||||
h${headingLevel}&,
|
||||
div&-h${headingLevel},
|
||||
div&-h${headingLevel} > textarea,
|
||||
h${headingLevel}
|
||||
`] = getTitleStyle(token[`fontSizeHeading${headingLevel}`], token[`lineHeightHeading${headingLevel}`], token.colorTextHeading, token);
|
||||
});
|
||||
return styles;
|
||||
};
|
||||
exports.getTitleStyles = getTitleStyles;
|
||||
const getLinkStyles = token => {
|
||||
const {
|
||||
componentCls
|
||||
} = token;
|
||||
return {
|
||||
'a&, a': Object.assign(Object.assign({}, (0, _style.operationUnit)(token)), {
|
||||
userSelect: 'text',
|
||||
[`&[disabled], &${componentCls}-disabled`]: {
|
||||
color: token.colorTextDisabled,
|
||||
cursor: 'not-allowed',
|
||||
'&:active, &:hover': {
|
||||
color: token.colorTextDisabled
|
||||
},
|
||||
'&:active': {
|
||||
pointerEvents: 'none'
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
exports.getLinkStyles = getLinkStyles;
|
||||
const getResetStyles = token => ({
|
||||
code: {
|
||||
margin: '0 0.2em',
|
||||
paddingInline: '0.4em',
|
||||
paddingBlock: '0.2em 0.1em',
|
||||
fontSize: '85%',
|
||||
fontFamily: token.fontFamilyCode,
|
||||
background: 'rgba(150, 150, 150, 0.1)',
|
||||
border: '1px solid rgba(100, 100, 100, 0.2)',
|
||||
borderRadius: 3
|
||||
},
|
||||
kbd: {
|
||||
margin: '0 0.2em',
|
||||
paddingInline: '0.4em',
|
||||
paddingBlock: '0.15em 0.1em',
|
||||
fontSize: '90%',
|
||||
fontFamily: token.fontFamilyCode,
|
||||
background: 'rgba(150, 150, 150, 0.06)',
|
||||
border: '1px solid rgba(100, 100, 100, 0.2)',
|
||||
borderBottomWidth: 2,
|
||||
borderRadius: 3
|
||||
},
|
||||
mark: {
|
||||
padding: 0,
|
||||
// FIXME hardcode in v4
|
||||
backgroundColor: _colors.gold[2]
|
||||
},
|
||||
'u, ins': {
|
||||
textDecoration: 'underline',
|
||||
textDecorationSkipInk: 'auto'
|
||||
},
|
||||
's, del': {
|
||||
textDecoration: 'line-through'
|
||||
},
|
||||
strong: {
|
||||
fontWeight: token.fontWeightStrong
|
||||
},
|
||||
// list
|
||||
'ul, ol': {
|
||||
marginInline: 0,
|
||||
marginBlock: '0 1em',
|
||||
padding: 0,
|
||||
li: {
|
||||
marginInline: '20px 0',
|
||||
marginBlock: 0,
|
||||
paddingInline: '4px 0',
|
||||
paddingBlock: 0
|
||||
}
|
||||
},
|
||||
ul: {
|
||||
listStyleType: 'circle',
|
||||
ul: {
|
||||
listStyleType: 'disc'
|
||||
}
|
||||
},
|
||||
ol: {
|
||||
listStyleType: 'decimal'
|
||||
},
|
||||
// pre & block
|
||||
'pre, blockquote': {
|
||||
margin: '1em 0'
|
||||
},
|
||||
pre: {
|
||||
padding: '0.4em 0.6em',
|
||||
whiteSpace: 'pre-wrap',
|
||||
wordWrap: 'break-word',
|
||||
background: 'rgba(150, 150, 150, 0.1)',
|
||||
border: '1px solid rgba(100, 100, 100, 0.2)',
|
||||
borderRadius: 3,
|
||||
fontFamily: token.fontFamilyCode,
|
||||
// Compatible for marked
|
||||
code: {
|
||||
display: 'inline',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
fontSize: 'inherit',
|
||||
fontFamily: 'inherit',
|
||||
background: 'transparent',
|
||||
border: 0
|
||||
}
|
||||
},
|
||||
blockquote: {
|
||||
paddingInline: '0.6em 0',
|
||||
paddingBlock: 0,
|
||||
borderInlineStart: '4px solid rgba(100, 100, 100, 0.2)',
|
||||
opacity: 0.85
|
||||
}
|
||||
});
|
||||
exports.getResetStyles = getResetStyles;
|
||||
const getEditableStyles = token => {
|
||||
const {
|
||||
componentCls,
|
||||
paddingSM
|
||||
} = token;
|
||||
const inputShift = paddingSM;
|
||||
return {
|
||||
'&-edit-content': {
|
||||
position: 'relative',
|
||||
'div&': {
|
||||
insetInlineStart: token.calc(token.paddingSM).mul(-1).equal(),
|
||||
insetBlockStart: token.calc(inputShift).div(-2).add(1).equal(),
|
||||
marginBottom: token.calc(inputShift).div(2).sub(2).equal()
|
||||
},
|
||||
[`${componentCls}-edit-content-confirm`]: {
|
||||
position: 'absolute',
|
||||
insetInlineEnd: token.calc(token.marginXS).add(2).equal(),
|
||||
insetBlockEnd: token.marginXS,
|
||||
color: token.colorIcon,
|
||||
// default style
|
||||
fontWeight: 'normal',
|
||||
fontSize: token.fontSize,
|
||||
fontStyle: 'normal',
|
||||
pointerEvents: 'none'
|
||||
},
|
||||
textarea: {
|
||||
margin: '0!important',
|
||||
// Fix Editable Textarea flash in Firefox
|
||||
MozTransition: 'none',
|
||||
height: '1em'
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
exports.getEditableStyles = getEditableStyles;
|
||||
const getCopyableStyles = token => ({
|
||||
[`${token.componentCls}-copy-success`]: {
|
||||
[`
|
||||
&,
|
||||
&:hover,
|
||||
&:focus`]: {
|
||||
color: token.colorSuccess
|
||||
}
|
||||
},
|
||||
[`${token.componentCls}-copy-icon-only`]: {
|
||||
marginInlineStart: 0
|
||||
}
|
||||
});
|
||||
exports.getCopyableStyles = getCopyableStyles;
|
||||
const getEllipsisStyles = () => ({
|
||||
[`
|
||||
a&-ellipsis,
|
||||
span&-ellipsis
|
||||
`]: {
|
||||
display: 'inline-block',
|
||||
maxWidth: '100%'
|
||||
},
|
||||
'&-ellipsis-single-line': {
|
||||
whiteSpace: 'nowrap',
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
// https://blog.csdn.net/iefreer/article/details/50421025
|
||||
'a&, span&': {
|
||||
verticalAlign: 'bottom'
|
||||
},
|
||||
'> code': {
|
||||
paddingBlock: 0,
|
||||
maxWidth: 'calc(100% - 1.2em)',
|
||||
display: 'inline-block',
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
verticalAlign: 'bottom',
|
||||
// https://github.com/ant-design/ant-design/issues/45953
|
||||
boxSizing: 'content-box'
|
||||
}
|
||||
},
|
||||
'&-ellipsis-multiple-line': {
|
||||
display: '-webkit-box',
|
||||
overflow: 'hidden',
|
||||
WebkitLineClamp: 3,
|
||||
WebkitBoxOrient: 'vertical'
|
||||
}
|
||||
});
|
||||
exports.getEllipsisStyles = getEllipsisStyles;
|
||||
Reference in New Issue
Block a user