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,78 @@
|
|
|
1
|
+
<main>
|
|
2
|
+
<dasar-theme-provider
|
|
3
|
+
[componentConfig]="customize.componentConfig()"
|
|
4
|
+
[tokenConfig]="customize.tokenConfig()"
|
|
5
|
+
[mode]="customize.mode()"
|
|
6
|
+
[ngStyle]="{ height: '100vh', overflow: 'hidden' }"
|
|
7
|
+
>
|
|
8
|
+
<dasar-card
|
|
9
|
+
appearance="borderless"
|
|
10
|
+
radius="none"
|
|
11
|
+
[container-style]="{
|
|
12
|
+
padding: '0 var(--space-base)',
|
|
13
|
+
'border-bottom': '1px solid var(--theme-border-subtle-color)',
|
|
14
|
+
'justify-content': 'center',
|
|
15
|
+
'align-items': 'center',
|
|
16
|
+
display: 'flex',
|
|
17
|
+
height: '50px',
|
|
18
|
+
}"
|
|
19
|
+
[body-style]="{
|
|
20
|
+
'justify-content': 'space-between',
|
|
21
|
+
'align-items': 'center',
|
|
22
|
+
display: 'flex',
|
|
23
|
+
width: '100%',
|
|
24
|
+
}"
|
|
25
|
+
>
|
|
26
|
+
<div style="display: flex; align-items: center; gap: var(--space-base)">
|
|
27
|
+
<span style="font-weight: 800; font-family: var(--font-hero)">Dasar UI Library</span>
|
|
28
|
+
<dasar-chip variant="secondary" size="xs">v{{ version }}</dasar-chip>
|
|
29
|
+
@if (latestVersion() !== null) {
|
|
30
|
+
<dasar-chip variant="primary" size="xs">latest v{{ latestVersion() }}</dasar-chip>
|
|
31
|
+
}
|
|
32
|
+
</div>
|
|
33
|
+
<div class="docs-navbar-actions">
|
|
34
|
+
<dasar-button appearance="outline" variant="secondary" (click)="customizeOpen.set(true)"
|
|
35
|
+
>Customize</dasar-button
|
|
36
|
+
>
|
|
37
|
+
<dasar-button
|
|
38
|
+
size="md"
|
|
39
|
+
radius="md"
|
|
40
|
+
appearance="outline"
|
|
41
|
+
variant="secondary"
|
|
42
|
+
(click)="openExternal('https://github.com/pis2co/dasar-ui/blob/main/CHANGELOG.md')"
|
|
43
|
+
aria-label="Open changelog on GitHub"
|
|
44
|
+
>Changelog</dasar-button
|
|
45
|
+
>
|
|
46
|
+
<dasar-button
|
|
47
|
+
appearance="outline"
|
|
48
|
+
variant="secondary"
|
|
49
|
+
icon-only
|
|
50
|
+
(click)="openExternal('https://github.com/pis2co/dasar-ui')"
|
|
51
|
+
aria-label="Open dasar-ui on GitHub"
|
|
52
|
+
><dasar-icon name="brand-github"
|
|
53
|
+
/></dasar-button>
|
|
54
|
+
<dasar-button
|
|
55
|
+
appearance="outline"
|
|
56
|
+
variant="danger"
|
|
57
|
+
icon-only
|
|
58
|
+
(click)="openExternal('https://www.npmjs.com/package/dasar-ui')"
|
|
59
|
+
aria-label="Open dasar-ui on npm"
|
|
60
|
+
><dasar-icon name="brand-npm"
|
|
61
|
+
/></dasar-button>
|
|
62
|
+
|
|
63
|
+
<dasar-button icon-only appearance="solid" (click)="customize.toggleMode()">
|
|
64
|
+
<dasar-icon name="{{ customize.mode() == 'light' ? 'moon' : 'sun' }}" />
|
|
65
|
+
</dasar-button>
|
|
66
|
+
</div>
|
|
67
|
+
</dasar-card>
|
|
68
|
+
<div [ngStyle]="{ height: 'calc(100vh - 50px)' }">
|
|
69
|
+
@for (key of [customize.renderKey()]; track key) {
|
|
70
|
+
<router-outlet></router-outlet>
|
|
71
|
+
}
|
|
72
|
+
</div>
|
|
73
|
+
<doc-customize-modal
|
|
74
|
+
[open]="customizeOpen()"
|
|
75
|
+
(closed)="customizeOpen.set(false)"
|
|
76
|
+
></doc-customize-modal>
|
|
77
|
+
</dasar-theme-provider>
|
|
78
|
+
</main>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
import { App } from './app';
|
|
3
|
+
|
|
4
|
+
describe('App', () => {
|
|
5
|
+
beforeEach(async () => {
|
|
6
|
+
await TestBed.configureTestingModule({
|
|
7
|
+
imports: [App],
|
|
8
|
+
}).compileComponents();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('should create the app', () => {
|
|
12
|
+
const fixture = TestBed.createComponent(App);
|
|
13
|
+
const app = fixture.componentInstance;
|
|
14
|
+
expect(app).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should render title', async () => {
|
|
18
|
+
const fixture = TestBed.createComponent(App);
|
|
19
|
+
await fixture.whenStable();
|
|
20
|
+
const compiled = fixture.nativeElement as HTMLElement;
|
|
21
|
+
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, dasar-ui-documentation');
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DasarThemeProviderComponent,
|
|
3
|
+
DasarButtonComponent,
|
|
4
|
+
DasarCardComponent,
|
|
5
|
+
DasarChipComponent,
|
|
6
|
+
DasarIconComponent,
|
|
7
|
+
} from 'dasar-ui';
|
|
8
|
+
import { Component, inject, signal, PLATFORM_ID } from '@angular/core';
|
|
9
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
10
|
+
import { RouterOutlet } from '@angular/router';
|
|
11
|
+
import { CommonModule } from '@angular/common';
|
|
12
|
+
import { DocCustomizeService } from './services/doc-customize.service';
|
|
13
|
+
import { DocCustomizeModalComponent } from './components/doc-customize-modal.component';
|
|
14
|
+
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
import packageJson from '../../../../projects/dasar-ui/package.json' with { loader: 'text' };
|
|
17
|
+
|
|
18
|
+
@Component({
|
|
19
|
+
imports: [
|
|
20
|
+
CommonModule,
|
|
21
|
+
RouterOutlet,
|
|
22
|
+
DasarThemeProviderComponent,
|
|
23
|
+
DasarButtonComponent,
|
|
24
|
+
DasarCardComponent,
|
|
25
|
+
DasarChipComponent,
|
|
26
|
+
DasarIconComponent,
|
|
27
|
+
DocCustomizeModalComponent,
|
|
28
|
+
],
|
|
29
|
+
templateUrl: './app.html',
|
|
30
|
+
selector: 'app-root',
|
|
31
|
+
})
|
|
32
|
+
export class App {
|
|
33
|
+
protected readonly customize = inject(DocCustomizeService);
|
|
34
|
+
protected readonly customizeOpen = signal(false);
|
|
35
|
+
protected readonly version: string = (typeof packageJson === 'string'
|
|
36
|
+
? (JSON.parse(packageJson) as { version: string })
|
|
37
|
+
: (packageJson as unknown as { version: string })
|
|
38
|
+
).version;
|
|
39
|
+
protected readonly latestVersion = signal<string | null>(null);
|
|
40
|
+
|
|
41
|
+
constructor() {
|
|
42
|
+
if (isPlatformBrowser(inject(PLATFORM_ID))) {
|
|
43
|
+
fetch('https://registry.npmjs.org/dasar-ui/latest')
|
|
44
|
+
.then((res) => (res.ok ? res.json() : null))
|
|
45
|
+
.then((data: { version?: string } | null) => {
|
|
46
|
+
if (data?.version && data.version !== this.version) {
|
|
47
|
+
this.latestVersion.set(data.version);
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
.catch(() => undefined);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
protected openExternal(url: string) {
|
|
55
|
+
window.open(url, '_blank', 'noopener,noreferrer');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
EventEmitter,
|
|
4
|
+
Input,
|
|
5
|
+
OnChanges,
|
|
6
|
+
Output,
|
|
7
|
+
SimpleChanges,
|
|
8
|
+
inject,
|
|
9
|
+
signal,
|
|
10
|
+
} from '@angular/core';
|
|
11
|
+
import {
|
|
12
|
+
DOC_DEFAULT_SETTINGS,
|
|
13
|
+
DocCustomizeService,
|
|
14
|
+
DocCustomizeSettings,
|
|
15
|
+
} from '../services/doc-customize.service';
|
|
16
|
+
import { DasarModalComponent, DasarButtonComponent, DasarSelectComponent } from 'dasar-ui';
|
|
17
|
+
import { CommonModule } from '@angular/common';
|
|
18
|
+
import { FormsModule } from '@angular/forms';
|
|
19
|
+
|
|
20
|
+
interface DasarModalOption {
|
|
21
|
+
label: string;
|
|
22
|
+
value: string | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const DEFAULT_SENTINEL = '__default__';
|
|
26
|
+
|
|
27
|
+
@Component({
|
|
28
|
+
selector: 'doc-customize-modal',
|
|
29
|
+
standalone: true,
|
|
30
|
+
imports: [
|
|
31
|
+
CommonModule,
|
|
32
|
+
FormsModule,
|
|
33
|
+
DasarModalComponent,
|
|
34
|
+
DasarButtonComponent,
|
|
35
|
+
DasarSelectComponent,
|
|
36
|
+
],
|
|
37
|
+
template: `
|
|
38
|
+
<dasar-modal [open]="open" label="Customize" (onClose)="cancel()">
|
|
39
|
+
<section class="cm-section">
|
|
40
|
+
<h3>Component defaults</h3>
|
|
41
|
+
<p class="cm-hint">Applies to every example that does not set the property explicitly.</p>
|
|
42
|
+
|
|
43
|
+
<dasar-select
|
|
44
|
+
full-width
|
|
45
|
+
label="Size"
|
|
46
|
+
[dropdown-panel-style]="panelStyle"
|
|
47
|
+
[options]="sizeOptions"
|
|
48
|
+
[ngModel]="draft().size ?? sentinel"
|
|
49
|
+
(ngModelChange)="setOption('size', $event)"
|
|
50
|
+
></dasar-select>
|
|
51
|
+
|
|
52
|
+
<dasar-select
|
|
53
|
+
full-width
|
|
54
|
+
label="Radius"
|
|
55
|
+
[dropdown-panel-style]="panelStyle"
|
|
56
|
+
[options]="radiusOptions"
|
|
57
|
+
[ngModel]="draft().radius ?? sentinel"
|
|
58
|
+
(ngModelChange)="setOption('radius', $event)"
|
|
59
|
+
></dasar-select>
|
|
60
|
+
|
|
61
|
+
<dasar-select
|
|
62
|
+
full-width
|
|
63
|
+
label="Button appearance"
|
|
64
|
+
[dropdown-panel-style]="panelStyle"
|
|
65
|
+
[options]="buttonAppearanceOptions"
|
|
66
|
+
[ngModel]="draft().buttonAppearance ?? sentinel"
|
|
67
|
+
(ngModelChange)="setOption('buttonAppearance', $event)"
|
|
68
|
+
></dasar-select>
|
|
69
|
+
|
|
70
|
+
<dasar-select
|
|
71
|
+
full-width
|
|
72
|
+
label="Input appearance"
|
|
73
|
+
[dropdown-panel-style]="panelStyle"
|
|
74
|
+
[options]="inputAppearanceOptions"
|
|
75
|
+
[ngModel]="draft().inputAppearance ?? sentinel"
|
|
76
|
+
(ngModelChange)="setOption('inputAppearance', $event)"
|
|
77
|
+
></dasar-select>
|
|
78
|
+
|
|
79
|
+
<dasar-select
|
|
80
|
+
full-width
|
|
81
|
+
label="Card appearance"
|
|
82
|
+
[dropdown-panel-style]="panelStyle"
|
|
83
|
+
[options]="cardAppearanceOptions"
|
|
84
|
+
[ngModel]="draft().cardAppearance ?? sentinel"
|
|
85
|
+
(ngModelChange)="setOption('cardAppearance', $event)"
|
|
86
|
+
></dasar-select>
|
|
87
|
+
|
|
88
|
+
<dasar-select
|
|
89
|
+
full-width
|
|
90
|
+
label="Tabs appearance"
|
|
91
|
+
[dropdown-panel-style]="panelStyle"
|
|
92
|
+
[options]="tabsAppearanceOptions"
|
|
93
|
+
[ngModel]="draft().tabsAppearance ?? sentinel"
|
|
94
|
+
(ngModelChange)="setOption('tabsAppearance', $event)"
|
|
95
|
+
></dasar-select>
|
|
96
|
+
|
|
97
|
+
<dasar-select
|
|
98
|
+
full-width
|
|
99
|
+
label="Tabs size"
|
|
100
|
+
[dropdown-panel-style]="panelStyle"
|
|
101
|
+
[options]="tabsSizeOptions"
|
|
102
|
+
[ngModel]="draft().tabsSize ?? sentinel"
|
|
103
|
+
(ngModelChange)="setOption('tabsSize', $event)"
|
|
104
|
+
></dasar-select>
|
|
105
|
+
|
|
106
|
+
<dasar-select
|
|
107
|
+
full-width
|
|
108
|
+
label="Tabs spacing"
|
|
109
|
+
[dropdown-panel-style]="panelStyle"
|
|
110
|
+
[options]="tabsSpacingOptions"
|
|
111
|
+
[ngModel]="draft().tabsSpacing ?? sentinel"
|
|
112
|
+
(ngModelChange)="setOption('tabsSpacing', $event)"
|
|
113
|
+
></dasar-select>
|
|
114
|
+
</section>
|
|
115
|
+
|
|
116
|
+
<section class="cm-section">
|
|
117
|
+
<h3>List</h3>
|
|
118
|
+
|
|
119
|
+
<dasar-select
|
|
120
|
+
full-width
|
|
121
|
+
label="List size"
|
|
122
|
+
[dropdown-panel-style]="panelStyle"
|
|
123
|
+
[options]="listSizeOptions"
|
|
124
|
+
[ngModel]="draft().listSize ?? sentinel"
|
|
125
|
+
(ngModelChange)="setOption('listSize', $event)"
|
|
126
|
+
></dasar-select>
|
|
127
|
+
|
|
128
|
+
<dasar-select
|
|
129
|
+
full-width
|
|
130
|
+
label="List bordered"
|
|
131
|
+
[dropdown-panel-style]="panelStyle"
|
|
132
|
+
[options]="booleanOptions"
|
|
133
|
+
[ngModel]="booleanSentinel(draft().listBordered)"
|
|
134
|
+
(ngModelChange)="setBooleanOption('listBordered', $event)"
|
|
135
|
+
></dasar-select>
|
|
136
|
+
|
|
137
|
+
<dasar-select
|
|
138
|
+
full-width
|
|
139
|
+
label="List show divider"
|
|
140
|
+
[dropdown-panel-style]="panelStyle"
|
|
141
|
+
[options]="booleanOptions"
|
|
142
|
+
[ngModel]="booleanSentinel(draft().listDivider)"
|
|
143
|
+
(ngModelChange)="setBooleanOption('listDivider', $event)"
|
|
144
|
+
></dasar-select>
|
|
145
|
+
</section>
|
|
146
|
+
|
|
147
|
+
<section class="cm-section">
|
|
148
|
+
<h3>Theme</h3>
|
|
149
|
+
|
|
150
|
+
<div class="cm-color">
|
|
151
|
+
<span>Primary color</span>
|
|
152
|
+
<input
|
|
153
|
+
type="color"
|
|
154
|
+
[ngModel]="draft().primaryColor ?? '#2563eb'"
|
|
155
|
+
(ngModelChange)="set('primaryColor', $event)"
|
|
156
|
+
/>
|
|
157
|
+
<dasar-button appearance="subtle" (click)="set('primaryColor', null)">
|
|
158
|
+
Use default
|
|
159
|
+
</dasar-button>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<dasar-select
|
|
163
|
+
full-width
|
|
164
|
+
label="Base font size"
|
|
165
|
+
[dropdown-panel-style]="panelStyle"
|
|
166
|
+
[options]="fontSizeOptions"
|
|
167
|
+
[ngModel]="draft().fontSizeBase ?? sentinel"
|
|
168
|
+
(ngModelChange)="setOption('fontSizeBase', $event)"
|
|
169
|
+
></dasar-select>
|
|
170
|
+
|
|
171
|
+
<dasar-select
|
|
172
|
+
full-width
|
|
173
|
+
label="Font family"
|
|
174
|
+
[options]="fontOptions"
|
|
175
|
+
[dropdown-panel-style]="panelStyle"
|
|
176
|
+
[ngModel]="draft().fontSans ?? sentinel"
|
|
177
|
+
(ngModelChange)="setOption('fontSans', $event)"
|
|
178
|
+
></dasar-select>
|
|
179
|
+
</section>
|
|
180
|
+
|
|
181
|
+
<div
|
|
182
|
+
action-slot
|
|
183
|
+
style="width: 100%; display: flex; gap: var(--space-base); justify-content: space-between; align-items: center;"
|
|
184
|
+
>
|
|
185
|
+
<dasar-button appearance="outline" variant="danger" (click)="resetDraft()">
|
|
186
|
+
Reset to defaults
|
|
187
|
+
</dasar-button>
|
|
188
|
+
<span class="cm-spacer"></span>
|
|
189
|
+
<div style="display: flex; gap: var(--space-base); align-items: center;">
|
|
190
|
+
<dasar-button appearance="outline" variant="secondary" (click)="cancel()">
|
|
191
|
+
Cancel
|
|
192
|
+
</dasar-button>
|
|
193
|
+
<dasar-button appearance="solid" (click)="apply()">Apply</dasar-button>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</dasar-modal>
|
|
197
|
+
`,
|
|
198
|
+
styles: [
|
|
199
|
+
`
|
|
200
|
+
.cm-section {
|
|
201
|
+
display: flex;
|
|
202
|
+
flex-direction: column;
|
|
203
|
+
gap: 12px;
|
|
204
|
+
}
|
|
205
|
+
.cm-section + .cm-section {
|
|
206
|
+
margin-top: 20px;
|
|
207
|
+
}
|
|
208
|
+
h3 {
|
|
209
|
+
margin: 0;
|
|
210
|
+
font-size: 13px;
|
|
211
|
+
text-transform: uppercase;
|
|
212
|
+
color: var(--theme-text-secondary-color);
|
|
213
|
+
}
|
|
214
|
+
.cm-hint {
|
|
215
|
+
margin: 0;
|
|
216
|
+
font-size: 12px;
|
|
217
|
+
color: var(--theme-text-secondary-color);
|
|
218
|
+
}
|
|
219
|
+
.cm-color {
|
|
220
|
+
display: flex;
|
|
221
|
+
align-items: center;
|
|
222
|
+
gap: 12px;
|
|
223
|
+
font-size: 14px;
|
|
224
|
+
}
|
|
225
|
+
.cm-color span {
|
|
226
|
+
flex: 1;
|
|
227
|
+
}
|
|
228
|
+
.cm-color input[type='color'] {
|
|
229
|
+
width: 48px;
|
|
230
|
+
height: 32px;
|
|
231
|
+
padding: 2px;
|
|
232
|
+
border: 1px solid var(--theme-border-strong-color);
|
|
233
|
+
border-radius: 6px;
|
|
234
|
+
background: var(--theme-bg-default-color);
|
|
235
|
+
}
|
|
236
|
+
.cm-spacer {
|
|
237
|
+
flex: 1;
|
|
238
|
+
}
|
|
239
|
+
`,
|
|
240
|
+
],
|
|
241
|
+
})
|
|
242
|
+
export class DocCustomizeModalComponent implements OnChanges {
|
|
243
|
+
@Input() open = false;
|
|
244
|
+
@Output() closed = new EventEmitter<void>();
|
|
245
|
+
|
|
246
|
+
private customize = inject(DocCustomizeService);
|
|
247
|
+
readonly draft = signal<DocCustomizeSettings>({ ...DOC_DEFAULT_SETTINGS });
|
|
248
|
+
readonly sentinel = DEFAULT_SENTINEL;
|
|
249
|
+
readonly panelStyle = { 'z-index': '1100' };
|
|
250
|
+
|
|
251
|
+
readonly sizeOptions: DasarModalOption[] = [
|
|
252
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
253
|
+
{ label: 'XS', value: 'xs' },
|
|
254
|
+
{ label: 'SM', value: 'sm' },
|
|
255
|
+
{ label: 'MD', value: 'md' },
|
|
256
|
+
{ label: 'LG', value: 'lg' },
|
|
257
|
+
{ label: 'XL', value: 'xl' },
|
|
258
|
+
];
|
|
259
|
+
readonly radiusOptions: DasarModalOption[] = [
|
|
260
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
261
|
+
{ label: 'None', value: 'none' },
|
|
262
|
+
{ label: 'XS', value: 'xs' },
|
|
263
|
+
{ label: 'SM', value: 'sm' },
|
|
264
|
+
{ label: 'MD', value: 'md' },
|
|
265
|
+
{ label: 'LG', value: 'lg' },
|
|
266
|
+
{ label: 'XL', value: 'xl' },
|
|
267
|
+
{ label: 'Full', value: 'full' },
|
|
268
|
+
];
|
|
269
|
+
readonly buttonAppearanceOptions: DasarModalOption[] = [
|
|
270
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
271
|
+
{ label: 'Solid', value: 'solid' },
|
|
272
|
+
{ label: 'Subtle', value: 'subtle' },
|
|
273
|
+
{ label: 'Outline', value: 'outline' },
|
|
274
|
+
];
|
|
275
|
+
readonly inputAppearanceOptions: DasarModalOption[] = [
|
|
276
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
277
|
+
{ label: 'Outline', value: 'outline' },
|
|
278
|
+
{ label: 'Filled', value: 'filled' },
|
|
279
|
+
];
|
|
280
|
+
readonly cardAppearanceOptions: DasarModalOption[] = [
|
|
281
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
282
|
+
{ label: 'Outline', value: 'outline' },
|
|
283
|
+
{ label: 'Borderless', value: 'borderless' },
|
|
284
|
+
{ label: 'Elevated', value: 'elevated' },
|
|
285
|
+
];
|
|
286
|
+
readonly tabsAppearanceOptions: DasarModalOption[] = [
|
|
287
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
288
|
+
{ label: 'Solid', value: 'solid' },
|
|
289
|
+
{ label: 'Subtle', value: 'subtle' },
|
|
290
|
+
{ label: 'Outline', value: 'outline' },
|
|
291
|
+
];
|
|
292
|
+
readonly tabsSizeOptions: DasarModalOption[] = [
|
|
293
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
294
|
+
{ label: 'None', value: 'none' },
|
|
295
|
+
{ label: 'Xs', value: 'xs' },
|
|
296
|
+
{ label: 'Sm', value: 'sm' },
|
|
297
|
+
{ label: 'Md', value: 'md' },
|
|
298
|
+
{ label: 'Lg', value: 'lg' },
|
|
299
|
+
{ label: 'Xl', value: 'xl' },
|
|
300
|
+
{ label: 'Full', value: 'full' },
|
|
301
|
+
];
|
|
302
|
+
readonly tabsSpacingOptions: DasarModalOption[] = [
|
|
303
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
304
|
+
{ label: 'Normal', value: 'normal' },
|
|
305
|
+
{ label: 'Compact', value: 'compact' },
|
|
306
|
+
];
|
|
307
|
+
readonly listSizeOptions: DasarModalOption[] = [
|
|
308
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
309
|
+
{ label: 'Sm', value: 'sm' },
|
|
310
|
+
{ label: 'Md', value: 'md' },
|
|
311
|
+
{ label: 'Lg', value: 'lg' },
|
|
312
|
+
];
|
|
313
|
+
readonly booleanOptions: DasarModalOption[] = [
|
|
314
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
315
|
+
{ label: 'On', value: 'true' },
|
|
316
|
+
{ label: 'Off', value: 'false' },
|
|
317
|
+
];
|
|
318
|
+
readonly fontSizeOptions: DasarModalOption[] = [
|
|
319
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
320
|
+
{ label: '12px', value: '12px' },
|
|
321
|
+
{ label: '13px', value: '13px' },
|
|
322
|
+
{ label: '14px', value: '14px' },
|
|
323
|
+
{ label: '15px', value: '15px' },
|
|
324
|
+
{ label: '16px', value: '16px' },
|
|
325
|
+
];
|
|
326
|
+
readonly fontOptions: DasarModalOption[] = [
|
|
327
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
328
|
+
{ label: 'System UI', value: 'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif' },
|
|
329
|
+
{ label: 'Serif', value: 'Georgia, "Times New Roman", serif' },
|
|
330
|
+
{ label: 'Monospace', value: 'Menlo, Monaco, "Courier New", monospace' },
|
|
331
|
+
];
|
|
332
|
+
|
|
333
|
+
ngOnChanges(changes: SimpleChanges) {
|
|
334
|
+
if (changes['open'] && this.open) {
|
|
335
|
+
this.draft.set({ ...this.customize.settings() });
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
set<K extends keyof DocCustomizeSettings>(key: K, value: DocCustomizeSettings[K]) {
|
|
340
|
+
this.draft.update((d) => ({ ...d, [key]: value }));
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
setOption<K extends keyof DocCustomizeSettings>(key: K, value: unknown) {
|
|
344
|
+
this.set(key, (value === DEFAULT_SENTINEL ? null : value) as DocCustomizeSettings[K]);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
setBooleanOption<K extends keyof DocCustomizeSettings>(key: K, value: unknown) {
|
|
348
|
+
const parsed = value === DEFAULT_SENTINEL ? null : String(value) === 'true';
|
|
349
|
+
this.set(key, parsed as DocCustomizeSettings[K]);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
booleanSentinel(value: boolean | null): string {
|
|
353
|
+
return value === null ? DEFAULT_SENTINEL : String(value);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
resetDraft() {
|
|
357
|
+
this.draft.set({ ...DOC_DEFAULT_SETTINGS });
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
apply() {
|
|
361
|
+
this.customize.apply(this.draft());
|
|
362
|
+
this.closed.emit();
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
cancel() {
|
|
366
|
+
this.closed.emit();
|
|
367
|
+
}
|
|
368
|
+
}
|