@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,164 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { inject, TemplateRef, input, Directive, isDevMode, contentChildren, viewChild, signal, computed, effect, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
4
|
+
import { ButtonComponent } from '@ids-group-ltd/ids-design-system/components/button';
|
|
5
|
+
import { PopoverComponent } from '@ids-group-ltd/ids-design-system/components/popover';
|
|
6
|
+
import { ProjectionDroppedDirective } from '@ids-group-ltd/ids-design-system/components';
|
|
7
|
+
|
|
8
|
+
/** Width assumed for a filter that declares none — roughly a `ds-select`. */
|
|
9
|
+
const DEFAULT_ITEM_WIDTH = 180;
|
|
10
|
+
function toWidth(value) {
|
|
11
|
+
const width = Number(value);
|
|
12
|
+
return Number.isFinite(width) && width > 0 ? width : DEFAULT_ITEM_WIDTH;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* One filter inside `ds-filter-bar`, with the width it should occupy:
|
|
16
|
+
* `<ng-template [dsFilterItem]="220"> <ds-date-picker … /> </ng-template>`.
|
|
17
|
+
*
|
|
18
|
+
* A template rather than plain projection because the bar has to MOVE the filters
|
|
19
|
+
* that do not fit into its overflow panel, and projected DOM cannot be relocated
|
|
20
|
+
* — it renders where it was projected. The cost is that crossing the boundary
|
|
21
|
+
* destroys and re-creates the view, so a control's internal state (an open panel,
|
|
22
|
+
* focus) does not survive a resize that collapses it. Its VALUE does: that lives
|
|
23
|
+
* in the consumer's own signal or form control.
|
|
24
|
+
*
|
|
25
|
+
* The width is a contract, not a hint — the bar sizes the slot to exactly this
|
|
26
|
+
* and decides the split from it, so a control that would render wider is
|
|
27
|
+
* narrowed rather than allowed to break the row.
|
|
28
|
+
*/
|
|
29
|
+
class FilterItemDirective {
|
|
30
|
+
template = inject(TemplateRef);
|
|
31
|
+
/** Slot width in px. Bare `dsFilterItem` (or a non-positive value) means 180. */
|
|
32
|
+
width = input(DEFAULT_ITEM_WIDTH, { ...(ngDevMode ? { debugName: "width" } : /* istanbul ignore next */ {}), alias: 'dsFilterItem',
|
|
33
|
+
transform: toWidth });
|
|
34
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: FilterItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
35
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.22", type: FilterItemDirective, isStandalone: true, selector: "ng-template[dsFilterItem]", inputs: { width: { classPropertyName: "width", publicName: "dsFilterItem", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
36
|
+
}
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: FilterItemDirective, decorators: [{
|
|
38
|
+
type: Directive,
|
|
39
|
+
args: [{
|
|
40
|
+
selector: 'ng-template[dsFilterItem]',
|
|
41
|
+
standalone: true,
|
|
42
|
+
}]
|
|
43
|
+
}], propDecorators: { width: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsFilterItem", required: false }] }] } });
|
|
44
|
+
|
|
45
|
+
// Room kept for the "+N more" trigger, which only exists once something has
|
|
46
|
+
// already collapsed. Measuring the real button would need it rendered first, and
|
|
47
|
+
// its width then feeds back into the count that decides whether it renders at
|
|
48
|
+
// all — a loop. A constant costs nothing: inline slots may shrink, so a longer
|
|
49
|
+
// translation of the label takes space from them instead of breaking the row.
|
|
50
|
+
const MORE_TRIGGER_WIDTH = 132;
|
|
51
|
+
/**
|
|
52
|
+
* Priority+ filter row: renders as many filters as fit and collapses the rest
|
|
53
|
+
* into a "+N more" panel. Every admin list past three filters hits the same wall
|
|
54
|
+
* — the row wraps to a second line on a laptop, or the consumer hand-rolls this.
|
|
55
|
+
*
|
|
56
|
+
* The split is decided from each item's declared width plus one `ResizeObserver`
|
|
57
|
+
* on the row, never by measuring the filters themselves: they would have to be in
|
|
58
|
+
* the DOM to be measured, so anything that did not fit would flash before being
|
|
59
|
+
* taken away. `[dsFilterItem]` carries the width.
|
|
60
|
+
*
|
|
61
|
+
* Anything marked `dsFilterBarTrailing` — search, a Clear button — sits at the
|
|
62
|
+
* trailing edge and never collapses. Mark each control rather than wrapping them:
|
|
63
|
+
* the bar owns that row's gap and alignment, and a projected wrapper would be a
|
|
64
|
+
* plain block whose children stack. The trailing group is outside the measured
|
|
65
|
+
* row, so flexbox subtracts its width before the row is measured and the
|
|
66
|
+
* arithmetic needs no allowance for it.
|
|
67
|
+
*
|
|
68
|
+
* ```html
|
|
69
|
+
* <ds-filter-bar>
|
|
70
|
+
* <ng-template [dsFilterItem]="180">
|
|
71
|
+
* <ds-select label="Status" … />
|
|
72
|
+
* </ng-template>
|
|
73
|
+
* <ng-template [dsFilterItem]="220">
|
|
74
|
+
* <ds-date-picker label="Opened" … />
|
|
75
|
+
* </ng-template>
|
|
76
|
+
*
|
|
77
|
+
* <ds-search dsFilterBarTrailing … />
|
|
78
|
+
* <ds-button dsFilterBarTrailing variant="text">Clear</ds-button>
|
|
79
|
+
* </ds-filter-bar>
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
class FilterBarComponent {
|
|
83
|
+
/** Trailing word of the trigger, after the count: "+2 filters". */
|
|
84
|
+
moreLabel = input('more', ...(ngDevMode ? [{ debugName: "moreLabel" }] : /* istanbul ignore next */ []));
|
|
85
|
+
/** Accessible name of the overflow panel. */
|
|
86
|
+
panelLabel = input('More filters', ...(ngDevMode ? [{ debugName: "panelLabel" }] : /* istanbul ignore next */ []));
|
|
87
|
+
/** Height of the "+N" trigger, to match the filters beside it. The bar cannot
|
|
88
|
+
* infer this: `dsFilterItem` carries a WIDTH, and the filters are arbitrary
|
|
89
|
+
* projected controls whose own `size` it never sees — so a row of `sm` filters
|
|
90
|
+
* got an `md` trigger standing 8px taller under `align-items: flex-end`. */
|
|
91
|
+
triggerSize = input('md', ...(ngDevMode ? [{ debugName: "triggerSize" }] : /* istanbul ignore next */ []));
|
|
92
|
+
devMode = isDevMode();
|
|
93
|
+
// descendants: true so a filter wrapped in @if or @for is still found — those
|
|
94
|
+
// put it in an embedded view, which a direct-children query does not reach.
|
|
95
|
+
items = contentChildren(FilterItemDirective, { ...(ngDevMode ? { debugName: "items" } : /* istanbul ignore next */ {}), descendants: true });
|
|
96
|
+
row = viewChild('row', ...(ngDevMode ? [{ debugName: "row" }] : /* istanbul ignore next */ []));
|
|
97
|
+
rowWidth = signal(0, ...(ngDevMode ? [{ debugName: "rowWidth" }] : /* istanbul ignore next */ []));
|
|
98
|
+
// Read off the row rather than hard-coded, so retuning --ds-filter-bar-gap
|
|
99
|
+
// cannot silently desynchronise the arithmetic from what is rendered.
|
|
100
|
+
gap = signal(0, ...(ngDevMode ? [{ debugName: "gap" }] : /* istanbul ignore next */ []));
|
|
101
|
+
inlineCount = computed(() => {
|
|
102
|
+
const items = this.items();
|
|
103
|
+
const available = this.rowWidth();
|
|
104
|
+
if (!available) {
|
|
105
|
+
return items.length;
|
|
106
|
+
}
|
|
107
|
+
const gap = this.gap();
|
|
108
|
+
const total = items.reduce((sum, item, index) => sum + (index > 0 ? gap : 0) + item.width(), 0);
|
|
109
|
+
if (total <= available) {
|
|
110
|
+
return items.length;
|
|
111
|
+
}
|
|
112
|
+
// Only now is the trigger certain to render, so only now does it cost room.
|
|
113
|
+
const budget = available - MORE_TRIGGER_WIDTH - gap;
|
|
114
|
+
let used = 0;
|
|
115
|
+
let count = 0;
|
|
116
|
+
for (const item of items) {
|
|
117
|
+
used += (count > 0 ? gap : 0) + item.width();
|
|
118
|
+
if (used > budget) {
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
count++;
|
|
122
|
+
}
|
|
123
|
+
return count;
|
|
124
|
+
}, ...(ngDevMode ? [{ debugName: "inlineCount" }] : /* istanbul ignore next */ []));
|
|
125
|
+
inline = computed(() => this.items().slice(0, this.inlineCount()), ...(ngDevMode ? [{ debugName: "inline" }] : /* istanbul ignore next */ []));
|
|
126
|
+
/** The filters currently in the overflow panel. */
|
|
127
|
+
collapsed = computed(() => this.items().slice(this.inlineCount()), ...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
|
|
128
|
+
constructor() {
|
|
129
|
+
effect((onCleanup) => {
|
|
130
|
+
const row = this.row()?.nativeElement;
|
|
131
|
+
if (!row) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const measure = () => {
|
|
135
|
+
this.rowWidth.set(row.clientWidth);
|
|
136
|
+
this.gap.set(parseFloat(getComputedStyle(row).columnGap) || 0);
|
|
137
|
+
};
|
|
138
|
+
measure();
|
|
139
|
+
const observer = new ResizeObserver(measure);
|
|
140
|
+
observer.observe(row);
|
|
141
|
+
onCleanup(() => observer.disconnect());
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: FilterBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
145
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: FilterBarComponent, isStandalone: true, selector: "ds-filter-bar", inputs: { moreLabel: { classPropertyName: "moreLabel", publicName: "moreLabel", isSignal: true, isRequired: false, transformFunction: null }, panelLabel: { classPropertyName: "panelLabel", publicName: "panelLabel", isSignal: true, isRequired: false, transformFunction: null }, triggerSize: { classPropertyName: "triggerSize", publicName: "triggerSize", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "items", predicate: FilterItemDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "row", first: true, predicate: ["row"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n #row\n class=\"row\">\n @for (item of inline(); track item) {\n <div\n class=\"item\"\n [style.width.px]=\"item.width()\">\n <ng-container [ngTemplateOutlet]=\"item.template\" />\n </div>\n }\n\n @if (collapsed().length) {\n <ds-button\n #moreTrigger\n class=\"more\"\n color=\"neutral\"\n variant=\"outline\"\n icon=\"filter\"\n [size]=\"triggerSize()\"\n [ariaExpanded]=\"more.opened()\"\n (pressed)=\"more.toggle(moreTrigger.buttonRef().nativeElement)\">\n +{{ collapsed().length }} {{ moreLabel() }}\n </ds-button>\n\n <ds-popover\n #more\n align=\"end\"\n panelRole=\"dialog\"\n [panelLabel]=\"panelLabel()\">\n <div class=\"panel\">\n @for (item of collapsed(); track item) {\n <div\n class=\"item\"\n [style.width.px]=\"item.width()\">\n <ng-container [ngTemplateOutlet]=\"item.template\" />\n </div>\n }\n </div>\n </ds-popover>\n }\n</div>\n\n<div class=\"trailing\">\n <ng-content select=\"[dsFilterBarTrailing]\"></ng-content>\n</div>\n\n@if (devMode) {\n <span\n dsProjectionDropped=\"ds-filter-bar\"\n reason='a filter belongs in an <ng-template [dsFilterItem]=\"width\">, and anything else needs the dsFilterBarTrailing attribute to reach the trailing edge. Content carrying neither is not rendered.'>\n <ng-content></ng-content>\n </span>\n}\n", styles: ["@charset \"UTF-8\";:host{--_filter-bar-gap: var(--ds-filter-bar-gap, var(--space-3));--_filter-bar-panel-gap: var(--ds-filter-bar-panel-gap, var(--space-4));display:flex;align-items:flex-end;gap:var(--_filter-bar-gap)}.row{display:flex;flex:1 1 auto;align-items:flex-end;gap:var(--_filter-bar-gap);min-width:0;overflow:clip;overflow-clip-margin:4px}.row:not(:has(*)){display:none}.item{flex:0 1 auto;min-width:0}.more{flex:0 0 auto}.panel{display:flex;flex-direction:column;gap:var(--_filter-bar-panel-gap)}.trailing{display:flex;flex:0 0 auto;align-items:flex-end;gap:var(--_filter-bar-gap);margin-left:auto}.trailing:not(:has(*)){display:none}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ButtonComponent, selector: "ds-button", inputs: ["color", "variant", "size", "type", "disabled", "loading", "fullWidth", "ariaLabel", "icon", "trailingIcon", "ariaHasPopup", "ariaExpanded", "ariaControls", "disabledReason", "ariaDescribedBy"], outputs: ["pressed"] }, { kind: "component", type: PopoverComponent, selector: "ds-popover", inputs: ["align", "placement", "arrow", "panelRole", "panelLabel"] }, { kind: "directive", type: ProjectionDroppedDirective, selector: "[dsProjectionDropped]", inputs: ["dsProjectionDropped", "reason"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
146
|
+
}
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: FilterBarComponent, decorators: [{
|
|
148
|
+
type: Component,
|
|
149
|
+
args: [{ selector: 'ds-filter-bar', standalone: true, imports: [
|
|
150
|
+
NgTemplateOutlet,
|
|
151
|
+
ButtonComponent,
|
|
152
|
+
PopoverComponent,
|
|
153
|
+
ProjectionDroppedDirective,
|
|
154
|
+
], encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n #row\n class=\"row\">\n @for (item of inline(); track item) {\n <div\n class=\"item\"\n [style.width.px]=\"item.width()\">\n <ng-container [ngTemplateOutlet]=\"item.template\" />\n </div>\n }\n\n @if (collapsed().length) {\n <ds-button\n #moreTrigger\n class=\"more\"\n color=\"neutral\"\n variant=\"outline\"\n icon=\"filter\"\n [size]=\"triggerSize()\"\n [ariaExpanded]=\"more.opened()\"\n (pressed)=\"more.toggle(moreTrigger.buttonRef().nativeElement)\">\n +{{ collapsed().length }} {{ moreLabel() }}\n </ds-button>\n\n <ds-popover\n #more\n align=\"end\"\n panelRole=\"dialog\"\n [panelLabel]=\"panelLabel()\">\n <div class=\"panel\">\n @for (item of collapsed(); track item) {\n <div\n class=\"item\"\n [style.width.px]=\"item.width()\">\n <ng-container [ngTemplateOutlet]=\"item.template\" />\n </div>\n }\n </div>\n </ds-popover>\n }\n</div>\n\n<div class=\"trailing\">\n <ng-content select=\"[dsFilterBarTrailing]\"></ng-content>\n</div>\n\n@if (devMode) {\n <span\n dsProjectionDropped=\"ds-filter-bar\"\n reason='a filter belongs in an <ng-template [dsFilterItem]=\"width\">, and anything else needs the dsFilterBarTrailing attribute to reach the trailing edge. Content carrying neither is not rendered.'>\n <ng-content></ng-content>\n </span>\n}\n", styles: ["@charset \"UTF-8\";:host{--_filter-bar-gap: var(--ds-filter-bar-gap, var(--space-3));--_filter-bar-panel-gap: var(--ds-filter-bar-panel-gap, var(--space-4));display:flex;align-items:flex-end;gap:var(--_filter-bar-gap)}.row{display:flex;flex:1 1 auto;align-items:flex-end;gap:var(--_filter-bar-gap);min-width:0;overflow:clip;overflow-clip-margin:4px}.row:not(:has(*)){display:none}.item{flex:0 1 auto;min-width:0}.more{flex:0 0 auto}.panel{display:flex;flex-direction:column;gap:var(--_filter-bar-panel-gap)}.trailing{display:flex;flex:0 0 auto;align-items:flex-end;gap:var(--_filter-bar-gap);margin-left:auto}.trailing:not(:has(*)){display:none}\n"] }]
|
|
155
|
+
}], ctorParameters: () => [], propDecorators: { moreLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "moreLabel", required: false }] }], panelLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelLabel", required: false }] }], triggerSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerSize", required: false }] }], items: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => FilterItemDirective), { ...{
|
|
156
|
+
descendants: true,
|
|
157
|
+
}, isSignal: true }] }], row: [{ type: i0.ViewChild, args: ['row', { isSignal: true }] }] } });
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Generated bundle index. Do not edit.
|
|
161
|
+
*/
|
|
162
|
+
|
|
163
|
+
export { FilterBarComponent, FilterItemDirective };
|
|
164
|
+
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-filter-bar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-filter-bar.mjs","sources":["../../../src/lib/components/filter-bar/filter-item.directive.ts","../../../src/lib/components/filter-bar/filter-bar.component.ts","../../../src/lib/components/filter-bar/filter-bar.component.html","../../../src/lib/components/filter-bar/ids-group-ltd-ids-design-system-components-filter-bar.ts"],"sourcesContent":["import { Directive, TemplateRef, inject, input } from '@angular/core';\n\n/** Width assumed for a filter that declares none — roughly a `ds-select`. */\nconst DEFAULT_ITEM_WIDTH = 180;\n\nfunction toWidth(value: unknown): number {\n const width = Number(value);\n\n return Number.isFinite(width) && width > 0 ? width : DEFAULT_ITEM_WIDTH;\n}\n\n/**\n * One filter inside `ds-filter-bar`, with the width it should occupy:\n * `<ng-template [dsFilterItem]=\"220\"> <ds-date-picker … /> </ng-template>`.\n *\n * A template rather than plain projection because the bar has to MOVE the filters\n * that do not fit into its overflow panel, and projected DOM cannot be relocated\n * — it renders where it was projected. The cost is that crossing the boundary\n * destroys and re-creates the view, so a control's internal state (an open panel,\n * focus) does not survive a resize that collapses it. Its VALUE does: that lives\n * in the consumer's own signal or form control.\n *\n * The width is a contract, not a hint — the bar sizes the slot to exactly this\n * and decides the split from it, so a control that would render wider is\n * narrowed rather than allowed to break the row.\n */\n@Directive({\n selector: 'ng-template[dsFilterItem]',\n standalone: true,\n})\nexport class FilterItemDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n\n /** Slot width in px. Bare `dsFilterItem` (or a non-positive value) means 180. */\n readonly width = input(DEFAULT_ITEM_WIDTH, {\n alias: 'dsFilterItem',\n transform: toWidth,\n });\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n contentChildren,\n effect,\n input,\n isDevMode,\n signal,\n viewChild,\n} from '@angular/core';\nimport { ButtonComponent } from '@ids-group-ltd/ids-design-system/components/button';\nimport { PopoverComponent } from '@ids-group-ltd/ids-design-system/components/popover';\nimport { ProjectionDroppedDirective } from '@ids-group-ltd/ids-design-system/components';\nimport type { DsSize } from '@ids-group-ltd/ids-design-system/core';\nimport { FilterItemDirective } from './filter-item.directive';\n\n// Room kept for the \"+N more\" trigger, which only exists once something has\n// already collapsed. Measuring the real button would need it rendered first, and\n// its width then feeds back into the count that decides whether it renders at\n// all — a loop. A constant costs nothing: inline slots may shrink, so a longer\n// translation of the label takes space from them instead of breaking the row.\nconst MORE_TRIGGER_WIDTH = 132;\n\n/**\n * Priority+ filter row: renders as many filters as fit and collapses the rest\n * into a \"+N more\" panel. Every admin list past three filters hits the same wall\n * — the row wraps to a second line on a laptop, or the consumer hand-rolls this.\n *\n * The split is decided from each item's declared width plus one `ResizeObserver`\n * on the row, never by measuring the filters themselves: they would have to be in\n * the DOM to be measured, so anything that did not fit would flash before being\n * taken away. `[dsFilterItem]` carries the width.\n *\n * Anything marked `dsFilterBarTrailing` — search, a Clear button — sits at the\n * trailing edge and never collapses. Mark each control rather than wrapping them:\n * the bar owns that row's gap and alignment, and a projected wrapper would be a\n * plain block whose children stack. The trailing group is outside the measured\n * row, so flexbox subtracts its width before the row is measured and the\n * arithmetic needs no allowance for it.\n *\n * ```html\n * <ds-filter-bar>\n * <ng-template [dsFilterItem]=\"180\">\n * <ds-select label=\"Status\" … />\n * </ng-template>\n * <ng-template [dsFilterItem]=\"220\">\n * <ds-date-picker label=\"Opened\" … />\n * </ng-template>\n *\n * <ds-search dsFilterBarTrailing … />\n * <ds-button dsFilterBarTrailing variant=\"text\">Clear</ds-button>\n * </ds-filter-bar>\n * ```\n */\n@Component({\n selector: 'ds-filter-bar',\n standalone: true,\n imports: [\n NgTemplateOutlet,\n ButtonComponent,\n PopoverComponent,\n ProjectionDroppedDirective,\n ],\n templateUrl: './filter-bar.component.html',\n styleUrl: './filter-bar.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FilterBarComponent {\n /** Trailing word of the trigger, after the count: \"+2 filters\". */\n readonly moreLabel = input<string>('more');\n /** Accessible name of the overflow panel. */\n readonly panelLabel = input<string>('More filters');\n /** Height of the \"+N\" trigger, to match the filters beside it. The bar cannot\n * infer this: `dsFilterItem` carries a WIDTH, and the filters are arbitrary\n * projected controls whose own `size` it never sees — so a row of `sm` filters\n * got an `md` trigger standing 8px taller under `align-items: flex-end`. */\n readonly triggerSize = input<DsSize>('md');\n\n protected readonly devMode = isDevMode();\n\n // descendants: true so a filter wrapped in @if or @for is still found — those\n // put it in an embedded view, which a direct-children query does not reach.\n protected readonly items = contentChildren(FilterItemDirective, {\n descendants: true,\n });\n\n private readonly row = viewChild<ElementRef<HTMLElement>>('row');\n private readonly rowWidth = signal(0);\n // Read off the row rather than hard-coded, so retuning --ds-filter-bar-gap\n // cannot silently desynchronise the arithmetic from what is rendered.\n private readonly gap = signal(0);\n\n protected readonly inlineCount = computed<number>(() => {\n const items = this.items();\n const available = this.rowWidth();\n if (!available) {\n return items.length;\n }\n\n const gap = this.gap();\n const total = items.reduce(\n (sum, item, index) => sum + (index > 0 ? gap : 0) + item.width(),\n 0,\n );\n if (total <= available) {\n return items.length;\n }\n\n // Only now is the trigger certain to render, so only now does it cost room.\n const budget = available - MORE_TRIGGER_WIDTH - gap;\n let used = 0;\n let count = 0;\n for (const item of items) {\n used += (count > 0 ? gap : 0) + item.width();\n if (used > budget) {\n break;\n }\n count++;\n }\n\n return count;\n });\n\n protected readonly inline = computed(() =>\n this.items().slice(0, this.inlineCount()),\n );\n\n /** The filters currently in the overflow panel. */\n readonly collapsed = computed(() => this.items().slice(this.inlineCount()));\n\n constructor() {\n effect((onCleanup) => {\n const row = this.row()?.nativeElement;\n if (!row) {\n return;\n }\n\n const measure = (): void => {\n this.rowWidth.set(row.clientWidth);\n this.gap.set(parseFloat(getComputedStyle(row).columnGap) || 0);\n };\n\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(row);\n onCleanup(() => observer.disconnect());\n });\n }\n}\n","<div\n #row\n class=\"row\">\n @for (item of inline(); track item) {\n <div\n class=\"item\"\n [style.width.px]=\"item.width()\">\n <ng-container [ngTemplateOutlet]=\"item.template\" />\n </div>\n }\n\n @if (collapsed().length) {\n <ds-button\n #moreTrigger\n class=\"more\"\n color=\"neutral\"\n variant=\"outline\"\n icon=\"filter\"\n [size]=\"triggerSize()\"\n [ariaExpanded]=\"more.opened()\"\n (pressed)=\"more.toggle(moreTrigger.buttonRef().nativeElement)\">\n +{{ collapsed().length }} {{ moreLabel() }}\n </ds-button>\n\n <ds-popover\n #more\n align=\"end\"\n panelRole=\"dialog\"\n [panelLabel]=\"panelLabel()\">\n <div class=\"panel\">\n @for (item of collapsed(); track item) {\n <div\n class=\"item\"\n [style.width.px]=\"item.width()\">\n <ng-container [ngTemplateOutlet]=\"item.template\" />\n </div>\n }\n </div>\n </ds-popover>\n }\n</div>\n\n<div class=\"trailing\">\n <ng-content select=\"[dsFilterBarTrailing]\"></ng-content>\n</div>\n\n@if (devMode) {\n <span\n dsProjectionDropped=\"ds-filter-bar\"\n reason='a filter belongs in an <ng-template [dsFilterItem]=\"width\">, and anything else needs the dsFilterBarTrailing attribute to reach the trailing edge. Content carrying neither is not rendered.'>\n <ng-content></ng-content>\n </span>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEA;AACA,MAAM,kBAAkB,GAAG,GAAG;AAE9B,SAAS,OAAO,CAAC,KAAc,EAAA;AAC7B,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AAE3B,IAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,kBAAkB;AACzE;AAEA;;;;;;;;;;;;;;AAcG;MAKU,mBAAmB,CAAA;AACrB,IAAA,QAAQ,GAAG,MAAM,CAAuB,WAAW,CAAC;;AAGpD,IAAA,KAAK,GAAG,KAAK,CAAC,kBAAkB,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,OAAA,EAAA,8BAAA,EAAA,CAAA,EACvC,KAAK,EAAE,cAAc;QACrB,SAAS,EAAE,OAAO,EAAA,CAClB;wGAPS,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAnB,mBAAmB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,2BAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,cAAA,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
3
|
+
import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
|
|
4
|
+
import { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Icon-only action button with its own variant taxonomy (standard / filled /
|
|
8
|
+
* tonal / outlined) + an optional toggle (`selected`) state. Distinct from
|
|
9
|
+
* `ds-button` — use this for square/round icon affordances; use `ds-button`
|
|
10
|
+
* for labelled actions. `ariaLabel` is REQUIRED (icon-only has no text label).
|
|
11
|
+
*/
|
|
12
|
+
class IconButtonComponent {
|
|
13
|
+
/** Icon to render — the button's only visible content. */
|
|
14
|
+
icon = input.required(...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
15
|
+
/** Accessible name — required since the button has no visible text. */
|
|
16
|
+
ariaLabel = input.required(...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
17
|
+
/** ARIA `aria-describedby` — the id of text the app renders beside the button,
|
|
18
|
+
* such as why the action is refused. Icon-only leaves no room for a second
|
|
19
|
+
* line, so unlike `ds-button` there is no `disabledReason` here: the text has
|
|
20
|
+
* to exist on screen already for this to point at it. */
|
|
21
|
+
ariaDescribedBy = input(null, ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : /* istanbul ignore next */ []));
|
|
22
|
+
/** Fill style — standard (chromeless), filled, tonal, or outlined. */
|
|
23
|
+
variant = input('standard', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
24
|
+
/** Brand/status hue family (shared with ds-button). `variant` is the fill
|
|
25
|
+
axis; `color` recolours the accent the fill consumes. Default primary. */
|
|
26
|
+
color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
27
|
+
/** Button size — sm/md/lg, matches the field/button height scale.
|
|
28
|
+
* Unset falls back to `DS_CONFIG.control.size`, then `'md'`. */
|
|
29
|
+
size = input(null, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
30
|
+
sizeResolved = resolveWithConfig(this.size, (config) => config.control?.size, 'md');
|
|
31
|
+
/** Native `<button>` `type`; defaults to `'button'` (not `'submit'`) so it never submits an ancestor form by accident. */
|
|
32
|
+
type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
33
|
+
/** Disables the button and blocks `pressed`. */
|
|
34
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
35
|
+
/** Toggle state — renders the pressed/active look and sets aria-pressed. */
|
|
36
|
+
selected = input(false, { ...(ngDevMode ? { debugName: "selected" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
37
|
+
/** ARIA `aria-expanded`, forwarded to the inner `<button>` — bind to the open
|
|
38
|
+
* state when this button opens a panel. On the host element it would land on
|
|
39
|
+
* a non-focusable wrapper, which no screen reader reads. */
|
|
40
|
+
ariaExpanded = input(null, ...(ngDevMode ? [{ debugName: "ariaExpanded" }] : /* istanbul ignore next */ []));
|
|
41
|
+
/** ARIA `aria-controls`, forwarded to the inner `<button>` — the id of the
|
|
42
|
+
* panel this button opens, e.g. `ds-app-layout`'s `railId`. */
|
|
43
|
+
ariaControls = input(null, ...(ngDevMode ? [{ debugName: "ariaControls" }] : /* istanbul ignore next */ []));
|
|
44
|
+
/** Fires on click, unless disabled. */
|
|
45
|
+
pressed = output();
|
|
46
|
+
classes = computed(() => {
|
|
47
|
+
const parts = ['icon-button', this.variant(), this.sizeResolved()];
|
|
48
|
+
if (this.color() !== 'primary') {
|
|
49
|
+
parts.push(`c-${this.color()}`);
|
|
50
|
+
}
|
|
51
|
+
if (this.selected()) {
|
|
52
|
+
parts.push('selected');
|
|
53
|
+
}
|
|
54
|
+
return parts.join(' ');
|
|
55
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
56
|
+
iconSize = computed(() => {
|
|
57
|
+
const size = this.sizeResolved();
|
|
58
|
+
if (size === 'sm') {
|
|
59
|
+
return 16;
|
|
60
|
+
}
|
|
61
|
+
if (size === 'lg') {
|
|
62
|
+
return 24;
|
|
63
|
+
}
|
|
64
|
+
return 20;
|
|
65
|
+
}, ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
66
|
+
onClick(event) {
|
|
67
|
+
if (this.disabled()) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
this.pressed.emit(event);
|
|
71
|
+
}
|
|
72
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: IconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
73
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: IconButtonComponent, isStandalone: true, selector: "ds-icon-button", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: true, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, ariaExpanded: { classPropertyName: "ariaExpanded", publicName: "ariaExpanded", isSignal: true, isRequired: false, transformFunction: null }, ariaControls: { classPropertyName: "ariaControls", publicName: "ariaControls", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressed" }, ngImport: i0, template: "<button\n [class]=\"classes()\"\n [type]=\"type()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-pressed]=\"selected() ? true : null\"\n [attr.aria-expanded]=\"ariaExpanded()\"\n [attr.aria-controls]=\"ariaControls()\"\n (click)=\"onClick($event)\">\n <ds-icon\n [name]=\"icon()\"\n [size]=\"iconSize()\" />\n</button>\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:inline-flex}.icon-button{--c-base: var(--accent);--c-on: var(--accent-on);--c-strong: var(--accent-strong);--c-subtitle: var(--accent-subtitle);--c-muted: var(--accent-muted);--c-muted-strong: var(--accent-muted-strong);--_icon-button-bg-color: var(--ds-icon-button-bg-color, transparent);--_icon-button-icon-color: var(--ds-icon-button-icon-color, var(--text-secondary));--_icon-button-border: var(--ds-icon-button-border, transparent);--_icon-button-bg-color-hover: var(--ds-icon-button-bg-color-hover, var(--surface-muted));--_icon-button-bg-color-active: var(--ds-icon-button-bg-color-active, var(--_icon-button-bg-color-hover));--_icon-button-icon-color-hover: var(--ds-icon-button-icon-color-hover, var(--text-primary));--_icon-button-radius: var(--ds-icon-button-radius, var(--ds-radius-control));--_icon-button-press-scale: var(--ds-icon-button-press-scale, .96);--_icon-button-accent: var(--_icon-button-icon-color);--_icon-button-bg-color-disabled: var(--ds-icon-button-bg-color-disabled, transparent);--_icon-button-icon-color-disabled: var(--ds-icon-button-icon-color-disabled, oklch(from var(--_icon-button-accent) 70% .035 h));--_icon-button-border-disabled: var(--ds-icon-button-border-disabled, transparent);--_icon-button-size: var(--ds-icon-button-size, var(--hit-cozy));display:inline-flex;align-items:center;justify-content:center;width:var(--_icon-button-size);height:var(--_icon-button-size);aspect-ratio:1;padding:0;border:var(--border-width-default) solid var(--_icon-button-border);border-radius:var(--_icon-button-radius);background-color:var(--_icon-button-bg-color);color:var(--_icon-button-icon-color);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard),transform var(--duration-instant) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard)}.icon-button:hover{background-color:var(--_icon-button-bg-color-hover);color:var(--_icon-button-icon-color-hover)}.icon-button:active{background-color:var(--_icon-button-bg-color-active);transform:scale(var(--_icon-button-press-scale))}.icon-button: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)}.icon-button[disabled]{background-color:var(--_icon-button-bg-color-disabled);color:var(--_icon-button-icon-color-disabled);border-color:var(--_icon-button-border-disabled);cursor:not-allowed;pointer-events:none}.icon-button.sm{--_icon-button-size: var(--ds-icon-button-size, var(--hit-min));width:var(--_icon-button-size);height:var(--_icon-button-size)}.icon-button.md{--_icon-button-size: var(--ds-icon-button-size, var(--hit-cozy));width:var(--_icon-button-size);height:var(--_icon-button-size)}.icon-button.lg{--_icon-button-size: var(--ds-icon-button-size, var(--field-h-lg));width:var(--_icon-button-size);height:var(--_icon-button-size)}.icon-button.standard{--_icon-button-icon-color-disabled: var(--ds-icon-button-icon-color-disabled, color-mix(in srgb, var(--_icon-button-icon-color) 40%, var(--surface-default)))}.icon-button.filled{--_icon-button-bg-color: var(--ds-icon-button-bg-color, var(--c-base));--_icon-button-icon-color: var(--ds-icon-button-icon-color, var(--c-on));--_icon-button-bg-color-hover: var(--ds-icon-button-bg-color-hover, color-mix(in srgb, var(--_icon-button-bg-color) 88%, black));--_icon-button-bg-color-active: var(--ds-icon-button-bg-color-active, color-mix(in srgb, var(--_icon-button-bg-color) 76%, black));--_icon-button-icon-color-hover: var(--ds-icon-button-icon-color-hover, var(--_icon-button-icon-color));--_icon-button-accent: var(--_icon-button-bg-color);--_icon-button-bg-color-disabled: var(--ds-icon-button-bg-color-disabled, oklch(from var(--_icon-button-accent) 92% .03 h))}.icon-button.tonal{--_icon-button-bg-color: var(--ds-icon-button-bg-color, var(--c-muted));--_icon-button-icon-color: var(--ds-icon-button-icon-color, var(--c-strong));--_icon-button-bg-color-hover: var(--ds-icon-button-bg-color-hover, var(--c-subtitle));--_icon-button-bg-color-active: var(--ds-icon-button-bg-color-active, var(--c-muted-strong));--_icon-button-icon-color-hover: var(--ds-icon-button-icon-color-hover, var(--c-strong));--_icon-button-bg-color-disabled: var(--ds-icon-button-bg-color-disabled, color-mix(in srgb, var(--_icon-button-bg-color) 28%, var(--surface-disabled)))}.icon-button.outlined{--_icon-button-bg-color: var(--ds-icon-button-bg-color, transparent);--_icon-button-icon-color: var(--ds-icon-button-icon-color, var(--text-primary));--_icon-button-border: var(--ds-icon-button-border, var(--border-default));--_icon-button-bg-color-hover: var(--ds-icon-button-bg-color-hover, var(--surface-secondary));--_icon-button-bg-color-active: var(--ds-icon-button-bg-color-active, var(--surface-muted));--_icon-button-icon-color-hover: var(--ds-icon-button-icon-color-hover, var(--text-primary));--_icon-button-bg-color-disabled: var(--ds-icon-button-bg-color-disabled, transparent);--_icon-button-border-disabled: var(--ds-icon-button-border-disabled, color-mix(in srgb, var(--_icon-button-border) 55%, var(--surface-disabled)))}.icon-button.c-secondary{--c-base: var(--secondary);--c-on: var(--secondary-on);--c-strong: var(--secondary-strong);--c-subtitle: var(--secondary-subtitle);--c-muted: var(--secondary-muted);--c-muted-strong: var(--secondary-muted-strong)}.icon-button.c-tertiary{--c-base: var(--tertiary);--c-on: var(--tertiary-on);--c-strong: var(--tertiary-strong);--c-subtitle: var(--tertiary-subtitle);--c-muted: var(--tertiary-muted);--c-muted-strong: var(--tertiary-muted-strong)}.icon-button.c-neutral{--c-base: var(--text-secondary);--c-on: var(--surface-default);--c-strong: var(--text-primary);--c-subtitle: var(--surface-secondary);--c-muted: var(--surface-secondary);--c-muted-strong: var(--border-default)}.icon-button.c-error{--c-base: var(--error);--c-on: var(--text-on-error);--c-strong: var(--error-text);--c-subtitle: var(--error-subtitle);--c-muted: var(--error-muted);--c-muted-strong: var(--error-muted-strong)}.icon-button.c-success{--c-base: var(--success);--c-on: var(--text-on-success);--c-strong: var(--success-text);--c-subtitle: var(--success-subtitle);--c-muted: var(--success-muted);--c-muted-strong: var(--success-muted-strong)}.icon-button.c-warning{--c-base: var(--warning);--c-on: var(--text-on-warning);--c-strong: var(--warning-text);--c-subtitle: var(--warning-subtitle);--c-muted: var(--warning-muted);--c-muted-strong: var(--warning-muted-strong)}.icon-button.selected{--_icon-button-bg-color: var(--ds-icon-button-bg-color, var(--c-base));--_icon-button-icon-color: var(--ds-icon-button-icon-color, var(--c-on));--_icon-button-border: var(--ds-icon-button-border, transparent);--_icon-button-bg-color-hover: var(--ds-icon-button-bg-color-hover, color-mix(in srgb, var(--_icon-button-bg-color) 88%, black));--_icon-button-bg-color-active: var(--ds-icon-button-bg-color-active, color-mix(in srgb, var(--_icon-button-bg-color) 76%, black));--_icon-button-icon-color-hover: var(--ds-icon-button-icon-color-hover, var(--_icon-button-icon-color));--_icon-button-accent: var(--_icon-button-bg-color);--_icon-button-bg-color-disabled: var(--ds-icon-button-bg-color-disabled, oklch(from var(--_icon-button-accent) 92% .03 h))}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
74
|
+
}
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: IconButtonComponent, decorators: [{
|
|
76
|
+
type: Component,
|
|
77
|
+
args: [{ selector: 'ds-icon-button', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<button\n [class]=\"classes()\"\n [type]=\"type()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-pressed]=\"selected() ? true : null\"\n [attr.aria-expanded]=\"ariaExpanded()\"\n [attr.aria-controls]=\"ariaControls()\"\n (click)=\"onClick($event)\">\n <ds-icon\n [name]=\"icon()\"\n [size]=\"iconSize()\" />\n</button>\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:inline-flex}.icon-button{--c-base: var(--accent);--c-on: var(--accent-on);--c-strong: var(--accent-strong);--c-subtitle: var(--accent-subtitle);--c-muted: var(--accent-muted);--c-muted-strong: var(--accent-muted-strong);--_icon-button-bg-color: var(--ds-icon-button-bg-color, transparent);--_icon-button-icon-color: var(--ds-icon-button-icon-color, var(--text-secondary));--_icon-button-border: var(--ds-icon-button-border, transparent);--_icon-button-bg-color-hover: var(--ds-icon-button-bg-color-hover, var(--surface-muted));--_icon-button-bg-color-active: var(--ds-icon-button-bg-color-active, var(--_icon-button-bg-color-hover));--_icon-button-icon-color-hover: var(--ds-icon-button-icon-color-hover, var(--text-primary));--_icon-button-radius: var(--ds-icon-button-radius, var(--ds-radius-control));--_icon-button-press-scale: var(--ds-icon-button-press-scale, .96);--_icon-button-accent: var(--_icon-button-icon-color);--_icon-button-bg-color-disabled: var(--ds-icon-button-bg-color-disabled, transparent);--_icon-button-icon-color-disabled: var(--ds-icon-button-icon-color-disabled, oklch(from var(--_icon-button-accent) 70% .035 h));--_icon-button-border-disabled: var(--ds-icon-button-border-disabled, transparent);--_icon-button-size: var(--ds-icon-button-size, var(--hit-cozy));display:inline-flex;align-items:center;justify-content:center;width:var(--_icon-button-size);height:var(--_icon-button-size);aspect-ratio:1;padding:0;border:var(--border-width-default) solid var(--_icon-button-border);border-radius:var(--_icon-button-radius);background-color:var(--_icon-button-bg-color);color:var(--_icon-button-icon-color);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard),color var(--duration-fast) var(--ease-standard),transform var(--duration-instant) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard)}.icon-button:hover{background-color:var(--_icon-button-bg-color-hover);color:var(--_icon-button-icon-color-hover)}.icon-button:active{background-color:var(--_icon-button-bg-color-active);transform:scale(var(--_icon-button-press-scale))}.icon-button: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)}.icon-button[disabled]{background-color:var(--_icon-button-bg-color-disabled);color:var(--_icon-button-icon-color-disabled);border-color:var(--_icon-button-border-disabled);cursor:not-allowed;pointer-events:none}.icon-button.sm{--_icon-button-size: var(--ds-icon-button-size, var(--hit-min));width:var(--_icon-button-size);height:var(--_icon-button-size)}.icon-button.md{--_icon-button-size: var(--ds-icon-button-size, var(--hit-cozy));width:var(--_icon-button-size);height:var(--_icon-button-size)}.icon-button.lg{--_icon-button-size: var(--ds-icon-button-size, var(--field-h-lg));width:var(--_icon-button-size);height:var(--_icon-button-size)}.icon-button.standard{--_icon-button-icon-color-disabled: var(--ds-icon-button-icon-color-disabled, color-mix(in srgb, var(--_icon-button-icon-color) 40%, var(--surface-default)))}.icon-button.filled{--_icon-button-bg-color: var(--ds-icon-button-bg-color, var(--c-base));--_icon-button-icon-color: var(--ds-icon-button-icon-color, var(--c-on));--_icon-button-bg-color-hover: var(--ds-icon-button-bg-color-hover, color-mix(in srgb, var(--_icon-button-bg-color) 88%, black));--_icon-button-bg-color-active: var(--ds-icon-button-bg-color-active, color-mix(in srgb, var(--_icon-button-bg-color) 76%, black));--_icon-button-icon-color-hover: var(--ds-icon-button-icon-color-hover, var(--_icon-button-icon-color));--_icon-button-accent: var(--_icon-button-bg-color);--_icon-button-bg-color-disabled: var(--ds-icon-button-bg-color-disabled, oklch(from var(--_icon-button-accent) 92% .03 h))}.icon-button.tonal{--_icon-button-bg-color: var(--ds-icon-button-bg-color, var(--c-muted));--_icon-button-icon-color: var(--ds-icon-button-icon-color, var(--c-strong));--_icon-button-bg-color-hover: var(--ds-icon-button-bg-color-hover, var(--c-subtitle));--_icon-button-bg-color-active: var(--ds-icon-button-bg-color-active, var(--c-muted-strong));--_icon-button-icon-color-hover: var(--ds-icon-button-icon-color-hover, var(--c-strong));--_icon-button-bg-color-disabled: var(--ds-icon-button-bg-color-disabled, color-mix(in srgb, var(--_icon-button-bg-color) 28%, var(--surface-disabled)))}.icon-button.outlined{--_icon-button-bg-color: var(--ds-icon-button-bg-color, transparent);--_icon-button-icon-color: var(--ds-icon-button-icon-color, var(--text-primary));--_icon-button-border: var(--ds-icon-button-border, var(--border-default));--_icon-button-bg-color-hover: var(--ds-icon-button-bg-color-hover, var(--surface-secondary));--_icon-button-bg-color-active: var(--ds-icon-button-bg-color-active, var(--surface-muted));--_icon-button-icon-color-hover: var(--ds-icon-button-icon-color-hover, var(--text-primary));--_icon-button-bg-color-disabled: var(--ds-icon-button-bg-color-disabled, transparent);--_icon-button-border-disabled: var(--ds-icon-button-border-disabled, color-mix(in srgb, var(--_icon-button-border) 55%, var(--surface-disabled)))}.icon-button.c-secondary{--c-base: var(--secondary);--c-on: var(--secondary-on);--c-strong: var(--secondary-strong);--c-subtitle: var(--secondary-subtitle);--c-muted: var(--secondary-muted);--c-muted-strong: var(--secondary-muted-strong)}.icon-button.c-tertiary{--c-base: var(--tertiary);--c-on: var(--tertiary-on);--c-strong: var(--tertiary-strong);--c-subtitle: var(--tertiary-subtitle);--c-muted: var(--tertiary-muted);--c-muted-strong: var(--tertiary-muted-strong)}.icon-button.c-neutral{--c-base: var(--text-secondary);--c-on: var(--surface-default);--c-strong: var(--text-primary);--c-subtitle: var(--surface-secondary);--c-muted: var(--surface-secondary);--c-muted-strong: var(--border-default)}.icon-button.c-error{--c-base: var(--error);--c-on: var(--text-on-error);--c-strong: var(--error-text);--c-subtitle: var(--error-subtitle);--c-muted: var(--error-muted);--c-muted-strong: var(--error-muted-strong)}.icon-button.c-success{--c-base: var(--success);--c-on: var(--text-on-success);--c-strong: var(--success-text);--c-subtitle: var(--success-subtitle);--c-muted: var(--success-muted);--c-muted-strong: var(--success-muted-strong)}.icon-button.c-warning{--c-base: var(--warning);--c-on: var(--text-on-warning);--c-strong: var(--warning-text);--c-subtitle: var(--warning-subtitle);--c-muted: var(--warning-muted);--c-muted-strong: var(--warning-muted-strong)}.icon-button.selected{--_icon-button-bg-color: var(--ds-icon-button-bg-color, var(--c-base));--_icon-button-icon-color: var(--ds-icon-button-icon-color, var(--c-on));--_icon-button-border: var(--ds-icon-button-border, transparent);--_icon-button-bg-color-hover: var(--ds-icon-button-bg-color-hover, color-mix(in srgb, var(--_icon-button-bg-color) 88%, black));--_icon-button-bg-color-active: var(--ds-icon-button-bg-color-active, color-mix(in srgb, var(--_icon-button-bg-color) 76%, black));--_icon-button-icon-color-hover: var(--ds-icon-button-icon-color-hover, var(--_icon-button-icon-color));--_icon-button-accent: var(--_icon-button-bg-color);--_icon-button-bg-color-disabled: var(--ds-icon-button-bg-color-disabled, oklch(from var(--_icon-button-accent) 92% .03 h))}\n"] }]
|
|
78
|
+
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: true }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedBy", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], ariaExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaExpanded", required: false }] }], ariaControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaControls", required: false }] }], pressed: [{ type: i0.Output, args: ["pressed"] }] } });
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Generated bundle index. Do not edit.
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
export { IconButtonComponent };
|
|
85
|
+
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-icon-button.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-icon-button.mjs","sources":["../../../src/lib/components/icon-button/icon-button.component.ts","../../../src/lib/components/icon-button/icon-button.component.html","../../../src/lib/components/icon-button/ids-group-ltd-ids-design-system-components-icon-button.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n input,\n output,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport type { ButtonColor } from '@ids-group-ltd/ids-design-system/components/button';\nimport type { IconButtonType, IconButtonVariant } from './icon-button.types';\nimport type { DsSize } from '@ids-group-ltd/ids-design-system/core';\nimport { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';\n\n/**\n * Icon-only action button with its own variant taxonomy (standard / filled /\n * tonal / outlined) + an optional toggle (`selected`) state. Distinct from\n * `ds-button` — use this for square/round icon affordances; use `ds-button`\n * for labelled actions. `ariaLabel` is REQUIRED (icon-only has no text label).\n */\n@Component({\n selector: 'ds-icon-button',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './icon-button.component.html',\n styleUrl: './icon-button.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class IconButtonComponent {\n /** Icon to render — the button's only visible content. */\n readonly icon = input.required<IconName>();\n /** Accessible name — required since the button has no visible text. */\n readonly ariaLabel = input.required<string>();\n /** ARIA `aria-describedby` — the id of text the app renders beside the button,\n * such as why the action is refused. Icon-only leaves no room for a second\n * line, so unlike `ds-button` there is no `disabledReason` here: the text has\n * to exist on screen already for this to point at it. */\n readonly ariaDescribedBy = input<string | null>(null);\n /** Fill style — standard (chromeless), filled, tonal, or outlined. */\n readonly variant = input<IconButtonVariant>('standard');\n /** Brand/status hue family (shared with ds-button). `variant` is the fill\n axis; `color` recolours the accent the fill consumes. Default primary. */\n readonly color = input<ButtonColor>('primary');\n /** Button size — sm/md/lg, matches the field/button height scale.\n * Unset falls back to `DS_CONFIG.control.size`, then `'md'`. */\n readonly size = input<DsSize | null>(null);\n readonly sizeResolved = resolveWithConfig(\n this.size,\n (config) => config.control?.size,\n 'md' as DsSize,\n );\n /** Native `<button>` `type`; defaults to `'button'` (not `'submit'`) so it never submits an ancestor form by accident. */\n readonly type = input<IconButtonType>('button');\n /** Disables the button and blocks `pressed`. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Toggle state — renders the pressed/active look and sets aria-pressed. */\n readonly selected = input(false, { transform: booleanAttribute });\n /** ARIA `aria-expanded`, forwarded to the inner `<button>` — bind to the open\n * state when this button opens a panel. On the host element it would land on\n * a non-focusable wrapper, which no screen reader reads. */\n readonly ariaExpanded = input<boolean | null>(null);\n /** ARIA `aria-controls`, forwarded to the inner `<button>` — the id of the\n * panel this button opens, e.g. `ds-app-layout`'s `railId`. */\n readonly ariaControls = input<string | null>(null);\n /** Fires on click, unless disabled. */\n readonly pressed = output<MouseEvent>();\n\n protected readonly classes = computed(() => {\n const parts = ['icon-button', this.variant(), this.sizeResolved()];\n if (this.color() !== 'primary') {\n parts.push(`c-${this.color()}`);\n }\n if (this.selected()) {\n parts.push('selected');\n }\n\n return parts.join(' ');\n });\n\n protected readonly iconSize = computed(() => {\n const size = this.sizeResolved();\n if (size === 'sm') {\n return 16;\n }\n if (size === 'lg') {\n return 24;\n }\n\n return 20;\n });\n\n protected onClick(event: MouseEvent): void {\n if (this.disabled()) {\n return;\n }\n this.pressed.emit(event);\n }\n}\n","<button\n [class]=\"classes()\"\n [type]=\"type()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-pressed]=\"selected() ? true : null\"\n [attr.aria-expanded]=\"ariaExpanded()\"\n [attr.aria-controls]=\"ariaControls()\"\n (click)=\"onClick($event)\">\n <ds-icon\n [name]=\"icon()\"\n [size]=\"iconSize()\" />\n</button>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAeA;;;;;AAKG;MASU,mBAAmB,CAAA;;AAErB,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,0EAAY;;A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