@semplice-studio/pa-design-system 0.1.1 → 0.3.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 +85 -128
- package/dist/components/PaAccordion/PaAccordion.vue.d.ts +0 -1
- package/dist/components/PaAccordion/PaAccordion.vue.js +3 -5
- package/dist/components/PaAccordion/PaAccordion.vue.js.map +1 -1
- package/dist/components/PaAccordion/PaAccordion.vue2.js +24 -30
- package/dist/components/PaAccordion/PaAccordion.vue2.js.map +1 -1
- package/dist/components/PaBanner/PaBanner.vue.js +6 -6
- package/dist/components/PaBanner/PaBanner.vue2.js +26 -28
- package/dist/components/PaBanner/PaBanner.vue2.js.map +1 -1
- package/dist/components/PaCard/PaCard.vue.d.ts +17 -14
- package/dist/components/PaCard/PaCard.vue.js +2 -2
- package/dist/components/PaCard/PaCard.vue2.js +37 -42
- package/dist/components/PaCard/PaCard.vue2.js.map +1 -1
- package/dist/components/PaCheckbox/PaCheckbox.vue.d.ts +5 -6
- package/dist/components/PaCheckbox/PaCheckbox.vue.js +2 -4
- package/dist/components/PaCheckbox/PaCheckbox.vue.js.map +1 -1
- package/dist/components/PaCheckbox/PaCheckbox.vue2.js +20 -26
- package/dist/components/PaCheckbox/PaCheckbox.vue2.js.map +1 -1
- package/dist/components/PaCheckboxGroup/PaCheckboxGroup.vue.d.ts +5 -6
- package/dist/components/PaCheckboxGroup/PaCheckboxGroup.vue.js +2 -4
- package/dist/components/PaCheckboxGroup/PaCheckboxGroup.vue.js.map +1 -1
- package/dist/components/PaCheckboxGroup/PaCheckboxGroup.vue2.js +25 -31
- package/dist/components/PaCheckboxGroup/PaCheckboxGroup.vue2.js.map +1 -1
- package/dist/components/PaDatePicker/PaDatePicker.vue.d.ts +13 -26
- package/dist/components/PaDatePicker/PaDatePicker.vue.js +4 -6
- package/dist/components/PaDatePicker/PaDatePicker.vue.js.map +1 -1
- package/dist/components/PaDatePicker/PaDatePicker.vue2.js +53 -59
- package/dist/components/PaDatePicker/PaDatePicker.vue2.js.map +1 -1
- package/dist/components/PaDrawer/PaDrawer.vue.js +2 -2
- package/dist/components/PaDrawer/PaDrawer.vue2.js +37 -41
- package/dist/components/PaDrawer/PaDrawer.vue2.js.map +1 -1
- package/dist/components/PaFileUpload/PaFileUpload.vue.d.ts +0 -1
- package/dist/components/PaFileUpload/PaFileUpload.vue.js +3 -5
- package/dist/components/PaFileUpload/PaFileUpload.vue.js.map +1 -1
- package/dist/components/PaFileUpload/PaFileUpload.vue2.js +22 -28
- package/dist/components/PaFileUpload/PaFileUpload.vue2.js.map +1 -1
- package/dist/components/PaFooter/PaFooter.vue.js +1 -1
- package/dist/components/PaFooter/PaFooter.vue2.js +43 -48
- package/dist/components/PaFooter/PaFooter.vue2.js.map +1 -1
- package/dist/components/PaHeaderDesktop/PaHeaderDesktop.vue.js +1 -1
- package/dist/components/PaHeaderDesktop/PaHeaderDesktop.vue2.js +61 -66
- package/dist/components/PaHeaderDesktop/PaHeaderDesktop.vue2.js.map +1 -1
- package/dist/components/PaHeaderMobile/PaHeaderMobile.vue.js +2 -2
- package/dist/components/PaHeaderMobile/PaHeaderMobile.vue2.js +69 -74
- package/dist/components/PaHeaderMobile/PaHeaderMobile.vue2.js.map +1 -1
- package/dist/components/PaHero/PaHero.vue.d.ts +15 -12
- package/dist/components/PaHero/PaHero.vue.js +2 -2
- package/dist/components/PaHero/PaHero.vue2.js +36 -41
- package/dist/components/PaHero/PaHero.vue2.js.map +1 -1
- package/dist/components/PaInput/PaInput.vue.d.ts +15 -13
- package/dist/components/PaInput/PaInput.vue.js +4 -6
- package/dist/components/PaInput/PaInput.vue.js.map +1 -1
- package/dist/components/PaInput/PaInput.vue2.js +27 -33
- package/dist/components/PaInput/PaInput.vue2.js.map +1 -1
- package/dist/components/PaModal/PaModal.vue.d.ts +14 -11
- package/dist/components/PaModal/PaModal.vue.js +3 -3
- package/dist/components/PaModal/PaModal.vue2.js +41 -46
- package/dist/components/PaModal/PaModal.vue2.js.map +1 -1
- package/dist/components/PaMonthPicker/PaMonthPicker.vue.d.ts +13 -26
- package/dist/components/PaMonthPicker/PaMonthPicker.vue.js +2 -4
- package/dist/components/PaMonthPicker/PaMonthPicker.vue.js.map +1 -1
- package/dist/components/PaMonthPicker/PaMonthPicker.vue2.js +64 -70
- package/dist/components/PaMonthPicker/PaMonthPicker.vue2.js.map +1 -1
- package/dist/components/PaPagination/PaPagination.vue.js +2 -2
- package/dist/components/PaPagination/PaPagination.vue2.js +41 -46
- package/dist/components/PaPagination/PaPagination.vue2.js.map +1 -1
- package/dist/components/PaRadioGroup/PaRadioGroup.vue.d.ts +5 -6
- package/dist/components/PaRadioGroup/PaRadioGroup.vue.js +2 -4
- package/dist/components/PaRadioGroup/PaRadioGroup.vue.js.map +1 -1
- package/dist/components/PaRadioGroup/PaRadioGroup.vue2.js +22 -28
- package/dist/components/PaRadioGroup/PaRadioGroup.vue2.js.map +1 -1
- package/dist/components/PaRangePicker/PaRangePicker.vue.d.ts +0 -1
- package/dist/components/PaRangePicker/PaRangePicker.vue.js +4 -6
- package/dist/components/PaRangePicker/PaRangePicker.vue.js.map +1 -1
- package/dist/components/PaRangePicker/PaRangePicker.vue2.js +76 -82
- package/dist/components/PaRangePicker/PaRangePicker.vue2.js.map +1 -1
- package/dist/components/PaSearchBar/PaSearchBar.vue.d.ts +0 -1
- package/dist/components/PaSearchBar/PaSearchBar.vue.js +3 -5
- package/dist/components/PaSearchBar/PaSearchBar.vue.js.map +1 -1
- package/dist/components/PaSearchBar/PaSearchBar.vue2.js +55 -61
- package/dist/components/PaSearchBar/PaSearchBar.vue2.js.map +1 -1
- package/dist/components/PaSelect/PaSelect.vue.d.ts +5 -6
- package/dist/components/PaSelect/PaSelect.vue.js +4 -6
- package/dist/components/PaSelect/PaSelect.vue.js.map +1 -1
- package/dist/components/PaSelect/PaSelect.vue2.js +25 -31
- package/dist/components/PaSelect/PaSelect.vue2.js.map +1 -1
- package/dist/components/PaTabs/PaTabs.vue.js +1 -1
- package/dist/components/PaTabs/PaTabs.vue2.js +17 -19
- package/dist/components/PaTabs/PaTabs.vue2.js.map +1 -1
- package/dist/components/PaTextarea/PaTextarea.vue.d.ts +5 -6
- package/dist/components/PaTextarea/PaTextarea.vue.js +4 -6
- package/dist/components/PaTextarea/PaTextarea.vue.js.map +1 -1
- package/dist/components/PaTextarea/PaTextarea.vue2.js +16 -22
- package/dist/components/PaTextarea/PaTextarea.vue2.js.map +1 -1
- package/dist/components/PaTimePicker/PaTimePicker.vue.d.ts +0 -1
- package/dist/components/PaTimePicker/PaTimePicker.vue.js +2 -4
- package/dist/components/PaTimePicker/PaTimePicker.vue.js.map +1 -1
- package/dist/components/PaTimePicker/PaTimePicker.vue2.js +44 -50
- package/dist/components/PaTimePicker/PaTimePicker.vue2.js.map +1 -1
- package/dist/components/PaTitleBar/PaTitleBar.vue.d.ts +12 -9
- package/dist/components/PaTitleBar/PaTitleBar.vue.js +2 -2
- package/dist/components/PaTitleBar/PaTitleBar.vue2.js +34 -39
- package/dist/components/PaTitleBar/PaTitleBar.vue2.js.map +1 -1
- package/dist/components/PaToggle/PaToggle.vue.d.ts +0 -1
- package/dist/components/PaToggle/PaToggle.vue.js +2 -4
- package/dist/components/PaToggle/PaToggle.vue.js.map +1 -1
- package/dist/components/PaToggle/PaToggle.vue2.js +20 -26
- package/dist/components/PaToggle/PaToggle.vue2.js.map +1 -1
- package/dist/components/PaYearPicker/PaYearPicker.vue.d.ts +13 -26
- package/dist/components/PaYearPicker/PaYearPicker.vue.js +4 -6
- package/dist/components/PaYearPicker/PaYearPicker.vue.js.map +1 -1
- package/dist/components/PaYearPicker/PaYearPicker.vue2.js +70 -76
- package/dist/components/PaYearPicker/PaYearPicker.vue2.js.map +1 -1
- package/dist/style.css +1 -1
- package/docs/design-system.md +590 -0
- package/docs/layouts.md +297 -0
- package/docs/page-composition-examples.md +286 -0
- package/docs/public-surface.md +68 -0
- package/package.json +8 -4
|
@@ -17,26 +17,29 @@ export interface PaCardProps {
|
|
|
17
17
|
imageAlt?: string;
|
|
18
18
|
imageRatio?: PaImageRatio;
|
|
19
19
|
}
|
|
20
|
-
declare
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
imageAlt: string;
|
|
24
|
-
typology: PaCardTypology;
|
|
25
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
26
|
-
'header-leading'?: (props: {}) => any;
|
|
20
|
+
declare var __VLS_4: {}, __VLS_12: {}, __VLS_18: {}, __VLS_20: {}, __VLS_22: {}, __VLS_24: {}, __VLS_26: {};
|
|
21
|
+
type __VLS_Slots = {} & {
|
|
22
|
+
'header-leading'?: (props: typeof __VLS_4) => any;
|
|
27
23
|
} & {
|
|
28
|
-
'header-trailing'?: (props:
|
|
24
|
+
'header-trailing'?: (props: typeof __VLS_12) => any;
|
|
29
25
|
} & {
|
|
30
|
-
title?: (props:
|
|
26
|
+
title?: (props: typeof __VLS_18) => any;
|
|
31
27
|
} & {
|
|
32
|
-
subtitle?: (props:
|
|
28
|
+
subtitle?: (props: typeof __VLS_20) => any;
|
|
33
29
|
} & {
|
|
34
|
-
body?: (props:
|
|
30
|
+
body?: (props: typeof __VLS_22) => any;
|
|
35
31
|
} & {
|
|
36
|
-
signature?: (props:
|
|
32
|
+
signature?: (props: typeof __VLS_24) => any;
|
|
37
33
|
} & {
|
|
38
|
-
footer?: (props:
|
|
39
|
-
}
|
|
34
|
+
footer?: (props: typeof __VLS_26) => any;
|
|
35
|
+
};
|
|
36
|
+
declare const __VLS_component: import("vue").DefineComponent<PaCardProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PaCardProps> & Readonly<{}>, {
|
|
37
|
+
variant: PaCardVariant;
|
|
38
|
+
titleLevel: 1 | 2 | 3 | 4 | 5 | 6;
|
|
39
|
+
imageAlt: string;
|
|
40
|
+
typology: PaCardTypology;
|
|
41
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
40
43
|
export default _default;
|
|
41
44
|
type __VLS_WithSlots<T, S> = T & {
|
|
42
45
|
new (): {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import o from "./PaCard.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-830dccf3"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=PaCard.vue.js.map
|
|
@@ -1,40 +1,35 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as B, computed as a, useSlots as C, useId as T, openBlock as t, createElementBlock as s, normalizeClass as N, createElementVNode as y, createVNode as V, createCommentVNode as l, renderSlot as r, createBlock as g, createTextVNode as n, toDisplayString as d, resolveDynamicComponent as H, withCtx as L } from "vue";
|
|
2
|
+
import P from "../PaIcon/PaIcon.vue.js";
|
|
3
|
+
import R from "../PaImage/PaImage.vue.js";
|
|
4
|
+
import z from "../PaTag/PaTag.vue.js";
|
|
5
|
+
const A = ["aria-labelledby"], D = { class: "pa-card__layout" }, E = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "pa-card__image-cell"
|
|
8
|
-
},
|
|
8
|
+
}, w = { class: "pa-card__content" }, j = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "pa-card__header"
|
|
11
|
-
},
|
|
11
|
+
}, q = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "pa-card__header-leading"
|
|
14
|
-
},
|
|
14
|
+
}, F = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "pa-card__header-trailing"
|
|
17
|
-
},
|
|
17
|
+
}, G = {
|
|
18
18
|
key: 1,
|
|
19
19
|
class: "pa-card__title-block"
|
|
20
|
-
},
|
|
20
|
+
}, J = {
|
|
21
21
|
key: 1,
|
|
22
22
|
class: "pa-card__subtitle"
|
|
23
|
-
},
|
|
23
|
+
}, K = {
|
|
24
24
|
key: 2,
|
|
25
25
|
class: "pa-card__body"
|
|
26
|
-
},
|
|
26
|
+
}, M = { class: "pa-card__body-text" }, O = {
|
|
27
27
|
key: 3,
|
|
28
28
|
class: "pa-card__signature"
|
|
29
|
-
},
|
|
29
|
+
}, Q = {
|
|
30
30
|
key: 4,
|
|
31
31
|
class: "pa-card__footer"
|
|
32
|
-
}
|
|
33
|
-
let O = 0;
|
|
34
|
-
function Q() {
|
|
35
|
-
return ++O;
|
|
36
|
-
}
|
|
37
|
-
const ee = /* @__PURE__ */ I({
|
|
32
|
+
}, x = /* @__PURE__ */ B({
|
|
38
33
|
__name: "PaCard",
|
|
39
34
|
props: {
|
|
40
35
|
typology: { default: "portrait" },
|
|
@@ -54,82 +49,82 @@ const ee = /* @__PURE__ */ I({
|
|
|
54
49
|
setup(e) {
|
|
55
50
|
const o = e, b = a(
|
|
56
51
|
() => o.imageRatio ?? (o.typology === "landscape" ? "1:1" : "3:2")
|
|
57
|
-
), c =
|
|
52
|
+
), c = C(), v = `pa-card-${T()}__title`, u = a(() => !!c.title || !!o.title), h = a(() => !!c.subtitle || !!o.subtitle), f = a(() => !!c.body || !!o.body), k = a(() => !!c.signature || !!o.signature), m = a(
|
|
58
53
|
() => !!c["header-leading"] || !!o.category || !!o.categoryIcon
|
|
59
54
|
), _ = a(
|
|
60
55
|
() => !!c["header-trailing"] || !!o.date
|
|
61
|
-
), $ = a(() => m.value || _.value), p = a(() => u.value || h.value), S = a(() => u.value ? v : void 0),
|
|
62
|
-
return (i,
|
|
63
|
-
class:
|
|
56
|
+
), $ = a(() => m.value || _.value), p = a(() => u.value || h.value), S = a(() => u.value ? v : void 0), I = a(() => `h${o.titleLevel}`);
|
|
57
|
+
return (i, U) => (t(), s("article", {
|
|
58
|
+
class: N(["pa-card", [`pa-card--${e.typology}`, `pa-card--${e.variant}`]]),
|
|
64
59
|
"aria-labelledby": S.value
|
|
65
60
|
}, [
|
|
66
|
-
y("div",
|
|
67
|
-
e.imageSrc && e.typology !== "process" ? (t(), s("div",
|
|
68
|
-
|
|
61
|
+
y("div", D, [
|
|
62
|
+
e.imageSrc && e.typology !== "process" ? (t(), s("div", E, [
|
|
63
|
+
V(R, {
|
|
69
64
|
src: e.imageSrc,
|
|
70
65
|
alt: e.imageAlt,
|
|
71
66
|
ratio: b.value
|
|
72
67
|
}, null, 8, ["src", "alt", "ratio"])
|
|
73
68
|
])) : l("", !0),
|
|
74
|
-
y("div",
|
|
75
|
-
$.value ? (t(), s("div",
|
|
76
|
-
m.value ? (t(), s("div",
|
|
69
|
+
y("div", w, [
|
|
70
|
+
$.value ? (t(), s("div", j, [
|
|
71
|
+
m.value ? (t(), s("div", q, [
|
|
77
72
|
r(i.$slots, "header-leading", {}, () => [
|
|
78
|
-
e.categoryIcon ? (t(), g(
|
|
73
|
+
e.categoryIcon ? (t(), g(P, {
|
|
79
74
|
key: 0,
|
|
80
75
|
name: e.categoryIcon,
|
|
81
76
|
size: "lg"
|
|
82
|
-
}, null, 8, ["name"])) : e.category ? (t(), g(
|
|
77
|
+
}, null, 8, ["name"])) : e.category ? (t(), g(z, {
|
|
83
78
|
key: 1,
|
|
84
79
|
variant: "info",
|
|
85
80
|
label: e.category
|
|
86
81
|
}, null, 8, ["label"])) : l("", !0)
|
|
87
82
|
], !0)
|
|
88
83
|
])) : l("", !0),
|
|
89
|
-
_.value ? (t(), s("div",
|
|
84
|
+
_.value ? (t(), s("div", F, [
|
|
90
85
|
r(i.$slots, "header-trailing", {}, () => [
|
|
91
86
|
n(d(e.date), 1)
|
|
92
87
|
], !0)
|
|
93
88
|
])) : l("", !0)
|
|
94
89
|
])) : l("", !0),
|
|
95
|
-
p.value ? (t(), s("div",
|
|
96
|
-
u.value ? (t(), g(
|
|
90
|
+
p.value ? (t(), s("div", G, [
|
|
91
|
+
u.value ? (t(), g(H(I.value), {
|
|
97
92
|
key: 0,
|
|
98
93
|
id: v,
|
|
99
94
|
class: "pa-card__title"
|
|
100
95
|
}, {
|
|
101
|
-
default:
|
|
96
|
+
default: L(() => [
|
|
102
97
|
r(i.$slots, "title", {}, () => [
|
|
103
98
|
n(d(e.title), 1)
|
|
104
99
|
], !0)
|
|
105
100
|
]),
|
|
106
101
|
_: 3
|
|
107
102
|
})) : l("", !0),
|
|
108
|
-
h.value ? (t(), s("p",
|
|
103
|
+
h.value ? (t(), s("p", J, [
|
|
109
104
|
r(i.$slots, "subtitle", {}, () => [
|
|
110
105
|
n(d(e.subtitle), 1)
|
|
111
106
|
], !0)
|
|
112
107
|
])) : l("", !0)
|
|
113
108
|
])) : l("", !0),
|
|
114
|
-
f.value ? (t(), s("div",
|
|
109
|
+
f.value ? (t(), s("div", K, [
|
|
115
110
|
r(i.$slots, "body", {}, () => [
|
|
116
|
-
y("p",
|
|
111
|
+
y("p", M, d(e.body), 1)
|
|
117
112
|
], !0)
|
|
118
113
|
])) : l("", !0),
|
|
119
|
-
k.value ? (t(), s("p",
|
|
114
|
+
k.value ? (t(), s("p", O, [
|
|
120
115
|
r(i.$slots, "signature", {}, () => [
|
|
121
116
|
n(d(e.signature), 1)
|
|
122
117
|
], !0)
|
|
123
118
|
])) : l("", !0),
|
|
124
|
-
i.$slots.footer ? (t(), s("div",
|
|
119
|
+
i.$slots.footer ? (t(), s("div", Q, [
|
|
125
120
|
r(i.$slots, "footer", {}, void 0, !0)
|
|
126
121
|
])) : l("", !0)
|
|
127
122
|
])
|
|
128
123
|
])
|
|
129
|
-
], 10,
|
|
124
|
+
], 10, A));
|
|
130
125
|
}
|
|
131
126
|
});
|
|
132
127
|
export {
|
|
133
|
-
|
|
128
|
+
x as default
|
|
134
129
|
};
|
|
135
130
|
//# sourceMappingURL=PaCard.vue2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaCard.vue2.js","sources":["../../../src/components/PaCard/PaCard.vue"],"sourcesContent":["<script lang=\"ts\">\nlet cardUid = 0\nfunction nextCardId() {\n return ++cardUid\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue'\nimport PaIcon from '../PaIcon/PaIcon.vue'\nimport PaImage from '../PaImage/PaImage.vue'\nimport PaTag from '../PaTag/PaTag.vue'\nimport type { PaImageRatio } from '../PaImage/PaImage.vue'\nimport type { PaIconName } from '../PaIcon/PaIcon.vue'\n\nexport type PaCardTypology = 'landscape' | 'portrait' | 'process'\nexport type PaCardVariant = 'light' | 'dark'\n\nexport interface PaCardProps {\n typology?: PaCardTypology\n variant?: PaCardVariant\n title?: string\n titleLevel?: 1 | 2 | 3 | 4 | 5 | 6\n subtitle?: string\n body?: string\n signature?: string\n date?: string\n category?: string\n categoryIcon?: PaIconName\n imageSrc?: string\n imageAlt?: string\n imageRatio?: PaImageRatio\n}\n\nconst props = withDefaults(defineProps<PaCardProps>(), {\n typology: 'portrait',\n variant: 'light',\n titleLevel: 3,\n imageAlt: '',\n})\n\nconst resolvedRatio = computed<PaImageRatio>(\n () => props.imageRatio ?? (props.typology === 'landscape' ? '1:1' : '3:2'),\n)\n\nconst slots = useSlots()\n\nconst titleId = `pa-card-${nextCardId()}__title`\n\nconst hasTitle = computed(() => !!slots.title || !!props.title)\nconst hasSubtitle = computed(() => !!slots.subtitle || !!props.subtitle)\nconst hasBody = computed(() => !!slots.body || !!props.body)\nconst hasSignature = computed(() => !!slots.signature || !!props.signature)\nconst hasHeaderLeading = computed(\n () => !!slots['header-leading'] || !!props.category || !!props.categoryIcon,\n)\nconst hasHeaderTrailing = computed(\n () => !!slots['header-trailing'] || !!props.date,\n)\nconst hasHeader = computed(() => hasHeaderLeading.value || hasHeaderTrailing.value)\nconst hasTitleBlock = computed(() => hasTitle.value || hasSubtitle.value)\nconst labelledBy = computed(() => (hasTitle.value ? titleId : undefined))\nconst titleTag = computed(() => `h${props.titleLevel}` as const)\n</script>\n\n<template>\n <article class=\"pa-card\"\n :class=\"[`pa-card--${typology}`, `pa-card--${variant}`]\"\n :aria-labelledby=\"labelledBy\">\n <div class=\"pa-card__layout\">\n <div v-if=\"imageSrc && typology !== 'process'\"\n class=\"pa-card__image-cell\">\n <PaImage :src=\"imageSrc\"\n :alt=\"imageAlt\"\n :ratio=\"resolvedRatio\" />\n </div>\n\n <div class=\"pa-card__content\">\n <div v-if=\"hasHeader\"\n class=\"pa-card__header\">\n <div v-if=\"hasHeaderLeading\"\n class=\"pa-card__header-leading\">\n <slot name=\"header-leading\">\n <PaIcon v-if=\"categoryIcon\"\n :name=\"categoryIcon\"\n size=\"lg\" />\n <PaTag v-else-if=\"category\"\n variant=\"info\"\n :label=\"category\" />\n </slot>\n </div>\n <div v-if=\"hasHeaderTrailing\"\n class=\"pa-card__header-trailing\">\n <slot name=\"header-trailing\">{{ date }}</slot>\n </div>\n </div>\n\n <div v-if=\"hasTitleBlock\"\n class=\"pa-card__title-block\">\n <component :is=\"titleTag\"\n v-if=\"hasTitle\"\n :id=\"titleId\"\n class=\"pa-card__title\">\n <slot name=\"title\">{{ title }}</slot>\n </component>\n <p v-if=\"hasSubtitle\"\n class=\"pa-card__subtitle\">\n <slot name=\"subtitle\">{{ subtitle }}</slot>\n </p>\n </div>\n\n <div v-if=\"hasBody\"\n class=\"pa-card__body\">\n <slot name=\"body\">\n <p class=\"pa-card__body-text\">{{ body }}</p>\n </slot>\n </div>\n\n <p v-if=\"hasSignature\"\n class=\"pa-card__signature\">\n <slot name=\"signature\">{{ signature }}</slot>\n </p>\n\n <div v-if=\"$slots.footer\"\n class=\"pa-card__footer\">\n <slot name=\"footer\" />\n </div>\n </div>\n </div>\n </article>\n</template>\n\n<style scoped>\n.pa-card {\n display: block;\n background-color: var(--pa-card-bg);\n border-radius: var(--pa-radius-smooth);\n box-shadow: var(--pa-shadow-elevation-01);\n overflow: hidden;\n container-type: inline-size;\n}\n\n.pa-card__layout {\n display: flex;\n flex-direction: column;\n}\n\n.pa-card--light {\n --pa-card-bg: var(--pa-color-bg-white);\n --pa-card-title-color: var(--pa-color-primary);\n --pa-card-body-color: var(--pa-color-text-secondary-gray);\n --pa-card-date-color: var(--pa-color-text-secondary-gray);\n --pa-card-signature-color: var(--pa-color-text-secondary-gray);\n --pa-card-subtitle-color: var(--pa-color-text-secondary-gray);\n --pa-card-action-color: var(--pa-color-primary);\n}\n\n.pa-card--dark {\n --pa-card-bg: var(--pa-color-bg-primary-dark-115);\n --pa-card-title-color: var(--pa-color-bg-white);\n --pa-card-body-color: var(--pa-color-bg-white);\n --pa-card-date-color: var(--pa-color-bg-white);\n --pa-card-signature-color: var(--pa-color-bg-white);\n --pa-card-subtitle-color: var(--pa-color-bg-white);\n --pa-card-action-color: var(--pa-color-accent);\n}\n\n.pa-card--process.pa-card--dark {\n --pa-card-title-color: var(--pa-color-bg-white);\n}\n\n.pa-card--portrait .pa-card__image-cell {\n width: 100%;\n}\n\n.pa-card--portrait .pa-card__content {\n display: flex;\n flex-direction: column;\n gap: 24px;\n padding: 32px;\n min-width: 0;\n}\n\n.pa-card__header {\n display: flex;\n align-items: center;\n gap: 16px;\n width: 100%;\n}\n\n.pa-card__header-leading {\n flex: 1 0 0;\n min-width: 0;\n}\n\n.pa-card__header-trailing {\n flex: 0 0 auto;\n font-family: var(--pa-font-family-mono);\n font-weight: 400;\n font-size: 16px;\n line-height: 18px;\n color: var(--pa-card-date-color);\n}\n\n.pa-card__title-block {\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: 100%;\n}\n\n.pa-card__title {\n margin: 0;\n font-family: var(--pa-font-family-base);\n font-weight: 700;\n font-size: 24px;\n line-height: 28px;\n letter-spacing: -0.5px;\n color: var(--pa-card-title-color);\n}\n\n.pa-card--portrait .pa-card__subtitle {\n margin: 0;\n font-family: var(--pa-font-family-base);\n font-weight: 600;\n font-size: 18px;\n line-height: 22px;\n letter-spacing: -0.5px;\n color: var(--pa-card-subtitle-color);\n}\n\n.pa-card__body,\n.pa-card__body-text {\n margin: 0;\n font-family: var(--pa-font-family-base);\n font-weight: 400;\n font-size: 16px;\n line-height: 20px;\n color: var(--pa-card-body-color);\n}\n\n.pa-card__signature {\n margin: 0;\n font-family: var(--pa-font-family-mono);\n font-weight: 400;\n font-size: 16px;\n line-height: 18px;\n color: var(--pa-card-signature-color);\n}\n\n.pa-card__footer {\n display: flex;\n align-items: center;\n gap: 12px;\n width: 100%;\n}\n\n/* Landscape */\n.pa-card--landscape .pa-card__layout {\n display: grid;\n grid-template-columns: 370px 1fr;\n align-items: stretch;\n}\n\n.pa-card--landscape .pa-card__image-cell {\n width: auto;\n height: 100%;\n}\n\n.pa-card--landscape .pa-card__content {\n display: flex;\n flex-direction: column;\n min-width: 0;\n gap: 24px;\n padding: 32px 48px;\n}\n\n.pa-card--landscape .pa-card__title {\n font-size: 32px;\n line-height: 36px;\n letter-spacing: -1px;\n}\n\n.pa-card--landscape .pa-card__subtitle {\n margin: 0;\n font-family: var(--pa-font-family-base);\n font-weight: 600;\n font-size: 20px;\n line-height: 24px;\n letter-spacing: -0.5px;\n color: var(--pa-card-subtitle-color);\n}\n\n/* Process */\n.pa-card--process .pa-card__content {\n display: flex;\n flex-direction: column;\n gap: 24px;\n padding: 32px;\n min-width: 0;\n}\n\n.pa-card--process.pa-card--light {\n --pa-card-title-color: var(--pa-color-text-secondary-gray);\n}\n\n.pa-card--process .pa-card__subtitle,\n.pa-card--process .pa-card__signature {\n display: none;\n}\n\n.pa-card--process .pa-card__footer {\n padding-top: 24px;\n}\n\n.pa-card--process .pa-card__header-leading :deep(svg) {\n width: 32px;\n height: 32px;\n}\n\n@container (max-width: 720px) {\n .pa-card--landscape .pa-card__layout {\n grid-template-columns: 1fr;\n }\n\n .pa-card--landscape .pa-card__image-cell {\n width: 100%;\n height: auto;\n }\n\n .pa-card--landscape .pa-card__image-cell :deep(.pa-image) {\n aspect-ratio: 3 / 2 !important;\n }\n\n .pa-card--landscape .pa-card__content {\n padding: 24px;\n }\n\n .pa-card--landscape .pa-card__title {\n font-size: 24px;\n line-height: 28px;\n letter-spacing: -0.5px;\n }\n}\n</style>\n"],"names":["cardUid","nextCardId","props","__props","resolvedRatio","computed","slots","useSlots","titleId","hasTitle","hasSubtitle","hasBody","hasSignature","hasHeaderLeading","hasHeaderTrailing","hasHeader","hasTitleBlock","labelledBy","titleTag","_createElementBlock","_normalizeClass","_createElementVNode","_hoisted_2","_openBlock","_hoisted_3","_createVNode","PaImage","_hoisted_4","_hoisted_5","_hoisted_6","_renderSlot","_ctx","_createBlock","PaIcon","PaTag","_hoisted_7","_hoisted_8","_resolveDynamicComponent","_hoisted_9","_hoisted_10","_hoisted_11","_toDisplayString","_hoisted_12","$slots","_hoisted_13"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAIA,IAAU;AACd,SAASC,IAAa;AACpB,SAAO,EAAED;AACX;;;;;;;;;;;;;;;;;;;AA8BA,UAAME,IAAQC,GAORC,IAAgBC;AAAA,MACpB,MAAMH,EAAM,eAAeA,EAAM,aAAa,cAAc,QAAQ;AAAA,IAAA,GAGhEI,IAAQC,EAAA,GAERC,IAAU,WAAWP,EAAA,CAAY,WAEjCQ,IAAWJ,EAAS,MAAM,CAAC,CAACC,EAAM,SAAS,CAAC,CAACJ,EAAM,KAAK,GACxDQ,IAAcL,EAAS,MAAM,CAAC,CAACC,EAAM,YAAY,CAAC,CAACJ,EAAM,QAAQ,GACjES,IAAUN,EAAS,MAAM,CAAC,CAACC,EAAM,QAAQ,CAAC,CAACJ,EAAM,IAAI,GACrDU,IAAeP,EAAS,MAAM,CAAC,CAACC,EAAM,aAAa,CAAC,CAACJ,EAAM,SAAS,GACpEW,IAAmBR;AAAA,MACvB,MAAM,CAAC,CAACC,EAAM,gBAAgB,KAAK,CAAC,CAACJ,EAAM,YAAY,CAAC,CAACA,EAAM;AAAA,IAAA,GAE3DY,IAAoBT;AAAA,MACxB,MAAM,CAAC,CAACC,EAAM,iBAAiB,KAAK,CAAC,CAACJ,EAAM;AAAA,IAAA,GAExCa,IAAYV,EAAS,MAAMQ,EAAiB,SAASC,EAAkB,KAAK,GAC5EE,IAAgBX,EAAS,MAAMI,EAAS,SAASC,EAAY,KAAK,GAClEO,IAAaZ,EAAS,MAAOI,EAAS,QAAQD,IAAU,MAAU,GAClEU,IAAWb,EAAS,MAAM,IAAIH,EAAM,UAAU,EAAW;2BAI7DiB,EA+DU,WAAA;AAAA,MA/DD,OAAKC,EAAA,CAAC,WAAS,CAAA,YACMjB,EAAA,QAAQ,gBAAgBA,EAAA,OAAO,EAAA,CAAA,CAAA;AAAA,MACnD,mBAAiBc,EAAA;AAAA,IAAA;MACzBI,EA2DM,OA3DNC,GA2DM;AAAA,QA1DKnB,EAAA,YAAYA,EAAA,aAAQ,aAA/BoB,KAAAJ,EAKM,OALNK,GAKM;AAAA,UAHJC,EAEkCC,GAAA;AAAA,YAFxB,KAAKvB,EAAA;AAAA,YACL,KAAKA,EAAA;AAAA,YACL,OAAOC,EAAA;AAAA,UAAA;;QAGnBiB,EAkDM,OAlDNM,GAkDM;AAAA,UAjDOZ,EAAA,SAAXQ,EAAA,GAAAJ,EAiBM,OAjBNS,GAiBM;AAAA,YAfOf,EAAA,SAAXU,EAAA,GAAAJ,EAUM,OAVNU,GAUM;AAAA,cARJC,EAOOC,gCAPP,MAOO;AAAA,gBANS5B,EAAA,qBAAd6B,EAEoBC,GAAA;AAAA;kBADX,MAAM9B,EAAA;AAAA,kBACP,MAAK;AAAA,gBAAA,yBACKA,EAAA,iBAAlB6B,EAE2BE,GAAA;AAAA;kBADpB,SAAQ;AAAA,kBACP,OAAO/B,EAAA;AAAA,gBAAA;;;YAGRW,EAAA,SAAXS,EAAA,GAAAJ,EAGM,OAHNgB,GAGM;AAAA,cADJL,EAA8CC,iCAA9C,MAA8C;AAAA,oBAAd5B,EAAA,IAAI,GAAA,CAAA;AAAA,cAAA;;;UAI7Ba,EAAA,SAAXO,EAAA,GAAAJ,EAYM,OAZNiB,GAYM;AAAA,YATa3B,EAAA,SADjBc,EAAA,GAAAS,EAKYK,EALInB,EAAA,KAAQ,GAAA;AAAA;cAEZ,IAAIV;AAAA,cACL,OAAM;AAAA,YAAA;yBACf,MAAqC;AAAA,gBAArCsB,EAAqCC,uBAArC,MAAqC;AAAA,sBAAf5B,EAAA,KAAK,GAAA,CAAA;AAAA,gBAAA;;;;YAEpBO,EAAA,SAATa,EAAA,GAAAJ,EAGI,KAHJmB,GAGI;AAAA,cADFR,EAA2CC,0BAA3C,MAA2C;AAAA,oBAAlB5B,EAAA,QAAQ,GAAA,CAAA;AAAA,cAAA;;;UAI1BQ,EAAA,SAAXY,EAAA,GAAAJ,EAKM,OALNoB,GAKM;AAAA,YAHJT,EAEOC,sBAFP,MAEO;AAAA,cADLV,EAA4C,KAA5CmB,GAA4CC,EAAXtC,EAAA,IAAI,GAAA,CAAA;AAAA,YAAA;;UAIhCS,EAAA,SAATW,EAAA,GAAAJ,EAGI,KAHJuB,GAGI;AAAA,YADFZ,EAA6CC,2BAA7C,MAA6C;AAAA,kBAAnB5B,EAAA,SAAS,GAAA,CAAA;AAAA,YAAA;;UAG1BwC,EAAAA,OAAO,UAAlBpB,KAAAJ,EAGM,OAHNyB,GAGM;AAAA,YADJd,EAAsBC,EAAA,QAAA,UAAA,CAAA,GAAA,QAAA,EAAA;AAAA,UAAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"PaCard.vue2.js","sources":["../../../src/components/PaCard/PaCard.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useId, useSlots } from 'vue'\nimport PaIcon from '../PaIcon/PaIcon.vue'\nimport PaImage from '../PaImage/PaImage.vue'\nimport PaTag from '../PaTag/PaTag.vue'\nimport type { PaImageRatio } from '../PaImage/PaImage.vue'\nimport type { PaIconName } from '../PaIcon/PaIcon.vue'\n\nexport type PaCardTypology = 'landscape' | 'portrait' | 'process'\nexport type PaCardVariant = 'light' | 'dark'\n\nexport interface PaCardProps {\n typology?: PaCardTypology\n variant?: PaCardVariant\n title?: string\n titleLevel?: 1 | 2 | 3 | 4 | 5 | 6\n subtitle?: string\n body?: string\n signature?: string\n date?: string\n category?: string\n categoryIcon?: PaIconName\n imageSrc?: string\n imageAlt?: string\n imageRatio?: PaImageRatio\n}\n\nconst props = withDefaults(defineProps<PaCardProps>(), {\n typology: 'portrait',\n variant: 'light',\n titleLevel: 3,\n imageAlt: '',\n})\n\nconst resolvedRatio = computed<PaImageRatio>(\n () => props.imageRatio ?? (props.typology === 'landscape' ? '1:1' : '3:2'),\n)\n\nconst slots = useSlots()\n\nconst titleId = `pa-card-${useId()}__title`\n\nconst hasTitle = computed(() => !!slots.title || !!props.title)\nconst hasSubtitle = computed(() => !!slots.subtitle || !!props.subtitle)\nconst hasBody = computed(() => !!slots.body || !!props.body)\nconst hasSignature = computed(() => !!slots.signature || !!props.signature)\nconst hasHeaderLeading = computed(\n () => !!slots['header-leading'] || !!props.category || !!props.categoryIcon,\n)\nconst hasHeaderTrailing = computed(\n () => !!slots['header-trailing'] || !!props.date,\n)\nconst hasHeader = computed(() => hasHeaderLeading.value || hasHeaderTrailing.value)\nconst hasTitleBlock = computed(() => hasTitle.value || hasSubtitle.value)\nconst labelledBy = computed(() => (hasTitle.value ? titleId : undefined))\nconst titleTag = computed(() => `h${props.titleLevel}` as const)\n</script>\n\n<template>\n <article class=\"pa-card\"\n :class=\"[`pa-card--${typology}`, `pa-card--${variant}`]\"\n :aria-labelledby=\"labelledBy\">\n <div class=\"pa-card__layout\">\n <div v-if=\"imageSrc && typology !== 'process'\"\n class=\"pa-card__image-cell\">\n <PaImage :src=\"imageSrc\"\n :alt=\"imageAlt\"\n :ratio=\"resolvedRatio\" />\n </div>\n\n <div class=\"pa-card__content\">\n <div v-if=\"hasHeader\"\n class=\"pa-card__header\">\n <div v-if=\"hasHeaderLeading\"\n class=\"pa-card__header-leading\">\n <slot name=\"header-leading\">\n <PaIcon v-if=\"categoryIcon\"\n :name=\"categoryIcon\"\n size=\"lg\" />\n <PaTag v-else-if=\"category\"\n variant=\"info\"\n :label=\"category\" />\n </slot>\n </div>\n <div v-if=\"hasHeaderTrailing\"\n class=\"pa-card__header-trailing\">\n <slot name=\"header-trailing\">{{ date }}</slot>\n </div>\n </div>\n\n <div v-if=\"hasTitleBlock\"\n class=\"pa-card__title-block\">\n <component :is=\"titleTag\"\n v-if=\"hasTitle\"\n :id=\"titleId\"\n class=\"pa-card__title\">\n <slot name=\"title\">{{ title }}</slot>\n </component>\n <p v-if=\"hasSubtitle\"\n class=\"pa-card__subtitle\">\n <slot name=\"subtitle\">{{ subtitle }}</slot>\n </p>\n </div>\n\n <div v-if=\"hasBody\"\n class=\"pa-card__body\">\n <slot name=\"body\">\n <p class=\"pa-card__body-text\">{{ body }}</p>\n </slot>\n </div>\n\n <p v-if=\"hasSignature\"\n class=\"pa-card__signature\">\n <slot name=\"signature\">{{ signature }}</slot>\n </p>\n\n <div v-if=\"$slots.footer\"\n class=\"pa-card__footer\">\n <slot name=\"footer\" />\n </div>\n </div>\n </div>\n </article>\n</template>\n\n<style scoped>\n.pa-card {\n display: block;\n background-color: var(--pa-card-bg);\n border-radius: var(--pa-radius-smooth);\n box-shadow: var(--pa-shadow-elevation-01);\n overflow: hidden;\n container-type: inline-size;\n}\n\n.pa-card__layout {\n display: flex;\n flex-direction: column;\n}\n\n.pa-card--light {\n --pa-card-bg: var(--pa-color-bg-white);\n --pa-card-title-color: var(--pa-color-primary);\n --pa-card-body-color: var(--pa-color-text-secondary-gray);\n --pa-card-date-color: var(--pa-color-text-secondary-gray);\n --pa-card-signature-color: var(--pa-color-text-secondary-gray);\n --pa-card-subtitle-color: var(--pa-color-text-secondary-gray);\n --pa-card-action-color: var(--pa-color-primary);\n}\n\n.pa-card--dark {\n --pa-card-bg: var(--pa-color-bg-primary-dark-115);\n --pa-card-title-color: var(--pa-color-bg-white);\n --pa-card-body-color: var(--pa-color-bg-white);\n --pa-card-date-color: var(--pa-color-bg-white);\n --pa-card-signature-color: var(--pa-color-bg-white);\n --pa-card-subtitle-color: var(--pa-color-bg-white);\n --pa-card-action-color: var(--pa-color-accent);\n}\n\n.pa-card--process.pa-card--dark {\n --pa-card-title-color: var(--pa-color-bg-white);\n}\n\n.pa-card--portrait .pa-card__image-cell {\n width: 100%;\n}\n\n.pa-card--portrait .pa-card__content {\n display: flex;\n flex-direction: column;\n gap: 24px;\n padding: 32px;\n min-width: 0;\n}\n\n.pa-card__header {\n display: flex;\n align-items: center;\n gap: 16px;\n width: 100%;\n}\n\n.pa-card__header-leading {\n flex: 1 0 0;\n min-width: 0;\n}\n\n.pa-card__header-trailing {\n flex: 0 0 auto;\n font-family: var(--pa-font-family-mono);\n font-weight: 400;\n font-size: 16px;\n line-height: 18px;\n color: var(--pa-card-date-color);\n}\n\n.pa-card__title-block {\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: 100%;\n}\n\n.pa-card__title {\n margin: 0;\n font-family: var(--pa-font-family-base);\n font-weight: 700;\n font-size: 24px;\n line-height: 28px;\n letter-spacing: -0.5px;\n color: var(--pa-card-title-color);\n}\n\n.pa-card--portrait .pa-card__subtitle {\n margin: 0;\n font-family: var(--pa-font-family-base);\n font-weight: 600;\n font-size: 18px;\n line-height: 22px;\n letter-spacing: -0.5px;\n color: var(--pa-card-subtitle-color);\n}\n\n.pa-card__body,\n.pa-card__body-text {\n margin: 0;\n font-family: var(--pa-font-family-base);\n font-weight: 400;\n font-size: 16px;\n line-height: 20px;\n color: var(--pa-card-body-color);\n}\n\n.pa-card__signature {\n margin: 0;\n font-family: var(--pa-font-family-mono);\n font-weight: 400;\n font-size: 16px;\n line-height: 18px;\n color: var(--pa-card-signature-color);\n}\n\n.pa-card__footer {\n display: flex;\n align-items: center;\n gap: 12px;\n width: 100%;\n}\n\n/* Landscape */\n.pa-card--landscape .pa-card__layout {\n display: grid;\n grid-template-columns: 370px 1fr;\n align-items: stretch;\n}\n\n.pa-card--landscape .pa-card__image-cell {\n width: auto;\n height: 100%;\n}\n\n.pa-card--landscape .pa-card__content {\n display: flex;\n flex-direction: column;\n min-width: 0;\n gap: 24px;\n padding: 32px 48px;\n}\n\n.pa-card--landscape .pa-card__title {\n font-size: 32px;\n line-height: 36px;\n letter-spacing: -1px;\n}\n\n.pa-card--landscape .pa-card__subtitle {\n margin: 0;\n font-family: var(--pa-font-family-base);\n font-weight: 600;\n font-size: 20px;\n line-height: 24px;\n letter-spacing: -0.5px;\n color: var(--pa-card-subtitle-color);\n}\n\n/* Process */\n.pa-card--process .pa-card__content {\n display: flex;\n flex-direction: column;\n gap: 24px;\n padding: 32px;\n min-width: 0;\n}\n\n.pa-card--process.pa-card--light {\n --pa-card-title-color: var(--pa-color-text-secondary-gray);\n}\n\n.pa-card--process .pa-card__subtitle,\n.pa-card--process .pa-card__signature {\n display: none;\n}\n\n.pa-card--process .pa-card__footer {\n padding-top: 24px;\n}\n\n.pa-card--process .pa-card__header-leading :deep(svg) {\n width: 32px;\n height: 32px;\n}\n\n@container (max-width: 720px) {\n .pa-card--landscape .pa-card__layout {\n grid-template-columns: 1fr;\n }\n\n .pa-card--landscape .pa-card__image-cell {\n width: 100%;\n height: auto;\n }\n\n .pa-card--landscape .pa-card__image-cell :deep(.pa-image) {\n aspect-ratio: 3 / 2 !important;\n }\n\n .pa-card--landscape .pa-card__content {\n padding: 24px;\n }\n\n .pa-card--landscape .pa-card__title {\n font-size: 24px;\n line-height: 28px;\n letter-spacing: -0.5px;\n }\n}\n</style>\n"],"names":["props","__props","resolvedRatio","computed","slots","useSlots","titleId","useId","hasTitle","hasSubtitle","hasBody","hasSignature","hasHeaderLeading","hasHeaderTrailing","hasHeader","hasTitleBlock","labelledBy","titleTag","_createElementBlock","_normalizeClass","_createElementVNode","_hoisted_2","_openBlock","_hoisted_3","_createVNode","PaImage","_hoisted_4","_hoisted_5","_hoisted_6","_renderSlot","_ctx","_createBlock","PaIcon","PaTag","_hoisted_7","_hoisted_8","_resolveDynamicComponent","_hoisted_9","_hoisted_10","_hoisted_11","_toDisplayString","_hoisted_12","$slots","_hoisted_13"],"mappings":"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"}
|
|
@@ -10,14 +10,13 @@ export interface PaCheckboxProps {
|
|
|
10
10
|
error?: string | boolean;
|
|
11
11
|
valid?: boolean;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
type __VLS_Props = PaCheckboxProps;
|
|
14
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
15
15
|
modelValue?: boolean;
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
|
+
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
18
|
"update:modelValue": (value: boolean) => any;
|
|
18
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
19
|
-
modelValue?: boolean;
|
|
20
|
-
}> & Readonly<{
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
21
20
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
22
21
|
}>, {
|
|
23
22
|
error: string | boolean;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import o from "./PaCheckbox.vue2.js";
|
|
2
|
-
import { nextPaCheckboxId as p } from "./PaCheckbox.vue2.js";
|
|
3
2
|
/* empty css */
|
|
4
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4c1d4d61"]]);
|
|
6
5
|
export {
|
|
7
|
-
|
|
8
|
-
p as nextPaCheckboxId
|
|
6
|
+
m as default
|
|
9
7
|
};
|
|
10
8
|
//# sourceMappingURL=PaCheckbox.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaCheckbox.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PaCheckbox.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as M, useModel as C, useId as V, computed as l, openBlock as t, createElementBlock as c, createElementVNode as n, normalizeClass as h, withDirectives as q, vModelCheckbox as I, createBlock as b, createCommentVNode as r, toDisplayString as p, mergeModels as w } from "vue";
|
|
2
2
|
import k from "../PaIcon/PaIcon.vue.js";
|
|
3
|
-
const
|
|
3
|
+
const z = { class: "pa-checkbox-field" }, T = ["for"], $ = { class: "pa-checkbox__box" }, A = ["id", "name", "value", "disabled", "required", ".indeterminate", "aria-invalid", "aria-describedby"], D = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "pa-checkbox__label"
|
|
6
|
-
},
|
|
7
|
-
let E = 0;
|
|
8
|
-
function N() {
|
|
9
|
-
return `pa-checkbox-${++E}`;
|
|
10
|
-
}
|
|
11
|
-
const j = /* @__PURE__ */ C({
|
|
6
|
+
}, E = ["id"], U = /* @__PURE__ */ M({
|
|
12
7
|
__name: "PaCheckbox",
|
|
13
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ w({
|
|
14
9
|
label: {},
|
|
15
10
|
id: {},
|
|
16
11
|
name: {},
|
|
@@ -27,14 +22,14 @@ const j = /* @__PURE__ */ C({
|
|
|
27
22
|
}),
|
|
28
23
|
emits: ["update:modelValue"],
|
|
29
24
|
setup(e) {
|
|
30
|
-
const a = e, s =
|
|
25
|
+
const a = e, s = C(e, "modelValue"), f = `pa-checkbox-${V()}`, d = l(() => a.id ?? f), u = l(() => `${d.value}-msg`), x = l(() => s.value), y = l(() => !s.value && a.indeterminate), o = l(() => !!a.error), m = l(() => a.valid && !o.value), g = l(
|
|
31
26
|
() => typeof a.error == "string" && a.error.length > 0 ? a.error : null
|
|
32
27
|
), _ = l(
|
|
33
28
|
() => !o.value && !m.value && a.helperText ? a.helperText : null
|
|
34
|
-
),
|
|
35
|
-
return (
|
|
36
|
-
|
|
37
|
-
for:
|
|
29
|
+
), i = l(() => g.value ?? _.value);
|
|
30
|
+
return (N, v) => (t(), c("div", z, [
|
|
31
|
+
n("label", {
|
|
32
|
+
for: d.value,
|
|
38
33
|
class: h([
|
|
39
34
|
"pa-checkbox",
|
|
40
35
|
{
|
|
@@ -44,9 +39,9 @@ const j = /* @__PURE__ */ C({
|
|
|
44
39
|
}
|
|
45
40
|
])
|
|
46
41
|
}, [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
id:
|
|
42
|
+
n("span", $, [
|
|
43
|
+
q(n("input", {
|
|
44
|
+
id: d.value,
|
|
50
45
|
"onUpdate:modelValue": v[0] || (v[0] = (B) => s.value = B),
|
|
51
46
|
type: "checkbox",
|
|
52
47
|
name: e.name,
|
|
@@ -55,10 +50,10 @@ const j = /* @__PURE__ */ C({
|
|
|
55
50
|
required: e.required,
|
|
56
51
|
".indeterminate": e.indeterminate,
|
|
57
52
|
"aria-invalid": o.value || void 0,
|
|
58
|
-
"aria-describedby":
|
|
53
|
+
"aria-describedby": i.value ? u.value : void 0,
|
|
59
54
|
class: "pa-checkbox__input"
|
|
60
|
-
}, null, 40,
|
|
61
|
-
[
|
|
55
|
+
}, null, 40, A), [
|
|
56
|
+
[I, s.value]
|
|
62
57
|
]),
|
|
63
58
|
x.value ? (t(), b(k, {
|
|
64
59
|
key: 0,
|
|
@@ -72,18 +67,17 @@ const j = /* @__PURE__ */ C({
|
|
|
72
67
|
class: "pa-checkbox__glyph"
|
|
73
68
|
})) : r("", !0)
|
|
74
69
|
]),
|
|
75
|
-
e.label ? (t(),
|
|
76
|
-
], 10,
|
|
77
|
-
|
|
70
|
+
e.label ? (t(), c("span", D, p(e.label), 1)) : r("", !0)
|
|
71
|
+
], 10, T),
|
|
72
|
+
i.value ? (t(), c("div", {
|
|
78
73
|
key: 0,
|
|
79
74
|
id: u.value,
|
|
80
75
|
class: h(["pa-checkbox__message", { "pa-checkbox__message--error": o.value }])
|
|
81
|
-
}, p(
|
|
76
|
+
}, p(i.value), 11, E)) : r("", !0)
|
|
82
77
|
]));
|
|
83
78
|
}
|
|
84
79
|
});
|
|
85
80
|
export {
|
|
86
|
-
|
|
87
|
-
N as nextPaCheckboxId
|
|
81
|
+
U as default
|
|
88
82
|
};
|
|
89
83
|
//# sourceMappingURL=PaCheckbox.vue2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaCheckbox.vue2.js","sources":["../../../src/components/PaCheckbox/PaCheckbox.vue"],"sourcesContent":["<script
|
|
1
|
+
{"version":3,"file":"PaCheckbox.vue2.js","sources":["../../../src/components/PaCheckbox/PaCheckbox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useId } from 'vue'\nimport PaIcon from '../PaIcon/PaIcon.vue'\n\nexport interface PaCheckboxProps {\n label?: string\n id?: string\n name?: string\n value?: string\n indeterminate?: boolean\n disabled?: boolean\n required?: boolean\n helperText?: string\n error?: string | boolean\n valid?: boolean\n}\n\nconst props = withDefaults(defineProps<PaCheckboxProps>(), {\n indeterminate: false,\n disabled: false,\n required: false,\n error: false,\n valid: false,\n})\n\nconst model = defineModel<boolean>({ default: false })\n\nconst generatedId = `pa-checkbox-${useId()}`\nconst inputId = computed(() => props.id ?? generatedId)\nconst messageId = computed(() => `${inputId.value}-msg`)\n\nconst showCheck = computed(() => model.value)\nconst showMinus = computed(() => !model.value && props.indeterminate)\n\nconst errorActive = computed(() => Boolean(props.error))\nconst validActive = computed(() => props.valid && !errorActive.value)\n\nconst errorMessage = computed(() =>\n typeof props.error === 'string' && props.error.length > 0 ? props.error : null,\n)\nconst helperMessage = computed(() =>\n !errorActive.value && !validActive.value && props.helperText ? props.helperText : null,\n)\nconst message = computed(() => errorMessage.value ?? helperMessage.value)\n</script>\n\n<template>\n <div class=\"pa-checkbox-field\">\n <label\n :for=\"inputId\"\n :class=\"[\n 'pa-checkbox',\n {\n 'pa-checkbox--disabled': disabled,\n 'pa-checkbox--error': errorActive,\n 'pa-checkbox--valid': validActive,\n },\n ]\"\n >\n <span class=\"pa-checkbox__box\">\n <input\n :id=\"inputId\"\n v-model=\"model\"\n type=\"checkbox\"\n :name=\"name\"\n :value=\"value\"\n :disabled=\"disabled\"\n :required=\"required\"\n :indeterminate.prop=\"indeterminate\"\n :aria-invalid=\"errorActive || undefined\"\n :aria-describedby=\"message ? messageId : undefined\"\n class=\"pa-checkbox__input\"\n />\n <PaIcon\n v-if=\"showCheck\"\n name=\"check\"\n size=\"sm\"\n class=\"pa-checkbox__glyph\"\n />\n <PaIcon\n v-else-if=\"showMinus\"\n name=\"minus\"\n size=\"sm\"\n class=\"pa-checkbox__glyph\"\n />\n </span>\n <span v-if=\"label\" class=\"pa-checkbox__label\">{{ label }}</span>\n </label>\n <div\n v-if=\"message\"\n :id=\"messageId\"\n :class=\"['pa-checkbox__message', { 'pa-checkbox__message--error': errorActive }]\"\n >\n {{ message }}\n </div>\n </div>\n</template>\n\n<style scoped>\n.pa-checkbox-field {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--pa-space-2xs);\n font-family: var(--pa-font-family-base);\n}\n\n.pa-checkbox {\n display: inline-flex;\n flex-direction: row;\n align-items: center;\n gap: 10px;\n cursor: pointer;\n}\n\n.pa-checkbox--disabled {\n cursor: not-allowed;\n}\n\n.pa-checkbox__box {\n position: relative;\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n}\n\n.pa-checkbox__input {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n appearance: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n background: var(--pa-color-bg-white);\n border: var(--pa-border-xs) solid var(--pa-color-neutral-gray);\n border-radius: var(--pa-radius-smooth);\n cursor: inherit;\n transition: border-color 120ms ease, background-color 120ms ease;\n}\n\n.pa-checkbox:hover:not(.pa-checkbox--disabled) .pa-checkbox__input:not(:checked):not(:indeterminate) {\n border-color: var(--pa-color-primary-hover);\n}\n\n.pa-checkbox:hover:not(.pa-checkbox--disabled):not(.pa-checkbox--error):not(.pa-checkbox--valid) .pa-checkbox__label {\n color: var(--pa-color-primary-hover);\n}\n\n.pa-checkbox__input:focus { outline: none; }\n\n.pa-checkbox__input:focus-visible {\n outline: var(--pa-border-xs) solid var(--pa-color-primary-focus-border);\n outline-offset: 3px;\n}\n\n.pa-checkbox__input:checked,\n.pa-checkbox__input:indeterminate {\n background: var(--pa-color-primary);\n border-color: var(--pa-color-primary);\n}\n\n.pa-checkbox--error .pa-checkbox__input:not(:disabled) {\n border-color: var(--pa-color-error);\n}\n\n.pa-checkbox--valid .pa-checkbox__input:not(:disabled) {\n border-color: var(--pa-color-success);\n}\n\n.pa-checkbox__input:disabled {\n cursor: not-allowed;\n background: var(--pa-color-bg-disabled-gray);\n border-color: var(--pa-color-bg-disabled-gray);\n}\n\n.pa-checkbox__glyph {\n position: relative;\n width: 12px;\n height: 12px;\n pointer-events: none;\n color: var(--pa-color-text-white);\n}\n\n.pa-checkbox--disabled .pa-checkbox__glyph {\n color: var(--pa-color-text-disabled-gray);\n}\n\n.pa-checkbox__label {\n font-size: var(--pa-font-body-size);\n line-height: var(--pa-font-body-line-height);\n font-weight: var(--pa-font-body-weight);\n color: var(--pa-color-text-secondary-gray);\n}\n\n.pa-checkbox--disabled .pa-checkbox__label {\n color: var(--pa-color-text-disabled-gray);\n}\n\n.pa-checkbox__message {\n font-size: var(--pa-font-label-helper-size);\n line-height: var(--pa-font-label-helper-line-height);\n font-weight: var(--pa-font-label-helper-weight);\n color: var(--pa-color-text-secondary-gray);\n padding-left: 34px;\n}\n\n.pa-checkbox__message--error {\n color: var(--pa-color-error);\n}\n</style>\n"],"names":["props","__props","model","_useModel","generatedId","useId","inputId","computed","messageId","showCheck","showMinus","errorActive","validActive","errorMessage","helperMessage","message","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_normalizeClass","_hoisted_3","$event","_createBlock","PaIcon","_hoisted_5","_toDisplayString","_hoisted_6"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAiBA,UAAMA,IAAQC,GAQRC,IAAQC,EAAoBF,GAAA,YAAmB,GAE/CG,IAAc,eAAeC,EAAA,CAAO,IACpCC,IAAUC,EAAS,MAAMP,EAAM,MAAMI,CAAW,GAChDI,IAAYD,EAAS,MAAM,GAAGD,EAAQ,KAAK,MAAM,GAEjDG,IAAYF,EAAS,MAAML,EAAM,KAAK,GACtCQ,IAAYH,EAAS,MAAM,CAACL,EAAM,SAASF,EAAM,aAAa,GAE9DW,IAAcJ,EAAS,MAAM,EAAQP,EAAM,KAAM,GACjDY,IAAcL,EAAS,MAAMP,EAAM,SAAS,CAACW,EAAY,KAAK,GAE9DE,IAAeN;AAAA,MAAS,MAC5B,OAAOP,EAAM,SAAU,YAAYA,EAAM,MAAM,SAAS,IAAIA,EAAM,QAAQ;AAAA,IAAA,GAEtEc,IAAgBP;AAAA,MAAS,MAC7B,CAACI,EAAY,SAAS,CAACC,EAAY,SAASZ,EAAM,aAAaA,EAAM,aAAa;AAAA,IAAA,GAE9Ee,IAAUR,EAAS,MAAMM,EAAa,SAASC,EAAc,KAAK;sBAItEE,EAAA,GAAAC,EAgDM,OAhDNC,GAgDM;AAAA,MA/CJC,EAuCQ,SAAA;AAAA,QAtCL,KAAKb,EAAA;AAAA,QACL,OAAKc,EAAA;AAAA;;qCAAwEnB,EAAA;AAAA,kCAA0CU,EAAA;AAAA,kCAA6CC,EAAA;AAAA,UAAA;AAAA;;QASrKO,EA0BO,QA1BPE,GA0BO;AAAA,YAzBLF,EAYE,SAAA;AAAA,YAXC,IAAIb,EAAA;AAAA,0DACIJ,EAAK,QAAAoB;AAAA,YACd,MAAK;AAAA,YACJ,MAAMrB,EAAA;AAAA,YACN,OAAOA,EAAA;AAAA,YACP,UAAUA,EAAA;AAAA,YACV,UAAUA,EAAA;AAAA,YACV,kBAAoBA,EAAA;AAAA,YACpB,gBAAcU,EAAA,SAAe;AAAA,YAC7B,oBAAkBI,EAAA,QAAUP,EAAA,QAAY;AAAA,YACzC,OAAM;AAAA,UAAA;gBATGN,EAAA,KAAK;AAAA,UAAA;UAYRO,EAAA,cADRc,EAKEC,GAAA;AAAA;YAHA,MAAK;AAAA,YACL,MAAK;AAAA,YACL,OAAM;AAAA,UAAA,MAGKd,EAAA,cADba,EAKEC,GAAA;AAAA;YAHA,MAAK;AAAA,YACL,MAAK;AAAA,YACL,OAAM;AAAA,UAAA;;QAGEvB,EAAA,cAAZgB,EAAgE,QAAhEQ,GAAgEC,EAAfzB,EAAA,KAAK,GAAA,CAAA;;MAGhDc,EAAA,cADRE,EAMM,OAAA;AAAA;QAJH,IAAIT,EAAA;AAAA,QACJ,mEAAiEG,EAAA,OAAW,CAAA;AAAA,MAAA,KAE1EI,EAAA,KAAO,GAAA,IAAAY,CAAA;;;;"}
|
|
@@ -14,14 +14,13 @@ export interface PaCheckboxGroupProps {
|
|
|
14
14
|
required?: boolean;
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
type __VLS_Props = PaCheckboxGroupProps;
|
|
18
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
19
19
|
modelValue?: string[];
|
|
20
|
-
}
|
|
20
|
+
};
|
|
21
|
+
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
22
|
"update:modelValue": (value: string[]) => any;
|
|
22
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
23
|
-
modelValue?: string[];
|
|
24
|
-
}> & Readonly<{
|
|
23
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
25
24
|
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
26
25
|
}>, {
|
|
27
26
|
error: string | boolean;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import o from "./PaCheckboxGroup.vue2.js";
|
|
2
|
-
import { nextPaCheckboxGroupId as c } from "./PaCheckboxGroup.vue2.js";
|
|
3
2
|
/* empty css */
|
|
4
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9c675dab"]]);
|
|
6
5
|
export {
|
|
7
|
-
|
|
8
|
-
c as nextPaCheckboxGroupId
|
|
6
|
+
c as default
|
|
9
7
|
};
|
|
10
8
|
//# sourceMappingURL=PaCheckboxGroup.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaCheckboxGroup.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PaCheckboxGroup.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import { defineComponent as q, useModel as C, computed as r, openBlock as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as q, useModel as C, useId as I, computed as r, openBlock as u, createElementBlock as i, normalizeClass as h, createTextVNode as M, toDisplayString as f, createCommentVNode as b, Fragment as T, renderList as _, createBlock as $, mergeModels as N } from "vue";
|
|
2
|
+
import S from "../PaCheckbox/PaCheckbox.vue.js";
|
|
3
|
+
const A = ["aria-labelledby", "aria-required", "aria-invalid", "aria-describedby"], P = ["id"], U = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "pa-checkbox-group__required",
|
|
6
6
|
"aria-hidden": "true"
|
|
7
|
-
},
|
|
8
|
-
let U = 0;
|
|
9
|
-
function w() {
|
|
10
|
-
return `pa-checkbox-group-${++U}`;
|
|
11
|
-
}
|
|
12
|
-
const E = /* @__PURE__ */ q({
|
|
7
|
+
}, w = ["id"], E = /* @__PURE__ */ q({
|
|
13
8
|
__name: "PaCheckboxGroup",
|
|
14
|
-
props: /* @__PURE__ */
|
|
9
|
+
props: /* @__PURE__ */ N({
|
|
15
10
|
options: {},
|
|
16
11
|
label: {},
|
|
17
12
|
id: {},
|
|
@@ -27,24 +22,24 @@ const E = /* @__PURE__ */ q({
|
|
|
27
22
|
}),
|
|
28
23
|
emits: ["update:modelValue"],
|
|
29
24
|
setup(e) {
|
|
30
|
-
const a = e, o = C(e, "modelValue"), k =
|
|
25
|
+
const a = e, o = C(e, "modelValue"), k = `pa-checkbox-group-${I()}`, n = r(() => a.id ?? k), m = r(() => `${n.value}-label`), p = r(() => `${n.value}-msg`), x = r(() => a.name ?? `${n.value}-name`), d = r(() => !!a.error), c = r(() => a.valid && !d.value), y = r(
|
|
31
26
|
() => typeof a.error == "string" && a.error.length > 0 ? a.error : null
|
|
32
27
|
), B = r(
|
|
33
|
-
() => !
|
|
28
|
+
() => !d.value && !c.value && a.helperText ? a.helperText : null
|
|
34
29
|
), v = r(() => y.value ?? B.value);
|
|
35
|
-
function V(
|
|
30
|
+
function V(s, g) {
|
|
36
31
|
if (g) {
|
|
37
|
-
if (o.value.includes(
|
|
38
|
-
const l = /* @__PURE__ */ new Set([...o.value,
|
|
32
|
+
if (o.value.includes(s)) return;
|
|
33
|
+
const l = /* @__PURE__ */ new Set([...o.value, s]);
|
|
39
34
|
o.value = a.options.map((t) => t.value).filter((t) => l.has(t));
|
|
40
35
|
} else
|
|
41
|
-
o.value = o.value.filter((l) => l !==
|
|
36
|
+
o.value = o.value.filter((l) => l !== s);
|
|
42
37
|
}
|
|
43
|
-
return (
|
|
38
|
+
return (s, g) => (u(), i("div", {
|
|
44
39
|
class: h([
|
|
45
40
|
"pa-checkbox-group",
|
|
46
41
|
{
|
|
47
|
-
"pa-checkbox-group--error":
|
|
42
|
+
"pa-checkbox-group--error": d.value,
|
|
48
43
|
"pa-checkbox-group--valid": c.value,
|
|
49
44
|
"pa-checkbox-group--disabled": e.disabled
|
|
50
45
|
}
|
|
@@ -52,38 +47,37 @@ const E = /* @__PURE__ */ q({
|
|
|
52
47
|
role: "group",
|
|
53
48
|
"aria-labelledby": e.label ? m.value : void 0,
|
|
54
49
|
"aria-required": e.required || void 0,
|
|
55
|
-
"aria-invalid":
|
|
50
|
+
"aria-invalid": d.value || void 0,
|
|
56
51
|
"aria-describedby": v.value ? p.value : void 0
|
|
57
52
|
}, [
|
|
58
|
-
e.label ? (
|
|
53
|
+
e.label ? (u(), i("span", {
|
|
59
54
|
key: 0,
|
|
60
55
|
id: m.value,
|
|
61
56
|
class: "pa-checkbox-group__label"
|
|
62
57
|
}, [
|
|
63
|
-
|
|
64
|
-
e.required ? (
|
|
65
|
-
], 8,
|
|
66
|
-
(
|
|
58
|
+
M(f(e.label), 1),
|
|
59
|
+
e.required ? (u(), i("span", U, "*")) : b("", !0)
|
|
60
|
+
], 8, P)) : b("", !0),
|
|
61
|
+
(u(!0), i(T, null, _(e.options, (l) => (u(), $(S, {
|
|
67
62
|
key: l.value,
|
|
68
63
|
"model-value": o.value.includes(l.value),
|
|
69
64
|
label: l.label,
|
|
70
65
|
value: l.value,
|
|
71
66
|
name: x.value,
|
|
72
67
|
disabled: e.disabled || l.disabled,
|
|
73
|
-
error:
|
|
68
|
+
error: d.value,
|
|
74
69
|
valid: c.value,
|
|
75
70
|
"onUpdate:modelValue": (t) => V(l.value, t)
|
|
76
71
|
}, null, 8, ["model-value", "label", "value", "name", "disabled", "error", "valid", "onUpdate:modelValue"]))), 128)),
|
|
77
|
-
v.value ? (
|
|
72
|
+
v.value ? (u(), i("div", {
|
|
78
73
|
key: 1,
|
|
79
74
|
id: p.value,
|
|
80
|
-
class: h(["pa-checkbox-group__message", { "pa-checkbox-group__message--error":
|
|
81
|
-
}, f(v.value), 11,
|
|
82
|
-
], 10,
|
|
75
|
+
class: h(["pa-checkbox-group__message", { "pa-checkbox-group__message--error": d.value }])
|
|
76
|
+
}, f(v.value), 11, w)) : b("", !0)
|
|
77
|
+
], 10, A));
|
|
83
78
|
}
|
|
84
79
|
});
|
|
85
80
|
export {
|
|
86
|
-
E as default
|
|
87
|
-
w as nextPaCheckboxGroupId
|
|
81
|
+
E as default
|
|
88
82
|
};
|
|
89
83
|
//# sourceMappingURL=PaCheckboxGroup.vue2.js.map
|