Update from Vibe Studio

This commit is contained in:
Vibe Studio
2026-01-12 09:12:41 +00:00
parent a4605e311a
commit a6ae5199b0
29756 changed files with 2526222 additions and 278 deletions

58
node_modules/@ant-design/pro-list/es/Item.d.ts generated vendored Normal file
View File

@@ -0,0 +1,58 @@
import type { CheckCardProps } from '@ant-design/pro-card';
import type { ListGridType } from 'antd/lib/list';
import type { ExpandableConfig } from 'antd/lib/table/interface';
import React from 'react';
import type { GetComponentProps } from './index';
export type RenderExpandIconProps<RecordType> = {
prefixCls: string;
expanded: boolean;
expandIcon: React.ReactNode | JSX.Element | ((props: {
onExpand: (expanded: boolean) => void;
expanded: boolean;
record: RecordType;
}) => React.ReactNode);
onExpand: (expanded: boolean) => void;
record: RecordType;
hashId: string;
};
export declare function renderExpandIcon<RecordType>({ prefixCls, expandIcon, onExpand, expanded, record, hashId, }: RenderExpandIconProps<RecordType>): import("react/jsx-runtime").JSX.Element;
export type ItemProps<RecordType> = {
title?: React.ReactNode;
subTitle?: React.ReactNode;
checkbox?: React.ReactNode;
className?: string;
prefixCls?: string;
item?: any;
subheader?: {
title: React.ReactNode;
actions: React.ReactNode[];
};
index: number;
selected?: boolean;
avatar?: React.ReactNode;
content?: React.ReactNode;
actions?: React.ReactNode[];
extra?: React.ReactNode;
description?: React.ReactNode;
loading?: boolean;
style?: React.CSSProperties;
grid?: ListGridType;
expand?: boolean;
rowSupportExpand?: boolean;
cardActionProps?: 'actions' | 'extra';
onExpand?: (expand: boolean) => void;
expandable?: ExpandableConfig<any>;
showActions?: 'hover' | 'always';
showExtra?: 'hover' | 'always';
type?: 'new' | 'top' | 'inline' | 'subheader';
isEditable: boolean;
recordKey: string | number | undefined;
cardProps?: CheckCardProps;
record: RecordType;
onRow?: GetComponentProps<RecordType>;
onItem?: GetComponentProps<RecordType>;
itemHeaderRender?: ((item: RecordType, index: number, defaultDom: JSX.Element | null) => React.ReactNode) | false;
itemTitleRender?: ((item: RecordType, index: number, defaultDom: JSX.Element | null) => React.ReactNode) | false;
};
declare function ProListItem<RecordType>(props: ItemProps<RecordType>): import("react/jsx-runtime").JSX.Element;
export default ProListItem;

243
node_modules/@ant-design/pro-list/es/Item.js generated vendored Normal file
View File

