@koalarx/ui 12.7.19 → 13.0.3
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/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/alert/{esm2015/koalarx-ui-alert.js → esm2020/koalarx-ui-alert.mjs} +0 -0
- package/alert/esm2020/lib/dialog-alert.component.mjs +48 -0
- package/alert/{esm2015/lib/koala.alert-config.interface.js → esm2020/lib/koala.alert-config.interface.mjs} +0 -0
- package/alert/{esm2015/lib/koala.alert.enum.js → esm2020/lib/koala.alert.enum.mjs} +0 -0
- package/alert/esm2020/lib/koala.alert.module.mjs +48 -0
- package/alert/esm2020/lib/koala.alert.service.mjs +19 -0
- package/alert/{esm2015/lib/koala.request-code-to-alert-enum.translate.js → esm2020/lib/koala.request-code-to-alert-enum.translate.mjs} +0 -0
- package/alert/fesm2015/koalarx-ui-alert.mjs +141 -0
- package/alert/fesm2015/koalarx-ui-alert.mjs.map +1 -0
- package/alert/fesm2020/koalarx-ui-alert.mjs +139 -0
- package/alert/fesm2020/koalarx-ui-alert.mjs.map +1 -0
- package/alert/koalarx-ui-alert.d.ts +1 -0
- package/alert/lib/dialog-alert.component.d.ts +3 -0
- package/alert/lib/koala.alert.module.d.ts +10 -0
- package/alert/lib/koala.alert.service.d.ts +3 -0
- package/alert/package.json +18 -6
- package/button/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/button/{esm2015/koalarx-ui-button.js → esm2020/koalarx-ui-button.mjs} +0 -0
- package/button/esm2020/lib/button.component.mjs +44 -0
- package/button/esm2020/lib/koala.button.module.mjs +42 -0
- package/button/fesm2015/koalarx-ui-button.mjs +90 -0
- package/button/fesm2015/koalarx-ui-button.mjs.map +1 -0
- package/button/fesm2020/koalarx-ui-button.mjs +90 -0
- package/button/fesm2020/koalarx-ui-button.mjs.map +1 -0
- package/button/koalarx-ui-button.d.ts +1 -0
- package/button/lib/button.component.d.ts +6 -1
- package/button/lib/koala.button.module.d.ts +10 -0
- package/button/package.json +18 -6
- package/common/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/common/{esm2015/koalarx-ui-common.js → esm2020/koalarx-ui-common.mjs} +0 -0
- package/common/{esm2015/lib/mask-options.js → esm2020/lib/mask-options.mjs} +0 -0
- package/common/esm2020/lib/services/csv/koala.csv.service.mjs +36 -0
- package/common/{esm2015/lib/services/xlsx/koala.xlsx-config.interface.js → esm2020/lib/services/xlsx/koala.xlsx-config.interface.mjs} +0 -0
- package/common/esm2020/lib/services/xlsx/koala.xlsx.service.mjs +73 -0
- package/common/fesm2015/{koalarx-ui-common.js → koalarx-ui-common.mjs} +14 -14
- package/common/fesm2015/koalarx-ui-common.mjs.map +1 -0
- package/common/fesm2020/koalarx-ui-common.mjs +118 -0
- package/common/fesm2020/koalarx-ui-common.mjs.map +1 -0
- package/common/koalarx-ui-common.d.ts +1 -0
- package/common/lib/services/csv/koala.csv.service.d.ts +3 -0
- package/common/lib/services/xlsx/koala.xlsx.service.d.ts +3 -0
- package/common/package.json +18 -6
- package/core/esm2020/index.mjs +35 -0
- package/core/esm2020/koalarx-ui-core.mjs +5 -0
- package/core/{esm2015/lib/environments/koalaEnvironment.js → esm2020/lib/environments/koalaEnvironment.mjs} +0 -0
- package/core/esm2020/lib/loader/loader-bar-page.component.mjs +24 -0
- package/core/{esm2015/lib/loader/loader-bar-page.interface.js → esm2020/lib/loader/loader-bar-page.interface.mjs} +0 -0
- package/core/{esm2015/lib/loader/loader-config.interface.js → esm2020/lib/loader/loader-config.interface.mjs} +0 -0
- package/core/esm2020/lib/ngx-koala.module.mjs +49 -0
- package/core/{esm2015/lib/page/koala-language.helper.js → esm2020/lib/page/koala-language.helper.mjs} +0 -0
- package/core/{esm2015/lib/page/koala-page-pallet-colors.interface.js → esm2020/lib/page/koala-page-pallet-colors.interface.mjs} +0 -0
- package/core/esm2020/lib/page/koala.page.module.mjs +78 -0
- package/core/{esm2015/lib/page/koala.user-menu-options.interface.js → esm2020/lib/page/koala.user-menu-options.interface.mjs} +0 -0
- package/core/{esm2015/lib/page/notifications/koala.notification.interface.js → esm2020/lib/page/notifications/koala.notification.interface.mjs} +0 -0
- package/core/esm2020/lib/page/notifications/notification.component.mjs +47 -0
- package/core/esm2020/lib/page/page.component.mjs +404 -0
- package/core/esm2020/lib/router/koala.parameter-hash-location-stategy.mjs +18 -0
- package/core/esm2020/lib/services/api-requester/factory/koala.response.factory.mjs +44 -0
- package/core/{esm2015/lib/services/api-requester/helpers/error/koala.client.error.js → esm2020/lib/services/api-requester/helpers/error/koala.client.error.mjs} +0 -0
- package/core/{esm2015/lib/services/api-requester/helpers/error/koala.errors.helper.js → esm2020/lib/services/api-requester/helpers/error/koala.errors.helper.mjs} +0 -0
- package/core/{esm2015/lib/services/api-requester/helpers/error/koala.not-found.error.js → esm2020/lib/services/api-requester/helpers/error/koala.not-found.error.mjs} +0 -0
- package/core/{esm2015/lib/services/api-requester/helpers/error/koala.success.error.js → esm2020/lib/services/api-requester/helpers/error/koala.success.error.mjs} +0 -0
- package/core/{esm2015/lib/services/api-requester/helpers/error/koala.unhautorized.error.js → esm2020/lib/services/api-requester/helpers/error/koala.unhautorized.error.mjs} +0 -0
- package/core/{esm2015/lib/services/api-requester/helpers/service/koala.request-header.helper.js → esm2020/lib/services/api-requester/helpers/service/koala.request-header.helper.mjs} +0 -0
- package/core/esm2020/lib/services/api-requester/koala.api-requester.base.mjs +63 -0
- package/core/esm2020/lib/services/api-requester/koala.api-requester.service.mjs +148 -0
- package/core/esm2020/lib/services/loader/koala.loader.service.mjs +34 -0
- package/core/{esm2015/lib/services/openid/koala-oauth2-config.interface.js → esm2020/lib/services/openid/koala-oauth2-config.interface.mjs} +0 -0
- package/core/esm2020/lib/services/openid/koala.oauth.config.mjs +30 -0
- package/core/esm2020/lib/services/openid/koala.oauth2.service.mjs +194 -0
- package/core/esm2020/lib/services/request/koala.request.service.mjs +52 -0
- package/core/{esm2015/lib/services/token/koala.token.service.js → esm2020/lib/services/token/koala.token.service.mjs} +7 -6
- package/core/esm2020/lib/services/token/token.factory.mjs +27 -0
- package/core/fesm2015/{koalarx-ui-core.js → koalarx-ui-core.mjs} +266 -191
- package/core/fesm2015/koalarx-ui-core.mjs.map +1 -0
- package/core/fesm2020/koalarx-ui-core.mjs +1384 -0
- package/core/fesm2020/koalarx-ui-core.mjs.map +1 -0
- package/core/index.d.ts +1 -0
- package/core/koalarx-ui-core.d.ts +1 -2
- package/core/lib/loader/loader-bar-page.component.d.ts +5 -1
- package/core/lib/ngx-koala.module.d.ts +7 -0
- package/core/lib/page/koala.page.module.d.ts +19 -0
- package/core/lib/page/notifications/notification.component.d.ts +3 -0
- package/core/lib/page/page.component.d.ts +3 -0
- package/core/lib/router/koala.parameter-hash-location-stategy.d.ts +3 -0
- package/core/lib/services/api-requester/koala.api-requester.service.d.ts +4 -0
- package/core/lib/services/loader/koala.loader.service.d.ts +3 -0
- package/core/lib/services/openid/koala.oauth2.service.d.ts +3 -0
- package/core/lib/services/request/koala.request.service.d.ts +3 -0
- package/core/lib/services/token/koala.token.service.d.ts +3 -0
- package/core/package.json +18 -6
- package/dialog/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/dialog/{esm2015/koalarx-ui-dialog.js → esm2020/koalarx-ui-dialog.mjs} +0 -0
- package/dialog/esm2020/lib/dialog.component.mjs +25 -0
- package/dialog/{esm2015/lib/koala.dialog-template.interface.js → esm2020/lib/koala.dialog-template.interface.mjs} +0 -0
- package/dialog/esm2020/lib/koala.dialog.module.mjs +38 -0
- package/dialog/esm2020/lib/koala.dialog.service.mjs +57 -0
- package/dialog/fesm2015/koalarx-ui-dialog.mjs +121 -0
- package/dialog/fesm2015/koalarx-ui-dialog.mjs.map +1 -0
- package/dialog/fesm2020/koalarx-ui-dialog.mjs +121 -0
- package/dialog/fesm2020/koalarx-ui-dialog.mjs.map +1 -0
- package/dialog/koalarx-ui-dialog.d.ts +1 -0
- package/dialog/lib/dialog.component.d.ts +3 -0
- package/dialog/lib/koala.dialog.module.d.ts +9 -0
- package/dialog/lib/koala.dialog.service.d.ts +3 -0
- package/dialog/package.json +18 -6
- package/dynamic-component/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/dynamic-component/{esm2015/koalarx-ui-dynamic-component.js → esm2020/koalarx-ui-dynamic-component.mjs} +0 -0
- package/dynamic-component/{esm2015/lib/koala-dynamic-component.component.js → esm2020/lib/koala-dynamic-component.component.mjs} +0 -0
- package/dynamic-component/esm2020/lib/koala-dynamic-component.directive.mjs +16 -0
- package/dynamic-component/esm2020/lib/koala-dynamic-component.factory.mjs +41 -0
- package/dynamic-component/{esm2015/lib/koala-dynamic-component.js → esm2020/lib/koala-dynamic-component.mjs} +0 -0
- package/dynamic-component/esm2020/lib/koala-dynamic-component.module.mjs +23 -0
- package/dynamic-component/fesm2015/koalarx-ui-dynamic-component.mjs +87 -0
- package/dynamic-component/fesm2015/koalarx-ui-dynamic-component.mjs.map +1 -0
- package/dynamic-component/fesm2020/koalarx-ui-dynamic-component.mjs +86 -0
- package/dynamic-component/fesm2020/koalarx-ui-dynamic-component.mjs.map +1 -0
- package/dynamic-component/koalarx-ui-dynamic-component.d.ts +1 -0
- package/dynamic-component/lib/koala-dynamic-component.directive.d.ts +3 -0
- package/dynamic-component/lib/koala-dynamic-component.factory.d.ts +3 -0
- package/dynamic-component/lib/koala-dynamic-component.module.d.ts +6 -0
- package/dynamic-component/package.json +18 -6
- package/file-button/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/file-button/{esm2015/koalarx-ui-file-button.js → esm2020/koalarx-ui-file-button.mjs} +0 -0
- package/file-button/esm2020/lib/file-button.component.mjs +125 -0
- package/file-button/esm2020/lib/koala.btn-file.service.mjs +25 -0
- package/file-button/esm2020/lib/koala.file-button.module.mjs +38 -0
- package/file-button/{esm2015/lib/koala.file.interface.js → esm2020/lib/koala.file.interface.mjs} +0 -0
- package/file-button/fesm2015/koalarx-ui-file-button.mjs +199 -0
- package/file-button/fesm2015/koalarx-ui-file-button.mjs.map +1 -0
- package/file-button/fesm2020/koalarx-ui-file-button.mjs +189 -0
- package/file-button/fesm2020/koalarx-ui-file-button.mjs.map +1 -0
- package/file-button/koalarx-ui-file-button.d.ts +1 -0
- package/file-button/lib/file-button.component.d.ts +4 -1
- package/file-button/lib/koala.btn-file.service.d.ts +3 -0
- package/file-button/lib/koala.file-button.module.d.ts +9 -0
- package/file-button/package.json +18 -6
- package/folder-page/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/folder-page/{esm2015/koalarx-ui-folder-page.js → esm2020/koalarx-ui-folder-page.mjs} +0 -0
- package/folder-page/esm2020/lib/folder.component.mjs +70 -0
- package/folder-page/{esm2015/lib/koala-navigate-history.interface.js → esm2020/lib/koala-navigate-history.interface.mjs} +0 -0
- package/folder-page/esm2020/lib/koala.folder-page.module.mjs +42 -0
- package/folder-page/fesm2015/koalarx-ui-folder-page.mjs +117 -0
- package/folder-page/fesm2015/koalarx-ui-folder-page.mjs.map +1 -0
- package/folder-page/fesm2020/koalarx-ui-folder-page.mjs +116 -0
- package/folder-page/fesm2020/koalarx-ui-folder-page.mjs.map +1 -0
- package/folder-page/koalarx-ui-folder-page.d.ts +1 -0
- package/folder-page/lib/folder.component.d.ts +6 -2
- package/folder-page/lib/koala.folder-page.module.d.ts +10 -0
- package/folder-page/package.json +18 -6
- package/form/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/form/{esm2015/koalarx-ui-form.js → esm2020/koalarx-ui-form.mjs} +0 -0
- package/form/esm2020/lib/btn-submit/btn-submit.component.mjs +49 -0
- package/form/esm2020/lib/directives/koala-autofocus.directive.mjs +25 -0
- package/form/esm2020/lib/dynamic-form/builder/dynamic-form.builder.mjs +138 -0
- package/form/{esm2015/lib/dynamic-form/builder/fields/autocomplete.builder.js → esm2020/lib/dynamic-form/builder/fields/autocomplete.builder.mjs} +0 -0
- package/form/esm2020/lib/dynamic-form/builder/fields/field.base.mjs +148 -0
- package/form/{esm2015/lib/dynamic-form/builder/fields/field.builder.js → esm2020/lib/dynamic-form/builder/fields/field.builder.mjs} +0 -0
- package/form/esm2020/lib/dynamic-form/builder/fields/more-items.builder.mjs +57 -0
- package/form/esm2020/lib/dynamic-form/dynamic-form.component.mjs +581 -0
- package/form/{esm2015/lib/dynamic-form/enums/dynamic-form-type-field.enum.js → esm2020/lib/dynamic-form/enums/dynamic-form-type-field.enum.mjs} +0 -0
- package/form/{esm2015/lib/dynamic-form/interfaces/koala-custom-validator-fn.interface.js → esm2020/lib/dynamic-form/interfaces/koala-custom-validator-fn.interface.mjs} +0 -0
- package/form/{esm2015/lib/dynamic-form/interfaces/koala.dynamic-autocomplete-options.interface.js → esm2020/lib/dynamic-form/interfaces/koala.dynamic-autocomplete-options.interface.mjs} +0 -0
- package/form/{esm2015/lib/dynamic-form/interfaces/koala.dynamic-form-autocomplete-multiple-config.interface.js → esm2020/lib/dynamic-form/interfaces/koala.dynamic-form-autocomplete-multiple-config.interface.mjs} +0 -0
- package/form/{esm2015/lib/dynamic-form/interfaces/koala.dynamic-form-config.interface.js → esm2020/lib/dynamic-form/interfaces/koala.dynamic-form-config.interface.mjs} +0 -0
- package/form/{esm2015/lib/dynamic-form/interfaces/koala.dynamic-form-field.interface.js → esm2020/lib/dynamic-form/interfaces/koala.dynamic-form-field.interface.mjs} +0 -0
- package/form/{esm2015/lib/dynamic-form/interfaces/koala.dynamic-form-more-itens-show-field-config.interface.js → esm2020/lib/dynamic-form/interfaces/koala.dynamic-form-more-itens-show-field-config.interface.mjs} +0 -0
- package/form/{esm2015/lib/dynamic-form/interfaces/koala.dynamic-form-show-field.interface.js → esm2020/lib/dynamic-form/interfaces/koala.dynamic-form-show-field.interface.mjs} +0 -0
- package/form/{esm2015/lib/dynamic-form/interfaces/koala.dynamic-set-value.interface.js → esm2020/lib/dynamic-form/interfaces/koala.dynamic-set-value.interface.mjs} +0 -0
- package/form/esm2020/lib/dynamic-form/koala.dynamic-form.service.mjs +199 -0
- package/form/{esm2015/lib/dynamic-form/validators/autocomplete-selected.validator.js → esm2020/lib/dynamic-form/validators/autocomplete-selected.validator.mjs} +0 -0
- package/form/{esm2015/lib/dynamic-form/validators/cnpj.validator.js → esm2020/lib/dynamic-form/validators/cnpj.validator.mjs} +0 -0
- package/form/{esm2015/lib/dynamic-form/validators/cpf.validator.js → esm2020/lib/dynamic-form/validators/cpf.validator.mjs} +0 -0
- package/form/{esm2015/lib/dynamic-form/validators/date-max.validator.js → esm2020/lib/dynamic-form/validators/date-max.validator.mjs} +0 -0
- package/form/{esm2015/lib/dynamic-form/validators/date-min.validator.js → esm2020/lib/dynamic-form/validators/date-min.validator.mjs} +0 -0
- package/form/{esm2015/lib/dynamic-form/validators/koala-dynamic-form-validator-result.helper.js → esm2020/lib/dynamic-form/validators/koala-dynamic-form-validator-result.helper.mjs} +0 -0
- package/form/{esm2015/lib/dynamic-form/validators/validation.helper.js → esm2020/lib/dynamic-form/validators/validation.helper.mjs} +0 -0
- package/form/{esm2015/lib/form.abstract.js → esm2020/lib/form.abstract.mjs} +0 -0
- package/form/esm2020/lib/koala.form.module.mjs +134 -0
- package/form/{esm2015/lib/show-invalid-fields/show-invalid-fields.js → esm2020/lib/show-invalid-fields/show-invalid-fields.mjs} +0 -0
- package/form/fesm2015/koalarx-ui-form.mjs +1575 -0
- package/form/fesm2015/koalarx-ui-form.mjs.map +1 -0
- package/form/fesm2020/koalarx-ui-form.mjs +1557 -0
- package/form/fesm2020/koalarx-ui-form.mjs.map +1 -0
- package/form/koalarx-ui-form.d.ts +1 -0
- package/form/lib/btn-submit/btn-submit.component.d.ts +3 -0
- package/form/lib/directives/koala-autofocus.directive.d.ts +3 -0
- package/form/lib/dynamic-form/dynamic-form.component.d.ts +7 -1
- package/form/lib/dynamic-form/koala.dynamic-form.service.d.ts +3 -0
- package/form/lib/koala.form.module.d.ts +23 -0
- package/form/package.json +18 -6
- package/icon/{esm2015/index.js → esm2020/index.mjs} +2 -1
- package/icon/{esm2015/koalarx-ui-icon.js → esm2020/koalarx-ui-icon.mjs} +0 -0
- package/icon/esm2020/lib/icon.component.mjs +46 -0
- package/icon/esm2020/lib/koala.icon.module.mjs +26 -0
- package/icon/esm2020/lib/koala.icon.type.mjs +2 -0
- package/icon/fesm2015/koalarx-ui-icon.mjs +77 -0
- package/icon/{esm2015/lib/icon.component.js → fesm2015/koalarx-ui-icon.mjs.map} +1 -45
- package/icon/fesm2020/koalarx-ui-icon.mjs +76 -0
- package/icon/{fesm2015/koalarx-ui-icon.js → fesm2020/koalarx-ui-icon.mjs.map} +1 -69
- package/icon/index.d.ts +1 -0
- package/icon/koalarx-ui-icon.d.ts +1 -0
- package/icon/lib/icon.component.d.ts +4 -1
- package/icon/lib/koala.icon.module.d.ts +6 -0
- package/icon/lib/koala.icon.type.d.ts +1 -0
- package/icon/package.json +18 -6
- package/icons-animated/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/icons-animated/esm2020/koalarx-ui-icons-animated.mjs +5 -0
- package/icons-animated/esm2020/lib/icons/downloading/downloading-icon-animated.component.mjs +23 -0
- package/icons-animated/esm2020/lib/icons/loading/loading-icon-animated.component.mjs +23 -0
- package/icons-animated/esm2020/lib/icons-animated.component.mjs +20 -0
- package/icons-animated/esm2020/lib/icons-animated.service.mjs +32 -0
- package/icons-animated/esm2020/lib/koala-icons-animated.module.mjs +32 -0
- package/icons-animated/fesm2015/koalarx-ui-icons-animated.mjs +122 -0
- package/icons-animated/fesm2015/koalarx-ui-icons-animated.mjs.map +1 -0
- package/icons-animated/fesm2020/koalarx-ui-icons-animated.mjs +120 -0
- package/icons-animated/fesm2020/koalarx-ui-icons-animated.mjs.map +1 -0
- package/icons-animated/koalarx-ui-icons-animated.d.ts +1 -1
- package/icons-animated/lib/icons/downloading/downloading-icon-animated.component.d.ts +5 -2
- package/icons-animated/lib/icons/loading/loading-icon-animated.component.d.ts +5 -2
- package/icons-animated/lib/icons-animated.component.d.ts +3 -0
- package/icons-animated/lib/icons-animated.service.d.ts +3 -0
- package/icons-animated/lib/koala-icons-animated.module.d.ts +8 -0
- package/icons-animated/package.json +18 -6
- package/list/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/list/{esm2015/koalarx-ui-list.js → esm2020/koalarx-ui-list.mjs} +0 -0
- package/list/{esm2015/lib/koala-list-btn-collapse-sub-list-config.interface.js → esm2020/lib/koala-list-btn-collapse-sub-list-config.interface.mjs} +0 -0
- package/list/{esm2015/lib/koala-list-filter.interface.js → esm2020/lib/koala-list-filter.interface.mjs} +0 -0
- package/list/{esm2015/lib/koala-list-form-filter.interface.js → esm2020/lib/koala-list-form-filter.interface.mjs} +0 -0
- package/list/{esm2015/lib/koala-list-item-menu-option.interface.js → esm2020/lib/koala-list-item-menu-option.interface.mjs} +0 -0
- package/list/{esm2015/lib/koala-list-item.interface.js → esm2020/lib/koala-list-item.interface.mjs} +0 -0
- package/list/{esm2015/lib/koala.list-config.interface.js → esm2020/lib/koala.list-config.interface.mjs} +0 -0
- package/list/esm2020/lib/koala.list.module.mjs +70 -0
- package/list/esm2020/lib/koala.list.service.mjs +15 -0
- package/list/esm2020/lib/list-builder/list.builder.mjs +97 -0
- package/list/esm2020/lib/list.abstract.mjs +157 -0
- package/list/esm2020/lib/list.component.mjs +171 -0
- package/list/esm2020/lib/providers/pagination/pagination.provider.mjs +32 -0
- package/list/fesm2015/koalarx-ui-list.mjs +559 -0
- package/list/fesm2015/koalarx-ui-list.mjs.map +1 -0
- package/list/fesm2020/koalarx-ui-list.mjs +529 -0
- package/list/fesm2020/koalarx-ui-list.mjs.map +1 -0
- package/list/koalarx-ui-list.d.ts +1 -0
- package/list/lib/koala.list.module.d.ts +15 -0
- package/list/lib/koala.list.service.d.ts +3 -0
- package/list/lib/list.component.d.ts +3 -0
- package/list/lib/providers/pagination/pagination.provider.d.ts +3 -0
- package/list/package.json +18 -6
- package/menu/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/menu/{esm2015/koalarx-ui-menu.js → esm2020/koalarx-ui-menu.mjs} +0 -0
- package/menu/{esm2015/lib/koala.menu-module.interface.js → esm2020/lib/koala.menu-module.interface.mjs} +0 -0
- package/menu/{esm2015/lib/koala.menu-tool.interface.js → esm2020/lib/koala.menu-tool.interface.mjs} +0 -0
- package/menu/esm2020/lib/koala.menu.module.mjs +38 -0
- package/menu/esm2020/lib/koala.menu.service.mjs +24 -0
- package/menu/esm2020/lib/menu.component.mjs +100 -0
- package/menu/fesm2015/koalarx-ui-menu.mjs +167 -0
- package/menu/fesm2015/koalarx-ui-menu.mjs.map +1 -0
- package/menu/fesm2020/koalarx-ui-menu.mjs +162 -0
- package/menu/fesm2020/koalarx-ui-menu.mjs.map +1 -0
- package/menu/koalarx-ui-menu.d.ts +1 -0
- package/menu/lib/koala.menu.module.d.ts +9 -0
- package/menu/lib/koala.menu.service.d.ts +3 -0
- package/menu/lib/menu.component.d.ts +6 -0
- package/menu/package.json +18 -6
- package/package.json +10 -9
- package/question/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/question/{esm2015/koalarx-ui-question.js → esm2020/koalarx-ui-question.mjs} +0 -0
- package/question/esm2020/lib/dialog-question.component.mjs +25 -0
- package/question/{esm2015/lib/koala-question-config.interface.js → esm2020/lib/koala-question-config.interface.mjs} +0 -0
- package/question/esm2020/lib/koala.question.module.mjs +42 -0
- package/question/esm2020/lib/koala.question.service.mjs +26 -0
- package/question/fesm2015/koalarx-ui-question.mjs +95 -0
- package/question/fesm2015/koalarx-ui-question.mjs.map +1 -0
- package/question/fesm2020/koalarx-ui-question.mjs +93 -0
- package/question/fesm2020/koalarx-ui-question.mjs.map +1 -0
- package/question/koalarx-ui-question.d.ts +1 -0
- package/question/lib/dialog-question.component.d.ts +3 -0
- package/question/lib/koala.question.module.d.ts +10 -0
- package/question/lib/koala.question.service.d.ts +3 -0
- package/question/package.json +18 -6
- package/snackbar/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/snackbar/{esm2015/koalarx-ui-snackbar.js → esm2020/koalarx-ui-snackbar.mjs} +0 -0
- package/snackbar/esm2020/lib/koala.snackbar.component.mjs +22 -0
- package/snackbar/{esm2015/lib/koala.snackbar.interface.js → esm2020/lib/koala.snackbar.interface.mjs} +0 -0
- package/snackbar/esm2020/lib/koala.snackbar.module.mjs +38 -0
- package/snackbar/esm2020/lib/koala.snackbar.service.mjs +35 -0
- package/snackbar/fesm2015/koalarx-ui-snackbar.mjs +95 -0
- package/snackbar/fesm2015/koalarx-ui-snackbar.mjs.map +1 -0
- package/snackbar/fesm2020/koalarx-ui-snackbar.mjs +93 -0
- package/snackbar/fesm2020/koalarx-ui-snackbar.mjs.map +1 -0
- package/snackbar/koalarx-ui-snackbar.d.ts +1 -0
- package/snackbar/lib/koala.snackbar.component.d.ts +3 -0
- package/snackbar/lib/koala.snackbar.module.d.ts +8 -0
- package/snackbar/lib/koala.snackbar.service.d.ts +3 -0
- package/snackbar/package.json +18 -6
- package/alert/bundles/koalarx-ui-alert.umd.js +0 -153
- package/alert/bundles/koalarx-ui-alert.umd.js.map +0 -1
- package/alert/esm2015/lib/dialog-alert.component.js +0 -43
- package/alert/esm2015/lib/koala.alert.module.js +0 -31
- package/alert/esm2015/lib/koala.alert.service.js +0 -21
- package/alert/fesm2015/koalarx-ui-alert.js +0 -121
- package/alert/fesm2015/koalarx-ui-alert.js.map +0 -1
- package/alert/koalarx-ui-alert.metadata.json +0 -1
- package/button/bundles/koalarx-ui-button.umd.js +0 -71
- package/button/bundles/koalarx-ui-button.umd.js.map +0 -1
- package/button/esm2015/lib/button.component.js +0 -31
- package/button/esm2015/lib/koala.button.module.js +0 -27
- package/button/fesm2015/koalarx-ui-button.js +0 -63
- package/button/fesm2015/koalarx-ui-button.js.map +0 -1
- package/button/koalarx-ui-button.metadata.json +0 -1
- package/common/bundles/koalarx-ui-common.umd.js +0 -481
- package/common/bundles/koalarx-ui-common.umd.js.map +0 -1
- package/common/esm2015/lib/services/csv/koala.csv.service.js +0 -38
- package/common/esm2015/lib/services/xlsx/koala.xlsx.service.js +0 -74
- package/common/fesm2015/koalarx-ui-common.js.map +0 -1
- package/common/koalarx-ui-common.metadata.json +0 -1
- package/core/bundles/koalarx-ui-core.umd.js +0 -1716
- package/core/bundles/koalarx-ui-core.umd.js.map +0 -1
- package/core/esm2015/index.js +0 -34
- package/core/esm2015/koalarx-ui-core.js +0 -7
- package/core/esm2015/lib/loader/loader-bar-page.component.js +0 -22
- package/core/esm2015/lib/ngx-koala.module.js +0 -35
- package/core/esm2015/lib/page/koala.page.module.js +0 -46
- package/core/esm2015/lib/page/notifications/notification.component.js +0 -43
- package/core/esm2015/lib/page/page.component.js +0 -396
- package/core/esm2015/lib/router/koala.parameter-hash-location-stategy.js +0 -16
- package/core/esm2015/lib/services/api-requester/factory/koala.response.factory.js +0 -48
- package/core/esm2015/lib/services/api-requester/koala.api-requester.base.js +0 -70
- package/core/esm2015/lib/services/api-requester/koala.api-requester.service.js +0 -134
- package/core/esm2015/lib/services/loader/koala.loader.service.js +0 -32
- package/core/esm2015/lib/services/openid/koala.oauth.config.js +0 -33
- package/core/esm2015/lib/services/openid/koala.oauth2.service.js +0 -201
- package/core/esm2015/lib/services/request/koala.request.service.js +0 -53
- package/core/esm2015/lib/services/token/token.factory.js +0 -31
- package/core/fesm2015/koalarx-ui-core.js.map +0 -1
- package/core/koalarx-ui-core.metadata.json +0 -1
- package/dialog/bundles/koalarx-ui-dialog.umd.js +0 -139
- package/dialog/bundles/koalarx-ui-dialog.umd.js.map +0 -1
- package/dialog/esm2015/lib/dialog.component.js +0 -18
- package/dialog/esm2015/lib/koala.dialog.module.js +0 -25
- package/dialog/esm2015/lib/koala.dialog.service.js +0 -61
- package/dialog/fesm2015/koalarx-ui-dialog.js +0 -107
- package/dialog/fesm2015/koalarx-ui-dialog.js.map +0 -1
- package/dialog/koalarx-ui-dialog.metadata.json +0 -1
- package/dynamic-component/bundles/koalarx-ui-dynamic-component.umd.js +0 -95
- package/dynamic-component/bundles/koalarx-ui-dynamic-component.umd.js.map +0 -1
- package/dynamic-component/esm2015/lib/koala-dynamic-component.directive.js +0 -15
- package/dynamic-component/esm2015/lib/koala-dynamic-component.factory.js +0 -38
- package/dynamic-component/esm2015/lib/koala-dynamic-component.module.js +0 -17
- package/dynamic-component/fesm2015/koalarx-ui-dynamic-component.js +0 -79
- package/dynamic-component/fesm2015/koalarx-ui-dynamic-component.js.map +0 -1
- package/dynamic-component/koalarx-ui-dynamic-component.metadata.json +0 -1
- package/file-button/bundles/koalarx-ui-file-button.umd.js +0 -553
- package/file-button/bundles/koalarx-ui-file-button.umd.js.map +0 -1
- package/file-button/esm2015/lib/file-button.component.js +0 -118
- package/file-button/esm2015/lib/koala.btn-file.service.js +0 -26
- package/file-button/esm2015/lib/koala.file-button.module.js +0 -25
- package/file-button/fesm2015/koalarx-ui-file-button.js +0 -171
- package/file-button/fesm2015/koalarx-ui-file-button.js.map +0 -1
- package/file-button/koalarx-ui-file-button.metadata.json +0 -1
- package/folder-page/bundles/koalarx-ui-folder-page.umd.js +0 -97
- package/folder-page/bundles/koalarx-ui-folder-page.umd.js.map +0 -1
- package/folder-page/esm2015/lib/folder.component.js +0 -56
- package/folder-page/esm2015/lib/koala.folder-page.module.js +0 -27
- package/folder-page/fesm2015/koalarx-ui-folder-page.js +0 -88
- package/folder-page/fesm2015/koalarx-ui-folder-page.js.map +0 -1
- package/folder-page/koalarx-ui-folder-page.metadata.json +0 -1
- package/form/bundles/koalarx-ui-form.umd.js +0 -1969
- package/form/bundles/koalarx-ui-form.umd.js.map +0 -1
- package/form/esm2015/lib/btn-submit/btn-submit.component.js +0 -39
- package/form/esm2015/lib/directives/koala-autofocus.directive.js +0 -25
- package/form/esm2015/lib/dynamic-form/builder/dynamic-form.builder.js +0 -141
- package/form/esm2015/lib/dynamic-form/builder/fields/field.base.js +0 -151
- package/form/esm2015/lib/dynamic-form/builder/fields/more-items.builder.js +0 -57
- package/form/esm2015/lib/dynamic-form/dynamic-form.component.js +0 -564
- package/form/esm2015/lib/dynamic-form/koala.dynamic-form.service.js +0 -204
- package/form/esm2015/lib/koala.form.module.js +0 -69
- package/form/fesm2015/koalarx-ui-form.js +0 -1487
- package/form/fesm2015/koalarx-ui-form.js.map +0 -1
- package/form/koalarx-ui-form.metadata.json +0 -1
- package/icon/bundles/koalarx-ui-icon.umd.js +0 -76
- package/icon/bundles/koalarx-ui-icon.umd.js.map +0 -1
- package/icon/esm2015/lib/koala.icon.module.js +0 -19
- package/icon/fesm2015/koalarx-ui-icon.js.map +0 -1
- package/icon/koalarx-ui-icon.metadata.json +0 -1
- package/icons-animated/bundles/koalarx-ui-icons-animated.umd.js +0 -138
- package/icons-animated/bundles/koalarx-ui-icons-animated.umd.js.map +0 -1
- package/icons-animated/esm2015/koalarx-ui-icons-animated.js +0 -6
- package/icons-animated/esm2015/lib/icons/downloading/downloading-icon-animated.component.js +0 -28
- package/icons-animated/esm2015/lib/icons/loading/loading-icon-animated.component.js +0 -28
- package/icons-animated/esm2015/lib/icons-animated.component.js +0 -15
- package/icons-animated/esm2015/lib/icons-animated.service.js +0 -29
- package/icons-animated/esm2015/lib/koala-icons-animated.module.js +0 -23
- package/icons-animated/fesm2015/koalarx-ui-icons-animated.js +0 -121
- package/icons-animated/fesm2015/koalarx-ui-icons-animated.js.map +0 -1
- package/icons-animated/koalarx-ui-icons-animated.metadata.json +0 -1
- package/list/bundles/koalarx-ui-list.umd.js +0 -914
- package/list/bundles/koalarx-ui-list.umd.js.map +0 -1
- package/list/esm2015/lib/koala.list.module.js +0 -42
- package/list/esm2015/lib/koala.list.service.js +0 -13
- package/list/esm2015/lib/list-builder/list.builder.js +0 -101
- package/list/esm2015/lib/list.abstract.js +0 -174
- package/list/esm2015/lib/list.component.js +0 -166
- package/list/esm2015/lib/providers/pagination/pagination.provider.js +0 -30
- package/list/fesm2015/koalarx-ui-list.js +0 -514
- package/list/fesm2015/koalarx-ui-list.js.map +0 -1
- package/list/koalarx-ui-list.metadata.json +0 -1
- package/menu/bundles/koalarx-ui-menu.umd.js +0 -511
- package/menu/bundles/koalarx-ui-menu.umd.js.map +0 -1
- package/menu/esm2015/lib/koala.menu.module.js +0 -25
- package/menu/esm2015/lib/koala.menu.service.js +0 -22
- package/menu/esm2015/lib/menu.component.js +0 -104
- package/menu/fesm2015/koalarx-ui-menu.js +0 -153
- package/menu/fesm2015/koalarx-ui-menu.js.map +0 -1
- package/menu/koalarx-ui-menu.metadata.json +0 -1
- package/question/bundles/koalarx-ui-question.umd.js +0 -104
- package/question/bundles/koalarx-ui-question.umd.js.map +0 -1
- package/question/esm2015/lib/dialog-question.component.js +0 -20
- package/question/esm2015/lib/koala.question.module.js +0 -27
- package/question/esm2015/lib/koala.question.service.js +0 -28
- package/question/fesm2015/koalarx-ui-question.js +0 -77
- package/question/fesm2015/koalarx-ui-question.js.map +0 -1
- package/question/koalarx-ui-question.metadata.json +0 -1
- package/snackbar/bundles/koalarx-ui-snackbar.umd.js +0 -93
- package/snackbar/bundles/koalarx-ui-snackbar.umd.js.map +0 -1
- package/snackbar/esm2015/lib/koala.snackbar.component.js +0 -20
- package/snackbar/esm2015/lib/koala.snackbar.module.js +0 -26
- package/snackbar/esm2015/lib/koala.snackbar.service.js +0 -35
- package/snackbar/fesm2015/koalarx-ui-snackbar.js +0 -81
- package/snackbar/fesm2015/koalarx-ui-snackbar.js.map +0 -1
- package/snackbar/koalarx-ui-snackbar.metadata.json +0 -1
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { __awaiter } from 'tslib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Input, Output, ViewChild, NgModule } from '@angular/core';
|
|
4
|
+
import { BehaviorSubject } from 'rxjs';
|
|
5
|
+
import * as i1 from '@angular/material/button';
|
|
6
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
7
|
+
import * as i2 from '@angular/material/icon';
|
|
8
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
9
|
+
import * as i3 from '@angular/common';
|
|
10
|
+
import { CommonModule } from '@angular/common';
|
|
11
|
+
import * as i4 from '@angular/material/tooltip';
|
|
12
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
13
|
+
|
|
14
|
+
class KoalaBtnFileService {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.setFileSubject = new BehaviorSubject(null);
|
|
17
|
+
this.fileListSubject = new BehaviorSubject([]);
|
|
18
|
+
}
|
|
19
|
+
setFile(file) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
if (file) {
|
|
22
|
+
this.setFileSubject.next(file);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
removeFile(files, index) {
|
|
27
|
+
files.splice(index, 1);
|
|
28
|
+
this.fileListSubject.next(files);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
KoalaBtnFileService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaBtnFileService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
32
|
+
KoalaBtnFileService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaBtnFileService, providedIn: "any" });
|
|
33
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaBtnFileService, decorators: [{
|
|
34
|
+
type: Injectable,
|
|
35
|
+
args: [{ providedIn: "any" }]
|
|
36
|
+
}] });
|
|
37
|
+
|
|
38
|
+
class FileButtonComponent {
|
|
39
|
+
constructor() {
|
|
40
|
+
this.autoclear = true;
|
|
41
|
+
this.getFiles = new EventEmitter();
|
|
42
|
+
this.files = [];
|
|
43
|
+
this.textSubject = new BehaviorSubject('');
|
|
44
|
+
}
|
|
45
|
+
ngOnInit() {
|
|
46
|
+
var _a;
|
|
47
|
+
this.style = `color: ${this.color}!important;background-color: ${this.backgroundColor}!important;`;
|
|
48
|
+
this.textSubject.next((_a = this.text) !== null && _a !== void 0 ? _a : '');
|
|
49
|
+
if (this.setFile) {
|
|
50
|
+
this.setFile.subscribe((file) => __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
if (file) {
|
|
52
|
+
const fileResult = yield this.convertFile(file);
|
|
53
|
+
if (fileResult) {
|
|
54
|
+
this.files.push(fileResult);
|
|
55
|
+
}
|
|
56
|
+
this.generateTextButton();
|
|
57
|
+
this.getFiles.emit(this.files);
|
|
58
|
+
}
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
if (this.updateFileList) {
|
|
62
|
+
this.updateFileList.subscribe((fileList) => {
|
|
63
|
+
this.files = fileList;
|
|
64
|
+
this.generateTextButton();
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
emitFiles(files) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
if (files) {
|
|
71
|
+
if ((files === null || files === void 0 ? void 0 : files.length) > 0) {
|
|
72
|
+
for (let f = 0; f <= files.length; f++) {
|
|
73
|
+
const file = files.item(f);
|
|
74
|
+
if (file) {
|
|
75
|
+
const fileResult = yield this.convertFile(file);
|
|
76
|
+
if (fileResult) {
|
|
77
|
+
this.files.push(fileResult);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
this.getFiles.emit(this.files);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
this.getFiles.emit([]);
|
|
85
|
+
}
|
|
86
|
+
this.generateTextButton();
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
open() {
|
|
91
|
+
var _a;
|
|
92
|
+
const elFile = (_a = this.file) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
93
|
+
if (elFile)
|
|
94
|
+
elFile.value = '';
|
|
95
|
+
if (this.autoclear) {
|
|
96
|
+
this.files = [];
|
|
97
|
+
this.getFiles.emit([]);
|
|
98
|
+
this.generateTextButton();
|
|
99
|
+
}
|
|
100
|
+
elFile === null || elFile === void 0 ? void 0 : elFile.click();
|
|
101
|
+
}
|
|
102
|
+
generateTextButton() {
|
|
103
|
+
var _a;
|
|
104
|
+
this.textSubject.next(this.files.length > 0
|
|
105
|
+
? `${this.files.length} arquivo${this.files.length > 1 ? 's' : ''} selecionado`
|
|
106
|
+
: (_a = this.text) !== null && _a !== void 0 ? _a : '');
|
|
107
|
+
}
|
|
108
|
+
convertFile(file) {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
const blobFile = yield new Promise((resolve) => {
|
|
111
|
+
const fileReader = new FileReader();
|
|
112
|
+
fileReader.readAsDataURL(file);
|
|
113
|
+
fileReader.onload = () => {
|
|
114
|
+
resolve(fileReader.result);
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
if (blobFile) {
|
|
118
|
+
const fileSplit = blobFile.toString().split(';base64,');
|
|
119
|
+
return {
|
|
120
|
+
filename: file.name,
|
|
121
|
+
type: fileSplit[0].replace('data:', ''),
|
|
122
|
+
base64: fileSplit[1],
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
return null;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
FileButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: FileButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
130
|
+
FileButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: FileButtonComponent, selector: "koala-file-button", inputs: { color: "color", backgroundColor: "backgroundColor", icon: "icon", text: "text", tooltip: "tooltip", disabled: "disabled", multiple: "multiple", accept: "accept", setFile: "setFile", updateFileList: "updateFileList", autoclear: "autoclear" }, outputs: { getFiles: "getFiles" }, viewQueries: [{ propertyName: "file", first: true, predicate: ["file"], descendants: true, static: true }], ngImport: i0, template: "<input #file (change)=\"emitFiles(file.files)\" [accept]=\"accept\" [multiple]=\"multiple\"\n style=\"display: none;\"\n type=\"file\"/>\n<button\n\t(click)=\"open()\"\n\t*ngIf=\"text else iconButton\"\n\t[disabled]=\"disabled\"\n\t[matTooltipDisabled]=\"!tooltip\"\n\t[matTooltip]=\"tooltip ?? ''\"\n [style]=\"style\"\n\tclass=\"koala-button\"\n\tmat-button\n\tmatTooltipPosition=\"above\"\n\ttype=\"button\">\n <mat-icon *ngIf=\"icon\">{{icon}}</mat-icon>\n\t{{textSubject | async}}\n</button>\n<ng-template #iconButton>\n <button\n\t (click)=\"open()\"\n\t [disabled]=\"disabled\"\n\t [matTooltipDisabled]=\"!tooltip\"\n\t [matTooltip]=\"tooltip ?? ''\"\n [style]=\"style\"\n\t class=\"koala-icon-button\"\n\t mat-icon-button\n\t matTooltipPosition=\"before\"\n\t type=\"button\">\n <mat-icon>{{icon}}</mat-icon>\n </button>\n</ng-template>\n", styles: [".koala-button{padding:2px 8px}.koala-icon-button:disabled,.koala-button:disabled{background:#cccccc!important;color:#616161!important;cursor:not-allowed}.koala-icon-button{height:25px;line-height:25px;width:25px}.koala-icon-button mat-icon{font-size:20px;height:20px;line-height:20px;position:relative;width:20px}\n"], components: [{ type: i1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
131
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: FileButtonComponent, decorators: [{
|
|
132
|
+
type: Component,
|
|
133
|
+
args: [{ selector: 'koala-file-button', changeDetection: ChangeDetectionStrategy.OnPush, template: "<input #file (change)=\"emitFiles(file.files)\" [accept]=\"accept\" [multiple]=\"multiple\"\n style=\"display: none;\"\n type=\"file\"/>\n<button\n\t(click)=\"open()\"\n\t*ngIf=\"text else iconButton\"\n\t[disabled]=\"disabled\"\n\t[matTooltipDisabled]=\"!tooltip\"\n\t[matTooltip]=\"tooltip ?? ''\"\n [style]=\"style\"\n\tclass=\"koala-button\"\n\tmat-button\n\tmatTooltipPosition=\"above\"\n\ttype=\"button\">\n <mat-icon *ngIf=\"icon\">{{icon}}</mat-icon>\n\t{{textSubject | async}}\n</button>\n<ng-template #iconButton>\n <button\n\t (click)=\"open()\"\n\t [disabled]=\"disabled\"\n\t [matTooltipDisabled]=\"!tooltip\"\n\t [matTooltip]=\"tooltip ?? ''\"\n [style]=\"style\"\n\t class=\"koala-icon-button\"\n\t mat-icon-button\n\t matTooltipPosition=\"before\"\n\t type=\"button\">\n <mat-icon>{{icon}}</mat-icon>\n </button>\n</ng-template>\n", styles: [".koala-button{padding:2px 8px}.koala-icon-button:disabled,.koala-button:disabled{background:#cccccc!important;color:#616161!important;cursor:not-allowed}.koala-icon-button{height:25px;line-height:25px;width:25px}.koala-icon-button mat-icon{font-size:20px;height:20px;line-height:20px;position:relative;width:20px}\n"] }]
|
|
134
|
+
}], propDecorators: { color: [{
|
|
135
|
+
type: Input
|
|
136
|
+
}], backgroundColor: [{
|
|
137
|
+
type: Input
|
|
138
|
+
}], icon: [{
|
|
139
|
+
type: Input
|
|
140
|
+
}], text: [{
|
|
141
|
+
type: Input
|
|
142
|
+
}], tooltip: [{
|
|
143
|
+
type: Input
|
|
144
|
+
}], disabled: [{
|
|
145
|
+
type: Input
|
|
146
|
+
}], multiple: [{
|
|
147
|
+
type: Input
|
|
148
|
+
}], accept: [{
|
|
149
|
+
type: Input
|
|
150
|
+
}], setFile: [{
|
|
151
|
+
type: Input
|
|
152
|
+
}], updateFileList: [{
|
|
153
|
+
type: Input
|
|
154
|
+
}], autoclear: [{
|
|
155
|
+
type: Input
|
|
156
|
+
}], getFiles: [{
|
|
157
|
+
type: Output
|
|
158
|
+
}], file: [{
|
|
159
|
+
type: ViewChild,
|
|
160
|
+
args: ['file', { static: true }]
|
|
161
|
+
}] } });
|
|
162
|
+
|
|
163
|
+
class KoalaFileButtonModule {
|
|
164
|
+
}
|
|
165
|
+
KoalaFileButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaFileButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
166
|
+
KoalaFileButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaFileButtonModule, declarations: [FileButtonComponent], imports: [CommonModule,
|
|
167
|
+
MatTooltipModule,
|
|
168
|
+
MatButtonModule,
|
|
169
|
+
MatIconModule], exports: [FileButtonComponent] });
|
|
170
|
+
KoalaFileButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaFileButtonModule, imports: [[
|
|
171
|
+
CommonModule,
|
|
172
|
+
MatTooltipModule,
|
|
173
|
+
MatButtonModule,
|
|
174
|
+
MatIconModule
|
|
175
|
+
]] });
|
|
176
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaFileButtonModule, decorators: [{
|
|
177
|
+
type: NgModule,
|
|
178
|
+
args: [{
|
|
179
|
+
exports: [
|
|
180
|
+
FileButtonComponent
|
|
181
|
+
],
|
|
182
|
+
declarations: [
|
|
183
|
+
FileButtonComponent
|
|
184
|
+
],
|
|
185
|
+
imports: [
|
|
186
|
+
CommonModule,
|
|
187
|
+
MatTooltipModule,
|
|
188
|
+
MatButtonModule,
|
|
189
|
+
MatIconModule
|
|
190
|
+
]
|
|
191
|
+
}]
|
|
192
|
+
}] });
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Generated bundle index. Do not edit.
|
|
196
|
+
*/
|
|
197
|
+
|
|
198
|
+
export { FileButtonComponent, KoalaBtnFileService, KoalaFileButtonModule };
|
|
199
|
+
//# sourceMappingURL=koalarx-ui-file-button.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"koalarx-ui-file-button.mjs","sources":["../../../projects/file-button/src/lib/koala.btn-file.service.ts","../../../projects/file-button/src/lib/file-button.component.ts","../../../projects/file-button/src/lib/file-button.component.html","../../../projects/file-button/src/lib/koala.file-button.module.ts","../../../projects/file-button/src/koalarx-ui-file-button.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { KoalaFileInterface } from './koala.file.interface';\n\n@Injectable({providedIn: \"any\"})\nexport class KoalaBtnFileService {\n\tpublic setFileSubject = new BehaviorSubject<File|null>(null);\n\tpublic fileListSubject = new BehaviorSubject<KoalaFileInterface[]>([]);\n\n\tpublic async setFile(file: File) {\n\t\tif (file) {\n\t\t\tthis.setFileSubject.next(file);\n\t\t}\n\t}\n\n\tpublic removeFile(files: KoalaFileInterface[], index: number) {\n\t\tfiles.splice(index, 1);\n\t\tthis.fileListSubject.next(files);\n\t}\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { KoalaFileInterface } from './koala.file.interface';\nimport { BehaviorSubject } from 'rxjs';\n\n@Component({\n selector: 'koala-file-button',\n templateUrl: 'file-button.component.html',\n styleUrls: ['file-button.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FileButtonComponent implements OnInit {\n @Input() color?: string;\n @Input() backgroundColor?: string;\n @Input() icon?: string;\n @Input() text?: string;\n @Input() tooltip?: string;\n @Input() disabled?: boolean;\n @Input() multiple?: boolean;\n @Input() accept?: string;\n @Input() setFile?: BehaviorSubject<File>;\n @Input() updateFileList?: BehaviorSubject<KoalaFileInterface[]>;\n @Input() autoclear = true;\n @Output() getFiles = new EventEmitter<KoalaFileInterface[]>();\n public files: KoalaFileInterface[] = [];\n public style?: string;\n\n @ViewChild('file', { static: true }) private file?: ElementRef<HTMLInputElement>;\n\n public textSubject = new BehaviorSubject<string>('');\n\n ngOnInit() {\n this.style = `color: ${this.color}!important;background-color: ${this.backgroundColor}!important;`;\n this.textSubject.next(this.text ?? '');\n if (this.setFile) {\n this.setFile.subscribe(async (file) => {\n if (file) {\n const fileResult = await this.convertFile(file);\n if (fileResult) {\n this.files.push(fileResult);\n }\n this.generateTextButton();\n this.getFiles.emit(this.files);\n }\n });\n }\n\n if (this.updateFileList) {\n this.updateFileList.subscribe((fileList) => {\n this.files = fileList;\n this.generateTextButton();\n });\n }\n }\n\n public async emitFiles(files: FileList | null) {\n if (files) {\n if (files?.length > 0) {\n for (let f = 0; f <= files.length; f++) {\n const file = files.item(f);\n if (file) {\n const fileResult = await this.convertFile(file);\n if (fileResult) {\n this.files.push(fileResult);\n }\n }\n }\n\n this.getFiles.emit(this.files);\n } else {\n this.getFiles.emit([]);\n }\n this.generateTextButton();\n }\n }\n\n public open() {\n const elFile = this.file?.nativeElement;\n if (elFile) elFile.value = '';\n if (this.autoclear) {\n this.files = [];\n this.getFiles.emit([]);\n this.generateTextButton();\n }\n elFile?.click();\n }\n\n private generateTextButton() {\n this.textSubject.next(\n this.files.length > 0\n ? `${this.files.length} arquivo${this.files.length > 1 ? 's' : ''} selecionado`\n : this.text ?? '',\n );\n }\n\n private async convertFile(file: File): Promise<KoalaFileInterface | null> {\n const blobFile = await new Promise<string | ArrayBuffer | null>((resolve) => {\n const fileReader = new FileReader();\n fileReader.readAsDataURL(file);\n fileReader.onload = () => {\n resolve(fileReader.result);\n };\n });\n if (blobFile) {\n const fileSplit = blobFile.toString().split(';base64,');\n return {\n filename: file.name,\n type: fileSplit[0].replace('data:', ''),\n base64: fileSplit[1],\n };\n }\n\n return null;\n }\n}\n","<input #file (change)=\"emitFiles(file.files)\" [accept]=\"accept\" [multiple]=\"multiple\"\n style=\"display: none;\"\n type=\"file\"/>\n<button\n\t(click)=\"open()\"\n\t*ngIf=\"text else iconButton\"\n\t[disabled]=\"disabled\"\n\t[matTooltipDisabled]=\"!tooltip\"\n\t[matTooltip]=\"tooltip ?? ''\"\n [style]=\"style\"\n\tclass=\"koala-button\"\n\tmat-button\n\tmatTooltipPosition=\"above\"\n\ttype=\"button\">\n <mat-icon *ngIf=\"icon\">{{icon}}</mat-icon>\n\t{{textSubject | async}}\n</button>\n<ng-template #iconButton>\n <button\n\t (click)=\"open()\"\n\t [disabled]=\"disabled\"\n\t [matTooltipDisabled]=\"!tooltip\"\n\t [matTooltip]=\"tooltip ?? ''\"\n [style]=\"style\"\n\t class=\"koala-icon-button\"\n\t mat-icon-button\n\t matTooltipPosition=\"before\"\n\t type=\"button\">\n <mat-icon>{{icon}}</mat-icon>\n </button>\n</ng-template>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { FileButtonComponent } from './file-button.component';\n\n@NgModule({\n exports: [\n FileButtonComponent\n ],\n\tdeclarations: [\n\t\tFileButtonComponent\n\t],\n\timports: [\n\t\tCommonModule,\n\t\tMatTooltipModule,\n\t\tMatButtonModule,\n\t\tMatIconModule\n\t]\n})\nexport class KoalaFileButtonModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;MAKa,mBAAmB;IADhC;QAEQ,mBAAc,GAAG,IAAI,eAAe,CAAY,IAAI,CAAC,CAAC;QACtD,oBAAe,GAAG,IAAI,eAAe,CAAuB,EAAE,CAAC,CAAC;KAYvE;IAVa,OAAO,CAAC,IAAU;;YAC9B,IAAI,IAAI,EAAE;gBACT,IAAI,CAAC,cAAc,C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,KAAK;gBACG,MAAM;sBAAd,KAAK;gBACG,OAAO;sBAAf,KAAK;gBACG,cAAc;sBAAtB,KAAK;gBACG,SAAS;sBAAjB,KAAK;gBACI,QAAQ;sBAAjB,MAAM;gBAIsC,IAAI;sBAAhD,SAAS;uBAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;;MEdxB,qBAAqB;;kHAArB,qBAAqB;mHAArB,qBAAqB,iBAThC,mBAAmB,aAGnB,YAAY;QACZ,gBAAgB;QAChB,eAAe;QACf,aAAa,aATX,mBAAmB;mHAYV,qBAAqB,YAPxB;YACR,YAAY;YACZ,gBAAgB;YAChB,eAAe;YACf,aAAa;SACb;2FAEW,qBAAqB;kBAdjC,QAAQ;mBAAC;oBACR,OAAO,EAAE;wBACP,mBAAmB;qBACpB;oBACF,YAAY,EAAE;wBACb,mBAAmB;qBACnB;oBACD,OAAO,EAAE;wBACR,YAAY;wBACZ,gBAAgB;wBAChB,eAAe;wBACf,aAAa;qBACb;iBACD;;;ACpBD;;;;;;"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Input, Output, ViewChild, NgModule } from '@angular/core';
|
|
3
|
+
import { BehaviorSubject } from 'rxjs';
|
|
4
|
+
import * as i1 from '@angular/material/button';
|
|
5
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
6
|
+
import * as i2 from '@angular/material/icon';
|
|
7
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
8
|
+
import * as i3 from '@angular/common';
|
|
9
|
+
import { CommonModule } from '@angular/common';
|
|
10
|
+
import * as i4 from '@angular/material/tooltip';
|
|
11
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
12
|
+
|
|
13
|
+
class KoalaBtnFileService {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.setFileSubject = new BehaviorSubject(null);
|
|
16
|
+
this.fileListSubject = new BehaviorSubject([]);
|
|
17
|
+
}
|
|
18
|
+
async setFile(file) {
|
|
19
|
+
if (file) {
|
|
20
|
+
this.setFileSubject.next(file);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
removeFile(files, index) {
|
|
24
|
+
files.splice(index, 1);
|
|
25
|
+
this.fileListSubject.next(files);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
KoalaBtnFileService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaBtnFileService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
29
|
+
KoalaBtnFileService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaBtnFileService, providedIn: "any" });
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaBtnFileService, decorators: [{
|
|
31
|
+
type: Injectable,
|
|
32
|
+
args: [{ providedIn: "any" }]
|
|
33
|
+
}] });
|
|
34
|
+
|
|
35
|
+
class FileButtonComponent {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.autoclear = true;
|
|
38
|
+
this.getFiles = new EventEmitter();
|
|
39
|
+
this.files = [];
|
|
40
|
+
this.textSubject = new BehaviorSubject('');
|
|
41
|
+
}
|
|
42
|
+
ngOnInit() {
|
|
43
|
+
this.style = `color: ${this.color}!important;background-color: ${this.backgroundColor}!important;`;
|
|
44
|
+
this.textSubject.next(this.text ?? '');
|
|
45
|
+
if (this.setFile) {
|
|
46
|
+
this.setFile.subscribe(async (file) => {
|
|
47
|
+
if (file) {
|
|
48
|
+
const fileResult = await this.convertFile(file);
|
|
49
|
+
if (fileResult) {
|
|
50
|
+
this.files.push(fileResult);
|
|
51
|
+
}
|
|
52
|
+
this.generateTextButton();
|
|
53
|
+
this.getFiles.emit(this.files);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (this.updateFileList) {
|
|
58
|
+
this.updateFileList.subscribe((fileList) => {
|
|
59
|
+
this.files = fileList;
|
|
60
|
+
this.generateTextButton();
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async emitFiles(files) {
|
|
65
|
+
if (files) {
|
|
66
|
+
if (files?.length > 0) {
|
|
67
|
+
for (let f = 0; f <= files.length; f++) {
|
|
68
|
+
const file = files.item(f);
|
|
69
|
+
if (file) {
|
|
70
|
+
const fileResult = await this.convertFile(file);
|
|
71
|
+
if (fileResult) {
|
|
72
|
+
this.files.push(fileResult);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
this.getFiles.emit(this.files);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this.getFiles.emit([]);
|
|
80
|
+
}
|
|
81
|
+
this.generateTextButton();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
open() {
|
|
85
|
+
const elFile = this.file?.nativeElement;
|
|
86
|
+
if (elFile)
|
|
87
|
+
elFile.value = '';
|
|
88
|
+
if (this.autoclear) {
|
|
89
|
+
this.files = [];
|
|
90
|
+
this.getFiles.emit([]);
|
|
91
|
+
this.generateTextButton();
|
|
92
|
+
}
|
|
93
|
+
elFile?.click();
|
|
94
|
+
}
|
|
95
|
+
generateTextButton() {
|
|
96
|
+
this.textSubject.next(this.files.length > 0
|
|
97
|
+
? `${this.files.length} arquivo${this.files.length > 1 ? 's' : ''} selecionado`
|
|
98
|
+
: this.text ?? '');
|
|
99
|
+
}
|
|
100
|
+
async convertFile(file) {
|
|
101
|
+
const blobFile = await new Promise((resolve) => {
|
|
102
|
+
const fileReader = new FileReader();
|
|
103
|
+
fileReader.readAsDataURL(file);
|
|
104
|
+
fileReader.onload = () => {
|
|
105
|
+
resolve(fileReader.result);
|
|
106
|
+
};
|
|
107
|
+
});
|
|
108
|
+
if (blobFile) {
|
|
109
|
+
const fileSplit = blobFile.toString().split(';base64,');
|
|
110
|
+
return {
|
|
111
|
+
filename: file.name,
|
|
112
|
+
type: fileSplit[0].replace('data:', ''),
|
|
113
|
+
base64: fileSplit[1],
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
FileButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: FileButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
120
|
+
FileButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: FileButtonComponent, selector: "koala-file-button", inputs: { color: "color", backgroundColor: "backgroundColor", icon: "icon", text: "text", tooltip: "tooltip", disabled: "disabled", multiple: "multiple", accept: "accept", setFile: "setFile", updateFileList: "updateFileList", autoclear: "autoclear" }, outputs: { getFiles: "getFiles" }, viewQueries: [{ propertyName: "file", first: true, predicate: ["file"], descendants: true, static: true }], ngImport: i0, template: "<input #file (change)=\"emitFiles(file.files)\" [accept]=\"accept\" [multiple]=\"multiple\"\n style=\"display: none;\"\n type=\"file\"/>\n<button\n\t(click)=\"open()\"\n\t*ngIf=\"text else iconButton\"\n\t[disabled]=\"disabled\"\n\t[matTooltipDisabled]=\"!tooltip\"\n\t[matTooltip]=\"tooltip ?? ''\"\n [style]=\"style\"\n\tclass=\"koala-button\"\n\tmat-button\n\tmatTooltipPosition=\"above\"\n\ttype=\"button\">\n <mat-icon *ngIf=\"icon\">{{icon}}</mat-icon>\n\t{{textSubject | async}}\n</button>\n<ng-template #iconButton>\n <button\n\t (click)=\"open()\"\n\t [disabled]=\"disabled\"\n\t [matTooltipDisabled]=\"!tooltip\"\n\t [matTooltip]=\"tooltip ?? ''\"\n [style]=\"style\"\n\t class=\"koala-icon-button\"\n\t mat-icon-button\n\t matTooltipPosition=\"before\"\n\t type=\"button\">\n <mat-icon>{{icon}}</mat-icon>\n </button>\n</ng-template>\n", styles: [".koala-button{padding:2px 8px}.koala-icon-button:disabled,.koala-button:disabled{background:#cccccc!important;color:#616161!important;cursor:not-allowed}.koala-icon-button{height:25px;line-height:25px;width:25px}.koala-icon-button mat-icon{font-size:20px;height:20px;line-height:20px;position:relative;width:20px}\n"], components: [{ type: i1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
121
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: FileButtonComponent, decorators: [{
|
|
122
|
+
type: Component,
|
|
123
|
+
args: [{ selector: 'koala-file-button', changeDetection: ChangeDetectionStrategy.OnPush, template: "<input #file (change)=\"emitFiles(file.files)\" [accept]=\"accept\" [multiple]=\"multiple\"\n style=\"display: none;\"\n type=\"file\"/>\n<button\n\t(click)=\"open()\"\n\t*ngIf=\"text else iconButton\"\n\t[disabled]=\"disabled\"\n\t[matTooltipDisabled]=\"!tooltip\"\n\t[matTooltip]=\"tooltip ?? ''\"\n [style]=\"style\"\n\tclass=\"koala-button\"\n\tmat-button\n\tmatTooltipPosition=\"above\"\n\ttype=\"button\">\n <mat-icon *ngIf=\"icon\">{{icon}}</mat-icon>\n\t{{textSubject | async}}\n</button>\n<ng-template #iconButton>\n <button\n\t (click)=\"open()\"\n\t [disabled]=\"disabled\"\n\t [matTooltipDisabled]=\"!tooltip\"\n\t [matTooltip]=\"tooltip ?? ''\"\n [style]=\"style\"\n\t class=\"koala-icon-button\"\n\t mat-icon-button\n\t matTooltipPosition=\"before\"\n\t type=\"button\">\n <mat-icon>{{icon}}</mat-icon>\n </button>\n</ng-template>\n", styles: [".koala-button{padding:2px 8px}.koala-icon-button:disabled,.koala-button:disabled{background:#cccccc!important;color:#616161!important;cursor:not-allowed}.koala-icon-button{height:25px;line-height:25px;width:25px}.koala-icon-button mat-icon{font-size:20px;height:20px;line-height:20px;position:relative;width:20px}\n"] }]
|
|
124
|
+
}], propDecorators: { color: [{
|
|
125
|
+
type: Input
|
|
126
|
+
}], backgroundColor: [{
|
|
127
|
+
type: Input
|
|
128
|
+
}], icon: [{
|
|
129
|
+
type: Input
|
|
130
|
+
}], text: [{
|
|
131
|
+
type: Input
|
|
132
|
+
}], tooltip: [{
|
|
133
|
+
type: Input
|
|
134
|
+
}], disabled: [{
|
|
135
|
+
type: Input
|
|
136
|
+
}], multiple: [{
|
|
137
|
+
type: Input
|
|
138
|
+
}], accept: [{
|
|
139
|
+
type: Input
|
|
140
|
+
}], setFile: [{
|
|
141
|
+
type: Input
|
|
142
|
+
}], updateFileList: [{
|
|
143
|
+
type: Input
|
|
144
|
+
}], autoclear: [{
|
|
145
|
+
type: Input
|
|
146
|
+
}], getFiles: [{
|
|
147
|
+
type: Output
|
|
148
|
+
}], file: [{
|
|
149
|
+
type: ViewChild,
|
|
150
|
+
args: ['file', { static: true }]
|
|
151
|
+
}] } });
|
|
152
|
+
|
|
153
|
+
class KoalaFileButtonModule {
|
|
154
|
+
}
|
|
155
|
+
KoalaFileButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaFileButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
156
|
+
KoalaFileButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaFileButtonModule, declarations: [FileButtonComponent], imports: [CommonModule,
|
|
157
|
+
MatTooltipModule,
|
|
158
|
+
MatButtonModule,
|
|
159
|
+
MatIconModule], exports: [FileButtonComponent] });
|
|
160
|
+
KoalaFileButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaFileButtonModule, imports: [[
|
|
161
|
+
CommonModule,
|
|
162
|
+
MatTooltipModule,
|
|
163
|
+
MatButtonModule,
|
|
164
|
+
MatIconModule
|
|
165
|
+
]] });
|
|
166
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaFileButtonModule, decorators: [{
|
|
167
|
+
type: NgModule,
|
|
168
|
+
args: [{
|
|
169
|
+
exports: [
|
|
170
|
+
FileButtonComponent
|
|
171
|
+
],
|
|
172
|
+
declarations: [
|
|
173
|
+
FileButtonComponent
|
|
174
|
+
],
|
|
175
|
+
imports: [
|
|
176
|
+
CommonModule,
|
|
177
|
+
MatTooltipModule,
|
|
178
|
+
MatButtonModule,
|
|
179
|
+
MatIconModule
|
|
180
|
+
]
|
|
181
|
+
}]
|
|
182
|
+
}] });
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Generated bundle index. Do not edit.
|
|
186
|
+
*/
|
|
187
|
+
|
|
188
|
+
export { FileButtonComponent, KoalaBtnFileService, KoalaFileButtonModule };
|
|
189
|
+
//# sourceMappingURL=koalarx-ui-file-button.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"koalarx-ui-file-button.mjs","sources":["../../../projects/file-button/src/lib/koala.btn-file.service.ts","../../../projects/file-button/src/lib/file-button.component.ts","../../../projects/file-button/src/lib/file-button.component.html","../../../projects/file-button/src/lib/koala.file-button.module.ts","../../../projects/file-button/src/koalarx-ui-file-button.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { KoalaFileInterface } from './koala.file.interface';\n\n@Injectable({providedIn: \"any\"})\nexport class KoalaBtnFileService {\n\tpublic setFileSubject = new BehaviorSubject<File|null>(null);\n\tpublic fileListSubject = new BehaviorSubject<KoalaFileInterface[]>([]);\n\n\tpublic async setFile(file: File) {\n\t\tif (file) {\n\t\t\tthis.setFileSubject.next(file);\n\t\t}\n\t}\n\n\tpublic removeFile(files: KoalaFileInterface[], index: number) {\n\t\tfiles.splice(index, 1);\n\t\tthis.fileListSubject.next(files);\n\t}\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { KoalaFileInterface } from './koala.file.interface';\nimport { BehaviorSubject } from 'rxjs';\n\n@Component({\n selector: 'koala-file-button',\n templateUrl: 'file-button.component.html',\n styleUrls: ['file-button.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FileButtonComponent implements OnInit {\n @Input() color?: string;\n @Input() backgroundColor?: string;\n @Input() icon?: string;\n @Input() text?: string;\n @Input() tooltip?: string;\n @Input() disabled?: boolean;\n @Input() multiple?: boolean;\n @Input() accept?: string;\n @Input() setFile?: BehaviorSubject<File>;\n @Input() updateFileList?: BehaviorSubject<KoalaFileInterface[]>;\n @Input() autoclear = true;\n @Output() getFiles = new EventEmitter<KoalaFileInterface[]>();\n public files: KoalaFileInterface[] = [];\n public style?: string;\n\n @ViewChild('file', { static: true }) private file?: ElementRef<HTMLInputElement>;\n\n public textSubject = new BehaviorSubject<string>('');\n\n ngOnInit() {\n this.style = `color: ${this.color}!important;background-color: ${this.backgroundColor}!important;`;\n this.textSubject.next(this.text ?? '');\n if (this.setFile) {\n this.setFile.subscribe(async (file) => {\n if (file) {\n const fileResult = await this.convertFile(file);\n if (fileResult) {\n this.files.push(fileResult);\n }\n this.generateTextButton();\n this.getFiles.emit(this.files);\n }\n });\n }\n\n if (this.updateFileList) {\n this.updateFileList.subscribe((fileList) => {\n this.files = fileList;\n this.generateTextButton();\n });\n }\n }\n\n public async emitFiles(files: FileList | null) {\n if (files) {\n if (files?.length > 0) {\n for (let f = 0; f <= files.length; f++) {\n const file = files.item(f);\n if (file) {\n const fileResult = await this.convertFile(file);\n if (fileResult) {\n this.files.push(fileResult);\n }\n }\n }\n\n this.getFiles.emit(this.files);\n } else {\n this.getFiles.emit([]);\n }\n this.generateTextButton();\n }\n }\n\n public open() {\n const elFile = this.file?.nativeElement;\n if (elFile) elFile.value = '';\n if (this.autoclear) {\n this.files = [];\n this.getFiles.emit([]);\n this.generateTextButton();\n }\n elFile?.click();\n }\n\n private generateTextButton() {\n this.textSubject.next(\n this.files.length > 0\n ? `${this.files.length} arquivo${this.files.length > 1 ? 's' : ''} selecionado`\n : this.text ?? '',\n );\n }\n\n private async convertFile(file: File): Promise<KoalaFileInterface | null> {\n const blobFile = await new Promise<string | ArrayBuffer | null>((resolve) => {\n const fileReader = new FileReader();\n fileReader.readAsDataURL(file);\n fileReader.onload = () => {\n resolve(fileReader.result);\n };\n });\n if (blobFile) {\n const fileSplit = blobFile.toString().split(';base64,');\n return {\n filename: file.name,\n type: fileSplit[0].replace('data:', ''),\n base64: fileSplit[1],\n };\n }\n\n return null;\n }\n}\n","<input #file (change)=\"emitFiles(file.files)\" [accept]=\"accept\" [multiple]=\"multiple\"\n style=\"display: none;\"\n type=\"file\"/>\n<button\n\t(click)=\"open()\"\n\t*ngIf=\"text else iconButton\"\n\t[disabled]=\"disabled\"\n\t[matTooltipDisabled]=\"!tooltip\"\n\t[matTooltip]=\"tooltip ?? ''\"\n [style]=\"style\"\n\tclass=\"koala-button\"\n\tmat-button\n\tmatTooltipPosition=\"above\"\n\ttype=\"button\">\n <mat-icon *ngIf=\"icon\">{{icon}}</mat-icon>\n\t{{textSubject | async}}\n</button>\n<ng-template #iconButton>\n <button\n\t (click)=\"open()\"\n\t [disabled]=\"disabled\"\n\t [matTooltipDisabled]=\"!tooltip\"\n\t [matTooltip]=\"tooltip ?? ''\"\n [style]=\"style\"\n\t class=\"koala-icon-button\"\n\t mat-icon-button\n\t matTooltipPosition=\"before\"\n\t type=\"button\">\n <mat-icon>{{icon}}</mat-icon>\n </button>\n</ng-template>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { FileButtonComponent } from './file-button.component';\n\n@NgModule({\n exports: [\n FileButtonComponent\n ],\n\tdeclarations: [\n\t\tFileButtonComponent\n\t],\n\timports: [\n\t\tCommonModule,\n\t\tMatTooltipModule,\n\t\tMatButtonModule,\n\t\tMatIconModule\n\t]\n})\nexport class KoalaFileButtonModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MAKa,mBAAmB;IADhC;QAEQ,mBAAc,GAAG,IAAI,eAAe,CAAY,IAAI,CAAC,CAAC;QACtD,oBAAe,GAAG,IAAI,eAAe,CAAuB,EAAE,CAAC,CAAC;KAYvE;IAVO,MAAM,OAAO,CAAC,IAAU;QAC9B,IAAI,IAAI,EAAE;YACT,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC/B;KACD;IAEM,UAAU,CAAC,KAA2B,EAAE,KAAa;QAC3D,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACvB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACjC;;gHAbW,mBAAmB;oHAAnB,mBAAmB,cADP,KAAK;2FACjB,mBAAmB;kBAD/B,UAAU;mBAAC,EAAC,UAAU,EAAE,KAAK,EAAC;;;MCelB,mBAAmB;IANhC;QAiBW,cAAS,GAAG,IAAI,CAAC;QAChB,aAAQ,GAAG,IAAI,YAAY,EAAwB,CAAC;QACvD,UAAK,GAAyB,EAAE,CAAC;QAKjC,gBAAW,GAAG,IAAI,eAAe,CAAS,EAAE,CAAC,CAAC;KAqFtD;IAnFC,QAAQ;QACN,IAAI,CAAC,K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7 @@
|
|
|
1
1
|
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
2
|
import { KoalaFileInterface } from './koala.file.interface';
|
|
3
3
|
import { BehaviorSubject } from 'rxjs';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class FileButtonComponent implements OnInit {
|
|
5
6
|
color?: string;
|
|
6
7
|
backgroundColor?: string;
|
|
@@ -19,8 +20,10 @@ export declare class FileButtonComponent implements OnInit {
|
|
|
19
20
|
private file?;
|
|
20
21
|
textSubject: BehaviorSubject<string>;
|
|
21
22
|
ngOnInit(): void;
|
|
22
|
-
emitFiles(files: FileList): Promise<void>;
|
|
23
|
+
emitFiles(files: FileList | null): Promise<void>;
|
|
23
24
|
open(): void;
|
|
24
25
|
private generateTextButton;
|
|
25
26
|
private convertFile;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FileButtonComponent, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FileButtonComponent, "koala-file-button", never, { "color": "color"; "backgroundColor": "backgroundColor"; "icon": "icon"; "text": "text"; "tooltip": "tooltip"; "disabled": "disabled"; "multiple": "multiple"; "accept": "accept"; "setFile": "setFile"; "updateFileList": "updateFileList"; "autoclear": "autoclear"; }, { "getFiles": "getFiles"; }, never, never>;
|
|
26
29
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { BehaviorSubject } from 'rxjs';
|
|
2
2
|
import { KoalaFileInterface } from './koala.file.interface';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
3
4
|
export declare class KoalaBtnFileService {
|
|
4
5
|
setFileSubject: BehaviorSubject<File | null>;
|
|
5
6
|
fileListSubject: BehaviorSubject<KoalaFileInterface[]>;
|
|
6
7
|
setFile(file: File): Promise<void>;
|
|
7
8
|
removeFile(files: KoalaFileInterface[], index: number): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KoalaBtnFileService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<KoalaBtnFileService>;
|
|
8
11
|
}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./file-button.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "@angular/material/tooltip";
|
|
5
|
+
import * as i4 from "@angular/material/button";
|
|
6
|
+
import * as i5 from "@angular/material/icon";
|
|
1
7
|
export declare class KoalaFileButtonModule {
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KoalaFileButtonModule, never>;
|
|
9
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<KoalaFileButtonModule, [typeof i1.FileButtonComponent], [typeof i2.CommonModule, typeof i3.MatTooltipModule, typeof i4.MatButtonModule, typeof i5.MatIconModule], [typeof i1.FileButtonComponent]>;
|
|
10
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<KoalaFileButtonModule>;
|
|
2
11
|
}
|
package/file-button/package.json
CHANGED
|
@@ -8,12 +8,24 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"tslib": "^2.1.0"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"fesm2015": "fesm2015/koalarx-ui-file-button.
|
|
11
|
+
"module": "fesm2015/koalarx-ui-file-button.mjs",
|
|
12
|
+
"es2020": "fesm2020/koalarx-ui-file-button.mjs",
|
|
13
|
+
"esm2020": "esm2020/koalarx-ui-file-button.mjs",
|
|
14
|
+
"fesm2020": "fesm2020/koalarx-ui-file-button.mjs",
|
|
15
|
+
"fesm2015": "fesm2015/koalarx-ui-file-button.mjs",
|
|
16
16
|
"typings": "koalarx-ui-file-button.d.ts",
|
|
17
|
-
"
|
|
17
|
+
"exports": {
|
|
18
|
+
"./package.json": {
|
|
19
|
+
"default": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./koalarx-ui-file-button.d.ts",
|
|
23
|
+
"esm2020": "./esm2020/koalarx-ui-file-button.mjs",
|
|
24
|
+
"es2020": "./fesm2020/koalarx-ui-file-button.mjs",
|
|
25
|
+
"es2015": "./fesm2015/koalarx-ui-file-button.mjs",
|
|
26
|
+
"node": "./fesm2015/koalarx-ui-file-button.mjs",
|
|
27
|
+
"default": "./fesm2020/koalarx-ui-file-button.mjs"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
18
30
|
"sideEffects": false
|
|
19
31
|
}
|
|
File without changes
|
package/folder-page/{esm2015/koalarx-ui-folder-page.js → esm2020/koalarx-ui-folder-page.mjs}
RENAMED
|
File without changes
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, Input, ViewChild } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "@angular/material/icon";
|
|
4
|
+
import * as i2 from "@koalarx/ui/icon";
|
|
5
|
+
import * as i3 from "@angular/common";
|
|
6
|
+
import * as i4 from "@angular/router";
|
|
7
|
+
export class FolderComponent {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.titlePage = 'Title';
|
|
10
|
+
this.customFolderFontColor = '#212121';
|
|
11
|
+
this.customFolderBackgroudColor = '#FFF';
|
|
12
|
+
}
|
|
13
|
+
ngOnInit() {
|
|
14
|
+
this.setCustomBackgroundColor();
|
|
15
|
+
}
|
|
16
|
+
ngOnChanges(changes) {
|
|
17
|
+
if (changes.customBackgroudColor || changes.customFolderFontColor) {
|
|
18
|
+
this.setCustomBackgroundColor();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
getKoalaIcon() {
|
|
22
|
+
return this.titleIcon;
|
|
23
|
+
}
|
|
24
|
+
setCustomBackgroundColor() {
|
|
25
|
+
if (this.customFolderBackgroudColor) {
|
|
26
|
+
const folder = this.folder?.nativeElement;
|
|
27
|
+
folder.style.background = this.customFolderBackgroudColor;
|
|
28
|
+
}
|
|
29
|
+
if (this.customFolderFontColor) {
|
|
30
|
+
const folderTitle = this.folderTitle?.nativeElement;
|
|
31
|
+
folderTitle.style.color = this.customFolderFontColor;
|
|
32
|
+
const folderIconTitle = this.folderTitle?.nativeElement;
|
|
33
|
+
folderIconTitle.style.color = this.customFolderFontColor;
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
if (this.folderNavigateHistory) {
|
|
36
|
+
const folderNavigateHistory = this.folderNavigateHistory.nativeElement;
|
|
37
|
+
folderNavigateHistory.style.color = this.customFolderFontColor;
|
|
38
|
+
}
|
|
39
|
+
}, 50);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
FolderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: FolderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
44
|
+
FolderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: FolderComponent, selector: "koala-folder-page", inputs: { titlePage: "titlePage", titleIcon: "titleIcon", koalaIcon: "koalaIcon", customFolderFontColor: "customFolderFontColor", customFolderBackgroudColor: "customFolderBackgroudColor", navigateHistory: "navigateHistory" }, viewQueries: [{ propertyName: "folder", first: true, predicate: ["folder"], descendants: true, static: true }, { propertyName: "folderTitle", first: true, predicate: ["folderTitle"], descendants: true, static: true }, { propertyName: "folderNavigateHistory", first: true, predicate: ["folderNavigateHistory"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div #folder class=\"folder-list\">\n <h1 #folderTitle>\n <mat-icon #folderIconTitle *ngIf=\"titleIcon && !koalaIcon\">{{titleIcon}}</mat-icon>\n <koala-icon *ngIf=\"titleIcon && koalaIcon\" [size]=\"20\" [color]=\"customFolderFontColor\" [icon]=\"getKoalaIcon()\"></koala-icon>\n {{titlePage}}\n </h1>\n <ul #folderNavigateHistory class=\"navigate-history\" *ngIf=\"navigateHistory\">\n <li *ngFor=\"let item of navigateHistory\">\n <a [style]=\"'color: ' + customFolderFontColor\" [ngClass]=\"{'disabled': !item.routerLink}\" [routerLink]=\"item.routerLink\">{{item.name}}</a>\n </li>\n </ul>\n <nav class=\"menu-folder\">\n <ng-content select=\"[menu-page]\"></ng-content>\n </nav>\n\n <div class=\"content\">\n <ng-content select=\"[content]\"></ng-content>\n </div>\n\n</div>\n", styles: [".folder-list{position:relative;background-size:cover;width:100%;height:160px;box-sizing:border-box}.folder-list h1{padding:0;margin:0;position:absolute;top:20px;left:20px;font-size:1.2em;font-family:OpenSans,sans-serif;font-weight:700;display:flex;align-items:center}.folder-list h1 mat-icon,.folder-list h1 koala-icon{margin-right:10px}nav.menu-folder{position:absolute;right:0;top:20px;z-index:4;padding:7px 30px}.content{position:relative;display:block;height:calc(100vh - 155px);overflow-x:hidden;top:85px;margin:0 auto;padding:3px 0}.navigate-history{position:absolute;top:45px;display:flex;align-items:center;list-style:none;padding:5px 20px;margin:0;font-size:0}.navigate-history li a{font-size:12px;text-decoration:none}.navigate-history li a.disabled{cursor:default;opacity:.8;pointer-events:none}.navigate-history li:after{content:\">\";padding:0 5px;font-size:12px;color:inherit}.navigate-history li:last-child:after{content:\"\";padding:0}\n"], components: [{ type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i2.IconComponent, selector: "koala-icon", inputs: ["color", "icon", "size"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: FolderComponent, decorators: [{
|
|
46
|
+
type: Component,
|
|
47
|
+
args: [{ selector: 'koala-folder-page', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div #folder class=\"folder-list\">\n <h1 #folderTitle>\n <mat-icon #folderIconTitle *ngIf=\"titleIcon && !koalaIcon\">{{titleIcon}}</mat-icon>\n <koala-icon *ngIf=\"titleIcon && koalaIcon\" [size]=\"20\" [color]=\"customFolderFontColor\" [icon]=\"getKoalaIcon()\"></koala-icon>\n {{titlePage}}\n </h1>\n <ul #folderNavigateHistory class=\"navigate-history\" *ngIf=\"navigateHistory\">\n <li *ngFor=\"let item of navigateHistory\">\n <a [style]=\"'color: ' + customFolderFontColor\" [ngClass]=\"{'disabled': !item.routerLink}\" [routerLink]=\"item.routerLink\">{{item.name}}</a>\n </li>\n </ul>\n <nav class=\"menu-folder\">\n <ng-content select=\"[menu-page]\"></ng-content>\n </nav>\n\n <div class=\"content\">\n <ng-content select=\"[content]\"></ng-content>\n </div>\n\n</div>\n", styles: [".folder-list{position:relative;background-size:cover;width:100%;height:160px;box-sizing:border-box}.folder-list h1{padding:0;margin:0;position:absolute;top:20px;left:20px;font-size:1.2em;font-family:OpenSans,sans-serif;font-weight:700;display:flex;align-items:center}.folder-list h1 mat-icon,.folder-list h1 koala-icon{margin-right:10px}nav.menu-folder{position:absolute;right:0;top:20px;z-index:4;padding:7px 30px}.content{position:relative;display:block;height:calc(100vh - 155px);overflow-x:hidden;top:85px;margin:0 auto;padding:3px 0}.navigate-history{position:absolute;top:45px;display:flex;align-items:center;list-style:none;padding:5px 20px;margin:0;font-size:0}.navigate-history li a{font-size:12px;text-decoration:none}.navigate-history li a.disabled{cursor:default;opacity:.8;pointer-events:none}.navigate-history li:after{content:\">\";padding:0 5px;font-size:12px;color:inherit}.navigate-history li:last-child:after{content:\"\";padding:0}\n"] }]
|
|
48
|
+
}], propDecorators: { titlePage: [{
|
|
49
|
+
type: Input
|
|
50
|
+
}], titleIcon: [{
|
|
51
|
+
type: Input
|
|
52
|
+
}], koalaIcon: [{
|
|
53
|
+
type: Input
|
|
54
|
+
}], customFolderFontColor: [{
|
|
55
|
+
type: Input
|
|
56
|
+
}], customFolderBackgroudColor: [{
|
|
57
|
+
type: Input
|
|
58
|
+
}], navigateHistory: [{
|
|
59
|
+
type: Input
|
|
60
|
+
}], folder: [{
|
|
61
|
+
type: ViewChild,
|
|
62
|
+
args: ['folder', { static: true }]
|
|
63
|
+
}], folderTitle: [{
|
|
64
|
+
type: ViewChild,
|
|
65
|
+
args: ['folderTitle', { static: true }]
|
|
66
|
+
}], folderNavigateHistory: [{
|
|
67
|
+
type: ViewChild,
|
|
68
|
+
args: ['folderNavigateHistory', { static: false }]
|
|
69
|
+
}] } });
|
|
70
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9sZGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL2ZvbGRlci1wYWdlL3NyYy9saWIvZm9sZGVyLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uL3Byb2plY3RzL2ZvbGRlci1wYWdlL3NyYy9saWIvZm9sZGVyLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCx1QkFBdUIsRUFDdkIsU0FBUyxFQUVULEtBQUssRUFJTCxTQUFTLEVBQ1YsTUFBTSxlQUFlLENBQUM7Ozs7OztBQVV2QixNQUFNLE9BQU8sZUFBZTtJQU41QjtRQU9XLGNBQVMsR0FBVyxPQUFPLENBQUM7UUFHNUIsMEJBQXFCLEdBQVcsU0FBUyxDQUFDO1FBQzFDLCtCQUEwQixHQUFXLE1BQU0sQ0FBQztLQXVDdEQ7SUFoQ0MsUUFBUTtRQUNOLElBQUksQ0FBQyx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