first commit
This commit is contained in:
22
frontend/node_modules/antd/lib/descriptions/Cell.d.ts
generated
vendored
Normal file
22
frontend/node_modules/antd/lib/descriptions/Cell.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import * as React from 'react';
|
||||
import type { SemanticName } from './DescriptionsContext';
|
||||
export interface CellProps {
|
||||
itemPrefixCls: string;
|
||||
span: number;
|
||||
className?: string;
|
||||
component: string;
|
||||
style?: React.CSSProperties;
|
||||
/** @deprecated Please use `styles={{ label: {} }}` instead */
|
||||
labelStyle?: React.CSSProperties;
|
||||
/** @deprecated Please use `styles={{ content: {} }}` instead */
|
||||
contentStyle?: React.CSSProperties;
|
||||
styles?: Partial<Record<SemanticName, React.CSSProperties>>;
|
||||
classNames?: Partial<Record<SemanticName, string>>;
|
||||
bordered?: boolean;
|
||||
label?: React.ReactNode;
|
||||
content?: React.ReactNode;
|
||||
colon?: boolean;
|
||||
type?: 'label' | 'content' | 'item';
|
||||
}
|
||||
declare const Cell: React.FC<CellProps>;
|
||||
export default Cell;
|
||||
69
frontend/node_modules/antd/lib/descriptions/Cell.js
generated
vendored
Normal file
69
frontend/node_modules/antd/lib/descriptions/Cell.js
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
"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 _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _DescriptionsContext = _interopRequireDefault(require("./DescriptionsContext"));
|
||||
const isNonNullable = val => {
|
||||
return val !== undefined && val !== null;
|
||||
};
|
||||
const Cell = props => {
|
||||
const {
|
||||
itemPrefixCls,
|
||||
component,
|
||||
span,
|
||||
className,
|
||||
style,
|
||||
labelStyle,
|
||||
contentStyle,
|
||||
bordered,
|
||||
label,
|
||||
content,
|
||||
colon,
|
||||
type,
|
||||
styles
|
||||
} = props;
|
||||
const Component = component;
|
||||
const {
|
||||
classNames: ctxClassNames
|
||||
} = React.useContext(_DescriptionsContext.default);
|
||||
const mergedLabelStyle = Object.assign(Object.assign({}, labelStyle), styles === null || styles === void 0 ? void 0 : styles.label);
|
||||
const mergedContentStyle = Object.assign(Object.assign({}, contentStyle), styles === null || styles === void 0 ? void 0 : styles.content);
|
||||
if (bordered) {
|
||||
return /*#__PURE__*/React.createElement(Component, {
|
||||
colSpan: span,
|
||||
style: style,
|
||||
className: (0, _classnames.default)(className, {
|
||||
[`${itemPrefixCls}-item-${type}`]: type === 'label' || type === 'content',
|
||||
[ctxClassNames === null || ctxClassNames === void 0 ? void 0 : ctxClassNames.label]: (ctxClassNames === null || ctxClassNames === void 0 ? void 0 : ctxClassNames.label) && type === 'label',
|
||||
[ctxClassNames === null || ctxClassNames === void 0 ? void 0 : ctxClassNames.content]: (ctxClassNames === null || ctxClassNames === void 0 ? void 0 : ctxClassNames.content) && type === 'content'
|
||||
})
|
||||
}, isNonNullable(label) && /*#__PURE__*/React.createElement("span", {
|
||||
style: mergedLabelStyle
|
||||
}, label), isNonNullable(content) && /*#__PURE__*/React.createElement("span", {
|
||||
style: mergedContentStyle
|
||||
}, content));
|
||||
}
|
||||
return /*#__PURE__*/React.createElement(Component, {
|
||||
colSpan: span,
|
||||
style: style,
|
||||
className: (0, _classnames.default)(`${itemPrefixCls}-item`, className)
|
||||
}, /*#__PURE__*/React.createElement("div", {
|
||||
className: `${itemPrefixCls}-item-container`
|
||||
}, isNonNullable(label) && (/*#__PURE__*/React.createElement("span", {
|
||||
style: mergedLabelStyle,
|
||||
className: (0, _classnames.default)(`${itemPrefixCls}-item-label`, ctxClassNames === null || ctxClassNames === void 0 ? void 0 : ctxClassNames.label, {
|
||||
[`${itemPrefixCls}-item-no-colon`]: !colon
|
||||
})
|
||||
}, label)), isNonNullable(content) && (/*#__PURE__*/React.createElement("span", {
|
||||
style: mergedContentStyle,
|
||||
className: (0, _classnames.default)(`${itemPrefixCls}-item-content`, ctxClassNames === null || ctxClassNames === void 0 ? void 0 : ctxClassNames.content)
|
||||
}, content))));
|
||||
};
|
||||
var _default = exports.default = Cell;
|
||||
12
frontend/node_modules/antd/lib/descriptions/DescriptionsContext.d.ts
generated
vendored
Normal file
12
frontend/node_modules/antd/lib/descriptions/DescriptionsContext.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import React from 'react';
|
||||
export type SemanticName = 'label' | 'content';
|
||||
export interface DescriptionsContextProps {
|
||||
/** @deprecated Please use `styles={{ label: {} }}` instead */
|
||||
labelStyle?: React.CSSProperties;
|
||||
/** @deprecated Please use `styles={{ content: {} }}` instead */
|
||||
contentStyle?: React.CSSProperties;
|
||||
styles?: Partial<Record<SemanticName, React.CSSProperties>>;
|
||||
classNames?: Partial<Record<SemanticName, string>>;
|
||||
}
|
||||
declare const DescriptionsContext: React.Context<DescriptionsContextProps>;
|
||||
export default DescriptionsContext;
|
||||
10
frontend/node_modules/antd/lib/descriptions/DescriptionsContext.js
generated
vendored
Normal file
10
frontend/node_modules/antd/lib/descriptions/DescriptionsContext.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _react = _interopRequireDefault(require("react"));
|
||||
const DescriptionsContext = /*#__PURE__*/_react.default.createContext({});
|
||||
var _default = exports.default = DescriptionsContext;
|
||||
21
frontend/node_modules/antd/lib/descriptions/Item.d.ts
generated
vendored
Normal file
21
frontend/node_modules/antd/lib/descriptions/Item.d.ts
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import type * as React from 'react';
|
||||
import type { Breakpoint } from '../_util/responsiveObserver';
|
||||
type SemanticName = 'label' | 'content';
|
||||
export interface DescriptionsItemProps {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
label?: React.ReactNode;
|
||||
/** @deprecated Please use `styles={{ label: {} }}` instead */
|
||||
labelStyle?: React.CSSProperties;
|
||||
/** @deprecated Please use `styles={{ content: {} }}` instead */
|
||||
contentStyle?: React.CSSProperties;
|
||||
styles?: Partial<Record<SemanticName, React.CSSProperties>>;
|
||||
classNames?: Partial<Record<SemanticName, string>>;
|
||||
children: React.ReactNode;
|
||||
span?: number | 'filled' | {
|
||||
[key in Breakpoint]?: number;
|
||||
};
|
||||
}
|
||||
declare const DescriptionsItem: React.FC<DescriptionsItemProps>;
|
||||
export default DescriptionsItem;
|
||||
12
frontend/node_modules/antd/lib/descriptions/Item.js
generated
vendored
Normal file
12
frontend/node_modules/antd/lib/descriptions/Item.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
// JSX Structure Syntactic Sugar. Never reach the render code.
|
||||
/* istanbul ignore next */
|
||||
const DescriptionsItem = ({
|
||||
children
|
||||
}) => children;
|
||||
var _default = exports.default = DescriptionsItem;
|
||||
13
frontend/node_modules/antd/lib/descriptions/Row.d.ts
generated
vendored
Normal file
13
frontend/node_modules/antd/lib/descriptions/Row.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import * as React from 'react';
|
||||
import type { InternalDescriptionsItemType } from '.';
|
||||
export interface RowProps {
|
||||
prefixCls: string;
|
||||
vertical: boolean;
|
||||
row: InternalDescriptionsItemType[];
|
||||
bordered?: boolean;
|
||||
colon: boolean;
|
||||
index: number;
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
declare const Row: React.FC<RowProps>;
|
||||
export default Row;
|
||||
117
frontend/node_modules/antd/lib/descriptions/Row.js
generated
vendored
Normal file
117
frontend/node_modules/antd/lib/descriptions/Row.js
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
"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 _Cell = _interopRequireDefault(require("./Cell"));
|
||||
var _DescriptionsContext = _interopRequireDefault(require("./DescriptionsContext"));
|
||||
function renderCells(items, {
|
||||
colon,
|
||||
prefixCls,
|
||||
bordered
|
||||
}, {
|
||||
component,
|
||||
type,
|
||||
showLabel,
|
||||
showContent,
|
||||
labelStyle: rootLabelStyle,
|
||||
contentStyle: rootContentStyle,
|
||||
styles: rootStyles
|
||||
}) {
|
||||
return items.map(({
|
||||
label,
|
||||
children,
|
||||
prefixCls: itemPrefixCls = prefixCls,
|
||||
className,
|
||||
style,
|
||||
labelStyle,
|
||||
contentStyle,
|
||||
span = 1,
|
||||
key,
|
||||
styles
|
||||
}, index) => {
|
||||
if (typeof component === 'string') {
|
||||
return /*#__PURE__*/React.createElement(_Cell.default, {
|
||||
key: `${type}-${key || index}`,
|
||||
className: className,
|
||||
style: style,
|
||||
styles: {
|
||||
label: Object.assign(Object.assign(Object.assign(Object.assign({}, rootLabelStyle), rootStyles === null || rootStyles === void 0 ? void 0 : rootStyles.label), labelStyle), styles === null || styles === void 0 ? void 0 : styles.label),
|
||||
content: Object.assign(Object.assign(Object.assign(Object.assign({}, rootContentStyle), rootStyles === null || rootStyles === void 0 ? void 0 : rootStyles.content), contentStyle), styles === null || styles === void 0 ? void 0 : styles.content)
|
||||
},
|
||||
span: span,
|
||||
colon: colon,
|
||||
component: component,
|
||||
itemPrefixCls: itemPrefixCls,
|
||||
bordered: bordered,
|
||||
label: showLabel ? label : null,
|
||||
content: showContent ? children : null,
|
||||
type: type
|
||||
});
|
||||
}
|
||||
return [/*#__PURE__*/React.createElement(_Cell.default, {
|
||||
key: `label-${key || index}`,
|
||||
className: className,
|
||||
style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, rootLabelStyle), rootStyles === null || rootStyles === void 0 ? void 0 : rootStyles.label), style), labelStyle), styles === null || styles === void 0 ? void 0 : styles.label),
|
||||
span: 1,
|
||||
colon: colon,
|
||||
component: component[0],
|
||||
itemPrefixCls: itemPrefixCls,
|
||||
bordered: bordered,
|
||||
label: label,
|
||||
type: "label"
|
||||
}), /*#__PURE__*/React.createElement(_Cell.default, {
|
||||
key: `content-${key || index}`,
|
||||
className: className,
|
||||
style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, rootContentStyle), rootStyles === null || rootStyles === void 0 ? void 0 : rootStyles.content), style), contentStyle), styles === null || styles === void 0 ? void 0 : styles.content),
|
||||
span: span * 2 - 1,
|
||||
component: component[1],
|
||||
itemPrefixCls: itemPrefixCls,
|
||||
bordered: bordered,
|
||||
content: children,
|
||||
type: "content"
|
||||
})];
|
||||
});
|
||||
}
|
||||
const Row = props => {
|
||||
const descContext = React.useContext(_DescriptionsContext.default);
|
||||
const {
|
||||
prefixCls,
|
||||
vertical,
|
||||
row,
|
||||
index,
|
||||
bordered
|
||||
} = props;
|
||||
if (vertical) {
|
||||
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("tr", {
|
||||
key: `label-${index}`,
|
||||
className: `${prefixCls}-row`
|
||||
}, renderCells(row, props, Object.assign({
|
||||
component: 'th',
|
||||
type: 'label',
|
||||
showLabel: true
|
||||
}, descContext))), /*#__PURE__*/React.createElement("tr", {
|
||||
key: `content-${index}`,
|
||||
className: `${prefixCls}-row`
|
||||
}, renderCells(row, props, Object.assign({
|
||||
component: 'td',
|
||||
type: 'content',
|
||||
showContent: true
|
||||
}, descContext))));
|
||||
}
|
||||
return /*#__PURE__*/React.createElement("tr", {
|
||||
key: index,
|
||||
className: `${prefixCls}-row`
|
||||
}, renderCells(row, props, Object.assign({
|
||||
component: bordered ? ['th', 'td'] : 'td',
|
||||
type: 'item',
|
||||
showLabel: true,
|
||||
showContent: true
|
||||
}, descContext)));
|
||||
};
|
||||
var _default = exports.default = Row;
|
||||
3
frontend/node_modules/antd/lib/descriptions/constant.d.ts
generated
vendored
Normal file
3
frontend/node_modules/antd/lib/descriptions/constant.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { Breakpoint } from '../_util/responsiveObserver';
|
||||
declare const DEFAULT_COLUMN_MAP: Record<Breakpoint, number>;
|
||||
export default DEFAULT_COLUMN_MAP;
|
||||
15
frontend/node_modules/antd/lib/descriptions/constant.js
generated
vendored
Normal file
15
frontend/node_modules/antd/lib/descriptions/constant.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
const DEFAULT_COLUMN_MAP = {
|
||||
xxl: 3,
|
||||
xl: 3,
|
||||
lg: 3,
|
||||
md: 3,
|
||||
sm: 2,
|
||||
xs: 1
|
||||
};
|
||||
var _default = exports.default = DEFAULT_COLUMN_MAP;
|
||||
4
frontend/node_modules/antd/lib/descriptions/hooks/useItems.d.ts
generated
vendored
Normal file
4
frontend/node_modules/antd/lib/descriptions/hooks/useItems.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import type { DescriptionsItemType, InternalDescriptionsItemType } from '..';
|
||||
import type { ScreenMap } from '../../_util/responsiveObserver';
|
||||
export default function useItems(screens: ScreenMap, items?: DescriptionsItemType[], children?: React.ReactNode): InternalDescriptionsItemType[];
|
||||
43
frontend/node_modules/antd/lib/descriptions/hooks/useItems.js
generated
vendored
Normal file
43
frontend/node_modules/antd/lib/descriptions/hooks/useItems.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = useItems;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _toArray = _interopRequireDefault(require("rc-util/lib/Children/toArray"));
|
||||
var _responsiveObserver = require("../../_util/responsiveObserver");
|
||||
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;
|
||||
};
|
||||
// Convert children into items
|
||||
const transChildren2Items = childNodes => (0, _toArray.default)(childNodes).map(node => Object.assign(Object.assign({}, node === null || node === void 0 ? void 0 : node.props), {
|
||||
key: node.key
|
||||
}));
|
||||
function useItems(screens, items, children) {
|
||||
const mergedItems = React.useMemo(() =>
|
||||
// Take `items` first or convert `children` into items
|
||||
items || transChildren2Items(children), [items, children]);
|
||||
const responsiveItems = React.useMemo(() => mergedItems.map(_a => {
|
||||
var {
|
||||
span
|
||||
} = _a,
|
||||
restItem = __rest(_a, ["span"]);
|
||||
if (span === 'filled') {
|
||||
return Object.assign(Object.assign({}, restItem), {
|
||||
filled: true
|
||||
});
|
||||
}
|
||||
return Object.assign(Object.assign({}, restItem), {
|
||||
span: typeof span === 'number' ? span : (0, _responsiveObserver.matchScreen)(screens, span)
|
||||
});
|
||||
}), [mergedItems, screens]);
|
||||
return responsiveItems;
|
||||
}
|
||||
3
frontend/node_modules/antd/lib/descriptions/hooks/useRow.d.ts
generated
vendored
Normal file
3
frontend/node_modules/antd/lib/descriptions/hooks/useRow.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { InternalDescriptionsItemType } from '..';
|
||||
declare const useRow: (mergedColumn: number, items: InternalDescriptionsItemType[]) => InternalDescriptionsItemType[][];
|
||||
export default useRow;
|
||||
78
frontend/node_modules/antd/lib/descriptions/hooks/useRow.js
generated
vendored
Normal file
78
frontend/node_modules/antd/lib/descriptions/hooks/useRow.js
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _react = require("react");
|
||||
var _warning = require("../../_util/warning");
|
||||
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;
|
||||
};
|
||||
// Calculate the sum of span in a row
|
||||
function getCalcRows(rowItems, mergedColumn) {
|
||||
let rows = [];
|
||||
let tmpRow = [];
|
||||
let exceed = false;
|
||||
let count = 0;
|
||||
rowItems.filter(n => n).forEach(rowItem => {
|
||||
const {
|
||||
filled
|
||||
} = rowItem,
|
||||
restItem = __rest(rowItem, ["filled"]);
|
||||
if (filled) {
|
||||
tmpRow.push(restItem);
|
||||
rows.push(tmpRow);
|
||||
// reset
|
||||
tmpRow = [];
|
||||
count = 0;
|
||||
return;
|
||||
}
|
||||
const restSpan = mergedColumn - count;
|
||||
count += rowItem.span || 1;
|
||||
if (count >= mergedColumn) {
|
||||
if (count > mergedColumn) {
|
||||
exceed = true;
|
||||
tmpRow.push(Object.assign(Object.assign({}, restItem), {
|
||||
span: restSpan
|
||||
}));
|
||||
} else {
|
||||
tmpRow.push(restItem);
|
||||
}
|
||||
rows.push(tmpRow);
|
||||
// reset
|
||||
tmpRow = [];
|
||||
count = 0;
|
||||
} else {
|
||||
tmpRow.push(restItem);
|
||||
}
|
||||
});
|
||||
if (tmpRow.length > 0) {
|
||||
rows.push(tmpRow);
|
||||
}
|
||||
rows = rows.map(rows => {
|
||||
const count = rows.reduce((acc, item) => acc + (item.span || 1), 0);
|
||||
if (count < mergedColumn) {
|
||||
// If the span of the last element in the current row is less than the column, then add its span to the remaining columns
|
||||
const last = rows[rows.length - 1];
|
||||
last.span = mergedColumn - (count - (last.span || 1));
|
||||
return rows;
|
||||
}
|
||||
return rows;
|
||||
});
|
||||
return [rows, exceed];
|
||||
}
|
||||
const useRow = (mergedColumn, items) => {
|
||||
const [rows, exceed] = (0, _react.useMemo)(() => getCalcRows(items, mergedColumn), [items, mergedColumn]);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = (0, _warning.devUseWarning)('Descriptions');
|
||||
process.env.NODE_ENV !== "production" ? warning(!exceed, 'usage', 'Sum of column `span` in a line not match `column` of Descriptions.') : void 0;
|
||||
}
|
||||
return rows;
|
||||
};
|
||||
var _default = exports.default = useRow;
|
||||
44
frontend/node_modules/antd/lib/descriptions/index.d.ts
generated
vendored
Normal file
44
frontend/node_modules/antd/lib/descriptions/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
import * as React from 'react';
|
||||
import type { Breakpoint } from '../_util/responsiveObserver';
|
||||
import DescriptionsContext from './DescriptionsContext';
|
||||
import type { DescriptionsItemProps } from './Item';
|
||||
import DescriptionsItem from './Item';
|
||||
interface CompoundedComponent {
|
||||
Item: typeof DescriptionsItem;
|
||||
}
|
||||
export interface InternalDescriptionsItemType extends Omit<DescriptionsItemProps, 'span'> {
|
||||
key?: React.Key;
|
||||
filled?: boolean;
|
||||
span?: number;
|
||||
}
|
||||
export interface DescriptionsItemType extends Omit<DescriptionsItemProps, 'prefixCls'> {
|
||||
key?: React.Key;
|
||||
}
|
||||
type SemanticName = 'root' | 'header' | 'title' | 'extra' | 'label' | 'content';
|
||||
export interface DescriptionsProps {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
rootClassName?: string;
|
||||
style?: React.CSSProperties;
|
||||
bordered?: boolean;
|
||||
size?: 'middle' | 'small' | 'default';
|
||||
/**
|
||||
* @deprecated use `items` instead
|
||||
*/
|
||||
children?: React.ReactNode;
|
||||
title?: React.ReactNode;
|
||||
extra?: React.ReactNode;
|
||||
column?: number | Partial<Record<Breakpoint, number>>;
|
||||
layout?: 'horizontal' | 'vertical';
|
||||
colon?: boolean;
|
||||
labelStyle?: React.CSSProperties;
|
||||
contentStyle?: React.CSSProperties;
|
||||
styles?: Partial<Record<SemanticName, React.CSSProperties>>;
|
||||
classNames?: Partial<Record<SemanticName, string>>;
|
||||
items?: DescriptionsItemType[];
|
||||
id?: string;
|
||||
}
|
||||
declare const Descriptions: React.FC<DescriptionsProps> & CompoundedComponent;
|
||||
export type { DescriptionsContextProps } from './DescriptionsContext';
|
||||
export { DescriptionsContext };
|
||||
export default Descriptions;
|
||||
138
frontend/node_modules/antd/lib/descriptions/index.js
generated
vendored
Normal file
138
frontend/node_modules/antd/lib/descriptions/index.js
generated
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
"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
|
||||
});
|
||||
Object.defineProperty(exports, "DescriptionsContext", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _DescriptionsContext.default;
|
||||
}
|
||||
});
|
||||
exports.default = void 0;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _responsiveObserver = require("../_util/responsiveObserver");
|
||||
var _warning = require("../_util/warning");
|
||||
var _context = require("../config-provider/context");
|
||||
var _useSize = _interopRequireDefault(require("../config-provider/hooks/useSize"));
|
||||
var _useBreakpoint = _interopRequireDefault(require("../grid/hooks/useBreakpoint"));
|
||||
var _constant = _interopRequireDefault(require("./constant"));
|
||||
var _DescriptionsContext = _interopRequireDefault(require("./DescriptionsContext"));
|
||||
var _useItems = _interopRequireDefault(require("./hooks/useItems"));
|
||||
var _useRow = _interopRequireDefault(require("./hooks/useRow"));
|
||||
var _Item = _interopRequireDefault(require("./Item"));
|
||||
var _Row = _interopRequireDefault(require("./Row"));
|
||||
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;
|
||||
};
|
||||
/* eslint-disable react/no-array-index-key */
|
||||
|
||||
const Descriptions = props => {
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
title,
|
||||
extra,
|
||||
column,
|
||||
colon = true,
|
||||
bordered,
|
||||
layout,
|
||||
children,
|
||||
className,
|
||||
rootClassName,
|
||||
style,
|
||||
size: customizeSize,
|
||||
labelStyle,
|
||||
contentStyle,
|
||||
styles,
|
||||
items,
|
||||
classNames: descriptionsClassNames
|
||||
} = props,
|
||||
restProps = __rest(props, ["prefixCls", "title", "extra", "column", "colon", "bordered", "layout", "children", "className", "rootClassName", "style", "size", "labelStyle", "contentStyle", "styles", "items", "classNames"]);
|
||||
const {
|
||||
getPrefixCls,
|
||||
direction,
|
||||
className: contextClassName,
|
||||
style: contextStyle,
|
||||
classNames: contextClassNames,
|
||||
styles: contextStyles
|
||||
} = (0, _context.useComponentConfig)('descriptions');
|
||||
const prefixCls = getPrefixCls('descriptions', customizePrefixCls);
|
||||
const screens = (0, _useBreakpoint.default)();
|
||||
// ============================== Warn ==============================
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = (0, _warning.devUseWarning)('Descriptions');
|
||||
[['labelStyle', 'styles={{ label: {} }}'], ['contentStyle', 'styles={{ content: {} }}']].forEach(([deprecatedName, newName]) => {
|
||||
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
|
||||
});
|
||||
}
|
||||
// Column count
|
||||
const mergedColumn = React.useMemo(() => {
|
||||
var _a;
|
||||
if (typeof column === 'number') {
|
||||
return column;
|
||||
}
|
||||
return (_a = (0, _responsiveObserver.matchScreen)(screens, Object.assign(Object.assign({}, _constant.default), column))) !== null && _a !== void 0 ? _a : 3;
|
||||
}, [screens, column]);
|
||||
// Items with responsive
|
||||
const mergedItems = (0, _useItems.default)(screens, items, children);
|
||||
const mergedSize = (0, _useSize.default)(customizeSize);
|
||||
const rows = (0, _useRow.default)(mergedColumn, mergedItems);
|
||||
const [wrapCSSVar, hashId, cssVarCls] = (0, _style.default)(prefixCls);
|
||||
// ======================== Render ========================
|
||||
const contextValue = React.useMemo(() => ({
|
||||
labelStyle,
|
||||
contentStyle,
|
||||
styles: {
|
||||
content: Object.assign(Object.assign({}, contextStyles.content), styles === null || styles === void 0 ? void 0 : styles.content),
|
||||
label: Object.assign(Object.assign({}, contextStyles.label), styles === null || styles === void 0 ? void 0 : styles.label)
|
||||
},
|
||||
classNames: {
|
||||
label: (0, _classnames.default)(contextClassNames.label, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.label),
|
||||
content: (0, _classnames.default)(contextClassNames.content, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.content)
|
||||
}
|
||||
}), [labelStyle, contentStyle, styles, descriptionsClassNames, contextClassNames, contextStyles]);
|
||||
return wrapCSSVar(/*#__PURE__*/React.createElement(_DescriptionsContext.default.Provider, {
|
||||
value: contextValue
|
||||
}, /*#__PURE__*/React.createElement("div", Object.assign({
|
||||
className: (0, _classnames.default)(prefixCls, contextClassName, contextClassNames.root, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.root, {
|
||||
[`${prefixCls}-${mergedSize}`]: mergedSize && mergedSize !== 'default',
|
||||
[`${prefixCls}-bordered`]: !!bordered,
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl'
|
||||
}, className, rootClassName, hashId, cssVarCls),
|
||||
style: Object.assign(Object.assign(Object.assign(Object.assign({}, contextStyle), contextStyles.root), styles === null || styles === void 0 ? void 0 : styles.root), style)
|
||||
}, restProps), (title || extra) && (/*#__PURE__*/React.createElement("div", {
|
||||
className: (0, _classnames.default)(`${prefixCls}-header`, contextClassNames.header, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.header),
|
||||
style: Object.assign(Object.assign({}, contextStyles.header), styles === null || styles === void 0 ? void 0 : styles.header)
|
||||
}, title && (/*#__PURE__*/React.createElement("div", {
|
||||
className: (0, _classnames.default)(`${prefixCls}-title`, contextClassNames.title, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.title),
|
||||
style: Object.assign(Object.assign({}, contextStyles.title), styles === null || styles === void 0 ? void 0 : styles.title)
|
||||
}, title)), extra && (/*#__PURE__*/React.createElement("div", {
|
||||
className: (0, _classnames.default)(`${prefixCls}-extra`, contextClassNames.extra, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.extra),
|
||||
style: Object.assign(Object.assign({}, contextStyles.extra), styles === null || styles === void 0 ? void 0 : styles.extra)
|
||||
}, extra)))), /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-view`
|
||||
}, /*#__PURE__*/React.createElement("table", null, /*#__PURE__*/React.createElement("tbody", null, rows.map((row, index) => (/*#__PURE__*/React.createElement(_Row.default, {
|
||||
key: index,
|
||||
index: index,
|
||||
colon: colon,
|
||||
prefixCls: prefixCls,
|
||||
vertical: layout === 'vertical',
|
||||
bordered: bordered,
|
||||
row: row
|
||||
})))))))));
|
||||
};
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Descriptions.displayName = 'Descriptions';
|
||||
}
|
||||
Descriptions.Item = _Item.default;
|
||||
var _default = exports.default = Descriptions;
|
||||
57
frontend/node_modules/antd/lib/descriptions/style/index.d.ts
generated
vendored
Normal file
57
frontend/node_modules/antd/lib/descriptions/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { GetDefaultToken } from '../../theme/internal';
|
||||
/** Component only token. Which will handle additional calculation of alias token */
|
||||
export interface ComponentToken {
|
||||
/**
|
||||
* @desc 标签背景色
|
||||
* @descEN Background color of label
|
||||
*/
|
||||
labelBg: string;
|
||||
/**
|
||||
* @desc 标签文字颜色
|
||||
* @descEN Text color of label
|
||||
*/
|
||||
labelColor: string;
|
||||
/**
|
||||
* @desc 标题文字颜色
|
||||
* @descEN Text color of title
|
||||
*/
|
||||
titleColor: string;
|
||||
/**
|
||||
* @desc 标题下间距
|
||||
* @descEN Bottom margin of title
|
||||
*/
|
||||
titleMarginBottom: number;
|
||||
/**
|
||||
* @desc 子项下间距
|
||||
* @descEN Bottom padding of item
|
||||
*/
|
||||
itemPaddingBottom: number;
|
||||
/**
|
||||
* @desc 子项结束间距
|
||||
* @descEN End padding of item
|
||||
*/
|
||||
itemPaddingEnd: number;
|
||||
/**
|
||||
* @desc 冒号右间距
|
||||
* @descEN Right margin of colon
|
||||
*/
|
||||
colonMarginRight: number;
|
||||
/**
|
||||
* @desc 冒号左间距
|
||||
* @descEN Left margin of colon
|
||||
*/
|
||||
colonMarginLeft: number;
|
||||
/**
|
||||
* @desc 内容区域文字颜色
|
||||
* @descEN Text color of content
|
||||
*/
|
||||
contentColor: string;
|
||||
/**
|
||||
* @desc 额外区域文字颜色
|
||||
* @descEN Text color of extra area
|
||||
*/
|
||||
extraColor: string;
|
||||
}
|
||||
export declare const prepareComponentToken: GetDefaultToken<'Descriptions'>;
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
206
frontend/node_modules/antd/lib/descriptions/style/index.js
generated
vendored
Normal file
206
frontend/node_modules/antd/lib/descriptions/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,206 @@
|
||||
"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 genBorderedStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
labelBg
|
||||
} = token;
|
||||
return {
|
||||
[`&${componentCls}-bordered`]: {
|
||||
[`> ${componentCls}-view`]: {
|
||||
border: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
|
||||
'> table': {
|
||||
tableLayout: 'auto'
|
||||
},
|
||||
[`${componentCls}-row`]: {
|
||||
borderBottom: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
|
||||
'&:first-child': {
|
||||
'> th:first-child, > td:first-child': {
|
||||
borderStartStartRadius: token.borderRadiusLG
|
||||
}
|
||||
},
|
||||
'&:last-child': {
|
||||
borderBottom: 'none',
|
||||
'> th:first-child, > td:first-child': {
|
||||
borderEndStartRadius: token.borderRadiusLG
|
||||
}
|
||||
},
|
||||
[`> ${componentCls}-item-label, > ${componentCls}-item-content`]: {
|
||||
padding: `${(0, _cssinjs.unit)(token.padding)} ${(0, _cssinjs.unit)(token.paddingLG)}`,
|
||||
borderInlineEnd: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
|
||||
'&:last-child': {
|
||||
borderInlineEnd: 'none'
|
||||
}
|
||||
},
|
||||
[`> ${componentCls}-item-label`]: {
|
||||
color: token.colorTextSecondary,
|
||||
backgroundColor: labelBg,
|
||||
'&::after': {
|
||||
display: 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-middle`]: {
|
||||
[`${componentCls}-row`]: {
|
||||
[`> ${componentCls}-item-label, > ${componentCls}-item-content`]: {
|
||||
padding: `${(0, _cssinjs.unit)(token.paddingSM)} ${(0, _cssinjs.unit)(token.paddingLG)}`
|
||||
}
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-small`]: {
|
||||
[`${componentCls}-row`]: {
|
||||
[`> ${componentCls}-item-label, > ${componentCls}-item-content`]: {
|
||||
padding: `${(0, _cssinjs.unit)(token.paddingXS)} ${(0, _cssinjs.unit)(token.padding)}`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const genDescriptionStyles = token => {
|
||||
const {
|
||||
componentCls,
|
||||
extraColor,
|
||||
itemPaddingBottom,
|
||||
itemPaddingEnd,
|
||||
colonMarginRight,
|
||||
colonMarginLeft,
|
||||
titleMarginBottom
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: Object.assign(Object.assign(Object.assign({}, (0, _style.resetComponent)(token)), genBorderedStyle(token)), {
|
||||
'&-rtl': {
|
||||
direction: 'rtl'
|
||||
},
|
||||
[`${componentCls}-header`]: {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
marginBottom: titleMarginBottom
|
||||
},
|
||||
[`${componentCls}-title`]: Object.assign(Object.assign({}, _style.textEllipsis), {
|
||||
flex: 'auto',
|
||||
color: token.titleColor,
|
||||
fontWeight: token.fontWeightStrong,
|
||||
fontSize: token.fontSizeLG,
|
||||
lineHeight: token.lineHeightLG
|
||||
}),
|
||||
[`${componentCls}-extra`]: {
|
||||
marginInlineStart: 'auto',
|
||||
color: extraColor,
|
||||
fontSize: token.fontSize
|
||||
},
|
||||
[`${componentCls}-view`]: {
|
||||
width: '100%',
|
||||
borderRadius: token.borderRadiusLG,
|
||||
table: {
|
||||
width: '100%',
|
||||
tableLayout: 'fixed',
|
||||
borderCollapse: 'collapse'
|
||||
}
|
||||
},
|
||||
[`${componentCls}-row`]: {
|
||||
'> th, > td': {
|
||||
paddingBottom: itemPaddingBottom,
|
||||
paddingInlineEnd: itemPaddingEnd
|
||||
},
|
||||
'> th:last-child, > td:last-child': {
|
||||
paddingInlineEnd: 0
|
||||
},
|
||||
'&:last-child': {
|
||||
borderBottom: 'none',
|
||||
'> th, > td': {
|
||||
paddingBottom: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
[`${componentCls}-item-label`]: {
|
||||
color: token.labelColor,
|
||||
fontWeight: 'normal',
|
||||
fontSize: token.fontSize,
|
||||
lineHeight: token.lineHeight,
|
||||
textAlign: 'start',
|
||||
'&::after': {
|
||||
content: '":"',
|
||||
position: 'relative',
|
||||
top: -0.5,
|
||||
// magic for position
|
||||
marginInline: `${(0, _cssinjs.unit)(colonMarginLeft)} ${(0, _cssinjs.unit)(colonMarginRight)}`
|
||||
},
|
||||
[`&${componentCls}-item-no-colon::after`]: {
|
||||
content: '""'
|
||||
}
|
||||
},
|
||||
[`${componentCls}-item-no-label`]: {
|
||||
'&::after': {
|
||||
margin: 0,
|
||||
content: '""'
|
||||
}
|
||||
},
|
||||
[`${componentCls}-item-content`]: {
|
||||
display: 'table-cell',
|
||||
flex: 1,
|
||||
color: token.contentColor,
|
||||
fontSize: token.fontSize,
|
||||
lineHeight: token.lineHeight,
|
||||
wordBreak: 'break-word',
|
||||
overflowWrap: 'break-word'
|
||||
},
|
||||
[`${componentCls}-item`]: {
|
||||
paddingBottom: 0,
|
||||
verticalAlign: 'top',
|
||||
'&-container': {
|
||||
display: 'flex',
|
||||
[`${componentCls}-item-label`]: {
|
||||
display: 'inline-flex',
|
||||
alignItems: 'baseline'
|
||||
},
|
||||
[`${componentCls}-item-content`]: {
|
||||
display: 'inline-flex',
|
||||
alignItems: 'baseline',
|
||||
minWidth: '1em'
|
||||
}
|
||||
}
|
||||
},
|
||||
'&-middle': {
|
||||
[`${componentCls}-row`]: {
|
||||
'> th, > td': {
|
||||
paddingBottom: token.paddingSM
|
||||
}
|
||||
}
|
||||
},
|
||||
'&-small': {
|
||||
[`${componentCls}-row`]: {
|
||||
'> th, > td': {
|
||||
paddingBottom: token.paddingXS
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
const prepareComponentToken = token => ({
|
||||
labelBg: token.colorFillAlter,
|
||||
labelColor: token.colorTextTertiary,
|
||||
titleColor: token.colorText,
|
||||
titleMarginBottom: token.fontSizeSM * token.lineHeightSM,
|
||||
itemPaddingBottom: token.padding,
|
||||
itemPaddingEnd: token.padding,
|
||||
colonMarginRight: token.marginXS,
|
||||
colonMarginLeft: token.marginXXS / 2,
|
||||
contentColor: token.colorText,
|
||||
extraColor: token.colorText
|
||||
});
|
||||
// ============================== Export ==============================
|
||||
exports.prepareComponentToken = prepareComponentToken;
|
||||
var _default = exports.default = (0, _internal.genStyleHooks)('Descriptions', token => {
|
||||
const descriptionToken = (0, _internal.mergeToken)(token, {});
|
||||
return genDescriptionStyles(descriptionToken);
|
||||
}, prepareComponentToken);
|
||||
Reference in New Issue
Block a user