@expcat/tigercat-vue 2.1.0 → 2.1.2
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/{chunk-7W3NALIL.mjs → chunk-3FPS7XVB.mjs} +26 -27
- package/dist/{chunk-2OI6GWOT.mjs → chunk-3KAHJF7D.mjs} +12 -11
- package/dist/{chunk-IEAEB4TX.mjs → chunk-3OCHBGPF.mjs} +242 -51
- package/dist/{chunk-OHR7IUBQ.mjs → chunk-5OILGUNU.mjs} +2 -2
- package/dist/{chunk-OQVGB7X6.mjs → chunk-626VUZ2Q.mjs} +1 -1
- package/dist/{chunk-66OS5A4D.mjs → chunk-67VS6QHJ.mjs} +26 -12
- package/dist/{chunk-EHGFW5GX.mjs → chunk-6JAAXPBW.mjs} +4 -3
- package/dist/{chunk-JHMT5Q6P.mjs → chunk-6NYC7EY2.mjs} +29 -15
- package/dist/{chunk-6BDDX2R4.mjs → chunk-73Z7N7VG.mjs} +1 -4
- package/dist/{chunk-F3ZVVVYD.mjs → chunk-7C7SG3SS.mjs} +15 -3
- package/dist/{chunk-CHEXI7MO.mjs → chunk-7TJE7OYH.mjs} +4 -3
- package/dist/{chunk-EGIMTTZA.mjs → chunk-BOHE5URZ.mjs} +18 -3
- package/dist/{chunk-5RIHHZF6.mjs → chunk-BQK7LH2L.mjs} +4 -1
- package/dist/{chunk-E6EZHSGY.mjs → chunk-BSOLH6R5.mjs} +0 -1
- package/dist/{chunk-RSM6FOWX.mjs → chunk-CCC3S6LK.mjs} +6 -3
- package/dist/{chunk-U75YXWSA.mjs → chunk-CLTRADS7.mjs} +17 -5
- package/dist/{chunk-BEIPGX74.mjs → chunk-DRLQCY7R.mjs} +162 -7
- package/dist/{chunk-KBJANUZZ.mjs → chunk-E523VGZP.mjs} +1 -1
- package/dist/{chunk-4HUYX5WW.mjs → chunk-EC62TY2Y.mjs} +80 -19
- package/dist/{chunk-D3U2NJ32.mjs → chunk-FEQ7PZXI.mjs} +8 -2
- package/dist/{chunk-PE5OA4YG.mjs → chunk-FHUGOSEY.mjs} +8 -2
- package/dist/{chunk-OAPIT53X.mjs → chunk-FIEECAJV.mjs} +7 -10
- package/dist/{chunk-7SFB77JR.mjs → chunk-GBPMQJJJ.mjs} +8 -1
- package/dist/{chunk-6AMWX5K4.mjs → chunk-GQOPDD44.mjs} +1 -1
- package/dist/{chunk-5RXYJWNA.mjs → chunk-H4DEIGEG.mjs} +77 -25
- package/dist/{chunk-AU6IC6K7.mjs → chunk-IFASMNTU.mjs} +36 -16
- package/dist/{chunk-EZYOCPMM.mjs → chunk-IK2WHKDA.mjs} +29 -15
- package/dist/{chunk-HGXD57QM.mjs → chunk-JBS3AESR.mjs} +65 -23
- package/dist/{chunk-PYRKFQ6J.mjs → chunk-JIU5UEOU.mjs} +70 -26
- package/dist/{chunk-JALHMWKW.mjs → chunk-K5MHUMKR.mjs} +2 -2
- package/dist/{chunk-BZ6MVFV7.mjs → chunk-K5RYFPOQ.mjs} +17 -19
- package/dist/{chunk-DI6RRAGQ.mjs → chunk-KIUGJNQO.mjs} +4 -4
- package/dist/{chunk-5E4LINDO.mjs → chunk-LH2V2JMZ.mjs} +26 -10
- package/dist/{chunk-PQBKN2NH.mjs → chunk-LRFKHJDU.mjs} +14 -5
- package/dist/{chunk-W5XFWVNV.mjs → chunk-M4FWWEMX.mjs} +15 -6
- package/dist/{chunk-VLW3UBIR.mjs → chunk-N2XV37BL.mjs} +37 -41
- package/dist/{chunk-2LIIMWBR.mjs → chunk-OYU47A57.mjs} +1 -2
- package/dist/{chunk-KU2Q5V3L.mjs → chunk-P62TYR3M.mjs} +18 -2
- package/dist/{chunk-P5FDKBXG.mjs → chunk-P7X46BAW.mjs} +70 -3
- package/dist/{chunk-KROVW4AW.mjs → chunk-PJQTRDIG.mjs} +13 -3
- package/dist/{chunk-26OI3TEA.mjs → chunk-PMQSXEMT.mjs} +42 -6
- package/dist/{chunk-XLNK3Z2P.mjs → chunk-POWDTOMF.mjs} +88 -79
- package/dist/{chunk-AXDBME5A.mjs → chunk-PSGVG4TN.mjs} +38 -21
- package/dist/{chunk-7DWWNFRP.mjs → chunk-PWWWACHC.mjs} +1 -1
- package/dist/{chunk-UUWTKCMY.mjs → chunk-QWLD5FMJ.mjs} +1 -1
- package/dist/{chunk-ALIUAGJO.mjs → chunk-QZLOF36M.mjs} +7 -13
- package/dist/{chunk-WLYQHKLZ.mjs → chunk-QZRSFGZZ.mjs} +50 -11
- package/dist/{chunk-37W7XTA6.mjs → chunk-RHQWQJ4I.mjs} +4 -3
- package/dist/{chunk-32X54QKW.mjs → chunk-RRLE7QRH.mjs} +43 -22
- package/dist/{chunk-RID7A5V7.mjs → chunk-RRNQL6MJ.mjs} +23 -6
- package/dist/{chunk-VJ6YM2EW.mjs → chunk-S4BKVFQ7.mjs} +1 -1
- package/dist/{chunk-LPZBXTJ6.mjs → chunk-SAC4PAG3.mjs} +4 -4
- package/dist/{chunk-W5RZPTFD.mjs → chunk-SNNT64HK.mjs} +13 -2
- package/dist/{chunk-N3C6YI7I.mjs → chunk-SWMYIORV.mjs} +22 -7
- package/dist/{chunk-U4B5QT72.mjs → chunk-SX3NAN4M.mjs} +1 -1
- package/dist/{chunk-JL3CN4UK.mjs → chunk-TDBMAKTJ.mjs} +10 -3
- package/dist/chunk-UEGNXN5B.mjs +28 -0
- package/dist/{chunk-NEEGXKJW.mjs → chunk-UGHLEKEZ.mjs} +22 -3
- package/dist/{chunk-HKYRRQS7.mjs → chunk-UNQO7EVG.mjs} +1 -1
- package/dist/{chunk-VN2TWPRC.mjs → chunk-UR5F74ZB.mjs} +112 -18
- package/dist/{chunk-VCCK4CDT.mjs → chunk-URPXBKK4.mjs} +23 -5
- package/dist/{chunk-7KCOF5US.mjs → chunk-VY6FVIOZ.mjs} +10 -8
- package/dist/{chunk-KICZSLOX.mjs → chunk-W2ICYZVU.mjs} +1 -1
- package/dist/{chunk-FIVVKBBF.mjs → chunk-W3QOMJKQ.mjs} +8 -6
- package/dist/{chunk-DCMRB3HR.mjs → chunk-WV25G4M3.mjs} +4 -3
- package/dist/{chunk-ZOYHZF4N.mjs → chunk-X5LJT76O.mjs} +49 -32
- package/dist/{chunk-FSJRNEZK.mjs → chunk-YLO73TDM.mjs} +4 -4
- package/dist/{chunk-BNYA5IUB.mjs → chunk-YNXP34KO.mjs} +39 -38
- package/dist/{chunk-2T2NEZRZ.mjs → chunk-YVDTXHQ6.mjs} +1 -1
- package/dist/{chunk-AUMTHL6N.mjs → chunk-ZOP7PEKY.mjs} +2 -1
- package/dist/components/ActivityFeed.d.mts +23 -5
- package/dist/components/ActivityFeed.mjs +2 -2
- package/dist/components/Affix.mjs +1 -1
- package/dist/components/Alert.d.mts +1 -1
- package/dist/components/Anchor.d.mts +1 -1
- package/dist/components/Anchor.mjs +1 -1
- package/dist/components/AreaChart.mjs +4 -3
- package/dist/components/AutoComplete.mjs +1 -1
- package/dist/components/BarChart.mjs +4 -3
- package/dist/components/Calendar.mjs +1 -1
- package/dist/components/Cascader.mjs +1 -1
- package/dist/components/ChartCanvas.d.mts +7 -3
- package/dist/components/ChartCanvas.mjs +1 -1
- package/dist/components/ChatWindow.d.mts +26 -8
- package/dist/components/ChatWindow.mjs +3 -3
- package/dist/components/Checkbox.d.mts +1 -1
- package/dist/components/Code.d.mts +34 -7
- package/dist/components/Code.mjs +3 -1
- package/dist/components/CodeEditor.d.mts +1 -1
- package/dist/components/CollapsePanel.mjs +1 -1
- package/dist/components/ColorPicker.d.mts +19 -1
- package/dist/components/ColorPicker.mjs +3 -1
- package/dist/components/ColorSwatch.d.mts +6 -0
- package/dist/components/ColorSwatch.mjs +1 -1
- package/dist/components/CommentThread.d.mts +63 -27
- package/dist/components/CommentThread.mjs +2 -2
- package/dist/components/ContextMenu.d.mts +2 -2
- package/dist/components/Countdown.d.mts +2 -2
- package/dist/components/CronEditor.d.mts +1 -1
- package/dist/components/DataExport.mjs +2 -2
- package/dist/components/DataTableWithToolbar.mjs +8 -8
- package/dist/components/DatePicker.d.mts +1 -1
- package/dist/components/Descriptions.d.mts +1 -1
- package/dist/components/DonutChart.mjs +4 -4
- package/dist/components/Drawer.d.mts +1 -1
- package/dist/components/Dropdown.d.mts +21 -2
- package/dist/components/Dropdown.mjs +1 -1
- package/dist/components/FileManager.d.mts +7 -1
- package/dist/components/FileManager.mjs +1 -1
- package/dist/components/FloatButton.d.mts +31 -1
- package/dist/components/FloatButton.mjs +1 -1
- package/dist/components/FormWizard.mjs +1 -1
- package/dist/components/FunnelChart.mjs +3 -3
- package/dist/components/Gantt.d.mts +3 -1
- package/dist/components/Gantt.mjs +2 -2
- package/dist/components/GaugeChart.mjs +2 -2
- package/dist/components/HeatmapChart.mjs +3 -3
- package/dist/components/Icon.d.mts +1 -1
- package/dist/components/Image.d.mts +1 -1
- package/dist/components/Image.mjs +3 -3
- package/dist/components/ImageAnnotation.d.mts +1 -1
- package/dist/components/ImageGroup.mjs +2 -2
- package/dist/components/ImagePreview.mjs +1 -1
- package/dist/components/Input.mjs +1 -1
- package/dist/components/InputNumber.mjs +1 -1
- package/dist/components/InputOTP.d.mts +1 -1
- package/dist/components/Kanban.mjs +2 -2
- package/dist/components/LineChart.mjs +4 -3
- package/dist/components/Link.d.mts +1 -1
- package/dist/components/List.mjs +2 -2
- package/dist/components/Loading.mjs +1 -1
- package/dist/components/MarkdownEditor.d.mts +1 -1
- package/dist/components/MarkdownEditor.mjs +1 -1
- package/dist/components/MaskInput.d.mts +9 -3
- package/dist/components/MaskInput.mjs +1 -1
- package/dist/components/Menu.d.mts +2 -2
- package/dist/components/Modal.d.mts +1 -1
- package/dist/components/NavigationMenu.d.mts +3 -3
- package/dist/components/NotificationCenter.d.mts +44 -26
- package/dist/components/NotificationCenter.mjs +4 -4
- package/dist/components/NumberKeyboard.d.mts +1 -1
- package/dist/components/OrgChart.mjs +2 -2
- package/dist/components/PageHeader.d.mts +1 -1
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/PieChart.mjs +3 -3
- package/dist/components/Popconfirm.d.mts +1 -1
- package/dist/components/Popconfirm.mjs +2 -2
- package/dist/components/Popover.d.mts +2 -2
- package/dist/components/Popover.mjs +2 -2
- package/dist/components/QRCode.d.mts +2 -11
- package/dist/components/QRCode.mjs +1 -1
- package/dist/components/RadarChart.mjs +3 -3
- package/dist/components/Radio.d.mts +1 -1
- package/dist/components/Radio.mjs +1 -1
- package/dist/components/Rate.mjs +1 -1
- package/dist/components/Result.d.mts +1 -1
- package/dist/components/RichTextEditor.d.mts +1 -1
- package/dist/components/RichTextEditor.mjs +1 -1
- package/dist/components/ScatterChart.mjs +4 -3
- package/dist/components/ScrollSpy.mjs +1 -1
- package/dist/components/Select.d.mts +4 -6
- package/dist/components/Select.mjs +1 -1
- package/dist/components/Signature.mjs +1 -1
- package/dist/components/Slider.d.mts +18 -0
- package/dist/components/Slider.mjs +1 -1
- package/dist/components/SplitButton.d.mts +1 -1
- package/dist/components/SplitButton.mjs +2 -2
- package/dist/components/Splitter.d.mts +4 -4
- package/dist/components/Splitter.mjs +1 -1
- package/dist/components/Spotlight.d.mts +1 -1
- package/dist/components/Statistic.d.mts +2 -2
- package/dist/components/Stepper.d.mts +7 -1
- package/dist/components/Stepper.mjs +1 -1
- package/dist/components/SunburstChart.mjs +3 -3
- package/dist/components/Switch.d.mts +22 -6
- package/dist/components/Switch.mjs +1 -1
- package/dist/components/Table.d.mts +4 -4
- package/dist/components/Table.mjs +4 -4
- package/dist/components/TagsInput.d.mts +1 -1
- package/dist/components/TaskBoard.mjs +1 -1
- package/dist/components/Text.d.mts +2 -2
- package/dist/components/Textarea.mjs +1 -1
- package/dist/components/TimePicker.d.mts +1 -1
- package/dist/components/Tooltip.d.mts +1 -1
- package/dist/components/Tooltip.mjs +2 -2
- package/dist/components/Tour.mjs +1 -1
- package/dist/components/Transfer.d.mts +2 -1
- package/dist/components/Transfer.mjs +1 -1
- package/dist/components/TreeMapChart.mjs +3 -3
- package/dist/components/TreeSelect.mjs +1 -1
- package/dist/components/Upload.d.mts +1 -1
- package/dist/components/Upload.mjs +1 -1
- package/dist/components/Watermark.d.mts +1 -1
- package/dist/composables/useChartInteraction.d.mts +5 -0
- package/dist/composables/useChartInteraction.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +57 -0
- package/package.json +2 -2
|
@@ -4,19 +4,22 @@ import {
|
|
|
4
4
|
} from "./chunk-U6OGGZBY.mjs";
|
|
5
5
|
import {
|
|
6
6
|
List
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GQOPDD44.mjs";
|
|
8
8
|
import {
|
|
9
9
|
Button
|
|
10
10
|
} from "./chunk-YZBQ6IR7.mjs";
|
|
11
11
|
import {
|
|
12
12
|
Loading
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZOP7PEKY.mjs";
|
|
14
14
|
import {
|
|
15
15
|
Text
|
|
16
16
|
} from "./chunk-NN6AINLG.mjs";
|
|
17
17
|
import {
|
|
18
18
|
Card
|
|
19
19
|
} from "./chunk-TC6ZPQFT.mjs";
|
|
20
|
+
import {
|
|
21
|
+
useTigerConfig
|
|
22
|
+
} from "./chunk-UOJOJBEU.mjs";
|
|
20
23
|
|
|
21
24
|
// src/components/NotificationCenter.ts
|
|
22
25
|
import { defineComponent, computed, ref, watch, h } from "vue";
|
|
@@ -25,7 +28,10 @@ import {
|
|
|
25
28
|
coerceClassValue,
|
|
26
29
|
mergeStyleValues,
|
|
27
30
|
buildNotificationGroups,
|
|
28
|
-
formatActivityTime
|
|
31
|
+
formatActivityTime,
|
|
32
|
+
getNotificationCenterLabels,
|
|
33
|
+
mergeTigerLocale,
|
|
34
|
+
resolveLocaleText
|
|
29
35
|
} from "@expcat/tigercat-core";
|
|
30
36
|
|
|
31
37
|
// ../core/src/internal/notification-center-styles.ts
|
|
@@ -100,39 +106,47 @@ var NotificationCenter = defineComponent({
|
|
|
100
106
|
},
|
|
101
107
|
loadingText: {
|
|
102
108
|
type: String,
|
|
103
|
-
default:
|
|
109
|
+
default: void 0
|
|
104
110
|
},
|
|
105
111
|
emptyText: {
|
|
106
112
|
type: String,
|
|
107
|
-
default:
|
|
113
|
+
default: void 0
|
|
108
114
|
},
|
|
109
115
|
title: {
|
|
110
116
|
type: String,
|
|
111
|
-
default:
|
|
117
|
+
default: void 0
|
|
112
118
|
},
|
|
113
119
|
allLabel: {
|
|
114
120
|
type: String,
|
|
115
|
-
default:
|
|
121
|
+
default: void 0
|
|
116
122
|
},
|
|
117
123
|
unreadLabel: {
|
|
118
124
|
type: String,
|
|
119
|
-
default:
|
|
125
|
+
default: void 0
|
|
120
126
|
},
|
|
121
127
|
readLabel: {
|
|
122
128
|
type: String,
|
|
123
|
-
default:
|
|
129
|
+
default: void 0
|
|
124
130
|
},
|
|
125
131
|
markAllReadText: {
|
|
126
132
|
type: String,
|
|
127
|
-
default:
|
|
133
|
+
default: void 0
|
|
128
134
|
},
|
|
129
135
|
markReadText: {
|
|
130
136
|
type: String,
|
|
131
|
-
default:
|
|
137
|
+
default: void 0
|
|
132
138
|
},
|
|
133
139
|
markUnreadText: {
|
|
134
140
|
type: String,
|
|
135
|
-
default:
|
|
141
|
+
default: void 0
|
|
142
|
+
},
|
|
143
|
+
locale: {
|
|
144
|
+
type: Object,
|
|
145
|
+
default: void 0
|
|
146
|
+
},
|
|
147
|
+
labels: {
|
|
148
|
+
type: Object,
|
|
149
|
+
default: void 0
|
|
136
150
|
},
|
|
137
151
|
manageReadState: {
|
|
138
152
|
type: Boolean,
|
|
@@ -157,6 +171,9 @@ var NotificationCenter = defineComponent({
|
|
|
157
171
|
"item-read-change"
|
|
158
172
|
],
|
|
159
173
|
setup(props, { emit, attrs }) {
|
|
174
|
+
const config = useTigerConfig();
|
|
175
|
+
const mergedLocale = computed(() => mergeTigerLocale(config.value.locale, props.locale));
|
|
176
|
+
const labels = computed(() => getNotificationCenterLabels(mergedLocale.value, props.labels));
|
|
160
177
|
const resolvedGroups = computed(
|
|
161
178
|
() => buildNotificationGroups(props.items, props.groups, props.groupBy, props.groupOrder)
|
|
162
179
|
);
|
|
@@ -296,9 +313,9 @@ var NotificationCenter = defineComponent({
|
|
|
296
313
|
};
|
|
297
314
|
const renderReadFilterButtons = () => {
|
|
298
315
|
const options = [
|
|
299
|
-
{ key: "all", label: props.allLabel },
|
|
300
|
-
{ key: "unread", label: props.unreadLabel },
|
|
301
|
-
{ key: "read", label: props.readLabel }
|
|
316
|
+
{ key: "all", label: resolveLocaleText(labels.value.allLabel, props.allLabel) },
|
|
317
|
+
{ key: "unread", label: resolveLocaleText(labels.value.unreadLabel, props.unreadLabel) },
|
|
318
|
+
{ key: "read", label: resolveLocaleText(labels.value.readLabel, props.readLabel) }
|
|
302
319
|
];
|
|
303
320
|
return h(
|
|
304
321
|
"div",
|
|
@@ -380,7 +397,9 @@ var NotificationCenter = defineComponent({
|
|
|
380
397
|
handleItemReadChange(item, !isRead);
|
|
381
398
|
}
|
|
382
399
|
},
|
|
383
|
-
{
|
|
400
|
+
{
|
|
401
|
+
default: () => isRead ? resolveLocaleText(labels.value.markUnreadText, props.markUnreadText) : resolveLocaleText(labels.value.markReadText, props.markReadText)
|
|
402
|
+
}
|
|
384
403
|
)
|
|
385
404
|
]
|
|
386
405
|
);
|
|
@@ -424,7 +443,7 @@ var NotificationCenter = defineComponent({
|
|
|
424
443
|
color: "muted",
|
|
425
444
|
class: notificationCenterEmptyTextClasses
|
|
426
445
|
},
|
|
427
|
-
{ default: () => props.emptyText }
|
|
446
|
+
{ default: () => resolveLocaleText(labels.value.emptyText, props.emptyText) }
|
|
428
447
|
)
|
|
429
448
|
]
|
|
430
449
|
);
|
|
@@ -436,7 +455,7 @@ var NotificationCenter = defineComponent({
|
|
|
436
455
|
split: true,
|
|
437
456
|
bordered: "divided",
|
|
438
457
|
hoverable: true,
|
|
439
|
-
emptyText: props.emptyText,
|
|
458
|
+
emptyText: resolveLocaleText(labels.value.emptyText, props.emptyText),
|
|
440
459
|
onItemClick: handleItemClick
|
|
441
460
|
},
|
|
442
461
|
{
|
|
@@ -484,7 +503,7 @@ var NotificationCenter = defineComponent({
|
|
|
484
503
|
weight: "bold",
|
|
485
504
|
class: notificationCenterTitleClasses
|
|
486
505
|
},
|
|
487
|
-
{ default: () => props.title }
|
|
506
|
+
{ default: () => resolveLocaleText(labels.value.title, props.title) }
|
|
488
507
|
),
|
|
489
508
|
totalUnread.value > 0 ? h(
|
|
490
509
|
"span",
|
|
@@ -506,20 +525,22 @@ var NotificationCenter = defineComponent({
|
|
|
506
525
|
),
|
|
507
526
|
onClick: handleMarkAllRead
|
|
508
527
|
},
|
|
509
|
-
{
|
|
528
|
+
{
|
|
529
|
+
default: () => resolveLocaleText(labels.value.markAllReadText, props.markAllReadText)
|
|
530
|
+
}
|
|
510
531
|
)
|
|
511
532
|
]),
|
|
512
533
|
renderReadFilterButtons()
|
|
513
534
|
]);
|
|
514
535
|
const content = props.loading ? h("div", { class: "flex items-center justify-center py-16" }, [
|
|
515
536
|
h(Loading, {
|
|
516
|
-
text: props.loadingText,
|
|
537
|
+
text: resolveLocaleText(labels.value.loadingText, props.loadingText),
|
|
517
538
|
class: notificationCenterLoadingClasses
|
|
518
539
|
})
|
|
519
540
|
]) : resolvedGroups.value.length > 0 ? h("div", { class: "-mx-4 -mb-4" }, [renderTabs()]) : h("div", { class: "-mx-4 -mb-4 max-h-[380px] overflow-y-auto" }, [
|
|
520
541
|
renderList(filteredFlatItems.value)
|
|
521
542
|
]);
|
|
522
|
-
const ariaLabel = attrs["aria-label"] ?? (attrs["aria-labelledby"] ? void 0 : props.title);
|
|
543
|
+
const ariaLabel = attrs["aria-label"] ?? (attrs["aria-labelledby"] ? void 0 : resolveLocaleText(labels.value.title, props.title));
|
|
523
544
|
return h(
|
|
524
545
|
"div",
|
|
525
546
|
{
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-3MO7A4GU.mjs";
|
|
7
7
|
import {
|
|
8
8
|
Loading
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZOP7PEKY.mjs";
|
|
10
10
|
import {
|
|
11
11
|
Tag
|
|
12
12
|
} from "./chunk-342DH5CF.mjs";
|
|
@@ -19,6 +19,9 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
Avatar
|
|
21
21
|
} from "./chunk-ZFTRR3KW.mjs";
|
|
22
|
+
import {
|
|
23
|
+
useTigerConfig
|
|
24
|
+
} from "./chunk-UOJOJBEU.mjs";
|
|
22
25
|
|
|
23
26
|
// src/components/ActivityFeed.ts
|
|
24
27
|
import { defineComponent, computed, h } from "vue";
|
|
@@ -28,6 +31,9 @@ import {
|
|
|
28
31
|
coerceClassValue,
|
|
29
32
|
formatActivityTime,
|
|
30
33
|
mergeStyleValues,
|
|
34
|
+
getActivityFeedLabels,
|
|
35
|
+
mergeTigerLocale,
|
|
36
|
+
resolveLocaleText,
|
|
31
37
|
toActivityTimelineItems,
|
|
32
38
|
activityItemClasses,
|
|
33
39
|
activityItemLayoutClasses,
|
|
@@ -120,11 +126,19 @@ var ActivityFeed = defineComponent({
|
|
|
120
126
|
},
|
|
121
127
|
loadingText: {
|
|
122
128
|
type: String,
|
|
123
|
-
default:
|
|
129
|
+
default: void 0
|
|
124
130
|
},
|
|
125
131
|
emptyText: {
|
|
126
132
|
type: String,
|
|
127
|
-
default:
|
|
133
|
+
default: void 0
|
|
134
|
+
},
|
|
135
|
+
locale: {
|
|
136
|
+
type: Object,
|
|
137
|
+
default: void 0
|
|
138
|
+
},
|
|
139
|
+
labels: {
|
|
140
|
+
type: Object,
|
|
141
|
+
default: void 0
|
|
128
142
|
},
|
|
129
143
|
showAvatar: {
|
|
130
144
|
type: Boolean,
|
|
@@ -148,6 +162,9 @@ var ActivityFeed = defineComponent({
|
|
|
148
162
|
}
|
|
149
163
|
},
|
|
150
164
|
setup(props, { slots, attrs }) {
|
|
165
|
+
const config = useTigerConfig();
|
|
166
|
+
const mergedLocale = computed(() => mergeTigerLocale(config.value.locale, props.locale));
|
|
167
|
+
const labels = computed(() => getActivityFeedLabels(mergedLocale.value, props.labels));
|
|
151
168
|
const resolvedGroups = computed(
|
|
152
169
|
() => buildActivityGroups(props.items, props.groups, props.groupBy, props.groupOrder)
|
|
153
170
|
);
|
|
@@ -246,13 +263,13 @@ var ActivityFeed = defineComponent({
|
|
|
246
263
|
};
|
|
247
264
|
const feedRole = computed(() => attrs.role ?? "feed");
|
|
248
265
|
const feedAriaLabel = computed(
|
|
249
|
-
() => attrs["aria-label"] ?? (attrs["aria-labelledby"] ? void 0 : "
|
|
266
|
+
() => attrs["aria-label"] ?? (attrs["aria-labelledby"] ? void 0 : "Activity")
|
|
250
267
|
);
|
|
251
268
|
const feedAriaBusy = computed(() => attrs["aria-busy"] ?? (props.loading ? "true" : void 0));
|
|
252
269
|
return () => {
|
|
253
270
|
if (props.loading) {
|
|
254
271
|
const loadingNode = slots.loading ? slots.loading() : h(Loading, {
|
|
255
|
-
text: props.loadingText,
|
|
272
|
+
text: resolveLocaleText(labels.value.loadingText, props.loadingText),
|
|
256
273
|
class: activityFeedLoadingClasses
|
|
257
274
|
});
|
|
258
275
|
return h(
|
|
@@ -303,7 +320,7 @@ var ActivityFeed = defineComponent({
|
|
|
303
320
|
h(
|
|
304
321
|
Text,
|
|
305
322
|
{ tag: "div", size: "sm", color: "muted", class: "font-medium" },
|
|
306
|
-
{ default: () => props.emptyText }
|
|
323
|
+
{ default: () => resolveLocaleText(labels.value.emptyText, props.emptyText) }
|
|
307
324
|
)
|
|
308
325
|
]);
|
|
309
326
|
return h(
|
|
@@ -265,8 +265,8 @@ var ImagePreview = defineComponent({
|
|
|
265
265
|
panState = createPanState();
|
|
266
266
|
pinchState = createPinchState();
|
|
267
267
|
};
|
|
268
|
-
const handleMaskClick = (
|
|
269
|
-
if (props.maskClosable
|
|
268
|
+
const handleMaskClick = () => {
|
|
269
|
+
if (props.maskClosable) {
|
|
270
270
|
handleClose();
|
|
271
271
|
}
|
|
272
272
|
};
|
|
@@ -299,7 +299,8 @@ var ImagePreview = defineComponent({
|
|
|
299
299
|
const currentSrc = props.images[index.value] || props.images[0];
|
|
300
300
|
const mask = h("div", {
|
|
301
301
|
class: imagePreviewMaskClasses,
|
|
302
|
-
"aria-hidden": "true"
|
|
302
|
+
"aria-hidden": "true",
|
|
303
|
+
onClick: handleMaskClick
|
|
303
304
|
});
|
|
304
305
|
const img = h("img", {
|
|
305
306
|
src: currentSrc,
|
|
@@ -409,7 +410,6 @@ var ImagePreview = defineComponent({
|
|
|
409
410
|
role: "dialog",
|
|
410
411
|
"aria-modal": "true",
|
|
411
412
|
"aria-label": labels.value.previewDialogAriaLabel,
|
|
412
|
-
onClick: handleMaskClick,
|
|
413
413
|
onWheel: handleWheel
|
|
414
414
|
},
|
|
415
415
|
[mask, img, closeBtn, prevBtn, nextBtn, toolbar]
|
|
@@ -11,6 +11,9 @@ import {
|
|
|
11
11
|
var ChartCanvas = defineComponent({
|
|
12
12
|
name: "TigerChartCanvas",
|
|
13
13
|
inheritAttrs: false,
|
|
14
|
+
emits: {
|
|
15
|
+
"resolved-size-change": (_size) => true
|
|
16
|
+
},
|
|
14
17
|
props: {
|
|
15
18
|
width: {
|
|
16
19
|
type: Number,
|
|
@@ -38,7 +41,7 @@ var ChartCanvas = defineComponent({
|
|
|
38
41
|
type: String
|
|
39
42
|
}
|
|
40
43
|
},
|
|
41
|
-
setup(props, { slots, attrs }) {
|
|
44
|
+
setup(props, { slots, attrs, emit }) {
|
|
42
45
|
const svgRef = ref(null);
|
|
43
46
|
const observedSize = ref(null);
|
|
44
47
|
const resizeController = createChartResizeObserverController({
|
|
@@ -74,6 +77,14 @@ var ChartCanvas = defineComponent({
|
|
|
74
77
|
};
|
|
75
78
|
onMounted(syncResponsiveObserver);
|
|
76
79
|
watch(() => props.responsive, syncResponsiveObserver);
|
|
80
|
+
watch(
|
|
81
|
+
[() => resolvedSize.value.width, () => resolvedSize.value.height],
|
|
82
|
+
([nextWidth, nextHeight], prev) => {
|
|
83
|
+
if (prev && prev[0] === nextWidth && prev[1] === nextHeight) return;
|
|
84
|
+
emit("resolved-size-change", { width: nextWidth, height: nextHeight });
|
|
85
|
+
},
|
|
86
|
+
{ immediate: true }
|
|
87
|
+
);
|
|
77
88
|
onBeforeUnmount(() => resizeController.disconnect());
|
|
78
89
|
return () => {
|
|
79
90
|
const rect = innerRect.value;
|
|
@@ -97,7 +108,7 @@ var ChartCanvas = defineComponent({
|
|
|
97
108
|
{
|
|
98
109
|
transform: `translate(${rect.x}, ${rect.y})`
|
|
99
110
|
},
|
|
100
|
-
slots.default?.({ innerRect: rect })
|
|
111
|
+
slots.default?.({ innerRect: rect, width: size.width, height: size.height })
|
|
101
112
|
)
|
|
102
113
|
].filter(Boolean)
|
|
103
114
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/components/Switch.ts
|
|
2
|
-
import { defineComponent, computed, h } from "vue";
|
|
2
|
+
import { defineComponent, computed, h, ref } from "vue";
|
|
3
3
|
import {
|
|
4
4
|
getSwitchClasses,
|
|
5
5
|
getSwitchThumbClasses,
|
|
@@ -10,10 +10,17 @@ var Switch = defineComponent({
|
|
|
10
10
|
inheritAttrs: false,
|
|
11
11
|
props: {
|
|
12
12
|
/**
|
|
13
|
-
* Whether the switch is checked
|
|
14
|
-
* @default false
|
|
13
|
+
* Whether the switch is checked (controlled mode)
|
|
15
14
|
*/
|
|
16
15
|
modelValue: {
|
|
16
|
+
type: [Boolean, null],
|
|
17
|
+
default: null
|
|
18
|
+
},
|
|
19
|
+
/**
|
|
20
|
+
* Default checked state (uncontrolled mode)
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
defaultValue: {
|
|
17
24
|
type: Boolean,
|
|
18
25
|
default: false
|
|
19
26
|
},
|
|
@@ -51,13 +58,21 @@ var Switch = defineComponent({
|
|
|
51
58
|
change: (value) => typeof value === "boolean"
|
|
52
59
|
},
|
|
53
60
|
setup(props, { emit, attrs }) {
|
|
61
|
+
const internalChecked = ref(props.defaultValue);
|
|
62
|
+
const isControlled = computed(() => props.modelValue !== null);
|
|
63
|
+
const checked = computed(
|
|
64
|
+
() => isControlled.value ? props.modelValue === true : internalChecked.value
|
|
65
|
+
);
|
|
54
66
|
const switchClasses = computed(
|
|
55
|
-
() => getSwitchClasses(props.size,
|
|
67
|
+
() => getSwitchClasses(props.size, checked.value, props.disabled, props.className, attrs.class)
|
|
56
68
|
);
|
|
57
|
-
const thumbClasses = computed(() => getSwitchThumbClasses(props.size,
|
|
69
|
+
const thumbClasses = computed(() => getSwitchThumbClasses(props.size, checked.value));
|
|
58
70
|
const emitChange = () => {
|
|
59
71
|
if (props.disabled) return;
|
|
60
|
-
const newValue = !
|
|
72
|
+
const newValue = !checked.value;
|
|
73
|
+
if (!isControlled.value) {
|
|
74
|
+
internalChecked.value = newValue;
|
|
75
|
+
}
|
|
61
76
|
emit("update:modelValue", newValue);
|
|
62
77
|
emit("change", newValue);
|
|
63
78
|
};
|
|
@@ -74,7 +89,7 @@ var Switch = defineComponent({
|
|
|
74
89
|
...attrs,
|
|
75
90
|
type: "button",
|
|
76
91
|
role: "switch",
|
|
77
|
-
"aria-checked":
|
|
92
|
+
"aria-checked": checked.value,
|
|
78
93
|
"aria-disabled": props.disabled ? "true" : void 0,
|
|
79
94
|
class: switchClasses.value,
|
|
80
95
|
style: mergeStyleValues(attrs.style, props.style),
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
calendarWeekdayClasses,
|
|
14
14
|
getCalendarDayClasses,
|
|
15
15
|
getCalendarMonthClasses,
|
|
16
|
+
isCalendarMonthDisabled,
|
|
16
17
|
isSameDay,
|
|
17
18
|
getMonthDays,
|
|
18
19
|
getShortDayNames,
|
|
@@ -79,8 +80,12 @@ var Calendar = defineComponent({
|
|
|
79
80
|
emit("change", date);
|
|
80
81
|
}
|
|
81
82
|
function selectMonth(monthIdx) {
|
|
83
|
+
if (isCalendarMonthDisabled(viewYear.value, monthIdx, props.disabledDate)) return;
|
|
82
84
|
viewMonth.value = monthIdx;
|
|
83
|
-
|
|
85
|
+
const date = new Date(viewYear.value, monthIdx, 1);
|
|
86
|
+
emit("update:modelValue", date);
|
|
87
|
+
emit("change", date);
|
|
88
|
+
emit("panel-change", date, "month");
|
|
84
89
|
}
|
|
85
90
|
const dayGridEl = ref(null);
|
|
86
91
|
const monthGridEl = ref(null);
|
|
@@ -261,6 +266,7 @@ var Calendar = defineComponent({
|
|
|
261
266
|
{ key: ri, class: "grid grid-cols-3 gap-2", role: "row" },
|
|
262
267
|
row.map((m, ci) => {
|
|
263
268
|
const i = ri * 3 + ci;
|
|
269
|
+
const isDisabled = isCalendarMonthDisabled(viewYear.value, i, props.disabledDate);
|
|
264
270
|
return h(
|
|
265
271
|
"button",
|
|
266
272
|
{
|
|
@@ -268,8 +274,9 @@ var Calendar = defineComponent({
|
|
|
268
274
|
type: "button",
|
|
269
275
|
role: "gridcell",
|
|
270
276
|
"aria-selected": viewMonth.value === i,
|
|
271
|
-
|
|
272
|
-
|
|
277
|
+
disabled: isDisabled,
|
|
278
|
+
tabindex: rovingMonthIdx === i && !isDisabled ? 0 : -1,
|
|
279
|
+
class: getCalendarMonthClasses(viewMonth.value === i, isDisabled),
|
|
273
280
|
onClick: () => selectMonth(i),
|
|
274
281
|
onFocus: () => activeMonthIdx.value = i,
|
|
275
282
|
onKeydown: (e) => handleMonthKeyDown(e, i)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// src/composables/useResponsiveChartSize.ts
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
import {
|
|
4
|
+
getChartInnerRect,
|
|
5
|
+
resolveResponsiveChartSize
|
|
6
|
+
} from "@expcat/tigercat-core";
|
|
7
|
+
function useResponsiveChartSize(width, height, padding, responsive) {
|
|
8
|
+
const observedSize = ref(null);
|
|
9
|
+
const plotSize = computed(
|
|
10
|
+
() => resolveResponsiveChartSize(
|
|
11
|
+
{ width: width(), height: height() },
|
|
12
|
+
responsive() ? observedSize.value : null
|
|
13
|
+
)
|
|
14
|
+
);
|
|
15
|
+
const innerRect = computed(
|
|
16
|
+
() => getChartInnerRect(plotSize.value.width, plotSize.value.height, padding())
|
|
17
|
+
);
|
|
18
|
+
function onResolvedSizeChange(size) {
|
|
19
|
+
const prev = observedSize.value;
|
|
20
|
+
if (prev && prev.width === size.width && prev.height === size.height) return;
|
|
21
|
+
observedSize.value = size;
|
|
22
|
+
}
|
|
23
|
+
return { plotSize, innerRect, onResolvedSizeChange };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
useResponsiveChartSize
|
|
28
|
+
};
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-UOJOJBEU.mjs";
|
|
4
4
|
|
|
5
5
|
// src/components/FileManager.ts
|
|
6
|
-
import { defineComponent, h, ref, computed, nextTick } from "vue";
|
|
6
|
+
import { defineComponent, h, ref, computed, nextTick, watch } from "vue";
|
|
7
7
|
import {
|
|
8
8
|
classNames,
|
|
9
9
|
coerceClassValue,
|
|
@@ -41,6 +41,9 @@ var FileManager = defineComponent({
|
|
|
41
41
|
default: "list"
|
|
42
42
|
},
|
|
43
43
|
selectedKeys: {
|
|
44
|
+
type: Array
|
|
45
|
+
},
|
|
46
|
+
defaultSelectedKeys: {
|
|
44
47
|
type: Array,
|
|
45
48
|
default: () => []
|
|
46
49
|
},
|
|
@@ -88,6 +91,19 @@ var FileManager = defineComponent({
|
|
|
88
91
|
const focusedIndex = ref(0);
|
|
89
92
|
const contentRef = ref(null);
|
|
90
93
|
let dragFromIndex = null;
|
|
94
|
+
const innerSelectedKeys = ref([...props.defaultSelectedKeys ?? []]);
|
|
95
|
+
const isControlled = computed(() => props.selectedKeys !== void 0);
|
|
96
|
+
const resolvedKeys = computed(
|
|
97
|
+
() => isControlled.value ? props.selectedKeys ?? [] : innerSelectedKeys.value
|
|
98
|
+
);
|
|
99
|
+
watch(
|
|
100
|
+
() => props.selectedKeys,
|
|
101
|
+
(value) => {
|
|
102
|
+
if (value !== void 0) {
|
|
103
|
+
innerSelectedKeys.value = [...value];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
);
|
|
91
107
|
function handleDragStart(event, item, index) {
|
|
92
108
|
if (!props.draggable || item.disabled) return;
|
|
93
109
|
dragFromIndex = index;
|
|
@@ -122,7 +138,7 @@ var FileManager = defineComponent({
|
|
|
122
138
|
() => deriveFileManagerModel({
|
|
123
139
|
files: props.files,
|
|
124
140
|
currentPath: props.currentPath,
|
|
125
|
-
selectedKeys:
|
|
141
|
+
selectedKeys: resolvedKeys.value,
|
|
126
142
|
sortField: props.sortField,
|
|
127
143
|
sortOrder: props.sortOrder,
|
|
128
144
|
showHidden: props.showHidden,
|
|
@@ -135,7 +151,10 @@ var FileManager = defineComponent({
|
|
|
135
151
|
function handleSelect(item) {
|
|
136
152
|
if (item.disabled) return;
|
|
137
153
|
emit("select", item);
|
|
138
|
-
const keys = toggleFileSelection(
|
|
154
|
+
const keys = toggleFileSelection(resolvedKeys.value, item.key, props.multiple);
|
|
155
|
+
if (!isControlled.value) {
|
|
156
|
+
innerSelectedKeys.value = keys;
|
|
157
|
+
}
|
|
139
158
|
emit("update:selectedKeys", keys);
|
|
140
159
|
}
|
|
141
160
|
function handleOpen(item) {
|