@expcat/tigercat-vue 2.0.19 → 2.1.1
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/README.md +20 -10
- package/dist/chunk-26QCTL2E.mjs +180 -0
- package/dist/{chunk-7W3NALIL.mjs → chunk-3FPS7XVB.mjs} +26 -27
- package/dist/{chunk-2OI6GWOT.mjs → chunk-3KAHJF7D.mjs} +12 -11
- package/dist/chunk-3OCHBGPF.mjs +835 -0
- package/dist/chunk-3ONCXHE5.mjs +184 -0
- package/dist/{chunk-4HUYX5WW.mjs → chunk-4PQZMDBK.mjs} +29 -8
- package/dist/{chunk-DI6RRAGQ.mjs → chunk-562Z32GR.mjs} +3 -3
- package/dist/{chunk-OQVGB7X6.mjs → chunk-626VUZ2Q.mjs} +1 -1
- package/dist/{chunk-WUQMFKQ6.mjs → chunk-67VS6QHJ.mjs} +29 -15
- package/dist/chunk-6GR3XC5V.mjs +281 -0
- package/dist/chunk-6GR5U4UB.mjs +225 -0
- package/dist/{chunk-KFJIZED5.mjs → chunk-6JAAXPBW.mjs} +7 -6
- package/dist/{chunk-XGXZF27U.mjs → chunk-6NYC7EY2.mjs} +32 -18
- package/dist/{chunk-6BDDX2R4.mjs → chunk-73Z7N7VG.mjs} +1 -4
- package/dist/chunk-7C7SG3SS.mjs +269 -0
- package/dist/{chunk-NNC75I7F.mjs → chunk-7TJE7OYH.mjs} +7 -6
- package/dist/{chunk-AU6IC6K7.mjs → chunk-ABNS4B5V.mjs} +35 -15
- package/dist/chunk-AECXFT7D.mjs +121 -0
- package/dist/chunk-AOLRZG4E.mjs +347 -0
- package/dist/chunk-AY7CGLMO.mjs +368 -0
- package/dist/chunk-BBNCP55O.mjs +156 -0
- 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-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-KOG3HKOF.mjs → chunk-GQOPDD44.mjs} +2 -5
- package/dist/{chunk-5RXYJWNA.mjs → chunk-H4DEIGEG.mjs} +77 -25
- package/dist/{chunk-ZGA66PSG.mjs → chunk-IK2WHKDA.mjs} +32 -18
- 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-5E4LINDO.mjs → chunk-LH2V2JMZ.mjs} +26 -10
- package/dist/{chunk-PQBKN2NH.mjs → chunk-LRFKHJDU.mjs} +14 -5
- package/dist/{chunk-OTHJIFDV.mjs → chunk-M4FWWEMX.mjs} +18 -9
- package/dist/{chunk-NGAA73CV.mjs → chunk-N2XV37BL.mjs} +40 -44
- package/dist/{chunk-2LIIMWBR.mjs → chunk-OYU47A57.mjs} +1 -2
- package/dist/{chunk-KU2Q5V3L.mjs → chunk-P62TYR3M.mjs} +18 -2
- package/dist/chunk-P6FMU4AT.mjs +54 -0
- package/dist/{chunk-P5FDKBXG.mjs → chunk-P7X46BAW.mjs} +70 -3
- package/dist/chunk-PFIV5MXD.mjs +48 -0
- 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-PWWWACHC.mjs +302 -0
- 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-MAKOSWR6.mjs → chunk-RHQWQJ4I.mjs} +7 -6
- package/dist/{chunk-GS4SV2HK.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-2XCXK3NQ.mjs → chunk-SX3NAN4M.mjs} +1 -1
- package/dist/chunk-TBOXTAIA.mjs +94 -0
- package/dist/{chunk-JL3CN4UK.mjs → chunk-TDBMAKTJ.mjs} +10 -3
- package/dist/{chunk-EDBMWZKH.mjs → chunk-TPESRDUG.mjs} +5 -1
- 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-UR5F74ZB.mjs +601 -0
- package/dist/{chunk-VCCK4CDT.mjs → chunk-URPXBKK4.mjs} +23 -5
- package/dist/chunk-UUWPSRNV.mjs +337 -0
- package/dist/chunk-UXJRH72H.mjs +834 -0
- package/dist/chunk-VFS5XAZ3.mjs +602 -0
- 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-3KITFMBJ.mjs → chunk-X5LJT76O.mjs} +52 -35
- 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 +29 -11
- package/dist/components/ActivityFeed.mjs +3 -3
- package/dist/components/Affix.d.mts +4 -4
- package/dist/components/Affix.mjs +1 -1
- package/dist/components/Alert.d.mts +4 -4
- package/dist/components/Anchor.d.mts +2 -2
- package/dist/components/Anchor.mjs +1 -1
- package/dist/components/AreaChart.d.mts +3 -3
- package/dist/components/AreaChart.mjs +5 -4
- package/dist/components/AspectRatio.d.mts +44 -0
- package/dist/components/AspectRatio.mjs +8 -0
- package/dist/components/AutoComplete.d.mts +3 -3
- package/dist/components/AutoComplete.mjs +1 -1
- package/dist/components/Avatar.d.mts +2 -2
- package/dist/components/AvatarGroup.d.mts +2 -2
- package/dist/components/BackTop.d.mts +2 -2
- package/dist/components/Badge.d.mts +5 -5
- package/dist/components/BarChart.d.mts +2 -2
- package/dist/components/BarChart.mjs +5 -4
- package/dist/components/Breadcrumb.d.mts +2 -2
- package/dist/components/Button.d.mts +5 -5
- package/dist/components/ButtonGroup.d.mts +1 -1
- package/dist/components/Calendar.d.mts +2 -2
- package/dist/components/Calendar.mjs +1 -1
- package/dist/components/Card.d.mts +3 -3
- package/dist/components/Carousel.d.mts +3 -3
- package/dist/components/Cascader.d.mts +37 -3
- package/dist/components/Cascader.mjs +1 -1
- package/dist/components/ChartCanvas.d.mts +8 -4
- package/dist/components/ChartCanvas.mjs +1 -1
- package/dist/components/ChartGrid.d.mts +1 -1
- package/dist/components/ChartLegend.d.mts +2 -2
- package/dist/components/ChartTooltip.d.mts +1 -1
- package/dist/components/ChatWindow.d.mts +29 -11
- package/dist/components/ChatWindow.mjs +4 -4
- package/dist/components/Checkbox.d.mts +1 -1
- package/dist/components/Code.d.mts +33 -6
- package/dist/components/Code.mjs +3 -1
- package/dist/components/CodeEditor.d.mts +1 -1
- package/dist/components/CodeEditor.mjs +1 -1
- package/dist/components/Collapse.d.mts +1 -1
- package/dist/components/CollapsePanel.mjs +1 -1
- package/dist/components/ColorPicker.mjs +1 -1
- package/dist/components/ColorSwatch.d.mts +8 -2
- 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/Container.d.mts +1 -1
- package/dist/components/ContextMenu.d.mts +234 -0
- package/dist/components/ContextMenu.mjs +17 -0
- package/dist/components/Countdown.d.mts +1 -1
- package/dist/components/CronEditor.d.mts +3 -3
- package/dist/components/CropUpload.d.mts +1 -1
- package/dist/components/DataExport.d.mts +1 -1
- package/dist/components/DataExport.mjs +2 -2
- package/dist/components/DataTableWithToolbar.d.mts +11 -11
- package/dist/components/DataTableWithToolbar.mjs +8 -8
- package/dist/components/DatePicker.d.mts +5 -5
- package/dist/components/Descriptions.d.mts +3 -3
- package/dist/components/DonutChart.d.mts +3 -3
- package/dist/components/DonutChart.mjs +5 -5
- package/dist/components/Drawer.d.mts +6 -6
- package/dist/components/Dropdown.d.mts +21 -2
- package/dist/components/Dropdown.mjs +1 -1
- package/dist/components/Empty.d.mts +1 -1
- package/dist/components/FileManager.d.mts +10 -4
- package/dist/components/FileManager.mjs +1 -1
- package/dist/components/FloatButton.d.mts +37 -7
- package/dist/components/FloatButton.mjs +1 -1
- package/dist/components/Form.d.mts +2 -2
- package/dist/components/FormWizard.d.mts +4 -4
- package/dist/components/FormWizard.mjs +1 -1
- package/dist/components/FunnelChart.d.mts +4 -4
- package/dist/components/FunnelChart.mjs +4 -4
- package/dist/components/Gantt.d.mts +6 -4
- package/dist/components/Gantt.mjs +2 -2
- package/dist/components/GaugeChart.d.mts +4 -4
- package/dist/components/GaugeChart.mjs +2 -2
- package/dist/components/Header.d.mts +1 -1
- package/dist/components/HeatmapChart.d.mts +3 -3
- package/dist/components/HeatmapChart.mjs +3 -3
- package/dist/components/Highlight.d.mts +146 -0
- package/dist/components/Highlight.mjs +8 -0
- package/dist/components/Icon.d.mts +2 -2
- package/dist/components/Image.d.mts +2 -2
- package/dist/components/Image.mjs +3 -3
- package/dist/components/ImageAnnotation.d.mts +4 -4
- package/dist/components/ImageCompare.d.mts +284 -0
- package/dist/components/ImageCompare.mjs +8 -0
- package/dist/components/ImageCropper.d.mts +1 -1
- package/dist/components/ImageGroup.mjs +2 -2
- package/dist/components/ImagePreview.d.mts +1 -1
- package/dist/components/ImagePreview.mjs +1 -1
- package/dist/components/ImageViewer.d.mts +1 -1
- package/dist/components/InfiniteScroll.d.mts +4 -4
- package/dist/components/Input.d.mts +7 -7
- package/dist/components/Input.mjs +1 -1
- package/dist/components/InputGroup.d.mts +2 -2
- package/dist/components/InputNumber.d.mts +3 -3
- package/dist/components/InputNumber.mjs +1 -1
- package/dist/components/InputOTP.d.mts +261 -0
- package/dist/components/InputOTP.mjs +11 -0
- package/dist/components/Kanban.d.mts +1 -1
- package/dist/components/Kanban.mjs +2 -2
- package/dist/components/Kbd.d.mts +118 -0
- package/dist/components/Kbd.mjs +8 -0
- package/dist/components/LineChart.d.mts +2 -2
- package/dist/components/LineChart.mjs +5 -4
- package/dist/components/Link.d.mts +1 -1
- package/dist/components/List.d.mts +7 -7
- package/dist/components/List.mjs +2 -2
- package/dist/components/Loading.d.mts +7 -7
- package/dist/components/Loading.mjs +1 -1
- package/dist/components/LoadingBar.d.mts +8 -0
- package/dist/components/LoadingBar.mjs +114 -0
- package/dist/components/LoadingBarContainer.d.mts +78 -0
- package/dist/components/LoadingBarContainer.mjs +8 -0
- package/dist/components/LoadingBarRoot.d.mts +6 -0
- package/dist/components/LoadingBarRoot.mjs +6 -0
- package/dist/components/MarkdownEditor.d.mts +4 -4
- package/dist/components/Marquee.d.mts +158 -0
- package/dist/components/Marquee.mjs +8 -0
- package/dist/components/MaskInput.d.mts +207 -0
- package/dist/components/MaskInput.mjs +11 -0
- package/dist/components/Masonry.d.mts +66 -0
- package/dist/components/Masonry.mjs +8 -0
- package/dist/components/Mentions.d.mts +1 -1
- package/dist/components/Menu.d.mts +4 -4
- package/dist/components/Modal.d.mts +7 -7
- package/dist/components/NavigationMenu.d.mts +411 -0
- package/dist/components/NavigationMenu.mjs +25 -0
- package/dist/components/NotificationCenter.d.mts +48 -30
- package/dist/components/NotificationCenter.mjs +4 -4
- package/dist/components/NumberKeyboard.d.mts +4 -4
- package/dist/components/OrgChart.d.mts +4 -4
- package/dist/components/OrgChart.mjs +2 -2
- package/dist/components/PageHeader.d.mts +140 -0
- package/dist/components/PageHeader.mjs +11 -0
- package/dist/components/Pagination.d.mts +5 -5
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/PieChart.d.mts +3 -3
- package/dist/components/PieChart.mjs +4 -4
- package/dist/components/Popconfirm.d.mts +4 -4
- package/dist/components/Popconfirm.mjs +2 -2
- package/dist/components/Popover.d.mts +5 -5
- package/dist/components/Popover.mjs +2 -2
- package/dist/components/Progress.d.mts +7 -7
- package/dist/components/QRCode.d.mts +4 -13
- package/dist/components/QRCode.mjs +1 -1
- package/dist/components/RadarChart.d.mts +3 -3
- package/dist/components/RadarChart.mjs +4 -4
- package/dist/components/Radio.d.mts +1 -1
- package/dist/components/Radio.mjs +1 -1
- package/dist/components/Rate.d.mts +1 -1
- package/dist/components/Rate.mjs +1 -1
- package/dist/components/Result.d.mts +1 -1
- package/dist/components/RichTextEditor.d.mts +4 -4
- package/dist/components/Row.d.mts +1 -1
- package/dist/components/ScatterChart.d.mts +3 -3
- package/dist/components/ScatterChart.mjs +5 -4
- package/dist/components/ScrollArea.d.mts +136 -0
- package/dist/components/ScrollArea.mjs +8 -0
- package/dist/components/ScrollSpy.d.mts +2 -2
- package/dist/components/ScrollSpy.mjs +1 -1
- package/dist/components/Segmented.d.mts +2 -2
- package/dist/components/Select.d.mts +3 -3
- package/dist/components/Signature.d.mts +6 -6
- package/dist/components/Signature.mjs +1 -1
- package/dist/components/Skeleton.d.mts +2 -2
- package/dist/components/Slider.d.mts +19 -1
- package/dist/components/Slider.mjs +1 -1
- package/dist/components/Space.d.mts +2 -2
- package/dist/components/SplitButton.d.mts +286 -0
- package/dist/components/SplitButton.mjs +12 -0
- package/dist/components/Splitter.d.mts +4 -4
- package/dist/components/Splitter.mjs +1 -1
- package/dist/components/Spotlight.d.mts +6 -6
- package/dist/components/Statistic.d.mts +1 -1
- package/dist/components/Stepper.d.mts +7 -1
- package/dist/components/Stepper.mjs +1 -1
- package/dist/components/Steps.d.mts +1 -1
- package/dist/components/SunburstChart.d.mts +2 -2
- package/dist/components/SunburstChart.mjs +4 -4
- package/dist/components/Switch.d.mts +22 -6
- package/dist/components/Switch.mjs +1 -1
- package/dist/components/Table.d.mts +9 -9
- package/dist/components/Table.mjs +3 -3
- package/dist/components/Tabs.d.mts +5 -5
- package/dist/components/Tag.d.mts +3 -3
- package/dist/components/TagsInput.d.mts +214 -0
- package/dist/components/TagsInput.mjs +12 -0
- package/dist/components/TaskBoard.d.mts +2 -2
- package/dist/components/TaskBoard.mjs +1 -1
- package/dist/components/Text.d.mts +3 -3
- package/dist/components/Textarea.d.mts +4 -4
- package/dist/components/Textarea.mjs +1 -1
- package/dist/components/TimePicker.d.mts +6 -6
- package/dist/components/Timeline.d.mts +2 -2
- package/dist/components/Tooltip.d.mts +2 -2
- package/dist/components/Tooltip.mjs +2 -2
- package/dist/components/Tour.d.mts +4 -4
- package/dist/components/Tour.mjs +1 -1
- package/dist/components/Transfer.d.mts +5 -4
- package/dist/components/Transfer.mjs +1 -1
- package/dist/components/Tree.d.mts +6 -6
- package/dist/components/TreeMapChart.d.mts +3 -3
- package/dist/components/TreeMapChart.mjs +4 -4
- package/dist/components/TreeSelect.d.mts +54 -3
- package/dist/components/TreeSelect.mjs +2 -1
- package/dist/components/Upload.d.mts +4 -4
- package/dist/components/Upload.mjs +1 -1
- package/dist/components/VirtualTable.d.mts +5 -5
- package/dist/components/Watermark.d.mts +6 -6
- package/dist/composables/useChartInteraction.d.mts +5 -0
- package/dist/composables/useChartInteraction.mjs +1 -1
- package/dist/index.d.mts +17 -1
- package/dist/index.mjs +406 -0
- package/package.json +117 -2
- package/dist/chunk-OTGGPXDT.mjs +0 -433
- package/dist/chunk-WC5MKASU.mjs +0 -393
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useTigerConfig
|
|
3
|
+
} from "./chunk-UOJOJBEU.mjs";
|
|
4
|
+
|
|
1
5
|
// src/components/Code.ts
|
|
2
6
|
import { computed, defineComponent, h, onBeforeUnmount, ref } from "vue";
|
|
3
7
|
import {
|
|
@@ -6,7 +10,10 @@ import {
|
|
|
6
10
|
copyTextToClipboard,
|
|
7
11
|
getCodeBlockContainerClasses,
|
|
8
12
|
getCodeBlockCopyButtonClasses,
|
|
9
|
-
|
|
13
|
+
getCodeLabels,
|
|
14
|
+
mergeStyleValues,
|
|
15
|
+
mergeTigerLocale,
|
|
16
|
+
resolveLocaleText
|
|
10
17
|
} from "@expcat/tigercat-core";
|
|
11
18
|
var Code = defineComponent({
|
|
12
19
|
name: "TigerCode",
|
|
@@ -22,11 +29,23 @@ var Code = defineComponent({
|
|
|
22
29
|
},
|
|
23
30
|
copyLabel: {
|
|
24
31
|
type: String,
|
|
25
|
-
default:
|
|
32
|
+
default: void 0
|
|
26
33
|
},
|
|
27
34
|
copiedLabel: {
|
|
28
35
|
type: String,
|
|
29
|
-
default:
|
|
36
|
+
default: void 0
|
|
37
|
+
},
|
|
38
|
+
copyFailedLabel: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: void 0
|
|
41
|
+
},
|
|
42
|
+
locale: {
|
|
43
|
+
type: Object,
|
|
44
|
+
default: void 0
|
|
45
|
+
},
|
|
46
|
+
labels: {
|
|
47
|
+
type: Object,
|
|
48
|
+
default: void 0
|
|
30
49
|
},
|
|
31
50
|
className: {
|
|
32
51
|
type: String,
|
|
@@ -39,14 +58,31 @@ var Code = defineComponent({
|
|
|
39
58
|
},
|
|
40
59
|
emits: ["copy"],
|
|
41
60
|
setup(props, { emit, attrs }) {
|
|
42
|
-
const
|
|
61
|
+
const config = useTigerConfig();
|
|
62
|
+
const copyStatus = ref("idle");
|
|
43
63
|
const timerRef = ref(null);
|
|
64
|
+
const mergedLocale = computed(() => mergeTigerLocale(config.value.locale, props.locale));
|
|
65
|
+
const labels = computed(() => getCodeLabels(mergedLocale.value, props.labels));
|
|
66
|
+
const resolvedCopyLabel = computed(
|
|
67
|
+
() => resolveLocaleText(labels.value.copyLabel, props.copyLabel)
|
|
68
|
+
);
|
|
69
|
+
const resolvedCopiedLabel = computed(
|
|
70
|
+
() => resolveLocaleText(labels.value.copiedLabel, props.copiedLabel)
|
|
71
|
+
);
|
|
72
|
+
const resolvedCopyFailedLabel = computed(
|
|
73
|
+
() => resolveLocaleText(labels.value.copyFailedLabel, props.copyFailedLabel)
|
|
74
|
+
);
|
|
75
|
+
const buttonLabel = computed(() => {
|
|
76
|
+
if (copyStatus.value === "failed") return resolvedCopyFailedLabel.value;
|
|
77
|
+
if (copyStatus.value === "copied") return resolvedCopiedLabel.value;
|
|
78
|
+
return resolvedCopyLabel.value;
|
|
79
|
+
});
|
|
44
80
|
const containerClasses = computed(() => {
|
|
45
81
|
const attrsRecord = attrs;
|
|
46
82
|
return getCodeBlockContainerClasses(props.className, coerceClassValue(attrsRecord.class));
|
|
47
83
|
});
|
|
48
84
|
const copyButtonClasses = computed(() => {
|
|
49
|
-
return getCodeBlockCopyButtonClasses(
|
|
85
|
+
return getCodeBlockCopyButtonClasses(copyStatus.value);
|
|
50
86
|
});
|
|
51
87
|
const clearTimer = () => {
|
|
52
88
|
if (timerRef.value != null) {
|
|
@@ -57,12 +93,15 @@ var Code = defineComponent({
|
|
|
57
93
|
const handleCopy = async () => {
|
|
58
94
|
if (!props.copyable) return;
|
|
59
95
|
const ok = await copyTextToClipboard(props.code);
|
|
60
|
-
if (!ok) return;
|
|
61
|
-
isCopied.value = true;
|
|
62
|
-
emit("copy", props.code);
|
|
63
96
|
clearTimer();
|
|
97
|
+
if (ok) {
|
|
98
|
+
copyStatus.value = "copied";
|
|
99
|
+
emit("copy", props.code);
|
|
100
|
+
} else {
|
|
101
|
+
copyStatus.value = "failed";
|
|
102
|
+
}
|
|
64
103
|
timerRef.value = window.setTimeout(() => {
|
|
65
|
-
|
|
104
|
+
copyStatus.value = "idle";
|
|
66
105
|
timerRef.value = null;
|
|
67
106
|
}, 1500);
|
|
68
107
|
};
|
|
@@ -84,9 +123,9 @@ var Code = defineComponent({
|
|
|
84
123
|
type: "button",
|
|
85
124
|
class: copyButtonClasses.value,
|
|
86
125
|
onClick: handleCopy,
|
|
87
|
-
"aria-label":
|
|
126
|
+
"aria-label": buttonLabel.value
|
|
88
127
|
},
|
|
89
|
-
|
|
128
|
+
buttonLabel.value
|
|
90
129
|
) : null
|
|
91
130
|
]
|
|
92
131
|
);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useChartInteraction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FHUGOSEY.mjs";
|
|
4
|
+
import {
|
|
5
|
+
ChartSeries
|
|
6
|
+
} from "./chunk-2ZUEXCVJ.mjs";
|
|
4
7
|
import {
|
|
5
8
|
ChartTooltip
|
|
6
9
|
} from "./chunk-SPFL55TF.mjs";
|
|
7
10
|
import {
|
|
8
11
|
ChartCanvas
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SNNT64HK.mjs";
|
|
10
13
|
import {
|
|
11
14
|
ChartLegend
|
|
12
15
|
} from "./chunk-V443QIJM.mjs";
|
|
13
|
-
import {
|
|
14
|
-
ChartSeries
|
|
15
|
-
} from "./chunk-2ZUEXCVJ.mjs";
|
|
16
16
|
|
|
17
17
|
// src/components/FunnelChart.ts
|
|
18
18
|
import { defineComponent, computed, h, useId } from "vue";
|
|
@@ -78,6 +78,7 @@ var FunnelChart = defineComponent({
|
|
|
78
78
|
wrapperClasses
|
|
79
79
|
} = useChartInteraction({
|
|
80
80
|
hoverable: computed(() => props.hoverable),
|
|
81
|
+
showTooltip: computed(() => props.showTooltip),
|
|
81
82
|
hoveredIndexProp: () => props.hoveredIndex,
|
|
82
83
|
selectable: computed(() => props.selectable),
|
|
83
84
|
selectedIndexProp: () => props.selectedIndex,
|
|
@@ -209,7 +210,7 @@ var FunnelChart = defineComponent({
|
|
|
209
210
|
}
|
|
210
211
|
}
|
|
211
212
|
);
|
|
212
|
-
const tooltip = props.showTooltip
|
|
213
|
+
const tooltip = props.showTooltip ? h(ChartTooltip, {
|
|
213
214
|
content: tooltipContent.value,
|
|
214
215
|
open: resolvedHoveredIndex.value !== null && tooltipContent.value !== "",
|
|
215
216
|
x: tooltipPosition.value.x,
|
|
@@ -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),
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// src/components/LoadingBarContainer.ts
|
|
2
|
+
import { computed, defineComponent, h } from "vue";
|
|
3
|
+
import {
|
|
4
|
+
classNames,
|
|
5
|
+
coerceClassValue,
|
|
6
|
+
DEFAULT_LOADING_BAR_ARIA_LABEL,
|
|
7
|
+
DEFAULT_LOADING_BAR_COLOR,
|
|
8
|
+
DEFAULT_LOADING_BAR_HEIGHT,
|
|
9
|
+
getLoadingBarContainerClasses,
|
|
10
|
+
getLoadingBarFillClasses,
|
|
11
|
+
getLoadingBarFillStyle,
|
|
12
|
+
LOADING_BAR_CONTAINER_ID,
|
|
13
|
+
mergeStyleValues
|
|
14
|
+
} from "@expcat/tigercat-core";
|
|
15
|
+
var LoadingBarContainer = /* @__PURE__ */ defineComponent({
|
|
16
|
+
name: "TigerLoadingBarContainer",
|
|
17
|
+
inheritAttrs: false,
|
|
18
|
+
props: {
|
|
19
|
+
percentage: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 0
|
|
22
|
+
},
|
|
23
|
+
status: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: "idle"
|
|
26
|
+
},
|
|
27
|
+
color: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: DEFAULT_LOADING_BAR_COLOR
|
|
30
|
+
},
|
|
31
|
+
height: {
|
|
32
|
+
type: Number,
|
|
33
|
+
default: DEFAULT_LOADING_BAR_HEIGHT
|
|
34
|
+
},
|
|
35
|
+
className: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: void 0
|
|
38
|
+
},
|
|
39
|
+
style: {
|
|
40
|
+
type: Object,
|
|
41
|
+
default: void 0
|
|
42
|
+
},
|
|
43
|
+
ariaLabel: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: void 0
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
setup(props, { attrs }) {
|
|
49
|
+
const containerClasses = computed(
|
|
50
|
+
() => getLoadingBarContainerClasses(classNames(props.className, coerceClassValue(attrs.class)))
|
|
51
|
+
);
|
|
52
|
+
const fillClasses = computed(() => getLoadingBarFillClasses(props.status, props.color));
|
|
53
|
+
const fillStyle = computed(() => getLoadingBarFillStyle(props.percentage, props.height));
|
|
54
|
+
const resolvedAriaLabel = computed(
|
|
55
|
+
() => props.ariaLabel?.trim() || DEFAULT_LOADING_BAR_ARIA_LABEL
|
|
56
|
+
);
|
|
57
|
+
return () => {
|
|
58
|
+
const isBusy = props.status === "loading";
|
|
59
|
+
return h(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
...attrs,
|
|
63
|
+
class: containerClasses.value,
|
|
64
|
+
style: mergeStyleValues(attrs.style, props.style, { height: `${props.height}px` }),
|
|
65
|
+
id: LOADING_BAR_CONTAINER_ID,
|
|
66
|
+
"data-tiger-loading-bar-container": "",
|
|
67
|
+
"data-tiger-loading-bar-status": props.status
|
|
68
|
+
},
|
|
69
|
+
[
|
|
70
|
+
h("div", {
|
|
71
|
+
class: fillClasses.value,
|
|
72
|
+
style: fillStyle.value,
|
|
73
|
+
role: "progressbar",
|
|
74
|
+
"aria-label": resolvedAriaLabel.value,
|
|
75
|
+
"aria-valuemin": 0,
|
|
76
|
+
"aria-valuemax": 100,
|
|
77
|
+
"aria-valuenow": Math.round(props.percentage),
|
|
78
|
+
"aria-busy": isBusy ? "true" : void 0,
|
|
79
|
+
"aria-live": "polite",
|
|
80
|
+
"aria-atomic": "true",
|
|
81
|
+
"data-tiger-loading-bar": "",
|
|
82
|
+
"data-tiger-loading-bar-status": props.status
|
|
83
|
+
})
|
|
84
|
+
]
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
var LoadingBarContainer_default = LoadingBarContainer;
|
|
90
|
+
|
|
91
|
+
export {
|
|
92
|
+
LoadingBarContainer,
|
|
93
|
+
LoadingBarContainer_default
|
|
94
|
+
};
|