@@ -0,0 +1,243 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
var _excluded = ["title", "subTitle", "content", "itemTitleRender", "prefixCls", "actions", "item", "recordKey", "avatar", "cardProps", "description", "isEditable", "checkbox", "index", "selected", "loading", "expand", "onExpand", "expandable", "rowSupportExpand", "showActions", "showExtra", "type", "style", "className", "record", "onRow", "onItem", "itemHeaderRender", "cardActionProps", "extra"];
import { RightOutlined } from '@ant-design/icons';
import { CheckCard } from '@ant-design/pro-card';
import { ProProvider } from '@ant-design/pro-provider';
import { ConfigProvider, List, Skeleton } from 'antd';
import classNames from 'classnames';
import useMergedState from "rc-util/es/hooks/useMergedState";
import React, { useContext, useMemo } from 'react';
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
import { Fragment as _Fragment } from "react/jsx-runtime";
export function renderExpandIcon(_ref) {
var prefixCls = _ref.prefixCls,
_ref$expandIcon = _ref.expandIcon,
expandIcon = _ref$expandIcon === void 0 ? /*#__PURE__*/_jsx(RightOutlined, {}) : _ref$expandIcon,
onExpand = _ref.onExpand,
expanded = _ref.expanded,
record = _ref.record,
hashId = _ref.hashId;
var icon = expandIcon;
var expandClassName = "".concat(prefixCls, "-row-expand-icon");
var onClick = function onClick(event) {
onExpand(!expanded);
event.stopPropagation();
};
if (typeof expandIcon === 'function') {
icon = expandIcon({
expanded: expanded,
onExpand: onExpand,
record: record
});
}
return /*#__PURE__*/_jsx("span", {
className: classNames(expandClassName, hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-row-expanded"), expanded), "".concat(prefixCls, "-row-collapsed"), !expanded)),
onClick: onClick,
children: icon
});
}
function ProListItem(props) {
var _ref3, _ref4;
var customizePrefixCls = props.prefixCls;
var _useContext = useContext(ConfigProvider.ConfigContext),
getPrefixCls = _useContext.getPrefixCls;
var _useContext2 = useContext(ProProvider),
hashId = _useContext2.hashId;
var prefixCls = getPrefixCls('pro-list', customizePrefixCls);
var defaultClassName = "".concat(prefixCls, "-row");
var title = props.title,
subTitle = props.subTitle,
content = props.content,
itemTitleRender = props.itemTitleRender,
restPrefixCls = props.prefixCls,
actions = props.actions,
item = props.item,
recordKey = props.recordKey,
avatar = props.avatar,
cardProps = props.cardProps,
description = props.description,
isEditable = props.isEditable,
checkbox = props.checkbox,
index = props.index,
selected = props.selected,
loading = props.loading,
propsExpand = props.expand,
propsOnExpand = props.onExpand,
expandableConfig = props.expandable,
rowSupportExpand = props.rowSupportExpand,
showActions = props.showActions,
showExtra = props.showExtra,
type = props.type,
style = props.style,
_props$className = props.className,
propsClassName = _props$className === void 0 ? defaultClassName : _props$className,
record = props.record,
onRow = props.onRow,
onItem = props.onItem,
itemHeaderRender = props.itemHeaderRender,
cardActionProps = props.cardActionProps,
extra = props.extra,
rest = _objectWithoutProperties(props, _excluded);
var _ref2 = expandableConfig || {},
expandedRowRender = _ref2.expandedRowRender,
expandIcon = _ref2.expandIcon,
expandRowByClick = _ref2.expandRowByClick,
_ref2$indentSize = _ref2.indentSize,
indentSize = _ref2$indentSize === void 0 ? 8 : _ref2$indentSize,
expandedRowClassName = _ref2.expandedRowClassName;
var _useMergedState = useMergedState(!!propsExpand, {
value: propsExpand,
onChange: propsOnExpand
}),
_useMergedState2 = _slicedToArray(_useMergedState, 2),
expanded = _useMergedState2[0],
onExpand = _useMergedState2[1];
var className = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(defaultClassName, "-selected"), !cardProps && selected), "".concat(defaultClassName, "-show-action-hover"), showActions === 'hover'), "".concat(defaultClassName, "-type-").concat(type), !!type), "".concat(defaultClassName, "-editable"), isEditable), "".concat(defaultClassName, "-show-extra-hover"), showExtra === 'hover'), hashId, defaultClassName);
var extraClassName = classNames(hashId, _defineProperty({}, "".concat(propsClassName, "-extra"), showExtra === 'hover'));
var needExpanded = expanded || Object.values(expandableConfig || {}).length === 0;
var expandedRowDom = expandedRowRender && expandedRowRender(record, index, indentSize, expanded);
var extraDom = useMemo(function () {
if (!actions || cardActionProps === 'actions') {
return undefined;
}
return [/*#__PURE__*/_jsx("div", {
onClick: function onClick(e) {
return e.stopPropagation();
},
children: actions
}, "action")];
}, [actions, cardActionProps]);
var actionsDom = useMemo(function () {
if (!actions || !cardActionProps || cardActionProps === 'extra') {
return undefined;
}
return [/*#__PURE__*/_jsx("div", {
className: "".concat(defaultClassName, "-actions ").concat(hashId).trim(),
onClick: function onClick(e) {
return e.stopPropagation();
},
children: actions
}, "action")];
}, [actions, cardActionProps, defaultClassName, hashId]);
var titleDom = title || subTitle ? /*#__PURE__*/_jsxs("div", {
className: "".concat(defaultClassName, "-header-container ").concat(hashId).trim(),
children: [title && /*#__PURE__*/_jsx("div", {
className: classNames("".concat(defaultClassName, "-title"), hashId, _defineProperty({}, "".concat(defaultClassName, "-title-editable"), isEditable)),
children: title
}), subTitle && /*#__PURE__*/_jsx("div", {
className: classNames("".concat(defaultClassName, "-subTitle"), hashId, _defineProperty({}, "".concat(defaultClassName, "-subTitle-editable"), isEditable)),
children: subTitle
})]
}) : null;
var metaTitle = (_ref3 = itemTitleRender && (itemTitleRender === null || itemTitleRender === void 0 ? void 0 : itemTitleRender(record, index, titleDom))) !== null && _ref3 !== void 0 ? _ref3 : titleDom;
var metaDom = metaTitle || avatar || subTitle || description ? /*#__PURE__*/_jsx(List.Item.Meta, {
avatar: avatar,
title: metaTitle,
description: description && needExpanded && /*#__PURE__*/_jsx("div", {
className: "".concat(className, "-description ").concat(hashId).trim(),
children: description
})
}) : null;
var rowClassName = classNames(hashId, _defineProperty(_defineProperty(_defineProperty({}, "".concat(defaultClassName, "-item-has-checkbox"), checkbox), "".concat(defaultClassName, "-item-has-avatar"), avatar), className, className));
var cardTitleDom = useMemo(function () {
if (avatar || title) {
return /*#__PURE__*/_jsxs(_Fragment, {
children: [avatar, /*#__PURE__*/_jsx("span", {
className: "".concat(getPrefixCls('list-item-meta-title'), " ").concat(hashId).trim(),
children: title
})]
});
}
return null;
}, [avatar, getPrefixCls, hashId, title]);
var itemProps = onItem === null || onItem === void 0 ? void 0 : onItem(record, index);
var defaultDom = !cardProps ? /*#__PURE__*/_jsx(List.Item, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
className: classNames(rowClassName, hashId, _defineProperty({}, propsClassName, propsClassName !== defaultClassName))
}, rest), {}, {
actions: extraDom,
extra: !!extra && /*#__PURE__*/_jsx("div", {
className: extraClassName,
children: extra
})
}, onRow === null || onRow === void 0 ? void 0 : onRow(record, index)), itemProps), {}, {
onClick: function onClick(e) {
var _onRow, _onRow$onClick, _onItem, _onItem$onClick;
onRow === null || onRow === void 0 || (_onRow = onRow(record, index)) === null || _onRow === void 0 || (_onRow$onClick = _onRow.onClick) === null || _onRow$onClick === void 0 || _onRow$onClick.call(_onRow, e);
onItem === null || onItem === void 0 || (_onItem = onItem(record, index)) === null || _onItem === void 0 || (_onItem$onClick = _onItem.onClick) === null || _onItem$onClick === void 0 || _onItem$onClick.call(_onItem, e);
if (expandRowByClick) {
onExpand(!expanded);
}
},
children: /*#__PURE__*/_jsxs(Skeleton, {
avatar: true,
title: false,
loading: loading,
active: true,
children: [/*#__PURE__*/_jsxs("div", {
className: "".concat(className, "-header ").concat(hashId).trim(),
children: [/*#__PURE__*/_jsxs("div", {
className: "".concat(className, "-header-option ").concat(hashId).trim(),
children: [!!checkbox && /*#__PURE__*/_jsx("div", {
className: "".concat(className, "-checkbox ").concat(hashId).trim(),
children: checkbox
}), Object.values(expandableConfig || {}).length > 0 && rowSupportExpand && renderExpandIcon({
prefixCls: prefixCls,
hashId: hashId,
expandIcon: expandIcon,
onExpand: onExpand,
expanded: expanded,
record: record
})]
}), (_ref4 = itemHeaderRender && (itemHeaderRender === null || itemHeaderRender === void 0 ? void 0 : itemHeaderRender(record, index, metaDom))) !== null && _ref4 !== void 0 ? _ref4 : metaDom]
}), needExpanded && (content || expandedRowDom) && /*#__PURE__*/_jsxs("div", {
className: "".concat(className, "-content ").concat(hashId).trim(),
children: [content, expandedRowRender && rowSupportExpand && /*#__PURE__*/_jsx("div", {
className: expandedRowClassName && typeof expandedRowClassName !== 'string' ? expandedRowClassName(record, index, indentSize) : expandedRowClassName,
children: expandedRowDom
})]
})]
})
})) : /*#__PURE__*/_jsx(CheckCard, _objectSpread(_objectSpread(_objectSpread({
bordered: true,
style: {
width: '100%'
}
}, cardProps), {}, {
title: cardTitleDom,
subTitle: subTitle,
extra: extraDom,
actions: actionsDom,
bodyStyle: _objectSpread({
padding: 24
}, cardProps.bodyStyle)
}, itemProps), {}, {
onClick: function onClick(e) {
var _cardProps$onClick, _itemProps$onClick;
cardProps === null || cardProps === void 0 || (_cardProps$onClick = cardProps.onClick) === null || _cardProps$onClick === void 0 || _cardProps$onClick.call(cardProps, e);
itemProps === null || itemProps === void 0 || (_itemProps$onClick = itemProps.onClick) === null || _itemProps$onClick === void 0 || _itemProps$onClick.call(itemProps, e);
},
children: /*#__PURE__*/_jsx(Skeleton, {
avatar: true,
title: false,
loading: loading,
active: true,
children: /*#__PURE__*/_jsxs("div", {
className: "".concat(className, "-header ").concat(hashId).trim(),
children: [itemTitleRender && (itemTitleRender === null || itemTitleRender === void 0 ? void 0 : itemTitleRender(record, index, titleDom)), content]
})
})
}));
if (!cardProps) {
return defaultDom;
}
return /*#__PURE__*/_jsx("div", {
className: classNames(hashId, _defineProperty(_defineProperty({}, "".concat(className, "-card"), cardProps), propsClassName, propsClassName !== defaultClassName)),
style: style,
children: defaultDom
});
}
export default ProListItem;

