first commit
This commit is contained in:
7
frontend/node_modules/antd/es/space/Addon.d.ts
generated
vendored
Normal file
7
frontend/node_modules/antd/es/space/Addon.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import React from 'react';
|
||||
export interface SpaceCompactCellProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
children: React.ReactNode;
|
||||
prefixCls?: string;
|
||||
}
|
||||
declare const SpaceAddon: React.ForwardRefExoticComponent<SpaceCompactCellProps & React.RefAttributes<HTMLDivElement>>;
|
||||
export default SpaceAddon;
|
||||
43
frontend/node_modules/antd/es/space/Addon.js
generated
vendored
Normal file
43
frontend/node_modules/antd/es/space/Addon.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
"use client";
|
||||
|
||||
var __rest = this && this.__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;
|
||||
};
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import { useCompactItemContext } from './Compact';
|
||||
import useStyle from './style/addon';
|
||||
const SpaceAddon = /*#__PURE__*/React.forwardRef((props, ref) => {
|
||||
const {
|
||||
className,
|
||||
children,
|
||||
style,
|
||||
prefixCls: customizePrefixCls
|
||||
} = props,
|
||||
restProps = __rest(props, ["className", "children", "style", "prefixCls"]);
|
||||
const {
|
||||
getPrefixCls,
|
||||
direction: directionConfig
|
||||
} = React.useContext(ConfigContext);
|
||||
const prefixCls = getPrefixCls('space-addon', customizePrefixCls);
|
||||
const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);
|
||||
const {
|
||||
compactItemClassnames,
|
||||
compactSize
|
||||
} = useCompactItemContext(prefixCls, directionConfig);
|
||||
const classes = classNames(prefixCls, hashId, compactItemClassnames, cssVarCls, {
|
||||
[`${prefixCls}-${compactSize}`]: compactSize
|
||||
}, className);
|
||||
return wrapCSSVar(/*#__PURE__*/React.createElement("div", Object.assign({
|
||||
ref: ref,
|
||||
className: classes,
|
||||
style: style
|
||||
}, restProps), children));
|
||||
});
|
||||
export default SpaceAddon;
|
||||
25
frontend/node_modules/antd/es/space/Compact.d.ts
generated
vendored
Normal file
25
frontend/node_modules/antd/es/space/Compact.d.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import * as React from 'react';
|
||||
import type { DirectionType } from '../config-provider';
|
||||
import type { SizeType } from '../config-provider/SizeContext';
|
||||
export interface SpaceCompactItemContextType {
|
||||
compactSize?: SizeType;
|
||||
compactDirection?: 'horizontal' | 'vertical';
|
||||
isFirstItem?: boolean;
|
||||
isLastItem?: boolean;
|
||||
}
|
||||
export declare const SpaceCompactItemContext: React.Context<SpaceCompactItemContextType | null>;
|
||||
export declare const useCompactItemContext: (prefixCls: string, direction: DirectionType) => {
|
||||
compactSize: SizeType;
|
||||
compactDirection: "horizontal" | "vertical" | undefined;
|
||||
compactItemClassnames: string;
|
||||
};
|
||||
export declare const NoCompactStyle: React.FC<Readonly<React.PropsWithChildren>>;
|
||||
export interface SpaceCompactProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
prefixCls?: string;
|
||||
size?: SizeType;
|
||||
direction?: 'horizontal' | 'vertical';
|
||||
block?: boolean;
|
||||
rootClassName?: string;
|
||||
}
|
||||
declare const Compact: React.FC<SpaceCompactProps>;
|
||||
export default Compact;
|
||||
102
frontend/node_modules/antd/es/space/Compact.js
generated
vendored
Normal file
102
frontend/node_modules/antd/es/space/Compact.js
generated
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
"use client";
|
||||
|
||||
var __rest = this && this.__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;
|
||||
};
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import toArray from "rc-util/es/Children/toArray";
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import useSize from '../config-provider/hooks/useSize';
|
||||
import useStyle from './style/compact';
|
||||
export const SpaceCompactItemContext = /*#__PURE__*/React.createContext(null);
|
||||
export const useCompactItemContext = (prefixCls, direction) => {
|
||||
const compactItemContext = React.useContext(SpaceCompactItemContext);
|
||||
const compactItemClassnames = React.useMemo(() => {
|
||||
if (!compactItemContext) {
|
||||
return '';
|
||||
}
|
||||
const {
|
||||
compactDirection,
|
||||
isFirstItem,
|
||||
isLastItem
|
||||
} = compactItemContext;
|
||||
const separator = compactDirection === 'vertical' ? '-vertical-' : '-';
|
||||
return classNames(`${prefixCls}-compact${separator}item`, {
|
||||
[`${prefixCls}-compact${separator}first-item`]: isFirstItem,
|
||||
[`${prefixCls}-compact${separator}last-item`]: isLastItem,
|
||||
[`${prefixCls}-compact${separator}item-rtl`]: direction === 'rtl'
|
||||
});
|
||||
}, [prefixCls, direction, compactItemContext]);
|
||||
return {
|
||||
compactSize: compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactSize,
|
||||
compactDirection: compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactDirection,
|
||||
compactItemClassnames
|
||||
};
|
||||
};
|
||||
export const NoCompactStyle = props => {
|
||||
const {
|
||||
children
|
||||
} = props;
|
||||
return /*#__PURE__*/React.createElement(SpaceCompactItemContext.Provider, {
|
||||
value: null
|
||||
}, children);
|
||||
};
|
||||
const CompactItem = props => {
|
||||
const {
|
||||
children
|
||||
} = props,
|
||||
others = __rest(props, ["children"]);
|
||||
return /*#__PURE__*/React.createElement(SpaceCompactItemContext.Provider, {
|
||||
value: React.useMemo(() => others, [others])
|
||||
}, children);
|
||||
};
|
||||
const Compact = props => {
|
||||
const {
|
||||
getPrefixCls,
|
||||
direction: directionConfig
|
||||
} = React.useContext(ConfigContext);
|
||||
const {
|
||||
size,
|
||||
direction,
|
||||
block,
|
||||
prefixCls: customizePrefixCls,
|
||||
className,
|
||||
rootClassName,
|
||||
children
|
||||
} = props,
|
||||
restProps = __rest(props, ["size", "direction", "block", "prefixCls", "className", "rootClassName", "children"]);
|
||||
const mergedSize = useSize(ctx => size !== null && size !== void 0 ? size : ctx);
|
||||
const prefixCls = getPrefixCls('space-compact', customizePrefixCls);
|
||||
const [wrapCSSVar, hashId] = useStyle(prefixCls);
|
||||
const clx = classNames(prefixCls, hashId, {
|
||||
[`${prefixCls}-rtl`]: directionConfig === 'rtl',
|
||||
[`${prefixCls}-block`]: block,
|
||||
[`${prefixCls}-vertical`]: direction === 'vertical'
|
||||
}, className, rootClassName);
|
||||
const compactItemContext = React.useContext(SpaceCompactItemContext);
|
||||
const childNodes = toArray(children);
|
||||
const nodes = React.useMemo(() => childNodes.map((child, i) => {
|
||||
const key = (child === null || child === void 0 ? void 0 : child.key) || `${prefixCls}-item-${i}`;
|
||||
return /*#__PURE__*/React.createElement(CompactItem, {
|
||||
key: key,
|
||||
compactSize: mergedSize,
|
||||
compactDirection: direction,
|
||||
isFirstItem: i === 0 && (!compactItemContext || (compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.isFirstItem)),
|
||||
isLastItem: i === childNodes.length - 1 && (!compactItemContext || (compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.isLastItem))
|
||||
}, child);
|
||||
}), [childNodes, compactItemContext, direction, mergedSize, prefixCls]);
|
||||
// =========================== Render ===========================
|
||||
if (childNodes.length === 0) {
|
||||
return null;
|
||||
}
|
||||
return wrapCSSVar(/*#__PURE__*/React.createElement("div", Object.assign({
|
||||
className: clx
|
||||
}, restProps), nodes));
|
||||
};
|
||||
export default Compact;
|
||||
10
frontend/node_modules/antd/es/space/Item.d.ts
generated
vendored
Normal file
10
frontend/node_modules/antd/es/space/Item.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import * as React from 'react';
|
||||
export interface ItemProps {
|
||||
className: string;
|
||||
children: React.ReactNode;
|
||||
index: number;
|
||||
split?: React.ReactNode;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
declare const Item: React.FC<ItemProps>;
|
||||
export default Item;
|
||||
25
frontend/node_modules/antd/es/space/Item.js
generated
vendored
Normal file
25
frontend/node_modules/antd/es/space/Item.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use client";
|
||||
|
||||
import * as React from 'react';
|
||||
import { SpaceContext } from './context';
|
||||
const Item = ({
|
||||
className,
|
||||
index,
|
||||
children,
|
||||
split,
|
||||
style
|
||||
}) => {
|
||||
const {
|
||||
latestIndex
|
||||
} = React.useContext(SpaceContext);
|
||||
if (children === null || children === undefined) {
|
||||
return null;
|
||||
}
|
||||
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
||||
className: className,
|
||||
style: style
|
||||
}, children), index < latestIndex && split && /*#__PURE__*/React.createElement("span", {
|
||||
className: `${className}-split`
|
||||
}, split));
|
||||
};
|
||||
export default Item;
|
||||
6
frontend/node_modules/antd/es/space/context.d.ts
generated
vendored
Normal file
6
frontend/node_modules/antd/es/space/context.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import React from 'react';
|
||||
export interface SpaceContextType {
|
||||
latestIndex: number;
|
||||
}
|
||||
export declare const SpaceContext: React.Context<SpaceContextType>;
|
||||
export declare const SpaceContextProvider: React.Provider<SpaceContextType>;
|
||||
5
frontend/node_modules/antd/es/space/context.js
generated
vendored
Normal file
5
frontend/node_modules/antd/es/space/context.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import React from 'react';
|
||||
export const SpaceContext = /*#__PURE__*/React.createContext({
|
||||
latestIndex: 0
|
||||
});
|
||||
export const SpaceContextProvider = SpaceContext.Provider;
|
||||
30
frontend/node_modules/antd/es/space/index.d.ts
generated
vendored
Normal file
30
frontend/node_modules/antd/es/space/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import * as React from 'react';
|
||||
import type { SizeType } from '../config-provider/SizeContext';
|
||||
import Compact from './Compact';
|
||||
import Addon from './Addon';
|
||||
export { SpaceContext } from './context';
|
||||
export type SpaceSize = SizeType | number;
|
||||
export interface SpaceProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
rootClassName?: string;
|
||||
style?: React.CSSProperties;
|
||||
size?: SpaceSize | [SpaceSize, SpaceSize];
|
||||
direction?: 'horizontal' | 'vertical';
|
||||
align?: 'start' | 'end' | 'center' | 'baseline';
|
||||
split?: React.ReactNode;
|
||||
wrap?: boolean;
|
||||
classNames?: {
|
||||
item: string;
|
||||
};
|
||||
styles?: {
|
||||
item: React.CSSProperties;
|
||||
};
|
||||
}
|
||||
declare const InternalSpace: React.ForwardRefExoticComponent<SpaceProps & React.RefAttributes<HTMLDivElement>>;
|
||||
type CompoundedComponent = typeof InternalSpace & {
|
||||
Compact: typeof Compact;
|
||||
Addon: typeof Addon;
|
||||
};
|
||||
declare const Space: CompoundedComponent;
|
||||
export default Space;
|
||||
112
frontend/node_modules/antd/es/space/index.js
generated
vendored
Normal file
112
frontend/node_modules/antd/es/space/index.js
generated
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
"use client";
|
||||
|
||||
var __rest = this && this.__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;
|
||||
};
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import toArray from "rc-util/es/Children/toArray";
|
||||
import { isPresetSize, isValidGapNumber } from '../_util/gapSize';
|
||||
import { useComponentConfig } from '../config-provider/context';
|
||||
import Compact from './Compact';
|
||||
import Addon from './Addon';
|
||||
import { SpaceContextProvider } from './context';
|
||||
import Item from './Item';
|
||||
import useStyle from './style';
|
||||
export { SpaceContext } from './context';
|
||||
const InternalSpace = /*#__PURE__*/React.forwardRef((props, ref) => {
|
||||
var _a;
|
||||
const {
|
||||
getPrefixCls,
|
||||
direction: directionConfig,
|
||||
size: contextSize,
|
||||
className: contextClassName,
|
||||
style: contextStyle,
|
||||
classNames: contextClassNames,
|
||||
styles: contextStyles
|
||||
} = useComponentConfig('space');
|
||||
const {
|
||||
size = contextSize !== null && contextSize !== void 0 ? contextSize : 'small',
|
||||
align,
|
||||
className,
|
||||
rootClassName,
|
||||
children,
|
||||
direction = 'horizontal',
|
||||
prefixCls: customizePrefixCls,
|
||||
split,
|
||||
style,
|
||||
wrap = false,
|
||||
classNames: customClassNames,
|
||||
styles
|
||||
} = props,
|
||||
otherProps = __rest(props, ["size", "align", "className", "rootClassName", "children", "direction", "prefixCls", "split", "style", "wrap", "classNames", "styles"]);
|
||||
const [horizontalSize, verticalSize] = Array.isArray(size) ? size : [size, size];
|
||||
const isPresetVerticalSize = isPresetSize(verticalSize);
|
||||
const isPresetHorizontalSize = isPresetSize(horizontalSize);
|
||||
const isValidVerticalSize = isValidGapNumber(verticalSize);
|
||||
const isValidHorizontalSize = isValidGapNumber(horizontalSize);
|
||||
const childNodes = toArray(children, {
|
||||
keepEmpty: true
|
||||
});
|
||||
const mergedAlign = align === undefined && direction === 'horizontal' ? 'center' : align;
|
||||
const prefixCls = getPrefixCls('space', customizePrefixCls);
|
||||
const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);
|
||||
const cls = classNames(prefixCls, contextClassName, hashId, `${prefixCls}-${direction}`, {
|
||||
[`${prefixCls}-rtl`]: directionConfig === 'rtl',
|
||||
[`${prefixCls}-align-${mergedAlign}`]: mergedAlign,
|
||||
[`${prefixCls}-gap-row-${verticalSize}`]: isPresetVerticalSize,
|
||||
[`${prefixCls}-gap-col-${horizontalSize}`]: isPresetHorizontalSize
|
||||
}, className, rootClassName, cssVarCls);
|
||||
const itemClassName = classNames(`${prefixCls}-item`, (_a = customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames.item) !== null && _a !== void 0 ? _a : contextClassNames.item);
|
||||
const mergedItemStyle = Object.assign(Object.assign({}, contextStyles.item), styles === null || styles === void 0 ? void 0 : styles.item);
|
||||
// Calculate latest one
|
||||
const renderedItems = childNodes.map((child, i) => {
|
||||
const key = (child === null || child === void 0 ? void 0 : child.key) || `${itemClassName}-${i}`;
|
||||
return /*#__PURE__*/React.createElement(Item, {
|
||||
className: itemClassName,
|
||||
key: key,
|
||||
index: i,
|
||||
split: split,
|
||||
style: mergedItemStyle
|
||||
}, child);
|
||||
});
|
||||
const memoizedSpaceContext = React.useMemo(() => {
|
||||
const calcLatestIndex = childNodes.reduce((latest, child, i) => child !== null && child !== undefined ? i : latest, 0);
|
||||
return {
|
||||
latestIndex: calcLatestIndex
|
||||
};
|
||||
}, [childNodes]);
|
||||
// =========================== Render ===========================
|
||||
if (childNodes.length === 0) {
|
||||
return null;
|
||||
}
|
||||
const gapStyle = {};
|
||||
if (wrap) {
|
||||
gapStyle.flexWrap = 'wrap';
|
||||
}
|
||||
if (!isPresetHorizontalSize && isValidHorizontalSize) {
|
||||
gapStyle.columnGap = horizontalSize;
|
||||
}
|
||||
if (!isPresetVerticalSize && isValidVerticalSize) {
|
||||
gapStyle.rowGap = verticalSize;
|
||||
}
|
||||
return wrapCSSVar(/*#__PURE__*/React.createElement("div", Object.assign({
|
||||
ref: ref,
|
||||
className: cls,
|
||||
style: Object.assign(Object.assign(Object.assign({}, gapStyle), contextStyle), style)
|
||||
}, otherProps), /*#__PURE__*/React.createElement(SpaceContextProvider, {
|
||||
value: memoizedSpaceContext
|
||||
}, renderedItems)));
|
||||
});
|
||||
const Space = InternalSpace;
|
||||
Space.Compact = Compact;
|
||||
Space.Addon = Addon;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Space.displayName = 'Space';
|
||||
}
|
||||
export default Space;
|
||||
5
frontend/node_modules/antd/es/space/style/addon.d.ts
generated
vendored
Normal file
5
frontend/node_modules/antd/es/space/style/addon.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/** Component only token. Which will handle additional calculation of alias token */
|
||||
export interface ComponentToken {
|
||||
}
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
58
frontend/node_modules/antd/es/space/style/addon.js
generated
vendored
Normal file
58
frontend/node_modules/antd/es/space/style/addon.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
import { genCompactItemStyle } from '../../style/compact-item';
|
||||
import { genStyleHooks } from '../../theme/internal';
|
||||
const genSpaceAddonStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
borderRadius,
|
||||
paddingSM,
|
||||
colorBorder,
|
||||
paddingXS,
|
||||
fontSizeLG,
|
||||
fontSizeSM,
|
||||
borderRadiusLG,
|
||||
borderRadiusSM,
|
||||
colorBgContainerDisabled,
|
||||
lineWidth
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: [{
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
gap: 0,
|
||||
paddingInline: paddingSM,
|
||||
margin: 0,
|
||||
background: colorBgContainerDisabled,
|
||||
borderWidth: lineWidth,
|
||||
borderStyle: 'solid',
|
||||
borderColor: colorBorder,
|
||||
borderRadius,
|
||||
'&-large': {
|
||||
fontSize: fontSizeLG,
|
||||
borderRadius: borderRadiusLG
|
||||
},
|
||||
'&-small': {
|
||||
paddingInline: paddingXS,
|
||||
borderRadius: borderRadiusSM,
|
||||
fontSize: fontSizeSM
|
||||
},
|
||||
'&-compact-last-item': {
|
||||
borderEndStartRadius: 0,
|
||||
borderStartStartRadius: 0
|
||||
},
|
||||
'&-compact-first-item': {
|
||||
borderEndEndRadius: 0,
|
||||
borderStartEndRadius: 0
|
||||
},
|
||||
'&-compact-item:not(:first-child):not(:last-child)': {
|
||||
borderRadius: 0
|
||||
},
|
||||
'&-compact-item:not(:last-child)': {
|
||||
borderInlineEndWidth: 0
|
||||
}
|
||||
}, genCompactItemStyle(token, {
|
||||
focus: false
|
||||
})]
|
||||
};
|
||||
};
|
||||
// ============================== Export ==============================
|
||||
export default genStyleHooks(['Space', 'Addon'], token => [genSpaceAddonStyle(token)]);
|
||||
5
frontend/node_modules/antd/es/space/style/compact.d.ts
generated
vendored
Normal file
5
frontend/node_modules/antd/es/space/style/compact.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/** Component only token. Which will handle additional calculation of alias token */
|
||||
export interface ComponentToken {
|
||||
}
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
27
frontend/node_modules/antd/es/space/style/compact.js
generated
vendored
Normal file
27
frontend/node_modules/antd/es/space/style/compact.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import { genStyleHooks } from '../../theme/internal';
|
||||
const genSpaceCompactStyle = token => {
|
||||
const {
|
||||
componentCls
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: {
|
||||
display: 'inline-flex',
|
||||
'&-block': {
|
||||
display: 'flex',
|
||||
width: '100%'
|
||||
},
|
||||
'&-vertical': {
|
||||
flexDirection: 'column'
|
||||
},
|
||||
'&-rtl': {
|
||||
direction: 'rtl'
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
// ============================== Export ==============================
|
||||
export default genStyleHooks(['Space', 'Compact'], token => [genSpaceCompactStyle(token)], () => ({}), {
|
||||
// Space component don't apply extra font style
|
||||
// https://github.com/ant-design/ant-design/issues/40315
|
||||
resetStyle: false
|
||||
});
|
||||
7
frontend/node_modules/antd/es/space/style/index.d.ts
generated
vendored
Normal file
7
frontend/node_modules/antd/es/space/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { GetDefaultToken } from '../../theme/internal';
|
||||
/** Component only token. Which will handle additional calculation of alias token */
|
||||
export interface ComponentToken {
|
||||
}
|
||||
export declare const prepareComponentToken: GetDefaultToken<'Space'>;
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
81
frontend/node_modules/antd/es/space/style/index.js
generated
vendored
Normal file
81
frontend/node_modules/antd/es/space/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
import { genStyleHooks, mergeToken } from '../../theme/internal';
|
||||
const genSpaceStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
antCls
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: {
|
||||
display: 'inline-flex',
|
||||
'&-rtl': {
|
||||
direction: 'rtl'
|
||||
},
|
||||
'&-vertical': {
|
||||
flexDirection: 'column'
|
||||
},
|
||||
'&-align': {
|
||||
flexDirection: 'column',
|
||||
'&-center': {
|
||||
alignItems: 'center'
|
||||
},
|
||||
'&-start': {
|
||||
alignItems: 'flex-start'
|
||||
},
|
||||
'&-end': {
|
||||
alignItems: 'flex-end'
|
||||
},
|
||||
'&-baseline': {
|
||||
alignItems: 'baseline'
|
||||
}
|
||||
},
|
||||
[`${componentCls}-item:empty`]: {
|
||||
display: 'none'
|
||||
},
|
||||
// https://github.com/ant-design/ant-design/issues/47875
|
||||
[`${componentCls}-item > ${antCls}-badge-not-a-wrapper:only-child`]: {
|
||||
display: 'block'
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const genSpaceGapStyle = token => {
|
||||
const {
|
||||
componentCls
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: {
|
||||
'&-gap-row-small': {
|
||||
rowGap: token.spaceGapSmallSize
|
||||
},
|
||||
'&-gap-row-middle': {
|
||||
rowGap: token.spaceGapMiddleSize
|
||||
},
|
||||
'&-gap-row-large': {
|
||||
rowGap: token.spaceGapLargeSize
|
||||
},
|
||||
'&-gap-col-small': {
|
||||
columnGap: token.spaceGapSmallSize
|
||||
},
|
||||
'&-gap-col-middle': {
|
||||
columnGap: token.spaceGapMiddleSize
|
||||
},
|
||||
'&-gap-col-large': {
|
||||
columnGap: token.spaceGapLargeSize
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
// ============================== Export ==============================
|
||||
export const prepareComponentToken = () => ({});
|
||||
export default genStyleHooks('Space', token => {
|
||||
const spaceToken = mergeToken(token, {
|
||||
spaceGapSmallSize: token.paddingXS,
|
||||
spaceGapMiddleSize: token.padding,
|
||||
spaceGapLargeSize: token.paddingLG
|
||||
});
|
||||
return [genSpaceStyle(spaceToken), genSpaceGapStyle(spaceToken)];
|
||||
}, () => ({}), {
|
||||
// Space component don't apply extra font style
|
||||
// https://github.com/ant-design/ant-design/issues/40315
|
||||
resetStyle: false
|
||||
});
|
||||
Reference in New Issue
Block a user