@golemui/gui-lit 1.1.0 → 1.1.1-rc.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 (60) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/{button.element-3a7rRHbA.js → button.element-CJay43iR.js} +16 -13
  3. package/{calendar-BuJgwvZx.js → calendar-D31xNsxx.js} +72 -59
  4. package/{calendar.element-M5MPJmap.js → calendar.element-BhFrCsns.js} +22 -20
  5. package/{checkbox.element-CVskoXEc.js → checkbox.element-DAAVB651.js} +49 -49
  6. package/{currency.element-CfFrAtrr.js → currency.element-D8A2ObpM.js} +11 -10
  7. package/{date-Bj9mI3GU.js → date-DBuYpvcO.js} +35 -27
  8. package/{date-input-cJDkNnVw.js → date-input-DLiMreSS.js} +64 -44
  9. package/date-picker.element-DeUQtbLg.js +357 -0
  10. package/{date-time-calendar-BzRfkLKU.js → date-time-calendar-DzU-FtVl.js} +89 -76
  11. package/{date-time-calendar.element-DC4NK0y1.js → date-time-calendar.element-BLBcVsFu.js} +13 -11
  12. package/{date-time-input-BXxsfuyZ.js → date-time-input-DZaz2heD.js} +75 -43
  13. package/{date-time-picker.element-Dy-8cb-_.js → date-time-picker.element-BUbLdV6i.js} +125 -65
  14. package/{date-time.element-Bv4XdzMi.js → date-time.element-B5onfSBG.js} +31 -25
  15. package/{date.element-Consgsbb.js → date.element-BsKhLrEc.js} +22 -19
  16. package/{day-status-0-hJHrI7.js → day-status-CsWStVQV.js} +153 -129
  17. package/{dropdown.element-WsD61Qel.js → dropdown.element-CXpMwJsU.js} +19 -13
  18. package/{errors-QjKhr6mA.js → errors-Byb2dIhK.js} +3 -2
  19. package/index.js +1643 -1184
  20. package/index.umd.cjs +792 -399
  21. package/{list-CrLIL4by.js → list-D730tmGN.js} +115 -116
  22. package/{list.element-DV82YxnJ.js → list.element-eo3DIOrp.js} +2 -2
  23. package/{markdown.element-p-kC47D7.js → markdown.element-FbtwdnAv.js} +310 -218
  24. package/{number.element-CBr47IiY.js → number.element-BEpOCzXy.js} +76 -61
  25. package/package.json +6 -6
  26. package/{part-templates-Db871PS3.js → part-templates-VORbpgs2.js} +132 -118
  27. package/{password.element-n-R9RbkB.js → password.element-CBaB8h5b.js} +19 -17
  28. package/{pill-ranges-DCqDmpkk.js → pill-ranges-DpvWwP-3.js} +12 -12
  29. package/{pills-Be1UrLgq.js → pills-BDMO2NiR.js} +80 -58
  30. package/popup.controller-B33OvX_y.js +86 -0
  31. package/{radiogroup.element-CeQn623u.js → radiogroup.element-KWzBx8mx.js} +55 -51
  32. package/{range-calendar-CKPYeSGt.js → range-calendar-DO_woqcF.js} +101 -87
  33. package/{range-calendar.element-D6KYq18B.js → range-calendar.element-DHLZhpnj.js} +15 -13
  34. package/{range-date-input-D--AqBMv.js → range-date-input-Br7XqQPK.js} +90 -71
  35. package/{range-date-input.element-D4nIXJbw.js → range-date-input.element-BdD4SlB4.js} +15 -12
  36. package/{range-date-picker.element-dhxPAAE6.js → range-date-picker.element-DWRHiAoC.js} +97 -49
  37. package/{range-date-time-calendar-yksWrR7b.js → range-date-time-calendar-B3EMgN1E.js} +150 -136
  38. package/{range-date-time-calendar.element-C00aDefZ.js → range-date-time-calendar.element-Coea6RF4.js} +9 -7
  39. package/{range-date-time-input-B37TUoM3.js → range-date-time-input-Cu-T_nuC.js} +125 -94
  40. package/{range-date-time-input.element-DUnbv4ed.js → range-date-time-input.element-Cti44iuW.js} +31 -25
  41. package/{range-date-time-picker.element-Cbps6s_G.js → range-date-time-picker.element-CDN2RL1y.js} +107 -47
  42. package/{range-time-input-3lhqR1Ku.js → range-time-input-BP9ZL9O8.js} +85 -66
  43. package/{range-time-input.element-dU2iBdmJ.js → range-time-input.element-B7wtHJoQ.js} +14 -11
  44. package/{range-time-picker.element-v6nQsIPw.js → range-time-picker.element-CPIAiQPC.js} +92 -51
  45. package/{repeater.element-CtNgB4F5.js → repeater.element-BM1Keckd.js} +1 -1
  46. package/{select.element-C0V-Bv3L.js → select.element-eepcXTpL.js} +84 -78
  47. package/{tabs.element-BvAyI71N.js → tabs.element-CvcIA8P3.js} +1 -0
  48. package/{tags.element-DvwEpxpK.js → tags.element-CPHgotb0.js} +21 -14
  49. package/templates-Dmr34nwp.js +88 -0
  50. package/{textarea.element-HThYqdR_.js → textarea.element-CiNEy9uq.js} +8 -7
  51. package/{textinput.element-CkXNzMUg.js → textinput.element-AL2Nr768.js} +10 -9
  52. package/{time-input-BOhlBGJZ.js → time-input-5dkSm8UW.js} +67 -47
  53. package/{time-list-Czo48bZm.js → time-list-DLcq8BAp.js} +1 -1
  54. package/{time-picker-bFJ63ky8.js → time-picker-g337F8d0.js} +89 -51
  55. package/{time-picker.element-CYZVXgRS.js → time-picker.element-DLihegjg.js} +23 -19
  56. package/{time.element-fK3oLi49.js → time.element-BneqgMlQ.js} +22 -19
  57. package/{toggle.element-C1kCw5H8.js → toggle.element-Cz91CRdp.js} +44 -43
  58. package/date-picker.element-va_-LGZD.js +0 -312
  59. package/popup.controller-eUDxE6jD.js +0 -71
  60. package/templates-Dk1jxLwS.js +0 -75
