@selectwin/kit 0.1.267 → 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 +14 -0
- package/dist/SelectDateField.js +112 -145
- package/dist/SelectField.d.ts +4 -0
- package/dist/SelectLocale.d.ts +40 -0
- package/dist/SelectLocale.js +137 -41
- 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/index.d.ts +3 -1
- package/dist/index.js +17 -16
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -306,6 +306,20 @@ o rodapé preso embaixo com o "Enviar" na ponta direita), com o `above` do `Sele
|
|
|
306
306
|
acima do rodapé; e `narrow` (`'auto'` ou `true`) no `variant="chat"` é o modo estreito: abaixo de 27rem da largura do
|
|
307
307
|
próprio compositor, o campo sobe para a linha de cima e as ferramentas ficam embaixo, e a dica do campo não quebra.
|
|
308
308
|
|
|
309
|
+
Os ajustes da varredura visual e a mesma barra de rolagem em tudo (0.1.268). O campo de um mês, `SelectMonthField`
|
|
310
|
+
(`value` e `onChange` em `'AAAA-MM'`, `min?`, `max?`, `label`, `placeholder`, `required`, `disabled`, `error`, `hint`,
|
|
311
|
+
`clearable?`, `name?`): o mês na língua do `SelectLocaleProvider` ("dezembro de 2026" / "December 2026"), na grade dos
|
|
312
|
+
doze meses do `SelectDateField` (o rótulo do ano abre a grade dos anos; os meses fora do `min`/`max` apagados; o "Este
|
|
313
|
+
mês" e o "Limpar"), no lugar do `<input type="month">`, que segue a língua do navegador e não a do app. O
|
|
314
|
+
`SelectDateField` também passa a seguir o provider (os dias, os meses, as setas, o pé e a ordem da data); sem provider, o
|
|
315
|
+
português de sempre. O título do cartão, da tabela e da lista lê a base e o piso de dois tokens, `--select-heading-basis`
|
|
316
|
+
(padrão `12rem`) e `--select-heading-min` (padrão `0`): sem eles nada muda; com `0px` e `min-content`, a ação fica na
|
|
317
|
+
linha do título sempre que a palavra mais longa do título cabe ao lado dela. A tabela sem moldura, `SelectTable bare`,
|
|
318
|
+
para o meio de outro conteúdo do corpo de um cartão ou de um modal: o cabeçalho das colunas e os filetes, sem a caixa
|
|
319
|
+
branca com a borda. Toda peça do kit que rola desenha a barra do scroll padrão (a fina, no polegar do token, também no
|
|
320
|
+
WebKit), pela regra `:where([class*='select-'])`, sem peso: a peça que esconde a barra continua escondendo. E o
|
|
321
|
+
`SelectScrollArea gutter="auto"` não guarda a calha (a lista curta de um menu).
|
|
322
|
+
|
|
309
323
|
## Build
|
|
310
324
|
|
|
311
325
|
```bash
|
package/dist/SelectDateField.js
CHANGED
|
@@ -1,235 +1,202 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import { SelectButton as e } from "./SelectButton.js";
|
|
3
3
|
import { CalendarIcon as t, ChevronDownIcon as n, ChevronLeftIcon as r, ChevronRightIcon as i } from "./icons.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { useSelectMessages as a } from "./SelectLocale.js";
|
|
5
|
+
import { SelectLabelRow as o } from "./SelectField.js";
|
|
6
|
+
import { SelectPopover as ee } from "./SelectPopover.js";
|
|
7
|
+
import { forwardRef as s, useId as c, useState as l } from "react";
|
|
8
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
9
|
//#region src/SelectDateField.tsx
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
"Seg",
|
|
12
|
-
"Ter",
|
|
13
|
-
"Qua",
|
|
14
|
-
"Qui",
|
|
15
|
-
"Sex",
|
|
16
|
-
"Sáb"
|
|
17
|
-
], f = [
|
|
18
|
-
"Janeiro",
|
|
19
|
-
"Fevereiro",
|
|
20
|
-
"Março",
|
|
21
|
-
"Abril",
|
|
22
|
-
"Maio",
|
|
23
|
-
"Junho",
|
|
24
|
-
"Julho",
|
|
25
|
-
"Agosto",
|
|
26
|
-
"Setembro",
|
|
27
|
-
"Outubro",
|
|
28
|
-
"Novembro",
|
|
29
|
-
"Dezembro"
|
|
30
|
-
], p = [
|
|
31
|
-
"Jan",
|
|
32
|
-
"Fev",
|
|
33
|
-
"Mar",
|
|
34
|
-
"Abr",
|
|
35
|
-
"Mai",
|
|
36
|
-
"Jun",
|
|
37
|
-
"Jul",
|
|
38
|
-
"Ago",
|
|
39
|
-
"Set",
|
|
40
|
-
"Out",
|
|
41
|
-
"Nov",
|
|
42
|
-
"Dez"
|
|
43
|
-
], m = 12, h = (e) => String(e).padStart(2, "0"), g = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), _ = (e) => new Date(e.getFullYear(), e.getMonth(), 1), v = (e, t) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + t), y = (e, t) => new Date(e.getFullYear(), e.getMonth() + t, 1), b = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
44
|
-
function x(e) {
|
|
10
|
+
var f = 12, p = (e) => String(e).padStart(2, "0"), m = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), h = (e) => new Date(e.getFullYear(), e.getMonth(), 1), g = (e, t) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + t), te = (e, t) => new Date(e.getFullYear(), e.getMonth() + t, 1), _ = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
11
|
+
function ne(e) {
|
|
45
12
|
let t = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}))?/.exec(e || "");
|
|
46
13
|
return t ? new Date(Number(t[1]), Number(t[2]) - 1, Number(t[3]), Number(t[4] ?? 0), Number(t[5] ?? 0)) : null;
|
|
47
14
|
}
|
|
48
|
-
function
|
|
49
|
-
let n = `${e.getFullYear()}-${
|
|
50
|
-
return t ? `${n}T${
|
|
15
|
+
function v(e, t) {
|
|
16
|
+
let n = `${e.getFullYear()}-${p(e.getMonth() + 1)}-${p(e.getDate())}`;
|
|
17
|
+
return t ? `${n}T${p(e.getHours())}:${p(e.getMinutes())}` : n;
|
|
51
18
|
}
|
|
52
|
-
function
|
|
53
|
-
let
|
|
54
|
-
return t ? `${
|
|
19
|
+
function y(e, t, n) {
|
|
20
|
+
let r = n.date(e.getFullYear(), e.getMonth() + 1, e.getDate());
|
|
21
|
+
return t ? `${r} ${p(e.getHours())}:${p(e.getMinutes())}` : r;
|
|
55
22
|
}
|
|
56
|
-
var
|
|
57
|
-
let
|
|
58
|
-
if (
|
|
23
|
+
var b = s(function({ label: s, value: b, onChange: x, showTime: S = !1, placeholder: C, required: w, disabled: T, error: E, hint: D, minDate: O, maxDate: k, clearable: re = !0, openTo: ie = "day", id: ae, className: A, ...j }, M) {
|
|
24
|
+
let N = c(), P = ae ?? N, F = a().dateField, [I, L] = l(!1), R = ne(b), z = O ? m(O) : null, B = k ? m(k) : null, V = (e) => !!z && m(e) < z || !!B && m(e) > B, H = () => {
|
|
25
|
+
if (R) return R;
|
|
59
26
|
let e = /* @__PURE__ */ new Date();
|
|
60
|
-
return
|
|
61
|
-
}, [
|
|
62
|
-
|
|
63
|
-
}, Z = (e) =>
|
|
64
|
-
if (
|
|
27
|
+
return B && e > B ? B : z && e < z ? z : e;
|
|
28
|
+
}, [U, W] = l(() => h(H())), [G, K] = l("day"), q = (e) => !!z && e < z.getFullYear() || !!B && e > B.getFullYear(), oe = (e, t) => !!z && new Date(e, t + 1, 0) < z || !!B && new Date(e, t, 1) > B, J = U.getFullYear() - U.getFullYear() % f, se = g(h(U), -h(U).getDay()), ce = Array.from({ length: 42 }, (e, t) => g(se, t)), Y = m(/* @__PURE__ */ new Date()), X = () => {
|
|
29
|
+
T || (W(h(H())), K(!R && ie === "year" ? "year" : "day"), L((e) => !e));
|
|
30
|
+
}, Z = (e) => W((t) => G === "day" ? te(t, e) : new Date(t.getFullYear() + e * (G === "year" ? f : 1), t.getMonth(), 1)), Q = G === "day" ? [F.prevMonth, F.nextMonth] : G === "month" ? [F.prevYear, F.nextYear] : [F.prevYears, F.nextYears], $ = (e) => {
|
|
31
|
+
if (V(e)) return;
|
|
65
32
|
let t = new Date(e);
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
let [t = "", n = ""] = e.split(":"), r = Number(t), i = Number(n), a = new Date(
|
|
69
|
-
a.setHours(Number.isFinite(r) ? r : 0, Number.isFinite(i) ? i : 0, 0, 0),
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
className: `select-input-wrap${
|
|
74
|
-
children: [/* @__PURE__ */
|
|
75
|
-
id:
|
|
33
|
+
S && t.setHours((R == null ? void 0 : R.getHours()) ?? 0, (R == null ? void 0 : R.getMinutes()) ?? 0, 0, 0), x(v(t, S)), S || L(!1);
|
|
34
|
+
}, le = (e) => {
|
|
35
|
+
let [t = "", n = ""] = e.split(":"), r = Number(t), i = Number(n), a = new Date(R ?? Y);
|
|
36
|
+
a.setHours(Number.isFinite(r) ? r : 0, Number.isFinite(i) ? i : 0, 0, 0), x(v(a, !0));
|
|
37
|
+
}, ue = () => {
|
|
38
|
+
x(""), L(!1);
|
|
39
|
+
}, de = /* @__PURE__ */ d("div", {
|
|
40
|
+
className: `select-input-wrap${E ? " select-input-wrap--error" : ""}`,
|
|
41
|
+
children: [/* @__PURE__ */ u("button", {
|
|
42
|
+
id: P,
|
|
76
43
|
type: "button",
|
|
77
|
-
className: `select-input select-datefield__activator${
|
|
78
|
-
onClick:
|
|
79
|
-
disabled:
|
|
44
|
+
className: `select-input select-datefield__activator${E ? " select-input--error" : ""}`,
|
|
45
|
+
onClick: X,
|
|
46
|
+
disabled: T,
|
|
80
47
|
"aria-haspopup": "dialog",
|
|
81
|
-
"aria-expanded":
|
|
82
|
-
"aria-invalid":
|
|
83
|
-
children:
|
|
48
|
+
"aria-expanded": I,
|
|
49
|
+
"aria-invalid": E ? !0 : void 0,
|
|
50
|
+
children: R ? y(R, S, F) : /* @__PURE__ */ u("span", {
|
|
84
51
|
className: "select-datefield__ph",
|
|
85
|
-
children:
|
|
52
|
+
children: C ?? (S ? F.dateTimePlaceholder : F.datePlaceholder)
|
|
86
53
|
})
|
|
87
|
-
}), /* @__PURE__ */
|
|
54
|
+
}), /* @__PURE__ */ u("span", {
|
|
88
55
|
className: "select-datefield__icon",
|
|
89
56
|
"aria-hidden": "true",
|
|
90
|
-
children: /* @__PURE__ */
|
|
57
|
+
children: /* @__PURE__ */ u(t, {})
|
|
91
58
|
})]
|
|
92
59
|
});
|
|
93
|
-
return /* @__PURE__ */
|
|
94
|
-
ref:
|
|
95
|
-
...
|
|
96
|
-
className: `select-field${
|
|
60
|
+
return /* @__PURE__ */ d("div", {
|
|
61
|
+
ref: M,
|
|
62
|
+
...j,
|
|
63
|
+
className: `select-field${A ? " " + A : ""}`,
|
|
97
64
|
children: [
|
|
98
|
-
s && /* @__PURE__ */
|
|
99
|
-
htmlFor:
|
|
100
|
-
label:
|
|
65
|
+
s && /* @__PURE__ */ u(o, {
|
|
66
|
+
htmlFor: P,
|
|
67
|
+
label: w ? `${s} *` : s
|
|
101
68
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ u("div", {
|
|
103
70
|
className: "select-datefield",
|
|
104
|
-
children: /* @__PURE__ */
|
|
105
|
-
active:
|
|
106
|
-
onClose: () =>
|
|
71
|
+
children: /* @__PURE__ */ u(ee, {
|
|
72
|
+
active: I,
|
|
73
|
+
onClose: () => L(!1),
|
|
107
74
|
placement: "bottom-start",
|
|
108
75
|
role: "dialog",
|
|
109
|
-
activator:
|
|
110
|
-
children: /* @__PURE__ */
|
|
76
|
+
activator: de,
|
|
77
|
+
children: /* @__PURE__ */ d("div", {
|
|
111
78
|
className: "select-datefield__pop",
|
|
112
79
|
children: [
|
|
113
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ d("div", {
|
|
114
81
|
className: "select-datepicker__calhead",
|
|
115
82
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ u("button", {
|
|
117
84
|
type: "button",
|
|
118
85
|
className: "select-datepicker__nav",
|
|
119
86
|
"aria-label": Q[0],
|
|
120
87
|
onClick: () => Z(-1),
|
|
121
|
-
children: /* @__PURE__ */
|
|
88
|
+
children: /* @__PURE__ */ u(r, {})
|
|
122
89
|
}),
|
|
123
|
-
|
|
90
|
+
G === "year" ? /* @__PURE__ */ d("span", {
|
|
124
91
|
className: "select-datepicker__monthlabel",
|
|
125
92
|
children: [
|
|
126
93
|
J,
|
|
127
94
|
" – ",
|
|
128
|
-
J +
|
|
95
|
+
J + f - 1
|
|
129
96
|
]
|
|
130
|
-
}) : /* @__PURE__ */
|
|
97
|
+
}) : /* @__PURE__ */ d("button", {
|
|
131
98
|
type: "button",
|
|
132
99
|
className: "select-datepicker__monthlabel select-datefield__modebtn",
|
|
133
|
-
"aria-label":
|
|
134
|
-
onClick: () =>
|
|
135
|
-
children: [
|
|
100
|
+
"aria-label": G === "day" ? F.pickYearMonth : F.pickYear,
|
|
101
|
+
onClick: () => K("year"),
|
|
102
|
+
children: [G === "day" ? F.monthTitle(U.getMonth() + 1, U.getFullYear()) : U.getFullYear(), /* @__PURE__ */ u(n, {})]
|
|
136
103
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ u("button", {
|
|
138
105
|
type: "button",
|
|
139
106
|
className: "select-datepicker__nav",
|
|
140
107
|
"aria-label": Q[1],
|
|
141
108
|
onClick: () => Z(1),
|
|
142
|
-
children: /* @__PURE__ */
|
|
109
|
+
children: /* @__PURE__ */ u(i, {})
|
|
143
110
|
})
|
|
144
111
|
]
|
|
145
112
|
}),
|
|
146
|
-
|
|
113
|
+
G === "year" && /* @__PURE__ */ u("div", {
|
|
147
114
|
className: "select-datefield__cells",
|
|
148
115
|
role: "grid",
|
|
149
|
-
"aria-label":
|
|
150
|
-
children: Array.from({ length:
|
|
151
|
-
let t = (
|
|
152
|
-
return /* @__PURE__ */
|
|
116
|
+
"aria-label": F.years,
|
|
117
|
+
children: Array.from({ length: f }, (e, t) => J + t).map((e) => {
|
|
118
|
+
let t = (R == null ? void 0 : R.getFullYear()) === e;
|
|
119
|
+
return /* @__PURE__ */ u("button", {
|
|
153
120
|
type: "button",
|
|
154
|
-
className: `select-datefield__cell${t ? " is-selected" : ""}${e ===
|
|
155
|
-
disabled:
|
|
121
|
+
className: `select-datefield__cell${t ? " is-selected" : ""}${e === Y.getFullYear() && !t ? " is-today" : ""}`,
|
|
122
|
+
disabled: q(e),
|
|
156
123
|
onClick: () => {
|
|
157
|
-
|
|
124
|
+
W(new Date(e, U.getMonth(), 1)), K("month");
|
|
158
125
|
},
|
|
159
126
|
children: e
|
|
160
127
|
}, e);
|
|
161
128
|
})
|
|
162
129
|
}),
|
|
163
|
-
|
|
130
|
+
G === "month" && /* @__PURE__ */ u("div", {
|
|
164
131
|
className: "select-datefield__cells",
|
|
165
132
|
role: "grid",
|
|
166
|
-
"aria-label":
|
|
167
|
-
children:
|
|
168
|
-
let n =
|
|
169
|
-
return /* @__PURE__ */
|
|
133
|
+
"aria-label": F.monthsOf(U.getFullYear()),
|
|
134
|
+
children: F.monthsShort.map((e, t) => {
|
|
135
|
+
let n = U.getFullYear(), r = !!R && R.getFullYear() === n && R.getMonth() === t;
|
|
136
|
+
return /* @__PURE__ */ u("button", {
|
|
170
137
|
type: "button",
|
|
171
|
-
"aria-label":
|
|
138
|
+
"aria-label": F.monthCell(t + 1, n),
|
|
172
139
|
className: `select-datefield__cell${r ? " is-selected" : ""}`,
|
|
173
|
-
disabled:
|
|
140
|
+
disabled: oe(n, t),
|
|
174
141
|
onClick: () => {
|
|
175
|
-
|
|
142
|
+
W(new Date(n, t, 1)), K("day");
|
|
176
143
|
},
|
|
177
144
|
children: e
|
|
178
145
|
}, e);
|
|
179
146
|
})
|
|
180
147
|
}),
|
|
181
|
-
|
|
148
|
+
G === "day" && /* @__PURE__ */ d("div", {
|
|
182
149
|
className: "select-datepicker__grid",
|
|
183
150
|
role: "grid",
|
|
184
|
-
children: [
|
|
151
|
+
children: [F.weekdays.map((e) => /* @__PURE__ */ u("div", {
|
|
185
152
|
className: "select-datepicker__weekday",
|
|
186
153
|
children: e
|
|
187
|
-
}, e)),
|
|
188
|
-
let t = e.getMonth() !==
|
|
189
|
-
return /* @__PURE__ */
|
|
154
|
+
}, e)), ce.map((e) => {
|
|
155
|
+
let t = e.getMonth() !== U.getMonth(), n = !!R && _(e, R), r = "select-datepicker__daybtn" + (n ? " is-selected" : "") + (_(e, Y) && !n ? " is-today" : "") + (t ? " is-outside" : "");
|
|
156
|
+
return /* @__PURE__ */ u("div", {
|
|
190
157
|
className: "select-datepicker__day",
|
|
191
|
-
children: /* @__PURE__ */
|
|
158
|
+
children: /* @__PURE__ */ u("button", {
|
|
192
159
|
type: "button",
|
|
193
160
|
className: r,
|
|
194
|
-
disabled:
|
|
161
|
+
disabled: V(e),
|
|
195
162
|
onClick: () => $(e),
|
|
196
163
|
children: e.getDate()
|
|
197
164
|
})
|
|
198
165
|
}, e.getTime());
|
|
199
166
|
})]
|
|
200
167
|
}),
|
|
201
|
-
|
|
168
|
+
S && /* @__PURE__ */ d("div", {
|
|
202
169
|
className: "select-datefield__time",
|
|
203
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ u("span", {
|
|
204
171
|
className: "select-datefield__time-label",
|
|
205
|
-
children:
|
|
206
|
-
}), /* @__PURE__ */
|
|
172
|
+
children: F.time
|
|
173
|
+
}), /* @__PURE__ */ u("input", {
|
|
207
174
|
type: "time",
|
|
208
175
|
className: "select-input select-datefield__time-input",
|
|
209
|
-
"aria-label":
|
|
210
|
-
value:
|
|
211
|
-
onChange: (e) =>
|
|
176
|
+
"aria-label": F.time,
|
|
177
|
+
value: R ? `${p(R.getHours())}:${p(R.getMinutes())}` : "",
|
|
178
|
+
onChange: (e) => le(e.target.value)
|
|
212
179
|
})]
|
|
213
180
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ d("div", {
|
|
215
182
|
className: "select-datefield__footer",
|
|
216
|
-
children: [re &&
|
|
183
|
+
children: [re && R ? /* @__PURE__ */ u(e, {
|
|
217
184
|
variant: "secondary",
|
|
218
185
|
inline: !0,
|
|
219
|
-
onClick:
|
|
220
|
-
children:
|
|
221
|
-
}) : /* @__PURE__ */
|
|
186
|
+
onClick: ue,
|
|
187
|
+
children: F.clear
|
|
188
|
+
}) : /* @__PURE__ */ u("span", {}), /* @__PURE__ */ d("div", {
|
|
222
189
|
className: "select-datefield__footer-right",
|
|
223
|
-
children: [!
|
|
190
|
+
children: [!V(Y) && /* @__PURE__ */ u(e, {
|
|
224
191
|
variant: "secondary",
|
|
225
192
|
inline: !0,
|
|
226
|
-
onClick: () => $(
|
|
227
|
-
children:
|
|
228
|
-
}),
|
|
193
|
+
onClick: () => $(Y),
|
|
194
|
+
children: F.today
|
|
195
|
+
}), S && /* @__PURE__ */ u(e, {
|
|
229
196
|
variant: "primary",
|
|
230
197
|
inline: !0,
|
|
231
|
-
onClick: () =>
|
|
232
|
-
children:
|
|
198
|
+
onClick: () => L(!1),
|
|
199
|
+
children: F.done
|
|
233
200
|
})]
|
|
234
201
|
})]
|
|
235
202
|
})
|
|
@@ -237,19 +204,19 @@ var w = s(function({ label: s, value: w, onChange: T, showTime: E = !1, placehol
|
|
|
237
204
|
})
|
|
238
205
|
})
|
|
239
206
|
}),
|
|
240
|
-
|
|
241
|
-
id: `${
|
|
207
|
+
E ? /* @__PURE__ */ u("p", {
|
|
208
|
+
id: `${P}-err`,
|
|
242
209
|
className: "select-field__error",
|
|
243
|
-
children:
|
|
244
|
-
}) :
|
|
245
|
-
id: `${
|
|
210
|
+
children: E
|
|
211
|
+
}) : D ? /* @__PURE__ */ u("p", {
|
|
212
|
+
id: `${P}-hint`,
|
|
246
213
|
className: "select-field__hint",
|
|
247
|
-
children:
|
|
214
|
+
children: D
|
|
248
215
|
}) : null
|
|
249
216
|
]
|
|
250
217
|
});
|
|
251
218
|
});
|
|
252
219
|
//#endregion
|
|
253
|
-
export {
|
|
220
|
+
export { b as SelectDateField };
|
|
254
221
|
|
|
255
222
|
//# sourceMappingURL=SelectDateField.js.map
|
package/dist/SelectField.d.ts
CHANGED
|
@@ -34,6 +34,10 @@ export interface SelectFieldProps {
|
|
|
34
34
|
value: string;
|
|
35
35
|
/** O valor novo e, desde a 0.1.198, o evento nativo (ausente quando quem muda é o passo do número). */
|
|
36
36
|
onChange: (value: string, event?: ChangeEvent<HTMLInputElement>) => void;
|
|
37
|
+
/**
|
|
38
|
+
* O tipo do `<input>`. Os de data (`date`, `datetime-local`, `month`, `week`) abrem o seletor do NAVEGADOR, que fala a
|
|
39
|
+
* língua do navegador e não a do app: para o mês, o `SelectMonthField` (0.1.268); para a data, o `SelectDateField`.
|
|
40
|
+
*/
|
|
37
41
|
type?: 'text' | 'email' | 'password' | 'url' | 'tel' | 'date' | 'datetime-local' | 'number' | 'search' | 'time' | 'month' | 'week';
|
|
38
42
|
/** 0.1.198: o "(opcional)" depois do rótulo. */
|
|
39
43
|
optional?: boolean;
|
package/dist/SelectLocale.d.ts
CHANGED
|
@@ -525,6 +525,46 @@ export interface SelectKitMessages {
|
|
|
525
525
|
endOption: (time: string, duration: string) => string;
|
|
526
526
|
done: string;
|
|
527
527
|
};
|
|
528
|
+
/**
|
|
529
|
+
* 0.1.268: o campo de uma data (`SelectDateField`) e o de um mês (`SelectMonthField`, novo), na língua do provider. Antes o
|
|
530
|
+
* campo da data era fixo em português, e o mês era o `<input type="month">` do navegador, que segue a língua do
|
|
531
|
+
* navegador e não a do app ("December 2026" num painel em português). O português é o de sempre do `SelectDateField`.
|
|
532
|
+
*/
|
|
533
|
+
dateField: {
|
|
534
|
+
/** Os dias curtos da grade, de domingo a sábado. */
|
|
535
|
+
weekdays: readonly [string, string, string, string, string, string, string];
|
|
536
|
+
/** O nome do mês (de janeiro a dezembro), o do título da grade dos dias ("Novembro 2026"). */
|
|
537
|
+
months: readonly string[];
|
|
538
|
+
/** O nome curto do mês, o da grade dos meses ("Nov"). */
|
|
539
|
+
monthsShort: readonly string[];
|
|
540
|
+
/** O título da grade dos dias; `month` de 1 a 12. */
|
|
541
|
+
monthTitle: (month: number, year: number) => string;
|
|
542
|
+
/** O mês escolhido no campo ("novembro de 2026"); `month` de 1 a 12. */
|
|
543
|
+
monthValue: (month: number, year: number) => string;
|
|
544
|
+
/** O nome de um mês da grade para o leitor de tela ("Novembro de 2026"); `month` de 1 a 12. */
|
|
545
|
+
monthCell: (month: number, year: number) => string;
|
|
546
|
+
/** A data do campo ("25/11/2026"); `month` de 1 a 12. */
|
|
547
|
+
date: (year: number, month: number, day: number) => string;
|
|
548
|
+
datePlaceholder: string;
|
|
549
|
+
dateTimePlaceholder: string;
|
|
550
|
+
monthPlaceholder: string;
|
|
551
|
+
prevMonth: string;
|
|
552
|
+
nextMonth: string;
|
|
553
|
+
prevYear: string;
|
|
554
|
+
nextYear: string;
|
|
555
|
+
prevYears: string;
|
|
556
|
+
nextYears: string;
|
|
557
|
+
pickYearMonth: string;
|
|
558
|
+
pickYear: string;
|
|
559
|
+
years: string;
|
|
560
|
+
/** A grade dos meses de um ano ("Meses de 2026"). */
|
|
561
|
+
monthsOf: (year: number) => string;
|
|
562
|
+
time: string;
|
|
563
|
+
clear: string;
|
|
564
|
+
today: string;
|
|
565
|
+
thisMonth: string;
|
|
566
|
+
done: string;
|
|
567
|
+
};
|
|
528
568
|
}
|
|
529
569
|
/** Os dicionários do kit, para quem quer conferir ou montar um texto do mesmo jeito. */
|
|
530
570
|
export declare const selectKitMessages: Readonly<Record<SelectLocaleCode, SelectKitMessages>>;
|