@koalarx/ui 12.4.1 → 12.4.2
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/alert/README.md +24 -0
- package/alert/bundles/koalarx-ui-alert.umd.js +153 -0
- package/alert/bundles/koalarx-ui-alert.umd.js.map +1 -0
- package/alert/esm2015/index.js +7 -0
- package/alert/esm2015/koalarx-ui-alert.js +5 -0
- package/alert/esm2015/lib/dialog-alert.component.js +43 -0
- package/alert/esm2015/lib/koala.alert-config.interface.js +2 -0
- package/alert/esm2015/lib/koala.alert.enum.js +9 -0
- package/alert/esm2015/lib/koala.alert.module.js +31 -0
- package/alert/esm2015/lib/koala.alert.service.js +21 -0
- package/alert/esm2015/lib/koala.request-code-to-alert-enum.translate.js +18 -0
- package/alert/fesm2015/koalarx-ui-alert.js +121 -0
- package/alert/fesm2015/koalarx-ui-alert.js.map +1 -0
- package/alert/index.d.ts +6 -6
- package/alert/koalarx-ui-alert.d.ts +4 -0
- package/alert/koalarx-ui-alert.metadata.json +1 -0
- package/alert/lib/dialog-alert.component.d.ts +7 -0
- package/alert/{koala.alert-config.interface.d.ts → lib/koala.alert-config.interface.d.ts} +1 -1
- package/alert/{koala.alert.enum.d.ts → lib/koala.alert.enum.d.ts} +0 -0
- package/alert/lib/koala.alert.module.d.ts +2 -0
- package/alert/{koala.alert.service.d.ts → lib/koala.alert.service.d.ts} +1 -4
- package/alert/{koala.request-code-to-alert-enum.translate.d.ts → lib/koala.request-code-to-alert-enum.translate.d.ts} +0 -0
- package/alert/package.json +19 -0
- package/button/bundles/koalarx-ui-button.umd.js +71 -0
- package/button/bundles/koalarx-ui-button.umd.js.map +1 -0
- package/button/esm2015/index.js +3 -0
- package/button/esm2015/koalarx-ui-button.js +5 -0
- package/button/esm2015/lib/button.component.js +31 -0
- package/button/esm2015/lib/koala.button.module.js +27 -0
- package/button/fesm2015/koalarx-ui-button.js +63 -0
- package/button/fesm2015/koalarx-ui-button.js.map +1 -0
- package/button/index.d.ts +2 -2
- package/button/koalarx-ui-button.d.ts +4 -0
- package/button/koalarx-ui-button.metadata.json +1 -0
- package/button/lib/button.component.d.ts +13 -0
- package/button/lib/koala.button.module.d.ts +2 -0
- package/button/package.json +19 -0
- package/core/README.md +24 -0
- package/core/bundles/koalarx-ui-core.umd.js +1821 -0
- package/core/bundles/koalarx-ui-core.umd.js.map +1 -0
- package/core/esm2015/index.js +51 -0
- package/core/esm2015/koalarx-ui-core.js +7 -0
- package/core/esm2015/lib/environments/koalaEnvironment.js +4 -0
- package/core/esm2015/lib/loader/loader-bar-page.component.js +22 -0
- package/core/esm2015/lib/loader/loader-bar-page.interface.js +2 -0
- package/core/esm2015/lib/loader/loader-config.interface.js +2 -0
- package/core/esm2015/lib/mask-options.js +4 -0
- package/core/esm2015/lib/ngx-koala.module.js +35 -0
- package/core/esm2015/lib/page/koala-language.helper.js +114 -0
- package/core/esm2015/lib/page/koala-oauth2-config.interface.js +2 -0
- package/core/esm2015/lib/page/koala-page-pallet-colors.interface.js +2 -0
- package/core/esm2015/lib/page/koala.page.module.js +46 -0
- package/core/esm2015/lib/page/koala.user-menu-options.interface.js +2 -0
- package/core/esm2015/lib/page/notifications/koala.notification.interface.js +2 -0
- package/core/esm2015/lib/page/notifications/notification.component.js +43 -0
- package/core/esm2015/lib/page/page.component.js +396 -0
- package/core/esm2015/lib/router/koala.parameter-hash-location-stategy.js +16 -0
- package/core/esm2015/lib/services/api-requester/factory/koala.response.factory.js +48 -0
- package/core/esm2015/lib/services/api-requester/helpers/error/koala.client.error.js +3 -0
- package/core/esm2015/lib/services/api-requester/helpers/error/koala.errors.helper.js +46 -0
- package/core/esm2015/lib/services/api-requester/helpers/error/koala.not-found.error.js +3 -0
- package/core/esm2015/lib/services/api-requester/helpers/error/koala.success.error.js +3 -0
- package/core/esm2015/lib/services/api-requester/helpers/error/koala.unhautorized.error.js +3 -0
- package/core/esm2015/lib/services/api-requester/helpers/service/koala.request-header.helper.js +15 -0
- package/core/esm2015/lib/services/api-requester/koala.api-requester.base.js +70 -0
- package/{esm2015/core → core/esm2015/lib}/services/api-requester/koala.api-requester.service.js +11 -8
- package/core/esm2015/lib/services/csv/koala.csv.service.js +38 -0
- package/core/esm2015/lib/services/loader/koala.loader.service.js +32 -0
- package/core/esm2015/lib/services/openid/koala.oauth.config.js +33 -0
- package/core/esm2015/lib/services/openid/koala.oauth2.service.js +196 -0
- package/core/esm2015/lib/services/request/koala.request.service.js +53 -0
- package/core/esm2015/lib/services/token/koala.token.service.js +52 -0
- package/core/esm2015/lib/services/token/token.factory.js +31 -0
- package/core/esm2015/lib/services/xlsx/koala.xlsx-config.interface.js +2 -0
- package/core/esm2015/lib/services/xlsx/koala.xlsx.service.js +61 -0
- package/core/fesm2015/koalarx-ui-core.js +1434 -0
- package/core/fesm2015/koalarx-ui-core.js.map +1 -0
- package/core/index.d.ts +24 -27
- package/core/koalarx-ui-core.d.ts +6 -0
- package/core/koalarx-ui-core.metadata.json +1 -0
- package/core/{environments → lib/environments}/koalaEnvironment.d.ts +0 -0
- package/core/lib/loader/loader-bar-page.component.d.ts +5 -0
- package/core/{loader → lib/loader}/loader-bar-page.interface.d.ts +0 -0
- package/core/{loader → lib/loader}/loader-config.interface.d.ts +0 -0
- package/core/{mask-options.d.ts → lib/mask-options.d.ts} +0 -0
- package/core/lib/ngx-koala.module.d.ts +5 -0
- package/core/{page → lib/page}/koala-language.helper.d.ts +0 -0
- package/core/{page → lib/page}/koala-oauth2-config.interface.d.ts +0 -0
- package/core/{page → lib/page}/koala-page-pallet-colors.interface.d.ts +0 -0
- package/core/lib/page/koala.page.module.d.ts +2 -0
- package/core/{page → lib/page}/koala.user-menu-options.interface.d.ts +0 -0
- package/core/{page → lib/page}/notifications/koala.notification.interface.d.ts +0 -0
- package/core/{page → lib/page}/notifications/notification.component.d.ts +0 -3
- package/core/{page → lib/page}/page.component.d.ts +1 -4
- package/core/lib/router/koala.parameter-hash-location-stategy.d.ts +4 -0
- package/core/{services → lib/services}/api-requester/factory/koala.response.factory.d.ts +0 -0
- package/core/{services → lib/services}/api-requester/helpers/error/koala.client.error.d.ts +0 -0
- package/core/{services → lib/services}/api-requester/helpers/error/koala.errors.helper.d.ts +1 -1
- package/core/{services → lib/services}/api-requester/helpers/error/koala.not-found.error.d.ts +0 -0
- package/core/{services → lib/services}/api-requester/helpers/error/koala.success.error.d.ts +0 -0
- package/core/{services → lib/services}/api-requester/helpers/error/koala.unhautorized.error.d.ts +0 -0
- package/core/{services → lib/services}/api-requester/helpers/service/koala.request-header.helper.d.ts +0 -0
- package/core/{services → lib/services}/api-requester/koala.api-requester.base.d.ts +2 -8
- package/core/{services → lib/services}/api-requester/koala.api-requester.service.d.ts +0 -3
- package/core/{services → lib/services}/csv/koala.csv.service.d.ts +0 -3
- package/core/{services → lib/services}/loader/koala.loader.service.d.ts +0 -3
- package/core/{services → lib/services}/openid/koala.oauth.config.d.ts +0 -0
- package/core/{services → lib/services}/openid/koala.oauth2.service.d.ts +0 -3
- package/core/{services → lib/services}/request/koala.request.service.d.ts +1 -4
- package/core/{services → lib/services}/token/koala.token.service.d.ts +0 -3
- package/core/{services → lib/services}/token/token.factory.d.ts +0 -0
- package/core/{services → lib/services}/xlsx/koala.xlsx-config.interface.d.ts +0 -0
- package/core/{services → lib/services}/xlsx/koala.xlsx.service.d.ts +0 -3
- package/core/package.json +19 -0
- package/{theme → core/theme}/koala.theme.css +0 -0
- package/dialog/README.md +24 -0
- package/dialog/bundles/koalarx-ui-dialog.umd.js +139 -0
- package/dialog/bundles/koalarx-ui-dialog.umd.js.map +1 -0
- package/dialog/esm2015/index.js +4 -0
- package/dialog/esm2015/koalarx-ui-dialog.js +5 -0
- package/dialog/esm2015/lib/dialog.component.js +18 -0
- package/dialog/esm2015/lib/koala.dialog-template.interface.js +2 -0
- package/dialog/esm2015/lib/koala.dialog.module.js +25 -0
- package/dialog/esm2015/lib/koala.dialog.service.js +61 -0
- package/dialog/fesm2015/koalarx-ui-dialog.js +107 -0
- package/dialog/fesm2015/koalarx-ui-dialog.js.map +1 -0
- package/dialog/index.d.ts +3 -3
- package/dialog/koalarx-ui-dialog.d.ts +4 -0
- package/dialog/koalarx-ui-dialog.metadata.json +1 -0
- package/dialog/lib/dialog.component.d.ts +8 -0
- package/dialog/{koala.dialog-template.interface.d.ts → lib/koala.dialog-template.interface.d.ts} +0 -0
- package/dialog/lib/koala.dialog.module.d.ts +2 -0
- package/dialog/{koala.dialog.service.d.ts → lib/koala.dialog.service.d.ts} +0 -3
- package/dialog/package.json +19 -0
- package/dynamic-component/README.md +24 -0
- package/dynamic-component/bundles/koalarx-ui-dynamic-component.umd.js +95 -0
- package/dynamic-component/bundles/koalarx-ui-dynamic-component.umd.js.map +1 -0
- package/dynamic-component/esm2015/index.js +6 -0
- package/dynamic-component/esm2015/koalarx-ui-dynamic-component.js +5 -0
- package/dynamic-component/esm2015/lib/koala-dynamic-component.component.js +2 -0
- package/dynamic-component/esm2015/lib/koala-dynamic-component.directive.js +15 -0
- package/dynamic-component/esm2015/lib/koala-dynamic-component.factory.js +38 -0
- package/dynamic-component/esm2015/lib/koala-dynamic-component.js +7 -0
- package/dynamic-component/esm2015/lib/koala-dynamic-component.module.js +17 -0
- package/dynamic-component/fesm2015/koalarx-ui-dynamic-component.js +79 -0
- package/dynamic-component/fesm2015/koalarx-ui-dynamic-component.js.map +1 -0
- package/dynamic-component/index.d.ts +5 -5
- package/dynamic-component/koalarx-ui-dynamic-component.d.ts +4 -0
- package/dynamic-component/koalarx-ui-dynamic-component.metadata.json +1 -0
- package/dynamic-component/{koala-dynamic-component.component.d.ts → lib/koala-dynamic-component.component.d.ts} +0 -0
- package/dynamic-component/{koala-dynamic-component.d.ts → lib/koala-dynamic-component.d.ts} +0 -0
- package/dynamic-component/lib/koala-dynamic-component.directive.d.ts +5 -0
- package/dynamic-component/{koala-dynamic-component.factory.d.ts → lib/koala-dynamic-component.factory.d.ts} +2 -5
- package/dynamic-component/lib/koala-dynamic-component.module.d.ts +2 -0
- package/dynamic-component/package.json +19 -0
- package/file-button/README.md +24 -0
- package/file-button/bundles/koalarx-ui-file-button.umd.js +553 -0
- package/file-button/bundles/koalarx-ui-file-button.umd.js.map +1 -0
- package/file-button/esm2015/index.js +5 -0
- package/file-button/esm2015/koalarx-ui-file-button.js +5 -0
- package/file-button/esm2015/lib/file-button.component.js +118 -0
- package/file-button/esm2015/lib/koala.btn-file.service.js +26 -0
- package/file-button/esm2015/lib/koala.file-button.module.js +25 -0
- package/file-button/esm2015/lib/koala.file.interface.js +2 -0
- package/file-button/fesm2015/koalarx-ui-file-button.js +171 -0
- package/file-button/fesm2015/koalarx-ui-file-button.js.map +1 -0
- package/file-button/index.d.ts +4 -4
- package/file-button/koalarx-ui-file-button.d.ts +4 -0
- package/file-button/koalarx-ui-file-button.metadata.json +1 -0
- package/file-button/lib/file-button.component.d.ts +26 -0
- package/file-button/{koala.btn-file.service.d.ts → lib/koala.btn-file.service.d.ts} +1 -4
- package/file-button/lib/koala.file-button.module.d.ts +2 -0
- package/file-button/{koala.file.interface.d.ts → lib/koala.file.interface.d.ts} +0 -0
- package/file-button/package.json +19 -0
- package/folder-page/README.md +24 -0
- package/folder-page/bundles/koalarx-ui-folder-page.umd.js +97 -0
- package/folder-page/bundles/koalarx-ui-folder-page.umd.js.map +1 -0
- package/folder-page/esm2015/index.js +4 -0
- package/folder-page/esm2015/koalarx-ui-folder-page.js +5 -0
- package/folder-page/esm2015/lib/folder.component.js +56 -0
- package/folder-page/esm2015/lib/koala-navigate-history.interface.js +2 -0
- package/folder-page/esm2015/lib/koala.folder-page.module.js +27 -0
- package/folder-page/fesm2015/koalarx-ui-folder-page.js +88 -0
- package/folder-page/fesm2015/koalarx-ui-folder-page.js.map +1 -0
- package/folder-page/index.d.ts +3 -2
- package/folder-page/koalarx-ui-folder-page.d.ts +4 -0
- package/folder-page/koalarx-ui-folder-page.metadata.json +1 -0
- package/folder-page/lib/folder.component.d.ts +17 -0
- package/folder-page/{koala-navigate-history.interface.d.ts → lib/koala-navigate-history.interface.d.ts} +0 -0
- package/folder-page/lib/koala.folder-page.module.d.ts +2 -0
- package/folder-page/package.json +19 -0
- package/form/README.md +24 -0
- package/form/bundles/koalarx-ui-form.umd.js +1949 -0
- package/form/bundles/koalarx-ui-form.umd.js.map +1 -0
- package/form/esm2015/index.js +20 -0
- package/form/esm2015/koalarx-ui-form.js +5 -0
- package/form/esm2015/lib/btn-submit/btn-submit.component.js +39 -0
- package/form/esm2015/lib/directives/koala-autofocus.directive.js +25 -0
- package/form/esm2015/lib/dynamic-form/builder/dynamic-form.builder.js +138 -0
- package/form/esm2015/lib/dynamic-form/builder/fields/autocomplete.builder.js +34 -0
- package/form/esm2015/lib/dynamic-form/builder/fields/field.base.js +147 -0
- package/form/esm2015/lib/dynamic-form/builder/fields/field.builder.js +7 -0
- package/form/esm2015/lib/dynamic-form/builder/fields/more-items.builder.js +57 -0
- package/form/esm2015/lib/dynamic-form/dynamic-form.component.js +551 -0
- package/{esm2015/form → form/esm2015/lib}/dynamic-form/enums/dynamic-form-type-field.enum.js +1 -1
- package/form/esm2015/lib/dynamic-form/interfaces/koala-custom-validator-fn.interface.js +2 -0
- package/form/esm2015/lib/dynamic-form/interfaces/koala.dynamic-autocomplete-options.interface.js +2 -0
- package/form/esm2015/lib/dynamic-form/interfaces/koala.dynamic-form-autocomplete-multiple-config.interface.js +2 -0
- package/form/esm2015/lib/dynamic-form/interfaces/koala.dynamic-form-config.interface.js +2 -0
- package/form/esm2015/lib/dynamic-form/interfaces/koala.dynamic-form-field.interface.js +2 -0
- package/form/esm2015/lib/dynamic-form/interfaces/koala.dynamic-form-more-itens-show-field-config.interface.js +2 -0
- package/form/esm2015/lib/dynamic-form/interfaces/koala.dynamic-form-show-field.interface.js +2 -0
- package/form/esm2015/lib/dynamic-form/interfaces/koala.dynamic-set-value.interface.js +2 -0
- package/{esm2015/form → form/esm2015/lib}/dynamic-form/koala.dynamic-form.service.js +11 -8
- package/form/esm2015/lib/dynamic-form/validators/autocomplete-selected.validator.js +10 -0
- package/form/esm2015/lib/dynamic-form/validators/cnpj.validator.js +10 -0
- package/form/esm2015/lib/dynamic-form/validators/cpf.validator.js +10 -0
- package/form/esm2015/lib/dynamic-form/validators/date-max.validator.js +11 -0
- package/form/esm2015/lib/dynamic-form/validators/date-min.validator.js +11 -0
- package/form/esm2015/lib/dynamic-form/validators/koala-dynamic-form-validator-result.helper.js +10 -0
- package/form/esm2015/lib/dynamic-form/validators/validation.helper.js +86 -0
- package/form/esm2015/lib/form.abstract.js +42 -0
- package/form/esm2015/lib/koala.form.module.js +69 -0
- package/form/esm2015/lib/show-invalid-fields/show-invalid-fields.js +9 -0
- package/form/fesm2015/koalarx-ui-form.js +1465 -0
- package/form/fesm2015/koalarx-ui-form.js.map +1 -0
- package/form/index.d.ts +19 -17
- package/form/koalarx-ui-form.d.ts +4 -0
- package/form/koalarx-ui-form.metadata.json +1 -0
- package/form/{btn-submit → lib/btn-submit}/btn-submit.component.d.ts +1 -4
- package/form/lib/directives/koala-autofocus.directive.d.ts +7 -0
- package/form/{dynamic-form → lib/dynamic-form}/builder/dynamic-form.builder.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/builder/fields/autocomplete.builder.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/builder/fields/field.base.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/builder/fields/field.builder.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/builder/fields/more-items.builder.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/dynamic-form.component.d.ts +2 -5
- package/form/{dynamic-form → lib/dynamic-form}/enums/dynamic-form-type-field.enum.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/interfaces/koala-custom-validator-fn.interface.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/interfaces/koala.dynamic-autocomplete-options.interface.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/interfaces/koala.dynamic-form-autocomplete-multiple-config.interface.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/interfaces/koala.dynamic-form-config.interface.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/interfaces/koala.dynamic-form-field.interface.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/interfaces/koala.dynamic-form-more-itens-show-field-config.interface.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/interfaces/koala.dynamic-form-show-field.interface.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/interfaces/koala.dynamic-set-value.interface.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/koala.dynamic-form.service.d.ts +0 -3
- package/form/{dynamic-form → lib/dynamic-form}/validators/autocomplete-selected.validator.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/validators/cnpj.validator.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/validators/cpf.validator.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/validators/date-max.validator.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/validators/date-min.validator.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/validators/koala-dynamic-form-validator-result.helper.d.ts +0 -0
- package/form/{dynamic-form → lib/dynamic-form}/validators/validation.helper.d.ts +0 -0
- package/{core → form/lib}/form.abstract.d.ts +1 -1
- package/form/lib/koala.form.module.d.ts +2 -0
- package/form/{show-invalid-fields → lib/show-invalid-fields}/show-invalid-fields.d.ts +0 -0
- package/form/package.json +19 -0
- package/icon/bundles/koalarx-ui-icon.umd.js +76 -0
- package/icon/bundles/koalarx-ui-icon.umd.js.map +1 -0
- package/icon/esm2015/index.js +3 -0
- package/icon/esm2015/koalarx-ui-icon.js +5 -0
- package/icon/esm2015/lib/icon.component.js +45 -0
- package/icon/esm2015/lib/koala.icon.module.js +19 -0
- package/icon/fesm2015/koalarx-ui-icon.js +69 -0
- package/icon/fesm2015/koalarx-ui-icon.js.map +1 -0
- package/icon/index.d.ts +2 -2
- package/icon/koalarx-ui-icon.d.ts +4 -0
- package/icon/koalarx-ui-icon.metadata.json +1 -0
- package/icon/{icon.component.d.ts → lib/icon.component.d.ts} +3 -6
- package/icon/lib/koala.icon.module.d.ts +2 -0
- package/icon/package.json +19 -0
- package/icons-animated/README.md +24 -0
- package/icons-animated/bundles/koalarx-ui-icons-animated.umd.js +138 -0
- package/icons-animated/bundles/koalarx-ui-icons-animated.umd.js.map +1 -0
- package/icons-animated/esm2015/index.js +5 -0
- package/icons-animated/esm2015/koalarx-ui-icons-animated.js +6 -0
- package/icons-animated/esm2015/lib/icons/downloading/downloading-icon-animated.component.js +28 -0
- package/icons-animated/esm2015/lib/icons/loading/loading-icon-animated.component.js +28 -0
- package/icons-animated/esm2015/lib/icons-animated.component.js +15 -0
- package/icons-animated/esm2015/lib/icons-animated.service.js +29 -0
- package/icons-animated/esm2015/lib/koala-icons-animated.module.js +23 -0
- package/icons-animated/fesm2015/koalarx-ui-icons-animated.js +121 -0
- package/icons-animated/fesm2015/koalarx-ui-icons-animated.js.map +1 -0
- package/icons-animated/index.d.ts +4 -4
- package/icons-animated/koalarx-ui-icons-animated.d.ts +5 -0
- package/icons-animated/koalarx-ui-icons-animated.metadata.json +1 -0
- package/icons-animated/{icons → lib/icons}/downloading/downloading-icon-animated.component.d.ts +0 -3
- package/icons-animated/{icons → lib/icons}/loading/loading-icon-animated.component.d.ts +0 -3
- package/icons-animated/lib/icons-animated.component.d.ts +5 -0
- package/icons-animated/lib/icons-animated.service.d.ts +6 -0
- package/icons-animated/lib/koala-icons-animated.module.d.ts +2 -0
- package/icons-animated/package.json +19 -0
- package/list/README.md +24 -0
- package/list/bundles/koalarx-ui-list.umd.js +882 -0
- package/list/bundles/koalarx-ui-list.umd.js.map +1 -0
- package/list/esm2015/index.js +11 -0
- package/list/esm2015/koalarx-ui-list.js +5 -0
- package/list/esm2015/lib/koala-list-filter.interface.js +2 -0
- package/list/esm2015/lib/koala-list-form-filter.interface.js +2 -0
- package/list/esm2015/lib/koala-list-item-menu-option.interface.js +2 -0
- package/list/esm2015/lib/koala-list-item.interface.js +2 -0
- package/list/esm2015/lib/koala.list-config.interface.js +2 -0
- package/list/esm2015/lib/koala.list.module.js +40 -0
- package/list/esm2015/lib/koala.list.service.js +13 -0
- package/list/esm2015/lib/list-builder/list.builder.js +85 -0
- package/list/esm2015/lib/list.abstract.js +174 -0
- package/list/esm2015/lib/list.component.js +151 -0
- package/list/esm2015/lib/providers/pagination/pagination.provider.js +30 -0
- package/list/fesm2015/koalarx-ui-list.js +481 -0
- package/list/fesm2015/koalarx-ui-list.js.map +1 -0
- package/list/index.d.ts +10 -9
- package/list/koalarx-ui-list.d.ts +4 -0
- package/list/koalarx-ui-list.metadata.json +1 -0
- package/list/{koala-list-filter.interface.d.ts → lib/koala-list-filter.interface.d.ts} +1 -1
- package/list/{koala-list-form-filter.interface.d.ts → lib/koala-list-form-filter.interface.d.ts} +0 -0
- package/list/{koala-list-item-menu-option.interface.d.ts → lib/koala-list-item-menu-option.interface.d.ts} +0 -0
- package/list/{koala-list-item.interface.d.ts → lib/koala-list-item.interface.d.ts} +1 -1
- package/list/{koala.list-config.interface.d.ts → lib/koala.list-config.interface.d.ts} +2 -2
- package/list/lib/koala.list.module.d.ts +2 -0
- package/list/lib/koala.list.service.d.ts +4 -0
- package/list/{list-builder → lib/list-builder}/list.builder.d.ts +1 -1
- package/list/{list.abstract.d.ts → lib/list.abstract.d.ts} +7 -7
- package/list/{list.component.d.ts → lib/list.component.d.ts} +12 -15
- package/{core → list/lib}/providers/pagination/pagination.provider.d.ts +0 -3
- package/list/package.json +19 -0
- package/menu/README.md +24 -0
- package/menu/bundles/koalarx-ui-menu.umd.js +511 -0
- package/menu/bundles/koalarx-ui-menu.umd.js.map +1 -0
- package/menu/esm2015/index.js +6 -0
- package/menu/esm2015/koalarx-ui-menu.js +5 -0
- package/menu/esm2015/lib/koala.menu-module.interface.js +2 -0
- package/menu/esm2015/lib/koala.menu-tool.interface.js +2 -0
- package/menu/esm2015/lib/koala.menu.module.js +25 -0
- package/menu/esm2015/lib/koala.menu.service.js +22 -0
- package/menu/esm2015/lib/menu.component.js +104 -0
- package/menu/fesm2015/koalarx-ui-menu.js +153 -0
- package/menu/fesm2015/koalarx-ui-menu.js.map +1 -0
- package/menu/index.d.ts +5 -5
- package/menu/koalarx-ui-menu.d.ts +4 -0
- package/menu/koalarx-ui-menu.metadata.json +1 -0
- package/menu/{koala.menu-module.interface.d.ts → lib/koala.menu-module.interface.d.ts} +0 -0
- package/menu/{koala.menu-tool.interface.d.ts → lib/koala.menu-tool.interface.d.ts} +0 -0
- package/menu/lib/koala.menu.module.d.ts +2 -0
- package/menu/lib/koala.menu.service.d.ts +7 -0
- package/menu/{menu.component.d.ts → lib/menu.component.d.ts} +4 -6
- package/menu/package.json +19 -0
- package/package.json +3 -12
- package/question/README.md +24 -0
- package/question/bundles/koalarx-ui-question.umd.js +104 -0
- package/question/bundles/koalarx-ui-question.umd.js.map +1 -0
- package/question/esm2015/index.js +5 -0
- package/question/esm2015/koalarx-ui-question.js +5 -0
- package/question/esm2015/lib/dialog-question.component.js +20 -0
- package/question/esm2015/lib/koala-question-config.interface.js +2 -0
- package/question/esm2015/lib/koala.question.module.js +27 -0
- package/question/esm2015/lib/koala.question.service.js +28 -0
- package/question/fesm2015/koalarx-ui-question.js +77 -0
- package/question/fesm2015/koalarx-ui-question.js.map +1 -0
- package/question/index.d.ts +4 -4
- package/question/koalarx-ui-question.d.ts +4 -0
- package/question/koalarx-ui-question.metadata.json +1 -0
- package/question/lib/dialog-question.component.d.ts +7 -0
- package/question/{koala-question-config.interface.d.ts → lib/koala-question-config.interface.d.ts} +1 -1
- package/question/lib/koala.question.module.d.ts +2 -0
- package/question/{koala.question.service.d.ts → lib/koala.question.service.d.ts} +1 -4
- package/question/package.json +19 -0
- package/snackbar/README.md +24 -0
- package/snackbar/bundles/koalarx-ui-snackbar.umd.js +93 -0
- package/snackbar/bundles/koalarx-ui-snackbar.umd.js.map +1 -0
- package/snackbar/esm2015/index.js +5 -0
- package/snackbar/esm2015/koalarx-ui-snackbar.js +5 -0
- package/snackbar/esm2015/lib/koala.snackbar.component.js +20 -0
- package/snackbar/esm2015/lib/koala.snackbar.interface.js +2 -0
- package/snackbar/esm2015/lib/koala.snackbar.module.js +26 -0
- package/snackbar/esm2015/lib/koala.snackbar.service.js +35 -0
- package/snackbar/fesm2015/koalarx-ui-snackbar.js +81 -0
- package/snackbar/fesm2015/koalarx-ui-snackbar.js.map +1 -0
- package/snackbar/index.d.ts +4 -4
- package/snackbar/koalarx-ui-snackbar.d.ts +4 -0
- package/snackbar/koalarx-ui-snackbar.metadata.json +1 -0
- package/snackbar/{koala.snackbar.component.d.ts → lib/koala.snackbar.component.d.ts} +0 -3
- package/snackbar/{koala.snackbar.interface.d.ts → lib/koala.snackbar.interface.d.ts} +0 -0
- package/snackbar/lib/koala.snackbar.module.d.ts +2 -0
- package/snackbar/{koala.snackbar.service.d.ts → lib/koala.snackbar.service.d.ts} +0 -3
- package/snackbar/package.json +19 -0
- package/README.md +0 -9
- package/alert/dialog-alert.component.d.ts +0 -10
- package/alert/koala.alert.module.d.ts +0 -12
- package/bundles/koalarx-ui.umd.js +0 -9165
- package/bundles/koalarx-ui.umd.js.map +0 -1
- package/button/button.component.d.ts +0 -16
- package/button/koala.button.module.d.ts +0 -12
- package/core/directives/koala-autofocus.directive.d.ts +0 -10
- package/core/loader/loader-bar-page.component.d.ts +0 -8
- package/core/ngx-koala.module.d.ts +0 -12
- package/core/page/koala.page.module.d.ts +0 -21
- package/core/router/koala.parameter-hash-location-stategy.d.ts +0 -7
- package/dialog/dialog.component.d.ts +0 -11
- package/dialog/koala.dialog.module.d.ts +0 -11
- package/dynamic-component/koala-dynamic-component.directive.d.ts +0 -8
- package/dynamic-component/koala-dynamic-component.module.d.ts +0 -8
- package/esm2015/alert/dialog-alert.component.js +0 -109
- package/esm2015/alert/index.js +0 -10
- package/esm2015/alert/koala.alert-config.interface.js +0 -2
- package/esm2015/alert/koala.alert.enum.js +0 -9
- package/esm2015/alert/koala.alert.module.js +0 -49
- package/esm2015/alert/koala.alert.service.js +0 -19
- package/esm2015/alert/koala.request-code-to-alert-enum.translate.js +0 -18
- package/esm2015/button/button.component.js +0 -113
- package/esm2015/button/index.js +0 -6
- package/esm2015/button/koala.button.module.js +0 -43
- package/esm2015/core/directives/koala-autofocus.directive.js +0 -25
- package/esm2015/core/environments/koalaEnvironment.js +0 -4
- package/esm2015/core/form.abstract.js +0 -42
- package/esm2015/core/index.js +0 -61
- package/esm2015/core/loader/loader-bar-page.component.js +0 -38
- package/esm2015/core/loader/loader-bar-page.interface.js +0 -2
- package/esm2015/core/loader/loader-config.interface.js +0 -2
- package/esm2015/core/mask-options.js +0 -4
- package/esm2015/core/ngx-koala.module.js +0 -51
- package/esm2015/core/page/koala-language.helper.js +0 -114
- package/esm2015/core/page/koala-oauth2-config.interface.js +0 -2
- package/esm2015/core/page/koala-page-pallet-colors.interface.js +0 -2
- package/esm2015/core/page/koala.page.module.js +0 -79
- package/esm2015/core/page/koala.user-menu-options.interface.js +0 -2
- package/esm2015/core/page/notifications/koala.notification.interface.js +0 -2
- package/esm2015/core/page/notifications/notification.component.js +0 -127
- package/esm2015/core/page/page.component.js +0 -627
- package/esm2015/core/providers/pagination/pagination.provider.js +0 -32
- package/esm2015/core/router/koala.parameter-hash-location-stategy.js +0 -19
- package/esm2015/core/services/api-requester/factory/koala.response.factory.js +0 -48
- package/esm2015/core/services/api-requester/helpers/error/koala.client.error.js +0 -3
- package/esm2015/core/services/api-requester/helpers/error/koala.errors.helper.js +0 -46
- package/esm2015/core/services/api-requester/helpers/error/koala.not-found.error.js +0 -3
- package/esm2015/core/services/api-requester/helpers/error/koala.success.error.js +0 -3
- package/esm2015/core/services/api-requester/helpers/error/koala.unhautorized.error.js +0 -3
- package/esm2015/core/services/api-requester/helpers/service/koala.request-header.helper.js +0 -15
- package/esm2015/core/services/api-requester/koala.api-requester.base.js +0 -70
- package/esm2015/core/services/csv/koala.csv.service.js +0 -36
- package/esm2015/core/services/loader/koala.loader.service.js +0 -34
- package/esm2015/core/services/openid/koala.oauth.config.js +0 -33
- package/esm2015/core/services/openid/koala.oauth2.service.js +0 -194
- package/esm2015/core/services/request/koala.request.service.js +0 -53
- package/esm2015/core/services/token/koala.token.service.js +0 -53
- package/esm2015/core/services/token/token.factory.js +0 -31
- package/esm2015/core/services/xlsx/koala.xlsx-config.interface.js +0 -2
- package/esm2015/core/services/xlsx/koala.xlsx.service.js +0 -63
- package/esm2015/dialog/dialog.component.js +0 -72
- package/esm2015/dialog/index.js +0 -7
- package/esm2015/dialog/koala.dialog-template.interface.js +0 -2
- package/esm2015/dialog/koala.dialog.module.js +0 -39
- package/esm2015/dialog/koala.dialog.service.js +0 -57
- package/esm2015/dynamic-component/index.js +0 -9
- package/esm2015/dynamic-component/koala-dynamic-component.component.js +0 -2
- package/esm2015/dynamic-component/koala-dynamic-component.directive.js +0 -16
- package/esm2015/dynamic-component/koala-dynamic-component.factory.js +0 -44
- package/esm2015/dynamic-component/koala-dynamic-component.js +0 -7
- package/esm2015/dynamic-component/koala-dynamic-component.module.js +0 -24
- package/esm2015/file-button/file-button.component.js +0 -183
- package/esm2015/file-button/index.js +0 -8
- package/esm2015/file-button/koala.btn-file.service.js +0 -28
- package/esm2015/file-button/koala.file-button.module.js +0 -39
- package/esm2015/file-button/koala.file.interface.js +0 -2
- package/esm2015/folder-page/folder.component.js +0 -157
- package/esm2015/folder-page/index.js +0 -6
- package/esm2015/folder-page/koala-navigate-history.interface.js +0 -2
- package/esm2015/folder-page/koala.folder-page.module.js +0 -43
- package/esm2015/form/btn-submit/btn-submit.component.js +0 -110
- package/esm2015/form/dynamic-form/builder/dynamic-form.builder.js +0 -138
- package/esm2015/form/dynamic-form/builder/fields/autocomplete.builder.js +0 -34
- package/esm2015/form/dynamic-form/builder/fields/field.base.js +0 -147
- package/esm2015/form/dynamic-form/builder/fields/field.builder.js +0 -7
- package/esm2015/form/dynamic-form/builder/fields/more-items.builder.js +0 -57
- package/esm2015/form/dynamic-form/dynamic-form.component.js +0 -1861
- package/esm2015/form/dynamic-form/interfaces/koala-custom-validator-fn.interface.js +0 -2
- package/esm2015/form/dynamic-form/interfaces/koala.dynamic-autocomplete-options.interface.js +0 -2
- package/esm2015/form/dynamic-form/interfaces/koala.dynamic-form-autocomplete-multiple-config.interface.js +0 -2
- package/esm2015/form/dynamic-form/interfaces/koala.dynamic-form-config.interface.js +0 -2
- package/esm2015/form/dynamic-form/interfaces/koala.dynamic-form-field.interface.js +0 -2
- package/esm2015/form/dynamic-form/interfaces/koala.dynamic-form-more-itens-show-field-config.interface.js +0 -2
- package/esm2015/form/dynamic-form/interfaces/koala.dynamic-form-show-field.interface.js +0 -2
- package/esm2015/form/dynamic-form/interfaces/koala.dynamic-set-value.interface.js +0 -2
- package/esm2015/form/dynamic-form/validators/autocomplete-selected.validator.js +0 -10
- package/esm2015/form/dynamic-form/validators/cnpj.validator.js +0 -10
- package/esm2015/form/dynamic-form/validators/cpf.validator.js +0 -10
- package/esm2015/form/dynamic-form/validators/date-max.validator.js +0 -11
- package/esm2015/form/dynamic-form/validators/date-min.validator.js +0 -11
- package/esm2015/form/dynamic-form/validators/koala-dynamic-form-validator-result.helper.js +0 -10
- package/esm2015/form/dynamic-form/validators/validation.helper.js +0 -86
- package/esm2015/form/index.js +0 -21
- package/esm2015/form/koala.form.module.js +0 -135
- package/esm2015/form/show-invalid-fields/show-invalid-fields.js +0 -9
- package/esm2015/icon/icon.component.js +0 -458
- package/esm2015/icon/index.js +0 -6
- package/esm2015/icon/koala.icon.module.js +0 -27
- package/esm2015/icons-animated/icons/downloading/downloading-icon-animated.component.js +0 -40
- package/esm2015/icons-animated/icons/loading/loading-icon-animated.component.js +0 -58
- package/esm2015/icons-animated/icons-animated.component.js +0 -48
- package/esm2015/icons-animated/icons-animated.service.js +0 -32
- package/esm2015/icons-animated/index.js +0 -8
- package/esm2015/icons-animated/koala-icons-animated.module.js +0 -33
- package/esm2015/koalarx-ui.js +0 -5
- package/esm2015/list/index.js +0 -13
- package/esm2015/list/koala-list-filter.interface.js +0 -2
- package/esm2015/list/koala-list-form-filter.interface.js +0 -2
- package/esm2015/list/koala-list-item-menu-option.interface.js +0 -2
- package/esm2015/list/koala-list-item.interface.js +0 -2
- package/esm2015/list/koala.list-config.interface.js +0 -2
- package/esm2015/list/koala.list.module.js +0 -67
- package/esm2015/list/koala.list.service.js +0 -15
- package/esm2015/list/list-builder/list.builder.js +0 -85
- package/esm2015/list/list.abstract.js +0 -161
- package/esm2015/list/list.component.js +0 -498
- package/esm2015/menu/index.js +0 -9
- package/esm2015/menu/koala.menu-module.interface.js +0 -2
- package/esm2015/menu/koala.menu-tool.interface.js +0 -2
- package/esm2015/menu/koala.menu.module.js +0 -39
- package/esm2015/menu/koala.menu.service.js +0 -24
- package/esm2015/menu/menu.component.js +0 -289
- package/esm2015/public-api.js +0 -18
- package/esm2015/question/dialog-question.component.js +0 -72
- package/esm2015/question/index.js +0 -8
- package/esm2015/question/koala-question-config.interface.js +0 -2
- package/esm2015/question/koala.question.module.js +0 -43
- package/esm2015/question/koala.question.service.js +0 -26
- package/esm2015/snackbar/index.js +0 -8
- package/esm2015/snackbar/koala.snackbar.component.js +0 -48
- package/esm2015/snackbar/koala.snackbar.interface.js +0 -2
- package/esm2015/snackbar/koala.snackbar.module.js +0 -39
- package/esm2015/snackbar/koala.snackbar.service.js +0 -35
- package/fesm2015/koalarx-ui.js +0 -7726
- package/fesm2015/koalarx-ui.js.map +0 -1
- package/file-button/file-button.component.d.ts +0 -29
- package/file-button/koala.file-button.module.d.ts +0 -11
- package/folder-page/folder.component.d.ts +0 -20
- package/folder-page/koala.folder-page.module.d.ts +0 -12
- package/form/koala.form.module.d.ts +0 -25
- package/icon/koala.icon.module.d.ts +0 -8
- package/icons-animated/icons-animated.component.d.ts +0 -8
- package/icons-animated/icons-animated.service.d.ts +0 -9
- package/icons-animated/koala-icons-animated.module.d.ts +0 -10
- package/koalarx-ui.d.ts +0 -5
- package/list/koala.list.module.d.ts +0 -16
- package/list/koala.list.service.d.ts +0 -7
- package/menu/koala.menu.module.d.ts +0 -11
- package/menu/koala.menu.service.d.ts +0 -9
- package/public-api.d.ts +0 -14
- package/question/dialog-question.component.d.ts +0 -10
- package/question/koala.question.module.d.ts +0 -12
- package/snackbar/koala.snackbar.module.d.ts +0 -10
|
@@ -0,0 +1,1434 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, Input, EventEmitter, Output, Injectable, ViewChild, NgModule } from '@angular/core';
|
|
3
|
+
import { Title } from '@angular/platform-browser';
|
|
4
|
+
import { __awaiter } from 'tslib';
|
|
5
|
+
import { Router, NavigationError, NavigationEnd, NavigationCancel, NavigationStart, RouterModule } from '@angular/router';
|
|
6
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
7
|
+
import jwt from 'jwt-decode';
|
|
8
|
+
import { menuStateSubject, KoalaMenuService } from '@koalarx/ui/menu';
|
|
9
|
+
import jwtEncode from 'jwt-encode';
|
|
10
|
+
import * as i1 from '@angular/common/http';
|
|
11
|
+
import { HttpClient, HttpErrorResponse, HttpParams, HttpClientModule } from '@angular/common/http';
|
|
12
|
+
import { koala } from '@koalarx/utils';
|
|
13
|
+
import { KlDelay } from '@koalarx/utils/dist/utils/KlDelay';
|
|
14
|
+
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
15
|
+
import * as i1$2 from '@koalarx/ui/alert';
|
|
16
|
+
import { KoalaAlertEnum, KoalaRequestCodeToAlertEnumTranslate, KoalaAlertService } from '@koalarx/ui/alert';
|
|
17
|
+
import { map, first } from 'rxjs/operators';
|
|
18
|
+
import * as i1$1 from 'ngx-papaparse';
|
|
19
|
+
import { Papa } from 'ngx-papaparse';
|
|
20
|
+
import * as Excel from 'exceljs/dist/exceljs.min.js';
|
|
21
|
+
import * as fs from 'file-saver';
|
|
22
|
+
import { HashLocationStrategy, CommonModule } from '@angular/common';
|
|
23
|
+
import { MatBadgeModule } from '@angular/material/badge';
|
|
24
|
+
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
25
|
+
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
26
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
27
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
28
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
29
|
+
import { MatSidenavModule } from '@angular/material/sidenav';
|
|
30
|
+
import { MatListModule } from '@angular/material/list';
|
|
31
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
32
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
33
|
+
|
|
34
|
+
class LoaderBarPageComponent {
|
|
35
|
+
constructor() {
|
|
36
|
+
this.show = false;
|
|
37
|
+
this.progress = 0;
|
|
38
|
+
this.typeLoader = 'indeterminate';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
LoaderBarPageComponent.decorators = [
|
|
42
|
+
{ type: Component, args: [{
|
|
43
|
+
selector: 'app-loader-page',
|
|
44
|
+
template: "<div [ngClass]=\"{'bouncedInDown d-block': show}\" class=\"animated loader-bar-page\">\n <mat-progress-bar\n [bufferValue]=\"progress\"\n [mode]=\"typeLoader\"\n [value]=\"progress\"\n color=\"primary\">\n </mat-progress-bar>\n</div>\n",
|
|
45
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
46
|
+
styles: [".loader-bar-page{position:absolute;display:none;top:0;left:0;width:100vw;height:100vh;z-index:100000}\n"]
|
|
47
|
+
},] }
|
|
48
|
+
];
|
|
49
|
+
LoaderBarPageComponent.propDecorators = {
|
|
50
|
+
show: [{ type: Input }],
|
|
51
|
+
progress: [{ type: Input }],
|
|
52
|
+
typeLoader: [{ type: Input }]
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
class NotificationComponent {
|
|
56
|
+
constructor(titleService) {
|
|
57
|
+
this.titleService = titleService;
|
|
58
|
+
this.deleteAll = new EventEmitter(false);
|
|
59
|
+
this.delete = new EventEmitter(null);
|
|
60
|
+
}
|
|
61
|
+
ngOnChanges(changes) {
|
|
62
|
+
if (!this.appName) {
|
|
63
|
+
this.appName = this.titleService.getTitle();
|
|
64
|
+
}
|
|
65
|
+
if (changes.notifications && this.notifications.length > 0) {
|
|
66
|
+
this.titleService.setTitle(`(${this.notifications.length}) ${this.appName}`);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
this.titleService.setTitle(this.appName);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
deleteAllNotifications() {
|
|
73
|
+
this.deleteAll.emit(true);
|
|
74
|
+
}
|
|
75
|
+
deleteNotification(notification) {
|
|
76
|
+
this.delete.emit(notification);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
NotificationComponent.decorators = [
|
|
80
|
+
{ type: Component, args: [{
|
|
81
|
+
selector: 'koala-notification-list',
|
|
82
|
+
template: "<div (click)=\"$event.stopPropagation()\" class=\"notifications-content\">\n <div class=\"title\">\n <mat-icon>info</mat-icon>\n <h2>Notifica\u00E7\u00F5es</h2>\n <span class=\"spacer\"></span>\n <button (click)=\"deleteAllNotifications()\" *ngIf=\"notifications.length > 0\" class=\"btn-delete-all\"\n mat-icon-button\n matTooltip=\"Excluir Todas\" matTooltipPosition=\"above\">\n <mat-icon>delete_sweep</mat-icon>\n </button>\n </div>\n <mat-action-list *ngIf=\"notifications.length > 0 else noNotifications\">\n <mat-list-item *ngFor=\"let notification of notifications\" [routerLink]=\"notification.redirectTo\" class=\"itemList\">\n <button (click)=\"deleteNotification(notification)\" class=\"delete-notification\" color=\"warn\" mat-icon-button\n matTooltip=\"Excluir\" matTooltipPosition=\"above\"\n mat-list-icon>\n <mat-icon>delete</mat-icon>\n </button>\n <mat-icon class=\"iconList\" mat-list-icon>announcement</mat-icon>\n <h4 class=\"titleList\" mat-line>{{notification.title}}</h4>\n <p [innerHTML]=\"notification.text\" class=\"textList\" mat-line></p>\n </mat-list-item>\n </mat-action-list>\n <ng-template #noNotifications>\n <div class=\"empty\">\n <mat-icon>mood</mat-icon>\n <p>Tudo certo por aqui!</p>\n </div>\n </ng-template>\n</div>\n",
|
|
83
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
84
|
+
styles: [".title{color:#616161;padding:5px 20px 15px}.title h2{vertical-align:middle;display:inline-flex;padding:0 10px;margin:0;font-family:OpenSans,sans-serif;font-size:.8em}.title mat-icon{vertical-align:middle;display:inline-flex;width:22px;height:22px;font-size:22px;line-height:22px}.title .btn-delete-all{position:absolute;right:20px;top:5px}.iconList{color:#1976d2}.titleList{font-family:OpenSansLight,sans-serif;font-size:.7em!important;color:#616161}.textList{font-family:OpenSans,sans-serif;font-size:.9em!important;color:#212121;white-space:unset!important}.itemList{height:-webkit-fit-content!important;height:-moz-fit-content!important;height:fit-content!important;padding:8px 0!important}.delete-notification{background:#b71c1c;border-radius:0!important;height:100%!important;margin-left:-75px;margin-right:10px;position:absolute;transition:.3s;width:50px!important}.delete-notification mat-icon{color:#fff;vertical-align:middle}mat-action-list{max-height:70vh;overflow-y:auto}mat-list-item:hover .delete-notification{margin-left:-15px}.empty{padding:50px;text-align:center;color:#616161}.empty mat-icon{width:40px;height:40px;font-size:40px;line-height:40px}.empty p{text-align:center;font-family:OpenSansLight,sans-serif;font-size:1em}\n"]
|
|
85
|
+
},] }
|
|
86
|
+
];
|
|
87
|
+
NotificationComponent.ctorParameters = () => [
|
|
88
|
+
{ type: Title }
|
|
89
|
+
];
|
|
90
|
+
NotificationComponent.propDecorators = {
|
|
91
|
+
notifications: [{ type: Input }],
|
|
92
|
+
deleteAll: [{ type: Output }],
|
|
93
|
+
delete: [{ type: Output }]
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
// @dynamic
|
|
97
|
+
class KoalaLanguageHelper {
|
|
98
|
+
static setLanguage(language) {
|
|
99
|
+
this.language = language;
|
|
100
|
+
}
|
|
101
|
+
static getLanguage() {
|
|
102
|
+
return this.language;
|
|
103
|
+
}
|
|
104
|
+
static getBtnLabel() {
|
|
105
|
+
switch (this.language) {
|
|
106
|
+
case "enUs":
|
|
107
|
+
return 'Send';
|
|
108
|
+
default:
|
|
109
|
+
return 'Enviar';
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
static getYesMessage() {
|
|
113
|
+
switch (this.language) {
|
|
114
|
+
case "enUs":
|
|
115
|
+
return 'Yes';
|
|
116
|
+
default:
|
|
117
|
+
return 'Sim';
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
static getNoMessage() {
|
|
121
|
+
switch (this.language) {
|
|
122
|
+
case "enUs":
|
|
123
|
+
return 'No';
|
|
124
|
+
default:
|
|
125
|
+
return 'Não';
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
static getInternalServerErrorMessage() {
|
|
129
|
+
switch (this.language) {
|
|
130
|
+
case "enUs":
|
|
131
|
+
return 'We had a problem with your request.<br/>Sorry for the inconvenience.<br/><br/>Please try again later.';
|
|
132
|
+
default:
|
|
133
|
+
return 'Tivemos um problema com sua requisição.<br/>Sinto muito pelo transtorno.<br/><br/>Gentileza tentar novamente mais tarde.';
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
static getRequiredMessage(label) {
|
|
137
|
+
switch (this.language) {
|
|
138
|
+
case "enUs":
|
|
139
|
+
return `${label} is required.`;
|
|
140
|
+
default:
|
|
141
|
+
return `Nenhum valor informado.`;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
static getInvalidMessage(label) {
|
|
145
|
+
switch (this.language) {
|
|
146
|
+
case "enUs":
|
|
147
|
+
return `${label} is invalid.`;
|
|
148
|
+
default:
|
|
149
|
+
return `Registro inválido.`;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
static getMinMessage(min) {
|
|
153
|
+
switch (this.language) {
|
|
154
|
+
case "enUs":
|
|
155
|
+
return `Inform at least the value of ${min}.`;
|
|
156
|
+
default:
|
|
157
|
+
return `Informe no mínimo o valor de ${min}.`;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
static getMaxMessage(max) {
|
|
161
|
+
switch (this.language) {
|
|
162
|
+
case "enUs":
|
|
163
|
+
return `Inform at most the value of ${max}.`;
|
|
164
|
+
default:
|
|
165
|
+
return `Informe no máximo o valor de ${max}.`;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
static getMinLengthMessage(minLength) {
|
|
169
|
+
switch (this.language) {
|
|
170
|
+
case "enUs":
|
|
171
|
+
return `Enter a value with at least ${minLength} characters.`;
|
|
172
|
+
default:
|
|
173
|
+
return `Informe um valor com no mínimo ${minLength} caracteres.`;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
static getMaxLengthMessage(maxLength) {
|
|
177
|
+
switch (this.language) {
|
|
178
|
+
case "enUs":
|
|
179
|
+
return `Enter a value with at most ${maxLength} characters.`;
|
|
180
|
+
default:
|
|
181
|
+
return `Informe um valor com no máximo ${maxLength} caracteres.`;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
static getDateMinMessage() {
|
|
185
|
+
switch (this.language) {
|
|
186
|
+
case "enUs":
|
|
187
|
+
return `Inform at least the date of `;
|
|
188
|
+
default:
|
|
189
|
+
return `Informe no mínimo a data de `;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
static getDateMaxMessage() {
|
|
193
|
+
switch (this.language) {
|
|
194
|
+
case "enUs":
|
|
195
|
+
return `Inform at most the date of `;
|
|
196
|
+
default:
|
|
197
|
+
return `Informe no máximo a data de `;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
static getAutocompleteMessage(label) {
|
|
201
|
+
switch (this.language) {
|
|
202
|
+
case "enUs":
|
|
203
|
+
return `You must select a option.`;
|
|
204
|
+
default:
|
|
205
|
+
return `Você deve selecionar uma opção.`;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// @dynamic
|
|
211
|
+
class KoalaEnvironment {
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// @dynamic
|
|
215
|
+
class TokenFactory {
|
|
216
|
+
static init() {
|
|
217
|
+
var _a, _b;
|
|
218
|
+
if (!!localStorage.getItem((_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.storageTokenName)) {
|
|
219
|
+
TokenFactory.setToken(localStorage.getItem((_b = KoalaEnvironment.environment) === null || _b === void 0 ? void 0 : _b.storageTokenName));
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
static setToken(token) {
|
|
223
|
+
var _a;
|
|
224
|
+
localStorage.setItem((_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.storageTokenName, token);
|
|
225
|
+
this.token = token;
|
|
226
|
+
}
|
|
227
|
+
static getToken() {
|
|
228
|
+
return this.token;
|
|
229
|
+
}
|
|
230
|
+
static removeToken() {
|
|
231
|
+
var _a;
|
|
232
|
+
localStorage.removeItem((_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.storageTokenName);
|
|
233
|
+
this.token = null;
|
|
234
|
+
}
|
|
235
|
+
static hasToken() {
|
|
236
|
+
var _a;
|
|
237
|
+
return !!this.token && !!localStorage.getItem((_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.storageTokenName);
|
|
238
|
+
}
|
|
239
|
+
static logout() {
|
|
240
|
+
this.removeToken();
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
class KoalaTokenService {
|
|
245
|
+
constructor() {
|
|
246
|
+
this.token$ = new BehaviorSubject(null);
|
|
247
|
+
this.verifySession();
|
|
248
|
+
}
|
|
249
|
+
ngOnDestroy() {
|
|
250
|
+
if (this.intervalToken) {
|
|
251
|
+
clearInterval(this.intervalToken);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
setToken(token) {
|
|
255
|
+
if (TokenFactory.hasToken()) {
|
|
256
|
+
this.token$.next(token);
|
|
257
|
+
}
|
|
258
|
+
TokenFactory.setToken(token);
|
|
259
|
+
}
|
|
260
|
+
getToken() {
|
|
261
|
+
return this.token$;
|
|
262
|
+
}
|
|
263
|
+
getDecodedToken() {
|
|
264
|
+
return (TokenFactory.hasToken() ? jwt(TokenFactory.getToken()) : null);
|
|
265
|
+
}
|
|
266
|
+
getOAuth2Token() {
|
|
267
|
+
return (TokenFactory.hasToken() ? jwt(TokenFactory.getToken()) : null);
|
|
268
|
+
}
|
|
269
|
+
removeToken() {
|
|
270
|
+
TokenFactory.removeToken();
|
|
271
|
+
}
|
|
272
|
+
verifySession() {
|
|
273
|
+
TokenFactory.init();
|
|
274
|
+
this.token$.next(TokenFactory.getToken());
|
|
275
|
+
this.intervalToken = setInterval(() => {
|
|
276
|
+
if (!TokenFactory.hasToken() && this.token$.getValue()) {
|
|
277
|
+
this.token$.next(null);
|
|
278
|
+
}
|
|
279
|
+
else if (TokenFactory.hasToken() && !this.token$.getValue()) {
|
|
280
|
+
this.token$.next(TokenFactory.getToken());
|
|
281
|
+
}
|
|
282
|
+
}, 300);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
KoalaTokenService.ɵprov = i0.ɵɵdefineInjectable({ factory: function KoalaTokenService_Factory() { return new KoalaTokenService(); }, token: KoalaTokenService, providedIn: "any" });
|
|
286
|
+
KoalaTokenService.decorators = [
|
|
287
|
+
{ type: Injectable, args: [{ providedIn: "any" },] }
|
|
288
|
+
];
|
|
289
|
+
KoalaTokenService.ctorParameters = () => [];
|
|
290
|
+
|
|
291
|
+
const KOALA_LOADER_SUBJECT = new BehaviorSubject({
|
|
292
|
+
typeLoader: 'indeterminate',
|
|
293
|
+
progress: 0,
|
|
294
|
+
show: false
|
|
295
|
+
});
|
|
296
|
+
class KoalaLoaderService {
|
|
297
|
+
getLoaderSubject() {
|
|
298
|
+
return KOALA_LOADER_SUBJECT;
|
|
299
|
+
}
|
|
300
|
+
create(loaderConfig) {
|
|
301
|
+
KOALA_LOADER_SUBJECT.next({
|
|
302
|
+
show: true,
|
|
303
|
+
progress: loaderConfig.progress ? loaderConfig.progress : 0,
|
|
304
|
+
typeLoader: loaderConfig.typeLoader ? loaderConfig.typeLoader : 'indeterminate'
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
dismiss() {
|
|
308
|
+
KOALA_LOADER_SUBJECT.next({
|
|
309
|
+
show: false,
|
|
310
|
+
progress: 0,
|
|
311
|
+
typeLoader: 'indeterminate'
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
KoalaLoaderService.ɵprov = i0.ɵɵdefineInjectable({ factory: function KoalaLoaderService_Factory() { return new KoalaLoaderService(); }, token: KoalaLoaderService, providedIn: "any" });
|
|
316
|
+
KoalaLoaderService.decorators = [
|
|
317
|
+
{ type: Injectable, args: [{ providedIn: "any" },] }
|
|
318
|
+
];
|
|
319
|
+
|
|
320
|
+
// @dynamic
|
|
321
|
+
class KoalaOauthConfig {
|
|
322
|
+
static getConfig() {
|
|
323
|
+
var _a;
|
|
324
|
+
return localStorage.getItem((_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.storageOAuthTypeName);
|
|
325
|
+
}
|
|
326
|
+
static hasConfig() {
|
|
327
|
+
return !!this.getConfig();
|
|
328
|
+
}
|
|
329
|
+
static setConfig(type) {
|
|
330
|
+
var _a;
|
|
331
|
+
localStorage.setItem((_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.storageOAuthTypeName, type);
|
|
332
|
+
this.config.next(this.getOAuthConfig(type));
|
|
333
|
+
}
|
|
334
|
+
static getOAuthConfig(type) {
|
|
335
|
+
var _a, _b, _c;
|
|
336
|
+
const environment = (_c = (_b = (_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.oauthConfig) === null || _b === void 0 ? void 0 : _b.find(config => config.name === type)) !== null && _c !== void 0 ? _c : null;
|
|
337
|
+
return environment !== null && environment !== void 0 ? environment : {
|
|
338
|
+
customQueryParams: {
|
|
339
|
+
client_secret: null
|
|
340
|
+
},
|
|
341
|
+
clientId: null,
|
|
342
|
+
scope: null,
|
|
343
|
+
domain: null,
|
|
344
|
+
strictDiscoveryDocumentValidation: false,
|
|
345
|
+
indexLoginName: 'name'
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
KoalaOauthConfig.config = new BehaviorSubject(KoalaOauthConfig.getOAuthConfig(KoalaOauthConfig.getConfig()));
|
|
350
|
+
|
|
351
|
+
const STATE_STORAGE_NAME = 'koala_openid_state';
|
|
352
|
+
class KoalaOAuth2Service {
|
|
353
|
+
constructor(http, router, tokenService) {
|
|
354
|
+
this.http = http;
|
|
355
|
+
this.router = router;
|
|
356
|
+
this.tokenService = tokenService;
|
|
357
|
+
this.events = new BehaviorSubject(null);
|
|
358
|
+
this.token = {};
|
|
359
|
+
this.generateState();
|
|
360
|
+
}
|
|
361
|
+
ngOnDestroy() {
|
|
362
|
+
if (this.eventSubscription) {
|
|
363
|
+
this.eventSubscription.unsubscribe();
|
|
364
|
+
}
|
|
365
|
+
if (this.refreshTokenInterval) {
|
|
366
|
+
clearInterval(this.refreshTokenInterval);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
hasOpenIdConfig() {
|
|
370
|
+
return !!this.openIdOptions;
|
|
371
|
+
}
|
|
372
|
+
configure(options) {
|
|
373
|
+
this.config = options;
|
|
374
|
+
}
|
|
375
|
+
loadDiscoveryDocumentAndTryLogin() {
|
|
376
|
+
if (this.eventSubscription) {
|
|
377
|
+
this.eventSubscription.unsubscribe();
|
|
378
|
+
}
|
|
379
|
+
this.eventSubscription = this.events.subscribe(event => {
|
|
380
|
+
if (event === 'authenticate') {
|
|
381
|
+
this.generateState();
|
|
382
|
+
localStorage.setItem(STATE_STORAGE_NAME, this.state);
|
|
383
|
+
window.location.href = `${this.openIdOptions.authorization_endpoint}?response_type=${this.config.responseType}&client_id=${this.config.clientId}&state=${this.state}&redirect_uri=${this.config.redirectUri}&scope=${this.config.scope}`;
|
|
384
|
+
}
|
|
385
|
+
else if (event === 'getToken') {
|
|
386
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
387
|
+
const state = urlParams.get('state');
|
|
388
|
+
if (state === this.state) {
|
|
389
|
+
const code = urlParams.get('code');
|
|
390
|
+
this.getToken(code);
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
this.logout();
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
else if (event === 'getClaims' || (event === 'refreshToken' && !this.claims)) {
|
|
397
|
+
this.getClaims();
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
return new Promise((resolve, reject) => {
|
|
401
|
+
this.http.get(`${this.config.issuer}/.well-known/openid-configuration`).subscribe(options => {
|
|
402
|
+
this.openIdOptions = options;
|
|
403
|
+
if (window.location.href.indexOf(`state=${this.state}`) >= 0) {
|
|
404
|
+
this.events.next('getToken');
|
|
405
|
+
}
|
|
406
|
+
else if (!this.tokenService.getOAuth2Token()) {
|
|
407
|
+
this.events.next('loadedConfig');
|
|
408
|
+
}
|
|
409
|
+
resolve(true);
|
|
410
|
+
}, e => {
|
|
411
|
+
console.error(e);
|
|
412
|
+
this.events.next('errorLoadConfig');
|
|
413
|
+
reject(e);
|
|
414
|
+
});
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
initLoginFlow(name) {
|
|
418
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
419
|
+
if (name) {
|
|
420
|
+
KoalaOauthConfig.setConfig(name);
|
|
421
|
+
yield KlDelay.waitFor(1000);
|
|
422
|
+
}
|
|
423
|
+
this.events.next('authenticate');
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
getIdentityClaims() {
|
|
427
|
+
return this.claims;
|
|
428
|
+
}
|
|
429
|
+
getAccessToken() {
|
|
430
|
+
return this.token.access_token;
|
|
431
|
+
}
|
|
432
|
+
getIdToken() {
|
|
433
|
+
return this.token.id_token;
|
|
434
|
+
}
|
|
435
|
+
getRefreshToken() {
|
|
436
|
+
return this.token.refresh_token;
|
|
437
|
+
}
|
|
438
|
+
getAccessTokenExpiration() {
|
|
439
|
+
const expires_in = new Date();
|
|
440
|
+
expires_in.setSeconds(this.token.expires_in);
|
|
441
|
+
return expires_in.toString();
|
|
442
|
+
}
|
|
443
|
+
getCode() {
|
|
444
|
+
return this.code;
|
|
445
|
+
}
|
|
446
|
+
logout() {
|
|
447
|
+
const logoutInterval = setInterval(() => {
|
|
448
|
+
if (this.hasOpenIdConfig()) {
|
|
449
|
+
if (this.openIdOptions.end_session_endpoint) {
|
|
450
|
+
this.claims = null;
|
|
451
|
+
this.token = null;
|
|
452
|
+
const iframeLogout = document.createElement('iframe');
|
|
453
|
+
iframeLogout.style.display = 'none';
|
|
454
|
+
iframeLogout.src = this.openIdOptions.end_session_endpoint;
|
|
455
|
+
document.querySelector('body').appendChild(iframeLogout);
|
|
456
|
+
}
|
|
457
|
+
this.events.next('logout');
|
|
458
|
+
clearInterval(logoutInterval);
|
|
459
|
+
}
|
|
460
|
+
}, 300);
|
|
461
|
+
}
|
|
462
|
+
initRefreshTokenInterval(code, refreshToken) {
|
|
463
|
+
if (!this.refreshTokenInterval) {
|
|
464
|
+
this.refreshTokenInterval = setInterval(() => {
|
|
465
|
+
const refreshTokenDate = new Date();
|
|
466
|
+
refreshTokenDate.setMinutes(refreshTokenDate.getMinutes() + 1);
|
|
467
|
+
const token = this.tokenService.getOAuth2Token();
|
|
468
|
+
if (token) {
|
|
469
|
+
const expires_in = token.expired;
|
|
470
|
+
if (expires_in) {
|
|
471
|
+
if (new Date(expires_in) <= refreshTokenDate) {
|
|
472
|
+
this.getToken(code, refreshToken);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}, 1000);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
getToken(code, refreshToken) {
|
|
480
|
+
var _a, _b;
|
|
481
|
+
if (refreshToken) {
|
|
482
|
+
clearInterval(this.refreshTokenInterval);
|
|
483
|
+
this.refreshTokenInterval = null;
|
|
484
|
+
}
|
|
485
|
+
const formData = new URLSearchParams();
|
|
486
|
+
let data = koala({
|
|
487
|
+
grant_type: (refreshToken ? 'refresh_token' : 'authorization_code'),
|
|
488
|
+
code,
|
|
489
|
+
redirect_uri: this.config.redirectUri,
|
|
490
|
+
client_id: this.config.clientId
|
|
491
|
+
}).object().merge((_a = this.config.customQueryParams) !== null && _a !== void 0 ? _a : {}).getValue();
|
|
492
|
+
if (refreshToken) {
|
|
493
|
+
data = koala(data).object().merge({ refresh_token: refreshToken }).getValue();
|
|
494
|
+
}
|
|
495
|
+
if (!this.code) {
|
|
496
|
+
this.code = code;
|
|
497
|
+
}
|
|
498
|
+
Object.keys(data).forEach(indexName => {
|
|
499
|
+
formData.append(indexName, data[indexName]);
|
|
500
|
+
});
|
|
501
|
+
this.http.post((_b = this.config.endpointToken) !== null && _b !== void 0 ? _b : this.openIdOptions.token_endpoint, formData.toString(), {
|
|
502
|
+
headers: {
|
|
503
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
504
|
+
}
|
|
505
|
+
}).subscribe((token) => {
|
|
506
|
+
this.token = token;
|
|
507
|
+
this.events.next((refreshToken ? 'refreshToken' : 'getClaims'));
|
|
508
|
+
}, () => this.events.next('getTokenError'));
|
|
509
|
+
}
|
|
510
|
+
getClaims() {
|
|
511
|
+
var _a;
|
|
512
|
+
this.http.get((_a = this.config.endpointClaims) !== null && _a !== void 0 ? _a : this.openIdOptions.userinfo_endpoint, {
|
|
513
|
+
headers: {
|
|
514
|
+
Authorization: `Bearer ${this.getAccessToken()}`
|
|
515
|
+
}
|
|
516
|
+
}).subscribe(userInfo => {
|
|
517
|
+
this.claims = userInfo;
|
|
518
|
+
this.state = null;
|
|
519
|
+
localStorage.removeItem(STATE_STORAGE_NAME);
|
|
520
|
+
this.events.next(this.events.getValue() === 'refreshToken' ? 'refreshToken' : 'userAuthenticated');
|
|
521
|
+
}, () => this.events.next('loadedConfig'));
|
|
522
|
+
}
|
|
523
|
+
generateState() {
|
|
524
|
+
this.state = localStorage.getItem(STATE_STORAGE_NAME) ?
|
|
525
|
+
localStorage.getItem(STATE_STORAGE_NAME) :
|
|
526
|
+
koala('').string().random(30, true, true, true).getValue();
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
KoalaOAuth2Service.decorators = [
|
|
530
|
+
{ type: Injectable }
|
|
531
|
+
];
|
|
532
|
+
KoalaOAuth2Service.ctorParameters = () => [
|
|
533
|
+
{ type: HttpClient },
|
|
534
|
+
{ type: Router },
|
|
535
|
+
{ type: KoalaTokenService }
|
|
536
|
+
];
|
|
537
|
+
|
|
538
|
+
class PageComponent {
|
|
539
|
+
constructor(tokenService, router, loaderService, menuService, oauth2Service, deviceService) {
|
|
540
|
+
this.tokenService = tokenService;
|
|
541
|
+
this.router = router;
|
|
542
|
+
this.loaderService = loaderService;
|
|
543
|
+
this.menuService = menuService;
|
|
544
|
+
this.oauth2Service = oauth2Service;
|
|
545
|
+
this.deviceService = deviceService;
|
|
546
|
+
this.showMenu = true;
|
|
547
|
+
this.startMenuOpened = true;
|
|
548
|
+
this.userMenuOptions = [];
|
|
549
|
+
this.language = 'ptBr';
|
|
550
|
+
this.validatingScope = new EventEmitter(false);
|
|
551
|
+
this.logoutEmitter = new EventEmitter(false);
|
|
552
|
+
this.deleteAllNotifications = new EventEmitter(false);
|
|
553
|
+
this.deleteNotification = new EventEmitter(null);
|
|
554
|
+
this.username$ = new BehaviorSubject('');
|
|
555
|
+
this.firstUserLetter$ = new BehaviorSubject('');
|
|
556
|
+
this.logged$ = new BehaviorSubject(false);
|
|
557
|
+
this.validationScope$ = new BehaviorSubject(false);
|
|
558
|
+
this.isMobile = this.deviceService.isMobile();
|
|
559
|
+
this.defaultPalletColors = {
|
|
560
|
+
scrollbarColor: '#1976D2',
|
|
561
|
+
scrollbarColorHover: '#1565C0',
|
|
562
|
+
userPresentationBackground: '#f1f1f1',
|
|
563
|
+
userPresentationUserBackground: '#1976D2',
|
|
564
|
+
userPresentationUserFontColor: '#fff',
|
|
565
|
+
firstColor: '#fff',
|
|
566
|
+
secondColor: '#F1F1F1',
|
|
567
|
+
bodyBackground: '#eeeeee',
|
|
568
|
+
checkboxBackground: '#1976d2',
|
|
569
|
+
checkboxColor: '#ffffff',
|
|
570
|
+
fontColor: '#1976D2',
|
|
571
|
+
fontHoverColor: '#1976D2',
|
|
572
|
+
fontActiveColor: '#1565C0',
|
|
573
|
+
menuTitleBackground: 'rgba(0,0,0,.1)',
|
|
574
|
+
menuTitleColor: 'rgba(0,0,0,.3)',
|
|
575
|
+
menuBackground: '#fafafa',
|
|
576
|
+
menuOptionsBackground: '#eaeaea',
|
|
577
|
+
menuOptionsColor: '#a5a5a5',
|
|
578
|
+
menuOptionsColorHover: '#1976D2',
|
|
579
|
+
menuOptionsColorActive: '#1565c0',
|
|
580
|
+
toolbarBackground: '#ffffff',
|
|
581
|
+
toolbarColor: '#1976d2',
|
|
582
|
+
listBackground: '#fff',
|
|
583
|
+
listContentBackground: '#fff',
|
|
584
|
+
listTitleItemColor: '#838383',
|
|
585
|
+
listItemColor: '#3e3e3e',
|
|
586
|
+
listItemBackgroudHover: '#F1F1F1',
|
|
587
|
+
listItemBackgroundActive: '#EEE',
|
|
588
|
+
shadowColorTableList: 'rgba(25, 118, 210, .4)'
|
|
589
|
+
};
|
|
590
|
+
this.loaderSubject = loaderService.getLoaderSubject();
|
|
591
|
+
}
|
|
592
|
+
ngOnInit() {
|
|
593
|
+
var _a;
|
|
594
|
+
KoalaLanguageHelper.setLanguage(this.language);
|
|
595
|
+
this.initOAuth2();
|
|
596
|
+
if (this.openPages) {
|
|
597
|
+
if (this.openPages.indexOf('/') < 0) {
|
|
598
|
+
this.openPages.push('/');
|
|
599
|
+
}
|
|
600
|
+
if (this.openPages.indexOf('/login') < 0) {
|
|
601
|
+
this.openPages.push('/login');
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
else {
|
|
605
|
+
this.openPages = [
|
|
606
|
+
'/',
|
|
607
|
+
'/login'
|
|
608
|
+
];
|
|
609
|
+
}
|
|
610
|
+
(_a = this.tokenService.getToken()) === null || _a === void 0 ? void 0 : _a.subscribe(token => {
|
|
611
|
+
var _a, _b;
|
|
612
|
+
this.logged$.next(!!token);
|
|
613
|
+
if (this.logged$.getValue()) {
|
|
614
|
+
const decodedToken = this.tokenService.getDecodedToken();
|
|
615
|
+
this.username$.next(decodedToken.login);
|
|
616
|
+
this.firstUserLetter$.next(decodedToken.login.charAt(0).toUpperCase());
|
|
617
|
+
if (!this.isMobile) {
|
|
618
|
+
this.menuService.open();
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
if (this.logged$.getValue() && ((_a = this.openPages) === null || _a === void 0 ? void 0 : _a.indexOf(this.currentUrl)) >= 0 && this.defaultPage) {
|
|
622
|
+
this.router.navigate([this.defaultPage]).then();
|
|
623
|
+
}
|
|
624
|
+
else if (!this.logged$.getValue() && this.currentUrl && ((_b = this.openPages) === null || _b === void 0 ? void 0 : _b.indexOf(this.currentUrl)) < 0) {
|
|
625
|
+
this.router.navigate(['login']).then();
|
|
626
|
+
return false;
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
this.router.events.subscribe(event => {
|
|
630
|
+
var _a, _b;
|
|
631
|
+
switch (true) {
|
|
632
|
+
case event instanceof NavigationStart: {
|
|
633
|
+
this.loaderService.create({ typeLoader: 'indeterminate' });
|
|
634
|
+
break;
|
|
635
|
+
}
|
|
636
|
+
case event instanceof NavigationEnd:
|
|
637
|
+
case event instanceof NavigationCancel:
|
|
638
|
+
case event instanceof NavigationError: {
|
|
639
|
+
this.loaderService.dismiss();
|
|
640
|
+
if (event instanceof NavigationEnd) {
|
|
641
|
+
if (this.isMobile) {
|
|
642
|
+
this.menuService.close();
|
|
643
|
+
}
|
|
644
|
+
this.currentUrl = event.url.split('?')[0];
|
|
645
|
+
if (event.url.indexOf('/login?clientId=') < 0) {
|
|
646
|
+
if (this.logged$.getValue() && this.defaultPage && ((_a = this.openPages) === null || _a === void 0 ? void 0 : _a.indexOf(this.currentUrl)) >= 0) {
|
|
647
|
+
this.router.navigate([this.defaultPage]).then();
|
|
648
|
+
return false;
|
|
649
|
+
}
|
|
650
|
+
else if (!this.logged$.getValue() && ((_b = this.openPages) === null || _b === void 0 ? void 0 : _b.indexOf(this.currentUrl)) < 0) {
|
|
651
|
+
this.router.navigate(['login']).then();
|
|
652
|
+
return false;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
break;
|
|
657
|
+
}
|
|
658
|
+
default: {
|
|
659
|
+
break;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
if (this.palletColors) {
|
|
664
|
+
Object.keys(this.defaultPalletColors).forEach(indexName => {
|
|
665
|
+
if (!this.palletColors.hasOwnProperty(indexName) ||
|
|
666
|
+
!this.palletColors[indexName]) {
|
|
667
|
+
this.palletColors[indexName] = this.defaultPalletColors[indexName];
|
|
668
|
+
}
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
else {
|
|
672
|
+
this.palletColors = this.defaultPalletColors;
|
|
673
|
+
}
|
|
674
|
+
this.defineColor();
|
|
675
|
+
if (this.showMenu) {
|
|
676
|
+
menuStateSubject.subscribe((state) => __awaiter(this, void 0, void 0, function* () {
|
|
677
|
+
if (this.menu) {
|
|
678
|
+
if (state === 'close') {
|
|
679
|
+
if (this.menu.opened) {
|
|
680
|
+
yield this.menu.close();
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
else if (state === 'open') {
|
|
684
|
+
if (!this.menu.opened) {
|
|
685
|
+
yield this.menu.open();
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}));
|
|
690
|
+
if (this.startMenuOpened && this.logged$.getValue()) {
|
|
691
|
+
if (!this.isMobile) {
|
|
692
|
+
this.menuService.open();
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
else {
|
|
696
|
+
this.menuService.close();
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
else {
|
|
700
|
+
this.menuService.close();
|
|
701
|
+
}
|
|
702
|
+
this.validationScope$.subscribe(scope => this.validatingScope.emit(scope));
|
|
703
|
+
}
|
|
704
|
+
toogleMenu() {
|
|
705
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
706
|
+
this.menuService.clearConfig();
|
|
707
|
+
if (this.menu) {
|
|
708
|
+
yield this.menu.toggle();
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
logout() {
|
|
713
|
+
var _a;
|
|
714
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
715
|
+
if ((_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.oauthConfig) {
|
|
716
|
+
this.oauth2Service.logout();
|
|
717
|
+
}
|
|
718
|
+
this.menuService.close();
|
|
719
|
+
this.tokenService.removeToken();
|
|
720
|
+
this.tokenService.getToken().next(null);
|
|
721
|
+
this.logoutEmitter.emit(true);
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
defineColor() {
|
|
725
|
+
const css = `
|
|
726
|
+
*::-webkit-scrollbar-thumb {background: ${this.palletColors.scrollbarColor};width: 2px;}
|
|
727
|
+
*::-webkit-scrollbar-thumb:hover {background: ${this.palletColors.scrollbarColorHover};}
|
|
728
|
+
input:-webkit-autofill, input:-webkit-autofill:focus, input:-webkit-autofill:hover {color: ${this.palletColors.fontColor}!important;}
|
|
729
|
+
.menu-container,
|
|
730
|
+
body {background: ${this.palletColors.bodyBackground}!important;}
|
|
731
|
+
input:-webkit-autofill, input:-webkit-autofill:focus, input:-webkit-autofill:hover {-webkit-box-shadow: 0 0 0 1000px ${this.palletColors.firstColor} inset !important;}
|
|
732
|
+
.mat-button-disabled,
|
|
733
|
+
input::placeholder,
|
|
734
|
+
.mat-form-field-appearance-outline .mat-form-field-outline {color: ${this.palletColors.fontColor}!important;opacity: .6;}
|
|
735
|
+
.mat-hint,
|
|
736
|
+
.mat-expansion-indicator::after,
|
|
737
|
+
.more-items-content .items .titleForm,
|
|
738
|
+
fieldset legend,
|
|
739
|
+
.mat-paginator-container,
|
|
740
|
+
.mat-form-field-flex mat-icon {color: ${this.palletColors.fontColor}!important;}
|
|
741
|
+
.mat-paginator-container,
|
|
742
|
+
.mat-card,
|
|
743
|
+
.mat-expansion-panel,
|
|
744
|
+
.mat-select-panel,
|
|
745
|
+
.mat-autocomplete-panel,
|
|
746
|
+
.mat-menu-panel {background: ${this.palletColors.firstColor}}
|
|
747
|
+
.mat-selected {background-color: rgba(0,0,0,.3)!important;}
|
|
748
|
+
.question p,
|
|
749
|
+
.alert-message,
|
|
750
|
+
.mat-action-row,
|
|
751
|
+
.mat-option,
|
|
752
|
+
.mat-menu-item,
|
|
753
|
+
.mat-menu-item mat-icon {color: ${this.palletColors.fontColor}!important}
|
|
754
|
+
.mat-select-value,
|
|
755
|
+
.mat-select-arrow,
|
|
756
|
+
.mat-form-field input,
|
|
757
|
+
.mat-form-field textarea,
|
|
758
|
+
.mat-form-field-appearance-outline:not(.mat-form-field-invalid) .mat-form-field-outline-thick,
|
|
759
|
+
.mat-form-field label,
|
|
760
|
+
.select-multiple-native select {color: ${this.palletColors.fontColor}!important;caret-color: ${this.palletColors.fontColor}!important;}
|
|
761
|
+
.mat-form-field-underline,
|
|
762
|
+
.mat-form-field-appearance-fill .mat-form-field-underline::before,
|
|
763
|
+
.mat-form-field-ripple {background: ${this.palletColors.fontColor}!important;}
|
|
764
|
+
.mat-checkbox-checked.mat-accent .mat-checkbox-background, .mat-checkbox-indeterminate.mat-accent .mat-checkbox-background,
|
|
765
|
+
.mat-checkbox:not(.mat-checkbox-disabled).mat-accent .mat-checkbox-ripple .mat-ripple-element {background-color: ${this.palletColors.checkboxBackground} !important;}
|
|
766
|
+
.mat-checkbox-checkmark-path {stroke: ${this.palletColors.checkboxColor} !important;}
|
|
767
|
+
.mat-checkbox-checkmark {fill: ${this.palletColors.checkboxColor} !important;}
|
|
768
|
+
.mat-checkbox-mixedmark {background-color: ${this.palletColors.checkboxColor} !important;}
|
|
769
|
+
.mat-checkbox-frame {border-color: ${this.palletColors.checkboxOutlineColor}!important;}
|
|
770
|
+
.mat-checkbox-label {color: ${this.palletColors.fontColor}!important;}
|
|
771
|
+
.mat-radio-outer-circle {border-color: ${this.palletColors.checkboxBackground}!important;}
|
|
772
|
+
.mat-radio-ripple .mat-ripple-element, .mat-radio-inner-circle {background-color: ${this.palletColors.checkboxBackground} !important;}
|
|
773
|
+
.home-list-cards .list .mat-list-item-content .mat-icon {color: ${this.palletColors.fontColor};}
|
|
774
|
+
.home-list-cards .list button .mat-badge-content {background: ${this.palletColors.fontColor};}
|
|
775
|
+
.koala-dialog .mat-dialog-title h2 {color: ${this.palletColors.fontColor};}
|
|
776
|
+
.koala-dialog .mat-dialog-title mat-icon {color: ${this.palletColors.fontColor}!important;}
|
|
777
|
+
.koala-dialog .mat-dialog-container {background: ${this.palletColors.firstColor}}
|
|
778
|
+
.list-filter mat-icon {color: ${this.palletColors.filterIconColor}!important;}
|
|
779
|
+
koala-page .menu-options {background: ${this.palletColors.menuBackground};}
|
|
780
|
+
koala-page .toolbar {background: ${this.palletColors.toolbarBackground};}
|
|
781
|
+
koala-page .toolbar .btn-collapse-menu,
|
|
782
|
+
koala-page .btn-toolbar span{color: ${this.palletColors.toolbarColor};}
|
|
783
|
+
koala-page .btn-toolbar span.icon-user,
|
|
784
|
+
.user-presentation span.icon-user {background: ${this.palletColors.userPresentationUserBackground};color: ${this.palletColors.userPresentationUserFontColor};}
|
|
785
|
+
.user-presentation {background: ${this.palletColors.userPresentationBackground};}
|
|
786
|
+
.user-presentation span.username {color: ${this.palletColors.toolbarColor};}
|
|
787
|
+
.mat-drawer.mat-drawer-push {background-color: ${this.palletColors.bodyBackground};}
|
|
788
|
+
koala-menu .title {background: ${this.palletColors.menuTitleBackground};color: ${this.palletColors.menuTitleColor};}
|
|
789
|
+
koala-menu ul li,
|
|
790
|
+
koala-menu ul li a {color: ${this.palletColors.menuOptionsColor};}
|
|
791
|
+
koala-menu ul li:hover,
|
|
792
|
+
koala-menu ul li:hover a {color: ${this.palletColors.menuOptionsColorHover} !important;}
|
|
793
|
+
koala-menu ul li.active,
|
|
794
|
+
koala-menu ul li.expanded {color: ${this.palletColors.menuOptionsColorActive} !important;border-left: 4px solid ${this.palletColors.menuOptionsColorActive} !important;background: ${this.palletColors.menuOptionsBackground} !important;}
|
|
795
|
+
koala-menu ul li.active a,
|
|
796
|
+
koala-menu ul li.expanded a {color: ${this.palletColors.menuOptionsColorActive} !important;background: ${this.palletColors.menuOptionsBackground} !important;}
|
|
797
|
+
koala-menu ul li li:hover,
|
|
798
|
+
koala-menu ul li li:hover a {color: ${this.palletColors.menuOptionsColorHover} !important;}
|
|
799
|
+
koala-menu ul li li.active,
|
|
800
|
+
koala-menu ul li li.active a {color: ${this.palletColors.menuOptionsColorActive} !important;}
|
|
801
|
+
koala-menu ul li koala-icon svg *,
|
|
802
|
+
koala-menu ul li a koala-icon svg * {fill: ${this.palletColors.menuOptionsColor};}
|
|
803
|
+
koala-menu ul li:hover koala-icon svg *,
|
|
804
|
+
koala-menu ul li:hover a koala-icon svg * {fill: ${this.palletColors.menuOptionsColorHover} !important;}
|
|
805
|
+
koala-menu ul li.active koala-icon *,
|
|
806
|
+
koala-menu ul li.expanded koala-icon * {fill: ${this.palletColors.menuOptionsColorActive} !important;}
|
|
807
|
+
koala-menu ul li li:hover koala-icon *,
|
|
808
|
+
koala-menu ul li li:hover a koala-icon * {fill: ${this.palletColors.menuOptionsColorHover} !important;}
|
|
809
|
+
koala-menu ul li li.active koala-icon *,
|
|
810
|
+
koala-menu ul li li.active a koala-icon * {fill: ${this.palletColors.menuOptionsColorActive}!important;}
|
|
811
|
+
.notifications-content .title {color: ${this.palletColors.notificationTitleColor}!important;}
|
|
812
|
+
.notifications-content .empty,
|
|
813
|
+
.notifications-content .titleList {color: ${this.palletColors.notificationContentTitleColor}!important;}
|
|
814
|
+
.notifications-content .iconList {color: ${this.palletColors.notificationContentIconColor}!important;}
|
|
815
|
+
.notifications-content .textList {color: ${this.palletColors.notificationTitleColor}!important;}
|
|
816
|
+
.list-container {box-shadow: 0 1px 3px ${this.palletColors.shadowColorTableList};}
|
|
817
|
+
.list-container .list table.table-hover tr:hover {background: ${this.palletColors.listItemBackgroudHover};}
|
|
818
|
+
.list-container .list table.table-hover tr:active {background: ${this.palletColors.listItemBackgroundActive};}
|
|
819
|
+
.list-container .list-filter .advanced {background: ${this.palletColors.firstColor};}
|
|
820
|
+
.list-container nav.menu-list {background: ${this.palletColors.firstColor};color: rgba(25, 118, 210, .3);}
|
|
821
|
+
.content {background: ${this.palletColors.listContentBackground};}
|
|
822
|
+
.mat-tab-group .mat-tab-label {color: ${this.palletColors.fontColor};}
|
|
823
|
+
.mat-tab-group .mat-ink-bar {background-color: ${this.palletColors.fontColor}!important;}
|
|
824
|
+
.mat-table {background: ${this.palletColors.listBackground};color: ${this.palletColors.fontColor};}
|
|
825
|
+
.mat-table th {color: ${this.palletColors.listTitleItemColor}!important;}
|
|
826
|
+
.mat-sort-header-arrow {color: ${this.palletColors.listItemColor}!important;}
|
|
827
|
+
.mat-table td {color: ${this.palletColors.listItemColor}!important;}`;
|
|
828
|
+
const head = document.head || document.getElementsByTagName('head')[0];
|
|
829
|
+
const style = document.createElement('style');
|
|
830
|
+
head.appendChild(style);
|
|
831
|
+
style.appendChild(document.createTextNode(css));
|
|
832
|
+
}
|
|
833
|
+
initOAuth2() {
|
|
834
|
+
KoalaOauthConfig.config.subscribe(config => this.startConfig(config));
|
|
835
|
+
if (KoalaOauthConfig.hasConfig()) {
|
|
836
|
+
KoalaOauthConfig.setConfig(KoalaOauthConfig.getConfig());
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
startConfig(config) {
|
|
840
|
+
var _a, _b;
|
|
841
|
+
if (config.clientId) {
|
|
842
|
+
this.oauth2Service.configure({
|
|
843
|
+
redirectUri: window.location.origin,
|
|
844
|
+
redirectUriAfterAuth: this.defaultPage,
|
|
845
|
+
responseType: 'code',
|
|
846
|
+
clientId: config.clientId,
|
|
847
|
+
scope: config.scope,
|
|
848
|
+
issuer: config.domain,
|
|
849
|
+
customQueryParams: config.customQueryParams,
|
|
850
|
+
endpointToken: (_a = config.endpointToken) !== null && _a !== void 0 ? _a : null,
|
|
851
|
+
endpointClaims: (_b = config.endpointClaims) !== null && _b !== void 0 ? _b : null
|
|
852
|
+
});
|
|
853
|
+
this.oauth2Service.loadDiscoveryDocumentAndTryLogin().then();
|
|
854
|
+
if (this.oauthEventsSubscription) {
|
|
855
|
+
this.oauthEventsSubscription.unsubscribe();
|
|
856
|
+
}
|
|
857
|
+
this.oauthEventsSubscription = this.oauth2Service.events.subscribe(event => {
|
|
858
|
+
var _a;
|
|
859
|
+
if (event === 'userAuthenticated' || event === 'refreshToken') {
|
|
860
|
+
const claims = this.oauth2Service.getIdentityClaims();
|
|
861
|
+
if (claims && (!TokenFactory.hasToken() ||
|
|
862
|
+
(TokenFactory.hasToken() && event === 'refreshToken'))) {
|
|
863
|
+
this.tokenService.setToken(jwtEncode({
|
|
864
|
+
accessToken: this.oauth2Service.getAccessToken(),
|
|
865
|
+
idToken: this.oauth2Service.getIdToken(),
|
|
866
|
+
refreshToken: this.oauth2Service.getRefreshToken(),
|
|
867
|
+
login: (_a = claims[config.indexLoginName]) !== null && _a !== void 0 ? _a : 'Undefined',
|
|
868
|
+
expired: this.oauth2Service.getAccessTokenExpiration(),
|
|
869
|
+
code: this.oauth2Service.getCode()
|
|
870
|
+
}, 'secret'));
|
|
871
|
+
}
|
|
872
|
+
if (event === 'userAuthenticated') {
|
|
873
|
+
setTimeout(() => this.validationScope$.next(false), 300);
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
else if (event === 'getToken') {
|
|
877
|
+
this.validationScope$.next(true);
|
|
878
|
+
}
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
PageComponent.decorators = [
|
|
884
|
+
{ type: Component, args: [{
|
|
885
|
+
selector: 'koala-page',
|
|
886
|
+
template: "<div *ngIf=\"showLoaderPage | async\" class=\"koala-loader-pg\">\n <div class=\"loader-content\">\n <figure>\n <img [src]=\"logo\" alt=\"Logotipo\"/>\n <figcaption *ngIf=\"(messageLoaderPage | async) as messageLoader\" [innerHTML]=\"messageLoader\"></figcaption>\n </figure>\n <mat-spinner></mat-spinner>\n </div>\n</div>\n<app-loader-page *ngIf=\"(loaderSubject | async) as loader\" [progress]=\"loader.progress\" [show]=\"loader.show\"\n [typeLoader]=\"loader.typeLoader\"></app-loader-page>\n<mat-drawer-container autosize class=\"menu-container\">\n <mat-drawer #drawer class=\"menu-options\" [mode]=\"isMobile ? 'push' : 'side'\">\n <img [src]=\"logo\" alt=\"Logotipo\" id=\"logotipo\"/>\n <ng-content *ngIf=\"showMenu\" select=\"[menu-options]\"></ng-content>\n </mat-drawer>\n\n <mat-toolbar *ngIf=\"!!(logged$ | async) && (username$ | async)\" class=\"toolbar\">\n <img *ngIf=\"!showMenu\" [src]=\"logo\" alt=\"Logotipo Toolbar\" id=\"logotipo-toolbar\"/>\n <button (click)=\"toogleMenu()\" *ngIf=\"showMenu\" [color]=\"color\" class=\"btn-collapse-menu\" mat-icon-button>\n <mat-icon>menu</mat-icon>\n </button>\n <span class=\"spacer\"></span>\n\t <div class=\"menu-toolbar\">\n\t\t <ng-content select=\"[menu-toolbar]\"></ng-content>\n\t </div>\n <div *ngIf=\"(notifications | async) as notificationList\">\n <button *ngIf=\"notifications\" [color]=\"color\" [matMenuTriggerFor]=\"notificationsMenu\" class=\"btn-toolbar\"\n mat-icon-button>\n <mat-icon\n\t [matBadgeHidden]=\"notificationList.length === 0\"\n\t [matBadge]=\"notificationList.length.toString()\"\n\t matBadgeColor=\"warn\">notifications\n </mat-icon>\n </button>\n <mat-menu #notificationsMenu=\"matMenu\" class=\"menu-list\" yPosition=\"below\">\n <koala-notification-list\n (delete)=\"deleteNotification.emit($event)\"\n (deleteAll)=\"deleteAllNotifications.emit($event)\"\n [notifications]=\"notificationList\">\n </koala-notification-list>\n </mat-menu>\n </div>\n <button [color]=\"color\" [matMenuTriggerFor]=\"userOptions\" class=\"btn-toolbar\" mat-button>\n <span>{{username$ | async}}</span>\n <span class=\"icon-user\">{{firstUserLetter$ | async}}</span>\n </button>\n <mat-menu #userOptions=\"matMenu\" class=\"user-menu menu-list\" yPosition=\"below\">\n <div class=\"user-presentation\">\n <span class=\"icon-user\">{{firstUserLetter$ | async}}</span><br/>\n <span class=\"username\">{{username$ | async}}</span>\n </div>\n <button (click)=\"btn.action()\" *ngFor=\"let btn of userMenuOptions\" mat-menu-item>\n <mat-icon>{{btn.icon}}</mat-icon>\n <span>{{btn.name}}</span>\n </button>\n <button (click)=\"logout()\" mat-menu-item>\n <mat-icon>exit_to_app</mat-icon>\n <span>{{language === 'ptBr' ? 'Sair' : 'Logout'}}</span>\n </button>\n </mat-menu>\n </mat-toolbar>\n\n <ng-content class=\"page-content\" select=\"[page-content]\"></ng-content>\n\n</mat-drawer-container>\n\n<ng-content class=\"loading-info-content\" select=\"[loading-info-content]\"></ng-content>\n",
|
|
887
|
+
providers: [KoalaTokenService],
|
|
888
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
889
|
+
styles: [".menu-container{height:100vh;width:100vw}.menu-options{border:none;padding:20px 0 0;width:250px}.page-content{align-items:center;display:flex;height:100%;justify-content:center}img#logotipo,img#logotipo-toolbar{display:block;height:auto;margin:0 auto 25px;position:relative;width:120px}.toolbar{box-shadow:none;padding:0 7px 0 13px}.toolbar img#logotipo-toolbar{margin:0;padding:0 10px}.menu-toolbar{margin:0 10px}.spacer{flex:1 1 auto}.btn-toolbar{display:inline-block;margin-right:10px;position:relative}.btn-toolbar span{padding:0 10px 0 0}.btn-toolbar span.icon-user,.user-presentation span.icon-user{border-radius:50%;display:inline-block;height:10px;line-height:10px;padding:5px;width:10px}.user-presentation{min-width:260px;padding:50px 10px;text-align:center}.user-presentation span.icon-user{font-size:30px;height:30px;line-height:30px;margin-bottom:10px;width:30px}.user-presentation span.username{font-family:OpenSansLight,sans-serif;word-break:break-all}@media (max-width: 900px){.btn-toolbar span:first-child{display:none}.btn-toolbar span.icon-user,.user-presentation span.icon-user{height:20px;line-height:20px;width:20px}}\n"]
|
|
890
|
+
},] }
|
|
891
|
+
];
|
|
892
|
+
PageComponent.ctorParameters = () => [
|
|
893
|
+
{ type: KoalaTokenService },
|
|
894
|
+
{ type: Router },
|
|
895
|
+
{ type: KoalaLoaderService },
|
|
896
|
+
{ type: KoalaMenuService },
|
|
897
|
+
{ type: KoalaOAuth2Service },
|
|
898
|
+
{ type: DeviceDetectorService }
|
|
899
|
+
];
|
|
900
|
+
PageComponent.propDecorators = {
|
|
901
|
+
showMenu: [{ type: Input }],
|
|
902
|
+
color: [{ type: Input }],
|
|
903
|
+
logo: [{ type: Input }],
|
|
904
|
+
startMenuOpened: [{ type: Input }],
|
|
905
|
+
showLoaderPage: [{ type: Input }],
|
|
906
|
+
messageLoaderPage: [{ type: Input }],
|
|
907
|
+
defaultPage: [{ type: Input }],
|
|
908
|
+
openPages: [{ type: Input }],
|
|
909
|
+
notifications: [{ type: Input }],
|
|
910
|
+
userMenuOptions: [{ type: Input }],
|
|
911
|
+
palletColors: [{ type: Input }],
|
|
912
|
+
language: [{ type: Input }],
|
|
913
|
+
validatingScope: [{ type: Output }],
|
|
914
|
+
logoutEmitter: [{ type: Output }],
|
|
915
|
+
deleteAllNotifications: [{ type: Output }],
|
|
916
|
+
deleteNotification: [{ type: Output }],
|
|
917
|
+
menu: [{ type: ViewChild, args: ['drawer', { static: true },] }]
|
|
918
|
+
};
|
|
919
|
+
|
|
920
|
+
class KoalaNotFoundError extends Error {
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
class KoalaUnhautorizedError extends Error {
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
class KoalaClientError extends Error {
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
class KoalaSuccessError extends Error {
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
class KoalaErrorsHelper {
|
|
933
|
+
static generate(e, urlRequest, customMessage) {
|
|
934
|
+
let errorMessage = {
|
|
935
|
+
error: true,
|
|
936
|
+
message: (customMessage ? customMessage : e.message),
|
|
937
|
+
urlRequest
|
|
938
|
+
};
|
|
939
|
+
if (e instanceof KoalaSuccessError) {
|
|
940
|
+
errorMessage.error = false;
|
|
941
|
+
errorMessage.statusCode = 200;
|
|
942
|
+
errorMessage.alertEnum = KoalaAlertEnum.success;
|
|
943
|
+
}
|
|
944
|
+
else if (e instanceof KoalaNotFoundError) {
|
|
945
|
+
errorMessage.statusCode = 404;
|
|
946
|
+
errorMessage.alertEnum = KoalaAlertEnum.notFound;
|
|
947
|
+
}
|
|
948
|
+
else if (e instanceof KoalaUnhautorizedError) {
|
|
949
|
+
errorMessage.statusCode = 401;
|
|
950
|
+
errorMessage.alertEnum = KoalaAlertEnum.unhautorized;
|
|
951
|
+
}
|
|
952
|
+
else if (e instanceof KoalaClientError) {
|
|
953
|
+
errorMessage.statusCode = 400;
|
|
954
|
+
errorMessage.alertEnum = KoalaAlertEnum.badRequest;
|
|
955
|
+
}
|
|
956
|
+
else if (e instanceof HttpErrorResponse) {
|
|
957
|
+
errorMessage.urlRequest = e.url;
|
|
958
|
+
errorMessage.statusCode = e.status;
|
|
959
|
+
errorMessage.alertEnum = KoalaAlertEnum.internalServerError;
|
|
960
|
+
if (e.error && e.error.message) {
|
|
961
|
+
errorMessage.message = e.error.message;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
else {
|
|
965
|
+
errorMessage.statusCode = 500;
|
|
966
|
+
errorMessage.alertEnum = KoalaAlertEnum.internalServerError;
|
|
967
|
+
}
|
|
968
|
+
return errorMessage;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
class KoalaRequestHeaderHelper {
|
|
973
|
+
static add(token) {
|
|
974
|
+
const headers = koala({}).object();
|
|
975
|
+
if (token) {
|
|
976
|
+
headers.merge({ Authorization: 'Bearer ' + token });
|
|
977
|
+
}
|
|
978
|
+
if (KoalaOauthConfig.hasConfig()) {
|
|
979
|
+
headers.merge({ Authenticator: KoalaOauthConfig.getConfig() });
|
|
980
|
+
}
|
|
981
|
+
return headers.getValue();
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
// @dynamic
|
|
986
|
+
class KoalaResponseFactory {
|
|
987
|
+
static generateResponse(response, urlRequest) {
|
|
988
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
989
|
+
return new Promise((resolve, reject) => {
|
|
990
|
+
var _a, _b, _c, _d, _e, _f;
|
|
991
|
+
let alert;
|
|
992
|
+
switch (response.status) {
|
|
993
|
+
case 200:
|
|
994
|
+
case 201:
|
|
995
|
+
alert = KoalaErrorsHelper.generate(new KoalaSuccessError((_a = response.body) === null || _a === void 0 ? void 0 : _a.message), urlRequest);
|
|
996
|
+
alert.data = response.body;
|
|
997
|
+
resolve(alert);
|
|
998
|
+
break;
|
|
999
|
+
case 400:
|
|
1000
|
+
alert = KoalaErrorsHelper.generate(new KoalaClientError(response.body.message), urlRequest);
|
|
1001
|
+
reject(alert);
|
|
1002
|
+
break;
|
|
1003
|
+
case 404:
|
|
1004
|
+
alert = KoalaErrorsHelper.generate(new KoalaNotFoundError((_b = response.body) === null || _b === void 0 ? void 0 : _b.message), urlRequest);
|
|
1005
|
+
reject(alert);
|
|
1006
|
+
break;
|
|
1007
|
+
case 401:
|
|
1008
|
+
alert = KoalaErrorsHelper.generate(new KoalaUnhautorizedError((_c = response.body) === null || _c === void 0 ? void 0 : _c.message), urlRequest);
|
|
1009
|
+
reject(alert);
|
|
1010
|
+
break;
|
|
1011
|
+
case 405:
|
|
1012
|
+
alert = KoalaErrorsHelper.generate(new KoalaClientError((_d = response.body) === null || _d === void 0 ? void 0 : _d.message), urlRequest);
|
|
1013
|
+
reject(alert);
|
|
1014
|
+
break;
|
|
1015
|
+
case 500:
|
|
1016
|
+
default:
|
|
1017
|
+
alert = KoalaErrorsHelper.generate(new Error((response && ((_e = response.body) === null || _e === void 0 ? void 0 : _e.message)) ? (_f = response.body) === null || _f === void 0 ? void 0 : _f.message : KoalaLanguageHelper.getInternalServerErrorMessage()), urlRequest);
|
|
1018
|
+
reject(alert);
|
|
1019
|
+
break;
|
|
1020
|
+
}
|
|
1021
|
+
});
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
class KoalaApiRequesterService {
|
|
1027
|
+
constructor(http, oauth2Service) {
|
|
1028
|
+
this.http = http;
|
|
1029
|
+
this.oauth2Service = oauth2Service;
|
|
1030
|
+
this.isMockup = false;
|
|
1031
|
+
this.subscriptions = [];
|
|
1032
|
+
}
|
|
1033
|
+
request(method, url, data = {}) {
|
|
1034
|
+
if (data.__zone_symbol__state) {
|
|
1035
|
+
data = data.__zone_symbol__value;
|
|
1036
|
+
}
|
|
1037
|
+
switch (method) {
|
|
1038
|
+
case 'post':
|
|
1039
|
+
case 'put':
|
|
1040
|
+
case 'patch':
|
|
1041
|
+
case 'delete':
|
|
1042
|
+
return this.promiseSendData(this.postPutDelete(method, url, data), url);
|
|
1043
|
+
case 'get':
|
|
1044
|
+
let httpParams = new HttpParams();
|
|
1045
|
+
Object.keys(data !== null && data !== void 0 ? data : {}).forEach((key) => {
|
|
1046
|
+
let dado = data[key];
|
|
1047
|
+
if (typeof dado == "object") {
|
|
1048
|
+
if (dado && dado.hasOwnProperty('length') && dado.length > 0) {
|
|
1049
|
+
dado.forEach(item => {
|
|
1050
|
+
httpParams = httpParams.append(`${key.replace('[]', '')}[]`, item);
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
else {
|
|
1054
|
+
httpParams = httpParams.append(key, dado);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
else {
|
|
1058
|
+
httpParams = httpParams.append(key, dado);
|
|
1059
|
+
}
|
|
1060
|
+
});
|
|
1061
|
+
return this.promiseGetData(this.get(url, httpParams));
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
cancelRequests() {
|
|
1065
|
+
for (let subscribe of this.subscriptions.values()) {
|
|
1066
|
+
subscribe.unsubscribe();
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
get(url, params) {
|
|
1070
|
+
return this.getMethod('get', url, params)
|
|
1071
|
+
.pipe(map(response => {
|
|
1072
|
+
return response.body;
|
|
1073
|
+
}));
|
|
1074
|
+
}
|
|
1075
|
+
postPutDelete(method, url, data) {
|
|
1076
|
+
return this.getMethod(method, url, data);
|
|
1077
|
+
}
|
|
1078
|
+
promiseGetData(request) {
|
|
1079
|
+
return new Observable(observe => {
|
|
1080
|
+
this.subscriptions
|
|
1081
|
+
.push(request.pipe(first())
|
|
1082
|
+
.subscribe({
|
|
1083
|
+
next: response => {
|
|
1084
|
+
observe.next(response);
|
|
1085
|
+
observe.complete();
|
|
1086
|
+
},
|
|
1087
|
+
error: e => {
|
|
1088
|
+
if (e.status === 401) {
|
|
1089
|
+
this.oauth2Service.logout();
|
|
1090
|
+
}
|
|
1091
|
+
observe.error(KoalaErrorsHelper.generate(e));
|
|
1092
|
+
}
|
|
1093
|
+
}));
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
promiseSendData(request, urlRequest) {
|
|
1097
|
+
return new Observable(observe => {
|
|
1098
|
+
this.subscriptions
|
|
1099
|
+
.push(request.pipe(first())
|
|
1100
|
+
.subscribe({
|
|
1101
|
+
next: response => KoalaResponseFactory.generateResponse(response, urlRequest)
|
|
1102
|
+
.then(success => {
|
|
1103
|
+
observe.next(success);
|
|
1104
|
+
observe.complete();
|
|
1105
|
+
})
|
|
1106
|
+
.catch(error => {
|
|
1107
|
+
if (error.status === 401) {
|
|
1108
|
+
this.oauth2Service.logout();
|
|
1109
|
+
}
|
|
1110
|
+
observe.error(error);
|
|
1111
|
+
}),
|
|
1112
|
+
error: e => observe.error(KoalaErrorsHelper.generate(e))
|
|
1113
|
+
}));
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
getUrlBase() {
|
|
1117
|
+
return this.isMockup ? 'http://localhost:4200/assets/mockup' : this.apiUrl;
|
|
1118
|
+
}
|
|
1119
|
+
getMethod(method, url, data = {}) {
|
|
1120
|
+
const options = {
|
|
1121
|
+
observe: 'response',
|
|
1122
|
+
headers: KoalaRequestHeaderHelper.add(TokenFactory.getToken())
|
|
1123
|
+
};
|
|
1124
|
+
switch (method) {
|
|
1125
|
+
case "post":
|
|
1126
|
+
return this.http.post(`${this.getUrlBase()}/${url}`, data, options);
|
|
1127
|
+
case "put":
|
|
1128
|
+
return this.http.put(`${this.getUrlBase()}/${url}`, data, options);
|
|
1129
|
+
case "patch":
|
|
1130
|
+
return this.http.patch(`${this.getUrlBase()}/${url}`, data, options);
|
|
1131
|
+
case "delete":
|
|
1132
|
+
return this.http.delete(`${this.getUrlBase()}/${url}`, options);
|
|
1133
|
+
case "get":
|
|
1134
|
+
options.params = data;
|
|
1135
|
+
return this.http.get(`${this.getUrlBase()}/${url}`, options);
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
KoalaApiRequesterService.ɵprov = i0.ɵɵdefineInjectable({ factory: function KoalaApiRequesterService_Factory() { return new KoalaApiRequesterService(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(KoalaOAuth2Service)); }, token: KoalaApiRequesterService, providedIn: "root" });
|
|
1140
|
+
KoalaApiRequesterService.decorators = [
|
|
1141
|
+
{ type: Injectable, args: [{ providedIn: "root" },] }
|
|
1142
|
+
];
|
|
1143
|
+
KoalaApiRequesterService.ctorParameters = () => [
|
|
1144
|
+
{ type: HttpClient },
|
|
1145
|
+
{ type: KoalaOAuth2Service }
|
|
1146
|
+
];
|
|
1147
|
+
|
|
1148
|
+
class KoalaApiRequesterBase {
|
|
1149
|
+
constructor(koalaService, endpoint, isMockup = false) {
|
|
1150
|
+
var _a;
|
|
1151
|
+
this.koalaService = koalaService;
|
|
1152
|
+
this.endpoint = endpoint;
|
|
1153
|
+
koalaService.apiUrl = (_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.endpointApi;
|
|
1154
|
+
koalaService.isMockup = isMockup;
|
|
1155
|
+
}
|
|
1156
|
+
getAll(filter) {
|
|
1157
|
+
return this.koalaService.request('get', this.endpoint, this.getParams(filter));
|
|
1158
|
+
}
|
|
1159
|
+
getById(id) {
|
|
1160
|
+
return this.koalaService.request('get', this.endpoint + '/' + id);
|
|
1161
|
+
}
|
|
1162
|
+
getBySomething(something) {
|
|
1163
|
+
return this.koalaService.request('get', this.endpoint + '/' + something);
|
|
1164
|
+
}
|
|
1165
|
+
save(data, id) {
|
|
1166
|
+
return this.koalaService.request((id ? 'put' : 'post'), `${this.endpoint}${(id ? `/${id}` : '')}`, data);
|
|
1167
|
+
}
|
|
1168
|
+
delete(id) {
|
|
1169
|
+
return this.koalaService.request('delete', this.endpoint + '/' + id);
|
|
1170
|
+
}
|
|
1171
|
+
cancelRequests() {
|
|
1172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1173
|
+
yield this.koalaService.cancelRequests();
|
|
1174
|
+
});
|
|
1175
|
+
}
|
|
1176
|
+
getParams(params) {
|
|
1177
|
+
var _a;
|
|
1178
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1179
|
+
let filter = {};
|
|
1180
|
+
if (params instanceof BehaviorSubject) {
|
|
1181
|
+
Object.assign(filter, (_a = params === null || params === void 0 ? void 0 : params.getValue()) !== null && _a !== void 0 ? _a : {});
|
|
1182
|
+
}
|
|
1183
|
+
else {
|
|
1184
|
+
Object.assign(filter, params !== null && params !== void 0 ? params : {});
|
|
1185
|
+
}
|
|
1186
|
+
if (filter &&
|
|
1187
|
+
filter.hasOwnProperty('sort') &&
|
|
1188
|
+
filter.hasOwnProperty('order') &&
|
|
1189
|
+
filter.hasOwnProperty('limit') &&
|
|
1190
|
+
filter.hasOwnProperty('page') &&
|
|
1191
|
+
filter.hasOwnProperty('params')) {
|
|
1192
|
+
Object.keys(filter.params).forEach(indexName => {
|
|
1193
|
+
if (`${filter.params[indexName]}` === 'NaN' ||
|
|
1194
|
+
filter.params[indexName] === null) {
|
|
1195
|
+
filter.params[indexName] = '';
|
|
1196
|
+
}
|
|
1197
|
+
});
|
|
1198
|
+
return koala({})
|
|
1199
|
+
.object()
|
|
1200
|
+
.merge(filter.params)
|
|
1201
|
+
.merge({
|
|
1202
|
+
sort: filter.sort,
|
|
1203
|
+
order: filter.order,
|
|
1204
|
+
limit: filter.limit,
|
|
1205
|
+
page: filter.page
|
|
1206
|
+
})
|
|
1207
|
+
.getValue();
|
|
1208
|
+
}
|
|
1209
|
+
return filter !== null && filter !== void 0 ? filter : null;
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
class KoalaCsvService {
|
|
1215
|
+
constructor(papa) {
|
|
1216
|
+
this.papa = papa;
|
|
1217
|
+
}
|
|
1218
|
+
convertJsonToCsv(json, filename = 'export') {
|
|
1219
|
+
this.downloadCsv(new Blob([
|
|
1220
|
+
this.papa.unparse(json, {
|
|
1221
|
+
header: true,
|
|
1222
|
+
delimiter: ";",
|
|
1223
|
+
newline: "\r\n"
|
|
1224
|
+
})
|
|
1225
|
+
], {
|
|
1226
|
+
type: 'text/csv;charset=utf-8;'
|
|
1227
|
+
}), filename);
|
|
1228
|
+
}
|
|
1229
|
+
downloadCsv(blob, filename = 'export') {
|
|
1230
|
+
let link = document.createElement('a');
|
|
1231
|
+
let url = URL.createObjectURL(blob);
|
|
1232
|
+
link.setAttribute("href", url);
|
|
1233
|
+
link.setAttribute("download", filename + '.csv');
|
|
1234
|
+
link.style.visibility = 'hidden';
|
|
1235
|
+
document.body.appendChild(link);
|
|
1236
|
+
link.click();
|
|
1237
|
+
document.body.removeChild(link);
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
KoalaCsvService.ɵprov = i0.ɵɵdefineInjectable({ factory: function KoalaCsvService_Factory() { return new KoalaCsvService(i0.ɵɵinject(i1$1.Papa)); }, token: KoalaCsvService, providedIn: "any" });
|
|
1241
|
+
KoalaCsvService.decorators = [
|
|
1242
|
+
{ type: Injectable, args: [{ providedIn: "any" },] }
|
|
1243
|
+
];
|
|
1244
|
+
KoalaCsvService.ctorParameters = () => [
|
|
1245
|
+
{ type: Papa }
|
|
1246
|
+
];
|
|
1247
|
+
|
|
1248
|
+
class KoalaRequestService {
|
|
1249
|
+
constructor(koalaAlertService) {
|
|
1250
|
+
this.koalaAlertService = koalaAlertService;
|
|
1251
|
+
}
|
|
1252
|
+
request(request, success, error) {
|
|
1253
|
+
if (request instanceof Promise) {
|
|
1254
|
+
request.then((response) => {
|
|
1255
|
+
if (success) {
|
|
1256
|
+
success(response);
|
|
1257
|
+
}
|
|
1258
|
+
}).catch(e => {
|
|
1259
|
+
if (error) {
|
|
1260
|
+
error(e);
|
|
1261
|
+
}
|
|
1262
|
+
this.showAlertError(e);
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
else {
|
|
1266
|
+
return request.subscribe((response) => {
|
|
1267
|
+
if (success) {
|
|
1268
|
+
success(response);
|
|
1269
|
+
}
|
|
1270
|
+
}, (e) => {
|
|
1271
|
+
if (error) {
|
|
1272
|
+
error(e);
|
|
1273
|
+
}
|
|
1274
|
+
this.showAlertError(e);
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
showAlertError(e) {
|
|
1279
|
+
const alertEnum = KoalaRequestCodeToAlertEnumTranslate.translate(e.statusCode);
|
|
1280
|
+
this.koalaAlertService.create({
|
|
1281
|
+
alertEnum,
|
|
1282
|
+
message: alertEnum === KoalaAlertEnum.internalServerError
|
|
1283
|
+
? KoalaLanguageHelper.getInternalServerErrorMessage()
|
|
1284
|
+
: e.message
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
KoalaRequestService.ɵprov = i0.ɵɵdefineInjectable({ factory: function KoalaRequestService_Factory() { return new KoalaRequestService(i0.ɵɵinject(i1$2.KoalaAlertService)); }, token: KoalaRequestService, providedIn: "any" });
|
|
1289
|
+
KoalaRequestService.decorators = [
|
|
1290
|
+
{ type: Injectable, args: [{ providedIn: "any" },] }
|
|
1291
|
+
];
|
|
1292
|
+
KoalaRequestService.ctorParameters = () => [
|
|
1293
|
+
{ type: KoalaAlertService }
|
|
1294
|
+
];
|
|
1295
|
+
|
|
1296
|
+
class KoalaXlsxService {
|
|
1297
|
+
convertJsonToXlsx(json, config) {
|
|
1298
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1299
|
+
const title = config.title;
|
|
1300
|
+
const header = [];
|
|
1301
|
+
Object.keys(json[0]).forEach(name => {
|
|
1302
|
+
header.push(koala(name).string().normalize().getValue().toUpperCase());
|
|
1303
|
+
});
|
|
1304
|
+
const workbook = new Excel.Workbook();
|
|
1305
|
+
const worksheet = workbook.addWorksheet(config.sheetName);
|
|
1306
|
+
if (config.password)
|
|
1307
|
+
yield worksheet.protect(config.password, {
|
|
1308
|
+
selectLockedCells: false,
|
|
1309
|
+
selectUnlockedCells: false,
|
|
1310
|
+
scenarios: false
|
|
1311
|
+
});
|
|
1312
|
+
const titleRow = worksheet.addRow([title]);
|
|
1313
|
+
titleRow.alignment = { horizontal: "center" };
|
|
1314
|
+
titleRow.font = { bold: true, color: { argb: config.titleFontColor.replace('#', '') } };
|
|
1315
|
+
titleRow.fill = {
|
|
1316
|
+
type: 'pattern',
|
|
1317
|
+
pattern: 'solid',
|
|
1318
|
+
fgColor: { argb: config.titleBackgroundColor.replace('#', '') },
|
|
1319
|
+
bgColor: { argb: config.titleBackgroundColor.replace('#', '') }
|
|
1320
|
+
};
|
|
1321
|
+
worksheet.mergeCells(`A1:${worksheet.getCell(1, Object.keys(json[0]).length).address}`);
|
|
1322
|
+
const headerRow = worksheet.addRow(header);
|
|
1323
|
+
headerRow.eachCell((cell, number) => {
|
|
1324
|
+
cell.fill = {
|
|
1325
|
+
type: 'pattern',
|
|
1326
|
+
pattern: 'solid',
|
|
1327
|
+
fgColor: { argb: config.headerBackgroundColor.replace('#', '') },
|
|
1328
|
+
bgColor: { argb: config.headerBackgroundColor.replace('#', '') }
|
|
1329
|
+
};
|
|
1330
|
+
cell.font = {
|
|
1331
|
+
color: { argb: config.headerFontColor.replace('#', '') }
|
|
1332
|
+
};
|
|
1333
|
+
});
|
|
1334
|
+
json.forEach(item => {
|
|
1335
|
+
const data = [];
|
|
1336
|
+
Object.values(item).forEach(value => data.push(value));
|
|
1337
|
+
worksheet.addRow(data);
|
|
1338
|
+
});
|
|
1339
|
+
workbook.xlsx.writeBuffer().then((data) => {
|
|
1340
|
+
let blob = new Blob([data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
1341
|
+
fs.saveAs(blob, config.filename + '.xlsx');
|
|
1342
|
+
});
|
|
1343
|
+
});
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
KoalaXlsxService.ɵprov = i0.ɵɵdefineInjectable({ factory: function KoalaXlsxService_Factory() { return new KoalaXlsxService(); }, token: KoalaXlsxService, providedIn: "any" });
|
|
1347
|
+
KoalaXlsxService.decorators = [
|
|
1348
|
+
{ type: Injectable, args: [{ providedIn: "any" },] }
|
|
1349
|
+
];
|
|
1350
|
+
|
|
1351
|
+
class KoalaParameterHashLocationStrategy extends HashLocationStrategy {
|
|
1352
|
+
prepareExternalUrl(internal) {
|
|
1353
|
+
var _a;
|
|
1354
|
+
const hasToken = !!localStorage.getItem((_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.storageTokenName);
|
|
1355
|
+
return !hasToken ?
|
|
1356
|
+
window.location.search + super.prepareExternalUrl(internal) :
|
|
1357
|
+
super.prepareExternalUrl(internal);
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
KoalaParameterHashLocationStrategy.decorators = [
|
|
1361
|
+
{ type: Injectable }
|
|
1362
|
+
];
|
|
1363
|
+
|
|
1364
|
+
const maskOptions = {
|
|
1365
|
+
validation: false
|
|
1366
|
+
};
|
|
1367
|
+
|
|
1368
|
+
class KoalaPageModule {
|
|
1369
|
+
}
|
|
1370
|
+
KoalaPageModule.decorators = [
|
|
1371
|
+
{ type: NgModule, args: [{
|
|
1372
|
+
declarations: [
|
|
1373
|
+
PageComponent,
|
|
1374
|
+
NotificationComponent,
|
|
1375
|
+
LoaderBarPageComponent
|
|
1376
|
+
],
|
|
1377
|
+
exports: [
|
|
1378
|
+
PageComponent,
|
|
1379
|
+
RouterModule
|
|
1380
|
+
],
|
|
1381
|
+
imports: [
|
|
1382
|
+
CommonModule,
|
|
1383
|
+
RouterModule,
|
|
1384
|
+
MatBadgeModule,
|
|
1385
|
+
MatProgressSpinnerModule,
|
|
1386
|
+
MatProgressBarModule,
|
|
1387
|
+
MatToolbarModule,
|
|
1388
|
+
MatTooltipModule,
|
|
1389
|
+
MatButtonModule,
|
|
1390
|
+
MatIconModule,
|
|
1391
|
+
MatSidenavModule,
|
|
1392
|
+
MatListModule,
|
|
1393
|
+
MatMenuModule
|
|
1394
|
+
]
|
|
1395
|
+
},] }
|
|
1396
|
+
];
|
|
1397
|
+
|
|
1398
|
+
class NgxKoalaModule {
|
|
1399
|
+
static forRoot(environment) {
|
|
1400
|
+
var _a, _b;
|
|
1401
|
+
environment.storageOAuthTypeName = (_a = environment.storageOAuthTypeName) !== null && _a !== void 0 ? _a : 'koala_ui_oauth_type';
|
|
1402
|
+
environment.storageTokenName = (_b = environment.storageTokenName) !== null && _b !== void 0 ? _b : 'koala_ui_token';
|
|
1403
|
+
KoalaEnvironment.environment = environment;
|
|
1404
|
+
return {
|
|
1405
|
+
ngModule: NgxKoalaModule,
|
|
1406
|
+
providers: [KoalaOAuth2Service]
|
|
1407
|
+
};
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
NgxKoalaModule.decorators = [
|
|
1411
|
+
{ type: NgModule, args: [{
|
|
1412
|
+
imports: [
|
|
1413
|
+
CommonModule,
|
|
1414
|
+
HttpClientModule,
|
|
1415
|
+
KoalaPageModule
|
|
1416
|
+
],
|
|
1417
|
+
exports: [
|
|
1418
|
+
HttpClientModule,
|
|
1419
|
+
KoalaPageModule
|
|
1420
|
+
],
|
|
1421
|
+
providers: [
|
|
1422
|
+
KoalaOAuth2Service
|
|
1423
|
+
]
|
|
1424
|
+
},] }
|
|
1425
|
+
];
|
|
1426
|
+
|
|
1427
|
+
//#region [COMPONENTS]
|
|
1428
|
+
|
|
1429
|
+
/**
|
|
1430
|
+
* Generated bundle index. Do not edit.
|
|
1431
|
+
*/
|
|
1432
|
+
|
|
1433
|
+
export { KOALA_LOADER_SUBJECT, KoalaApiRequesterBase, KoalaApiRequesterService, KoalaCsvService, KoalaLanguageHelper, KoalaLoaderService, KoalaOAuth2Service, KoalaOauthConfig, KoalaParameterHashLocationStrategy, KoalaRequestService, KoalaTokenService, KoalaXlsxService, LoaderBarPageComponent, NgxKoalaModule, NotificationComponent, PageComponent, maskOptions, KoalaEnvironment as ɵa, KoalaPageModule as ɵb };
|
|
1434
|
+
//# sourceMappingURL=koalarx-ui-core.js.map
|