@selectwin/kit 0.1.266 → 0.1.268
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -5
- package/dist/SelectCalendar.d.ts +7 -1
- package/dist/SelectCalendar.js +36 -36
- package/dist/SelectDateField.js +112 -145
- package/dist/SelectField.d.ts +4 -0
- package/dist/SelectKpiBand.d.ts +3 -1
- package/dist/SelectKpiBand.js +14 -9
- package/dist/SelectLocale.d.ts +57 -0
- package/dist/SelectLocale.js +153 -39
- package/dist/SelectMail.d.ts +21 -3
- package/dist/SelectMail.js +61 -57
- package/dist/SelectMonthField.d.ts +20 -0
- package/dist/SelectMonthField.js +181 -0
- package/dist/SelectScrollArea.d.ts +6 -2
- package/dist/SelectScrollArea.js +7 -7
- package/dist/SelectTable.d.ts +8 -0
- package/dist/SelectTable.js +90 -90
- package/dist/SelectWhenField.d.ts +26 -0
- package/dist/SelectWhenField.js +192 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +17 -15
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/SelectMail.js
CHANGED
|
@@ -216,7 +216,7 @@ function H({ tone: e, children: t }) {
|
|
|
216
216
|
})]
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function U({ icon: e, title: t, children: n, details: r, action: i, tone: a = "neutral" }) {
|
|
220
220
|
return /* @__PURE__ */ F("div", {
|
|
221
221
|
className: `select-inbox-empty select-inbox-empty--${a}`,
|
|
222
222
|
children: [
|
|
@@ -244,14 +244,14 @@ function ee({ icon: e, title: t, children: n, details: r, action: i, tone: a = "
|
|
|
244
244
|
]
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function W({ children: e, "aria-label": t }) {
|
|
248
248
|
return /* @__PURE__ */ P("div", {
|
|
249
249
|
className: "select-maillist",
|
|
250
250
|
"aria-label": t,
|
|
251
251
|
children: e
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function G({ label: e, children: t }) {
|
|
255
255
|
return /* @__PURE__ */ F("div", {
|
|
256
256
|
className: "select-maillist__group",
|
|
257
257
|
role: "group",
|
|
@@ -266,14 +266,14 @@ function ne({ label: e, children: t }) {
|
|
|
266
266
|
})]
|
|
267
267
|
});
|
|
268
268
|
}
|
|
269
|
-
var
|
|
269
|
+
var K = {
|
|
270
270
|
whatsapp: y,
|
|
271
271
|
email: l,
|
|
272
272
|
instagram: c,
|
|
273
273
|
messenger: u,
|
|
274
274
|
sms: h
|
|
275
275
|
};
|
|
276
|
-
function
|
|
276
|
+
function q({ from: e, avatar: t, subject: n, snippet: r, date: i, count: a, attachments: o, active: s = !1, unread: c = !1, flagged: l = !1, unreadCount: u, channel: f, avatarTone: p = "neutral", avatarRound: m = !1, onFlagToggle: h, flagLabel: _, unflagLabel: v, badge: y, pending: x = !1, pendingLabel: S, onClick: C }) {
|
|
277
277
|
let w = b().inbox, E = h != null, D = y != null && y !== !1, O = u != null && u > 0, k = c || O, A = t === !1 ? null : /* @__PURE__ */ P(T, {
|
|
278
278
|
name: t === !1 ? void 0 : t ?? (typeof e == "string" ? e : void 0),
|
|
279
279
|
initials: 2,
|
|
@@ -292,7 +292,7 @@ function ie({ from: e, avatar: t, subject: n, snippet: r, date: i, count: a, att
|
|
|
292
292
|
onClick: C,
|
|
293
293
|
children: [f && A ? /* @__PURE__ */ F("span", {
|
|
294
294
|
className: "select-maillist__face",
|
|
295
|
-
children: [A, /* @__PURE__ */ P(
|
|
295
|
+
children: [A, /* @__PURE__ */ P(J, {
|
|
296
296
|
channel: f,
|
|
297
297
|
label: w.channel[f]
|
|
298
298
|
})]
|
|
@@ -372,8 +372,8 @@ function ie({ from: e, avatar: t, subject: n, snippet: r, date: i, count: a, att
|
|
|
372
372
|
})]
|
|
373
373
|
}) : M;
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
let i =
|
|
375
|
+
function J({ channel: e, label: t, inline: n, className: r }) {
|
|
376
|
+
let i = K[e];
|
|
377
377
|
return /* @__PURE__ */ P("span", {
|
|
378
378
|
className: L("select-maillist__channel", `select-maillist__channel--${e}`, n && "select-maillist__channel--inline", r),
|
|
379
379
|
role: "img",
|
|
@@ -381,16 +381,16 @@ function U({ channel: e, label: t, inline: n, className: r }) {
|
|
|
381
381
|
children: /* @__PURE__ */ P(i, {})
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function Y({ channel: e, label: t, className: n }) {
|
|
385
385
|
let r = b().inbox;
|
|
386
|
-
return /* @__PURE__ */ P(
|
|
386
|
+
return /* @__PURE__ */ P(J, {
|
|
387
387
|
channel: e,
|
|
388
388
|
label: t ?? r.channel[e],
|
|
389
389
|
inline: !0,
|
|
390
390
|
className: n
|
|
391
391
|
});
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function ee({ rows: e = 6 }) {
|
|
394
394
|
return /* @__PURE__ */ P("div", {
|
|
395
395
|
className: "select-maillist__skeleton",
|
|
396
396
|
"aria-hidden": "true",
|
|
@@ -409,13 +409,13 @@ function G({ rows: e = 6 }) {
|
|
|
409
409
|
}, t))
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function te({ children: e, tone: t = "muted" }) {
|
|
413
413
|
return /* @__PURE__ */ P("div", {
|
|
414
414
|
className: `select-maillist__note select-maillist__note--${t}`,
|
|
415
415
|
children: e
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function ne({ title: t, meta: n, actions: r, tools: i, onBack: a, children: o, footer: s, variant: c = "mail", avatar: l, threadMin: u, context: d }) {
|
|
419
419
|
let f = b().inbox;
|
|
420
420
|
return /* @__PURE__ */ F("div", {
|
|
421
421
|
className: L("select-mailreader", c === "chat" && "select-mailreader--chat"),
|
|
@@ -481,7 +481,7 @@ function q({ title: t, meta: n, actions: r, tools: i, onBack: a, children: o, fo
|
|
|
481
481
|
]
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function re({ from: e, to: t, cc: n, bcc: i, selfAddress: a, date: o, dateTitle: s, actions: c, notice: l, text: u, children: f, attachments: p, collapsed: m = !1, snippet: h, hasAttachments: g = !1, onToggle: _ }) {
|
|
485
485
|
let v = (e) => !!e && !!a && e.address.toLowerCase() === a.toLowerCase(), y = (e) => (e ?? []).map((e) => v(e) ? "você" : I(e)).join(", "), b = I(e);
|
|
486
486
|
if (m) return /* @__PURE__ */ F("button", {
|
|
487
487
|
type: "button",
|
|
@@ -585,7 +585,7 @@ function J({ from: e, to: t, cc: n, bcc: i, selfAddress: a, date: o, dateTitle:
|
|
|
585
585
|
]
|
|
586
586
|
});
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function ie({ tone: e = "info", icon: t, children: n }) {
|
|
589
589
|
return /* @__PURE__ */ F("div", {
|
|
590
590
|
className: `select-mailnotice select-mailnotice--${e}`,
|
|
591
591
|
children: [/* @__PURE__ */ P("span", {
|
|
@@ -595,7 +595,7 @@ function ae({ tone: e = "info", icon: t, children: n }) {
|
|
|
595
595
|
}), /* @__PURE__ */ P("span", { children: n })]
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function ae({ name: e, size: t, state: n = "idle", onClick: r, loadingLabel: i, readyLabel: s, failedLabel: c, downloadOnly: l = !1 }) {
|
|
599
599
|
let u = b().inbox, d = D(e), f = n === "loading" ? i ?? u.attachmentLoading : n === "ready" ? s ?? (l ? u.download : u.attachmentReady) : n === "failed" ? c ?? u.attachmentFailed : t, p = n === "ready" ? l ? u.attachmentDownload(e) : u.attachmentOpen(e) : n === "loading" ? u.attachmentBusy(e) : l && n === "idle" ? u.attachmentDownloadGet(e) : u.attachmentGet(e);
|
|
600
600
|
return /* @__PURE__ */ F("button", {
|
|
601
601
|
type: "button",
|
|
@@ -632,7 +632,7 @@ function oe({ name: e, size: t, state: n = "idle", onClick: r, loadingLabel: i,
|
|
|
632
632
|
]
|
|
633
633
|
});
|
|
634
634
|
}
|
|
635
|
-
function
|
|
635
|
+
function oe({ children: e, onClick: n, variant: r = "link", title: i }) {
|
|
636
636
|
return /* @__PURE__ */ F("button", {
|
|
637
637
|
type: "button",
|
|
638
638
|
className: `select-leadchip select-leadchip--${r}`,
|
|
@@ -656,34 +656,34 @@ function se({ children: e, onClick: n, variant: r = "link", title: i }) {
|
|
|
656
656
|
]
|
|
657
657
|
});
|
|
658
658
|
}
|
|
659
|
-
var
|
|
659
|
+
var X = (e) => {
|
|
660
660
|
var t;
|
|
661
661
|
return Array.from(((t = e.dataTransfer) == null ? void 0 : t.types) ?? []).includes("Files");
|
|
662
662
|
};
|
|
663
|
-
function
|
|
664
|
-
let
|
|
663
|
+
function se({ variant: e = "inline", title: t, minimized: a = !1, onToggleMinimize: o, onClose: c, closeLabel: l, error: u, attachments: f, onFiles: p, dropLabel: m, footer: h, start: g, end: _, hint: v, hintEnd: y, shape: C = "box", narrow: T = !1, fill: E = !1, children: D, "aria-label": O }) {
|
|
664
|
+
let k = b().inbox, A = e === "dock", I = e === "chat", R = S(I && C === "auto" ? x : void 0), z = I && (C === "pill" || C === "auto" && R), [B, V] = M(!1), H = j(0), U = p ? {
|
|
665
665
|
onDragEnter: (e) => {
|
|
666
|
-
|
|
666
|
+
X(e) && (e.preventDefault(), H.current += 1, V(!0));
|
|
667
667
|
},
|
|
668
668
|
onDragOver: (e) => {
|
|
669
|
-
|
|
669
|
+
X(e) && e.preventDefault();
|
|
670
670
|
},
|
|
671
671
|
onDragLeave: (e) => {
|
|
672
|
-
|
|
672
|
+
X(e) && (H.current = Math.max(0, H.current - 1), H.current === 0 && V(!1));
|
|
673
673
|
},
|
|
674
674
|
onDrop: (e) => {
|
|
675
|
-
if (!
|
|
676
|
-
e.preventDefault(),
|
|
675
|
+
if (!X(e)) return;
|
|
676
|
+
e.preventDefault(), H.current = 0, V(!1);
|
|
677
677
|
let t = Array.from(e.dataTransfer.files);
|
|
678
678
|
t.length && p(t);
|
|
679
679
|
}
|
|
680
|
-
} : {},
|
|
681
|
-
className: L("select-mailcomposer", `select-mailcomposer--${e}`,
|
|
682
|
-
role:
|
|
683
|
-
"aria-label":
|
|
684
|
-
...
|
|
680
|
+
} : {}, W = /* @__PURE__ */ F("div", {
|
|
681
|
+
className: L("select-mailcomposer", `select-mailcomposer--${e}`, z && "select-mailcomposer--pill", I && T === "auto" && "select-mailcomposer--narrow-auto", I && T === !0 && "select-mailcomposer--narrow", E && "select-mailcomposer--fill", a && "is-minimized", B && "is-dragging"),
|
|
682
|
+
role: A ? "dialog" : "group",
|
|
683
|
+
"aria-label": O,
|
|
684
|
+
...U,
|
|
685
685
|
children: [
|
|
686
|
-
|
|
686
|
+
A ? /* @__PURE__ */ F("div", {
|
|
687
687
|
className: "select-mailcomposer__bar",
|
|
688
688
|
children: [
|
|
689
689
|
/* @__PURE__ */ P("span", {
|
|
@@ -692,24 +692,24 @@ function ce({ variant: e = "inline", title: t, minimized: a = !1, onToggleMinimi
|
|
|
692
692
|
}),
|
|
693
693
|
o ? /* @__PURE__ */ P(w, {
|
|
694
694
|
icon: P(a ? r : n, {}),
|
|
695
|
-
label: a ?
|
|
695
|
+
label: a ? k.open : k.minimize,
|
|
696
696
|
size: "sm",
|
|
697
697
|
onClick: o
|
|
698
698
|
}) : null,
|
|
699
699
|
c ? /* @__PURE__ */ P(w, {
|
|
700
700
|
icon: /* @__PURE__ */ P(i, {}),
|
|
701
|
-
label: l ??
|
|
701
|
+
label: l ?? k.close,
|
|
702
702
|
size: "sm",
|
|
703
703
|
onClick: c
|
|
704
704
|
}) : null
|
|
705
705
|
]
|
|
706
706
|
}) : null,
|
|
707
|
-
|
|
707
|
+
B && !a ? /* @__PURE__ */ F("div", {
|
|
708
708
|
className: "select-mailcomposer__drop",
|
|
709
709
|
"aria-hidden": "true",
|
|
710
|
-
children: [/* @__PURE__ */ P(d, {}), /* @__PURE__ */ P("span", { children: m ??
|
|
710
|
+
children: [/* @__PURE__ */ P(d, {}), /* @__PURE__ */ P("span", { children: m ?? k.drop })]
|
|
711
711
|
}) : null,
|
|
712
|
-
a ? null :
|
|
712
|
+
a ? null : I ? /* @__PURE__ */ F(N, { children: [
|
|
713
713
|
f,
|
|
714
714
|
u ? /* @__PURE__ */ F("div", {
|
|
715
715
|
className: "select-mailcomposer__error",
|
|
@@ -728,7 +728,7 @@ function ce({ variant: e = "inline", title: t, minimized: a = !1, onToggleMinimi
|
|
|
728
728
|
}) : null,
|
|
729
729
|
/* @__PURE__ */ P("div", {
|
|
730
730
|
className: "select-mailcomposer__fields",
|
|
731
|
-
children:
|
|
731
|
+
children: D
|
|
732
732
|
}),
|
|
733
733
|
_ != null && _ !== !1 ? /* @__PURE__ */ P("div", {
|
|
734
734
|
className: "select-mailcomposer__end",
|
|
@@ -743,7 +743,7 @@ function ce({ variant: e = "inline", title: t, minimized: a = !1, onToggleMinimi
|
|
|
743
743
|
] }) : /* @__PURE__ */ F(N, { children: [
|
|
744
744
|
/* @__PURE__ */ P("div", {
|
|
745
745
|
className: "select-mailcomposer__fields",
|
|
746
|
-
children:
|
|
746
|
+
children: D
|
|
747
747
|
}),
|
|
748
748
|
f,
|
|
749
749
|
u ? /* @__PURE__ */ F("div", {
|
|
@@ -761,12 +761,12 @@ function ce({ variant: e = "inline", title: t, minimized: a = !1, onToggleMinimi
|
|
|
761
761
|
] })
|
|
762
762
|
]
|
|
763
763
|
});
|
|
764
|
-
return !
|
|
764
|
+
return !I || (v == null || v === !1) && (y == null || y === !1) ? W : /* @__PURE__ */ F(N, { children: [W, /* @__PURE__ */ F("div", {
|
|
765
765
|
className: "select-mailcomposer__hint",
|
|
766
766
|
children: [/* @__PURE__ */ P("span", { children: v }), y != null && y !== !1 ? /* @__PURE__ */ P("span", { children: y }) : null]
|
|
767
767
|
})] });
|
|
768
768
|
}
|
|
769
|
-
function
|
|
769
|
+
function ce({ label: e, children: t, action: n }) {
|
|
770
770
|
return /* @__PURE__ */ F("div", {
|
|
771
771
|
className: "select-mailcomposer__row",
|
|
772
772
|
children: [
|
|
@@ -785,7 +785,7 @@ function le({ label: e, children: t, action: n }) {
|
|
|
785
785
|
]
|
|
786
786
|
});
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function le({ value: e, onChange: t, placeholder: n, "aria-label": r, maxLength: i }) {
|
|
789
789
|
return /* @__PURE__ */ P("input", {
|
|
790
790
|
className: "select-mailcomposer__input",
|
|
791
791
|
value: e,
|
|
@@ -795,19 +795,19 @@ function ue({ value: e, onChange: t, placeholder: n, "aria-label": r, maxLength:
|
|
|
795
795
|
maxLength: i
|
|
796
796
|
});
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function Z(e, t, n) {
|
|
799
799
|
let r = getComputedStyle(e), i = parseFloat(r.lineHeight) || 22, a = (parseFloat(r.paddingTop) || 0) + (parseFloat(r.paddingBottom) || 0) + (parseFloat(r.borderTopWidth) || 0) + (parseFloat(r.borderBottomWidth) || 0), o = i * t + a, s = i * n + a;
|
|
800
800
|
e.style.height = "auto";
|
|
801
801
|
let c = e.scrollHeight + (parseFloat(r.borderTopWidth) || 0) + (parseFloat(r.borderBottomWidth) || 0);
|
|
802
802
|
e.style.height = `${Math.round(Math.min(s, Math.max(o, c)))}px`, e.style.overflowY = c > s ? "auto" : "hidden";
|
|
803
803
|
}
|
|
804
|
-
function
|
|
804
|
+
function ue({ value: e, onChange: t, placeholder: n, rows: r = 6, autoGrow: i = !1, minRows: a = 3, maxRows: o = 12, "aria-label": s, maxLength: c, onEnter: l, id: u, textareaRef: d, onKeyDown: f, onSelect: p, fieldProps: m }) {
|
|
805
805
|
let h = b().inbox, g = j(null), _ = k((e) => {
|
|
806
806
|
g.current = e, typeof d == "function" ? d(e) : d && (d.current = e);
|
|
807
807
|
}, [d]);
|
|
808
808
|
return A(() => {
|
|
809
809
|
let e = g.current;
|
|
810
|
-
i && e &&
|
|
810
|
+
i && e && Z(e, a, o);
|
|
811
811
|
}, [
|
|
812
812
|
i,
|
|
813
813
|
e,
|
|
@@ -817,7 +817,7 @@ function de({ value: e, onChange: t, placeholder: n, rows: r = 6, autoGrow: i =
|
|
|
817
817
|
let e = g.current;
|
|
818
818
|
if (!i || !e || typeof ResizeObserver > "u") return;
|
|
819
819
|
let t = e.clientWidth, n = new ResizeObserver(() => {
|
|
820
|
-
e.clientWidth !== t && (t = e.clientWidth,
|
|
820
|
+
e.clientWidth !== t && (t = e.clientWidth, Z(e, a, o));
|
|
821
821
|
});
|
|
822
822
|
return n.observe(e), () => n.disconnect();
|
|
823
823
|
}, [
|
|
@@ -841,7 +841,7 @@ function de({ value: e, onChange: t, placeholder: n, rows: r = 6, autoGrow: i =
|
|
|
841
841
|
maxLength: c
|
|
842
842
|
});
|
|
843
843
|
}
|
|
844
|
-
function
|
|
844
|
+
function de({ onFiles: e, accept: t, multiple: n = !0, disabled: r = !1, label: i = "Anexar arquivo" }) {
|
|
845
845
|
let a = j(null);
|
|
846
846
|
return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(w, {
|
|
847
847
|
icon: /* @__PURE__ */ P(d, {}),
|
|
@@ -866,7 +866,7 @@ function fe({ onFiles: e, accept: t, multiple: n = !0, disabled: r = !1, label:
|
|
|
866
866
|
}
|
|
867
867
|
})] });
|
|
868
868
|
}
|
|
869
|
-
function
|
|
869
|
+
function fe({ children: e, note: t }) {
|
|
870
870
|
return /* @__PURE__ */ F("div", {
|
|
871
871
|
className: "select-mailcomposer__attachments",
|
|
872
872
|
role: "list",
|
|
@@ -877,7 +877,7 @@ function pe({ children: e, note: t }) {
|
|
|
877
877
|
}) : null]
|
|
878
878
|
});
|
|
879
879
|
}
|
|
880
|
-
function
|
|
880
|
+
function pe({ name: e, size: t, state: n = "done", progress: r, error: a, onRemove: o, onRetry: s }) {
|
|
881
881
|
let c = D(e), l = r == null ? null : Math.round(Math.min(1, Math.max(0, r)) * 100), u = n === "uploading" ? l == null ? "Subindo…" : `Subindo… ${l}%` : n === "failed" ? a ?? "Não subiu" : t;
|
|
882
882
|
return /* @__PURE__ */ F("span", {
|
|
883
883
|
className: `select-mailupload select-mailupload--${n}`,
|
|
@@ -927,25 +927,29 @@ function me({ name: e, size: t, state: n = "done", progress: r, error: a, onRemo
|
|
|
927
927
|
]
|
|
928
928
|
});
|
|
929
929
|
}
|
|
930
|
-
function
|
|
930
|
+
function me({ above: e, start: t, note: n, end: r }) {
|
|
931
931
|
return /* @__PURE__ */ F(N, { children: [
|
|
932
|
-
e ? /* @__PURE__ */ P("div", {
|
|
933
|
-
className: "select-
|
|
932
|
+
e != null && e !== !1 ? /* @__PURE__ */ P("div", {
|
|
933
|
+
className: "select-mailcomposer__above",
|
|
934
934
|
children: e
|
|
935
935
|
}) : null,
|
|
936
|
+
t ? /* @__PURE__ */ P("div", {
|
|
937
|
+
className: "select-mailcomposer__start",
|
|
938
|
+
children: t
|
|
939
|
+
}) : null,
|
|
936
940
|
/* @__PURE__ */ P("span", {
|
|
937
941
|
className: "select-mailcomposer__note",
|
|
938
|
-
children:
|
|
942
|
+
children: n
|
|
939
943
|
}),
|
|
940
|
-
|
|
944
|
+
r ? /* @__PURE__ */ P("div", {
|
|
941
945
|
className: "select-mailcomposer__end",
|
|
942
|
-
children:
|
|
946
|
+
children: r
|
|
943
947
|
}) : null
|
|
944
948
|
] });
|
|
945
949
|
}
|
|
946
|
-
var
|
|
950
|
+
var he = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Q = /[\s,;]+/;
|
|
947
951
|
function $(e) {
|
|
948
|
-
return
|
|
952
|
+
return he.test(e);
|
|
949
953
|
}
|
|
950
954
|
function ge({ value: e, onChange: t, labels: n, validate: r = $, placeholder: a, "aria-label": o }) {
|
|
951
955
|
let [s, c] = M(""), l = j(null), u = (n) => {
|
|
@@ -1040,6 +1044,6 @@ function _e({ open: e, onClose: t, activator: n, templates: r, onPick: i, hint:
|
|
|
1040
1044
|
});
|
|
1041
1045
|
}
|
|
1042
1046
|
//#endregion
|
|
1043
|
-
export {
|
|
1047
|
+
export { Y as SelectChannelBadge, z as SelectInbox, B as SelectInboxBanner, U as SelectInboxEmpty, V as SelectInboxToolbar, oe as SelectLeadChip, de as SelectMailAttachButton, ae as SelectMailAttachment, se as SelectMailComposer, fe as SelectMailComposerAttachments, ue as SelectMailComposerBody, me as SelectMailComposerFooter, le as SelectMailComposerInput, ce as SelectMailComposerRow, W as SelectMailList, G as SelectMailListGroup, q as SelectMailListItem, te as SelectMailListNote, ee as SelectMailListSkeleton, re as SelectMailMessage, ie as SelectMailNotice, ne as SelectMailReader, pe as SelectMailUpload, H as SelectMailboxStatus, ge as SelectRecipientInput, _e as SelectTemplateMenu, D as attachmentExt, $ as isMailAddress, I as mailName };
|
|
1044
1048
|
|
|
1045
1049
|
//# sourceMappingURL=SelectMail.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface SelectMonthFieldProps {
|
|
2
|
+
label?: string;
|
|
3
|
+
/** O mês: `"AAAA-MM"`, ou `""` sem mês. */
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
/** O primeiro e o último mês que dá para escolher (`"AAAA-MM"`, inclusivos). */
|
|
7
|
+
min?: string;
|
|
8
|
+
max?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
error?: string;
|
|
13
|
+
hint?: string;
|
|
14
|
+
/** O "Limpar", que esvazia o campo (padrão: só quando não é `required`). */
|
|
15
|
+
clearable?: boolean;
|
|
16
|
+
/** O nome do campo no formulário (um `<input type="hidden">` com o valor). */
|
|
17
|
+
name?: string;
|
|
18
|
+
id?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const SelectMonthField: import('react').ForwardRefExoticComponent<SelectMonthFieldProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectMonthFieldProps> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { SelectButton as e } from "./SelectButton.js";
|
|
3
|
+
import { CalendarIcon as t, ChevronDownIcon as n, ChevronLeftIcon as r, ChevronRightIcon as i } from "./icons.js";
|
|
4
|
+
import { useSelectMessages as a } from "./SelectLocale.js";
|
|
5
|
+
import { SelectLabelRow as o } from "./SelectField.js";
|
|
6
|
+
import { SelectPopover as s } from "./SelectPopover.js";
|
|
7
|
+
import { forwardRef as c, useId as l, useState as u } from "react";
|
|
8
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
|
+
//#region src/SelectMonthField.tsx
|
|
10
|
+
var p = 12;
|
|
11
|
+
function m(e) {
|
|
12
|
+
let t = /^(\d{4})-(\d{2})$/.exec(e ?? "");
|
|
13
|
+
if (!t) return null;
|
|
14
|
+
let n = Number(t[2]) - 1;
|
|
15
|
+
return n >= 0 && n <= 11 ? {
|
|
16
|
+
y: Number(t[1]),
|
|
17
|
+
m: n
|
|
18
|
+
} : null;
|
|
19
|
+
}
|
|
20
|
+
var h = (e) => String(e).padStart(2, "0"), g = (e, t) => `${e}-${h(t + 1)}`, _ = (e, t) => e * 12 + t, v = c(function({ label: c, value: h, onChange: v, min: y, max: b, placeholder: x, required: S, disabled: C, error: w, hint: T, clearable: E, name: D, id: O, className: k, ...A }, j) {
|
|
21
|
+
let M = l(), N = O ?? M, P = a().dateField, F = m(h), I = m(y), L = m(b), R = /* @__PURE__ */ new Date(), z = {
|
|
22
|
+
y: R.getFullYear(),
|
|
23
|
+
m: R.getMonth()
|
|
24
|
+
}, B = (e, t) => !!I && _(e, t) < _(I.y, I.m) || !!L && _(e, t) > _(L.y, L.m), V = (e) => !!I && e < I.y || !!L && e > L.y, H = () => F ? F.y : L && _(z.y, z.m) > _(L.y, L.m) ? L.y : I && _(z.y, z.m) < _(I.y, I.m) ? I.y : z.y, [U, W] = u(!1), [G, K] = u(H), [q, J] = u("month"), Y = G - G % p, X = (E ?? !S) && !!F, Z = () => {
|
|
25
|
+
C || (K(H()), J("month"), W((e) => !e));
|
|
26
|
+
}, Q = (e, t) => {
|
|
27
|
+
B(e, t) || (v(g(e, t)), W(!1));
|
|
28
|
+
}, $ = (e) => K((t) => t + e * (q === "year" ? p : 1)), ee = w ? `${N}-err` : T ? `${N}-hint` : void 0, te = /* @__PURE__ */ f("div", {
|
|
29
|
+
className: `select-input-wrap${w ? " select-input-wrap--error" : ""}`,
|
|
30
|
+
children: [/* @__PURE__ */ d("button", {
|
|
31
|
+
id: N,
|
|
32
|
+
type: "button",
|
|
33
|
+
className: `select-input select-datefield__activator select-monthfield__activator${w ? " select-input--error" : ""}`,
|
|
34
|
+
onClick: Z,
|
|
35
|
+
disabled: C,
|
|
36
|
+
"aria-haspopup": "dialog",
|
|
37
|
+
"aria-expanded": U,
|
|
38
|
+
"aria-invalid": w ? !0 : void 0,
|
|
39
|
+
"aria-describedby": ee,
|
|
40
|
+
children: F ? P.monthValue(F.m + 1, F.y) : /* @__PURE__ */ d("span", {
|
|
41
|
+
className: "select-datefield__ph",
|
|
42
|
+
children: x ?? P.monthPlaceholder
|
|
43
|
+
})
|
|
44
|
+
}), /* @__PURE__ */ d("span", {
|
|
45
|
+
className: "select-datefield__icon",
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
children: /* @__PURE__ */ d(t, {})
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
50
|
+
return /* @__PURE__ */ f("div", {
|
|
51
|
+
ref: j,
|
|
52
|
+
...A,
|
|
53
|
+
className: `select-field select-monthfield${k ? " " + k : ""}`,
|
|
54
|
+
children: [
|
|
55
|
+
c && /* @__PURE__ */ d(o, {
|
|
56
|
+
htmlFor: N,
|
|
57
|
+
label: S ? `${c} *` : c
|
|
58
|
+
}),
|
|
59
|
+
D ? /* @__PURE__ */ d("input", {
|
|
60
|
+
type: "hidden",
|
|
61
|
+
name: D,
|
|
62
|
+
value: F ? h : ""
|
|
63
|
+
}) : null,
|
|
64
|
+
/* @__PURE__ */ d("div", {
|
|
65
|
+
className: "select-datefield",
|
|
66
|
+
children: /* @__PURE__ */ d(s, {
|
|
67
|
+
active: U,
|
|
68
|
+
onClose: () => W(!1),
|
|
69
|
+
placement: "bottom-start",
|
|
70
|
+
role: "dialog",
|
|
71
|
+
activator: te,
|
|
72
|
+
children: /* @__PURE__ */ f("div", {
|
|
73
|
+
className: "select-datefield__pop",
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ f("div", {
|
|
76
|
+
className: "select-datepicker__calhead",
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ d("button", {
|
|
79
|
+
type: "button",
|
|
80
|
+
className: "select-datepicker__nav",
|
|
81
|
+
"aria-label": q === "year" ? P.prevYears : P.prevYear,
|
|
82
|
+
onClick: () => $(-1),
|
|
83
|
+
children: /* @__PURE__ */ d(r, {})
|
|
84
|
+
}),
|
|
85
|
+
q === "year" ? /* @__PURE__ */ f("span", {
|
|
86
|
+
className: "select-datepicker__monthlabel",
|
|
87
|
+
children: [
|
|
88
|
+
Y,
|
|
89
|
+
" – ",
|
|
90
|
+
Y + p - 1
|
|
91
|
+
]
|
|
92
|
+
}) : /* @__PURE__ */ f("button", {
|
|
93
|
+
type: "button",
|
|
94
|
+
className: "select-datepicker__monthlabel select-datefield__modebtn",
|
|
95
|
+
"aria-label": P.pickYear,
|
|
96
|
+
onClick: () => J("year"),
|
|
97
|
+
children: [G, /* @__PURE__ */ d(n, {})]
|
|
98
|
+
}),
|
|
99
|
+
/* @__PURE__ */ d("button", {
|
|
100
|
+
type: "button",
|
|
101
|
+
className: "select-datepicker__nav",
|
|
102
|
+
"aria-label": q === "year" ? P.nextYears : P.nextYear,
|
|
103
|
+
onClick: () => $(1),
|
|
104
|
+
children: /* @__PURE__ */ d(i, {})
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
}),
|
|
108
|
+
q === "year" ? /* @__PURE__ */ d("div", {
|
|
109
|
+
className: "select-datefield__cells",
|
|
110
|
+
role: "grid",
|
|
111
|
+
"aria-label": P.years,
|
|
112
|
+
children: Array.from({ length: p }, (e, t) => Y + t).map((e) => {
|
|
113
|
+
let t = (F == null ? void 0 : F.y) === e;
|
|
114
|
+
return /* @__PURE__ */ d("button", {
|
|
115
|
+
type: "button",
|
|
116
|
+
className: `select-datefield__cell${t ? " is-selected" : ""}${e === z.y && !t ? " is-today" : ""}`,
|
|
117
|
+
"aria-pressed": t,
|
|
118
|
+
disabled: V(e),
|
|
119
|
+
onClick: () => {
|
|
120
|
+
K(e), J("month");
|
|
121
|
+
},
|
|
122
|
+
children: e
|
|
123
|
+
}, e);
|
|
124
|
+
})
|
|
125
|
+
}) : /* @__PURE__ */ d("div", {
|
|
126
|
+
className: "select-datefield__cells",
|
|
127
|
+
role: "grid",
|
|
128
|
+
"aria-label": P.monthsOf(G),
|
|
129
|
+
children: P.monthsShort.map((e, t) => {
|
|
130
|
+
let n = !!F && F.y === G && F.m === t, r = G === z.y && t === z.m;
|
|
131
|
+
return /* @__PURE__ */ d("button", {
|
|
132
|
+
type: "button",
|
|
133
|
+
"aria-label": P.monthCell(t + 1, G),
|
|
134
|
+
"aria-pressed": n,
|
|
135
|
+
...r ? { "aria-current": "date" } : {},
|
|
136
|
+
className: `select-datefield__cell${n ? " is-selected" : ""}${r && !n ? " is-today" : ""}`,
|
|
137
|
+
disabled: B(G, t),
|
|
138
|
+
onClick: () => Q(G, t),
|
|
139
|
+
children: e
|
|
140
|
+
}, t);
|
|
141
|
+
})
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ f("div", {
|
|
144
|
+
className: "select-datefield__footer",
|
|
145
|
+
children: [X ? /* @__PURE__ */ d(e, {
|
|
146
|
+
variant: "secondary",
|
|
147
|
+
inline: !0,
|
|
148
|
+
onClick: () => {
|
|
149
|
+
v(""), W(!1);
|
|
150
|
+
},
|
|
151
|
+
children: P.clear
|
|
152
|
+
}) : /* @__PURE__ */ d("span", {}), /* @__PURE__ */ d("div", {
|
|
153
|
+
className: "select-datefield__footer-right",
|
|
154
|
+
children: !B(z.y, z.m) && /* @__PURE__ */ d(e, {
|
|
155
|
+
variant: "secondary",
|
|
156
|
+
inline: !0,
|
|
157
|
+
onClick: () => Q(z.y, z.m),
|
|
158
|
+
children: P.thisMonth
|
|
159
|
+
})
|
|
160
|
+
})]
|
|
161
|
+
})
|
|
162
|
+
]
|
|
163
|
+
})
|
|
164
|
+
})
|
|
165
|
+
}),
|
|
166
|
+
w ? /* @__PURE__ */ d("p", {
|
|
167
|
+
id: `${N}-err`,
|
|
168
|
+
className: "select-field__error",
|
|
169
|
+
children: w
|
|
170
|
+
}) : T ? /* @__PURE__ */ d("p", {
|
|
171
|
+
id: `${N}-hint`,
|
|
172
|
+
className: "select-field__hint",
|
|
173
|
+
children: T
|
|
174
|
+
}) : null
|
|
175
|
+
]
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
//#endregion
|
|
179
|
+
export { v as SelectMonthField };
|
|
180
|
+
|
|
181
|
+
//# sourceMappingURL=SelectMonthField.js.map
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
export type SelectScrollAxis = 'y' | 'x' | 'both';
|
|
3
|
+
/** A calha da barra: guardada (`stable`, o padrão) ou só quando rola (`auto`). */
|
|
4
|
+
export type SelectScrollGutter = 'stable' | 'auto';
|
|
3
5
|
/** As tags de bloco que a área pode ser. */
|
|
4
6
|
export type SelectScrollAreaElement = 'div' | 'section' | 'article' | 'aside' | 'nav' | 'main' | 'header' | 'footer' | 'ul' | 'ol' | 'dl' | 'pre';
|
|
5
7
|
type SelectScrollAreaOwnProps = {
|
|
@@ -11,9 +13,11 @@ type SelectScrollAreaOwnProps = {
|
|
|
11
13
|
label?: string;
|
|
12
14
|
/** A tag (padrão `div`). */
|
|
13
15
|
as?: SelectScrollAreaElement;
|
|
16
|
+
/** 0.1.268: `auto` não guarda a calha (a lista curta de um menu); o padrão `stable` guarda. */
|
|
17
|
+
gutter?: SelectScrollGutter;
|
|
14
18
|
};
|
|
15
19
|
export type SelectScrollAreaProps = SelectScrollAreaOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectScrollAreaOwnProps>;
|
|
16
|
-
/** As classes da área: a `.select-scroll` com o eixo e, sem a barra, o `--nobar`. */
|
|
17
|
-
export declare function selectScrollClass(axis?: SelectScrollAxis, hideBar?: boolean): string;
|
|
20
|
+
/** As classes da área: a `.select-scroll` com o eixo, a calha sem guardar (`--autogutter`) e, sem a barra, o `--nobar`. */
|
|
21
|
+
export declare function selectScrollClass(axis?: SelectScrollAxis, hideBar?: boolean, gutter?: SelectScrollGutter): string;
|
|
18
22
|
export declare const SelectScrollArea: import('react').ForwardRefExoticComponent<SelectScrollAreaOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectScrollAreaOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
|
|
19
23
|
export {};
|
package/dist/SelectScrollArea.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { forwardRef as e } from "react";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
//#region src/SelectScrollArea.tsx
|
|
4
|
-
function n(e = "y", t = !1) {
|
|
5
|
-
return `select-scroll select-scroll--${e}${t ? " select-scroll--nobar" : ""}`;
|
|
4
|
+
function n(e = "y", t = !1, n = "stable") {
|
|
5
|
+
return `select-scroll select-scroll--${e}${n === "auto" && e !== "x" ? " select-scroll--autogutter" : ""}${t ? " select-scroll--nobar" : ""}`;
|
|
6
6
|
}
|
|
7
|
-
var r = e(function({ axis: e = "y", hideBar: r = !1, label: i, as: a = "div",
|
|
7
|
+
var r = e(function({ axis: e = "y", hideBar: r = !1, label: i, as: a = "div", gutter: o = "stable", className: s, children: c, ...l }, u) {
|
|
8
8
|
return /* @__PURE__ */ t(a, {
|
|
9
|
-
ref:
|
|
9
|
+
ref: u,
|
|
10
10
|
...i ? {
|
|
11
11
|
role: "region",
|
|
12
12
|
"aria-label": i,
|
|
13
13
|
tabIndex: 0
|
|
14
14
|
} : null,
|
|
15
|
-
...
|
|
16
|
-
className: `${n(e, r)}${
|
|
17
|
-
children:
|
|
15
|
+
...l,
|
|
16
|
+
className: `${n(e, r, o)}${s ? ` ${s}` : ""}`,
|
|
17
|
+
children: c
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
20
|
//#endregion
|
package/dist/SelectTable.d.ts
CHANGED
|
@@ -77,6 +77,14 @@ type SelectTableOwnProps = {
|
|
|
77
77
|
* separados por linhas de 1px.
|
|
78
78
|
*/
|
|
79
79
|
flush?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* 0.1.268: a tabela SEM MOLDURA, no meio de outro conteúdo do corpo de um cartão (o texto, uma lista de detalhes, outra
|
|
82
|
+
* tabela). Sem ela, a tabela de dentro do corpo perde a casca cinza mas segue com a caixa branca e a borda das linhas — a
|
|
83
|
+
* moldura dobrada. Com ela, o cabeçalho das colunas, um filete embaixo dele e um entre as linhas, sem a caixa, a primeira
|
|
84
|
+
* coluna alinhada com o texto do corpo. Quando a tabela é o conteúdo inteiro do cartão, a moldura é a da lista
|
|
85
|
+
* (`SelectSection list`), não esta. Não vale com `flush` (a região de uma superfície seccionada).
|
|
86
|
+
*/
|
|
87
|
+
bare?: boolean;
|
|
80
88
|
/**
|
|
81
89
|
* 0.1.213: o nome da tabela para o leitor de tela (a grade é `role="table"`). Sem ele, o nome é o `title` quando o
|
|
82
90
|
* `title` é texto.
|