@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
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button
|
|
3
|
+
} from "./chunk-YZBQ6IR7.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Link
|
|
6
|
+
} from "./chunk-3MO7A4GU.mjs";
|
|
7
|
+
|
|
8
|
+
// src/components/PageHeader.ts
|
|
9
|
+
import { defineComponent, getCurrentInstance, h } from "vue";
|
|
10
|
+
import {
|
|
11
|
+
chevronLeftSolidIcon20PathD,
|
|
12
|
+
coerceClassValue,
|
|
13
|
+
composeComponentClasses,
|
|
14
|
+
getPageHeaderBackButtonClasses,
|
|
15
|
+
getPageHeaderRootClasses,
|
|
16
|
+
hasPageHeaderHeadingContent,
|
|
17
|
+
icon20ViewBox,
|
|
18
|
+
mergeStyleValues,
|
|
19
|
+
pageHeaderActionsClasses,
|
|
20
|
+
pageHeaderBackIconClasses,
|
|
21
|
+
pageHeaderBackWrapClasses,
|
|
22
|
+
pageHeaderContentClasses,
|
|
23
|
+
pageHeaderHeadingRowClasses,
|
|
24
|
+
pageHeaderMainClasses,
|
|
25
|
+
pageHeaderStartClasses,
|
|
26
|
+
pageHeaderSubtitleClasses,
|
|
27
|
+
pageHeaderTitleClasses,
|
|
28
|
+
pageHeaderTitleRowClasses,
|
|
29
|
+
resolvePageHeaderBackAriaLabel,
|
|
30
|
+
resolvePageHeaderBackVisibility
|
|
31
|
+
} from "@expcat/tigercat-core";
|
|
32
|
+
function hasSlotContent(nodes) {
|
|
33
|
+
return Array.isArray(nodes) && nodes.length > 0;
|
|
34
|
+
}
|
|
35
|
+
function createBackIcon() {
|
|
36
|
+
return h(
|
|
37
|
+
"svg",
|
|
38
|
+
{
|
|
39
|
+
class: pageHeaderBackIconClasses,
|
|
40
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
41
|
+
viewBox: icon20ViewBox,
|
|
42
|
+
fill: "currentColor",
|
|
43
|
+
"aria-hidden": "true",
|
|
44
|
+
focusable: "false"
|
|
45
|
+
},
|
|
46
|
+
[
|
|
47
|
+
h("path", {
|
|
48
|
+
"fill-rule": "evenodd",
|
|
49
|
+
d: chevronLeftSolidIcon20PathD,
|
|
50
|
+
"clip-rule": "evenodd"
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
var PageHeader = defineComponent({
|
|
56
|
+
name: "TigerPageHeader",
|
|
57
|
+
inheritAttrs: false,
|
|
58
|
+
props: {
|
|
59
|
+
/**
|
|
60
|
+
* Whether to show the back control.
|
|
61
|
+
* When omitted, the control is shown if `@back`, `backHref`, or a `#back`
|
|
62
|
+
* slot is provided. Set `false` to force-hide.
|
|
63
|
+
*/
|
|
64
|
+
showBack: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: void 0
|
|
67
|
+
},
|
|
68
|
+
/**
|
|
69
|
+
* Navigation URL for the default back control. Renders a Link instead of
|
|
70
|
+
* a Button when set and no `#back` slot is provided.
|
|
71
|
+
*/
|
|
72
|
+
backHref: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: void 0
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* Accessible name for the default back control
|
|
78
|
+
* @default 'Back'
|
|
79
|
+
*/
|
|
80
|
+
backAriaLabel: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: void 0
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* Page title
|
|
86
|
+
*/
|
|
87
|
+
title: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: void 0
|
|
90
|
+
},
|
|
91
|
+
/**
|
|
92
|
+
* Secondary text shown beside the title
|
|
93
|
+
*/
|
|
94
|
+
subTitle: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: void 0
|
|
97
|
+
},
|
|
98
|
+
/**
|
|
99
|
+
* Additional CSS classes
|
|
100
|
+
*/
|
|
101
|
+
className: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: void 0
|
|
104
|
+
},
|
|
105
|
+
/**
|
|
106
|
+
* Inline styles
|
|
107
|
+
*/
|
|
108
|
+
style: {
|
|
109
|
+
type: Object,
|
|
110
|
+
default: void 0
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
emits: {
|
|
114
|
+
/**
|
|
115
|
+
* Emitted when the default back control is activated
|
|
116
|
+
*/
|
|
117
|
+
back: (event) => event instanceof MouseEvent
|
|
118
|
+
},
|
|
119
|
+
setup(props, { slots, emit, attrs }) {
|
|
120
|
+
const instance = getCurrentInstance();
|
|
121
|
+
const handleBack = (event) => {
|
|
122
|
+
emit("back", event);
|
|
123
|
+
};
|
|
124
|
+
return () => {
|
|
125
|
+
const attrsRecord = attrs;
|
|
126
|
+
const vnodeProps = instance?.vnode.props;
|
|
127
|
+
const breadcrumb = slots.breadcrumb?.();
|
|
128
|
+
const titleSlot = slots.title?.();
|
|
129
|
+
const subTitleSlot = slots.subTitle?.();
|
|
130
|
+
const actions = slots.actions?.();
|
|
131
|
+
const backOverride = slots.back?.();
|
|
132
|
+
const body = slots.default?.();
|
|
133
|
+
const hasBreadcrumb = hasSlotContent(breadcrumb);
|
|
134
|
+
const hasTitleSlot = hasSlotContent(titleSlot);
|
|
135
|
+
const hasSubTitleSlot = hasSlotContent(subTitleSlot);
|
|
136
|
+
const hasActions = hasSlotContent(actions);
|
|
137
|
+
const hasBackOverride = hasSlotContent(backOverride);
|
|
138
|
+
const hasBody = hasSlotContent(body);
|
|
139
|
+
const titleContent = hasTitleSlot ? titleSlot : props.title;
|
|
140
|
+
const subTitleContent = hasSubTitleSlot ? subTitleSlot : props.subTitle;
|
|
141
|
+
const hasTitle = hasTitleSlot || Boolean(props.title);
|
|
142
|
+
const hasSubtitle = hasSubTitleSlot || Boolean(props.subTitle);
|
|
143
|
+
const showBack = resolvePageHeaderBackVisibility({
|
|
144
|
+
showBack: props.showBack,
|
|
145
|
+
hasHandler: Boolean(vnodeProps && "onBack" in vnodeProps),
|
|
146
|
+
hasBackHref: Boolean(props.backHref),
|
|
147
|
+
hasBackOverride
|
|
148
|
+
});
|
|
149
|
+
const showHeading = hasPageHeaderHeadingContent({
|
|
150
|
+
showBack,
|
|
151
|
+
hasBreadcrumb,
|
|
152
|
+
hasTitle,
|
|
153
|
+
hasSubtitle,
|
|
154
|
+
hasActions
|
|
155
|
+
});
|
|
156
|
+
const backAriaLabel = resolvePageHeaderBackAriaLabel(props.backAriaLabel);
|
|
157
|
+
const backControl = showBack ? h("div", { class: pageHeaderBackWrapClasses, "data-page-header-back": "" }, [
|
|
158
|
+
hasBackOverride ? backOverride : props.backHref ? h(
|
|
159
|
+
Link,
|
|
160
|
+
{
|
|
161
|
+
href: props.backHref,
|
|
162
|
+
underline: false,
|
|
163
|
+
variant: "default",
|
|
164
|
+
class: getPageHeaderBackButtonClasses(),
|
|
165
|
+
"aria-label": backAriaLabel,
|
|
166
|
+
onClick: handleBack
|
|
167
|
+
},
|
|
168
|
+
{ default: () => [createBackIcon()] }
|
|
169
|
+
) : h(
|
|
170
|
+
Button,
|
|
171
|
+
{
|
|
172
|
+
variant: "ghost",
|
|
173
|
+
size: "sm",
|
|
174
|
+
className: getPageHeaderBackButtonClasses(),
|
|
175
|
+
"aria-label": backAriaLabel,
|
|
176
|
+
onClick: handleBack
|
|
177
|
+
},
|
|
178
|
+
{ default: () => [createBackIcon()] }
|
|
179
|
+
)
|
|
180
|
+
]) : null;
|
|
181
|
+
const mainColumn = hasBreadcrumb || hasTitle || hasSubtitle ? h("div", { class: pageHeaderMainClasses }, [
|
|
182
|
+
hasBreadcrumb ? breadcrumb : null,
|
|
183
|
+
hasTitle || hasSubtitle ? h("div", { class: pageHeaderTitleRowClasses }, [
|
|
184
|
+
hasTitle ? h(
|
|
185
|
+
"div",
|
|
186
|
+
{ class: pageHeaderTitleClasses, "data-page-header-title": "" },
|
|
187
|
+
titleContent
|
|
188
|
+
) : null,
|
|
189
|
+
hasSubtitle ? h(
|
|
190
|
+
"div",
|
|
191
|
+
{ class: pageHeaderSubtitleClasses, "data-page-header-subtitle": "" },
|
|
192
|
+
subTitleContent
|
|
193
|
+
) : null
|
|
194
|
+
]) : null
|
|
195
|
+
]) : null;
|
|
196
|
+
const heading = showHeading ? h("div", { class: pageHeaderHeadingRowClasses, "data-page-header-heading": "" }, [
|
|
197
|
+
h("div", { class: pageHeaderStartClasses }, [backControl, mainColumn]),
|
|
198
|
+
hasActions ? h(
|
|
199
|
+
"div",
|
|
200
|
+
{ class: pageHeaderActionsClasses, "data-page-header-actions": "" },
|
|
201
|
+
actions
|
|
202
|
+
) : null
|
|
203
|
+
]) : null;
|
|
204
|
+
return h(
|
|
205
|
+
"header",
|
|
206
|
+
{
|
|
207
|
+
...attrs,
|
|
208
|
+
class: composeComponentClasses(
|
|
209
|
+
getPageHeaderRootClasses(props.className),
|
|
210
|
+
coerceClassValue(attrsRecord.class)
|
|
211
|
+
),
|
|
212
|
+
style: mergeStyleValues(attrsRecord.style, props.style),
|
|
213
|
+
"data-page-header": ""
|
|
214
|
+
},
|
|
215
|
+
[heading, hasBody ? h("div", { class: pageHeaderContentClasses }, body) : null]
|
|
216
|
+
);
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
var PageHeader_default = PageHeader;
|
|
221
|
+
|
|
222
|
+
export {
|
|
223
|
+
PageHeader,
|
|
224
|
+
PageHeader_default
|
|
225
|
+
};
|
|
@@ -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/TreeMapChart.ts
|
|
18
18
|
import { defineComponent, computed, h, useId } from "vue";
|
|
@@ -76,6 +76,7 @@ var TreeMapChart = defineComponent({
|
|
|
76
76
|
wrapperClasses
|
|
77
77
|
} = useChartInteraction({
|
|
78
78
|
hoverable: computed(() => props.hoverable),
|
|
79
|
+
showTooltip: computed(() => props.showTooltip),
|
|
79
80
|
hoveredIndexProp: () => props.hoveredIndex,
|
|
80
81
|
selectable: computed(() => props.selectable),
|
|
81
82
|
selectedIndexProp: () => props.selectedIndex,
|
|
@@ -219,7 +220,7 @@ var TreeMapChart = defineComponent({
|
|
|
219
220
|
}
|
|
220
221
|
}
|
|
221
222
|
);
|
|
222
|
-
const tooltip = props.showTooltip
|
|
223
|
+
const tooltip = props.showTooltip ? h(ChartTooltip, {
|
|
223
224
|
content: tooltipContent.value,
|
|
224
225
|
open: resolvedHoveredIndex.value !== null && tooltipContent.value !== "",
|
|
225
226
|
x: tooltipPosition.value.x,
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useResponsiveChartSize
|
|
3
|
+
} from "./chunk-UEGNXN5B.mjs";
|
|
1
4
|
import {
|
|
2
5
|
useChartInteraction
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FHUGOSEY.mjs";
|
|
7
|
+
import {
|
|
8
|
+
ChartSeries
|
|
9
|
+
} from "./chunk-2ZUEXCVJ.mjs";
|
|
4
10
|
import {
|
|
5
11
|
ChartTooltip
|
|
6
12
|
} from "./chunk-SPFL55TF.mjs";
|
|
@@ -9,16 +15,13 @@ import {
|
|
|
9
15
|
} from "./chunk-ZWVA7HT3.mjs";
|
|
10
16
|
import {
|
|
11
17
|
ChartCanvas
|
|
12
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-SNNT64HK.mjs";
|
|
13
19
|
import {
|
|
14
20
|
ChartGrid
|
|
15
21
|
} from "./chunk-MI6TL3CQ.mjs";
|
|
16
22
|
import {
|
|
17
23
|
ChartLegend
|
|
18
24
|
} from "./chunk-V443QIJM.mjs";
|
|
19
|
-
import {
|
|
20
|
-
ChartSeries
|
|
21
|
-
} from "./chunk-2ZUEXCVJ.mjs";
|
|
22
25
|
|
|
23
26
|
// src/components/LineChart.ts
|
|
24
27
|
import { defineComponent, computed, getCurrentInstance, h, ref, useId } from "vue";
|
|
@@ -29,7 +32,6 @@ import {
|
|
|
29
32
|
createLinePath,
|
|
30
33
|
createPointScale,
|
|
31
34
|
getChartElementOpacity,
|
|
32
|
-
getChartInnerRect,
|
|
33
35
|
getStableChartGradientPrefix,
|
|
34
36
|
getNumberExtent,
|
|
35
37
|
linePointTransitionClasses,
|
|
@@ -255,7 +257,12 @@ var LineChart = defineComponent({
|
|
|
255
257
|
const hoveredPointInfo = ref(null);
|
|
256
258
|
const tooltipPosition = ref({ x: 0, y: 0 });
|
|
257
259
|
const gradientPrefix = getStableChartGradientPrefix("line", useId());
|
|
258
|
-
const innerRect
|
|
260
|
+
const { innerRect, onResolvedSizeChange } = useResponsiveChartSize(
|
|
261
|
+
() => props.width,
|
|
262
|
+
() => props.height,
|
|
263
|
+
() => props.padding,
|
|
264
|
+
() => props.responsive
|
|
265
|
+
);
|
|
259
266
|
const resolvedSeries = computed(
|
|
260
267
|
() => resolveSeriesData(props.series, props.data, {
|
|
261
268
|
color: props.lineColor,
|
|
@@ -273,6 +280,7 @@ var LineChart = defineComponent({
|
|
|
273
280
|
wrapperClasses
|
|
274
281
|
} = useChartInteraction({
|
|
275
282
|
hoverable: computed(() => props.hoverable),
|
|
283
|
+
showTooltip: computed(() => props.showTooltip),
|
|
276
284
|
hoveredIndexProp: () => props.hoveredIndex,
|
|
277
285
|
selectable: computed(() => props.selectable),
|
|
278
286
|
selectedIndexProp: () => props.selectedIndex,
|
|
@@ -368,19 +376,23 @@ var LineChart = defineComponent({
|
|
|
368
376
|
const handlePointMouseEnter = (seriesIndex, pointIndex, event) => {
|
|
369
377
|
hoveredPointInfo.value = { seriesIndex, pointIndex };
|
|
370
378
|
tooltipPosition.value = { x: event.clientX, y: event.clientY };
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
379
|
+
if (props.hoverable) {
|
|
380
|
+
emit(
|
|
381
|
+
"point-hover",
|
|
382
|
+
seriesIndex,
|
|
383
|
+
pointIndex,
|
|
384
|
+
resolvedSeries.value[seriesIndex]?.data[pointIndex]
|
|
385
|
+
);
|
|
386
|
+
}
|
|
377
387
|
};
|
|
378
388
|
const handlePointMouseMove = (event) => {
|
|
379
389
|
tooltipPosition.value = { x: event.clientX, y: event.clientY };
|
|
380
390
|
};
|
|
381
391
|
const handlePointMouseLeave = () => {
|
|
382
392
|
hoveredPointInfo.value = null;
|
|
383
|
-
|
|
393
|
+
if (props.hoverable) {
|
|
394
|
+
emit("point-hover", null, null, null);
|
|
395
|
+
}
|
|
384
396
|
};
|
|
385
397
|
const showPointTooltipFromElement = (el, seriesIndex, pointIndex) => {
|
|
386
398
|
if (!props.hoverable) return;
|
|
@@ -411,6 +423,7 @@ var LineChart = defineComponent({
|
|
|
411
423
|
};
|
|
412
424
|
return () => {
|
|
413
425
|
const pointClickable = props.selectable || typeof instance?.vnode.props?.onPointClick === "function";
|
|
426
|
+
const trackPointHover = props.showTooltip || props.hoverable;
|
|
414
427
|
const chart = h(
|
|
415
428
|
ChartCanvas,
|
|
416
429
|
{
|
|
@@ -420,7 +433,8 @@ var LineChart = defineComponent({
|
|
|
420
433
|
responsive: props.responsive,
|
|
421
434
|
title: props.title,
|
|
422
435
|
desc: props.desc,
|
|
423
|
-
className: classNames(props.className)
|
|
436
|
+
className: classNames(props.className),
|
|
437
|
+
onResolvedSizeChange
|
|
424
438
|
},
|
|
425
439
|
{
|
|
426
440
|
default: () => [
|
|
@@ -627,9 +641,9 @@ var LineChart = defineComponent({
|
|
|
627
641
|
tabindex: pointInteractive ? 0 : void 0,
|
|
628
642
|
"data-point-index": point.pointIndex,
|
|
629
643
|
"data-series-key": sd.seriesKey,
|
|
630
|
-
onMouseenter:
|
|
631
|
-
onMousemove:
|
|
632
|
-
onMouseleave:
|
|
644
|
+
onMouseenter: trackPointHover ? (e) => handlePointMouseEnter(sd.seriesIndex, point.pointIndex, e) : void 0,
|
|
645
|
+
onMousemove: trackPointHover ? handlePointMouseMove : void 0,
|
|
646
|
+
onMouseleave: trackPointHover ? handlePointMouseLeave : void 0,
|
|
633
647
|
onClick: pointClickable ? (e) => {
|
|
634
648
|
e.stopPropagation();
|
|
635
649
|
handlePointClick(sd.seriesIndex, point.pointIndex);
|
|
@@ -99,10 +99,7 @@ var Radio = defineComponent({
|
|
|
99
99
|
});
|
|
100
100
|
const isInGroup = computed(() => !!groupContext.value);
|
|
101
101
|
const actualSize = computed(() => props.size || groupContext.value?.size || "md");
|
|
102
|
-
const actualDisabled = computed(() =>
|
|
103
|
-
if (props.disabled !== void 0) return props.disabled;
|
|
104
|
-
return groupContext.value?.disabled || false;
|
|
105
|
-
});
|
|
102
|
+
const actualDisabled = computed(() => props.disabled || groupContext.value?.disabled || false);
|
|
106
103
|
const actualName = computed(() => props.name || groupContext.value?.name);
|
|
107
104
|
const isChecked = computed(() => {
|
|
108
105
|
if (isCheckedControlled.value) return props.modelValue;
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FORM_ITEM_CONTROL_INJECTION_KEY
|
|
3
|
+
} from "./chunk-P2LZ2MR5.mjs";
|
|
4
|
+
import {
|
|
5
|
+
useTigerConfig
|
|
6
|
+
} from "./chunk-UOJOJBEU.mjs";
|
|
7
|
+
|
|
8
|
+
// src/components/MaskInput.ts
|
|
9
|
+
import { computed, defineComponent, h, inject, nextTick, ref, watch } from "vue";
|
|
10
|
+
import {
|
|
11
|
+
applyMaskInput,
|
|
12
|
+
classNames,
|
|
13
|
+
coerceClassValue,
|
|
14
|
+
formatMaskValue,
|
|
15
|
+
getInputClasses,
|
|
16
|
+
getInputClearButtonClasses,
|
|
17
|
+
getInputErrorClasses,
|
|
18
|
+
getInputWrapperClasses,
|
|
19
|
+
injectShakeStyle,
|
|
20
|
+
mergeStyleValues,
|
|
21
|
+
parseMask,
|
|
22
|
+
SHAKE_CLASS
|
|
23
|
+
} from "@expcat/tigercat-core";
|
|
24
|
+
var maskInputIdCounter = 0;
|
|
25
|
+
var MaskInput = defineComponent({
|
|
26
|
+
name: "TigerMaskInput",
|
|
27
|
+
inheritAttrs: false,
|
|
28
|
+
props: {
|
|
29
|
+
/**
|
|
30
|
+
* Raw (unmasked) value for v-model
|
|
31
|
+
*/
|
|
32
|
+
modelValue: { type: String, default: void 0 },
|
|
33
|
+
/**
|
|
34
|
+
* Default raw value (for uncontrolled mode)
|
|
35
|
+
*/
|
|
36
|
+
defaultValue: { type: String, default: "" },
|
|
37
|
+
/**
|
|
38
|
+
* Mask template. Built-in tokens: `#` digit, `a` letter, `*` alphanumeric,
|
|
39
|
+
* `!` escapes the next character to a literal
|
|
40
|
+
*/
|
|
41
|
+
mask: { type: String, required: true },
|
|
42
|
+
/**
|
|
43
|
+
* Custom tokens merged over the built-ins
|
|
44
|
+
*/
|
|
45
|
+
tokens: { type: Object, default: void 0 },
|
|
46
|
+
/**
|
|
47
|
+
* Input size
|
|
48
|
+
* @default 'md'
|
|
49
|
+
*/
|
|
50
|
+
size: { type: String, default: "md" },
|
|
51
|
+
/**
|
|
52
|
+
* Validation status
|
|
53
|
+
* @default 'default'
|
|
54
|
+
*/
|
|
55
|
+
status: { type: String, default: "default" },
|
|
56
|
+
/** Error message to display */
|
|
57
|
+
errorMessage: String,
|
|
58
|
+
/** Placeholder text */
|
|
59
|
+
placeholder: { type: String, default: "" },
|
|
60
|
+
/** Whether the input is disabled */
|
|
61
|
+
disabled: Boolean,
|
|
62
|
+
/** Whether the input is readonly */
|
|
63
|
+
readonly: Boolean,
|
|
64
|
+
/** Whether to show a clear button when the input has value */
|
|
65
|
+
clearable: Boolean,
|
|
66
|
+
/**
|
|
67
|
+
* Input name attribute. When set, a hidden input with this name submits the
|
|
68
|
+
* raw (unmasked) value; the visible field displays the mask and has no name.
|
|
69
|
+
*/
|
|
70
|
+
name: String,
|
|
71
|
+
/** Input id attribute */
|
|
72
|
+
id: String,
|
|
73
|
+
/** Autocomplete attribute */
|
|
74
|
+
autoComplete: String,
|
|
75
|
+
/** Whether to autofocus on mount */
|
|
76
|
+
autoFocus: Boolean,
|
|
77
|
+
/**
|
|
78
|
+
* Internal shake trigger counter (used by FormItem)
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
_shakeTrigger: { type: Number, default: void 0 },
|
|
82
|
+
/** Additional CSS classes */
|
|
83
|
+
className: String,
|
|
84
|
+
/** Inline styles */
|
|
85
|
+
style: { type: Object, default: void 0 }
|
|
86
|
+
},
|
|
87
|
+
emits: {
|
|
88
|
+
"update:modelValue": null,
|
|
89
|
+
change: null,
|
|
90
|
+
complete: null,
|
|
91
|
+
focus: null,
|
|
92
|
+
blur: null,
|
|
93
|
+
clear: null
|
|
94
|
+
},
|
|
95
|
+
setup(props, { emit, attrs }) {
|
|
96
|
+
injectShakeStyle();
|
|
97
|
+
const formItemControl = inject(
|
|
98
|
+
FORM_ITEM_CONTROL_INJECTION_KEY,
|
|
99
|
+
null
|
|
100
|
+
);
|
|
101
|
+
useTigerConfig();
|
|
102
|
+
const effectiveStatus = computed(
|
|
103
|
+
() => props.status !== "default" ? props.status : formItemControl?.status.value ?? props.status
|
|
104
|
+
);
|
|
105
|
+
const effectiveErrorMessage = computed(
|
|
106
|
+
() => props.errorMessage ?? formItemControl?.errorMessage.value
|
|
107
|
+
);
|
|
108
|
+
const effectiveShakeTrigger = computed(
|
|
109
|
+
() => props._shakeTrigger ?? formItemControl?.shakeTrigger.value
|
|
110
|
+
);
|
|
111
|
+
const instanceId = ++maskInputIdCounter;
|
|
112
|
+
const errorMsgId = `tiger-mask-input-error-${instanceId}`;
|
|
113
|
+
const wrapperRef = ref(null);
|
|
114
|
+
const inputRef = ref(null);
|
|
115
|
+
const isComposing = ref(false);
|
|
116
|
+
const spec = computed(() => parseMask(props.mask, props.tokens));
|
|
117
|
+
const isControlled = computed(() => props.modelValue !== void 0);
|
|
118
|
+
const innerRaw = ref(props.defaultValue ?? "");
|
|
119
|
+
const rawValue = computed(
|
|
120
|
+
() => isControlled.value ? props.modelValue ?? "" : innerRaw.value
|
|
121
|
+
);
|
|
122
|
+
const formatted = computed(() => formatMaskValue(rawValue.value, spec.value));
|
|
123
|
+
const maskedValue = computed(() => formatted.value.maskedValue);
|
|
124
|
+
watch([effectiveStatus, effectiveShakeTrigger], ([newStatus]) => {
|
|
125
|
+
if (newStatus === "error" && wrapperRef.value) {
|
|
126
|
+
const el = wrapperRef.value;
|
|
127
|
+
el.classList.remove(SHAKE_CLASS);
|
|
128
|
+
void el.offsetWidth;
|
|
129
|
+
el.classList.add(SHAKE_CLASS);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
const commit = (raw, detail, previousMasked) => {
|
|
133
|
+
if (!isControlled.value) innerRaw.value = raw;
|
|
134
|
+
emit("update:modelValue", raw);
|
|
135
|
+
emit("change", raw, detail);
|
|
136
|
+
if (detail.completed && !formatMaskValue(previousMasked, spec.value).completed) {
|
|
137
|
+
emit("complete", raw, detail.maskedValue);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
const applyValue = (inputValue, caret) => {
|
|
141
|
+
const previousMasked = maskedValue.value;
|
|
142
|
+
const result = applyMaskInput(inputValue, caret, spec.value, previousMasked);
|
|
143
|
+
if (inputRef.value) inputRef.value.value = result.maskedValue;
|
|
144
|
+
commit(
|
|
145
|
+
result.rawValue,
|
|
146
|
+
{ maskedValue: result.maskedValue, completed: result.completed },
|
|
147
|
+
previousMasked
|
|
148
|
+
);
|
|
149
|
+
nextTick(() => {
|
|
150
|
+
if (inputRef.value) inputRef.value.setSelectionRange(result.caret, result.caret);
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
const processInput = (target) => {
|
|
154
|
+
applyValue(target.value, target.selectionStart ?? target.value.length);
|
|
155
|
+
};
|
|
156
|
+
const handleInput = (event) => {
|
|
157
|
+
if (isComposing.value) return;
|
|
158
|
+
processInput(event.target);
|
|
159
|
+
};
|
|
160
|
+
const handlePaste = (event) => {
|
|
161
|
+
if (props.disabled || props.readonly) return;
|
|
162
|
+
event.preventDefault();
|
|
163
|
+
const input = event.target;
|
|
164
|
+
const text = event.clipboardData?.getData("text") ?? "";
|
|
165
|
+
const start = input.selectionStart ?? input.value.length;
|
|
166
|
+
const end = input.selectionEnd ?? input.value.length;
|
|
167
|
+
applyValue(input.value.slice(0, start) + text + input.value.slice(end), start + text.length);
|
|
168
|
+
};
|
|
169
|
+
const handleCompositionStart = () => {
|
|
170
|
+
isComposing.value = true;
|
|
171
|
+
};
|
|
172
|
+
const handleCompositionEnd = (event) => {
|
|
173
|
+
isComposing.value = false;
|
|
174
|
+
processInput(event.target);
|
|
175
|
+
};
|
|
176
|
+
const handleClear = () => {
|
|
177
|
+
if (!isControlled.value) innerRaw.value = "";
|
|
178
|
+
emit("update:modelValue", "");
|
|
179
|
+
emit("change", "", { maskedValue: "", completed: false });
|
|
180
|
+
emit("clear");
|
|
181
|
+
inputRef.value?.focus();
|
|
182
|
+
};
|
|
183
|
+
const handleFocus = (event) => emit("focus", event);
|
|
184
|
+
const handleBlur = (event) => emit("blur", event);
|
|
185
|
+
return () => {
|
|
186
|
+
const { class: attrClass, style: attrStyle, ...restAttrs } = attrs;
|
|
187
|
+
const activeError = effectiveStatus.value === "error" && !!effectiveErrorMessage.value;
|
|
188
|
+
const hasSuffix = props.clearable;
|
|
189
|
+
const showClear = props.clearable && !props.disabled && !props.readonly && rawValue.value.length > 0;
|
|
190
|
+
const inputClasses = getInputClasses({
|
|
191
|
+
size: props.size,
|
|
192
|
+
status: effectiveStatus.value,
|
|
193
|
+
hasPrefix: false,
|
|
194
|
+
hasSuffix
|
|
195
|
+
});
|
|
196
|
+
const children = [
|
|
197
|
+
h("input", {
|
|
198
|
+
...restAttrs,
|
|
199
|
+
ref: inputRef,
|
|
200
|
+
class: inputClasses,
|
|
201
|
+
type: "text",
|
|
202
|
+
value: maskedValue.value,
|
|
203
|
+
placeholder: props.placeholder,
|
|
204
|
+
disabled: props.disabled,
|
|
205
|
+
readonly: props.readonly,
|
|
206
|
+
id: props.id,
|
|
207
|
+
autocomplete: props.autoComplete,
|
|
208
|
+
autofocus: props.autoFocus,
|
|
209
|
+
...effectiveStatus.value === "error" ? { "aria-invalid": true } : {},
|
|
210
|
+
...activeError ? { "aria-describedby": errorMsgId } : {},
|
|
211
|
+
onInput: handleInput,
|
|
212
|
+
onPaste: handlePaste,
|
|
213
|
+
onCompositionstart: handleCompositionStart,
|
|
214
|
+
onCompositionend: handleCompositionEnd,
|
|
215
|
+
onFocus: handleFocus,
|
|
216
|
+
onBlur: handleBlur
|
|
217
|
+
})
|
|
218
|
+
];
|
|
219
|
+
if (props.name) {
|
|
220
|
+
children.push(
|
|
221
|
+
h("input", {
|
|
222
|
+
key: "hidden",
|
|
223
|
+
type: "hidden",
|
|
224
|
+
name: props.name,
|
|
225
|
+
value: rawValue.value
|
|
226
|
+
})
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
if (activeError) {
|
|
230
|
+
children.push(
|
|
231
|
+
h(
|
|
232
|
+
"div",
|
|
233
|
+
{ id: errorMsgId, class: getInputErrorClasses(props.size), "aria-live": "polite" },
|
|
234
|
+
effectiveErrorMessage.value
|
|
235
|
+
)
|
|
236
|
+
);
|
|
237
|
+
} else if (showClear) {
|
|
238
|
+
children.push(
|
|
239
|
+
h(
|
|
240
|
+
"button",
|
|
241
|
+
{
|
|
242
|
+
type: "button",
|
|
243
|
+
class: getInputClearButtonClasses(props.size),
|
|
244
|
+
onClick: handleClear,
|
|
245
|
+
"aria-label": "Clear input",
|
|
246
|
+
tabindex: -1
|
|
247
|
+
},
|
|
248
|
+
"\u2715"
|
|
249
|
+
)
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
return h(
|
|
253
|
+
"div",
|
|
254
|
+
{
|
|
255
|
+
ref: wrapperRef,
|
|
256
|
+
class: classNames(getInputWrapperClasses(), props.className, coerceClassValue(attrClass)),
|
|
257
|
+
style: mergeStyleValues(props.style, attrStyle)
|
|
258
|
+
},
|
|
259
|
+
children
|
|
260
|
+
);
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
var MaskInput_default = MaskInput;
|
|
265
|
+
|
|
266
|
+
export {
|
|
267
|
+
MaskInput,
|
|
268
|
+
MaskInput_default
|
|
269
|
+
};
|