@onemrvapublic/design-system 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +4 -0
- package/.editorconfig +16 -0
- package/.github/workflows/npm-publish.yml +34 -0
- package/README.md +27 -0
- package/angular.json +214 -0
- package/build.sh +108 -0
- package/cypress.config.ts +40 -0
- package/index.html +10 -0
- package/npm-publish.sh +11 -0
- package/package.json +89 -0
- package/projects/onemrva/design-system/README.md +24 -0
- package/projects/onemrva/design-system/_index.scss +29 -0
- package/projects/onemrva/design-system/_utils.scss +25 -0
- package/projects/onemrva/design-system/layout/assets/logo_de.svg +3 -0
- package/projects/onemrva/design-system/layout/assets/logo_en.svg +3 -0
- package/projects/onemrva/design-system/layout/assets/logo_fr.svg +3 -0
- package/projects/onemrva/design-system/layout/assets/logo_nl.svg +3 -0
- package/projects/onemrva/design-system/layout/assets/logo_onem_rva.svg +32 -0
- package/projects/onemrva/design-system/layout/index.ts +7 -0
- package/projects/onemrva/design-system/layout/ng-package.json +6 -0
- package/projects/onemrva/design-system/layout/src/components/index.ts +31 -0
- package/projects/onemrva/design-system/layout/src/components/layout/_layout-mixin.component.scss +159 -0
- package/projects/onemrva/design-system/layout/src/components/layout/layout.component.html +194 -0
- package/projects/onemrva/design-system/layout/src/components/layout/layout.component.scss +137 -0
- package/projects/onemrva/design-system/layout/src/components/layout/layout.component.spec.ts +24 -0
- package/projects/onemrva/design-system/layout/src/components/layout/layout.component.ts +187 -0
- package/projects/onemrva/design-system/layout/src/components/layout-content/layout-content.component.spec.ts +24 -0
- package/projects/onemrva/design-system/layout/src/components/layout-content/layout-content.component.ts +23 -0
- package/projects/onemrva/design-system/layout/src/components/layout-footer/layout-footer.component.ts +11 -0
- package/projects/onemrva/design-system/layout/src/components/layout-login-menu/layout-login-menu.component.spec.ts +25 -0
- package/projects/onemrva/design-system/layout/src/components/layout-login-menu/layout-login-menu.component.ts +17 -0
- package/projects/onemrva/design-system/layout/src/components/layout-route/layout-route.component.html +57 -0
- package/projects/onemrva/design-system/layout/src/components/layout-route/layout-route.component.spec.ts +24 -0
- package/projects/onemrva/design-system/layout/src/components/layout-route/layout-route.component.ts +56 -0
- package/projects/onemrva/design-system/layout/src/components/layout-sidenav/layout-sidenav.component.html +104 -0
- package/projects/onemrva/design-system/layout/src/components/layout-sidenav/layout-sidenav.component.ts +88 -0
- package/projects/onemrva/design-system/layout/src/components/layout-sidenav-title/layout-sidenav-title.component.ts +9 -0
- package/projects/onemrva/design-system/layout/src/components/layout-subroute/layout-subroute.component.html +44 -0
- package/projects/onemrva/design-system/layout/src/components/layout-subroute/layout-subroute.component.spec.ts +24 -0
- package/projects/onemrva/design-system/layout/src/components/layout-subroute/layout-subroute.component.ts +35 -0
- package/projects/onemrva/design-system/layout/src/components/layout-title/layout-title.component.spec.ts +25 -0
- package/projects/onemrva/design-system/layout/src/components/layout-title/layout-title.component.ts +17 -0
- package/projects/onemrva/design-system/layout/src/decorators/coerce-boolean-input.decorator.ts +19 -0
- package/projects/onemrva/design-system/layout/src/decorators/observable-content.decorator.ts +13 -0
- package/projects/onemrva/design-system/layout/src/directives/drawer-host.directive.ts +10 -0
- package/projects/onemrva/design-system/layout/src/enums/environment.enum.ts +6 -0
- package/projects/onemrva/design-system/layout/src/layout.component.spec.ts +24 -0
- package/projects/onemrva/design-system/layout/src/layout.module.ts +103 -0
- package/projects/onemrva/design-system/layout/src/models/onem-language.model.ts +4 -0
- package/projects/onemrva/design-system/layout/src/models/onemrva-profile.model.ts +57 -0
- package/projects/onemrva/design-system/layout/src/services/drawer.service.ts +28 -0
- package/projects/onemrva/design-system/layout/src/striphtml.pipe.ts +11 -0
- package/projects/onemrva/design-system/layout/src/test.ts +25 -0
- package/projects/onemrva/design-system/mat-avatar/index.ts +2 -0
- package/projects/onemrva/design-system/mat-avatar/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-avatar/src/onemrva-mat-avatar.component.html +17 -0
- package/projects/onemrva/design-system/mat-avatar/src/onemrva-mat-avatar.component.scss +130 -0
- package/projects/onemrva/design-system/mat-avatar/src/onemrva-mat-avatar.component.ts +421 -0
- package/projects/onemrva/design-system/mat-avatar/src/onemrva-mat-avatar.module.ts +17 -0
- package/projects/onemrva/design-system/mat-badge/index.ts +6 -0
- package/projects/onemrva/design-system/mat-badge/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-badge/src/onemrva-mat-badge.component.scss +152 -0
- package/projects/onemrva/design-system/mat-badge/src/onemrva-mat-badge.component.ts +291 -0
- package/projects/onemrva/design-system/mat-badge/src/onemrva-mat-badge.module.ts +8 -0
- package/projects/onemrva/design-system/mat-breadcrumb/index.ts +7 -0
- package/projects/onemrva/design-system/mat-breadcrumb/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-breadcrumb/src/onemrva-mat-breadcrumb.component.html +37 -0
- package/projects/onemrva/design-system/mat-breadcrumb/src/onemrva-mat-breadcrumb.component.scss +70 -0
- package/projects/onemrva/design-system/mat-breadcrumb/src/onemrva-mat-breadcrumb.component.ts +16 -0
- package/projects/onemrva/design-system/mat-breadcrumb/src/onemrva-mat-breadcrumb.model.ts +4 -0
- package/projects/onemrva/design-system/mat-breadcrumb/src/onemrva-mat-breadcrumb.module.ts +12 -0
- package/projects/onemrva/design-system/mat-breadcrumb/src/onemrva-mat-breadcrumb.service.ts +65 -0
- package/projects/onemrva/design-system/mat-clipboard/index.ts +6 -0
- package/projects/onemrva/design-system/mat-clipboard/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-clipboard/src/_onemrva-mat-spinner.component.scss +62 -0
- package/projects/onemrva/design-system/mat-clipboard/src/onemrva-mat-clipboard.component.ts +16 -0
- package/projects/onemrva/design-system/mat-clipboard/src/onemrva-mat-clipboard.module.ts +14 -0
- package/projects/onemrva/design-system/mat-datepicker-header/index.ts +5 -0
- package/projects/onemrva/design-system/mat-datepicker-header/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-datepicker-header/src/_onemrva-mat-datepicker-header.component.scss +11 -0
- package/projects/onemrva/design-system/mat-datepicker-header/src/onemrva-mat-datepicker-header.component.html +53 -0
- package/projects/onemrva/design-system/mat-datepicker-header/src/onemrva-mat-datepicker-header.component.ts +285 -0
- package/projects/onemrva/design-system/mat-file-upload/index.ts +11 -0
- package/projects/onemrva/design-system/mat-file-upload/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-file-upload/src/components/index.ts +10 -0
- package/projects/onemrva/design-system/mat-file-upload/src/components/onemrva-mat-file-panel/onemrva-file-panel.component.html +59 -0
- package/projects/onemrva/design-system/mat-file-upload/src/components/onemrva-mat-file-panel/onemrva-file-panel.component.scss +24 -0
- package/projects/onemrva/design-system/mat-file-upload/src/components/onemrva-mat-file-panel/onemrva-file-panel.component.ts +79 -0
- package/projects/onemrva/design-system/mat-file-upload/src/components/onemrva-mat-file-upload/onemrva-mat-file-upload.component.html +53 -0
- package/projects/onemrva/design-system/mat-file-upload/src/components/onemrva-mat-file-upload/onemrva-mat-file-upload.component.scss +248 -0
- package/projects/onemrva/design-system/mat-file-upload/src/components/onemrva-mat-file-upload/onemrva-mat-file-upload.component.ts +185 -0
- package/projects/onemrva/design-system/mat-file-upload/src/directives/dnd.directive.ts +43 -0
- package/projects/onemrva/design-system/mat-file-upload/src/models/action-config.model.ts +10 -0
- package/projects/onemrva/design-system/mat-file-upload/src/models/progress-file.model.ts +94 -0
- package/projects/onemrva/design-system/mat-file-upload/src/onemrva-mat-file-upload-itf.store.ts +79 -0
- package/projects/onemrva/design-system/mat-file-upload/src/onemrva-mat-file-upload.module.ts +28 -0
- package/projects/onemrva/design-system/mat-file-upload/src/onemrva-mat-file-upload.service.ts +68 -0
- package/projects/onemrva/design-system/mat-file-upload/src/onemrva-mat-file-upload.store.ts +473 -0
- package/projects/onemrva/design-system/mat-input-bank-account/index.ts +5 -0
- package/projects/onemrva/design-system/mat-input-bank-account/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-input-bank-account/src/onemrva-mat-input-bank-account.component.html +32 -0
- package/projects/onemrva/design-system/mat-input-bank-account/src/onemrva-mat-input-bank-account.component.scss +9 -0
- package/projects/onemrva/design-system/mat-input-bank-account/src/onemrva-mat-input-bank-account.component.ts +125 -0
- package/projects/onemrva/design-system/mat-input-country/index.ts +6 -0
- package/projects/onemrva/design-system/mat-input-country/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-input-country/src/countries.ts +3182 -0
- package/projects/onemrva/design-system/mat-input-country/src/onemrva-mat-input-country.component.html +29 -0
- package/projects/onemrva/design-system/mat-input-country/src/onemrva-mat-input-country.component.scss +29 -0
- package/projects/onemrva/design-system/mat-input-country/src/onemrva-mat-input-country.component.ts +144 -0
- package/projects/onemrva/design-system/mat-input-enterprise-number/index.ts +5 -0
- package/projects/onemrva/design-system/mat-input-enterprise-number/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-input-enterprise-number/src/onemrva-mat-input-enterprise-number.component.html +39 -0
- package/projects/onemrva/design-system/mat-input-enterprise-number/src/onemrva-mat-input-enterprise-number.component.scss +25 -0
- package/projects/onemrva/design-system/mat-input-enterprise-number/src/onemrva-mat-input-enterprise-number.component.ts +190 -0
- package/projects/onemrva/design-system/mat-input-phone/index.ts +6 -0
- package/projects/onemrva/design-system/mat-input-phone/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-input-phone/src/onemrva-mat-input-phone.component.html +43 -0
- package/projects/onemrva/design-system/mat-input-phone/src/onemrva-mat-input-phone.component.scss +29 -0
- package/projects/onemrva/design-system/mat-input-phone/src/onemrva-mat-input-phone.component.ts +261 -0
- package/projects/onemrva/design-system/mat-input-phone/src/phone-number.directive.ts +47 -0
- package/projects/onemrva/design-system/mat-message-box/index.ts +2 -0
- package/projects/onemrva/design-system/mat-message-box/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-message-box/src/onemrva-mat-message-box.component.scss +60 -0
- package/projects/onemrva/design-system/mat-message-box/src/onemrva-mat-message-box.component.ts +134 -0
- package/projects/onemrva/design-system/mat-message-box/src/onemrva-mat-message-box.module.ts +12 -0
- package/projects/onemrva/design-system/mat-multi-select/index.ts +2 -0
- package/projects/onemrva/design-system/mat-multi-select/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-multi-select/src/_onemrva-mat-multi-select.component.scss +66 -0
- package/projects/onemrva/design-system/mat-multi-select/src/onemrva-mat-multi-select.component.html +24 -0
- package/projects/onemrva/design-system/mat-multi-select/src/onemrva-mat-multi-select.component.ts +152 -0
- package/projects/onemrva/design-system/mat-multi-select/src/onemrva-mat-multi-select.module.ts +31 -0
- package/projects/onemrva/design-system/mat-notification/index.ts +1 -0
- package/projects/onemrva/design-system/mat-notification/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-notification/src/_onemrva-mat-notification.component.scss +71 -0
- package/projects/onemrva/design-system/mat-notification/src/onemrva-mat-notification.component.html +10 -0
- package/projects/onemrva/design-system/mat-notification/src/onemrva-mat-notification.component.ts +158 -0
- package/projects/onemrva/design-system/mat-paginator/index.ts +6 -0
- package/projects/onemrva/design-system/mat-paginator/ng-package.json +7 -0
- package/projects/onemrva/design-system/mat-paginator/package.json +7 -0
- package/projects/onemrva/design-system/mat-paginator/src/_onemrva-mat-paginator.component.scss +122 -0
- package/projects/onemrva/design-system/mat-paginator/src/onemrva-mat-paginator.component.html +104 -0
- package/projects/onemrva/design-system/mat-paginator/src/onemrva-mat-paginator.component.spec.ts +184 -0
- package/projects/onemrva/design-system/mat-paginator/src/onemrva-mat-paginator.component.ts +214 -0
- package/projects/onemrva/design-system/mat-paginator/src/onemrva-mat-paginator.module.ts +15 -0
- package/projects/onemrva/design-system/mat-panel/index.ts +6 -0
- package/projects/onemrva/design-system/mat-panel/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-panel/src/onemrva-mat-panel-content.component.ts +12 -0
- package/projects/onemrva/design-system/mat-panel/src/onemrva-mat-panel-content.html +5 -0
- package/projects/onemrva/design-system/mat-panel/src/onemrva-mat-panel-icon.component.ts +12 -0
- package/projects/onemrva/design-system/mat-panel/src/onemrva-mat-panel-icon.html +5 -0
- package/projects/onemrva/design-system/mat-panel/src/onemrva-mat-panel-title-action.component.ts +12 -0
- package/projects/onemrva/design-system/mat-panel/src/onemrva-mat-panel-title-action.html +5 -0
- package/projects/onemrva/design-system/mat-panel/src/onemrva-mat-panel-title.component.ts +20 -0
- package/projects/onemrva/design-system/mat-panel/src/onemrva-mat-panel-title.html +8 -0
- package/projects/onemrva/design-system/mat-panel/src/onemrva-mat-panel.component.html +10 -0
- package/projects/onemrva/design-system/mat-panel/src/onemrva-mat-panel.component.scss +100 -0
- package/projects/onemrva/design-system/mat-panel/src/onemrva-mat-panel.component.ts +122 -0
- package/projects/onemrva/design-system/mat-panel/src/onemrva-mat-panel.module.ts +26 -0
- package/projects/onemrva/design-system/mat-pop-over/index.ts +4 -0
- package/projects/onemrva/design-system/mat-pop-over/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-pop-over/src/onemrva-mat-pop-over-content.component.ts +13 -0
- package/projects/onemrva/design-system/mat-pop-over/src/onemrva-mat-pop-over-trigger.component.ts +13 -0
- package/projects/onemrva/design-system/mat-pop-over/src/onemrva-mat-pop-over.component.html +29 -0
- package/projects/onemrva/design-system/mat-pop-over/src/onemrva-mat-pop-over.component.scss +141 -0
- package/projects/onemrva/design-system/mat-pop-over/src/onemrva-mat-pop-over.component.ts +47 -0
- package/projects/onemrva/design-system/mat-pop-over/src/onemrva-mat-pop-over.module.ts +19 -0
- package/projects/onemrva/design-system/mat-progress-bar/index.ts +1 -0
- package/projects/onemrva/design-system/mat-progress-bar/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-progress-bar/src/_onemrva-mat-progress-bar-mixin.component.scss +37 -0
- package/projects/onemrva/design-system/mat-progress-bar/src/onemrva-mat-progress-bar.component.html +13 -0
- package/projects/onemrva/design-system/mat-progress-bar/src/onemrva-mat-progress-bar.component.ts +27 -0
- package/projects/onemrva/design-system/mat-select-search/index.ts +3 -0
- package/projects/onemrva/design-system/mat-select-search/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-select-search/src/default-options.ts +42 -0
- package/projects/onemrva/design-system/mat-select-search/src/mat-select-no-entries-found.directive.ts +15 -0
- package/projects/onemrva/design-system/mat-select-search/src/mat-select-search-clear.directive.ts +13 -0
- package/projects/onemrva/design-system/mat-select-search/src/mat-select-search.component.html +67 -0
- package/projects/onemrva/design-system/mat-select-search/src/mat-select-search.component.scss +126 -0
- package/projects/onemrva/design-system/mat-select-search/src/mat-select-search.component.spec.ts +790 -0
- package/projects/onemrva/design-system/mat-select-search/src/mat-select-search.component.ts +612 -0
- package/projects/onemrva/design-system/mat-select-search/src/mat-select-search.module.ts +53 -0
- package/projects/onemrva/design-system/mat-side-menu/index.ts +6 -0
- package/projects/onemrva/design-system/mat-side-menu/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-side-menu/src/onemrva-mat-side-menu.component.html +36 -0
- package/projects/onemrva/design-system/mat-side-menu/src/onemrva-mat-side-menu.component.scss +50 -0
- package/projects/onemrva/design-system/mat-side-menu/src/onemrva-mat-side-menu.component.spec.ts +66 -0
- package/projects/onemrva/design-system/mat-side-menu/src/onemrva-mat-side-menu.component.ts +46 -0
- package/projects/onemrva/design-system/mat-side-menu/src/onemrva-mat-side-menu.module.ts +14 -0
- package/projects/onemrva/design-system/mat-skeleton/index.ts +3 -0
- package/projects/onemrva/design-system/mat-skeleton/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-skeleton/src/onemrva-mat-skeleton-enums.ts +32 -0
- package/projects/onemrva/design-system/mat-skeleton/src/onemrva-mat-skeleton.component.html +17 -0
- package/projects/onemrva/design-system/mat-skeleton/src/onemrva-mat-skeleton.component.scss +216 -0
- package/projects/onemrva/design-system/mat-skeleton/src/onemrva-mat-skeleton.component.ts +173 -0
- package/projects/onemrva/design-system/mat-skeleton/src/onemrva-mat-skeleton.module.ts +16 -0
- package/projects/onemrva/design-system/mat-spinner/index.ts +6 -0
- package/projects/onemrva/design-system/mat-spinner/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-spinner/src/_onemrva-mat-spinner.component.scss +62 -0
- package/projects/onemrva/design-system/mat-spinner/src/onemrva-mat-spinner.component.ts +11 -0
- package/projects/onemrva/design-system/mat-spinner/src/onemrva-mat-spinner.module.ts +8 -0
- package/projects/onemrva/design-system/mat-stepper/index.ts +6 -0
- package/projects/onemrva/design-system/mat-stepper/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-stepper/src/_stepper-variables.scss +29 -0
- package/projects/onemrva/design-system/mat-stepper/src/onemrva-mat-stepper.component.spec.ts +23 -0
- package/projects/onemrva/design-system/mat-stepper/src/onemrva-mat-stepper.component.ts +60 -0
- package/projects/onemrva/design-system/mat-stepper/src/onemrva-mat-stepper.html +53 -0
- package/projects/onemrva/design-system/mat-stepper/src/onemrva-mat-stepper.module.ts +30 -0
- package/projects/onemrva/design-system/mat-stepper/src/onemrva-mat-stepper.scss +106 -0
- package/projects/onemrva/design-system/mat-stepper/src/onemrva-stepper-animations.ts +40 -0
- package/projects/onemrva/design-system/mat-table-of-content/index.ts +8 -0
- package/projects/onemrva/design-system/mat-table-of-content/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-table-of-content/src/_onemrva-mat-table-of-content.component.scss +79 -0
- package/projects/onemrva/design-system/mat-table-of-content/src/onemrva-mat-table-of-content.component.html +23 -0
- package/projects/onemrva/design-system/mat-table-of-content/src/onemrva-mat-table-of-content.component.ts +128 -0
- package/projects/onemrva/design-system/mat-table-of-content/src/onemrva-mat-table-of-content.directive.ts +67 -0
- package/projects/onemrva/design-system/mat-table-of-content/src/onemrva-mat-table-of-content.service.ts +51 -0
- package/projects/onemrva/design-system/mat-table-of-content/src/onemrva-mat-toc-anchor.model.ts +24 -0
- package/projects/onemrva/design-system/mat-task-list/index.ts +5 -0
- package/projects/onemrva/design-system/mat-task-list/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-task-list/src/onemrva-mat-task-content.component.ts +12 -0
- package/projects/onemrva/design-system/mat-task-list/src/onemrva-mat-task-content.html +5 -0
- package/projects/onemrva/design-system/mat-task-list/src/onemrva-mat-task-list.component.html +1 -0
- package/projects/onemrva/design-system/mat-task-list/src/onemrva-mat-task-list.component.scss +150 -0
- package/projects/onemrva/design-system/mat-task-list/src/onemrva-mat-task-list.component.ts +50 -0
- package/projects/onemrva/design-system/mat-task-list/src/onemrva-mat-task-list.module.ts +31 -0
- package/projects/onemrva/design-system/mat-task-list/src/onemrva-mat-task-title.component.ts +18 -0
- package/projects/onemrva/design-system/mat-task-list/src/onemrva-mat-task-title.html +5 -0
- package/projects/onemrva/design-system/mat-task-list/src/onemrva-mat-task.component.html +17 -0
- package/projects/onemrva/design-system/mat-task-list/src/onemrva-mat-task.component.scss +0 -0
- package/projects/onemrva/design-system/mat-task-list/src/onemrva-mat-task.component.ts +117 -0
- package/projects/onemrva/design-system/mat-timepicker/index.ts +6 -0
- package/projects/onemrva/design-system/mat-timepicker/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-timepicker/src/clock/clock.component.html +42 -0
- package/projects/onemrva/design-system/mat-timepicker/src/clock/clock.component.scss +129 -0
- package/projects/onemrva/design-system/mat-timepicker/src/clock/clock.component.spec.ts +25 -0
- package/projects/onemrva/design-system/mat-timepicker/src/clock/clock.component.ts +273 -0
- package/projects/onemrva/design-system/mat-timepicker/src/interfaces-and-types.ts +16 -0
- package/projects/onemrva/design-system/mat-timepicker/src/onemrva-mat-timepicker.component.html +0 -0
- package/projects/onemrva/design-system/mat-timepicker/src/onemrva-mat-timepicker.component.ts +289 -0
- package/projects/onemrva/design-system/mat-timepicker/src/onemrva-mat-timepicker.module.ts +40 -0
- package/projects/onemrva/design-system/mat-timepicker/src/timepicker-dialog/timepicker-dialog.component.html +53 -0
- package/projects/onemrva/design-system/mat-timepicker/src/timepicker-dialog/timepicker-dialog.component.scss +69 -0
- package/projects/onemrva/design-system/mat-timepicker/src/timepicker-dialog/timepicker-dialog.component.spec.ts +25 -0
- package/projects/onemrva/design-system/mat-timepicker/src/timepicker-dialog/timepicker-dialog.component.ts +169 -0
- package/projects/onemrva/design-system/mat-timepicker/src/timepicker-toggle/timepicker-toggle.component.html +15 -0
- package/projects/onemrva/design-system/mat-timepicker/src/timepicker-toggle/timepicker-toggle.component.scss +32 -0
- package/projects/onemrva/design-system/mat-timepicker/src/timepicker-toggle/timepicker-toggle.component.ts +135 -0
- package/projects/onemrva/design-system/mat-timepicker/src/timepicker.directive.ts +594 -0
- package/projects/onemrva/design-system/mat-timepicker/src/util.ts +97 -0
- package/projects/onemrva/design-system/mat-toast/index.ts +6 -0
- package/projects/onemrva/design-system/mat-toast/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-toast/src/onemrva-mat-toast.component.scss +54 -0
- package/projects/onemrva/design-system/mat-toast/src/onemrva-mat-toast.component.ts +36 -0
- package/projects/onemrva/design-system/mat-toast/src/onemrva-mat-toast.module.ts +11 -0
- package/projects/onemrva/design-system/mat-tooltip/index.ts +4 -0
- package/projects/onemrva/design-system/mat-tooltip/ng-package.json +6 -0
- package/projects/onemrva/design-system/mat-tooltip/src/onemrva-mat-tooltip.component.scss +9 -0
- package/projects/onemrva/design-system/mat-tooltip/src/onemrva-mat-tooltip.component.ts +21 -0
- package/projects/onemrva/design-system/mat-tooltip/src/onemrva-mat-tooltip.directive.ts +119 -0
- package/projects/onemrva/design-system/mat-tooltip/src/onemrva-mat-tooltip.module.ts +11 -0
- package/projects/onemrva/design-system/ng-package.json +20 -0
- package/projects/onemrva/design-system/package.json +27 -0
- package/projects/onemrva/design-system/page-not-found/assets/404/Arri/303/250re-plan.svg +22 -0
- package/projects/onemrva/design-system/page-not-found/assets/404/Halo.svg +10 -0
- package/projects/onemrva/design-system/page-not-found/assets/404/Ombre.svg +3 -0
- package/projects/onemrva/design-system/page-not-found/assets/404/Page.svg +21 -0
- package/projects/onemrva/design-system/page-not-found/assets/404/Page2.svg +19 -0
- package/projects/onemrva/design-system/page-not-found/assets/404/Soucoupe.svg +70 -0
- package/projects/onemrva/design-system/page-not-found/assets/404/Yeux.svg +6 -0
- package/projects/onemrva/design-system/page-not-found/assets/404/shape.svg +3 -0
- package/projects/onemrva/design-system/page-not-found/index.ts +5 -0
- package/projects/onemrva/design-system/page-not-found/ng-package.json +9 -0
- package/projects/onemrva/design-system/page-not-found/src/page-not-found-action.component.ts +9 -0
- package/projects/onemrva/design-system/page-not-found/src/page-not-found-extra.component.ts +9 -0
- package/projects/onemrva/design-system/page-not-found/src/page-not-found-invader.component.scss +16 -0
- package/projects/onemrva/design-system/page-not-found/src/page-not-found-invader.component.ts +84 -0
- package/projects/onemrva/design-system/page-not-found/src/page-not-found-mixin.component.scss +12 -0
- package/projects/onemrva/design-system/page-not-found/src/page-not-found.component.html +31 -0
- package/projects/onemrva/design-system/page-not-found/src/page-not-found.component.scss +206 -0
- package/projects/onemrva/design-system/page-not-found/src/page-not-found.component.ts +59 -0
- package/projects/onemrva/design-system/page-not-found/src/page-not-found.module.ts +24 -0
- package/projects/onemrva/design-system/src/public-api.ts +5 -0
- package/projects/onemrva/design-system/tsconfig.lib.json +12 -0
- package/projects/onemrva/design-system/tsconfig.lib.prod.json +10 -0
- package/projects/onemrva/design-system/utils/index.ts +2 -0
- package/projects/onemrva/design-system/utils/ng-package.json +6 -0
- package/projects/onemrva/design-system/utils/src/enum.utils.ts +6 -0
- package/projects/onemrva/design-system/utils/src/enums/color.enum.ts +14 -0
- package/projects/onemrva/design-system/utils/src/enums/index.ts +2 -0
- package/projects/onemrva/design-system/utils/src/enums/size.enum.ts +11 -0
- package/projects/schematics/README.md +40 -0
- package/projects/schematics/package.json +25 -0
- package/projects/schematics/src/cmp-demo/schema.json +15 -0
- package/projects/schematics/src/collection.json +17 -0
- package/projects/schematics/src/component/files/root/ng-package.json +6 -0
- package/projects/schematics/src/component/files/src/onemrva-mat-__name__.component.html +4 -0
- package/projects/schematics/src/component/schema.json +11 -0
- package/projects/schematics/src/demo/files/demo/demo-__name__.component.html +2 -0
- package/projects/schematics/src/demo/files/demo/readme.md +26 -0
- package/projects/schematics/src/demo/schema.json +15 -0
- package/projects/schematics/tsconfig.json +24 -0
- package/projects/test/.nycrc +5 -0
- package/projects/test/cypress/coverage.webpack.ts +20 -0
- package/projects/test/cypress/cucumber-json/basictest.cucumber.json +402 -0
- package/projects/test/cypress/fixtures/example.json +5 -0
- package/projects/test/cypress/integration/basictest.feature +53 -0
- package/projects/test/cypress/integration/common/basicTestSteps.ts +54 -0
- package/projects/test/cypress/plugins/index.ts +13 -0
- package/projects/test/cypress/support/commands.ts +44 -0
- package/projects/test/cypress/support/e2e.ts +20 -0
- package/projects/test/cypress/tsconfig.json +10 -0
- package/projects/test/cypress/videos/basictest.feature.mp4 +0 -0
- package/projects/test/karma.conf.js +44 -0
- package/projects/test/src/app/app-routing.module.ts +14 -0
- package/projects/test/src/app/app.component.html +14 -0
- package/projects/test/src/app/app.component.scss +0 -0
- package/projects/test/src/app/app.component.spec.ts +35 -0
- package/projects/test/src/app/app.component.ts +51 -0
- package/projects/test/src/app/app.module.ts +103 -0
- package/projects/test/src/app/demos/avatar/demo-avatar.component.html +77 -0
- package/projects/test/src/app/demos/avatar/demo-avatar.component.scss +4 -0
- package/projects/test/src/app/demos/avatar/demo-avatar.component.ts +13 -0
- package/projects/test/src/app/demos/badge/demo-badge.component.html +389 -0
- package/projects/test/src/app/demos/badge/demo-badge.component.scss +4 -0
- package/projects/test/src/app/demos/badge/demo-badge.component.ts +22 -0
- package/projects/test/src/app/demos/badge/readme.md +30 -0
- package/projects/test/src/app/demos/breadcrumb/demo-breadcrumb.component.html +20 -0
- package/projects/test/src/app/demos/breadcrumb/demo-breadcrumb.component.ts +7 -0
- package/projects/test/src/app/demos/breadcrumb/demo-breadcrumb.module.ts +89 -0
- package/projects/test/src/app/demos/breadcrumb/readme.md +29 -0
- package/projects/test/src/app/demos/datepicker/demo-datepicker.component.html +10 -0
- package/projects/test/src/app/demos/datepicker/demo-datepicker.component.scss +5 -0
- package/projects/test/src/app/demos/datepicker/demo-datepicker.component.ts +12 -0
- package/projects/test/src/app/demos/datepicker/demo-datepicker.module.ts +43 -0
- package/projects/test/src/app/demos/datepicker/readme.md +36 -0
- package/projects/test/src/app/demos/file-upload/demo-file-upload.component.html +30 -0
- package/projects/test/src/app/demos/file-upload/demo-file-upload.component.ts +132 -0
- package/projects/test/src/app/demos/file-upload/demo-file-upload.service.ts +60 -0
- package/projects/test/src/app/demos/file-upload/readme.md +26 -0
- package/projects/test/src/app/demos/input-bank-account/demo-input-bank-account.component.ts +19 -0
- package/projects/test/src/app/demos/input-bank-account/demo-input-bank-account.module.ts +20 -0
- package/projects/test/src/app/demos/input-country/demo-input-country.component.html +9 -0
- package/projects/test/src/app/demos/input-country/demo-input-country.component.ts +14 -0
- package/projects/test/src/app/demos/input-country/demo-input-country.module.ts +26 -0
- package/projects/test/src/app/demos/input-enterprise-number/demo-input-enterprise-number.component.ts +13 -0
- package/projects/test/src/app/demos/input-enterprise-number/demo-input-enterprise-number.module.ts +20 -0
- package/projects/test/src/app/demos/input-phone/demo-input-phone.component.html +16 -0
- package/projects/test/src/app/demos/input-phone/demo-input-phone.component.ts +16 -0
- package/projects/test/src/app/demos/input-phone/demo-input-phone.module.ts +21 -0
- package/projects/test/src/app/demos/message-box/demo-message-box.component.html +32 -0
- package/projects/test/src/app/demos/message-box/demo-message-box.component.ts +12 -0
- package/projects/test/src/app/demos/message-box/readme.md +26 -0
- package/projects/test/src/app/demos/multiselect/demo-multiselect.component.html +53 -0
- package/projects/test/src/app/demos/multiselect/demo-multiselect.component.scss +23 -0
- package/projects/test/src/app/demos/multiselect/demo-multiselect.component.ts +53 -0
- package/projects/test/src/app/demos/multiselect/demo-multiselect.module.ts +38 -0
- package/projects/test/src/app/demos/multiselect/readme.md +34 -0
- package/projects/test/src/app/demos/not-found/demo-not-found.component.html +21 -0
- package/projects/test/src/app/demos/not-found/demo-not-found.component.scss +6 -0
- package/projects/test/src/app/demos/not-found/demo-not-found.component.ts +50 -0
- package/projects/test/src/app/demos/not-found/readme.md +44 -0
- package/projects/test/src/app/demos/notification/demo-notification.component.html +5 -0
- package/projects/test/src/app/demos/notification/demo-notification.component.ts +10 -0
- package/projects/test/src/app/demos/paginator/demo-paginator.component.html +35 -0
- package/projects/test/src/app/demos/paginator/demo-paginator.component.ts +25 -0
- package/projects/test/src/app/demos/paginator/readme.md +89 -0
- package/projects/test/src/app/demos/panel/demo-panel.component.html +53 -0
- package/projects/test/src/app/demos/panel/demo-panel.component.scss +3 -0
- package/projects/test/src/app/demos/panel/demo-panel.component.ts +20 -0
- package/projects/test/src/app/demos/panel/readme.md +26 -0
- package/projects/test/src/app/demos/pop-over/demo-pop-over.component.html +130 -0
- package/projects/test/src/app/demos/pop-over/demo-pop-over.component.scss +9 -0
- package/projects/test/src/app/demos/pop-over/demo-pop-over.component.ts +13 -0
- package/projects/test/src/app/demos/pop-over/readme.md +26 -0
- package/projects/test/src/app/demos/progress-bar/demo-progress-bar.component.html +19 -0
- package/projects/test/src/app/demos/progress-bar/demo-progress-bar.component.ts +35 -0
- package/projects/test/src/app/demos/side-menu/demo-side-menu.component.html +5 -0
- package/projects/test/src/app/demos/side-menu/demo-side-menu.component.ts +34 -0
- package/projects/test/src/app/demos/side-menu/readme.md +30 -0
- package/projects/test/src/app/demos/skeleton/demo-skeleton.component.html +119 -0
- package/projects/test/src/app/demos/skeleton/demo-skeleton.component.scss +0 -0
- package/projects/test/src/app/demos/skeleton/demo-skeleton.component.ts +35 -0
- package/projects/test/src/app/demos/spinner/demo-spinner.component.html +1 -0
- package/projects/test/src/app/demos/spinner/demo-spinner.component.ts +10 -0
- package/projects/test/src/app/demos/spinner/readme.md +24 -0
- package/projects/test/src/app/demos/summary-stepper/demo-summary-stepper.component.html +108 -0
- package/projects/test/src/app/demos/summary-stepper/demo-summary-stepper.component.scss +3 -0
- package/projects/test/src/app/demos/summary-stepper/demo-summary-stepper.component.ts +55 -0
- package/projects/test/src/app/demos/summary-stepper/readme.md +26 -0
- package/projects/test/src/app/demos/table/demo-table-datasource.ts +140 -0
- package/projects/test/src/app/demos/table/demo-table.component.html +41 -0
- package/projects/test/src/app/demos/table/demo-table.component.scss +17 -0
- package/projects/test/src/app/demos/table/demo-table.component.ts +51 -0
- package/projects/test/src/app/demos/table/demo-table.module.ts +45 -0
- package/projects/test/src/app/demos/table/readme.md +27 -0
- package/projects/test/src/app/demos/task-list/demo-task-list.component.html +37 -0
- package/projects/test/src/app/demos/task-list/demo-task-list.component.scss +3 -0
- package/projects/test/src/app/demos/task-list/demo-task-list.component.ts +14 -0
- package/projects/test/src/app/demos/task-list/demo-task-list.module.ts +29 -0
- package/projects/test/src/app/demos/task-list/readme.md +26 -0
- package/projects/test/src/app/demos/timepicker/demo-timepicker.component.html +9 -0
- package/projects/test/src/app/demos/timepicker/demo-timepicker.component.ts +31 -0
- package/projects/test/src/app/demos/timepicker/readme.md +26 -0
- package/projects/test/src/app/demos/toast/demo-toast.component.html +8 -0
- package/projects/test/src/app/demos/toast/demo-toast.component.scss +3 -0
- package/projects/test/src/app/demos/toast/demo-toast.component.ts +61 -0
- package/projects/test/src/app/demos/toast/readme.md +30 -0
- package/projects/test/src/app/demos/toc/demo-toc.component.html +288 -0
- package/projects/test/src/app/demos/toc/demo-toc.component.ts +26 -0
- package/projects/test/src/app/demos/tooltip/demo-tooltip.component.html +73 -0
- package/projects/test/src/app/demos/tooltip/demo-tooltip.component.scss +11 -0
- package/projects/test/src/app/demos/tooltip/demo-tooltip.component.ts +14 -0
- package/projects/test/src/app/home.component.ts +54 -0
- package/projects/test/src/app/material.module.ts +39 -0
- package/projects/test/src/app/onemrva-translate-http-loader.ts +35 -0
- package/projects/test/src/app/routes.ts +198 -0
- package/projects/test/src/assets/.gitkeep +0 -0
- package/projects/test/src/assets/i18n/de.json +80 -0
- package/projects/test/src/assets/i18n/en.json +80 -0
- package/projects/test/src/assets/i18n/fr.json +80 -0
- package/projects/test/src/assets/i18n/nl.json +79 -0
- package/projects/test/src/environments/environment.e2e.ts +3 -0
- package/projects/test/src/environments/environment.prod.ts +3 -0
- package/projects/test/src/environments/environment.ts +16 -0
- package/projects/test/src/favicon.ico +0 -0
- package/projects/test/src/index.html +15 -0
- package/projects/test/src/main.ts +12 -0
- package/projects/test/src/polyfills.ts +53 -0
- package/projects/test/src/styles.scss +22 -0
- package/projects/test/src/test.ts +26 -0
- package/projects/test/tsconfig.app.json +15 -0
- package/projects/test/tsconfig.spec.json +18 -0
- package/rva.crt +36 -0
- package/tsconfig.json +44 -0
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ControlValueAccessor,
|
|
3
|
+
NgForm,
|
|
4
|
+
NgControl,
|
|
5
|
+
FormGroupDirective,
|
|
6
|
+
FormControl,
|
|
7
|
+
} from '@angular/forms';
|
|
8
|
+
import {
|
|
9
|
+
Directive,
|
|
10
|
+
OnInit,
|
|
11
|
+
EventEmitter,
|
|
12
|
+
Input,
|
|
13
|
+
ElementRef,
|
|
14
|
+
OnChanges,
|
|
15
|
+
Renderer2,
|
|
16
|
+
AfterViewInit,
|
|
17
|
+
Optional,
|
|
18
|
+
SimpleChanges,
|
|
19
|
+
NgZone,
|
|
20
|
+
HostBinding,
|
|
21
|
+
Self,
|
|
22
|
+
Output,
|
|
23
|
+
HostListener,
|
|
24
|
+
} from '@angular/core';
|
|
25
|
+
import {
|
|
26
|
+
MatFormFieldControl,
|
|
27
|
+
MatFormField,
|
|
28
|
+
} from '@angular/material/form-field';
|
|
29
|
+
import { IAllowed24HourMap } from './interfaces-and-types';
|
|
30
|
+
import {
|
|
31
|
+
twoDigits,
|
|
32
|
+
convertHoursForMode,
|
|
33
|
+
isAllowed,
|
|
34
|
+
isDateInRange,
|
|
35
|
+
isTimeInRange,
|
|
36
|
+
} from './util';
|
|
37
|
+
import { Subject, Subscription } from 'rxjs';
|
|
38
|
+
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
39
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
40
|
+
import { ErrorStateMatcher } from '@angular/material/core';
|
|
41
|
+
import { Platform } from '@angular/cdk/platform';
|
|
42
|
+
import { OnemrvaMatTimepickerComponent } from './onemrva-mat-timepicker.component';
|
|
43
|
+
|
|
44
|
+
@Directive({
|
|
45
|
+
selector: 'input[matTimepicker]',
|
|
46
|
+
providers: [
|
|
47
|
+
{ provide: MatFormFieldControl, useExisting: MatTimepickerDirective },
|
|
48
|
+
],
|
|
49
|
+
// tslint:disable-next-line:no-host-metadata-property
|
|
50
|
+
host: {
|
|
51
|
+
// tslint:disable-next-line:object-literal-key-quotes
|
|
52
|
+
class: 'mat-input-element mat-form-field-autofill-control',
|
|
53
|
+
'[class.mat-input-server]': '_isServer',
|
|
54
|
+
// Native input properties that are overwritten by Angular inputs need to be synced with
|
|
55
|
+
// the native input element. Otherwise property bindings for those don't work.
|
|
56
|
+
'[attr.id]': 'id',
|
|
57
|
+
'[attr.placeholder]': 'placeholder',
|
|
58
|
+
'[disabled]': 'disabled',
|
|
59
|
+
'[required]': 'required',
|
|
60
|
+
'[attr.readonly]': 'readonly || null',
|
|
61
|
+
'[attr.aria-invalid]': 'errorState',
|
|
62
|
+
'[attr.aria-required]': 'required.toString()',
|
|
63
|
+
},
|
|
64
|
+
exportAs: 'matTimepicker',
|
|
65
|
+
})
|
|
66
|
+
export class MatTimepickerDirective
|
|
67
|
+
implements
|
|
68
|
+
OnInit,
|
|
69
|
+
OnChanges,
|
|
70
|
+
AfterViewInit,
|
|
71
|
+
ControlValueAccessor,
|
|
72
|
+
MatFormFieldControl<any>
|
|
73
|
+
{
|
|
74
|
+
static nextId = 0;
|
|
75
|
+
|
|
76
|
+
/** Whether the component is being rendered on the server. */
|
|
77
|
+
// tslint:disable-next-line:variable-name
|
|
78
|
+
readonly _isServer: boolean;
|
|
79
|
+
private _closedSubscription = Subscription.EMPTY;
|
|
80
|
+
|
|
81
|
+
/** The datepicker that this input is associated with. */
|
|
82
|
+
@Input()
|
|
83
|
+
set matTimepicker(timepicker: OnemrvaMatTimepickerComponent) {
|
|
84
|
+
if (timepicker) {
|
|
85
|
+
this._timepicker = timepicker;
|
|
86
|
+
this._timepicker.setTimepickerInput(this);
|
|
87
|
+
this._closedSubscription = timepicker.closedStream.subscribe(() =>
|
|
88
|
+
this._onTouched()
|
|
89
|
+
);
|
|
90
|
+
//this._registerModel(datepicker.registerInput(this));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
_timepicker!: OnemrvaMatTimepickerComponent;
|
|
94
|
+
|
|
95
|
+
// tslint:disable-next-line:variable-name
|
|
96
|
+
_errorState = false;
|
|
97
|
+
get errorState() {
|
|
98
|
+
const oldState = this._errorState;
|
|
99
|
+
const parent = this._parentFormGroup || this._parentForm;
|
|
100
|
+
const control = this.ngControl
|
|
101
|
+
? (this.ngControl.control as FormControl)
|
|
102
|
+
: null;
|
|
103
|
+
const newState = this.errorStateMatcher
|
|
104
|
+
? this.errorStateMatcher.isErrorState(control, parent)
|
|
105
|
+
: oldState;
|
|
106
|
+
|
|
107
|
+
if (newState !== oldState) {
|
|
108
|
+
this._errorState = newState;
|
|
109
|
+
this.stateChanges.next();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return newState;
|
|
113
|
+
}
|
|
114
|
+
_onTouched = () => {};
|
|
115
|
+
|
|
116
|
+
@Input()
|
|
117
|
+
get disabled(): boolean {
|
|
118
|
+
if (this.ngControl && this.ngControl.disabled !== null) {
|
|
119
|
+
return this.ngControl.disabled;
|
|
120
|
+
}
|
|
121
|
+
return this._disabled;
|
|
122
|
+
}
|
|
123
|
+
set disabled(value: boolean) {
|
|
124
|
+
this._disabled = coerceBooleanProperty(value);
|
|
125
|
+
|
|
126
|
+
// Browsers may not fire the blur event if the input is disabled too quickly.
|
|
127
|
+
// Reset from here to ensure that the element doesn't become stuck.
|
|
128
|
+
if (this.focused) {
|
|
129
|
+
this.focused = false;
|
|
130
|
+
this.stateChanges.next();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// tslint:disable-next-line:variable-name
|
|
134
|
+
protected _disabled = false;
|
|
135
|
+
|
|
136
|
+
@Input() get id(): string {
|
|
137
|
+
return this._id;
|
|
138
|
+
}
|
|
139
|
+
set id(value: string) {
|
|
140
|
+
this._id = value || this._uid;
|
|
141
|
+
}
|
|
142
|
+
// tslint:disable-next-line:variable-name
|
|
143
|
+
protected _id: string = '0';
|
|
144
|
+
|
|
145
|
+
@Input() get readonly(): boolean {
|
|
146
|
+
return this._readonly;
|
|
147
|
+
}
|
|
148
|
+
set readonly(value: boolean) {
|
|
149
|
+
this._readonly = coerceBooleanProperty(value);
|
|
150
|
+
}
|
|
151
|
+
// tslint:disable-next-line:variable-name
|
|
152
|
+
private _readonly = false;
|
|
153
|
+
|
|
154
|
+
private isAlive: Subject<any> = new Subject<any>();
|
|
155
|
+
stateChanges = new Subject<void>();
|
|
156
|
+
|
|
157
|
+
// tslint:disable-next-line:variable-name
|
|
158
|
+
protected _uid = `mat-input-${MatTimepickerDirective.nextId++}`;
|
|
159
|
+
@HostBinding('class.floating') get shouldLabelFloat() {
|
|
160
|
+
return this.focused || !this.empty;
|
|
161
|
+
}
|
|
162
|
+
@HostBinding('attr.aria-describedby') describedBy = '';
|
|
163
|
+
|
|
164
|
+
@Input() errorStateMatcher: ErrorStateMatcher;
|
|
165
|
+
|
|
166
|
+
@Input() get required() {
|
|
167
|
+
return this._required;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
set required(req) {
|
|
171
|
+
this._required = coerceBooleanProperty(req);
|
|
172
|
+
this.stateChanges.next();
|
|
173
|
+
}
|
|
174
|
+
// tslint:disable-next-line:variable-name
|
|
175
|
+
private _required = false;
|
|
176
|
+
|
|
177
|
+
@Input() get placeholder() {
|
|
178
|
+
return this._placeholder;
|
|
179
|
+
}
|
|
180
|
+
set placeholder(plh) {
|
|
181
|
+
this._placeholder = plh;
|
|
182
|
+
this.stateChanges.next();
|
|
183
|
+
}
|
|
184
|
+
// tslint:disable-next-line:variable-name
|
|
185
|
+
private _placeholder: string = '';
|
|
186
|
+
|
|
187
|
+
focused = false;
|
|
188
|
+
private pattern: RegExp = new RegExp('[0-2]?[0-9]:[0-6]?[0-9]');
|
|
189
|
+
|
|
190
|
+
private allowed24HourMap: IAllowed24HourMap = this.generateAllowedMap();
|
|
191
|
+
|
|
192
|
+
private isInputFocused = false;
|
|
193
|
+
|
|
194
|
+
/** Override the label of the ok button. */
|
|
195
|
+
@Input() okLabel = 'Ok';
|
|
196
|
+
/** Override the label of the cancel button. */
|
|
197
|
+
@Input() cancelLabel = 'Cancel';
|
|
198
|
+
|
|
199
|
+
/** Sets the clock mode, 12-hour or 24-hour clocks are supported. */
|
|
200
|
+
@Input() color = 'primary';
|
|
201
|
+
@Input() disableDialogOpenOnClick = false;
|
|
202
|
+
@Input() strict = true;
|
|
203
|
+
|
|
204
|
+
controlType = 'angular-material-timepicker';
|
|
205
|
+
|
|
206
|
+
private listeners: (() => void)[] = [];
|
|
207
|
+
|
|
208
|
+
@Input() minDate!: Date;
|
|
209
|
+
@Input() maxDate!: Date;
|
|
210
|
+
|
|
211
|
+
// tslint:disable-next-line:variable-name
|
|
212
|
+
private _isPm: boolean = false;
|
|
213
|
+
// tslint:disable-next-line:variable-name
|
|
214
|
+
private _value!: Date;
|
|
215
|
+
// tslint:disable-next-line:variable-name
|
|
216
|
+
private _formattedValueString: string = '';
|
|
217
|
+
|
|
218
|
+
// tslint:disable-next-line:variable-name
|
|
219
|
+
private _skipValueChangeEmission = true;
|
|
220
|
+
|
|
221
|
+
@Input() set value(value: Date) {
|
|
222
|
+
if (value === this._value) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
this._value = value;
|
|
226
|
+
if (!value) {
|
|
227
|
+
this._formattedValueString = '';
|
|
228
|
+
this.setInputElementValue(value);
|
|
229
|
+
this.currentValue = value;
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const { hour, isPm } = convertHoursForMode(value.getHours());
|
|
234
|
+
this._formattedValueString = `${twoDigits(value.getHours())}:${twoDigits(
|
|
235
|
+
value.getMinutes()
|
|
236
|
+
)}`;
|
|
237
|
+
|
|
238
|
+
if (!this.isInputFocused) {
|
|
239
|
+
this.setInputElementValue(this.formattedValueString);
|
|
240
|
+
}
|
|
241
|
+
this.currentValue = value;
|
|
242
|
+
this.stateChanges.next();
|
|
243
|
+
|
|
244
|
+
if (this._skipValueChangeEmission) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
this.timeChange.emit(this.currentValue);
|
|
248
|
+
|
|
249
|
+
if (this.onChangeFn) this.onChangeFn(this.value);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
get value() {
|
|
253
|
+
return this._value;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
get empty() {
|
|
257
|
+
return !(this.currentValue instanceof Date);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
private get formattedValueString() {
|
|
261
|
+
return this._formattedValueString;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
private currentValue!: Date;
|
|
265
|
+
|
|
266
|
+
private onChangeFn: any;
|
|
267
|
+
private onTouchedFn: any;
|
|
268
|
+
private combination: string[] = [];
|
|
269
|
+
|
|
270
|
+
@Output() timeChange: EventEmitter<any> = new EventEmitter<any>();
|
|
271
|
+
@Output() invalidInput: EventEmitter<any> = new EventEmitter<any>();
|
|
272
|
+
|
|
273
|
+
@HostListener('input') inputHandler() {
|
|
274
|
+
let value = (this.elRef.nativeElement as any).value as string;
|
|
275
|
+
const length = value.length;
|
|
276
|
+
|
|
277
|
+
if (length === 0) {
|
|
278
|
+
//this.writeValue(null, true);
|
|
279
|
+
this._skipValueChangeEmission = true;
|
|
280
|
+
Promise.resolve().then(() => (this._skipValueChangeEmission = false));
|
|
281
|
+
|
|
282
|
+
if (this.onChangeFn) {
|
|
283
|
+
this.onChangeFn(null);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const valueHasColumn = value.includes(':');
|
|
290
|
+
let [hours, minutes]: any =
|
|
291
|
+
length === 1
|
|
292
|
+
? [value, 0]
|
|
293
|
+
: length === 2 && !valueHasColumn
|
|
294
|
+
? [value, 0]
|
|
295
|
+
: valueHasColumn
|
|
296
|
+
? value.split(':')
|
|
297
|
+
: value.split(/(\d\d)/).filter((v) => v);
|
|
298
|
+
|
|
299
|
+
hours = +hours;
|
|
300
|
+
|
|
301
|
+
if (/\s/.test(minutes)) {
|
|
302
|
+
let other;
|
|
303
|
+
[minutes, other] = minutes.split(/\s/);
|
|
304
|
+
if (other === 'pm' && !isNaN(hours) && hours < 12) {
|
|
305
|
+
hours += 12;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
minutes = +minutes;
|
|
310
|
+
|
|
311
|
+
if (isNaN(hours) || isNaN(minutes)) {
|
|
312
|
+
//this.writeValue(null, true);
|
|
313
|
+
this._skipValueChangeEmission = true;
|
|
314
|
+
Promise.resolve().then(() => (this._skipValueChangeEmission = false));
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
if (+hours > 24) {
|
|
319
|
+
hours = '24';
|
|
320
|
+
} else if (+hours < 0) {
|
|
321
|
+
hours = '0';
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
if (+minutes > 59) {
|
|
325
|
+
minutes = '59';
|
|
326
|
+
} else if (+minutes < 0) {
|
|
327
|
+
minutes = '0';
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
const d = this.value ? new Date(this.value.getTime()) : new Date();
|
|
331
|
+
d.setHours(+hours);
|
|
332
|
+
d.setMinutes(+minutes);
|
|
333
|
+
d.setSeconds(0);
|
|
334
|
+
d.setMilliseconds(0);
|
|
335
|
+
|
|
336
|
+
const isValueInRange = isDateInRange(this.minDate, this.maxDate, d);
|
|
337
|
+
if (!isValueInRange) {
|
|
338
|
+
this.invalidInput.emit();
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
this.writeValue(d, true);
|
|
342
|
+
if (this.onChangeFn) {
|
|
343
|
+
this.onChangeFn(d);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
@HostListener('keydown', ['$event']) keydownHandler(event: any) {
|
|
348
|
+
let e = <KeyboardEvent>event;
|
|
349
|
+
|
|
350
|
+
const allowedKey = [
|
|
351
|
+
'0',
|
|
352
|
+
'1',
|
|
353
|
+
'2',
|
|
354
|
+
'3',
|
|
355
|
+
'4',
|
|
356
|
+
'5',
|
|
357
|
+
'6',
|
|
358
|
+
'7',
|
|
359
|
+
'8',
|
|
360
|
+
'9',
|
|
361
|
+
':',
|
|
362
|
+
'Backspace',
|
|
363
|
+
'Delete',
|
|
364
|
+
'Tab',
|
|
365
|
+
'Enter',
|
|
366
|
+
'ArrowLeft',
|
|
367
|
+
'ArrowRight',
|
|
368
|
+
'ArrowUp',
|
|
369
|
+
'ArrowDown',
|
|
370
|
+
'Home',
|
|
371
|
+
'End',
|
|
372
|
+
];
|
|
373
|
+
if (allowedKey.indexOf(e.key) >= 0) return;
|
|
374
|
+
|
|
375
|
+
const allowedCtrlShortcuts = ['a', 'c', 'x', 'v'];
|
|
376
|
+
if (e.ctrlKey && allowedCtrlShortcuts.indexOf(e.key) >= 0) return;
|
|
377
|
+
|
|
378
|
+
if (event.metaKey || event.ctrlKey || event.altKey) {
|
|
379
|
+
this.combination = this.combination.concat(event.code);
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
const target = event.target;
|
|
383
|
+
const tValue = target.value;
|
|
384
|
+
const value = `${tValue.slice(0, target.selectionStart)}${
|
|
385
|
+
event.key
|
|
386
|
+
}${tValue.slice(target.selectionEnd)}`;
|
|
387
|
+
if (value.match(this.pattern) || this.combination.length > 0) {
|
|
388
|
+
return true;
|
|
389
|
+
}
|
|
390
|
+
event.preventDefault();
|
|
391
|
+
event.stopImmediatePropagation();
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
@HostListener('keyup', ['$event']) keyupHandler(event: any) {
|
|
396
|
+
this.combination = this.combination.filter((v) => v !== event.code);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
@HostListener('focus') focusHandler() {
|
|
400
|
+
this.isInputFocused = true;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
@HostListener('focusout') focusoutHandler() {
|
|
404
|
+
this.isInputFocused = false;
|
|
405
|
+
this.setInputElementValue(this.formattedValueString);
|
|
406
|
+
if (this.onTouchedFn && !this._timepicker.modalRef) {
|
|
407
|
+
this.onTouchedFn();
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
constructor(
|
|
412
|
+
@Optional() @Self() public ngControl: NgControl,
|
|
413
|
+
private renderer: Renderer2,
|
|
414
|
+
private zone: NgZone,
|
|
415
|
+
private fm: FocusMonitor,
|
|
416
|
+
private elRef: ElementRef<HTMLElement>,
|
|
417
|
+
private ngZone: NgZone,
|
|
418
|
+
// tslint:disable-next-line:variable-name
|
|
419
|
+
protected _platform: Platform,
|
|
420
|
+
// tslint:disable-next-line:variable-name
|
|
421
|
+
@Optional() private _parentForm: NgForm,
|
|
422
|
+
// tslint:disable-next-line:variable-name
|
|
423
|
+
@Optional() private _matFormFiled: MatFormField,
|
|
424
|
+
// tslint:disable-next-line:variable-name
|
|
425
|
+
@Optional() private _parentFormGroup: FormGroupDirective,
|
|
426
|
+
// tslint:disable-next-line:variable-name
|
|
427
|
+
_defaultErrorStateMatcher: ErrorStateMatcher
|
|
428
|
+
) {
|
|
429
|
+
this.id = this.id;
|
|
430
|
+
|
|
431
|
+
this.errorStateMatcher = _defaultErrorStateMatcher;
|
|
432
|
+
if (this.ngControl != null) {
|
|
433
|
+
this.ngControl.valueAccessor = this;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
if (_platform.IOS) {
|
|
437
|
+
ngZone.runOutsideAngular(() => {
|
|
438
|
+
elRef.nativeElement.addEventListener('keyup', (event: Event) => {
|
|
439
|
+
const el = event.target as HTMLInputElement;
|
|
440
|
+
if (!el.value && !el.selectionStart && !el.selectionEnd) {
|
|
441
|
+
// Note: Just setting `0, 0` doesn't fix the issue. Setting
|
|
442
|
+
// `1, 1` fixes it for the first time that you type text and
|
|
443
|
+
// then hold delete. Toggling to `1, 1` and then back to
|
|
444
|
+
// `0, 0` seems to completely fix it.
|
|
445
|
+
el.setSelectionRange(1, 1);
|
|
446
|
+
el.setSelectionRange(0, 0);
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
this._isServer = !this._platform.isBrowser;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
setDescribedByIds(ids: string[]) {
|
|
456
|
+
this.describedBy = ids.join(' ');
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
onContainerClick(event: MouseEvent) {
|
|
460
|
+
if ((event.target as Element).tagName.toLowerCase() !== 'input') {
|
|
461
|
+
this.elRef.nativeElement.focus();
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
setInputElementValue(value: any) {
|
|
466
|
+
Promise.resolve().then(() => {
|
|
467
|
+
this.zone.runOutsideAngular(() => {
|
|
468
|
+
this.renderer.setProperty(this.elRef.nativeElement, 'value', value);
|
|
469
|
+
});
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
validate() {
|
|
474
|
+
const isValueInRange = this.strict
|
|
475
|
+
? isDateInRange(this.minDate, this.maxDate, this.currentValue)
|
|
476
|
+
: isTimeInRange(this.minDate, this.maxDate, this.currentValue);
|
|
477
|
+
|
|
478
|
+
return isValueInRange ? null : { dateRange: true };
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
ngAfterViewInit() {}
|
|
482
|
+
|
|
483
|
+
ngOnInit() {
|
|
484
|
+
if (this._platform.isBrowser) {
|
|
485
|
+
this.fm.monitor(this.elRef.nativeElement, true).subscribe((origin) => {
|
|
486
|
+
this.focused = !!origin;
|
|
487
|
+
this.stateChanges.next();
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
if (!this.value) {
|
|
491
|
+
const hasMaxDate = !!this.maxDate;
|
|
492
|
+
const hasMinDate = !!this.minDate;
|
|
493
|
+
|
|
494
|
+
//if (hasMinDate || hasMaxDate) {
|
|
495
|
+
if (hasMinDate) {
|
|
496
|
+
this.minDate.setSeconds(0);
|
|
497
|
+
this.minDate.setMilliseconds(0);
|
|
498
|
+
}
|
|
499
|
+
if (hasMaxDate) {
|
|
500
|
+
this.maxDate.setSeconds(0);
|
|
501
|
+
this.maxDate.setMilliseconds(0);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
if (
|
|
505
|
+
!(this.ngControl as any)._rawValidators.find((v: any) => v === this)
|
|
506
|
+
) {
|
|
507
|
+
(this.ngControl as any)._rawValidators.push(this);
|
|
508
|
+
}
|
|
509
|
+
//}
|
|
510
|
+
}
|
|
511
|
+
this._skipValueChangeEmission = false;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
generateAllowedMap(): IAllowed24HourMap {
|
|
515
|
+
const isStrictMode = this.strict && this.value instanceof Date;
|
|
516
|
+
const a24hm: IAllowed24HourMap = {};
|
|
517
|
+
for (let h = 0; h < 24; h++) {
|
|
518
|
+
for (let m = 0; m < 60; m++) {
|
|
519
|
+
const hourMap = a24hm[h] || {};
|
|
520
|
+
if (isStrictMode) {
|
|
521
|
+
const currentDate = new Date(this.value.getTime());
|
|
522
|
+
currentDate.setHours(h);
|
|
523
|
+
currentDate.setMinutes(m);
|
|
524
|
+
currentDate.setSeconds(0);
|
|
525
|
+
currentDate.setMilliseconds(0);
|
|
526
|
+
hourMap[m] = isDateInRange(this.minDate, this.maxDate, currentDate);
|
|
527
|
+
} else {
|
|
528
|
+
hourMap[m] = isAllowed(h, m, this.minDate, this.maxDate);
|
|
529
|
+
}
|
|
530
|
+
a24hm[h] = hourMap;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
return a24hm;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
ngOnChanges(simpleChanges: SimpleChanges) {
|
|
538
|
+
this.pattern = /^[0-9]{1,2}:?([0-9]{1,2})?$/;
|
|
539
|
+
|
|
540
|
+
if (
|
|
541
|
+
!this._timepicker.modalRef ||
|
|
542
|
+
!this._timepicker.modalRef.componentInstance
|
|
543
|
+
) {
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
this._timepicker.modalRef.componentInstance.data = {
|
|
548
|
+
value: this.currentValue,
|
|
549
|
+
okLabel: this.okLabel,
|
|
550
|
+
cancelLabel: this.cancelLabel,
|
|
551
|
+
color: this.color,
|
|
552
|
+
minDate: this.minDate,
|
|
553
|
+
maxDate: this.maxDate,
|
|
554
|
+
allowed24HourMap: this.allowed24HourMap,
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
checkValidity(value: Date) {
|
|
559
|
+
if (!value) {
|
|
560
|
+
return false;
|
|
561
|
+
}
|
|
562
|
+
const hour = value.getHours();
|
|
563
|
+
const minutes = value.getMinutes();
|
|
564
|
+
return isAllowed(hour, minutes, this.minDate, this.maxDate);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
writeValue(value: Date, isInnerCall = false): void {
|
|
568
|
+
if (!isInnerCall) {
|
|
569
|
+
this._skipValueChangeEmission = true;
|
|
570
|
+
Promise.resolve().then(() => (this._skipValueChangeEmission = false));
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
if (value) {
|
|
574
|
+
value.setSeconds(0);
|
|
575
|
+
value.setMilliseconds(0);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
if (+this.value !== +value) {
|
|
579
|
+
this.value = value;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
registerOnChange(fn: any): void {
|
|
584
|
+
this.onChangeFn = fn;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
registerOnTouched(fn: any): void {
|
|
588
|
+
this.onTouchedFn = fn;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
setDisabledState?(isDisabled: boolean): void {
|
|
592
|
+
this.disabled = isDisabled;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { ITimeData, ClockViewType } from './interfaces-and-types';
|
|
2
|
+
|
|
3
|
+
export function twoDigits(n: number) {
|
|
4
|
+
return n < 10 ? `0${n}` : `${n}`;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function addDays(date: Date, days: number) {
|
|
8
|
+
const result = new Date(date);
|
|
9
|
+
result.setDate(result.getDate() + days);
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function convertHoursForMode(hour: number) {
|
|
14
|
+
const isPm = hour >= 12;
|
|
15
|
+
return { hour, isPm };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function mod(a: number, b: number) {
|
|
19
|
+
return a - Math.floor(a / b) * b;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function getShortestAngle(from: number, to: number) {
|
|
23
|
+
const difference = to - from;
|
|
24
|
+
return from + mod(difference + 180, 360) - 180;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function isDateInRange(minDate: Date, maxDate: Date, current: Date) {
|
|
28
|
+
const unixCurrentDate = +current;
|
|
29
|
+
return (!minDate || +minDate <= unixCurrentDate) && (!maxDate || unixCurrentDate <= +maxDate);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function isTimeInRange(minDate: Date, maxDate: Date, current: Date) {
|
|
33
|
+
if (minDate instanceof Date) {
|
|
34
|
+
const newMinDate = new Date();
|
|
35
|
+
newMinDate.setHours(minDate.getHours());
|
|
36
|
+
newMinDate.setMinutes(minDate.getMinutes());
|
|
37
|
+
newMinDate.setSeconds(0);
|
|
38
|
+
newMinDate.setMilliseconds(0);
|
|
39
|
+
minDate = newMinDate;
|
|
40
|
+
}
|
|
41
|
+
if (maxDate instanceof Date) {
|
|
42
|
+
const newMaxDate = new Date();
|
|
43
|
+
newMaxDate.setHours(maxDate.getHours());
|
|
44
|
+
newMaxDate.setMinutes(maxDate.getMinutes());
|
|
45
|
+
newMaxDate.setSeconds(0);
|
|
46
|
+
newMaxDate.setMilliseconds(0);
|
|
47
|
+
maxDate = newMaxDate;
|
|
48
|
+
}
|
|
49
|
+
if (current instanceof Date) {
|
|
50
|
+
const newCurrent = new Date();
|
|
51
|
+
newCurrent.setHours(current.getHours());
|
|
52
|
+
newCurrent.setMinutes(current.getMinutes());
|
|
53
|
+
newCurrent.setSeconds(0);
|
|
54
|
+
newCurrent.setMilliseconds(0);
|
|
55
|
+
current = newCurrent;
|
|
56
|
+
}
|
|
57
|
+
const unixCurrentDate = +current;
|
|
58
|
+
return (!minDate || +minDate <= unixCurrentDate) && (!maxDate || unixCurrentDate <= +maxDate);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// used when generating the allowed maps
|
|
62
|
+
|
|
63
|
+
export function isAllowed(
|
|
64
|
+
hour: number,
|
|
65
|
+
minutes: number,
|
|
66
|
+
minDate: Date,
|
|
67
|
+
maxDate: Date
|
|
68
|
+
) {
|
|
69
|
+
if (hour > 24 || hour < 0 || minutes > 60 || minutes < 0) { return false; }
|
|
70
|
+
|
|
71
|
+
if (!minDate && !maxDate) { return true; }
|
|
72
|
+
|
|
73
|
+
const checkDate = new Date();
|
|
74
|
+
|
|
75
|
+
checkDate.setHours(hour);
|
|
76
|
+
checkDate.setMinutes(minutes);
|
|
77
|
+
checkDate.setSeconds(0);
|
|
78
|
+
checkDate.setMilliseconds(0);
|
|
79
|
+
|
|
80
|
+
return isDateInRange(minDate, maxDate, checkDate);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// used by the clock component to visually disable the not allowed values
|
|
84
|
+
|
|
85
|
+
export function getIsAvailabeFn( allowed24HourMap : any) {
|
|
86
|
+
return (value: number, viewType: ClockViewType, h: number) => {
|
|
87
|
+
const isHourCheck = viewType === 'hours';
|
|
88
|
+
const [hour, minutes] = isHourCheck ? [value, 0] : [h, value];
|
|
89
|
+
|
|
90
|
+
if (!allowed24HourMap) { return true; }
|
|
91
|
+
|
|
92
|
+
if (isHourCheck) {
|
|
93
|
+
return !!Object.values(allowed24HourMap[hour]).find(v => v === true);
|
|
94
|
+
}
|
|
95
|
+
return allowed24HourMap[hour][minutes];
|
|
96
|
+
};
|
|
97
|
+
}
|