dap-design-system 0.62.4 → 1.0.0-beta.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/README.md +5 -1
- package/dist/common/utils.js +46 -46
- package/dist/common/utils.js.map +1 -1
- package/dist/components/accordion/accordion-base-element.js +15 -19
- package/dist/components/accordion/accordion-base-element.js.map +1 -1
- package/dist/components/accordion-group/accordion-group.component.js +20 -24
- package/dist/components/accordion-group/accordion-group.component.js.map +1 -1
- package/dist/components/anchor-heading/anchor-heading.component.js +19 -22
- package/dist/components/anchor-heading/anchor-heading.component.js.map +1 -1
- package/dist/components/avatar/avatar.component.js +51 -55
- package/dist/components/avatar/avatar.component.js.map +1 -1
- package/dist/components/avatar-group/avatar-group.component.js +18 -22
- package/dist/components/avatar-group/avatar-group.component.js.map +1 -1
- package/dist/components/badge/badge.component.js +17 -20
- package/dist/components/badge/badge.component.js.map +1 -1
- package/dist/components/banner/banner.component.js +18 -24
- package/dist/components/banner/banner.component.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +1 -0
- package/dist/components/breadcrumb/breadcrumb.component.js +32 -32
- package/dist/components/breadcrumb/breadcrumb.component.js.map +1 -1
- package/dist/components/breadcrumb-item/breadcrumb-item.component.d.ts +8 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.component.js +33 -28
- package/dist/components/breadcrumb-item/breadcrumb-item.component.js.map +1 -1
- package/dist/components/button/_styles/button.scss.js +1 -1
- package/dist/components/button/button.component.js +18 -22
- package/dist/components/button/button.component.js.map +1 -1
- package/dist/components/button-group/_styles/button-group-separator.scss.js +5 -0
- package/dist/components/button-group/_styles/button-group-separator.scss.js.map +1 -0
- package/dist/components/button-group/_styles/button-group-text.scss.js +5 -0
- package/dist/components/button-group/_styles/button-group-text.scss.js.map +1 -0
- package/dist/components/button-group/_styles/button-group.scss.js +5 -0
- package/dist/components/button-group/_styles/button-group.scss.js.map +1 -0
- package/dist/components/button-group/button-group-separator.component.d.ts +28 -0
- package/dist/components/button-group/button-group-separator.component.js +18 -0
- package/dist/components/button-group/button-group-separator.component.js.map +1 -0
- package/dist/components/button-group/button-group-separator.d.ts +8 -0
- package/dist/components/button-group/button-group-separator.js +6 -0
- package/dist/components/button-group/button-group-separator.js.map +1 -0
- package/dist/components/button-group/button-group-text.component.d.ts +33 -0
- package/dist/components/button-group/button-group-text.component.js +17 -0
- package/dist/components/button-group/button-group-text.component.js.map +1 -0
- package/dist/components/button-group/button-group-text.d.ts +8 -0
- package/dist/components/button-group/button-group-text.js +6 -0
- package/dist/components/button-group/button-group-text.js.map +1 -0
- package/dist/components/button-group/button-group.component.d.ts +52 -0
- package/dist/components/button-group/button-group.component.js +30 -0
- package/dist/components/button-group/button-group.component.js.map +1 -0
- package/dist/components/button-group/button-group.d.ts +8 -0
- package/dist/components/button-group/button-group.js +6 -0
- package/dist/components/button-group/button-group.js.map +1 -0
- package/dist/components/calendar/calendar-cell.component.js +26 -29
- package/dist/components/calendar/calendar-cell.component.js.map +1 -1
- package/dist/components/calendar/calendar.component.d.ts +7 -1
- package/dist/components/calendar/calendar.component.js +37 -46
- package/dist/components/calendar/calendar.component.js.map +1 -1
- package/dist/components/callout/callout.component.d.ts +3 -0
- package/dist/components/callout/callout.component.js +71 -69
- package/dist/components/callout/callout.component.js.map +1 -1
- package/dist/components/card/card-actions.component.js +8 -11
- package/dist/components/card/card-actions.component.js.map +1 -1
- package/dist/components/card/card-content.component.js +20 -23
- package/dist/components/card/card-content.component.js.map +1 -1
- package/dist/components/card/card-image.component.js +18 -21
- package/dist/components/card/card-image.component.js.map +1 -1
- package/dist/components/card/card-subtitle.component.js +18 -21
- package/dist/components/card/card-subtitle.component.js.map +1 -1
- package/dist/components/card/card-title.component.js +18 -21
- package/dist/components/card/card-title.component.js.map +1 -1
- package/dist/components/card/card.component.js +25 -28
- package/dist/components/card/card.component.js.map +1 -1
- package/dist/components/checkbox/_styles/checkbox.scss.js +1 -1
- package/dist/components/checkbox/checkbox.component.js +71 -74
- package/dist/components/checkbox/checkbox.component.js.map +1 -1
- package/dist/components/chip/chip.component.js +21 -26
- package/dist/components/chip/chip.component.js.map +1 -1
- package/dist/components/code-puncher/code-puncher-slot.component.js +34 -38
- package/dist/components/code-puncher/code-puncher-slot.component.js.map +1 -1
- package/dist/components/code-puncher/code-puncher.component.js +97 -102
- package/dist/components/code-puncher/code-puncher.component.js.map +1 -1
- package/dist/components/code-puncher/code-puncher.context.js +1 -1
- package/dist/components/code-puncher/code-puncher.context.js.map +1 -1
- package/dist/components/code-puncher/code-puncher.scss.js +1 -1
- package/dist/components/combobox/combobox.component.d.ts +3 -1
- package/dist/components/combobox/combobox.component.js.map +1 -1
- package/dist/components/combobox/combobox.scss.js +1 -1
- package/dist/components/combobox/comboboxBase.d.ts +21 -0
- package/dist/components/combobox/comboboxBase.js +176 -139
- package/dist/components/combobox/comboboxBase.js.map +1 -1
- package/dist/components/command/command-group.component.js +19 -23
- package/dist/components/command/command-group.component.js.map +1 -1
- package/dist/components/command/command-item.component.js +17 -22
- package/dist/components/command/command-item.component.js.map +1 -1
- package/dist/components/command/command.component.js +28 -33
- package/dist/components/command/command.component.js.map +1 -1
- package/dist/components/content-switcher/content-switcher-item.component.js +16 -19
- package/dist/components/content-switcher/content-switcher-item.component.js.map +1 -1
- package/dist/components/content-switcher/content-switcher.component.js +19 -22
- package/dist/components/content-switcher/content-switcher.component.js.map +1 -1
- package/dist/components/copybox-input/copybox-input.component.js +12 -16
- package/dist/components/copybox-input/copybox-input.component.js.map +1 -1
- package/dist/components/dap-badge/dap-badge.component.js +13 -18
- package/dist/components/dap-badge/dap-badge.component.js.map +1 -1
- package/dist/components/datatable/datatable.component.js +38 -42
- package/dist/components/datatable/datatable.component.js.map +1 -1
- package/dist/components/datatable/utils/cell-renderer.js +6 -8
- package/dist/components/datatable/utils/cell-renderer.js.map +1 -1
- package/dist/components/datepicker/datepicker.component.js +76 -81
- package/dist/components/datepicker/datepicker.component.js.map +1 -1
- package/dist/components/datepicker/datepicker.scss.js +1 -1
- package/dist/components/divider/divider.component.js +18 -21
- package/dist/components/divider/divider.component.js.map +1 -1
- package/dist/components/feedback/feedback.component.js +8 -11
- package/dist/components/feedback/feedback.component.js.map +1 -1
- package/dist/components/file-input/file-input-list-item.component.js +36 -40
- package/dist/components/file-input/file-input-list-item.component.js.map +1 -1
- package/dist/components/file-input/file-input-list.component.js +15 -20
- package/dist/components/file-input/file-input-list.component.js.map +1 -1
- package/dist/components/file-input/file-input-list.scss.js +1 -1
- package/dist/components/file-input/file-input.component.js +135 -142
- package/dist/components/file-input/file-input.component.js.map +1 -1
- package/dist/components/file-input/file-input.scss.js +1 -1
- package/dist/components/form/form-label/form-label.component.js +20 -23
- package/dist/components/form/form-label/form-label.component.js.map +1 -1
- package/dist/components/form/input-group/input-group.component.js +42 -42
- package/dist/components/form/input-group/input-group.component.js.map +1 -1
- package/dist/components/form/input-group/input-group.scss.js +2 -2
- package/dist/components/form/radio-group/radio-group.component.js +54 -55
- package/dist/components/form/radio-group/radio-group.component.js.map +1 -1
- package/dist/components/icon/icon.component.js +25 -28
- package/dist/components/icon/icon.component.js.map +1 -1
- package/dist/components/icon-button/icon-button.component.js +11 -14
- package/dist/components/icon-button/icon-button.component.js.map +1 -1
- package/dist/components/icon-button/icon-button.scss.js +1 -1
- package/dist/components/icons/arrows/arrows-arrow-down-line/arrows-arrow-down-line.component.js +9 -12
- package/dist/components/icons/arrows/arrows-arrow-down-line/arrows-arrow-down-line.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-down-s-fill/arrows-arrow-down-s-fill.component.js +7 -10
- package/dist/components/icons/arrows/arrows-arrow-down-s-fill/arrows-arrow-down-s-fill.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-down-s-line/arrows-arrow-down-s-line.component.js +12 -15
- package/dist/components/icons/arrows/arrows-arrow-down-s-line/arrows-arrow-down-s-line.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-left-down-line/arrows-arrow-left-down-line.component.js +8 -11
- package/dist/components/icons/arrows/arrows-arrow-left-down-line/arrows-arrow-left-down-line.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-left-l-line/arrows-arrow-left-l-line.component.js +15 -18
- package/dist/components/icons/arrows/arrows-arrow-left-l-line/arrows-arrow-left-l-line.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-left-line/arrows-arrow-left-line.component.js +7 -10
- package/dist/components/icons/arrows/arrows-arrow-left-line/arrows-arrow-left-line.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-left-s-fill/arrows-arrow-left-s-fill.component.js +10 -13
- package/dist/components/icons/arrows/arrows-arrow-left-s-fill/arrows-arrow-left-s-fill.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-left-s-line/arrows-arrow-left-s-line.component.js +7 -10
- package/dist/components/icons/arrows/arrows-arrow-left-s-line/arrows-arrow-left-s-line.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-left-up-line/arrows-arrow-left-up-line.component.js +6 -9
- package/dist/components/icons/arrows/arrows-arrow-left-up-line/arrows-arrow-left-up-line.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-right-down-line/arrows-arrow-right-down-line.component.js +18 -21
- package/dist/components/icons/arrows/arrows-arrow-right-down-line/arrows-arrow-right-down-line.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-right-l-line/arrows-arrow-right-l-line.component.js +15 -18
- package/dist/components/icons/arrows/arrows-arrow-right-l-line/arrows-arrow-right-l-line.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-right-line/arrows-arrow-right-line.component.js +17 -20
- package/dist/components/icons/arrows/arrows-arrow-right-line/arrows-arrow-right-line.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-right-s-fill/arrows-arrow-right-s-fill.component.js +17 -20
- package/dist/components/icons/arrows/arrows-arrow-right-s-fill/arrows-arrow-right-s-fill.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-right-s-line/arrows-arrow-right-s-line.component.js +17 -20
- package/dist/components/icons/arrows/arrows-arrow-right-s-line/arrows-arrow-right-s-line.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-right-up-line/arrows-arrow-right-up-line.component.js +18 -21
- package/dist/components/icons/arrows/arrows-arrow-right-up-line/arrows-arrow-right-up-line.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-up-line/arrows-arrow-up-line.component.js +9 -12
- package/dist/components/icons/arrows/arrows-arrow-up-line/arrows-arrow-up-line.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-up-s-fill/arrows-arrow-up-s-fill.component.js +8 -11
- package/dist/components/icons/arrows/arrows-arrow-up-s-fill/arrows-arrow-up-s-fill.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-arrow-up-s-line/arrows-arrow-up-s-line.component.js +9 -12
- package/dist/components/icons/arrows/arrows-arrow-up-s-line/arrows-arrow-up-s-line.component.js.map +1 -1
- package/dist/components/icons/arrows/arrows-expand-up-down-fill/arrows-expand-up-down-fill.component.js +11 -14
- package/dist/components/icons/arrows/arrows-expand-up-down-fill/arrows-expand-up-down-fill.component.js.map +1 -1
- package/dist/components/icons/buildings/buildings-home-6-line/buildings-home-6-line.component.js +10 -13
- package/dist/components/icons/buildings/buildings-home-6-line/buildings-home-6-line.component.js.map +1 -1
- package/dist/components/icons/business/business-calendar-line/business-calendar-line.component.js +11 -14
- package/dist/components/icons/business/business-calendar-line/business-calendar-line.component.js.map +1 -1
- package/dist/components/icons/design/design-edit-line/design-edit-line.component.js +6 -9
- package/dist/components/icons/design/design-edit-line/design-edit-line.component.js.map +1 -1
- package/dist/components/icons/design/design-tools-line/design-tools-line.component.js +12 -15
- package/dist/components/icons/design/design-tools-line/design-tools-line.component.js.map +1 -1
- package/dist/components/icons/device/device-computer-line/device-computer-line.component.js +16 -19
- package/dist/components/icons/device/device-computer-line/device-computer-line.component.js.map +1 -1
- package/dist/components/icons/document/document-clipboard-line/document-clipboard-line.component.js +11 -14
- package/dist/components/icons/document/document-clipboard-line/document-clipboard-line.component.js.map +1 -1
- package/dist/components/icons/document/document-file-copy-line/document-file-copy-line.component.js +10 -13
- package/dist/components/icons/document/document-file-copy-line/document-file-copy-line.component.js.map +1 -1
- package/dist/components/icons/document/document-file-image-line/document-file-image-line.component.js +11 -14
- package/dist/components/icons/document/document-file-image-line/document-file-image-line.component.js.map +1 -1
- package/dist/components/icons/document/document-file-music-line/document-file-music-line.component.js +11 -14
- package/dist/components/icons/document/document-file-music-line/document-file-music-line.component.js.map +1 -1
- package/dist/components/icons/document/document-file-text-line/document-file-text-line.component.js +10 -13
- package/dist/components/icons/document/document-file-text-line/document-file-text-line.component.js.map +1 -1
- package/dist/components/icons/document/document-file-video-line/document-file-video-line.component.js +11 -14
- package/dist/components/icons/document/document-file-video-line/document-file-video-line.component.js.map +1 -1
- package/dist/components/icons/document/document-folder-line/document-folder-line.component.js +11 -14
- package/dist/components/icons/document/document-folder-line/document-folder-line.component.js.map +1 -1
- package/dist/components/icons/document/document-folder-open-line/document-folder-open-line.component.js +10 -13
- package/dist/components/icons/document/document-folder-open-line/document-folder-open-line.component.js.map +1 -1
- package/dist/components/icons/editor/editor-separator/editor-separator.component.js +10 -13
- package/dist/components/icons/editor/editor-separator/editor-separator.component.js.map +1 -1
- package/dist/components/icons/health/health-heart-fill/health-heart-fill.component.js +8 -11
- package/dist/components/icons/health/health-heart-fill/health-heart-fill.component.js.map +1 -1
- package/dist/components/icons/health/health-heart-line/health-heart-line.component.js +10 -13
- package/dist/components/icons/health/health-heart-line/health-heart-line.component.js.map +1 -1
- package/dist/components/icons/others/others-cookie-line/others-cookie-line.component.js +6 -9
- package/dist/components/icons/others/others-cookie-line/others-cookie-line.component.js.map +1 -1
- package/dist/components/icons/system/system-add-line/system-add-line.component.js +11 -14
- package/dist/components/icons/system/system-add-line/system-add-line.component.js.map +1 -1
- package/dist/components/icons/system/system-alert-fill/system-alert-fill.component.js +9 -12
- package/dist/components/icons/system/system-alert-fill/system-alert-fill.component.js.map +1 -1
- package/dist/components/icons/system/system-alert-line/system-alert-line.component.js +11 -14
- package/dist/components/icons/system/system-alert-line/system-alert-line.component.js.map +1 -1
- package/dist/components/icons/system/system-check-line/system-check-line.component.js +9 -12
- package/dist/components/icons/system/system-check-line/system-check-line.component.js.map +1 -1
- package/dist/components/icons/system/system-check-line2/system-check-line2.component.js +11 -14
- package/dist/components/icons/system/system-check-line2/system-check-line2.component.js.map +1 -1
- package/dist/components/icons/system/system-checkbox-blank-circle-fill/system-checkbox-blank-circle-fill.component.js +9 -12
- package/dist/components/icons/system/system-checkbox-blank-circle-fill/system-checkbox-blank-circle-fill.component.js.map +1 -1
- package/dist/components/icons/system/system-checkbox-blank-circle-fill-check/system-checkbox-blank-circle-fill-check.component.js +12 -15
- package/dist/components/icons/system/system-checkbox-blank-circle-fill-check/system-checkbox-blank-circle-fill-check.component.js.map +1 -1
- package/dist/components/icons/system/system-checkbox-blank-circle-line/system-checkbox-blank-circle-line.component.js +13 -16
- package/dist/components/icons/system/system-checkbox-blank-circle-line/system-checkbox-blank-circle-line.component.js.map +1 -1
- package/dist/components/icons/system/system-checkbox-circle-fill/system-checkbox-circle-fill.component.js +11 -14
- package/dist/components/icons/system/system-checkbox-circle-fill/system-checkbox-circle-fill.component.js.map +1 -1
- package/dist/components/icons/system/system-checkbox-circle-line/system-checkbox-circle-line.component.js +11 -14
- package/dist/components/icons/system/system-checkbox-circle-line/system-checkbox-circle-line.component.js.map +1 -1
- package/dist/components/icons/system/system-close-circle-fill/system-close-circle-fill.component.js +11 -14
- package/dist/components/icons/system/system-close-circle-fill/system-close-circle-fill.component.js.map +1 -1
- package/dist/components/icons/system/system-close-circle-line/system-close-circle-line.component.js +7 -10
- package/dist/components/icons/system/system-close-circle-line/system-close-circle-line.component.js.map +1 -1
- package/dist/components/icons/system/system-close-fill/system-close-fill.component.js +11 -14
- package/dist/components/icons/system/system-close-fill/system-close-fill.component.js.map +1 -1
- package/dist/components/icons/system/system-close-line/system-close-line.component.js +11 -14
- package/dist/components/icons/system/system-close-line/system-close-line.component.js.map +1 -1
- package/dist/components/icons/system/system-delete-bin-fill/system-delete-bin-fill.component.js +7 -10
- package/dist/components/icons/system/system-delete-bin-fill/system-delete-bin-fill.component.js.map +1 -1
- package/dist/components/icons/system/system-delete-bin-line/system-delete-bin-line.component.js +9 -12
- package/dist/components/icons/system/system-delete-bin-line/system-delete-bin-line.component.js.map +1 -1
- package/dist/components/icons/system/system-download-line/system-download-line.component.js +9 -12
- package/dist/components/icons/system/system-download-line/system-download-line.component.js.map +1 -1
- package/dist/components/icons/system/system-error-warning-fill/system-error-warning-fill.component.js +7 -10
- package/dist/components/icons/system/system-error-warning-fill/system-error-warning-fill.component.js.map +1 -1
- package/dist/components/icons/system/system-error-warning-line/system-error-warning-line.component.js +11 -14
- package/dist/components/icons/system/system-error-warning-line/system-error-warning-line.component.js.map +1 -1
- package/dist/components/icons/system/system-external-link-line/system-external-link-line.component.js +9 -12
- package/dist/components/icons/system/system-external-link-line/system-external-link-line.component.js.map +1 -1
- package/dist/components/icons/system/system-eye-line/system-eye-line.component.js +11 -14
- package/dist/components/icons/system/system-eye-line/system-eye-line.component.js.map +1 -1
- package/dist/components/icons/system/system-eye-off-line/system-eye-off-line.component.js +6 -9
- package/dist/components/icons/system/system-eye-off-line/system-eye-off-line.component.js.map +1 -1
- package/dist/components/icons/system/system-forbid-fill/system-forbid-fill.component.js +9 -12
- package/dist/components/icons/system/system-forbid-fill/system-forbid-fill.component.js.map +1 -1
- package/dist/components/icons/system/system-information-2-fill/system-information-2-fill.component.js +9 -12
- package/dist/components/icons/system/system-information-2-fill/system-information-2-fill.component.js.map +1 -1
- package/dist/components/icons/system/system-information-fill/system-information-fill.component.js +9 -12
- package/dist/components/icons/system/system-information-fill/system-information-fill.component.js.map +1 -1
- package/dist/components/icons/system/system-information-line/system-information-line.component.js +9 -12
- package/dist/components/icons/system/system-information-line/system-information-line.component.js.map +1 -1
- package/dist/components/icons/system/system-lightbulb-fill/system-lightbulb-fill.component.js +9 -12
- package/dist/components/icons/system/system-lightbulb-fill/system-lightbulb-fill.component.js.map +1 -1
- package/dist/components/icons/system/system-loading-spinner/system-loading-spinner.component.js +9 -12
- package/dist/components/icons/system/system-loading-spinner/system-loading-spinner.component.js.map +1 -1
- package/dist/components/icons/system/system-lock-fill/system-lock-fill.component.js +13 -16
- package/dist/components/icons/system/system-lock-fill/system-lock-fill.component.js.map +1 -1
- package/dist/components/icons/system/system-lock-line/system-lock-line.component.js +10 -13
- package/dist/components/icons/system/system-lock-line/system-lock-line.component.js.map +1 -1
- package/dist/components/icons/system/system-menu-line/system-menu-line.component.js +9 -12
- package/dist/components/icons/system/system-menu-line/system-menu-line.component.js.map +1 -1
- package/dist/components/icons/system/system-menu-line-s/system-menu-line-s.component.js +9 -12
- package/dist/components/icons/system/system-menu-line-s/system-menu-line-s.component.js.map +1 -1
- package/dist/components/icons/system/system-more-2-line/system-more-2-line.component.js +10 -13
- package/dist/components/icons/system/system-more-2-line/system-more-2-line.component.js.map +1 -1
- package/dist/components/icons/system/system-more-line/system-more-line.component.js +16 -19
- package/dist/components/icons/system/system-more-line/system-more-line.component.js.map +1 -1
- package/dist/components/icons/system/system-search-line/system-search-line.component.js +11 -14
- package/dist/components/icons/system/system-search-line/system-search-line.component.js.map +1 -1
- package/dist/components/icons/system/system-share-line/system-share-line.component.js +9 -12
- package/dist/components/icons/system/system-share-line/system-share-line.component.js.map +1 -1
- package/dist/components/icons/system/system-shield-check-fill/system-shield-check-fill.component.js +8 -11
- package/dist/components/icons/system/system-shield-check-fill/system-shield-check-fill.component.js.map +1 -1
- package/dist/components/icons/system/system-shield-check-line/system-shield-check-line.component.js +6 -9
- package/dist/components/icons/system/system-shield-check-line/system-shield-check-line.component.js.map +1 -1
- package/dist/components/icons/system/system-star-fill/system-star-fill.component.js +13 -16
- package/dist/components/icons/system/system-star-fill/system-star-fill.component.js.map +1 -1
- package/dist/components/icons/system/system-subtract-line/system-subtract-line.component.js +11 -14
- package/dist/components/icons/system/system-subtract-line/system-subtract-line.component.js.map +1 -1
- package/dist/components/icons/system/system-subtract-line2/system-subtract-line2.component.js +7 -10
- package/dist/components/icons/system/system-subtract-line2/system-subtract-line2.component.js.map +1 -1
- package/dist/components/icons/system/system-time-fill/system-time-fill.component.js +11 -14
- package/dist/components/icons/system/system-time-fill/system-time-fill.component.js.map +1 -1
- package/dist/components/icons/system/system-time-line/system-time-line.component.js +11 -14
- package/dist/components/icons/system/system-time-line/system-time-line.component.js.map +1 -1
- package/dist/components/icons/system/system-upload-2-fill/system-upload-2-fill.component.js +5 -8
- package/dist/components/icons/system/system-upload-2-fill/system-upload-2-fill.component.js.map +1 -1
- package/dist/components/icons/system/system-upload-2-line/system-upload-2-line.component.js +7 -10
- package/dist/components/icons/system/system-upload-2-line/system-upload-2-line.component.js.map +1 -1
- package/dist/components/icons/system/system-upload-line/system-upload-line.component.js +9 -12
- package/dist/components/icons/system/system-upload-line/system-upload-line.component.js.map +1 -1
- package/dist/components/icons/system/system-zoom-in-line/system-zoom-in-line.component.js +9 -12
- package/dist/components/icons/system/system-zoom-in-line/system-zoom-in-line.component.js.map +1 -1
- package/dist/components/icons/system/system-zoom-out-line/system-zoom-out-line.component.js +11 -14
- package/dist/components/icons/system/system-zoom-out-line/system-zoom-out-line.component.js.map +1 -1
- package/dist/components/icons/user/user-account-circle-fill/user-account-circle-fill.component.js +16 -19
- package/dist/components/icons/user/user-account-circle-fill/user-account-circle-fill.component.js.map +1 -1
- package/dist/components/icons/user/user-account-circle-line/user-account-circle-line.component.js +13 -16
- package/dist/components/icons/user/user-account-circle-line/user-account-circle-line.component.js.map +1 -1
- package/dist/components/icons/user/user-user-fill/user-user-fill.component.js +8 -11
- package/dist/components/icons/user/user-user-fill/user-user-fill.component.js.map +1 -1
- package/dist/components/icons/user/user-user-line/user-user-line.component.js +11 -14
- package/dist/components/icons/user/user-user-line/user-user-line.component.js.map +1 -1
- package/dist/components/image-zoom/image-zoom.component.js +12 -17
- package/dist/components/image-zoom/image-zoom.component.js.map +1 -1
- package/dist/components/input/_styles/input.scss.js +1 -1
- package/dist/components/input/input-base-element.js +41 -47
- package/dist/components/input/input-base-element.js.map +1 -1
- package/dist/components/label/_styles/label.scss.js +1 -1
- package/dist/components/label/label.component.js +8 -11
- package/dist/components/label/label.component.js.map +1 -1
- package/dist/components/link/link.component.js +23 -27
- package/dist/components/link/link.component.js.map +1 -1
- package/dist/components/list-item/list-item.component.js +24 -29
- package/dist/components/list-item/list-item.component.js.map +1 -1
- package/dist/components/modal/modal-base-element.js +36 -42
- package/dist/components/modal/modal-base-element.js.map +1 -1
- package/dist/components/navigation-menu/navigation-menu-item.component.d.ts +9 -1
- package/dist/components/navigation-menu/navigation-menu-item.component.js +36 -31
- package/dist/components/navigation-menu/navigation-menu-item.component.js.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.component.js +20 -24
- package/dist/components/navigation-menu/navigation-menu.component.js.map +1 -1
- package/dist/components/notification-badge/notification-badge.component.js +28 -32
- package/dist/components/notification-badge/notification-badge.component.js.map +1 -1
- package/dist/components/number-input/number-input.component.js +23 -29
- package/dist/components/number-input/number-input.component.js.map +1 -1
- package/dist/components/official-website-banner/official-website-banner.component.js +19 -24
- package/dist/components/official-website-banner/official-website-banner.component.js.map +1 -1
- package/dist/components/option-group/option-group.component.js +17 -20
- package/dist/components/option-group/option-group.component.js.map +1 -1
- package/dist/components/option-item/option-item.component.d.ts +9 -0
- package/dist/components/option-item/option-item.component.js +66 -60
- package/dist/components/option-item/option-item.component.js.map +1 -1
- package/dist/components/option-item/option-item.scss.js +1 -1
- package/dist/components/option-list/__test__/listbox-harness.d.ts +129 -0
- package/dist/components/option-list/listbox-state.d.ts +230 -0
- package/dist/components/option-list/listbox-state.js +312 -0
- package/dist/components/option-list/listbox-state.js.map +1 -0
- package/dist/components/option-list/option-data.d.ts +35 -0
- package/dist/components/option-list/option-data.js +34 -0
- package/dist/components/option-list/option-data.js.map +1 -0
- package/dist/components/option-list/option-list.component.d.ts +66 -14
- package/dist/components/option-list/option-list.component.js +381 -294
- package/dist/components/option-list/option-list.component.js.map +1 -1
- package/dist/components/overlay/overlay.component.js +10 -13
- package/dist/components/overlay/overlay.component.js.map +1 -1
- package/dist/components/pager/pager.component.js +31 -37
- package/dist/components/pager/pager.component.js.map +1 -1
- package/dist/components/password-input/password-input.component.js +24 -30
- package/dist/components/password-input/password-input.component.js.map +1 -1
- package/dist/components/popup/popup-base-element.js +21 -25
- package/dist/components/popup/popup-base-element.js.map +1 -1
- package/dist/components/progress/progress.component.js +17 -21
- package/dist/components/progress/progress.component.js.map +1 -1
- package/dist/components/radio-button/_styles/radio-button.scss.js +1 -1
- package/dist/components/radio-button/radio-button.component.js +58 -62
- package/dist/components/radio-button/radio-button.component.js.map +1 -1
- package/dist/components/rating/_styles/rating.scss.js +2 -2
- package/dist/components/rating/rating.component.js +37 -41
- package/dist/components/rating/rating.component.js.map +1 -1
- package/dist/components/scroll-area/scroll-area.component.js +25 -28
- package/dist/components/scroll-area/scroll-area.component.js.map +1 -1
- package/dist/components/scroll-progress/scroll-progress.component.js +13 -17
- package/dist/components/scroll-progress/scroll-progress.component.js.map +1 -1
- package/dist/components/search/search.component.d.ts +1 -1
- package/dist/components/search/search.component.js.map +1 -1
- package/dist/components/select/select.component.d.ts +44 -0
- package/dist/components/select/select.component.js +268 -157
- package/dist/components/select/select.component.js.map +1 -1
- package/dist/components/select/select.scss.js +1 -1
- package/dist/components/sidenav/sidenav-group.component.js +11 -14
- package/dist/components/sidenav/sidenav-group.component.js.map +1 -1
- package/dist/components/sidenav/sidenav-item.component.js +20 -23
- package/dist/components/sidenav/sidenav-item.component.js.map +1 -1
- package/dist/components/sidenav/sidenav.component.js +17 -20
- package/dist/components/sidenav/sidenav.component.js.map +1 -1
- package/dist/components/skeleton/skeleton.component.js +9 -12
- package/dist/components/skeleton/skeleton.component.js.map +1 -1
- package/dist/components/skip-link/skip-link.component.js +13 -16
- package/dist/components/skip-link/skip-link.component.js.map +1 -1
- package/dist/components/snackbar/snackbar-message.component.js +39 -44
- package/dist/components/snackbar/snackbar-message.component.js.map +1 -1
- package/dist/components/snackbar/snackbar.component.js +36 -42
- package/dist/components/snackbar/snackbar.component.js.map +1 -1
- package/dist/components/spinner/spinner.component.js +33 -38
- package/dist/components/spinner/spinner.component.js.map +1 -1
- package/dist/components/stack/stack.component.js +15 -18
- package/dist/components/stack/stack.component.js.map +1 -1
- package/dist/components/switch/switch.component.js +48 -51
- package/dist/components/switch/switch.component.js.map +1 -1
- package/dist/components/switch/switch.scss.js +1 -1
- package/dist/components/tab/tab-group.component.d.ts +4 -1
- package/dist/components/tab/tab-group.component.js +42 -33
- package/dist/components/tab/tab-group.component.js.map +1 -1
- package/dist/components/tab/tab.component.js +22 -25
- package/dist/components/tab/tab.component.js.map +1 -1
- package/dist/components/table/table-cell.component.js +16 -19
- package/dist/components/table/table-cell.component.js.map +1 -1
- package/dist/components/table/table-header.component.js +21 -24
- package/dist/components/table/table-header.component.js.map +1 -1
- package/dist/components/table/table-row.component.js +15 -18
- package/dist/components/table/table-row.component.js.map +1 -1
- package/dist/components/table/table.component.js +18 -22
- package/dist/components/table/table.component.js.map +1 -1
- package/dist/components/textarea/textarea.component.js +42 -46
- package/dist/components/textarea/textarea.component.js.map +1 -1
- package/dist/components/textarea/textarea.scss.js +1 -1
- package/dist/components/timeline/timeline-item.component.js +7 -10
- package/dist/components/timeline/timeline-item.component.js.map +1 -1
- package/dist/components/timeline/timeline.component.js +5 -8
- package/dist/components/timeline/timeline.component.js.map +1 -1
- package/dist/components/timepicker/time-grid.component.js +12 -15
- package/dist/components/timepicker/time-grid.component.js.map +1 -1
- package/dist/components/timepicker/timepicker.component.js +90 -95
- package/dist/components/timepicker/timepicker.component.js.map +1 -1
- package/dist/components/timepicker/timepicker.scss.js +1 -1
- package/dist/components/toc/toc.component.js +66 -69
- package/dist/components/toc/toc.component.js.map +1 -1
- package/dist/components/toggle-button/toggle-button.component.js +9 -12
- package/dist/components/toggle-button/toggle-button.component.js.map +1 -1
- package/dist/components/tooltip/tooltip.component.js +19 -23
- package/dist/components/tooltip/tooltip.component.js.map +1 -1
- package/dist/components/tray/tray.component.js +13 -16
- package/dist/components/tray/tray.component.js.map +1 -1
- package/dist/components/typography/typography.component.js +38 -41
- package/dist/components/typography/typography.component.js.map +1 -1
- package/dist/components.d.ts +3 -0
- package/dist/components.js +204 -195
- package/dist/components.js.map +1 -1
- package/dist/components.native.css +5 -2
- package/dist/components.native.css.map +1 -1
- package/dist/dap-design-system.d.ts +3 -0
- package/dist/dds-preupgrade.css +57 -0
- package/dist/dds.js +383 -374
- package/dist/dds.js.map +1 -1
- package/dist/internal/dds-hu-element.d.ts +8 -0
- package/dist/internal/dds-hu-element.js +40 -41
- package/dist/internal/dds-hu-element.js.map +1 -1
- package/dist/internal/mixin/choiceElementMixin.js +7 -7
- package/dist/internal/mixin/feedbackMixin.js +13 -15
- package/dist/internal/mixin/feedbackMixin.js.map +1 -1
- package/dist/internal/mixin/focusableMixin.js +6 -6
- package/dist/internal/mixin/formElementMixin.js +1 -1
- package/dist/internal/mixin/labelPositionedMixin.js +1 -1
- package/dist/internal/mixin/labelableMixin.d.ts +1 -1
- package/dist/internal/mixin/labelableMixin.js +61 -63
- package/dist/internal/mixin/labelableMixin.js.map +1 -1
- package/dist/internal/mixin/sizedMixin.js +29 -27
- package/dist/internal/mixin/sizedMixin.js.map +1 -1
- package/dist/internal/templates/formLabel.d.ts +41 -0
- package/dist/internal/templates/formLabel.js +47 -0
- package/dist/internal/templates/formLabel.js.map +1 -0
- package/dist/localization/localization.d.ts +1 -2
- package/dist/localization/localization.js +77 -76
- package/dist/localization/localization.js.map +1 -1
- package/dist/localization/localize-controller.d.ts +12 -0
- package/dist/localization/localize-controller.js +51 -0
- package/dist/localization/localize-controller.js.map +1 -0
- package/dist/manifest/types/vue/index.d.ts +571 -491
- package/dist/manifest/vscode.html-custom-data.json +422 -368
- package/dist/manifest/web-types.json +1198 -1094
- package/dist/react/dap-ds-button-group/index.d.ts +45 -0
- package/dist/react/dap-ds-button-group/index.js +15 -0
- package/dist/react/dap-ds-button-group/index.js.map +1 -0
- package/dist/react/dap-ds-button-group-separator/index.d.ts +24 -0
- package/dist/react/dap-ds-button-group-separator/index.js +15 -0
- package/dist/react/dap-ds-button-group-separator/index.js.map +1 -0
- package/dist/react/dap-ds-button-group-text/index.d.ts +30 -0
- package/dist/react/dap-ds-button-group-text/index.js +15 -0
- package/dist/react/dap-ds-button-group-text/index.js.map +1 -0
- package/dist/react/dap-ds-combobox/index.d.ts +3 -1
- package/dist/react/dap-ds-combobox/index.js.map +1 -1
- package/dist/react/dap-ds-option-list/index.d.ts +1 -1
- package/dist/react/dap-ds-option-list/index.js.map +1 -1
- package/dist/react/dap-ds-search/index.d.ts +1 -1
- package/dist/react/dap-ds-search/index.js.map +1 -1
- package/dist/react/dap-ds-select/index.d.ts +3 -0
- package/dist/react/dap-ds-select/index.js.map +1 -1
- package/dist/react/index.d.ts +17 -14
- package/dist/react-types.ts +17 -14
- package/dist/react.js +370 -364
- package/dist/react.js.map +1 -1
- package/package.json +15 -9
- package/dist/node_modules/@lit/context/lib/context-request-event.js +0 -14
- package/dist/node_modules/@lit/context/lib/context-request-event.js.map +0 -1
- package/dist/node_modules/@lit/context/lib/controllers/context-consumer.js +0 -31
- package/dist/node_modules/@lit/context/lib/controllers/context-consumer.js.map +0 -1
- package/dist/node_modules/@lit/context/lib/controllers/context-provider.js +0 -40
- package/dist/node_modules/@lit/context/lib/controllers/context-provider.js.map +0 -1
- package/dist/node_modules/@lit/context/lib/create-context.js +0 -12
- package/dist/node_modules/@lit/context/lib/create-context.js.map +0 -1
- package/dist/node_modules/@lit/context/lib/value-notifier.js +0 -37
- package/dist/node_modules/@lit/context/lib/value-notifier.js.map +0 -1
- package/dist/node_modules/@lit/reactive-element/css-tag.js +0 -51
- package/dist/node_modules/@lit/reactive-element/css-tag.js.map +0 -1
- package/dist/node_modules/@lit/reactive-element/decorators/base.js +0 -10
- package/dist/node_modules/@lit/reactive-element/decorators/base.js.map +0 -1
- package/dist/node_modules/@lit/reactive-element/decorators/property.js +0 -38
- package/dist/node_modules/@lit/reactive-element/decorators/property.js.map +0 -1
- package/dist/node_modules/@lit/reactive-element/decorators/query-all.js +0 -17
- package/dist/node_modules/@lit/reactive-element/decorators/query-all.js.map +0 -1
- package/dist/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js +0 -20
- package/dist/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js.map +0 -1
- package/dist/node_modules/@lit/reactive-element/decorators/query-assigned-nodes.js +0 -20
- package/dist/node_modules/@lit/reactive-element/decorators/query-assigned-nodes.js.map +0 -1
- package/dist/node_modules/@lit/reactive-element/decorators/query.js +0 -21
- package/dist/node_modules/@lit/reactive-element/decorators/query.js.map +0 -1
- package/dist/node_modules/@lit/reactive-element/decorators/state.js +0 -25
- package/dist/node_modules/@lit/reactive-element/decorators/state.js.map +0 -1
- package/dist/node_modules/@lit/reactive-element/reactive-element.js +0 -276
- package/dist/node_modules/@lit/reactive-element/reactive-element.js.map +0 -1
- package/dist/node_modules/lit-element/lit-element.js +0 -53
- package/dist/node_modules/lit-element/lit-element.js.map +0 -1
- package/dist/node_modules/lit-html/async-directive.js +0 -71
- package/dist/node_modules/lit-html/async-directive.js.map +0 -1
- package/dist/node_modules/lit-html/directive-helpers.js +0 -46
- package/dist/node_modules/lit-html/directive-helpers.js.map +0 -1
- package/dist/node_modules/lit-html/directive.js +0 -28
- package/dist/node_modules/lit-html/directive.js.map +0 -1
- package/dist/node_modules/lit-html/directives/if-defined.js +0 -11
- package/dist/node_modules/lit-html/directives/if-defined.js.map +0 -1
- package/dist/node_modules/lit-html/directives/map.js +0 -15
- package/dist/node_modules/lit-html/directives/map.js.map +0 -1
- package/dist/node_modules/lit-html/directives/repeat.js +0 -63
- package/dist/node_modules/lit-html/directives/repeat.js.map +0 -1
- package/dist/node_modules/lit-html/directives/style-map.js +0 -37
- package/dist/node_modules/lit-html/directives/style-map.js.map +0 -1
- package/dist/node_modules/lit-html/lit-html.js +0 -249
- package/dist/node_modules/lit-html/lit-html.js.map +0 -1
- package/dist/node_modules/lit-html/static.js +0 -34
- package/dist/node_modules/lit-html/static.js.map +0 -1
- package/dist/node_modules/lit-i18n/src/lit-i18n.js +0 -95
- package/dist/node_modules/lit-i18n/src/lit-i18n.js.map +0 -1
package/README.md
CHANGED
|
@@ -22,8 +22,12 @@ pnpm add dap-design-system
|
|
|
22
22
|
|
|
23
23
|
CDN
|
|
24
24
|
|
|
25
|
+
The design system now ships with Lit as an external (peer) module rather than
|
|
26
|
+
bundling its own copy. When loading directly in the browser from a CDN, use
|
|
27
|
+
jsDelivr's `/+esm` endpoint so the bare `lit` imports are resolved automatically:
|
|
28
|
+
|
|
25
29
|
```html
|
|
26
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/dap-design-system"
|
|
30
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/dap-design-system/+esm"></script>
|
|
27
31
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dap-design-system/dist/light.theme.css" />
|
|
28
32
|
```
|
|
29
33
|
|
package/dist/common/utils.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var s = (t, e,
|
|
5
|
-
for (var
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var
|
|
9
|
-
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var c = Object.getOwnPropertySymbols;
|
|
3
|
+
var f = Object.prototype.hasOwnProperty, u = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var s = (t, e, n) => e in t ? a(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, l = (t, e) => {
|
|
5
|
+
for (var n in e || (e = {}))
|
|
6
|
+
f.call(e, n) && s(t, n, e[n]);
|
|
7
|
+
if (c)
|
|
8
|
+
for (var n of c(e))
|
|
9
|
+
u.call(e, n) && s(t, n, e[n]);
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
window.matchMedia(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const e = (
|
|
12
|
+
typeof window != "undefined" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
13
|
+
function m(t) {
|
|
14
|
+
var n;
|
|
15
|
+
if (typeof t.closest != "function")
|
|
16
|
+
return;
|
|
17
|
+
const e = (n = t.closest("dap-ds-card")) == null ? void 0 : n.getAttribute("size");
|
|
18
18
|
t.setAttribute("size", e != null ? e : "sm");
|
|
19
19
|
}
|
|
20
|
-
const
|
|
20
|
+
const h = (t) => {
|
|
21
21
|
let e = {};
|
|
22
22
|
try {
|
|
23
23
|
e = JSON.parse(t != null ? t : "");
|
|
24
|
-
} catch (
|
|
24
|
+
} catch (n) {
|
|
25
25
|
console.error("Incorrect Json string data", {
|
|
26
26
|
data: t
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
return e;
|
|
30
30
|
};
|
|
31
|
-
function
|
|
31
|
+
function d(t) {
|
|
32
32
|
return t == null || t === "null" || t === "undefined" ? "" : t;
|
|
33
33
|
}
|
|
34
34
|
const b = {
|
|
35
|
-
fromAttribute: (t) =>
|
|
35
|
+
fromAttribute: (t) => d(t),
|
|
36
36
|
toAttribute: (t) => !t || t === "null" || t === "undefined" ? null : t
|
|
37
37
|
};
|
|
38
|
-
function
|
|
39
|
-
const e = (
|
|
40
|
-
if (
|
|
41
|
-
return
|
|
42
|
-
const
|
|
43
|
-
return
|
|
38
|
+
function p(t) {
|
|
39
|
+
const e = (o) => {
|
|
40
|
+
if (o instanceof Element && o.assignedSlot)
|
|
41
|
+
return o.assignedSlot;
|
|
42
|
+
const r = o.parentNode;
|
|
43
|
+
return r instanceof ShadowRoot ? r.host : r;
|
|
44
44
|
};
|
|
45
|
-
let
|
|
46
|
-
for (;
|
|
47
|
-
const { overflowY:
|
|
48
|
-
if (/(auto|scroll|overlay)/.test(
|
|
49
|
-
return
|
|
50
|
-
|
|
45
|
+
let n = e(t);
|
|
46
|
+
for (; n instanceof HTMLElement; ) {
|
|
47
|
+
const { overflowY: o } = getComputedStyle(n);
|
|
48
|
+
if (/(auto|scroll|overlay)/.test(o) && n.scrollHeight > n.clientHeight)
|
|
49
|
+
return n;
|
|
50
|
+
n = e(n);
|
|
51
51
|
}
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
const e =
|
|
54
|
+
function w(t) {
|
|
55
|
+
const e = p(t);
|
|
56
56
|
if (!e)
|
|
57
57
|
return;
|
|
58
|
-
const
|
|
59
|
-
|
|
58
|
+
const o = e.getBoundingClientRect().top + e.clientTop, r = o + e.clientHeight, i = t.getBoundingClientRect();
|
|
59
|
+
i.top < o ? e.scrollTop -= o - i.top : i.bottom > r && (e.scrollTop += i.bottom - r);
|
|
60
60
|
}
|
|
61
61
|
function S(t) {
|
|
62
|
-
return
|
|
62
|
+
return l({
|
|
63
63
|
badInput: !1,
|
|
64
64
|
customError: !1,
|
|
65
65
|
patternMismatch: !1,
|
|
@@ -73,22 +73,22 @@ function S(t) {
|
|
|
73
73
|
valueMissing: !1
|
|
74
74
|
}, t);
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
return t.trim().toLowerCase().replace(/\./g, "-").replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "").replace(/--+/g, "-").replace(/^-+|-+$/g, "");
|
|
76
|
+
function y(t) {
|
|
77
|
+
return t ? t.trim().toLowerCase().replace(/\./g, "-").replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "").replace(/--+/g, "-").replace(/^-+|-+$/g, "") : "";
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function C(t, e) {
|
|
80
80
|
if (!(!t || !(e != null && e.id)))
|
|
81
81
|
return e.getRootNode() === t ? e.id : void 0;
|
|
82
82
|
}
|
|
83
83
|
export {
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
h as JSONAttributeParser,
|
|
85
|
+
p as getScrollParent,
|
|
86
86
|
S as getValidityStateObject,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
C as idInScope,
|
|
88
|
+
y as kebabCase,
|
|
89
|
+
d as normalizeStringProperty,
|
|
90
|
+
w as scrollIntoContainer,
|
|
91
|
+
m as setFromParentSize,
|
|
92
92
|
b as stringPropertyConverter
|
|
93
93
|
};
|
|
94
94
|
//# sourceMappingURL=utils.js.map
|
package/dist/common/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/common/utils.ts"],"sourcesContent":["export const isReducedMotion = window.matchMedia(\n '(prefers-reduced-motion: reduce)',\n).matches\n\nexport function isMobileView() {\n const mobileBreakpoint = getComputedStyle(document.documentElement)\n .getPropertyValue('--dds-breakpoints-small')\n .trim()\n\n const isMobileView = window.matchMedia(\n `(max-width: ${mobileBreakpoint})`,\n ).matches\n\n return isMobileView\n}\n\nexport function setFromParentSize(element: HTMLElement) {\n const size = element.closest('dap-ds-card')?.getAttribute('size')\n element.setAttribute('size', size ?? 'sm')\n}\n\nexport function numberRange(start: number, end: number): number[] {\n return Array.from({ length: end - start + 1 }, (_, i) => start + i)\n}\n\nexport const JSONAttributeParser = (value: string | null) => {\n let convertedValue = {}\n try {\n convertedValue = JSON.parse(value ?? '')\n } catch (error) {\n console.error('Incorrect Json string data', {\n data: value,\n })\n }\n\n return convertedValue\n}\n\n/**\n * Normalizes a string value that might be null, undefined, or the string \"null\"/\"undefined\".\n * This is useful for handling values from React/Next.js object spreads where null props\n * can be serialized as the string \"null\".\n *\n * @param value - The value to normalize\n * @returns An empty string if the value is null, undefined, or the string \"null\"/\"undefined\", otherwise the value\n *\n * @example\n * ```typescript\n * protected updated(changedProperties: Map<PropertyKey, unknown>): void {\n * super.updated(changedProperties)\n * if (changedProperties.has('title')) {\n * this.title = normalizeStringProperty(this.title)\n * }\n * }\n * ```\n */\nexport function normalizeStringProperty(\n value: string | null | undefined,\n): string {\n if (\n value === null ||\n value === undefined ||\n value === 'null' ||\n value === 'undefined'\n ) {\n return ''\n }\n return value\n}\n\n/**\n * Lit property converter that handles null/undefined values from React/Next.js object spreads.\n *\n * When React serializes null props (e.g., from object spreads like {...props} where props.title = null),\n * it can become the string \"null\" in HTML attributes. This converter normalizes these cases.\n *\n * @example\n * ```typescript\n * @property({\n * converter: stringPropertyConverter\n * })\n * title: string\n * ```\n *\n * This prevents the string \"null\" from appearing in the rendered output when:\n * - Props come from object spreads with null values\n * - React/Next.js serializes null as the string \"null\"\n * - Properties are set directly (bypassing attribute conversion)\n *\n * Note: For direct property assignments (e.g., `element.title = null`), also use\n * `normalizeStringProperty` in the `updated` lifecycle method.\n */\nexport const stringPropertyConverter = {\n fromAttribute: (value: string | null): string => {\n return normalizeStringProperty(value)\n },\n toAttribute: (value: string | null | undefined): string | null => {\n // Prevent reflecting null/undefined/empty values back to attributes\n // This avoids setting title=\"null\" or title=\"\" in the DOM\n if (!value || value === 'null' || value === 'undefined') {\n return null // null removes the attribute\n }\n return value\n },\n}\n\n/**\n * Finds the nearest scrollable ancestor of an element, crossing shadow DOM and\n * slot boundaries. Returns null if none is found before the document root.\n */\nexport function getScrollParent(element: Element): HTMLElement | null {\n const getParent = (node: Node): Node | null => {\n // Slotted content lives visually inside the slot, so continue up through it.\n if (node instanceof Element && node.assignedSlot) {\n return node.assignedSlot\n }\n const parent = node.parentNode\n // Cross a shadow root boundary via its host element.\n if (parent instanceof ShadowRoot) {\n return parent.host\n }\n return parent\n }\n\n let current = getParent(element)\n while (current instanceof HTMLElement) {\n const { overflowY } = getComputedStyle(current)\n if (\n /(auto|scroll|overlay)/.test(overflowY) &&\n current.scrollHeight > current.clientHeight\n ) {\n return current\n }\n current = getParent(current)\n }\n return null\n}\n\n/**\n * Reveals an element by scrolling only its nearest scrollable ancestor, without\n * bubbling the scroll to outer ancestors. Unlike `Element.scrollIntoView`, which\n * scrolls every scrollable ancestor up to the window, this keeps outer containers\n * (e.g. a modal body or the page) still. That matters for an option deep inside a\n * dropdown: revealing it must not scroll the trigger out of the viewport, which\n * would otherwise fire the popup's viewport auto-close and snap the dropdown shut.\n */\nexport function scrollIntoContainer(element: HTMLElement): void {\n const container = getScrollParent(element)\n if (!container) {\n return\n }\n\n const containerRect = container.getBoundingClientRect()\n const elementRect = element.getBoundingClientRect()\n\n if (elementRect.top < containerRect.top) {\n container.scrollTop -= containerRect.top - elementRect.top\n } else if (elementRect.bottom > containerRect.bottom) {\n container.scrollTop += elementRect.bottom - containerRect.bottom\n }\n}\n\nexport function getValidityStateObject(state: Partial<ValidityState>) {\n return {\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valid: true,\n valueMissing: false,\n ...state,\n }\n}\n\n/**\n * Converts a string to kebab-case.\n *\n * @param str - The string to convert\n * @returns The kebab-cased string\n */\nexport function kebabCase(str: string): string {\n return str\n .trim()\n .toLowerCase()\n .replace(/\\./g, '-') // Convert dots to dashes first\n .replace(/\\s+/g, '-') // Convert spaces to dashes\n .replace(/[^a-z0-9-]/g, '') // Remove non-alphanumeric except dashes\n .replace(/--+/g, '-') // Collapse multiple dashes\n .replace(/^-+|-+$/g, '') // Remove leading/trailing dashes\n}\n\n/**\n * Returns `target.id` only when `target` lives in the given tree scope (document\n * or shadow root). IDREF attributes such as aria-activedescendant resolve only\n * within one scope, so a reference into another shadow root (e.g. an option the\n * option list renders inside its own shadow root) is dropped by every browser's\n * accessibility tree and reported by axe as aria-valid-attr-value.\n */\nexport function idInScope(\n scope: Node | null | undefined,\n target: Element | null | undefined,\n): string | undefined {\n if (!scope || !target?.id) {\n return undefined\n }\n return target.getRootNode() === scope ? target.id : undefined\n}\n"],"names":["setFromParentSize","element","_a","size","JSONAttributeParser","value","convertedValue","error","normalizeStringProperty","stringPropertyConverter","getScrollParent","getParent","node","parent","current","overflowY","scrollIntoContainer","container","containerRect","elementRect","getValidityStateObject","state","__spreadValues","kebabCase","str","idInScope","scope","target"],"mappings":";;;;;;;;;;;AAA+B,OAAO;AAAA,EACpC;AACF,EAAE;AAcK,SAASA,EAAkBC,GAAsB;AAhBzB,MAAAC;AAiB7B,QAAMC,KAAOD,IAAAD,EAAQ,QAAQ,aAAa,MAA7B,gBAAAC,EAAgC,aAAa;AAClD,EAAAD,EAAA,aAAa,QAAQE,KAAA,OAAAA,IAAQ,IAAI;AAC3C;AAMa,MAAAC,IAAsB,CAACC,MAAyB;AAC3D,MAAIC,IAAiB,CAAC;AAClB,MAAA;AACe,IAAAA,IAAA,KAAK,MAAMD,KAAA,OAAAA,IAAS,EAAE;AAAA,WAChCE,GAAO;AACd,YAAQ,MAAM,8BAA8B;AAAA,MAC1C,MAAMF;AAAA,IAAA,CACP;AAAA,EAAA;AAGI,SAAAC;AACT;AAoBO,SAASE,EACdH,GACQ;AACR,SACEA,KAAU,QAEVA,MAAU,UACVA,MAAU,cAEH,KAEFA;AACT;AAwBO,MAAMI,IAA0B;AAAA,EACrC,eAAe,CAACJ,MACPG,EAAwBH,CAAK;AAAA,EAEtC,aAAa,CAACA,MAGR,CAACA,KAASA,MAAU,UAAUA,MAAU,cACnC,OAEFA;AAEX;AAMO,SAASK,EAAgBT,GAAsC;AAC9D,QAAAU,IAAY,CAACC,MAA4B;AAEzC,QAAAA,aAAgB,WAAWA,EAAK;AAClC,aAAOA,EAAK;AAEd,UAAMC,IAASD,EAAK;AAEpB,WAAIC,aAAkB,aACbA,EAAO,OAETA;AAAA,EACT;AAEI,MAAAC,IAAUH,EAAUV,CAAO;AAC/B,SAAOa,aAAmB,eAAa;AACrC,UAAM,EAAE,WAAAC,EAAA,IAAc,iBAAiBD,CAAO;AAC9C,QACE,wBAAwB,KAAKC,CAAS,KACtCD,EAAQ,eAAeA,EAAQ;AAExB,aAAAA;AAET,IAAAA,IAAUH,EAAUG,CAAO;AAAA,EAAA;AAEtB,SAAA;AACT;AAUO,SAASE,EAAoBf,GAA4B;AACxD,QAAAgB,IAAYP,EAAgBT,CAAO;AACzC,MAAI,CAACgB;AACH;AAGI,QAAAC,IAAgBD,EAAU,sBAAsB,GAChDE,IAAclB,EAAQ,sBAAsB;AAE9C,EAAAkB,EAAY,MAAMD,EAAc,MACxBD,EAAA,aAAaC,EAAc,MAAMC,EAAY,MAC9CA,EAAY,SAASD,EAAc,WAClCD,EAAA,aAAaE,EAAY,SAASD,EAAc;AAE9D;AAEO,SAASE,EAAuBC,GAA+B;AAC7D,SAAAC,EAAA;AAAA,IACL,UAAU;AAAA,IACV,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd,SAAS;AAAA,IACT,UAAU;AAAA,IACV,cAAc;AAAA,IACd,OAAO;AAAA,IACP,cAAc;AAAA,KACXD;AAEP;AAQO,SAASE,EAAUC,GAAqB;AACtC,SAAAA,EACJ,KACA,EAAA,cACA,QAAQ,OAAO,GAAG,EAClB,QAAQ,QAAQ,GAAG,EACnB,QAAQ,eAAe,EAAE,EACzB,QAAQ,QAAQ,GAAG,EACnB,QAAQ,YAAY,EAAE;AAC3B;AASgB,SAAAC,EACdC,GACAC,GACoB;AACpB,MAAI,GAACD,KAAS,EAACC,KAAA,QAAAA,EAAQ;AAGvB,WAAOA,EAAO,YAAkB,MAAAD,IAAQC,EAAO,KAAK;AACtD;"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/common/utils.ts"],"sourcesContent":["// Guarded so importing this module does not touch `window` during SSR (Node).\n// In the browser the value is identical to before; on the server it is `false`\n// (no motion preference assumed).\nexport const isReducedMotion =\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches\n\nexport function isMobileView() {\n const mobileBreakpoint = getComputedStyle(document.documentElement)\n .getPropertyValue('--dds-breakpoints-small')\n .trim()\n\n const isMobileView = window.matchMedia(\n `(max-width: ${mobileBreakpoint})`,\n ).matches\n\n return isMobileView\n}\n\nexport function setFromParentSize(element: HTMLElement) {\n // `closest` is unavailable in the Lit SSR DOM shim; skip on the server (the\n // parent <dap-ds-card> is resolved on the client after hydration).\n if (typeof element.closest !== 'function') {\n return\n }\n const size = element.closest('dap-ds-card')?.getAttribute('size')\n element.setAttribute('size', size ?? 'sm')\n}\n\nexport function numberRange(start: number, end: number): number[] {\n return Array.from({ length: end - start + 1 }, (_, i) => start + i)\n}\n\nexport const JSONAttributeParser = (value: string | null) => {\n let convertedValue = {}\n try {\n convertedValue = JSON.parse(value ?? '')\n } catch (error) {\n console.error('Incorrect Json string data', {\n data: value,\n })\n }\n\n return convertedValue\n}\n\n/**\n * Normalizes a string value that might be null, undefined, or the string \"null\"/\"undefined\".\n * This is useful for handling values from React/Next.js object spreads where null props\n * can be serialized as the string \"null\".\n *\n * @param value - The value to normalize\n * @returns An empty string if the value is null, undefined, or the string \"null\"/\"undefined\", otherwise the value\n *\n * @example\n * ```typescript\n * protected updated(changedProperties: Map<PropertyKey, unknown>): void {\n * super.updated(changedProperties)\n * if (changedProperties.has('title')) {\n * this.title = normalizeStringProperty(this.title)\n * }\n * }\n * ```\n */\nexport function normalizeStringProperty(\n value: string | null | undefined,\n): string {\n if (\n value === null ||\n value === undefined ||\n value === 'null' ||\n value === 'undefined'\n ) {\n return ''\n }\n return value\n}\n\n/**\n * Lit property converter that handles null/undefined values from React/Next.js object spreads.\n *\n * When React serializes null props (e.g., from object spreads like {...props} where props.title = null),\n * it can become the string \"null\" in HTML attributes. This converter normalizes these cases.\n *\n * @example\n * ```typescript\n * @property({\n * converter: stringPropertyConverter\n * })\n * title: string\n * ```\n *\n * This prevents the string \"null\" from appearing in the rendered output when:\n * - Props come from object spreads with null values\n * - React/Next.js serializes null as the string \"null\"\n * - Properties are set directly (bypassing attribute conversion)\n *\n * Note: For direct property assignments (e.g., `element.title = null`), also use\n * `normalizeStringProperty` in the `updated` lifecycle method.\n */\nexport const stringPropertyConverter = {\n fromAttribute: (value: string | null): string => {\n return normalizeStringProperty(value)\n },\n toAttribute: (value: string | null | undefined): string | null => {\n // Prevent reflecting null/undefined/empty values back to attributes\n // This avoids setting title=\"null\" or title=\"\" in the DOM\n if (!value || value === 'null' || value === 'undefined') {\n return null // null removes the attribute\n }\n return value\n },\n}\n\n/**\n * Finds the nearest scrollable ancestor of an element, crossing shadow DOM and\n * slot boundaries. Returns null if none is found before the document root.\n */\nexport function getScrollParent(element: Element): HTMLElement | null {\n const getParent = (node: Node): Node | null => {\n // Slotted content lives visually inside the slot, so continue up through it.\n if (node instanceof Element && node.assignedSlot) {\n return node.assignedSlot\n }\n const parent = node.parentNode\n // Cross a shadow root boundary via its host element.\n if (parent instanceof ShadowRoot) {\n return parent.host\n }\n return parent\n }\n\n let current = getParent(element)\n while (current instanceof HTMLElement) {\n const { overflowY } = getComputedStyle(current)\n if (\n /(auto|scroll|overlay)/.test(overflowY) &&\n current.scrollHeight > current.clientHeight\n ) {\n return current\n }\n current = getParent(current)\n }\n return null\n}\n\n/**\n * Reveals an element by scrolling only its nearest scrollable ancestor, without\n * bubbling the scroll to outer ancestors. Unlike `Element.scrollIntoView`, which\n * scrolls every scrollable ancestor up to the window, this keeps outer containers\n * (e.g. a modal body or the page) still. That matters for an option deep inside a\n * dropdown: revealing it must not scroll the trigger out of the viewport, which\n * would otherwise fire the popup's viewport auto-close and snap the dropdown shut.\n */\nexport function scrollIntoContainer(element: HTMLElement): void {\n const container = getScrollParent(element)\n if (!container) {\n return\n }\n\n // Compare against the visible content box (inside the borders), not the\n // border box, or an item at the edge stays clipped by the border width.\n const containerRect = container.getBoundingClientRect()\n const visibleTop = containerRect.top + container.clientTop\n const visibleBottom = visibleTop + container.clientHeight\n const elementRect = element.getBoundingClientRect()\n\n if (elementRect.top < visibleTop) {\n container.scrollTop -= visibleTop - elementRect.top\n } else if (elementRect.bottom > visibleBottom) {\n container.scrollTop += elementRect.bottom - visibleBottom\n }\n}\n\nexport function getValidityStateObject(state: Partial<ValidityState>) {\n return {\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valid: true,\n valueMissing: false,\n ...state,\n }\n}\n\n/**\n * Converts a string to kebab-case.\n *\n * @param str - The string to convert\n * @returns The kebab-cased string\n */\nexport function kebabCase(str: string): string {\n if (!str) {\n return ''\n }\n return str\n .trim()\n .toLowerCase()\n .replace(/\\./g, '-') // Convert dots to dashes first\n .replace(/\\s+/g, '-') // Convert spaces to dashes\n .replace(/[^a-z0-9-]/g, '') // Remove non-alphanumeric except dashes\n .replace(/--+/g, '-') // Collapse multiple dashes\n .replace(/^-+|-+$/g, '') // Remove leading/trailing dashes\n}\n\n/**\n * Returns `target.id` only when `target` lives in the given tree scope (document\n * or shadow root). IDREF attributes such as aria-activedescendant resolve only\n * within one scope, so a reference into another shadow root (e.g. an option the\n * option list renders inside its own shadow root) is dropped by every browser's\n * accessibility tree and reported by axe as aria-valid-attr-value.\n */\nexport function idInScope(\n scope: Node | null | undefined,\n target: Element | null | undefined,\n): string | undefined {\n if (!scope || !target?.id) {\n return undefined\n }\n return target.getRootNode() === scope ? target.id : undefined\n}\n"],"names":["setFromParentSize","element","_a","size","JSONAttributeParser","value","convertedValue","error","normalizeStringProperty","stringPropertyConverter","getScrollParent","getParent","node","parent","current","overflowY","scrollIntoContainer","container","visibleTop","visibleBottom","elementRect","getValidityStateObject","state","__spreadValues","kebabCase","str","idInScope","scope","target"],"mappings":";;;;;;;;;;;AAIE,OAAO,UAAW,eAClB,OAAO,OAAO,cAAe,cAC7B,OAAO,WAAW,kCAAkC,EAAE;AAcjD,SAASA,EAAkBC,GAAsB;AAhBtD,MAAAC;AAmB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MA,EAAU,WAC3CE,IAAgBD,IAAaD,EAAU,cACvCG,IAAcnB,EAAQ,sBAAsB;AAE9C,EAAAmB,EAAY,MAAMF,IACVD,EAAA,aAAaC,IAAaE,EAAY,MACvCA,EAAY,SAASD,MACpBF,EAAA,aAAaG,EAAY,SAASD;AAEhD;AAEO,SAASE,EAAuBC,GAA+B;AAC7D,SAAAC,EAAA;AAAA,IACL,UAAU;AAAA,IACV,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd,SAAS;AAAA,IACT,UAAU;AAAA,IACV,cAAc;AAAA,IACd,OAAO;AAAA,IACP,cAAc;AAAA,KACXD;AAEP;AAQO,SAASE,EAAUC,GAAqB;AAC7C,SAAKA,IAGEA,EACJ,KACA,EAAA,cACA,QAAQ,OAAO,GAAG,EAClB,QAAQ,QAAQ,GAAG,EACnB,QAAQ,eAAe,EAAE,EACzB,QAAQ,QAAQ,GAAG,EACnB,QAAQ,YAAY,EAAE,IAThB;AAUX;AASgB,SAAAC,EACdC,GACAC,GACoB;AACpB,MAAI,GAACD,KAAS,EAACC,KAAA,QAAAA,EAAQ;AAGvB,WAAOA,EAAO,YAAkB,MAAAD,IAAQC,EAAO,KAAK;AACtD;"}
|
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
import { clsx as v } from "../../node_modules/clsx/dist/clsx.js";
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
import { query as f } from "../../node_modules/@lit/reactive-element/decorators/query.js";
|
|
7
|
-
import { ifDefined as p } from "../../node_modules/lit-html/directives/if-defined.js";
|
|
8
|
-
import { html as s, unsafeStatic as u } from "../../node_modules/lit-html/static.js";
|
|
2
|
+
import { unsafeCSS as b } from "lit";
|
|
3
|
+
import { query as f, property as a } from "lit/decorators.js";
|
|
4
|
+
import { ifDefined as p } from "lit/directives/if-defined.js";
|
|
5
|
+
import { html as s, unsafeStatic as g } from "lit/static-html.js";
|
|
9
6
|
import { DdsElement as m } from "../../internal/dds-hu-element.js";
|
|
10
|
-
import { SizedMixin as
|
|
7
|
+
import { SizedMixin as y } from "../../internal/mixin/sizedMixin.js";
|
|
11
8
|
import "../../localization/localization.js";
|
|
12
|
-
import
|
|
13
|
-
import { unsafeCSS as $ } from "../../node_modules/@lit/reactive-element/css-tag.js";
|
|
9
|
+
import $ from "./accordion.scss.js";
|
|
14
10
|
import { t as _ } from "../../node_modules/i18next/dist/esm/i18next.js";
|
|
15
11
|
var L = Object.defineProperty, I = Object.getOwnPropertyDescriptor, n = (h, e, t, d) => {
|
|
16
12
|
for (var r = d > 1 ? void 0 : d ? I(e, t) : e, c = h.length - 1, l; c >= 0; c--)
|
|
17
13
|
(l = h[c]) && (r = (d ? l(e, t, r) : l(r)) || r);
|
|
18
14
|
return d && r && L(e, t, r), r;
|
|
19
15
|
};
|
|
20
|
-
const
|
|
16
|
+
const u = [
|
|
21
17
|
"default",
|
|
22
18
|
"collapsed",
|
|
23
19
|
"clean",
|
|
24
20
|
"clean-collapsed"
|
|
25
|
-
], S =
|
|
21
|
+
], S = y(m);
|
|
26
22
|
var o;
|
|
27
23
|
const i = (o = class extends S {
|
|
28
24
|
constructor() {
|
|
@@ -83,7 +79,7 @@ const i = (o = class extends S {
|
|
|
83
79
|
}
|
|
84
80
|
set variant(e) {
|
|
85
81
|
const t = this._variant;
|
|
86
|
-
|
|
82
|
+
u.includes(e) ? this._variant = e : (console.warn(`Invalid accordion variant: ${e}. Using default.`), this._variant = "default"), this.requestUpdate("variant", t);
|
|
87
83
|
}
|
|
88
84
|
/**
|
|
89
85
|
* Renders the heading content. Override in subclasses to customize heading rendering.
|
|
@@ -100,7 +96,7 @@ const i = (o = class extends S {
|
|
|
100
96
|
return s`<div></div>`;
|
|
101
97
|
}
|
|
102
98
|
validateProperties() {
|
|
103
|
-
(this.headingLevel < 1 || this.headingLevel > 6) && console.warn("headingLevel must be between 1 and 6"),
|
|
99
|
+
(this.headingLevel < 1 || this.headingLevel > 6) && console.warn("headingLevel must be between 1 and 6"), u.includes(this.variant) || console.warn(`Invalid accordion variant: ${this.variant}. Using default.`);
|
|
104
100
|
}
|
|
105
101
|
firstUpdated(e) {
|
|
106
102
|
super.firstUpdated(e), this.validateProperties();
|
|
@@ -204,10 +200,10 @@ const i = (o = class extends S {
|
|
|
204
200
|
renderHeading() {
|
|
205
201
|
return s`
|
|
206
202
|
<div class="accordion__heading" part="heading">
|
|
207
|
-
<${
|
|
203
|
+
<${g(`h${this.headingLevel}`)}
|
|
208
204
|
class="accordion__heading-content">
|
|
209
205
|
${this.renderButtons()}
|
|
210
|
-
</${
|
|
206
|
+
</${g(`h${this.headingLevel}`)}>
|
|
211
207
|
</div>
|
|
212
208
|
`;
|
|
213
209
|
}
|
|
@@ -222,7 +218,7 @@ const i = (o = class extends S {
|
|
|
222
218
|
</div>
|
|
223
219
|
`;
|
|
224
220
|
}
|
|
225
|
-
}, o.styles = $
|
|
221
|
+
}, o.styles = b($), o.nextId = 0, o);
|
|
226
222
|
n([
|
|
227
223
|
f('[part="button"]')
|
|
228
224
|
], i.prototype, "button", 2);
|
|
@@ -256,8 +252,8 @@ n([
|
|
|
256
252
|
n([
|
|
257
253
|
a({ type: Boolean })
|
|
258
254
|
], i.prototype, "lastItem", 2);
|
|
259
|
-
let
|
|
255
|
+
let P = i;
|
|
260
256
|
export {
|
|
261
|
-
|
|
257
|
+
P as AccordionBaseElement
|
|
262
258
|
};
|
|
263
259
|
//# sourceMappingURL=accordion-base-element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion-base-element.js","sources":["../../../src/components/accordion/accordion-base-element.ts"],"sourcesContent":["import { clsx } from 'clsx'\nimport { PropertyValueMap, TemplateResult, unsafeCSS } from 'lit'\nimport { property, query } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { html, unsafeStatic } from 'lit/static-html.js'\n\nimport type { AccordionVariant } from '@/common/types'\nimport { HeadingLevel, LabelPlacement } from '@/dap-design-system'\nimport { DdsElement } from '@/internal/dds-hu-element'\nimport { SizedMixin } from '@/internal/mixin/sizedMixin'\nimport { t } from '@/localization/localization'\n\nimport type { IconSize } from '../icon/icon.component'\nimport styles from './accordion.scss?inline'\n\nexport interface AccordionEventDetail {\n open: boolean\n item: AccordionBaseElement\n}\n\nexport type AccordionOpenedEvent = CustomEvent<AccordionEventDetail>\nexport type AccordionClosedEvent = CustomEvent<AccordionEventDetail>\n\nconst ACCORDION_VARIANTS = [\n 'default',\n 'collapsed',\n 'clean',\n 'clean-collapsed',\n] as const\n\nconst AccordionBaseWithSized = SizedMixin(DdsElement)\n\nexport class AccordionBaseElement extends AccordionBaseWithSized {\n static readonly styles = unsafeCSS(styles)\n private static nextId = 0\n\n private readonly accordionId: string\n private readonly buttonId: string\n private readonly contentId: string\n\n private _headingLevel: HeadingLevel = 4\n private _variant: AccordionVariant = 'default'\n\n /** Query for the accordion button element */\n @query('[part=\"button\"]')\n protected button?: HTMLButtonElement\n\n /**\n * The element that actually takes focus -- the toggle button inside the shadow root.\n *\n * Without this, `accordionElement.focus()` silently does nothing: the host has no\n * tabindex and does not delegate focus, so a caller trying to move focus to an\n * accordion header (after committing an inline edit, say) drops focus to <body>.\n * Mirrors the `focusElement` contract that FocusableMixin defines and that\n * dap-ds-modal's focus trap already looks for.\n */\n get focusElement(): HTMLElement {\n return this.button ?? this\n }\n\n override focus(options?: FocusOptions): void {\n const target = this.focusElement\n if (target === this) {\n HTMLElement.prototype.focus.call(this, options)\n return\n }\n target.focus(options)\n }\n\n override blur(): void {\n const target = this.focusElement\n if (target === this) {\n HTMLElement.prototype.blur.call(this)\n return\n }\n target.blur()\n }\n\n /** Query for the accordion content element */\n @query('[part=\"content\"]')\n protected content?: HTMLDivElement\n\n /** Display size for accordion styling (sm or lg); other effective sizes map to sm. */\n private get accordionDisplaySize(): 'sm' | 'lg' {\n return this.effectiveSize === 'lg' ? 'lg' : 'sm'\n }\n\n /** The heading level of the accordion\n * @type { 1 | 2 | 3 | 4 | 5 | 6 }\n */\n @property({ type: Number })\n get headingLevel(): HeadingLevel {\n return this._headingLevel\n }\n set headingLevel(value: HeadingLevel) {\n const oldValue = this._headingLevel\n if (value < 1 || value > 6) {\n console.warn('headingLevel must be between 1 and 6, using default of 4')\n this._headingLevel = 4\n } else {\n this._headingLevel = value\n }\n this.requestUpdate('headingLevel', oldValue)\n }\n\n /** Whether the accordion is opened */\n @property({ type: Boolean, reflect: true }) opened = false\n\n /** Whether the accordion is disabled */\n @property({ type: Boolean, reflect: true }) disabled = false\n\n /** Whether the accordion is in loading state */\n @property({ type: Boolean, reflect: true }) loading = false\n\n /** The heading text of the accordion, this will be used as the aria label of the heading also if ariaLabel is not provided */\n @property({ type: String }) heading?: string\n\n /** The loading aria label of the accordion */\n @property({ type: String }) loadingAriaLabel?: string\n\n /** The location of the icon\n * @type { 'left' | 'right' }\n */\n @property({ type: String }) iconLocation: LabelPlacement = 'right'\n\n /** The variant of the accordion\n * @type { 'default' | 'collapsed' | 'clean' | 'clean-collapsed' }\n */\n @property({ type: String })\n get variant(): AccordionVariant {\n return this._variant\n }\n set variant(value: AccordionVariant) {\n const oldValue = this._variant\n if (!ACCORDION_VARIANTS.includes(value as any)) {\n console.warn(`Invalid accordion variant: ${value}. Using default.`)\n this._variant = 'default'\n } else {\n this._variant = value\n }\n this.requestUpdate('variant', oldValue)\n }\n\n /** Whether this is the last item in an accordion group */\n @property({ type: Boolean }) lastItem = false\n\n constructor() {\n super()\n AccordionBaseElement.nextId++\n const uniqueSuffix =\n typeof crypto !== 'undefined' && crypto.randomUUID\n ? crypto.randomUUID().slice(0, 8)\n : Date.now().toString(36)\n this.accordionId = `accordion-${AccordionBaseElement.nextId}-${uniqueSuffix}`\n this.buttonId = `${this.accordionId}-button`\n this.contentId = `${this.accordionId}-content`\n }\n\n /**\n * Renders the heading content. Override in subclasses to customize heading rendering.\n * @returns Template result for heading content\n */\n protected headingRender() {\n return html`<div>${this.heading}</div>`\n }\n\n /**\n * Renders additional content. Override in subclasses to add custom content.\n * @returns Template result for additional content\n */\n protected contentRender() {\n return html`<div></div>`\n }\n\n validateProperties(): void {\n if (this.headingLevel < 1 || this.headingLevel > 6) {\n console.warn('headingLevel must be between 1 and 6')\n }\n\n if (!ACCORDION_VARIANTS.includes(this.variant as any)) {\n console.warn(`Invalid accordion variant: ${this.variant}. Using default.`)\n }\n }\n\n protected firstUpdated(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,\n ): void {\n super.firstUpdated(_changedProperties)\n this.validateProperties()\n }\n\n private onChange(): void {\n const eventName = this.opened ? 'dds-opened' : 'dds-closed'\n const detail: AccordionEventDetail = {\n open: this.opened,\n item: this,\n }\n\n this.emit(eventName, detail)\n }\n\n private toggle(): void {\n if (this.disabled || this.loading) {\n return\n }\n\n this.opened = !this.opened\n this.onChange()\n }\n\n private handleKeyDown = (event: KeyboardEvent): void => {\n if (this.disabled || this.loading) {\n return\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n this.toggle()\n }\n }\n\n private handleClick = (event: Event): void => {\n if (this.disabled || this.loading) {\n event.preventDefault()\n return\n }\n\n this.toggle()\n }\n\n private get accordionClasses() {\n return clsx('accordion', {\n 'accordion--opened': this.opened,\n 'accordion--disabled': this.disabled,\n 'accordion--loading': this.loading,\n 'accordion--sm': this.accordionDisplaySize === 'sm',\n 'accordion--lg': this.accordionDisplaySize === 'lg',\n 'accordion--icon-left': this.iconLocation === 'left',\n 'accordion--icon-right': this.iconLocation === 'right',\n [`accordion--${this.variant}`]: this.variant,\n 'accordion--last-item': this.lastItem,\n })\n }\n\n private renderIconOrSpinner() {\n if (this.loading) {\n return html`\n <span\n class=\"accordion__loading\"\n role=\"status\"\n aria-live=\"polite\"\n aria-label=\"${this.loadingAriaLabel ?? t('loading')}\">\n <dap-ds-icon-loading-spinner size=\"16\"></dap-ds-icon-loading-spinner>\n </span>\n `\n }\n\n return html`\n <span\n class=\"accordion__icon-wrapper\"\n aria-hidden=\"true\"\n part=\"icon-wrapper\">\n <slot name=\"icon-opened\" class=\"accordion__icon-opened\">\n <dap-ds-icon\n exportparts=\"icon:open-icon, base:open-icon-base\"\n size=${(this.effectiveSize === 'xxs'\n ? 'xs'\n : this.effectiveSize) as IconSize}\n name=\"arrow-up-s-line\"\n class=\"open-icon\">\n </dap-ds-icon>\n </slot>\n <slot name=\"icon-closed\" class=\"accordion__icon-closed\">\n <dap-ds-icon\n exportparts=\"icon:close-icon, base:close-icon-base\"\n size=${(this.effectiveSize === 'xxs'\n ? 'xs'\n : this.effectiveSize) as IconSize}\n name=\"arrow-down-s-line\"\n class=\"close-icon\">\n </dap-ds-icon>\n </slot>\n </span>\n `\n }\n\n private renderButtons() {\n return html`\n <button\n class=\"accordion__button\"\n type=\"button\"\n part=\"button\"\n id=\"${this.buttonId}\"\n aria-controls=\"${this.contentId}\"\n aria-expanded=\"${this.opened}\"\n aria-disabled=\"${this.disabled}\"\n aria-label=${ifDefined(this.ariaLabel ?? this.heading)}\n aria-describedby=${ifDefined(this.ariaDescribedBy ?? undefined)}\n ?disabled=${this.disabled}\n @click=${this.handleClick}\n @keydown=${this.handleKeyDown}>\n ${this.renderIconOrSpinner()}\n <span part=\"heading-text\" class=\"accordion__heading-text\">\n <slot name=\"heading\"> ${this.headingRender()} </slot>\n </span>\n </button>\n `\n }\n\n private renderContent() {\n return html`\n <div\n part=\"content\"\n class=\"accordion__content\"\n id=\"${this.contentId}\"\n aria-labelledby=\"${this.buttonId}\"\n role=\"region\"\n aria-hidden=\"${!this.opened}\">\n <div part=\"content-container\" class=\"accordion-content__container\">\n <slot></slot>\n ${this.contentRender()}\n </div>\n </div>\n `\n }\n\n private renderHeading(): TemplateResult {\n return html`\n <div class=\"accordion__heading\" part=\"heading\">\n <${unsafeStatic(`h${this.headingLevel}`)}\n class=\"accordion__heading-content\">\n ${this.renderButtons()}\n </${unsafeStatic(`h${this.headingLevel}`)}>\n </div>\n `\n }\n\n /**\n * Renders the complete accordion component. Override in subclasses to customize the entire accordion structure.\n * @returns Template result for the complete accordion\n */\n renderAccordion() {\n return html`\n <div part=\"base\" class=${this.accordionClasses}>\n ${this.renderHeading()} ${this.renderContent()}\n </div>\n `\n }\n}\n"],"names":["ACCORDION_VARIANTS","AccordionBaseWithSized","SizedMixin","DdsElement","_AccordionBaseElement","_a","event","uniqueSuffix","options","target","value","oldValue","html","_changedProperties","eventName","detail","clsx","t","ifDefined","_b","unsafeStatic","unsafeCSS","styles","__decorateClass","query","property","AccordionBaseElement"],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA,MAAMA,IAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,IAAyBC,EAAWC,CAAU;;AAE7C,MAAMC,KAANC,IAAA,cAAmCJ,EAAuB;AAAA,EAkH/D,cAAc;AACN,UAAA,GA3GR,KAAQ,gBAA8B,GACtC,KAAQ,WAA6B,WAiEgB,KAAA,SAAA,IAGE,KAAA,WAAA,IAGD,KAAA,UAAA,IAWK,KAAA,eAAA,SAqBnB,KAAA,WAAA,IAkEhC,KAAA,gBAAgB,CAACK,MAA+B;AAClD,MAAA,KAAK,YAAY,KAAK,YAItBA,EAAM,QAAQ,WAAWA,EAAM,QAAQ,SACzCA,EAAM,eAAe,GACrB,KAAK,OAAO;AAAA,IAEhB,GAEQ,KAAA,cAAc,CAACA,MAAuB;AACxC,UAAA,KAAK,YAAY,KAAK,SAAS;AACjC,QAAAA,EAAM,eAAe;AACrB;AAAA,MAAA;AAGF,WAAK,OAAO;AAAA,IACd,GAhFuBD,EAAA;AACrB,UAAME,IACJ,OAAO,UAAW,eAAe,OAAO,aACpC,OAAO,WAAA,EAAa,MAAM,GAAG,CAAC,IAC9B,KAAK,IAAI,EAAE,SAAS,EAAE;AAC5B,SAAK,cAAc,aAAaF,EAAqB,MAAM,IAAIE,CAAY,IACtE,KAAA,WAAW,GAAG,KAAK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B,WAAA,YAAA,CAAA;AAhHxB,IAAMsB,IAANtB;"}
|
|
1
|
+
{"version":3,"file":"accordion-base-element.js","sources":["../../../src/components/accordion/accordion-base-element.ts"],"sourcesContent":["import { clsx } from 'clsx'\nimport { PropertyValueMap, TemplateResult, unsafeCSS } from 'lit'\nimport { property, query } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { html, unsafeStatic } from 'lit/static-html.js'\n\nimport type { AccordionVariant } from '@/common/types'\nimport { HeadingLevel, LabelPlacement } from '@/dap-design-system'\nimport { DdsElement } from '@/internal/dds-hu-element'\nimport { SizedMixin } from '@/internal/mixin/sizedMixin'\nimport { t } from '@/localization/localization'\n\nimport type { IconSize } from '../icon/icon.component'\nimport styles from './accordion.scss?inline'\n\nexport interface AccordionEventDetail {\n open: boolean\n item: AccordionBaseElement\n}\n\nexport type AccordionOpenedEvent = CustomEvent<AccordionEventDetail>\nexport type AccordionClosedEvent = CustomEvent<AccordionEventDetail>\n\nconst ACCORDION_VARIANTS = [\n 'default',\n 'collapsed',\n 'clean',\n 'clean-collapsed',\n] as const\n\nconst AccordionBaseWithSized = SizedMixin(DdsElement)\n\nexport class AccordionBaseElement extends AccordionBaseWithSized {\n static readonly styles = unsafeCSS(styles)\n private static nextId = 0\n\n private readonly accordionId: string\n private readonly buttonId: string\n private readonly contentId: string\n\n private _headingLevel: HeadingLevel = 4\n private _variant: AccordionVariant = 'default'\n\n /** Query for the accordion button element */\n @query('[part=\"button\"]')\n protected button?: HTMLButtonElement\n\n /**\n * The element that actually takes focus -- the toggle button inside the shadow root.\n *\n * Without this, `accordionElement.focus()` silently does nothing: the host has no\n * tabindex and does not delegate focus, so a caller trying to move focus to an\n * accordion header (after committing an inline edit, say) drops focus to <body>.\n * Mirrors the `focusElement` contract that FocusableMixin defines and that\n * dap-ds-modal's focus trap already looks for.\n */\n get focusElement(): HTMLElement {\n return this.button ?? this\n }\n\n override focus(options?: FocusOptions): void {\n const target = this.focusElement\n if (target === this) {\n HTMLElement.prototype.focus.call(this, options)\n return\n }\n target.focus(options)\n }\n\n override blur(): void {\n const target = this.focusElement\n if (target === this) {\n HTMLElement.prototype.blur.call(this)\n return\n }\n target.blur()\n }\n\n /** Query for the accordion content element */\n @query('[part=\"content\"]')\n protected content?: HTMLDivElement\n\n /** Display size for accordion styling (sm or lg); other effective sizes map to sm. */\n private get accordionDisplaySize(): 'sm' | 'lg' {\n return this.effectiveSize === 'lg' ? 'lg' : 'sm'\n }\n\n /** The heading level of the accordion\n * @type { 1 | 2 | 3 | 4 | 5 | 6 }\n */\n @property({ type: Number })\n get headingLevel(): HeadingLevel {\n return this._headingLevel\n }\n set headingLevel(value: HeadingLevel) {\n const oldValue = this._headingLevel\n if (value < 1 || value > 6) {\n console.warn('headingLevel must be between 1 and 6, using default of 4')\n this._headingLevel = 4\n } else {\n this._headingLevel = value\n }\n this.requestUpdate('headingLevel', oldValue)\n }\n\n /** Whether the accordion is opened */\n @property({ type: Boolean, reflect: true }) opened = false\n\n /** Whether the accordion is disabled */\n @property({ type: Boolean, reflect: true }) disabled = false\n\n /** Whether the accordion is in loading state */\n @property({ type: Boolean, reflect: true }) loading = false\n\n /** The heading text of the accordion, this will be used as the aria label of the heading also if ariaLabel is not provided */\n @property({ type: String }) heading?: string\n\n /** The loading aria label of the accordion */\n @property({ type: String }) loadingAriaLabel?: string\n\n /** The location of the icon\n * @type { 'left' | 'right' }\n */\n @property({ type: String }) iconLocation: LabelPlacement = 'right'\n\n /** The variant of the accordion\n * @type { 'default' | 'collapsed' | 'clean' | 'clean-collapsed' }\n */\n @property({ type: String })\n get variant(): AccordionVariant {\n return this._variant\n }\n set variant(value: AccordionVariant) {\n const oldValue = this._variant\n if (!ACCORDION_VARIANTS.includes(value as any)) {\n console.warn(`Invalid accordion variant: ${value}. Using default.`)\n this._variant = 'default'\n } else {\n this._variant = value\n }\n this.requestUpdate('variant', oldValue)\n }\n\n /** Whether this is the last item in an accordion group */\n @property({ type: Boolean }) lastItem = false\n\n constructor() {\n super()\n AccordionBaseElement.nextId++\n const uniqueSuffix =\n typeof crypto !== 'undefined' && crypto.randomUUID\n ? crypto.randomUUID().slice(0, 8)\n : Date.now().toString(36)\n this.accordionId = `accordion-${AccordionBaseElement.nextId}-${uniqueSuffix}`\n this.buttonId = `${this.accordionId}-button`\n this.contentId = `${this.accordionId}-content`\n }\n\n /**\n * Renders the heading content. Override in subclasses to customize heading rendering.\n * @returns Template result for heading content\n */\n protected headingRender() {\n return html`<div>${this.heading}</div>`\n }\n\n /**\n * Renders additional content. Override in subclasses to add custom content.\n * @returns Template result for additional content\n */\n protected contentRender() {\n return html`<div></div>`\n }\n\n validateProperties(): void {\n if (this.headingLevel < 1 || this.headingLevel > 6) {\n console.warn('headingLevel must be between 1 and 6')\n }\n\n if (!ACCORDION_VARIANTS.includes(this.variant as any)) {\n console.warn(`Invalid accordion variant: ${this.variant}. Using default.`)\n }\n }\n\n protected firstUpdated(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,\n ): void {\n super.firstUpdated(_changedProperties)\n this.validateProperties()\n }\n\n private onChange(): void {\n const eventName = this.opened ? 'dds-opened' : 'dds-closed'\n const detail: AccordionEventDetail = {\n open: this.opened,\n item: this,\n }\n\n this.emit(eventName, detail)\n }\n\n private toggle(): void {\n if (this.disabled || this.loading) {\n return\n }\n\n this.opened = !this.opened\n this.onChange()\n }\n\n private handleKeyDown = (event: KeyboardEvent): void => {\n if (this.disabled || this.loading) {\n return\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n this.toggle()\n }\n }\n\n private handleClick = (event: Event): void => {\n if (this.disabled || this.loading) {\n event.preventDefault()\n return\n }\n\n this.toggle()\n }\n\n private get accordionClasses() {\n return clsx('accordion', {\n 'accordion--opened': this.opened,\n 'accordion--disabled': this.disabled,\n 'accordion--loading': this.loading,\n 'accordion--sm': this.accordionDisplaySize === 'sm',\n 'accordion--lg': this.accordionDisplaySize === 'lg',\n 'accordion--icon-left': this.iconLocation === 'left',\n 'accordion--icon-right': this.iconLocation === 'right',\n [`accordion--${this.variant}`]: this.variant,\n 'accordion--last-item': this.lastItem,\n })\n }\n\n private renderIconOrSpinner() {\n if (this.loading) {\n return html`\n <span\n class=\"accordion__loading\"\n role=\"status\"\n aria-live=\"polite\"\n aria-label=\"${this.loadingAriaLabel ?? t('loading')}\">\n <dap-ds-icon-loading-spinner size=\"16\"></dap-ds-icon-loading-spinner>\n </span>\n `\n }\n\n return html`\n <span\n class=\"accordion__icon-wrapper\"\n aria-hidden=\"true\"\n part=\"icon-wrapper\">\n <slot name=\"icon-opened\" class=\"accordion__icon-opened\">\n <dap-ds-icon\n exportparts=\"icon:open-icon, base:open-icon-base\"\n size=${(this.effectiveSize === 'xxs'\n ? 'xs'\n : this.effectiveSize) as IconSize}\n name=\"arrow-up-s-line\"\n class=\"open-icon\">\n </dap-ds-icon>\n </slot>\n <slot name=\"icon-closed\" class=\"accordion__icon-closed\">\n <dap-ds-icon\n exportparts=\"icon:close-icon, base:close-icon-base\"\n size=${(this.effectiveSize === 'xxs'\n ? 'xs'\n : this.effectiveSize) as IconSize}\n name=\"arrow-down-s-line\"\n class=\"close-icon\">\n </dap-ds-icon>\n </slot>\n </span>\n `\n }\n\n private renderButtons() {\n return html`\n <button\n class=\"accordion__button\"\n type=\"button\"\n part=\"button\"\n id=\"${this.buttonId}\"\n aria-controls=\"${this.contentId}\"\n aria-expanded=\"${this.opened}\"\n aria-disabled=\"${this.disabled}\"\n aria-label=${ifDefined(this.ariaLabel ?? this.heading)}\n aria-describedby=${ifDefined(this.ariaDescribedBy ?? undefined)}\n ?disabled=${this.disabled}\n @click=${this.handleClick}\n @keydown=${this.handleKeyDown}>\n ${this.renderIconOrSpinner()}\n <span part=\"heading-text\" class=\"accordion__heading-text\">\n <slot name=\"heading\"> ${this.headingRender()} </slot>\n </span>\n </button>\n `\n }\n\n private renderContent() {\n return html`\n <div\n part=\"content\"\n class=\"accordion__content\"\n id=\"${this.contentId}\"\n aria-labelledby=\"${this.buttonId}\"\n role=\"region\"\n aria-hidden=\"${!this.opened}\">\n <div part=\"content-container\" class=\"accordion-content__container\">\n <slot></slot>\n ${this.contentRender()}\n </div>\n </div>\n `\n }\n\n private renderHeading(): TemplateResult {\n return html`\n <div class=\"accordion__heading\" part=\"heading\">\n <${unsafeStatic(`h${this.headingLevel}`)}\n class=\"accordion__heading-content\">\n ${this.renderButtons()}\n </${unsafeStatic(`h${this.headingLevel}`)}>\n </div>\n `\n }\n\n /**\n * Renders the complete accordion component. Override in subclasses to customize the entire accordion structure.\n * @returns Template result for the complete accordion\n */\n renderAccordion() {\n return html`\n <div part=\"base\" class=${this.accordionClasses}>\n ${this.renderHeading()} ${this.renderContent()}\n </div>\n `\n }\n}\n"],"names":["ACCORDION_VARIANTS","AccordionBaseWithSized","SizedMixin","DdsElement","_AccordionBaseElement","_a","event","uniqueSuffix","options","target","value","oldValue","html","_changedProperties","eventName","detail","clsx","t","ifDefined","_b","unsafeStatic","unsafeCSS","styles","__decorateClass","query","property","AccordionBaseElement"],"mappings":";;;;;;;;;;;;;;;AAuBA,MAAMA,IAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,IAAyBC,EAAWC,CAAU;;AAE7C,MAAMC,KAANC,IAAA,cAAmCJ,EAAuB;AAAA,EAkH/D,cAAc;AACN,UAAA,GA3GR,KAAQ,gBAA8B,GACtC,KAAQ,WAA6B,WAiEgB,KAAA,SAAA,IAGE,KAAA,WAAA,IAGD,KAAA,UAAA,IAWK,KAAA,eAAA,SAqBnB,KAAA,WAAA,IAkEhC,KAAA,gBAAgB,CAACK,MAA+B;AAClD,MAAA,KAAK,YAAY,KAAK,YAItBA,EAAM,QAAQ,WAAWA,EAAM,QAAQ,SACzCA,EAAM,eAAe,GACrB,KAAK,OAAO;AAAA,IAEhB,GAEQ,KAAA,cAAc,CAACA,MAAuB;AACxC,UAAA,KAAK,YAAY,KAAK,SAAS;AACjC,QAA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AAE,MAAM,OAAQ,CAAA;AAAA,GA3FfrB,EA2FiB,WAAA,gBAAA,CAAA;AAMxBmB,EAAA;AAAA,EADHE,EAAS,EAAE,MAAM,OAAQ,CAAA;AAAA,GAhGfrB,EAiGP,WAAA,WAAA,CAAA;AAeyBmB,EAAA;AAAA,EAA5BE,EAAS,EAAE,MAAM,QAAS,CAAA;AAAA,GAhHhBrB,EAgHkB,WAAA,YAAA,CAAA;AAhHxB,IAAMsB,IAANtB;"}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { clsx as l } from "../../node_modules/clsx/dist/clsx.js";
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import { property as h } from "../../node_modules/@lit/reactive-element/decorators/property.js";
|
|
6
|
-
import { queryAssignedElements as p } from "../../node_modules/@lit/reactive-element/decorators/query-assigned-elements.js";
|
|
7
|
-
import { html as u } from "../../node_modules/lit-html/static.js";
|
|
2
|
+
import { unsafeCSS as p } from "lit";
|
|
3
|
+
import { queryAssignedElements as u, property as h } from "lit/decorators.js";
|
|
4
|
+
import { html as g } from "lit/static-html.js";
|
|
8
5
|
import { DdsElement as m } from "../../internal/dds-hu-element.js";
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
var v = Object.defineProperty, a = (d, t, o, r) => {
|
|
6
|
+
import f from "./accordion-group.scss.js";
|
|
7
|
+
var v = Object.defineProperty, a = (d, t, n, r) => {
|
|
12
8
|
for (var e = void 0, i = d.length - 1, c; i >= 0; i--)
|
|
13
|
-
(c = d[i]) && (e = c(t,
|
|
14
|
-
return e && v(t,
|
|
9
|
+
(c = d[i]) && (e = c(t, n, e) || e);
|
|
10
|
+
return e && v(t, n, e), e;
|
|
15
11
|
};
|
|
16
12
|
const s = class s extends m {
|
|
17
13
|
constructor() {
|
|
@@ -32,19 +28,19 @@ const s = class s extends m {
|
|
|
32
28
|
this.setupAccordions();
|
|
33
29
|
}
|
|
34
30
|
setupAccordions() {
|
|
35
|
-
this.accordions.forEach((t,
|
|
36
|
-
t.variant = this.variant, t.lastItem =
|
|
31
|
+
this.accordions.forEach((t, n) => {
|
|
32
|
+
t.variant = this.variant, t.lastItem = n === this.accordions.length - 1, t.removeEventListener("dds-opened", this.boundOnAccordionChange), t.addEventListener("dds-opened", this.boundOnAccordionChange);
|
|
37
33
|
});
|
|
38
34
|
}
|
|
39
35
|
onAccordionChange(t) {
|
|
40
36
|
var r;
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
const n = (r = t.detail) == null ? void 0 : r.item;
|
|
38
|
+
n && this.autoClose === "true" && this.accordions.forEach((e) => {
|
|
39
|
+
n !== e && e.removeAttribute("opened");
|
|
44
40
|
});
|
|
45
41
|
}
|
|
46
42
|
render() {
|
|
47
|
-
return
|
|
43
|
+
return g`
|
|
48
44
|
<div
|
|
49
45
|
part="base"
|
|
50
46
|
class=${l("accordion-group", `accordion-group--${this.variant}`)}>
|
|
@@ -53,18 +49,18 @@ const s = class s extends m {
|
|
|
53
49
|
`;
|
|
54
50
|
}
|
|
55
51
|
};
|
|
56
|
-
s.tagName = "dap-ds-accordion-group", s.styles = f
|
|
57
|
-
let
|
|
52
|
+
s.tagName = "dap-ds-accordion-group", s.styles = p(f);
|
|
53
|
+
let o = s;
|
|
58
54
|
a([
|
|
59
|
-
|
|
60
|
-
],
|
|
55
|
+
u({ selector: "dap-ds-accordion" })
|
|
56
|
+
], o.prototype, "accordions");
|
|
61
57
|
a([
|
|
62
58
|
h({ type: String })
|
|
63
|
-
],
|
|
59
|
+
], o.prototype, "autoClose");
|
|
64
60
|
a([
|
|
65
61
|
h({ type: String })
|
|
66
|
-
],
|
|
62
|
+
], o.prototype, "variant");
|
|
67
63
|
export {
|
|
68
|
-
|
|
64
|
+
o as default
|
|
69
65
|
};
|
|
70
66
|
//# sourceMappingURL=accordion-group.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion-group.component.js","sources":["../../../src/components/accordion-group/accordion-group.component.ts"],"sourcesContent":["import clsx from 'clsx'\nimport { PropertyValueMap, unsafeCSS } from 'lit'\nimport { property, queryAssignedElements } from 'lit/decorators.js'\nimport { html } from 'lit/static-html.js'\n\nimport { AccordionVariant } from '@/dap-design-system'\n\nimport { DdsElement } from '../../internal/dds-hu-element'\nimport DapDSAccordion from '../accordion/accordion.component'\nimport styles from './accordion-group.scss?inline'\n\n/**\n * `dap-ds-accordion-group` is a custom accordion group component.\n * @element dap-ds-accordion-group\n * @summary An accordion group is a collection of accordion components.\n * @title - Accordion group\n * @group accordion\n *\n * @slot - The content of the accordion group.\n *\n * @csspart base - The main accordion group container.\n *\n * @cssproperty --dds-accordion-group-spacing - Controls the gap between accordion items (default: var(--dds-spacing-300))\n * @cssproperty --dds-accordion-group-border-color - Controls the border color (default: var(--dds-border-neutral-subtle))\n * @cssproperty --dds-accordion-group-border-width - Controls the border width (default: var(--dds-border-width-base))\n * @cssproperty --dds-accordion-group-border-radius - Controls the border radius (default: var(--dds-radius-base))\n * @cssproperty --dds-accordion-group-background - Controls the background color (default: transparent)\n */\nexport default class DapDSAccordionGroup extends DdsElement {\n static tagName = 'dap-ds-accordion-group'\n\n @queryAssignedElements({ selector: 'dap-ds-accordion' })\n private readonly accordions!: Array<DapDSAccordion>\n\n /** Whether to close other accordions when one is opened. */\n @property({ type: String }) autoClose = 'true'\n\n /** The variant of the accordion\n * @type { 'default' | 'collapsed' | 'clean' | 'clean-collapsed' }\n */\n @property({ type: String }) variant: AccordionVariant = 'default'\n\n static readonly styles = unsafeCSS(styles)\n\n private readonly boundOnAccordionChange = this.onAccordionChange.bind(this)\n private readonly boundOnSlotChange = this.onSlotChange.bind(this)\n\n connectedCallback(): void {\n super.connectedCallback()\n this.addEventListener('slotchange', this.boundOnSlotChange)\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n this.removeEventListener('slotchange', this.boundOnSlotChange)\n this.accordions.forEach(accordion => {\n accordion.removeEventListener('dds-opened', this.boundOnAccordionChange)\n })\n }\n\n protected firstUpdated(\n _changedProperties:\n | PropertyValueMap<DapDSAccordionGroup>\n | Map<PropertyKey, unknown>,\n ): void {\n this.setupAccordions()\n }\n\n private onSlotChange(): void {\n this.setupAccordions()\n }\n\n private setupAccordions(): void {\n this.accordions.forEach((accordion, index) => {\n accordion.variant = this.variant\n accordion.lastItem = index === this.accordions.length - 1\n\n accordion.removeEventListener('dds-opened', this.boundOnAccordionChange)\n accordion.addEventListener('dds-opened', this.boundOnAccordionChange)\n })\n }\n\n private onAccordionChange(event: CustomEvent): void {\n const openedAccordion = event.detail?.item\n\n if (!openedAccordion) {\n return\n }\n\n if (this.autoClose === 'true') {\n this.accordions.forEach(accordion => {\n if (openedAccordion !== accordion) {\n accordion.removeAttribute('opened')\n }\n })\n }\n }\n\n render() {\n return html`\n <div\n part=\"base\"\n class=${clsx('accordion-group', `accordion-group--${this.variant}`)}>\n <slot></slot>\n </div>\n `\n }\n}\n"],"names":["_DapDSAccordionGroup","DdsElement","accordion","_changedProperties","index","event","openedAccordion","_a","html","clsx","unsafeCSS","styles","DapDSAccordionGroup","__decorateClass","queryAssignedElements","property"],"mappings":"
|
|
1
|
+
{"version":3,"file":"accordion-group.component.js","sources":["../../../src/components/accordion-group/accordion-group.component.ts"],"sourcesContent":["import clsx from 'clsx'\nimport { PropertyValueMap, unsafeCSS } from 'lit'\nimport { property, queryAssignedElements } from 'lit/decorators.js'\nimport { html } from 'lit/static-html.js'\n\nimport { AccordionVariant } from '@/dap-design-system'\n\nimport { DdsElement } from '../../internal/dds-hu-element'\nimport DapDSAccordion from '../accordion/accordion.component'\nimport styles from './accordion-group.scss?inline'\n\n/**\n * `dap-ds-accordion-group` is a custom accordion group component.\n * @element dap-ds-accordion-group\n * @summary An accordion group is a collection of accordion components.\n * @title - Accordion group\n * @group accordion\n *\n * @slot - The content of the accordion group.\n *\n * @csspart base - The main accordion group container.\n *\n * @cssproperty --dds-accordion-group-spacing - Controls the gap between accordion items (default: var(--dds-spacing-300))\n * @cssproperty --dds-accordion-group-border-color - Controls the border color (default: var(--dds-border-neutral-subtle))\n * @cssproperty --dds-accordion-group-border-width - Controls the border width (default: var(--dds-border-width-base))\n * @cssproperty --dds-accordion-group-border-radius - Controls the border radius (default: var(--dds-radius-base))\n * @cssproperty --dds-accordion-group-background - Controls the background color (default: transparent)\n */\nexport default class DapDSAccordionGroup extends DdsElement {\n static tagName = 'dap-ds-accordion-group'\n\n @queryAssignedElements({ selector: 'dap-ds-accordion' })\n private readonly accordions!: Array<DapDSAccordion>\n\n /** Whether to close other accordions when one is opened. */\n @property({ type: String }) autoClose = 'true'\n\n /** The variant of the accordion\n * @type { 'default' | 'collapsed' | 'clean' | 'clean-collapsed' }\n */\n @property({ type: String }) variant: AccordionVariant = 'default'\n\n static readonly styles = unsafeCSS(styles)\n\n private readonly boundOnAccordionChange = this.onAccordionChange.bind(this)\n private readonly boundOnSlotChange = this.onSlotChange.bind(this)\n\n connectedCallback(): void {\n super.connectedCallback()\n this.addEventListener('slotchange', this.boundOnSlotChange)\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n this.removeEventListener('slotchange', this.boundOnSlotChange)\n this.accordions.forEach(accordion => {\n accordion.removeEventListener('dds-opened', this.boundOnAccordionChange)\n })\n }\n\n protected firstUpdated(\n _changedProperties:\n | PropertyValueMap<DapDSAccordionGroup>\n | Map<PropertyKey, unknown>,\n ): void {\n this.setupAccordions()\n }\n\n private onSlotChange(): void {\n this.setupAccordions()\n }\n\n private setupAccordions(): void {\n this.accordions.forEach((accordion, index) => {\n accordion.variant = this.variant\n accordion.lastItem = index === this.accordions.length - 1\n\n accordion.removeEventListener('dds-opened', this.boundOnAccordionChange)\n accordion.addEventListener('dds-opened', this.boundOnAccordionChange)\n })\n }\n\n private onAccordionChange(event: CustomEvent): void {\n const openedAccordion = event.detail?.item\n\n if (!openedAccordion) {\n return\n }\n\n if (this.autoClose === 'true') {\n this.accordions.forEach(accordion => {\n if (openedAccordion !== accordion) {\n accordion.removeAttribute('opened')\n }\n })\n }\n }\n\n render() {\n return html`\n <div\n part=\"base\"\n class=${clsx('accordion-group', `accordion-group--${this.variant}`)}>\n <slot></slot>\n </div>\n `\n }\n}\n"],"names":["_DapDSAccordionGroup","DdsElement","accordion","_changedProperties","index","event","openedAccordion","_a","html","clsx","unsafeCSS","styles","DapDSAccordionGroup","__decorateClass","queryAssignedElements","property"],"mappings":";;;;;;;;;;;AA4BA,MAAqBA,IAArB,MAAqBA,UAA4BC,EAAW;AAAA,EAA5D,cAAA;AAAA,UAAA,GAAA,SAAA,GAO0C,KAAA,YAAA,QAKgB,KAAA,UAAA,WAIxD,KAAiB,yBAAyB,KAAK,kBAAkB,KAAK,IAAI,GAC1E,KAAiB,oBAAoB,KAAK,aAAa,KAAK,IAAI;AAAA,EAAA;AAAA,EAEhE,oBAA0B;AACxB,UAAM,kBAAkB,GACnB,KAAA,iBAAiB,cAAc,KAAK,iBAAiB;AAAA,EAAA;AAAA,EAG5D,uBAA6B;AAC3B,UAAM,qBAAqB,GACtB,KAAA,oBAAoB,cAAc,KAAK,iBAAiB,GACxD,KAAA,WAAW,QAAQ,CAAaC,MAAA;AACzB,MAAAA,EAAA,oBAAoB,cAAc,KAAK,sBAAsB;AAAA,IAAA,CACxE;AAAA,EAAA;AAAA,EAGO,aACRC,GAGM;AACN,SAAK,gBAAgB;AAAA,EAAA;AAAA,EAGf,eAAqB;AAC3B,SAAK,gBAAgB;AAAA,EAAA;AAAA,EAGf,kBAAwB;AAC9B,SAAK,WAAW,QAAQ,CAACD,GAAWE,MAAU;AAC5C,MAAAF,EAAU,UAAU,KAAK,SACzBA,EAAU,WAAWE,MAAU,KAAK,WAAW,SAAS,GAE9CF,EAAA,oBAAoB,cAAc,KAAK,sBAAsB,GAC7DA,EAAA,iBAAiB,cAAc,KAAK,sBAAsB;AAAA,IAAA,CACrE;AAAA,EAAA;AAAA,EAGK,kBAAkBG,GAA0B;;AAC5C,UAAAC,KAAkBC,IAAAF,EAAM,WAAN,gBAAAE,EAAc;AAEtC,IAAKD,KAID,KAAK,cAAc,UAChB,KAAA,WAAW,QAAQ,CAAaJ,MAAA;AACnC,MAAII,MAAoBJ,KACtBA,EAAU,gBAAgB,QAAQ;AAAA,IACpC,CACD;AAAA,EACH;AAAA,EAGF,SAAS;AACA,WAAAM;AAAA;AAAA;AAAA,gBAGKC,EAAK,mBAAmB,oBAAoB,KAAK,OAAO,EAAE,CAAC;AAAA;AAAA;AAAA;AAAA,EAAA;AAK3E;AA9EET,EAAO,UAAU,0BAaDA,EAAA,SAASU,EAAUC,CAAM;AAd3C,IAAqBC,IAArBZ;AAImBa,EAAA;AAAA,EADhBC,EAAsB,EAAE,UAAU,mBAAoB,CAAA;AAAA,GAHpCF,EAIF,WAAA,YAAA;AAGWC,EAAA;AAAA,EAA3BE,EAAS,EAAE,MAAM,OAAQ,CAAA;AAAA,GAPPH,EAOS,WAAA,WAAA;AAKAC,EAAA;AAAA,EAA3BE,EAAS,EAAE,MAAM,OAAQ,CAAA;AAAA,GAZPH,EAYS,WAAA,SAAA;"}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { clsx as d } from "../../node_modules/clsx/dist/clsx.js";
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import { property as m } from "../../node_modules/@lit/reactive-element/decorators/property.js";
|
|
6
|
-
import { unsafeStatic as n, html as f } from "../../node_modules/lit-html/static.js";
|
|
2
|
+
import { unsafeCSS as n } from "lit";
|
|
3
|
+
import { property as m } from "lit/decorators.js";
|
|
4
|
+
import { unsafeStatic as p, html as f } from "lit/static-html.js";
|
|
7
5
|
import { anchorClass as c } from "../../common/const.js";
|
|
8
6
|
import { kebabCase as $ } from "../../common/utils.js";
|
|
9
7
|
import { adoptLightStyles as b } from "../../internal/adopt-light-styles.js";
|
|
10
8
|
import { DdsElement as k } from "../../internal/dds-hu-element.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
9
|
+
import v from "../link/link.component.js";
|
|
10
|
+
import u from "../typography/_styles/typography.scss.js";
|
|
13
11
|
import y from "./anchor-heading.scss.js";
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return t && x(a, o, t), t;
|
|
12
|
+
var x = Object.defineProperty, h = (s, a, l, C) => {
|
|
13
|
+
for (var t = void 0, i = s.length - 1, o; i >= 0; i--)
|
|
14
|
+
(o = s[i]) && (t = o(a, l, t) || t);
|
|
15
|
+
return t && x(a, l, t), t;
|
|
19
16
|
};
|
|
20
|
-
const
|
|
17
|
+
const e = class e extends k {
|
|
21
18
|
createRenderRoot() {
|
|
22
19
|
return b(this), this;
|
|
23
20
|
}
|
|
@@ -29,7 +26,7 @@ const r = class r extends k {
|
|
|
29
26
|
}
|
|
30
27
|
render() {
|
|
31
28
|
return f`
|
|
32
|
-
<${
|
|
29
|
+
<${p(this.variant)}
|
|
33
30
|
id=${this.elementId}
|
|
34
31
|
part="base"
|
|
35
32
|
class=${d(c, { [`typography-${this.variant}`]: this.variant })}
|
|
@@ -44,21 +41,21 @@ const r = class r extends k {
|
|
|
44
41
|
title=${this.anchorTitle}>
|
|
45
42
|
​
|
|
46
43
|
</dap-ds-link>
|
|
47
|
-
</${
|
|
44
|
+
</${p(this.variant)}>
|
|
48
45
|
`;
|
|
49
46
|
}
|
|
50
47
|
};
|
|
51
|
-
|
|
52
|
-
"dap-ds-link":
|
|
53
|
-
},
|
|
54
|
-
let
|
|
48
|
+
e.tagName = "dap-ds-anchor-heading", e.dependencies = {
|
|
49
|
+
"dap-ds-link": v
|
|
50
|
+
}, e.styles = [n(y), n(u)];
|
|
51
|
+
let r = e;
|
|
55
52
|
h([
|
|
56
53
|
m()
|
|
57
|
-
],
|
|
54
|
+
], r.prototype, "variant");
|
|
58
55
|
h([
|
|
59
56
|
m()
|
|
60
|
-
],
|
|
57
|
+
], r.prototype, "label");
|
|
61
58
|
export {
|
|
62
|
-
|
|
59
|
+
r as default
|
|
63
60
|
};
|
|
64
61
|
//# sourceMappingURL=anchor-heading.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor-heading.component.js","sources":["../../../src/components/anchor-heading/anchor-heading.component.ts"],"sourcesContent":["import clsx from 'clsx'\nimport { unsafeCSS } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport { html, unsafeStatic } from 'lit/static-html.js'\n\nimport { anchorClass } from '@/common/const'\nimport { kebabCase } from '@/common/utils'\nimport { adoptLightStyles } from '@/internal/adopt-light-styles'\nimport { DdsElement } from '@/internal/dds-hu-element'\n\nimport DapDSLink from '../link/link.component'\nimport typographyStyles from '../typography/_styles/typography.scss?inline'\nimport { TypographyVariant } from '../typography/typography.component'\nimport styles from './anchor-heading.scss?inline'\n\nexport type HeadingVariant = Extract<\n TypographyVariant,\n 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n>\n\n/**\n * `dap-ds-anchor-heading`\n * @summary Anchor heading is a heading with an anchor link.\n * @element dap-ds-anchor-heading\n * @title - Anchor heading\n *\n * @attribute {'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'} variant - The variant of the heading. Default is `h2`. Can be `h1`, `h2`, `h3`, `h4`, `h5`, or `h6`.\n * @attribute {string} label - The label of the heading.\n *\n * @csspart base - The main anchor heading container.\n * @csspart link - The link of the anchor heading. dap-ds-link element.\n * @csspart link-base - The base of the link part.\n * @csspart text - The text of the anchor heading.\n *\n * @cssproperty --dds-anchor-link-color - The color of the anchor link (default: var(--dds-color-primary))\n * @cssproperty --dds-anchor-link-opacity - The opacity of the anchor link when not hovered (default: 0)\n * @cssproperty --dds-anchor-link-hover-opacity - The opacity of the anchor link when hovered (default: 1)\n * @cssproperty --dds-anchor-link-transition - The transition property for the anchor link opacity (default: opacity 0.2s ease-in-out)\n */\nexport default class DapDSAnchorHeading extends DdsElement {\n static tagName = 'dap-ds-anchor-heading'\n\n static dependencies = {\n 'dap-ds-link': DapDSLink,\n }\n\n @property() variant!: HeadingVariant\n @property() label!: string\n\n static readonly styles = [unsafeCSS(styles), unsafeCSS(typographyStyles)]\n\n createRenderRoot() {\n adoptLightStyles(this)\n return this\n }\n\n get elementId() {\n return this.id ? this.id : kebabCase(this.label)\n }\n\n get anchorTitle() {\n return `Link to ${this.label}`\n }\n\n render() {\n return html`\n <${unsafeStatic(this.variant)}\n id=${this.elementId}\n part=\"base\"\n class=${clsx(anchorClass, { [`typography-${this.variant}`]: this.variant })}\n >\n ${this.label}\n <dap-ds-link\n part=\"link\"\n exportparts=\"base: link-base, text: link-text\"\n class=\"dds-anchor__link\"\n href=${`#${this.elementId}`}\n aria-label=${this.anchorTitle}\n title=${this.anchorTitle}>\n ​\n </dap-ds-link>\n </${unsafeStatic(this.variant)}>\n `\n }\n}\n"],"names":["_DapDSAnchorHeading","DdsElement","adoptLightStyles","kebabCase","html","unsafeStatic","clsx","anchorClass","DapDSLink","unsafeCSS","styles","typographyStyles","DapDSAnchorHeading","__decorateClass","property"],"mappings":"
|
|
1
|
+
{"version":3,"file":"anchor-heading.component.js","sources":["../../../src/components/anchor-heading/anchor-heading.component.ts"],"sourcesContent":["import clsx from 'clsx'\nimport { unsafeCSS } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport { html, unsafeStatic } from 'lit/static-html.js'\n\nimport { anchorClass } from '@/common/const'\nimport { kebabCase } from '@/common/utils'\nimport { adoptLightStyles } from '@/internal/adopt-light-styles'\nimport { DdsElement } from '@/internal/dds-hu-element'\n\nimport DapDSLink from '../link/link.component'\nimport typographyStyles from '../typography/_styles/typography.scss?inline'\nimport { TypographyVariant } from '../typography/typography.component'\nimport styles from './anchor-heading.scss?inline'\n\nexport type HeadingVariant = Extract<\n TypographyVariant,\n 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n>\n\n/**\n * `dap-ds-anchor-heading`\n * @summary Anchor heading is a heading with an anchor link.\n * @element dap-ds-anchor-heading\n * @title - Anchor heading\n *\n * @attribute {'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'} variant - The variant of the heading. Default is `h2`. Can be `h1`, `h2`, `h3`, `h4`, `h5`, or `h6`.\n * @attribute {string} label - The label of the heading.\n *\n * @csspart base - The main anchor heading container.\n * @csspart link - The link of the anchor heading. dap-ds-link element.\n * @csspart link-base - The base of the link part.\n * @csspart text - The text of the anchor heading.\n *\n * @cssproperty --dds-anchor-link-color - The color of the anchor link (default: var(--dds-color-primary))\n * @cssproperty --dds-anchor-link-opacity - The opacity of the anchor link when not hovered (default: 0)\n * @cssproperty --dds-anchor-link-hover-opacity - The opacity of the anchor link when hovered (default: 1)\n * @cssproperty --dds-anchor-link-transition - The transition property for the anchor link opacity (default: opacity 0.2s ease-in-out)\n */\nexport default class DapDSAnchorHeading extends DdsElement {\n static tagName = 'dap-ds-anchor-heading'\n\n static dependencies = {\n 'dap-ds-link': DapDSLink,\n }\n\n @property() variant!: HeadingVariant\n @property() label!: string\n\n static readonly styles = [unsafeCSS(styles), unsafeCSS(typographyStyles)]\n\n createRenderRoot() {\n adoptLightStyles(this)\n return this\n }\n\n get elementId() {\n return this.id ? this.id : kebabCase(this.label)\n }\n\n get anchorTitle() {\n return `Link to ${this.label}`\n }\n\n render() {\n return html`\n <${unsafeStatic(this.variant)}\n id=${this.elementId}\n part=\"base\"\n class=${clsx(anchorClass, { [`typography-${this.variant}`]: this.variant })}\n >\n ${this.label}\n <dap-ds-link\n part=\"link\"\n exportparts=\"base: link-base, text: link-text\"\n class=\"dds-anchor__link\"\n href=${`#${this.elementId}`}\n aria-label=${this.anchorTitle}\n title=${this.anchorTitle}>\n ​\n </dap-ds-link>\n </${unsafeStatic(this.variant)}>\n `\n }\n}\n"],"names":["_DapDSAnchorHeading","DdsElement","adoptLightStyles","kebabCase","html","unsafeStatic","clsx","anchorClass","DapDSLink","unsafeCSS","styles","typographyStyles","DapDSAnchorHeading","__decorateClass","property"],"mappings":";;;;;;;;;;;;;;;;AAuCA,MAAqBA,IAArB,MAAqBA,UAA2BC,EAAW;AAAA,EAYzD,mBAAmB;AACjB,WAAAC,EAAiB,IAAI,GACd;AAAA,EAAA;AAAA,EAGT,IAAI,YAAY;AACd,WAAO,KAAK,KAAK,KAAK,KAAKC,EAAU,KAAK,KAAK;AAAA,EAAA;AAAA,EAGjD,IAAI,cAAc;AACT,WAAA,WAAW,KAAK,KAAK;AAAA,EAAA;AAAA,EAG9B,SAAS;AACA,WAAAC;AAAA,OACJC,EAAa,KAAK,OAAO,CAAC;AAAA,WACtB,KAAK,SAAS;AAAA;AAAA,cAEXC,EAAKC,GAAa,EAAE,CAAC,cAAc,KAAK,OAAO,EAAE,GAAG,KAAK,SAAS,CAAC;AAAA;AAAA,QAEzE,KAAK,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,eAKH,IAAI,KAAK,SAAS,EAAE;AAAA,qBACd,KAAK,WAAW;AAAA,gBACrB,KAAK,WAAW;AAAA;AAAA;AAAA,QAGxBF,EAAa,KAAK,OAAO,CAAC;AAAA;AAAA,EAAA;AAGlC;AA5CEL,EAAO,UAAU,yBAEjBA,EAAO,eAAe;AAAA,EACpB,eAAeQ;AACjB,GAKAR,EAAgB,SAAS,CAACS,EAAUC,CAAM,GAAGD,EAAUE,CAAgB,CAAC;AAV1E,IAAqBC,IAArBZ;AAOca,EAAA;AAAA,EAAXC,EAAS;AAAA,GAPSF,EAOP,WAAA,SAAA;AACAC,EAAA;AAAA,EAAXC,EAAS;AAAA,GARSF,EAQP,WAAA,OAAA;"}
|