30
node_modules/@ant-design/pro-list/es/ListView.d.ts generated vendored Normal file
View File

@@ -0,0 +1,30 @@
import type { CheckCardProps } from '@ant-design/pro-card';
import type { ActionType } from '@ant-design/pro-table';
import type { ListProps, TableProps } from 'antd';
import type { GetRowKey, TableRowSelection } from 'antd/lib/table/interface';
import React from 'react';
import type { ItemProps } from './Item';
import type { GetComponentProps } from './index';
import type { AnyObject } from 'antd/es/_util/type';
import type { PaginationConfig } from 'antd/lib/pagination';
type AntdListProps<RecordType> = Omit<ListProps<RecordType>, 'rowKey'>;
export type ListViewProps<RecordType> = Omit<AntdListProps<RecordType>, 'renderItem'> & Pick<TableProps<RecordType>, 'columns' | 'dataSource' | 'expandable' | 'pagination'> & {
rowKey?: string | keyof RecordType | GetRowKey<RecordType>;
showActions?: 'hover' | 'always';
showExtra?: 'hover' | 'always';
rowSelection?: TableRowSelection<RecordType>;
prefixCls?: string;
dataSource: readonly RecordType[];
renderItem?: (item: RecordType, index: number, defaultDom: JSX.Element) => React.ReactNode;
actionRef: React.MutableRefObject<ActionType | undefined>;
onRow?: GetComponentProps<RecordType>;
onItem?: GetComponentProps<RecordType>;
rowClassName?: string | ((item: RecordType, index: number) => string);
/** Render 除了 header 之后的代码 */
itemHeaderRender?: ItemProps<RecordType>['itemHeaderRender'];
itemTitleRender?: ItemProps<RecordType>['itemTitleRender'];
itemCardProps?: CheckCardProps;
pagination?: PaginationConfig;
};
declare function ListView<RecordType extends AnyObject>(props: ListViewProps<RecordType>): import("react/jsx-runtime").JSX.Element;
export default ListView;

