@nubisco/ui 5.12.0 → 5.13.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.
Files changed (62) hide show
  1. package/dist/Badge-BgCdM21g.cjs +1 -0
  2. package/dist/Badge-CfXOTEnO.js +59 -0
  3. package/dist/DatePicker-B_lnTkqz.cjs +1 -0
  4. package/dist/DatePicker-DcWyOduI.js +704 -0
  5. package/dist/{Menu-Dy1JwMdl.js → Menu-CsA8dtMR.js} +6 -1
  6. package/dist/Menu-Xt1MCf-q.cjs +1 -0
  7. package/dist/{MenuBarItem-Ya88A6xZ.cjs → MenuBarItem-42bSEdWZ.cjs} +1 -1
  8. package/dist/{MenuBarItem-CYofbcgq.js → MenuBarItem-H1sFt0Mx.js} +1 -1
  9. package/dist/{Pagination-CcZB4Lp_.cjs → Pagination-BVqdCAar.cjs} +1 -1
  10. package/dist/{Pagination-DDIc4vUH.js → Pagination-DfE_VBmi.js} +1 -1
  11. package/dist/{Select-CB4BSCaj.js → Select-C4kly9iF.js} +77 -74
  12. package/dist/Select-CDaJcun8.cjs +1 -0
  13. package/dist/{Tabs-BPgmRLDi.cjs → Tabs-4-VnGh4i.cjs} +1 -1
  14. package/dist/{Tabs-DseHSwTm.js → Tabs-q8dnIAkO.js} +2 -2
  15. package/dist/all.cjs +1 -1
  16. package/dist/all.mjs +7 -7
  17. package/dist/component-styles.json +2 -1
  18. package/dist/components/Badge.cjs +1 -1
  19. package/dist/components/Badge.d.ts +18 -0
  20. package/dist/components/Badge.mjs +1 -1
  21. package/dist/components/Badge.vue.d.ts +5 -2
  22. package/dist/components/Badge.vue.d.ts.map +1 -1
  23. package/dist/components/DatePicker.cjs +1 -1
  24. package/dist/components/DatePicker.mjs +1 -1
  25. package/dist/components/DatePicker.vue.d.ts +1 -1
  26. package/dist/components/DatePicker.vue.d.ts.map +1 -1
  27. package/dist/components/Menu.cjs +1 -1
  28. package/dist/components/Menu.mjs +1 -1
  29. package/dist/components/Menu.vue.d.ts.map +1 -1
  30. package/dist/components/MenuBarItem.cjs +1 -1
  31. package/dist/components/MenuBarItem.mjs +1 -1
  32. package/dist/components/NotificationCenter.vue.d.ts +1 -1
  33. package/dist/components/NotificationCenterItem.vue.d.ts +1 -1
  34. package/dist/components/NumberInput.vue.d.ts +1 -1
  35. package/dist/components/NumberInput.vue.d.ts.map +1 -1
  36. package/dist/components/Pagination.cjs +1 -1
  37. package/dist/components/Pagination.mjs +1 -1
  38. package/dist/components/Select.cjs +1 -1
  39. package/dist/components/Select.mjs +1 -1
  40. package/dist/components/Select.vue.d.ts +1 -1
  41. package/dist/components/Select.vue.d.ts.map +1 -1
  42. package/dist/components/Tabs.cjs +1 -1
  43. package/dist/components/Tabs.mjs +1 -1
  44. package/dist/components/Tabs.vue.d.ts.map +1 -1
  45. package/dist/components/TextInput.vue.d.ts +1 -1
  46. package/dist/components/TextInput.vue.d.ts.map +1 -1
  47. package/dist/composables/useMenuSurface.composable.cjs +1 -0
  48. package/dist/composables/useMenuSurface.composable.d.ts +14 -0
  49. package/dist/composables/useMenuSurface.composable.d.ts.map +1 -0
  50. package/dist/composables/useMenuSurface.composable.mjs +12 -0
  51. package/dist/index.cjs +1 -1
  52. package/dist/index.mjs +7 -7
  53. package/dist/styles/Badge.css +1 -1
  54. package/dist/styles/Tabs.css +1 -1
  55. package/dist/ui.css +2 -2
  56. package/package.json +1 -1
  57. package/dist/Badge-BOF-mQu9.cjs +0 -1
  58. package/dist/Badge-MPdaJamD.js +0 -30
  59. package/dist/DatePicker-DQJ31TUm.cjs +0 -1
  60. package/dist/DatePicker-htoxxlSw.js +0 -701
  61. package/dist/Menu-BSbPfsiE.cjs +0 -1
  62. package/dist/Select-BMamCNcN.cjs +0 -1
