yc-agent-ui 1.2.8 → 1.2.11
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/data-table/src/data-table.vue.d.ts +2 -2
- package/es/components/display-item/index.d.ts +3 -3
- package/es/components/display-item/src/index.vue.d.ts +1 -1
- package/es/components/drawer-form/index.d.ts +6 -6
- package/es/components/drawer-form/src/index.vue.d.ts +2 -2
- package/es/components/page/index.d.ts +100 -100
- package/es/components/page/src/index.vue.d.ts +33 -33
- package/es/components/table/index.d.ts +18 -18
- package/es/components/table/src/index.vue.d.ts +2 -2
- package/es/components/table/src/table-column.vue.d.ts +10 -10
- package/es/components/virtual-table/index.d.ts +7 -7
- package/es/components/virtual-table/src/index.vue.d.ts +2 -2
- package/es/components/yc-ai-chat/src/bubble.vue.d.ts +1 -1
- package/es/components/yc-ai-chat/src/file-card.vue.d.ts +1 -1
- package/es/components/yc-ai-chat/src/sender.vue.d.ts +1 -1
- package/es/components/yc-coss-table/src/coss-table.vue.d.ts +3 -3
- package/es/components/yc-coss-table/src/table.vue.d.ts +1 -1
- package/es/components/yc-display-cards/index.d.ts +218 -3
- package/es/components/yc-display-cards/src/card-renderer.vue.d.ts +16 -0
- package/es/components/yc-display-cards/src/elements/action-bar.vue.d.ts +12 -0
- package/es/components/yc-display-cards/src/elements/card-shell.vue.d.ts +24 -0
- package/es/components/yc-display-cards/src/elements/choice-group.vue.d.ts +14 -0
- package/es/components/yc-display-cards/src/elements/data-table.vue.d.ts +10 -0
- package/es/components/yc-display-cards/src/elements/field-control.vue.d.ts +22 -0
- package/es/components/yc-display-cards/src/elements/field-utils.d.ts +16 -0
- package/es/components/yc-display-cards/src/elements/form-field.vue.d.ts +18 -0
- package/es/components/yc-display-cards/src/elements/inline-alert.vue.d.ts +14 -0
- package/es/components/yc-display-cards/src/elements/input.vue.d.ts +20 -0
- package/es/components/yc-display-cards/src/elements/kv-list.vue.d.ts +8 -0
- package/es/components/yc-display-cards/src/elements/metric-grid.vue.d.ts +7 -0
- package/es/components/yc-display-cards/src/elements/status-tag.vue.d.ts +6 -0
- package/es/components/yc-display-cards/src/elements/switch.vue.d.ts +10 -0
- package/es/components/yc-display-cards/src/elements/upload.vue.d.ts +17 -0
- package/es/components/yc-display-cards/src/elements/use-card-form.d.ts +23 -0
- package/es/components/yc-display-cards/src/form-card.vue.d.ts +5 -2
- package/es/components/yc-display-cards/src/table-card.vue.d.ts +1 -2
- package/es/components/yc-display-cards/src/types.d.ts +179 -10
- package/es/components/yc-feedback/src/banner.vue.d.ts +1 -1
- package/es/components/yc-feedback/src/key-value-list.vue.d.ts +1 -1
- package/es/components/yc-input/src/textarea.vue.d.ts +2 -2
- package/es/components/yc-plus-page/src/header-filter-cell.vue.d.ts +8 -8
- package/es/components/yc-plus-page/src/index.vue.d.ts +115 -115
- package/es/components/yc-property-table/src/property-table.vue.d.ts +2 -2
- package/es/hooks/usePlusFormReset.d.ts +18 -18
- package/es/index.css +30 -24
- package/es/index.mjs +3 -1
- package/es/packages/components/index.mjs +3 -1
- package/es/packages/components/yc-display-cards/capability.mjs +57 -1
- package/es/packages/components/yc-display-cards/index.mjs +31 -1
- package/es/packages/components/yc-display-cards/src/card-renderer.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/card-renderer2.vue.mjs +295 -0
- package/es/packages/components/yc-display-cards/src/detail-card.vue.mjs +1 -1
- package/es/packages/components/yc-display-cards/src/detail-card2.vue.mjs +28 -94
- package/es/packages/components/yc-display-cards/src/elements/action-bar.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/action-bar2.vue.mjs +38 -0
- package/es/packages/components/yc-display-cards/src/elements/card-shell.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/card-shell2.vue.mjs +85 -0
- package/es/packages/components/yc-display-cards/src/elements/choice-group.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/choice-group2.vue.mjs +57 -0
- package/es/packages/components/yc-display-cards/src/elements/data-table.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/data-table2.vue.mjs +184 -0
- package/es/packages/components/yc-display-cards/src/elements/field-control.vue.mjs +5 -0
- package/es/packages/components/yc-display-cards/src/elements/field-control2.vue.mjs +92 -0
- package/es/packages/components/yc-display-cards/src/elements/field-utils.mjs +121 -0
- package/es/packages/components/yc-display-cards/src/elements/form-field.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/form-field2.vue.mjs +68 -0
- package/es/packages/components/yc-display-cards/src/elements/inline-alert.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/inline-alert2.vue.mjs +29 -0
- package/es/packages/components/yc-display-cards/src/elements/input.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/input2.vue.mjs +148 -0
- package/es/packages/components/yc-display-cards/src/elements/kv-list.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/kv-list2.vue.mjs +63 -0
- package/es/packages/components/yc-display-cards/src/elements/metric-grid.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/metric-grid2.vue.mjs +97 -0
- package/es/packages/components/yc-display-cards/src/elements/status-tag.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/status-tag2.vue.mjs +25 -0
- package/es/packages/components/yc-display-cards/src/elements/switch.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/switch2.vue.mjs +35 -0
- package/es/packages/components/yc-display-cards/src/elements/upload.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/upload2.vue.mjs +196 -0
- package/es/packages/components/yc-display-cards/src/elements/use-card-form.mjs +80 -0
- package/es/packages/components/yc-display-cards/src/form-card.vue.mjs +1 -1
- package/es/packages/components/yc-display-cards/src/form-card2.vue.mjs +169 -1140
- package/es/packages/components/yc-display-cards/src/metrics-card.vue.mjs +1 -1
- package/es/packages/components/yc-display-cards/src/metrics-card2.vue.mjs +19 -114
- package/es/packages/components/yc-display-cards/src/table-card.vue.mjs +1 -1
- package/es/packages/components/yc-display-cards/src/table-card2.vue.mjs +50 -232
- package/es/packages/components/yc-status-dialog/src/index.vue.mjs +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/index.css +20 -14
- package/index.js +2204 -2354
- package/index.min.css +19 -13
- package/index.min.js +37 -43
- package/index.min.mjs +36 -42
- package/index.mjs +2184 -2353
- package/lib/components/data-table/src/data-table.vue.d.ts +2 -2
- package/lib/components/display-item/index.d.ts +3 -3
- package/lib/components/display-item/src/index.vue.d.ts +1 -1
- package/lib/components/drawer-form/index.d.ts +6 -6
- package/lib/components/drawer-form/src/index.vue.d.ts +2 -2
- package/lib/components/page/index.d.ts +100 -100
- package/lib/components/page/src/index.vue.d.ts +33 -33
- package/lib/components/table/index.d.ts +18 -18
- package/lib/components/table/src/index.vue.d.ts +2 -2
- package/lib/components/table/src/table-column.vue.d.ts +10 -10
- package/lib/components/virtual-table/index.d.ts +7 -7
- package/lib/components/virtual-table/src/index.vue.d.ts +2 -2
- package/lib/components/yc-ai-chat/src/bubble.vue.d.ts +1 -1
- package/lib/components/yc-ai-chat/src/file-card.vue.d.ts +1 -1
- package/lib/components/yc-ai-chat/src/sender.vue.d.ts +1 -1
- package/lib/components/yc-coss-table/src/coss-table.vue.d.ts +3 -3
- package/lib/components/yc-coss-table/src/table.vue.d.ts +1 -1
- package/lib/components/yc-display-cards/index.d.ts +218 -3
- package/lib/components/yc-display-cards/src/card-renderer.vue.d.ts +16 -0
- package/lib/components/yc-display-cards/src/elements/action-bar.vue.d.ts +12 -0
- package/lib/components/yc-display-cards/src/elements/card-shell.vue.d.ts +24 -0
- package/lib/components/yc-display-cards/src/elements/choice-group.vue.d.ts +14 -0
- package/lib/components/yc-display-cards/src/elements/data-table.vue.d.ts +10 -0
- package/lib/components/yc-display-cards/src/elements/field-control.vue.d.ts +22 -0
- package/lib/components/yc-display-cards/src/elements/field-utils.d.ts +16 -0
- package/lib/components/yc-display-cards/src/elements/form-field.vue.d.ts +18 -0
- package/lib/components/yc-display-cards/src/elements/inline-alert.vue.d.ts +14 -0
- package/lib/components/yc-display-cards/src/elements/input.vue.d.ts +20 -0
- package/lib/components/yc-display-cards/src/elements/kv-list.vue.d.ts +8 -0
- package/lib/components/yc-display-cards/src/elements/metric-grid.vue.d.ts +7 -0
- package/lib/components/yc-display-cards/src/elements/status-tag.vue.d.ts +6 -0
- package/lib/components/yc-display-cards/src/elements/switch.vue.d.ts +10 -0
- package/lib/components/yc-display-cards/src/elements/upload.vue.d.ts +17 -0
- package/lib/components/yc-display-cards/src/elements/use-card-form.d.ts +23 -0
- package/lib/components/yc-display-cards/src/form-card.vue.d.ts +5 -2
- package/lib/components/yc-display-cards/src/table-card.vue.d.ts +1 -2
- package/lib/components/yc-display-cards/src/types.d.ts +179 -10
- package/lib/components/yc-feedback/src/banner.vue.d.ts +1 -1
- package/lib/components/yc-feedback/src/key-value-list.vue.d.ts +1 -1
- package/lib/components/yc-input/src/textarea.vue.d.ts +2 -2
- package/lib/components/yc-plus-page/src/header-filter-cell.vue.d.ts +8 -8
- package/lib/components/yc-plus-page/src/index.vue.d.ts +115 -115
- package/lib/components/yc-property-table/src/property-table.vue.d.ts +2 -2
- package/lib/hooks/usePlusFormReset.d.ts +18 -18
- package/lib/index.css +29 -23
- package/lib/index.js +28 -7
- package/lib/packages/components/index.js +28 -7
- package/lib/packages/components/yc-display-cards/capability.js +56 -0
- package/lib/packages/components/yc-display-cards/index.js +49 -0
- package/lib/packages/components/yc-display-cards/src/card-renderer.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/card-renderer2.vue.js +299 -0
- package/lib/packages/components/yc-display-cards/src/detail-card.vue.js +1 -1
- package/lib/packages/components/yc-display-cards/src/detail-card2.vue.js +27 -93
- package/lib/packages/components/yc-display-cards/src/elements/action-bar.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/action-bar2.vue.js +42 -0
- package/lib/packages/components/yc-display-cards/src/elements/card-shell.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/card-shell2.vue.js +89 -0
- package/lib/packages/components/yc-display-cards/src/elements/choice-group.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/choice-group2.vue.js +61 -0
- package/lib/packages/components/yc-display-cards/src/elements/data-table.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/data-table2.vue.js +188 -0
- package/lib/packages/components/yc-display-cards/src/elements/field-control.vue.js +9 -0
- package/lib/packages/components/yc-display-cards/src/elements/field-control2.vue.js +96 -0
- package/lib/packages/components/yc-display-cards/src/elements/field-utils.js +134 -0
- package/lib/packages/components/yc-display-cards/src/elements/form-field.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/form-field2.vue.js +72 -0
- package/lib/packages/components/yc-display-cards/src/elements/inline-alert.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/inline-alert2.vue.js +33 -0
- package/lib/packages/components/yc-display-cards/src/elements/input.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/input2.vue.js +152 -0
- package/lib/packages/components/yc-display-cards/src/elements/kv-list.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/kv-list2.vue.js +67 -0
- package/lib/packages/components/yc-display-cards/src/elements/metric-grid.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/metric-grid2.vue.js +101 -0
- package/lib/packages/components/yc-display-cards/src/elements/status-tag.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/status-tag2.vue.js +29 -0
- package/lib/packages/components/yc-display-cards/src/elements/switch.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/switch2.vue.js +39 -0
- package/lib/packages/components/yc-display-cards/src/elements/upload.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/upload2.vue.js +200 -0
- package/lib/packages/components/yc-display-cards/src/elements/use-card-form.js +82 -0
- package/lib/packages/components/yc-display-cards/src/form-card.vue.js +1 -1
- package/lib/packages/components/yc-display-cards/src/form-card2.vue.js +168 -1139
- package/lib/packages/components/yc-display-cards/src/metrics-card.vue.js +1 -1
- package/lib/packages/components/yc-display-cards/src/metrics-card2.vue.js +18 -113
- package/lib/packages/components/yc-display-cards/src/table-card.vue.js +1 -1
- package/lib/packages/components/yc-display-cards/src/table-card2.vue.js +49 -231
- package/lib/packages/components/yc-status-dialog/src/index.vue.js +1 -1
- 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 -2
- package/theme-chalk/index.css +20 -14
- package/theme-chalk/plus-dialog.css +1 -1
- package/theme-chalk/plus-yc-status-dialog.css +1 -1
- package/theme-chalk/src/dialog.scss +0 -6
- package/theme-chalk/src/index.scss +1 -2
- package/theme-chalk/src/yc-status-dialog.scss +2 -2
- package/es/_virtual/_commonjsHelpers.mjs +0 -7
- package/es/_virtual/toastify.mjs +0 -3
- package/es/components/yc-display-cards/src/toast.d.ts +0 -4
- package/es/node_modules/.pnpm/toastify-js@1.12.0/node_modules/toastify-js/src/toastify.mjs +0 -456
- package/es/packages/components/yc-display-cards/src/toast.mjs +0 -35
- package/lib/_virtual/_commonjsHelpers.js +0 -10
- package/lib/_virtual/toastify.js +0 -5
- package/lib/components/yc-display-cards/src/toast.d.ts +0 -4
- package/lib/node_modules/.pnpm/toastify-js@1.12.0/node_modules/toastify-js/src/toastify.js +0 -460
- package/lib/packages/components/yc-display-cards/src/toast.js +0 -37
|
@@ -1,13 +1,69 @@
|
|
|
1
|
-
import { YcDisplayTableCard, YcDisplayMetricsCard, YcDisplayDetailCard, YcDisplayFormCard } from './index.mjs';
|
|
1
|
+
import { YcCardRenderer, YcDisplayTableCard, YcDisplayMetricsCard, YcDisplayDetailCard, YcDisplayFormCard, YcCardShell, YcCardTag, YcCardAlert, YcCardKv, YcCardMetrics, YcCardTable, YcCardInput, YcCardChoice, YcCardSwitch, YcCardUpload, YcCardField, YcCardFieldControl, YcCardActions } from './index.mjs';
|
|
2
2
|
|
|
3
3
|
const capability = {
|
|
4
4
|
install: [
|
|
5
|
+
YcCardRenderer,
|
|
6
|
+
YcCardShell,
|
|
7
|
+
YcCardTag,
|
|
8
|
+
YcCardAlert,
|
|
9
|
+
YcCardKv,
|
|
10
|
+
YcCardMetrics,
|
|
11
|
+
YcCardTable,
|
|
12
|
+
YcCardInput,
|
|
13
|
+
YcCardChoice,
|
|
14
|
+
YcCardSwitch,
|
|
15
|
+
YcCardUpload,
|
|
16
|
+
YcCardField,
|
|
17
|
+
YcCardFieldControl,
|
|
18
|
+
YcCardActions,
|
|
5
19
|
YcDisplayTableCard,
|
|
6
20
|
YcDisplayMetricsCard,
|
|
7
21
|
YcDisplayDetailCard,
|
|
8
22
|
YcDisplayFormCard
|
|
9
23
|
],
|
|
10
24
|
gallery: [
|
|
25
|
+
{
|
|
26
|
+
id: "yc.card",
|
|
27
|
+
title: "\u539F\u5B50\u5143\u7D20\u62FC\u88C5\u5361",
|
|
28
|
+
categories: ["\u5361\u7247\u4E0E\u5C55\u793A"],
|
|
29
|
+
component: YcCardRenderer,
|
|
30
|
+
props: {
|
|
31
|
+
card: {
|
|
32
|
+
title: "\u65B0\u5EFA\u62A5\u4FEE\u5DE5\u5355",
|
|
33
|
+
subtitle: "\u8BF7\u6838\u5BF9\u4FE1\u606F\u5E76\u4E0A\u4F20\u73B0\u573A\u7167\u7247",
|
|
34
|
+
elements: [
|
|
35
|
+
{
|
|
36
|
+
type: "kv",
|
|
37
|
+
items: [
|
|
38
|
+
{ label: "\u6240\u5C5E\u9879\u76EE", value: "\u5B81\u5B89\u7B2C\u4E00\u82B1\u56ED" },
|
|
39
|
+
{ label: "\u62A5\u4FEE\u4F4D\u7F6E", value: "1\u680B\u7535\u68AF" }
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{ type: "field", name: "title", label: "\u5DE5\u5355\u6807\u9898", required: true, value: "1\u680B\u7535\u68AF\u5F02\u54CD" },
|
|
43
|
+
{
|
|
44
|
+
type: "field",
|
|
45
|
+
name: "priority",
|
|
46
|
+
label: "\u4F18\u5148\u7EA7",
|
|
47
|
+
widget: "radio",
|
|
48
|
+
required: true,
|
|
49
|
+
options: [
|
|
50
|
+
{ label: "\u4E00\u822C", value: "normal" },
|
|
51
|
+
{ label: "\u7D27\u6025", value: "urgent" }
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{ type: "field", name: "phone", label: "\u8054\u7CFB\u7535\u8BDD", widget: "phone" },
|
|
55
|
+
{ type: "field", name: "photos", label: "\u73B0\u573A\u7167\u7247", widget: "image", required: true },
|
|
56
|
+
{
|
|
57
|
+
type: "actions",
|
|
58
|
+
items: [
|
|
59
|
+
{ action: "reply", label: "\u63D0\u4EA4\u5DE5\u5355", primary: true },
|
|
60
|
+
{ action: "reset", label: "\u91CD\u7F6E" }
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
11
67
|
{
|
|
12
68
|
id: "yc.common.table",
|
|
13
69
|
title: "\u901A\u7528\u6570\u636E\u8868\u683C\u5361",
|
|
@@ -3,10 +3,40 @@ import TableCard from './src/table-card.vue.mjs';
|
|
|
3
3
|
import MetricsCard from './src/metrics-card.vue.mjs';
|
|
4
4
|
import DetailCard from './src/detail-card.vue.mjs';
|
|
5
5
|
import FormCard from './src/form-card.vue.mjs';
|
|
6
|
+
import CardRenderer from './src/card-renderer.vue.mjs';
|
|
7
|
+
import CardShell from './src/elements/card-shell.vue.mjs';
|
|
8
|
+
import StatusTag from './src/elements/status-tag.vue.mjs';
|
|
9
|
+
import InlineAlert from './src/elements/inline-alert.vue.mjs';
|
|
10
|
+
import KvList from './src/elements/kv-list.vue.mjs';
|
|
11
|
+
import MetricGrid from './src/elements/metric-grid.vue.mjs';
|
|
12
|
+
import DataTable from './src/elements/data-table.vue.mjs';
|
|
13
|
+
import Input from './src/elements/input.vue.mjs';
|
|
14
|
+
import ChoiceGroup from './src/elements/choice-group.vue.mjs';
|
|
15
|
+
import Switch from './src/elements/switch.vue.mjs';
|
|
16
|
+
import Upload from './src/elements/upload.vue.mjs';
|
|
17
|
+
import FormField from './src/elements/form-field.vue.mjs';
|
|
18
|
+
import _sfc_main from './src/elements/field-control2.vue.mjs';
|
|
19
|
+
import ActionBar from './src/elements/action-bar.vue.mjs';
|
|
20
|
+
export { buildReplyText, normalizeOptions, resolveFieldKind, validateFieldValue } from './src/elements/field-utils.mjs';
|
|
21
|
+
export { useCardForm } from './src/elements/use-card-form.mjs';
|
|
6
22
|
|
|
23
|
+
const YcCardRenderer = withInstall(CardRenderer);
|
|
24
|
+
const YcCardShell = withInstall(CardShell);
|
|
25
|
+
const YcCardTag = withInstall(StatusTag);
|
|
26
|
+
const YcCardAlert = withInstall(InlineAlert);
|
|
27
|
+
const YcCardKv = withInstall(KvList);
|
|
28
|
+
const YcCardMetrics = withInstall(MetricGrid);
|
|
29
|
+
const YcCardTable = withInstall(DataTable);
|
|
30
|
+
const YcCardInput = withInstall(Input);
|
|
31
|
+
const YcCardChoice = withInstall(ChoiceGroup);
|
|
32
|
+
const YcCardSwitch = withInstall(Switch);
|
|
33
|
+
const YcCardUpload = withInstall(Upload);
|
|
34
|
+
const YcCardField = withInstall(FormField);
|
|
35
|
+
const YcCardFieldControl = withInstall(_sfc_main);
|
|
36
|
+
const YcCardActions = withInstall(ActionBar);
|
|
7
37
|
const YcDisplayTableCard = withInstall(TableCard);
|
|
8
38
|
const YcDisplayMetricsCard = withInstall(MetricsCard);
|
|
9
39
|
const YcDisplayDetailCard = withInstall(DetailCard);
|
|
10
40
|
const YcDisplayFormCard = withInstall(FormCard);
|
|
11
41
|
|
|
12
|
-
export { YcDisplayDetailCard, YcDisplayFormCard, YcDisplayMetricsCard, YcDisplayTableCard };
|
|
42
|
+
export { YcCardActions, YcCardAlert, YcCardChoice, YcCardField, YcCardFieldControl, YcCardInput, YcCardKv, YcCardMetrics, YcCardRenderer, YcCardShell, YcCardSwitch, YcCardTable, YcCardTag, YcCardUpload, YcDisplayDetailCard, YcDisplayFormCard, YcDisplayMetricsCard, YcDisplayTableCard };
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { defineComponent, computed, ref, openBlock, createBlock, normalizeClass, withCtx, createElementVNode, createElementBlock, Fragment, renderList, unref, toDisplayString, createVNode, createCommentVNode } from 'vue';
|
|
2
|
+
import ActionBar from './elements/action-bar.vue.mjs';
|
|
3
|
+
import CardShell from './elements/card-shell.vue.mjs';
|
|
4
|
+
import DataTable from './elements/data-table.vue.mjs';
|
|
5
|
+
import _sfc_main$1 from './elements/field-control2.vue.mjs';
|
|
6
|
+
import InlineAlert from './elements/inline-alert.vue.mjs';
|
|
7
|
+
import KvList from './elements/kv-list.vue.mjs';
|
|
8
|
+
import MetricGrid from './elements/metric-grid.vue.mjs';
|
|
9
|
+
import StatusTag from './elements/status-tag.vue.mjs';
|
|
10
|
+
import { useCardForm } from './elements/use-card-form.mjs';
|
|
11
|
+
|
|
12
|
+
const _hoisted_1 = { class: "yc-card-renderer__body" };
|
|
13
|
+
const _hoisted_2 = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "yc-card-renderer__grid"
|
|
16
|
+
};
|
|
17
|
+
const _hoisted_3 = { key: 1 };
|
|
18
|
+
const _hoisted_4 = {
|
|
19
|
+
key: 6,
|
|
20
|
+
class: "yc-card-renderer__divider"
|
|
21
|
+
};
|
|
22
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
23
|
+
...{ name: "YcCardRenderer" },
|
|
24
|
+
__name: "card-renderer",
|
|
25
|
+
props: {
|
|
26
|
+
card: {},
|
|
27
|
+
compact: { type: Boolean, default: false },
|
|
28
|
+
uploadFile: { type: Function, default: void 0 },
|
|
29
|
+
submitAction: { type: Function, default: void 0 },
|
|
30
|
+
inlineFeedback: { type: Boolean, default: true }
|
|
31
|
+
},
|
|
32
|
+
emits: ["action", "feedback"],
|
|
33
|
+
setup(__props, { emit: __emit }) {
|
|
34
|
+
const props = __props;
|
|
35
|
+
const emit = __emit;
|
|
36
|
+
const DEFAULT_ACTIONS = [
|
|
37
|
+
{ action: "reply", label: "\u63D0\u4EA4", primary: true },
|
|
38
|
+
{ action: "reset", label: "\u91CD\u7F6E" }
|
|
39
|
+
];
|
|
40
|
+
const elements = computed(
|
|
41
|
+
() => {
|
|
42
|
+
var _a;
|
|
43
|
+
return Array.isArray((_a = props.card) == null ? void 0 : _a.elements) ? props.card.elements : [];
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
function toField(element) {
|
|
47
|
+
const { type: _type, value: _value, ...field } = element;
|
|
48
|
+
return field;
|
|
49
|
+
}
|
|
50
|
+
const fieldElements = computed(
|
|
51
|
+
() => elements.value.filter((el) => (el == null ? void 0 : el.type) === "field" && Boolean(el.name))
|
|
52
|
+
);
|
|
53
|
+
const form = useCardForm(
|
|
54
|
+
computed(() => fieldElements.value.map(toField)),
|
|
55
|
+
computed(() => {
|
|
56
|
+
const initial = {};
|
|
57
|
+
for (const el of fieldElements.value) {
|
|
58
|
+
if (el.value !== void 0 && el.value !== null && el.value !== "") initial[el.name] = el.value;
|
|
59
|
+
}
|
|
60
|
+
return initial;
|
|
61
|
+
})
|
|
62
|
+
);
|
|
63
|
+
const hasActions = computed(() => elements.value.some((el) => (el == null ? void 0 : el.type) === "actions"));
|
|
64
|
+
const blocks = computed(() => {
|
|
65
|
+
const result = [];
|
|
66
|
+
let group = null;
|
|
67
|
+
const appended = form.fields.value.filter((field) => form.appendedNames.value.has(field.name));
|
|
68
|
+
const pushAppended = () => {
|
|
69
|
+
if (!appended.length) return;
|
|
70
|
+
result.push({ kind: "fields", key: "appended", fields: appended.filter((f) => f.visible !== false) });
|
|
71
|
+
appended.length = 0;
|
|
72
|
+
};
|
|
73
|
+
elements.value.forEach((el, idx) => {
|
|
74
|
+
var _a;
|
|
75
|
+
if (!el || typeof el !== "object") return;
|
|
76
|
+
if (el.type === "field") {
|
|
77
|
+
if (el.visible === false || !el.name) return;
|
|
78
|
+
if (!group) {
|
|
79
|
+
group = [];
|
|
80
|
+
result.push({ kind: "fields", key: `fields-${idx}`, fields: group });
|
|
81
|
+
}
|
|
82
|
+
group.push(toField(el));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
group = null;
|
|
86
|
+
if (el.type === "actions") {
|
|
87
|
+
pushAppended();
|
|
88
|
+
result.push({ kind: "actions", key: `actions-${idx}`, actions: (_a = el.items) != null ? _a : [] });
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
result.push({ kind: "element", key: `${el.type}-${idx}`, element: el });
|
|
92
|
+
});
|
|
93
|
+
pushAppended();
|
|
94
|
+
if (!hasActions.value && fieldElements.value.length) {
|
|
95
|
+
result.push({ kind: "actions", key: "actions-default", actions: DEFAULT_ACTIONS });
|
|
96
|
+
}
|
|
97
|
+
return result;
|
|
98
|
+
});
|
|
99
|
+
const accent = computed(() => fieldElements.value.length > 0 || hasActions.value);
|
|
100
|
+
const submitting = ref("");
|
|
101
|
+
const submitted = ref(false);
|
|
102
|
+
const errorMessage = ref("");
|
|
103
|
+
const successMessage = ref("");
|
|
104
|
+
function report(feedback) {
|
|
105
|
+
if (feedback.type === "success") {
|
|
106
|
+
successMessage.value = feedback.message;
|
|
107
|
+
errorMessage.value = "";
|
|
108
|
+
} else {
|
|
109
|
+
errorMessage.value = feedback.message;
|
|
110
|
+
}
|
|
111
|
+
emit("feedback", feedback);
|
|
112
|
+
}
|
|
113
|
+
function actionItems(actions, blockKey) {
|
|
114
|
+
return actions.map((item, idx) => ({
|
|
115
|
+
key: `${blockKey}:${idx}`,
|
|
116
|
+
label: item.label,
|
|
117
|
+
primary: item.primary,
|
|
118
|
+
disabled: submitted.value && item.action !== "link"
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
function findAction(key) {
|
|
122
|
+
const [blockKey, idx] = key.split(":");
|
|
123
|
+
const block = blocks.value.find((b) => b.key === blockKey);
|
|
124
|
+
return (block == null ? void 0 : block.kind) === "actions" ? block.actions[Number(idx)] : void 0;
|
|
125
|
+
}
|
|
126
|
+
async function handleAction(key) {
|
|
127
|
+
var _a, _b, _c;
|
|
128
|
+
const action = findAction(key);
|
|
129
|
+
if (!action || submitting.value) return;
|
|
130
|
+
if (action.action === "link") {
|
|
131
|
+
if (action.url) emit("action", { action: "link", url: action.url });
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (action.action === "reset") {
|
|
135
|
+
form.reset();
|
|
136
|
+
errorMessage.value = "";
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
errorMessage.value = "";
|
|
140
|
+
successMessage.value = "";
|
|
141
|
+
const invalid = form.validate();
|
|
142
|
+
if (invalid) {
|
|
143
|
+
report({ type: "validation", message: invalid.message, field: invalid.field });
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const attachments = form.attachments();
|
|
147
|
+
const prefix = ((_a = action.replyPrefix) == null ? void 0 : _a.trim()) || `\u8BF7\u6309\u4EE5\u4E0B\u4FE1\u606F${(_c = (_b = props.card) == null ? void 0 : _b.title) != null ? _c : ""}`;
|
|
148
|
+
const payload = {
|
|
149
|
+
action: "reply",
|
|
150
|
+
text: form.replyText(prefix),
|
|
151
|
+
values: { ...form.values },
|
|
152
|
+
...attachments.length ? { attachments } : {}
|
|
153
|
+
};
|
|
154
|
+
if (!props.submitAction) {
|
|
155
|
+
submitted.value = true;
|
|
156
|
+
emit("action", payload);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
submitting.value = key;
|
|
160
|
+
try {
|
|
161
|
+
const result = await props.submitAction(payload);
|
|
162
|
+
if (result.ok) {
|
|
163
|
+
submitted.value = true;
|
|
164
|
+
report({ type: "success", message: result.message || "\u5DF2\u63D0\u4EA4" });
|
|
165
|
+
} else {
|
|
166
|
+
form.appendFields(result.missingFields);
|
|
167
|
+
report({ type: "error", message: result.message || "\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u8865\u5145\u540E\u91CD\u65B0\u63D0\u4EA4" });
|
|
168
|
+
}
|
|
169
|
+
} catch (err) {
|
|
170
|
+
report({ type: "error", message: err instanceof Error ? err.message : "\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5" });
|
|
171
|
+
} finally {
|
|
172
|
+
submitting.value = "";
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function textClass(tone) {
|
|
176
|
+
return `yc-card-renderer__text is-${tone != null ? tone : "default"}`;
|
|
177
|
+
}
|
|
178
|
+
return (_ctx, _cache) => {
|
|
179
|
+
var _a, _b, _c;
|
|
180
|
+
return openBlock(), createBlock(CardShell, {
|
|
181
|
+
class: normalizeClass(["yc-card-renderer", { "is-compact": __props.compact }]),
|
|
182
|
+
title: (_a = __props.card) == null ? void 0 : _a.title,
|
|
183
|
+
subtitle: (_b = __props.card) == null ? void 0 : _b.subtitle,
|
|
184
|
+
badge: (_c = __props.card) == null ? void 0 : _c.badge,
|
|
185
|
+
accent: accent.value,
|
|
186
|
+
compact: __props.compact
|
|
187
|
+
}, {
|
|
188
|
+
default: withCtx(() => [
|
|
189
|
+
createElementVNode("div", _hoisted_1, [
|
|
190
|
+
(openBlock(true), createElementBlock(
|
|
191
|
+
Fragment,
|
|
192
|
+
null,
|
|
193
|
+
renderList(blocks.value, (block) => {
|
|
194
|
+
return openBlock(), createElementBlock(
|
|
195
|
+
Fragment,
|
|
196
|
+
{
|
|
197
|
+
key: block.key
|
|
198
|
+
},
|
|
199
|
+
[
|
|
200
|
+
block.kind === "fields" ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
201
|
+
(openBlock(true), createElementBlock(
|
|
202
|
+
Fragment,
|
|
203
|
+
null,
|
|
204
|
+
renderList(block.fields, (field) => {
|
|
205
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
206
|
+
key: field.name,
|
|
207
|
+
field,
|
|
208
|
+
"model-value": unref(form).values[field.name],
|
|
209
|
+
options: unref(form).optionsOf(field),
|
|
210
|
+
disabled: submitted.value,
|
|
211
|
+
error: unref(form).errors[field.name],
|
|
212
|
+
hint: unref(form).appendedNames.value.has(field.name) ? "\u9700\u8865\u5145" : "",
|
|
213
|
+
"upload-file": __props.uploadFile,
|
|
214
|
+
"onUpdate:modelValue": (value) => unref(form).setValue(field.name, value),
|
|
215
|
+
onBlur: ($event) => unref(form).values[field.name] !== void 0 && unref(form).validateField(field),
|
|
216
|
+
onUploadError: (message) => report({ type: "upload-error", message, field: field.name })
|
|
217
|
+
}, null, 8, ["field", "model-value", "options", "disabled", "error", "hint", "upload-file", "onUpdate:modelValue", "onBlur", "onUploadError"]);
|
|
218
|
+
}),
|
|
219
|
+
128
|
|
220
|
+
/* KEYED_FRAGMENT */
|
|
221
|
+
))
|
|
222
|
+
])) : block.kind === "actions" ? (openBlock(), createBlock(ActionBar, {
|
|
223
|
+
key: 1,
|
|
224
|
+
items: actionItems(block.actions, block.key),
|
|
225
|
+
"loading-key": submitting.value,
|
|
226
|
+
onClick: handleAction
|
|
227
|
+
}, null, 8, ["items", "loading-key"])) : (openBlock(), createElementBlock(
|
|
228
|
+
Fragment,
|
|
229
|
+
{ key: 2 },
|
|
230
|
+
[
|
|
231
|
+
block.element.type === "text" ? (openBlock(), createElementBlock(
|
|
232
|
+
"p",
|
|
233
|
+
{
|
|
234
|
+
key: 0,
|
|
235
|
+
class: normalizeClass(textClass(block.element.tone))
|
|
236
|
+
},
|
|
237
|
+
toDisplayString(block.element.text),
|
|
238
|
+
3
|
|
239
|
+
/* TEXT, CLASS */
|
|
240
|
+
)) : block.element.type === "status" ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
241
|
+
createVNode(StatusTag, {
|
|
242
|
+
text: block.element.text,
|
|
243
|
+
tone: block.element.tone
|
|
244
|
+
}, null, 8, ["text", "tone"])
|
|
245
|
+
])) : block.element.type === "alert" ? (openBlock(), createBlock(InlineAlert, {
|
|
246
|
+
key: 2,
|
|
247
|
+
text: block.element.text,
|
|
248
|
+
tone: block.element.tone
|
|
249
|
+
}, null, 8, ["text", "tone"])) : block.element.type === "kv" ? (openBlock(), createBlock(KvList, {
|
|
250
|
+
key: 3,
|
|
251
|
+
items: block.element.items,
|
|
252
|
+
columns: __props.compact ? 1 : block.element.columns,
|
|
253
|
+
bordered: ""
|
|
254
|
+
}, null, 8, ["items", "columns"])) : block.element.type === "metrics" ? (openBlock(), createBlock(MetricGrid, {
|
|
255
|
+
key: 4,
|
|
256
|
+
items: block.element.items,
|
|
257
|
+
bordered: ""
|
|
258
|
+
}, null, 8, ["items"])) : block.element.type === "table" ? (openBlock(), createBlock(DataTable, {
|
|
259
|
+
key: 5,
|
|
260
|
+
columns: block.element.columns,
|
|
261
|
+
rows: block.element.rows,
|
|
262
|
+
bordered: ""
|
|
263
|
+
}, null, 8, ["columns", "rows"])) : block.element.type === "divider" ? (openBlock(), createElementBlock("hr", _hoisted_4)) : createCommentVNode("v-if", true)
|
|
264
|
+
],
|
|
265
|
+
64
|
|
266
|
+
/* STABLE_FRAGMENT */
|
|
267
|
+
))
|
|
268
|
+
],
|
|
269
|
+
64
|
|
270
|
+
/* STABLE_FRAGMENT */
|
|
271
|
+
);
|
|
272
|
+
}),
|
|
273
|
+
128
|
|
274
|
+
/* KEYED_FRAGMENT */
|
|
275
|
+
)),
|
|
276
|
+
__props.inlineFeedback && errorMessage.value ? (openBlock(), createBlock(InlineAlert, {
|
|
277
|
+
key: 0,
|
|
278
|
+
tone: "error",
|
|
279
|
+
text: errorMessage.value
|
|
280
|
+
}, null, 8, ["text"])) : createCommentVNode("v-if", true),
|
|
281
|
+
__props.inlineFeedback && successMessage.value ? (openBlock(), createBlock(InlineAlert, {
|
|
282
|
+
key: 1,
|
|
283
|
+
tone: "success",
|
|
284
|
+
text: successMessage.value
|
|
285
|
+
}, null, 8, ["text"])) : createCommentVNode("v-if", true)
|
|
286
|
+
])
|
|
287
|
+
]),
|
|
288
|
+
_: 1
|
|
289
|
+
/* STABLE */
|
|
290
|
+
}, 8, ["class", "title", "subtitle", "badge", "accent", "compact"]);
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
export { _sfc_main as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _sfc_main from './detail-card2.vue.mjs';
|
|
2
2
|
import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
3
3
|
|
|
4
|
-
var DetailCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
var DetailCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1bb9c82b"]]);
|
|
5
5
|
|
|
6
6
|
export { DetailCard as default };
|
|
@@ -1,29 +1,13 @@
|
|
|
1
|
-
import { defineComponent, openBlock,
|
|
1
|
+
import { defineComponent, openBlock, createBlock, withCtx, createElementBlock, toDisplayString, createCommentVNode } from 'vue';
|
|
2
|
+
import CardShell from './elements/card-shell.vue.mjs';
|
|
3
|
+
import KvList from './elements/kv-list.vue.mjs';
|
|
2
4
|
|
|
3
|
-
const _hoisted_1 = {
|
|
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 = {
|
|
5
|
+
const _hoisted_1 = {
|
|
14
6
|
key: 1,
|
|
15
|
-
class: "yc-display-
|
|
7
|
+
class: "yc-display-detail-card__empty"
|
|
16
8
|
};
|
|
17
|
-
const
|
|
18
|
-
key: 1,
|
|
19
|
-
class: "yc-display-detail-card__fields"
|
|
20
|
-
};
|
|
21
|
-
const _hoisted_7 = {
|
|
9
|
+
const _hoisted_2 = {
|
|
22
10
|
key: 2,
|
|
23
|
-
class: "yc-display-card__empty"
|
|
24
|
-
};
|
|
25
|
-
const _hoisted_8 = {
|
|
26
|
-
key: 3,
|
|
27
11
|
class: "yc-display-detail-card__note"
|
|
28
12
|
};
|
|
29
13
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -38,79 +22,29 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
38
22
|
},
|
|
39
23
|
setup(__props) {
|
|
40
24
|
return (_ctx, _cache) => {
|
|
41
|
-
var _a, _b
|
|
42
|
-
return openBlock(),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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 */
|
|
25
|
+
var _a, _b;
|
|
26
|
+
return openBlock(), createBlock(CardShell, {
|
|
27
|
+
class: "yc-display-detail-card",
|
|
28
|
+
title: __props.title,
|
|
29
|
+
subtitle: __props.subtitle,
|
|
30
|
+
badge: ((_a = __props.status) == null ? void 0 : _a.text) ? { text: __props.status.text, tone: (_b = __props.status.type) != null ? _b : "info" } : void 0
|
|
31
|
+
}, {
|
|
32
|
+
default: withCtx(() => [
|
|
33
|
+
__props.fields.length ? (openBlock(), createBlock(KvList, {
|
|
34
|
+
key: 0,
|
|
35
|
+
items: __props.fields
|
|
36
|
+
}, null, 8, ["items"])) : (openBlock(), createElementBlock("div", _hoisted_1, "\u6682\u65E0\u53EF\u5C55\u793A\u7684\u8BE6\u60C5\u5B57\u6BB5")),
|
|
37
|
+
__props.note ? (openBlock(), createElementBlock(
|
|
38
|
+
"div",
|
|
39
|
+
_hoisted_2,
|
|
40
|
+
toDisplayString(__props.note),
|
|
41
|
+
1
|
|
42
|
+
/* TEXT */
|
|
69
43
|
)) : createCommentVNode("v-if", true)
|
|
70
|
-
])
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
]);
|
|
44
|
+
]),
|
|
45
|
+
_: 1
|
|
46
|
+
/* STABLE */
|
|
47
|
+
}, 8, ["title", "subtitle", "badge"]);
|
|
114
48
|
};
|
|
115
49
|
}
|
|
116
50
|
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, Fragment, renderList, normalizeClass, toDisplayString } from 'vue';
|
|
2
|
+
|
|
3
|
+
const _hoisted_1 = { class: "yc-action-bar" };
|
|
4
|
+
const _hoisted_2 = ["disabled", "onClick"];
|
|
5
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
...{ name: "YcCardActions" },
|
|
7
|
+
__name: "action-bar",
|
|
8
|
+
props: {
|
|
9
|
+
items: { default: () => [] },
|
|
10
|
+
loadingKey: { default: "" },
|
|
11
|
+
disabled: { type: Boolean, default: false }
|
|
12
|
+
},
|
|
13
|
+
emits: ["click"],
|
|
14
|
+
setup(__props, { emit: __emit }) {
|
|
15
|
+
const emit = __emit;
|
|
16
|
+
return (_ctx, _cache) => {
|
|
17
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
18
|
+
(openBlock(true), createElementBlock(
|
|
19
|
+
Fragment,
|
|
20
|
+
null,
|
|
21
|
+
renderList(__props.items, (item) => {
|
|
22
|
+
return openBlock(), createElementBlock("button", {
|
|
23
|
+
key: item.key,
|
|
24
|
+
type: "button",
|
|
25
|
+
class: normalizeClass(["yc-action-bar__btn", item.primary ? "is-primary" : "is-default"]),
|
|
26
|
+
disabled: __props.disabled || item.disabled || Boolean(__props.loadingKey),
|
|
27
|
+
onClick: ($event) => emit("click", item.key)
|
|
28
|
+
}, toDisplayString(__props.loadingKey === item.key ? item.loadingLabel || "\u5904\u7406\u4E2D\u2026" : item.label), 11, _hoisted_2);
|
|
29
|
+
}),
|
|
30
|
+
128
|
|
31
|
+
/* KEYED_FRAGMENT */
|
|
32
|
+
))
|
|
33
|
+
]);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export { _sfc_main as default };
|