@bertimatteodev/astra-ui 0.8.5 → 0.9.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/astra-ui.cjs +1 -1
- package/dist/astra-ui.css +1 -1
- package/dist/astra-ui.js +231 -191
- package/dist/types/components/List/List.d.ts +12 -18
- package/dist/types/components/List/List.d.ts.map +1 -1
- package/dist/types/components/List/index.d.ts +2 -2
- package/dist/types/components/List/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/astra-ui.js
CHANGED
|
@@ -182,7 +182,7 @@ var w = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
182
182
|
d: "M8 18h.01",
|
|
183
183
|
key: "lrp35t"
|
|
184
184
|
}]
|
|
185
|
-
]),
|
|
185
|
+
]), ee = N("calendar-days", [
|
|
186
186
|
["path", {
|
|
187
187
|
d: "M8 2v3",
|
|
188
188
|
key: "1ioesn"
|
|
@@ -227,28 +227,28 @@ var w = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
227
227
|
d: "M16 17h.01",
|
|
228
228
|
key: "ql8jdd"
|
|
229
229
|
}]
|
|
230
|
-
]),
|
|
230
|
+
]), F = N("check", [["path", {
|
|
231
231
|
d: "M20 6 9 17l-5-5",
|
|
232
232
|
key: "1gmf2c"
|
|
233
|
-
}]]),
|
|
233
|
+
}]]), te = N("chevron-down", [["path", {
|
|
234
234
|
d: "m6 9 6 6 6-6",
|
|
235
235
|
key: "qrunsl"
|
|
236
|
-
}]]),
|
|
236
|
+
}]]), I = N("chevron-left", [["path", {
|
|
237
237
|
d: "m15 18-6-6 6-6",
|
|
238
238
|
key: "1wnfg3"
|
|
239
|
-
}]]),
|
|
239
|
+
}]]), L = N("chevron-right", [["path", {
|
|
240
240
|
d: "m9 18 6-6-6-6",
|
|
241
241
|
key: "mthhwq"
|
|
242
|
-
}]]),
|
|
242
|
+
}]]), R = N("chevron-up", [["path", {
|
|
243
243
|
d: "m18 15-6-6-6 6",
|
|
244
244
|
key: "153udz"
|
|
245
|
-
}]]),
|
|
245
|
+
}]]), ne = N("chevrons-up-down", [["path", {
|
|
246
246
|
d: "m7 15 5 5 5-5",
|
|
247
247
|
key: "1hf1tw"
|
|
248
248
|
}], ["path", {
|
|
249
249
|
d: "m7 9 5-5 5 5",
|
|
250
250
|
key: "sgt6xg"
|
|
251
|
-
}]]),
|
|
251
|
+
}]]), re = N("delete", [
|
|
252
252
|
["path", {
|
|
253
253
|
d: "M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",
|
|
254
254
|
key: "1yo7s0"
|
|
@@ -261,7 +261,7 @@ var w = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
261
261
|
d: "m18 9-6 6",
|
|
262
262
|
key: "1fp51s"
|
|
263
263
|
}]
|
|
264
|
-
]),
|
|
264
|
+
]), ie = N("equal", [["line", {
|
|
265
265
|
x1: "5",
|
|
266
266
|
x2: "19",
|
|
267
267
|
y1: "9",
|
|
@@ -273,7 +273,7 @@ var w = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
273
273
|
y1: "15",
|
|
274
274
|
y2: "15",
|
|
275
275
|
key: "g8yjpy"
|
|
276
|
-
}]]),
|
|
276
|
+
}]]), z = {
|
|
277
277
|
field: "_field_11hml_1",
|
|
278
278
|
label: "_label_11hml_11",
|
|
279
279
|
trigger: "_trigger_11hml_18",
|
|
@@ -291,22 +291,22 @@ var w = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
291
291
|
confirmKey: "_confirmKey_11hml_178",
|
|
292
292
|
submitButton: "_submitButton_11hml_188",
|
|
293
293
|
wideKey: "_wideKey_11hml_221"
|
|
294
|
-
},
|
|
294
|
+
}, ae = {
|
|
295
295
|
"+": "+",
|
|
296
296
|
"-": "−",
|
|
297
297
|
"*": "×",
|
|
298
298
|
"/": "÷"
|
|
299
299
|
};
|
|
300
|
-
function
|
|
300
|
+
function oe(e, t) {
|
|
301
301
|
let n = String(e);
|
|
302
302
|
return t === "," ? n.replace(".", ",") : n;
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function se(e, t) {
|
|
305
305
|
if (!e) return null;
|
|
306
306
|
let n = t === "," ? e.replace(",", ".") : e, r = Number(n);
|
|
307
307
|
return Number.isFinite(r) ? r : null;
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function ce(e, t, n) {
|
|
310
310
|
switch (n) {
|
|
311
311
|
case "+": return e + t;
|
|
312
312
|
case "-": return e - t;
|
|
@@ -314,8 +314,8 @@ function oe(e, t, n) {
|
|
|
314
314
|
case "/": return t === 0 ? null : e / t;
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
|
-
function
|
|
318
|
-
let [d, m] = u(() => e === void 0 ? "" :
|
|
317
|
+
function le({ initialValue: e, decimalSeparator: t = ",", label: n, placeholder: r = "Inserisci un valore", disabled: i = !1, maxFractionDigits: a = 2, onValueChange: s, onConfirm: l }) {
|
|
318
|
+
let [d, m] = u(() => e === void 0 ? "" : oe(e, t)), [h, g] = u(null), [_, v] = u(null), [y, b] = u(!1), [x, S] = u(!0), [C, w] = u(!1), T = c(() => se(d, t), [t, d]);
|
|
319
319
|
o(() => {
|
|
320
320
|
s?.(C ? null : T);
|
|
321
321
|
}, [
|
|
@@ -448,17 +448,17 @@ function se({ initialValue: e, decimalSeparator: t = ",", label: n, placeholder:
|
|
|
448
448
|
v(e ?? null), S(!0);
|
|
449
449
|
return;
|
|
450
450
|
}
|
|
451
|
-
let n =
|
|
451
|
+
let n = ce(h, T, _);
|
|
452
452
|
if (n === null) {
|
|
453
453
|
m("Errore"), g(null), v(null), S(!0), w(!0);
|
|
454
454
|
return;
|
|
455
455
|
}
|
|
456
|
-
let r =
|
|
456
|
+
let r = oe(n, t);
|
|
457
457
|
m(r), g(e ? n : null), v(e ?? null), S(!0);
|
|
458
458
|
}
|
|
459
459
|
function j() {
|
|
460
460
|
A();
|
|
461
|
-
let e = h !== null && _ !== null ?
|
|
461
|
+
let e = h !== null && _ !== null ? ce(h, T ?? 0, _) : T;
|
|
462
462
|
e != null && (l?.(e), b(!1));
|
|
463
463
|
}
|
|
464
464
|
function M(e) {
|
|
@@ -482,56 +482,56 @@ function se({ initialValue: e, decimalSeparator: t = ",", label: n, placeholder:
|
|
|
482
482
|
A(e.value);
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
let N = _ ? `${h ?? ""} ${
|
|
485
|
+
let N = _ ? `${h ?? ""} ${ae[_]}` : null;
|
|
486
486
|
return /* @__PURE__ */ p("div", {
|
|
487
|
-
className:
|
|
487
|
+
className: z.field,
|
|
488
488
|
children: [
|
|
489
489
|
n ? /* @__PURE__ */ f("span", {
|
|
490
|
-
className:
|
|
490
|
+
className: z.label,
|
|
491
491
|
children: n
|
|
492
492
|
}) : null,
|
|
493
493
|
/* @__PURE__ */ p("button", {
|
|
494
494
|
type: "button",
|
|
495
|
-
className:
|
|
495
|
+
className: z.trigger,
|
|
496
496
|
disabled: i,
|
|
497
497
|
"aria-label": y ? "Chiudi calcolatrice" : "Apri calcolatrice",
|
|
498
498
|
"aria-expanded": y,
|
|
499
499
|
onClick: () => b((e) => !e),
|
|
500
500
|
children: [/* @__PURE__ */ f(P, {
|
|
501
|
-
className:
|
|
501
|
+
className: z.triggerIcon,
|
|
502
502
|
size: 20,
|
|
503
503
|
"aria-hidden": "true"
|
|
504
504
|
}), /* @__PURE__ */ f("span", {
|
|
505
|
-
className: d ?
|
|
505
|
+
className: d ? z.triggerValue : z.placeholder,
|
|
506
506
|
children: d || r
|
|
507
507
|
})]
|
|
508
508
|
}),
|
|
509
509
|
y ? /* @__PURE__ */ p("section", {
|
|
510
|
-
className:
|
|
510
|
+
className: z.calculator,
|
|
511
511
|
"aria-label": "Calcolatrice",
|
|
512
512
|
children: [
|
|
513
513
|
/* @__PURE__ */ p("div", {
|
|
514
|
-
className:
|
|
514
|
+
className: z.display,
|
|
515
515
|
"aria-live": "polite",
|
|
516
516
|
"aria-atomic": "true",
|
|
517
517
|
children: [/* @__PURE__ */ f("span", {
|
|
518
|
-
className:
|
|
518
|
+
className: z.expression,
|
|
519
519
|
children: N ?? "\xA0"
|
|
520
520
|
}), /* @__PURE__ */ f("output", {
|
|
521
|
-
className: `${
|
|
521
|
+
className: `${z.value} numeric`,
|
|
522
522
|
"aria-label": `Valore corrente: ${d}`,
|
|
523
523
|
children: d
|
|
524
524
|
})]
|
|
525
525
|
}),
|
|
526
526
|
/* @__PURE__ */ f("div", {
|
|
527
|
-
className:
|
|
527
|
+
className: z.keypad,
|
|
528
528
|
children: E.map((e) => {
|
|
529
529
|
let t = [
|
|
530
|
-
|
|
531
|
-
e.kind === "operator" &&
|
|
532
|
-
e.kind === "action" &&
|
|
533
|
-
e.kind === "confirm" &&
|
|
534
|
-
e.wide &&
|
|
530
|
+
z.key,
|
|
531
|
+
e.kind === "operator" && z.operatorKey,
|
|
532
|
+
e.kind === "action" && z.actionKey,
|
|
533
|
+
e.kind === "confirm" && z.confirmKey,
|
|
534
|
+
e.wide && z.wideKey
|
|
535
535
|
].filter(Boolean).join(" "), n = e.value === "backspace", r = e.value === "equals";
|
|
536
536
|
return /* @__PURE__ */ p("button", {
|
|
537
537
|
type: "button",
|
|
@@ -540,12 +540,12 @@ function se({ initialValue: e, decimalSeparator: t = ",", label: n, placeholder:
|
|
|
540
540
|
"aria-label": e.ariaLabel ?? e.label,
|
|
541
541
|
onClick: () => M(e),
|
|
542
542
|
children: [
|
|
543
|
-
n ? /* @__PURE__ */ f(
|
|
543
|
+
n ? /* @__PURE__ */ f(re, {
|
|
544
544
|
size: 18,
|
|
545
545
|
strokeWidth: 1.9,
|
|
546
546
|
"aria-hidden": "true"
|
|
547
547
|
}) : null,
|
|
548
|
-
r ? /* @__PURE__ */ f(
|
|
548
|
+
r ? /* @__PURE__ */ f(ie, {
|
|
549
549
|
size: 18,
|
|
550
550
|
strokeWidth: 2,
|
|
551
551
|
"aria-hidden": "true"
|
|
@@ -557,11 +557,11 @@ function se({ initialValue: e, decimalSeparator: t = ",", label: n, placeholder:
|
|
|
557
557
|
}),
|
|
558
558
|
/* @__PURE__ */ f("button", {
|
|
559
559
|
type: "button",
|
|
560
|
-
className:
|
|
560
|
+
className: z.submitButton,
|
|
561
561
|
disabled: i,
|
|
562
562
|
"aria-label": "Confirm value",
|
|
563
563
|
onClick: j,
|
|
564
|
-
children: /* @__PURE__ */ f(
|
|
564
|
+
children: /* @__PURE__ */ f(F, {
|
|
565
565
|
size: 18,
|
|
566
566
|
strokeWidth: 2,
|
|
567
567
|
"aria-hidden": "true"
|
|
@@ -572,7 +572,7 @@ function se({ initialValue: e, decimalSeparator: t = ",", label: n, placeholder:
|
|
|
572
572
|
]
|
|
573
573
|
});
|
|
574
574
|
}
|
|
575
|
-
var
|
|
575
|
+
var B = {
|
|
576
576
|
field: "_field_t3jjk_1",
|
|
577
577
|
label: "_label_t3jjk_8",
|
|
578
578
|
trigger: "_trigger_t3jjk_15",
|
|
@@ -594,7 +594,7 @@ var H = {
|
|
|
594
594
|
today: "_today_t3jjk_195",
|
|
595
595
|
footer: "_footer_t3jjk_210",
|
|
596
596
|
textButton: "_textButton_t3jjk_218"
|
|
597
|
-
},
|
|
597
|
+
}, ue = [
|
|
598
598
|
"Lun",
|
|
599
599
|
"Mar",
|
|
600
600
|
"Mer",
|
|
@@ -603,47 +603,47 @@ var H = {
|
|
|
603
603
|
"Sab",
|
|
604
604
|
"Dom"
|
|
605
605
|
];
|
|
606
|
-
function
|
|
606
|
+
function V(e) {
|
|
607
607
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
608
608
|
}
|
|
609
|
-
function
|
|
609
|
+
function de(e) {
|
|
610
610
|
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
611
611
|
}
|
|
612
|
-
function
|
|
612
|
+
function fe(e, t) {
|
|
613
613
|
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
614
614
|
}
|
|
615
|
-
function
|
|
615
|
+
function pe(e, t) {
|
|
616
616
|
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
|
|
617
617
|
}
|
|
618
|
-
function
|
|
619
|
-
let r =
|
|
620
|
-
return !!(t && r <
|
|
618
|
+
function me(e, t, n) {
|
|
619
|
+
let r = V(e);
|
|
620
|
+
return !!(t && r < V(t) || n && r > V(n));
|
|
621
621
|
}
|
|
622
|
-
function
|
|
622
|
+
function he(e) {
|
|
623
623
|
let t = e.getFullYear(), n = e.getMonth(), r = new Date(t, n, 1), i = new Date(t, n + 1, 0), a = (r.getDay() + 6) % 7, o = Math.ceil((a + i.getDate()) / 7) * 7, s = new Date(t, n, 1 - a);
|
|
624
624
|
return Array.from({ length: o }, (e, t) => new Date(s.getFullYear(), s.getMonth(), s.getDate() + t));
|
|
625
625
|
}
|
|
626
|
-
function
|
|
626
|
+
function ge(e, t) {
|
|
627
627
|
let n = new Intl.DateTimeFormat(t, {
|
|
628
628
|
month: "long",
|
|
629
629
|
year: "numeric"
|
|
630
630
|
}).format(e);
|
|
631
631
|
return n.charAt(0).toUpperCase() + n.slice(1);
|
|
632
632
|
}
|
|
633
|
-
function
|
|
633
|
+
function _e(e, t) {
|
|
634
634
|
return e ? new Intl.DateTimeFormat(t, {
|
|
635
635
|
day: "2-digit",
|
|
636
636
|
month: "short",
|
|
637
637
|
year: "numeric"
|
|
638
638
|
}).format(e) : "";
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function ve(...e) {
|
|
641
641
|
return e.filter(Boolean).join(" ");
|
|
642
642
|
}
|
|
643
|
-
function
|
|
644
|
-
let y = s(), b = _ ?? `date-picker-${y}`, x = `${b}-dialog`, S = `${b}-error`, C = l(null), w = l(null), [T, E] = u(!1), [D, O] = u(() =>
|
|
643
|
+
function ye({ value: e, onChange: t, label: n, placeholder: r = "Seleziona una data", locale: i = "it-IT", disabled: a = !1, minDate: d, maxDate: m, clearable: h = !1, name: g, id: _, error: v }) {
|
|
644
|
+
let y = s(), b = _ ?? `date-picker-${y}`, x = `${b}-dialog`, S = `${b}-error`, C = l(null), w = l(null), [T, E] = u(!1), [D, O] = u(() => V(e ?? /* @__PURE__ */ new Date())), k = c(() => he(D), [D]), A = V(/* @__PURE__ */ new Date());
|
|
645
645
|
o(() => {
|
|
646
|
-
e && O(
|
|
646
|
+
e && O(V(e));
|
|
647
647
|
}, [e]), o(() => {
|
|
648
648
|
function e(e) {
|
|
649
649
|
C.current && !C.current.contains(e.target) && E(!1);
|
|
@@ -656,10 +656,10 @@ function _e({ value: e, onChange: t, label: n, placeholder: r = "Seleziona una d
|
|
|
656
656
|
};
|
|
657
657
|
}, []);
|
|
658
658
|
function j() {
|
|
659
|
-
a || (O(
|
|
659
|
+
a || (O(V(e ?? /* @__PURE__ */ new Date())), E(!0));
|
|
660
660
|
}
|
|
661
661
|
function M(e) {
|
|
662
|
-
|
|
662
|
+
me(e, d, m) || (t(V(e)), E(!1), w.current?.focus());
|
|
663
663
|
}
|
|
664
664
|
function N(e) {
|
|
665
665
|
O((t) => new Date(t.getFullYear(), t.getMonth() + e, 1));
|
|
@@ -674,20 +674,20 @@ function _e({ value: e, onChange: t, label: n, placeholder: r = "Seleziona una d
|
|
|
674
674
|
else if (e.key === "End") n.setDate(t.getDate() + (6 - (t.getDay() + 6) % 7));
|
|
675
675
|
else return;
|
|
676
676
|
e.preventDefault();
|
|
677
|
-
let r = `${b}-${
|
|
677
|
+
let r = `${b}-${de(n)}`, i = document.getElementById(r);
|
|
678
678
|
if (i) {
|
|
679
679
|
i.focus();
|
|
680
680
|
return;
|
|
681
681
|
}
|
|
682
682
|
O(new Date(n.getFullYear(), n.getMonth(), 1));
|
|
683
683
|
}
|
|
684
|
-
let
|
|
684
|
+
let F = _e(e, i);
|
|
685
685
|
return /* @__PURE__ */ p("div", {
|
|
686
686
|
ref: C,
|
|
687
|
-
className:
|
|
687
|
+
className: B.field,
|
|
688
688
|
children: [
|
|
689
689
|
n ? /* @__PURE__ */ f("label", {
|
|
690
|
-
className:
|
|
690
|
+
className: B.label,
|
|
691
691
|
htmlFor: b,
|
|
692
692
|
children: n
|
|
693
693
|
}) : null,
|
|
@@ -695,61 +695,61 @@ function _e({ value: e, onChange: t, label: n, placeholder: r = "Seleziona una d
|
|
|
695
695
|
id: b,
|
|
696
696
|
type: "hidden",
|
|
697
697
|
name: g,
|
|
698
|
-
value: e ?
|
|
698
|
+
value: e ? de(e) : ""
|
|
699
699
|
}),
|
|
700
700
|
/* @__PURE__ */ p("button", {
|
|
701
701
|
ref: w,
|
|
702
702
|
type: "button",
|
|
703
|
-
className:
|
|
703
|
+
className: ve(B.trigger, v && B.hasError, a && B.isDisabled),
|
|
704
704
|
disabled: a,
|
|
705
705
|
"aria-haspopup": "dialog",
|
|
706
706
|
"aria-expanded": T,
|
|
707
707
|
"aria-controls": T ? x : void 0,
|
|
708
708
|
onClick: () => T ? E(!1) : j(),
|
|
709
|
-
children: [/* @__PURE__ */ f(
|
|
710
|
-
className:
|
|
709
|
+
children: [/* @__PURE__ */ f(ee, {
|
|
710
|
+
className: B.triggerIcon,
|
|
711
711
|
size: 18,
|
|
712
712
|
"aria-hidden": "true"
|
|
713
713
|
}), /* @__PURE__ */ f("span", {
|
|
714
|
-
className:
|
|
715
|
-
children:
|
|
714
|
+
className: ve(B.triggerValue, !e && B.placeholder),
|
|
715
|
+
children: F || r
|
|
716
716
|
})]
|
|
717
717
|
}),
|
|
718
718
|
v ? /* @__PURE__ */ f("p", {
|
|
719
719
|
id: S,
|
|
720
|
-
className:
|
|
720
|
+
className: B.error,
|
|
721
721
|
role: "alert",
|
|
722
722
|
children: v
|
|
723
723
|
}) : null,
|
|
724
724
|
T ? /* @__PURE__ */ p("div", {
|
|
725
725
|
id: x,
|
|
726
|
-
className:
|
|
726
|
+
className: B.popover,
|
|
727
727
|
role: "dialog",
|
|
728
728
|
"aria-label": "Seleziona una data",
|
|
729
729
|
children: [
|
|
730
730
|
/* @__PURE__ */ p("header", {
|
|
731
|
-
className:
|
|
731
|
+
className: B.calendarHeader,
|
|
732
732
|
children: [
|
|
733
733
|
/* @__PURE__ */ f("button", {
|
|
734
734
|
type: "button",
|
|
735
|
-
className:
|
|
735
|
+
className: B.navigationButton,
|
|
736
736
|
"aria-label": "Mese precedente",
|
|
737
737
|
onClick: () => N(-1),
|
|
738
|
-
children: /* @__PURE__ */ f(
|
|
738
|
+
children: /* @__PURE__ */ f(I, {
|
|
739
739
|
size: 18,
|
|
740
740
|
"aria-hidden": "true"
|
|
741
741
|
})
|
|
742
742
|
}),
|
|
743
743
|
/* @__PURE__ */ f("span", {
|
|
744
|
-
className:
|
|
745
|
-
children:
|
|
744
|
+
className: B.monthLabel,
|
|
745
|
+
children: ge(D, i)
|
|
746
746
|
}),
|
|
747
747
|
/* @__PURE__ */ f("button", {
|
|
748
748
|
type: "button",
|
|
749
|
-
className:
|
|
749
|
+
className: B.navigationButton,
|
|
750
750
|
"aria-label": "Mese successivo",
|
|
751
751
|
onClick: () => N(1),
|
|
752
|
-
children: /* @__PURE__ */ f(
|
|
752
|
+
children: /* @__PURE__ */ f(L, {
|
|
753
753
|
size: 18,
|
|
754
754
|
"aria-hidden": "true"
|
|
755
755
|
})
|
|
@@ -757,20 +757,20 @@ function _e({ value: e, onChange: t, label: n, placeholder: r = "Seleziona una d
|
|
|
757
757
|
]
|
|
758
758
|
}),
|
|
759
759
|
/* @__PURE__ */ p("div", {
|
|
760
|
-
className:
|
|
760
|
+
className: B.calendarGrid,
|
|
761
761
|
role: "grid",
|
|
762
|
-
"aria-label":
|
|
763
|
-
children: [
|
|
764
|
-
className:
|
|
762
|
+
"aria-label": ge(D, i),
|
|
763
|
+
children: [ue.map((e) => /* @__PURE__ */ f("span", {
|
|
764
|
+
className: B.weekDay,
|
|
765
765
|
role: "columnheader",
|
|
766
766
|
children: e
|
|
767
767
|
}, e)), k.map((t) => {
|
|
768
|
-
let n =
|
|
768
|
+
let n = pe(t, D), r = e ? fe(t, e) : !1, a = fe(t, A), o = me(t, d, m), s = `${b}-${de(t)}`;
|
|
769
769
|
return /* @__PURE__ */ f("button", {
|
|
770
770
|
id: s,
|
|
771
771
|
type: "button",
|
|
772
772
|
role: "gridcell",
|
|
773
|
-
className:
|
|
773
|
+
className: ve(B.day, !n && B.outsideMonth, r && B.selectedDay, a && B.today),
|
|
774
774
|
disabled: o,
|
|
775
775
|
"aria-label": new Intl.DateTimeFormat(i, {
|
|
776
776
|
weekday: "long",
|
|
@@ -787,17 +787,17 @@ function _e({ value: e, onChange: t, label: n, placeholder: r = "Seleziona una d
|
|
|
787
787
|
})]
|
|
788
788
|
}),
|
|
789
789
|
/* @__PURE__ */ p("footer", {
|
|
790
|
-
className:
|
|
790
|
+
className: B.footer,
|
|
791
791
|
children: [/* @__PURE__ */ f("button", {
|
|
792
792
|
type: "button",
|
|
793
|
-
className:
|
|
793
|
+
className: B.textButton,
|
|
794
794
|
onClick: () => {
|
|
795
795
|
O(A), M(A);
|
|
796
796
|
},
|
|
797
797
|
children: "Oggi"
|
|
798
798
|
}), h && e ? /* @__PURE__ */ f("button", {
|
|
799
799
|
type: "button",
|
|
800
|
-
className:
|
|
800
|
+
className: B.textButton,
|
|
801
801
|
onClick: () => {
|
|
802
802
|
t(null), E(!1), w.current?.focus();
|
|
803
803
|
},
|
|
@@ -809,7 +809,7 @@ function _e({ value: e, onChange: t, label: n, placeholder: r = "Seleziona una d
|
|
|
809
809
|
]
|
|
810
810
|
});
|
|
811
811
|
}
|
|
812
|
-
var
|
|
812
|
+
var H = {
|
|
813
813
|
button: "_button_2kydv_1",
|
|
814
814
|
sizeSm: "_sizeSm_2kydv_27",
|
|
815
815
|
sizeMd: "_sizeMd_2kydv_32",
|
|
@@ -823,20 +823,20 @@ var W = {
|
|
|
823
823
|
spinner: "_spinner_2kydv_94",
|
|
824
824
|
spin: "_spin_2kydv_94",
|
|
825
825
|
loading: "_loading_2kydv_103"
|
|
826
|
-
},
|
|
827
|
-
primary:
|
|
828
|
-
secondary:
|
|
829
|
-
ghost:
|
|
830
|
-
danger:
|
|
831
|
-
},
|
|
832
|
-
sm:
|
|
833
|
-
md:
|
|
834
|
-
lg:
|
|
826
|
+
}, be = {
|
|
827
|
+
primary: H.variantPrimary,
|
|
828
|
+
secondary: H.variantSecondary,
|
|
829
|
+
ghost: H.variantGhost,
|
|
830
|
+
danger: H.variantDanger
|
|
831
|
+
}, xe = {
|
|
832
|
+
sm: H.sizeSm,
|
|
833
|
+
md: H.sizeMd,
|
|
834
|
+
lg: H.sizeLg
|
|
835
835
|
};
|
|
836
|
-
function
|
|
836
|
+
function Se(...e) {
|
|
837
837
|
return e.filter(Boolean).join(" ");
|
|
838
838
|
}
|
|
839
|
-
var
|
|
839
|
+
var Ce = r(function({ icon: e, label: t, className: n, variant: r = "secondary", size: i = "md", isLoading: a = !1, borderless: o = !1, backgroundColor: s, disabled: c, type: l = "button", style: u, ...d }, p) {
|
|
840
840
|
let m = c || a, h = s ? {
|
|
841
841
|
...u,
|
|
842
842
|
backgroundColor: s
|
|
@@ -844,24 +844,24 @@ var xe = r(function({ icon: e, label: t, className: n, variant: r = "secondary",
|
|
|
844
844
|
return /* @__PURE__ */ f("button", {
|
|
845
845
|
ref: p,
|
|
846
846
|
type: l,
|
|
847
|
-
className:
|
|
847
|
+
className: Se(H.button, be[r], xe[i], a && H.loading, o && H.borderless, n),
|
|
848
848
|
style: h,
|
|
849
849
|
disabled: m,
|
|
850
850
|
"aria-label": t,
|
|
851
851
|
"aria-busy": a || void 0,
|
|
852
852
|
...d,
|
|
853
853
|
children: a ? /* @__PURE__ */ f("span", {
|
|
854
|
-
className:
|
|
854
|
+
className: H.spinner,
|
|
855
855
|
"aria-hidden": "true"
|
|
856
856
|
}) : /* @__PURE__ */ f("span", {
|
|
857
|
-
className:
|
|
857
|
+
className: H.icon,
|
|
858
858
|
"aria-hidden": "true",
|
|
859
859
|
children: e
|
|
860
860
|
})
|
|
861
861
|
});
|
|
862
862
|
});
|
|
863
|
-
|
|
864
|
-
var
|
|
863
|
+
Ce.displayName = "IconButton";
|
|
864
|
+
var U = {
|
|
865
865
|
field: "_field_1pq0j_1",
|
|
866
866
|
label: "_label_1pq0j_7",
|
|
867
867
|
required: "_required_1pq0j_14",
|
|
@@ -875,39 +875,39 @@ var G = {
|
|
|
875
875
|
};
|
|
876
876
|
//#endregion
|
|
877
877
|
//#region src/components/TextField/TextField.tsx
|
|
878
|
-
function
|
|
878
|
+
function we(...e) {
|
|
879
879
|
return e.filter(Boolean).join(" ");
|
|
880
880
|
}
|
|
881
|
-
var
|
|
881
|
+
var Te = r(function({ id: e, label: t, hint: n, error: r, startAdornment: i, endAdornment: a, className: o, containerClassName: c, disabled: l, required: u, "aria-describedby": d, ...m }, h) {
|
|
882
882
|
let g = s(), _ = e ?? `text-field-${g}`, v = `${_}-hint`, y = `${_}-error`, b = [
|
|
883
883
|
d,
|
|
884
884
|
n ? v : null,
|
|
885
885
|
r ? y : null
|
|
886
886
|
].filter(Boolean).join(" ");
|
|
887
887
|
return /* @__PURE__ */ p("div", {
|
|
888
|
-
className:
|
|
888
|
+
className: we(U.field, c),
|
|
889
889
|
children: [
|
|
890
890
|
t ? /* @__PURE__ */ p("label", {
|
|
891
|
-
className:
|
|
891
|
+
className: U.label,
|
|
892
892
|
htmlFor: _,
|
|
893
893
|
children: [t, u ? /* @__PURE__ */ p("span", {
|
|
894
|
-
className:
|
|
894
|
+
className: U.required,
|
|
895
895
|
"aria-hidden": "true",
|
|
896
896
|
children: [" ", "*"]
|
|
897
897
|
}) : null]
|
|
898
898
|
}) : null,
|
|
899
899
|
/* @__PURE__ */ p("div", {
|
|
900
|
-
className:
|
|
900
|
+
className: we(U.control, r && U.hasError, l && U.isDisabled),
|
|
901
901
|
children: [
|
|
902
902
|
i ? /* @__PURE__ */ f("span", {
|
|
903
|
-
className:
|
|
903
|
+
className: U.adornment,
|
|
904
904
|
"aria-hidden": "true",
|
|
905
905
|
children: i
|
|
906
906
|
}) : null,
|
|
907
907
|
/* @__PURE__ */ f("input", {
|
|
908
908
|
ref: h,
|
|
909
909
|
id: _,
|
|
910
|
-
className:
|
|
910
|
+
className: we(U.input, o),
|
|
911
911
|
disabled: l,
|
|
912
912
|
required: u,
|
|
913
913
|
"aria-invalid": r ? !0 : void 0,
|
|
@@ -915,7 +915,7 @@ var Ce = r(function({ id: e, label: t, hint: n, error: r, startAdornment: i, end
|
|
|
915
915
|
...m
|
|
916
916
|
}),
|
|
917
917
|
a ? /* @__PURE__ */ f("span", {
|
|
918
|
-
className:
|
|
918
|
+
className: U.adornment,
|
|
919
919
|
"aria-hidden": "true",
|
|
920
920
|
children: a
|
|
921
921
|
}) : null
|
|
@@ -923,20 +923,20 @@ var Ce = r(function({ id: e, label: t, hint: n, error: r, startAdornment: i, end
|
|
|
923
923
|
}),
|
|
924
924
|
r ? /* @__PURE__ */ f("p", {
|
|
925
925
|
id: y,
|
|
926
|
-
className:
|
|
926
|
+
className: U.error,
|
|
927
927
|
role: "alert",
|
|
928
928
|
children: r
|
|
929
929
|
}) : null,
|
|
930
930
|
!r && n ? /* @__PURE__ */ f("p", {
|
|
931
931
|
id: v,
|
|
932
|
-
className:
|
|
932
|
+
className: U.hint,
|
|
933
933
|
children: n
|
|
934
934
|
}) : null
|
|
935
935
|
]
|
|
936
936
|
});
|
|
937
937
|
});
|
|
938
|
-
|
|
939
|
-
var
|
|
938
|
+
Te.displayName = "TextField";
|
|
939
|
+
var W = {
|
|
940
940
|
field: "_field_3nnjq_1",
|
|
941
941
|
label: "_label_3nnjq_7",
|
|
942
942
|
required: "_required_3nnjq_14",
|
|
@@ -957,70 +957,70 @@ var K = {
|
|
|
957
957
|
};
|
|
958
958
|
//#endregion
|
|
959
959
|
//#region src/components/Dropdown/Dropdown.tsx
|
|
960
|
-
function
|
|
960
|
+
function G(...e) {
|
|
961
961
|
return e.filter(Boolean).join(" ");
|
|
962
962
|
}
|
|
963
|
-
var
|
|
963
|
+
var Ee = r(function({ id: e, options: t, label: n, hint: r, error: i, placeholder: a, className: c, containerClassName: d, disabled: m, required: h, value: g, defaultValue: _, onChange: v, onValueChange: y, "aria-describedby": b, ...x }, S) {
|
|
964
964
|
let C = s(), w = e ?? `dropdown-${C}`, T = `${w}-hint`, E = `${w}-error`, D = `${w}-label`, O = `${w}-listbox`, k = [
|
|
965
965
|
b,
|
|
966
966
|
r ? T : null,
|
|
967
967
|
i ? E : null
|
|
968
|
-
].filter(Boolean).join(" "), A = typeof g == "string" ? g : void 0, [j, M] = u(typeof _ == "string" ? _ : ""), [N, P] = u(!1), [
|
|
968
|
+
].filter(Boolean).join(" "), A = typeof g == "string" ? g : void 0, [j, M] = u(typeof _ == "string" ? _ : ""), [N, P] = u(!1), [ee, F] = u(0), te = l(null), I = A ?? j, L = t.find((e) => e.value === I), R = t.reduce((e, t, n) => (t.disabled || e.push(n), e), []);
|
|
969
969
|
o(() => {
|
|
970
970
|
function e(e) {
|
|
971
|
-
|
|
971
|
+
te.current?.contains(e.target) || P(!1);
|
|
972
972
|
}
|
|
973
973
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
974
974
|
}, []);
|
|
975
|
-
function
|
|
975
|
+
function ne(e) {
|
|
976
976
|
v?.(e), y?.(e.target.value);
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function re(e) {
|
|
979
979
|
A === void 0 && M(e), y?.(e), P(!1);
|
|
980
980
|
}
|
|
981
|
-
function
|
|
981
|
+
function ie(e) {
|
|
982
982
|
if (!m) {
|
|
983
983
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
984
984
|
e.preventDefault(), P(!0);
|
|
985
|
-
let t = (
|
|
986
|
-
|
|
985
|
+
let t = (R.indexOf(ee) + (e.key === "ArrowDown" ? 1 : -1) + R.length) % R.length;
|
|
986
|
+
F(R[t] ?? 0);
|
|
987
987
|
}
|
|
988
988
|
if (e.key === "Enter" || e.key === " ") {
|
|
989
989
|
if (e.preventDefault(), N) {
|
|
990
|
-
let e = t[
|
|
991
|
-
e && !e.disabled &&
|
|
990
|
+
let e = t[ee];
|
|
991
|
+
e && !e.disabled && re(e.value);
|
|
992
992
|
} else P(!0);
|
|
993
993
|
}
|
|
994
994
|
e.key === "Escape" && P(!1);
|
|
995
995
|
}
|
|
996
996
|
}
|
|
997
997
|
return /* @__PURE__ */ p("div", {
|
|
998
|
-
className:
|
|
998
|
+
className: G(W.field, d),
|
|
999
999
|
children: [
|
|
1000
1000
|
n ? /* @__PURE__ */ p("label", {
|
|
1001
1001
|
id: D,
|
|
1002
|
-
className:
|
|
1002
|
+
className: W.label,
|
|
1003
1003
|
htmlFor: w,
|
|
1004
1004
|
children: [n, h ? /* @__PURE__ */ p("span", {
|
|
1005
|
-
className:
|
|
1005
|
+
className: W.required,
|
|
1006
1006
|
"aria-hidden": "true",
|
|
1007
1007
|
children: [" ", "*"]
|
|
1008
1008
|
}) : null]
|
|
1009
1009
|
}) : null,
|
|
1010
1010
|
/* @__PURE__ */ p("div", {
|
|
1011
|
-
ref:
|
|
1012
|
-
className:
|
|
1011
|
+
ref: te,
|
|
1012
|
+
className: G(W.control, i && W.hasError, m && W.isDisabled, N && W.isOpen),
|
|
1013
1013
|
children: [
|
|
1014
1014
|
/* @__PURE__ */ p("select", {
|
|
1015
1015
|
ref: S,
|
|
1016
1016
|
id: w,
|
|
1017
|
-
className:
|
|
1017
|
+
className: W.nativeSelect,
|
|
1018
1018
|
disabled: m,
|
|
1019
1019
|
required: h,
|
|
1020
|
-
value:
|
|
1020
|
+
value: I,
|
|
1021
1021
|
"aria-invalid": i ? !0 : void 0,
|
|
1022
1022
|
"aria-describedby": k || void 0,
|
|
1023
|
-
onChange:
|
|
1023
|
+
onChange: ne,
|
|
1024
1024
|
...x,
|
|
1025
1025
|
children: [a ? /* @__PURE__ */ f("option", {
|
|
1026
1026
|
value: "",
|
|
@@ -1034,7 +1034,7 @@ var we = r(function({ id: e, options: t, label: n, hint: r, error: i, placeholde
|
|
|
1034
1034
|
}),
|
|
1035
1035
|
/* @__PURE__ */ p("button", {
|
|
1036
1036
|
type: "button",
|
|
1037
|
-
className:
|
|
1037
|
+
className: G(W.trigger, c),
|
|
1038
1038
|
disabled: m,
|
|
1039
1039
|
"aria-haspopup": "listbox",
|
|
1040
1040
|
"aria-expanded": N,
|
|
@@ -1043,34 +1043,34 @@ var we = r(function({ id: e, options: t, label: n, hint: r, error: i, placeholde
|
|
|
1043
1043
|
"aria-describedby": k || void 0,
|
|
1044
1044
|
"aria-invalid": i ? !0 : void 0,
|
|
1045
1045
|
onClick: () => P((e) => !e),
|
|
1046
|
-
onKeyDown:
|
|
1046
|
+
onKeyDown: ie,
|
|
1047
1047
|
children: [/* @__PURE__ */ f("span", {
|
|
1048
|
-
className:
|
|
1049
|
-
children:
|
|
1048
|
+
className: L ? void 0 : W.placeholder,
|
|
1049
|
+
children: L?.label ?? a
|
|
1050
1050
|
}), /* @__PURE__ */ f("span", {
|
|
1051
|
-
className:
|
|
1051
|
+
className: W.indicator,
|
|
1052
1052
|
"aria-hidden": "true"
|
|
1053
1053
|
})]
|
|
1054
1054
|
}),
|
|
1055
1055
|
N ? /* @__PURE__ */ p("div", {
|
|
1056
1056
|
id: O,
|
|
1057
|
-
className:
|
|
1057
|
+
className: W.menu,
|
|
1058
1058
|
role: "listbox",
|
|
1059
1059
|
children: [a ? /* @__PURE__ */ f("button", {
|
|
1060
1060
|
type: "button",
|
|
1061
|
-
className:
|
|
1061
|
+
className: G(W.option, !I && W.selectedOption),
|
|
1062
1062
|
role: "option",
|
|
1063
|
-
"aria-selected": !
|
|
1064
|
-
onClick: () =>
|
|
1063
|
+
"aria-selected": !I,
|
|
1064
|
+
onClick: () => re(""),
|
|
1065
1065
|
children: a
|
|
1066
1066
|
}) : null, t.map((e, t) => /* @__PURE__ */ f("button", {
|
|
1067
1067
|
type: "button",
|
|
1068
|
-
className:
|
|
1068
|
+
className: G(W.option, e.value === I && W.selectedOption, t === ee && W.activeOption),
|
|
1069
1069
|
role: "option",
|
|
1070
|
-
"aria-selected": e.value ===
|
|
1070
|
+
"aria-selected": e.value === I,
|
|
1071
1071
|
disabled: e.disabled,
|
|
1072
|
-
onMouseEnter: () =>
|
|
1073
|
-
onClick: () =>
|
|
1072
|
+
onMouseEnter: () => F(t),
|
|
1073
|
+
onClick: () => re(e.value),
|
|
1074
1074
|
children: e.label
|
|
1075
1075
|
}, e.value))]
|
|
1076
1076
|
}) : null
|
|
@@ -1078,20 +1078,20 @@ var we = r(function({ id: e, options: t, label: n, hint: r, error: i, placeholde
|
|
|
1078
1078
|
}),
|
|
1079
1079
|
i ? /* @__PURE__ */ f("p", {
|
|
1080
1080
|
id: E,
|
|
1081
|
-
className:
|
|
1081
|
+
className: W.error,
|
|
1082
1082
|
role: "alert",
|
|
1083
1083
|
children: i
|
|
1084
1084
|
}) : null,
|
|
1085
1085
|
!i && r ? /* @__PURE__ */ f("p", {
|
|
1086
1086
|
id: T,
|
|
1087
|
-
className:
|
|
1087
|
+
className: W.hint,
|
|
1088
1088
|
children: r
|
|
1089
1089
|
}) : null
|
|
1090
1090
|
]
|
|
1091
1091
|
});
|
|
1092
1092
|
});
|
|
1093
|
-
|
|
1094
|
-
var
|
|
1093
|
+
Ee.displayName = "Dropdown";
|
|
1094
|
+
var K = {
|
|
1095
1095
|
group: "_group_1fqa2_1",
|
|
1096
1096
|
option: "_option_1fqa2_8",
|
|
1097
1097
|
selected: "_selected_1fqa2_41",
|
|
@@ -1099,10 +1099,10 @@ var Te = {
|
|
|
1099
1099
|
};
|
|
1100
1100
|
//#endregion
|
|
1101
1101
|
//#region src/components/MultiSelect/MultiSelect.tsx
|
|
1102
|
-
function
|
|
1102
|
+
function De(...e) {
|
|
1103
1103
|
return e.filter(Boolean).join(" ");
|
|
1104
1104
|
}
|
|
1105
|
-
var
|
|
1105
|
+
var Oe = r(function({ options: e, value: t, defaultValue: n = [], multiple: r = !1, disabled: i = !1, className: a, onValueChange: o, "aria-label": s = r ? "Selezione multipla" : "Selezione singola", ...c }, l) {
|
|
1106
1106
|
let [d, m] = u(n), h = t ?? d, g = r ? h : h.slice(0, 1);
|
|
1107
1107
|
function _(e) {
|
|
1108
1108
|
let n = g.includes(e), i = r ? n ? g.filter((t) => t !== e) : [...g, e] : n ? [] : [e];
|
|
@@ -1112,7 +1112,7 @@ var De = r(function({ options: e, value: t, defaultValue: n = [], multiple: r =
|
|
|
1112
1112
|
ref: l,
|
|
1113
1113
|
role: "group",
|
|
1114
1114
|
"aria-label": s,
|
|
1115
|
-
className:
|
|
1115
|
+
className: De(K.group, a),
|
|
1116
1116
|
...c,
|
|
1117
1117
|
children: e.map((e) => {
|
|
1118
1118
|
let t = g.includes(e.value), n = i || e.disabled, r = e.selectedColor ? {
|
|
@@ -1121,21 +1121,21 @@ var De = r(function({ options: e, value: t, defaultValue: n = [], multiple: r =
|
|
|
1121
1121
|
} : void 0;
|
|
1122
1122
|
return /* @__PURE__ */ p("button", {
|
|
1123
1123
|
type: "button",
|
|
1124
|
-
className:
|
|
1124
|
+
className: De(K.option, t && K.selected),
|
|
1125
1125
|
disabled: n,
|
|
1126
1126
|
"aria-pressed": t,
|
|
1127
1127
|
style: r,
|
|
1128
1128
|
onClick: () => _(e.value),
|
|
1129
1129
|
children: [e.count === void 0 ? null : /* @__PURE__ */ f("span", {
|
|
1130
|
-
className:
|
|
1130
|
+
className: K.count,
|
|
1131
1131
|
children: e.count
|
|
1132
1132
|
}), /* @__PURE__ */ f("span", { children: e.label })]
|
|
1133
1133
|
}, e.value);
|
|
1134
1134
|
})
|
|
1135
1135
|
});
|
|
1136
1136
|
});
|
|
1137
|
-
|
|
1138
|
-
var
|
|
1137
|
+
Oe.displayName = "MultiSelect";
|
|
1138
|
+
var q = {
|
|
1139
1139
|
carousel: "_carousel_17hln_1",
|
|
1140
1140
|
navigationButton: "_navigationButton_17hln_13",
|
|
1141
1141
|
track: "_track_17hln_51",
|
|
@@ -1145,7 +1145,7 @@ var J = {
|
|
|
1145
1145
|
};
|
|
1146
1146
|
//#endregion
|
|
1147
1147
|
//#region src/components/MonthCarousel/MonthCarousel.tsx
|
|
1148
|
-
function
|
|
1148
|
+
function J(e) {
|
|
1149
1149
|
return e.year * 12 + e.month - 1;
|
|
1150
1150
|
}
|
|
1151
1151
|
function ke(e, t) {
|
|
@@ -1164,7 +1164,7 @@ function Ae(e, t) {
|
|
|
1164
1164
|
}
|
|
1165
1165
|
function je(e, t, n, r) {
|
|
1166
1166
|
let i = ke(t, e);
|
|
1167
|
-
return e === -1 && n ?
|
|
1167
|
+
return e === -1 && n ? J(i) < J(n) : e === 1 && r ? J(i) > J(r) : !1;
|
|
1168
1168
|
}
|
|
1169
1169
|
function Me({ value: e, onChange: t, locale: n = "it-IT", minMonth: r, maxMonth: a, disabled: o = !1, ariaLabel: s = "Seleziona il mese" }) {
|
|
1170
1170
|
let [d, m] = u(0), h = l(null), g = c(() => Ae(e, n), [e, n]), _ = o || je(-1, e, r, a), v = o || je(1, e, r, a), y = i((n) => {
|
|
@@ -1179,44 +1179,44 @@ function Me({ value: e, onChange: t, locale: n = "it-IT", minMonth: r, maxMonth:
|
|
|
1179
1179
|
e.key === "ArrowLeft" ? (e.preventDefault(), y(-1)) : e.key === "ArrowRight" && (e.preventDefault(), y(1));
|
|
1180
1180
|
}
|
|
1181
1181
|
return /* @__PURE__ */ p("div", {
|
|
1182
|
-
className:
|
|
1182
|
+
className: q.carousel,
|
|
1183
1183
|
role: "group",
|
|
1184
1184
|
"aria-label": s,
|
|
1185
1185
|
onKeyDown: b,
|
|
1186
1186
|
children: [
|
|
1187
1187
|
/* @__PURE__ */ f("button", {
|
|
1188
1188
|
type: "button",
|
|
1189
|
-
className:
|
|
1189
|
+
className: q.navigationButton,
|
|
1190
1190
|
"aria-label": "Mese precedente",
|
|
1191
1191
|
disabled: _,
|
|
1192
1192
|
onClick: () => y(-1),
|
|
1193
|
-
children: /* @__PURE__ */ f(
|
|
1193
|
+
children: /* @__PURE__ */ f(I, {
|
|
1194
1194
|
size: 18,
|
|
1195
1195
|
"aria-hidden": "true"
|
|
1196
1196
|
})
|
|
1197
1197
|
}),
|
|
1198
1198
|
/* @__PURE__ */ f("div", {
|
|
1199
|
-
className:
|
|
1199
|
+
className: q.track,
|
|
1200
1200
|
children: /* @__PURE__ */ f("span", {
|
|
1201
|
-
className:
|
|
1201
|
+
className: q.label,
|
|
1202
1202
|
"data-direction": d,
|
|
1203
1203
|
children: g
|
|
1204
1204
|
}, `${e.year}-${e.month}`)
|
|
1205
1205
|
}),
|
|
1206
1206
|
/* @__PURE__ */ f("button", {
|
|
1207
1207
|
type: "button",
|
|
1208
|
-
className:
|
|
1208
|
+
className: q.navigationButton,
|
|
1209
1209
|
"aria-label": "Mese successivo",
|
|
1210
1210
|
disabled: v,
|
|
1211
1211
|
onClick: () => y(1),
|
|
1212
|
-
children: /* @__PURE__ */ f(
|
|
1212
|
+
children: /* @__PURE__ */ f(L, {
|
|
1213
1213
|
size: 18,
|
|
1214
1214
|
"aria-hidden": "true"
|
|
1215
1215
|
})
|
|
1216
1216
|
}),
|
|
1217
1217
|
/* @__PURE__ */ f("span", {
|
|
1218
1218
|
ref: h,
|
|
1219
|
-
className:
|
|
1219
|
+
className: q.srOnly,
|
|
1220
1220
|
"aria-live": "polite",
|
|
1221
1221
|
children: g
|
|
1222
1222
|
})
|
|
@@ -1293,6 +1293,46 @@ var Le = r(function({ label: e, className: t, color: n, size: r = "md", disabled
|
|
|
1293
1293
|
});
|
|
1294
1294
|
});
|
|
1295
1295
|
Le.displayName = "Switch";
|
|
1296
|
+
var Re = {
|
|
1297
|
+
list: "_list_o9mae_1",
|
|
1298
|
+
listItem: "_listItem_o9mae_12",
|
|
1299
|
+
interactive: "_interactive_o9mae_22",
|
|
1300
|
+
cell: "_cell_o9mae_36"
|
|
1301
|
+
};
|
|
1302
|
+
//#endregion
|
|
1303
|
+
//#region src/components/List/List.tsx
|
|
1304
|
+
function ze(...e) {
|
|
1305
|
+
return e.filter(Boolean).join(" ");
|
|
1306
|
+
}
|
|
1307
|
+
function Be({ children: e, ariaLabel: t, className: n, ...r }) {
|
|
1308
|
+
return /* @__PURE__ */ f("ul", {
|
|
1309
|
+
...r,
|
|
1310
|
+
className: ze(Re.list, n),
|
|
1311
|
+
"aria-label": t,
|
|
1312
|
+
children: e
|
|
1313
|
+
});
|
|
1314
|
+
}
|
|
1315
|
+
function Ve({ children: e, className: t, onClick: n, onKeyDown: r, ...i }) {
|
|
1316
|
+
let a = !!n;
|
|
1317
|
+
return /* @__PURE__ */ f("li", {
|
|
1318
|
+
...i,
|
|
1319
|
+
className: ze(Re.listItem, a ? Re.interactive : void 0, t),
|
|
1320
|
+
onClick: n,
|
|
1321
|
+
onKeyDown: (e) => {
|
|
1322
|
+
r?.(e), a && !e.defaultPrevented && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click());
|
|
1323
|
+
},
|
|
1324
|
+
role: a ? "button" : i.role,
|
|
1325
|
+
tabIndex: a ? 0 : i.tabIndex,
|
|
1326
|
+
children: e
|
|
1327
|
+
});
|
|
1328
|
+
}
|
|
1329
|
+
function He({ children: e, className: t, ...n }) {
|
|
1330
|
+
return /* @__PURE__ */ f("div", {
|
|
1331
|
+
...n,
|
|
1332
|
+
className: ze(Re.cell, t),
|
|
1333
|
+
children: e
|
|
1334
|
+
});
|
|
1335
|
+
}
|
|
1296
1336
|
var X = {
|
|
1297
1337
|
wrapper: "_wrapper_1ly5u_1",
|
|
1298
1338
|
table: "_table_1ly5u_11",
|
|
@@ -1317,17 +1357,17 @@ var X = {
|
|
|
1317
1357
|
function Z(...e) {
|
|
1318
1358
|
return e.filter(Boolean).join(" ");
|
|
1319
1359
|
}
|
|
1320
|
-
function
|
|
1360
|
+
function Ue(e, t) {
|
|
1321
1361
|
return e == null ? 1 : t == null ? -1 : e instanceof Date && t instanceof Date ? e.getTime() - t.getTime() : typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t), "it-IT", {
|
|
1322
1362
|
numeric: !0,
|
|
1323
1363
|
sensitivity: "base"
|
|
1324
1364
|
});
|
|
1325
1365
|
}
|
|
1326
|
-
function
|
|
1366
|
+
function We({ columns: e, data: t, getRowId: n, caption: r, emptyMessage: i = "Non sono disponibili dati da visualizzare.", isLoading: a = !1, sortable: o = !0, onRowClick: s, rowAriaLabel: l, className: d, containerClassName: m, ...h }) {
|
|
1327
1367
|
let [g, _] = u(null), v = c(() => {
|
|
1328
1368
|
if (!g?.column.sortValue) return t;
|
|
1329
1369
|
let { column: e, direction: n } = g, r = n === "ascending" ? 1 : -1;
|
|
1330
|
-
return [...t].sort((t, n) =>
|
|
1370
|
+
return [...t].sort((t, n) => Ue(e.sortValue?.(t), e.sortValue?.(n)) * r);
|
|
1331
1371
|
}, [t, g]);
|
|
1332
1372
|
function y(e) {
|
|
1333
1373
|
!o || !e.sortable || !e.sortValue || _((t) => t?.column.id === e.id ? t.direction === "ascending" ? {
|
|
@@ -1342,13 +1382,13 @@ function ze({ columns: e, data: t, getRowId: n, caption: r, emptyMessage: i = "N
|
|
|
1342
1382
|
return g?.column.id === e.id ? g.direction : "none";
|
|
1343
1383
|
}
|
|
1344
1384
|
function x(e) {
|
|
1345
|
-
return g?.column.id === e.id ? g.direction === "ascending" ? /* @__PURE__ */ f(
|
|
1385
|
+
return g?.column.id === e.id ? g.direction === "ascending" ? /* @__PURE__ */ f(R, {
|
|
1346
1386
|
size: 15,
|
|
1347
1387
|
"aria-hidden": "true"
|
|
1348
|
-
}) : /* @__PURE__ */ f(
|
|
1388
|
+
}) : /* @__PURE__ */ f(te, {
|
|
1349
1389
|
size: 15,
|
|
1350
1390
|
"aria-hidden": "true"
|
|
1351
|
-
}) : /* @__PURE__ */ f(
|
|
1391
|
+
}) : /* @__PURE__ */ f(ne, {
|
|
1352
1392
|
size: 15,
|
|
1353
1393
|
"aria-hidden": "true"
|
|
1354
1394
|
});
|
|
@@ -1371,7 +1411,7 @@ function ze({ columns: e, data: t, getRowId: n, caption: r, emptyMessage: i = "N
|
|
|
1371
1411
|
return /* @__PURE__ */ f("th", {
|
|
1372
1412
|
scope: "col",
|
|
1373
1413
|
"aria-sort": t ? b(e) : void 0,
|
|
1374
|
-
className: Z(X.headerCell, X[`align${
|
|
1414
|
+
className: Z(X.headerCell, X[`align${Ge(e.align ?? "left")}`], e.hideOnMobile && X.hideOnMobile),
|
|
1375
1415
|
children: t ? /* @__PURE__ */ p("button", {
|
|
1376
1416
|
type: "button",
|
|
1377
1417
|
className: X.sortButton,
|
|
@@ -1410,7 +1450,7 @@ function ze({ columns: e, data: t, getRowId: n, caption: r, emptyMessage: i = "N
|
|
|
1410
1450
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), c());
|
|
1411
1451
|
} : void 0,
|
|
1412
1452
|
children: e.map((e) => /* @__PURE__ */ f("td", {
|
|
1413
|
-
className: Z(X.cell, X[`align${
|
|
1453
|
+
className: Z(X.cell, X[`align${Ge(e.align ?? "left")}`], e.numeric && X.numeric, e.hideOnMobile && X.hideOnMobile),
|
|
1414
1454
|
children: e.cell(t, r)
|
|
1415
1455
|
}, e.id))
|
|
1416
1456
|
}, i);
|
|
@@ -1421,7 +1461,7 @@ function ze({ columns: e, data: t, getRowId: n, caption: r, emptyMessage: i = "N
|
|
|
1421
1461
|
})
|
|
1422
1462
|
});
|
|
1423
1463
|
}
|
|
1424
|
-
function
|
|
1464
|
+
function Ge(e) {
|
|
1425
1465
|
return `${e.charAt(0).toUpperCase()}${e.slice(1)}`;
|
|
1426
1466
|
}
|
|
1427
1467
|
var Q = {
|
|
@@ -1434,17 +1474,17 @@ var Q = {
|
|
|
1434
1474
|
};
|
|
1435
1475
|
//#endregion
|
|
1436
1476
|
//#region src/components/ProgressBar/ProgressBar.tsx
|
|
1437
|
-
function
|
|
1477
|
+
function Ke(e, t) {
|
|
1438
1478
|
if (t <= 0) return 0;
|
|
1439
1479
|
let n = e / t * 100;
|
|
1440
1480
|
return Math.min(100, Math.max(0, n));
|
|
1441
1481
|
}
|
|
1442
|
-
var
|
|
1443
|
-
let n =
|
|
1482
|
+
var qe = (e, t) => {
|
|
1483
|
+
let n = Ke(e, t);
|
|
1444
1484
|
return `${Math.round(n)}%`;
|
|
1445
1485
|
};
|
|
1446
|
-
function
|
|
1447
|
-
let c =
|
|
1486
|
+
function Je({ value: e, max: t = 100, color: n = "var(--color-danger-500)", showValue: r = !0, formatValue: i = qe, label: a, size: o = "md", className: s }) {
|
|
1487
|
+
let c = Ke(e, t), l = Math.max(0, t), u = Math.min(l, Math.max(0, e));
|
|
1448
1488
|
return /* @__PURE__ */ p("div", {
|
|
1449
1489
|
className: [Q.root, s].filter(Boolean).join(" "),
|
|
1450
1490
|
children: [/* @__PURE__ */ f("div", {
|
|
@@ -1480,10 +1520,10 @@ var $ = {
|
|
|
1480
1520
|
};
|
|
1481
1521
|
//#endregion
|
|
1482
1522
|
//#region src/components/Carousel/Carousel.tsx
|
|
1483
|
-
function
|
|
1523
|
+
function Ye(...e) {
|
|
1484
1524
|
return e.filter(Boolean).join(" ");
|
|
1485
1525
|
}
|
|
1486
|
-
function
|
|
1526
|
+
function Xe({ children: t, ariaLabel: n = "Carosello", showArrows: r = !0, showDots: a = !0, gap: c = "var(--space-4)", slideWidth: m = "100%", className: h }) {
|
|
1487
1527
|
let g = l(null), _ = l([]), v = s(), y = e.toArray(t), [b, x] = u(0), [S, C] = u(!1), [w, T] = u(y.length > 1), E = i(() => {
|
|
1488
1528
|
let e = g.current;
|
|
1489
1529
|
if (!e) return;
|
|
@@ -1519,7 +1559,7 @@ function Ge({ children: t, ariaLabel: n = "Carosello", showArrows: r = !0, showD
|
|
|
1519
1559
|
D(Math.min(y.length - 1, b + 1));
|
|
1520
1560
|
}
|
|
1521
1561
|
return /* @__PURE__ */ p("div", {
|
|
1522
|
-
className:
|
|
1562
|
+
className: Ye($.root, h),
|
|
1523
1563
|
role: "region",
|
|
1524
1564
|
"aria-roledescription": "carosello",
|
|
1525
1565
|
"aria-label": n,
|
|
@@ -1544,21 +1584,21 @@ function Ge({ children: t, ariaLabel: n = "Carosello", showArrows: r = !0, showD
|
|
|
1544
1584
|
}),
|
|
1545
1585
|
r && y.length > 1 ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("button", {
|
|
1546
1586
|
type: "button",
|
|
1547
|
-
className:
|
|
1587
|
+
className: Ye($.arrow, $.arrowPrev),
|
|
1548
1588
|
"aria-label": "Elemento precedente",
|
|
1549
1589
|
disabled: !S,
|
|
1550
1590
|
onClick: O,
|
|
1551
|
-
children: /* @__PURE__ */ f(
|
|
1591
|
+
children: /* @__PURE__ */ f(I, {
|
|
1552
1592
|
size: 18,
|
|
1553
1593
|
"aria-hidden": "true"
|
|
1554
1594
|
})
|
|
1555
1595
|
}), /* @__PURE__ */ f("button", {
|
|
1556
1596
|
type: "button",
|
|
1557
|
-
className:
|
|
1597
|
+
className: Ye($.arrow, $.arrowNext),
|
|
1558
1598
|
"aria-label": "Elemento successivo",
|
|
1559
1599
|
disabled: !w,
|
|
1560
1600
|
onClick: k,
|
|
1561
|
-
children: /* @__PURE__ */ f(
|
|
1601
|
+
children: /* @__PURE__ */ f(L, {
|
|
1562
1602
|
size: 18,
|
|
1563
1603
|
"aria-hidden": "true"
|
|
1564
1604
|
})
|
|
@@ -1570,7 +1610,7 @@ function Ge({ children: t, ariaLabel: n = "Carosello", showArrows: r = !0, showD
|
|
|
1570
1610
|
children: y.map((e, t) => /* @__PURE__ */ f("button", {
|
|
1571
1611
|
type: "button",
|
|
1572
1612
|
role: "tab",
|
|
1573
|
-
className:
|
|
1613
|
+
className: Ye($.dot, t === b && $.activeDot),
|
|
1574
1614
|
"aria-selected": t === b,
|
|
1575
1615
|
"aria-controls": `${v}-slide-${t}`,
|
|
1576
1616
|
"aria-label": `Vai all'elemento ${t + 1}`,
|
|
@@ -1581,4 +1621,4 @@ function Ge({ children: t, ariaLabel: n = "Carosello", showArrows: r = !0, showD
|
|
|
1581
1621
|
});
|
|
1582
1622
|
}
|
|
1583
1623
|
//#endregion
|
|
1584
|
-
export { Fe as Badge, v as Button,
|
|
1624
|
+
export { Fe as Badge, v as Button, le as CalculatorKeypad, C as Card, Xe as Carousel, We as DataTable, ye as DatePicker, Ee as Dropdown, Ce as IconButton, Be as List, He as ListCell, Ve as ListRow, Me as MonthCarousel, Oe as MultiSelect, Je as ProgressBar, Le as Switch, Te as TextField };
|