@sbb-esta/lyne-elements-dev 5.14.0-dev.1795683754 → 5.14.0-dev.1795700857

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.
@@ -17,7 +17,10 @@ export interface Day<T = Date> {
17
17
  monthValue: string;
18
18
  yearValue: string;
19
19
  dateValue: T;
20
+ /** ISO 8601 week number. */
20
21
  weekValue: number;
22
+ /** ISO 8601 week-numbering year, which can differ from `yearValue` at the turn of the year. */
23
+ weekYearValue?: number;
21
24
  weekDayValue: number;
22
25
  }
23
26
  export interface MonthCell {
@@ -109,12 +112,6 @@ export declare class SbbCalendarElement<T = Date> extends SbbCalendarElement_bas
109
112
  /** An array containing the weeks' numbers for the current month. */
110
113
  private _weekNumbers;
111
114
  private _enhancedVariant;
112
- /** A list of calendar's cells corresponding to days, months or years depending on the view. */
113
- private get _cells();
114
- /** A list of calendar's weekday cells. */
115
- private get _weekdayCells();
116
- /** A list of calendar's weeknumber cells. */
117
- private get _weekNumberCells();
118
115
  /** The chosen year in the year selection view. */
119
116
  private _chosenYear?;
120
117
  /** The chosen month in the year selection view. */
@@ -126,8 +123,34 @@ export declare class SbbCalendarElement<T = Date> extends SbbCalendarElement_bas
126
123
  private _lastSelection;
127
124
  private accessor _initialized;
128
125
  private _language;
129
- private get _tabbableGroups();
130
126
  constructor();
127
+ /** A list of calendar's cells corresponding to days, months or years depending on the view. */
128
+ private _cells;
129
+ /** A list of calendar's month cells. */
130
+ private _yearCells;
131
+ /** A list of calendar's month cells. */
132
+ private _monthCells;
133
+ /** Returns the rendered or slotted days within the given root. */
134
+ private _dayCells;
135
+ /** A list of calendar's weekday cells. */
136
+ private _weekdayCells;
137
+ /** A list of calendar's weeknumber cells. */
138
+ private _weekNumberCells;
139
+ private _selectAllButtons;
140
+ /** Returns the day, weekday, week number or select-all cell the event originates from. */
141
+ private _resolveHeaderNavigationCell;
142
+ /**
143
+ * Each table provides two tab stops: the header cells (select-all, weekdays and week numbers)
144
+ * and the days. Arrow keys move within a tab stop, Tab moves between them.
145
+ */
146
+ private _handleCellKeydown;
147
+ /** Returns the day of the given table which should receive focus when tabbing into the days. */
148
+ private _getDayTabStop;
149
+ /**
150
+ * Weekdays are navigated along the orientation axis, week numbers along the other one.
151
+ * The select-all buttons belong to both groups. Navigation spans over all tables.
152
+ */
153
+ private _getNextNavigationHeaderCell;
131
154
  private readonly _sortDate;
132
155
  private _dateFilter;
133
156
  private _parseMonth;
@@ -192,7 +215,6 @@ export declare class SbbCalendarElement<T = Date> extends SbbCalendarElement_bas
192
215
  */
193
216
  private _createWeekRowsVertical;
194
217
  private _mapDateToDay;
195
- private _getWeek;
196
218
  /** Force the conversion to ISO8601 formatted string. */
197
219
  private _mapValueToISODate;
198
220
  /** Creates the rows for the month selection view. */
@@ -253,25 +275,22 @@ export declare class SbbCalendarElement<T = Date> extends SbbCalendarElement_bas
253
275
  private _nextYearRangeDisabled;
254
276
  private _handleTableBlur;
255
277
  private _setTabIndex;
256
- private _setWeekFocus;
257
278
  /** Get the element in the calendar to assign focus. */
258
279
  private _getFirstFocusable;
259
280
  /**
260
- * In `day` view in `vertical` orientation,
261
- * if the first of the month is not a Monday, it is not the first rendered element in the table,
262
- * so `this.shadowRoot!.querySelector('sbb-calendar-day:not([disabled])')` will return a wrong value.
263
- *
264
- * To solve this, the element with the lowest `value` is taken (ISO String are ordered).
281
+ * Returns the enabled day with the earliest date.
282
+ * In `vertical` orientation, the DOM order does not match the date order (e.g. if the first of
283
+ * the month is not a Monday), so the days are compared by their slot name (ISO string).
265
284
  */
266
285
  private _getFirstFocusableDay;
267
- private _handleKeyboardEventWeek;
268
286
  private _handleKeyboardEvent;
269
287
  private _navigateByKeyboardDayView;
270
288
  private _isDayOutOfView;
271
- private _findDayArrows;
272
- private _findDayPageUpDown;
273
- private _findDayFirst;
274
- private _findDayLast;
289
+ /**
290
+ * Starting from `date`, moves by `step` days until an enabled day is found.
291
+ * Returns `fallback` if the visible range is left before.
292
+ */
293
+ private _findEnabledDay;
275
294
  /**
276
295
  * Gets the index of the element to move to, based on a list of elements (which can be potentially disabled),
277
296
  * the keyboard input and the position of the current element in the list.
@@ -302,11 +321,23 @@ export declare class SbbCalendarElement<T = Date> extends SbbCalendarElement_bas
302
321
  private _resetCalendarView;
303
322
  /** Creates the calendar table for the daily view. */
304
323
  private _createDayTable;
305
- /** Creates the table in orientation='vertical'. */
306
- private _createDayTableVertical;
324
+ /** Weekdays are rendered as columns, weeks as rows. */
325
+ private _createDayTableHorizontalContent;
326
+ /** Weekdays are rendered as rows, weeks as columns. */
327
+ private _createDayTableVerticalContent;
307
328
  private _createDayTableControls;
308
329
  /** Creates the cells for the daily view. */
309
330
  private _createDayCells;
331
+ /**
332
+ * Returns true if at least one of the given days, which can be selected
333
+ * (within min/max and not filtered out), is not selected yet.
334
+ */
335
+ private _hasUnselectedDays;
336
+ /** Weekday header cell, which selects all given days if multiple selection is enabled. */
337
+ private _weekdayCell;
338
+ /** Week number header cell, which selects the days of the given week if multiple selection is enabled. */
339
+ private _weekNumberCell;
340
+ private _selectAllButton;
310
341
  /** Render the view for the month selection. */
311
342
  private _renderMonthView;
312
343
  /** Select the month and change the view to day selection. */
@@ -318,6 +349,9 @@ export declare class SbbCalendarElement<T = Date> extends SbbCalendarElement_bas
318
349
  /** Creates the button arrow for all the views. */
319
350
  private _getArrow;
320
351
  private _getView;
352
+ private _applyElementInternalsAriaLabel;
353
+ /** Hidden descriptions referenced by the header cells via aria-describedby. */
354
+ private _navigationHints;
321
355
  protected render(): TemplateResult;
322
356
  }
