dasar-ui 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +31 -0
- package/.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 +48 -0
- package/Dockerfile +26 -0
- package/README.md +14 -19
- package/angular.json +114 -0
- package/package.json +56 -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 +104 -0
- package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.ts +87 -0
- package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.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.ts +271 -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 +666 -0
- package/projects/dasar-ui/src/lib/models/type.model.ts +11 -0
- package/projects/dasar-ui/src/lib/services/theme.service.spec.ts +65 -0
- package/projects/dasar-ui/src/lib/services/theme.service.ts +707 -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 +23 -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 +51 -0
- package/projects/documentation/src/app/app.spec.ts +23 -0
- package/projects/documentation/src/app/app.ts +23 -0
- package/projects/documentation/src/app/components/doc-customize-modal.component.ts +314 -0
- package/projects/documentation/src/app/components/doc-example.component.ts +195 -0
- package/projects/documentation/src/app/config/app.config.server.ts +10 -0
- package/projects/documentation/src/app/config/app.config.ts +17 -0
- package/projects/documentation/src/app/layouts/doc.layout.ts +229 -0
- package/projects/documentation/src/app/pages/button/button.page.html +65 -0
- package/projects/documentation/src/app/pages/button/button.page.ts +139 -0
- package/projects/documentation/src/app/pages/button/examples/appearance/button-appearance.example.html +7 -0
- package/projects/documentation/src/app/pages/button/examples/appearance/button-appearance.example.ts +10 -0
- package/projects/documentation/src/app/pages/button/examples/icon/button-icon.example.html +19 -0
- package/projects/documentation/src/app/pages/button/examples/icon/button-icon.example.ts +10 -0
- package/projects/documentation/src/app/pages/button/examples/radius/button-radius.example.html +9 -0
- package/projects/documentation/src/app/pages/button/examples/radius/button-radius.example.ts +10 -0
- package/projects/documentation/src/app/pages/button/examples/sizes/button-sizes.example.html +7 -0
- package/projects/documentation/src/app/pages/button/examples/sizes/button-sizes.example.ts +10 -0
- package/projects/documentation/src/app/pages/button/examples/state/button-state.example.html +10 -0
- package/projects/documentation/src/app/pages/button/examples/state/button-state.example.ts +10 -0
- package/projects/documentation/src/app/pages/button/examples/variant/button-variant.example.html +9 -0
- package/projects/documentation/src/app/pages/button/examples/variant/button-variant.example.ts +10 -0
- package/projects/documentation/src/app/pages/calendar/calendar.page.html +75 -0
- package/projects/documentation/src/app/pages/calendar/calendar.page.ts +165 -0
- package/projects/documentation/src/app/pages/calendar/examples/actions/calendar-actions.example.html +21 -0
- package/projects/documentation/src/app/pages/calendar/examples/actions/calendar-actions.example.ts +10 -0
- package/projects/documentation/src/app/pages/calendar/examples/basic/calendar-basic.example.html +11 -0
- package/projects/documentation/src/app/pages/calendar/examples/basic/calendar-basic.example.ts +13 -0
- package/projects/documentation/src/app/pages/calendar/examples/custom-header/calendar-custom-header.example.html +36 -0
- package/projects/documentation/src/app/pages/calendar/examples/custom-header/calendar-custom-header.example.ts +11 -0
- package/projects/documentation/src/app/pages/calendar/examples/dropdown/calendar-dropdown.example.html +10 -0
- package/projects/documentation/src/app/pages/calendar/examples/dropdown/calendar-dropdown.example.ts +12 -0
- package/projects/documentation/src/app/pages/calendar/examples/format/calendar-format.example.html +15 -0
- package/projects/documentation/src/app/pages/calendar/examples/format/calendar-format.example.ts +12 -0
- package/projects/documentation/src/app/pages/calendar/examples/locale/calendar-locale.example.html +34 -0
- package/projects/documentation/src/app/pages/calendar/examples/locale/calendar-locale.example.ts +14 -0
- package/projects/documentation/src/app/pages/calendar/examples/more/calendar.more.example.html +20 -0
- package/projects/documentation/src/app/pages/calendar/examples/more/calendar.more.example.ts +37 -0
- package/projects/documentation/src/app/pages/calendar/examples/styles/calendar-styles.example.html +16 -0
- package/projects/documentation/src/app/pages/calendar/examples/styles/calendar-styles.example.ts +10 -0
- package/projects/documentation/src/app/pages/card/card.page.html +75 -0
- package/projects/documentation/src/app/pages/card/card.page.ts +182 -0
- package/projects/documentation/src/app/pages/card/examples/appearance/card-appearance.example.html +13 -0
- package/projects/documentation/src/app/pages/card/examples/appearance/card-appearance.example.ts +10 -0
- package/projects/documentation/src/app/pages/card/examples/closable/card-closable.example.html +30 -0
- package/projects/documentation/src/app/pages/card/examples/closable/card-closable.example.ts +19 -0
- package/projects/documentation/src/app/pages/card/examples/custom-style/card-custom-style.example.html +173 -0
- package/projects/documentation/src/app/pages/card/examples/custom-style/card-custom-style.example.ts +10 -0
- package/projects/documentation/src/app/pages/card/examples/media/card-media.example.html +27 -0
- package/projects/documentation/src/app/pages/card/examples/media/card-media.example.ts +10 -0
- package/projects/documentation/src/app/pages/card/examples/radius/card-radius.example.html +13 -0
- package/projects/documentation/src/app/pages/card/examples/radius/card-radius.example.ts +10 -0
- package/projects/documentation/src/app/pages/card/examples/slots/card-slots.example.html +20 -0
- package/projects/documentation/src/app/pages/card/examples/slots/card-slots.example.ts +10 -0
- package/projects/documentation/src/app/pages/card/examples/spacing/card-spacing.example.html +11 -0
- package/projects/documentation/src/app/pages/card/examples/spacing/card-spacing.example.ts +10 -0
- package/projects/documentation/src/app/pages/chip/chip.page.html +55 -0
- package/projects/documentation/src/app/pages/chip/chip.page.ts +158 -0
- package/projects/documentation/src/app/pages/chip/examples/appearance/chip-appearance.example.html +7 -0
- package/projects/documentation/src/app/pages/chip/examples/appearance/chip-appearance.example.ts +10 -0
- package/projects/documentation/src/app/pages/chip/examples/more/chip-more.example.html +13 -0
- package/projects/documentation/src/app/pages/chip/examples/more/chip-more.example.ts +17 -0
- package/projects/documentation/src/app/pages/chip/examples/radius/chip-radius.example.html +9 -0
- package/projects/documentation/src/app/pages/chip/examples/radius/chip-radius.example.ts +10 -0
- package/projects/documentation/src/app/pages/chip/examples/sizes/chip-sizes.example.html +6 -0
- package/projects/documentation/src/app/pages/chip/examples/sizes/chip-sizes.example.ts +10 -0
- package/projects/documentation/src/app/pages/chip/examples/variant/chip-variant.example.html +8 -0
- package/projects/documentation/src/app/pages/chip/examples/variant/chip-variant.example.ts +10 -0
- package/projects/documentation/src/app/pages/datepicker/datepicker.page.html +75 -0
- package/projects/documentation/src/app/pages/datepicker/datepicker.page.ts +181 -0
- package/projects/documentation/src/app/pages/datepicker/examples/appearance/datepicker-appearance.example.html +29 -0
- package/projects/documentation/src/app/pages/datepicker/examples/appearance/datepicker-appearance.example.ts +10 -0
- package/projects/documentation/src/app/pages/datepicker/examples/basic/datepicker-basic.example.html +12 -0
- package/projects/documentation/src/app/pages/datepicker/examples/basic/datepicker-basic.example.ts +12 -0
- package/projects/documentation/src/app/pages/datepicker/examples/footer/datepicker-footer.example.html +23 -0
- package/projects/documentation/src/app/pages/datepicker/examples/footer/datepicker-footer.example.ts +17 -0
- package/projects/documentation/src/app/pages/datepicker/examples/format/datepicker-format.example.html +30 -0
- package/projects/documentation/src/app/pages/datepicker/examples/format/datepicker-format.example.ts +13 -0
- package/projects/documentation/src/app/pages/datepicker/examples/placement/datepicker-placement.example.html +24 -0
- package/projects/documentation/src/app/pages/datepicker/examples/placement/datepicker-placement.example.ts +10 -0
- package/projects/documentation/src/app/pages/datepicker/examples/slots/datepicker-slots.example.html +19 -0
- package/projects/documentation/src/app/pages/datepicker/examples/slots/datepicker-slots.example.ts +10 -0
- package/projects/documentation/src/app/pages/datepicker/examples/states/datepicker-states.example.html +28 -0
- package/projects/documentation/src/app/pages/datepicker/examples/states/datepicker-states.example.ts +12 -0
- package/projects/documentation/src/app/pages/icon/icon.page.html +15 -0
- package/projects/documentation/src/app/pages/icon/icon.page.ts +60 -0
- package/projects/documentation/src/app/pages/input/examples/appearance/input-appearance.example.html +27 -0
- package/projects/documentation/src/app/pages/input/examples/appearance/input-appearance.example.ts +10 -0
- package/projects/documentation/src/app/pages/input/examples/basic/input-basic.example.html +13 -0
- package/projects/documentation/src/app/pages/input/examples/basic/input-basic.example.ts +13 -0
- package/projects/documentation/src/app/pages/input/examples/mask/input-mask.example.html +31 -0
- package/projects/documentation/src/app/pages/input/examples/mask/input-mask.example.ts +19 -0
- package/projects/documentation/src/app/pages/input/examples/more/input-more.example.html +68 -0
- package/projects/documentation/src/app/pages/input/examples/more/input-more.example.ts +18 -0
- package/projects/documentation/src/app/pages/input/examples/slots/input-slots.example.html +52 -0
- package/projects/documentation/src/app/pages/input/examples/slots/input-slots.example.ts +10 -0
- package/projects/documentation/src/app/pages/input/examples/states/input-states.example.html +29 -0
- package/projects/documentation/src/app/pages/input/examples/states/input-states.example.ts +10 -0
- package/projects/documentation/src/app/pages/input/input.page.html +65 -0
- package/projects/documentation/src/app/pages/input/input.page.ts +170 -0
- package/projects/documentation/src/app/pages/menu/examples/basic/menu-basic.example.html +5 -0
- package/projects/documentation/src/app/pages/menu/examples/basic/menu-basic.example.ts +17 -0
- package/projects/documentation/src/app/pages/menu/examples/custom-template/menu-custom-template.example.html +35 -0
- package/projects/documentation/src/app/pages/menu/examples/custom-template/menu-custom-template.example.ts +57 -0
- package/projects/documentation/src/app/pages/menu/examples/placement/menu-placement.example.html +12 -0
- package/projects/documentation/src/app/pages/menu/examples/placement/menu-placement.example.ts +16 -0
- package/projects/documentation/src/app/pages/menu/menu.page.html +35 -0
- package/projects/documentation/src/app/pages/menu/menu.page.ts +149 -0
- package/projects/documentation/src/app/pages/modal/examples/appearance/modal-appearance.example.html +18 -0
- package/projects/documentation/src/app/pages/modal/examples/appearance/modal-appearance.example.ts +21 -0
- package/projects/documentation/src/app/pages/modal/examples/basic/modal-basic.example.html +8 -0
- package/projects/documentation/src/app/pages/modal/examples/basic/modal-basic.example.ts +12 -0
- package/projects/documentation/src/app/pages/modal/examples/close-behavior/modal-close-behavior.example.html +44 -0
- package/projects/documentation/src/app/pages/modal/examples/close-behavior/modal-close-behavior.example.ts +14 -0
- package/projects/documentation/src/app/pages/modal/examples/custom-style/modal-custom-style.example.html +36 -0
- package/projects/documentation/src/app/pages/modal/examples/custom-style/modal-custom-style.example.ts +12 -0
- package/projects/documentation/src/app/pages/modal/examples/overlay/modal-overlay.example.html +29 -0
- package/projects/documentation/src/app/pages/modal/examples/overlay/modal-overlay.example.ts +14 -0
- package/projects/documentation/src/app/pages/modal/examples/radius-spacing/modal-radius-spacing.example.html +27 -0
- package/projects/documentation/src/app/pages/modal/examples/radius-spacing/modal-radius-spacing.example.ts +27 -0
- package/projects/documentation/src/app/pages/modal/examples/scroll/modal-scroll.example.html +14 -0
- package/projects/documentation/src/app/pages/modal/examples/scroll/modal-scroll.example.ts +13 -0
- package/projects/documentation/src/app/pages/modal/examples/size/modal-size.example.html +17 -0
- package/projects/documentation/src/app/pages/modal/examples/size/modal-size.example.ts +21 -0
- package/projects/documentation/src/app/pages/modal/examples/slots/modal-slots.example.html +30 -0
- package/projects/documentation/src/app/pages/modal/examples/slots/modal-slots.example.ts +12 -0
- package/projects/documentation/src/app/pages/modal/examples/width/modal-width.example.html +23 -0
- package/projects/documentation/src/app/pages/modal/examples/width/modal-width.example.ts +13 -0
- package/projects/documentation/src/app/pages/modal/modal.page.html +105 -0
- package/projects/documentation/src/app/pages/modal/modal.page.ts +257 -0
- package/projects/documentation/src/app/pages/number-input/examples/appearance/number-input-appearance.example.html +30 -0
- package/projects/documentation/src/app/pages/number-input/examples/appearance/number-input-appearance.example.ts +10 -0
- package/projects/documentation/src/app/pages/number-input/examples/basic/number-input-basic.example.html +12 -0
- package/projects/documentation/src/app/pages/number-input/examples/basic/number-input-basic.example.ts +13 -0
- package/projects/documentation/src/app/pages/number-input/examples/limits/number-input-limits.example.html +30 -0
- package/projects/documentation/src/app/pages/number-input/examples/limits/number-input-limits.example.ts +14 -0
- package/projects/documentation/src/app/pages/number-input/examples/slots/number-input-slots.example.html +49 -0
- package/projects/documentation/src/app/pages/number-input/examples/slots/number-input-slots.example.ts +10 -0
- package/projects/documentation/src/app/pages/number-input/examples/states/number-input-states.example.html +21 -0
- package/projects/documentation/src/app/pages/number-input/examples/states/number-input-states.example.ts +10 -0
- package/projects/documentation/src/app/pages/number-input/number-input.page.html +55 -0
- package/projects/documentation/src/app/pages/number-input/number-input.page.ts +142 -0
- package/projects/documentation/src/app/pages/select/examples/appearance/select-appearance.example.html +32 -0
- package/projects/documentation/src/app/pages/select/examples/appearance/select-appearance.example.ts +15 -0
- package/projects/documentation/src/app/pages/select/examples/basic/select-basic.example.html +13 -0
- package/projects/documentation/src/app/pages/select/examples/basic/select-basic.example.ts +20 -0
- package/projects/documentation/src/app/pages/select/examples/multiple/select-multiple.example.html +24 -0
- package/projects/documentation/src/app/pages/select/examples/multiple/select-multiple.example.ts +59 -0
- package/projects/documentation/src/app/pages/select/examples/placement/select-placement.example.html +20 -0
- package/projects/documentation/src/app/pages/select/examples/placement/select-placement.example.ts +20 -0
- package/projects/documentation/src/app/pages/select/examples/search/select-search.example.html +13 -0
- package/projects/documentation/src/app/pages/select/examples/search/select-search.example.ts +22 -0
- package/projects/documentation/src/app/pages/select/examples/slots/select-slots.example.html +44 -0
- package/projects/documentation/src/app/pages/select/examples/slots/select-slots.example.ts +15 -0
- package/projects/documentation/src/app/pages/select/examples/states/select-states.example.html +31 -0
- package/projects/documentation/src/app/pages/select/examples/states/select-states.example.ts +12 -0
- package/projects/documentation/src/app/pages/select/select.page.html +75 -0
- package/projects/documentation/src/app/pages/select/select.page.ts +195 -0
- package/projects/documentation/src/app/pages/table/examples/cell-actions/table-cell-actions.example.html +14 -0
- package/projects/documentation/src/app/pages/table/examples/cell-actions/table-cell-actions.example.ts +25 -0
- package/projects/documentation/src/app/pages/table/examples/cell-badge/table-cell-badge.example.html +12 -0
- package/projects/documentation/src/app/pages/table/examples/cell-badge/table-cell-badge.example.ts +21 -0
- package/projects/documentation/src/app/pages/table/examples/cell-profile/table-cell-profile.example.html +29 -0
- package/projects/documentation/src/app/pages/table/examples/cell-profile/table-cell-profile.example.ts +20 -0
- package/projects/documentation/src/app/pages/table/examples/custom-body/table-custom-body.example.html +39 -0
- package/projects/documentation/src/app/pages/table/examples/custom-body/table-custom-body.example.ts +21 -0
- package/projects/documentation/src/app/pages/table/examples/custom-sizes/table-custom-sizes.example.html +7 -0
- package/projects/documentation/src/app/pages/table/examples/custom-sizes/table-custom-sizes.example.ts +21 -0
- package/projects/documentation/src/app/pages/table/examples/dynamic-style/table-dynamic-style.example.html +3 -0
- package/projects/documentation/src/app/pages/table/examples/dynamic-style/table-dynamic-style.example.ts +41 -0
- package/projects/documentation/src/app/pages/table/examples/empty/table-empty.example.html +43 -0
- package/projects/documentation/src/app/pages/table/examples/empty/table-empty.example.ts +21 -0
- package/projects/documentation/src/app/pages/table/examples/expanded/table-expanded.example.html +36 -0
- package/projects/documentation/src/app/pages/table/examples/expanded/table-expanded.example.ts +34 -0
- package/projects/documentation/src/app/pages/table/examples/heatmap/table-heatmap.example.html +8 -0
- package/projects/documentation/src/app/pages/table/examples/heatmap/table-heatmap.example.ts +52 -0
- package/projects/documentation/src/app/pages/table/examples/inline-edit/table-inline-edit.example.html +53 -0
- package/projects/documentation/src/app/pages/table/examples/inline-edit/table-inline-edit.example.ts +50 -0
- package/projects/documentation/src/app/pages/table/examples/nested/table-nested.example.html +23 -0
- package/projects/documentation/src/app/pages/table/examples/nested/table-nested.example.ts +42 -0
- package/projects/documentation/src/app/pages/table/examples/pagination/table-pagination.example.html +20 -0
- package/projects/documentation/src/app/pages/table/examples/pagination/table-pagination.example.ts +21 -0
- package/projects/documentation/src/app/pages/table/table.page.html +125 -0
- package/projects/documentation/src/app/pages/table/table.page.ts +261 -0
- package/projects/documentation/src/app/pages/tabs/examples/advanced-dynamic/tabs-advanced-dynamic.example.html +13 -0
- package/projects/documentation/src/app/pages/tabs/examples/advanced-dynamic/tabs-advanced-dynamic.example.ts +27 -0
- package/projects/documentation/src/app/pages/tabs/examples/advanced-form/tabs-advanced-form.example.html +27 -0
- package/projects/documentation/src/app/pages/tabs/examples/advanced-form/tabs-advanced-form.example.ts +36 -0
- package/projects/documentation/src/app/pages/tabs/examples/advanced-theme/tabs-advanced-theme.example.html +5 -0
- package/projects/documentation/src/app/pages/tabs/examples/advanced-theme/tabs-advanced-theme.example.ts +20 -0
- package/projects/documentation/src/app/pages/tabs/examples/appearance/tabs-appearance.example.html +6 -0
- package/projects/documentation/src/app/pages/tabs/examples/appearance/tabs-appearance.example.ts +13 -0
- package/projects/documentation/src/app/pages/tabs/examples/basic/tabs-basic.example.html +13 -0
- package/projects/documentation/src/app/pages/tabs/examples/basic/tabs-basic.example.ts +13 -0
- package/projects/documentation/src/app/pages/tabs/examples/custom-style/tabs-custom-style.example.html +19 -0
- package/projects/documentation/src/app/pages/tabs/examples/custom-style/tabs-custom-style.example.ts +12 -0
- package/projects/documentation/src/app/pages/tabs/examples/events/tabs-events.example.html +16 -0
- package/projects/documentation/src/app/pages/tabs/examples/events/tabs-events.example.ts +23 -0
- package/projects/documentation/src/app/pages/tabs/examples/fluid/tabs-fluid.example.html +5 -0
- package/projects/documentation/src/app/pages/tabs/examples/fluid/tabs-fluid.example.ts +12 -0
- package/projects/documentation/src/app/pages/tabs/examples/no-body/tabs-no-body.example.html +6 -0
- package/projects/documentation/src/app/pages/tabs/examples/no-body/tabs-no-body.example.ts +12 -0
- package/projects/documentation/src/app/pages/tabs/examples/radius/tabs-radius.example.html +6 -0
- package/projects/documentation/src/app/pages/tabs/examples/radius/tabs-radius.example.ts +13 -0
- package/projects/documentation/src/app/pages/tabs/examples/scroll/tabs-scroll.example.html +20 -0
- package/projects/documentation/src/app/pages/tabs/examples/scroll/tabs-scroll.example.ts +30 -0
- package/projects/documentation/src/app/pages/tabs/examples/scroll-icon/tabs-scroll-icon.example.html +16 -0
- package/projects/documentation/src/app/pages/tabs/examples/scroll-icon/tabs-scroll-icon.example.ts +26 -0
- package/projects/documentation/src/app/pages/tabs/examples/scroll-slot/tabs-scroll-slot.example.html +22 -0
- package/projects/documentation/src/app/pages/tabs/examples/scroll-slot/tabs-scroll-slot.example.ts +26 -0
- package/projects/documentation/src/app/pages/tabs/examples/size/tabs-size.example.html +6 -0
- package/projects/documentation/src/app/pages/tabs/examples/size/tabs-size.example.ts +13 -0
- package/projects/documentation/src/app/pages/tabs/examples/slots/tabs-slots.example.html +25 -0
- package/projects/documentation/src/app/pages/tabs/examples/slots/tabs-slots.example.ts +10 -0
- package/projects/documentation/src/app/pages/tabs/examples/spacing/tabs-spacing.example.html +6 -0
- package/projects/documentation/src/app/pages/tabs/examples/spacing/tabs-spacing.example.ts +13 -0
- package/projects/documentation/src/app/pages/tabs/tabs.page.html +165 -0
- package/projects/documentation/src/app/pages/tabs/tabs.page.ts +340 -0
- package/projects/documentation/src/app/routes/app.routes.server.ts +8 -0
- package/projects/documentation/src/app/routes/app.routes.ts +87 -0
- package/projects/documentation/src/app/services/doc-customize.service.ts +107 -0
- package/projects/documentation/src/app/utils/highlight.pipe.ts +43 -0
- package/projects/documentation/src/index.html +13 -0
- package/projects/documentation/src/main.server.ts +7 -0
- package/projects/documentation/src/main.ts +5 -0
- package/projects/documentation/src/server.ts +47 -0
- package/projects/documentation/src/styles.scss +7 -0
- package/projects/documentation/tsconfig.app.json +11 -0
- package/projects/documentation/tsconfig.spec.json +10 -0
- package/tsconfig.json +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,23 @@
|
|
|
1
|
+
import { DasarThemeProviderComponent, DasarButtonComponent, DasarCardComponent } from 'dasar-ui';
|
|
2
|
+
import { Component, inject, signal } from '@angular/core';
|
|
3
|
+
import { RouterOutlet } from '@angular/router';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { DocCustomizeService } from './services/doc-customize.service';
|
|
6
|
+
import { DocCustomizeModalComponent } from './components/doc-customize-modal.component';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
imports: [
|
|
10
|
+
CommonModule,
|
|
11
|
+
RouterOutlet,
|
|
12
|
+
DasarThemeProviderComponent,
|
|
13
|
+
DasarButtonComponent,
|
|
14
|
+
DasarCardComponent,
|
|
15
|
+
DocCustomizeModalComponent,
|
|
16
|
+
],
|
|
17
|
+
templateUrl: './app.html',
|
|
18
|
+
selector: 'app-root',
|
|
19
|
+
})
|
|
20
|
+
export class App {
|
|
21
|
+
protected readonly customize = inject(DocCustomizeService);
|
|
22
|
+
protected readonly customizeOpen = signal(false);
|
|
23
|
+
}
|
|
@@ -0,0 +1,314 @@
|
|
|
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>Theme</h3>
|
|
118
|
+
|
|
119
|
+
<div class="cm-color">
|
|
120
|
+
<span>Primary color</span>
|
|
121
|
+
<input
|
|
122
|
+
type="color"
|
|
123
|
+
[ngModel]="draft().primaryColor ?? '#2563eb'"
|
|
124
|
+
(ngModelChange)="set('primaryColor', $event)"
|
|
125
|
+
/>
|
|
126
|
+
<dasar-button appearance="subtle" (click)="set('primaryColor', null)">
|
|
127
|
+
Use default
|
|
128
|
+
</dasar-button>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<dasar-select
|
|
132
|
+
full-width
|
|
133
|
+
label="Base font size"
|
|
134
|
+
[dropdown-panel-style]="panelStyle"
|
|
135
|
+
[options]="fontSizeOptions"
|
|
136
|
+
[ngModel]="draft().fontSizeBase ?? sentinel"
|
|
137
|
+
(ngModelChange)="setOption('fontSizeBase', $event)"
|
|
138
|
+
></dasar-select>
|
|
139
|
+
|
|
140
|
+
<dasar-select
|
|
141
|
+
full-width
|
|
142
|
+
label="Font family"
|
|
143
|
+
[options]="fontOptions"
|
|
144
|
+
[dropdown-panel-style]="panelStyle"
|
|
145
|
+
[ngModel]="draft().fontSans ?? sentinel"
|
|
146
|
+
(ngModelChange)="setOption('fontSans', $event)"
|
|
147
|
+
></dasar-select>
|
|
148
|
+
</section>
|
|
149
|
+
|
|
150
|
+
<div action-slot style="display: flex; justify-content: space-between; align-items: center;">
|
|
151
|
+
<dasar-button appearance="outline" variant="secondary" (click)="resetDraft()">
|
|
152
|
+
Reset to defaults
|
|
153
|
+
</dasar-button>
|
|
154
|
+
<span class="cm-spacer"></span>
|
|
155
|
+
<div style="display: flex; gap: var(--space-base); align-items: center;">
|
|
156
|
+
<dasar-button appearance="outline" variant="secondary" (click)="cancel()">
|
|
157
|
+
Cancel
|
|
158
|
+
</dasar-button>
|
|
159
|
+
<dasar-button appearance="solid" (click)="apply()">Apply</dasar-button>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
</dasar-modal>
|
|
163
|
+
`,
|
|
164
|
+
styles: [
|
|
165
|
+
`
|
|
166
|
+
.cm-section {
|
|
167
|
+
display: flex;
|
|
168
|
+
flex-direction: column;
|
|
169
|
+
gap: 12px;
|
|
170
|
+
}
|
|
171
|
+
.cm-section + .cm-section {
|
|
172
|
+
margin-top: 20px;
|
|
173
|
+
}
|
|
174
|
+
h3 {
|
|
175
|
+
margin: 0;
|
|
176
|
+
font-size: 13px;
|
|
177
|
+
text-transform: uppercase;
|
|
178
|
+
color: var(--theme-text-secondary-color);
|
|
179
|
+
}
|
|
180
|
+
.cm-hint {
|
|
181
|
+
margin: 0;
|
|
182
|
+
font-size: 12px;
|
|
183
|
+
color: var(--theme-text-secondary-color);
|
|
184
|
+
}
|
|
185
|
+
.cm-color {
|
|
186
|
+
display: flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
gap: 12px;
|
|
189
|
+
font-size: 14px;
|
|
190
|
+
}
|
|
191
|
+
.cm-color span {
|
|
192
|
+
flex: 1;
|
|
193
|
+
}
|
|
194
|
+
.cm-color input[type='color'] {
|
|
195
|
+
width: 48px;
|
|
196
|
+
height: 32px;
|
|
197
|
+
padding: 2px;
|
|
198
|
+
border: 1px solid var(--theme-border-strong-color);
|
|
199
|
+
border-radius: 6px;
|
|
200
|
+
background: var(--theme-bg-default-color);
|
|
201
|
+
}
|
|
202
|
+
.cm-spacer {
|
|
203
|
+
flex: 1;
|
|
204
|
+
}
|
|
205
|
+
`,
|
|
206
|
+
],
|
|
207
|
+
})
|
|
208
|
+
export class DocCustomizeModalComponent implements OnChanges {
|
|
209
|
+
@Input() open = false;
|
|
210
|
+
@Output() closed = new EventEmitter<void>();
|
|
211
|
+
|
|
212
|
+
private customize = inject(DocCustomizeService);
|
|
213
|
+
readonly draft = signal<DocCustomizeSettings>({ ...DOC_DEFAULT_SETTINGS });
|
|
214
|
+
readonly sentinel = DEFAULT_SENTINEL;
|
|
215
|
+
readonly panelStyle = { 'z-index': '1100' };
|
|
216
|
+
|
|
217
|
+
readonly sizeOptions: DasarModalOption[] = [
|
|
218
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
219
|
+
{ label: 'XS', value: 'xs' },
|
|
220
|
+
{ label: 'SM', value: 'sm' },
|
|
221
|
+
{ label: 'MD', value: 'md' },
|
|
222
|
+
{ label: 'LG', value: 'lg' },
|
|
223
|
+
{ label: 'XL', value: 'xl' },
|
|
224
|
+
];
|
|
225
|
+
readonly radiusOptions: DasarModalOption[] = [
|
|
226
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
227
|
+
{ label: 'None', value: 'none' },
|
|
228
|
+
{ label: 'XS', value: 'xs' },
|
|
229
|
+
{ label: 'SM', value: 'sm' },
|
|
230
|
+
{ label: 'MD', value: 'md' },
|
|
231
|
+
{ label: 'LG', value: 'lg' },
|
|
232
|
+
{ label: 'XL', value: 'xl' },
|
|
233
|
+
{ label: 'Full', value: 'full' },
|
|
234
|
+
];
|
|
235
|
+
readonly buttonAppearanceOptions: DasarModalOption[] = [
|
|
236
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
237
|
+
{ label: 'Solid', value: 'solid' },
|
|
238
|
+
{ label: 'Subtle', value: 'subtle' },
|
|
239
|
+
{ label: 'Outline', value: 'outline' },
|
|
240
|
+
];
|
|
241
|
+
readonly inputAppearanceOptions: DasarModalOption[] = [
|
|
242
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
243
|
+
{ label: 'Outline', value: 'outline' },
|
|
244
|
+
{ label: 'Filled', value: 'filled' },
|
|
245
|
+
];
|
|
246
|
+
readonly cardAppearanceOptions: DasarModalOption[] = [
|
|
247
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
248
|
+
{ label: 'Outline', value: 'outline' },
|
|
249
|
+
{ label: 'Borderless', value: 'borderless' },
|
|
250
|
+
{ label: 'Elevated', value: 'elevated' },
|
|
251
|
+
];
|
|
252
|
+
readonly tabsAppearanceOptions: DasarModalOption[] = [
|
|
253
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
254
|
+
{ label: 'Solid', value: 'solid' },
|
|
255
|
+
{ label: 'Subtle', value: 'subtle' },
|
|
256
|
+
{ label: 'Outline', value: 'outline' },
|
|
257
|
+
];
|
|
258
|
+
readonly tabsSizeOptions: DasarModalOption[] = [
|
|
259
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
260
|
+
{ label: 'None', value: 'none' },
|
|
261
|
+
{ label: 'Xs', value: 'xs' },
|
|
262
|
+
{ label: 'Sm', value: 'sm' },
|
|
263
|
+
{ label: 'Md', value: 'md' },
|
|
264
|
+
{ label: 'Lg', value: 'lg' },
|
|
265
|
+
{ label: 'Xl', value: 'xl' },
|
|
266
|
+
{ label: 'Full', value: 'full' },
|
|
267
|
+
];
|
|
268
|
+
readonly tabsSpacingOptions: DasarModalOption[] = [
|
|
269
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
270
|
+
{ label: 'Normal', value: 'normal' },
|
|
271
|
+
{ label: 'Compact', value: 'compact' },
|
|
272
|
+
];
|
|
273
|
+
readonly fontSizeOptions: DasarModalOption[] = [
|
|
274
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
275
|
+
{ label: '12px', value: '12px' },
|
|
276
|
+
{ label: '13px', value: '13px' },
|
|
277
|
+
{ label: '14px', value: '14px' },
|
|
278
|
+
{ label: '15px', value: '15px' },
|
|
279
|
+
{ label: '16px', value: '16px' },
|
|
280
|
+
];
|
|
281
|
+
readonly fontOptions: DasarModalOption[] = [
|
|
282
|
+
{ label: 'Default', value: DEFAULT_SENTINEL },
|
|
283
|
+
{ label: 'System UI', value: 'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif' },
|
|
284
|
+
{ label: 'Serif', value: 'Georgia, "Times New Roman", serif' },
|
|
285
|
+
{ label: 'Monospace', value: 'Menlo, Monaco, "Courier New", monospace' },
|
|
286
|
+
];
|
|
287
|
+
|
|
288
|
+
ngOnChanges(changes: SimpleChanges) {
|
|
289
|
+
if (changes['open'] && this.open) {
|
|
290
|
+
this.draft.set({ ...this.customize.settings() });
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
set<K extends keyof DocCustomizeSettings>(key: K, value: DocCustomizeSettings[K]) {
|
|
295
|
+
this.draft.update((d) => ({ ...d, [key]: value }));
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
setOption<K extends keyof DocCustomizeSettings>(key: K, value: unknown) {
|
|
299
|
+
this.set(key, (value === DEFAULT_SENTINEL ? null : value) as DocCustomizeSettings[K]);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
resetDraft() {
|
|
303
|
+
this.draft.set({ ...DOC_DEFAULT_SETTINGS });
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
apply() {
|
|
307
|
+
this.customize.apply(this.draft());
|
|
308
|
+
this.closed.emit();
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
cancel() {
|
|
312
|
+
this.closed.emit();
|
|
313
|
+
}
|
|
314
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { DasarButtonComponent, DasarCardComponent } from 'dasar-ui';
|
|
2
|
+
import { Component, Input, signal } from '@angular/core';
|
|
3
|
+
import { HighlightPipe } from '../utils/highlight.pipe';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
|
|
6
|
+
interface DocExampleCodeOption {
|
|
7
|
+
lang: 'html' | 'typescript' | 'scss' | 'css';
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Component({
|
|
13
|
+
selector: 'doc-example-component',
|
|
14
|
+
standalone: true,
|
|
15
|
+
imports: [CommonModule, DasarCardComponent, HighlightPipe, DasarButtonComponent],
|
|
16
|
+
template: `
|
|
17
|
+
<dasar-card [label]="title" class="doc-example-card">
|
|
18
|
+
<dasar-card
|
|
19
|
+
extra-header-slot
|
|
20
|
+
fluid
|
|
21
|
+
appearance="outline"
|
|
22
|
+
[container-style]="{
|
|
23
|
+
overflow: 'hidden',
|
|
24
|
+
}"
|
|
25
|
+
>
|
|
26
|
+
<dasar-button
|
|
27
|
+
[variant]="mode() === 'preview' ? 'primary' : 'secondary'"
|
|
28
|
+
(click)="mode.set('preview')"
|
|
29
|
+
appearance="subtle"
|
|
30
|
+
radius="none"
|
|
31
|
+
size="sm"
|
|
32
|
+
>
|
|
33
|
+
Preview
|
|
34
|
+
</dasar-button>
|
|
35
|
+
@if (codes.length > 0) {
|
|
36
|
+
@for (codeItem of codes; track $index) {
|
|
37
|
+
<dasar-button
|
|
38
|
+
[variant]="mode() === 'code' && selectedCode() == codeItem ? 'primary' : 'secondary'"
|
|
39
|
+
(click)="codeClicked(codeItem)"
|
|
40
|
+
appearance="subtle"
|
|
41
|
+
radius="none"
|
|
42
|
+
size="sm"
|
|
43
|
+
>
|
|
44
|
+
{{ codeItem.label }}
|
|
45
|
+
</dasar-button>
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</dasar-card>
|
|
49
|
+
<div class="preview-area" [class.hidden]="mode() !== 'preview'" [ngStyle]="previewStyle">
|
|
50
|
+
<ng-content></ng-content>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="code-area" [class.hidden]="mode() !== 'code'">
|
|
53
|
+
@if (selectedCode() != null) {
|
|
54
|
+
<div class="code-header">
|
|
55
|
+
<div class="code-lang-badge">
|
|
56
|
+
<span class="lang-text">{{ selectedCode()?.lang | uppercase }}</span>
|
|
57
|
+
</div>
|
|
58
|
+
<button class="copy-btn" (click)="copyCode(selectedCode())" [class.copied]="isCopied()">
|
|
59
|
+
{{ isCopied() ? 'Copied!' : 'Copy' }}
|
|
60
|
+
</button>
|
|
61
|
+
</div>
|
|
62
|
+
@if (selectedCode()?.value != null && selectedCode()?.lang != null) {
|
|
63
|
+
<div class="code-content">
|
|
64
|
+
<pre><code
|
|
65
|
+
[class]="'language-' + selectedCode()?.lang"
|
|
66
|
+
[innerHTML]="selectedCode()!.value | highlight:selectedCode()!.lang"
|
|
67
|
+
></code></pre>
|
|
68
|
+
</div>
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</div>
|
|
72
|
+
</dasar-card>
|
|
73
|
+
`,
|
|
74
|
+
styles: [
|
|
75
|
+
`
|
|
76
|
+
.doc-example-card {
|
|
77
|
+
display: block;
|
|
78
|
+
margin-bottom: var(--space-8);
|
|
79
|
+
}
|
|
80
|
+
.example-toolbar {
|
|
81
|
+
display: flex;
|
|
82
|
+
justify-content: space-between;
|
|
83
|
+
align-items: flex-start;
|
|
84
|
+
gap: var(--space-4);
|
|
85
|
+
margin-bottom: var(--space-6);
|
|
86
|
+
padding-bottom: var(--space-4);
|
|
87
|
+
border-bottom: 1px solid var(--theme-border-subtle-color);
|
|
88
|
+
}
|
|
89
|
+
.example-desc p {
|
|
90
|
+
margin: 0;
|
|
91
|
+
color: var(--theme-text-secondary-color);
|
|
92
|
+
line-height: 1.5;
|
|
93
|
+
}
|
|
94
|
+
.segmented-control {
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-shrink: 0;
|
|
97
|
+
gap: var(--space-1);
|
|
98
|
+
background: var(--theme-bg-hover-color);
|
|
99
|
+
padding: var(--space-1);
|
|
100
|
+
border-radius: var(--radius-sm);
|
|
101
|
+
border: 1px solid var(--theme-border-subtle-color);
|
|
102
|
+
}
|
|
103
|
+
.preview-area {
|
|
104
|
+
width: 100%;
|
|
105
|
+
}
|
|
106
|
+
.code-area {
|
|
107
|
+
background: #1e1e1e;
|
|
108
|
+
border-radius: var(--radius-md);
|
|
109
|
+
border: 1px solid var(--theme-border-subtle-color);
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
}
|
|
114
|
+
.code-header {
|
|
115
|
+
display: flex;
|
|
116
|
+
justify-content: space-between;
|
|
117
|
+
align-items: center;
|
|
118
|
+
background: #2d2d2d;
|
|
119
|
+
padding: var(--space-base);
|
|
120
|
+
border-bottom: 1px solid #404040;
|
|
121
|
+
}
|
|
122
|
+
.code-lang-badge {
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
|
|
126
|
+
gap: var(--space-2);
|
|
127
|
+
}
|
|
128
|
+
.lang-text {
|
|
129
|
+
color: #9cdcfe;
|
|
130
|
+
font-family: var(--font-sans);
|
|
131
|
+
font-weight: 600;
|
|
132
|
+
letter-spacing: 0.05em;
|
|
133
|
+
margin-left: var(--space-2);
|
|
134
|
+
}
|
|
135
|
+
.copy-btn {
|
|
136
|
+
background: transparent;
|
|
137
|
+
border: 1px solid #555;
|
|
138
|
+
color: #cccccc;
|
|
139
|
+
padding: 4px 12px;
|
|
140
|
+
border-radius: var(--radius-xs);
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
font-family: var(--font-sans);
|
|
143
|
+
}
|
|
144
|
+
.copy-btn:hover {
|
|
145
|
+
background: #444;
|
|
146
|
+
color: #ffffff;
|
|
147
|
+
}
|
|
148
|
+
.copy-btn.copied {
|
|
149
|
+
background: var(--theme-success-color);
|
|
150
|
+
border-color: var(--theme-success-color);
|
|
151
|
+
color: #ffffff;
|
|
152
|
+
}
|
|
153
|
+
.code-content {
|
|
154
|
+
padding: var(--space-base);
|
|
155
|
+
overflow-x: auto;
|
|
156
|
+
}
|
|
157
|
+
.code-content pre {
|
|
158
|
+
margin: 0;
|
|
159
|
+
}
|
|
160
|
+
.code-content code {
|
|
161
|
+
font-family: 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace;
|
|
162
|
+
color: #d4d4d4;
|
|
163
|
+
line-height: 1.6;
|
|
164
|
+
white-space: pre-wrap;
|
|
165
|
+
}
|
|
166
|
+
.hidden {
|
|
167
|
+
display: none !important;
|
|
168
|
+
}
|
|
169
|
+
`,
|
|
170
|
+
],
|
|
171
|
+
})
|
|
172
|
+
export class DocExampleComponent {
|
|
173
|
+
@Input() previewStyle: Record<string, any> = {};
|
|
174
|
+
@Input() codes: DocExampleCodeOption[] = [];
|
|
175
|
+
@Input() description = '';
|
|
176
|
+
@Input() title = '';
|
|
177
|
+
|
|
178
|
+
selectedCode = signal<DocExampleCodeOption | null>(null);
|
|
179
|
+
mode = signal<'preview' | 'code'>('preview');
|
|
180
|
+
isCopied = signal<boolean>(false);
|
|
181
|
+
|
|
182
|
+
codeClicked(item: DocExampleCodeOption) {
|
|
183
|
+
this.mode.set('code');
|
|
184
|
+
this.selectedCode.set(item);
|
|
185
|
+
}
|
|
186
|
+
copyCode(item: DocExampleCodeOption | null) {
|
|
187
|
+
if (!item) return;
|
|
188
|
+
navigator.clipboard.writeText(item.value).then(() => {
|
|
189
|
+
this.isCopied.set(true);
|
|
190
|
+
setTimeout(() => {
|
|
191
|
+
this.isCopied.set(false);
|
|
192
|
+
}, 1000);
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
|
|
2
|
+
import { provideServerRendering, withRoutes } from '@angular/ssr';
|
|
3
|
+
import { serverRoutes } from '../routes/app.routes.server';
|
|
4
|
+
import { appConfig } from './app.config';
|
|
5
|
+
|
|
6
|
+
const serverConfig: ApplicationConfig = {
|
|
7
|
+
providers: [provideServerRendering(withRoutes(serverRoutes))],
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const config = mergeApplicationConfig(appConfig, serverConfig);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core';
|
|
2
|
+
import { provideRouter } from '@angular/router';
|
|
3
|
+
|
|
4
|
+
import { routes } from '../routes/app.routes';
|
|
5
|
+
import { provideClientHydration } from '@angular/platform-browser';
|
|
6
|
+
|
|
7
|
+
import { registerLocaleData } from '@angular/common';
|
|
8
|
+
import localeId from '@angular/common/locales/id';
|
|
9
|
+
registerLocaleData(localeId, 'id-ID');
|
|
10
|
+
|
|
11
|
+
export const appConfig: ApplicationConfig = {
|
|
12
|
+
providers: [
|
|
13
|
+
provideBrowserGlobalErrorListeners(),
|
|
14
|
+
provideRouter(routes),
|
|
15
|
+
provideClientHydration(),
|
|
16
|
+
],
|
|
17
|
+
};
|