@ids-group-ltd/ids-design-system 0.11.3 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +253 -13
- package/components/README.md +86 -0
- package/components.md +12 -4
- package/docs/agent/INDEX.md +1 -0
- package/docs/agent/platform/body-scroll-lock-service.md +12 -0
- package/docs/agent/platform/toast-service.md +4 -6
- 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 +286 -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 +235 -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 +53 -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.mjs +1802 -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 +547 -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 +325 -0
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +101 -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 +72 -14030
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.11.0.json +0 -2
- package/migrations/0.11.1.json +2 -1
- package/migrations/0.11.2.json +2 -1
- package/migrations/0.11.3.json +3 -2
- package/migrations/0.11.4.json +247 -0
- package/migrations/0.12.0.json +22 -0
- package/migrations/0.4.0.json +2 -1
- package/migrations/0.7.1.json +2 -1
- package/migrations/0.8.0.json +6 -5
- package/package.json +573 -1
- package/styles/_control-label.scss +18 -0
- package/styles/_ds-color.scss +6 -0
- package/styles/_focus.scss +16 -0
- package/styles/_skeleton-shimmer.scss +10 -26
- package/themes/README.md +4 -4
- package/themes/_semantic.scss +11 -2
- 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 +82 -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 +106 -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 +38 -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.d.ts +791 -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 +428 -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 +72 -5544
- package/LICENSE +0 -21
- package/README.md +0 -73
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, model, signal, output, computed, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
|
|
4
|
+
|
|
5
|
+
class DropzoneComponent {
|
|
6
|
+
/** Native `accept` attribute — comma-separated MIME types or extensions. */
|
|
7
|
+
accept = input('', ...(ngDevMode ? [{ debugName: "accept" }] : /* istanbul ignore next */ []));
|
|
8
|
+
/** Allows picking more than one file at once (ignored when `single`). */
|
|
9
|
+
multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
10
|
+
/** Files shown in the list — the consumer owns upload state and progress. */
|
|
11
|
+
files = model([], ...(ngDevMode ? [{ debugName: "files" }] : /* istanbul ignore next */ []));
|
|
12
|
+
/** Disables the dropzone: blocks all file-picking interactions and signals unavailability. */
|
|
13
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
14
|
+
/** Restricts the dropzone to a single file; narrows the panel to `--col-cap-text`. */
|
|
15
|
+
single = input(false, { ...(ngDevMode ? { debugName: "single" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
16
|
+
dragOver = signal(false, ...(ngDevMode ? [{ debugName: "dragOver" }] : /* istanbul ignore next */ []));
|
|
17
|
+
/** Fires with the raw files picked or dropped; the consumer adds them to `files`. */
|
|
18
|
+
filesAdded = output();
|
|
19
|
+
/** Fires when the user removes a file; unlike `filesAdded`, the consumer must remove the matching entry from `files` itself. */
|
|
20
|
+
fileRemoved = output();
|
|
21
|
+
classes = computed(() => {
|
|
22
|
+
const parts = ['dropzone'];
|
|
23
|
+
if (this.dragOver()) {
|
|
24
|
+
parts.push('active');
|
|
25
|
+
}
|
|
26
|
+
if (this.files().length > 0) {
|
|
27
|
+
parts.push('has-files');
|
|
28
|
+
}
|
|
29
|
+
if (this.disabled()) {
|
|
30
|
+
parts.push('disabled');
|
|
31
|
+
}
|
|
32
|
+
if (this.single()) {
|
|
33
|
+
parts.push('single');
|
|
34
|
+
}
|
|
35
|
+
return parts.join(' ');
|
|
36
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
37
|
+
onDragOver(event) {
|
|
38
|
+
if (this.disabled()) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
this.dragOver.set(true);
|
|
43
|
+
}
|
|
44
|
+
onDragLeave() {
|
|
45
|
+
this.dragOver.set(false);
|
|
46
|
+
}
|
|
47
|
+
onDrop(event) {
|
|
48
|
+
event.preventDefault();
|
|
49
|
+
this.dragOver.set(false);
|
|
50
|
+
if (this.disabled()) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const list = event.dataTransfer?.files;
|
|
54
|
+
if (list) {
|
|
55
|
+
this.filesAdded.emit(Array.from(list));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
onPickerChange(event) {
|
|
59
|
+
if (this.disabled()) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const list = event.target.files;
|
|
63
|
+
if (list) {
|
|
64
|
+
this.filesAdded.emit(Array.from(list));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
onRemove(file) {
|
|
68
|
+
this.fileRemoved.emit(file);
|
|
69
|
+
}
|
|
70
|
+
fileMeta(file) {
|
|
71
|
+
const size = this.formatSize(file.size);
|
|
72
|
+
if (file.message) {
|
|
73
|
+
return `${size} · ${file.message}`;
|
|
74
|
+
}
|
|
75
|
+
if (file.state === 'queued') {
|
|
76
|
+
return size;
|
|
77
|
+
}
|
|
78
|
+
return `${size} · ${file.state}`;
|
|
79
|
+
}
|
|
80
|
+
formatSize(bytes) {
|
|
81
|
+
if (bytes < 1024) {
|
|
82
|
+
return `${bytes} B`;
|
|
83
|
+
}
|
|
84
|
+
if (bytes < 1024 * 1024) {
|
|
85
|
+
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
86
|
+
}
|
|
87
|
+
return `${(bytes / 1024 / 1024).toFixed(1)} MB`;
|
|
88
|
+
}
|
|
89
|
+
fileIcon(state) {
|
|
90
|
+
if (state === 'success') {
|
|
91
|
+
return 'check';
|
|
92
|
+
}
|
|
93
|
+
if (state === 'error') {
|
|
94
|
+
return 'error';
|
|
95
|
+
}
|
|
96
|
+
return 'file';
|
|
97
|
+
}
|
|
98
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DropzoneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
99
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DropzoneComponent, isStandalone: true, selector: "ds-dropzone", inputs: { accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, single: { classPropertyName: "single", publicName: "single", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { files: "filesChange", filesAdded: "filesAdded", fileRemoved: "fileRemoved" }, ngImport: i0, template: "<label\n [class]=\"classes()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave()\"\n (drop)=\"onDrop($event)\"\n>\n <input\n type=\"file\"\n class=\"dz-input\"\n aria-label=\"Upload files\"\n [attr.accept]=\"accept() || null\"\n [multiple]=\"single() ? false : multiple()\"\n [disabled]=\"disabled()\"\n (change)=\"onPickerChange($event)\"\n />\n\n @if (files().length === 0) {\n <ds-icon\n name=\"upload\"\n [size]=\"24\"\n >\n </ds-icon>\n\n <div class=\"title\">\n Drop files here\n </div>\n\n <div class=\"hint\">\n or click to browse\n </div>\n\n <ng-content select=\"[hint]\"></ng-content>\n } @else {\n <div class=\"file-list\">\n @for (file of files(); track file.id) {\n <div [class]=\"'file ' + file.state\">\n <ds-icon\n class=\"icon\"\n [name]=\"fileIcon(file.state)\"\n [size]=\"20\"\n >\n </ds-icon>\n\n <div class=\"main\">\n <div class=\"name\">\n {{ file.name }}\n </div>\n\n <div class=\"meta\">\n {{ fileMeta(file) }}\n </div>\n\n @if (file.state === 'uploading') {\n <div class=\"progress\">\n <div\n class=\"progress-fill\"\n [style.width.%]=\"file.progress\"\n >\n </div>\n </div>\n }\n </div>\n\n <button\n class=\"remove\"\n type=\"button\"\n [attr.aria-label]=\"'Remove ' + file.name\"\n (click)=\"\n onRemove(file); $event.preventDefault(); $event.stopPropagation()\n \"\n >\n <ds-icon\n name=\"x\"\n [size]=\"14\"\n >\n </ds-icon>\n </button>\n </div>\n }\n </div>\n }\n</label>\n", styles: [":host{--_dropzone-bg-color: var(--ds-dropzone-bg-color, var(--surface-default));--_dropzone-bg-color-hover: var(--ds-dropzone-bg-color-hover, var(--accent-subtitle));--_dropzone-bg-color-active: var(--ds-dropzone-bg-color-active, var(--accent-subtitle));--_dropzone-border: var(--ds-dropzone-border, var(--border-default));--_dropzone-border-hover: var(--ds-dropzone-border-hover, var(--accent));--_dropzone-border-active: var(--ds-dropzone-border-active, var(--accent));--_dropzone-text-color: var(--ds-dropzone-text-color, var(--text-secondary));--_dropzone-text-color-active: var(--ds-dropzone-text-color-active, var(--accent-strong));--_dropzone-radius: var(--ds-dropzone-radius, var(--ds-radius-panel));--_dropzone-file-progress: var(--ds-dropzone-file-progress, var(--accent));--_dropzone-file-success: var(--ds-dropzone-file-success, var(--success));--_dropzone-file-error: var(--ds-dropzone-file-error, var(--error));--_dropzone-file-border: var(--ds-dropzone-file-border, var(--border-default));--_dropzone-file-name-color: var(--ds-dropzone-file-name-color, var(--text-primary));--_dropzone-icon-color: var(--ds-dropzone-icon-color, var(--icon-default));display:flex;flex-direction:column;min-width:0}.dz-input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.dropzone:focus-within{outline:var(--border-width-strong, 2px) solid var(--accent);outline-offset:var(--focus-ring-offset)}.dropzone{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-2);border:var(--border-width-strong) dashed var(--_dropzone-border);border-radius:var(--_dropzone-radius);padding:var(--space-6);text-align:center;background-color:var(--_dropzone-bg-color);cursor:pointer;min-height:160px;transition:border-color var(--duration-fast) var(--ease-standard),background-color var(--duration-fast) var(--ease-standard)}.dropzone:hover{border-color:var(--_dropzone-border-hover);background-color:var(--_dropzone-bg-color-hover)}.dropzone.active{border-color:var(--_dropzone-border-active);background-color:var(--_dropzone-bg-color-active)}.dropzone.has-files{align-items:stretch;text-align:left;min-height:0;cursor:default}.dropzone.disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed;pointer-events:none}.dropzone.single{max-width:var(--col-cap-text)}.dropzone .title{font:var(--font-weight-bold) var(--font-size-m)/var(--line-height-snug) var(--font-heading);margin:0 0 var(--space-1)}.dropzone .hint{font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_dropzone-text-color)}.dropzone [hint]{margin:var(--space-3) calc(var(--space-6) * -1) 0;padding:var(--space-3) var(--space-6) 0;border-top:var(--border-width-default) solid var(--border-subtitle);align-self:stretch;text-align:center;font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-tertiary);letter-spacing:var(--letter-spacing-wide)}.dropzone .file-list{width:100%;margin-top:var(--space-4);display:grid;gap:var(--space-2)}.dropzone .file{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3);border:var(--border-width-default) solid var(--_dropzone-file-border);border-radius:var(--radius-md);background:var(--surface-default)}.dropzone .file .icon{flex-shrink:0;color:var(--_dropzone-icon-color)}.dropzone .file .main{flex:1;min-width:0}.dropzone .file .name{font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_dropzone-file-name-color)}.dropzone .file .meta{font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-tertiary)}.dropzone .file .progress{height:var(--border-width-strong);background:var(--surface-secondary);border-radius:var(--radius-pill);margin-top:var(--space-1)}.dropzone .file .progress-fill{height:100%;background:var(--_dropzone-file-progress);border-radius:var(--radius-pill);transition:width var(--duration-base) var(--ease-standard)}.dropzone .file .remove{background:none;border:0;cursor:pointer;color:var(--icon-default);transition:color var(--duration-fast) var(--ease-standard)}.dropzone .file .remove:hover{color:var(--icon-strong)}.dropzone .file .remove:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.dropzone .file.uploading .icon{color:var(--_dropzone-file-progress)}.dropzone .file.success{border-color:var(--_dropzone-file-success)}.dropzone .file.success .icon{color:var(--_dropzone-file-success)}.dropzone .file.error{border-color:var(--_dropzone-file-error)}.dropzone .file.error .icon{color:var(--_dropzone-file-error)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
100
|
+
}
|
|
101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DropzoneComponent, decorators: [{
|
|
102
|
+
type: Component,
|
|
103
|
+
args: [{ selector: 'ds-dropzone', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<label\n [class]=\"classes()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave()\"\n (drop)=\"onDrop($event)\"\n>\n <input\n type=\"file\"\n class=\"dz-input\"\n aria-label=\"Upload files\"\n [attr.accept]=\"accept() || null\"\n [multiple]=\"single() ? false : multiple()\"\n [disabled]=\"disabled()\"\n (change)=\"onPickerChange($event)\"\n />\n\n @if (files().length === 0) {\n <ds-icon\n name=\"upload\"\n [size]=\"24\"\n >\n </ds-icon>\n\n <div class=\"title\">\n Drop files here\n </div>\n\n <div class=\"hint\">\n or click to browse\n </div>\n\n <ng-content select=\"[hint]\"></ng-content>\n } @else {\n <div class=\"file-list\">\n @for (file of files(); track file.id) {\n <div [class]=\"'file ' + file.state\">\n <ds-icon\n class=\"icon\"\n [name]=\"fileIcon(file.state)\"\n [size]=\"20\"\n >\n </ds-icon>\n\n <div class=\"main\">\n <div class=\"name\">\n {{ file.name }}\n </div>\n\n <div class=\"meta\">\n {{ fileMeta(file) }}\n </div>\n\n @if (file.state === 'uploading') {\n <div class=\"progress\">\n <div\n class=\"progress-fill\"\n [style.width.%]=\"file.progress\"\n >\n </div>\n </div>\n }\n </div>\n\n <button\n class=\"remove\"\n type=\"button\"\n [attr.aria-label]=\"'Remove ' + file.name\"\n (click)=\"\n onRemove(file); $event.preventDefault(); $event.stopPropagation()\n \"\n >\n <ds-icon\n name=\"x\"\n [size]=\"14\"\n >\n </ds-icon>\n </button>\n </div>\n }\n </div>\n }\n</label>\n", styles: [":host{--_dropzone-bg-color: var(--ds-dropzone-bg-color, var(--surface-default));--_dropzone-bg-color-hover: var(--ds-dropzone-bg-color-hover, var(--accent-subtitle));--_dropzone-bg-color-active: var(--ds-dropzone-bg-color-active, var(--accent-subtitle));--_dropzone-border: var(--ds-dropzone-border, var(--border-default));--_dropzone-border-hover: var(--ds-dropzone-border-hover, var(--accent));--_dropzone-border-active: var(--ds-dropzone-border-active, var(--accent));--_dropzone-text-color: var(--ds-dropzone-text-color, var(--text-secondary));--_dropzone-text-color-active: var(--ds-dropzone-text-color-active, var(--accent-strong));--_dropzone-radius: var(--ds-dropzone-radius, var(--ds-radius-panel));--_dropzone-file-progress: var(--ds-dropzone-file-progress, var(--accent));--_dropzone-file-success: var(--ds-dropzone-file-success, var(--success));--_dropzone-file-error: var(--ds-dropzone-file-error, var(--error));--_dropzone-file-border: var(--ds-dropzone-file-border, var(--border-default));--_dropzone-file-name-color: var(--ds-dropzone-file-name-color, var(--text-primary));--_dropzone-icon-color: var(--ds-dropzone-icon-color, var(--icon-default));display:flex;flex-direction:column;min-width:0}.dz-input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.dropzone:focus-within{outline:var(--border-width-strong, 2px) solid var(--accent);outline-offset:var(--focus-ring-offset)}.dropzone{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-2);border:var(--border-width-strong) dashed var(--_dropzone-border);border-radius:var(--_dropzone-radius);padding:var(--space-6);text-align:center;background-color:var(--_dropzone-bg-color);cursor:pointer;min-height:160px;transition:border-color var(--duration-fast) var(--ease-standard),background-color var(--duration-fast) var(--ease-standard)}.dropzone:hover{border-color:var(--_dropzone-border-hover);background-color:var(--_dropzone-bg-color-hover)}.dropzone.active{border-color:var(--_dropzone-border-active);background-color:var(--_dropzone-bg-color-active)}.dropzone.has-files{align-items:stretch;text-align:left;min-height:0;cursor:default}.dropzone.disabled{background:var(--surface-disabled);border-color:var(--border-disabled);color:var(--text-disabled);cursor:not-allowed;pointer-events:none}.dropzone.single{max-width:var(--col-cap-text)}.dropzone .title{font:var(--font-weight-bold) var(--font-size-m)/var(--line-height-snug) var(--font-heading);margin:0 0 var(--space-1)}.dropzone .hint{font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_dropzone-text-color)}.dropzone [hint]{margin:var(--space-3) calc(var(--space-6) * -1) 0;padding:var(--space-3) var(--space-6) 0;border-top:var(--border-width-default) solid var(--border-subtitle);align-self:stretch;text-align:center;font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-tertiary);letter-spacing:var(--letter-spacing-wide)}.dropzone .file-list{width:100%;margin-top:var(--space-4);display:grid;gap:var(--space-2)}.dropzone .file{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3);border:var(--border-width-default) solid var(--_dropzone-file-border);border-radius:var(--radius-md);background:var(--surface-default)}.dropzone .file .icon{flex-shrink:0;color:var(--_dropzone-icon-color)}.dropzone .file .main{flex:1;min-width:0}.dropzone .file .name{font:var(--font-weight-medium) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_dropzone-file-name-color)}.dropzone .file .meta{font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);color:var(--text-tertiary)}.dropzone .file .progress{height:var(--border-width-strong);background:var(--surface-secondary);border-radius:var(--radius-pill);margin-top:var(--space-1)}.dropzone .file .progress-fill{height:100%;background:var(--_dropzone-file-progress);border-radius:var(--radius-pill);transition:width var(--duration-base) var(--ease-standard)}.dropzone .file .remove{background:none;border:0;cursor:pointer;color:var(--icon-default);transition:color var(--duration-fast) var(--ease-standard)}.dropzone .file .remove:hover{color:var(--icon-strong)}.dropzone .file .remove:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.dropzone .file.uploading .icon{color:var(--_dropzone-file-progress)}.dropzone .file.success{border-color:var(--_dropzone-file-success)}.dropzone .file.success .icon{color:var(--_dropzone-file-success)}.dropzone .file.error{border-color:var(--_dropzone-file-error)}.dropzone .file.error .icon{color:var(--_dropzone-file-error)}\n"] }]
|
|
104
|
+
}], propDecorators: { accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], files: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }, { type: i0.Output, args: ["filesChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], single: [{ type: i0.Input, args: [{ isSignal: true, alias: "single", required: false }] }], filesAdded: [{ type: i0.Output, args: ["filesAdded"] }], fileRemoved: [{ type: i0.Output, args: ["fileRemoved"] }] } });
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Generated bundle index. Do not edit.
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
export { DropzoneComponent };
|
|
111
|
+
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-dropzone.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-dropzone.mjs","sources":["../../../src/lib/components/dropzone/dropzone.component.ts","../../../src/lib/components/dropzone/dropzone.component.html","../../../src/lib/components/dropzone/ids-group-ltd-ids-design-system-components-dropzone.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport type { DropzoneFile } from './dropzone.types';\n\n@Component({\n selector: 'ds-dropzone',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './dropzone.component.html',\n styleUrl: './dropzone.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class DropzoneComponent {\n /** Native `accept` attribute — comma-separated MIME types or extensions. */\n readonly accept = input<string>('');\n /** Allows picking more than one file at once (ignored when `single`). */\n readonly multiple = input(false, { transform: booleanAttribute });\n /** Files shown in the list — the consumer owns upload state and progress. */\n readonly files = model<DropzoneFile[]>([]);\n /** Disables the dropzone: blocks all file-picking interactions and signals unavailability. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Restricts the dropzone to a single file; narrows the panel to `--col-cap-text`. */\n readonly single = input(false, { transform: booleanAttribute });\n\n protected readonly dragOver = signal<boolean>(false);\n\n /** Fires with the raw files picked or dropped; the consumer adds them to `files`. */\n readonly filesAdded = output<File[]>();\n /** Fires when the user removes a file; unlike `filesAdded`, the consumer must remove the matching entry from `files` itself. */\n readonly fileRemoved = output<DropzoneFile>();\n\n protected readonly classes = computed(() => {\n const parts = ['dropzone'];\n if (this.dragOver()) {\n parts.push('active');\n }\n if (this.files().length > 0) {\n parts.push('has-files');\n }\n if (this.disabled()) {\n parts.push('disabled');\n }\n if (this.single()) {\n parts.push('single');\n }\n\n return parts.join(' ');\n });\n\n protected onDragOver(event: DragEvent): void {\n if (this.disabled()) {\n return;\n }\n event.preventDefault();\n this.dragOver.set(true);\n }\n\n protected onDragLeave(): void {\n this.dragOver.set(false);\n }\n\n protected onDrop(event: DragEvent): void {\n event.preventDefault();\n this.dragOver.set(false);\n if (this.disabled()) {\n return;\n }\n const list = event.dataTransfer?.files;\n if (list) {\n this.filesAdded.emit(Array.from(list));\n }\n }\n\n protected onPickerChange(event: Event): void {\n if (this.disabled()) {\n return;\n }\n const list = (event.target as HTMLInputElement).files;\n if (list) {\n this.filesAdded.emit(Array.from(list));\n }\n }\n\n protected onRemove(file: DropzoneFile): void {\n this.fileRemoved.emit(file);\n }\n\n protected fileMeta(file: DropzoneFile): string {\n const size = this.formatSize(file.size);\n if (file.message) {\n return `${size} · ${file.message}`;\n }\n if (file.state === 'queued') {\n return size;\n }\n\n return `${size} · ${file.state}`;\n }\n\n protected formatSize(bytes: number): string {\n if (bytes < 1024) {\n return `${bytes} B`;\n }\n if (bytes < 1024 * 1024) {\n return `${(bytes / 1024).toFixed(1)} KB`;\n }\n\n return `${(bytes / 1024 / 1024).toFixed(1)} MB`;\n }\n\n protected fileIcon(state: DropzoneFile['state']): 'file' | 'check' | 'error' {\n if (state === 'success') {\n return 'check';\n }\n if (state === 'error') {\n return 'error';\n }\n\n return 'file';\n }\n}\n","<label\n [class]=\"classes()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave()\"\n (drop)=\"onDrop($event)\"\n>\n <input\n type=\"file\"\n class=\"dz-input\"\n aria-label=\"Upload files\"\n [attr.accept]=\"accept() || null\"\n [multiple]=\"single() ? false : multiple()\"\n [disabled]=\"disabled()\"\n (change)=\"onPickerChange($event)\"\n />\n\n @if (files().length === 0) {\n <ds-icon\n name=\"upload\"\n [size]=\"24\"\n >\n </ds-icon>\n\n <div class=\"title\">\n Drop files here\n </div>\n\n <div class=\"hint\">\n or click to browse\n </div>\n\n <ng-content select=\"[hint]\"></ng-content>\n } @else {\n <div class=\"file-list\">\n @for (file of files(); track file.id) {\n <div [class]=\"'file ' + file.state\">\n <ds-icon\n class=\"icon\"\n [name]=\"fileIcon(file.state)\"\n [size]=\"20\"\n >\n </ds-icon>\n\n <div class=\"main\">\n <div class=\"name\">\n {{ file.name }}\n </div>\n\n <div class=\"meta\">\n {{ fileMeta(file) }}\n </div>\n\n @if (file.state === 'uploading') {\n <div class=\"progress\">\n <div\n class=\"progress-fill\"\n [style.width.%]=\"file.progress\"\n >\n </div>\n </div>\n }\n </div>\n\n <button\n class=\"remove\"\n type=\"button\"\n [attr.aria-label]=\"'Remove ' + file.name\"\n (click)=\"\n onRemove(file); $event.preventDefault(); $event.stopPropagation()\n \"\n >\n <ds-icon\n name=\"x\"\n [size]=\"14\"\n >\n </ds-icon>\n </button>\n </div>\n }\n </div>\n }\n</label>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAqBa,iBAAiB,CAAA;;AAEnB,IAAA,MAAM,GAAG,KAAK,CAAS,EAAE,6EAAC;;IAE1B,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAExD,IAAA,KAAK,GAAG,KAAK,CAAiB,E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,IAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,KAAA,EAAA,aAAA,EAAA,UAAA,EAAA,YAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECrB9B,69DAmFA,EAAA,MAAA,EAAA,CAAA,muJAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDnEY,aAAa,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAKZ,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAR7B,SAAS;+BACE,aAAa,EAAA,UAAA,EACX,IAAI,EAAA,OAAA,EACP,CAAC,aAAa,CAAC,EAAA,aAAA,EAGT,iBAAiB,CAAC,QAAQ,EAAA,QAAA,EAAA,69DAAA,EAAA,MAAA,EAAA,CAAA,muJAAA,CAAA,EAAA;;;AEnB3C;;AAEG;;;;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
|
|
4
|
+
import { LoadingOverlayComponent } from '@ids-group-ltd/ids-design-system/components/loading-overlay';
|
|
5
|
+
|
|
6
|
+
class EmptyStateComponent {
|
|
7
|
+
/** State — drives the default icon and shows a loading overlay when `'loading'`. */
|
|
8
|
+
variant = input('none', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
9
|
+
/** Override the variant's default icon. */
|
|
10
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
11
|
+
/** Optional heading below the icon. */
|
|
12
|
+
title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
13
|
+
/** Optional supporting text below the title. */
|
|
14
|
+
body = input('', ...(ngDevMode ? [{ debugName: "body" }] : /* istanbul ignore next */ []));
|
|
15
|
+
classes = computed(() => {
|
|
16
|
+
const variant = this.variant();
|
|
17
|
+
return variant === 'none' ? 'empty-state' : `empty-state ${variant}`;
|
|
18
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
19
|
+
resolvedIcon = computed(() => {
|
|
20
|
+
const explicit = this.icon();
|
|
21
|
+
if (explicit) {
|
|
22
|
+
return explicit;
|
|
23
|
+
}
|
|
24
|
+
const variant = this.variant();
|
|
25
|
+
if (variant === 'error') {
|
|
26
|
+
return 'warn';
|
|
27
|
+
}
|
|
28
|
+
if (variant === 'locked') {
|
|
29
|
+
return 'lock';
|
|
30
|
+
}
|
|
31
|
+
if (variant === 'success') {
|
|
32
|
+
return 'success';
|
|
33
|
+
}
|
|
34
|
+
if (variant === 'loading') {
|
|
35
|
+
return 'package';
|
|
36
|
+
}
|
|
37
|
+
return 'package';
|
|
38
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedIcon" }] : /* istanbul ignore next */ []));
|
|
39
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: EmptyStateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
40
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: EmptyStateComponent, isStandalone: true, selector: "ds-empty-state", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, body: { classPropertyName: "body", publicName: "body", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ds-loading-overlay\n spinnerSize=\"lg\"\n [loading]=\"variant() === 'loading'\"\n [blur]=\"true\"\n>\n <span [class]=\"classes()\">\n <span class=\"icon-tile\">\n <ds-icon\n [name]=\"resolvedIcon()\"\n [size]=\"28\"\n >\n </ds-icon>\n </span>\n\n @if (title()) {\n <span class=\"title\">\n {{ title() }}\n </span>\n }\n\n @if (body()) {\n <span class=\"body\">\n {{ body() }}\n </span>\n }\n\n <span class=\"cta\">\n <ng-content select=\"[actions]\"></ng-content>\n </span>\n </span>\n</ds-loading-overlay>\n", styles: [":host{--_es-tile-bg-color: var(--ds-empty-state-tile-bg-color, var(--accent-surface-tint));--_es-tile-icon-color: var(--ds-empty-state-tile-icon-color, var(--text-secondary));--_es-title-text-color: var(--ds-empty-state-title-text-color, var(--text-primary));--_es-title-fs: var(--ds-empty-state-title-fs, var(--font-size-h5));--_es-body-text-color: var(--ds-empty-state-body-text-color, var(--text-secondary));--_es-body-maxw: var(--ds-empty-state-body-maxw, var(--empty-body-maxw));--_es-pad: var(--ds-empty-state-pad, var(--space-12) var(--space-6));display:block}.empty-state{display:flex;flex-direction:column;align-items:center;text-align:center;padding:var(--_es-pad);gap:var(--space-3);position:relative}.empty-state .icon-tile{width:var(--empty-icon-size);height:var(--empty-icon-size);border-radius:var(--radius-lg);background-color:var(--_es-tile-bg-color);color:var(--_es-tile-icon-color);display:grid;place-items:center;margin-bottom:var(--space-2)}.empty-state .title{font:var(--font-weight-bold) var(--_es-title-fs)/var(--line-height-snug) var(--font-sans);color:var(--_es-title-text-color);margin:0}.empty-state .body{font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_es-body-text-color);max-width:var(--_es-body-maxw);margin:0}.empty-state .cta{margin-top:var(--space-3);display:inline-flex;gap:var(--space-2);align-items:center;flex-wrap:wrap;justify-content:center}.empty-state .cta:empty{display:none;margin-top:0}.empty-state.error{--_es-tile-bg-color: var(--ds-empty-state-tile-bg-color, var(--error-subtitle));--_es-tile-icon-color: var(--ds-empty-state-tile-icon-color, var(--error-text))}.empty-state.locked{--_es-tile-bg-color: var(--ds-empty-state-tile-bg-color, var(--surface-muted));--_es-tile-icon-color: var(--ds-empty-state-tile-icon-color, var(--text-tertiary))}.empty-state.success{--_es-tile-bg-color: var(--ds-empty-state-tile-bg-color, var(--success-subtitle));--_es-tile-icon-color: var(--ds-empty-state-tile-icon-color, var(--success-text))}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: LoadingOverlayComponent, selector: "ds-loading-overlay", inputs: ["loading", "label", "blur", "spinnerSize", "insetTop", "inertContent"] }] });
|
|
41
|
+
}
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: EmptyStateComponent, decorators: [{
|
|
43
|
+
type: Component,
|
|
44
|
+
args: [{ selector: 'ds-empty-state', standalone: true, imports: [IconComponent, LoadingOverlayComponent], encapsulation: ViewEncapsulation.Emulated, template: "<ds-loading-overlay\n spinnerSize=\"lg\"\n [loading]=\"variant() === 'loading'\"\n [blur]=\"true\"\n>\n <span [class]=\"classes()\">\n <span class=\"icon-tile\">\n <ds-icon\n [name]=\"resolvedIcon()\"\n [size]=\"28\"\n >\n </ds-icon>\n </span>\n\n @if (title()) {\n <span class=\"title\">\n {{ title() }}\n </span>\n }\n\n @if (body()) {\n <span class=\"body\">\n {{ body() }}\n </span>\n }\n\n <span class=\"cta\">\n <ng-content select=\"[actions]\"></ng-content>\n </span>\n </span>\n</ds-loading-overlay>\n", styles: [":host{--_es-tile-bg-color: var(--ds-empty-state-tile-bg-color, var(--accent-surface-tint));--_es-tile-icon-color: var(--ds-empty-state-tile-icon-color, var(--text-secondary));--_es-title-text-color: var(--ds-empty-state-title-text-color, var(--text-primary));--_es-title-fs: var(--ds-empty-state-title-fs, var(--font-size-h5));--_es-body-text-color: var(--ds-empty-state-body-text-color, var(--text-secondary));--_es-body-maxw: var(--ds-empty-state-body-maxw, var(--empty-body-maxw));--_es-pad: var(--ds-empty-state-pad, var(--space-12) var(--space-6));display:block}.empty-state{display:flex;flex-direction:column;align-items:center;text-align:center;padding:var(--_es-pad);gap:var(--space-3);position:relative}.empty-state .icon-tile{width:var(--empty-icon-size);height:var(--empty-icon-size);border-radius:var(--radius-lg);background-color:var(--_es-tile-bg-color);color:var(--_es-tile-icon-color);display:grid;place-items:center;margin-bottom:var(--space-2)}.empty-state .title{font:var(--font-weight-bold) var(--_es-title-fs)/var(--line-height-snug) var(--font-sans);color:var(--_es-title-text-color);margin:0}.empty-state .body{font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--_es-body-text-color);max-width:var(--_es-body-maxw);margin:0}.empty-state .cta{margin-top:var(--space-3);display:inline-flex;gap:var(--space-2);align-items:center;flex-wrap:wrap;justify-content:center}.empty-state .cta:empty{display:none;margin-top:0}.empty-state.error{--_es-tile-bg-color: var(--ds-empty-state-tile-bg-color, var(--error-subtitle));--_es-tile-icon-color: var(--ds-empty-state-tile-icon-color, var(--error-text))}.empty-state.locked{--_es-tile-bg-color: var(--ds-empty-state-tile-bg-color, var(--surface-muted));--_es-tile-icon-color: var(--ds-empty-state-tile-icon-color, var(--text-tertiary))}.empty-state.success{--_es-tile-bg-color: var(--ds-empty-state-tile-bg-color, var(--success-subtitle));--_es-tile-icon-color: var(--ds-empty-state-tile-icon-color, var(--success-text))}\n"] }]
|
|
45
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], body: [{ type: i0.Input, args: [{ isSignal: true, alias: "body", required: false }] }] } });
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Generated bundle index. Do not edit.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
export { EmptyStateComponent };
|
|
52
|
+
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-empty-state.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-empty-state.mjs","sources":["../../../src/lib/components/empty-state/empty-state.component.ts","../../../src/lib/components/empty-state/empty-state.component.html","../../../src/lib/components/empty-state/ids-group-ltd-ids-design-system-components-empty-state.ts"],"sourcesContent":["import { Component, ViewEncapsulation, computed, input } from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { LoadingOverlayComponent } from '@ids-group-ltd/ids-design-system/components/loading-overlay';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport type { EmptyStateVariant } from './empty-state.types';\n\n@Component({\n selector: 'ds-empty-state',\n standalone: true,\n imports: [IconComponent, LoadingOverlayComponent],\n templateUrl: './empty-state.component.html',\n styleUrl: './empty-state.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class EmptyStateComponent {\n /** State — drives the default icon and shows a loading overlay when `'loading'`. */\n readonly variant = input<EmptyStateVariant>('none');\n /** Override the variant's default icon. */\n readonly icon = input<IconName | null>(null);\n /** Optional heading below the icon. */\n readonly title = input<string>('');\n /** Optional supporting text below the title. */\n readonly body = input<string>('');\n\n protected readonly classes = computed(() => {\n const variant = this.variant();\n\n return variant === 'none' ? 'empty-state' : `empty-state ${variant}`;\n });\n\n protected readonly resolvedIcon = computed<IconName>(() => {\n const explicit = this.icon();\n if (explicit) {\n return explicit;\n }\n const variant = this.variant();\n if (variant === 'error') {\n return 'warn';\n }\n if (variant === 'locked') {\n return 'lock';\n }\n if (variant === 'success') {\n return 'success';\n }\n if (variant === 'loading') {\n return 'package';\n }\n\n return 'package';\n });\n}\n","<ds-loading-overlay\n spinnerSize=\"lg\"\n [loading]=\"variant() === 'loading'\"\n [blur]=\"true\"\n>\n <span [class]=\"classes()\">\n <span class=\"icon-tile\">\n <ds-icon\n [name]=\"resolvedIcon()\"\n [size]=\"28\"\n >\n </ds-icon>\n </span>\n\n @if (title()) {\n <span class=\"title\">\n {{ title() }}\n </span>\n }\n\n @if (body()) {\n <span class=\"body\">\n {{ body() }}\n </span>\n }\n\n <span class=\"cta\">\n <ng-content select=\"[actions]\"></ng-content>\n </span>\n </span>\n</ds-loading-overlay>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAca,mBAAmB,CAAA;;AAErB,IAAA,OAAO,GAAG,KAAK,CAAoB,MAAM,8EAAC;;AAE1C,IAAA,IAAI,GAAG,KAAK,CAAkB,IAAI,2EAAC;;AAEnC,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;;AAEzB,IAAA,IAAI,GAAG,KAAK,CAAS,EAAE,2EAAC;AAEd,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;AACzC,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE;AAE9B,QAAA,OAAO,OAAO,KAAK,MAAM,GAAG,aAAa,GAAG,CAAA,YAAA,EAAe,OAAO,EAAE;AACtE,IAAA,CAAC,8EAAC;AAEiB,IAAA,YAAY,GAAG,QAAQ,CAAW,MAAK;AACxD,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE;QAC5B,IAAI,QAAQ,EAAE;AACZ,YAAA,OAAO,QAAQ;QACjB;AACA,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE;AAC9B,QAAA,IAAI,OAAO,KAAK,OAAO,EAAE;AACvB,YAAA,OAAO,MAAM;QACf;AACA,QAAA,IAAI,OAAO,KAAK,QAAQ,EAAE;AACxB,YAAA,OAAO,MAAM;QACf;AACA,QAAA,IAAI,OAAO,KAAK,SAAS,EAAE;AACzB,YAAA,OAAO,SAAS;QAClB;AACA,QAAA,IAAI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EAAA,OAAA,EAAA,MAAA,EAAA,aAAA,EAAA,UAAA,EAAA,cAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAKrC,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAR/B,SAAS;+BACE,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,OAAA,EACP,CAAC,aAAa,EAAE,uBAAuB,CAAC,EAAA,aAAA,EAGlC,iBAAiB,CAAC,QAAQ,EAAA,QAAA,EAAA,gmBAAA,EAAA,MAAA,EAAA,CAAA,u/DAAA,CAAA,EAAA;;;AEZ3C;;AAEG;;;;"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, input, booleanAttribute, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Provided by `ds-field-group`, injected `{ optional: true }` by every control
|
|
7
|
+
* that can be a segment.
|
|
8
|
+
*
|
|
9
|
+
* DI rather than a `[grouped]` input on each child: the alternative is manual,
|
|
10
|
+
* and one segment where it was forgotten renders its own border and radius in
|
|
11
|
+
* the middle of a glued row — a broken control that still looks deliberate.
|
|
12
|
+
* Presence of the token IS the fact the child needs, and the consumer already
|
|
13
|
+
* declared it by wrapping them.
|
|
14
|
+
*/
|
|
15
|
+
const DS_FIELD_GROUP = new InjectionToken('DS_FIELD_GROUP');
|
|
16
|
+
/**
|
|
17
|
+
* Whether this control is a segment of a `ds-field-group`. Call it in a field
|
|
18
|
+
* component and bind the result to a host `.in-group` class; the component's own
|
|
19
|
+
* `.in-group` block then strips the chrome the group has taken over.
|
|
20
|
+
*
|
|
21
|
+
* A function so the six supported controls share one line instead of six copies
|
|
22
|
+
* of the same optional inject — and so the contract has one place to change.
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
function inFieldGroup() {
|
|
26
|
+
return !!inject(DS_FIELD_GROUP, { optional: true });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* One bordered control out of several: `select + input`, `search + button`,
|
|
31
|
+
* `button + select`. The group owns the border, the radius, the focus ring and
|
|
32
|
+
* the divider between segments; the controls inside render "naked".
|
|
33
|
+
*
|
|
34
|
+
* Segments are the direct children. Each hugs its content by default; mark the
|
|
35
|
+
* one that should take the slack with `grow`:
|
|
36
|
+
*
|
|
37
|
+
* ```html
|
|
38
|
+
* <ds-field-group>
|
|
39
|
+
* <ds-select [options]="scopes" />
|
|
40
|
+
* <ds-input grow placeholder="Search…" />
|
|
41
|
+
* </ds-field-group>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* A control knows it is a segment by injecting `DS_FIELD_GROUP` — see the token
|
|
45
|
+
* for why that is DI and not an input. Grouped controls must not carry a `label`
|
|
46
|
+
* or a `hint`: their own message row would break the glued line, so it is
|
|
47
|
+
* suppressed and a group-level one is not built yet.
|
|
48
|
+
*/
|
|
49
|
+
class FieldGroupComponent {
|
|
50
|
+
/** Segment height — the field family's scale, so a group lines up with a
|
|
51
|
+
* plain field beside it.
|
|
52
|
+
* Unset falls back to `DS_CONFIG.control.size`, then `'md'`. */
|
|
53
|
+
size = input(null, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
54
|
+
sizeResolved = resolveWithConfig(this.size, (config) => config.control?.size, 'md');
|
|
55
|
+
/** Draws the error border on the whole group. A single segment cannot be
|
|
56
|
+
* invalid on its own: the border belongs to the group. */
|
|
57
|
+
invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
58
|
+
/** Dims the group. Disable the CONTROLS too — this is the chrome, not their
|
|
59
|
+
* interactivity. */
|
|
60
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
61
|
+
/** Fills the container instead of hugging its segments. */
|
|
62
|
+
fullWidth = input(false, { ...(ngDevMode ? { debugName: "fullWidth" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
63
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: FieldGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
64
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: FieldGroupComponent, isStandalone: true, selector: "ds-field-group", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "class": "sizeResolved()", "class.invalid": "invalid()", "class.disabled": "disabled()", "class.full-width": "fullWidth()" } }, providers: [
|
|
65
|
+
{
|
|
66
|
+
provide: DS_FIELD_GROUP,
|
|
67
|
+
useExisting: forwardRef(() => FieldGroupComponent),
|
|
68
|
+
},
|
|
69
|
+
], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: ["@charset \"UTF-8\";:host{--_field-group-bg-color: var(--ds-field-group-bg-color, var(--surface-default));--_field-group-border-color: var(--ds-field-group-border-color, var(--border-default));--_field-group-border-color-focus: var(--ds-field-group-border-color-focus, var(--accent));--_field-group-border-color-error: var(--ds-field-group-border-color-error, var(--error));--_field-group-radius: var(--ds-field-group-radius, var(--ds-radius-control));--_field-group-focus-shadow: var(--ds-field-group-focus-shadow, var(--ds-field-focus-shadow));--_field-group-divider-color: var(--ds-field-group-divider-color, var(--border-divider));display:inline-flex;align-items:stretch;width:fit-content;max-width:100%;background-color:var(--_field-group-bg-color);border:var(--border-width-default) solid var(--_field-group-border-color);border-radius:var(--_field-group-radius);overflow:hidden;transition:border-color var(--duration-fast) var(--ease-standard);--_field-box-height: var(--ds-field-height, var(--field-h-md));height:var(--_field-box-height)}:host(.sm){--_field-box-height: var(--ds-field-height, var(--field-h-sm));height:var(--_field-box-height)}:host(.lg){--_field-box-height: var(--ds-field-height, var(--field-h-lg));height:var(--_field-box-height)}:host(.full-width){display:flex;width:100%}:host(:hover:not(.disabled)){border-color:var(--border-strong)}:host(:focus-within:not(.disabled)){border-color:var(--_field-group-border-color-focus);box-shadow:var(--_field-group-focus-shadow)}:host(.invalid){border-color:var(--_field-group-border-color-error)}:host(.disabled){background-color:var(--surface-disabled);border-color:var(--border-disabled)}:host ::ng-deep>*{flex:0 0 auto;min-width:0}:host ::ng-deep>[grow]{flex:1 1 0;min-width:0}:host ::ng-deep>*+*{border-left:var(--border-width-default) solid var(--_field-group-divider-color)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
70
|
+
}
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: FieldGroupComponent, decorators: [{
|
|
72
|
+
type: Component,
|
|
73
|
+
args: [{ selector: 'ds-field-group', standalone: true, template: '<ng-content></ng-content>', encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
74
|
+
role: 'group',
|
|
75
|
+
'[class]': 'sizeResolved()',
|
|
76
|
+
'[class.invalid]': 'invalid()',
|
|
77
|
+
'[class.disabled]': 'disabled()',
|
|
78
|
+
'[class.full-width]': 'fullWidth()',
|
|
79
|
+
}, providers: [
|
|
80
|
+
{
|
|
81
|
+
provide: DS_FIELD_GROUP,
|
|
82
|
+
useExisting: forwardRef(() => FieldGroupComponent),
|
|
83
|
+
},
|
|
84
|
+
], styles: ["@charset \"UTF-8\";:host{--_field-group-bg-color: var(--ds-field-group-bg-color, var(--surface-default));--_field-group-border-color: var(--ds-field-group-border-color, var(--border-default));--_field-group-border-color-focus: var(--ds-field-group-border-color-focus, var(--accent));--_field-group-border-color-error: var(--ds-field-group-border-color-error, var(--error));--_field-group-radius: var(--ds-field-group-radius, var(--ds-radius-control));--_field-group-focus-shadow: var(--ds-field-group-focus-shadow, var(--ds-field-focus-shadow));--_field-group-divider-color: var(--ds-field-group-divider-color, var(--border-divider));display:inline-flex;align-items:stretch;width:fit-content;max-width:100%;background-color:var(--_field-group-bg-color);border:var(--border-width-default) solid var(--_field-group-border-color);border-radius:var(--_field-group-radius);overflow:hidden;transition:border-color var(--duration-fast) var(--ease-standard);--_field-box-height: var(--ds-field-height, var(--field-h-md));height:var(--_field-box-height)}:host(.sm){--_field-box-height: var(--ds-field-height, var(--field-h-sm));height:var(--_field-box-height)}:host(.lg){--_field-box-height: var(--ds-field-height, var(--field-h-lg));height:var(--_field-box-height)}:host(.full-width){display:flex;width:100%}:host(:hover:not(.disabled)){border-color:var(--border-strong)}:host(:focus-within:not(.disabled)){border-color:var(--_field-group-border-color-focus);box-shadow:var(--_field-group-focus-shadow)}:host(.invalid){border-color:var(--_field-group-border-color-error)}:host(.disabled){background-color:var(--surface-disabled);border-color:var(--border-disabled)}:host ::ng-deep>*{flex:0 0 auto;min-width:0}:host ::ng-deep>[grow]{flex:1 1 0;min-width:0}:host ::ng-deep>*+*{border-left:var(--border-width-default) solid var(--_field-group-divider-color)}\n"] }]
|
|
85
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }] } });
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Generated bundle index. Do not edit.
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
export { DS_FIELD_GROUP, FieldGroupComponent, inFieldGroup };
|
|
92
|
+
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-field-group.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-field-group.mjs","sources":["../../../src/lib/components/field-group/field-group.token.ts","../../../src/lib/components/field-group/field-group.component.ts","../../../src/lib/components/field-group/ids-group-ltd-ids-design-system-components-field-group.ts"],"sourcesContent":["import { InjectionToken, inject } from '@angular/core';\nimport type { DsSize } from '@ids-group-ltd/ids-design-system/core';\n\n/** What a grouped control can read off the group that encloses it. */\nexport interface DsFieldGroupContext {\n /** The group's size, so a segment matches its neighbours without being told.\n * Resolved, not the raw input: `size` is unset by default and falls back to\n * `DS_CONFIG.control.size`, which a segment must not have to resolve again. */\n readonly sizeResolved: () => DsSize;\n}\n\n/**\n * Provided by `ds-field-group`, injected `{ optional: true }` by every control\n * that can be a segment.\n *\n * DI rather than a `[grouped]` input on each child: the alternative is manual,\n * and one segment where it was forgotten renders its own border and radius in\n * the middle of a glued row — a broken control that still looks deliberate.\n * Presence of the token IS the fact the child needs, and the consumer already\n * declared it by wrapping them.\n */\nexport const DS_FIELD_GROUP = new InjectionToken<DsFieldGroupContext>(\n 'DS_FIELD_GROUP',\n);\n\n/**\n * Whether this control is a segment of a `ds-field-group`. Call it in a field\n * component and bind the result to a host `.in-group` class; the component's own\n * `.in-group` block then strips the chrome the group has taken over.\n *\n * A function so the six supported controls share one line instead of six copies\n * of the same optional inject — and so the contract has one place to change.\n * @internal\n */\nexport function inFieldGroup(): boolean {\n return !!inject(DS_FIELD_GROUP, { optional: true });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n booleanAttribute,\n forwardRef,\n input,\n} from '@angular/core';\nimport type { DsSize } from '@ids-group-ltd/ids-design-system/core';\nimport { DS_FIELD_GROUP, type DsFieldGroupContext } from './field-group.token';\nimport { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';\n\n/**\n * One bordered control out of several: `select + input`, `search + button`,\n * `button + select`. The group owns the border, the radius, the focus ring and\n * the divider between segments; the controls inside render \"naked\".\n *\n * Segments are the direct children. Each hugs its content by default; mark the\n * one that should take the slack with `grow`:\n *\n * ```html\n * <ds-field-group>\n * <ds-select [options]=\"scopes\" />\n * <ds-input grow placeholder=\"Search…\" />\n * </ds-field-group>\n * ```\n *\n * A control knows it is a segment by injecting `DS_FIELD_GROUP` — see the token\n * for why that is DI and not an input. Grouped controls must not carry a `label`\n * or a `hint`: their own message row would break the glued line, so it is\n * suppressed and a group-level one is not built yet.\n */\n@Component({\n selector: 'ds-field-group',\n standalone: true,\n template: '<ng-content></ng-content>',\n styleUrl: './field-group.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n role: 'group',\n '[class]': 'sizeResolved()',\n '[class.invalid]': 'invalid()',\n '[class.disabled]': 'disabled()',\n '[class.full-width]': 'fullWidth()',\n },\n providers: [\n {\n provide: DS_FIELD_GROUP,\n useExisting: forwardRef(() => FieldGroupComponent),\n },\n ],\n})\nexport class FieldGroupComponent implements DsFieldGroupContext {\n /** Segment height — the field family's scale, so a group lines up with a\n * plain field beside it.\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 /** Draws the error border on the whole group. A single segment cannot be\n * invalid on its own: the border belongs to the group. */\n readonly invalid = input(false, { transform: booleanAttribute });\n /** Dims the group. Disable the CONTROLS too — this is the chrome, not their\n * interactivity. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Fills the container instead of hugging its segments. */\n readonly fullWidth = input(false, { transform: booleanAttribute });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAWA;;;;;;;;;AASG;MACU,cAAc,GAAG,IAAI,cAAc,CAC9C,gBAAgB;AAGlB;;;;;;;;AAQG;SACa,YAAY,G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wBAAA;AACE,4BAAA,OAAO,EAAE,cAAc;AACvB,4BAAA,WAAW,EAAE,UAAU,CAAC,yBAAyB,CAAC;AACnD,yBAAA;AACF,qBAAA,EAAA,MAAA,EAAA,CAAA,2zDAAA,CAAA,EAAA;;;ACnDH;;AAEG;;;;"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, inject, computed, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
|
|
4
|
+
import { DS_CONFIG } from '@ids-group-ltd/ids-design-system/core';
|
|
5
|
+
|
|
6
|
+
/** Internal shared helper/error line for form fields. Renders nothing when
|
|
7
|
+
* `text` is empty. The host field owns the `aria-describedby` relationship
|
|
8
|
+
* and passes `messageId`; this only renders the element that carries it.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
class FieldMessageComponent {
|
|
12
|
+
/** The one line under a field. Empty renders nothing (or reserved space, if the field asks). */
|
|
13
|
+
text = input('', ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
14
|
+
/** Which role the line is playing — hint, error, warning or success. Decides the colour. */
|
|
15
|
+
state = input('default', ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
16
|
+
/** Id the field points `aria-describedby` at, so the message is announced with the control. */
|
|
17
|
+
messageId = input(null, ...(ngDevMode ? [{ debugName: "messageId" }] : /* istanbul ignore next */ []));
|
|
18
|
+
/** Leading glyph. Unset resolves from the state through
|
|
19
|
+
* `DS_CONFIG.field.stateIcons` — error, warning and success carry one by default and
|
|
20
|
+
* the hint line does not. A name here overrides that for this message; `false`
|
|
21
|
+
* removes it. */
|
|
22
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
23
|
+
/** Reserve one line of height even when there's no `text`, so a field that
|
|
24
|
+
* gains/loses a message doesn't shift the layout below it. */
|
|
25
|
+
reserve = input(false, { ...(ngDevMode ? { debugName: "reserve" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
26
|
+
config = inject(DS_CONFIG);
|
|
27
|
+
/** `hint` rather than `default` in the config: every field calls this line a hint,
|
|
28
|
+
* and `default` would read as "the default icon". */
|
|
29
|
+
static BUILT_IN = {
|
|
30
|
+
error: 'error',
|
|
31
|
+
warning: 'warn',
|
|
32
|
+
success: 'success',
|
|
33
|
+
default: false,
|
|
34
|
+
};
|
|
35
|
+
iconResolved = computed(() => {
|
|
36
|
+
const own = this.icon();
|
|
37
|
+
if (own !== null) {
|
|
38
|
+
return own === false ? null : own;
|
|
39
|
+
}
|
|
40
|
+
const configured = this.config.field?.stateIcons;
|
|
41
|
+
if (configured === false) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
const state = this.state();
|
|
45
|
+
const key = state === 'default' ? 'hint' : state;
|
|
46
|
+
const resolved = configured?.[key] ?? FieldMessageComponent.BUILT_IN[state];
|
|
47
|
+
return resolved === false ? null : resolved;
|
|
48
|
+
}, ...(ngDevMode ? [{ debugName: "iconResolved" }] : /* istanbul ignore next */ []));
|
|
49
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: FieldMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
50
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: FieldMessageComponent, isStandalone: true, selector: "ds-field-message", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, messageId: { classPropertyName: "messageId", publicName: "messageId", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, reserve: { classPropertyName: "reserve", publicName: "reserve", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<!-- The error variant is a separate branch so it mounts as a FRESH node with\n role=\"alert\" already set \u2014 screen readers reliably announce a live region\n on insertion, but not when role=\"alert\" is toggled onto an existing node. -->\n@if (text()) {\n @if (state() === 'error') {\n <span\n class=\"field-message error\"\n role=\"alert\"\n [id]=\"messageId()\"\n >\n @if (iconResolved(); as glyph) {\n <ds-icon\n class=\"message-icon\"\n [name]=\"glyph\"\n [size]=\"14\"\n />\n }\n {{ text() }}\n </span>\n } @else {\n <span\n class=\"field-message {{ state() }}\"\n [id]=\"messageId()\"\n >\n @if (iconResolved(); as glyph) {\n <ds-icon\n class=\"message-icon\"\n [name]=\"glyph\"\n [size]=\"14\"\n />\n }\n {{ text() }}\n </span>\n }\n} @else if (reserve()) {\n <span\n class=\"field-message reserve-placeholder\"\n aria-hidden=\"true\"\n >\n </span>\n}\n", styles: ["@charset \"UTF-8\";:host{display:contents}.field-message{--_field-message-color: var(--ds-field-message-color, var(--text-tertiary));--_field-message-font-size: var(--ds-field-message-font-size, var(--font-size-xs));--_field-message-icon-gap: var(--ds-field-message-icon-gap, var(--space-1));--_field-message-icon-offset: var(--ds-field-message-icon-offset, calc((var(--_field-message-font-size) * var(--line-height-base) - var(--icon-sm)) / 2));display:flex;align-items:flex-start;gap:var(--_field-message-icon-gap);font:var(--font-weight-regular) var(--_field-message-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-message-color)}.field-message .message-icon{margin-top:var(--_field-message-icon-offset)}.field-message.error{color:var(--error-text)}.field-message.warning{color:var(--warning-text)}.field-message.success{color:var(--success-text)}.field-message.reserve-placeholder:before{content:\"\\a0\"}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
51
|
+
}
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: FieldMessageComponent, decorators: [{
|
|
53
|
+
type: Component,
|
|
54
|
+
args: [{ selector: 'ds-field-message', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<!-- The error variant is a separate branch so it mounts as a FRESH node with\n role=\"alert\" already set \u2014 screen readers reliably announce a live region\n on insertion, but not when role=\"alert\" is toggled onto an existing node. -->\n@if (text()) {\n @if (state() === 'error') {\n <span\n class=\"field-message error\"\n role=\"alert\"\n [id]=\"messageId()\"\n >\n @if (iconResolved(); as glyph) {\n <ds-icon\n class=\"message-icon\"\n [name]=\"glyph\"\n [size]=\"14\"\n />\n }\n {{ text() }}\n </span>\n } @else {\n <span\n class=\"field-message {{ state() }}\"\n [id]=\"messageId()\"\n >\n @if (iconResolved(); as glyph) {\n <ds-icon\n class=\"message-icon\"\n [name]=\"glyph\"\n [size]=\"14\"\n />\n }\n {{ text() }}\n </span>\n }\n} @else if (reserve()) {\n <span\n class=\"field-message reserve-placeholder\"\n aria-hidden=\"true\"\n >\n </span>\n}\n", styles: ["@charset \"UTF-8\";:host{display:contents}.field-message{--_field-message-color: var(--ds-field-message-color, var(--text-tertiary));--_field-message-font-size: var(--ds-field-message-font-size, var(--font-size-xs));--_field-message-icon-gap: var(--ds-field-message-icon-gap, var(--space-1));--_field-message-icon-offset: var(--ds-field-message-icon-offset, calc((var(--_field-message-font-size) * var(--line-height-base) - var(--icon-sm)) / 2));display:flex;align-items:flex-start;gap:var(--_field-message-icon-gap);font:var(--font-weight-regular) var(--_field-message-font-size)/var(--line-height-base) var(--font-sans);color:var(--_field-message-color)}.field-message .message-icon{margin-top:var(--_field-message-icon-offset)}.field-message.error{color:var(--error-text)}.field-message.warning{color:var(--warning-text)}.field-message.success{color:var(--success-text)}.field-message.reserve-placeholder:before{content:\"\\a0\"}\n"] }]
|
|
55
|
+
}], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], messageId: [{ type: i0.Input, args: [{ isSignal: true, alias: "messageId", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], reserve: [{ type: i0.Input, args: [{ isSignal: true, alias: "reserve", required: false }] }] } });
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Generated bundle index. Do not edit.
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
export { FieldMessageComponent };
|
|
62
|
+
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-field-message.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-field-message.mjs","sources":["../../../src/lib/components/field-message/field-message.component.ts","../../../src/lib/components/field-message/field-message.component.html","../../../src/lib/components/field-message/ids-group-ltd-ids-design-system-components-field-message.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n inject,\n input,\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 { DS_CONFIG } from '@ids-group-ltd/ids-design-system/core';\n\n/** @internal */\nexport type FieldMessageState = 'default' | 'error' | 'warning' | 'success';\n\n/** Internal shared helper/error line for form fields. Renders nothing when\n * `text` is empty. The host field owns the `aria-describedby` relationship\n * and passes `messageId`; this only renders the element that carries it.\n * @internal\n */\n@Component({\n selector: 'ds-field-message',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './field-message.component.html',\n styleUrl: './field-message.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class FieldMessageComponent {\n /** The one line under a field. Empty renders nothing (or reserved space, if the field asks). */\n readonly text = input<string>('');\n /** Which role the line is playing — hint, error, warning or success. Decides the colour. */\n readonly state = input<FieldMessageState>('default');\n /** Id the field points `aria-describedby` at, so the message is announced with the control. */\n readonly messageId = input<string | null>(null);\n /** Leading glyph. Unset resolves from the state through\n * `DS_CONFIG.field.stateIcons` — error, warning and success carry one by default and\n * the hint line does not. A name here overrides that for this message; `false`\n * removes it. */\n readonly icon = input<IconName | false | null>(null);\n /** Reserve one line of height even when there's no `text`, so a field that\n * gains/loses a message doesn't shift the layout below it. */\n readonly reserve = input(false, { transform: booleanAttribute });\n\n private readonly config = inject(DS_CONFIG);\n\n /** `hint` rather than `default` in the config: every field calls this line a hint,\n * and `default` would read as \"the default icon\". */\n private static readonly BUILT_IN: Record<\n FieldMessageState,\n IconName | false\n > = {\n error: 'error',\n warning: 'warn',\n success: 'success',\n default: false,\n };\n\n protected readonly iconResolved = computed<IconName | null>(() => {\n const own = this.icon();\n if (own !== null) {\n return own === false ? null : own;\n }\n const configured = this.config.field?.stateIcons;\n if (configured === false) {\n return null;\n }\n const state = this.state();\n const key = state === 'default' ? 'hint' : state;\n const resolved = configured?.[key] ?? FieldMessageComponent.BUILT_IN[state];\n\n return resolved === false ? null : resolved;\n });\n}\n","<!-- The error variant is a separate branch so it mounts as a FRESH node with\n role=\"alert\" already set — screen readers reliably announce a live region\n on insertion, but not when role=\"alert\" is toggled onto an existing node. -->\n@if (text()) {\n @if (state() === 'error') {\n <span\n class=\"field-message error\"\n role=\"alert\"\n [id]=\"messageId()\"\n >\n @if (iconResolved(); as glyph) {\n <ds-icon\n class=\"message-icon\"\n [name]=\"glyph\"\n [size]=\"14\"\n />\n }\n {{ text() }}\n </span>\n } @else {\n <span\n class=\"field-message {{ state() }}\"\n [id]=\"messageId()\"\n >\n @if (iconResolved(); as glyph) {\n <ds-icon\n class=\"message-icon\"\n [name]=\"glyph\"\n [size]=\"14\"\n />\n }\n {{ text() }}\n </span>\n }\n} @else if (reserve()) {\n <span\n class=\"field-message reserve-placeholder\"\n aria-hidden=\"true\"\n >\n </span>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAeA;;;;AAIG;MASU,qBAAqB,CAAA;;AAEvB,IAAA,IAAI,GAAG,KAAK,CAAS,EAAE,2EAAC;;AAExB,IAAA,KAAK,GAAG,KAAK,CAAoB,SAAS,4EAAC;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