@ids-group-ltd/ids-design-system 0.11.4 → 0.12.1
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 +373 -53
- package/components/README.md +86 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +85 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +70 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +573 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs +86 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +615 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs +30 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs +188 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +59 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +92 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +204 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +100 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs +23 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +180 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs +78 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs +49 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +73 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +397 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +1231 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +51 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs +35 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +109 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +111 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +52 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +92 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs +62 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +164 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs +85 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +223 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs +63 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +53 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs +43 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +293 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +329 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +612 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +69 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +191 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs +23 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +43 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +85 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs +95 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs +240 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs +41 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +248 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-reserve-messages.mjs +62 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-reserve-messages.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +173 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +123 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +461 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +107 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +185 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +32 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +204 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs +25 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +63 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +99 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs +26 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +74 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +76 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +440 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +186 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-resize.mjs +227 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-resize.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +1593 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +381 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +44 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +158 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +671 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +41 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +549 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs +34 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +218 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs +18 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +153 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs +48 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +1338 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +333 -0
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +65 -0
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs +56 -0
- package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-theme.mjs +37 -0
- package/fesm2022/ids-group-ltd-ids-design-system-theme.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +75 -14267
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.10.0.json +1 -1
- package/migrations/0.10.1.json +1 -1
- package/migrations/0.10.2.json +1 -30
- package/migrations/0.11.0.json +0 -2
- package/migrations/0.11.1.json +2 -24
- package/migrations/0.11.2.json +2 -1
- package/migrations/0.11.3.json +3 -2
- package/migrations/0.11.4.json +32 -6
- package/migrations/0.12.0.json +22 -0
- package/migrations/0.12.1.json +215 -0
- package/migrations/0.4.0.json +2 -1
- package/migrations/0.5.0.json +0 -54
- package/migrations/0.5.1.json +3 -1
- package/migrations/0.7.0.json +0 -11
- package/migrations/0.7.1.json +2 -1
- package/migrations/0.9.0.json +22 -3
- package/migrations/0.9.1.json +1 -1
- package/package.json +597 -1
- package/styles/_check-box.scss +84 -0
- package/styles/_check-mark.scss +59 -0
- package/styles/_dropdown-overlay.scss +12 -2
- package/styles/_field-group-segment.scss +4 -1
- package/styles/_focus.scss +103 -50
- package/styles/_link.scss +4 -2
- package/styles/_tokens.scss +20 -0
- package/styles/_typography.scss +6 -0
- package/themes/README.md +4 -4
- package/themes/_semantic.scss +7 -8
- package/types/ids-group-ltd-ids-design-system-components-accordion.d.ts +48 -0
- package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +32 -0
- package/types/ids-group-ltd-ids-design-system-components-app-layout.d.ts +260 -0
- package/types/ids-group-ltd-ids-design-system-components-auth-layout.d.ts +75 -0
- package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +226 -0
- package/types/ids-group-ltd-ids-design-system-components-avatar-group.d.ts +13 -0
- package/types/ids-group-ltd-ids-design-system-components-avatar.d.ts +99 -0
- package/types/ids-group-ltd-ids-design-system-components-badge.d.ts +25 -0
- package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +41 -0
- package/types/ids-group-ltd-ids-design-system-components-bottom-sheet.d.ts +61 -0
- package/types/ids-group-ltd-ids-design-system-components-breadcrumbs.d.ts +66 -0
- package/types/ids-group-ltd-ids-design-system-components-button-group.d.ts +10 -0
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +90 -0
- package/types/ids-group-ltd-ids-design-system-components-calendar-day.d.ts +41 -0
- package/types/ids-group-ltd-ids-design-system-components-card.d.ts +24 -0
- package/types/ids-group-ltd-ids-design-system-components-checkbox.d.ts +41 -0
- package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +79 -0
- package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +251 -0
- package/types/ids-group-ltd-ids-design-system-components-description-list.d.ts +25 -0
- package/types/ids-group-ltd-ids-design-system-components-divider.d.ts +22 -0
- package/types/ids-group-ltd-ids-design-system-components-drawer.d.ts +38 -0
- package/types/ids-group-ltd-ids-design-system-components-dropzone.d.ts +45 -0
- package/types/ids-group-ltd-ids-design-system-components-empty-state.d.ts +22 -0
- package/types/ids-group-ltd-ids-design-system-components-field-group.d.ts +73 -0
- package/types/ids-group-ltd-ids-design-system-components-field-message.d.ts +36 -0
- package/types/ids-group-ltd-ids-design-system-components-filter-bar.d.ts +83 -0
- package/types/ids-group-ltd-ids-design-system-components-icon-button.d.ts +56 -0
- package/types/ids-group-ltd-ids-design-system-components-input.d.ts +121 -0
- package/types/ids-group-ltd-ids-design-system-components-layout.d.ts +39 -0
- package/types/ids-group-ltd-ids-design-system-components-list.d.ts +29 -0
- package/types/ids-group-ltd-ids-design-system-components-loading-overlay.d.ts +31 -0
- package/types/ids-group-ltd-ids-design-system-components-menu.d.ts +85 -0
- package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +124 -0
- package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +213 -0
- package/types/ids-group-ltd-ids-design-system-components-number-stepper.d.ts +31 -0
- package/types/ids-group-ltd-ids-design-system-components-otp-input.d.ts +52 -0
- package/types/ids-group-ltd-ids-design-system-components-page-footer.d.ts +13 -0
- package/types/ids-group-ltd-ids-design-system-components-page-header.d.ts +21 -0
- package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +32 -0
- package/types/ids-group-ltd-ids-design-system-components-password-rules.d.ts +80 -0
- package/types/ids-group-ltd-ids-design-system-components-popover.d.ts +48 -0
- package/types/ids-group-ltd-ids-design-system-components-progress.d.ts +22 -0
- package/types/ids-group-ltd-ids-design-system-components-radio-group.d.ts +110 -0
- package/types/ids-group-ltd-ids-design-system-components-reserve-messages.d.ts +33 -0
- package/types/ids-group-ltd-ids-design-system-components-search.d.ts +82 -0
- package/types/ids-group-ltd-ids-design-system-components-segmented.d.ts +40 -0
- package/types/ids-group-ltd-ids-design-system-components-select.d.ts +152 -0
- package/types/ids-group-ltd-ids-design-system-components-sidenav-footer.d.ts +92 -0
- package/types/ids-group-ltd-ids-design-system-components-sidenav.d.ts +131 -0
- package/types/ids-group-ltd-ids-design-system-components-skeleton.d.ts +16 -0
- package/types/ids-group-ltd-ids-design-system-components-slider.d.ts +51 -0
- package/types/ids-group-ltd-ids-design-system-components-spinner.d.ts +11 -0
- package/types/ids-group-ltd-ids-design-system-components-split-button.d.ts +39 -0
- package/types/ids-group-ltd-ids-design-system-components-stat.d.ts +44 -0
- package/types/ids-group-ltd-ids-design-system-components-status-dot.d.ts +12 -0
- package/types/ids-group-ltd-ids-design-system-components-stepper.d.ts +32 -0
- package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +40 -0
- package/types/ids-group-ltd-ids-design-system-components-table-columns.d.ts +43 -0
- package/types/ids-group-ltd-ids-design-system-components-table-export.d.ts +48 -0
- package/types/ids-group-ltd-ids-design-system-components-table-resize.d.ts +79 -0
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +815 -0
- package/types/ids-group-ltd-ids-design-system-components-tabs.d.ts +118 -0
- package/types/ids-group-ltd-ids-design-system-components-tag.d.ts +26 -0
- package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +85 -0
- package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +188 -0
- package/types/ids-group-ltd-ids-design-system-components-timeline.d.ts +24 -0
- package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +167 -0
- package/types/ids-group-ltd-ids-design-system-components-toggle-button.d.ts +18 -0
- package/types/ids-group-ltd-ids-design-system-components-tooltip.d.ts +66 -0
- package/types/ids-group-ltd-ids-design-system-components-topbar.d.ts +8 -0
- package/types/ids-group-ltd-ids-design-system-components-tree.d.ts +46 -0
- package/types/ids-group-ltd-ids-design-system-components-w3w.d.ts +18 -0
- package/types/ids-group-ltd-ids-design-system-components.d.ts +604 -0
- package/types/ids-group-ltd-ids-design-system-core.d.ts +436 -0
- package/types/ids-group-ltd-ids-design-system-icons.d.ts +52 -0
- package/types/ids-group-ltd-ids-design-system-overlay.d.ts +32 -0
- package/types/ids-group-ltd-ids-design-system-theme.d.ts +29 -0
- package/types/ids-group-ltd-ids-design-system.d.ts +75 -5594
- package/LICENSE +0 -21
- package/README.md +0 -73
|
@@ -0,0 +1,612 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { inject, ViewContainerRef, ElementRef, model, input, booleanAttribute, output, numberAttribute, contentChild, TemplateRef, viewChild, signal, computed, forwardRef, ViewEncapsulation, Component } from '@angular/core';
|
|
4
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
6
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
7
|
+
import { DsControlValueAccessor, trimmedText, DsOptionTemplateDirective, DsChipTemplateDirective, DsPickerTriggerDirective, DsPanelHeaderTemplateDirective, DsPanelFooterTemplateDirective, DsGroupLabelTemplateDirective, DsEmptyTemplateDirective, nextControlId, chipFit, resolveFieldMessage, scrollActiveOptionIntoView, announceOptionCount, createTypeAhead, dropdownOverlay, prepareOverlayEnter, forwardOverlayTokens, closeOnOutsidePointer, closeOnScroll, focusIsInside, disposeWithLeave } from '@ids-group-ltd/ids-design-system/components';
|
|
8
|
+
import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
|
|
9
|
+
import { SpinnerComponent } from '@ids-group-ltd/ids-design-system/components/spinner';
|
|
10
|
+
import { TagComponent } from '@ids-group-ltd/ids-design-system/components/tag';
|
|
11
|
+
import { FieldMessageComponent } from '@ids-group-ltd/ids-design-system/components/field-message';
|
|
12
|
+
import { resolveWithConfig, flattenDsOptions, isDsOptionGroup, firstEnabledIndex, lastEnabledIndex, nextEnabledIndex } from '@ids-group-ltd/ids-design-system/core';
|
|
13
|
+
import { BadgeComponent } from '@ids-group-ltd/ids-design-system/components/badge';
|
|
14
|
+
|
|
15
|
+
class MultiSelectComponent extends DsControlValueAccessor {
|
|
16
|
+
overlay = inject(Overlay);
|
|
17
|
+
vcr = inject(ViewContainerRef);
|
|
18
|
+
host = inject((ElementRef));
|
|
19
|
+
/** Public panel tokens forwarded onto the portaled overlay pane on open so
|
|
20
|
+
* a consumer's `ds-multi-select { --ds-multi-select-panel-*: … }` reaches it. */
|
|
21
|
+
panelTokens = [
|
|
22
|
+
'--ds-multi-select-panel-bg-color',
|
|
23
|
+
'--ds-multi-select-option-bg-color-active',
|
|
24
|
+
'--ds-multi-select-check-bg-color',
|
|
25
|
+
'--ds-dropdown-panel-bg-color',
|
|
26
|
+
'--ds-dropdown-panel-minw',
|
|
27
|
+
'--ds-dropdown-panel-maxw',
|
|
28
|
+
'--ds-option-selected-bg-color',
|
|
29
|
+
'--ds-option-selected-label-color',
|
|
30
|
+
'--ds-option-selected-bg-color-hover',
|
|
31
|
+
'--ds-option-check-color',
|
|
32
|
+
];
|
|
33
|
+
/** Selected values, two-way bound. */
|
|
34
|
+
value = model([], ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
35
|
+
/** Options, groups, or both mixed — rendered in the order given. */
|
|
36
|
+
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
37
|
+
/** Placeholder shown in the trigger when nothing is selected. */
|
|
38
|
+
placeholder = input('Select…', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
39
|
+
/** Placeholder for the in-panel filter input. */
|
|
40
|
+
searchPlaceholder = input('Filter…', ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []));
|
|
41
|
+
/** Whether the panel carries a filter row. `true` always, `false` never, and a
|
|
42
|
+
* NUMBER is a threshold — the row appears once there are at least that many
|
|
43
|
+
* options. Unset falls back to `DS_CONFIG.picker.searchable`, then `true`.
|
|
44
|
+
*
|
|
45
|
+
* Hiding it moves the panel's keyboard model onto the trigger: the arrows,
|
|
46
|
+
* Enter, Escape and `aria-activedescendant` are the filter input's today. */
|
|
47
|
+
searchable = input(null, { ...(ngDevMode ? { debugName: "searchable" } : /* istanbul ignore next */ {}), transform: (raw) => {
|
|
48
|
+
if (raw === null || raw === undefined) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
// A bare attribute arrives as '' and has to beat the config default, which
|
|
52
|
+
// treating it as "unset" would not.
|
|
53
|
+
if (raw === '') {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
if (typeof raw === 'number') {
|
|
57
|
+
return raw;
|
|
58
|
+
}
|
|
59
|
+
if (typeof raw === 'boolean') {
|
|
60
|
+
return raw;
|
|
61
|
+
}
|
|
62
|
+
const asNumber = Number(raw);
|
|
63
|
+
return Number.isFinite(asNumber) ? asNumber : raw !== 'false';
|
|
64
|
+
} });
|
|
65
|
+
searchableResolved = resolveWithConfig(this.searchable, (config) => config.picker?.searchable, true);
|
|
66
|
+
/** Native `name` attribute forwarded to the trigger. */
|
|
67
|
+
name = input(null, ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
68
|
+
/** Prevents opening the panel while still allowing focus. */
|
|
69
|
+
readOnly = input(false, { ...(ngDevMode ? { debugName: "readOnly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
70
|
+
/**
|
|
71
|
+
* The contract spelling of `readOnly`, a second input because signal forms binds
|
|
72
|
+
* by NAME — a `readonly()` rule was reaching nothing before this existed.
|
|
73
|
+
*/
|
|
74
|
+
readonlyBinding = input(false, { ...(ngDevMode ? { debugName: "readonlyBinding" } : /* istanbul ignore next */ {}),
|
|
75
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
76
|
+
alias: 'readonly',
|
|
77
|
+
transform: booleanAttribute });
|
|
78
|
+
/** Shows a clear affordance once there is something to clear. */
|
|
79
|
+
clearable = input(false, { ...(ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
80
|
+
/** How the typed query narrows the list.
|
|
81
|
+
*
|
|
82
|
+
* The default matches a case-insensitive substring of `label`. Pass a predicate
|
|
83
|
+
* to match on anything else — a second field, ignoring diacritics, a fuzzy score.
|
|
84
|
+
* Pass `'none'` when the list arrives already filtered, which is what a
|
|
85
|
+
* server-side search needs: the query is reported through `filterChange` and
|
|
86
|
+
* every option given is rendered.
|
|
87
|
+
*/
|
|
88
|
+
filterWith = input((option, query) => option.label.toLowerCase().includes(query), ...(ngDevMode ? [{ debugName: "filterWith" }] : /* istanbul ignore next */ []));
|
|
89
|
+
/** The query the user typed, on every change. The input for a server-side search;
|
|
90
|
+
* pair it with `filterWith="none"` so the list is not narrowed twice. */
|
|
91
|
+
filterChange = output();
|
|
92
|
+
/** Options are still being fetched. The panel shows a spinner instead of the
|
|
93
|
+
* empty row — which would otherwise claim there are no matches — and the list
|
|
94
|
+
* reports `aria-busy`. */
|
|
95
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
96
|
+
/** The panel opened. The moment to fetch options for a picker whose list is
|
|
97
|
+
* loaded on demand. */
|
|
98
|
+
opened = output();
|
|
99
|
+
/** The panel closed, for any reason — a pick, Escape, an outside click, a scroll. */
|
|
100
|
+
closed = output();
|
|
101
|
+
/** Scrolls the keyboard cursor's row into view. On by default: a list longer
|
|
102
|
+
* than the panel otherwise walks the cursor out of sight. Set `false` only if
|
|
103
|
+
* you are driving the scroll position yourself. */
|
|
104
|
+
scrollActiveIntoView = input(true, { ...(ngDevMode ? { debugName: "scrollActiveIntoView" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
105
|
+
/** How the chips collapse when they outgrow one line. `"fit"` (the default)
|
|
106
|
+
* measures and shows as many as the trigger is wide, the rest behind "+N more".
|
|
107
|
+
* A NUMBER is a CEILING, not a promise: the row still measures, so you get at
|
|
108
|
+
* most that many and fewer when the trigger is narrow. `"all"` shows every chip and
|
|
109
|
+
* lets the trigger grow a line per selection.
|
|
110
|
+
*
|
|
111
|
+
* Unset (`null`) means "not deciding", as it does on every other input in the
|
|
112
|
+
* library — it resolves to `"fit"`. It does NOT mean "show all": that is
|
|
113
|
+
* `"all"`, which is the loudest of the three modes and has to be asked for. */
|
|
114
|
+
maxVisibleChips = input(null, { ...(ngDevMode ? { debugName: "maxVisibleChips" } : /* istanbul ignore next */ {}), transform: (raw) => {
|
|
115
|
+
if (raw === 'fit' || raw === 'all') {
|
|
116
|
+
return raw;
|
|
117
|
+
}
|
|
118
|
+
return raw == null ? null : numberAttribute(raw);
|
|
119
|
+
} });
|
|
120
|
+
/** Disables the trigger and blocks all interaction. */
|
|
121
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
122
|
+
/** Confirmation text, shown when there is no error or warning — and it paints
|
|
123
|
+
* the field's success border. A string like `warning`: the text IS the state. */
|
|
124
|
+
success = input('', { ...(ngDevMode ? { debugName: "success" } : /* istanbul ignore next */ {}), transform: trimmedText });
|
|
125
|
+
/** Accessible name for the trigger — falls back to `placeholder`. */
|
|
126
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
127
|
+
/** Trigger width — `fill` stretches to the container and pins the panel to the
|
|
128
|
+
* trigger's width; `content` hugs the trigger's own content and takes that width
|
|
129
|
+
* as the panel's FLOOR, so a compact trigger does not force an unreadable panel. */
|
|
130
|
+
width = input('fill', ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
131
|
+
/** Trigger height — sm/md/lg. Unset falls back to `DS_CONFIG.control.size`, then `'md'`. */
|
|
132
|
+
size = input(null, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
133
|
+
sizeResolved = resolveWithConfig(this.size, (config) => config.control?.size, 'md');
|
|
134
|
+
/** What the trigger shows. `count` is a caption plus a selected-count badge at
|
|
135
|
+
* intrinsic width; `labels` names the selection instead, cut to the width with the
|
|
136
|
+
* rest behind "+N". A projected `dsPickerTrigger` template WINS over this — the
|
|
137
|
+
* input is then not read at all. */
|
|
138
|
+
triggerDisplay = input('full', ...(ngDevMode ? [{ debugName: "triggerDisplay" }] : /* istanbul ignore next */ []));
|
|
139
|
+
/** Field label above the control — the same meaning it has on `ds-select`, and the
|
|
140
|
+
* caption a `count`/`labels` trigger uses when it needs one. */
|
|
141
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
142
|
+
/** Marks the field required: a `*` beside the label and `aria-required` on the trigger. */
|
|
143
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
144
|
+
/** Marks the field optional in words, for a form where most fields are required. */
|
|
145
|
+
optional = input(false, { ...(ngDevMode ? { debugName: "optional" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
146
|
+
/** Where a "select all" row appears. `false` nowhere, `true` one row over the whole
|
|
147
|
+
* panel, `'group'` one row per group, `'both'` for either. Group rows need groups
|
|
148
|
+
* in `options` — with a flat list they have nothing to head. */
|
|
149
|
+
selectAll = input(false, { ...(ngDevMode ? { debugName: "selectAll" } : /* istanbul ignore next */ {}), transform: (raw) => raw === 'group' || raw === 'both' ? raw : booleanAttribute(raw) });
|
|
150
|
+
optionTemplate = contentChild(DsOptionTemplateDirective, { ...(ngDevMode ? { debugName: "optionTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
151
|
+
chipTemplate = contentChild(DsChipTemplateDirective, { ...(ngDevMode ? { debugName: "chipTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
152
|
+
pickerTrigger = contentChild(DsPickerTriggerDirective, { ...(ngDevMode ? { debugName: "pickerTrigger" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
153
|
+
panelHeaderTemplate = contentChild(DsPanelHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "panelHeaderTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
154
|
+
panelFooterTemplate = contentChild(DsPanelFooterTemplateDirective, { ...(ngDevMode ? { debugName: "panelFooterTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
155
|
+
groupLabelTemplate = contentChild(DsGroupLabelTemplateDirective, { ...(ngDevMode ? { debugName: "groupLabelTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
156
|
+
emptyTemplate = contentChild(DsEmptyTemplateDirective, { ...(ngDevMode ? { debugName: "emptyTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
157
|
+
uid = nextControlId('ds-multi-select');
|
|
158
|
+
listboxId = `${this.uid}-listbox`;
|
|
159
|
+
labelId = `${this.uid}-label`;
|
|
160
|
+
optionId(index) {
|
|
161
|
+
return `${this.uid}-opt-${index}`;
|
|
162
|
+
}
|
|
163
|
+
trigger = viewChild.required('trigger');
|
|
164
|
+
searchInput = viewChild('search', ...(ngDevMode ? [{ debugName: "searchInput" }] : /* istanbul ignore next */ []));
|
|
165
|
+
panelTpl = viewChild.required('panel');
|
|
166
|
+
chipRow = viewChild('chipRow', ...(ngDevMode ? [{ debugName: "chipRow" }] : /* istanbul ignore next */ []));
|
|
167
|
+
open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
168
|
+
filter = signal('', ...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
|
|
169
|
+
activeIndex = signal(-1, ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
170
|
+
overlayRef = null;
|
|
171
|
+
focusTimer = null;
|
|
172
|
+
ngOnDestroy() {
|
|
173
|
+
// Host torn down while open → close() never runs. Dispose the overlay so
|
|
174
|
+
// its pane and event subscriptions don't leak.
|
|
175
|
+
clearTimeout(this.focusTimer ?? undefined);
|
|
176
|
+
this.overlayRef?.dispose();
|
|
177
|
+
this.overlayRef = null;
|
|
178
|
+
}
|
|
179
|
+
isDisabled = computed(() => this.disabled() || this.formDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
180
|
+
showsCompactTrigger = computed(() => !this.pickerTrigger() && this.triggerDisplay() !== 'full', ...(ngDevMode ? [{ debugName: "showsCompactTrigger" }] : /* istanbul ignore next */ []));
|
|
181
|
+
showsSearch = computed(() => {
|
|
182
|
+
const setting = this.searchableResolved();
|
|
183
|
+
return typeof setting === 'number'
|
|
184
|
+
? this.allOptions().length >= setting
|
|
185
|
+
: setting;
|
|
186
|
+
}, ...(ngDevMode ? [{ debugName: "showsSearch" }] : /* istanbul ignore next */ []));
|
|
187
|
+
triggerActiveDescendant = computed(() => this.showsSearch() ? null : this.activeDescendant(), ...(ngDevMode ? [{ debugName: "triggerActiveDescendant" }] : /* istanbul ignore next */ []));
|
|
188
|
+
triggerCaption = computed(() => this.label() || this.ariaLabel() || this.placeholder(), ...(ngDevMode ? [{ debugName: "triggerCaption" }] : /* istanbul ignore next */ []));
|
|
189
|
+
allOptions = computed(() => flattenDsOptions(this.options()), ...(ngDevMode ? [{ debugName: "allOptions" }] : /* istanbul ignore next */ []));
|
|
190
|
+
selectedOptions = computed(() => {
|
|
191
|
+
const selected = this.value();
|
|
192
|
+
return this.allOptions().filter((option) => selected.includes(option.value));
|
|
193
|
+
}, ...(ngDevMode ? [{ debugName: "selectedOptions" }] : /* istanbul ignore next */ []));
|
|
194
|
+
chipsMode = computed(() => this.maxVisibleChips() ?? 'fit', ...(ngDevMode ? [{ debugName: "chipsMode" }] : /* istanbul ignore next */ []));
|
|
195
|
+
showsEveryChip = computed(() => this.chipsMode() === 'all', ...(ngDevMode ? [{ debugName: "showsEveryChip" }] : /* istanbul ignore next */ []));
|
|
196
|
+
/** True for BOTH `'fit'` and a number: a number is a ceiling, not a promise, so
|
|
197
|
+
* the row still measures and shows only what the trigger is wide enough for. */
|
|
198
|
+
fitsChipsToWidth = computed(() => !this.showsEveryChip(), ...(ngDevMode ? [{ debugName: "fitsChipsToWidth" }] : /* istanbul ignore next */ []));
|
|
199
|
+
/** How many chips the row is ASKED to render before measuring: everything for
|
|
200
|
+
* `'fit'`, the ceiling for a number. It must be the ceiling and not the selection —
|
|
201
|
+
* the width cache only fills from a render that holds every chip. */
|
|
202
|
+
chipBudget = computed(() => {
|
|
203
|
+
const max = this.chipsMode();
|
|
204
|
+
const total = this.selectedOptions().length;
|
|
205
|
+
return typeof max === 'number' ? Math.min(Math.max(max, 0), total) : total;
|
|
206
|
+
}, ...(ngDevMode ? [{ debugName: "chipBudget" }] : /* istanbul ignore next */ []));
|
|
207
|
+
chipsThatFit = chipFit(this.chipBudget, this.chipRow, this.fitsChipsToWidth, computed(() => this.selectedOptions().length));
|
|
208
|
+
visibleChips = computed(() => {
|
|
209
|
+
const selected = this.selectedOptions();
|
|
210
|
+
return this.showsEveryChip()
|
|
211
|
+
? selected
|
|
212
|
+
: selected.slice(0, this.chipsThatFit());
|
|
213
|
+
}, ...(ngDevMode ? [{ debugName: "visibleChips" }] : /* istanbul ignore next */ []));
|
|
214
|
+
overflowCount = computed(() => this.selectedOptions().length - this.visibleChips().length, ...(ngDevMode ? [{ debugName: "overflowCount" }] : /* istanbul ignore next */ []));
|
|
215
|
+
filteredItems = computed(() => {
|
|
216
|
+
const query = this.filter().trim().toLowerCase();
|
|
217
|
+
const filter = this.filterWith();
|
|
218
|
+
const matches = (option) => !query || filter === 'none' || filter(option, query);
|
|
219
|
+
const kept = [];
|
|
220
|
+
for (const item of this.options()) {
|
|
221
|
+
if (!isDsOptionGroup(item)) {
|
|
222
|
+
if (matches(item)) {
|
|
223
|
+
kept.push(item);
|
|
224
|
+
}
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
// A disabled group disables its options HERE, not only in the flattened
|
|
228
|
+
// list: the template renders these objects, so a group left to inherit
|
|
229
|
+
// later would paint enabled rows that refuse to be picked.
|
|
230
|
+
const options = item.options
|
|
231
|
+
.filter(matches)
|
|
232
|
+
.map((option) => item.disabled ? { ...option, disabled: true } : option);
|
|
233
|
+
if (options.length > 0) {
|
|
234
|
+
kept.push({ ...item, options });
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return kept;
|
|
238
|
+
}, ...(ngDevMode ? [{ debugName: "filteredItems" }] : /* istanbul ignore next */ []));
|
|
239
|
+
filteredOptions = computed(() => flattenDsOptions(this.filteredItems()), ...(ngDevMode ? [{ debugName: "filteredOptions" }] : /* istanbul ignore next */ []));
|
|
240
|
+
isGroup(item) {
|
|
241
|
+
return isDsOptionGroup(item);
|
|
242
|
+
}
|
|
243
|
+
/** Where an option sits in the flat visible list — the id the listbox's
|
|
244
|
+
* `aria-activedescendant` points at, which a grouped render cannot get from
|
|
245
|
+
* the loop index. */
|
|
246
|
+
flatIndexOf(option) {
|
|
247
|
+
return this.filteredOptions().indexOf(option);
|
|
248
|
+
}
|
|
249
|
+
activeDescendant = computed(() => {
|
|
250
|
+
const index = this.activeIndex();
|
|
251
|
+
return this.open() && index >= 0 ? this.optionId(index) : null;
|
|
252
|
+
}, ...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
|
|
253
|
+
resolvedAriaLabel = computed(() => this.ariaLabel() || this.placeholder(), ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
|
|
254
|
+
hintId = computed(() => this.message().text ? `${this.uid}-hint` : null, ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
255
|
+
fieldMessage = resolveFieldMessage({
|
|
256
|
+
hint: this.hint,
|
|
257
|
+
warning: this.warning,
|
|
258
|
+
error: this.error,
|
|
259
|
+
errors: this.errors,
|
|
260
|
+
invalid: this.invalid,
|
|
261
|
+
success: this.success,
|
|
262
|
+
touchedSelf: this.touchedSelf,
|
|
263
|
+
touched: this.touched,
|
|
264
|
+
});
|
|
265
|
+
message = this.fieldMessage.message;
|
|
266
|
+
controlState = this.fieldMessage.controlState;
|
|
267
|
+
invalidResolved = this.fieldMessage.invalid;
|
|
268
|
+
enabledFiltered() {
|
|
269
|
+
return this.filteredOptions().filter((option) => !option.disabled);
|
|
270
|
+
}
|
|
271
|
+
allFilteredSelected = computed(() => {
|
|
272
|
+
const enabled = this.enabledFiltered();
|
|
273
|
+
const selected = this.value();
|
|
274
|
+
return (enabled.length > 0 && enabled.every((o) => selected.includes(o.value)));
|
|
275
|
+
}, ...(ngDevMode ? [{ debugName: "allFilteredSelected" }] : /* istanbul ignore next */ []));
|
|
276
|
+
someFilteredSelected = computed(() => {
|
|
277
|
+
const selected = this.value();
|
|
278
|
+
return (this.enabledFiltered().some((o) => selected.includes(o.value)) &&
|
|
279
|
+
!this.allFilteredSelected());
|
|
280
|
+
}, ...(ngDevMode ? [{ debugName: "someFilteredSelected" }] : /* istanbul ignore next */ []));
|
|
281
|
+
showsPanelSelectAll = computed(() => {
|
|
282
|
+
const setting = this.selectAll();
|
|
283
|
+
return setting === true || setting === 'both';
|
|
284
|
+
}, ...(ngDevMode ? [{ debugName: "showsPanelSelectAll" }] : /* istanbul ignore next */ []));
|
|
285
|
+
showsGroupSelectAll = computed(() => {
|
|
286
|
+
const setting = this.selectAll();
|
|
287
|
+
return setting === 'group' || setting === 'both';
|
|
288
|
+
}, ...(ngDevMode ? [{ debugName: "showsGroupSelectAll" }] : /* istanbul ignore next */ []));
|
|
289
|
+
enabledIn(group) {
|
|
290
|
+
return group.options.filter((option) => !option.disabled);
|
|
291
|
+
}
|
|
292
|
+
groupAllSelected(group) {
|
|
293
|
+
const enabled = this.enabledIn(group);
|
|
294
|
+
const selected = this.value();
|
|
295
|
+
return (enabled.length > 0 && enabled.every((o) => selected.includes(o.value)));
|
|
296
|
+
}
|
|
297
|
+
groupSomeSelected(group) {
|
|
298
|
+
const selected = this.value();
|
|
299
|
+
return (this.enabledIn(group).some((o) => selected.includes(o.value)) &&
|
|
300
|
+
!this.groupAllSelected(group));
|
|
301
|
+
}
|
|
302
|
+
toggleGroup(group) {
|
|
303
|
+
const values = this.enabledIn(group).map((o) => o.value);
|
|
304
|
+
if (this.groupAllSelected(group)) {
|
|
305
|
+
const remove = new Set(values);
|
|
306
|
+
this.value.set(this.value().filter((value) => !remove.has(value)));
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
const next = new Set(this.value());
|
|
310
|
+
values.forEach((value) => next.add(value));
|
|
311
|
+
this.value.set([...next]);
|
|
312
|
+
}
|
|
313
|
+
toggleSelectAll() {
|
|
314
|
+
const enabledValues = this.enabledFiltered().map((o) => o.value);
|
|
315
|
+
if (this.allFilteredSelected()) {
|
|
316
|
+
const remove = new Set(enabledValues);
|
|
317
|
+
this.value.set(this.value().filter((value) => !remove.has(value)));
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
const next = new Set(this.value());
|
|
321
|
+
enabledValues.forEach((value) => next.add(value));
|
|
322
|
+
this.value.set([...next]);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
isSelected(value) {
|
|
326
|
+
return this.value().includes(value);
|
|
327
|
+
}
|
|
328
|
+
toggleValue(option) {
|
|
329
|
+
if (option.disabled) {
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
const current = this.value();
|
|
333
|
+
this.value.set(current.includes(option.value)
|
|
334
|
+
? current.filter((value) => value !== option.value)
|
|
335
|
+
: [...current, option.value]);
|
|
336
|
+
}
|
|
337
|
+
clearValue(event) {
|
|
338
|
+
event.stopPropagation();
|
|
339
|
+
this.clear();
|
|
340
|
+
this.markTouched();
|
|
341
|
+
// The button that ran this is destroyed with the chips, so focus would fall
|
|
342
|
+
// to <body>.
|
|
343
|
+
this.trigger().nativeElement.focus();
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Empties the selection from outside — a "reset filters" button, a form the app
|
|
347
|
+
* clears itself. Deliberately does NOT move focus: the caller may be navigating
|
|
348
|
+
* away.
|
|
349
|
+
*/
|
|
350
|
+
clear() {
|
|
351
|
+
this.value.set([]);
|
|
352
|
+
this.filter.set('');
|
|
353
|
+
if (this.open()) {
|
|
354
|
+
this.close('dismiss');
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
removeValue(value) {
|
|
358
|
+
this.value.set(this.value().filter((entry) => entry !== value));
|
|
359
|
+
// The close button that ran this is destroyed with its chip, so focus would
|
|
360
|
+
// fall to <body>.
|
|
361
|
+
this.trigger().nativeElement.focus();
|
|
362
|
+
}
|
|
363
|
+
constructor() {
|
|
364
|
+
super();
|
|
365
|
+
scrollActiveOptionIntoView(this.activeDescendant, this.scrollActiveIntoView, this.cursorFromKeyboard);
|
|
366
|
+
announceOptionCount(computed(() => this.filteredOptions().length), this.open);
|
|
367
|
+
}
|
|
368
|
+
onFilter(event) {
|
|
369
|
+
const typed = event.target.value;
|
|
370
|
+
this.filter.set(typed);
|
|
371
|
+
this.filterChange.emit(typed);
|
|
372
|
+
this.activeIndex.set(this.firstEnabledIndex());
|
|
373
|
+
}
|
|
374
|
+
setOpen(next) {
|
|
375
|
+
if (this.open() === next) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
this.open.set(next);
|
|
379
|
+
(next ? this.opened : this.closed).emit();
|
|
380
|
+
}
|
|
381
|
+
isReadOnly = computed(() => this.readOnly() || this.readonlyBinding(), ...(ngDevMode ? [{ debugName: "isReadOnly" }] : /* istanbul ignore next */ []));
|
|
382
|
+
typeAhead = createTypeAhead();
|
|
383
|
+
handleTypeAhead(key) {
|
|
384
|
+
const index = this.typeAhead.match(key, this.filteredOptions().map((option) => option.label), this.activeIndex());
|
|
385
|
+
if (index < 0) {
|
|
386
|
+
return false;
|
|
387
|
+
}
|
|
388
|
+
this.activeIndex.set(index);
|
|
389
|
+
return true;
|
|
390
|
+
}
|
|
391
|
+
cursorFromKeyboard = signal(false, ...(ngDevMode ? [{ debugName: "cursorFromKeyboard" }] : /* istanbul ignore next */ []));
|
|
392
|
+
cursorList() {
|
|
393
|
+
const options = this.filteredOptions();
|
|
394
|
+
return {
|
|
395
|
+
length: options.length,
|
|
396
|
+
isEnabled: (index) => !options[index].disabled,
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
firstEnabledIndex() {
|
|
400
|
+
return firstEnabledIndex(this.cursorList());
|
|
401
|
+
}
|
|
402
|
+
onTriggerKeydown(event) {
|
|
403
|
+
this.cursorFromKeyboard.set(true);
|
|
404
|
+
if (this.isDisabled()) {
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
// With no filter row the trigger runs the input's handler, and must take Enter
|
|
408
|
+
// first — otherwise Enter toggles the panel instead of picking the active row.
|
|
409
|
+
if (this.open() && !this.showsSearch()) {
|
|
410
|
+
this.onSearchKeydown(event);
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
414
|
+
event.preventDefault();
|
|
415
|
+
this.onTriggerClick();
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
if (event.key === 'ArrowDown' && !this.open()) {
|
|
419
|
+
event.preventDefault();
|
|
420
|
+
this.openPanel();
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
if (!this.open() && this.handleTypeAhead(event.key)) {
|
|
424
|
+
event.preventDefault();
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
onSearchKeydown(event) {
|
|
428
|
+
this.cursorFromKeyboard.set(true);
|
|
429
|
+
switch (event.key) {
|
|
430
|
+
case 'ArrowDown':
|
|
431
|
+
event.preventDefault();
|
|
432
|
+
this.moveActive(1);
|
|
433
|
+
break;
|
|
434
|
+
case 'ArrowUp':
|
|
435
|
+
event.preventDefault();
|
|
436
|
+
this.moveActive(-1);
|
|
437
|
+
break;
|
|
438
|
+
case 'Enter': {
|
|
439
|
+
event.preventDefault();
|
|
440
|
+
const option = this.filteredOptions()[this.activeIndex()];
|
|
441
|
+
if (option) {
|
|
442
|
+
this.toggleValue(option);
|
|
443
|
+
}
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
case 'Escape':
|
|
447
|
+
event.preventDefault();
|
|
448
|
+
this.close('dismiss');
|
|
449
|
+
break;
|
|
450
|
+
case 'PageDown':
|
|
451
|
+
event.preventDefault();
|
|
452
|
+
this.moveActive(MultiSelectComponent.pageStep);
|
|
453
|
+
break;
|
|
454
|
+
case 'PageUp':
|
|
455
|
+
event.preventDefault();
|
|
456
|
+
this.moveActive(-MultiSelectComponent.pageStep);
|
|
457
|
+
break;
|
|
458
|
+
case 'Home':
|
|
459
|
+
event.preventDefault();
|
|
460
|
+
this.activeIndex.set(this.firstEnabledIndex());
|
|
461
|
+
break;
|
|
462
|
+
case 'End':
|
|
463
|
+
event.preventDefault();
|
|
464
|
+
this.activeIndex.set(lastEnabledIndex(this.cursorList()));
|
|
465
|
+
break;
|
|
466
|
+
case 'Tab':
|
|
467
|
+
this.close('dismiss');
|
|
468
|
+
break;
|
|
469
|
+
case 'Backspace':
|
|
470
|
+
if (!this.filter()) {
|
|
471
|
+
const selected = this.selectedOptions();
|
|
472
|
+
if (selected.length) {
|
|
473
|
+
this.removeValue(selected[selected.length - 1].value);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
break;
|
|
477
|
+
default:
|
|
478
|
+
break;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
openPanel() {
|
|
482
|
+
if (this.overlayRef || this.isDisabled() || this.isReadOnly()) {
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
const triggerElement = this.trigger().nativeElement;
|
|
486
|
+
const { positionStrategy, config } = dropdownOverlay(this.overlay, triggerElement);
|
|
487
|
+
const triggerWidth = triggerElement.getBoundingClientRect().width;
|
|
488
|
+
// A compact trigger hugs its caption, so pinning the panel to it gives a panel
|
|
489
|
+
// too narrow to read its own options — the trigger width becomes a FLOOR here
|
|
490
|
+
// whether or not the consumer asked for `content`.
|
|
491
|
+
if (this.width() === 'content' || this.showsCompactTrigger()) {
|
|
492
|
+
config.minWidth = triggerWidth;
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
config.width = triggerWidth;
|
|
496
|
+
}
|
|
497
|
+
this.overlayRef = this.overlay.create(config);
|
|
498
|
+
prepareOverlayEnter(this.overlayRef, this.host.nativeElement, positionStrategy);
|
|
499
|
+
forwardOverlayTokens(this.overlayRef, this.host.nativeElement, this.panelTokens);
|
|
500
|
+
closeOnOutsidePointer(this.overlayRef, (target) => this.trigger().nativeElement.contains(target), () => this.close('dismiss'));
|
|
501
|
+
// No backdrop catches a page scroll and CDK's scroll strategies miss a plain
|
|
502
|
+
// overflow container, so close on any outside scroll ourselves.
|
|
503
|
+
const removeScrollClose = closeOnScroll(this.overlayRef, () => this.close('dismiss'));
|
|
504
|
+
const detaching = this.overlayRef;
|
|
505
|
+
this.overlayRef.detachments().subscribe(() => {
|
|
506
|
+
removeScrollClose();
|
|
507
|
+
// A deferred dispose can outlive a re-open, and then this fires for the
|
|
508
|
+
// PREVIOUS panel: clearing state here would strand the live one.
|
|
509
|
+
if (this.overlayRef !== detaching) {
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
this.overlayRef = null;
|
|
513
|
+
this.setOpen(false);
|
|
514
|
+
});
|
|
515
|
+
this.overlayRef.keydownEvents().subscribe((event) => {
|
|
516
|
+
if (event.key === 'Escape') {
|
|
517
|
+
event.preventDefault();
|
|
518
|
+
this.close('dismiss');
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
this.overlayRef.attach(new TemplatePortal(this.panelTpl(), this.vcr));
|
|
522
|
+
this.setOpen(true);
|
|
523
|
+
this.activeIndex.set(this.firstEnabledIndex());
|
|
524
|
+
if (this.showsSearch()) {
|
|
525
|
+
this.focusTimer = setTimeout(() => {
|
|
526
|
+
this.focusTimer = null;
|
|
527
|
+
this.searchInput()?.nativeElement.focus();
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
onTriggerClick() {
|
|
532
|
+
if (this.isDisabled()) {
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
if (this.overlayRef) {
|
|
536
|
+
this.close();
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
this.openPanel();
|
|
540
|
+
}
|
|
541
|
+
close(cause = 'select') {
|
|
542
|
+
if (!this.overlayRef) {
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
clearTimeout(this.focusTimer ?? undefined);
|
|
546
|
+
this.focusTimer = null;
|
|
547
|
+
const focusWasInPanel = focusIsInside(this.overlayRef);
|
|
548
|
+
disposeWithLeave(this.overlayRef, cause);
|
|
549
|
+
this.overlayRef = null;
|
|
550
|
+
this.setOpen(false);
|
|
551
|
+
this.filter.set('');
|
|
552
|
+
this.activeIndex.set(-1);
|
|
553
|
+
this.markTouched();
|
|
554
|
+
if (focusWasInPanel) {
|
|
555
|
+
this.trigger().nativeElement.focus({ preventScroll: true });
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
/** How far PageUp and PageDown move. Ten rows is the native `<select>` step and
|
|
559
|
+
* the APG listbox example's — a fixed number rather than a measured screenful,
|
|
560
|
+
* so the jump is the same wherever the panel happens to be clipped. */
|
|
561
|
+
static pageStep = 10;
|
|
562
|
+
moveActive(delta) {
|
|
563
|
+
const next = nextEnabledIndex(this.cursorList(), this.activeIndex(), delta);
|
|
564
|
+
if (next >= 0) {
|
|
565
|
+
this.activeIndex.set(next);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: MultiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
569
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: MultiSelectComponent, isStandalone: true, selector: "ds-multi-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, readonlyBinding: { classPropertyName: "readonlyBinding", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, filterWith: { classPropertyName: "filterWith", publicName: "filterWith", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, scrollActiveIntoView: { classPropertyName: "scrollActiveIntoView", publicName: "scrollActiveIntoView", isSignal: true, isRequired: false, transformFunction: null }, maxVisibleChips: { classPropertyName: "maxVisibleChips", publicName: "maxVisibleChips", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, success: { classPropertyName: "success", publicName: "success", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, triggerDisplay: { classPropertyName: "triggerDisplay", publicName: "triggerDisplay", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, selectAll: { classPropertyName: "selectAll", publicName: "selectAll", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", filterChange: "filterChange", opened: "opened", closed: "closed" }, host: { properties: { "attr.data-field-state": "controlState()", "class.content-width": "width() === 'content'", "class.compact-trigger": "showsCompactTrigger()" } }, providers: [
|
|
570
|
+
{
|
|
571
|
+
provide: NG_VALUE_ACCESSOR,
|
|
572
|
+
useExisting: forwardRef(() => MultiSelectComponent),
|
|
573
|
+
multi: true,
|
|
574
|
+
},
|
|
575
|
+
], queries: [{ propertyName: "optionTemplate", first: true, predicate: DsOptionTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "chipTemplate", first: true, predicate: DsChipTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "pickerTrigger", first: true, predicate: DsPickerTriggerDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "panelHeaderTemplate", first: true, predicate: DsPanelHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "panelFooterTemplate", first: true, predicate: DsPanelFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupLabelTemplate", first: true, predicate: DsGroupLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: DsEmptyTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "searchInput", first: true, predicate: ["search"], descendants: true, isSignal: true }, { propertyName: "panelTpl", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "chipRow", first: true, predicate: ["chipRow"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\">\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\">\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\">\n (optional)\n </span>\n }\n </span>\n}\n\n<div\n #trigger\n aria-haspopup=\"listbox\"\n role=\"combobox\"\n [class]=\"'field-trigger ' + sizeResolved()\"\n [class.open]=\"open()\"\n [class.disabled]=\"isDisabled()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-readonly]=\"isReadOnly() ? 'true' : null\"\n [attr.name]=\"name()\"\n [class.readonly]=\"isReadOnly()\"\n [attr.aria-activedescendant]=\"triggerActiveDescendant()\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKeydown($event)\">\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOptions(),\n selected: selectedOptions(),\n count: selectedOptions().length,\n open: open(),\n disabled: isDisabled(),\n }\" />\n } @else if (showsCompactTrigger()) {\n <span class=\"trigger-caption\">\n {{ triggerCaption() }}\n </span>\n\n @if (triggerDisplay() === 'labels' && selectedOptions().length > 0) {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\">\n @for (option of visibleChips(); track option.value) {\n <span\n data-chip\n class=\"trigger-label\">\n {{ option.label }}\n </span>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow>\n +{{ overflowCount() }}\n </span>\n }\n </span>\n } @else if (selectedOptions().length > 0) {\n <ds-badge\n [count]=\"selectedOptions().length\"\n [countLabel]=\"'selected'\" />\n }\n } @else if (selectedOptions().length === 0) {\n <span class=\"placeholder\">\n {{ placeholder() }}\n </span>\n } @else {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\">\n @for (option of visibleChips(); track option.value) {\n <ds-tag\n data-chip\n variant=\"neutral\"\n closable\n [closeLabel]=\"'Remove ' + option.label\"\n (closed)=\"removeValue(option.value)\">\n @if (chipTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\" />\n } @else {\n {{ option.label }}\n }\n </ds-tag>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow>\n +{{ overflowCount() }} more\n </span>\n }\n </span>\n }\n\n @if (\n clearable() &&\n selectedOptions().length > 0 &&\n !isDisabled() &&\n !isReadOnly()\n ) {\n <button\n type=\"button\"\n class=\"clear-btn\"\n aria-label=\"Clear selection\"\n (click)=\"clearValue($event)\">\n <ds-icon\n name=\"x\"\n [size]=\"14\" />\n </button>\n }\n\n <ds-icon\n class=\"chevron\"\n name=\"chevronDown\"\n [size]=\"18\" />\n</div>\n\n<ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n\n<ng-template #panel>\n <div class=\"dropdown-panel\">\n @if (panelHeaderTemplate(); as tpl) {\n <div class=\"panel-header\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: filter(),\n }\" />\n </div>\n }\n\n @if (showsSearch()) {\n <div class=\"search-row\">\n <ds-icon\n class=\"search-icon\"\n name=\"search\"\n [size]=\"16\" />\n\n <input\n #search\n type=\"text\"\n class=\"search-input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded=\"true\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [placeholder]=\"searchPlaceholder()\"\n [value]=\"filter()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n (input)=\"onFilter($event)\"\n (keydown)=\"onSearchKeydown($event)\" />\n </div>\n }\n\n @if (showsPanelSelectAll() && filteredOptions().length) {\n <button\n type=\"button\"\n class=\"select-all\"\n role=\"checkbox\"\n [attr.aria-checked]=\"\n allFilteredSelected()\n ? 'true'\n : someFilteredSelected()\n ? 'mixed'\n : 'false'\n \"\n (click)=\"toggleSelectAll()\">\n <span\n class=\"checkbox\"\n [class.checked]=\"allFilteredSelected()\"\n [class.indeterminate]=\"someFilteredSelected()\">\n <span class=\"tick\"></span>\n </span>\n\n <span class=\"select-all-label\">\n Select all\n </span>\n </button>\n }\n\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n [id]=\"listboxId\">\n @for (item of filteredItems(); track $index; let itemIdx = $index) {\n @if (isGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\">\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"itemIdx === 0\">\n @if (groupLabelTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: item,\n group: item,\n count: item.options.length,\n }\" />\n } @else {\n {{ item.label }}\n }\n </span>\n\n @if (showsGroupSelectAll()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"select-all group\"\n role=\"option\"\n [disabled]=\"item.disabled\"\n [attr.aria-selected]=\"groupAllSelected(item)\"\n [attr.aria-checked]=\"\n groupAllSelected(item)\n ? 'true'\n : groupSomeSelected(item)\n ? 'mixed'\n : 'false'\n \"\n (click)=\"toggleGroup(item)\">\n <span\n class=\"checkbox\"\n [class.checked]=\"groupAllSelected(item)\"\n [class.indeterminate]=\"groupSomeSelected(item)\">\n <span class=\"tick\"></span>\n </span>\n\n All of {{ item.label }}\n </button>\n }\n\n <ul\n class=\"optgroup-list\"\n role=\"presentation\">\n @for (option of item.options; track option.value) {\n <li role=\"presentation\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n role=\"option\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"activeIndex() === flatIndexOf(option)\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [disabled]=\"option.disabled\"\n (click)=\"toggleValue(option)\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n activeIndex.set(flatIndexOf(option))\n \">\n <span\n class=\"checkbox\"\n [class.checked]=\"isSelected(option.value)\">\n <span class=\"tick\"></span>\n </span>\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\" />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\" />\n } @else {\n {{ option.label }}\n }\n </span>\n </button>\n </li>\n }\n </ul>\n </li>\n } @else {\n @let option = item;\n\n <li role=\"presentation\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n role=\"option\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"activeIndex() === flatIndexOf(option)\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [disabled]=\"option.disabled\"\n (click)=\"toggleValue(option)\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n activeIndex.set(flatIndexOf(option))\n \">\n <span\n class=\"checkbox\"\n [class.checked]=\"isSelected(option.value)\">\n <span class=\"tick\"></span>\n </span>\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\" />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\" />\n } @else {\n {{ option.label }}\n }\n </span>\n </button>\n </li>\n }\n }\n\n @if (loading()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\">\n <ds-spinner size=\"sm\" />\n </li>\n } @else if (filteredOptions().length === 0) {\n <li\n class=\"empty t-s\"\n role=\"presentation\">\n @if (emptyTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: filter(),\n query: filter(),\n }\" />\n } @else {\n No matches\n }\n </li>\n }\n </ul>\n\n @if (panelFooterTemplate(); as tpl) {\n <div class=\"panel-footer\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: filter(),\n }\" />\n </div>\n }\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{display:flex;flex-direction:column;gap:var(--field-label-gap);--ds-dropdown-panel-bg-color: var( --ds-multi-select-panel-bg-color, var(--surface-overlay) );--_trigger-bg-color: var(--ds-multi-select-bg-color, var(--surface-default));--_trigger-border-color: var( --ds-multi-select-border-color, var(--border-default) );--_trigger-radius: var(--ds-multi-select-radius, var(--ds-radius-control));--_trigger-text-color: var(--ds-multi-select-text-color, var(--text-primary));--_trigger-border-color-focus: var( --ds-multi-select-border-color-focus, var(--accent) )}:host(.content-width){width:fit-content}:host(.compact-trigger){width:fit-content}:host(.compact-trigger) .field-trigger{padding:var(--space-1) var(--space-2-5);gap:var(--space-1-5)}:host(.compact-trigger) .trigger-caption{font-weight:var(--font-weight-medium);white-space:nowrap}:host(.compact-trigger):has(ds-badge) .field-trigger,:host(.compact-trigger):has(.trigger-label) .field-trigger{border-color:var(--accent)}:host(.compact-trigger) .trigger-label{color:var(--text-secondary);white-space:nowrap}:host(.compact-trigger) .trigger-label:not(:last-child):after{content:\",\"}.field-trigger{display:flex;flex-wrap:wrap}.field-trigger:has(>.chip-row.fit){flex-wrap:nowrap}.field-trigger{align-items:center;gap:var(--space-1-5);--_field-box-height: var(--ds-field-height, var(--field-h-md));min-height:var(--_field-box-height)}.field-trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));min-height:var(--_field-box-height)}.field-trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));min-height:var(--_field-box-height)}.field-trigger{padding:var(--space-1-5) var(--field-pad-x);background-color:var(--_trigger-bg-color);border:var(--border-width-default) solid var(--_trigger-border-color);border-radius:var(--_trigger-radius);color:var(--_trigger-text-color);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);cursor:pointer;transition:border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard)}.field-trigger:hover:not(.disabled){border-color:var(--border-strong)}@media not (forced-colors:active){.field-trigger.open,.field-trigger:focus-visible{outline:none}}.field-trigger.open,.field-trigger:focus-visible{border-color:var(--_trigger-border-color-focus);box-shadow:var(--accent-focus-field)}.field-trigger.disabled{background-color:var(--surface-muted);color:var(--text-disabled);cursor:not-allowed}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.placeholder{color:var(--text-tertiary)}.chip-row{display:contents}.chip-row.fit{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;overflow:hidden;gap:inherit}.chip-row.fit>*{flex:0 1 auto;min-width:0;white-space:nowrap}.overflow{color:var(--text-secondary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-xs)}.chevron{margin-left:auto;color:var(--text-tertiary)}.dropdown-panel{--ds-option-bg-color-active: var( --ds-multi-select-option-bg-color-active, var(--surface-secondary) );--_check-bg-color: var(--ds-multi-select-check-bg-color, var(--accent))}.search-row{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);border-bottom:var(--border-width-default) solid var(--border-divider)}.search-row:focus-within{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:calc(-1 * var(--focus-ring-width));animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@media not (forced-colors:active){.search-row .search-input:where(:focus-visible){outline:none}}.search-icon{color:var(--text-tertiary);flex:none}.search-input{flex:1;min-width:0;border:0;background:transparent;color:var(--text-primary);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans)}.select-all-label{min-width:0;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.select-all{display:flex;align-items:center;gap:var(--ds-option-gap, var(--space-2));width:100%;padding:var(--ds-option-padding, var(--space-2) var(--space-2-5));border:0;border-bottom:var(--border-width-default) solid var(--border-divider);border-radius:var(--ds-radius-inner) var(--ds-radius-inner) 0 0;background:transparent;color:var(--text-secondary);font:var(--font-weight-semibold) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);text-transform:uppercase;letter-spacing:var(--letter-spacing-wide);text-align:left;cursor:pointer}.select-all:hover:not(:disabled){background-color:var(--surface-secondary)}.select-all:disabled{color:var(--text-disabled);cursor:not-allowed}.checkbox{display:inline-flex;align-items:center;justify-content:center;flex:none;width:var(--check-size);height:var(--check-size);border-radius:var(--ds-radius-inner);border:var(--check-bw) solid var(--border-strong);background-color:var(--surface-default);color:var(--text-on-primary)}.checkbox.checked,.checkbox.indeterminate{background-color:var(--_check-bg-color);border-color:var(--_check-bg-color)}.checkbox .tick{--_check-mark-enter-duration: var(--ds-check-mark-enter-duration, var(--ds-motion-check-enter-duration));--_check-mark-enter-easing: var(--ds-check-mark-enter-easing, var(--ds-motion-check-enter-easing));--_check-mark-exit-duration: var(--ds-check-mark-exit-duration, var(--ds-motion-check-exit-duration));--_check-mark-exit-easing: var(--ds-check-mark-exit-easing, var(--ds-motion-check-exit-easing));width:var(--check-tick-size);height:var(--check-tick-size);transform:scale(.6);opacity:0;transform-origin:center;transition:transform var(--_check-mark-exit-duration) var(--_check-mark-exit-easing),opacity var(--_check-mark-exit-duration) var(--_check-mark-exit-easing);background-color:currentcolor}@media(forced-colors:active){.checkbox .tick{background-color:CanvasText}}.checkbox .tick{-webkit-mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat;mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat}.checkbox.checked .tick,.checkbox.indeterminate .tick{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing)}.checkbox.indeterminate .tick{width:var(--check-indet-w);height:var(--check-indet-h);border-radius:var(--ds-radius-inner);-webkit-mask:none;mask:none}:host([data-field-state=error]:not(.in-group)) .field-trigger{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .field-trigger:focus-within,:host([data-field-state=error]:not(.in-group)) .field-trigger:focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .field-trigger{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .field-trigger{border-color:var(--success)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: SpinnerComponent, selector: "ds-spinner", inputs: ["size"] }, { kind: "component", type: TagComponent, selector: "ds-tag", inputs: ["variant", "closable", "interactive", "selected", "closeLabel"], outputs: ["closed", "toggled"] }, { kind: "component", type: BadgeComponent, selector: "ds-badge", inputs: ["status", "withDot", "solid", "count", "max", "countLabel"] }, { kind: "component", type: FieldMessageComponent, selector: "ds-field-message", inputs: ["text", "state", "messageId", "icon", "reserve"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
576
|
+
}
|
|
577
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: MultiSelectComponent, decorators: [{
|
|
578
|
+
type: Component,
|
|
579
|
+
args: [{ selector: 'ds-multi-select', standalone: true, imports: [
|
|
580
|
+
IconComponent,
|
|
581
|
+
SpinnerComponent,
|
|
582
|
+
TagComponent,
|
|
583
|
+
BadgeComponent,
|
|
584
|
+
FieldMessageComponent,
|
|
585
|
+
NgTemplateOutlet,
|
|
586
|
+
], host: {
|
|
587
|
+
'[attr.data-field-state]': 'controlState()',
|
|
588
|
+
'[class.content-width]': "width() === 'content'",
|
|
589
|
+
'[class.compact-trigger]': 'showsCompactTrigger()',
|
|
590
|
+
}, encapsulation: ViewEncapsulation.Emulated, providers: [
|
|
591
|
+
{
|
|
592
|
+
provide: NG_VALUE_ACCESSOR,
|
|
593
|
+
useExisting: forwardRef(() => MultiSelectComponent),
|
|
594
|
+
multi: true,
|
|
595
|
+
},
|
|
596
|
+
], template: "@if (label()) {\n <span\n class=\"label\"\n [id]=\"labelId\">\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\">\n *\n </span>\n } @else if (optional()) {\n <span\n class=\"optional-marker\"\n aria-hidden=\"true\">\n (optional)\n </span>\n }\n </span>\n}\n\n<div\n #trigger\n aria-haspopup=\"listbox\"\n role=\"combobox\"\n [class]=\"'field-trigger ' + sizeResolved()\"\n [class.open]=\"open()\"\n [class.disabled]=\"isDisabled()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-readonly]=\"isReadOnly() ? 'true' : null\"\n [attr.name]=\"name()\"\n [class.readonly]=\"isReadOnly()\"\n [attr.aria-activedescendant]=\"triggerActiveDescendant()\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKeydown($event)\">\n @if (pickerTrigger(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: selectedOptions(),\n selected: selectedOptions(),\n count: selectedOptions().length,\n open: open(),\n disabled: isDisabled(),\n }\" />\n } @else if (showsCompactTrigger()) {\n <span class=\"trigger-caption\">\n {{ triggerCaption() }}\n </span>\n\n @if (triggerDisplay() === 'labels' && selectedOptions().length > 0) {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\">\n @for (option of visibleChips(); track option.value) {\n <span\n data-chip\n class=\"trigger-label\">\n {{ option.label }}\n </span>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow>\n +{{ overflowCount() }}\n </span>\n }\n </span>\n } @else if (selectedOptions().length > 0) {\n <ds-badge\n [count]=\"selectedOptions().length\"\n [countLabel]=\"'selected'\" />\n }\n } @else if (selectedOptions().length === 0) {\n <span class=\"placeholder\">\n {{ placeholder() }}\n </span>\n } @else {\n <span\n #chipRow\n class=\"chip-row\"\n [class.fit]=\"fitsChipsToWidth()\">\n @for (option of visibleChips(); track option.value) {\n <ds-tag\n data-chip\n variant=\"neutral\"\n closable\n [closeLabel]=\"'Remove ' + option.label\"\n (closed)=\"removeValue(option.value)\">\n @if (chipTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\" />\n } @else {\n {{ option.label }}\n }\n </ds-tag>\n }\n\n @if (overflowCount() > 0) {\n <span\n class=\"overflow\"\n data-chip-overflow>\n +{{ overflowCount() }} more\n </span>\n }\n </span>\n }\n\n @if (\n clearable() &&\n selectedOptions().length > 0 &&\n !isDisabled() &&\n !isReadOnly()\n ) {\n <button\n type=\"button\"\n class=\"clear-btn\"\n aria-label=\"Clear selection\"\n (click)=\"clearValue($event)\">\n <ds-icon\n name=\"x\"\n [size]=\"14\" />\n </button>\n }\n\n <ds-icon\n class=\"chevron\"\n name=\"chevronDown\"\n [size]=\"18\" />\n</div>\n\n<ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n\n<ng-template #panel>\n <div class=\"dropdown-panel\">\n @if (panelHeaderTemplate(); as tpl) {\n <div class=\"panel-header\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: filter(),\n }\" />\n </div>\n }\n\n @if (showsSearch()) {\n <div class=\"search-row\">\n <ds-icon\n class=\"search-icon\"\n name=\"search\"\n [size]=\"16\" />\n\n <input\n #search\n type=\"text\"\n class=\"search-input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded=\"true\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [placeholder]=\"searchPlaceholder()\"\n [value]=\"filter()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n (input)=\"onFilter($event)\"\n (keydown)=\"onSearchKeydown($event)\" />\n </div>\n }\n\n @if (showsPanelSelectAll() && filteredOptions().length) {\n <button\n type=\"button\"\n class=\"select-all\"\n role=\"checkbox\"\n [attr.aria-checked]=\"\n allFilteredSelected()\n ? 'true'\n : someFilteredSelected()\n ? 'mixed'\n : 'false'\n \"\n (click)=\"toggleSelectAll()\">\n <span\n class=\"checkbox\"\n [class.checked]=\"allFilteredSelected()\"\n [class.indeterminate]=\"someFilteredSelected()\">\n <span class=\"tick\"></span>\n </span>\n\n <span class=\"select-all-label\">\n Select all\n </span>\n </button>\n }\n\n <ul\n class=\"dropdown-list\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n [id]=\"listboxId\">\n @for (item of filteredItems(); track $index; let itemIdx = $index) {\n @if (isGroup(item)) {\n <li\n class=\"optgroup\"\n role=\"group\"\n [attr.aria-label]=\"item.label\">\n <span\n class=\"optgroup-label\"\n [class.is-first]=\"itemIdx === 0\">\n @if (groupLabelTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: item,\n group: item,\n count: item.options.length,\n }\" />\n } @else {\n {{ item.label }}\n }\n </span>\n\n @if (showsGroupSelectAll()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"select-all group\"\n role=\"option\"\n [disabled]=\"item.disabled\"\n [attr.aria-selected]=\"groupAllSelected(item)\"\n [attr.aria-checked]=\"\n groupAllSelected(item)\n ? 'true'\n : groupSomeSelected(item)\n ? 'mixed'\n : 'false'\n \"\n (click)=\"toggleGroup(item)\">\n <span\n class=\"checkbox\"\n [class.checked]=\"groupAllSelected(item)\"\n [class.indeterminate]=\"groupSomeSelected(item)\">\n <span class=\"tick\"></span>\n </span>\n\n All of {{ item.label }}\n </button>\n }\n\n <ul\n class=\"optgroup-list\"\n role=\"presentation\">\n @for (option of item.options; track option.value) {\n <li role=\"presentation\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n role=\"option\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"activeIndex() === flatIndexOf(option)\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [disabled]=\"option.disabled\"\n (click)=\"toggleValue(option)\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n activeIndex.set(flatIndexOf(option))\n \">\n <span\n class=\"checkbox\"\n [class.checked]=\"isSelected(option.value)\">\n <span class=\"tick\"></span>\n </span>\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\" />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\" />\n } @else {\n {{ option.label }}\n }\n </span>\n </button>\n </li>\n }\n </ul>\n </li>\n } @else {\n @let option = item;\n\n <li role=\"presentation\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n role=\"option\"\n class=\"option\"\n [id]=\"optionId(flatIndexOf(option))\"\n [class.is-active]=\"activeIndex() === flatIndexOf(option)\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [disabled]=\"option.disabled\"\n (click)=\"toggleValue(option)\"\n (mouseenter)=\"\n cursorFromKeyboard.set(false);\n activeIndex.set(flatIndexOf(option))\n \">\n <span\n class=\"checkbox\"\n [class.checked]=\"isSelected(option.value)\">\n <span class=\"tick\"></span>\n </span>\n\n @if (option.icon) {\n <ds-icon\n class=\"option-icon\"\n [name]=\"option.icon\"\n [size]=\"16\" />\n }\n\n <span class=\"option-label\">\n @if (optionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option,\n option: option,\n }\" />\n } @else {\n {{ option.label }}\n }\n </span>\n </button>\n </li>\n }\n }\n\n @if (loading()) {\n <li\n class=\"empty t-s\"\n role=\"presentation\">\n <ds-spinner size=\"sm\" />\n </li>\n } @else if (filteredOptions().length === 0) {\n <li\n class=\"empty t-s\"\n role=\"presentation\">\n @if (emptyTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: filter(),\n query: filter(),\n }\" />\n } @else {\n No matches\n }\n </li>\n }\n </ul>\n\n @if (panelFooterTemplate(); as tpl) {\n <div class=\"panel-footer\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n count: filteredOptions().length,\n total: allOptions().length,\n query: filter(),\n }\" />\n </div>\n }\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{display:flex;flex-direction:column;gap:var(--field-label-gap);--ds-dropdown-panel-bg-color: var( --ds-multi-select-panel-bg-color, var(--surface-overlay) );--_trigger-bg-color: var(--ds-multi-select-bg-color, var(--surface-default));--_trigger-border-color: var( --ds-multi-select-border-color, var(--border-default) );--_trigger-radius: var(--ds-multi-select-radius, var(--ds-radius-control));--_trigger-text-color: var(--ds-multi-select-text-color, var(--text-primary));--_trigger-border-color-focus: var( --ds-multi-select-border-color-focus, var(--accent) )}:host(.content-width){width:fit-content}:host(.compact-trigger){width:fit-content}:host(.compact-trigger) .field-trigger{padding:var(--space-1) var(--space-2-5);gap:var(--space-1-5)}:host(.compact-trigger) .trigger-caption{font-weight:var(--font-weight-medium);white-space:nowrap}:host(.compact-trigger):has(ds-badge) .field-trigger,:host(.compact-trigger):has(.trigger-label) .field-trigger{border-color:var(--accent)}:host(.compact-trigger) .trigger-label{color:var(--text-secondary);white-space:nowrap}:host(.compact-trigger) .trigger-label:not(:last-child):after{content:\",\"}.field-trigger{display:flex;flex-wrap:wrap}.field-trigger:has(>.chip-row.fit){flex-wrap:nowrap}.field-trigger{align-items:center;gap:var(--space-1-5);--_field-box-height: var(--ds-field-height, var(--field-h-md));min-height:var(--_field-box-height)}.field-trigger.sm{--_field-box-height: var(--ds-field-height, var(--field-h-sm));min-height:var(--_field-box-height)}.field-trigger.lg{--_field-box-height: var(--ds-field-height, var(--field-h-lg));min-height:var(--_field-box-height)}.field-trigger{padding:var(--space-1-5) var(--field-pad-x);background-color:var(--_trigger-bg-color);border:var(--border-width-default) solid var(--_trigger-border-color);border-radius:var(--_trigger-radius);color:var(--_trigger-text-color);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);cursor:pointer;transition:border-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard)}.field-trigger:hover:not(.disabled){border-color:var(--border-strong)}@media not (forced-colors:active){.field-trigger.open,.field-trigger:focus-visible{outline:none}}.field-trigger.open,.field-trigger:focus-visible{border-color:var(--_trigger-border-color-focus);box-shadow:var(--accent-focus-field)}.field-trigger.disabled{background-color:var(--surface-muted);color:var(--text-disabled);cursor:not-allowed}.label{--_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));--_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));--_field-label-color: var(--ds-field-label-color, var(--text-secondary));--_field-label-transform: var(--ds-field-label-transform, none);--_field-label-tracking: var(--ds-field-label-tracking, normal);display:flex;align-items:center;gap:var(--field-gap-req);font:var(--_field-label-weight) var(--_field-label-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-label-color);text-transform:var(--_field-label-transform);letter-spacing:var(--_field-label-tracking)}.label .req{color:var(--error);font-weight:var(--font-weight-semibold)}.label .optional-marker{color:var(--text-tertiary);font-weight:var(--font-weight-regular)}.placeholder{color:var(--text-tertiary)}.chip-row{display:contents}.chip-row.fit{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;overflow:hidden;gap:inherit}.chip-row.fit>*{flex:0 1 auto;min-width:0;white-space:nowrap}.overflow{color:var(--text-secondary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-xs)}.chevron{margin-left:auto;color:var(--text-tertiary)}.dropdown-panel{--ds-option-bg-color-active: var( --ds-multi-select-option-bg-color-active, var(--surface-secondary) );--_check-bg-color: var(--ds-multi-select-check-bg-color, var(--accent))}.search-row{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);border-bottom:var(--border-width-default) solid var(--border-divider)}.search-row:focus-within{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:calc(-1 * var(--focus-ring-width));animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@media not (forced-colors:active){.search-row .search-input:where(:focus-visible){outline:none}}.search-icon{color:var(--text-tertiary);flex:none}.search-input{flex:1;min-width:0;border:0;background:transparent;color:var(--text-primary);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans)}.select-all-label{min-width:0;overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap}.select-all{display:flex;align-items:center;gap:var(--ds-option-gap, var(--space-2));width:100%;padding:var(--ds-option-padding, var(--space-2) var(--space-2-5));border:0;border-bottom:var(--border-width-default) solid var(--border-divider);border-radius:var(--ds-radius-inner) var(--ds-radius-inner) 0 0;background:transparent;color:var(--text-secondary);font:var(--font-weight-semibold) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);text-transform:uppercase;letter-spacing:var(--letter-spacing-wide);text-align:left;cursor:pointer}.select-all:hover:not(:disabled){background-color:var(--surface-secondary)}.select-all:disabled{color:var(--text-disabled);cursor:not-allowed}.checkbox{display:inline-flex;align-items:center;justify-content:center;flex:none;width:var(--check-size);height:var(--check-size);border-radius:var(--ds-radius-inner);border:var(--check-bw) solid var(--border-strong);background-color:var(--surface-default);color:var(--text-on-primary)}.checkbox.checked,.checkbox.indeterminate{background-color:var(--_check-bg-color);border-color:var(--_check-bg-color)}.checkbox .tick{--_check-mark-enter-duration: var(--ds-check-mark-enter-duration, var(--ds-motion-check-enter-duration));--_check-mark-enter-easing: var(--ds-check-mark-enter-easing, var(--ds-motion-check-enter-easing));--_check-mark-exit-duration: var(--ds-check-mark-exit-duration, var(--ds-motion-check-exit-duration));--_check-mark-exit-easing: var(--ds-check-mark-exit-easing, var(--ds-motion-check-exit-easing));width:var(--check-tick-size);height:var(--check-tick-size);transform:scale(.6);opacity:0;transform-origin:center;transition:transform var(--_check-mark-exit-duration) var(--_check-mark-exit-easing),opacity var(--_check-mark-exit-duration) var(--_check-mark-exit-easing);background-color:currentcolor}@media(forced-colors:active){.checkbox .tick{background-color:CanvasText}}.checkbox .tick{-webkit-mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat;mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat}.checkbox.checked .tick,.checkbox.indeterminate .tick{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing)}.checkbox.indeterminate .tick{width:var(--check-indet-w);height:var(--check-indet-h);border-radius:var(--ds-radius-inner);-webkit-mask:none;mask:none}:host([data-field-state=error]:not(.in-group)) .field-trigger{border-color:var(--error);background-color:var(--error-subtitle)}:host([data-field-state=error]:not(.in-group)) .field-trigger:focus-within,:host([data-field-state=error]:not(.in-group)) .field-trigger:focus-visible{box-shadow:var(--ds-field-focus-shadow-error)}:host([data-field-state=warning]:not(.in-group)) .field-trigger{border-color:var(--warning-text)}:host([data-field-state=success]:not(.in-group)) .field-trigger{border-color:var(--success)}\n"] }]
|
|
597
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], readonlyBinding: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], filterWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterWith", required: false }] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], scrollActiveIntoView: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollActiveIntoView", required: false }] }], maxVisibleChips: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisibleChips", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], success: [{ type: i0.Input, args: [{ isSignal: true, alias: "success", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], triggerDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerDisplay", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], selectAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectAll", required: false }] }], optionTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsOptionTemplateDirective), { ...{
|
|
598
|
+
read: TemplateRef,
|
|
599
|
+
}, isSignal: true }] }], chipTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsChipTemplateDirective), { ...{
|
|
600
|
+
read: TemplateRef,
|
|
601
|
+
}, isSignal: true }] }], pickerTrigger: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsPickerTriggerDirective), { ...{
|
|
602
|
+
read: TemplateRef,
|
|
603
|
+
}, isSignal: true }] }], panelHeaderTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsPanelHeaderTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], panelFooterTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsPanelFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], groupLabelTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsGroupLabelTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], emptyTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DsEmptyTemplateDirective), { ...{
|
|
604
|
+
read: TemplateRef,
|
|
605
|
+
}, isSignal: true }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], searchInput: [{ type: i0.ViewChild, args: ['search', { isSignal: true }] }], panelTpl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], chipRow: [{ type: i0.ViewChild, args: ['chipRow', { isSignal: true }] }] } });
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Generated bundle index. Do not edit.
|
|
609
|
+
*/
|
|
610
|
+
|
|
611
|
+
export { MultiSelectComponent };
|
|
612
|
+
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-multi-select.mjs.map
|