@antdv-next1/pro-card 2.0.18 → 2.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Card.js CHANGED
@@ -3,8 +3,8 @@ import { Fragment, cloneVNode, computed, createVNode, defineComponent, isVNode,
3
3
  import { LabelIconTip, childrenToArray, isSpecialNode } from "@antdv-next1/pro-utils";
4
4
  import { classNames } from "@v-c/util";
5
5
  import { BorderBeam, Card, Col, Collapse, Row, useBreakpoint } from "antdv-next";
6
+ import { useConfig } from "antdv-next/config-provider/context";
6
7
  import { responsiveArray } from "antdv-next/dist/_util/responsiveObserver";
7
- import { useConfig } from "antdv-next/dist/config-provider/context";
8
8
  //#region src/Card.tsx
9
9
  function _isSlot(s) {
10
10
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
package/dist/ProCard.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import InternalProCard from "./Card.js";
2
2
  import { createVNode, defineComponent, mergeProps } from "vue";
3
3
  import { CardGrid, CardMeta } from "antdv-next";
4
- import ProConfigProvider from "@antdv-next1/pro-provider";
4
+ import { ProConfigProvider } from "@antdv-next1/pro-provider";
5
5
  //#region src/ProCard.tsx
6
6
  const ProCard = /* @__PURE__ */ defineComponent((props, { slots, expose, attrs }) => {
7
7
  expose({});
@@ -27,7 +27,7 @@ declare const _ProCheckCard: _$vue.DefineSetupFnComponent<ProCheckCardProps, {},
27
27
  extra?: () => VueNode[];
28
28
  cover?: () => VueNode[];
29
29
  description?: () => VNode[];
30
- }>, CardMetaProps & Omit<CardProps, "size" | "title" | "type" | "headStyle" | "bodyStyle" | "tabList" | "tabBarExtraContent" | "activeTabKey" | "defaultActiveTabKey" | "onTabChange"> & {
30
+ }>, CardMetaProps & Omit<CardProps, "size" | "title" | "onTabChange" | "activeTabKey" | "defaultActiveTabKey" | "headStyle" | "bodyStyle" | "tabBarExtraContent" | "tabList" | "type"> & {
31
31
  /** 边框流光 */borderBeam?: BorderBeamProps | boolean;
32
32
  size?: CardProps["size"] | "large";
33
33
  checked?: boolean;
@@ -3,9 +3,9 @@ import ProCheckCardGroup, { useCheckCardGroupContextInject } from "./Group.js";
3
3
  import style_default from "./style/index.js";
4
4
  import { Fragment, computed, createVNode, defineComponent, mergeProps, reactive, ref, toRef } from "vue";
5
5
  import { isImg, isNil, isUrl, transformVueNodeType, useEffect, useMountMergeState } from "@antdv-next1/pro-utils";
6
- import { classNames } from "@v-c/util";
6
+ import { classNames, omit } from "@v-c/util";
7
7
  import { Avatar, CardMeta } from "antdv-next";
8
- import { useConfig } from "antdv-next/dist/config-provider/context";
8
+ import { useConfig } from "antdv-next/config-provider/context";
9
9
  //#region src/components/CheckCard/CheckCard.tsx
10
10
  function getSizeCls(size) {
11
11
  if (size === "large") return "lg";
@@ -68,7 +68,7 @@ const ProCheckCard = /* @__PURE__ */ defineComponent((props, { slots, attrs }) =
68
68
  "src": avatar
69
69
  }, null) : transformVueNodeType(avatar);
70
70
  const headerDom = isNil(titleDom ?? extraDom) ? null : createVNode(Fragment, null, [titleDom && createVNode("div", { "class": classNames(`${baseClassName.value}-meta-header`, hashId.value, cssVarCls.value) }, [createVNode("div", { "class": classNames(`${baseClassName.value}-meta-title`, `${baseClassName.value}-meta-title-with-ellipsis`, hashId.value, cssVarCls.value) }, [titleDom])]), extraDom && createVNode("div", { "class": classNames(`${baseClassName.value}-meta-title-extra`, hashId.value, cssVarCls.value) }, [extraDom])]);
71
- return createVNode(ProCard, mergeProps({
71
+ return createVNode(ProCard, mergeProps(omit(attrs, ["style", "class"]), {
72
72
  "style": attrs.style,
73
73
  "class": classNames(baseClassName.value, attrs.class, hashId.value, cssVarCls.value, {
74
74
  [`${baseClassName.value}-checked`]: propsChecked,
@@ -1,11 +1,11 @@
1
1
  import ProCard from "../../ProCard.js";
2
2
  import group_default from "./style/group.js";
3
3
  import ProCheckCard from "./CheckCard.js";
4
- import { computed, createVNode, defineComponent, inject, provide, shallowRef, toRef } from "vue";
4
+ import { computed, createVNode, defineComponent, inject, mergeProps, provide, shallowRef, toRef } from "vue";
5
5
  import { childrenToArray, isSpecialNode, useMountMergeState } from "@antdv-next1/pro-utils";
6
- import { classNames } from "@v-c/util";
7
- import { useConfig } from "antdv-next/dist/config-provider/context";
8
- import { ProConfigProvider as ProConfigProvider$1 } from "@antdv-next1/pro-provider";
6
+ import { classNames, omit } from "@v-c/util";
7
+ import { useConfig } from "antdv-next/config-provider/context";
8
+ import { ProConfigProvider } from "@antdv-next1/pro-provider";
9
9
  //#region src/components/CheckCard/Group.tsx
10
10
  /**
11
11
  * Represents the possible value types for a CheckGroup.
@@ -61,7 +61,7 @@ const InternalCheckCardGroup = /* @__PURE__ */ defineComponent((props, { slots,
61
61
  "title": option.title,
62
62
  "style": { flex: "0 0 100%" }
63
63
  }, { default: () => renderOptions(option?.children) });
64
- return createVNode(ProCheckCard, {
64
+ return createVNode(ProCheckCard, mergeProps(omit(attrs, ["class", "style"]), {
65
65
  "key": option.value.toString(),
66
66
  "disabled": option.disabled,
67
67
  "size": option.size ?? props.size,
@@ -72,7 +72,7 @@ const InternalCheckCardGroup = /* @__PURE__ */ defineComponent((props, { slots,
72
72
  "avatar": option.avatar,
73
73
  "description": option.description,
74
74
  "cover": option.cover
75
- }, null);
75
+ }), null);
76
76
  });
77
77
  };
78
78
  return renderOptions(getOptions(props.options));
@@ -112,7 +112,7 @@ const InternalCheckCardGroup = /* @__PURE__ */ defineComponent((props, { slots,
112
112
  cancelValue
113
113
  })));
114
114
  return () => createVNode("div", {
115
- "class": classNames(baseClassName.value, hashId.value, cssVarCls.value),
115
+ "class": classNames(baseClassName.value, attrs.class, hashId.value, cssVarCls.value),
116
116
  "style": attrs.style
117
117
  }, [children.value]);
118
118
  }, {
@@ -178,6 +178,6 @@ const InternalCheckCardGroup = /* @__PURE__ */ defineComponent((props, { slots,
178
178
  name: "InternalCheckCardGroup",
179
179
  inheritAttrs: false
180
180
  });
181
- const ProCheckCardGroup = (props, { slots }) => createVNode(ProConfigProvider$1, { "needDeps": true }, { default: () => [createVNode(InternalCheckCardGroup, props, slots)] });
181
+ const ProCheckCardGroup = (props, { slots }) => createVNode(ProConfigProvider, { "needDeps": true }, { default: () => [createVNode(InternalCheckCardGroup, props, slots)] });
182
182
  //#endregion
183
183
  export { checkCardGroupContextKey, ProCheckCardGroup as default, useCheckCardGroupContextInject, useCheckCardGroupContextProvider };
@@ -1,12 +1,12 @@
1
1
  import * as _$vue from "vue";
2
2
  import { VNode } from "vue";
3
3
  import { VueNode } from "@v-c/util";
4
- import { BadgeProps, StatisticProps as StatisticProps$1, TooltipProps } from "antdv-next";
4
+ import { BadgeProps, StatisticProps, TooltipProps } from "antdv-next";
5
5
  import { CustomSlotsType } from "@v-c/util/dist/type";
6
6
  import * as _$antdv_next_dist_statistic_Statistic0 from "antdv-next/dist/statistic/Statistic";
7
7
 
8
8
  //#region src/components/Statistic/index.d.ts
9
- type StatisticProps = StatisticProps$1 & {
9
+ type ProStatisticProps = StatisticProps & {
10
10
  /** 描述性标签 */description?: VueNode; /** 标题提示 */
11
11
  tooltip?: TooltipProps & {
12
12
  icon?: VueNode;
@@ -16,7 +16,7 @@ type StatisticProps = StatisticProps$1 & {
16
16
  layout?: 'horizontal' | 'vertical' | 'inline'; /** 趋势 */
17
17
  trend?: 'up' | 'down';
18
18
  };
19
- declare const Statistic: _$vue.DefineSetupFnComponent<StatisticProps, {}, CustomSlotsType<{
19
+ declare const ProStatistic: _$vue.DefineSetupFnComponent<ProStatisticProps, {}, CustomSlotsType<{
20
20
  default?: () => VNode[];
21
21
  }>, _$antdv_next_dist_statistic_Statistic0.InternalStatisticProps & {
22
22
  /** 描述性标签 */description?: VueNode; /** 标题提示 */
@@ -29,4 +29,4 @@ declare const Statistic: _$vue.DefineSetupFnComponent<StatisticProps, {}, Custom
29
29
  trend?: "up" | "down";
30
30
  } & {}, _$vue.PublicProps>;
31
31
  //#endregion
32
- export { StatisticProps, Statistic as default };
32
+ export { ProStatisticProps, ProStatistic as default };
@@ -1,15 +1,16 @@
1
1
  import style_default from "./style/index.js";
2
2
  import { Fragment, computed, createVNode, defineComponent, mergeProps } from "vue";
3
- import { classNames } from "@v-c/util";
4
- import { Badge, Statistic as Statistic$1, Tooltip } from "antdv-next";
5
- import { useConfig } from "antdv-next/dist/config-provider/context";
3
+ import { classNames, omit } from "@v-c/util";
4
+ import { Badge, Statistic, Tooltip } from "antdv-next";
5
+ import { useConfig } from "antdv-next/config-provider/context";
6
6
  import { QuestionCircleOutlined } from "@antdv-next/icons";
7
7
  //#region src/components/Statistic/index.tsx
8
- const Statistic = /* @__PURE__ */ defineComponent((props, { attrs }) => {
8
+ const ProStatistic = /* @__PURE__ */ defineComponent((props, { attrs, expose }) => {
9
9
  const config = useConfig();
10
10
  const prefixCls = computed(() => props.prefixCls || config.value.getPrefixCls("pro"));
11
11
  const baseClassName = computed(() => `${prefixCls.value}-card-statistic`);
12
12
  const [hashId, cssVarCls] = style_default(baseClassName);
13
+ expose({});
13
14
  return () => {
14
15
  const { layout = "inline", description, title, tooltip, status, trend, prefix, icon, ...rest } = props;
15
16
  const tooltipDom = tooltip && createVNode(Tooltip, { "title": tooltip }, { default: () => [createVNode(QuestionCircleOutlined, { "class": classNames(`${baseClassName.value}-tip`, hashId.value, cssVarCls.value) }, null)] });
@@ -20,7 +21,7 @@ const Statistic = /* @__PURE__ */ defineComponent((props, { attrs }) => {
20
21
  }, [icon && createVNode("div", { "class": classNames(`${baseClassName.value}-icon`, hashId.value, cssVarCls.value) }, [icon]), createVNode("div", { "class": classNames(`${baseClassName.value}-wrapper`, hashId.value, cssVarCls.value) }, [status && createVNode("div", { "class": classNames(`${baseClassName.value}-status`, hashId.value, cssVarCls.value) }, [createVNode(Badge, {
21
22
  "status": status,
22
23
  "text": null
23
- }, null)]), createVNode("div", { "class": classNames(`${baseClassName.value}-content`, hashId.value, cssVarCls.value) }, [createVNode(Statistic$1, mergeProps({
24
+ }, null)]), createVNode("div", { "class": classNames(`${baseClassName.value}-content`, hashId.value, cssVarCls.value) }, [createVNode(Statistic, mergeProps(omit(attrs, ["class", "style"]), {
24
25
  "title": (title || tooltipDom) && createVNode(Fragment, null, [title, tooltipDom]),
25
26
  "prefix": (trendDom || prefix) && createVNode(Fragment, null, [trendDom, prefix]),
26
27
  "class": classNames(hashId.value, cssVarCls.value, {
@@ -182,4 +183,4 @@ const Statistic = /* @__PURE__ */ defineComponent((props, { attrs }) => {
182
183
  inheritAttrs: false
183
184
  });
184
185
  //#endregion
185
- export { Statistic as default };
186
+ export { ProStatistic as default };
@@ -53,7 +53,7 @@ const genProStatisticStyle = (token) => {
53
53
  }
54
54
  } };
55
55
  };
56
- var style_default = useStyle("Statistic", (token) => {
56
+ var style_default = useStyle("ProStatistic", (token) => {
57
57
  return [genProStatisticStyle(mergeToken(token, {}))];
58
58
  });
59
59
  //#endregion
@@ -1,6 +1,6 @@
1
1
  import { CollapsibleType } from "../../typing.js";
2
2
  import { ProCardProps } from "../../ProCard.js";
3
- import Statistic$1, { StatisticProps as StatisticProps$1 } from "../Statistic/index.js";
3
+ import ProStatistic, { ProStatisticProps } from "../Statistic/index.js";
4
4
  import * as _$vue from "vue";
5
5
  import { VNode } from "vue";
6
6
  import { VueNode } from "@v-c/util";
@@ -10,13 +10,13 @@ import { CustomSlotsType } from "@v-c/util/dist/type";
10
10
  import * as _$antdv_next_dist_grid_row0 from "antdv-next/dist/grid/row";
11
11
 
12
12
  //#region src/components/StatisticCard/index.d.ts
13
- type StatisticCardProps = ProCardProps & {
13
+ type ProStatisticCardProps = ProCardProps & {
14
14
  /** 图表配置 */chart?: VueNode; /** 数值统计配置 */
15
- statistic?: StatisticProps$1; /** Chart 相对于 statistic 的位置 */
15
+ statistic?: ProStatisticProps; /** Chart 相对于 statistic 的位置 */
16
16
  chartPlacement?: 'right' | 'bottom' | 'left'; /** 底部额外展示区域 */
17
17
  footer?: VueNode;
18
18
  };
19
- declare const _StatisticCard: _$vue.DefineSetupFnComponent<StatisticCardProps, {}, CustomSlotsType<{
19
+ declare const _ProStatisticCard: _$vue.DefineSetupFnComponent<ProStatisticCardProps, {}, CustomSlotsType<{
20
20
  default?: () => VNode[];
21
21
  }>, _$antdv_next0.CardProps & _$antdv_next0.RowProps & {
22
22
  tooltip?: _$antdv_next_dist_form_FormItemLabel0.FormItemTooltipType;
@@ -55,13 +55,13 @@ declare const _StatisticCard: _$vue.DefineSetupFnComponent<StatisticCardProps, {
55
55
  onClick?: (e: MouseEvent) => void;
56
56
  } & {
57
57
  /** 图表配置 */chart?: VueNode; /** 数值统计配置 */
58
- statistic?: StatisticProps$1; /** Chart 相对于 statistic 的位置 */
58
+ statistic?: ProStatisticProps; /** Chart 相对于 statistic 的位置 */
59
59
  chartPlacement?: "right" | "bottom" | "left"; /** 底部额外展示区域 */
60
60
  footer?: VueNode;
61
61
  } & {}, _$vue.PublicProps>;
62
- declare const StatisticCard: typeof _StatisticCard & {
62
+ declare const ProStatisticCard: typeof _ProStatisticCard & {
63
63
  isProCard?: boolean;
64
- Statistic?: typeof Statistic$1;
64
+ Statistic?: typeof ProStatistic;
65
65
  };
66
66
  //#endregion
67
- export { StatisticCardProps, StatisticCard as default };
67
+ export { ProStatisticCardProps, ProStatisticCard as default };
@@ -1,25 +1,26 @@
1
1
  import ProCard from "../../ProCard.js";
2
- import Statistic from "../Statistic/index.js";
2
+ import ProStatistic from "../Statistic/index.js";
3
3
  import style_default from "./style/index.js";
4
4
  import { Fragment, computed, createVNode, defineComponent, mergeProps } from "vue";
5
5
  import { classNames } from "@v-c/util";
6
- import { useConfig } from "antdv-next/dist/config-provider/context";
6
+ import { useConfig } from "antdv-next/config-provider/context";
7
7
  //#region src/components/StatisticCard/index.tsx
8
- const StatisticCard = /* @__PURE__ */ defineComponent((props, { attrs, slots }) => {
8
+ const ProStatisticCard = /* @__PURE__ */ defineComponent((props, { attrs, slots, expose }) => {
9
9
  const config = useConfig();
10
10
  const prefixCls = computed(() => props.prefixCls || config.value.getPrefixCls("pro"));
11
11
  const baseClassName = computed(() => `${prefixCls.value}-statistic-card`);
12
12
  const [hashId, cssVarCls] = style_default(baseClassName);
13
+ expose({});
13
14
  return () => {
14
15
  const { statistic, chart, chartPlacement, footer, ...restProps } = props;
15
- const statisticDom = statistic && createVNode(Statistic, mergeProps({ "layout": "vertical" }, statistic), null);
16
+ const statisticDom = statistic && createVNode(ProStatistic, mergeProps({ "layout": "vertical" }, statistic), null);
16
17
  const chartDom = chart && createVNode("div", { "class": classNames(`${baseClassName.value}-chart`, hashId.value, cssVarCls.value, {
17
18
  [`${baseClassName.value}-chart-left`]: chartPlacement === "left" && chart && statistic,
18
19
  [`${baseClassName.value}-chart-right`]: chartPlacement === "right" && chart && statistic
19
20
  }) }, [chart]);
20
21
  const contentCls = classNames(`${baseClassName.value}-content `, hashId.value, cssVarCls.value, { [`${baseClassName.value}-content-horizontal`]: chartPlacement === "left" || chartPlacement === "right" });
21
22
  const contentDom = (chartDom || statisticDom) && (chartPlacement === "left" ? createVNode("div", { "class": contentCls }, [chartDom, statisticDom]) : createVNode("div", { "class": contentCls }, [statisticDom, chartDom]));
22
- return createVNode(Fragment, null, [createVNode(ProCard, mergeProps({
23
+ return createVNode(Fragment, null, [createVNode(ProCard, mergeProps(attrs, {
23
24
  "style": attrs.style,
24
25
  "class": classNames(baseClassName.value, attrs.class, hashId.value, cssVarCls.value)
25
26
  }, restProps), { default: () => [
@@ -314,10 +315,10 @@ const StatisticCard = /* @__PURE__ */ defineComponent((props, { attrs, slots })
314
315
  default: void 0
315
316
  }
316
317
  },
317
- name: "StatisticCard",
318
+ name: "ProStatisticCard",
318
319
  inheritAttrs: false
319
320
  });
320
- StatisticCard.isProCard = true;
321
- StatisticCard.Statistic = Statistic;
321
+ ProStatisticCard.isProCard = true;
322
+ ProStatisticCard.Statistic = ProStatistic;
322
323
  //#endregion
323
- export { StatisticCard as default };
324
+ export { ProStatisticCard as default };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import ProCard, { ProCardProps } from "./ProCard.js";
2
2
  import ProCheckCardGroup, { CheckCardGroupContextType, CheckCardItemGroupType, CheckCardItemType, CheckCardOptionType, CheckCardValueType, CheckGroupValueType, ProCheckCardGroupProps } from "./components/CheckCard/Group.js";
3
3
  import ProCheckCard, { ProCheckCardProps } from "./components/CheckCard/CheckCard.js";
4
- import Statistic, { StatisticProps } from "./components/Statistic/index.js";
5
- import StatisticCard, { StatisticCardProps } from "./components/StatisticCard/index.js";
6
- export { type CheckCardGroupContextType, type CheckCardItemGroupType, type CheckCardItemType, type CheckCardOptionType, type CheckCardValueType, type CheckGroupValueType, ProCard, type ProCardProps, ProCheckCard, ProCheckCardGroup, type ProCheckCardGroupProps, type ProCheckCardProps, Statistic, StatisticCard, type StatisticCardProps, type StatisticProps, ProCard as default };
4
+ import ProStatistic, { ProStatisticProps } from "./components/Statistic/index.js";
5
+ import ProStatisticCard, { ProStatisticCardProps } from "./components/StatisticCard/index.js";
6
+ export { type CheckCardGroupContextType, type CheckCardItemGroupType, type CheckCardItemType, type CheckCardOptionType, type CheckCardValueType, type CheckGroupValueType, ProCard, type ProCardProps, ProCheckCard, ProCheckCardGroup, type ProCheckCardGroupProps, type ProCheckCardProps, ProStatistic, ProStatisticCard, type ProStatisticCardProps, type ProStatisticProps, ProCard as default };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import ProCard from "./ProCard.js";
2
2
  import ProCheckCardGroup from "./components/CheckCard/Group.js";
3
3
  import ProCheckCard from "./components/CheckCard/CheckCard.js";
4
- import Statistic from "./components/Statistic/index.js";
5
- import StatisticCard from "./components/StatisticCard/index.js";
6
- export { ProCard, ProCheckCard, ProCheckCardGroup, Statistic, StatisticCard, ProCard as default };
4
+ import ProStatistic from "./components/Statistic/index.js";
5
+ import ProStatisticCard from "./components/StatisticCard/index.js";
6
+ export { ProCard, ProCheckCard, ProCheckCardGroup, ProStatistic, ProStatisticCard, ProCard as default };