dasar-ui 1.1.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +31 -0
- package/.github/workflows/npm-publish-github-packages.yml +36 -0
- package/.versionrc.json +4 -0
- package/CHANGELOG.md +30 -0
- package/Dockerfile +26 -0
- package/angular.json +77 -0
- package/package.json +38 -24
- package/projects/dasar-ui/package.json +1 -1
- package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.ts +3 -7
- package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.ts +1 -1
- package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.ts +2 -2
- package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.ts +0 -2
- package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.html +11 -2
- package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.scss +30 -0
- package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.spec.ts +78 -6
- package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.ts +32 -32
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.registry.ts +0 -2
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.ts +1 -1
- package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.scss +0 -30
- package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.ts +0 -4
- package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list-item.html +17 -0
- package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list.html +25 -0
- package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list.scss +122 -0
- package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list.ts +166 -0
- package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.html +6 -5
- package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.scss +39 -5
- package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.spec.ts +78 -6
- package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.ts +41 -3
- package/projects/dasar-ui/src/lib/components/dasar-modal/dasar-modal.html +72 -0
- package/projects/dasar-ui/src/lib/components/dasar-modal/dasar-modal.scss +170 -0
- package/projects/dasar-ui/src/lib/components/dasar-modal/dasar-modal.spec.ts +267 -0
- package/projects/dasar-ui/src/lib/components/dasar-modal/dasar-modal.ts +305 -0
- package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.scss +2 -7
- package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.html +11 -0
- package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.scss +18 -0
- package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.spec.ts +104 -0
- package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.ts +87 -0
- package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.ts +1 -1
- package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.html +1 -14
- package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.scss +0 -11
- package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.ts +0 -2
- package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.html +9 -5
- package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.scss +62 -22
- package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.spec.ts +82 -6
- package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.ts +47 -4
- package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.html +92 -30
- package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.scss +137 -25
- package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.spec.ts +554 -5
- package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.ts +312 -35
- package/projects/dasar-ui/src/lib/components/dasar-theme-provider/dasar-theme-provider.ts +6 -21
- package/projects/dasar-ui/src/lib/models/theme.model.ts +35 -12
- package/projects/dasar-ui/src/lib/services/theme.service.spec.ts +65 -0
- package/projects/dasar-ui/src/lib/services/theme.service.ts +68 -4
- package/projects/dasar-ui/src/lib/styles/theme.scss +47 -48
- package/projects/dasar-ui/src/lib/utils/common.ts +5 -24
- package/projects/dasar-ui/src/lib/utils/icon-size.spec.ts +23 -0
- package/projects/dasar-ui/src/lib/utils/icon-size.ts +16 -0
- package/projects/dasar-ui/src/lib/utils/panel-placement.spec.ts +90 -0
- package/projects/dasar-ui/src/lib/utils/panel-placement.ts +53 -0
- package/projects/dasar-ui/src/public-api.ts +4 -4
- package/projects/dasar-ui/tsconfig.spec.json +8 -1
- package/projects/documentation/public/favicon.ico +0 -0
- package/projects/documentation/src/app/app.html +51 -0
- package/projects/documentation/src/app/app.spec.ts +23 -0
- package/projects/documentation/src/app/app.ts +23 -0
- package/projects/documentation/src/app/components/doc-customize-modal.component.ts +314 -0
- package/projects/documentation/src/app/components/doc-example.component.ts +195 -0
- package/projects/documentation/src/app/config/app.config.server.ts +10 -0
- package/projects/documentation/src/app/config/app.config.ts +17 -0
- package/projects/documentation/src/app/layouts/doc.layout.ts +229 -0
- package/projects/documentation/src/app/pages/button/button.page.html +65 -0
- package/projects/documentation/src/app/pages/button/button.page.ts +139 -0
- package/projects/documentation/src/app/pages/button/examples/appearance/button-appearance.example.html +7 -0
- package/projects/documentation/src/app/pages/button/examples/appearance/button-appearance.example.ts +10 -0
- package/projects/documentation/src/app/pages/button/examples/icon/button-icon.example.html +19 -0
- package/projects/documentation/src/app/pages/button/examples/icon/button-icon.example.ts +10 -0
- package/projects/documentation/src/app/pages/button/examples/radius/button-radius.example.html +9 -0
- package/projects/documentation/src/app/pages/button/examples/radius/button-radius.example.ts +10 -0
- package/projects/documentation/src/app/pages/button/examples/sizes/button-sizes.example.html +7 -0
- package/projects/documentation/src/app/pages/button/examples/sizes/button-sizes.example.ts +10 -0
- package/projects/documentation/src/app/pages/button/examples/state/button-state.example.html +10 -0
- package/projects/documentation/src/app/pages/button/examples/state/button-state.example.ts +10 -0
- package/projects/documentation/src/app/pages/button/examples/variant/button-variant.example.html +9 -0
- package/projects/documentation/src/app/pages/button/examples/variant/button-variant.example.ts +10 -0
- package/projects/documentation/src/app/pages/calendar/calendar.page.html +75 -0
- package/projects/documentation/src/app/pages/calendar/calendar.page.ts +165 -0
- package/projects/documentation/src/app/pages/calendar/examples/actions/calendar-actions.example.html +21 -0
- package/projects/documentation/src/app/pages/calendar/examples/actions/calendar-actions.example.ts +10 -0
- package/projects/documentation/src/app/pages/calendar/examples/basic/calendar-basic.example.html +11 -0
- package/projects/documentation/src/app/pages/calendar/examples/basic/calendar-basic.example.ts +13 -0
- package/projects/documentation/src/app/pages/calendar/examples/custom-header/calendar-custom-header.example.html +36 -0
- package/projects/documentation/src/app/pages/calendar/examples/custom-header/calendar-custom-header.example.ts +11 -0
- package/projects/documentation/src/app/pages/calendar/examples/dropdown/calendar-dropdown.example.html +10 -0
- package/projects/documentation/src/app/pages/calendar/examples/dropdown/calendar-dropdown.example.ts +12 -0
- package/projects/documentation/src/app/pages/calendar/examples/format/calendar-format.example.html +15 -0
- package/projects/documentation/src/app/pages/calendar/examples/format/calendar-format.example.ts +12 -0
- package/projects/documentation/src/app/pages/calendar/examples/locale/calendar-locale.example.html +34 -0
- package/projects/documentation/src/app/pages/calendar/examples/locale/calendar-locale.example.ts +14 -0
- package/projects/documentation/src/app/pages/calendar/examples/more/calendar.more.example.html +20 -0
- package/projects/documentation/src/app/pages/calendar/examples/more/calendar.more.example.ts +37 -0
- package/projects/documentation/src/app/pages/calendar/examples/styles/calendar-styles.example.html +16 -0
- package/projects/documentation/src/app/pages/calendar/examples/styles/calendar-styles.example.ts +10 -0
- package/projects/documentation/src/app/pages/card/card.page.html +75 -0
- package/projects/documentation/src/app/pages/card/card.page.ts +182 -0
- package/projects/documentation/src/app/pages/card/examples/appearance/card-appearance.example.html +13 -0
- package/projects/documentation/src/app/pages/card/examples/appearance/card-appearance.example.ts +10 -0
- package/projects/documentation/src/app/pages/card/examples/closable/card-closable.example.html +30 -0
- package/projects/documentation/src/app/pages/card/examples/closable/card-closable.example.ts +19 -0
- package/projects/documentation/src/app/pages/card/examples/custom-style/card-custom-style.example.html +173 -0
- package/projects/documentation/src/app/pages/card/examples/custom-style/card-custom-style.example.ts +10 -0
- package/projects/documentation/src/app/pages/card/examples/media/card-media.example.html +27 -0
- package/projects/documentation/src/app/pages/card/examples/media/card-media.example.ts +10 -0
- package/projects/documentation/src/app/pages/card/examples/radius/card-radius.example.html +13 -0
- package/projects/documentation/src/app/pages/card/examples/radius/card-radius.example.ts +10 -0
- package/projects/documentation/src/app/pages/card/examples/slots/card-slots.example.html +20 -0
- package/projects/documentation/src/app/pages/card/examples/slots/card-slots.example.ts +10 -0
- package/projects/documentation/src/app/pages/card/examples/spacing/card-spacing.example.html +11 -0
- package/projects/documentation/src/app/pages/card/examples/spacing/card-spacing.example.ts +10 -0
- package/projects/documentation/src/app/pages/chip/chip.page.html +55 -0
- package/projects/documentation/src/app/pages/chip/chip.page.ts +158 -0
- package/projects/documentation/src/app/pages/chip/examples/appearance/chip-appearance.example.html +7 -0
- package/projects/documentation/src/app/pages/chip/examples/appearance/chip-appearance.example.ts +10 -0
- package/projects/documentation/src/app/pages/chip/examples/more/chip-more.example.html +13 -0
- package/projects/documentation/src/app/pages/chip/examples/more/chip-more.example.ts +17 -0
- package/projects/documentation/src/app/pages/chip/examples/radius/chip-radius.example.html +9 -0
- package/projects/documentation/src/app/pages/chip/examples/radius/chip-radius.example.ts +10 -0
- package/projects/documentation/src/app/pages/chip/examples/sizes/chip-sizes.example.html +6 -0
- package/projects/documentation/src/app/pages/chip/examples/sizes/chip-sizes.example.ts +10 -0
- package/projects/documentation/src/app/pages/chip/examples/variant/chip-variant.example.html +8 -0
- package/projects/documentation/src/app/pages/chip/examples/variant/chip-variant.example.ts +10 -0
- package/projects/documentation/src/app/pages/datepicker/datepicker.page.html +75 -0
- package/projects/documentation/src/app/pages/datepicker/datepicker.page.ts +181 -0
- package/projects/documentation/src/app/pages/datepicker/examples/appearance/datepicker-appearance.example.html +29 -0
- package/projects/documentation/src/app/pages/datepicker/examples/appearance/datepicker-appearance.example.ts +10 -0
- package/projects/documentation/src/app/pages/datepicker/examples/basic/datepicker-basic.example.html +12 -0
- package/projects/documentation/src/app/pages/datepicker/examples/basic/datepicker-basic.example.ts +12 -0
- package/projects/documentation/src/app/pages/datepicker/examples/footer/datepicker-footer.example.html +23 -0
- package/projects/documentation/src/app/pages/datepicker/examples/footer/datepicker-footer.example.ts +17 -0
- package/projects/documentation/src/app/pages/datepicker/examples/format/datepicker-format.example.html +30 -0
- package/projects/documentation/src/app/pages/datepicker/examples/format/datepicker-format.example.ts +13 -0
- package/projects/documentation/src/app/pages/datepicker/examples/placement/datepicker-placement.example.html +24 -0
- package/projects/documentation/src/app/pages/datepicker/examples/placement/datepicker-placement.example.ts +10 -0
- package/projects/documentation/src/app/pages/datepicker/examples/slots/datepicker-slots.example.html +19 -0
- package/projects/documentation/src/app/pages/datepicker/examples/slots/datepicker-slots.example.ts +10 -0
- package/projects/documentation/src/app/pages/datepicker/examples/states/datepicker-states.example.html +28 -0
- package/projects/documentation/src/app/pages/datepicker/examples/states/datepicker-states.example.ts +12 -0
- package/projects/documentation/src/app/pages/icon/icon.page.html +15 -0
- package/projects/documentation/src/app/pages/icon/icon.page.ts +60 -0
- package/projects/documentation/src/app/pages/input/examples/appearance/input-appearance.example.html +27 -0
- package/projects/documentation/src/app/pages/input/examples/appearance/input-appearance.example.ts +10 -0
- package/projects/documentation/src/app/pages/input/examples/basic/input-basic.example.html +13 -0
- package/projects/documentation/src/app/pages/input/examples/basic/input-basic.example.ts +13 -0
- package/projects/documentation/src/app/pages/input/examples/mask/input-mask.example.html +31 -0
- package/projects/documentation/src/app/pages/input/examples/mask/input-mask.example.ts +19 -0
- package/projects/documentation/src/app/pages/input/examples/more/input-more.example.html +68 -0
- package/projects/documentation/src/app/pages/input/examples/more/input-more.example.ts +18 -0
- package/projects/documentation/src/app/pages/input/examples/slots/input-slots.example.html +52 -0
- package/projects/documentation/src/app/pages/input/examples/slots/input-slots.example.ts +10 -0
- package/projects/documentation/src/app/pages/input/examples/states/input-states.example.html +29 -0
- package/projects/documentation/src/app/pages/input/examples/states/input-states.example.ts +10 -0
- package/projects/documentation/src/app/pages/input/input.page.html +65 -0
- package/projects/documentation/src/app/pages/input/input.page.ts +170 -0
- package/projects/documentation/src/app/pages/menu/examples/basic/menu-basic.example.html +5 -0
- package/projects/documentation/src/app/pages/menu/examples/basic/menu-basic.example.ts +17 -0
- package/projects/documentation/src/app/pages/menu/examples/custom-template/menu-custom-template.example.html +35 -0
- package/projects/documentation/src/app/pages/menu/examples/custom-template/menu-custom-template.example.ts +57 -0
- package/projects/documentation/src/app/pages/menu/examples/placement/menu-placement.example.html +12 -0
- package/projects/documentation/src/app/pages/menu/examples/placement/menu-placement.example.ts +16 -0
- package/projects/documentation/src/app/pages/menu/menu.page.html +35 -0
- package/projects/documentation/src/app/pages/menu/menu.page.ts +149 -0
- package/projects/documentation/src/app/pages/modal/examples/appearance/modal-appearance.example.html +18 -0
- package/projects/documentation/src/app/pages/modal/examples/appearance/modal-appearance.example.ts +21 -0
- package/projects/documentation/src/app/pages/modal/examples/basic/modal-basic.example.html +8 -0
- package/projects/documentation/src/app/pages/modal/examples/basic/modal-basic.example.ts +12 -0
- package/projects/documentation/src/app/pages/modal/examples/close-behavior/modal-close-behavior.example.html +44 -0
- package/projects/documentation/src/app/pages/modal/examples/close-behavior/modal-close-behavior.example.ts +14 -0
- package/projects/documentation/src/app/pages/modal/examples/custom-style/modal-custom-style.example.html +36 -0
- package/projects/documentation/src/app/pages/modal/examples/custom-style/modal-custom-style.example.ts +12 -0
- package/projects/documentation/src/app/pages/modal/examples/overlay/modal-overlay.example.html +29 -0
- package/projects/documentation/src/app/pages/modal/examples/overlay/modal-overlay.example.ts +14 -0
- package/projects/documentation/src/app/pages/modal/examples/radius-spacing/modal-radius-spacing.example.html +27 -0
- package/projects/documentation/src/app/pages/modal/examples/radius-spacing/modal-radius-spacing.example.ts +27 -0
- package/projects/documentation/src/app/pages/modal/examples/scroll/modal-scroll.example.html +14 -0
- package/projects/documentation/src/app/pages/modal/examples/scroll/modal-scroll.example.ts +13 -0
- package/projects/documentation/src/app/pages/modal/examples/size/modal-size.example.html +17 -0
- package/projects/documentation/src/app/pages/modal/examples/size/modal-size.example.ts +21 -0
- package/projects/documentation/src/app/pages/modal/examples/slots/modal-slots.example.html +30 -0
- package/projects/documentation/src/app/pages/modal/examples/slots/modal-slots.example.ts +12 -0
- package/projects/documentation/src/app/pages/modal/examples/width/modal-width.example.html +23 -0
- package/projects/documentation/src/app/pages/modal/examples/width/modal-width.example.ts +13 -0
- package/projects/documentation/src/app/pages/modal/modal.page.html +105 -0
- package/projects/documentation/src/app/pages/modal/modal.page.ts +257 -0
- package/projects/documentation/src/app/pages/number-input/examples/appearance/number-input-appearance.example.html +30 -0
- package/projects/documentation/src/app/pages/number-input/examples/appearance/number-input-appearance.example.ts +10 -0
- package/projects/documentation/src/app/pages/number-input/examples/basic/number-input-basic.example.html +12 -0
- package/projects/documentation/src/app/pages/number-input/examples/basic/number-input-basic.example.ts +13 -0
- package/projects/documentation/src/app/pages/number-input/examples/limits/number-input-limits.example.html +30 -0
- package/projects/documentation/src/app/pages/number-input/examples/limits/number-input-limits.example.ts +14 -0
- package/projects/documentation/src/app/pages/number-input/examples/slots/number-input-slots.example.html +49 -0
- package/projects/documentation/src/app/pages/number-input/examples/slots/number-input-slots.example.ts +10 -0
- package/projects/documentation/src/app/pages/number-input/examples/states/number-input-states.example.html +21 -0
- package/projects/documentation/src/app/pages/number-input/examples/states/number-input-states.example.ts +10 -0
- package/projects/documentation/src/app/pages/number-input/number-input.page.html +55 -0
- package/projects/documentation/src/app/pages/number-input/number-input.page.ts +142 -0
- package/projects/documentation/src/app/pages/select/examples/appearance/select-appearance.example.html +32 -0
- package/projects/documentation/src/app/pages/select/examples/appearance/select-appearance.example.ts +15 -0
- package/projects/documentation/src/app/pages/select/examples/basic/select-basic.example.html +13 -0
- package/projects/documentation/src/app/pages/select/examples/basic/select-basic.example.ts +20 -0
- package/projects/documentation/src/app/pages/select/examples/multiple/select-multiple.example.html +24 -0
- package/projects/documentation/src/app/pages/select/examples/multiple/select-multiple.example.ts +59 -0
- package/projects/documentation/src/app/pages/select/examples/placement/select-placement.example.html +20 -0
- package/projects/documentation/src/app/pages/select/examples/placement/select-placement.example.ts +20 -0
- package/projects/documentation/src/app/pages/select/examples/search/select-search.example.html +13 -0
- package/projects/documentation/src/app/pages/select/examples/search/select-search.example.ts +22 -0
- package/projects/documentation/src/app/pages/select/examples/slots/select-slots.example.html +44 -0
- package/projects/documentation/src/app/pages/select/examples/slots/select-slots.example.ts +15 -0
- package/projects/documentation/src/app/pages/select/examples/states/select-states.example.html +31 -0
- package/projects/documentation/src/app/pages/select/examples/states/select-states.example.ts +12 -0
- package/projects/documentation/src/app/pages/select/select.page.html +75 -0
- package/projects/documentation/src/app/pages/select/select.page.ts +195 -0
- package/projects/documentation/src/app/pages/table/examples/cell-actions/table-cell-actions.example.html +14 -0
- package/projects/documentation/src/app/pages/table/examples/cell-actions/table-cell-actions.example.ts +25 -0
- package/projects/documentation/src/app/pages/table/examples/cell-badge/table-cell-badge.example.html +12 -0
- package/projects/documentation/src/app/pages/table/examples/cell-badge/table-cell-badge.example.ts +21 -0
- package/projects/documentation/src/app/pages/table/examples/cell-profile/table-cell-profile.example.html +29 -0
- package/projects/documentation/src/app/pages/table/examples/cell-profile/table-cell-profile.example.ts +20 -0
- package/projects/documentation/src/app/pages/table/examples/custom-body/table-custom-body.example.html +39 -0
- package/projects/documentation/src/app/pages/table/examples/custom-body/table-custom-body.example.ts +21 -0
- package/projects/documentation/src/app/pages/table/examples/custom-sizes/table-custom-sizes.example.html +7 -0
- package/projects/documentation/src/app/pages/table/examples/custom-sizes/table-custom-sizes.example.ts +21 -0
- package/projects/documentation/src/app/pages/table/examples/dynamic-style/table-dynamic-style.example.html +3 -0
- package/projects/documentation/src/app/pages/table/examples/dynamic-style/table-dynamic-style.example.ts +41 -0
- package/projects/documentation/src/app/pages/table/examples/empty/table-empty.example.html +43 -0
- package/projects/documentation/src/app/pages/table/examples/empty/table-empty.example.ts +21 -0
- package/projects/documentation/src/app/pages/table/examples/expanded/table-expanded.example.html +36 -0
- package/projects/documentation/src/app/pages/table/examples/expanded/table-expanded.example.ts +34 -0
- package/projects/documentation/src/app/pages/table/examples/heatmap/table-heatmap.example.html +8 -0
- package/projects/documentation/src/app/pages/table/examples/heatmap/table-heatmap.example.ts +52 -0
- package/projects/documentation/src/app/pages/table/examples/inline-edit/table-inline-edit.example.html +53 -0
- package/projects/documentation/src/app/pages/table/examples/inline-edit/table-inline-edit.example.ts +50 -0
- package/projects/documentation/src/app/pages/table/examples/nested/table-nested.example.html +23 -0
- package/projects/documentation/src/app/pages/table/examples/nested/table-nested.example.ts +42 -0
- package/projects/documentation/src/app/pages/table/examples/pagination/table-pagination.example.html +20 -0
- package/projects/documentation/src/app/pages/table/examples/pagination/table-pagination.example.ts +21 -0
- package/projects/documentation/src/app/pages/table/table.page.html +125 -0
- package/projects/documentation/src/app/pages/table/table.page.ts +261 -0
- package/projects/documentation/src/app/pages/tabs/examples/advanced-dynamic/tabs-advanced-dynamic.example.html +13 -0
- package/projects/documentation/src/app/pages/tabs/examples/advanced-dynamic/tabs-advanced-dynamic.example.ts +27 -0
- package/projects/documentation/src/app/pages/tabs/examples/advanced-form/tabs-advanced-form.example.html +27 -0
- package/projects/documentation/src/app/pages/tabs/examples/advanced-form/tabs-advanced-form.example.ts +36 -0
- package/projects/documentation/src/app/pages/tabs/examples/advanced-theme/tabs-advanced-theme.example.html +5 -0
- package/projects/documentation/src/app/pages/tabs/examples/advanced-theme/tabs-advanced-theme.example.ts +20 -0
- package/projects/documentation/src/app/pages/tabs/examples/appearance/tabs-appearance.example.html +6 -0
- package/projects/documentation/src/app/pages/tabs/examples/appearance/tabs-appearance.example.ts +13 -0
- package/projects/documentation/src/app/pages/tabs/examples/basic/tabs-basic.example.html +13 -0
- package/projects/documentation/src/app/pages/tabs/examples/basic/tabs-basic.example.ts +13 -0
- package/projects/documentation/src/app/pages/tabs/examples/custom-style/tabs-custom-style.example.html +19 -0
- package/projects/documentation/src/app/pages/tabs/examples/custom-style/tabs-custom-style.example.ts +12 -0
- package/projects/documentation/src/app/pages/tabs/examples/events/tabs-events.example.html +16 -0
- package/projects/documentation/src/app/pages/tabs/examples/events/tabs-events.example.ts +23 -0
- package/projects/documentation/src/app/pages/tabs/examples/fluid/tabs-fluid.example.html +5 -0
- package/projects/documentation/src/app/pages/tabs/examples/fluid/tabs-fluid.example.ts +12 -0
- package/projects/documentation/src/app/pages/tabs/examples/no-body/tabs-no-body.example.html +6 -0
- package/projects/documentation/src/app/pages/tabs/examples/no-body/tabs-no-body.example.ts +12 -0
- package/projects/documentation/src/app/pages/tabs/examples/radius/tabs-radius.example.html +6 -0
- package/projects/documentation/src/app/pages/tabs/examples/radius/tabs-radius.example.ts +13 -0
- package/projects/documentation/src/app/pages/tabs/examples/scroll/tabs-scroll.example.html +20 -0
- package/projects/documentation/src/app/pages/tabs/examples/scroll/tabs-scroll.example.ts +30 -0
- package/projects/documentation/src/app/pages/tabs/examples/scroll-icon/tabs-scroll-icon.example.html +16 -0
- package/projects/documentation/src/app/pages/tabs/examples/scroll-icon/tabs-scroll-icon.example.ts +26 -0
- package/projects/documentation/src/app/pages/tabs/examples/scroll-slot/tabs-scroll-slot.example.html +22 -0
- package/projects/documentation/src/app/pages/tabs/examples/scroll-slot/tabs-scroll-slot.example.ts +26 -0
- package/projects/documentation/src/app/pages/tabs/examples/size/tabs-size.example.html +6 -0
- package/projects/documentation/src/app/pages/tabs/examples/size/tabs-size.example.ts +13 -0
- package/projects/documentation/src/app/pages/tabs/examples/slots/tabs-slots.example.html +25 -0
- package/projects/documentation/src/app/pages/tabs/examples/slots/tabs-slots.example.ts +10 -0
- package/projects/documentation/src/app/pages/tabs/examples/spacing/tabs-spacing.example.html +6 -0
- package/projects/documentation/src/app/pages/tabs/examples/spacing/tabs-spacing.example.ts +13 -0
- package/projects/documentation/src/app/pages/tabs/tabs.page.html +165 -0
- package/projects/documentation/src/app/pages/tabs/tabs.page.ts +340 -0
- package/projects/documentation/src/app/routes/app.routes.server.ts +8 -0
- package/projects/documentation/src/app/routes/app.routes.ts +87 -0
- package/projects/documentation/src/app/services/doc-customize.service.ts +107 -0
- package/projects/documentation/src/app/utils/highlight.pipe.ts +43 -0
- package/projects/documentation/src/index.html +13 -0
- package/projects/documentation/src/main.server.ts +7 -0
- package/projects/documentation/src/main.ts +5 -0
- package/projects/documentation/src/server.ts +47 -0
- package/projects/documentation/src/styles.scss +7 -0
- package/projects/documentation/tsconfig.app.json +11 -0
- package/projects/documentation/tsconfig.spec.json +10 -0
- package/tsconfig.json +6 -3
- package/.nvmrc +0 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Component, signal } from '@angular/core';
|
|
2
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
3
|
+
import { DasarOverlay } from './dasar-overlay';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
standalone: true,
|
|
7
|
+
imports: [DasarOverlay],
|
|
8
|
+
template: `<dasar-overlay
|
|
9
|
+
[blur]="blur()"
|
|
10
|
+
(onClick)="clicked.set(clicked() + 1)"
|
|
11
|
+
></dasar-overlay>`,
|
|
12
|
+
})
|
|
13
|
+
class OverlayHost {
|
|
14
|
+
blur = signal('4px');
|
|
15
|
+
clicked = signal(0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@Component({
|
|
19
|
+
standalone: true,
|
|
20
|
+
imports: [DasarOverlay],
|
|
21
|
+
template: `<dasar-overlay><div class="panel">child</div></dasar-overlay>`,
|
|
22
|
+
})
|
|
23
|
+
class OverlayContentHost {}
|
|
24
|
+
|
|
25
|
+
describe('DasarOverlay', () => {
|
|
26
|
+
let component: DasarOverlay;
|
|
27
|
+
let fixture: ComponentFixture<DasarOverlay>;
|
|
28
|
+
|
|
29
|
+
beforeEach(async () => {
|
|
30
|
+
await TestBed.configureTestingModule({
|
|
31
|
+
imports: [DasarOverlay],
|
|
32
|
+
}).compileComponents();
|
|
33
|
+
|
|
34
|
+
fixture = TestBed.createComponent(DasarOverlay);
|
|
35
|
+
component = fixture.componentInstance;
|
|
36
|
+
await fixture.whenStable();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('should create', () => {
|
|
40
|
+
expect(component).toBeTruthy();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('applies the dasar-overlay host class', () => {
|
|
44
|
+
fixture.detectChanges();
|
|
45
|
+
expect(fixture.nativeElement.classList).toContain('dasar-overlay');
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
describe('DasarOverlay interactions', () => {
|
|
50
|
+
const backdrop = (f: ComponentFixture<unknown>) =>
|
|
51
|
+
f.nativeElement.querySelector('.dasar-overlay-backdrop') as HTMLElement;
|
|
52
|
+
|
|
53
|
+
it('reflects the blur input into a CSS custom property', async () => {
|
|
54
|
+
await TestBed.configureTestingModule({ imports: [OverlayHost] }).compileComponents();
|
|
55
|
+
const fixture: ComponentFixture<OverlayHost> = TestBed.createComponent(OverlayHost);
|
|
56
|
+
fixture.detectChanges();
|
|
57
|
+
|
|
58
|
+
expect(backdrop(fixture).style.getPropertyValue('--overlay-blur')).toBe('4px');
|
|
59
|
+
|
|
60
|
+
fixture.componentInstance.blur.set('10px');
|
|
61
|
+
await fixture.whenStable();
|
|
62
|
+
|
|
63
|
+
expect(backdrop(fixture).style.getPropertyValue('--overlay-blur')).toBe('10px');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('reflects the background input into a CSS custom property', async () => {
|
|
67
|
+
await TestBed.configureTestingModule({ imports: [OverlayHost] }).compileComponents();
|
|
68
|
+
const fixture: ComponentFixture<OverlayHost> = TestBed.createComponent(OverlayHost);
|
|
69
|
+
fixture.detectChanges();
|
|
70
|
+
|
|
71
|
+
fixture.componentInstance.blur.set('0px');
|
|
72
|
+
await fixture.whenStable();
|
|
73
|
+
|
|
74
|
+
expect(backdrop(fixture).style.getPropertyValue('--overlay-blur')).toBe('0px');
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('emits onClick when the backdrop itself is clicked', async () => {
|
|
78
|
+
await TestBed.configureTestingModule({ imports: [OverlayHost] }).compileComponents();
|
|
79
|
+
const fixture: ComponentFixture<OverlayHost> = TestBed.createComponent(OverlayHost);
|
|
80
|
+
fixture.detectChanges();
|
|
81
|
+
|
|
82
|
+
backdrop(fixture).click();
|
|
83
|
+
await fixture.whenStable();
|
|
84
|
+
|
|
85
|
+
expect(fixture.componentInstance.clicked()).toBe(1);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it('does not emit onClick when projected content is clicked', async () => {
|
|
89
|
+
await TestBed.configureTestingModule({ imports: [OverlayContentHost] }).compileComponents();
|
|
90
|
+
const fixture = TestBed.createComponent(OverlayContentHost);
|
|
91
|
+
fixture.detectChanges();
|
|
92
|
+
|
|
93
|
+
const overlay = fixture.debugElement.query(
|
|
94
|
+
(node) => node.componentInstance instanceof DasarOverlay,
|
|
95
|
+
);
|
|
96
|
+
let emitted = false;
|
|
97
|
+
overlay.componentInstance.onClick.subscribe(() => (emitted = true));
|
|
98
|
+
|
|
99
|
+
fixture.nativeElement.querySelector('.panel').click();
|
|
100
|
+
await fixture.whenStable();
|
|
101
|
+
|
|
102
|
+
expect(emitted).toBe(false);
|
|
103
|
+
});
|
|
104
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {
|
|
2
|
+
booleanAttribute,
|
|
3
|
+
ViewEncapsulation,
|
|
4
|
+
EventEmitter,
|
|
5
|
+
HostBinding,
|
|
6
|
+
Component,
|
|
7
|
+
Output,
|
|
8
|
+
inject,
|
|
9
|
+
Input,
|
|
10
|
+
} from '@angular/core';
|
|
11
|
+
import { CommonModule } from '@angular/common';
|
|
12
|
+
|
|
13
|
+
import { DASAR_THEME_PROVIDER } from '../dasar-theme-provider/dasar-theme-provider';
|
|
14
|
+
import { ClassType, StyleType } from '../../models/type.model';
|
|
15
|
+
import { DasarThemeService } from '../../services/theme.service';
|
|
16
|
+
import { resolveThemeDefault } from '../../utils/common';
|
|
17
|
+
|
|
18
|
+
export interface DasarOverlayConfig {
|
|
19
|
+
blur?: string;
|
|
20
|
+
background?: string;
|
|
21
|
+
zIndex?: number;
|
|
22
|
+
overlayStyle?: StyleType;
|
|
23
|
+
overlayClass?: ClassType;
|
|
24
|
+
closeOnClick?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@Component({
|
|
28
|
+
imports: [CommonModule],
|
|
29
|
+
encapsulation: ViewEncapsulation.None,
|
|
30
|
+
templateUrl: './dasar-overlay.html',
|
|
31
|
+
styleUrls: ['./dasar-overlay.scss'],
|
|
32
|
+
selector: 'dasar-overlay',
|
|
33
|
+
standalone: true,
|
|
34
|
+
})
|
|
35
|
+
export class DasarOverlay {
|
|
36
|
+
private themeProvider = inject(DASAR_THEME_PROVIDER, { optional: true });
|
|
37
|
+
private themeService = inject(DasarThemeService, { optional: true });
|
|
38
|
+
|
|
39
|
+
@Input() blur = resolveThemeDefault(
|
|
40
|
+
'overlay',
|
|
41
|
+
'blur',
|
|
42
|
+
'4px',
|
|
43
|
+
this.themeProvider,
|
|
44
|
+
this.themeService,
|
|
45
|
+
);
|
|
46
|
+
@Input() background = resolveThemeDefault(
|
|
47
|
+
'overlay',
|
|
48
|
+
'background',
|
|
49
|
+
'rgba(0, 0, 0, 0.45)',
|
|
50
|
+
this.themeProvider,
|
|
51
|
+
this.themeService,
|
|
52
|
+
);
|
|
53
|
+
@Input({ alias: 'z-index' }) zIndex = resolveThemeDefault(
|
|
54
|
+
'overlay',
|
|
55
|
+
'zIndex',
|
|
56
|
+
1000,
|
|
57
|
+
this.themeProvider,
|
|
58
|
+
this.themeService,
|
|
59
|
+
);
|
|
60
|
+
@Input({ alias: 'overlay-style' }) overlayStyle = resolveThemeDefault(
|
|
61
|
+
'overlay',
|
|
62
|
+
'overlayStyle',
|
|
63
|
+
null,
|
|
64
|
+
this.themeProvider,
|
|
65
|
+
this.themeService,
|
|
66
|
+
);
|
|
67
|
+
@Input({ alias: 'overlay-class' }) overlayClass = resolveThemeDefault(
|
|
68
|
+
'overlay',
|
|
69
|
+
'overlayClass',
|
|
70
|
+
null,
|
|
71
|
+
this.themeProvider,
|
|
72
|
+
this.themeService,
|
|
73
|
+
);
|
|
74
|
+
@Input({ alias: 'close-on-click', transform: booleanAttribute }) closeOnClick =
|
|
75
|
+
resolveThemeDefault('overlay', 'closeOnClick', true, this.themeProvider, this.themeService);
|
|
76
|
+
|
|
77
|
+
@Output() onClick = new EventEmitter<MouseEvent>();
|
|
78
|
+
|
|
79
|
+
@HostBinding('class.dasar-overlay') readonly baseClass = true;
|
|
80
|
+
|
|
81
|
+
handleClick(event: MouseEvent): void {
|
|
82
|
+
if (event.target !== event.currentTarget) return;
|
|
83
|
+
this.onClick.emit(event);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const DasarOverlayComponent = [DasarOverlay] as const;
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
effect,
|
|
10
10
|
} from '@angular/core';
|
|
11
11
|
import { CommonModule } from '@angular/common';
|
|
12
|
-
import { DasarButtonComponent } from '../dasar-button/dasar-button';
|
|
12
|
+
import { DasarButtonComponent } from '../dasar-button/dasar-button';
|
|
13
13
|
|
|
14
14
|
export type DasarPaginationRadiusType = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
15
15
|
export type DasarPaginationAppearanceType = 'solid' | 'subtle' | 'outline';
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
<div
|
|
2
2
|
class="dasar-pivot-container appearance-{{ appearance }} size-{{ size }} spacing-{{ spacing }}"
|
|
3
3
|
>
|
|
4
|
-
<!-- Top Table Header Slot (Optional Toolbar) -->
|
|
5
4
|
@if (providedHeader) {
|
|
6
5
|
<ng-container *ngTemplateOutlet="providedHeader.templateRef"></ng-container>
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
<div class="dasar-pivot-wrapper">
|
|
10
9
|
<table class="dasar-pivot-table hoverable">
|
|
11
|
-
<!-- HEADER ROW -->
|
|
12
10
|
<thead>
|
|
13
11
|
<tr>
|
|
14
12
|
<th class="corner-cell">
|
|
@@ -39,12 +37,9 @@
|
|
|
39
37
|
</tr>
|
|
40
38
|
</thead>
|
|
41
39
|
|
|
42
|
-
<!-- CUSTOM BODY SLOT -->
|
|
43
40
|
@if (providedBody) {
|
|
44
41
|
<ng-container *ngTemplateOutlet="providedBody.templateRef"></ng-container>
|
|
45
|
-
}
|
|
46
|
-
<!-- STANDARD BODY -->
|
|
47
|
-
@else if (data.length > 0 && !loading) {
|
|
42
|
+
} @else if (data.length > 0 && !loading) {
|
|
48
43
|
<tbody>
|
|
49
44
|
@for (row of rowHeaders; track row; let i = $index) {
|
|
50
45
|
<tr
|
|
@@ -53,7 +48,6 @@
|
|
|
53
48
|
(dblclick)="handleRowDblclick(row, i, $event)"
|
|
54
49
|
(contextmenu)="handleRowContextMenu(row, i, $event)"
|
|
55
50
|
>
|
|
56
|
-
<!-- Row Header -->
|
|
57
51
|
<th scope="row" class="row-header">
|
|
58
52
|
@if (rowHeaderTemplate) {
|
|
59
53
|
<ng-container
|
|
@@ -64,7 +58,6 @@
|
|
|
64
58
|
}
|
|
65
59
|
</th>
|
|
66
60
|
|
|
67
|
-
<!-- Data Cells (With custom styling functions) -->
|
|
68
61
|
@for (col of colHeaders; track col) {
|
|
69
62
|
<td
|
|
70
63
|
class="data-cell"
|
|
@@ -84,7 +77,6 @@
|
|
|
84
77
|
</td>
|
|
85
78
|
}
|
|
86
79
|
|
|
87
|
-
<!-- Row Total Cell -->
|
|
88
80
|
@if (showRowTotals) {
|
|
89
81
|
<td class="total-cell row-total">
|
|
90
82
|
{{ rowTotals[row] !== null ? rowTotals[row] : emptyText }}
|
|
@@ -92,7 +84,6 @@
|
|
|
92
84
|
}
|
|
93
85
|
</tr>
|
|
94
86
|
|
|
95
|
-
<!-- Expanded Row Slot -->
|
|
96
87
|
@if (expandedRows.has(row) && providedExpanded) {
|
|
97
88
|
<tr class="dasar-table-expanded-row state-row">
|
|
98
89
|
<td
|
|
@@ -109,7 +100,6 @@
|
|
|
109
100
|
</tbody>
|
|
110
101
|
}
|
|
111
102
|
|
|
112
|
-
<!-- FOOTER ROW -->
|
|
113
103
|
@if (showColTotals && rowHeaders.length > 0 && !loading && !providedBody) {
|
|
114
104
|
<tfoot>
|
|
115
105
|
<tr>
|
|
@@ -129,7 +119,6 @@
|
|
|
129
119
|
}
|
|
130
120
|
</table>
|
|
131
121
|
|
|
132
|
-
<!-- Loading State -->
|
|
133
122
|
@if (loading) {
|
|
134
123
|
<div class="state-cell">
|
|
135
124
|
<div class="state-content">
|
|
@@ -139,7 +128,6 @@
|
|
|
139
128
|
</div>
|
|
140
129
|
}
|
|
141
130
|
|
|
142
|
-
<!-- Empty State -->
|
|
143
131
|
@if (data.length === 0 && !loading) {
|
|
144
132
|
@if (providedEmpty) {
|
|
145
133
|
<ng-container *ngTemplateOutlet="providedEmpty.templateRef"></ng-container>
|
|
@@ -154,7 +142,6 @@
|
|
|
154
142
|
}
|
|
155
143
|
</div>
|
|
156
144
|
|
|
157
|
-
<!-- Pagination Slot (Bottom Toolbar) -->
|
|
158
145
|
@if (providedPagination) {
|
|
159
146
|
<div class="dasar-table-pagination">
|
|
160
147
|
<ng-container *ngTemplateOutlet="providedPagination.templateRef"></ng-container>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@use '../../styles/theme.scss' as *;
|
|
2
2
|
|
|
3
3
|
.dasar-pivot-container {
|
|
4
|
-
/* Inherit Table Variables */
|
|
5
4
|
--dt-primary: var(--theme-primary-color);
|
|
6
5
|
--dt-primary-hover: var(--theme-primary-hover-color);
|
|
7
6
|
--dt-primary-surface: var(--theme-primary-surface-color);
|
|
@@ -36,7 +35,6 @@
|
|
|
36
35
|
background-color: transparent;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
/* --- Sizing --- */
|
|
40
38
|
&.size-sm {
|
|
41
39
|
font-size: 13px;
|
|
42
40
|
}
|
|
@@ -47,7 +45,6 @@
|
|
|
47
45
|
font-size: 16px;
|
|
48
46
|
}
|
|
49
47
|
|
|
50
|
-
/* --- Spacing --- */
|
|
51
48
|
&.spacing-compact .dasar-pivot-table {
|
|
52
49
|
th,
|
|
53
50
|
td {
|
|
@@ -87,7 +84,6 @@
|
|
|
87
84
|
white-space: nowrap;
|
|
88
85
|
}
|
|
89
86
|
|
|
90
|
-
/* --- Top Headers --- */
|
|
91
87
|
thead {
|
|
92
88
|
background-color: var(--dt-primary);
|
|
93
89
|
|
|
@@ -101,7 +97,6 @@
|
|
|
101
97
|
}
|
|
102
98
|
}
|
|
103
99
|
|
|
104
|
-
/* --- Top Left Corner --- */
|
|
105
100
|
.corner-cell {
|
|
106
101
|
background-color: var(--dt-primary);
|
|
107
102
|
position: sticky;
|
|
@@ -133,7 +128,6 @@
|
|
|
133
128
|
}
|
|
134
129
|
}
|
|
135
130
|
|
|
136
|
-
/* --- Body & Rows --- */
|
|
137
131
|
tbody {
|
|
138
132
|
tr.dasar-table-row {
|
|
139
133
|
border-bottom: 1px solid var(--theme-border-subtle-color);
|
|
@@ -148,7 +142,6 @@
|
|
|
148
142
|
}
|
|
149
143
|
}
|
|
150
144
|
|
|
151
|
-
/* --- Row Headers (Left Column) --- */
|
|
152
145
|
.row-header {
|
|
153
146
|
background-color: var(--theme-bg-surface-color);
|
|
154
147
|
font-weight: var(--font-weight-semibold, $dasar-font-weight-semibold);
|
|
@@ -161,12 +154,10 @@
|
|
|
161
154
|
box-shadow 0.2s ease;
|
|
162
155
|
}
|
|
163
156
|
|
|
164
|
-
/* --- Data Cells --- */
|
|
165
157
|
.data-cell {
|
|
166
158
|
text-align: right;
|
|
167
159
|
}
|
|
168
160
|
|
|
169
|
-
/* --- Hover State (Matches Table Hover) --- */
|
|
170
161
|
&.hoverable tbody tr.dasar-table-row:not(.state-row):hover {
|
|
171
162
|
background-color: var(--dt-primary-surface);
|
|
172
163
|
cursor: pointer;
|
|
@@ -179,7 +170,6 @@
|
|
|
179
170
|
}
|
|
180
171
|
}
|
|
181
172
|
|
|
182
|
-
/* --- Totals --- */
|
|
183
173
|
.total-header {
|
|
184
174
|
font-weight: var(--font-weight-bold, $dasar-font-weight-bold);
|
|
185
175
|
}
|
|
@@ -216,7 +206,6 @@
|
|
|
216
206
|
}
|
|
217
207
|
}
|
|
218
208
|
|
|
219
|
-
/* --- State & Utility Classes --- */
|
|
220
209
|
.state-row {
|
|
221
210
|
background-color: transparent !important;
|
|
222
211
|
&:hover {
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
} from '@angular/core';
|
|
14
14
|
import { CommonModule } from '@angular/common';
|
|
15
15
|
|
|
16
|
-
// --- Types ---
|
|
17
16
|
export type DasarPivotAggregator = 'sum' | 'count' | 'avg' | 'min' | 'max';
|
|
18
17
|
export type DasarPivotTableAppearance = 'outline' | 'filled' | 'elevated' | 'borderless';
|
|
19
18
|
export type DasarPivotTableSpacing = 'compact' | 'normal' | 'relaxed';
|
|
@@ -203,7 +202,6 @@ export class DasarPivotTable implements OnChanges {
|
|
|
203
202
|
this.grandTotal = null;
|
|
204
203
|
}
|
|
205
204
|
|
|
206
|
-
// --- Event Handlers ---
|
|
207
205
|
handleRowClick(row: string, index: number, event: MouseEvent) {
|
|
208
206
|
this.rowClick.emit({ row, index, event });
|
|
209
207
|
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
</div>
|
|
15
15
|
}
|
|
16
16
|
<div
|
|
17
|
+
#triggerEl
|
|
17
18
|
class="dasar-select-container appearance-{{ appearance }} size-{{ size }} radius-{{ radius }}"
|
|
18
19
|
[class.hide-overflow]="hideOverflow"
|
|
19
20
|
[class.full-width]="fullWidth"
|
|
@@ -99,14 +100,14 @@
|
|
|
99
100
|
</div>
|
|
100
101
|
@if (loading) {
|
|
101
102
|
<div class="dasar-select-loader-wrapper">
|
|
102
|
-
<dasar-icon name="loader" size="
|
|
103
|
+
<dasar-icon name="loader" [size]="iconSize" class="spinning-icon"></dasar-icon>
|
|
103
104
|
</div>
|
|
104
105
|
}
|
|
105
106
|
@if (clearable && hasValue && !disabled) {
|
|
106
107
|
<dasar-icon
|
|
107
108
|
class="dasar-select-clear-btn"
|
|
108
109
|
tabindex="-1"
|
|
109
|
-
size="
|
|
110
|
+
[size]="iconSize"
|
|
110
111
|
name="x"
|
|
111
112
|
(click)="clearSelection($event)"
|
|
112
113
|
></dasar-icon>
|
|
@@ -121,12 +122,15 @@
|
|
|
121
122
|
[disabled]="disabled"
|
|
122
123
|
[size]="size"
|
|
123
124
|
>
|
|
124
|
-
<dasar-icon [name]="arrowIconName" [size]="
|
|
125
|
+
<dasar-icon [name]="arrowIconName" [size]="iconSize"></dasar-icon>
|
|
125
126
|
</dasar-button>
|
|
126
127
|
</div>
|
|
127
128
|
@if (isOpen && !disabled) {
|
|
128
129
|
<div
|
|
129
|
-
|
|
130
|
+
#panelEl
|
|
131
|
+
class="dasar-select-dropdown-panel size-{{ size }} radius-{{ radius }} placement-{{
|
|
132
|
+
currentPlacement
|
|
133
|
+
}}"
|
|
130
134
|
[ngClass]="dropdownPanelClass"
|
|
131
135
|
[ngStyle]="dropdownPanelStyle"
|
|
132
136
|
>
|
|
@@ -168,7 +172,7 @@
|
|
|
168
172
|
></ng-container>
|
|
169
173
|
} @else {
|
|
170
174
|
@if (option.iconName) {
|
|
171
|
-
<dasar-icon [name]="option.iconName" size="
|
|
175
|
+
<dasar-icon [name]="option.iconName" [size]="iconSize"></dasar-icon>
|
|
172
176
|
}
|
|
173
177
|
<span class="option-label">{{ option.label }}</span>
|
|
174
178
|
}
|
|
@@ -117,9 +117,6 @@
|
|
|
117
117
|
|
|
118
118
|
&:has([prefix-slot], [chip-template]) {
|
|
119
119
|
padding-left: 0;
|
|
120
|
-
// .dasar-select-value-display {
|
|
121
|
-
// padding-left: var(--input-padding-horizontal-xs, var(--space-base));
|
|
122
|
-
// }
|
|
123
120
|
}
|
|
124
121
|
}
|
|
125
122
|
|
|
@@ -131,9 +128,6 @@
|
|
|
131
128
|
|
|
132
129
|
&:has([prefix-slot], [chip-template]) {
|
|
133
130
|
padding-left: 0;
|
|
134
|
-
// .dasar-select-value-display {
|
|
135
|
-
// padding-left: var(--input-padding-horizontal-sm, var(--space-3));
|
|
136
|
-
// }
|
|
137
131
|
}
|
|
138
132
|
}
|
|
139
133
|
|
|
@@ -145,9 +139,6 @@
|
|
|
145
139
|
|
|
146
140
|
&:has([prefix-slot], [chip-template]) {
|
|
147
141
|
padding-left: 0;
|
|
148
|
-
// .dasar-select-value-display {
|
|
149
|
-
// padding-left: var(--input-padding-horizontal-md, var(--space-4));
|
|
150
|
-
// }
|
|
151
142
|
}
|
|
152
143
|
}
|
|
153
144
|
|
|
@@ -159,9 +150,6 @@
|
|
|
159
150
|
|
|
160
151
|
&:has([prefix-slot], [chip-template]) {
|
|
161
152
|
padding-left: 0;
|
|
162
|
-
// .dasar-select-value-display {
|
|
163
|
-
// padding-left: var(--input-padding-horizontal-lg, var(--space-5));
|
|
164
|
-
// }
|
|
165
153
|
}
|
|
166
154
|
}
|
|
167
155
|
|
|
@@ -173,9 +161,6 @@
|
|
|
173
161
|
|
|
174
162
|
&:has([prefix-slot]) {
|
|
175
163
|
padding-left: 0;
|
|
176
|
-
// .dasar-select-value-display {
|
|
177
|
-
// padding-left: var(--input-padding-horizontal-xl, var(--space-6));
|
|
178
|
-
// }
|
|
179
164
|
}
|
|
180
165
|
}
|
|
181
166
|
|
|
@@ -262,8 +247,6 @@
|
|
|
262
247
|
|
|
263
248
|
.dasar-select-dropdown-panel {
|
|
264
249
|
position: absolute;
|
|
265
|
-
top: calc(100% + 4px);
|
|
266
|
-
left: 0;
|
|
267
250
|
width: 100%;
|
|
268
251
|
max-height: var(--select-dropdown-max-height, 240px);
|
|
269
252
|
overflow-y: auto;
|
|
@@ -278,6 +261,51 @@
|
|
|
278
261
|
z-index: var(--select-dropdown-z-index, 50);
|
|
279
262
|
display: flex;
|
|
280
263
|
flex-direction: column;
|
|
264
|
+
|
|
265
|
+
&.radius-none {
|
|
266
|
+
border-radius: var(--select-dropdown-radius-none, var(--radius-none));
|
|
267
|
+
}
|
|
268
|
+
&.radius-xs {
|
|
269
|
+
border-radius: var(--select-dropdown-radius-xs, var(--radius-xs));
|
|
270
|
+
}
|
|
271
|
+
&.radius-sm {
|
|
272
|
+
border-radius: var(--select-dropdown-radius-sm, var(--radius-sm));
|
|
273
|
+
}
|
|
274
|
+
&.radius-md {
|
|
275
|
+
border-radius: var(--select-dropdown-radius-md, var(--radius-md));
|
|
276
|
+
}
|
|
277
|
+
&.radius-lg {
|
|
278
|
+
border-radius: var(--select-dropdown-radius-lg, var(--radius-lg));
|
|
279
|
+
}
|
|
280
|
+
&.radius-xl {
|
|
281
|
+
border-radius: var(--select-dropdown-radius-xl, var(--radius-xl));
|
|
282
|
+
}
|
|
283
|
+
&.radius-full {
|
|
284
|
+
border-radius: var(--select-dropdown-radius-full, var(--radius-lg));
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
&.placement-bottom-start {
|
|
288
|
+
top: calc(100% + var(--select-dropdown-offset, 4px));
|
|
289
|
+
right: auto;
|
|
290
|
+
left: 0;
|
|
291
|
+
}
|
|
292
|
+
&.placement-bottom-end {
|
|
293
|
+
top: calc(100% + var(--select-dropdown-offset, 4px));
|
|
294
|
+
right: 0;
|
|
295
|
+
left: auto;
|
|
296
|
+
}
|
|
297
|
+
&.placement-top-start {
|
|
298
|
+
right: auto;
|
|
299
|
+
bottom: calc(100% + var(--select-dropdown-offset, 4px));
|
|
300
|
+
top: auto;
|
|
301
|
+
left: 0;
|
|
302
|
+
}
|
|
303
|
+
&.placement-top-end {
|
|
304
|
+
bottom: calc(100% + var(--select-dropdown-offset, 4px));
|
|
305
|
+
top: auto;
|
|
306
|
+
right: 0;
|
|
307
|
+
left: auto;
|
|
308
|
+
}
|
|
281
309
|
}
|
|
282
310
|
|
|
283
311
|
.dasar-select-option {
|
|
@@ -290,20 +318,32 @@
|
|
|
290
318
|
cursor: pointer;
|
|
291
319
|
display: flex;
|
|
292
320
|
|
|
293
|
-
.size-xs & {
|
|
321
|
+
.dasar-select-dropdown-panel.size-xs & {
|
|
294
322
|
font-size: var(--font-size-xs);
|
|
323
|
+
|
|
324
|
+
padding: var(--select-option-padding-y, var(--space-1))
|
|
325
|
+
var(--select-option-padding-x, var(--space-base));
|
|
295
326
|
}
|
|
296
|
-
.size-sm & {
|
|
327
|
+
.dasar-select-dropdown-panel.size-sm & {
|
|
297
328
|
font-size: var(--font-size-sm);
|
|
329
|
+
|
|
330
|
+
padding: var(--select-option-padding-y, var(--space-1))
|
|
331
|
+
var(--select-option-padding-x, var(--space-3));
|
|
298
332
|
}
|
|
299
|
-
.size-md & {
|
|
333
|
+
.dasar-select-dropdown-panel.size-md & {
|
|
300
334
|
font-size: var(--font-size-base);
|
|
301
335
|
}
|
|
302
|
-
.size-lg & {
|
|
336
|
+
.dasar-select-dropdown-panel.size-lg & {
|
|
303
337
|
font-size: var(--font-size-lg);
|
|
338
|
+
|
|
339
|
+
padding: var(--select-option-padding-y, var(--space-3))
|
|
340
|
+
var(--select-option-padding-x, var(--space-4));
|
|
304
341
|
}
|
|
305
|
-
.size-xl & {
|
|
342
|
+
.dasar-select-dropdown-panel.size-xl & {
|
|
306
343
|
font-size: var(--font-size-xl);
|
|
344
|
+
|
|
345
|
+
padding: var(--select-option-padding-y, var(--space-3))
|
|
346
|
+
var(--select-option-padding-x, var(--space-5));
|
|
307
347
|
}
|
|
308
348
|
|
|
309
349
|
&:hover:not(.disabled) {
|
|
@@ -1,21 +1,97 @@
|
|
|
1
|
+
import { Component, signal } from '@angular/core';
|
|
1
2
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import {
|
|
3
|
+
import { FormsModule } from '@angular/forms';
|
|
4
|
+
import { DasarSelect, DasarSelectComponent } from './dasar-select';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
standalone: true,
|
|
8
|
+
imports: [FormsModule, DasarSelectComponent],
|
|
9
|
+
template: `
|
|
10
|
+
<dasar-select
|
|
11
|
+
[size]="size()"
|
|
12
|
+
[radius]="radius()"
|
|
13
|
+
[placement]="placement()"
|
|
14
|
+
[options]="options"
|
|
15
|
+
[ngModel]="value"
|
|
16
|
+
/>
|
|
17
|
+
`,
|
|
18
|
+
})
|
|
19
|
+
class SelectHost {
|
|
20
|
+
size = signal<'sm' | 'md' | 'lg'>('sm');
|
|
21
|
+
radius = signal<'none' | 'md' | 'lg' | 'full'>('lg');
|
|
22
|
+
placement = signal<'bottom-start' | 'top-start'>('bottom-start');
|
|
23
|
+
value = '';
|
|
24
|
+
options = [
|
|
25
|
+
{ label: 'Alpha', value: 'a', iconName: 'info-circle' },
|
|
26
|
+
{ label: 'Beta', value: 'b' },
|
|
27
|
+
];
|
|
28
|
+
}
|
|
3
29
|
|
|
4
30
|
describe('DasarSelect', () => {
|
|
5
31
|
let component: DasarSelect;
|
|
6
|
-
let fixture: ComponentFixture<
|
|
32
|
+
let fixture: ComponentFixture<SelectHost>;
|
|
33
|
+
let host: SelectHost;
|
|
34
|
+
|
|
35
|
+
const container = () =>
|
|
36
|
+
fixture.nativeElement.querySelector('.dasar-select-container') as HTMLElement;
|
|
37
|
+
const panel = () =>
|
|
38
|
+
fixture.nativeElement.querySelector('.dasar-select-dropdown-panel') as HTMLElement;
|
|
39
|
+
const open = async () => {
|
|
40
|
+
container().click();
|
|
41
|
+
await fixture.whenStable();
|
|
42
|
+
};
|
|
7
43
|
|
|
8
44
|
beforeEach(async () => {
|
|
9
45
|
await TestBed.configureTestingModule({
|
|
10
|
-
imports: [
|
|
46
|
+
imports: [SelectHost],
|
|
11
47
|
}).compileComponents();
|
|
12
48
|
|
|
13
|
-
fixture = TestBed.createComponent(
|
|
14
|
-
|
|
15
|
-
|
|
49
|
+
fixture = TestBed.createComponent(SelectHost);
|
|
50
|
+
host = fixture.componentInstance;
|
|
51
|
+
component = fixture.debugElement.children[0].componentInstance;
|
|
52
|
+
fixture.detectChanges();
|
|
16
53
|
});
|
|
17
54
|
|
|
18
55
|
it('should create', () => {
|
|
19
56
|
expect(component).toBeTruthy();
|
|
20
57
|
});
|
|
58
|
+
|
|
59
|
+
it('renders no panel while closed', () => {
|
|
60
|
+
expect(panel()).toBeNull();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('panel follows size and radius of the trigger', async () => {
|
|
64
|
+
await open();
|
|
65
|
+
|
|
66
|
+
expect(panel()).toBeTruthy();
|
|
67
|
+
expect(panel().classList).toContain('size-sm');
|
|
68
|
+
expect(panel().classList).toContain('radius-lg');
|
|
69
|
+
expect(panel().classList).toContain('placement-bottom-start');
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('panel reflects a radius change', async () => {
|
|
73
|
+
host.radius.set('none');
|
|
74
|
+
await open();
|
|
75
|
+
|
|
76
|
+
expect(panel().classList).toContain('radius-none');
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('panel starts at the requested placement', async () => {
|
|
80
|
+
host.placement.set('top-start');
|
|
81
|
+
await open();
|
|
82
|
+
|
|
83
|
+
expect(panel().classList).toContain('placement-top-start');
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('arrow icon scales with the select size', () => {
|
|
87
|
+
const svg = container().querySelector('.dasar-select-arrow-btn dasar-icon svg') as SVGElement;
|
|
88
|
+
expect(svg.getAttribute('width')).toBe('14');
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('option icons scale with the select size', async () => {
|
|
92
|
+
await open();
|
|
93
|
+
|
|
94
|
+
const svg = panel().querySelector('.dasar-select-option dasar-icon svg') as SVGElement;
|
|
95
|
+
expect(svg.getAttribute('width')).toBe('14');
|
|
96
|
+
});
|
|
21
97
|
});
|