@leaflink/stash 48.16.1 → 48.17.0
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/Accordion.js +1 -1
- package/dist/Accordion.js.map +1 -1
- package/dist/Accordion.vue.d.ts +8 -9
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/ActionsDropdown.vue.d.ts +7 -8
- package/dist/AddressSelect.js +42 -38
- package/dist/AddressSelect.js.map +1 -1
- package/dist/AddressSelect.vue.d.ts +10 -11
- package/dist/Alert.js.map +1 -1
- package/dist/Alert.vue.d.ts +6 -7
- package/dist/AppNavigationItem.js +2 -2
- package/dist/AppNavigationItem.js.map +1 -1
- package/dist/AppNavigationItem.vue.d.ts +7 -8
- package/dist/AppSidebar.js +42 -42
- package/dist/AppSidebar.js.map +1 -1
- package/dist/AppSidebar.vue.d.ts +8 -9
- package/dist/AppTopbar.js +16 -16
- package/dist/AppTopbar.js.map +1 -1
- package/dist/AppTopbar.vue.d.ts +8 -9
- package/dist/Avatar.js.map +1 -1
- package/dist/Avatar.vue.d.ts +7 -8
- package/dist/Backdrop.vue.d.ts +3 -5
- package/dist/Badge.js +1 -1
- package/dist/Badge.js.map +1 -1
- package/dist/Badge.vue.d.ts +7 -8
- package/dist/Box.vue.d.ts +6 -7
- package/dist/Box.vue_vue_type_script_setup_true_lang-69e5176b.js.map +1 -1
- package/dist/Button.js.map +1 -1
- package/dist/Button.vue.d.ts +7 -8
- package/dist/ButtonGroup.js +29 -29
- package/dist/ButtonGroup.js.map +1 -1
- package/dist/ButtonGroup.vue.d.ts +8 -9
- package/dist/Card.js.map +1 -1
- package/dist/Card.vue.d.ts +6 -7
- package/dist/CardContent.vue.d.ts +3 -5
- package/dist/CardFooter.vue.d.ts +3 -5
- package/dist/CardHeader.js.map +1 -1
- package/dist/CardHeader.vue.d.ts +3 -4
- package/dist/CardMedia.js +6 -6
- package/dist/CardMedia.js.map +1 -1
- package/dist/CardMedia.vue.d.ts +3 -4
- package/dist/Carousel.js +249 -249
- package/dist/Carousel.js.map +1 -1
- package/dist/Carousel.vue.d.ts +9 -9
- package/dist/Checkbox.js +27 -27
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox.vue.d.ts +11 -12
- package/dist/ChevronToggle.js +1 -1
- package/dist/ChevronToggle.vue.d.ts +8 -9
- package/dist/{ChevronToggle.vue_vue_type_script_setup_true_lang-1591294c.js → ChevronToggle.vue_vue_type_script_setup_true_lang-fcdf0c19.js} +11 -11
- package/dist/{ChevronToggle.vue_vue_type_script_setup_true_lang-1591294c.js.map → ChevronToggle.vue_vue_type_script_setup_true_lang-fcdf0c19.js.map} +1 -1
- package/dist/Chip.js +30 -30
- package/dist/Chip.js.map +1 -1
- package/dist/Chip.vue.d.ts +9 -10
- package/dist/ConfirmationCodeInput.js +128 -105
- package/dist/ConfirmationCodeInput.js.map +1 -1
- package/dist/ConfirmationCodeInput.vue.d.ts +36 -11
- package/dist/ContextSwitcher.js +18 -18
- package/dist/ContextSwitcher.js.map +1 -1
- package/dist/ContextSwitcher.vue.d.ts +9 -10
- package/dist/Copy.js.map +1 -1
- package/dist/Copy.vue.d.ts +6 -7
- package/dist/CurrencyInput.js +93 -93
- package/dist/CurrencyInput.js.map +1 -1
- package/dist/CurrencyInput.vue.d.ts +10 -11
- package/dist/CustomRender.vue.d.ts +3 -15
- package/dist/DataView.js +97 -97
- package/dist/DataView.js.map +1 -1
- package/dist/DataView.vue.d.ts +9 -10
- package/dist/DataViewFilters.js +153 -150
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/DataViewFilters.vue.d.ts +9 -10
- package/dist/DataViewSortButton.js.map +1 -1
- package/dist/DataViewSortButton.vue.d.ts +6 -7
- package/dist/DataViewToolbar.js +27 -27
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DataViewToolbar.vue.d.ts +8 -9
- package/dist/DatePicker.js +738 -738
- package/dist/DatePicker.js.map +1 -1
- package/dist/DatePicker.vue.d.ts +11 -12
- package/dist/DescriptionList.js.map +1 -1
- package/dist/DescriptionList.vue.d.ts +6 -7
- package/dist/DescriptionListDetail.vue.d.ts +3 -5
- package/dist/DescriptionListGroup.vue.d.ts +3 -5
- package/dist/DescriptionListTerm.vue.d.ts +3 -5
- package/dist/Dialog.js +44 -44
- package/dist/Dialog.js.map +1 -1
- package/dist/Dialog.vue.d.ts +10 -11
- package/dist/Divider.vue.d.ts +3 -5
- package/dist/Dropdown.js +38 -38
- package/dist/Dropdown.js.map +1 -1
- package/dist/Dropdown.vue.d.ts +9 -10
- package/dist/EmptyState.js +20 -20
- package/dist/EmptyState.js.map +1 -1
- package/dist/EmptyState.vue.d.ts +6 -7
- package/dist/Expand.js +1 -1
- package/dist/Expand.vue.d.ts +8 -9
- package/dist/{Expand.vue_vue_type_script_setup_true_lang-1751f4a6.js → Expand.vue_vue_type_script_setup_true_lang-0f236267.js} +19 -19
- package/dist/Expand.vue_vue_type_script_setup_true_lang-0f236267.js.map +1 -0
- package/dist/Field.vue.d.ts +6 -7
- package/dist/Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js.map +1 -1
- package/dist/FileUpload.js +65 -65
- package/dist/FileUpload.js.map +1 -1
- package/dist/FileUpload.vue.d.ts +10 -11
- package/dist/FilterChip.js +27 -27
- package/dist/FilterChip.js.map +1 -1
- package/dist/FilterChip.vue.d.ts +8 -9
- package/dist/FilterDrawerItem.js +26 -26
- package/dist/FilterDrawerItem.js.map +1 -1
- package/dist/FilterDrawerItem.vue.d.ts +5 -6
- package/dist/FilterDropdown.js +49 -49
- package/dist/FilterDropdown.js.map +1 -1
- package/dist/FilterDropdown.vue.d.ts +8 -9
- package/dist/FilterSelect.js +23 -23
- package/dist/FilterSelect.js.map +1 -1
- package/dist/FilterSelect.vue.d.ts +8 -9
- package/dist/Filters.js +112 -104
- package/dist/Filters.js.map +1 -1
- package/dist/Filters.vue.d.ts +2204 -65
- package/dist/HttpError.js +42 -42
- package/dist/HttpError.js.map +1 -1
- package/dist/HttpError.vue.d.ts +6 -7
- package/dist/Icon.js.map +1 -1
- package/dist/Icon.vue.d.ts +7 -8
- package/dist/IconLabel.js.map +1 -1
- package/dist/IconLabel.vue.d.ts +8 -9
- package/dist/Illustration.vue.d.ts +6 -7
- package/dist/Illustration.vue_vue_type_script_setup_true_lang-e26c3841.js.map +1 -1
- package/dist/Image.js +47 -47
- package/dist/Image.js.map +1 -1
- package/dist/Image.vue.d.ts +6 -7
- package/dist/InlineEdit.js +34 -34
- package/dist/InlineEdit.js.map +1 -1
- package/dist/InlineEdit.vue.d.ts +9 -10
- package/dist/Input.js +35 -35
- package/dist/Input.js.map +1 -1
- package/dist/Input.vue.d.ts +13 -14
- package/dist/InputOptions.js +33 -33
- package/dist/InputOptions.js.map +1 -1
- package/dist/InputOptions.vue.d.ts +8 -9
- package/dist/IntegrationIcon.js.map +1 -1
- package/dist/IntegrationIcon.vue.d.ts +7 -8
- package/dist/Label.vue.d.ts +6 -7
- package/dist/Label.vue_vue_type_script_setup_true_lang-4b02087f.js.map +1 -1
- package/dist/LicenseChip.js.map +1 -1
- package/dist/LicenseChip.vue.d.ts +6 -7
- package/dist/ListItem.vue.d.ts +225 -95
- package/dist/ListItemCell.vue.d.ts +4 -16
- package/dist/ListView.js +1 -1
- package/dist/ListView.vue.d.ts +5072 -470
- package/dist/Loading.js +16 -16
- package/dist/Loading.js.map +1 -1
- package/dist/Loading.vue.d.ts +3 -5
- package/dist/Logo.js +1 -1
- package/dist/Logo.vue.d.ts +9 -10
- package/dist/Logo.vue_vue_type_script_setup_true_lang-2a2597cb.js +196 -0
- package/dist/Logo.vue_vue_type_script_setup_true_lang-2a2597cb.js.map +1 -0
- package/dist/Menu.vue.d.ts +3 -5
- package/dist/MenuItem.vue.d.ts +3 -5
- package/dist/Metric.js.map +1 -1
- package/dist/Metric.vue.d.ts +6 -7
- package/dist/Modal.js +29 -29
- package/dist/Modal.js.map +1 -1
- package/dist/Modal.vue.d.ts +8 -9
- package/dist/Modals.js +8 -7
- package/dist/Modals.js.map +1 -1
- package/dist/Modals.vue.d.ts +3 -5
- package/dist/Module.js.map +1 -1
- package/dist/Module.vue.d.ts +7 -8
- package/dist/ModuleContent.vue.d.ts +3 -5
- package/dist/ModuleFooter.vue.d.ts +3 -5
- package/dist/ModuleHeader.js.map +1 -1
- package/dist/ModuleHeader.vue.d.ts +6 -7
- package/dist/ObfuscateText.js +1 -1
- package/dist/ObfuscateText.js.map +1 -1
- package/dist/ObfuscateText.vue.d.ts +6 -7
- package/dist/PageContent.vue.d.ts +3 -5
- package/dist/PageHeader.js.map +1 -1
- package/dist/PageHeader.vue.d.ts +6 -7
- package/dist/PageNavigation.js +30 -27
- package/dist/PageNavigation.js.map +1 -1
- package/dist/PageNavigation.vue.d.ts +8 -9
- package/dist/Paginate.js +32 -32
- package/dist/Paginate.js.map +1 -1
- package/dist/Paginate.vue.d.ts +8 -9
- package/dist/PlaidLink.js +29 -29
- package/dist/PlaidLink.js.map +1 -1
- package/dist/PlaidLink.vue.d.ts +11 -12
- package/dist/QuickAction.js.map +1 -1
- package/dist/QuickAction.vue.d.ts +4 -5
- package/dist/Radio.vue.d.ts +20 -1
- package/dist/RadioGroup.js +123 -123
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioGroup.vue.d.ts +10 -11
- package/dist/RadioNew.js +102 -102
- package/dist/RadioNew.js.map +1 -1
- package/dist/RadioNew.vue.d.ts +10 -11
- package/dist/RangeInput.vue.d.ts +3 -5
- package/dist/SearchBar.js +36 -36
- package/dist/SearchBar.js.map +1 -1
- package/dist/SearchBar.vue.d.ts +9 -10
- package/dist/Select.js +792 -774
- package/dist/Select.js.map +1 -1
- package/dist/Select.vue.d.ts +14 -15
- package/dist/SelectStatus.js +27 -27
- package/dist/SelectStatus.js.map +1 -1
- package/dist/SelectStatus.vue.d.ts +12 -13
- package/dist/Skeleton.js.map +1 -1
- package/dist/Skeleton.vue.d.ts +7 -8
- package/dist/Step.js.map +1 -1
- package/dist/Step.vue.d.ts +7 -8
- package/dist/Stepper.js +19 -19
- package/dist/Stepper.js.map +1 -1
- package/dist/Stepper.vue.d.ts +9 -10
- package/dist/Switch.js +25 -25
- package/dist/Switch.js.map +1 -1
- package/dist/Switch.vue.d.ts +11 -12
- package/dist/Tab.js +2 -2
- package/dist/Tab.vue.d.ts +3 -4
- package/dist/{Tab.vue_vue_type_script_setup_true_lang-69d1b046.js → Tab.vue_vue_type_script_setup_true_lang-9aa53203.js} +5 -3
- package/dist/Tab.vue_vue_type_script_setup_true_lang-9aa53203.js.map +1 -0
- package/dist/Table.js +3 -3
- package/dist/Table.js.map +1 -1
- package/dist/{Table.keys-cf93df19.js → Table.keys-83e4f09b.js} +11 -11
- package/dist/{Table.keys-cf93df19.js.map → Table.keys-83e4f09b.js.map} +1 -1
- package/dist/Table.vue.d.ts +6 -7
- package/dist/TableCell.js +1 -1
- package/dist/TableCell.js.map +1 -1
- package/dist/TableCell.vue.d.ts +6 -7
- package/dist/TableHeaderCell.js +12 -12
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/TableHeaderCell.vue.d.ts +6 -7
- package/dist/TableHeaderRow.js +21 -21
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableHeaderRow.vue.d.ts +8 -9
- package/dist/TableRow.js +42 -42
- package/dist/TableRow.js.map +1 -1
- package/dist/TableRow.vue.d.ts +8 -9
- package/dist/Tabs.js +2 -2
- package/dist/Tabs.vue.d.ts +8 -9
- package/dist/{Tabs.vue_used_vue_type_style_index_0_lang.module-2a131332.js → Tabs.vue_used_vue_type_style_index_0_lang.module-3aa36673.js} +37 -37
- package/dist/Tabs.vue_used_vue_type_style_index_0_lang.module-3aa36673.js.map +1 -0
- package/dist/TextEditor.js +565 -565
- package/dist/TextEditor.js.map +1 -1
- package/dist/TextEditor.vue.d.ts +12 -13
- package/dist/Textarea.js +28 -28
- package/dist/Textarea.js.map +1 -1
- package/dist/Textarea.vue.d.ts +10 -11
- package/dist/Timeline.js.map +1 -1
- package/dist/Timeline.vue.d.ts +6 -7
- package/dist/TimelineItem.js +21 -21
- package/dist/TimelineItem.js.map +1 -1
- package/dist/TimelineItem.vue.d.ts +13 -6
- package/dist/Toast.js +134 -134
- package/dist/Toast.js.map +1 -1
- package/dist/Toast.vue.d.ts +6 -7
- package/dist/Toasts.vue.d.ts +3 -5
- package/dist/components.css +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tailwind-base.js.map +1 -1
- package/dist/usePlaidLink.d.ts +1 -6
- package/dist/useScriptTag.d.ts +3 -8
- package/dist/useStepper.d.ts +7 -2
- package/package.json +1 -1
- package/tailwind-base.ts +13 -6
- package/dist/Expand.vue_vue_type_script_setup_true_lang-1751f4a6.js.map +0 -1
- package/dist/Logo.vue_vue_type_script_setup_true_lang-d7da48a0.js +0 -196
- package/dist/Logo.vue_vue_type_script_setup_true_lang-d7da48a0.js.map +0 -1
- package/dist/Tab.vue_vue_type_script_setup_true_lang-69d1b046.js.map +0 -1
- package/dist/Tabs.vue_used_vue_type_style_index_0_lang.module-2a131332.js.map +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as a, computed as i, openBlock as s, createBlock as l, withCtx as m, createVNode as p } from "vue";
|
|
2
|
+
import d from "./Button.js";
|
|
3
|
+
import u from "./Icon.js";
|
|
4
|
+
const k = /* @__PURE__ */ a({
|
|
5
5
|
__name: "ChevronToggle",
|
|
6
6
|
props: {
|
|
7
7
|
direction: { default: "down" }
|
|
8
8
|
},
|
|
9
9
|
emits: ["click"],
|
|
10
10
|
setup(o, { emit: n }) {
|
|
11
|
-
const c = o, t =
|
|
12
|
-
return (
|
|
11
|
+
const c = o, r = n, t = i(() => `chevron-${c.direction}`);
|
|
12
|
+
return (f, e) => (s(), l(d, {
|
|
13
13
|
class: "stash-chevron-toggle",
|
|
14
14
|
icon: "",
|
|
15
15
|
"data-test": "stash-chevron-toggle",
|
|
16
|
-
onClick: e[0] || (e[0] = (
|
|
16
|
+
onClick: e[0] || (e[0] = (v) => r("click"))
|
|
17
17
|
}, {
|
|
18
|
-
default:
|
|
19
|
-
|
|
18
|
+
default: m(() => [
|
|
19
|
+
p(u, {
|
|
20
20
|
name: t.value,
|
|
21
21
|
"data-test": `icon|${t.value}`
|
|
22
22
|
}, null, 8, ["name", "data-test"])
|
|
@@ -26,6 +26,6 @@ const _ = /* @__PURE__ */ r({
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
export {
|
|
29
|
-
_
|
|
29
|
+
k as _
|
|
30
30
|
};
|
|
31
|
-
//# sourceMappingURL=ChevronToggle.vue_vue_type_script_setup_true_lang-
|
|
31
|
+
//# sourceMappingURL=ChevronToggle.vue_vue_type_script_setup_true_lang-fcdf0c19.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChevronToggle.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
{"version":3,"file":"ChevronToggle.vue_vue_type_script_setup_true_lang-fcdf0c19.js","sources":["../src/components/ChevronToggle/ChevronToggle.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue';\n\n import Button from '../Button/Button.vue';\n import { IconName } from '../Icon/Icon.types';\n import Icon from '../Icon/Icon.vue';\n\n enum ChevronToggleDirections {\n Up = 'up',\n Down = 'down',\n Left = 'left',\n Right = 'right',\n }\n\n export type ChevronToggleDirection = `${ChevronToggleDirections}`;\n\n export interface ChevronToggleProps {\n direction?: ChevronToggleDirection;\n }\n\n const props = withDefaults(defineProps<ChevronToggleProps>(), {\n direction: 'down',\n });\n\n const emit = defineEmits<{ (e: 'click'): void }>();\n\n const icon = computed<IconName>(() => `chevron-${props.direction}`);\n</script>\n\n<template>\n <Button class=\"stash-chevron-toggle\" icon data-test=\"stash-chevron-toggle\" @click=\"emit('click')\">\n <Icon :name=\"icon\" :data-test=\"`icon|${icon}`\" />\n </Button>\n</template>\n"],"names":["props","__props","emit","__emit","icon","computed"],"mappings":";;;;;;;;;;AAoBE,UAAMA,IAAQC,GAIRC,IAAOC,GAEPC,IAAOC,EAAmB,MAAM,WAAWL,EAAM,WAAW;;;;;;;;;;;;;;;;;"}
|
package/dist/Chip.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { _ as
|
|
1
|
+
import { defineComponent as f, useCssModule as b, openBlock as a, createElementBlock as d, normalizeClass as n, unref as i, renderSlot as m, withKeys as v, withModifiers as u, createVNode as _, createCommentVNode as w } from "vue";
|
|
2
|
+
import C from "./utils/colorScheme.js";
|
|
3
|
+
import y from "./Icon.js";
|
|
4
|
+
import { _ as $ } from "./_plugin-vue_export-helper-dad06003.js";
|
|
5
5
|
import "lodash-es/uniqueId";
|
|
6
6
|
import "./index-9e1095ef.js";
|
|
7
7
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
8
|
-
const
|
|
8
|
+
const z = ["disabled"], k = /* @__PURE__ */ f({
|
|
9
9
|
name: "ll-chip",
|
|
10
10
|
__name: "Chip",
|
|
11
11
|
props: {
|
|
@@ -20,10 +20,10 @@ const $ = ["disabled"], z = /* @__PURE__ */ h({
|
|
|
20
20
|
disabled: { type: Boolean, default: !1 }
|
|
21
21
|
},
|
|
22
22
|
emits: ["click", "remove"],
|
|
23
|
-
setup(c, { emit:
|
|
24
|
-
const e = c, s =
|
|
25
|
-
function
|
|
26
|
-
const { computedBgColor: o, computedTextColor: t } =
|
|
23
|
+
setup(c, { emit: p }) {
|
|
24
|
+
const e = c, r = p, s = b();
|
|
25
|
+
function h() {
|
|
26
|
+
const { computedBgColor: o, computedTextColor: t } = C({
|
|
27
27
|
shade: e.shade,
|
|
28
28
|
color: e.colorScheme
|
|
29
29
|
}), l = `tw-text-${e.textColor || t} tw-bg-${e.bgColor || o}`;
|
|
@@ -35,51 +35,51 @@ const $ = ["disabled"], z = /* @__PURE__ */ h({
|
|
|
35
35
|
"tw-bg-ice-500 tw-text-white": e.disabled
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
return (o, t) => (
|
|
38
|
+
return (o, t) => (a(), d("span", {
|
|
39
39
|
class: n(["stash-chip tw-relative tw-inline-flex tw-items-center", [
|
|
40
40
|
`stash-chip--radius-${e.radius}`,
|
|
41
41
|
`stash-chip--size-${e.size}`,
|
|
42
42
|
`stash-chip--shade-${e.shade}`,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
i(s).root,
|
|
44
|
+
i(s).removableChip,
|
|
45
|
+
i(s)[`size-${e.size}`],
|
|
46
|
+
h()
|
|
47
47
|
]]),
|
|
48
48
|
"data-test": "stash-chip",
|
|
49
|
-
onClick: t[2] || (t[2] = (l) =>
|
|
49
|
+
onClick: t[2] || (t[2] = (l) => r("click"))
|
|
50
50
|
}, [
|
|
51
|
-
o.isRemovable ? (
|
|
51
|
+
o.isRemovable ? (a(), d("span", {
|
|
52
52
|
key: 0,
|
|
53
53
|
class: n([{ "tw-mr-6 tw-truncate": e.isRemovable }])
|
|
54
54
|
}, [
|
|
55
|
-
|
|
56
|
-
], 2)) :
|
|
57
|
-
e.isRemovable ? (
|
|
55
|
+
m(o.$slots, "default")
|
|
56
|
+
], 2)) : m(o.$slots, "default", { key: 1 }),
|
|
57
|
+
e.isRemovable ? (a(), d("button", {
|
|
58
58
|
key: 2,
|
|
59
59
|
tabindex: "-1",
|
|
60
|
-
class: n(["stash-chip__remove-button", ["tw-absolute",
|
|
60
|
+
class: n(["stash-chip__remove-button", ["tw-absolute", i(s)["remove-button"]]]),
|
|
61
61
|
"data-test": "stash-chip|remove-button",
|
|
62
62
|
disabled: e.disabled,
|
|
63
|
-
onKeypress: t[0] || (t[0] =
|
|
64
|
-
onMousedown: t[1] || (t[1] =
|
|
63
|
+
onKeypress: t[0] || (t[0] = v(u((l) => r("remove"), ["prevent"]), ["enter"])),
|
|
64
|
+
onMousedown: t[1] || (t[1] = u((l) => r("remove"), ["prevent", "stop"]))
|
|
65
65
|
}, [
|
|
66
|
-
|
|
66
|
+
_(y, {
|
|
67
67
|
"data-test": "icon|close",
|
|
68
68
|
name: "close",
|
|
69
69
|
size: "small"
|
|
70
70
|
})
|
|
71
|
-
], 42,
|
|
71
|
+
], 42, z)) : w("", !0)
|
|
72
72
|
], 2));
|
|
73
73
|
}
|
|
74
|
-
}),
|
|
75
|
-
root:
|
|
74
|
+
}), x = "_root_1u8h2_2", g = {
|
|
75
|
+
root: x,
|
|
76
76
|
"size-medium": "_size-medium_1u8h2_12",
|
|
77
77
|
"size-small": "_size-small_1u8h2_17",
|
|
78
78
|
"remove-button": "_remove-button_1u8h2_22"
|
|
79
|
-
},
|
|
80
|
-
$style:
|
|
81
|
-
},
|
|
79
|
+
}, B = {
|
|
80
|
+
$style: g
|
|
81
|
+
}, E = /* @__PURE__ */ $(k, [["__cssModules", B]]);
|
|
82
82
|
export {
|
|
83
|
-
|
|
83
|
+
E as default
|
|
84
84
|
};
|
|
85
85
|
//# sourceMappingURL=Chip.js.map
|
package/dist/Chip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.js","sources":["../src/components/Chip/Chip.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { useCssModule } from 'vue';\n\n import { StashCommonColor, StashPrimaryColorGroup } from '../../../types/colors';\n import colorSchemeUtil from '../../utils/colorScheme';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({\n name: 'll-chip',\n });\n\n export interface ChipProps {\n /**\n * The color for the chip that determines both the text and bg color. Needs to\n * be one of the brand colors in our design system (not a shade).\n */\n colorScheme?: StashPrimaryColorGroup;\n\n /**\n * The shade of the provided color to use for the background color. This effects the inferred\n * text color unless a specific text color is provided. Currently only `light` and `main`\n * shades are supported. `dark` may be added in the future.\n */\n shade?: 'light' | 'main';\n\n /**\n * The size of the chip.\n */\n size?: 'small' | 'medium';\n\n /**\n * The type of border radius to use.\n */\n radius?: 'none' | 'standard' | 'pill';\n\n /**\n * The background color of the chip. Needs to be one of our design system colors.\n */\n bgColor?: StashCommonColor;\n\n /**\n * The color of the chip text. Needs to be one of our design system colors.\n */\n textColor?: StashCommonColor;\n\n /**\n * Determines if a close icon is surfaced.\n */\n isRemovable?: boolean;\n\n /**\n * Determines if background and text color in Chip should be overidden.\n */\n shouldOverrideColors?: boolean;\n\n /**\n * Determines if the chip is disabled.\n */\n disabled?: boolean;\n }\n\n const props = withDefaults(defineProps<ChipProps>(), {\n size: 'medium',\n radius: 'standard',\n colorScheme: 'ice',\n shade: 'light',\n bgColor: undefined,\n textColor: undefined,\n isRemovable: false,\n shouldOverrideColors: false,\n disabled: false,\n });\n\n const emit
|
|
1
|
+
{"version":3,"file":"Chip.js","sources":["../src/components/Chip/Chip.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { useCssModule } from 'vue';\n\n import { StashCommonColor, StashPrimaryColorGroup } from '../../../types/colors';\n import colorSchemeUtil from '../../utils/colorScheme';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({\n name: 'll-chip',\n });\n\n export interface ChipProps {\n /**\n * The color for the chip that determines both the text and bg color. Needs to\n * be one of the brand colors in our design system (not a shade).\n */\n colorScheme?: StashPrimaryColorGroup;\n\n /**\n * The shade of the provided color to use for the background color. This effects the inferred\n * text color unless a specific text color is provided. Currently only `light` and `main`\n * shades are supported. `dark` may be added in the future.\n */\n shade?: 'light' | 'main';\n\n /**\n * The size of the chip.\n */\n size?: 'small' | 'medium';\n\n /**\n * The type of border radius to use.\n */\n radius?: 'none' | 'standard' | 'pill';\n\n /**\n * The background color of the chip. Needs to be one of our design system colors.\n */\n bgColor?: StashCommonColor;\n\n /**\n * The color of the chip text. Needs to be one of our design system colors.\n */\n textColor?: StashCommonColor;\n\n /**\n * Determines if a close icon is surfaced.\n */\n isRemovable?: boolean;\n\n /**\n * Determines if background and text color in Chip should be overidden.\n */\n shouldOverrideColors?: boolean;\n\n /**\n * Determines if the chip is disabled.\n */\n disabled?: boolean;\n }\n\n const props = withDefaults(defineProps<ChipProps>(), {\n size: 'medium',\n radius: 'standard',\n colorScheme: 'ice',\n shade: 'light',\n bgColor: undefined,\n textColor: undefined,\n isRemovable: false,\n shouldOverrideColors: false,\n disabled: false,\n });\n\n const emit = defineEmits<{\n /**\n * Fires on click of the chip.\n */\n (e: 'click'): void;\n /**\n * If `is-removable` is true, fires on click of the close button.\n */\n (e: 'remove'): void;\n }>();\n\n const classes = useCssModule();\n\n function determineConditionalStyles() {\n const { computedBgColor, computedTextColor } = colorSchemeUtil({\n shade: props.shade,\n color: props.colorScheme,\n });\n\n const colorStyles = `tw-text-${props.textColor || computedTextColor} tw-bg-${props.bgColor || computedBgColor}`;\n\n return {\n 'tw-rounded-none': props.radius === 'none',\n 'tw-rounded-sm': props.radius === 'standard',\n 'tw-rounded-full': props.radius === 'pill',\n [colorStyles]: !props.shouldOverrideColors && !props.disabled,\n 'tw-bg-ice-500 tw-text-white': props.disabled,\n };\n }\n</script>\n\n<template>\n <span\n class=\"stash-chip tw-relative tw-inline-flex tw-items-center\"\n :class=\"[\n `stash-chip--radius-${props.radius}`,\n `stash-chip--size-${props.size}`,\n `stash-chip--shade-${props.shade}`,\n classes.root,\n classes.removableChip,\n classes[`size-${props.size}`],\n determineConditionalStyles(),\n ]\"\n data-test=\"stash-chip\"\n @click=\"emit('click')\"\n >\n <span v-if=\"isRemovable\" :class=\"[{ 'tw-mr-6 tw-truncate': props.isRemovable }]\">\n <!-- @slot Chip text -->\n <slot></slot>\n </span>\n\n <!-- Allows easier testing and DOM quering when the chip text isn't nested in an inner span -->\n <!-- @slot Chip text -->\n <slot v-else></slot>\n\n <button\n v-if=\"props.isRemovable\"\n tabindex=\"-1\"\n class=\"stash-chip__remove-button\"\n :class=\"['tw-absolute', classes['remove-button']]\"\n data-test=\"stash-chip|remove-button\"\n :disabled=\"props.disabled\"\n @keypress.enter.prevent=\"emit('remove')\"\n @mousedown.prevent.stop=\"emit('remove')\"\n >\n <Icon data-test=\"icon|close\" name=\"close\" size=\"small\" />\n </button>\n </span>\n</template>\n\n<style module>\n .root {\n /**\n * Applying these styles this way because the rule of thumb is that tailwind classes should\n * always end up taking precedence, so we're converted these specific styles to be generated\n * in a custom class instead, giving `FilterChip` (which wraps `Chip`) the ability to easily\n * override them.\n */\n @apply tw-leading-none tw-font-semibold tw-uppercase tw-text-[10px];\n }\n\n .size-medium {\n height: 20px;\n padding: 2px 8px 0 8px;\n }\n\n .size-small {\n height: 16px;\n padding: 2px 8px 0 8px;\n }\n\n .remove-button {\n border-radius: inherit;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n height: inherit;\n margin-top: -2px; /* used to offset 2px top padding from .size-medium and size-small */\n padding: 0 4px;\n right: 0;\n }\n\n .remove-button:not(:disabled):hover {\n background: rgb(0 0 0 / 10%);\n }\n</style>\n"],"names":["props","__props","emit","__emit","classes","useCssModule","determineConditionalStyles","computedBgColor","computedTextColor","colorSchemeUtil","colorStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA6DE,UAAMA,IAAQC,GAYRC,IAAOC,GAWPC,IAAUC;AAEhB,aAASC,IAA6B;AACpC,YAAM,EAAE,iBAAAC,GAAiB,mBAAAC,EAAkB,IAAIC,EAAgB;AAAA,QAC7D,OAAOT,EAAM;AAAA,QACb,OAAOA,EAAM;AAAA,MAAA,CACd,GAEKU,IAAc,WAAWV,EAAM,aAAaQ,WAA2BR,EAAM,WAAWO;AAEvF,aAAA;AAAA,QACL,mBAAmBP,EAAM,WAAW;AAAA,QACpC,iBAAiBA,EAAM,WAAW;AAAA,QAClC,mBAAmBA,EAAM,WAAW;AAAA,QACpC,CAACU,CAAW,GAAG,CAACV,EAAM,wBAAwB,CAACA,EAAM;AAAA,QACrD,+BAA+BA,EAAM;AAAA,MAAA;AAAA,IAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/Chip.vue.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { AllowedComponentProps } from 'vue';
|
|
2
|
-
import { ComponentCustomProps } from 'vue';
|
|
3
1
|
import { ComponentOptionsMixin } from 'vue';
|
|
2
|
+
import { ComponentProvideOptions } from 'vue';
|
|
4
3
|
import { DefineComponent } from 'vue';
|
|
5
4
|
import { ExtractPropTypes } from 'vue';
|
|
6
5
|
import { PropType } from 'vue';
|
|
7
|
-
import {
|
|
6
|
+
import { PublicProps } from 'vue';
|
|
8
7
|
|
|
9
8
|
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
10
9
|
|
|
@@ -75,7 +74,7 @@ export declare interface ChipProps {
|
|
|
75
74
|
disabled?: boolean;
|
|
76
75
|
}
|
|
77
76
|
|
|
78
|
-
declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ChipProps>, {
|
|
77
|
+
declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ChipProps>, {
|
|
79
78
|
size: string;
|
|
80
79
|
radius: string;
|
|
81
80
|
colorScheme: string;
|
|
@@ -85,10 +84,10 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
|
|
|
85
84
|
isRemovable: boolean;
|
|
86
85
|
shouldOverrideColors: boolean;
|
|
87
86
|
disabled: boolean;
|
|
88
|
-
}
|
|
87
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
89
88
|
click: () => void;
|
|
90
89
|
remove: () => void;
|
|
91
|
-
}, string,
|
|
90
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ChipProps>, {
|
|
92
91
|
size: string;
|
|
93
92
|
radius: string;
|
|
94
93
|
colorScheme: string;
|
|
@@ -98,12 +97,12 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
|
|
|
98
97
|
isRemovable: boolean;
|
|
99
98
|
shouldOverrideColors: boolean;
|
|
100
99
|
disabled: boolean;
|
|
101
|
-
}>>> & {
|
|
100
|
+
}>>> & Readonly<{
|
|
102
101
|
onClick?: (() => any) | undefined;
|
|
103
102
|
onRemove?: (() => any) | undefined;
|
|
104
|
-
}
|
|
105
|
-
size: "small" | "medium";
|
|
103
|
+
}>, {
|
|
106
104
|
disabled: boolean;
|
|
105
|
+
size: "small" | "medium";
|
|
107
106
|
shade: "main" | "light";
|
|
108
107
|
colorScheme: StashPrimaryColorGroup;
|
|
109
108
|
radius: "standard" | "none" | "pill";
|
|
@@ -111,7 +110,7 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
|
|
|
111
110
|
textColor: "ice-700" | "purple-700" | "purple-500" | "purple-100" | "royal-700" | "royal-500" | "royal-100" | "blue-700" | "blue-500" | "blue-100" | "teal-700" | "teal-500" | "teal-100" | "green-700" | "green-500" | "green-100" | "seafoam-700" | "seafoam-500" | "seafoam-100" | "yellow-700" | "yellow-500" | "yellow-100" | "orange-700" | "orange-500" | "orange-100" | "red-700" | "red-500" | "red-100" | "ice-500" | "ice-200" | "ice-100" | "white" | "black";
|
|
112
111
|
isRemovable: boolean;
|
|
113
112
|
shouldOverrideColors: boolean;
|
|
114
|
-
}, {}>, {
|
|
113
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
115
114
|
default?(_: {}): any;
|
|
116
115
|
}>;
|
|
117
116
|
export default _default;
|
|
@@ -1,125 +1,148 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as I, useCssVars as v, useCssModule as E, ref as V, onMounted as B, watch as P, openBlock as a, createElementBlock as r, normalizeClass as x, unref as l, createElementVNode as z, Fragment as A, renderList as M, toDisplayString as p, createCommentVNode as f } from "vue";
|
|
2
|
+
import { _ as F } from "./_plugin-vue_export-helper-dad06003.js";
|
|
3
|
+
const K = { class: "tw-mb-3 tw-flex tw-gap-6" }, S = ["value", "onInput"], U = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "tw-mt-1 tw-block tw-whitespace-pre-line tw-pr-6 tw-text-center tw-text-red-500",
|
|
6
|
+
"data-test": "field-error"
|
|
7
|
+
}, j = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "tw-mt-1 tw-block tw-whitespace-pre-line tw-pr-6 tw-text-center tw-text-green-500",
|
|
10
|
+
"data-test": "field-success"
|
|
11
|
+
}, L = {
|
|
12
|
+
key: 2,
|
|
13
|
+
class: "tw-mt-1 tw-block tw-whitespace-pre-line tw-pr-6 tw-text-center tw-text-ice-700",
|
|
14
|
+
"data-test": "field-hint"
|
|
15
|
+
}, R = /* @__PURE__ */ I({
|
|
4
16
|
__name: "ConfirmationCodeInput",
|
|
5
17
|
props: {
|
|
6
18
|
digitCount: { default: 6 },
|
|
7
19
|
errorText: { default: void 0 },
|
|
8
|
-
successText: { default: void 0 }
|
|
20
|
+
successText: { default: void 0 },
|
|
21
|
+
hintText: { default: void 0 },
|
|
22
|
+
modelValue: { default: void 0 }
|
|
9
23
|
},
|
|
10
|
-
emits: ["update:model-value"],
|
|
11
|
-
setup(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
24
|
+
emits: ["update:model-value", "change", "focus", "blur"],
|
|
25
|
+
setup(g, { emit: b }) {
|
|
26
|
+
v((t) => ({
|
|
27
|
+
b1b2f1d6: t.digitCount
|
|
28
|
+
}));
|
|
29
|
+
const c = E(), o = g, i = b, s = V([]);
|
|
30
|
+
B(() => {
|
|
31
|
+
var t;
|
|
32
|
+
o.modelValue && (s.value = (t = o.modelValue) == null ? void 0 : t.split(""));
|
|
33
|
+
});
|
|
34
|
+
function k(t, e) {
|
|
35
|
+
var n;
|
|
36
|
+
s.value[e] = (n = t.target) == null ? void 0 : n.value, m(t), t.inputType === "deleteContentBackward" ? d(t) : (t.inputType === "insertText" || t.inputType === "deleteContentForward") && w(t);
|
|
15
37
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
let t = 0;
|
|
22
|
-
s.value.forEach((u, r) => {
|
|
23
|
-
u && (t = r + 1);
|
|
24
|
-
}), n.value[t].focus();
|
|
38
|
+
function m(t) {
|
|
39
|
+
const e = s.value.join("");
|
|
40
|
+
i("update:model-value", e), i("change", { originalEvent: t, value: e });
|
|
25
41
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
function d(t) {
|
|
43
|
+
const e = h(t.target);
|
|
44
|
+
e && (e.focus(), e.select());
|
|
45
|
+
}
|
|
46
|
+
function w(t) {
|
|
47
|
+
const e = _(t.target);
|
|
48
|
+
e && (e.focus(), e.select());
|
|
49
|
+
}
|
|
50
|
+
function h(t) {
|
|
51
|
+
const e = t.previousElementSibling;
|
|
52
|
+
if (e)
|
|
53
|
+
return e.nodeName === "INPUT" ? e : h(e);
|
|
54
|
+
}
|
|
55
|
+
function _(t) {
|
|
56
|
+
const e = t.nextElementSibling;
|
|
57
|
+
if (e)
|
|
58
|
+
return e.nodeName === "INPUT" ? e : _(e);
|
|
59
|
+
}
|
|
60
|
+
function T(t) {
|
|
61
|
+
t.target.select(), i("focus", t);
|
|
62
|
+
}
|
|
63
|
+
function y(t) {
|
|
64
|
+
i("blur", t);
|
|
65
|
+
}
|
|
66
|
+
function C(t) {
|
|
67
|
+
var e;
|
|
68
|
+
if (!(t.ctrlKey || t.metaKey))
|
|
69
|
+
switch (t.code) {
|
|
70
|
+
case "ArrowLeft":
|
|
71
|
+
d(t), t.preventDefault();
|
|
72
|
+
break;
|
|
73
|
+
case "ArrowUp":
|
|
74
|
+
case "ArrowDown":
|
|
75
|
+
t.preventDefault();
|
|
76
|
+
break;
|
|
77
|
+
case "Backspace":
|
|
78
|
+
((e = t.target) == null ? void 0 : e.value.length) === 0 && (d(t), t.preventDefault());
|
|
79
|
+
break;
|
|
80
|
+
case "ArrowRight":
|
|
81
|
+
w(t), t.preventDefault();
|
|
82
|
+
break;
|
|
83
|
+
case "Enter":
|
|
84
|
+
case "NumpadEnter":
|
|
85
|
+
case "Tab":
|
|
86
|
+
break;
|
|
87
|
+
default:
|
|
88
|
+
(!(t.code !== "Space" && Number(t.key) >= 0 && Number(t.key) <= 9) || s.value.join("").length >= o.digitCount && t.code !== "Delete") && t.preventDefault();
|
|
89
|
+
break;
|
|
36
90
|
}
|
|
37
|
-
if (s.value[o])
|
|
38
|
-
return;
|
|
39
|
-
s.value[t] = "", n.value[t].focus();
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (!new RegExp("^([0-9])$").test(e.key) && !s.value[o]) {
|
|
43
|
-
s.value[t] = "", n.value[t].focus();
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
91
|
}
|
|
47
|
-
function
|
|
48
|
-
var
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
|
|
92
|
+
function N(t) {
|
|
93
|
+
var n;
|
|
94
|
+
const e = (n = t.clipboardData) == null ? void 0 : n.getData("text");
|
|
95
|
+
if (e != null && e.length) {
|
|
96
|
+
const u = e == null ? void 0 : e.substring(0, o.digitCount), D = parseInt(u);
|
|
97
|
+
isNaN(D) || (s.value = u.split(""), m(t));
|
|
53
98
|
}
|
|
54
|
-
|
|
55
|
-
if (o)
|
|
56
|
-
for (let r = 1; r < o.length; r++)
|
|
57
|
-
t && (s.value[r] = o[r], t = t.nextElementSibling);
|
|
99
|
+
t.preventDefault();
|
|
58
100
|
}
|
|
59
|
-
return
|
|
60
|
-
() =>
|
|
61
|
-
(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
d("update:model-value", Number(e.value.join("")));
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
{ deep: !0 }
|
|
73
|
-
), (e, o) => (c(), i("form", {
|
|
74
|
-
ref: "otpCont",
|
|
75
|
-
class: "stash-confirmation-code-input tw-inline-block",
|
|
76
|
-
"data-test": "stash-confirmation-code-input",
|
|
77
|
-
onInput: g
|
|
101
|
+
return P(
|
|
102
|
+
() => o.modelValue,
|
|
103
|
+
(t) => {
|
|
104
|
+
s.value = t ? t.split("") : new Array(o.digitCount);
|
|
105
|
+
}
|
|
106
|
+
), (t, e) => (a(), r("div", {
|
|
107
|
+
class: x(["stash-confirmation-code-input tw-inline-block", [l(c)["stash-confirmation-code-input-container"]]]),
|
|
108
|
+
"data-test": "stash-confirmation-code-input"
|
|
78
109
|
}, [
|
|
79
|
-
|
|
80
|
-
(
|
|
81
|
-
key:
|
|
82
|
-
ref_for: !0,
|
|
83
|
-
ref_key: "inputEl",
|
|
84
|
-
ref: n,
|
|
85
|
-
"onUpdate:modelValue": (r) => s.value[t - 1] = r,
|
|
110
|
+
z("div", K, [
|
|
111
|
+
(a(!0), r(A, null, M(o.digitCount, (n) => (a(), r("input", {
|
|
112
|
+
key: n,
|
|
86
113
|
"data-test": "stash-confirmation-code-input__otp",
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
{ [f(l)["has-error"]]: !!a.errorText },
|
|
92
|
-
{ [f(l)["has-success"]]: !!a.successText }
|
|
114
|
+
class: x(["tw-border tw-bg-white tw-p-2 tw-text-center tw-text-base tw-font-medium tw-text-ice-900 focus:tw-border-blue-500", [
|
|
115
|
+
l(c)["otp-code-input"],
|
|
116
|
+
{ [l(c)["has-error"]]: !!o.errorText },
|
|
117
|
+
{ [l(c)["has-success"]]: !!o.successText }
|
|
93
118
|
]]),
|
|
119
|
+
type: "text",
|
|
94
120
|
inputmode: "numeric",
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
121
|
+
maxlength: "1",
|
|
122
|
+
value: s.value[n - 1],
|
|
123
|
+
pattern: "[0-9]",
|
|
124
|
+
autocomplete: "one-time-code",
|
|
125
|
+
onInput: (u) => k(u, n - 1),
|
|
126
|
+
onKeydown: C,
|
|
127
|
+
onPaste: N,
|
|
128
|
+
onFocus: T,
|
|
129
|
+
onBlur: y
|
|
130
|
+
}, null, 42, S))), 128))
|
|
101
131
|
]),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}, v(a.errorText), 3)) : _("", !0),
|
|
107
|
-
a.successText ? (c(), i("small", {
|
|
108
|
-
key: 1,
|
|
109
|
-
class: p(["tw-block tw-text-center tw-text-green-500", f(l).error]),
|
|
110
|
-
"data-test": "field-error"
|
|
111
|
-
}, v(a.successText), 3)) : _("", !0)
|
|
112
|
-
], 544));
|
|
132
|
+
o.errorText ? (a(), r("small", U, p(o.errorText), 1)) : f("", !0),
|
|
133
|
+
o.successText ? (a(), r("small", j, p(o.successText), 1)) : f("", !0),
|
|
134
|
+
o.hintText ? (a(), r("small", L, p(o.hintText), 1)) : f("", !0)
|
|
135
|
+
], 2));
|
|
113
136
|
}
|
|
114
|
-
}),
|
|
115
|
-
|
|
116
|
-
"
|
|
117
|
-
"has-
|
|
118
|
-
|
|
119
|
-
},
|
|
120
|
-
$style:
|
|
121
|
-
},
|
|
137
|
+
}), $ = {
|
|
138
|
+
"stash-confirmation-code-input-container": "_stash-confirmation-code-input-container_kwgaz_2",
|
|
139
|
+
"otp-code-input": "_otp-code-input_kwgaz_9",
|
|
140
|
+
"has-error": "_has-error_kwgaz_16",
|
|
141
|
+
"has-success": "_has-success_kwgaz_20"
|
|
142
|
+
}, q = {
|
|
143
|
+
$style: $
|
|
144
|
+
}, J = /* @__PURE__ */ F(R, [["__cssModules", q]]);
|
|
122
145
|
export {
|
|
123
|
-
|
|
146
|
+
J as default
|
|
124
147
|
};
|
|
125
148
|
//# sourceMappingURL=ConfirmationCodeInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationCodeInput.js","sources":["../src/components/ConfirmationCodeInput/ConfirmationCodeInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { Ref, ref, useCssModule, watch } from 'vue';\n\n const classes = useCssModule();\n\n export interface VerificationCodeInputProps {\n digitCount?: number;\n /**\n * Error text to display.\n */\n errorText?: string;\n /**\n * Success text to display.\n */\n successText?: string;\n }\n\n const props = withDefaults(defineProps<VerificationCodeInputProps>(), {\n digitCount: 6,\n errorText: undefined,\n successText: undefined,\n });\n\n const emit
|
|
1
|
+
{"version":3,"file":"ConfirmationCodeInput.js","sources":["../src/components/ConfirmationCodeInput/ConfirmationCodeInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { onMounted, Ref, ref, useCssModule, watch } from 'vue';\n\n const classes = useCssModule();\n\n export interface VerificationCodeInputProps {\n digitCount?: number;\n /**\n * Error text to display.\n */\n errorText?: string;\n /**\n * Success text to display.\n */\n successText?: string;\n /**\n * Hint text to display.\n */\n hintText?: string;\n /**\n * One time password/code\n */\n modelValue?: string;\n }\n\n const props = withDefaults(defineProps<VerificationCodeInputProps>(), {\n digitCount: 6,\n errorText: undefined,\n successText: undefined,\n hintText: undefined,\n modelValue: undefined,\n });\n\n const emit = defineEmits<{\n (e: 'update:model-value', value: string | null): void;\n (e: 'change', params: { originalEvent: Event; value: string | null }): void;\n (e: 'focus', params: Event): void;\n (e: 'blur', params: Event): void;\n }>();\n\n const data: Ref<Array<string>> = ref([]);\n\n onMounted(() => {\n if (props.modelValue) {\n data.value = props.modelValue?.split('');\n }\n });\n\n function handleInput(event: InputEvent, index) {\n data.value[index] = event.target?.['value'];\n updateModel(event);\n\n if (event.inputType === 'deleteContentBackward') {\n moveToPrev(event);\n } else if (event.inputType === 'insertText' || event.inputType === 'deleteContentForward') {\n moveToNext(event);\n }\n }\n\n function updateModel(event: Event) {\n const newValue = data.value.join('');\n emit('update:model-value', newValue);\n emit('change', { originalEvent: event, value: newValue });\n }\n\n function moveToPrev(event: InputEvent | KeyboardEvent) {\n const prevInput: HTMLInputElement = findPrevInput(event.target as HTMLInputElement);\n\n if (prevInput) {\n prevInput.focus();\n prevInput.select();\n }\n }\n\n function moveToNext(event: InputEvent | KeyboardEvent) {\n const nextInput: HTMLInputElement = findNextInput(event.target as HTMLInputElement);\n\n if (nextInput) {\n nextInput.focus();\n nextInput.select();\n }\n }\n\n function findPrevInput(element: HTMLInputElement) {\n const prevElement = element.previousElementSibling;\n\n if (!prevElement) return;\n\n return prevElement.nodeName === 'INPUT' ? prevElement : findPrevInput(prevElement as HTMLInputElement);\n }\n\n function findNextInput(element: HTMLInputElement) {\n const nextElement = element.nextElementSibling;\n\n if (!nextElement) return;\n\n return nextElement.nodeName === 'INPUT' ? nextElement : findNextInput(nextElement as HTMLInputElement);\n }\n\n function handleFocus(event) {\n event.target.select();\n emit('focus', event);\n }\n\n function handleBlur(event: Event) {\n emit('blur', event);\n }\n\n function handleKeyDown(event: KeyboardEvent) {\n if (event.ctrlKey || event.metaKey) {\n return;\n }\n\n switch (event.code) {\n case 'ArrowLeft':\n moveToPrev(event);\n event.preventDefault();\n break;\n\n case 'ArrowUp':\n case 'ArrowDown':\n event.preventDefault();\n break;\n\n case 'Backspace':\n if (event.target?.['value'].length === 0) {\n moveToPrev(event);\n event.preventDefault();\n }\n break;\n\n case 'ArrowRight':\n moveToNext(event);\n event.preventDefault();\n\n break;\n\n case 'Enter':\n case 'NumpadEnter':\n case 'Tab':\n break;\n\n default:\n if (\n !(event.code !== 'Space' && Number(event.key) >= 0 && Number(event.key) <= 9) ||\n (data.value.join('').length >= props.digitCount && event.code !== 'Delete')\n ) {\n event.preventDefault();\n }\n\n break;\n }\n }\n\n function handlePaste(event: ClipboardEvent) {\n const paste = event.clipboardData?.getData('text');\n\n if (paste?.length) {\n const pastedCode = paste?.substring(0, props.digitCount);\n\n const parsed = parseInt(pastedCode);\n\n if (!isNaN(parsed)) {\n data.value = pastedCode.split('');\n updateModel(event);\n }\n }\n\n event.preventDefault();\n }\n\n watch(\n () => props.modelValue,\n (newValue) => {\n data.value = newValue ? newValue.split('') : new Array(props.digitCount);\n },\n );\n</script>\n\n<template>\n <div\n class=\"stash-confirmation-code-input tw-inline-block\"\n data-test=\"stash-confirmation-code-input\"\n :class=\"[classes['stash-confirmation-code-input-container']]\"\n >\n <div class=\"tw-mb-3 tw-flex tw-gap-6\">\n <template v-for=\"field in props.digitCount\" :key=\"field\">\n <input\n data-test=\"stash-confirmation-code-input__otp\"\n class=\"tw-border tw-bg-white tw-p-2 tw-text-center tw-text-base tw-font-medium tw-text-ice-900 focus:tw-border-blue-500\"\n :class=\"[\n classes['otp-code-input'],\n { [classes['has-error']]: !!props.errorText },\n { [classes['has-success']]: !!props.successText },\n ]\"\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"1\"\n :value=\"data[field - 1]\"\n pattern=\"[0-9]\"\n autocomplete=\"one-time-code\"\n @input=\"handleInput($event as InputEvent, field - 1)\"\n @keydown=\"handleKeyDown\"\n @paste=\"handlePaste\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n />\n </template>\n </div>\n <small\n v-if=\"props.errorText\"\n class=\"tw-mt-1 tw-block tw-whitespace-pre-line tw-pr-6 tw-text-center tw-text-red-500\"\n data-test=\"field-error\"\n >\n {{ props.errorText }}\n </small>\n <small\n v-if=\"props.successText\"\n class=\"tw-mt-1 tw-block tw-whitespace-pre-line tw-pr-6 tw-text-center tw-text-green-500\"\n data-test=\"field-success\"\n >\n {{ props.successText }}\n </small>\n <small\n v-if=\"props.hintText\"\n class=\"tw-mt-1 tw-block tw-whitespace-pre-line tw-pr-6 tw-text-center tw-text-ice-700\"\n data-test=\"field-hint\"\n >\n {{ props.hintText }}\n </small>\n </div>\n</template>\n\n<style module>\n .stash-confirmation-code-input-container {\n --otp-digits: v-bind(digitCount);\n --otp-container-width: calc(var(--otp-digits) * 60px);\n\n width: var(--otp-container-width);\n }\n\n .otp-code-input {\n border-radius: 4px;\n caret-color: transparent;\n height: 36px;\n width: 36px;\n }\n\n .otp-code-input.has-error:not(:focus) {\n border-color: var(--color-red-500);\n }\n\n .otp-code-input.has-success:not(:focus) {\n border-color: var(--color-green-500);\n }\n\n .otp-code-input:focus {\n box-shadow: 0 0 0 3px rgb(0 114 240 / 15%);\n outline: none;\n }\n</style>\n"],"names":["classes","useCssModule","props","__props","emit","__emit","data","ref","onMounted","_a","handleInput","event","index","updateModel","moveToPrev","moveToNext","newValue","prevInput","findPrevInput","nextInput","findNextInput","element","prevElement","nextElement","handleFocus","handleBlur","handleKeyDown","handlePaste","paste","pastedCode","parsed","watch"],"mappings":"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"}
|