323
357
  declare global {
@@ -0,0 +1,18 @@
1
+ import { type TemplateResult } from 'lit';
2
+ import { SbbCalendarCellBaseElement } from '../common/calendar-cell-base-element.ts';
3
+ declare const SbbCalendarSelectAllElement_base: import("../../core.ts").AbstractConstructor<import("../../icon.pure.ts").SbbIconNameMixinType> & typeof SbbCalendarCellBaseElement;
4
+ /**
5
+ * It displays a toggle all button inside the `sbb-calendar` component.
6
+ */
7
+ export declare class SbbCalendarSelectAllElement extends SbbCalendarSelectAllElement_base {
8
+ static readonly elementName: string;
9
+ /** @internal */
10
+ value: unknown;
11
+ protected renderTemplate(): TemplateResult;
12
+ }
13
+ declare global {
14
+ interface HTMLElementTagNameMap {
15
+ 'sbb-calendar-select-all': SbbCalendarSelectAllElement;
16
+ }
17
+ }
18
+ export {};
@@ -5,7 +5,6 @@ import { SbbCalendarCellBaseElement } from '../common/calendar-cell-base-element
5
5
  */
6
6
  export declare class SbbCalendarWeeknumberElement extends SbbCalendarCellBaseElement {
7
7
  static readonly elementName: string;
8
- private _language;
9
8
  /** Value of the week number element. */
10
9
  set value(value: string | null);
11
10
  get value(): string | null;
@@ -6,8 +6,8 @@ export declare abstract class SbbCalendarCellBaseElement<T = Date> extends SbbCa
6
6
  static styles: CSSResultGroup;
7
7
  protected dateAdapter: DateAdapter;
8
8
  constructor();
9
- protected abstract setDisabledFilteredState(parent: SbbCalendarElement<T>): void;
10
- protected abstract setSelectedState(parent: SbbCalendarElement<T>): void;
9
+ protected setDisabledFilteredState?(parent: SbbCalendarElement<T>): void;
10
+ protected setSelectedState?(parent: SbbCalendarElement<T>): void;
11
11
  protected getParent(): SbbCalendarElement<T> | null;
12
12
  /**
13
13
  * Intentionally empty, as buttons are not targeted by form reset.
@@ -1,4 +1,4 @@
1
- import { SbbCalendarDayElement, SbbCalendarElement, SbbCalendarMonthElement, SbbCalendarWeekdayElement, SbbCalendarWeeknumberElement, SbbCalendarYearElement } from "./calendar.pure.js";
1
+ import { SbbCalendarDayElement, SbbCalendarElement, SbbCalendarMonthElement, SbbCalendarSelectAllElement, SbbCalendarWeekdayElement, SbbCalendarWeeknumberElement, SbbCalendarYearElement } from "./calendar.pure.js";
2
2
 
3
3
  export * from "./calendar.pure.js"
4
4
 
@@ -10,3 +10,4 @@ SbbCalendarMonthElement.define();
10
10
  SbbCalendarYearElement.define();
11
11
  SbbCalendarWeekdayElement.define();
12
12
  SbbCalendarWeeknumberElement.define();
13
+ SbbCalendarSelectAllElement.define();
@@ -6,3 +6,4 @@ export * from './calendar/calendar-weekday/calendar-weekday.component.ts';
6
6
  export * from './calendar/calendar-weeknumber/calendar-weeknumber.component.ts';
7
7
  export * from './calendar/calendar/calendar.component.ts';
8
8
  export * from './calendar/common/calendar-cell-base-element.ts';
9
+ export * from './calendar/calendar-select-all/calendar-select-all.component.ts';