dasar-ui 1.3.0 → 1.9.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/.editorconfig +17 -0
- package/.github/workflows/npm-publish-github-packages.yml +36 -0
- package/.prettierrc +12 -0
- package/.versionrc.json +4 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/settings.json +4 -0
- package/.vscode/tasks.json +42 -0
- package/CHANGELOG.md +92 -0
- package/Dockerfile +26 -0
- package/README.md +41 -40
- package/angular.json +114 -0
- package/docs/_config.yml +3 -0
- package/docs/getting-started.md +89 -0
- package/docs/index.md +9 -0
- package/docs/installation.md +46 -0
- package/package.json +57 -39
- package/projects/dasar-ui/README.md +64 -0
- package/projects/dasar-ui/ng-package.json +10 -0
- package/projects/dasar-ui/package.json +27 -0
- package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.html +9 -0
- package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.scss +352 -0
- package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.ts +154 -0
- package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.html +1 -0
- package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.scss +69 -0
- package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.ts +26 -0
- package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.html +158 -0
- package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.scss +371 -0
- package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.ts +458 -0
- package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.html +80 -0
- package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.scss +184 -0
- package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.ts +294 -0
- package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.html +42 -0
- package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.scss +38 -0
- package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.ts +205 -0
- package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.html +111 -0
- package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.scss +331 -0
- package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.spec.ts +93 -0
- package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.ts +527 -0
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.html +1 -0
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.registry.ts +5087 -0
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.scss +24 -0
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.ts +97 -0
- package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.html +54 -0
- package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.scss +251 -0
- package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.ts +319 -0
- 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 +64 -0
- package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.scss +229 -0
- package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.spec.ts +93 -0
- package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.ts +278 -0
- 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.html +90 -0
- package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.scss +353 -0
- package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.ts +337 -0
- 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 +112 -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.html +98 -0
- package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.scss +51 -0
- package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.ts +99 -0
- package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.css +0 -0
- package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.html +1 -0
- package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.ts +9 -0
- package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.html +150 -0
- package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.scss +272 -0
- package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.ts +228 -0
- package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.css +0 -0
- package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.html +1 -0
- package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.ts +9 -0
- package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.html +189 -0
- package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.scss +387 -0
- package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.spec.ts +97 -0
- package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.ts +540 -0
- package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.css +0 -0
- package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.html +1 -0
- package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.ts +9 -0
- package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.html +162 -0
- package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.scss +283 -0
- package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.ts +380 -0
- package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.html +103 -0
- package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.scss +238 -0
- package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.spec.ts +570 -0
- package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.ts +349 -0
- package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.html +43 -0
- package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.scss +189 -0
- package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.ts +139 -0
- package/projects/dasar-ui/src/lib/components/dasar-theme-provider/dasar-theme-provider.spec.ts +89 -0
- package/projects/dasar-ui/src/lib/components/dasar-theme-provider/dasar-theme-provider.ts +294 -0
- package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.css +0 -0
- package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.html +1 -0
- package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.ts +9 -0
- package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.css +0 -0
- package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.html +1 -0
- package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.ts +9 -0
- package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.css +0 -0
- package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.html +1 -0
- package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.spec.ts +21 -0
- package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.ts +9 -0
- package/projects/dasar-ui/src/lib/models/theme.model.ts +730 -0
- package/projects/dasar-ui/src/lib/models/type.model.ts +11 -0
- package/projects/dasar-ui/src/lib/services/theme.service.spec.ts +130 -0
- package/projects/dasar-ui/src/lib/services/theme.service.ts +777 -0
- package/{styles → projects/dasar-ui/src/lib/styles}/theme.scss +47 -48
- package/projects/dasar-ui/src/lib/styles/theme.ts +70 -0
- package/projects/dasar-ui/src/lib/utils/common.ts +156 -0
- 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 +24 -0
- package/projects/dasar-ui/tsconfig.lib.json +21 -0
- package/projects/dasar-ui/tsconfig.lib.prod.json +11 -0
- package/projects/dasar-ui/tsconfig.spec.json +18 -0
- package/projects/documentation/public/favicon.ico +0 -0
- package/projects/documentation/src/app/app.html +78 -0
- package/projects/documentation/src/app/app.spec.ts +23 -0
- package/projects/documentation/src/app/app.ts +57 -0
- package/projects/documentation/src/app/components/doc-customize-modal.component.ts +368 -0
- package/projects/documentation/src/app/components/doc-example.component.ts +195 -0
- package/projects/documentation/src/app/components/doc-markdown.component.ts +154 -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 +249 -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/getting-started/getting-started.page.ts +21 -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/installation/installation.page.ts +18 -0
- package/projects/documentation/src/app/pages/introduction/introduction.page.ts +18 -0
- package/projects/documentation/src/app/pages/list/examples/advanced-dynamic/list-advanced-dynamic.example.html +29 -0
- package/projects/documentation/src/app/pages/list/examples/advanced-dynamic/list-advanced-dynamic.example.ts +33 -0
- package/projects/documentation/src/app/pages/list/examples/advanced-theme/list-advanced-theme.example.html +13 -0
- package/projects/documentation/src/app/pages/list/examples/advanced-theme/list-advanced-theme.example.ts +30 -0
- package/projects/documentation/src/app/pages/list/examples/basic/list-basic.example.html +5 -0
- package/projects/documentation/src/app/pages/list/examples/basic/list-basic.example.ts +12 -0
- package/projects/documentation/src/app/pages/list/examples/bordered-divider/list-bordered-divider.example.html +20 -0
- package/projects/documentation/src/app/pages/list/examples/bordered-divider/list-bordered-divider.example.ts +12 -0
- package/projects/documentation/src/app/pages/list/examples/custom-style/list-custom-style.example.html +11 -0
- package/projects/documentation/src/app/pages/list/examples/custom-style/list-custom-style.example.ts +19 -0
- package/projects/documentation/src/app/pages/list/examples/header-footer/list-header-footer.example.html +7 -0
- package/projects/documentation/src/app/pages/list/examples/header-footer/list-header-footer.example.ts +12 -0
- package/projects/documentation/src/app/pages/list/examples/interactive/list-interactive.example.html +20 -0
- package/projects/documentation/src/app/pages/list/examples/interactive/list-interactive.example.ts +22 -0
- package/projects/documentation/src/app/pages/list/examples/prefix-suffix/list-prefix-suffix.example.html +9 -0
- package/projects/documentation/src/app/pages/list/examples/prefix-suffix/list-prefix-suffix.example.ts +16 -0
- package/projects/documentation/src/app/pages/list/examples/size/list-size.example.html +20 -0
- package/projects/documentation/src/app/pages/list/examples/size/list-size.example.ts +12 -0
- package/projects/documentation/src/app/pages/list/list.page.html +95 -0
- package/projects/documentation/src/app/pages/list/list.page.ts +238 -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 +266 -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 +347 -0
- package/projects/documentation/src/app/pages/theming/examples/component-config/theming-component-config.example.html +13 -0
- package/projects/documentation/src/app/pages/theming/examples/component-config/theming-component-config.example.ts +20 -0
- package/projects/documentation/src/app/pages/theming/examples/css-override/theming-css-override.example.html +8 -0
- package/projects/documentation/src/app/pages/theming/examples/css-override/theming-css-override.example.scss +4 -0
- package/projects/documentation/src/app/pages/theming/examples/css-override/theming-css-override.example.ts +11 -0
- package/projects/documentation/src/app/pages/theming/examples/custom-tokens/theming-custom-tokens.example.html +13 -0
- package/projects/documentation/src/app/pages/theming/examples/custom-tokens/theming-custom-tokens.example.ts +33 -0
- package/projects/documentation/src/app/pages/theming/examples/global-theme/theming-global-theme.example.html +6 -0
- package/projects/documentation/src/app/pages/theming/examples/global-theme/theming-global-theme.example.ts +20 -0
- package/projects/documentation/src/app/pages/theming/examples/light-dark/theming-light-dark.example.html +15 -0
- package/projects/documentation/src/app/pages/theming/examples/light-dark/theming-light-dark.example.ts +31 -0
- package/projects/documentation/src/app/pages/theming/theming-component-config.page.ts +52 -0
- package/projects/documentation/src/app/pages/theming/theming-css-variables.page.ts +71 -0
- package/projects/documentation/src/app/pages/theming/theming-tokens.page.ts +56 -0
- package/projects/documentation/src/app/pages/theming/theming.data.ts +947 -0
- package/projects/documentation/src/app/pages/theming/theming.page.html +56 -0
- package/projects/documentation/src/app/pages/theming/theming.page.ts +144 -0
- package/projects/documentation/src/app/routes/app.routes.server.ts +8 -0
- package/projects/documentation/src/app/routes/app.routes.ts +135 -0
- package/projects/documentation/src/app/services/doc-customize.service.ts +119 -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 +19 -0
- package/projects/documentation/tsconfig.app.json +11 -0
- package/projects/documentation/tsconfig.spec.json +10 -0
- package/tsconfig.json +40 -0
- package/fesm2022/dasar-ui.mjs +0 -9664
- package/fesm2022/dasar-ui.mjs.map +0 -1
- package/types/dasar-ui.d.ts +0 -2114
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<div style="width: 100%; max-width: 800px">
|
|
2
|
+
<dasar-table [data]="employees" [columns]="columns">
|
|
3
|
+
<ng-template cell-slot="name" let-val let-row="row">
|
|
4
|
+
@if (row.isEditing) {
|
|
5
|
+
<input
|
|
6
|
+
type="text"
|
|
7
|
+
[(ngModel)]="row.editName"
|
|
8
|
+
style="
|
|
9
|
+
padding: 4px 8px;
|
|
10
|
+
border: 1px solid var(--theme-border-strong-color);
|
|
11
|
+
border-radius: 4px;
|
|
12
|
+
width: 100%;
|
|
13
|
+
"
|
|
14
|
+
/>
|
|
15
|
+
} @else {
|
|
16
|
+
<span>{{ val }}</span>
|
|
17
|
+
}
|
|
18
|
+
</ng-template>
|
|
19
|
+
<ng-template cell-slot="role" let-val let-row="row">
|
|
20
|
+
@if (row.isEditing) {
|
|
21
|
+
<select
|
|
22
|
+
[(ngModel)]="row.editRole"
|
|
23
|
+
style="
|
|
24
|
+
padding: 4px 8px;
|
|
25
|
+
border: 1px solid var(--theme-border-strong-color);
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
width: 100%;
|
|
28
|
+
"
|
|
29
|
+
>
|
|
30
|
+
<option value="Admin">Admin</option>
|
|
31
|
+
<option value="Editor">Editor</option>
|
|
32
|
+
<option value="Viewer">Viewer</option>
|
|
33
|
+
</select>
|
|
34
|
+
} @else {
|
|
35
|
+
<dasar-chip [variant]="val === 'Admin' ? 'primary' : 'ghost'" size="sm">{{
|
|
36
|
+
val
|
|
37
|
+
}}</dasar-chip>
|
|
38
|
+
}
|
|
39
|
+
</ng-template>
|
|
40
|
+
<ng-template cell-slot="actions" let-row="row">
|
|
41
|
+
<div style="display: flex; gap: 8px; justify-content: flex-end">
|
|
42
|
+
@if (row.isEditing) {
|
|
43
|
+
<dasar-button variant="primary" size="sm" (click)="saveEdit(row)">Save</dasar-button>
|
|
44
|
+
<dasar-button variant="ghost" size="sm" (click)="cancelEdit(row)">Cancel</dasar-button>
|
|
45
|
+
} @else {
|
|
46
|
+
<dasar-button appearance="outline" size="sm" icon-only (click)="startEdit(row)">
|
|
47
|
+
<dasar-icon name="edit-2" size="sm"></dasar-icon>
|
|
48
|
+
</dasar-button>
|
|
49
|
+
}
|
|
50
|
+
</div>
|
|
51
|
+
</ng-template>
|
|
52
|
+
</dasar-table>
|
|
53
|
+
</div>
|
package/projects/documentation/src/app/pages/table/examples/inline-edit/table-inline-edit.example.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DasarTableComponent,
|
|
3
|
+
DasarTableColumn,
|
|
4
|
+
DasarButtonComponent,
|
|
5
|
+
DasarIconComponent,
|
|
6
|
+
DasarChipComponent,
|
|
7
|
+
} from 'dasar-ui';
|
|
8
|
+
import { FormsModule } from '@angular/forms';
|
|
9
|
+
import { Component } from '@angular/core';
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
imports: [
|
|
13
|
+
FormsModule,
|
|
14
|
+
DasarTableComponent,
|
|
15
|
+
DasarButtonComponent,
|
|
16
|
+
DasarIconComponent,
|
|
17
|
+
DasarChipComponent,
|
|
18
|
+
],
|
|
19
|
+
templateUrl: './table-inline-edit.example.html',
|
|
20
|
+
selector: 'app-table-inline-edit',
|
|
21
|
+
standalone: true,
|
|
22
|
+
})
|
|
23
|
+
export class TableInlineEditExample {
|
|
24
|
+
protected columns: DasarTableColumn[] = [
|
|
25
|
+
{ key: 'id', label: 'ID', width: '60px' },
|
|
26
|
+
{ key: 'name', label: 'Employee Name' },
|
|
27
|
+
{ key: 'role', label: 'Role', width: '150px' },
|
|
28
|
+
{ key: 'actions', label: '', align: 'right', width: '160px' },
|
|
29
|
+
];
|
|
30
|
+
protected employees = [
|
|
31
|
+
{ id: '1', name: 'Alice Smith', role: 'Admin', isEditing: false },
|
|
32
|
+
{ id: '2', name: 'Bob Jones', role: 'Viewer', isEditing: false },
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
startEdit(row: any) {
|
|
36
|
+
row.isEditing = true;
|
|
37
|
+
row.editName = row.name;
|
|
38
|
+
row.editRole = row.role;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
saveEdit(row: any) {
|
|
42
|
+
row.isEditing = false;
|
|
43
|
+
row.name = row.editName;
|
|
44
|
+
row.role = row.editRole;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
cancelEdit(row: any) {
|
|
48
|
+
row.isEditing = false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<div style="width: 100%; max-width: 800px">
|
|
2
|
+
<dasar-table [data]="departments" [columns]="columns" [expandable]="true" appearance="elevated">
|
|
3
|
+
<ng-template expanded-slot let-row>
|
|
4
|
+
<div
|
|
5
|
+
style="
|
|
6
|
+
padding: 16px;
|
|
7
|
+
background: var(--theme-bg-default-color);
|
|
8
|
+
border-top: 1px solid var(--theme-border-subtle-color);
|
|
9
|
+
"
|
|
10
|
+
>
|
|
11
|
+
<h5 style="margin: 0 0 12px 0; font-size: 14px; color: var(--theme-text-secondary-color)">
|
|
12
|
+
Employees in {{ row.name }}
|
|
13
|
+
</h5>
|
|
14
|
+
<dasar-table
|
|
15
|
+
[data]="row.employees"
|
|
16
|
+
[columns]="employeeColumns"
|
|
17
|
+
appearance="outline"
|
|
18
|
+
size="sm"
|
|
19
|
+
></dasar-table>
|
|
20
|
+
</div>
|
|
21
|
+
</ng-template>
|
|
22
|
+
</dasar-table>
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { DasarTableComponent, DasarTableColumn } from 'dasar-ui';
|
|
2
|
+
import { Component } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-table-nested',
|
|
6
|
+
standalone: true,
|
|
7
|
+
imports: [DasarTableComponent],
|
|
8
|
+
templateUrl: './table-nested.example.html',
|
|
9
|
+
})
|
|
10
|
+
export class TableNestedExample {
|
|
11
|
+
protected columns: DasarTableColumn[] = [
|
|
12
|
+
{ key: 'name', label: 'Department Name', cellStyle: { fontWeight: 'bold' } },
|
|
13
|
+
{ key: 'manager', label: 'Manager' },
|
|
14
|
+
{ key: 'headcount', label: 'Headcount', align: 'right' },
|
|
15
|
+
];
|
|
16
|
+
protected employeeColumns: DasarTableColumn[] = [
|
|
17
|
+
{ key: 'id', label: 'Emp ID', width: '80px' },
|
|
18
|
+
{ key: 'title', label: 'Job Title' },
|
|
19
|
+
{ key: 'name', label: 'Name' },
|
|
20
|
+
];
|
|
21
|
+
protected departments = [
|
|
22
|
+
{
|
|
23
|
+
name: 'Engineering',
|
|
24
|
+
manager: 'Sarah Connor',
|
|
25
|
+
headcount: 3,
|
|
26
|
+
employees: [
|
|
27
|
+
{ id: 'E101', name: 'John Doe', title: 'Frontend Developer' },
|
|
28
|
+
{ id: 'E102', name: 'Jane Smith', title: 'Backend Developer' },
|
|
29
|
+
{ id: 'E103', name: 'Mike Johnson', title: 'DevOps Engineer' },
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Design',
|
|
34
|
+
manager: 'Alan Turing',
|
|
35
|
+
headcount: 2,
|
|
36
|
+
employees: [
|
|
37
|
+
{ id: 'D201', name: 'Emily Davis', title: 'UI Designer' },
|
|
38
|
+
{ id: 'D202', name: 'Chris Lee', title: 'UX Researcher' },
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
}
|
package/projects/documentation/src/app/pages/table/examples/pagination/table-pagination.example.html
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<div style="width: 100%; max-width: 800px">
|
|
2
|
+
<dasar-table [data]="data" [columns]="columns">
|
|
3
|
+
<div
|
|
4
|
+
pagination-slot
|
|
5
|
+
style="display: flex; justify-content: space-between; width: 100%; align-items: center"
|
|
6
|
+
>
|
|
7
|
+
<span style="font-size: 14px; color: var(--theme-text-secondary-color)"
|
|
8
|
+
>Showing 1 to 5 of 97 results</span
|
|
9
|
+
>
|
|
10
|
+
<div style="display: flex; gap: 8px">
|
|
11
|
+
<dasar-button appearance="outline" size="sm">Prev</dasar-button>
|
|
12
|
+
<dasar-button variant="primary" size="sm">1</dasar-button>
|
|
13
|
+
<dasar-button variant="ghost" size="sm">2</dasar-button>
|
|
14
|
+
<dasar-button variant="ghost" size="sm">3</dasar-button>
|
|
15
|
+
<dasar-button variant="ghost" size="sm">...</dasar-button>
|
|
16
|
+
<dasar-button appearance="outline" size="sm">Next</dasar-button>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</dasar-table>
|
|
20
|
+
</div>
|
package/projects/documentation/src/app/pages/table/examples/pagination/table-pagination.example.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DasarTableComponent, DasarTableColumn, DasarButtonComponent } from 'dasar-ui';
|
|
2
|
+
import { Component } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
imports: [DasarTableComponent, DasarButtonComponent],
|
|
6
|
+
templateUrl: './table-pagination.example.html',
|
|
7
|
+
selector: 'app-table-pagination',
|
|
8
|
+
standalone: true,
|
|
9
|
+
})
|
|
10
|
+
export class TablePaginationExample {
|
|
11
|
+
protected columns: DasarTableColumn[] = [
|
|
12
|
+
{ key: 'id', label: 'ID' },
|
|
13
|
+
{ key: 'event', label: 'Event Name' },
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
protected data = [
|
|
17
|
+
{ id: '1', event: 'System Boot' },
|
|
18
|
+
{ id: '2', event: 'User Login' },
|
|
19
|
+
{ id: '3', event: 'Data Sync' },
|
|
20
|
+
];
|
|
21
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<docs-layout
|
|
2
|
+
title="Table"
|
|
3
|
+
description="Advanced examples demonstrating how to fully customize Dasar Table cells, headers, empty states, and expanded rows using Angular structural directives."
|
|
4
|
+
[apiData]="apiProps"
|
|
5
|
+
>
|
|
6
|
+
<doc-example-component
|
|
7
|
+
[codes]="[
|
|
8
|
+
{ label: 'HTML', lang: 'html', value: badgeHtml },
|
|
9
|
+
{ label: 'TypeScript', lang: 'typescript', value: badgeTs },
|
|
10
|
+
]"
|
|
11
|
+
title="Cell Slot: Status Badges"
|
|
12
|
+
>
|
|
13
|
+
<app-table-cell-badge></app-table-cell-badge>
|
|
14
|
+
</doc-example-component>
|
|
15
|
+
|
|
16
|
+
<doc-example-component
|
|
17
|
+
[codes]="[
|
|
18
|
+
{ label: 'HTML', lang: 'html', value: profileHtml },
|
|
19
|
+
{ label: 'TypeScript', lang: 'typescript', value: profileTs },
|
|
20
|
+
]"
|
|
21
|
+
title="Cell Slot: User Profiles"
|
|
22
|
+
>
|
|
23
|
+
<app-table-cell-profile></app-table-cell-profile>
|
|
24
|
+
</doc-example-component>
|
|
25
|
+
|
|
26
|
+
<doc-example-component
|
|
27
|
+
[codes]="[
|
|
28
|
+
{ label: 'HTML', lang: 'html', value: actionsHtml },
|
|
29
|
+
{ label: 'TypeScript', lang: 'typescript', value: actionsTs },
|
|
30
|
+
]"
|
|
31
|
+
title="Cell Slot: Action Buttons"
|
|
32
|
+
>
|
|
33
|
+
<app-table-cell-actions></app-table-cell-actions>
|
|
34
|
+
</doc-example-component>
|
|
35
|
+
|
|
36
|
+
<doc-example-component
|
|
37
|
+
[codes]="[
|
|
38
|
+
{ label: 'HTML', lang: 'html', value: expandedHtml },
|
|
39
|
+
{ label: 'TypeScript', lang: 'typescript', value: expandedTs },
|
|
40
|
+
]"
|
|
41
|
+
title="Expandable Rows"
|
|
42
|
+
>
|
|
43
|
+
<app-table-expanded></app-table-expanded>
|
|
44
|
+
</doc-example-component>
|
|
45
|
+
|
|
46
|
+
<doc-example-component
|
|
47
|
+
[codes]="[
|
|
48
|
+
{ label: 'HTML', lang: 'html', value: emptyHtml },
|
|
49
|
+
{ label: 'TypeScript', lang: 'typescript', value: emptyTs },
|
|
50
|
+
]"
|
|
51
|
+
title="Custom Empty State"
|
|
52
|
+
>
|
|
53
|
+
<app-table-empty></app-table-empty>
|
|
54
|
+
</doc-example-component>
|
|
55
|
+
|
|
56
|
+
<doc-example-component
|
|
57
|
+
[codes]="[
|
|
58
|
+
{ label: 'HTML', lang: 'html', value: paginationHtml },
|
|
59
|
+
{ label: 'TypeScript', lang: 'typescript', value: paginationTs },
|
|
60
|
+
]"
|
|
61
|
+
title="Custom Pagination Footer"
|
|
62
|
+
>
|
|
63
|
+
<app-table-pagination></app-table-pagination>
|
|
64
|
+
</doc-example-component>
|
|
65
|
+
|
|
66
|
+
<doc-example-component
|
|
67
|
+
[codes]="[
|
|
68
|
+
{ label: 'HTML', lang: 'html', value: customSizesHtml },
|
|
69
|
+
{ label: 'TypeScript', lang: 'typescript', value: customSizesTs },
|
|
70
|
+
]"
|
|
71
|
+
title="Custom Sizes"
|
|
72
|
+
>
|
|
73
|
+
<app-table-custom-sizes></app-table-custom-sizes>
|
|
74
|
+
</doc-example-component>
|
|
75
|
+
|
|
76
|
+
<doc-example-component
|
|
77
|
+
[codes]="[
|
|
78
|
+
{ label: 'HTML', lang: 'html', value: customBodyHtml },
|
|
79
|
+
{ label: 'TypeScript', lang: 'typescript', value: customBodyTs },
|
|
80
|
+
]"
|
|
81
|
+
title="Custom Body Layout"
|
|
82
|
+
>
|
|
83
|
+
<app-table-custom-body></app-table-custom-body>
|
|
84
|
+
</doc-example-component>
|
|
85
|
+
|
|
86
|
+
<doc-example-component
|
|
87
|
+
[codes]="[
|
|
88
|
+
{ label: 'HTML', lang: 'html', value: heatmapHtml },
|
|
89
|
+
{ label: 'TypeScript', lang: 'typescript', value: heatmapTs },
|
|
90
|
+
]"
|
|
91
|
+
title="Data Heatmap using Dynamic cellStyle"
|
|
92
|
+
>
|
|
93
|
+
<app-table-heatmap></app-table-heatmap>
|
|
94
|
+
</doc-example-component>
|
|
95
|
+
|
|
96
|
+
<doc-example-component
|
|
97
|
+
[codes]="[
|
|
98
|
+
{ label: 'HTML', lang: 'html', value: dynamicStyleHtml },
|
|
99
|
+
{ label: 'TypeScript', lang: 'typescript', value: dynamicStyleTs },
|
|
100
|
+
]"
|
|
101
|
+
title="Conditional Text & Status Styling"
|
|
102
|
+
>
|
|
103
|
+
<app-table-dynamic-style></app-table-dynamic-style>
|
|
104
|
+
</doc-example-component>
|
|
105
|
+
|
|
106
|
+
<doc-example-component
|
|
107
|
+
[codes]="[
|
|
108
|
+
{ label: 'HTML', lang: 'html', value: inlineEditHtml },
|
|
109
|
+
{ label: 'TypeScript', lang: 'typescript', value: inlineEditTs },
|
|
110
|
+
]"
|
|
111
|
+
title="Inline Editing with Cell Slots"
|
|
112
|
+
>
|
|
113
|
+
<app-table-inline-edit></app-table-inline-edit>
|
|
114
|
+
</doc-example-component>
|
|
115
|
+
|
|
116
|
+
<doc-example-component
|
|
117
|
+
[codes]="[
|
|
118
|
+
{ label: 'HTML', lang: 'html', value: nestedHtml },
|
|
119
|
+
{ label: 'TypeScript', lang: 'typescript', value: nestedTs },
|
|
120
|
+
]"
|
|
121
|
+
title="Nested Tables in Expanded Rows"
|
|
122
|
+
>
|
|
123
|
+
<app-table-nested></app-table-nested>
|
|
124
|
+
</doc-example-component>
|
|
125
|
+
</docs-layout>
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { DocsLayoutComponent, DocApiProperty } from '../../layouts/doc.layout';
|
|
2
|
+
import { DocExampleComponent } from '../../components/doc-example.component';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { Component } from '@angular/core';
|
|
5
|
+
|
|
6
|
+
import { TableCustomSizesExample } from './examples/custom-sizes/table-custom-sizes.example';
|
|
7
|
+
import { TableDynamicStyleExample } from './examples/dynamic-style/table-dynamic-style.example';
|
|
8
|
+
import { TableCellProfileExample } from './examples/cell-profile/table-cell-profile.example';
|
|
9
|
+
import { TableCellActionsExample } from './examples/cell-actions/table-cell-actions.example';
|
|
10
|
+
import { TableCustomBodyExample } from './examples/custom-body/table-custom-body.example';
|
|
11
|
+
import { TableInlineEditExample } from './examples/inline-edit/table-inline-edit.example';
|
|
12
|
+
import { TablePaginationExample } from './examples/pagination/table-pagination.example';
|
|
13
|
+
import { TableCellBadgeExample } from './examples/cell-badge/table-cell-badge.example';
|
|
14
|
+
import { TableExpandedExample } from './examples/expanded/table-expanded.example';
|
|
15
|
+
import { TableHeatmapExample } from './examples/heatmap/table-heatmap.example';
|
|
16
|
+
import { TableNestedExample } from './examples/nested/table-nested.example';
|
|
17
|
+
import { TableEmptyExample } from './examples/empty/table-empty.example';
|
|
18
|
+
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
import profileHtml from './examples/cell-profile/table-cell-profile.example.html' with {
|
|
21
|
+
loader: 'text',
|
|
22
|
+
};
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
import profileTs from './examples/cell-profile/table-cell-profile.example.ts' with {
|
|
25
|
+
loader: 'text',
|
|
26
|
+
};
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
import actionsHtml from './examples/cell-actions/table-cell-actions.example.html' with {
|
|
29
|
+
loader: 'text',
|
|
30
|
+
};
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
import paginationHtml from './examples/pagination/table-pagination.example.html' with {
|
|
33
|
+
loader: 'text',
|
|
34
|
+
};
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
import paginationTs from './examples/pagination/table-pagination.example.ts' with {
|
|
37
|
+
loader: 'text',
|
|
38
|
+
};
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
import customSizesHtml from './examples/custom-sizes/table-custom-sizes.example.html' with {
|
|
41
|
+
loader: 'text',
|
|
42
|
+
};
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
import customSizesTs from './examples/custom-sizes/table-custom-sizes.example' with {
|
|
45
|
+
loader: 'text',
|
|
46
|
+
};
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
import customBodyHtml from './examples/custom-body/table-custom-body.example.html' with {
|
|
49
|
+
loader: 'text',
|
|
50
|
+
};
|
|
51
|
+
// @ts-ignore
|
|
52
|
+
import customBodyTs from './examples/custom-body/table-custom-body.example.ts' with {
|
|
53
|
+
loader: 'text',
|
|
54
|
+
};
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
import badgeHtml from './examples/cell-badge/table-cell-badge.example.html' with { loader: 'text' };
|
|
57
|
+
// @ts-ignore
|
|
58
|
+
import badgeTs from './examples/cell-badge/table-cell-badge.example.ts' with { loader: 'text' };
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
import actionsTs from './examples/cell-actions/table-cell-actions.example.ts' with {
|
|
61
|
+
loader: 'text',
|
|
62
|
+
};
|
|
63
|
+
// @ts-ignore
|
|
64
|
+
import expandedHtml from './examples/expanded/table-expanded.example.html' with { loader: 'text' };
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
import expandedTs from './examples/expanded/table-expanded.example.ts' with { loader: 'text' };
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
import emptyHtml from './examples/empty/table-empty.example.html' with { loader: 'text' };
|
|
69
|
+
// @ts-ignore
|
|
70
|
+
import emptyTs from './examples/empty/table-empty.example.ts' with { loader: 'text' };
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
import heatmapHtml from './examples/heatmap/table-heatmap.example.html' with { loader: 'text' };
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
import heatmapTs from './examples/heatmap/table-heatmap.example.ts' with { loader: 'text' };
|
|
75
|
+
// @ts-ignore
|
|
76
|
+
import dynamicStyleHtml from './examples/dynamic-style/table-dynamic-style.example.html' with {
|
|
77
|
+
loader: 'text',
|
|
78
|
+
};
|
|
79
|
+
// @ts-ignore
|
|
80
|
+
import dynamicStyleTs from './examples/dynamic-style/table-dynamic-style.example.ts' with {
|
|
81
|
+
loader: 'text',
|
|
82
|
+
};
|
|
83
|
+
// @ts-ignore
|
|
84
|
+
import inlineEditHtml from './examples/inline-edit/table-inline-edit.example.html' with {
|
|
85
|
+
loader: 'text',
|
|
86
|
+
};
|
|
87
|
+
// @ts-ignore
|
|
88
|
+
import inlineEditTs from './examples/inline-edit/table-inline-edit.example.ts' with {
|
|
89
|
+
loader: 'text',
|
|
90
|
+
};
|
|
91
|
+
// @ts-ignore
|
|
92
|
+
import nestedHtml from './examples/nested/table-nested.example.html' with { loader: 'text' };
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
import nestedTs from './examples/nested/table-nested.example.ts' with { loader: 'text' };
|
|
95
|
+
|
|
96
|
+
@Component({
|
|
97
|
+
imports: [
|
|
98
|
+
CommonModule,
|
|
99
|
+
DocsLayoutComponent,
|
|
100
|
+
DocExampleComponent,
|
|
101
|
+
TableHeatmapExample,
|
|
102
|
+
TableDynamicStyleExample,
|
|
103
|
+
TableInlineEditExample,
|
|
104
|
+
TableNestedExample,
|
|
105
|
+
TableCellBadgeExample,
|
|
106
|
+
TableCellProfileExample,
|
|
107
|
+
TableCellActionsExample,
|
|
108
|
+
TableExpandedExample,
|
|
109
|
+
TableEmptyExample,
|
|
110
|
+
TablePaginationExample,
|
|
111
|
+
TableCustomSizesExample,
|
|
112
|
+
TableCustomBodyExample,
|
|
113
|
+
],
|
|
114
|
+
templateUrl: './table.page.html',
|
|
115
|
+
selector: 'app-table-page',
|
|
116
|
+
standalone: true,
|
|
117
|
+
})
|
|
118
|
+
export class TableDocPage {
|
|
119
|
+
protected badgeHtml = badgeHtml;
|
|
120
|
+
protected badgeTs = badgeTs;
|
|
121
|
+
protected profileHtml = profileHtml;
|
|
122
|
+
protected profileTs = profileTs;
|
|
123
|
+
protected actionsHtml = actionsHtml;
|
|
124
|
+
protected actionsTs = actionsTs;
|
|
125
|
+
protected expandedHtml = expandedHtml;
|
|
126
|
+
protected expandedTs = expandedTs;
|
|
127
|
+
protected emptyHtml = emptyHtml;
|
|
128
|
+
protected emptyTs = emptyTs;
|
|
129
|
+
protected paginationHtml = paginationHtml;
|
|
130
|
+
protected paginationTs = paginationTs;
|
|
131
|
+
protected customSizesHtml = customSizesHtml;
|
|
132
|
+
protected customSizesTs = customSizesTs;
|
|
133
|
+
protected customBodyHtml = customBodyHtml;
|
|
134
|
+
protected customBodyTs = customBodyTs;
|
|
135
|
+
protected heatmapHtml = heatmapHtml;
|
|
136
|
+
protected heatmapTs = heatmapTs;
|
|
137
|
+
protected dynamicStyleHtml = dynamicStyleHtml;
|
|
138
|
+
protected dynamicStyleTs = dynamicStyleTs;
|
|
139
|
+
protected inlineEditHtml = inlineEditHtml;
|
|
140
|
+
protected inlineEditTs = inlineEditTs;
|
|
141
|
+
protected nestedHtml = nestedHtml;
|
|
142
|
+
protected nestedTs = nestedTs;
|
|
143
|
+
|
|
144
|
+
protected readonly apiProps: DocApiProperty[] = [
|
|
145
|
+
{
|
|
146
|
+
name: 'data',
|
|
147
|
+
type: 'any[]',
|
|
148
|
+
defaultValue: '[]',
|
|
149
|
+
description: 'Array of data objects to render.',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: 'columns',
|
|
153
|
+
type: 'DasarTableColumn[]',
|
|
154
|
+
defaultValue: '[]',
|
|
155
|
+
description: 'Configuration array for table columns.',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: 'appearance',
|
|
159
|
+
type: "'outline' | 'filled' | 'elevated' | 'borderless'",
|
|
160
|
+
defaultValue: "'outline'",
|
|
161
|
+
description: 'Visual style of the table container.',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: 'size',
|
|
165
|
+
type: "'sm' | 'md' | 'lg'",
|
|
166
|
+
defaultValue: "'md'",
|
|
167
|
+
description: 'Typographic scale of the table contents.',
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: 'spacing',
|
|
171
|
+
type: "'compact' | 'normal' | 'relaxed'",
|
|
172
|
+
defaultValue: "'normal'",
|
|
173
|
+
description: 'Controls the cell padding.',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: 'expandable',
|
|
177
|
+
type: 'boolean',
|
|
178
|
+
defaultValue: 'false',
|
|
179
|
+
description: 'Enables row expansion and renders the expand chevron column.',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: 'striped',
|
|
183
|
+
type: 'boolean',
|
|
184
|
+
defaultValue: 'false',
|
|
185
|
+
description: 'Applies alternating background colors to rows.',
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: 'hoverable',
|
|
189
|
+
type: 'boolean',
|
|
190
|
+
defaultValue: 'true',
|
|
191
|
+
description: 'Applies hover effects to rows.',
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: 'loading',
|
|
195
|
+
type: 'boolean',
|
|
196
|
+
defaultValue: 'false',
|
|
197
|
+
description: 'Displays the loading state overlay.',
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: 'fluid',
|
|
201
|
+
type: 'boolean',
|
|
202
|
+
defaultValue: 'true',
|
|
203
|
+
description: 'Forces the table to 100% width.',
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: 'sortKey',
|
|
207
|
+
type: 'string | null',
|
|
208
|
+
defaultValue: 'null',
|
|
209
|
+
description: 'The currently active sorting column key.',
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: 'sortDirection',
|
|
213
|
+
type: "'asc' | 'desc' | null",
|
|
214
|
+
defaultValue: 'null',
|
|
215
|
+
description: 'The current sorting direction.',
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: '(onSortChange)',
|
|
219
|
+
type: 'EventEmitter<DasarTableSortEvent>',
|
|
220
|
+
defaultValue: '-',
|
|
221
|
+
description: 'Emitted when a sortable column header is clicked.',
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: '(onRowClick) / (onRowDblClick)',
|
|
225
|
+
type: 'EventEmitter<any>',
|
|
226
|
+
defaultValue: '-',
|
|
227
|
+
description: 'Mouse events on table rows.',
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: '[cell-slot]="key"',
|
|
231
|
+
type: 'TemplateRef',
|
|
232
|
+
defaultValue: '-',
|
|
233
|
+
description:
|
|
234
|
+
'Overrides rendering for a specific column. Provides let-val, let-row, and let-index.',
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: '[expanded-slot]',
|
|
238
|
+
type: 'TemplateRef',
|
|
239
|
+
defaultValue: '-',
|
|
240
|
+
description: 'Template rendered inside an expanded row. Provides let-row and let-index.',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
name: '[empty-slot]',
|
|
244
|
+
type: 'Content Slot',
|
|
245
|
+
defaultValue: '-',
|
|
246
|
+
description: 'Completely replaces the default empty state UI.',
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
name: '[pagination-slot]',
|
|
250
|
+
type: 'Content Slot',
|
|
251
|
+
defaultValue: '-',
|
|
252
|
+
description: 'Injects pagination controls at the bottom of the table.',
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
name: '[header-slot] / [body-slot]',
|
|
256
|
+
type: 'Content Slot',
|
|
257
|
+
defaultValue: '-',
|
|
258
|
+
description: 'Completely replaces the thead or tbody elements for ultimate control.',
|
|
259
|
+
},
|
|
260
|
+
];
|
|
261
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<dasar-tabs appearance="outline" [active-index]="active()" (onTabsChange)="active.set($event)">
|
|
2
|
+
@for (tab of tabs(); track tab) {
|
|
3
|
+
<ng-template tab-item-slot>
|
|
4
|
+
<span style="display: inline-flex; align-items: center; gap: 4px">
|
|
5
|
+
{{ tab }}
|
|
6
|
+
<dasar-icon name="x" [size]="12" (click)="closeTab(tab, $event)" />
|
|
7
|
+
</span>
|
|
8
|
+
</ng-template>
|
|
9
|
+
}
|
|
10
|
+
<p>Settings for {{ tabs()[active()] ?? 'nothing' }}.</p>
|
|
11
|
+
</dasar-tabs>
|
|
12
|
+
|
|
13
|
+
<dasar-button size="sm" variant="ghost" (click)="addTab()">Add tab</dasar-button>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Component, signal } from '@angular/core';
|
|
2
|
+
import { DasarTabsComponent, DasarIconComponent, DasarButtonComponent } from 'dasar-ui';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
templateUrl: './tabs-advanced-dynamic.example.html',
|
|
6
|
+
selector: 'app-tabs-advanced-dynamic-example',
|
|
7
|
+
imports: [DasarTabsComponent, DasarIconComponent, DasarButtonComponent],
|
|
8
|
+
standalone: true,
|
|
9
|
+
})
|
|
10
|
+
export class TabsAdvancedDynamicExample {
|
|
11
|
+
protected tabs = signal(['General', 'Profile', 'Billing', 'Team']);
|
|
12
|
+
protected active = signal(0);
|
|
13
|
+
|
|
14
|
+
protected addTab() {
|
|
15
|
+
this.tabs.update((list) => [...list, `Tab ${list.length + 1}`]);
|
|
16
|
+
this.active.set(this.tabs().length - 1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
protected closeTab(name: string, event: Event) {
|
|
20
|
+
event.stopPropagation();
|
|
21
|
+
const removedIndex = this.tabs().indexOf(name);
|
|
22
|
+
this.tabs.update((list) => list.filter((tab) => tab !== name));
|
|
23
|
+
if (removedIndex <= this.active()) {
|
|
24
|
+
this.active.set(Math.max(0, this.active() - 1));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<dasar-card label="Workspace settings" size="sm" spacing="compact">
|
|
2
|
+
<dasar-tabs
|
|
3
|
+
size="sm"
|
|
4
|
+
spacing="compact"
|
|
5
|
+
[active-index]="active"
|
|
6
|
+
(onTabsChange)="active = $event"
|
|
7
|
+
[items]="['Profile', 'Access', 'Billing']"
|
|
8
|
+
>
|
|
9
|
+
@switch (active) {
|
|
10
|
+
@case (0) {
|
|
11
|
+
<div style="display: flex; gap: 12px; flex-wrap: wrap">
|
|
12
|
+
<dasar-input label="Full name" [(ngModel)]="name" />
|
|
13
|
+
</div>
|
|
14
|
+
}
|
|
15
|
+
@case (1) {
|
|
16
|
+
<div style="display: flex; gap: 12px; flex-wrap: wrap">
|
|
17
|
+
<dasar-select label="Role" [options]="roles" [(ngModel)]="role" />
|
|
18
|
+
</div>
|
|
19
|
+
}
|
|
20
|
+
@case (2) {
|
|
21
|
+
<div style="display: flex; gap: 12px; flex-wrap: wrap">
|
|
22
|
+
<dasar-datepicker label="Renewal date" [(ngModel)]="renewal" clearable />
|
|
23
|
+
</div>
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
</dasar-tabs>
|
|
27
|
+
</dasar-card>
|