@leaflink/stash 44.0.0-beta.1 → 44.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionsDropdown.js +9 -9
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/AddressSelect.js +12 -11
- package/dist/AddressSelect.js.map +1 -1
- package/dist/Alert.js +2 -2
- package/dist/Alert.js.map +1 -1
- package/dist/AppNavigationItem.js +15 -15
- package/dist/AppNavigationItem.js.map +1 -1
- package/dist/AppSidebar.js +17 -17
- package/dist/AppSidebar.js.map +1 -1
- package/dist/AppTopbar.js +12 -12
- package/dist/Avatar.js +12 -12
- package/dist/Avatar.js.map +1 -1
- package/dist/Backdrop.js +1 -1
- package/dist/Backdrop.js.map +1 -1
- package/dist/Badge.js +12 -12
- package/dist/Badge.js.map +1 -1
- package/dist/Button.js +1 -1
- package/dist/Button.js.map +1 -1
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-b2ee90e6.js +17 -0
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-b2ee90e6.js.map +1 -0
- package/dist/ButtonGroup.js +26 -26
- package/dist/ButtonGroup.js.map +1 -1
- package/dist/Card.js +3 -3
- package/dist/Card.js.map +1 -1
- package/dist/CardHeader.js +3 -3
- package/dist/CardMedia.js +1 -1
- package/dist/CardMedia.js.map +1 -1
- package/dist/Carousel.js +24 -24
- package/dist/Carousel.js.map +1 -1
- package/dist/Checkbox.js +27 -26
- package/dist/Checkbox.js.map +1 -1
- package/dist/{Checkbox.vue_vue_type_style_index_0_scoped_0d7e7fd0_lang-4ed993c7.js → Checkbox.vue_vue_type_style_index_0_scoped_dbd26d7f_lang-4ed993c7.js} +1 -1
- package/dist/Checkbox.vue_vue_type_style_index_0_scoped_dbd26d7f_lang-4ed993c7.js.map +1 -0
- package/dist/ChevronToggle.js +1 -1
- package/dist/Chip.js +1 -1
- package/dist/Chip.js.map +1 -1
- package/dist/ConfirmationCodeInput.js +21 -21
- package/dist/ConfirmationCodeInput.js.map +1 -1
- package/dist/ContextSwitcher.js +6 -5
- package/dist/ContextSwitcher.js.map +1 -1
- package/dist/Copy.js +1 -1
- package/dist/CurrencyInput.js +2 -2
- package/dist/DataView.js +1 -1
- package/dist/DataViewFilters.js +7 -7
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/DataViewSortButton.js +5 -5
- package/dist/DataViewSortButton.js.map +1 -1
- package/dist/DataViewToolbar.js +4 -4
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DatePicker.js +8 -8
- package/dist/DatePicker.js.map +1 -1
- package/dist/DescriptionListTerm.js +1 -1
- package/dist/DescriptionListTerm.js.map +1 -1
- package/dist/Dialog.js +34 -34
- package/dist/Dialog.js.map +1 -1
- package/dist/Dropdown.js +3 -3
- package/dist/Dropdown.js.map +1 -1
- package/dist/EmptyState.js +1 -1
- package/dist/EmptyState.js.map +1 -1
- package/dist/Field.js +2 -2
- package/dist/{Field.vue_vue_type_script_setup_true_lang-475832fe.js → Field.vue_vue_type_script_setup_true_lang-42cf79d4.js} +5 -5
- package/dist/{Field.vue_vue_type_script_setup_true_lang-475832fe.js.map → Field.vue_vue_type_script_setup_true_lang-42cf79d4.js.map} +1 -1
- package/dist/FileUpload.js +25 -25
- package/dist/FileUpload.js.map +1 -1
- package/dist/FilterChip.js +32 -32
- package/dist/FilterChip.js.map +1 -1
- package/dist/FilterDrawerItem.js +4 -4
- package/dist/FilterDrawerItem.js.map +1 -1
- package/dist/FilterDropdown.js +19 -19
- package/dist/FilterDropdown.js.map +1 -1
- package/dist/FilterSelect.js +2 -2
- package/dist/Filters.js +7 -6
- package/dist/Filters.js.map +1 -1
- package/dist/HttpError.js +30 -30
- package/dist/HttpError.js.map +1 -1
- package/dist/IconLabel.js +1 -1
- package/dist/IconLabel.js.map +1 -1
- package/dist/InlineEdit.js +3 -3
- package/dist/InlineEdit.js.map +1 -1
- package/dist/Input.js +37 -37
- package/dist/Input.js.map +1 -1
- package/dist/InputOptions.js +37 -36
- package/dist/InputOptions.js.map +1 -1
- package/dist/Label.js +1 -1
- package/dist/{Label.vue_vue_type_script_setup_true_lang-1d29d98a.js → Label.vue_vue_type_script_setup_true_lang-c5589919.js} +2 -2
- package/dist/{Label.vue_vue_type_script_setup_true_lang-1d29d98a.js.map → Label.vue_vue_type_script_setup_true_lang-c5589919.js.map} +1 -1
- package/dist/ListItem.js +6 -5
- package/dist/ListItem.js.map +1 -1
- package/dist/ListView.js +55 -54
- package/dist/ListView.js.map +1 -1
- package/dist/Menu.js +1 -1
- package/dist/Menu.js.map +1 -1
- package/dist/Metric.js +4 -4
- package/dist/Metric.js.map +1 -1
- package/dist/Modal.js +21 -21
- package/dist/Modal.js.map +1 -1
- package/dist/Module.js +2 -2
- package/dist/Module.js.map +1 -1
- package/dist/ModuleContent.js +2 -2
- package/dist/ModuleContent.js.map +1 -1
- package/dist/ModuleFooter.js +11 -11
- package/dist/ModuleFooter.js.map +1 -1
- package/dist/ModuleHeader.js +6 -6
- package/dist/ModuleHeader.js.map +1 -1
- package/dist/ObfuscateText.js +1 -1
- package/dist/PageHeader.js +3 -3
- package/dist/PageHeader.js.map +1 -1
- package/dist/PageNavigation.js +2 -2
- package/dist/Paginate.js +1 -1
- package/dist/Paginate.js.map +1 -1
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-1a2084f9.js +11 -0
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-1a2084f9.js.map +1 -0
- package/dist/QuickAction.js +11 -11
- package/dist/QuickAction.js.map +1 -1
- package/dist/Radio.js +2 -2
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js +44 -44
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioNew.js +14 -14
- package/dist/SearchBar.js +21 -21
- package/dist/SearchBar.js.map +1 -1
- package/dist/Select.js +187 -186
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +22 -21
- package/dist/SelectStatus.js.map +1 -1
- package/dist/Step.js +37 -37
- package/dist/Step.js.map +1 -1
- package/dist/Switch.js +26 -25
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.js +3 -2
- package/dist/Tab.js.map +1 -1
- package/dist/{Tab.vue_vue_type_script_setup_true_lang-b810bee8.js → Tab.vue_vue_type_script_setup_true_lang-4a40f015.js} +23 -22
- package/dist/Tab.vue_vue_type_script_setup_true_lang-4a40f015.js.map +1 -0
- package/dist/Table.js +20 -19
- package/dist/Table.js.map +1 -1
- package/dist/TableCell.js +22 -21
- package/dist/TableCell.js.map +1 -1
- package/dist/TableHeaderCell.js +7 -6
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/TableHeaderRow.js +6 -5
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableRow.js +24 -23
- package/dist/TableRow.js.map +1 -1
- package/dist/Tabs.js +2 -2
- package/dist/{Tabs.vue_used_vue_type_style_index_0_lang.module-4f247ed7.js → Tabs.vue_used_vue_type_style_index_0_lang.module-0af1e1cf.js} +3 -3
- package/dist/{Tabs.vue_used_vue_type_style_index_0_lang.module-4f247ed7.js.map → Tabs.vue_used_vue_type_style_index_0_lang.module-0af1e1cf.js.map} +1 -1
- package/dist/Textarea.js +2 -2
- package/dist/components.css +1 -1
- package/dist/index.js +21 -20
- package/dist/index.js.map +1 -1
- package/dist/storage.js +3 -2
- package/dist/storage.js.map +1 -1
- package/dist/useGoogleMaps.js.map +1 -1
- package/dist/utils/storage.js +30 -29
- package/dist/utils/storage.js.map +1 -1
- package/package.json +2 -2
- package/styles/_base.scss +1 -1
- package/styles/_core.scss +1 -1
- package/styles/elements/_links.scss +1 -1
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-b77978d6.js +0 -17
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-b77978d6.js.map +0 -1
- package/dist/Checkbox.vue_vue_type_style_index_0_scoped_0d7e7fd0_lang-4ed993c7.js.map +0 -1
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-bfccf992.js +0 -11
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-bfccf992.js.map +0 -1
- package/dist/Tab.vue_vue_type_script_setup_true_lang-b810bee8.js.map +0 -1
|
@@ -11,7 +11,7 @@ const p = ["data-variant"], w = {
|
|
|
11
11
|
throw new Error("DescriptionListDetail must be used within a DescriptionList component.");
|
|
12
12
|
const { variant: t } = s;
|
|
13
13
|
return (r, u) => (i(), n("dt", {
|
|
14
|
-
class: c(["stash-description-list-term tw-text-
|
|
14
|
+
class: c(["stash-description-list-term tw-text-medium tw-text-ice-900", {
|
|
15
15
|
"md:tw-w-2/5 md:tw-max-w-[10.5rem]": e(t) === "columns",
|
|
16
16
|
"tw-mr-1.5": e(t) === "inline",
|
|
17
17
|
"tw-pb-1.5": e(t) === "stacked",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DescriptionListTerm.js","sources":["../src/components/DescriptionListTerm/DescriptionListTerm.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { inject } from 'vue';\n\n import { DESCRIPTION_LIST_INJECTION } from '../DescriptionList/DescriptionList.keys';\n\n const descriptionListInjectedValues = inject(DESCRIPTION_LIST_INJECTION.key);\n if (!descriptionListInjectedValues) {\n throw new Error('DescriptionListDetail must be used within a DescriptionList component.');\n }\n const { variant } = descriptionListInjectedValues;\n</script>\n\n<template>\n <dt\n class=\"stash-description-list-term tw-text-
|
|
1
|
+
{"version":3,"file":"DescriptionListTerm.js","sources":["../src/components/DescriptionListTerm/DescriptionListTerm.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { inject } from 'vue';\n\n import { DESCRIPTION_LIST_INJECTION } from '../DescriptionList/DescriptionList.keys';\n\n const descriptionListInjectedValues = inject(DESCRIPTION_LIST_INJECTION.key);\n if (!descriptionListInjectedValues) {\n throw new Error('DescriptionListDetail must be used within a DescriptionList component.');\n }\n const { variant } = descriptionListInjectedValues;\n</script>\n\n<template>\n <dt\n class=\"stash-description-list-term tw-text-medium tw-text-ice-900\"\n :class=\"{\n 'md:tw-w-2/5 md:tw-max-w-[10.5rem]': variant === 'columns',\n 'tw-mr-1.5': variant === 'inline',\n 'tw-pb-1.5': variant === 'stacked',\n 'tw-pb-1.5 md:tw-pb-0': variant !== 'stacked',\n }\"\n data-test=\"stash-description-list-term\"\n :data-variant=\"variant\"\n >\n <!-- @slot Default slot, for rendering a term -->\n <slot></slot><span v-if=\"variant === 'inline'\" class=\"hidden md:inline\">:</span>\n </dt>\n</template>\n"],"names":["descriptionListInjectedValues","inject","DESCRIPTION_LIST_INJECTION","variant"],"mappings":";;;;;;;;AAKQ,UAAAA,IAAgCC,EAAOC,EAA2B,GAAG;AAC3E,QAAI,CAACF;AACG,YAAA,IAAI,MAAM,wEAAwE;AAEpF,UAAA,EAAE,SAAAG,EAAY,IAAAH;;;;;;;;;;;;;;;;"}
|
package/dist/Dialog.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as K, useSlots as Z, useAttrs as z, useCssModule as A, ref as C, computed as n, watchEffect as H, nextTick as L, openBlock as s, createBlock as f, Transition as q, withCtx as m, createElementBlock as p, mergeProps as P, unref as e, withKeys as Y, createElementVNode as a, normalizeClass as o, createCommentVNode as r, toDisplayString as _, renderSlot as j, createTextVNode as T, createVNode as F } from "vue";
|
|
2
2
|
import S from "lodash-es/capitalize";
|
|
3
3
|
import G from "lodash-es/uniqueId";
|
|
4
4
|
import { S as B, a as I, b as J } from "./statusLevels-a8b041f4.js";
|
|
5
5
|
import { t as c } from "./locale.js";
|
|
6
|
-
import
|
|
6
|
+
import D from "./Button.js";
|
|
7
7
|
import O from "./Icon.js";
|
|
8
8
|
import { _ as Q } from "./_plugin-vue_export-helper-dad06003.js";
|
|
9
9
|
import "lodash-es/get";
|
|
10
|
-
import "./Button.vue_used_vue_type_style_index_0_lang.module-
|
|
10
|
+
import "./Button.vue_used_vue_type_style_index_0_lang.module-b2ee90e6.js";
|
|
11
11
|
import "./index-79ce320f.js";
|
|
12
12
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
13
13
|
const R = ["open", "aria-labelledby", "data-test", "onKeydown"], U = ["id"], W = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "tw-mb-0"
|
|
16
|
-
}, X = ["innerHTML"], tt = { class: "tw-text-right" }, et = /* @__PURE__ */
|
|
16
|
+
}, X = ["innerHTML"], tt = { class: "tw-text-right" }, et = /* @__PURE__ */ K({
|
|
17
17
|
name: "ll-dialog",
|
|
18
18
|
inheritAttrs: !1,
|
|
19
19
|
__name: "Dialog",
|
|
@@ -29,30 +29,30 @@ const R = ["open", "aria-labelledby", "data-test", "onKeydown"], U = ["id"], W =
|
|
|
29
29
|
status: { default: void 0 }
|
|
30
30
|
},
|
|
31
31
|
emits: ["update:open", "cancel"],
|
|
32
|
-
setup(
|
|
33
|
-
const t =
|
|
32
|
+
setup(M, { emit: y }) {
|
|
33
|
+
const t = M, b = Z(), i = z(), l = A(), g = G("dialog-header-"), d = C(!1), h = C(), E = n(() => t.confirmText || (t.alert ? c("ll.okay") : c("ll.confirm"))), v = n(() => !!b.default || t.description), N = n(
|
|
34
34
|
() => t.status ? B[S(t.status)] : B.Info
|
|
35
|
-
),
|
|
35
|
+
), w = n(
|
|
36
36
|
() => t.status ? I[S(t.status)] : I.Info
|
|
37
|
-
),
|
|
38
|
-
function
|
|
37
|
+
), V = n(() => t.dangerZone || t.status === J.Error);
|
|
38
|
+
function x() {
|
|
39
39
|
y("update:open", !1), y("cancel");
|
|
40
40
|
}
|
|
41
|
-
async function
|
|
41
|
+
async function $(u) {
|
|
42
42
|
d.value = !0;
|
|
43
|
-
const
|
|
44
|
-
await
|
|
43
|
+
const k = i.onConfirm;
|
|
44
|
+
await k(u), d.value = !1;
|
|
45
45
|
}
|
|
46
|
-
return
|
|
47
|
-
t.open &&
|
|
48
|
-
|
|
46
|
+
return H(() => {
|
|
47
|
+
t.open && L(function() {
|
|
48
|
+
h.value.focus();
|
|
49
49
|
});
|
|
50
|
-
}), (u,
|
|
50
|
+
}), (u, k) => (s(), f(q, { name: "fade" }, {
|
|
51
51
|
default: m(() => [
|
|
52
|
-
t.open ? (s(), p("dialog",
|
|
52
|
+
t.open ? (s(), p("dialog", P({
|
|
53
53
|
key: 0,
|
|
54
54
|
ref_key: "root",
|
|
55
|
-
ref:
|
|
55
|
+
ref: h,
|
|
56
56
|
open: t.open,
|
|
57
57
|
tabindex: "0",
|
|
58
58
|
"aria-labelledby": e(g),
|
|
@@ -60,12 +60,12 @@ const R = ["open", "aria-labelledby", "data-test", "onKeydown"], U = ["id"], W =
|
|
|
60
60
|
class: e(l).dialog,
|
|
61
61
|
"data-test": e(i)["data-test"] || "ll-dialog"
|
|
62
62
|
}, e(i), {
|
|
63
|
-
onKeydown:
|
|
63
|
+
onKeydown: Y(x, ["esc"])
|
|
64
64
|
}), [
|
|
65
65
|
a("div", {
|
|
66
66
|
class: o([
|
|
67
67
|
e(l).body,
|
|
68
|
-
`tw-border-${
|
|
68
|
+
`tw-border-${w.value}`,
|
|
69
69
|
{
|
|
70
70
|
"tw-border-t-6": t.status
|
|
71
71
|
}
|
|
@@ -75,21 +75,21 @@ const R = ["open", "aria-labelledby", "data-test", "onKeydown"], U = ["id"], W =
|
|
|
75
75
|
class: o(e(l).content)
|
|
76
76
|
}, [
|
|
77
77
|
a("div", {
|
|
78
|
-
class: o(["tw-flex tw-items-center",
|
|
78
|
+
class: o(["tw-flex tw-items-center", v.value && "tw-mb-1.5"])
|
|
79
79
|
}, [
|
|
80
80
|
t.status ? (s(), f(O, {
|
|
81
81
|
key: 0,
|
|
82
82
|
"data-test": "dialog-status-icon",
|
|
83
|
-
name:
|
|
84
|
-
class: o(`tw-text-${
|
|
83
|
+
name: N.value,
|
|
84
|
+
class: o(`tw-text-${w.value}`)
|
|
85
85
|
}, null, 8, ["name", "class"])) : r("", !0),
|
|
86
86
|
a("h3", {
|
|
87
87
|
id: e(g),
|
|
88
88
|
class: o({ "tw-ml-1.5 tw-mt-px": t.status })
|
|
89
89
|
}, _(t.header), 11, U)
|
|
90
90
|
], 2),
|
|
91
|
-
|
|
92
|
-
e(b).default ?
|
|
91
|
+
v.value ? (s(), p("p", W, [
|
|
92
|
+
e(b).default ? j(u.$slots, "default", { key: 0 }) : (s(), p("span", {
|
|
93
93
|
key: 1,
|
|
94
94
|
innerHTML: t.description
|
|
95
95
|
}, null, 8, X))
|
|
@@ -102,28 +102,28 @@ const R = ["open", "aria-labelledby", "data-test", "onKeydown"], U = ["id"], W =
|
|
|
102
102
|
a("div", {
|
|
103
103
|
class: o({ "button-grid": !t.alert })
|
|
104
104
|
}, [
|
|
105
|
-
t.alert ? r("", !0) : (s(), f(
|
|
105
|
+
t.alert ? r("", !0) : (s(), f(D, {
|
|
106
106
|
key: 0,
|
|
107
107
|
"data-test": "button|cancel",
|
|
108
108
|
secondary: "",
|
|
109
|
-
onClick:
|
|
109
|
+
onClick: x
|
|
110
110
|
}, {
|
|
111
111
|
default: m(() => [
|
|
112
112
|
T(_(t.cancelText), 1)
|
|
113
113
|
]),
|
|
114
114
|
_: 1
|
|
115
115
|
})),
|
|
116
|
-
F(
|
|
116
|
+
F(D, {
|
|
117
117
|
"data-test": "button|confirm",
|
|
118
118
|
disabled: t.disabled || d.value,
|
|
119
|
-
color:
|
|
119
|
+
color: V.value ? "red" : "blue",
|
|
120
120
|
class: o({
|
|
121
121
|
"tw-w-full": t.alert
|
|
122
122
|
}),
|
|
123
|
-
onClick:
|
|
123
|
+
onClick: $
|
|
124
124
|
}, {
|
|
125
125
|
default: m(() => [
|
|
126
|
-
T(_(
|
|
126
|
+
T(_(E.value), 1)
|
|
127
127
|
]),
|
|
128
128
|
_: 1
|
|
129
129
|
}, 8, ["disabled", "color", "class"])
|
|
@@ -136,7 +136,7 @@ const R = ["open", "aria-labelledby", "data-test", "onKeydown"], U = ["id"], W =
|
|
|
136
136
|
_: 3
|
|
137
137
|
}));
|
|
138
138
|
}
|
|
139
|
-
}), ot = "
|
|
139
|
+
}), ot = "_dialog_1n595_176", at = "_body_1n595_193", st = "_grey_1n595_206", nt = "_content_1n595_211", lt = "_footer_1n595_216", rt = {
|
|
140
140
|
dialog: ot,
|
|
141
141
|
body: at,
|
|
142
142
|
grey: st,
|
|
@@ -144,8 +144,8 @@ const R = ["open", "aria-labelledby", "data-test", "onKeydown"], U = ["id"], W =
|
|
|
144
144
|
footer: lt
|
|
145
145
|
}, ct = {
|
|
146
146
|
$style: rt
|
|
147
|
-
},
|
|
147
|
+
}, wt = /* @__PURE__ */ Q(et, [["__cssModules", ct]]);
|
|
148
148
|
export {
|
|
149
|
-
|
|
149
|
+
wt as default
|
|
150
150
|
};
|
|
151
151
|
//# sourceMappingURL=Dialog.js.map
|
package/dist/Dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sources":["../src/components/Dialog/Dialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import capitalize from 'lodash-es/capitalize';\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, nextTick, ref, useAttrs, useCssModule, useSlots, watchEffect } from 'vue';\n\n import {\n StatusColor,\n StatusColors,\n StatusIcon,\n StatusIcons,\n StatusSeverities,\n StatusSeverity,\n } from '../../../types/statusLevels';\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n export interface DialogProps {\n /**\n * Shows or hides the dialog.\n * Usage: v-model:open=\"isOpen\"\n */\n open?: boolean;\n\n /**\n * Whether the confirmation button is enabled or not.\n */\n disabled?: boolean;\n\n /**\n * Is this a dangerous action? Will turn the confirmation button red.\n */\n dangerZone?: boolean;\n\n /**\n * Header text.\n */\n header?: string;\n\n /**\n * Description text.\n */\n description?: string;\n\n /**\n * Cancel button text.\n */\n cancelText?: string;\n\n /**\n * Confirm button text.\n */\n confirmText?: string;\n\n /**\n * Treats it like an Alert Dialog, with only the confirmation button showing.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/alert}\n */\n alert?: boolean;\n\n /**\n * Adds a top accent border and icon next to the header.\n * This behaves similarly to the Alert component in respect to the levels, icons, and colors\n * passing `error` will treat the dialog the same as `dangerZone`\n */\n status?: StatusSeverity;\n }\n\n const props = withDefaults(defineProps<DialogProps>(), {\n open: false,\n disabled: false,\n dangerZone: false,\n header: t('ll.areYouSure'),\n description: '',\n cancelText: t('ll.cancel'),\n confirmText: '',\n alert: false,\n status: undefined,\n });\n\n defineOptions({\n name: 'll-dialog',\n inheritAttrs: false,\n });\n\n const emits =\n defineEmits<{\n (e: 'update:open', value: boolean): void;\n (e: 'cancel'): void;\n }>();\n\n const slots = useSlots();\n const attrs = useAttrs();\n const classes = useCssModule();\n const headerId = uniqueId('dialog-header-');\n\n const isConfirming = ref(false);\n const root = ref();\n\n /**\n * Set the default confirm button text to \"Confirm\".\n * If the `alert` prop is true, the default text is \"Okay\".\n * If the `confirmText` prop is provided, `confirmText` is used whether or not\n * the alert prop is true.\n */\n const modifiedConfirmText = computed(() => props.confirmText || (props.alert ? t('ll.okay') : t('ll.confirm')));\n\n const hasDescription = computed(() => !!slots.default || props.description);\n\n const statusIcon = computed<StatusIcon>(() =>\n props.status ? StatusIcons[capitalize(props.status)] : StatusIcons.Info,\n );\n const statusColor = computed<StatusColor>(() =>\n props.status ? StatusColors[capitalize(props.status)] : StatusColors.Info,\n );\n\n const computedDangerZone = computed(() => props.dangerZone || props.status === StatusSeverities.Error);\n\n function cancel() {\n emits('update:open', false);\n emits('cancel');\n }\n\n async function handleConfirm(event: Event) {\n isConfirming.value = true;\n\n // useAttrs returns a Record<string, unknown> type, which causes\n // TS errors when trying to call a passed listener\n const onConfirm = attrs.onConfirm as (event: Event) => void;\n\n // Call the parent confirm listener and await it. Using Async/Await lets\n // us await even non-promises. Pass the event so modifiers can work.\n await onConfirm(event);\n isConfirming.value = false;\n }\n\n watchEffect(() => {\n if (props.open) {\n // Move focus to confirm button\n nextTick(function () {\n root.value.focus();\n });\n }\n });\n</script>\n\n<template>\n <transition name=\"fade\">\n <dialog\n v-if=\"props.open\"\n ref=\"root\"\n :open=\"props.open\"\n tabindex=\"0\"\n :aria-labelledby=\"headerId\"\n aria-modal=\"true\"\n :class=\"classes.dialog\"\n :data-test=\"attrs['data-test'] || 'll-dialog'\"\n v-bind=\"attrs\"\n @keydown.esc=\"cancel\"\n >\n <div\n :class=\"[\n classes.body,\n `tw-border-${statusColor}`,\n {\n 'tw-border-t-6': props.status,\n },\n ]\"\n >\n <div :class=\"classes.content\">\n <div class=\"tw-flex tw-items-center\" :class=\"hasDescription && 'tw-mb-1.5'\">\n <Icon\n v-if=\"props.status\"\n data-test=\"dialog-status-icon\"\n :name=\"statusIcon\"\n :class=\"`tw-text-${statusColor}`\"\n />\n <h3 :id=\"headerId\" :class=\"{ 'tw-ml-1.5 tw-mt-px': props.status }\">{{ props.header }}</h3>\n </div>\n\n <p v-if=\"hasDescription\" class=\"tw-mb-0\">\n <slot v-if=\"slots.default\"></slot>\n <span v-else v-html=\"props.description\"></span>\n </p>\n </div>\n\n <footer :class=\"classes.footer\">\n <div class=\"tw-text-right\">\n <div :class=\"{ 'button-grid': !props.alert }\">\n <Button v-if=\"!props.alert\" data-test=\"button|cancel\" secondary @click=\"cancel\">\n {{ props.cancelText }}\n </Button>\n\n <Button\n data-test=\"button|confirm\"\n :disabled=\"props.disabled || isConfirming\"\n :color=\"computedDangerZone ? 'red' : 'blue'\"\n :class=\"{\n 'tw-w-full': props.alert,\n }\"\n @click=\"handleConfirm\"\n >\n {{ modifiedConfirmText }}\n </Button>\n </div>\n </div>\n </footer>\n </div>\n </dialog>\n </transition>\n</template>\n\n<style lang=\"scss\" module>\n .dialog {\n background: rgb(0 0 0 / 30%);\n bottom: 0;\n display: flex;\n flex-direction: column;\n left: 0;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n place-content: center;\n position: fixed;\n right: 0;\n top: 0;\n z-index: z-index('dialog');\n width: 100%;\n height: 100vh;\n }\n\n .body {\n @include elevation('low');\n\n background: var(--color-white);\n border-radius: $border-radius;\n color: var(--color-ice-700);\n display: flex;\n flex-direction: column;\n margin: 0 auto;\n max-height: 100vh;\n max-width: 360px;\n transition: transform $primary-transition;\n width: 100%;\n\n &.grey {\n background: var(--color-ice-200);\n border-radius: $border-radius;\n }\n }\n\n .content {\n flex-grow: 1;\n padding: space(3) var(--grid-gutter);\n }\n\n .footer {\n background: var(--color-ice-200);\n border-top: border('thin', var(--color-ice));\n display: initial; // TEMP. Will need to fix marketplace `footer` style\n padding: space(3) var(--grid-gutter);\n\n @include breakpoint('md') {\n border-bottom-left-radius: $border-radius;\n border-bottom-right-radius: $border-radius;\n }\n }\n\n :global(.fade-enter-from),\n :global(.fade-leave-active) {\n .body {\n transform: translate3d(0, #{space(2)}, 0);\n }\n }\n</style>\n"],"names":["slots","useSlots","attrs","useAttrs","classes","useCssModule","headerId","uniqueId","isConfirming","ref","root","modifiedConfirmText","computed","props","t","hasDescription","statusIcon","StatusIcons","capitalize","statusColor","StatusColors","computedDangerZone","StatusSeverities","cancel","emits","handleConfirm","event","onConfirm","watchEffect","nextTick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4FQA,IAAQC,KACRC,IAAQC,KACRC,IAAUC,KACVC,IAAWC,EAAS,gBAAgB,GAEpCC,IAAeC,EAAI,EAAK,GACxBC,IAAOD,KAQPE,IAAsBC,EAAS,MAAMC,EAAM,gBAAgBA,EAAM,QAAQC,EAAE,SAAS,IAAIA,EAAE,YAAY,EAAE,GAExGC,IAAiBH,EAAS,MAAM,CAAC,CAACZ,EAAM,WAAWa,EAAM,WAAW,GAEpEG,IAAaJ;AAAA,MAAqB,MACtCC,EAAM,SAASI,EAAYC,EAAWL,EAAM,MAAM,CAAC,IAAII,EAAY;AAAA,IAAA,GAE/DE,IAAcP;AAAA,MAAsB,MACxCC,EAAM,SAASO,EAAaF,EAAWL,EAAM,MAAM,CAAC,IAAIO,EAAa;AAAA,IAAA,GAGjEC,IAAqBT,EAAS,MAAMC,EAAM,cAAcA,EAAM,WAAWS,EAAiB,KAAK;AAErG,aAASC,IAAS;AAChB,MAAAC,EAAM,eAAe,EAAK,GAC1BA,EAAM,QAAQ;AAAA,IAChB;AAEA,mBAAeC,EAAcC,GAAc;AACzC,MAAAlB,EAAa,QAAQ;AAIrB,YAAMmB,IAAYzB,EAAM;AAIxB,YAAMyB,EAAUD,CAAK,GACrBlB,EAAa,QAAQ;AAAA,IACvB;AAEA,WAAAoB,EAAY,MAAM;AAChB,MAAIf,EAAM,QAERgB,EAAS,WAAY;AACnB,QAAAnB,EAAK,MAAM;MAAM,CAClB;AAAA,IACH,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Dialog.js","sources":["../src/components/Dialog/Dialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import capitalize from 'lodash-es/capitalize';\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, nextTick, ref, useAttrs, useCssModule, useSlots, watchEffect } from 'vue';\n\n import {\n StatusColor,\n StatusColors,\n StatusIcon,\n StatusIcons,\n StatusSeverities,\n StatusSeverity,\n } from '../../../types/statusLevels';\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n export interface DialogProps {\n /**\n * Shows or hides the dialog.\n * Usage: v-model:open=\"isOpen\"\n */\n open?: boolean;\n\n /**\n * Whether the confirmation button is enabled or not.\n */\n disabled?: boolean;\n\n /**\n * Is this a dangerous action? Will turn the confirmation button red.\n */\n dangerZone?: boolean;\n\n /**\n * Header text.\n */\n header?: string;\n\n /**\n * Description text.\n */\n description?: string;\n\n /**\n * Cancel button text.\n */\n cancelText?: string;\n\n /**\n * Confirm button text.\n */\n confirmText?: string;\n\n /**\n * Treats it like an Alert Dialog, with only the confirmation button showing.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/alert}\n */\n alert?: boolean;\n\n /**\n * Adds a top accent border and icon next to the header.\n * This behaves similarly to the Alert component in respect to the levels, icons, and colors\n * passing `error` will treat the dialog the same as `dangerZone`\n */\n status?: StatusSeverity;\n }\n\n const props = withDefaults(defineProps<DialogProps>(), {\n open: false,\n disabled: false,\n dangerZone: false,\n header: t('ll.areYouSure'),\n description: '',\n cancelText: t('ll.cancel'),\n confirmText: '',\n alert: false,\n status: undefined,\n });\n\n defineOptions({\n name: 'll-dialog',\n inheritAttrs: false,\n });\n\n const emits =\n defineEmits<{\n (e: 'update:open', value: boolean): void;\n (e: 'cancel'): void;\n }>();\n\n const slots = useSlots();\n const attrs = useAttrs();\n const classes = useCssModule();\n const headerId = uniqueId('dialog-header-');\n\n const isConfirming = ref(false);\n const root = ref();\n\n /**\n * Set the default confirm button text to \"Confirm\".\n * If the `alert` prop is true, the default text is \"Okay\".\n * If the `confirmText` prop is provided, `confirmText` is used whether or not\n * the alert prop is true.\n */\n const modifiedConfirmText = computed(() => props.confirmText || (props.alert ? t('ll.okay') : t('ll.confirm')));\n\n const hasDescription = computed(() => !!slots.default || props.description);\n\n const statusIcon = computed<StatusIcon>(() =>\n props.status ? StatusIcons[capitalize(props.status)] : StatusIcons.Info,\n );\n const statusColor = computed<StatusColor>(() =>\n props.status ? StatusColors[capitalize(props.status)] : StatusColors.Info,\n );\n\n const computedDangerZone = computed(() => props.dangerZone || props.status === StatusSeverities.Error);\n\n function cancel() {\n emits('update:open', false);\n emits('cancel');\n }\n\n async function handleConfirm(event: Event) {\n isConfirming.value = true;\n\n // useAttrs returns a Record<string, unknown> type, which causes\n // TS errors when trying to call a passed listener\n const onConfirm = attrs.onConfirm as (event: Event) => void;\n\n // Call the parent confirm listener and await it. Using Async/Await lets\n // us await even non-promises. Pass the event so modifiers can work.\n await onConfirm(event);\n isConfirming.value = false;\n }\n\n watchEffect(() => {\n if (props.open) {\n // Move focus to confirm button\n nextTick(function () {\n root.value.focus();\n });\n }\n });\n</script>\n\n<template>\n <transition name=\"fade\">\n <dialog\n v-if=\"props.open\"\n ref=\"root\"\n :open=\"props.open\"\n tabindex=\"0\"\n :aria-labelledby=\"headerId\"\n aria-modal=\"true\"\n :class=\"classes.dialog\"\n :data-test=\"attrs['data-test'] || 'll-dialog'\"\n v-bind=\"attrs\"\n @keydown.esc=\"cancel\"\n >\n <div\n :class=\"[\n classes.body,\n `tw-border-${statusColor}`,\n {\n 'tw-border-t-6': props.status,\n },\n ]\"\n >\n <div :class=\"classes.content\">\n <div class=\"tw-flex tw-items-center\" :class=\"hasDescription && 'tw-mb-1.5'\">\n <Icon\n v-if=\"props.status\"\n data-test=\"dialog-status-icon\"\n :name=\"statusIcon\"\n :class=\"`tw-text-${statusColor}`\"\n />\n <h3 :id=\"headerId\" :class=\"{ 'tw-ml-1.5 tw-mt-px': props.status }\">{{ props.header }}</h3>\n </div>\n\n <p v-if=\"hasDescription\" class=\"tw-mb-0\">\n <slot v-if=\"slots.default\"></slot>\n <span v-else v-html=\"props.description\"></span>\n </p>\n </div>\n\n <footer :class=\"classes.footer\">\n <div class=\"tw-text-right\">\n <div :class=\"{ 'button-grid': !props.alert }\">\n <Button v-if=\"!props.alert\" data-test=\"button|cancel\" secondary @click=\"cancel\">\n {{ props.cancelText }}\n </Button>\n\n <Button\n data-test=\"button|confirm\"\n :disabled=\"props.disabled || isConfirming\"\n :color=\"computedDangerZone ? 'red' : 'blue'\"\n :class=\"{\n 'tw-w-full': props.alert,\n }\"\n @click=\"handleConfirm\"\n >\n {{ modifiedConfirmText }}\n </Button>\n </div>\n </div>\n </footer>\n </div>\n </dialog>\n </transition>\n</template>\n\n<style lang=\"scss\" module>\n .dialog {\n background: rgb(0 0 0 / 30%);\n bottom: 0;\n display: flex;\n flex-direction: column;\n left: 0;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n place-content: center;\n position: fixed;\n right: 0;\n top: 0;\n z-index: z-index('dialog');\n width: 100%;\n height: 100vh;\n }\n\n .body {\n @include elevation('low');\n\n background: var(--color-white);\n border-radius: $border-radius;\n color: var(--color-ice-700);\n display: flex;\n flex-direction: column;\n margin: 0 auto;\n max-height: 100vh;\n max-width: 360px;\n transition: transform $primary-transition;\n width: 100%;\n\n &.grey {\n background: var(--color-ice-200);\n border-radius: $border-radius;\n }\n }\n\n .content {\n flex-grow: 1;\n padding: space(3) var(--grid-gutter);\n }\n\n .footer {\n background: var(--color-ice-200);\n border-top: border('thin', var(--color-ice-500));\n display: initial; // TEMP. Will need to fix marketplace `footer` style\n padding: space(3) var(--grid-gutter);\n\n @include breakpoint('md') {\n border-bottom-left-radius: $border-radius;\n border-bottom-right-radius: $border-radius;\n }\n }\n\n :global(.fade-enter-from),\n :global(.fade-leave-active) {\n .body {\n transform: translate3d(0, #{space(2)}, 0);\n }\n }\n</style>\n"],"names":["slots","useSlots","attrs","useAttrs","classes","useCssModule","headerId","uniqueId","isConfirming","ref","root","modifiedConfirmText","computed","props","t","hasDescription","statusIcon","StatusIcons","capitalize","statusColor","StatusColors","computedDangerZone","StatusSeverities","cancel","emits","handleConfirm","event","onConfirm","watchEffect","nextTick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4FQA,IAAQC,KACRC,IAAQC,KACRC,IAAUC,KACVC,IAAWC,EAAS,gBAAgB,GAEpCC,IAAeC,EAAI,EAAK,GACxBC,IAAOD,KAQPE,IAAsBC,EAAS,MAAMC,EAAM,gBAAgBA,EAAM,QAAQC,EAAE,SAAS,IAAIA,EAAE,YAAY,EAAE,GAExGC,IAAiBH,EAAS,MAAM,CAAC,CAACZ,EAAM,WAAWa,EAAM,WAAW,GAEpEG,IAAaJ;AAAA,MAAqB,MACtCC,EAAM,SAASI,EAAYC,EAAWL,EAAM,MAAM,CAAC,IAAII,EAAY;AAAA,IAAA,GAE/DE,IAAcP;AAAA,MAAsB,MACxCC,EAAM,SAASO,EAAaF,EAAWL,EAAM,MAAM,CAAC,IAAIO,EAAa;AAAA,IAAA,GAGjEC,IAAqBT,EAAS,MAAMC,EAAM,cAAcA,EAAM,WAAWS,EAAiB,KAAK;AAErG,aAASC,IAAS;AAChB,MAAAC,EAAM,eAAe,EAAK,GAC1BA,EAAM,QAAQ;AAAA,IAChB;AAEA,mBAAeC,EAAcC,GAAc;AACzC,MAAAlB,EAAa,QAAQ;AAIrB,YAAMmB,IAAYzB,EAAM;AAIxB,YAAMyB,EAAUD,CAAK,GACrBlB,EAAa,QAAQ;AAAA,IACvB;AAEA,WAAAoB,EAAY,MAAM;AAChB,MAAIf,EAAM,QAERgB,EAAS,WAAY;AACnB,QAAAnB,EAAK,MAAM;MAAM,CAClB;AAAA,IACH,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/Dropdown.js
CHANGED
|
@@ -14,7 +14,7 @@ import "./index-79ce320f.js";
|
|
|
14
14
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
15
15
|
const Z = ["aria-expanded"], ee = {
|
|
16
16
|
key: 0,
|
|
17
|
-
class: "tw-
|
|
17
|
+
class: "tw-flex tw-items-center tw-font-medium tw-text-blue-500 hover:tw-text-blue-700"
|
|
18
18
|
}, te = /* @__PURE__ */ R({
|
|
19
19
|
name: "ll-dropdown",
|
|
20
20
|
__name: "Dropdown",
|
|
@@ -99,7 +99,7 @@ const Z = ["aria-expanded"], ee = {
|
|
|
99
99
|
}), (e, l) => _((v(), k("div", {
|
|
100
100
|
ref_key: "dropdownRef",
|
|
101
101
|
ref: w,
|
|
102
|
-
class: "tw-inline-block
|
|
102
|
+
class: "tw-relative tw-inline-block",
|
|
103
103
|
"data-test": "ll-dropdown",
|
|
104
104
|
onKeydown: T
|
|
105
105
|
}, [
|
|
@@ -110,7 +110,7 @@ const Z = ["aria-expanded"], ee = {
|
|
|
110
110
|
E("button", {
|
|
111
111
|
"data-test": "button|toggle",
|
|
112
112
|
"aria-expanded": o.value,
|
|
113
|
-
class: b([e.label ? "button--tertiary tw-
|
|
113
|
+
class: b([e.label ? "button--tertiary tw-min-w-auto tw-outline-none" : "button--icon button tw-rounded"]),
|
|
114
114
|
onClick: m
|
|
115
115
|
}, [
|
|
116
116
|
e.label ? (v(), k("span", ee, [
|
package/dist/Dropdown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sources":["../src/components/Dropdown/Dropdown.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, nextTick, onBeforeUnmount, onMounted, ref, useCssModule, watch } from 'vue';\n\n import { KEY_CODES } from '../../constants';\n import vClickoutside from '../../directives/clickoutside/clickoutside';\n import calculateElementOverflow from '../../utils/calculateElementOverflow';\n import { getMountPoint } from '../../utils/helpers';\n import Icon from '../Icon/Icon.vue';\n\n export type DropdownOffset = {\n x?: number;\n y?: number;\n };\n\n export interface DropdownProps {\n /**\n * Used to position the dropdown relative to target\n * Options: left, right\n */\n align?: 'left' | 'right';\n /**\n * When passed, text with caret is displayed instead of default kebab menu.\n */\n label?: string;\n /**\n * If true, dropdown will remain open when clicking on its content. Otherwise, it'll close automatically on click.\n */\n closeManually?: boolean;\n /**\n * Used to horizontally and vertically offset the dropdown in pixels\n * Keep in mind, `x` value is relative to `align` value.\n */\n offset?: DropdownOffset;\n /**\n * If `reattach` is true, the contents will be mounted in the mount point container,\n * so as to circumvent clipping issues from a parent's overflow property.\n */\n reattach?: boolean;\n /**\n * Custom class to apply to the default dropdown content element\n */\n contentClass?: string | string[];\n /**\n * Removes content container's max width\n */\n fluidContent?: boolean;\n }\n\n type DropdownStyles = {\n left?: string;\n right?: string;\n top?: string;\n };\n\n defineOptions({\n name: 'll-dropdown',\n });\n\n const props = withDefaults(defineProps<DropdownProps>(), {\n align: 'right',\n label: '',\n closeManually: false,\n offset: () => ({}),\n reattach: true,\n contentClass: '',\n fluidContent: false,\n });\n\n const emit =\n defineEmits<{\n toggle: [isActive: boolean];\n dismiss: [];\n }>();\n\n const contentRef = ref<HTMLElement | null>(null);\n const dropdownRef = ref<HTMLDivElement | null>(null);\n\n const DEFAULT_ITEMS_LIST = [] as unknown as NodeListOf<Element>;\n\n const items = ref<NodeListOf<Element>>(DEFAULT_ITEMS_LIST);\n const itemIndex = ref(-1);\n const isActive = ref(false);\n\n const styles = ref<DropdownStyles>({});\n const classes = useCssModule();\n\n watch(isActive, (val) => {\n if (!val) {\n itemIndex.value = -1;\n }\n\n emit('toggle', val);\n });\n\n watch(itemIndex, (next, prev) => {\n next in items.value && items.value[next].classList.add('is-highlighted');\n prev in items.value && items.value[prev].classList.remove('is-highlighted');\n });\n\n onMounted(() => {\n if (props.reattach) {\n const target = getMountPoint();\n\n contentRef.value && target.appendChild(contentRef.value);\n }\n\n // if stash-menu exists, use it's items\n if (contentRef.value?.querySelector('.stash-menu')) {\n items.value = contentRef.value?.querySelectorAll('.stash-menu-item') ?? DEFAULT_ITEMS_LIST;\n } else {\n items.value = contentRef.value?.querySelectorAll('.dropdown__item') ?? DEFAULT_ITEMS_LIST;\n }\n\n // avoid calling dismiss with ResizeEvent because it's target is the Window element and it's not a valid Node element to be passed to dismiss\n window.addEventListener('resize', () => dismiss());\n });\n\n onBeforeUnmount(() => {\n window.removeEventListener('resize', () => dismiss());\n contentRef.value?.parentNode?.removeChild(contentRef.value);\n });\n\n /**\n * Dismisses the Dropdown.\n */\n function dismiss(event?: Event) {\n if (\n props.closeManually &&\n (contentRef.value?.contains(event?.target as HTMLElement) || contentRef.value === event?.target)\n ) {\n return;\n }\n\n const wasOpen = isActive.value;\n\n isActive.value = false;\n\n if (wasOpen) {\n emit('dismiss');\n }\n }\n\n /**\n * Opens or closes the Dropdown. If opening, positions and focuses its content.\n */\n async function toggle() {\n if (isActive.value) {\n isActive.value = false;\n } else {\n isActive.value = true;\n await calculateOffset();\n contentRef.value?.focus();\n }\n }\n\n /**\n * Handles all user keyboard input on the Dropdown.\n * @param {KeyboardEvent} e The native keydown event.\n */\n function onKeyDown(e: KeyboardEvent) {\n if (e.keyCode === KEY_CODES.ESCAPE) {\n dismiss();\n } else if (e.keyCode === KEY_CODES.DOWN && itemIndex.value < items.value.length - 1) {\n isActive.value && itemIndex.value++;\n } else if (e.keyCode === KEY_CODES.UP && itemIndex.value > -1) {\n isActive.value && itemIndex.value--;\n } else if (e.keyCode === KEY_CODES.ENTER && itemIndex.value !== -1) {\n isActive.value && items[itemIndex.value].click();\n } else {\n return;\n }\n\n e.preventDefault(); // if keyDown did something / we didn't return\n }\n\n /**\n * Reset any page overflow offset\n */\n function resetOffset() {\n contentRef.value?.style.setProperty('--offset', '0');\n }\n\n /**\n * Calculate the position for the Dropdown content element,\n * relative to the viewport.\n * Repositions the dropdown content element (& arrow)\n * if it overflows the page (including gutter).\n */\n async function calculateOffset() {\n await nextTick();\n\n const toggleBCR = dropdownRef.value?.getBoundingClientRect() || ({} as DOMRect);\n const top = toggleBCR.top + toggleBCR.height;\n const offset = {\n x: 0,\n y: 0,\n ...props.offset,\n };\n\n if (props.reattach) {\n styles.value = {\n left: props.align === 'left' ? `${Math.round(toggleBCR.left) + offset.x}px` : undefined,\n right:\n props.align === 'right'\n ? `${document.documentElement.clientWidth - Math.round(toggleBCR.right) + offset.x}px`\n : undefined,\n top: `${window.scrollY + top + offset.y}px`,\n };\n await nextTick(); // wait for style updates to sync in the DOM\n }\n\n const overflow = calculateElementOverflow(contentRef?.value);\n\n if (overflow) {\n const direction = props.align === 'left' ? '-' : '';\n contentRef.value?.style.setProperty('--offset', `${direction}${overflow.value}`);\n }\n }\n\n defineExpose({\n isActive: computed(() => isActive.value),\n toggle,\n dismiss,\n });\n</script>\n\n<template>\n <div\n ref=\"dropdownRef\"\n v-clickoutside=\"dismiss\"\n class=\"tw-inline-block tw-relative\"\n data-test=\"ll-dropdown\"\n @keydown=\"onKeyDown\"\n >\n <!-- @slot Toggle component slot, receives `toggle` method to trigger Dropdown display -->\n <slot name=\"toggle\" :is-active=\"isActive\" :toggle=\"toggle\">\n <button\n data-test=\"button|toggle\"\n :aria-expanded=\"isActive\"\n :class=\"[label ? 'button--tertiary tw-outline-none tw-min-w-auto' : 'button--icon button tw-rounded']\"\n @click=\"toggle\"\n >\n <span v-if=\"label\" class=\"tw-font-medium tw-flex tw-items-center tw-text-blue-500 hover:tw-text-blue-700\">\n {{ label }}\n <Icon name=\"caret-down\" />\n </span>\n <Icon v-else name=\"ellipsis\" />\n </button>\n </slot>\n\n <transition name=\"fade\" @after-leave=\"resetOffset\">\n <div\n v-show=\"isActive\"\n ref=\"contentRef\"\n data-test=\"ll-dropdown-content\"\n :class=\"[\n classes.content,\n contentClass,\n {\n 'tw-left-0 after:tw-left-6': props.align === 'left',\n 'tw-right-0': props.align === 'right',\n 'tw-max-w-[360px]': !props.fluidContent,\n },\n ]\"\n :style=\"styles\"\n >\n <!-- @slot Dropdown content slot. Receives `dismiss` method, to trigger manual close. You must call dismiss with parentheses. Receives `is-active` prop. -->\n <slot :dismiss=\"dismiss\" :is-active=\"isActive\"></slot>\n </div>\n </transition>\n </div>\n</template>\n\n<style module>\n .content {\n --offset: 0;\n\n @apply tw-shadow\n tw-bg-white\n tw-border\n tw-border-solid\n tw-border-blue-500\n tw-rounded\n tw-absolute\n tw-z-control\n tw-min-w-[200px];\n\n transform: translateX(calc(var(--offset) * 1px));\n }\n\n /**\n * TODO: these global styles should be componentized in https://leaflink.atlassian.net/browse/STASH-566\n */\n :global(.dropdown__list) {\n @apply tw-bg-white tw-list-none tw-m-1.5 tw-p-0;\n }\n\n :global(.dropdown__item) {\n @apply tw-block tw-mx-0 tw-mt-0 tw-mb-1.5 tw-w-full first:tw-mt-0 last:tw-mb-0;\n }\n\n :global(.dropdown__item) button {\n @apply tw-border-none tw-text-left tw-p-1.5;\n }\n\n :global(.dropdown__item) :where(a, button) {\n @apply tw-rounded\n tw-text-ice-700\n tw-block\n tw-py-[10px]\n tw-px-1.5\n tw-w-full\n disabled:tw-text-ice-500\n disabled:tw-cursor-default\n hover:tw-bg-ice-200\n hover:tw-text-ice-700\n hover:tw-no-underline\n tw-transition-all\n tw-duration-fast\n tw-ease-swing;\n }\n</style>\n"],"names":["contentRef","ref","dropdownRef","DEFAULT_ITEMS_LIST","items","itemIndex","isActive","styles","classes","useCssModule","watch","val","emit","next","prev","onMounted","props","target","getMountPoint","_a","_b","_c","dismiss","onBeforeUnmount","event","wasOpen","toggle","calculateOffset","onKeyDown","KEY_CODES","resetOffset","nextTick","toggleBCR","top","offset","overflow","calculateElementOverflow","direction","__expose","computed"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sources":["../src/components/Dropdown/Dropdown.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, nextTick, onBeforeUnmount, onMounted, ref, useCssModule, watch } from 'vue';\n\n import { KEY_CODES } from '../../constants';\n import vClickoutside from '../../directives/clickoutside/clickoutside';\n import calculateElementOverflow from '../../utils/calculateElementOverflow';\n import { getMountPoint } from '../../utils/helpers';\n import Icon from '../Icon/Icon.vue';\n\n export type DropdownOffset = {\n x?: number;\n y?: number;\n };\n\n export interface DropdownProps {\n /**\n * Used to position the dropdown relative to target\n * Options: left, right\n */\n align?: 'left' | 'right';\n /**\n * When passed, text with caret is displayed instead of default kebab menu.\n */\n label?: string;\n /**\n * If true, dropdown will remain open when clicking on its content. Otherwise, it'll close automatically on click.\n */\n closeManually?: boolean;\n /**\n * Used to horizontally and vertically offset the dropdown in pixels\n * Keep in mind, `x` value is relative to `align` value.\n */\n offset?: DropdownOffset;\n /**\n * If `reattach` is true, the contents will be mounted in the mount point container,\n * so as to circumvent clipping issues from a parent's overflow property.\n */\n reattach?: boolean;\n /**\n * Custom class to apply to the default dropdown content element\n */\n contentClass?: string | string[];\n /**\n * Removes content container's max width\n */\n fluidContent?: boolean;\n }\n\n type DropdownStyles = {\n left?: string;\n right?: string;\n top?: string;\n };\n\n defineOptions({\n name: 'll-dropdown',\n });\n\n const props = withDefaults(defineProps<DropdownProps>(), {\n align: 'right',\n label: '',\n closeManually: false,\n offset: () => ({}),\n reattach: true,\n contentClass: '',\n fluidContent: false,\n });\n\n const emit =\n defineEmits<{\n toggle: [isActive: boolean];\n dismiss: [];\n }>();\n\n const contentRef = ref<HTMLElement | null>(null);\n const dropdownRef = ref<HTMLDivElement | null>(null);\n\n const DEFAULT_ITEMS_LIST = [] as unknown as NodeListOf<Element>;\n\n const items = ref<NodeListOf<Element>>(DEFAULT_ITEMS_LIST);\n const itemIndex = ref(-1);\n const isActive = ref(false);\n\n const styles = ref<DropdownStyles>({});\n const classes = useCssModule();\n\n watch(isActive, (val) => {\n if (!val) {\n itemIndex.value = -1;\n }\n\n emit('toggle', val);\n });\n\n watch(itemIndex, (next, prev) => {\n next in items.value && items.value[next].classList.add('is-highlighted');\n prev in items.value && items.value[prev].classList.remove('is-highlighted');\n });\n\n onMounted(() => {\n if (props.reattach) {\n const target = getMountPoint();\n\n contentRef.value && target.appendChild(contentRef.value);\n }\n\n // if stash-menu exists, use it's items\n if (contentRef.value?.querySelector('.stash-menu')) {\n items.value = contentRef.value?.querySelectorAll('.stash-menu-item') ?? DEFAULT_ITEMS_LIST;\n } else {\n items.value = contentRef.value?.querySelectorAll('.dropdown__item') ?? DEFAULT_ITEMS_LIST;\n }\n\n // avoid calling dismiss with ResizeEvent because it's target is the Window element and it's not a valid Node element to be passed to dismiss\n window.addEventListener('resize', () => dismiss());\n });\n\n onBeforeUnmount(() => {\n window.removeEventListener('resize', () => dismiss());\n contentRef.value?.parentNode?.removeChild(contentRef.value);\n });\n\n /**\n * Dismisses the Dropdown.\n */\n function dismiss(event?: Event) {\n if (\n props.closeManually &&\n (contentRef.value?.contains(event?.target as HTMLElement) || contentRef.value === event?.target)\n ) {\n return;\n }\n\n const wasOpen = isActive.value;\n\n isActive.value = false;\n\n if (wasOpen) {\n emit('dismiss');\n }\n }\n\n /**\n * Opens or closes the Dropdown. If opening, positions and focuses its content.\n */\n async function toggle() {\n if (isActive.value) {\n isActive.value = false;\n } else {\n isActive.value = true;\n await calculateOffset();\n contentRef.value?.focus();\n }\n }\n\n /**\n * Handles all user keyboard input on the Dropdown.\n * @param {KeyboardEvent} e The native keydown event.\n */\n function onKeyDown(e: KeyboardEvent) {\n if (e.keyCode === KEY_CODES.ESCAPE) {\n dismiss();\n } else if (e.keyCode === KEY_CODES.DOWN && itemIndex.value < items.value.length - 1) {\n isActive.value && itemIndex.value++;\n } else if (e.keyCode === KEY_CODES.UP && itemIndex.value > -1) {\n isActive.value && itemIndex.value--;\n } else if (e.keyCode === KEY_CODES.ENTER && itemIndex.value !== -1) {\n isActive.value && items[itemIndex.value].click();\n } else {\n return;\n }\n\n e.preventDefault(); // if keyDown did something / we didn't return\n }\n\n /**\n * Reset any page overflow offset\n */\n function resetOffset() {\n contentRef.value?.style.setProperty('--offset', '0');\n }\n\n /**\n * Calculate the position for the Dropdown content element,\n * relative to the viewport.\n * Repositions the dropdown content element (& arrow)\n * if it overflows the page (including gutter).\n */\n async function calculateOffset() {\n await nextTick();\n\n const toggleBCR = dropdownRef.value?.getBoundingClientRect() || ({} as DOMRect);\n const top = toggleBCR.top + toggleBCR.height;\n const offset = {\n x: 0,\n y: 0,\n ...props.offset,\n };\n\n if (props.reattach) {\n styles.value = {\n left: props.align === 'left' ? `${Math.round(toggleBCR.left) + offset.x}px` : undefined,\n right:\n props.align === 'right'\n ? `${document.documentElement.clientWidth - Math.round(toggleBCR.right) + offset.x}px`\n : undefined,\n top: `${window.scrollY + top + offset.y}px`,\n };\n await nextTick(); // wait for style updates to sync in the DOM\n }\n\n const overflow = calculateElementOverflow(contentRef?.value);\n\n if (overflow) {\n const direction = props.align === 'left' ? '-' : '';\n contentRef.value?.style.setProperty('--offset', `${direction}${overflow.value}`);\n }\n }\n\n defineExpose({\n isActive: computed(() => isActive.value),\n toggle,\n dismiss,\n });\n</script>\n\n<template>\n <div\n ref=\"dropdownRef\"\n v-clickoutside=\"dismiss\"\n class=\"tw-relative tw-inline-block\"\n data-test=\"ll-dropdown\"\n @keydown=\"onKeyDown\"\n >\n <!-- @slot Toggle component slot, receives `toggle` method to trigger Dropdown display -->\n <slot name=\"toggle\" :is-active=\"isActive\" :toggle=\"toggle\">\n <button\n data-test=\"button|toggle\"\n :aria-expanded=\"isActive\"\n :class=\"[label ? 'button--tertiary tw-min-w-auto tw-outline-none' : 'button--icon button tw-rounded']\"\n @click=\"toggle\"\n >\n <span v-if=\"label\" class=\"tw-flex tw-items-center tw-font-medium tw-text-blue-500 hover:tw-text-blue-700\">\n {{ label }}\n <Icon name=\"caret-down\" />\n </span>\n <Icon v-else name=\"ellipsis\" />\n </button>\n </slot>\n\n <transition name=\"fade\" @after-leave=\"resetOffset\">\n <div\n v-show=\"isActive\"\n ref=\"contentRef\"\n data-test=\"ll-dropdown-content\"\n :class=\"[\n classes.content,\n contentClass,\n {\n 'tw-left-0 after:tw-left-6': props.align === 'left',\n 'tw-right-0': props.align === 'right',\n 'tw-max-w-[360px]': !props.fluidContent,\n },\n ]\"\n :style=\"styles\"\n >\n <!-- @slot Dropdown content slot. Receives `dismiss` method, to trigger manual close. You must call dismiss with parentheses. Receives `is-active` prop. -->\n <slot :dismiss=\"dismiss\" :is-active=\"isActive\"></slot>\n </div>\n </transition>\n </div>\n</template>\n\n<style module>\n .content {\n --offset: 0;\n\n @apply tw-shadow\n tw-bg-white\n tw-border\n tw-border-solid\n tw-border-blue-500\n tw-rounded\n tw-absolute\n tw-z-control\n tw-min-w-[200px];\n\n transform: translateX(calc(var(--offset) * 1px));\n }\n\n /**\n * TODO: these global styles should be componentized in https://leaflink.atlassian.net/browse/STASH-566\n */\n :global(.dropdown__list) {\n @apply tw-bg-white tw-list-none tw-m-1.5 tw-p-0;\n }\n\n :global(.dropdown__item) {\n @apply tw-block tw-mx-0 tw-mt-0 tw-mb-1.5 tw-w-full first:tw-mt-0 last:tw-mb-0;\n }\n\n :global(.dropdown__item) button {\n @apply tw-border-none tw-text-left tw-p-1.5;\n }\n\n :global(.dropdown__item) :where(a, button) {\n @apply tw-rounded\n tw-text-ice-700\n tw-block\n tw-py-[10px]\n tw-px-1.5\n tw-w-full\n disabled:tw-text-ice-500\n disabled:tw-cursor-default\n hover:tw-bg-ice-200\n hover:tw-text-ice-700\n hover:tw-no-underline\n tw-transition-all\n tw-duration-fast\n tw-ease-swing;\n }\n</style>\n"],"names":["contentRef","ref","dropdownRef","DEFAULT_ITEMS_LIST","items","itemIndex","isActive","styles","classes","useCssModule","watch","val","emit","next","prev","onMounted","props","target","getMountPoint","_a","_b","_c","dismiss","onBeforeUnmount","event","wasOpen","toggle","calculateOffset","onKeyDown","KEY_CODES","resetOffset","nextTick","toggleBCR","top","offset","overflow","calculateElementOverflow","direction","__expose","computed"],"mappings":"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"}
|
package/dist/EmptyState.js
CHANGED
|
@@ -17,7 +17,7 @@ const x = ["alt", "src"], S = /* @__PURE__ */ n({
|
|
|
17
17
|
const t = r, s = i(), l = p();
|
|
18
18
|
return (c, k) => (a(), o("div", {
|
|
19
19
|
key: "empty",
|
|
20
|
-
class: m(["stash-empty-state tw-
|
|
20
|
+
class: m(["stash-empty-state tw-mx-auto tw-my-0 tw-flex tw-items-center tw-justify-center tw-py-12", [e(s).root, { "tw-text-center": !t.image.src && !e(l).image }]]),
|
|
21
21
|
"data-test": "stash-empty-state"
|
|
22
22
|
}, [
|
|
23
23
|
u(c.$slots, "image", {}, () => [
|
package/dist/EmptyState.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.js","sources":["../src/components/EmptyState/EmptyState.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { useCssModule, useSlots } from 'vue';\n\n import { t } from '../../locale';\n\n export interface EmptyStateProps {\n /**\n * Controls wether the sidebar is opened or not\n */\n image?: {\n alt?: string;\n src: string;\n };\n text?: string;\n }\n\n defineOptions({\n name: 'll-empty-state',\n });\n\n const props = withDefaults(defineProps<EmptyStateProps>(), {\n /**\n * An optional image to render\n */\n image: () => ({\n alt: '',\n src: '',\n }),\n\n /**\n * The custom message to render\n */\n text: '',\n });\n\n const classes = useCssModule();\n const slots = useSlots();\n</script>\n\n<template>\n <div\n key=\"empty\"\n class=\"stash-empty-state tw-
|
|
1
|
+
{"version":3,"file":"EmptyState.js","sources":["../src/components/EmptyState/EmptyState.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { useCssModule, useSlots } from 'vue';\n\n import { t } from '../../locale';\n\n export interface EmptyStateProps {\n /**\n * Controls wether the sidebar is opened or not\n */\n image?: {\n alt?: string;\n src: string;\n };\n text?: string;\n }\n\n defineOptions({\n name: 'll-empty-state',\n });\n\n const props = withDefaults(defineProps<EmptyStateProps>(), {\n /**\n * An optional image to render\n */\n image: () => ({\n alt: '',\n src: '',\n }),\n\n /**\n * The custom message to render\n */\n text: '',\n });\n\n const classes = useCssModule();\n const slots = useSlots();\n</script>\n\n<template>\n <div\n key=\"empty\"\n class=\"stash-empty-state tw-mx-auto tw-my-0 tw-flex tw-items-center tw-justify-center tw-py-12\"\n data-test=\"stash-empty-state\"\n :class=\"[classes.root, { 'tw-text-center': !props.image.src && !slots.image }]\"\n >\n <slot name=\"image\">\n <img\n v-if=\"props.image.src\"\n class=\"tw-mr-6\"\n :alt=\"props.image.alt\"\n :class=\"classes.image\"\n :src=\"props.image.src\"\n data-test=\"stash-empty-state__img\"\n />\n </slot>\n\n {{ props.text || t('ll.emptyState.noResults') }}\n </div>\n</template>\n\n<style module>\n .root {\n max-width: 600px;\n }\n\n .image {\n max-width: 60px;\n }\n</style>\n"],"names":["classes","useCssModule","slots","useSlots"],"mappings":";;;;;;;;;;;;;;;;iBAmCQA,IAAUC,KACVC,IAAQC;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/Field.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as o } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _ as o } from "./Field.vue_vue_type_script_setup_true_lang-42cf79d4.js";
|
|
2
2
|
import "vue";
|
|
3
3
|
import "lodash-es/uniqueId";
|
|
4
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import "./Label.vue_vue_type_script_setup_true_lang-c5589919.js";
|
|
5
5
|
import "./locale.js";
|
|
6
6
|
import "lodash-es/get";
|
|
7
7
|
export {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as x, useAttrs as k, useSlots as T, computed as a, openBlock as l, createBlock as m, resolveDynamicComponent as B, mergeProps as O, unref as f, withCtx as v, normalizeClass as R, createTextVNode as q, toDisplayString as p, createCommentVNode as s, createElementBlock as o, renderSlot as c } from "vue";
|
|
2
2
|
import h from "lodash-es/uniqueId";
|
|
3
|
-
import { _ as E } from "./Label.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import { _ as E } from "./Label.vue_vue_type_script_setup_true_lang-c5589919.js";
|
|
4
4
|
const L = ["aria-labelledby"], S = ["id"], C = {
|
|
5
5
|
key: 4,
|
|
6
|
-
class: "tw-
|
|
6
|
+
class: "tw-mt-1 tw-block tw-whitespace-pre-line tw-text-xs",
|
|
7
7
|
"data-test": "field-hint"
|
|
8
8
|
}, g = { key: 0 }, A = {
|
|
9
9
|
key: 5,
|
|
10
|
-
class: "tw-
|
|
10
|
+
class: "tw-mt-1 tw-whitespace-pre-line tw-text-xs",
|
|
11
11
|
"data-test": "field-hint"
|
|
12
12
|
}, $ = {
|
|
13
13
|
inheritAttrs: !1
|
|
@@ -78,7 +78,7 @@ const L = ["aria-labelledby"], S = ["id"], C = {
|
|
|
78
78
|
e.errorText ? (l(), o("span", {
|
|
79
79
|
key: 3,
|
|
80
80
|
id: n.value,
|
|
81
|
-
class: "tw-
|
|
81
|
+
class: "tw-mt-1 tw-block tw-whitespace-pre-line tw-text-xs tw-text-red-500",
|
|
82
82
|
"data-test": "field-error"
|
|
83
83
|
}, p(e.errorText), 9, S)) : e.hintText ? (l(), o("span", C, [
|
|
84
84
|
e.isReadOnly ? s("", !0) : (l(), o("span", g, p(e.hintText), 1))
|
|
@@ -93,4 +93,4 @@ const L = ["aria-labelledby"], S = ["id"], C = {
|
|
|
93
93
|
export {
|
|
94
94
|
z as _
|
|
95
95
|
};
|
|
96
|
-
//# sourceMappingURL=Field.vue_vue_type_script_setup_true_lang-
|
|
96
|
+
//# sourceMappingURL=Field.vue_vue_type_script_setup_true_lang-42cf79d4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
{"version":3,"file":"Field.vue_vue_type_script_setup_true_lang-42cf79d4.js","sources":["../src/components/Field/Field.vue"],"sourcesContent":["<script lang=\"ts\">\n export default {\n inheritAttrs: false,\n };\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, useAttrs, useSlots } from 'vue';\n\n import Label from '../Label/Label.vue';\n\n export interface FieldProps {\n /**\n * Adds spacing under the field that is consistent whether or not hint/error text is displayed.\n */\n addBottomSpace?: boolean;\n\n /**\n * Error text to display. Replaces `hintText` (if provided) & adds error styling.\n */\n errorText?: string;\n\n /**\n * Displays text below the input; hidden when the isReadOnly prop is truthy.\n */\n hintText?: string;\n\n /**\n * ID for the Label and Input; must be unique\n */\n id?: string;\n\n /**\n * ID for the error text element; useful for aria-errormessage\n */\n errorId?: string;\n\n /**\n * Whether it's a readonly field.\n */\n isReadOnly?: boolean;\n\n /**\n * Whether the field is required.\n */\n isRequired?: boolean;\n\n /**\n * Label to render above the input.\n */\n label?: string;\n\n /**\n * Show \"(optional)\" to the right of the label text\n */\n showOptionalInLabel?: boolean;\n\n /**\n * Indicates wheter the field is a fieldset or not\n */\n fieldset?: boolean;\n }\n\n const props = withDefaults(defineProps<FieldProps>(), {\n addBottomSpace: false,\n errorText: undefined,\n hintText: undefined,\n id: undefined,\n errorId: undefined,\n isRequired: false,\n label: undefined,\n showOptionalInLabel: false,\n fieldset: false,\n });\n const attrs = useAttrs();\n const slots = useSlots();\n const fieldId = computed(() => props.id || uniqueId('field-'));\n const fieldErrorId = computed(() => props.errorId || uniqueId('field-error-'));\n const labelId = computed(() => uniqueId('field-label-'));\n const hasError = computed(() => !!props.errorText);\n const wrapperElement = computed(() => (props.fieldset ? 'fieldset' : 'div'));\n\n // Any attributes that are unique to form elements, you want to exclude from\n // being bound from the root element.\n const rootAttrs = computed(() => {\n const { placeholder, ...otherAttrs } = attrs;\n\n return otherAttrs;\n });\n</script>\n\n<template>\n <component\n v-bind=\"rootAttrs\"\n :is=\"wrapperElement\"\n :class=\"[\n { 'tw-p-0': props.fieldset },\n { 'tw-mb-9': props.addBottomSpace && !props.errorText && !props.hintText && !slots.hint },\n { 'tw-mb-4': props.addBottomSpace && (props.errorText || props.hintText || slots.hint) },\n ]\"\n >\n <Label\n v-if=\"props.label\"\n :id=\"labelId\"\n :class=\"{ 'tw-mb-1.5': !!props.isReadOnly }\"\n :for=\"fieldId\"\n :has-error=\"hasError\"\n :is-required=\"isRequired\"\n :show-optional=\"props.showOptionalInLabel\"\n :legend=\"props.fieldset\"\n >\n {{ props.label }}\n </Label>\n\n <!-- @slot for the form field; the Label can also be rendered here instead of using the label prop -->\n <template v-if=\"props.isReadOnly\">\n <div :aria-labelledby=\"labelId\">\n <slot\n :field-id=\"fieldId\"\n :field-error-id=\"fieldErrorId\"\n :has-error=\"hasError\"\n :is-required=\"isRequired\"\n :label-id=\"labelId\"\n :show-optional-in-label=\"props.showOptionalInLabel\"\n ></slot>\n </div>\n </template>\n <template v-else>\n <slot\n :field-id=\"fieldId\"\n :field-error-id=\"fieldErrorId\"\n :has-error=\"hasError\"\n :is-required=\"isRequired\"\n :label-id=\"labelId\"\n :show-optional-in-label=\"props.showOptionalInLabel\"\n ></slot>\n </template>\n\n <span\n v-if=\"props.errorText\"\n :id=\"fieldErrorId\"\n class=\"tw-mt-1 tw-block tw-whitespace-pre-line tw-text-xs tw-text-red-500\"\n data-test=\"field-error\"\n >\n {{ props.errorText }}\n </span>\n\n <span v-else-if=\"props.hintText\" class=\"tw-mt-1 tw-block tw-whitespace-pre-line tw-text-xs\" data-test=\"field-hint\">\n <span v-if=\"!props.isReadOnly\">{{ props.hintText }}</span>\n </span>\n\n <div v-else-if=\"slots.hint\" class=\"tw-mt-1 tw-whitespace-pre-line tw-text-xs\" data-test=\"field-hint\">\n <!-- @slot for displaying hint text below the field -->\n <slot v-if=\"!props.isReadOnly\" name=\"hint\"></slot>\n </div>\n </component>\n</template>\n"],"names":["attrs","useAttrs","slots","useSlots","fieldId","computed","props","uniqueId","fieldErrorId","labelId","hasError","wrapperElement","rootAttrs","placeholder","otherAttrs"],"mappings":";;;;;;;;;;;OACiB;AAAA,EACb,cAAc;AAChB;;;;;;;;;;;;;;;;iBAwEMA,IAAQC,KACRC,IAAQC,KACRC,IAAUC,EAAS,MAAMC,EAAM,MAAMC,EAAS,QAAQ,CAAC,GACvDC,IAAeH,EAAS,MAAMC,EAAM,WAAWC,EAAS,cAAc,CAAC,GACvEE,IAAUJ,EAAS,MAAME,EAAS,cAAc,CAAC,GACjDG,IAAWL,EAAS,MAAM,CAAC,CAACC,EAAM,SAAS,GAC3CK,IAAiBN,EAAS,MAAOC,EAAM,WAAW,aAAa,KAAM,GAIrEM,IAAYP,EAAS,MAAM;AAC/B,YAAM,EAAE,aAAAQ,GAAa,GAAGC,EAAA,IAAed;AAEhC,aAAAc;AAAA,IAAA,CACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/FileUpload.js
CHANGED
|
@@ -2,20 +2,20 @@ import { I as x } from "./index-79ce320f.js";
|
|
|
2
2
|
import { t as u } from "./locale.js";
|
|
3
3
|
import F from "./Button.js";
|
|
4
4
|
import O from "./Icon.js";
|
|
5
|
-
import { resolveComponent as g, openBlock as r, createElementBlock as o, normalizeClass as d, createVNode as h, withModifiers as c, withCtx as T, createTextVNode as y, toDisplayString as p, createElementVNode as f, Fragment as
|
|
5
|
+
import { resolveComponent as g, openBlock as r, createElementBlock as o, normalizeClass as d, createVNode as h, withModifiers as c, withCtx as T, createTextVNode as y, toDisplayString as p, createElementVNode as f, Fragment as v, createBlock as C, createCommentVNode as S, renderSlot as _, renderList as w, withDirectives as U, mergeProps as M, vShow as N } from "vue";
|
|
6
6
|
import { _ as P } from "./_plugin-vue_export-helper-dad06003.js";
|
|
7
7
|
import "lodash-es/get";
|
|
8
|
-
import "./Button.vue_used_vue_type_style_index_0_lang.module-
|
|
8
|
+
import "./Button.vue_used_vue_type_style_index_0_lang.module-b2ee90e6.js";
|
|
9
9
|
import "lodash-es/uniqueId";
|
|
10
10
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
11
|
-
const A = "
|
|
12
|
-
"file-dropbox": "_file-
|
|
13
|
-
"is-dragging": "_is-
|
|
14
|
-
"is-disabled": "_is-
|
|
15
|
-
"upload-icon": "_upload-
|
|
16
|
-
"remove-button": "_remove-
|
|
11
|
+
const A = "_button_oi2f6_201", L = {
|
|
12
|
+
"file-dropbox": "_file-dropbox_oi2f6_176",
|
|
13
|
+
"is-dragging": "_is-dragging_oi2f6_184",
|
|
14
|
+
"is-disabled": "_is-disabled_oi2f6_192",
|
|
15
|
+
"upload-icon": "_upload-icon_oi2f6_196",
|
|
16
|
+
"remove-button": "_remove-button_oi2f6_201",
|
|
17
17
|
button: A
|
|
18
|
-
},
|
|
18
|
+
}, E = Object.freeze({
|
|
19
19
|
CSV: {
|
|
20
20
|
ACCEPTS: ["text/csv"],
|
|
21
21
|
EXTENSION: ["csv"],
|
|
@@ -52,7 +52,7 @@ const A = "_button_fvrzb_201", L = {
|
|
|
52
52
|
MIME_TYPES: ["application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
|
|
53
53
|
ILLUSTRATION: "csv"
|
|
54
54
|
}
|
|
55
|
-
}),
|
|
55
|
+
}), b = Object.freeze({
|
|
56
56
|
Dense: "dense",
|
|
57
57
|
Standard: "standard"
|
|
58
58
|
}), k = {
|
|
@@ -74,7 +74,7 @@ const A = "_button_fvrzb_201", L = {
|
|
|
74
74
|
*/
|
|
75
75
|
fileTypes: {
|
|
76
76
|
type: Array,
|
|
77
|
-
default: () => Object.keys(
|
|
77
|
+
default: () => Object.keys(E)
|
|
78
78
|
},
|
|
79
79
|
/**
|
|
80
80
|
* Shows only an upload button
|
|
@@ -97,13 +97,13 @@ const A = "_button_fvrzb_201", L = {
|
|
|
97
97
|
size: {
|
|
98
98
|
type: String,
|
|
99
99
|
default: "standard",
|
|
100
|
-
validator: (e) => Object.values(
|
|
100
|
+
validator: (e) => Object.values(b).includes(e)
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
emits: ["file-select", "file-delete", "file-error"],
|
|
104
104
|
setup() {
|
|
105
105
|
return {
|
|
106
|
-
Sizes:
|
|
106
|
+
Sizes: b
|
|
107
107
|
};
|
|
108
108
|
},
|
|
109
109
|
data() {
|
|
@@ -133,11 +133,11 @@ const A = "_button_fvrzb_201", L = {
|
|
|
133
133
|
return this.fileTypes.map((e) => this.fileMeta[e].EXTENSION).reduce(this.flattenArray);
|
|
134
134
|
},
|
|
135
135
|
fileMeta() {
|
|
136
|
-
return
|
|
136
|
+
return E;
|
|
137
137
|
},
|
|
138
138
|
illustrationPath() {
|
|
139
139
|
var e;
|
|
140
|
-
return `${(e = this.stashOptions) == null ? void 0 : e.staticPath}/illustrations/FileUpload/${
|
|
140
|
+
return `${(e = this.stashOptions) == null ? void 0 : e.staticPath}/illustrations/FileUpload/${E[this.fileTypes[0]].ILLUSTRATION}.svg`;
|
|
141
141
|
}
|
|
142
142
|
},
|
|
143
143
|
methods: {
|
|
@@ -217,7 +217,7 @@ const A = "_button_fvrzb_201", L = {
|
|
|
217
217
|
}
|
|
218
218
|
}, z = ["data-test"], R = { key: 0 }, j = { class: "text-ice-900" }, X = {
|
|
219
219
|
key: 0,
|
|
220
|
-
class: "
|
|
220
|
+
class: "text-center text-small text-ice-700 tw-mt-6"
|
|
221
221
|
}, Y = ["accept", "multiple"];
|
|
222
222
|
function B(e, t, i, a, n, l) {
|
|
223
223
|
const m = g("ll-button"), D = g("InlineSvg"), I = g("ll-icon");
|
|
@@ -239,7 +239,7 @@ function B(e, t, i, a, n, l) {
|
|
|
239
239
|
}, 8, ["disabled", "onClick"])
|
|
240
240
|
])) : (r(), o("div", {
|
|
241
241
|
key: 1,
|
|
242
|
-
class: d(["tw-p-6
|
|
242
|
+
class: d(["rounded tw-p-6", [e.$style["file-dropbox"], n.isDraggingOver && e.$style["is-dragging"], i.disabled && e.$style["is-disabled"]]]),
|
|
243
243
|
onDragover: t[0] || (t[0] = c((...s) => l.handleDragEnter && l.handleDragEnter(...s), ["prevent"])),
|
|
244
244
|
onDrop: t[1] || (t[1] = c((...s) => l.handleDropFile && l.handleDropFile(...s), ["prevent"])),
|
|
245
245
|
onDragleave: t[2] || (t[2] = c((...s) => l.handleDragLeave && l.handleDragLeave(...s), ["prevent"]))
|
|
@@ -247,7 +247,7 @@ function B(e, t, i, a, n, l) {
|
|
|
247
247
|
f("div", {
|
|
248
248
|
class: d(["flex text-center flex-column align-center align-middle", [{ "items-center md:flex-row": i.size === a.Sizes.Dense }]])
|
|
249
249
|
}, [
|
|
250
|
-
i.files.length ? (r(!0), o(
|
|
250
|
+
i.files.length ? (r(!0), o(v, { key: 1 }, w(i.files, (s) => (r(), o("div", {
|
|
251
251
|
key: s.name
|
|
252
252
|
}, [
|
|
253
253
|
h(I, { name: "file" }),
|
|
@@ -261,14 +261,14 @@ function B(e, t, i, a, n, l) {
|
|
|
261
261
|
]),
|
|
262
262
|
_: 2
|
|
263
263
|
}, 1032, ["class", "onClick"])
|
|
264
|
-
]))), 128)) : (r(), o(
|
|
264
|
+
]))), 128)) : (r(), o(v, { key: 0 }, [
|
|
265
265
|
i.size !== a.Sizes.Dense ? (r(), C(D, {
|
|
266
266
|
key: 0,
|
|
267
267
|
src: l.illustrationPath,
|
|
268
268
|
name: "file",
|
|
269
269
|
width: "84",
|
|
270
270
|
height: "96"
|
|
271
|
-
}, null, 8, ["src"])) :
|
|
271
|
+
}, null, 8, ["src"])) : S("", !0),
|
|
272
272
|
f("span", j, p(n.fileUploadDragDropFileHereText), 1),
|
|
273
273
|
f("span", {
|
|
274
274
|
class: d(i.size === a.Sizes.Dense ? "md:ml-1 md:mr-2 md:my-0 my-1 text-ice-900" : "tw-mt-1.5 my-1")
|
|
@@ -281,7 +281,7 @@ function B(e, t, i, a, n, l) {
|
|
|
281
281
|
onClick: c(l.openFileDialog, ["stop", "prevent"])
|
|
282
282
|
}, {
|
|
283
283
|
default: T(() => [
|
|
284
|
-
|
|
284
|
+
_(e.$slots, "submitText", {}, () => [
|
|
285
285
|
y(p(n.fileUploadUploadFileText), 1)
|
|
286
286
|
])
|
|
287
287
|
]),
|
|
@@ -290,8 +290,8 @@ function B(e, t, i, a, n, l) {
|
|
|
290
290
|
], 64))
|
|
291
291
|
], 2),
|
|
292
292
|
e.$slots.hint && !i.files.length ? (r(), o("div", X, [
|
|
293
|
-
|
|
294
|
-
])) :
|
|
293
|
+
_(e.$slots, "hint")
|
|
294
|
+
])) : S("", !0)
|
|
295
295
|
], 34)),
|
|
296
296
|
U(f("input", M(l.inputAttrs, {
|
|
297
297
|
ref: "fileUpload",
|
|
@@ -308,8 +308,8 @@ const V = {
|
|
|
308
308
|
$style: L
|
|
309
309
|
}, le = /* @__PURE__ */ P(k, [["render", B], ["__cssModules", V]]);
|
|
310
310
|
export {
|
|
311
|
-
|
|
312
|
-
|
|
311
|
+
E as FILE_TYPES,
|
|
312
|
+
b as Sizes,
|
|
313
313
|
le as default
|
|
314
314
|
};
|
|
315
315
|
//# sourceMappingURL=FileUpload.js.map
|