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
|
@@ -1,62 +1,61 @@
|
|
|
1
|
-
// Fonts
|
|
2
1
|
$dasar-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
3
2
|
$dasar-font-hero: 'Space Grotesk', sans-serif;
|
|
4
|
-
|
|
3
|
+
|
|
5
4
|
$dasar-font-weight-thin: 300;
|
|
6
5
|
$dasar-font-weight-regular: 400;
|
|
7
6
|
$dasar-font-weight-medium: 500;
|
|
8
7
|
$dasar-font-weight-semibold: 600;
|
|
9
8
|
$dasar-font-weight-bold: 700;
|
|
10
|
-
|
|
11
|
-
$dasar-text-xss: 0.5rem;
|
|
12
|
-
$dasar-text-xs: 0.625rem;
|
|
13
|
-
$dasar-text-sm: 0.75rem;
|
|
14
|
-
$dasar-text-base: 0.875rem;
|
|
15
|
-
$dasar-text-lg: 1rem;
|
|
16
|
-
$dasar-text-xl: 1.125rem;
|
|
9
|
+
|
|
10
|
+
$dasar-text-xss: 0.5rem;
|
|
11
|
+
$dasar-text-xs: 0.625rem;
|
|
12
|
+
$dasar-text-sm: 0.75rem;
|
|
13
|
+
$dasar-text-base: 0.875rem;
|
|
14
|
+
$dasar-text-lg: 1rem;
|
|
15
|
+
$dasar-text-xl: 1.125rem;
|
|
17
16
|
$dasar-line-height-normal: 1.5;
|
|
18
17
|
$dasar-line-height-tight: 1.25;
|
|
19
|
-
|
|
20
|
-
$breakpoint-sm: 40em;
|
|
21
|
-
$breakpoint-md: 48em;
|
|
22
|
-
$breakpoint-lg: 64em;
|
|
23
|
-
$breakpoint-xl: 75em;
|
|
24
|
-
|
|
18
|
+
|
|
19
|
+
$breakpoint-sm: 40em;
|
|
20
|
+
$breakpoint-md: 48em;
|
|
21
|
+
$breakpoint-lg: 64em;
|
|
22
|
+
$breakpoint-xl: 75em;
|
|
23
|
+
|
|
25
24
|
$dasar-radius-none: 0;
|
|
26
|
-
$dasar-radius-xxs: 0.125em;
|
|
27
|
-
$dasar-radius-xs: 0.25em;
|
|
28
|
-
$dasar-radius-sm: 0.375em;
|
|
29
|
-
$dasar-radius-md: 0.5em;
|
|
30
|
-
$dasar-radius-lg: 0.625em;
|
|
31
|
-
$dasar-radius-xl: 0.75em;
|
|
32
|
-
$dasar-radius-2xl: 1em;
|
|
33
|
-
$dasar-radius-3xl: 1.25em;
|
|
34
|
-
$dasar-radius-4xl: 1.5em;
|
|
35
|
-
$dasar-radius-full: 9999px;
|
|
36
|
-
|
|
25
|
+
$dasar-radius-xxs: 0.125em;
|
|
26
|
+
$dasar-radius-xs: 0.25em;
|
|
27
|
+
$dasar-radius-sm: 0.375em;
|
|
28
|
+
$dasar-radius-md: 0.5em;
|
|
29
|
+
$dasar-radius-lg: 0.625em;
|
|
30
|
+
$dasar-radius-xl: 0.75em;
|
|
31
|
+
$dasar-radius-2xl: 1em;
|
|
32
|
+
$dasar-radius-3xl: 1.25em;
|
|
33
|
+
$dasar-radius-4xl: 1.5em;
|
|
34
|
+
$dasar-radius-full: 9999px;
|
|
35
|
+
|
|
37
36
|
$dasar-space-0: 0;
|
|
38
|
-
$dasar-space-0-5: 0.125em;
|
|
39
|
-
$dasar-space-1: 0.25em;
|
|
40
|
-
$dasar-space-base: 0.5em;
|
|
41
|
-
$dasar-space-3: 0.75em;
|
|
42
|
-
$dasar-space-4: 1em;
|
|
43
|
-
$dasar-space-5: 1.25em;
|
|
44
|
-
$dasar-space-6: 1.5em;
|
|
45
|
-
$dasar-space-8: 2em;
|
|
46
|
-
$dasar-space-10: 2.5em;
|
|
47
|
-
$dasar-space-12: 3em;
|
|
48
|
-
$dasar-space-16: 4em;
|
|
49
|
-
$dasar-space-18: 5em;
|
|
50
|
-
$dasar-space-24: 6em;
|
|
51
|
-
$dasar-space-32: 8em;
|
|
52
|
-
$dasar-space-40: 10em;
|
|
53
|
-
$dasar-space-48: 12em;
|
|
54
|
-
$dasar-space-56: 14em;
|
|
55
|
-
$dasar-space-64: 16em;
|
|
56
|
-
$dasar-space-80: 20em;
|
|
57
|
-
$dasar-space-96: 24em;
|
|
58
|
-
$dasar-space-120: 30em;
|
|
59
|
-
|
|
37
|
+
$dasar-space-0-5: 0.125em;
|
|
38
|
+
$dasar-space-1: 0.25em;
|
|
39
|
+
$dasar-space-base: 0.5em;
|
|
40
|
+
$dasar-space-3: 0.75em;
|
|
41
|
+
$dasar-space-4: 1em;
|
|
42
|
+
$dasar-space-5: 1.25em;
|
|
43
|
+
$dasar-space-6: 1.5em;
|
|
44
|
+
$dasar-space-8: 2em;
|
|
45
|
+
$dasar-space-10: 2.5em;
|
|
46
|
+
$dasar-space-12: 3em;
|
|
47
|
+
$dasar-space-16: 4em;
|
|
48
|
+
$dasar-space-18: 5em;
|
|
49
|
+
$dasar-space-24: 6em;
|
|
50
|
+
$dasar-space-32: 8em;
|
|
51
|
+
$dasar-space-40: 10em;
|
|
52
|
+
$dasar-space-48: 12em;
|
|
53
|
+
$dasar-space-56: 14em;
|
|
54
|
+
$dasar-space-64: 16em;
|
|
55
|
+
$dasar-space-80: 20em;
|
|
56
|
+
$dasar-space-96: 24em;
|
|
57
|
+
$dasar-space-120: 30em;
|
|
58
|
+
|
|
60
59
|
$dasar-primary-900: #071727;
|
|
61
60
|
$dasar-primary-800: #0d253f;
|
|
62
61
|
$dasar-primary-700: #12345a;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const dasarVariables = {
|
|
2
|
+
font: {
|
|
3
|
+
sans: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
|
|
4
|
+
hero: "'Space Grotesk', sans-serif",
|
|
5
|
+
},
|
|
6
|
+
fontWeight: {
|
|
7
|
+
thin: '300',
|
|
8
|
+
regular: '400',
|
|
9
|
+
medium: '500',
|
|
10
|
+
semibold: '600',
|
|
11
|
+
bold: '700',
|
|
12
|
+
},
|
|
13
|
+
fontSize: {
|
|
14
|
+
xss: '0.5rem',
|
|
15
|
+
xs: '0.625rem',
|
|
16
|
+
sm: '0.75rem',
|
|
17
|
+
base: '0.875rem',
|
|
18
|
+
lg: '1rem',
|
|
19
|
+
xl: '1.125rem',
|
|
20
|
+
},
|
|
21
|
+
lineHeight: {
|
|
22
|
+
normal: '1.5',
|
|
23
|
+
tight: '1.25',
|
|
24
|
+
},
|
|
25
|
+
colors: {
|
|
26
|
+
primary: {
|
|
27
|
+
900: '#071727',
|
|
28
|
+
800: '#0d253f',
|
|
29
|
+
700: '#12345a',
|
|
30
|
+
base: '#1b4d8e',
|
|
31
|
+
500: '#2563eb',
|
|
32
|
+
300: '#60a5fa',
|
|
33
|
+
200: '#a2cafa',
|
|
34
|
+
100: '#bfdbfe',
|
|
35
|
+
50: '#eff6ff',
|
|
36
|
+
},
|
|
37
|
+
neutral: {
|
|
38
|
+
900: '#111827',
|
|
39
|
+
800: '#1f2937',
|
|
40
|
+
700: '#374151',
|
|
41
|
+
base: '#4b5563',
|
|
42
|
+
500: '#6b7280',
|
|
43
|
+
400: '#9ca3af',
|
|
44
|
+
300: '#d1d5db',
|
|
45
|
+
200: '#eaecf0',
|
|
46
|
+
100: '#f3f4f6',
|
|
47
|
+
50: '#ffffff',
|
|
48
|
+
},
|
|
49
|
+
success: { base: '#059669', 50: '#ecfdf5' },
|
|
50
|
+
danger: { base: '#dc2626', 50: '#fef2f2' },
|
|
51
|
+
warning: { base: '#d97706', 50: '#fffbeb' },
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const dasarVariablesTypography = {
|
|
56
|
+
fontSans: dasarVariables.font.sans,
|
|
57
|
+
fontHero: dasarVariables.font.hero,
|
|
58
|
+
fontWeightRegular: dasarVariables.fontWeight.regular,
|
|
59
|
+
fontWeightMedium: dasarVariables.fontWeight.medium,
|
|
60
|
+
fontWeightSemibold: dasarVariables.fontWeight.semibold,
|
|
61
|
+
fontWeightBold: dasarVariables.fontWeight.bold,
|
|
62
|
+
fontSizeXss: dasarVariables.fontSize.xss,
|
|
63
|
+
fontSizeXs: dasarVariables.fontSize.xs,
|
|
64
|
+
fontSizeSm: dasarVariables.fontSize.sm,
|
|
65
|
+
fontSizeBase: dasarVariables.fontSize.base,
|
|
66
|
+
fontSizeLg: dasarVariables.fontSize.lg,
|
|
67
|
+
fontSizeXl: dasarVariables.fontSize.xl,
|
|
68
|
+
lineHeightNormal: dasarVariables.lineHeight.normal,
|
|
69
|
+
lineHeightTight: dasarVariables.lineHeight.tight,
|
|
70
|
+
};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { DasarThemeProviderComponent } from '../components/dasar-theme-provider/dasar-theme-provider';
|
|
2
|
+
import { DasarThemeService } from '../services/theme.service';
|
|
3
|
+
import { DasarComponentCommonConfig, DasarComponentConfig } from '../models/theme.model';
|
|
4
|
+
import { ClassType } from '../models/type.model';
|
|
5
|
+
|
|
6
|
+
export function parseClassesToArray(classes: ClassType): string[] {
|
|
7
|
+
if (!classes) {
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
if (typeof classes === 'string') {
|
|
11
|
+
return classes.split(/\s+/).filter(Boolean);
|
|
12
|
+
}
|
|
13
|
+
if (Array.isArray(classes)) {
|
|
14
|
+
return classes.flatMap((c) => c.split(/\s+/).filter(Boolean));
|
|
15
|
+
}
|
|
16
|
+
if (classes instanceof Set) {
|
|
17
|
+
return Array.from(classes).flatMap((c) => c.split(/\s+/).filter(Boolean));
|
|
18
|
+
}
|
|
19
|
+
if (typeof classes === 'object') {
|
|
20
|
+
return Object.entries(classes)
|
|
21
|
+
.filter(([_, condition]) => Boolean(condition))
|
|
22
|
+
.map(([className]) => className)
|
|
23
|
+
.flatMap((c) => c.split(/\s+/).filter(Boolean));
|
|
24
|
+
}
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
export function safeFormat(date: Date, format: string, locale: string): string {
|
|
28
|
+
if (!date || isNaN(date.getTime())) return '';
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
const year = date.getFullYear().toString();
|
|
32
|
+
const month = date.getMonth() + 1;
|
|
33
|
+
const day = date.getDate();
|
|
34
|
+
const hours = date.getHours();
|
|
35
|
+
const minutes = date.getMinutes();
|
|
36
|
+
const seconds = date.getSeconds();
|
|
37
|
+
|
|
38
|
+
const pad = (num: number) => num.toString().padStart(2, '0');
|
|
39
|
+
|
|
40
|
+
const getIntl = (opts: Intl.DateTimeFormatOptions) => {
|
|
41
|
+
try {
|
|
42
|
+
return new Intl.DateTimeFormat(locale, opts).format(date);
|
|
43
|
+
} catch {
|
|
44
|
+
return '';
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const tokens: Record<string, string> = {
|
|
49
|
+
YYYY: year,
|
|
50
|
+
yyyy: year,
|
|
51
|
+
YY: year.slice(-2),
|
|
52
|
+
yy: year.slice(-2),
|
|
53
|
+
|
|
54
|
+
MMMM: getIntl({ month: 'long' }),
|
|
55
|
+
LLLL: getIntl({ month: 'long' }),
|
|
56
|
+
MMM: getIntl({ month: 'short' }),
|
|
57
|
+
|
|
58
|
+
MM: pad(month),
|
|
59
|
+
M: month.toString(),
|
|
60
|
+
|
|
61
|
+
DD: pad(day),
|
|
62
|
+
dd: pad(day),
|
|
63
|
+
D: day.toString(),
|
|
64
|
+
d: day.toString(),
|
|
65
|
+
|
|
66
|
+
dddd: getIntl({ weekday: 'long' }),
|
|
67
|
+
ddd: getIntl({ weekday: 'short' }),
|
|
68
|
+
EEEE: getIntl({ weekday: 'long' }),
|
|
69
|
+
EEE: getIntl({ weekday: 'short' }),
|
|
70
|
+
EEEEE: getIntl({ weekday: 'narrow' }),
|
|
71
|
+
|
|
72
|
+
HH: pad(hours),
|
|
73
|
+
H: hours.toString(),
|
|
74
|
+
hh: pad(hours % 12 || 12),
|
|
75
|
+
h: (hours % 12 || 12).toString(),
|
|
76
|
+
mm: pad(minutes),
|
|
77
|
+
m: minutes.toString(),
|
|
78
|
+
ss: pad(seconds),
|
|
79
|
+
s: seconds.toString(),
|
|
80
|
+
|
|
81
|
+
A: hours >= 12 ? 'PM' : 'AM',
|
|
82
|
+
a: hours >= 12 ? 'pm' : 'am',
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const regex = new RegExp(
|
|
86
|
+
Object.keys(tokens)
|
|
87
|
+
.sort((a, b) => b.length - a.length)
|
|
88
|
+
.join('|'),
|
|
89
|
+
'g',
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
return format.replace(regex, (match) => tokens[match] || match);
|
|
93
|
+
} catch (e) {
|
|
94
|
+
return new Intl.DateTimeFormat(locale || 'en-US').format(date);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
export function parseFormattedStringIntoDate(value: string, format: string): Date | null {
|
|
98
|
+
try {
|
|
99
|
+
let regexStr = format
|
|
100
|
+
.replace('yyyy', '(?<year>\\d{4})')
|
|
101
|
+
.replace('MM', '(?<month>\\d{2})')
|
|
102
|
+
.replace('dd', '(?<day>\\d{2})')
|
|
103
|
+
.replace('HH', '(?<hour>\\d{2})')
|
|
104
|
+
.replace('mm', '(?<minute>\\d{2})')
|
|
105
|
+
.replace('ss', '(?<second>\\d{2})');
|
|
106
|
+
|
|
107
|
+
const match = value.match(new RegExp(`^${regexStr}$`));
|
|
108
|
+
|
|
109
|
+
if (match && match.groups) {
|
|
110
|
+
const year = parseInt(match.groups['year'], 10);
|
|
111
|
+
const month = parseInt(match.groups['month'], 10) - 1;
|
|
112
|
+
const day = parseInt(match.groups['day'], 10);
|
|
113
|
+
|
|
114
|
+
const hour = match.groups['hour'] ? parseInt(match.groups['hour'], 10) : 0;
|
|
115
|
+
const min = match.groups['minute'] ? parseInt(match.groups['minute'], 10) : 0;
|
|
116
|
+
const sec = match.groups['second'] ? parseInt(match.groups['second'], 10) : 0;
|
|
117
|
+
|
|
118
|
+
const parsedDate = new Date(year, month, day, hour, min, sec);
|
|
119
|
+
if (!isNaN(parsedDate.getTime())) return parsedDate;
|
|
120
|
+
}
|
|
121
|
+
} catch (e) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
export function resolveThemeDefault<
|
|
127
|
+
T,
|
|
128
|
+
C extends keyof DasarComponentConfig,
|
|
129
|
+
K extends keyof NonNullable<DasarComponentConfig[C]>,
|
|
130
|
+
>(
|
|
131
|
+
componentKey: C,
|
|
132
|
+
propKey: K,
|
|
133
|
+
fallback: NonNullable<NonNullable<DasarComponentConfig[C]>[K]> | T,
|
|
134
|
+
provider: DasarThemeProviderComponent | null,
|
|
135
|
+
service: DasarThemeService | null,
|
|
136
|
+
): NonNullable<NonNullable<DasarComponentConfig[C]>[K]> | T {
|
|
137
|
+
const providerConfig = provider?.componentConfig as any;
|
|
138
|
+
const serviceConfig = service?.rawThemeVariable()?.components as any;
|
|
139
|
+
|
|
140
|
+
if (providerConfig?.[componentKey]?.[propKey] !== undefined) {
|
|
141
|
+
return providerConfig[componentKey]![propKey] as any;
|
|
142
|
+
}
|
|
143
|
+
if (serviceConfig?.[componentKey]?.[propKey] !== undefined) {
|
|
144
|
+
return serviceConfig[componentKey]![propKey] as any;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const commonKey = propKey as unknown as keyof DasarComponentCommonConfig;
|
|
148
|
+
if (providerConfig?.common?.[commonKey] !== undefined) {
|
|
149
|
+
return providerConfig.common[commonKey] as any;
|
|
150
|
+
}
|
|
151
|
+
if (serviceConfig?.common?.[commonKey] !== undefined) {
|
|
152
|
+
return serviceConfig.common[commonKey] as any;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return fallback;
|
|
156
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { fieldIconSize } from './icon-size';
|
|
2
|
+
|
|
3
|
+
describe('fieldIconSize', () => {
|
|
4
|
+
it('scales down for small controls', () => {
|
|
5
|
+
expect(fieldIconSize('xs')).toBe(12);
|
|
6
|
+
expect(fieldIconSize('sm')).toBe(14);
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it('uses the field friendly default for md', () => {
|
|
10
|
+
expect(fieldIconSize('md')).toBe(16);
|
|
11
|
+
expect(fieldIconSize(undefined)).toBe(16);
|
|
12
|
+
expect(fieldIconSize(null)).toBe(16);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('scales up for large controls', () => {
|
|
16
|
+
expect(fieldIconSize('lg')).toBe(20);
|
|
17
|
+
expect(fieldIconSize('xl')).toBe(24);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('passes a numeric size through', () => {
|
|
21
|
+
expect(fieldIconSize(18)).toBe(18);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function fieldIconSize(size: string | number | null | undefined): number {
|
|
2
|
+
switch (size) {
|
|
3
|
+
case 'xs':
|
|
4
|
+
return 12;
|
|
5
|
+
case 'sm':
|
|
6
|
+
return 14;
|
|
7
|
+
case 'lg':
|
|
8
|
+
return 20;
|
|
9
|
+
case 'xl':
|
|
10
|
+
return 24;
|
|
11
|
+
case 'md':
|
|
12
|
+
return 16;
|
|
13
|
+
default:
|
|
14
|
+
return typeof size === 'number' ? size : 16;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { computeSmartPlacement, DasarPanelPlacement } from './panel-placement';
|
|
2
|
+
|
|
3
|
+
interface FakeRect {
|
|
4
|
+
top: number;
|
|
5
|
+
bottom: number;
|
|
6
|
+
left: number;
|
|
7
|
+
right: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function rect(partial: Partial<FakeRect>): { getBoundingClientRect: () => FakeRect } {
|
|
13
|
+
const value: FakeRect = {
|
|
14
|
+
top: 0,
|
|
15
|
+
bottom: 0,
|
|
16
|
+
left: 0,
|
|
17
|
+
right: 0,
|
|
18
|
+
width: 0,
|
|
19
|
+
height: 0,
|
|
20
|
+
...partial,
|
|
21
|
+
};
|
|
22
|
+
return { getBoundingClientRect: () => value };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
describe('computeSmartPlacement', () => {
|
|
26
|
+
const originalInnerHeight = window.innerHeight;
|
|
27
|
+
const originalInnerWidth = window.innerWidth;
|
|
28
|
+
|
|
29
|
+
afterAll(() => {
|
|
30
|
+
Object.defineProperty(window, 'innerHeight', {
|
|
31
|
+
value: originalInnerHeight,
|
|
32
|
+
configurable: true,
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(window, 'innerWidth', { value: originalInnerWidth, configurable: true });
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
function setViewport(width: number, height: number) {
|
|
38
|
+
Object.defineProperty(window, 'innerHeight', { value: height, configurable: true });
|
|
39
|
+
Object.defineProperty(window, 'innerWidth', { value: width, configurable: true });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
it('keeps the preferred placement when there is room below', () => {
|
|
43
|
+
setViewport(1024, 800);
|
|
44
|
+
const trigger = rect({ top: 100, bottom: 132, left: 100, right: 300 });
|
|
45
|
+
const panel = rect({ width: 200, height: 240 });
|
|
46
|
+
|
|
47
|
+
expect(computeSmartPlacement(trigger, panel, 'bottom-start')).toBe('bottom-start');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('flips to top when there is not enough room below', () => {
|
|
51
|
+
setViewport(1024, 300);
|
|
52
|
+
const trigger = rect({ top: 240, bottom: 272, left: 100, right: 300 });
|
|
53
|
+
const panel = rect({ width: 200, height: 240 });
|
|
54
|
+
|
|
55
|
+
expect(computeSmartPlacement(trigger, panel, 'bottom-start')).toBe('top-start');
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('flips to bottom when there is not enough room above', () => {
|
|
59
|
+
setViewport(1024, 800);
|
|
60
|
+
const trigger = rect({ top: 4, bottom: 36, left: 100, right: 300 });
|
|
61
|
+
const panel = rect({ width: 200, height: 240 });
|
|
62
|
+
|
|
63
|
+
expect(computeSmartPlacement(trigger, panel, 'top-start')).toBe('bottom-start');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('flips horizontally when the preferred side is too narrow', () => {
|
|
67
|
+
setViewport(1024, 800);
|
|
68
|
+
const trigger = rect({ top: 100, bottom: 132, left: 900, right: 1000 });
|
|
69
|
+
const panel = rect({ width: 300, height: 200 });
|
|
70
|
+
|
|
71
|
+
expect(computeSmartPlacement(trigger, panel, 'bottom-start')).toBe('bottom-end');
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('flips vertically and horizontally at the same time', () => {
|
|
75
|
+
setViewport(800, 300);
|
|
76
|
+
const trigger = rect({ top: 250, bottom: 282, left: 700, right: 790 });
|
|
77
|
+
const panel = rect({ width: 300, height: 240 });
|
|
78
|
+
|
|
79
|
+
expect(computeSmartPlacement(trigger, panel, 'bottom-start')).toBe('top-end');
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('keeps the preferred placement when neither side has room', () => {
|
|
83
|
+
setViewport(1024, 400);
|
|
84
|
+
const trigger = rect({ top: 184, bottom: 216, left: 400, right: 600 });
|
|
85
|
+
const panel = rect({ width: 200, height: 300 });
|
|
86
|
+
|
|
87
|
+
const result: DasarPanelPlacement = computeSmartPlacement(trigger, panel, 'bottom-start');
|
|
88
|
+
expect(result).toBe('bottom-start');
|
|
89
|
+
});
|
|
90
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type DasarPanelPlacement = 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end';
|
|
2
|
+
|
|
3
|
+
export type DasarPlacementRect = Pick<
|
|
4
|
+
DOMRect,
|
|
5
|
+
'top' | 'bottom' | 'left' | 'right' | 'width' | 'height'
|
|
6
|
+
>;
|
|
7
|
+
|
|
8
|
+
export interface DasarPlacementTarget {
|
|
9
|
+
getBoundingClientRect(): DasarPlacementRect;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function computeSmartPlacement(
|
|
13
|
+
trigger: DasarPlacementTarget,
|
|
14
|
+
panel: DasarPlacementTarget,
|
|
15
|
+
preferred: DasarPanelPlacement,
|
|
16
|
+
margin = 8,
|
|
17
|
+
): DasarPanelPlacement {
|
|
18
|
+
if (typeof window === 'undefined') {
|
|
19
|
+
return preferred;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const triggerRect = trigger.getBoundingClientRect();
|
|
23
|
+
const panelRect = panel.getBoundingClientRect();
|
|
24
|
+
const [preferredVertical, preferredHorizontal] = preferred.split('-') as [
|
|
25
|
+
'bottom' | 'top',
|
|
26
|
+
'start' | 'end',
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
let vertical = preferredVertical;
|
|
30
|
+
let horizontal = preferredHorizontal;
|
|
31
|
+
|
|
32
|
+
const spaceBelow = window.innerHeight - triggerRect.bottom;
|
|
33
|
+
const spaceAbove = triggerRect.top;
|
|
34
|
+
const requiredVertical = panelRect.height + margin;
|
|
35
|
+
|
|
36
|
+
if (vertical === 'bottom' && spaceBelow < requiredVertical && spaceAbove > spaceBelow) {
|
|
37
|
+
vertical = 'top';
|
|
38
|
+
} else if (vertical === 'top' && spaceAbove < requiredVertical && spaceBelow > spaceAbove) {
|
|
39
|
+
vertical = 'bottom';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const spaceRight = window.innerWidth - triggerRect.left;
|
|
43
|
+
const spaceLeft = triggerRect.right;
|
|
44
|
+
const requiredHorizontal = panelRect.width + margin;
|
|
45
|
+
|
|
46
|
+
if (horizontal === 'start' && spaceRight < requiredHorizontal && spaceLeft > spaceRight) {
|
|
47
|
+
horizontal = 'end';
|
|
48
|
+
} else if (horizontal === 'end' && spaceLeft < requiredHorizontal && spaceRight > spaceLeft) {
|
|
49
|
+
horizontal = 'start';
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return `${vertical}-${horizontal}` as DasarPanelPlacement;
|
|
53
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export * from './lib/components/dasar-button-group/dasar-button-group';
|
|
2
|
+
export * from './lib/components/dasar-number-input/dasar-number-input';
|
|
3
|
+
export * from './lib/components/dasar-pagination/dasar-pagination';
|
|
4
|
+
export * from './lib/components/dasar-textarea/dasar-textarea';
|
|
5
|
+
export * from './lib/components/dasar-table/dasar-table';
|
|
6
|
+
export * from './lib/components/dasar-menu/dasar-menu';
|
|
7
|
+
export * from './lib/components/dasar-tabs/dasar-tabs';
|
|
8
|
+
export * from './lib/components/dasar-pivot-table/dasar-pivot-table';
|
|
9
|
+
export * from './lib/components/dasar-datepicker/dasar-datepicker';
|
|
10
|
+
export * from './lib/components/dasar-calendar/dasar-calendar';
|
|
11
|
+
export * from './lib/components/dasar-select/dasar-select';
|
|
12
|
+
export * from './lib/components/dasar-icon/dasar-icon';
|
|
13
|
+
export * from './lib/components/dasar-card/dasar-card';
|
|
14
|
+
export * from './lib/components/dasar-chip/dasar-chip';
|
|
15
|
+
export * from './lib/components/dasar-input/dasar-input';
|
|
16
|
+
export * from './lib/components/dasar-modal/dasar-modal';
|
|
17
|
+
export * from './lib/components/dasar-overlay/dasar-overlay';
|
|
18
|
+
export * from './lib/components/dasar-theme-provider/dasar-theme-provider';
|
|
19
|
+
export * from './lib/components/dasar-button/dasar-button';
|
|
20
|
+
export * from './lib/services/theme.service';
|
|
21
|
+
export * from './lib/utils/panel-placement';
|
|
22
|
+
export * from './lib/utils/icon-size';
|
|
23
|
+
export * from './lib/models/theme.model';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "../../tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../../out-tsc/lib",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"paths": {
|
|
9
|
+
"@components/*": ["./src/lib/components/*"],
|
|
10
|
+
"@services/*": ["./src/lib/services/*"],
|
|
11
|
+
"@models/*": ["./src/lib/models/*"],
|
|
12
|
+
"@styles/*": ["./src/lib/styles/*"],
|
|
13
|
+
"dasar-ui": ["./src/public-api.ts"]
|
|
14
|
+
},
|
|
15
|
+
"declaration": true,
|
|
16
|
+
"declarationMap": true,
|
|
17
|
+
"types": []
|
|
18
|
+
},
|
|
19
|
+
"include": ["src/**/*.ts", "src/**/*.d.ts"],
|
|
20
|
+
"exclude": ["**/*.spec.ts"]
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "./tsconfig.lib.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"declarationMap": false
|
|
7
|
+
},
|
|
8
|
+
"angularCompilerOptions": {
|
|
9
|
+
"compilationMode": "partial"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "../../tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../../out-tsc/spec",
|
|
7
|
+
"types": ["vitest/globals"],
|
|
8
|
+
"rootDir": "./src",
|
|
9
|
+
"paths": {
|
|
10
|
+
"@components/*": ["./src/lib/components/*"],
|
|
11
|
+
"@services/*": ["./src/lib/services/*"],
|
|
12
|
+
"@models/*": ["./src/lib/models/*"],
|
|
13
|
+
"@styles/*": ["./src/lib/styles/*"],
|
|
14
|
+
"dasar-ui": ["./src/public-api.ts"]
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"include": ["src/**/*.d.ts", "src/**/*.spec.ts"]
|
|
18
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
<span style="font-weight: 800; font-family: var(--font-hero)">Dasar UI Library</span>
|
|
27
|
+
<div style="display: flex; gap: 8px; align-items: center">
|
|
28
|
+
<dasar-button
|
|
29
|
+
size="md"
|
|
30
|
+
radius="md"
|
|
31
|
+
appearance="outline"
|
|
32
|
+
variant="secondary"
|
|
33
|
+
(click)="customizeOpen.set(true)"
|
|
34
|
+
>Customize</dasar-button
|
|
35
|
+
>
|
|
36
|
+
<dasar-button size="md" radius="md" appearance="solid" (click)="customize.toggleMode()">
|
|
37
|
+
<span [ngStyle]="{ 'text-transform': 'capitalize' }">Theme: {{ customize.mode() }}</span>
|
|
38
|
+
</dasar-button>
|
|
39
|
+
</div>
|
|
40
|
+
</dasar-card>
|
|
41
|
+
<div [ngStyle]="{ height: 'calc(100vh - 50px)' }">
|
|
42
|
+
@for (key of [customize.renderKey()]; track key) {
|
|
43
|
+
<router-outlet></router-outlet>
|
|
44
|
+
}
|
|
45
|
+
</div>
|
|
46
|
+
<doc-customize-modal
|
|
47
|
+
[open]="customizeOpen()"
|
|
48
|
+
(closed)="customizeOpen.set(false)"
|
|
49
|
+
></doc-customize-modal>
|
|
50
|
+
</dasar-theme-provider>
|
|
51
|
+
</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
|
+
});
|