@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,1821 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/platform-browser'), require('@angular/router'), require('rxjs'), require('jwt-decode'), require('@koalarx/ui/menu'), require('jwt-encode'), require('@angular/common/http'), require('@koalarx/utils'), require('@koalarx/utils/dist/utils/KlDelay'), require('ngx-device-detector'), require('@koalarx/ui/alert'), require('rxjs/operators'), require('ngx-papaparse'), require('exceljs/dist/exceljs.min.js'), require('file-saver'), require('@angular/common'), require('@angular/material/badge'), require('@angular/material/progress-bar'), require('@angular/material/toolbar'), require('@angular/material/tooltip'), require('@angular/material/button'), require('@angular/material/icon'), require('@angular/material/sidenav'), require('@angular/material/list'), require('@angular/material/menu'), require('@angular/material/progress-spinner')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@koalarx/ui/core', ['exports', '@angular/core', '@angular/platform-browser', '@angular/router', 'rxjs', 'jwt-decode', '@koalarx/ui/menu', 'jwt-encode', '@angular/common/http', '@koalarx/utils', '@koalarx/utils/dist/utils/KlDelay', 'ngx-device-detector', '@koalarx/ui/alert', 'rxjs/operators', 'ngx-papaparse', 'exceljs/dist/exceljs.min.js', 'file-saver', '@angular/common', '@angular/material/badge', '@angular/material/progress-bar', '@angular/material/toolbar', '@angular/material/tooltip', '@angular/material/button', '@angular/material/icon', '@angular/material/sidenav', '@angular/material/list', '@angular/material/menu', '@angular/material/progress-spinner'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.koalarx = global.koalarx || {}, global.koalarx.ui = global.koalarx.ui || {}, global.koalarx.ui.core = {}), global.ng.core, global.ng.platformBrowser, global.ng.router, global.rxjs, global.jwt, global.menu, global.jwtEncode, global.ng.common.http, global.utils, global.KlDelay, global.ngxDeviceDetector, global.alert, global.rxjs.operators, global["ngx-papaparse"], global.Excel, global.fs, global.ng.common, global.ng.material.badge, global.ng.material.progressBar, global.ng.material.toolbar, global.ng.material.tooltip, global.ng.material.button, global.ng.material.icon, global.ng.material.sidenav, global.ng.material.list, global.ng.material.menu, global.ng.material.progressSpinner));
|
|
5
|
+
})(this, (function (exports, i0, platformBrowser, router, rxjs, jwt, menu, jwtEncode, i1, utils, KlDelay, ngxDeviceDetector, i1$1, operators, i1$2, Excel, fs, common, badge, progressBar, toolbar, tooltip, button, icon, sidenav, list, menu$1, progressSpinner) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return e[k]; }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n["default"] = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
28
|
+
var jwt__default = /*#__PURE__*/_interopDefaultLegacy(jwt);
|
|
29
|
+
var jwtEncode__default = /*#__PURE__*/_interopDefaultLegacy(jwtEncode);
|
|
30
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
31
|
+
var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
32
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$2);
|
|
33
|
+
var Excel__namespace = /*#__PURE__*/_interopNamespace(Excel);
|
|
34
|
+
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
35
|
+
|
|
36
|
+
var LoaderBarPageComponent = /** @class */ (function () {
|
|
37
|
+
function LoaderBarPageComponent() {
|
|
38
|
+
this.show = false;
|
|
39
|
+
this.progress = 0;
|
|
40
|
+
this.typeLoader = 'indeterminate';
|
|
41
|
+
}
|
|
42
|
+
return LoaderBarPageComponent;
|
|
43
|
+
}());
|
|
44
|
+
LoaderBarPageComponent.decorators = [
|
|
45
|
+
{ type: i0.Component, args: [{
|
|
46
|
+
selector: 'app-loader-page',
|
|
47
|
+
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",
|
|
48
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
49
|
+
styles: [".loader-bar-page{position:absolute;display:none;top:0;left:0;width:100vw;height:100vh;z-index:100000}\n"]
|
|
50
|
+
},] }
|
|
51
|
+
];
|
|
52
|
+
LoaderBarPageComponent.propDecorators = {
|
|
53
|
+
show: [{ type: i0.Input }],
|
|
54
|
+
progress: [{ type: i0.Input }],
|
|
55
|
+
typeLoader: [{ type: i0.Input }]
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
var NotificationComponent = /** @class */ (function () {
|
|
59
|
+
function NotificationComponent(titleService) {
|
|
60
|
+
this.titleService = titleService;
|
|
61
|
+
this.deleteAll = new i0.EventEmitter(false);
|
|
62
|
+
this.delete = new i0.EventEmitter(null);
|
|
63
|
+
}
|
|
64
|
+
NotificationComponent.prototype.ngOnChanges = function (changes) {
|
|
65
|
+
if (!this.appName) {
|
|
66
|
+
this.appName = this.titleService.getTitle();
|
|
67
|
+
}
|
|
68
|
+
if (changes.notifications && this.notifications.length > 0) {
|
|
69
|
+
this.titleService.setTitle("(" + this.notifications.length + ") " + this.appName);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.titleService.setTitle(this.appName);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
NotificationComponent.prototype.deleteAllNotifications = function () {
|
|
76
|
+
this.deleteAll.emit(true);
|
|
77
|
+
};
|
|
78
|
+
NotificationComponent.prototype.deleteNotification = function (notification) {
|
|
79
|
+
this.delete.emit(notification);
|
|
80
|
+
};
|
|
81
|
+
return NotificationComponent;
|
|
82
|
+
}());
|
|
83
|
+
NotificationComponent.decorators = [
|
|
84
|
+
{ type: i0.Component, args: [{
|
|
85
|
+
selector: 'koala-notification-list',
|
|
86
|
+
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",
|
|
87
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
88
|
+
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"]
|
|
89
|
+
},] }
|
|
90
|
+
];
|
|
91
|
+
NotificationComponent.ctorParameters = function () { return [
|
|
92
|
+
{ type: platformBrowser.Title }
|
|
93
|
+
]; };
|
|
94
|
+
NotificationComponent.propDecorators = {
|
|
95
|
+
notifications: [{ type: i0.Input }],
|
|
96
|
+
deleteAll: [{ type: i0.Output }],
|
|
97
|
+
delete: [{ type: i0.Output }]
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// @dynamic
|
|
101
|
+
var KoalaLanguageHelper = /** @class */ (function () {
|
|
102
|
+
function KoalaLanguageHelper() {
|
|
103
|
+
}
|
|
104
|
+
KoalaLanguageHelper.setLanguage = function (language) {
|
|
105
|
+
this.language = language;
|
|
106
|
+
};
|
|
107
|
+
KoalaLanguageHelper.getLanguage = function () {
|
|
108
|
+
return this.language;
|
|
109
|
+
};
|
|
110
|
+
KoalaLanguageHelper.getBtnLabel = function () {
|
|
111
|
+
switch (this.language) {
|
|
112
|
+
case "enUs":
|
|
113
|
+
return 'Send';
|
|
114
|
+
default:
|
|
115
|
+
return 'Enviar';
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
KoalaLanguageHelper.getYesMessage = function () {
|
|
119
|
+
switch (this.language) {
|
|
120
|
+
case "enUs":
|
|
121
|
+
return 'Yes';
|
|
122
|
+
default:
|
|
123
|
+
return 'Sim';
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
KoalaLanguageHelper.getNoMessage = function () {
|
|
127
|
+
switch (this.language) {
|
|
128
|
+
case "enUs":
|
|
129
|
+
return 'No';
|
|
130
|
+
default:
|
|
131
|
+
return 'Não';
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
KoalaLanguageHelper.getInternalServerErrorMessage = function () {
|
|
135
|
+
switch (this.language) {
|
|
136
|
+
case "enUs":
|
|
137
|
+
return 'We had a problem with your request.<br/>Sorry for the inconvenience.<br/><br/>Please try again later.';
|
|
138
|
+
default:
|
|
139
|
+
return 'Tivemos um problema com sua requisição.<br/>Sinto muito pelo transtorno.<br/><br/>Gentileza tentar novamente mais tarde.';
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
KoalaLanguageHelper.getRequiredMessage = function (label) {
|
|
143
|
+
switch (this.language) {
|
|
144
|
+
case "enUs":
|
|
145
|
+
return label + " is required.";
|
|
146
|
+
default:
|
|
147
|
+
return "Nenhum valor informado.";
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
KoalaLanguageHelper.getInvalidMessage = function (label) {
|
|
151
|
+
switch (this.language) {
|
|
152
|
+
case "enUs":
|
|
153
|
+
return label + " is invalid.";
|
|
154
|
+
default:
|
|
155
|
+
return "Registro inv\u00E1lido.";
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
KoalaLanguageHelper.getMinMessage = function (min) {
|
|
159
|
+
switch (this.language) {
|
|
160
|
+
case "enUs":
|
|
161
|
+
return "Inform at least the value of " + min + ".";
|
|
162
|
+
default:
|
|
163
|
+
return "Informe no m\u00EDnimo o valor de " + min + ".";
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
KoalaLanguageHelper.getMaxMessage = function (max) {
|
|
167
|
+
switch (this.language) {
|
|
168
|
+
case "enUs":
|
|
169
|
+
return "Inform at most the value of " + max + ".";
|
|
170
|
+
default:
|
|
171
|
+
return "Informe no m\u00E1ximo o valor de " + max + ".";
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
KoalaLanguageHelper.getMinLengthMessage = function (minLength) {
|
|
175
|
+
switch (this.language) {
|
|
176
|
+
case "enUs":
|
|
177
|
+
return "Enter a value with at least " + minLength + " characters.";
|
|
178
|
+
default:
|
|
179
|
+
return "Informe um valor com no m\u00EDnimo " + minLength + " caracteres.";
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
KoalaLanguageHelper.getMaxLengthMessage = function (maxLength) {
|
|
183
|
+
switch (this.language) {
|
|
184
|
+
case "enUs":
|
|
185
|
+
return "Enter a value with at most " + maxLength + " characters.";
|
|
186
|
+
default:
|
|
187
|
+
return "Informe um valor com no m\u00E1ximo " + maxLength + " caracteres.";
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
KoalaLanguageHelper.getDateMinMessage = function () {
|
|
191
|
+
switch (this.language) {
|
|
192
|
+
case "enUs":
|
|
193
|
+
return "Inform at least the date of ";
|
|
194
|
+
default:
|
|
195
|
+
return "Informe no m\u00EDnimo a data de ";
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
KoalaLanguageHelper.getDateMaxMessage = function () {
|
|
199
|
+
switch (this.language) {
|
|
200
|
+
case "enUs":
|
|
201
|
+
return "Inform at most the date of ";
|
|
202
|
+
default:
|
|
203
|
+
return "Informe no m\u00E1ximo a data de ";
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
KoalaLanguageHelper.getAutocompleteMessage = function (label) {
|
|
207
|
+
switch (this.language) {
|
|
208
|
+
case "enUs":
|
|
209
|
+
return "You must select a option.";
|
|
210
|
+
default:
|
|
211
|
+
return "Voc\u00EA deve selecionar uma op\u00E7\u00E3o.";
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
return KoalaLanguageHelper;
|
|
215
|
+
}());
|
|
216
|
+
|
|
217
|
+
/*! *****************************************************************************
|
|
218
|
+
Copyright (c) Microsoft Corporation.
|
|
219
|
+
|
|
220
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
221
|
+
purpose with or without fee is hereby granted.
|
|
222
|
+
|
|
223
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
224
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
225
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
226
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
227
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
228
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
229
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
230
|
+
***************************************************************************** */
|
|
231
|
+
/* global Reflect, Promise */
|
|
232
|
+
var extendStatics = function (d, b) {
|
|
233
|
+
extendStatics = Object.setPrototypeOf ||
|
|
234
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
235
|
+
function (d, b) { for (var p in b)
|
|
236
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
237
|
+
d[p] = b[p]; };
|
|
238
|
+
return extendStatics(d, b);
|
|
239
|
+
};
|
|
240
|
+
function __extends(d, b) {
|
|
241
|
+
if (typeof b !== "function" && b !== null)
|
|
242
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
243
|
+
extendStatics(d, b);
|
|
244
|
+
function __() { this.constructor = d; }
|
|
245
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
246
|
+
}
|
|
247
|
+
var __assign = function () {
|
|
248
|
+
__assign = Object.assign || function __assign(t) {
|
|
249
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
250
|
+
s = arguments[i];
|
|
251
|
+
for (var p in s)
|
|
252
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
253
|
+
t[p] = s[p];
|
|
254
|
+
}
|
|
255
|
+
return t;
|
|
256
|
+
};
|
|
257
|
+
return __assign.apply(this, arguments);
|
|
258
|
+
};
|
|
259
|
+
function __rest(s, e) {
|
|
260
|
+
var t = {};
|
|
261
|
+
for (var p in s)
|
|
262
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
263
|
+
t[p] = s[p];
|
|
264
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
265
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
266
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
267
|
+
t[p[i]] = s[p[i]];
|
|
268
|
+
}
|
|
269
|
+
return t;
|
|
270
|
+
}
|
|
271
|
+
function __decorate(decorators, target, key, desc) {
|
|
272
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
273
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
274
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
275
|
+
else
|
|
276
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
277
|
+
if (d = decorators[i])
|
|
278
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
279
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
280
|
+
}
|
|
281
|
+
function __param(paramIndex, decorator) {
|
|
282
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
283
|
+
}
|
|
284
|
+
function __metadata(metadataKey, metadataValue) {
|
|
285
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
286
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
287
|
+
}
|
|
288
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
289
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
290
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
291
|
+
function fulfilled(value) { try {
|
|
292
|
+
step(generator.next(value));
|
|
293
|
+
}
|
|
294
|
+
catch (e) {
|
|
295
|
+
reject(e);
|
|
296
|
+
} }
|
|
297
|
+
function rejected(value) { try {
|
|
298
|
+
step(generator["throw"](value));
|
|
299
|
+
}
|
|
300
|
+
catch (e) {
|
|
301
|
+
reject(e);
|
|
302
|
+
} }
|
|
303
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
304
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
function __generator(thisArg, body) {
|
|
308
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
309
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
310
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
311
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
312
|
+
function step(op) {
|
|
313
|
+
if (f)
|
|
314
|
+
throw new TypeError("Generator is already executing.");
|
|
315
|
+
while (_)
|
|
316
|
+
try {
|
|
317
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
318
|
+
return t;
|
|
319
|
+
if (y = 0, t)
|
|
320
|
+
op = [op[0] & 2, t.value];
|
|
321
|
+
switch (op[0]) {
|
|
322
|
+
case 0:
|
|
323
|
+
case 1:
|
|
324
|
+
t = op;
|
|
325
|
+
break;
|
|
326
|
+
case 4:
|
|
327
|
+
_.label++;
|
|
328
|
+
return { value: op[1], done: false };
|
|
329
|
+
case 5:
|
|
330
|
+
_.label++;
|
|
331
|
+
y = op[1];
|
|
332
|
+
op = [0];
|
|
333
|
+
continue;
|
|
334
|
+
case 7:
|
|
335
|
+
op = _.ops.pop();
|
|
336
|
+
_.trys.pop();
|
|
337
|
+
continue;
|
|
338
|
+
default:
|
|
339
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
340
|
+
_ = 0;
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
344
|
+
_.label = op[1];
|
|
345
|
+
break;
|
|
346
|
+
}
|
|
347
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
348
|
+
_.label = t[1];
|
|
349
|
+
t = op;
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
if (t && _.label < t[2]) {
|
|
353
|
+
_.label = t[2];
|
|
354
|
+
_.ops.push(op);
|
|
355
|
+
break;
|
|
356
|
+
}
|
|
357
|
+
if (t[2])
|
|
358
|
+
_.ops.pop();
|
|
359
|
+
_.trys.pop();
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
op = body.call(thisArg, _);
|
|
363
|
+
}
|
|
364
|
+
catch (e) {
|
|
365
|
+
op = [6, e];
|
|
366
|
+
y = 0;
|
|
367
|
+
}
|
|
368
|
+
finally {
|
|
369
|
+
f = t = 0;
|
|
370
|
+
}
|
|
371
|
+
if (op[0] & 5)
|
|
372
|
+
throw op[1];
|
|
373
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
377
|
+
if (k2 === undefined)
|
|
378
|
+
k2 = k;
|
|
379
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
380
|
+
}) : (function (o, m, k, k2) {
|
|
381
|
+
if (k2 === undefined)
|
|
382
|
+
k2 = k;
|
|
383
|
+
o[k2] = m[k];
|
|
384
|
+
});
|
|
385
|
+
function __exportStar(m, o) {
|
|
386
|
+
for (var p in m)
|
|
387
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
388
|
+
__createBinding(o, m, p);
|
|
389
|
+
}
|
|
390
|
+
function __values(o) {
|
|
391
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
392
|
+
if (m)
|
|
393
|
+
return m.call(o);
|
|
394
|
+
if (o && typeof o.length === "number")
|
|
395
|
+
return {
|
|
396
|
+
next: function () {
|
|
397
|
+
if (o && i >= o.length)
|
|
398
|
+
o = void 0;
|
|
399
|
+
return { value: o && o[i++], done: !o };
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
403
|
+
}
|
|
404
|
+
function __read(o, n) {
|
|
405
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
406
|
+
if (!m)
|
|
407
|
+
return o;
|
|
408
|
+
var i = m.call(o), r, ar = [], e;
|
|
409
|
+
try {
|
|
410
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
411
|
+
ar.push(r.value);
|
|
412
|
+
}
|
|
413
|
+
catch (error) {
|
|
414
|
+
e = { error: error };
|
|
415
|
+
}
|
|
416
|
+
finally {
|
|
417
|
+
try {
|
|
418
|
+
if (r && !r.done && (m = i["return"]))
|
|
419
|
+
m.call(i);
|
|
420
|
+
}
|
|
421
|
+
finally {
|
|
422
|
+
if (e)
|
|
423
|
+
throw e.error;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
return ar;
|
|
427
|
+
}
|
|
428
|
+
/** @deprecated */
|
|
429
|
+
function __spread() {
|
|
430
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
431
|
+
ar = ar.concat(__read(arguments[i]));
|
|
432
|
+
return ar;
|
|
433
|
+
}
|
|
434
|
+
/** @deprecated */
|
|
435
|
+
function __spreadArrays() {
|
|
436
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
437
|
+
s += arguments[i].length;
|
|
438
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
439
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
440
|
+
r[k] = a[j];
|
|
441
|
+
return r;
|
|
442
|
+
}
|
|
443
|
+
function __spreadArray(to, from, pack) {
|
|
444
|
+
if (pack || arguments.length === 2)
|
|
445
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
446
|
+
if (ar || !(i in from)) {
|
|
447
|
+
if (!ar)
|
|
448
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
449
|
+
ar[i] = from[i];
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
453
|
+
}
|
|
454
|
+
function __await(v) {
|
|
455
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
456
|
+
}
|
|
457
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
458
|
+
if (!Symbol.asyncIterator)
|
|
459
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
460
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
461
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
462
|
+
function verb(n) { if (g[n])
|
|
463
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
464
|
+
function resume(n, v) { try {
|
|
465
|
+
step(g[n](v));
|
|
466
|
+
}
|
|
467
|
+
catch (e) {
|
|
468
|
+
settle(q[0][3], e);
|
|
469
|
+
} }
|
|
470
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
471
|
+
function fulfill(value) { resume("next", value); }
|
|
472
|
+
function reject(value) { resume("throw", value); }
|
|
473
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
474
|
+
resume(q[0][0], q[0][1]); }
|
|
475
|
+
}
|
|
476
|
+
function __asyncDelegator(o) {
|
|
477
|
+
var i, p;
|
|
478
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
479
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
480
|
+
}
|
|
481
|
+
function __asyncValues(o) {
|
|
482
|
+
if (!Symbol.asyncIterator)
|
|
483
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
484
|
+
var m = o[Symbol.asyncIterator], i;
|
|
485
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
486
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
487
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
488
|
+
}
|
|
489
|
+
function __makeTemplateObject(cooked, raw) {
|
|
490
|
+
if (Object.defineProperty) {
|
|
491
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
492
|
+
}
|
|
493
|
+
else {
|
|
494
|
+
cooked.raw = raw;
|
|
495
|
+
}
|
|
496
|
+
return cooked;
|
|
497
|
+
}
|
|
498
|
+
;
|
|
499
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
500
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
501
|
+
}) : function (o, v) {
|
|
502
|
+
o["default"] = v;
|
|
503
|
+
};
|
|
504
|
+
function __importStar(mod) {
|
|
505
|
+
if (mod && mod.__esModule)
|
|
506
|
+
return mod;
|
|
507
|
+
var result = {};
|
|
508
|
+
if (mod != null)
|
|
509
|
+
for (var k in mod)
|
|
510
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
511
|
+
__createBinding(result, mod, k);
|
|
512
|
+
__setModuleDefault(result, mod);
|
|
513
|
+
return result;
|
|
514
|
+
}
|
|
515
|
+
function __importDefault(mod) {
|
|
516
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
517
|
+
}
|
|
518
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
519
|
+
if (kind === "a" && !f)
|
|
520
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
521
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
522
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
523
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
524
|
+
}
|
|
525
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
526
|
+
if (kind === "m")
|
|
527
|
+
throw new TypeError("Private method is not writable");
|
|
528
|
+
if (kind === "a" && !f)
|
|
529
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
530
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
531
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
532
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// @dynamic
|
|
536
|
+
var KoalaEnvironment = /** @class */ (function () {
|
|
537
|
+
function KoalaEnvironment() {
|
|
538
|
+
}
|
|
539
|
+
return KoalaEnvironment;
|
|
540
|
+
}());
|
|
541
|
+
|
|
542
|
+
// @dynamic
|
|
543
|
+
var TokenFactory = /** @class */ (function () {
|
|
544
|
+
function TokenFactory() {
|
|
545
|
+
}
|
|
546
|
+
TokenFactory.init = function () {
|
|
547
|
+
var _a, _b;
|
|
548
|
+
if (!!localStorage.getItem((_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.storageTokenName)) {
|
|
549
|
+
TokenFactory.setToken(localStorage.getItem((_b = KoalaEnvironment.environment) === null || _b === void 0 ? void 0 : _b.storageTokenName));
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
TokenFactory.setToken = function (token) {
|
|
553
|
+
var _a;
|
|
554
|
+
localStorage.setItem((_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.storageTokenName, token);
|
|
555
|
+
this.token = token;
|
|
556
|
+
};
|
|
557
|
+
TokenFactory.getToken = function () {
|
|
558
|
+
return this.token;
|
|
559
|
+
};
|
|
560
|
+
TokenFactory.removeToken = function () {
|
|
561
|
+
var _a;
|
|
562
|
+
localStorage.removeItem((_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.storageTokenName);
|
|
563
|
+
this.token = null;
|
|
564
|
+
};
|
|
565
|
+
TokenFactory.hasToken = function () {
|
|
566
|
+
var _a;
|
|
567
|
+
return !!this.token && !!localStorage.getItem((_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.storageTokenName);
|
|
568
|
+
};
|
|
569
|
+
TokenFactory.logout = function () {
|
|
570
|
+
this.removeToken();
|
|
571
|
+
};
|
|
572
|
+
return TokenFactory;
|
|
573
|
+
}());
|
|
574
|
+
|
|
575
|
+
var KoalaTokenService = /** @class */ (function () {
|
|
576
|
+
function KoalaTokenService() {
|
|
577
|
+
this.token$ = new rxjs.BehaviorSubject(null);
|
|
578
|
+
this.verifySession();
|
|
579
|
+
}
|
|
580
|
+
KoalaTokenService.prototype.ngOnDestroy = function () {
|
|
581
|
+
if (this.intervalToken) {
|
|
582
|
+
clearInterval(this.intervalToken);
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
KoalaTokenService.prototype.setToken = function (token) {
|
|
586
|
+
if (TokenFactory.hasToken()) {
|
|
587
|
+
this.token$.next(token);
|
|
588
|
+
}
|
|
589
|
+
TokenFactory.setToken(token);
|
|
590
|
+
};
|
|
591
|
+
KoalaTokenService.prototype.getToken = function () {
|
|
592
|
+
return this.token$;
|
|
593
|
+
};
|
|
594
|
+
KoalaTokenService.prototype.getDecodedToken = function () {
|
|
595
|
+
return (TokenFactory.hasToken() ? jwt__default["default"](TokenFactory.getToken()) : null);
|
|
596
|
+
};
|
|
597
|
+
KoalaTokenService.prototype.getOAuth2Token = function () {
|
|
598
|
+
return (TokenFactory.hasToken() ? jwt__default["default"](TokenFactory.getToken()) : null);
|
|
599
|
+
};
|
|
600
|
+
KoalaTokenService.prototype.removeToken = function () {
|
|
601
|
+
TokenFactory.removeToken();
|
|
602
|
+
};
|
|
603
|
+
KoalaTokenService.prototype.verifySession = function () {
|
|
604
|
+
var _this = this;
|
|
605
|
+
TokenFactory.init();
|
|
606
|
+
this.token$.next(TokenFactory.getToken());
|
|
607
|
+
this.intervalToken = setInterval(function () {
|
|
608
|
+
if (!TokenFactory.hasToken() && _this.token$.getValue()) {
|
|
609
|
+
_this.token$.next(null);
|
|
610
|
+
}
|
|
611
|
+
else if (TokenFactory.hasToken() && !_this.token$.getValue()) {
|
|
612
|
+
_this.token$.next(TokenFactory.getToken());
|
|
613
|
+
}
|
|
614
|
+
}, 300);
|
|
615
|
+
};
|
|
616
|
+
return KoalaTokenService;
|
|
617
|
+
}());
|
|
618
|
+
KoalaTokenService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function KoalaTokenService_Factory() { return new KoalaTokenService(); }, token: KoalaTokenService, providedIn: "any" });
|
|
619
|
+
KoalaTokenService.decorators = [
|
|
620
|
+
{ type: i0.Injectable, args: [{ providedIn: "any" },] }
|
|
621
|
+
];
|
|
622
|
+
KoalaTokenService.ctorParameters = function () { return []; };
|
|
623
|
+
|
|
624
|
+
var KOALA_LOADER_SUBJECT = new rxjs.BehaviorSubject({
|
|
625
|
+
typeLoader: 'indeterminate',
|
|
626
|
+
progress: 0,
|
|
627
|
+
show: false
|
|
628
|
+
});
|
|
629
|
+
var KoalaLoaderService = /** @class */ (function () {
|
|
630
|
+
function KoalaLoaderService() {
|
|
631
|
+
}
|
|
632
|
+
KoalaLoaderService.prototype.getLoaderSubject = function () {
|
|
633
|
+
return KOALA_LOADER_SUBJECT;
|
|
634
|
+
};
|
|
635
|
+
KoalaLoaderService.prototype.create = function (loaderConfig) {
|
|
636
|
+
KOALA_LOADER_SUBJECT.next({
|
|
637
|
+
show: true,
|
|
638
|
+
progress: loaderConfig.progress ? loaderConfig.progress : 0,
|
|
639
|
+
typeLoader: loaderConfig.typeLoader ? loaderConfig.typeLoader : 'indeterminate'
|
|
640
|
+
});
|
|
641
|
+
};
|
|
642
|
+
KoalaLoaderService.prototype.dismiss = function () {
|
|
643
|
+
KOALA_LOADER_SUBJECT.next({
|
|
644
|
+
show: false,
|
|
645
|
+
progress: 0,
|
|
646
|
+
typeLoader: 'indeterminate'
|
|
647
|
+
});
|
|
648
|
+
};
|
|
649
|
+
return KoalaLoaderService;
|
|
650
|
+
}());
|
|
651
|
+
KoalaLoaderService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function KoalaLoaderService_Factory() { return new KoalaLoaderService(); }, token: KoalaLoaderService, providedIn: "any" });
|
|
652
|
+
KoalaLoaderService.decorators = [
|
|
653
|
+
{ type: i0.Injectable, args: [{ providedIn: "any" },] }
|
|
654
|
+
];
|
|
655
|
+
|
|
656
|
+
// @dynamic
|
|
657
|
+
var KoalaOauthConfig = /** @class */ (function () {
|
|
658
|
+
function KoalaOauthConfig() {
|
|
659
|
+
}
|
|
660
|
+
KoalaOauthConfig.getConfig = function () {
|
|
661
|
+
var _a;
|
|
662
|
+
return localStorage.getItem((_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.storageOAuthTypeName);
|
|
663
|
+
};
|
|
664
|
+
KoalaOauthConfig.hasConfig = function () {
|
|
665
|
+
return !!this.getConfig();
|
|
666
|
+
};
|
|
667
|
+
KoalaOauthConfig.setConfig = function (type) {
|
|
668
|
+
var _a;
|
|
669
|
+
localStorage.setItem((_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.storageOAuthTypeName, type);
|
|
670
|
+
this.config.next(this.getOAuthConfig(type));
|
|
671
|
+
};
|
|
672
|
+
KoalaOauthConfig.getOAuthConfig = function (type) {
|
|
673
|
+
var _a, _b, _c;
|
|
674
|
+
var environment = (_c = (_b = (_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.oauthConfig) === null || _b === void 0 ? void 0 : _b.find(function (config) { return config.name === type; })) !== null && _c !== void 0 ? _c : null;
|
|
675
|
+
return environment !== null && environment !== void 0 ? environment : {
|
|
676
|
+
customQueryParams: {
|
|
677
|
+
client_secret: null
|
|
678
|
+
},
|
|
679
|
+
clientId: null,
|
|
680
|
+
scope: null,
|
|
681
|
+
domain: null,
|
|
682
|
+
strictDiscoveryDocumentValidation: false,
|
|
683
|
+
indexLoginName: 'name'
|
|
684
|
+
};
|
|
685
|
+
};
|
|
686
|
+
return KoalaOauthConfig;
|
|
687
|
+
}());
|
|
688
|
+
KoalaOauthConfig.config = new rxjs.BehaviorSubject(KoalaOauthConfig.getOAuthConfig(KoalaOauthConfig.getConfig()));
|
|
689
|
+
|
|
690
|
+
var STATE_STORAGE_NAME = 'koala_openid_state';
|
|
691
|
+
var KoalaOAuth2Service = /** @class */ (function () {
|
|
692
|
+
function KoalaOAuth2Service(http, router, tokenService) {
|
|
693
|
+
this.http = http;
|
|
694
|
+
this.router = router;
|
|
695
|
+
this.tokenService = tokenService;
|
|
696
|
+
this.events = new rxjs.BehaviorSubject(null);
|
|
697
|
+
this.token = {};
|
|
698
|
+
this.generateState();
|
|
699
|
+
}
|
|
700
|
+
KoalaOAuth2Service.prototype.ngOnDestroy = function () {
|
|
701
|
+
if (this.eventSubscription) {
|
|
702
|
+
this.eventSubscription.unsubscribe();
|
|
703
|
+
}
|
|
704
|
+
if (this.refreshTokenInterval) {
|
|
705
|
+
clearInterval(this.refreshTokenInterval);
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
KoalaOAuth2Service.prototype.hasOpenIdConfig = function () {
|
|
709
|
+
return !!this.openIdOptions;
|
|
710
|
+
};
|
|
711
|
+
KoalaOAuth2Service.prototype.configure = function (options) {
|
|
712
|
+
this.config = options;
|
|
713
|
+
};
|
|
714
|
+
KoalaOAuth2Service.prototype.loadDiscoveryDocumentAndTryLogin = function () {
|
|
715
|
+
var _this = this;
|
|
716
|
+
if (this.eventSubscription) {
|
|
717
|
+
this.eventSubscription.unsubscribe();
|
|
718
|
+
}
|
|
719
|
+
this.eventSubscription = this.events.subscribe(function (event) {
|
|
720
|
+
if (event === 'authenticate') {
|
|
721
|
+
_this.generateState();
|
|
722
|
+
localStorage.setItem(STATE_STORAGE_NAME, _this.state);
|
|
723
|
+
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;
|
|
724
|
+
}
|
|
725
|
+
else if (event === 'getToken') {
|
|
726
|
+
var urlParams = new URLSearchParams(window.location.search);
|
|
727
|
+
var state = urlParams.get('state');
|
|
728
|
+
if (state === _this.state) {
|
|
729
|
+
var code = urlParams.get('code');
|
|
730
|
+
_this.getToken(code);
|
|
731
|
+
}
|
|
732
|
+
else {
|
|
733
|
+
_this.logout();
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
else if (event === 'getClaims' || (event === 'refreshToken' && !_this.claims)) {
|
|
737
|
+
_this.getClaims();
|
|
738
|
+
}
|
|
739
|
+
});
|
|
740
|
+
return new Promise(function (resolve, reject) {
|
|
741
|
+
_this.http.get(_this.config.issuer + "/.well-known/openid-configuration").subscribe(function (options) {
|
|
742
|
+
_this.openIdOptions = options;
|
|
743
|
+
if (window.location.href.indexOf("state=" + _this.state) >= 0) {
|
|
744
|
+
_this.events.next('getToken');
|
|
745
|
+
}
|
|
746
|
+
else if (!_this.tokenService.getOAuth2Token()) {
|
|
747
|
+
_this.events.next('loadedConfig');
|
|
748
|
+
}
|
|
749
|
+
resolve(true);
|
|
750
|
+
}, function (e) {
|
|
751
|
+
console.error(e);
|
|
752
|
+
_this.events.next('errorLoadConfig');
|
|
753
|
+
reject(e);
|
|
754
|
+
});
|
|
755
|
+
});
|
|
756
|
+
};
|
|
757
|
+
KoalaOAuth2Service.prototype.initLoginFlow = function (name) {
|
|
758
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
759
|
+
return __generator(this, function (_c) {
|
|
760
|
+
switch (_c.label) {
|
|
761
|
+
case 0:
|
|
762
|
+
if (!name) return [3 /*break*/, 2];
|
|
763
|
+
KoalaOauthConfig.setConfig(name);
|
|
764
|
+
return [4 /*yield*/, KlDelay.KlDelay.waitFor(1000)];
|
|
765
|
+
case 1:
|
|
766
|
+
_c.sent();
|
|
767
|
+
_c.label = 2;
|
|
768
|
+
case 2:
|
|
769
|
+
this.events.next('authenticate');
|
|
770
|
+
return [2 /*return*/];
|
|
771
|
+
}
|
|
772
|
+
});
|
|
773
|
+
});
|
|
774
|
+
};
|
|
775
|
+
KoalaOAuth2Service.prototype.getIdentityClaims = function () {
|
|
776
|
+
return this.claims;
|
|
777
|
+
};
|
|
778
|
+
KoalaOAuth2Service.prototype.getAccessToken = function () {
|
|
779
|
+
return this.token.access_token;
|
|
780
|
+
};
|
|
781
|
+
KoalaOAuth2Service.prototype.getIdToken = function () {
|
|
782
|
+
return this.token.id_token;
|
|
783
|
+
};
|
|
784
|
+
KoalaOAuth2Service.prototype.getRefreshToken = function () {
|
|
785
|
+
return this.token.refresh_token;
|
|
786
|
+
};
|
|
787
|
+
KoalaOAuth2Service.prototype.getAccessTokenExpiration = function () {
|
|
788
|
+
var expires_in = new Date();
|
|
789
|
+
expires_in.setSeconds(this.token.expires_in);
|
|
790
|
+
return expires_in.toString();
|
|
791
|
+
};
|
|
792
|
+
KoalaOAuth2Service.prototype.getCode = function () {
|
|
793
|
+
return this.code;
|
|
794
|
+
};
|
|
795
|
+
KoalaOAuth2Service.prototype.logout = function () {
|
|
796
|
+
var _this = this;
|
|
797
|
+
var logoutInterval = setInterval(function () {
|
|
798
|
+
if (_this.hasOpenIdConfig()) {
|
|
799
|
+
if (_this.openIdOptions.end_session_endpoint) {
|
|
800
|
+
_this.claims = null;
|
|
801
|
+
_this.token = null;
|
|
802
|
+
var iframeLogout = document.createElement('iframe');
|
|
803
|
+
iframeLogout.style.display = 'none';
|
|
804
|
+
iframeLogout.src = _this.openIdOptions.end_session_endpoint;
|
|
805
|
+
document.querySelector('body').appendChild(iframeLogout);
|
|
806
|
+
}
|
|
807
|
+
_this.events.next('logout');
|
|
808
|
+
clearInterval(logoutInterval);
|
|
809
|
+
}
|
|
810
|
+
}, 300);
|
|
811
|
+
};
|
|
812
|
+
KoalaOAuth2Service.prototype.initRefreshTokenInterval = function (code, refreshToken) {
|
|
813
|
+
var _this = this;
|
|
814
|
+
if (!this.refreshTokenInterval) {
|
|
815
|
+
this.refreshTokenInterval = setInterval(function () {
|
|
816
|
+
var refreshTokenDate = new Date();
|
|
817
|
+
refreshTokenDate.setMinutes(refreshTokenDate.getMinutes() + 1);
|
|
818
|
+
var token = _this.tokenService.getOAuth2Token();
|
|
819
|
+
if (token) {
|
|
820
|
+
var expires_in = token.expired;
|
|
821
|
+
if (expires_in) {
|
|
822
|
+
if (new Date(expires_in) <= refreshTokenDate) {
|
|
823
|
+
_this.getToken(code, refreshToken);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
}, 1000);
|
|
828
|
+
}
|
|
829
|
+
};
|
|
830
|
+
KoalaOAuth2Service.prototype.getToken = function (code, refreshToken) {
|
|
831
|
+
var _this = this;
|
|
832
|
+
var _a, _b;
|
|
833
|
+
if (refreshToken) {
|
|
834
|
+
clearInterval(this.refreshTokenInterval);
|
|
835
|
+
this.refreshTokenInterval = null;
|
|
836
|
+
}
|
|
837
|
+
var formData = new URLSearchParams();
|
|
838
|
+
var data = utils.koala({
|
|
839
|
+
grant_type: (refreshToken ? 'refresh_token' : 'authorization_code'),
|
|
840
|
+
code: code,
|
|
841
|
+
redirect_uri: this.config.redirectUri,
|
|
842
|
+
client_id: this.config.clientId
|
|
843
|
+
}).object().merge((_a = this.config.customQueryParams) !== null && _a !== void 0 ? _a : {}).getValue();
|
|
844
|
+
if (refreshToken) {
|
|
845
|
+
data = utils.koala(data).object().merge({ refresh_token: refreshToken }).getValue();
|
|
846
|
+
}
|
|
847
|
+
if (!this.code) {
|
|
848
|
+
this.code = code;
|
|
849
|
+
}
|
|
850
|
+
Object.keys(data).forEach(function (indexName) {
|
|
851
|
+
formData.append(indexName, data[indexName]);
|
|
852
|
+
});
|
|
853
|
+
this.http.post((_b = this.config.endpointToken) !== null && _b !== void 0 ? _b : this.openIdOptions.token_endpoint, formData.toString(), {
|
|
854
|
+
headers: {
|
|
855
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
856
|
+
}
|
|
857
|
+
}).subscribe(function (token) {
|
|
858
|
+
_this.token = token;
|
|
859
|
+
_this.events.next((refreshToken ? 'refreshToken' : 'getClaims'));
|
|
860
|
+
}, function () { return _this.events.next('getTokenError'); });
|
|
861
|
+
};
|
|
862
|
+
KoalaOAuth2Service.prototype.getClaims = function () {
|
|
863
|
+
var _this = this;
|
|
864
|
+
var _a;
|
|
865
|
+
this.http.get((_a = this.config.endpointClaims) !== null && _a !== void 0 ? _a : this.openIdOptions.userinfo_endpoint, {
|
|
866
|
+
headers: {
|
|
867
|
+
Authorization: "Bearer " + this.getAccessToken()
|
|
868
|
+
}
|
|
869
|
+
}).subscribe(function (userInfo) {
|
|
870
|
+
_this.claims = userInfo;
|
|
871
|
+
_this.state = null;
|
|
872
|
+
localStorage.removeItem(STATE_STORAGE_NAME);
|
|
873
|
+
_this.events.next(_this.events.getValue() === 'refreshToken' ? 'refreshToken' : 'userAuthenticated');
|
|
874
|
+
}, function () { return _this.events.next('loadedConfig'); });
|
|
875
|
+
};
|
|
876
|
+
KoalaOAuth2Service.prototype.generateState = function () {
|
|
877
|
+
this.state = localStorage.getItem(STATE_STORAGE_NAME) ?
|
|
878
|
+
localStorage.getItem(STATE_STORAGE_NAME) :
|
|
879
|
+
utils.koala('').string().random(30, true, true, true).getValue();
|
|
880
|
+
};
|
|
881
|
+
return KoalaOAuth2Service;
|
|
882
|
+
}());
|
|
883
|
+
KoalaOAuth2Service.decorators = [
|
|
884
|
+
{ type: i0.Injectable }
|
|
885
|
+
];
|
|
886
|
+
KoalaOAuth2Service.ctorParameters = function () { return [
|
|
887
|
+
{ type: i1.HttpClient },
|
|
888
|
+
{ type: router.Router },
|
|
889
|
+
{ type: KoalaTokenService }
|
|
890
|
+
]; };
|
|
891
|
+
|
|
892
|
+
var PageComponent = /** @class */ (function () {
|
|
893
|
+
function PageComponent(tokenService, router, loaderService, menuService, oauth2Service, deviceService) {
|
|
894
|
+
this.tokenService = tokenService;
|
|
895
|
+
this.router = router;
|
|
896
|
+
this.loaderService = loaderService;
|
|
897
|
+
this.menuService = menuService;
|
|
898
|
+
this.oauth2Service = oauth2Service;
|
|
899
|
+
this.deviceService = deviceService;
|
|
900
|
+
this.showMenu = true;
|
|
901
|
+
this.startMenuOpened = true;
|
|
902
|
+
this.userMenuOptions = [];
|
|
903
|
+
this.language = 'ptBr';
|
|
904
|
+
this.validatingScope = new i0.EventEmitter(false);
|
|
905
|
+
this.logoutEmitter = new i0.EventEmitter(false);
|
|
906
|
+
this.deleteAllNotifications = new i0.EventEmitter(false);
|
|
907
|
+
this.deleteNotification = new i0.EventEmitter(null);
|
|
908
|
+
this.username$ = new rxjs.BehaviorSubject('');
|
|
909
|
+
this.firstUserLetter$ = new rxjs.BehaviorSubject('');
|
|
910
|
+
this.logged$ = new rxjs.BehaviorSubject(false);
|
|
911
|
+
this.validationScope$ = new rxjs.BehaviorSubject(false);
|
|
912
|
+
this.isMobile = this.deviceService.isMobile();
|
|
913
|
+
this.defaultPalletColors = {
|
|
914
|
+
scrollbarColor: '#1976D2',
|
|
915
|
+
scrollbarColorHover: '#1565C0',
|
|
916
|
+
userPresentationBackground: '#f1f1f1',
|
|
917
|
+
userPresentationUserBackground: '#1976D2',
|
|
918
|
+
userPresentationUserFontColor: '#fff',
|
|
919
|
+
firstColor: '#fff',
|
|
920
|
+
secondColor: '#F1F1F1',
|
|
921
|
+
bodyBackground: '#eeeeee',
|
|
922
|
+
checkboxBackground: '#1976d2',
|
|
923
|
+
checkboxColor: '#ffffff',
|
|
924
|
+
fontColor: '#1976D2',
|
|
925
|
+
fontHoverColor: '#1976D2',
|
|
926
|
+
fontActiveColor: '#1565C0',
|
|
927
|
+
menuTitleBackground: 'rgba(0,0,0,.1)',
|
|
928
|
+
menuTitleColor: 'rgba(0,0,0,.3)',
|
|
929
|
+
menuBackground: '#fafafa',
|
|
930
|
+
menuOptionsBackground: '#eaeaea',
|
|
931
|
+
menuOptionsColor: '#a5a5a5',
|
|
932
|
+
menuOptionsColorHover: '#1976D2',
|
|
933
|
+
menuOptionsColorActive: '#1565c0',
|
|
934
|
+
toolbarBackground: '#ffffff',
|
|
935
|
+
toolbarColor: '#1976d2',
|
|
936
|
+
listBackground: '#fff',
|
|
937
|
+
listContentBackground: '#fff',
|
|
938
|
+
listTitleItemColor: '#838383',
|
|
939
|
+
listItemColor: '#3e3e3e',
|
|
940
|
+
listItemBackgroudHover: '#F1F1F1',
|
|
941
|
+
listItemBackgroundActive: '#EEE',
|
|
942
|
+
shadowColorTableList: 'rgba(25, 118, 210, .4)'
|
|
943
|
+
};
|
|
944
|
+
this.loaderSubject = loaderService.getLoaderSubject();
|
|
945
|
+
}
|
|
946
|
+
PageComponent.prototype.ngOnInit = function () {
|
|
947
|
+
var _this = this;
|
|
948
|
+
var _a;
|
|
949
|
+
KoalaLanguageHelper.setLanguage(this.language);
|
|
950
|
+
this.initOAuth2();
|
|
951
|
+
if (this.openPages) {
|
|
952
|
+
if (this.openPages.indexOf('/') < 0) {
|
|
953
|
+
this.openPages.push('/');
|
|
954
|
+
}
|
|
955
|
+
if (this.openPages.indexOf('/login') < 0) {
|
|
956
|
+
this.openPages.push('/login');
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
else {
|
|
960
|
+
this.openPages = [
|
|
961
|
+
'/',
|
|
962
|
+
'/login'
|
|
963
|
+
];
|
|
964
|
+
}
|
|
965
|
+
(_a = this.tokenService.getToken()) === null || _a === void 0 ? void 0 : _a.subscribe(function (token) {
|
|
966
|
+
var _a, _b;
|
|
967
|
+
_this.logged$.next(!!token);
|
|
968
|
+
if (_this.logged$.getValue()) {
|
|
969
|
+
var decodedToken = _this.tokenService.getDecodedToken();
|
|
970
|
+
_this.username$.next(decodedToken.login);
|
|
971
|
+
_this.firstUserLetter$.next(decodedToken.login.charAt(0).toUpperCase());
|
|
972
|
+
if (!_this.isMobile) {
|
|
973
|
+
_this.menuService.open();
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
if (_this.logged$.getValue() && ((_a = _this.openPages) === null || _a === void 0 ? void 0 : _a.indexOf(_this.currentUrl)) >= 0 && _this.defaultPage) {
|
|
977
|
+
_this.router.navigate([_this.defaultPage]).then();
|
|
978
|
+
}
|
|
979
|
+
else if (!_this.logged$.getValue() && _this.currentUrl && ((_b = _this.openPages) === null || _b === void 0 ? void 0 : _b.indexOf(_this.currentUrl)) < 0) {
|
|
980
|
+
_this.router.navigate(['login']).then();
|
|
981
|
+
return false;
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
this.router.events.subscribe(function (event) {
|
|
985
|
+
var _a, _b;
|
|
986
|
+
switch (true) {
|
|
987
|
+
case event instanceof router.NavigationStart: {
|
|
988
|
+
_this.loaderService.create({ typeLoader: 'indeterminate' });
|
|
989
|
+
break;
|
|
990
|
+
}
|
|
991
|
+
case event instanceof router.NavigationEnd:
|
|
992
|
+
case event instanceof router.NavigationCancel:
|
|
993
|
+
case event instanceof router.NavigationError: {
|
|
994
|
+
_this.loaderService.dismiss();
|
|
995
|
+
if (event instanceof router.NavigationEnd) {
|
|
996
|
+
if (_this.isMobile) {
|
|
997
|
+
_this.menuService.close();
|
|
998
|
+
}
|
|
999
|
+
_this.currentUrl = event.url.split('?')[0];
|
|
1000
|
+
if (event.url.indexOf('/login?clientId=') < 0) {
|
|
1001
|
+
if (_this.logged$.getValue() && _this.defaultPage && ((_a = _this.openPages) === null || _a === void 0 ? void 0 : _a.indexOf(_this.currentUrl)) >= 0) {
|
|
1002
|
+
_this.router.navigate([_this.defaultPage]).then();
|
|
1003
|
+
return false;
|
|
1004
|
+
}
|
|
1005
|
+
else if (!_this.logged$.getValue() && ((_b = _this.openPages) === null || _b === void 0 ? void 0 : _b.indexOf(_this.currentUrl)) < 0) {
|
|
1006
|
+
_this.router.navigate(['login']).then();
|
|
1007
|
+
return false;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
break;
|
|
1012
|
+
}
|
|
1013
|
+
default: {
|
|
1014
|
+
break;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
});
|
|
1018
|
+
if (this.palletColors) {
|
|
1019
|
+
Object.keys(this.defaultPalletColors).forEach(function (indexName) {
|
|
1020
|
+
if (!_this.palletColors.hasOwnProperty(indexName) ||
|
|
1021
|
+
!_this.palletColors[indexName]) {
|
|
1022
|
+
_this.palletColors[indexName] = _this.defaultPalletColors[indexName];
|
|
1023
|
+
}
|
|
1024
|
+
});
|
|
1025
|
+
}
|
|
1026
|
+
else {
|
|
1027
|
+
this.palletColors = this.defaultPalletColors;
|
|
1028
|
+
}
|
|
1029
|
+
this.defineColor();
|
|
1030
|
+
if (this.showMenu) {
|
|
1031
|
+
menu.menuStateSubject.subscribe(function (state) { return __awaiter(_this, void 0, void 0, function () {
|
|
1032
|
+
return __generator(this, function (_c) {
|
|
1033
|
+
switch (_c.label) {
|
|
1034
|
+
case 0:
|
|
1035
|
+
if (!this.menu) return [3 /*break*/, 5];
|
|
1036
|
+
if (!(state === 'close')) return [3 /*break*/, 3];
|
|
1037
|
+
if (!this.menu.opened) return [3 /*break*/, 2];
|
|
1038
|
+
return [4 /*yield*/, this.menu.close()];
|
|
1039
|
+
case 1:
|
|
1040
|
+
_c.sent();
|
|
1041
|
+
_c.label = 2;
|
|
1042
|
+
case 2: return [3 /*break*/, 5];
|
|
1043
|
+
case 3:
|
|
1044
|
+
if (!(state === 'open')) return [3 /*break*/, 5];
|
|
1045
|
+
if (!!this.menu.opened) return [3 /*break*/, 5];
|
|
1046
|
+
return [4 /*yield*/, this.menu.open()];
|
|
1047
|
+
case 4:
|
|
1048
|
+
_c.sent();
|
|
1049
|
+
_c.label = 5;
|
|
1050
|
+
case 5: return [2 /*return*/];
|
|
1051
|
+
}
|
|
1052
|
+
});
|
|
1053
|
+
}); });
|
|
1054
|
+
if (this.startMenuOpened && this.logged$.getValue()) {
|
|
1055
|
+
if (!this.isMobile) {
|
|
1056
|
+
this.menuService.open();
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
else {
|
|
1060
|
+
this.menuService.close();
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
else {
|
|
1064
|
+
this.menuService.close();
|
|
1065
|
+
}
|
|
1066
|
+
this.validationScope$.subscribe(function (scope) { return _this.validatingScope.emit(scope); });
|
|
1067
|
+
};
|
|
1068
|
+
PageComponent.prototype.toogleMenu = function () {
|
|
1069
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1070
|
+
return __generator(this, function (_c) {
|
|
1071
|
+
switch (_c.label) {
|
|
1072
|
+
case 0:
|
|
1073
|
+
this.menuService.clearConfig();
|
|
1074
|
+
if (!this.menu) return [3 /*break*/, 2];
|
|
1075
|
+
return [4 /*yield*/, this.menu.toggle()];
|
|
1076
|
+
case 1:
|
|
1077
|
+
_c.sent();
|
|
1078
|
+
_c.label = 2;
|
|
1079
|
+
case 2: return [2 /*return*/];
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
});
|
|
1083
|
+
};
|
|
1084
|
+
PageComponent.prototype.logout = function () {
|
|
1085
|
+
var _a;
|
|
1086
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1087
|
+
return __generator(this, function (_c) {
|
|
1088
|
+
if ((_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.oauthConfig) {
|
|
1089
|
+
this.oauth2Service.logout();
|
|
1090
|
+
}
|
|
1091
|
+
this.menuService.close();
|
|
1092
|
+
this.tokenService.removeToken();
|
|
1093
|
+
this.tokenService.getToken().next(null);
|
|
1094
|
+
this.logoutEmitter.emit(true);
|
|
1095
|
+
return [2 /*return*/];
|
|
1096
|
+
});
|
|
1097
|
+
});
|
|
1098
|
+
};
|
|
1099
|
+
PageComponent.prototype.defineColor = function () {
|
|
1100
|
+
var css = "\n*::-webkit-scrollbar-thumb {background: " + this.palletColors.scrollbarColor + ";width: 2px;}\n*::-webkit-scrollbar-thumb:hover {background: " + this.palletColors.scrollbarColorHover + ";}\ninput:-webkit-autofill, input:-webkit-autofill:focus, input:-webkit-autofill:hover {color: " + this.palletColors.fontColor + "!important;}\n.menu-container,\nbody {background: " + this.palletColors.bodyBackground + "!important;}\ninput:-webkit-autofill, input:-webkit-autofill:focus, input:-webkit-autofill:hover {-webkit-box-shadow: 0 0 0 1000px " + this.palletColors.firstColor + " inset !important;}\n.mat-button-disabled,\ninput::placeholder,\n.mat-form-field-appearance-outline .mat-form-field-outline {color: " + this.palletColors.fontColor + "!important;opacity: .6;}\n.mat-hint,\n.mat-expansion-indicator::after,\n.more-items-content .items .titleForm,\nfieldset legend,\n.mat-paginator-container,\n.mat-form-field-flex mat-icon {color: " + this.palletColors.fontColor + "!important;}\n.mat-paginator-container,\n.mat-card,\n.mat-expansion-panel,\n.mat-select-panel,\n.mat-autocomplete-panel,\n.mat-menu-panel {background: " + this.palletColors.firstColor + "}\n.mat-selected {background-color: rgba(0,0,0,.3)!important;}\n.question p,\n.alert-message,\n.mat-action-row,\n.mat-option,\n.mat-menu-item,\n.mat-menu-item mat-icon {color: " + this.palletColors.fontColor + "!important}\n.mat-select-value,\n.mat-select-arrow,\n.mat-form-field input,\n.mat-form-field textarea,\n.mat-form-field-appearance-outline:not(.mat-form-field-invalid) .mat-form-field-outline-thick,\n.mat-form-field label,\n.select-multiple-native select {color: " + this.palletColors.fontColor + "!important;caret-color: " + this.palletColors.fontColor + "!important;}\n.mat-form-field-underline,\n.mat-form-field-appearance-fill .mat-form-field-underline::before,\n.mat-form-field-ripple {background: " + this.palletColors.fontColor + "!important;}\n.mat-checkbox-checked.mat-accent .mat-checkbox-background, .mat-checkbox-indeterminate.mat-accent .mat-checkbox-background,\n.mat-checkbox:not(.mat-checkbox-disabled).mat-accent .mat-checkbox-ripple .mat-ripple-element {background-color: " + this.palletColors.checkboxBackground + " !important;}\n.mat-checkbox-checkmark-path {stroke: " + this.palletColors.checkboxColor + " !important;}\n.mat-checkbox-checkmark {fill: " + this.palletColors.checkboxColor + " !important;}\n.mat-checkbox-mixedmark {background-color: " + this.palletColors.checkboxColor + " !important;}\n.mat-checkbox-frame {border-color: " + this.palletColors.checkboxOutlineColor + "!important;}\n.mat-checkbox-label {color: " + this.palletColors.fontColor + "!important;}\n.mat-radio-outer-circle {border-color: " + this.palletColors.checkboxBackground + "!important;}\n.mat-radio-ripple .mat-ripple-element, .mat-radio-inner-circle {background-color: " + this.palletColors.checkboxBackground + " !important;}\n.home-list-cards .list .mat-list-item-content .mat-icon {color: " + this.palletColors.fontColor + ";}\n.home-list-cards .list button .mat-badge-content {background: " + this.palletColors.fontColor + ";}\n.koala-dialog .mat-dialog-title h2 {color: " + this.palletColors.fontColor + ";}\n.koala-dialog .mat-dialog-title mat-icon {color: " + this.palletColors.fontColor + "!important;}\n.koala-dialog .mat-dialog-container {background: " + this.palletColors.firstColor + "}\n.list-filter mat-icon {color: " + this.palletColors.filterIconColor + "!important;}\nkoala-page .menu-options {background: " + this.palletColors.menuBackground + ";}\nkoala-page .toolbar {background: " + this.palletColors.toolbarBackground + ";}\nkoala-page .toolbar .btn-collapse-menu,\nkoala-page .btn-toolbar span{color: " + this.palletColors.toolbarColor + ";}\nkoala-page .btn-toolbar span.icon-user,\n.user-presentation span.icon-user {background: " + this.palletColors.userPresentationUserBackground + ";color: " + this.palletColors.userPresentationUserFontColor + ";}\n.user-presentation {background: " + this.palletColors.userPresentationBackground + ";}\n.user-presentation span.username {color: " + this.palletColors.toolbarColor + ";}\n.mat-drawer.mat-drawer-push {background-color: " + this.palletColors.bodyBackground + ";}\nkoala-menu .title {background: " + this.palletColors.menuTitleBackground + ";color: " + this.palletColors.menuTitleColor + ";}\nkoala-menu ul li,\nkoala-menu ul li a {color: " + this.palletColors.menuOptionsColor + ";}\nkoala-menu ul li:hover,\nkoala-menu ul li:hover a {color: " + this.palletColors.menuOptionsColorHover + " !important;}\nkoala-menu ul li.active,\nkoala-menu ul li.expanded {color: " + this.palletColors.menuOptionsColorActive + " !important;border-left: 4px solid " + this.palletColors.menuOptionsColorActive + " !important;background: " + this.palletColors.menuOptionsBackground + " !important;}\nkoala-menu ul li.active a,\nkoala-menu ul li.expanded a {color: " + this.palletColors.menuOptionsColorActive + " !important;background: " + this.palletColors.menuOptionsBackground + " !important;}\nkoala-menu ul li li:hover,\nkoala-menu ul li li:hover a {color: " + this.palletColors.menuOptionsColorHover + " !important;}\nkoala-menu ul li li.active,\nkoala-menu ul li li.active a {color: " + this.palletColors.menuOptionsColorActive + " !important;}\nkoala-menu ul li koala-icon svg *,\nkoala-menu ul li a koala-icon svg * {fill: " + this.palletColors.menuOptionsColor + ";}\nkoala-menu ul li:hover koala-icon svg *,\nkoala-menu ul li:hover a koala-icon svg * {fill: " + this.palletColors.menuOptionsColorHover + " !important;}\nkoala-menu ul li.active koala-icon *,\nkoala-menu ul li.expanded koala-icon * {fill: " + this.palletColors.menuOptionsColorActive + " !important;}\nkoala-menu ul li li:hover koala-icon *,\nkoala-menu ul li li:hover a koala-icon * {fill: " + this.palletColors.menuOptionsColorHover + " !important;}\nkoala-menu ul li li.active koala-icon *,\nkoala-menu ul li li.active a koala-icon * {fill: " + this.palletColors.menuOptionsColorActive + "!important;}\n.notifications-content .title {color: " + this.palletColors.notificationTitleColor + "!important;}\n.notifications-content .empty,\n.notifications-content .titleList {color: " + this.palletColors.notificationContentTitleColor + "!important;}\n.notifications-content .iconList {color: " + this.palletColors.notificationContentIconColor + "!important;}\n.notifications-content .textList {color: " + this.palletColors.notificationTitleColor + "!important;}\n.list-container {box-shadow: 0 1px 3px " + this.palletColors.shadowColorTableList + ";}\n.list-container .list table.table-hover tr:hover {background: " + this.palletColors.listItemBackgroudHover + ";}\n.list-container .list table.table-hover tr:active {background: " + this.palletColors.listItemBackgroundActive + ";}\n.list-container .list-filter .advanced {background: " + this.palletColors.firstColor + ";}\n.list-container nav.menu-list {background: " + this.palletColors.firstColor + ";color: rgba(25, 118, 210, .3);}\n.content {background: " + this.palletColors.listContentBackground + ";}\n.mat-tab-group .mat-tab-label {color: " + this.palletColors.fontColor + ";}\n.mat-tab-group .mat-ink-bar {background-color: " + this.palletColors.fontColor + "!important;}\n.mat-table {background: " + this.palletColors.listBackground + ";color: " + this.palletColors.fontColor + ";}\n.mat-table th {color: " + this.palletColors.listTitleItemColor + "!important;}\n.mat-sort-header-arrow {color: " + this.palletColors.listItemColor + "!important;}\n.mat-table td {color: " + this.palletColors.listItemColor + "!important;}";
|
|
1101
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
1102
|
+
var style = document.createElement('style');
|
|
1103
|
+
head.appendChild(style);
|
|
1104
|
+
style.appendChild(document.createTextNode(css));
|
|
1105
|
+
};
|
|
1106
|
+
PageComponent.prototype.initOAuth2 = function () {
|
|
1107
|
+
var _this = this;
|
|
1108
|
+
KoalaOauthConfig.config.subscribe(function (config) { return _this.startConfig(config); });
|
|
1109
|
+
if (KoalaOauthConfig.hasConfig()) {
|
|
1110
|
+
KoalaOauthConfig.setConfig(KoalaOauthConfig.getConfig());
|
|
1111
|
+
}
|
|
1112
|
+
};
|
|
1113
|
+
PageComponent.prototype.startConfig = function (config) {
|
|
1114
|
+
var _this = this;
|
|
1115
|
+
var _a, _b;
|
|
1116
|
+
if (config.clientId) {
|
|
1117
|
+
this.oauth2Service.configure({
|
|
1118
|
+
redirectUri: window.location.origin,
|
|
1119
|
+
redirectUriAfterAuth: this.defaultPage,
|
|
1120
|
+
responseType: 'code',
|
|
1121
|
+
clientId: config.clientId,
|
|
1122
|
+
scope: config.scope,
|
|
1123
|
+
issuer: config.domain,
|
|
1124
|
+
customQueryParams: config.customQueryParams,
|
|
1125
|
+
endpointToken: (_a = config.endpointToken) !== null && _a !== void 0 ? _a : null,
|
|
1126
|
+
endpointClaims: (_b = config.endpointClaims) !== null && _b !== void 0 ? _b : null
|
|
1127
|
+
});
|
|
1128
|
+
this.oauth2Service.loadDiscoveryDocumentAndTryLogin().then();
|
|
1129
|
+
if (this.oauthEventsSubscription) {
|
|
1130
|
+
this.oauthEventsSubscription.unsubscribe();
|
|
1131
|
+
}
|
|
1132
|
+
this.oauthEventsSubscription = this.oauth2Service.events.subscribe(function (event) {
|
|
1133
|
+
var _a;
|
|
1134
|
+
if (event === 'userAuthenticated' || event === 'refreshToken') {
|
|
1135
|
+
var claims = _this.oauth2Service.getIdentityClaims();
|
|
1136
|
+
if (claims && (!TokenFactory.hasToken() ||
|
|
1137
|
+
(TokenFactory.hasToken() && event === 'refreshToken'))) {
|
|
1138
|
+
_this.tokenService.setToken(jwtEncode__default["default"]({
|
|
1139
|
+
accessToken: _this.oauth2Service.getAccessToken(),
|
|
1140
|
+
idToken: _this.oauth2Service.getIdToken(),
|
|
1141
|
+
refreshToken: _this.oauth2Service.getRefreshToken(),
|
|
1142
|
+
login: (_a = claims[config.indexLoginName]) !== null && _a !== void 0 ? _a : 'Undefined',
|
|
1143
|
+
expired: _this.oauth2Service.getAccessTokenExpiration(),
|
|
1144
|
+
code: _this.oauth2Service.getCode()
|
|
1145
|
+
}, 'secret'));
|
|
1146
|
+
}
|
|
1147
|
+
if (event === 'userAuthenticated') {
|
|
1148
|
+
setTimeout(function () { return _this.validationScope$.next(false); }, 300);
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
else if (event === 'getToken') {
|
|
1152
|
+
_this.validationScope$.next(true);
|
|
1153
|
+
}
|
|
1154
|
+
});
|
|
1155
|
+
}
|
|
1156
|
+
};
|
|
1157
|
+
return PageComponent;
|
|
1158
|
+
}());
|
|
1159
|
+
PageComponent.decorators = [
|
|
1160
|
+
{ type: i0.Component, args: [{
|
|
1161
|
+
selector: 'koala-page',
|
|
1162
|
+
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",
|
|
1163
|
+
providers: [KoalaTokenService],
|
|
1164
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1165
|
+
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"]
|
|
1166
|
+
},] }
|
|
1167
|
+
];
|
|
1168
|
+
PageComponent.ctorParameters = function () { return [
|
|
1169
|
+
{ type: KoalaTokenService },
|
|
1170
|
+
{ type: router.Router },
|
|
1171
|
+
{ type: KoalaLoaderService },
|
|
1172
|
+
{ type: menu.KoalaMenuService },
|
|
1173
|
+
{ type: KoalaOAuth2Service },
|
|
1174
|
+
{ type: ngxDeviceDetector.DeviceDetectorService }
|
|
1175
|
+
]; };
|
|
1176
|
+
PageComponent.propDecorators = {
|
|
1177
|
+
showMenu: [{ type: i0.Input }],
|
|
1178
|
+
color: [{ type: i0.Input }],
|
|
1179
|
+
logo: [{ type: i0.Input }],
|
|
1180
|
+
startMenuOpened: [{ type: i0.Input }],
|
|
1181
|
+
showLoaderPage: [{ type: i0.Input }],
|
|
1182
|
+
messageLoaderPage: [{ type: i0.Input }],
|
|
1183
|
+
defaultPage: [{ type: i0.Input }],
|
|
1184
|
+
openPages: [{ type: i0.Input }],
|
|
1185
|
+
notifications: [{ type: i0.Input }],
|
|
1186
|
+
userMenuOptions: [{ type: i0.Input }],
|
|
1187
|
+
palletColors: [{ type: i0.Input }],
|
|
1188
|
+
language: [{ type: i0.Input }],
|
|
1189
|
+
validatingScope: [{ type: i0.Output }],
|
|
1190
|
+
logoutEmitter: [{ type: i0.Output }],
|
|
1191
|
+
deleteAllNotifications: [{ type: i0.Output }],
|
|
1192
|
+
deleteNotification: [{ type: i0.Output }],
|
|
1193
|
+
menu: [{ type: i0.ViewChild, args: ['drawer', { static: true },] }]
|
|
1194
|
+
};
|
|
1195
|
+
|
|
1196
|
+
var KoalaNotFoundError = /** @class */ (function (_super) {
|
|
1197
|
+
__extends(KoalaNotFoundError, _super);
|
|
1198
|
+
function KoalaNotFoundError() {
|
|
1199
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1200
|
+
}
|
|
1201
|
+
return KoalaNotFoundError;
|
|
1202
|
+
}(Error));
|
|
1203
|
+
|
|
1204
|
+
var KoalaUnhautorizedError = /** @class */ (function (_super) {
|
|
1205
|
+
__extends(KoalaUnhautorizedError, _super);
|
|
1206
|
+
function KoalaUnhautorizedError() {
|
|
1207
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1208
|
+
}
|
|
1209
|
+
return KoalaUnhautorizedError;
|
|
1210
|
+
}(Error));
|
|
1211
|
+
|
|
1212
|
+
var KoalaClientError = /** @class */ (function (_super) {
|
|
1213
|
+
__extends(KoalaClientError, _super);
|
|
1214
|
+
function KoalaClientError() {
|
|
1215
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1216
|
+
}
|
|
1217
|
+
return KoalaClientError;
|
|
1218
|
+
}(Error));
|
|
1219
|
+
|
|
1220
|
+
var KoalaSuccessError = /** @class */ (function (_super) {
|
|
1221
|
+
__extends(KoalaSuccessError, _super);
|
|
1222
|
+
function KoalaSuccessError() {
|
|
1223
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1224
|
+
}
|
|
1225
|
+
return KoalaSuccessError;
|
|
1226
|
+
}(Error));
|
|
1227
|
+
|
|
1228
|
+
var KoalaErrorsHelper = /** @class */ (function () {
|
|
1229
|
+
function KoalaErrorsHelper() {
|
|
1230
|
+
}
|
|
1231
|
+
KoalaErrorsHelper.generate = function (e, urlRequest, customMessage) {
|
|
1232
|
+
var errorMessage = {
|
|
1233
|
+
error: true,
|
|
1234
|
+
message: (customMessage ? customMessage : e.message),
|
|
1235
|
+
urlRequest: urlRequest
|
|
1236
|
+
};
|
|
1237
|
+
if (e instanceof KoalaSuccessError) {
|
|
1238
|
+
errorMessage.error = false;
|
|
1239
|
+
errorMessage.statusCode = 200;
|
|
1240
|
+
errorMessage.alertEnum = i1$1.KoalaAlertEnum.success;
|
|
1241
|
+
}
|
|
1242
|
+
else if (e instanceof KoalaNotFoundError) {
|
|
1243
|
+
errorMessage.statusCode = 404;
|
|
1244
|
+
errorMessage.alertEnum = i1$1.KoalaAlertEnum.notFound;
|
|
1245
|
+
}
|
|
1246
|
+
else if (e instanceof KoalaUnhautorizedError) {
|
|
1247
|
+
errorMessage.statusCode = 401;
|
|
1248
|
+
errorMessage.alertEnum = i1$1.KoalaAlertEnum.unhautorized;
|
|
1249
|
+
}
|
|
1250
|
+
else if (e instanceof KoalaClientError) {
|
|
1251
|
+
errorMessage.statusCode = 400;
|
|
1252
|
+
errorMessage.alertEnum = i1$1.KoalaAlertEnum.badRequest;
|
|
1253
|
+
}
|
|
1254
|
+
else if (e instanceof i1.HttpErrorResponse) {
|
|
1255
|
+
errorMessage.urlRequest = e.url;
|
|
1256
|
+
errorMessage.statusCode = e.status;
|
|
1257
|
+
errorMessage.alertEnum = i1$1.KoalaAlertEnum.internalServerError;
|
|
1258
|
+
if (e.error && e.error.message) {
|
|
1259
|
+
errorMessage.message = e.error.message;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
else {
|
|
1263
|
+
errorMessage.statusCode = 500;
|
|
1264
|
+
errorMessage.alertEnum = i1$1.KoalaAlertEnum.internalServerError;
|
|
1265
|
+
}
|
|
1266
|
+
return errorMessage;
|
|
1267
|
+
};
|
|
1268
|
+
return KoalaErrorsHelper;
|
|
1269
|
+
}());
|
|
1270
|
+
|
|
1271
|
+
var KoalaRequestHeaderHelper = /** @class */ (function () {
|
|
1272
|
+
function KoalaRequestHeaderHelper() {
|
|
1273
|
+
}
|
|
1274
|
+
KoalaRequestHeaderHelper.add = function (token) {
|
|
1275
|
+
var headers = utils.koala({}).object();
|
|
1276
|
+
if (token) {
|
|
1277
|
+
headers.merge({ Authorization: 'Bearer ' + token });
|
|
1278
|
+
}
|
|
1279
|
+
if (KoalaOauthConfig.hasConfig()) {
|
|
1280
|
+
headers.merge({ Authenticator: KoalaOauthConfig.getConfig() });
|
|
1281
|
+
}
|
|
1282
|
+
return headers.getValue();
|
|
1283
|
+
};
|
|
1284
|
+
return KoalaRequestHeaderHelper;
|
|
1285
|
+
}());
|
|
1286
|
+
|
|
1287
|
+
// @dynamic
|
|
1288
|
+
var KoalaResponseFactory = /** @class */ (function () {
|
|
1289
|
+
function KoalaResponseFactory() {
|
|
1290
|
+
}
|
|
1291
|
+
KoalaResponseFactory.generateResponse = function (response, urlRequest) {
|
|
1292
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1293
|
+
return __generator(this, function (_g) {
|
|
1294
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
1295
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1296
|
+
var alert;
|
|
1297
|
+
switch (response.status) {
|
|
1298
|
+
case 200:
|
|
1299
|
+
case 201:
|
|
1300
|
+
alert = KoalaErrorsHelper.generate(new KoalaSuccessError((_a = response.body) === null || _a === void 0 ? void 0 : _a.message), urlRequest);
|
|
1301
|
+
alert.data = response.body;
|
|
1302
|
+
resolve(alert);
|
|
1303
|
+
break;
|
|
1304
|
+
case 400:
|
|
1305
|
+
alert = KoalaErrorsHelper.generate(new KoalaClientError(response.body.message), urlRequest);
|
|
1306
|
+
reject(alert);
|
|
1307
|
+
break;
|
|
1308
|
+
case 404:
|
|
1309
|
+
alert = KoalaErrorsHelper.generate(new KoalaNotFoundError((_b = response.body) === null || _b === void 0 ? void 0 : _b.message), urlRequest);
|
|
1310
|
+
reject(alert);
|
|
1311
|
+
break;
|
|
1312
|
+
case 401:
|
|
1313
|
+
alert = KoalaErrorsHelper.generate(new KoalaUnhautorizedError((_c = response.body) === null || _c === void 0 ? void 0 : _c.message), urlRequest);
|
|
1314
|
+
reject(alert);
|
|
1315
|
+
break;
|
|
1316
|
+
case 405:
|
|
1317
|
+
alert = KoalaErrorsHelper.generate(new KoalaClientError((_d = response.body) === null || _d === void 0 ? void 0 : _d.message), urlRequest);
|
|
1318
|
+
reject(alert);
|
|
1319
|
+
break;
|
|
1320
|
+
case 500:
|
|
1321
|
+
default:
|
|
1322
|
+
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);
|
|
1323
|
+
reject(alert);
|
|
1324
|
+
break;
|
|
1325
|
+
}
|
|
1326
|
+
})];
|
|
1327
|
+
});
|
|
1328
|
+
});
|
|
1329
|
+
};
|
|
1330
|
+
return KoalaResponseFactory;
|
|
1331
|
+
}());
|
|
1332
|
+
|
|
1333
|
+
var KoalaApiRequesterService = /** @class */ (function () {
|
|
1334
|
+
function KoalaApiRequesterService(http, oauth2Service) {
|
|
1335
|
+
this.http = http;
|
|
1336
|
+
this.oauth2Service = oauth2Service;
|
|
1337
|
+
this.isMockup = false;
|
|
1338
|
+
this.subscriptions = [];
|
|
1339
|
+
}
|
|
1340
|
+
KoalaApiRequesterService.prototype.request = function (method, url, data) {
|
|
1341
|
+
if (data === void 0) { data = {}; }
|
|
1342
|
+
if (data.__zone_symbol__state) {
|
|
1343
|
+
data = data.__zone_symbol__value;
|
|
1344
|
+
}
|
|
1345
|
+
switch (method) {
|
|
1346
|
+
case 'post':
|
|
1347
|
+
case 'put':
|
|
1348
|
+
case 'patch':
|
|
1349
|
+
case 'delete':
|
|
1350
|
+
return this.promiseSendData(this.postPutDelete(method, url, data), url);
|
|
1351
|
+
case 'get':
|
|
1352
|
+
var httpParams_1 = new i1.HttpParams();
|
|
1353
|
+
Object.keys(data !== null && data !== void 0 ? data : {}).forEach(function (key) {
|
|
1354
|
+
var dado = data[key];
|
|
1355
|
+
if (typeof dado == "object") {
|
|
1356
|
+
if (dado && dado.hasOwnProperty('length') && dado.length > 0) {
|
|
1357
|
+
dado.forEach(function (item) {
|
|
1358
|
+
httpParams_1 = httpParams_1.append(key.replace('[]', '') + "[]", item);
|
|
1359
|
+
});
|
|
1360
|
+
}
|
|
1361
|
+
else {
|
|
1362
|
+
httpParams_1 = httpParams_1.append(key, dado);
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
else {
|
|
1366
|
+
httpParams_1 = httpParams_1.append(key, dado);
|
|
1367
|
+
}
|
|
1368
|
+
});
|
|
1369
|
+
return this.promiseGetData(this.get(url, httpParams_1));
|
|
1370
|
+
}
|
|
1371
|
+
};
|
|
1372
|
+
KoalaApiRequesterService.prototype.cancelRequests = function () {
|
|
1373
|
+
var e_1, _a;
|
|
1374
|
+
try {
|
|
1375
|
+
for (var _b = __values(this.subscriptions.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1376
|
+
var subscribe = _c.value;
|
|
1377
|
+
subscribe.unsubscribe();
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1381
|
+
finally {
|
|
1382
|
+
try {
|
|
1383
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1384
|
+
}
|
|
1385
|
+
finally { if (e_1) throw e_1.error; }
|
|
1386
|
+
}
|
|
1387
|
+
};
|
|
1388
|
+
KoalaApiRequesterService.prototype.get = function (url, params) {
|
|
1389
|
+
return this.getMethod('get', url, params)
|
|
1390
|
+
.pipe(operators.map(function (response) {
|
|
1391
|
+
return response.body;
|
|
1392
|
+
}));
|
|
1393
|
+
};
|
|
1394
|
+
KoalaApiRequesterService.prototype.postPutDelete = function (method, url, data) {
|
|
1395
|
+
return this.getMethod(method, url, data);
|
|
1396
|
+
};
|
|
1397
|
+
KoalaApiRequesterService.prototype.promiseGetData = function (request) {
|
|
1398
|
+
var _this = this;
|
|
1399
|
+
return new rxjs.Observable(function (observe) {
|
|
1400
|
+
_this.subscriptions
|
|
1401
|
+
.push(request.pipe(operators.first())
|
|
1402
|
+
.subscribe({
|
|
1403
|
+
next: function (response) {
|
|
1404
|
+
observe.next(response);
|
|
1405
|
+
observe.complete();
|
|
1406
|
+
},
|
|
1407
|
+
error: function (e) {
|
|
1408
|
+
if (e.status === 401) {
|
|
1409
|
+
_this.oauth2Service.logout();
|
|
1410
|
+
}
|
|
1411
|
+
observe.error(KoalaErrorsHelper.generate(e));
|
|
1412
|
+
}
|
|
1413
|
+
}));
|
|
1414
|
+
});
|
|
1415
|
+
};
|
|
1416
|
+
KoalaApiRequesterService.prototype.promiseSendData = function (request, urlRequest) {
|
|
1417
|
+
var _this = this;
|
|
1418
|
+
return new rxjs.Observable(function (observe) {
|
|
1419
|
+
_this.subscriptions
|
|
1420
|
+
.push(request.pipe(operators.first())
|
|
1421
|
+
.subscribe({
|
|
1422
|
+
next: function (response) { return KoalaResponseFactory.generateResponse(response, urlRequest)
|
|
1423
|
+
.then(function (success) {
|
|
1424
|
+
observe.next(success);
|
|
1425
|
+
observe.complete();
|
|
1426
|
+
})
|
|
1427
|
+
.catch(function (error) {
|
|
1428
|
+
if (error.status === 401) {
|
|
1429
|
+
_this.oauth2Service.logout();
|
|
1430
|
+
}
|
|
1431
|
+
observe.error(error);
|
|
1432
|
+
}); },
|
|
1433
|
+
error: function (e) { return observe.error(KoalaErrorsHelper.generate(e)); }
|
|
1434
|
+
}));
|
|
1435
|
+
});
|
|
1436
|
+
};
|
|
1437
|
+
KoalaApiRequesterService.prototype.getUrlBase = function () {
|
|
1438
|
+
return this.isMockup ? 'http://localhost:4200/assets/mockup' : this.apiUrl;
|
|
1439
|
+
};
|
|
1440
|
+
KoalaApiRequesterService.prototype.getMethod = function (method, url, data) {
|
|
1441
|
+
if (data === void 0) { data = {}; }
|
|
1442
|
+
var options = {
|
|
1443
|
+
observe: 'response',
|
|
1444
|
+
headers: KoalaRequestHeaderHelper.add(TokenFactory.getToken())
|
|
1445
|
+
};
|
|
1446
|
+
switch (method) {
|
|
1447
|
+
case "post":
|
|
1448
|
+
return this.http.post(this.getUrlBase() + "/" + url, data, options);
|
|
1449
|
+
case "put":
|
|
1450
|
+
return this.http.put(this.getUrlBase() + "/" + url, data, options);
|
|
1451
|
+
case "patch":
|
|
1452
|
+
return this.http.patch(this.getUrlBase() + "/" + url, data, options);
|
|
1453
|
+
case "delete":
|
|
1454
|
+
return this.http.delete(this.getUrlBase() + "/" + url, options);
|
|
1455
|
+
case "get":
|
|
1456
|
+
options.params = data;
|
|
1457
|
+
return this.http.get(this.getUrlBase() + "/" + url, options);
|
|
1458
|
+
}
|
|
1459
|
+
};
|
|
1460
|
+
return KoalaApiRequesterService;
|
|
1461
|
+
}());
|
|
1462
|
+
KoalaApiRequesterService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function KoalaApiRequesterService_Factory() { return new KoalaApiRequesterService(i0__namespace.ɵɵinject(i1__namespace.HttpClient), i0__namespace.ɵɵinject(KoalaOAuth2Service)); }, token: KoalaApiRequesterService, providedIn: "root" });
|
|
1463
|
+
KoalaApiRequesterService.decorators = [
|
|
1464
|
+
{ type: i0.Injectable, args: [{ providedIn: "root" },] }
|
|
1465
|
+
];
|
|
1466
|
+
KoalaApiRequesterService.ctorParameters = function () { return [
|
|
1467
|
+
{ type: i1.HttpClient },
|
|
1468
|
+
{ type: KoalaOAuth2Service }
|
|
1469
|
+
]; };
|
|
1470
|
+
|
|
1471
|
+
var KoalaApiRequesterBase = /** @class */ (function () {
|
|
1472
|
+
function KoalaApiRequesterBase(koalaService, endpoint, isMockup) {
|
|
1473
|
+
if (isMockup === void 0) { isMockup = false; }
|
|
1474
|
+
var _a;
|
|
1475
|
+
this.koalaService = koalaService;
|
|
1476
|
+
this.endpoint = endpoint;
|
|
1477
|
+
koalaService.apiUrl = (_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.endpointApi;
|
|
1478
|
+
koalaService.isMockup = isMockup;
|
|
1479
|
+
}
|
|
1480
|
+
KoalaApiRequesterBase.prototype.getAll = function (filter) {
|
|
1481
|
+
return this.koalaService.request('get', this.endpoint, this.getParams(filter));
|
|
1482
|
+
};
|
|
1483
|
+
KoalaApiRequesterBase.prototype.getById = function (id) {
|
|
1484
|
+
return this.koalaService.request('get', this.endpoint + '/' + id);
|
|
1485
|
+
};
|
|
1486
|
+
KoalaApiRequesterBase.prototype.getBySomething = function (something) {
|
|
1487
|
+
return this.koalaService.request('get', this.endpoint + '/' + something);
|
|
1488
|
+
};
|
|
1489
|
+
KoalaApiRequesterBase.prototype.save = function (data, id) {
|
|
1490
|
+
return this.koalaService.request((id ? 'put' : 'post'), "" + this.endpoint + (id ? "/" + id : ''), data);
|
|
1491
|
+
};
|
|
1492
|
+
KoalaApiRequesterBase.prototype.delete = function (id) {
|
|
1493
|
+
return this.koalaService.request('delete', this.endpoint + '/' + id);
|
|
1494
|
+
};
|
|
1495
|
+
KoalaApiRequesterBase.prototype.cancelRequests = function () {
|
|
1496
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1497
|
+
return __generator(this, function (_b) {
|
|
1498
|
+
switch (_b.label) {
|
|
1499
|
+
case 0: return [4 /*yield*/, this.koalaService.cancelRequests()];
|
|
1500
|
+
case 1:
|
|
1501
|
+
_b.sent();
|
|
1502
|
+
return [2 /*return*/];
|
|
1503
|
+
}
|
|
1504
|
+
});
|
|
1505
|
+
});
|
|
1506
|
+
};
|
|
1507
|
+
KoalaApiRequesterBase.prototype.getParams = function (params) {
|
|
1508
|
+
var _a;
|
|
1509
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1510
|
+
var filter;
|
|
1511
|
+
return __generator(this, function (_b) {
|
|
1512
|
+
filter = {};
|
|
1513
|
+
if (params instanceof rxjs.BehaviorSubject) {
|
|
1514
|
+
Object.assign(filter, (_a = params === null || params === void 0 ? void 0 : params.getValue()) !== null && _a !== void 0 ? _a : {});
|
|
1515
|
+
}
|
|
1516
|
+
else {
|
|
1517
|
+
Object.assign(filter, params !== null && params !== void 0 ? params : {});
|
|
1518
|
+
}
|
|
1519
|
+
if (filter &&
|
|
1520
|
+
filter.hasOwnProperty('sort') &&
|
|
1521
|
+
filter.hasOwnProperty('order') &&
|
|
1522
|
+
filter.hasOwnProperty('limit') &&
|
|
1523
|
+
filter.hasOwnProperty('page') &&
|
|
1524
|
+
filter.hasOwnProperty('params')) {
|
|
1525
|
+
Object.keys(filter.params).forEach(function (indexName) {
|
|
1526
|
+
if ("" + filter.params[indexName] === 'NaN' ||
|
|
1527
|
+
filter.params[indexName] === null) {
|
|
1528
|
+
filter.params[indexName] = '';
|
|
1529
|
+
}
|
|
1530
|
+
});
|
|
1531
|
+
return [2 /*return*/, utils.koala({})
|
|
1532
|
+
.object()
|
|
1533
|
+
.merge(filter.params)
|
|
1534
|
+
.merge({
|
|
1535
|
+
sort: filter.sort,
|
|
1536
|
+
order: filter.order,
|
|
1537
|
+
limit: filter.limit,
|
|
1538
|
+
page: filter.page
|
|
1539
|
+
})
|
|
1540
|
+
.getValue()];
|
|
1541
|
+
}
|
|
1542
|
+
return [2 /*return*/, filter !== null && filter !== void 0 ? filter : null];
|
|
1543
|
+
});
|
|
1544
|
+
});
|
|
1545
|
+
};
|
|
1546
|
+
return KoalaApiRequesterBase;
|
|
1547
|
+
}());
|
|
1548
|
+
|
|
1549
|
+
var KoalaCsvService = /** @class */ (function () {
|
|
1550
|
+
function KoalaCsvService(papa) {
|
|
1551
|
+
this.papa = papa;
|
|
1552
|
+
}
|
|
1553
|
+
KoalaCsvService.prototype.convertJsonToCsv = function (json, filename) {
|
|
1554
|
+
if (filename === void 0) { filename = 'export'; }
|
|
1555
|
+
this.downloadCsv(new Blob([
|
|
1556
|
+
this.papa.unparse(json, {
|
|
1557
|
+
header: true,
|
|
1558
|
+
delimiter: ";",
|
|
1559
|
+
newline: "\r\n"
|
|
1560
|
+
})
|
|
1561
|
+
], {
|
|
1562
|
+
type: 'text/csv;charset=utf-8;'
|
|
1563
|
+
}), filename);
|
|
1564
|
+
};
|
|
1565
|
+
KoalaCsvService.prototype.downloadCsv = function (blob, filename) {
|
|
1566
|
+
if (filename === void 0) { filename = 'export'; }
|
|
1567
|
+
var link = document.createElement('a');
|
|
1568
|
+
var url = URL.createObjectURL(blob);
|
|
1569
|
+
link.setAttribute("href", url);
|
|
1570
|
+
link.setAttribute("download", filename + '.csv');
|
|
1571
|
+
link.style.visibility = 'hidden';
|
|
1572
|
+
document.body.appendChild(link);
|
|
1573
|
+
link.click();
|
|
1574
|
+
document.body.removeChild(link);
|
|
1575
|
+
};
|
|
1576
|
+
return KoalaCsvService;
|
|
1577
|
+
}());
|
|
1578
|
+
KoalaCsvService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function KoalaCsvService_Factory() { return new KoalaCsvService(i0__namespace.ɵɵinject(i1__namespace$1.Papa)); }, token: KoalaCsvService, providedIn: "any" });
|
|
1579
|
+
KoalaCsvService.decorators = [
|
|
1580
|
+
{ type: i0.Injectable, args: [{ providedIn: "any" },] }
|
|
1581
|
+
];
|
|
1582
|
+
KoalaCsvService.ctorParameters = function () { return [
|
|
1583
|
+
{ type: i1$2.Papa }
|
|
1584
|
+
]; };
|
|
1585
|
+
|
|
1586
|
+
var KoalaRequestService = /** @class */ (function () {
|
|
1587
|
+
function KoalaRequestService(koalaAlertService) {
|
|
1588
|
+
this.koalaAlertService = koalaAlertService;
|
|
1589
|
+
}
|
|
1590
|
+
KoalaRequestService.prototype.request = function (request, success, error) {
|
|
1591
|
+
var _this = this;
|
|
1592
|
+
if (request instanceof Promise) {
|
|
1593
|
+
request.then(function (response) {
|
|
1594
|
+
if (success) {
|
|
1595
|
+
success(response);
|
|
1596
|
+
}
|
|
1597
|
+
}).catch(function (e) {
|
|
1598
|
+
if (error) {
|
|
1599
|
+
error(e);
|
|
1600
|
+
}
|
|
1601
|
+
_this.showAlertError(e);
|
|
1602
|
+
});
|
|
1603
|
+
}
|
|
1604
|
+
else {
|
|
1605
|
+
return request.subscribe(function (response) {
|
|
1606
|
+
if (success) {
|
|
1607
|
+
success(response);
|
|
1608
|
+
}
|
|
1609
|
+
}, function (e) {
|
|
1610
|
+
if (error) {
|
|
1611
|
+
error(e);
|
|
1612
|
+
}
|
|
1613
|
+
_this.showAlertError(e);
|
|
1614
|
+
});
|
|
1615
|
+
}
|
|
1616
|
+
};
|
|
1617
|
+
KoalaRequestService.prototype.showAlertError = function (e) {
|
|
1618
|
+
var alertEnum = i1$1.KoalaRequestCodeToAlertEnumTranslate.translate(e.statusCode);
|
|
1619
|
+
this.koalaAlertService.create({
|
|
1620
|
+
alertEnum: alertEnum,
|
|
1621
|
+
message: alertEnum === i1$1.KoalaAlertEnum.internalServerError
|
|
1622
|
+
? KoalaLanguageHelper.getInternalServerErrorMessage()
|
|
1623
|
+
: e.message
|
|
1624
|
+
});
|
|
1625
|
+
};
|
|
1626
|
+
return KoalaRequestService;
|
|
1627
|
+
}());
|
|
1628
|
+
KoalaRequestService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function KoalaRequestService_Factory() { return new KoalaRequestService(i0__namespace.ɵɵinject(i1__namespace$2.KoalaAlertService)); }, token: KoalaRequestService, providedIn: "any" });
|
|
1629
|
+
KoalaRequestService.decorators = [
|
|
1630
|
+
{ type: i0.Injectable, args: [{ providedIn: "any" },] }
|
|
1631
|
+
];
|
|
1632
|
+
KoalaRequestService.ctorParameters = function () { return [
|
|
1633
|
+
{ type: i1$1.KoalaAlertService }
|
|
1634
|
+
]; };
|
|
1635
|
+
|
|
1636
|
+
var KoalaXlsxService = /** @class */ (function () {
|
|
1637
|
+
function KoalaXlsxService() {
|
|
1638
|
+
}
|
|
1639
|
+
KoalaXlsxService.prototype.convertJsonToXlsx = function (json, config) {
|
|
1640
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1641
|
+
var title, header, workbook, worksheet, titleRow, headerRow;
|
|
1642
|
+
return __generator(this, function (_a) {
|
|
1643
|
+
switch (_a.label) {
|
|
1644
|
+
case 0:
|
|
1645
|
+
title = config.title;
|
|
1646
|
+
header = [];
|
|
1647
|
+
Object.keys(json[0]).forEach(function (name) {
|
|
1648
|
+
header.push(utils.koala(name).string().normalize().getValue().toUpperCase());
|
|
1649
|
+
});
|
|
1650
|
+
workbook = new Excel__namespace.Workbook();
|
|
1651
|
+
worksheet = workbook.addWorksheet(config.sheetName);
|
|
1652
|
+
if (!config.password) return [3 /*break*/, 2];
|
|
1653
|
+
return [4 /*yield*/, worksheet.protect(config.password, {
|
|
1654
|
+
selectLockedCells: false,
|
|
1655
|
+
selectUnlockedCells: false,
|
|
1656
|
+
scenarios: false
|
|
1657
|
+
})];
|
|
1658
|
+
case 1:
|
|
1659
|
+
_a.sent();
|
|
1660
|
+
_a.label = 2;
|
|
1661
|
+
case 2:
|
|
1662
|
+
titleRow = worksheet.addRow([title]);
|
|
1663
|
+
titleRow.alignment = { horizontal: "center" };
|
|
1664
|
+
titleRow.font = { bold: true, color: { argb: config.titleFontColor.replace('#', '') } };
|
|
1665
|
+
titleRow.fill = {
|
|
1666
|
+
type: 'pattern',
|
|
1667
|
+
pattern: 'solid',
|
|
1668
|
+
fgColor: { argb: config.titleBackgroundColor.replace('#', '') },
|
|
1669
|
+
bgColor: { argb: config.titleBackgroundColor.replace('#', '') }
|
|
1670
|
+
};
|
|
1671
|
+
worksheet.mergeCells("A1:" + worksheet.getCell(1, Object.keys(json[0]).length).address);
|
|
1672
|
+
headerRow = worksheet.addRow(header);
|
|
1673
|
+
headerRow.eachCell(function (cell, number) {
|
|
1674
|
+
cell.fill = {
|
|
1675
|
+
type: 'pattern',
|
|
1676
|
+
pattern: 'solid',
|
|
1677
|
+
fgColor: { argb: config.headerBackgroundColor.replace('#', '') },
|
|
1678
|
+
bgColor: { argb: config.headerBackgroundColor.replace('#', '') }
|
|
1679
|
+
};
|
|
1680
|
+
cell.font = {
|
|
1681
|
+
color: { argb: config.headerFontColor.replace('#', '') }
|
|
1682
|
+
};
|
|
1683
|
+
});
|
|
1684
|
+
json.forEach(function (item) {
|
|
1685
|
+
var data = [];
|
|
1686
|
+
Object.values(item).forEach(function (value) { return data.push(value); });
|
|
1687
|
+
worksheet.addRow(data);
|
|
1688
|
+
});
|
|
1689
|
+
workbook.xlsx.writeBuffer().then(function (data) {
|
|
1690
|
+
var blob = new Blob([data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
1691
|
+
fs__namespace.saveAs(blob, config.filename + '.xlsx');
|
|
1692
|
+
});
|
|
1693
|
+
return [2 /*return*/];
|
|
1694
|
+
}
|
|
1695
|
+
});
|
|
1696
|
+
});
|
|
1697
|
+
};
|
|
1698
|
+
return KoalaXlsxService;
|
|
1699
|
+
}());
|
|
1700
|
+
KoalaXlsxService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function KoalaXlsxService_Factory() { return new KoalaXlsxService(); }, token: KoalaXlsxService, providedIn: "any" });
|
|
1701
|
+
KoalaXlsxService.decorators = [
|
|
1702
|
+
{ type: i0.Injectable, args: [{ providedIn: "any" },] }
|
|
1703
|
+
];
|
|
1704
|
+
|
|
1705
|
+
var KoalaParameterHashLocationStrategy = /** @class */ (function (_super) {
|
|
1706
|
+
__extends(KoalaParameterHashLocationStrategy, _super);
|
|
1707
|
+
function KoalaParameterHashLocationStrategy() {
|
|
1708
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1709
|
+
}
|
|
1710
|
+
KoalaParameterHashLocationStrategy.prototype.prepareExternalUrl = function (internal) {
|
|
1711
|
+
var _a;
|
|
1712
|
+
var hasToken = !!localStorage.getItem((_a = KoalaEnvironment.environment) === null || _a === void 0 ? void 0 : _a.storageTokenName);
|
|
1713
|
+
return !hasToken ?
|
|
1714
|
+
window.location.search + _super.prototype.prepareExternalUrl.call(this, internal) :
|
|
1715
|
+
_super.prototype.prepareExternalUrl.call(this, internal);
|
|
1716
|
+
};
|
|
1717
|
+
return KoalaParameterHashLocationStrategy;
|
|
1718
|
+
}(common.HashLocationStrategy));
|
|
1719
|
+
KoalaParameterHashLocationStrategy.decorators = [
|
|
1720
|
+
{ type: i0.Injectable }
|
|
1721
|
+
];
|
|
1722
|
+
|
|
1723
|
+
var maskOptions = {
|
|
1724
|
+
validation: false
|
|
1725
|
+
};
|
|
1726
|
+
|
|
1727
|
+
var KoalaPageModule = /** @class */ (function () {
|
|
1728
|
+
function KoalaPageModule() {
|
|
1729
|
+
}
|
|
1730
|
+
return KoalaPageModule;
|
|
1731
|
+
}());
|
|
1732
|
+
KoalaPageModule.decorators = [
|
|
1733
|
+
{ type: i0.NgModule, args: [{
|
|
1734
|
+
declarations: [
|
|
1735
|
+
PageComponent,
|
|
1736
|
+
NotificationComponent,
|
|
1737
|
+
LoaderBarPageComponent
|
|
1738
|
+
],
|
|
1739
|
+
exports: [
|
|
1740
|
+
PageComponent,
|
|
1741
|
+
router.RouterModule
|
|
1742
|
+
],
|
|
1743
|
+
imports: [
|
|
1744
|
+
common.CommonModule,
|
|
1745
|
+
router.RouterModule,
|
|
1746
|
+
badge.MatBadgeModule,
|
|
1747
|
+
progressSpinner.MatProgressSpinnerModule,
|
|
1748
|
+
progressBar.MatProgressBarModule,
|
|
1749
|
+
toolbar.MatToolbarModule,
|
|
1750
|
+
tooltip.MatTooltipModule,
|
|
1751
|
+
button.MatButtonModule,
|
|
1752
|
+
icon.MatIconModule,
|
|
1753
|
+
sidenav.MatSidenavModule,
|
|
1754
|
+
list.MatListModule,
|
|
1755
|
+
menu$1.MatMenuModule
|
|
1756
|
+
]
|
|
1757
|
+
},] }
|
|
1758
|
+
];
|
|
1759
|
+
|
|
1760
|
+
var NgxKoalaModule = /** @class */ (function () {
|
|
1761
|
+
function NgxKoalaModule() {
|
|
1762
|
+
}
|
|
1763
|
+
NgxKoalaModule.forRoot = function (environment) {
|
|
1764
|
+
var _a, _b;
|
|
1765
|
+
environment.storageOAuthTypeName = (_a = environment.storageOAuthTypeName) !== null && _a !== void 0 ? _a : 'koala_ui_oauth_type';
|
|
1766
|
+
environment.storageTokenName = (_b = environment.storageTokenName) !== null && _b !== void 0 ? _b : 'koala_ui_token';
|
|
1767
|
+
KoalaEnvironment.environment = environment;
|
|
1768
|
+
return {
|
|
1769
|
+
ngModule: NgxKoalaModule,
|
|
1770
|
+
providers: [KoalaOAuth2Service]
|
|
1771
|
+
};
|
|
1772
|
+
};
|
|
1773
|
+
return NgxKoalaModule;
|
|
1774
|
+
}());
|
|
1775
|
+
NgxKoalaModule.decorators = [
|
|
1776
|
+
{ type: i0.NgModule, args: [{
|
|
1777
|
+
imports: [
|
|
1778
|
+
common.CommonModule,
|
|
1779
|
+
i1.HttpClientModule,
|
|
1780
|
+
KoalaPageModule
|
|
1781
|
+
],
|
|
1782
|
+
exports: [
|
|
1783
|
+
i1.HttpClientModule,
|
|
1784
|
+
KoalaPageModule
|
|
1785
|
+
],
|
|
1786
|
+
providers: [
|
|
1787
|
+
KoalaOAuth2Service
|
|
1788
|
+
]
|
|
1789
|
+
},] }
|
|
1790
|
+
];
|
|
1791
|
+
|
|
1792
|
+
//#region [COMPONENTS]
|
|
1793
|
+
|
|
1794
|
+
/**
|
|
1795
|
+
* Generated bundle index. Do not edit.
|
|
1796
|
+
*/
|
|
1797
|
+
|
|
1798
|
+
exports.KOALA_LOADER_SUBJECT = KOALA_LOADER_SUBJECT;
|
|
1799
|
+
exports.KoalaApiRequesterBase = KoalaApiRequesterBase;
|
|
1800
|
+
exports.KoalaApiRequesterService = KoalaApiRequesterService;
|
|
1801
|
+
exports.KoalaCsvService = KoalaCsvService;
|
|
1802
|
+
exports.KoalaLanguageHelper = KoalaLanguageHelper;
|
|
1803
|
+
exports.KoalaLoaderService = KoalaLoaderService;
|
|
1804
|
+
exports.KoalaOAuth2Service = KoalaOAuth2Service;
|
|
1805
|
+
exports.KoalaOauthConfig = KoalaOauthConfig;
|
|
1806
|
+
exports.KoalaParameterHashLocationStrategy = KoalaParameterHashLocationStrategy;
|
|
1807
|
+
exports.KoalaRequestService = KoalaRequestService;
|
|
1808
|
+
exports.KoalaTokenService = KoalaTokenService;
|
|
1809
|
+
exports.KoalaXlsxService = KoalaXlsxService;
|
|
1810
|
+
exports.LoaderBarPageComponent = LoaderBarPageComponent;
|
|
1811
|
+
exports.NgxKoalaModule = NgxKoalaModule;
|
|
1812
|
+
exports.NotificationComponent = NotificationComponent;
|
|
1813
|
+
exports.PageComponent = PageComponent;
|
|
1814
|
+
exports.maskOptions = maskOptions;
|
|
1815
|
+
exports["ɵa"] = KoalaEnvironment;
|
|
1816
|
+
exports["ɵb"] = KoalaPageModule;
|
|
1817
|
+
|
|
1818
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1819
|
+
|
|
1820
|
+
}));
|
|
1821
|
+
//# sourceMappingURL=koalarx-ui-core.umd.js.map
|