218
node_modules/@ant-design/pro-list/es/ListView.js generated vendored Normal file
View File

@@ -0,0 +1,218 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["dataSource", "columns", "rowKey", "showActions", "showExtra", "prefixCls", "actionRef", "itemTitleRender", "renderItem", "itemCardProps", "itemHeaderRender", "expandable", "rowSelection", "pagination", "onRow", "onItem", "rowClassName"];
import { ProProvider } from '@ant-design/pro-provider';
import { ConfigProvider, List, version } from 'antd';
import useLazyKVMap from "antd/es/table/hooks/useLazyKVMap";
import usePagination from "antd/es/table/hooks/usePagination";
import useSelection from "antd/es/table/hooks/useSelection";
import classNames from 'classnames';
import get from "rc-util/es/utils/get";
import React, { useContext } from 'react';
import ProListItem from "./Item";
import { PRO_LIST_KEYS_MAP } from "./constants";
import { compareVersions } from '@ant-design/pro-utils';
import { jsx as _jsx } from "react/jsx-runtime";
function ListView(props) {
var dataSource = props.dataSource,
columns = props.columns,
rowKey = props.rowKey,
showActions = props.showActions,
showExtra = props.showExtra,
customizePrefixCls = props.prefixCls,
actionRef = props.actionRef,
itemTitleRender = props.itemTitleRender,
_renderItem = props.renderItem,
itemCardProps = props.itemCardProps,
itemHeaderRender = props.itemHeaderRender,
expandableConfig = props.expandable,
rowSelection = props.rowSelection,
pagination = props.pagination,
onRow = props.onRow,
onItem = props.onItem,
rowClassName = props.rowClassName,
rest = _objectWithoutProperties(props, _excluded);
var _useContext = useContext(ProProvider),
hashId = _useContext.hashId;
var _useContext2 = useContext(ConfigProvider.ConfigContext),
getPrefixCls = _useContext2.getPrefixCls;
var getRowKey = React.useMemo(function () {
if (typeof rowKey === 'function') {
return rowKey;
}
return function (record, index) {
return record[rowKey] || index;
};
}, [rowKey]);
var _useLazyKVMap = useLazyKVMap(dataSource, 'children', getRowKey),
_useLazyKVMap2 = _slicedToArray(_useLazyKVMap, 1),
getRecordByKey = _useLazyKVMap2[0];
var usePaginationArgs = [function () {}, pagination];
// 兼容 5.2.0 以下的版本
if (compareVersions(version, '5.3.0') < 0) usePaginationArgs.reverse();
// 合并分页的的配置,这里是为了兼容 antd 的分页
var _usePagination = usePagination(dataSource.length, usePaginationArgs[0], usePaginationArgs[1]),
_usePagination2 = _slicedToArray(_usePagination, 1),
mergedPagination = _usePagination2[0];
/** 根据分页来返回不同的数据,模拟 table */
var pageData = React.useMemo(function () {
if (pagination === false || !mergedPagination.pageSize || dataSource.length < mergedPagination.total) {
return dataSource;
}
var _mergedPagination$cur = mergedPagination.current,
current = _mergedPagination$cur === void 0 ? 1 : _mergedPagination$cur,
_mergedPagination$pag = mergedPagination.pageSize,
pageSize = _mergedPagination$pag === void 0 ? 10 : _mergedPagination$pag;
var currentPageData = dataSource.slice((current - 1) * pageSize, current * pageSize);
return currentPageData;
}, [dataSource, mergedPagination, pagination]);
var prefixCls = getPrefixCls('pro-list', customizePrefixCls);
/** 提供和 table 一样的 rowSelection 配置 */
var useSelectionArgs = [{
getRowKey: getRowKey,
getRecordByKey: getRecordByKey,
prefixCls: prefixCls,
data: dataSource,
pageData: pageData,
expandType: 'row',
childrenColumnName: 'children',
locale: {}
}, rowSelection
// 这个 API 用的不好,先 any 一下
];
// 兼容 5.2.0 以下的版本
if (compareVersions(version, '5.3.0') < 0) useSelectionArgs.reverse();
var _useSelection = useSelection.apply(void 0, useSelectionArgs),
_useSelection2 = _slicedToArray(_useSelection, 2),
selectItemRender = _useSelection2[0],
selectedKeySet = _useSelection2[1];
// 提供和 Table 一样的 expand 支持
var _ref = expandableConfig || {},
expandedRowKeys = _ref.expandedRowKeys,
defaultExpandedRowKeys = _ref.defaultExpandedRowKeys,
_ref$defaultExpandAll = _ref.defaultExpandAllRows,
defaultExpandAllRows = _ref$defaultExpandAll === void 0 ? true : _ref$defaultExpandAll,
onExpand = _ref.onExpand,
onExpandedRowsChange = _ref.onExpandedRowsChange,
rowExpandable = _ref.rowExpandable;
/** 展开收起功能区域 star */
var _React$useState = React.useState(function () {
if (defaultExpandedRowKeys) {
return defaultExpandedRowKeys;
}
if (defaultExpandAllRows !== false) {
return dataSource.map(getRowKey);
}
return [];
}),
_React$useState2 = _slicedToArray(_React$useState, 2),
innerExpandedKeys = _React$useState2[0],
setInnerExpandedKeys = _React$useState2[1];
var mergedExpandedKeys = React.useMemo(function () {
return new Set(expandedRowKeys || innerExpandedKeys || []);
}, [expandedRowKeys, innerExpandedKeys]);
var onTriggerExpand = React.useCallback(function (record) {
var key = getRowKey(record, dataSource.indexOf(record));
var newExpandedKeys;
var hasKey = mergedExpandedKeys.has(key);
if (hasKey) {
mergedExpandedKeys.delete(key);
newExpandedKeys = _toConsumableArray(mergedExpandedKeys);
} else {
newExpandedKeys = [].concat(_toConsumableArray(mergedExpandedKeys), [key]);
}
setInnerExpandedKeys(newExpandedKeys);
if (onExpand) {
onExpand(!hasKey, record);
}
if (onExpandedRowsChange) {
onExpandedRowsChange(newExpandedKeys);
}
}, [getRowKey, mergedExpandedKeys, dataSource, onExpand, onExpandedRowsChange]);
/** 展开收起功能区域 end */
/** 这个是 选择框的 render 方法 为了兼容 antd 的 table,用了同样的渲染逻辑 所以看起来有点奇怪 */
var selectItemDom = selectItemRender([])[0];
return /*#__PURE__*/_jsx(List, _objectSpread(_objectSpread({}, rest), {}, {
className: classNames(getPrefixCls('pro-list-container', customizePrefixCls), hashId, rest.className),
dataSource: pageData,
pagination: pagination && mergedPagination,
renderItem: function renderItem(item, index) {
var _actionRef$current;
var listItemProps = {
className: typeof rowClassName === 'function' ? rowClassName(item, index) : rowClassName
};
columns === null || columns === void 0 || columns.forEach(function (column) {
var listKey = column.listKey,
cardActionProps = column.cardActionProps;
if (!PRO_LIST_KEYS_MAP.has(listKey)) {
return;
}
var dataIndex = column.dataIndex || listKey || column.key;
var rawData = Array.isArray(dataIndex) ? get(item, dataIndex) : item[dataIndex];
/** 如果cardActionProps 需要直接使用源数组,因为 action 必须要源数组 */
if (cardActionProps === 'actions' && listKey === 'actions') {
listItemProps.cardActionProps = cardActionProps;
}
// 调用protable的列配置渲染数据
var data = column.render ? column.render(rawData, item, index) : rawData;
if (data !== '-') listItemProps[column.listKey] = data;
});
var checkboxDom;
if (selectItemDom && selectItemDom.render) {
checkboxDom = selectItemDom.render(item, item, index);
}
var _ref2 = ((_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : _actionRef$current.isEditable(_objectSpread(_objectSpread({}, item), {}, {
index: index
}))) || {},
isEditable = _ref2.isEditable,
recordKey = _ref2.recordKey;
var isChecked = selectedKeySet.has(recordKey || index);
var defaultDom = /*#__PURE__*/_jsx(ProListItem, _objectSpread(_objectSpread({
cardProps: rest.grid ? _objectSpread(_objectSpread(_objectSpread({}, itemCardProps), rest.grid), {}, {
checked: isChecked,
onChange: /*#__PURE__*/React.isValidElement(checkboxDom) ? function (changeChecked) {
var _checkboxDom;
return (_checkboxDom = checkboxDom) === null || _checkboxDom === void 0 || (_checkboxDom = _checkboxDom.props) === null || _checkboxDom === void 0 ? void 0 : _checkboxDom.onChange({
nativeEvent: {},
changeChecked: changeChecked
});
} : undefined
}) : undefined
}, listItemProps), {}, {
recordKey: recordKey,
isEditable: isEditable || false,
expandable: expandableConfig,
expand: mergedExpandedKeys.has(getRowKey(item, index)),
onExpand: function onExpand() {
onTriggerExpand(item);
},
index: index,
record: item,
item: item,
showActions: showActions,
showExtra: showExtra,
itemTitleRender: itemTitleRender,
itemHeaderRender: itemHeaderRender,
rowSupportExpand: !rowExpandable || rowExpandable && rowExpandable(item),
selected: selectedKeySet.has(getRowKey(item, index)),
checkbox: checkboxDom,
onRow: onRow,
onItem: onItem
}), recordKey);
if (_renderItem) {
return _renderItem(item, index, defaultDom);
}
return defaultDom;
}
}));
}
export default ListView;

3
node_modules/@ant-design/pro-list/es/constants.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
declare const PRO_LIST_KEYS: string[];
declare const PRO_LIST_KEYS_MAP: Map<any, any>;
export { PRO_LIST_KEYS, PRO_LIST_KEYS_MAP };

6
node_modules/@ant-design/pro-list/es/constants.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
var PRO_LIST_KEYS = ['title', 'subTitle', 'avatar', 'description', 'extra', 'content', 'actions', 'type'];
var PRO_LIST_KEYS_MAP = PRO_LIST_KEYS.reduce(function (pre, next) {
pre.set(next, true);
return pre;
}, new Map());
export { PRO_LIST_KEYS, PRO_LIST_KEYS_MAP };

54
node_modules/@ant-design/pro-list/es/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,54 @@
import type { CheckCardProps } from '@ant-design/pro-card';
import type { ProColumnType, ProTableProps } from '@ant-design/pro-table';
import type { ListProps } from 'antd';
import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
import React from 'react';
import type { ItemProps } from './Item';
import 'antd/lib/list/style';
export type AntdListProps<RecordType> = Omit<ListProps<RecordType>, 'rowKey'>;
export type ProListMeta<T> = Pick<ProColumnType<T>, 'dataIndex' | 'valueType' | 'render' | 'search' | 'title' | 'valueEnum' | 'editable' | 'fieldProps' | 'formItemProps' | 'renderFormItem'> & {
key?: React.Key;
};
type ProListMetaAction<T> = ProListMeta<T> & {
/**
* @example
* `cardActionProps = 'actions';`;
*
* @name 选择映射到 card 上的 props默认为extra
*/
cardActionProps?: 'extra' | 'actions';
};
type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
type IsAny<T> = IfAny<T, true, false>;
export type BaseProListMetas<T = any> = {
[key: string]: any;
type?: ProListMeta<T>;
title?: ProListMeta<T>;
subTitle?: ProListMeta<T>;
description?: ProListMeta<T>;
avatar?: ProListMeta<T>;
content?: ProListMeta<T>;
actions?: ProListMetaAction<T>;
};
export type ProListMetas<T = any> = BaseProListMetas<T> & {
[key in keyof T]?: IsAny<T> extends true ? ProListMetaAction<T> : ProListMeta<T>;
};
export type GetComponentProps<RecordType> = (record: RecordType, index: number) => React.HTMLAttributes<HTMLElement>;
export type ProListProps<RecordType = any, Params = Record<string, any>, ValueType = 'text'> = Omit<ProTableProps<RecordType, Params, ValueType>, 'size' | 'footer'> & AntdListProps<RecordType> & {
tooltip?: LabelTooltipType | string;
metas?: ProListMetas<RecordType>;
showActions?: 'hover' | 'always';
showExtra?: 'hover' | 'always';
onRow?: GetComponentProps<RecordType>;
onItem?: GetComponentProps<RecordType>;
itemCardProps?: CheckCardProps;
rowClassName?: string | ((item: RecordType, index: number) => string);
itemHeaderRender?: ItemProps<RecordType>['itemHeaderRender'];
itemTitleRender?: ItemProps<RecordType>['itemTitleRender'];
};
export type Key = React.Key;
export type TriggerEventHandler<RecordType> = (record: RecordType) => void;
declare function BaseProList<RecordType extends Record<string, any>, U extends Record<string, any> = Record<string, any>>(props: ProListProps<RecordType, U>): import("react/jsx-runtime").JSX.Element;
declare function ProList<RecordType extends Record<string, any>, U extends Record<string, any> = Record<string, any>>(props: ProListProps<RecordType, U>): import("react/jsx-runtime").JSX.Element;
export { BaseProList, ProList };
export default ProList;

147
node_modules/@ant-design/pro-list/es/index.js generated vendored Normal file
View File

@@ -0,0 +1,147 @@
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["metas", "split", "footer", "rowKey", "tooltip", "className", "options", "search", "expandable", "showActions", "showExtra", "rowSelection", "pagination", "itemLayout", "renderItem", "grid", "itemCardProps", "onRow", "onItem", "rowClassName", "locale", "itemHeaderRender", "itemTitleRender"];
import { ProConfigProvider } from '@ant-design/pro-provider';
import ProTable from '@ant-design/pro-table';
import { ConfigProvider } from 'antd';
import classNames from 'classnames';
import React, { useContext, useImperativeHandle, useMemo, useRef } from 'react';
import ListView from "./ListView";
import { useStyle } from "./style/index";
// 兼容性代码
import "antd/es/list/style";
import { jsx as _jsx } from "react/jsx-runtime";
function NoProVideProList(props) {
var metals = props.metas,
split = props.split,
footer = props.footer,
rowKey = props.rowKey,
tooltip = props.tooltip,
className = props.className,
_props$options = props.options,
options = _props$options === void 0 ? false : _props$options,
_props$search = props.search,
search = _props$search === void 0 ? false : _props$search,
expandable = props.expandable,
showActions = props.showActions,
showExtra = props.showExtra,
_props$rowSelection = props.rowSelection,
propRowSelection = _props$rowSelection === void 0 ? false : _props$rowSelection,
_props$pagination = props.pagination,
propsPagination = _props$pagination === void 0 ? false : _props$pagination,
itemLayout = props.itemLayout,
renderItem = props.renderItem,
grid = props.grid,
itemCardProps = props.itemCardProps,
onRow = props.onRow,
onItem = props.onItem,
rowClassName = props.rowClassName,
locale = props.locale,
itemHeaderRender = props.itemHeaderRender,
itemTitleRender = props.itemTitleRender,
rest = _objectWithoutProperties(props, _excluded);
var actionRef = useRef();
useImperativeHandle(rest.actionRef, function () {
return actionRef.current;
}, [actionRef.current]);
var _useContext = useContext(ConfigProvider.ConfigContext),
getPrefixCls = _useContext.getPrefixCls;
var proTableColumns = useMemo(function () {
var columns = [];
Object.keys(metals || {}).forEach(function (key) {
var meta = metals[key] || {};
var valueType = meta.valueType;
if (!valueType) {
// 根据 key 给不同的 valueType
if (key === 'avatar') {
valueType = 'avatar';
}
if (key === 'actions') {
valueType = 'option';
}
if (key === 'description') {
valueType = 'textarea';
}
}
columns.push(_objectSpread(_objectSpread({
listKey: key,
dataIndex: (meta === null || meta === void 0 ? void 0 : meta.dataIndex) || key
}, meta), {}, {
valueType: valueType
}));
});
return columns;
}, [metals]);
var prefixCls = getPrefixCls('pro-list', props.prefixCls);
var _useStyle = useStyle(prefixCls),
wrapSSR = _useStyle.wrapSSR,
hashId = _useStyle.hashId;
var listClassName = classNames(prefixCls, hashId, _defineProperty({}, "".concat(prefixCls, "-no-split"), !split));
return wrapSSR( /*#__PURE__*/_jsx(ProTable, _objectSpread(_objectSpread({
tooltip: tooltip
}, rest), {}, {
actionRef: actionRef,
pagination: propsPagination,
type: "list",
rowSelection: propRowSelection,
search: search,
options: options,
className: classNames(prefixCls, className, listClassName),
columns: proTableColumns,
rowKey: rowKey,
tableViewRender: function tableViewRender(_ref) {
var columns = _ref.columns,
size = _ref.size,
pagination = _ref.pagination,
rowSelection = _ref.rowSelection,
dataSource = _ref.dataSource,
loading = _ref.loading;
return /*#__PURE__*/_jsx(ListView, {
grid: grid,
itemCardProps: itemCardProps,
itemTitleRender: itemTitleRender,
prefixCls: props.prefixCls,
columns: columns,
renderItem: renderItem,
actionRef: actionRef,
dataSource: dataSource || [],
size: size,
footer: footer,
split: split,
rowKey: rowKey,
expandable: expandable,
rowSelection: propRowSelection === false ? undefined : rowSelection,
showActions: showActions,
showExtra: showExtra,
pagination: pagination,
itemLayout: itemLayout,
loading: loading,
itemHeaderRender: itemHeaderRender,
onRow: onRow,
onItem: onItem,
rowClassName: rowClassName,
locale: locale
});
}
})));
}
function BaseProList(props) {
return /*#__PURE__*/_jsx(ProConfigProvider, {
needDeps: true,
children: /*#__PURE__*/_jsx(NoProVideProList, _objectSpread({
cardProps: false,
search: false,
toolBarRender: false
}, props))
});
}
function ProList(props) {
return /*#__PURE__*/_jsx(ProConfigProvider, {
needDeps: true,
children: /*#__PURE__*/_jsx(NoProVideProList, _objectSpread({}, props))
});
}
export { BaseProList, ProList };
export default ProList;

10
node_modules/@ant-design/pro-list/es/style/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,10 @@
/// <reference types="react" />
import type { ProAliasToken } from '@ant-design/pro-provider';
export interface ProListToken extends ProAliasToken {
componentCls: string;
}
export declare const techUiListActive: any;
export declare function useStyle(prefixCls: string): {
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
hashId: string;
};

233
node_modules/@ant-design/pro-list/es/style/index.js generated vendored Normal file
View File

@@ -0,0 +1,233 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import { Keyframes } from '@ant-design/cssinjs';
import { useStyle as useAntdStyle } from '@ant-design/pro-provider';
export var techUiListActive = new Keyframes('techUiListActive', {
'0%': {
backgroundColor: 'unset'
},
'30%': {
background: '#fefbe6'
},
'100%': {
backgroundColor: 'unset'
}
});
var genProListStyle = function genProListStyle(token) {
var _row;
return _defineProperty({}, token.componentCls, _defineProperty(_defineProperty({
backgroundColor: 'transparent'
}, "".concat(token.proComponentsCls, "-table-alert"), {
marginBlockEnd: '16px'
}), '&-row', (_row = {
borderBlockEnd: "1px solid ".concat(token.colorSplit)
}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_row, "".concat(token.antCls, "-list-item-meta-title"), {
borderBlockEnd: 'none',
margin: 0
}), '&:last-child', _defineProperty({
borderBlockEnd: 'none'
}, "".concat(token.antCls, "-list-item"), {
borderBlockEnd: 'none'
})), '&:hover', _defineProperty(_defineProperty(_defineProperty(_defineProperty({
backgroundColor: 'rgba(0, 0, 0, 0.02)',
transition: 'background-color 0.3s'
}, "".concat(token.antCls, "-list-item-action"), {
display: 'block'
}), "".concat(token.antCls, "-list-item-extra"), {
display: 'flex'
}), "".concat(token.componentCls, "-row-extra"), {
display: 'block'
}), "".concat(token.componentCls, "-row-subheader-actions"), {
display: 'block'
})), '&-card', _defineProperty({
marginBlock: 8,
marginInline: 0,
paddingBlock: 0,
paddingInline: 8,
'&:hover': {
backgroundColor: 'transparent'
}
}, "".concat(token.antCls, "-list-item-meta-title"), {
flexShrink: 9,
marginBlock: 0,
marginInline: 0,
lineHeight: '22px'
})), "&".concat(token.componentCls, "-row-editable"), _defineProperty({}, "".concat(token.componentCls, "-list-item"), {
'&-meta': {
'&-avatar,&-description,&-title': {
paddingBlock: 6,
paddingInline: 0,
'&-editable': {
paddingBlock: 0
}
}
},
'&-action': {
display: 'block'
}
})), "&".concat(token.componentCls, "-row-selected"), {
backgroundColor: token.colorPrimaryBgHover,
'&:hover': {
backgroundColor: token.colorPrimaryBgHover
}
}), "&".concat(token.componentCls, "-row-type-new"), {
animationName: techUiListActive,
animationDuration: '3s'
}), "&".concat(token.componentCls, "-row-type-inline"), _defineProperty({}, "".concat(token.componentCls, "-row-title"), {
fontWeight: 'normal'
})), "&".concat(token.componentCls, "-row-type-top"), {
backgroundImage: "url('https://gw.alipayobjects.com/zos/antfincdn/DehQfMbOJb/icon.svg')",
backgroundRepeat: 'no-repeat',
backgroundPosition: 'left top',
backgroundSize: '12px 12px'
}), '&-show-action-hover', _defineProperty({}, "".concat(token.antCls, "-list-item-action,\n ").concat(token.proComponentsCls, "-card-extra,\n ").concat(token.proComponentsCls, "-card-actions"), {
display: 'flex'
})), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_row, '&-show-extra-hover', _defineProperty({}, "".concat(token.antCls, "-list-item-extra"), {
display: 'none'
})), '&-extra', {
display: 'none'
}), '&-subheader', {
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
height: '44px',
paddingInline: 24,
paddingBlock: 0,
color: token.colorTextSecondary,
lineHeight: '44px',
background: 'rgba(0, 0, 0, 0.02)',
'&-actions': {
display: 'none'
},
'&-actions *': {
marginInlineEnd: 8,
'&:last-child': {
marginInlineEnd: 0
}
}
}), '&-expand-icon', {
marginInlineEnd: 8,
display: 'flex',
fontSize: 12,
cursor: 'pointer',
height: '24px',
marginRight: 4,
color: token.colorTextSecondary,
'> .anticon > svg': {
transition: '0.3s'
}
}), '&-expanded', {
' > .anticon > svg': {
transform: 'rotate(90deg)'
}
}), '&-title', {
marginInlineEnd: '16px',
wordBreak: 'break-all',
cursor: 'pointer',
'&-editable': {
paddingBlock: 8
},
'&:hover': {
color: token.colorPrimary
}
}), '&-content', {
position: 'relative',
display: 'flex',
flex: '1',
flexDirection: 'column',
marginBlock: 0,
marginInline: 32
}), '&-subTitle', {
color: 'rgba(0, 0, 0, 0.45)',
'&-editable': {
paddingBlock: 8
}
}), '&-description', {
marginBlockStart: '4px',
wordBreak: 'break-all'
}), '&-avatar', {
display: 'flex'
}), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_row, '&-header', {
display: 'flex',
flex: '1',
justifyContent: 'flex-start',
h4: {
margin: 0,
padding: 0
}
}), '&-header-container', {
display: 'flex',
alignItems: 'center',
justifyContent: 'flex-start'
}), '&-header-option', {
display: 'flex'
}), '&-checkbox', {
width: '16px',
marginInlineEnd: '12px'
}), '&-no-split', _defineProperty(_defineProperty({}, "".concat(token.componentCls, "-row"), {
borderBlockEnd: 'none'
}), "".concat(token.antCls, "-list ").concat(token.antCls, "-list-item"), {
borderBlockEnd: 'none'
})), '&-bordered', _defineProperty({}, "".concat(token.componentCls, "-toolbar"), {
borderBlockEnd: "1px solid ".concat(token.colorSplit)
})), "".concat(token.antCls, "-list-vertical"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(token.componentCls, "-row"), {
borderBlockEnd: '12px 18px 12px 24px'
}), '&-header-title', {
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
justifyContent: 'center'
}), '&-content', {
marginBlock: 0,
marginInline: 0
}), '&-subTitle', {
marginBlockStart: 8
}), "".concat(token.antCls, "-list-item-extra"), _defineProperty({
display: 'flex',
alignItems: 'center',
marginInlineStart: '32px'
}, "".concat(token.componentCls, "-row-description"), {
marginBlockStart: 16
})), "".concat(token.antCls, "-list-bordered ").concat(token.antCls, "-list-item"), {
paddingInline: 0
}), "".concat(token.componentCls, "-row-show-extra-hover"), _defineProperty({}, "".concat(token.antCls, "-list-item-extra "), {
display: 'none'
}))), "".concat(token.antCls, "-list-pagination"), {
marginBlockStart: token.margin,
marginBlockEnd: token.margin
}), "".concat(token.antCls, "-list-list"), {
'&-item': {
cursor: 'pointer',
paddingBlock: 12,
paddingInline: 12
}
}), "".concat(token.antCls, "-list-vertical ").concat(token.proComponentsCls, "-list-row"), _defineProperty({
'&-header': {
paddingBlock: 0,
paddingInline: 0,
borderBlockEnd: 'none'
}
}, "".concat(token.antCls, "-list-item"), _defineProperty(_defineProperty(_defineProperty({
width: '100%',
paddingBlock: 12,
paddingInlineStart: 24,
paddingInlineEnd: 18
}, "".concat(token.antCls, "-list-item-meta-avatar"), {
display: 'flex',
alignItems: 'center',
marginInlineEnd: 8
}), "".concat(token.antCls, "-list-item-action-split"), {
display: 'none'
}), "".concat(token.antCls, "-list-item-meta-title"), {
marginBlock: 0,
marginInline: 0
}))))));
};
export function useStyle(prefixCls) {
return useAntdStyle('ProList', function (token) {
var proListToken = _objectSpread(_objectSpread({}, token), {}, {
componentCls: ".".concat(prefixCls)
});
return [genProListStyle(proListToken)];
});
}