@semplice-studio/pa-design-system 0.2.0 → 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/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 +52 -58
- 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 +75 -81
- 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/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as W, useModel as F, useId as O, computed as y, ref as R, watch as P, nextTick as U, onBeforeUnmount as q, openBlock as n, createBlock as x, Teleport as j, createElementBlock as i, createElementVNode as b, normalizeClass as G, createVNode as S, createCommentVNode as a, resolveDynamicComponent as H, withCtx as J, createTextVNode as Q, toDisplayString as D, renderSlot as I, mergeModels as X } from "vue";
|
|
2
|
+
import T from "../PaIcon/PaIcon.vue.js";
|
|
3
3
|
const Y = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "pa-modal__wrapper"
|
|
@@ -9,15 +9,10 @@ const Y = {
|
|
|
9
9
|
}, le = {
|
|
10
10
|
key: 3,
|
|
11
11
|
class: "pa-modal__body"
|
|
12
|
-
},
|
|
12
|
+
}, ne = {
|
|
13
13
|
key: 4,
|
|
14
14
|
class: "pa-modal__footer"
|
|
15
|
-
}
|
|
16
|
-
let ne = 0;
|
|
17
|
-
function ie() {
|
|
18
|
-
return ++ne;
|
|
19
|
-
}
|
|
20
|
-
const ce = /* @__PURE__ */ F({
|
|
15
|
+
}, ae = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', se = /* @__PURE__ */ W({
|
|
21
16
|
__name: "PaModal",
|
|
22
17
|
props: /* @__PURE__ */ X({
|
|
23
18
|
title: {},
|
|
@@ -33,13 +28,12 @@ const ce = /* @__PURE__ */ F({
|
|
|
33
28
|
}),
|
|
34
29
|
emits: ["update:open"],
|
|
35
30
|
setup(t) {
|
|
36
|
-
const s = t, c =
|
|
31
|
+
const s = t, c = F(t, "open"), v = O(), p = `pa-modal-${v}__title`, h = `pa-modal-${v}__description`, A = y(() => s.title ? p : void 0), M = y(() => s.subtitle ? h : void 0), z = y(() => `h${s.titleLevel}`), o = R(null), m = R(null);
|
|
37
32
|
let d = null, _ = "", k = "", u = !1, r = !1;
|
|
38
|
-
const K = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
39
33
|
function w(e) {
|
|
40
|
-
return Array.from(e.querySelectorAll(
|
|
34
|
+
return Array.from(e.querySelectorAll(ae));
|
|
41
35
|
}
|
|
42
|
-
function
|
|
36
|
+
function K(e) {
|
|
43
37
|
if (e.key !== "Tab" || !o.value) return;
|
|
44
38
|
const l = w(o.value);
|
|
45
39
|
if (l.length === 0) {
|
|
@@ -52,7 +46,7 @@ const ce = /* @__PURE__ */ F({
|
|
|
52
46
|
function g(e) {
|
|
53
47
|
e.key === "Escape" && (e.preventDefault(), c.value = !1);
|
|
54
48
|
}
|
|
55
|
-
function
|
|
49
|
+
function N() {
|
|
56
50
|
if (u) return;
|
|
57
51
|
_ = document.body.style.overflow, k = document.body.style.paddingRight;
|
|
58
52
|
const e = window.innerWidth - document.documentElement.clientWidth;
|
|
@@ -61,24 +55,25 @@ const ce = /* @__PURE__ */ F({
|
|
|
61
55
|
function E() {
|
|
62
56
|
u && (document.body.style.overflow = _, document.body.style.paddingRight = k, u = !1);
|
|
63
57
|
}
|
|
64
|
-
function
|
|
58
|
+
function V() {
|
|
65
59
|
r || (window.addEventListener("keydown", g), r = !0);
|
|
66
60
|
}
|
|
67
61
|
function B() {
|
|
68
62
|
r && (window.removeEventListener("keydown", g), r = !1);
|
|
69
63
|
}
|
|
70
|
-
|
|
64
|
+
P(
|
|
71
65
|
c,
|
|
72
66
|
async (e) => {
|
|
73
|
-
if (
|
|
74
|
-
if (
|
|
75
|
-
m.value
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
67
|
+
if (!(typeof document > "u"))
|
|
68
|
+
if (e) {
|
|
69
|
+
if (d = document.activeElement, N(), V(), await U(), s.showClose && m.value)
|
|
70
|
+
m.value.focus();
|
|
71
|
+
else if (o.value) {
|
|
72
|
+
const l = w(o.value);
|
|
73
|
+
l.length > 0 ? l[0].focus() : o.value.focus();
|
|
74
|
+
}
|
|
75
|
+
} else
|
|
76
|
+
B(), E(), d && document.contains(d) && d.focus(), d = null;
|
|
82
77
|
},
|
|
83
78
|
{ flush: "post", immediate: !0 }
|
|
84
79
|
), q(() => {
|
|
@@ -87,8 +82,8 @@ const ce = /* @__PURE__ */ F({
|
|
|
87
82
|
function C() {
|
|
88
83
|
c.value = !1;
|
|
89
84
|
}
|
|
90
|
-
return (e, l) => (
|
|
91
|
-
c.value ? (
|
|
85
|
+
return (e, l) => (n(), x(j, { to: "body" }, [
|
|
86
|
+
c.value ? (n(), i("div", Y, [
|
|
92
87
|
b("div", {
|
|
93
88
|
class: "pa-modal__backdrop",
|
|
94
89
|
onClick: C
|
|
@@ -99,12 +94,12 @@ const ce = /* @__PURE__ */ F({
|
|
|
99
94
|
role: "dialog",
|
|
100
95
|
"aria-modal": "true",
|
|
101
96
|
tabindex: "-1",
|
|
102
|
-
"aria-labelledby":
|
|
103
|
-
"aria-describedby":
|
|
97
|
+
"aria-labelledby": A.value,
|
|
98
|
+
"aria-describedby": M.value,
|
|
104
99
|
class: G(["pa-modal", [`pa-modal--${t.size}`]]),
|
|
105
|
-
onKeydown:
|
|
100
|
+
onKeydown: K
|
|
106
101
|
}, [
|
|
107
|
-
t.showClose ? (
|
|
102
|
+
t.showClose ? (n(), i("button", {
|
|
108
103
|
key: 0,
|
|
109
104
|
ref_key: "closeButtonRef",
|
|
110
105
|
ref: m,
|
|
@@ -113,16 +108,16 @@ const ce = /* @__PURE__ */ F({
|
|
|
113
108
|
"aria-label": t.closeLabel,
|
|
114
109
|
onClick: C
|
|
115
110
|
}, [
|
|
116
|
-
S(
|
|
111
|
+
S(T, {
|
|
117
112
|
name: "x",
|
|
118
113
|
size: "sm"
|
|
119
114
|
})
|
|
120
|
-
], 8, ee)) :
|
|
115
|
+
], 8, ee)) : a("", !0),
|
|
121
116
|
b("div", te, [
|
|
122
|
-
t.leadingIcon ? (
|
|
123
|
-
S(
|
|
124
|
-
])) :
|
|
125
|
-
t.title ? (
|
|
117
|
+
t.leadingIcon ? (n(), i("div", oe, [
|
|
118
|
+
S(T, { name: t.leadingIcon }, null, 8, ["name"])
|
|
119
|
+
])) : a("", !0),
|
|
120
|
+
t.title ? (n(), x(H(z.value), {
|
|
126
121
|
key: 1,
|
|
127
122
|
id: p,
|
|
128
123
|
class: "pa-modal__title"
|
|
@@ -131,25 +126,25 @@ const ce = /* @__PURE__ */ F({
|
|
|
131
126
|
Q(D(t.title), 1)
|
|
132
127
|
]),
|
|
133
128
|
_: 1
|
|
134
|
-
})) :
|
|
135
|
-
t.subtitle ? (
|
|
129
|
+
})) : a("", !0),
|
|
130
|
+
t.subtitle ? (n(), i("p", {
|
|
136
131
|
key: 2,
|
|
137
132
|
id: h,
|
|
138
133
|
class: "pa-modal__subtitle"
|
|
139
|
-
}, D(t.subtitle), 1)) :
|
|
140
|
-
e.$slots.default ? (
|
|
134
|
+
}, D(t.subtitle), 1)) : a("", !0),
|
|
135
|
+
e.$slots.default ? (n(), i("div", le, [
|
|
141
136
|
I(e.$slots, "default", {}, void 0, !0)
|
|
142
|
-
])) :
|
|
143
|
-
e.$slots.footer ? (
|
|
137
|
+
])) : a("", !0),
|
|
138
|
+
e.$slots.footer ? (n(), i("div", ne, [
|
|
144
139
|
I(e.$slots, "footer", {}, void 0, !0)
|
|
145
|
-
])) :
|
|
140
|
+
])) : a("", !0)
|
|
146
141
|
])
|
|
147
142
|
], 42, Z)
|
|
148
|
-
])) :
|
|
143
|
+
])) : a("", !0)
|
|
149
144
|
]));
|
|
150
145
|
}
|
|
151
146
|
});
|
|
152
147
|
export {
|
|
153
|
-
|
|
148
|
+
se as default
|
|
154
149
|
};
|
|
155
150
|
//# sourceMappingURL=PaModal.vue2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaModal.vue2.js","sources":["../../../src/components/PaModal/PaModal.vue"],"sourcesContent":["<script lang=\"ts\">\nlet modalUid = 0\nfunction nextModalId() {\n return ++modalUid\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, onBeforeUnmount, ref, watch } from 'vue'\nimport PaIcon from '../PaIcon/PaIcon.vue'\nimport type { PaIconName } from '../PaIcon/PaIcon.vue'\n\nexport type PaModalSize = 'sm' | 'md' | 'lg'\n\nexport interface PaModalProps {\n title?: string\n titleLevel?: 1 | 2 | 3 | 4 | 5 | 6\n subtitle?: string\n leadingIcon?: PaIconName\n showClose?: boolean\n closeLabel?: string\n size?: PaModalSize\n}\n\nconst props = withDefaults(defineProps<PaModalProps>(), {\n titleLevel: 2,\n showClose: true,\n closeLabel: 'Chiudi',\n size: 'md',\n})\n\nconst open = defineModel<boolean>('open', { default: false })\n\nconst uid = nextModalId()\nconst titleId = `pa-modal-${uid}__title`\nconst descriptionId = `pa-modal-${uid}__description`\n\nconst labelledBy = computed(() => (props.title ? titleId : undefined))\nconst describedBy = computed(() => (props.subtitle ? descriptionId : undefined))\nconst titleTag = computed(() => `h${props.titleLevel}` as const)\n\nconst modalRef = ref<HTMLElement | null>(null)\nconst closeButtonRef = ref<HTMLButtonElement | null>(null)\n\nlet previouslyFocusedElement: HTMLElement | null = null\nlet originalBodyOverflow = ''\nlet originalBodyPaddingRight = ''\nlet scrollLockActive = false\nlet escListenerAttached = false\n\nconst FOCUSABLE_SELECTOR =\n 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])'\n\nfunction getFocusable(root: HTMLElement): HTMLElement[] {\n return Array.from(root.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR))\n}\n\nfunction onModalKeydown(event: KeyboardEvent) {\n if (event.key !== 'Tab' || !modalRef.value) return\n const focusable = getFocusable(modalRef.value)\n if (focusable.length === 0) {\n event.preventDefault()\n modalRef.value.focus()\n return\n }\n const first = focusable[0]!\n const last = focusable[focusable.length - 1]!\n const active = document.activeElement as HTMLElement | null\n if (event.shiftKey) {\n if (active === first || !modalRef.value.contains(active)) {\n event.preventDefault()\n last.focus()\n }\n } else {\n if (active === last || !modalRef.value.contains(active)) {\n event.preventDefault()\n first.focus()\n }\n }\n}\n\nfunction onWindowKeydownEsc(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n event.preventDefault()\n open.value = false\n }\n}\n\nfunction lockScroll() {\n if (scrollLockActive) return\n originalBodyOverflow = document.body.style.overflow\n originalBodyPaddingRight = document.body.style.paddingRight\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth\n document.body.style.overflow = 'hidden'\n if (scrollbarWidth > 0) {\n document.body.style.paddingRight = `${scrollbarWidth}px`\n }\n scrollLockActive = true\n}\n\nfunction unlockScroll() {\n if (!scrollLockActive) return\n document.body.style.overflow = originalBodyOverflow\n document.body.style.paddingRight = originalBodyPaddingRight\n scrollLockActive = false\n}\n\nfunction attachEsc() {\n if (escListenerAttached) return\n window.addEventListener('keydown', onWindowKeydownEsc)\n escListenerAttached = true\n}\n\nfunction detachEsc() {\n if (!escListenerAttached) return\n window.removeEventListener('keydown', onWindowKeydownEsc)\n escListenerAttached = false\n}\n\nwatch(\n open,\n async (next) => {\n if (next) {\n previouslyFocusedElement = document.activeElement as HTMLElement | null\n lockScroll()\n attachEsc()\n await nextTick()\n if (props.showClose && closeButtonRef.value) {\n closeButtonRef.value.focus()\n } else if (modalRef.value) {\n const focusable = getFocusable(modalRef.value)\n if (focusable.length > 0) {\n focusable[0]!.focus()\n } else {\n modalRef.value.focus()\n }\n }\n } else {\n detachEsc()\n unlockScroll()\n if (previouslyFocusedElement && document.contains(previouslyFocusedElement)) {\n previouslyFocusedElement.focus()\n }\n previouslyFocusedElement = null\n }\n },\n { flush: 'post', immediate: true },\n)\n\nonBeforeUnmount(() => {\n detachEsc()\n unlockScroll()\n})\n\nfunction close() {\n open.value = false\n}\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div v-if=\"open\"\n class=\"pa-modal__wrapper\">\n <div class=\"pa-modal__backdrop\"\n @click=\"close\" />\n <div ref=\"modalRef\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n :aria-labelledby=\"labelledBy\"\n :aria-describedby=\"describedBy\"\n class=\"pa-modal\"\n :class=\"[`pa-modal--${size}`]\"\n @keydown=\"onModalKeydown\">\n <button v-if=\"showClose\"\n ref=\"closeButtonRef\"\n type=\"button\"\n class=\"pa-modal__close\"\n :aria-label=\"closeLabel\"\n @click=\"close\">\n <PaIcon name=\"x\"\n size=\"sm\" />\n </button>\n\n <div class=\"pa-modal__container\">\n <div v-if=\"leadingIcon\"\n class=\"pa-modal__leading-icon\">\n <PaIcon :name=\"leadingIcon\" />\n </div>\n\n <component :is=\"titleTag\"\n v-if=\"title\"\n :id=\"titleId\"\n class=\"pa-modal__title\">\n {{ title }}\n </component>\n\n <p v-if=\"subtitle\"\n :id=\"descriptionId\"\n class=\"pa-modal__subtitle\">\n {{ subtitle }}\n </p>\n\n <div v-if=\"$slots.default\"\n class=\"pa-modal__body\">\n <slot />\n </div>\n\n <div v-if=\"$slots.footer\"\n class=\"pa-modal__footer\">\n <slot name=\"footer\" />\n </div>\n </div>\n </div>\n </div>\n </Teleport>\n</template>\n\n<style scoped>\n.pa-modal__wrapper {\n position: fixed;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n container-type: inline-size;\n}\n\n.pa-modal__backdrop {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n z-index: 1000;\n}\n\n.pa-modal {\n position: relative;\n z-index: 1001;\n background: var(--pa-color-bg-white);\n border-radius: 16px;\n box-shadow: var(--pa-shadow-elevation-04);\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n padding: 24px 32px 32px 32px;\n width: var(--pa-modal-width);\n max-width: calc(100vw - 32px);\n}\n\n.pa-modal:focus {\n outline: none;\n}\n\n.pa-modal--sm {\n --pa-modal-width: 400px;\n}\n\n.pa-modal--md {\n --pa-modal-width: 600px;\n}\n\n.pa-modal--lg {\n --pa-modal-width: 800px;\n}\n\n.pa-modal__close {\n width: 50px;\n height: 48px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n background: transparent;\n border: none;\n color: var(--pa-color-text-secondary-gray);\n cursor: pointer;\n padding: 0;\n}\n\n.pa-modal__close:hover {\n background: var(--pa-color-bg-secondary-light-50);\n}\n\n.pa-modal__close:focus-visible {\n outline: var(--pa-border-sm) solid var(--pa-color-primary-focus-border);\n outline-offset: 2px;\n}\n\n.pa-modal__container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 24px;\n width: 100%;\n}\n\n.pa-modal__leading-icon {\n display: flex;\n align-items: flex-start;\n padding-bottom: 16px;\n width: 100%;\n}\n\n.pa-modal__leading-icon :deep(svg) {\n width: 32px;\n height: 32px;\n}\n\n.pa-modal__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-color-text-secondary-gray);\n width: 100%;\n}\n\n.pa-modal__subtitle {\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-color-text-secondary-gray);\n width: 100%;\n}\n\n.pa-modal__body {\n width: 100%;\n}\n\n.pa-modal__footer {\n display: flex;\n gap: 24px;\n padding-top: 16px;\n width: 100%;\n justify-content: flex-end;\n align-items: center;\n}\n\n@container (max-width: 600px) {\n .pa-modal {\n width: calc(100vw - 32px);\n max-width: none;\n padding: 24px;\n }\n\n .pa-modal__container {\n align-items: flex-start;\n justify-content: flex-start;\n gap: 16px;\n }\n\n .pa-modal__leading-icon :deep(svg) {\n width: 24px;\n height: 24px;\n }\n\n .pa-modal__footer {\n flex-direction: column;\n align-items: stretch;\n justify-content: flex-start;\n gap: 24px;\n }\n}\n</style>\n"],"names":["modalUid","nextModalId","props","__props","open","_useModel","uid","titleId","descriptionId","labelledBy","computed","describedBy","titleTag","modalRef","ref","closeButtonRef","previouslyFocusedElement","originalBodyOverflow","originalBodyPaddingRight","scrollLockActive","escListenerAttached","FOCUSABLE_SELECTOR","getFocusable","root","onModalKeydown","event","focusable","first","last","active","onWindowKeydownEsc","lockScroll","scrollbarWidth","unlockScroll","attachEsc","detachEsc","watch","next","nextTick","onBeforeUnmount","close","_createBlock","_Teleport","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_normalizeClass","_createVNode","PaIcon","_hoisted_4","_hoisted_5","_resolveDynamicComponent","$slots","_hoisted_6","_renderSlot","_ctx","_hoisted_7"],"mappings":";;;;;;;;;;;;;;;AACA,IAAIA,KAAW;AACf,SAASC,KAAc;AACrB,SAAO,EAAED;AACX;;;;;;;;;;;;;;;;;AAoBA,UAAME,IAAQC,GAORC,IAAOC,EAAoBF,GAAC,MAA0B,GAEtDG,IAAML,GAAA,GACNM,IAAU,YAAYD,CAAG,WACzBE,IAAgB,YAAYF,CAAG,iBAE/BG,IAAaC,EAAS,MAAOR,EAAM,QAAQK,IAAU,MAAU,GAC/DI,IAAcD,EAAS,MAAOR,EAAM,WAAWM,IAAgB,MAAU,GACzEI,IAAWF,EAAS,MAAM,IAAIR,EAAM,UAAU,EAAW,GAEzDW,IAAWC,EAAwB,IAAI,GACvCC,IAAiBD,EAA8B,IAAI;AAEzD,QAAIE,IAA+C,MAC/CC,IAAuB,IACvBC,IAA2B,IAC3BC,IAAmB,IACnBC,IAAsB;AAE1B,UAAMC,IACJ;AAEF,aAASC,EAAaC,GAAkC;AACtD,aAAO,MAAM,KAAKA,EAAK,iBAA8BF,CAAkB,CAAC;AAAA,IAC1E;AAEA,aAASG,EAAeC,GAAsB;AAC5C,UAAIA,EAAM,QAAQ,SAAS,CAACZ,EAAS,MAAO;AAC5C,YAAMa,IAAYJ,EAAaT,EAAS,KAAK;AAC7C,UAAIa,EAAU,WAAW,GAAG;AAC1B,QAAAD,EAAM,eAAA,GACNZ,EAAS,MAAM,MAAA;AACf;AAAA,MACF;AACA,YAAMc,IAAQD,EAAU,CAAC,GACnBE,IAAOF,EAAUA,EAAU,SAAS,CAAC,GACrCG,IAAS,SAAS;AACxB,MAAIJ,EAAM,YACJI,MAAWF,KAAS,CAACd,EAAS,MAAM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,IAAIL;AAAA,cACL,OAAM;AAAA,YAAA;yBACf,MAAW;AAAA,oBAARJ,EAAA,KAAK,GAAA,CAAA;AAAA,cAAA;;;YAGDA,EAAA,iBAATyC,EAII,KAAA;AAAA;cAHA,IAAIpC;AAAA,cACL,OAAM;AAAA,YAAA,KACJL,EAAA,QAAQ,GAAA,CAAA;YAGFkD,EAAAA,OAAO,WAAlBV,KAAAC,EAGM,OAHNU,IAGM;AAAA,cADJC,EAAQC,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,YAAA;YAGCH,EAAAA,OAAO,UAAlBV,KAAAC,EAGM,OAHNa,IAGM;AAAA,cADJF,EAAsBC,EAAA,QAAA,UAAA,CAAA,GAAA,QAAA,EAAA;AAAA,YAAA;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"PaModal.vue2.js","sources":["../../../src/components/PaModal/PaModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, nextTick, onBeforeUnmount, ref, useId, watch } from 'vue'\nimport PaIcon from '../PaIcon/PaIcon.vue'\nimport type { PaIconName } from '../PaIcon/PaIcon.vue'\n\nexport type PaModalSize = 'sm' | 'md' | 'lg'\n\nexport interface PaModalProps {\n title?: string\n titleLevel?: 1 | 2 | 3 | 4 | 5 | 6\n subtitle?: string\n leadingIcon?: PaIconName\n showClose?: boolean\n closeLabel?: string\n size?: PaModalSize\n}\n\nconst props = withDefaults(defineProps<PaModalProps>(), {\n titleLevel: 2,\n showClose: true,\n closeLabel: 'Chiudi',\n size: 'md',\n})\n\nconst open = defineModel<boolean>('open', { default: false })\n\nconst uid = useId()\nconst titleId = `pa-modal-${uid}__title`\nconst descriptionId = `pa-modal-${uid}__description`\n\nconst labelledBy = computed(() => (props.title ? titleId : undefined))\nconst describedBy = computed(() => (props.subtitle ? descriptionId : undefined))\nconst titleTag = computed(() => `h${props.titleLevel}` as const)\n\nconst modalRef = ref<HTMLElement | null>(null)\nconst closeButtonRef = ref<HTMLButtonElement | null>(null)\n\nlet previouslyFocusedElement: HTMLElement | null = null\nlet originalBodyOverflow = ''\nlet originalBodyPaddingRight = ''\nlet scrollLockActive = false\nlet escListenerAttached = false\n\nconst FOCUSABLE_SELECTOR =\n 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])'\n\nfunction getFocusable(root: HTMLElement): HTMLElement[] {\n return Array.from(root.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR))\n}\n\nfunction onModalKeydown(event: KeyboardEvent) {\n if (event.key !== 'Tab' || !modalRef.value) return\n const focusable = getFocusable(modalRef.value)\n if (focusable.length === 0) {\n event.preventDefault()\n modalRef.value.focus()\n return\n }\n const first = focusable[0]!\n const last = focusable[focusable.length - 1]!\n const active = document.activeElement as HTMLElement | null\n if (event.shiftKey) {\n if (active === first || !modalRef.value.contains(active)) {\n event.preventDefault()\n last.focus()\n }\n } else {\n if (active === last || !modalRef.value.contains(active)) {\n event.preventDefault()\n first.focus()\n }\n }\n}\n\nfunction onWindowKeydownEsc(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n event.preventDefault()\n open.value = false\n }\n}\n\nfunction lockScroll() {\n if (scrollLockActive) return\n originalBodyOverflow = document.body.style.overflow\n originalBodyPaddingRight = document.body.style.paddingRight\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth\n document.body.style.overflow = 'hidden'\n if (scrollbarWidth > 0) {\n document.body.style.paddingRight = `${scrollbarWidth}px`\n }\n scrollLockActive = true\n}\n\nfunction unlockScroll() {\n if (!scrollLockActive) return\n document.body.style.overflow = originalBodyOverflow\n document.body.style.paddingRight = originalBodyPaddingRight\n scrollLockActive = false\n}\n\nfunction attachEsc() {\n if (escListenerAttached) return\n window.addEventListener('keydown', onWindowKeydownEsc)\n escListenerAttached = true\n}\n\nfunction detachEsc() {\n if (!escListenerAttached) return\n window.removeEventListener('keydown', onWindowKeydownEsc)\n escListenerAttached = false\n}\n\nwatch(\n open,\n async (next) => {\n if (typeof document === 'undefined') return\n if (next) {\n previouslyFocusedElement = document.activeElement as HTMLElement | null\n lockScroll()\n attachEsc()\n await nextTick()\n if (props.showClose && closeButtonRef.value) {\n closeButtonRef.value.focus()\n } else if (modalRef.value) {\n const focusable = getFocusable(modalRef.value)\n if (focusable.length > 0) {\n focusable[0]!.focus()\n } else {\n modalRef.value.focus()\n }\n }\n } else {\n detachEsc()\n unlockScroll()\n if (previouslyFocusedElement && document.contains(previouslyFocusedElement)) {\n previouslyFocusedElement.focus()\n }\n previouslyFocusedElement = null\n }\n },\n { flush: 'post', immediate: true },\n)\n\nonBeforeUnmount(() => {\n detachEsc()\n unlockScroll()\n})\n\nfunction close() {\n open.value = false\n}\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div v-if=\"open\"\n class=\"pa-modal__wrapper\">\n <div class=\"pa-modal__backdrop\"\n @click=\"close\" />\n <div ref=\"modalRef\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n :aria-labelledby=\"labelledBy\"\n :aria-describedby=\"describedBy\"\n class=\"pa-modal\"\n :class=\"[`pa-modal--${size}`]\"\n @keydown=\"onModalKeydown\">\n <button v-if=\"showClose\"\n ref=\"closeButtonRef\"\n type=\"button\"\n class=\"pa-modal__close\"\n :aria-label=\"closeLabel\"\n @click=\"close\">\n <PaIcon name=\"x\"\n size=\"sm\" />\n </button>\n\n <div class=\"pa-modal__container\">\n <div v-if=\"leadingIcon\"\n class=\"pa-modal__leading-icon\">\n <PaIcon :name=\"leadingIcon\" />\n </div>\n\n <component :is=\"titleTag\"\n v-if=\"title\"\n :id=\"titleId\"\n class=\"pa-modal__title\">\n {{ title }}\n </component>\n\n <p v-if=\"subtitle\"\n :id=\"descriptionId\"\n class=\"pa-modal__subtitle\">\n {{ subtitle }}\n </p>\n\n <div v-if=\"$slots.default\"\n class=\"pa-modal__body\">\n <slot />\n </div>\n\n <div v-if=\"$slots.footer\"\n class=\"pa-modal__footer\">\n <slot name=\"footer\" />\n </div>\n </div>\n </div>\n </div>\n </Teleport>\n</template>\n\n<style scoped>\n.pa-modal__wrapper {\n position: fixed;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n container-type: inline-size;\n}\n\n.pa-modal__backdrop {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n z-index: 1000;\n}\n\n.pa-modal {\n position: relative;\n z-index: 1001;\n background: var(--pa-color-bg-white);\n border-radius: 16px;\n box-shadow: var(--pa-shadow-elevation-04);\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n padding: 24px 32px 32px 32px;\n width: var(--pa-modal-width);\n max-width: calc(100vw - 32px);\n}\n\n.pa-modal:focus {\n outline: none;\n}\n\n.pa-modal--sm {\n --pa-modal-width: 400px;\n}\n\n.pa-modal--md {\n --pa-modal-width: 600px;\n}\n\n.pa-modal--lg {\n --pa-modal-width: 800px;\n}\n\n.pa-modal__close {\n width: 50px;\n height: 48px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n background: transparent;\n border: none;\n color: var(--pa-color-text-secondary-gray);\n cursor: pointer;\n padding: 0;\n}\n\n.pa-modal__close:hover {\n background: var(--pa-color-bg-secondary-light-50);\n}\n\n.pa-modal__close:focus-visible {\n outline: var(--pa-border-sm) solid var(--pa-color-primary-focus-border);\n outline-offset: 2px;\n}\n\n.pa-modal__container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 24px;\n width: 100%;\n}\n\n.pa-modal__leading-icon {\n display: flex;\n align-items: flex-start;\n padding-bottom: 16px;\n width: 100%;\n}\n\n.pa-modal__leading-icon :deep(svg) {\n width: 32px;\n height: 32px;\n}\n\n.pa-modal__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-color-text-secondary-gray);\n width: 100%;\n}\n\n.pa-modal__subtitle {\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-color-text-secondary-gray);\n width: 100%;\n}\n\n.pa-modal__body {\n width: 100%;\n}\n\n.pa-modal__footer {\n display: flex;\n gap: 24px;\n padding-top: 16px;\n width: 100%;\n justify-content: flex-end;\n align-items: center;\n}\n\n@container (max-width: 600px) {\n .pa-modal {\n width: calc(100vw - 32px);\n max-width: none;\n padding: 24px;\n }\n\n .pa-modal__container {\n align-items: flex-start;\n justify-content: flex-start;\n gap: 16px;\n }\n\n .pa-modal__leading-icon :deep(svg) {\n width: 24px;\n height: 24px;\n }\n\n .pa-modal__footer {\n flex-direction: column;\n align-items: stretch;\n justify-content: flex-start;\n gap: 24px;\n }\n}\n</style>\n"],"names":["FOCUSABLE_SELECTOR","props","__props","open","_useModel","uid","useId","titleId","descriptionId","labelledBy","computed","describedBy","titleTag","modalRef","ref","closeButtonRef","previouslyFocusedElement","originalBodyOverflow","originalBodyPaddingRight","scrollLockActive","escListenerAttached","getFocusable","root","onModalKeydown","event","focusable","first","last","active","onWindowKeydownEsc","lockScroll","scrollbarWidth","unlockScroll","attachEsc","detachEsc","watch","next","nextTick","onBeforeUnmount","close","_createBlock","_Teleport","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_normalizeClass","_createVNode","PaIcon","_hoisted_4","_hoisted_5","_resolveDynamicComponent","$slots","_hoisted_6","_renderSlot","_ctx","_hoisted_7"],"mappings":";;;;;;;;;;;;;;GA2CMA,KACJ;;;;;;;;;;;;;;;;AA3BF,UAAMC,IAAQC,GAORC,IAAOC,EAAoBF,GAAC,MAA0B,GAEtDG,IAAMC,EAAA,GACNC,IAAU,YAAYF,CAAG,WACzBG,IAAgB,YAAYH,CAAG,iBAE/BI,IAAaC,EAAS,MAAOT,EAAM,QAAQM,IAAU,MAAU,GAC/DI,IAAcD,EAAS,MAAOT,EAAM,WAAWO,IAAgB,MAAU,GACzEI,IAAWF,EAAS,MAAM,IAAIT,EAAM,UAAU,EAAW,GA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| 'inline';
|
|
4
3
|
placeholder?: string;
|
|
5
4
|
label?: string;
|
|
6
5
|
required?: boolean;
|
|
@@ -14,28 +13,17 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
14
13
|
min?: Date | null;
|
|
15
14
|
max?: Date | null;
|
|
16
15
|
disabledMonths?: (date: Date) => boolean;
|
|
17
|
-
}
|
|
16
|
+
};
|
|
17
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
18
18
|
modelValue?: Date | null;
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
|
+
declare var __VLS_1: {};
|
|
21
|
+
type __VLS_Slots = {} & {
|
|
22
|
+
suffix?: (props: typeof __VLS_1) => any;
|
|
23
|
+
};
|
|
24
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
25
|
"update:modelValue": (value: Date | null) => any;
|
|
21
|
-
}, string, import("vue").PublicProps, Readonly<{
|
|
22
|
-
display?: "popover" | "inline";
|
|
23
|
-
placeholder?: string;
|
|
24
|
-
label?: string;
|
|
25
|
-
required?: boolean;
|
|
26
|
-
helperText?: string;
|
|
27
|
-
error?: string | boolean;
|
|
28
|
-
valid?: boolean;
|
|
29
|
-
disabled?: boolean;
|
|
30
|
-
readonly?: boolean;
|
|
31
|
-
id?: string;
|
|
32
|
-
name?: string;
|
|
33
|
-
min?: Date | null;
|
|
34
|
-
max?: Date | null;
|
|
35
|
-
disabledMonths?: (date: Date) => boolean;
|
|
36
|
-
} & {
|
|
37
|
-
modelValue?: Date | null;
|
|
38
|
-
}> & Readonly<{
|
|
26
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
39
27
|
"onUpdate:modelValue"?: ((value: Date | null) => any) | undefined;
|
|
40
28
|
}>, {
|
|
41
29
|
error: string | boolean;
|
|
@@ -48,9 +36,8 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
48
36
|
max: Date | null;
|
|
49
37
|
display: "popover" | "inline";
|
|
50
38
|
disabledMonths: (date: Date) => boolean;
|
|
51
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any
|
|
52
|
-
|
|
53
|
-
}>;
|
|
39
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
54
41
|
export default _default;
|
|
55
42
|
type __VLS_WithSlots<T, S> = T & {
|
|
56
43
|
new (): {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import o from "./PaMonthPicker.vue2.js";
|
|
2
|
-
import { nextPaMonthPickerId as p } from "./PaMonthPicker.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-bb0ffaf9"]]);
|
|
6
5
|
export {
|
|
7
|
-
|
|
8
|
-
p as nextPaMonthPickerId
|
|
6
|
+
m as default
|
|
9
7
|
};
|
|
10
8
|
//# sourceMappingURL=PaMonthPicker.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaMonthPicker.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PaMonthPicker.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as ie, useModel as ue, ref as h, useId as j, computed as o, watch as se, onBeforeUnmount as de, openBlock as v, createElementBlock as p, normalizeClass as g, createTextVNode as ce, toDisplayString as b, createCommentVNode as k, withKeys as S, withModifiers as q, createElementVNode as d, renderSlot as ve, createVNode as Y, withDirectives as pe, Fragment as fe, renderList as me, vShow as he, mergeModels as ge, nextTick as J } from "vue";
|
|
2
2
|
import B from "../PaIcon/PaIcon.vue.js";
|
|
3
|
-
const
|
|
3
|
+
const be = ["for"], ke = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "pa-month-picker__required",
|
|
6
6
|
"aria-hidden": "true"
|
|
7
|
-
},
|
|
7
|
+
}, ye = ["id", "disabled", "aria-expanded", "aria-required", "aria-invalid", "aria-readonly", "aria-describedby", "onKeydown"], we = { class: "pa-month-picker__value" }, De = ["name", "value", "disabled", "readonly", "required"], _e = { class: "pa-month-picker__header" }, Me = {
|
|
8
8
|
class: "pa-month-picker__year-label",
|
|
9
9
|
"aria-live": "polite"
|
|
10
|
-
},
|
|
11
|
-
let Ae = 0;
|
|
12
|
-
function Ee() {
|
|
13
|
-
return `pa-month-picker-${++Ae}`;
|
|
14
|
-
}
|
|
15
|
-
const Se = /* @__PURE__ */ le({
|
|
10
|
+
}, Te = ["disabled", "tabindex", "aria-pressed", "onClick", "onKeydown"], Ae = ["id"], Ne = /* @__PURE__ */ ie({
|
|
16
11
|
__name: "PaMonthPicker",
|
|
17
|
-
props: /* @__PURE__ */
|
|
12
|
+
props: /* @__PURE__ */ ge({
|
|
18
13
|
display: { default: "popover" },
|
|
19
14
|
placeholder: { default: "mese / aaaa" },
|
|
20
15
|
label: {},
|
|
@@ -35,7 +30,7 @@ const Se = /* @__PURE__ */ le({
|
|
|
35
30
|
}),
|
|
36
31
|
emits: ["update:modelValue"],
|
|
37
32
|
setup(t) {
|
|
38
|
-
const n = t, i =
|
|
33
|
+
const n = t, i = ue(t, "modelValue"), _ = h(null), C = h(null), L = h(null), u = h(!1), $ = `pa-month-picker-pop-${j()}`, Q = `pa-month-picker-${j()}`, M = o(() => n.id ?? Q), V = o(() => `${M.value}-msg`), X = [
|
|
39
34
|
"Gennaio",
|
|
40
35
|
"Febbraio",
|
|
41
36
|
"Marzo",
|
|
@@ -50,39 +45,39 @@ const Se = /* @__PURE__ */ le({
|
|
|
50
45
|
"Dicembre"
|
|
51
46
|
], c = h(
|
|
52
47
|
i.value instanceof Date ? i.value.getFullYear() : (/* @__PURE__ */ new Date()).getFullYear()
|
|
53
|
-
),
|
|
48
|
+
), Z = new Intl.DateTimeFormat("it-IT", {
|
|
54
49
|
month: "long",
|
|
55
50
|
year: "numeric"
|
|
56
|
-
}),
|
|
51
|
+
}), ee = o(() => {
|
|
57
52
|
const e = i.value;
|
|
58
53
|
if (!(e instanceof Date) || isNaN(e.getTime())) return n.placeholder;
|
|
59
|
-
const a =
|
|
54
|
+
const a = Z.format(e);
|
|
60
55
|
return a.charAt(0).toUpperCase() + a.slice(1);
|
|
61
|
-
}),
|
|
56
|
+
}), ae = o(() => !(i.value instanceof Date)), f = o(() => !!n.error), I = o(() => n.valid && !f.value), te = o(
|
|
62
57
|
() => typeof n.error == "string" && n.error.length > 0 ? n.error : null
|
|
63
|
-
),
|
|
64
|
-
() => !
|
|
65
|
-
), T = o(() =>
|
|
58
|
+
), ne = o(
|
|
59
|
+
() => !f.value && n.helperText ? n.helperText : null
|
|
60
|
+
), T = o(() => te.value ?? ne.value), re = o(() => {
|
|
66
61
|
const e = i.value;
|
|
67
62
|
if (!(e instanceof Date) || isNaN(e.getTime())) return "";
|
|
68
63
|
const a = e.getFullYear(), r = String(e.getMonth() + 1).padStart(2, "0");
|
|
69
64
|
return `${a}-${r}`;
|
|
70
65
|
});
|
|
71
|
-
function
|
|
66
|
+
function K(e) {
|
|
72
67
|
return new Date(e.getFullYear(), e.getMonth(), 1, 0, 0, 0, 0);
|
|
73
68
|
}
|
|
74
|
-
const
|
|
75
|
-
() => n.min ?
|
|
69
|
+
const P = o(
|
|
70
|
+
() => n.min ? K(n.min) : null
|
|
76
71
|
), R = o(
|
|
77
|
-
() => n.max ?
|
|
72
|
+
() => n.max ? K(n.max) : null
|
|
78
73
|
);
|
|
79
|
-
function
|
|
74
|
+
function z(e) {
|
|
80
75
|
const a = new Date(c.value, e, 1, 0, 0, 0, 0);
|
|
81
|
-
return
|
|
76
|
+
return P.value && a.getTime() < P.value.getTime() || R.value && a.getTime() > R.value.getTime() ? !0 : n.disabledMonths ? n.disabledMonths(a) === !0 : !1;
|
|
82
77
|
}
|
|
83
78
|
const m = o(
|
|
84
|
-
() => Array.from({ length: 12 }, (e, a) =>
|
|
85
|
-
),
|
|
79
|
+
() => Array.from({ length: 12 }, (e, a) => z(a))
|
|
80
|
+
), x = o(() => {
|
|
86
81
|
const e = i.value;
|
|
87
82
|
return !(e instanceof Date) || isNaN(e.getTime()) || e.getFullYear() !== c.value ? null : e.getMonth();
|
|
88
83
|
});
|
|
@@ -102,8 +97,8 @@ const Se = /* @__PURE__ */ le({
|
|
|
102
97
|
function H() {
|
|
103
98
|
c.value += 1;
|
|
104
99
|
}
|
|
105
|
-
function
|
|
106
|
-
n.readonly ||
|
|
100
|
+
function oe(e) {
|
|
101
|
+
n.readonly || z(e) || (i.value = new Date(c.value, e, 1, 0, 0, 0, 0), n.display === "popover" && y());
|
|
107
102
|
}
|
|
108
103
|
function E(e) {
|
|
109
104
|
var s, W;
|
|
@@ -133,7 +128,7 @@ const Se = /* @__PURE__ */ le({
|
|
|
133
128
|
const r = O(e, a);
|
|
134
129
|
r >= 0 && E(r);
|
|
135
130
|
}
|
|
136
|
-
function
|
|
131
|
+
function le(e, a) {
|
|
137
132
|
switch (e.key) {
|
|
138
133
|
case "ArrowRight":
|
|
139
134
|
e.preventDefault(), w(a, 1);
|
|
@@ -154,10 +149,10 @@ const Se = /* @__PURE__ */ le({
|
|
|
154
149
|
e.preventDefault(), D(11, -1);
|
|
155
150
|
break;
|
|
156
151
|
case "PageDown":
|
|
157
|
-
e.preventDefault(), H(),
|
|
152
|
+
e.preventDefault(), H(), J(() => D(a, 1));
|
|
158
153
|
break;
|
|
159
154
|
case "PageUp":
|
|
160
|
-
e.preventDefault(), G(),
|
|
155
|
+
e.preventDefault(), G(), J(() => D(a, 1));
|
|
161
156
|
break;
|
|
162
157
|
}
|
|
163
158
|
}
|
|
@@ -167,11 +162,11 @@ const Se = /* @__PURE__ */ le({
|
|
|
167
162
|
function N(e) {
|
|
168
163
|
e.key === "Escape" && (e.preventDefault(), y());
|
|
169
164
|
}
|
|
170
|
-
return
|
|
165
|
+
return se(u, (e) => {
|
|
171
166
|
e ? (document.addEventListener("mousedown", F), window.addEventListener("keydown", N)) : (document.removeEventListener("mousedown", F), window.removeEventListener("keydown", N));
|
|
172
|
-
}),
|
|
167
|
+
}), de(() => {
|
|
173
168
|
document.removeEventListener("mousedown", F), window.removeEventListener("keydown", N);
|
|
174
|
-
}), (e, a) => (v(),
|
|
169
|
+
}), (e, a) => (v(), p("div", {
|
|
175
170
|
ref_key: "rootRef",
|
|
176
171
|
ref: _,
|
|
177
172
|
class: g([
|
|
@@ -181,20 +176,20 @@ const Se = /* @__PURE__ */ le({
|
|
|
181
176
|
"pa-month-picker--open": u.value,
|
|
182
177
|
"pa-month-picker--disabled": t.disabled,
|
|
183
178
|
"pa-month-picker--readonly": t.readonly,
|
|
184
|
-
"pa-month-picker--error":
|
|
185
|
-
"pa-month-picker--valid":
|
|
179
|
+
"pa-month-picker--error": f.value,
|
|
180
|
+
"pa-month-picker--valid": I.value
|
|
186
181
|
}
|
|
187
182
|
])
|
|
188
183
|
}, [
|
|
189
|
-
t.label ? (v(),
|
|
184
|
+
t.label ? (v(), p("label", {
|
|
190
185
|
key: 0,
|
|
191
186
|
for: M.value,
|
|
192
187
|
class: "pa-month-picker__label"
|
|
193
188
|
}, [
|
|
194
|
-
|
|
195
|
-
t.required ? (v(),
|
|
196
|
-
], 8,
|
|
197
|
-
t.display === "popover" ? (v(),
|
|
189
|
+
ce(b(t.label), 1),
|
|
190
|
+
t.required ? (v(), p("span", ke, "*")) : k("", !0)
|
|
191
|
+
], 8, be)) : k("", !0),
|
|
192
|
+
t.display === "popover" ? (v(), p("button", {
|
|
198
193
|
key: 1,
|
|
199
194
|
id: M.value,
|
|
200
195
|
ref_key: "triggerRef",
|
|
@@ -203,21 +198,21 @@ const Se = /* @__PURE__ */ le({
|
|
|
203
198
|
class: g([
|
|
204
199
|
"pa-month-picker__trigger",
|
|
205
200
|
{
|
|
206
|
-
"pa-month-picker__trigger--placeholder":
|
|
201
|
+
"pa-month-picker__trigger--placeholder": ae.value,
|
|
207
202
|
"pa-month-picker__trigger--disabled": t.disabled,
|
|
208
203
|
"pa-month-picker__trigger--readonly": t.readonly && !t.disabled,
|
|
209
|
-
"pa-month-picker__trigger--error":
|
|
210
|
-
"pa-month-picker__trigger--valid":
|
|
204
|
+
"pa-month-picker__trigger--error": f.value && !t.disabled,
|
|
205
|
+
"pa-month-picker__trigger--valid": I.value && !t.disabled
|
|
211
206
|
}
|
|
212
207
|
]),
|
|
213
208
|
disabled: t.disabled,
|
|
214
209
|
"aria-expanded": u.value,
|
|
215
210
|
"aria-haspopup": "dialog",
|
|
216
|
-
"aria-controls":
|
|
211
|
+
"aria-controls": $,
|
|
217
212
|
"aria-required": t.required || void 0,
|
|
218
|
-
"aria-invalid":
|
|
213
|
+
"aria-invalid": f.value || void 0,
|
|
219
214
|
"aria-readonly": t.readonly || void 0,
|
|
220
|
-
"aria-describedby": T.value ?
|
|
215
|
+
"aria-describedby": T.value ? V.value : void 0,
|
|
221
216
|
onClick: A,
|
|
222
217
|
onKeydown: [
|
|
223
218
|
S(q(A, ["prevent"]), ["enter"]),
|
|
@@ -225,25 +220,25 @@ const Se = /* @__PURE__ */ le({
|
|
|
225
220
|
S(q(U, ["prevent"]), ["down"])
|
|
226
221
|
]
|
|
227
222
|
}, [
|
|
228
|
-
d("span",
|
|
229
|
-
|
|
223
|
+
d("span", we, b(ee.value), 1),
|
|
224
|
+
ve(e.$slots, "suffix", {}, () => [
|
|
230
225
|
Y(B, {
|
|
231
226
|
name: "calendar-blank",
|
|
232
227
|
size: "md"
|
|
233
228
|
})
|
|
234
229
|
], !0)
|
|
235
|
-
], 42,
|
|
236
|
-
t.name ? (v(),
|
|
230
|
+
], 42, ye)) : k("", !0),
|
|
231
|
+
t.name ? (v(), p("input", {
|
|
237
232
|
key: 2,
|
|
238
233
|
type: "hidden",
|
|
239
234
|
name: t.name,
|
|
240
|
-
value:
|
|
235
|
+
value: re.value,
|
|
241
236
|
disabled: t.disabled,
|
|
242
237
|
readonly: t.readonly,
|
|
243
238
|
required: t.required
|
|
244
|
-
}, null, 8,
|
|
245
|
-
|
|
246
|
-
id:
|
|
239
|
+
}, null, 8, De)) : k("", !0),
|
|
240
|
+
pe(d("div", {
|
|
241
|
+
id: $,
|
|
247
242
|
class: g([
|
|
248
243
|
"pa-month-picker__popover",
|
|
249
244
|
{ "pa-month-picker__popover--inline": t.display === "inline" }
|
|
@@ -251,7 +246,7 @@ const Se = /* @__PURE__ */ le({
|
|
|
251
246
|
role: "dialog",
|
|
252
247
|
"aria-modal": "false"
|
|
253
248
|
}, [
|
|
254
|
-
d("div",
|
|
249
|
+
d("div", _e, [
|
|
255
250
|
d("button", {
|
|
256
251
|
type: "button",
|
|
257
252
|
class: "pa-month-picker__nav-arrow",
|
|
@@ -263,7 +258,7 @@ const Se = /* @__PURE__ */ le({
|
|
|
263
258
|
size: "sm"
|
|
264
259
|
})
|
|
265
260
|
]),
|
|
266
|
-
d("span",
|
|
261
|
+
d("span", Me, b(c.value), 1),
|
|
267
262
|
d("button", {
|
|
268
263
|
type: "button",
|
|
269
264
|
class: "pa-month-picker__nav-arrow",
|
|
@@ -282,33 +277,32 @@ const Se = /* @__PURE__ */ le({
|
|
|
282
277
|
class: "pa-month-picker__grid",
|
|
283
278
|
role: "grid"
|
|
284
279
|
}, [
|
|
285
|
-
(v(),
|
|
280
|
+
(v(), p(fe, null, me(X, (r, l) => d("button", {
|
|
286
281
|
key: r,
|
|
287
282
|
type: "button",
|
|
288
283
|
class: g(["pa-month-picker__tile", {
|
|
289
|
-
"pa-month-picker__tile--selected":
|
|
284
|
+
"pa-month-picker__tile--selected": x.value === l,
|
|
290
285
|
"pa-month-picker__tile--disabled": m.value[l]
|
|
291
286
|
}]),
|
|
292
287
|
disabled: m.value[l],
|
|
293
288
|
tabindex: m.value[l] ? -1 : 0,
|
|
294
|
-
"aria-pressed":
|
|
295
|
-
onClick: (s) =>
|
|
296
|
-
onKeydown: (s) =>
|
|
297
|
-
}, b(r), 43,
|
|
289
|
+
"aria-pressed": x.value === l,
|
|
290
|
+
onClick: (s) => oe(l),
|
|
291
|
+
onKeydown: (s) => le(s, l)
|
|
292
|
+
}, b(r), 43, Te)), 64))
|
|
298
293
|
], 512)
|
|
299
294
|
], 2), [
|
|
300
|
-
[
|
|
295
|
+
[he, t.display === "inline" || u.value]
|
|
301
296
|
]),
|
|
302
|
-
T.value ? (v(),
|
|
297
|
+
T.value ? (v(), p("div", {
|
|
303
298
|
key: 3,
|
|
304
|
-
id:
|
|
305
|
-
class: g(["pa-month-picker__message", { "pa-month-picker__message--error":
|
|
306
|
-
}, b(T.value), 11,
|
|
299
|
+
id: V.value,
|
|
300
|
+
class: g(["pa-month-picker__message", { "pa-month-picker__message--error": f.value }])
|
|
301
|
+
}, b(T.value), 11, Ae)) : k("", !0)
|
|
307
302
|
], 2));
|
|
308
303
|
}
|
|
309
304
|
});
|
|
310
305
|
export {
|
|
311
|
-
|
|
312
|
-
Ee as nextPaMonthPickerId
|
|
306
|
+
Ne as default
|
|
313
307
|
};
|
|
314
308
|
//# sourceMappingURL=PaMonthPicker.vue2.js.map
|