@mintplayer/web-components 2.2.0 → 2.3.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 (107) hide show
  1. package/a11y/index.mjs +26 -2
  2. package/a11y/src/dismiss-stack.d.ts +25 -0
  3. package/a11y/src/error-text.d.ts +41 -0
  4. package/a11y/src/focus-restore.d.ts +116 -0
  5. package/a11y/src/focus-trap.d.ts +69 -0
  6. package/a11y/src/form-associated.d.ts +48 -0
  7. package/a11y/src/host-aria.d.ts +154 -0
  8. package/a11y/src/index.d.ts +16 -0
  9. package/a11y/src/inert-regions.d.ts +52 -0
  10. package/a11y/src/live-announcer.d.ts +8 -0
  11. package/a11y/src/roving-focus.d.ts +118 -0
  12. package/a11y/src/testing/expect-idref-resolves.d.ts +31 -0
  13. package/a11y/src/testing/index.d.ts +1 -0
  14. package/accordion/index.mjs +180 -174
  15. package/accordion/src/components/mp-accordion.d.ts +18 -13
  16. package/calendar/index.mjs +1 -1
  17. package/calendar/src/mp-calendar.element.d.ts +2 -0
  18. package/carousel/index.mjs +211 -164
  19. package/carousel/src/components/mp-carousel.d.ts +1 -0
  20. package/checkbox/index.mjs +1 -1
  21. package/checkbox/src/components/mp-checkbox.d.ts +59 -1
  22. package/chunks/focus-restore-DxuP1Oe2.mjs +94 -0
  23. package/chunks/focus-trap-DTOLJ5bb.mjs +121 -0
  24. package/chunks/form-associated-axmc5sY0.mjs +58 -0
  25. package/chunks/host-aria-WSGs7SPQ.mjs +152 -0
  26. package/chunks/inert-regions-DXCnn1LN.mjs +48 -0
  27. package/chunks/invalid-feedback.styles-he0JYrJm.mjs +11 -0
  28. package/chunks/{live-announcer-CZDTKulf.mjs → live-announcer-Bi0orG4n.mjs} +9 -9
  29. package/chunks/{mp-calendar.element-UC68iDbi.mjs → mp-calendar.element-u6uS31_j.mjs} +136 -105
  30. package/chunks/mp-checkbox-Ph2mMRGz.mjs +312 -0
  31. package/chunks/{mp-datatable-Bfw0KGkV.mjs → mp-datatable-BwTlh9A_.mjs} +265 -103
  32. package/chunks/{mp-pagination-BGxsawFL.mjs → mp-pagination-Dea75mD4.mjs} +25 -22
  33. package/chunks/mp-radio-BjW1HNSc.mjs +300 -0
  34. package/chunks/{mp-select-BDS1-YGn.mjs → mp-select-Ctu-v1-p.mjs} +163 -40
  35. package/chunks/{mp-splitter-C8cGCmac.mjs → mp-splitter-LszuRDbR.mjs} +53 -46
  36. package/chunks/{mp-tab-page-D1b4x-y2.mjs → mp-tab-page-CaCzX1ym.mjs} +46 -45
  37. package/chunks/{mp-timepicker.element-BwEiwX92.mjs → mp-timepicker.element-Bz393NDQ.mjs} +93 -86
  38. package/chunks/{mp-toggle-button-dLZNDUVz.mjs → mp-toggle-button-Kz6sIgBJ.mjs} +131 -37
  39. package/chunks/{mp-treeview-C48F63xb.mjs → mp-treeview-tkWu28iF.mjs} +67 -43
  40. package/chunks/overlay-controller-DPt13i8p.mjs +314 -0
  41. package/chunks/roving-focus-CrL9982a.mjs +129 -0
  42. package/code-snippet/index.mjs +21 -13
  43. package/code-snippet/src/mp-code-snippet.element.d.ts +6 -0
  44. package/datatable/index.mjs +1 -1
  45. package/datatable/src/components/mp-datatable.d.ts +50 -0
  46. package/datatable/src/types/index.d.ts +2 -0
  47. package/datatable/src/types/labels.d.ts +30 -0
  48. package/datepicker/index.mjs +45 -22
  49. package/datepicker/src/mp-datepicker.element.d.ts +30 -0
  50. package/datetime-picker/index.mjs +15 -9
  51. package/dock/index.mjs +365 -209
  52. package/dock/src/components/mint-dock-manager.element.d.ts +63 -3
  53. package/dropdown-menu/index.mjs +135 -90
  54. package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +12 -3
  55. package/file-manager/index.mjs +279 -214
  56. package/file-manager/src/components/mp-file-manager.d.ts +22 -0
  57. package/file-manager/src/types/messages.d.ts +9 -0
  58. package/multi-range/index.mjs +26 -10
  59. package/multi-range/src/mint-multi-range.element.d.ts +7 -0
  60. package/navbar/index.mjs +53 -39
  61. package/navbar/src/components/mp-navbar.d.ts +1 -0
  62. package/otp-input/index.mjs +82 -48
  63. package/otp-input/src/mint-otp-input.element.d.ts +31 -3
  64. package/overlay/index.mjs +2 -258
  65. package/overlay/src/overlay-controller.d.ts +64 -4
  66. package/package.json +9 -1
  67. package/pagination/index.mjs +1 -1
  68. package/query-builder/index.mjs +117 -87
  69. package/query-builder/src/model/messages.d.ts +9 -0
  70. package/radio/index.mjs +2 -160
  71. package/radio/src/components/mp-radio.d.ts +58 -3
  72. package/radio-group/index.d.ts +1 -0
  73. package/radio-group/index.mjs +145 -0
  74. package/radio-group/src/components/mp-radio-group.d.ts +52 -0
  75. package/radio-group/src/index.d.ts +1 -0
  76. package/radio-group/src/styles/radio-group.styles.d.ts +2 -0
  77. package/ribbon/index.mjs +316 -304
  78. package/ribbon/src/mp-ribbon.element.d.ts +16 -0
  79. package/scheduler/index.mjs +219 -132
  80. package/scheduler/src/components/mp-scheduler.d.ts +3 -0
  81. package/scheduler/src/views/base-view.d.ts +23 -0
  82. package/select/index.mjs +1 -1
  83. package/select/src/components/mp-select.d.ts +60 -3
  84. package/shell/index.mjs +142 -31
  85. package/shell/src/components/mp-shell.d.ts +1 -0
  86. package/signature-pad/index.d.ts +1 -0
  87. package/signature-pad/index.mjs +230 -0
  88. package/signature-pad/src/index.d.ts +2 -0
  89. package/signature-pad/src/mp-signature-pad.element.d.ts +143 -0
  90. package/signature-pad/src/mp-signature-pad.element.template.d.ts +2 -0
  91. package/signature-pad/src/types/signature.d.ts +12 -0
  92. package/splitter/index.mjs +1 -1
  93. package/splitter/src/components/mp-splitter.d.ts +7 -0
  94. package/tab-control/index.mjs +1 -1
  95. package/tile-manager/index.mjs +110 -93
  96. package/timeline/index.mjs +138 -54
  97. package/timeline/src/components/mp-timeline.d.ts +15 -0
  98. package/timepicker/index.mjs +1 -1
  99. package/timepicker/src/mp-time-list.element.d.ts +13 -4
  100. package/timepicker/src/mp-timepicker.element.d.ts +29 -0
  101. package/toggle-button/index.mjs +1 -1
  102. package/toggle-button/src/components/mp-toggle-button.d.ts +32 -1
  103. package/tree-select/index.mjs +233 -121
  104. package/tree-select/src/components/mp-tree-select.d.ts +37 -0
  105. package/treeview/index.mjs +1 -1
  106. package/treeview/src/components/mp-treeview.d.ts +10 -1
  107. package/chunks/mp-checkbox-BokLL7BS.mjs +0 -211