@@ -0,0 +1,704 @@
1
+ import { t as e } from "./Icon-rREAqsu0.js";
2
+ import { useSurfaceLayer as t } from "./composables/useSurfaceLayer.composable.mjs";
3
+ import { t as n } from "./Label-glcQoGCr.js";
4
+ import { t as r } from "./Message-Ciyc2nN6.js";
5
+ import { t as i } from "./Grid-CgUyhsw4.js";
6
+ import { useMenuSurface as a } from "./composables/useMenuSurface.composable.mjs";
7
+ import { Fragment as o, Teleport as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, mergeProps as ee, nextTick as g, normalizeClass as _, onBeforeUnmount as te, openBlock as v, ref as y, renderList as ne, renderSlot as re, toDisplayString as b, unref as x, useId as ie, watch as ae, withCtx as S, withModifiers as oe } from "vue";
8
+ import { regular as se } from "@nubisco/ui/icons/caret-right";
9
+ import { regular as C } from "@nubisco/ui/icons/calendar";
10
+ import { regular as ce } from "@nubisco/ui/icons/caret-double-left";
11
+ import { regular as le } from "@nubisco/ui/icons/caret-left";
12
+ import { regular as ue } from "@nubisco/ui/icons/caret-double-right";
13
+ //#region src/components/DatePicker.vue?vue&type=script&setup=true&lang.ts
14
+ var de = { class: "nb-date-picker__col" }, fe = [
15
+ "id",
16
+ "value",
17
+ "placeholder",
18
+ "disabled",
19
+ "readonly",
20
+ "required",
21
+ "name",
22
+ "aria-invalid",
23
+ "aria-describedby"
24
+ ], pe = ["disabled", "aria-label"], me = {
25
+ key: 0,
26
+ class: "nb-date-picker__col"
27
+ }, he = [
28
+ "id",
29
+ "value",
30
+ "placeholder",
31
+ "disabled",
32
+ "readonly",
33
+ "required",
34
+ "aria-invalid",
35
+ "aria-describedby"
36
+ ], ge = ["disabled", "aria-label"], _e = {
37
+ key: 0,
38
+ class: "nb-date-picker__inner-header"
39
+ }, ve = ["for"], ye = {
40
+ key: 0,
41
+ class: "nb-date-picker__asterisk",
42
+ "aria-hidden": "true"
43
+ }, be = { class: "nb-date-picker__fluid-row" }, xe = [
44
+ "id",
45
+ "value",
46
+ "placeholder",
47
+ "disabled",
48
+ "readonly",
49
+ "required",
50
+ "name",
51
+ "aria-invalid"
52
+ ], Se = ["disabled", "aria-label"], Ce = {
53
+ key: 0,
54
+ class: "nb-date-picker__inner-header"
55
+ }, we = ["for"], Te = {
56
+ key: 0,
57
+ class: "nb-date-picker__asterisk",
58
+ "aria-hidden": "true"
59
+ }, Ee = { class: "nb-date-picker__fluid-row" }, De = [
60
+ "id",
61
+ "value",
62
+ "placeholder",
63
+ "disabled",
64
+ "readonly",
65
+ "required",
66
+ "aria-invalid"
67
+ ], Oe = ["disabled", "aria-label"], ke = ["aria-label"], Ae = { class: "nb-date-picker__cal-header" }, je = ["id"], Me = ["aria-labelledby"], Ne = { class: "nb-date-picker__cal-weekdays" }, Pe = ["abbr"], Fe = ["aria-selected", "aria-disabled"], Ie = [
68
+ "tabindex",
69
+ "disabled",
70
+ "aria-label",
71
+ "data-date",
72
+ "onClick"
73
+ ], Le = /* @__PURE__ */ h({
74
+ inheritAttrs: !1,
75
+ __name: "DatePicker",
76
+ props: {
77
+ modelValue: { default: null },
78
+ type: { default: "single" },
79
+ endValue: { default: null },
80
+ min: { default: void 0 },
81
+ max: { default: void 0 },
82
+ weekStart: { default: 1 },
83
+ locale: { default: void 0 },
84
+ endPlaceholder: { default: "" },
85
+ endLabel: { default: "" },
86
+ endError: { default: "" },
87
+ endWarning: { default: "" },
88
+ disabledDates: {
89
+ type: [Array, Function],
90
+ default: void 0
91
+ },
92
+ readonly: {
93
+ type: Boolean,
94
+ default: !1
95
+ },
96
+ placeholder: { default: "" },
97
+ name: { default: "" },
98
+ disabled: {
99
+ type: Boolean,
100
+ default: !1
101
+ },
102
+ required: {
103
+ type: Boolean,
104
+ default: !1
105
+ },
106
+ id: { default: void 0 },
107
+ label: { default: "" },
108
+ error: { default: "" },
109
+ warning: { default: "" },
110
+ helper: { default: "" },
111
+ variant: { default: "default" },
112
+ size: { default: "md" }
113
+ },
114
+ emits: [
115
+ "update:modelValue",
116
+ "update:endValue",
117
+ "change"
118
+ ],
119
+ setup(h, { expose: Le, emit: Re }) {
120
+ let w = h, { layerProps: ze } = t({ overlay: !0 }), T = Re, Be = `nb-date-picker-${ie()}`, E = c(() => w.id ?? Be), Ve = c(() => `${E.value}-end`), He = c(() => `${E.value}-helper`), Ue = c(() => `${E.value}-message`), We = c(() => `${E.value}-end-message`), Ge = c(() => `${E.value}-cal-title`), D = y(null), Ke = c(() => D.value !== null), O = y(!1), k = y($(/* @__PURE__ */ new Date())), qe = y(null), A = y(null), j = y(null), M = y(null);
121
+ a(M);
122
+ let Je = y({
123
+ position: "fixed",
124
+ top: "0px",
125
+ left: "0px",
126
+ zIndex: "9999"
127
+ }), N = y("start"), P = c(() => w.locale || navigator.language || "pt-PT"), F = c(() => new Intl.DateTimeFormat(P.value).formatToParts(new Date(2e3, 0, 15)).map((e) => e.type === "day" ? "dd" : e.type === "month" ? "mm" : e.type === "year" ? "yyyy" : e.value).join(""));
128
+ function I(e) {
129
+ if (!e) return "";
130
+ let t = /* @__PURE__ */ new Date(e + "T00:00:00");
131
+ return isNaN(t.getTime()) ? e : t.toLocaleDateString(P.value);
132
+ }
133
+ function Ye(e) {
134
+ return (/* @__PURE__ */ new Date(e + "T00:00:00")).toLocaleDateString(P.value, {
135
+ weekday: "long",
136
+ year: "numeric",
137
+ month: "long",
138
+ day: "numeric"
139
+ });
140
+ }
141
+ let Xe = c(() => I(w.modelValue ?? null)), Ze = c(() => I(w.endValue ?? null)), L = c(() => w.error ? {
142
+ variant: "error",
143
+ text: w.error
144
+ } : w.warning ? {
145
+ variant: "warning",
146
+ text: w.warning
147
+ } : null), R = c(() => w.type === "range" ? w.endError ? {
148
+ variant: "error",
149
+ text: w.endError
150
+ } : w.endWarning ? {
151
+ variant: "warning",
152
+ text: w.endWarning
153
+ } : null : null), z = c(() => L.value ? L.value : w.helper ? {
154
+ variant: "helper",
155
+ text: w.helper
156
+ } : null), Qe = c(() => {
157
+ if (w.variant === "default") return L.value ? Ue.value : w.helper ? He.value : void 0;
158
+ }), $e = c(() => {
159
+ if (w.variant === "default") return R.value ? We.value : w.helper ? He.value : void 0;
160
+ }), et = c(() => w.type === "range" && !!w.endLabel), tt = c(() => w.endLabel || w.endPlaceholder);
161
+ function B(e) {
162
+ return w.min != null && e < w.min || w.max != null && e > w.max ? !0 : w.disabledDates ? typeof w.disabledDates == "function" ? w.disabledDates(e) : w.disabledDates.includes(e) : !1;
163
+ }
164
+ function nt(e) {
165
+ let t = e.trim();
166
+ if (!t) return null;
167
+ if (/^\d{4}-\d{2}-\d{2}$/.test(t)) {
168
+ let e = /* @__PURE__ */ new Date(t + "T00:00:00");
169
+ return isNaN(e.getTime()) ? null : t;
170
+ }
171
+ let n = new Date(t);
172
+ return isNaN(n.getTime()) ? null : $(n);
173
+ }
174
+ function rt(e) {
175
+ let t = e.target.value, n = nt(t);
176
+ n && B(n) || (n || t === "") && (T("update:modelValue", n), T("change", n));
177
+ }
178
+ function it(e) {
179
+ let t = e.target.value, n = nt(t);
180
+ n && B(n) || (n || t === "") && T("update:endValue", n);
181
+ }
182
+ function V(e) {
183
+ D.value = e.target === j.value ? "end" : "start", w.type !== "simple" && !w.readonly && (N.value = D.value, O.value ? at() : W());
184
+ }
185
+ function H() {
186
+ D.value = null;
187
+ }
188
+ function U(e) {
189
+ if (!(w.type === "simple" || w.readonly)) switch (e.key) {
190
+ case "Escape":
191
+ O.value && (G(), e.preventDefault());
192
+ break;
193
+ case "ArrowDown":
194
+ e.preventDefault(), O.value || W(), g(q);
195
+ break;
196
+ case "Enter":
197
+ O.value || (e.preventDefault(), W(), g(q));
198
+ break;
199
+ }
200
+ }
201
+ function at() {
202
+ let e = qe.value?.querySelectorAll(".nb-date-picker__input-wrapper");
203
+ if (!e?.length) return;
204
+ let t = (N.value === "end" && e.length > 1 ? e[1] : e[0]).getBoundingClientRect();
205
+ Je.value = {
206
+ position: "fixed",
207
+ top: `${t.bottom + 4}px`,
208
+ left: `${t.left}px`,
209
+ zIndex: "9999"
210
+ };
211
+ }
212
+ function W() {
213
+ if (w.disabled || w.readonly || w.type === "simple" || O.value) return;
214
+ O.value = !0;
215
+ let e = N.value === "end" && w.endValue ? w.endValue : w.modelValue, t = e ? /* @__PURE__ */ new Date(e + "T00:00:00") : /* @__PURE__ */ new Date();
216
+ Z.value = t.getFullYear(), Q.value = t.getMonth(), k.value = e || $(/* @__PURE__ */ new Date()), at();
217
+ }
218
+ function G() {
219
+ O.value && (O.value = !1, g(() => {
220
+ N.value === "end" && j.value ? j.value.focus() : A.value?.focus();
221
+ }));
222
+ }
223
+ function K() {
224
+ O.value ? G() : (N.value = "start", W(), g(q));
225
+ }
226
+ function q() {
227
+ g(() => {
228
+ (M.value?.querySelector(`[data-date="${k.value}"]`))?.focus();
229
+ });
230
+ }
231
+ function ot(e) {
232
+ B(e) || (w.type === "range" ? N.value === "start" ? (T("update:modelValue", e), T("change", e), N.value = "end", k.value = e, g(() => j.value?.focus())) : (w.modelValue && e < w.modelValue ? (T("update:endValue", w.modelValue), T("update:modelValue", e), T("change", e)) : T("update:endValue", e), G()) : (T("update:modelValue", e), T("change", e), G()));
233
+ }
234
+ function st(e) {
235
+ let t = /* @__PURE__ */ new Date(k.value + "T00:00:00"), n = !0;
236
+ switch (e.key) {
237
+ case "ArrowRight":
238
+ J(t, 1);
239
+ break;
240
+ case "ArrowLeft":
241
+ J(t, -1);
242
+ break;
243
+ case "ArrowDown":
244
+ J(t, 7);
245
+ break;
246
+ case "ArrowUp":
247
+ J(t, -7);
248
+ break;
249
+ case "Home":
250
+ ct(t, "start");
251
+ break;
252
+ case "End":
253
+ ct(t, "end");
254
+ break;
255
+ case "PageUp":
256
+ e.shiftKey ? Y(t, -12) : Y(t, -1);
257
+ break;
258
+ case "PageDown":
259
+ e.shiftKey ? Y(t, 12) : Y(t, 1);
260
+ break;
261
+ case "Enter":
262
+ case " ":
263
+ e.preventDefault(), ot(k.value);
264
+ return;
265
+ case "Escape":
266
+ G();
267
+ break;
268
+ case "Tab":
269
+ G();
270
+ return;
271
+ default: n = !1;
272
+ }
273
+ n && e.preventDefault();
274
+ }
275
+ function J(e, t) {
276
+ let n = new Date(e);
277
+ n.setDate(n.getDate() + t), lt(n);
278
+ }
279
+ function ct(e, t) {
280
+ let n = e.getDay();
281
+ w.weekStart === 1 && (n = n === 0 ? 6 : n - 1);
282
+ let r = t === "start" ? -n : 6 - n, i = new Date(e);
283
+ i.setDate(i.getDate() + r), lt(i);
284
+ }
285
+ function Y(e, t) {
286
+ let n = new Date(e);
287
+ n.setMonth(n.getMonth() + t), n.getDate() !== e.getDate() && n.setDate(0), lt(n);
288
+ }
289
+ function lt(e) {
290
+ let t = $(e);
291
+ w.min != null && t < w.min || w.max != null && t > w.max || (k.value = t, Z.value = e.getFullYear(), Q.value = e.getMonth(), q());
292
+ }
293
+ function ut(e) {
294
+ let t = e.target, n = qe.value?.contains(t) ?? !1, r = M.value?.contains(t) ?? !1;
295
+ !n && !r && G();
296
+ }
297
+ function X() {
298
+ O.value && at();
299
+ }
300
+ ae(O, (e) => {
301
+ e ? (document.addEventListener("mousedown", ut), window.addEventListener("scroll", X, !0), window.addEventListener("resize", X)) : (document.removeEventListener("mousedown", ut), window.removeEventListener("scroll", X, !0), window.removeEventListener("resize", X));
302
+ }), te(() => {
303
+ document.removeEventListener("mousedown", ut), window.removeEventListener("scroll", X, !0), window.removeEventListener("resize", X);
304
+ });
305
+ let Z = y((/* @__PURE__ */ new Date()).getFullYear()), Q = y((/* @__PURE__ */ new Date()).getMonth());
306
+ function dt(e) {
307
+ let t = Z.value * 12 + Q.value + e;
308
+ Z.value = Math.floor(t / 12), Q.value = (t % 12 + 12) % 12;
309
+ let n = (/* @__PURE__ */ new Date(k.value + "T00:00:00")).getDate(), r = new Date(Z.value, Q.value + 1, 0).getDate();
310
+ k.value = $(new Date(Z.value, Q.value, Math.min(n, r))), q();
311
+ }
312
+ let ft = () => dt(-1), pt = () => dt(1), mt = () => dt(-12), ht = () => dt(12), gt = c(() => {
313
+ let e = new Date(Z.value, Q.value, 1).toLocaleDateString(P.value, {
314
+ month: "long",
315
+ year: "numeric"
316
+ });
317
+ return e.charAt(0).toUpperCase() + e.slice(1);
318
+ }), _t = c(() => {
319
+ let e = [], t = new Date(2024, 0, w.weekStart === 0 ? 7 : 1);
320
+ for (let n = 0; n < 7; n++) {
321
+ let r = new Date(t);
322
+ r.setDate(t.getDate() + n);
323
+ let i = r.toLocaleDateString(P.value, { weekday: "narrow" }).toUpperCase(), a = r.toLocaleDateString(P.value, { weekday: "long" });
324
+ e.push({
325
+ narrow: i,
326
+ full: a.charAt(0).toUpperCase() + a.slice(1)
327
+ });
328
+ }
329
+ return e;
330
+ });
331
+ function $(e) {
332
+ return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
333
+ }
334
+ let vt = c(() => $(/* @__PURE__ */ new Date())), yt = c(() => {
335
+ let e = Z.value, t = Q.value, n = new Date(e, t, 1), r = new Date(e, t + 1, 0), i = n.getDay();
336
+ w.weekStart === 1 && (i = i === 0 ? 6 : i - 1);
337
+ let a = [], o = w.modelValue ?? null, s = w.endValue ?? null, c = o && s ? o < s ? o : s : null, l = o && s ? o < s ? s : o : null;
338
+ function u(e, t) {
339
+ let n = $(e);
340
+ return {
341
+ key: n,
342
+ date: n,
343
+ day: e.getDate(),
344
+ inMonth: t,
345
+ isToday: n === vt.value,
346
+ isSelected: n === o || n === s,
347
+ inRange: c != null && l != null && n > c && n < l,
348
+ isRangeStart: n === c && l != null,
349
+ isRangeEnd: n === l && c != null,
350
+ isDisabled: B(n)
351
+ };
352
+ }
353
+ for (let n = i - 1; n >= 0; n--) a.push(u(new Date(e, t, -n), !1));
354
+ for (let n = 1; n <= r.getDate(); n++) a.push(u(new Date(e, t, n), !0));
355
+ let d = 7 - a.length % 7;
356
+ if (d < 7) for (let n = 1; n <= d; n++) a.push(u(new Date(e, t + 1, n), !1));
357
+ return a;
358
+ }), bt = c(() => {
359
+ let e = [];
360
+ for (let t = 0; t < yt.value.length; t += 7) e.push(yt.value.slice(t, t + 7));
361
+ return e;
362
+ }), xt = c(() => [
363
+ "nb-date-picker",
364
+ `nb-date-picker--${w.variant}`,
365
+ `nb-date-picker--${w.size}`,
366
+ `nb-date-picker--${w.type}`,
367
+ {
368
+ "nb-date-picker--focused": Ke.value,
369
+ "nb-date-picker--open": O.value,
370
+ "nb-date-picker--error": !!w.error || !!w.endError,
371
+ "nb-date-picker--warning": !w.error && !w.endError && (!!w.warning || !!w.endWarning),
372
+ "nb-date-picker--disabled": w.disabled,
373
+ "nb-date-picker--readonly": w.readonly
374
+ }
375
+ ]), St = c(() => ({
376
+ "nb-date-picker__input-wrapper--focused": D.value === "start",
377
+ "nb-date-picker__input-wrapper--error": !!w.error,
378
+ "nb-date-picker__input-wrapper--warning": !w.error && !!w.warning,
379
+ "nb-date-picker__input-wrapper--disabled": w.disabled,
380
+ "nb-date-picker__input-wrapper--readonly": w.readonly
381
+ })), Ct = c(() => ({
382
+ "nb-date-picker__input-wrapper--focused": D.value === "end",
383
+ "nb-date-picker__input-wrapper--error": !!w.endError,
384
+ "nb-date-picker__input-wrapper--warning": !w.endError && !!w.endWarning,
385
+ "nb-date-picker__input-wrapper--disabled": w.disabled,
386
+ "nb-date-picker__input-wrapper--readonly": w.readonly
387
+ }));
388
+ return Le({
389
+ open: W,
390
+ close: G,
391
+ focus: () => A.value?.focus()
392
+ }), (t, a) => (v(), d(o, null, [f("div", {
393
+ ref_key: "rootRef",
394
+ ref: qe,
395
+ class: _(xt.value)
396
+ }, [h.variant === "default" ? (v(), d(o, { key: 0 }, [
397
+ t.$slots.label ? re(t.$slots, "label", { key: 0 }) : h.label && !et.value ? (v(), l(n, {
398
+ key: 1,
399
+ for: E.value,
400
+ required: h.required,
401
+ disabled: h.disabled
402
+ }, {
403
+ default: S(() => [p(b(h.label), 1)]),
404
+ _: 1
405
+ }, 8, [
406
+ "for",
407
+ "required",
408
+ "disabled"
409
+ ])) : u("", !0),
410
+ m(i, {
411
+ dir: "row",
412
+ gap: h.type === "range" ? "sm" : void 0,
413
+ class: "nb-date-picker__fields"
414
+ }, {
415
+ default: S(() => [f("div", de, [et.value && h.label ? (v(), l(n, {
416
+ key: 0,
417
+ for: E.value,
418
+ required: h.required,
419
+ disabled: h.disabled
420
+ }, {
421
+ default: S(() => [p(b(h.label), 1)]),
422
+ _: 1
423
+ }, 8, [
424
+ "for",
425
+ "required",
426
+ "disabled"
427
+ ])) : u("", !0), f("div", { class: _(["nb-date-picker__input-wrapper", St.value]) }, [f("input", ee({
428
+ id: E.value,
429
+ ref_key: "inputRef",
430
+ ref: A
431
+ }, t.$attrs, {
432
+ type: "text",
433
+ class: "nb-date-picker__field",
434
+ value: Xe.value,
435
+ placeholder: h.placeholder || F.value,
436
+ disabled: h.disabled,
437
+ readonly: h.readonly,
438
+ required: h.required,
439
+ name: h.name,
440
+ "aria-invalid": h.error ? !0 : void 0,
441
+ "aria-describedby": Qe.value,
442
+ onInput: a[0] ||= (e) => rt(e),
443
+ onFocus: V,
444
+ onBlur: H,
445
+ onKeydown: U
446
+ }), null, 16, fe), h.type === "simple" ? u("", !0) : (v(), d("button", {
447
+ key: 0,
448
+ type: "button",
449
+ class: "nb-date-picker__icon",
450
+ disabled: h.disabled || h.readonly,
451
+ tabindex: "-1",
452
+ "aria-label": h.modelValue ? `Change date, ${I(h.modelValue)}` : "Choose date",
453
+ onClick: K
454
+ }, [m(e, {
455
+ name: x(C),
456
+ size: 16
457
+ }, null, 8, ["name"])], 8, pe))], 2)]), h.type === "range" ? (v(), d("div", me, [et.value ? (v(), l(n, {
458
+ key: 0,
459
+ for: Ve.value,
460
+ required: h.required,
461
+ disabled: h.disabled
462
+ }, {
463
+ default: S(() => [p(b(h.endLabel), 1)]),
464
+ _: 1
465
+ }, 8, [
466
+ "for",
467
+ "required",
468
+ "disabled"
469
+ ])) : u("", !0), f("div", { class: _(["nb-date-picker__input-wrapper", Ct.value]) }, [f("input", {
470
+ id: Ve.value,
471
+ ref_key: "endInputRef",
472
+ ref: j,
473
+ type: "text",
474
+ class: "nb-date-picker__field",
475
+ value: Ze.value,
476
+ placeholder: h.endPlaceholder || F.value,
477
+ disabled: h.disabled,
478
+ readonly: h.readonly,
479
+ required: h.required,
480
+ "aria-invalid": h.endError ? !0 : void 0,
481
+ "aria-describedby": $e.value,
482
+ onInput: a[1] ||= (e) => it(e),
483
+ onFocus: V,
484
+ onBlur: H,
485
+ onKeydown: U
486
+ }, null, 40, he), f("button", {
487
+ type: "button",
488
+ class: "nb-date-picker__icon",
489
+ disabled: h.disabled || h.readonly,
490
+ tabindex: "-1",
491
+ "aria-label": h.endValue ? `Change end date, ${I(h.endValue)}` : "Choose end date",
492
+ onClick: K
493
+ }, [m(e, {
494
+ name: x(C),
495
+ size: 16
496
+ }, null, 8, ["name"])], 8, ge)], 2)])) : u("", !0)]),
497
+ _: 1
498
+ }, 8, ["gap"]),
499
+ L.value ? (v(), l(r, {
500
+ key: 2,
501
+ id: Ue.value,
502
+ variant: L.value.variant,
503
+ class: "nb-date-picker__message"
504
+ }, {
505
+ default: S(() => [p(b(L.value.text), 1)]),
506
+ _: 1
507
+ }, 8, ["id", "variant"])) : u("", !0),
508
+ R.value ? (v(), l(r, {
509
+ key: 3,
510
+ id: We.value,
511
+ variant: R.value.variant,
512
+ class: "nb-date-picker__message"
513
+ }, {
514
+ default: S(() => [p(b(R.value.text), 1)]),
515
+ _: 1
516
+ }, 8, ["id", "variant"])) : u("", !0),
517
+ !L.value && !R.value && h.helper ? (v(), l(r, {
518
+ key: 4,
519
+ id: He.value,
520
+ variant: "helper",
521
+ class: "nb-date-picker__message"
522
+ }, {
523
+ default: S(() => [p(b(h.helper), 1)]),
524
+ _: 1
525
+ }, 8, ["id"])) : u("", !0)
526
+ ], 64)) : h.variant === "fluid" ? (v(), l(i, {
527
+ key: 1,
528
+ dir: "row",
529
+ gap: h.type === "range" ? "sm" : void 0,
530
+ class: "nb-date-picker__fields"
531
+ }, {
532
+ default: S(() => [f("div", { class: _(["nb-date-picker__input-wrapper nb-date-picker__input-wrapper--fluid", St.value]) }, [h.label || t.$slots.label || z.value ? (v(), d("div", _e, [t.$slots.label ? re(t.$slots, "label", { key: 0 }) : (v(), d("label", {
533
+ key: 1,
534
+ for: E.value,
535
+ class: "nb-date-picker__inner-label"
536
+ }, [p(b(h.label) + " ", 1), h.required ? (v(), d("span", ye, "*")) : u("", !0)], 8, ve)), z.value ? (v(), l(r, {
537
+ key: 2,
538
+ variant: z.value.variant,
539
+ "icon-only": "",
540
+ class: "nb-date-picker__inner-message"
541
+ }, {
542
+ default: S(() => [p(b(z.value.text), 1)]),
543
+ _: 1
544
+ }, 8, ["variant"])) : u("", !0)])) : u("", !0), f("div", be, [f("input", ee({
545
+ id: E.value,
546
+ ref_key: "inputRef",
547
+ ref: A
548
+ }, t.$attrs, {
549
+ type: "text",
550
+ class: "nb-date-picker__field",
551
+ value: Xe.value,
552
+ placeholder: h.placeholder || F.value,
553
+ disabled: h.disabled,
554
+ readonly: h.readonly,
555
+ required: h.required,
556
+ name: h.name,
557
+ "aria-invalid": h.error ? !0 : void 0,
558
+ onInput: a[2] ||= (e) => rt(e),
559
+ onFocus: V,
560
+ onBlur: H,
561
+ onKeydown: U
562
+ }), null, 16, xe), h.type === "simple" ? u("", !0) : (v(), d("button", {
563
+ key: 0,
564
+ type: "button",
565
+ class: "nb-date-picker__icon",
566
+ disabled: h.disabled || h.readonly,
567
+ tabindex: "-1",
568
+ "aria-label": h.modelValue ? `Change date, ${I(h.modelValue)}` : "Choose date",
569
+ onClick: K
570
+ }, [m(e, {
571
+ name: x(C),
572
+ size: 16
573
+ }, null, 8, ["name"])], 8, Se))])], 2), h.type === "range" ? (v(), d("div", {
574
+ key: 0,
575
+ class: _(["nb-date-picker__input-wrapper nb-date-picker__input-wrapper--fluid", Ct.value])
576
+ }, [tt.value || R.value ? (v(), d("div", Ce, [f("label", {
577
+ for: Ve.value,
578
+ class: "nb-date-picker__inner-label"
579
+ }, [p(b(tt.value) + " ", 1), h.required ? (v(), d("span", Te, "*")) : u("", !0)], 8, we), R.value ? (v(), l(r, {
580
+ key: 0,
581
+ variant: R.value.variant,
582
+ "icon-only": "",
583
+ class: "nb-date-picker__inner-message"
584
+ }, {
585
+ default: S(() => [p(b(R.value.text), 1)]),
586
+ _: 1
587
+ }, 8, ["variant"])) : u("", !0)])) : u("", !0), f("div", Ee, [f("input", {
588
+ id: Ve.value,
589
+ ref_key: "endInputRef",
590
+ ref: j,
591
+ type: "text",
592
+ class: "nb-date-picker__field",
593
+ value: Ze.value,
594
+ placeholder: h.endPlaceholder || F.value,
595
+ disabled: h.disabled,
596
+ readonly: h.readonly,
597
+ required: h.required,
598
+ "aria-invalid": h.endError ? !0 : void 0,
599
+ onInput: a[3] ||= (e) => it(e),
600
+ onFocus: V,
601
+ onBlur: H,
602
+ onKeydown: U
603
+ }, null, 40, De), f("button", {
604
+ type: "button",
605
+ class: "nb-date-picker__icon",
606
+ disabled: h.disabled || h.readonly,
607
+ tabindex: "-1",
608
+ "aria-label": h.endValue ? `Change end date, ${I(h.endValue)}` : "Choose end date",
609
+ onClick: K
610
+ }, [m(e, {
611
+ name: x(C),
612
+ size: 16
613
+ }, null, 8, ["name"])], 8, Oe)])], 2)) : u("", !0)]),
614
+ _: 3
615
+ }, 8, ["gap"])) : u("", !0)], 2), (v(), l(s, { to: "body" }, [O.value ? (v(), d("div", ee({
616
+ key: 0,
617
+ ref_key: "calendarRef",
618
+ ref: M,
619
+ role: "dialog",
620
+ "aria-modal": "true",
621
+ "aria-label": h.label ? `${h.label} calendar` : "Date picker",
622
+ class: "nb-date-picker__calendar"
623
+ }, x(ze), {
624
+ style: Je.value,
625
+ onKeydown: st,
626
+ onMousedown: a[4] ||= oe(() => {}, ["prevent"])
627
+ }), [f("div", Ae, [
628
+ f("button", {
629
+ type: "button",
630
+ class: "nb-date-picker__cal-nav",
631
+ "aria-label": "Previous year",
632
+ onClick: mt
633
+ }, [m(e, {
634
+ name: x(ce),
635
+ size: 16
636
+ }, null, 8, ["name"])]),
637
+ f("button", {
638
+ type: "button",
639
+ class: "nb-date-picker__cal-nav",
640
+ "aria-label": "Previous month",
641
+ onClick: ft
642
+ }, [m(e, {
643
+ name: x(le),
644
+ size: 16
645
+ }, null, 8, ["name"])]),
646
+ f("span", {
647
+ id: Ge.value,
648
+ class: "nb-date-picker__cal-title",
649
+ "aria-live": "polite"
650
+ }, b(gt.value), 9, je),
651
+ f("button", {
652
+ type: "button",
653
+ class: "nb-date-picker__cal-nav",
654
+ "aria-label": "Next month",
655
+ onClick: pt
656
+ }, [m(e, {
657
+ name: x(se),
658
+ size: 16
659
+ }, null, 8, ["name"])]),
660
+ f("button", {
661
+ type: "button",
662
+ class: "nb-date-picker__cal-nav",
663
+ "aria-label": "Next year",
664
+ onClick: ht
665
+ }, [m(e, {
666
+ name: x(ue),
667
+ size: 16
668
+ }, null, 8, ["name"])])
669
+ ]), f("table", {
670
+ role: "grid",
671
+ "aria-labelledby": Ge.value,
672
+ class: "nb-date-picker__cal-table"
673
+ }, [f("thead", null, [f("tr", Ne, [(v(!0), d(o, null, ne(_t.value, (e) => (v(), d("th", {
674
+ key: e.narrow,
675
+ scope: "col",
676
+ class: "nb-date-picker__cal-weekday",
677
+ abbr: e.full
678
+ }, b(e.narrow), 9, Pe))), 128))])]), f("tbody", null, [(v(!0), d(o, null, ne(bt.value, (e, t) => (v(), d("tr", { key: t }, [(v(!0), d(o, null, ne(e, (e) => (v(), d("td", {
679
+ key: e.key,
680
+ role: "gridcell",
681
+ "aria-selected": e.isSelected || void 0,
682
+ "aria-disabled": e.isDisabled || void 0
683
+ }, [f("button", {
684
+ type: "button",
685
+ class: _(["nb-date-picker__cal-day", {
686
+ "nb-date-picker__cal-day--outside": !e.inMonth,
687
+ "nb-date-picker__cal-day--today": e.isToday,
688
+ "nb-date-picker__cal-day--selected": e.isSelected,
689
+ "nb-date-picker__cal-day--in-range": e.inRange,
690
+ "nb-date-picker__cal-day--range-start": e.isRangeStart,
691
+ "nb-date-picker__cal-day--range-end": e.isRangeEnd,
692
+ "nb-date-picker__cal-day--disabled": e.isDisabled,
693
+ "nb-date-picker__cal-day--focused": e.date === k.value
694
+ }]),
695
+ tabindex: e.date === k.value ? 0 : -1,
696
+ disabled: e.isDisabled,
697
+ "aria-label": Ye(e.date),
698
+ "data-date": e.date,
699
+ onClick: (t) => ot(e.date)
700
+ }, b(e.day), 11, Ie)], 8, Fe))), 128))]))), 128))])], 8, Me)], 16, ke)) : u("", !0)]))], 64));
701
+ }
702
+ });
703
+ //#endregion
704
+ export { Le as t };