@sixbell-telco/sdk 4.2.0 → 4.4.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 +108 -1
- package/README.md +98 -66
- package/_index.css +2 -1586
- package/components/accordion/accordion-item/accordion-item.component.d.ts +1 -1
- package/components/alert/README.md +27 -0
- package/components/alert/index.d.ts +5 -0
- package/components/alert/public-api.d.ts +1 -0
- package/components/alert/src/alert.component.d.ts +85 -0
- package/components/audio-player/audio-timeline/audio-timeline.component.d.ts +1 -1
- package/components/audio-player/button-play/button-play.component.d.ts +7 -7
- package/components/audio-player/src/audio-player.component.d.ts +2 -2
- package/components/audio-player/volume-control/volume-control.component.d.ts +1 -1
- package/components/avatar/README.md +1 -0
- package/components/avatar/src/avatar.component.d.ts +2 -2
- package/components/badge/src/badge.component.d.ts +4 -4
- package/components/button/README.md +5 -4
- package/components/button/src/button.component.d.ts +38 -16
- package/components/card/README.md +2 -0
- package/components/card/card-footer/card-footer.component.d.ts +37 -2
- package/components/card/card-section-group/card-section-group.component.d.ts +1 -1
- package/components/card/src/card.component.d.ts +6 -6
- package/components/countdown/src/countdown.component.d.ts +4 -4
- package/components/data-table/README.md +26 -0
- package/components/data-table/expandable/expandable.component.d.ts +4 -4
- package/components/data-table/sortable-header/sortable-header.component.d.ts +1 -1
- package/components/data-table/src/data-table.component.d.ts +15 -8
- package/components/data-table/sub-component-toggle/sub-component-toggle.component.d.ts +1 -1
- package/components/description-list/README.md +27 -0
- package/components/description-list/index.d.ts +5 -0
- package/components/description-list/public-api.d.ts +1 -0
- package/components/description-list/src/description-list.component.d.ts +90 -0
- package/components/dialog/README.md +10 -6
- package/components/dialog/dialog-actions/dialog-actions.component.d.ts +4 -0
- package/components/dialog/src/dialog.component.d.ts +27 -6
- package/components/dialog/src/fullscreen-block-scroll-strategy.d.ts +31 -0
- package/components/divider/src/divider.component.d.ts +1 -1
- package/components/dropdown/README.md +2 -2
- package/components/dropdown/dropdown-chevron/dropdown-chevron.component.d.ts +1 -1
- package/components/dropdown/dropdown-content/dropdown-content.component.d.ts +1 -1
- package/components/dropdown/dropdown-item/dropdown-item.component.d.ts +4 -4
- package/components/dropdown/dropdown-item-checkbox/dropdown-item-checkbox.component.d.ts +5 -5
- package/components/dropdown/dropdown-item-radio/dropdown-item-radio.component.d.ts +5 -5
- package/components/dropdown/dropdown-trigger/dropdown-trigger.component.d.ts +11 -14
- package/components/dropdown-menu/README.md +2 -2
- package/components/dropdown-menu/bar/dropdown-menu-bar/dropdown-menu-bar.component.d.ts +1 -1
- package/components/dropdown-menu/bar/dropdown-menu-bar-content/dropdown-menu-bar-content.component.d.ts +6 -2
- package/components/dropdown-menu/bar/dropdown-menu-bar-item/dropdown-menu-bar-item.component.d.ts +3 -3
- package/components/dropdown-menu/bar/dropdown-menu-bar-item-checkbox/dropdown-menu-bar-item-checkbox.component.d.ts +4 -4
- package/components/dropdown-menu/bar/dropdown-menu-bar-item-radio/dropdown-menu-bar-item-radio.component.d.ts +4 -4
- package/components/dropdown-menu/bar/dropdown-menu-bar-sub-trigger/dropdown-menu-bar-sub-trigger.component.d.ts +3 -1
- package/components/dropdown-menu/bar/dropdown-menu-bar-trigger/dropdown-menu-bar-trigger.component.d.ts +3 -1
- package/components/dropdown-menu/context/dropdown-context-menu-trigger/dropdown-context-menu-trigger.component.d.ts +2 -1
- package/components/dropdown-menu/dropdown-menu-chevron/dropdown-menu-chevron.component.d.ts +1 -1
- package/components/dropdown-menu/src/dropdown-menu-content/dropdown-menu-content.component.d.ts +2 -0
- package/components/dropdown-menu/src/dropdown-menu-item/dropdown-menu-item.component.d.ts +3 -3
- package/components/dropdown-menu/src/dropdown-menu-sub-content/dropdown-menu-sub-content.component.d.ts +2 -0
- package/components/dropdown-menu/src/dropdown-menu-sub-trigger/dropdown-menu-sub-trigger.component.d.ts +2 -1
- package/components/dropdown-menu/src/dropdown-menu-trigger/dropdown-menu-trigger.component.d.ts +1 -0
- package/components/empty-state/README.md +40 -0
- package/components/empty-state/index.d.ts +5 -0
- package/components/empty-state/public-api.d.ts +1 -0
- package/components/empty-state/src/empty-state.component.d.ts +73 -0
- package/components/file-upload/file-dropzone/file-dropzone.component.d.ts +4 -4
- package/components/file-upload/file-uploader/file-uploader.component.d.ts +2 -2
- package/components/forms/checkbox/src/checkbox.component.d.ts +1 -1
- package/components/forms/combobox/README.md +2 -1
- package/components/forms/combobox/src/combobox.component.d.ts +31 -18
- package/components/forms/date-picker/src/date-picker.component.d.ts +16 -9
- package/components/forms/form-hint/README.md +29 -0
- package/components/forms/form-hint/index.d.ts +5 -0
- package/components/forms/form-hint/public-api.d.ts +1 -0
- package/components/forms/form-hint/src/form-hint.component.d.ts +38 -0
- package/components/forms/form-item/src/form-item.component.d.ts +45 -1
- package/components/forms/input/src/input.component.d.ts +15 -8
- package/components/forms/radio/src/radio.component.d.ts +1 -1
- package/components/forms/range/src/range.component.d.ts +18 -4
- package/components/forms/select/README.md +2 -1
- package/components/forms/select/src/select.component.d.ts +30 -16
- package/components/forms/switch/src/switch.component.d.ts +1 -1
- package/components/forms/textarea/src/textarea.component.d.ts +12 -5
- package/components/forms/toggle/src/toggle.component.d.ts +1 -1
- package/components/notification/src/notification.component.d.ts +1 -1
- package/components/overlay/README.md +7 -2
- package/components/overlay/overlay-trigger/overlay-trigger.component.d.ts +1 -1
- package/components/overlay/src/overlay.component.d.ts +10 -9
- package/components/paginator/components/pagination-item/pagination-item.component.d.ts +3 -3
- package/components/progress/src/progress.component.d.ts +1 -1
- package/components/segmented-button/README.md +57 -0
- package/components/segmented-button/index.d.ts +5 -0
- package/components/segmented-button/public-api.d.ts +1 -0
- package/components/segmented-button/src/segmented-button.component.d.ts +110 -0
- package/components/sonner/toaster/src/toaster.component.d.ts +3 -3
- package/components/tab/src/tab.component.d.ts +2 -2
- package/components/table/README.md +51 -3
- package/components/table/public-api.d.ts +1 -0
- package/components/table/src/table.component.d.ts +20 -13
- package/components/table/table-action/table-action.component.d.ts +14 -3
- package/components/table/table-actions/table-actions.component.d.ts +12 -1
- package/components/table/tokens/README.md +7 -0
- package/components/table/tokens/index.d.ts +5 -0
- package/components/table/tokens/public-api.d.ts +1 -0
- package/components/table/tokens/table-empty-state.d.ts +6 -0
- package/components/tooltip/README.md +25 -7
- package/components/tooltip/src/tooltip.component.d.ts +44 -12
- package/components/tree/README.md +73 -0
- package/components/tree/index.d.ts +5 -0
- package/components/tree/public-api.d.ts +1 -0
- package/components/tree/src/tree.component.d.ts +180 -0
- package/components/wizard/README.md +9 -0
- package/components/wizard/wizard-content/wizard-content.component.d.ts +1 -1
- package/components/wizard/wizard-wrapper/wizard-wrapper.component.d.ts +15 -6
- package/directives/auto-focus/src/auto-focus.directive.d.ts +1 -1
- package/directives/only-numbers/src/only-numbers.directive.d.ts +1 -1
- package/directives/truncate/README.md +49 -0
- package/directives/truncate/index.d.ts +5 -0
- package/directives/truncate/public-api.d.ts +1 -0
- package/directives/truncate/src/truncate-popover.component.d.ts +11 -0
- package/directives/truncate/src/truncate.directive.d.ts +96 -0
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-alert.mjs +152 -0
- package/fesm2022/sixbell-telco-sdk-components-alert.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +15 -15
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs +5 -5
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +53 -19
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-card.mjs +61 -14
- package/fesm2022/sixbell-telco-sdk-components-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-countdown.mjs +5 -5
- package/fesm2022/sixbell-telco-sdk-components-countdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +34 -33
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-description-list.mjs +200 -0
- package/fesm2022/sixbell-telco-sdk-components-description-list.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +128 -17
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +33 -24
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs +7 -3
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +25 -14
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +43 -72
- package/fesm2022/sixbell-telco-sdk-components-dropdown.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-empty-state.mjs +131 -0
- package/fesm2022/sixbell-telco-sdk-components-empty-state.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +9 -9
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +104 -72
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +23 -12
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-hint.mjs +81 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-form-hint.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-form-item.mjs +45 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-form-item.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +27 -13
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +29 -7
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +84 -56
- 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 +27 -22
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs +41 -79
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-segmented-button.mjs +329 -0
- package/fesm2022/sixbell-telco-sdk-components-segmented-button.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-sonner.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-sonner.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table-tokens.mjs +14 -0
- package/fesm2022/sixbell-telco-sdk-components-table-tokens.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +63 -32
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +187 -75
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tree.mjs +478 -0
- package/fesm2022/sixbell-telco-sdk-components-tree.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +18 -9
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-truncate.mjs +339 -0
- package/fesm2022/sixbell-telco-sdk-directives-truncate.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-layouts.mjs +69 -41
- package/fesm2022/sixbell-telco-sdk-layouts.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-date.mjs +15 -2
- package/fesm2022/sixbell-telco-sdk-utils-date.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-mfe.mjs +87 -2
- package/fesm2022/sixbell-telco-sdk-utils-mfe.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-popover-motion.mjs +186 -0
- package/fesm2022/sixbell-telco-sdk-utils-popover-motion.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs +234 -4
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-translation-testing.mjs +203 -0
- package/fesm2022/sixbell-telco-sdk-utils-translation-testing.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +129 -14
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-unsaved-changes.mjs +150 -0
- package/fesm2022/sixbell-telco-sdk-utils-unsaved-changes.mjs.map +1 -0
- package/i18n/sdk/en.json +224 -0
- package/i18n/sdk/es.json +224 -0
- package/i18n/sdk/pt.json +224 -0
- package/layouts/README.md +18 -11
- package/layouts/public-api.d.ts +1 -1
- package/layouts/src/app-layout/app-layout.component.d.ts +11 -8
- package/layouts/src/layout.config.d.ts +1 -1
- package/layouts/src/menu/menu-active.d.ts +2 -1
- package/layouts/src/menu/menu-url.d.ts +2 -0
- package/layouts/src/navbar/navbar.component.d.ts +5 -5
- package/layouts/src/page-banner/page-banner.component.d.ts +19 -2
- package/layouts/src/side-menu/side-menu.component.d.ts +2 -2
- package/layouts/src/user-menu/user-menu.component.d.ts +5 -5
- package/package.json +64 -20
- package/src/_index.css +1701 -0
- package/utils/mfe/README.md +1 -0
- package/utils/mfe/src/hoist-property-rules.d.ts +13 -0
- package/utils/mfe/src/mfe-shadow-shell.component.d.ts +3 -0
- package/utils/popover-motion/README.md +38 -0
- package/utils/popover-motion/index.d.ts +5 -0
- package/utils/popover-motion/public-api.d.ts +2 -0
- package/utils/popover-motion/src/popover-menu-motion.d.ts +37 -0
- package/utils/popover-motion/src/popover-motion.d.ts +31 -0
- package/utils/theme/README.md +94 -1
- package/utils/theme/public-api.d.ts +2 -1
- package/utils/theme/src/models/theme.d.ts +32 -0
- package/utils/theme/src/overlay/theme-overlay.d.ts +33 -0
- package/utils/theme/src/providers/theme.provider.types.d.ts +7 -0
- package/utils/translation/README.md +63 -0
- package/utils/translation/src/translation.service.d.ts +24 -0
- package/utils/translation/testing/index.d.ts +5 -0
- package/utils/translation/testing/public-api.d.ts +2 -0
- package/utils/translation/testing/src/translation-testing.d.ts +96 -0
- package/utils/unsaved-changes/README.md +33 -0
- package/utils/unsaved-changes/index.d.ts +5 -0
- package/utils/unsaved-changes/public-api.d.ts +1 -0
- package/utils/unsaved-changes/src/unsaved-changes-dialog.component.d.ts +24 -0
- package/utils/unsaved-changes/src/unsaved-changes.d.ts +50 -0
|
@@ -3,9 +3,10 @@ import * as i1 from '@angular/cdk/overlay';
|
|
|
3
3
|
import { OverlayModule } from '@angular/cdk/overlay';
|
|
4
4
|
import { PortalModule } from '@angular/cdk/portal';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { inject, computed, input, model, output, signal, viewChild, effect, afterRenderEffect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
6
|
+
import { inject, computed, input, booleanAttribute, model, output, signal, viewChild, effect, afterRenderEffect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
7
7
|
import { toObservable, toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
8
8
|
import { FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
9
|
+
import { optionalBooleanAttribute, injectFormFieldA11y } from '@sixbell-telco/sdk/components/forms/form-item';
|
|
9
10
|
import { TranslateService, TranslatePipe } from '@ngx-translate/core';
|
|
10
11
|
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
11
12
|
import { cva } from 'class-variance-authority';
|
|
@@ -13,6 +14,7 @@ import { BadgeComponent } from '@sixbell-telco/sdk/components/badge';
|
|
|
13
14
|
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
14
15
|
import { IconComponent } from '@sixbell-telco/sdk/components/icon';
|
|
15
16
|
import { matSearchOutline, matKeyboardArrowDownOutline, matCheckOutline, matCloseOutline } from '@sixbell-telco/sdk/components/icon/material/outline';
|
|
17
|
+
import { popoverPlacement, isPopoverMotionAnimation } from '@sixbell-telco/sdk/utils/popover-motion';
|
|
16
18
|
import { ThemeDomService } from '@sixbell-telco/sdk/utils/theme';
|
|
17
19
|
import { injectLabelTranslator } from '@sixbell-telco/sdk/utils/translation';
|
|
18
20
|
import { Subject, switchMap, startWith, debounceTime, distinctUntilChanged } from 'rxjs';
|
|
@@ -147,17 +149,28 @@ class ComboboxComponent {
|
|
|
147
149
|
* Whether to show optional indicator
|
|
148
150
|
* @defaultValue false
|
|
149
151
|
*/
|
|
150
|
-
showOptional = input(false);
|
|
152
|
+
showOptional = input(false, { transform: booleanAttribute });
|
|
151
153
|
/**
|
|
152
154
|
* Optional indicator text (translation key or literal)
|
|
153
155
|
* @defaultValue 'sdk.formFields.optional'
|
|
154
156
|
*/
|
|
155
157
|
optionalText = input('sdk.formFields.optional');
|
|
158
|
+
/**
|
|
159
|
+
* Mark the field as required: shows the `*` marker and announces the field as required.
|
|
160
|
+
* When not set, the enclosing `st-form-item` `required`, then `Validators.required` on the bound control decide.
|
|
161
|
+
*/
|
|
162
|
+
required = input(undefined, { transform: optionalBooleanAttribute });
|
|
163
|
+
/** @internal Required state and hint ids from the enclosing `st-form-item`. */
|
|
164
|
+
fieldA11y = injectFormFieldA11y({
|
|
165
|
+
required: () => this.required(),
|
|
166
|
+
control: () => this.formControl(),
|
|
167
|
+
status: () => this.statusSignal(),
|
|
168
|
+
});
|
|
156
169
|
/**
|
|
157
170
|
* Whether to use ghost (transparent) styling
|
|
158
171
|
* @default false
|
|
159
172
|
*/
|
|
160
|
-
ghost = input(false);
|
|
173
|
+
ghost = input(false, { transform: booleanAttribute });
|
|
161
174
|
/**
|
|
162
175
|
* The HTML name attribute for the underlying form control
|
|
163
176
|
*/
|
|
@@ -196,13 +209,13 @@ class ComboboxComponent {
|
|
|
196
209
|
* Works for both single and multiple selection modes
|
|
197
210
|
* @default true
|
|
198
211
|
*/
|
|
199
|
-
allowClear = input(true);
|
|
212
|
+
allowClear = input(true, { transform: booleanAttribute });
|
|
200
213
|
/**
|
|
201
214
|
* Whether to show a "Clear All" button at the bottom of the dropdown for multiple selection
|
|
202
215
|
* Only applies when selectionType is 'multiple'
|
|
203
216
|
* @default true
|
|
204
217
|
*/
|
|
205
|
-
allowClearAll = input(true);
|
|
218
|
+
allowClearAll = input(true, { transform: booleanAttribute });
|
|
206
219
|
/**
|
|
207
220
|
* Placeholder text for the search input field
|
|
208
221
|
* @default 'Search...'
|
|
@@ -242,7 +255,7 @@ class ComboboxComponent {
|
|
|
242
255
|
* Whether to enable debounced search functionality
|
|
243
256
|
* @default false
|
|
244
257
|
*/
|
|
245
|
-
searchDebounced = input(false);
|
|
258
|
+
searchDebounced = input(false, { transform: booleanAttribute });
|
|
246
259
|
/**
|
|
247
260
|
* Debounce time in milliseconds for search input
|
|
248
261
|
* @default 300
|
|
@@ -260,7 +273,7 @@ class ComboboxComponent {
|
|
|
260
273
|
* Stop event propagation for activation events
|
|
261
274
|
* @defaultValue false
|
|
262
275
|
*/
|
|
263
|
-
stopPropagation = input(false);
|
|
276
|
+
stopPropagation = input(false, { transform: booleanAttribute });
|
|
264
277
|
/**
|
|
265
278
|
* Event emitted on click
|
|
266
279
|
*/
|
|
@@ -303,6 +316,8 @@ class ComboboxComponent {
|
|
|
303
316
|
searchSubject = new Subject();
|
|
304
317
|
/** Current animation state of the overlay */
|
|
305
318
|
animationState = signal('closed');
|
|
319
|
+
/** Set when the exit animation already ran the close cleanup, so the detach that follows does not repeat it */
|
|
320
|
+
exitSettled = false;
|
|
306
321
|
/** Trigger for blur events in form validation */
|
|
307
322
|
blurTrigger = signal(0);
|
|
308
323
|
/** Active option index for keyboard navigation */
|
|
@@ -332,53 +347,21 @@ class ComboboxComponent {
|
|
|
332
347
|
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },
|
|
333
348
|
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
|
|
334
349
|
];
|
|
335
|
-
/**
|
|
336
|
-
|
|
337
|
-
* Maps animation directions to complete Tailwind class names
|
|
338
|
-
* All class names are static and detectable by Tailwind at build time
|
|
339
|
-
*/
|
|
340
|
-
animationClassMap = {
|
|
341
|
-
bottom: 'data-[state=opening]:animate-fade-in-up data-[state=open]:animate-fade-in-up data-[state=closing]:animate-fade-out-down',
|
|
342
|
-
top: 'data-[state=opening]:animate-fade-in-down data-[state=open]:animate-fade-in-down data-[state=closing]:animate-fade-out-up',
|
|
343
|
-
left: 'data-[state=opening]:animate-fade-in-left data-[state=open]:animate-fade-in-left data-[state=closing]:animate-fade-out-right',
|
|
344
|
-
right: 'data-[state=opening]:animate-fade-in-right data-[state=open]:animate-fade-in-right data-[state=closing]:animate-fade-out-left',
|
|
345
|
-
};
|
|
346
|
-
/**
|
|
347
|
-
* Computed animation direction based on current overlay position
|
|
348
|
-
* Dynamically detects position and returns appropriate direction: 'top', 'bottom', 'left', or 'right'
|
|
349
|
-
*/
|
|
350
|
-
animationDirection = computed(() => {
|
|
350
|
+
/** Real placement of the open panel, bound to `data-side` / `data-align`; null until the CDK places it */
|
|
351
|
+
placement = computed(() => {
|
|
351
352
|
const position = this.currentPosition();
|
|
352
|
-
|
|
353
|
-
return 'bottom'; // default
|
|
354
|
-
// Determine direction based on overlay Y and X positions
|
|
355
|
-
const overlayY = position.overlayY;
|
|
356
|
-
const overlayX = position.overlayX;
|
|
357
|
-
// Priority: check Y first, then X
|
|
358
|
-
if (overlayY === 'top') {
|
|
359
|
-
return 'top'; // Dropdown appears above
|
|
360
|
-
}
|
|
361
|
-
else if (overlayY === 'bottom') {
|
|
362
|
-
return 'bottom'; // Dropdown appears below
|
|
363
|
-
}
|
|
364
|
-
else if (overlayX === 'end') {
|
|
365
|
-
return 'left'; // Dropdown appears to the left
|
|
366
|
-
}
|
|
367
|
-
else if (overlayX === 'start') {
|
|
368
|
-
return 'right'; // Dropdown appears to the right
|
|
369
|
-
}
|
|
370
|
-
return 'bottom'; // default
|
|
353
|
+
return position ? popoverPlacement(position) : null;
|
|
371
354
|
});
|
|
372
355
|
/**
|
|
373
|
-
*
|
|
374
|
-
*
|
|
356
|
+
* Side of the field the panel opened on (`'bottom'` until the CDK places it)
|
|
357
|
+
* @deprecated Read `data-side` on the panel instead; kept for compatibility
|
|
375
358
|
*/
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
359
|
+
animationDirection = computed(() => this.placement()?.side ?? 'bottom');
|
|
360
|
+
/**
|
|
361
|
+
* Class of the panel: the shared `popover-motion` utility driven by `data-state` and `data-side`
|
|
362
|
+
* @deprecated Kept for compatibility; the motion lives in the `popover-motion` utility
|
|
363
|
+
*/
|
|
364
|
+
animationClasses = computed(() => 'popover-motion');
|
|
382
365
|
// ==============================================================================
|
|
383
366
|
// FORM CONTROL INTEGRATION
|
|
384
367
|
// ==============================================================================
|
|
@@ -399,6 +382,8 @@ class ComboboxComponent {
|
|
|
399
382
|
// ==============================================================================
|
|
400
383
|
/** Callback function for value changes */
|
|
401
384
|
onChange = (value) => { };
|
|
385
|
+
/** Value written through the accessor before any matching option was bound */
|
|
386
|
+
pendingValue = null;
|
|
402
387
|
/** Callback function for touch events */
|
|
403
388
|
onTouched = () => { };
|
|
404
389
|
// ==============================================================================
|
|
@@ -487,11 +472,9 @@ class ComboboxComponent {
|
|
|
487
472
|
const selectionType = this.selectionType();
|
|
488
473
|
const currentValue = this.value();
|
|
489
474
|
if (selectionType === 'multiple') {
|
|
490
|
-
const selected = Array.isArray(currentValue) ? currentValue : [];
|
|
475
|
+
const selected = (Array.isArray(currentValue) ? currentValue : []).filter((value) => this.isValidValue(value));
|
|
491
476
|
if (selected.length === 0)
|
|
492
477
|
return null;
|
|
493
|
-
if (selected.length === 1)
|
|
494
|
-
return { firstItem: this.getDisplayValue(selected[0]), additionalCount: 0 };
|
|
495
478
|
return {
|
|
496
479
|
firstItem: this.getDisplayValue(selected[0]),
|
|
497
480
|
additionalCount: selected.length - 1,
|
|
@@ -667,27 +650,58 @@ class ComboboxComponent {
|
|
|
667
650
|
* @param value - The new value to set
|
|
668
651
|
*/
|
|
669
652
|
writeValue(value) {
|
|
670
|
-
|
|
653
|
+
this.pendingValue = null;
|
|
671
654
|
if (!value) {
|
|
672
655
|
this.value.set(value);
|
|
673
656
|
return;
|
|
674
657
|
}
|
|
675
658
|
if (this.selectionType() === 'multiple') {
|
|
676
|
-
|
|
677
|
-
if (Array.isArray(value)) {
|
|
678
|
-
const validValues = value.filter((v) => this.isValidValue(v));
|
|
679
|
-
this.value.set(validValues.length > 0 ? validValues : []);
|
|
680
|
-
}
|
|
681
|
-
else {
|
|
659
|
+
if (!Array.isArray(value)) {
|
|
682
660
|
this.value.set([]);
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
const validValues = value.filter((v) => this.isValidValue(v));
|
|
664
|
+
const unresolved = value.filter((v) => !this.isValidValue(v));
|
|
665
|
+
if (unresolved.length > 0) {
|
|
666
|
+
this.pendingValue = unresolved;
|
|
683
667
|
}
|
|
668
|
+
this.value.set(validValues);
|
|
684
669
|
}
|
|
685
670
|
else {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
671
|
+
if (this.isValidValue(value)) {
|
|
672
|
+
this.value.set(value);
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
// Options may still be loading or be replaced: keep the raw value until a matching option arrives
|
|
676
|
+
this.pendingValue = value;
|
|
677
|
+
this.value.set(null);
|
|
689
678
|
}
|
|
690
679
|
}
|
|
680
|
+
/**
|
|
681
|
+
* Resolves a value written before its options existed once matching options arrive.
|
|
682
|
+
* Multiple selection shows the matching values and keeps the rest pending until they resolve. Never calls onChange.
|
|
683
|
+
*/
|
|
684
|
+
pendingValueEffect = effect(() => {
|
|
685
|
+
this.options();
|
|
686
|
+
untracked(() => {
|
|
687
|
+
const pending = this.pendingValue;
|
|
688
|
+
if (pending === null)
|
|
689
|
+
return;
|
|
690
|
+
if (Array.isArray(pending)) {
|
|
691
|
+
const matches = pending.filter((v) => this.isValidValue(v));
|
|
692
|
+
if (matches.length === 0)
|
|
693
|
+
return;
|
|
694
|
+
const unresolved = pending.filter((v) => !this.isValidValue(v));
|
|
695
|
+
this.pendingValue = unresolved.length > 0 ? unresolved : null;
|
|
696
|
+
const current = this.value();
|
|
697
|
+
this.value.set([...(Array.isArray(current) ? current : []), ...matches]);
|
|
698
|
+
}
|
|
699
|
+
else if (this.isValidValue(pending)) {
|
|
700
|
+
this.pendingValue = null;
|
|
701
|
+
this.value.set(pending);
|
|
702
|
+
}
|
|
703
|
+
});
|
|
704
|
+
});
|
|
691
705
|
/**
|
|
692
706
|
* Registers a callback function to be called when the value changes
|
|
693
707
|
* @param fn - The callback function
|
|
@@ -721,6 +735,8 @@ class ComboboxComponent {
|
|
|
721
735
|
this.animationState.set('opening');
|
|
722
736
|
// Focus search input after opening
|
|
723
737
|
setTimeout(() => {
|
|
738
|
+
if (this.animationState() !== 'opening' && this.animationState() !== 'open')
|
|
739
|
+
return;
|
|
724
740
|
this.searchInputRef()?.nativeElement?.focus();
|
|
725
741
|
// Set first option as active by default
|
|
726
742
|
this.setDefaultActiveOption();
|
|
@@ -758,11 +774,15 @@ class ComboboxComponent {
|
|
|
758
774
|
* @param event - The animation event
|
|
759
775
|
*/
|
|
760
776
|
onAnimationEnd(event) {
|
|
761
|
-
if (
|
|
777
|
+
if (event.target !== event.currentTarget)
|
|
778
|
+
return;
|
|
779
|
+
if (this.animationState() === 'opening' && isPopoverMotionAnimation(event, 'opening')) {
|
|
762
780
|
this.animationState.set('open');
|
|
763
781
|
}
|
|
764
|
-
else if (this.animationState() === 'closing' && event
|
|
782
|
+
else if (this.animationState() === 'closing' && isPopoverMotionAnimation(event, 'closing')) {
|
|
783
|
+
this.exitSettled = true;
|
|
765
784
|
this.animationState.set('closed');
|
|
785
|
+
this.currentPosition.set(null);
|
|
766
786
|
this.clearSearch();
|
|
767
787
|
this.triggerBlur();
|
|
768
788
|
// Return focus to trigger button for better keyboard navigation
|
|
@@ -776,7 +796,12 @@ class ComboboxComponent {
|
|
|
776
796
|
* Cleans up state and triggers blur
|
|
777
797
|
*/
|
|
778
798
|
handleDetach() {
|
|
799
|
+
if (this.exitSettled) {
|
|
800
|
+
this.exitSettled = false;
|
|
801
|
+
return;
|
|
802
|
+
}
|
|
779
803
|
this.animationState.set('closed');
|
|
804
|
+
this.currentPosition.set(null);
|
|
780
805
|
this.clearSearch();
|
|
781
806
|
this.triggerBlur();
|
|
782
807
|
}
|
|
@@ -792,13 +817,17 @@ class ComboboxComponent {
|
|
|
792
817
|
* @param event - The mouse event
|
|
793
818
|
*/
|
|
794
819
|
handleClickOutside(event) {
|
|
795
|
-
|
|
820
|
+
const state = this.animationState();
|
|
821
|
+
if (state === 'opening' || state === 'open') {
|
|
796
822
|
this.animationState.set('closing');
|
|
797
823
|
}
|
|
798
824
|
if (this.stopPropagation()) {
|
|
799
825
|
event.stopPropagation();
|
|
800
826
|
}
|
|
801
|
-
|
|
827
|
+
// A panel that is shown blurs when its exit animation ends
|
|
828
|
+
if (state === 'closed') {
|
|
829
|
+
this.triggerBlur();
|
|
830
|
+
}
|
|
802
831
|
}
|
|
803
832
|
/**
|
|
804
833
|
* Handles search input changes
|
|
@@ -839,11 +868,13 @@ class ComboboxComponent {
|
|
|
839
868
|
else {
|
|
840
869
|
newValues = [...currentValues, option];
|
|
841
870
|
}
|
|
871
|
+
const emitted = Array.isArray(this.pendingValue) ? [...newValues, ...this.pendingValue] : newValues;
|
|
842
872
|
this.value.set(newValues);
|
|
843
|
-
this.onChange(
|
|
844
|
-
this.valueUpdated.emit(
|
|
873
|
+
this.onChange(emitted);
|
|
874
|
+
this.valueUpdated.emit(emitted);
|
|
845
875
|
}
|
|
846
876
|
else {
|
|
877
|
+
this.pendingValue = null;
|
|
847
878
|
this.value.set(option);
|
|
848
879
|
this.onChange(option);
|
|
849
880
|
this.valueUpdated.emit(option);
|
|
@@ -1016,6 +1047,7 @@ class ComboboxComponent {
|
|
|
1016
1047
|
clearSelection() {
|
|
1017
1048
|
if (this.disabled())
|
|
1018
1049
|
return;
|
|
1050
|
+
this.pendingValue = null;
|
|
1019
1051
|
if (this.selectionType() === 'multiple') {
|
|
1020
1052
|
this.value.set([]);
|
|
1021
1053
|
this.onChange([]);
|
|
@@ -1239,13 +1271,13 @@ class ComboboxComponent {
|
|
|
1239
1271
|
});
|
|
1240
1272
|
}
|
|
1241
1273
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ComboboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1242
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: ComboboxComponent, isStandalone: true, selector: "st-combobox", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, showOptional: { classPropertyName: "showOptional", publicName: "showOptional", isSignal: true, isRequired: false, transformFunction: null }, optionalText: { classPropertyName: "optionalText", publicName: "optionalText", isSignal: true, isRequired: false, transformFunction: null }, ghost: { classPropertyName: "ghost", publicName: "ghost", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, allowClear: { classPropertyName: "allowClear", publicName: "allowClear", isSignal: true, isRequired: false, transformFunction: null }, allowClearAll: { classPropertyName: "allowClearAll", publicName: "allowClearAll", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, noResultsText: { classPropertyName: "noResultsText", publicName: "noResultsText", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, displayKey: { classPropertyName: "displayKey", publicName: "displayKey", isSignal: true, isRequired: false, transformFunction: null }, valueKey: { classPropertyName: "valueKey", publicName: "valueKey", isSignal: true, isRequired: false, transformFunction: null }, selectionType: { classPropertyName: "selectionType", publicName: "selectionType", isSignal: true, isRequired: false, transformFunction: null }, searchDebounced: { classPropertyName: "searchDebounced", publicName: "searchDebounced", isSignal: true, isRequired: false, transformFunction: null }, searchDebounceTime: { classPropertyName: "searchDebounceTime", publicName: "searchDebounceTime", isSignal: true, isRequired: false, transformFunction: null }, stopPropagation: { classPropertyName: "stopPropagation", publicName: "stopPropagation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", value: "valueChange", blurred: "blurred", valueUpdated: "valueUpdated", clicked: "clicked", keyDownEnter: "keyDownEnter", keyDownSpace: "keyDownSpace", triggered: "triggered", searchQuery: "searchQuery" }, providers: [
|
|
1274
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: ComboboxComponent, isStandalone: true, selector: "st-combobox", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, showOptional: { classPropertyName: "showOptional", publicName: "showOptional", isSignal: true, isRequired: false, transformFunction: null }, optionalText: { classPropertyName: "optionalText", publicName: "optionalText", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, ghost: { classPropertyName: "ghost", publicName: "ghost", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, allowClear: { classPropertyName: "allowClear", publicName: "allowClear", isSignal: true, isRequired: false, transformFunction: null }, allowClearAll: { classPropertyName: "allowClearAll", publicName: "allowClearAll", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, noResultsText: { classPropertyName: "noResultsText", publicName: "noResultsText", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, displayKey: { classPropertyName: "displayKey", publicName: "displayKey", isSignal: true, isRequired: false, transformFunction: null }, valueKey: { classPropertyName: "valueKey", publicName: "valueKey", isSignal: true, isRequired: false, transformFunction: null }, selectionType: { classPropertyName: "selectionType", publicName: "selectionType", isSignal: true, isRequired: false, transformFunction: null }, searchDebounced: { classPropertyName: "searchDebounced", publicName: "searchDebounced", isSignal: true, isRequired: false, transformFunction: null }, searchDebounceTime: { classPropertyName: "searchDebounceTime", publicName: "searchDebounceTime", isSignal: true, isRequired: false, transformFunction: null }, stopPropagation: { classPropertyName: "stopPropagation", publicName: "stopPropagation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", value: "valueChange", blurred: "blurred", valueUpdated: "valueUpdated", clicked: "clicked", keyDownEnter: "keyDownEnter", keyDownSpace: "keyDownSpace", triggered: "triggered", searchQuery: "searchQuery" }, providers: [
|
|
1243
1275
|
{
|
|
1244
1276
|
provide: NG_VALUE_ACCESSOR,
|
|
1245
1277
|
useExisting: ComboboxComponent,
|
|
1246
1278
|
multi: true,
|
|
1247
1279
|
},
|
|
1248
|
-
], viewQueries: [{ propertyName: "fieldRef", first: true, predicate: ["field"], descendants: true, isSignal: true }, { propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "searchInputRef", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "optionsList", first: true, predicate: ["optionsList"], descendants: true, isSignal: true }, { propertyName: "listbox", first: true, predicate: ["listbox"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<!-- Field chrome click is pointer-only sugar; keyboard access is the focusable trigger button inside. -->\n@let isOpen = this.isOpen(); @let triggerWidth = this.triggerWidth(); @let dataState = this.dataState();\n@let filteredOptions = this.filteredOptions(); @let displayValue = this.displayValue(); @let multipleDisplayInfo = this.multipleDisplayInfo();\n@let label = this.label();\n\n<fieldset class=\"fieldset p-0\">\n\t@if (label) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t\t<span>{{ label }}</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\n\t<div\n\t\t#field\n\t\tcdkOverlayOrigin\n\t\t#overlayOrigin=\"cdkOverlayOrigin\"\n\t\t[class]=\"validationClass()\"\n\t\t[attr.data-open]=\"isOpen ? '' : null\"\n\t\t(click)=\"handleFieldChromeClick($event)\"\n\t>\n\t\t<button\n\t\t\t#trigger\n\t\t\t[id]=\"resolvedId()\"\n\t\t\tclass=\"min-w-0 flex-1 grow cursor-pointer bg-transparent p-0 text-left outline-hidden\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(keydown)=\"handleTriggerKeydown($event)\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"true\"\n\t\t\trole=\"combobox\"\n\t\t\t[attr.aria-controls]=\"'combobox-list'\"\n\t\t\t[attr.aria-expanded]=\"isOpen\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t>\n\t\t\t<span class=\"block min-w-0 truncate text-left\">\n\t\t\t\t@if (selectionType() === 'multiple' && multipleDisplayInfo) {\n\t\t\t\t\t<span class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t<span class=\"truncate\">{{ multipleDisplayInfo.firstItem }}</span>\n\t\t\t\t\t\t@if (multipleDisplayInfo.additionalCount > 0) {\n\t\t\t\t\t\t\t<st-badge variant=\"primary\" [soft]=\"true\" [size]=\"badgeClass()\">+{{ multipleDisplayInfo.additionalCount }}</st-badge>\n\t\t\t\t\t\t}\n\t\t\t\t\t</span>\n\t\t\t\t} @else {\n\t\t\t\t\t{{ displayValue }}\n\t\t\t\t}\n\t\t\t</span>\n\t\t</button>\n\t\t@if (showClearButton()) {\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdata-st-clear\n\t\t\t\tclass=\"btn btn-ghost btn-square shrink-0 cursor-pointer [--fontsize:1em] [--size:1.25em]\"\n\t\t\t\t(click)=\"handleClearSelection($event)\"\n\t\t\t\t(keydown.enter)=\"handleClearSelection($event)\"\n\t\t\t\t(keydown.space)=\"handleClearSelection($event)\"\n\t\t\t\t[attr.aria-label]=\"clearSelectionLabel()\"\n\t\t\t>\n\t\t\t\t<st-icon [icon]=\"iconClose\"></st-icon>\n\t\t\t</button>\n\t\t}\n\t\t<span data-st-chevron class=\"pointer-events-none inline-flex size-[1em] shrink-0 items-center justify-center\" aria-hidden=\"true\">\n\t\t\t<st-icon [icon]=\"iconChevronDown\"></st-icon>\n\t\t</span>\n\t</div>\n\n\t<ng-template\n\t\tcdkConnectedOverlay\n\t\t[cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n\t\t[cdkConnectedOverlayOpen]=\"isOpen\"\n\t\t[cdkConnectedOverlayPositions]=\"overlayPositions\"\n\t\t[cdkConnectedOverlayWidth]=\"triggerWidth\"\n\t\t[cdkConnectedOverlayMinWidth]=\"triggerWidth\"\n\t\t(detach)=\"handleDetach()\"\n\t\t(overlayOutsideClick)=\"handleClickOutside($event)\"\n\t\t(positionChange)=\"onPositionChange($event)\"\n\t>\n\t\t<div class=\"contents\" [attr.data-theme]=\"themeDomService.themeOf(field)\">\n\t\t\t<div [class]=\"'rounded-box shadow-main w-full ' + animationClasses()\" (animationend)=\"onAnimationEnd($event)\" [attr.data-state]=\"dataState\">\n\t\t\t\t<div class=\"bg-base-200 rounded-box border-neutral overflow-hidden border border-solid\">\n\t\t\t\t\t<!-- Search Input -->\n\t\t\t\t\t<div class=\"border-neutral border-b\">\n\t\t\t\t\t\t@let searchInputClass = this.searchInputClass();\n\t\t\t\t\t\t<div [class]=\"searchInputClass\">\n\t\t\t\t\t\t\t<st-icon class=\"text-base-placeholder\" [icon]=\"iconSearch\"></st-icon>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t#searchInput\n\t\t\t\t\t\t\t\tclass=\"placeholder:text-base-placeholder w-full border-transparent py-0 focus-within:outline-hidden focus:border-transparent focus:outline-hidden\"\n\t\t\t\t\t\t\t\t[value]=\"currentSearchValue\"\n\t\t\t\t\t\t\t\t(input)=\"handleSearchInput($event)\"\n\t\t\t\t\t\t\t\t(keydown)=\"handleSearchKeydown($event)\"\n\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t[placeholder]=\"translatedSearchPlaceholder()\"\n\t\t\t\t\t\t\t\t[attr.aria-label]=\"searchOptionsLabel()\"\n\t\t\t\t\t\t\t\t[disabled]=\"!isOpen\"\n\t\t\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Options List -->\n\t\t\t\t\t@let menuClass = this.menuClass();\n\t\t\t\t\t<ul\n\t\t\t\t\t\t[class]=\"menuClass\"\n\t\t\t\t\t\tcdkListbox\n\t\t\t\t\t\tcdkListboxUseActiveDescendant\n\t\t\t\t\t\t[cdkListboxMultiple]=\"selectionType() === 'multiple'\"\n\t\t\t\t\t\taria-labelledby=\"Combobox options\"\n\t\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\t\t#optionsList\n\t\t\t\t\t\t[tabindex]=\"-1\"\n\t\t\t\t\t\t(keydown)=\"handleListboxKeydown($event)\"\n\t\t\t\t\t\t(selectionChange)=\"handleSelectionChange($event)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t@for (option of filteredOptions; track $index) {\n\t\t\t\t\t\t\t<li [cdkOption]=\"option\" class=\"group\" [attr.data-option-index]=\"$index\" [class.cdk-option-active]=\"isActiveOption($index)\">\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tclass=\"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\"\n\t\t\t\t\t\t\t\t\t(click)=\"handleOptionSelect(option)\"\n\t\t\t\t\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<span class=\"min-w-0 flex-1 wrap-break-word whitespace-normal\">{{ getDisplayValue(option) }}</span>\n\n\t\t\t\t\t\t\t\t\t@if (isOptionSelected(option)) {\n\t\t\t\t\t\t\t\t\t\t<st-icon class=\"h-4 w-4 shrink-0\" [icon]=\"iconCheck\"></st-icon>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t<!-- Empty state -->\n\t\t\t\t\t\t@if (filteredOptions.length === 0) {\n\t\t\t\t\t\t\t<li class=\"text-base-content/60 px-4 py-2 text-center\">\n\t\t\t\t\t\t\t\t<span>{{ translatedNoResultsText() }}</span>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\t\t\t\t\t</ul>\n\n\t\t\t\t\t<!-- Clear All button for multiple selection -->\n\t\t\t\t\t@if (selectionType() === 'multiple' && allowClearAll() && value() && isArray(value()) && value().length > 0) {\n\t\t\t\t\t\t<div class=\"border-base-300 border-t p-2\">\n\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\tvariant=\"base\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t[outline]=\"true\"\n\t\t\t\t\t\t\t\t[block]=\"true\"\n\t\t\t\t\t\t\t\t(clicked)=\"clearSelection()\"\n\t\t\t\t\t\t\t\t(keydown)=\"handleClearButtonKeydown($event)\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{{ clearAllLabel() }}\n\t\t\t\t\t\t\t</st-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</ng-template>\n\n\t@if (label) {\n\t\t<label class=\"sr-only\" [for]=\"resolvedId()\">{{ label }}</label>\n\t}\n\n\t<!-- Additional content -->\n\t<ng-content></ng-content>\n</fieldset>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: PortalModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkListbox, selector: "[cdkListbox]", inputs: ["id", "tabindex", "cdkListboxValue", "cdkListboxMultiple", "cdkListboxDisabled", "cdkListboxUseActiveDescendant", "cdkListboxOrientation", "cdkListboxCompareWith", "cdkListboxNavigationWrapDisabled", "cdkListboxNavigatesDisabledOptions"], outputs: ["cdkListboxValueChange"], exportAs: ["cdkListbox"] }, { kind: "directive", type: CdkOption, selector: "[cdkOption]", inputs: ["id", "cdkOption", "cdkOptionTypeaheadLabel", "cdkOptionDisabled", "tabindex"], exportAs: ["cdkOption"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }, { kind: "component", type: BadgeComponent, selector: "st-badge", inputs: ["variant", "size", "outline", "soft", "dash", "ghost", "icon", "iconPosition"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation", "ariaLabel", "ariaExpanded", "ariaPressed"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1280
|
+
], viewQueries: [{ propertyName: "fieldRef", first: true, predicate: ["field"], descendants: true, isSignal: true }, { propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "searchInputRef", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "optionsList", first: true, predicate: ["optionsList"], descendants: true, isSignal: true }, { propertyName: "listbox", first: true, predicate: ["listbox"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<!-- Field chrome click is pointer-only sugar; keyboard access is the focusable trigger button inside. -->\n@let isOpen = this.isOpen(); @let triggerWidth = this.triggerWidth(); @let dataState = this.dataState();\n@let filteredOptions = this.filteredOptions(); @let displayValue = this.displayValue(); @let multipleDisplayInfo = this.multipleDisplayInfo();\n@let label = this.label();\n\n<fieldset class=\"fieldset p-0\">\n\t@if (label) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t\t<span\n\t\t\t\t>{{ label }}\n\t\t\t\t@if (fieldA11y.required()) {\n\t\t\t\t\t<span aria-hidden=\"true\" data-st-required-marker class=\"text-error-strong ms-0.5\">*</span>\n\t\t\t\t}\n\t\t\t</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\n\t<div\n\t\t#field\n\t\tcdkOverlayOrigin\n\t\t#overlayOrigin=\"cdkOverlayOrigin\"\n\t\t[class]=\"validationClass()\"\n\t\t[attr.data-open]=\"isOpen ? '' : null\"\n\t\t(click)=\"handleFieldChromeClick($event)\"\n\t>\n\t\t<button\n\t\t\t#trigger\n\t\t\t[id]=\"resolvedId()\"\n\t\t\t[attr.aria-required]=\"fieldA11y.required() || null\"\n\t\t\t[attr.aria-describedby]=\"fieldA11y.describedBy()\"\n\t\t\tclass=\"min-w-0 flex-1 grow cursor-pointer bg-transparent p-0 text-left outline-hidden\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(keydown)=\"handleTriggerKeydown($event)\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"true\"\n\t\t\trole=\"combobox\"\n\t\t\t[attr.aria-controls]=\"'combobox-list'\"\n\t\t\t[attr.aria-expanded]=\"isOpen\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t>\n\t\t\t<span class=\"block min-w-0 truncate text-left\">\n\t\t\t\t@if (selectionType() === 'multiple' && multipleDisplayInfo) {\n\t\t\t\t\t<span class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t<span class=\"truncate\">{{ multipleDisplayInfo.firstItem }}</span>\n\t\t\t\t\t\t@if (multipleDisplayInfo.additionalCount > 0) {\n\t\t\t\t\t\t\t<st-badge variant=\"primary\" [soft]=\"true\" [size]=\"badgeClass()\">+{{ multipleDisplayInfo.additionalCount }}</st-badge>\n\t\t\t\t\t\t}\n\t\t\t\t\t</span>\n\t\t\t\t} @else {\n\t\t\t\t\t{{ displayValue }}\n\t\t\t\t}\n\t\t\t</span>\n\t\t</button>\n\t\t@if (showClearButton()) {\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdata-st-clear\n\t\t\t\tclass=\"btn btn-ghost btn-square shrink-0 cursor-pointer [--fontsize:1em] [--size:1.25em]\"\n\t\t\t\t(click)=\"handleClearSelection($event)\"\n\t\t\t\t(keydown.enter)=\"handleClearSelection($event)\"\n\t\t\t\t(keydown.space)=\"handleClearSelection($event)\"\n\t\t\t\t[attr.aria-label]=\"clearSelectionLabel()\"\n\t\t\t>\n\t\t\t\t<st-icon [icon]=\"iconClose\"></st-icon>\n\t\t\t</button>\n\t\t}\n\t\t<span data-st-chevron class=\"pointer-events-none inline-flex size-[1em] shrink-0 items-center justify-center\" aria-hidden=\"true\">\n\t\t\t<st-icon [icon]=\"iconChevronDown\"></st-icon>\n\t\t</span>\n\t</div>\n\n\t<ng-template\n\t\tcdkConnectedOverlay\n\t\t[cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n\t\t[cdkConnectedOverlayOpen]=\"isOpen\"\n\t\t[cdkConnectedOverlayPositions]=\"overlayPositions\"\n\t\t[cdkConnectedOverlayDisableClose]=\"true\"\n\t\t[cdkConnectedOverlayWidth]=\"triggerWidth\"\n\t\t[cdkConnectedOverlayMinWidth]=\"triggerWidth\"\n\t\t(detach)=\"handleDetach()\"\n\t\t(overlayOutsideClick)=\"handleClickOutside($event)\"\n\t\t(positionChange)=\"onPositionChange($event)\"\n\t>\n\t\t<div class=\"contents\" [attr.data-theme]=\"themeDomService.themeOf(field)\">\n\t\t\t<div\n\t\t\t\t[class]=\"'rounded-box shadow-main w-full ' + animationClasses()\"\n\t\t\t\t(animationend)=\"onAnimationEnd($event)\"\n\t\t\t\t[attr.data-state]=\"dataState\"\n\t\t\t\t[attr.data-side]=\"placement()?.side\"\n\t\t\t\t[attr.data-align]=\"placement()?.align\"\n\t\t\t>\n\t\t\t\t<div class=\"bg-base-200 rounded-box border-neutral overflow-hidden border border-solid\">\n\t\t\t\t\t<!-- Search Input -->\n\t\t\t\t\t<div class=\"border-neutral border-b\">\n\t\t\t\t\t\t@let searchInputClass = this.searchInputClass();\n\t\t\t\t\t\t<div [class]=\"searchInputClass\">\n\t\t\t\t\t\t\t<st-icon class=\"text-base-placeholder\" [icon]=\"iconSearch\"></st-icon>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t#searchInput\n\t\t\t\t\t\t\t\tclass=\"placeholder:text-base-placeholder w-full border-transparent py-0 focus-within:outline-hidden focus:border-transparent focus:outline-hidden\"\n\t\t\t\t\t\t\t\t[value]=\"currentSearchValue\"\n\t\t\t\t\t\t\t\t(input)=\"handleSearchInput($event)\"\n\t\t\t\t\t\t\t\t(keydown)=\"handleSearchKeydown($event)\"\n\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t[placeholder]=\"translatedSearchPlaceholder()\"\n\t\t\t\t\t\t\t\t[attr.aria-label]=\"searchOptionsLabel()\"\n\t\t\t\t\t\t\t\t[disabled]=\"!isOpen\"\n\t\t\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Options List -->\n\t\t\t\t\t@let menuClass = this.menuClass();\n\t\t\t\t\t<ul\n\t\t\t\t\t\t[class]=\"menuClass\"\n\t\t\t\t\t\tcdkListbox\n\t\t\t\t\t\tcdkListboxUseActiveDescendant\n\t\t\t\t\t\t[cdkListboxMultiple]=\"selectionType() === 'multiple'\"\n\t\t\t\t\t\taria-labelledby=\"Combobox options\"\n\t\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\t\t#optionsList\n\t\t\t\t\t\t[tabindex]=\"-1\"\n\t\t\t\t\t\t(keydown)=\"handleListboxKeydown($event)\"\n\t\t\t\t\t\t(selectionChange)=\"handleSelectionChange($event)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t@for (option of filteredOptions; track $index) {\n\t\t\t\t\t\t\t<li [cdkOption]=\"option\" class=\"group\" [attr.data-option-index]=\"$index\" [class.cdk-option-active]=\"isActiveOption($index)\">\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tclass=\"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\"\n\t\t\t\t\t\t\t\t\t(click)=\"handleOptionSelect(option)\"\n\t\t\t\t\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<span class=\"min-w-0 flex-1 wrap-break-word whitespace-normal\">{{ getDisplayValue(option) }}</span>\n\n\t\t\t\t\t\t\t\t\t@if (isOptionSelected(option)) {\n\t\t\t\t\t\t\t\t\t\t<st-icon class=\"h-4 w-4 shrink-0\" [icon]=\"iconCheck\"></st-icon>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t<!-- Empty state -->\n\t\t\t\t\t\t@if (filteredOptions.length === 0) {\n\t\t\t\t\t\t\t<li class=\"text-base-content/60 px-4 py-2 text-center\">\n\t\t\t\t\t\t\t\t<span>{{ translatedNoResultsText() }}</span>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\t\t\t\t\t</ul>\n\n\t\t\t\t\t<!-- Clear All button for multiple selection -->\n\t\t\t\t\t@if (selectionType() === 'multiple' && allowClearAll() && value() && isArray(value()) && value().length > 0) {\n\t\t\t\t\t\t<div class=\"border-base-300 border-t p-2\">\n\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t[ghost]=\"true\"\n\t\t\t\t\t\t\t\t[block]=\"true\"\n\t\t\t\t\t\t\t\t(clicked)=\"clearSelection()\"\n\t\t\t\t\t\t\t\t(keydown)=\"handleClearButtonKeydown($event)\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{{ clearAllLabel() }}\n\t\t\t\t\t\t\t</st-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</ng-template>\n\n\t@if (label) {\n\t\t<label class=\"sr-only\" [for]=\"resolvedId()\">{{ label }}</label>\n\t}\n\n\t<!-- Additional content -->\n\t<ng-content></ng-content>\n</fieldset>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: PortalModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkListbox, selector: "[cdkListbox]", inputs: ["id", "tabindex", "cdkListboxValue", "cdkListboxMultiple", "cdkListboxDisabled", "cdkListboxUseActiveDescendant", "cdkListboxOrientation", "cdkListboxCompareWith", "cdkListboxNavigationWrapDisabled", "cdkListboxNavigatesDisabledOptions"], outputs: ["cdkListboxValueChange"], exportAs: ["cdkListbox"] }, { kind: "directive", type: CdkOption, selector: "[cdkOption]", inputs: ["id", "cdkOption", "cdkOptionTypeaheadLabel", "cdkOptionDisabled", "tabindex"], exportAs: ["cdkOption"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }, { kind: "component", type: BadgeComponent, selector: "st-badge", inputs: ["variant", "size", "outline", "soft", "dash", "ghost", "icon", "iconPosition"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaDescribedBy", "ariaControls"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1249
1281
|
}
|
|
1250
1282
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ComboboxComponent, decorators: [{
|
|
1251
1283
|
type: Component,
|
|
@@ -1266,7 +1298,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
1266
1298
|
useExisting: ComboboxComponent,
|
|
1267
1299
|
multi: true,
|
|
1268
1300
|
},
|
|
1269
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<!-- Field chrome click is pointer-only sugar; keyboard access is the focusable trigger button inside. -->\n@let isOpen = this.isOpen(); @let triggerWidth = this.triggerWidth(); @let dataState = this.dataState();\n@let filteredOptions = this.filteredOptions(); @let displayValue = this.displayValue(); @let multipleDisplayInfo = this.multipleDisplayInfo();\n@let label = this.label();\n\n<fieldset class=\"fieldset p-0\">\n\t@if (label) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t\t<span>{{ label }}</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\n\t<div\n\t\t#field\n\t\tcdkOverlayOrigin\n\t\t#overlayOrigin=\"cdkOverlayOrigin\"\n\t\t[class]=\"validationClass()\"\n\t\t[attr.data-open]=\"isOpen ? '' : null\"\n\t\t(click)=\"handleFieldChromeClick($event)\"\n\t>\n\t\t<button\n\t\t\t#trigger\n\t\t\t[id]=\"resolvedId()\"\n\t\t\tclass=\"min-w-0 flex-1 grow cursor-pointer bg-transparent p-0 text-left outline-hidden\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(keydown)=\"handleTriggerKeydown($event)\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"true\"\n\t\t\trole=\"combobox\"\n\t\t\t[attr.aria-controls]=\"'combobox-list'\"\n\t\t\t[attr.aria-expanded]=\"isOpen\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t>\n\t\t\t<span class=\"block min-w-0 truncate text-left\">\n\t\t\t\t@if (selectionType() === 'multiple' && multipleDisplayInfo) {\n\t\t\t\t\t<span class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t<span class=\"truncate\">{{ multipleDisplayInfo.firstItem }}</span>\n\t\t\t\t\t\t@if (multipleDisplayInfo.additionalCount > 0) {\n\t\t\t\t\t\t\t<st-badge variant=\"primary\" [soft]=\"true\" [size]=\"badgeClass()\">+{{ multipleDisplayInfo.additionalCount }}</st-badge>\n\t\t\t\t\t\t}\n\t\t\t\t\t</span>\n\t\t\t\t} @else {\n\t\t\t\t\t{{ displayValue }}\n\t\t\t\t}\n\t\t\t</span>\n\t\t</button>\n\t\t@if (showClearButton()) {\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdata-st-clear\n\t\t\t\tclass=\"btn btn-ghost btn-square shrink-0 cursor-pointer [--fontsize:1em] [--size:1.25em]\"\n\t\t\t\t(click)=\"handleClearSelection($event)\"\n\t\t\t\t(keydown.enter)=\"handleClearSelection($event)\"\n\t\t\t\t(keydown.space)=\"handleClearSelection($event)\"\n\t\t\t\t[attr.aria-label]=\"clearSelectionLabel()\"\n\t\t\t>\n\t\t\t\t<st-icon [icon]=\"iconClose\"></st-icon>\n\t\t\t</button>\n\t\t}\n\t\t<span data-st-chevron class=\"pointer-events-none inline-flex size-[1em] shrink-0 items-center justify-center\" aria-hidden=\"true\">\n\t\t\t<st-icon [icon]=\"iconChevronDown\"></st-icon>\n\t\t</span>\n\t</div>\n\n\t<ng-template\n\t\tcdkConnectedOverlay\n\t\t[cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n\t\t[cdkConnectedOverlayOpen]=\"isOpen\"\n\t\t[cdkConnectedOverlayPositions]=\"overlayPositions\"\n\t\t[cdkConnectedOverlayWidth]=\"triggerWidth\"\n\t\t[cdkConnectedOverlayMinWidth]=\"triggerWidth\"\n\t\t(detach)=\"handleDetach()\"\n\t\t(overlayOutsideClick)=\"handleClickOutside($event)\"\n\t\t(positionChange)=\"onPositionChange($event)\"\n\t>\n\t\t<div class=\"contents\" [attr.data-theme]=\"themeDomService.themeOf(field)\">\n\t\t\t<div
|
|
1301
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<!-- Field chrome click is pointer-only sugar; keyboard access is the focusable trigger button inside. -->\n@let isOpen = this.isOpen(); @let triggerWidth = this.triggerWidth(); @let dataState = this.dataState();\n@let filteredOptions = this.filteredOptions(); @let displayValue = this.displayValue(); @let multipleDisplayInfo = this.multipleDisplayInfo();\n@let label = this.label();\n\n<fieldset class=\"fieldset p-0\">\n\t@if (label) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t\t<span\n\t\t\t\t>{{ label }}\n\t\t\t\t@if (fieldA11y.required()) {\n\t\t\t\t\t<span aria-hidden=\"true\" data-st-required-marker class=\"text-error-strong ms-0.5\">*</span>\n\t\t\t\t}\n\t\t\t</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\n\t<div\n\t\t#field\n\t\tcdkOverlayOrigin\n\t\t#overlayOrigin=\"cdkOverlayOrigin\"\n\t\t[class]=\"validationClass()\"\n\t\t[attr.data-open]=\"isOpen ? '' : null\"\n\t\t(click)=\"handleFieldChromeClick($event)\"\n\t>\n\t\t<button\n\t\t\t#trigger\n\t\t\t[id]=\"resolvedId()\"\n\t\t\t[attr.aria-required]=\"fieldA11y.required() || null\"\n\t\t\t[attr.aria-describedby]=\"fieldA11y.describedBy()\"\n\t\t\tclass=\"min-w-0 flex-1 grow cursor-pointer bg-transparent p-0 text-left outline-hidden\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(keydown)=\"handleTriggerKeydown($event)\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"true\"\n\t\t\trole=\"combobox\"\n\t\t\t[attr.aria-controls]=\"'combobox-list'\"\n\t\t\t[attr.aria-expanded]=\"isOpen\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t>\n\t\t\t<span class=\"block min-w-0 truncate text-left\">\n\t\t\t\t@if (selectionType() === 'multiple' && multipleDisplayInfo) {\n\t\t\t\t\t<span class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t<span class=\"truncate\">{{ multipleDisplayInfo.firstItem }}</span>\n\t\t\t\t\t\t@if (multipleDisplayInfo.additionalCount > 0) {\n\t\t\t\t\t\t\t<st-badge variant=\"primary\" [soft]=\"true\" [size]=\"badgeClass()\">+{{ multipleDisplayInfo.additionalCount }}</st-badge>\n\t\t\t\t\t\t}\n\t\t\t\t\t</span>\n\t\t\t\t} @else {\n\t\t\t\t\t{{ displayValue }}\n\t\t\t\t}\n\t\t\t</span>\n\t\t</button>\n\t\t@if (showClearButton()) {\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdata-st-clear\n\t\t\t\tclass=\"btn btn-ghost btn-square shrink-0 cursor-pointer [--fontsize:1em] [--size:1.25em]\"\n\t\t\t\t(click)=\"handleClearSelection($event)\"\n\t\t\t\t(keydown.enter)=\"handleClearSelection($event)\"\n\t\t\t\t(keydown.space)=\"handleClearSelection($event)\"\n\t\t\t\t[attr.aria-label]=\"clearSelectionLabel()\"\n\t\t\t>\n\t\t\t\t<st-icon [icon]=\"iconClose\"></st-icon>\n\t\t\t</button>\n\t\t}\n\t\t<span data-st-chevron class=\"pointer-events-none inline-flex size-[1em] shrink-0 items-center justify-center\" aria-hidden=\"true\">\n\t\t\t<st-icon [icon]=\"iconChevronDown\"></st-icon>\n\t\t</span>\n\t</div>\n\n\t<ng-template\n\t\tcdkConnectedOverlay\n\t\t[cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n\t\t[cdkConnectedOverlayOpen]=\"isOpen\"\n\t\t[cdkConnectedOverlayPositions]=\"overlayPositions\"\n\t\t[cdkConnectedOverlayDisableClose]=\"true\"\n\t\t[cdkConnectedOverlayWidth]=\"triggerWidth\"\n\t\t[cdkConnectedOverlayMinWidth]=\"triggerWidth\"\n\t\t(detach)=\"handleDetach()\"\n\t\t(overlayOutsideClick)=\"handleClickOutside($event)\"\n\t\t(positionChange)=\"onPositionChange($event)\"\n\t>\n\t\t<div class=\"contents\" [attr.data-theme]=\"themeDomService.themeOf(field)\">\n\t\t\t<div\n\t\t\t\t[class]=\"'rounded-box shadow-main w-full ' + animationClasses()\"\n\t\t\t\t(animationend)=\"onAnimationEnd($event)\"\n\t\t\t\t[attr.data-state]=\"dataState\"\n\t\t\t\t[attr.data-side]=\"placement()?.side\"\n\t\t\t\t[attr.data-align]=\"placement()?.align\"\n\t\t\t>\n\t\t\t\t<div class=\"bg-base-200 rounded-box border-neutral overflow-hidden border border-solid\">\n\t\t\t\t\t<!-- Search Input -->\n\t\t\t\t\t<div class=\"border-neutral border-b\">\n\t\t\t\t\t\t@let searchInputClass = this.searchInputClass();\n\t\t\t\t\t\t<div [class]=\"searchInputClass\">\n\t\t\t\t\t\t\t<st-icon class=\"text-base-placeholder\" [icon]=\"iconSearch\"></st-icon>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t#searchInput\n\t\t\t\t\t\t\t\tclass=\"placeholder:text-base-placeholder w-full border-transparent py-0 focus-within:outline-hidden focus:border-transparent focus:outline-hidden\"\n\t\t\t\t\t\t\t\t[value]=\"currentSearchValue\"\n\t\t\t\t\t\t\t\t(input)=\"handleSearchInput($event)\"\n\t\t\t\t\t\t\t\t(keydown)=\"handleSearchKeydown($event)\"\n\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t[placeholder]=\"translatedSearchPlaceholder()\"\n\t\t\t\t\t\t\t\t[attr.aria-label]=\"searchOptionsLabel()\"\n\t\t\t\t\t\t\t\t[disabled]=\"!isOpen\"\n\t\t\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Options List -->\n\t\t\t\t\t@let menuClass = this.menuClass();\n\t\t\t\t\t<ul\n\t\t\t\t\t\t[class]=\"menuClass\"\n\t\t\t\t\t\tcdkListbox\n\t\t\t\t\t\tcdkListboxUseActiveDescendant\n\t\t\t\t\t\t[cdkListboxMultiple]=\"selectionType() === 'multiple'\"\n\t\t\t\t\t\taria-labelledby=\"Combobox options\"\n\t\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\t\t#optionsList\n\t\t\t\t\t\t[tabindex]=\"-1\"\n\t\t\t\t\t\t(keydown)=\"handleListboxKeydown($event)\"\n\t\t\t\t\t\t(selectionChange)=\"handleSelectionChange($event)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t@for (option of filteredOptions; track $index) {\n\t\t\t\t\t\t\t<li [cdkOption]=\"option\" class=\"group\" [attr.data-option-index]=\"$index\" [class.cdk-option-active]=\"isActiveOption($index)\">\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tclass=\"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\"\n\t\t\t\t\t\t\t\t\t(click)=\"handleOptionSelect(option)\"\n\t\t\t\t\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<span class=\"min-w-0 flex-1 wrap-break-word whitespace-normal\">{{ getDisplayValue(option) }}</span>\n\n\t\t\t\t\t\t\t\t\t@if (isOptionSelected(option)) {\n\t\t\t\t\t\t\t\t\t\t<st-icon class=\"h-4 w-4 shrink-0\" [icon]=\"iconCheck\"></st-icon>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t<!-- Empty state -->\n\t\t\t\t\t\t@if (filteredOptions.length === 0) {\n\t\t\t\t\t\t\t<li class=\"text-base-content/60 px-4 py-2 text-center\">\n\t\t\t\t\t\t\t\t<span>{{ translatedNoResultsText() }}</span>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\t\t\t\t\t</ul>\n\n\t\t\t\t\t<!-- Clear All button for multiple selection -->\n\t\t\t\t\t@if (selectionType() === 'multiple' && allowClearAll() && value() && isArray(value()) && value().length > 0) {\n\t\t\t\t\t\t<div class=\"border-base-300 border-t p-2\">\n\t\t\t\t\t\t\t<st-button\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t[ghost]=\"true\"\n\t\t\t\t\t\t\t\t[block]=\"true\"\n\t\t\t\t\t\t\t\t(clicked)=\"clearSelection()\"\n\t\t\t\t\t\t\t\t(keydown)=\"handleClearButtonKeydown($event)\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{{ clearAllLabel() }}\n\t\t\t\t\t\t\t</st-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</ng-template>\n\n\t@if (label) {\n\t\t<label class=\"sr-only\" [for]=\"resolvedId()\">{{ label }}</label>\n\t}\n\n\t<!-- Additional content -->\n\t<ng-content></ng-content>\n</fieldset>\n" }]
|
|
1270
1302
|
}], ctorParameters: () => [] });
|
|
1271
1303
|
|
|
1272
1304
|
/**
|