@leaflink/stash 52.0.2 → 53.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -49
- package/dist/Accordion.js +16 -16
- package/dist/Accordion.js.map +1 -1
- package/dist/AccordionGroup.js +7 -7
- package/dist/AccordionGroup.js.map +1 -1
- package/dist/ActionsDropdown.js +16 -16
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/AddressSelect.js.map +1 -1
- package/dist/AddressSelect.vue.d.ts +1 -1
- package/dist/Alert.js +34 -34
- package/dist/Alert.js.map +1 -1
- package/dist/AppNavigationItem.js +31 -31
- package/dist/AppNavigationItem.js.map +1 -1
- package/dist/AppSidebar.js +19 -19
- package/dist/AppSidebar.js.map +1 -1
- package/dist/AppTopbar.js +32 -32
- package/dist/AppTopbar.js.map +1 -1
- package/dist/Avatar.js +18 -18
- package/dist/Avatar.js.map +1 -1
- package/dist/Backdrop.js +5 -5
- package/dist/Backdrop.js.map +1 -1
- package/dist/Badge.js +38 -38
- package/dist/Badge.js.map +1 -1
- package/dist/Box.js +1 -1
- package/dist/{Box.vue_vue_type_script_setup_true_lang-rFnvwLVY.js → Box.vue_vue_type_script_setup_true_lang-dFFZN40_.js} +6 -6
- package/dist/{Box.vue_vue_type_script_setup_true_lang-rFnvwLVY.js.map → Box.vue_vue_type_script_setup_true_lang-dFFZN40_.js.map} +1 -1
- package/dist/Button.js +21 -21
- package/dist/Button.js.map +1 -1
- package/dist/ButtonGroup.js +26 -26
- package/dist/ButtonGroup.js.map +1 -1
- package/dist/Card.js +14 -14
- package/dist/Card.js.map +1 -1
- package/dist/CardContent.js +1 -1
- package/dist/CardContent.js.map +1 -1
- package/dist/CardFooter.js +1 -1
- package/dist/CardFooter.js.map +1 -1
- package/dist/CardHeader.js +4 -4
- package/dist/CardHeader.js.map +1 -1
- package/dist/CardMedia.js +20 -20
- package/dist/CardMedia.js.map +1 -1
- package/dist/Carousel.js +88 -93
- package/dist/Carousel.js.map +1 -1
- package/dist/Checkbox.js +30 -30
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox.vue.d.ts +0 -3
- package/dist/Chip.js +33 -33
- package/dist/Chip.js.map +1 -1
- package/dist/ConfirmationCodeInput.js +72 -72
- package/dist/ConfirmationCodeInput.js.map +1 -1
- package/dist/ContextSwitcher.js +27 -27
- package/dist/ContextSwitcher.js.map +1 -1
- package/dist/Copy.js +47 -48
- package/dist/Copy.js.map +1 -1
- package/dist/CurrencyInput.js +1 -1
- package/dist/CurrencyInput.js.map +1 -1
- package/dist/CurrencyInput.vue.d.ts +5 -5
- package/dist/DataView.js +23 -23
- package/dist/DataView.js.map +1 -1
- package/dist/DataViewFilters.js +26 -26
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/DataViewSortButton.js +22 -22
- package/dist/DataViewSortButton.js.map +1 -1
- package/dist/DataViewToolbar.js +52 -52
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DatePicker.js +10 -10
- package/dist/DatePicker.js.map +1 -1
- package/dist/DescriptionList.js +2 -2
- package/dist/DescriptionList.js.map +1 -1
- package/dist/DescriptionListDetail.js +2 -2
- package/dist/DescriptionListDetail.js.map +1 -1
- package/dist/DescriptionListGroup.js +9 -9
- package/dist/DescriptionListGroup.js.map +1 -1
- package/dist/DescriptionListTerm.js +8 -8
- package/dist/DescriptionListTerm.js.map +1 -1
- package/dist/Dialog.js +47 -47
- package/dist/Dialog.js.map +1 -1
- package/dist/Divider.js +6 -6
- package/dist/Divider.js.map +1 -1
- package/dist/Dropdown.js +20 -20
- package/dist/Dropdown.js.map +1 -1
- package/dist/EmptyState.js +26 -26
- package/dist/EmptyState.js.map +1 -1
- package/dist/Field.js +1 -1
- package/dist/{Field.vue_vue_type_script_setup_true_lang-DI6z3AE9.js → Field.vue_vue_type_script_setup_true_lang-dAGKfjf5.js} +17 -17
- package/dist/Field.vue_vue_type_script_setup_true_lang-dAGKfjf5.js.map +1 -0
- package/dist/FileUpload.js +47 -49
- package/dist/FileUpload.js.map +1 -1
- package/dist/FilterChip.js +20 -20
- package/dist/FilterChip.js.map +1 -1
- package/dist/FilterDrawerItem.js +13 -13
- package/dist/FilterDrawerItem.js.map +1 -1
- package/dist/FilterDropdown.js +27 -27
- package/dist/FilterDropdown.js.map +1 -1
- package/dist/FilterSelect.js +33 -33
- package/dist/FilterSelect.js.map +1 -1
- package/dist/Filters.js +29 -29
- package/dist/Filters.js.map +1 -1
- package/dist/Filters.vue.d.ts +2 -8
- package/dist/HttpError.js +29 -29
- package/dist/HttpError.js.map +1 -1
- package/dist/HttpError.vue.d.ts +0 -3
- package/dist/Icon.js +12 -12
- package/dist/Icon.js.map +1 -1
- package/dist/IconLabel.js +19 -19
- package/dist/IconLabel.js.map +1 -1
- package/dist/IconLabel.vue.d.ts +1 -1
- package/dist/Illustration.js +2 -2
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-BrqEF8xe.js → Illustration.vue_vue_type_script_setup_true_lang-C1bPkWZZ.js} +4 -4
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-BrqEF8xe.js.map → Illustration.vue_vue_type_script_setup_true_lang-C1bPkWZZ.js.map} +1 -1
- package/dist/Image.js +2 -2
- package/dist/Image.vue.d.ts +0 -3
- package/dist/{Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js → Image.vue_vue_type_script_setup_true_lang-CAj0FH9h.js} +11 -11
- package/dist/Image.vue_vue_type_script_setup_true_lang-CAj0FH9h.js.map +1 -0
- package/dist/InlineEdit.js +8 -8
- package/dist/InlineEdit.js.map +1 -1
- package/dist/Input.js +29 -29
- package/dist/Input.js.map +1 -1
- package/dist/InputOptions.js +87 -84
- package/dist/InputOptions.js.map +1 -1
- package/dist/InputOptions.vue.d.ts +2 -2
- package/dist/IntegrationIcon.js +11 -11
- package/dist/IntegrationIcon.js.map +1 -1
- package/dist/Label.js +1 -1
- package/dist/{Label.vue_vue_type_script_setup_true_lang-CNquF3AP.js → Label.vue_vue_type_script_setup_true_lang-xwY3X-iV.js} +16 -16
- package/dist/{Label.vue_vue_type_script_setup_true_lang-CNquF3AP.js.map → Label.vue_vue_type_script_setup_true_lang-xwY3X-iV.js.map} +1 -1
- package/dist/ListItem.js +14 -14
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItem.vue.d.ts +0 -6
- package/dist/ListItemCell.js +9 -9
- package/dist/ListItemCell.js.map +1 -1
- package/dist/ListView.js +138 -141
- package/dist/ListView.js.map +1 -1
- package/dist/ListView.vue.d.ts +2 -26
- package/dist/Loading.js +8 -8
- package/dist/Loading.js.map +1 -1
- package/dist/Logo.js +1 -1
- package/dist/{Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js → Logo.vue_vue_type_script_setup_true_lang-DghNC_k6.js} +3 -3
- package/dist/{Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js.map → Logo.vue_vue_type_script_setup_true_lang-DghNC_k6.js.map} +1 -1
- package/dist/Menu.js +5 -5
- package/dist/Menu.js.map +1 -1
- package/dist/MenuItem.js +12 -12
- package/dist/MenuItem.js.map +1 -1
- package/dist/Metric.js +24 -24
- package/dist/Metric.js.map +1 -1
- package/dist/Modal.js +60 -60
- package/dist/Modal.js.map +1 -1
- package/dist/Modals.js +1 -1
- package/dist/Modals.js.map +1 -1
- package/dist/Module.js +6 -6
- package/dist/Module.js.map +1 -1
- package/dist/ModuleContent.js +16 -16
- package/dist/ModuleContent.js.map +1 -1
- package/dist/ModuleFooter.js +13 -13
- package/dist/ModuleFooter.js.map +1 -1
- package/dist/ModuleHeader.js +29 -29
- package/dist/ModuleHeader.js.map +1 -1
- package/dist/MoreActions.js +81 -84
- package/dist/MoreActions.js.map +1 -1
- package/dist/ObfuscateText.js +4 -4
- package/dist/ObfuscateText.js.map +1 -1
- package/dist/PageContent.js +13 -13
- package/dist/PageContent.js.map +1 -1
- package/dist/PageHeader.js +28 -28
- package/dist/PageHeader.js.map +1 -1
- package/dist/PageNavigation.js +1 -1
- package/dist/Paginate.js +45 -45
- package/dist/Paginate.js.map +1 -1
- package/dist/QuickAction.js +18 -18
- package/dist/QuickAction.js.map +1 -1
- package/dist/Radio.js +17 -17
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js +158 -154
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioNew.js +80 -80
- package/dist/RadioNew.js.map +1 -1
- package/dist/RadioNew.vue.d.ts +0 -3
- package/dist/RangeInput.js +2 -2
- package/dist/RangeInput.js.map +1 -1
- package/dist/SearchBar.js +9 -9
- package/dist/SearchBar.js.map +1 -1
- package/dist/SectionHeader.js +14 -14
- package/dist/SectionHeader.js.map +1 -1
- package/dist/Select.js +369 -366
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +26 -27
- package/dist/SelectStatus.js.map +1 -1
- package/dist/Skeleton.js +20 -20
- package/dist/Skeleton.js.map +1 -1
- package/dist/Step.js +37 -40
- package/dist/Step.js.map +1 -1
- package/dist/Stepper.js +17 -17
- package/dist/Stepper.js.map +1 -1
- package/dist/Switch.js +57 -57
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.js +17 -19
- package/dist/Tab.js.map +1 -1
- package/dist/TabPanel.js +1 -1
- package/dist/TabPanel.js.map +1 -1
- package/dist/Table.js +22 -22
- package/dist/Table.js.map +1 -1
- package/dist/TableCell.js +32 -32
- package/dist/TableCell.js.map +1 -1
- package/dist/TableHeaderCell.js +35 -35
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/TableHeaderRow.js +10 -10
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableRow.js +51 -51
- package/dist/TableRow.js.map +1 -1
- package/dist/Tabs.js +2 -2
- package/dist/{Tabs.vue_vue_type_script_setup_true_lang-B3Irnlcd.js → Tabs.vue_vue_type_script_setup_true_lang-BVTCcK6M.js} +33 -33
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-BVTCcK6M.js.map +1 -0
- package/dist/TextEditor.js +8 -8
- package/dist/TextEditor.js.map +1 -1
- package/dist/Textarea.js +15 -15
- package/dist/Textarea.js.map +1 -1
- package/dist/Thumbnail.js +41 -41
- package/dist/Thumbnail.js.map +1 -1
- package/dist/ThumbnailEmpty.js +3 -3
- package/dist/ThumbnailEmpty.js.map +1 -1
- package/dist/ThumbnailGroup.js +22 -22
- package/dist/ThumbnailGroup.js.map +1 -1
- package/dist/Timeline.js +3 -3
- package/dist/Timeline.js.map +1 -1
- package/dist/TimelineItem.js +22 -22
- package/dist/TimelineItem.js.map +1 -1
- package/dist/Toast.js +29 -29
- package/dist/Toast.js.map +1 -1
- package/dist/Toast.vue.d.ts +3 -0
- package/dist/Toasts.js +11 -11
- package/dist/Toasts.js.map +1 -1
- package/dist/Tooltip.js +2 -81
- package/dist/Tooltip.js.map +1 -1
- package/dist/Tooltip.vue.d.ts +1 -1
- package/dist/Tooltip.vue_vue_type_script_setup_true_lang-mzBLSXy3.js +84 -0
- package/dist/Tooltip.vue_vue_type_script_setup_true_lang-mzBLSXy3.js.map +1 -0
- package/dist/components.css +2 -2
- package/dist/constants.d.ts +9 -9
- package/dist/constants.js +17 -17
- package/dist/constants.js.map +1 -1
- package/dist/directives/tooltip.js +2 -2
- package/dist/directives/tooltip.js.map +1 -1
- package/dist/{index-C14LhAwV.js → index-DBV9Uz0C.js} +3 -3
- package/dist/{index-C14LhAwV.js.map → index-DBV9Uz0C.js.map} +1 -1
- package/dist/tailwind-base.js.d.ts +12 -0
- package/dist/tailwind-base.js.map +1 -1
- package/dist/useSortable.js +1 -1
- package/dist/utils/helpers.js +15 -15
- package/dist/utils/helpers.js.map +1 -1
- package/package.json +15 -15
- package/styles/backwards-compat.css +373 -2851
- package/styles/main.css +8 -0
- package/styles/sofia-font.css +23 -27
- package/styles/theme.css +1033 -0
- package/dist/Field.vue_vue_type_script_setup_true_lang-DI6z3AE9.js.map +0 -1
- package/dist/Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js.map +0 -1
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-B3Irnlcd.js.map +0 -1
- package/dist/tailwind-base.d.ts +0 -333
- package/styles/base.css +0 -902
- package/tailwind-base.ts +0 -455
package/dist/Filters.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { resolveComponent as V, createElementBlock as _, openBlock as u, createElementVNode as k, Fragment as
|
|
1
|
+
import H from "lodash-es/cloneDeep";
|
|
2
|
+
import G from "lodash-es/merge";
|
|
3
|
+
import { resolveComponent as V, createElementBlock as _, openBlock as u, createElementVNode as k, Fragment as P, renderList as w, createCommentVNode as S, normalizeClass as L, createBlock as f, mergeProps as b, resolveDynamicComponent as v, createSlots as W, withCtx as y, createVNode as O, createTextVNode as U, toDisplayString as D, nextTick as z, toRefs as Y, ref as R } from "vue";
|
|
4
4
|
import q from "./useValidation.js";
|
|
5
|
-
import { LLLV_CHANGE_TRIGGERS as
|
|
6
|
-
import { t as
|
|
7
|
-
import { persistentStorage as
|
|
5
|
+
import { LLLV_CHANGE_TRIGGERS as A } from "./constants.js";
|
|
6
|
+
import { t as M } from "./locale.js";
|
|
7
|
+
import { persistentStorage as N } from "./storage.js";
|
|
8
8
|
import J from "./Button.js";
|
|
9
9
|
import K from "./Checkbox.js";
|
|
10
10
|
import Q from "./DatePicker.js";
|
|
@@ -14,7 +14,7 @@ import I from "./Radio.js";
|
|
|
14
14
|
import $ from "./Select.js";
|
|
15
15
|
import { _ as ee } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
16
16
|
const te = {
|
|
17
|
-
"filter-button-group": "_filter-button-
|
|
17
|
+
"filter-button-group": "_filter-button-group_i1lu1_5"
|
|
18
18
|
}, le = {
|
|
19
19
|
name: "ll-filters",
|
|
20
20
|
components: {
|
|
@@ -59,7 +59,7 @@ const te = {
|
|
|
59
59
|
},
|
|
60
60
|
emits: ["change", "submit", "reset"],
|
|
61
61
|
setup(l) {
|
|
62
|
-
const { validationSchema: r } = Y(l), i = r.value(), s =
|
|
62
|
+
const { validationSchema: r } = Y(l), i = r.value(), s = R({}), t = R();
|
|
63
63
|
function o() {
|
|
64
64
|
if ((i == null ? void 0 : i.toString()) !== "[object Object]")
|
|
65
65
|
return;
|
|
@@ -75,8 +75,8 @@ const te = {
|
|
|
75
75
|
},
|
|
76
76
|
data() {
|
|
77
77
|
return {
|
|
78
|
-
applyText:
|
|
79
|
-
clearText:
|
|
78
|
+
applyText: M("ll.apply"),
|
|
79
|
+
clearText: M("ll.clear"),
|
|
80
80
|
filters: {},
|
|
81
81
|
filterValues: {},
|
|
82
82
|
forceRenderCount: 0
|
|
@@ -126,7 +126,7 @@ const te = {
|
|
|
126
126
|
}
|
|
127
127
|
},
|
|
128
128
|
async created() {
|
|
129
|
-
this.initFilterValues(), await z(), this.initValidation(), this.applyFilters({ trigger:
|
|
129
|
+
this.initFilterValues(), await z(), this.initValidation(), this.applyFilters({ trigger: A.LOAD });
|
|
130
130
|
},
|
|
131
131
|
methods: {
|
|
132
132
|
initFilterValues() {
|
|
@@ -143,7 +143,7 @@ const te = {
|
|
|
143
143
|
* @param {object} [options] - optional parameters
|
|
144
144
|
* @param {string} [options.trigger] - the action that triggered this function call
|
|
145
145
|
*/
|
|
146
|
-
async applyFilters({ trigger: l =
|
|
146
|
+
async applyFilters({ trigger: l = A.APPLY } = {}) {
|
|
147
147
|
this.validation && (await this.validation.validate(), this.validation.hasErrors) || (this.disablePersistency || this.persistFilterValues(this.filterValues), this.$emit("submit", { trigger: l }));
|
|
148
148
|
},
|
|
149
149
|
resetFilters() {
|
|
@@ -161,7 +161,7 @@ const te = {
|
|
|
161
161
|
* Intended for external use, when filter values need to be set for the user
|
|
162
162
|
*/
|
|
163
163
|
setFilterValues(l) {
|
|
164
|
-
this.filterValues =
|
|
164
|
+
this.filterValues = G({}, this.filterValues, l), this.forceRenderCount++;
|
|
165
165
|
},
|
|
166
166
|
updateValidationValues() {
|
|
167
167
|
const l = Object.keys(this.validationSchema());
|
|
@@ -191,27 +191,27 @@ const te = {
|
|
|
191
191
|
* @returns {any}
|
|
192
192
|
*/
|
|
193
193
|
getPersistentFilterValues() {
|
|
194
|
-
return
|
|
194
|
+
return N.get("filter-values");
|
|
195
195
|
},
|
|
196
196
|
/**
|
|
197
197
|
* Clone new filterValues to remove reactivity, and save them to localStorage.
|
|
198
198
|
* @param {object} newValues - the filterValues to be persisted in localStorage
|
|
199
199
|
*/
|
|
200
200
|
persistFilterValues(l) {
|
|
201
|
-
|
|
201
|
+
N.set("filter-values", H(l));
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
}, se = { class: "
|
|
204
|
+
}, se = { class: "ll-grid grid-cols-4 md:grid-cols-12" }, ie = ["data-test"], oe = ["innerHTML"], re = ["innerHTML"];
|
|
205
205
|
function ae(l, r, i, s, t, o) {
|
|
206
206
|
var c;
|
|
207
207
|
const p = V("ll-select"), d = V("ll-checkbox"), h = V("ll-radio"), m = V("ll-button");
|
|
208
208
|
return u(), _("div", se, [
|
|
209
|
-
(u(!0), _(
|
|
210
|
-
var g, F, T, C,
|
|
211
|
-
return u(), _(
|
|
212
|
-
e.hidden ?
|
|
209
|
+
(u(!0), _(P, null, w(i.schema, (e, a) => {
|
|
210
|
+
var g, F, T, C, x, B, j, E;
|
|
211
|
+
return u(), _(P, null, [
|
|
212
|
+
e.hidden ? S("", !0) : (u(), _("div", {
|
|
213
213
|
key: `${a} ${t.forceRenderCount}`,
|
|
214
|
-
class:
|
|
214
|
+
class: L(["field-wrapper col-span-4 md:col-span-3", { "max-md:hidden": !e.type, "flex items-end": e.type === "ll-checkbox" }]),
|
|
215
215
|
"data-test": `filter|${e.fieldToFilter}`
|
|
216
216
|
}, [
|
|
217
217
|
e.type === "ll-select" ? (u(), f(p, b({
|
|
@@ -237,7 +237,7 @@ function ae(l, r, i, s, t, o) {
|
|
|
237
237
|
"onUpdate:checked": (n) => t.filterValues[a] = n,
|
|
238
238
|
ref_for: !0
|
|
239
239
|
}, e.attributes, {
|
|
240
|
-
"error-text": ((
|
|
240
|
+
"error-text": ((x = s.validation) == null ? void 0 : x.fields[e.fieldToFilter]) && ((B = s.validation) == null ? void 0 : B.getError(e.fieldToFilter)),
|
|
241
241
|
label: e.label,
|
|
242
242
|
"onUpdate:checked": (n) => o.onChange(e, t.filterValues, a)
|
|
243
243
|
}), null, 16, ["checked", "onUpdate:checked", "error-text", "label"])) : e.type ? (u(), f(v(e.type), b({
|
|
@@ -246,7 +246,7 @@ function ae(l, r, i, s, t, o) {
|
|
|
246
246
|
}, e.attributes, {
|
|
247
247
|
modelValue: t.filterValues[a],
|
|
248
248
|
"onUpdate:modelValue": [(n) => t.filterValues[a] = n, (n) => o.onChange(e, t.filterValues, a)],
|
|
249
|
-
"error-text": ((
|
|
249
|
+
"error-text": ((j = s.validation) == null ? void 0 : j.fields[e.fieldToFilter]) && ((E = s.validation) == null ? void 0 : E.getError(e.fieldToFilter)),
|
|
250
250
|
label: e.label
|
|
251
251
|
}), W({ _: 2 }, [
|
|
252
252
|
e.slots && e.slots.selected ? {
|
|
@@ -281,32 +281,32 @@ function ae(l, r, i, s, t, o) {
|
|
|
281
281
|
]),
|
|
282
282
|
key: "3"
|
|
283
283
|
} : void 0
|
|
284
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "error-text", "label"])) :
|
|
284
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "error-text", "label"])) : S("", !0)
|
|
285
285
|
], 10, ie))
|
|
286
286
|
], 64);
|
|
287
287
|
}), 256)),
|
|
288
288
|
k("div", {
|
|
289
|
-
class:
|
|
289
|
+
class: L(["button-grid col-span-4 flex items-end justify-end md:col-span-12", l.$style["filter-button-group"]])
|
|
290
290
|
}, [
|
|
291
|
-
|
|
291
|
+
O(m, {
|
|
292
292
|
secondary: "",
|
|
293
293
|
"data-test": "button|reset-filters",
|
|
294
294
|
disabled: i.disableClear,
|
|
295
295
|
onClick: o.resetFilters
|
|
296
296
|
}, {
|
|
297
297
|
default: y(() => [
|
|
298
|
-
|
|
298
|
+
U(D(t.clearText), 1)
|
|
299
299
|
]),
|
|
300
300
|
_: 1
|
|
301
301
|
}, 8, ["disabled", "onClick"]),
|
|
302
|
-
|
|
302
|
+
O(m, {
|
|
303
303
|
primary: "",
|
|
304
304
|
"data-test": "button|apply-filters",
|
|
305
305
|
disabled: i.disableApply || ((c = s.validation) == null ? void 0 : c.hasErrors),
|
|
306
306
|
onClick: o.applyFilters
|
|
307
307
|
}, {
|
|
308
308
|
default: y(() => [
|
|
309
|
-
|
|
309
|
+
U(D(t.applyText), 1)
|
|
310
310
|
]),
|
|
311
311
|
_: 1
|
|
312
312
|
}, 8, ["disabled", "onClick"])
|
package/dist/Filters.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Filters.js","sources":["../src/components/Filters/Filters.vue"],"sourcesContent":["<script>\n import cloneDeep from 'lodash-es/cloneDeep';\n import merge from 'lodash-es/merge';\n import { nextTick, ref, toRefs } from 'vue';\n\n import useValidation from '../../composables/useValidation/useValidation';\n import { LLLV_CHANGE_TRIGGERS } from '../../constants';\n import { t } from '../../locale';\n import { persistentStorage } from '../../storage';\n import Button from '../Button/Button.vue';\n import Checkbox from '../Checkbox/Checkbox.vue';\n import DatePicker from '../DatePicker/DatePicker.vue';\n import Input from '../Input/Input.vue';\n import InputOptions from '../InputOptions/InputOptions.vue';\n import Radio from '../Radio/Radio.vue';\n import Select from '../Select/Select.vue';\n\n export default {\n name: 'll-filters',\n\n components: {\n 'll-button': Button,\n 'll-checkbox': Checkbox,\n 'll-input': Input,\n 'll-input-options': InputOptions,\n 'll-radio': Radio,\n 'll-select': Select,\n DatePicker,\n },\n\n props: {\n /**\n * Whether to disable the Apply button\n */\n disableApply: Boolean,\n /**\n * Whether to disable the Clear button\n */\n disableClear: Boolean,\n /**\n * Whether to disable the sticky filters\n * If disabled, a default pre-selected value(s) can be added to\n * the filter component's attributes\n */\n disablePersistency: Boolean,\n /**\n * Filters schema\n */\n schema: {\n type: Array,\n default: () => [],\n },\n /**\n * Validation schema function that returns an object\n */\n validationSchema: {\n type: Function,\n default: () => () => undefined,\n },\n },\n\n emits: ['change', 'submit', 'reset'],\n\n setup(props) {\n const { validationSchema: getValidationSchema } = toRefs(props);\n const validationSchema = getValidationSchema.value();\n const validationValues = ref({});\n\n // Without ref, `this.validation` will always evaluate to its initial value of `undefined` due to lack of reactivity.\n const validation = ref();\n\n function initValidation() {\n if (validationSchema?.toString() !== '[object Object]') {\n return;\n }\n\n validationValues.value = Object.keys(validationSchema).reduce((values, fieldName) => {\n values[fieldName] = undefined;\n\n return values;\n }, {});\n\n const validationRules = Object.entries(validationSchema).reduce((rules, [fieldName, fieldRules]) => {\n rules[fieldName] = fieldRules.map((fieldRule) => {\n return fieldRule(validationValues);\n });\n\n return rules;\n }, {});\n\n validation.value = useValidation({ rules: validationRules, values: validationValues });\n validation.value.validate();\n }\n\n return {\n validation,\n validationValues,\n initValidation,\n };\n },\n\n data() {\n return {\n applyText: t('ll.apply'),\n clearText: t('ll.clear'),\n filters: {},\n filterValues: {},\n forceRenderCount: 0,\n };\n },\n\n watch: {\n filterValues: {\n /**\n * Maps filters to a partcular object structure:\n * @param {IFilterSchemaItem} newFilterValues all selected filters\n * @returns {IFilter}\n */\n handler: function (newFilterValues) {\n const filters = Object.keys(newFilterValues).reduce((acc, i) => {\n const schema = this.schema[i];\n\n if (!schema || !schema.fieldToFilter) {\n return acc;\n }\n\n const item = newFilterValues[i];\n\n // Ignore empty string or undefined/null filter values\n if (item === '' || item == null) {\n return acc;\n }\n\n const trackBy = schema.attributes.trackBy || 'id';\n const isObject = typeof item === 'object';\n const isCustomFilterComponent = typeof schema.type === 'object';\n // TODO: remove handling of schema.attributes.multiple when we remove the vue-multiselect version of Select\n const isMultiple =\n (isCustomFilterComponent && schema.attributes.multiple) ||\n (!isCustomFilterComponent &&\n schema.type.includes('ll-select') &&\n (schema.attributes.multiple || !schema.attributes.single));\n const filterBy = isMultiple\n ? // local storage might have item stored as an object from the old Select\n (Array.isArray(item) ? item : [item]).map((v) => v[trackBy])\n : isObject\n ? [item[trackBy]]\n : [item];\n\n const groupedWith = schema.groupedWith;\n\n if (groupedWith) {\n filterBy[0] = {\n index: groupedWith,\n value: newFilterValues[groupedWith],\n };\n filterBy.push({\n index: Number(i),\n value: newFilterValues[i],\n });\n }\n\n if (filterBy.length) {\n acc[schema.fieldToFilter] = {\n // don't add to `filters` if no filterBy\n filterBy,\n filterType: schema.type, // Informs the applied filter count\n isMultiple,\n ...('fn' in schema && { customFilter: schema.fn }),\n };\n }\n\n return acc;\n }, {});\n\n this.filters = filters;\n this.$emit('change', filters);\n },\n\n deep: true,\n immediate: true,\n },\n\n filters() {\n if (this.validation) {\n this.updateValidationValues();\n }\n },\n },\n\n async created() {\n // initFilterValues updates the filterValues so using await nextTick() forces the code\n // after it to wait until nextTick is done, at which point the filterValues will\n // be done initializing. Otherwise, applyFilters sometimes applies the wrong\n // filters because filterValues is not done updating.\n this.initFilterValues();\n await nextTick();\n this.initValidation();\n this.applyFilters({ trigger: LLLV_CHANGE_TRIGGERS.LOAD });\n },\n\n methods: {\n initFilterValues() {\n if (this.disablePersistency) {\n this.filterValues = this.getDefaultFilterValues();\n\n return;\n }\n\n this.filterValues = this.getPersistentFilterValues() || this.getDefaultFilterValues();\n },\n\n /**\n * Apply the selected filters and save them to localStorage.\n * ListView calls this method using a ref to Filters.\n * The trigger option is used in ListView.\n * @param {object} [options] - optional parameters\n * @param {string} [options.trigger] - the action that triggered this function call\n */\n async applyFilters({ trigger = LLLV_CHANGE_TRIGGERS.APPLY } = {}) {\n if (this.validation) {\n await this.validation.validate();\n\n if (this.validation.hasErrors) {\n return;\n }\n }\n\n if (!this.disablePersistency) {\n this.persistFilterValues(this.filterValues);\n }\n\n this.$emit('submit', { trigger });\n },\n\n resetFilters() {\n this.filterValues = this.getDefaultFilterValues();\n\n this.forceRenderCount++;\n\n if (!this.disablePersistency) {\n this.persistFilterValues(this.filterValues);\n }\n\n // Emit after filters are updated\n this.$nextTick(() => {\n this.$emit('reset');\n });\n },\n\n /**\n * Returns pre-defined filter values to become the default values\n */\n getDefaultFilterValues() {\n return this.schema.reduce((acc, item, filterIndex) => {\n if (item.type === 'll-checkbox') {\n acc[filterIndex] = item.attributes.checked || false;\n } else if (Object.prototype.hasOwnProperty.call(item.attributes, 'modelValue')) {\n acc[filterIndex] = item.attributes.modelValue;\n }\n\n return acc;\n }, {});\n },\n\n /**\n * Intended for external use, when filter values need to be set for the user\n */\n setFilterValues(newValues) {\n this.filterValues = merge({}, this.filterValues, newValues);\n this.forceRenderCount++;\n },\n\n updateValidationValues() {\n const validatable = Object.keys(this.validationSchema());\n\n this.schema.forEach((fieldSchema, filterIndex) => {\n const fieldToFilter = fieldSchema.fieldToFilter;\n const validate = validatable.includes(fieldToFilter);\n\n if (validate) {\n const filter = this.filters[fieldToFilter];\n\n /**\n * Get all validatable fields.\n * Use parsed value of filters that are set,\n * otherwise fall back to `filterValue` value if not set.\n */\n const filterValue = filter\n ? filter.isMultiple\n ? filter.filterBy\n : filter.filterBy[0]\n : this.filterValues[filterIndex];\n\n this.validationValues[fieldToFilter] = filterValue;\n }\n });\n },\n\n /**\n * Change handler for filter fields\n */\n onChange(filter, filterValues, filterIndex) {\n if (filter.on?.change) {\n // Maps to `on.change` handlers in the filter schema.\n filter.on.change(filterValues, filterIndex);\n }\n },\n\n /**\n * Select input event handler for filter fields\n */\n onSelectInput(newValue, filter, filterIndex) {\n if (newValue === undefined) {\n delete this.filterValues[filterIndex]; // prevent undefined filterValues which cause an empty result list\n } else {\n this.filterValues[filterIndex] = newValue;\n }\n\n this.onChange(filter, this.filterValues, filterIndex);\n },\n\n /**\n * Get filter values from local storage.\n * @returns {any}\n */\n getPersistentFilterValues() {\n return persistentStorage.get('filter-values');\n },\n\n /**\n * Clone new filterValues to remove reactivity, and save them to localStorage.\n * @param {object} newValues - the filterValues to be persisted in localStorage\n */\n persistFilterValues(newValues) {\n persistentStorage.set('filter-values', cloneDeep(newValues));\n },\n },\n };\n</script>\n\n<template>\n <div class=\"tw-ll-grid tw-grid-cols-4 md:tw-grid-cols-12\">\n <template v-for=\"(filter, filterIndex) in schema\">\n <div\n v-if=\"!filter.hidden\"\n :key=\"`${filterIndex} ${forceRenderCount}`\"\n class=\"field-wrapper tw-col-span-4 md:tw-col-span-3\"\n :class=\"{ 'max-md:tw-hidden': !filter.type, 'tw-flex tw-items-end': filter.type === 'll-checkbox' }\"\n :data-test=\"`filter|${filter.fieldToFilter}`\"\n >\n <!-- Filter component -->\n <ll-select\n v-if=\"filter.type === 'll-select'\"\n v-bind=\"filter.attributes\"\n :error=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n :model-value=\"filterValues[filterIndex]\"\n @update:model-value=\"(newValue) => onSelectInput(newValue, filter, filterIndex)\"\n />\n <ll-checkbox\n v-else-if=\"filter.type === 'll-checkbox'\"\n v-model:checked=\"filterValues[filterIndex]\"\n v-bind=\"filter.attributes\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:checked=\"onChange(filter, filterValues, filterIndex)\"\n />\n <ll-radio\n v-else-if=\"filter.type === 'll-radio'\"\n v-model:checked=\"filterValues[filterIndex]\"\n v-bind=\"filter.attributes\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:checked=\"onChange(filter, filterValues, filterIndex)\"\n />\n <component\n v-bind=\"filter.attributes\"\n :is=\"filter.type\"\n v-else-if=\"filter.type\"\n v-model=\"filterValues[filterIndex]\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:model-value=\"onChange(filter, filterValues, filterIndex)\"\n >\n <template v-if=\"filter.slots && filter.slots.selected\" #selected=\"{ option }\">\n <component :is=\"filter.slots.selected\" v-bind=\"option.props\" />\n </template>\n <template v-if=\"filter.slots && filter.slots.option\" #option=\"{ option }\">\n <component :is=\"filter.slots.option\" v-bind=\"option.props\" />\n </template>\n <template v-if=\"filter.slots && filter.slots.prepend\" #prepend>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <span v-html=\"filter.slots.prepend\"></span>\n </template>\n <template v-if=\"filter.slots && filter.slots.append\" #append>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <span v-html=\"filter.slots.append\"></span>\n </template>\n </component>\n </div>\n </template>\n <div\n class=\"button-grid tw-col-span-4 tw-flex tw-items-end tw-justify-end md:tw-col-span-12\"\n :class=\"$style['filter-button-group']\"\n >\n <ll-button secondary data-test=\"button|reset-filters\" :disabled=\"disableClear\" @click=\"resetFilters\">\n {{ clearText }}\n </ll-button>\n <ll-button\n primary\n data-test=\"button|apply-filters\"\n :disabled=\"disableApply || validation?.hasErrors\"\n @click=\"applyFilters\"\n >\n {{ applyText }}\n </ll-button>\n </div>\n </div>\n</template>\n\n<style module>\n .filter-button-group {\n @media screen('max-md') {\n display: flex;\n flex-direction: column-reverse;\n }\n\n button {\n @media screen('max-md') {\n width: 100% !important;\n }\n\n &:nth-child(2) {\n @media screen('max-md') {\n margin-bottom: theme('spacing.3');\n }\n }\n }\n }\n</style>\n"],"names":["_sfc_main","Button","Checkbox","Input","InputOptions","Radio","Select","DatePicker","props","getValidationSchema","toRefs","validationSchema","validationValues","ref","validation","initValidation","values","fieldName","validationRules","rules","fieldRules","fieldRule","useValidation","t","newFilterValues","filters","acc","i","schema","item","trackBy","isObject","isCustomFilterComponent","isMultiple","filterBy","v","groupedWith","nextTick","LLLV_CHANGE_TRIGGERS","trigger","filterIndex","newValues","merge","validatable","fieldSchema","fieldToFilter","filter","filterValue","filterValues","_a","newValue","persistentStorage","cloneDeep","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_openBlock","_createElementBlock","_Fragment","_renderList","$props","_createCommentVNode","$data","_normalizeClass","_createBlock","_component_ll_select","_mergeProps","$setup","_b","$options","_component_ll_checkbox","$event","_c","_d","_component_ll_radio","_e","_f","_resolveDynamicComponent","_g","_h","_createSlots","_withCtx","option","_createElementVNode","_ctx","_createVNode","_component_ll_button","_createTextVNode","_toDisplayString"],"mappings":";;;;;;;;;;;;;;;;;GAiBOA,KAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,aAAaC;AAAA,IACb,eAAeC;AAAA,IACf,YAAYC;AAAA,IACZ,oBAAoBC;AAAA,IACpB,YAAYC;AAAA,IACZ,aAAaC;AAAA,IACb,YAAAC;AAAA;EAGF,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,cAAc;AAAA;AAAA;AAAA;AAAA,IAId,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMd,oBAAoB;AAAA;AAAA;AAAA;AAAA,IAIpB,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS,MAAM,CAAA;AAAA;;;;IAKjB,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS,MAAM,MAAA;AAAA;AAAA;;EAInB,OAAO,CAAC,UAAU,UAAU,OAAO;AAAA,EAEnC,MAAMC,GAAO;AACX,UAAM,EAAE,kBAAkBC,MAAwBC,EAAOF,CAAK,GACxDG,IAAmBF,EAAoB,MAAK,GAC5CG,IAAmBC,EAAI,EAAE,GAGzBC,IAAaD,EAAG;AAEtB,aAASE,IAAiB;AACxB,WAAIJ,KAAA,gBAAAA,EAAkB,gBAAe;AACnC;AAGF,MAAAC,EAAiB,QAAQ,OAAO,KAAKD,CAAgB,EAAE,OAAO,CAACK,GAAQC,OACrED,EAAOC,CAAS,IAAI,QAEbD,IACN,CAAA,CAAE;AAEL,YAAME,IAAkB,OAAO,QAAQP,CAAgB,EAAE,OAAO,CAACQ,GAAO,CAACF,GAAWG,CAAU,OAC5FD,EAAMF,CAAS,IAAIG,EAAW,IAAI,CAACC,MAC1BA,EAAUT,CAAgB,CAClC,GAEMO,IACN,CAAA,CAAE;AAEL,MAAAL,EAAW,QAAQQ,EAAc,EAAE,OAAOJ,GA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A,EAAA;AAAA,QAAA,GAAA,IAAAR,EAAA;AAAA;;IAkZI8B,EAeM,OAAA;AAAA,MAdJ,OAnZNpB,EAAA,CAmZY,mFACEqB,EAAA,OAAM,qBAAA,CAAA,CAAA;AAAA;MAEdC,EAEYC,GAAA;AAAA,QAFD,WAAA;AAAA,QAAU,aAAU;AAAA,QAAwB,UAAU1B,EAAA;AAAA,QAAe,SAAOS,EAAA;AAAA;QAtZ7F,SAAAY,EAuZQ,MAAe;AAAA,UAvZvBM,EAAAC,EAuZW1B,EAAA,SAAS,GAAA,CAAA;AAAA;QAvZpB,GAAA;AAAA;MAyZMuB,EAOYC,GAAA;AAAA,QANV,SAAA;AAAA,QACA,aAAU;AAAA,QACT,UAAU1B,EAAA,kBAAgBZ,IAAAmB,EAAA,eAAA,gBAAAnB,EAAY;AAAA,QACtC,SAAOqB,EAAA;AAAA;QA7ZhB,SAAAY,EA+ZQ,MAAe;AAAA,UA/ZvBM,EAAAC,EA+ZW1B,EAAA,SAAS,GAAA,CAAA;AAAA;QA/ZpB,GAAA;AAAA;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Filters.js","sources":["../src/components/Filters/Filters.vue"],"sourcesContent":["<script>\n import cloneDeep from 'lodash-es/cloneDeep';\n import merge from 'lodash-es/merge';\n import { nextTick, ref, toRefs } from 'vue';\n\n import useValidation from '../../composables/useValidation/useValidation';\n import { LLLV_CHANGE_TRIGGERS } from '../../constants';\n import { t } from '../../locale';\n import { persistentStorage } from '../../storage';\n import Button from '../Button/Button.vue';\n import Checkbox from '../Checkbox/Checkbox.vue';\n import DatePicker from '../DatePicker/DatePicker.vue';\n import Input from '../Input/Input.vue';\n import InputOptions from '../InputOptions/InputOptions.vue';\n import Radio from '../Radio/Radio.vue';\n import Select from '../Select/Select.vue';\n\n export default {\n name: 'll-filters',\n\n components: {\n 'll-button': Button,\n 'll-checkbox': Checkbox,\n 'll-input': Input,\n 'll-input-options': InputOptions,\n 'll-radio': Radio,\n 'll-select': Select,\n DatePicker,\n },\n\n props: {\n /**\n * Whether to disable the Apply button\n */\n disableApply: Boolean,\n /**\n * Whether to disable the Clear button\n */\n disableClear: Boolean,\n /**\n * Whether to disable the sticky filters\n * If disabled, a default pre-selected value(s) can be added to\n * the filter component's attributes\n */\n disablePersistency: Boolean,\n /**\n * Filters schema\n */\n schema: {\n type: Array,\n default: () => [],\n },\n /**\n * Validation schema function that returns an object\n */\n validationSchema: {\n type: Function,\n default: () => () => undefined,\n },\n },\n\n emits: ['change', 'submit', 'reset'],\n\n setup(props) {\n const { validationSchema: getValidationSchema } = toRefs(props);\n const validationSchema = getValidationSchema.value();\n const validationValues = ref({});\n\n // Without ref, `this.validation` will always evaluate to its initial value of `undefined` due to lack of reactivity.\n const validation = ref();\n\n function initValidation() {\n if (validationSchema?.toString() !== '[object Object]') {\n return;\n }\n\n validationValues.value = Object.keys(validationSchema).reduce((values, fieldName) => {\n values[fieldName] = undefined;\n\n return values;\n }, {});\n\n const validationRules = Object.entries(validationSchema).reduce((rules, [fieldName, fieldRules]) => {\n rules[fieldName] = fieldRules.map((fieldRule) => {\n return fieldRule(validationValues);\n });\n\n return rules;\n }, {});\n\n validation.value = useValidation({ rules: validationRules, values: validationValues });\n validation.value.validate();\n }\n\n return {\n validation,\n validationValues,\n initValidation,\n };\n },\n\n data() {\n return {\n applyText: t('ll.apply'),\n clearText: t('ll.clear'),\n filters: {},\n filterValues: {},\n forceRenderCount: 0,\n };\n },\n\n watch: {\n filterValues: {\n /**\n * Maps filters to a partcular object structure:\n * @param {IFilterSchemaItem} newFilterValues all selected filters\n * @returns {IFilter}\n */\n handler: function (newFilterValues) {\n const filters = Object.keys(newFilterValues).reduce((acc, i) => {\n const schema = this.schema[i];\n\n if (!schema || !schema.fieldToFilter) {\n return acc;\n }\n\n const item = newFilterValues[i];\n\n // Ignore empty string or undefined/null filter values\n if (item === '' || item == null) {\n return acc;\n }\n\n const trackBy = schema.attributes.trackBy || 'id';\n const isObject = typeof item === 'object';\n const isCustomFilterComponent = typeof schema.type === 'object';\n // TODO: remove handling of schema.attributes.multiple when we remove the vue-multiselect version of Select\n const isMultiple =\n (isCustomFilterComponent && schema.attributes.multiple) ||\n (!isCustomFilterComponent &&\n schema.type.includes('ll-select') &&\n (schema.attributes.multiple || !schema.attributes.single));\n const filterBy = isMultiple\n ? // local storage might have item stored as an object from the old Select\n (Array.isArray(item) ? item : [item]).map((v) => v[trackBy])\n : isObject\n ? [item[trackBy]]\n : [item];\n\n const groupedWith = schema.groupedWith;\n\n if (groupedWith) {\n filterBy[0] = {\n index: groupedWith,\n value: newFilterValues[groupedWith],\n };\n filterBy.push({\n index: Number(i),\n value: newFilterValues[i],\n });\n }\n\n if (filterBy.length) {\n acc[schema.fieldToFilter] = {\n // don't add to `filters` if no filterBy\n filterBy,\n filterType: schema.type, // Informs the applied filter count\n isMultiple,\n ...('fn' in schema && { customFilter: schema.fn }),\n };\n }\n\n return acc;\n }, {});\n\n this.filters = filters;\n this.$emit('change', filters);\n },\n\n deep: true,\n immediate: true,\n },\n\n filters() {\n if (this.validation) {\n this.updateValidationValues();\n }\n },\n },\n\n async created() {\n // initFilterValues updates the filterValues so using await nextTick() forces the code\n // after it to wait until nextTick is done, at which point the filterValues will\n // be done initializing. Otherwise, applyFilters sometimes applies the wrong\n // filters because filterValues is not done updating.\n this.initFilterValues();\n await nextTick();\n this.initValidation();\n this.applyFilters({ trigger: LLLV_CHANGE_TRIGGERS.LOAD });\n },\n\n methods: {\n initFilterValues() {\n if (this.disablePersistency) {\n this.filterValues = this.getDefaultFilterValues();\n\n return;\n }\n\n this.filterValues = this.getPersistentFilterValues() || this.getDefaultFilterValues();\n },\n\n /**\n * Apply the selected filters and save them to localStorage.\n * ListView calls this method using a ref to Filters.\n * The trigger option is used in ListView.\n * @param {object} [options] - optional parameters\n * @param {string} [options.trigger] - the action that triggered this function call\n */\n async applyFilters({ trigger = LLLV_CHANGE_TRIGGERS.APPLY } = {}) {\n if (this.validation) {\n await this.validation.validate();\n\n if (this.validation.hasErrors) {\n return;\n }\n }\n\n if (!this.disablePersistency) {\n this.persistFilterValues(this.filterValues);\n }\n\n this.$emit('submit', { trigger });\n },\n\n resetFilters() {\n this.filterValues = this.getDefaultFilterValues();\n\n this.forceRenderCount++;\n\n if (!this.disablePersistency) {\n this.persistFilterValues(this.filterValues);\n }\n\n // Emit after filters are updated\n this.$nextTick(() => {\n this.$emit('reset');\n });\n },\n\n /**\n * Returns pre-defined filter values to become the default values\n */\n getDefaultFilterValues() {\n return this.schema.reduce((acc, item, filterIndex) => {\n if (item.type === 'll-checkbox') {\n acc[filterIndex] = item.attributes.checked || false;\n } else if (Object.prototype.hasOwnProperty.call(item.attributes, 'modelValue')) {\n acc[filterIndex] = item.attributes.modelValue;\n }\n\n return acc;\n }, {});\n },\n\n /**\n * Intended for external use, when filter values need to be set for the user\n */\n setFilterValues(newValues) {\n this.filterValues = merge({}, this.filterValues, newValues);\n this.forceRenderCount++;\n },\n\n updateValidationValues() {\n const validatable = Object.keys(this.validationSchema());\n\n this.schema.forEach((fieldSchema, filterIndex) => {\n const fieldToFilter = fieldSchema.fieldToFilter;\n const validate = validatable.includes(fieldToFilter);\n\n if (validate) {\n const filter = this.filters[fieldToFilter];\n\n /**\n * Get all validatable fields.\n * Use parsed value of filters that are set,\n * otherwise fall back to `filterValue` value if not set.\n */\n const filterValue = filter\n ? filter.isMultiple\n ? filter.filterBy\n : filter.filterBy[0]\n : this.filterValues[filterIndex];\n\n this.validationValues[fieldToFilter] = filterValue;\n }\n });\n },\n\n /**\n * Change handler for filter fields\n */\n onChange(filter, filterValues, filterIndex) {\n if (filter.on?.change) {\n // Maps to `on.change` handlers in the filter schema.\n filter.on.change(filterValues, filterIndex);\n }\n },\n\n /**\n * Select input event handler for filter fields\n */\n onSelectInput(newValue, filter, filterIndex) {\n if (newValue === undefined) {\n delete this.filterValues[filterIndex]; // prevent undefined filterValues which cause an empty result list\n } else {\n this.filterValues[filterIndex] = newValue;\n }\n\n this.onChange(filter, this.filterValues, filterIndex);\n },\n\n /**\n * Get filter values from local storage.\n * @returns {any}\n */\n getPersistentFilterValues() {\n return persistentStorage.get('filter-values');\n },\n\n /**\n * Clone new filterValues to remove reactivity, and save them to localStorage.\n * @param {object} newValues - the filterValues to be persisted in localStorage\n */\n persistFilterValues(newValues) {\n persistentStorage.set('filter-values', cloneDeep(newValues));\n },\n },\n };\n</script>\n\n<template>\n <div class=\"ll-grid grid-cols-4 md:grid-cols-12\">\n <template v-for=\"(filter, filterIndex) in schema\">\n <div\n v-if=\"!filter.hidden\"\n :key=\"`${filterIndex} ${forceRenderCount}`\"\n class=\"field-wrapper col-span-4 md:col-span-3\"\n :class=\"{ 'max-md:hidden': !filter.type, 'flex items-end': filter.type === 'll-checkbox' }\"\n :data-test=\"`filter|${filter.fieldToFilter}`\"\n >\n <!-- Filter component -->\n <ll-select\n v-if=\"filter.type === 'll-select'\"\n v-bind=\"filter.attributes\"\n :error=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n :model-value=\"filterValues[filterIndex]\"\n @update:model-value=\"(newValue) => onSelectInput(newValue, filter, filterIndex)\"\n />\n <ll-checkbox\n v-else-if=\"filter.type === 'll-checkbox'\"\n v-model:checked=\"filterValues[filterIndex]\"\n v-bind=\"filter.attributes\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:checked=\"onChange(filter, filterValues, filterIndex)\"\n />\n <ll-radio\n v-else-if=\"filter.type === 'll-radio'\"\n v-model:checked=\"filterValues[filterIndex]\"\n v-bind=\"filter.attributes\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:checked=\"onChange(filter, filterValues, filterIndex)\"\n />\n <component\n v-bind=\"filter.attributes\"\n :is=\"filter.type\"\n v-else-if=\"filter.type\"\n v-model=\"filterValues[filterIndex]\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:model-value=\"onChange(filter, filterValues, filterIndex)\"\n >\n <template v-if=\"filter.slots && filter.slots.selected\" #selected=\"{ option }\">\n <component :is=\"filter.slots.selected\" v-bind=\"option.props\" />\n </template>\n <template v-if=\"filter.slots && filter.slots.option\" #option=\"{ option }\">\n <component :is=\"filter.slots.option\" v-bind=\"option.props\" />\n </template>\n <template v-if=\"filter.slots && filter.slots.prepend\" #prepend>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <span v-html=\"filter.slots.prepend\"></span>\n </template>\n <template v-if=\"filter.slots && filter.slots.append\" #append>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <span v-html=\"filter.slots.append\"></span>\n </template>\n </component>\n </div>\n </template>\n <div\n class=\"button-grid col-span-4 flex items-end justify-end md:col-span-12\"\n :class=\"$style['filter-button-group']\"\n >\n <ll-button secondary data-test=\"button|reset-filters\" :disabled=\"disableClear\" @click=\"resetFilters\">\n {{ clearText }}\n </ll-button>\n <ll-button\n primary\n data-test=\"button|apply-filters\"\n :disabled=\"disableApply || validation?.hasErrors\"\n @click=\"applyFilters\"\n >\n {{ applyText }}\n </ll-button>\n </div>\n </div>\n</template>\n\n<style module>\n @reference \"../../../styles/main.css\";\n\n @layer utilities {\n .filter-button-group {\n @media (width <= theme(--breakpoint-md)) {\n display: flex;\n flex-direction: column-reverse;\n }\n\n button {\n @media (width <= theme(--breakpoint-md)) {\n width: 100% !important;\n }\n\n &:nth-child(2) {\n @media (width <= theme(--breakpoint-md)) {\n margin-bottom: --spacing(3);\n }\n }\n }\n }\n }\n</style>\n"],"names":["_sfc_main","Button","Checkbox","Input","InputOptions","Radio","Select","DatePicker","props","getValidationSchema","toRefs","validationSchema","validationValues","ref","validation","initValidation","values","fieldName","validationRules","rules","fieldRules","fieldRule","useValidation","t","newFilterValues","filters","acc","i","schema","item","trackBy","isObject","isCustomFilterComponent","isMultiple","filterBy","v","groupedWith","nextTick","LLLV_CHANGE_TRIGGERS","trigger","filterIndex","newValues","merge","validatable","fieldSchema","fieldToFilter","filter","filterValue","filterValues","_a","newValue","persistentStorage","cloneDeep","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_openBlock","_createElementBlock","_Fragment","_renderList","$props","_createCommentVNode","$data","_normalizeClass","_createBlock","_component_ll_select","_mergeProps","$setup","_b","$options","_component_ll_checkbox","$event","_c","_d","_component_ll_radio","_e","_f","_resolveDynamicComponent","_g","_h","_createSlots","_withCtx","option","_createElementVNode","_ctx","_createVNode","_component_ll_button","_createTextVNode","_toDisplayString"],"mappings":";;;;;;;;;;;;;;;;;GAiBOA,KAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,aAAaC;AAAA,IACb,eAAeC;AAAA,IACf,YAAYC;AAAA,IACZ,oBAAoBC;AAAA,IACpB,YAAYC;AAAA,IACZ,aAAaC;AAAA,IACb,YAAAC;AAAA;EAGF,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,cAAc;AAAA;AAAA;AAAA;AAAA,IAId,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMd,oBAAoB;AAAA;AAAA;AAAA;AAAA,IAIpB,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS,MAAM,CAAA;AAAA;;;;IAKjB,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS,MAAM,MAAA;AAAA;AAAA;;EAInB,OAAO,CAAC,UAAU,UAAU,OAAO;AAAA,EAEnC,MAAMC,GAAO;AACX,UAAM,EAAE,kBAAkBC,MAAwBC,EAAOF,CAAK,GACxDG,IAAmBF,EAAoB,MAAK,GAC5CG,IAAmBC,EAAI,EAAE,GAGzBC,IAAaD,EAAG;AAEtB,aAASE,IAAiB;AACxB,WAAIJ,KAAA,gBAAAA,EAAkB,gBAAe;AACnC;AAGF,MAAAC,EAAiB,QAAQ,OAAO,KAAKD,CAAgB,EAAE,OAAO,CAACK,GAAQC,OACr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cAAA,KAAA;AAAA,gBAAA;AAAA,YA2Y0BT,EAAO,SAASA,EAAO,MAAM;cA3YvD,MA2YgE;AAAA,cA3YhE,IAAAoC,EA6YY,MAA0C;AAAA,gBAA1CE,EAA0C,QAAA;AAAA,kBAApC,WAAQtC,EAAO,MAAM;AAAA,gBA7YvC,GAAA,MAAA,GAAAU,EAAA;AAAA;cAAA,KAAA;AAAA,gBAAA;AAAA,qFAAAM,EAAA,IAAA,EAAA;AAAA,QAAA,GAAA,IAAAR,EAAA;AAAA;;IAkZI8B,EAeM,OAAA;AAAA,MAdJ,OAnZNpB,EAAA,CAmZY,oEACEqB,EAAA,OAAM,qBAAA,CAAA,CAAA;AAAA;MAEdC,EAEYC,GAAA;AAAA,QAFD,WAAA;AAAA,QAAU,aAAU;AAAA,QAAwB,UAAU1B,EAAA;AAAA,QAAe,SAAOS,EAAA;AAAA;QAtZ7F,SAAAY,EAuZQ,MAAe;AAAA,UAvZvBM,EAAAC,EAuZW1B,EAAA,SAAS,GAAA,CAAA;AAAA;QAvZpB,GAAA;AAAA;MAyZMuB,EAOYC,GAAA;AAAA,QANV,SAAA;AAAA,QACA,aAAU;AAAA,QACT,UAAU1B,EAAA,kBAAgBZ,IAAAmB,EAAA,eAAA,gBAAAnB,EAAY;AAAA,QACtC,SAAOqB,EAAA;AAAA;QA7ZhB,SAAAY,EA+ZQ,MAAe;AAAA,UA/ZvBM,EAAAC,EA+ZW1B,EAAA,SAAS,GAAA,CAAA;AAAA;QA/ZpB,GAAA;AAAA;;;;;;;"}
|
package/dist/Filters.vue.d.ts
CHANGED
|
@@ -351,7 +351,6 @@ default: undefined;
|
|
|
351
351
|
checked: {
|
|
352
352
|
type: PropType<boolean | (string | number)[]>;
|
|
353
353
|
required: true;
|
|
354
|
-
default: boolean;
|
|
355
354
|
};
|
|
356
355
|
}>> & Readonly<{
|
|
357
356
|
"onUpdate:checked"?: ((value: boolean | (string | number)[]) => any) | undefined;
|
|
@@ -366,7 +365,6 @@ errorText: string;
|
|
|
366
365
|
hintText: string;
|
|
367
366
|
modelValue: boolean | (string | number)[];
|
|
368
367
|
value: string | number;
|
|
369
|
-
checked: boolean | (string | number)[];
|
|
370
368
|
}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
371
369
|
P: {};
|
|
372
370
|
B: {};
|
|
@@ -410,7 +408,6 @@ default: undefined;
|
|
|
410
408
|
checked: {
|
|
411
409
|
type: PropType<boolean | (string | number)[]>;
|
|
412
410
|
required: true;
|
|
413
|
-
default: boolean;
|
|
414
411
|
};
|
|
415
412
|
}>> & Readonly<{
|
|
416
413
|
"onUpdate:checked"?: ((value: boolean | (string | number)[]) => any) | undefined;
|
|
@@ -423,7 +420,6 @@ errorText: string;
|
|
|
423
420
|
hintText: string;
|
|
424
421
|
modelValue: boolean | (string | number)[];
|
|
425
422
|
value: string | number;
|
|
426
|
-
checked: boolean | (string | number)[];
|
|
427
423
|
}>;
|
|
428
424
|
__isFragment?: undefined;
|
|
429
425
|
__isTeleport?: undefined;
|
|
@@ -464,7 +460,6 @@ default: undefined;
|
|
|
464
460
|
checked: {
|
|
465
461
|
type: PropType<boolean | (string | number)[]>;
|
|
466
462
|
required: true;
|
|
467
|
-
default: boolean;
|
|
468
463
|
};
|
|
469
464
|
}>> & Readonly<{
|
|
470
465
|
"onUpdate:checked"?: ((value: boolean | (string | number)[]) => any) | undefined;
|
|
@@ -479,7 +474,6 @@ errorText: string;
|
|
|
479
474
|
hintText: string;
|
|
480
475
|
modelValue: boolean | (string | number)[];
|
|
481
476
|
value: string | number;
|
|
482
|
-
checked: boolean | (string | number)[];
|
|
483
477
|
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
484
478
|
$slots: {
|
|
485
479
|
default?(_: {}): any;
|
|
@@ -1071,12 +1065,12 @@ $slots: Readonly<{
|
|
|
1071
1065
|
default: (props: {
|
|
1072
1066
|
fieldId: string;
|
|
1073
1067
|
}) => void;
|
|
1074
|
-
hint: () =>
|
|
1068
|
+
hint: () => unknown;
|
|
1075
1069
|
}> & {
|
|
1076
1070
|
default: (props: {
|
|
1077
1071
|
fieldId: string;
|
|
1078
1072
|
}) => void;
|
|
1079
|
-
hint: () =>
|
|
1073
|
+
hint: () => unknown;
|
|
1080
1074
|
};
|
|
1081
1075
|
});
|
|
1082
1076
|
'll-radio': DefineComponent<ExtractPropTypes< {
|
package/dist/HttpError.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as B, useCssModule as b, useSlots as
|
|
1
|
+
import { defineComponent as B, useCssModule as b, useSlots as S, computed as n, resolveComponent as V, createElementBlock as _, openBlock as m, normalizeClass as i, unref as s, createElementVNode as o, createVNode as a, createCommentVNode as X, withCtx as h, toDisplayString as p, createTextVNode as c, renderSlot as I } from "vue";
|
|
2
2
|
import { t } from "./locale.js";
|
|
3
|
-
import
|
|
4
|
-
import { _ as
|
|
5
|
-
import { _ as
|
|
3
|
+
import N from "./Button.js";
|
|
4
|
+
import { _ as $, V as M, I as T } from "./Illustration.vue_vue_type_script_setup_true_lang-C1bPkWZZ.js";
|
|
5
|
+
import { _ as z } from "./Logo.vue_vue_type_script_setup_true_lang-DghNC_k6.js";
|
|
6
6
|
import { _ as D } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
|
-
const H = { class: "heading-jumbo
|
|
7
|
+
const H = { class: "heading-jumbo m-0 mb-3 !text-white" }, j = { class: "mb-8 text-white" }, F = { class: "mb-4 text-white" }, R = ["href"], Y = {
|
|
8
8
|
key: 0,
|
|
9
|
-
class: "
|
|
9
|
+
class: "flex items-start gap-6"
|
|
10
10
|
}, q = /* @__PURE__ */ B({
|
|
11
11
|
__name: "HttpError",
|
|
12
12
|
props: {
|
|
13
13
|
description: { default: "" },
|
|
14
|
-
errorCode: {
|
|
14
|
+
errorCode: {},
|
|
15
15
|
hideLogoutButton: { type: Boolean, default: !1 },
|
|
16
16
|
onLogout: { type: Function, default: void 0 },
|
|
17
17
|
retryLink: { default: void 0 },
|
|
@@ -51,22 +51,22 @@ const H = { class: "heading-jumbo tw-m-0 tw-mb-3 !tw-text-white" }, j = { class:
|
|
|
51
51
|
title: t("ll.httpError.504.title"),
|
|
52
52
|
description: t("ll.httpError.504.description")
|
|
53
53
|
}
|
|
54
|
-
}, r = f,
|
|
54
|
+
}, r = f, l = b(), g = S(), E = n(() => r.errorCode.toString()), v = n(() => parseInt(E.value, 10)), u = n(() => d[v.value] || d[500]), y = n(() => r.title || u.value.title), k = n(() => r.description || u.value.description), C = n(() => !r.hideLogoutButton && r.onLogout), w = n(() => r.retryLink || window.location.href);
|
|
55
55
|
return (x, e) => {
|
|
56
|
-
const L =
|
|
56
|
+
const L = V("router-link");
|
|
57
57
|
return m(), _("div", {
|
|
58
|
-
class:
|
|
58
|
+
class: i(["stash-http-error px-6 py-12", s(l).root]),
|
|
59
59
|
"data-test": "stash-http-error"
|
|
60
60
|
}, [
|
|
61
61
|
o("div", {
|
|
62
|
-
class:
|
|
62
|
+
class: i(s(l).wrapper)
|
|
63
63
|
}, [
|
|
64
|
-
|
|
64
|
+
a(L, {
|
|
65
65
|
to: "/",
|
|
66
|
-
class: "
|
|
66
|
+
class: "mb-8 block"
|
|
67
67
|
}, {
|
|
68
68
|
default: h(() => [
|
|
69
|
-
|
|
69
|
+
a(z, {
|
|
70
70
|
color: "white",
|
|
71
71
|
width: "192"
|
|
72
72
|
})
|
|
@@ -74,17 +74,17 @@ const H = { class: "heading-jumbo tw-m-0 tw-mb-3 !tw-text-white" }, j = { class:
|
|
|
74
74
|
_: 1
|
|
75
75
|
}),
|
|
76
76
|
o("div", {
|
|
77
|
-
class:
|
|
77
|
+
class: i(["mb-8 gap-6", s(l).content])
|
|
78
78
|
}, [
|
|
79
79
|
o("div", {
|
|
80
|
-
class:
|
|
80
|
+
class: i(["order-2 lg:order-1", s(l).content__text])
|
|
81
81
|
}, [
|
|
82
|
-
o("h1", H,
|
|
83
|
-
o("h2", j, "Error Code: " +
|
|
82
|
+
o("h1", H, p(y.value), 1),
|
|
83
|
+
o("h2", j, "Error Code: " + p(r.errorCode), 1),
|
|
84
84
|
o("p", F, [
|
|
85
|
-
c(
|
|
85
|
+
c(p(k.value) + " You can ", 1),
|
|
86
86
|
o("a", {
|
|
87
|
-
href:
|
|
87
|
+
href: w.value,
|
|
88
88
|
class: "link"
|
|
89
89
|
}, "try again", 8, R),
|
|
90
90
|
e[0] || (e[0] = c(" or reach out to ")),
|
|
@@ -96,18 +96,18 @@ const H = { class: "heading-jumbo tw-m-0 tw-mb-3 !tw-text-white" }, j = { class:
|
|
|
96
96
|
])
|
|
97
97
|
], 2),
|
|
98
98
|
o("div", {
|
|
99
|
-
class:
|
|
99
|
+
class: i(["order-1 lg:order-2", s(l).illustration])
|
|
100
100
|
}, [
|
|
101
|
-
|
|
101
|
+
a($, {
|
|
102
102
|
size: 300,
|
|
103
|
-
type: s(
|
|
104
|
-
name: s(
|
|
103
|
+
type: s(T).Vignette,
|
|
104
|
+
name: s(M).SearchStorefront
|
|
105
105
|
}, null, 8, ["type", "name"])
|
|
106
106
|
], 2)
|
|
107
107
|
], 2),
|
|
108
|
-
s(
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
s(g).actions || C.value ? (m(), _("div", Y, [
|
|
109
|
+
I(x.$slots, "actions", {}, () => [
|
|
110
|
+
a(N, {
|
|
111
111
|
tertiary: "",
|
|
112
112
|
onClick: r.onLogout
|
|
113
113
|
}, {
|
|
@@ -117,12 +117,12 @@ const H = { class: "heading-jumbo tw-m-0 tw-mb-3 !tw-text-white" }, j = { class:
|
|
|
117
117
|
_: 1
|
|
118
118
|
}, 8, ["onClick"])
|
|
119
119
|
])
|
|
120
|
-
])) :
|
|
120
|
+
])) : X("", !0)
|
|
121
121
|
], 2)
|
|
122
122
|
], 2);
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
}), A = "
|
|
125
|
+
}), A = "_root_dangr_3", G = "_wrapper_dangr_12", J = "_content_dangr_17", K = "_illustration_dangr_23", O = "_content__text_dangr_41", P = {
|
|
126
126
|
root: A,
|
|
127
127
|
wrapper: G,
|
|
128
128
|
content: J,
|
package/dist/HttpError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpError.js","sources":["../src/components/HttpError/HttpError.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, useCssModule, useSlots } from 'vue';\n\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import { IllustrationType, VignetteName } from '../Illustration/Illustration.models';\n import Illustration from '../Illustration/Illustration.vue';\n import Logo from '../Logo/Logo.vue';\n\n type ErrorCodes = 401 | 403 | 404 | 405 | 500 | 502 | 503 | 504;\n const errors: Record<ErrorCodes, { title: string; description: string }> = {\n 401: {\n title: t('ll.httpError.401.title'),\n description: t('ll.httpError.401.description'),\n },\n 403: {\n title: t('ll.httpError.403.title'),\n description: t('ll.httpError.403.description'),\n },\n 404: {\n title: t('ll.httpError.404.title'),\n description: t('ll.httpError.404.description'),\n },\n 405: {\n title: t('ll.httpError.405.title'),\n description: t('ll.httpError.405.description'),\n },\n 500: {\n title: t('ll.httpError.50X.title'),\n description: t('ll.httpError.50X.description'),\n },\n 502: {\n title: t('ll.httpError.50X.title'),\n description: t('ll.httpError.50X.description'),\n },\n 503: {\n title: t('ll.httpError.50X.title'),\n description: t('ll.httpError.50X.description'),\n },\n 504: {\n title: t('ll.httpError.504.title'),\n description: t('ll.httpError.504.description'),\n },\n };\n\n export interface HttpErrorProps {\n /**\n * A description of what possibly happened.\n */\n description?: string;\n\n /**\n * The error code.\n */\n errorCode: keyof typeof errors | `${keyof typeof errors}`;\n\n /**\n * By default, the logout button is visible unless content is provided to the `actions` slot or\n * this prop is `true`.\n */\n hideLogoutButton?: boolean;\n\n /**\n * A callback that will be called when the user clicks the logout button. If not provided,\n * a `logout` event will be emitted.\n */\n onLogout?: () => void;\n\n /**\n * A link to redirect the user to see if a hard refresh fixes the issue.\n */\n retryLink?: string;\n\n /**\n * The error title.\n */\n title?: string;\n }\n\n const props = withDefaults(defineProps<HttpErrorProps>(), {\n description: '',\n
|
|
1
|
+
{"version":3,"file":"HttpError.js","sources":["../src/components/HttpError/HttpError.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, useCssModule, useSlots } from 'vue';\n\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import { IllustrationType, VignetteName } from '../Illustration/Illustration.models';\n import Illustration from '../Illustration/Illustration.vue';\n import Logo from '../Logo/Logo.vue';\n\n type ErrorCodes = 401 | 403 | 404 | 405 | 500 | 502 | 503 | 504;\n const errors: Record<ErrorCodes, { title: string; description: string }> = {\n 401: {\n title: t('ll.httpError.401.title'),\n description: t('ll.httpError.401.description'),\n },\n 403: {\n title: t('ll.httpError.403.title'),\n description: t('ll.httpError.403.description'),\n },\n 404: {\n title: t('ll.httpError.404.title'),\n description: t('ll.httpError.404.description'),\n },\n 405: {\n title: t('ll.httpError.405.title'),\n description: t('ll.httpError.405.description'),\n },\n 500: {\n title: t('ll.httpError.50X.title'),\n description: t('ll.httpError.50X.description'),\n },\n 502: {\n title: t('ll.httpError.50X.title'),\n description: t('ll.httpError.50X.description'),\n },\n 503: {\n title: t('ll.httpError.50X.title'),\n description: t('ll.httpError.50X.description'),\n },\n 504: {\n title: t('ll.httpError.504.title'),\n description: t('ll.httpError.504.description'),\n },\n };\n\n export interface HttpErrorProps {\n /**\n * A description of what possibly happened.\n */\n description?: string;\n\n /**\n * The error code.\n */\n errorCode: keyof typeof errors | `${keyof typeof errors}`;\n\n /**\n * By default, the logout button is visible unless content is provided to the `actions` slot or\n * this prop is `true`.\n */\n hideLogoutButton?: boolean;\n\n /**\n * A callback that will be called when the user clicks the logout button. If not provided,\n * a `logout` event will be emitted.\n */\n onLogout?: () => void;\n\n /**\n * A link to redirect the user to see if a hard refresh fixes the issue.\n */\n retryLink?: string;\n\n /**\n * The error title.\n */\n title?: string;\n }\n\n const props = withDefaults(defineProps<HttpErrorProps>(), {\n description: '',\n onLogout: undefined,\n hideLogoutButton: false,\n retryLink: undefined,\n title: '',\n });\n\n const classes = useCssModule();\n const slots = useSlots();\n\n const errorCodeStr = computed(() => props.errorCode.toString());\n const errorCodeInt = computed(() => parseInt(errorCodeStr.value, 10));\n const defaultInfoByErrorCode = computed(() => errors[errorCodeInt.value] || errors['500']);\n const errorTitle = computed(() => props.title || defaultInfoByErrorCode.value.title);\n const errorDescription = computed(() => props.description || defaultInfoByErrorCode.value.description);\n\n const showLogoutButton = computed(() => !props.hideLogoutButton && props.onLogout);\n const computedRetryLink = computed(() => props.retryLink || window.location.href);\n</script>\n\n<template>\n <div class=\"stash-http-error px-6 py-12\" :class=\"classes.root\" data-test=\"stash-http-error\">\n <div :class=\"classes.wrapper\">\n <router-link to=\"/\" class=\"mb-8 block\">\n <Logo color=\"white\" width=\"192\" />\n </router-link>\n\n <div class=\"mb-8 gap-6\" :class=\"classes.content\">\n <div class=\"order-2 lg:order-1\" :class=\"classes.content__text\">\n <h1 class=\"heading-jumbo m-0 mb-3 !text-white\">\n {{ errorTitle }}\n </h1>\n <h2 class=\"mb-8 text-white\">Error Code: {{ props.errorCode }}</h2>\n <p class=\"mb-4 text-white\">\n {{ errorDescription }} You can <a :href=\"computedRetryLink\" class=\"link\">try again</a> or reach out to\n <a href=\"mailto:support@leaflink.com\" class=\"link\">support@leaflink.com</a> for assistance.\n </p>\n </div>\n <div class=\"order-1 lg:order-2\" :class=\"classes.illustration\">\n <Illustration :size=\"300\" :type=\"IllustrationType.Vignette\" :name=\"VignetteName.SearchStorefront\" />\n </div>\n </div>\n\n <div v-if=\"slots.actions || showLogoutButton\" class=\"flex items-start gap-6\">\n <slot name=\"actions\">\n <Button tertiary @click=\"props.onLogout\">Logout</Button>\n </slot>\n </div>\n </div>\n </div>\n</template>\n\n<style module>\n @layer utilities {\n .root {\n background-color: var(--color-purple-500);\n display: flex;\n height: 100%;\n justify-content: center;\n align-items: center;\n max-width: 100vw;\n }\n\n .wrapper {\n max-width: 100%;\n width: 56rem;\n }\n\n .content {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .illustration {\n /* width and height similar to figma. */\n width: 300px;\n height: 193px;\n }\n\n @media screen and (width < 1024px) {\n .content {\n flex-wrap: wrap;\n gap: 0;\n }\n\n .illustration {\n margin-bottom: 30px;\n }\n }\n\n @media screen and (width >= 1024px) {\n .content__text {\n max-width: 50vw;\n }\n }\n\n .illustration svg {\n /*\n * We cannot use the same sizes from figma because the illustration would be smaller\n * and it would break alignment. The specified height in figma is 193px but the\n * illustration is 300px, so, (300 - 193) / 2 ~= 53, which keeps it aligned.\n */\n margin-top: -53px;\n }\n }\n</style>\n"],"names":["errors","props","__props","classes","useCssModule","slots","useSlots","errorCodeStr","computed","errorCodeInt","defaultInfoByErrorCode","errorTitle","errorDescription","showLogoutButton","computedRetryLink"],"mappings":";;;;;;;;;;;;;;;;;;;;AAUE,UAAMA,IAAqE;AAAA,MACzE,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAAA;AAAA,MAE/C,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAAA;AAAA,MAE/C,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAAA;AAAA,MAE/C,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAAA;AAAA,MAE/C,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAAA;AAAA,MAE/C,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAAA;AAAA,MAE/C,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAAA;AAAA,MAE/C,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAAA;AAAA,IAC/C,GAqCIC,IAAQC,GAQRC,IAAUC,EAAA,GACVC,IAAQC,EAAA,GAERC,IAAeC,EAAS,MAAMP,EAAM,UAAU,UAAU,GACxDQ,IAAeD,EAAS,MAAM,SAASD,EAAa,OAAO,EAAE,CAAC,GAC9DG,IAAyBF,EAAS,MAAMR,EAAOS,EAAa,KAAK,KAAKT,EAAO,GAAK,CAAC,GACnFW,IAAaH,EAAS,MAAMP,EAAM,SAASS,EAAuB,MAAM,KAAK,GAC7EE,IAAmBJ,EAAS,MAAMP,EAAM,eAAeS,EAAuB,MAAM,WAAW,GAE/FG,IAAmBL,EAAS,MAAM,CAACP,EAAM,oBAAoBA,EAAM,QAAQ,GAC3Ea,IAAoBN,EAAS,MAAMP,EAAM,aAAa,OAAO,SAAS,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/HttpError.vue.d.ts
CHANGED
|
@@ -34,14 +34,12 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
|
34
34
|
|
|
35
35
|
declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<HttpErrorProps>, {
|
|
36
36
|
description: string;
|
|
37
|
-
errorCode: string;
|
|
38
37
|
onLogout: undefined;
|
|
39
38
|
hideLogoutButton: boolean;
|
|
40
39
|
retryLink: undefined;
|
|
41
40
|
title: string;
|
|
42
41
|
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<HttpErrorProps>, {
|
|
43
42
|
description: string;
|
|
44
|
-
errorCode: string;
|
|
45
43
|
onLogout: undefined;
|
|
46
44
|
hideLogoutButton: boolean;
|
|
47
45
|
retryLink: undefined;
|
|
@@ -49,7 +47,6 @@ title: string;
|
|
|
49
47
|
}>>> & Readonly<{}>, {
|
|
50
48
|
title: string;
|
|
51
49
|
description: string;
|
|
52
|
-
errorCode: ErrorCodes | "500" | "401" | "403" | "404" | "405" | "502" | "503" | "504";
|
|
53
50
|
hideLogoutButton: boolean;
|
|
54
51
|
onLogout: () => void;
|
|
55
52
|
retryLink: string;
|
package/dist/Icon.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as p, useCssModule as m, inject as h, computed as i, createBlock as f, openBlock as g, unref as a, normalizeClass as b } from "vue";
|
|
2
|
-
import
|
|
3
|
-
import { I as
|
|
2
|
+
import w from "lodash-es/uniqueId";
|
|
3
|
+
import { I as k } from "./index-D6bxWkZ1.js";
|
|
4
4
|
import { _ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const v = [
|
|
6
6
|
"action-dots",
|
|
@@ -209,11 +209,11 @@ const v = [
|
|
|
209
209
|
"working"
|
|
210
210
|
];
|
|
211
211
|
var y = /* @__PURE__ */ ((t) => (t.Standard = "standard", t.Dense = "dense", t.Small = "small", t.Large = "large", t))(y || {});
|
|
212
|
-
const
|
|
212
|
+
const j = /* @__PURE__ */ p({
|
|
213
213
|
name: "ll-icon",
|
|
214
214
|
__name: "Icon",
|
|
215
215
|
props: {
|
|
216
|
-
id: { default: () =>
|
|
216
|
+
id: { default: () => w("ll-icon-") },
|
|
217
217
|
name: {},
|
|
218
218
|
title: { default: "" },
|
|
219
219
|
size: { default: "standard" },
|
|
@@ -232,7 +232,7 @@ const x = /* @__PURE__ */ p({
|
|
|
232
232
|
const c = r.querySelector(`#${s.value}`);
|
|
233
233
|
return c ? (r.replaceChildren(c, l), r) : (r.insertBefore(l, r.firstChild), r);
|
|
234
234
|
};
|
|
235
|
-
return (r, l) => (g(), f(a(
|
|
235
|
+
return (r, l) => (g(), f(a(k), {
|
|
236
236
|
id: e.id,
|
|
237
237
|
role: "presentation",
|
|
238
238
|
"aria-labelledby": e.id,
|
|
@@ -252,15 +252,15 @@ const x = /* @__PURE__ */ p({
|
|
|
252
252
|
"transform-source": u
|
|
253
253
|
}, null, 8, ["id", "aria-labelledby", "class", "src", "title"]));
|
|
254
254
|
}
|
|
255
|
-
}), q = "
|
|
255
|
+
}), q = "_icon_1jfwu_3", z = "_standard_1jfwu_9", x = "_dense_1jfwu_16", B = "_small_1jfwu_23", C = "_large_1jfwu_30", P = {
|
|
256
256
|
icon: q,
|
|
257
257
|
standard: z,
|
|
258
|
-
dense:
|
|
259
|
-
small:
|
|
260
|
-
large:
|
|
261
|
-
},
|
|
262
|
-
$style:
|
|
263
|
-
}, A = /* @__PURE__ */ _(
|
|
258
|
+
dense: x,
|
|
259
|
+
small: B,
|
|
260
|
+
large: C
|
|
261
|
+
}, $ = {
|
|
262
|
+
$style: P
|
|
263
|
+
}, A = /* @__PURE__ */ _(j, [["__cssModules", $]]);
|
|
264
264
|
export {
|
|
265
265
|
y as IconSizes,
|
|
266
266
|
A as default,
|