@@ -1,8 +1,8 @@
1
- import { html as u, unsafeCSS as b, LitElement as D, nothing as c } from "lit";
1
+ import { html as u, unsafeCSS as b, LitElement as p, nothing as c } from "lit";
2
2
  u`<!-- The calendar is rendered dynamically by render(). This file exists only so
3
3
  the codegen-wc target emits a \`styles\` export from the sibling .scss; the
4
4
  \`template\` export is intentionally unused. -->`;
5
- const p = b(`:host {
5
+ const D = b(`:host {
6
6
  display: inline-block;
7
7
  box-sizing: border-box;
8
8
  color: var(--bs-body-color);
@@ -51,14 +51,26 @@ table th {
51
51
  table tr {
52
52
  border-top: none;
53
53
  }
54
- table tr:first-child > td {
54
+ table tr:first-child > th:not(:nth-of-type(1)) {
55
55
  border-bottom: 1px solid var(--bs-border-color);
56
56
  }
57
- table tr:nth-of-type(2) > th:not(:nth-of-type(1)) {
57
+ table tr:not(:first-child) > th:nth-of-type(1) {
58
+ border-right: 1px solid var(--bs-border-color);
59
+ }
60
+
61
+ .calendar-nav {
62
+ display: flex;
63
+ align-items: center;
58
64
  border-bottom: 1px solid var(--bs-border-color);
59
65
  }
60
- table tr:not(:nth-of-type(2)) > th:nth-of-type(1) {
61
- border-right: 1px solid var(--bs-border-color);
66
+ .calendar-nav .chevron-btn {
67
+ flex: 0 0 auto;
68
+ width: auto;
69
+ padding: 0.25rem 0.5rem;
70
+ }
71
+ .calendar-nav .month-label {
72
+ flex: 1 1 auto;
73
+ text-align: center;
62
74
  }
63
75
 
64
76
  .chevron-btn {
@@ -88,14 +100,26 @@ table tr:not(:nth-of-type(2)) > th:nth-of-type(1) {
88
100
 
89
101
  .month-label {
90
102
  font-weight: bolder;
91
- }`), m = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/></svg>', M = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/></svg>';
92
- let w = 0;
93
- class y extends D {
103
+ }
104
+
105
+ .visually-hidden {
106
+ position: absolute;
107
+ width: 1px;
108
+ height: 1px;
109
+ padding: 0;
110
+ margin: -1px;
111
+ overflow: hidden;
112
+ clip: rect(0, 0, 0, 0);
113
+ white-space: nowrap;
114
+ border: 0;
115
+ }`), m = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/></svg>', w = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/></svg>';
116
+ let M = 0;
117
+ class y extends p {
94
118
  constructor() {
95
- super(...arguments), this.selectedDate = null, this.currentMonth = null, this.disableDateFn = null, this.min = null, this.max = null, this.firstDayOfWeek = 1, this.locale = void 0, this._focusedDate = null, this.pendingFocusMove = !1, this.instanceId = `mp-cal-${++w}`, this.monthLabelId = `${this.instanceId}-month`;
119
+ super(...arguments), this.selectedDate = null, this.currentMonth = null, this.disableDateFn = null, this.min = null, this.max = null, this.firstDayOfWeek = 1, this.locale = void 0, this._focusedDate = null, this.pendingFocusMove = !1, this.instanceId = `mp-cal-${++M}`, this.monthLabelId = `${this.instanceId}-month`;
96
120
  }
97
121
  static {
98
- this.styles = [p];
122
+ this.styles = [D];
99
123
  }
100
124
  static {
101
125
  this.properties = {
@@ -112,40 +136,40 @@ class y extends D {
112
136
  connectedCallback() {
113
137
  super.connectedCallback(), this.currentMonth === null && (this.currentMonth = /* @__PURE__ */ new Date());
114
138
  }
115
- updated(t) {
139
+ updated(e) {
116
140
  if (this.pendingFocusMove) {
117
141
  this.pendingFocusMove = !1;
118
- const e = this._focusedDate;
119
- e && this.renderRoot.querySelector(
120
- `[id="${this.cellId(e)}"]`
142
+ const t = this._focusedDate;
143
+ t && this.renderRoot.querySelector(
144
+ `[id="${this.cellId(t)}"]`
121
145
  )?.focus();
122
146
  }
123
147
  }
124
- cellId(t) {
125
- return `${this.instanceId}-cell-${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`;
148
+ cellId(e) {
149
+ return `${this.instanceId}-cell-${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`;
126
150
  }
127
- isSameDate(t, e) {
128
- return t === null && e === null ? !0 : t === null || e === null ? !1 : t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
151
+ isSameDate(e, t) {
152
+ return e === null && t === null ? !0 : e === null || t === null ? !1 : e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
129
153
  }
130
- isToday(t) {
131
- return this.isSameDate(t, /* @__PURE__ */ new Date());
154
+ isToday(e) {
155
+ return this.isSameDate(e, /* @__PURE__ */ new Date());
132
156
  }
133
157
  /** Disabled if out of [min, max] (date-only) or rejected by disableDateFn. */
134
- isDisabled(t) {
135
- return this.min && this.dateOnly(t) < this.dateOnly(this.min) || this.max && this.dateOnly(t) > this.dateOnly(this.max) ? !0 : !!this.disableDateFn && this.disableDateFn(t);
158
+ isDisabled(e) {
159
+ return this.min && this.dateOnly(e) < this.dateOnly(this.min) || this.max && this.dateOnly(e) > this.dateOnly(this.max) ? !0 : !!this.disableDateFn && this.disableDateFn(e);
136
160
  }
137
- dateOnly(t) {
138
- return new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime();
161
+ dateOnly(e) {
162
+ return new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime();
139
163
  }
140
164
  /** Compute the weeks rendered for the current month, honoring firstDayOfWeek. */
141
- getWeeks(t) {
142
- const e = new Date(t.getFullYear(), t.getMonth(), 1), n = new Date(t.getFullYear(), t.getMonth() + 1, 0), r = this.startOfWeek(e), i = this.endOfWeek(n), s = this.daysBetween(r, i) + 1, l = [];
165
+ getWeeks(e) {
166
+ const t = new Date(e.getFullYear(), e.getMonth(), 1), n = new Date(e.getFullYear(), e.getMonth() + 1, 0), r = this.startOfWeek(t), i = this.endOfWeek(n), s = this.daysBetween(r, i) + 1, l = [];
143
167
  for (let a = 0; a < s; a++) {
144
168
  const h = new Date(r.getFullYear(), r.getMonth(), r.getDate() + a);
145
169
  l.push({
146
170
  date: h,
147
171
  dayOfMonth: h.getDate(),
148
- isInMonth: h.getFullYear() === t.getFullYear() && h.getMonth() === t.getMonth()
172
+ isInMonth: h.getFullYear() === e.getFullYear() && h.getMonth() === e.getMonth()
149
173
  });
150
174
  }
151
175
  const o = [];
@@ -159,54 +183,59 @@ class y extends D {
159
183
  return o;
160
184
  }
161
185
  /** First day of the visible grid — Monday-on-top by default. */
162
- startOfWeek(t) {
163
- const n = (t.getDay() - this.firstDayOfWeek + 7) % 7;
164
- return new Date(t.getFullYear(), t.getMonth(), t.getDate() - n);
186
+ startOfWeek(e) {
187
+ const n = (e.getDay() - this.firstDayOfWeek + 7) % 7;
188
+ return new Date(e.getFullYear(), e.getMonth(), e.getDate() - n);
165
189
  }
166
- endOfWeek(t) {
167
- const e = t.getDay(), n = (this.firstDayOfWeek + 6 - e + 7) % 7;
168
- return new Date(t.getFullYear(), t.getMonth(), t.getDate() + n);
190
+ endOfWeek(e) {
191
+ const t = e.getDay(), n = (this.firstDayOfWeek + 6 - t + 7) % 7;
192
+ return new Date(e.getFullYear(), e.getMonth(), e.getDate() + n);
169
193
  }
170
- daysBetween(t, e) {
171
- return Math.floor((this.dateOnly(e) - this.dateOnly(t)) / 864e5);
194
+ daysBetween(e, t) {
195
+ return Math.floor((this.dateOnly(t) - this.dateOnly(e)) / 864e5);
172
196
  }
173
197
  /** ISO-8601 week-of-year. */
174
- weekOfYear(t) {
175
- const e = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate()));
176
- e.setUTCDate(e.getUTCDate() + 4 - (e.getUTCDay() || 7));
177
- const n = new Date(Date.UTC(e.getUTCFullYear(), 0, 1));
178
- return Math.ceil(((e.getTime() - n.getTime()) / 864e5 + 1) / 7);
198
+ weekOfYear(e) {
199
+ const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()));
200
+ t.setUTCDate(t.getUTCDate() + 4 - (t.getUTCDay() || 7));
201
+ const n = new Date(Date.UTC(t.getUTCFullYear(), 0, 1));
202
+ return Math.ceil(((t.getTime() - n.getTime()) / 864e5 + 1) / 7);
179
203
  }
180
204
  /** Localized weekday short + long names, in the order driven by firstDayOfWeek. */
181
205
  weekdayNames() {
182
- const t = new Date(2024, 0, 7), e = [];
206
+ const e = new Date(2024, 0, 7), t = [];
183
207
  for (let n = 0; n < 7; n++) {
184
- const r = new Date(t);
185
- r.setDate(t.getDate() + (this.firstDayOfWeek + n) % 7), e.push({
208
+ const r = new Date(e);
209
+ r.setDate(e.getDate() + (this.firstDayOfWeek + n) % 7), t.push({
186
210
  short: r.toLocaleString(this.locale ?? "default", { weekday: "short" }),
187
211
  long: r.toLocaleString(this.locale ?? "default", { weekday: "long" })
188
212
  });
189
213
  }
190
- return e;
214
+ return t;
191
215
  }
192
- monthLabel(t) {
193
- const e = t.toLocaleString(this.locale ?? "default", { month: "long" });
194
- return `${e.charAt(0).toUpperCase()}${e.slice(1)} ${t.getFullYear()}`;
216
+ monthLabel(e) {
217
+ const t = e.toLocaleString(this.locale ?? "default", { month: "long" });
218
+ return `${t.charAt(0).toUpperCase()}${t.slice(1)} ${e.getFullYear()}`;
219
+ }
220
+ /** Focus the grid = focus its roving cell (dialog initial focus calls host.focus()). */
221
+ focus(e) {
222
+ const t = this.renderRoot.querySelector('[tabindex="0"]');
223
+ t ? t.focus(e) : super.focus(e);
195
224
  }
196
225
  /**
197
226
  * The cell that should carry tabindex="0". One per month — focused, else
198
227
  * selected, else today, else first enabled day. Mirrors APG convention.
199
228
  */
200
229
  focusableDate() {
201
- const t = this.currentMonth;
202
- if (!t) return null;
203
- const e = (o) => o.getFullYear() === t.getFullYear() && o.getMonth() === t.getMonth(), n = (o) => o && e(o) ? o : null, r = n(this._focusedDate);
230
+ const e = this.currentMonth;
231
+ if (!e) return null;
232
+ const t = (o) => o.getFullYear() === e.getFullYear() && o.getMonth() === e.getMonth(), n = (o) => o && t(o) ? o : null, r = n(this._focusedDate);
204
233
  if (r) return r;
205
234
  const i = n(this.selectedDate);
206
235
  if (i) return i;
207
236
  const l = n(/* @__PURE__ */ new Date());
208
237
  if (l) return l;
209
- for (const o of this.getWeeks(t))
238
+ for (const o of this.getWeeks(e))
210
239
  for (const a of o.days)
211
240
  if (a && a.isInMonth && !this.isDisabled(a.date)) return a.date;
212
241
  return null;
@@ -222,42 +251,42 @@ class y extends D {
222
251
  new Date(this.currentMonth.getFullYear(), this.currentMonth.getMonth() + 1, 1)
223
252
  );
224
253
  }
225
- goto(t) {
226
- !t || !t.isInMonth || this.isDisabled(t.date) || (this.setSelectedDate(t.date), this._focusedDate = t.date, this.requestUpdate());
254
+ goto(e) {
255
+ !e || !e.isInMonth || this.isDisabled(e.date) || (this.setSelectedDate(e.date), this._focusedDate = e.date, this.requestUpdate());
227
256
  }
228
257
  /* ---- Internal setters with event dispatch ---- */
229
- setCurrentMonth(t) {
230
- const e = this.currentMonth;
231
- e && this.isSameYearMonth(e, t) || (this.currentMonth = t, this.requestUpdate(), this.dispatchEvent(
258
+ setCurrentMonth(e) {
259
+ const t = this.currentMonth;
260
+ t && this.isSameYearMonth(t, e) || (this.currentMonth = e, this.requestUpdate(), this.dispatchEvent(
232
261
  new CustomEvent("current-month-change", {
233
- detail: new Date(t.getFullYear(), t.getMonth(), 1),
262
+ detail: new Date(e.getFullYear(), e.getMonth(), 1),
234
263
  bubbles: !0,
235
264
  composed: !0
236
265
  })
237
266
  ));
238
267
  }
239
- setSelectedDate(t) {
240
- this.selectedDate = t, this.requestUpdate(), this.dispatchEvent(
268
+ setSelectedDate(e) {
269
+ this.selectedDate = e, this.requestUpdate(), this.dispatchEvent(
241
270
  new CustomEvent("selected-date-change", {
242
- detail: new Date(t.getFullYear(), t.getMonth(), t.getDate()),
271
+ detail: new Date(e.getFullYear(), e.getMonth(), e.getDate()),
243
272
  bubbles: !0,
244
273
  composed: !0
245
274
  })
246
275
  );
247
276
  }
248
- isSameYearMonth(t, e) {
249
- return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth();
277
+ isSameYearMonth(e, t) {
278
+ return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
250
279
  }
251
280
  /* ---- Keyboard ---- */
252
- onCellKeyDown(t, e) {
253
- if (!e || !e.isInMonth) return;
254
- const n = t.key, r = n === "ArrowLeft" || n === "ArrowRight" || n === "ArrowUp" || n === "ArrowDown" || n === "Home" || n === "End" || n === "PageUp" || n === "PageDown", i = n === "Enter" || n === " ";
281
+ onCellKeyDown(e, t) {
282
+ if (!t || !t.isInMonth) return;
283
+ const n = e.key, r = n === "ArrowLeft" || n === "ArrowRight" || n === "ArrowUp" || n === "ArrowDown" || n === "Home" || n === "End" || n === "PageUp" || n === "PageDown", i = n === "Enter" || n === " ";
255
284
  if (!r && !i) return;
256
- if (t.preventDefault(), i) {
257
- this.goto(e);
285
+ if (e.preventDefault(), i) {
286
+ this.goto(t);
258
287
  return;
259
288
  }
260
- const s = e.date;
289
+ const s = t.date;
261
290
  let l = new Date(s);
262
291
  const o = getComputedStyle(this).direction === "rtl";
263
292
  switch (n) {
@@ -284,52 +313,54 @@ class y extends D {
284
313
  break;
285
314
  }
286
315
  case "PageUp":
287
- l = t.ctrlKey ? new Date(s.getFullYear() - 1, s.getMonth(), s.getDate()) : new Date(s.getFullYear(), s.getMonth() - 1, s.getDate());
316
+ l = e.ctrlKey ? new Date(s.getFullYear() - 1, s.getMonth(), s.getDate()) : new Date(s.getFullYear(), s.getMonth() - 1, s.getDate());
288
317
  break;
289
318
  case "PageDown":
290
- l = t.ctrlKey ? new Date(s.getFullYear() + 1, s.getMonth(), s.getDate()) : new Date(s.getFullYear(), s.getMonth() + 1, s.getDate());
319
+ l = e.ctrlKey ? new Date(s.getFullYear() + 1, s.getMonth(), s.getDate()) : new Date(s.getFullYear(), s.getMonth() + 1, s.getDate());
291
320
  break;
292
321
  }
293
322
  this.moveFocusTo(l);
294
323
  }
295
- moveFocusTo(t) {
296
- this.currentMonth && (this.isSameYearMonth(this.currentMonth, t) || this.setCurrentMonth(new Date(t.getFullYear(), t.getMonth(), 1)), this._focusedDate = t, this.pendingFocusMove = !0, this.requestUpdate());
324
+ moveFocusTo(e) {
325
+ this.currentMonth && (this.isSameYearMonth(this.currentMonth, e) || this.setCurrentMonth(new Date(e.getFullYear(), e.getMonth(), 1)), this._focusedDate = e, this.pendingFocusMove = !0, this.requestUpdate());
297
326
  }
298
327
  /* ---- Render ---- */
299
328
  render() {
300
- const t = this.currentMonth ?? /* @__PURE__ */ new Date(), e = this.getWeeks(t), n = this.weekdayNames(), r = this.focusableDate();
329
+ const e = this.currentMonth ?? /* @__PURE__ */ new Date(), t = this.getWeeks(e), n = this.weekdayNames(), r = this.focusableDate();
301
330
  return u`
331
+ <!-- The month-nav toolbar lives OUTSIDE the table: a presentational
332
+ row does not remove its BUTTONS from the grid's owned children,
333
+ so the grid still owned two role=button nodes — invalid
334
+ (axe aria-required-children, critical). -->
335
+ <div class="calendar-nav">
336
+ <button
337
+ type="button"
338
+ class="chevron-btn"
339
+ aria-label="Previous month"
340
+ @click="${() => this.previousMonth()}"
341
+ .innerHTML="${m}"
342
+ ></button>
343
+ <span id="${this.monthLabelId}" class="month-label" aria-live="polite">
344
+ ${this.monthLabel(e)}
345
+ </span>
346
+ <button
347
+ type="button"
348
+ class="chevron-btn"
349
+ aria-label="Next month"
350
+ @click="${() => this.nextMonth()}"
351
+ .innerHTML="${w}"
352
+ ></button>
353
+ </div>
302
354
  <table role="grid" aria-labelledby="${this.monthLabelId}">
303
- <tr>
304
- <td>
305
- <button
306
- type="button"
307
- class="chevron-btn"
308
- aria-label="Previous month"
309
- @click="${() => this.previousMonth()}"
310
- .innerHTML="${m}"
311
- ></button>
312
- </td>
313
- <td colspan="6" id="${this.monthLabelId}" class="month-label" aria-live="polite">
314
- ${this.monthLabel(t)}
315
- </td>
316
- <td>
317
- <button
318
- type="button"
319
- class="chevron-btn"
320
- aria-label="Next month"
321
- @click="${() => this.nextMonth()}"
322
- .innerHTML="${M}"
323
- ></button>
324
- </td>
325
- </tr>
326
355
  <tr role="row">
327
- <th aria-hidden="true"></th>
356
+ <!-- The week-number column's header: hidden it left every
357
+ rowheader in an unlabelled column. Visually empty, spoken. -->
358
+ <th scope="col" role="columnheader"><span class="visually-hidden">Week</span></th>
328
359
  ${n.map(
329
360
  (i) => u`<th scope="col" role="columnheader" title="${i.long}">${i.short}</th>`
330
361
  )}
331
362
  </tr>
332
- ${e.map(
363
+ ${t.map(
333
364
  (i) => u`
334
365
  <tr role="row">
335
366
  <th scope="row" role="rowheader">${i.number}</th>
@@ -340,10 +371,10 @@ class y extends D {
340
371
  </table>
341
372
  `;
342
373
  }
343
- renderCell(t, e) {
344
- const n = !!t && t.isInMonth, r = !!t && this.isDisabled(t.date), i = !!t && t.isInMonth && this.isSameDate(this.selectedDate, t.date), s = !!t && t.isInMonth && this.isToday(t.date), l = !!t && t.isInMonth && this.isSameDate(e, t.date), o = [];
374
+ renderCell(e, t) {
375
+ const n = !!e && e.isInMonth, r = !!e && this.isDisabled(e.date), i = !!e && e.isInMonth && this.isSameDate(this.selectedDate, e.date), s = !!e && e.isInMonth && this.isToday(e.date), l = !!e && e.isInMonth && this.isSameDate(t, e.date), o = [];
345
376
  i && o.push("selected"), n && !r && o.push("cursor-pointer");
346
- const a = o.length ? o.join(" ") : void 0, h = t && t.isInMonth ? this.cellId(t.date) : void 0;
377
+ const a = o.length ? o.join(" ") : void 0, h = e && e.isInMonth ? this.cellId(e.date) : void 0;
347
378
  return u`<td
348
379
  role="gridcell"
349
380
  id="${h ?? c}"
@@ -352,10 +383,10 @@ class y extends D {
352
383
  aria-selected="${n ? i ? "true" : "false" : c}"
353
384
  aria-current="${s ? "date" : c}"
354
385
  aria-disabled="${r ? "true" : c}"
355
- @click="${() => this.goto(t)}"
356
- @keydown="${(d) => this.onCellKeyDown(d, t)}"
386
+ @click="${() => this.goto(e)}"
387
+ @keydown="${(d) => this.onCellKeyDown(d, e)}"
357
388
  >
358
- ${n ? u`<span class="${r ? "text-muted" : ""}">${t.dayOfMonth}</span>` : c}
389
+ ${n ? u`<span class="${r ? "text-muted" : ""}">${e.dayOfMonth}</span>` : c}
359
390
  </td>`;
360
391
  }
361
392
  }