@leaflink/stash 46.7.2 → 46.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataView.js +51 -49
- package/dist/DataView.js.map +1 -1
- package/dist/DataView.vue.d.ts +9 -0
- package/dist/{DataView.vue_used_vue_type_style_index_0_lang.module-d878ca9a.js → DataView.vue_used_vue_type_style_index_0_lang.module-5c180dba.js} +11 -10
- package/dist/DataView.vue_used_vue_type_style_index_0_lang.module-5c180dba.js.map +1 -0
- package/dist/DataViewFilters.js +1 -1
- package/dist/DataViewSortButton.js +1 -1
- package/dist/DataViewToolbar.js +73 -50
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DataViewToolbar.vue.d.ts +23 -2
- package/dist/FilterDropdown.js +1 -1
- package/dist/HttpError.js +57 -66
- package/dist/HttpError.js.map +1 -1
- package/dist/ListView.vue.d.ts +1 -1
- package/dist/Switch.js +59 -43
- package/dist/Switch.js.map +1 -1
- package/dist/Table.js +38 -35
- package/dist/Table.js.map +1 -1
- package/dist/TableCell.js +1 -1
- package/dist/TableHeaderCell.js +1 -1
- package/dist/TableHeaderRow.js +44 -40
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableRow.js +1 -1
- package/dist/components.css +1 -1
- package/package.json +1 -1
- package/dist/DataView.vue_used_vue_type_style_index_0_lang.module-d878ca9a.js.map +0 -1
|
@@ -34,6 +34,11 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export declare interface DataViewToolbarProps {
|
|
37
|
+
/**
|
|
38
|
+
* When DataView has `variant="table"` and Table has `is-selectable` enabled, it provides a way to flag
|
|
39
|
+
* a checkbox whenever all rows are selected, just like the standalone version on TableHeaderRow.
|
|
40
|
+
*/
|
|
41
|
+
allRowsSelected?: boolean;
|
|
37
42
|
/**
|
|
38
43
|
* Hides the page statistics (ex: "1 - 12 of 20") in the toolbar
|
|
39
44
|
*/
|
|
@@ -42,17 +47,33 @@ export declare interface DataViewToolbarProps {
|
|
|
42
47
|
* Controls the corners of DataViewToolbar with the "border-radius" CSS property. The default value is "rounded".
|
|
43
48
|
*/
|
|
44
49
|
radius?: ToolbarRadiuses;
|
|
50
|
+
/**
|
|
51
|
+
* When DataView has variant="table" and Table has `is-selectable` enabled, it provides a way to flag
|
|
52
|
+
* a checkbox whenever one or more, but not all rows are selected, just like the standalone
|
|
53
|
+
* version on TableHeaderRow.
|
|
54
|
+
*/
|
|
55
|
+
someRowsSelected?: boolean;
|
|
45
56
|
}
|
|
46
57
|
|
|
47
58
|
declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DataViewToolbarProps>, {
|
|
59
|
+
allRowsSelected: boolean;
|
|
48
60
|
hidePageStats: boolean;
|
|
49
61
|
radius: string;
|
|
50
|
-
|
|
62
|
+
someRowsSelected: boolean;
|
|
63
|
+
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
64
|
+
select: () => void;
|
|
65
|
+
}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DataViewToolbarProps>, {
|
|
66
|
+
allRowsSelected: boolean;
|
|
51
67
|
hidePageStats: boolean;
|
|
52
68
|
radius: string;
|
|
53
|
-
|
|
69
|
+
someRowsSelected: boolean;
|
|
70
|
+
}>>> & {
|
|
71
|
+
onSelect?: (() => any) | undefined;
|
|
72
|
+
}, {
|
|
54
73
|
radius: "none" | "rounded" | "rounded-top";
|
|
74
|
+
allRowsSelected: boolean;
|
|
55
75
|
hidePageStats: boolean;
|
|
76
|
+
someRowsSelected: boolean;
|
|
56
77
|
}, {}>, {
|
|
57
78
|
default?(_: {}): any;
|
|
58
79
|
}>;
|
package/dist/FilterDropdown.js
CHANGED
|
@@ -6,7 +6,7 @@ import "lodash-es/cloneDeep";
|
|
|
6
6
|
import "lodash-es/uniqueId";
|
|
7
7
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
8
8
|
import "./Paginate.vue_used_vue_type_style_index_0_lang.module-18343da7.js";
|
|
9
|
-
import { D as F } from "./DataView.vue_used_vue_type_style_index_0_lang.module-
|
|
9
|
+
import { D as F } from "./DataView.vue_used_vue_type_style_index_0_lang.module-5c180dba.js";
|
|
10
10
|
import { D as z } from "./DataViewFilters.keys-c80ffabe.js";
|
|
11
11
|
import G from "./Dropdown.js";
|
|
12
12
|
import $ from "./FilterChip.js";
|
package/dist/HttpError.js
CHANGED
|
@@ -1,29 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineComponent as L, useCssModule as B, useSlots as b, computed as s, resolveComponent as z, openBlock as _, createElementBlock as u, normalizeClass as l, unref as e, createElementVNode as o, createVNode as n, withCtx as h, toDisplayString as p, createTextVNode as c, renderSlot as S, createCommentVNode as V } from "vue";
|
|
2
2
|
import { t } from "./locale.js";
|
|
3
|
-
import
|
|
4
|
-
import { _ as
|
|
5
|
-
import { _ as
|
|
3
|
+
import X from "./Button.js";
|
|
4
|
+
import { _ as I, I as N, V as $ } from "./Illustration.vue_vue_type_script_setup_true_lang-e52df837.js";
|
|
5
|
+
import { _ as M } from "./Logo.vue_vue_type_script_setup_true_lang-d7da48a0.js";
|
|
6
|
+
import { _ as T } from "./_plugin-vue_export-helper-dad06003.js";
|
|
6
7
|
import "lodash-es/get";
|
|
7
8
|
import "./Button.vue_used_vue_type_style_index_0_lang.module-63d31dc0.js";
|
|
8
9
|
import "lodash-es/uniqueId";
|
|
9
10
|
import "./index-79ce320f.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
fill: "none",
|
|
13
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
14
|
-
}, z = /* @__PURE__ */ y('<g clip-path="url(#a)" fill="#fff"><path d="M35.265.248h3.883V23.82h-3.883V.248ZM57.586 17.127H45.493c.433 2.143 2.11 3.231 4.422 3.231 1.708 0 3.316-.66 4.254-1.912l2.58 1.945c-1.44 2.242-4.188 3.429-7.036 3.429-4.689 0-8.24-3.231-8.24-8.045 0-4.912 3.752-8.012 8.207-8.012 4.49 0 8.007 3.068 8.007 7.88-.005.496-.038.991-.1 1.483ZM53.8 14.456c-.234-2.11-1.876-3.33-4.053-3.33-2.11 0-3.785.99-4.254 3.33H53.8ZM76.628 8.093V23.82H72.74v-2.407c-1.071 1.648-3.282 2.407-5.196 2.407-4.12 0-7.709-3.132-7.709-8.045 0-4.944 3.552-8.012 7.672-8.012 1.977 0 4.158.758 5.226 2.374V8.09l3.894.002Zm-3.953 7.65c0-2.705-2.278-4.419-4.522-4.419-2.412 0-4.389 1.846-4.389 4.418s1.977 4.484 4.389 4.484c2.378 0 4.522-1.78 4.522-4.484ZM83.997 7.071v1.352h3.484v3.069h-3.484V23.82h-3.882V7.269c0-4.418 2.14-7.089 6.495-7.089h1.843l-1.072 3.56c-2.647 0-3.418 1.452-3.384 3.331ZM91.182.25h3.886v23.57h-3.886V.25ZM97.993 2.983c0-1.352 1.172-2.34 2.546-2.34 1.407 0 2.512.988 2.512 2.34 0 1.319-1.105 2.34-2.512 2.34-1.37 0-2.546-1.021-2.546-2.34Zm.606 5.44h3.886V23.82h-3.886V8.423ZM120.934 15.183v8.637h-3.885v-8.276c0-2.44-1.508-3.692-3.25-3.692-1.776 0-3.984.956-3.984 3.92v8.045h-3.891V8.423h3.886v2.44c.803-1.913 3.249-2.77 4.857-2.77 4.023 0 6.267 2.604 6.267 7.09ZM134.073 23.82l-6.098-6.99v6.99h-3.885V.248h3.885v13.087l4.489-4.912h5.059l-6.365 6.726 7.838 8.67h-4.923ZM7.219 19.014v-4.518L0 23.813h4.195l3.092-3.99a4.958 4.958 0 0 1-.068-.81ZM14.74 22.429a3.8 3.8 0 0 1-2.657-1.095 3.68 3.68 0 0 1-1.097-2.621c0-.03.01-11.764.01-13.665.003-1.747 1.502-3.333 3.442-3.333.87 0 1.706.323 2.343.906A4.876 4.876 0 0 0 14.408.589a4.971 4.971 0 0 0-3.139-.193 4.902 4.902 0 0 0-2.61 1.726 4.771 4.771 0 0 0-1.007 2.932v13.943c0 2.521 2.11 4.802 4.9 4.802a4.905 4.905 0 0 0 2.834-.887c.345-.238.658-.517.932-.831a3.755 3.755 0 0 1-1.578.348Z"></path><path d="M18.023 19.003v-4.517l-4.23 5.428c-.219.282-.53.481-.883.562-.351.082-.72.04-1.044-.117.265.46.641.848 1.094 1.132a3.338 3.338 0 0 0 3.073.248c.494-.207.929-.53 1.267-.941l.788-1.008a4.672 4.672 0 0 1-.065-.787ZM25.55 22.429a3.8 3.8 0 0 1-2.657-1.094 3.679 3.679 0 0 1-1.096-2.622l.01-13.665c0-1.745 1.5-3.33 3.441-3.33.868.001 1.703.325 2.338.907A4.875 4.875 0 0 0 25.216.594 4.971 4.971 0 0 0 22.077.4a4.902 4.902 0 0 0-2.61 1.724 4.77 4.77 0 0 0-1.01 2.93v13.943c0 2.521 2.111 4.802 4.9 4.802a4.904 4.904 0 0 0 2.835-.887c.345-.238.658-.517.932-.831a3.758 3.758 0 0 1-1.574.348Z"></path><path d="m26.12 17.93-1.523 1.983c-.219.282-.53.48-.881.562-.352.081-.72.04-1.044-.116.266.46.642.848 1.095 1.132a3.339 3.339 0 0 0 3.073.248c.494-.207.929-.53 1.268-.941l.67-.864-2.657-2.004ZM25.243 2.169c-.547 0-1.084.147-1.553.425a2.99 2.99 0 0 0-1.11 1.151 1.58 1.58 0 0 1 1.973.31 1.52 1.52 0 0 1 .044 1.965L22.23 9.077v5.4l5.02-6.46a4.711 4.711 0 0 0 1.01-2.92 2.943 2.943 0 0 0-.897-2.074 3.038 3.038 0 0 0-2.119-.854ZM14.438 2.169a3.055 3.055 0 0 0-1.551.426 2.99 2.99 0 0 0-1.108 1.15 1.58 1.58 0 0 1 1.97.312 1.52 1.52 0 0 1 .044 1.963l-2.368 3.057v5.4l5.019-6.46a4.713 4.713 0 0 0 1.008-2.92 2.943 2.943 0 0 0-.897-2.073 3.038 3.038 0 0 0-2.117-.855Z"></path></g><defs><clipPath id="a"><path fill="#fff" transform="translate(0 .18)" d="M0 0h139v23.64H0z"></path></clipPath></defs>', 2), T = [
|
|
15
|
-
z
|
|
16
|
-
];
|
|
17
|
-
function A(d, e) {
|
|
18
|
-
return p(), h("svg", I, T);
|
|
19
|
-
}
|
|
20
|
-
const D = { render: A }, P = { class: "heading-jumbo tw-m-0 tw-mb-3 !tw-text-white" }, F = { class: "tw-mb-8 tw-text-white" }, R = { class: "tw-mb-4 tw-text-white" }, Y = ["href"], q = /* @__PURE__ */ r("a", {
|
|
11
|
+
import "@leaflink/snitch";
|
|
12
|
+
const D = { class: "heading-jumbo tw-m-0 tw-mb-3 !tw-text-white" }, H = { class: "tw-mb-8 tw-text-white" }, j = { class: "tw-mb-4 tw-text-white" }, F = ["href"], R = /* @__PURE__ */ o("a", {
|
|
21
13
|
href: "mailto:support@leaflink.com",
|
|
22
14
|
class: "link"
|
|
23
|
-
}, "support@leaflink.com", -1),
|
|
15
|
+
}, "support@leaflink.com", -1), Y = {
|
|
24
16
|
key: 0,
|
|
25
17
|
class: "tw-flex tw-items-start tw-gap-6"
|
|
26
|
-
},
|
|
18
|
+
}, q = /* @__PURE__ */ L({
|
|
27
19
|
__name: "HttpError",
|
|
28
20
|
props: {
|
|
29
21
|
description: { default: "" },
|
|
@@ -33,8 +25,8 @@ const D = { render: A }, P = { class: "heading-jumbo tw-m-0 tw-mb-3 !tw-text-whi
|
|
|
33
25
|
retryLink: { default: void 0 },
|
|
34
26
|
title: { default: "" }
|
|
35
27
|
},
|
|
36
|
-
setup(
|
|
37
|
-
const
|
|
28
|
+
setup(m) {
|
|
29
|
+
const r = m, a = {
|
|
38
30
|
401: {
|
|
39
31
|
title: t("ll.httpError.401.title"),
|
|
40
32
|
description: t("ll.httpError.401.description")
|
|
@@ -67,85 +59,84 @@ const D = { render: A }, P = { class: "heading-jumbo tw-m-0 tw-mb-3 !tw-text-whi
|
|
|
67
59
|
title: t("ll.httpError.504.title"),
|
|
68
60
|
description: t("ll.httpError.504.description")
|
|
69
61
|
}
|
|
70
|
-
},
|
|
71
|
-
return (
|
|
72
|
-
const x =
|
|
73
|
-
return
|
|
74
|
-
class:
|
|
62
|
+
}, i = B(), f = b(), w = s(() => r.errorCode.toString()), E = s(() => parseInt(w.value, 10)), d = s(() => a[E.value] || a[500]), g = s(() => r.title || d.value.title), v = s(() => r.description || d.value.description), y = s(() => !r.hideLogoutButton && r.onLogout), k = s(() => r.retryLink || window.location.href);
|
|
63
|
+
return (C, U) => {
|
|
64
|
+
const x = z("router-link");
|
|
65
|
+
return _(), u("div", {
|
|
66
|
+
class: l(["stash-http-error tw-px-6 tw-py-12", e(i).root]),
|
|
75
67
|
"data-test": "stash-http-error"
|
|
76
68
|
}, [
|
|
77
|
-
|
|
78
|
-
class:
|
|
69
|
+
o("div", {
|
|
70
|
+
class: l(e(i).wrapper)
|
|
79
71
|
}, [
|
|
80
72
|
n(x, {
|
|
81
73
|
to: "/",
|
|
82
|
-
class:
|
|
74
|
+
class: "tw-mb-8 tw-block"
|
|
83
75
|
}, {
|
|
84
|
-
default:
|
|
85
|
-
n(
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
default: h(() => [
|
|
77
|
+
n(M, {
|
|
78
|
+
color: "white",
|
|
79
|
+
width: "192"
|
|
88
80
|
})
|
|
89
81
|
]),
|
|
90
82
|
_: 1
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
class:
|
|
83
|
+
}),
|
|
84
|
+
o("div", {
|
|
85
|
+
class: l(["tw-mb-8 tw-gap-6", e(i).content])
|
|
94
86
|
}, [
|
|
95
|
-
|
|
96
|
-
class:
|
|
87
|
+
o("div", {
|
|
88
|
+
class: l(["tw-order-2 lg:tw-order-1", e(i).content__text])
|
|
97
89
|
}, [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
c(
|
|
102
|
-
|
|
103
|
-
href:
|
|
90
|
+
o("h1", D, p(g.value), 1),
|
|
91
|
+
o("h2", H, "Error Code: " + p(r.errorCode), 1),
|
|
92
|
+
o("p", j, [
|
|
93
|
+
c(p(v.value) + " You can ", 1),
|
|
94
|
+
o("a", {
|
|
95
|
+
href: k.value,
|
|
104
96
|
class: "link"
|
|
105
|
-
}, "try again", 8,
|
|
97
|
+
}, "try again", 8, F),
|
|
106
98
|
c(" or reach out to "),
|
|
107
|
-
|
|
99
|
+
R,
|
|
108
100
|
c(" for assistance. ")
|
|
109
101
|
])
|
|
110
102
|
], 2),
|
|
111
|
-
|
|
112
|
-
class:
|
|
103
|
+
o("div", {
|
|
104
|
+
class: l(["tw-order-1 lg:tw-order-2", e(i).illustration])
|
|
113
105
|
}, [
|
|
114
|
-
n(
|
|
106
|
+
n(I, {
|
|
115
107
|
size: 300,
|
|
116
|
-
type:
|
|
117
|
-
name:
|
|
108
|
+
type: e(N).Vignette,
|
|
109
|
+
name: e($).SearchStorefront
|
|
118
110
|
}, null, 8, ["type", "name"])
|
|
119
111
|
], 2)
|
|
120
112
|
], 2),
|
|
121
|
-
|
|
122
|
-
S(
|
|
123
|
-
n(
|
|
113
|
+
e(f).actions || y.value ? (_(), u("div", Y, [
|
|
114
|
+
S(C.$slots, "actions", {}, () => [
|
|
115
|
+
n(X, {
|
|
124
116
|
tertiary: "",
|
|
125
|
-
onClick:
|
|
117
|
+
onClick: r.onLogout
|
|
126
118
|
}, {
|
|
127
|
-
default:
|
|
119
|
+
default: h(() => [
|
|
128
120
|
c("Logout")
|
|
129
121
|
]),
|
|
130
122
|
_: 1
|
|
131
123
|
}, 8, ["onClick"])
|
|
132
124
|
])
|
|
133
|
-
])) :
|
|
125
|
+
])) : V("", !0)
|
|
134
126
|
], 2)
|
|
135
127
|
], 2);
|
|
136
128
|
};
|
|
137
129
|
}
|
|
138
|
-
}),
|
|
139
|
-
root:
|
|
140
|
-
wrapper:
|
|
141
|
-
content:
|
|
142
|
-
illustration:
|
|
143
|
-
content__text:
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}, _t = /* @__PURE__ */ $(J, [["__cssModules", et]]);
|
|
130
|
+
}), A = "_root_16z1p_2", G = "_wrapper_16z1p_11", J = "_content_16z1p_16", K = "_illustration_16z1p_22", O = "_content__text_16z1p_40", P = {
|
|
131
|
+
root: A,
|
|
132
|
+
wrapper: G,
|
|
133
|
+
content: J,
|
|
134
|
+
illustration: K,
|
|
135
|
+
content__text: O
|
|
136
|
+
}, Q = {
|
|
137
|
+
$style: P
|
|
138
|
+
}, pt = /* @__PURE__ */ T(q, [["__cssModules", Q]]);
|
|
148
139
|
export {
|
|
149
|
-
|
|
140
|
+
pt as default
|
|
150
141
|
};
|
|
151
142
|
//# sourceMappingURL=HttpError.js.map
|
package/dist/HttpError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpError.js","sources":["../assets/logos/leaflink-white-logo-full.svg?component","../src/components/HttpError/HttpError.vue"],"sourcesContent":["import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createStaticVNode as _createStaticVNode } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 139 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createStaticVNode(\"<g clip-path=\\\"url(#a)\\\" fill=\\\"#fff\\\"><path d=\\\"M35.265.248h3.883V23.82h-3.883V.248ZM57.586 17.127H45.493c.433 2.143 2.11 3.231 4.422 3.231 1.708 0 3.316-.66 4.254-1.912l2.58 1.945c-1.44 2.242-4.188 3.429-7.036 3.429-4.689 0-8.24-3.231-8.24-8.045 0-4.912 3.752-8.012 8.207-8.012 4.49 0 8.007 3.068 8.007 7.88-.005.496-.038.991-.1 1.483ZM53.8 14.456c-.234-2.11-1.876-3.33-4.053-3.33-2.11 0-3.785.99-4.254 3.33H53.8ZM76.628 8.093V23.82H72.74v-2.407c-1.071 1.648-3.282 2.407-5.196 2.407-4.12 0-7.709-3.132-7.709-8.045 0-4.944 3.552-8.012 7.672-8.012 1.977 0 4.158.758 5.226 2.374V8.09l3.894.002Zm-3.953 7.65c0-2.705-2.278-4.419-4.522-4.419-2.412 0-4.389 1.846-4.389 4.418s1.977 4.484 4.389 4.484c2.378 0 4.522-1.78 4.522-4.484ZM83.997 7.071v1.352h3.484v3.069h-3.484V23.82h-3.882V7.269c0-4.418 2.14-7.089 6.495-7.089h1.843l-1.072 3.56c-2.647 0-3.418 1.452-3.384 3.331ZM91.182.25h3.886v23.57h-3.886V.25ZM97.993 2.983c0-1.352 1.172-2.34 2.546-2.34 1.407 0 2.512.988 2.512 2.34 0 1.319-1.105 2.34-2.512 2.34-1.37 0-2.546-1.021-2.546-2.34Zm.606 5.44h3.886V23.82h-3.886V8.423ZM120.934 15.183v8.637h-3.885v-8.276c0-2.44-1.508-3.692-3.25-3.692-1.776 0-3.984.956-3.984 3.92v8.045h-3.891V8.423h3.886v2.44c.803-1.913 3.249-2.77 4.857-2.77 4.023 0 6.267 2.604 6.267 7.09ZM134.073 23.82l-6.098-6.99v6.99h-3.885V.248h3.885v13.087l4.489-4.912h5.059l-6.365 6.726 7.838 8.67h-4.923ZM7.219 19.014v-4.518L0 23.813h4.195l3.092-3.99a4.958 4.958 0 0 1-.068-.81ZM14.74 22.429a3.8 3.8 0 0 1-2.657-1.095 3.68 3.68 0 0 1-1.097-2.621c0-.03.01-11.764.01-13.665.003-1.747 1.502-3.333 3.442-3.333.87 0 1.706.323 2.343.906A4.876 4.876 0 0 0 14.408.589a4.971 4.971 0 0 0-3.139-.193 4.902 4.902 0 0 0-2.61 1.726 4.771 4.771 0 0 0-1.007 2.932v13.943c0 2.521 2.11 4.802 4.9 4.802a4.905 4.905 0 0 0 2.834-.887c.345-.238.658-.517.932-.831a3.755 3.755 0 0 1-1.578.348Z\\\"></path><path d=\\\"M18.023 19.003v-4.517l-4.23 5.428c-.219.282-.53.481-.883.562-.351.082-.72.04-1.044-.117.265.46.641.848 1.094 1.132a3.338 3.338 0 0 0 3.073.248c.494-.207.929-.53 1.267-.941l.788-1.008a4.672 4.672 0 0 1-.065-.787ZM25.55 22.429a3.8 3.8 0 0 1-2.657-1.094 3.679 3.679 0 0 1-1.096-2.622l.01-13.665c0-1.745 1.5-3.33 3.441-3.33.868.001 1.703.325 2.338.907A4.875 4.875 0 0 0 25.216.594 4.971 4.971 0 0 0 22.077.4a4.902 4.902 0 0 0-2.61 1.724 4.77 4.77 0 0 0-1.01 2.93v13.943c0 2.521 2.111 4.802 4.9 4.802a4.904 4.904 0 0 0 2.835-.887c.345-.238.658-.517.932-.831a3.758 3.758 0 0 1-1.574.348Z\\\"></path><path d=\\\"m26.12 17.93-1.523 1.983c-.219.282-.53.48-.881.562-.352.081-.72.04-1.044-.116.266.46.642.848 1.095 1.132a3.339 3.339 0 0 0 3.073.248c.494-.207.929-.53 1.268-.941l.67-.864-2.657-2.004ZM25.243 2.169c-.547 0-1.084.147-1.553.425a2.99 2.99 0 0 0-1.11 1.151 1.58 1.58 0 0 1 1.973.31 1.52 1.52 0 0 1 .044 1.965L22.23 9.077v5.4l5.02-6.46a4.711 4.711 0 0 0 1.01-2.92 2.943 2.943 0 0 0-.897-2.074 3.038 3.038 0 0 0-2.119-.854ZM14.438 2.169a3.055 3.055 0 0 0-1.551.426 2.99 2.99 0 0 0-1.108 1.15 1.58 1.58 0 0 1 1.97.312 1.52 1.52 0 0 1 .044 1.963l-2.368 3.057v5.4l5.019-6.46a4.713 4.713 0 0 0 1.008-2.92 2.943 2.943 0 0 0-.897-2.073 3.038 3.038 0 0 0-2.117-.855Z\\\"></path></g><defs><clipPath id=\\\"a\\\"><path fill=\\\"#fff\\\" transform=\\\"translate(0 .18)\\\" d=\\\"M0 0h139v23.64H0z\\\"></path></clipPath></defs>\", 2)\nconst _hoisted_4 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_4))\n}\nexport default { render: render }","<script setup lang=\"ts\">\n import { computed, useCssModule, useSlots } from 'vue';\n\n import LeafLinkLogo from '../../../assets/logos/leaflink-white-logo-full.svg?component';\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\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 errorCode: '404',\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 tw-min-h-screen tw-px-6 tw-py-12\" :class=\"classes.root\" data-test=\"stash-http-error\">\n <div :class=\"classes.wrapper\">\n <router-link to=\"/\" class=\"tw-mb-8\" :class=\"classes.logo\">\n <LeafLinkLogo width=\"192\" height=\"33\" />\n </router-link>\n\n <div class=\"tw-mb-8 tw-gap-6\" :class=\"classes.content\">\n <div class=\"tw-order-2 lg:tw-order-1\" :class=\"classes.content__text\">\n <h1 class=\"heading-jumbo tw-m-0 tw-mb-3 !tw-text-white\">\n {{ errorTitle }}\n </h1>\n <h2 class=\"tw-mb-8 tw-text-white\">Error Code: {{ props.errorCode }}</h2>\n <p class=\"tw-mb-4 tw-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=\"tw-order-1 lg:tw-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=\"tw-flex tw-items-start tw-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 .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 .logo {\n /* width and height similar to figma. */\n width: 192px;\n height: 33px;\n display: block;\n }\n</style>\n"],"names":["_hoisted_1","_hoisted_2","_createStaticVNode","_hoisted_4","render","_ctx","_cache","_openBlock","_createElementBlock","LeafLinkLogo","errors","classes","useCssModule","slots","useSlots","errorCodeStr","computed","props","errorCodeInt","defaultInfoByErrorCode","errorTitle","errorDescription","showLogoutButton","computedRetryLink"],"mappings":";;;;;;;;;AAEA,MAAMA,IAAa;AAAA,EACjB,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AACT,GACMC,IAA0BC,gBAAAA,EAAmB,0pGAA4qG,CAAC,GAC1tGC,IAAa;AAAA,EACjBF;AACF;AAEO,SAASG,EAAOC,GAAMC,GAAQ;AACnC,SAAQC,EAAY,GAAEC,EAAoB,OAAOR,GAAYG,CAAU;AACzE;AACA,MAAeM,IAAA,EAAE,QAAQL,EAAM;;;;;;;;;;;;;;;;;iBCLvBM,IAAqE;AAAA,MACzE,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,IAAA,GA8CIC,IAAUC,KACVC,IAAQC,KAERC,IAAeC,EAAS,MAAMC,EAAM,UAAU,UAAU,GACxDC,IAAeF,EAAS,MAAM,SAASD,EAAa,OAAO,EAAE,CAAC,GAC9DI,IAAyBH,EAAS,MAAMN,EAAOQ,EAAa,KAAK,KAAKR,EAAO,GAAK,CAAC,GACnFU,IAAaJ,EAAS,MAAMC,EAAM,SAASE,EAAuB,MAAM,KAAK,GAC7EE,IAAmBL,EAAS,MAAMC,EAAM,eAAeE,EAAuB,MAAM,WAAW,GAE/FG,IAAmBN,EAAS,MAAM,CAACC,EAAM,oBAAoBA,EAAM,QAAQ,GAC3EM,IAAoBP,EAAS,MAAMC,EAAM,aAAa,OAAO,SAAS,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
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 errorCode: '404',\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 tw-px-6 tw-py-12\" :class=\"classes.root\" data-test=\"stash-http-error\">\n <div :class=\"classes.wrapper\">\n <router-link to=\"/\" class=\"tw-mb-8 tw-block\">\n <Logo color=\"white\" width=\"192\" />\n </router-link>\n\n <div class=\"tw-mb-8 tw-gap-6\" :class=\"classes.content\">\n <div class=\"tw-order-2 lg:tw-order-1\" :class=\"classes.content__text\">\n <h1 class=\"heading-jumbo tw-m-0 tw-mb-3 !tw-text-white\">\n {{ errorTitle }}\n </h1>\n <h2 class=\"tw-mb-8 tw-text-white\">Error Code: {{ props.errorCode }}</h2>\n <p class=\"tw-mb-4 tw-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=\"tw-order-1 lg:tw-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=\"tw-flex tw-items-start tw-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 .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</style>\n"],"names":["errors","classes","useCssModule","slots","useSlots","errorCodeStr","computed","props","errorCodeInt","defaultInfoByErrorCode","errorTitle","errorDescription","showLogoutButton","computedRetryLink"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUQA,IAAqE;AAAA,MACzE,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,IAAA,GA8CIC,IAAUC,KACVC,IAAQC,KAERC,IAAeC,EAAS,MAAMC,EAAM,UAAU,UAAU,GACxDC,IAAeF,EAAS,MAAM,SAASD,EAAa,OAAO,EAAE,CAAC,GAC9DI,IAAyBH,EAAS,MAAMN,EAAOQ,EAAa,KAAK,KAAKR,EAAO,GAAK,CAAC,GACnFU,IAAaJ,EAAS,MAAMC,EAAM,SAASE,EAAuB,MAAM,KAAK,GAC7EE,IAAmBL,EAAS,MAAMC,EAAM,eAAeE,EAAuB,MAAM,WAAW,GAE/FG,IAAmBN,EAAS,MAAM,CAACC,EAAM,oBAAoBA,EAAM,QAAQ,GAC3EM,IAAoBP,EAAS,MAAMC,EAAM,aAAa,OAAO,SAAS,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/ListView.vue.d.ts
CHANGED
|
@@ -564,9 +564,9 @@ declare const _default: DefineComponent<{
|
|
|
564
564
|
items: unknown[];
|
|
565
565
|
loading: boolean;
|
|
566
566
|
pageSize: number;
|
|
567
|
+
isSelectable: boolean;
|
|
567
568
|
disablePersistency: boolean;
|
|
568
569
|
validationSchema: Function;
|
|
569
|
-
isSelectable: boolean;
|
|
570
570
|
hideBulkActionOptions: boolean;
|
|
571
571
|
hideNumberOfTotalSelected: boolean;
|
|
572
572
|
emptyStateText: string;
|
package/dist/Switch.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as x, useAttrs as v, useSlots as g, useCssModule as y, computed as o, openBlock as i, createElementBlock as d, normalizeClass as s, unref as a, createElementVNode as c, mergeProps as C, withDirectives as S, vModelCheckbox as A, toDisplayString as u, createCommentVNode as _, renderSlot as V, createTextVNode as B } from "vue";
|
|
2
2
|
import M from "@leaflink/snitch";
|
|
3
3
|
import T from "lodash-es/uniqueId";
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
4
|
+
import { _ as E } from "./_plugin-vue_export-helper-dad06003.js";
|
|
5
|
+
const N = ["data-test"], D = ["for"], I = ["id", "disabled", "name", "value"], $ = /* @__PURE__ */ x({
|
|
6
6
|
name: "ll-switch",
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "Switch",
|
|
@@ -16,81 +16,97 @@ const E = ["data-test"], N = ["for"], D = ["id", "disabled", "name", "value"], I
|
|
|
16
16
|
value: { default: "" }
|
|
17
17
|
},
|
|
18
18
|
emits: ["update:checked"],
|
|
19
|
-
setup(
|
|
20
|
-
const t =
|
|
21
|
-
if (typeof t.value == "boolean" && M.warn("Switch: use `checked` to toggle the state; `value` is what will be set if `checked` is true"),
|
|
19
|
+
setup(b, { emit: p }) {
|
|
20
|
+
const t = b, l = v(), f = g(), n = y();
|
|
21
|
+
if (typeof t.value == "boolean" && M.warn("Switch: use `checked` to toggle the state; `value` is what will be set if `checked` is true"), l.onChange)
|
|
22
22
|
throw new Error("ll-switch: use the @update:checked event instead of @change.");
|
|
23
|
-
const
|
|
24
|
-
const e = { ...
|
|
23
|
+
const k = o(() => {
|
|
24
|
+
const e = { ...l };
|
|
25
25
|
return delete e["data-test"], delete e.class, e;
|
|
26
|
-
}),
|
|
26
|
+
}), h = o({
|
|
27
27
|
get() {
|
|
28
28
|
return t.checked;
|
|
29
29
|
},
|
|
30
30
|
set(e) {
|
|
31
|
-
|
|
31
|
+
p("update:checked", e);
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
34
|
-
return (e,
|
|
35
|
-
class: s(["stash-switch", a(
|
|
36
|
-
"data-test": a(
|
|
33
|
+
}), r = o(() => t.id || T("switch-"));
|
|
34
|
+
return (e, w) => (i(), d("div", {
|
|
35
|
+
class: s(["stash-switch", a(l).class]),
|
|
36
|
+
"data-test": a(l)["data-test"] || "stash-switch"
|
|
37
37
|
}, [
|
|
38
|
-
|
|
39
|
-
for:
|
|
38
|
+
c("label", C({
|
|
39
|
+
for: r.value,
|
|
40
40
|
class: [{ "tw-pointer-events-none": t.disabled }, "tw-flex tw-cursor-pointer"],
|
|
41
41
|
"data-test": "stash-switch|label"
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
class: s(["tw-relative tw-inline-block tw-h-5 tw-w-[34px] tw-min-w-[34px]", { [a(
|
|
42
|
+
}, k.value), [
|
|
43
|
+
c("span", {
|
|
44
|
+
class: s(["tw-relative tw-inline-block tw-h-5 tw-w-[34px] tw-min-w-[34px]", { [a(n).active]: t.checked }])
|
|
45
45
|
}, [
|
|
46
|
-
|
|
47
|
-
class: s(["stash-switch__track tw-absolute tw-top-0.5 tw-h-4 tw-w-full tw-rounded-[10px]",
|
|
46
|
+
c("span", {
|
|
47
|
+
class: s(["stash-switch__track tw-absolute tw-top-0.5 tw-h-4 tw-w-full tw-rounded-[10px]", {
|
|
48
|
+
"tw-bg-blue-500": t.checked && !t.disabled,
|
|
49
|
+
"tw-bg-ice-700": !t.checked && !t.disabled,
|
|
50
|
+
"stash-switch__track--disabled tw-bg-ice-500": t.disabled,
|
|
51
|
+
"stash-switch__track--on": t.checked,
|
|
52
|
+
"stash-switch__track--off": !t.checked
|
|
53
|
+
}]),
|
|
54
|
+
"data-test": "stash-switch|track"
|
|
48
55
|
}, null, 2),
|
|
49
|
-
|
|
50
|
-
class: s(["stash-switch__control tw-absolute tw-left-0 tw-h-5 tw-w-5 tw-rounded-[10px] tw-border tw-border-solid tw-border-ice-500 tw-bg-white tw-shadow",
|
|
56
|
+
c("span", {
|
|
57
|
+
class: s(["stash-switch__control tw-absolute tw-left-0 tw-h-5 tw-w-5 tw-rounded-[10px] tw-border tw-border-solid tw-border-ice-500 tw-bg-white tw-shadow", [
|
|
58
|
+
a(n).control,
|
|
59
|
+
{
|
|
60
|
+
"stash-switch__control--on": t.checked,
|
|
61
|
+
"stash-switch__control--off": !t.checked,
|
|
62
|
+
"stash-switch__control--disabled": t.disabled
|
|
63
|
+
}
|
|
64
|
+
]]),
|
|
65
|
+
"data-test": "stash-switch|control"
|
|
51
66
|
}, null, 2)
|
|
52
67
|
], 2),
|
|
53
|
-
S(
|
|
54
|
-
id:
|
|
55
|
-
"onUpdate:modelValue":
|
|
68
|
+
S(c("input", {
|
|
69
|
+
id: r.value,
|
|
70
|
+
"onUpdate:modelValue": w[0] || (w[0] = (m) => h.value = m),
|
|
56
71
|
type: "checkbox",
|
|
57
72
|
disabled: t.disabled,
|
|
58
73
|
name: t.name,
|
|
59
74
|
tabindex: "0",
|
|
60
75
|
value: e.value,
|
|
61
76
|
class: "tw-sr-only"
|
|
62
|
-
}, null, 8,
|
|
63
|
-
[A,
|
|
77
|
+
}, null, 8, I), [
|
|
78
|
+
[A, h.value]
|
|
64
79
|
]),
|
|
65
80
|
t.label ? (i(), d("span", {
|
|
66
81
|
key: 0,
|
|
67
82
|
class: s([{
|
|
83
|
+
"tw-text-ice-900": t.checked && !t.disabled,
|
|
68
84
|
"tw-text-ice-700": !t.checked && !t.disabled,
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
|
|
85
|
+
"stash-switch__label-text--on": t.checked,
|
|
86
|
+
"stash-switch__label-text--off": !t.checked,
|
|
87
|
+
"stash-switch__label-text--disabled tw-text-ice-500": t.disabled
|
|
88
|
+
}, "stash-switch__label-text tw-relative tw-top-px tw-ml-1.5"]),
|
|
72
89
|
"data-test": "stash-switch|label-text"
|
|
73
|
-
}, u(t.label), 3)) :
|
|
74
|
-
], 16,
|
|
75
|
-
t.hintText || a(
|
|
90
|
+
}, u(t.label), 3)) : _("", !0)
|
|
91
|
+
], 16, D),
|
|
92
|
+
t.hintText || a(f).hint ? (i(), d("span", {
|
|
76
93
|
key: 0,
|
|
77
|
-
class: s(["tw-ml-[40px] tw-mt-1.5 tw-block tw-whitespace-pre-line tw-text-xs", { "tw-text-ice-500": t.disabled }]),
|
|
94
|
+
class: s(["stash-switch__hint tw-ml-[40px] tw-mt-1.5 tw-block tw-whitespace-pre-line tw-text-xs", { "stash-switch__hint--disabled tw-text-ice-500": t.disabled }]),
|
|
78
95
|
"data-test": "stash-switch|hint"
|
|
79
96
|
}, [
|
|
80
97
|
V(e.$slots, "hint", {}, () => [
|
|
81
98
|
B(u(t.hintText), 1)
|
|
82
99
|
])
|
|
83
|
-
], 2)) :
|
|
84
|
-
], 10,
|
|
100
|
+
], 2)) : _("", !0)
|
|
101
|
+
], 10, N));
|
|
85
102
|
}
|
|
86
|
-
}),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
control: z
|
|
103
|
+
}), q = "_control_8a1ic_2", z = "_active_8a1ic_5", P = {
|
|
104
|
+
control: q,
|
|
105
|
+
active: z
|
|
90
106
|
}, U = {
|
|
91
107
|
$style: P
|
|
92
|
-
},
|
|
108
|
+
}, J = /* @__PURE__ */ E($, [["__cssModules", U]]);
|
|
93
109
|
export {
|
|
94
|
-
|
|
110
|
+
J as default
|
|
95
111
|
};
|
|
96
112
|
//# sourceMappingURL=Switch.js.map
|
package/dist/Switch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","sources":["../src/components/Switch/Switch.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, useAttrs, useCssModule, useSlots } from 'vue';\n\n export interface SwitchProps {\n /**\n * The current checked value, can be a boolean or an array of values\n */\n checked?: boolean | Array<string | number>;\n /**\n * Prevent the user from changing the switch state.\n */\n disabled?: boolean;\n /**\n * Displays text below the input; hidden when the isReadOnly prop is truthy.\n */\n hintText?: string;\n /**\n * Unique ID for the switch, required for accessibility purposes\n */\n id?: string;\n /**\n * Label text to display with switch\n */\n label?: string;\n /**\n * HTML name property\n */\n name?: string;\n /**\n * Value associated with switch when it is `checked`. This value is\n * used to compare against `checked` property when passed as an array.\n */\n value?: string | number;\n }\n\n defineOptions({\n name: 'll-switch',\n inheritAttrs: false,\n });\n\n const props = withDefaults(defineProps<SwitchProps>(), {\n checked: false,\n disabled: false,\n hintText: '',\n id: undefined,\n label: '',\n name: '',\n value: '',\n });\n\n const attrs = useAttrs();\n const slots = useSlots();\n const classes = useCssModule();\n\n const emit =\n defineEmits<{\n (e: 'update:checked', value: SwitchProps['checked']): void;\n }>();\n\n if (typeof props.value === 'boolean') {\n logger.warn('Switch: use `checked` to toggle the state; `value` is what will be set if `checked` is true');\n }\n\n if (attrs.onChange) {\n throw new Error('ll-switch: use the @update:checked event instead of @change.');\n }\n\n const switchAttrs = computed(() => {\n const tempAttrs = { ...attrs };\n\n delete tempAttrs['data-test'];\n delete tempAttrs.class;\n\n return tempAttrs;\n });\n\n const internalValue = computed({\n get() {\n return props.checked;\n },\n set(value) {\n emit('update:checked', value);\n },\n });\n\n const switchId = computed(() => props.id || uniqueId('switch-'));\n</script>\n\n<template>\n <div class=\"stash-switch\" :class=\"attrs['class']\" :data-test=\"attrs['data-test'] || 'stash-switch'\">\n <label\n :for=\"switchId\"\n :class=\"{ 'tw-pointer-events-none': props.disabled }\"\n class=\"tw-flex tw-cursor-pointer\"\n data-test=\"stash-switch|label\"\n v-bind=\"switchAttrs\"\n >\n <span\n class=\"tw-relative tw-inline-block tw-h-5 tw-w-[34px] tw-min-w-[34px]\"\n :class=\"{ [classes.active]: props.checked }\"\n >\n <span\n class=\"stash-switch__track tw-absolute tw-top-0.5 tw-h-4 tw-w-full tw-rounded-[10px]\"\n :class=\"
|
|
1
|
+
{"version":3,"file":"Switch.js","sources":["../src/components/Switch/Switch.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, useAttrs, useCssModule, useSlots } from 'vue';\n\n export interface SwitchProps {\n /**\n * The current checked value, can be a boolean or an array of values\n */\n checked?: boolean | Array<string | number>;\n\n /**\n * Prevent the user from changing the switch state.\n */\n disabled?: boolean;\n\n /**\n * Displays text below the input; hidden when the isReadOnly prop is truthy.\n */\n hintText?: string;\n\n /**\n * Unique ID for the switch, required for accessibility purposes\n */\n id?: string;\n\n /**\n * Label text to display with switch\n */\n label?: string;\n\n /**\n * HTML name property\n */\n name?: string;\n\n /**\n * Value associated with switch when it is `checked`. This value is\n * used to compare against `checked` property when passed as an array.\n */\n value?: string | number;\n }\n\n defineOptions({\n name: 'll-switch',\n inheritAttrs: false,\n });\n\n const props = withDefaults(defineProps<SwitchProps>(), {\n checked: false,\n disabled: false,\n hintText: '',\n id: undefined,\n label: '',\n name: '',\n value: '',\n });\n\n const attrs = useAttrs();\n const slots = useSlots();\n const classes = useCssModule();\n\n const emit =\n defineEmits<{\n (e: 'update:checked', value: SwitchProps['checked']): void;\n }>();\n\n if (typeof props.value === 'boolean') {\n logger.warn('Switch: use `checked` to toggle the state; `value` is what will be set if `checked` is true');\n }\n\n if (attrs.onChange) {\n throw new Error('ll-switch: use the @update:checked event instead of @change.');\n }\n\n const switchAttrs = computed(() => {\n const tempAttrs = { ...attrs };\n\n delete tempAttrs['data-test'];\n delete tempAttrs.class;\n\n return tempAttrs;\n });\n\n const internalValue = computed({\n get() {\n return props.checked;\n },\n set(value) {\n emit('update:checked', value);\n },\n });\n\n const switchId = computed(() => props.id || uniqueId('switch-'));\n</script>\n\n<template>\n <div class=\"stash-switch\" :class=\"attrs['class']\" :data-test=\"attrs['data-test'] || 'stash-switch'\">\n <label\n :for=\"switchId\"\n :class=\"{ 'tw-pointer-events-none': props.disabled }\"\n class=\"tw-flex tw-cursor-pointer\"\n data-test=\"stash-switch|label\"\n v-bind=\"switchAttrs\"\n >\n <span\n class=\"tw-relative tw-inline-block tw-h-5 tw-w-[34px] tw-min-w-[34px]\"\n :class=\"{ [classes.active]: props.checked }\"\n >\n <span\n class=\"stash-switch__track tw-absolute tw-top-0.5 tw-h-4 tw-w-full tw-rounded-[10px]\"\n :class=\"{\n 'tw-bg-blue-500': props.checked && !props.disabled,\n 'tw-bg-ice-700': !props.checked && !props.disabled,\n 'stash-switch__track--disabled tw-bg-ice-500': props.disabled,\n 'stash-switch__track--on': props.checked,\n 'stash-switch__track--off': !props.checked,\n }\"\n data-test=\"stash-switch|track\"\n ></span>\n <span\n class=\"\n stash-switch__control\n tw-absolute\n tw-left-0\n tw-h-5\n tw-w-5\n tw-rounded-[10px]\n tw-border\n tw-border-solid\n tw-border-ice-500\n tw-bg-white\n tw-shadow\n \"\n :class=\"[\n classes.control,\n {\n 'stash-switch__control--on': props.checked,\n 'stash-switch__control--off': !props.checked,\n 'stash-switch__control--disabled': props.disabled,\n },\n ]\"\n data-test=\"stash-switch|control\"\n ></span>\n </span>\n <input\n :id=\"switchId\"\n v-model=\"internalValue\"\n type=\"checkbox\"\n :disabled=\"props.disabled\"\n :name=\"props.name\"\n tabindex=\"0\"\n :value=\"value\"\n class=\"tw-sr-only\"\n />\n <span\n v-if=\"props.label\"\n :class=\"{\n 'tw-text-ice-900': props.checked && !props.disabled,\n 'tw-text-ice-700': !props.checked && !props.disabled,\n 'stash-switch__label-text--on': props.checked,\n 'stash-switch__label-text--off': !props.checked,\n 'stash-switch__label-text--disabled tw-text-ice-500': props.disabled,\n }\"\n class=\"stash-switch__label-text tw-relative tw-top-px tw-ml-1.5\"\n data-test=\"stash-switch|label-text\"\n >\n {{ props.label }}\n </span>\n </label>\n <span\n v-if=\"props.hintText || slots.hint\"\n class=\"stash-switch__hint tw-ml-[40px] tw-mt-1.5 tw-block tw-whitespace-pre-line tw-text-xs\"\n :class=\"{ 'stash-switch__hint--disabled tw-text-ice-500': props.disabled }\"\n data-test=\"stash-switch|hint\"\n >\n <!-- @slot for displaying hint text -->\n <slot name=\"hint\">{{ props.hintText }}</slot>\n </span>\n </div>\n</template>\n\n<style module>\n .control {\n transition: left 0.2s ease-in-out;\n\n .active & {\n @apply tw-left-3.5; /* track width - switch width */\n }\n }\n</style>\n"],"names":["attrs","useAttrs","slots","useSlots","classes","useCssModule","props","logger","switchAttrs","computed","tempAttrs","internalValue","value","emit","switchId","uniqueId"],"mappings":";;;;;;;;;;;;;;;;;;;iBA0DQA,IAAQC,KACRC,IAAQC,KACRC,IAAUC;AAWhB,QAJI,OAAOC,EAAM,SAAU,aACzBC,EAAO,KAAK,6FAA6F,GAGvGP,EAAM;AACF,YAAA,IAAI,MAAM,8DAA8D;AAG1E,UAAAQ,IAAcC,EAAS,MAAM;AAC3B,YAAAC,IAAY,EAAE,GAAGV;AAEvB,oBAAOU,EAAU,WAAW,GAC5B,OAAOA,EAAU,OAEVA;AAAA,IAAA,CACR,GAEKC,IAAgBF,EAAS;AAAA,MAC7B,MAAM;AACJ,eAAOH,EAAM;AAAA,MACf;AAAA,MACA,IAAIM,GAAO;AACT,QAAAC,EAAK,kBAAkBD,CAAK;AAAA,MAC9B;AAAA,IAAA,CACD,GAEKE,IAAWL,EAAS,MAAMH,EAAM,MAAMS,EAAS,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|