@sixbell-telco/sdk 4.9.0 → 4.10.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 (34) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/components/alert/src/alert.component.d.ts +8 -1
  3. package/components/data-table/README.md +1 -0
  4. package/components/file-upload/file-dropzone/file-dropzone.component.d.ts +12 -0
  5. package/components/file-upload/file-uploader/file-uploader.component.d.ts +6 -0
  6. package/components/forms/combobox/README.md +41 -1
  7. package/components/forms/combobox/src/combobox.component.d.ts +134 -3
  8. package/components/forms/select/README.md +41 -1
  9. package/components/forms/select/src/select.component.d.ts +119 -3
  10. package/components/forms/textarea/src/textarea.component.d.ts +6 -1
  11. package/components/progress/src/progress.component.d.ts +17 -3
  12. package/components/table/README.md +2 -0
  13. package/components/table/src/table.component.d.ts +13 -0
  14. package/fesm2022/sixbell-telco-sdk-components-alert.mjs +12 -5
  15. package/fesm2022/sixbell-telco-sdk-components-alert.mjs.map +1 -1
  16. package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +2 -2
  17. package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
  18. package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +32 -6
  19. package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
  20. package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +204 -21
  21. package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
  22. package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +189 -17
  23. package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
  24. package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +11 -3
  25. package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
  26. package/fesm2022/sixbell-telco-sdk-components-progress.mjs +22 -4
  27. package/fesm2022/sixbell-telco-sdk-components-progress.mjs.map +1 -1
  28. package/fesm2022/sixbell-telco-sdk-components-table.mjs +39 -5
  29. package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
  30. package/i18n/sdk/en.json +7 -1
  31. package/i18n/sdk/es.json +7 -1
  32. package/i18n/sdk/pt.json +7 -1
  33. package/manifest.json +95 -9
  34. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [4.10.0] - 2026-12-02
11
+
12
+ ### Added
13
+
14
+ - **st-select, st-combobox**: `panelWidth="content"` sizes the list to its widest option (capped, one line per option, ellipsis and title past the cap; searching never resizes it) and `fitOptions` sizes the closed control to its widest option; the trigger width is measured without rounding down, so an option that exactly fills the control no longer wraps
15
+ - **st-select, st-combobox**: `groupKey` lists options under non-selectable group headers, `checkedKey` shows a dimmed check on already-taken options without adding them to the value, and the option panel fades its scroll edges (`scroll-fade-y`)
16
+
17
+ ### Changed
18
+
19
+ - **st-select, st-combobox**: option descriptions sit inline, right-aligned before the check (the label keeps whole words, the description truncates); group headers use the dropdown section-label look with a separator line between sections
20
+
21
+ ### Fixed
22
+
23
+ - **st-select, st-combobox**: the selected option is the active row when the panel opens; cut-off options show their full text on keyboard focus too. **st-table, st-data-table**: the items-per-page select keeps each option on one line; st-table's horizontal scroll area fades its edges and becomes a focusable, named region while it overflows
24
+ - **File upload**: `st-file-dropzone` is a named button (`sdk.fileUpload.dropzone.chooseFiles`) described by its size, type or error text; `st-file-uploader` adds a real "Choose file" button (`sdk.fileUpload.fileUploader.chooseFile`) that opens the picker. New keys in es/en/pt
25
+ - **Alert**: `st-alert-actions` moves to its own row under the text when the alert is narrower than 28rem (container query); the wide layout is unchanged
26
+ - **Progress**: new `ariaLabel` input (default `sdk.progress.label`); a determinate bar exposes `aria-valuenow`/`min`/`max`/`valuetext`, and the printed label is the percentage of `max` (rounded) instead of the raw value
27
+ - **Textarea**: with `maxCharacters` set, the textarea is described by its character counter and gets a native `maxlength`, so typing stops at the limit
28
+
29
+ ### Consumer upgrade
30
+
31
+ - Move a host and every remote it loads to 4.10.0 together: the SDK is a strict federation singleton. No `ng update` migration runs for 4.10.0
32
+ - Select and combobox options that sat in sections or showed "already added" through label tricks: use `groupKey` and `checkedKey`
33
+ - A hidden sizer next to a select or combobox (a `<span>` copying kit padding and text size to widen the control or its list): remove it and use `panelWidth="content"` or `fitOptions` (SBP-104)
34
+ - `st-textarea` with `maxCharacters` now sets a native `maxlength`, so typing stops at the limit instead of going past it with a red counter
35
+ - `st-progress` prints the percentage of `max` (value/max*100, rounded) instead of the raw value; a bar with `max` other than 100 shows a different number. Name bars that sit without a visible label through `ariaLabel`
36
+ - New i18n keys (es/en/pt): `sdk.fileUpload.dropzone.chooseFiles`, `sdk.fileUpload.fileUploader.chooseFile`, `sdk.progress.label`. Apps that override the SDK bundle add them
37
+ - sdk-tools 0.1.6 with eslint-plugin-sdk 0.1.2 adds the warnings `scroll-fade` (DS_SCROLL_FADE) and `dialog-content-scroll` (UI_DIALOG_SCROLL_001), and `check --baseline`/`--since` to fail CI only on new findings
38
+
10
39
  ## [4.9.0] - 2026-12-02
