Update from Vibe Studio

This commit is contained in:
Vibe Studio
2026-01-16 01:51:36 +00:00
parent a4605e311a
commit 58905d02c2
28599 changed files with 2179074 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import React from 'react';
import type { CardProps } from '../../typing';
import Divider from '../Divider';
import Operation from '../Operation';
import type { StatisticProps } from '../Statistic';
import Statistic from '../Statistic';
import 'antd/lib/divider/style';
import 'antd/lib/statistic/style';
export type StatisticCardProps = {
/** 图表配置 */
chart?: React.ReactNode;
/** 数值统计配置 */
statistic?: StatisticProps;
/** Chart 相对于 statistic 的位置 */
chartPlacement?: 'right' | 'bottom' | 'left';
/** 底部额外展示区域 */
footer?: React.ReactNode;
} & CardProps;
/** @deprecated */
export type StatisticsCardProps = StatisticCardProps;
declare const StatisticCard: React.FC<StatisticCardProps> & {
Statistic: typeof Statistic;
Divider: typeof Divider;
Operation: typeof Operation;
isProCard: boolean;
Group: typeof Group;
};
declare const Group: React.FC<StatisticCardProps>;
export default StatisticCard;

View File

@@ -0,0 +1,76 @@
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 = ["children", "statistic", "className", "chart", "chartPlacement", "footer"];
import { ConfigProvider } from 'antd';
import classNames from 'classnames';
import React, { useContext } from 'react';
import Card from "../Card";
import Divider from "../Divider";
import Operation from "../Operation";
import Statistic from "../Statistic";
import { useStyle } from "./style";
import "antd/es/divider/style";
import "antd/es/statistic/style";
/** @deprecated */
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
var StatisticCard = function StatisticCard(props) {
var children = props.children,
statistic = props.statistic,
className = props.className,
chart = props.chart,
chartPlacement = props.chartPlacement,
footer = props.footer,
others = _objectWithoutProperties(props, _excluded);
var _useContext = useContext(ConfigProvider.ConfigContext),
getPrefixCls = _useContext.getPrefixCls;
var prefixCls = getPrefixCls('pro-statistic-card');
var _useStyle = useStyle(prefixCls),
wrapSSR = _useStyle.wrapSSR,
hashId = _useStyle.hashId;
var classString = classNames(prefixCls, className, hashId);
// 在 StatisticCard 中时默认为 vertical。
var statisticDom = statistic && /*#__PURE__*/_jsx(Statistic, _objectSpread({
layout: "vertical"
}, statistic));
var chartCls = classNames("".concat(prefixCls, "-chart"), hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-chart-left"), chartPlacement === 'left' && chart && statistic), "".concat(prefixCls, "-chart-right"), chartPlacement === 'right' && chart && statistic));
var chartDom = chart && /*#__PURE__*/_jsx("div", {
className: chartCls,
children: chart
});
var contentCls = classNames("".concat(prefixCls, "-content "), hashId, _defineProperty({}, "".concat(prefixCls, "-content-horizontal"), chartPlacement === 'left' || chartPlacement === 'right'));
// 默认上下结构
var contentDom = (chartDom || statisticDom) && (chartPlacement === 'left' ? /*#__PURE__*/_jsxs("div", {
className: contentCls,
children: [chartDom, statisticDom]
}) : /*#__PURE__*/_jsxs("div", {
className: contentCls,
children: [statisticDom, chartDom]
}));
var footerDom = footer && /*#__PURE__*/_jsx("div", {
className: "".concat(prefixCls, "-footer ").concat(hashId).trim(),
children: footer
});
return wrapSSR( /*#__PURE__*/_jsxs(Card, _objectSpread(_objectSpread({
className: classString
}, others), {}, {
children: [contentDom, children, footerDom]
})));
};
var Group = function Group(props) {
return /*#__PURE__*/_jsx(StatisticCard, _objectSpread({
bodyStyle: {
padding: 0
}
}, props));
};
StatisticCard.Statistic = Statistic;
StatisticCard.Divider = Divider;
StatisticCard.Operation = Operation;
StatisticCard.isProCard = true;
StatisticCard.Group = Group;
export default StatisticCard;

View File

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

View File

@@ -0,0 +1,44 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import { useStyle as useAntdStyle } from '@ant-design/pro-provider';
var genProStyle = function genProStyle(token) {
return _defineProperty({}, token.componentCls, {
'&-chart': {
display: 'flex',
flexDirection: 'column',
marginBlockStart: 8,
marginBlockEnd: 8,
'&-left': {
marginBlockStart: 0,
marginInlineEnd: '16px'
},
'&-right': {
marginBlockStart: 0,
marginInlineStart: '16px'
}
},
'&-content': {
display: 'flex',
flexDirection: 'column',
'&-horizontal': _defineProperty({
flexDirection: 'row'
}, "".concat(token.componentCls, "-chart"), {
alignItems: 'center',
alignSelf: 'flex-start'
})
},
'&-footer': {
marginBlockStart: 8,
paddingBlockStart: '16px',
borderBlockStart: "rgba(0, 0, 0, 0.08) solid ".concat(token.colorBorder)
}
});
};
export function useStyle(prefixCls) {
return useAntdStyle('StatisticCard', function (token) {
var proListToken = _objectSpread(_objectSpread({}, token), {}, {
componentCls: ".".concat(prefixCls)
});
return [genProStyle(proListToken)];
});
}