@leaflink/stash 43.5.2 → 44.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +107 -39
- package/assets/illustrations/FileUpload/document.svg +1 -17
- package/dist/ActionsDropdown.js +25 -25
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/AddressSelect.js +12 -11
- package/dist/AddressSelect.js.map +1 -1
- package/dist/Alert.js +9 -9
- package/dist/Alert.js.map +1 -1
- package/dist/AppNavigationItem.js +22 -22
- package/dist/AppNavigationItem.js.map +1 -1
- package/dist/AppSidebar.js +11 -11
- 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/Badge.vue.d.ts +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-63d31dc0.js +17 -0
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-63d31dc0.js.map +1 -0
- package/dist/ButtonGroup.js +28 -28
- 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 +260 -248
- package/dist/Carousel.js.map +1 -1
- package/dist/Checkbox.js +58 -46
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox.vue.d.ts +2 -0
- package/dist/Checkbox.vue_used_vue_type_style_index_0_lang.module-fa8d9c06.js +9 -0
- package/dist/Checkbox.vue_used_vue_type_style_index_0_lang.module-fa8d9c06.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 +47 -38
- package/dist/DataViewSortButton.js.map +1 -1
- package/dist/DataViewToolbar.js +4 -4
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DatePicker.js +12 -15
- package/dist/DatePicker.js.map +1 -1
- package/dist/DescriptionListTerm.js +8 -8
- package/dist/DescriptionListTerm.js.map +1 -1
- package/dist/Dialog.js +46 -46
- package/dist/Dialog.js.map +1 -1
- package/dist/Divider.js +9 -9
- package/dist/Divider.js.map +1 -1
- package/dist/Dropdown.js +17 -17
- package/dist/Dropdown.js.map +1 -1
- package/dist/EmptyState.js +1 -1
- package/dist/EmptyState.js.map +1 -1
- package/dist/Expand.js +1 -1
- package/dist/{Expand.vue_vue_type_script_setup_true_lang-5fe03d51.js → Expand.vue_vue_type_script_setup_true_lang-1751f4a6.js} +14 -15
- package/dist/Expand.vue_vue_type_script_setup_true_lang-1751f4a6.js.map +1 -0
- package/dist/Field.js +2 -2
- package/dist/Field.vue.d.ts +1 -1
- package/dist/{Field.vue_vue_type_script_setup_true_lang-475832fe.js → Field.vue_vue_type_script_setup_true_lang-42ba3c5a.js} +5 -5
- package/dist/Field.vue_vue_type_script_setup_true_lang-42ba3c5a.js.map +1 -0
- package/dist/FileUpload.js +49 -47
- package/dist/FileUpload.js.map +1 -1
- package/dist/FilterChip.js +20 -20
- 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 +27 -27
- package/dist/FilterSelect.js.map +1 -1
- package/dist/Filters.js +51 -50
- package/dist/Filters.js.map +1 -1
- package/dist/HttpError.js +28 -28
- package/dist/HttpError.js.map +1 -1
- package/dist/IconLabel.js +17 -17
- package/dist/IconLabel.js.map +1 -1
- package/dist/IconLabel.vue.d.ts +1 -1
- package/dist/Illustration.js +10 -60
- package/dist/Illustration.js.map +1 -1
- package/dist/Illustration.vue_vue_type_script_setup_true_lang-d6a94e17.js +56 -0
- package/dist/Illustration.vue_vue_type_script_setup_true_lang-d6a94e17.js.map +1 -0
- package/dist/Image.js +67 -72
- package/dist/Image.js.map +1 -1
- package/dist/InlineEdit.js +3 -3
- package/dist/InlineEdit.js.map +1 -1
- package/dist/Input.js +43 -43
- package/dist/Input.js.map +1 -1
- package/dist/InputOptions.js +34 -33
- package/dist/InputOptions.js.map +1 -1
- package/dist/Label.js +1 -1
- package/dist/Label.vue.d.ts +13 -2
- package/dist/Label.vue_vue_type_script_setup_true_lang-4b02087f.js +38 -0
- package/dist/Label.vue_vue_type_script_setup_true_lang-4b02087f.js.map +1 -0
- package/dist/ListItem.js +16 -15
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItemCell.js +9 -9
- package/dist/ListItemCell.js.map +1 -1
- package/dist/ListView.js +143 -139
- package/dist/ListView.js.map +1 -1
- package/dist/Loading.js +17 -10
- package/dist/Loading.js.map +1 -1
- package/dist/Loading.vue_used_vue_type_style_index_0_lang.module-ef5a3bc6.js +8 -0
- package/dist/Loading.vue_used_vue_type_style_index_0_lang.module-ef5a3bc6.js.map +1 -0
- package/dist/Menu.js +1 -1
- package/dist/Menu.js.map +1 -1
- package/dist/MenuItem.js +20 -14
- package/dist/MenuItem.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/Modals.js +13 -13
- package/dist/Modals.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 +30 -32
- package/dist/ObfuscateText.js.map +1 -1
- package/dist/ObfuscateText.vue.d.ts +1 -1
- package/dist/PageContent.js +9 -9
- package/dist/PageContent.js.map +1 -1
- package/dist/PageHeader.js +24 -24
- package/dist/PageHeader.js.map +1 -1
- package/dist/PageNavigation.js +3 -3
- package/dist/PageNavigation.js.map +1 -1
- 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-18343da7.js +11 -0
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-18343da7.js.map +1 -0
- package/dist/QuickAction.js +20 -17
- package/dist/QuickAction.js.map +1 -1
- package/dist/Radio.js +30 -15
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js +177 -148
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioNew.js +118 -91
- package/dist/RadioNew.js.map +1 -1
- package/dist/SearchBar.js +27 -27
- package/dist/SearchBar.js.map +1 -1
- package/dist/Select.js +189 -188
- 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 +44 -36
- 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-69d1b046.js} +23 -22
- package/dist/Tab.vue_vue_type_script_setup_true_lang-69d1b046.js.map +1 -0
- package/dist/Table.js +23 -22
- package/dist/Table.js.map +1 -1
- package/dist/Table.keys-cf93df19.js +27 -0
- package/dist/{Table.keys-1ebe4ecb.js.map → Table.keys-cf93df19.js.map} +1 -1
- package/dist/TableCell.js +24 -23
- package/dist/TableCell.js.map +1 -1
- package/dist/TableHeaderCell.js +37 -36
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/TableHeaderRow.js +13 -12
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableRow.js +36 -34
- 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-2a131332.js} +26 -26
- package/dist/Tabs.vue_used_vue_type_style_index_0_lang.module-2a131332.js.map +1 -0
- package/dist/Textarea.js +61 -53
- package/dist/Textarea.js.map +1 -1
- package/dist/Toast.js +23 -23
- package/dist/Toast.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/constants.d.ts +33 -26
- package/dist/constants.js +56 -41
- package/dist/constants.js.map +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/tailwind-base.d.ts +16 -16
- package/dist/tailwind-base.js +16 -6
- package/dist/tailwind-base.js.map +1 -1
- package/dist/useGoogleMaps.js.map +1 -1
- package/dist/utils/helpers.js +37 -37
- package/dist/utils/helpers.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/_core.scss +49 -1
- package/styles/backwards-compat.css +1467 -106
- package/styles/base.css +537 -22
- package/tailwind-base.ts +6 -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 +0 -2
- package/dist/Checkbox.vue_vue_type_style_index_0_scoped_0d7e7fd0_lang-4ed993c7.js.map +0 -1
- package/dist/Expand.vue_vue_type_script_setup_true_lang-5fe03d51.js.map +0 -1
- package/dist/Field.vue_vue_type_script_setup_true_lang-475832fe.js.map +0 -1
- package/dist/Label.vue_vue_type_script_setup_true_lang-1d29d98a.js +0 -37
- package/dist/Label.vue_vue_type_script_setup_true_lang-1d29d98a.js.map +0 -1
- package/dist/Loading.vue_vue_type_style_index_0_scoped_bb8d5f15_lang-4ed993c7.js +0 -2
- package/dist/Loading.vue_vue_type_style_index_0_scoped_bb8d5f15_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
- package/dist/Table.keys-1ebe4ecb.js +0 -27
- package/dist/Tabs.vue_used_vue_type_style_index_0_lang.module-4f247ed7.js.map +0 -1
- package/styles/_base.scss +0 -493
- package/styles/components/_all.scss +0 -14
- package/styles/components/_box.scss +0 -13
- package/styles/components/_item-list.scss +0 -78
- package/styles/components/_sidebar.scss +0 -404
- package/styles/components/_top-header.scss +0 -219
- package/styles/elements/_all.scss +0 -15
- package/styles/elements/_buttons.scss +0 -235
- package/styles/elements/_forms.scss +0 -300
- package/styles/elements/_links.scss +0 -32
- package/styles/elements/_lists.scss +0 -31
- package/styles/elements/_misc.scss +0 -16
- package/styles/elements/_tables.scss +0 -80
- package/styles/elements/_tooltips.scss +0 -110
- package/styles/main.scss +0 -38
- package/styles/utility/_all.scss +0 -12
- package/styles/utility/_animations.scss +0 -103
- package/styles/utility/_display.scss +0 -167
- package/styles/utility/_grid.scss +0 -200
- package/styles/utility/_icons.scss +0 -31
- package/styles/utility/_transitions.scss +0 -110
package/dist/Modal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as H, useSlots as I, ref as d, computed as x, watch as $, onBeforeUnmount as K, openBlock as a, createElementBlock as
|
|
1
|
+
import { defineComponent as H, useSlots as I, ref as d, computed as x, watch as $, onBeforeUnmount as K, openBlock as a, createElementBlock as w, normalizeClass as s, withKeys as R, createVNode as C, withModifiers as j, createElementVNode as g, unref as f, renderSlot as m, toDisplayString as T, createCommentVNode as i, createBlock as F, withCtx as L } from "vue";
|
|
2
2
|
import V from "lodash-es/uniqueId";
|
|
3
3
|
import { FOCUS_ELEMENTS_SELECTOR as A } from "./constants.js";
|
|
4
4
|
import { t as M } from "./locale.js";
|
|
@@ -7,7 +7,7 @@ import N from "./Button.js";
|
|
|
7
7
|
import D from "./Icon.js";
|
|
8
8
|
import { _ as P } 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-63d31dc0.js";
|
|
11
11
|
import "./index-79ce320f.js";
|
|
12
12
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
13
13
|
var U = /* @__PURE__ */ ((l) => (l.Narrow = "narrow", l.Medium = "medium", l.Wide = "wide", l))(U || {}), W = /* @__PURE__ */ ((l) => (l.Center = "center", l.Left = "left", l.Right = "right", l))(W || {});
|
|
@@ -65,14 +65,14 @@ const G = ["onKeydown"], J = ["aria-labelledby"], Q = { class: "tw-flex tw-place
|
|
|
65
65
|
var c, S;
|
|
66
66
|
t.key === "Tab" && (t.shiftKey && document.activeElement === b.value ? ((c = k.value) == null || c.focus(), t.preventDefault()) : document.activeElement === k.value && ((S = b.value) == null || S.focus(), t.preventDefault()));
|
|
67
67
|
}
|
|
68
|
-
return (t, c) => o.value ? (a(),
|
|
68
|
+
return (t, c) => o.value ? (a(), w("div", {
|
|
69
69
|
key: 0,
|
|
70
70
|
ref_key: "rootRef",
|
|
71
71
|
ref: r,
|
|
72
72
|
class: s(["stash-modal tw-fixed tw-inset-0 tw-overflow-y-auto", {
|
|
73
73
|
"tw-invisible tw-z-behind": !o.value,
|
|
74
74
|
"tw-visible tw-z-modal": o.value,
|
|
75
|
-
"lg:tw-flex lg:tw-flex-col lg:tw-
|
|
75
|
+
"lg:tw-flex lg:tw-flex-col lg:tw-items-center lg:tw-justify-center": e.position === "center"
|
|
76
76
|
}]),
|
|
77
77
|
"data-test": "ll-modal",
|
|
78
78
|
tabindex: "0",
|
|
@@ -85,8 +85,8 @@ const G = ["onKeydown"], J = ["aria-labelledby"], Q = { class: "tw-flex tw-place
|
|
|
85
85
|
g("div", {
|
|
86
86
|
"aria-modal": "true",
|
|
87
87
|
role: "dialog",
|
|
88
|
-
"aria-labelledby":
|
|
89
|
-
class: s(["stash-modal__dialog tw-
|
|
88
|
+
"aria-labelledby": f(B),
|
|
89
|
+
class: s(["stash-modal__dialog tw-relative tw-flex tw-h-screen tw-w-full tw-flex-col lg:tw-shadow", [
|
|
90
90
|
`stash-modal__dialog--size-${e.size}`,
|
|
91
91
|
`stash-modal__dialog--position-${e.position}`,
|
|
92
92
|
{
|
|
@@ -97,8 +97,8 @@ const G = ["onKeydown"], J = ["aria-labelledby"], Q = { class: "tw-flex tw-place
|
|
|
97
97
|
"lg:tw-w-[360px]": e.size === "narrow",
|
|
98
98
|
"lg:tw-w-[648px]": e.size === "medium",
|
|
99
99
|
"lg:tw-w-[960px]": e.size === "wide",
|
|
100
|
-
"lg:tw-
|
|
101
|
-
"lg:tw-
|
|
100
|
+
"lg:tw-my-0 lg:tw-h-auto lg:tw-max-h-[90vh]": e.position === "center",
|
|
101
|
+
"lg:tw-absolute lg:tw-h-screen": n.value,
|
|
102
102
|
"lg:tw-left-0": e.position === "left",
|
|
103
103
|
"lg:tw-right-0": e.position === "right"
|
|
104
104
|
}
|
|
@@ -106,24 +106,24 @@ const G = ["onKeydown"], J = ["aria-labelledby"], Q = { class: "tw-flex tw-place
|
|
|
106
106
|
onClick: c[0] || (c[0] = j(() => {
|
|
107
107
|
}, ["stop"]))
|
|
108
108
|
}, [
|
|
109
|
-
e.hideHeader ? i("", !0) : (a(),
|
|
109
|
+
e.hideHeader ? i("", !0) : (a(), w("header", {
|
|
110
110
|
key: 0,
|
|
111
111
|
"data-test": "stash-modal__header",
|
|
112
|
-
class: s(["stash-modal__header tw-
|
|
112
|
+
class: s(["stash-modal__header tw-grid tw-h-12 tw-place-items-center tw-bg-purple-500", { "lg:tw-rounded-t": !n.value }])
|
|
113
113
|
}, [
|
|
114
114
|
g("div", Q, [
|
|
115
115
|
m(t.$slots, "headerAction", {}, void 0, !0)
|
|
116
116
|
]),
|
|
117
|
-
e.title ? (a(),
|
|
117
|
+
e.title ? (a(), w("h3", {
|
|
118
118
|
key: 0,
|
|
119
|
-
id:
|
|
120
|
-
class: "tw-
|
|
119
|
+
id: f(B),
|
|
120
|
+
class: "tw-m-0 tw-flex-1 tw-leading-6 tw-text-white"
|
|
121
121
|
}, T(e.title), 9, X)) : i("", !0),
|
|
122
122
|
e.hideClose ? i("", !0) : (a(), F(N, {
|
|
123
123
|
key: 1,
|
|
124
124
|
icon: "",
|
|
125
125
|
"data-test": "ll-modal-close",
|
|
126
|
-
title:
|
|
126
|
+
title: f(M)("ll.closeModal"),
|
|
127
127
|
type: "button",
|
|
128
128
|
onClick: v
|
|
129
129
|
}, {
|
|
@@ -142,7 +142,7 @@ const G = ["onKeydown"], J = ["aria-labelledby"], Q = { class: "tw-flex tw-place
|
|
|
142
142
|
icon: "",
|
|
143
143
|
"data-test": "ll-modal-close",
|
|
144
144
|
type: "button",
|
|
145
|
-
title:
|
|
145
|
+
title: f(M)("ll.closeModal"),
|
|
146
146
|
onClick: v
|
|
147
147
|
}, {
|
|
148
148
|
default: L(() => [
|
|
@@ -153,9 +153,9 @@ const G = ["onKeydown"], J = ["aria-labelledby"], Q = { class: "tw-flex tw-place
|
|
|
153
153
|
]),
|
|
154
154
|
_: 1
|
|
155
155
|
}, 8, ["title"])) : i("", !0),
|
|
156
|
-
|
|
156
|
+
f(y)["featured-content"] ? (a(), w("div", {
|
|
157
157
|
key: 2,
|
|
158
|
-
class: s(["
|
|
158
|
+
class: s(["stash-modal__featured-content tw-relative", {
|
|
159
159
|
"tw-rounded-t": e.hideHeader
|
|
160
160
|
}])
|
|
161
161
|
}, [
|
|
@@ -175,9 +175,9 @@ const G = ["onKeydown"], J = ["aria-labelledby"], Q = { class: "tw-flex tw-place
|
|
|
175
175
|
}, [
|
|
176
176
|
m(t.$slots, "default", {}, void 0, !0)
|
|
177
177
|
], 2),
|
|
178
|
-
z.value ? (a(),
|
|
178
|
+
z.value ? (a(), w("footer", {
|
|
179
179
|
key: 3,
|
|
180
|
-
class: s(["stash-modal__footer tw-
|
|
180
|
+
class: s(["stash-modal__footer tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-p-6", { "lg:tw-rounded-b": !n.value }])
|
|
181
181
|
}, [
|
|
182
182
|
m(t.$slots, "footer", {}, () => [
|
|
183
183
|
g("div", Y, [
|
|
@@ -189,10 +189,10 @@ const G = ["onKeydown"], J = ["aria-labelledby"], Q = { class: "tw-flex tw-place
|
|
|
189
189
|
], 42, G)) : i("", !0);
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
|
-
const
|
|
192
|
+
const we = /* @__PURE__ */ P(Z, [["__scopeId", "data-v-87b2b608"]]);
|
|
193
193
|
export {
|
|
194
194
|
W as ModalPosition,
|
|
195
195
|
U as ModalSize,
|
|
196
|
-
|
|
196
|
+
we as default
|
|
197
197
|
};
|
|
198
198
|
//# sourceMappingURL=Modal.js.map
|
package/dist/Modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":["../src/components/Modal/Modal.types.ts","../src/components/Modal/Modal.vue"],"sourcesContent":["export enum ModalSize {\n Narrow = 'narrow',\n Medium = 'medium',\n Wide = 'wide',\n}\n\nexport type ModalSizes = `${ModalSize}`;\n\nexport enum ModalPosition {\n Center = 'center',\n Left = 'left',\n Right = 'right',\n}\n\nexport type ModalPositions = `${ModalPosition}`;\n","<script lang=\"ts\">\n import { ModalPositions, ModalSizes } from './Modal.types';\n\n export * from './Modal.types';\n\n export interface ModalProps {\n /**\n * Hides the \"close\" button\n */\n hideClose?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n * @deprecated Use `isOpen` instead\n */\n open?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n */\n isOpen?: boolean;\n\n /**\n * Use v-model:is-open or :is-open instead of :model-value and v-model.\n * @deprecated\n */\n modelValue?: boolean;\n\n /**\n * Sets a preset max-width on the modal.\n * Options: default (648px), narrow (360px), wide (960px)\n */\n size?: ModalSizes;\n\n /**\n * Should the modal be scrollable within the content area. This prop is treated as `true` when the `position` prop is set to \"left\" or \"right\".\n */\n scrollable?: boolean;\n\n /**\n * Gives the modal body have a light gray background\n */\n contrast?: boolean;\n\n /**\n * Text to display in the modal header\n */\n title?: string;\n\n /**\n * Disables the default padding in the modal body.\n */\n disableBodyPadding?: boolean;\n\n /**\n * The position on the screen to display the modal.\n */\n position?: ModalPositions;\n\n /**\n * Hide the header. Typically used with the featuredContent slot to display a graphic and create a \"promo\" modal.\n */\n hideHeader?: boolean;\n\n /**\n * Add classes to the close button. This can be used with the hideHeader prop and featuredContent slot to\n * accommodate images with different color backgrounds.\n */\n closeButtonColorClass?: string;\n }\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, onBeforeUnmount, ref, useSlots, watch } from 'vue';\n\n import { FOCUS_ELEMENTS_SELECTOR } from '../../constants';\n import { t } from '../../locale';\n import Backdrop from '../Backdrop/Backdrop.vue';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({ name: 'll-modal' });\n\n const props = withDefaults(defineProps<ModalProps>(), {\n hideClose: false,\n open: false,\n isOpen: false,\n modelValue: false,\n size: 'medium',\n scrollable: false,\n contrast: false,\n title: '',\n position: 'center',\n hideHeader: false,\n closeButtonColorClass: 'tw-text-white/50',\n });\n\n const emit =\n defineEmits<{\n /**\n * @deprecated Use the `update:is-open` event instead\n */\n (e: 'update:open', isOpen?: boolean): void;\n (e: 'update:is-open', isOpen?: boolean): void;\n (e: 'dismiss'): void;\n }>();\n\n const slots = useSlots();\n\n const rootRef = ref<HTMLElement>();\n const lastExternalFocusedElement = ref<HTMLElement>();\n const focusElements = ref<HTMLElement[]>([]);\n const firstFocusElement = ref<HTMLElement>();\n const lastFocusElement = ref<HTMLElement>();\n const initialPageScrollingElementStyle = ref({ height: '', overflow: '' });\n const headerId = uniqueId('modal-header-');\n const hasFooterContent = computed(() => !!slots.actions || !!slots.footer);\n const isModalOpen = computed(() => props.open || props.isOpen);\n const isDrawer = computed(() => props.position === 'left' || props.position === 'right');\n\n function getPageScrollingElement() {\n return (document.scrollingElement || document.body) as HTMLElement;\n }\n\n watch(\n isModalOpen,\n () => {\n if (isModalOpen.value) {\n Object.assign(initialPageScrollingElementStyle.value, {\n height: getPageScrollingElement().style.height,\n overflow: getPageScrollingElement().style.overflow,\n });\n }\n\n Object.assign(getPageScrollingElement().style, {\n overflow: isModalOpen.value ? 'hidden' : initialPageScrollingElementStyle.value.overflow, // Prevents page from scrolling when modal is open\n height: isModalOpen.value ? '100%' : initialPageScrollingElementStyle.value.height, // Ensures the backdrop covers the entire page when modal is open; see https://github.com/LeafLink/stash/pull/713#issuecomment-1184602535\n });\n },\n { immediate: true },\n );\n\n onBeforeUnmount(() => {\n // In cases where the watchEffect for isModalOpen isn't triggered while closing/nagivating away from modal, this ensures scrolling returns to normal\n Object.assign(getPageScrollingElement().style, {\n overflow: initialPageScrollingElementStyle.value.overflow,\n height: initialPageScrollingElementStyle.value.height,\n });\n\n // Clear focus trap tab listener\n document.removeEventListener('keydown', handleTab);\n lastExternalFocusedElement.value?.focus();\n });\n\n function dismiss() {\n emit('update:open', false);\n emit('update:is-open', false);\n emit('dismiss');\n }\n\n // This watcher ensures the Tab key cycles through focusable elements within the modal.\n watch(rootRef, () => {\n if (!rootRef.value) {\n return;\n }\n\n lastExternalFocusedElement.value = document.activeElement as HTMLElement;\n rootRef.value.focus();\n\n focusElements.value = Array.from(rootRef.value.querySelectorAll<HTMLElement>(FOCUS_ELEMENTS_SELECTOR));\n firstFocusElement.value = focusElements.value[0];\n lastFocusElement.value = focusElements.value[focusElements.value.length - 1];\n document.addEventListener('keydown', handleTab);\n });\n\n function handleTab(e) {\n if (e.key === 'Tab') {\n if (e.shiftKey && document.activeElement === firstFocusElement.value) {\n lastFocusElement.value?.focus();\n e.preventDefault();\n } else if (document.activeElement === lastFocusElement.value) {\n firstFocusElement.value?.focus();\n e.preventDefault();\n }\n }\n }\n</script>\n\n<template>\n <div\n v-if=\"isModalOpen\"\n ref=\"rootRef\"\n class=\"stash-modal tw-fixed tw-inset-0 tw-overflow-y-auto\"\n :class=\"{\n 'tw-invisible tw-z-behind': !isModalOpen,\n 'tw-visible tw-z-modal': isModalOpen,\n 'lg:tw-flex lg:tw-flex-col lg:tw-justify-center lg:tw-items-center': props.position === 'center',\n }\"\n data-test=\"ll-modal\"\n tabindex=\"0\"\n @keydown.esc=\"dismiss\"\n >\n <Backdrop class=\"stash-modal__backdrop\" @click.stop=\"dismiss\" />\n <div\n aria-modal=\"true\"\n role=\"dialog\"\n :aria-labelledby=\"headerId\"\n class=\"stash-modal__dialog tw-flex tw-flex-col tw-h-screen tw-w-full lg:tw-shadow tw-relative\"\n :class=\"[\n `stash-modal__dialog--size-${props.size}`,\n `stash-modal__dialog--position-${props.position}`,\n {\n 'stash-modal__dialog--is-open': isModalOpen,\n 'stash-modal__dialog--is-drawer': isDrawer,\n 'stash-modal__dialog--is-contrast': props.contrast,\n 'stash-modal__dialog--is-scrollable': props.scrollable,\n 'lg:tw-w-[360px]': props.size === 'narrow',\n 'lg:tw-w-[648px]': props.size === 'medium',\n 'lg:tw-w-[960px]': props.size === 'wide',\n 'lg:tw-h-auto lg:tw-my-0 lg:tw-max-h-[90vh]': props.position === 'center',\n 'lg:tw-h-screen lg:tw-absolute': isDrawer,\n 'lg:tw-left-0': props.position === 'left',\n 'lg:tw-right-0': props.position === 'right',\n },\n ]\"\n @click.stop\n >\n <header\n v-if=\"!props.hideHeader\"\n data-test=\"stash-modal__header\"\n class=\"stash-modal__header tw-bg-purple-500 tw-h-12 tw-grid tw-place-items-center\"\n :class=\"{ 'lg:tw-rounded-t': !isDrawer }\"\n >\n <div class=\"tw-flex tw-place-items-center\">\n <!-- @slot Adds an action to the left side of the header bar. An example usage is a modal with multiple pages and a back button can be inserted here -->\n <slot name=\"headerAction\"></slot>\n </div>\n\n <h3 v-if=\"props.title\" :id=\"headerId\" class=\"tw-text-white tw-flex-1 tw-leading-6 tw-m-0\">\n {{ props.title }}\n </h3>\n\n <Button\n v-if=\"!props.hideClose\"\n icon\n data-test=\"ll-modal-close\"\n :title=\"t('ll.closeModal')\"\n type=\"button\"\n @click=\"dismiss\"\n >\n <Icon class=\"tw-text-white\" name=\"close\" />\n </Button>\n </header>\n\n <Button\n v-if=\"!props.hideClose && props.hideHeader\"\n class=\"tw-absolute tw-right-0 tw-top-0 tw-z-10\"\n icon\n data-test=\"ll-modal-close\"\n type=\"button\"\n :title=\"t('ll.closeModal')\"\n @click=\"dismiss\"\n >\n <Icon class=\"tw-drop-shadow-md\" name=\"close\" :class=\"[props.closeButtonColorClass]\" />\n </Button>\n\n <div\n v-if=\"!!slots['featured-content']\"\n class=\"tw-relative stash-modal__featured-content\"\n :class=\"{\n 'tw-rounded-t': props.hideHeader,\n }\"\n >\n <slot name=\"featured-content\"></slot>\n </div>\n\n <div\n class=\"stash-modal__body tw-flex-1 tw-overflow-y-auto\"\n :class=\"[\n {\n 'tw-p-3 lg:tw-p-6': !props.disableBodyPadding,\n 'lg:tw-overflow-y-visible': !props.scrollable && !isDrawer,\n 'lg:tw-rounded-b': !hasFooterContent && !isDrawer,\n 'tw-bg-white': !props.contrast,\n 'tw-bg-ice-200': props.contrast,\n },\n ]\"\n data-test=\"stash-modal__body\"\n >\n <slot></slot>\n </div>\n\n <footer\n v-if=\"hasFooterContent\"\n class=\"stash-modal__footer tw-bg-ice-100 tw-border-ice-500 tw-p-3 lg:tw-p-6\"\n :class=\"{ 'lg:tw-rounded-b': !isDrawer }\"\n >\n <!-- @slot Overrides the whole footer section. Used for rendering custom footers with more than 2 actions. If defined, \"actions\" slot will get ignored. -->\n <slot name=\"footer\">\n <div class=\"stash-modal__footer__actions tw-flex tw-flex-col tw-justify-end lg:tw-flex-row\">\n <!-- @slot Modal footer actions, supports rendering up to 2 `<Button>` children -->\n <slot name=\"actions\"></slot>\n </div>\n </slot>\n </footer>\n </div>\n </div>\n</template>\n\n<style scoped>\n .stash-modal__header {\n grid-template-columns: 48px 1fr 48px;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: var(--ll-space-2);\n order: 1;\n }\n\n @media screen and (width >= 961px) {\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 1;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: 0;\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button + .stash-button) {\n margin-left: var(--grid-gutter);\n }\n }\n\n .stash-modal__featured-content > :deep(*) {\n border-radius: inherit;\n }\n</style>\n"],"names":["ModalSize","ModalPosition","slots","useSlots","rootRef","ref","lastExternalFocusedElement","focusElements","firstFocusElement","lastFocusElement","initialPageScrollingElementStyle","headerId","uniqueId","hasFooterContent","computed","isModalOpen","props","isDrawer","getPageScrollingElement","watch","onBeforeUnmount","handleTab","_a","dismiss","emit","FOCUS_ELEMENTS_SELECTOR","e","_b"],"mappings":";;;;;;;;;;;;AAAY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,QAAQ,SAHEA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;iBCoGJC,IAAQC,KAERC,IAAUC,KACVC,IAA6BD,KAC7BE,IAAgBF,EAAmB,CAAA,CAAE,GACrCG,IAAoBH,KACpBI,IAAmBJ,KACnBK,IAAmCL,EAAI,EAAE,QAAQ,IAAI,UAAU,IAAI,GACnEM,IAAWC,EAAS,eAAe,GACnCC,IAAmBC,EAAS,MAAM,CAAC,CAACZ,EAAM,WAAW,CAAC,CAACA,EAAM,MAAM,GACnEa,IAAcD,EAAS,MAAME,EAAM,QAAQA,EAAM,MAAM,GACvDC,IAAWH,EAAS,MAAME,EAAM,aAAa,UAAUA,EAAM,aAAa,OAAO;AAEvF,aAASE,IAA0B;AACzB,aAAA,SAAS,oBAAoB,SAAS;AAAA,IAChD;AAEA,IAAAC;AAAA,MACEJ;AAAA,MACA,MAAM;AACJ,QAAIA,EAAY,SACP,OAAA,OAAOL,EAAiC,OAAO;AAAA,UACpD,QAAQQ,IAA0B,MAAM;AAAA,UACxC,UAAUA,IAA0B,MAAM;AAAA,QAAA,CAC3C,GAGI,OAAA,OAAOA,EAAwB,EAAE,OAAO;AAAA,UAC7C,UAAUH,EAAY,QAAQ,WAAWL,EAAiC,MAAM;AAAA;AAAA,UAChF,QAAQK,EAAY,QAAQ,SAASL,EAAiC,MAAM;AAAA;AAAA,QAAA,CAC7E;AAAA,MACH;AAAA,MACA,EAAE,WAAW,GAAK;AAAA,IAAA,GAGpBU,EAAgB,MAAM;;AAEb,aAAA,OAAOF,EAAwB,EAAE,OAAO;AAAA,QAC7C,UAAUR,EAAiC,MAAM;AAAA,QACjD,QAAQA,EAAiC,MAAM;AAAA,MAAA,CAChD,GAGQ,SAAA,oBAAoB,WAAWW,CAAS,IACjDC,IAAAhB,EAA2B,UAA3B,QAAAgB,EAAkC;AAAA,IAAM,CACzC;AAED,aAASC,IAAU;AACjB,MAAAC,EAAK,eAAe,EAAK,GACzBA,EAAK,kBAAkB,EAAK,GAC5BA,EAAK,SAAS;AAAA,IAChB;AAGA,IAAAL,EAAMf,GAAS,MAAM;AACf,MAACA,EAAQ,UAIbE,EAA2B,QAAQ,SAAS,eAC5CF,EAAQ,MAAM,SAEdG,EAAc,QAAQ,MAAM,KAAKH,EAAQ,MAAM,iBAA8BqB,CAAuB,CAAC,GACnFjB,EAAA,QAAQD,EAAc,MAAM,CAAC,GAC/CE,EAAiB,QAAQF,EAAc,MAAMA,EAAc,MAAM,SAAS,CAAC,GAClE,SAAA,iBAAiB,WAAWc,CAAS;AAAA,IAAA,CAC/C;AAED,aAASA,EAAUK,GAAG;;AAChB,MAAAA,EAAE,QAAQ,UACRA,EAAE,YAAY,SAAS,kBAAkBlB,EAAkB,UAC7Dc,IAAAb,EAAiB,UAAjB,QAAAa,EAAwB,SACxBI,EAAE,eAAe,KACR,SAAS,kBAAkBjB,EAAiB,WACrDkB,IAAAnB,EAAkB,UAAlB,QAAAmB,EAAyB,SACzBD,EAAE,eAAe;AAAA,IAGvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["../src/components/Modal/Modal.types.ts","../src/components/Modal/Modal.vue"],"sourcesContent":["export enum ModalSize {\n Narrow = 'narrow',\n Medium = 'medium',\n Wide = 'wide',\n}\n\nexport type ModalSizes = `${ModalSize}`;\n\nexport enum ModalPosition {\n Center = 'center',\n Left = 'left',\n Right = 'right',\n}\n\nexport type ModalPositions = `${ModalPosition}`;\n","<script lang=\"ts\">\n import { ModalPositions, ModalSizes } from './Modal.types';\n\n export * from './Modal.types';\n\n export interface ModalProps {\n /**\n * Hides the \"close\" button\n */\n hideClose?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n * @deprecated Use `isOpen` instead\n */\n open?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n */\n isOpen?: boolean;\n\n /**\n * Use v-model:is-open or :is-open instead of :model-value and v-model.\n * @deprecated\n */\n modelValue?: boolean;\n\n /**\n * Sets a preset max-width on the modal.\n * Options: default (648px), narrow (360px), wide (960px)\n */\n size?: ModalSizes;\n\n /**\n * Should the modal be scrollable within the content area. This prop is treated as `true` when the `position` prop is set to \"left\" or \"right\".\n */\n scrollable?: boolean;\n\n /**\n * Gives the modal body have a light gray background\n */\n contrast?: boolean;\n\n /**\n * Text to display in the modal header\n */\n title?: string;\n\n /**\n * Disables the default padding in the modal body.\n */\n disableBodyPadding?: boolean;\n\n /**\n * The position on the screen to display the modal.\n */\n position?: ModalPositions;\n\n /**\n * Hide the header. Typically used with the featuredContent slot to display a graphic and create a \"promo\" modal.\n */\n hideHeader?: boolean;\n\n /**\n * Add classes to the close button. This can be used with the hideHeader prop and featuredContent slot to\n * accommodate images with different color backgrounds.\n */\n closeButtonColorClass?: string;\n }\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, onBeforeUnmount, ref, useSlots, watch } from 'vue';\n\n import { FOCUS_ELEMENTS_SELECTOR } from '../../constants';\n import { t } from '../../locale';\n import Backdrop from '../Backdrop/Backdrop.vue';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({ name: 'll-modal' });\n\n const props = withDefaults(defineProps<ModalProps>(), {\n hideClose: false,\n open: false,\n isOpen: false,\n modelValue: false,\n size: 'medium',\n scrollable: false,\n contrast: false,\n title: '',\n position: 'center',\n hideHeader: false,\n closeButtonColorClass: 'tw-text-white/50',\n });\n\n const emit =\n defineEmits<{\n /**\n * @deprecated Use the `update:is-open` event instead\n */\n (e: 'update:open', isOpen?: boolean): void;\n (e: 'update:is-open', isOpen?: boolean): void;\n (e: 'dismiss'): void;\n }>();\n\n const slots = useSlots();\n\n const rootRef = ref<HTMLElement>();\n const lastExternalFocusedElement = ref<HTMLElement>();\n const focusElements = ref<HTMLElement[]>([]);\n const firstFocusElement = ref<HTMLElement>();\n const lastFocusElement = ref<HTMLElement>();\n const initialPageScrollingElementStyle = ref({ height: '', overflow: '' });\n const headerId = uniqueId('modal-header-');\n const hasFooterContent = computed(() => !!slots.actions || !!slots.footer);\n const isModalOpen = computed(() => props.open || props.isOpen);\n const isDrawer = computed(() => props.position === 'left' || props.position === 'right');\n\n function getPageScrollingElement() {\n return (document.scrollingElement || document.body) as HTMLElement;\n }\n\n watch(\n isModalOpen,\n () => {\n if (isModalOpen.value) {\n Object.assign(initialPageScrollingElementStyle.value, {\n height: getPageScrollingElement().style.height,\n overflow: getPageScrollingElement().style.overflow,\n });\n }\n\n Object.assign(getPageScrollingElement().style, {\n overflow: isModalOpen.value ? 'hidden' : initialPageScrollingElementStyle.value.overflow, // Prevents page from scrolling when modal is open\n height: isModalOpen.value ? '100%' : initialPageScrollingElementStyle.value.height, // Ensures the backdrop covers the entire page when modal is open; see https://github.com/LeafLink/stash/pull/713#issuecomment-1184602535\n });\n },\n { immediate: true },\n );\n\n onBeforeUnmount(() => {\n // In cases where the watchEffect for isModalOpen isn't triggered while closing/nagivating away from modal, this ensures scrolling returns to normal\n Object.assign(getPageScrollingElement().style, {\n overflow: initialPageScrollingElementStyle.value.overflow,\n height: initialPageScrollingElementStyle.value.height,\n });\n\n // Clear focus trap tab listener\n document.removeEventListener('keydown', handleTab);\n lastExternalFocusedElement.value?.focus();\n });\n\n function dismiss() {\n emit('update:open', false);\n emit('update:is-open', false);\n emit('dismiss');\n }\n\n // This watcher ensures the Tab key cycles through focusable elements within the modal.\n watch(rootRef, () => {\n if (!rootRef.value) {\n return;\n }\n\n lastExternalFocusedElement.value = document.activeElement as HTMLElement;\n rootRef.value.focus();\n\n focusElements.value = Array.from(rootRef.value.querySelectorAll<HTMLElement>(FOCUS_ELEMENTS_SELECTOR));\n firstFocusElement.value = focusElements.value[0];\n lastFocusElement.value = focusElements.value[focusElements.value.length - 1];\n document.addEventListener('keydown', handleTab);\n });\n\n function handleTab(e) {\n if (e.key === 'Tab') {\n if (e.shiftKey && document.activeElement === firstFocusElement.value) {\n lastFocusElement.value?.focus();\n e.preventDefault();\n } else if (document.activeElement === lastFocusElement.value) {\n firstFocusElement.value?.focus();\n e.preventDefault();\n }\n }\n }\n</script>\n\n<template>\n <div\n v-if=\"isModalOpen\"\n ref=\"rootRef\"\n class=\"stash-modal tw-fixed tw-inset-0 tw-overflow-y-auto\"\n :class=\"{\n 'tw-invisible tw-z-behind': !isModalOpen,\n 'tw-visible tw-z-modal': isModalOpen,\n 'lg:tw-flex lg:tw-flex-col lg:tw-items-center lg:tw-justify-center': props.position === 'center',\n }\"\n data-test=\"ll-modal\"\n tabindex=\"0\"\n @keydown.esc=\"dismiss\"\n >\n <Backdrop class=\"stash-modal__backdrop\" @click.stop=\"dismiss\" />\n <div\n aria-modal=\"true\"\n role=\"dialog\"\n :aria-labelledby=\"headerId\"\n class=\"stash-modal__dialog tw-relative tw-flex tw-h-screen tw-w-full tw-flex-col lg:tw-shadow\"\n :class=\"[\n `stash-modal__dialog--size-${props.size}`,\n `stash-modal__dialog--position-${props.position}`,\n {\n 'stash-modal__dialog--is-open': isModalOpen,\n 'stash-modal__dialog--is-drawer': isDrawer,\n 'stash-modal__dialog--is-contrast': props.contrast,\n 'stash-modal__dialog--is-scrollable': props.scrollable,\n 'lg:tw-w-[360px]': props.size === 'narrow',\n 'lg:tw-w-[648px]': props.size === 'medium',\n 'lg:tw-w-[960px]': props.size === 'wide',\n 'lg:tw-my-0 lg:tw-h-auto lg:tw-max-h-[90vh]': props.position === 'center',\n 'lg:tw-absolute lg:tw-h-screen': isDrawer,\n 'lg:tw-left-0': props.position === 'left',\n 'lg:tw-right-0': props.position === 'right',\n },\n ]\"\n @click.stop\n >\n <header\n v-if=\"!props.hideHeader\"\n data-test=\"stash-modal__header\"\n class=\"stash-modal__header tw-grid tw-h-12 tw-place-items-center tw-bg-purple-500\"\n :class=\"{ 'lg:tw-rounded-t': !isDrawer }\"\n >\n <div class=\"tw-flex tw-place-items-center\">\n <!-- @slot Adds an action to the left side of the header bar. An example usage is a modal with multiple pages and a back button can be inserted here -->\n <slot name=\"headerAction\"></slot>\n </div>\n\n <h3 v-if=\"props.title\" :id=\"headerId\" class=\"tw-m-0 tw-flex-1 tw-leading-6 tw-text-white\">\n {{ props.title }}\n </h3>\n\n <Button\n v-if=\"!props.hideClose\"\n icon\n data-test=\"ll-modal-close\"\n :title=\"t('ll.closeModal')\"\n type=\"button\"\n @click=\"dismiss\"\n >\n <Icon class=\"tw-text-white\" name=\"close\" />\n </Button>\n </header>\n\n <Button\n v-if=\"!props.hideClose && props.hideHeader\"\n class=\"tw-absolute tw-right-0 tw-top-0 tw-z-10\"\n icon\n data-test=\"ll-modal-close\"\n type=\"button\"\n :title=\"t('ll.closeModal')\"\n @click=\"dismiss\"\n >\n <Icon class=\"tw-drop-shadow-md\" name=\"close\" :class=\"[props.closeButtonColorClass]\" />\n </Button>\n\n <div\n v-if=\"!!slots['featured-content']\"\n class=\"stash-modal__featured-content tw-relative\"\n :class=\"{\n 'tw-rounded-t': props.hideHeader,\n }\"\n >\n <slot name=\"featured-content\"></slot>\n </div>\n\n <div\n class=\"stash-modal__body tw-flex-1 tw-overflow-y-auto\"\n :class=\"[\n {\n 'tw-p-3 lg:tw-p-6': !props.disableBodyPadding,\n 'lg:tw-overflow-y-visible': !props.scrollable && !isDrawer,\n 'lg:tw-rounded-b': !hasFooterContent && !isDrawer,\n 'tw-bg-white': !props.contrast,\n 'tw-bg-ice-200': props.contrast,\n },\n ]\"\n data-test=\"stash-modal__body\"\n >\n <slot></slot>\n </div>\n\n <footer\n v-if=\"hasFooterContent\"\n class=\"stash-modal__footer tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-p-6\"\n :class=\"{ 'lg:tw-rounded-b': !isDrawer }\"\n >\n <!-- @slot Overrides the whole footer section. Used for rendering custom footers with more than 2 actions. If defined, \"actions\" slot will get ignored. -->\n <slot name=\"footer\">\n <div class=\"stash-modal__footer__actions tw-flex tw-flex-col tw-justify-end lg:tw-flex-row\">\n <!-- @slot Modal footer actions, supports rendering up to 2 `<Button>` children -->\n <slot name=\"actions\"></slot>\n </div>\n </slot>\n </footer>\n </div>\n </div>\n</template>\n\n<style scoped>\n .stash-modal__header {\n grid-template-columns: 48px 1fr 48px;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: theme('spacing.3');\n order: 1;\n }\n\n @media screen('lg') {\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 1;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: 0;\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button + .stash-button) {\n margin-left: var(--grid-gutter);\n }\n }\n\n .stash-modal__featured-content > :deep(*) {\n border-radius: inherit;\n }\n</style>\n"],"names":["ModalSize","ModalPosition","slots","useSlots","rootRef","ref","lastExternalFocusedElement","focusElements","firstFocusElement","lastFocusElement","initialPageScrollingElementStyle","headerId","uniqueId","hasFooterContent","computed","isModalOpen","props","isDrawer","getPageScrollingElement","watch","onBeforeUnmount","handleTab","_a","dismiss","emit","FOCUS_ELEMENTS_SELECTOR","e","_b"],"mappings":";;;;;;;;;;;;AAAY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,QAAQ,SAHEA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;iBCoGJC,IAAQC,KAERC,IAAUC,KACVC,IAA6BD,KAC7BE,IAAgBF,EAAmB,CAAA,CAAE,GACrCG,IAAoBH,KACpBI,IAAmBJ,KACnBK,IAAmCL,EAAI,EAAE,QAAQ,IAAI,UAAU,IAAI,GACnEM,IAAWC,EAAS,eAAe,GACnCC,IAAmBC,EAAS,MAAM,CAAC,CAACZ,EAAM,WAAW,CAAC,CAACA,EAAM,MAAM,GACnEa,IAAcD,EAAS,MAAME,EAAM,QAAQA,EAAM,MAAM,GACvDC,IAAWH,EAAS,MAAME,EAAM,aAAa,UAAUA,EAAM,aAAa,OAAO;AAEvF,aAASE,IAA0B;AACzB,aAAA,SAAS,oBAAoB,SAAS;AAAA,IAChD;AAEA,IAAAC;AAAA,MACEJ;AAAA,MACA,MAAM;AACJ,QAAIA,EAAY,SACP,OAAA,OAAOL,EAAiC,OAAO;AAAA,UACpD,QAAQQ,IAA0B,MAAM;AAAA,UACxC,UAAUA,IAA0B,MAAM;AAAA,QAAA,CAC3C,GAGI,OAAA,OAAOA,EAAwB,EAAE,OAAO;AAAA,UAC7C,UAAUH,EAAY,QAAQ,WAAWL,EAAiC,MAAM;AAAA;AAAA,UAChF,QAAQK,EAAY,QAAQ,SAASL,EAAiC,MAAM;AAAA;AAAA,QAAA,CAC7E;AAAA,MACH;AAAA,MACA,EAAE,WAAW,GAAK;AAAA,IAAA,GAGpBU,EAAgB,MAAM;;AAEb,aAAA,OAAOF,EAAwB,EAAE,OAAO;AAAA,QAC7C,UAAUR,EAAiC,MAAM;AAAA,QACjD,QAAQA,EAAiC,MAAM;AAAA,MAAA,CAChD,GAGQ,SAAA,oBAAoB,WAAWW,CAAS,IACjDC,IAAAhB,EAA2B,UAA3B,QAAAgB,EAAkC;AAAA,IAAM,CACzC;AAED,aAASC,IAAU;AACjB,MAAAC,EAAK,eAAe,EAAK,GACzBA,EAAK,kBAAkB,EAAK,GAC5BA,EAAK,SAAS;AAAA,IAChB;AAGA,IAAAL,EAAMf,GAAS,MAAM;AACf,MAACA,EAAQ,UAIbE,EAA2B,QAAQ,SAAS,eAC5CF,EAAQ,MAAM,SAEdG,EAAc,QAAQ,MAAM,KAAKH,EAAQ,MAAM,iBAA8BqB,CAAuB,CAAC,GACnFjB,EAAA,QAAQD,EAAc,MAAM,CAAC,GAC/CE,EAAiB,QAAQF,EAAc,MAAMA,EAAc,MAAM,SAAS,CAAC,GAClE,SAAA,iBAAiB,WAAWc,CAAS;AAAA,IAAA,CAC/C;AAED,aAASA,EAAUK,GAAG;;AAChB,MAAAA,EAAE,QAAQ,UACRA,EAAE,YAAY,SAAS,kBAAkBlB,EAAkB,UAC7Dc,IAAAb,EAAiB,UAAjB,QAAAa,EAAwB,SACxBI,EAAE,eAAe,KACR,SAAS,kBAAkBjB,EAAiB,WACrDkB,IAAAnB,EAAkB,UAAlB,QAAAmB,EAAyB,SACzBD,EAAE,eAAe;AAAA,IAGvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/Modals.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as p, openBlock as s, createBlock as
|
|
2
|
-
import
|
|
3
|
-
import { _ as
|
|
1
|
+
import { defineComponent as p, openBlock as s, createBlock as a, TransitionGroup as m, withCtx as c, createElementBlock as d, Fragment as f, renderList as l, unref as v, resolveDynamicComponent as M, mergeProps as L, toHandlers as b, createSlots as g, createElementVNode as k } from "vue";
|
|
2
|
+
import y from "./useModals.js";
|
|
3
|
+
import { _ as h } from "./_plugin-vue_export-helper-dad06003.js";
|
|
4
4
|
import "lodash-es/merge";
|
|
5
|
-
const
|
|
5
|
+
const B = ["innerHTML"], C = /* @__PURE__ */ p({
|
|
6
6
|
__name: "Modals",
|
|
7
|
-
setup(
|
|
8
|
-
const t =
|
|
7
|
+
setup(H) {
|
|
8
|
+
const t = y();
|
|
9
9
|
function _(n, o) {
|
|
10
10
|
var e;
|
|
11
11
|
return (e = n.options) != null && e.disableDefaultListeners ? {} : {
|
|
@@ -14,15 +14,15 @@ const C = ["innerHTML"], H = /* @__PURE__ */ p({
|
|
|
14
14
|
cancel: () => t.close({ index: o })
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
return (n, o) => (s(),
|
|
18
|
-
default:
|
|
19
|
-
(s(!0),
|
|
17
|
+
return (n, o) => (s(), a(m, { name: "modals" }, {
|
|
18
|
+
default: c(() => [
|
|
19
|
+
(s(!0), d(f, null, l(v(t).active, (e, r) => (s(), a(M(e.component), L({
|
|
20
20
|
key: `modal-${r}`
|
|
21
|
-
}, e.attributes, { "is-open": !0 },
|
|
21
|
+
}, e.attributes, { "is-open": !0 }, b(_(e, r))), g({ _: 2 }, [
|
|
22
22
|
l(e.slots, (i, u) => ({
|
|
23
23
|
name: u,
|
|
24
|
-
fn:
|
|
25
|
-
|
|
24
|
+
fn: c(() => [
|
|
25
|
+
k("div", { innerHTML: i }, null, 8, B)
|
|
26
26
|
])
|
|
27
27
|
}))
|
|
28
28
|
]), 1040))), 128))
|
|
@@ -31,7 +31,7 @@ const C = ["innerHTML"], H = /* @__PURE__ */ p({
|
|
|
31
31
|
}));
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
const w = /* @__PURE__ */
|
|
34
|
+
const w = /* @__PURE__ */ h(C, [["__scopeId", "data-v-370a72b6"]]);
|
|
35
35
|
export {
|
|
36
36
|
w as default
|
|
37
37
|
};
|
package/dist/Modals.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modals.js","sources":["../src/components/Modals/Modals.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { DeepReadonly } from 'vue';\n\n import useModals, { type Modal } from '../../composables/useModals/useModals';\n\n const modals = useModals();\n\n function getListeners(modal: DeepReadonly<Modal>, index: number) {\n if (modal.options?.disableDefaultListeners) {\n return {};\n }\n\n return {\n dismiss: () => modals.close({ index }),\n close: () => modals.close({ index }),\n cancel: () => modals.close({ index }),\n };\n }\n</script>\n\n<template>\n <TransitionGroup name=\"modals\">\n <component\n :is=\"modal.component\"\n v-for=\"(modal, index) in modals.active\"\n :key=\"`modal-${index}`\"\n v-bind=\"modal.attributes\"\n :is-open=\"true\"\n v-on=\"getListeners(modal, index)\"\n >\n <template v-for=\"(value, name) in modal.slots\" :key=\"name\" #[name]>\n <div v-html=\"value\" />\n </template>\n </component>\n </TransitionGroup>\n</template>\n\n<style scoped>\n .modals-enter-active,\n .modals-leave-active {\n --swing-timing-function: cubic-bezier(0.25, 0.8, 0.5, 1); /* \"swing\" from the $transition sass map */\n transition: opacity 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from,\n .modals-leave-to {\n opacity: 0;\n }\n\n .modals-enter-active :deep(.stash-modal__dialog--position-center),\n .modals-leave-active :deep(.stash-modal__dialog--position-center) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-center),\n .modals-leave-to :deep(.stash-modal__dialog--position-center) {\n transform: translateY(20px);\n }\n\n .modals-enter-active :deep(.stash-modal__dialog--is-drawer),\n .modals-leave-active :deep(.stash-modal__dialog--is-drawer) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-left),\n .modals-leave-to :deep(.stash-modal__dialog--position-left) {\n transform: translateX(-50px);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-right),\n .modals-leave-to :deep(.stash-modal__dialog--position-right) {\n transform: translateX(50px);\n }\n</style>\n"],"names":["modals","useModals","getListeners","modal","index","_a"],"mappings":";;;;;;;AAKE,UAAMA,IAASC;AAEN,aAAAC,EAAaC,GAA4BC,GAAe;;AAC3D,cAAAC,IAAAF,EAAM,YAAN,QAAAE,EAAe,0BACV,KAGF;AAAA,QACL,SAAS,MAAML,EAAO,MAAM,EAAE,OAAAI,GAAO;AAAA,QACrC,OAAO,MAAMJ,EAAO,MAAM,EAAE,OAAAI,GAAO;AAAA,QACnC,QAAQ,MAAMJ,EAAO,MAAM,EAAE,OAAAI,GAAO;AAAA,MAAA;AAAA,IAExC;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Modals.js","sources":["../src/components/Modals/Modals.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { DeepReadonly } from 'vue';\n\n import useModals, { type Modal } from '../../composables/useModals/useModals';\n\n const modals = useModals();\n\n function getListeners(modal: DeepReadonly<Modal>, index: number) {\n if (modal.options?.disableDefaultListeners) {\n return {};\n }\n\n return {\n dismiss: () => modals.close({ index }),\n close: () => modals.close({ index }),\n cancel: () => modals.close({ index }),\n };\n }\n</script>\n\n<template>\n <TransitionGroup name=\"modals\">\n <component\n :is=\"modal.component\"\n v-for=\"(modal, index) in modals.active\"\n :key=\"`modal-${index}`\"\n v-bind=\"modal.attributes\"\n :is-open=\"true\"\n v-on=\"getListeners(modal, index)\"\n >\n <template v-for=\"(value, name) in modal.slots\" :key=\"name\" #[name]>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <div v-html=\"value\" />\n </template>\n </component>\n </TransitionGroup>\n</template>\n\n<style scoped>\n .modals-enter-active,\n .modals-leave-active {\n --swing-timing-function: cubic-bezier(0.25, 0.8, 0.5, 1); /* \"swing\" from the $transition sass map */\n transition: opacity 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from,\n .modals-leave-to {\n opacity: 0;\n }\n\n .modals-enter-active :deep(.stash-modal__dialog--position-center),\n .modals-leave-active :deep(.stash-modal__dialog--position-center) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-center),\n .modals-leave-to :deep(.stash-modal__dialog--position-center) {\n transform: translateY(20px);\n }\n\n .modals-enter-active :deep(.stash-modal__dialog--is-drawer),\n .modals-leave-active :deep(.stash-modal__dialog--is-drawer) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-left),\n .modals-leave-to :deep(.stash-modal__dialog--position-left) {\n transform: translateX(-50px);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-right),\n .modals-leave-to :deep(.stash-modal__dialog--position-right) {\n transform: translateX(50px);\n }\n</style>\n"],"names":["modals","useModals","getListeners","modal","index","_a"],"mappings":";;;;;;;AAKE,UAAMA,IAASC;AAEN,aAAAC,EAAaC,GAA4BC,GAAe;;AAC3D,cAAAC,IAAAF,EAAM,YAAN,QAAAE,EAAe,0BACV,KAGF;AAAA,QACL,SAAS,MAAML,EAAO,MAAM,EAAE,OAAAI,GAAO;AAAA,QACrC,OAAO,MAAMJ,EAAO,MAAM,EAAE,OAAAI,GAAO;AAAA,QACnC,QAAQ,MAAMJ,EAAO,MAAM,EAAE,OAAAI,GAAO;AAAA,MAAA;AAAA,IAExC;;;;;;;;;;;;;;;;;;;"}
|
package/dist/Module.js
CHANGED
|
@@ -19,9 +19,9 @@ const y = /* @__PURE__ */ i({
|
|
|
19
19
|
a.variant === "card" && o.warn('Card Modules are no longer a thing. You\'re probably looking for `<RadioGroup variant="card">`.'), a.variant === "list" && o.warn("Only used with deprecated ListView component. Use `table` variant with `Table` component instead.");
|
|
20
20
|
}), s(w.key, { variant: d(() => a.variant) }), (n, f) => (p(), u(v, {
|
|
21
21
|
class: b(["stash-module tw-flex tw-flex-col", {
|
|
22
|
-
"tw-shadow-none lg:tw-shadow
|
|
22
|
+
"tw-bg-transparent tw-shadow-none lg:tw-shadow": a.variant === t(e).Table,
|
|
23
23
|
"tw-border tw-border-ice-500": a.variant === t(e).Card,
|
|
24
|
-
"tw-
|
|
24
|
+
"tw-mb-6 tw-bg-transparent tw-shadow-none lg:tw-shadow": a.variant === t(e).List
|
|
25
25
|
}]),
|
|
26
26
|
"data-test": "stash-module",
|
|
27
27
|
"disable-gutters": a.disableGutters,
|
package/dist/Module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Module.js","sources":["../src/components/Module/Module.vue"],"sourcesContent":["<script lang=\"ts\">\n import Box, { type BoxProps } from '../Box/Box.vue';\n import { ModuleVariant, type ModuleVariants } from './Module.types';\n\n export * from './Module.keys';\n export * from './Module.types';\n\n export interface ModuleProps extends BoxProps {\n /**\n * Variant applied.\n *\n * Options: `box`, `card`, `list`.\n */\n variant?: ModuleVariants;\n }\n</script>\n\n<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import { computed, onMounted, provide } from 'vue';\n\n import { MODULE_INJECTION } from './Module.keys';\n\n defineOptions({\n name: 'll-module',\n });\n\n const props = withDefaults(defineProps<ModuleProps>(), {\n variant: ModuleVariant.Box,\n });\n\n onMounted(() => {\n if (props.variant === 'card') {\n logger.warn('Card Modules are no longer a thing. You\\'re probably looking for `<RadioGroup variant=\"card\">`.');\n }\n\n if (props.variant === 'list') {\n logger.warn('Only used with deprecated ListView component. Use `table` variant with `Table` component instead.');\n }\n });\n\n provide(MODULE_INJECTION.key, { variant: computed(() => props.variant) });\n</script>\n\n<template>\n <Box\n class=\"stash-module tw-flex tw-flex-col\"\n data-test=\"stash-module\"\n :class=\"{\n 'tw-shadow-none lg:tw-shadow
|
|
1
|
+
{"version":3,"file":"Module.js","sources":["../src/components/Module/Module.vue"],"sourcesContent":["<script lang=\"ts\">\n import Box, { type BoxProps } from '../Box/Box.vue';\n import { ModuleVariant, type ModuleVariants } from './Module.types';\n\n export * from './Module.keys';\n export * from './Module.types';\n\n export interface ModuleProps extends BoxProps {\n /**\n * Variant applied.\n *\n * Options: `box`, `card`, `list`.\n */\n variant?: ModuleVariants;\n }\n</script>\n\n<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import { computed, onMounted, provide } from 'vue';\n\n import { MODULE_INJECTION } from './Module.keys';\n\n defineOptions({\n name: 'll-module',\n });\n\n const props = withDefaults(defineProps<ModuleProps>(), {\n variant: ModuleVariant.Box,\n });\n\n onMounted(() => {\n if (props.variant === 'card') {\n logger.warn('Card Modules are no longer a thing. You\\'re probably looking for `<RadioGroup variant=\"card\">`.');\n }\n\n if (props.variant === 'list') {\n logger.warn('Only used with deprecated ListView component. Use `table` variant with `Table` component instead.');\n }\n });\n\n provide(MODULE_INJECTION.key, { variant: computed(() => props.variant) });\n</script>\n\n<template>\n <Box\n class=\"stash-module tw-flex tw-flex-col\"\n data-test=\"stash-module\"\n :class=\"{\n 'tw-bg-transparent tw-shadow-none lg:tw-shadow': props.variant === ModuleVariant.Table,\n 'tw-border tw-border-ice-500': props.variant === ModuleVariant.Card,\n 'tw-mb-6 tw-bg-transparent tw-shadow-none lg:tw-shadow': props.variant === ModuleVariant.List,\n }\"\n :disable-gutters=\"props.disableGutters\"\n :disable-padding=\"props.disablePadding || ['card', 'list', 'table'].includes(props.variant)\"\n :disable-elevation=\"\n props.disableElevation ||\n props.variant === ModuleVariant.Table ||\n props.variant === ModuleVariant.Card ||\n props.variant === ModuleVariant.List\n \"\n >\n <slot></slot>\n </Box>\n</template>\n"],"names":["onMounted","props","logger","provide","MODULE_INJECTION","computed"],"mappings":";;;;;;;;;;;;;;;;;AA+BE,WAAAA,EAAU,MAAM;AACV,MAAAC,EAAM,YAAY,UACpBC,EAAO,KAAK,iGAAiG,GAG3GD,EAAM,YAAY,UACpBC,EAAO,KAAK,mGAAmG;AAAA,IACjH,CACD,GAEOC,EAAAC,EAAiB,KAAK,EAAE,SAASC,EAAS,MAAMJ,EAAM,OAAO,EAAA,CAAG;;;;;;;;;;;;;;;;;;"}
|
package/dist/ModuleContent.js
CHANGED
|
@@ -3,7 +3,7 @@ import { M as u } from "./Module.keys-2cc7d830.js";
|
|
|
3
3
|
import { M as n } from "./Module.types-3f78f2a0.js";
|
|
4
4
|
const _ = {
|
|
5
5
|
key: 0,
|
|
6
|
-
class: "stash-module-content__top-slots tw-flex tw-flex-wrap tw-
|
|
6
|
+
class: "stash-module-content__top-slots tw-flex tw-flex-wrap tw-items-center tw-justify-between",
|
|
7
7
|
"data-test": "stash-module-content|top-slots"
|
|
8
8
|
}, v = {
|
|
9
9
|
class: "tw-mb-6 tw-mr-6",
|
|
@@ -23,7 +23,7 @@ const _ = {
|
|
|
23
23
|
o.value = t.variant.value;
|
|
24
24
|
}), (t, C) => (a(), r("div", {
|
|
25
25
|
class: w(["stash-module-content tw-flex-1", {
|
|
26
|
-
"tw-px-3
|
|
26
|
+
"tw-px-3 tw-py-6 lg:tw-px-6": o.value === e(n).Card,
|
|
27
27
|
"tw-border-t tw-border-ice-200": o.value === e(n).Table || o.value === e(n).List
|
|
28
28
|
}]),
|
|
29
29
|
"data-test": "stash-module-content"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleContent.js","sources":["../src/components/ModuleContent/ModuleContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { inject, onBeforeMount, ref, useSlots } from 'vue';\n\n import { MODULE_INJECTION } from '../Module/Module.keys';\n import { ModuleVariant } from '../Module/Module.types';\n\n defineOptions({\n name: 'll-module-content',\n });\n\n const slots = useSlots();\n const moduleVariant = ref();\n\n onBeforeMount(() => {\n const moduleInjectedValues = inject(MODULE_INJECTION.key, MODULE_INJECTION.defaults);\n if (!moduleInjectedValues.variant) {\n throw new Error('ModuleContent must be used within a Module component.');\n }\n moduleVariant.value = moduleInjectedValues.variant.value;\n });\n</script>\n\n<template>\n <div\n class=\"stash-module-content tw-flex-1\"\n data-test=\"stash-module-content\"\n :class=\"{\n 'tw-px-3
|
|
1
|
+
{"version":3,"file":"ModuleContent.js","sources":["../src/components/ModuleContent/ModuleContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { inject, onBeforeMount, ref, useSlots } from 'vue';\n\n import { MODULE_INJECTION } from '../Module/Module.keys';\n import { ModuleVariant } from '../Module/Module.types';\n\n defineOptions({\n name: 'll-module-content',\n });\n\n const slots = useSlots();\n const moduleVariant = ref();\n\n onBeforeMount(() => {\n const moduleInjectedValues = inject(MODULE_INJECTION.key, MODULE_INJECTION.defaults);\n if (!moduleInjectedValues.variant) {\n throw new Error('ModuleContent must be used within a Module component.');\n }\n moduleVariant.value = moduleInjectedValues.variant.value;\n });\n</script>\n\n<template>\n <div\n class=\"stash-module-content tw-flex-1\"\n data-test=\"stash-module-content\"\n :class=\"{\n 'tw-px-3 tw-py-6 lg:tw-px-6': moduleVariant === ModuleVariant.Card,\n 'tw-border-t tw-border-ice-200': moduleVariant === ModuleVariant.Table || moduleVariant === ModuleVariant.List,\n }\"\n >\n <div\n v-if=\"slots['top-left'] || slots['top-right']\"\n class=\"stash-module-content__top-slots tw-flex tw-flex-wrap tw-items-center tw-justify-between\"\n data-test=\"stash-module-content|top-slots\"\n >\n <!--\n For styling purposes, we always render both slots. In the scenario where only a top-right is\n provided, the div wrappers ensure space-between works and puts top-right on the right side.\n -->\n <div class=\"tw-mb-6 tw-mr-6\" data-test=\"stash-module-content|top-left-slot\"><slot name=\"top-left\"></slot></div>\n <div class=\"tw-mb-6\" data-test=\"stash-module-content|top-right-slot\"><slot name=\"top-right\"></slot></div>\n </div>\n\n <slot></slot>\n </div>\n</template>\n"],"names":["slots","useSlots","moduleVariant","ref","onBeforeMount","moduleInjectedValues","inject","MODULE_INJECTION"],"mappings":";;;;;;;;;;;;;;;;;AAUE,UAAMA,IAAQC,KACRC,IAAgBC;AAEtB,WAAAC,EAAc,MAAM;AAClB,YAAMC,IAAuBC,EAAOC,EAAiB,KAAKA,EAAiB,QAAQ;AAC/E,UAAA,CAACF,EAAqB;AAClB,cAAA,IAAI,MAAM,uDAAuD;AAE3D,MAAAH,EAAA,QAAQG,EAAqB,QAAQ;AAAA,IAAA,CACpD;;;;;;;;;;;;;;;;;;;"}
|
package/dist/ModuleFooter.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as n, ref as l, onBeforeMount as u, inject as
|
|
1
|
+
import { defineComponent as n, ref as l, onBeforeMount as u, inject as d, openBlock as s, createElementBlock as w, normalizeClass as i, unref as o, renderSlot as p } from "vue";
|
|
2
2
|
import { M as a } from "./Module.keys-2cc7d830.js";
|
|
3
3
|
import { M as r } from "./Module.types-3f78f2a0.js";
|
|
4
4
|
const h = /* @__PURE__ */ n({
|
|
5
5
|
__name: "ModuleFooter",
|
|
6
6
|
setup(m) {
|
|
7
|
-
const
|
|
7
|
+
const e = l();
|
|
8
8
|
return u(() => {
|
|
9
|
-
const
|
|
10
|
-
if (!
|
|
9
|
+
const t = d(a.key, a.defaults);
|
|
10
|
+
if (!t.variant)
|
|
11
11
|
throw new Error("ModuleContent must be used within a Module component.");
|
|
12
|
-
|
|
13
|
-
}), (
|
|
14
|
-
class:
|
|
15
|
-
"tw-
|
|
16
|
-
"tw-
|
|
17
|
-
"tw-pt-3 lg:tw-pt-6
|
|
12
|
+
e.value = t.variant.value;
|
|
13
|
+
}), (t, f) => (s(), w("div", {
|
|
14
|
+
class: i(["stash-module-footer tw-flex tw-flex-wrap tw-justify-between", {
|
|
15
|
+
"tw-rounded-b tw-border-b tw-border-ice-500 tw-px-3 tw-pb-6 tw-pt-0 lg:tw-px-6": e.value === o(r).Card,
|
|
16
|
+
"tw-rounded tw-bg-white tw-p-3 tw-shadow lg:tw-rounded-t-none lg:tw-px-6 lg:tw-shadow-none": e.value === o(r).Table || e.value === o(r).List,
|
|
17
|
+
"tw-mb-0 tw-pt-3 lg:tw-pt-6": e.value === o(r).Box
|
|
18
18
|
}]),
|
|
19
19
|
"data-test": "stash-module-footer"
|
|
20
20
|
}, [
|
|
21
|
-
|
|
21
|
+
p(t.$slots, "default")
|
|
22
22
|
], 2));
|
|
23
23
|
}
|
|
24
24
|
});
|
package/dist/ModuleFooter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleFooter.js","sources":["../src/components/ModuleFooter/ModuleFooter.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { inject, onBeforeMount, ref } from 'vue';\n\n import { MODULE_INJECTION } from '../Module/Module.keys';\n import { ModuleVariant } from '../Module/Module.types';\n\n const moduleVariant = ref();\n\n onBeforeMount(() => {\n const moduleInjectedValues = inject(MODULE_INJECTION.key, MODULE_INJECTION.defaults);\n if (!moduleInjectedValues.variant) {\n throw new Error('ModuleContent must be used within a Module component.');\n }\n moduleVariant.value = moduleInjectedValues.variant.value;\n });\n</script>\n\n<template>\n <div\n class=\"stash-module-footer tw-flex tw-flex-wrap tw-justify-between\"\n :class=\"{\n 'tw-
|
|
1
|
+
{"version":3,"file":"ModuleFooter.js","sources":["../src/components/ModuleFooter/ModuleFooter.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { inject, onBeforeMount, ref } from 'vue';\n\n import { MODULE_INJECTION } from '../Module/Module.keys';\n import { ModuleVariant } from '../Module/Module.types';\n\n const moduleVariant = ref();\n\n onBeforeMount(() => {\n const moduleInjectedValues = inject(MODULE_INJECTION.key, MODULE_INJECTION.defaults);\n if (!moduleInjectedValues.variant) {\n throw new Error('ModuleContent must be used within a Module component.');\n }\n moduleVariant.value = moduleInjectedValues.variant.value;\n });\n</script>\n\n<template>\n <div\n class=\"stash-module-footer tw-flex tw-flex-wrap tw-justify-between\"\n :class=\"{\n 'tw-rounded-b tw-border-b tw-border-ice-500 tw-px-3 tw-pb-6 tw-pt-0 lg:tw-px-6':\n moduleVariant === ModuleVariant.Card,\n 'tw-rounded tw-bg-white tw-p-3 tw-shadow lg:tw-rounded-t-none lg:tw-px-6 lg:tw-shadow-none':\n moduleVariant === ModuleVariant.Table || moduleVariant === ModuleVariant.List,\n 'tw-mb-0 tw-pt-3 lg:tw-pt-6': moduleVariant === ModuleVariant.Box,\n }\"\n data-test=\"stash-module-footer\"\n >\n <slot></slot>\n </div>\n</template>\n"],"names":["moduleVariant","ref","onBeforeMount","moduleInjectedValues","inject","MODULE_INJECTION"],"mappings":";;;;;;AAME,UAAMA,IAAgBC;AAEtB,WAAAC,EAAc,MAAM;AAClB,YAAMC,IAAuBC,EAAOC,EAAiB,KAAKA,EAAiB,QAAQ;AAC/E,UAAA,CAACF,EAAqB;AAClB,cAAA,IAAI,MAAM,uDAAuD;AAE3D,MAAAH,EAAA,QAAQG,EAAqB,QAAQ;AAAA,IAAA,CACpD;;;;;;;;;;;;"}
|
package/dist/ModuleHeader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as v, useCssModule as g, useSlots as
|
|
1
|
+
import { defineComponent as v, useCssModule as g, useSlots as k, ref as y, onBeforeMount as x, inject as M, computed as w, openBlock as l, createElementBlock as r, normalizeClass as n, unref as a, createElementVNode as u, renderSlot as d, createCommentVNode as i, createBlock as B, resolveDynamicComponent as C, withCtx as V, createTextVNode as E, toDisplayString as h } from "vue";
|
|
2
2
|
import { M as p } from "./Module.keys-2cc7d830.js";
|
|
3
3
|
import { M as o } from "./Module.types-3f78f2a0.js";
|
|
4
4
|
import { _ as N } from "./_plugin-vue_export-helper-dad06003.js";
|
|
@@ -7,7 +7,7 @@ const T = { class: "tw-flex tw-items-center" }, $ = {
|
|
|
7
7
|
"data-test": "stash-module-header|content-text"
|
|
8
8
|
}, z = {
|
|
9
9
|
key: 0,
|
|
10
|
-
class: "tw-
|
|
10
|
+
class: "tw-mb-0 tw-mt-3"
|
|
11
11
|
}, L = /* @__PURE__ */ v({
|
|
12
12
|
name: "ll-module-header",
|
|
13
13
|
__name: "ModuleHeader",
|
|
@@ -19,7 +19,7 @@ const T = { class: "tw-flex tw-items-center" }, $ = {
|
|
|
19
19
|
underline: { type: Boolean, default: !1 }
|
|
20
20
|
},
|
|
21
21
|
setup(f) {
|
|
22
|
-
const t = f, _ = g(), c =
|
|
22
|
+
const t = f, _ = g(), c = k(), s = y();
|
|
23
23
|
x(() => {
|
|
24
24
|
const e = M(p.key, p.defaults);
|
|
25
25
|
if (!e.variant)
|
|
@@ -49,9 +49,9 @@ const T = { class: "tw-flex tw-items-center" }, $ = {
|
|
|
49
49
|
});
|
|
50
50
|
return (e, H) => (l(), r("header", {
|
|
51
51
|
class: n(["stash-module-header tw-flex tw-flex-wrap tw-justify-between", {
|
|
52
|
-
"tw-
|
|
53
|
-
"tw-
|
|
54
|
-
"tw-border-b tw-border-ice-200
|
|
52
|
+
"tw-rounded-t tw-border-b tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-px-6": s.value === a(o).Card,
|
|
53
|
+
"tw-mb-6 tw-rounded tw-bg-white tw-px-3 tw-pt-3 tw-shadow lg:tw-mb-0 lg:tw-rounded-b-none lg:tw-px-6 lg:tw-pt-6 lg:tw-shadow-none": s.value === a(o).Table || s.value === a(o).List,
|
|
54
|
+
"tw-mb-3 tw-border-b tw-border-ice-200 lg:tw-mb-6": t.underline
|
|
55
55
|
}]),
|
|
56
56
|
"data-test": "stash-module-header"
|
|
57
57
|
}, [
|
package/dist/ModuleHeader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleHeader.js","sources":["../src/components/ModuleHeader/ModuleHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, onBeforeMount, ref, useCssModule, useSlots } from 'vue';\n\n import { MODULE_INJECTION } from '../Module/Module.keys';\n import { ModuleVariant } from '../Module/Module.types';\n\n defineOptions({\n name: 'll-module-header',\n });\n\n export interface ModuleHeaderProps {\n /**\n * Header title. Will get overridden by the `title` slot if provided.\n */\n title?: string;\n\n /**\n * Size of the header.\n *\n * - `small` = `h4`\n * - `medium` = `h3`\n * - `large` = `h2`\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Header description, aka subtitle. Will get overridden by the `description` slot if provided.\n */\n description?: string;\n\n /**\n * Stop the actions slot from force-wrapping on medium and smalls screens.\n */\n preventActionsWrap?: boolean;\n\n /**\n * Displays a border at the bottom\n */\n underline?: boolean;\n }\n\n const props = withDefaults(defineProps<ModuleHeaderProps>(), {\n title: '',\n size: 'medium',\n description: '',\n preventActionsWrap: false,\n underline: false,\n });\n const classes = useCssModule();\n const slots = useSlots();\n const moduleVariant = ref();\n\n onBeforeMount(() => {\n const moduleInjectedValues = inject(MODULE_INJECTION.key, MODULE_INJECTION.defaults);\n if (!moduleInjectedValues.variant) {\n throw new Error('ModuleHeader must be used within a Module component.');\n }\n moduleVariant.value = moduleInjectedValues.variant.value;\n });\n\n const is = computed(() => {\n let component;\n\n switch (props.size) {\n case 'small':\n component = 'h4';\n break;\n\n case 'medium':\n component = 'h3';\n break;\n\n case 'large':\n component = 'h2';\n break;\n\n default:\n component = 'h3';\n break;\n }\n\n return component;\n });\n\n const marginBottomClasses = computed(() => {\n const isBoxOrTableOrList =\n moduleVariant.value === ModuleVariant.Box ||\n moduleVariant.value === ModuleVariant.Table ||\n moduleVariant.value === ModuleVariant.List;\n\n if (isBoxOrTableOrList && !props.underline) {\n return 'tw-mb-3 lg:tw-mb-6';\n } else if (isBoxOrTableOrList && props.underline) {\n return 'tw-mb-3';\n } else {\n return '';\n }\n });\n</script>\n\n<template>\n <header\n class=\"stash-module-header tw-flex tw-flex-wrap tw-justify-between\"\n :class=\"{\n 'tw-
|
|
1
|
+
{"version":3,"file":"ModuleHeader.js","sources":["../src/components/ModuleHeader/ModuleHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, onBeforeMount, ref, useCssModule, useSlots } from 'vue';\n\n import { MODULE_INJECTION } from '../Module/Module.keys';\n import { ModuleVariant } from '../Module/Module.types';\n\n defineOptions({\n name: 'll-module-header',\n });\n\n export interface ModuleHeaderProps {\n /**\n * Header title. Will get overridden by the `title` slot if provided.\n */\n title?: string;\n\n /**\n * Size of the header.\n *\n * - `small` = `h4`\n * - `medium` = `h3`\n * - `large` = `h2`\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Header description, aka subtitle. Will get overridden by the `description` slot if provided.\n */\n description?: string;\n\n /**\n * Stop the actions slot from force-wrapping on medium and smalls screens.\n */\n preventActionsWrap?: boolean;\n\n /**\n * Displays a border at the bottom\n */\n underline?: boolean;\n }\n\n const props = withDefaults(defineProps<ModuleHeaderProps>(), {\n title: '',\n size: 'medium',\n description: '',\n preventActionsWrap: false,\n underline: false,\n });\n const classes = useCssModule();\n const slots = useSlots();\n const moduleVariant = ref();\n\n onBeforeMount(() => {\n const moduleInjectedValues = inject(MODULE_INJECTION.key, MODULE_INJECTION.defaults);\n if (!moduleInjectedValues.variant) {\n throw new Error('ModuleHeader must be used within a Module component.');\n }\n moduleVariant.value = moduleInjectedValues.variant.value;\n });\n\n const is = computed(() => {\n let component;\n\n switch (props.size) {\n case 'small':\n component = 'h4';\n break;\n\n case 'medium':\n component = 'h3';\n break;\n\n case 'large':\n component = 'h2';\n break;\n\n default:\n component = 'h3';\n break;\n }\n\n return component;\n });\n\n const marginBottomClasses = computed(() => {\n const isBoxOrTableOrList =\n moduleVariant.value === ModuleVariant.Box ||\n moduleVariant.value === ModuleVariant.Table ||\n moduleVariant.value === ModuleVariant.List;\n\n if (isBoxOrTableOrList && !props.underline) {\n return 'tw-mb-3 lg:tw-mb-6';\n } else if (isBoxOrTableOrList && props.underline) {\n return 'tw-mb-3';\n } else {\n return '';\n }\n });\n</script>\n\n<template>\n <header\n class=\"stash-module-header tw-flex tw-flex-wrap tw-justify-between\"\n :class=\"{\n 'tw-rounded-t tw-border-b tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-px-6':\n moduleVariant === ModuleVariant.Card,\n 'tw-mb-6 tw-rounded tw-bg-white tw-px-3 tw-pt-3 tw-shadow lg:tw-mb-0 lg:tw-rounded-b-none lg:tw-px-6 lg:tw-pt-6 lg:tw-shadow-none':\n moduleVariant === ModuleVariant.Table || moduleVariant === ModuleVariant.List,\n 'tw-mb-3 tw-border-b tw-border-ice-200 lg:tw-mb-6': props.underline,\n }\"\n data-test=\"stash-module-header\"\n >\n <div\n class=\"stash-module-header__content tw-mr-6\"\n :class=\"marginBottomClasses\"\n data-test=\"stash-module-header|content\"\n >\n <div class=\"tw-flex tw-items-center\">\n <div\n v-if=\"slots.media && props.size === 'large'\"\n class=\"stash-module-header__content__media tw-mr-3\"\n :class=\"classes.media\"\n data-test=\"stash-module-header|content-media\"\n >\n <slot name=\"media\"></slot>\n </div>\n\n <div class=\"stash-module-header__content__text\" data-test=\"stash-module-header|content-text\">\n <!--\n @slot Header title\n @type String\n @default HTML header element with the `title` prop as the text.\n TODO: this doesn't work...\n -->\n <slot name=\"title\">\n <component :is=\"is\" v-if=\"props.title\" class=\"tw-my-0\">{{ props.title }}</component>\n </slot>\n\n <!--\n @slot Header title\n @type String\n @default HTML <p> element with the `description` prop as the text.\n -->\n <slot name=\"description\">\n <p v-if=\"props.description\" class=\"tw-mb-0 tw-mt-3\">{{ props.description }}</p>\n </slot>\n </div>\n </div>\n </div>\n\n <!-- todo: how can we pass a prop/class to actions in order to top align vs middle align? -->\n <div\n v-if=\"slots.actions\"\n class=\"stash-module-header__actions tw-self-center\"\n :class=\"[\n marginBottomClasses,\n {\n 'tw-w-full lg:tw-w-auto': !props.preventActionsWrap,\n },\n ]\"\n data-test=\"stash-module-header|actions\"\n >\n <slot name=\"actions\"></slot>\n </div>\n </header>\n</template>\n\n<style module>\n /* max size for media/marketing illustration icons we would be passing to the slot */\n .media {\n max-height: 58px;\n max-width: 58px;\n }\n</style>\n"],"names":["classes","useCssModule","slots","useSlots","moduleVariant","ref","onBeforeMount","moduleInjectedValues","inject","MODULE_INJECTION","is","computed","component","props","marginBottomClasses","isBoxOrTableOrList","ModuleVariant"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAgDQA,IAAUC,KACVC,IAAQC,KACRC,IAAgBC;AAEtB,IAAAC,EAAc,MAAM;AAClB,YAAMC,IAAuBC,EAAOC,EAAiB,KAAKA,EAAiB,QAAQ;AAC/E,UAAA,CAACF,EAAqB;AAClB,cAAA,IAAI,MAAM,sDAAsD;AAE1D,MAAAH,EAAA,QAAQG,EAAqB,QAAQ;AAAA,IAAA,CACpD;AAEK,UAAAG,IAAKC,EAAS,MAAM;AACpB,UAAAC;AAEJ,cAAQC,EAAM,MAAM;AAAA,QAClB,KAAK;AACS,UAAAD,IAAA;AACZ;AAAA,QAEF,KAAK;AACS,UAAAA,IAAA;AACZ;AAAA,QAEF,KAAK;AACS,UAAAA,IAAA;AACZ;AAAA,QAEF;AACc,UAAAA,IAAA;AACZ;AAAA,MACJ;AAEO,aAAAA;AAAA,IAAA,CACR,GAEKE,IAAsBH,EAAS,MAAM;AACnC,YAAAI,IACJX,EAAc,UAAUY,EAAc,OACtCZ,EAAc,UAAUY,EAAc,SACtCZ,EAAc,UAAUY,EAAc;AAEpC,aAAAD,KAAsB,CAACF,EAAM,YACxB,uBACEE,KAAsBF,EAAM,YAC9B,YAEA;AAAA,IACT,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/ObfuscateText.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
1
|
+
import { defineComponent as r, ref as u, computed as c, openBlock as s, createElementBlock as i, createTextVNode as p, toDisplayString as f, createBlock as h, withCtx as m, createVNode as d, normalizeClass as g, createCommentVNode as x } from "vue";
|
|
2
|
+
import C from "./Button.js";
|
|
3
|
+
import b from "./Icon.js";
|
|
4
|
+
import "./Button.vue_used_vue_type_style_index_0_lang.module-63d31dc0.js";
|
|
5
|
+
import "./_plugin-vue_export-helper-dad06003.js";
|
|
6
6
|
import "lodash-es/uniqueId";
|
|
7
7
|
import "./index-79ce320f.js";
|
|
8
8
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
9
|
-
const
|
|
9
|
+
const k = {
|
|
10
|
+
class: "stash-obfuscate-text",
|
|
11
|
+
"data-test": "stash-obfuscate-text"
|
|
12
|
+
}, A = /* @__PURE__ */ r({
|
|
10
13
|
name: "ll-obfuscate-text",
|
|
11
14
|
__name: "ObfuscateText",
|
|
12
15
|
props: {
|
|
@@ -18,42 +21,37 @@ const N = /* @__PURE__ */ g({
|
|
|
18
21
|
obfuscateAll: { type: Boolean, default: !1 },
|
|
19
22
|
showToggle: { type: Boolean, default: !1 }
|
|
20
23
|
},
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return l.repeat(n);
|
|
24
|
+
setup(l) {
|
|
25
|
+
const t = l, e = u(!1), n = c(() => {
|
|
26
|
+
if (t.showToggle && e.value)
|
|
27
|
+
return t.text;
|
|
28
|
+
if (t.obfuscateAll || !t.lengthToKeep)
|
|
29
|
+
return t.maskChar.repeat(t.maskCharCount);
|
|
28
30
|
let o;
|
|
29
|
-
return
|
|
31
|
+
return t.position === "end" ? (o = t.text.substring(0, t.lengthToKeep), o + t.maskChar.repeat(t.maskCharCount)) : (o = t.text.substring(t.text.length - t.lengthToKeep), t.maskChar.repeat(t.maskCharCount) + o);
|
|
30
32
|
});
|
|
31
|
-
return (
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
return (o, a) => (s(), i("span", k, [
|
|
34
|
+
p(f(n.value) + " ", 1),
|
|
35
|
+
o.showToggle ? (s(), h(C, {
|
|
34
36
|
key: 0,
|
|
35
|
-
class:
|
|
37
|
+
class: "tw-ml-1 tw-h-auto tw-w-auto tw-p-0",
|
|
36
38
|
icon: "",
|
|
37
39
|
type: "button",
|
|
38
|
-
onClick:
|
|
40
|
+
onClick: a[0] || (a[0] = (w) => e.value = !e.value)
|
|
39
41
|
}, {
|
|
40
|
-
default:
|
|
41
|
-
|
|
42
|
-
name:
|
|
43
|
-
class: "cursor-pointer",
|
|
44
|
-
"data-test":
|
|
45
|
-
}, null, 8, ["name", "data-test"])
|
|
42
|
+
default: m(() => [
|
|
43
|
+
d(b, {
|
|
44
|
+
name: e.value ? "hide" : "show",
|
|
45
|
+
class: g(["tw-cursor-pointer", e.value ? "stash-obfuscate-text__hide-toggle-icon" : "stash-obfuscate-text__show-toggle-icon"]),
|
|
46
|
+
"data-test": e.value ? "stash-obfuscate-text|hide-toggle-icon" : "stash-obfuscate-text|show-toggle-icon"
|
|
47
|
+
}, null, 8, ["name", "class", "data-test"])
|
|
46
48
|
]),
|
|
47
49
|
_: 1
|
|
48
|
-
}
|
|
50
|
+
})) : x("", !0)
|
|
49
51
|
]));
|
|
50
52
|
}
|
|
51
|
-
})
|
|
52
|
-
"obfuscation-toggle-button": "_obfuscation-toggle-button_16egb_2"
|
|
53
|
-
}, O = {
|
|
54
|
-
$style: A
|
|
55
|
-
}, q = /* @__PURE__ */ M(N, [["__cssModules", O]]);
|
|
53
|
+
});
|
|
56
54
|
export {
|
|
57
|
-
|
|
55
|
+
A as default
|
|
58
56
|
};
|
|
59
57
|
//# sourceMappingURL=ObfuscateText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObfuscateText.js","sources":["../src/components/ObfuscateText/ObfuscateText.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref
|
|
1
|
+
{"version":3,"file":"ObfuscateText.js","sources":["../src/components/ObfuscateText/ObfuscateText.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref } from 'vue';\n\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({ name: 'll-obfuscate-text' });\n\n export interface ObfuscateTextProps {\n /**\n * The full text\n */\n text: string;\n\n /**\n * Character to obfuscate text with\n */\n maskChar?: string;\n\n /**\n * The number of masked characters to display\n */\n maskCharCount?: number;\n\n /**\n * Num of characters to keep revealed.\n * Default will obfuscate entire string\n * with length of maskCharCount.\n */\n lengthToKeep?: number;\n\n /**\n * Position to start obfuscating text\n */\n position?: 'start' | 'end';\n\n /**\n * Whether to obfuscate all characters.\n * @deprecated omit the lengthToKeep prop to achieve the same result\n */\n obfuscateAll?: boolean;\n\n /**\n * Displays a button for toggling text visibility\n */\n showToggle?: boolean;\n }\n\n const isFullTextVisible = ref(false);\n\n const props = withDefaults(defineProps<ObfuscateTextProps>(), {\n maskChar: '•',\n maskCharCount: 10,\n lengthToKeep: 0,\n position: 'start',\n obfuscateAll: false,\n showToggle: false,\n });\n\n const obfuscatedText = computed(() => {\n if (props.showToggle && isFullTextVisible.value) {\n return props.text;\n }\n\n if (props.obfuscateAll || !props.lengthToKeep) {\n return props.maskChar.repeat(props.maskCharCount);\n }\n\n let charsToKeep;\n\n if (props.position === 'end') {\n charsToKeep = props.text.substring(0, props.lengthToKeep);\n\n return charsToKeep + props.maskChar.repeat(props.maskCharCount);\n } else {\n charsToKeep = props.text.substring(props.text.length - props.lengthToKeep);\n\n return props.maskChar.repeat(props.maskCharCount) + charsToKeep;\n }\n });\n</script>\n\n<template>\n <span class=\"stash-obfuscate-text\" data-test=\"stash-obfuscate-text\">\n {{ obfuscatedText }}\n <Button\n v-if=\"showToggle\"\n class=\"tw-ml-1 tw-h-auto tw-w-auto tw-p-0\"\n icon\n type=\"button\"\n @click=\"isFullTextVisible = !isFullTextVisible\"\n >\n <Icon\n :name=\"isFullTextVisible ? 'hide' : 'show'\"\n class=\"tw-cursor-pointer\"\n :class=\"isFullTextVisible ? 'stash-obfuscate-text__hide-toggle-icon' : 'stash-obfuscate-text__show-toggle-icon'\"\n :data-test=\"\n isFullTextVisible ? 'stash-obfuscate-text|hide-toggle-icon' : 'stash-obfuscate-text|show-toggle-icon'\n \"\n />\n </Button>\n </span>\n</template>\n"],"names":["isFullTextVisible","ref","obfuscatedText","computed","props","charsToKeep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;iBAgDQA,IAAoBC,EAAI,EAAK,GAW7BC,IAAiBC,EAAS,MAAM;AAChC,UAAAC,EAAM,cAAcJ,EAAkB;AACxC,eAAOI,EAAM;AAGf,UAAIA,EAAM,gBAAgB,CAACA,EAAM;AAC/B,eAAOA,EAAM,SAAS,OAAOA,EAAM,aAAa;AAG9C,UAAAC;AAEA,aAAAD,EAAM,aAAa,SACrBC,IAAcD,EAAM,KAAK,UAAU,GAAGA,EAAM,YAAY,GAEjDC,IAAcD,EAAM,SAAS,OAAOA,EAAM,aAAa,MAE9DC,IAAcD,EAAM,KAAK,UAAUA,EAAM,KAAK,SAASA,EAAM,YAAY,GAElEA,EAAM,SAAS,OAAOA,EAAM,aAAa,IAAIC;AAAA,IACtD,CACD;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -75,7 +75,7 @@ export declare interface ObfuscateTextProps {
|
|
|
75
75
|
*/
|
|
76
76
|
position?: 'start' | 'end';
|
|
77
77
|
/**
|
|
78
|
-
* Whether
|
|
78
|
+
* Whether to obfuscate all characters.
|
|
79
79
|
* @deprecated omit the lengthToKeep prop to achieve the same result
|
|
80
80
|
*/
|
|
81
81
|
obfuscateAll?: boolean;
|