@sixbell-telco/sdk 4.8.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.
- package/CHANGELOG.md +53 -0
- package/components/accordion/README.md +1 -1
- package/components/accordion/src/accordion.component.d.ts +4 -0
- package/components/alert/src/alert.component.d.ts +8 -1
- package/components/data-table/README.md +1 -0
- package/components/data-table/src/data-table.component.d.ts +2 -24
- package/components/dialog/README.md +4 -3
- package/components/dialog/dialog-actions/dialog-actions.component.d.ts +2 -1
- package/components/dialog/src/dialog.component.d.ts +10 -5
- package/components/dropdown-menu/bar/dropdown-menu-bar-item/dropdown-menu-bar-item.component.d.ts +1 -1
- package/components/dropdown-menu/src/dropdown-menu-item/dropdown-menu-item.component.d.ts +3 -2
- package/components/file-upload/file-dropzone/file-dropzone.component.d.ts +12 -0
- package/components/file-upload/file-uploader/file-uploader.component.d.ts +6 -0
- package/components/forms/combobox/README.md +49 -0
- package/components/forms/combobox/src/combobox.component.d.ts +178 -3
- package/components/forms/date-picker/README.md +3 -1
- package/components/forms/date-picker/src/date-picker.component.d.ts +8 -1
- package/components/forms/form-error/README.md +2 -0
- package/components/forms/form-error/src/form-error.component.d.ts +17 -0
- package/components/forms/form-hint/README.md +2 -2
- package/components/forms/form-item/README.md +1 -0
- package/components/forms/form-item/src/form-item.component.d.ts +38 -6
- package/components/forms/input/README.md +7 -0
- package/components/forms/input/src/input.component.d.ts +11 -1
- package/components/forms/select/README.md +48 -0
- package/components/forms/select/src/select.component.d.ts +157 -2
- package/components/forms/textarea/README.md +1 -0
- package/components/forms/textarea/src/textarea.component.d.ts +6 -1
- package/components/paginator/README.md +3 -0
- package/components/paginator/components/pagination-item/pagination-item.component.d.ts +8 -3
- package/components/paginator/src/paginator.component.d.ts +2 -1
- package/components/progress/src/progress.component.d.ts +17 -3
- package/components/table/README.md +2 -0
- package/components/table/src/table.component.d.ts +16 -23
- package/directives/only-numbers/src/only-numbers.directive.d.ts +27 -1
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs +6 -1
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-alert.mjs +12 -5
- package/fesm2022/sixbell-telco-sdk-components-alert.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +5 -2
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +30 -13
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +2 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +10 -4
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +32 -6
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +272 -23
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +17 -4
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs +32 -4
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-item.mjs +74 -10
- package/fesm2022/sixbell-telco-sdk-components-forms-form-item.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +13 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +258 -18
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +11 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +15 -11
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs +22 -4
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +42 -5
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs +49 -4
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-layouts.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-layouts.mjs.map +1 -1
- package/i18n/sdk/en.json +14 -4
- package/i18n/sdk/es.json +14 -4
- package/i18n/sdk/pt.json +14 -4
- package/manifest.json +185 -19
- package/package.json +1 -1
- package/src/_index.css +19 -0
|
@@ -15,6 +15,10 @@ export type SelectProps = {
|
|
|
15
15
|
variant?: SelectVariantProps;
|
|
16
16
|
size?: SelectSizeProps;
|
|
17
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* How wide the options panel is: `'trigger'` copies the control's width, `'content'` grows to the widest option
|
|
20
|
+
*/
|
|
21
|
+
export type SelectPanelWidth = 'trigger' | 'content';
|
|
18
22
|
/** Animation states for the select overlay */
|
|
19
23
|
type AnimationState = 'closed' | 'opening' | 'open' | 'closing';
|
|
20
24
|
/**
|
|
@@ -95,6 +99,10 @@ export declare class SelectComponent implements ControlValueAccessor {
|
|
|
95
99
|
private readonly generatedId;
|
|
96
100
|
/** @internal Id applied to the focusable control and referenced by its label */
|
|
97
101
|
protected readonly resolvedId: import("@angular/core").Signal<string>;
|
|
102
|
+
/** @internal Id of the options listbox, referenced by the trigger's `aria-controls` */
|
|
103
|
+
protected readonly listboxId: string;
|
|
104
|
+
/** @internal Id of the visually hidden label, which names the listbox */
|
|
105
|
+
protected readonly labelId: string;
|
|
98
106
|
/**
|
|
99
107
|
* Placeholder text when no option is selected
|
|
100
108
|
*/
|
|
@@ -121,11 +129,56 @@ export declare class SelectComponent implements ControlValueAccessor {
|
|
|
121
129
|
* Uses the entire object if not specified
|
|
122
130
|
*/
|
|
123
131
|
valueKey: import("@angular/core").InputSignal<string>;
|
|
132
|
+
/**
|
|
133
|
+
* The object property that marks an option as disabled when truthy.
|
|
134
|
+
* A disabled option stays in the list (and in search results), is dimmed,
|
|
135
|
+
* carries `aria-disabled="true"` and cannot be chosen by click or keyboard.
|
|
136
|
+
* Leave empty to keep every option enabled.
|
|
137
|
+
*/
|
|
138
|
+
disabledKey: import("@angular/core").InputSignal<string>;
|
|
139
|
+
/**
|
|
140
|
+
* The object property holding a secondary text shown right-aligned on the option row
|
|
141
|
+
* (for example why it is disabled: "Already added"). It is part of the
|
|
142
|
+
* option's accessible name.
|
|
143
|
+
*/
|
|
144
|
+
descriptionKey: import("@angular/core").InputSignal<string>;
|
|
145
|
+
/**
|
|
146
|
+
* The object property naming the group an option belongs to. Options that share a value are listed
|
|
147
|
+
* together under one header showing that value, groups in the order they first appear, each group
|
|
148
|
+
* named by its header for assistive technology. Options without the property are listed first,
|
|
149
|
+
* ungrouped. Headers cannot be chosen and the arrow keys skip them. Leave empty for a flat list.
|
|
150
|
+
*/
|
|
151
|
+
groupKey: import("@angular/core").InputSignal<string>;
|
|
152
|
+
/**
|
|
153
|
+
* The object property that marks an option as already taken outside this field when truthy (for
|
|
154
|
+
* example a country added earlier). The option shows the check icon, in the option's own color, but
|
|
155
|
+
* it is not part of the value and never appears in the trigger. Pair it with `disabledKey` so it is
|
|
156
|
+
* dimmed, check included, and cannot be chosen again.
|
|
157
|
+
*/
|
|
158
|
+
checkedKey: import("@angular/core").InputSignal<string>;
|
|
124
159
|
/**
|
|
125
160
|
* Whether to show a clear button next to the selected value
|
|
126
161
|
* @default true
|
|
127
162
|
*/
|
|
128
163
|
allowClear: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
164
|
+
/**
|
|
165
|
+
* Width of the options panel.
|
|
166
|
+
* - `'trigger'`: as wide as the control; a long option wraps onto more lines.
|
|
167
|
+
* - `'content'`: at least as wide as the control and wider when an option needs it, up to
|
|
168
|
+
* `min(28rem, 100vw - 2rem)`. Options stay on one line; past that cap the description, then the label,
|
|
169
|
+
* end in an ellipsis and the row shows its full text as a tooltip. Near the viewport edge the panel
|
|
170
|
+
* aligns to the control's end instead of overflowing.
|
|
171
|
+
* @defaultValue 'trigger'
|
|
172
|
+
*/
|
|
173
|
+
panelWidth: import("@angular/core").InputSignal<SelectPanelWidth>;
|
|
174
|
+
/**
|
|
175
|
+
* Size the closed control to its widest option or the placeholder, measured with the option row's own
|
|
176
|
+
* font, padding and check icon for the current `size`. A selected value never truncates and the control
|
|
177
|
+
* keeps its width between selections. The panel then follows its options as with `panelWidth="content"`.
|
|
178
|
+
* The control does not shrink in a flex row (`shrink-0`); `min-w-*` and `w-*` classes on the element still apply.
|
|
179
|
+
* @defaultValue false
|
|
180
|
+
*/
|
|
181
|
+
fitOptions: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
129
182
|
/**
|
|
130
183
|
* Parent form group for reactive forms
|
|
131
184
|
*/
|
|
@@ -177,6 +230,8 @@ export declare class SelectComponent implements ControlValueAccessor {
|
|
|
177
230
|
private readonly translateLabel;
|
|
178
231
|
/** @internal Name of the icon-only clear button. */
|
|
179
232
|
protected readonly clearSelectionLabel: import("@angular/core").Signal<string>;
|
|
233
|
+
/** @internal Text of the empty listbox */
|
|
234
|
+
protected readonly noOptionsLabel: import("@angular/core").Signal<string>;
|
|
180
235
|
/** Current animation state of the overlay */
|
|
181
236
|
private readonly animationState;
|
|
182
237
|
/** Set when the exit animation already ran the close cleanup, so the detach that follows does not repeat it */
|
|
@@ -199,6 +254,27 @@ export declare class SelectComponent implements ControlValueAccessor {
|
|
|
199
254
|
private readonly currentPosition;
|
|
200
255
|
/** Overlay positions with a symmetric 4px trigger gap (below first, flip above) */
|
|
201
256
|
readonly overlayPositions: ConnectedPosition[];
|
|
257
|
+
/** @internal Content-width panel positions: a panel wider than the control aligns to its end near the viewport edge */
|
|
258
|
+
private readonly contentOverlayPositions;
|
|
259
|
+
/** @internal Whether the panel sizes to its options (`panelWidth="content"` or `fitOptions`) */
|
|
260
|
+
protected readonly contentPanel: import("@angular/core").Signal<boolean>;
|
|
261
|
+
/** @internal Positions bound to the overlay */
|
|
262
|
+
protected readonly activeOverlayPositions: import("@angular/core").Signal<ConnectedPosition[]>;
|
|
263
|
+
/** @internal Fixed overlay width: the trigger width, or none when the panel sizes to its options */
|
|
264
|
+
protected readonly overlayWidth: import("@angular/core").Signal<string | number>;
|
|
265
|
+
/** @internal Classes of the panel box */
|
|
266
|
+
protected readonly panelClass: import("@angular/core").Signal<string>;
|
|
267
|
+
/**
|
|
268
|
+
* @internal
|
|
269
|
+
* Classes of the hidden option sizer: the panel's menu size, so rows measure alike, plus a reserved scrollbar
|
|
270
|
+
* gutter, so a list that scrolls keeps the width of one that does not; capped like the panel, so a long
|
|
271
|
+
* option cannot widen the control past the panel
|
|
272
|
+
*/
|
|
273
|
+
protected readonly optionSizerClass: import("@angular/core").Signal<string>;
|
|
274
|
+
/** @internal Classes of an option row */
|
|
275
|
+
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";
|
|
276
|
+
/** @internal Texts the closed control must fit with `fitOptions`: the placeholder and every option label */
|
|
277
|
+
protected readonly valueSizerLabels: import("@angular/core").Signal<any[]>;
|
|
202
278
|
/** Real placement of the open panel, bound to `data-side` / `data-align`; null until the CDK places it */
|
|
203
279
|
readonly placement: import("@angular/core").Signal<PopoverPlacement | null>;
|
|
204
280
|
/**
|
|
@@ -279,11 +355,30 @@ export declare class SelectComponent implements ControlValueAccessor {
|
|
|
279
355
|
* @internal
|
|
280
356
|
*/
|
|
281
357
|
validationClass: import("@angular/core").Signal<string>;
|
|
358
|
+
/**
|
|
359
|
+
* @internal
|
|
360
|
+
* Options in the order they are listed: ungrouped first, then each `groupKey` group
|
|
361
|
+
*/
|
|
362
|
+
protected readonly optionSections: import("@angular/core").Signal<{
|
|
363
|
+
label: string | null;
|
|
364
|
+
headerId: string | null;
|
|
365
|
+
options: {
|
|
366
|
+
option: any;
|
|
367
|
+
index: number;
|
|
368
|
+
}[];
|
|
369
|
+
}[]>;
|
|
370
|
+
/**
|
|
371
|
+
* @internal
|
|
372
|
+
* Options in the order they are listed, which keyboard navigation and `data-option-index` follow
|
|
373
|
+
*/
|
|
374
|
+
protected readonly orderedOptions: import("@angular/core").Signal<any[]>;
|
|
282
375
|
/**
|
|
283
376
|
* CSS classes for the options menu
|
|
284
377
|
* @internal
|
|
285
378
|
*/
|
|
286
379
|
menuClass: import("@angular/core").Signal<string>;
|
|
380
|
+
/** @internal Menu size modifier shared by the options list and the option sizer */
|
|
381
|
+
private readonly menuSizeClass;
|
|
287
382
|
/**
|
|
288
383
|
* Updates the trigger width for proper overlay positioning
|
|
289
384
|
*/
|
|
@@ -390,6 +485,24 @@ export declare class SelectComponent implements ControlValueAccessor {
|
|
|
390
485
|
* @returns True if the option is active
|
|
391
486
|
*/
|
|
392
487
|
isActiveOption(index: number): boolean;
|
|
488
|
+
/**
|
|
489
|
+
* Whether an option is disabled through `disabledKey`
|
|
490
|
+
* @param option - The option to check
|
|
491
|
+
* @returns True if the option cannot be chosen
|
|
492
|
+
*/
|
|
493
|
+
isOptionDisabled(option: any): boolean;
|
|
494
|
+
/**
|
|
495
|
+
* Whether an option is marked as already taken through `checkedKey`
|
|
496
|
+
* @param option - The option to check
|
|
497
|
+
* @returns True if the option shows the check without being part of the value
|
|
498
|
+
*/
|
|
499
|
+
isOptionChecked(option: any): boolean;
|
|
500
|
+
/**
|
|
501
|
+
* Gets the secondary text for an option through `descriptionKey`
|
|
502
|
+
* @param option - The option to read
|
|
503
|
+
* @returns The secondary text, or an empty string
|
|
504
|
+
*/
|
|
505
|
+
getOptionDescription(option: any): string;
|
|
393
506
|
/**
|
|
394
507
|
* Gets the display value for an option
|
|
395
508
|
* @param option - The option to get display value for
|
|
@@ -400,23 +513,65 @@ export declare class SelectComponent implements ControlValueAccessor {
|
|
|
400
513
|
* Updates the trigger button width for overlay positioning
|
|
401
514
|
*/
|
|
402
515
|
private updateTriggerWidth;
|
|
516
|
+
/**
|
|
517
|
+
* @internal
|
|
518
|
+
* On hover of a single-line option, shows its full text as a tooltip when its label or description is cut off
|
|
519
|
+
* @param event - The pointer event on the option row
|
|
520
|
+
* @param option - The option the row shows
|
|
521
|
+
*/
|
|
522
|
+
protected syncOptionTitle(event: Event, option: any): void;
|
|
523
|
+
/**
|
|
524
|
+
* Sets the full-text tooltip of an option row when its label or description is cut off, or removes it;
|
|
525
|
+
* runs on hover and when the row becomes the keyboard-active one
|
|
526
|
+
* @param row - The option row
|
|
527
|
+
* @param option - The option the row shows
|
|
528
|
+
*/
|
|
529
|
+
private syncRowTitle;
|
|
530
|
+
/**
|
|
531
|
+
* Gets the full text of an option: its label, then its description when it has one
|
|
532
|
+
* @param option - The option to read
|
|
533
|
+
* @returns The text shown as the tooltip of a truncated option
|
|
534
|
+
*/
|
|
535
|
+
private getOptionFullText;
|
|
403
536
|
/**
|
|
404
537
|
* Gets the value property from an option
|
|
405
538
|
* @param option - The option to get value from
|
|
406
539
|
* @returns The option value
|
|
407
540
|
*/
|
|
408
541
|
private getOptionValue;
|
|
542
|
+
/**
|
|
543
|
+
* Gets the group an option belongs to through `groupKey`
|
|
544
|
+
* @param option - The option to read
|
|
545
|
+
* @returns The group name, or null when the option is ungrouped
|
|
546
|
+
*/
|
|
547
|
+
private getOptionGroup;
|
|
548
|
+
/**
|
|
549
|
+
* Splits options into the ungrouped run, listed first, and one section per group in first-appearance order.
|
|
550
|
+
* `index` is the option's position in the listed order; `headerId` is unique per instance.
|
|
551
|
+
* @param options - The options to list
|
|
552
|
+
* @returns The sections to render
|
|
553
|
+
*/
|
|
554
|
+
private groupOptions;
|
|
409
555
|
/**
|
|
410
556
|
* Triggers blur event for form validation
|
|
411
557
|
*/
|
|
412
558
|
private triggerBlur;
|
|
559
|
+
/**
|
|
560
|
+
* Finds the next enabled option index, wrapping around the list
|
|
561
|
+
* @param options - The options being navigated
|
|
562
|
+
* @param from - The index to start from (exclusive)
|
|
563
|
+
* @param step - 1 to move down, -1 to move up
|
|
564
|
+
* @returns The index of the next enabled option, or -1 if every option is disabled
|
|
565
|
+
*/
|
|
566
|
+
private findEnabledIndex;
|
|
413
567
|
/**
|
|
414
568
|
* Sets the active option for keyboard navigation
|
|
415
569
|
* @param index - The index of the option to make active
|
|
416
570
|
*/
|
|
417
571
|
private setActiveOption;
|
|
418
572
|
/**
|
|
419
|
-
*
|
|
573
|
+
* Makes the selected option active when the panel opens, so the highlight and the check sit on the same row;
|
|
574
|
+
* without an enabled selected option, the first enabled one
|
|
420
575
|
*/
|
|
421
576
|
private setDefaultActiveOption;
|
|
422
577
|
/**
|
|
@@ -424,6 +579,6 @@ export declare class SelectComponent implements ControlValueAccessor {
|
|
|
424
579
|
*/
|
|
425
580
|
private updateActiveOptionVisually;
|
|
426
581
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectComponent, never>;
|
|
427
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent, "st-select", 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; }; "label": { "alias": "label"; "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; }; "allowClear": { "alias": "allowClear"; "required": false; "isSignal": true; }; "parentForm": { "alias": "parentForm"; "required": false; "isSignal": true; }; "formControlName": { "alias": "formControlName"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "disabled": "disabledChange"; "blurred": "blurred"; "valueUpdated": "valueUpdated"; "clicked": "clicked"; "keyDownEnter": "keyDownEnter"; "keyDownSpace": "keyDownSpace"; "triggered": "triggered"; }, never, ["*"], true, never>;
|
|
582
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent, "st-select", 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; }; "label": { "alias": "label"; "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; }; "allowClear": { "alias": "allowClear"; "required": false; "isSignal": true; }; "panelWidth": { "alias": "panelWidth"; "required": false; "isSignal": true; }; "fitOptions": { "alias": "fitOptions"; "required": false; "isSignal": true; }; "parentForm": { "alias": "parentForm"; "required": false; "isSignal": true; }; "formControlName": { "alias": "formControlName"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "disabled": "disabledChange"; "blurred": "blurred"; "valueUpdated": "valueUpdated"; "clicked": "clicked"; "keyDownEnter": "keyDownEnter"; "keyDownSpace": "keyDownSpace"; "triggered": "triggered"; }, never, ["*"], true, never>;
|
|
428
583
|
}
|
|
429
584
|
export {};
|
|
@@ -15,3 +15,4 @@ Multi-line field with optional character counter.
|
|
|
15
15
|
## Notes
|
|
16
16
|
|
|
17
17
|
- Prefer `(triggered)` instead of the old `(enterPressed)`.
|
|
18
|
+
- Validation errors: inside `st-form-item` with `st-form-errors`, the inner `<textarea>` 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).
|
|
@@ -86,6 +86,10 @@ export declare class TextareaComponent {
|
|
|
86
86
|
private readonly generatedId;
|
|
87
87
|
/** @internal Id applied to the focusable control and referenced by its label */
|
|
88
88
|
protected readonly resolvedId: import("@angular/core").Signal<string>;
|
|
89
|
+
/** @internal Id of the character counter, referenced by the textarea's `aria-describedby`. */
|
|
90
|
+
protected readonly counterId: import("@angular/core").Signal<string>;
|
|
91
|
+
/** @internal Hint and error ids from `st-form-item`, plus the counter id while a `maxCharacters` limit is set. */
|
|
92
|
+
protected readonly describedBy: import("@angular/core").Signal<string | null>;
|
|
89
93
|
/**
|
|
90
94
|
* Placeholder text when empty
|
|
91
95
|
*/
|
|
@@ -116,7 +120,8 @@ export declare class TextareaComponent {
|
|
|
116
120
|
*/
|
|
117
121
|
value: import("@angular/core").ModelSignal<string>;
|
|
118
122
|
/**
|
|
119
|
-
* Maximum allowed character count
|
|
123
|
+
* Maximum allowed character count. When set, the counter is shown, the textarea references it
|
|
124
|
+
* through `aria-describedby`, and the native `maxlength` stops typing past the limit.
|
|
120
125
|
* @defaultValue 0 (unlimited)
|
|
121
126
|
*/
|
|
122
127
|
maxCharacters: import("@angular/core").InputSignal<number>;
|
|
@@ -16,3 +16,6 @@ Page controls. Bind `pages` and listen to `pageChanged`.
|
|
|
16
16
|
|
|
17
17
|
- Two-way `[(currentPage)]`. Prefer `(pageChanged)` over item-level activation outputs.
|
|
18
18
|
- Accessibility: the first/previous/next/last icon buttons are named from `sdk.pagination.first|previous|next|last`, and dot buttons from `sdk.pagination.page` ("Page 3"), in English when no translation is loaded. Numeric buttons are named by their number, and the current page has `aria-current="page"`. A standalone `st-pagination-item` with `variant="icon"` or `"dots"` needs `ariaLabel`.
|
|
19
|
+
- The paginator is a `<nav>` landmark named from `sdk.pagination.label` ("Pagination"). Each ellipsis hides its dots from screen readers and reads `sdk.pagination.more` ("More pages").
|
|
20
|
+
- `triggered` on `st-pagination-item` fires once per activation: Enter and Space reach it through the button's native click. `keyDownEnter` and `keyDownSpace` still emit on the key press.
|
|
21
|
+
- Below `sm` the first and last buttons hide and the gap tightens to fit a 375px phone. Dot buttons keep a hit area of at least 24x24px around the visible dot.
|
|
@@ -84,6 +84,7 @@ export declare class PaginationItemComponent {
|
|
|
84
84
|
/**
|
|
85
85
|
* Accessible name forwarded to the inner `<button>` as `aria-label`.
|
|
86
86
|
* Required for the `icon` and `dots` variants, which have no visible text.
|
|
87
|
+
* On the `ellipsis` variant it replaces the screen-reader text, which defaults to `sdk.pagination.more` ("More pages").
|
|
87
88
|
*/
|
|
88
89
|
ariaLabel: import("@angular/core").InputSignal<string | null | undefined>;
|
|
89
90
|
/**
|
|
@@ -99,9 +100,13 @@ export declare class PaginationItemComponent {
|
|
|
99
100
|
*/
|
|
100
101
|
keyDownSpace: import("@angular/core").OutputEmitterRef<KeyboardEvent>;
|
|
101
102
|
/**
|
|
102
|
-
* Event emitted
|
|
103
|
+
* Event emitted once per activation. Enter and Space reach it through the native button click
|
|
104
|
+
* they produce, so one key press or one mouse click emits it once.
|
|
103
105
|
*/
|
|
104
106
|
triggered: import("@angular/core").OutputEmitterRef<void>;
|
|
107
|
+
private readonly translateLabel;
|
|
108
|
+
/** @internal Screen-reader text for the `ellipsis` variant; the visible dots are hidden from assistive technology. */
|
|
109
|
+
protected readonly ellipsisLabel: import("@angular/core").Signal<string>;
|
|
105
110
|
/**
|
|
106
111
|
* @internal
|
|
107
112
|
* DaisyUI button geometry with paginator-owned semantic state colors.
|
|
@@ -118,12 +123,12 @@ export declare class PaginationItemComponent {
|
|
|
118
123
|
handleClick(event: MouseEvent): void;
|
|
119
124
|
/**
|
|
120
125
|
* @internal
|
|
121
|
-
*
|
|
126
|
+
* Report the Enter key. Activation comes from the click the native button fires next.
|
|
122
127
|
*/
|
|
123
128
|
handleKeyDownEnter(event: Event): void;
|
|
124
129
|
/**
|
|
125
130
|
* @internal
|
|
126
|
-
*
|
|
131
|
+
* Report the Space key. Activation comes from the click the native button fires on key up.
|
|
127
132
|
*/
|
|
128
133
|
handleKeyDownSpace(event: Event): void;
|
|
129
134
|
static ɵfac: i0.ɵɵFactoryDeclaration<PaginationItemComponent, never>;
|
|
@@ -84,8 +84,9 @@ export declare class PaginatorComponent {
|
|
|
84
84
|
*/
|
|
85
85
|
iconDoubleArrowRight: string;
|
|
86
86
|
private readonly translateLabel;
|
|
87
|
-
/** @internal Names of the icon-only navigation buttons, from `sdk.pagination.*` with English fallbacks. */
|
|
87
|
+
/** @internal Names of the landmark and the icon-only navigation buttons, from `sdk.pagination.*` with English fallbacks. */
|
|
88
88
|
protected readonly navigationLabels: import("@angular/core").Signal<{
|
|
89
|
+
nav: string;
|
|
89
90
|
first: string;
|
|
90
91
|
previous: string;
|
|
91
92
|
next: string;
|
|
@@ -45,8 +45,8 @@ export declare class ProgressComponent {
|
|
|
45
45
|
*/
|
|
46
46
|
variant: import("@angular/core").InputSignal<ProgressVariantProps>;
|
|
47
47
|
/**
|
|
48
|
-
* Current progress value
|
|
49
|
-
* @defaultValue -1 (
|
|
48
|
+
* Current progress value, from 0 to `max`
|
|
49
|
+
* @defaultValue -1 (no value label and no `aria-valuenow` while value < 0)
|
|
50
50
|
*/
|
|
51
51
|
value: import("@angular/core").InputSignal<number>;
|
|
52
52
|
/**
|
|
@@ -64,11 +64,25 @@ export declare class ProgressComponent {
|
|
|
64
64
|
* @defaultValue 'none'
|
|
65
65
|
*/
|
|
66
66
|
labelPosition: import("@angular/core").InputSignal<ProgressLabelPositionProps>;
|
|
67
|
+
/**
|
|
68
|
+
* Accessible name of the progress bar. Defaults to `sdk.progress.label` ("Progress").
|
|
69
|
+
*/
|
|
70
|
+
ariaLabel: import("@angular/core").InputSignal<string | null | undefined>;
|
|
71
|
+
/** @internal */
|
|
72
|
+
private readonly translateLabel;
|
|
73
|
+
/** @internal Name announced for the progress bar. */
|
|
74
|
+
protected readonly accessibleName: import("@angular/core").Signal<string>;
|
|
75
|
+
/** @internal Whether a value is shown and announced. */
|
|
76
|
+
protected readonly determinate: import("@angular/core").Signal<boolean>;
|
|
77
|
+
/** @internal Value clamped to `0..max`, as the native progress element does. */
|
|
78
|
+
protected readonly clampedValue: import("@angular/core").Signal<number>;
|
|
79
|
+
/** @internal Value as a whole percentage of `max`. */
|
|
80
|
+
protected readonly percentage: import("@angular/core").Signal<number>;
|
|
67
81
|
/**
|
|
68
82
|
* @internal
|
|
69
83
|
* Computed class string for the progress bar container
|
|
70
84
|
*/
|
|
71
85
|
componentClass: import("@angular/core").Signal<string>;
|
|
72
86
|
static ɵfac: i0.ɵɵFactoryDeclaration<ProgressComponent, never>;
|
|
73
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ProgressComponent, "st-progress", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
87
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ProgressComponent, "st-progress", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
74
88
|
}
|
|
@@ -45,6 +45,8 @@ actions: TableActionConfig[] = [
|
|
|
45
45
|
- `st-table-action` tooltip default `tooltipVariant` is `base`; override per action when needed.
|
|
46
46
|
- Accessible names: an `st-table-action` uses its translated `tooltip` as the button's `aria-label`, so give icon-only actions a `tooltip` (or a `tooltip` in each `TableActionConfig`). The `dropdown` mode trigger is named by the `sdk.table.actions` key.
|
|
47
47
|
- Row context: set `contextLabel` (on `st-table-action` or `st-table-actions`) to the row's name so each row's actions are told apart. The accessible name becomes "<tooltip> <contextLabel>" ("Editar producto ABC"), starting with the visible tooltip as WCAG 2.5.3 requires, while the tooltip still shows "Editar". In `dropdown` mode the trigger becomes "<actions label> <contextLabel>".
|
|
48
|
+
- Horizontal scroll: the table container fades its start and end edges (`scroll-fade-x`) while there is more to scroll. Only while the table is wider than its container, the container becomes `role="region"` with `tabindex="0"` and the `sdk.table.scrollRegion` name, so keyboard users can focus it and scroll with the arrow keys; a table that fits adds no tab stop. The focus ring is inset.
|
|
49
|
+
- 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.
|
|
48
50
|
|
|
49
51
|
```html
|
|
50
52
|
<st-table-action variant="warning" [icon]="editIcon" tooltip="Editar" [contextLabel]="'producto ' + row.name" (triggered)="edit(row)" />
|
|
@@ -64,28 +64,6 @@ export interface TablePagination extends Pagination {
|
|
|
64
64
|
id: string;
|
|
65
65
|
search: string;
|
|
66
66
|
}
|
|
67
|
-
/**
|
|
68
|
-
* A feature-rich data table component with sorting, pagination, and row selection
|
|
69
|
-
*
|
|
70
|
-
* @remarks
|
|
71
|
-
* Integrates with Tailwind CSS for styling and supports responsive layouts.
|
|
72
|
-
* Includes built-in pagination controls and checkbox selection functionality.
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```html
|
|
76
|
-
* <st-table
|
|
77
|
-
* [data]="users"
|
|
78
|
-
* [totalItems]="100"
|
|
79
|
-
* [pagination]="{ currentPage: 1, itemsPerPage: 10 }"
|
|
80
|
-
* (pageChanged)="handlePageChange($event)"
|
|
81
|
-
* size="md"
|
|
82
|
-
* height="lg"
|
|
83
|
-
* zebra
|
|
84
|
-
* >
|
|
85
|
-
* <!-- Table columns and content -->
|
|
86
|
-
* </st-table>
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
67
|
export declare class TableComponent {
|
|
90
68
|
readonly translationService: TranslateService;
|
|
91
69
|
/**
|
|
@@ -177,6 +155,21 @@ export declare class TableComponent {
|
|
|
177
155
|
pageSizeChanged: import("@angular/core").OutputEmitterRef<number>;
|
|
178
156
|
readonly ENTRIES: readonly [5, 10, 20, 50, 100];
|
|
179
157
|
private readonly translateLabel;
|
|
158
|
+
/** @internal Id of the items-per-page select, named by its visually hidden label */
|
|
159
|
+
protected readonly pageSizeSelectId: string;
|
|
160
|
+
/** @internal The horizontal scroll container */
|
|
161
|
+
private readonly scrollContainer;
|
|
162
|
+
/** @internal The table, observed so a wider column re-measures the overflow */
|
|
163
|
+
private readonly tableElement;
|
|
164
|
+
/**
|
|
165
|
+
* @internal
|
|
166
|
+
* Whether the table is wider than its container. Only then the container is a named, focusable region,
|
|
167
|
+
* so keyboard users can scroll it; a table that fits adds no tab stop
|
|
168
|
+
*/
|
|
169
|
+
protected readonly overflowsX: import("@angular/core").WritableSignal<boolean>;
|
|
170
|
+
/** @internal Accessible name of the scroll container while it overflows */
|
|
171
|
+
protected readonly scrollRegionLabel: import("@angular/core").Signal<string>;
|
|
172
|
+
constructor();
|
|
180
173
|
readonly entriesPerPageOptions: import("@angular/core").Signal<{
|
|
181
174
|
value: 10 | 5 | 20 | 50 | 100;
|
|
182
175
|
text: string;
|
|
@@ -311,5 +304,5 @@ export declare class TableComponent {
|
|
|
311
304
|
/** @internal Clear all selections */
|
|
312
305
|
private clearList;
|
|
313
306
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent, never>;
|
|
314
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "st-table", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "pinRows": { "alias": "pinRows"; "required": false; "isSignal": true; }; "pinColumns": { "alias": "pinColumns"; "required": false; "isSignal": true; }; "zebra": { "alias": "zebra"; "required": false; "isSignal": true; }; "bordered": { "alias": "bordered"; "required": false; "isSignal": true; }; "rowHover": { "alias": "rowHover"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "loadingRows": { "alias": "loadingRows"; "required": false; "isSignal": true; }; "paginatorType": { "alias": "paginatorType"; "required": false; "isSignal": true; }; "noDataIcon": { "alias": "noDataIcon"; "required": false; "isSignal": true; }; "noResultsIcon": { "alias": "noResultsIcon"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "totalItems": { "alias": "totalItems"; "required": false; "isSignal": true; }; "pagination": { "alias": "pagination"; "required": false; "isSignal": true; }; "maxSize": { "alias": "maxSize"; "required": false; "isSignal": true; }; "showItemsPerPage": { "alias": "showItemsPerPage"; "required": false; "isSignal": true; }; "showEntries": { "alias": "showEntries"; "required": false; "isSignal": true; }; "showPagination": { "alias": "showPagination"; "required": false; "isSignal": true; }; "showFooter": { "alias": "showFooter"; "required": false; "isSignal": true; }; "hasActiveFiltersCallback": { "alias": "hasActiveFiltersCallback"; "required": false; "isSignal": true; }; "allowHeaderOverflow": { "alias": "allowHeaderOverflow"; "required": false; "isSignal": true; }; }, { "pageChanged": "pageChanged"; "pageSizeChanged": "pageSizeChanged"; "checkedItems": "checkedItems"; }, ["customEmptyState", "header", "rows"], ["st-empty-state", "st-table-empty-actions", "thead", "tbody", "tfoot"], true, never>;
|
|
307
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "st-table", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "pinRows": { "alias": "pinRows"; "required": false; "isSignal": true; }; "pinColumns": { "alias": "pinColumns"; "required": false; "isSignal": true; }; "zebra": { "alias": "zebra"; "required": false; "isSignal": true; }; "bordered": { "alias": "bordered"; "required": false; "isSignal": true; }; "rowHover": { "alias": "rowHover"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "loadingRows": { "alias": "loadingRows"; "required": false; "isSignal": true; }; "paginatorType": { "alias": "paginatorType"; "required": false; "isSignal": true; }; "noDataIcon": { "alias": "noDataIcon"; "required": false; "isSignal": true; }; "noResultsIcon": { "alias": "noResultsIcon"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "totalItems": { "alias": "totalItems"; "required": false; "isSignal": true; }; "pagination": { "alias": "pagination"; "required": false; "isSignal": true; }; "maxSize": { "alias": "maxSize"; "required": false; "isSignal": true; }; "showItemsPerPage": { "alias": "showItemsPerPage"; "required": false; "isSignal": true; }; "showEntries": { "alias": "showEntries"; "required": false; "isSignal": true; }; "showPagination": { "alias": "showPagination"; "required": false; "isSignal": true; }; "showFooter": { "alias": "showFooter"; "required": false; "isSignal": true; }; "hasActiveFiltersCallback": { "alias": "hasActiveFiltersCallback"; "required": false; "isSignal": true; }; "allowHeaderOverflow": { "alias": "allowHeaderOverflow"; "required": false; "isSignal": true; }; }, { "pageChanged": "pageChanged"; "pageSizeChanged": "pageSizeChanged"; "checkedItems": "checkedItems"; }, ["customEmptyState", "header", "rows"], ["st-empty-state", "st-table-empty-actions", "caption, colgroup", "thead", "tbody", "tfoot"], true, never>;
|
|
315
308
|
}
|
|
@@ -3,12 +3,19 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
* Directive that restricts input to numeric characters only.
|
|
4
4
|
*
|
|
5
5
|
* Use the `stOnlyNumbers` selector to enable numeric-only input restriction.
|
|
6
|
+
* By default only digits are accepted. `stOnlyNumbersAllowNegative` accepts a
|
|
7
|
+
* leading `-` and `stOnlyNumbersAllowDecimal` accepts one `.` after at least
|
|
8
|
+
* one digit. With either option on, each keypress and paste is judged by the
|
|
9
|
+
* value it would leave in the field (the current value with the selection
|
|
10
|
+
* replaced). Half-typed values such as `-`, `4.` or `-0.` stay typeable;
|
|
11
|
+
* checking that the final value is complete is the form validator's job.
|
|
6
12
|
*
|
|
7
13
|
* @example
|
|
8
14
|
* ```html
|
|
9
15
|
* <!-- Modern usage (recommended) -->
|
|
10
16
|
* <input stOnlyNumbers />
|
|
11
17
|
* <input [stOnlyNumbers]="true" />
|
|
18
|
+
* <input stOnlyNumbers stOnlyNumbersAllowNegative stOnlyNumbersAllowDecimal />
|
|
12
19
|
* ```
|
|
13
20
|
*/
|
|
14
21
|
export declare class OnlyNumbersDirective {
|
|
@@ -17,8 +24,27 @@ export declare class OnlyNumbersDirective {
|
|
|
17
24
|
* @default false
|
|
18
25
|
*/
|
|
19
26
|
stOnlyNumbers: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* Accept a single leading `-`. Only applies when `stOnlyNumbers` is on.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
stOnlyNumbersAllowNegative: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
32
|
+
/**
|
|
33
|
+
* Accept a single `.` as decimal separator, after at least one digit. Only applies when `stOnlyNumbers` is on.
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
stOnlyNumbersAllowDecimal: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
20
37
|
blockPaste(event: ClipboardEvent): boolean;
|
|
21
38
|
onKeyPress(event: KeyboardEvent): boolean;
|
|
39
|
+
private hasExtendedOptions;
|
|
40
|
+
private isCandidateKey;
|
|
41
|
+
/**
|
|
42
|
+
* Pattern for a value that is complete or still being typed: an optional
|
|
43
|
+
* leading `-`, then digits with at most one `.` after the first digit.
|
|
44
|
+
*/
|
|
45
|
+
private partialPattern;
|
|
46
|
+
/** The field's value after replacing the current selection with `text`. */
|
|
47
|
+
private resultingValue;
|
|
22
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<OnlyNumbersDirective, never>;
|
|
23
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<OnlyNumbersDirective, "[stOnlyNumbers]", never, { "stOnlyNumbers": { "alias": "stOnlyNumbers"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
49
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<OnlyNumbersDirective, "[stOnlyNumbers]", never, { "stOnlyNumbers": { "alias": "stOnlyNumbers"; "required": false; "isSignal": true; }; "stOnlyNumbersAllowNegative": { "alias": "stOnlyNumbersAllowNegative"; "required": false; "isSignal": true; }; "stOnlyNumbersAllowDecimal": { "alias": "stOnlyNumbersAllowDecimal"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
24
50
|
}
|
|
@@ -4,8 +4,13 @@ import { TextDirective } from '@sixbell-telco/sdk/directives/text';
|
|
|
4
4
|
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
6
|
|
|
7
|
+
let nextAccordionId = 0;
|
|
7
8
|
class AccordionComponent {
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Group name shared by the item inputs. Defaults to a name unique to this accordion, so two
|
|
11
|
+
* `type="single"` accordions on one page do not close each other's items.
|
|
12
|
+
*/
|
|
13
|
+
name = input(`st-accordion-${nextAccordionId++}`);
|
|
9
14
|
type = input('default');
|
|
10
15
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: AccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11
16
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.25", type: AccordionComponent, isStandalone: true, selector: "st-accordion", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"join join-vertical w-full\">\n\t<ng-content></ng-content>\n</div>\n" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-accordion.mjs","sources":["../../../projects/sdk/components/accordion/src/accordion.component.ts","../../../projects/sdk/components/accordion/src/accordion.component.html","../../../projects/sdk/components/accordion/accordion-item/accordion-item.component.ts","../../../projects/sdk/components/accordion/accordion-item/accordion-item.component.html","../../../projects/sdk/components/accordion/sixbell-telco-sdk-components-accordion.ts"],"sourcesContent":["import { Component, input } from '@angular/core';\n\n@Component({\n\tselector: 'st-accordion',\n\timports: [],\n\ttemplateUrl: './accordion.component.html',\n})\nexport class AccordionComponent {\n\tname = input(
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-accordion.mjs","sources":["../../../projects/sdk/components/accordion/src/accordion.component.ts","../../../projects/sdk/components/accordion/src/accordion.component.html","../../../projects/sdk/components/accordion/accordion-item/accordion-item.component.ts","../../../projects/sdk/components/accordion/accordion-item/accordion-item.component.html","../../../projects/sdk/components/accordion/sixbell-telco-sdk-components-accordion.ts"],"sourcesContent":["import { Component, input } from '@angular/core';\n\nlet nextAccordionId = 0;\n\n@Component({\n\tselector: 'st-accordion',\n\timports: [],\n\ttemplateUrl: './accordion.component.html',\n})\nexport class AccordionComponent {\n\t/**\n\t * Group name shared by the item inputs. Defaults to a name unique to this accordion, so two\n\t * `type=\"single\"` accordions on one page do not close each other's items.\n\t */\n\tname = input(`st-accordion-${nextAccordionId++}`);\n\ttype = input<'default' | 'single'>('default');\n}\n","<div class=\"join join-vertical w-full\">\n\t<ng-content></ng-content>\n</div>\n","import { booleanAttribute, Component, computed, inject, input } from '@angular/core';\nimport { TextDirective } from '@sixbell-telco/sdk/directives/text';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\nimport { AccordionComponent } from '../src/accordion.component';\n\nexport const accordionItemComponent = cva(['join-item border-neutral collapse border'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tdefault: [],\n\t\t\tarrow: ['collapse-arrow'],\n\t\t\tplus: ['collapse-plus'],\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tvariant: 'default',\n\t},\n});\n\nexport type AccordionVariantProps = 'default' | 'arrow' | 'plus' | null | undefined;\n\nexport type AccordionItemProps = {\n\tvariant?: AccordionVariantProps;\n};\n\n@Component({\n\tselector: 'st-accordion-item',\n\timports: [TextDirective],\n\ttemplateUrl: './accordion-item.component.html',\n})\nexport class AccordionItemComponent {\n\theader = input('');\n\topened = input(false, { transform: booleanAttribute });\n\n\tvariant = input<AccordionVariantProps>();\n\tname: string;\n\ttype: string;\n\n\tprivate readonly accordion = inject(AccordionComponent, { host: true });\n\n\tconstructor() {\n\t\tthis.name = this.accordion.name();\n\t\tthis.type = this.accordion.type() === 'single' ? 'radio' : 'checkbox';\n\t}\n\n\tcomponentClass = computed(() => cn(accordionItemComponent({ variant: this.variant() })));\n}\n","<div [class]=\"componentClass()\">\n\t<input [type]=\"type\" [name]=\"name\" [checked]=\"opened()\" />\n\t<div class=\"collapse-title\">\n\t\t<div stText=\"7\">\n\t\t\t{{ header() }}\n\t\t</div>\n\t</div>\n\t<div class=\"collapse-content\">\n\t\t<ng-content></ng-content>\n\t</div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAEA,IAAI,eAAe,GAAG,CAAC;MAOV,kBAAkB,CAAA;AAC9B;;;AAGG;IACH,IAAI,GAAG,KAAK,CAAC,CAAA,aAAA,EAAgB,eAAe,EAAE,CAAA,CAAE,CAAC;AACjD,IAAA,IAAI,GAAG,KAAK,CAAuB,SAAS,CAAC;wGANjC,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,kBAAkB,8TCT/B,kFAGA,EAAA,CAAA;;4FDMa,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAL9B,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,cAAc,WACf,EAAE,EAAA,QAAA,EAAA,kFAAA,EAAA;;;MEAC,sBAAsB,GAAG,GAAG,CAAC,CAAC,0CAA0C,CAAC,EAAE;AACvF,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;AACR,YAAA,OAAO,EAAE,EAAE;YACX,KAAK,EAAE,CAAC,gBAAgB,CAAC;YACzB,IAAI,EAAE,CAAC,eAAe,CAAC;AACvB,SAAA;AACD,KAAA;AACD,IAAA,eAAe,EAAE;AAChB,QAAA,OAAO,EAAE,SAAS;AAClB,KAAA;AACD,CAAA;MAaY,sBAAsB,CAAA;AAClC,IAAA,MAAM,GAAG,KAAK,CAAC,EAAE,CAAC;IAClB,MAAM,GAAG,KAAK,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAEtD,OAAO,GAAG,KAAK,EAAyB;AACxC,IAAA,IAAI;AACJ,IAAA,IAAI;IAEa,SAAS,GAAG,MAAM,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAEvE,IAAA,WAAA,GAAA;QACC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;AACjC,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,QAAQ,GAAG,OAAO,GAAG,UAAU;IACtE;IAEA,cAAc,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,sBAAsB,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;wGAf5E,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC9BnC,qSAWA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDgBW,aAAa,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,cAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,iBAAA,EAAA,aAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAGX,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBALlC,SAAS;+BACC,mBAAmB,EAAA,OAAA,EACpB,CAAC,aAAa,CAAC,EAAA,QAAA,EAAA,qSAAA,EAAA;;;AE3BzB;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, booleanAttribute, output, signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, output, signal, computed, ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
|
3
3
|
import { heroXCircle, heroExclamationTriangle, heroCheckCircle, heroInformationCircle, heroXMark } from '@ng-icons/heroicons/outline';
|
|
4
4
|
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
5
5
|
import { IconComponent } from '@sixbell-telco/sdk/components/icon';
|
|
@@ -14,7 +14,7 @@ const DISMISS_LABEL = { key: 'sdk.alert.dismiss', fallback: 'Dismiss alert' };
|
|
|
14
14
|
* Soft status callout classes. Body text stays on `base-content`; the icon and title read the
|
|
15
15
|
* `--color-<status>-strong` token so they meet 4.5:1 on the soft tint.
|
|
16
16
|
*/
|
|
17
|
-
const alertComponent = cva(['alert', 'alert-soft', 'flex', 'w-full', 'items-start', 'gap-3', 'text-base-content'], {
|
|
17
|
+
const alertComponent = cva(['alert', 'alert-soft', '@container', 'flex', 'w-full', 'flex-wrap', 'items-start', 'gap-3', 'text-base-content'], {
|
|
18
18
|
variants: {
|
|
19
19
|
variant: {
|
|
20
20
|
info: ['alert-info'],
|
|
@@ -127,10 +127,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
127
127
|
'[attr.hidden]': 'isDismissed() ? "" : null',
|
|
128
128
|
}, template: "@let headingVar = heading();\n@if (showIcon()) {\n\t<span class=\"flex shrink-0 pt-0.5\" [class]=\"accentClass()\">\n\t\t<st-icon [icon]=\"resolvedIcon()\" size=\"sm\"></st-icon>\n\t</span>\n}\n<div class=\"flex min-w-0 flex-1 flex-col gap-0.5 self-center\">\n\t@if (headingVar) {\n\t\t<p stText=\"7\" stTextWeight=\"semibold\" [stTextClass]=\"accentClass()\">{{ headingVar }}</p>\n\t}\n\t<div stText=\"7\" class=\"empty:hidden\"><ng-content /></div>\n</div>\n<ng-content select=\"st-alert-actions\" />\n@if (dismissible()) {\n\t<st-button\n\t\tclass=\"-my-1 shrink-0\"\n\t\tsize=\"sm\"\n\t\t[ghost]=\"true\"\n\t\t[circle]=\"true\"\n\t\t[icon]=\"dismissIcon\"\n\t\t[ariaLabel]=\"dismissLabel()\"\n\t\t(clicked)=\"dismiss()\"\n\t/>\n}\n" }]
|
|
129
129
|
}] });
|
|
130
|
-
/**
|
|
130
|
+
/**
|
|
131
|
+
* Action area of `st-alert`. From a 28rem wide alert up it sits after the body on the same row;
|
|
132
|
+
* below that it wraps to its own row under the text, so the text keeps its width on phones.
|
|
133
|
+
*/
|
|
131
134
|
class AlertActionsComponent {
|
|
135
|
+
/** @internal */
|
|
136
|
+
alert = inject(AlertComponent, { optional: true });
|
|
137
|
+
/** @internal Under the text on narrow alerts (indented past the icon), after it from `@md`. */
|
|
138
|
+
componentClass = computed(() => cn('order-last flex shrink-0 basis-full flex-wrap items-center gap-2 self-center @md:order-0 @md:basis-auto', (this.alert?.showIcon() ?? false) && 'ps-8 @md:ps-0'));
|
|
132
139
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: AlertActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
133
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: AlertActionsComponent, isStandalone: true, selector: "st-alert-actions", host: {
|
|
140
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: AlertActionsComponent, isStandalone: true, selector: "st-alert-actions", host: { properties: { "class": "componentClass()" } }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
134
141
|
}
|
|
135
142
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: AlertActionsComponent, decorators: [{
|
|
136
143
|
type: Component,
|
|
@@ -139,7 +146,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
139
146
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
140
147
|
template: '<ng-content />',
|
|
141
148
|
host: {
|
|
142
|
-
class: '
|
|
149
|
+
'[class]': 'componentClass()',
|
|
143
150
|
},
|
|
144
151
|
}]
|
|
145
152
|
}] });
|