dasar-ui 1.9.0 → 1.9.3
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/README.md +40 -41
- package/fesm2022/dasar-ui.mjs +10444 -0
- package/fesm2022/dasar-ui.mjs.map +1 -0
- package/package.json +39 -57
- package/types/dasar-ui.d.ts +2498 -0
- package/.dockerignore +0 -31
- package/.editorconfig +0 -17
- package/.github/workflows/npm-publish-github-packages.yml +0 -36
- package/.prettierrc +0 -12
- package/.versionrc.json +0 -4
- package/.vscode/extensions.json +0 -4
- package/.vscode/launch.json +0 -20
- package/.vscode/settings.json +0 -4
- package/.vscode/tasks.json +0 -42
- package/CHANGELOG.md +0 -92
- package/Dockerfile +0 -26
- package/angular.json +0 -114
- package/docs/_config.yml +0 -3
- package/docs/getting-started.md +0 -89
- package/docs/index.md +0 -9
- package/docs/installation.md +0 -46
- package/projects/dasar-ui/README.md +0 -64
- package/projects/dasar-ui/ng-package.json +0 -10
- package/projects/dasar-ui/package.json +0 -27
- package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.html +0 -9
- package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.scss +0 -352
- package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.ts +0 -154
- package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.html +0 -1
- package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.scss +0 -69
- package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.ts +0 -26
- package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.html +0 -158
- package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.scss +0 -371
- package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.ts +0 -458
- package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.html +0 -80
- package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.scss +0 -184
- package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.ts +0 -294
- package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.html +0 -42
- package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.scss +0 -38
- package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.ts +0 -205
- package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.html +0 -111
- package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.scss +0 -331
- package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.spec.ts +0 -93
- package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.ts +0 -527
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.html +0 -1
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.registry.ts +0 -5087
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.scss +0 -24
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.ts +0 -97
- package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.html +0 -54
- package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.scss +0 -251
- package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.ts +0 -319
- package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list-item.html +0 -17
- package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list.html +0 -25
- package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list.scss +0 -122
- package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list.ts +0 -166
- package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.html +0 -64
- package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.scss +0 -229
- package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.spec.ts +0 -93
- package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.ts +0 -278
- package/projects/dasar-ui/src/lib/components/dasar-modal/dasar-modal.html +0 -72
- package/projects/dasar-ui/src/lib/components/dasar-modal/dasar-modal.scss +0 -170
- package/projects/dasar-ui/src/lib/components/dasar-modal/dasar-modal.spec.ts +0 -267
- package/projects/dasar-ui/src/lib/components/dasar-modal/dasar-modal.ts +0 -305
- package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.html +0 -90
- package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.scss +0 -353
- package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.ts +0 -337
- package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.html +0 -11
- package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.scss +0 -18
- package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.spec.ts +0 -112
- package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.ts +0 -87
- package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.html +0 -98
- package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.scss +0 -51
- package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.ts +0 -99
- 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 +0 -1
- package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.ts +0 -9
- package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.html +0 -150
- package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.scss +0 -272
- package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.ts +0 -228
- 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 +0 -1
- package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.ts +0 -9
- package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.html +0 -189
- package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.scss +0 -387
- package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.spec.ts +0 -97
- package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.ts +0 -540
- 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 +0 -1
- package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.ts +0 -9
- package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.html +0 -162
- package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.scss +0 -283
- package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.ts +0 -380
- package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.html +0 -103
- package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.scss +0 -238
- package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.spec.ts +0 -570
- package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.ts +0 -349
- package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.html +0 -43
- package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.scss +0 -189
- package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.ts +0 -139
- package/projects/dasar-ui/src/lib/components/dasar-theme-provider/dasar-theme-provider.spec.ts +0 -89
- package/projects/dasar-ui/src/lib/components/dasar-theme-provider/dasar-theme-provider.ts +0 -294
- 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 +0 -1
- package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.ts +0 -9
- 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 +0 -1
- package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.ts +0 -9
- 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 +0 -1
- package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.ts +0 -9
- package/projects/dasar-ui/src/lib/models/theme.model.ts +0 -730
- package/projects/dasar-ui/src/lib/models/type.model.ts +0 -11
- package/projects/dasar-ui/src/lib/services/theme.service.spec.ts +0 -130
- package/projects/dasar-ui/src/lib/services/theme.service.ts +0 -777
- package/projects/dasar-ui/src/lib/styles/theme.ts +0 -70
- package/projects/dasar-ui/src/lib/utils/common.ts +0 -156
- package/projects/dasar-ui/src/lib/utils/icon-size.spec.ts +0 -23
- package/projects/dasar-ui/src/lib/utils/icon-size.ts +0 -16
- package/projects/dasar-ui/src/lib/utils/panel-placement.spec.ts +0 -90
- package/projects/dasar-ui/src/lib/utils/panel-placement.ts +0 -53
- package/projects/dasar-ui/src/public-api.ts +0 -24
- package/projects/dasar-ui/tsconfig.lib.json +0 -21
- package/projects/dasar-ui/tsconfig.lib.prod.json +0 -11
- package/projects/dasar-ui/tsconfig.spec.json +0 -18
- package/projects/documentation/public/favicon.ico +0 -0
- package/projects/documentation/src/app/app.html +0 -78
- package/projects/documentation/src/app/app.spec.ts +0 -23
- package/projects/documentation/src/app/app.ts +0 -57
- package/projects/documentation/src/app/components/doc-customize-modal.component.ts +0 -368
- package/projects/documentation/src/app/components/doc-example.component.ts +0 -195
- package/projects/documentation/src/app/components/doc-markdown.component.ts +0 -154
- package/projects/documentation/src/app/config/app.config.server.ts +0 -10
- package/projects/documentation/src/app/config/app.config.ts +0 -17
- package/projects/documentation/src/app/layouts/doc.layout.ts +0 -249
- package/projects/documentation/src/app/pages/button/button.page.html +0 -65
- package/projects/documentation/src/app/pages/button/button.page.ts +0 -139
- package/projects/documentation/src/app/pages/button/examples/appearance/button-appearance.example.html +0 -7
- package/projects/documentation/src/app/pages/button/examples/appearance/button-appearance.example.ts +0 -10
- package/projects/documentation/src/app/pages/button/examples/icon/button-icon.example.html +0 -19
- package/projects/documentation/src/app/pages/button/examples/icon/button-icon.example.ts +0 -10
- package/projects/documentation/src/app/pages/button/examples/radius/button-radius.example.html +0 -9
- package/projects/documentation/src/app/pages/button/examples/radius/button-radius.example.ts +0 -10
- package/projects/documentation/src/app/pages/button/examples/sizes/button-sizes.example.html +0 -7
- package/projects/documentation/src/app/pages/button/examples/sizes/button-sizes.example.ts +0 -10
- package/projects/documentation/src/app/pages/button/examples/state/button-state.example.html +0 -10
- package/projects/documentation/src/app/pages/button/examples/state/button-state.example.ts +0 -10
- package/projects/documentation/src/app/pages/button/examples/variant/button-variant.example.html +0 -9
- package/projects/documentation/src/app/pages/button/examples/variant/button-variant.example.ts +0 -10
- package/projects/documentation/src/app/pages/calendar/calendar.page.html +0 -75
- package/projects/documentation/src/app/pages/calendar/calendar.page.ts +0 -165
- package/projects/documentation/src/app/pages/calendar/examples/actions/calendar-actions.example.html +0 -21
- package/projects/documentation/src/app/pages/calendar/examples/actions/calendar-actions.example.ts +0 -10
- package/projects/documentation/src/app/pages/calendar/examples/basic/calendar-basic.example.html +0 -11
- package/projects/documentation/src/app/pages/calendar/examples/basic/calendar-basic.example.ts +0 -13
- package/projects/documentation/src/app/pages/calendar/examples/custom-header/calendar-custom-header.example.html +0 -36
- package/projects/documentation/src/app/pages/calendar/examples/custom-header/calendar-custom-header.example.ts +0 -11
- package/projects/documentation/src/app/pages/calendar/examples/dropdown/calendar-dropdown.example.html +0 -10
- package/projects/documentation/src/app/pages/calendar/examples/dropdown/calendar-dropdown.example.ts +0 -12
- package/projects/documentation/src/app/pages/calendar/examples/format/calendar-format.example.html +0 -15
- package/projects/documentation/src/app/pages/calendar/examples/format/calendar-format.example.ts +0 -12
- package/projects/documentation/src/app/pages/calendar/examples/locale/calendar-locale.example.html +0 -34
- package/projects/documentation/src/app/pages/calendar/examples/locale/calendar-locale.example.ts +0 -14
- package/projects/documentation/src/app/pages/calendar/examples/more/calendar.more.example.html +0 -20
- package/projects/documentation/src/app/pages/calendar/examples/more/calendar.more.example.ts +0 -37
- package/projects/documentation/src/app/pages/calendar/examples/styles/calendar-styles.example.html +0 -16
- package/projects/documentation/src/app/pages/calendar/examples/styles/calendar-styles.example.ts +0 -10
- package/projects/documentation/src/app/pages/card/card.page.html +0 -75
- package/projects/documentation/src/app/pages/card/card.page.ts +0 -182
- package/projects/documentation/src/app/pages/card/examples/appearance/card-appearance.example.html +0 -13
- package/projects/documentation/src/app/pages/card/examples/appearance/card-appearance.example.ts +0 -10
- package/projects/documentation/src/app/pages/card/examples/closable/card-closable.example.html +0 -30
- package/projects/documentation/src/app/pages/card/examples/closable/card-closable.example.ts +0 -19
- package/projects/documentation/src/app/pages/card/examples/custom-style/card-custom-style.example.html +0 -173
- package/projects/documentation/src/app/pages/card/examples/custom-style/card-custom-style.example.ts +0 -10
- package/projects/documentation/src/app/pages/card/examples/media/card-media.example.html +0 -27
- package/projects/documentation/src/app/pages/card/examples/media/card-media.example.ts +0 -10
- package/projects/documentation/src/app/pages/card/examples/radius/card-radius.example.html +0 -13
- package/projects/documentation/src/app/pages/card/examples/radius/card-radius.example.ts +0 -10
- package/projects/documentation/src/app/pages/card/examples/slots/card-slots.example.html +0 -20
- package/projects/documentation/src/app/pages/card/examples/slots/card-slots.example.ts +0 -10
- package/projects/documentation/src/app/pages/card/examples/spacing/card-spacing.example.html +0 -11
- package/projects/documentation/src/app/pages/card/examples/spacing/card-spacing.example.ts +0 -10
- package/projects/documentation/src/app/pages/chip/chip.page.html +0 -55
- package/projects/documentation/src/app/pages/chip/chip.page.ts +0 -158
- package/projects/documentation/src/app/pages/chip/examples/appearance/chip-appearance.example.html +0 -7
- package/projects/documentation/src/app/pages/chip/examples/appearance/chip-appearance.example.ts +0 -10
- package/projects/documentation/src/app/pages/chip/examples/more/chip-more.example.html +0 -13
- package/projects/documentation/src/app/pages/chip/examples/more/chip-more.example.ts +0 -17
- package/projects/documentation/src/app/pages/chip/examples/radius/chip-radius.example.html +0 -9
- package/projects/documentation/src/app/pages/chip/examples/radius/chip-radius.example.ts +0 -10
- package/projects/documentation/src/app/pages/chip/examples/sizes/chip-sizes.example.html +0 -6
- package/projects/documentation/src/app/pages/chip/examples/sizes/chip-sizes.example.ts +0 -10
- package/projects/documentation/src/app/pages/chip/examples/variant/chip-variant.example.html +0 -8
- package/projects/documentation/src/app/pages/chip/examples/variant/chip-variant.example.ts +0 -10
- package/projects/documentation/src/app/pages/datepicker/datepicker.page.html +0 -75
- package/projects/documentation/src/app/pages/datepicker/datepicker.page.ts +0 -181
- package/projects/documentation/src/app/pages/datepicker/examples/appearance/datepicker-appearance.example.html +0 -29
- package/projects/documentation/src/app/pages/datepicker/examples/appearance/datepicker-appearance.example.ts +0 -10
- package/projects/documentation/src/app/pages/datepicker/examples/basic/datepicker-basic.example.html +0 -12
- package/projects/documentation/src/app/pages/datepicker/examples/basic/datepicker-basic.example.ts +0 -12
- package/projects/documentation/src/app/pages/datepicker/examples/footer/datepicker-footer.example.html +0 -23
- package/projects/documentation/src/app/pages/datepicker/examples/footer/datepicker-footer.example.ts +0 -17
- package/projects/documentation/src/app/pages/datepicker/examples/format/datepicker-format.example.html +0 -30
- package/projects/documentation/src/app/pages/datepicker/examples/format/datepicker-format.example.ts +0 -13
- package/projects/documentation/src/app/pages/datepicker/examples/placement/datepicker-placement.example.html +0 -24
- package/projects/documentation/src/app/pages/datepicker/examples/placement/datepicker-placement.example.ts +0 -10
- package/projects/documentation/src/app/pages/datepicker/examples/slots/datepicker-slots.example.html +0 -19
- package/projects/documentation/src/app/pages/datepicker/examples/slots/datepicker-slots.example.ts +0 -10
- package/projects/documentation/src/app/pages/datepicker/examples/states/datepicker-states.example.html +0 -28
- package/projects/documentation/src/app/pages/datepicker/examples/states/datepicker-states.example.ts +0 -12
- package/projects/documentation/src/app/pages/getting-started/getting-started.page.ts +0 -21
- package/projects/documentation/src/app/pages/icon/icon.page.html +0 -15
- package/projects/documentation/src/app/pages/icon/icon.page.ts +0 -60
- package/projects/documentation/src/app/pages/input/examples/appearance/input-appearance.example.html +0 -27
- package/projects/documentation/src/app/pages/input/examples/appearance/input-appearance.example.ts +0 -10
- package/projects/documentation/src/app/pages/input/examples/basic/input-basic.example.html +0 -13
- package/projects/documentation/src/app/pages/input/examples/basic/input-basic.example.ts +0 -13
- package/projects/documentation/src/app/pages/input/examples/mask/input-mask.example.html +0 -31
- package/projects/documentation/src/app/pages/input/examples/mask/input-mask.example.ts +0 -19
- package/projects/documentation/src/app/pages/input/examples/more/input-more.example.html +0 -68
- package/projects/documentation/src/app/pages/input/examples/more/input-more.example.ts +0 -18
- package/projects/documentation/src/app/pages/input/examples/slots/input-slots.example.html +0 -52
- package/projects/documentation/src/app/pages/input/examples/slots/input-slots.example.ts +0 -10
- package/projects/documentation/src/app/pages/input/examples/states/input-states.example.html +0 -29
- package/projects/documentation/src/app/pages/input/examples/states/input-states.example.ts +0 -10
- package/projects/documentation/src/app/pages/input/input.page.html +0 -65
- package/projects/documentation/src/app/pages/input/input.page.ts +0 -170
- package/projects/documentation/src/app/pages/installation/installation.page.ts +0 -18
- package/projects/documentation/src/app/pages/introduction/introduction.page.ts +0 -18
- package/projects/documentation/src/app/pages/list/examples/advanced-dynamic/list-advanced-dynamic.example.html +0 -29
- package/projects/documentation/src/app/pages/list/examples/advanced-dynamic/list-advanced-dynamic.example.ts +0 -33
- package/projects/documentation/src/app/pages/list/examples/advanced-theme/list-advanced-theme.example.html +0 -13
- package/projects/documentation/src/app/pages/list/examples/advanced-theme/list-advanced-theme.example.ts +0 -30
- package/projects/documentation/src/app/pages/list/examples/basic/list-basic.example.html +0 -5
- package/projects/documentation/src/app/pages/list/examples/basic/list-basic.example.ts +0 -12
- package/projects/documentation/src/app/pages/list/examples/bordered-divider/list-bordered-divider.example.html +0 -20
- package/projects/documentation/src/app/pages/list/examples/bordered-divider/list-bordered-divider.example.ts +0 -12
- package/projects/documentation/src/app/pages/list/examples/custom-style/list-custom-style.example.html +0 -11
- package/projects/documentation/src/app/pages/list/examples/custom-style/list-custom-style.example.ts +0 -19
- package/projects/documentation/src/app/pages/list/examples/header-footer/list-header-footer.example.html +0 -7
- package/projects/documentation/src/app/pages/list/examples/header-footer/list-header-footer.example.ts +0 -12
- package/projects/documentation/src/app/pages/list/examples/interactive/list-interactive.example.html +0 -20
- package/projects/documentation/src/app/pages/list/examples/interactive/list-interactive.example.ts +0 -22
- package/projects/documentation/src/app/pages/list/examples/prefix-suffix/list-prefix-suffix.example.html +0 -9
- package/projects/documentation/src/app/pages/list/examples/prefix-suffix/list-prefix-suffix.example.ts +0 -16
- package/projects/documentation/src/app/pages/list/examples/size/list-size.example.html +0 -20
- package/projects/documentation/src/app/pages/list/examples/size/list-size.example.ts +0 -12
- package/projects/documentation/src/app/pages/list/list.page.html +0 -95
- package/projects/documentation/src/app/pages/list/list.page.ts +0 -238
- package/projects/documentation/src/app/pages/menu/examples/basic/menu-basic.example.html +0 -5
- package/projects/documentation/src/app/pages/menu/examples/basic/menu-basic.example.ts +0 -17
- package/projects/documentation/src/app/pages/menu/examples/custom-template/menu-custom-template.example.html +0 -35
- package/projects/documentation/src/app/pages/menu/examples/custom-template/menu-custom-template.example.ts +0 -57
- package/projects/documentation/src/app/pages/menu/examples/placement/menu-placement.example.html +0 -12
- package/projects/documentation/src/app/pages/menu/examples/placement/menu-placement.example.ts +0 -16
- package/projects/documentation/src/app/pages/menu/menu.page.html +0 -35
- package/projects/documentation/src/app/pages/menu/menu.page.ts +0 -149
- package/projects/documentation/src/app/pages/modal/examples/appearance/modal-appearance.example.html +0 -18
- package/projects/documentation/src/app/pages/modal/examples/appearance/modal-appearance.example.ts +0 -21
- package/projects/documentation/src/app/pages/modal/examples/basic/modal-basic.example.html +0 -8
- package/projects/documentation/src/app/pages/modal/examples/basic/modal-basic.example.ts +0 -12
- package/projects/documentation/src/app/pages/modal/examples/close-behavior/modal-close-behavior.example.html +0 -44
- package/projects/documentation/src/app/pages/modal/examples/close-behavior/modal-close-behavior.example.ts +0 -14
- package/projects/documentation/src/app/pages/modal/examples/custom-style/modal-custom-style.example.html +0 -36
- package/projects/documentation/src/app/pages/modal/examples/custom-style/modal-custom-style.example.ts +0 -12
- package/projects/documentation/src/app/pages/modal/examples/overlay/modal-overlay.example.html +0 -29
- package/projects/documentation/src/app/pages/modal/examples/overlay/modal-overlay.example.ts +0 -14
- package/projects/documentation/src/app/pages/modal/examples/radius-spacing/modal-radius-spacing.example.html +0 -27
- package/projects/documentation/src/app/pages/modal/examples/radius-spacing/modal-radius-spacing.example.ts +0 -27
- package/projects/documentation/src/app/pages/modal/examples/scroll/modal-scroll.example.html +0 -14
- package/projects/documentation/src/app/pages/modal/examples/scroll/modal-scroll.example.ts +0 -13
- package/projects/documentation/src/app/pages/modal/examples/size/modal-size.example.html +0 -17
- package/projects/documentation/src/app/pages/modal/examples/size/modal-size.example.ts +0 -21
- package/projects/documentation/src/app/pages/modal/examples/slots/modal-slots.example.html +0 -30
- package/projects/documentation/src/app/pages/modal/examples/slots/modal-slots.example.ts +0 -12
- package/projects/documentation/src/app/pages/modal/examples/width/modal-width.example.html +0 -23
- package/projects/documentation/src/app/pages/modal/examples/width/modal-width.example.ts +0 -13
- package/projects/documentation/src/app/pages/modal/modal.page.html +0 -105
- package/projects/documentation/src/app/pages/modal/modal.page.ts +0 -266
- package/projects/documentation/src/app/pages/number-input/examples/appearance/number-input-appearance.example.html +0 -30
- package/projects/documentation/src/app/pages/number-input/examples/appearance/number-input-appearance.example.ts +0 -10
- package/projects/documentation/src/app/pages/number-input/examples/basic/number-input-basic.example.html +0 -12
- package/projects/documentation/src/app/pages/number-input/examples/basic/number-input-basic.example.ts +0 -13
- package/projects/documentation/src/app/pages/number-input/examples/limits/number-input-limits.example.html +0 -30
- package/projects/documentation/src/app/pages/number-input/examples/limits/number-input-limits.example.ts +0 -14
- package/projects/documentation/src/app/pages/number-input/examples/slots/number-input-slots.example.html +0 -49
- package/projects/documentation/src/app/pages/number-input/examples/slots/number-input-slots.example.ts +0 -10
- package/projects/documentation/src/app/pages/number-input/examples/states/number-input-states.example.html +0 -21
- package/projects/documentation/src/app/pages/number-input/examples/states/number-input-states.example.ts +0 -10
- package/projects/documentation/src/app/pages/number-input/number-input.page.html +0 -55
- package/projects/documentation/src/app/pages/number-input/number-input.page.ts +0 -142
- package/projects/documentation/src/app/pages/select/examples/appearance/select-appearance.example.html +0 -32
- package/projects/documentation/src/app/pages/select/examples/appearance/select-appearance.example.ts +0 -15
- package/projects/documentation/src/app/pages/select/examples/basic/select-basic.example.html +0 -13
- package/projects/documentation/src/app/pages/select/examples/basic/select-basic.example.ts +0 -20
- package/projects/documentation/src/app/pages/select/examples/multiple/select-multiple.example.html +0 -24
- package/projects/documentation/src/app/pages/select/examples/multiple/select-multiple.example.ts +0 -59
- package/projects/documentation/src/app/pages/select/examples/placement/select-placement.example.html +0 -20
- package/projects/documentation/src/app/pages/select/examples/placement/select-placement.example.ts +0 -20
- package/projects/documentation/src/app/pages/select/examples/search/select-search.example.html +0 -13
- package/projects/documentation/src/app/pages/select/examples/search/select-search.example.ts +0 -22
- package/projects/documentation/src/app/pages/select/examples/slots/select-slots.example.html +0 -44
- package/projects/documentation/src/app/pages/select/examples/slots/select-slots.example.ts +0 -15
- package/projects/documentation/src/app/pages/select/examples/states/select-states.example.html +0 -31
- package/projects/documentation/src/app/pages/select/examples/states/select-states.example.ts +0 -12
- package/projects/documentation/src/app/pages/select/select.page.html +0 -75
- package/projects/documentation/src/app/pages/select/select.page.ts +0 -195
- package/projects/documentation/src/app/pages/table/examples/cell-actions/table-cell-actions.example.html +0 -14
- package/projects/documentation/src/app/pages/table/examples/cell-actions/table-cell-actions.example.ts +0 -25
- package/projects/documentation/src/app/pages/table/examples/cell-badge/table-cell-badge.example.html +0 -12
- package/projects/documentation/src/app/pages/table/examples/cell-badge/table-cell-badge.example.ts +0 -21
- package/projects/documentation/src/app/pages/table/examples/cell-profile/table-cell-profile.example.html +0 -29
- package/projects/documentation/src/app/pages/table/examples/cell-profile/table-cell-profile.example.ts +0 -20
- package/projects/documentation/src/app/pages/table/examples/custom-body/table-custom-body.example.html +0 -39
- package/projects/documentation/src/app/pages/table/examples/custom-body/table-custom-body.example.ts +0 -21
- package/projects/documentation/src/app/pages/table/examples/custom-sizes/table-custom-sizes.example.html +0 -7
- package/projects/documentation/src/app/pages/table/examples/custom-sizes/table-custom-sizes.example.ts +0 -21
- package/projects/documentation/src/app/pages/table/examples/dynamic-style/table-dynamic-style.example.html +0 -3
- package/projects/documentation/src/app/pages/table/examples/dynamic-style/table-dynamic-style.example.ts +0 -41
- package/projects/documentation/src/app/pages/table/examples/empty/table-empty.example.html +0 -43
- package/projects/documentation/src/app/pages/table/examples/empty/table-empty.example.ts +0 -21
- package/projects/documentation/src/app/pages/table/examples/expanded/table-expanded.example.html +0 -36
- package/projects/documentation/src/app/pages/table/examples/expanded/table-expanded.example.ts +0 -34
- package/projects/documentation/src/app/pages/table/examples/heatmap/table-heatmap.example.html +0 -8
- package/projects/documentation/src/app/pages/table/examples/heatmap/table-heatmap.example.ts +0 -52
- package/projects/documentation/src/app/pages/table/examples/inline-edit/table-inline-edit.example.html +0 -53
- package/projects/documentation/src/app/pages/table/examples/inline-edit/table-inline-edit.example.ts +0 -50
- package/projects/documentation/src/app/pages/table/examples/nested/table-nested.example.html +0 -23
- package/projects/documentation/src/app/pages/table/examples/nested/table-nested.example.ts +0 -42
- package/projects/documentation/src/app/pages/table/examples/pagination/table-pagination.example.html +0 -20
- package/projects/documentation/src/app/pages/table/examples/pagination/table-pagination.example.ts +0 -21
- package/projects/documentation/src/app/pages/table/table.page.html +0 -125
- package/projects/documentation/src/app/pages/table/table.page.ts +0 -261
- package/projects/documentation/src/app/pages/tabs/examples/advanced-dynamic/tabs-advanced-dynamic.example.html +0 -13
- package/projects/documentation/src/app/pages/tabs/examples/advanced-dynamic/tabs-advanced-dynamic.example.ts +0 -27
- package/projects/documentation/src/app/pages/tabs/examples/advanced-form/tabs-advanced-form.example.html +0 -27
- package/projects/documentation/src/app/pages/tabs/examples/advanced-form/tabs-advanced-form.example.ts +0 -36
- package/projects/documentation/src/app/pages/tabs/examples/advanced-theme/tabs-advanced-theme.example.html +0 -5
- package/projects/documentation/src/app/pages/tabs/examples/advanced-theme/tabs-advanced-theme.example.ts +0 -20
- package/projects/documentation/src/app/pages/tabs/examples/appearance/tabs-appearance.example.html +0 -6
- package/projects/documentation/src/app/pages/tabs/examples/appearance/tabs-appearance.example.ts +0 -13
- package/projects/documentation/src/app/pages/tabs/examples/basic/tabs-basic.example.html +0 -13
- package/projects/documentation/src/app/pages/tabs/examples/basic/tabs-basic.example.ts +0 -13
- package/projects/documentation/src/app/pages/tabs/examples/custom-style/tabs-custom-style.example.html +0 -19
- package/projects/documentation/src/app/pages/tabs/examples/custom-style/tabs-custom-style.example.ts +0 -12
- package/projects/documentation/src/app/pages/tabs/examples/events/tabs-events.example.html +0 -16
- package/projects/documentation/src/app/pages/tabs/examples/events/tabs-events.example.ts +0 -23
- package/projects/documentation/src/app/pages/tabs/examples/fluid/tabs-fluid.example.html +0 -5
- package/projects/documentation/src/app/pages/tabs/examples/fluid/tabs-fluid.example.ts +0 -12
- package/projects/documentation/src/app/pages/tabs/examples/no-body/tabs-no-body.example.html +0 -6
- package/projects/documentation/src/app/pages/tabs/examples/no-body/tabs-no-body.example.ts +0 -12
- package/projects/documentation/src/app/pages/tabs/examples/radius/tabs-radius.example.html +0 -6
- package/projects/documentation/src/app/pages/tabs/examples/radius/tabs-radius.example.ts +0 -13
- package/projects/documentation/src/app/pages/tabs/examples/scroll/tabs-scroll.example.html +0 -20
- package/projects/documentation/src/app/pages/tabs/examples/scroll/tabs-scroll.example.ts +0 -30
- package/projects/documentation/src/app/pages/tabs/examples/scroll-icon/tabs-scroll-icon.example.html +0 -16
- package/projects/documentation/src/app/pages/tabs/examples/scroll-icon/tabs-scroll-icon.example.ts +0 -26
- package/projects/documentation/src/app/pages/tabs/examples/scroll-slot/tabs-scroll-slot.example.html +0 -22
- package/projects/documentation/src/app/pages/tabs/examples/scroll-slot/tabs-scroll-slot.example.ts +0 -26
- package/projects/documentation/src/app/pages/tabs/examples/size/tabs-size.example.html +0 -6
- package/projects/documentation/src/app/pages/tabs/examples/size/tabs-size.example.ts +0 -13
- package/projects/documentation/src/app/pages/tabs/examples/slots/tabs-slots.example.html +0 -25
- package/projects/documentation/src/app/pages/tabs/examples/slots/tabs-slots.example.ts +0 -10
- package/projects/documentation/src/app/pages/tabs/examples/spacing/tabs-spacing.example.html +0 -6
- package/projects/documentation/src/app/pages/tabs/examples/spacing/tabs-spacing.example.ts +0 -13
- package/projects/documentation/src/app/pages/tabs/tabs.page.html +0 -165
- package/projects/documentation/src/app/pages/tabs/tabs.page.ts +0 -347
- package/projects/documentation/src/app/pages/theming/examples/component-config/theming-component-config.example.html +0 -13
- package/projects/documentation/src/app/pages/theming/examples/component-config/theming-component-config.example.ts +0 -20
- package/projects/documentation/src/app/pages/theming/examples/css-override/theming-css-override.example.html +0 -8
- package/projects/documentation/src/app/pages/theming/examples/css-override/theming-css-override.example.scss +0 -4
- package/projects/documentation/src/app/pages/theming/examples/css-override/theming-css-override.example.ts +0 -11
- package/projects/documentation/src/app/pages/theming/examples/custom-tokens/theming-custom-tokens.example.html +0 -13
- package/projects/documentation/src/app/pages/theming/examples/custom-tokens/theming-custom-tokens.example.ts +0 -33
- package/projects/documentation/src/app/pages/theming/examples/global-theme/theming-global-theme.example.html +0 -6
- package/projects/documentation/src/app/pages/theming/examples/global-theme/theming-global-theme.example.ts +0 -20
- package/projects/documentation/src/app/pages/theming/examples/light-dark/theming-light-dark.example.html +0 -15
- package/projects/documentation/src/app/pages/theming/examples/light-dark/theming-light-dark.example.ts +0 -31
- package/projects/documentation/src/app/pages/theming/theming-component-config.page.ts +0 -52
- package/projects/documentation/src/app/pages/theming/theming-css-variables.page.ts +0 -71
- package/projects/documentation/src/app/pages/theming/theming-tokens.page.ts +0 -56
- package/projects/documentation/src/app/pages/theming/theming.data.ts +0 -947
- package/projects/documentation/src/app/pages/theming/theming.page.html +0 -56
- package/projects/documentation/src/app/pages/theming/theming.page.ts +0 -144
- package/projects/documentation/src/app/routes/app.routes.server.ts +0 -8
- package/projects/documentation/src/app/routes/app.routes.ts +0 -135
- package/projects/documentation/src/app/services/doc-customize.service.ts +0 -119
- package/projects/documentation/src/app/utils/highlight.pipe.ts +0 -43
- package/projects/documentation/src/index.html +0 -13
- package/projects/documentation/src/main.server.ts +0 -7
- package/projects/documentation/src/main.ts +0 -5
- package/projects/documentation/src/server.ts +0 -47
- package/projects/documentation/src/styles.scss +0 -19
- package/projects/documentation/tsconfig.app.json +0 -11
- package/projects/documentation/tsconfig.spec.json +0 -10
- package/tsconfig.json +0 -40
- /package/{projects/dasar-ui/src/lib/styles → styles}/theme.scss +0 -0
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { Component, signal } from '@angular/core';
|
|
2
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
3
|
-
import { DasarDatepicker, DasarDatepickerComponent } from './dasar-datepicker';
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
standalone: true,
|
|
7
|
-
imports: [DasarDatepickerComponent],
|
|
8
|
-
template: `
|
|
9
|
-
<dasar-datepicker
|
|
10
|
-
[size]="size()"
|
|
11
|
-
[radius]="radius()"
|
|
12
|
-
[placement]="placement()"
|
|
13
|
-
[value]="value()"
|
|
14
|
-
clearable
|
|
15
|
-
placeholder="Pick a date"
|
|
16
|
-
/>
|
|
17
|
-
`,
|
|
18
|
-
})
|
|
19
|
-
class DatepickerHost {
|
|
20
|
-
size = signal<'sm' | 'md' | 'lg'>('sm');
|
|
21
|
-
radius = signal<'none' | 'md' | 'lg' | 'full'>('lg');
|
|
22
|
-
placement = signal<'bottom-start' | 'top-start'>('bottom-start');
|
|
23
|
-
value = signal<string | null>(null);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
describe('DasarDatepicker', () => {
|
|
27
|
-
let component: DasarDatepicker;
|
|
28
|
-
let fixture: ComponentFixture<DatepickerHost>;
|
|
29
|
-
let host: DatepickerHost;
|
|
30
|
-
|
|
31
|
-
const trigger = () =>
|
|
32
|
-
fixture.nativeElement.querySelector('.dasar-datepicker-trigger') as HTMLElement;
|
|
33
|
-
const dropdown = () =>
|
|
34
|
-
fixture.nativeElement.querySelector('.dasar-datepicker-dropdown') as HTMLElement;
|
|
35
|
-
const open = async () => {
|
|
36
|
-
trigger().click();
|
|
37
|
-
await fixture.whenStable();
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
beforeEach(async () => {
|
|
41
|
-
await TestBed.configureTestingModule({
|
|
42
|
-
imports: [DatepickerHost],
|
|
43
|
-
}).compileComponents();
|
|
44
|
-
|
|
45
|
-
fixture = TestBed.createComponent(DatepickerHost);
|
|
46
|
-
host = fixture.componentInstance;
|
|
47
|
-
component = fixture.debugElement.children[0].componentInstance;
|
|
48
|
-
fixture.detectChanges();
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('should create', () => {
|
|
52
|
-
expect(component).toBeTruthy();
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('calendar icon fits the trigger size', () => {
|
|
56
|
-
const svg = trigger().querySelector('.calendar-icon svg') as SVGElement;
|
|
57
|
-
expect(svg.getAttribute('width')).toBe('14');
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it('clear icon fits the trigger size when there is a value', () => {
|
|
61
|
-
host.value.set('2026-01-05');
|
|
62
|
-
fixture.detectChanges();
|
|
63
|
-
const svg = trigger().querySelector('.clear-icon svg') as SVGElement;
|
|
64
|
-
expect(svg.getAttribute('width')).toBe('14');
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('dropdown follows the trigger size and radius', async () => {
|
|
68
|
-
await open();
|
|
69
|
-
|
|
70
|
-
expect(dropdown()).toBeTruthy();
|
|
71
|
-
expect(dropdown().classList).toContain('size-sm');
|
|
72
|
-
expect(dropdown().classList).toContain('radius-lg');
|
|
73
|
-
expect(dropdown().classList).toContain('placement-bottom-start');
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('dropdown starts at the requested placement', async () => {
|
|
77
|
-
host.placement.set('top-start');
|
|
78
|
-
await open();
|
|
79
|
-
|
|
80
|
-
expect(dropdown().classList).toContain('placement-top-start');
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('never writes the flipped placement back to the placement input', async () => {
|
|
84
|
-
await open();
|
|
85
|
-
|
|
86
|
-
expect(component.placement).toBe('bottom-start');
|
|
87
|
-
expect(component.currentPlacement).toBe('bottom-start');
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('renders no dropdown while closed', () => {
|
|
91
|
-
expect(dropdown()).toBeNull();
|
|
92
|
-
});
|
|
93
|
-
});
|
|
@@ -1,527 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Component,
|
|
3
|
-
Input,
|
|
4
|
-
Output,
|
|
5
|
-
EventEmitter,
|
|
6
|
-
booleanAttribute,
|
|
7
|
-
ElementRef,
|
|
8
|
-
HostListener,
|
|
9
|
-
OnInit,
|
|
10
|
-
forwardRef,
|
|
11
|
-
inject,
|
|
12
|
-
ChangeDetectorRef,
|
|
13
|
-
ViewEncapsulation,
|
|
14
|
-
Directive,
|
|
15
|
-
ContentChild,
|
|
16
|
-
HostBinding,
|
|
17
|
-
ViewChild,
|
|
18
|
-
} from '@angular/core';
|
|
19
|
-
import { ControlValueAccessor, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
20
|
-
import { DASAR_THEME_PROVIDER } from '../dasar-theme-provider/dasar-theme-provider';
|
|
21
|
-
import { ClassType, StyleType, ScaleAttributeType } from '../../models/type.model';
|
|
22
|
-
import { DasarCalendarComponent } from '../dasar-calendar/dasar-calendar';
|
|
23
|
-
import { resolveThemeDefault, safeFormat } from '../../utils/common';
|
|
24
|
-
import { computeSmartPlacement, DasarPanelPlacement } from '../../utils/panel-placement';
|
|
25
|
-
import { fieldIconSize } from '../../utils/icon-size';
|
|
26
|
-
import { DasarButtonComponent } from '../dasar-button/dasar-button';
|
|
27
|
-
import { DasarThemeService } from '../../services/theme.service';
|
|
28
|
-
import { DasarIconComponent } from '../dasar-icon/dasar-icon';
|
|
29
|
-
import { CommonModule } from '@angular/common';
|
|
30
|
-
|
|
31
|
-
export type DasarDatepickerPlacement = DasarPanelPlacement;
|
|
32
|
-
export type DasarDatepickerSize = Extract<ScaleAttributeType, 'sm' | 'md' | 'lg'>;
|
|
33
|
-
export type DasarDatepickerAppearance = 'outline' | 'filled' | 'subtle';
|
|
34
|
-
export type DasarDatepickerRadius = ScaleAttributeType;
|
|
35
|
-
export type DasarDatepickerType = 'date';
|
|
36
|
-
|
|
37
|
-
export interface DasarDatepickerConfig {
|
|
38
|
-
fullWidth?: boolean;
|
|
39
|
-
clearable?: boolean;
|
|
40
|
-
disabled?: boolean;
|
|
41
|
-
fluid?: boolean;
|
|
42
|
-
error?: boolean;
|
|
43
|
-
displayFormat?: string;
|
|
44
|
-
valueFormat?: string;
|
|
45
|
-
placement?: DasarDatepickerPlacement;
|
|
46
|
-
appearance?: DasarDatepickerAppearance;
|
|
47
|
-
extraLabel?: string;
|
|
48
|
-
placeholder?: string;
|
|
49
|
-
radius?: DasarDatepickerRadius;
|
|
50
|
-
type?: DasarDatepickerType;
|
|
51
|
-
size?: DasarDatepickerSize;
|
|
52
|
-
locale?: string;
|
|
53
|
-
label?: string;
|
|
54
|
-
hint?: string;
|
|
55
|
-
containerClass?: ClassType;
|
|
56
|
-
wrapperClass?: ClassType;
|
|
57
|
-
triggerClass?: ClassType;
|
|
58
|
-
dropdownClass?: ClassType;
|
|
59
|
-
labelWrapperClass?: ClassType;
|
|
60
|
-
hintWrapperClass?: ClassType;
|
|
61
|
-
wrapperStyle?: StyleType;
|
|
62
|
-
triggerStyle?: StyleType;
|
|
63
|
-
labelWrapperStyle?: StyleType;
|
|
64
|
-
hintWrapperStyle?: StyleType;
|
|
65
|
-
containerStyle?: StyleType;
|
|
66
|
-
dropdownStyle?: StyleType;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
@Directive({ selector: '[prefix-slot]', standalone: true })
|
|
70
|
-
export class DasarDatepickerPrefixSlot {}
|
|
71
|
-
@Directive({ selector: '[label-slot]', standalone: true })
|
|
72
|
-
export class DasarDatepickerLabelSlot {}
|
|
73
|
-
@Directive({ selector: '[extra-label-slot]', standalone: true })
|
|
74
|
-
export class DasarDatepickerExtraLabelSlot {}
|
|
75
|
-
@Directive({ selector: '[extra-header-slot]', standalone: true })
|
|
76
|
-
export class DasarDatepickerExtraHeaderSlot {}
|
|
77
|
-
@Directive({ selector: '[extra-footer-slot]', standalone: true })
|
|
78
|
-
export class DasarDatepickerExtraFooterSlot {}
|
|
79
|
-
@Directive({ selector: '[hint-slot]', standalone: true })
|
|
80
|
-
export class DasarDatepickerHintSlot {}
|
|
81
|
-
|
|
82
|
-
@Component({
|
|
83
|
-
selector: 'dasar-datepicker',
|
|
84
|
-
standalone: true,
|
|
85
|
-
imports: [
|
|
86
|
-
CommonModule,
|
|
87
|
-
FormsModule,
|
|
88
|
-
DasarCalendarComponent,
|
|
89
|
-
DasarIconComponent,
|
|
90
|
-
DasarButtonComponent,
|
|
91
|
-
],
|
|
92
|
-
templateUrl: './dasar-datepicker.html',
|
|
93
|
-
styleUrls: ['./dasar-datepicker.scss'],
|
|
94
|
-
encapsulation: ViewEncapsulation.None,
|
|
95
|
-
providers: [
|
|
96
|
-
{
|
|
97
|
-
provide: NG_VALUE_ACCESSOR,
|
|
98
|
-
useExisting: forwardRef(() => DasarDatepicker),
|
|
99
|
-
multi: true,
|
|
100
|
-
},
|
|
101
|
-
],
|
|
102
|
-
})
|
|
103
|
-
export class DasarDatepicker implements OnInit, ControlValueAccessor {
|
|
104
|
-
private themeProvider = inject(DASAR_THEME_PROVIDER, { optional: true });
|
|
105
|
-
private themeService = inject(DasarThemeService, { optional: true });
|
|
106
|
-
private cdr = inject(ChangeDetectorRef);
|
|
107
|
-
private elementRef = inject(ElementRef);
|
|
108
|
-
|
|
109
|
-
@ContentChild(DasarDatepickerExtraHeaderSlot) extraHeaderSlot?: DasarDatepickerExtraHeaderSlot;
|
|
110
|
-
@ContentChild(DasarDatepickerExtraFooterSlot) extraFooterSlot?: DasarDatepickerExtraFooterSlot;
|
|
111
|
-
@ContentChild(DasarDatepickerExtraLabelSlot) extraLabelSlot?: DasarDatepickerExtraLabelSlot;
|
|
112
|
-
@ContentChild(DasarDatepickerLabelSlot) labelSlot?: DasarDatepickerLabelSlot;
|
|
113
|
-
@ContentChild(DasarDatepickerHintSlot) hintSlot?: DasarDatepickerHintSlot;
|
|
114
|
-
@ContentChild(DasarDatepickerPrefixSlot) prefixSlot?: DasarDatepickerPrefixSlot;
|
|
115
|
-
|
|
116
|
-
@ViewChild('triggerElement') triggerEl?: ElementRef<HTMLElement>;
|
|
117
|
-
@ViewChild('dropdownElement') dropdownEl?: ElementRef<HTMLElement>;
|
|
118
|
-
|
|
119
|
-
@Input({ alias: 'display-format' }) displayFormat = resolveThemeDefault(
|
|
120
|
-
'datepicker',
|
|
121
|
-
'displayFormat',
|
|
122
|
-
'DD-MM-YYYY',
|
|
123
|
-
this.themeProvider,
|
|
124
|
-
this.themeService,
|
|
125
|
-
);
|
|
126
|
-
@Input({ alias: 'value-format' }) valueFormat = resolveThemeDefault(
|
|
127
|
-
'datepicker',
|
|
128
|
-
'valueFormat',
|
|
129
|
-
'yyyy-MM-dd',
|
|
130
|
-
this.themeProvider,
|
|
131
|
-
this.themeService,
|
|
132
|
-
);
|
|
133
|
-
@Input() locale = resolveThemeDefault(
|
|
134
|
-
'datepicker',
|
|
135
|
-
'locale',
|
|
136
|
-
'en-US',
|
|
137
|
-
this.themeProvider,
|
|
138
|
-
this.themeService,
|
|
139
|
-
);
|
|
140
|
-
private _placement: DasarDatepickerPlacement = resolveThemeDefault(
|
|
141
|
-
'datepicker',
|
|
142
|
-
'placement',
|
|
143
|
-
'bottom-start',
|
|
144
|
-
this.themeProvider,
|
|
145
|
-
this.themeService,
|
|
146
|
-
);
|
|
147
|
-
@Input()
|
|
148
|
-
set placement(value: DasarDatepickerPlacement) {
|
|
149
|
-
this._placement = value;
|
|
150
|
-
this.currentPlacement = value;
|
|
151
|
-
}
|
|
152
|
-
get placement(): DasarDatepickerPlacement {
|
|
153
|
-
return this._placement;
|
|
154
|
-
}
|
|
155
|
-
currentPlacement: DasarDatepickerPlacement = this._placement;
|
|
156
|
-
@Input() appearance = resolveThemeDefault(
|
|
157
|
-
'datepicker',
|
|
158
|
-
'appearance',
|
|
159
|
-
'outline',
|
|
160
|
-
this.themeProvider,
|
|
161
|
-
this.themeService,
|
|
162
|
-
);
|
|
163
|
-
@Input() radius = resolveThemeDefault(
|
|
164
|
-
'datepicker',
|
|
165
|
-
'radius',
|
|
166
|
-
'md',
|
|
167
|
-
this.themeProvider,
|
|
168
|
-
this.themeService,
|
|
169
|
-
);
|
|
170
|
-
@Input() type = resolveThemeDefault(
|
|
171
|
-
'datepicker',
|
|
172
|
-
'type',
|
|
173
|
-
'date',
|
|
174
|
-
this.themeProvider,
|
|
175
|
-
this.themeService,
|
|
176
|
-
);
|
|
177
|
-
@Input() size = resolveThemeDefault(
|
|
178
|
-
'datepicker',
|
|
179
|
-
'size',
|
|
180
|
-
'md',
|
|
181
|
-
this.themeProvider,
|
|
182
|
-
this.themeService,
|
|
183
|
-
);
|
|
184
|
-
@Input() placeholder = resolveThemeDefault(
|
|
185
|
-
'datepicker',
|
|
186
|
-
'placeholder',
|
|
187
|
-
'Select date',
|
|
188
|
-
this.themeProvider,
|
|
189
|
-
this.themeService,
|
|
190
|
-
);
|
|
191
|
-
@Input() label = resolveThemeDefault(
|
|
192
|
-
'datepicker',
|
|
193
|
-
'label',
|
|
194
|
-
undefined,
|
|
195
|
-
this.themeProvider,
|
|
196
|
-
this.themeService,
|
|
197
|
-
);
|
|
198
|
-
@Input({ alias: 'extra-label' }) extraLabel = resolveThemeDefault(
|
|
199
|
-
'datepicker',
|
|
200
|
-
'extraLabel',
|
|
201
|
-
undefined,
|
|
202
|
-
this.themeProvider,
|
|
203
|
-
this.themeService,
|
|
204
|
-
);
|
|
205
|
-
@Input() hint = resolveThemeDefault(
|
|
206
|
-
'datepicker',
|
|
207
|
-
'hint',
|
|
208
|
-
undefined,
|
|
209
|
-
this.themeProvider,
|
|
210
|
-
this.themeService,
|
|
211
|
-
);
|
|
212
|
-
@Input({ alias: 'container-class' }) containerClass = resolveThemeDefault(
|
|
213
|
-
'datepicker',
|
|
214
|
-
'containerClass',
|
|
215
|
-
null,
|
|
216
|
-
this.themeProvider,
|
|
217
|
-
this.themeService,
|
|
218
|
-
);
|
|
219
|
-
@Input({ alias: 'wrapper-class' }) wrapperClass = resolveThemeDefault(
|
|
220
|
-
'datepicker',
|
|
221
|
-
'wrapperClass',
|
|
222
|
-
null,
|
|
223
|
-
this.themeProvider,
|
|
224
|
-
this.themeService,
|
|
225
|
-
);
|
|
226
|
-
@Input({ alias: 'trigger-class' }) triggerClass = resolveThemeDefault(
|
|
227
|
-
'datepicker',
|
|
228
|
-
'triggerClass',
|
|
229
|
-
null,
|
|
230
|
-
this.themeProvider,
|
|
231
|
-
this.themeService,
|
|
232
|
-
);
|
|
233
|
-
@Input({ alias: 'dropdown-class' }) dropdownClass = resolveThemeDefault(
|
|
234
|
-
'datepicker',
|
|
235
|
-
'dropdownClass',
|
|
236
|
-
null,
|
|
237
|
-
this.themeProvider,
|
|
238
|
-
this.themeService,
|
|
239
|
-
);
|
|
240
|
-
@Input({ alias: 'label-wrapper-class' }) labelWrapperClass = resolveThemeDefault(
|
|
241
|
-
'datepicker',
|
|
242
|
-
'labelWrapperClass',
|
|
243
|
-
null,
|
|
244
|
-
this.themeProvider,
|
|
245
|
-
this.themeService,
|
|
246
|
-
);
|
|
247
|
-
@Input({ alias: 'hint-wrapper-class' }) hintWrapperClass = resolveThemeDefault(
|
|
248
|
-
'datepicker',
|
|
249
|
-
'hintWrapperClass',
|
|
250
|
-
null,
|
|
251
|
-
this.themeProvider,
|
|
252
|
-
this.themeService,
|
|
253
|
-
);
|
|
254
|
-
@Input({ alias: 'container-style' }) containerStyle = resolveThemeDefault(
|
|
255
|
-
'datepicker',
|
|
256
|
-
'containerStyle',
|
|
257
|
-
null,
|
|
258
|
-
this.themeProvider,
|
|
259
|
-
this.themeService,
|
|
260
|
-
);
|
|
261
|
-
@Input({ alias: 'wrapper-style' }) wrapperStyle = resolveThemeDefault(
|
|
262
|
-
'datepicker',
|
|
263
|
-
'wrapperStyle',
|
|
264
|
-
null,
|
|
265
|
-
this.themeProvider,
|
|
266
|
-
this.themeService,
|
|
267
|
-
);
|
|
268
|
-
@Input({ alias: 'trigger-style' }) triggerStyle = resolveThemeDefault(
|
|
269
|
-
'datepicker',
|
|
270
|
-
'triggerStyle',
|
|
271
|
-
null,
|
|
272
|
-
this.themeProvider,
|
|
273
|
-
this.themeService,
|
|
274
|
-
);
|
|
275
|
-
@Input({ alias: 'dropdown-style' }) dropdownStyle = resolveThemeDefault(
|
|
276
|
-
'datepicker',
|
|
277
|
-
'dropdownStyle',
|
|
278
|
-
null,
|
|
279
|
-
this.themeProvider,
|
|
280
|
-
this.themeService,
|
|
281
|
-
);
|
|
282
|
-
@Input({ alias: 'label-wrapper-style' }) labelWrapperStyle = resolveThemeDefault(
|
|
283
|
-
'datepicker',
|
|
284
|
-
'labelWrapperStyle',
|
|
285
|
-
null,
|
|
286
|
-
this.themeProvider,
|
|
287
|
-
this.themeService,
|
|
288
|
-
);
|
|
289
|
-
@Input({ alias: 'hint-wrapper-style' }) hintWrapperStyle = resolveThemeDefault(
|
|
290
|
-
'datepicker',
|
|
291
|
-
'hintWrapperStyle',
|
|
292
|
-
null,
|
|
293
|
-
this.themeProvider,
|
|
294
|
-
this.themeService,
|
|
295
|
-
);
|
|
296
|
-
@Input({ alias: 'full-width', transform: booleanAttribute }) fullWidth = resolveThemeDefault(
|
|
297
|
-
'datepicker',
|
|
298
|
-
'fullWidth',
|
|
299
|
-
false,
|
|
300
|
-
this.themeProvider,
|
|
301
|
-
this.themeService,
|
|
302
|
-
);
|
|
303
|
-
@Input({ transform: booleanAttribute }) clearable = resolveThemeDefault(
|
|
304
|
-
'datepicker',
|
|
305
|
-
'clearable',
|
|
306
|
-
false,
|
|
307
|
-
this.themeProvider,
|
|
308
|
-
this.themeService,
|
|
309
|
-
);
|
|
310
|
-
@Input({ transform: booleanAttribute }) disabled = resolveThemeDefault(
|
|
311
|
-
'datepicker',
|
|
312
|
-
'disabled',
|
|
313
|
-
false,
|
|
314
|
-
this.themeProvider,
|
|
315
|
-
this.themeService,
|
|
316
|
-
);
|
|
317
|
-
@Input({ transform: booleanAttribute }) fluid = resolveThemeDefault(
|
|
318
|
-
'datepicker',
|
|
319
|
-
'fluid',
|
|
320
|
-
false,
|
|
321
|
-
this.themeProvider,
|
|
322
|
-
this.themeService,
|
|
323
|
-
);
|
|
324
|
-
@Input({ transform: booleanAttribute }) error = resolveThemeDefault(
|
|
325
|
-
'datepicker',
|
|
326
|
-
'error',
|
|
327
|
-
false,
|
|
328
|
-
this.themeProvider,
|
|
329
|
-
this.themeService,
|
|
330
|
-
);
|
|
331
|
-
|
|
332
|
-
@Output() valueChange = new EventEmitter<any>();
|
|
333
|
-
@Output() onDateSelected = new EventEmitter<any>();
|
|
334
|
-
@Output() onInitialized = new EventEmitter<void>();
|
|
335
|
-
@Output() onClickIn = new EventEmitter<Event>();
|
|
336
|
-
@Output() onClickOut = new EventEmitter<Event>();
|
|
337
|
-
|
|
338
|
-
@Output() onNextMonthClick = new EventEmitter<void>();
|
|
339
|
-
@Output() onPrevMonthClick = new EventEmitter<void>();
|
|
340
|
-
@Output() onNextYearClick = new EventEmitter<void>();
|
|
341
|
-
@Output() onPrevYearClick = new EventEmitter<void>();
|
|
342
|
-
|
|
343
|
-
@Output() onCleared = new EventEmitter<void>();
|
|
344
|
-
@Output() onCouched = new EventEmitter<void>();
|
|
345
|
-
@Output() onFocus = new EventEmitter<Event | void>();
|
|
346
|
-
@Output() onBlur = new EventEmitter<Event | void>();
|
|
347
|
-
|
|
348
|
-
@HostBinding('class.dasar-datepicker') readonly baseClass = true;
|
|
349
|
-
@HostBinding('class.full-width') get hasFullWidth(): boolean {
|
|
350
|
-
return this.fullWidth;
|
|
351
|
-
}
|
|
352
|
-
@HostBinding('class.disabled') get isDisabled(): boolean {
|
|
353
|
-
return this.disabled;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
private _value: any = null;
|
|
357
|
-
internalDate: Date | null = null;
|
|
358
|
-
isOpen: boolean = false;
|
|
359
|
-
private isFocused: boolean = false;
|
|
360
|
-
|
|
361
|
-
@Input()
|
|
362
|
-
get value(): any {
|
|
363
|
-
return this._value;
|
|
364
|
-
}
|
|
365
|
-
set value(val: any) {
|
|
366
|
-
if (this._value !== val) {
|
|
367
|
-
this._value = val ?? null;
|
|
368
|
-
this.syncInternalDate();
|
|
369
|
-
this.cdr.markForCheck();
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
onTouched: any = () => {};
|
|
374
|
-
onChange: any = () => {};
|
|
375
|
-
|
|
376
|
-
ngOnInit() {
|
|
377
|
-
this.syncInternalDate();
|
|
378
|
-
this.onInitialized.emit();
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
get hasLabelRow(): boolean {
|
|
382
|
-
return !!(this.label || this.labelSlot || this.extraLabel || this.extraLabelSlot);
|
|
383
|
-
}
|
|
384
|
-
get hasHintRow(): boolean {
|
|
385
|
-
return !!(this.hint || this.hintSlot);
|
|
386
|
-
}
|
|
387
|
-
get formattedDisplay(): string {
|
|
388
|
-
if (!this.internalDate || isNaN(this.internalDate.getTime())) return '';
|
|
389
|
-
try {
|
|
390
|
-
const formatToUse = () => {
|
|
391
|
-
return this.displayFormat;
|
|
392
|
-
};
|
|
393
|
-
return safeFormat(this.internalDate, formatToUse(), this.locale);
|
|
394
|
-
} catch {
|
|
395
|
-
return this.internalDate.toDateString();
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
writeValue(value: any): void {
|
|
400
|
-
if (this._value === value) return;
|
|
401
|
-
this._value = value ?? null;
|
|
402
|
-
this.syncInternalDate();
|
|
403
|
-
this.cdr.markForCheck();
|
|
404
|
-
}
|
|
405
|
-
registerOnChange(fn: any): void {
|
|
406
|
-
this.onChange = fn;
|
|
407
|
-
}
|
|
408
|
-
registerOnTouched(fn: any): void {
|
|
409
|
-
this.onTouched = fn;
|
|
410
|
-
}
|
|
411
|
-
setDisabledState(isDisabled: boolean): void {
|
|
412
|
-
this.disabled = isDisabled;
|
|
413
|
-
this.cdr.detectChanges();
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
@HostListener('document:click', ['$event'])
|
|
417
|
-
onClickOutside(event: Event) {
|
|
418
|
-
if (this.isOpen && !this.elementRef.nativeElement.contains(event.target)) {
|
|
419
|
-
this.isOpen = false;
|
|
420
|
-
this.onClickOut.emit(event);
|
|
421
|
-
this.setFocus(false, event);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
private syncInternalDate() {
|
|
425
|
-
if (!this._value) {
|
|
426
|
-
this.internalDate = null;
|
|
427
|
-
return;
|
|
428
|
-
}
|
|
429
|
-
this.internalDate = new Date(this._value);
|
|
430
|
-
}
|
|
431
|
-
private setFocus(state: boolean, event?: Event) {
|
|
432
|
-
if (this.disabled) return;
|
|
433
|
-
if (state !== this.isFocused) {
|
|
434
|
-
this.isFocused = state;
|
|
435
|
-
if (state) {
|
|
436
|
-
this.onFocus.emit(event);
|
|
437
|
-
} else {
|
|
438
|
-
this.onBlur.emit(event);
|
|
439
|
-
this.onTouched();
|
|
440
|
-
this.onTouched.emit();
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
get iconSize(): number {
|
|
445
|
-
return fieldIconSize(this.size);
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
toggleDropdown(event: Event) {
|
|
449
|
-
if (this.disabled) return;
|
|
450
|
-
this.isOpen = !this.isOpen;
|
|
451
|
-
|
|
452
|
-
if (this.isOpen) {
|
|
453
|
-
this.onClickIn.emit(event);
|
|
454
|
-
this.setFocus(true, event);
|
|
455
|
-
this.currentPlacement = this.placement;
|
|
456
|
-
setTimeout(() => this.calculateSmartPlacement(), 0);
|
|
457
|
-
} else {
|
|
458
|
-
this.onClickOut.emit(event);
|
|
459
|
-
this.setFocus(false, event);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
@HostListener('window:resize')
|
|
463
|
-
@HostListener('window:scroll')
|
|
464
|
-
onViewportChange() {
|
|
465
|
-
if (this.isOpen) this.calculateSmartPlacement();
|
|
466
|
-
}
|
|
467
|
-
clearValue(event: Event) {
|
|
468
|
-
event.stopPropagation();
|
|
469
|
-
if (this.disabled) return;
|
|
470
|
-
this._value = null;
|
|
471
|
-
this.internalDate = null;
|
|
472
|
-
this.onChange(null);
|
|
473
|
-
this.valueChange.emit(null);
|
|
474
|
-
this.onCleared.emit();
|
|
475
|
-
this.setFocus(true, event);
|
|
476
|
-
this.cdr.markForCheck();
|
|
477
|
-
}
|
|
478
|
-
onCalendarSelect(date: Date | null) {
|
|
479
|
-
if (!date) return;
|
|
480
|
-
this.internalDate = date;
|
|
481
|
-
|
|
482
|
-
const returnValue = this.formatReturnValue(date);
|
|
483
|
-
this._value = returnValue;
|
|
484
|
-
|
|
485
|
-
this.onChange(returnValue);
|
|
486
|
-
this.valueChange.emit(returnValue);
|
|
487
|
-
this.onDateSelected.emit(returnValue);
|
|
488
|
-
|
|
489
|
-
if (this.type === 'date') {
|
|
490
|
-
this.isOpen = false;
|
|
491
|
-
this.setFocus(false);
|
|
492
|
-
}
|
|
493
|
-
this.cdr.detectChanges();
|
|
494
|
-
}
|
|
495
|
-
private formatReturnValue(date: Date): any {
|
|
496
|
-
if (!this.valueFormat) return date;
|
|
497
|
-
if (this.valueFormat === 'timestamp') return date.getTime();
|
|
498
|
-
if (this.valueFormat === 'iso') return date.toISOString();
|
|
499
|
-
try {
|
|
500
|
-
return safeFormat(date, this.valueFormat, this.locale);
|
|
501
|
-
} catch {
|
|
502
|
-
return date;
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
private calculateSmartPlacement() {
|
|
506
|
-
if (!this.triggerEl?.nativeElement || !this.dropdownEl?.nativeElement) return;
|
|
507
|
-
const newPlacement = computeSmartPlacement(
|
|
508
|
-
this.triggerEl.nativeElement,
|
|
509
|
-
this.dropdownEl.nativeElement,
|
|
510
|
-
this.placement,
|
|
511
|
-
);
|
|
512
|
-
if (this.currentPlacement !== newPlacement) {
|
|
513
|
-
this.currentPlacement = newPlacement;
|
|
514
|
-
this.cdr.detectChanges();
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
export const DasarDatepickerComponent = [
|
|
520
|
-
DasarDatepicker,
|
|
521
|
-
DasarDatepickerLabelSlot,
|
|
522
|
-
DasarDatepickerExtraLabelSlot,
|
|
523
|
-
DasarDatepickerExtraHeaderSlot,
|
|
524
|
-
DasarDatepickerExtraFooterSlot,
|
|
525
|
-
DasarDatepickerHintSlot,
|
|
526
|
-
DasarDatepickerPrefixSlot,
|
|
527
|
-
] as const;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<span class="dasar-icon" [class.fluid]="fluid" [innerHTML]="svgContent"></span>
|