@onemrvapublic/design-system 1.0.0-beta.4 → 1.0.0-develop.1
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 +9 -4
- package/assets/i18n/de.json +84 -12
- package/assets/i18n/en.json +78 -6
- package/assets/i18n/fr.json +79 -7
- package/assets/i18n/nl.json +84 -12
- package/fesm2022/onemrvapublic-design-system-flag-icon.mjs +49 -0
- package/fesm2022/onemrvapublic-design-system-flag-icon.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-layout.mjs +948 -0
- package/fesm2022/onemrvapublic-design-system-layout.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-address.mjs +111 -0
- package/fesm2022/onemrvapublic-design-system-mat-address.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-avatar.mjs +318 -0
- package/fesm2022/onemrvapublic-design-system-mat-avatar.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-breadcrumb.mjs +125 -0
- package/fesm2022/onemrvapublic-design-system-mat-breadcrumb.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-carousel.mjs +208 -0
- package/fesm2022/onemrvapublic-design-system-mat-carousel.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-choice-chip.mjs +84 -0
- package/fesm2022/onemrvapublic-design-system-mat-choice-chip.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-copy-to-clipboard.mjs +90 -0
- package/fesm2022/onemrvapublic-design-system-mat-copy-to-clipboard.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-country-item.mjs +33 -0
- package/fesm2022/onemrvapublic-design-system-mat-country-item.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-datepicker-header.mjs +211 -0
- package/fesm2022/onemrvapublic-design-system-mat-datepicker-header.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-empty-row.mjs +42 -0
- package/fesm2022/onemrvapublic-design-system-mat-empty-row.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-file-upload.mjs +810 -0
- package/fesm2022/onemrvapublic-design-system-mat-file-upload.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-input-address.mjs +138 -0
- package/fesm2022/onemrvapublic-design-system-mat-input-address.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-input-birthplace.mjs +135 -0
- package/fesm2022/onemrvapublic-design-system-mat-input-birthplace.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-input-country.mjs +98 -0
- package/fesm2022/onemrvapublic-design-system-mat-input-country.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-input-enterprise-number.mjs +189 -0
- package/fesm2022/onemrvapublic-design-system-mat-input-enterprise-number.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-input-iban.mjs +308 -0
- package/fesm2022/onemrvapublic-design-system-mat-input-iban.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-input-phone.mjs +295 -0
- package/fesm2022/onemrvapublic-design-system-mat-input-phone.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-message-box.mjs +210 -0
- package/fesm2022/onemrvapublic-design-system-mat-message-box.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-multi-select.mjs +225 -0
- package/fesm2022/onemrvapublic-design-system-mat-multi-select.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-navigation.mjs +169 -0
- package/fesm2022/onemrvapublic-design-system-mat-navigation.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-notification.mjs +103 -0
- package/fesm2022/onemrvapublic-design-system-mat-notification.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-paginator.mjs +269 -0
- package/fesm2022/onemrvapublic-design-system-mat-paginator.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-panel.mjs +185 -0
- package/fesm2022/onemrvapublic-design-system-mat-panel.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-pop-over.mjs +118 -0
- package/fesm2022/onemrvapublic-design-system-mat-pop-over.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-progress-bar.mjs +52 -0
- package/fesm2022/onemrvapublic-design-system-mat-progress-bar.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-select-search.mjs +612 -0
- package/fesm2022/onemrvapublic-design-system-mat-select-search.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-selectable-box.mjs +96 -0
- package/fesm2022/onemrvapublic-design-system-mat-selectable-box.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-side-menu.mjs +72 -0
- package/fesm2022/onemrvapublic-design-system-mat-side-menu.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-skeleton.mjs +241 -0
- package/fesm2022/onemrvapublic-design-system-mat-skeleton.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-spinner.mjs +65 -0
- package/fesm2022/onemrvapublic-design-system-mat-spinner.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-stepper.mjs +146 -0
- package/fesm2022/onemrvapublic-design-system-mat-stepper.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-sticker.mjs +36 -0
- package/fesm2022/onemrvapublic-design-system-mat-sticker.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-table-of-content.mjs +232 -0
- package/fesm2022/onemrvapublic-design-system-mat-table-of-content.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-task-list.mjs +170 -0
- package/fesm2022/onemrvapublic-design-system-mat-task-list.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-timepicker.mjs +1363 -0
- package/fesm2022/onemrvapublic-design-system-mat-timepicker.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-toast.mjs +73 -0
- package/fesm2022/onemrvapublic-design-system-mat-toast.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-mat-tooltip.mjs +166 -0
- package/fesm2022/onemrvapublic-design-system-mat-tooltip.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-page-error.mjs +80 -0
- package/fesm2022/onemrvapublic-design-system-page-error.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-page-not-found.mjs +211 -0
- package/fesm2022/onemrvapublic-design-system-page-not-found.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-shared.mjs +2188 -0
- package/fesm2022/onemrvapublic-design-system-shared.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system-utils.mjs +35 -0
- package/fesm2022/onemrvapublic-design-system-utils.mjs.map +1 -0
- package/fesm2022/onemrvapublic-design-system.mjs +10573 -0
- package/fesm2022/onemrvapublic-design-system.mjs.map +1 -0
- package/flag-icon/index.d.ts +18 -0
- package/flag-icon/src/flag-icon.component.scss +12 -0
- package/index.d.ts +3140 -0
- package/layout/index.d.ts +293 -0
- package/layout/src/components/layout/layout.component.scss +90 -80
- package/layout/src/components/layout-drawer-actions/layout-drawer-actions.component.scss +3 -2
- package/layout/src/components/layout-drawer-content/layout-drawer-content.component.scss +9 -0
- package/layout/src/components/layout-drawer-title/layout-drawer-title.component.scss +9 -5
- package/layout/src/components/layout-left-sidenav/layout-left-sidenav.component.scss +5 -0
- package/layout/src/components/layout-sidenav/layout-sidenav.component.scss +43 -0
- package/layout/src/index.scss +0 -1
- package/mat-address/index.d.ts +36 -0
- package/mat-address/src/onemrva-address.scss +14 -0
- package/mat-avatar/index.d.ts +187 -0
- package/mat-avatar/src/onemrva-mat-avatar.component.scss +79 -123
- package/mat-breadcrumb/index.d.ts +40 -0
- package/mat-breadcrumb/src/onemrva-mat-breadcrumb.component.scss +39 -53
- package/mat-carousel/index.d.ts +52 -0
- package/mat-carousel/src/mat-carousel-item/onemrva-mat-carousel-item.component.scss +10 -0
- package/mat-carousel/src/onemrva-mat-carousel.component.scss +38 -45
- package/mat-choice-chip/index.d.ts +20 -0
- package/mat-choice-chip/src/onemrva-mat-choice-chip.component.scss +83 -0
- package/mat-copy-to-clipboard/index.d.ts +26 -0
- package/mat-country-item/index.d.ts +10 -0
- package/{mat-input-birthplace/src/country-item.component.scss → mat-country-item/src/onemrva-mat-country-item.component.scss} +6 -1
- package/mat-datepicker-header/index.d.ts +44 -0
- package/mat-datepicker-header/src/onemrva-mat-datepicker-header.component.scss +8 -0
- package/mat-empty-row/index.d.ts +19 -0
- package/mat-empty-row/src/onemrva-mat-empty-row.component.scss +29 -0
- package/mat-file-upload/index.d.ts +301 -0
- package/mat-file-upload/src/components/onemrva-mat-file-panel/onemrva-file-panel.component.scss +48 -16
- package/mat-file-upload/src/components/onemrva-mat-file-upload/onemrva-mat-file-upload.component.scss +72 -218
- package/mat-input-address/index.d.ts +32 -0
- package/mat-input-address/src/onemrva-mat-input-address.component.scss +8 -0
- package/mat-input-birthplace/index.d.ts +36 -0
- package/mat-input-birthplace/src/onemrva-mat-input-birthplace.component.scss +4 -2
- package/mat-input-country/index.d.ts +32 -0
- package/mat-input-country/src/onemrva-mat-input-country.component.scss +13 -0
- package/mat-input-enterprise-number/index.d.ts +37 -0
- package/mat-input-enterprise-number/src/onemrva-mat-input-enterprise-number.component.scss +7 -0
- package/mat-input-iban/index.d.ts +79 -0
- package/mat-input-iban/src/onemrva-mat-input-iban.component.scss +10 -0
- package/mat-input-phone/index.d.ts +44 -0
- package/mat-message-box/index.d.ts +101 -0
- package/mat-message-box/src/onemrva-mat-message-box.component.scss +13 -65
- package/mat-multi-select/index.d.ts +57 -0
- package/mat-multi-select/src/onemrva-mat-multi-select.component.scss +35 -0
- package/mat-navigation/index.d.ts +54 -0
- package/mat-navigation/src/mat-navigation-item/onemrva-mat-navigation-item.component.scss +66 -0
- package/mat-navigation/src/onemrva-mat-navigation.component.scss +36 -0
- package/mat-notification/index.d.ts +43 -0
- package/mat-notification/src/onemrva-mat-notification.component.scss +26 -0
- package/mat-paginator/index.d.ts +58 -0
- package/mat-paginator/src/onemrva-mat-paginator.component.scss +146 -0
- package/mat-panel/index.d.ts +66 -0
- package/mat-panel/src/mat-expansion-panel-header-arrow-divider.scss +11 -0
- package/mat-panel/src/onemrva-mat-panel-content.scss +8 -0
- package/mat-panel/src/onemrva-mat-panel-icon.scss +7 -0
- package/mat-panel/src/onemrva-mat-panel-title.scss +13 -0
- package/mat-panel/src/onemrva-mat-panel.component.scss +75 -82
- package/mat-pop-over/index.d.ts +40 -0
- package/mat-pop-over/src/onemrva-mat-pop-over.component.scss +11 -11
- package/mat-progress-bar/index.d.ts +18 -0
- package/mat-progress-bar/src/onemrva-mat-progress-bar.component.scss +26 -0
- package/mat-select-search/index.d.ts +197 -0
- package/mat-select-search/src/mat-select-search.component.scss +62 -109
- package/mat-selectable-box/index.d.ts +29 -0
- package/mat-selectable-box/src/onemrva-mat-selectable-box.component.scss +68 -90
- package/mat-side-menu/index.d.ts +33 -0
- package/mat-side-menu/src/onemrva-mat-side-menu.component.scss +36 -38
- package/mat-skeleton/index.d.ts +100 -0
- package/mat-skeleton/src/onemrva-mat-skeleton.component.scss +10 -59
- package/mat-spinner/index.d.ts +25 -0
- package/mat-spinner/src/onemrva-mat-spinner.component.scss +21 -0
- package/mat-stepper/index.d.ts +36 -0
- package/mat-stepper/src/onemrva-mat-stepper.scss +40 -105
- package/mat-sticker/index.d.ts +14 -0
- package/mat-sticker/src/onemrva-mat-sticker.component.scss +26 -63
- package/mat-table-of-content/index.d.ts +84 -0
- package/mat-table-of-content/src/onemrva-mat-table-of-content.component.scss +57 -0
- package/mat-task-list/index.d.ts +57 -0
- package/mat-task-list/src/onemrva-mat-task-content.scss +11 -0
- package/mat-task-list/src/onemrva-mat-task-list.component.scss +0 -150
- package/mat-task-list/src/onemrva-mat-task-title.scss +16 -0
- package/mat-task-list/src/onemrva-mat-task.component.scss +67 -0
- package/mat-timepicker/index.d.ts +386 -0
- package/mat-timepicker/src/clock/clock.component.scss +13 -7
- package/mat-timepicker/src/timepicker-dialog/timepicker-dialog.component.scss +2 -7
- package/mat-toast/index.d.ts +30 -0
- package/mat-toast/src/onemrva-mat-toast.component.scss +7 -49
- package/mat-tooltip/index.d.ts +39 -0
- package/mat-tooltip/src/onemrva-mat-tooltip.component.scss +8 -5
- package/package.json +196 -26
- package/page-error/index.d.ts +34 -0
- package/page-error/src/page-error.component.scss +25 -0
- package/page-not-found/index.d.ts +54 -0
- package/page-not-found/src/page-not-found-mixin.component.scss +1 -1
- package/page-not-found/src/page-not-found.component.scss +2 -2
- package/shared/index.d.ts +541 -0
- package/utils/index.d.ts +32 -0
- package/.eslintrc.json +0 -33
- package/_index.scss +0 -34
- package/_utils.scss +0 -30
- package/core/index.ts +0 -3
- package/core/ng-package.json +0 -6
- package/core/src/lib/core.module.ts +0 -26
- package/core/src/lib/modules/index.ts +0 -1
- package/core/src/lib/modules/translate.loader.ts +0 -34
- package/core/src/lib/modules/translate.module.ts +0 -66
- package/core/src/lib/services/index.ts +0 -2
- package/core/src/lib/services/onemrva-error-handler.service.ts +0 -24
- package/core/src/lib/services/onemrva-missing-translation.service.ts +0 -12
- package/core/src/test.ts +0 -30
- package/layout/index.ts +0 -7
- package/layout/ng-package.json +0 -6
- package/layout/src/components/index.ts +0 -37
- package/layout/src/components/layout/_layout-mixin.component.scss +0 -189
- package/layout/src/components/layout/layout.component.html +0 -213
- package/layout/src/components/layout/layout.component.spec.ts +0 -59
- package/layout/src/components/layout/layout.component.ts +0 -185
- package/layout/src/components/layout-after-nav/layout-after-nav.component.spec.ts +0 -24
- package/layout/src/components/layout-after-nav/layout-after-nav.component.ts +0 -24
- package/layout/src/components/layout-content/layout-content.component.spec.ts +0 -24
- package/layout/src/components/layout-content/layout-content.component.ts +0 -24
- package/layout/src/components/layout-drawer-actions/layout-drawer-actions.component.html +0 -1
- package/layout/src/components/layout-drawer-actions/layout-drawer-actions.component.ts +0 -14
- package/layout/src/components/layout-drawer-content/layout-drawer-content.component.html +0 -1
- package/layout/src/components/layout-drawer-content/layout-drawer-content.component.ts +0 -14
- package/layout/src/components/layout-drawer-title/layout-drawer-title.component.html +0 -7
- package/layout/src/components/layout-drawer-title/layout-drawer-title.component.ts +0 -18
- package/layout/src/components/layout-footer/layout-footer.component.ts +0 -11
- package/layout/src/components/layout-login-menu/layout-login-menu.component.spec.ts +0 -24
- package/layout/src/components/layout-login-menu/layout-login-menu.component.ts +0 -24
- package/layout/src/components/layout-route/layout-route.component.html +0 -64
- package/layout/src/components/layout-route/layout-route.component.spec.ts +0 -24
- package/layout/src/components/layout-route/layout-route.component.ts +0 -57
- package/layout/src/components/layout-sidenav/layout-sidenav.component.html +0 -104
- package/layout/src/components/layout-sidenav/layout-sidenav.component.ts +0 -88
- package/layout/src/components/layout-sidenav-title/layout-sidenav-title.component.ts +0 -9
- package/layout/src/components/layout-subroute/layout-subroute.component.html +0 -43
- package/layout/src/components/layout-subroute/layout-subroute.component.spec.ts +0 -24
- package/layout/src/components/layout-subroute/layout-subroute.component.ts +0 -62
- package/layout/src/components/layout-title/layout-title.component.spec.ts +0 -24
- package/layout/src/components/layout-title/layout-title.component.ts +0 -24
- package/layout/src/decorators/coerce-boolean-input.decorator.ts +0 -19
- package/layout/src/decorators/observable-content.decorator.ts +0 -13
- package/layout/src/directives/drawer-host.directive.ts +0 -42
- package/layout/src/enums/environment.enum.ts +0 -6
- package/layout/src/layout.module.ts +0 -47
- package/layout/src/models/onem-language.model.ts +0 -4
- package/layout/src/models/onemrva-profile.model.ts +0 -57
- package/layout/src/services/drawer.service.ts +0 -30
- package/layout/src/striphtml.pipe.ts +0 -10
- package/layout/src/test.ts +0 -31
- package/mat-avatar/index.ts +0 -2
- package/mat-avatar/ng-package.json +0 -6
- package/mat-avatar/src/onemrva-mat-avatar.component.html +0 -21
- package/mat-avatar/src/onemrva-mat-avatar.component.ts +0 -421
- package/mat-avatar/src/onemrva-mat-avatar.module.ts +0 -11
- package/mat-avatar/src/onemrva-mat.avatar.component.spec.ts +0 -54
- package/mat-badge/index.ts +0 -6
- package/mat-badge/ng-package.json +0 -6
- package/mat-badge/src/onemrva-mat-badge.component.scss +0 -157
- package/mat-badge/src/onemrva-mat-badge.component.ts +0 -331
- package/mat-badge/src/onemrva-mat-badge.module.ts +0 -8
- package/mat-breadcrumb/index.ts +0 -7
- package/mat-breadcrumb/ng-package.json +0 -6
- package/mat-breadcrumb/src/onemrva-mat-breadcrumb.component.html +0 -37
- package/mat-breadcrumb/src/onemrva-mat-breadcrumb.component.ts +0 -16
- package/mat-breadcrumb/src/onemrva-mat-breadcrumb.model.ts +0 -4
- package/mat-breadcrumb/src/onemrva-mat-breadcrumb.module.ts +0 -12
- package/mat-breadcrumb/src/onemrva-mat-breadcrumb.service.ts +0 -65
- package/mat-carousel/index.ts +0 -2
- package/mat-carousel/ng-package.json +0 -6
- package/mat-carousel/src/mat-carousel-item/onemrva-mat-carousel-item.component.html +0 -5
- package/mat-carousel/src/mat-carousel-item/onemrva-mat-carousel-item.component.ts +0 -27
- package/mat-carousel/src/onemrva-mat-carousel-item.directive.ts +0 -8
- package/mat-carousel/src/onemrva-mat-carousel.component.html +0 -43
- package/mat-carousel/src/onemrva-mat-carousel.component.ts +0 -160
- package/mat-copy-to-clipboard/index.ts +0 -1
- package/mat-copy-to-clipboard/ng-package.json +0 -6
- package/mat-copy-to-clipboard/src/components/copy-to-clipboard.component.html +0 -14
- package/mat-copy-to-clipboard/src/components/copy-to-clipboard.component.ts +0 -76
- package/mat-datepicker-header/index.ts +0 -5
- package/mat-datepicker-header/ng-package.json +0 -6
- package/mat-datepicker-header/src/_onemrva-mat-datepicker-header.component.scss +0 -12
- package/mat-datepicker-header/src/onemrva-mat-datepicker-header.component.html +0 -54
- package/mat-datepicker-header/src/onemrva-mat-datepicker-header.component.ts +0 -283
- package/mat-file-upload/index.ts +0 -11
- package/mat-file-upload/ng-package.json +0 -6
- package/mat-file-upload/src/components/index.ts +0 -10
- package/mat-file-upload/src/components/onemrva-mat-file-panel/onemrva-file-panel.component.html +0 -59
- package/mat-file-upload/src/components/onemrva-mat-file-panel/onemrva-file-panel.component.ts +0 -79
- package/mat-file-upload/src/components/onemrva-mat-file-upload/onemrva-mat-file-upload.component.html +0 -58
- package/mat-file-upload/src/components/onemrva-mat-file-upload/onemrva-mat-file-upload.component.ts +0 -209
- package/mat-file-upload/src/directives/dnd.directive.ts +0 -41
- package/mat-file-upload/src/models/action-config.model.ts +0 -10
- package/mat-file-upload/src/models/progress-file.model.ts +0 -94
- package/mat-file-upload/src/onemrva-mat-file-upload-itf.store.ts +0 -79
- package/mat-file-upload/src/onemrva-mat-file-upload.module.ts +0 -28
- package/mat-file-upload/src/onemrva-mat-file-upload.service.ts +0 -68
- package/mat-file-upload/src/onemrva-mat-file-upload.store.ts +0 -482
- package/mat-input-bank-account/index.ts +0 -5
- package/mat-input-bank-account/ng-package.json +0 -6
- package/mat-input-bank-account/src/bank-account.component.html +0 -36
- package/mat-input-bank-account/src/bank-account.component.scss +0 -42
- package/mat-input-bank-account/src/bank-account.component.ts +0 -308
- package/mat-input-bank-account/src/onemrva-mat-input-bank-account.component.html +0 -11
- package/mat-input-bank-account/src/onemrva-mat-input-bank-account.component.scss +0 -14
- package/mat-input-bank-account/src/onemrva-mat-input-bank-account.component.ts +0 -82
- package/mat-input-birthplace/index.ts +0 -5
- package/mat-input-birthplace/ng-package.json +0 -6
- package/mat-input-birthplace/src/country-item.component.html +0 -8
- package/mat-input-birthplace/src/country-item.component.ts +0 -33
- package/mat-input-birthplace/src/onemrva-mat-input-birthplace.component.html +0 -28
- package/mat-input-birthplace/src/onemrva-mat-input-birthplace.component.ts +0 -129
- package/mat-input-country/index.ts +0 -6
- package/mat-input-country/ng-package.json +0 -6
- package/mat-input-country/src/countries.ts +0 -3198
- package/mat-input-country/src/onemrva-mat-input-country.component.html +0 -25
- package/mat-input-country/src/onemrva-mat-input-country.component.ts +0 -152
- package/mat-input-enterprise-number/index.ts +0 -5
- package/mat-input-enterprise-number/ng-package.json +0 -6
- package/mat-input-enterprise-number/src/onemrva-mat-input-enterprise-number.component.html +0 -42
- package/mat-input-enterprise-number/src/onemrva-mat-input-enterprise-number.component.ts +0 -212
- package/mat-input-phone/index.ts +0 -6
- package/mat-input-phone/ng-package.json +0 -6
- package/mat-input-phone/src/onemrva-mat-input-phone.component.html +0 -47
- package/mat-input-phone/src/onemrva-mat-input-phone.component.ts +0 -274
- package/mat-input-phone/src/phone-number.directive.ts +0 -46
- package/mat-message-box/index.ts +0 -2
- package/mat-message-box/ng-package.json +0 -6
- package/mat-message-box/src/onemrva-mat-message-box.component.html +0 -3
- package/mat-message-box/src/onemrva-mat-message-box.component.ts +0 -172
- package/mat-message-box/src/onemrva-mat-message-box.module.ts +0 -12
- package/mat-multi-select/index.ts +0 -2
- package/mat-multi-select/ng-package.json +0 -6
- package/mat-multi-select/src/_onemrva-mat-multi-select.component.scss +0 -66
- package/mat-multi-select/src/onemrva-mat-multi-select.component.html +0 -44
- package/mat-multi-select/src/onemrva-mat-multi-select.component.ts +0 -194
- package/mat-multi-select/src/onemrva-mat-multi-select.module.ts +0 -27
- package/mat-multi-select/src/onemrva-mat-select-counter.component.ts +0 -0
- package/mat-notification/index.ts +0 -1
- package/mat-notification/ng-package.json +0 -6
- package/mat-notification/src/_onemrva-mat-notification.component.scss +0 -102
- package/mat-notification/src/onemrva-mat-notification.component.html +0 -15
- package/mat-notification/src/onemrva-mat-notification.component.ts +0 -158
- package/mat-paginator/index.ts +0 -6
- package/mat-paginator/ng-package.json +0 -6
- package/mat-paginator/src/_onemrva-mat-paginator.component.scss +0 -122
- package/mat-paginator/src/onemrva-mat-paginator.component.html +0 -108
- package/mat-paginator/src/onemrva-mat-paginator.component.spec.ts +0 -184
- package/mat-paginator/src/onemrva-mat-paginator.component.ts +0 -216
- package/mat-paginator/src/onemrva-mat-paginator.module.ts +0 -21
- package/mat-panel/index.ts +0 -6
- package/mat-panel/ng-package.json +0 -6
- package/mat-panel/src/onemrva-mat-panel-content.component.ts +0 -11
- package/mat-panel/src/onemrva-mat-panel-content.html +0 -5
- package/mat-panel/src/onemrva-mat-panel-icon.component.ts +0 -11
- package/mat-panel/src/onemrva-mat-panel-icon.html +0 -5
- package/mat-panel/src/onemrva-mat-panel-title-action.component.ts +0 -11
- package/mat-panel/src/onemrva-mat-panel-title-action.html +0 -5
- package/mat-panel/src/onemrva-mat-panel-title.component.ts +0 -29
- package/mat-panel/src/onemrva-mat-panel-title.html +0 -8
- package/mat-panel/src/onemrva-mat-panel.component.html +0 -10
- package/mat-panel/src/onemrva-mat-panel.component.ts +0 -122
- package/mat-panel/src/onemrva-mat-panel.module.ts +0 -26
- package/mat-pop-over/index.ts +0 -4
- package/mat-pop-over/ng-package.json +0 -6
- package/mat-pop-over/src/onemrva-mat-pop-over-content.component.ts +0 -13
- package/mat-pop-over/src/onemrva-mat-pop-over-trigger.component.ts +0 -13
- package/mat-pop-over/src/onemrva-mat-pop-over.component.html +0 -29
- package/mat-pop-over/src/onemrva-mat-pop-over.component.ts +0 -46
- package/mat-pop-over/src/onemrva-mat-pop-over.module.ts +0 -19
- package/mat-progress-bar/index.ts +0 -1
- package/mat-progress-bar/ng-package.json +0 -6
- package/mat-progress-bar/src/_onemrva-mat-progress-bar-mixin.component.scss +0 -37
- package/mat-progress-bar/src/onemrva-mat-progress-bar.component.html +0 -13
- package/mat-progress-bar/src/onemrva-mat-progress-bar.component.ts +0 -27
- package/mat-select-search/index.ts +0 -3
- package/mat-select-search/ng-package.json +0 -6
- package/mat-select-search/src/default-options.ts +0 -48
- package/mat-select-search/src/mat-select-no-entries-found.directive.ts +0 -15
- package/mat-select-search/src/mat-select-search-clear.directive.ts +0 -13
- package/mat-select-search/src/mat-select-search.component.html +0 -82
- package/mat-select-search/src/mat-select-search.component.spec.ts +0 -790
- package/mat-select-search/src/mat-select-search.component.ts +0 -705
- package/mat-select-search/src/mat-select-search.module.ts +0 -52
- package/mat-selectable-box/index.ts +0 -6
- package/mat-selectable-box/ng-package.json +0 -6
- package/mat-selectable-box/src/onemrva-mat-selectable-box.component.ts +0 -99
- package/mat-selectable-box/src/onemrva-mat-selectable-box.module.ts +0 -30
- package/mat-side-menu/index.ts +0 -6
- package/mat-side-menu/ng-package.json +0 -6
- package/mat-side-menu/src/onemrva-mat-side-menu.component.html +0 -36
- package/mat-side-menu/src/onemrva-mat-side-menu.component.spec.ts +0 -66
- package/mat-side-menu/src/onemrva-mat-side-menu.component.ts +0 -58
- package/mat-side-menu/src/onemrva-mat-side-menu.module.ts +0 -14
- package/mat-skeleton/index.ts +0 -3
- package/mat-skeleton/ng-package.json +0 -6
- package/mat-skeleton/src/onemrva-mat-skeleton-enums.ts +0 -32
- package/mat-skeleton/src/onemrva-mat-skeleton.component.html +0 -14
- package/mat-skeleton/src/onemrva-mat-skeleton.component.ts +0 -187
- package/mat-skeleton/src/onemrva-mat-skeleton.module.ts +0 -10
- package/mat-spinner/index.ts +0 -7
- package/mat-spinner/ng-package.json +0 -6
- package/mat-spinner/src/_onemrva-mat-spinner.component.scss +0 -151
- package/mat-spinner/src/onemrva-mat-loading.directive.ts +0 -41
- package/mat-spinner/src/onemrva-mat-spinner.component.html +0 -2138
- package/mat-spinner/src/onemrva-mat-spinner.component.ts +0 -52
- package/mat-spinner/src/onemrva-mat-spinner.module.ts +0 -10
- package/mat-stepper/index.ts +0 -6
- package/mat-stepper/ng-package.json +0 -6
- package/mat-stepper/src/_stepper-variables.scss +0 -29
- package/mat-stepper/src/onemrva-mat-stepper.component.spec.ts +0 -22
- package/mat-stepper/src/onemrva-mat-stepper.component.ts +0 -57
- package/mat-stepper/src/onemrva-mat-stepper.html +0 -61
- package/mat-stepper/src/onemrva-mat-stepper.module.ts +0 -24
- package/mat-stepper/src/onemrva-stepper-animations.ts +0 -42
- package/mat-sticker/index.ts +0 -6
- package/mat-sticker/ng-package.json +0 -6
- package/mat-sticker/src/onemrva-mat-sticker.component.spec.ts +0 -16
- package/mat-sticker/src/onemrva-mat-sticker.component.ts +0 -58
- package/mat-sticker/src/onemrva-mat-sticker.module.ts +0 -10
- package/mat-table-of-content/index.ts +0 -8
- package/mat-table-of-content/ng-package.json +0 -6
- package/mat-table-of-content/src/_onemrva-mat-table-of-content.component.scss +0 -79
- package/mat-table-of-content/src/onemrva-mat-table-of-content.component.html +0 -23
- package/mat-table-of-content/src/onemrva-mat-table-of-content.component.ts +0 -126
- package/mat-table-of-content/src/onemrva-mat-table-of-content.directive.ts +0 -67
- package/mat-table-of-content/src/onemrva-mat-table-of-content.service.ts +0 -51
- package/mat-table-of-content/src/onemrva-mat-toc-anchor.model.ts +0 -24
- package/mat-task-list/index.ts +0 -5
- package/mat-task-list/ng-package.json +0 -6
- package/mat-task-list/src/onemrva-mat-task-content.component.ts +0 -11
- package/mat-task-list/src/onemrva-mat-task-content.html +0 -5
- package/mat-task-list/src/onemrva-mat-task-list.component.html +0 -1
- package/mat-task-list/src/onemrva-mat-task-list.component.ts +0 -39
- package/mat-task-list/src/onemrva-mat-task-list.module.ts +0 -31
- package/mat-task-list/src/onemrva-mat-task-title.component.ts +0 -24
- package/mat-task-list/src/onemrva-mat-task-title.html +0 -5
- package/mat-task-list/src/onemrva-mat-task.component.html +0 -23
- package/mat-task-list/src/onemrva-mat-task.component.ts +0 -121
- package/mat-timepicker/index.ts +0 -6
- package/mat-timepicker/ng-package.json +0 -6
- package/mat-timepicker/src/clock/clock.component.html +0 -109
- package/mat-timepicker/src/clock/clock.component.spec.ts +0 -38
- package/mat-timepicker/src/clock/clock.component.ts +0 -274
- package/mat-timepicker/src/interfaces-and-types.ts +0 -18
- package/mat-timepicker/src/onemrva-mat-timepicker.component.html +0 -0
- package/mat-timepicker/src/onemrva-mat-timepicker.component.ts +0 -300
- package/mat-timepicker/src/onemrva-mat-timepicker.module.ts +0 -40
- package/mat-timepicker/src/timepicker-dialog/timepicker-dialog.component.html +0 -53
- package/mat-timepicker/src/timepicker-dialog/timepicker-dialog.component.spec.ts +0 -41
- package/mat-timepicker/src/timepicker-dialog/timepicker-dialog.component.ts +0 -176
- package/mat-timepicker/src/timepicker-toggle/timepicker-toggle.component.html +0 -15
- package/mat-timepicker/src/timepicker-toggle/timepicker-toggle.component.ts +0 -140
- package/mat-timepicker/src/timepicker.directive.ts +0 -596
- package/mat-timepicker/src/util.ts +0 -109
- package/mat-toast/index.ts +0 -6
- package/mat-toast/ng-package.json +0 -6
- package/mat-toast/src/onemrva-mat-toast.component.ts +0 -36
- package/mat-toast/src/onemrva-mat-toast.module.ts +0 -11
- package/mat-tooltip/index.ts +0 -4
- package/mat-tooltip/ng-package.json +0 -6
- package/mat-tooltip/src/onemrva-mat-tooltip.component.ts +0 -21
- package/mat-tooltip/src/onemrva-mat-tooltip.directive.ts +0 -123
- package/mat-tooltip/src/onemrva-mat-tooltip.module.ts +0 -11
- package/ng-package.json +0 -25
- package/npm-shrinkwrap.json +0 -30
- package/page-not-found/index.ts +0 -5
- package/page-not-found/ng-package.json +0 -6
- package/page-not-found/src/page-not-found-action.component.ts +0 -9
- package/page-not-found/src/page-not-found-extra.component.ts +0 -9
- package/page-not-found/src/page-not-found-invader.component.ts +0 -93
- package/page-not-found/src/page-not-found.component.html +0 -47
- package/page-not-found/src/page-not-found.component.ts +0 -60
- package/page-not-found/src/page-not-found.module.ts +0 -24
- package/shared/index.ts +0 -17
- package/shared/ng-package.json +0 -6
- package/shared/src/lib/OnemrvaDateAdapter.ts +0 -78
- package/shared/src/lib/components/clipboard-icon/clipboard-icon.component.css +0 -0
- package/shared/src/lib/components/clipboard-icon/clipboard-icon.component.html +0 -1
- package/shared/src/lib/components/clipboard-icon/clipboard-icon.component.spec.ts +0 -21
- package/shared/src/lib/components/clipboard-icon/clipboard-icon.component.ts +0 -18
- package/shared/src/lib/containers/WebComponentOverlayContainer.ts +0 -90
- package/shared/src/lib/containers/index.ts +0 -1
- package/shared/src/lib/date.format.ts +0 -11
- package/shared/src/lib/directives/clipboard.directive.ts +0 -52
- package/shared/src/lib/directives/color.directive.ts +0 -46
- package/shared/src/lib/directives/digit-only.directive.ts +0 -46
- package/shared/src/lib/directives/if-width-is.directive.ts +0 -39
- package/shared/src/lib/directives/index.ts +0 -22
- package/shared/src/lib/directives/mask.directive.ts +0 -223
- package/shared/src/lib/directives/mat-row-clickable.directive.ts +0 -66
- package/shared/src/lib/interfaces/OnemRvaCommonCountry.interface.ts +0 -23
- package/shared/src/lib/interfaces/index.ts +0 -1
- package/shared/src/lib/pipes/index.ts +0 -2
- package/shared/src/lib/pipes/onemrva-bce.pipe.ts +0 -18
- package/shared/src/lib/pipes/onemrva-niss.pipe.ts +0 -18
- package/shared/src/lib/services/commonCountryLookup.service.ts +0 -50
- package/shared/src/lib/services/index.ts +0 -1
- package/shared/src/lib/shared.datepicker.module.ts +0 -60
- package/shared/src/lib/shared.module.ts +0 -10
- package/shared/src/lib/validators/bankAccountValidator.utils.ts +0 -61
- package/shared/src/lib/validators/onemrva-validators.spec.ts +0 -79
- package/shared/src/lib/validators/onemrva-validators.ts +0 -97
- package/shared/src/onemrva-validators.spec.ts +0 -14
- package/src/polyfills.ts +0 -52
- package/src/public-api.spec.ts +0 -7
- package/src/public-api.ts +0 -5
- package/tsconfig.lib.json +0 -12
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -10
- package/utils/index.ts +0 -2
- package/utils/ng-package.json +0 -6
- package/utils/src/enum.utils.ts +0 -8
- package/utils/src/enums/color.enum.ts +0 -14
- package/utils/src/enums/index.ts +0 -2
- package/utils/src/enums/size.enum.ts +0 -11
- /package/{assets/.gitkeep → mat-navigation/src/mat-navigation-tree/onemrva-mat-navigation-tree.component.scss} +0 -0
|
@@ -0,0 +1,1363 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Input, Output, ChangeDetectionStrategy, Component, inject, HostBinding, Directive, ChangeDetectorRef, HostAttributeToken, ViewEncapsulation, Renderer2, NgZone, ElementRef, HostListener, NgModule } from '@angular/core';
|
|
3
|
+
import { OnemrvaMatSize, OnemrvaMatColor } from '@onemrvapublic/design-system/utils';
|
|
4
|
+
import { MatDialog, MAT_DIALOG_DATA, MatDialogContent, MatDialogActions } from '@angular/material/dialog';
|
|
5
|
+
import { MatToolbar } from '@angular/material/toolbar';
|
|
6
|
+
import { NgClass } from '@angular/common';
|
|
7
|
+
import { MatMiniFabButton, MatButton, MatIconButton } from '@angular/material/button';
|
|
8
|
+
import { OnemRvaColorDirective } from '@onemrvapublic/design-system/shared';
|
|
9
|
+
import { Subject, Subscription, of, merge } from 'rxjs';
|
|
10
|
+
import { takeUntil, first } from 'rxjs/operators';
|
|
11
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
12
|
+
import { MatIcon } from '@angular/material/icon';
|
|
13
|
+
import { Validators, NgControl, NgForm, FormGroupDirective } from '@angular/forms';
|
|
14
|
+
import { MatFormField, MatFormFieldControl } from '@angular/material/form-field';
|
|
15
|
+
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
16
|
+
import { ErrorStateMatcher } from '@angular/material/core';
|
|
17
|
+
import { Platform } from '@angular/cdk/platform';
|
|
18
|
+
|
|
19
|
+
function twoDigits(n) {
|
|
20
|
+
return n < 10 ? `0${n}` : `${n}`;
|
|
21
|
+
}
|
|
22
|
+
function addDays(date, days) {
|
|
23
|
+
const result = new Date(date);
|
|
24
|
+
result.setDate(result.getDate() + days);
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
function convertHoursForMode(hour) {
|
|
28
|
+
const isPm = hour >= 12;
|
|
29
|
+
return { hour, isPm };
|
|
30
|
+
}
|
|
31
|
+
function mod(a, b) {
|
|
32
|
+
return a - Math.floor(a / b) * b;
|
|
33
|
+
}
|
|
34
|
+
function getShortestAngle(from, to) {
|
|
35
|
+
const difference = to - from;
|
|
36
|
+
return from + mod(difference + 180, 360) - 180;
|
|
37
|
+
}
|
|
38
|
+
function isDateInRange(minDate, maxDate, current) {
|
|
39
|
+
const unixCurrentDate = +current;
|
|
40
|
+
return ((!minDate || +minDate <= unixCurrentDate) &&
|
|
41
|
+
(!maxDate || unixCurrentDate <= +maxDate));
|
|
42
|
+
}
|
|
43
|
+
function isTimeInRange(minDate, maxDate, current) {
|
|
44
|
+
if (minDate instanceof Date) {
|
|
45
|
+
const newMinDate = new Date();
|
|
46
|
+
newMinDate.setHours(minDate.getHours());
|
|
47
|
+
newMinDate.setMinutes(minDate.getMinutes());
|
|
48
|
+
newMinDate.setSeconds(0);
|
|
49
|
+
newMinDate.setMilliseconds(0);
|
|
50
|
+
minDate = newMinDate;
|
|
51
|
+
}
|
|
52
|
+
if (maxDate instanceof Date) {
|
|
53
|
+
const newMaxDate = new Date();
|
|
54
|
+
newMaxDate.setHours(maxDate.getHours());
|
|
55
|
+
newMaxDate.setMinutes(maxDate.getMinutes());
|
|
56
|
+
newMaxDate.setSeconds(0);
|
|
57
|
+
newMaxDate.setMilliseconds(0);
|
|
58
|
+
maxDate = newMaxDate;
|
|
59
|
+
}
|
|
60
|
+
if (current instanceof Date) {
|
|
61
|
+
const newCurrent = new Date();
|
|
62
|
+
newCurrent.setHours(current.getHours());
|
|
63
|
+
newCurrent.setMinutes(current.getMinutes());
|
|
64
|
+
newCurrent.setSeconds(0);
|
|
65
|
+
newCurrent.setMilliseconds(0);
|
|
66
|
+
current = newCurrent;
|
|
67
|
+
}
|
|
68
|
+
const unixCurrentDate = +current;
|
|
69
|
+
return ((!minDate || +minDate <= unixCurrentDate) &&
|
|
70
|
+
(!maxDate || unixCurrentDate <= +maxDate));
|
|
71
|
+
}
|
|
72
|
+
// used when generating the allowed maps
|
|
73
|
+
function isAllowed(hour, minutes, minDate, maxDate) {
|
|
74
|
+
if (hour > 24 || hour < 0 || minutes > 60 || minutes < 0) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
if (!minDate && !maxDate) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
const checkDate = new Date();
|
|
81
|
+
checkDate.setHours(hour);
|
|
82
|
+
checkDate.setMinutes(minutes);
|
|
83
|
+
checkDate.setSeconds(0);
|
|
84
|
+
checkDate.setMilliseconds(0);
|
|
85
|
+
return isDateInRange(minDate, maxDate, checkDate);
|
|
86
|
+
}
|
|
87
|
+
// used by the clock component to visually disable the not allowed values
|
|
88
|
+
function getIsAvailabeFn(allowed24HourMap) {
|
|
89
|
+
return (value, viewType, h) => {
|
|
90
|
+
const isHourCheck = viewType === 'hours';
|
|
91
|
+
const [hour, minutes] = isHourCheck ? [value, 0] : [h, value];
|
|
92
|
+
if (!allowed24HourMap) {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
if (isHourCheck) {
|
|
96
|
+
return !!Object.values(allowed24HourMap[hour]).find(v => v === true);
|
|
97
|
+
}
|
|
98
|
+
return allowed24HourMap[hour][minutes];
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
class ClockComponent {
|
|
103
|
+
constructor() {
|
|
104
|
+
this.viewType = 'hours';
|
|
105
|
+
this.formattedValue = 0;
|
|
106
|
+
this.formattedHours = 0;
|
|
107
|
+
this.changeEvent = new EventEmitter();
|
|
108
|
+
this.unavailableSelection = new EventEmitter();
|
|
109
|
+
this.invalidSelection = new EventEmitter();
|
|
110
|
+
this.isFormattedValueAllowed = true;
|
|
111
|
+
this.touching = false;
|
|
112
|
+
this.numbers = [];
|
|
113
|
+
this.secondaryNumbers = [];
|
|
114
|
+
this.minuteDots = [];
|
|
115
|
+
this.invalidMeridiemEmitted = true;
|
|
116
|
+
this.handleTouchMove = (e) => {
|
|
117
|
+
e.preventDefault(); // prevent scrolling behind the clock on iOS
|
|
118
|
+
const rect = e.target.getBoundingClientRect();
|
|
119
|
+
this.movePointer(e.changedTouches[0].clientX - rect.left, e.changedTouches[0].clientY - rect.top);
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
initIsAllowedFn() {
|
|
123
|
+
if (!this.allowed24HourMap) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
this.isAvailableFn = getIsAvailabeFn(this.allowed24HourMap);
|
|
127
|
+
}
|
|
128
|
+
isAvailable(value) {
|
|
129
|
+
return this.isAvailableFn
|
|
130
|
+
? this.isAvailableFn(value, this.viewType, this.formattedHours)
|
|
131
|
+
: true;
|
|
132
|
+
}
|
|
133
|
+
ngOnChanges(simpleChanges) {
|
|
134
|
+
if (simpleChanges['allowed24HourMap'] ||
|
|
135
|
+
(simpleChanges['mode'] && !simpleChanges['mode'].firstChange)) {
|
|
136
|
+
this.initIsAllowedFn();
|
|
137
|
+
}
|
|
138
|
+
this.calculateAngule();
|
|
139
|
+
this.setNumbers();
|
|
140
|
+
if (simpleChanges['formattedValue'] && this.allowed24HourMap) {
|
|
141
|
+
this.isFormattedValueAllowed = this.isAvailable(this.formattedValue);
|
|
142
|
+
}
|
|
143
|
+
const isSelectedTimeAvailable = this.isAvailableFn
|
|
144
|
+
? this.isAvailableFn(this.formattedValue, 'minutes', this.formattedHours)
|
|
145
|
+
: true;
|
|
146
|
+
if (this.viewType === 'minutes' && this.isAvailableFn) {
|
|
147
|
+
const areMinitesAvailable = this.isAvailableFn(this.minutes, 'minutes', this.formattedHours);
|
|
148
|
+
if (!areMinitesAvailable) {
|
|
149
|
+
if (this.minDate && this.minDate.getMinutes() > this.minutes) {
|
|
150
|
+
setTimeout(() => {
|
|
151
|
+
this.changeEvent.emit({
|
|
152
|
+
value: this.minDate.getMinutes(),
|
|
153
|
+
type: 'minutes',
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
setTimeout(() => {
|
|
159
|
+
this.changeEvent.emit({
|
|
160
|
+
value: this.maxDate.getMinutes(),
|
|
161
|
+
type: 'minutes',
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (isSelectedTimeAvailable && this.invalidMeridiemEmitted) {
|
|
168
|
+
this.invalidMeridiemEmitted = false;
|
|
169
|
+
}
|
|
170
|
+
this.invalidSelection.emit(!isSelectedTimeAvailable);
|
|
171
|
+
}
|
|
172
|
+
calculateAngule() {
|
|
173
|
+
this.angle = this.getPointerAngle(this.formattedValue, this.viewType);
|
|
174
|
+
}
|
|
175
|
+
setNumbers() {
|
|
176
|
+
if (this.viewType === 'hours') {
|
|
177
|
+
// if (this.mode === '12h') {
|
|
178
|
+
// const meridiem : string = this.isPm ? 'pm' : 'am';
|
|
179
|
+
// const isAllowedFn = this.allowed12HourMap ? (num : number) => this.allowed12HourMap[meridiem][num + 1][0] : undefined;
|
|
180
|
+
// this.numbers = this.getNumbers(12, { size: 256 }, isAllowedFn);
|
|
181
|
+
// this.secondaryNumbers = [];
|
|
182
|
+
// this.minuteDots = [];
|
|
183
|
+
// } else if (this.mode === '24h') {
|
|
184
|
+
const isAllowedFn = this.allowed24HourMap
|
|
185
|
+
? (num) => this.allowed24HourMap[num][0]
|
|
186
|
+
: undefined;
|
|
187
|
+
this.numbers = this.getNumbers(12, { size: 256 }, isAllowedFn);
|
|
188
|
+
this.secondaryNumbers = this.getNumbers(12, { size: 256 - 64, start: 13 }, isAllowedFn);
|
|
189
|
+
this.minuteDots = [];
|
|
190
|
+
//}
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
//const meridiem : string = this.isPm ? 'pm' : 'am';
|
|
194
|
+
const isAllowedFn =
|
|
195
|
+
// !!this.allowed12HourMap ? (num : number) => this.allowed12HourMap[meridiem][this.formattedHours][num] :
|
|
196
|
+
this.allowed24HourMap
|
|
197
|
+
? (num) => this.allowed24HourMap[this.formattedHours][num]
|
|
198
|
+
: undefined;
|
|
199
|
+
this.numbers = this.getNumbers(12, { size: 256, start: 5, step: 5 }, isAllowedFn);
|
|
200
|
+
this.minuteDots = this.getNumbers(60, { size: 256, start: 13 }).map(digit => {
|
|
201
|
+
if (digit.display <= 59) {
|
|
202
|
+
digit.allowed = isAllowedFn ? isAllowedFn(digit.display) : true;
|
|
203
|
+
return digit;
|
|
204
|
+
}
|
|
205
|
+
digit.display = digit.display - 60;
|
|
206
|
+
digit.allowed = isAllowedFn ? isAllowedFn(digit.display) : true;
|
|
207
|
+
return digit;
|
|
208
|
+
});
|
|
209
|
+
this.secondaryNumbers = [];
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
disableAnimatedPointer() {
|
|
213
|
+
this.touching = true;
|
|
214
|
+
}
|
|
215
|
+
enableAnimatedPointer() {
|
|
216
|
+
this.touching = false;
|
|
217
|
+
}
|
|
218
|
+
handleTouchEnd(e) {
|
|
219
|
+
this.handleTouchMove(e);
|
|
220
|
+
this.enableAnimatedPointer();
|
|
221
|
+
}
|
|
222
|
+
handleMouseMove(e) {
|
|
223
|
+
// MouseEvent.which is deprecated, but MouseEvent.buttons is not supported in Safari
|
|
224
|
+
if (e.buttons === 1 || e.which === 1) {
|
|
225
|
+
const rect = e.target.getBoundingClientRect();
|
|
226
|
+
this.movePointer(e.clientX - rect.left, e.clientY - rect.top);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
handleClick(e) {
|
|
230
|
+
const rect = e.target.getBoundingClientRect();
|
|
231
|
+
this.movePointer(e.clientX - rect.left, e.clientY - rect.top);
|
|
232
|
+
}
|
|
233
|
+
movePointer(x, y) {
|
|
234
|
+
const value = this.getPointerValue(x, y, 256);
|
|
235
|
+
if (!this.isAvailable(value)) {
|
|
236
|
+
this.unavailableSelection.emit();
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
if (value !== this.formattedValue) {
|
|
240
|
+
this.changeEvent.emit({
|
|
241
|
+
value,
|
|
242
|
+
type: this.viewType !== 'minutes' ? 'hours' : 'minutes',
|
|
243
|
+
});
|
|
244
|
+
if (this.viewType !== 'minutes') {
|
|
245
|
+
if (!this.isAvailable(value)) {
|
|
246
|
+
if (this.minDate && this.isAvailable(value)) {
|
|
247
|
+
this.changeEvent.emit({
|
|
248
|
+
value: this.minDate.getMinutes(),
|
|
249
|
+
type: 'minutes',
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
else if (this.maxDate && this.isAvailable(value)) {
|
|
253
|
+
this.changeEvent.emit({
|
|
254
|
+
value: this.maxDate.getMinutes(),
|
|
255
|
+
type: 'minutes',
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
getNumbers(count, { size = 0, start = 1, step = 1 }, isAllowedFn) {
|
|
263
|
+
// eslint-disable-next-line
|
|
264
|
+
return Array.apply(null, Array(count)).map((_, i) => ({
|
|
265
|
+
display: i * step + start,
|
|
266
|
+
translateX: (size / 2 - 20) * Math.cos((2 * Math.PI * (i - 2)) / count),
|
|
267
|
+
translateY: (size / 2 - 20) * Math.sin((2 * Math.PI * (i - 2)) / count),
|
|
268
|
+
allowed: isAllowedFn ? isAllowedFn(i) : true,
|
|
269
|
+
}));
|
|
270
|
+
}
|
|
271
|
+
getPointerAngle(value, _mode) {
|
|
272
|
+
if (this.viewType === 'hours') {
|
|
273
|
+
return (360 / 12) * ((value % 12) - 3);
|
|
274
|
+
}
|
|
275
|
+
return (360 / 60) * (value - 15);
|
|
276
|
+
}
|
|
277
|
+
getPointerValue(x, y, size) {
|
|
278
|
+
let value;
|
|
279
|
+
let angle = (Math.atan2(size / 2 - x, size / 2 - y) / Math.PI) * 180;
|
|
280
|
+
if (angle < 0) {
|
|
281
|
+
angle = 360 + angle;
|
|
282
|
+
}
|
|
283
|
+
if (this.viewType === 'hours') {
|
|
284
|
+
const radius = Math.sqrt(Math.pow(size / 2 - x, 2) + Math.pow(size / 2 - y, 2));
|
|
285
|
+
value = 12 - Math.round((angle * 12) / 360);
|
|
286
|
+
if (value === 0) {
|
|
287
|
+
value = 12;
|
|
288
|
+
}
|
|
289
|
+
if (radius < size / 2 - 32) {
|
|
290
|
+
value = value === 12 ? 0 : value + 12;
|
|
291
|
+
}
|
|
292
|
+
return value;
|
|
293
|
+
}
|
|
294
|
+
value = Math.round(60 - (60 * angle) / 360);
|
|
295
|
+
return value === 60 ? 0 : value;
|
|
296
|
+
}
|
|
297
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: ClockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
298
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: ClockComponent, isStandalone: true, selector: "mat-clock", inputs: { viewType: "viewType", formattedValue: "formattedValue", minDate: "minDate", maxDate: "maxDate", formattedHours: "formattedHours", minutes: "minutes", allowed24HourMap: "allowed24HourMap" }, outputs: { changeEvent: "changeEvent", unavailableSelection: "unavailableSelection", invalidSelection: "invalidSelection" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"root\">\n <div\n class=\"circle\"\n tabindex=\"1\"\n (touchmove)=\"handleTouchMove($event)\"\n (mousemove)=\"handleMouseMove($event)\"\n (touchstart)=\"disableAnimatedPointer()\"\n (mousedown)=\"disableAnimatedPointer()\"\n (touchend)=\"handleTouchEnd($event)\"\n (mouseup)=\"enableAnimatedPointer()\"\n (click)=\"handleClick($event)\"\n >\n <div\n class=\"pointer-container\"\n [ngClass]=\"{\n 'small-pointer':\n viewType === 'hours' && (formattedValue === 0 || formattedValue > 12),\n 'animated-pointer': !touching,\n }\"\n [style.transform]=\"'rotate(' + angle + 'deg)'\"\n >\n <button\n aria-disabled=\"true\"\n mat-mini-fab\n color=\"neutral\"\n class=\"inner-dot\"\n aria-label=\"Inner Dot\"\n ></button>\n <mat-toolbar color=\"accent\" class=\"pointer\">\n <button\n mat-mini-fab\n color=\"neutral\"\n class=\"outer-dot\"\n aria-label=\"Outer dot\"\n [ngClass]=\"{\n 'outer-dot-odd': viewType === 'minutes' && formattedValue % 5 !== 0,\n }\"\n >\n @if (viewType === 'minutes' && formattedValue % 5 !== 0) {\n <ng-container>\u00B7</ng-container>\n }\n </button>\n </mat-toolbar>\n </div>\n @for (digit of minuteDots; track digit.display) {\n <button\n mat-mini-fab\n color=\"neutral\"\n class=\"number minute-dot\"\n [ngClass]=\"{\n selected:\n formattedValue === digit.display ||\n (digit.display === 0 && formattedValue === 0),\n disabled: !isAvailable(digit.display === 60 ? 0 : digit.display),\n }\"\n [style.transform]=\"\n 'translate(' + digit.translateX + 'px, ' + digit.translateY + 'px)'\n \"\n >\n @if (digit.display % 5 !== 0) {\n <ng-container>\u00B7</ng-container>\n }\n </button>\n }\n @for (digit of numbers; track digit.display) {\n <button\n mat-mini-fab\n color=\"neutral\"\n class=\"number\"\n [ngClass]=\"{\n selected:\n formattedValue === digit.display ||\n (digit.display === 60 && formattedValue === 0),\n disabled: !isAvailable(digit.display === 60 ? 0 : digit.display),\n }\"\n [style.transform]=\"\n 'translate(' + digit.translateX + 'px, ' + digit.translateY + 'px)'\n \"\n >\n <ng-template #hoursTemplate>{{ digit.display }}</ng-template>\n <ng-template #minutesTemplate>{{\n digit.display === 60 ? '00' : digit.display\n }}</ng-template>\n @if (viewType === 'minutes') {\n {{ digit.display === 60 ? '00' : digit.display }}\n } @else {\n {{ digit.display }}\n }\n </button>\n }\n @for (digit of secondaryNumbers; track digit.display) {\n <button\n mat-mini-fab\n color=\"neutral\"\n class=\"number small-number\"\n [ngClass]=\"{\n selected:\n formattedValue === digit.display ||\n (digit.display === 24 && formattedValue === 0),\n disabled: !isAvailable(digit.display === 24 ? 0 : digit.display),\n }\"\n [style.transform]=\"\n 'translate(' + digit.translateX + 'px, ' + digit.translateY + 'px)'\n \"\n >\n {{ digit.display === 24 ? '00' : digit.display }}\n </button>\n }\n </div>\n</div>\n", styles: [".root{width:256px;height:256px;cursor:default}.circle{width:256px;height:256px;border-radius:50%;position:relative;background:var(--mat-sys-surface-container-high);cursor:pointer}.mat-mdc-mini-fab.number{width:32px;height:32px;left:calc(50% - 16px);top:calc(50% - 16px);position:absolute;text-align:center;line-height:32px;cursor:pointer;font-size:14px;pointer-events:none;-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;flex-direction:column;background-color:transparent;box-shadow:none;color:var(--mat-sys-on-surface)}.mat-mdc-mini-fab.number.selected{background:var(--background-gradient);color:var(--on-background-gradient)}.mat-mdc-mini-fab.number.disabled{opacity:.1}.mat-mdc-mini-fab.number:not(.selected):not(.disabled){color:var(--mat-sys-on-surface)}.small-number{font-size:12px}.small-number:not(.selected):not(.disabled){color:var(--mat-sys-on-surface-variant)}.pointer-container{width:calc(50% - 20px);height:2px;position:absolute;left:50%;top:calc(50% - 1px);transform-origin:left center;pointer-events:none}.pointer-container.disabled *{background-color:transparent}.pointer{height:1px;background-color:var(--mat-sys-on-surface)}.animated-pointer{transition:all .2s ease-out}.pointer-container.small-pointer{width:calc(50% - 52px)}.pointer-container.small-pointer mat-toolbar{padding:0 16px}.pointer-container mat-toolbar{padding:0 54px}.inner-dot{position:absolute;top:-3px;left:-4px;width:8px;height:8px;border-radius:50%;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f}.outer-dot{width:32px;height:32px;position:absolute;right:-16px;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;border-radius:50%;box-sizing:content-box}.outer-dot-odd{box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;width:32px;height:32px;display:flex;align-items:center;justify-content:center;flex-direction:column}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: OnemRvaColorDirective, selector: "onemrva-mat-selectable-box[color],div[color],onemrva-mat-avatar[color],mat-card[color],mat-toolbar[color],onemrva-mat-spinner[color],onemrva-mat-notification[color],onemrva-mat-task-list[color],onemrva-mat-sticker[color],onemrva-mat-panel[color],onemrva-mat-task[color],onemrva-mat-choice-chip[color],mat-form-field[color],button[color],mat-icon[color],mat-chip[color],mat-chip-option[color]", inputs: ["color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
299
|
+
}
|
|
300
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: ClockComponent, decorators: [{
|
|
301
|
+
type: Component,
|
|
302
|
+
args: [{ selector: 'mat-clock', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgClass, MatMiniFabButton, MatToolbar, OnemRvaColorDirective], template: "<div class=\"root\">\n <div\n class=\"circle\"\n tabindex=\"1\"\n (touchmove)=\"handleTouchMove($event)\"\n (mousemove)=\"handleMouseMove($event)\"\n (touchstart)=\"disableAnimatedPointer()\"\n (mousedown)=\"disableAnimatedPointer()\"\n (touchend)=\"handleTouchEnd($event)\"\n (mouseup)=\"enableAnimatedPointer()\"\n (click)=\"handleClick($event)\"\n >\n <div\n class=\"pointer-container\"\n [ngClass]=\"{\n 'small-pointer':\n viewType === 'hours' && (formattedValue === 0 || formattedValue > 12),\n 'animated-pointer': !touching,\n }\"\n [style.transform]=\"'rotate(' + angle + 'deg)'\"\n >\n <button\n aria-disabled=\"true\"\n mat-mini-fab\n color=\"neutral\"\n class=\"inner-dot\"\n aria-label=\"Inner Dot\"\n ></button>\n <mat-toolbar color=\"accent\" class=\"pointer\">\n <button\n mat-mini-fab\n color=\"neutral\"\n class=\"outer-dot\"\n aria-label=\"Outer dot\"\n [ngClass]=\"{\n 'outer-dot-odd': viewType === 'minutes' && formattedValue % 5 !== 0,\n }\"\n >\n @if (viewType === 'minutes' && formattedValue % 5 !== 0) {\n <ng-container>\u00B7</ng-container>\n }\n </button>\n </mat-toolbar>\n </div>\n @for (digit of minuteDots; track digit.display) {\n <button\n mat-mini-fab\n color=\"neutral\"\n class=\"number minute-dot\"\n [ngClass]=\"{\n selected:\n formattedValue === digit.display ||\n (digit.display === 0 && formattedValue === 0),\n disabled: !isAvailable(digit.display === 60 ? 0 : digit.display),\n }\"\n [style.transform]=\"\n 'translate(' + digit.translateX + 'px, ' + digit.translateY + 'px)'\n \"\n >\n @if (digit.display % 5 !== 0) {\n <ng-container>\u00B7</ng-container>\n }\n </button>\n }\n @for (digit of numbers; track digit.display) {\n <button\n mat-mini-fab\n color=\"neutral\"\n class=\"number\"\n [ngClass]=\"{\n selected:\n formattedValue === digit.display ||\n (digit.display === 60 && formattedValue === 0),\n disabled: !isAvailable(digit.display === 60 ? 0 : digit.display),\n }\"\n [style.transform]=\"\n 'translate(' + digit.translateX + 'px, ' + digit.translateY + 'px)'\n \"\n >\n <ng-template #hoursTemplate>{{ digit.display }}</ng-template>\n <ng-template #minutesTemplate>{{\n digit.display === 60 ? '00' : digit.display\n }}</ng-template>\n @if (viewType === 'minutes') {\n {{ digit.display === 60 ? '00' : digit.display }}\n } @else {\n {{ digit.display }}\n }\n </button>\n }\n @for (digit of secondaryNumbers; track digit.display) {\n <button\n mat-mini-fab\n color=\"neutral\"\n class=\"number small-number\"\n [ngClass]=\"{\n selected:\n formattedValue === digit.display ||\n (digit.display === 24 && formattedValue === 0),\n disabled: !isAvailable(digit.display === 24 ? 0 : digit.display),\n }\"\n [style.transform]=\"\n 'translate(' + digit.translateX + 'px, ' + digit.translateY + 'px)'\n \"\n >\n {{ digit.display === 24 ? '00' : digit.display }}\n </button>\n }\n </div>\n</div>\n", styles: [".root{width:256px;height:256px;cursor:default}.circle{width:256px;height:256px;border-radius:50%;position:relative;background:var(--mat-sys-surface-container-high);cursor:pointer}.mat-mdc-mini-fab.number{width:32px;height:32px;left:calc(50% - 16px);top:calc(50% - 16px);position:absolute;text-align:center;line-height:32px;cursor:pointer;font-size:14px;pointer-events:none;-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;flex-direction:column;background-color:transparent;box-shadow:none;color:var(--mat-sys-on-surface)}.mat-mdc-mini-fab.number.selected{background:var(--background-gradient);color:var(--on-background-gradient)}.mat-mdc-mini-fab.number.disabled{opacity:.1}.mat-mdc-mini-fab.number:not(.selected):not(.disabled){color:var(--mat-sys-on-surface)}.small-number{font-size:12px}.small-number:not(.selected):not(.disabled){color:var(--mat-sys-on-surface-variant)}.pointer-container{width:calc(50% - 20px);height:2px;position:absolute;left:50%;top:calc(50% - 1px);transform-origin:left center;pointer-events:none}.pointer-container.disabled *{background-color:transparent}.pointer{height:1px;background-color:var(--mat-sys-on-surface)}.animated-pointer{transition:all .2s ease-out}.pointer-container.small-pointer{width:calc(50% - 52px)}.pointer-container.small-pointer mat-toolbar{padding:0 16px}.pointer-container mat-toolbar{padding:0 54px}.inner-dot{position:absolute;top:-3px;left:-4px;width:8px;height:8px;border-radius:50%;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f}.outer-dot{width:32px;height:32px;position:absolute;right:-16px;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;border-radius:50%;box-sizing:content-box}.outer-dot-odd{box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;width:32px;height:32px;display:flex;align-items:center;justify-content:center;flex-direction:column}\n"] }]
|
|
303
|
+
}], propDecorators: { viewType: [{
|
|
304
|
+
type: Input
|
|
305
|
+
}], formattedValue: [{
|
|
306
|
+
type: Input
|
|
307
|
+
}], minDate: [{
|
|
308
|
+
type: Input
|
|
309
|
+
}], maxDate: [{
|
|
310
|
+
type: Input
|
|
311
|
+
}], formattedHours: [{
|
|
312
|
+
type: Input
|
|
313
|
+
}], minutes: [{
|
|
314
|
+
type: Input
|
|
315
|
+
}], changeEvent: [{
|
|
316
|
+
type: Output
|
|
317
|
+
}], unavailableSelection: [{
|
|
318
|
+
type: Output
|
|
319
|
+
}], invalidSelection: [{
|
|
320
|
+
type: Output
|
|
321
|
+
}], allowed24HourMap: [{
|
|
322
|
+
type: Input
|
|
323
|
+
}] } });
|
|
324
|
+
|
|
325
|
+
class MatTimepickerComponentDialogComponent {
|
|
326
|
+
set value(value) {
|
|
327
|
+
value = value || this.minDate || this.maxDate || new Date();
|
|
328
|
+
this.hours = value.getHours();
|
|
329
|
+
this.minutes = value.getMinutes();
|
|
330
|
+
this._value = value;
|
|
331
|
+
}
|
|
332
|
+
get value() {
|
|
333
|
+
return this._value;
|
|
334
|
+
}
|
|
335
|
+
set hours(value) {
|
|
336
|
+
this._hours = value;
|
|
337
|
+
this._formattedHour = convertHoursForMode(this.hours).hour;
|
|
338
|
+
}
|
|
339
|
+
get hours() {
|
|
340
|
+
return this._hours;
|
|
341
|
+
}
|
|
342
|
+
get formattedHours() {
|
|
343
|
+
return this._formattedHour;
|
|
344
|
+
}
|
|
345
|
+
bindData(data) {
|
|
346
|
+
this.okLabel = data.okLabel;
|
|
347
|
+
this.cancelLabel = data.cancelLabel;
|
|
348
|
+
this.color = data.color;
|
|
349
|
+
this.minDate = data.minDate;
|
|
350
|
+
this.maxDate = data.maxDate;
|
|
351
|
+
this.allowed24HourMap = data.allowed24HourMap;
|
|
352
|
+
}
|
|
353
|
+
constructor() {
|
|
354
|
+
this.twoDigits = twoDigits;
|
|
355
|
+
this.changeEvent = new EventEmitter();
|
|
356
|
+
this.okClickEvent = new EventEmitter();
|
|
357
|
+
this.cancelClickEvent = new EventEmitter();
|
|
358
|
+
this.invalidSelection = false;
|
|
359
|
+
this.okLabel = '';
|
|
360
|
+
this.cancelLabel = '';
|
|
361
|
+
this.viewType = 'hours';
|
|
362
|
+
this.color = 'primary';
|
|
363
|
+
this.isPm = false;
|
|
364
|
+
this.skipMinuteAutoSwitch = false;
|
|
365
|
+
this.editHoursClicked = false;
|
|
366
|
+
this.isClosing = false;
|
|
367
|
+
this.dialog = inject(MatDialog);
|
|
368
|
+
this.data = inject(MAT_DIALOG_DATA);
|
|
369
|
+
this.isPm = this.data.isPm;
|
|
370
|
+
this.bindData(this.data);
|
|
371
|
+
// keep this always at the bottom
|
|
372
|
+
this.value = this.data.value;
|
|
373
|
+
}
|
|
374
|
+
ngDoCheck() {
|
|
375
|
+
this.bindData(this.data);
|
|
376
|
+
}
|
|
377
|
+
handleClockChange({ value, type, }) {
|
|
378
|
+
if ((type && type === 'hours') || (!type && this.viewType === 'hours')) {
|
|
379
|
+
this.hours = value;
|
|
380
|
+
}
|
|
381
|
+
else if ((type && type === 'minutes') ||
|
|
382
|
+
(!type && this.viewType === 'minutes')) {
|
|
383
|
+
this.minutes = value;
|
|
384
|
+
}
|
|
385
|
+
const newValue = new Date();
|
|
386
|
+
const hours = this.hours;
|
|
387
|
+
// newValue.setFullYear(0);
|
|
388
|
+
// newValue.setMonth(0);
|
|
389
|
+
// newValue.setDate(0);
|
|
390
|
+
newValue.setHours(hours);
|
|
391
|
+
newValue.setMinutes(this.minutes);
|
|
392
|
+
newValue.setSeconds(0);
|
|
393
|
+
newValue.setMilliseconds(0);
|
|
394
|
+
this.value = newValue;
|
|
395
|
+
this.changeEvent.emit(newValue);
|
|
396
|
+
}
|
|
397
|
+
handleUnavailableSelection() {
|
|
398
|
+
clearTimeout(this.autoSwitchID);
|
|
399
|
+
}
|
|
400
|
+
handleClockChangeDone(e) {
|
|
401
|
+
e.preventDefault(); // prevent mouseUp after touchEnd
|
|
402
|
+
if (this.viewType === 'hours' && !this.skipMinuteAutoSwitch) {
|
|
403
|
+
this.autoSwitchID = setTimeout(() => {
|
|
404
|
+
this.editMinutes();
|
|
405
|
+
this.autoSwitchID = null;
|
|
406
|
+
}, 300);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
editHours() {
|
|
410
|
+
this.viewType = 'hours';
|
|
411
|
+
this.editHoursClicked = true;
|
|
412
|
+
setTimeout(() => {
|
|
413
|
+
this.editHoursClicked = false;
|
|
414
|
+
}, 0);
|
|
415
|
+
}
|
|
416
|
+
editMinutes() {
|
|
417
|
+
this.viewType = 'minutes';
|
|
418
|
+
}
|
|
419
|
+
invalidSelectionHandler(value) {
|
|
420
|
+
this.invalidSelection = value;
|
|
421
|
+
}
|
|
422
|
+
okClickHandler() {
|
|
423
|
+
this.okClickEvent.emit();
|
|
424
|
+
}
|
|
425
|
+
cancelClickHandler() {
|
|
426
|
+
this.cancelClickEvent.emit();
|
|
427
|
+
}
|
|
428
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: MatTimepickerComponentDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
429
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.7", type: MatTimepickerComponentDialogComponent, isStandalone: true, selector: "mat-timepicker-dialog", outputs: { changeEvent: "changeEvent", okClickEvent: "okClickEvent", cancelClickEvent: "cancelClickEvent" }, ngImport: i0, template: "<mat-dialog-content>\n <div class=\"root\">\n <mat-toolbar color=\"accent\" class=\"header\">\n <div class=\"time-frame\">\n <span\n class=\"time fixed-font-size\"\n [ngClass]=\"{ select: viewType === 'hours' && 'active' }\"\n (click)=\"editHours()\"\n role=\"button\"\n tabindex=\"0\"\n >\n {{ twoDigits(formattedHours) }}\n </span>\n <span class=\"fixed-font-size\">:</span>\n <span\n class=\"time fixed-font-size\"\n [ngClass]=\"{ select: viewType === 'minutes' && 'active' }\"\n (click)=\"editMinutes()\"\n tabindex=\"1\"\n role=\"button\"\n >\n {{ twoDigits(minutes) }}\n </span>\n </div>\n </mat-toolbar>\n <div class=\"body\">\n <mat-clock\n [allowed24HourMap]=\"allowed24HourMap\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [viewType]=\"viewType\"\n [formattedHours]=\"formattedHours\"\n [minutes]=\"minutes\"\n (changeEvent)=\"handleClockChange($event)\"\n (unavailableSelection)=\"handleUnavailableSelection()\"\n [formattedValue]=\"viewType === 'minutes' ? minutes : formattedHours\"\n (mouseup)=\"handleClockChangeDone($event)\"\n (touchend)=\"handleClockChangeDone($event)\"\n (invalidSelection)=\"invalidSelectionHandler($event)\"\n ></mat-clock>\n </div>\n </div>\n</mat-dialog-content>\n<mat-dialog-actions>\n <button mat-button color=\"primary\" (click)=\"cancelClickHandler()\">\n {{ cancelLabel }}\n </button>\n <button\n mat-flat-button\n [disabled]=\"invalidSelection\"\n [color]=\"color\"\n (click)=\"okClickHandler()\"\n >\n {{ okLabel }}\n </button>\n</mat-dialog-actions>\n", styles: [".mdc-dialog__content{min-height:395px;padding:0!important;overflow:hidden}mat-dialog-actions{justify-content:flex-end;margin:0}.root{min-width:282px}.header{border-top-left-radius:2px;border-top-right-radius:2px;padding:20px 0;line-height:58px;font-size:58px;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;height:98px}.header .fixed-font-size{font-size:58px}.header .time-frame{height:60px}.time{transition:all .2s ease-out;cursor:pointer}.time:not(.select){opacity:.6}.placeholder{flex:1}.ampm{display:flex;flex-direction:column-reverse;flex:1;font-size:14px;line-height:20px;margin-left:16px;font-weight:700}.body{padding:24px 16px 20px;display:flex;justify-content:center}\n"], dependencies: [{ kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ClockComponent, selector: "mat-clock", inputs: ["viewType", "formattedValue", "minDate", "maxDate", "formattedHours", "minutes", "allowed24HourMap"], outputs: ["changeEvent", "unavailableSelection", "invalidSelection"] }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: OnemRvaColorDirective, selector: "onemrva-mat-selectable-box[color],div[color],onemrva-mat-avatar[color],mat-card[color],mat-toolbar[color],onemrva-mat-spinner[color],onemrva-mat-notification[color],onemrva-mat-task-list[color],onemrva-mat-sticker[color],onemrva-mat-panel[color],onemrva-mat-task[color],onemrva-mat-choice-chip[color],mat-form-field[color],button[color],mat-icon[color],mat-chip[color],mat-chip-option[color]", inputs: ["color"] }] }); }
|
|
430
|
+
}
|
|
431
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: MatTimepickerComponentDialogComponent, decorators: [{
|
|
432
|
+
type: Component,
|
|
433
|
+
args: [{ selector: 'mat-timepicker-dialog', standalone: true, imports: [
|
|
434
|
+
MatDialogContent,
|
|
435
|
+
MatToolbar,
|
|
436
|
+
NgClass,
|
|
437
|
+
ClockComponent,
|
|
438
|
+
MatDialogActions,
|
|
439
|
+
MatButton,
|
|
440
|
+
OnemRvaColorDirective,
|
|
441
|
+
], template: "<mat-dialog-content>\n <div class=\"root\">\n <mat-toolbar color=\"accent\" class=\"header\">\n <div class=\"time-frame\">\n <span\n class=\"time fixed-font-size\"\n [ngClass]=\"{ select: viewType === 'hours' && 'active' }\"\n (click)=\"editHours()\"\n role=\"button\"\n tabindex=\"0\"\n >\n {{ twoDigits(formattedHours) }}\n </span>\n <span class=\"fixed-font-size\">:</span>\n <span\n class=\"time fixed-font-size\"\n [ngClass]=\"{ select: viewType === 'minutes' && 'active' }\"\n (click)=\"editMinutes()\"\n tabindex=\"1\"\n role=\"button\"\n >\n {{ twoDigits(minutes) }}\n </span>\n </div>\n </mat-toolbar>\n <div class=\"body\">\n <mat-clock\n [allowed24HourMap]=\"allowed24HourMap\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [viewType]=\"viewType\"\n [formattedHours]=\"formattedHours\"\n [minutes]=\"minutes\"\n (changeEvent)=\"handleClockChange($event)\"\n (unavailableSelection)=\"handleUnavailableSelection()\"\n [formattedValue]=\"viewType === 'minutes' ? minutes : formattedHours\"\n (mouseup)=\"handleClockChangeDone($event)\"\n (touchend)=\"handleClockChangeDone($event)\"\n (invalidSelection)=\"invalidSelectionHandler($event)\"\n ></mat-clock>\n </div>\n </div>\n</mat-dialog-content>\n<mat-dialog-actions>\n <button mat-button color=\"primary\" (click)=\"cancelClickHandler()\">\n {{ cancelLabel }}\n </button>\n <button\n mat-flat-button\n [disabled]=\"invalidSelection\"\n [color]=\"color\"\n (click)=\"okClickHandler()\"\n >\n {{ okLabel }}\n </button>\n</mat-dialog-actions>\n", styles: [".mdc-dialog__content{min-height:395px;padding:0!important;overflow:hidden}mat-dialog-actions{justify-content:flex-end;margin:0}.root{min-width:282px}.header{border-top-left-radius:2px;border-top-right-radius:2px;padding:20px 0;line-height:58px;font-size:58px;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;height:98px}.header .fixed-font-size{font-size:58px}.header .time-frame{height:60px}.time{transition:all .2s ease-out;cursor:pointer}.time:not(.select){opacity:.6}.placeholder{flex:1}.ampm{display:flex;flex-direction:column-reverse;flex:1;font-size:14px;line-height:20px;margin-left:16px;font-weight:700}.body{padding:24px 16px 20px;display:flex;justify-content:center}\n"] }]
|
|
442
|
+
}], ctorParameters: () => [], propDecorators: { changeEvent: [{
|
|
443
|
+
type: Output
|
|
444
|
+
}], okClickEvent: [{
|
|
445
|
+
type: Output
|
|
446
|
+
}], cancelClickEvent: [{
|
|
447
|
+
type: Output
|
|
448
|
+
}] } });
|
|
449
|
+
|
|
450
|
+
let NEXT_ID = 0;
|
|
451
|
+
class OnemrvaMatTimepickerComponent {
|
|
452
|
+
constructor() {
|
|
453
|
+
this.isAlive = new Subject();
|
|
454
|
+
this.dialog = inject(MatDialog);
|
|
455
|
+
this.opened = false;
|
|
456
|
+
/** Emits when the timepicker's state changes. */
|
|
457
|
+
this.stateChanges = new Subject();
|
|
458
|
+
// eslint-disable-next-line @angular-eslint/no-output-rename
|
|
459
|
+
this.openedStream = new EventEmitter();
|
|
460
|
+
// eslint-disable-next-line @angular-eslint/no-output-rename
|
|
461
|
+
this.closedStream = new EventEmitter();
|
|
462
|
+
/**
|
|
463
|
+
* Returns the `aria-label` attribute of the element.
|
|
464
|
+
*
|
|
465
|
+
* @example
|
|
466
|
+
* ```typescript
|
|
467
|
+
* let timepickerLabel = this.timepicker.ariaLabel;
|
|
468
|
+
* ```
|
|
469
|
+
*
|
|
470
|
+
*/
|
|
471
|
+
this.ariaLabel = '';
|
|
472
|
+
this.dialogLabel = 'Pick a Time';
|
|
473
|
+
/**
|
|
474
|
+
* Returns the `role` attribute of the element.
|
|
475
|
+
*
|
|
476
|
+
* @example
|
|
477
|
+
* ```typescript
|
|
478
|
+
* let timepickerRole = this.timepicker.role;
|
|
479
|
+
* ```
|
|
480
|
+
*/
|
|
481
|
+
this.role = '';
|
|
482
|
+
/**
|
|
483
|
+
* Host `class.onemrva-mat-timepicker` binding.
|
|
484
|
+
*
|
|
485
|
+
* @hidden
|
|
486
|
+
* @internal
|
|
487
|
+
*/
|
|
488
|
+
this.cssClass = 'onemrva-mat-timepicker';
|
|
489
|
+
/**
|
|
490
|
+
* Sets the `id` of the element. If not set, the first component instance will have `id` = `"onemrva-mat-timepicker-0"`.
|
|
491
|
+
*
|
|
492
|
+
* @example
|
|
493
|
+
* ```html
|
|
494
|
+
* <onemrva-mat-timepicker id="my-first-timepicker"></onemrva-mat-timepicker>
|
|
495
|
+
* ```
|
|
496
|
+
*/
|
|
497
|
+
this.id = `onemrva-mat-timepicker-${NEXT_ID++}`;
|
|
498
|
+
/**
|
|
499
|
+
* Sets the `data-cy` of the element. If not set, the first component instance will have `data-cy` = `"onemrva-mat-timepicker-0"`.
|
|
500
|
+
*
|
|
501
|
+
* @example
|
|
502
|
+
* ```html
|
|
503
|
+
* <onemrva-mat-timepicker id="my-first-timepicker"></onemrva-mat-timepicker>
|
|
504
|
+
* ```
|
|
505
|
+
*/
|
|
506
|
+
this.dataCy = `onemrva-mat-timepicker-${NEXT_ID++}`;
|
|
507
|
+
/**
|
|
508
|
+
* @hidden
|
|
509
|
+
* @internal
|
|
510
|
+
*/
|
|
511
|
+
this._color = 'primary';
|
|
512
|
+
/**
|
|
513
|
+
* @hidden
|
|
514
|
+
* @internal
|
|
515
|
+
*/
|
|
516
|
+
this._size = OnemrvaMatSize.SMALL;
|
|
517
|
+
this.handleChange = (newValue) => {
|
|
518
|
+
if (!(newValue instanceof Date)) {
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
const v = this.value instanceof Date ? new Date(this.value.getTime()) : new Date();
|
|
522
|
+
v.setHours(newValue.getHours());
|
|
523
|
+
v.setMinutes(newValue.getMinutes());
|
|
524
|
+
v.setSeconds(0);
|
|
525
|
+
v.setMilliseconds(0);
|
|
526
|
+
this.value = v;
|
|
527
|
+
};
|
|
528
|
+
this.handleOk = () => {
|
|
529
|
+
if (this.onChangeFn) {
|
|
530
|
+
this.onChangeFn(this.value);
|
|
531
|
+
}
|
|
532
|
+
this.timepickerInput.value = this.value;
|
|
533
|
+
this.modalRef.close();
|
|
534
|
+
};
|
|
535
|
+
this.handleCancel = () => {
|
|
536
|
+
this.modalRef.close();
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
get value() {
|
|
540
|
+
return this._value;
|
|
541
|
+
}
|
|
542
|
+
set value(value) {
|
|
543
|
+
this._value = value;
|
|
544
|
+
}
|
|
545
|
+
setTimepickerInput(t) {
|
|
546
|
+
this.timepickerInput = t;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Returns the color of the element.
|
|
550
|
+
*
|
|
551
|
+
* @example
|
|
552
|
+
* ```typescript
|
|
553
|
+
* let color = this.timepicker.color;
|
|
554
|
+
* ```
|
|
555
|
+
*/
|
|
556
|
+
get color() {
|
|
557
|
+
return this._color;
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Sets the size of the element.
|
|
561
|
+
* By default, the color is `"primary"`.
|
|
562
|
+
*
|
|
563
|
+
* @example
|
|
564
|
+
* ```html
|
|
565
|
+
* <onemrva-mat-timepicker size="large"></onemrva-mat-timepicker>
|
|
566
|
+
* ```
|
|
567
|
+
*/
|
|
568
|
+
set color(value) {
|
|
569
|
+
switch (value) {
|
|
570
|
+
case OnemrvaMatColor.PRIMARY:
|
|
571
|
+
case OnemrvaMatColor.ACCENT:
|
|
572
|
+
case OnemrvaMatColor.WARN:
|
|
573
|
+
this._color = value;
|
|
574
|
+
break;
|
|
575
|
+
default:
|
|
576
|
+
this._color = OnemrvaMatColor.PRIMARY;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
/** @hidden @internal */
|
|
580
|
+
get _isPrimary() {
|
|
581
|
+
return this.color === OnemrvaMatColor.PRIMARY;
|
|
582
|
+
}
|
|
583
|
+
/** @hidden @internal */
|
|
584
|
+
get _isAccent() {
|
|
585
|
+
return this.color === OnemrvaMatColor.ACCENT;
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* Returns the size of the element.
|
|
589
|
+
*
|
|
590
|
+
* @example
|
|
591
|
+
* ```typescript
|
|
592
|
+
* let timepickerSize = this.timepicker.size;
|
|
593
|
+
* ```
|
|
594
|
+
*/
|
|
595
|
+
get size() {
|
|
596
|
+
return this._size;
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Sets the size of the element.
|
|
600
|
+
* By default, the size is `"medium"`.
|
|
601
|
+
*
|
|
602
|
+
* @example
|
|
603
|
+
* ```html
|
|
604
|
+
* <onemrva-mat-timepicker size="large"></onemrva-mat-timepicker>
|
|
605
|
+
* ```
|
|
606
|
+
*/
|
|
607
|
+
set size(value) {
|
|
608
|
+
switch (value) {
|
|
609
|
+
case OnemrvaMatSize.XSMALL:
|
|
610
|
+
case OnemrvaMatSize.SMALL:
|
|
611
|
+
case OnemrvaMatSize.MEDIUM:
|
|
612
|
+
case OnemrvaMatSize.LARGE:
|
|
613
|
+
case OnemrvaMatSize.XLARGE:
|
|
614
|
+
this._size = value;
|
|
615
|
+
break;
|
|
616
|
+
default:
|
|
617
|
+
this._size = OnemrvaMatSize.MEDIUM;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
open() {
|
|
621
|
+
if (this.timepickerInput.disabled) {
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
this.value = this.timepickerInput.currentValue;
|
|
625
|
+
if (this.value === undefined || this.value === null) {
|
|
626
|
+
this.value = new Date();
|
|
627
|
+
}
|
|
628
|
+
this.modalRef = this.dialog.open(MatTimepickerComponentDialogComponent, {
|
|
629
|
+
ariaLabel: this.dialogLabel,
|
|
630
|
+
autoFocus: false,
|
|
631
|
+
data: {
|
|
632
|
+
value: this.timepickerInput.currentValue,
|
|
633
|
+
okLabel: this.timepickerInput.okLabel,
|
|
634
|
+
cancelLabel: this.timepickerInput.cancelLabel,
|
|
635
|
+
color: this.color,
|
|
636
|
+
minDate: this.timepickerInput.minDate,
|
|
637
|
+
maxDate: this.timepickerInput.maxDate,
|
|
638
|
+
allowed24HourMap: this.timepickerInput.allowed24HourMap,
|
|
639
|
+
},
|
|
640
|
+
});
|
|
641
|
+
const instance = this.modalRef.componentInstance;
|
|
642
|
+
instance.changeEvent
|
|
643
|
+
.pipe(takeUntil(this.isAlive))
|
|
644
|
+
.subscribe(this.handleChange);
|
|
645
|
+
instance.okClickEvent
|
|
646
|
+
.pipe(takeUntil(this.isAlive))
|
|
647
|
+
.subscribe(this.handleOk);
|
|
648
|
+
instance.cancelClickEvent
|
|
649
|
+
.pipe(takeUntil(this.isAlive))
|
|
650
|
+
.subscribe(this.handleCancel);
|
|
651
|
+
this.modalRef
|
|
652
|
+
.beforeClosed()
|
|
653
|
+
.pipe(first())
|
|
654
|
+
.subscribe(() => (instance.isClosing = true));
|
|
655
|
+
this.modalRef
|
|
656
|
+
.afterClosed()
|
|
657
|
+
.pipe(first())
|
|
658
|
+
.subscribe(() => {
|
|
659
|
+
if (this.timepickerInput.onTouchedFn) {
|
|
660
|
+
this.timepickerInput.onTouchedFn();
|
|
661
|
+
}
|
|
662
|
+
//this.modalRef = null;
|
|
663
|
+
this.timepickerInput.elRef.nativeElement.focus();
|
|
664
|
+
});
|
|
665
|
+
this.timepickerInput.currentValue = this.value;
|
|
666
|
+
}
|
|
667
|
+
ngOnDestroy() {
|
|
668
|
+
this.isAlive.next('0');
|
|
669
|
+
this.isAlive.complete();
|
|
670
|
+
this.stateChanges.complete();
|
|
671
|
+
// if (this._platform.isBrowser) {
|
|
672
|
+
// this.fm.stopMonitoring(this.elRef.nativeElement);
|
|
673
|
+
// }
|
|
674
|
+
//
|
|
675
|
+
// this.listeners.forEach(l => l());
|
|
676
|
+
}
|
|
677
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: OnemrvaMatTimepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
678
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.7", type: OnemrvaMatTimepickerComponent, isStandalone: true, selector: "mat-timepicker", inputs: { dialogLabel: "dialogLabel", id: "id", dataCy: "dataCy", color: "color", size: "size" }, outputs: { openedStream: "opened", closedStream: "closed" }, host: { properties: { "attr.aria-label": "this.ariaLabel", "attr.role": "this.role", "class.onemrva-mat-timepicker": "this.cssClass", "attr.id": "this.id", "attr.data-cy": "this.dataCy", "class.mat-primary": "this._isPrimary", "class.mat-accent": "this._isAccent" } }, ngImport: i0, template: "" }); }
|
|
679
|
+
}
|
|
680
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: OnemrvaMatTimepickerComponent, decorators: [{
|
|
681
|
+
type: Component,
|
|
682
|
+
args: [{ selector: 'mat-timepicker', template: "" }]
|
|
683
|
+
}], propDecorators: { openedStream: [{
|
|
684
|
+
type: Output,
|
|
685
|
+
args: ['opened']
|
|
686
|
+
}], closedStream: [{
|
|
687
|
+
type: Output,
|
|
688
|
+
args: ['closed']
|
|
689
|
+
}], ariaLabel: [{
|
|
690
|
+
type: HostBinding,
|
|
691
|
+
args: ['attr.aria-label']
|
|
692
|
+
}], dialogLabel: [{
|
|
693
|
+
type: Input
|
|
694
|
+
}], role: [{
|
|
695
|
+
type: HostBinding,
|
|
696
|
+
args: ['attr.role']
|
|
697
|
+
}], cssClass: [{
|
|
698
|
+
type: HostBinding,
|
|
699
|
+
args: ['class.onemrva-mat-timepicker']
|
|
700
|
+
}], id: [{
|
|
701
|
+
type: HostBinding,
|
|
702
|
+
args: ['attr.id']
|
|
703
|
+
}, {
|
|
704
|
+
type: Input
|
|
705
|
+
}], dataCy: [{
|
|
706
|
+
type: HostBinding,
|
|
707
|
+
args: ['attr.data-cy']
|
|
708
|
+
}, {
|
|
709
|
+
type: Input
|
|
710
|
+
}], color: [{
|
|
711
|
+
type: Input
|
|
712
|
+
}], _isPrimary: [{
|
|
713
|
+
type: HostBinding,
|
|
714
|
+
args: ['class.mat-primary']
|
|
715
|
+
}], _isAccent: [{
|
|
716
|
+
type: HostBinding,
|
|
717
|
+
args: ['class.mat-accent']
|
|
718
|
+
}], size: [{
|
|
719
|
+
type: Input
|
|
720
|
+
}] } });
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* @license
|
|
724
|
+
* Copyright Google LLC All Rights Reserved.
|
|
725
|
+
*
|
|
726
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
727
|
+
* found in the LICENSE file at https://angular.io/license
|
|
728
|
+
*/
|
|
729
|
+
/** Can be used to override the icon of a `matDatepickerToggle`. */
|
|
730
|
+
class MatTimepickerToggleIconDirective {
|
|
731
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: MatTimepickerToggleIconDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
732
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.7", type: MatTimepickerToggleIconDirective, isStandalone: true, selector: "[matDatepickerToggleIcon]", ngImport: i0 }); }
|
|
733
|
+
}
|
|
734
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: MatTimepickerToggleIconDirective, decorators: [{
|
|
735
|
+
type: Directive,
|
|
736
|
+
args: [{
|
|
737
|
+
selector: '[matDatepickerToggleIcon]',
|
|
738
|
+
}]
|
|
739
|
+
}] });
|
|
740
|
+
class MatTimePickerToggle {
|
|
741
|
+
/** Whether the toggle button is disabled. */
|
|
742
|
+
get disabled() {
|
|
743
|
+
if (this.timepicker) {
|
|
744
|
+
return this.timepicker.timepickerInput._disabled;
|
|
745
|
+
}
|
|
746
|
+
return this._disabled;
|
|
747
|
+
}
|
|
748
|
+
set disabled(value) {
|
|
749
|
+
this._disabled = coerceBooleanProperty(value);
|
|
750
|
+
}
|
|
751
|
+
constructor() {
|
|
752
|
+
this._stateChanges = Subscription.EMPTY;
|
|
753
|
+
/** Screenreader label for the button. */
|
|
754
|
+
this.ariaLabel = '';
|
|
755
|
+
this._disabled = false;
|
|
756
|
+
/** Whether ripples on the toggle should be disabled. */
|
|
757
|
+
this.disableRipple = false;
|
|
758
|
+
this.$event = new Event('abrupt');
|
|
759
|
+
/** Underlying button element. */
|
|
760
|
+
//@ViewChild('button') _button: MatButton;
|
|
761
|
+
this._changeDetectorRef = inject(ChangeDetectorRef);
|
|
762
|
+
const defaultTabIndex = inject(new HostAttributeToken('tabindex'), {
|
|
763
|
+
optional: true,
|
|
764
|
+
});
|
|
765
|
+
const parsedTabIndex = Number(defaultTabIndex);
|
|
766
|
+
this.tabIndex =
|
|
767
|
+
parsedTabIndex || parsedTabIndex === 0 ? parsedTabIndex : null;
|
|
768
|
+
}
|
|
769
|
+
ngOnChanges(changes) {
|
|
770
|
+
if (changes['timepicker']) {
|
|
771
|
+
this._watchStateChanges();
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
ngOnDestroy() {
|
|
775
|
+
this._stateChanges.unsubscribe();
|
|
776
|
+
}
|
|
777
|
+
ngAfterContentInit() {
|
|
778
|
+
this._watchStateChanges();
|
|
779
|
+
}
|
|
780
|
+
_open(event) {
|
|
781
|
+
if (this.timepicker && !this.disabled) {
|
|
782
|
+
this.timepicker.open();
|
|
783
|
+
event.stopPropagation();
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
_watchStateChanges() {
|
|
787
|
+
const datepickerStateChanged = this.timepicker
|
|
788
|
+
? this.timepicker.stateChanges
|
|
789
|
+
: of();
|
|
790
|
+
const inputStateChanged = this.timepicker && this.timepicker.timepickerInput
|
|
791
|
+
? this.timepicker.timepickerInput.stateChanges
|
|
792
|
+
: of();
|
|
793
|
+
const datepickerToggled = this.timepicker
|
|
794
|
+
? merge(this.timepicker.openedStream, this.timepicker.closedStream)
|
|
795
|
+
: of();
|
|
796
|
+
this._stateChanges.unsubscribe();
|
|
797
|
+
this._stateChanges = merge(datepickerStateChanged, inputStateChanged, datepickerToggled).subscribe(() => this._changeDetectorRef.markForCheck());
|
|
798
|
+
}
|
|
799
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: MatTimePickerToggle, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
800
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.7", type: MatTimePickerToggle, isStandalone: true, selector: "mat-timepicker-toggle", inputs: { timepicker: ["for", "timepicker"], tabIndex: "tabIndex", ariaLabel: "ariaLabel", disabled: "disabled", disableRipple: "disableRipple" }, host: { listeners: { "click": "_open($event)" }, properties: { "attr.tabindex": "null", "class.mat-timepicker-toggle-active": "timepicker && timepicker.opened", "class.mat-accent": "timepicker && timepicker.color === \"accent\"", "class.mat-warn": "timepicker && timepicker.color === \"warn\"", "attr.data-mat-calendar": "timepicker ? timepicker.id : null" }, classAttribute: "mat-timepicker-toggle" }, exportAs: ["matDatepickerToggle"], usesOnChanges: true, ngImport: i0, template: "<button\n #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"timepicker ? 'dialog' : null\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\"\n>\n <mat-icon>schedule</mat-icon>\n\n <ng-content select=\"[mattimepickerToggleIcon]\"></ng-content>\n</button>\n", styles: [".mat-form-field-appearance-legacy .mat-form-field-prefix .mat-datepicker-toggle-default-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-datepicker-toggle-default-icon{width:1em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-datepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-datepicker-toggle-default-icon{display:block;width:1.5em;height:1.5em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-datepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-datepicker-toggle-default-icon{margin:auto}\n"], dependencies: [{ kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
801
|
+
}
|
|
802
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: MatTimePickerToggle, decorators: [{
|
|
803
|
+
type: Component,
|
|
804
|
+
args: [{ selector: 'mat-timepicker-toggle', host: {
|
|
805
|
+
class: 'mat-timepicker-toggle',
|
|
806
|
+
'[attr.tabindex]': 'null',
|
|
807
|
+
'[class.mat-timepicker-toggle-active]': 'timepicker && timepicker.opened',
|
|
808
|
+
'[class.mat-accent]': 'timepicker && timepicker.color === "accent"',
|
|
809
|
+
'[class.mat-warn]': 'timepicker && timepicker.color === "warn"',
|
|
810
|
+
// Used by the test harness to tie this toggle to its timepicker.
|
|
811
|
+
'[attr.data-mat-calendar]': 'timepicker ? timepicker.id : null',
|
|
812
|
+
// Bind the `click` on the host, rather than the inner `button`, so that we can call
|
|
813
|
+
// `stopPropagation` on it without affecting the user's `click` handlers. We need to stop
|
|
814
|
+
// it so that the input doesn't get focused automatically by the form field (See #21836).
|
|
815
|
+
'(click)': '_open($event)',
|
|
816
|
+
}, exportAs: 'matDatepickerToggle', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatIconButton, MatIcon], template: "<button\n #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"timepicker ? 'dialog' : null\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\"\n>\n <mat-icon>schedule</mat-icon>\n\n <ng-content select=\"[mattimepickerToggleIcon]\"></ng-content>\n</button>\n", styles: [".mat-form-field-appearance-legacy .mat-form-field-prefix .mat-datepicker-toggle-default-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-datepicker-toggle-default-icon{width:1em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-datepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-datepicker-toggle-default-icon{display:block;width:1.5em;height:1.5em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-datepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-datepicker-toggle-default-icon{margin:auto}\n"] }]
|
|
817
|
+
}], ctorParameters: () => [], propDecorators: { timepicker: [{
|
|
818
|
+
type: Input,
|
|
819
|
+
args: ['for']
|
|
820
|
+
}], tabIndex: [{
|
|
821
|
+
type: Input
|
|
822
|
+
}], ariaLabel: [{
|
|
823
|
+
type: Input
|
|
824
|
+
}], disabled: [{
|
|
825
|
+
type: Input
|
|
826
|
+
}], disableRipple: [{
|
|
827
|
+
type: Input
|
|
828
|
+
}] } });
|
|
829
|
+
|
|
830
|
+
class MatTimepickerDirective {
|
|
831
|
+
static { this.nextId = 0; }
|
|
832
|
+
/** The datepicker that this input is associated with. */
|
|
833
|
+
set matTimepicker(timepicker) {
|
|
834
|
+
if (timepicker) {
|
|
835
|
+
this._timepicker = timepicker;
|
|
836
|
+
this._timepicker.setTimepickerInput(this);
|
|
837
|
+
this._closedSubscription = timepicker.closedStream.subscribe(() => this._onTouched());
|
|
838
|
+
//this._registerModel(datepicker.registerInput(this));
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
get errorState() {
|
|
842
|
+
const oldState = this._errorState;
|
|
843
|
+
const parent = this._parentFormGroup || this._parentForm;
|
|
844
|
+
const control = this.ngControl
|
|
845
|
+
? this.ngControl.control
|
|
846
|
+
: null;
|
|
847
|
+
const newState = this.errorStateMatcher
|
|
848
|
+
? this.errorStateMatcher.isErrorState(control, parent)
|
|
849
|
+
: oldState;
|
|
850
|
+
if (newState !== oldState) {
|
|
851
|
+
this._errorState = newState;
|
|
852
|
+
this.stateChanges.next();
|
|
853
|
+
}
|
|
854
|
+
return newState;
|
|
855
|
+
}
|
|
856
|
+
get disabled() {
|
|
857
|
+
if (this.ngControl && this.ngControl.disabled !== null) {
|
|
858
|
+
return this.ngControl.disabled;
|
|
859
|
+
}
|
|
860
|
+
return this._disabled;
|
|
861
|
+
}
|
|
862
|
+
set disabled(value) {
|
|
863
|
+
this._disabled = coerceBooleanProperty(value);
|
|
864
|
+
// Browsers may not fire the blur event if the input is disabled too quickly.
|
|
865
|
+
// Reset from here to ensure that the element doesn't become stuck.
|
|
866
|
+
if (this.focused) {
|
|
867
|
+
this.focused = false;
|
|
868
|
+
}
|
|
869
|
+
this.stateChanges.next();
|
|
870
|
+
}
|
|
871
|
+
get id() {
|
|
872
|
+
return this._id;
|
|
873
|
+
}
|
|
874
|
+
set id(value) {
|
|
875
|
+
this._id = value || this._uid;
|
|
876
|
+
}
|
|
877
|
+
get readonly() {
|
|
878
|
+
return this._readonly;
|
|
879
|
+
}
|
|
880
|
+
set readonly(value) {
|
|
881
|
+
this._readonly = coerceBooleanProperty(value);
|
|
882
|
+
}
|
|
883
|
+
get shouldLabelFloat() {
|
|
884
|
+
return this.focused || !this.empty;
|
|
885
|
+
}
|
|
886
|
+
get required() {
|
|
887
|
+
if (this.ngControl?.control) {
|
|
888
|
+
return this.ngControl.control.hasValidator(Validators.required);
|
|
889
|
+
}
|
|
890
|
+
return this._required;
|
|
891
|
+
}
|
|
892
|
+
set required(req) {
|
|
893
|
+
this._required = coerceBooleanProperty(req);
|
|
894
|
+
this.stateChanges.next();
|
|
895
|
+
}
|
|
896
|
+
get placeholder() {
|
|
897
|
+
return this._placeholder;
|
|
898
|
+
}
|
|
899
|
+
set placeholder(plh) {
|
|
900
|
+
this._placeholder = plh;
|
|
901
|
+
this.stateChanges.next();
|
|
902
|
+
}
|
|
903
|
+
set value(value) {
|
|
904
|
+
if (value === this._value) {
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
this._value = value;
|
|
908
|
+
if (!value) {
|
|
909
|
+
this._formattedValueString = '';
|
|
910
|
+
this.setInputElementValue(value);
|
|
911
|
+
this.currentValue = value ?? new Date();
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
914
|
+
this._formattedValueString = `${twoDigits(value.getHours())}:${twoDigits(value.getMinutes())}`;
|
|
915
|
+
if (!this.isInputFocused) {
|
|
916
|
+
this.setInputElementValue(this.formattedValueString);
|
|
917
|
+
}
|
|
918
|
+
this.currentValue = value;
|
|
919
|
+
this.stateChanges.next();
|
|
920
|
+
if (this._skipValueChangeEmission) {
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
923
|
+
this.timeChange.emit(this.currentValue);
|
|
924
|
+
if (this.onChangeFn)
|
|
925
|
+
this.onChangeFn(this.value);
|
|
926
|
+
}
|
|
927
|
+
get value() {
|
|
928
|
+
return this._value;
|
|
929
|
+
}
|
|
930
|
+
get empty() {
|
|
931
|
+
return !(this.currentValue instanceof Date);
|
|
932
|
+
}
|
|
933
|
+
get formattedValueString() {
|
|
934
|
+
return this._formattedValueString;
|
|
935
|
+
}
|
|
936
|
+
inputHandler() {
|
|
937
|
+
const value = this.elRef.nativeElement.value;
|
|
938
|
+
const length = value.length;
|
|
939
|
+
if (length === 0) {
|
|
940
|
+
this.writeValue(null, true);
|
|
941
|
+
this._value = null;
|
|
942
|
+
this._skipValueChangeEmission = true;
|
|
943
|
+
Promise.resolve().then(() => (this._skipValueChangeEmission = false));
|
|
944
|
+
if (this.onChangeFn) {
|
|
945
|
+
this.onChangeFn(null);
|
|
946
|
+
}
|
|
947
|
+
return;
|
|
948
|
+
}
|
|
949
|
+
const valueHasColumn = value.includes(':');
|
|
950
|
+
let [hours, minutes] = length === 1
|
|
951
|
+
? [value, 0]
|
|
952
|
+
: length === 2 && !valueHasColumn
|
|
953
|
+
? [value, 0]
|
|
954
|
+
: valueHasColumn
|
|
955
|
+
? value.split(':')
|
|
956
|
+
: value.split(/(\d\d)/).filter(v => v);
|
|
957
|
+
hours = +hours;
|
|
958
|
+
if (/\s/.test(minutes)) {
|
|
959
|
+
let other;
|
|
960
|
+
[minutes, other] = minutes.split(/\s/);
|
|
961
|
+
if (other === 'pm' && !isNaN(hours) && hours < 12) {
|
|
962
|
+
hours += 12;
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
minutes = +minutes;
|
|
966
|
+
if (isNaN(hours) || isNaN(minutes)) {
|
|
967
|
+
//this.writeValue(null, true);
|
|
968
|
+
this._skipValueChangeEmission = true;
|
|
969
|
+
Promise.resolve().then(() => (this._skipValueChangeEmission = false));
|
|
970
|
+
return;
|
|
971
|
+
}
|
|
972
|
+
if (+hours > 24) {
|
|
973
|
+
hours = '24';
|
|
974
|
+
}
|
|
975
|
+
else if (+hours < 0) {
|
|
976
|
+
hours = '0';
|
|
977
|
+
}
|
|
978
|
+
if (+minutes > 59) {
|
|
979
|
+
minutes = '59';
|
|
980
|
+
}
|
|
981
|
+
else if (+minutes < 0) {
|
|
982
|
+
minutes = '0';
|
|
983
|
+
}
|
|
984
|
+
const d = this.value ? new Date(this.value.getTime()) : new Date();
|
|
985
|
+
d.setHours(+hours);
|
|
986
|
+
d.setMinutes(+minutes);
|
|
987
|
+
d.setSeconds(0);
|
|
988
|
+
d.setMilliseconds(0);
|
|
989
|
+
const isValueInRange = isDateInRange(this.minDate, this.maxDate, d);
|
|
990
|
+
if (!isValueInRange) {
|
|
991
|
+
this.invalidInput.emit();
|
|
992
|
+
}
|
|
993
|
+
this.writeValue(d, true);
|
|
994
|
+
if (this.onChangeFn) {
|
|
995
|
+
this.onChangeFn(d);
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
keydownHandler(event) {
|
|
999
|
+
const e = event;
|
|
1000
|
+
const allowedKey = [
|
|
1001
|
+
'0',
|
|
1002
|
+
'1',
|
|
1003
|
+
'2',
|
|
1004
|
+
'3',
|
|
1005
|
+
'4',
|
|
1006
|
+
'5',
|
|
1007
|
+
'6',
|
|
1008
|
+
'7',
|
|
1009
|
+
'8',
|
|
1010
|
+
'9',
|
|
1011
|
+
':',
|
|
1012
|
+
'Backspace',
|
|
1013
|
+
'Delete',
|
|
1014
|
+
'Tab',
|
|
1015
|
+
'Enter',
|
|
1016
|
+
'ArrowLeft',
|
|
1017
|
+
'ArrowRight',
|
|
1018
|
+
'ArrowUp',
|
|
1019
|
+
'ArrowDown',
|
|
1020
|
+
'Home',
|
|
1021
|
+
'End',
|
|
1022
|
+
];
|
|
1023
|
+
if (allowedKey.indexOf(e.key) >= 0)
|
|
1024
|
+
return;
|
|
1025
|
+
const allowedCtrlShortcuts = ['a', 'c', 'x', 'v'];
|
|
1026
|
+
if (e.ctrlKey && allowedCtrlShortcuts.indexOf(e.key) >= 0)
|
|
1027
|
+
return;
|
|
1028
|
+
if (event.metaKey || event.ctrlKey || event.altKey) {
|
|
1029
|
+
this.combination = this.combination.concat(event.code);
|
|
1030
|
+
return;
|
|
1031
|
+
}
|
|
1032
|
+
const target = event.target;
|
|
1033
|
+
const tValue = target.value;
|
|
1034
|
+
const value = `${tValue.slice(0, target.selectionStart)}${event.key}${tValue.slice(target.selectionEnd)}`;
|
|
1035
|
+
if (value.match(this.pattern) || this.combination.length > 0) {
|
|
1036
|
+
return true;
|
|
1037
|
+
}
|
|
1038
|
+
event.preventDefault();
|
|
1039
|
+
event.stopImmediatePropagation();
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1042
|
+
keyupHandler(event) {
|
|
1043
|
+
this.combination = this.combination.filter(v => v !== event.code);
|
|
1044
|
+
}
|
|
1045
|
+
focusHandler() {
|
|
1046
|
+
this.isInputFocused = true;
|
|
1047
|
+
}
|
|
1048
|
+
focusoutHandler() {
|
|
1049
|
+
this.isInputFocused = false;
|
|
1050
|
+
this.setInputElementValue(this.formattedValueString);
|
|
1051
|
+
if (this.onTouchedFn && !this._timepicker.modalRef) {
|
|
1052
|
+
this.onTouchedFn();
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
constructor() {
|
|
1056
|
+
this._closedSubscription = Subscription.EMPTY;
|
|
1057
|
+
this._errorState = false;
|
|
1058
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1059
|
+
this._onTouched = () => { };
|
|
1060
|
+
this._disabled = false;
|
|
1061
|
+
this._id = '0';
|
|
1062
|
+
this._readonly = false;
|
|
1063
|
+
this.stateChanges = new Subject();
|
|
1064
|
+
this._uid = `mat-input-${MatTimepickerDirective.nextId++}`;
|
|
1065
|
+
this.describedBy = '';
|
|
1066
|
+
this._required = false;
|
|
1067
|
+
this._placeholder = '';
|
|
1068
|
+
this.focused = false;
|
|
1069
|
+
this.pattern = new RegExp('[0-2]?[0-9]:[0-6]?[0-9]');
|
|
1070
|
+
this.allowed24HourMap = this.generateAllowedMap();
|
|
1071
|
+
this.isInputFocused = false;
|
|
1072
|
+
/** Override the label of the ok button. */
|
|
1073
|
+
this.okLabel = 'Ok';
|
|
1074
|
+
/** Override the label of the cancel button. */
|
|
1075
|
+
this.cancelLabel = 'Cancel';
|
|
1076
|
+
/** Sets the clock mode, 12-hour or 24-hour clocks are supported. */
|
|
1077
|
+
this.color = 'primary';
|
|
1078
|
+
this.disableDialogOpenOnClick = false;
|
|
1079
|
+
this.strict = true;
|
|
1080
|
+
this.controlType = 'angular-material-timepicker';
|
|
1081
|
+
this._value = null;
|
|
1082
|
+
this._formattedValueString = '';
|
|
1083
|
+
this._skipValueChangeEmission = true;
|
|
1084
|
+
this.combination = [];
|
|
1085
|
+
this.timeChange = new EventEmitter();
|
|
1086
|
+
this.invalidInput = new EventEmitter();
|
|
1087
|
+
this.ngControl = inject(NgControl, { optional: true, self: true });
|
|
1088
|
+
this.renderer = inject(Renderer2);
|
|
1089
|
+
this.zone = inject(NgZone);
|
|
1090
|
+
this.fm = inject(FocusMonitor);
|
|
1091
|
+
this.elRef = inject((ElementRef));
|
|
1092
|
+
this.ngZone = inject(NgZone);
|
|
1093
|
+
this._platform = inject(Platform);
|
|
1094
|
+
this._parentForm = inject(NgForm, { optional: true });
|
|
1095
|
+
this._matFormFiled = inject(MatFormField, { optional: true });
|
|
1096
|
+
this._parentFormGroup = inject(FormGroupDirective, {
|
|
1097
|
+
optional: true,
|
|
1098
|
+
});
|
|
1099
|
+
this._defaultErrorStateMatcher = inject(ErrorStateMatcher);
|
|
1100
|
+
this.errorStateMatcher = this._defaultErrorStateMatcher;
|
|
1101
|
+
if (this.ngControl != null) {
|
|
1102
|
+
this.ngControl.valueAccessor = this;
|
|
1103
|
+
}
|
|
1104
|
+
if (this._platform.IOS) {
|
|
1105
|
+
this.ngZone.runOutsideAngular(() => {
|
|
1106
|
+
this.elRef.nativeElement.addEventListener('keyup', (event) => {
|
|
1107
|
+
const el = event.target;
|
|
1108
|
+
if (!el.value && !el.selectionStart && !el.selectionEnd) {
|
|
1109
|
+
// Note: Just setting `0, 0` doesn't fix the issue. Setting
|
|
1110
|
+
// `1, 1` fixes it for the first time that you type text and
|
|
1111
|
+
// then hold delete. Toggling to `1, 1` and then back to
|
|
1112
|
+
// `0, 0` seems to completely fix it.
|
|
1113
|
+
el.setSelectionRange(1, 1);
|
|
1114
|
+
el.setSelectionRange(0, 0);
|
|
1115
|
+
}
|
|
1116
|
+
});
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
this._isServer = !this._platform.isBrowser;
|
|
1120
|
+
}
|
|
1121
|
+
setDescribedByIds(ids) {
|
|
1122
|
+
this.describedBy = ids.join(' ');
|
|
1123
|
+
}
|
|
1124
|
+
onContainerClick(event) {
|
|
1125
|
+
if (event.target.tagName.toLowerCase() !== 'input') {
|
|
1126
|
+
this.elRef.nativeElement.focus();
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
setInputElementValue(value) {
|
|
1130
|
+
Promise.resolve().then(() => {
|
|
1131
|
+
this.zone.runOutsideAngular(() => {
|
|
1132
|
+
this.renderer.setProperty(this.elRef.nativeElement, 'value', value);
|
|
1133
|
+
});
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
validate() {
|
|
1137
|
+
const isValueInRange = this.strict
|
|
1138
|
+
? isDateInRange(this.minDate, this.maxDate, this.currentValue)
|
|
1139
|
+
: isTimeInRange(this.minDate, this.maxDate, this.currentValue);
|
|
1140
|
+
return isValueInRange ? null : { dateRange: true };
|
|
1141
|
+
}
|
|
1142
|
+
ngOnInit() {
|
|
1143
|
+
if (this._platform.isBrowser) {
|
|
1144
|
+
this.fm.monitor(this.elRef.nativeElement, true).subscribe(origin => {
|
|
1145
|
+
this.focused = !!origin;
|
|
1146
|
+
this.stateChanges.next();
|
|
1147
|
+
});
|
|
1148
|
+
}
|
|
1149
|
+
if (!this.value) {
|
|
1150
|
+
const hasMaxDate = !!this.maxDate;
|
|
1151
|
+
const hasMinDate = !!this.minDate;
|
|
1152
|
+
//if (hasMinDate || hasMaxDate) {
|
|
1153
|
+
if (hasMinDate) {
|
|
1154
|
+
this.minDate.setSeconds(0);
|
|
1155
|
+
this.minDate.setMilliseconds(0);
|
|
1156
|
+
}
|
|
1157
|
+
if (hasMaxDate) {
|
|
1158
|
+
this.maxDate.setSeconds(0);
|
|
1159
|
+
this.maxDate.setMilliseconds(0);
|
|
1160
|
+
}
|
|
1161
|
+
if (!this.ngControl._rawValidators.find((v) => v === this)) {
|
|
1162
|
+
this.ngControl._rawValidators.push(this);
|
|
1163
|
+
}
|
|
1164
|
+
//}
|
|
1165
|
+
}
|
|
1166
|
+
this._skipValueChangeEmission = false;
|
|
1167
|
+
}
|
|
1168
|
+
generateAllowedMap() {
|
|
1169
|
+
const isStrictMode = this.strict && this.value instanceof Date;
|
|
1170
|
+
const a24hm = {};
|
|
1171
|
+
for (let h = 0; h < 24; h++) {
|
|
1172
|
+
for (let m = 0; m < 60; m++) {
|
|
1173
|
+
const hourMap = a24hm[h] || {};
|
|
1174
|
+
if (isStrictMode && this.value) {
|
|
1175
|
+
const currentDate = new Date(this.value.getTime());
|
|
1176
|
+
currentDate.setHours(h);
|
|
1177
|
+
currentDate.setMinutes(m);
|
|
1178
|
+
currentDate.setSeconds(0);
|
|
1179
|
+
currentDate.setMilliseconds(0);
|
|
1180
|
+
hourMap[m] = isDateInRange(this.minDate, this.maxDate, currentDate);
|
|
1181
|
+
}
|
|
1182
|
+
else {
|
|
1183
|
+
hourMap[m] = isAllowed(h, m, this.minDate, this.maxDate);
|
|
1184
|
+
}
|
|
1185
|
+
a24hm[h] = hourMap;
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
return a24hm;
|
|
1189
|
+
}
|
|
1190
|
+
ngOnChanges() {
|
|
1191
|
+
this.pattern = /^[0-9]{1,2}:?([0-9]{1,2})?$/;
|
|
1192
|
+
if (!this._timepicker.modalRef ||
|
|
1193
|
+
!this._timepicker.modalRef.componentInstance) {
|
|
1194
|
+
return;
|
|
1195
|
+
}
|
|
1196
|
+
this._timepicker.modalRef.componentInstance.data = {
|
|
1197
|
+
value: this.currentValue,
|
|
1198
|
+
okLabel: this.okLabel,
|
|
1199
|
+
cancelLabel: this.cancelLabel,
|
|
1200
|
+
color: this.color,
|
|
1201
|
+
minDate: this.minDate,
|
|
1202
|
+
maxDate: this.maxDate,
|
|
1203
|
+
allowed24HourMap: this.allowed24HourMap,
|
|
1204
|
+
};
|
|
1205
|
+
}
|
|
1206
|
+
checkValidity(value) {
|
|
1207
|
+
if (!value) {
|
|
1208
|
+
return false;
|
|
1209
|
+
}
|
|
1210
|
+
const hour = value.getHours();
|
|
1211
|
+
const minutes = value.getMinutes();
|
|
1212
|
+
return isAllowed(hour, minutes, this.minDate, this.maxDate);
|
|
1213
|
+
}
|
|
1214
|
+
writeValue(value, isInnerCall = false) {
|
|
1215
|
+
if (!isInnerCall) {
|
|
1216
|
+
this._skipValueChangeEmission = true;
|
|
1217
|
+
Promise.resolve().then(() => (this._skipValueChangeEmission = false));
|
|
1218
|
+
}
|
|
1219
|
+
if (value) {
|
|
1220
|
+
value.setSeconds(0);
|
|
1221
|
+
value.setMilliseconds(0);
|
|
1222
|
+
}
|
|
1223
|
+
if (this.value && +this.value === +(value ?? 0)) {
|
|
1224
|
+
return;
|
|
1225
|
+
}
|
|
1226
|
+
else {
|
|
1227
|
+
this.value = value;
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
registerOnChange(fn) {
|
|
1231
|
+
this.onChangeFn = fn;
|
|
1232
|
+
}
|
|
1233
|
+
registerOnTouched(fn) {
|
|
1234
|
+
this.onTouchedFn = fn;
|
|
1235
|
+
}
|
|
1236
|
+
setDisabledState(isDisabled) {
|
|
1237
|
+
this.disabled = isDisabled;
|
|
1238
|
+
this.stateChanges.next();
|
|
1239
|
+
}
|
|
1240
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: MatTimepickerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1241
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.7", type: MatTimepickerDirective, isStandalone: true, selector: "input[matTimepicker]", inputs: { matTimepicker: "matTimepicker", disabled: "disabled", id: "id", readonly: "readonly", errorStateMatcher: "errorStateMatcher", required: "required", placeholder: "placeholder", okLabel: "okLabel", cancelLabel: "cancelLabel", color: "color", disableDialogOpenOnClick: "disableDialogOpenOnClick", strict: "strict", minDate: "minDate", maxDate: "maxDate", value: "value" }, outputs: { timeChange: "timeChange", invalidInput: "invalidInput" }, host: { listeners: { "input": "inputHandler()", "keydown": "keydownHandler($event)", "keyup": "keyupHandler($event)", "focus": "focusHandler()", "focusout": "focusoutHandler()" }, properties: { "class.mat-input-server": "_isServer", "attr.id": "id", "attr.placeholder": "placeholder", "disabled": "disabled", "required": "required", "attr.readonly": "readonly || null", "attr.aria-invalid": "errorState", "attr.aria-required": "required.toString()", "class.floating": "this.shouldLabelFloat", "attr.aria-describedby": "this.describedBy" }, classAttribute: "mat-input-element mat-form-field-autofill-control" }, providers: [
|
|
1242
|
+
{ provide: MatFormFieldControl, useExisting: MatTimepickerDirective },
|
|
1243
|
+
], exportAs: ["matTimepicker"], usesOnChanges: true, ngImport: i0 }); }
|
|
1244
|
+
}
|
|
1245
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: MatTimepickerDirective, decorators: [{
|
|
1246
|
+
type: Directive,
|
|
1247
|
+
args: [{
|
|
1248
|
+
selector: 'input[matTimepicker]',
|
|
1249
|
+
providers: [
|
|
1250
|
+
{ provide: MatFormFieldControl, useExisting: MatTimepickerDirective },
|
|
1251
|
+
],
|
|
1252
|
+
host: {
|
|
1253
|
+
class: 'mat-input-element mat-form-field-autofill-control',
|
|
1254
|
+
'[class.mat-input-server]': '_isServer',
|
|
1255
|
+
// Native input properties that are overwritten by Angular inputs need to be synced with
|
|
1256
|
+
// the native input element. Otherwise property bindings for those don't work.
|
|
1257
|
+
'[attr.id]': 'id',
|
|
1258
|
+
'[attr.placeholder]': 'placeholder',
|
|
1259
|
+
'[disabled]': 'disabled',
|
|
1260
|
+
'[required]': 'required',
|
|
1261
|
+
'[attr.readonly]': 'readonly || null',
|
|
1262
|
+
'[attr.aria-invalid]': 'errorState',
|
|
1263
|
+
'[attr.aria-required]': 'required.toString()',
|
|
1264
|
+
},
|
|
1265
|
+
exportAs: 'matTimepicker',
|
|
1266
|
+
standalone: true,
|
|
1267
|
+
}]
|
|
1268
|
+
}], ctorParameters: () => [], propDecorators: { matTimepicker: [{
|
|
1269
|
+
type: Input
|
|
1270
|
+
}], disabled: [{
|
|
1271
|
+
type: Input
|
|
1272
|
+
}], id: [{
|
|
1273
|
+
type: Input
|
|
1274
|
+
}], readonly: [{
|
|
1275
|
+
type: Input
|
|
1276
|
+
}], shouldLabelFloat: [{
|
|
1277
|
+
type: HostBinding,
|
|
1278
|
+
args: ['class.floating']
|
|
1279
|
+
}], describedBy: [{
|
|
1280
|
+
type: HostBinding,
|
|
1281
|
+
args: ['attr.aria-describedby']
|
|
1282
|
+
}], errorStateMatcher: [{
|
|
1283
|
+
type: Input
|
|
1284
|
+
}], required: [{
|
|
1285
|
+
type: Input
|
|
1286
|
+
}], placeholder: [{
|
|
1287
|
+
type: Input
|
|
1288
|
+
}], okLabel: [{
|
|
1289
|
+
type: Input
|
|
1290
|
+
}], cancelLabel: [{
|
|
1291
|
+
type: Input
|
|
1292
|
+
}], color: [{
|
|
1293
|
+
type: Input
|
|
1294
|
+
}], disableDialogOpenOnClick: [{
|
|
1295
|
+
type: Input
|
|
1296
|
+
}], strict: [{
|
|
1297
|
+
type: Input
|
|
1298
|
+
}], minDate: [{
|
|
1299
|
+
type: Input
|
|
1300
|
+
}], maxDate: [{
|
|
1301
|
+
type: Input
|
|
1302
|
+
}], value: [{
|
|
1303
|
+
type: Input
|
|
1304
|
+
}], timeChange: [{
|
|
1305
|
+
type: Output
|
|
1306
|
+
}], invalidInput: [{
|
|
1307
|
+
type: Output
|
|
1308
|
+
}], inputHandler: [{
|
|
1309
|
+
type: HostListener,
|
|
1310
|
+
args: ['input']
|
|
1311
|
+
}], keydownHandler: [{
|
|
1312
|
+
type: HostListener,
|
|
1313
|
+
args: ['keydown', ['$event']]
|
|
1314
|
+
}], keyupHandler: [{
|
|
1315
|
+
type: HostListener,
|
|
1316
|
+
args: ['keyup', ['$event']]
|
|
1317
|
+
}], focusHandler: [{
|
|
1318
|
+
type: HostListener,
|
|
1319
|
+
args: ['focus']
|
|
1320
|
+
}], focusoutHandler: [{
|
|
1321
|
+
type: HostListener,
|
|
1322
|
+
args: ['focusout']
|
|
1323
|
+
}] } });
|
|
1324
|
+
|
|
1325
|
+
class OnemrvaMatTimepickerModule {
|
|
1326
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: OnemrvaMatTimepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1327
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.7", ngImport: i0, type: OnemrvaMatTimepickerModule, imports: [ClockComponent,
|
|
1328
|
+
MatTimepickerDirective,
|
|
1329
|
+
MatTimepickerComponentDialogComponent,
|
|
1330
|
+
MatTimepickerToggleIconDirective,
|
|
1331
|
+
MatTimePickerToggle,
|
|
1332
|
+
OnemrvaMatTimepickerComponent], exports: [MatTimepickerDirective,
|
|
1333
|
+
MatTimePickerToggle,
|
|
1334
|
+
OnemrvaMatTimepickerComponent] }); }
|
|
1335
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: OnemrvaMatTimepickerModule, imports: [ClockComponent,
|
|
1336
|
+
MatTimepickerComponentDialogComponent,
|
|
1337
|
+
MatTimePickerToggle] }); }
|
|
1338
|
+
}
|
|
1339
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: OnemrvaMatTimepickerModule, decorators: [{
|
|
1340
|
+
type: NgModule,
|
|
1341
|
+
args: [{
|
|
1342
|
+
imports: [
|
|
1343
|
+
ClockComponent,
|
|
1344
|
+
MatTimepickerDirective,
|
|
1345
|
+
MatTimepickerComponentDialogComponent,
|
|
1346
|
+
MatTimepickerToggleIconDirective,
|
|
1347
|
+
MatTimePickerToggle,
|
|
1348
|
+
OnemrvaMatTimepickerComponent,
|
|
1349
|
+
],
|
|
1350
|
+
exports: [
|
|
1351
|
+
MatTimepickerDirective,
|
|
1352
|
+
MatTimePickerToggle,
|
|
1353
|
+
OnemrvaMatTimepickerComponent,
|
|
1354
|
+
],
|
|
1355
|
+
}]
|
|
1356
|
+
}] });
|
|
1357
|
+
|
|
1358
|
+
/**
|
|
1359
|
+
* Generated bundle index. Do not edit.
|
|
1360
|
+
*/
|
|
1361
|
+
|
|
1362
|
+
export { ClockComponent, MatTimePickerToggle, MatTimepickerComponentDialogComponent, MatTimepickerDirective, MatTimepickerToggleIconDirective, OnemrvaMatTimepickerComponent, OnemrvaMatTimepickerModule };
|
|
1363
|
+
//# sourceMappingURL=onemrvapublic-design-system-mat-timepicker.mjs.map
|