@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/Paginate.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as
|
|
1
|
+
import { defineComponent as M, useCssModule as N, computed as D, toRef as u, createElementBlock as i, openBlock as l, createElementVNode as p, normalizeClass as o, unref as n, createVNode as _, toDisplayString as v, Fragment as m, renderList as E, createCommentVNode as d } from "vue";
|
|
2
|
+
import { u as $ } from "./usePaginationStats-d_q39naC.js";
|
|
3
3
|
import { t as g } from "./locale.js";
|
|
4
4
|
import h from "./Icon.js";
|
|
5
|
-
import { _ as
|
|
5
|
+
import { _ as w } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const B = {
|
|
7
|
-
class: "stash-paginate
|
|
7
|
+
class: "stash-paginate flex justify-center",
|
|
8
8
|
"data-test": "stash-paginate"
|
|
9
9
|
}, V = ["aria-label", "disabled"], F = {
|
|
10
10
|
key: 0,
|
|
11
|
-
class: "
|
|
12
|
-
}, I = ["onClick"], j = ["aria-label", "disabled"], R = /* @__PURE__ */
|
|
11
|
+
class: "mx-3 text-ice-900"
|
|
12
|
+
}, I = ["onClick"], j = ["aria-label", "disabled"], R = /* @__PURE__ */ M({
|
|
13
13
|
name: "ll-paginate",
|
|
14
14
|
__name: "Paginate",
|
|
15
15
|
props: {
|
|
@@ -21,91 +21,91 @@ const B = {
|
|
|
21
21
|
},
|
|
22
22
|
emits: ["set-page"],
|
|
23
23
|
setup(P, { emit: b }) {
|
|
24
|
-
const
|
|
25
|
-
currentPage: u(() =>
|
|
26
|
-
pageSize: u(() =>
|
|
27
|
-
totalItems: u(() =>
|
|
24
|
+
const e = P, x = b, r = N(), a = D(() => Math.ceil(e.listLength / e.pageSize)), k = e.variant === "stats" ? $({
|
|
25
|
+
currentPage: u(() => e.currentPage),
|
|
26
|
+
pageSize: u(() => e.pageSize),
|
|
27
|
+
totalItems: u(() => e.listLength)
|
|
28
28
|
}) : null;
|
|
29
|
-
function c(
|
|
30
|
-
x("set-page",
|
|
29
|
+
function c(t) {
|
|
30
|
+
x("set-page", t);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
|
|
32
|
+
function y() {
|
|
33
|
+
e.currentPage < a.value && c(e.currentPage + 1);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
|
|
35
|
+
function z() {
|
|
36
|
+
e.currentPage > 1 && c(e.currentPage - 1);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
const f = Math.abs(
|
|
40
|
-
return a.value < 10 ||
|
|
38
|
+
function S(t) {
|
|
39
|
+
const f = Math.abs(e.currentPage - t);
|
|
40
|
+
return a.value < 10 || t === 1 || t === a.value || e.currentPage < 6 && t < 8 || a.value - e.currentPage < 5 && a.value - t < 7 || f < 3;
|
|
41
41
|
}
|
|
42
|
-
function C(
|
|
43
|
-
return a.value > 9 &&
|
|
42
|
+
function C(t) {
|
|
43
|
+
return a.value > 9 && e.currentPage > 5 && t === 2;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
return a.value > 9 && a.value -
|
|
45
|
+
function L(t) {
|
|
46
|
+
return a.value > 9 && a.value - e.currentPage > 4 && t === a.value - 1;
|
|
47
47
|
}
|
|
48
|
-
return (
|
|
49
|
-
|
|
50
|
-
class: o(["stash-paginate__list
|
|
48
|
+
return (t, f) => (l(), i("div", B, [
|
|
49
|
+
p("ul", {
|
|
50
|
+
class: o(["stash-paginate__list flex items-center", n(r).pagination]),
|
|
51
51
|
"data-test": "stash-paginate|list"
|
|
52
52
|
}, [
|
|
53
|
-
|
|
53
|
+
p("button", {
|
|
54
54
|
"aria-label": n(g)("ll.previous"),
|
|
55
55
|
"data-test": "stash-paginate|prev-page",
|
|
56
56
|
class: o(n(r).prev),
|
|
57
|
-
disabled:
|
|
58
|
-
onClick:
|
|
57
|
+
disabled: e.currentPage === 1,
|
|
58
|
+
onClick: z
|
|
59
59
|
}, [
|
|
60
60
|
_(h, {
|
|
61
61
|
size: "small",
|
|
62
62
|
name: "chevron-left"
|
|
63
63
|
})
|
|
64
64
|
], 10, V),
|
|
65
|
-
|
|
65
|
+
e.variant === "stats" ? (l(), i("span", F, v(n(g)("ll.pageStats", n(k))), 1)) : (l(!0), i(m, { key: 1 }, E(a.value, (s) => (l(), i(m, null, [
|
|
66
66
|
C(s) ? (l(), i("button", {
|
|
67
67
|
key: `${s}-ellipsis`,
|
|
68
|
-
class: "
|
|
68
|
+
class: "pointer-events-none",
|
|
69
69
|
"data-test": "stash-paginate|first-ellipsis",
|
|
70
70
|
tabindex: "-1"
|
|
71
|
-
}, " … ")) :
|
|
72
|
-
|
|
71
|
+
}, " … ")) : d("", !0),
|
|
72
|
+
S(s) ? (l(), i("button", {
|
|
73
73
|
key: s,
|
|
74
74
|
"data-test": "stash-paginate|page-number",
|
|
75
|
-
class: o({ [n(r)["is-active"]]:
|
|
75
|
+
class: o({ [n(r)["is-active"]]: e.currentPage === s }),
|
|
76
76
|
onClick: (K) => c(s)
|
|
77
|
-
},
|
|
78
|
-
|
|
77
|
+
}, v(s), 11, I)) : d("", !0),
|
|
78
|
+
L(s) ? (l(), i("button", {
|
|
79
79
|
key: `${s}-ellipsis`,
|
|
80
|
-
class: "
|
|
80
|
+
class: "pointer-events-none",
|
|
81
81
|
"data-test": "stash-paginate|last-ellipsis",
|
|
82
82
|
tabindex: "-1"
|
|
83
|
-
}, " … ")) :
|
|
83
|
+
}, " … ")) : d("", !0)
|
|
84
84
|
], 64))), 256)),
|
|
85
|
-
|
|
85
|
+
p("button", {
|
|
86
86
|
"aria-label": n(g)("ll.next"),
|
|
87
87
|
"data-test": "stash-paginate|next-page",
|
|
88
88
|
class: o(n(r).next),
|
|
89
|
-
disabled:
|
|
90
|
-
onClick:
|
|
89
|
+
disabled: e.isNextDisabled || e.currentPage === a.value,
|
|
90
|
+
onClick: y
|
|
91
91
|
}, [
|
|
92
92
|
_(h, {
|
|
93
93
|
size: "small",
|
|
94
|
-
class: "
|
|
94
|
+
class: "rotate-180",
|
|
95
95
|
name: "chevron-left"
|
|
96
96
|
})
|
|
97
97
|
], 10, j)
|
|
98
98
|
], 2)
|
|
99
99
|
]));
|
|
100
100
|
}
|
|
101
|
-
}), q = "
|
|
101
|
+
}), q = "_pagination_kzyvn_5", A = "_prev_kzyvn_23", G = "_next_kzyvn_28", H = {
|
|
102
102
|
pagination: q,
|
|
103
103
|
prev: A,
|
|
104
104
|
next: G,
|
|
105
|
-
"is-active": "_is-
|
|
105
|
+
"is-active": "_is-active_kzyvn_41"
|
|
106
106
|
}, J = {
|
|
107
107
|
$style: H
|
|
108
|
-
}, X = /* @__PURE__ */
|
|
108
|
+
}, X = /* @__PURE__ */ w(R, [["__cssModules", J]]);
|
|
109
109
|
export {
|
|
110
110
|
X as default
|
|
111
111
|
};
|
package/dist/Paginate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paginate.js","sources":["../src/components/Paginate/Paginate.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, toRef, useCssModule } from 'vue';\n\n import usePaginationStats from '../../composables/usePaginationStats/usePaginationStats';\n import { t } from '../../locale';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({\n name: 'll-paginate',\n });\n\n export interface PaginateProps {\n /**\n * Current page number\n */\n currentPage?: number;\n /**\n * Total number of items in list\n */\n listLength?: number;\n /**\n * Number of items per page\n */\n pageSize?: number;\n /*\n * Optional override for the next button disabled state\n */\n isNextDisabled?: boolean;\n /**\n * Variant of the pagination component\n */\n variant?: 'standard' | 'stats';\n }\n\n const props = withDefaults(defineProps<PaginateProps>(), {\n currentPage: 1,\n listLength: 1,\n pageSize: 50,\n isNextDisabled: false,\n variant: 'standard',\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the page number changes.\n */\n (e: 'set-page', pageNumber: number): void;\n }>();\n\n const classes = useCssModule();\n\n const pageCount = computed(() => Math.ceil(props.listLength / props.pageSize));\n\n const pageStats =\n props.variant === 'stats'\n ? usePaginationStats({\n currentPage: toRef(() => props.currentPage),\n pageSize: toRef(() => props.pageSize),\n totalItems: toRef(() => props.listLength),\n })\n : null;\n\n /**\n * Emits current page to list view.\n */\n function updatePage(currentPage: number) {\n emit('set-page', currentPage);\n }\n\n /**\n * Sets current page to next page\n */\n function next() {\n if (props.currentPage < pageCount.value) {\n updatePage(props.currentPage + 1);\n }\n }\n\n /**\n * Sets current page to previous page\n */\n function prev() {\n if (props.currentPage > 1) {\n updatePage(props.currentPage - 1);\n }\n }\n\n /**\n * Determines whether to show page\n * @returns {boolean} - should show page in pagination component\n */\n function shouldShowPage(page: number): boolean {\n const pageDiff = Math.abs(props.currentPage - page);\n\n if (\n pageCount.value < 10 ||\n page === 1 ||\n page === pageCount.value ||\n (props.currentPage < 6 && page < 8) ||\n (pageCount.value - props.currentPage < 5 && pageCount.value - page < 7) ||\n pageDiff < 3\n ) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Determines whether to show the leading ellipsis\n * @returns {boolean} should show or not\n */\n function shouldShowFirstEllipsis(page: number): boolean {\n return pageCount.value > 9 && props.currentPage > 5 && page === 2;\n }\n\n /**\n * Determines whether to show the trailing ellipsis\n * @returns {boolean} should show or not\n */\n function shouldShowLastEllipsis(page: number): boolean {\n return pageCount.value > 9 && pageCount.value - props.currentPage > 4 && page === pageCount.value - 1;\n }\n</script>\n\n<template>\n <div class=\"stash-paginate
|
|
1
|
+
{"version":3,"file":"Paginate.js","sources":["../src/components/Paginate/Paginate.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, toRef, useCssModule } from 'vue';\n\n import usePaginationStats from '../../composables/usePaginationStats/usePaginationStats';\n import { t } from '../../locale';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({\n name: 'll-paginate',\n });\n\n export interface PaginateProps {\n /**\n * Current page number\n */\n currentPage?: number;\n /**\n * Total number of items in list\n */\n listLength?: number;\n /**\n * Number of items per page\n */\n pageSize?: number;\n /*\n * Optional override for the next button disabled state\n */\n isNextDisabled?: boolean;\n /**\n * Variant of the pagination component\n */\n variant?: 'standard' | 'stats';\n }\n\n const props = withDefaults(defineProps<PaginateProps>(), {\n currentPage: 1,\n listLength: 1,\n pageSize: 50,\n isNextDisabled: false,\n variant: 'standard',\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the page number changes.\n */\n (e: 'set-page', pageNumber: number): void;\n }>();\n\n const classes = useCssModule();\n\n const pageCount = computed(() => Math.ceil(props.listLength / props.pageSize));\n\n const pageStats =\n props.variant === 'stats'\n ? usePaginationStats({\n currentPage: toRef(() => props.currentPage),\n pageSize: toRef(() => props.pageSize),\n totalItems: toRef(() => props.listLength),\n })\n : null;\n\n /**\n * Emits current page to list view.\n */\n function updatePage(currentPage: number) {\n emit('set-page', currentPage);\n }\n\n /**\n * Sets current page to next page\n */\n function next() {\n if (props.currentPage < pageCount.value) {\n updatePage(props.currentPage + 1);\n }\n }\n\n /**\n * Sets current page to previous page\n */\n function prev() {\n if (props.currentPage > 1) {\n updatePage(props.currentPage - 1);\n }\n }\n\n /**\n * Determines whether to show page\n * @returns {boolean} - should show page in pagination component\n */\n function shouldShowPage(page: number): boolean {\n const pageDiff = Math.abs(props.currentPage - page);\n\n if (\n pageCount.value < 10 ||\n page === 1 ||\n page === pageCount.value ||\n (props.currentPage < 6 && page < 8) ||\n (pageCount.value - props.currentPage < 5 && pageCount.value - page < 7) ||\n pageDiff < 3\n ) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Determines whether to show the leading ellipsis\n * @returns {boolean} should show or not\n */\n function shouldShowFirstEllipsis(page: number): boolean {\n return pageCount.value > 9 && props.currentPage > 5 && page === 2;\n }\n\n /**\n * Determines whether to show the trailing ellipsis\n * @returns {boolean} should show or not\n */\n function shouldShowLastEllipsis(page: number): boolean {\n return pageCount.value > 9 && pageCount.value - props.currentPage > 4 && page === pageCount.value - 1;\n }\n</script>\n\n<template>\n <div class=\"stash-paginate flex justify-center\" data-test=\"stash-paginate\">\n <ul class=\"stash-paginate__list flex items-center\" :class=\"classes.pagination\" data-test=\"stash-paginate|list\">\n <button\n :aria-label=\"t('ll.previous')\"\n data-test=\"stash-paginate|prev-page\"\n :class=\"classes.prev\"\n :disabled=\"props.currentPage === 1\"\n @click=\"prev\"\n >\n <Icon size=\"small\" name=\"chevron-left\" />\n </button>\n <span v-if=\"props.variant === 'stats'\" class=\"mx-3 text-ice-900\">\n {{ t('ll.pageStats', pageStats) }}\n </span>\n <template v-for=\"page in pageCount\" v-else>\n <button\n v-if=\"shouldShowFirstEllipsis(page)\"\n :key=\"`${page}-ellipsis`\"\n class=\"pointer-events-none\"\n data-test=\"stash-paginate|first-ellipsis\"\n tabindex=\"-1\"\n >\n …\n </button>\n <button\n v-if=\"shouldShowPage(page)\"\n :key=\"page\"\n data-test=\"stash-paginate|page-number\"\n :class=\"{ [classes['is-active']]: props.currentPage === page }\"\n @click=\"updatePage(page)\"\n >\n {{ page }}\n </button>\n <button\n v-if=\"shouldShowLastEllipsis(page)\"\n :key=\"`${page}-ellipsis`\"\n class=\"pointer-events-none\"\n data-test=\"stash-paginate|last-ellipsis\"\n tabindex=\"-1\"\n >\n …\n </button>\n </template>\n <button\n :aria-label=\"t('ll.next')\"\n data-test=\"stash-paginate|next-page\"\n :class=\"classes.next\"\n :disabled=\"props.isNextDisabled || props.currentPage === pageCount\"\n @click=\"next\"\n >\n <Icon size=\"small\" class=\"rotate-180\" name=\"chevron-left\" />\n </button>\n </ul>\n </div>\n</template>\n\n<style module>\n @reference \"../../../styles/main.css\";\n\n @layer utilities {\n .pagination {\n /* Todo: We shouldn't really be making assumptions about the outer spacing of the pagination component */\n margin-top: --spacing(12);\n z-index: 0;\n\n a,\n button {\n @apply border border-solid border-ice-200;\n align-items: center;\n background-color: var(--color-white);\n color: var(--color-blue-500);\n cursor: pointer;\n display: flex;\n height: var(--height-input);\n justify-content: center;\n margin: 0 0 0 -1px;\n width: var(--height-input);\n\n &.prev {\n border-bottom-left-radius: var(--radius-sm);\n border-top-left-radius: var(--radius-sm);\n }\n\n &.next {\n border-bottom-right-radius: var(--radius-sm);\n border-top-right-radius: var(--radius-sm);\n }\n\n &:focus {\n outline: none;\n }\n\n &:hover {\n text-decoration: none;\n }\n\n &.is-active {\n background-color: var(--color-blue-500);\n color: var(--color-white);\n pointer-events: none;\n z-index: var(--z-index-control);\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n &:not(:disabled):hover,\n &:not(:disabled):focus,\n &.is-active {\n @apply border border-solid border-blue-500;\n position: relative;\n }\n\n &.is-active:focus {\n @apply bg-blue-700 border-blue-700;\n }\n }\n }\n }\n</style>\n"],"names":["props","__props","emit","__emit","classes","useCssModule","pageCount","computed","pageStats","usePaginationStats","toRef","updatePage","currentPage","next","prev","shouldShowPage","page","pageDiff","shouldShowFirstEllipsis","shouldShowLastEllipsis"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkCE,UAAMA,IAAQC,GAQRC,IAAOC,GAOPC,IAAUC,EAAA,GAEVC,IAAYC,EAAS,MAAM,KAAK,KAAKP,EAAM,aAAaA,EAAM,QAAQ,CAAC,GAEvEQ,IACJR,EAAM,YAAY,UACdS,EAAmB;AAAA,MACjB,aAAaC,EAAM,MAAMV,EAAM,WAAW;AAAA,MAC1C,UAAUU,EAAM,MAAMV,EAAM,QAAQ;AAAA,MACpC,YAAYU,EAAM,MAAMV,EAAM,UAAU;AAAA,IAAA,CACzC,IACD;AAKN,aAASW,EAAWC,GAAqB;AACvC,MAAAV,EAAK,YAAYU,CAAW;AAAA,IAC9B;AAKA,aAASC,IAAO;AACd,MAAIb,EAAM,cAAcM,EAAU,SAChCK,EAAWX,EAAM,cAAc,CAAC;AAAA,IAEpC;AAKA,aAASc,IAAO;AACd,MAAId,EAAM,cAAc,KACtBW,EAAWX,EAAM,cAAc,CAAC;AAAA,IAEpC;AAMA,aAASe,EAAeC,GAAuB;AAC7C,YAAMC,IAAW,KAAK,IAAIjB,EAAM,cAAcgB,CAAI;AAElD,aACEV,EAAU,QAAQ,MAClBU,MAAS,KACTA,MAASV,EAAU,SAClBN,EAAM,cAAc,KAAKgB,IAAO,KAChCV,EAAU,QAAQN,EAAM,cAAc,KAAKM,EAAU,QAAQU,IAAO,KACrEC,IAAW;AAAA,IAMf;AAMA,aAASC,EAAwBF,GAAuB;AACtD,aAAOV,EAAU,QAAQ,KAAKN,EAAM,cAAc,KAAKgB,MAAS;AAAA,IAClE;AAMA,aAASG,EAAuBH,GAAuB;AACrD,aAAOV,EAAU,QAAQ,KAAKA,EAAU,QAAQN,EAAM,cAAc,KAAKgB,MAASV,EAAU,QAAQ;AAAA,IACtG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/QuickAction.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as u, useCssModule as _, computed as s, createBlock as d, openBlock as f, resolveDynamicComponent as
|
|
2
|
-
import
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as u, useCssModule as _, computed as s, createBlock as d, openBlock as f, resolveDynamicComponent as m, mergeProps as p, unref as h, withCtx as x, createElementVNode as e, createVNode as o, toDisplayString as r } from "vue";
|
|
2
|
+
import n from "./Icon.js";
|
|
3
|
+
import { _ as b } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
const k = { class: "flex items-center gap-3" }, v = { class: "flex items-center justify-center rounded bg-blue-100 p-3" }, g = { class: "flex-1" }, y = { class: "text-blue-500" }, C = { class: "text-xs font-normal text-ice-700 lg:mb-0" }, w = /* @__PURE__ */ u({
|
|
5
5
|
__name: "QuickAction",
|
|
6
6
|
props: {
|
|
7
7
|
title: {},
|
|
@@ -16,36 +16,36 @@ const b = { class: "tw-flex tw-items-center tw-gap-3" }, k = { class: "tw-flex t
|
|
|
16
16
|
} : t.href ? {
|
|
17
17
|
href: t.href
|
|
18
18
|
} : {});
|
|
19
|
-
return (B, D) => (f(), d(
|
|
20
|
-
class: ["stash-quick-action
|
|
19
|
+
return (B, D) => (f(), d(m(l.value), p(a.value, {
|
|
20
|
+
class: ["stash-quick-action rounded p-3 shadow", h(i).root],
|
|
21
21
|
"data-test": "stash-quick-action"
|
|
22
22
|
}), {
|
|
23
|
-
default:
|
|
24
|
-
e("div",
|
|
25
|
-
e("div",
|
|
26
|
-
o(
|
|
23
|
+
default: x(() => [
|
|
24
|
+
e("div", k, [
|
|
25
|
+
e("div", v, [
|
|
26
|
+
o(n, {
|
|
27
27
|
name: t.icon,
|
|
28
|
-
class: "
|
|
28
|
+
class: "text-blue-500"
|
|
29
29
|
}, null, 8, ["name"])
|
|
30
30
|
]),
|
|
31
|
-
e("div",
|
|
32
|
-
e("h4",
|
|
33
|
-
e("p",
|
|
31
|
+
e("div", g, [
|
|
32
|
+
e("h4", y, r(t.title), 1),
|
|
33
|
+
e("p", C, r(t.subtitle), 1)
|
|
34
34
|
]),
|
|
35
|
-
o(
|
|
35
|
+
o(n, {
|
|
36
36
|
name: "arrow-right",
|
|
37
|
-
class: "
|
|
37
|
+
class: "text-blue-500"
|
|
38
38
|
})
|
|
39
39
|
])
|
|
40
40
|
]),
|
|
41
41
|
_: 1
|
|
42
42
|
}, 16, ["class"]));
|
|
43
43
|
}
|
|
44
|
-
}), A = "
|
|
44
|
+
}), A = "_root_1iis9_3", M = {
|
|
45
45
|
root: A
|
|
46
46
|
}, q = {
|
|
47
47
|
$style: M
|
|
48
|
-
}, j = /* @__PURE__ */
|
|
48
|
+
}, j = /* @__PURE__ */ b(w, [["__cssModules", q]]);
|
|
49
49
|
export {
|
|
50
50
|
j as default
|
|
51
51
|
};
|
package/dist/QuickAction.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuickAction.js","sources":["../src/components/QuickAction/QuickAction.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, useCssModule } from 'vue';\n import { type RouteLocationRaw } from 'vue-router';\n\n import { IconName } from '../Icon/Icon.types';\n import Icon from '../Icon/Icon.vue';\n\n export interface QuickActionProps {\n /**\n * The title prop will show the first line of text\n */\n title: string;\n\n /**\n * The subtitle prop will show the second line of text\n */\n subtitle: string;\n\n /**\n * The `to` prop for vue-router's `RouterLink` component\n */\n to?: RouteLocationRaw;\n\n /**\n * If defined, the quick action will render as an `<a />` tag.\n */\n href?: string;\n\n /**\n * Icon to render on the left side\n */\n icon: IconName;\n }\n\n const props = defineProps<QuickActionProps>();\n const classes = useCssModule();\n\n const is = computed(() => {\n if (props.to) {\n return 'router-link';\n }\n\n if (props.href) {\n return 'a';\n }\n\n return 'div';\n });\n\n const linkAttrs = computed(() => {\n if (props.to) {\n return {\n to: props.to,\n };\n }\n\n if (props.href) {\n return {\n href: props.href,\n };\n }\n\n return {};\n });\n</script>\n\n<template>\n <component\n :is=\"is\"\n v-bind=\"linkAttrs\"\n class=\"stash-quick-action
|
|
1
|
+
{"version":3,"file":"QuickAction.js","sources":["../src/components/QuickAction/QuickAction.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, useCssModule } from 'vue';\n import { type RouteLocationRaw } from 'vue-router';\n\n import { IconName } from '../Icon/Icon.types';\n import Icon from '../Icon/Icon.vue';\n\n export interface QuickActionProps {\n /**\n * The title prop will show the first line of text\n */\n title: string;\n\n /**\n * The subtitle prop will show the second line of text\n */\n subtitle: string;\n\n /**\n * The `to` prop for vue-router's `RouterLink` component\n */\n to?: RouteLocationRaw;\n\n /**\n * If defined, the quick action will render as an `<a />` tag.\n */\n href?: string;\n\n /**\n * Icon to render on the left side\n */\n icon: IconName;\n }\n\n const props = defineProps<QuickActionProps>();\n const classes = useCssModule();\n\n const is = computed(() => {\n if (props.to) {\n return 'router-link';\n }\n\n if (props.href) {\n return 'a';\n }\n\n return 'div';\n });\n\n const linkAttrs = computed(() => {\n if (props.to) {\n return {\n to: props.to,\n };\n }\n\n if (props.href) {\n return {\n href: props.href,\n };\n }\n\n return {};\n });\n</script>\n\n<template>\n <component\n :is=\"is\"\n v-bind=\"linkAttrs\"\n class=\"stash-quick-action rounded p-3 shadow\"\n :class=\"classes.root\"\n data-test=\"stash-quick-action\"\n >\n <div class=\"flex items-center gap-3\">\n <div class=\"flex items-center justify-center rounded bg-blue-100 p-3\">\n <Icon :name=\"props.icon\" class=\"text-blue-500\" />\n </div>\n <div class=\"flex-1\">\n <h4 class=\"text-blue-500\">{{ props.title }}</h4>\n <p class=\"text-xs font-normal text-ice-700 lg:mb-0\">\n {{ props.subtitle }}\n </p>\n </div>\n <Icon name=\"arrow-right\" class=\"text-blue-500\" />\n </div>\n </component>\n</template>\n\n<style module>\n @layer utilities {\n .root {\n background-color: #fff;\n border: 1px solid transparent; /* it prevents layout size shifting of extra height/width when hover */\n cursor: pointer;\n display: inline-block;\n }\n\n .root:hover,\n .root:active,\n .root:focus {\n border: 1px solid var(--color-blue-500);\n text-decoration: none;\n }\n }\n</style>\n"],"names":["props","__props","classes","useCssModule","is","computed","linkAttrs"],"mappings":";;;;;;;;;;;;;AAkCE,UAAMA,IAAQC,GACRC,IAAUC,EAAA,GAEVC,IAAKC,EAAS,MACdL,EAAM,KACD,gBAGLA,EAAM,OACD,MAGF,KACR,GAEKM,IAAYD,EAAS,MACrBL,EAAM,KACD;AAAA,MACL,IAAIA,EAAM;AAAA,IAAA,IAIVA,EAAM,OACD;AAAA,MACL,MAAMA,EAAM;AAAA,IAAA,IAIT,CAAA,CACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/Radio.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useCssModule as
|
|
1
|
+
import { useCssModule as n, createElementBlock as i, openBlock as c, normalizeClass as a, withDirectives as u, createElementVNode as s, mergeProps as _, vModelRadio as m, toDisplayString as h } from "vue";
|
|
2
2
|
import { _ as f } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
-
const p = "
|
|
3
|
+
const p = "_root_1dy32_5", y = "_label_1dy32_10", b = "_error_1dy32_43", k = "_input_1dy32_48", g = {
|
|
4
4
|
root: p,
|
|
5
|
-
label:
|
|
6
|
-
error:
|
|
7
|
-
input:
|
|
5
|
+
label: y,
|
|
6
|
+
error: b,
|
|
7
|
+
input: k
|
|
8
8
|
}, v = {
|
|
9
9
|
name: "ll-radio",
|
|
10
10
|
props: {
|
|
@@ -50,7 +50,7 @@ const p = "_root_ul6uq_2", b = "_label_ul6uq_7", k = "_error_ul6uq_40", y = "_in
|
|
|
50
50
|
emits: ["update:checked"],
|
|
51
51
|
setup() {
|
|
52
52
|
return {
|
|
53
|
-
classes:
|
|
53
|
+
classes: n()
|
|
54
54
|
};
|
|
55
55
|
},
|
|
56
56
|
computed: {
|
|
@@ -67,30 +67,30 @@ const p = "_root_ul6uq_2", b = "_label_ul6uq_7", k = "_error_ul6uq_40", y = "_in
|
|
|
67
67
|
if (this.$attrs.onChange)
|
|
68
68
|
throw new Error("ll-radio: use the @update:checked event instead of @input");
|
|
69
69
|
}
|
|
70
|
-
},
|
|
71
|
-
function
|
|
72
|
-
return
|
|
70
|
+
}, E = ["id"], V = ["for"];
|
|
71
|
+
function w(e, l, t, r, M, o) {
|
|
72
|
+
return c(), i("div", {
|
|
73
73
|
class: a(["stash-radio", [r.classes.root, { error: t.hasError }]]),
|
|
74
74
|
"data-test": "ll-radio"
|
|
75
75
|
}, [
|
|
76
|
-
|
|
76
|
+
u(s("input", _({
|
|
77
77
|
id: t.id,
|
|
78
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
79
|
-
class: ["
|
|
78
|
+
"onUpdate:modelValue": l[0] || (l[0] = (d) => o.internalValue = d),
|
|
79
|
+
class: ["sr-only", r.classes.input],
|
|
80
80
|
type: "radio"
|
|
81
|
-
}, e.$attrs), null, 16,
|
|
81
|
+
}, e.$attrs), null, 16, E), [
|
|
82
82
|
[m, o.internalValue]
|
|
83
83
|
]),
|
|
84
84
|
s("label", {
|
|
85
85
|
for: t.id,
|
|
86
86
|
class: a(r.classes.label)
|
|
87
|
-
}, h(t.label), 11,
|
|
87
|
+
}, h(t.label), 11, V)
|
|
88
88
|
], 2);
|
|
89
89
|
}
|
|
90
|
-
const
|
|
90
|
+
const S = {
|
|
91
91
|
$style: g
|
|
92
|
-
},
|
|
92
|
+
}, N = /* @__PURE__ */ f(v, [["render", w], ["__cssModules", S]]);
|
|
93
93
|
export {
|
|
94
|
-
|
|
94
|
+
N as default
|
|
95
95
|
};
|
|
96
96
|
//# sourceMappingURL=Radio.js.map
|
package/dist/Radio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sources":["../src/components/Radio/Radio.vue"],"sourcesContent":["<script>\n import { useCssModule } from 'vue';\n\n /**\n * @deprecated use components/RadioNew/Radio instead.\n * if you need multiple Radio components considering using RadioGroup instead.\n */\n export default {\n name: 'll-radio',\n\n props: {\n /**\n * The checked/selected state of the radio button\n */\n checked: {\n type: [String, Number],\n default: undefined,\n },\n\n /**\n * @deprecated Use :checked or v-model:checked instead of :model-value and v-model.\n */\n modelValue: {\n type: [String, Number, null],\n default: null,\n validator(value) {\n if (value !== null) {\n throw new Error('ll-radio: use :checked or v-model:checked instead of :model-value and v-model.');\n }\n\n return true;\n },\n },\n\n /**\n * Adds error styling\n */\n hasError: Boolean,\n\n /**\n * A unique string to distinguish one Radio instance from another\n * and to link the label to the input; required for accessibility\n */\n id: {\n type: String,\n required: true,\n },\n\n /**\n * The description which appears to the right of the radio button\n */\n label: {\n type: String,\n default: '',\n },\n },\n\n emits: ['update:checked'],\n\n setup() {\n return {\n classes: useCssModule(),\n };\n },\n\n computed: {\n internalValue: {\n get() {\n return this.checked;\n },\n set(value) {\n this.$emit('update:checked', value);\n },\n },\n },\n\n created() {\n if (this.$attrs.onChange) {\n throw new Error('ll-radio: use the @update:checked event instead of @input');\n }\n },\n };\n</script>\n\n<template>\n <div class=\"stash-radio\" data-test=\"ll-radio\" :class=\"[classes.root, { error: hasError }]\">\n <input :id=\"id\" v-model=\"internalValue\" class=\"
|
|
1
|
+
{"version":3,"file":"Radio.js","sources":["../src/components/Radio/Radio.vue"],"sourcesContent":["<script>\n import { useCssModule } from 'vue';\n\n /**\n * @deprecated use components/RadioNew/Radio instead.\n * if you need multiple Radio components considering using RadioGroup instead.\n */\n export default {\n name: 'll-radio',\n\n props: {\n /**\n * The checked/selected state of the radio button\n */\n checked: {\n type: [String, Number],\n default: undefined,\n },\n\n /**\n * @deprecated Use :checked or v-model:checked instead of :model-value and v-model.\n */\n modelValue: {\n type: [String, Number, null],\n default: null,\n validator(value) {\n if (value !== null) {\n throw new Error('ll-radio: use :checked or v-model:checked instead of :model-value and v-model.');\n }\n\n return true;\n },\n },\n\n /**\n * Adds error styling\n */\n hasError: Boolean,\n\n /**\n * A unique string to distinguish one Radio instance from another\n * and to link the label to the input; required for accessibility\n */\n id: {\n type: String,\n required: true,\n },\n\n /**\n * The description which appears to the right of the radio button\n */\n label: {\n type: String,\n default: '',\n },\n },\n\n emits: ['update:checked'],\n\n setup() {\n return {\n classes: useCssModule(),\n };\n },\n\n computed: {\n internalValue: {\n get() {\n return this.checked;\n },\n set(value) {\n this.$emit('update:checked', value);\n },\n },\n },\n\n created() {\n if (this.$attrs.onChange) {\n throw new Error('ll-radio: use the @update:checked event instead of @input');\n }\n },\n };\n</script>\n\n<template>\n <div class=\"stash-radio\" data-test=\"ll-radio\" :class=\"[classes.root, { error: hasError }]\">\n <input :id=\"id\" v-model=\"internalValue\" class=\"sr-only\" :class=\"classes.input\" type=\"radio\" v-bind=\"$attrs\" />\n\n <label :for=\"id\" :class=\"classes.label\">\n {{ label }}\n </label>\n </div>\n</template>\n\n<style module>\n @reference \"../../../styles/main.css\";\n\n @layer utilities {\n .root {\n position: relative;\n margin: --spacing(1.5) 0;\n }\n\n .label {\n color: var(--color-ice-700);\n cursor: pointer;\n display: inline-block;\n font-size: var(--text-sm);\n font-weight: var(--font-weight-normal);\n line-height: --spacing(6);\n min-height: --spacing(9);\n overflow: visible;\n padding: --spacing(1.5) 0 --spacing(1.5) calc(20px + --spacing(3));\n position: relative;\n vertical-align: top;\n }\n\n .label::before {\n background: var(--color-white);\n border: 1px solid var(--color-ice-500);\n content: '';\n display: inline-block;\n vertical-align: top;\n }\n\n .label::before,\n .label::after {\n height: 20px;\n left: 0;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: 20px;\n border-radius: 50%;\n }\n\n .error .label {\n color: var(--color-red-500);\n }\n\n .error .label::before,\n .error .input {\n border-color: var(--color-red-500);\n }\n\n .input:checked + .label::after {\n background: var(--color-blue-500);\n content: '';\n height: 14px;\n left: 3px;\n width: 14px;\n }\n\n .input:checked:disabled + .label::after {\n background: var(--color-ice-500);\n }\n\n .input:not(:disabled, :checked) + .label:hover::before {\n border-color: var(--color-blue-500);\n }\n\n @media (width >= theme(--breakpoint-lg)) {\n .root input {\n margin: 0;\n }\n }\n }\n</style>\n"],"names":["_sfc_main","value","useCssModule","_hoisted_1","_hoisted_2","_createElementBlock","_normalizeClass","$setup","$props","_withDirectives","_createElementVNode","_mergeProps","_cache","$event","$options","_ctx","_toDisplayString"],"mappings":";;;;;;;GAOOA,IAAU;AAAA,EACb,MAAM;AAAA,EAEN,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,SAAS;AAAA,MACP,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS;AAAA;;;;IAMX,YAAY;AAAA,MACV,MAAM,CAAC,QAAQ,QAAQ,IAAI;AAAA,MAC3B,SAAS;AAAA,MACT,UAAUC,GAAO;AACf,YAAIA,MAAU;AACZ,gBAAM,IAAI,MAAM,gFAAgF;AAGlG,eAAO;AAAA,MACT;AAAA;;;;IAMF,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,IAMV,IAAI;AAAA,MACF,MAAM;AAAA,MACN,UAAU;AAAA;;;;IAMZ,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA;;EAIb,OAAO,CAAC,gBAAgB;AAAA,EAExB,QAAQ;AACN,WAAO;AAAA,MACL,SAASC,EAAY;AAAA;EAEzB;AAAA,EAEA,UAAU;AAAA,IACR,eAAe;AAAA,MACb,MAAM;AACJ,eAAO,KAAK;AAAA,MACd;AAAA,MACA,IAAID,GAAO;AACT,aAAK,MAAM,kBAAkBA,CAAK;AAAA,MACpC;AAAA;;EAIJ,UAAU;AACR,QAAI,KAAK,OAAO;AACd,YAAM,IAAI,MAAM,2DAA2D;AAAA,EAE/E;GAhFJE,IAAA,CAAA,IAAA,GAAAC,IAAA,CAAA,KAAA;;cAqFEC,EAMM,OAAA;AAAA,IAND,OArFPC,GAqFa,eAAa,CAA+BC,UAAQ,eAAeC,EAAA,SAAQ,CAAA,CAAA,CAAA;AAAA,IAA7D,aAAU;AAAA;IACjCC,EAAAC,EAA8G,SAA9GC,EAA8G;AAAA,MAAtG,IAAIH,EAAA;AAAA,MAtFhB,uBAAAI,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAsF6BC,EAAA,gBAAaD;AAAA,MAAE,OAAK,CAAC,WAAkBN,EAAA,QAAQ,KAAK;AAAA,MAAE,MAAK;AAAA,IAAgB,GAAAQ,EAAA,MAAM,GAAA,MAAA,IAtF9GZ,CAAA,GAAA;AAAA,UAsF6BW,EAAA,aAAa;AAAA;IAEtCJ,EAEQ,SAAA;AAAA,MAFA,KAAKF,EAAA;AAAA,MAAK,OAxFtBF,EAwF6BC,EAAA,QAAQ,KAAK;AAAA,IACjC,GAAAS,EAAAR,EAAA,KAAK,GAAA,IAzFdJ,CAAA;AAAA;;;;;"}
|