monkey-front-core 0.0.95 → 0.0.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -24
- package/bundles/monkey-front-core.umd.js +4900 -0
- package/bundles/monkey-front-core.umd.js.map +1 -0
- package/esm2015/lib/components/closed-to-maintenance/closed-to-maintenance.component.js +35 -0
- package/{esm2020/lib/components/closed-to-maintenance/closed-to-maintenance.module.mjs → esm2015/lib/components/closed-to-maintenance/closed-to-maintenance.module.js} +5 -5
- package/{esm2020/lib/components/closed-to-maintenance/index.mjs → esm2015/lib/components/closed-to-maintenance/index.js} +1 -1
- package/{esm2020/lib/components/index.mjs → esm2015/lib/components/index.js} +0 -0
- package/{esm2020/lib/components/progress-bar/index.mjs → esm2015/lib/components/progress-bar/index.js} +1 -1
- package/esm2015/lib/components/progress-bar/progress-bar.component.js +29 -0
- package/{esm2020/lib/components/progress-bar/progress-bar.module.mjs → esm2015/lib/components/progress-bar/progress-bar.module.js} +5 -5
- package/esm2015/lib/components/progress-bar/progress-bar.service.js +53 -0
- package/{esm2020/lib/components/version-changed/index.mjs → esm2015/lib/components/version-changed/index.js} +1 -1
- package/esm2015/lib/components/version-changed/version-changed.component.js +29 -0
- package/{esm2020/lib/components/version-changed/version-changed.module.mjs → esm2015/lib/components/version-changed/version-changed.module.js} +5 -5
- package/{esm2020/lib/core/decorators/index.mjs → esm2015/lib/core/decorators/index.js} +1 -1
- package/{esm2020/lib/core/decorators/monkeyecx-charts-decorators.mjs → esm2015/lib/core/decorators/monkeyecx-charts-decorators.js} +1 -1
- package/esm2015/lib/core/decorators/monkeyecx-decorators.js +112 -0
- package/esm2015/lib/core/decorators/monkeyecx-download-decorators.js +25 -0
- package/esm2015/lib/core/decorators/monkeyecx-upload-decorators.js +25 -0
- package/{esm2020/lib/core/directives/index.mjs → esm2015/lib/core/directives/index.js} +1 -1
- package/{esm2020/lib/core/directives/monkeyecx-directives-module.mjs → esm2015/lib/core/directives/monkeyecx-directives-module.js} +5 -5
- package/esm2015/lib/core/directives/monkeyecx-drag-drop.js +57 -0
- package/esm2015/lib/core/directives/monkeyecx-feature-directive.js +68 -0
- package/{esm2020/lib/core/directives/monkeyecx-format-currency.mjs → esm2015/lib/core/directives/monkeyecx-format-currency.js} +4 -4
- package/esm2015/lib/core/directives/monkeyecx-format-upper.js +69 -0
- package/{esm2020/lib/core/directives/monkeyecx-only-alpha-numeric-directive.mjs → esm2015/lib/core/directives/monkeyecx-only-alpha-numeric-directive.js} +4 -4
- package/{esm2020/lib/core/directives/monkeyecx-only-number-directive.mjs → esm2015/lib/core/directives/monkeyecx-only-number-directive.js} +4 -4
- package/esm2015/lib/core/directives/monkeyecx-security-directive.js +69 -0
- package/esm2015/lib/core/directives/monkeyecx-tooltip-directive.js +124 -0
- package/{esm2020/lib/core/index.mjs → esm2015/lib/core/index.js} +1 -1
- package/{esm2020/lib/core/interceptors/index.mjs → esm2015/lib/core/interceptors/index.js} +1 -1
- package/esm2015/lib/core/interceptors/monkeyecx-http-config-error.interceptor.js +40 -0
- package/esm2015/lib/core/interceptors/monkeyecx-http-config-header.interceptor.js +33 -0
- package/{esm2020/lib/core/interceptors/monkeyecx-http-config-interceptor.module.mjs → esm2015/lib/core/interceptors/monkeyecx-http-config-interceptor.module.js} +5 -5
- package/esm2015/lib/core/interceptors/monkeyecx-http-config-loading-in-progress.interceptor.js +44 -0
- package/esm2015/lib/core/interceptors/monkeyecx-http-config-queue.interceptor.js +38 -0
- package/esm2015/lib/core/interfaces/index.js +27 -0
- package/esm2015/lib/core/interfaces/monkeyecx-auth-credentials.js +2 -0
- package/{esm2020/lib/core/interfaces/monkeyecx-company.mjs → esm2015/lib/core/interfaces/monkeyecx-company.js} +1 -1
- package/esm2015/lib/core/interfaces/monkeyecx-config-boostrap.js +2 -0
- package/esm2015/lib/core/interfaces/monkeyecx-config.js +2 -0
- package/{esm2020/lib/core/interfaces/monkeyecx-error-response.mjs → esm2015/lib/core/interfaces/monkeyecx-error-response.js} +1 -1
- package/{esm2020/lib/core/interfaces/monkeyecx-handled-error-response.mjs → esm2015/lib/core/interfaces/monkeyecx-handled-error-response.js} +1 -1
- package/{esm2020/lib/core/interfaces/monkeyecx-header-credentials.mjs → esm2015/lib/core/interfaces/monkeyecx-header-credentials.js} +1 -1
- package/{esm2020/lib/core/interfaces/monkeyecx-intercom-options.mjs → esm2015/lib/core/interfaces/monkeyecx-intercom-options.js} +1 -1
- package/esm2015/lib/core/interfaces/monkeyecx-me-credentials.js +2 -0
- package/esm2015/lib/core/interfaces/monkeyecx-navigation.js +2 -0
- package/{esm2020/lib/core/interfaces/monkeyecx-program.mjs → esm2015/lib/core/interfaces/monkeyecx-program.js} +1 -1
- package/{esm2020/lib/core/interfaces/monkeyecx-releases.mjs → esm2015/lib/core/interfaces/monkeyecx-releases.js} +1 -1
- package/{esm2020/lib/core/interfaces/monkeyecx-request-in-progress.mjs → esm2015/lib/core/interfaces/monkeyecx-request-in-progress.js} +1 -1
- package/esm2015/lib/core/interfaces/monkeyecx-request-paged.js +2 -0
- package/{esm2020/lib/core/interfaces/monkeyecx-response-links.mjs → esm2015/lib/core/interfaces/monkeyecx-response-links.js} +1 -1
- package/{esm2020/lib/core/interfaces/monkeyecx-response-paged.mjs → esm2015/lib/core/interfaces/monkeyecx-response-paged.js} +1 -1
- package/esm2015/lib/core/interfaces/monkeyecx-saved-state.js +2 -0
- package/esm2015/lib/core/interfaces/monkeyecx-scroll-options.js +2 -0
- package/esm2015/lib/core/interfaces/monkeyecx-service-credentials.js +2 -0
- package/{esm2020/lib/core/interfaces/monkeyecx-support-options.mjs → esm2015/lib/core/interfaces/monkeyecx-support-options.js} +1 -1
- package/esm2015/lib/core/interfaces/monkeyecx-token-credentials.js +2 -0
- package/{esm2020/lib/core/interfaces/monkeyecx-translate-options.mjs → esm2015/lib/core/interfaces/monkeyecx-translate-options.js} +1 -1
- package/{esm2020/lib/core/interfaces/request-download/index.mjs → esm2015/lib/core/interfaces/request-download/index.js} +1 -1
- package/{esm2020/lib/core/interfaces/request-download/monkeyecx-request-download.mjs → esm2015/lib/core/interfaces/request-download/monkeyecx-request-download.js} +1 -1
- package/{esm2020/lib/core/interfaces/request-download/monkeyecx-request-downloaded.mjs → esm2015/lib/core/interfaces/request-download/monkeyecx-request-downloaded.js} +1 -1
- package/{esm2020/lib/core/interfaces/request-download/monkeyecx-request-item-download.mjs → esm2015/lib/core/interfaces/request-download/monkeyecx-request-item-download.js} +1 -1
- package/{esm2020/lib/core/interfaces/request-queue/index.mjs → esm2015/lib/core/interfaces/request-queue/index.js} +1 -1
- package/{esm2020/lib/core/interfaces/request-queue/monkeyecx-request-item-queue.mjs → esm2015/lib/core/interfaces/request-queue/monkeyecx-request-item-queue.js} +1 -1
- package/{esm2020/lib/core/interfaces/request-queue/monkeyecx-request-progress-queue.mjs → esm2015/lib/core/interfaces/request-queue/monkeyecx-request-progress-queue.js} +1 -1
- package/{esm2020/lib/core/interfaces/request-queue/monkeyecx-request-queue.mjs → esm2015/lib/core/interfaces/request-queue/monkeyecx-request-queue.js} +1 -1
- package/{esm2020/lib/core/interfaces/request-upload/index.mjs → esm2015/lib/core/interfaces/request-upload/index.js} +1 -1
- package/{esm2020/lib/core/interfaces/request-upload/monkeyecx-request-item-upload.mjs → esm2015/lib/core/interfaces/request-upload/monkeyecx-request-item-upload.js} +1 -1
- package/{esm2020/lib/core/interfaces/request-upload/monkeyecx-request-upload.mjs → esm2015/lib/core/interfaces/request-upload/monkeyecx-request-upload.js} +1 -1
- package/{esm2020/lib/core/interfaces/schedules/index.mjs → esm2015/lib/core/interfaces/schedules/index.js} +1 -1
- package/esm2015/lib/core/interfaces/schedules/monkeyecx-request-schedule.js +2 -0
- package/{esm2020/lib/core/model/index.mjs → esm2015/lib/core/model/index.js} +1 -1
- package/{esm2020/lib/core/model/monkeyecx-model.mjs → esm2015/lib/core/model/monkeyecx-model.js} +1 -1
- package/{esm2020/lib/core/pipes/index.mjs → esm2015/lib/core/pipes/index.js} +0 -0
- package/{esm2020/lib/core/pipes/monkeyecx-display-first-name.mjs → esm2015/lib/core/pipes/monkeyecx-display-first-name.js} +4 -4
- package/{esm2020/lib/core/pipes/monkeyecx-format-address.mjs → esm2015/lib/core/pipes/monkeyecx-format-address.js} +4 -4
- package/{esm2020/lib/core/pipes/monkeyecx-format-currency.mjs → esm2015/lib/core/pipes/monkeyecx-format-currency.js} +4 -4
- package/esm2015/lib/core/pipes/monkeyecx-format-date-group.js +46 -0
- package/{esm2020/lib/core/pipes/monkeyecx-format-date-timelapse.mjs → esm2015/lib/core/pipes/monkeyecx-format-date-timelapse.js} +4 -4
- package/{esm2020/lib/core/pipes/monkeyecx-format-document.mjs → esm2015/lib/core/pipes/monkeyecx-format-document.js} +4 -4
- package/{esm2020/lib/core/pipes/monkeyecx-format-number.mjs → esm2015/lib/core/pipes/monkeyecx-format-number.js} +4 -4
- package/{esm2020/lib/core/pipes/monkeyecx-format-phone.mjs → esm2015/lib/core/pipes/monkeyecx-format-phone.js} +4 -4
- package/{esm2020/lib/core/pipes/monkeyecx-format-size.mjs → esm2015/lib/core/pipes/monkeyecx-format-size.js} +4 -4
- package/{esm2020/lib/core/pipes/monkeyecx-format-type-document.mjs → esm2015/lib/core/pipes/monkeyecx-format-type-document.js} +4 -4
- package/{esm2020/lib/core/pipes/monkeyecx-format-value.mjs → esm2015/lib/core/pipes/monkeyecx-format-value.js} +4 -4
- package/{esm2020/lib/core/pipes/monkeyecx-format-zipcode.mjs → esm2015/lib/core/pipes/monkeyecx-format-zipcode.js} +4 -4
- package/{esm2020/lib/core/pipes/monkeyecx-pipes.module.mjs → esm2015/lib/core/pipes/monkeyecx-pipes.module.js} +5 -5
- package/{esm2020/lib/core/pipes/monkeyecx-text-truncate.mjs → esm2015/lib/core/pipes/monkeyecx-text-truncate.js} +4 -4
- package/{esm2020/lib/core/pipes/monkeyecx-truncate-qtd.mjs → esm2015/lib/core/pipes/monkeyecx-truncate-qtd.js} +4 -4
- package/{esm2020/lib/core/services/auth/index.mjs → esm2015/lib/core/services/auth/index.js} +1 -1
- package/{esm2020/lib/core/services/auth/monkeyecx-auth-guard-login.service.mjs → esm2015/lib/core/services/auth/monkeyecx-auth-guard-login.service.js} +4 -4
- package/{esm2020/lib/core/services/auth/monkeyecx-auth-guard.service.mjs → esm2015/lib/core/services/auth/monkeyecx-auth-guard.service.js} +4 -4
- package/esm2015/lib/core/services/auth/monkeyecx-authentication.service.js +61 -0
- package/{esm2020/lib/core/services/commons/index.mjs → esm2015/lib/core/services/commons/index.js} +1 -1
- package/esm2015/lib/core/services/commons/monkeyecx-commons.service.js +265 -0
- package/{esm2020/lib/core/services/config/monkeyecx-config.module.mjs → esm2015/lib/core/services/config/monkeyecx-config.module.js} +5 -5
- package/{esm2020/lib/core/services/config/monkeyecx-config.service.mjs → esm2015/lib/core/services/config/monkeyecx-config.service.js} +9 -11
- package/esm2015/lib/core/services/config/monkeyecx-error-config.service.js +85 -0
- package/esm2015/lib/core/services/config/monkeyecx-feature-toggle.service.js +70 -0
- package/esm2015/lib/core/services/config/monkeyecx-i18n-config.service.js +72 -0
- package/esm2015/lib/core/services/config/monkeyecx-logs-config.service.js +34 -0
- package/{esm2020/lib/core/services/config/monkeyecx-maintenance-config.service.mjs → esm2015/lib/core/services/config/monkeyecx-maintenance-config.service.js} +4 -4
- package/esm2015/lib/core/services/config/monkeyecx-security-console-config.service.js +42 -0
- package/esm2015/lib/core/services/config/monkeyecx-service-worker-config.service.js +54 -0
- package/{esm2020/lib/core/services/error/index.mjs → esm2015/lib/core/services/error/index.js} +1 -1
- package/{esm2020/lib/core/services/error/monkeyecx-error-handling.module.mjs → esm2015/lib/core/services/error/monkeyecx-error-handling.module.js} +5 -5
- package/esm2015/lib/core/services/error/monkeyecx-error-handling.service.js +41 -0
- package/esm2015/lib/core/services/error/monkeyecx-http-error-handling.service.js +132 -0
- package/{esm2020/lib/core/services/error/monkeyecx-others-errors-handling.service.mjs → esm2015/lib/core/services/error/monkeyecx-others-errors-handling.service.js} +4 -4
- package/{esm2020/lib/core/services/index.mjs → esm2015/lib/core/services/index.js} +1 -1
- package/{esm2020/lib/core/services/logged/index.mjs → esm2015/lib/core/services/logged/index.js} +1 -1
- package/{esm2020/lib/core/services/logged/monkeyecx-logged-handling.service.mjs → esm2015/lib/core/services/logged/monkeyecx-logged-handling.service.js} +4 -4
- package/esm2015/lib/core/services/monkeyecx-handling.service.js +50 -0
- package/esm2015/lib/core/services/monkeyecx-service.service.js +102 -0
- package/{esm2020/lib/core/services/request-download/index.mjs → esm2015/lib/core/services/request-download/index.js} +1 -1
- package/esm2015/lib/core/services/request-download/monkeyecx-request-download-handling.service.js +81 -0
- package/esm2015/lib/core/services/request-download/monkeyecx-request-downloaded-handling.service.js +55 -0
- package/{esm2020/lib/core/services/request-paged/index.mjs → esm2015/lib/core/services/request-paged/index.js} +1 -1
- package/esm2015/lib/core/services/request-paged/monkeyecx-request-request-paged-handling.js +37 -0
- package/{esm2020/lib/core/services/request-queue/index.mjs → esm2015/lib/core/services/request-queue/index.js} +1 -1
- package/esm2015/lib/core/services/request-queue/monkeyecx-request-queue-handling.service.js +101 -0
- package/esm2015/lib/core/services/request-queue/monkeyecx-request-queue-modal-handling.service.js +106 -0
- package/{esm2020/lib/core/services/routes/index.mjs → esm2015/lib/core/services/routes/index.js} +1 -1
- package/esm2015/lib/core/services/routes/monkeyecx-dicovery-params.service.js +55 -0
- package/{esm2020/lib/core/services/schedules/index.mjs → esm2015/lib/core/services/schedules/index.js} +1 -1
- package/esm2015/lib/core/services/schedules/monkeyecx-request-schedule.service.js +99 -0
- package/{esm2020/lib/core/services/storage/index.mjs → esm2015/lib/core/services/storage/index.js} +1 -1
- package/{esm2020/lib/core/services/storage/monkeyecx-cookie-storage.service.mjs → esm2015/lib/core/services/storage/monkeyecx-cookie-storage.service.js} +4 -4
- package/esm2015/lib/core/services/storage/monkeyecx-token-storage.service.js +123 -0
- package/{esm2020/lib/core/specification-search/index.mjs → esm2015/lib/core/specification-search/index.js} +1 -1
- package/{esm2020/lib/core/specification-search/monkeyecx-specification-search.mjs → esm2015/lib/core/specification-search/monkeyecx-specification-search.js} +3 -2
- package/esm2015/lib/core/utils/decorators-utils.js +37 -0
- package/{esm2020/lib/core/utils/index.mjs → esm2015/lib/core/utils/index.js} +1 -1
- package/{esm2020/lib/core/utils/statics.mjs → esm2015/lib/core/utils/statics.js} +1 -1
- package/esm2015/lib/core/utils/utils.js +219 -0
- package/esm2015/lib/core/utils/validate-utils.js +210 -0
- package/esm2015/lib/core/utils/validators.js +211 -0
- package/{esm2020/lib/monkey-front-core.module.mjs → esm2015/lib/monkey-front-core.module.js} +5 -5
- package/{esm2020/monkey-front-core.mjs → esm2015/monkey-front-core.js} +0 -0
- package/{esm2020/public-api.mjs → esm2015/public-api.js} +1 -1
- package/fesm2015/{monkey-front-core.mjs → monkey-front-core.js} +233 -218
- package/fesm2015/monkey-front-core.js.map +1 -0
- package/lib/core/interfaces/index.d.ts +2 -0
- package/lib/core/interfaces/monkeyecx-saved-state.d.ts +5 -0
- package/lib/core/interfaces/monkeyecx-scroll-options.d.ts +5 -0
- package/lib/core/pipes/monkeyecx-format-currency.d.ts +1 -1
- package/lib/core/services/auth/monkeyecx-authentication.service.d.ts +3 -3
- package/lib/core/services/commons/monkeyecx-commons.service.d.ts +18 -15
- package/lib/core/services/schedules/monkeyecx-request-schedule.service.d.ts +1 -1
- package/lib/core/utils/validate-utils.d.ts +13 -13
- package/monkey-front-core-0.0.99.tgz +0 -0
- package/package.json +7 -20
- package/esm2020/lib/components/closed-to-maintenance/closed-to-maintenance.component.mjs +0 -29
- package/esm2020/lib/components/progress-bar/progress-bar.component.mjs +0 -23
- package/esm2020/lib/components/progress-bar/progress-bar.service.mjs +0 -50
- package/esm2020/lib/components/version-changed/version-changed.component.mjs +0 -24
- package/esm2020/lib/core/decorators/monkeyecx-decorators.mjs +0 -111
- package/esm2020/lib/core/decorators/monkeyecx-download-decorators.mjs +0 -26
- package/esm2020/lib/core/decorators/monkeyecx-upload-decorators.mjs +0 -26
- package/esm2020/lib/core/directives/monkeyecx-drag-drop.mjs +0 -57
- package/esm2020/lib/core/directives/monkeyecx-feature-directive.mjs +0 -68
- package/esm2020/lib/core/directives/monkeyecx-format-upper.mjs +0 -67
- package/esm2020/lib/core/directives/monkeyecx-security-directive.mjs +0 -69
- package/esm2020/lib/core/directives/monkeyecx-tooltip-directive.mjs +0 -123
- package/esm2020/lib/core/interceptors/monkeyecx-http-config-error.interceptor.mjs +0 -39
- package/esm2020/lib/core/interceptors/monkeyecx-http-config-header.interceptor.mjs +0 -32
- package/esm2020/lib/core/interceptors/monkeyecx-http-config-loading-in-progress.interceptor.mjs +0 -43
- package/esm2020/lib/core/interceptors/monkeyecx-http-config-queue.interceptor.mjs +0 -37
- package/esm2020/lib/core/interfaces/index.mjs +0 -25
- package/esm2020/lib/core/interfaces/monkeyecx-auth-credentials.mjs +0 -2
- package/esm2020/lib/core/interfaces/monkeyecx-config-boostrap.mjs +0 -2
- package/esm2020/lib/core/interfaces/monkeyecx-config.mjs +0 -2
- package/esm2020/lib/core/interfaces/monkeyecx-me-credentials.mjs +0 -2
- package/esm2020/lib/core/interfaces/monkeyecx-navigation.mjs +0 -2
- package/esm2020/lib/core/interfaces/monkeyecx-request-paged.mjs +0 -2
- package/esm2020/lib/core/interfaces/monkeyecx-service-credentials.mjs +0 -2
- package/esm2020/lib/core/interfaces/monkeyecx-token-credentials.mjs +0 -2
- package/esm2020/lib/core/interfaces/schedules/monkeyecx-request-schedule.mjs +0 -2
- package/esm2020/lib/core/pipes/monkeyecx-format-date-group.mjs +0 -45
- package/esm2020/lib/core/services/auth/monkeyecx-authentication.service.mjs +0 -61
- package/esm2020/lib/core/services/commons/monkeyecx-commons.service.mjs +0 -273
- package/esm2020/lib/core/services/config/monkeyecx-error-config.service.mjs +0 -85
- package/esm2020/lib/core/services/config/monkeyecx-feature-toggle.service.mjs +0 -67
- package/esm2020/lib/core/services/config/monkeyecx-i18n-config.service.mjs +0 -74
- package/esm2020/lib/core/services/config/monkeyecx-logs-config.service.mjs +0 -34
- package/esm2020/lib/core/services/config/monkeyecx-security-console-config.service.mjs +0 -42
- package/esm2020/lib/core/services/config/monkeyecx-service-worker-config.service.mjs +0 -53
- package/esm2020/lib/core/services/error/monkeyecx-error-handling.service.mjs +0 -41
- package/esm2020/lib/core/services/error/monkeyecx-http-error-handling.service.mjs +0 -127
- package/esm2020/lib/core/services/monkeyecx-handling.service.mjs +0 -50
- package/esm2020/lib/core/services/monkeyecx-service.service.mjs +0 -104
- package/esm2020/lib/core/services/request-download/monkeyecx-request-download-handling.service.mjs +0 -93
- package/esm2020/lib/core/services/request-download/monkeyecx-request-downloaded-handling.service.mjs +0 -61
- package/esm2020/lib/core/services/request-paged/monkeyecx-request-request-paged-handling.mjs +0 -37
- package/esm2020/lib/core/services/request-queue/monkeyecx-request-queue-handling.service.mjs +0 -114
- package/esm2020/lib/core/services/request-queue/monkeyecx-request-queue-modal-handling.service.mjs +0 -119
- package/esm2020/lib/core/services/routes/monkeyecx-dicovery-params.service.mjs +0 -54
- package/esm2020/lib/core/services/schedules/monkeyecx-request-schedule.service.mjs +0 -113
- package/esm2020/lib/core/services/storage/monkeyecx-token-storage.service.mjs +0 -126
- package/esm2020/lib/core/utils/decorators-utils.mjs +0 -40
- package/esm2020/lib/core/utils/utils.mjs +0 -218
- package/esm2020/lib/core/utils/validate-utils.mjs +0 -206
- package/esm2020/lib/core/utils/validators.mjs +0 -208
- package/fesm2015/monkey-front-core.mjs.map +0 -1
- package/fesm2020/monkey-front-core.mjs +0 -4258
- package/fesm2020/monkey-front-core.mjs.map +0 -1
- package/monkey-front-core-0.0.95.tgz +0 -0
|
@@ -1,4258 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe, Component, ViewEncapsulation, Input, Injectable, NgModule, EventEmitter, Directive, Output, HostBinding, HostListener, forwardRef, Self, NgZone, ErrorHandler, Optional, SkipSelf } from '@angular/core';
|
|
3
|
-
import * as i1 from 'monkey-style-guide';
|
|
4
|
-
import { MonkeyButtonModule, MonkeyIconModule, MonkeyInputModule, MonkeyModalModule, MonkeyUtils, MonkeyStyleGuideModule, MonkeyStyleGuideModalService, MonkeyStyleGuideSettingsService, MonkeyStyleGuideSnackbarService } from 'monkey-style-guide';
|
|
5
|
-
import * as i2 from '@angular/common';
|
|
6
|
-
import { formatNumber, CurrencyPipe, CommonModule } from '@angular/common';
|
|
7
|
-
import * as i1$1 from '@ngx-translate/core';
|
|
8
|
-
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
|
9
|
-
import * as moment_ from 'moment';
|
|
10
|
-
import * as i1$2 from 'ngx-cookie-service';
|
|
11
|
-
import * as i1$3 from '@angular/router';
|
|
12
|
-
import { NavigationStart, NavigationEnd, NavigationError, NavigationCancel } from '@angular/router';
|
|
13
|
-
import { BehaviorSubject, throwError, interval, concat, of, Subject } from 'rxjs';
|
|
14
|
-
import { filter, take, takeWhile, map, catchError, first, takeUntil, mergeMap, finalize } from 'rxjs/operators';
|
|
15
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
16
|
-
import { __decorate } from 'tslib';
|
|
17
|
-
import * as i1$4 from '@angular/common/http';
|
|
18
|
-
import { HttpParams, HttpErrorResponse, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
|
|
19
|
-
import { datadogRum } from '@datadog/browser-rum';
|
|
20
|
-
import * as i1$5 from '@angular/service-worker';
|
|
21
|
-
import { ServiceWorkerModule } from '@angular/service-worker';
|
|
22
|
-
import { initialize } from 'launchdarkly-js-client-sdk';
|
|
23
|
-
|
|
24
|
-
/* eslint-disable comma-dangle */
|
|
25
|
-
/* eslint-disable max-len */
|
|
26
|
-
/* eslint-disable no-useless-escape */
|
|
27
|
-
/* eslint-disable no-plusplus */
|
|
28
|
-
/* eslint-disable no-cond-assign */
|
|
29
|
-
/* eslint-disable eqeqeq */
|
|
30
|
-
/* eslint-disable no-redeclare */
|
|
31
|
-
/* eslint-disable vars-on-top */
|
|
32
|
-
/* eslint-disable no-var */
|
|
33
|
-
/* eslint-disable block-scoped-var */
|
|
34
|
-
class MonkeyEcxUtils {
|
|
35
|
-
static persistNullEmptyUndefined(tp) {
|
|
36
|
-
return tp !== null && tp !== undefined && tp !== '';
|
|
37
|
-
}
|
|
38
|
-
static getDocumentType(doc, country) {
|
|
39
|
-
if (!doc)
|
|
40
|
-
return '';
|
|
41
|
-
if (country === 'cl')
|
|
42
|
-
return 'RUT';
|
|
43
|
-
return doc.length <= 11 ? 'CPF' : 'CNPJ';
|
|
44
|
-
}
|
|
45
|
-
static getDocumentMask(type) {
|
|
46
|
-
if (type === 'CPF')
|
|
47
|
-
return '000.000.000-00';
|
|
48
|
-
return '00.000.000/0000-00';
|
|
49
|
-
}
|
|
50
|
-
static formatDocumentWithMask(doc, withType, country) {
|
|
51
|
-
if (!doc)
|
|
52
|
-
return doc;
|
|
53
|
-
let formated = '';
|
|
54
|
-
if (country === 'cl') {
|
|
55
|
-
formated = doc.replace(/^(\d{1,2})(\d{3})(\d{3})(\w{1})$/, '$1.$2.$3-$4');
|
|
56
|
-
return `${formated}`;
|
|
57
|
-
}
|
|
58
|
-
if (doc.length === 14) {
|
|
59
|
-
formated = doc
|
|
60
|
-
.replace(/^(\d{2})(\d)/, '$1.$2')
|
|
61
|
-
.replace(/^(\d{2})\.(\d{3})(\d)/, '$1.$2.$3')
|
|
62
|
-
.replace(/\.(\d{3})(\d)/, '.$1/$2')
|
|
63
|
-
.replace(/(\d{4})(\d)/, '$1-$2');
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
formated = doc
|
|
67
|
-
.replace(/^(\d{3})(\d)/, '$1.$2')
|
|
68
|
-
.replace(/^(\d{3})\.(\d{3})(\d)/, '$1.$2.$3')
|
|
69
|
-
.replace(/\.(\d{3})(\d)/, '.$1-$2');
|
|
70
|
-
}
|
|
71
|
-
return `${withType ? `${this.getDocumentType(doc)}:` : ''} ${formated}`;
|
|
72
|
-
}
|
|
73
|
-
static cutFirstLastName(value, tp = 'first') {
|
|
74
|
-
const split = value?.trim()?.split(' ');
|
|
75
|
-
if (tp === 'first')
|
|
76
|
-
return split[0];
|
|
77
|
-
return split?.splice(1, split.length)?.join(' ');
|
|
78
|
-
}
|
|
79
|
-
static isCPFCNPJValid(document) {
|
|
80
|
-
document = document.replace(/[^\d]/g, '');
|
|
81
|
-
if (document.length === 11) {
|
|
82
|
-
let base = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0];
|
|
83
|
-
for (var i = 0, n = 0; i < 9; n += document[i] * base[i++])
|
|
84
|
-
;
|
|
85
|
-
if (document[9] != ((n %= 11) <= 1 ? 0 : 11 - n)) {
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
base = [11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0];
|
|
89
|
-
for (var i = 0, n = 0; i <= 9; n += document[i] * base[i++])
|
|
90
|
-
;
|
|
91
|
-
if (document[10] != ((n %= 11) <= 1 ? 0 : 11 - n)) {
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
return true;
|
|
95
|
-
}
|
|
96
|
-
if (document.length === 14 || /0{14}/.test(document)) {
|
|
97
|
-
const base = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2];
|
|
98
|
-
for (var i = 0, n = 0; i < 12; n += document[i] * base[++i])
|
|
99
|
-
;
|
|
100
|
-
if (document[12] != ((n %= 11) < 2 ? 0 : 11 - n)) {
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
for (var i = 0, n = 0; i <= 12; n += document[i] * base[i++])
|
|
104
|
-
;
|
|
105
|
-
if (document[13] != ((n %= 11) < 2 ? 0 : 11 - n)) {
|
|
106
|
-
return false;
|
|
107
|
-
}
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
112
|
-
static isValidRUT(document) {
|
|
113
|
-
if (!document || document.trim().length < 3)
|
|
114
|
-
return false;
|
|
115
|
-
const documentHandled = document.replace(/[^0-9kK]/g, '');
|
|
116
|
-
if (documentHandled.length < 3)
|
|
117
|
-
return false;
|
|
118
|
-
const calcDv = (rut) => {
|
|
119
|
-
const value = `${rut}`;
|
|
120
|
-
let sum = 0;
|
|
121
|
-
let mult = 2;
|
|
122
|
-
for (let i = 1; i <= value.length; i++) {
|
|
123
|
-
const index = mult * Number(value.charAt(value.length - i));
|
|
124
|
-
sum += index;
|
|
125
|
-
if (mult < 7) {
|
|
126
|
-
mult += 1;
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
mult = 2;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
const dvEsperado = 11 - (sum % 11);
|
|
133
|
-
if (dvEsperado === 10)
|
|
134
|
-
return 'K';
|
|
135
|
-
if (dvEsperado === 11)
|
|
136
|
-
return '0';
|
|
137
|
-
return `${dvEsperado}`;
|
|
138
|
-
};
|
|
139
|
-
const num = documentHandled.slice(0, -1);
|
|
140
|
-
const dgv = documentHandled.slice(-1).toUpperCase();
|
|
141
|
-
const dvCalc = calcDv(num);
|
|
142
|
-
return dvCalc === dgv;
|
|
143
|
-
}
|
|
144
|
-
static isValidUrl(txt) {
|
|
145
|
-
const regex = new RegExp(/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)+[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,10}(:[0-9]{1,5})?(\/.*)?$/gm);
|
|
146
|
-
return regex.test(txt);
|
|
147
|
-
}
|
|
148
|
-
static isValidZipCode(zipCode) {
|
|
149
|
-
return `${this.handleOnlyNumbers(zipCode)}`.length === 8;
|
|
150
|
-
}
|
|
151
|
-
static getRandomString(len, charSet) {
|
|
152
|
-
charSet = charSet || 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
153
|
-
const randomString = new Array(len)
|
|
154
|
-
.fill('1')
|
|
155
|
-
.map(() => {
|
|
156
|
-
return charSet?.charAt(Math.floor(Math.random() * charSet?.length));
|
|
157
|
-
})
|
|
158
|
-
.join('');
|
|
159
|
-
return randomString;
|
|
160
|
-
}
|
|
161
|
-
static handleOnlyNumbers(value) {
|
|
162
|
-
if (!value)
|
|
163
|
-
return null;
|
|
164
|
-
return value.replace(new RegExp(/[^0-9]/g), '');
|
|
165
|
-
}
|
|
166
|
-
static handleOnlyAlphaNumeric(value) {
|
|
167
|
-
if (!value)
|
|
168
|
-
return '';
|
|
169
|
-
return value.replace(new RegExp(/[^0-9A-Za-z]/, 'g'), '');
|
|
170
|
-
}
|
|
171
|
-
static capitalize(value) {
|
|
172
|
-
return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;
|
|
173
|
-
}
|
|
174
|
-
static formatZipCode(zipCode) {
|
|
175
|
-
if (!zipCode)
|
|
176
|
-
return zipCode;
|
|
177
|
-
const formated = zipCode
|
|
178
|
-
.replace(/^(\d{5})(\d)/, '$1-$2')
|
|
179
|
-
.replace(/\.(\d{3})(\d)/, '.$1-$2');
|
|
180
|
-
return `${formated}`;
|
|
181
|
-
}
|
|
182
|
-
static formatFileSize(size) {
|
|
183
|
-
const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
184
|
-
let l = 0;
|
|
185
|
-
while (size >= 1024 && ++l) {
|
|
186
|
-
size /= 1024;
|
|
187
|
-
}
|
|
188
|
-
return `${size.toFixed(size < 10 && l > 0 ? 1 : 0)} ${units[l]}`;
|
|
189
|
-
}
|
|
190
|
-
static sufflue(data) {
|
|
191
|
-
for (let i = data.length - 1; i > 0; i--) {
|
|
192
|
-
const j = Math.floor(Math.random() * i);
|
|
193
|
-
const temp = data[i];
|
|
194
|
-
data[i] = data[j];
|
|
195
|
-
data[j] = temp;
|
|
196
|
-
}
|
|
197
|
-
return data;
|
|
198
|
-
}
|
|
199
|
-
static handleBlobFile(theBlob, fileName, fileType) {
|
|
200
|
-
function blobToFile(theBlob, fileName) {
|
|
201
|
-
const b = theBlob;
|
|
202
|
-
b.lastModifiedDate = new Date();
|
|
203
|
-
b.name = fileName;
|
|
204
|
-
return b;
|
|
205
|
-
}
|
|
206
|
-
let file;
|
|
207
|
-
if (!navigator.msSaveBlob) {
|
|
208
|
-
file = new File([theBlob], fileName, {
|
|
209
|
-
type: fileType,
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
file = new Blob([theBlob], {
|
|
214
|
-
type: fileType,
|
|
215
|
-
});
|
|
216
|
-
file = blobToFile(file, fileName);
|
|
217
|
-
}
|
|
218
|
-
return file;
|
|
219
|
-
}
|
|
220
|
-
static truncate(text, maxLength = 25) {
|
|
221
|
-
const midChar = '...';
|
|
222
|
-
if (!text)
|
|
223
|
-
return midChar;
|
|
224
|
-
if (text && text.length <= maxLength)
|
|
225
|
-
return text;
|
|
226
|
-
const left = Math.ceil(maxLength / 2);
|
|
227
|
-
const right = text.length - left + 1;
|
|
228
|
-
return `${text.substr(0, left)} ${midChar} ${text.substring(right)}`;
|
|
229
|
-
}
|
|
230
|
-
static isLocalhost() {
|
|
231
|
-
const { href } = window?.location;
|
|
232
|
-
if (!href)
|
|
233
|
-
return false;
|
|
234
|
-
return href?.search('localhost') >= 0;
|
|
235
|
-
}
|
|
236
|
-
static isSameOrigin(frontend) {
|
|
237
|
-
const initialPath = window.location.origin;
|
|
238
|
-
return (initialPath || '') === frontend;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
const moment$3 = moment_;
|
|
243
|
-
class MonkeyEcxFormatDateTimelapsePipe {
|
|
244
|
-
transform(date, showTime = false, useUtc = true, format = '- HH:mm') {
|
|
245
|
-
if (!MonkeyEcxUtils.persistNullEmptyUndefined(date))
|
|
246
|
-
return '';
|
|
247
|
-
let stillUtc = moment$3.default.utc(date).toDate();
|
|
248
|
-
if (!useUtc)
|
|
249
|
-
stillUtc = moment$3.default(date).toDate();
|
|
250
|
-
if (date.toString().indexOf(':') <= -1) {
|
|
251
|
-
if (typeof date === 'string') {
|
|
252
|
-
stillUtc = date;
|
|
253
|
-
showTime = false;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
const formatFrom = `YYYY/MM/DD${showTime ? ` ${format}` : ''}`;
|
|
257
|
-
const formatTo = `DD/MM/YYYY${showTime ? ` ${format}` : ''}`;
|
|
258
|
-
return `${moment$3.default(stillUtc, formatFrom).format(formatTo)}`;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
MonkeyEcxFormatDateTimelapsePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDateTimelapsePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
262
|
-
MonkeyEcxFormatDateTimelapsePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDateTimelapsePipe, name: "monkeyecxFormatDateTimelapse" });
|
|
263
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDateTimelapsePipe, decorators: [{
|
|
264
|
-
type: Pipe,
|
|
265
|
-
args: [{
|
|
266
|
-
name: 'monkeyecxFormatDateTimelapse',
|
|
267
|
-
}]
|
|
268
|
-
}] });
|
|
269
|
-
|
|
270
|
-
class ClosedToMaintenanceComponent {
|
|
271
|
-
constructor() {
|
|
272
|
-
this.config = null;
|
|
273
|
-
this._configBoostrap = null;
|
|
274
|
-
}
|
|
275
|
-
ngOnInit() {
|
|
276
|
-
this._configBoostrap = this.config?.data;
|
|
277
|
-
}
|
|
278
|
-
onClose() {
|
|
279
|
-
document.location.reload();
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
ClosedToMaintenanceComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ClosedToMaintenanceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
283
|
-
ClosedToMaintenanceComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: ClosedToMaintenanceComponent, selector: "monkeyecx-closed-to-maintenance", inputs: { config: "config", modalRef: "modalRef" }, ngImport: i0, template: "<monkey-modal [config]=\"config\" [modalRef]=\"modalRef\" *ngIf=\"config\">\n <div class=\"d-flex flex-column justify-content-center align-items-center\">\n <span class=\"h2\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.TITLE' | translate }}\n </span>\n <span class=\"information-title mt-4\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-1' | translate }}\n </span>\n <span class=\"information-title mt-4\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-2' | translate }}\n </span>\n <span class=\"information mt-3\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-3' | translate }}\n {{ _configBoostrap?.maintenance?.endDate | monkeyecxFormatDateTimelapse: true }}\n </span>\n <span class=\"information-title mt-4\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-4' | translate }}\n </span>\n </div>\n <div class=\"d-flex flex-column justify-content-center align-items-center mt-5\">\n <monkey-button type=\"primary\" color=\"theme\" (click)=\"onClose()\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.BUTTONS.UPDATE-MAINTENANCE' | translate }}\n </monkey-button>\n </div>\n</monkey-modal>", styles: ["monkeyecx-closed-to-maintenance .body{padding:24px;width:100%}monkeyecx-closed-to-maintenance .information-title{font-style:normal;font-weight:600;font-size:25px;line-height:32px;display:flex;align-items:center;text-align:center;color:#4b4a53}monkeyecx-closed-to-maintenance .information{font-style:normal;font-weight:400;font-size:20px;line-height:24px;display:flex;align-items:center;text-align:center;color:#4b4a53;max-width:600px}monkeyecx-closed-to-maintenance .browser-name{font-style:normal;font-weight:400;font-size:16px;line-height:24px;text-align:center;color:#9c9ca6}monkeyecx-closed-to-maintenance .option{text-decoration:none;padding:4px;background:#eee;border:1px solid #d6d6d6;box-sizing:border-box;border-radius:16px}monkeyecx-closed-to-maintenance monkey-modal mecx-monkey-modal .body{margin-bottom:0!important}\n"], components: [{ type: i1.MonkeyModalComponent, selector: "monkey-modal", inputs: ["config", "modalRef", "onHandleConfirm"] }, { type: i1.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i1$1.TranslatePipe, "monkeyecxFormatDateTimelapse": MonkeyEcxFormatDateTimelapsePipe }, encapsulation: i0.ViewEncapsulation.None });
|
|
284
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ClosedToMaintenanceComponent, decorators: [{
|
|
285
|
-
type: Component,
|
|
286
|
-
args: [{ selector: 'monkeyecx-closed-to-maintenance', encapsulation: ViewEncapsulation.None, template: "<monkey-modal [config]=\"config\" [modalRef]=\"modalRef\" *ngIf=\"config\">\n <div class=\"d-flex flex-column justify-content-center align-items-center\">\n <span class=\"h2\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.TITLE' | translate }}\n </span>\n <span class=\"information-title mt-4\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-1' | translate }}\n </span>\n <span class=\"information-title mt-4\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-2' | translate }}\n </span>\n <span class=\"information mt-3\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-3' | translate }}\n {{ _configBoostrap?.maintenance?.endDate | monkeyecxFormatDateTimelapse: true }}\n </span>\n <span class=\"information-title mt-4\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-4' | translate }}\n </span>\n </div>\n <div class=\"d-flex flex-column justify-content-center align-items-center mt-5\">\n <monkey-button type=\"primary\" color=\"theme\" (click)=\"onClose()\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.BUTTONS.UPDATE-MAINTENANCE' | translate }}\n </monkey-button>\n </div>\n</monkey-modal>", styles: ["monkeyecx-closed-to-maintenance .body{padding:24px;width:100%}monkeyecx-closed-to-maintenance .information-title{font-style:normal;font-weight:600;font-size:25px;line-height:32px;display:flex;align-items:center;text-align:center;color:#4b4a53}monkeyecx-closed-to-maintenance .information{font-style:normal;font-weight:400;font-size:20px;line-height:24px;display:flex;align-items:center;text-align:center;color:#4b4a53;max-width:600px}monkeyecx-closed-to-maintenance .browser-name{font-style:normal;font-weight:400;font-size:16px;line-height:24px;text-align:center;color:#9c9ca6}monkeyecx-closed-to-maintenance .option{text-decoration:none;padding:4px;background:#eee;border:1px solid #d6d6d6;box-sizing:border-box;border-radius:16px}monkeyecx-closed-to-maintenance monkey-modal mecx-monkey-modal .body{margin-bottom:0!important}\n"] }]
|
|
287
|
-
}], propDecorators: { config: [{
|
|
288
|
-
type: Input
|
|
289
|
-
}], modalRef: [{
|
|
290
|
-
type: Input
|
|
291
|
-
}] } });
|
|
292
|
-
|
|
293
|
-
class MonkeyEcxDisplayFirstNamePipe {
|
|
294
|
-
transform(name) {
|
|
295
|
-
if (!MonkeyEcxUtils.persistNullEmptyUndefined(name))
|
|
296
|
-
return '';
|
|
297
|
-
return MonkeyEcxUtils.cutFirstLastName(name);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
MonkeyEcxDisplayFirstNamePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDisplayFirstNamePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
301
|
-
MonkeyEcxDisplayFirstNamePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDisplayFirstNamePipe, name: "monkeyecxDisplayFirstName" });
|
|
302
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDisplayFirstNamePipe, decorators: [{
|
|
303
|
-
type: Pipe,
|
|
304
|
-
args: [{
|
|
305
|
-
name: 'monkeyecxDisplayFirstName'
|
|
306
|
-
}]
|
|
307
|
-
}] });
|
|
308
|
-
|
|
309
|
-
class MonkeyEcxFormatAddressPipe {
|
|
310
|
-
transform({ zipCode, address, neighborhood, city, state, }) {
|
|
311
|
-
return [address, neighborhood, zipCode, city, state]
|
|
312
|
-
.filter((_) => {
|
|
313
|
-
return _;
|
|
314
|
-
})
|
|
315
|
-
.join(', ');
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
MonkeyEcxFormatAddressPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatAddressPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
319
|
-
MonkeyEcxFormatAddressPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatAddressPipe, name: "monkeyecxFormatAddress" });
|
|
320
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatAddressPipe, decorators: [{
|
|
321
|
-
type: Pipe,
|
|
322
|
-
args: [{
|
|
323
|
-
name: 'monkeyecxFormatAddress',
|
|
324
|
-
}]
|
|
325
|
-
}] });
|
|
326
|
-
|
|
327
|
-
/* eslint-disable object-curly-newline */
|
|
328
|
-
class MonkeyEcxCookieStorageService {
|
|
329
|
-
constructor(cookieService) {
|
|
330
|
-
this.cookieService = cookieService;
|
|
331
|
-
// not to do
|
|
332
|
-
}
|
|
333
|
-
setCookie(name, value) {
|
|
334
|
-
this.removeCookie(name);
|
|
335
|
-
this.cookieService.set(name, value, undefined, '/', '', true, 'None');
|
|
336
|
-
}
|
|
337
|
-
getCookie(name) {
|
|
338
|
-
return this.cookieService.get(name);
|
|
339
|
-
}
|
|
340
|
-
removeCookie(name) {
|
|
341
|
-
this.cookieService.delete(name, '/');
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
MonkeyEcxCookieStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxCookieStorageService, deps: [{ token: i1$2.CookieService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
345
|
-
MonkeyEcxCookieStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxCookieStorageService, providedIn: 'root' });
|
|
346
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxCookieStorageService, decorators: [{
|
|
347
|
-
type: Injectable,
|
|
348
|
-
args: [{
|
|
349
|
-
providedIn: 'root'
|
|
350
|
-
}]
|
|
351
|
-
}], ctorParameters: function () { return [{ type: i1$2.CookieService }]; } });
|
|
352
|
-
|
|
353
|
-
class MonkeyEcxFormatCurrencyPipe {
|
|
354
|
-
constructor(injector, currencyPipe) {
|
|
355
|
-
this.injector = injector;
|
|
356
|
-
this.currencyPipe = currencyPipe;
|
|
357
|
-
// not to do
|
|
358
|
-
}
|
|
359
|
-
transform(value) {
|
|
360
|
-
const cookieStorageService = this.injector.get(MonkeyEcxCookieStorageService);
|
|
361
|
-
const cookie = cookieStorageService.getCookie('monkey-app-locale');
|
|
362
|
-
const i18n = JSON.parse(atob(cookie));
|
|
363
|
-
const { currency } = i18n;
|
|
364
|
-
return this.currencyPipe.transform(value, currency, 'symbol');
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
MonkeyEcxFormatCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatCurrencyPipe, deps: [{ token: i0.Injector }, { token: i2.CurrencyPipe }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
368
|
-
MonkeyEcxFormatCurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatCurrencyPipe, name: "monkeyecxFormatCurrency" });
|
|
369
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatCurrencyPipe, decorators: [{
|
|
370
|
-
type: Pipe,
|
|
371
|
-
args: [{
|
|
372
|
-
name: 'monkeyecxFormatCurrency'
|
|
373
|
-
}]
|
|
374
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i2.CurrencyPipe }]; } });
|
|
375
|
-
|
|
376
|
-
class MonkeyEcxFormatDocumentPipe {
|
|
377
|
-
transform(document, withType) {
|
|
378
|
-
if (!MonkeyEcxUtils.persistNullEmptyUndefined(document))
|
|
379
|
-
return '';
|
|
380
|
-
return MonkeyEcxUtils.formatDocumentWithMask(document, withType);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
MonkeyEcxFormatDocumentPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDocumentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
384
|
-
MonkeyEcxFormatDocumentPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDocumentPipe, name: "monkeyecxFormatDocument" });
|
|
385
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDocumentPipe, decorators: [{
|
|
386
|
-
type: Pipe,
|
|
387
|
-
args: [{
|
|
388
|
-
name: 'monkeyecxFormatDocument'
|
|
389
|
-
}]
|
|
390
|
-
}] });
|
|
391
|
-
|
|
392
|
-
class MonkeyEcxFormatNumberPipe {
|
|
393
|
-
transform(number) {
|
|
394
|
-
if (!MonkeyEcxUtils.persistNullEmptyUndefined(number))
|
|
395
|
-
return '';
|
|
396
|
-
return formatNumber(Number(number), 'ptbr');
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
MonkeyEcxFormatNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
400
|
-
MonkeyEcxFormatNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatNumberPipe, name: "monkeyecxFormatNumber" });
|
|
401
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatNumberPipe, decorators: [{
|
|
402
|
-
type: Pipe,
|
|
403
|
-
args: [{
|
|
404
|
-
name: 'monkeyecxFormatNumber'
|
|
405
|
-
}]
|
|
406
|
-
}] });
|
|
407
|
-
|
|
408
|
-
class MonkeyEcxFormatPhonePipe {
|
|
409
|
-
transform(phone) {
|
|
410
|
-
if (phone) {
|
|
411
|
-
const value = `${phone || ''}`.replace(/\D/g, '');
|
|
412
|
-
let formated = '';
|
|
413
|
-
if (value.length > 12) {
|
|
414
|
-
formated = value.replace(/(\d{2})?(\d{2})?(\d{5})?(\d{4})/, '+$1 ($2) $3-$4');
|
|
415
|
-
}
|
|
416
|
-
else if (value.length > 11) {
|
|
417
|
-
formated = value.replace(/(\d{2})?(\d{2})?(\d{4})?(\d{4})/, '+$1 ($2) $3-$4');
|
|
418
|
-
}
|
|
419
|
-
else if (value.length > 10) {
|
|
420
|
-
formated = value.replace(/(\d{2})?(\d{5})?(\d{4})/, '($1) $2-$3');
|
|
421
|
-
}
|
|
422
|
-
else if (value.length > 9) {
|
|
423
|
-
formated = value.replace(/(\d{2})?(\d{4})?(\d{4})/, '($1) $2-$3');
|
|
424
|
-
}
|
|
425
|
-
else if (value.length > 5) {
|
|
426
|
-
formated = value.replace(/^(\d{2})?(\d{4})?(\d{0,4})/, '($1) $2-$3');
|
|
427
|
-
}
|
|
428
|
-
else if (value.length > 1) {
|
|
429
|
-
formated = value.replace(/^(\d{2})?(\d{0,5})/, '($1) $2');
|
|
430
|
-
}
|
|
431
|
-
else if (phone !== '') {
|
|
432
|
-
formated = value.replace(/^(\d*)/, '($1');
|
|
433
|
-
}
|
|
434
|
-
return formated;
|
|
435
|
-
}
|
|
436
|
-
return '';
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
MonkeyEcxFormatPhonePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatPhonePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
440
|
-
MonkeyEcxFormatPhonePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatPhonePipe, name: "monkeyecxFormatPhone" });
|
|
441
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatPhonePipe, decorators: [{
|
|
442
|
-
type: Pipe,
|
|
443
|
-
args: [{
|
|
444
|
-
name: 'monkeyecxFormatPhone'
|
|
445
|
-
}]
|
|
446
|
-
}] });
|
|
447
|
-
|
|
448
|
-
class MonkeyEcxFormatSizePipe {
|
|
449
|
-
transform(size) {
|
|
450
|
-
if (!size)
|
|
451
|
-
return '0 B';
|
|
452
|
-
const sizeNum = Number(size);
|
|
453
|
-
return MonkeyEcxUtils.formatFileSize(sizeNum);
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
MonkeyEcxFormatSizePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatSizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
457
|
-
MonkeyEcxFormatSizePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatSizePipe, name: "monkeyecxFormatSize" });
|
|
458
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatSizePipe, decorators: [{
|
|
459
|
-
type: Pipe,
|
|
460
|
-
args: [{
|
|
461
|
-
name: 'monkeyecxFormatSize'
|
|
462
|
-
}]
|
|
463
|
-
}] });
|
|
464
|
-
|
|
465
|
-
class MonkeyEcxFormatDocumentTypePipe {
|
|
466
|
-
transform(document) {
|
|
467
|
-
if (!MonkeyEcxUtils.persistNullEmptyUndefined(document))
|
|
468
|
-
return '';
|
|
469
|
-
return MonkeyEcxUtils.getDocumentType(document);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
MonkeyEcxFormatDocumentTypePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDocumentTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
473
|
-
MonkeyEcxFormatDocumentTypePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDocumentTypePipe, name: "monkeyecxFormatDocumentType" });
|
|
474
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDocumentTypePipe, decorators: [{
|
|
475
|
-
type: Pipe,
|
|
476
|
-
args: [{
|
|
477
|
-
name: 'monkeyecxFormatDocumentType'
|
|
478
|
-
}]
|
|
479
|
-
}] });
|
|
480
|
-
|
|
481
|
-
class MonkeyEcxFormatValue {
|
|
482
|
-
transform(number) {
|
|
483
|
-
if (!MonkeyEcxUtils.persistNullEmptyUndefined(number))
|
|
484
|
-
return '';
|
|
485
|
-
return number;
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
MonkeyEcxFormatValue.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatValue, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
489
|
-
MonkeyEcxFormatValue.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatValue, name: "monkeyecxFormatValue" });
|
|
490
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatValue, decorators: [{
|
|
491
|
-
type: Pipe,
|
|
492
|
-
args: [{
|
|
493
|
-
name: 'monkeyecxFormatValue'
|
|
494
|
-
}]
|
|
495
|
-
}] });
|
|
496
|
-
|
|
497
|
-
class MonkeyEcxFormatZipCodePipe {
|
|
498
|
-
transform(zipCode) {
|
|
499
|
-
if (!MonkeyEcxUtils.persistNullEmptyUndefined(zipCode))
|
|
500
|
-
return '';
|
|
501
|
-
return MonkeyEcxUtils.formatZipCode(zipCode);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
MonkeyEcxFormatZipCodePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatZipCodePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
505
|
-
MonkeyEcxFormatZipCodePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatZipCodePipe, name: "monkeyecxFormatZipCode" });
|
|
506
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatZipCodePipe, decorators: [{
|
|
507
|
-
type: Pipe,
|
|
508
|
-
args: [{
|
|
509
|
-
name: 'monkeyecxFormatZipCode'
|
|
510
|
-
}]
|
|
511
|
-
}] });
|
|
512
|
-
|
|
513
|
-
class MonkeyEcxTextTruncatePipe {
|
|
514
|
-
transform(text, maxLength = 25) {
|
|
515
|
-
const midChar = '...';
|
|
516
|
-
if (!text)
|
|
517
|
-
return midChar;
|
|
518
|
-
if (text && text.length <= maxLength)
|
|
519
|
-
return text;
|
|
520
|
-
const left = Math.ceil(maxLength / 2);
|
|
521
|
-
const right = text.length - left + 1;
|
|
522
|
-
return `${text.substr(0, left)} ${midChar} ${text.substring(right)}`;
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
MonkeyEcxTextTruncatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTextTruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
526
|
-
MonkeyEcxTextTruncatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTextTruncatePipe, name: "monkeyecxTextTruncate" });
|
|
527
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTextTruncatePipe, decorators: [{
|
|
528
|
-
type: Pipe,
|
|
529
|
-
args: [{
|
|
530
|
-
name: 'monkeyecxTextTruncate'
|
|
531
|
-
}]
|
|
532
|
-
}] });
|
|
533
|
-
|
|
534
|
-
class MonkeyEcxTruncateQtdPipe {
|
|
535
|
-
transform(number, threshold) {
|
|
536
|
-
return `${number > threshold ? `${threshold}+` : number}`;
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
MonkeyEcxTruncateQtdPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTruncateQtdPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
540
|
-
MonkeyEcxTruncateQtdPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTruncateQtdPipe, name: "monkeyecxTruncateQtd" });
|
|
541
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTruncateQtdPipe, decorators: [{
|
|
542
|
-
type: Pipe,
|
|
543
|
-
args: [{
|
|
544
|
-
name: 'monkeyecxTruncateQtd'
|
|
545
|
-
}]
|
|
546
|
-
}] });
|
|
547
|
-
|
|
548
|
-
const moment$2 = moment_;
|
|
549
|
-
class MonkeyEcxFormatDateGroupPipe {
|
|
550
|
-
constructor(injector) {
|
|
551
|
-
this.injector = injector;
|
|
552
|
-
this.lang = 'pt-BR';
|
|
553
|
-
const translateService = this.injector.get(TranslateService);
|
|
554
|
-
this.lang = translateService.getDefaultLang();
|
|
555
|
-
}
|
|
556
|
-
format(date) {
|
|
557
|
-
if (!MonkeyEcxUtils.persistNullEmptyUndefined(date))
|
|
558
|
-
return '';
|
|
559
|
-
let stillUtc = moment$2.default.utc(date).toDate();
|
|
560
|
-
if (date.toString()?.indexOf(':') <= -1) {
|
|
561
|
-
stillUtc = date;
|
|
562
|
-
}
|
|
563
|
-
const formatFrom = 'YYYY/MM/DD';
|
|
564
|
-
const fmt = moment$2.default(stillUtc, formatFrom).locale(this.lang);
|
|
565
|
-
const dayFormated = fmt.format('DD/');
|
|
566
|
-
const monthFormated = MonkeyEcxUtils.capitalize(fmt.format('MMMM'));
|
|
567
|
-
const yearFormated = fmt.format('YYYY');
|
|
568
|
-
return `${`${dayFormated}${monthFormated}`.substring(0, 6)}, ${yearFormated}`;
|
|
569
|
-
}
|
|
570
|
-
transform(obj) {
|
|
571
|
-
if (!obj || !obj?.start || !obj?.end)
|
|
572
|
-
return '';
|
|
573
|
-
const { start, end } = obj;
|
|
574
|
-
const formatedStart = this.format(start);
|
|
575
|
-
const formatedEnd = this.format(end);
|
|
576
|
-
return `${formatedStart} - ${formatedEnd}`;
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
MonkeyEcxFormatDateGroupPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDateGroupPipe, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
580
|
-
MonkeyEcxFormatDateGroupPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDateGroupPipe, name: "monkeyecxFormatDateGroup" });
|
|
581
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDateGroupPipe, decorators: [{
|
|
582
|
-
type: Pipe,
|
|
583
|
-
args: [{
|
|
584
|
-
name: 'monkeyecxFormatDateGroup',
|
|
585
|
-
}]
|
|
586
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
587
|
-
|
|
588
|
-
class MonkeyEcxPipesModule {
|
|
589
|
-
}
|
|
590
|
-
MonkeyEcxPipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
591
|
-
MonkeyEcxPipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxPipesModule, declarations: [MonkeyEcxDisplayFirstNamePipe,
|
|
592
|
-
MonkeyEcxFormatAddressPipe,
|
|
593
|
-
MonkeyEcxFormatCurrencyPipe,
|
|
594
|
-
MonkeyEcxFormatDateTimelapsePipe,
|
|
595
|
-
MonkeyEcxFormatDateGroupPipe,
|
|
596
|
-
MonkeyEcxFormatDocumentPipe,
|
|
597
|
-
MonkeyEcxFormatNumberPipe,
|
|
598
|
-
MonkeyEcxFormatPhonePipe,
|
|
599
|
-
MonkeyEcxFormatSizePipe,
|
|
600
|
-
MonkeyEcxFormatDocumentTypePipe,
|
|
601
|
-
MonkeyEcxFormatValue,
|
|
602
|
-
MonkeyEcxFormatZipCodePipe,
|
|
603
|
-
MonkeyEcxTextTruncatePipe,
|
|
604
|
-
MonkeyEcxTruncateQtdPipe], exports: [MonkeyEcxDisplayFirstNamePipe,
|
|
605
|
-
MonkeyEcxFormatAddressPipe,
|
|
606
|
-
MonkeyEcxFormatCurrencyPipe,
|
|
607
|
-
MonkeyEcxFormatDateTimelapsePipe,
|
|
608
|
-
MonkeyEcxFormatDateGroupPipe,
|
|
609
|
-
MonkeyEcxFormatDocumentPipe,
|
|
610
|
-
MonkeyEcxFormatNumberPipe,
|
|
611
|
-
MonkeyEcxFormatPhonePipe,
|
|
612
|
-
MonkeyEcxFormatSizePipe,
|
|
613
|
-
MonkeyEcxFormatDocumentTypePipe,
|
|
614
|
-
MonkeyEcxFormatValue,
|
|
615
|
-
MonkeyEcxFormatZipCodePipe,
|
|
616
|
-
MonkeyEcxTextTruncatePipe,
|
|
617
|
-
MonkeyEcxTruncateQtdPipe] });
|
|
618
|
-
MonkeyEcxPipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxPipesModule, providers: [CurrencyPipe] });
|
|
619
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxPipesModule, decorators: [{
|
|
620
|
-
type: NgModule,
|
|
621
|
-
args: [{
|
|
622
|
-
declarations: [
|
|
623
|
-
MonkeyEcxDisplayFirstNamePipe,
|
|
624
|
-
MonkeyEcxFormatAddressPipe,
|
|
625
|
-
MonkeyEcxFormatCurrencyPipe,
|
|
626
|
-
MonkeyEcxFormatDateTimelapsePipe,
|
|
627
|
-
MonkeyEcxFormatDateGroupPipe,
|
|
628
|
-
MonkeyEcxFormatDocumentPipe,
|
|
629
|
-
MonkeyEcxFormatNumberPipe,
|
|
630
|
-
MonkeyEcxFormatPhonePipe,
|
|
631
|
-
MonkeyEcxFormatSizePipe,
|
|
632
|
-
MonkeyEcxFormatDocumentTypePipe,
|
|
633
|
-
MonkeyEcxFormatValue,
|
|
634
|
-
MonkeyEcxFormatZipCodePipe,
|
|
635
|
-
MonkeyEcxTextTruncatePipe,
|
|
636
|
-
MonkeyEcxTruncateQtdPipe,
|
|
637
|
-
],
|
|
638
|
-
exports: [
|
|
639
|
-
MonkeyEcxDisplayFirstNamePipe,
|
|
640
|
-
MonkeyEcxFormatAddressPipe,
|
|
641
|
-
MonkeyEcxFormatCurrencyPipe,
|
|
642
|
-
MonkeyEcxFormatDateTimelapsePipe,
|
|
643
|
-
MonkeyEcxFormatDateGroupPipe,
|
|
644
|
-
MonkeyEcxFormatDocumentPipe,
|
|
645
|
-
MonkeyEcxFormatNumberPipe,
|
|
646
|
-
MonkeyEcxFormatPhonePipe,
|
|
647
|
-
MonkeyEcxFormatSizePipe,
|
|
648
|
-
MonkeyEcxFormatDocumentTypePipe,
|
|
649
|
-
MonkeyEcxFormatValue,
|
|
650
|
-
MonkeyEcxFormatZipCodePipe,
|
|
651
|
-
MonkeyEcxTextTruncatePipe,
|
|
652
|
-
MonkeyEcxTruncateQtdPipe,
|
|
653
|
-
],
|
|
654
|
-
providers: [CurrencyPipe],
|
|
655
|
-
}]
|
|
656
|
-
}] });
|
|
657
|
-
|
|
658
|
-
class ClosedToMaintenanceModule {
|
|
659
|
-
}
|
|
660
|
-
ClosedToMaintenanceModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ClosedToMaintenanceModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
661
|
-
ClosedToMaintenanceModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ClosedToMaintenanceModule, declarations: [ClosedToMaintenanceComponent], imports: [CommonModule,
|
|
662
|
-
MonkeyButtonModule,
|
|
663
|
-
MonkeyIconModule,
|
|
664
|
-
MonkeyInputModule,
|
|
665
|
-
MonkeyModalModule,
|
|
666
|
-
MonkeyEcxPipesModule, i1$1.TranslateModule], exports: [ClosedToMaintenanceComponent] });
|
|
667
|
-
ClosedToMaintenanceModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ClosedToMaintenanceModule, imports: [[
|
|
668
|
-
CommonModule,
|
|
669
|
-
MonkeyButtonModule,
|
|
670
|
-
MonkeyIconModule,
|
|
671
|
-
MonkeyInputModule,
|
|
672
|
-
MonkeyModalModule,
|
|
673
|
-
MonkeyEcxPipesModule,
|
|
674
|
-
TranslateModule.forChild()
|
|
675
|
-
]] });
|
|
676
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ClosedToMaintenanceModule, decorators: [{
|
|
677
|
-
type: NgModule,
|
|
678
|
-
args: [{
|
|
679
|
-
declarations: [ClosedToMaintenanceComponent],
|
|
680
|
-
imports: [
|
|
681
|
-
CommonModule,
|
|
682
|
-
MonkeyButtonModule,
|
|
683
|
-
MonkeyIconModule,
|
|
684
|
-
MonkeyInputModule,
|
|
685
|
-
MonkeyModalModule,
|
|
686
|
-
MonkeyEcxPipesModule,
|
|
687
|
-
TranslateModule.forChild()
|
|
688
|
-
],
|
|
689
|
-
exports: [ClosedToMaintenanceComponent]
|
|
690
|
-
}]
|
|
691
|
-
}] });
|
|
692
|
-
|
|
693
|
-
class MonkeyEcxProgressBarService {
|
|
694
|
-
constructor(router) {
|
|
695
|
-
this.router = router;
|
|
696
|
-
this.visible = null;
|
|
697
|
-
this.init();
|
|
698
|
-
}
|
|
699
|
-
init() {
|
|
700
|
-
this.visible = new BehaviorSubject(false);
|
|
701
|
-
this.router.events
|
|
702
|
-
.pipe(filter((event) => {
|
|
703
|
-
return event instanceof NavigationStart;
|
|
704
|
-
}))
|
|
705
|
-
.subscribe(() => {
|
|
706
|
-
this.show();
|
|
707
|
-
});
|
|
708
|
-
this.router.events
|
|
709
|
-
.pipe(filter((event) => {
|
|
710
|
-
return (event instanceof NavigationEnd ||
|
|
711
|
-
event instanceof NavigationError ||
|
|
712
|
-
event instanceof NavigationCancel);
|
|
713
|
-
}))
|
|
714
|
-
.subscribe(() => {
|
|
715
|
-
this.hide();
|
|
716
|
-
});
|
|
717
|
-
}
|
|
718
|
-
show() {
|
|
719
|
-
this.visible?.next(true);
|
|
720
|
-
}
|
|
721
|
-
hide() {
|
|
722
|
-
this.visible?.next(false);
|
|
723
|
-
}
|
|
724
|
-
visibleConfig() {
|
|
725
|
-
return this.visible?.asObservable() || null;
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
MonkeyEcxProgressBarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarService, deps: [{ token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
729
|
-
MonkeyEcxProgressBarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarService, providedIn: 'root' });
|
|
730
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarService, decorators: [{
|
|
731
|
-
type: Injectable,
|
|
732
|
-
args: [{
|
|
733
|
-
providedIn: 'root'
|
|
734
|
-
}]
|
|
735
|
-
}], ctorParameters: function () { return [{ type: i1$3.Router }]; } });
|
|
736
|
-
|
|
737
|
-
class MonkeyEcxProgressBarComponent {
|
|
738
|
-
constructor(progressBarService) {
|
|
739
|
-
this.progressBarService = progressBarService;
|
|
740
|
-
this.visible = false;
|
|
741
|
-
//not to do
|
|
742
|
-
}
|
|
743
|
-
ngOnInit() {
|
|
744
|
-
this.progressBarService?.visibleConfig()?.subscribe((visible) => {
|
|
745
|
-
this.visible = visible;
|
|
746
|
-
});
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
MonkeyEcxProgressBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarComponent, deps: [{ token: MonkeyEcxProgressBarService }], target: i0.ɵɵFactoryTarget.Component });
|
|
750
|
-
MonkeyEcxProgressBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxProgressBarComponent, selector: "monkeyecx-progress-bar", ngImport: i0, template: "<ng-container *ngIf=\"visible\">\n <progress class=\"monkey-progress monkey-progress__theme\"></progress>\n</ng-container>\n", styles: ["monkeyecx-progress-bar{position:absolute;width:100%;margin-top:-9.5px;z-index:99998}\n"], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
751
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarComponent, decorators: [{
|
|
752
|
-
type: Component,
|
|
753
|
-
args: [{ selector: 'monkeyecx-progress-bar', encapsulation: ViewEncapsulation.None, template: "<ng-container *ngIf=\"visible\">\n <progress class=\"monkey-progress monkey-progress__theme\"></progress>\n</ng-container>\n", styles: ["monkeyecx-progress-bar{position:absolute;width:100%;margin-top:-9.5px;z-index:99998}\n"] }]
|
|
754
|
-
}], ctorParameters: function () { return [{ type: MonkeyEcxProgressBarService }]; } });
|
|
755
|
-
|
|
756
|
-
class MonkeyEcxProgressBarModule {
|
|
757
|
-
}
|
|
758
|
-
MonkeyEcxProgressBarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
759
|
-
MonkeyEcxProgressBarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarModule, declarations: [MonkeyEcxProgressBarComponent], imports: [CommonModule], exports: [MonkeyEcxProgressBarComponent] });
|
|
760
|
-
MonkeyEcxProgressBarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarModule, imports: [[CommonModule]] });
|
|
761
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarModule, decorators: [{
|
|
762
|
-
type: NgModule,
|
|
763
|
-
args: [{
|
|
764
|
-
declarations: [MonkeyEcxProgressBarComponent],
|
|
765
|
-
imports: [CommonModule],
|
|
766
|
-
exports: [MonkeyEcxProgressBarComponent]
|
|
767
|
-
}]
|
|
768
|
-
}] });
|
|
769
|
-
|
|
770
|
-
class VersionChangedComponent {
|
|
771
|
-
constructor() {
|
|
772
|
-
this.config = null;
|
|
773
|
-
}
|
|
774
|
-
onClose() {
|
|
775
|
-
document.location.reload();
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
VersionChangedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: VersionChangedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
779
|
-
VersionChangedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: VersionChangedComponent, selector: "monkeyecx-version-changed", inputs: { config: "config", modalRef: "modalRef" }, ngImport: i0, template: "<monkey-modal [config]=\"config\" [modalRef]=\"modalRef\" *ngIf=\"config\">\n <div class=\"d-flex flex-column justify-content-center align-items-center\">\n <span class=\"h2\">\n {{ 'SCREENS.VERSION-CHANGED.TITLE' | translate }}\n </span>\n <span class=\"information-title mt-4\">\n {{ 'SCREENS.VERSION-CHANGED.INFORMATION-1' | translate }}\n </span>\n <span class=\"information mt-3\">\n {{ 'SCREENS.VERSION-CHANGED.INFORMATION-2' | translate }}\n </span>\n </div>\n <div class=\"d-flex flex-column justify-content-center align-items-center mt-5\">\n <monkey-button type=\"primary\" color=\"theme\" (click)=\"onClose()\">\n {{ 'SCREENS.VERSION-CHANGED.BUTTONS.UPDATE-VERSION' | translate }}\n </monkey-button>\n </div>\n</monkey-modal>", styles: ["monkeyecx-version-changed .body{padding:24px;width:100%}monkeyecx-version-changed .information-title{font-style:normal;font-weight:600;font-size:25px;line-height:32px;display:flex;align-items:center;text-align:center;color:#4b4a53;max-width:600px}monkeyecx-version-changed .information{font-style:normal;font-weight:400;font-size:20px;line-height:24px;display:flex;align-items:center;text-align:center;color:#4b4a53;max-width:600px}monkeyecx-version-changed .browser-name{font-style:normal;font-weight:400;font-size:16px;line-height:24px;text-align:center;color:#9c9ca6}monkeyecx-version-changed .option{text-decoration:none;padding:4px;background:#eee;border:1px solid #d6d6d6;box-sizing:border-box;border-radius:16px}monkeyecx-version-changed monkey-modal mecx-monkey-modal .body{margin-bottom:0!important}\n"], components: [{ type: i1.MonkeyModalComponent, selector: "monkey-modal", inputs: ["config", "modalRef", "onHandleConfirm"] }, { type: i1.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i1$1.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
|
|
780
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: VersionChangedComponent, decorators: [{
|
|
781
|
-
type: Component,
|
|
782
|
-
args: [{ selector: 'monkeyecx-version-changed', encapsulation: ViewEncapsulation.None, template: "<monkey-modal [config]=\"config\" [modalRef]=\"modalRef\" *ngIf=\"config\">\n <div class=\"d-flex flex-column justify-content-center align-items-center\">\n <span class=\"h2\">\n {{ 'SCREENS.VERSION-CHANGED.TITLE' | translate }}\n </span>\n <span class=\"information-title mt-4\">\n {{ 'SCREENS.VERSION-CHANGED.INFORMATION-1' | translate }}\n </span>\n <span class=\"information mt-3\">\n {{ 'SCREENS.VERSION-CHANGED.INFORMATION-2' | translate }}\n </span>\n </div>\n <div class=\"d-flex flex-column justify-content-center align-items-center mt-5\">\n <monkey-button type=\"primary\" color=\"theme\" (click)=\"onClose()\">\n {{ 'SCREENS.VERSION-CHANGED.BUTTONS.UPDATE-VERSION' | translate }}\n </monkey-button>\n </div>\n</monkey-modal>", styles: ["monkeyecx-version-changed .body{padding:24px;width:100%}monkeyecx-version-changed .information-title{font-style:normal;font-weight:600;font-size:25px;line-height:32px;display:flex;align-items:center;text-align:center;color:#4b4a53;max-width:600px}monkeyecx-version-changed .information{font-style:normal;font-weight:400;font-size:20px;line-height:24px;display:flex;align-items:center;text-align:center;color:#4b4a53;max-width:600px}monkeyecx-version-changed .browser-name{font-style:normal;font-weight:400;font-size:16px;line-height:24px;text-align:center;color:#9c9ca6}monkeyecx-version-changed .option{text-decoration:none;padding:4px;background:#eee;border:1px solid #d6d6d6;box-sizing:border-box;border-radius:16px}monkeyecx-version-changed monkey-modal mecx-monkey-modal .body{margin-bottom:0!important}\n"] }]
|
|
783
|
-
}], propDecorators: { config: [{
|
|
784
|
-
type: Input
|
|
785
|
-
}], modalRef: [{
|
|
786
|
-
type: Input
|
|
787
|
-
}] } });
|
|
788
|
-
|
|
789
|
-
class VersionChangedModule {
|
|
790
|
-
}
|
|
791
|
-
VersionChangedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: VersionChangedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
792
|
-
VersionChangedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: VersionChangedModule, declarations: [VersionChangedComponent], imports: [CommonModule,
|
|
793
|
-
MonkeyButtonModule,
|
|
794
|
-
MonkeyIconModule,
|
|
795
|
-
MonkeyInputModule,
|
|
796
|
-
MonkeyModalModule, i1$1.TranslateModule], exports: [VersionChangedComponent] });
|
|
797
|
-
VersionChangedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: VersionChangedModule, imports: [[
|
|
798
|
-
CommonModule,
|
|
799
|
-
MonkeyButtonModule,
|
|
800
|
-
MonkeyIconModule,
|
|
801
|
-
MonkeyInputModule,
|
|
802
|
-
MonkeyModalModule,
|
|
803
|
-
TranslateModule.forChild()
|
|
804
|
-
]] });
|
|
805
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: VersionChangedModule, decorators: [{
|
|
806
|
-
type: NgModule,
|
|
807
|
-
args: [{
|
|
808
|
-
declarations: [VersionChangedComponent],
|
|
809
|
-
imports: [
|
|
810
|
-
CommonModule,
|
|
811
|
-
MonkeyButtonModule,
|
|
812
|
-
MonkeyIconModule,
|
|
813
|
-
MonkeyInputModule,
|
|
814
|
-
MonkeyModalModule,
|
|
815
|
-
TranslateModule.forChild()
|
|
816
|
-
],
|
|
817
|
-
exports: [VersionChangedComponent]
|
|
818
|
-
}]
|
|
819
|
-
}] });
|
|
820
|
-
|
|
821
|
-
/* eslint-disable space-before-function-paren */
|
|
822
|
-
/* eslint-disable func-names */
|
|
823
|
-
function MonkeyEcxCoreCharts(render = true) {
|
|
824
|
-
return (target, propertyName, propertyDescriptor) => {
|
|
825
|
-
const method = propertyDescriptor.value;
|
|
826
|
-
propertyDescriptor.value = function (...args) {
|
|
827
|
-
const context = this;
|
|
828
|
-
if (render) {
|
|
829
|
-
const scriptsLoaded = Array.from(document.scripts);
|
|
830
|
-
scriptsLoaded.forEach((script) => {
|
|
831
|
-
const { src } = script;
|
|
832
|
-
if (src.search('www.gstatic.com/charts') > 0) {
|
|
833
|
-
document.getElementsByTagName('head')[0].removeChild(script);
|
|
834
|
-
}
|
|
835
|
-
});
|
|
836
|
-
const node = document.createElement('script');
|
|
837
|
-
node.src = 'https://www.gstatic.com/charts/loader.js';
|
|
838
|
-
node.type = 'text/javascript';
|
|
839
|
-
node.async = true;
|
|
840
|
-
node.id = 'monkeyecx-charts-settings';
|
|
841
|
-
node.onload = () => {
|
|
842
|
-
method.apply(context, args);
|
|
843
|
-
};
|
|
844
|
-
document.getElementsByTagName('head')[0].appendChild(node);
|
|
845
|
-
}
|
|
846
|
-
else {
|
|
847
|
-
const scriptsLoaded = Array.from(document.scripts);
|
|
848
|
-
scriptsLoaded.forEach((script) => {
|
|
849
|
-
const { src } = script;
|
|
850
|
-
if (src.search('www.gstatic.com/charts') > 0) {
|
|
851
|
-
document.getElementsByTagName('head')[0].removeChild(script);
|
|
852
|
-
}
|
|
853
|
-
});
|
|
854
|
-
method.apply(context, args);
|
|
855
|
-
}
|
|
856
|
-
};
|
|
857
|
-
return propertyDescriptor;
|
|
858
|
-
};
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
/* eslint-disable max-classes-per-file */
|
|
862
|
-
const moment$1 = moment_;
|
|
863
|
-
class DateValidator {
|
|
864
|
-
static do(control) {
|
|
865
|
-
if (!control.parent || !control)
|
|
866
|
-
return null;
|
|
867
|
-
if (control && control.value) {
|
|
868
|
-
const dateFormat = 'MM-DD-YYYY';
|
|
869
|
-
if (!moment$1
|
|
870
|
-
.default(moment$1.default(control.value).format(dateFormat), ['DD/MM/YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD'], true)
|
|
871
|
-
.isValid()) {
|
|
872
|
-
return {
|
|
873
|
-
invalidDate: true,
|
|
874
|
-
};
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
return null;
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
class DocumentValidator {
|
|
881
|
-
static do(control) {
|
|
882
|
-
if (!control.parent || !control)
|
|
883
|
-
return null;
|
|
884
|
-
if (control && control.value) {
|
|
885
|
-
if (!MonkeyEcxUtils.isCPFCNPJValid(control.value)) {
|
|
886
|
-
return {
|
|
887
|
-
invalidCpfCnpj: true,
|
|
888
|
-
};
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
return null;
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
class DocumentRutValidator {
|
|
895
|
-
static do(control) {
|
|
896
|
-
if (!control.parent || !control)
|
|
897
|
-
return null;
|
|
898
|
-
if (control && control.value) {
|
|
899
|
-
if (!MonkeyEcxUtils.isValidRUT(control.value)) {
|
|
900
|
-
return {
|
|
901
|
-
invalidRut: true,
|
|
902
|
-
};
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
return null;
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
class ZipCodeValidator {
|
|
909
|
-
static do(control) {
|
|
910
|
-
if (!control.parent || !control)
|
|
911
|
-
return null;
|
|
912
|
-
if (control && control.value) {
|
|
913
|
-
if (!MonkeyEcxUtils.isValidZipCode(control.value)) {
|
|
914
|
-
return {
|
|
915
|
-
invalidZipCode: true,
|
|
916
|
-
};
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
return null;
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
class ComboValidator {
|
|
923
|
-
static do(control) {
|
|
924
|
-
if (!control.parent || !control)
|
|
925
|
-
return null;
|
|
926
|
-
if (control && control.value !== '0')
|
|
927
|
-
return null;
|
|
928
|
-
return {
|
|
929
|
-
invalidCombo: true,
|
|
930
|
-
};
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
class isTrueValidator {
|
|
934
|
-
static do(control) {
|
|
935
|
-
if (!control.parent || !control)
|
|
936
|
-
return null;
|
|
937
|
-
if (control && control.value !== false)
|
|
938
|
-
return null;
|
|
939
|
-
return {
|
|
940
|
-
invalidTrue: true,
|
|
941
|
-
};
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
class PasswordMatchValidation {
|
|
945
|
-
static do(control) {
|
|
946
|
-
if (!control.parent || !control)
|
|
947
|
-
return null;
|
|
948
|
-
const { parent } = control;
|
|
949
|
-
const password = parent?.get('password')?.value;
|
|
950
|
-
const passwordConfirm = parent?.get('passwordConfirm')?.value;
|
|
951
|
-
if (!password || !passwordConfirm)
|
|
952
|
-
return null;
|
|
953
|
-
if (password === passwordConfirm)
|
|
954
|
-
return null;
|
|
955
|
-
return {
|
|
956
|
-
passwordsNotMatching: true,
|
|
957
|
-
};
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
class UrlValidator {
|
|
961
|
-
static do(control) {
|
|
962
|
-
if (!control.parent || !control)
|
|
963
|
-
return null;
|
|
964
|
-
if (control && control.value) {
|
|
965
|
-
if (!MonkeyEcxUtils.isValidUrl(control.value)) {
|
|
966
|
-
return {
|
|
967
|
-
invalidUrl: true,
|
|
968
|
-
};
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
return null;
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
class CustomDatesStartValidator {
|
|
975
|
-
static do(control) {
|
|
976
|
-
if (!control.parent || !control)
|
|
977
|
-
return null;
|
|
978
|
-
const { parent } = control;
|
|
979
|
-
const valueStart = parent?.get('dateStart')?.value;
|
|
980
|
-
const valueEnd = parent?.get('dateEnd')?.value;
|
|
981
|
-
let dateStart = null;
|
|
982
|
-
let dateEnd = null;
|
|
983
|
-
if (valueStart) {
|
|
984
|
-
dateStart = new Date(valueStart);
|
|
985
|
-
}
|
|
986
|
-
if (valueEnd) {
|
|
987
|
-
dateEnd = new Date(valueEnd);
|
|
988
|
-
}
|
|
989
|
-
if (!dateStart || !dateEnd)
|
|
990
|
-
return null;
|
|
991
|
-
if (dateStart > dateEnd) {
|
|
992
|
-
return {
|
|
993
|
-
dateStartMustBeLessThanAnd: true,
|
|
994
|
-
};
|
|
995
|
-
}
|
|
996
|
-
return null;
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
class CustomDatesEndValidator {
|
|
1000
|
-
static do(control) {
|
|
1001
|
-
if (!control.parent || !control)
|
|
1002
|
-
return null;
|
|
1003
|
-
const { parent } = control;
|
|
1004
|
-
const valueStart = parent?.get('dateStart')?.value;
|
|
1005
|
-
const valueEnd = parent?.get('dateEnd')?.value;
|
|
1006
|
-
let dateStart = null;
|
|
1007
|
-
let dateEnd = null;
|
|
1008
|
-
if (valueStart) {
|
|
1009
|
-
dateStart = new Date(valueStart);
|
|
1010
|
-
}
|
|
1011
|
-
if (valueEnd) {
|
|
1012
|
-
dateEnd = new Date(valueEnd);
|
|
1013
|
-
}
|
|
1014
|
-
if (!dateEnd || !dateStart)
|
|
1015
|
-
return null;
|
|
1016
|
-
if (dateEnd < dateStart) {
|
|
1017
|
-
return {
|
|
1018
|
-
dateEndMustBeGreaterThanStart: true,
|
|
1019
|
-
};
|
|
1020
|
-
}
|
|
1021
|
-
return null;
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
class UnlockRegisterBuyerValidator {
|
|
1025
|
-
static do(control) {
|
|
1026
|
-
if (!control.parent || !control)
|
|
1027
|
-
return null;
|
|
1028
|
-
if (control && control.value !== '#MONKEYBUYER') {
|
|
1029
|
-
return {
|
|
1030
|
-
invalidUnlockRegister: true,
|
|
1031
|
-
};
|
|
1032
|
-
}
|
|
1033
|
-
return null;
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
class UnlockRegisterSponsorValidator {
|
|
1037
|
-
static do(control) {
|
|
1038
|
-
if (!control.parent || !control)
|
|
1039
|
-
return null;
|
|
1040
|
-
if (control && control.value !== '#MONKEYSPONSOR') {
|
|
1041
|
-
return {
|
|
1042
|
-
invalidUnlockRegister: true,
|
|
1043
|
-
};
|
|
1044
|
-
}
|
|
1045
|
-
return null;
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
class DateRangeValidator {
|
|
1049
|
-
static do(control) {
|
|
1050
|
-
if (!control.parent || !control) {
|
|
1051
|
-
return null;
|
|
1052
|
-
}
|
|
1053
|
-
const dates = control?.parent?.get('dates')?.value;
|
|
1054
|
-
if (dates &&
|
|
1055
|
-
(!MonkeyEcxUtils.persistNullEmptyUndefined(dates.startDate) ||
|
|
1056
|
-
!MonkeyEcxUtils.persistNullEmptyUndefined(dates.endDate))) {
|
|
1057
|
-
return {
|
|
1058
|
-
invalidDateRange: true,
|
|
1059
|
-
};
|
|
1060
|
-
}
|
|
1061
|
-
return null;
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
var validateUtils = /*#__PURE__*/Object.freeze({
|
|
1066
|
-
__proto__: null,
|
|
1067
|
-
DateValidator: DateValidator,
|
|
1068
|
-
DocumentValidator: DocumentValidator,
|
|
1069
|
-
DocumentRutValidator: DocumentRutValidator,
|
|
1070
|
-
ZipCodeValidator: ZipCodeValidator,
|
|
1071
|
-
ComboValidator: ComboValidator,
|
|
1072
|
-
isTrueValidator: isTrueValidator,
|
|
1073
|
-
PasswordMatchValidation: PasswordMatchValidation,
|
|
1074
|
-
UrlValidator: UrlValidator,
|
|
1075
|
-
CustomDatesStartValidator: CustomDatesStartValidator,
|
|
1076
|
-
CustomDatesEndValidator: CustomDatesEndValidator,
|
|
1077
|
-
UnlockRegisterBuyerValidator: UnlockRegisterBuyerValidator,
|
|
1078
|
-
UnlockRegisterSponsorValidator: UnlockRegisterSponsorValidator,
|
|
1079
|
-
DateRangeValidator: DateRangeValidator
|
|
1080
|
-
});
|
|
1081
|
-
|
|
1082
|
-
/* eslint-disable no-unused-vars */
|
|
1083
|
-
/* eslint-disable no-shadow */
|
|
1084
|
-
var MonkeyEcxQueueEvents;
|
|
1085
|
-
(function (MonkeyEcxQueueEvents) {
|
|
1086
|
-
MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["OnGoing"] = 0] = "OnGoing";
|
|
1087
|
-
MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["Finished"] = 1] = "Finished";
|
|
1088
|
-
MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["FinishedWithError"] = 2] = "FinishedWithError";
|
|
1089
|
-
})(MonkeyEcxQueueEvents || (MonkeyEcxQueueEvents = {}));
|
|
1090
|
-
var MonkeyEcxDownloadEvents;
|
|
1091
|
-
(function (MonkeyEcxDownloadEvents) {
|
|
1092
|
-
MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["OnGoing"] = 0] = "OnGoing";
|
|
1093
|
-
MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["Finished"] = 1] = "Finished";
|
|
1094
|
-
MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["FinishedWithError"] = 2] = "FinishedWithError";
|
|
1095
|
-
})(MonkeyEcxDownloadEvents || (MonkeyEcxDownloadEvents = {}));
|
|
1096
|
-
var MonkeyEcxUploadEvents;
|
|
1097
|
-
(function (MonkeyEcxUploadEvents) {
|
|
1098
|
-
MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["OnGoing"] = 0] = "OnGoing";
|
|
1099
|
-
MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["Finished"] = 1] = "Finished";
|
|
1100
|
-
MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["FinishedWithError"] = 2] = "FinishedWithError";
|
|
1101
|
-
})(MonkeyEcxUploadEvents || (MonkeyEcxUploadEvents = {}));
|
|
1102
|
-
// TODO pegar do json de config
|
|
1103
|
-
var ApiEndPointsTokenNotMandatory;
|
|
1104
|
-
(function (ApiEndPointsTokenNotMandatory) {
|
|
1105
|
-
ApiEndPointsTokenNotMandatory["Assets"] = "assets/";
|
|
1106
|
-
ApiEndPointsTokenNotMandatory["MonkeyEcx"] = "/monkeyecx";
|
|
1107
|
-
ApiEndPointsTokenNotMandatory["ViaCep"] = "viacep.com.br/";
|
|
1108
|
-
})(ApiEndPointsTokenNotMandatory || (ApiEndPointsTokenNotMandatory = {}));
|
|
1109
|
-
// TODO pegar do json de config
|
|
1110
|
-
var ApiEndPointsHeaderNotMandatory;
|
|
1111
|
-
(function (ApiEndPointsHeaderNotMandatory) {
|
|
1112
|
-
ApiEndPointsHeaderNotMandatory["Assets"] = "/assets";
|
|
1113
|
-
ApiEndPointsHeaderNotMandatory["PayablesUpload"] = "payables-upload";
|
|
1114
|
-
ApiEndPointsHeaderNotMandatory["PictureUser"] = "/user-pictures";
|
|
1115
|
-
ApiEndPointsHeaderNotMandatory["Documents"] = "documents/";
|
|
1116
|
-
ApiEndPointsHeaderNotMandatory["BuyerTaxFile"] = "/buyer-tax-file";
|
|
1117
|
-
ApiEndPointsHeaderNotMandatory["ViaCep"] = "viacep.com.br/";
|
|
1118
|
-
})(ApiEndPointsHeaderNotMandatory || (ApiEndPointsHeaderNotMandatory = {}));
|
|
1119
|
-
|
|
1120
|
-
var statics = /*#__PURE__*/Object.freeze({
|
|
1121
|
-
__proto__: null,
|
|
1122
|
-
get MonkeyEcxQueueEvents () { return MonkeyEcxQueueEvents; },
|
|
1123
|
-
get MonkeyEcxDownloadEvents () { return MonkeyEcxDownloadEvents; },
|
|
1124
|
-
get MonkeyEcxUploadEvents () { return MonkeyEcxUploadEvents; },
|
|
1125
|
-
get ApiEndPointsTokenNotMandatory () { return ApiEndPointsTokenNotMandatory; },
|
|
1126
|
-
get ApiEndPointsHeaderNotMandatory () { return ApiEndPointsHeaderNotMandatory; }
|
|
1127
|
-
});
|
|
1128
|
-
|
|
1129
|
-
function buildQueuePropertys(queue) {
|
|
1130
|
-
const params = {
|
|
1131
|
-
item: {
|
|
1132
|
-
...queue,
|
|
1133
|
-
id: MonkeyEcxUtils.getRandomString(40)
|
|
1134
|
-
},
|
|
1135
|
-
status: MonkeyEcxQueueEvents.OnGoing
|
|
1136
|
-
};
|
|
1137
|
-
return params;
|
|
1138
|
-
}
|
|
1139
|
-
function buildDownloadPropertys(name, description, size) {
|
|
1140
|
-
const params = {
|
|
1141
|
-
item: {
|
|
1142
|
-
name,
|
|
1143
|
-
description,
|
|
1144
|
-
id: `${MonkeyEcxUtils.getRandomString(40)}`,
|
|
1145
|
-
size,
|
|
1146
|
-
createdAt: new Date()
|
|
1147
|
-
},
|
|
1148
|
-
status: MonkeyEcxQueueEvents.OnGoing
|
|
1149
|
-
};
|
|
1150
|
-
return params;
|
|
1151
|
-
}
|
|
1152
|
-
function buildUploadPropertys(name, description) {
|
|
1153
|
-
const params = {
|
|
1154
|
-
item: {
|
|
1155
|
-
name,
|
|
1156
|
-
description,
|
|
1157
|
-
id: `${MonkeyEcxUtils.getRandomString(40)}`
|
|
1158
|
-
},
|
|
1159
|
-
status: MonkeyEcxUploadEvents.OnGoing
|
|
1160
|
-
};
|
|
1161
|
-
return params;
|
|
1162
|
-
}
|
|
1163
|
-
function hasMonkeyEcxServiceAndHandlingProperties(context) {
|
|
1164
|
-
return Object.prototype.hasOwnProperty.call(context, 'monkeyecxService');
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
var decoratorsUtils = /*#__PURE__*/Object.freeze({
|
|
1168
|
-
__proto__: null,
|
|
1169
|
-
buildQueuePropertys: buildQueuePropertys,
|
|
1170
|
-
buildDownloadPropertys: buildDownloadPropertys,
|
|
1171
|
-
buildUploadPropertys: buildUploadPropertys,
|
|
1172
|
-
hasMonkeyEcxServiceAndHandlingProperties: hasMonkeyEcxServiceAndHandlingProperties
|
|
1173
|
-
});
|
|
1174
|
-
|
|
1175
|
-
const moment = moment_;
|
|
1176
|
-
const EMAIL_REGEXP = /^[\w-.]+@([\w-]+\.)+[\w-]{1,64}$/;
|
|
1177
|
-
function isEmptyInputValue(value) {
|
|
1178
|
-
return value == null || value.length === 0;
|
|
1179
|
-
}
|
|
1180
|
-
function emailValidator(control) {
|
|
1181
|
-
if (!control.parent || !control || isEmptyInputValue(control.value)) {
|
|
1182
|
-
return null;
|
|
1183
|
-
}
|
|
1184
|
-
const test = EMAIL_REGEXP.test(control.value);
|
|
1185
|
-
if (test)
|
|
1186
|
-
return null;
|
|
1187
|
-
return {
|
|
1188
|
-
email: true,
|
|
1189
|
-
};
|
|
1190
|
-
}
|
|
1191
|
-
function dateRangeValidator(control) {
|
|
1192
|
-
if (!control.parent || !control || isEmptyInputValue(control.value)) {
|
|
1193
|
-
return null;
|
|
1194
|
-
}
|
|
1195
|
-
const dates = control?.parent?.get('dates')?.value;
|
|
1196
|
-
if (dates &&
|
|
1197
|
-
(!MonkeyEcxUtils.persistNullEmptyUndefined(dates?.startDate) ||
|
|
1198
|
-
!MonkeyEcxUtils.persistNullEmptyUndefined(dates?.endDate))) {
|
|
1199
|
-
return {
|
|
1200
|
-
dateRange: true,
|
|
1201
|
-
};
|
|
1202
|
-
}
|
|
1203
|
-
return null;
|
|
1204
|
-
}
|
|
1205
|
-
function registerValidator(control, type) {
|
|
1206
|
-
if (!control.parent || !control || isEmptyInputValue(control.value)) {
|
|
1207
|
-
return null;
|
|
1208
|
-
}
|
|
1209
|
-
if (control && control.value !== `#MONKEY${type}`.toUpperCase()) {
|
|
1210
|
-
return {
|
|
1211
|
-
invalidUnlockRegister: true,
|
|
1212
|
-
};
|
|
1213
|
-
}
|
|
1214
|
-
return null;
|
|
1215
|
-
}
|
|
1216
|
-
function dateStartEndValidator(control) {
|
|
1217
|
-
if (!control.parent || !control) {
|
|
1218
|
-
return null;
|
|
1219
|
-
}
|
|
1220
|
-
const { parent } = control;
|
|
1221
|
-
const valueStart = parent?.get('dateStart')?.value;
|
|
1222
|
-
const valueEnd = parent?.get('dateEnd')?.value;
|
|
1223
|
-
let dateStart = null;
|
|
1224
|
-
let dateEnd = null;
|
|
1225
|
-
if (valueStart) {
|
|
1226
|
-
dateStart = new Date(valueStart);
|
|
1227
|
-
}
|
|
1228
|
-
if (valueEnd) {
|
|
1229
|
-
dateEnd = new Date(valueEnd);
|
|
1230
|
-
}
|
|
1231
|
-
if (!dateEnd || !dateStart)
|
|
1232
|
-
return null;
|
|
1233
|
-
if (dateStart > dateEnd) {
|
|
1234
|
-
return {
|
|
1235
|
-
dateStartMustBeLessThanAnd: true,
|
|
1236
|
-
};
|
|
1237
|
-
}
|
|
1238
|
-
return null;
|
|
1239
|
-
}
|
|
1240
|
-
function urlValidator(control) {
|
|
1241
|
-
if (!control.parent || !control || isEmptyInputValue(control.value))
|
|
1242
|
-
return null;
|
|
1243
|
-
if (!MonkeyEcxUtils.isValidUrl(control.value)) {
|
|
1244
|
-
return {
|
|
1245
|
-
url: true,
|
|
1246
|
-
};
|
|
1247
|
-
}
|
|
1248
|
-
return null;
|
|
1249
|
-
}
|
|
1250
|
-
function passwordConfirmValidator(control) {
|
|
1251
|
-
if (!control.parent || !control || isEmptyInputValue(control.value))
|
|
1252
|
-
return null;
|
|
1253
|
-
const { parent } = control;
|
|
1254
|
-
const password = parent?.get('password')?.value;
|
|
1255
|
-
const passwordConfirm = parent?.get('passwordConfirm')?.value;
|
|
1256
|
-
if (!password || !passwordConfirm)
|
|
1257
|
-
return null;
|
|
1258
|
-
if (password === passwordConfirm)
|
|
1259
|
-
return null;
|
|
1260
|
-
return {
|
|
1261
|
-
passwordsNotMatching: true,
|
|
1262
|
-
};
|
|
1263
|
-
}
|
|
1264
|
-
function trueValidator(control) {
|
|
1265
|
-
if (!control.parent || !control)
|
|
1266
|
-
return null;
|
|
1267
|
-
if (control && control.value !== false)
|
|
1268
|
-
return null;
|
|
1269
|
-
return {
|
|
1270
|
-
invalidTrue: true,
|
|
1271
|
-
};
|
|
1272
|
-
}
|
|
1273
|
-
function comboValidator(control) {
|
|
1274
|
-
if (!control.parent || !control)
|
|
1275
|
-
return null;
|
|
1276
|
-
if (control && control.value !== '0')
|
|
1277
|
-
return null;
|
|
1278
|
-
return {
|
|
1279
|
-
invalidCombo: true,
|
|
1280
|
-
};
|
|
1281
|
-
}
|
|
1282
|
-
function zipCodeValidator(control) {
|
|
1283
|
-
if (!control.parent || !control || isEmptyInputValue(control.value))
|
|
1284
|
-
return null;
|
|
1285
|
-
if (control && control.value) {
|
|
1286
|
-
if (!MonkeyEcxUtils.isValidZipCode(control.value)) {
|
|
1287
|
-
return {
|
|
1288
|
-
invalidZipCode: true,
|
|
1289
|
-
};
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
return null;
|
|
1293
|
-
}
|
|
1294
|
-
function documentValidator(control, country) {
|
|
1295
|
-
if (!control.parent || !control || isEmptyInputValue(control.value))
|
|
1296
|
-
return null;
|
|
1297
|
-
if (country === 'BR') {
|
|
1298
|
-
if (!MonkeyEcxUtils.isCPFCNPJValid(control.value)) {
|
|
1299
|
-
return {
|
|
1300
|
-
invalidCpfCnpj: true,
|
|
1301
|
-
};
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
else if (country === 'CL') {
|
|
1305
|
-
if (!MonkeyEcxUtils.isValidRUT(control.value)) {
|
|
1306
|
-
return {
|
|
1307
|
-
invalidCpfCnpj: true,
|
|
1308
|
-
};
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
return null;
|
|
1312
|
-
}
|
|
1313
|
-
function dateValidator(control) {
|
|
1314
|
-
if (!control.parent || !control || isEmptyInputValue(control.value))
|
|
1315
|
-
return null;
|
|
1316
|
-
const dateFormat = 'MM-DD-YYYY';
|
|
1317
|
-
if (!moment
|
|
1318
|
-
.default(moment.default(control.value).format(dateFormat), ['DD/MM/YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD'], true)
|
|
1319
|
-
.isValid()) {
|
|
1320
|
-
return {
|
|
1321
|
-
invalidDate: true,
|
|
1322
|
-
};
|
|
1323
|
-
}
|
|
1324
|
-
return null;
|
|
1325
|
-
}
|
|
1326
|
-
function valueGreaterThanZero(control) {
|
|
1327
|
-
if (!control.parent || !control || isEmptyInputValue(control.value))
|
|
1328
|
-
return null;
|
|
1329
|
-
if (control && `${control?.value}` === '0') {
|
|
1330
|
-
return {
|
|
1331
|
-
invalidValueGreaterThanZero: true,
|
|
1332
|
-
};
|
|
1333
|
-
}
|
|
1334
|
-
return null;
|
|
1335
|
-
}
|
|
1336
|
-
class Validators {
|
|
1337
|
-
static email(control) {
|
|
1338
|
-
return emailValidator(control);
|
|
1339
|
-
}
|
|
1340
|
-
static dateRange(control) {
|
|
1341
|
-
return dateRangeValidator(control);
|
|
1342
|
-
}
|
|
1343
|
-
static unlockSponsorRegister(control) {
|
|
1344
|
-
return registerValidator(control, 'sponsor');
|
|
1345
|
-
}
|
|
1346
|
-
static unlockBuyerRegister(control) {
|
|
1347
|
-
return registerValidator(control, 'buyer');
|
|
1348
|
-
}
|
|
1349
|
-
static dateStartEnd(control) {
|
|
1350
|
-
return dateStartEndValidator(control);
|
|
1351
|
-
}
|
|
1352
|
-
static url(control) {
|
|
1353
|
-
return urlValidator(control);
|
|
1354
|
-
}
|
|
1355
|
-
static passwordConfirm(control) {
|
|
1356
|
-
return passwordConfirmValidator(control);
|
|
1357
|
-
}
|
|
1358
|
-
static true(control) {
|
|
1359
|
-
return trueValidator(control);
|
|
1360
|
-
}
|
|
1361
|
-
static combo(control) {
|
|
1362
|
-
return comboValidator(control);
|
|
1363
|
-
}
|
|
1364
|
-
static zipCode(control) {
|
|
1365
|
-
return zipCodeValidator(control);
|
|
1366
|
-
}
|
|
1367
|
-
static documentBR(control) {
|
|
1368
|
-
return documentValidator(control, 'BR');
|
|
1369
|
-
}
|
|
1370
|
-
static documentCL(control) {
|
|
1371
|
-
return documentValidator(control, 'CL');
|
|
1372
|
-
}
|
|
1373
|
-
static date(control) {
|
|
1374
|
-
return dateValidator(control);
|
|
1375
|
-
}
|
|
1376
|
-
static greaterThanZero(control) {
|
|
1377
|
-
return valueGreaterThanZero(control);
|
|
1378
|
-
}
|
|
1379
|
-
}
|
|
1380
|
-
|
|
1381
|
-
/* eslint-disable object-curly-newline */
|
|
1382
|
-
|
|
1383
|
-
function MonkeyEcxCoreServiceConstructor() {
|
|
1384
|
-
return (target) => {
|
|
1385
|
-
Object.entries(target.prototype).forEach(([key, value]) => {
|
|
1386
|
-
const method = target.prototype[key];
|
|
1387
|
-
if (key !== 'constructor') {
|
|
1388
|
-
target.prototype[key] = function (...args) {
|
|
1389
|
-
const context = this;
|
|
1390
|
-
if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
|
|
1391
|
-
context.monkeyecxService.monkeyecxHandlingService.clearAll();
|
|
1392
|
-
}
|
|
1393
|
-
const result = method.apply(context, args);
|
|
1394
|
-
return result;
|
|
1395
|
-
};
|
|
1396
|
-
}
|
|
1397
|
-
});
|
|
1398
|
-
return target;
|
|
1399
|
-
};
|
|
1400
|
-
}
|
|
1401
|
-
function MonkeyEcxCoreLog(tp) {
|
|
1402
|
-
return function (target, propertyName, propertyDescriptor) {
|
|
1403
|
-
const method = propertyDescriptor.value;
|
|
1404
|
-
propertyDescriptor.value = function (...args) {
|
|
1405
|
-
const params = args
|
|
1406
|
-
.map((a) => {
|
|
1407
|
-
return JSON.stringify(a);
|
|
1408
|
-
})
|
|
1409
|
-
.join();
|
|
1410
|
-
const result = method.apply(this, args);
|
|
1411
|
-
const r = JSON.stringify(result);
|
|
1412
|
-
console.log(`Call: ${propertyName}(${params}) => ${r}`);
|
|
1413
|
-
return result;
|
|
1414
|
-
};
|
|
1415
|
-
return propertyDescriptor;
|
|
1416
|
-
};
|
|
1417
|
-
}
|
|
1418
|
-
function MonkeyEcxCoreClearDecorators() {
|
|
1419
|
-
return function (target, propertyName, propertyDescriptor) {
|
|
1420
|
-
const method = propertyDescriptor.value;
|
|
1421
|
-
propertyDescriptor.value = function (...args) {
|
|
1422
|
-
const context = this;
|
|
1423
|
-
if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
|
|
1424
|
-
context?.monkeyecxService?.monkeyecxHandlingService?.clearAll();
|
|
1425
|
-
}
|
|
1426
|
-
const result = method.apply(context, args);
|
|
1427
|
-
return result;
|
|
1428
|
-
};
|
|
1429
|
-
return propertyDescriptor;
|
|
1430
|
-
};
|
|
1431
|
-
}
|
|
1432
|
-
function MonkeyEcxCoreService(params) {
|
|
1433
|
-
return function (target, propertyName, propertyDescriptor) {
|
|
1434
|
-
const method = propertyDescriptor.value;
|
|
1435
|
-
propertyDescriptor.value = function (...args) {
|
|
1436
|
-
const context = this;
|
|
1437
|
-
if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
|
|
1438
|
-
context?.monkeyecxService?.monkeyecxHandlingService?.clearAll();
|
|
1439
|
-
context?.monkeyecxService?.monkeyecxHandlingService?.setMonkeyEcxServiceCredentials(params);
|
|
1440
|
-
}
|
|
1441
|
-
const result = method.apply(context, args);
|
|
1442
|
-
return result;
|
|
1443
|
-
};
|
|
1444
|
-
return propertyDescriptor;
|
|
1445
|
-
};
|
|
1446
|
-
}
|
|
1447
|
-
function MonkeyEcxCoreServicePaged(params) {
|
|
1448
|
-
return function (target, propertyName, propertyDescriptor) {
|
|
1449
|
-
const method = propertyDescriptor.value;
|
|
1450
|
-
propertyDescriptor.value = function (...args) {
|
|
1451
|
-
const context = this;
|
|
1452
|
-
if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
|
|
1453
|
-
const credentials = context?.monkeyecxService?.monkeyecxHandlingService?.getMonkeyEcxServiceCredentials();
|
|
1454
|
-
let requestPaged = null;
|
|
1455
|
-
if (credentials) {
|
|
1456
|
-
requestPaged = credentials.requestPaged;
|
|
1457
|
-
}
|
|
1458
|
-
context?.monkeyecxService?.monkeyecxHandlingService?.clearAll();
|
|
1459
|
-
context?.monkeyecxService?.monkeyecxHandlingService?.setMonkeyEcxServiceCredentials({
|
|
1460
|
-
...params,
|
|
1461
|
-
...(requestPaged || {}),
|
|
1462
|
-
});
|
|
1463
|
-
}
|
|
1464
|
-
const result = method.apply(context, args);
|
|
1465
|
-
return result;
|
|
1466
|
-
};
|
|
1467
|
-
return propertyDescriptor;
|
|
1468
|
-
};
|
|
1469
|
-
}
|
|
1470
|
-
function MonkeyEcxCoreServiceQueue(name, description, params) {
|
|
1471
|
-
return function (target, propertyName, propertyDescriptor) {
|
|
1472
|
-
const method = propertyDescriptor.value;
|
|
1473
|
-
propertyDescriptor.value = function (...args) {
|
|
1474
|
-
const context = this;
|
|
1475
|
-
if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
|
|
1476
|
-
if (MonkeyEcxUtils.persistNullEmptyUndefined(params)) {
|
|
1477
|
-
context?.monkeyecxService?.monkeyecxHandlingService?.clearAll();
|
|
1478
|
-
context?.monkeyecxService?.monkeyecxHandlingService?.setMonkeyEcxServiceCredentials(params);
|
|
1479
|
-
}
|
|
1480
|
-
context?.monkeyecxService.monkeyecxHandlingService.setMonkeyEcxRequestQueue(buildQueuePropertys({
|
|
1481
|
-
name,
|
|
1482
|
-
description,
|
|
1483
|
-
}));
|
|
1484
|
-
}
|
|
1485
|
-
const result = method.apply(context, args);
|
|
1486
|
-
return result;
|
|
1487
|
-
};
|
|
1488
|
-
return propertyDescriptor;
|
|
1489
|
-
};
|
|
1490
|
-
}
|
|
1491
|
-
|
|
1492
|
-
/* eslint-disable space-before-function-paren */
|
|
1493
|
-
function MonkeyEcxServiceDownload(name, description, params) {
|
|
1494
|
-
return function (target, propertyName, propertyDescriptor) {
|
|
1495
|
-
const method = propertyDescriptor.value;
|
|
1496
|
-
propertyDescriptor.value = function (...args) {
|
|
1497
|
-
const context = this;
|
|
1498
|
-
if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
|
|
1499
|
-
if (MonkeyUtils.persistNullEmptyUndefined(params)) {
|
|
1500
|
-
context?.monkeyecxService?.monkeyecxHandlingService?.clearAll();
|
|
1501
|
-
context?.monkeyecxService?.monkeyecxHandlingService?.setMonkeyEcxServiceCredentials(params);
|
|
1502
|
-
}
|
|
1503
|
-
context?.monkeyecxService?.monkeyecxHandlingService?.setMonkeyEcxRequestDownload({
|
|
1504
|
-
...buildDownloadPropertys(name, description),
|
|
1505
|
-
});
|
|
1506
|
-
}
|
|
1507
|
-
const result = method.apply(context, args);
|
|
1508
|
-
return result;
|
|
1509
|
-
};
|
|
1510
|
-
return propertyDescriptor;
|
|
1511
|
-
};
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
/* eslint-disable space-before-function-paren */
|
|
1515
|
-
function MonkeyEcxServiceUpload(name, description, params) {
|
|
1516
|
-
return function (target, propertyName, propertyDescriptor) {
|
|
1517
|
-
const method = propertyDescriptor.value;
|
|
1518
|
-
propertyDescriptor.value = function (...args) {
|
|
1519
|
-
const context = this;
|
|
1520
|
-
if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
|
|
1521
|
-
if (MonkeyUtils.persistNullEmptyUndefined(params)) {
|
|
1522
|
-
context?.monkeyecxService?.monkeyecxHandlingService?.clearAll();
|
|
1523
|
-
context?.monkeyecxService?.monkeyecxHandlingService?.setMonkeyEcxServiceCredentials(params);
|
|
1524
|
-
}
|
|
1525
|
-
context?.monkeyecxService?.monkeyecxHandlingService?.setMonkeyEcxRequestUpload({
|
|
1526
|
-
...buildUploadPropertys(name, description),
|
|
1527
|
-
});
|
|
1528
|
-
}
|
|
1529
|
-
const result = method.apply(context, args);
|
|
1530
|
-
return result;
|
|
1531
|
-
};
|
|
1532
|
-
return propertyDescriptor;
|
|
1533
|
-
};
|
|
1534
|
-
}
|
|
1535
|
-
|
|
1536
|
-
class MonkeyEcxDragDropDirective {
|
|
1537
|
-
constructor() {
|
|
1538
|
-
this.onFileDropped = new EventEmitter();
|
|
1539
|
-
this.background = '#f5fcff';
|
|
1540
|
-
this.opacity = '1';
|
|
1541
|
-
}
|
|
1542
|
-
onDragOver(evt) {
|
|
1543
|
-
evt?.preventDefault();
|
|
1544
|
-
evt?.stopPropagation();
|
|
1545
|
-
this.background = '#9ecbec';
|
|
1546
|
-
this.opacity = '0.8';
|
|
1547
|
-
}
|
|
1548
|
-
onDragLeave(evt) {
|
|
1549
|
-
evt?.preventDefault();
|
|
1550
|
-
evt?.stopPropagation();
|
|
1551
|
-
this.background = '#f5fcff';
|
|
1552
|
-
this.opacity = '1';
|
|
1553
|
-
}
|
|
1554
|
-
ondrop(evt) {
|
|
1555
|
-
evt?.preventDefault();
|
|
1556
|
-
evt?.stopPropagation();
|
|
1557
|
-
this.background = '#f5fcff';
|
|
1558
|
-
this.opacity = '1';
|
|
1559
|
-
const { files } = evt?.dataTransfer;
|
|
1560
|
-
if (files.length > 0) {
|
|
1561
|
-
this.onFileDropped.emit(files);
|
|
1562
|
-
}
|
|
1563
|
-
}
|
|
1564
|
-
}
|
|
1565
|
-
MonkeyEcxDragDropDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDragDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1566
|
-
MonkeyEcxDragDropDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxDragDropDirective, selector: "[monkeyecxDragDrop]", outputs: { onFileDropped: "onFileDropped" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "ondrop($event)" }, properties: { "style.background-color": "this.background", "style.opacity": "this.opacity" } }, ngImport: i0 });
|
|
1567
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDragDropDirective, decorators: [{
|
|
1568
|
-
type: Directive,
|
|
1569
|
-
args: [{
|
|
1570
|
-
selector: '[monkeyecxDragDrop]',
|
|
1571
|
-
}]
|
|
1572
|
-
}], propDecorators: { onFileDropped: [{
|
|
1573
|
-
type: Output
|
|
1574
|
-
}], background: [{
|
|
1575
|
-
type: HostBinding,
|
|
1576
|
-
args: ['style.background-color']
|
|
1577
|
-
}], opacity: [{
|
|
1578
|
-
type: HostBinding,
|
|
1579
|
-
args: ['style.opacity']
|
|
1580
|
-
}], onDragOver: [{
|
|
1581
|
-
type: HostListener,
|
|
1582
|
-
args: ['dragover', ['$event']]
|
|
1583
|
-
}], onDragLeave: [{
|
|
1584
|
-
type: HostListener,
|
|
1585
|
-
args: ['dragleave', ['$event']]
|
|
1586
|
-
}], ondrop: [{
|
|
1587
|
-
type: HostListener,
|
|
1588
|
-
args: ['drop', ['$event']]
|
|
1589
|
-
}] } });
|
|
1590
|
-
|
|
1591
|
-
class MonkeyEcxFormatCurrency {
|
|
1592
|
-
constructor(elementRef, injector) {
|
|
1593
|
-
this.elementRef = elementRef;
|
|
1594
|
-
this.injector = injector;
|
|
1595
|
-
this.currencyCode = 'BRL';
|
|
1596
|
-
this.currentLocale = 'pt-BR';
|
|
1597
|
-
this.el = this.elementRef.nativeElement;
|
|
1598
|
-
this.currency = this.injector.get(CurrencyPipe);
|
|
1599
|
-
const translateService = this.injector.get(TranslateService);
|
|
1600
|
-
translateService.get('MONKEY-CURRENCY-CODE').subscribe((_) => {
|
|
1601
|
-
this.currencyCode = _;
|
|
1602
|
-
this.currentLocale = translateService.getDefaultLang();
|
|
1603
|
-
});
|
|
1604
|
-
}
|
|
1605
|
-
handle(value) {
|
|
1606
|
-
const { currencyCode, currentLocale } = this;
|
|
1607
|
-
const newValue = MonkeyEcxUtils.handleOnlyNumbers(value);
|
|
1608
|
-
return this.currency.transform(newValue / 100, currencyCode, 'symbol', '', currentLocale);
|
|
1609
|
-
}
|
|
1610
|
-
ngOnInit() {
|
|
1611
|
-
this.el.value = this.handle(this.el.value);
|
|
1612
|
-
}
|
|
1613
|
-
onInput(value) {
|
|
1614
|
-
this.el.value = this.handle(value);
|
|
1615
|
-
}
|
|
1616
|
-
}
|
|
1617
|
-
MonkeyEcxFormatCurrency.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatCurrency, deps: [{ token: i0.ElementRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1618
|
-
MonkeyEcxFormatCurrency.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxFormatCurrency, selector: "[monkeyecxFormatCurrency]", host: { listeners: { "input": "onInput($event.target.value)" } }, providers: [CurrencyPipe], ngImport: i0 });
|
|
1619
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatCurrency, decorators: [{
|
|
1620
|
-
type: Directive,
|
|
1621
|
-
args: [{
|
|
1622
|
-
selector: '[monkeyecxFormatCurrency]',
|
|
1623
|
-
providers: [CurrencyPipe]
|
|
1624
|
-
}]
|
|
1625
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Injector }]; }, propDecorators: { onInput: [{
|
|
1626
|
-
type: HostListener,
|
|
1627
|
-
args: ['input', ['$event.target.value']]
|
|
1628
|
-
}] } });
|
|
1629
|
-
|
|
1630
|
-
class MonkeyEcxFormatUpper {
|
|
1631
|
-
constructor(_el, _renderer) {
|
|
1632
|
-
this._el = _el;
|
|
1633
|
-
this._renderer = _renderer;
|
|
1634
|
-
// not to do
|
|
1635
|
-
}
|
|
1636
|
-
onKeyDown(evt) {
|
|
1637
|
-
const value = this._el.nativeElement.value.toUpperCase();
|
|
1638
|
-
this._renderer.setProperty(this._el.nativeElement, 'value', value);
|
|
1639
|
-
this._onChange?.(value);
|
|
1640
|
-
evt.preventDefault();
|
|
1641
|
-
}
|
|
1642
|
-
onBlur() {
|
|
1643
|
-
this._touched?.();
|
|
1644
|
-
}
|
|
1645
|
-
writeValue(value) {
|
|
1646
|
-
this._renderer.setProperty(this._el.nativeElement, 'value', value);
|
|
1647
|
-
}
|
|
1648
|
-
registerOnChange(fn) {
|
|
1649
|
-
this._onChange = fn;
|
|
1650
|
-
}
|
|
1651
|
-
registerOnTouched(fn) {
|
|
1652
|
-
this._touched = fn;
|
|
1653
|
-
}
|
|
1654
|
-
setDisabledState(isDisabled) {
|
|
1655
|
-
this._renderer.setProperty(this._el.nativeElement, 'disabled', isDisabled);
|
|
1656
|
-
}
|
|
1657
|
-
}
|
|
1658
|
-
MonkeyEcxFormatUpper.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatUpper, deps: [{ token: i0.ElementRef, self: true }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1659
|
-
MonkeyEcxFormatUpper.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxFormatUpper, selector: "[monkeyecxFormatUpper]", host: { listeners: { "keyup": "onKeyDown($event)", "blur": "onBlur($event)" } }, providers: [
|
|
1660
|
-
{
|
|
1661
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1662
|
-
useExisting: forwardRef(() => {
|
|
1663
|
-
// eslint-disable-next-line no-use-before-define
|
|
1664
|
-
return MonkeyEcxFormatUpper;
|
|
1665
|
-
}),
|
|
1666
|
-
multi: true,
|
|
1667
|
-
},
|
|
1668
|
-
], ngImport: i0 });
|
|
1669
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatUpper, decorators: [{
|
|
1670
|
-
type: Directive,
|
|
1671
|
-
args: [{
|
|
1672
|
-
selector: '[monkeyecxFormatUpper]',
|
|
1673
|
-
providers: [
|
|
1674
|
-
{
|
|
1675
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1676
|
-
useExisting: forwardRef(() => {
|
|
1677
|
-
// eslint-disable-next-line no-use-before-define
|
|
1678
|
-
return MonkeyEcxFormatUpper;
|
|
1679
|
-
}),
|
|
1680
|
-
multi: true,
|
|
1681
|
-
},
|
|
1682
|
-
],
|
|
1683
|
-
}]
|
|
1684
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef, decorators: [{
|
|
1685
|
-
type: Self
|
|
1686
|
-
}] }, { type: i0.Renderer2 }]; }, propDecorators: { onKeyDown: [{
|
|
1687
|
-
type: HostListener,
|
|
1688
|
-
args: ['keyup', ['$event']]
|
|
1689
|
-
}], onBlur: [{
|
|
1690
|
-
type: HostListener,
|
|
1691
|
-
args: ['blur', ['$event']]
|
|
1692
|
-
}] } });
|
|
1693
|
-
|
|
1694
|
-
class MonkeyEcxOnlyAlphaNumericDirective {
|
|
1695
|
-
constructor(elementRef) {
|
|
1696
|
-
this.elementRef = elementRef;
|
|
1697
|
-
// not to do
|
|
1698
|
-
}
|
|
1699
|
-
onInputChange(event) {
|
|
1700
|
-
const initalValue = this.elementRef.nativeElement.value;
|
|
1701
|
-
this.elementRef.nativeElement.value = MonkeyEcxUtils.handleOnlyAlphaNumeric(initalValue);
|
|
1702
|
-
if (initalValue !== this.elementRef.nativeElement.value) {
|
|
1703
|
-
event.stopPropagation();
|
|
1704
|
-
}
|
|
1705
|
-
}
|
|
1706
|
-
}
|
|
1707
|
-
MonkeyEcxOnlyAlphaNumericDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxOnlyAlphaNumericDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1708
|
-
MonkeyEcxOnlyAlphaNumericDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxOnlyAlphaNumericDirective, selector: "[monkeyecxOnlyAlphaNumeric]", host: { listeners: { "input": "onInputChange($event)" } }, ngImport: i0 });
|
|
1709
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxOnlyAlphaNumericDirective, decorators: [{
|
|
1710
|
-
type: Directive,
|
|
1711
|
-
args: [{
|
|
1712
|
-
selector: '[monkeyecxOnlyAlphaNumeric]'
|
|
1713
|
-
}]
|
|
1714
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { onInputChange: [{
|
|
1715
|
-
type: HostListener,
|
|
1716
|
-
args: ['input', ['$event']]
|
|
1717
|
-
}] } });
|
|
1718
|
-
|
|
1719
|
-
class MonkeyEcxOnlyNumbersDirective {
|
|
1720
|
-
constructor(elementRef) {
|
|
1721
|
-
this.elementRef = elementRef;
|
|
1722
|
-
// not to do
|
|
1723
|
-
}
|
|
1724
|
-
onInputChange(event) {
|
|
1725
|
-
const initalValue = this.elementRef.nativeElement.value;
|
|
1726
|
-
this.elementRef.nativeElement.value = MonkeyEcxUtils.handleOnlyNumbers(initalValue);
|
|
1727
|
-
if (initalValue !== this.elementRef.nativeElement.value) {
|
|
1728
|
-
event.stopPropagation();
|
|
1729
|
-
}
|
|
1730
|
-
}
|
|
1731
|
-
}
|
|
1732
|
-
MonkeyEcxOnlyNumbersDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxOnlyNumbersDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1733
|
-
MonkeyEcxOnlyNumbersDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxOnlyNumbersDirective, selector: "[monkeyecxOnlyNumbers]", host: { listeners: { "input": "onInputChange($event)" } }, ngImport: i0 });
|
|
1734
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxOnlyNumbersDirective, decorators: [{
|
|
1735
|
-
type: Directive,
|
|
1736
|
-
args: [{
|
|
1737
|
-
selector: '[monkeyecxOnlyNumbers]'
|
|
1738
|
-
}]
|
|
1739
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { onInputChange: [{
|
|
1740
|
-
type: HostListener,
|
|
1741
|
-
args: ['input', ['$event']]
|
|
1742
|
-
}] } });
|
|
1743
|
-
|
|
1744
|
-
class MonkeyEcxRequestPagedHandling {
|
|
1745
|
-
constructor(_url, _pagedParams, _links) {
|
|
1746
|
-
this.url = _url;
|
|
1747
|
-
this.pagedParams = _pagedParams || {
|
|
1748
|
-
page: {},
|
|
1749
|
-
};
|
|
1750
|
-
this.links = _links;
|
|
1751
|
-
}
|
|
1752
|
-
handlePagedValuesFromApi(url = '') {
|
|
1753
|
-
if (url.search('\\?') < 0)
|
|
1754
|
-
return url;
|
|
1755
|
-
const params = url.substring(url.search('\\?') + 1, url.length);
|
|
1756
|
-
url = url.substring(0, url.search('\\?'));
|
|
1757
|
-
return `${url}?${new HttpParams({
|
|
1758
|
-
fromString: params,
|
|
1759
|
-
})
|
|
1760
|
-
.delete('size')
|
|
1761
|
-
.delete('page')
|
|
1762
|
-
.toString()}`;
|
|
1763
|
-
}
|
|
1764
|
-
getUrlParams(url) {
|
|
1765
|
-
const { pagedParams } = this;
|
|
1766
|
-
const { number, size } = pagedParams?.page || {};
|
|
1767
|
-
const hasInitialQueryParams = url.search('\\?') > 0;
|
|
1768
|
-
return `${!hasInitialQueryParams ? '?' : '&'}page=${number || 0}&size=${size || 20}`;
|
|
1769
|
-
}
|
|
1770
|
-
getRequestWithPagedParams() {
|
|
1771
|
-
const { url, links } = this;
|
|
1772
|
-
if (links && links.next) {
|
|
1773
|
-
return links.next.href;
|
|
1774
|
-
}
|
|
1775
|
-
const handled = this.handlePagedValuesFromApi(url);
|
|
1776
|
-
return `${handled}${this.getUrlParams(handled)}`;
|
|
1777
|
-
}
|
|
1778
|
-
}
|
|
1779
|
-
|
|
1780
|
-
class MonkeyEcxCommonsService {
|
|
1781
|
-
constructor(monkeyecxService, tokenStorage, otherArgs) {
|
|
1782
|
-
this.monkeyecxService = monkeyecxService;
|
|
1783
|
-
this.tokenStorage = tokenStorage;
|
|
1784
|
-
this.otherArgs = otherArgs;
|
|
1785
|
-
this.flagValidator = true;
|
|
1786
|
-
this.__error = null;
|
|
1787
|
-
this.__handledError = null;
|
|
1788
|
-
this.__page = null;
|
|
1789
|
-
this.__links = null;
|
|
1790
|
-
this.__requestPaged = null;
|
|
1791
|
-
this.__onSearchChanged$ = new BehaviorSubject(null);
|
|
1792
|
-
this.__onDataChanged$ = new BehaviorSubject(null);
|
|
1793
|
-
this.__onLoadingInProgress$ = new BehaviorSubject(false);
|
|
1794
|
-
this.__onDataDeleted$ = new BehaviorSubject(null);
|
|
1795
|
-
this.__onErrorChanged$ = new BehaviorSubject(null);
|
|
1796
|
-
this.__onGovernmentIdDataChanged$ = new BehaviorSubject(null);
|
|
1797
|
-
this.__onZipCodeDataChanged$ = new BehaviorSubject(null);
|
|
1798
|
-
this.__oni18nDataChanged$ = new BehaviorSubject(null);
|
|
1799
|
-
this.__onDoSearch$ = new BehaviorSubject({});
|
|
1800
|
-
this.__tokenCredentials = null;
|
|
1801
|
-
this.__schedule = null;
|
|
1802
|
-
this.__callbackPagination = () => {
|
|
1803
|
-
// eslint-disable-next-line no-console
|
|
1804
|
-
return console.error('Method callbackPagination needs to be declared');
|
|
1805
|
-
};
|
|
1806
|
-
this.handleInit();
|
|
1807
|
-
}
|
|
1808
|
-
handleInit() {
|
|
1809
|
-
if (this.tokenStorage) {
|
|
1810
|
-
this.__tokenCredentials = this.tokenStorage.getToken();
|
|
1811
|
-
}
|
|
1812
|
-
if (this.otherArgs?.router) {
|
|
1813
|
-
const { clearOnChangeRoute } = this.otherArgs?.schedule?.options || {
|
|
1814
|
-
clearOnChangeRoute: false,
|
|
1815
|
-
};
|
|
1816
|
-
this.otherArgs.router.events
|
|
1817
|
-
.pipe(filter((event) => {
|
|
1818
|
-
return event instanceof NavigationStart;
|
|
1819
|
-
}), take(1))
|
|
1820
|
-
.subscribe(() => {
|
|
1821
|
-
if (this.__schedule && clearOnChangeRoute) {
|
|
1822
|
-
this.otherArgs?.schedule?.service?.removeSchedule(this.__schedule);
|
|
1823
|
-
this.__schedule = null;
|
|
1824
|
-
}
|
|
1825
|
-
});
|
|
1826
|
-
}
|
|
1827
|
-
}
|
|
1828
|
-
getRole() {
|
|
1829
|
-
const { __tokenCredentials } = this;
|
|
1830
|
-
if (!__tokenCredentials)
|
|
1831
|
-
return '';
|
|
1832
|
-
if (__tokenCredentials?.programAdmin === 'true') {
|
|
1833
|
-
return 'PROGRAM_ADMIN';
|
|
1834
|
-
}
|
|
1835
|
-
return __tokenCredentials?.role || '';
|
|
1836
|
-
}
|
|
1837
|
-
allowedSecurityAccess(args) {
|
|
1838
|
-
if (!args)
|
|
1839
|
-
return true;
|
|
1840
|
-
const roles = args?.roles;
|
|
1841
|
-
const byExclusion = args?.byExclusion;
|
|
1842
|
-
const found = roles?.indexOf(this.getRole());
|
|
1843
|
-
let ret = false;
|
|
1844
|
-
if (byExclusion) {
|
|
1845
|
-
ret = true;
|
|
1846
|
-
if (found > -1) {
|
|
1847
|
-
ret = false;
|
|
1848
|
-
}
|
|
1849
|
-
}
|
|
1850
|
-
else {
|
|
1851
|
-
ret = false;
|
|
1852
|
-
if (found > -1) {
|
|
1853
|
-
ret = true;
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
if (!roles || roles.length === 0 || this.getRole() === 'PROGRAM_ADMIN') {
|
|
1857
|
-
ret = true;
|
|
1858
|
-
}
|
|
1859
|
-
return ret;
|
|
1860
|
-
}
|
|
1861
|
-
navigateToErrorPage(statusCode, router) {
|
|
1862
|
-
const routes = {
|
|
1863
|
-
403: 'forbidden',
|
|
1864
|
-
404: 'not-found',
|
|
1865
|
-
500: 'service-problems',
|
|
1866
|
-
503: 'service-problems',
|
|
1867
|
-
};
|
|
1868
|
-
if (!router) {
|
|
1869
|
-
console.error('Router must be declared');
|
|
1870
|
-
}
|
|
1871
|
-
else {
|
|
1872
|
-
router?.navigate([`/app/pages/${routes[statusCode]}`.toLowerCase()], {
|
|
1873
|
-
skipLocationChange: true,
|
|
1874
|
-
});
|
|
1875
|
-
}
|
|
1876
|
-
}
|
|
1877
|
-
setPage(requestPaged) {
|
|
1878
|
-
this.__requestPaged = {
|
|
1879
|
-
...this.__requestPaged,
|
|
1880
|
-
...requestPaged,
|
|
1881
|
-
};
|
|
1882
|
-
return this;
|
|
1883
|
-
}
|
|
1884
|
-
nextPage() {
|
|
1885
|
-
if (this.__links) {
|
|
1886
|
-
return !!this.__links?.next;
|
|
1887
|
-
}
|
|
1888
|
-
if (!this.__requestPaged)
|
|
1889
|
-
return false;
|
|
1890
|
-
const { page } = this.__requestPaged;
|
|
1891
|
-
const { number, totalPages } = page;
|
|
1892
|
-
if (number < totalPages) {
|
|
1893
|
-
this.__requestPaged = {
|
|
1894
|
-
...this.__requestPaged,
|
|
1895
|
-
page: {
|
|
1896
|
-
...page,
|
|
1897
|
-
number: number + 1,
|
|
1898
|
-
},
|
|
1899
|
-
};
|
|
1900
|
-
return true;
|
|
1901
|
-
}
|
|
1902
|
-
return false;
|
|
1903
|
-
}
|
|
1904
|
-
getEmbeddedData(data, field) {
|
|
1905
|
-
const { _embedded } = data;
|
|
1906
|
-
return _embedded ? _embedded[field] : null;
|
|
1907
|
-
}
|
|
1908
|
-
getNormalizedUrl(url) {
|
|
1909
|
-
const { __requestPaged, __links } = this;
|
|
1910
|
-
return new MonkeyEcxRequestPagedHandling(url, __requestPaged || {}, __links).getRequestWithPagedParams();
|
|
1911
|
-
}
|
|
1912
|
-
clear(clearData) {
|
|
1913
|
-
if (clearData) {
|
|
1914
|
-
this.__data = null;
|
|
1915
|
-
this.__requestPaged = null;
|
|
1916
|
-
this.__params = null;
|
|
1917
|
-
this.__page = null;
|
|
1918
|
-
this.__links = null;
|
|
1919
|
-
if (this.__schedule) {
|
|
1920
|
-
const { queue } = this.__schedule;
|
|
1921
|
-
if (queue) {
|
|
1922
|
-
this.otherArgs?.queue?.service?.removeQueueItem(queue);
|
|
1923
|
-
}
|
|
1924
|
-
this.otherArgs?.schedule?.service?.removeSchedule(this.__schedule);
|
|
1925
|
-
this.__schedule = null;
|
|
1926
|
-
}
|
|
1927
|
-
}
|
|
1928
|
-
this.__error = null;
|
|
1929
|
-
this.__handledError = null;
|
|
1930
|
-
this.flagValidator = false;
|
|
1931
|
-
}
|
|
1932
|
-
resolve(route, state, otherArgs) {
|
|
1933
|
-
if (JSON.stringify(route?.queryParams) === '{}') {
|
|
1934
|
-
this.__data = null;
|
|
1935
|
-
this.__page = null;
|
|
1936
|
-
}
|
|
1937
|
-
this.__requestPaged = null;
|
|
1938
|
-
this.flagValidator = true;
|
|
1939
|
-
if (this.tokenStorage) {
|
|
1940
|
-
this.__tokenCredentials = this.tokenStorage.getToken();
|
|
1941
|
-
}
|
|
1942
|
-
if (this.allowedSecurityAccess(otherArgs?.security)) {
|
|
1943
|
-
if (this.__schedule) {
|
|
1944
|
-
this.otherArgs?.schedule?.service?.removeSchedule(this.__schedule);
|
|
1945
|
-
this.__schedule = null;
|
|
1946
|
-
}
|
|
1947
|
-
const { __requestPaged } = this;
|
|
1948
|
-
if (!__requestPaged) {
|
|
1949
|
-
this.setPage({
|
|
1950
|
-
page: {
|
|
1951
|
-
number: 0,
|
|
1952
|
-
size: 10,
|
|
1953
|
-
},
|
|
1954
|
-
});
|
|
1955
|
-
}
|
|
1956
|
-
if (otherArgs?.translateOptions) {
|
|
1957
|
-
const { service, keys } = otherArgs?.translateOptions;
|
|
1958
|
-
this.geti18n(service, keys || '');
|
|
1959
|
-
}
|
|
1960
|
-
if (otherArgs?.callbackPagination) {
|
|
1961
|
-
this.__callbackPagination = otherArgs.callbackPagination;
|
|
1962
|
-
}
|
|
1963
|
-
if (otherArgs?.feature) {
|
|
1964
|
-
const { flag, service } = otherArgs.feature;
|
|
1965
|
-
service.onFlags
|
|
1966
|
-
.pipe(takeWhile(() => {
|
|
1967
|
-
return this.flagValidator;
|
|
1968
|
-
}))
|
|
1969
|
-
.subscribe((val) => {
|
|
1970
|
-
if (val) {
|
|
1971
|
-
const hasFlag = service.getFlag(flag);
|
|
1972
|
-
if (MonkeyEcxUtils.persistNullEmptyUndefined(hasFlag)) {
|
|
1973
|
-
if (!hasFlag) {
|
|
1974
|
-
this.navigateToErrorPage(404, otherArgs?.router);
|
|
1975
|
-
return;
|
|
1976
|
-
}
|
|
1977
|
-
}
|
|
1978
|
-
otherArgs?.callbackMain();
|
|
1979
|
-
}
|
|
1980
|
-
});
|
|
1981
|
-
}
|
|
1982
|
-
else {
|
|
1983
|
-
otherArgs?.callbackMain();
|
|
1984
|
-
}
|
|
1985
|
-
}
|
|
1986
|
-
else {
|
|
1987
|
-
this.navigateToErrorPage(403, otherArgs?.router);
|
|
1988
|
-
}
|
|
1989
|
-
}
|
|
1990
|
-
getHTTPHeaderApplicationPDF() {
|
|
1991
|
-
return {
|
|
1992
|
-
observe: 'response',
|
|
1993
|
-
responseType: 'blob',
|
|
1994
|
-
};
|
|
1995
|
-
}
|
|
1996
|
-
genericMethod(link, data, callback) {
|
|
1997
|
-
const { href, type = 'get' } = link;
|
|
1998
|
-
this.monkeyecxService?.[type.toLowerCase()](`${href}`, data)?.subscribe(() => {
|
|
1999
|
-
if (callback)
|
|
2000
|
-
callback();
|
|
2001
|
-
}, (err) => {
|
|
2002
|
-
throwError(err);
|
|
2003
|
-
});
|
|
2004
|
-
}
|
|
2005
|
-
geti18n(translateService, keys) {
|
|
2006
|
-
translateService.getStreamOnTranslationChange(keys).subscribe((translations) => {
|
|
2007
|
-
this.__i18n = translations;
|
|
2008
|
-
this.__oni18nDataChanged$.next(null);
|
|
2009
|
-
});
|
|
2010
|
-
}
|
|
2011
|
-
doPagination() {
|
|
2012
|
-
if (!this.__onLoadingInProgress$.value) {
|
|
2013
|
-
const hasMorePages = this.setPage({
|
|
2014
|
-
page: {
|
|
2015
|
-
...this.__page,
|
|
2016
|
-
},
|
|
2017
|
-
}).nextPage();
|
|
2018
|
-
if (hasMorePages && this.__callbackPagination) {
|
|
2019
|
-
this.__callbackPagination();
|
|
2020
|
-
}
|
|
2021
|
-
}
|
|
2022
|
-
}
|
|
2023
|
-
setSearchByUrl(router, url, search, extras) {
|
|
2024
|
-
this.__data = null;
|
|
2025
|
-
this.__page = null;
|
|
2026
|
-
this.__onDataChanged$.next(null);
|
|
2027
|
-
this.__onLoadingInProgress$.next(false);
|
|
2028
|
-
router.navigate([url], {
|
|
2029
|
-
queryParams: {
|
|
2030
|
-
...search,
|
|
2031
|
-
r: MonkeyEcxUtils.getRandomString(30),
|
|
2032
|
-
},
|
|
2033
|
-
queryParamsHandling: 'merge',
|
|
2034
|
-
...extras,
|
|
2035
|
-
});
|
|
2036
|
-
}
|
|
2037
|
-
}
|
|
2038
|
-
__decorate([
|
|
2039
|
-
MonkeyEcxCoreService({
|
|
2040
|
-
requestInProgress: {
|
|
2041
|
-
showProgress: true,
|
|
2042
|
-
},
|
|
2043
|
-
})
|
|
2044
|
-
], MonkeyEcxCommonsService.prototype, "genericMethod", null);
|
|
2045
|
-
|
|
2046
|
-
/* eslint-disable max-len */
|
|
2047
|
-
class MonkeyEcxHandlingService {
|
|
2048
|
-
constructor() {
|
|
2049
|
-
this.monkeyecxServiceCredentials = null;
|
|
2050
|
-
this.monkeyecxRequestQueue = null;
|
|
2051
|
-
this.monkeyecxRequestDownload = null;
|
|
2052
|
-
this.monkeyecxRequestUpload = null;
|
|
2053
|
-
}
|
|
2054
|
-
clearAll() {
|
|
2055
|
-
this.monkeyecxServiceCredentials = null;
|
|
2056
|
-
this.monkeyecxRequestQueue = null;
|
|
2057
|
-
this.monkeyecxRequestDownload = null;
|
|
2058
|
-
this.monkeyecxRequestUpload = null;
|
|
2059
|
-
}
|
|
2060
|
-
setMonkeyEcxServiceCredentials(param) {
|
|
2061
|
-
this.monkeyecxServiceCredentials = param;
|
|
2062
|
-
}
|
|
2063
|
-
getMonkeyEcxServiceCredentials() {
|
|
2064
|
-
return this.monkeyecxServiceCredentials;
|
|
2065
|
-
}
|
|
2066
|
-
setMonkeyEcxRequestQueue(queue) {
|
|
2067
|
-
this.monkeyecxRequestQueue = queue;
|
|
2068
|
-
}
|
|
2069
|
-
getMonkeyEcxRequestQueue() {
|
|
2070
|
-
return this.monkeyecxRequestQueue;
|
|
2071
|
-
}
|
|
2072
|
-
setMonkeyEcxRequestDownload(download) {
|
|
2073
|
-
this.monkeyecxRequestDownload = download;
|
|
2074
|
-
}
|
|
2075
|
-
getMonkeyEcxRequestDownload() {
|
|
2076
|
-
return this.monkeyecxRequestDownload;
|
|
2077
|
-
}
|
|
2078
|
-
setMonkeyEcxRequestUpload(upload) {
|
|
2079
|
-
this.monkeyecxRequestUpload = upload;
|
|
2080
|
-
}
|
|
2081
|
-
getMonkeyEcxRequestUpload() {
|
|
2082
|
-
return this.monkeyecxRequestUpload;
|
|
2083
|
-
}
|
|
2084
|
-
}
|
|
2085
|
-
MonkeyEcxHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2086
|
-
MonkeyEcxHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHandlingService, providedIn: 'root' });
|
|
2087
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHandlingService, decorators: [{
|
|
2088
|
-
type: Injectable,
|
|
2089
|
-
args: [{
|
|
2090
|
-
providedIn: 'root'
|
|
2091
|
-
}]
|
|
2092
|
-
}] });
|
|
2093
|
-
|
|
2094
|
-
class MonkeyEcxService {
|
|
2095
|
-
constructor(http, monkeyecxHandlingService) {
|
|
2096
|
-
this.http = http;
|
|
2097
|
-
this.monkeyecxHandlingService = monkeyecxHandlingService;
|
|
2098
|
-
// not to do
|
|
2099
|
-
}
|
|
2100
|
-
handlelize(params) {
|
|
2101
|
-
if (!params) {
|
|
2102
|
-
return params;
|
|
2103
|
-
}
|
|
2104
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
2105
|
-
for (const field of [
|
|
2106
|
-
'createdAt',
|
|
2107
|
-
'createUserId',
|
|
2108
|
-
'updatedAt',
|
|
2109
|
-
'lastUserId',
|
|
2110
|
-
'_links',
|
|
2111
|
-
'governmentIdType',
|
|
2112
|
-
'governmentIdMask',
|
|
2113
|
-
'screenType',
|
|
2114
|
-
'screenTab',
|
|
2115
|
-
]) {
|
|
2116
|
-
delete params[field];
|
|
2117
|
-
}
|
|
2118
|
-
return params;
|
|
2119
|
-
}
|
|
2120
|
-
get(url, options) {
|
|
2121
|
-
return this.http.get(url, options);
|
|
2122
|
-
}
|
|
2123
|
-
post(url, params, options) {
|
|
2124
|
-
return this.http.post(url, params, options);
|
|
2125
|
-
}
|
|
2126
|
-
put(url, params) {
|
|
2127
|
-
return this.http.put(url, this.handlelize({
|
|
2128
|
-
...params,
|
|
2129
|
-
}));
|
|
2130
|
-
}
|
|
2131
|
-
delete(url, params) {
|
|
2132
|
-
return this.http.delete(url, params);
|
|
2133
|
-
}
|
|
2134
|
-
download(url, options, filename) {
|
|
2135
|
-
this.http.get(url, options).subscribe((resp) => {
|
|
2136
|
-
const { headers, body } = resp;
|
|
2137
|
-
const contentType = headers.get('Content-Type');
|
|
2138
|
-
const contentDisposition = headers.get('Content-Disposition');
|
|
2139
|
-
if (contentDisposition) {
|
|
2140
|
-
filename = contentDisposition
|
|
2141
|
-
.split(';')[1]
|
|
2142
|
-
.split('filename')[1]
|
|
2143
|
-
.split('=')[1]
|
|
2144
|
-
.trim()
|
|
2145
|
-
.replace(new RegExp(/"/g), '');
|
|
2146
|
-
}
|
|
2147
|
-
const blob = new Blob([body], {
|
|
2148
|
-
type: `${contentType}`,
|
|
2149
|
-
});
|
|
2150
|
-
return {
|
|
2151
|
-
filename,
|
|
2152
|
-
blob,
|
|
2153
|
-
};
|
|
2154
|
-
}, (err) => {
|
|
2155
|
-
throwError(err);
|
|
2156
|
-
});
|
|
2157
|
-
}
|
|
2158
|
-
downloadOb(url, options, filename) {
|
|
2159
|
-
return this.http.get(url, options).pipe(map((resp) => {
|
|
2160
|
-
const { headers, body } = resp;
|
|
2161
|
-
const contentType = headers.get('Content-Type');
|
|
2162
|
-
const contentDisposition = headers.get('Content-Disposition');
|
|
2163
|
-
if (contentDisposition) {
|
|
2164
|
-
filename = contentDisposition
|
|
2165
|
-
.split(';')[1]
|
|
2166
|
-
.split('filename')[1]
|
|
2167
|
-
.split('=')[1]
|
|
2168
|
-
.trim()
|
|
2169
|
-
.replace(new RegExp(/"/g), '');
|
|
2170
|
-
}
|
|
2171
|
-
const blob = new Blob([body], {
|
|
2172
|
-
type: `${contentType}`,
|
|
2173
|
-
});
|
|
2174
|
-
return {
|
|
2175
|
-
filename,
|
|
2176
|
-
blob,
|
|
2177
|
-
};
|
|
2178
|
-
}), catchError((err) => {
|
|
2179
|
-
return throwError(err);
|
|
2180
|
-
}));
|
|
2181
|
-
}
|
|
2182
|
-
}
|
|
2183
|
-
MonkeyEcxService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxService, deps: [{ token: i1$4.HttpClient }, { token: MonkeyEcxHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2184
|
-
MonkeyEcxService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxService, providedIn: 'root' });
|
|
2185
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxService, decorators: [{
|
|
2186
|
-
type: Injectable,
|
|
2187
|
-
args: [{
|
|
2188
|
-
providedIn: 'root',
|
|
2189
|
-
}]
|
|
2190
|
-
}], ctorParameters: function () { return [{ type: i1$4.HttpClient }, { type: MonkeyEcxHandlingService }]; } });
|
|
2191
|
-
|
|
2192
|
-
let window$1;
|
|
2193
|
-
const text = {
|
|
2194
|
-
i18n: {
|
|
2195
|
-
title: 'We have an quick update for you',
|
|
2196
|
-
message: 'Click anywhere here to reload your locale',
|
|
2197
|
-
},
|
|
2198
|
-
theme: {
|
|
2199
|
-
title: 'We have an quick update for you',
|
|
2200
|
-
message: 'Click anywhere here to reload your theme',
|
|
2201
|
-
},
|
|
2202
|
-
};
|
|
2203
|
-
class MonkeyEcxErrorConfigService {
|
|
2204
|
-
constructor() {
|
|
2205
|
-
// not to do
|
|
2206
|
-
}
|
|
2207
|
-
enableSupport() {
|
|
2208
|
-
window$1.zE('webWidget', 'updateSettings', {
|
|
2209
|
-
webWidget: {
|
|
2210
|
-
color: {
|
|
2211
|
-
theme: '#0273E8',
|
|
2212
|
-
launcherText: '#fff',
|
|
2213
|
-
header: '#0273E8',
|
|
2214
|
-
button: '#0273E8',
|
|
2215
|
-
},
|
|
2216
|
-
zIndex: 99,
|
|
2217
|
-
offset: {
|
|
2218
|
-
horizontal: '1px',
|
|
2219
|
-
vertical: '20px',
|
|
2220
|
-
},
|
|
2221
|
-
mobile: {
|
|
2222
|
-
labelVisible: true,
|
|
2223
|
-
},
|
|
2224
|
-
launcher: {
|
|
2225
|
-
mobile: {
|
|
2226
|
-
labelVisible: true,
|
|
2227
|
-
},
|
|
2228
|
-
},
|
|
2229
|
-
},
|
|
2230
|
-
});
|
|
2231
|
-
window$1.zE('webWidget', 'setLocale', 'en-US');
|
|
2232
|
-
window$1.zE('webWidget', 'show');
|
|
2233
|
-
}
|
|
2234
|
-
apply(type) {
|
|
2235
|
-
const { title, message } = text?.[type];
|
|
2236
|
-
const element = document.createElement('div');
|
|
2237
|
-
element.id = 'monkeyecx-information';
|
|
2238
|
-
const elementImg = document.createElement('img');
|
|
2239
|
-
elementImg.width = 128;
|
|
2240
|
-
elementImg.src = 'assets/images/monkey.svg';
|
|
2241
|
-
elementImg.style.marginBottom = '50px';
|
|
2242
|
-
const elementTitle = document.createElement('span');
|
|
2243
|
-
elementTitle.id = 'title';
|
|
2244
|
-
elementTitle.innerText = title;
|
|
2245
|
-
elementTitle.style.marginBottom = '20px';
|
|
2246
|
-
const elementMessage = document.createElement('span');
|
|
2247
|
-
elementMessage.id = 'message';
|
|
2248
|
-
elementMessage.innerText = message;
|
|
2249
|
-
elementMessage.style.marginBottom = '20px';
|
|
2250
|
-
const elementChat = document.createElement('span');
|
|
2251
|
-
elementChat.id = 'message';
|
|
2252
|
-
elementChat.innerText =
|
|
2253
|
-
"If you're having trouble to update, please use the support icon bellow";
|
|
2254
|
-
element.appendChild(elementImg);
|
|
2255
|
-
element.appendChild(elementTitle);
|
|
2256
|
-
element.appendChild(elementMessage);
|
|
2257
|
-
element.appendChild(elementChat);
|
|
2258
|
-
element.addEventListener('click', () => {
|
|
2259
|
-
document.location.reload();
|
|
2260
|
-
});
|
|
2261
|
-
document.body.appendChild(element);
|
|
2262
|
-
document.body.getElementsByTagName('app-root')[0].remove();
|
|
2263
|
-
this.enableSupport();
|
|
2264
|
-
}
|
|
2265
|
-
}
|
|
2266
|
-
MonkeyEcxErrorConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2267
|
-
MonkeyEcxErrorConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorConfigService, providedIn: 'root' });
|
|
2268
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorConfigService, decorators: [{
|
|
2269
|
-
type: Injectable,
|
|
2270
|
-
args: [{
|
|
2271
|
-
providedIn: 'root',
|
|
2272
|
-
}]
|
|
2273
|
-
}], ctorParameters: function () { return []; } });
|
|
2274
|
-
|
|
2275
|
-
class MonkeyEcxi18nConfigService extends MonkeyEcxCommonsService {
|
|
2276
|
-
constructor(monkeyecxService, translateService, monkeyecxCookieStorageService, monkeyecxErrorConfigService) {
|
|
2277
|
-
super(monkeyecxService);
|
|
2278
|
-
this.translateService = translateService;
|
|
2279
|
-
this.monkeyecxCookieStorageService = monkeyecxCookieStorageService;
|
|
2280
|
-
this.monkeyecxErrorConfigService = monkeyecxErrorConfigService;
|
|
2281
|
-
this.translateService.addLangs(['pt-BR', 'en-US']);
|
|
2282
|
-
this.translateService.setDefaultLang('pt-BR');
|
|
2283
|
-
this.translateService.use('pt-BR');
|
|
2284
|
-
}
|
|
2285
|
-
apply(params, environment, change = false) {
|
|
2286
|
-
const { monkeyecxService, monkeyecxCookieStorageService, monkeyecxErrorConfigService } = this;
|
|
2287
|
-
let { i18n } = params;
|
|
2288
|
-
const externali18n = params?.externali18n?.[`${i18n?.lang || 'pt-BR'}`];
|
|
2289
|
-
const cookie = monkeyecxCookieStorageService.getCookie('monkey-app-locale');
|
|
2290
|
-
if (cookie && !change) {
|
|
2291
|
-
i18n = JSON.parse(atob(cookie));
|
|
2292
|
-
}
|
|
2293
|
-
else {
|
|
2294
|
-
monkeyecxCookieStorageService.setCookie('monkey-app-locale', btoa(JSON.stringify(i18n)));
|
|
2295
|
-
if (!cookie)
|
|
2296
|
-
change = true;
|
|
2297
|
-
}
|
|
2298
|
-
monkeyecxService?.get(`${environment.localAssets}/i18n/${i18n?.lang}.json`)?.subscribe((config) => {
|
|
2299
|
-
const { lang } = config;
|
|
2300
|
-
let { data } = config;
|
|
2301
|
-
if (externali18n) {
|
|
2302
|
-
data = {
|
|
2303
|
-
...data,
|
|
2304
|
-
EXTERNAL: externali18n,
|
|
2305
|
-
};
|
|
2306
|
-
}
|
|
2307
|
-
this.translateService.setTranslation(lang, data, true);
|
|
2308
|
-
this.translateService.use(lang);
|
|
2309
|
-
if (change)
|
|
2310
|
-
document.location.reload();
|
|
2311
|
-
}, (err) => {
|
|
2312
|
-
console.error(`i18n ${i18n?.lang} not found!`);
|
|
2313
|
-
monkeyecxErrorConfigService.apply('i18n');
|
|
2314
|
-
throwError(err);
|
|
2315
|
-
});
|
|
2316
|
-
}
|
|
2317
|
-
}
|
|
2318
|
-
MonkeyEcxi18nConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxi18nConfigService, deps: [{ token: MonkeyEcxService }, { token: i1$1.TranslateService }, { token: MonkeyEcxCookieStorageService }, { token: MonkeyEcxErrorConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2319
|
-
MonkeyEcxi18nConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxi18nConfigService, providedIn: 'root' });
|
|
2320
|
-
__decorate([
|
|
2321
|
-
MonkeyEcxCoreService({
|
|
2322
|
-
httpResponse: {
|
|
2323
|
-
httpCodeIgnore: [404],
|
|
2324
|
-
},
|
|
2325
|
-
requestInProgress: {
|
|
2326
|
-
showProgress: false,
|
|
2327
|
-
},
|
|
2328
|
-
})
|
|
2329
|
-
], MonkeyEcxi18nConfigService.prototype, "apply", null);
|
|
2330
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxi18nConfigService, decorators: [{
|
|
2331
|
-
type: Injectable,
|
|
2332
|
-
args: [{
|
|
2333
|
-
providedIn: 'root',
|
|
2334
|
-
}]
|
|
2335
|
-
}], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: i1$1.TranslateService }, { type: MonkeyEcxCookieStorageService }, { type: MonkeyEcxErrorConfigService }]; }, propDecorators: { apply: [] } });
|
|
2336
|
-
|
|
2337
|
-
class MonkeyEcxLogsConfigService {
|
|
2338
|
-
apply(params, configBoostrap, environment, identifyCode) {
|
|
2339
|
-
const { program, logs } = params;
|
|
2340
|
-
if (logs?.enabled && environment.environment !== 'dev') {
|
|
2341
|
-
datadogRum.init({
|
|
2342
|
-
applicationId: environment?.dataDogApplicationId,
|
|
2343
|
-
clientToken: environment?.dataDogClientToken,
|
|
2344
|
-
service: program?.token,
|
|
2345
|
-
site: 'datadoghq.com',
|
|
2346
|
-
sampleRate: 100,
|
|
2347
|
-
replaySampleRate: 100,
|
|
2348
|
-
env: `monkey-front-${identifyCode}-${environment.environment}`,
|
|
2349
|
-
version: configBoostrap?.version,
|
|
2350
|
-
trackInteractions: true,
|
|
2351
|
-
trackSessionAcrossSubdomains: true,
|
|
2352
|
-
useSecureSessionCookie: true,
|
|
2353
|
-
useCrossSiteSessionCookie: true
|
|
2354
|
-
});
|
|
2355
|
-
datadogRum.startSessionReplayRecording();
|
|
2356
|
-
}
|
|
2357
|
-
}
|
|
2358
|
-
}
|
|
2359
|
-
MonkeyEcxLogsConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxLogsConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2360
|
-
MonkeyEcxLogsConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxLogsConfigService, providedIn: 'root' });
|
|
2361
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxLogsConfigService, decorators: [{
|
|
2362
|
-
type: Injectable,
|
|
2363
|
-
args: [{
|
|
2364
|
-
providedIn: 'root'
|
|
2365
|
-
}]
|
|
2366
|
-
}] });
|
|
2367
|
-
|
|
2368
|
-
class MonkeyEcxServiceWorkerConfigService {
|
|
2369
|
-
constructor(appRef, updates, modalService) {
|
|
2370
|
-
this.appRef = appRef;
|
|
2371
|
-
this.updates = updates;
|
|
2372
|
-
this.modalService = modalService;
|
|
2373
|
-
// not to do
|
|
2374
|
-
}
|
|
2375
|
-
handleValidation(config) {
|
|
2376
|
-
const { updates, modalService } = this;
|
|
2377
|
-
updates?.versionUpdates?.subscribe(() => {
|
|
2378
|
-
if (!config.showNewVersion || config.maintenance.closed) {
|
|
2379
|
-
document.location.reload();
|
|
2380
|
-
}
|
|
2381
|
-
else {
|
|
2382
|
-
modalService.open(VersionChangedComponent, {
|
|
2383
|
-
color: 'theme',
|
|
2384
|
-
size: 'md'
|
|
2385
|
-
});
|
|
2386
|
-
}
|
|
2387
|
-
});
|
|
2388
|
-
}
|
|
2389
|
-
verify() {
|
|
2390
|
-
const { appRef, updates } = this;
|
|
2391
|
-
const appIsStable$ = appRef.isStable
|
|
2392
|
-
.pipe(first((isStable) => { return isStable === true; }));
|
|
2393
|
-
const everyHour$ = interval(1 * 60 * 60 * 1000);
|
|
2394
|
-
const everyHourOnceAppIsStable$ = concat(appIsStable$, everyHour$);
|
|
2395
|
-
everyHourOnceAppIsStable$.subscribe(() => {
|
|
2396
|
-
updates.checkForUpdate();
|
|
2397
|
-
});
|
|
2398
|
-
updates.checkForUpdate();
|
|
2399
|
-
}
|
|
2400
|
-
apply(config) {
|
|
2401
|
-
this.handleValidation(config);
|
|
2402
|
-
this.verify();
|
|
2403
|
-
}
|
|
2404
|
-
}
|
|
2405
|
-
MonkeyEcxServiceWorkerConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxServiceWorkerConfigService, deps: [{ token: i0.ApplicationRef }, { token: i1$5.SwUpdate }, { token: i1.MonkeyStyleGuideModalService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2406
|
-
MonkeyEcxServiceWorkerConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxServiceWorkerConfigService, providedIn: 'root' });
|
|
2407
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxServiceWorkerConfigService, decorators: [{
|
|
2408
|
-
type: Injectable,
|
|
2409
|
-
args: [{
|
|
2410
|
-
providedIn: 'root'
|
|
2411
|
-
}]
|
|
2412
|
-
}], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: i1$5.SwUpdate }, { type: i1.MonkeyStyleGuideModalService }]; } });
|
|
2413
|
-
|
|
2414
|
-
/* eslint-disable no-console */
|
|
2415
|
-
class MonkeyEcxSecurityConsoleConfigService extends MonkeyEcxCommonsService {
|
|
2416
|
-
constructor(translateService) {
|
|
2417
|
-
super();
|
|
2418
|
-
this.translateService = translateService;
|
|
2419
|
-
this.geti18n(this.translateService, 'SERVICES.WARNING.CONSOLE');
|
|
2420
|
-
}
|
|
2421
|
-
handleValidation() {
|
|
2422
|
-
this.__oni18nDataChanged$.subscribe(() => {
|
|
2423
|
-
const { __i18n } = this;
|
|
2424
|
-
const title = __i18n?.TITLE;
|
|
2425
|
-
const message = __i18n?.MESSAGE;
|
|
2426
|
-
if (title) {
|
|
2427
|
-
console.log(`%c${title}`, 'background: #f2f061; color: #ff0000; font-size: x-large');
|
|
2428
|
-
console.log(`%c${message}`, 'font-size: x-large');
|
|
2429
|
-
console.log('%c __ __ _ ______ \n ' +
|
|
2430
|
-
'| \\/ | ___ _ __ | | _____ _ _\\ \\ \\ \\ \n ' +
|
|
2431
|
-
"| |\\/| |/ _ \\| '_ \\| |/ / _ \\ | | |\\ \\ \\ \\ \n " +
|
|
2432
|
-
'| | | | (_) | | | | < __/ |_| |/ / / / \n ' +
|
|
2433
|
-
'|_| |_|\\___/|_| |_|_|\\_\\___|\\__, /_/_/_/ \n ' +
|
|
2434
|
-
' |___/ \n ' +
|
|
2435
|
-
'Join us: https://monkeyecx.gupy.io', 'background: #1976d2; color: #fff');
|
|
2436
|
-
}
|
|
2437
|
-
});
|
|
2438
|
-
}
|
|
2439
|
-
apply() {
|
|
2440
|
-
this.handleValidation();
|
|
2441
|
-
}
|
|
2442
|
-
}
|
|
2443
|
-
MonkeyEcxSecurityConsoleConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxSecurityConsoleConfigService, deps: [{ token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2444
|
-
MonkeyEcxSecurityConsoleConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxSecurityConsoleConfigService, providedIn: 'root' });
|
|
2445
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxSecurityConsoleConfigService, decorators: [{
|
|
2446
|
-
type: Injectable,
|
|
2447
|
-
args: [{
|
|
2448
|
-
providedIn: 'root'
|
|
2449
|
-
}]
|
|
2450
|
-
}], ctorParameters: function () { return [{ type: i1$1.TranslateService }]; } });
|
|
2451
|
-
|
|
2452
|
-
class MonkeyEcxMaintenanceConfigService {
|
|
2453
|
-
constructor(modalService, router) {
|
|
2454
|
-
this.modalService = modalService;
|
|
2455
|
-
this.router = router;
|
|
2456
|
-
// not to do
|
|
2457
|
-
}
|
|
2458
|
-
handleValidation(config) {
|
|
2459
|
-
if (config.maintenance.closed) {
|
|
2460
|
-
localStorage.clear();
|
|
2461
|
-
this.router.navigate(['']);
|
|
2462
|
-
setTimeout(() => {
|
|
2463
|
-
this.modalService.open(ClosedToMaintenanceComponent, {
|
|
2464
|
-
color: 'theme',
|
|
2465
|
-
size: 'md',
|
|
2466
|
-
data: config
|
|
2467
|
-
});
|
|
2468
|
-
}, 200);
|
|
2469
|
-
}
|
|
2470
|
-
}
|
|
2471
|
-
apply(config) {
|
|
2472
|
-
this.handleValidation(config);
|
|
2473
|
-
}
|
|
2474
|
-
}
|
|
2475
|
-
MonkeyEcxMaintenanceConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxMaintenanceConfigService, deps: [{ token: i1.MonkeyStyleGuideModalService }, { token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2476
|
-
MonkeyEcxMaintenanceConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxMaintenanceConfigService, providedIn: 'root' });
|
|
2477
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxMaintenanceConfigService, decorators: [{
|
|
2478
|
-
type: Injectable,
|
|
2479
|
-
args: [{
|
|
2480
|
-
providedIn: 'root'
|
|
2481
|
-
}]
|
|
2482
|
-
}], ctorParameters: function () { return [{ type: i1.MonkeyStyleGuideModalService }, { type: i1$3.Router }]; } });
|
|
2483
|
-
|
|
2484
|
-
class MonkeyEcxFeatureToggleService {
|
|
2485
|
-
constructor() {
|
|
2486
|
-
this.flagSubject$ = new BehaviorSubject(null);
|
|
2487
|
-
this.flags = undefined;
|
|
2488
|
-
this.ldClient = undefined;
|
|
2489
|
-
// not to do
|
|
2490
|
-
}
|
|
2491
|
-
getAllFlags() {
|
|
2492
|
-
if (!this)
|
|
2493
|
-
return;
|
|
2494
|
-
this.flags = this.ldClient?.allFlags();
|
|
2495
|
-
this.flagSubject$.next(true);
|
|
2496
|
-
}
|
|
2497
|
-
identify(config, environment) {
|
|
2498
|
-
if (config) {
|
|
2499
|
-
const email = 'monkey@monkey.exchange';
|
|
2500
|
-
const user = {
|
|
2501
|
-
email,
|
|
2502
|
-
key: `${config.program?.token}#${email}`,
|
|
2503
|
-
};
|
|
2504
|
-
if (!this.ldClient) {
|
|
2505
|
-
this.ldClient = initialize(environment.launchDarklyClientSideID, user, {
|
|
2506
|
-
streaming: true,
|
|
2507
|
-
disableSyncEventPost: true,
|
|
2508
|
-
sendEvents: false,
|
|
2509
|
-
diagnosticOptOut: true,
|
|
2510
|
-
});
|
|
2511
|
-
this.ldClient.on('change', this.getAllFlags.bind(this));
|
|
2512
|
-
this.ldClient.on('ready', this.getAllFlags.bind(this));
|
|
2513
|
-
}
|
|
2514
|
-
else {
|
|
2515
|
-
this.ldClient.identify(user, undefined, this.getAllFlags);
|
|
2516
|
-
}
|
|
2517
|
-
}
|
|
2518
|
-
}
|
|
2519
|
-
apply(configSubject$, environment) {
|
|
2520
|
-
if (environment.launchDarklyClientSideID) {
|
|
2521
|
-
configSubject$.subscribe((config) => {
|
|
2522
|
-
this.identify(config, environment);
|
|
2523
|
-
});
|
|
2524
|
-
}
|
|
2525
|
-
else {
|
|
2526
|
-
this.flagSubject$.next(true);
|
|
2527
|
-
}
|
|
2528
|
-
}
|
|
2529
|
-
get onFlags() {
|
|
2530
|
-
return this.flagSubject$.asObservable();
|
|
2531
|
-
}
|
|
2532
|
-
getFlag(flag) {
|
|
2533
|
-
const flagValue = this.flags?.[flag];
|
|
2534
|
-
return MonkeyUtils.persistNullEmptyUndefined(flagValue) ? flagValue : null;
|
|
2535
|
-
}
|
|
2536
|
-
}
|
|
2537
|
-
MonkeyEcxFeatureToggleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFeatureToggleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2538
|
-
MonkeyEcxFeatureToggleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFeatureToggleService, providedIn: 'root' });
|
|
2539
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFeatureToggleService, decorators: [{
|
|
2540
|
-
type: Injectable,
|
|
2541
|
-
args: [{
|
|
2542
|
-
providedIn: 'root',
|
|
2543
|
-
}]
|
|
2544
|
-
}], ctorParameters: function () { return []; } });
|
|
2545
|
-
|
|
2546
|
-
class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
|
|
2547
|
-
constructor(monkeyecxService, monkeyecxi18nConfigService, monkeyecxLogsConfigService, monkeyStyleGuideSettingsService, monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService) {
|
|
2548
|
-
super(monkeyecxService);
|
|
2549
|
-
this.monkeyecxi18nConfigService = monkeyecxi18nConfigService;
|
|
2550
|
-
this.monkeyecxLogsConfigService = monkeyecxLogsConfigService;
|
|
2551
|
-
this.monkeyStyleGuideSettingsService = monkeyStyleGuideSettingsService;
|
|
2552
|
-
this.monkeyecxServiceWorkerConfigService = monkeyecxServiceWorkerConfigService;
|
|
2553
|
-
this.monkeyecxSecurityConsoleConfigService = monkeyecxSecurityConsoleConfigService;
|
|
2554
|
-
this.monkeyecxMaintenanceConfigService = monkeyecxMaintenanceConfigService;
|
|
2555
|
-
this.monkeyecxErrorConfigService = monkeyecxErrorConfigService;
|
|
2556
|
-
this.monkeyEcxFeatureToggleService = monkeyEcxFeatureToggleService;
|
|
2557
|
-
this.configSubject$ = new BehaviorSubject({});
|
|
2558
|
-
this.configBoostrapSubject$ = new BehaviorSubject({});
|
|
2559
|
-
}
|
|
2560
|
-
internalValidations(...args) {
|
|
2561
|
-
const { monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService, } = this;
|
|
2562
|
-
const configBoostrap = args[0];
|
|
2563
|
-
const callback = args[1];
|
|
2564
|
-
monkeyecxSecurityConsoleConfigService.apply();
|
|
2565
|
-
monkeyecxServiceWorkerConfigService.apply(configBoostrap);
|
|
2566
|
-
monkeyecxMaintenanceConfigService.apply(configBoostrap);
|
|
2567
|
-
callback(configBoostrap);
|
|
2568
|
-
}
|
|
2569
|
-
getWhiteLabelSettings(monkeyecxCode, configBoostrap, callback, environment, identifyCode) {
|
|
2570
|
-
const { monkeyecxService, monkeyecxi18nConfigService, configSubject$, monkeyStyleGuideSettingsService, monkeyecxLogsConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService, internalValidations, } = this;
|
|
2571
|
-
const url = `${environment.urlAssets}`;
|
|
2572
|
-
monkeyecxService
|
|
2573
|
-
?.get(`${url}/${monkeyecxCode.toLowerCase()}/white-label.json?t=${MonkeyUtils.getRandomString(30)}`)
|
|
2574
|
-
?.subscribe((config) => {
|
|
2575
|
-
monkeyecxi18nConfigService.apply(config, environment);
|
|
2576
|
-
monkeyecxLogsConfigService.apply(config, configBoostrap, environment, identifyCode);
|
|
2577
|
-
monkeyEcxFeatureToggleService.apply(configSubject$, environment);
|
|
2578
|
-
monkeyStyleGuideSettingsService.boostrap(`${url}/${monkeyecxCode.toLowerCase()}/monkey-style-guide-settings.json?t=${MonkeyUtils.getRandomString(30)}`, internalValidations.bind(this, configBoostrap, callback, environment));
|
|
2579
|
-
configSubject$.next(config);
|
|
2580
|
-
}, (err) => {
|
|
2581
|
-
monkeyecxErrorConfigService.apply('theme');
|
|
2582
|
-
console.error('Program Configuration not found!');
|
|
2583
|
-
throwError(err);
|
|
2584
|
-
});
|
|
2585
|
-
}
|
|
2586
|
-
init(callback, environment, identifyCode, monkeyecxCode) {
|
|
2587
|
-
const { monkeyecxService, configBoostrapSubject$, monkeyecxErrorConfigService } = this;
|
|
2588
|
-
monkeyecxService
|
|
2589
|
-
?.get(`${environment.boostrapAssets}?t=${MonkeyUtils.getRandomString(30)}`, {
|
|
2590
|
-
observe: 'response',
|
|
2591
|
-
})
|
|
2592
|
-
?.subscribe((resp) => {
|
|
2593
|
-
const { headers, body } = resp;
|
|
2594
|
-
const monkeyCode = headers.get('monkey-code') || monkeyecxCode;
|
|
2595
|
-
if (monkeyCode) {
|
|
2596
|
-
this.getWhiteLabelSettings(monkeyCode, body, callback, environment, identifyCode);
|
|
2597
|
-
configBoostrapSubject$.next(body);
|
|
2598
|
-
}
|
|
2599
|
-
else {
|
|
2600
|
-
monkeyecxErrorConfigService.apply('theme');
|
|
2601
|
-
console.error(`Boostrap ${monkeyCode} Configuration not found!`);
|
|
2602
|
-
}
|
|
2603
|
-
}, (err) => {
|
|
2604
|
-
monkeyecxErrorConfigService.apply('theme');
|
|
2605
|
-
console.error('Boostrap Configuration not found!');
|
|
2606
|
-
throwError(err);
|
|
2607
|
-
});
|
|
2608
|
-
}
|
|
2609
|
-
config() {
|
|
2610
|
-
return this.configSubject$.asObservable();
|
|
2611
|
-
}
|
|
2612
|
-
boostrapConfig() {
|
|
2613
|
-
return this.configBoostrapSubject$.asObservable();
|
|
2614
|
-
}
|
|
2615
|
-
}
|
|
2616
|
-
MonkeyEcxConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxConfigService, deps: [{ token: MonkeyEcxService }, { token: MonkeyEcxi18nConfigService }, { token: MonkeyEcxLogsConfigService }, { token: i1.MonkeyStyleGuideSettingsService }, { token: MonkeyEcxServiceWorkerConfigService }, { token: MonkeyEcxSecurityConsoleConfigService }, { token: MonkeyEcxMaintenanceConfigService }, { token: MonkeyEcxErrorConfigService }, { token: MonkeyEcxFeatureToggleService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2617
|
-
MonkeyEcxConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxConfigService, providedIn: 'root' });
|
|
2618
|
-
__decorate([
|
|
2619
|
-
MonkeyEcxCoreService({
|
|
2620
|
-
httpResponse: {
|
|
2621
|
-
httpCodeIgnore: [404],
|
|
2622
|
-
},
|
|
2623
|
-
requestInProgress: {
|
|
2624
|
-
showProgress: false,
|
|
2625
|
-
},
|
|
2626
|
-
})
|
|
2627
|
-
], MonkeyEcxConfigService.prototype, "init", null);
|
|
2628
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxConfigService, decorators: [{
|
|
2629
|
-
type: Injectable,
|
|
2630
|
-
args: [{
|
|
2631
|
-
providedIn: 'root',
|
|
2632
|
-
}]
|
|
2633
|
-
}], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxi18nConfigService }, { type: MonkeyEcxLogsConfigService }, { type: i1.MonkeyStyleGuideSettingsService }, { type: MonkeyEcxServiceWorkerConfigService }, { type: MonkeyEcxSecurityConsoleConfigService }, { type: MonkeyEcxMaintenanceConfigService }, { type: MonkeyEcxErrorConfigService }, { type: MonkeyEcxFeatureToggleService }]; }, propDecorators: { init: [] } });
|
|
2634
|
-
|
|
2635
|
-
class MonkeyEcxTokenStorageService {
|
|
2636
|
-
constructor(monkeyecxConfigService) {
|
|
2637
|
-
this.monkeyecxConfigService = monkeyecxConfigService;
|
|
2638
|
-
this.config = null;
|
|
2639
|
-
this.token = {
|
|
2640
|
-
username: '',
|
|
2641
|
-
program: '',
|
|
2642
|
-
accessToken: '',
|
|
2643
|
-
refreshToken: '',
|
|
2644
|
-
companyId: '',
|
|
2645
|
-
governmentId: '',
|
|
2646
|
-
companyTypeUrl: '',
|
|
2647
|
-
companyType: '',
|
|
2648
|
-
programAdmin: false,
|
|
2649
|
-
programType: '',
|
|
2650
|
-
accessType: '',
|
|
2651
|
-
role: '',
|
|
2652
|
-
_clearIgnore: {
|
|
2653
|
-
ignore: ['username', 'program', 'accessType'],
|
|
2654
|
-
},
|
|
2655
|
-
};
|
|
2656
|
-
this.token$ = new BehaviorSubject(null);
|
|
2657
|
-
this.me$ = new BehaviorSubject(null);
|
|
2658
|
-
this.monkeyecxConfigService.config().subscribe((_) => {
|
|
2659
|
-
this.config = _;
|
|
2660
|
-
});
|
|
2661
|
-
}
|
|
2662
|
-
setAllTokens(token) {
|
|
2663
|
-
const { token$ } = this;
|
|
2664
|
-
Object.entries(token).forEach(([key, value]) => {
|
|
2665
|
-
if (MonkeyEcxUtils.persistNullEmptyUndefined(value)) {
|
|
2666
|
-
localStorage.setItem(key, value);
|
|
2667
|
-
}
|
|
2668
|
-
});
|
|
2669
|
-
token$.next(token);
|
|
2670
|
-
}
|
|
2671
|
-
getAllTokens() {
|
|
2672
|
-
const { token, config } = this;
|
|
2673
|
-
const handledToken = {
|
|
2674
|
-
...token,
|
|
2675
|
-
};
|
|
2676
|
-
Object.entries(token || {}).forEach(([key, value]) => {
|
|
2677
|
-
handledToken[key] = localStorage.getItem(key);
|
|
2678
|
-
});
|
|
2679
|
-
if (!handledToken?.program && config?.program) {
|
|
2680
|
-
handledToken.program = config?.program?.token;
|
|
2681
|
-
}
|
|
2682
|
-
return handledToken;
|
|
2683
|
-
}
|
|
2684
|
-
setAllMe(me) {
|
|
2685
|
-
const { me$ } = this;
|
|
2686
|
-
let previousMe = JSON.parse(localStorage?.getItem('me') || '{}');
|
|
2687
|
-
Object.entries(me).forEach(([key, value]) => {
|
|
2688
|
-
if (MonkeyEcxUtils.persistNullEmptyUndefined(value)) {
|
|
2689
|
-
previousMe = {
|
|
2690
|
-
...previousMe,
|
|
2691
|
-
[key]: value,
|
|
2692
|
-
};
|
|
2693
|
-
}
|
|
2694
|
-
});
|
|
2695
|
-
localStorage.setItem('me', JSON.stringify(previousMe));
|
|
2696
|
-
me$.next(previousMe);
|
|
2697
|
-
}
|
|
2698
|
-
getAllMe() {
|
|
2699
|
-
const me = localStorage.getItem('me');
|
|
2700
|
-
return JSON.parse(me || '{}');
|
|
2701
|
-
}
|
|
2702
|
-
tokenHasChanged() {
|
|
2703
|
-
return this.token$.asObservable();
|
|
2704
|
-
}
|
|
2705
|
-
meHasChanged() {
|
|
2706
|
-
return this.me$.asObservable() || null;
|
|
2707
|
-
}
|
|
2708
|
-
getToken() {
|
|
2709
|
-
return this.getAllTokens();
|
|
2710
|
-
}
|
|
2711
|
-
getMe() {
|
|
2712
|
-
return this.getAllMe();
|
|
2713
|
-
}
|
|
2714
|
-
setToken(token) {
|
|
2715
|
-
this.setAllTokens(token);
|
|
2716
|
-
}
|
|
2717
|
-
setMe(me) {
|
|
2718
|
-
this.setAllMe(me);
|
|
2719
|
-
}
|
|
2720
|
-
clear(force) {
|
|
2721
|
-
const { token } = this;
|
|
2722
|
-
try {
|
|
2723
|
-
Object.entries(token || {}).forEach(([key, value]) => {
|
|
2724
|
-
if ((token?._clearIgnore?.ignore || []).filter((val) => {
|
|
2725
|
-
return val === key;
|
|
2726
|
-
}).length <= 0 ||
|
|
2727
|
-
force === true) {
|
|
2728
|
-
localStorage.removeItem(key);
|
|
2729
|
-
}
|
|
2730
|
-
});
|
|
2731
|
-
localStorage.removeItem('me');
|
|
2732
|
-
}
|
|
2733
|
-
catch (error) {
|
|
2734
|
-
return of(false);
|
|
2735
|
-
}
|
|
2736
|
-
return of(true);
|
|
2737
|
-
}
|
|
2738
|
-
/**
|
|
2739
|
-
* @param fields (the name of fields you want to clear. ie: ['companyId', 'role', ...])
|
|
2740
|
-
*/
|
|
2741
|
-
clearCredentials(fields = ['companyId', 'governmentId', 'companyType', 'programAdmin', 'role']) {
|
|
2742
|
-
fields?.forEach((key) => {
|
|
2743
|
-
localStorage.removeItem(key);
|
|
2744
|
-
});
|
|
2745
|
-
}
|
|
2746
|
-
}
|
|
2747
|
-
MonkeyEcxTokenStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTokenStorageService, deps: [{ token: MonkeyEcxConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2748
|
-
MonkeyEcxTokenStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTokenStorageService, providedIn: 'root' });
|
|
2749
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTokenStorageService, decorators: [{
|
|
2750
|
-
type: Injectable,
|
|
2751
|
-
args: [{
|
|
2752
|
-
providedIn: 'root',
|
|
2753
|
-
}]
|
|
2754
|
-
}], ctorParameters: function () { return [{ type: MonkeyEcxConfigService }]; } });
|
|
2755
|
-
|
|
2756
|
-
class MonkeyEcxSecurityDirective {
|
|
2757
|
-
constructor(elementRef, tokenStorageService, cdr) {
|
|
2758
|
-
this.elementRef = elementRef;
|
|
2759
|
-
this.tokenStorageService = tokenStorageService;
|
|
2760
|
-
this.cdr = cdr;
|
|
2761
|
-
this.roles = [];
|
|
2762
|
-
this.byExclusion = false;
|
|
2763
|
-
this.tokenCredentials = null;
|
|
2764
|
-
// not to do
|
|
2765
|
-
}
|
|
2766
|
-
getRole() {
|
|
2767
|
-
const { tokenCredentials } = this;
|
|
2768
|
-
if (!tokenCredentials)
|
|
2769
|
-
return '';
|
|
2770
|
-
if (tokenCredentials?.programAdmin === 'true') {
|
|
2771
|
-
return 'PROGRAM_ADMIN';
|
|
2772
|
-
}
|
|
2773
|
-
return tokenCredentials?.role || '';
|
|
2774
|
-
}
|
|
2775
|
-
handleAccess() {
|
|
2776
|
-
const { roles, byExclusion } = this;
|
|
2777
|
-
let display = 'none';
|
|
2778
|
-
const found = roles?.indexOf(this.getRole());
|
|
2779
|
-
if (byExclusion) {
|
|
2780
|
-
display = 'block';
|
|
2781
|
-
if (found > -1) {
|
|
2782
|
-
display = 'none';
|
|
2783
|
-
}
|
|
2784
|
-
}
|
|
2785
|
-
else {
|
|
2786
|
-
display = 'none';
|
|
2787
|
-
if (found > -1) {
|
|
2788
|
-
display = 'block';
|
|
2789
|
-
}
|
|
2790
|
-
}
|
|
2791
|
-
if (!roles || roles.length === 0 || this.getRole() === 'PROGRAM_ADMIN')
|
|
2792
|
-
display = 'block';
|
|
2793
|
-
this.elementRef.nativeElement.style.display = display;
|
|
2794
|
-
this.cdr.detectChanges();
|
|
2795
|
-
}
|
|
2796
|
-
ngOnInit() {
|
|
2797
|
-
this.elementRef.nativeElement.style.display = 'none';
|
|
2798
|
-
this.cdr.detectChanges();
|
|
2799
|
-
this.tokenStorageService.tokenHasChanged().subscribe(() => {
|
|
2800
|
-
this.tokenCredentials = this.tokenStorageService.getToken();
|
|
2801
|
-
this.handleAccess();
|
|
2802
|
-
});
|
|
2803
|
-
this.tokenCredentials = this.tokenStorageService.getToken();
|
|
2804
|
-
this.handleAccess();
|
|
2805
|
-
}
|
|
2806
|
-
}
|
|
2807
|
-
MonkeyEcxSecurityDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxSecurityDirective, deps: [{ token: i0.ElementRef }, { token: MonkeyEcxTokenStorageService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2808
|
-
MonkeyEcxSecurityDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxSecurityDirective, selector: "[monkeyecxSecurity]", inputs: { roles: ["securityRoles", "roles"], byExclusion: ["securityByExclusion", "byExclusion"] }, ngImport: i0 });
|
|
2809
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxSecurityDirective, decorators: [{
|
|
2810
|
-
type: Directive,
|
|
2811
|
-
args: [{
|
|
2812
|
-
selector: '[monkeyecxSecurity]',
|
|
2813
|
-
}]
|
|
2814
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: MonkeyEcxTokenStorageService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { roles: [{
|
|
2815
|
-
type: Input,
|
|
2816
|
-
args: ['securityRoles']
|
|
2817
|
-
}], byExclusion: [{
|
|
2818
|
-
type: Input,
|
|
2819
|
-
args: ['securityByExclusion']
|
|
2820
|
-
}] } });
|
|
2821
|
-
|
|
2822
|
-
class MonkeyEcxTooltipDirective {
|
|
2823
|
-
constructor(el, renderer) {
|
|
2824
|
-
this.el = el;
|
|
2825
|
-
this.renderer = renderer;
|
|
2826
|
-
this.enableToShow = true;
|
|
2827
|
-
this.offset = 10;
|
|
2828
|
-
this.tooltip = null;
|
|
2829
|
-
// not to do
|
|
2830
|
-
}
|
|
2831
|
-
onMouseEnter() {
|
|
2832
|
-
if (!this.tooltip) {
|
|
2833
|
-
this.show();
|
|
2834
|
-
}
|
|
2835
|
-
}
|
|
2836
|
-
onMouseLeave() {
|
|
2837
|
-
if (this.tooltip) {
|
|
2838
|
-
this.hide();
|
|
2839
|
-
}
|
|
2840
|
-
}
|
|
2841
|
-
clickout() {
|
|
2842
|
-
if (this.tooltip) {
|
|
2843
|
-
this.hide();
|
|
2844
|
-
}
|
|
2845
|
-
}
|
|
2846
|
-
show() {
|
|
2847
|
-
if (this.enableToShow) {
|
|
2848
|
-
this.create();
|
|
2849
|
-
this.setPosition();
|
|
2850
|
-
this.renderer.addClass(this.tooltip, 'monkeyecx-tooltip-show');
|
|
2851
|
-
setTimeout(() => {
|
|
2852
|
-
this.hide();
|
|
2853
|
-
}, 5000);
|
|
2854
|
-
}
|
|
2855
|
-
}
|
|
2856
|
-
hide() {
|
|
2857
|
-
if (!this.tooltip)
|
|
2858
|
-
return;
|
|
2859
|
-
this.renderer.removeClass(this.tooltip, 'monkeyecx-tooltip-show');
|
|
2860
|
-
this.renderer.removeChild(document.body, this.tooltip);
|
|
2861
|
-
this.tooltip = null;
|
|
2862
|
-
}
|
|
2863
|
-
create() {
|
|
2864
|
-
const tooltipElement = document.createElement('div');
|
|
2865
|
-
this.tooltip = this.renderer.createElement('span');
|
|
2866
|
-
if (this.tooltipTitle) {
|
|
2867
|
-
const tooltipTitleElement = document.createElement('span');
|
|
2868
|
-
tooltipTitleElement.innerText = `${this.tooltipTitle}`;
|
|
2869
|
-
tooltipTitleElement.className = 'monkeyecx-tooltip-title';
|
|
2870
|
-
tooltipElement.appendChild(tooltipTitleElement);
|
|
2871
|
-
}
|
|
2872
|
-
if (this.tooltipText) {
|
|
2873
|
-
const tooltipTextElement = document.createElement('span');
|
|
2874
|
-
tooltipTextElement.innerText = `${this.tooltipText}`;
|
|
2875
|
-
tooltipTextElement.className = 'monkeyecx-tooltip-description';
|
|
2876
|
-
tooltipElement.appendChild(tooltipTextElement);
|
|
2877
|
-
}
|
|
2878
|
-
this.renderer.appendChild(this.tooltip, tooltipElement);
|
|
2879
|
-
this.renderer.appendChild(document.body, this.tooltip);
|
|
2880
|
-
this.renderer.addClass(this.tooltip, 'monkeyecx-tooltip');
|
|
2881
|
-
this.renderer.addClass(this.tooltip, `monkeyecx-tooltip-${this.tooltipPosition}`);
|
|
2882
|
-
this.renderer.setStyle(this.tooltip, '-webkit-transition', `opacity ${this.tooltipDelay}ms`);
|
|
2883
|
-
this.renderer.setStyle(this.tooltip, '-moz-transition', `opacity ${this.tooltipDelay}ms`);
|
|
2884
|
-
this.renderer.setStyle(this.tooltip, '-o-transition', `opacity ${this.tooltipDelay}ms`);
|
|
2885
|
-
this.renderer.setStyle(this.tooltip, 'transition', `opacity ${this.tooltipDelay}ms`);
|
|
2886
|
-
}
|
|
2887
|
-
setPosition() {
|
|
2888
|
-
const hostPos = this.el.nativeElement.getBoundingClientRect();
|
|
2889
|
-
const tooltipPos = this.tooltip?.getBoundingClientRect();
|
|
2890
|
-
if (!tooltipPos)
|
|
2891
|
-
return;
|
|
2892
|
-
const scrollPos = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
2893
|
-
let top = 0;
|
|
2894
|
-
let left = 0;
|
|
2895
|
-
if (this.tooltipPosition === 'top') {
|
|
2896
|
-
top = hostPos.top - tooltipPos.height - this.offset;
|
|
2897
|
-
left = hostPos.left + (hostPos.width - tooltipPos.width) / 2;
|
|
2898
|
-
}
|
|
2899
|
-
if (this.tooltipPosition === 'bottom') {
|
|
2900
|
-
top = hostPos.bottom + this.offset;
|
|
2901
|
-
left = hostPos.left + (hostPos.width - tooltipPos.width) / 2;
|
|
2902
|
-
}
|
|
2903
|
-
if (this.tooltipPosition === 'left') {
|
|
2904
|
-
top = hostPos.top + (hostPos.height - tooltipPos.height) / 2;
|
|
2905
|
-
left = hostPos.left - tooltipPos.width - this.offset;
|
|
2906
|
-
}
|
|
2907
|
-
if (this.tooltipPosition === 'right') {
|
|
2908
|
-
top = hostPos.top + (hostPos.height - tooltipPos.height) / 2;
|
|
2909
|
-
left = hostPos.right + this.offset;
|
|
2910
|
-
}
|
|
2911
|
-
this.renderer.setStyle(this.tooltip, 'top', `${top + scrollPos}px`);
|
|
2912
|
-
this.renderer.setStyle(this.tooltip, 'left', `${left}px`);
|
|
2913
|
-
}
|
|
2914
|
-
}
|
|
2915
|
-
MonkeyEcxTooltipDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTooltipDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2916
|
-
MonkeyEcxTooltipDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxTooltipDirective, selector: "[monkeyecxTooltip]", inputs: { tooltipDelay: "tooltipDelay", tooltipPosition: "tooltipPosition", tooltipText: "tooltipText", tooltipTitle: "tooltipTitle", enableToShow: "enableToShow" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "click": "clickout()" } }, ngImport: i0 });
|
|
2917
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTooltipDirective, decorators: [{
|
|
2918
|
-
type: Directive,
|
|
2919
|
-
args: [{
|
|
2920
|
-
selector: '[monkeyecxTooltip]',
|
|
2921
|
-
}]
|
|
2922
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { tooltipDelay: [{
|
|
2923
|
-
type: Input
|
|
2924
|
-
}], tooltipPosition: [{
|
|
2925
|
-
type: Input
|
|
2926
|
-
}], tooltipText: [{
|
|
2927
|
-
type: Input
|
|
2928
|
-
}], tooltipTitle: [{
|
|
2929
|
-
type: Input
|
|
2930
|
-
}], enableToShow: [{
|
|
2931
|
-
type: Input
|
|
2932
|
-
}], onMouseEnter: [{
|
|
2933
|
-
type: HostListener,
|
|
2934
|
-
args: ['mouseenter']
|
|
2935
|
-
}], onMouseLeave: [{
|
|
2936
|
-
type: HostListener,
|
|
2937
|
-
args: ['mouseleave']
|
|
2938
|
-
}], clickout: [{
|
|
2939
|
-
type: HostListener,
|
|
2940
|
-
args: ['click']
|
|
2941
|
-
}] } });
|
|
2942
|
-
|
|
2943
|
-
class MonkeyEcxFeatureDirective {
|
|
2944
|
-
constructor(cdr, elementRef, monkeyecxFeatureToggleService) {
|
|
2945
|
-
this.cdr = cdr;
|
|
2946
|
-
this.elementRef = elementRef;
|
|
2947
|
-
this.monkeyecxFeatureToggleService = monkeyecxFeatureToggleService;
|
|
2948
|
-
this.unsubscribeAll = new Subject();
|
|
2949
|
-
// not to do
|
|
2950
|
-
}
|
|
2951
|
-
getFeature(feature) {
|
|
2952
|
-
const { monkeyecxFeatureToggleService } = this;
|
|
2953
|
-
if (!monkeyecxFeatureToggleService) {
|
|
2954
|
-
return false;
|
|
2955
|
-
}
|
|
2956
|
-
return monkeyecxFeatureToggleService?.getFlag(feature) || false;
|
|
2957
|
-
}
|
|
2958
|
-
handleDisplay() {
|
|
2959
|
-
if (!this.feature)
|
|
2960
|
-
return;
|
|
2961
|
-
const flag = this.getFeature(this.feature);
|
|
2962
|
-
let display = 'none';
|
|
2963
|
-
if (!MonkeyEcxUtils.persistNullEmptyUndefined(flag)) {
|
|
2964
|
-
return;
|
|
2965
|
-
}
|
|
2966
|
-
if (flag) {
|
|
2967
|
-
display = 'block';
|
|
2968
|
-
}
|
|
2969
|
-
if (display === 'none') {
|
|
2970
|
-
this.elementRef.nativeElement.remove();
|
|
2971
|
-
}
|
|
2972
|
-
this.elementRef.nativeElement.style.display = display;
|
|
2973
|
-
this.cdr.detectChanges();
|
|
2974
|
-
}
|
|
2975
|
-
ngOnDestroy() {
|
|
2976
|
-
this.unsubscribeAll.next();
|
|
2977
|
-
this.unsubscribeAll.complete();
|
|
2978
|
-
}
|
|
2979
|
-
ngOnInit() {
|
|
2980
|
-
if (!this.feature)
|
|
2981
|
-
return;
|
|
2982
|
-
this.elementRef.nativeElement.style.display = 'none';
|
|
2983
|
-
this.cdr.detectChanges();
|
|
2984
|
-
this.monkeyecxFeatureToggleService.onFlags
|
|
2985
|
-
.pipe(takeUntil(this.unsubscribeAll))
|
|
2986
|
-
.subscribe((val) => {
|
|
2987
|
-
if (val) {
|
|
2988
|
-
this.handleDisplay();
|
|
2989
|
-
}
|
|
2990
|
-
});
|
|
2991
|
-
}
|
|
2992
|
-
}
|
|
2993
|
-
MonkeyEcxFeatureDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFeatureDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: MonkeyEcxFeatureToggleService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2994
|
-
MonkeyEcxFeatureDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxFeatureDirective, selector: "[monkeyecxFeature]", inputs: { feature: ["featureName", "feature"] }, ngImport: i0 });
|
|
2995
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFeatureDirective, decorators: [{
|
|
2996
|
-
type: Directive,
|
|
2997
|
-
args: [{
|
|
2998
|
-
selector: '[monkeyecxFeature]',
|
|
2999
|
-
}]
|
|
3000
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: MonkeyEcxFeatureToggleService }]; }, propDecorators: { feature: [{
|
|
3001
|
-
type: Input,
|
|
3002
|
-
args: ['featureName']
|
|
3003
|
-
}] } });
|
|
3004
|
-
|
|
3005
|
-
class MonkeyEcxDirectivesModule {
|
|
3006
|
-
}
|
|
3007
|
-
MonkeyEcxDirectivesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3008
|
-
MonkeyEcxDirectivesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDirectivesModule, declarations: [MonkeyEcxDragDropDirective,
|
|
3009
|
-
MonkeyEcxFormatCurrency,
|
|
3010
|
-
MonkeyEcxFeatureDirective,
|
|
3011
|
-
MonkeyEcxFormatUpper,
|
|
3012
|
-
MonkeyEcxOnlyAlphaNumericDirective,
|
|
3013
|
-
MonkeyEcxOnlyNumbersDirective,
|
|
3014
|
-
MonkeyEcxSecurityDirective,
|
|
3015
|
-
MonkeyEcxTooltipDirective], exports: [MonkeyEcxDragDropDirective,
|
|
3016
|
-
MonkeyEcxFormatCurrency,
|
|
3017
|
-
MonkeyEcxFeatureDirective,
|
|
3018
|
-
MonkeyEcxFormatUpper,
|
|
3019
|
-
MonkeyEcxOnlyAlphaNumericDirective,
|
|
3020
|
-
MonkeyEcxOnlyNumbersDirective,
|
|
3021
|
-
MonkeyEcxSecurityDirective,
|
|
3022
|
-
MonkeyEcxTooltipDirective] });
|
|
3023
|
-
MonkeyEcxDirectivesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDirectivesModule });
|
|
3024
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDirectivesModule, decorators: [{
|
|
3025
|
-
type: NgModule,
|
|
3026
|
-
args: [{
|
|
3027
|
-
declarations: [
|
|
3028
|
-
MonkeyEcxDragDropDirective,
|
|
3029
|
-
MonkeyEcxFormatCurrency,
|
|
3030
|
-
MonkeyEcxFeatureDirective,
|
|
3031
|
-
MonkeyEcxFormatUpper,
|
|
3032
|
-
MonkeyEcxOnlyAlphaNumericDirective,
|
|
3033
|
-
MonkeyEcxOnlyNumbersDirective,
|
|
3034
|
-
MonkeyEcxSecurityDirective,
|
|
3035
|
-
MonkeyEcxTooltipDirective
|
|
3036
|
-
],
|
|
3037
|
-
exports: [
|
|
3038
|
-
MonkeyEcxDragDropDirective,
|
|
3039
|
-
MonkeyEcxFormatCurrency,
|
|
3040
|
-
MonkeyEcxFeatureDirective,
|
|
3041
|
-
MonkeyEcxFormatUpper,
|
|
3042
|
-
MonkeyEcxOnlyAlphaNumericDirective,
|
|
3043
|
-
MonkeyEcxOnlyNumbersDirective,
|
|
3044
|
-
MonkeyEcxSecurityDirective,
|
|
3045
|
-
MonkeyEcxTooltipDirective
|
|
3046
|
-
]
|
|
3047
|
-
}]
|
|
3048
|
-
}] });
|
|
3049
|
-
|
|
3050
|
-
/* eslint-disable no-console */
|
|
3051
|
-
class MonkeyEcxAuthenticationService {
|
|
3052
|
-
constructor() {
|
|
3053
|
-
this.hadAtLeastOneLogin = () => {
|
|
3054
|
-
console.error('hadAtLeastOneLogin needs to be declared!');
|
|
3055
|
-
return null;
|
|
3056
|
-
};
|
|
3057
|
-
this.redirectApp = () => {
|
|
3058
|
-
console.error('redirectApp needs to be declared!');
|
|
3059
|
-
return null;
|
|
3060
|
-
};
|
|
3061
|
-
this.redirectLoginWelcomeBack = () => {
|
|
3062
|
-
console.error('redirectLoginWelcomeBack needs to be declared!');
|
|
3063
|
-
return null;
|
|
3064
|
-
};
|
|
3065
|
-
this.isAuthorized = () => {
|
|
3066
|
-
console.error('isAuthorized needs to be declared!');
|
|
3067
|
-
return false;
|
|
3068
|
-
};
|
|
3069
|
-
this.getRequestWithHeaders = (request) => {
|
|
3070
|
-
console.error('getRequestWithHeaders needs to be declared!');
|
|
3071
|
-
return null;
|
|
3072
|
-
};
|
|
3073
|
-
this.getRequestWithHeadersOb = (request) => {
|
|
3074
|
-
console.error('getRequestWithHeadersOb needs to be declared!');
|
|
3075
|
-
return null;
|
|
3076
|
-
};
|
|
3077
|
-
this.refreshShouldHappen = (response) => {
|
|
3078
|
-
console.error('refreshShouldHappen needs to be declared!');
|
|
3079
|
-
return false;
|
|
3080
|
-
};
|
|
3081
|
-
this.refreshToken = () => {
|
|
3082
|
-
console.error('refreshToken needs to be declared!');
|
|
3083
|
-
return null;
|
|
3084
|
-
};
|
|
3085
|
-
// not to do
|
|
3086
|
-
}
|
|
3087
|
-
init(args) {
|
|
3088
|
-
this.hadAtLeastOneLogin = args?.hadAtLeastOneLogin || this.hadAtLeastOneLogin.bind(this);
|
|
3089
|
-
this.redirectApp = args?.redirectApp || this.redirectApp.bind(this);
|
|
3090
|
-
this.redirectLoginWelcomeBack = args?.redirectLoginWelcomeBack ||
|
|
3091
|
-
this.redirectLoginWelcomeBack.bind(this);
|
|
3092
|
-
this.isAuthorized = args?.isAuthorized || this.isAuthorized.bind(this);
|
|
3093
|
-
this.getRequestWithHeaders = args?.getRequestWithHeaders ||
|
|
3094
|
-
this.getRequestWithHeaders.bind(this);
|
|
3095
|
-
this.getRequestWithHeadersOb = args?.getRequestWithHeadersOb.bind(this);
|
|
3096
|
-
this.refreshShouldHappen = args?.refreshShouldHappen || this.refreshShouldHappen.bind(this);
|
|
3097
|
-
this.refreshToken = args?.refreshToken || this.refreshToken.bind(this);
|
|
3098
|
-
}
|
|
3099
|
-
}
|
|
3100
|
-
MonkeyEcxAuthenticationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthenticationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3101
|
-
MonkeyEcxAuthenticationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthenticationService, providedIn: 'root' });
|
|
3102
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthenticationService, decorators: [{
|
|
3103
|
-
type: Injectable,
|
|
3104
|
-
args: [{
|
|
3105
|
-
providedIn: 'root'
|
|
3106
|
-
}]
|
|
3107
|
-
}], ctorParameters: function () { return []; } });
|
|
3108
|
-
|
|
3109
|
-
class MonkeyEcxAuthGuardLogin {
|
|
3110
|
-
constructor(monkeyecxAuthenticationService) {
|
|
3111
|
-
this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
|
|
3112
|
-
// not to do
|
|
3113
|
-
}
|
|
3114
|
-
canActivate() {
|
|
3115
|
-
if (this.monkeyecxAuthenticationService.isAuthorized()) {
|
|
3116
|
-
this.monkeyecxAuthenticationService.redirectApp();
|
|
3117
|
-
return false;
|
|
3118
|
-
}
|
|
3119
|
-
if (this.monkeyecxAuthenticationService.hadAtLeastOneLogin()) {
|
|
3120
|
-
this.monkeyecxAuthenticationService.redirectLoginWelcomeBack();
|
|
3121
|
-
return false;
|
|
3122
|
-
}
|
|
3123
|
-
return true;
|
|
3124
|
-
}
|
|
3125
|
-
}
|
|
3126
|
-
MonkeyEcxAuthGuardLogin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthGuardLogin, deps: [{ token: MonkeyEcxAuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3127
|
-
MonkeyEcxAuthGuardLogin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthGuardLogin, providedIn: 'root' });
|
|
3128
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthGuardLogin, decorators: [{
|
|
3129
|
-
type: Injectable,
|
|
3130
|
-
args: [{
|
|
3131
|
-
providedIn: 'root'
|
|
3132
|
-
}]
|
|
3133
|
-
}], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }]; } });
|
|
3134
|
-
|
|
3135
|
-
class MonkeyEcxAuthGuard {
|
|
3136
|
-
constructor(monkeyecxAuthenticationService) {
|
|
3137
|
-
this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
|
|
3138
|
-
// not to do
|
|
3139
|
-
}
|
|
3140
|
-
canActivate() {
|
|
3141
|
-
const { monkeyecxAuthenticationService } = this;
|
|
3142
|
-
if (monkeyecxAuthenticationService.isAuthorized()) {
|
|
3143
|
-
return true;
|
|
3144
|
-
}
|
|
3145
|
-
monkeyecxAuthenticationService.redirectLoginWelcomeBack();
|
|
3146
|
-
return false;
|
|
3147
|
-
}
|
|
3148
|
-
}
|
|
3149
|
-
MonkeyEcxAuthGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthGuard, deps: [{ token: MonkeyEcxAuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3150
|
-
MonkeyEcxAuthGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthGuard, providedIn: 'root' });
|
|
3151
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthGuard, decorators: [{
|
|
3152
|
-
type: Injectable,
|
|
3153
|
-
args: [{
|
|
3154
|
-
providedIn: 'root'
|
|
3155
|
-
}]
|
|
3156
|
-
}], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }]; } });
|
|
3157
|
-
|
|
3158
|
-
class MonkeyEcxHttpErrorHandlingService extends MonkeyEcxCommonsService {
|
|
3159
|
-
constructor(monkeyecxService, tokenStorage, monkeyecxAuthenticationService, router, snackbarService, translateService) {
|
|
3160
|
-
super(monkeyecxService, tokenStorage);
|
|
3161
|
-
this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
|
|
3162
|
-
this.router = router;
|
|
3163
|
-
this.snackbarService = snackbarService;
|
|
3164
|
-
this.translateService = translateService;
|
|
3165
|
-
super.resolve(null, null);
|
|
3166
|
-
this.geti18n(this.translateService, 'SERVICES.WARNING');
|
|
3167
|
-
}
|
|
3168
|
-
isHttpCodeIgnoreMessage(tp, httpCode) {
|
|
3169
|
-
if (!MonkeyEcxUtils.persistNullEmptyUndefined(tp) && !tp?.httpResponse) {
|
|
3170
|
-
return false;
|
|
3171
|
-
}
|
|
3172
|
-
const found = (tp?.httpResponse?.httpCodeIgnore || [])?.indexOf(httpCode) > -1;
|
|
3173
|
-
return found;
|
|
3174
|
-
}
|
|
3175
|
-
isHttpCodeIgnoreRedirect(tp, httpCode) {
|
|
3176
|
-
if (!MonkeyEcxUtils.persistNullEmptyUndefined(tp) && !tp?.httpResponse) {
|
|
3177
|
-
return false;
|
|
3178
|
-
}
|
|
3179
|
-
const found = (tp?.httpResponse?.httpCodeIgnoreRedirect || [])?.indexOf(httpCode) > -1;
|
|
3180
|
-
return found;
|
|
3181
|
-
}
|
|
3182
|
-
getMessageType(status) {
|
|
3183
|
-
if (status === 409 || status === 400) {
|
|
3184
|
-
return 'warning';
|
|
3185
|
-
}
|
|
3186
|
-
return 'error';
|
|
3187
|
-
}
|
|
3188
|
-
showMessage(message, error, mkc) {
|
|
3189
|
-
const { snackbarService } = this;
|
|
3190
|
-
if (!this.isHttpCodeIgnoreMessage(mkc, error.status)) {
|
|
3191
|
-
snackbarService.show({
|
|
3192
|
-
title: this.__i18n?.TITLE,
|
|
3193
|
-
message,
|
|
3194
|
-
type: this.getMessageType(error.status),
|
|
3195
|
-
duration: 4000,
|
|
3196
|
-
horizontalPosition: 'center',
|
|
3197
|
-
verticalPosition: 'top'
|
|
3198
|
-
});
|
|
3199
|
-
}
|
|
3200
|
-
}
|
|
3201
|
-
handleMessage(error, mkc) {
|
|
3202
|
-
// eslint-disable-next-line camelcase
|
|
3203
|
-
const { notifications, error_description, message } = error.error;
|
|
3204
|
-
let customMessage = '';
|
|
3205
|
-
if (message) {
|
|
3206
|
-
customMessage = message;
|
|
3207
|
-
}
|
|
3208
|
-
// eslint-disable-next-line camelcase
|
|
3209
|
-
if (error_description) {
|
|
3210
|
-
// eslint-disable-next-line camelcase
|
|
3211
|
-
customMessage = error_description;
|
|
3212
|
-
}
|
|
3213
|
-
if (notifications) {
|
|
3214
|
-
customMessage = notifications;
|
|
3215
|
-
}
|
|
3216
|
-
if (!customMessage) {
|
|
3217
|
-
if (error.error instanceof Blob) {
|
|
3218
|
-
const blob = new Blob([error.error], {
|
|
3219
|
-
type: 'application/json'
|
|
3220
|
-
});
|
|
3221
|
-
const reader = new FileReader();
|
|
3222
|
-
reader.addEventListener('loadend', (e) => {
|
|
3223
|
-
const text = e?.target?.result;
|
|
3224
|
-
const jsonResp = JSON.parse(text);
|
|
3225
|
-
customMessage = jsonResp.notifications;
|
|
3226
|
-
this.showMessage(customMessage, error, mkc);
|
|
3227
|
-
});
|
|
3228
|
-
reader.readAsText(blob);
|
|
3229
|
-
}
|
|
3230
|
-
else {
|
|
3231
|
-
this.showMessage(this.__i18n['ERROR-HANDLING']?.ERROR, error, mkc);
|
|
3232
|
-
}
|
|
3233
|
-
}
|
|
3234
|
-
else {
|
|
3235
|
-
this.showMessage(customMessage, error, mkc);
|
|
3236
|
-
}
|
|
3237
|
-
}
|
|
3238
|
-
handleError(error, mkc) {
|
|
3239
|
-
const { router } = this;
|
|
3240
|
-
const { status } = error;
|
|
3241
|
-
const routes = {
|
|
3242
|
-
403: 'forbidden',
|
|
3243
|
-
500: 'service-problems',
|
|
3244
|
-
503: 'service-problems'
|
|
3245
|
-
};
|
|
3246
|
-
const found = routes[status];
|
|
3247
|
-
let timeout = 0;
|
|
3248
|
-
if (found && !this.isHttpCodeIgnoreRedirect(mkc, error?.status)) {
|
|
3249
|
-
const route = `/app/pages/${found}`.toLowerCase();
|
|
3250
|
-
timeout = 800;
|
|
3251
|
-
router.navigate([route]);
|
|
3252
|
-
}
|
|
3253
|
-
setTimeout(() => {
|
|
3254
|
-
this.handleMessage(error, mkc);
|
|
3255
|
-
}, timeout);
|
|
3256
|
-
}
|
|
3257
|
-
handleErrorRefreshToken(error, mkc) {
|
|
3258
|
-
if (error.status === 401 || error.status === 400) {
|
|
3259
|
-
NgZone.call(this.monkeyecxAuthenticationService.redirectLoginWelcomeBack(), {});
|
|
3260
|
-
}
|
|
3261
|
-
else if (!this.isHttpCodeIgnoreMessage(mkc, error.status)) {
|
|
3262
|
-
this.handleMessage(error, mkc);
|
|
3263
|
-
}
|
|
3264
|
-
}
|
|
3265
|
-
}
|
|
3266
|
-
MonkeyEcxHttpErrorHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpErrorHandlingService, deps: [{ token: MonkeyEcxService }, { token: MonkeyEcxTokenStorageService }, { token: MonkeyEcxAuthenticationService }, { token: i1$3.Router }, { token: i1.MonkeyStyleGuideSnackbarService }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3267
|
-
MonkeyEcxHttpErrorHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpErrorHandlingService, providedIn: 'root' });
|
|
3268
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpErrorHandlingService, decorators: [{
|
|
3269
|
-
type: Injectable,
|
|
3270
|
-
args: [{
|
|
3271
|
-
providedIn: 'root'
|
|
3272
|
-
}]
|
|
3273
|
-
}], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxTokenStorageService }, { type: MonkeyEcxAuthenticationService }, { type: i1$3.Router }, { type: i1.MonkeyStyleGuideSnackbarService }, { type: i1$1.TranslateService }]; } });
|
|
3274
|
-
|
|
3275
|
-
class MonkeyEcxOthersErrorsHandlingService {
|
|
3276
|
-
constructor(modalService) {
|
|
3277
|
-
this.modalService = modalService;
|
|
3278
|
-
// not to do
|
|
3279
|
-
}
|
|
3280
|
-
handleError(error) {
|
|
3281
|
-
const { modalService } = this;
|
|
3282
|
-
const { message } = error;
|
|
3283
|
-
if (new RegExp(/Loading chunk [\d]+ failed/).test(message)) {
|
|
3284
|
-
modalService.open(VersionChangedComponent, {
|
|
3285
|
-
color: 'theme',
|
|
3286
|
-
size: 'md'
|
|
3287
|
-
});
|
|
3288
|
-
}
|
|
3289
|
-
}
|
|
3290
|
-
}
|
|
3291
|
-
MonkeyEcxOthersErrorsHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxOthersErrorsHandlingService, deps: [{ token: i1.MonkeyStyleGuideModalService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3292
|
-
MonkeyEcxOthersErrorsHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxOthersErrorsHandlingService, providedIn: 'root' });
|
|
3293
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxOthersErrorsHandlingService, decorators: [{
|
|
3294
|
-
type: Injectable,
|
|
3295
|
-
args: [{
|
|
3296
|
-
providedIn: 'root'
|
|
3297
|
-
}]
|
|
3298
|
-
}], ctorParameters: function () { return [{ type: i1.MonkeyStyleGuideModalService }]; } });
|
|
3299
|
-
|
|
3300
|
-
class MonkeyEcxErrorHandlingService {
|
|
3301
|
-
constructor(injector) {
|
|
3302
|
-
this.injector = injector;
|
|
3303
|
-
// not to do
|
|
3304
|
-
}
|
|
3305
|
-
handleError(error, type) {
|
|
3306
|
-
const { injector } = this;
|
|
3307
|
-
const handlingService = injector.get(MonkeyEcxHandlingService);
|
|
3308
|
-
const httpErrorHandlingService = injector.get(MonkeyEcxHttpErrorHandlingService);
|
|
3309
|
-
const othersErrorsHandlingService = injector.get(MonkeyEcxOthersErrorsHandlingService);
|
|
3310
|
-
console.log('======error');
|
|
3311
|
-
console.log(error);
|
|
3312
|
-
if (error instanceof HttpErrorResponse) {
|
|
3313
|
-
const sCredentials = handlingService?.getMonkeyEcxServiceCredentials() || {};
|
|
3314
|
-
if (MonkeyEcxUtils.persistNullEmptyUndefined(type) && type === 'refresh_token') {
|
|
3315
|
-
httpErrorHandlingService.handleErrorRefreshToken(error, sCredentials);
|
|
3316
|
-
}
|
|
3317
|
-
else
|
|
3318
|
-
httpErrorHandlingService.handleError(error, sCredentials);
|
|
3319
|
-
}
|
|
3320
|
-
else {
|
|
3321
|
-
othersErrorsHandlingService.handleError(error);
|
|
3322
|
-
}
|
|
3323
|
-
}
|
|
3324
|
-
}
|
|
3325
|
-
MonkeyEcxErrorHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorHandlingService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3326
|
-
MonkeyEcxErrorHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorHandlingService, providedIn: 'root' });
|
|
3327
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorHandlingService, decorators: [{
|
|
3328
|
-
type: Injectable,
|
|
3329
|
-
args: [{
|
|
3330
|
-
providedIn: 'root',
|
|
3331
|
-
}]
|
|
3332
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
3333
|
-
|
|
3334
|
-
class MonkeyEcxErrorHandlingModule {
|
|
3335
|
-
static forRoot() {
|
|
3336
|
-
return {
|
|
3337
|
-
ngModule: MonkeyEcxErrorHandlingModule,
|
|
3338
|
-
providers: [
|
|
3339
|
-
{
|
|
3340
|
-
provide: ErrorHandler,
|
|
3341
|
-
useClass: MonkeyEcxErrorHandlingService,
|
|
3342
|
-
},
|
|
3343
|
-
],
|
|
3344
|
-
};
|
|
3345
|
-
}
|
|
3346
|
-
}
|
|
3347
|
-
MonkeyEcxErrorHandlingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorHandlingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3348
|
-
MonkeyEcxErrorHandlingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorHandlingModule, imports: [CommonModule] });
|
|
3349
|
-
MonkeyEcxErrorHandlingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorHandlingModule, imports: [[CommonModule]] });
|
|
3350
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorHandlingModule, decorators: [{
|
|
3351
|
-
type: NgModule,
|
|
3352
|
-
args: [{
|
|
3353
|
-
imports: [CommonModule],
|
|
3354
|
-
}]
|
|
3355
|
-
}] });
|
|
3356
|
-
|
|
3357
|
-
class MonkeyEcxHttpConfigErrorInterceptor {
|
|
3358
|
-
constructor(monkeyecxAuthenticationService, monkeyecxErrorHandlingService) {
|
|
3359
|
-
this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
|
|
3360
|
-
this.monkeyecxErrorHandlingService = monkeyecxErrorHandlingService;
|
|
3361
|
-
// no to do
|
|
3362
|
-
}
|
|
3363
|
-
intercept(request, next) {
|
|
3364
|
-
return next.handle(request).pipe(map((event) => {
|
|
3365
|
-
return event;
|
|
3366
|
-
}), catchError((error) => {
|
|
3367
|
-
if (this.monkeyecxAuthenticationService.refreshShouldHappen(error)) {
|
|
3368
|
-
return this.monkeyecxAuthenticationService?.refreshToken()?.pipe(take(1), map(() => {
|
|
3369
|
-
return this.monkeyecxAuthenticationService.getRequestWithHeaders(request);
|
|
3370
|
-
}), mergeMap((resp) => {
|
|
3371
|
-
return next.handle(resp).pipe(catchError((error) => {
|
|
3372
|
-
this.monkeyecxErrorHandlingService.handleError(error, 'refresh_token');
|
|
3373
|
-
return throwError(null);
|
|
3374
|
-
}));
|
|
3375
|
-
}), catchError((error) => {
|
|
3376
|
-
this.monkeyecxErrorHandlingService.handleError(error, 'refresh_token');
|
|
3377
|
-
return throwError(null);
|
|
3378
|
-
})) || throwError(error);
|
|
3379
|
-
}
|
|
3380
|
-
return throwError(error);
|
|
3381
|
-
}));
|
|
3382
|
-
}
|
|
3383
|
-
}
|
|
3384
|
-
MonkeyEcxHttpConfigErrorInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigErrorInterceptor, deps: [{ token: MonkeyEcxAuthenticationService }, { token: MonkeyEcxErrorHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3385
|
-
MonkeyEcxHttpConfigErrorInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigErrorInterceptor });
|
|
3386
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigErrorInterceptor, decorators: [{
|
|
3387
|
-
type: Injectable
|
|
3388
|
-
}], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }, { type: MonkeyEcxErrorHandlingService }]; } });
|
|
3389
|
-
|
|
3390
|
-
class MonkeyEcxHttpConfigHeaderInterceptor {
|
|
3391
|
-
constructor(monkeyecxAuthenticationService, monkeyecxErrorHandlingService) {
|
|
3392
|
-
this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
|
|
3393
|
-
this.monkeyecxErrorHandlingService = monkeyecxErrorHandlingService;
|
|
3394
|
-
// not to do
|
|
3395
|
-
}
|
|
3396
|
-
intercept(request, next) {
|
|
3397
|
-
return this.monkeyecxAuthenticationService?.getRequestWithHeadersOb(request)?.pipe(take(1), map((event) => {
|
|
3398
|
-
return event;
|
|
3399
|
-
}), mergeMap((resp) => {
|
|
3400
|
-
request = request.clone({
|
|
3401
|
-
setHeaders: resp
|
|
3402
|
-
});
|
|
3403
|
-
return next.handle(request);
|
|
3404
|
-
}), catchError((error) => {
|
|
3405
|
-
this.monkeyecxErrorHandlingService.handleError(error);
|
|
3406
|
-
return throwError(error);
|
|
3407
|
-
})) || throwError('getRequestWithHeadersOb undefined');
|
|
3408
|
-
}
|
|
3409
|
-
}
|
|
3410
|
-
MonkeyEcxHttpConfigHeaderInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigHeaderInterceptor, deps: [{ token: MonkeyEcxAuthenticationService }, { token: MonkeyEcxErrorHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3411
|
-
MonkeyEcxHttpConfigHeaderInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigHeaderInterceptor });
|
|
3412
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigHeaderInterceptor, decorators: [{
|
|
3413
|
-
type: Injectable
|
|
3414
|
-
}], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }, { type: MonkeyEcxErrorHandlingService }]; } });
|
|
3415
|
-
|
|
3416
|
-
class MonkeyEcxRequestQueueHandlingService {
|
|
3417
|
-
constructor() {
|
|
3418
|
-
this.queue = [];
|
|
3419
|
-
this.newQueue = new BehaviorSubject(false);
|
|
3420
|
-
this.queues$ = new BehaviorSubject([]);
|
|
3421
|
-
}
|
|
3422
|
-
addToQueue(q) {
|
|
3423
|
-
this.queue.push(q);
|
|
3424
|
-
this.queues$.next(this.queue);
|
|
3425
|
-
this.newQueue.next(true);
|
|
3426
|
-
}
|
|
3427
|
-
markQueueItemAsFinish(q, status, action) {
|
|
3428
|
-
const saved = [...this.queue];
|
|
3429
|
-
this.queue = [
|
|
3430
|
-
...saved.map((val) => {
|
|
3431
|
-
const valSaved = {
|
|
3432
|
-
...val
|
|
3433
|
-
};
|
|
3434
|
-
if (val.status === MonkeyEcxQueueEvents.OnGoing) {
|
|
3435
|
-
if (valSaved.item.id === q.item.id) {
|
|
3436
|
-
return {
|
|
3437
|
-
...valSaved,
|
|
3438
|
-
status: status || MonkeyEcxQueueEvents.Finished,
|
|
3439
|
-
action
|
|
3440
|
-
};
|
|
3441
|
-
}
|
|
3442
|
-
}
|
|
3443
|
-
return valSaved;
|
|
3444
|
-
})
|
|
3445
|
-
];
|
|
3446
|
-
this.queues$.next(this.queue);
|
|
3447
|
-
}
|
|
3448
|
-
updateQueue(q, progress) {
|
|
3449
|
-
const saved = [...this.queue];
|
|
3450
|
-
this.queue = [
|
|
3451
|
-
...saved.map((val) => {
|
|
3452
|
-
const valSaved = {
|
|
3453
|
-
...val
|
|
3454
|
-
};
|
|
3455
|
-
const { total, loaded } = progress;
|
|
3456
|
-
const currentPecentage = Math.floor(((loaded || 0) / (total || 0)) * 100);
|
|
3457
|
-
const totalPercentage = 100;
|
|
3458
|
-
if (valSaved.item.id === q.item.id) {
|
|
3459
|
-
return {
|
|
3460
|
-
...valSaved,
|
|
3461
|
-
progress: {
|
|
3462
|
-
loaded,
|
|
3463
|
-
total,
|
|
3464
|
-
currentPercentage: currentPecentage,
|
|
3465
|
-
totalPercentage
|
|
3466
|
-
}
|
|
3467
|
-
};
|
|
3468
|
-
}
|
|
3469
|
-
return valSaved;
|
|
3470
|
-
})
|
|
3471
|
-
];
|
|
3472
|
-
this.queues$.next(this.queue);
|
|
3473
|
-
}
|
|
3474
|
-
deleteQueue(q) {
|
|
3475
|
-
const saved = [...this.queue];
|
|
3476
|
-
this.queue = [
|
|
3477
|
-
...saved.map((val) => {
|
|
3478
|
-
const valSaved = {
|
|
3479
|
-
...val
|
|
3480
|
-
};
|
|
3481
|
-
if (valSaved.item.id === q.item.id) {
|
|
3482
|
-
return null;
|
|
3483
|
-
}
|
|
3484
|
-
return valSaved;
|
|
3485
|
-
})
|
|
3486
|
-
].filter((_) => {
|
|
3487
|
-
return _;
|
|
3488
|
-
});
|
|
3489
|
-
this.queues$.next(this.queue);
|
|
3490
|
-
}
|
|
3491
|
-
setQueue(q) {
|
|
3492
|
-
if (!q)
|
|
3493
|
-
return;
|
|
3494
|
-
this.addToQueue(q);
|
|
3495
|
-
}
|
|
3496
|
-
getQueue() {
|
|
3497
|
-
return this.queues$.asObservable();
|
|
3498
|
-
}
|
|
3499
|
-
finishQueueItem(q, action, status) {
|
|
3500
|
-
if (!q)
|
|
3501
|
-
return;
|
|
3502
|
-
this.markQueueItemAsFinish(q, status, action);
|
|
3503
|
-
}
|
|
3504
|
-
removeQueueItem(q) {
|
|
3505
|
-
this.deleteQueue(q);
|
|
3506
|
-
}
|
|
3507
|
-
updateQueueItem(q, progress) {
|
|
3508
|
-
this.updateQueue(q, progress);
|
|
3509
|
-
}
|
|
3510
|
-
hasNewQueue() {
|
|
3511
|
-
return this.newQueue.pipe(map((_) => {
|
|
3512
|
-
return _;
|
|
3513
|
-
}));
|
|
3514
|
-
}
|
|
3515
|
-
}
|
|
3516
|
-
MonkeyEcxRequestQueueHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestQueueHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3517
|
-
MonkeyEcxRequestQueueHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestQueueHandlingService, providedIn: 'root' });
|
|
3518
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestQueueHandlingService, decorators: [{
|
|
3519
|
-
type: Injectable,
|
|
3520
|
-
args: [{
|
|
3521
|
-
providedIn: 'root'
|
|
3522
|
-
}]
|
|
3523
|
-
}], ctorParameters: function () { return []; } });
|
|
3524
|
-
|
|
3525
|
-
class MonkeyEcxRequestQueueModalHandlingService {
|
|
3526
|
-
constructor() {
|
|
3527
|
-
this.queue = [];
|
|
3528
|
-
this.newQueue$ = new BehaviorSubject(false);
|
|
3529
|
-
this.allQueueFinished$ = new BehaviorSubject(false);
|
|
3530
|
-
this.queues$ = new BehaviorSubject([]);
|
|
3531
|
-
}
|
|
3532
|
-
addToQueue(q) {
|
|
3533
|
-
this.queue.push(q);
|
|
3534
|
-
this.queues$.next(this.queue);
|
|
3535
|
-
this.newQueue$.next(true);
|
|
3536
|
-
}
|
|
3537
|
-
markQueueItemAsFinish(q, status, action) {
|
|
3538
|
-
const saved = [...this.queue];
|
|
3539
|
-
this.queue = [
|
|
3540
|
-
...saved.map((val) => {
|
|
3541
|
-
const valSaved = {
|
|
3542
|
-
...val
|
|
3543
|
-
};
|
|
3544
|
-
if (val.status === MonkeyEcxQueueEvents.OnGoing) {
|
|
3545
|
-
if (valSaved.item.id === q.item.id) {
|
|
3546
|
-
return {
|
|
3547
|
-
...valSaved,
|
|
3548
|
-
status: status || MonkeyEcxQueueEvents.Finished,
|
|
3549
|
-
action
|
|
3550
|
-
};
|
|
3551
|
-
}
|
|
3552
|
-
}
|
|
3553
|
-
return valSaved;
|
|
3554
|
-
})
|
|
3555
|
-
];
|
|
3556
|
-
this.queues$.next(this.queue);
|
|
3557
|
-
}
|
|
3558
|
-
updateQueue(q, progress) {
|
|
3559
|
-
const saved = [...this.queue];
|
|
3560
|
-
this.queue = [
|
|
3561
|
-
...saved.map((val) => {
|
|
3562
|
-
const valSaved = {
|
|
3563
|
-
...val
|
|
3564
|
-
};
|
|
3565
|
-
const { total, loaded } = progress;
|
|
3566
|
-
const currentPecentage = Math.floor(((loaded || 0) / (total || 0)) * 100);
|
|
3567
|
-
const totalPercentage = 100;
|
|
3568
|
-
if (valSaved.item.id === q.item.id) {
|
|
3569
|
-
return {
|
|
3570
|
-
...valSaved,
|
|
3571
|
-
progress: {
|
|
3572
|
-
loaded,
|
|
3573
|
-
total,
|
|
3574
|
-
currentPercentage: currentPecentage,
|
|
3575
|
-
totalPercentage
|
|
3576
|
-
}
|
|
3577
|
-
};
|
|
3578
|
-
}
|
|
3579
|
-
return valSaved;
|
|
3580
|
-
})
|
|
3581
|
-
];
|
|
3582
|
-
this.queues$.next(this.queue);
|
|
3583
|
-
}
|
|
3584
|
-
deleteQueue(q) {
|
|
3585
|
-
const saved = [...this.queue];
|
|
3586
|
-
this.queue = [
|
|
3587
|
-
...saved.map((val) => {
|
|
3588
|
-
const valSaved = {
|
|
3589
|
-
...val
|
|
3590
|
-
};
|
|
3591
|
-
if (valSaved.item.id === q.item.id) {
|
|
3592
|
-
return null;
|
|
3593
|
-
}
|
|
3594
|
-
return valSaved;
|
|
3595
|
-
})
|
|
3596
|
-
].filter((_) => {
|
|
3597
|
-
return _;
|
|
3598
|
-
});
|
|
3599
|
-
this.queues$.next(this.queue);
|
|
3600
|
-
if (this.queue.length <= 0) {
|
|
3601
|
-
this.allQueueFinished$.next(true);
|
|
3602
|
-
}
|
|
3603
|
-
}
|
|
3604
|
-
setQueue(q) {
|
|
3605
|
-
this.addToQueue(q);
|
|
3606
|
-
}
|
|
3607
|
-
getQueue() {
|
|
3608
|
-
return this.queues$.asObservable();
|
|
3609
|
-
}
|
|
3610
|
-
finishQueueItem(q, action, status) {
|
|
3611
|
-
this.markQueueItemAsFinish(q, status, action);
|
|
3612
|
-
}
|
|
3613
|
-
removeQueueItem(q) {
|
|
3614
|
-
this.deleteQueue(q);
|
|
3615
|
-
}
|
|
3616
|
-
updateQueueItem(q, progress) {
|
|
3617
|
-
this.updateQueue(q, progress);
|
|
3618
|
-
}
|
|
3619
|
-
hasNewQueue() {
|
|
3620
|
-
return this.newQueue$.pipe(map((_) => {
|
|
3621
|
-
return _;
|
|
3622
|
-
}));
|
|
3623
|
-
}
|
|
3624
|
-
hasAllQueueFinished() {
|
|
3625
|
-
return this.allQueueFinished$.pipe(map((_) => {
|
|
3626
|
-
return _;
|
|
3627
|
-
}));
|
|
3628
|
-
}
|
|
3629
|
-
}
|
|
3630
|
-
MonkeyEcxRequestQueueModalHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestQueueModalHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3631
|
-
MonkeyEcxRequestQueueModalHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestQueueModalHandlingService, providedIn: 'root' });
|
|
3632
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestQueueModalHandlingService, decorators: [{
|
|
3633
|
-
type: Injectable,
|
|
3634
|
-
args: [{
|
|
3635
|
-
providedIn: 'root'
|
|
3636
|
-
}]
|
|
3637
|
-
}], ctorParameters: function () { return []; } });
|
|
3638
|
-
|
|
3639
|
-
/* eslint-disable max-len */
|
|
3640
|
-
class MonkeyEcxHttpConfigQueueInterceptor {
|
|
3641
|
-
constructor(injector, monkeyecxRequestQueueHandlingService) {
|
|
3642
|
-
this.injector = injector;
|
|
3643
|
-
this.monkeyecxRequestQueueHandlingService = monkeyecxRequestQueueHandlingService;
|
|
3644
|
-
// not to do
|
|
3645
|
-
}
|
|
3646
|
-
intercept(request, next) {
|
|
3647
|
-
const { injector, isQueueProperty } = this;
|
|
3648
|
-
const monkeyecxHandlingService = injector.get(MonkeyEcxHandlingService);
|
|
3649
|
-
const monkeyecxRequestQueue = monkeyecxHandlingService?.getMonkeyEcxRequestQueue();
|
|
3650
|
-
if (isQueueProperty(monkeyecxRequestQueue)) {
|
|
3651
|
-
this.monkeyecxRequestQueueHandlingService.setQueue(monkeyecxRequestQueue);
|
|
3652
|
-
}
|
|
3653
|
-
return next.handle(request).pipe(finalize(() => {
|
|
3654
|
-
if (isQueueProperty(monkeyecxRequestQueue)) {
|
|
3655
|
-
this.monkeyecxRequestQueueHandlingService.finishQueueItem(monkeyecxRequestQueue);
|
|
3656
|
-
}
|
|
3657
|
-
}));
|
|
3658
|
-
}
|
|
3659
|
-
isQueueProperty(mrq) {
|
|
3660
|
-
return (MonkeyEcxUtils.persistNullEmptyUndefined(mrq) &&
|
|
3661
|
-
MonkeyEcxUtils.persistNullEmptyUndefined(mrq?.item?.name));
|
|
3662
|
-
}
|
|
3663
|
-
}
|
|
3664
|
-
MonkeyEcxHttpConfigQueueInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigQueueInterceptor, deps: [{ token: i0.Injector }, { token: MonkeyEcxRequestQueueHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3665
|
-
MonkeyEcxHttpConfigQueueInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigQueueInterceptor });
|
|
3666
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigQueueInterceptor, decorators: [{
|
|
3667
|
-
type: Injectable
|
|
3668
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: MonkeyEcxRequestQueueHandlingService }]; } });
|
|
3669
|
-
|
|
3670
|
-
/* eslint-disable max-len */
|
|
3671
|
-
class MonkeyEcxHttpConfigLoadingInProgressInterceptor {
|
|
3672
|
-
constructor(injector) {
|
|
3673
|
-
this.injector = injector;
|
|
3674
|
-
// no to do
|
|
3675
|
-
}
|
|
3676
|
-
intercept(request, next) {
|
|
3677
|
-
const { injector, isLoadingInProgressProperty } = this;
|
|
3678
|
-
const handlingService = injector.get(MonkeyEcxHandlingService);
|
|
3679
|
-
const progressBarService = injector.get(MonkeyEcxProgressBarService);
|
|
3680
|
-
const inProgress = handlingService?.getMonkeyEcxServiceCredentials()
|
|
3681
|
-
? handlingService?.getMonkeyEcxServiceCredentials()?.requestInProgress || null
|
|
3682
|
-
: null;
|
|
3683
|
-
if (isLoadingInProgressProperty(inProgress)) {
|
|
3684
|
-
progressBarService.show();
|
|
3685
|
-
}
|
|
3686
|
-
return next.handle(request).pipe(finalize(() => {
|
|
3687
|
-
if (isLoadingInProgressProperty(inProgress)) {
|
|
3688
|
-
progressBarService.hide();
|
|
3689
|
-
}
|
|
3690
|
-
}));
|
|
3691
|
-
}
|
|
3692
|
-
isLoadingInProgressProperty(mlp) {
|
|
3693
|
-
if (!mlp)
|
|
3694
|
-
return false;
|
|
3695
|
-
return MonkeyEcxUtils.persistNullEmptyUndefined(mlp) &&
|
|
3696
|
-
MonkeyEcxUtils.persistNullEmptyUndefined(mlp.showProgress)
|
|
3697
|
-
? mlp.showProgress
|
|
3698
|
-
: true;
|
|
3699
|
-
}
|
|
3700
|
-
}
|
|
3701
|
-
MonkeyEcxHttpConfigLoadingInProgressInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigLoadingInProgressInterceptor, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3702
|
-
MonkeyEcxHttpConfigLoadingInProgressInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigLoadingInProgressInterceptor });
|
|
3703
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigLoadingInProgressInterceptor, decorators: [{
|
|
3704
|
-
type: Injectable
|
|
3705
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
3706
|
-
|
|
3707
|
-
class MonkeyEcxHttpConfigInterceptorModule {
|
|
3708
|
-
static forRoot() {
|
|
3709
|
-
return {
|
|
3710
|
-
ngModule: MonkeyEcxHttpConfigInterceptorModule,
|
|
3711
|
-
providers: [
|
|
3712
|
-
{
|
|
3713
|
-
provide: HTTP_INTERCEPTORS,
|
|
3714
|
-
useClass: MonkeyEcxHttpConfigHeaderInterceptor,
|
|
3715
|
-
multi: true,
|
|
3716
|
-
},
|
|
3717
|
-
{
|
|
3718
|
-
provide: HTTP_INTERCEPTORS,
|
|
3719
|
-
useClass: MonkeyEcxHttpConfigErrorInterceptor,
|
|
3720
|
-
multi: true,
|
|
3721
|
-
},
|
|
3722
|
-
{
|
|
3723
|
-
provide: HTTP_INTERCEPTORS,
|
|
3724
|
-
useClass: MonkeyEcxHttpConfigQueueInterceptor,
|
|
3725
|
-
multi: true,
|
|
3726
|
-
},
|
|
3727
|
-
{
|
|
3728
|
-
provide: HTTP_INTERCEPTORS,
|
|
3729
|
-
useClass: MonkeyEcxHttpConfigLoadingInProgressInterceptor,
|
|
3730
|
-
multi: true,
|
|
3731
|
-
},
|
|
3732
|
-
],
|
|
3733
|
-
};
|
|
3734
|
-
}
|
|
3735
|
-
}
|
|
3736
|
-
MonkeyEcxHttpConfigInterceptorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigInterceptorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3737
|
-
MonkeyEcxHttpConfigInterceptorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigInterceptorModule, imports: [CommonModule] });
|
|
3738
|
-
MonkeyEcxHttpConfigInterceptorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigInterceptorModule, imports: [[CommonModule]] });
|
|
3739
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigInterceptorModule, decorators: [{
|
|
3740
|
-
type: NgModule,
|
|
3741
|
-
args: [{
|
|
3742
|
-
imports: [CommonModule],
|
|
3743
|
-
}]
|
|
3744
|
-
}] });
|
|
3745
|
-
|
|
3746
|
-
class MonkeyEcxModel {
|
|
3747
|
-
getAction(type) {
|
|
3748
|
-
const { _links } = this;
|
|
3749
|
-
if (!_links)
|
|
3750
|
-
return null;
|
|
3751
|
-
const link = _links[type.toLowerCase()];
|
|
3752
|
-
return link;
|
|
3753
|
-
}
|
|
3754
|
-
}
|
|
3755
|
-
|
|
3756
|
-
/* eslint-disable indent */
|
|
3757
|
-
class MonkeyEcxConfigModule {
|
|
3758
|
-
constructor(parentModule) {
|
|
3759
|
-
if (parentModule) {
|
|
3760
|
-
throw new Error('MonkeyEcxConfigModule is already loaded. Import it in the AppModule only!');
|
|
3761
|
-
}
|
|
3762
|
-
}
|
|
3763
|
-
static forRoot() {
|
|
3764
|
-
return {
|
|
3765
|
-
ngModule: MonkeyEcxConfigModule,
|
|
3766
|
-
providers: [MonkeyEcxConfigService]
|
|
3767
|
-
};
|
|
3768
|
-
}
|
|
3769
|
-
}
|
|
3770
|
-
MonkeyEcxConfigModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxConfigModule, deps: [{ token: MonkeyEcxConfigModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3771
|
-
MonkeyEcxConfigModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxConfigModule });
|
|
3772
|
-
MonkeyEcxConfigModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxConfigModule });
|
|
3773
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxConfigModule, decorators: [{
|
|
3774
|
-
type: NgModule
|
|
3775
|
-
}], ctorParameters: function () { return [{ type: MonkeyEcxConfigModule, decorators: [{
|
|
3776
|
-
type: Optional
|
|
3777
|
-
}, {
|
|
3778
|
-
type: SkipSelf
|
|
3779
|
-
}] }]; } });
|
|
3780
|
-
|
|
3781
|
-
class MonkeyEcxLoggedHandlingService {
|
|
3782
|
-
constructor() {
|
|
3783
|
-
this.schedules = [];
|
|
3784
|
-
// not to do
|
|
3785
|
-
}
|
|
3786
|
-
destroySchedule() {
|
|
3787
|
-
this.schedules.forEach((sch) => {
|
|
3788
|
-
clearInterval(sch.interval);
|
|
3789
|
-
});
|
|
3790
|
-
this.schedules = [];
|
|
3791
|
-
}
|
|
3792
|
-
addSchedule(sch) {
|
|
3793
|
-
this.schedules = sch;
|
|
3794
|
-
}
|
|
3795
|
-
destroy() {
|
|
3796
|
-
this.destroySchedule();
|
|
3797
|
-
}
|
|
3798
|
-
}
|
|
3799
|
-
MonkeyEcxLoggedHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxLoggedHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3800
|
-
MonkeyEcxLoggedHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxLoggedHandlingService, providedIn: 'root' });
|
|
3801
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxLoggedHandlingService, decorators: [{
|
|
3802
|
-
type: Injectable,
|
|
3803
|
-
args: [{
|
|
3804
|
-
providedIn: 'root'
|
|
3805
|
-
}]
|
|
3806
|
-
}], ctorParameters: function () { return []; } });
|
|
3807
|
-
|
|
3808
|
-
class MonkeyEcxRequestDownloadHandlingService {
|
|
3809
|
-
constructor() {
|
|
3810
|
-
this.download = [];
|
|
3811
|
-
this.download$ = new BehaviorSubject([]);
|
|
3812
|
-
}
|
|
3813
|
-
addTo(q) {
|
|
3814
|
-
this.download.push(q);
|
|
3815
|
-
this.download$.next(this.download);
|
|
3816
|
-
}
|
|
3817
|
-
markItemAsFinish(q, status) {
|
|
3818
|
-
const saved = [...this.download];
|
|
3819
|
-
this.download = [
|
|
3820
|
-
...saved
|
|
3821
|
-
.map((val) => {
|
|
3822
|
-
if (val.status === MonkeyEcxDownloadEvents.OnGoing) {
|
|
3823
|
-
const valSaved = {
|
|
3824
|
-
...val
|
|
3825
|
-
};
|
|
3826
|
-
if (valSaved.item.id === q.item.id) {
|
|
3827
|
-
return {
|
|
3828
|
-
...valSaved,
|
|
3829
|
-
status: status || MonkeyEcxDownloadEvents.Finished
|
|
3830
|
-
};
|
|
3831
|
-
}
|
|
3832
|
-
return valSaved;
|
|
3833
|
-
}
|
|
3834
|
-
return null;
|
|
3835
|
-
})
|
|
3836
|
-
.filter((_) => {
|
|
3837
|
-
return _;
|
|
3838
|
-
})
|
|
3839
|
-
];
|
|
3840
|
-
this.download = this.download.filter((_) => {
|
|
3841
|
-
return _.status === MonkeyEcxDownloadEvents.OnGoing;
|
|
3842
|
-
});
|
|
3843
|
-
this.download$.next(this.download);
|
|
3844
|
-
}
|
|
3845
|
-
updateItem(q, loaded, total) {
|
|
3846
|
-
const saved = [...this.download];
|
|
3847
|
-
this.download = [
|
|
3848
|
-
...saved.map((val) => {
|
|
3849
|
-
const valSaved = {
|
|
3850
|
-
...val
|
|
3851
|
-
};
|
|
3852
|
-
const currentPecentage = Math.floor(((loaded || 0) / (total || 0)) * 100);
|
|
3853
|
-
const totalPercentage = 100;
|
|
3854
|
-
if (valSaved.item.id === q.item.id) {
|
|
3855
|
-
return {
|
|
3856
|
-
...valSaved,
|
|
3857
|
-
loaded,
|
|
3858
|
-
total,
|
|
3859
|
-
currentPercentage: currentPecentage,
|
|
3860
|
-
totalPercentage
|
|
3861
|
-
};
|
|
3862
|
-
}
|
|
3863
|
-
return valSaved;
|
|
3864
|
-
})
|
|
3865
|
-
];
|
|
3866
|
-
this.download$.next(this.download);
|
|
3867
|
-
}
|
|
3868
|
-
set(q) {
|
|
3869
|
-
this.addTo(q);
|
|
3870
|
-
}
|
|
3871
|
-
get() {
|
|
3872
|
-
return this.download$.asObservable();
|
|
3873
|
-
}
|
|
3874
|
-
update(q, loaded, total) {
|
|
3875
|
-
this.updateItem(q, loaded, total);
|
|
3876
|
-
}
|
|
3877
|
-
finishItem(q, status) {
|
|
3878
|
-
this.markItemAsFinish(q, status);
|
|
3879
|
-
}
|
|
3880
|
-
hasDownloadOnGoing() {
|
|
3881
|
-
const found = this.download.find((_) => {
|
|
3882
|
-
return _.status === MonkeyEcxDownloadEvents.OnGoing;
|
|
3883
|
-
});
|
|
3884
|
-
return MonkeyEcxUtils.persistNullEmptyUndefined(found);
|
|
3885
|
-
}
|
|
3886
|
-
}
|
|
3887
|
-
MonkeyEcxRequestDownloadHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestDownloadHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3888
|
-
MonkeyEcxRequestDownloadHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestDownloadHandlingService, providedIn: 'root' });
|
|
3889
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestDownloadHandlingService, decorators: [{
|
|
3890
|
-
type: Injectable,
|
|
3891
|
-
args: [{
|
|
3892
|
-
providedIn: 'root'
|
|
3893
|
-
}]
|
|
3894
|
-
}], ctorParameters: function () { return []; } });
|
|
3895
|
-
|
|
3896
|
-
class MonkeyEcxRequestDownloadedHandlingService {
|
|
3897
|
-
constructor() {
|
|
3898
|
-
this.downloaded = [];
|
|
3899
|
-
this.downloaded$ = new BehaviorSubject([]);
|
|
3900
|
-
}
|
|
3901
|
-
addTo(q) {
|
|
3902
|
-
this.downloaded.push(q);
|
|
3903
|
-
this.downloaded$.next(this.downloaded);
|
|
3904
|
-
}
|
|
3905
|
-
markItemAsFinish(q, status) {
|
|
3906
|
-
const saved = [...this.downloaded];
|
|
3907
|
-
this.downloaded = [
|
|
3908
|
-
...saved.map((val) => {
|
|
3909
|
-
if (val.status === MonkeyEcxDownloadEvents.OnGoing) {
|
|
3910
|
-
const valSaved = {
|
|
3911
|
-
...val
|
|
3912
|
-
};
|
|
3913
|
-
if (valSaved.item.id === q.item.id) {
|
|
3914
|
-
return {
|
|
3915
|
-
...valSaved,
|
|
3916
|
-
status: status || MonkeyEcxDownloadEvents.Finished,
|
|
3917
|
-
action: q.action
|
|
3918
|
-
};
|
|
3919
|
-
}
|
|
3920
|
-
return valSaved;
|
|
3921
|
-
}
|
|
3922
|
-
return val;
|
|
3923
|
-
})
|
|
3924
|
-
];
|
|
3925
|
-
this.downloaded$.next(this.downloaded);
|
|
3926
|
-
}
|
|
3927
|
-
set(q) {
|
|
3928
|
-
this.addTo(q);
|
|
3929
|
-
}
|
|
3930
|
-
get() {
|
|
3931
|
-
return this.downloaded$.asObservable();
|
|
3932
|
-
}
|
|
3933
|
-
finishItem(q, status) {
|
|
3934
|
-
this.markItemAsFinish(q, status);
|
|
3935
|
-
}
|
|
3936
|
-
hasDownloadOnGoing() {
|
|
3937
|
-
const found = this.downloaded.find((_) => {
|
|
3938
|
-
return _.status === MonkeyEcxDownloadEvents.OnGoing;
|
|
3939
|
-
});
|
|
3940
|
-
return MonkeyEcxUtils.persistNullEmptyUndefined(found);
|
|
3941
|
-
}
|
|
3942
|
-
}
|
|
3943
|
-
MonkeyEcxRequestDownloadedHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestDownloadedHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3944
|
-
MonkeyEcxRequestDownloadedHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestDownloadedHandlingService, providedIn: 'root' });
|
|
3945
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestDownloadedHandlingService, decorators: [{
|
|
3946
|
-
type: Injectable,
|
|
3947
|
-
args: [{
|
|
3948
|
-
providedIn: 'root'
|
|
3949
|
-
}]
|
|
3950
|
-
}], ctorParameters: function () { return []; } });
|
|
3951
|
-
|
|
3952
|
-
class MonkeyEcxDiscoveryParamsService {
|
|
3953
|
-
constructor(router) {
|
|
3954
|
-
this.router = router;
|
|
3955
|
-
// not to do
|
|
3956
|
-
}
|
|
3957
|
-
getLastChild(route) {
|
|
3958
|
-
if (route.firstChild) {
|
|
3959
|
-
return this.getLastChild(route.firstChild);
|
|
3960
|
-
}
|
|
3961
|
-
return route;
|
|
3962
|
-
}
|
|
3963
|
-
setData(field, value) {
|
|
3964
|
-
const { root } = this.router.routerState.snapshot;
|
|
3965
|
-
const route = this.getLastChild(root);
|
|
3966
|
-
route.data[field] = value;
|
|
3967
|
-
}
|
|
3968
|
-
getData(field) {
|
|
3969
|
-
const { root } = this.router.routerState.snapshot;
|
|
3970
|
-
const route = this.getLastChild(root);
|
|
3971
|
-
const found = MonkeyEcxUtils.persistNullEmptyUndefined(route) ? route.data[field] : null;
|
|
3972
|
-
return found;
|
|
3973
|
-
}
|
|
3974
|
-
getDataFromCurrentNavigation(field) {
|
|
3975
|
-
const navigation = this.router.getCurrentNavigation();
|
|
3976
|
-
let state = null;
|
|
3977
|
-
if (MonkeyEcxUtils.persistNullEmptyUndefined(navigation)) {
|
|
3978
|
-
state = navigation?.extras.state;
|
|
3979
|
-
}
|
|
3980
|
-
return state ? state[field] : null;
|
|
3981
|
-
}
|
|
3982
|
-
getParam(param) {
|
|
3983
|
-
const { root } = this.router.routerState.snapshot;
|
|
3984
|
-
const route = this.getLastChild(root);
|
|
3985
|
-
let found = MonkeyEcxUtils.persistNullEmptyUndefined(route)
|
|
3986
|
-
? route?.paramMap?.get(param) || ''
|
|
3987
|
-
: '';
|
|
3988
|
-
if (!MonkeyEcxUtils.persistNullEmptyUndefined(found))
|
|
3989
|
-
found = this.getData(param);
|
|
3990
|
-
return found;
|
|
3991
|
-
}
|
|
3992
|
-
}
|
|
3993
|
-
MonkeyEcxDiscoveryParamsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDiscoveryParamsService, deps: [{ token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3994
|
-
MonkeyEcxDiscoveryParamsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDiscoveryParamsService, providedIn: 'root' });
|
|
3995
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDiscoveryParamsService, decorators: [{
|
|
3996
|
-
type: Injectable,
|
|
3997
|
-
args: [{
|
|
3998
|
-
providedIn: 'root'
|
|
3999
|
-
}]
|
|
4000
|
-
}], ctorParameters: function () { return [{ type: i1$3.Router }]; } });
|
|
4001
|
-
|
|
4002
|
-
class MonkeyEcxRequestScheduleService {
|
|
4003
|
-
constructor(monkeyecxService, monkeyecxLoggedHandlingService) {
|
|
4004
|
-
this.monkeyecxService = monkeyecxService;
|
|
4005
|
-
this.monkeyecxLoggedHandlingService = monkeyecxLoggedHandlingService;
|
|
4006
|
-
this.schedule = [];
|
|
4007
|
-
// not to do
|
|
4008
|
-
}
|
|
4009
|
-
addToSchedule(q) {
|
|
4010
|
-
this.schedule.push(q);
|
|
4011
|
-
this.monkeyecxLoggedHandlingService.addSchedule(this.schedule);
|
|
4012
|
-
}
|
|
4013
|
-
removeFromSchedule(q) {
|
|
4014
|
-
clearInterval(q.interval);
|
|
4015
|
-
const saved = [...this.schedule];
|
|
4016
|
-
this.schedule = [
|
|
4017
|
-
...saved.map((sch) => {
|
|
4018
|
-
const savedLocal = {
|
|
4019
|
-
...sch,
|
|
4020
|
-
};
|
|
4021
|
-
if (sch.id === q.id) {
|
|
4022
|
-
return null;
|
|
4023
|
-
}
|
|
4024
|
-
return savedLocal;
|
|
4025
|
-
}),
|
|
4026
|
-
].filter((_) => {
|
|
4027
|
-
return _;
|
|
4028
|
-
});
|
|
4029
|
-
this.monkeyecxLoggedHandlingService.addSchedule(this.schedule);
|
|
4030
|
-
}
|
|
4031
|
-
removeFromScheduleById(id) {
|
|
4032
|
-
const q = this.getScheduleById(id);
|
|
4033
|
-
clearInterval(q.interval);
|
|
4034
|
-
const saved = [...this.schedule];
|
|
4035
|
-
this.schedule = [
|
|
4036
|
-
...saved.map((sch) => {
|
|
4037
|
-
const savedLocal = {
|
|
4038
|
-
...sch,
|
|
4039
|
-
};
|
|
4040
|
-
if (sch.id === q.id) {
|
|
4041
|
-
return null;
|
|
4042
|
-
}
|
|
4043
|
-
return savedLocal;
|
|
4044
|
-
}),
|
|
4045
|
-
].filter((_) => {
|
|
4046
|
-
return _;
|
|
4047
|
-
});
|
|
4048
|
-
this.monkeyecxLoggedHandlingService.addSchedule(this.schedule);
|
|
4049
|
-
}
|
|
4050
|
-
doCall(sch) {
|
|
4051
|
-
const { url, method, params, data, action } = sch;
|
|
4052
|
-
this.monkeyecxService[method.toLowerCase()](`${url}`, params).subscribe((resp) => {
|
|
4053
|
-
action({
|
|
4054
|
-
...data,
|
|
4055
|
-
...resp,
|
|
4056
|
-
}, sch);
|
|
4057
|
-
}, () => {
|
|
4058
|
-
this.removeFromSchedule(sch);
|
|
4059
|
-
});
|
|
4060
|
-
}
|
|
4061
|
-
setSchedule(q, delay = 3000) {
|
|
4062
|
-
const interval = setInterval(() => {
|
|
4063
|
-
this.doCall({
|
|
4064
|
-
...q,
|
|
4065
|
-
interval,
|
|
4066
|
-
});
|
|
4067
|
-
}, delay);
|
|
4068
|
-
const sch = {
|
|
4069
|
-
...q,
|
|
4070
|
-
id: `${MonkeyEcxUtils.getRandomString(40)}`,
|
|
4071
|
-
interval,
|
|
4072
|
-
};
|
|
4073
|
-
this.addToSchedule(sch);
|
|
4074
|
-
return sch;
|
|
4075
|
-
}
|
|
4076
|
-
removeSchedule(q) {
|
|
4077
|
-
this.removeFromSchedule(q);
|
|
4078
|
-
}
|
|
4079
|
-
removeScheduleById(id) {
|
|
4080
|
-
this.removeFromScheduleById(id);
|
|
4081
|
-
}
|
|
4082
|
-
getScheduleById(id) {
|
|
4083
|
-
const q = this.schedule.find((sch) => {
|
|
4084
|
-
return sch.id === id;
|
|
4085
|
-
});
|
|
4086
|
-
return q;
|
|
4087
|
-
}
|
|
4088
|
-
}
|
|
4089
|
-
MonkeyEcxRequestScheduleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestScheduleService, deps: [{ token: MonkeyEcxService }, { token: MonkeyEcxLoggedHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4090
|
-
MonkeyEcxRequestScheduleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestScheduleService, providedIn: 'root' });
|
|
4091
|
-
__decorate([
|
|
4092
|
-
MonkeyEcxCoreService({
|
|
4093
|
-
httpResponse: {
|
|
4094
|
-
httpCodeIgnore: [400, 403, 404, 500, 503],
|
|
4095
|
-
},
|
|
4096
|
-
requestInProgress: {
|
|
4097
|
-
showProgress: false,
|
|
4098
|
-
},
|
|
4099
|
-
})
|
|
4100
|
-
], MonkeyEcxRequestScheduleService.prototype, "doCall", null);
|
|
4101
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestScheduleService, decorators: [{
|
|
4102
|
-
type: Injectable,
|
|
4103
|
-
args: [{
|
|
4104
|
-
providedIn: 'root',
|
|
4105
|
-
}]
|
|
4106
|
-
}], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxLoggedHandlingService }]; }, propDecorators: { doCall: [] } });
|
|
4107
|
-
|
|
4108
|
-
/* eslint-disable no-unused-vars */
|
|
4109
|
-
var OpSearch;
|
|
4110
|
-
(function (OpSearch) {
|
|
4111
|
-
OpSearch["LIKE"] = ":*:value*";
|
|
4112
|
-
OpSearch["BETWEEN"] = ":first AND :last";
|
|
4113
|
-
OpSearch["OR"] = "OR";
|
|
4114
|
-
OpSearch["AND"] = "AND";
|
|
4115
|
-
OpSearch["GT"] = ">:value";
|
|
4116
|
-
OpSearch["LT"] = "<:value";
|
|
4117
|
-
OpSearch["EQUAL"] = "::value";
|
|
4118
|
-
})(OpSearch || (OpSearch = {}));
|
|
4119
|
-
class MonkeyEcxSpecificationSearch {
|
|
4120
|
-
constructor() {
|
|
4121
|
-
// not to do
|
|
4122
|
-
}
|
|
4123
|
-
handleValue(value) {
|
|
4124
|
-
return Object.entries(value).map(([key, value1]) => {
|
|
4125
|
-
if (!MonkeyEcxUtils.persistNullEmptyUndefined(value1)) {
|
|
4126
|
-
return null;
|
|
4127
|
-
}
|
|
4128
|
-
if (Array.isArray(value1)) {
|
|
4129
|
-
if (key === OpSearch.BETWEEN) {
|
|
4130
|
-
return `${key}`.replace(':first', value1[0]).replace(':last', value1[1]);
|
|
4131
|
-
}
|
|
4132
|
-
}
|
|
4133
|
-
return `${key}`.replace(':value', `${value1}`);
|
|
4134
|
-
})[0];
|
|
4135
|
-
}
|
|
4136
|
-
queryVisitor(value) {
|
|
4137
|
-
const okay = Object.entries(value).map(([key1, value1]) => {
|
|
4138
|
-
if (key1 === OpSearch.OR || key1 === OpSearch.AND) {
|
|
4139
|
-
const join = value1
|
|
4140
|
-
.map((_) => {
|
|
4141
|
-
return Object.entries(_).map(([key2, value2]) => {
|
|
4142
|
-
if (value2 instanceof Object) {
|
|
4143
|
-
value2 = this.handleValue(value2);
|
|
4144
|
-
}
|
|
4145
|
-
return this.criteriaParser(key2, value2);
|
|
4146
|
-
})[0];
|
|
4147
|
-
})
|
|
4148
|
-
.filter((_) => {
|
|
4149
|
-
return _;
|
|
4150
|
-
})
|
|
4151
|
-
.join(` ${key1} `);
|
|
4152
|
-
return `${join ? `(${join})` : ''}`;
|
|
4153
|
-
}
|
|
4154
|
-
if (value1 instanceof Object) {
|
|
4155
|
-
value1 = this.handleValue(value1);
|
|
4156
|
-
}
|
|
4157
|
-
return this.criteriaParser(key1, value1);
|
|
4158
|
-
});
|
|
4159
|
-
return okay
|
|
4160
|
-
.filter((_) => {
|
|
4161
|
-
return _;
|
|
4162
|
-
})
|
|
4163
|
-
.join(' AND ');
|
|
4164
|
-
}
|
|
4165
|
-
criteriaParser(key, value) {
|
|
4166
|
-
if (!MonkeyEcxUtils.persistNullEmptyUndefined(value)) {
|
|
4167
|
-
return '';
|
|
4168
|
-
}
|
|
4169
|
-
if (value instanceof Object) {
|
|
4170
|
-
return this.queryVisitor(value);
|
|
4171
|
-
}
|
|
4172
|
-
return `${key}${value}`;
|
|
4173
|
-
}
|
|
4174
|
-
build(spec) {
|
|
4175
|
-
try {
|
|
4176
|
-
return this.queryVisitor(spec);
|
|
4177
|
-
}
|
|
4178
|
-
catch (e) {
|
|
4179
|
-
throw new Error(`MonkeyEcxSpecificationSearch Error ${e}`);
|
|
4180
|
-
}
|
|
4181
|
-
}
|
|
4182
|
-
buildMoreThanOne(field, op = OpSearch.EQUAL) {
|
|
4183
|
-
let self = this;
|
|
4184
|
-
try {
|
|
4185
|
-
if (!self[field])
|
|
4186
|
-
return [];
|
|
4187
|
-
const filters = self[field]?.split(',')?.map((filter) => {
|
|
4188
|
-
if (!filter)
|
|
4189
|
-
return null;
|
|
4190
|
-
return {
|
|
4191
|
-
[field]: {
|
|
4192
|
-
[op]: `${filter}`
|
|
4193
|
-
}
|
|
4194
|
-
};
|
|
4195
|
-
}).filter((val) => { return val; });
|
|
4196
|
-
return filters || [];
|
|
4197
|
-
}
|
|
4198
|
-
catch (e) {
|
|
4199
|
-
throw new Error(`MonkeyEcxSpecificationSearch Error ${e}`);
|
|
4200
|
-
}
|
|
4201
|
-
}
|
|
4202
|
-
}
|
|
4203
|
-
|
|
4204
|
-
class MonkeyFrontCoreModuleModule {
|
|
4205
|
-
}
|
|
4206
|
-
MonkeyFrontCoreModuleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyFrontCoreModuleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4207
|
-
MonkeyFrontCoreModuleModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyFrontCoreModuleModule, imports: [CommonModule,
|
|
4208
|
-
HttpClientModule, i1$1.TranslateModule, MonkeyEcxConfigModule, MonkeyEcxHttpConfigInterceptorModule, MonkeyEcxErrorHandlingModule, MonkeyStyleGuideModule, i1$5.ServiceWorkerModule, ClosedToMaintenanceModule,
|
|
4209
|
-
VersionChangedModule] });
|
|
4210
|
-
MonkeyFrontCoreModuleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyFrontCoreModuleModule, providers: [
|
|
4211
|
-
MonkeyStyleGuideModalService,
|
|
4212
|
-
MonkeyStyleGuideSettingsService,
|
|
4213
|
-
MonkeyStyleGuideSnackbarService
|
|
4214
|
-
], imports: [[
|
|
4215
|
-
CommonModule,
|
|
4216
|
-
HttpClientModule,
|
|
4217
|
-
TranslateModule.forRoot(),
|
|
4218
|
-
MonkeyEcxConfigModule.forRoot(),
|
|
4219
|
-
MonkeyEcxHttpConfigInterceptorModule.forRoot(),
|
|
4220
|
-
MonkeyEcxErrorHandlingModule.forRoot(),
|
|
4221
|
-
MonkeyStyleGuideModule,
|
|
4222
|
-
ServiceWorkerModule.register('ngsw-worker.js'),
|
|
4223
|
-
ClosedToMaintenanceModule,
|
|
4224
|
-
VersionChangedModule
|
|
4225
|
-
]] });
|
|
4226
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyFrontCoreModuleModule, decorators: [{
|
|
4227
|
-
type: NgModule,
|
|
4228
|
-
args: [{
|
|
4229
|
-
imports: [
|
|
4230
|
-
CommonModule,
|
|
4231
|
-
HttpClientModule,
|
|
4232
|
-
TranslateModule.forRoot(),
|
|
4233
|
-
MonkeyEcxConfigModule.forRoot(),
|
|
4234
|
-
MonkeyEcxHttpConfigInterceptorModule.forRoot(),
|
|
4235
|
-
MonkeyEcxErrorHandlingModule.forRoot(),
|
|
4236
|
-
MonkeyStyleGuideModule,
|
|
4237
|
-
ServiceWorkerModule.register('ngsw-worker.js'),
|
|
4238
|
-
ClosedToMaintenanceModule,
|
|
4239
|
-
VersionChangedModule
|
|
4240
|
-
],
|
|
4241
|
-
providers: [
|
|
4242
|
-
MonkeyStyleGuideModalService,
|
|
4243
|
-
MonkeyStyleGuideSettingsService,
|
|
4244
|
-
MonkeyStyleGuideSnackbarService
|
|
4245
|
-
]
|
|
4246
|
-
}]
|
|
4247
|
-
}] });
|
|
4248
|
-
|
|
4249
|
-
/*
|
|
4250
|
-
* Public API Surface of monkey-front-core
|
|
4251
|
-
*/
|
|
4252
|
-
|
|
4253
|
-
/**
|
|
4254
|
-
* Generated bundle index. Do not edit.
|
|
4255
|
-
*/
|
|
4256
|
-
|
|
4257
|
-
export { ClosedToMaintenanceComponent, ClosedToMaintenanceModule, decoratorsUtils as DecoratorsUtils, MonkeyEcxAuthGuard, MonkeyEcxAuthGuardLogin, MonkeyEcxAuthenticationService, MonkeyEcxCommonsService, MonkeyEcxConfigModule, MonkeyEcxConfigService, MonkeyEcxCookieStorageService, MonkeyEcxCoreCharts, MonkeyEcxCoreClearDecorators, MonkeyEcxCoreLog, MonkeyEcxCoreService, MonkeyEcxCoreServiceConstructor, MonkeyEcxCoreServicePaged, MonkeyEcxCoreServiceQueue, MonkeyEcxDirectivesModule, MonkeyEcxDiscoveryParamsService, MonkeyEcxDisplayFirstNamePipe, MonkeyEcxDragDropDirective, MonkeyEcxErrorConfigService, MonkeyEcxErrorHandlingModule, MonkeyEcxErrorHandlingService, MonkeyEcxFeatureDirective, MonkeyEcxFeatureToggleService, MonkeyEcxFormatAddressPipe, MonkeyEcxFormatCurrency, MonkeyEcxFormatCurrencyPipe, MonkeyEcxFormatDateGroupPipe, MonkeyEcxFormatDateTimelapsePipe, MonkeyEcxFormatDocumentPipe, MonkeyEcxFormatDocumentTypePipe, MonkeyEcxFormatNumberPipe, MonkeyEcxFormatPhonePipe, MonkeyEcxFormatSizePipe, MonkeyEcxFormatUpper, MonkeyEcxFormatValue, MonkeyEcxFormatZipCodePipe, MonkeyEcxHandlingService, MonkeyEcxHttpConfigErrorInterceptor, MonkeyEcxHttpConfigHeaderInterceptor, MonkeyEcxHttpConfigInterceptorModule, MonkeyEcxHttpConfigLoadingInProgressInterceptor, MonkeyEcxHttpConfigQueueInterceptor, MonkeyEcxHttpErrorHandlingService, MonkeyEcxLoggedHandlingService, MonkeyEcxLogsConfigService, MonkeyEcxMaintenanceConfigService, MonkeyEcxModel, MonkeyEcxOnlyAlphaNumericDirective, MonkeyEcxOnlyNumbersDirective, MonkeyEcxOthersErrorsHandlingService, MonkeyEcxPipesModule, MonkeyEcxProgressBarComponent, MonkeyEcxProgressBarModule, MonkeyEcxProgressBarService, MonkeyEcxRequestDownloadHandlingService, MonkeyEcxRequestDownloadedHandlingService, MonkeyEcxRequestPagedHandling, MonkeyEcxRequestQueueHandlingService, MonkeyEcxRequestQueueModalHandlingService, MonkeyEcxRequestScheduleService, MonkeyEcxSecurityConsoleConfigService, MonkeyEcxSecurityDirective, MonkeyEcxService, MonkeyEcxServiceDownload, MonkeyEcxServiceUpload, MonkeyEcxServiceWorkerConfigService, MonkeyEcxSpecificationSearch, MonkeyEcxTextTruncatePipe, MonkeyEcxTokenStorageService, MonkeyEcxTooltipDirective, MonkeyEcxTruncateQtdPipe, MonkeyEcxUtils, MonkeyEcxi18nConfigService, MonkeyFrontCoreModuleModule, OpSearch, statics as Statics, validateUtils as ValidateUtils, Validators, VersionChangedComponent, VersionChangedModule, comboValidator, dateRangeValidator, dateStartEndValidator, dateValidator, documentValidator, emailValidator, passwordConfirmValidator, registerValidator, trueValidator, urlValidator, valueGreaterThanZero, zipCodeValidator };
|
|
4258
|
-
//# sourceMappingURL=monkey-front-core.mjs.map
|