@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,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
HttpEvent,
|
|
3
|
+
HttpEventType,
|
|
4
|
+
HttpProgressEvent,
|
|
5
|
+
HttpResponse,
|
|
6
|
+
} from '@angular/common/http';
|
|
7
|
+
import { Injectable } from '@angular/core';
|
|
8
|
+
import { catchError, interval, map, Observable, of, take } from 'rxjs';
|
|
9
|
+
import { ProgressFile } from './models/progress-file.model';
|
|
10
|
+
|
|
11
|
+
export interface OnemrvaMatFileUploadInterface {
|
|
12
|
+
listUploadedFiles: (inputs: any) => Observable<ProgressFile[]>;
|
|
13
|
+
upload: (file: ProgressFile) => Observable<HttpEvent<any>>;
|
|
14
|
+
deleteFile: (id: any) => Observable<any>;
|
|
15
|
+
retry: (file: any) => Observable<any>;
|
|
16
|
+
downloadFile?: (id: any) => Observable<any>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@Injectable({
|
|
20
|
+
providedIn: 'root',
|
|
21
|
+
})
|
|
22
|
+
export class OnemrvaMatFileUploadService
|
|
23
|
+
implements OnemrvaMatFileUploadInterface
|
|
24
|
+
{
|
|
25
|
+
constructor() {
|
|
26
|
+
alert(
|
|
27
|
+
"Don't forget to add a provider in your component with your own implementation of OnemrvaMatFileUploadInterface. Check out the demo to have an example of how to do it"
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
listUploadedFiles(inputs: any): Observable<ProgressFile[]> {
|
|
32
|
+
return of([]);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
upload(file: ProgressFile): Observable<HttpEvent<any>> {
|
|
36
|
+
return interval(50).pipe(
|
|
37
|
+
take(101),
|
|
38
|
+
map((i) => {
|
|
39
|
+
if (i < 100) {
|
|
40
|
+
return {
|
|
41
|
+
type: HttpEventType.UploadProgress,
|
|
42
|
+
loaded: i,
|
|
43
|
+
total: 100,
|
|
44
|
+
} as HttpProgressEvent;
|
|
45
|
+
} else {
|
|
46
|
+
if (i >= 100 && Math.random() > 0.5) {
|
|
47
|
+
throw 'Fake error thrown';
|
|
48
|
+
}
|
|
49
|
+
return new HttpResponse<any>();
|
|
50
|
+
}
|
|
51
|
+
}),
|
|
52
|
+
catchError(() => of(new HttpResponse<any>({ body: {}, status: 500 })))
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
deleteFile(id: any): Observable<any> {
|
|
57
|
+
return of('F = m.a');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
retry(file: any): Observable<any> {
|
|
61
|
+
return of(file);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
downloadFile(id: any): Observable<any> {
|
|
65
|
+
alert(`Missing download implementation for file ID ${id}`);
|
|
66
|
+
return of(true);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';
|
|
2
|
+
import { ComponentStore } from '@ngrx/component-store';
|
|
3
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
4
|
+
import {
|
|
5
|
+
catchError,
|
|
6
|
+
filter,
|
|
7
|
+
forkJoin,
|
|
8
|
+
interval,
|
|
9
|
+
map,
|
|
10
|
+
merge,
|
|
11
|
+
mergeMap,
|
|
12
|
+
Observable,
|
|
13
|
+
of,
|
|
14
|
+
Subject,
|
|
15
|
+
switchMap,
|
|
16
|
+
take,
|
|
17
|
+
takeWhile,
|
|
18
|
+
tap,
|
|
19
|
+
throttle,
|
|
20
|
+
withLatestFrom,
|
|
21
|
+
} from 'rxjs';
|
|
22
|
+
import { OnemrvaMatFileUploadService } from './onemrva-mat-file-upload.service';
|
|
23
|
+
import {
|
|
24
|
+
formattedSize,
|
|
25
|
+
ProgressFile,
|
|
26
|
+
ReferencedProgressFile,
|
|
27
|
+
} from './models/progress-file.model';
|
|
28
|
+
import { HttpEvent, HttpEventType } from '@angular/common/http';
|
|
29
|
+
import { OnemrvaMatFileUploadStoreItf } from './onemrva-mat-file-upload-itf.store';
|
|
30
|
+
|
|
31
|
+
export interface FileUploadStoreEvent {
|
|
32
|
+
type: string;
|
|
33
|
+
payload?: any;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface UploadState {
|
|
37
|
+
upload: ReferencedProgressFile[];
|
|
38
|
+
accept: string[];
|
|
39
|
+
maxFileSize: number;
|
|
40
|
+
fileUploadError: string;
|
|
41
|
+
event: FileUploadStoreEvent;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const INIT_STATE: UploadState = {
|
|
45
|
+
upload: [],
|
|
46
|
+
accept: [],
|
|
47
|
+
maxFileSize: 0,
|
|
48
|
+
fileUploadError: '',
|
|
49
|
+
event: {
|
|
50
|
+
type: 'INIT',
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type CustomValidationFn = (
|
|
55
|
+
input: [ReferencedProgressFile, ReferencedProgressFile[]]
|
|
56
|
+
) => ReferencedProgressFile;
|
|
57
|
+
|
|
58
|
+
export const CUSTOM_VALIDATION_FN = new InjectionToken<CustomValidationFn>(
|
|
59
|
+
'x1, x2 = (-b -+ sqrt(rho))/2a'
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
@Injectable()
|
|
63
|
+
export class OnemrvaMatFileUploadStore
|
|
64
|
+
extends ComponentStore<UploadState>
|
|
65
|
+
implements OnemrvaMatFileUploadStoreItf
|
|
66
|
+
{
|
|
67
|
+
private fn: CustomValidationFn = (
|
|
68
|
+
x: [ReferencedProgressFile, ReferencedProgressFile[]]
|
|
69
|
+
) => {
|
|
70
|
+
return x[0];
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
constructor(
|
|
74
|
+
private fileUploadService: OnemrvaMatFileUploadService,
|
|
75
|
+
private translateService: TranslateService,
|
|
76
|
+
@Optional()
|
|
77
|
+
@Inject(CUSTOM_VALIDATION_FN)
|
|
78
|
+
public customValidationFn: CustomValidationFn
|
|
79
|
+
) {
|
|
80
|
+
super(INIT_STATE);
|
|
81
|
+
if (!!customValidationFn) this.fn = customValidationFn;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
* U P D A T E R S
|
|
86
|
+
*/
|
|
87
|
+
public readonly setAccept = this.updater((state, accept: string[]) => ({
|
|
88
|
+
...state,
|
|
89
|
+
accept,
|
|
90
|
+
event: {
|
|
91
|
+
type: 'setAccept',
|
|
92
|
+
payload: accept,
|
|
93
|
+
},
|
|
94
|
+
}));
|
|
95
|
+
|
|
96
|
+
public readonly setMaxFileSize = this.updater(
|
|
97
|
+
(state, maxFileSize: number) => ({
|
|
98
|
+
...state,
|
|
99
|
+
maxFileSize,
|
|
100
|
+
event: {
|
|
101
|
+
type: 'setMaxFileSize',
|
|
102
|
+
payload: maxFileSize,
|
|
103
|
+
},
|
|
104
|
+
})
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
private readonly emptyList = this.updater((state) => {
|
|
108
|
+
return {
|
|
109
|
+
...state,
|
|
110
|
+
upload: [],
|
|
111
|
+
event: {
|
|
112
|
+
type: 'emptyList',
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
private readonly pushFile = this.updater(
|
|
118
|
+
(state, payload: ReferencedProgressFile) => {
|
|
119
|
+
return {
|
|
120
|
+
...state,
|
|
121
|
+
upload: [...state.upload, { ...payload }],
|
|
122
|
+
event: {
|
|
123
|
+
type: 'pushFile',
|
|
124
|
+
payload,
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
public readonly setData = this.updater(
|
|
131
|
+
(state, payload: { ref: symbol; data: any }) => {
|
|
132
|
+
return {
|
|
133
|
+
...state,
|
|
134
|
+
upload: state.upload.map((file: ReferencedProgressFile) =>
|
|
135
|
+
file.ref === payload.ref ? { ...file, data: payload.data } : file
|
|
136
|
+
),
|
|
137
|
+
event: {
|
|
138
|
+
type: 'setData',
|
|
139
|
+
payload,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
private readonly setSuccess = this.updater(
|
|
146
|
+
(state, payload: { ref: symbol; body: any }) => {
|
|
147
|
+
const newFile = {
|
|
148
|
+
...state.upload.find((f) => f.ref === payload.ref),
|
|
149
|
+
...payload.body,
|
|
150
|
+
color: 'success',
|
|
151
|
+
progress: 100,
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
return {
|
|
155
|
+
...state,
|
|
156
|
+
upload: state.upload.map((file) =>
|
|
157
|
+
file.ref === payload.ref ? newFile : file
|
|
158
|
+
),
|
|
159
|
+
event: {
|
|
160
|
+
type: 'setData',
|
|
161
|
+
payload: newFile,
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
private readonly setFail = this.updater(
|
|
168
|
+
(state, payload: { ref: symbol; message: string }) => ({
|
|
169
|
+
...state,
|
|
170
|
+
upload: state.upload.map((file) =>
|
|
171
|
+
file.ref === payload.ref
|
|
172
|
+
? { ...file, color: 'warn', message: payload.message }
|
|
173
|
+
: file
|
|
174
|
+
),
|
|
175
|
+
event: {
|
|
176
|
+
type: 'setFail',
|
|
177
|
+
payload,
|
|
178
|
+
},
|
|
179
|
+
})
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
private readonly setProgress = this.updater(
|
|
183
|
+
(state, payload: { ref: symbol; progress: number }) => ({
|
|
184
|
+
...state,
|
|
185
|
+
upload: state.upload.map((file) =>
|
|
186
|
+
file.ref === payload.ref
|
|
187
|
+
? { ...file, progress: payload.progress }
|
|
188
|
+
: file
|
|
189
|
+
),
|
|
190
|
+
event: {
|
|
191
|
+
type: 'setProgress',
|
|
192
|
+
payload,
|
|
193
|
+
},
|
|
194
|
+
})
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
private readonly reset = this.updater((state, ref: symbol) => ({
|
|
198
|
+
...state,
|
|
199
|
+
upload: state.upload.map((file) =>
|
|
200
|
+
file.ref === ref ? { ...file, progress: 0, message: '', color: '' } : file
|
|
201
|
+
),
|
|
202
|
+
event: {
|
|
203
|
+
type: 'reset',
|
|
204
|
+
payload: ref,
|
|
205
|
+
},
|
|
206
|
+
}));
|
|
207
|
+
|
|
208
|
+
private readonly remove = this.updater(
|
|
209
|
+
(state, payload: ReferencedProgressFile) => ({
|
|
210
|
+
...state,
|
|
211
|
+
upload: state.upload.filter((f) => f.ref !== payload.ref),
|
|
212
|
+
event: {
|
|
213
|
+
type: 'remove',
|
|
214
|
+
payload,
|
|
215
|
+
},
|
|
216
|
+
})
|
|
217
|
+
);
|
|
218
|
+
|
|
219
|
+
private readonly enableProgressBar = this.updater((state) => ({
|
|
220
|
+
...state,
|
|
221
|
+
upload: state.upload.map((file) => ({ ...file, enableProgressBar: true })),
|
|
222
|
+
event: {
|
|
223
|
+
type: 'enableProgressBar',
|
|
224
|
+
},
|
|
225
|
+
}));
|
|
226
|
+
|
|
227
|
+
public readonly setFileUploadError = this.updater(
|
|
228
|
+
(state, fileUploadError: string) => ({
|
|
229
|
+
...state,
|
|
230
|
+
fileUploadError,
|
|
231
|
+
event: {
|
|
232
|
+
type: 'setFileUploadError',
|
|
233
|
+
payload: fileUploadError,
|
|
234
|
+
},
|
|
235
|
+
})
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
public readonly clearFileUploadError = this.updater((state) => ({
|
|
239
|
+
...state,
|
|
240
|
+
fileUploadError: '',
|
|
241
|
+
event: {
|
|
242
|
+
type: 'clearFileUploadError',
|
|
243
|
+
},
|
|
244
|
+
}));
|
|
245
|
+
|
|
246
|
+
/*
|
|
247
|
+
* S E L E C T O R S
|
|
248
|
+
*/
|
|
249
|
+
readonly files$ = this.select((state) => state.upload);
|
|
250
|
+
readonly accept$ = this.select((state) => state.accept);
|
|
251
|
+
readonly event$ = this.select((state) => state.event);
|
|
252
|
+
readonly maxFileSize$ = this.select((state) => state.maxFileSize);
|
|
253
|
+
readonly fileUploadError$ = this.select((state) => state.fileUploadError);
|
|
254
|
+
|
|
255
|
+
/*
|
|
256
|
+
* A C T I O N S / E F F E C T S
|
|
257
|
+
*/
|
|
258
|
+
readonly listUploadedFiles = this.effect((inputs$: Observable<any>) => {
|
|
259
|
+
return inputs$.pipe(
|
|
260
|
+
tap(() => {
|
|
261
|
+
this.emptyList();
|
|
262
|
+
}),
|
|
263
|
+
mergeMap((inputs: any) => {
|
|
264
|
+
return this.fileUploadService.listUploadedFiles(inputs).pipe(
|
|
265
|
+
take(1),
|
|
266
|
+
withLatestFrom(this.files$),
|
|
267
|
+
tap(([newfiles, registeredFiles]) => {
|
|
268
|
+
newfiles.forEach((file) => {
|
|
269
|
+
if (
|
|
270
|
+
registeredFiles.findIndex((rfile) => rfile.id === file.id) < 0
|
|
271
|
+
) {
|
|
272
|
+
this.pushFile({
|
|
273
|
+
...file,
|
|
274
|
+
color: 'success',
|
|
275
|
+
progress: 100,
|
|
276
|
+
ref: Symbol('H.psi = E.psi'),
|
|
277
|
+
name: file!.name,
|
|
278
|
+
lastModified: file!.lastModified,
|
|
279
|
+
size: file!.size,
|
|
280
|
+
type: file!.type,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}),
|
|
285
|
+
catchError(() => of([]))
|
|
286
|
+
);
|
|
287
|
+
})
|
|
288
|
+
);
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
readonly deleteFile = this.effect(
|
|
292
|
+
(file$: Observable<ReferencedProgressFile>) => {
|
|
293
|
+
return file$.pipe(
|
|
294
|
+
tap(() => {
|
|
295
|
+
this.clearFileUploadError();
|
|
296
|
+
}),
|
|
297
|
+
withLatestFrom(this.files$),
|
|
298
|
+
map(this.fn),
|
|
299
|
+
mergeMap((file: any) =>
|
|
300
|
+
this.fileUploadService.deleteFile(file.id).pipe(
|
|
301
|
+
take(1),
|
|
302
|
+
tap(() => {
|
|
303
|
+
this.remove(file);
|
|
304
|
+
}),
|
|
305
|
+
catchError(() => {
|
|
306
|
+
this.setFail({
|
|
307
|
+
ref: file.ref,
|
|
308
|
+
message: 'file.upload.delete.error',
|
|
309
|
+
});
|
|
310
|
+
return of(null);
|
|
311
|
+
})
|
|
312
|
+
)
|
|
313
|
+
)
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
);
|
|
317
|
+
|
|
318
|
+
readonly removeFile = this.effect(
|
|
319
|
+
(file$: Observable<ReferencedProgressFile>) => {
|
|
320
|
+
return file$.pipe(
|
|
321
|
+
tap(() => {
|
|
322
|
+
this.clearFileUploadError();
|
|
323
|
+
}),
|
|
324
|
+
withLatestFrom(this.files$),
|
|
325
|
+
map(this.fn),
|
|
326
|
+
tap((file) => {
|
|
327
|
+
this.remove(file);
|
|
328
|
+
})
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
);
|
|
332
|
+
|
|
333
|
+
private progressFileChecker = (file$: Observable<any>) => {
|
|
334
|
+
return file$.pipe(
|
|
335
|
+
withLatestFrom(this.accept$),
|
|
336
|
+
map(([file, accept]) => {
|
|
337
|
+
// Step 1 - Add a new file in the view
|
|
338
|
+
let f: ReferencedProgressFile = { ...file };
|
|
339
|
+
if (file.ref === undefined) {
|
|
340
|
+
f = {
|
|
341
|
+
...f,
|
|
342
|
+
ref: Symbol('v_sound = sqrt(gamma.P / rho)'),
|
|
343
|
+
name: file!.name,
|
|
344
|
+
lastModified: file!.lastModified,
|
|
345
|
+
size: file!.size,
|
|
346
|
+
type: file!.type,
|
|
347
|
+
};
|
|
348
|
+
this.pushFile(f);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// Step 2 - Check file extension
|
|
352
|
+
if (!accept.includes(file.file!.type)) {
|
|
353
|
+
this.setFail({
|
|
354
|
+
ref: f.ref,
|
|
355
|
+
message: this.translateService.instant(
|
|
356
|
+
'file.upload.type.not.supported'
|
|
357
|
+
),
|
|
358
|
+
});
|
|
359
|
+
// This trick coupled with the next filter is used to avoid catchError, which would break the effect
|
|
360
|
+
return { ...f, message: 'ERROR' };
|
|
361
|
+
}
|
|
362
|
+
return f;
|
|
363
|
+
}),
|
|
364
|
+
filter((x) => x.message !== 'ERROR'),
|
|
365
|
+
withLatestFrom(this.maxFileSize$),
|
|
366
|
+
map(([refFile, maxFileSize]) => {
|
|
367
|
+
// Step 3 - Check file size
|
|
368
|
+
if (maxFileSize !== 0 && refFile.size > maxFileSize) {
|
|
369
|
+
this.setFail({
|
|
370
|
+
ref: refFile.ref,
|
|
371
|
+
message:
|
|
372
|
+
this.translateService.instant('file.upload.too.big') +
|
|
373
|
+
' ' +
|
|
374
|
+
formattedSize(refFile.size),
|
|
375
|
+
});
|
|
376
|
+
// Same trick for error management
|
|
377
|
+
return { ...refFile, message: 'ERROR' };
|
|
378
|
+
}
|
|
379
|
+
return refFile;
|
|
380
|
+
}),
|
|
381
|
+
filter((x) => x.message !== 'ERROR'),
|
|
382
|
+
withLatestFrom(this.files$),
|
|
383
|
+
map(this.fn), // For custom validations
|
|
384
|
+
tap((x) => {
|
|
385
|
+
if (!!x.message && x.message.startsWith('ERROR:'))
|
|
386
|
+
this.setFileUploadError(x.message.replace('ERROR:', '').trim());
|
|
387
|
+
else this.clearFileUploadError();
|
|
388
|
+
}),
|
|
389
|
+
filter((x) => !x.message.startsWith('ERROR')),
|
|
390
|
+
take(1)
|
|
391
|
+
);
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
private loadStep = (file: any) => {
|
|
395
|
+
if (file.color === 'warn') this.reset(file.ref);
|
|
396
|
+
|
|
397
|
+
this.enableProgressBar();
|
|
398
|
+
|
|
399
|
+
return this.fileUploadService.upload(file).pipe(
|
|
400
|
+
throttle(() => interval(200), { leading: true, trailing: true }),
|
|
401
|
+
tap((event: HttpEvent<any>) => {
|
|
402
|
+
if (event.type === HttpEventType.UploadProgress) {
|
|
403
|
+
this.setProgress({
|
|
404
|
+
ref: file.ref,
|
|
405
|
+
progress: Math.round((100 * event.loaded) / event.total!),
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
if (event.type === HttpEventType.Response) {
|
|
410
|
+
this.setSuccess({ ref: file.ref, body: event.body });
|
|
411
|
+
}
|
|
412
|
+
}),
|
|
413
|
+
takeWhile(
|
|
414
|
+
(event: HttpEvent<any>) => event.type === HttpEventType.UploadProgress
|
|
415
|
+
),
|
|
416
|
+
catchError(() => {
|
|
417
|
+
this.setFail({
|
|
418
|
+
ref: file.ref,
|
|
419
|
+
message: 'file.upload.retry.error',
|
|
420
|
+
});
|
|
421
|
+
return of(null);
|
|
422
|
+
})
|
|
423
|
+
);
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* For adding one file panel (creation of file panel reference skipped if already created) at a time.
|
|
428
|
+
* Upload to BE not triggered
|
|
429
|
+
*/
|
|
430
|
+
readonly addForPotentialUpload = this.effect(
|
|
431
|
+
(file$: Observable<ProgressFile>) => this.progressFileChecker(file$)
|
|
432
|
+
);
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* For adding an array of file panels (creation of file panels reference skipped if already created).
|
|
436
|
+
* Uploads to BE not triggered
|
|
437
|
+
*/
|
|
438
|
+
readonly addSeveralForPotentialUpload = this.effect(
|
|
439
|
+
(files$: Observable<ProgressFile[]>) =>
|
|
440
|
+
files$.pipe(
|
|
441
|
+
switchMap((files) =>
|
|
442
|
+
forkJoin(files.map((file) => this.progressFileChecker(of(file))))
|
|
443
|
+
)
|
|
444
|
+
)
|
|
445
|
+
);
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* For adding a file panel (creation of file panels reference skipped if already created) then uploading it
|
|
449
|
+
*/
|
|
450
|
+
readonly uploadFile = this.effect((file$: Observable<ProgressFile>) => {
|
|
451
|
+
return this.progressFileChecker(file$).pipe(mergeMap(this.loadStep));
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
readonly retryFile = this.effect(
|
|
455
|
+
(file$: Observable<ReferencedProgressFile>) =>
|
|
456
|
+
this.progressFileChecker(file$).pipe(mergeMap(this.loadStep))
|
|
457
|
+
);
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* For adding several file panels (creation of file panels reference skipped if already created) then uploading them
|
|
461
|
+
*/
|
|
462
|
+
readonly uploadFiles = this.effect((files$: Observable<ProgressFile[]>) =>
|
|
463
|
+
files$.pipe(
|
|
464
|
+
switchMap((files) =>
|
|
465
|
+
merge(
|
|
466
|
+
...files.map((file) =>
|
|
467
|
+
this.progressFileChecker(of(file)).pipe(switchMap(this.loadStep))
|
|
468
|
+
)
|
|
469
|
+
)
|
|
470
|
+
)
|
|
471
|
+
)
|
|
472
|
+
);
|
|
473
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<ng-container [formGroup]="accountNumber">
|
|
2
|
+
<mat-form-field class="onemrva-bank-account-input">
|
|
3
|
+
<mat-label>{{ key | translate }}</mat-label>
|
|
4
|
+
<mat-select
|
|
5
|
+
matPrefix
|
|
6
|
+
formControlName="countryCode"
|
|
7
|
+
[placeholder]="'bankAccountInput.countryCode' | translate"
|
|
8
|
+
class="country-code"
|
|
9
|
+
style="padding: 0 0px 0 8px"
|
|
10
|
+
class="onemrva-bank-account-select"
|
|
11
|
+
>
|
|
12
|
+
<mat-option
|
|
13
|
+
*ngFor="let countryCode of countryCodes"
|
|
14
|
+
[value]="countryCode"
|
|
15
|
+
>{{ countryCode }}</mat-option
|
|
16
|
+
>
|
|
17
|
+
<mat-option value="">{{ "otherCountryCode" | translate }}</mat-option>
|
|
18
|
+
</mat-select>
|
|
19
|
+
<input
|
|
20
|
+
(click)="handleClick($event)"
|
|
21
|
+
type="tel"
|
|
22
|
+
matInput
|
|
23
|
+
[placeholder]="placeholder | translate"
|
|
24
|
+
formControlName="bankNumber"
|
|
25
|
+
class="onemrva-bank-account-text"
|
|
26
|
+
[mask]="mask$ | async"
|
|
27
|
+
/>
|
|
28
|
+
</mat-form-field>
|
|
29
|
+
</ng-container>
|
|
30
|
+
|
|
31
|
+
{{ accountNumber.value | json }}
|
|
32
|
+
{{ accountNumber.errors | json }}
|