@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,1949 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@koalarx/ui/core'), require('@angular/forms'), require('@koalarx/utils'), require('ngx-device-detector'), require('rxjs/operators'), require('@koalarx/utils/dist/utils/KlDelay'), require('@angular/common'), require('@angular/material/input'), require('@angular/material/select'), require('@angular/material/radio'), require('@angular/material/checkbox'), require('@angular/material/autocomplete'), require('@angular/material/button'), require('@angular/material/icon'), require('@angular/material/progress-spinner'), require('ngx-mask'), require('ng2-currency-mask'), require('@koalarx/ui/button'), require('@angular/material/expansion'), require('@koalarx/ui/file-button'), require('@angular/material/chips')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@koalarx/ui/form', ['exports', '@angular/core', 'rxjs', '@koalarx/ui/core', '@angular/forms', '@koalarx/utils', 'ngx-device-detector', 'rxjs/operators', '@koalarx/utils/dist/utils/KlDelay', '@angular/common', '@angular/material/input', '@angular/material/select', '@angular/material/radio', '@angular/material/checkbox', '@angular/material/autocomplete', '@angular/material/button', '@angular/material/icon', '@angular/material/progress-spinner', 'ngx-mask', 'ng2-currency-mask', '@koalarx/ui/button', '@angular/material/expansion', '@koalarx/ui/file-button', '@angular/material/chips'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.koalarx = global.koalarx || {}, global.koalarx.ui = global.koalarx.ui || {}, global.koalarx.ui.form = {}), global.ng.core, global.rxjs, global.core, global.ng.forms, global.utils, global.i2, global.rxjs.operators, global.KlDelay, global.ng.common, global.ng.material.input, global.ng.material.select, global.ng.material.radio, global.ng.material.checkbox, global.ng.material.autocomplete, global.ng.material.button, global.ng.material.icon, global.ng.material.progressSpinner, global["ngx-mask"], global.ng2CurrencyMask, global.button, global.ng.material.expansion, global.fileButton, global.ng.material.chips));
|
|
5
|
+
})(this, (function (exports, i0, rxjs, core, i1, utils, i2, operators, KlDelay, common, input, select, radio, checkbox, autocomplete, button, icon, progressSpinner, ngxMask, ng2CurrencyMask, button$1, expansion, fileButton, chips) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n["default"] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
26
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
27
|
+
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
28
|
+
|
|
29
|
+
var BtnSubmitComponent = /** @class */ (function () {
|
|
30
|
+
function BtnSubmitComponent() {
|
|
31
|
+
this.color = 'primary';
|
|
32
|
+
this.btnLabel = core.KoalaLanguageHelper.getBtnLabel();
|
|
33
|
+
this.btnSubmitDisabled = false;
|
|
34
|
+
this.disabled = new rxjs.BehaviorSubject(false);
|
|
35
|
+
}
|
|
36
|
+
BtnSubmitComponent.prototype.ngOnInit = function () {
|
|
37
|
+
if (!this.btnLabel) {
|
|
38
|
+
this.btnLabel = core.KoalaLanguageHelper.getBtnLabel();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
BtnSubmitComponent.prototype.ngOnChanges = function (changes) {
|
|
42
|
+
if (changes.btnSubmitDisabled) {
|
|
43
|
+
this.disabled.next(changes.btnSubmitDisabled.currentValue);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return BtnSubmitComponent;
|
|
47
|
+
}());
|
|
48
|
+
BtnSubmitComponent.decorators = [
|
|
49
|
+
{ type: i0.Component, args: [{
|
|
50
|
+
selector: 'koala-submit',
|
|
51
|
+
template: "<button\n\t*ngIf=\"!iconButton else btnIcon\"\n\t[color]=\"color\"\n\t[disabled]=\"(disabled | async) || fg.invalid || fg.pending\"\n\tmat-raised-button\n\ttype=\"submit\">\n <span>{{btnLabel}}</span>\n <mat-spinner *ngIf=\"loader | async\" diameter=\"20\"></mat-spinner>\n</button>\n<ng-template #btnIcon>\n <button\n\t [color]=\"color\"\n\t [disabled]=\"(disabled | async) || fg.invalid || fg.pending\"\n\t class=\"koala-icon-button\"\n\t mat-icon-button\n\t type=\"submit\">\n <mat-spinner *ngIf=\"loader | async\" [color]=\"color\" diameter=\"20\"></mat-spinner>\n <mat-icon *ngIf=\"!(loader | async)\">{{icon}}</mat-icon>\n </button>\n</ng-template>\n",
|
|
52
|
+
styles: [".mat-spinner{display:inline-block;margin-left:8px}.koala-button{padding:2px 8px}.koala-icon-button mat-spinner{position:relative;display:inline-flex;margin:0}\n"]
|
|
53
|
+
},] }
|
|
54
|
+
];
|
|
55
|
+
BtnSubmitComponent.propDecorators = {
|
|
56
|
+
fg: [{ type: i0.Input }],
|
|
57
|
+
color: [{ type: i0.Input }],
|
|
58
|
+
btnLabel: [{ type: i0.Input }],
|
|
59
|
+
btnSubmitDisabled: [{ type: i0.Input }],
|
|
60
|
+
loader: [{ type: i0.Input }],
|
|
61
|
+
iconButton: [{ type: i0.Input }],
|
|
62
|
+
icon: [{ type: i0.Input }],
|
|
63
|
+
iconColor: [{ type: i0.Input }]
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
exports.DynamicFormTypeFieldEnum = void 0;
|
|
67
|
+
(function (DynamicFormTypeFieldEnum) {
|
|
68
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["text"] = 1] = "text";
|
|
69
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["password"] = 2] = "password";
|
|
70
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["cpf"] = 3] = "cpf";
|
|
71
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["cnpj"] = 4] = "cnpj";
|
|
72
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["datetime"] = 5] = "datetime";
|
|
73
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["email"] = 6] = "email";
|
|
74
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["phone"] = 7] = "phone";
|
|
75
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["number"] = 8] = "number";
|
|
76
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["valueList"] = 9] = "valueList";
|
|
77
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["textarea"] = 10] = "textarea";
|
|
78
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["time"] = 11] = "time";
|
|
79
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["hoursAndMinutes"] = 12] = "hoursAndMinutes";
|
|
80
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["checkbox"] = 13] = "checkbox";
|
|
81
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["select"] = 14] = "select";
|
|
82
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["coin"] = 15] = "coin";
|
|
83
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["percent"] = 16] = "percent";
|
|
84
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["moreItems"] = 17] = "moreItems";
|
|
85
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["id"] = 18] = "id";
|
|
86
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["textLogs"] = 19] = "textLogs";
|
|
87
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["file"] = 20] = "file";
|
|
88
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["autocomplete"] = 21] = "autocomplete";
|
|
89
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["color"] = 22] = "color";
|
|
90
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["dynamicForm"] = 23] = "dynamicForm";
|
|
91
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["date"] = 24] = "date";
|
|
92
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["radio"] = 25] = "radio";
|
|
93
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["float"] = 26] = "float";
|
|
94
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["stringNumber"] = 27] = "stringNumber";
|
|
95
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["selectMultipleNative"] = 28] = "selectMultipleNative";
|
|
96
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["month"] = 29] = "month";
|
|
97
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["competenceDate"] = 30] = "competenceDate";
|
|
98
|
+
DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["stringWithCustomMasc"] = 31] = "stringWithCustomMasc";
|
|
99
|
+
})(exports.DynamicFormTypeFieldEnum || (exports.DynamicFormTypeFieldEnum = {}));
|
|
100
|
+
|
|
101
|
+
/*! *****************************************************************************
|
|
102
|
+
Copyright (c) Microsoft Corporation.
|
|
103
|
+
|
|
104
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
105
|
+
purpose with or without fee is hereby granted.
|
|
106
|
+
|
|
107
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
108
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
109
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
110
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
111
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
112
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
113
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
114
|
+
***************************************************************************** */
|
|
115
|
+
/* global Reflect, Promise */
|
|
116
|
+
var extendStatics = function (d, b) {
|
|
117
|
+
extendStatics = Object.setPrototypeOf ||
|
|
118
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
119
|
+
function (d, b) { for (var p in b)
|
|
120
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
121
|
+
d[p] = b[p]; };
|
|
122
|
+
return extendStatics(d, b);
|
|
123
|
+
};
|
|
124
|
+
function __extends(d, b) {
|
|
125
|
+
if (typeof b !== "function" && b !== null)
|
|
126
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
127
|
+
extendStatics(d, b);
|
|
128
|
+
function __() { this.constructor = d; }
|
|
129
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
130
|
+
}
|
|
131
|
+
var __assign = function () {
|
|
132
|
+
__assign = Object.assign || function __assign(t) {
|
|
133
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
134
|
+
s = arguments[i];
|
|
135
|
+
for (var p in s)
|
|
136
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
137
|
+
t[p] = s[p];
|
|
138
|
+
}
|
|
139
|
+
return t;
|
|
140
|
+
};
|
|
141
|
+
return __assign.apply(this, arguments);
|
|
142
|
+
};
|
|
143
|
+
function __rest(s, e) {
|
|
144
|
+
var t = {};
|
|
145
|
+
for (var p in s)
|
|
146
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
147
|
+
t[p] = s[p];
|
|
148
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
149
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
150
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
151
|
+
t[p[i]] = s[p[i]];
|
|
152
|
+
}
|
|
153
|
+
return t;
|
|
154
|
+
}
|
|
155
|
+
function __decorate(decorators, target, key, desc) {
|
|
156
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
157
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
158
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
159
|
+
else
|
|
160
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
161
|
+
if (d = decorators[i])
|
|
162
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
163
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
164
|
+
}
|
|
165
|
+
function __param(paramIndex, decorator) {
|
|
166
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
167
|
+
}
|
|
168
|
+
function __metadata(metadataKey, metadataValue) {
|
|
169
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
170
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
171
|
+
}
|
|
172
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
173
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
174
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
175
|
+
function fulfilled(value) { try {
|
|
176
|
+
step(generator.next(value));
|
|
177
|
+
}
|
|
178
|
+
catch (e) {
|
|
179
|
+
reject(e);
|
|
180
|
+
} }
|
|
181
|
+
function rejected(value) { try {
|
|
182
|
+
step(generator["throw"](value));
|
|
183
|
+
}
|
|
184
|
+
catch (e) {
|
|
185
|
+
reject(e);
|
|
186
|
+
} }
|
|
187
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
188
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
function __generator(thisArg, body) {
|
|
192
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
193
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
194
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
195
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
196
|
+
function step(op) {
|
|
197
|
+
if (f)
|
|
198
|
+
throw new TypeError("Generator is already executing.");
|
|
199
|
+
while (_)
|
|
200
|
+
try {
|
|
201
|
+
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)
|
|
202
|
+
return t;
|
|
203
|
+
if (y = 0, t)
|
|
204
|
+
op = [op[0] & 2, t.value];
|
|
205
|
+
switch (op[0]) {
|
|
206
|
+
case 0:
|
|
207
|
+
case 1:
|
|
208
|
+
t = op;
|
|
209
|
+
break;
|
|
210
|
+
case 4:
|
|
211
|
+
_.label++;
|
|
212
|
+
return { value: op[1], done: false };
|
|
213
|
+
case 5:
|
|
214
|
+
_.label++;
|
|
215
|
+
y = op[1];
|
|
216
|
+
op = [0];
|
|
217
|
+
continue;
|
|
218
|
+
case 7:
|
|
219
|
+
op = _.ops.pop();
|
|
220
|
+
_.trys.pop();
|
|
221
|
+
continue;
|
|
222
|
+
default:
|
|
223
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
224
|
+
_ = 0;
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
228
|
+
_.label = op[1];
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
232
|
+
_.label = t[1];
|
|
233
|
+
t = op;
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
if (t && _.label < t[2]) {
|
|
237
|
+
_.label = t[2];
|
|
238
|
+
_.ops.push(op);
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
if (t[2])
|
|
242
|
+
_.ops.pop();
|
|
243
|
+
_.trys.pop();
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
op = body.call(thisArg, _);
|
|
247
|
+
}
|
|
248
|
+
catch (e) {
|
|
249
|
+
op = [6, e];
|
|
250
|
+
y = 0;
|
|
251
|
+
}
|
|
252
|
+
finally {
|
|
253
|
+
f = t = 0;
|
|
254
|
+
}
|
|
255
|
+
if (op[0] & 5)
|
|
256
|
+
throw op[1];
|
|
257
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
261
|
+
if (k2 === undefined)
|
|
262
|
+
k2 = k;
|
|
263
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
264
|
+
}) : (function (o, m, k, k2) {
|
|
265
|
+
if (k2 === undefined)
|
|
266
|
+
k2 = k;
|
|
267
|
+
o[k2] = m[k];
|
|
268
|
+
});
|
|
269
|
+
function __exportStar(m, o) {
|
|
270
|
+
for (var p in m)
|
|
271
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
272
|
+
__createBinding(o, m, p);
|
|
273
|
+
}
|
|
274
|
+
function __values(o) {
|
|
275
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
276
|
+
if (m)
|
|
277
|
+
return m.call(o);
|
|
278
|
+
if (o && typeof o.length === "number")
|
|
279
|
+
return {
|
|
280
|
+
next: function () {
|
|
281
|
+
if (o && i >= o.length)
|
|
282
|
+
o = void 0;
|
|
283
|
+
return { value: o && o[i++], done: !o };
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
287
|
+
}
|
|
288
|
+
function __read(o, n) {
|
|
289
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
290
|
+
if (!m)
|
|
291
|
+
return o;
|
|
292
|
+
var i = m.call(o), r, ar = [], e;
|
|
293
|
+
try {
|
|
294
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
295
|
+
ar.push(r.value);
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
e = { error: error };
|
|
299
|
+
}
|
|
300
|
+
finally {
|
|
301
|
+
try {
|
|
302
|
+
if (r && !r.done && (m = i["return"]))
|
|
303
|
+
m.call(i);
|
|
304
|
+
}
|
|
305
|
+
finally {
|
|
306
|
+
if (e)
|
|
307
|
+
throw e.error;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return ar;
|
|
311
|
+
}
|
|
312
|
+
/** @deprecated */
|
|
313
|
+
function __spread() {
|
|
314
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
315
|
+
ar = ar.concat(__read(arguments[i]));
|
|
316
|
+
return ar;
|
|
317
|
+
}
|
|
318
|
+
/** @deprecated */
|
|
319
|
+
function __spreadArrays() {
|
|
320
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
321
|
+
s += arguments[i].length;
|
|
322
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
323
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
324
|
+
r[k] = a[j];
|
|
325
|
+
return r;
|
|
326
|
+
}
|
|
327
|
+
function __spreadArray(to, from, pack) {
|
|
328
|
+
if (pack || arguments.length === 2)
|
|
329
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
330
|
+
if (ar || !(i in from)) {
|
|
331
|
+
if (!ar)
|
|
332
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
333
|
+
ar[i] = from[i];
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
337
|
+
}
|
|
338
|
+
function __await(v) {
|
|
339
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
340
|
+
}
|
|
341
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
342
|
+
if (!Symbol.asyncIterator)
|
|
343
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
344
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
345
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
346
|
+
function verb(n) { if (g[n])
|
|
347
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
348
|
+
function resume(n, v) { try {
|
|
349
|
+
step(g[n](v));
|
|
350
|
+
}
|
|
351
|
+
catch (e) {
|
|
352
|
+
settle(q[0][3], e);
|
|
353
|
+
} }
|
|
354
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
355
|
+
function fulfill(value) { resume("next", value); }
|
|
356
|
+
function reject(value) { resume("throw", value); }
|
|
357
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
358
|
+
resume(q[0][0], q[0][1]); }
|
|
359
|
+
}
|
|
360
|
+
function __asyncDelegator(o) {
|
|
361
|
+
var i, p;
|
|
362
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
363
|
+
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; }
|
|
364
|
+
}
|
|
365
|
+
function __asyncValues(o) {
|
|
366
|
+
if (!Symbol.asyncIterator)
|
|
367
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
368
|
+
var m = o[Symbol.asyncIterator], i;
|
|
369
|
+
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);
|
|
370
|
+
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); }); }; }
|
|
371
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
372
|
+
}
|
|
373
|
+
function __makeTemplateObject(cooked, raw) {
|
|
374
|
+
if (Object.defineProperty) {
|
|
375
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
cooked.raw = raw;
|
|
379
|
+
}
|
|
380
|
+
return cooked;
|
|
381
|
+
}
|
|
382
|
+
;
|
|
383
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
384
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
385
|
+
}) : function (o, v) {
|
|
386
|
+
o["default"] = v;
|
|
387
|
+
};
|
|
388
|
+
function __importStar(mod) {
|
|
389
|
+
if (mod && mod.__esModule)
|
|
390
|
+
return mod;
|
|
391
|
+
var result = {};
|
|
392
|
+
if (mod != null)
|
|
393
|
+
for (var k in mod)
|
|
394
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
395
|
+
__createBinding(result, mod, k);
|
|
396
|
+
__setModuleDefault(result, mod);
|
|
397
|
+
return result;
|
|
398
|
+
}
|
|
399
|
+
function __importDefault(mod) {
|
|
400
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
401
|
+
}
|
|
402
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
403
|
+
if (kind === "a" && !f)
|
|
404
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
405
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
406
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
407
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
408
|
+
}
|
|
409
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
410
|
+
if (kind === "m")
|
|
411
|
+
throw new TypeError("Private method is not writable");
|
|
412
|
+
if (kind === "a" && !f)
|
|
413
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
414
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
415
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
416
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
var FieldBase = /** @class */ (function () {
|
|
420
|
+
function FieldBase(label, name, type, formConfig, fb, deviceService) {
|
|
421
|
+
this.formConfig = formConfig;
|
|
422
|
+
this.fb = fb;
|
|
423
|
+
this.deviceService = deviceService;
|
|
424
|
+
this.fieldConfig = {
|
|
425
|
+
label: label,
|
|
426
|
+
name: name,
|
|
427
|
+
type: type
|
|
428
|
+
};
|
|
429
|
+
this.appearance().grid();
|
|
430
|
+
}
|
|
431
|
+
FieldBase.prototype.hide = function (hide) {
|
|
432
|
+
if (hide === void 0) { hide = true; }
|
|
433
|
+
this.fieldConfig.show = !hide;
|
|
434
|
+
return this;
|
|
435
|
+
};
|
|
436
|
+
FieldBase.prototype.focus = function () {
|
|
437
|
+
this.fieldConfig.focus = true;
|
|
438
|
+
return this;
|
|
439
|
+
};
|
|
440
|
+
FieldBase.prototype.syncValidator = function (validators) {
|
|
441
|
+
this.fieldConfig.syncValidators = validators;
|
|
442
|
+
return this;
|
|
443
|
+
};
|
|
444
|
+
FieldBase.prototype.asyncValidator = function (validators) {
|
|
445
|
+
this.fieldConfig.asyncValidators = validators;
|
|
446
|
+
return this;
|
|
447
|
+
};
|
|
448
|
+
FieldBase.prototype.disabled = function (disabled) {
|
|
449
|
+
if (disabled === void 0) { disabled = true; }
|
|
450
|
+
this.fieldConfig.disabled = disabled;
|
|
451
|
+
return this;
|
|
452
|
+
};
|
|
453
|
+
FieldBase.prototype.required = function (required) {
|
|
454
|
+
if (required === void 0) { required = true; }
|
|
455
|
+
this.fieldConfig.required = required;
|
|
456
|
+
return this;
|
|
457
|
+
};
|
|
458
|
+
FieldBase.prototype.textHint = function (hint) {
|
|
459
|
+
this.fieldConfig.textHint = hint;
|
|
460
|
+
return this;
|
|
461
|
+
};
|
|
462
|
+
FieldBase.prototype.min = function (min) {
|
|
463
|
+
this.fieldConfig.min = min;
|
|
464
|
+
return this;
|
|
465
|
+
};
|
|
466
|
+
FieldBase.prototype.max = function (max) {
|
|
467
|
+
this.fieldConfig.max = max;
|
|
468
|
+
return this;
|
|
469
|
+
};
|
|
470
|
+
FieldBase.prototype.minLength = function (min) {
|
|
471
|
+
this.fieldConfig.minLength = min;
|
|
472
|
+
return this;
|
|
473
|
+
};
|
|
474
|
+
FieldBase.prototype.maxLength = function (max) {
|
|
475
|
+
this.fieldConfig.maxLength = max;
|
|
476
|
+
return this;
|
|
477
|
+
};
|
|
478
|
+
FieldBase.prototype.multiple = function (multiple) {
|
|
479
|
+
if (multiple === void 0) { multiple = true; }
|
|
480
|
+
this.fieldConfig.multiple = multiple;
|
|
481
|
+
};
|
|
482
|
+
FieldBase.prototype.valueChanges = function (fn) {
|
|
483
|
+
this.fieldConfig.valueChanges = fn;
|
|
484
|
+
return this;
|
|
485
|
+
};
|
|
486
|
+
FieldBase.prototype.setValue = function (value) {
|
|
487
|
+
this.fieldConfig.value = value;
|
|
488
|
+
return this;
|
|
489
|
+
};
|
|
490
|
+
FieldBase.prototype.appearance = function (type, floatLabel) {
|
|
491
|
+
if (type === void 0) { type = "outline"; }
|
|
492
|
+
if (floatLabel === void 0) { floatLabel = "always"; }
|
|
493
|
+
this.fieldConfig.appearance = type;
|
|
494
|
+
this.fieldConfig.floatLabel = floatLabel;
|
|
495
|
+
return this;
|
|
496
|
+
};
|
|
497
|
+
FieldBase.prototype.grid = function (size, width) {
|
|
498
|
+
if (size === void 0) { size = 12; }
|
|
499
|
+
if (width === void 0) { width = 100; }
|
|
500
|
+
var _a;
|
|
501
|
+
if (this.deviceService.isMobile()) {
|
|
502
|
+
size = 12;
|
|
503
|
+
}
|
|
504
|
+
for (var colSize = 12; colSize >= 1; colSize--) {
|
|
505
|
+
this.fieldConfig.class = (_a = this.fieldConfig.class) === null || _a === void 0 ? void 0 : _a.replace('col-' + colSize, '');
|
|
506
|
+
}
|
|
507
|
+
this.addClass('col-' + size);
|
|
508
|
+
this.addFieldClass('w-' + width);
|
|
509
|
+
return this;
|
|
510
|
+
};
|
|
511
|
+
FieldBase.prototype.setOptions = function (options) {
|
|
512
|
+
this.fieldConfig.opcoesSelect = options;
|
|
513
|
+
return this;
|
|
514
|
+
};
|
|
515
|
+
FieldBase.prototype.addClass = function (className) {
|
|
516
|
+
var _a, _b;
|
|
517
|
+
if (this.deviceService.isMobile() &&
|
|
518
|
+
className.indexOf('col-') >= 0 &&
|
|
519
|
+
className.indexOf('col-12') === 0) {
|
|
520
|
+
className = className.replace('col-1', 'col-12')
|
|
521
|
+
.replace('col-2', 'col-12')
|
|
522
|
+
.replace('col-3', 'col-12')
|
|
523
|
+
.replace('col-4', 'col-12')
|
|
524
|
+
.replace('col-5', 'col-12')
|
|
525
|
+
.replace('col-6', 'col-12')
|
|
526
|
+
.replace('col-7', 'col-12')
|
|
527
|
+
.replace('col-8', 'col-12')
|
|
528
|
+
.replace('col-9', 'col-12')
|
|
529
|
+
.replace('col-10', 'col-12')
|
|
530
|
+
.replace('col-11', 'col-12');
|
|
531
|
+
}
|
|
532
|
+
this.fieldConfig.class = utils.koala(((_b = (_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.class) !== null && _b !== void 0 ? _b : '') + " " + className)
|
|
533
|
+
.string()
|
|
534
|
+
.split(' ')
|
|
535
|
+
.clearEmptyValues()
|
|
536
|
+
.toString(' ')
|
|
537
|
+
.getValue();
|
|
538
|
+
return this;
|
|
539
|
+
};
|
|
540
|
+
FieldBase.prototype.addFieldClass = function (className) {
|
|
541
|
+
var _a, _b;
|
|
542
|
+
this.fieldConfig.fieldClass = utils.koala(((_b = (_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.fieldClass) !== null && _b !== void 0 ? _b : '') + " " + className)
|
|
543
|
+
.string()
|
|
544
|
+
.split(' ')
|
|
545
|
+
.clearEmptyValues()
|
|
546
|
+
.toString(' ')
|
|
547
|
+
.getValue();
|
|
548
|
+
return this;
|
|
549
|
+
};
|
|
550
|
+
FieldBase.prototype.setCustomMasc = function (mask) {
|
|
551
|
+
this.fieldConfig.customMasc = mask;
|
|
552
|
+
return this;
|
|
553
|
+
};
|
|
554
|
+
FieldBase.prototype.generate = function () {
|
|
555
|
+
var getLastConfig = (this.formConfig.formConfig.length > 0) ?
|
|
556
|
+
this.formConfig.formConfig[this.formConfig.formConfig.length - 1] :
|
|
557
|
+
null;
|
|
558
|
+
if ((getLastConfig === null || getLastConfig === void 0 ? void 0 : getLastConfig.type) === exports.DynamicFormTypeFieldEnum.moreItems && (getLastConfig === null || getLastConfig === void 0 ? void 0 : getLastConfig.name) !== 'endMoreItems') {
|
|
559
|
+
this.formConfig.formConfig[this.formConfig.formConfig.length - 1].moreItemsConfig.formConfig.push(this.fieldConfig);
|
|
560
|
+
}
|
|
561
|
+
else {
|
|
562
|
+
if ((getLastConfig === null || getLastConfig === void 0 ? void 0 : getLastConfig.name) === 'endMoreItems') {
|
|
563
|
+
this.formConfig.formConfig.splice(this.formConfig.formConfig.length - 1, 1);
|
|
564
|
+
}
|
|
565
|
+
this.formConfig.formConfig.push(this.fieldConfig);
|
|
566
|
+
}
|
|
567
|
+
return new DynamicFormBuilder(this.fb, this.deviceService, this.formConfig.formConfig);
|
|
568
|
+
};
|
|
569
|
+
return FieldBase;
|
|
570
|
+
}());
|
|
571
|
+
|
|
572
|
+
var AutocompleteBuilder = /** @class */ (function (_super) {
|
|
573
|
+
__extends(AutocompleteBuilder, _super);
|
|
574
|
+
function AutocompleteBuilder(label, name, formConfig, fb, deviceService) {
|
|
575
|
+
return _super.call(this, label, name, exports.DynamicFormTypeFieldEnum.autocomplete, formConfig, fb, deviceService) || this;
|
|
576
|
+
}
|
|
577
|
+
AutocompleteBuilder.prototype.service = function (service) {
|
|
578
|
+
this.service$ = service;
|
|
579
|
+
return this;
|
|
580
|
+
};
|
|
581
|
+
AutocompleteBuilder.prototype.defaultValueOnClean = function (value) {
|
|
582
|
+
this.fieldConfig.autocompleteDefaultValueOnClear = value;
|
|
583
|
+
return this;
|
|
584
|
+
};
|
|
585
|
+
AutocompleteBuilder.prototype.loadOptions = function (type, onDemandFilter) {
|
|
586
|
+
this.fieldConfig.autocompleteType = type;
|
|
587
|
+
if (type === "all") {
|
|
588
|
+
var options$_1 = new rxjs.BehaviorSubject([]);
|
|
589
|
+
this.service$.subscribe(function (options) { return options$_1.next(options); });
|
|
590
|
+
this.fieldConfig.autocompleteOptions = options$_1;
|
|
591
|
+
}
|
|
592
|
+
else {
|
|
593
|
+
this.fieldConfig.autocompleteFilter = onDemandFilter;
|
|
594
|
+
}
|
|
595
|
+
return this;
|
|
596
|
+
};
|
|
597
|
+
AutocompleteBuilder.prototype.colorChipConfig = function (fn) {
|
|
598
|
+
this.fieldConfig.autocompleteMultipleConfig = new rxjs.BehaviorSubject(null);
|
|
599
|
+
fn(this.fieldConfig.autocompleteMultipleConfig);
|
|
600
|
+
return this;
|
|
601
|
+
};
|
|
602
|
+
return AutocompleteBuilder;
|
|
603
|
+
}(FieldBase));
|
|
604
|
+
|
|
605
|
+
var FieldBuilder = /** @class */ (function (_super) {
|
|
606
|
+
__extends(FieldBuilder, _super);
|
|
607
|
+
function FieldBuilder(label, name, type, formConfig, fb, deviceService) {
|
|
608
|
+
return _super.call(this, label, name, type, formConfig, fb, deviceService) || this;
|
|
609
|
+
}
|
|
610
|
+
return FieldBuilder;
|
|
611
|
+
}(FieldBase));
|
|
612
|
+
|
|
613
|
+
var MoreItemsBuilder = /** @class */ (function () {
|
|
614
|
+
function MoreItemsBuilder(label, name, btnAddLabel, min, max, formConfig, fb, deviceService) {
|
|
615
|
+
this.label = label;
|
|
616
|
+
this.name = name;
|
|
617
|
+
this.btnAddLabel = btnAddLabel;
|
|
618
|
+
this.min = min;
|
|
619
|
+
this.max = max;
|
|
620
|
+
this.formConfig = formConfig;
|
|
621
|
+
this.fb = fb;
|
|
622
|
+
this.deviceService = deviceService;
|
|
623
|
+
}
|
|
624
|
+
MoreItemsBuilder.prototype.build = function () {
|
|
625
|
+
var getLastConfig = (this.formConfig.formConfig.length > 0) ?
|
|
626
|
+
this.formConfig.formConfig[this.formConfig.formConfig.length - 1] :
|
|
627
|
+
null;
|
|
628
|
+
this.fieldConfig = {
|
|
629
|
+
label: this.label,
|
|
630
|
+
name: this.name,
|
|
631
|
+
type: exports.DynamicFormTypeFieldEnum.moreItems,
|
|
632
|
+
moreItemsIconBackgroundColor: '#fff',
|
|
633
|
+
moreItemsIconFontColor: '#212121',
|
|
634
|
+
moreItemsMinItems: this.min,
|
|
635
|
+
moreItemsMaxItems: this.max,
|
|
636
|
+
moreItemsButtonIconAddlabel: this.btnAddLabel,
|
|
637
|
+
moreItemsConfig: {
|
|
638
|
+
form: this.fb.group({}),
|
|
639
|
+
formConfig: [],
|
|
640
|
+
setValues: new rxjs.BehaviorSubject([])
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
if ((getLastConfig === null || getLastConfig === void 0 ? void 0 : getLastConfig.type) === exports.DynamicFormTypeFieldEnum.moreItems && (getLastConfig === null || getLastConfig === void 0 ? void 0 : getLastConfig.name) !== 'endMoreItems') {
|
|
644
|
+
var formConfigMoreItems = getLastConfig.moreItemsConfig.formConfig;
|
|
645
|
+
if (formConfigMoreItems.length > 0) {
|
|
646
|
+
var lastIndexMoreItems_1 = 0;
|
|
647
|
+
formConfigMoreItems.forEach(function (item, index) {
|
|
648
|
+
if (item.type === exports.DynamicFormTypeFieldEnum.moreItems)
|
|
649
|
+
lastIndexMoreItems_1 = index;
|
|
650
|
+
});
|
|
651
|
+
formConfigMoreItems[lastIndexMoreItems_1].moreItemsConfig.formConfig.push(this.fieldConfig);
|
|
652
|
+
}
|
|
653
|
+
else {
|
|
654
|
+
this.formConfig.formConfig[this.formConfig.formConfig.length - 1].moreItemsConfig.formConfig.push(this.fieldConfig);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
else {
|
|
658
|
+
if ((getLastConfig === null || getLastConfig === void 0 ? void 0 : getLastConfig.name) === 'endMoreItems') {
|
|
659
|
+
this.formConfig.formConfig.splice(this.formConfig.formConfig.length - 1, 1);
|
|
660
|
+
}
|
|
661
|
+
this.formConfig.formConfig.push(this.fieldConfig);
|
|
662
|
+
}
|
|
663
|
+
return new DynamicFormBuilder(this.fb, this.deviceService, this.formConfig.formConfig);
|
|
664
|
+
};
|
|
665
|
+
return MoreItemsBuilder;
|
|
666
|
+
}());
|
|
667
|
+
|
|
668
|
+
var DynamicFormBuilder = /** @class */ (function () {
|
|
669
|
+
function DynamicFormBuilder(fb, deviceService, configInMemory) {
|
|
670
|
+
this.fb = fb;
|
|
671
|
+
this.deviceService = deviceService;
|
|
672
|
+
this.config = {
|
|
673
|
+
form: fb.group({}),
|
|
674
|
+
formConfig: configInMemory !== null && configInMemory !== void 0 ? configInMemory : [],
|
|
675
|
+
setValues: new rxjs.BehaviorSubject(null),
|
|
676
|
+
showFields: new rxjs.BehaviorSubject(null)
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
DynamicFormBuilder.prototype.field = function (label, name, type) {
|
|
680
|
+
switch (type) {
|
|
681
|
+
case "id":
|
|
682
|
+
case "text":
|
|
683
|
+
case "textarea":
|
|
684
|
+
case "number":
|
|
685
|
+
case "stringNumber":
|
|
686
|
+
case "cnpj":
|
|
687
|
+
case "cpf":
|
|
688
|
+
case "coin":
|
|
689
|
+
case "color":
|
|
690
|
+
case "date":
|
|
691
|
+
case "datetime":
|
|
692
|
+
case "email":
|
|
693
|
+
case "float":
|
|
694
|
+
case "password":
|
|
695
|
+
case "percent":
|
|
696
|
+
case "phone":
|
|
697
|
+
case "time":
|
|
698
|
+
case "hoursAndMinutes":
|
|
699
|
+
case "textLogs":
|
|
700
|
+
case "valueList":
|
|
701
|
+
case "checkbox":
|
|
702
|
+
case "radio":
|
|
703
|
+
case "select":
|
|
704
|
+
case "selectMultipleNative":
|
|
705
|
+
case "month":
|
|
706
|
+
case "competenceDate":
|
|
707
|
+
case "stringWithCustomMasc":
|
|
708
|
+
return new FieldBuilder(label, name, exports.DynamicFormTypeFieldEnum[type], this.config, this.fb, this.deviceService);
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
DynamicFormBuilder.prototype.autocomplete = function (label, name) {
|
|
712
|
+
return new AutocompleteBuilder(label, name, this.config, this.fb, this.deviceService);
|
|
713
|
+
};
|
|
714
|
+
DynamicFormBuilder.prototype.simpleMoreItems = function (label, name, btnAddLabel, min, max) {
|
|
715
|
+
return new MoreItemsBuilder(label, name, btnAddLabel, min, max, this.config, this.fb, this.deviceService);
|
|
716
|
+
};
|
|
717
|
+
DynamicFormBuilder.prototype.autofill = function (object) {
|
|
718
|
+
var _this = this;
|
|
719
|
+
if (object) {
|
|
720
|
+
var setValues_1 = [];
|
|
721
|
+
Object.keys(object).forEach(function (indexName) {
|
|
722
|
+
var _a;
|
|
723
|
+
var arrField = utils.koala(_this.config.formConfig).array().filter(indexName, 'name').getValue();
|
|
724
|
+
var field = (_a = arrField[0]) !== null && _a !== void 0 ? _a : null;
|
|
725
|
+
if (typeof object[indexName] !== "object" ||
|
|
726
|
+
field.type === exports.DynamicFormTypeFieldEnum.autocomplete ||
|
|
727
|
+
field.type === exports.DynamicFormTypeFieldEnum.selectMultipleNative) {
|
|
728
|
+
if ((field === null || field === void 0 ? void 0 : field.type) === exports.DynamicFormTypeFieldEnum.textLogs) {
|
|
729
|
+
field.textObs = object[indexName];
|
|
730
|
+
}
|
|
731
|
+
else {
|
|
732
|
+
setValues_1.push({
|
|
733
|
+
name: indexName,
|
|
734
|
+
value: object[indexName]
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
else {
|
|
739
|
+
if (field.type === exports.DynamicFormTypeFieldEnum.moreItems) {
|
|
740
|
+
var setValuesMoreItems_1 = [];
|
|
741
|
+
var objectMoreItems = object[indexName];
|
|
742
|
+
objectMoreItems.forEach(function (objectItem) {
|
|
743
|
+
var moreItemValues = [];
|
|
744
|
+
Object.keys(objectItem).forEach(function (objectIndexName) {
|
|
745
|
+
moreItemValues.push({
|
|
746
|
+
name: objectIndexName,
|
|
747
|
+
value: objectItem[objectIndexName]
|
|
748
|
+
});
|
|
749
|
+
});
|
|
750
|
+
setValuesMoreItems_1.push(new rxjs.BehaviorSubject(moreItemValues));
|
|
751
|
+
});
|
|
752
|
+
field.moreItemsConfig.setValues.next(setValuesMoreItems_1);
|
|
753
|
+
}
|
|
754
|
+
else if (field.type === exports.DynamicFormTypeFieldEnum.dynamicForm) {
|
|
755
|
+
var dynamicFormObject_1 = object[indexName];
|
|
756
|
+
var dynamicFormSetValues_1 = [];
|
|
757
|
+
Object.keys(dynamicFormObject_1).forEach(function (dynamicFormIndexName) {
|
|
758
|
+
var _a;
|
|
759
|
+
var arrDynamicField = utils.koala(field.dynamicFormConfig.formConfig).array().filter(indexName, 'name').getValue();
|
|
760
|
+
var dynamicField = (_a = arrDynamicField[0]) !== null && _a !== void 0 ? _a : null;
|
|
761
|
+
if ((dynamicField === null || dynamicField === void 0 ? void 0 : dynamicField.type) === exports.DynamicFormTypeFieldEnum.textLogs) {
|
|
762
|
+
dynamicField.textObs = object[indexName];
|
|
763
|
+
}
|
|
764
|
+
else {
|
|
765
|
+
dynamicFormSetValues_1.push({
|
|
766
|
+
name: dynamicFormIndexName,
|
|
767
|
+
value: dynamicFormObject_1[dynamicFormIndexName]
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
});
|
|
771
|
+
field.dynamicFormConfig.setValues.next(dynamicFormSetValues_1);
|
|
772
|
+
}
|
|
773
|
+
else {
|
|
774
|
+
_this.autofill(object[indexName]);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
});
|
|
778
|
+
this.config.setValues.next(setValues_1);
|
|
779
|
+
}
|
|
780
|
+
return this;
|
|
781
|
+
};
|
|
782
|
+
DynamicFormBuilder.prototype.literalConfig = function (config) {
|
|
783
|
+
this.config.formConfig.push(config);
|
|
784
|
+
if (config.type === exports.DynamicFormTypeFieldEnum.moreItems)
|
|
785
|
+
this.generateMoreItems();
|
|
786
|
+
return this;
|
|
787
|
+
};
|
|
788
|
+
DynamicFormBuilder.prototype.generate = function () {
|
|
789
|
+
this.config.formConfig = this.config.formConfig.filter(function (config) { return config.name !== 'endMoreItems'; });
|
|
790
|
+
return this.config;
|
|
791
|
+
};
|
|
792
|
+
DynamicFormBuilder.prototype.generateMoreItems = function () {
|
|
793
|
+
this.config.formConfig.push({
|
|
794
|
+
name: 'endMoreItems',
|
|
795
|
+
type: exports.DynamicFormTypeFieldEnum.moreItems
|
|
796
|
+
});
|
|
797
|
+
return new DynamicFormBuilder(this.fb, this.deviceService, this.config.formConfig);
|
|
798
|
+
};
|
|
799
|
+
return DynamicFormBuilder;
|
|
800
|
+
}());
|
|
801
|
+
|
|
802
|
+
function DateMinValidator(min) {
|
|
803
|
+
return function (control) {
|
|
804
|
+
if (control.value && typeof min === 'string') {
|
|
805
|
+
if (new Date(control.value) < new Date(min)) {
|
|
806
|
+
return { dateMin: true };
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
return null;
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
function DateMaxValidator(max) {
|
|
814
|
+
return function (control) {
|
|
815
|
+
if (control.value && typeof max === 'string') {
|
|
816
|
+
if (new Date(control.value) > new Date(max)) {
|
|
817
|
+
return { dateMax: true };
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
return null;
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
var KoalaDynamicFormService = /** @class */ (function () {
|
|
825
|
+
function KoalaDynamicFormService(fb, deviceService) {
|
|
826
|
+
this.fb = fb;
|
|
827
|
+
this.deviceService = deviceService;
|
|
828
|
+
}
|
|
829
|
+
KoalaDynamicFormService.prototype.build = function () {
|
|
830
|
+
return new DynamicFormBuilder(this.fb, this.deviceService);
|
|
831
|
+
};
|
|
832
|
+
KoalaDynamicFormService.prototype.updateValidator = function (formGroup, name, type, value) {
|
|
833
|
+
if (type === 'required' && typeof value !== 'boolean') {
|
|
834
|
+
throw new Error("Type required cannot be a " + typeof value);
|
|
835
|
+
}
|
|
836
|
+
else if ((type === 'min' || type === 'max') && typeof value === "boolean") {
|
|
837
|
+
throw new Error("Type " + type + " cannot be a boolean");
|
|
838
|
+
}
|
|
839
|
+
var formArray = formGroup.get('formData');
|
|
840
|
+
var control = formArray.controls.find(function (control) { return control.get('name').value === name; });
|
|
841
|
+
if (control) {
|
|
842
|
+
var currentRequired = control.get('required').value;
|
|
843
|
+
var currentMin = control.get('min').value;
|
|
844
|
+
var currentMax = control.get('max').value;
|
|
845
|
+
var validators = [];
|
|
846
|
+
control.get('value').clearValidators();
|
|
847
|
+
control.get('value').setErrors(null);
|
|
848
|
+
if ((type === "required" && value) || currentRequired) {
|
|
849
|
+
validators.push(i1.Validators.required);
|
|
850
|
+
control.get('value').setErrors({ required: true });
|
|
851
|
+
}
|
|
852
|
+
if ((type === "min" || currentMin)) {
|
|
853
|
+
if (typeof value === "number") {
|
|
854
|
+
validators.push(i1.Validators.min((type === "min" ? value : currentMin)));
|
|
855
|
+
control.get('value').setErrors({ min: true });
|
|
856
|
+
}
|
|
857
|
+
else if (typeof value === "string") {
|
|
858
|
+
validators.push(DateMinValidator((type === "min" ? value : currentMin)));
|
|
859
|
+
control.get('value').setErrors({ dateMin: true });
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
if ((type === "max" || currentMax)) {
|
|
863
|
+
if (typeof value === "number") {
|
|
864
|
+
validators.push(i1.Validators.max((type === "max" ? value : currentMax)));
|
|
865
|
+
control.get('value').setErrors({ max: true });
|
|
866
|
+
}
|
|
867
|
+
else if (typeof value === "string") {
|
|
868
|
+
validators.push(DateMaxValidator((type === "max" ? value : currentMax)));
|
|
869
|
+
control.get('value').setErrors({ dateMax: true });
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
if (type === "required") {
|
|
873
|
+
control.get('required').setValue(value);
|
|
874
|
+
}
|
|
875
|
+
else if (type === "min") {
|
|
876
|
+
control.get('min').setValue(value);
|
|
877
|
+
}
|
|
878
|
+
else if (type === "max") {
|
|
879
|
+
control.get('max').setValue(value);
|
|
880
|
+
}
|
|
881
|
+
control.get('value').setValidators(validators);
|
|
882
|
+
control.get('value').updateValueAndValidity();
|
|
883
|
+
}
|
|
884
|
+
};
|
|
885
|
+
KoalaDynamicFormService.prototype.emitData = function (form) {
|
|
886
|
+
var _this = this;
|
|
887
|
+
var data = {};
|
|
888
|
+
var formArray = form.get('formData');
|
|
889
|
+
formArray === null || formArray === void 0 ? void 0 : formArray.controls.forEach(function (control) {
|
|
890
|
+
var _a;
|
|
891
|
+
if (control.get('show').value.getValue() !== false) {
|
|
892
|
+
var value_1 = control.get('value').value;
|
|
893
|
+
if (control.get('type').value === exports.DynamicFormTypeFieldEnum.valueList) {
|
|
894
|
+
if (value_1 === null || value_1 === undefined) {
|
|
895
|
+
value_1 = '';
|
|
896
|
+
}
|
|
897
|
+
value_1 = utils.koala(value_1).string().split().getValue();
|
|
898
|
+
}
|
|
899
|
+
else if (control.get('type').value === exports.DynamicFormTypeFieldEnum.moreItems) {
|
|
900
|
+
var moreItems = control.get('moreItemsConfig').value;
|
|
901
|
+
value_1 = [];
|
|
902
|
+
moreItems.forEach(function (item) {
|
|
903
|
+
value_1.push(_this.emitData(item.form));
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
else if (control.get('type').value === exports.DynamicFormTypeFieldEnum.autocomplete) {
|
|
907
|
+
if (control.get('multiple').value) {
|
|
908
|
+
var options = control.get('autocompleteSelectedValue').value;
|
|
909
|
+
value_1 = options === null || options === void 0 ? void 0 : options.map(function (item) { return item === null || item === void 0 ? void 0 : item.value; });
|
|
910
|
+
}
|
|
911
|
+
else {
|
|
912
|
+
value_1 = (((_a = control.get('autocompleteSelectedValue').value) === null || _a === void 0 ? void 0 : _a.value) ?
|
|
913
|
+
control.get('autocompleteSelectedValue').value.value :
|
|
914
|
+
control.get('autocompleteSelectedValue').value);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
else if (control.get('type').value === exports.DynamicFormTypeFieldEnum.dynamicForm) {
|
|
918
|
+
var dynamicFormConfig = control.get('dynamicFormConfig').value;
|
|
919
|
+
value_1 = _this.emitData(dynamicFormConfig.getValue().form);
|
|
920
|
+
}
|
|
921
|
+
else if (control.get('type').value === exports.DynamicFormTypeFieldEnum.number) {
|
|
922
|
+
value_1 = parseInt(value_1);
|
|
923
|
+
}
|
|
924
|
+
else if ((control.get('type').value === exports.DynamicFormTypeFieldEnum.float ||
|
|
925
|
+
control.get('type').value === exports.DynamicFormTypeFieldEnum.percent) && typeof value_1 === "string") {
|
|
926
|
+
value_1 = parseFloat(value_1.replace(/,/g, '.'));
|
|
927
|
+
}
|
|
928
|
+
else if (control.get('type').value === exports.DynamicFormTypeFieldEnum.coin &&
|
|
929
|
+
typeof value_1 === "string") {
|
|
930
|
+
value_1 = utils.koala(value_1).string().unmaskCoin().getValue();
|
|
931
|
+
}
|
|
932
|
+
data[control.get('name').value] = value_1;
|
|
933
|
+
}
|
|
934
|
+
});
|
|
935
|
+
return data;
|
|
936
|
+
};
|
|
937
|
+
KoalaDynamicFormService.prototype.resetForm = function (form) {
|
|
938
|
+
var formArray = form.get('formData');
|
|
939
|
+
formArray.controls.forEach(function (control) {
|
|
940
|
+
if (control.get('type').value === exports.DynamicFormTypeFieldEnum.moreItems) {
|
|
941
|
+
control.get('moreItemsConfig').setValue([]);
|
|
942
|
+
}
|
|
943
|
+
else {
|
|
944
|
+
control.get('value').reset();
|
|
945
|
+
}
|
|
946
|
+
});
|
|
947
|
+
};
|
|
948
|
+
KoalaDynamicFormService.prototype.setValuesInMoreItemsForm = function (subject, values) {
|
|
949
|
+
var valuesMoreItems = [];
|
|
950
|
+
values.forEach(function (itemValue) {
|
|
951
|
+
valuesMoreItems.push(new rxjs.BehaviorSubject(itemValue));
|
|
952
|
+
});
|
|
953
|
+
subject.next(valuesMoreItems);
|
|
954
|
+
};
|
|
955
|
+
KoalaDynamicFormService.prototype.autocompleteFilterOnServer = function (request, nameConfig, indexNameByValue) {
|
|
956
|
+
var _this = this;
|
|
957
|
+
return new rxjs.Observable(function (observe) {
|
|
958
|
+
request().then(function (response) {
|
|
959
|
+
var options = [];
|
|
960
|
+
response.forEach(function (item) {
|
|
961
|
+
var _a;
|
|
962
|
+
var value = '';
|
|
963
|
+
if ((indexNameByValue === null || indexNameByValue === void 0 ? void 0 : indexNameByValue.indexOf(' > ')) >= 0) {
|
|
964
|
+
value = _this.getValueByStringPath(indexNameByValue, item);
|
|
965
|
+
}
|
|
966
|
+
else if (indexNameByValue) {
|
|
967
|
+
value = item[indexNameByValue];
|
|
968
|
+
}
|
|
969
|
+
else {
|
|
970
|
+
value = item;
|
|
971
|
+
}
|
|
972
|
+
options.push({
|
|
973
|
+
name: utils.koala(item).object().toString(nameConfig.propsByName, ((_a = nameConfig.delimiter) !== null && _a !== void 0 ? _a : ' ')).getValue(),
|
|
974
|
+
value: value
|
|
975
|
+
});
|
|
976
|
+
});
|
|
977
|
+
observe.next(options);
|
|
978
|
+
});
|
|
979
|
+
});
|
|
980
|
+
};
|
|
981
|
+
KoalaDynamicFormService.prototype.showFields = function (subject, names, show, clearCurrentValue) {
|
|
982
|
+
if (clearCurrentValue === void 0) { clearCurrentValue = false; }
|
|
983
|
+
var fields = [];
|
|
984
|
+
names.forEach(function (name) {
|
|
985
|
+
fields.push({
|
|
986
|
+
name: name,
|
|
987
|
+
show: show,
|
|
988
|
+
clearCurrentValue: clearCurrentValue
|
|
989
|
+
});
|
|
990
|
+
});
|
|
991
|
+
subject.next(fields);
|
|
992
|
+
};
|
|
993
|
+
KoalaDynamicFormService.prototype.getValueByStringPath = function (indexNameByValue, item) {
|
|
994
|
+
var value;
|
|
995
|
+
var partsIndex = indexNameByValue.split(' > ');
|
|
996
|
+
var partIndex = 0;
|
|
997
|
+
do {
|
|
998
|
+
if (!value) {
|
|
999
|
+
value = item[partsIndex[partIndex]];
|
|
1000
|
+
}
|
|
1001
|
+
else {
|
|
1002
|
+
value = value[partsIndex[partIndex]];
|
|
1003
|
+
}
|
|
1004
|
+
partIndex++;
|
|
1005
|
+
} while (partIndex < partsIndex.length);
|
|
1006
|
+
return value;
|
|
1007
|
+
};
|
|
1008
|
+
return KoalaDynamicFormService;
|
|
1009
|
+
}());
|
|
1010
|
+
KoalaDynamicFormService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function KoalaDynamicFormService_Factory() { return new KoalaDynamicFormService(i0__namespace.ɵɵinject(i1__namespace.FormBuilder), i0__namespace.ɵɵinject(i2__namespace.DeviceDetectorService)); }, token: KoalaDynamicFormService, providedIn: "any" });
|
|
1011
|
+
KoalaDynamicFormService.decorators = [
|
|
1012
|
+
{ type: i0.Injectable, args: [{ providedIn: "any" },] }
|
|
1013
|
+
];
|
|
1014
|
+
KoalaDynamicFormService.ctorParameters = function () { return [
|
|
1015
|
+
{ type: i1.FormBuilder },
|
|
1016
|
+
{ type: i2.DeviceDetectorService }
|
|
1017
|
+
]; };
|
|
1018
|
+
|
|
1019
|
+
var ValidationHelper = /** @class */ (function () {
|
|
1020
|
+
function ValidationHelper() {
|
|
1021
|
+
}
|
|
1022
|
+
ValidationHelper.validateCpf = function (value) {
|
|
1023
|
+
function calcChecker1(digits) {
|
|
1024
|
+
var sum = null;
|
|
1025
|
+
for (var j = 0; j < 9; ++j) {
|
|
1026
|
+
sum += digits.toString().charAt(j) * (10 - j);
|
|
1027
|
+
}
|
|
1028
|
+
var lastSumChecker1 = sum % 11;
|
|
1029
|
+
return lastSumChecker1 < 2 ? 0 : 11 - lastSumChecker1;
|
|
1030
|
+
}
|
|
1031
|
+
function calcChecker2(cpfWithChecker1) {
|
|
1032
|
+
var sum = null;
|
|
1033
|
+
for (var k = 0; k < 10; ++k) {
|
|
1034
|
+
sum += cpfWithChecker1.toString().charAt(k) * (11 - k);
|
|
1035
|
+
}
|
|
1036
|
+
var lastSumChecker2 = sum % 11;
|
|
1037
|
+
return lastSumChecker2 < 2 ? 0 : 11 - lastSumChecker2;
|
|
1038
|
+
}
|
|
1039
|
+
var cleanCPF = value.replace(/\.|\-|\s/g, '');
|
|
1040
|
+
var firstNineDigits = cleanCPF.substring(0, 9);
|
|
1041
|
+
var checker = cleanCPF.substring(9, 11);
|
|
1042
|
+
if (cleanCPF.length !== 11) {
|
|
1043
|
+
return false;
|
|
1044
|
+
}
|
|
1045
|
+
// Checking if all digits are equal
|
|
1046
|
+
for (var i = 0; i < 10; i++) {
|
|
1047
|
+
if ('' + firstNineDigits + checker === Array(12).join("" + i)) {
|
|
1048
|
+
return false;
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
var checker1 = calcChecker1(firstNineDigits);
|
|
1052
|
+
var checker2 = calcChecker2(firstNineDigits + '' + checker1);
|
|
1053
|
+
return checker.toString() === checker1.toString() + checker2.toString();
|
|
1054
|
+
};
|
|
1055
|
+
ValidationHelper.validateCnpj = function (value) {
|
|
1056
|
+
value = value.replace(/[^\d]+/g, '');
|
|
1057
|
+
if (value === '') {
|
|
1058
|
+
return false;
|
|
1059
|
+
}
|
|
1060
|
+
if (value.length !== 14) {
|
|
1061
|
+
return false;
|
|
1062
|
+
}
|
|
1063
|
+
// Elimina CNPJs invalidos conhecidos
|
|
1064
|
+
if (value === '00000000000000' ||
|
|
1065
|
+
value === '11111111111111' ||
|
|
1066
|
+
value === '22222222222222' ||
|
|
1067
|
+
value === '33333333333333' ||
|
|
1068
|
+
value === '44444444444444' ||
|
|
1069
|
+
value === '55555555555555' ||
|
|
1070
|
+
value === '66666666666666' ||
|
|
1071
|
+
value === '77777777777777' ||
|
|
1072
|
+
value === '88888888888888' ||
|
|
1073
|
+
value === '99999999999999') {
|
|
1074
|
+
return false;
|
|
1075
|
+
}
|
|
1076
|
+
// Valida DVs
|
|
1077
|
+
var tamanho = value.length - 2;
|
|
1078
|
+
var numeros = value.substring(0, tamanho);
|
|
1079
|
+
var digitos = value.substring(tamanho);
|
|
1080
|
+
var soma = 0;
|
|
1081
|
+
var pos = tamanho - 7;
|
|
1082
|
+
for (var i = tamanho; i >= 1; i--) {
|
|
1083
|
+
soma += parseInt(numeros.charAt(tamanho - i), 10) * pos--;
|
|
1084
|
+
if (pos < 2) {
|
|
1085
|
+
pos = 9;
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
var resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
|
|
1089
|
+
if (resultado !== parseInt(digitos.charAt(0), 10)) {
|
|
1090
|
+
return false;
|
|
1091
|
+
}
|
|
1092
|
+
tamanho = tamanho + 1;
|
|
1093
|
+
numeros = value.substring(0, tamanho);
|
|
1094
|
+
soma = 0;
|
|
1095
|
+
pos = tamanho - 7;
|
|
1096
|
+
for (var i = tamanho; i >= 1; i--) {
|
|
1097
|
+
soma += parseInt(numeros.charAt(tamanho - i), 10) * pos--;
|
|
1098
|
+
if (pos < 2) {
|
|
1099
|
+
pos = 9;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
|
|
1103
|
+
return !(resultado !== parseInt(digitos.charAt(1), 10));
|
|
1104
|
+
};
|
|
1105
|
+
return ValidationHelper;
|
|
1106
|
+
}());
|
|
1107
|
+
|
|
1108
|
+
function CpfValidator(control) {
|
|
1109
|
+
if (control.value) {
|
|
1110
|
+
if (control.value.length <= 14 && !ValidationHelper.validateCpf(control.value)) {
|
|
1111
|
+
return { cpfInvalid: true };
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
return null;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
function CnpjValidator(control) {
|
|
1118
|
+
if (control.value) {
|
|
1119
|
+
if (control.value.length > 14 && !ValidationHelper.validateCnpj(control.value)) {
|
|
1120
|
+
return { cnpjInvalid: true };
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
return null;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
function AutocompleteSelectedValidator(control) {
|
|
1127
|
+
if (control.value &&
|
|
1128
|
+
control.value.hasOwnProperty('value') &&
|
|
1129
|
+
control.value.hasOwnProperty('name') &&
|
|
1130
|
+
Object.keys(control.value).length === 2) {
|
|
1131
|
+
return null;
|
|
1132
|
+
}
|
|
1133
|
+
return { autocompleteSelected: true };
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
var KoalaDynamicFormValidatorResultHelper = /** @class */ (function () {
|
|
1137
|
+
function KoalaDynamicFormValidatorResultHelper() {
|
|
1138
|
+
}
|
|
1139
|
+
KoalaDynamicFormValidatorResultHelper.generate = function (errorMessage) {
|
|
1140
|
+
return {
|
|
1141
|
+
customError: {
|
|
1142
|
+
message: errorMessage
|
|
1143
|
+
}
|
|
1144
|
+
};
|
|
1145
|
+
};
|
|
1146
|
+
return KoalaDynamicFormValidatorResultHelper;
|
|
1147
|
+
}());
|
|
1148
|
+
|
|
1149
|
+
var ShowInvalidFields = /** @class */ (function () {
|
|
1150
|
+
function ShowInvalidFields() {
|
|
1151
|
+
}
|
|
1152
|
+
ShowInvalidFields.prototype.isErrorState = function (control, form) {
|
|
1153
|
+
var isSubmitted = form && form.submitted;
|
|
1154
|
+
return !!(control && control.invalid && (control.errors || control.dirty || control.touched || isSubmitted));
|
|
1155
|
+
};
|
|
1156
|
+
return ShowInvalidFields;
|
|
1157
|
+
}());
|
|
1158
|
+
|
|
1159
|
+
var FormAbstract = /** @class */ (function () {
|
|
1160
|
+
function FormAbstract(formAbstract) {
|
|
1161
|
+
this.formAbstract = formAbstract;
|
|
1162
|
+
this.loader = new rxjs.BehaviorSubject(false);
|
|
1163
|
+
this.btnSubmitDisabled = false;
|
|
1164
|
+
this.getData = new rxjs.BehaviorSubject(false);
|
|
1165
|
+
}
|
|
1166
|
+
FormAbstract.prototype.selecionarAutocomplete = function (controlName, obj, indexName) {
|
|
1167
|
+
if (obj) {
|
|
1168
|
+
var value_1 = indexName ? obj[indexName] : obj;
|
|
1169
|
+
if (Array.isArray(obj)) {
|
|
1170
|
+
value_1 = [];
|
|
1171
|
+
obj.forEach(function (item) {
|
|
1172
|
+
value_1.push(indexName ? item[indexName] : item);
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
this.formAbstract().get(controlName).setValue(value_1);
|
|
1176
|
+
}
|
|
1177
|
+
else {
|
|
1178
|
+
this.formAbstract().get(controlName).setValue('');
|
|
1179
|
+
}
|
|
1180
|
+
};
|
|
1181
|
+
FormAbstract.prototype.btnClickGetData = function () {
|
|
1182
|
+
this.getData.next(true);
|
|
1183
|
+
};
|
|
1184
|
+
FormAbstract.prototype.enableShowInvalidFields = function () {
|
|
1185
|
+
this.showInvalidFields = new ShowInvalidFields();
|
|
1186
|
+
};
|
|
1187
|
+
FormAbstract.prototype.loading = function (show, btnLabel) {
|
|
1188
|
+
if (show === void 0) { show = true; }
|
|
1189
|
+
this.btnSubmitDisabled = show;
|
|
1190
|
+
this.loader.next(show);
|
|
1191
|
+
if (show) {
|
|
1192
|
+
this.btnLabel = btnLabel ? btnLabel : 'Enviando Dados...';
|
|
1193
|
+
}
|
|
1194
|
+
else {
|
|
1195
|
+
this.btnLabel = btnLabel ? btnLabel : 'Enviar';
|
|
1196
|
+
}
|
|
1197
|
+
};
|
|
1198
|
+
return FormAbstract;
|
|
1199
|
+
}());
|
|
1200
|
+
|
|
1201
|
+
var DynamicFormComponent = /** @class */ (function (_super) {
|
|
1202
|
+
__extends(DynamicFormComponent, _super);
|
|
1203
|
+
function DynamicFormComponent(fb, dynamicFormService) {
|
|
1204
|
+
var _this = _super.call(this, function () { return _this.form; }) || this;
|
|
1205
|
+
_this.fb = fb;
|
|
1206
|
+
_this.dynamicFormService = dynamicFormService;
|
|
1207
|
+
_this.tabIndexStart = 1;
|
|
1208
|
+
_this.typeField = exports.DynamicFormTypeFieldEnum;
|
|
1209
|
+
_this.hoursAndMinutesMask = '00:000';
|
|
1210
|
+
_this.errorMessage = core.KoalaLanguageHelper;
|
|
1211
|
+
return _this;
|
|
1212
|
+
}
|
|
1213
|
+
DynamicFormComponent.prototype.ngOnInit = function () {
|
|
1214
|
+
var _this = this;
|
|
1215
|
+
var _a;
|
|
1216
|
+
if (!this.form.get('formData')) {
|
|
1217
|
+
this.form.addControl('formData', this.fb.array([]));
|
|
1218
|
+
}
|
|
1219
|
+
this.controls = this.form.get('formData');
|
|
1220
|
+
(_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.forEach(function (config, indexConfig) {
|
|
1221
|
+
var newFormGroup = _this.newControl(config);
|
|
1222
|
+
if (config.asyncValidators) {
|
|
1223
|
+
newFormGroup.get('value').setAsyncValidators(config.asyncValidators);
|
|
1224
|
+
}
|
|
1225
|
+
newFormGroup.get('value').updateValueAndValidity();
|
|
1226
|
+
if (config.type === exports.DynamicFormTypeFieldEnum.dynamicForm) {
|
|
1227
|
+
var formGroupDynamicFormsSubject = newFormGroup.get('dynamicFormConfig').value;
|
|
1228
|
+
formGroupDynamicFormsSubject.subscribe(function (formGroupConfig) {
|
|
1229
|
+
if (formGroupConfig) {
|
|
1230
|
+
formGroupConfig.form.valueChanges.subscribe(function () {
|
|
1231
|
+
if (formGroupConfig.form.valid && (config.valueChanges || _this.showFieldsMoreItensConfig)) {
|
|
1232
|
+
var value = _this.dynamicFormService.emitData(formGroupConfig.form);
|
|
1233
|
+
newFormGroup.get('value').setValue(value);
|
|
1234
|
+
}
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
});
|
|
1238
|
+
}
|
|
1239
|
+
if (config.valueChanges ||
|
|
1240
|
+
config.type === exports.DynamicFormTypeFieldEnum.autocomplete ||
|
|
1241
|
+
config.type === exports.DynamicFormTypeFieldEnum.dynamicForm ||
|
|
1242
|
+
_this.showFieldsMoreItensConfig) {
|
|
1243
|
+
if (config.type === exports.DynamicFormTypeFieldEnum.autocomplete) {
|
|
1244
|
+
var autocompleteOptionsSubject = newFormGroup.get('autocompleteOptions').value;
|
|
1245
|
+
if (autocompleteOptionsSubject) {
|
|
1246
|
+
autocompleteOptionsSubject.subscribe(function (options) { return newFormGroup.get('autocompleteOptionsFiltered').value.next(options); });
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
newFormGroup.get('value')
|
|
1250
|
+
.valueChanges
|
|
1251
|
+
.pipe(operators.debounceTime(300))
|
|
1252
|
+
.subscribe(function (value) { return __awaiter(_this, void 0, void 0, function () {
|
|
1253
|
+
var _a, _b, _c, _d, _2, _3, itemValue, autocompleteOptionsSubject, loader_1;
|
|
1254
|
+
var e_1, _4;
|
|
1255
|
+
return __generator(this, function (_5) {
|
|
1256
|
+
switch (_5.label) {
|
|
1257
|
+
case 0: return [4 /*yield*/, this.setConfigDynamicForm(newFormGroup)];
|
|
1258
|
+
case 1:
|
|
1259
|
+
_5.sent();
|
|
1260
|
+
if (config.type === exports.DynamicFormTypeFieldEnum.autocomplete) {
|
|
1261
|
+
if (value && (value.hasOwnProperty('value') &&
|
|
1262
|
+
value.hasOwnProperty('name') &&
|
|
1263
|
+
Object.keys(value).length === 2) || (Array.isArray(value) &&
|
|
1264
|
+
value.length > 0 &&
|
|
1265
|
+
newFormGroup.get('multiple').value)) {
|
|
1266
|
+
if (newFormGroup.get('multiple').value) {
|
|
1267
|
+
if (Array.isArray(value)) {
|
|
1268
|
+
try {
|
|
1269
|
+
for (_2 = __values(value.values()), _3 = _2.next(); !_3.done; _3 = _2.next()) {
|
|
1270
|
+
itemValue = _3.value;
|
|
1271
|
+
newFormGroup.get('autocompleteSelectedValue').value.push(itemValue);
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1275
|
+
finally {
|
|
1276
|
+
try {
|
|
1277
|
+
if (_3 && !_3.done && (_4 = _2.return)) _4.call(_2);
|
|
1278
|
+
}
|
|
1279
|
+
finally { if (e_1) throw e_1.error; }
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
else {
|
|
1283
|
+
newFormGroup.get('autocompleteSelectedValue').value.push(value);
|
|
1284
|
+
}
|
|
1285
|
+
if ((_a = this.autocompleteInput) === null || _a === void 0 ? void 0 : _a.nativeElement) {
|
|
1286
|
+
this.autocompleteInput.nativeElement.value = '';
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
else {
|
|
1290
|
+
newFormGroup.get('autocompleteSelectedValue').setValue(value);
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
else if (!newFormGroup.get('multiple').value) {
|
|
1294
|
+
newFormGroup.get('autocompleteSelectedValue').setValue((_c = (_b = utils.koala(this.formConfig)
|
|
1295
|
+
.array()
|
|
1296
|
+
.filter(newFormGroup.get('name').value, 'name')
|
|
1297
|
+
.getValue()[0]) === null || _b === void 0 ? void 0 : _b.autocompleteDefaultValueOnClear) !== null && _c !== void 0 ? _c : null);
|
|
1298
|
+
}
|
|
1299
|
+
if (config.type === exports.DynamicFormTypeFieldEnum.autocomplete) {
|
|
1300
|
+
if (config.autocompleteType === 'all') {
|
|
1301
|
+
autocompleteOptionsSubject = newFormGroup.get('autocompleteOptions').value;
|
|
1302
|
+
newFormGroup.get('autocompleteOptionsFiltered').value.next(this.autocompleteFilter(autocompleteOptionsSubject.value, value));
|
|
1303
|
+
}
|
|
1304
|
+
else if (config.autocompleteType === 'onDemand' && typeof value !== "object") {
|
|
1305
|
+
loader_1 = newFormGroup.get('autocompleteLoading').value;
|
|
1306
|
+
loader_1.next(true);
|
|
1307
|
+
config.autocompleteFilter(value).subscribe(function (options) {
|
|
1308
|
+
newFormGroup.get('autocompleteOptionsFiltered').value.next(options);
|
|
1309
|
+
loader_1.next(false);
|
|
1310
|
+
});
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
if (config.valueChanges) {
|
|
1315
|
+
if (config.type === exports.DynamicFormTypeFieldEnum.autocomplete) {
|
|
1316
|
+
config.valueChanges((newFormGroup.get('multiple').value ?
|
|
1317
|
+
newFormGroup.get('autocompleteSelectedValue').value.map(function (item) { return item.value; }) :
|
|
1318
|
+
(_d = newFormGroup.get('autocompleteSelectedValue').value) === null || _d === void 0 ? void 0 : _d.value));
|
|
1319
|
+
}
|
|
1320
|
+
else {
|
|
1321
|
+
config.valueChanges(value);
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
return [2 /*return*/];
|
|
1325
|
+
}
|
|
1326
|
+
});
|
|
1327
|
+
}); });
|
|
1328
|
+
}
|
|
1329
|
+
_this.controls.push(newFormGroup);
|
|
1330
|
+
if (config.moreItemsConfig) {
|
|
1331
|
+
if (config.moreItemsMinItems > 0) {
|
|
1332
|
+
for (var min = 0; min < config.moreItemsMinItems; min++) {
|
|
1333
|
+
if (min <= config.moreItemsMaxItems) {
|
|
1334
|
+
_this.addMoreItem(indexConfig);
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
if (config.moreItemsConfig.setValues) {
|
|
1339
|
+
config.moreItemsConfig
|
|
1340
|
+
.setValues
|
|
1341
|
+
.subscribe(function (values) { return __awaiter(_this, void 0, void 0, function () {
|
|
1342
|
+
var _this = this;
|
|
1343
|
+
return __generator(this, function (_2) {
|
|
1344
|
+
if (values.length > 0) {
|
|
1345
|
+
values.forEach(function (itemValue, indexValue) {
|
|
1346
|
+
if (!_this.controls.controls[indexConfig].get('moreItemsConfig').value[indexValue]) {
|
|
1347
|
+
_this.addMoreItem(indexConfig);
|
|
1348
|
+
}
|
|
1349
|
+
setTimeout(function () {
|
|
1350
|
+
_this.setValuesOnFields(itemValue, _this.controls.controls[indexConfig].get('moreItemsConfig').value[indexValue].form);
|
|
1351
|
+
}, 300);
|
|
1352
|
+
});
|
|
1353
|
+
}
|
|
1354
|
+
return [2 /*return*/];
|
|
1355
|
+
});
|
|
1356
|
+
}); });
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
});
|
|
1360
|
+
if (this.showFields) {
|
|
1361
|
+
this.changeVisibilityFields(this.showFields, this.form);
|
|
1362
|
+
}
|
|
1363
|
+
if (this.setValues) {
|
|
1364
|
+
this.setValuesOnFields(this.setValues, this.form);
|
|
1365
|
+
}
|
|
1366
|
+
};
|
|
1367
|
+
DynamicFormComponent.prototype.hoursAndMinutesApplyMask = function (index, event) {
|
|
1368
|
+
var _a;
|
|
1369
|
+
var control = (_a = this.controls) === null || _a === void 0 ? void 0 : _a.controls[index];
|
|
1370
|
+
var type = control === null || control === void 0 ? void 0 : control.get('type').value;
|
|
1371
|
+
if (type === exports.DynamicFormTypeFieldEnum.hoursAndMinutes) {
|
|
1372
|
+
var value = control === null || control === void 0 ? void 0 : control.get('value').value;
|
|
1373
|
+
if (event.key == 'Backspace' && value.length < 6) {
|
|
1374
|
+
this.hoursAndMinutesMask = '00:000';
|
|
1375
|
+
}
|
|
1376
|
+
else if (event.key != 'Backspace' && value.length >= 6) {
|
|
1377
|
+
this.hoursAndMinutesMask = '000:00';
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
};
|
|
1381
|
+
DynamicFormComponent.prototype.passwordView = function (index) {
|
|
1382
|
+
var _a;
|
|
1383
|
+
var control = (_a = this.controls) === null || _a === void 0 ? void 0 : _a.controls[index];
|
|
1384
|
+
var hidePassword = !(control === null || control === void 0 ? void 0 : control.get('hidePassword').value);
|
|
1385
|
+
control === null || control === void 0 ? void 0 : control.get('hidePassword').setValue(hidePassword);
|
|
1386
|
+
control === null || control === void 0 ? void 0 : control.get('type').setValue(hidePassword ?
|
|
1387
|
+
exports.DynamicFormTypeFieldEnum.password :
|
|
1388
|
+
exports.DynamicFormTypeFieldEnum.text);
|
|
1389
|
+
};
|
|
1390
|
+
DynamicFormComponent.prototype.addMoreItem = function (propIndex) {
|
|
1391
|
+
if (this.controls.controls[propIndex].get('moreItemsConfig').value.length < this.controls.controls[propIndex].get('moreItemsMaxItems').value) {
|
|
1392
|
+
var formGroup = this.fb.group({});
|
|
1393
|
+
this.controls.controls[propIndex].get('moreItemsConfig').value.push({
|
|
1394
|
+
form: formGroup,
|
|
1395
|
+
formConfig: this.formConfig[propIndex].moreItemsConfig.formConfig,
|
|
1396
|
+
showFields: new rxjs.BehaviorSubject([]),
|
|
1397
|
+
showFieldsMoreItensConfig: this.formConfig[propIndex].moreItemsConfig.showFieldsConfig
|
|
1398
|
+
});
|
|
1399
|
+
this.controls.controls[propIndex].get('moreItemsExpanded').setValue(this.controls.controls[propIndex].get('moreItemsConfig').value.length - 1);
|
|
1400
|
+
var formArrayMoreItems = this.controls.controls[propIndex].get('moreItemsFormGroup');
|
|
1401
|
+
formArrayMoreItems.push(formGroup);
|
|
1402
|
+
}
|
|
1403
|
+
};
|
|
1404
|
+
DynamicFormComponent.prototype.removeMoreItem = function (propIndex, removeIndex) {
|
|
1405
|
+
var _this = this;
|
|
1406
|
+
var expandedItemIndex = removeIndex - 1;
|
|
1407
|
+
this.controls.controls[propIndex].get('moreItemsConfig').value.splice(removeIndex, 1);
|
|
1408
|
+
setTimeout(function () {
|
|
1409
|
+
_this.controls.controls[propIndex].get('moreItemsExpanded').setValue((expandedItemIndex < 0) ? 0 : expandedItemIndex);
|
|
1410
|
+
}, 50);
|
|
1411
|
+
};
|
|
1412
|
+
DynamicFormComponent.prototype.clearAutocomplete = function (propIndex) {
|
|
1413
|
+
var _a, _b;
|
|
1414
|
+
if (this.controls.controls[propIndex].get('multiple').value) {
|
|
1415
|
+
this.controls.controls[propIndex].get('autocompleteSelectedValue').setValue([]);
|
|
1416
|
+
this.controls.controls[propIndex].get('value').setValue(null);
|
|
1417
|
+
}
|
|
1418
|
+
else {
|
|
1419
|
+
this.controls.controls[propIndex].get('autocompleteSelectedValue').setValue((_a = this.formConfig[propIndex].autocompleteDefaultValueOnClear) !== null && _a !== void 0 ? _a : null);
|
|
1420
|
+
this.controls.controls[propIndex].get('value').setValue((_b = this.formConfig[propIndex].autocompleteDefaultValueOnClear) !== null && _b !== void 0 ? _b : null);
|
|
1421
|
+
}
|
|
1422
|
+
};
|
|
1423
|
+
DynamicFormComponent.prototype.display = function (option) {
|
|
1424
|
+
return option ? option.name : undefined;
|
|
1425
|
+
};
|
|
1426
|
+
DynamicFormComponent.prototype.removeOptionOnAutocomplete = function (propIndex, option) {
|
|
1427
|
+
var value = this.controls.controls[propIndex].get('autocompleteSelectedValue').value.filter(function (item) { return item !== option; });
|
|
1428
|
+
this.controls.controls[propIndex].get('autocompleteSelectedValue').setValue(value);
|
|
1429
|
+
if (value.length === 0) {
|
|
1430
|
+
this.controls.controls[propIndex].get('autocompleteSelectedValue').setValue([]);
|
|
1431
|
+
this.controls.controls[propIndex].get('value').setValue(null);
|
|
1432
|
+
}
|
|
1433
|
+
else if (this.formConfig[propIndex].valueChanges) {
|
|
1434
|
+
this.formConfig[propIndex].valueChanges(value.map(function (item) { return item.value; }));
|
|
1435
|
+
}
|
|
1436
|
+
};
|
|
1437
|
+
DynamicFormComponent.prototype.getColorChip = function (config) {
|
|
1438
|
+
return config.color;
|
|
1439
|
+
};
|
|
1440
|
+
DynamicFormComponent.prototype.newControl = function (config) {
|
|
1441
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
1442
|
+
var validators = (_a = config.syncValidators) !== null && _a !== void 0 ? _a : [];
|
|
1443
|
+
var value = (_b = config.value) !== null && _b !== void 0 ? _b : '';
|
|
1444
|
+
var valueSelectedAutocomplete = (config.multiple ? [] : ((_c = config.autocompleteDefaultValueOnClear) !== null && _c !== void 0 ? _c : null));
|
|
1445
|
+
if (config.required === true)
|
|
1446
|
+
validators.push(i1.Validators.required);
|
|
1447
|
+
if (config.min && typeof config.min === "number")
|
|
1448
|
+
validators.push(i1.Validators.min(config.min));
|
|
1449
|
+
if (config.max && typeof config.max === "number")
|
|
1450
|
+
validators.push(i1.Validators.max(config.max));
|
|
1451
|
+
if (config.type === exports.DynamicFormTypeFieldEnum.date ||
|
|
1452
|
+
config.type === exports.DynamicFormTypeFieldEnum.datetime ||
|
|
1453
|
+
config.type === exports.DynamicFormTypeFieldEnum.time) {
|
|
1454
|
+
if (config.min && typeof config.min === "string") {
|
|
1455
|
+
validators.push(DateMinValidator(config.min));
|
|
1456
|
+
}
|
|
1457
|
+
if (config.max && typeof config.max === "string") {
|
|
1458
|
+
validators.push(DateMaxValidator(config.max));
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
if (config.minLength)
|
|
1462
|
+
validators.push(i1.Validators.minLength(config.minLength));
|
|
1463
|
+
if (config.maxLength)
|
|
1464
|
+
validators.push(i1.Validators.maxLength(config.maxLength));
|
|
1465
|
+
if (config.type === exports.DynamicFormTypeFieldEnum.cpf) {
|
|
1466
|
+
validators.push(CpfValidator);
|
|
1467
|
+
}
|
|
1468
|
+
else if (config.type === exports.DynamicFormTypeFieldEnum.cnpj) {
|
|
1469
|
+
validators.push(CnpjValidator);
|
|
1470
|
+
}
|
|
1471
|
+
else if (config.type === exports.DynamicFormTypeFieldEnum.email) {
|
|
1472
|
+
validators.push(i1.Validators.email);
|
|
1473
|
+
}
|
|
1474
|
+
else if (config.type === exports.DynamicFormTypeFieldEnum.autocomplete) {
|
|
1475
|
+
if (value) {
|
|
1476
|
+
valueSelectedAutocomplete = value;
|
|
1477
|
+
value = (config.multiple ? valueSelectedAutocomplete[0] : value);
|
|
1478
|
+
}
|
|
1479
|
+
if (config.required === true) {
|
|
1480
|
+
validators.push(AutocompleteSelectedValidator);
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
else if (config.type === exports.DynamicFormTypeFieldEnum.checkbox) {
|
|
1484
|
+
value = (_d = config.value) !== null && _d !== void 0 ? _d : false;
|
|
1485
|
+
}
|
|
1486
|
+
if (config.type === exports.DynamicFormTypeFieldEnum.hoursAndMinutes &&
|
|
1487
|
+
value.length >= 6) {
|
|
1488
|
+
this.hoursAndMinutesMask = '000:00';
|
|
1489
|
+
}
|
|
1490
|
+
if (config.dynamicFormConfig) {
|
|
1491
|
+
var cloneDynamicFormConfig = {};
|
|
1492
|
+
Object.assign(cloneDynamicFormConfig, config.dynamicFormConfig);
|
|
1493
|
+
cloneDynamicFormConfig.form = config.dynamicFormConfig.form;
|
|
1494
|
+
config.dynamicFormConfig = cloneDynamicFormConfig;
|
|
1495
|
+
}
|
|
1496
|
+
if (config.show === false) {
|
|
1497
|
+
validators = [];
|
|
1498
|
+
}
|
|
1499
|
+
var field = this.fb.group({
|
|
1500
|
+
show: [new rxjs.BehaviorSubject((_e = config.show) !== null && _e !== void 0 ? _e : true)],
|
|
1501
|
+
label: [config.label],
|
|
1502
|
+
name: [config.name],
|
|
1503
|
+
type: [config.type],
|
|
1504
|
+
fileButtonConfig: [{
|
|
1505
|
+
icon: (_g = (_f = config === null || config === void 0 ? void 0 : config.fileButtonConfig) === null || _f === void 0 ? void 0 : _f.icon) !== null && _g !== void 0 ? _g : 'attach_file',
|
|
1506
|
+
text: (_j = (_h = config === null || config === void 0 ? void 0 : config.fileButtonConfig) === null || _h === void 0 ? void 0 : _h.text) !== null && _j !== void 0 ? _j : 'Clique para anexar arquivos',
|
|
1507
|
+
backgroundColor: (_l = (_k = config === null || config === void 0 ? void 0 : config.fileButtonConfig) === null || _k === void 0 ? void 0 : _k.backgroundColor) !== null && _l !== void 0 ? _l : 'white',
|
|
1508
|
+
color: (_o = (_m = config === null || config === void 0 ? void 0 : config.fileButtonConfig) === null || _m === void 0 ? void 0 : _m.color) !== null && _o !== void 0 ? _o : 'blue',
|
|
1509
|
+
accept: (_q = (_p = config === null || config === void 0 ? void 0 : config.fileButtonConfig) === null || _p === void 0 ? void 0 : _p.accept) !== null && _q !== void 0 ? _q : '*'
|
|
1510
|
+
}],
|
|
1511
|
+
dynamicFormConfig: [new rxjs.BehaviorSubject(config.dynamicFormConfig)],
|
|
1512
|
+
dynamicFormGroup: this.fb.array([]),
|
|
1513
|
+
appearance: [config.appearance],
|
|
1514
|
+
floatLabel: [config.floatLabel],
|
|
1515
|
+
placeholder: [config.placeholder],
|
|
1516
|
+
class: [config.class],
|
|
1517
|
+
fieldClass: [config.fieldClass],
|
|
1518
|
+
textHint: [config.textHint],
|
|
1519
|
+
required: [(_r = config.required) !== null && _r !== void 0 ? _r : false],
|
|
1520
|
+
min: [(_s = config.min) !== null && _s !== void 0 ? _s : 0],
|
|
1521
|
+
max: [(_t = config.max) !== null && _t !== void 0 ? _t : 99999999999],
|
|
1522
|
+
minLength: [(_u = config.minLength) !== null && _u !== void 0 ? _u : 0],
|
|
1523
|
+
maxLength: [(_v = config.maxLength) !== null && _v !== void 0 ? _v : 255],
|
|
1524
|
+
disabled: [(_w = config.disabled) !== null && _w !== void 0 ? _w : false],
|
|
1525
|
+
focus: [(_x = config.focus) !== null && _x !== void 0 ? _x : false],
|
|
1526
|
+
multiple: [(_y = config.multiple) !== null && _y !== void 0 ? _y : false],
|
|
1527
|
+
opcoesSelect: [(_z = config.opcoesSelect) !== null && _z !== void 0 ? _z : []],
|
|
1528
|
+
hidePassword: config.type === exports.DynamicFormTypeFieldEnum.password ? true : null,
|
|
1529
|
+
moreItemsButtonIconAddlabel: [config.moreItemsButtonIconAddlabel],
|
|
1530
|
+
moreItemsMinItems: [(_0 = config.moreItemsMinItems) !== null && _0 !== void 0 ? _0 : 0],
|
|
1531
|
+
moreItemsMaxItems: [(_1 = config.moreItemsMaxItems) !== null && _1 !== void 0 ? _1 : 100],
|
|
1532
|
+
moreItemsIcon: [config.moreItemsIcon],
|
|
1533
|
+
moreItemsIconFontColor: [config.moreItemsIconFontColor],
|
|
1534
|
+
moreItemsIconBackgroundColor: [config.moreItemsIconBackgroundColor],
|
|
1535
|
+
moreItemsExpanded: [''],
|
|
1536
|
+
moreItemsConfig: [[]],
|
|
1537
|
+
moreItemsFormGroup: this.fb.array([]),
|
|
1538
|
+
autocompleteLoading: [new rxjs.BehaviorSubject(false)],
|
|
1539
|
+
autocompleteOptions: [config.autocompleteOptions],
|
|
1540
|
+
autocompleteMultipleConfig: [config.autocompleteMultipleConfig],
|
|
1541
|
+
autocompleteOptionsFiltered: [new rxjs.BehaviorSubject([])],
|
|
1542
|
+
autocompleteSelectedValue: [valueSelectedAutocomplete],
|
|
1543
|
+
textLogs: [config === null || config === void 0 ? void 0 : config.textObs],
|
|
1544
|
+
customMasc: [config === null || config === void 0 ? void 0 : config.customMasc],
|
|
1545
|
+
value: [{ value: value, disabled: config.disabled }, validators, config.asyncValidators]
|
|
1546
|
+
});
|
|
1547
|
+
if (config.autocompleteType === "onDemand") {
|
|
1548
|
+
var loader_2 = field.get('autocompleteLoading').value;
|
|
1549
|
+
loader_2.next(true);
|
|
1550
|
+
config.autocompleteFilter('').subscribe(function (options) {
|
|
1551
|
+
field.get('autocompleteOptionsFiltered').value.next(options);
|
|
1552
|
+
loader_2.next(false);
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
return field;
|
|
1556
|
+
};
|
|
1557
|
+
DynamicFormComponent.prototype.setValuesOnFields = function (subject, form) {
|
|
1558
|
+
var _this = this;
|
|
1559
|
+
subject.subscribe(function (item) {
|
|
1560
|
+
var e_2, _2;
|
|
1561
|
+
if (item) {
|
|
1562
|
+
var formArray = form.get('formData');
|
|
1563
|
+
try {
|
|
1564
|
+
for (var _3 = __values(item.values()), _4 = _3.next(); !_4.done; _4 = _3.next()) {
|
|
1565
|
+
var prop = _4.value;
|
|
1566
|
+
_this.setValueByProp(formArray, prop);
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1570
|
+
finally {
|
|
1571
|
+
try {
|
|
1572
|
+
if (_4 && !_4.done && (_2 = _3.return)) _2.call(_3);
|
|
1573
|
+
}
|
|
1574
|
+
finally { if (e_2) throw e_2.error; }
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
});
|
|
1578
|
+
};
|
|
1579
|
+
DynamicFormComponent.prototype.changeVisibilityFields = function (subject, form) {
|
|
1580
|
+
var _this = this;
|
|
1581
|
+
subject.pipe(operators.debounceTime(5)).subscribe(function (item) {
|
|
1582
|
+
var e_3, _2, e_4, _3;
|
|
1583
|
+
var _a, _b, _c;
|
|
1584
|
+
if (item) {
|
|
1585
|
+
var formArray = form.get('formData');
|
|
1586
|
+
try {
|
|
1587
|
+
for (var _4 = __values(item.values()), _5 = _4.next(); !_5.done; _5 = _4.next()) {
|
|
1588
|
+
var prop = _5.value;
|
|
1589
|
+
try {
|
|
1590
|
+
for (var _6 = (e_4 = void 0, __values(formArray.controls.entries())), _7 = _6.next(); !_7.done; _7 = _6.next()) {
|
|
1591
|
+
var _8 = __read(_7.value, 2), indexControl = _8[0], control = _8[1];
|
|
1592
|
+
if (control.get('name').value === prop.name) {
|
|
1593
|
+
control.get('show').value.next(prop.show);
|
|
1594
|
+
var config = (_a = _this.formConfig[indexControl]) !== null && _a !== void 0 ? _a : null;
|
|
1595
|
+
if (prop.show) {
|
|
1596
|
+
var validators = [];
|
|
1597
|
+
if (config) {
|
|
1598
|
+
if (config.type === exports.DynamicFormTypeFieldEnum.dynamicForm) {
|
|
1599
|
+
var formArrayMoreItems = control.get('dynamicFormGroup');
|
|
1600
|
+
formArrayMoreItems.push((_b = config === null || config === void 0 ? void 0 : config.dynamicFormConfig) === null || _b === void 0 ? void 0 : _b.form);
|
|
1601
|
+
}
|
|
1602
|
+
else {
|
|
1603
|
+
validators = (_c = config.syncValidators) !== null && _c !== void 0 ? _c : [];
|
|
1604
|
+
if (config.required === true) {
|
|
1605
|
+
validators.push(i1.Validators.required);
|
|
1606
|
+
}
|
|
1607
|
+
if (config.type === exports.DynamicFormTypeFieldEnum.cpf) {
|
|
1608
|
+
validators.push(CpfValidator);
|
|
1609
|
+
}
|
|
1610
|
+
else if (config.type === exports.DynamicFormTypeFieldEnum.cnpj) {
|
|
1611
|
+
validators.push(CnpjValidator);
|
|
1612
|
+
}
|
|
1613
|
+
else if (config.type === exports.DynamicFormTypeFieldEnum.email) {
|
|
1614
|
+
validators.push(i1.Validators.email);
|
|
1615
|
+
}
|
|
1616
|
+
else if (config.required === true &&
|
|
1617
|
+
config.type === exports.DynamicFormTypeFieldEnum.autocomplete) {
|
|
1618
|
+
validators.push(AutocompleteSelectedValidator);
|
|
1619
|
+
}
|
|
1620
|
+
if (config.min && typeof config.min === "number")
|
|
1621
|
+
validators.push(i1.Validators.min(config.min));
|
|
1622
|
+
if (config.max && typeof config.max === "number")
|
|
1623
|
+
validators.push(i1.Validators.max(config.max));
|
|
1624
|
+
if (config.type === exports.DynamicFormTypeFieldEnum.date ||
|
|
1625
|
+
config.type === exports.DynamicFormTypeFieldEnum.datetime ||
|
|
1626
|
+
config.type === exports.DynamicFormTypeFieldEnum.time) {
|
|
1627
|
+
if (config.min && typeof config.min === "string") {
|
|
1628
|
+
validators.push(DateMinValidator(config.min));
|
|
1629
|
+
}
|
|
1630
|
+
if (config.max && typeof config.max === "string") {
|
|
1631
|
+
validators.push(DateMaxValidator(config.max));
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
if (config.minLength)
|
|
1635
|
+
validators.push(i1.Validators.minLength(config.minLength));
|
|
1636
|
+
if (config.maxLength)
|
|
1637
|
+
validators.push(i1.Validators.maxLength(config.maxLength));
|
|
1638
|
+
control.get('value').setValidators(validators);
|
|
1639
|
+
if (config.asyncValidators) {
|
|
1640
|
+
control.get('value').setAsyncValidators(config.asyncValidators);
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
control.get('value').updateValueAndValidity();
|
|
1644
|
+
if (prop.clearCurrentValue) {
|
|
1645
|
+
control.get('value').setValue(null);
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
else {
|
|
1650
|
+
control.get('value').clearValidators();
|
|
1651
|
+
control.get('value').clearAsyncValidators();
|
|
1652
|
+
control.setErrors(null);
|
|
1653
|
+
control.get('value').setValue(null);
|
|
1654
|
+
control.get('value').updateValueAndValidity();
|
|
1655
|
+
if (config.type === exports.DynamicFormTypeFieldEnum.dynamicForm) {
|
|
1656
|
+
var formGroup = control;
|
|
1657
|
+
formGroup.removeControl('dynamicFormGroup');
|
|
1658
|
+
formGroup.addControl('dynamicFormGroup', _this.fb.array([]));
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
break;
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
1666
|
+
finally {
|
|
1667
|
+
try {
|
|
1668
|
+
if (_7 && !_7.done && (_3 = _6.return)) _3.call(_6);
|
|
1669
|
+
}
|
|
1670
|
+
finally { if (e_4) throw e_4.error; }
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1675
|
+
finally {
|
|
1676
|
+
try {
|
|
1677
|
+
if (_5 && !_5.done && (_2 = _4.return)) _2.call(_4);
|
|
1678
|
+
}
|
|
1679
|
+
finally { if (e_3) throw e_3.error; }
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
});
|
|
1683
|
+
};
|
|
1684
|
+
DynamicFormComponent.prototype.autocompleteFilter = function (arr, value) {
|
|
1685
|
+
return arr.filter(function (filter) {
|
|
1686
|
+
if (typeof value === 'string') {
|
|
1687
|
+
if (filter) {
|
|
1688
|
+
var find_1 = true;
|
|
1689
|
+
value.toLowerCase()
|
|
1690
|
+
.split(' ')
|
|
1691
|
+
.forEach(function (part) {
|
|
1692
|
+
if (filter.name.toLowerCase().indexOf(part) < 0) {
|
|
1693
|
+
find_1 = false;
|
|
1694
|
+
return false;
|
|
1695
|
+
}
|
|
1696
|
+
});
|
|
1697
|
+
return find_1;
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
else {
|
|
1701
|
+
return true;
|
|
1702
|
+
}
|
|
1703
|
+
});
|
|
1704
|
+
};
|
|
1705
|
+
DynamicFormComponent.prototype.setValueByProp = function (formArray, prop) {
|
|
1706
|
+
var e_5, _2;
|
|
1707
|
+
if (formArray) {
|
|
1708
|
+
if (prop.name.indexOf(' > ') >= 0) {
|
|
1709
|
+
var dynamicFormSubject = void 0;
|
|
1710
|
+
var arrPropName_1 = prop.name.split(' > ');
|
|
1711
|
+
var indexPropName_1 = 0;
|
|
1712
|
+
do {
|
|
1713
|
+
var control = formArray.controls.find(function (control) { return control.get('name').value === arrPropName_1[indexPropName_1]; });
|
|
1714
|
+
if (indexPropName_1 === arrPropName_1.length - 2) {
|
|
1715
|
+
dynamicFormSubject = control.get('dynamicFormConfig').value;
|
|
1716
|
+
var dynamicForm = dynamicFormSubject.getValue();
|
|
1717
|
+
if (dynamicForm.formConfig.find(function (fc) { return fc.name === arrPropName_1[arrPropName_1.length - 1]; })) {
|
|
1718
|
+
if (dynamicForm.setValues) {
|
|
1719
|
+
dynamicForm.setValues.next(utils.koala(dynamicForm.setValues.getValue()).array().merge([{
|
|
1720
|
+
name: arrPropName_1[arrPropName_1.length - 1],
|
|
1721
|
+
value: prop.value
|
|
1722
|
+
}]).getValue());
|
|
1723
|
+
}
|
|
1724
|
+
else {
|
|
1725
|
+
dynamicForm.setValues = new rxjs.BehaviorSubject([{
|
|
1726
|
+
name: arrPropName_1[arrPropName_1.length - 1],
|
|
1727
|
+
value: prop.value
|
|
1728
|
+
}]);
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
indexPropName_1++;
|
|
1733
|
+
} while (indexPropName_1 < arrPropName_1.length - 1);
|
|
1734
|
+
}
|
|
1735
|
+
else {
|
|
1736
|
+
try {
|
|
1737
|
+
for (var _3 = __values(formArray.controls.values()), _4 = _3.next(); !_4.done; _4 = _3.next()) {
|
|
1738
|
+
var control = _4.value;
|
|
1739
|
+
if (control.get('name').value === prop.name) {
|
|
1740
|
+
control.get('value').setValue(prop.value);
|
|
1741
|
+
break;
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
1746
|
+
finally {
|
|
1747
|
+
try {
|
|
1748
|
+
if (_4 && !_4.done && (_2 = _3.return)) _2.call(_3);
|
|
1749
|
+
}
|
|
1750
|
+
finally { if (e_5) throw e_5.error; }
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
};
|
|
1755
|
+
DynamicFormComponent.prototype.setConfigDynamicForm = function (newFormGroup) {
|
|
1756
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1757
|
+
var value_1, configs, _loop_1, this_1, configs_1, configs_1_1, config, e_6_1;
|
|
1758
|
+
var e_6, _2;
|
|
1759
|
+
return __generator(this, function (_3) {
|
|
1760
|
+
switch (_3.label) {
|
|
1761
|
+
case 0:
|
|
1762
|
+
if (!this.showFieldsMoreItensConfig) return [3 /*break*/, 8];
|
|
1763
|
+
value_1 = newFormGroup.get('value').value;
|
|
1764
|
+
configs = this.showFieldsMoreItensConfig
|
|
1765
|
+
.filter(function (config) { return config.nameField === newFormGroup.get('name').value; })
|
|
1766
|
+
.sort(function (config) {
|
|
1767
|
+
if (config.fnShow(value_1)) {
|
|
1768
|
+
return 1;
|
|
1769
|
+
}
|
|
1770
|
+
return -1;
|
|
1771
|
+
});
|
|
1772
|
+
_loop_1 = function (config) {
|
|
1773
|
+
var controlDynamicFormConfig, dynamicFormConfigSubject;
|
|
1774
|
+
return __generator(this, function (_4) {
|
|
1775
|
+
switch (_4.label) {
|
|
1776
|
+
case 0:
|
|
1777
|
+
if (!config) return [3 /*break*/, 3];
|
|
1778
|
+
if (!(config.dynamicFormConfig && config.fnShow(value_1))) return [3 /*break*/, 2];
|
|
1779
|
+
controlDynamicFormConfig = this_1.controls
|
|
1780
|
+
.controls
|
|
1781
|
+
.find(function (control) { return config.fieldsToShow.indexOf(control.get('name').value) >= 0; });
|
|
1782
|
+
dynamicFormConfigSubject = controlDynamicFormConfig.get('dynamicFormConfig').value;
|
|
1783
|
+
dynamicFormConfigSubject.next(null);
|
|
1784
|
+
return [4 /*yield*/, KlDelay.KlDelay.waitFor(1)];
|
|
1785
|
+
case 1:
|
|
1786
|
+
_4.sent();
|
|
1787
|
+
dynamicFormConfigSubject.next(config.dynamicFormConfig(value_1));
|
|
1788
|
+
_4.label = 2;
|
|
1789
|
+
case 2:
|
|
1790
|
+
this_1.dynamicFormService.showFields(this_1.showFields, config.fieldsToShow, config.fnShow(value_1), config.clearCurrentValue);
|
|
1791
|
+
_4.label = 3;
|
|
1792
|
+
case 3: return [2 /*return*/];
|
|
1793
|
+
}
|
|
1794
|
+
});
|
|
1795
|
+
};
|
|
1796
|
+
this_1 = this;
|
|
1797
|
+
_3.label = 1;
|
|
1798
|
+
case 1:
|
|
1799
|
+
_3.trys.push([1, 6, 7, 8]);
|
|
1800
|
+
configs_1 = __values(configs), configs_1_1 = configs_1.next();
|
|
1801
|
+
_3.label = 2;
|
|
1802
|
+
case 2:
|
|
1803
|
+
if (!!configs_1_1.done) return [3 /*break*/, 5];
|
|
1804
|
+
config = configs_1_1.value;
|
|
1805
|
+
return [5 /*yield**/, _loop_1(config)];
|
|
1806
|
+
case 3:
|
|
1807
|
+
_3.sent();
|
|
1808
|
+
_3.label = 4;
|
|
1809
|
+
case 4:
|
|
1810
|
+
configs_1_1 = configs_1.next();
|
|
1811
|
+
return [3 /*break*/, 2];
|
|
1812
|
+
case 5: return [3 /*break*/, 8];
|
|
1813
|
+
case 6:
|
|
1814
|
+
e_6_1 = _3.sent();
|
|
1815
|
+
e_6 = { error: e_6_1 };
|
|
1816
|
+
return [3 /*break*/, 8];
|
|
1817
|
+
case 7:
|
|
1818
|
+
try {
|
|
1819
|
+
if (configs_1_1 && !configs_1_1.done && (_2 = configs_1.return)) _2.call(configs_1);
|
|
1820
|
+
}
|
|
1821
|
+
finally { if (e_6) throw e_6.error; }
|
|
1822
|
+
return [7 /*endfinally*/];
|
|
1823
|
+
case 8: return [2 /*return*/];
|
|
1824
|
+
}
|
|
1825
|
+
});
|
|
1826
|
+
});
|
|
1827
|
+
};
|
|
1828
|
+
return DynamicFormComponent;
|
|
1829
|
+
}(FormAbstract));
|
|
1830
|
+
DynamicFormComponent.decorators = [
|
|
1831
|
+
{ type: i0.Component, args: [{
|
|
1832
|
+
selector: 'koala-dynamic-form',
|
|
1833
|
+
template: "<div [formGroup]=\"form\" class=\"p-relative w-100\">\n <div *ngFor=\"let propriedade of controls?.controls; let i = index;\"\n [ngClass]=\"(propriedade.get('show').value | async) ? propriedade.get('class').value : 'd-none'\"\n formArrayName=\"formData\">\n\t <div *ngIf=\"propriedade.get('show').value | async\">\n\t <mat-form-field\n\t\t *ngIf=\"propriedade.get('type').value == typeField.text ||\n\t propriedade.get('type').value == typeField.password ||\n\t propriedade.get('type').value == typeField.cpf ||\n\t propriedade.get('type').value == typeField.cnpj ||\n\t propriedade.get('type').value == typeField.datetime ||\n\t propriedade.get('type').value == typeField.email ||\n\t propriedade.get('type').value == typeField.number ||\n\t propriedade.get('type').value == typeField.stringNumber ||\n\t propriedade.get('type').value == typeField.time ||\n\t propriedade.get('type').value == typeField.date ||\n\t propriedade.get('type').value == typeField.hoursAndMinutes ||\n\t propriedade.get('type').value == typeField.phone ||\n\t propriedade.get('type').value == typeField.percent ||\n\t propriedade.get('type').value == typeField.color ||\n\t propriedade.get('type').value == typeField.month ||\n\t propriedade.get('type').value == typeField.competenceDate ||\n propriedade.get('type').value == typeField.stringWithCustomMasc\"\n\t\t [appearance]=\"propriedade.get('appearance').value\"\n\t\t [floatLabel]=\"propriedade.get('floatLabel').value\"\n\t\t [formGroupName]=\"i\"\n\t\t [ngClass]=\"propriedade.get('fieldClass').value\">\n\t <mat-label>{{propriedade.get('label').value}}</mat-label>\n\t <input\n\t\t [dropSpecialCharacters]=\"false\"\n\t\t [koalaAutoFocus]=\"propriedade.get('focus').value\"\n\t\t (keyup)=\"hoursAndMinutesApplyMask(i, $event)\"\n\t\t [required]=\"propriedade.get('required').value\"\n\t\t [tabIndex]=\"tabIndexStart + i\"\n\t\t [mask]=\"((propriedade.get('type').value == typeField.competenceDate) ? '00/0000' : null) ||\n\t\t ((propriedade.get('type').value == typeField.phone) ? '(00)0000-0000?0' : null) ||\n\t\t ((propriedade.get('type').value == typeField.stringNumber) ? '0{'+propriedade.get('maxLength').value+'}' : null) ||\n ((propriedade.get('type').value == typeField.cpf) ? '000.000.000-00' : null) ||\n ((propriedade.get('type').value == typeField.cnpj) ? '00.000.000/0000-00' : null) ||\n ((propriedade.get('type').value == typeField.percent) ? 'percent' : null) ||\n\t\t\t\t\t\t\t\t\t((propriedade.get('type').value == typeField.hoursAndMinutes) ? hoursAndMinutesMask : null) ||\n\t\t\t\t\t\t\t\t\t((propriedade.get('type').value == typeField.stringWithCustomMasc) ? propriedade.get('customMasc').value : null)\"\n\t\t [validation]=\"\n\t (propriedade.get('type').value == typeField.cpf && propriedade.get('value').errors?.cpfInvalid) ||\n\t (propriedade.get('type').value == typeField.cnpj && propriedade.get('value').errors?.cnpjInvalid)\"\n\t\t [type]=\"((propriedade.get('type').value == typeField.cpf ||\n propriedade.get('type').value == typeField.cnpj ||\n propriedade.get('type').value == typeField.phone ||\n propriedade.get('type').value == typeField.percent\n )) ? 'tel' : (\n propriedade.get('type').value == typeField.month ?\n 'month' : (\n propriedade.get('type').value == typeField.date ?\n 'date' : (\n propriedade.get('type').value == typeField.datetime ?\n 'datetime-local' : (\n propriedade.get('type').value == typeField.email ?\n 'email' : (\n propriedade.get('type').value == typeField.number ?\n 'number' : (\n propriedade.get('type').value == typeField.time ?\n 'time' : (\n propriedade.get('type').value == typeField.password ?\n 'password' : (\n propriedade.get('type').value == typeField.color ?\n 'color' : 'text'))))))))\"\n [min]=\"propriedade.get('min').value\"\n [max]=\"propriedade.get('max').value\"\n [minLength]=\"propriedade.get('minLength').value\"\n [maxLength]=\"propriedade.get('maxLength').value\"\n separatorLimit=\"0\"\n\t\t showMaskTyped\n autocomplete=\"off\"\n\t\t formControlName=\"value\"\n\t\t matInput/>\n\t <button\n\t\t (click)=\"passwordView(i)\"\n\t\t *ngIf=\"propriedade.get('hidePassword').value !== null\"\n\t\t [attr.aria-label]=\"'Hide password'\"\n\t\t [attr.aria-pressed]=\"propriedade.get('hidePassword').value\"\n\t\t mat-icon-button matSuffix tabindex=\"-1\" type=\"button\">\n\t <mat-icon>{{propriedade.get('hidePassword').value ? 'visibility_off' : 'visibility'}}</mat-icon>\n\t </button>\n\t <mat-hint *ngIf=\"propriedade.get('textHint').value\">\n\t <mat-icon>info</mat-icon>\n\t\t {{propriedade.get('textHint').value}}\n\t </mat-hint>\n\t <mat-error *ngIf=\"propriedade.get('value').errors?.required\">\n\t <mat-icon>error</mat-icon>\n {{errorMessage.getRequiredMessage(propriedade.get('label').value)}}\n\t </mat-error>\n\t <mat-error *ngIf=\"propriedade.get('value').errors?.cpfInvalid\">\n\t <mat-icon>error</mat-icon>\n {{errorMessage.getInvalidMessage(propriedade.get('label').value)}}\n\t </mat-error>\n\t <mat-error *ngIf=\"propriedade.get('value').errors?.cnpjInvalid\">\n\t <mat-icon>error</mat-icon>\n {{errorMessage.getInvalidMessage(propriedade.get('label').value)}}\n\t </mat-error>\n\t <mat-error *ngIf=\"propriedade.get('value').errors?.email\">\n\t <mat-icon>error</mat-icon>\n {{errorMessage.getInvalidMessage(propriedade.get('label').value)}}\n\t </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.min\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getMinMessage(propriedade.get('min').value)}}\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.max\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getMaxMessage(propriedade.get('max').value)}}\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.minLength\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getMinLengthMessage(propriedade.get('minLength').value)}}\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.maxLength\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getMaxLengthMessage(propriedade.get('maxLength').value)}}\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.dateMin\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getDateMinMessage()}}\n {{propriedade.get('min').value | date:\"shortDate\"}}.\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.dateMax\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getDateMaxMessage()}}\n {{propriedade.get('max').value | date:\"shortDate\"}}.\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.customError\">\n <mat-icon>error</mat-icon>\n {{propriedade.get('value').errors?.customError.message}}.\n </mat-error>\n\t </mat-form-field>\n\t <mat-form-field\n\t\t *ngIf=\"propriedade.get('type').value == typeField.coin\"\n\t\t [appearance]=\"propriedade.get('appearance').value\"\n\t\t [floatLabel]=\"propriedade.get('floatLabel').value\"\n\t\t [formGroupName]=\"i\"\n\t\t [ngClass]=\"propriedade.get('fieldClass').value\">\n\t <mat-label>{{propriedade.get('label').value}}</mat-label>\n\t <input\n\t\t [koalaAutoFocus]=\"propriedade.get('focus').value\"\n\t\t [required]=\"propriedade.get('required').value\"\n [tabIndex]=\"tabIndexStart + i\"\n [min]=\"propriedade.get('min').value\"\n [max]=\"propriedade.get('max').value\"\n [minLength]=\"propriedade.get('minLength').value\"\n [maxLength]=\"propriedade.get('maxLength').value\"\n autocomplete=\"off\"\n\t\t currencyMask\n\t\t formControlName=\"value\"\n\t\t matInput\n\t\t type=\"tel\"/>\n\t <mat-hint *ngIf=\"propriedade.get('textHint').value\">\n\t <mat-icon>info</mat-icon>\n\t\t {{propriedade.get('textHint').value}}\n\t </mat-hint>\n <mat-error *ngIf=\"propriedade.get('value').errors?.min\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getMinMessage(propriedade.get('min').value)}}\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.max\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getMaxMessage(propriedade.get('max').value)}}\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.minLength\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getMinLengthMessage(propriedade.get('minLength').value)}}\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.maxLength\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getMaxLengthMessage(propriedade.get('maxLength').value)}}\n </mat-error>\n\t <mat-error *ngIf=\"propriedade.get('value').errors?.required\">\n\t <mat-icon>error</mat-icon>\n {{errorMessage.getRequiredMessage(propriedade.get('label').value)}}\n\t </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.customError\">\n <mat-icon>error</mat-icon>\n {{propriedade.get('value').errors?.customError.message}}.\n </mat-error>\n\t </mat-form-field>\n <mat-form-field\n *ngIf=\"propriedade.get('type').value == typeField.float\"\n [appearance]=\"propriedade.get('appearance').value\"\n [floatLabel]=\"propriedade.get('floatLabel').value\"\n [formGroupName]=\"i\"\n [ngClass]=\"propriedade.get('fieldClass').value\">\n <mat-label>{{propriedade.get('label').value}}</mat-label>\n <input\n [koalaAutoFocus]=\"propriedade.get('focus').value\"\n [required]=\"propriedade.get('required').value\"\n [tabIndex]=\"tabIndexStart + i\"\n [min]=\"propriedade.get('min').value\"\n [max]=\"propriedade.get('max').value\"\n [minLength]=\"propriedade.get('minLength').value\"\n [maxLength]=\"propriedade.get('maxLength').value\"\n autocomplete=\"off\"\n currencyMask\n [options]=\"{prefix: ''}\"\n formControlName=\"value\"\n matInput\n type=\"tel\"/>\n <mat-hint *ngIf=\"propriedade.get('textHint').value\">\n <mat-icon>info</mat-icon>\n {{propriedade.get('textHint').value}}\n </mat-hint>\n <mat-error *ngIf=\"propriedade.get('value').errors?.min\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getMinMessage(propriedade.get('min').value)}}\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.max\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getMaxMessage(propriedade.get('max').value)}}\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.minLength\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getMinLengthMessage(propriedade.get('minLength').value)}}\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.maxLength\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getMaxLengthMessage(propriedade.get('maxLength').value)}}\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.required\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getRequiredMessage(propriedade.get('label').value)}}\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.customError\">\n <mat-icon>error</mat-icon>\n {{propriedade.get('value').errors?.customError.message}}.\n </mat-error>\n </mat-form-field>\n\t <mat-form-field\n\t\t *ngIf=\"propriedade.get('type').value == typeField.valueList ||\n\t propriedade.get('type').value == typeField.textarea\"\n\t\t [appearance]=\"propriedade.get('appearance').value\"\n\t\t [floatLabel]=\"propriedade.get('floatLabel').value\"\n\t\t [formGroupName]=\"i\"\n\t\t [ngClass]=\"propriedade.get('fieldClass').value\">\n\t <mat-label>{{propriedade.get('label').value}}</mat-label>\n\t <textarea\n #textarea\n\t\t [koalaAutoFocus]=\"propriedade.get('focus').value\"\n\t\t [mat-autosize]=\"true\"\n\t\t [matAutosizeMaxRows]=\"8\"\n\t\t [matAutosizeMinRows]=\"3\"\n\t\t [required]=\"propriedade.get('required').value\"\n [tabIndex]=\"tabIndexStart + i\"\n [minLength]=\"propriedade.get('minLength').value\"\n [maxLength]=\"propriedade.get('maxLength').value\"\n\t\t formControlName=\"value\"\n\t\t matInput>\n </textarea>\n\t <mat-hint *ngIf=\"propriedade.get('textHint').value\">\n\t <mat-icon>info</mat-icon>\n\t\t {{propriedade.get('textHint').value}}\n\t </mat-hint>\n <mat-hint align=\"end\" *ngIf=\"propriedade.get('maxLength').value\">\n {{textarea.value.length}}/{{propriedade.get('maxLength').value}}\n </mat-hint>\n <mat-error *ngIf=\"propriedade.get('value').errors?.minLength\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getMinLengthMessage(propriedade.get('minLength').value)}}\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.maxLength\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getMaxLengthMessage(propriedade.get('maxLength').value)}}\n </mat-error>\n\t <mat-error *ngIf=\"propriedade.get('value').errors?.required\">\n\t <mat-icon>error</mat-icon>\n {{errorMessage.getRequiredMessage(propriedade.get('label').value)}}\n\t </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.customError\">\n <mat-icon>error</mat-icon>\n {{propriedade.get('value').errors?.customError.message}}.\n </mat-error>\n\t </mat-form-field>\n\t\t <mat-form-field\n\t\t\t *ngIf=\"propriedade.get('type').value == typeField.textLogs\"\n\t\t\t [appearance]=\"propriedade.get('appearance').value\"\n\t\t\t [floatLabel]=\"propriedade.get('floatLabel').value\"\n\t\t\t [formGroupName]=\"i\"\n\t\t\t [ngClass]=\"propriedade.get('fieldClass').value\">\n\t <mat-label>{{propriedade.get('label').value}}</mat-label>\n\t <div [innerHTML]=\"propriedade.get('textLogs').value\" class=\"text-obs\"></div>\n\t <textarea\n #textarea\n\t\t [koalaAutoFocus]=\"propriedade.get('focus').value\"\n\t\t [mat-autosize]=\"true\"\n\t\t [matAutosizeMaxRows]=\"8\"\n\t\t [matAutosizeMinRows]=\"3\"\n\t\t [required]=\"propriedade.get('required').value\"\n [tabIndex]=\"tabIndexStart + i\"\n [minLength]=\"propriedade.get('minLength').value\"\n [maxLength]=\"propriedade.get('maxLength').value\"\n\t\t formControlName=\"value\"\n\t\t matInput>\n\t </textarea>\n\t <mat-hint *ngIf=\"propriedade.get('textHint').value\">\n\t <mat-icon>info</mat-icon>\n\t\t {{propriedade.get('textHint').value}}\n\t </mat-hint>\n <mat-hint align=\"end\" *ngIf=\"propriedade.get('maxLength').value\">\n {{textarea.value.length}}/{{propriedade.get('maxLength').value}}\n </mat-hint>\n <mat-error *ngIf=\"propriedade.get('value').errors?.minLength\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getMinLengthMessage(propriedade.get('minLength').value)}}\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.maxLength\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getMaxLengthMessage(propriedade.get('maxLength').value)}}\n </mat-error>\n\t <mat-error *ngIf=\"propriedade.get('value').errors?.required\">\n\t <mat-icon>error</mat-icon>\n {{errorMessage.getRequiredMessage(propriedade.get('label').value)}}\n\t </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.customError\">\n <mat-icon>error</mat-icon>\n {{propriedade.get('value').errors?.customError.message}}.\n </mat-error>\n\t </mat-form-field>\n\t <mat-form-field\n\t\t *ngIf=\"propriedade.get('type').value == typeField.select\"\n\t\t [appearance]=\"propriedade.get('appearance').value\"\n\t\t [floatLabel]=\"propriedade.get('floatLabel').value\"\n\t\t [formGroupName]=\"i\"\n\t\t [ngClass]=\"propriedade.get('fieldClass').value\">\n\t <mat-label>{{propriedade.get('label').value}}</mat-label>\n\t <mat-select [multiple]=\"propriedade.get('multiple').value\" [required]=\"propriedade.get('required').value\"\n [tabIndex]=\"tabIndexStart + i\" formControlName=\"value\">\n\t <mat-option *ngFor=\"let options of propriedade.get('opcoesSelect').value\" [value]=\"options.value\">\n\t {{options.name}}\n\t </mat-option>\n\t </mat-select>\n\t <mat-hint *ngIf=\"propriedade.get('textHint').value\">\n\t <mat-icon>info</mat-icon>\n\t\t {{propriedade.get('textHint').value}}\n\t </mat-hint>\n\t <mat-error *ngIf=\"propriedade.get('value').errors?.required\">\n\t <mat-icon>error</mat-icon>\n {{errorMessage.getRequiredMessage(propriedade.get('label').value)}}\n\t </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.customError\">\n <mat-icon>error</mat-icon>\n {{propriedade.get('value').errors?.customError.message}}.\n </mat-error>\n\t </mat-form-field>\n <mat-form-field\n class=\"select-multiple-native\"\n *ngIf=\"propriedade.get('type').value == typeField.selectMultipleNative\"\n [appearance]=\"propriedade.get('appearance').value\"\n [floatLabel]=\"propriedade.get('floatLabel').value\"\n [formGroupName]=\"i\"\n [ngClass]=\"propriedade.get('fieldClass').value\">\n <mat-label>{{propriedade.get('label').value}}</mat-label>\n <select\n matNativeControl\n formControlName=\"value\"\n multiple\n [tabIndex]=\"tabIndexStart + i\"\n [required]=\"propriedade.get('required').value\">\n <option *ngFor=\"let options of propriedade.get('opcoesSelect').value\" [value]=\"options.value\">\n {{options.name}}\n </option>\n </select>\n <mat-hint *ngIf=\"propriedade.get('textHint').value\">\n <mat-icon>info</mat-icon>\n {{propriedade.get('textHint').value}}\n </mat-hint>\n <mat-error *ngIf=\"propriedade.get('value').errors?.required\">\n <mat-icon>error</mat-icon>\n {{errorMessage.getRequiredMessage(propriedade.get('label').value)}}\n </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.customError\">\n <mat-icon>error</mat-icon>\n {{propriedade.get('value').errors?.customError.message}}.\n </mat-error>\n </mat-form-field>\n\t <div\n\t\t *ngIf=\"propriedade.get('type').value == typeField.checkbox\"\n\t\t [formGroupName]=\"i\"\n\t\t [ngClass]=\"propriedade.get('fieldClass').value\">\n\t <mat-checkbox\n [tabIndex]=\"tabIndexStart + i\"\n\t\t formControlName=\"value\"\n\t\t value=\"true\">\n\t {{propriedade.get('label').value}}\n\t </mat-checkbox>\n\t </div>\n\t\t <div\n\t\t\t *ngIf=\"propriedade.get('type').value == typeField.moreItems\"\n\t\t\t [formGroupName]=\"i\"\n\t\t\t [ngClass]=\"propriedade.get('fieldClass').value\"\n\t\t\t class=\"more-items-content\">\n\t\t\t <fieldset>\n\t\t\t\t <legend>\n\t\t\t\t\t <koala-button\n\t\t\t\t\t\t (click)=\"addMoreItem(i)\"\n\t\t\t\t\t\t [disabled]=\"propriedade.get('moreItemsConfig').value.length === propriedade.get('moreItemsMaxItems').value\"\n\t\t\t\t\t\t [tooltip]=\"propriedade.get('moreItemsButtonIconAddlabel').value\"\n\t\t\t\t\t\t [backgroundColor]=\"propriedade.get('moreItemsIconBackgroundColor').value\"\n [color]=\"propriedade.get('moreItemsIconFontColor').value\"\n\t\t\t\t\t\t class=\"btn-add-more-items\"\n\t\t\t\t\t\t icon=\"add\">\n\t\t\t\t\t </koala-button>\n\t\t\t\t\t {{propriedade.get('label').value}} (Min.: {{propriedade.get('moreItemsMinItems').value}}\n\t\t\t\t\t | M\u00E1x.: {{propriedade.get('moreItemsMaxItems').value}})\n\t\t\t\t </legend>\n\t\t\t\t <mat-accordion class=\"items\" multi>\n\t\t\t\t\t <mat-expansion-panel\n\t\t\t\t\t\t *ngFor=\"let item of propriedade.get('moreItemsConfig').value.slice().reverse(); index as indexMoreItems\"\n\t\t\t\t\t\t expanded>\n\t\t\t\t\t\t <mat-expansion-panel-header>\n\t\t\t\t\t\t\t\t<mat-panel-title class=\"titleForm\">#\n\t\t\t\t\t\t\t\t\t{{propriedade.get('moreItemsConfig').value.length - 1 - indexMoreItems + 1}}</mat-panel-title>\n\t\t\t\t\t\t\t\t<mat-panel-description class=\"titleForm\">\n\t\t\t\t\t\t\t\t\t{{propriedade.get('label').value}}\n\t\t\t\t\t\t\t\t\t<mat-icon>{{propriedade.get('moreItemsIcon').value}}</mat-icon>\n\t\t\t\t\t\t\t\t</mat-panel-description>\n\t\t\t\t\t\t\t</mat-expansion-panel-header>\n\t\t\t\t\t\t <koala-dynamic-form\n\t\t\t\t\t\t\t [showFieldsMoreItensConfig]=\"item.showFieldsMoreItensConfig\"\n\t\t\t\t\t\t\t [showFields]=\"item.showFields\"\n\t\t\t\t\t\t\t [formConfig]=\"item.formConfig\"\n\t\t\t\t\t\t\t [form]=\"item.form\"\n [tabIndexStart]=\"tabIndexStart + i\">\n\t\t\t\t\t\t </koala-dynamic-form>\n\t\t\t\t\t <mat-action-row\n\t\t\t\t\t\t *ngIf=\"propriedade.get('moreItemsConfig').value.length > propriedade.get('moreItemsMinItems').value\">\n\t\t\t\t\t <button\n\t\t\t\t\t\t (click)=\"removeMoreItem(i, propriedade.get('moreItemsConfig').value.length - 1 - indexMoreItems)\"\n\t\t\t\t\t\t mat-icon-button>\n\t\t\t\t\t\t <mat-icon>delete</mat-icon>\n\t\t\t\t\t </button>\n\t\t\t\t\t </mat-action-row>\n\t\t\t\t\t </mat-expansion-panel>\n\t\t\t\t </mat-accordion>\n\t\t\t </fieldset>\n\t\t </div>\n\t\t <mat-form-field\n\t\t\t *ngIf=\"propriedade.get('type').value == typeField.autocomplete\"\n\t\t\t [appearance]=\"propriedade.get('appearance').value\"\n\t\t\t [floatLabel]=\"propriedade.get('floatLabel').value\"\n\t\t\t [formGroupName]=\"i\"\n\t\t\t [ngClass]=\"propriedade.get('fieldClass').value\">\n\t <mat-label>{{propriedade.get('label').value}} {{propriedade.get('multiple').value &&\n\t propriedade.get('required').value ? '*' : ''}}</mat-label>\n\t\t\t <div *ngIf=\"propriedade.get('multiple').value else single\">\n\t <mat-chip-list #chipList>\n\t <mat-chip\n\t\t (removed)=\"removeOptionOnAutocomplete(i, option)\"\n\t\t *ngFor=\"let option of propriedade.get('autocompleteSelectedValue').value\"\n\t\t [color]=\"getColorChip(propriedade.get('autocompleteMultipleConfig').value | async)\"\n\t\t [removable]=\"true\"\n\t\t [selectable]=\"true\">\n\t {{display(option)}}\n\t\t <mat-icon matChipRemove>cancel</mat-icon>\n\t </mat-chip>\n\t <input\n\t\t #autocompleteInput\n [koalaAutoFocus]=\"propriedade.get('focus').value\"\n\t\t [required]=\"propriedade.get('required').value\"\n\t\t [matAutocomplete]=\"auto\"\n\t\t [matChipInputFor]=\"chipList\"\n [tabIndex]=\"tabIndexStart + i\"\n\t\t formControlName=\"value\"\n\t\t matInput\n\t\t type=\"text\"\n\t\t placeholder=\"Selecione um ou mais op\u00E7\u00F5es...\">\n\t </mat-chip-list>\n\t </div>\n\t <ng-template #single>\n\t\t <input\n\t\t\t [matAutocomplete]=\"auto\"\n [koalaAutoFocus]=\"propriedade.get('focus').value\"\n\t\t\t [required]=\"propriedade.get('required').value\"\n [tabIndex]=\"tabIndexStart + i\"\n\t\t\t formControlName=\"value\"\n\t\t\t matInput\n\t\t\t placeholder=\"Selecione uma op\u00E7\u00E3o...\"\n\t\t\t type=\"text\">\n\t </ng-template>\n\t <mat-spinner *ngIf=\"propriedade.get('autocompleteLoading').value | async\" color=\"primary\"\n\t matSuffix></mat-spinner>\n\t <button\n\t\t (click)=\"clearAutocomplete(i)\"\n\t\t *ngIf=\"\n\t !(propriedade.get('autocompleteLoading').value | async) &&\n\t !propriedade.get('disabled').value\"\n\t\t color=\"warn\"\n\t\t mat-icon-button\n\t\t matSuffix\n\t\t type=\"button\">\n\t <mat-icon>close</mat-icon>\n\t </button>\n\t <mat-hint *ngIf=\"propriedade.get('textHint').value\">\n\t <mat-icon>info</mat-icon>\n\t\t {{propriedade.get('textHint').value}}\n\t </mat-hint>\n\t <mat-error *ngIf=\"propriedade.get('value').errors?.required || propriedade.get('value').errors?.autocompleteSelected\">\n\t <mat-icon>error</mat-icon>\n {{errorMessage.getAutocompleteMessage(propriedade.get('label').value)}}\n\t </mat-error>\n <mat-error *ngIf=\"propriedade.get('value').errors?.customError\">\n <mat-icon>error</mat-icon>\n {{propriedade.get('value').errors?.customError.message}}.\n </mat-error>\n\t <mat-autocomplete\n\t\t #auto=\"matAutocomplete\"\n\t\t [displayWith]=\"display\" autoActiveFirstOption>\n\t\t <div *ngIf=\"(propriedade.get('autocompleteOptionsFiltered').value | async) as options\">\n\t\t <mat-option *ngFor=\"let option of options\" [value]=\"option\">\n\t\t {{option.name}}\n\t\t </mat-option>\n\t\t </div>\n\t </mat-autocomplete>\n\t </mat-form-field>\n\t\t <div *ngIf=\"propriedade.get('type').value == typeField.file\">\n\t\t\t <koala-file-button\n\t\t\t\t (getFiles)=\"propriedade.get('value').setValue($event)\"\n\t\t\t\t [accept]=\"propriedade.get('fileButtonConfig').value.accept\"\n\t\t\t\t [backgroundColor]=\"propriedade.get('fileButtonConfig').value.backgroundColor\"\n\t\t\t\t [color]=\"propriedade.get('fileButtonConfig').value.color\"\n\t\t\t\t [disabled]=\"propriedade.get('disabled').value\"\n\t\t\t\t [icon]=\"propriedade.get('fileButtonConfig').value.icon\"\n\t\t\t\t [multiple]=\"propriedade.get('multiple').value\"\n\t\t\t\t [text]=\"propriedade.get('fileButtonConfig').value.text\">\n\t\t\t </koala-file-button>\n\t\t </div>\n\t\t <div *ngIf=\"\n\t\t propriedade.get('type').value == typeField.dynamicForm &&\n\t\t\t\t(propriedade.get('dynamicFormConfig').value | async) as dynamicFormConfig\">\n\t\t\t <fieldset *ngIf=\"propriedade.get('label').value else dynamicFormWithoutLabel\">\n\t\t\t\t <legend>{{propriedade.get('label').value}}</legend>\n\t\t\t\t <koala-dynamic-form\n\t\t\t\t\t [formConfig]=\"dynamicFormConfig.formConfig\"\n\t\t\t\t\t [form]=\"dynamicFormConfig.form\"\n\t\t\t\t\t [setValues]=\"dynamicFormConfig.setValues\"\n\t\t\t\t\t [showFields]=\"dynamicFormConfig.showFields\"\n [tabIndexStart]=\"tabIndexStart + i\">\n\t\t\t\t </koala-dynamic-form>\n\t\t\t </fieldset>\n\t\t\t <ng-template #dynamicFormWithoutLabel>\n\t\t\t\t <koala-dynamic-form\n\t\t\t\t\t [formConfig]=\"dynamicFormConfig.formConfig\"\n\t\t\t\t\t [form]=\"dynamicFormConfig.form\"\n\t\t\t\t\t [setValues]=\"dynamicFormConfig.setValues\"\n\t\t\t\t\t [showFields]=\"dynamicFormConfig.showFields\"\n [tabIndexStart]=\"tabIndexStart + i\">\n\t\t\t\t </koala-dynamic-form>\n\t\t\t </ng-template>\n\t\t </div>\n <div\n class=\"radio-btn-group\"\n *ngIf=\"propriedade.get('type').value == typeField.radio\"\n [formGroupName]=\"i\"\n [ngClass]=\"propriedade.get('fieldClass').value\">\n <mat-radio-group formControlName=\"value\">\n <label *ngIf=\"propriedade.get('label').value\">{{propriedade.get('label').value}}</label>\n <mat-radio-button\n [tabIndex]=\"tabIndexStart + i\"\n *ngFor=\"let options of propriedade.get('opcoesSelect').value\"\n [value]=\"options.value\">\n {{options.name}}\n </mat-radio-button>\n </mat-radio-group>\n </div>\n\t </div>\n </div>\n <ng-content select=\"[btn-submit]\"></ng-content>\n</div>\n",
|
|
1834
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1835
|
+
styles: [".more-items-content fieldset{border:1px solid #cccccc;padding:16px}.more-items-content fieldset legend{font-family:\"Josefin Sans\",sans-serif;font-size:11px;font-weight:bold;padding:0 8px}.more-items-content .items .titleForm{color:#616161}.more-items-content .items .mat-expansion-panel-header-title,.more-items-content .items .mat-expansion-panel-header-description{flex-basis:0}.more-items-content .items .mat-expansion-panel-header-description{align-items:center;justify-content:space-between}.more-items-content .items .mat-form-field+.mat-form-field{margin-left:8px}.radio-btn-group label{position:relative;display:block;padding:10px 0}.text-obs{background:#eeeeee;border-radius:5px;color:#212121;font-family:OpenSansLight,sans-serif;height:150px;margin:0 auto 10px;overflow-y:auto;padding:10px;position:relative;width:calc(100% - 27px)}.select-multiple-native{margin-bottom:15px}.select-multiple-native select{width:100%;height:150px;background:transparent;border:none}.select-multiple-native select:focus,.select-multiple-native select:active{outline:none}.select-multiple-native select option{padding:5px 10px;font-family:JosefinSans,sans-serif}.select-multiple-native select option:checked{background:#f1f1f1!important}\n"]
|
|
1836
|
+
},] }
|
|
1837
|
+
];
|
|
1838
|
+
DynamicFormComponent.ctorParameters = function () { return [
|
|
1839
|
+
{ type: i1.FormBuilder },
|
|
1840
|
+
{ type: KoalaDynamicFormService }
|
|
1841
|
+
]; };
|
|
1842
|
+
DynamicFormComponent.propDecorators = {
|
|
1843
|
+
form: [{ type: i0.Input }],
|
|
1844
|
+
formConfig: [{ type: i0.Input }],
|
|
1845
|
+
showFields: [{ type: i0.Input }],
|
|
1846
|
+
showFieldsMoreItensConfig: [{ type: i0.Input }],
|
|
1847
|
+
setValues: [{ type: i0.Input }],
|
|
1848
|
+
tabIndexStart: [{ type: i0.Input }],
|
|
1849
|
+
autocompleteInput: [{ type: i0.ViewChild, args: ['autocompleteInput',] }]
|
|
1850
|
+
};
|
|
1851
|
+
|
|
1852
|
+
var KoalaAutofocusDirective = /** @class */ (function () {
|
|
1853
|
+
function KoalaAutofocusDirective(el) {
|
|
1854
|
+
this.el = el;
|
|
1855
|
+
}
|
|
1856
|
+
KoalaAutofocusDirective.prototype.ngAfterContentInit = function () {
|
|
1857
|
+
var _this = this;
|
|
1858
|
+
if (this.koalaAutoFocus) {
|
|
1859
|
+
setTimeout(function () {
|
|
1860
|
+
_this.el.nativeElement.focus();
|
|
1861
|
+
}, 500);
|
|
1862
|
+
}
|
|
1863
|
+
};
|
|
1864
|
+
return KoalaAutofocusDirective;
|
|
1865
|
+
}());
|
|
1866
|
+
KoalaAutofocusDirective.decorators = [
|
|
1867
|
+
{ type: i0.Directive, args: [{
|
|
1868
|
+
selector: '[koalaAutoFocus]'
|
|
1869
|
+
},] }
|
|
1870
|
+
];
|
|
1871
|
+
KoalaAutofocusDirective.ctorParameters = function () { return [
|
|
1872
|
+
{ type: i0.ElementRef }
|
|
1873
|
+
]; };
|
|
1874
|
+
KoalaAutofocusDirective.propDecorators = {
|
|
1875
|
+
koalaAutoFocus: [{ type: i0.Input }]
|
|
1876
|
+
};
|
|
1877
|
+
|
|
1878
|
+
var KoalaFormModule = /** @class */ (function () {
|
|
1879
|
+
function KoalaFormModule() {
|
|
1880
|
+
}
|
|
1881
|
+
return KoalaFormModule;
|
|
1882
|
+
}());
|
|
1883
|
+
KoalaFormModule.decorators = [
|
|
1884
|
+
{ type: i0.NgModule, args: [{
|
|
1885
|
+
declarations: [
|
|
1886
|
+
BtnSubmitComponent,
|
|
1887
|
+
DynamicFormComponent,
|
|
1888
|
+
KoalaAutofocusDirective
|
|
1889
|
+
],
|
|
1890
|
+
imports: [
|
|
1891
|
+
common.CommonModule,
|
|
1892
|
+
i1.ReactiveFormsModule,
|
|
1893
|
+
i1.FormsModule,
|
|
1894
|
+
ng2CurrencyMask.CurrencyMaskModule,
|
|
1895
|
+
ngxMask.NgxMaskModule.forRoot(core.maskOptions),
|
|
1896
|
+
fileButton.KoalaFileButtonModule,
|
|
1897
|
+
input.MatInputModule,
|
|
1898
|
+
select.MatSelectModule,
|
|
1899
|
+
radio.MatRadioModule,
|
|
1900
|
+
checkbox.MatCheckboxModule,
|
|
1901
|
+
autocomplete.MatAutocompleteModule,
|
|
1902
|
+
button.MatButtonModule,
|
|
1903
|
+
icon.MatIconModule,
|
|
1904
|
+
expansion.MatExpansionModule,
|
|
1905
|
+
chips.MatChipsModule,
|
|
1906
|
+
button$1.KoalaButtonModule,
|
|
1907
|
+
progressSpinner.MatProgressSpinnerModule
|
|
1908
|
+
],
|
|
1909
|
+
exports: [
|
|
1910
|
+
i1.ReactiveFormsModule,
|
|
1911
|
+
i1.FormsModule,
|
|
1912
|
+
KoalaAutofocusDirective,
|
|
1913
|
+
ngxMask.NgxMaskModule,
|
|
1914
|
+
fileButton.KoalaFileButtonModule,
|
|
1915
|
+
input.MatInputModule,
|
|
1916
|
+
select.MatSelectModule,
|
|
1917
|
+
radio.MatRadioModule,
|
|
1918
|
+
checkbox.MatCheckboxModule,
|
|
1919
|
+
autocomplete.MatAutocompleteModule,
|
|
1920
|
+
button.MatButtonModule,
|
|
1921
|
+
icon.MatIconModule,
|
|
1922
|
+
progressSpinner.MatProgressSpinnerModule,
|
|
1923
|
+
BtnSubmitComponent,
|
|
1924
|
+
DynamicFormComponent
|
|
1925
|
+
]
|
|
1926
|
+
},] }
|
|
1927
|
+
];
|
|
1928
|
+
|
|
1929
|
+
/**
|
|
1930
|
+
* Generated bundle index. Do not edit.
|
|
1931
|
+
*/
|
|
1932
|
+
|
|
1933
|
+
exports.AutocompleteSelectedValidator = AutocompleteSelectedValidator;
|
|
1934
|
+
exports.BtnSubmitComponent = BtnSubmitComponent;
|
|
1935
|
+
exports.CnpjValidator = CnpjValidator;
|
|
1936
|
+
exports.CpfValidator = CpfValidator;
|
|
1937
|
+
exports.DynamicFormComponent = DynamicFormComponent;
|
|
1938
|
+
exports.FormAbstract = FormAbstract;
|
|
1939
|
+
exports.KoalaAutofocusDirective = KoalaAutofocusDirective;
|
|
1940
|
+
exports.KoalaDynamicFormService = KoalaDynamicFormService;
|
|
1941
|
+
exports.KoalaDynamicFormValidatorResultHelper = KoalaDynamicFormValidatorResultHelper;
|
|
1942
|
+
exports.KoalaFormModule = KoalaFormModule;
|
|
1943
|
+
exports.ShowInvalidFields = ShowInvalidFields;
|
|
1944
|
+
exports.ValidationHelper = ValidationHelper;
|
|
1945
|
+
|
|
1946
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1947
|
+
|
|
1948
|
+
}));
|
|
1949
|
+
//# sourceMappingURL=koalarx-ui-form.umd.js.map
|