yc-agent-ui 1.2.4 → 1.2.5
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/es/components/descriptions/index.d.ts +3 -3
- package/es/components/descriptions/src/index.vue.d.ts +1 -1
- package/es/components/dialog/index.d.ts +6 -6
- package/es/components/dialog/src/index.vue.d.ts +2 -2
- package/es/components/dialog-form/index.d.ts +2 -2
- package/es/components/dialog-form/src/index.vue.d.ts +2 -2
- package/es/components/display-item/index.d.ts +9 -9
- package/es/components/display-item/src/index.vue.d.ts +7 -7
- package/es/components/drawer-form/index.d.ts +20 -20
- package/es/components/drawer-form/src/index.vue.d.ts +8 -8
- package/es/components/form/index.d.ts +39 -39
- package/es/components/form/src/form-content.vue.d.ts +11 -11
- package/es/components/form/src/index.vue.d.ts +17 -17
- package/es/components/form-item/index.d.ts +61 -61
- package/es/components/form-item/src/index.vue.d.ts +22 -22
- package/es/components/index.d.ts +1 -0
- package/es/components/page/index.d.ts +850 -850
- package/es/components/page/src/index.vue.d.ts +286 -286
- package/es/components/popover/index.d.ts +9 -9
- package/es/components/popover/src/index.vue.d.ts +3 -3
- package/es/components/render/index.d.ts +1 -1
- package/es/components/render/src/index.vue.d.ts +1 -1
- package/es/components/search/index.d.ts +256 -256
- package/es/components/search/src/index.vue.d.ts +88 -88
- package/es/components/table/index.d.ts +9 -9
- package/es/components/table/src/index.vue.d.ts +1 -1
- package/es/components/table/src/table-column.vue.d.ts +22 -22
- package/es/components/utils/index.d.ts +1 -1
- package/es/components/yc-date-picker/src/date-picker.vue.d.ts +1 -1
- package/es/components/yc-display-cards/capability.d.ts +4 -0
- package/es/components/yc-display-cards/index.d.ts +24 -0
- package/es/components/yc-display-cards/src/detail-card.vue.d.ts +10 -0
- package/es/components/yc-display-cards/src/metrics-card.vue.d.ts +8 -0
- package/es/components/yc-display-cards/src/table-card.vue.d.ts +12 -0
- package/es/components/yc-display-cards/src/types.d.ts +47 -0
- package/es/components/yc-input/src/input.vue.d.ts +1 -1
- package/es/components/yc-input/src/money-input.vue.d.ts +1 -1
- package/es/components/yc-plus-page/src/index.vue.d.ts +858 -858
- package/es/components/yc-plus-tree/src/index.vue.d.ts +1 -1
- package/es/components/yc-questionnaire/src/index.vue.d.ts +1 -1
- package/es/components/yc-select-v2/src/index.vue.d.ts +1 -1
- package/es/components/yc-status-dialog/src/index.vue.d.ts +1 -1
- package/es/hooks/usePlusFormReset.d.ts +114 -114
- package/es/index.css +13 -10
- package/es/index.mjs +1 -0
- package/es/packages/components/index.mjs +1 -0
- package/es/packages/components/yc-ai-chat/src/question-card2.vue.mjs +240 -86
- package/es/packages/components/yc-display-cards/capability.mjs +75 -0
- package/es/packages/components/yc-display-cards/index.mjs +10 -0
- package/es/packages/components/yc-display-cards/src/detail-card.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/detail-card2.vue.mjs +118 -0
- package/es/packages/components/yc-display-cards/src/metrics-card.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/metrics-card2.vue.mjs +132 -0
- package/es/packages/components/yc-display-cards/src/table-card.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/table-card2.vue.mjs +199 -0
- package/es/packages/components/yc-display-cards/src/types.mjs +1 -0
- package/es/packages/registry/load.mjs +9 -8
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/index.css +4 -1
- package/index.js +1274 -595
- package/index.min.css +3 -0
- package/index.min.js +20 -20
- package/index.min.mjs +24 -24
- package/index.mjs +1270 -594
- package/lib/components/descriptions/index.d.ts +3 -3
- package/lib/components/descriptions/src/index.vue.d.ts +1 -1
- package/lib/components/dialog/index.d.ts +6 -6
- package/lib/components/dialog/src/index.vue.d.ts +2 -2
- package/lib/components/dialog-form/index.d.ts +2 -2
- package/lib/components/dialog-form/src/index.vue.d.ts +2 -2
- package/lib/components/display-item/index.d.ts +9 -9
- package/lib/components/display-item/src/index.vue.d.ts +7 -7
- package/lib/components/drawer-form/index.d.ts +20 -20
- package/lib/components/drawer-form/src/index.vue.d.ts +8 -8
- package/lib/components/form/index.d.ts +39 -39
- package/lib/components/form/src/form-content.vue.d.ts +11 -11
- package/lib/components/form/src/index.vue.d.ts +17 -17
- package/lib/components/form-item/index.d.ts +61 -61
- package/lib/components/form-item/src/index.vue.d.ts +22 -22
- package/lib/components/index.d.ts +1 -0
- package/lib/components/page/index.d.ts +850 -850
- package/lib/components/page/src/index.vue.d.ts +286 -286
- package/lib/components/popover/index.d.ts +9 -9
- package/lib/components/popover/src/index.vue.d.ts +3 -3
- package/lib/components/render/index.d.ts +1 -1
- package/lib/components/render/src/index.vue.d.ts +1 -1
- package/lib/components/search/index.d.ts +256 -256
- package/lib/components/search/src/index.vue.d.ts +88 -88
- package/lib/components/table/index.d.ts +9 -9
- package/lib/components/table/src/index.vue.d.ts +1 -1
- package/lib/components/table/src/table-column.vue.d.ts +22 -22
- package/lib/components/utils/index.d.ts +1 -1
- package/lib/components/yc-date-picker/src/date-picker.vue.d.ts +1 -1
- package/lib/components/yc-display-cards/capability.d.ts +4 -0
- package/lib/components/yc-display-cards/index.d.ts +24 -0
- package/lib/components/yc-display-cards/src/detail-card.vue.d.ts +10 -0
- package/lib/components/yc-display-cards/src/metrics-card.vue.d.ts +8 -0
- package/lib/components/yc-display-cards/src/table-card.vue.d.ts +12 -0
- package/lib/components/yc-display-cards/src/types.d.ts +47 -0
- package/lib/components/yc-input/src/input.vue.d.ts +1 -1
- package/lib/components/yc-input/src/money-input.vue.d.ts +1 -1
- package/lib/components/yc-plus-page/src/index.vue.d.ts +858 -858
- package/lib/components/yc-plus-tree/src/index.vue.d.ts +1 -1
- package/lib/components/yc-questionnaire/src/index.vue.d.ts +1 -1
- package/lib/components/yc-select-v2/src/index.vue.d.ts +1 -1
- package/lib/components/yc-status-dialog/src/index.vue.d.ts +1 -1
- package/lib/hooks/usePlusFormReset.d.ts +114 -114
- package/lib/index.css +12 -9
- package/lib/index.js +10 -6
- package/lib/packages/components/index.js +10 -6
- package/lib/packages/components/yc-ai-chat/src/question-card2.vue.js +239 -85
- package/lib/packages/components/yc-display-cards/capability.js +79 -0
- package/lib/packages/components/yc-display-cards/index.js +14 -0
- package/lib/packages/components/yc-display-cards/src/detail-card.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/detail-card2.vue.js +122 -0
- package/lib/packages/components/yc-display-cards/src/metrics-card.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/metrics-card2.vue.js +136 -0
- package/lib/packages/components/yc-display-cards/src/table-card.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/table-card2.vue.js +203 -0
- package/lib/packages/components/yc-display-cards/src/types.js +2 -0
- package/lib/packages/registry/load.js +9 -8
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/ja.js +1 -1
- package/locale/ja.min.js +1 -1
- package/locale/ja.min.mjs +1 -1
- package/locale/ja.mjs +1 -1
- package/locale/ko.js +1 -1
- package/locale/ko.min.js +1 -1
- package/locale/ko.min.mjs +1 -1
- package/locale/ko.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/locale/zh-tw.js +1 -1
- package/locale/zh-tw.min.js +1 -1
- package/locale/zh-tw.min.mjs +1 -1
- package/locale/zh-tw.mjs +1 -1
- package/package.json +1 -1
- package/theme-chalk/index.css +4 -1
- package/theme-chalk/plus-yc-ai-chat.css +1 -1
- package/theme-chalk/src/yc-ai-chat.scss +90 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createCommentVNode, normalizeClass, Fragment, renderList } from 'vue';
|
|
2
|
+
|
|
3
|
+
const _hoisted_1 = { class: "yc-display-card yc-display-detail-card" };
|
|
4
|
+
const _hoisted_2 = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "yc-display-card__header"
|
|
7
|
+
};
|
|
8
|
+
const _hoisted_3 = { class: "yc-display-card__title-wrap" };
|
|
9
|
+
const _hoisted_4 = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "yc-display-card__title"
|
|
12
|
+
};
|
|
13
|
+
const _hoisted_5 = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "yc-display-card__subtitle"
|
|
16
|
+
};
|
|
17
|
+
const _hoisted_6 = {
|
|
18
|
+
key: 1,
|
|
19
|
+
class: "yc-display-detail-card__fields"
|
|
20
|
+
};
|
|
21
|
+
const _hoisted_7 = {
|
|
22
|
+
key: 2,
|
|
23
|
+
class: "yc-display-card__empty"
|
|
24
|
+
};
|
|
25
|
+
const _hoisted_8 = {
|
|
26
|
+
key: 3,
|
|
27
|
+
class: "yc-display-detail-card__note"
|
|
28
|
+
};
|
|
29
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
30
|
+
...{ name: "YcDisplayDetailCard" },
|
|
31
|
+
__name: "detail-card",
|
|
32
|
+
props: {
|
|
33
|
+
title: { default: "" },
|
|
34
|
+
subtitle: { default: "" },
|
|
35
|
+
status: { default: void 0 },
|
|
36
|
+
fields: { default: () => [] },
|
|
37
|
+
note: { default: "" }
|
|
38
|
+
},
|
|
39
|
+
setup(__props) {
|
|
40
|
+
return (_ctx, _cache) => {
|
|
41
|
+
var _a, _b, _c;
|
|
42
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
43
|
+
__props.title || __props.subtitle || ((_a = __props.status) == null ? void 0 : _a.text) ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
44
|
+
createElementVNode("div", _hoisted_3, [
|
|
45
|
+
__props.title ? (openBlock(), createElementBlock(
|
|
46
|
+
"div",
|
|
47
|
+
_hoisted_4,
|
|
48
|
+
toDisplayString(__props.title),
|
|
49
|
+
1
|
|
50
|
+
/* TEXT */
|
|
51
|
+
)) : createCommentVNode("v-if", true),
|
|
52
|
+
__props.subtitle ? (openBlock(), createElementBlock(
|
|
53
|
+
"div",
|
|
54
|
+
_hoisted_5,
|
|
55
|
+
toDisplayString(__props.subtitle),
|
|
56
|
+
1
|
|
57
|
+
/* TEXT */
|
|
58
|
+
)) : createCommentVNode("v-if", true)
|
|
59
|
+
]),
|
|
60
|
+
((_b = __props.status) == null ? void 0 : _b.text) ? (openBlock(), createElementBlock(
|
|
61
|
+
"span",
|
|
62
|
+
{
|
|
63
|
+
key: 0,
|
|
64
|
+
class: normalizeClass(["yc-display-detail-card__status", `is-${(_c = __props.status.type) != null ? _c : "info"}`])
|
|
65
|
+
},
|
|
66
|
+
toDisplayString(__props.status.text),
|
|
67
|
+
3
|
|
68
|
+
/* TEXT, CLASS */
|
|
69
|
+
)) : createCommentVNode("v-if", true)
|
|
70
|
+
])) : createCommentVNode("v-if", true),
|
|
71
|
+
__props.fields.length ? (openBlock(), createElementBlock("dl", _hoisted_6, [
|
|
72
|
+
(openBlock(true), createElementBlock(
|
|
73
|
+
Fragment,
|
|
74
|
+
null,
|
|
75
|
+
renderList(__props.fields, (field, idx) => {
|
|
76
|
+
return openBlock(), createElementBlock(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
key: `${field.label}-${idx}`,
|
|
80
|
+
class: normalizeClass(["yc-display-detail-card__field", { "is-full": field.span === 2 }])
|
|
81
|
+
},
|
|
82
|
+
[
|
|
83
|
+
createElementVNode(
|
|
84
|
+
"dt",
|
|
85
|
+
null,
|
|
86
|
+
toDisplayString(field.label),
|
|
87
|
+
1
|
|
88
|
+
/* TEXT */
|
|
89
|
+
),
|
|
90
|
+
createElementVNode(
|
|
91
|
+
"dd",
|
|
92
|
+
null,
|
|
93
|
+
toDisplayString(field.value === void 0 || field.value === null || field.value === "" ? "\u2014" : field.value),
|
|
94
|
+
1
|
|
95
|
+
/* TEXT */
|
|
96
|
+
)
|
|
97
|
+
],
|
|
98
|
+
2
|
|
99
|
+
/* CLASS */
|
|
100
|
+
);
|
|
101
|
+
}),
|
|
102
|
+
128
|
|
103
|
+
/* KEYED_FRAGMENT */
|
|
104
|
+
))
|
|
105
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_7, "\u6682\u65E0\u53EF\u5C55\u793A\u7684\u8BE6\u60C5\u5B57\u6BB5")),
|
|
106
|
+
__props.note ? (openBlock(), createElementBlock(
|
|
107
|
+
"div",
|
|
108
|
+
_hoisted_8,
|
|
109
|
+
toDisplayString(__props.note),
|
|
110
|
+
1
|
|
111
|
+
/* TEXT */
|
|
112
|
+
)) : createCommentVNode("v-if", true)
|
|
113
|
+
]);
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createCommentVNode, Fragment, renderList, normalizeClass } from 'vue';
|
|
2
|
+
|
|
3
|
+
const _hoisted_1 = { class: "yc-display-card yc-display-metrics-card" };
|
|
4
|
+
const _hoisted_2 = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "yc-display-card__header"
|
|
7
|
+
};
|
|
8
|
+
const _hoisted_3 = { class: "yc-display-card__title-wrap" };
|
|
9
|
+
const _hoisted_4 = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "yc-display-card__title"
|
|
12
|
+
};
|
|
13
|
+
const _hoisted_5 = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "yc-display-card__subtitle"
|
|
16
|
+
};
|
|
17
|
+
const _hoisted_6 = {
|
|
18
|
+
key: 1,
|
|
19
|
+
class: "yc-display-metrics-card__grid"
|
|
20
|
+
};
|
|
21
|
+
const _hoisted_7 = { class: "yc-display-metrics-card__label" };
|
|
22
|
+
const _hoisted_8 = { class: "yc-display-metrics-card__value-row" };
|
|
23
|
+
const _hoisted_9 = { class: "yc-display-metrics-card__value" };
|
|
24
|
+
const _hoisted_10 = {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: "yc-display-metrics-card__unit"
|
|
27
|
+
};
|
|
28
|
+
const _hoisted_11 = {
|
|
29
|
+
key: 0,
|
|
30
|
+
class: "yc-display-metrics-card__meta"
|
|
31
|
+
};
|
|
32
|
+
const _hoisted_12 = {
|
|
33
|
+
key: 1,
|
|
34
|
+
class: "yc-display-metrics-card__desc"
|
|
35
|
+
};
|
|
36
|
+
const _hoisted_13 = {
|
|
37
|
+
key: 2,
|
|
38
|
+
class: "yc-display-card__empty"
|
|
39
|
+
};
|
|
40
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
41
|
+
...{ name: "YcDisplayMetricsCard" },
|
|
42
|
+
__name: "metrics-card",
|
|
43
|
+
props: {
|
|
44
|
+
title: { default: "" },
|
|
45
|
+
subtitle: { default: "" },
|
|
46
|
+
items: { default: () => [] }
|
|
47
|
+
},
|
|
48
|
+
setup(__props) {
|
|
49
|
+
return (_ctx, _cache) => {
|
|
50
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
51
|
+
__props.title || __props.subtitle ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
52
|
+
createElementVNode("div", _hoisted_3, [
|
|
53
|
+
__props.title ? (openBlock(), createElementBlock(
|
|
54
|
+
"div",
|
|
55
|
+
_hoisted_4,
|
|
56
|
+
toDisplayString(__props.title),
|
|
57
|
+
1
|
|
58
|
+
/* TEXT */
|
|
59
|
+
)) : createCommentVNode("v-if", true),
|
|
60
|
+
__props.subtitle ? (openBlock(), createElementBlock(
|
|
61
|
+
"div",
|
|
62
|
+
_hoisted_5,
|
|
63
|
+
toDisplayString(__props.subtitle),
|
|
64
|
+
1
|
|
65
|
+
/* TEXT */
|
|
66
|
+
)) : createCommentVNode("v-if", true)
|
|
67
|
+
])
|
|
68
|
+
])) : createCommentVNode("v-if", true),
|
|
69
|
+
__props.items.length ? (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
70
|
+
(openBlock(true), createElementBlock(
|
|
71
|
+
Fragment,
|
|
72
|
+
null,
|
|
73
|
+
renderList(__props.items, (item, idx) => {
|
|
74
|
+
var _a;
|
|
75
|
+
return openBlock(), createElementBlock("div", {
|
|
76
|
+
key: `${item.label}-${idx}`,
|
|
77
|
+
class: "yc-display-metrics-card__item"
|
|
78
|
+
}, [
|
|
79
|
+
createElementVNode(
|
|
80
|
+
"div",
|
|
81
|
+
_hoisted_7,
|
|
82
|
+
toDisplayString(item.label),
|
|
83
|
+
1
|
|
84
|
+
/* TEXT */
|
|
85
|
+
),
|
|
86
|
+
createElementVNode("div", _hoisted_8, [
|
|
87
|
+
createElementVNode(
|
|
88
|
+
"span",
|
|
89
|
+
_hoisted_9,
|
|
90
|
+
toDisplayString(item.value),
|
|
91
|
+
1
|
|
92
|
+
/* TEXT */
|
|
93
|
+
),
|
|
94
|
+
item.unit ? (openBlock(), createElementBlock(
|
|
95
|
+
"span",
|
|
96
|
+
_hoisted_10,
|
|
97
|
+
toDisplayString(item.unit),
|
|
98
|
+
1
|
|
99
|
+
/* TEXT */
|
|
100
|
+
)) : createCommentVNode("v-if", true)
|
|
101
|
+
]),
|
|
102
|
+
item.trend || item.description ? (openBlock(), createElementBlock("div", _hoisted_11, [
|
|
103
|
+
item.trend ? (openBlock(), createElementBlock(
|
|
104
|
+
"span",
|
|
105
|
+
{
|
|
106
|
+
key: 0,
|
|
107
|
+
class: normalizeClass(["yc-display-metrics-card__trend", `is-${(_a = item.trendType) != null ? _a : "neutral"}`])
|
|
108
|
+
},
|
|
109
|
+
toDisplayString(item.trend),
|
|
110
|
+
3
|
|
111
|
+
/* TEXT, CLASS */
|
|
112
|
+
)) : createCommentVNode("v-if", true),
|
|
113
|
+
item.description ? (openBlock(), createElementBlock(
|
|
114
|
+
"span",
|
|
115
|
+
_hoisted_12,
|
|
116
|
+
toDisplayString(item.description),
|
|
117
|
+
1
|
|
118
|
+
/* TEXT */
|
|
119
|
+
)) : createCommentVNode("v-if", true)
|
|
120
|
+
])) : createCommentVNode("v-if", true)
|
|
121
|
+
]);
|
|
122
|
+
}),
|
|
123
|
+
128
|
|
124
|
+
/* KEYED_FRAGMENT */
|
|
125
|
+
))
|
|
126
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_13, "\u6682\u65E0\u53EF\u5C55\u793A\u7684\u6307\u6807\u6570\u636E"))
|
|
127
|
+
]);
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, createCommentVNode, Fragment, renderList, normalizeStyle } from 'vue';
|
|
2
|
+
|
|
3
|
+
const _hoisted_1 = { class: "yc-display-card yc-display-table-card" };
|
|
4
|
+
const _hoisted_2 = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "yc-display-card__header"
|
|
7
|
+
};
|
|
8
|
+
const _hoisted_3 = { class: "yc-display-card__title-wrap" };
|
|
9
|
+
const _hoisted_4 = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "yc-display-card__title"
|
|
12
|
+
};
|
|
13
|
+
const _hoisted_5 = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "yc-display-card__subtitle"
|
|
16
|
+
};
|
|
17
|
+
const _hoisted_6 = { class: "yc-display-card__badge" };
|
|
18
|
+
const _hoisted_7 = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "yc-display-table-card__summary"
|
|
21
|
+
};
|
|
22
|
+
const _hoisted_8 = { class: "yc-display-table-card__summary-label" };
|
|
23
|
+
const _hoisted_9 = { class: "yc-display-table-card__summary-value" };
|
|
24
|
+
const _hoisted_10 = { class: "yc-display-table-card__scroll" };
|
|
25
|
+
const _hoisted_11 = {
|
|
26
|
+
key: 0,
|
|
27
|
+
class: "yc-display-table-card__table"
|
|
28
|
+
};
|
|
29
|
+
const _hoisted_12 = {
|
|
30
|
+
key: 1,
|
|
31
|
+
class: "yc-display-card__empty"
|
|
32
|
+
};
|
|
33
|
+
const _hoisted_13 = {
|
|
34
|
+
key: 2,
|
|
35
|
+
class: "yc-display-card__footer"
|
|
36
|
+
};
|
|
37
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
38
|
+
...{ name: "YcDisplayTableCard" },
|
|
39
|
+
__name: "table-card",
|
|
40
|
+
props: {
|
|
41
|
+
title: { default: "" },
|
|
42
|
+
subtitle: { default: "" },
|
|
43
|
+
columns: { default: () => [] },
|
|
44
|
+
rows: { default: () => [] },
|
|
45
|
+
summary: { default: () => [] },
|
|
46
|
+
maxRows: { default: 10 }
|
|
47
|
+
},
|
|
48
|
+
setup(__props) {
|
|
49
|
+
const props = __props;
|
|
50
|
+
const expanded = ref(false);
|
|
51
|
+
const normalizedColumns = computed(() => {
|
|
52
|
+
if (props.columns.length > 0) return props.columns;
|
|
53
|
+
const first = props.rows[0];
|
|
54
|
+
if (!first || typeof first !== "object") return [];
|
|
55
|
+
return Object.keys(first).map((key) => ({ key, label: key }));
|
|
56
|
+
});
|
|
57
|
+
const hasMore = computed(() => props.rows.length > props.maxRows);
|
|
58
|
+
const visibleRows = computed(
|
|
59
|
+
() => expanded.value || !hasMore.value ? props.rows : props.rows.slice(0, props.maxRows)
|
|
60
|
+
);
|
|
61
|
+
function formatCell(row, col) {
|
|
62
|
+
const raw = row == null ? void 0 : row[col.key];
|
|
63
|
+
if (raw === void 0 || raw === null || raw === "") return "\u2014";
|
|
64
|
+
const text = typeof raw === "object" ? JSON.stringify(raw) : String(raw);
|
|
65
|
+
return col.unit ? `${text} ${col.unit}` : text;
|
|
66
|
+
}
|
|
67
|
+
return (_ctx, _cache) => {
|
|
68
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
69
|
+
__props.title || __props.subtitle || __props.rows.length ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
70
|
+
createElementVNode("div", _hoisted_3, [
|
|
71
|
+
__props.title ? (openBlock(), createElementBlock(
|
|
72
|
+
"div",
|
|
73
|
+
_hoisted_4,
|
|
74
|
+
toDisplayString(__props.title),
|
|
75
|
+
1
|
|
76
|
+
/* TEXT */
|
|
77
|
+
)) : createCommentVNode("v-if", true),
|
|
78
|
+
__props.subtitle ? (openBlock(), createElementBlock(
|
|
79
|
+
"div",
|
|
80
|
+
_hoisted_5,
|
|
81
|
+
toDisplayString(__props.subtitle),
|
|
82
|
+
1
|
|
83
|
+
/* TEXT */
|
|
84
|
+
)) : createCommentVNode("v-if", true)
|
|
85
|
+
]),
|
|
86
|
+
createElementVNode(
|
|
87
|
+
"span",
|
|
88
|
+
_hoisted_6,
|
|
89
|
+
"\u5171 " + toDisplayString(__props.rows.length) + " \u6761",
|
|
90
|
+
1
|
|
91
|
+
/* TEXT */
|
|
92
|
+
)
|
|
93
|
+
])) : createCommentVNode("v-if", true),
|
|
94
|
+
__props.summary.length ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
95
|
+
(openBlock(true), createElementBlock(
|
|
96
|
+
Fragment,
|
|
97
|
+
null,
|
|
98
|
+
renderList(__props.summary, (item) => {
|
|
99
|
+
return openBlock(), createElementBlock("div", {
|
|
100
|
+
key: item.label,
|
|
101
|
+
class: "yc-display-table-card__summary-item"
|
|
102
|
+
}, [
|
|
103
|
+
createElementVNode(
|
|
104
|
+
"span",
|
|
105
|
+
_hoisted_8,
|
|
106
|
+
toDisplayString(item.label),
|
|
107
|
+
1
|
|
108
|
+
/* TEXT */
|
|
109
|
+
),
|
|
110
|
+
createElementVNode(
|
|
111
|
+
"strong",
|
|
112
|
+
_hoisted_9,
|
|
113
|
+
toDisplayString(item.value),
|
|
114
|
+
1
|
|
115
|
+
/* TEXT */
|
|
116
|
+
)
|
|
117
|
+
]);
|
|
118
|
+
}),
|
|
119
|
+
128
|
|
120
|
+
/* KEYED_FRAGMENT */
|
|
121
|
+
))
|
|
122
|
+
])) : createCommentVNode("v-if", true),
|
|
123
|
+
createElementVNode("div", _hoisted_10, [
|
|
124
|
+
normalizedColumns.value.length && __props.rows.length ? (openBlock(), createElementBlock("table", _hoisted_11, [
|
|
125
|
+
createElementVNode("thead", null, [
|
|
126
|
+
createElementVNode("tr", null, [
|
|
127
|
+
(openBlock(true), createElementBlock(
|
|
128
|
+
Fragment,
|
|
129
|
+
null,
|
|
130
|
+
renderList(normalizedColumns.value, (col) => {
|
|
131
|
+
var _a;
|
|
132
|
+
return openBlock(), createElementBlock(
|
|
133
|
+
"th",
|
|
134
|
+
{
|
|
135
|
+
key: col.key,
|
|
136
|
+
style: normalizeStyle({ textAlign: (_a = col.align) != null ? _a : "left" })
|
|
137
|
+
},
|
|
138
|
+
toDisplayString(col.label),
|
|
139
|
+
5
|
|
140
|
+
/* TEXT, STYLE */
|
|
141
|
+
);
|
|
142
|
+
}),
|
|
143
|
+
128
|
|
144
|
+
/* KEYED_FRAGMENT */
|
|
145
|
+
))
|
|
146
|
+
])
|
|
147
|
+
]),
|
|
148
|
+
createElementVNode("tbody", null, [
|
|
149
|
+
(openBlock(true), createElementBlock(
|
|
150
|
+
Fragment,
|
|
151
|
+
null,
|
|
152
|
+
renderList(visibleRows.value, (row, idx) => {
|
|
153
|
+
return openBlock(), createElementBlock("tr", { key: idx }, [
|
|
154
|
+
(openBlock(true), createElementBlock(
|
|
155
|
+
Fragment,
|
|
156
|
+
null,
|
|
157
|
+
renderList(normalizedColumns.value, (col) => {
|
|
158
|
+
var _a;
|
|
159
|
+
return openBlock(), createElementBlock(
|
|
160
|
+
"td",
|
|
161
|
+
{
|
|
162
|
+
key: col.key,
|
|
163
|
+
style: normalizeStyle({ textAlign: (_a = col.align) != null ? _a : "left" })
|
|
164
|
+
},
|
|
165
|
+
toDisplayString(formatCell(row, col)),
|
|
166
|
+
5
|
|
167
|
+
/* TEXT, STYLE */
|
|
168
|
+
);
|
|
169
|
+
}),
|
|
170
|
+
128
|
|
171
|
+
/* KEYED_FRAGMENT */
|
|
172
|
+
))
|
|
173
|
+
]);
|
|
174
|
+
}),
|
|
175
|
+
128
|
|
176
|
+
/* KEYED_FRAGMENT */
|
|
177
|
+
))
|
|
178
|
+
])
|
|
179
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_12, "\u6682\u65E0\u53EF\u5C55\u793A\u7684\u8868\u683C\u6570\u636E"))
|
|
180
|
+
]),
|
|
181
|
+
hasMore.value ? (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
182
|
+
createElementVNode(
|
|
183
|
+
"button",
|
|
184
|
+
{
|
|
185
|
+
type: "button",
|
|
186
|
+
class: "yc-display-card__toggle",
|
|
187
|
+
onClick: _cache[0] || (_cache[0] = ($event) => expanded.value = !expanded.value)
|
|
188
|
+
},
|
|
189
|
+
toDisplayString(expanded.value ? "\u6536\u8D77\u660E\u7EC6" : `\u5C55\u5F00\u5168\u90E8 ${__props.rows.length} \u884C`),
|
|
190
|
+
1
|
|
191
|
+
/* TEXT */
|
|
192
|
+
)
|
|
193
|
+
])) : createCommentVNode("v-if", true)
|
|
194
|
+
]);
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import capability$
|
|
2
|
-
import capability$
|
|
3
|
-
import capability$
|
|
4
|
-
import capability$
|
|
5
|
-
import capability$
|
|
6
|
-
import capability$
|
|
7
|
-
import capability$
|
|
1
|
+
import capability$i from '../components/chart/capability.mjs';
|
|
2
|
+
import capability$h from '../components/data-table/capability.mjs';
|
|
3
|
+
import capability$g from '../components/table/capability.mjs';
|
|
4
|
+
import capability$f from '../components/yc-card/capability.mjs';
|
|
5
|
+
import capability$e from '../components/yc-controls/capability.mjs';
|
|
6
|
+
import capability$d from '../components/yc-coss-table/capability.mjs';
|
|
7
|
+
import capability$c from '../components/yc-date-picker/capability.mjs';
|
|
8
|
+
import capability$b from '../components/yc-display-cards/capability.mjs';
|
|
8
9
|
import capability$a from '../components/yc-feedback/capability.mjs';
|
|
9
10
|
import capability$9 from '../components/yc-gradient-card/capability.mjs';
|
|
10
11
|
import capability$8 from '../components/yc-input-otp/capability.mjs';
|
|
@@ -18,7 +19,7 @@ import capability$1 from '../components/yc-select-v2/capability.mjs';
|
|
|
18
19
|
import capability from '../components/yc-text/capability.mjs';
|
|
19
20
|
import runtime from './capabilities/runtime.mjs';
|
|
20
21
|
|
|
21
|
-
const modules = { "../components/chart/capability.ts": capability$
|
|
22
|
+
const modules = { "../components/chart/capability.ts": capability$i, "../components/data-table/capability.ts": capability$h, "../components/table/capability.ts": capability$g, "../components/yc-card/capability.ts": capability$f, "../components/yc-controls/capability.ts": capability$e, "../components/yc-coss-table/capability.ts": capability$d, "../components/yc-date-picker/capability.ts": capability$c, "../components/yc-display-cards/capability.ts": capability$b, "../components/yc-feedback/capability.ts": capability$a, "../components/yc-gradient-card/capability.ts": capability$9, "../components/yc-input-otp/capability.ts": capability$8, "../components/yc-input/capability.ts": capability$7, "../components/yc-lens/capability.ts": capability$6, "../components/yc-pagination/capability.ts": capability$5, "../components/yc-plus-tree/capability.ts": capability$4, "../components/yc-property-table/capability.ts": capability$3, "../components/yc-questionnaire/capability.ts": capability$2, "../components/yc-select-v2/capability.ts": capability$1, "../components/yc-text/capability.ts": capability, "./capabilities/runtime.ts": runtime };
|
|
22
23
|
function isCapability(value) {
|
|
23
24
|
return !!value && typeof value === "object" && ("install" in value || "gallery" in value);
|
|
24
25
|
}
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.2.
|
|
1
|
+
export declare const version = "1.2.5";
|
package/es/version.mjs
CHANGED