11
40
 
12
41
  ### Added
@@ -78,8 +78,15 @@ export declare class AlertComponent {
78
78
  static ɵfac: i0.ɵɵFactoryDeclaration<AlertComponent, never>;
79
79
  static ɵcmp: i0.ɵɵComponentDeclaration<AlertComponent, "st-alert", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "heading": { "alias": "heading"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "showIcon": { "alias": "showIcon"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "assertive": { "alias": "assertive"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, { "dismissed": "dismissed"; }, never, ["*", "st-alert-actions"], true, never>;
80
80
  }
81
- /** Action area of `st-alert`, aligned after the body. */
81
+ /**
82
+ * Action area of `st-alert`. From a 28rem wide alert up it sits after the body on the same row;
83
+ * below that it wraps to its own row under the text, so the text keeps its width on phones.
84
+ */
82
85
  export declare class AlertActionsComponent {
86
+ /** @internal */
87
+ private readonly alert;
88
+ /** @internal Under the text on narrow alerts (indented past the icon), after it from `@md`. */
89
+ protected readonly componentClass: import("@angular/core").Signal<string>;
83
90
  static ɵfac: i0.ɵɵFactoryDeclaration<AlertActionsComponent, never>;
84
91
  static ɵcmp: i0.ɵɵComponentDeclaration<AlertActionsComponent, "st-alert-actions", never, {}, {}, never, ["*"], true, never>;
85
92
  }
@@ -90,6 +90,7 @@ The data table finds the projected component through the `TABLE_EMPTY_STATE` inj
90
90
 
91
91
  ## Accessibility
92
92
 
93
+ - Items per page: the footer `st-select` uses `fitOptions`, so it is as wide as its longest option ("100 / página") and the chosen value never wraps.
93
94
  - `st-data-table-sortable-header` (and the sort button of `st-data-table-expandable-header-cell`) sets `aria-sort="ascending"` or `"descending"` on its closest `th` (or `[role=columnheader]`) and removes it while the column is unsorted. Render the header inside the `th` for this to work.
94
95
  - To manage the attribute yourself, set `syncHeaderAriaSort` to `false` and bind the helper on the `th`:
95
96
 
@@ -146,6 +146,18 @@ export declare class DropzoneComponent implements ControlValueAccessor {
146
146
  iconDelete: string;
147
147
  iconDownload: string;
148
148
  private readonly translateLabel;
149
+ /** @internal Accessible name of the dropzone, which acts as a button that opens the file picker. */
150
+ protected readonly dropzoneLabel: import("@angular/core").Signal<string>;
151
+ /** @internal */
152
+ private readonly idPrefix;
153
+ /** @internal Id of the max size hint. */
154
+ protected readonly maxSizeId: string;
155
+ /** @internal Id of the allowed types hint. */
156
+ protected readonly allowedTypesId: string;
157
+ /** @internal Id of the error message. */
158
+ protected readonly errorId: string;
159
+ /** @internal Ids of the visible error, or of the size and type hints, that describe the dropzone button. */
160
+ protected readonly hintIds: import("@angular/core").Signal<string | null>;
149
161
  /** @internal Names of the icon-only file action buttons. */
150
162
  protected readonly fileActionLabels: import("@angular/core").Signal<{
151
163
  download: string;
@@ -115,6 +115,12 @@ export declare class FileUploaderComponent implements ControlValueAccessor {
115
115
  * @internal
116
116
  */
117
117
  formattedExtensions: import("@angular/core").Signal<string>;
118
+ /** @internal */
119
+ private readonly translateLabel;
120
+ /** @internal Accessible name of the button that opens the file picker. */
121
+ protected readonly triggerLabel: import("@angular/core").Signal<string>;
122
+ /** @internal Icon of the file picker button. */
123
+ protected readonly iconUpload = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M9 16h6v-6h4l-7-7l-7 7h4zm-4 2h14v2H5z\"></path></svg>";
118
124
  /**
119
125
  * Reference to the hidden file input
120
126
  * @internal
@@ -19,6 +19,30 @@ Searchable select. Clear is a sibling of the trigger; the chevron is a custom ic
19
19
  ></st-combobox>
20
20
  ```
21
21
 
22
+ ## Width
23
+
24
+ The control's width is measured with `getBoundingClientRect()` and rounded up, so a panel that copies it is never a fraction of a pixel narrower than the control (an option that exactly fills the control no longer wraps).
25
+
26
+ - `panelWidth` (`'trigger' | 'content'`, default `'trigger'`). `'trigger'` keeps the panel as wide as the control, as before; a long option wraps. `'content'` makes the panel at least as wide as the control and wider when an option needs it, up to `min(28rem, 100vw - 2rem)`. The width is measured over every option, not the filtered list, so typing in the search never resizes the panel. Options stay on one line, with the check slot reserved on every row. Past the cap the description is cut first, then the label, both with an ellipsis; hovering a cut-off row, or making it the keyboard-active row, shows its full text (`Label, Description`) as a `title`. The accessible name and keyboard navigation do not change. Near the viewport edge the panel aligns to the control's end instead of overflowing, and it still flips above the control when there is no room below.
27
+ - `fitOptions` (boolean, default `false`) sizes the closed control to its widest option or its placeholder. A hidden sizer in the component's own template stacks every option row with the option row's classes and the menu size of the current `size` (label, description and check slot), plus every label in the control's own font, so CSS takes the widest in real pixels. The room of the clear button is kept while nothing is chosen, so the control keeps its width between selections and a chosen value is never cut off. In `multiple` mode the `+N` badge next to the first value is not counted. The sizer is capped like the panel (`min(28rem, 100vw - 2rem)`), so one very long option cannot widen the control past the panel. The element becomes `inline-block align-top shrink-0`: it shrinks to that width in a block, `align-top` keeps it from sitting on the text baseline (no stray gap below it in a line box) and does not shrink in a flex row that scrolls (`overflow-x-auto`). `min-w-*` and `w-*` classes on the element still apply; a narrower `w-*` cuts the value with an ellipsis.
28
+ - How they combine: `fitOptions` implies `panelWidth="content"`, so setting both is the same as `fitOptions` alone. With a fitted control the panel ends up as wide as the control; it only grows past it when a `w-*` or `max-w-*` class makes the control narrower than its options.
29
+
30
+ ```html
31
+ <!-- A short filter whose panel shows every option on one line -->
32
+ <st-combobox
33
+ class="min-w-28"
34
+ size="sm"
35
+ panelWidth="content"
36
+ [options]="['All', 'OC_ACN_MISMATCH', 'WHITELIST_GTO', 'BLACKLIST_MSISDN']"
37
+ [(value)]="filter"
38
+ ></st-combobox>
39
+
40
+ <!-- A control as wide as its widest option, in a scrolling filter bar -->
41
+ <div class="flex gap-4 overflow-x-auto">
42
+ <st-combobox size="sm" fitOptions [options]="refreshOptions" displayKey="label" valueKey="seconds" [(value)]="refresh"></st-combobox>
43
+ </div>
44
+ ```
45
+
22
46
  ## Notes
23
47
 
24
48
  - `allowClear` keeps the clear control in tab order after the trigger. Do not nest a button in the trigger.
@@ -26,11 +50,27 @@ Searchable select. Clear is a sibling of the trigger; the chevron is a custom ic
26
50
  - `selectionType` is `'single'` or `'multiple'`.
27
51
  - Async options: a value written through the form (`writeValue`) before its options exist is kept and resolved, with its label, once a matching option arrives, without calling `onChange` (the control stays pristine). It is resolved again whenever `options` is replaced, so a list that is filtered or reloaded later still shows the label. A user selection, clear or `writeValue(null)` replaces it (clear is ignored while disabled). In `multiple` mode the values that match show right away and the ones without an option stay pending in the form, showing when their option arrives; a user toggle emits the visible values plus the still-pending ones, so nothing the form holds is silently dropped. Pending values are cleared by `writeValue`, a reset or a user clear.
28
52
  - Disabled options: `disabledKey` names the option property that disables it when truthy. The option stays in the list and in search results, is dimmed with the kit's disabled colors (`--color-disabled-content`), carries `aria-disabled="true"` and cannot be chosen by click, Enter or Space. The arrow keys skip them; Home and End stay on the search text. In `multiple` mode a disabled option is never added, by click or Enter. Without `disabledKey` every option is enabled.
29
- - Secondary text: `descriptionKey` names an option property shown as a second line under the label (for example why the option is disabled). It is part of the option's accessible name.
53
+ - Secondary text: `descriptionKey` names an option property shown on the same row as the label, right-aligned in the muted colour before the check (for example why the option is disabled). A long label wraps first; a long description is cut with an ellipsis rather than pushed under the label. It is part of the option's accessible name (read as "Label, Description").
54
+ - Option groups: `groupKey` names an option property holding its group. Options that share a value are listed under one header showing that value, styled like the dropdown section label (`st-dropdown-label`) with a separator line before it unless it opens the list, groups in the order they first appear; options without the property are listed first, ungrouped. Each group is a `role="group"` with `aria-labelledby` pointing at its header (ids unique per instance). Headers cannot be chosen. The arrow keys and `aria-activedescendant` follow the listed order and skip headers; disabled options stay skipped. A group whose options are all filtered out by the search hides its header. Without `groupKey` the list is flat, in the given order.
55
+ - Already-taken options: `checkedKey` names an option property that, when truthy, shows the check icon on the option without making it part of the value: it never appears in the trigger or counts as selected. Pair it with `disabledKey` so the check is dimmed with the option text (`--color-disabled-content`), the option carries `aria-disabled="true"` and it cannot be chosen again; use `descriptionKey` to say why. Without `disabledKey` the check is only a marker and the option can still be chosen.
56
+ - Scrolling: the option list fades its top and bottom edges while there is more to scroll to (`scroll-fade-y`) and contains its overscroll.
30
57
  - Validation errors: inside `st-form-item` with `st-form-errors`, the `role="combobox"` trigger gets `aria-invalid="true"` while its control is invalid and touched or dirty, and the error message id joins the hint ids in its `aria-describedby`. See [Form Error](../form-error/README.md).
31
58
  - Listbox: the trigger has `aria-haspopup="listbox"` and `aria-controls` pointing at the listbox's generated id (unique per instance). The listbox is named by the `label`, or by the trigger when there is no `label`. With no matches it shows `noResultsText`, else `sdk.combobox.noResultsFound` ("No results found" when no translation is loaded).
32
59
  - Search input: while the panel is open it has focus and is the combobox: `role="combobox"`, `aria-autocomplete="list"`, `aria-expanded`, `aria-controls` (the listbox id) and `aria-activedescendant`, the id of the option the arrow keys made active (disabled options are skipped), so screen readers announce it.
60
+ - When the panel opens in `single` mode with a value, the selected option (the one with the check) is the active row, so the highlight and the check sit on the same option. Without a value, in `multiple` mode, or when the selected option is disabled, the first enabled option is active. Typing a search moves the active row to the first match.
33
61
 
34
62
  ```html
35
63
  <st-combobox [options]="countries" displayKey="name" valueKey="code" disabledKey="added" descriptionKey="note" [(value)]="country"></st-combobox>
36
64
  ```
65
+
66
+ ```html
67
+ <st-combobox
68
+ [options]="countries"
69
+ displayKey="name"
70
+ valueKey="code"
71
+ groupKey="group"
72
+ disabledKey="added"
73
+ checkedKey="added"
74
+ [(value)]="country"
75
+ ></st-combobox>
76
+ ```
@@ -42,6 +42,10 @@ type AnimationState = 'closed' | 'opening' | 'open' | 'closing';
42
42
  * Selection type for the combobox
43
43
  */
44
44
  type SelectionType = 'single' | 'multiple';
45
+ /**
46
+ * How wide the options panel is: `'trigger'` copies the control's width, `'content'` grows to the widest option
47
+ */
48
+ export type ComboboxPanelWidth = 'trigger' | 'content';
45
49
  /**
46
50
  * Event emitted when the search query changes
47
51
  */
@@ -175,6 +179,25 @@ export declare class ComboboxComponent implements ControlValueAccessor {
175
179
  * @default true
176
180
  */
177
181
  allowClearAll: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
182
+ /**
183
+ * Width of the options panel.
184
+ * - `'trigger'`: as wide as the control; a long option wraps onto more lines.
185
+ * - `'content'`: at least as wide as the control and wider when an option needs it, up to
186
+ * `min(28rem, 100vw - 2rem)`. The width is measured over every option, so searching never resizes the
187
+ * panel. Options stay on one line; past that cap the description, then the label, end in an ellipsis and
188
+ * the row shows its full text as a tooltip. Near the viewport edge the panel aligns to the control's end
189
+ * instead of overflowing.
190
+ * @defaultValue 'trigger'
191
+ */
192
+ panelWidth: import("@angular/core").InputSignal<ComboboxPanelWidth>;
193
+ /**
194
+ * Size the closed control to its widest option or the placeholder, measured with the option row's own
195
+ * font, padding and check icon for the current `size`. A selected value never truncates and the control
196
+ * keeps its width between selections. The panel then follows its options as with `panelWidth="content"`.
197
+ * The control does not shrink in a flex row (`shrink-0`); `min-w-*` and `w-*` classes on the element still apply.
198
+ * @defaultValue false
199
+ */
200
+ fitOptions: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
178
201
  /**
179
202
  * Placeholder text for the search input field
180
203
  * @default 'Search...'
@@ -213,11 +236,26 @@ export declare class ComboboxComponent implements ControlValueAccessor {
213
236
  */
214
237
  disabledKey: import("@angular/core").InputSignal<string>;
215
238
  /**
216
- * The object property holding a secondary text shown under the option label
239
+ * The object property holding a secondary text shown right-aligned on the option row
217
240
  * (for example why it is disabled: "Already added"). It is part of the
218
241
  * option's accessible name.
219
242
  */
220
243
  descriptionKey: import("@angular/core").InputSignal<string>;
244
+ /**
245
+ * The object property naming the group an option belongs to. Options that share a value are listed
246
+ * together under one header showing that value, groups in the order they first appear, each group
247
+ * named by its header for assistive technology. Options without the property are listed first,
248
+ * ungrouped. A group whose options are all filtered out by the search hides its header. Headers
249
+ * cannot be chosen and the arrow keys skip them. Leave empty for a flat list.
250
+ */
251
+ groupKey: import("@angular/core").InputSignal<string>;
252
+ /**
253
+ * The object property that marks an option as already taken outside this field when truthy (for
254
+ * example a country added earlier). The option shows the check icon, in the option's own color, but
255
+ * it is not part of the value and never appears in the trigger. Pair it with `disabledKey` so it is
256
+ * dimmed, check included, and cannot be chosen again.
257
+ */
258
+ checkedKey: import("@angular/core").InputSignal<string>;
221
259
  /**
222
260
  * Selection mode: 'single' for single selection, 'multiple' for multi-select
223
261
  * @default 'single'
@@ -304,6 +342,39 @@ export declare class ComboboxComponent implements ControlValueAccessor {
304
342
  private readonly currentPosition;
305
343
  /** Overlay positions with a symmetric 4px trigger gap (below first, flip above) */
306
344
  readonly overlayPositions: ConnectedPosition[];
345
+ /** @internal Content-width panel positions: a panel wider than the control aligns to its end near the viewport edge */
346
+ private readonly contentOverlayPositions;
347
+ /** @internal Whether the panel sizes to its options (`panelWidth="content"` or `fitOptions`) */
348
+ protected readonly contentPanel: import("@angular/core").Signal<boolean>;
349
+ /** @internal Positions bound to the overlay */
350
+ protected readonly activeOverlayPositions: import("@angular/core").Signal<ConnectedPosition[]>;
351
+ /** @internal Fixed overlay width: the trigger width, or none when the panel sizes to its options */
352
+ protected readonly overlayWidth: import("@angular/core").Signal<string | number>;
353
+ /** @internal Classes of the panel box */
354
+ protected readonly panelClass: import("@angular/core").Signal<string>;
355
+ /**
356
+ * @internal
357
+ * Classes of the hidden option sizer: the panel's menu size, so rows measure alike, plus a reserved scrollbar
358
+ * gutter, so a list that scrolls keeps the width of one that does not; capped like the panel, so a long
359
+ * option cannot widen the control past the panel
360
+ */
361
+ protected readonly optionSizerClass: import("@angular/core").Signal<string>;
362
+ /** @internal Classes of an option row */
363
+ protected readonly optionRowClass = "group-[.cdk-option-active]:bg-base-300 font-body flex w-full items-center justify-between rounded-none px-4 py-2 text-left leading-normal font-normal text-pretty transition-colors duration-150 ease-in-out group-data-disabled:cursor-not-allowed group-data-disabled:bg-transparent group-data-disabled:text-(--color-disabled-content) group-data-disabled:hover:bg-transparent";
364
+ /** @internal Texts the closed control must fit with `fitOptions`: the placeholder and every option label */
365
+ protected readonly valueSizerLabels: import("@angular/core").Signal<any[]>;
366
+ /**
367
+ * @internal
368
+ * Every option in sections, ignoring the search, so the content-width panel keeps its width while filtering
369
+ */
370
+ protected readonly allOptionSections: import("@angular/core").Signal<{
371
+ label: string | null;
372
+ headerId: string | null;
373
+ options: {
374
+ option: any;
375
+ index: number;
376
+ }[];
377
+ }[]>;
307
378
  /** Real placement of the open panel, bound to `data-side` / `data-align`; null until the CDK places it */
308
379
  readonly placement: import("@angular/core").Signal<PopoverPlacement | null>;
309
380
  /**
@@ -340,6 +411,23 @@ export declare class ComboboxComponent implements ControlValueAccessor {
340
411
  * @returns Array of options that match the search criteria
341
412
  */
342
413
  filteredOptions: import("@angular/core").Signal<any[]>;
414
+ /**
415
+ * @internal
416
+ * Filtered options in the order they are listed: ungrouped first, then each `groupKey` group
417
+ */
418
+ protected readonly optionSections: import("@angular/core").Signal<{
419
+ label: string | null;
420
+ headerId: string | null;
421
+ options: {
422
+ option: any;
423
+ index: number;
424
+ }[];
425
+ }[]>;
426
+ /**
427
+ * @internal
428
+ * Filtered options in the order they are listed, which keyboard navigation, `data-option-index` and the option ids follow
429
+ */
430
+ protected readonly orderedOptions: import("@angular/core").Signal<any[]>;
343
431
  /**
344
432
  * Whether the overlay is currently open or in the process of opening/closing
345
433
  * @returns True if overlay is visible or animating
@@ -403,6 +491,8 @@ export declare class ComboboxComponent implements ControlValueAccessor {
403
491
  * @internal
404
492
  */
405
493
  menuClass: import("@angular/core").Signal<string>;
494
+ /** @internal Menu size modifier shared by the options list and the option sizer */
495
+ private readonly menuSizeClass;
406
496
  /**
407
497
  * CSS classes for the badge
408
498
  * @internal
@@ -555,6 +645,12 @@ export declare class ComboboxComponent implements ControlValueAccessor {
555
645
  * @returns True if the option cannot be chosen
556
646
  */
557
647
  isOptionDisabled(option: any): boolean;
648
+ /**
649
+ * Whether an option is marked as already taken through `checkedKey`
650
+ * @param option - The option to check
651
+ * @returns True if the option shows the check without being part of the value
652
+ */
653
+ isOptionChecked(option: any): boolean;
558
654
  /**
559
655
  * Gets the secondary text for an option through `descriptionKey`
560
656
  * @param option - The option to read
@@ -577,6 +673,26 @@ export declare class ComboboxComponent implements ControlValueAccessor {
577
673
  * Updates the trigger button width for overlay positioning
578
674
  */
579
675
  private updateTriggerWidth;
676
+ /**
677
+ * @internal
678
+ * On hover of a single-line option, shows its full text as a tooltip when its label or description is cut off
679
+ * @param event - The pointer event on the option row
680
+ * @param option - The option the row shows
681
+ */
682
+ protected syncOptionTitle(event: Event, option: any): void;
683
+ /**
684
+ * Sets the full-text tooltip of an option row when its label or description is cut off, or removes it;
685
+ * runs on hover and when the row becomes the keyboard-active one
686
+ * @param row - The option row
687
+ * @param option - The option the row shows
688
+ */
689
+ private syncRowTitle;
690
+ /**
691
+ * Gets the full text of an option: its label, then its description when it has one
692
+ * @param option - The option to read
693
+ * @returns The text shown as the tooltip of a truncated option
694
+ */
695
+ private getOptionFullText;
580
696
  /**
581
697
  * Gets the value property from an option
582
698
  * @param option - The option to get value from
@@ -589,6 +705,19 @@ export declare class ComboboxComponent implements ControlValueAccessor {
589
705
  * @returns True if the value exists in the options array
590
706
  */
591
707
  private isValidValue;
708
+ /**
709
+ * Gets the group an option belongs to through `groupKey`
710
+ * @param option - The option to read
711
+ * @returns The group name, or null when the option is ungrouped
712
+ */
713
+ private getOptionGroup;
714
+ /**
715
+ * Splits options into the ungrouped run, listed first, and one section per group in first-appearance order.
716
+ * `index` is the option's position in the listed order; `headerId` is unique per instance.
717
+ * @param options - The options to list
718
+ * @returns The sections to render
719
+ */
720
+ private groupOptions;
592
721
  /**
593
722
  * Triggers blur event for form validation
594
723
  */
@@ -616,7 +745,9 @@ export declare class ComboboxComponent implements ControlValueAccessor {
616
745
  */
617
746
  private setActiveOption;
618
747
  /**
619
- * Sets the first option as active by default
748
+ * Sets the first enabled option as active; on open in single mode, the selected option, so the highlight and
749
+ * the check sit on the same row. A search keeps the first match.
750
+ * @param preferSelected - Whether an enabled selected option wins over the first one
620
751
  */
621
752
  private setDefaultActiveOption;
622
753
  /**
@@ -629,6 +760,6 @@ export declare class ComboboxComponent implements ControlValueAccessor {
629
760
  */
630
761
  private setupSearchQueryEmission;
631
762
  static ɵfac: i0.ɵɵFactoryDeclaration<ComboboxComponent, never>;
632
- static ɵcmp: i0.ɵɵComponentDeclaration<ComboboxComponent, "st-combobox", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "showOptional": { "alias": "showOptional"; "required": false; "isSignal": true; }; "optionalText": { "alias": "optionalText"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "ghost": { "alias": "ghost"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "parentForm": { "alias": "parentForm"; "required": false; "isSignal": true; }; "formControlName": { "alias": "formControlName"; "required": false; "isSignal": true; }; "allowClear": { "alias": "allowClear"; "required": false; "isSignal": true; }; "allowClearAll": { "alias": "allowClearAll"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "noResultsText": { "alias": "noResultsText"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "displayKey": { "alias": "displayKey"; "required": false; "isSignal": true; }; "valueKey": { "alias": "valueKey"; "required": false; "isSignal": true; }; "disabledKey": { "alias": "disabledKey"; "required": false; "isSignal": true; }; "descriptionKey": { "alias": "descriptionKey"; "required": false; "isSignal": true; }; "selectionType": { "alias": "selectionType"; "required": false; "isSignal": true; }; "searchDebounced": { "alias": "searchDebounced"; "required": false; "isSignal": true; }; "searchDebounceTime": { "alias": "searchDebounceTime"; "required": false; "isSignal": true; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "value": "valueChange"; "blurred": "blurred"; "valueUpdated": "valueUpdated"; "clicked": "clicked"; "keyDownEnter": "keyDownEnter"; "keyDownSpace": "keyDownSpace"; "triggered": "triggered"; "searchQuery": "searchQuery"; }, never, ["*"], true, never>;
763
+ static ɵcmp: i0.ɵɵComponentDeclaration<ComboboxComponent, "st-combobox", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "showOptional": { "alias": "showOptional"; "required": false; "isSignal": true; }; "optionalText": { "alias": "optionalText"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "ghost": { "alias": "ghost"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "parentForm": { "alias": "parentForm"; "required": false; "isSignal": true; }; "formControlName": { "alias": "formControlName"; "required": false; "isSignal": true; }; "allowClear": { "alias": "allowClear"; "required": false; "isSignal": true; }; "allowClearAll": { "alias": "allowClearAll"; "required": false; "isSignal": true; }; "panelWidth": { "alias": "panelWidth"; "required": false; "isSignal": true; }; "fitOptions": { "alias": "fitOptions"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "noResultsText": { "alias": "noResultsText"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "displayKey": { "alias": "displayKey"; "required": false; "isSignal": true; }; "valueKey": { "alias": "valueKey"; "required": false; "isSignal": true; }; "disabledKey": { "alias": "disabledKey"; "required": false; "isSignal": true; }; "descriptionKey": { "alias": "descriptionKey"; "required": false; "isSignal": true; }; "groupKey": { "alias": "groupKey"; "required": false; "isSignal": true; }; "checkedKey": { "alias": "checkedKey"; "required": false; "isSignal": true; }; "selectionType": { "alias": "selectionType"; "required": false; "isSignal": true; }; "searchDebounced": { "alias": "searchDebounced"; "required": false; "isSignal": true; }; "searchDebounceTime": { "alias": "searchDebounceTime"; "required": false; "isSignal": true; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "value": "valueChange"; "blurred": "blurred"; "valueUpdated": "valueUpdated"; "clicked": "clicked"; "keyDownEnter": "keyDownEnter"; "keyDownSpace": "keyDownSpace"; "triggered": "triggered"; "searchQuery": "searchQuery"; }, never, ["*"], true, never>;
633
764
  }
634
765
  export {};
@@ -12,16 +12,56 @@ List picker. Clear is a sibling of the trigger; the chevron is a custom icon tha
12
12
  <st-select label="Status" [options]="statuses" displayKey="label" valueKey="id" [(value)]="status"></st-select>
13
13
  ```
14
14
 
15
+ ## Width
16
+
17
+ The control's width is measured with `getBoundingClientRect()` and rounded up, so a panel that copies it is never a fraction of a pixel narrower than the control (an option that exactly fills the control no longer wraps).
18
+
19
+ - `panelWidth` (`'trigger' | 'content'`, default `'trigger'`). `'trigger'` keeps the panel as wide as the control, as before; a long option wraps. `'content'` makes the panel at least as wide as the control and wider when an option needs it, up to `min(28rem, 100vw - 2rem)`. Options stay on one line, with the check slot reserved on every row. Past the cap the description is cut first, then the label, both with an ellipsis; hovering a cut-off row, or making it the keyboard-active row, shows its full text (`Label, Description`) as a `title`. The accessible name and keyboard navigation do not change. Near the viewport edge the panel aligns to the control's end instead of overflowing, and it still flips above the control when there is no room below.
20
+ - `fitOptions` (boolean, default `false`) sizes the closed control to its widest option or its placeholder. A hidden sizer in the component's own template stacks every option row with the option row's classes and the menu size of the current `size` (label, description and check slot), plus every label in the control's own font, so CSS takes the widest in real pixels. The room of the clear button is kept while nothing is chosen, so the control keeps its width between selections and a chosen value is never cut off. The sizer is capped like the panel (`min(28rem, 100vw - 2rem)`), so one very long option cannot widen the control past the panel. The element becomes `inline-block align-top shrink-0`: it shrinks to that width in a block, `align-top` keeps it from sitting on the text baseline (no stray gap below it in a line box) and does not shrink in a flex row that scrolls (`overflow-x-auto`). `min-w-*` and `w-*` classes on the element still apply; a narrower `w-*` cuts the value with an ellipsis.
21
+ - How they combine: `fitOptions` implies `panelWidth="content"`, so setting both is the same as `fitOptions` alone. With a fitted control the panel ends up as wide as the control; it only grows past it when a `w-*` or `max-w-*` class makes the control narrower than its options.
22
+
23
+ ```html
24
+ <!-- A short filter whose panel shows every option on one line -->
25
+ <st-select
26
+ class="min-w-28"
27
+ size="sm"
28
+ panelWidth="content"
29
+ [options]="['All', 'OC_ACN_MISMATCH', 'WHITELIST_GTO', 'BLACKLIST_MSISDN']"
30
+ [(value)]="filter"
31
+ ></st-select>
32
+
33
+ <!-- A control as wide as its widest option, in a scrolling filter bar -->
34
+ <div class="flex gap-4 overflow-x-auto">
35
+ <st-select size="sm" fitOptions [options]="refreshOptions" displayKey="label" valueKey="seconds" [(value)]="refresh"></st-select>
36
+ </div>
37
+ ```
38
+
15
39
  ## Notes
16
40
 
17
41
  - `allowClear` defaults to `true`. The panel opens 4px from the field with the shared popover motion (`popover-motion`), toward the side the CDK placed it on.
42
+ - When the panel opens with a value, the selected option (the one with the check) is the active row, so the highlight and the check sit on the same option and ArrowDown moves on from it. Without a value, or when the selected option is disabled, the first enabled option is active.
18
43
  - Do not nest the clear button inside the trigger.
19
44
  - Async options: a value written through the form (`writeValue`) before its option exists is kept and resolved to the matching option, with its label, as soon as one arrives (first load or a replaced list), without calling `onChange` (the control stays pristine). A user selection, clear or `writeValue(null)` replaces it. While no option matches the select shows the placeholder and its value is `null`; the form control still holds the written value.
20
45
  - Disabled options: `disabledKey` names the option property that disables it when truthy. The option stays in the list and in search results, is dimmed with the kit's disabled colors (`--color-disabled-content`), carries `aria-disabled="true"` and cannot be chosen by click, Enter or Space. ArrowUp, ArrowDown, Home and End skip them. Without `disabledKey` every option is enabled.
21
- - Secondary text: `descriptionKey` names an option property shown as a second line under the label (for example why the option is disabled). It is part of the option's accessible name.
46
+ - Secondary text: `descriptionKey` names an option property shown on the same row as the label, right-aligned in the muted colour before the check (for example why the option is disabled). A long label wraps first; a long description is cut with an ellipsis rather than pushed under the label. It is part of the option's accessible name (read as "Label, Description").
47
+ - Option groups: `groupKey` names an option property holding its group. Options that share a value are listed under one header showing that value, styled like the dropdown section label (`st-dropdown-label`) with a separator line before it unless it opens the list, groups in the order they first appear; options without the property are listed first, ungrouped. Each group is a `role="group"` with `aria-labelledby` pointing at its header (ids unique per instance). Headers cannot be chosen. ArrowUp, ArrowDown, Home and End follow the listed order and skip headers; disabled options stay skipped. Without `groupKey` the list is flat, in the given order.
48
+ - Already-taken options: `checkedKey` names an option property that, when truthy, shows the check icon on the option without making it part of the value: it never appears in the trigger or counts as selected. Pair it with `disabledKey` so the check is dimmed with the option text (`--color-disabled-content`), the option carries `aria-disabled="true"` and it cannot be chosen again; use `descriptionKey` to say why. Without `disabledKey` the check is only a marker and the option can still be chosen.
49
+ - Scrolling: the option list fades its top and bottom edges while there is more to scroll to (`scroll-fade-y`) and contains its overscroll.
22
50
  - Validation errors: inside `st-form-item` with `st-form-errors`, the `role="combobox"` trigger gets `aria-invalid="true"` while its control is invalid and touched or dirty, and the error message id joins the hint ids in its `aria-describedby`. See [Form Error](../form-error/README.md).
23
51
  - Listbox: the trigger has `aria-haspopup="listbox"` and `aria-controls` pointing at the listbox's generated id (unique per instance). The listbox is named by the `label` (through the visually hidden label's id), or by the trigger when there is no `label`. With no options it shows `sdk.select.noOptions` ("No options available" when no translation is loaded).
24
52
 
25
53
  ```html
26
54
  <st-select [options]="countries" displayKey="name" valueKey="code" disabledKey="added" descriptionKey="note" [(value)]="country"></st-select>
27
55
  ```
56
+
57
+ ```html
58
+ <st-select
59
+ [options]="countries"
60
+ displayKey="name"
61
+ valueKey="code"
62
+ groupKey="group"
63
+ disabledKey="added"
64
+ checkedKey="added"
65
+ [(value)]="country"
66
+ ></st-select>
67
+ ```