@@ -1,37 +1,37 @@
1
- import { nothing as S, html as c } from "lit";
2
- import { g as C, n as O, c as T } from "./focus-leave.controller-2gV0pQd5.js";
3
- import { t as v, p as M, j as k, i as E, k as R, l as I, w as A, f as L, h as N, n as y } from "./date-Bj9mI3GU.js";
1
+ import { nothing as m, html as c } from "lit";
2
+ import { g as C, n as Y, c as k } from "./focus-leave.controller-2gV0pQd5.js";
3
+ import { t as v, p as M, k as A, i as R, l as x, n as I, o as L, w as N, h as P, j as q, q as y } from "./date-DBuYpvcO.js";
4
4
  import { repeat as w } from "lit-html/directives/repeat.js";
5
- import { b as P, c as q } from "./templates-Dk1jxLwS.js";
6
- const m = ".gui-calendar__day-button:not(.other-month)", F = ".gui-calendar__panel", G = "gui-calendar__year-button", U = ".gui-calendar__year-button", $ = ".gui-calendar__year-button.current", K = ".gui-calendar__year-grid", Y = ".gui-calendar__year-selector", H = '.gui-calendar__day-button[tabindex="0"]';
7
- class te {
5
+ import { b as F, c as G } from "./templates-Dmr34nwp.js";
6
+ const S = ".gui-calendar__day-button:not(.other-month)", U = ".gui-calendar__panel", K = "gui-calendar__year-button", H = ".gui-calendar__year-button", O = ".gui-calendar__year-button.current", j = ".gui-calendar__year-grid", B = ".gui-calendar__year-selector", V = '.gui-calendar__day-button[tabindex="0"]';
7
+ class re {
8
8
  constructor(e, r) {
9
9
  this.handleDayKeydown = async (n) => {
10
10
  if (!["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(n.key) && n.key !== " " && n.key !== "Enter") return;
11
- const a = n.target, u = Array.from(this.host.querySelectorAll(m)), p = u.indexOf(a), f = window.getComputedStyle(this.host).direction === "rtl";
11
+ const o = n.target, u = Array.from(this.host.querySelectorAll(S)), p = u.indexOf(o), f = window.getComputedStyle(this.host).direction === "rtl";
12
12
  if (n.key === " " || n.key === "Enter") {
13
- n.preventDefault(), this.options.onActivateDay(a.dataset.date ?? "", n);
13
+ n.preventDefault(), this.options.onActivateDay(o.dataset.date ?? "", n);
14
14
  return;
15
15
  }
16
16
  const d = C(n.key, { columns: 7, isRTL: f });
17
17
  if (d.kind !== "delta") return;
18
18
  const h = d.delta;
19
19
  n.preventDefault();
20
- const s = O(
20
+ const i = Y(
21
21
  p,
22
22
  h,
23
23
  u.length,
24
- (o) => this.isButtonDisabled(u[o])
24
+ (a) => this.isButtonDisabled(u[a])
25
25
  );
26
26
  let l = !1;
27
- if (s < 0)
27
+ if (i < 0)
28
28
  if (this.options.canGoPrev())
29
29
  this.options.goPrev(), l = !0;
30
30
  else {
31
31
  u.find((g) => !this.isButtonDisabled(g))?.focus();
32
32
  return;
33
33
  }
34
- else if (s >= u.length)
34
+ else if (i >= u.length)
35
35
  if (this.options.canGoNext())
36
36
  this.options.goNext(), l = !0;
37
37
  else {
@@ -40,53 +40,53 @@ class te {
40
40
  }
41
41
  if (l) {
42
42
  await this.host.updateComplete;
43
- const o = Array.from(
44
- this.host.querySelectorAll(m)
45
- ), g = Array.from(this.host.querySelectorAll(F));
43
+ const a = Array.from(
44
+ this.host.querySelectorAll(S)
45
+ ), g = Array.from(this.host.querySelectorAll(U));
46
46
  let b;
47
- if (s < 0)
48
- b = g[0].querySelectorAll(m).length + s;
47
+ if (i < 0)
48
+ b = g[0].querySelectorAll(S).length + i;
49
49
  else {
50
- const _ = g[g.length - 1].querySelectorAll(m).length;
51
- b = o.length - _ + (s - u.length);
50
+ const _ = g[g.length - 1].querySelectorAll(S).length;
51
+ b = a.length - _ + (i - u.length);
52
52
  }
53
- if (this.isButtonDisabled(o[b])) {
54
- const D = O(
53
+ if (this.isButtonDisabled(a[b])) {
54
+ const D = Y(
55
55
  b,
56
56
  h,
57
- o.length,
58
- (_) => this.isButtonDisabled(o[_])
57
+ a.length,
58
+ (_) => this.isButtonDisabled(a[_])
59
59
  );
60
- if (D < 0 || D >= o.length) {
61
- const _ = o.findIndex((x) => !this.isButtonDisabled(x));
62
- _ > -1 && o[_].focus();
60
+ if (D < 0 || D >= a.length) {
61
+ const _ = a.findIndex((E) => !this.isButtonDisabled(E));
62
+ _ > -1 && a[_].focus();
63
63
  } else
64
- o[D]?.focus();
64
+ a[D]?.focus();
65
65
  } else {
66
- const D = Math.max(0, Math.min(b, o.length - 1));
67
- o[D]?.focus();
66
+ const D = Math.max(0, Math.min(b, a.length - 1));
67
+ a[D]?.focus();
68
68
  }
69
69
  } else
70
- u[s]?.focus();
70
+ u[i]?.focus();
71
71
  }, this.handleYearKeydown = (n) => {
72
- const i = n.target;
73
- if (!i.classList.contains(G)) return;
74
- const a = Array.from(this.host.querySelectorAll(U)), u = a.indexOf(i), p = window.getComputedStyle(this.host).direction === "rtl";
72
+ const s = n.target;
73
+ if (!s.classList.contains(K)) return;
74
+ const o = Array.from(this.host.querySelectorAll(H)), u = o.indexOf(s), p = window.getComputedStyle(this.host).direction === "rtl";
75
75
  if (n.key === "Enter" || n.key === " ") {
76
76
  n.preventDefault();
77
- const h = parseInt(i.dataset.year ?? "", 10);
77
+ const h = parseInt(s.dataset.year ?? "", 10);
78
78
  isNaN(h) || this.selectYear(h);
79
79
  return;
80
80
  }
81
81
  if (n.key === "Escape") {
82
- n.preventDefault(), n.stopPropagation(), this.host.querySelector(Y)?.focus(), this.options.onCloseYearGrid();
82
+ n.preventDefault(), n.stopPropagation(), this.host.querySelector(B)?.focus(), this.options.onCloseYearGrid();
83
83
  return;
84
84
  }
85
85
  const f = C(n.key, { columns: 4, isRTL: p });
86
86
  if (f.kind !== "delta") return;
87
87
  n.preventDefault();
88
88
  const d = u + f.delta;
89
- d >= 0 && d < a.length && a[d].focus();
89
+ d >= 0 && d < o.length && o[d].focus();
90
90
  }, this.onPrevMonthClick = () => {
91
91
  this.options.goPrev(), this.keepNavFocusInside("prev", "next");
92
92
  }, this.onNextMonthClick = () => {
@@ -97,9 +97,9 @@ class te {
97
97
  }
98
98
  selectYear(e) {
99
99
  this.host.querySelector(
100
- Y
100
+ B
101
101
  )?.focus(), this.options.onSelectYear(e), this.host.updateComplete.then(() => {
102
- this.host.querySelector(H)?.focus();
102
+ this.host.querySelector(V)?.focus();
103
103
  });
104
104
  }
105
105
  /**
@@ -112,14 +112,14 @@ class te {
112
112
  });
113
113
  }
114
114
  scrollToCurrentYear() {
115
- const e = this.host.querySelector(K), r = this.host.querySelector($);
115
+ const e = this.host.querySelector(j), r = this.host.querySelector(O);
116
116
  if (e && r) {
117
- const n = e.getBoundingClientRect(), i = r.getBoundingClientRect(), a = e.scrollTop + (i.top - n.top) - n.height / 2 + i.height / 2;
118
- e.scrollTop = Math.max(0, a);
117
+ const n = e.getBoundingClientRect(), s = r.getBoundingClientRect(), o = e.scrollTop + (s.top - n.top) - n.height / 2 + s.height / 2;
118
+ e.scrollTop = Math.max(0, o);
119
119
  }
120
120
  }
121
121
  focusCurrentYearButton() {
122
- this.host.querySelector($)?.focus();
122
+ this.host.querySelector(O)?.focus();
123
123
  }
124
124
  /**
125
125
  * After a nav click lands on a min/max boundary, the clicked button renders
@@ -134,16 +134,20 @@ class te {
134
134
  if (!n || !n.disabled) return;
135
135
  (this.host.querySelector(
136
136
  `.gui-calendar__month-button--${r}:not([disabled])`
137
- ) ?? this.host.querySelector(".gui-calendar__day-button:not([disabled])"))?.focus();
137
+ ) ?? this.host.querySelector(
138
+ '.gui-calendar__day-button:not([disabled]):not([aria-disabled="true"])'
139
+ ))?.focus();
138
140
  }
139
141
  /**
140
- * Whether a queried button is disabled; a missing button counts as disabled
142
+ * Whether a queried button is disabled; a missing button counts as disabled.
143
+ * Blocked in-month days carry `aria-disabled` instead of the native
144
+ * attribute (they stay in the accessibility tree) — skip both alike.
141
145
  */
142
146
  isButtonDisabled(e) {
143
- return e ? e.hasAttribute("disabled") : !0;
147
+ return e ? e.hasAttribute("disabled") || e.getAttribute("aria-disabled") === "true" : !0;
144
148
  }
145
149
  }
146
- class ne {
150
+ class se {
147
151
  constructor(e, r) {
148
152
  this._currentDate = /* @__PURE__ */ new Date(), this._yearSelectorOpen = !1, this.host = e, this.options = r, e.addController(this);
149
153
  }
@@ -241,11 +245,11 @@ class ne {
241
245
  * dates already inside the visible months.
242
246
  */
243
247
  navigateToDate(e) {
244
- !isNaN(e.getTime()) && !k(e, this._currentDate, this.options.getNumberOfMonths() ?? 1) && (this.currentDate = e);
248
+ !isNaN(e.getTime()) && !A(e, this._currentDate, this.options.getNumberOfMonths() ?? 1) && (this.currentDate = e);
245
249
  }
246
250
  /** Whether a day is outside min/max or inside a disabled range. */
247
251
  isDisabled(e) {
248
- return E(
252
+ return R(
249
253
  v(e),
250
254
  this.options.getMinDate(),
251
255
  this.options.getMaxDate(),
@@ -253,7 +257,11 @@ class ne {
253
257
  );
254
258
  }
255
259
  }
256
- function re(t) {
260
+ function $(t, e) {
261
+ const r = new Date(t);
262
+ return r.setDate(1), r.setMonth(r.getMonth() + e), r;
263
+ }
264
+ function oe(t) {
257
265
  const e = {
258
266
  uid: t.uid,
259
267
  label: t.label,
@@ -261,21 +269,22 @@ function re(t) {
261
269
  errors: t.errors,
262
270
  touched: t.touched,
263
271
  required: t.required
264
- }, r = Array.from({ length: t.numberOfMonths ?? 1 }, (n, i) => i);
272
+ }, r = Array.from({ length: t.numberOfMonths ?? 1 }, (s, o) => o), n = r.map((s) => x(t.localeId, $(t.currentDate, s))).join(", ");
265
273
  return c`
266
- ${t.label ? P(t.uid, e, !1, "calendar") : S}
274
+ ${t.label ? F(t.uid, e, !1, "calendar") : m}
267
275
 
268
276
  <div class="gui-widget" @focusout=${t.onFocusOut}>
269
277
  <div
270
- id=${t.uid}
278
+ id=${`${t.uid}_calendar`}
271
279
  class="gui-calendar-input"
272
280
  role="group"
273
- aria-labelledby=${t.label ? `${t.uid}_calendar_label` : S}
274
- ?aria-disabled=${t.disabled}
281
+ aria-labelledby=${t.label ? `${t.uid}_calendar_label` : m}
282
+ aria-disabled=${t.disabled ? "true" : m}
275
283
  >
284
+ <div class="gui-visually-hidden" aria-live="polite">${n}</div>
276
285
  ${t.renderAboveCalendar()}
277
286
  <div class="gui-calendar__container">
278
- ${B("prev", {
287
+ ${T("prev", {
279
288
  icon: t.prevMonthIcon,
280
289
  ariaLabel: t.prevMonthAriaLabel,
281
290
  disabled: !t.canGoPrev,
@@ -283,10 +292,10 @@ function re(t) {
283
292
  })}
284
293
 
285
294
  <div class="gui-calendar__months-grid">
286
- ${r.map((n) => t.renderMonthPanel(n))}
295
+ ${r.map((s) => t.renderMonthPanel(s))}
287
296
  </div>
288
297
 
289
- ${B("next", {
298
+ ${T("next", {
290
299
  icon: t.nextMonthIcon,
291
300
  ariaLabel: t.nextMonthAriaLabel,
292
301
  disabled: !t.canGoNext,
@@ -296,24 +305,28 @@ function re(t) {
296
305
  </div>
297
306
  </div>
298
307
 
299
- ${t.errors?.length ? q(t.uid, e) : S}
308
+ ${t.errors?.length ? G(t.uid, e) : m}
300
309
  `;
301
310
  }
302
- function B(t, e) {
311
+ function T(t, e) {
303
312
  return t === "prev" ? c`
304
313
  <button
305
314
  type="button"
306
- tabindex="0"
307
315
  class="gui-button gui-calendar__month-button gui-calendar__month-button--prev"
308
316
  ?disabled=${e.disabled}
309
317
  @click=${e.onClick}
310
318
  aria-label=${e.ariaLabel ?? "Previous month"}
311
319
  >
312
- ${e.icon ? c`<span class=${`gui-widget-icon ${e.icon}`} data-icon=${e.icon}></span>` : c`<svg
320
+ ${e.icon ? c`<span
321
+ class=${`gui-widget-icon ${e.icon}`}
322
+ data-icon=${e.icon}
323
+ aria-hidden="true"
324
+ ></span>` : c`<svg
313
325
  xmlns="http://www.w3.org/2000/svg"
314
326
  width="16"
315
327
  height="16"
316
328
  viewBox="0 0 256 256"
329
+ aria-hidden="true"
317
330
  >
318
331
  <path
319
332
  d="M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"
@@ -323,13 +336,22 @@ function B(t, e) {
323
336
  ` : c`
324
337
  <button
325
338
  type="button"
326
- tabindex="0"
327
339
  class="gui-button gui-calendar__month-button gui-calendar__month-button--next"
328
340
  ?disabled=${e.disabled}
329
341
  @click=${e.onClick}
330
342
  aria-label=${e.ariaLabel ?? "Next month"}
331
343
  >
332
- ${e.icon ? c`<span class=${`gui-widget-icon ${e.icon}`} data-icon=${e.icon}></span>` : c`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
344
+ ${e.icon ? c`<span
345
+ class=${`gui-widget-icon ${e.icon}`}
346
+ data-icon=${e.icon}
347
+ aria-hidden="true"
348
+ ></span>` : c`<svg
349
+ xmlns="http://www.w3.org/2000/svg"
350
+ width="16"
351
+ height="16"
352
+ viewBox="0 0 256 256"
353
+ aria-hidden="true"
354
+ >
333
355
  <path
334
356
  d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"
335
357
  ></path>
@@ -337,54 +359,56 @@ function B(t, e) {
337
359
  </button>
338
360
  `;
339
361
  }
340
- function V(t) {
341
- const e = new Date(t.currentDate);
342
- return e.setDate(1), e.setMonth(e.getMonth() + t.offset), c`
362
+ function W(t) {
363
+ const e = $(t.currentDate, t.offset);
364
+ return c`
343
365
  <div class="gui-calendar__panel">
344
366
  ${t.renderHeader(e)} ${t.renderBelowHeader(t.offset)}
345
367
  ${t.renderPanelBody(t.offset)}
346
368
  </div>
347
369
  `;
348
370
  }
349
- function se(t) {
350
- return V({
371
+ function ie(t) {
372
+ return W({
351
373
  currentDate: t.currentDate,
352
374
  offset: t.offset,
353
- renderHeader: (e) => W(e, {
375
+ renderHeader: (e) => Z(e, {
354
376
  localeId: t.localeId,
355
377
  monthFormat: t.monthFormat,
356
378
  yearSelectorOpen: t.yearSelectorOpen,
379
+ selectYearAriaLabel: t.selectYearAriaLabel,
357
380
  onToggleYearSelector: t.onToggleYearSelector
358
381
  }),
359
- renderBelowHeader: t.renderBelowHeader ?? (() => S),
382
+ renderBelowHeader: t.renderBelowHeader ?? (() => m),
360
383
  renderPanelBody: t.renderPanelBody
361
384
  });
362
385
  }
363
- function oe(t) {
364
- return t.yearSelectorOpen && t.offset === 0 ? Z({
386
+ function ae(t) {
387
+ return t.yearSelectorOpen && t.offset === 0 ? J({
365
388
  years: t.years,
366
389
  currentYear: t.currentYear,
367
390
  onSelectYear: t.onSelectYear,
368
- onKeydown: t.onYearKeydown
369
- }) : j(
370
- T(t.getDays(t.offset), 7),
371
- R(t.localeId),
372
- (e) => t.renderDay(e)
391
+ onKeydown: t.onYearKeydown,
392
+ ariaLabel: t.yearGridAriaLabel
393
+ }) : z(
394
+ k(t.getDays(t.offset), 7),
395
+ I(t.localeId),
396
+ (e) => t.renderDay(e),
397
+ x(t.localeId, $(t.currentDate, t.offset))
373
398
  );
374
399
  }
375
- function W(t, e) {
376
- const r = I(e.localeId, t, e.monthFormat);
400
+ function Z(t, e) {
401
+ const r = L(e.localeId, t, e.monthFormat);
377
402
  return c`
378
403
  <header class="gui-calendar__header">
379
404
  <h2>
380
405
  ${r.map(
381
406
  (n) => n.type === "year" ? c`<button
382
407
  type="button"
383
- tabindex="0"
384
408
  class="gui-calendar__year-selector"
385
409
  @click=${e.onToggleYearSelector}
386
410
  aria-expanded=${e.yearSelectorOpen}
387
- aria-label="Select year"
411
+ aria-label=${`${e.selectYearAriaLabel ?? "Select year"}, ${n.value}`}
388
412
  >
389
413
  <span class="gui-calendar__year-value">${n.value}</span>
390
414
  <span class="gui-calendar__year-arrow" aria-hidden="true">
@@ -405,25 +429,25 @@ function W(t, e) {
405
429
  </header>
406
430
  `;
407
431
  }
408
- function j(t, e, r) {
432
+ function z(t, e, r, n) {
409
433
  return c`
410
- <div class="gui-calendar__days-grid" role="grid">
434
+ <div class="gui-calendar__days-grid" role="grid" aria-label=${n ?? m}>
411
435
  <div role="row" class="gui-calendar__rows">
412
436
  ${w(
413
437
  e,
414
- (n, i) => i,
415
- (n) => c`<span class="gui-calendar__weekday" role="gridcell">${n}</span>`
438
+ (s, o) => o,
439
+ (s) => c`<span class="gui-calendar__weekday" role="columnheader">${s}</span>`
416
440
  )}
417
441
  </div>
418
442
 
419
443
  ${w(
420
444
  t,
421
- (n) => c`
445
+ (s) => c`
422
446
  <div role="row" class="gui-calendar__rows">
423
447
  ${w(
424
- n,
425
- (i) => i.date.toISOString(),
426
- (i) => r(i)
448
+ s,
449
+ (o) => o.date.toISOString(),
450
+ (o) => r(o)
427
451
  )}
428
452
  </div>
429
453
  `
@@ -431,16 +455,16 @@ function j(t, e, r) {
431
455
  </div>
432
456
  `;
433
457
  }
434
- function Z(t) {
458
+ function J(t) {
435
459
  const e = t.currentYear;
436
460
  return c`
437
461
  <div
438
462
  class="gui-calendar__year-grid"
439
463
  role="grid"
440
- aria-label="Year selection"
464
+ aria-label=${t.ariaLabel ?? "Year selection"}
441
465
  @keydown=${t.onKeydown}
442
466
  >
443
- ${T(t.years, 4).map(
467
+ ${k(t.years, 4).map(
444
468
  (r) => c`
445
469
  <div role="row" class="gui-calendar__year-row">
446
470
  ${r.map(
@@ -451,8 +475,8 @@ function Z(t) {
451
475
  class="gui-calendar__year-button ${n === e ? "current" : ""}"
452
476
  tabindex=${n === e ? 0 : -1}
453
477
  data-year=${n}
454
- @click=${(i) => {
455
- i.stopPropagation(), t.onSelectYear(n);
478
+ @click=${(s) => {
479
+ s.stopPropagation(), t.onSelectYear(n);
456
480
  }}
457
481
  aria-selected=${n === e}
458
482
  >
@@ -466,26 +490,26 @@ function Z(t) {
466
490
  </div>
467
491
  `;
468
492
  }
469
- function ie(t, e) {
493
+ function le(t, e) {
470
494
  const r = t.getTime();
471
- let n = !1, i = !1, a = !1, u = !1, p = !1, f = !1, d = !1, h = !1;
495
+ let n = !1, s = !1, o = !1, u = !1, p = !1, f = !1, d = !1, h = !1;
472
496
  if (e.selectedISO && (n = y(t, M(e.selectedISO))), e.invalidRange) {
473
- const s = e.invalidRange.start, l = e.invalidRange.end;
474
- f = y(t, s), d = y(t, l), r > s.getTime() && r < l.getTime() && (h = !0);
497
+ const i = e.invalidRange.start, l = e.invalidRange.end;
498
+ f = y(t, i), d = y(t, l), r > i.getTime() && r < l.getTime() && (h = !0);
475
499
  }
476
500
  if (e.selectingSpan && (p = r >= e.selectingSpan.start.getTime() && r <= e.selectingSpan.end.getTime()), e.ranges)
477
- for (const s of e.ranges)
478
- y(t, s.start) && (i = !0, a = !s.end), s.end && (y(t, s.end) && (a = !0), r > s.start.getTime() && r < s.end.getTime() && (u = !0));
501
+ for (const i of e.ranges)
502
+ y(t, i.start) && (s = !0, o = !i.end), i.end && (y(t, i.end) && (o = !0), r > i.start.getTime() && r < i.end.getTime() && (u = !0));
479
503
  if (e.workingRange) {
480
- const { start: s, end: l } = e.workingRange;
481
- y(t, s) && (i = !0), y(t, l) && (a = !0), r > s.getTime() && r < l.getTime() && (u = !0);
504
+ const { start: i, end: l } = e.workingRange;
505
+ y(t, i) && (s = !0), y(t, l) && (o = !0), r > i.getTime() && r < l.getTime() && (u = !0);
482
506
  }
483
507
  return {
484
508
  isSelected: n,
485
- isRangeStart: i,
486
- isRangeEnd: a,
509
+ isRangeStart: s,
510
+ isRangeEnd: o,
487
511
  isInRange: u,
488
- isOneDayRange: i && a,
512
+ isOneDayRange: s && o,
489
513
  isAnchor: e.anchor ? y(t, e.anchor) : !1,
490
514
  isSelecting: p,
491
515
  isInvalidStart: f,
@@ -493,38 +517,38 @@ function ie(t, e) {
493
517
  isInvalidInRange: h
494
518
  };
495
519
  }
496
- function ae(t) {
497
- const { currentDate: e, offset: r = 0, localeId: n, numberOfMonths: i = 1 } = t, a = new Date(e.getFullYear(), e.getMonth() + r, 1), u = a.getMonth(), p = a.getDay(), f = A(n)[0], d = (p - f + 7) % 7, h = new Date(a);
498
- h.setDate(a.getDate() - d);
499
- let s = [];
520
+ function ce(t) {
521
+ const { currentDate: e, offset: r = 0, localeId: n, numberOfMonths: s = 1 } = t, o = new Date(e.getFullYear(), e.getMonth() + r, 1), u = o.getMonth(), p = o.getDay(), f = N(n)[0], d = (p - f + 7) % 7, h = new Date(o);
522
+ h.setDate(o.getDate() - d);
523
+ let i = [];
500
524
  for (let l = 0; l < 42; l++) {
501
- const o = new Date(h);
502
- o.setDate(h.getDate() + l), s.push(
525
+ const a = new Date(h);
526
+ a.setDate(h.getDate() + l), i.push(
503
527
  t.toDay({
504
- date: o,
505
- dayLabel: N(n, o),
506
- isCurrentMonth: o.getMonth() === u,
507
- isToday: L(o),
508
- isDisabled: t.isDisabled(o)
528
+ date: a,
529
+ dayLabel: q(n, a),
530
+ isCurrentMonth: a.getMonth() === u,
531
+ isToday: P(a),
532
+ isDisabled: t.isDisabled(a)
509
533
  })
510
534
  );
511
535
  }
512
536
  for (let l = 0; l < 2; l++)
513
- s.slice(-7).every((g) => !g.isCurrentMonth) && (s = s.slice(0, -7));
514
- if (r === 0 && !s.some((l) => l.isFocusable) && !(t.focusFallbackDates ?? []).some(
515
- (o) => k(o, e, i)
537
+ i.slice(-7).every((g) => !g.isCurrentMonth) && (i = i.slice(0, -7));
538
+ if (r === 0 && !i.some((l) => l.isFocusable) && !(t.focusFallbackDates ?? []).some(
539
+ (a) => A(a, e, s)
516
540
  )) {
517
- const o = s.find((g) => g.isCurrentMonth && !g.isDisabled);
518
- o && (o.isFocusable = !0);
541
+ const a = i.find((g) => g.isCurrentMonth && !g.isDisabled);
542
+ a && (a.isFocusable = !0);
519
543
  }
520
- return s;
544
+ return i;
521
545
  }
522
546
  export {
523
- ne as G,
524
- te as a,
525
- se as b,
526
- oe as c,
527
- ae as d,
528
- ie as e,
529
- re as r
547
+ se as G,
548
+ re as a,
549
+ ie as b,
550
+ ae as c,
551
+ ce as d,
552
+ le as e,
553
+ oe as r
530
554
  };
@@ -1,10 +1,10 @@
1
1
  import { InputWidgetAdapter as w, formContext as y, inputContext as F } from "@golemui/lit";
2
2
  import { consume as x, provide as C } from "@lit/context";
3
3
  import { LitElement as D, nothing as f, html as g } from "lit";
4
- import { property as L, state as c, query as $, customElement as R } from "lit/decorators.js";
4
+ import { property as L, state as c, query as I, customElement as R } from "lit/decorators.js";
5
5
  import { Subject as V, debounceTime as k } from "rxjs";
6
- import { d as j } from "./list-CrLIL4by.js";
7
- import "./errors-QjKhr6mA.js";
6
+ import { d as j } from "./list-D730tmGN.js";
7
+ import "./errors-Byb2dIhK.js";
8
8
  var O = Object.defineProperty, S = Object.getOwnPropertyDescriptor, l = (e, t, i, s) => {
9
9
  for (var r = s > 1 ? void 0 : s ? S(t, i) : t, d = e.length - 1, h; d >= 0; d--)
10
10
  (h = e[d]) && (r = (s ? h(t, i, r) : h(r)) || r);
@@ -126,13 +126,10 @@ let a = class extends D {
126
126
  .native=${!1}
127
127
  ></gui-label>
128
128
 
129
- <div
130
- class="gui-widget"
131
- aria-expanded=${this._isListVisible}
132
- @keydown=${this._onWidgetKeyDown}
133
- >
129
+ <div class="gui-widget" @keydown=${this._onWidgetKeyDown}>
134
130
  <input
135
131
  type="text"
132
+ role="combobox"
136
133
  id=${this.widget.uid}
137
134
  data-cy=${`${this.widget.uid}_textinput`}
138
135
  class="gui-widget-input"
@@ -146,18 +143,27 @@ let a = class extends D {
146
143
  @input=${this._onInput}
147
144
  @focusout=${this._onFocusOutInput}
148
145
  @focus=${this._onFocus}
146
+ aria-expanded=${this._isListVisible ? "true" : "false"}
147
+ aria-controls=${`${this.widget.uid}-list`}
148
+ aria-autocomplete="list"
149
149
  aria-labelledby=${e.label ? `${this.widget.uid}_label` : f}
150
150
  aria-describedby=${e.hint ? `${this.widget.uid}_hint` : f}
151
151
  />
152
152
  <span class="gui-dropdown__arrow"
153
- ><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
153
+ ><svg
154
+ xmlns="http://www.w3.org/2000/svg"
155
+ width="16"
156
+ height="16"
157
+ viewBox="0 0 256 256"
158
+ aria-hidden="true"
159
+ >
154
160
  <path
155
161
  d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
156
162
  ></path></svg
157
163
  ></span>
158
164
 
159
165
  <gui-list
160
- id=${this.widget.uid}
166
+ id=${`${this.widget.uid}-list`}
161
167
  .uid=${this.widget.uid}
162
168
  .value=${e.value ?? ""}
163
169
  .valueField=${e.valueField}
@@ -177,7 +183,7 @@ let a = class extends D {
177
183
  @change=${this._onValueChange}
178
184
  >
179
185
  ${i.map((o, _) => {
180
- const u = this._range.start + _, p = e.value === o.value, m = this._focusedIndex === u, b = !!e.disabled || !!o.disabled, I = e.labelField ?? "label", v = o.template !== null && typeof o.template == "object" && I && !e.itemRenderer ? o.template[I] : o.template;
186
+ const u = this._range.start + _, p = e.value === o.value, m = this._focusedIndex === u, b = !!e.disabled || !!o.disabled, $ = e.labelField ?? "label", v = o.template !== null && typeof o.template == "object" && $ && !e.itemRenderer ? o.template[$] : o.template;
181
187
  return g`
182
188
  <div
183
189
  role="option"
@@ -240,10 +246,10 @@ l([
240
246
  c()
241
247
  ], a.prototype, "_selectedItem", 2);
242
248
  l([
243
- $("input")
249
+ I("input")
244
250
  ], a.prototype, "_inputRef", 2);
245
251
  l([
246
- $("gui-list")
252
+ I("gui-list")
247
253
  ], a.prototype, "_listRef", 2);
248
254
  a = l([
249
255
  R("gui-dropdown-input")
@@ -1,6 +1,6 @@
1
1
  import { LitElement as h, html as y } from "lit";
2
2
  import { property as r, customElement as c } from "lit/decorators.js";
3
- import { G as m, b as f, c as g } from "./templates-Dk1jxLwS.js";
3
+ import { G as m, b as f, c as g } from "./templates-Dmr34nwp.js";
4
4
  var v = Object.defineProperty, b = Object.getOwnPropertyDescriptor, o = (u, s, n, i) => {
5
5
  for (var e = i > 1 ? void 0 : i ? b(s, n) : s, l = u.length - 1, a; l >= 0; l--)
6
6
  (a = u[l]) && (e = (i ? a(s, n, e) : a(e)) || e);
@@ -17,7 +17,8 @@ let t = class extends h {
17
17
  errors: this.errors,
18
18
  readonly: this.readOnly,
19
19
  disabled: this.disabled,
20
- touched: this.touched
20
+ touched: this.touched,
21
+ required: this.required
21
22
  }
22
23
  })
23
24
  });