@koalarx/ui 12.7.18 → 13.0.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.
Files changed (433) hide show
  1. package/alert/{esm2015/index.js → esm2020/index.mjs} +0 -0
  2. package/alert/{esm2015/koalarx-ui-alert.js → esm2020/koalarx-ui-alert.mjs} +0 -0
  3. package/alert/esm2020/lib/dialog-alert.component.mjs +48 -0
  4. package/alert/{esm2015/lib/koala.alert-config.interface.js → esm2020/lib/koala.alert-config.interface.mjs} +0 -0
  5. package/alert/{esm2015/lib/koala.alert.enum.js → esm2020/lib/koala.alert.enum.mjs} +0 -0
  6. package/alert/esm2020/lib/koala.alert.module.mjs +48 -0
  7. package/alert/esm2020/lib/koala.alert.service.mjs +19 -0
  8. package/alert/{esm2015/lib/koala.request-code-to-alert-enum.translate.js → esm2020/lib/koala.request-code-to-alert-enum.translate.mjs} +0 -0
  9. package/alert/fesm2015/koalarx-ui-alert.mjs +141 -0
  10. package/alert/fesm2015/koalarx-ui-alert.mjs.map +1 -0
  11. package/alert/fesm2020/koalarx-ui-alert.mjs +139 -0
  12. package/alert/fesm2020/koalarx-ui-alert.mjs.map +1 -0
  13. package/alert/koalarx-ui-alert.d.ts +1 -0
  14. package/alert/lib/dialog-alert.component.d.ts +3 -0
  15. package/alert/lib/koala.alert.module.d.ts +10 -0
  16. package/alert/lib/koala.alert.service.d.ts +3 -0
  17. package/alert/package.json +18 -6
  18. package/button/{esm2015/index.js → esm2020/index.mjs} +0 -0
  19. package/button/{esm2015/koalarx-ui-button.js → esm2020/koalarx-ui-button.mjs} +0 -0
  20. package/button/esm2020/lib/button.component.mjs +44 -0
  21. package/button/esm2020/lib/koala.button.module.mjs +42 -0
  22. package/button/fesm2015/koalarx-ui-button.mjs +90 -0
  23. package/button/fesm2015/koalarx-ui-button.mjs.map +1 -0
  24. package/button/fesm2020/koalarx-ui-button.mjs +90 -0
  25. package/button/fesm2020/koalarx-ui-button.mjs.map +1 -0
  26. package/button/koalarx-ui-button.d.ts +1 -0
  27. package/button/lib/button.component.d.ts +6 -1
  28. package/button/lib/koala.button.module.d.ts +10 -0
  29. package/button/package.json +18 -6
  30. package/common/{esm2015/index.js → esm2020/index.mjs} +0 -0
  31. package/common/{esm2015/koalarx-ui-common.js → esm2020/koalarx-ui-common.mjs} +0 -0
  32. package/common/{esm2015/lib/mask-options.js → esm2020/lib/mask-options.mjs} +0 -0
  33. package/common/esm2020/lib/services/csv/koala.csv.service.mjs +36 -0
  34. package/common/{esm2015/lib/services/xlsx/koala.xlsx-config.interface.js → esm2020/lib/services/xlsx/koala.xlsx-config.interface.mjs} +0 -0
  35. package/common/esm2020/lib/services/xlsx/koala.xlsx.service.mjs +73 -0
  36. package/common/fesm2015/{koalarx-ui-common.js → koalarx-ui-common.mjs} +14 -14
  37. package/common/fesm2015/koalarx-ui-common.mjs.map +1 -0
  38. package/common/fesm2020/koalarx-ui-common.mjs +118 -0
  39. package/common/fesm2020/koalarx-ui-common.mjs.map +1 -0
  40. package/common/koalarx-ui-common.d.ts +1 -0
  41. package/common/lib/services/csv/koala.csv.service.d.ts +3 -0
  42. package/common/lib/services/xlsx/koala.xlsx.service.d.ts +3 -0
  43. package/common/package.json +18 -6
  44. package/core/esm2020/index.mjs +35 -0
  45. package/core/esm2020/koalarx-ui-core.mjs +5 -0
  46. package/core/{esm2015/lib/environments/koalaEnvironment.js → esm2020/lib/environments/koalaEnvironment.mjs} +0 -0
  47. package/core/esm2020/lib/loader/loader-bar-page.component.mjs +24 -0
  48. package/core/{esm2015/lib/loader/loader-bar-page.interface.js → esm2020/lib/loader/loader-bar-page.interface.mjs} +0 -0
  49. package/core/{esm2015/lib/loader/loader-config.interface.js → esm2020/lib/loader/loader-config.interface.mjs} +0 -0
  50. package/core/esm2020/lib/ngx-koala.module.mjs +49 -0
  51. package/core/{esm2015/lib/page/koala-language.helper.js → esm2020/lib/page/koala-language.helper.mjs} +0 -0
  52. package/core/{esm2015/lib/page/koala-page-pallet-colors.interface.js → esm2020/lib/page/koala-page-pallet-colors.interface.mjs} +0 -0
  53. package/core/esm2020/lib/page/koala.page.module.mjs +78 -0
  54. package/core/{esm2015/lib/page/koala.user-menu-options.interface.js → esm2020/lib/page/koala.user-menu-options.interface.mjs} +0 -0
  55. package/core/{esm2015/lib/page/notifications/koala.notification.interface.js → esm2020/lib/page/notifications/koala.notification.interface.mjs} +0 -0
  56. package/core/esm2020/lib/page/notifications/notification.component.mjs +47 -0
  57. package/core/esm2020/lib/page/page.component.mjs +404 -0
  58. package/core/esm2020/lib/router/koala.parameter-hash-location-stategy.mjs +18 -0
  59. package/core/esm2020/lib/services/api-requester/factory/koala.response.factory.mjs +44 -0
  60. package/core/{esm2015/lib/services/api-requester/helpers/error/koala.client.error.js → esm2020/lib/services/api-requester/helpers/error/koala.client.error.mjs} +0 -0
  61. package/core/{esm2015/lib/services/api-requester/helpers/error/koala.errors.helper.js → esm2020/lib/services/api-requester/helpers/error/koala.errors.helper.mjs} +0 -0
  62. package/core/{esm2015/lib/services/api-requester/helpers/error/koala.not-found.error.js → esm2020/lib/services/api-requester/helpers/error/koala.not-found.error.mjs} +0 -0
  63. package/core/{esm2015/lib/services/api-requester/helpers/error/koala.success.error.js → esm2020/lib/services/api-requester/helpers/error/koala.success.error.mjs} +0 -0
  64. package/core/{esm2015/lib/services/api-requester/helpers/error/koala.unhautorized.error.js → esm2020/lib/services/api-requester/helpers/error/koala.unhautorized.error.mjs} +0 -0
  65. package/core/{esm2015/lib/services/api-requester/helpers/service/koala.request-header.helper.js → esm2020/lib/services/api-requester/helpers/service/koala.request-header.helper.mjs} +0 -0
  66. package/core/esm2020/lib/services/api-requester/koala.api-requester.base.mjs +63 -0
  67. package/core/esm2020/lib/services/api-requester/koala.api-requester.service.mjs +131 -0
  68. package/core/esm2020/lib/services/loader/koala.loader.service.mjs +34 -0
  69. package/core/{esm2015/lib/services/openid/koala-oauth2-config.interface.js → esm2020/lib/services/openid/koala-oauth2-config.interface.mjs} +0 -0
  70. package/core/esm2020/lib/services/openid/koala.oauth.config.mjs +30 -0
  71. package/core/esm2020/lib/services/openid/koala.oauth2.service.mjs +194 -0
  72. package/core/esm2020/lib/services/request/koala.request.service.mjs +52 -0
  73. package/core/{esm2015/lib/services/token/koala.token.service.js → esm2020/lib/services/token/koala.token.service.mjs} +7 -6
  74. package/core/esm2020/lib/services/token/token.factory.mjs +27 -0
  75. package/core/fesm2015/{koalarx-ui-core.js → koalarx-ui-core.mjs} +249 -191
  76. package/core/fesm2015/koalarx-ui-core.mjs.map +1 -0
  77. package/core/fesm2020/koalarx-ui-core.mjs +1367 -0
  78. package/core/fesm2020/koalarx-ui-core.mjs.map +1 -0
  79. package/core/index.d.ts +1 -0
  80. package/core/koalarx-ui-core.d.ts +1 -2
  81. package/core/lib/loader/loader-bar-page.component.d.ts +5 -1
  82. package/core/lib/ngx-koala.module.d.ts +7 -0
  83. package/core/lib/page/koala.page.module.d.ts +19 -0
  84. package/core/lib/page/notifications/notification.component.d.ts +3 -0
  85. package/core/lib/page/page.component.d.ts +3 -0
  86. package/core/lib/router/koala.parameter-hash-location-stategy.d.ts +3 -0
  87. package/core/lib/services/api-requester/koala.api-requester.service.d.ts +3 -0
  88. package/core/lib/services/loader/koala.loader.service.d.ts +3 -0
  89. package/core/lib/services/openid/koala.oauth2.service.d.ts +3 -0
  90. package/core/lib/services/request/koala.request.service.d.ts +3 -0
  91. package/core/lib/services/token/koala.token.service.d.ts +3 -0
  92. package/core/package.json +18 -6
  93. package/dialog/{esm2015/index.js → esm2020/index.mjs} +0 -0
  94. package/dialog/{esm2015/koalarx-ui-dialog.js → esm2020/koalarx-ui-dialog.mjs} +0 -0
  95. package/dialog/esm2020/lib/dialog.component.mjs +25 -0
  96. package/dialog/{esm2015/lib/koala.dialog-template.interface.js → esm2020/lib/koala.dialog-template.interface.mjs} +0 -0
  97. package/dialog/esm2020/lib/koala.dialog.module.mjs +38 -0
  98. package/dialog/esm2020/lib/koala.dialog.service.mjs +57 -0
  99. package/dialog/fesm2015/koalarx-ui-dialog.mjs +121 -0
  100. package/dialog/fesm2015/koalarx-ui-dialog.mjs.map +1 -0
  101. package/dialog/fesm2020/koalarx-ui-dialog.mjs +121 -0
  102. package/dialog/fesm2020/koalarx-ui-dialog.mjs.map +1 -0
  103. package/dialog/koalarx-ui-dialog.d.ts +1 -0
  104. package/dialog/lib/dialog.component.d.ts +3 -0
  105. package/dialog/lib/koala.dialog.module.d.ts +9 -0
  106. package/dialog/lib/koala.dialog.service.d.ts +3 -0
  107. package/dialog/package.json +18 -6
  108. package/dynamic-component/{esm2015/index.js → esm2020/index.mjs} +0 -0
  109. package/dynamic-component/{esm2015/koalarx-ui-dynamic-component.js → esm2020/koalarx-ui-dynamic-component.mjs} +0 -0
  110. package/dynamic-component/{esm2015/lib/koala-dynamic-component.component.js → esm2020/lib/koala-dynamic-component.component.mjs} +0 -0
  111. package/dynamic-component/esm2020/lib/koala-dynamic-component.directive.mjs +16 -0
  112. package/dynamic-component/esm2020/lib/koala-dynamic-component.factory.mjs +41 -0
  113. package/dynamic-component/{esm2015/lib/koala-dynamic-component.js → esm2020/lib/koala-dynamic-component.mjs} +0 -0
  114. package/dynamic-component/esm2020/lib/koala-dynamic-component.module.mjs +23 -0
  115. package/dynamic-component/fesm2015/koalarx-ui-dynamic-component.mjs +87 -0
  116. package/dynamic-component/fesm2015/koalarx-ui-dynamic-component.mjs.map +1 -0
  117. package/dynamic-component/fesm2020/koalarx-ui-dynamic-component.mjs +86 -0
  118. package/dynamic-component/fesm2020/koalarx-ui-dynamic-component.mjs.map +1 -0
  119. package/dynamic-component/koalarx-ui-dynamic-component.d.ts +1 -0
  120. package/dynamic-component/lib/koala-dynamic-component.directive.d.ts +3 -0
  121. package/dynamic-component/lib/koala-dynamic-component.factory.d.ts +3 -0
  122. package/dynamic-component/lib/koala-dynamic-component.module.d.ts +6 -0
  123. package/dynamic-component/package.json +18 -6
  124. package/file-button/{esm2015/index.js → esm2020/index.mjs} +0 -0
  125. package/file-button/{esm2015/koalarx-ui-file-button.js → esm2020/koalarx-ui-file-button.mjs} +0 -0
  126. package/file-button/esm2020/lib/file-button.component.mjs +125 -0
  127. package/file-button/esm2020/lib/koala.btn-file.service.mjs +25 -0
  128. package/file-button/esm2020/lib/koala.file-button.module.mjs +38 -0
  129. package/file-button/{esm2015/lib/koala.file.interface.js → esm2020/lib/koala.file.interface.mjs} +0 -0
  130. package/file-button/fesm2015/koalarx-ui-file-button.mjs +199 -0
  131. package/file-button/fesm2015/koalarx-ui-file-button.mjs.map +1 -0
  132. package/file-button/fesm2020/koalarx-ui-file-button.mjs +189 -0
  133. package/file-button/fesm2020/koalarx-ui-file-button.mjs.map +1 -0
  134. package/file-button/koalarx-ui-file-button.d.ts +1 -0
  135. package/file-button/lib/file-button.component.d.ts +4 -1
  136. package/file-button/lib/koala.btn-file.service.d.ts +3 -0
  137. package/file-button/lib/koala.file-button.module.d.ts +9 -0
  138. package/file-button/package.json +18 -6
  139. package/folder-page/{esm2015/index.js → esm2020/index.mjs} +0 -0
  140. package/folder-page/{esm2015/koalarx-ui-folder-page.js → esm2020/koalarx-ui-folder-page.mjs} +0 -0
  141. package/folder-page/esm2020/lib/folder.component.mjs +70 -0
  142. package/folder-page/{esm2015/lib/koala-navigate-history.interface.js → esm2020/lib/koala-navigate-history.interface.mjs} +0 -0
  143. package/folder-page/esm2020/lib/koala.folder-page.module.mjs +42 -0
  144. package/folder-page/fesm2015/koalarx-ui-folder-page.mjs +117 -0
  145. package/folder-page/fesm2015/koalarx-ui-folder-page.mjs.map +1 -0
  146. package/folder-page/fesm2020/koalarx-ui-folder-page.mjs +116 -0
  147. package/folder-page/fesm2020/koalarx-ui-folder-page.mjs.map +1 -0
  148. package/folder-page/koalarx-ui-folder-page.d.ts +1 -0
  149. package/folder-page/lib/folder.component.d.ts +6 -2
  150. package/folder-page/lib/koala.folder-page.module.d.ts +10 -0
  151. package/folder-page/package.json +18 -6
  152. package/form/{esm2015/index.js → esm2020/index.mjs} +0 -0
  153. package/form/{esm2015/koalarx-ui-form.js → esm2020/koalarx-ui-form.mjs} +0 -0
  154. package/form/esm2020/lib/btn-submit/btn-submit.component.mjs +49 -0
  155. package/form/esm2020/lib/directives/koala-autofocus.directive.mjs +25 -0
  156. package/form/esm2020/lib/dynamic-form/builder/dynamic-form.builder.mjs +138 -0
  157. package/form/{esm2015/lib/dynamic-form/builder/fields/autocomplete.builder.js → esm2020/lib/dynamic-form/builder/fields/autocomplete.builder.mjs} +0 -0
  158. package/form/esm2020/lib/dynamic-form/builder/fields/field.base.mjs +148 -0
  159. package/form/{esm2015/lib/dynamic-form/builder/fields/field.builder.js → esm2020/lib/dynamic-form/builder/fields/field.builder.mjs} +0 -0
  160. package/form/esm2020/lib/dynamic-form/builder/fields/more-items.builder.mjs +57 -0
  161. package/form/esm2020/lib/dynamic-form/dynamic-form.component.mjs +581 -0
  162. package/form/{esm2015/lib/dynamic-form/enums/dynamic-form-type-field.enum.js → esm2020/lib/dynamic-form/enums/dynamic-form-type-field.enum.mjs} +0 -0
  163. package/form/{esm2015/lib/dynamic-form/interfaces/koala-custom-validator-fn.interface.js → esm2020/lib/dynamic-form/interfaces/koala-custom-validator-fn.interface.mjs} +0 -0
  164. package/form/{esm2015/lib/dynamic-form/interfaces/koala.dynamic-autocomplete-options.interface.js → esm2020/lib/dynamic-form/interfaces/koala.dynamic-autocomplete-options.interface.mjs} +0 -0
  165. package/form/{esm2015/lib/dynamic-form/interfaces/koala.dynamic-form-autocomplete-multiple-config.interface.js → esm2020/lib/dynamic-form/interfaces/koala.dynamic-form-autocomplete-multiple-config.interface.mjs} +0 -0
  166. package/form/{esm2015/lib/dynamic-form/interfaces/koala.dynamic-form-config.interface.js → esm2020/lib/dynamic-form/interfaces/koala.dynamic-form-config.interface.mjs} +0 -0
  167. package/form/{esm2015/lib/dynamic-form/interfaces/koala.dynamic-form-field.interface.js → esm2020/lib/dynamic-form/interfaces/koala.dynamic-form-field.interface.mjs} +0 -0
  168. package/form/{esm2015/lib/dynamic-form/interfaces/koala.dynamic-form-more-itens-show-field-config.interface.js → esm2020/lib/dynamic-form/interfaces/koala.dynamic-form-more-itens-show-field-config.interface.mjs} +0 -0
  169. package/form/{esm2015/lib/dynamic-form/interfaces/koala.dynamic-form-show-field.interface.js → esm2020/lib/dynamic-form/interfaces/koala.dynamic-form-show-field.interface.mjs} +0 -0
  170. package/form/{esm2015/lib/dynamic-form/interfaces/koala.dynamic-set-value.interface.js → esm2020/lib/dynamic-form/interfaces/koala.dynamic-set-value.interface.mjs} +0 -0
  171. package/form/esm2020/lib/dynamic-form/koala.dynamic-form.service.mjs +199 -0
  172. package/form/{esm2015/lib/dynamic-form/validators/autocomplete-selected.validator.js → esm2020/lib/dynamic-form/validators/autocomplete-selected.validator.mjs} +0 -0
  173. package/form/{esm2015/lib/dynamic-form/validators/cnpj.validator.js → esm2020/lib/dynamic-form/validators/cnpj.validator.mjs} +0 -0
  174. package/form/{esm2015/lib/dynamic-form/validators/cpf.validator.js → esm2020/lib/dynamic-form/validators/cpf.validator.mjs} +0 -0
  175. package/form/{esm2015/lib/dynamic-form/validators/date-max.validator.js → esm2020/lib/dynamic-form/validators/date-max.validator.mjs} +0 -0
  176. package/form/{esm2015/lib/dynamic-form/validators/date-min.validator.js → esm2020/lib/dynamic-form/validators/date-min.validator.mjs} +0 -0
  177. package/form/{esm2015/lib/dynamic-form/validators/koala-dynamic-form-validator-result.helper.js → esm2020/lib/dynamic-form/validators/koala-dynamic-form-validator-result.helper.mjs} +0 -0
  178. package/form/{esm2015/lib/dynamic-form/validators/validation.helper.js → esm2020/lib/dynamic-form/validators/validation.helper.mjs} +0 -0
  179. package/form/{esm2015/lib/form.abstract.js → esm2020/lib/form.abstract.mjs} +0 -0
  180. package/form/esm2020/lib/koala.form.module.mjs +134 -0
  181. package/form/{esm2015/lib/show-invalid-fields/show-invalid-fields.js → esm2020/lib/show-invalid-fields/show-invalid-fields.mjs} +0 -0
  182. package/form/fesm2015/koalarx-ui-form.mjs +1575 -0
  183. package/form/fesm2015/koalarx-ui-form.mjs.map +1 -0
  184. package/form/fesm2020/koalarx-ui-form.mjs +1557 -0
  185. package/form/fesm2020/koalarx-ui-form.mjs.map +1 -0
  186. package/form/koalarx-ui-form.d.ts +1 -0
  187. package/form/lib/btn-submit/btn-submit.component.d.ts +3 -0
  188. package/form/lib/directives/koala-autofocus.directive.d.ts +3 -0
  189. package/form/lib/dynamic-form/builder/fields/field.base.d.ts +1 -1
  190. package/form/lib/dynamic-form/dynamic-form.component.d.ts +8 -1
  191. package/form/lib/dynamic-form/koala.dynamic-form.service.d.ts +3 -0
  192. package/form/lib/koala.form.module.d.ts +23 -0
  193. package/form/package.json +18 -6
  194. package/icon/{esm2015/index.js → esm2020/index.mjs} +2 -1
  195. package/icon/{esm2015/koalarx-ui-icon.js → esm2020/koalarx-ui-icon.mjs} +0 -0
  196. package/icon/esm2020/lib/icon.component.mjs +46 -0
  197. package/icon/esm2020/lib/koala.icon.module.mjs +26 -0
  198. package/icon/esm2020/lib/koala.icon.type.mjs +2 -0
  199. package/icon/fesm2015/koalarx-ui-icon.mjs +77 -0
  200. package/icon/{esm2015/lib/icon.component.js → fesm2015/koalarx-ui-icon.mjs.map} +1 -45
  201. package/icon/fesm2020/koalarx-ui-icon.mjs +76 -0
  202. package/icon/{fesm2015/koalarx-ui-icon.js → fesm2020/koalarx-ui-icon.mjs.map} +1 -69
  203. package/icon/index.d.ts +1 -0
  204. package/icon/koalarx-ui-icon.d.ts +1 -0
  205. package/icon/lib/icon.component.d.ts +4 -1
  206. package/icon/lib/koala.icon.module.d.ts +6 -0
  207. package/icon/lib/koala.icon.type.d.ts +1 -0
  208. package/icon/package.json +18 -6
  209. package/icons-animated/{esm2015/index.js → esm2020/index.mjs} +0 -0
  210. package/icons-animated/esm2020/koalarx-ui-icons-animated.mjs +5 -0
  211. package/icons-animated/esm2020/lib/icons/downloading/downloading-icon-animated.component.mjs +23 -0
  212. package/icons-animated/esm2020/lib/icons/loading/loading-icon-animated.component.mjs +23 -0
  213. package/icons-animated/esm2020/lib/icons-animated.component.mjs +20 -0
  214. package/icons-animated/esm2020/lib/icons-animated.service.mjs +32 -0
  215. package/icons-animated/esm2020/lib/koala-icons-animated.module.mjs +32 -0
  216. package/icons-animated/fesm2015/koalarx-ui-icons-animated.mjs +122 -0
  217. package/icons-animated/fesm2015/koalarx-ui-icons-animated.mjs.map +1 -0
  218. package/icons-animated/fesm2020/koalarx-ui-icons-animated.mjs +120 -0
  219. package/icons-animated/fesm2020/koalarx-ui-icons-animated.mjs.map +1 -0
  220. package/icons-animated/koalarx-ui-icons-animated.d.ts +1 -1
  221. package/icons-animated/lib/icons/downloading/downloading-icon-animated.component.d.ts +5 -2
  222. package/icons-animated/lib/icons/loading/loading-icon-animated.component.d.ts +5 -2
  223. package/icons-animated/lib/icons-animated.component.d.ts +3 -0
  224. package/icons-animated/lib/icons-animated.service.d.ts +3 -0
  225. package/icons-animated/lib/koala-icons-animated.module.d.ts +8 -0
  226. package/icons-animated/package.json +18 -6
  227. package/list/{esm2015/index.js → esm2020/index.mjs} +0 -0
  228. package/list/{esm2015/koalarx-ui-list.js → esm2020/koalarx-ui-list.mjs} +0 -0
  229. package/list/{esm2015/lib/koala-list-btn-collapse-sub-list-config.interface.js → esm2020/lib/koala-list-btn-collapse-sub-list-config.interface.mjs} +0 -0
  230. package/list/{esm2015/lib/koala-list-filter.interface.js → esm2020/lib/koala-list-filter.interface.mjs} +0 -0
  231. package/list/{esm2015/lib/koala-list-form-filter.interface.js → esm2020/lib/koala-list-form-filter.interface.mjs} +0 -0
  232. package/list/{esm2015/lib/koala-list-item-menu-option.interface.js → esm2020/lib/koala-list-item-menu-option.interface.mjs} +0 -0
  233. package/list/{esm2015/lib/koala-list-item.interface.js → esm2020/lib/koala-list-item.interface.mjs} +0 -0
  234. package/list/{esm2015/lib/koala.list-config.interface.js → esm2020/lib/koala.list-config.interface.mjs} +0 -0
  235. package/list/esm2020/lib/koala.list.module.mjs +70 -0
  236. package/list/esm2020/lib/koala.list.service.mjs +15 -0
  237. package/list/esm2020/lib/list-builder/list.builder.mjs +97 -0
  238. package/list/esm2020/lib/list.abstract.mjs +157 -0
  239. package/list/esm2020/lib/list.component.mjs +171 -0
  240. package/list/esm2020/lib/providers/pagination/pagination.provider.mjs +32 -0
  241. package/list/fesm2015/koalarx-ui-list.mjs +559 -0
  242. package/list/fesm2015/koalarx-ui-list.mjs.map +1 -0
  243. package/list/fesm2020/koalarx-ui-list.mjs +529 -0
  244. package/list/fesm2020/koalarx-ui-list.mjs.map +1 -0
  245. package/list/koalarx-ui-list.d.ts +1 -0
  246. package/list/lib/koala.list.module.d.ts +15 -0
  247. package/list/lib/koala.list.service.d.ts +3 -0
  248. package/list/lib/list.component.d.ts +3 -0
  249. package/list/lib/providers/pagination/pagination.provider.d.ts +3 -0
  250. package/list/package.json +18 -6
  251. package/menu/{esm2015/index.js → esm2020/index.mjs} +0 -0
  252. package/menu/{esm2015/koalarx-ui-menu.js → esm2020/koalarx-ui-menu.mjs} +0 -0
  253. package/menu/{esm2015/lib/koala.menu-module.interface.js → esm2020/lib/koala.menu-module.interface.mjs} +0 -0
  254. package/menu/{esm2015/lib/koala.menu-tool.interface.js → esm2020/lib/koala.menu-tool.interface.mjs} +0 -0
  255. package/menu/esm2020/lib/koala.menu.module.mjs +38 -0
  256. package/menu/esm2020/lib/koala.menu.service.mjs +24 -0
  257. package/menu/esm2020/lib/menu.component.mjs +100 -0
  258. package/menu/fesm2015/koalarx-ui-menu.mjs +167 -0
  259. package/menu/fesm2015/koalarx-ui-menu.mjs.map +1 -0
  260. package/menu/fesm2020/koalarx-ui-menu.mjs +162 -0
  261. package/menu/fesm2020/koalarx-ui-menu.mjs.map +1 -0
  262. package/menu/koalarx-ui-menu.d.ts +1 -0
  263. package/menu/lib/koala.menu.module.d.ts +9 -0
  264. package/menu/lib/koala.menu.service.d.ts +3 -0
  265. package/menu/lib/menu.component.d.ts +6 -0
  266. package/menu/package.json +18 -6
  267. package/package.json +9 -9
  268. package/question/{esm2015/index.js → esm2020/index.mjs} +0 -0
  269. package/question/{esm2015/koalarx-ui-question.js → esm2020/koalarx-ui-question.mjs} +0 -0
  270. package/question/esm2020/lib/dialog-question.component.mjs +25 -0
  271. package/question/{esm2015/lib/koala-question-config.interface.js → esm2020/lib/koala-question-config.interface.mjs} +0 -0
  272. package/question/esm2020/lib/koala.question.module.mjs +42 -0
  273. package/question/esm2020/lib/koala.question.service.mjs +26 -0
  274. package/question/fesm2015/koalarx-ui-question.mjs +95 -0
  275. package/question/fesm2015/koalarx-ui-question.mjs.map +1 -0
  276. package/question/fesm2020/koalarx-ui-question.mjs +93 -0
  277. package/question/fesm2020/koalarx-ui-question.mjs.map +1 -0
  278. package/question/koalarx-ui-question.d.ts +1 -0
  279. package/question/lib/dialog-question.component.d.ts +3 -0
  280. package/question/lib/koala.question.module.d.ts +10 -0
  281. package/question/lib/koala.question.service.d.ts +3 -0
  282. package/question/package.json +18 -6
  283. package/snackbar/{esm2015/index.js → esm2020/index.mjs} +0 -0
  284. package/snackbar/{esm2015/koalarx-ui-snackbar.js → esm2020/koalarx-ui-snackbar.mjs} +0 -0
  285. package/snackbar/esm2020/lib/koala.snackbar.component.mjs +22 -0
  286. package/snackbar/{esm2015/lib/koala.snackbar.interface.js → esm2020/lib/koala.snackbar.interface.mjs} +0 -0
  287. package/snackbar/esm2020/lib/koala.snackbar.module.mjs +38 -0
  288. package/snackbar/esm2020/lib/koala.snackbar.service.mjs +35 -0
  289. package/snackbar/fesm2015/koalarx-ui-snackbar.mjs +95 -0
  290. package/snackbar/fesm2015/koalarx-ui-snackbar.mjs.map +1 -0
  291. package/snackbar/fesm2020/koalarx-ui-snackbar.mjs +93 -0
  292. package/snackbar/fesm2020/koalarx-ui-snackbar.mjs.map +1 -0
  293. package/snackbar/koalarx-ui-snackbar.d.ts +1 -0
  294. package/snackbar/lib/koala.snackbar.component.d.ts +3 -0
  295. package/snackbar/lib/koala.snackbar.module.d.ts +8 -0
  296. package/snackbar/lib/koala.snackbar.service.d.ts +3 -0
  297. package/snackbar/package.json +18 -6
  298. package/alert/bundles/koalarx-ui-alert.umd.js +0 -153
  299. package/alert/bundles/koalarx-ui-alert.umd.js.map +0 -1
  300. package/alert/esm2015/lib/dialog-alert.component.js +0 -43
  301. package/alert/esm2015/lib/koala.alert.module.js +0 -31
  302. package/alert/esm2015/lib/koala.alert.service.js +0 -21
  303. package/alert/fesm2015/koalarx-ui-alert.js +0 -121
  304. package/alert/fesm2015/koalarx-ui-alert.js.map +0 -1
  305. package/alert/koalarx-ui-alert.metadata.json +0 -1
  306. package/button/bundles/koalarx-ui-button.umd.js +0 -71
  307. package/button/bundles/koalarx-ui-button.umd.js.map +0 -1
  308. package/button/esm2015/lib/button.component.js +0 -31
  309. package/button/esm2015/lib/koala.button.module.js +0 -27
  310. package/button/fesm2015/koalarx-ui-button.js +0 -63
  311. package/button/fesm2015/koalarx-ui-button.js.map +0 -1
  312. package/button/koalarx-ui-button.metadata.json +0 -1
  313. package/common/bundles/koalarx-ui-common.umd.js +0 -481
  314. package/common/bundles/koalarx-ui-common.umd.js.map +0 -1
  315. package/common/esm2015/lib/services/csv/koala.csv.service.js +0 -38
  316. package/common/esm2015/lib/services/xlsx/koala.xlsx.service.js +0 -74
  317. package/common/fesm2015/koalarx-ui-common.js.map +0 -1
  318. package/common/koalarx-ui-common.metadata.json +0 -1
  319. package/core/bundles/koalarx-ui-core.umd.js +0 -1716
  320. package/core/bundles/koalarx-ui-core.umd.js.map +0 -1
  321. package/core/esm2015/index.js +0 -34
  322. package/core/esm2015/koalarx-ui-core.js +0 -7
  323. package/core/esm2015/lib/loader/loader-bar-page.component.js +0 -22
  324. package/core/esm2015/lib/ngx-koala.module.js +0 -35
  325. package/core/esm2015/lib/page/koala.page.module.js +0 -46
  326. package/core/esm2015/lib/page/notifications/notification.component.js +0 -43
  327. package/core/esm2015/lib/page/page.component.js +0 -396
  328. package/core/esm2015/lib/router/koala.parameter-hash-location-stategy.js +0 -16
  329. package/core/esm2015/lib/services/api-requester/factory/koala.response.factory.js +0 -48
  330. package/core/esm2015/lib/services/api-requester/koala.api-requester.base.js +0 -70
  331. package/core/esm2015/lib/services/api-requester/koala.api-requester.service.js +0 -134
  332. package/core/esm2015/lib/services/loader/koala.loader.service.js +0 -32
  333. package/core/esm2015/lib/services/openid/koala.oauth.config.js +0 -33
  334. package/core/esm2015/lib/services/openid/koala.oauth2.service.js +0 -201
  335. package/core/esm2015/lib/services/request/koala.request.service.js +0 -53
  336. package/core/esm2015/lib/services/token/token.factory.js +0 -31
  337. package/core/fesm2015/koalarx-ui-core.js.map +0 -1
  338. package/core/koalarx-ui-core.metadata.json +0 -1
  339. package/dialog/bundles/koalarx-ui-dialog.umd.js +0 -139
  340. package/dialog/bundles/koalarx-ui-dialog.umd.js.map +0 -1
  341. package/dialog/esm2015/lib/dialog.component.js +0 -18
  342. package/dialog/esm2015/lib/koala.dialog.module.js +0 -25
  343. package/dialog/esm2015/lib/koala.dialog.service.js +0 -61
  344. package/dialog/fesm2015/koalarx-ui-dialog.js +0 -107
  345. package/dialog/fesm2015/koalarx-ui-dialog.js.map +0 -1
  346. package/dialog/koalarx-ui-dialog.metadata.json +0 -1
  347. package/dynamic-component/bundles/koalarx-ui-dynamic-component.umd.js +0 -95
  348. package/dynamic-component/bundles/koalarx-ui-dynamic-component.umd.js.map +0 -1
  349. package/dynamic-component/esm2015/lib/koala-dynamic-component.directive.js +0 -15
  350. package/dynamic-component/esm2015/lib/koala-dynamic-component.factory.js +0 -38
  351. package/dynamic-component/esm2015/lib/koala-dynamic-component.module.js +0 -17
  352. package/dynamic-component/fesm2015/koalarx-ui-dynamic-component.js +0 -79
  353. package/dynamic-component/fesm2015/koalarx-ui-dynamic-component.js.map +0 -1
  354. package/dynamic-component/koalarx-ui-dynamic-component.metadata.json +0 -1
  355. package/file-button/bundles/koalarx-ui-file-button.umd.js +0 -553
  356. package/file-button/bundles/koalarx-ui-file-button.umd.js.map +0 -1
  357. package/file-button/esm2015/lib/file-button.component.js +0 -118
  358. package/file-button/esm2015/lib/koala.btn-file.service.js +0 -26
  359. package/file-button/esm2015/lib/koala.file-button.module.js +0 -25
  360. package/file-button/fesm2015/koalarx-ui-file-button.js +0 -171
  361. package/file-button/fesm2015/koalarx-ui-file-button.js.map +0 -1
  362. package/file-button/koalarx-ui-file-button.metadata.json +0 -1
  363. package/folder-page/bundles/koalarx-ui-folder-page.umd.js +0 -97
  364. package/folder-page/bundles/koalarx-ui-folder-page.umd.js.map +0 -1
  365. package/folder-page/esm2015/lib/folder.component.js +0 -56
  366. package/folder-page/esm2015/lib/koala.folder-page.module.js +0 -27
  367. package/folder-page/fesm2015/koalarx-ui-folder-page.js +0 -88
  368. package/folder-page/fesm2015/koalarx-ui-folder-page.js.map +0 -1
  369. package/folder-page/koalarx-ui-folder-page.metadata.json +0 -1
  370. package/form/bundles/koalarx-ui-form.umd.js +0 -1944
  371. package/form/bundles/koalarx-ui-form.umd.js.map +0 -1
  372. package/form/esm2015/lib/btn-submit/btn-submit.component.js +0 -39
  373. package/form/esm2015/lib/directives/koala-autofocus.directive.js +0 -25
  374. package/form/esm2015/lib/dynamic-form/builder/dynamic-form.builder.js +0 -141
  375. package/form/esm2015/lib/dynamic-form/builder/fields/field.base.js +0 -150
  376. package/form/esm2015/lib/dynamic-form/builder/fields/more-items.builder.js +0 -57
  377. package/form/esm2015/lib/dynamic-form/dynamic-form.component.js +0 -551
  378. package/form/esm2015/lib/dynamic-form/koala.dynamic-form.service.js +0 -204
  379. package/form/esm2015/lib/koala.form.module.js +0 -69
  380. package/form/fesm2015/koalarx-ui-form.js +0 -1473
  381. package/form/fesm2015/koalarx-ui-form.js.map +0 -1
  382. package/form/koalarx-ui-form.metadata.json +0 -1
  383. package/icon/bundles/koalarx-ui-icon.umd.js +0 -76
  384. package/icon/bundles/koalarx-ui-icon.umd.js.map +0 -1
  385. package/icon/esm2015/lib/koala.icon.module.js +0 -19
  386. package/icon/fesm2015/koalarx-ui-icon.js.map +0 -1
  387. package/icon/koalarx-ui-icon.metadata.json +0 -1
  388. package/icons-animated/bundles/koalarx-ui-icons-animated.umd.js +0 -138
  389. package/icons-animated/bundles/koalarx-ui-icons-animated.umd.js.map +0 -1
  390. package/icons-animated/esm2015/koalarx-ui-icons-animated.js +0 -6
  391. package/icons-animated/esm2015/lib/icons/downloading/downloading-icon-animated.component.js +0 -28
  392. package/icons-animated/esm2015/lib/icons/loading/loading-icon-animated.component.js +0 -28
  393. package/icons-animated/esm2015/lib/icons-animated.component.js +0 -15
  394. package/icons-animated/esm2015/lib/icons-animated.service.js +0 -29
  395. package/icons-animated/esm2015/lib/koala-icons-animated.module.js +0 -23
  396. package/icons-animated/fesm2015/koalarx-ui-icons-animated.js +0 -121
  397. package/icons-animated/fesm2015/koalarx-ui-icons-animated.js.map +0 -1
  398. package/icons-animated/koalarx-ui-icons-animated.metadata.json +0 -1
  399. package/list/bundles/koalarx-ui-list.umd.js +0 -914
  400. package/list/bundles/koalarx-ui-list.umd.js.map +0 -1
  401. package/list/esm2015/lib/koala.list.module.js +0 -42
  402. package/list/esm2015/lib/koala.list.service.js +0 -13
  403. package/list/esm2015/lib/list-builder/list.builder.js +0 -101
  404. package/list/esm2015/lib/list.abstract.js +0 -174
  405. package/list/esm2015/lib/list.component.js +0 -166
  406. package/list/esm2015/lib/providers/pagination/pagination.provider.js +0 -30
  407. package/list/fesm2015/koalarx-ui-list.js +0 -514
  408. package/list/fesm2015/koalarx-ui-list.js.map +0 -1
  409. package/list/koalarx-ui-list.metadata.json +0 -1
  410. package/menu/bundles/koalarx-ui-menu.umd.js +0 -511
  411. package/menu/bundles/koalarx-ui-menu.umd.js.map +0 -1
  412. package/menu/esm2015/lib/koala.menu.module.js +0 -25
  413. package/menu/esm2015/lib/koala.menu.service.js +0 -22
  414. package/menu/esm2015/lib/menu.component.js +0 -104
  415. package/menu/fesm2015/koalarx-ui-menu.js +0 -153
  416. package/menu/fesm2015/koalarx-ui-menu.js.map +0 -1
  417. package/menu/koalarx-ui-menu.metadata.json +0 -1
  418. package/question/bundles/koalarx-ui-question.umd.js +0 -104
  419. package/question/bundles/koalarx-ui-question.umd.js.map +0 -1
  420. package/question/esm2015/lib/dialog-question.component.js +0 -20
  421. package/question/esm2015/lib/koala.question.module.js +0 -27
  422. package/question/esm2015/lib/koala.question.service.js +0 -28
  423. package/question/fesm2015/koalarx-ui-question.js +0 -77
  424. package/question/fesm2015/koalarx-ui-question.js.map +0 -1
  425. package/question/koalarx-ui-question.metadata.json +0 -1
  426. package/snackbar/bundles/koalarx-ui-snackbar.umd.js +0 -93
  427. package/snackbar/bundles/koalarx-ui-snackbar.umd.js.map +0 -1
  428. package/snackbar/esm2015/lib/koala.snackbar.component.js +0 -20
  429. package/snackbar/esm2015/lib/koala.snackbar.module.js +0 -26
  430. package/snackbar/esm2015/lib/koala.snackbar.service.js +0 -35
  431. package/snackbar/fesm2015/koalarx-ui-snackbar.js +0 -81
  432. package/snackbar/fesm2015/koalarx-ui-snackbar.js.map +0 -1
  433. package/snackbar/koalarx-ui-snackbar.metadata.json +0 -1
@@ -0,0 +1,1575 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, Input, Injectable, Directive, ChangeDetectionStrategy, ViewChild, NgModule } from '@angular/core';
3
+ import { BehaviorSubject, Observable } from 'rxjs';
4
+ import { KoalaLanguageHelper } from '@koalarx/ui/core';
5
+ import * as i1 from '@angular/material/button';
6
+ import { MatButtonModule } from '@angular/material/button';
7
+ import * as i2 from '@angular/material/progress-spinner';
8
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
9
+ import * as i3 from '@angular/material/icon';
10
+ import { MatIconModule } from '@angular/material/icon';
11
+ import * as i16 from '@angular/common';
12
+ import { CommonModule } from '@angular/common';
13
+ import * as i1$1 from '@angular/forms';
14
+ import { Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
15
+ import { koala } from '@koalarx/utils';
16
+ import { unmaskCoin } from '@koalarx/utils/operators/string';
17
+ import * as i2$1 from 'ngx-device-detector';
18
+ import { __awaiter } from 'tslib';
19
+ import { debounceTime } from 'rxjs/operators';
20
+ import { delay } from '@koalarx/utils/operators/delay';
21
+ import * as i3$1 from '@angular/material/form-field';
22
+ import * as i6 from '@angular/material/select';
23
+ import { MatSelectModule } from '@angular/material/select';
24
+ import * as i7 from '@angular/material/core';
25
+ import * as i8 from '@angular/material/checkbox';
26
+ import { MatCheckboxModule } from '@angular/material/checkbox';
27
+ import * as i9 from '@koalarx/ui/button';
28
+ import { KoalaButtonModule } from '@koalarx/ui/button';
29
+ import * as i10 from '@angular/material/expansion';
30
+ import { MatExpansionModule } from '@angular/material/expansion';
31
+ import * as i11 from '@angular/material/chips';
32
+ import { MatChipsModule } from '@angular/material/chips';
33
+ import * as i13 from '@angular/material/autocomplete';
34
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
35
+ import * as i14 from '@koalarx/ui/file-button';
36
+ import { KoalaFileButtonModule } from '@koalarx/ui/file-button';
37
+ import * as i15 from '@angular/material/radio';
38
+ import { MatRadioModule } from '@angular/material/radio';
39
+ import * as i17 from '@angular/material/input';
40
+ import { MatInputModule } from '@angular/material/input';
41
+ import * as i18 from 'ngx-mask';
42
+ import { NgxMaskModule } from 'ngx-mask';
43
+ import * as i20 from 'ng2-currency-mask';
44
+ import { CurrencyMaskModule } from 'ng2-currency-mask';
45
+ import * as i21 from '@angular/cdk/text-field';
46
+ import { maskOptions } from '@koalarx/ui/common';
47
+
48
+ class BtnSubmitComponent {
49
+ constructor() {
50
+ this.color = 'primary';
51
+ this.btnLabel = KoalaLanguageHelper.getBtnLabel();
52
+ this.btnSubmitDisabled = false;
53
+ this.disabled = new BehaviorSubject(false);
54
+ }
55
+ ngOnInit() {
56
+ if (!this.btnLabel) {
57
+ this.btnLabel = KoalaLanguageHelper.getBtnLabel();
58
+ }
59
+ }
60
+ ngOnChanges(changes) {
61
+ if (changes.btnSubmitDisabled) {
62
+ this.disabled.next(changes.btnSubmitDisabled.currentValue);
63
+ }
64
+ }
65
+ }
66
+ BtnSubmitComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: BtnSubmitComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
67
+ BtnSubmitComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: BtnSubmitComponent, selector: "koala-submit", inputs: { fg: "fg", color: "color", btnLabel: "btnLabel", btnSubmitDisabled: "btnSubmitDisabled", loader: "loader", iconButton: "iconButton", icon: "icon", iconColor: "iconColor" }, usesOnChanges: true, ngImport: i0, 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", 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"], components: [{ type: i1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2.MatSpinner, selector: "mat-spinner", inputs: ["color"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i16.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i16.AsyncPipe } });
68
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: BtnSubmitComponent, decorators: [{
69
+ type: Component,
70
+ args: [{ selector: 'koala-submit', 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", 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"] }]
71
+ }], propDecorators: { fg: [{
72
+ type: Input
73
+ }], color: [{
74
+ type: Input
75
+ }], btnLabel: [{
76
+ type: Input
77
+ }], btnSubmitDisabled: [{
78
+ type: Input
79
+ }], loader: [{
80
+ type: Input
81
+ }], iconButton: [{
82
+ type: Input
83
+ }], icon: [{
84
+ type: Input
85
+ }], iconColor: [{
86
+ type: Input
87
+ }] } });
88
+
89
+ var DynamicFormTypeFieldEnum;
90
+ (function (DynamicFormTypeFieldEnum) {
91
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["text"] = 1] = "text";
92
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["password"] = 2] = "password";
93
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["cpf"] = 3] = "cpf";
94
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["cnpj"] = 4] = "cnpj";
95
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["datetime"] = 5] = "datetime";
96
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["email"] = 6] = "email";
97
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["phone"] = 7] = "phone";
98
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["number"] = 8] = "number";
99
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["valueList"] = 9] = "valueList";
100
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["textarea"] = 10] = "textarea";
101
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["time"] = 11] = "time";
102
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["hoursAndMinutes"] = 12] = "hoursAndMinutes";
103
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["checkbox"] = 13] = "checkbox";
104
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["select"] = 14] = "select";
105
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["coin"] = 15] = "coin";
106
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["percent"] = 16] = "percent";
107
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["moreItems"] = 17] = "moreItems";
108
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["id"] = 18] = "id";
109
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["textLogs"] = 19] = "textLogs";
110
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["file"] = 20] = "file";
111
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["autocomplete"] = 21] = "autocomplete";
112
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["color"] = 22] = "color";
113
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["dynamicForm"] = 23] = "dynamicForm";
114
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["date"] = 24] = "date";
115
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["radio"] = 25] = "radio";
116
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["float"] = 26] = "float";
117
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["stringNumber"] = 27] = "stringNumber";
118
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["selectMultipleNative"] = 28] = "selectMultipleNative";
119
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["month"] = 29] = "month";
120
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["competenceDate"] = 30] = "competenceDate";
121
+ DynamicFormTypeFieldEnum[DynamicFormTypeFieldEnum["stringWithCustomMasc"] = 31] = "stringWithCustomMasc";
122
+ })(DynamicFormTypeFieldEnum || (DynamicFormTypeFieldEnum = {}));
123
+
124
+ class FieldBase {
125
+ constructor(label, name, type, formConfig, fb, deviceService) {
126
+ this.formConfig = formConfig;
127
+ this.fb = fb;
128
+ this.deviceService = deviceService;
129
+ this.fieldConfig = {
130
+ label,
131
+ name,
132
+ type
133
+ };
134
+ this.appearance().grid();
135
+ }
136
+ hide(hide = true) {
137
+ this.fieldConfig.show = !hide;
138
+ return this;
139
+ }
140
+ focus() {
141
+ this.fieldConfig.focus = true;
142
+ return this;
143
+ }
144
+ syncValidator(validators) {
145
+ this.fieldConfig.syncValidators = validators;
146
+ return this;
147
+ }
148
+ asyncValidator(validators) {
149
+ this.fieldConfig.asyncValidators = validators;
150
+ return this;
151
+ }
152
+ disabled(disabled = true) {
153
+ this.fieldConfig.disabled = disabled;
154
+ return this;
155
+ }
156
+ required(required = true) {
157
+ this.fieldConfig.required = required;
158
+ return this;
159
+ }
160
+ textHint(hint) {
161
+ this.fieldConfig.textHint = hint;
162
+ return this;
163
+ }
164
+ min(min) {
165
+ this.fieldConfig.min = min;
166
+ return this;
167
+ }
168
+ max(max) {
169
+ this.fieldConfig.max = max;
170
+ return this;
171
+ }
172
+ minLength(min) {
173
+ this.fieldConfig.minLength = min;
174
+ return this;
175
+ }
176
+ maxLength(max) {
177
+ this.fieldConfig.maxLength = max;
178
+ return this;
179
+ }
180
+ multiple(multiple = true) {
181
+ this.fieldConfig.multiple = multiple;
182
+ return this;
183
+ }
184
+ valueChanges(fn) {
185
+ this.fieldConfig.valueChanges = fn;
186
+ return this;
187
+ }
188
+ setValue(value) {
189
+ this.fieldConfig.value = value;
190
+ return this;
191
+ }
192
+ appearance(type = "outline", floatLabel = "always") {
193
+ this.fieldConfig.appearance = type;
194
+ this.fieldConfig.floatLabel = floatLabel;
195
+ return this;
196
+ }
197
+ grid(size = 12, width = 100) {
198
+ var _a;
199
+ if (this.deviceService.isMobile()) {
200
+ size = 12;
201
+ }
202
+ for (let colSize = 12; colSize >= 1; colSize--) {
203
+ this.fieldConfig.class = (_a = this.fieldConfig.class) === null || _a === void 0 ? void 0 : _a.replace('col-' + colSize, '');
204
+ }
205
+ this.addClass('col-' + size);
206
+ this.addFieldClass('w-' + width);
207
+ return this;
208
+ }
209
+ setOptions(options) {
210
+ this.fieldConfig.opcoesSelect = options;
211
+ return this;
212
+ }
213
+ addClass(className) {
214
+ var _a, _b;
215
+ if (this.deviceService.isMobile() &&
216
+ className.indexOf('col-') >= 0 &&
217
+ className.indexOf('col-12') === 0) {
218
+ className = className.replace('col-1', 'col-12')
219
+ .replace('col-2', 'col-12')
220
+ .replace('col-3', 'col-12')
221
+ .replace('col-4', 'col-12')
222
+ .replace('col-5', 'col-12')
223
+ .replace('col-6', 'col-12')
224
+ .replace('col-7', 'col-12')
225
+ .replace('col-8', 'col-12')
226
+ .replace('col-9', 'col-12')
227
+ .replace('col-10', 'col-12')
228
+ .replace('col-11', 'col-12');
229
+ }
230
+ this.fieldConfig.class = koala(`${(_b = (_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.class) !== null && _b !== void 0 ? _b : ''} ${className}`)
231
+ .string()
232
+ .split(' ')
233
+ .clearEmptyValues()
234
+ .toString(' ')
235
+ .getValue();
236
+ return this;
237
+ }
238
+ addFieldClass(className) {
239
+ var _a, _b;
240
+ this.fieldConfig.fieldClass = koala(`${(_b = (_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.fieldClass) !== null && _b !== void 0 ? _b : ''} ${className}`)
241
+ .string()
242
+ .split(' ')
243
+ .clearEmptyValues()
244
+ .toString(' ')
245
+ .getValue();
246
+ return this;
247
+ }
248
+ setCustomMasc(mask, config) {
249
+ this.fieldConfig.customMasc = mask;
250
+ this.fieldConfig.customMascThousandSeparator = config === null || config === void 0 ? void 0 : config.thousandSeparator;
251
+ this.fieldConfig.customMascSuffix = config === null || config === void 0 ? void 0 : config.suffix;
252
+ this.fieldConfig.customMascPrefix = config === null || config === void 0 ? void 0 : config.prefix;
253
+ return this;
254
+ }
255
+ generate() {
256
+ let getLastConfig = (this.formConfig.formConfig.length > 0) ?
257
+ this.formConfig.formConfig[this.formConfig.formConfig.length - 1] :
258
+ null;
259
+ if ((getLastConfig === null || getLastConfig === void 0 ? void 0 : getLastConfig.type) === DynamicFormTypeFieldEnum.moreItems && (getLastConfig === null || getLastConfig === void 0 ? void 0 : getLastConfig.name) !== 'endMoreItems') {
260
+ this.formConfig.formConfig[this.formConfig.formConfig.length - 1].moreItemsConfig.formConfig.push(this.fieldConfig);
261
+ }
262
+ else {
263
+ if ((getLastConfig === null || getLastConfig === void 0 ? void 0 : getLastConfig.name) === 'endMoreItems') {
264
+ this.formConfig.formConfig.splice(this.formConfig.formConfig.length - 1, 1);
265
+ }
266
+ this.formConfig.formConfig.push(this.fieldConfig);
267
+ }
268
+ return new DynamicFormBuilder(this.fb, this.deviceService, this.formConfig.formConfig);
269
+ }
270
+ }
271
+
272
+ class AutocompleteBuilder extends FieldBase {
273
+ constructor(label, name, formConfig, fb, deviceService) {
274
+ super(label, name, DynamicFormTypeFieldEnum.autocomplete, formConfig, fb, deviceService);
275
+ }
276
+ service(service) {
277
+ this.service$ = service;
278
+ return this;
279
+ }
280
+ defaultValueOnClean(value) {
281
+ this.fieldConfig.autocompleteDefaultValueOnClear = value;
282
+ return this;
283
+ }
284
+ loadOptions(type, onDemandFilter) {
285
+ this.fieldConfig.autocompleteType = type;
286
+ if (type === "all") {
287
+ const options$ = new BehaviorSubject([]);
288
+ this.service$.subscribe(options => options$.next(options));
289
+ this.fieldConfig.autocompleteOptions = options$;
290
+ }
291
+ else {
292
+ this.fieldConfig.autocompleteFilter = onDemandFilter;
293
+ }
294
+ return this;
295
+ }
296
+ colorChipConfig(fn) {
297
+ this.fieldConfig.autocompleteMultipleConfig = new BehaviorSubject(null);
298
+ fn(this.fieldConfig.autocompleteMultipleConfig);
299
+ return this;
300
+ }
301
+ }
302
+
303
+ class FieldBuilder extends FieldBase {
304
+ constructor(label, name, type, formConfig, fb, deviceService) {
305
+ super(label, name, type, formConfig, fb, deviceService);
306
+ }
307
+ }
308
+
309
+ class MoreItemsBuilder {
310
+ constructor(label, name, btnAddLabel, min, max, formConfig, fb, deviceService) {
311
+ this.label = label;
312
+ this.name = name;
313
+ this.btnAddLabel = btnAddLabel;
314
+ this.min = min;
315
+ this.max = max;
316
+ this.formConfig = formConfig;
317
+ this.fb = fb;
318
+ this.deviceService = deviceService;
319
+ }
320
+ build() {
321
+ let getLastConfig = (this.formConfig.formConfig.length > 0) ?
322
+ this.formConfig.formConfig[this.formConfig.formConfig.length - 1] :
323
+ null;
324
+ this.fieldConfig = {
325
+ label: this.label,
326
+ name: this.name,
327
+ type: DynamicFormTypeFieldEnum.moreItems,
328
+ moreItemsIconBackgroundColor: '#fff',
329
+ moreItemsIconFontColor: '#212121',
330
+ moreItemsMinItems: this.min,
331
+ moreItemsMaxItems: this.max,
332
+ moreItemsButtonIconAddlabel: this.btnAddLabel,
333
+ moreItemsConfig: {
334
+ form: this.fb.group({}),
335
+ formConfig: [],
336
+ setValues: new BehaviorSubject([])
337
+ }
338
+ };
339
+ if ((getLastConfig === null || getLastConfig === void 0 ? void 0 : getLastConfig.type) === DynamicFormTypeFieldEnum.moreItems && (getLastConfig === null || getLastConfig === void 0 ? void 0 : getLastConfig.name) !== 'endMoreItems') {
340
+ let formConfigMoreItems = getLastConfig.moreItemsConfig.formConfig;
341
+ if (formConfigMoreItems.length > 0) {
342
+ let lastIndexMoreItems = 0;
343
+ formConfigMoreItems.forEach((item, index) => {
344
+ if (item.type === DynamicFormTypeFieldEnum.moreItems)
345
+ lastIndexMoreItems = index;
346
+ });
347
+ formConfigMoreItems[lastIndexMoreItems].moreItemsConfig.formConfig.push(this.fieldConfig);
348
+ }
349
+ else {
350
+ this.formConfig.formConfig[this.formConfig.formConfig.length - 1].moreItemsConfig.formConfig.push(this.fieldConfig);
351
+ }
352
+ }
353
+ else {
354
+ if ((getLastConfig === null || getLastConfig === void 0 ? void 0 : getLastConfig.name) === 'endMoreItems') {
355
+ this.formConfig.formConfig.splice(this.formConfig.formConfig.length - 1, 1);
356
+ }
357
+ this.formConfig.formConfig.push(this.fieldConfig);
358
+ }
359
+ return new DynamicFormBuilder(this.fb, this.deviceService, this.formConfig.formConfig);
360
+ }
361
+ }
362
+
363
+ class DynamicFormBuilder {
364
+ constructor(fb, deviceService, configInMemory) {
365
+ this.fb = fb;
366
+ this.deviceService = deviceService;
367
+ this.config = {
368
+ form: fb.group({}),
369
+ formConfig: configInMemory !== null && configInMemory !== void 0 ? configInMemory : [],
370
+ setValues: new BehaviorSubject(null),
371
+ showFields: new BehaviorSubject(null)
372
+ };
373
+ }
374
+ field(label, name, type) {
375
+ switch (type) {
376
+ case "id":
377
+ case "text":
378
+ case "textarea":
379
+ case "number":
380
+ case "stringNumber":
381
+ case "cnpj":
382
+ case "cpf":
383
+ case "coin":
384
+ case "color":
385
+ case "date":
386
+ case "datetime":
387
+ case "email":
388
+ case "float":
389
+ case "password":
390
+ case "percent":
391
+ case "phone":
392
+ case "time":
393
+ case "hoursAndMinutes":
394
+ case "textLogs":
395
+ case "valueList":
396
+ case "checkbox":
397
+ case "radio":
398
+ case "select":
399
+ case "selectMultipleNative":
400
+ case "month":
401
+ case "competenceDate":
402
+ case "stringWithCustomMasc":
403
+ return new FieldBuilder(label, name, DynamicFormTypeFieldEnum[type], this.config, this.fb, this.deviceService);
404
+ }
405
+ }
406
+ autocomplete(label, name) {
407
+ return new AutocompleteBuilder(label, name, this.config, this.fb, this.deviceService);
408
+ }
409
+ simpleMoreItems(label, name, btnAddLabel, min, max) {
410
+ return new MoreItemsBuilder(label, name, btnAddLabel, min, max, this.config, this.fb, this.deviceService);
411
+ }
412
+ autofill(object) {
413
+ var _a, _b;
414
+ if (object) {
415
+ const setValues = [];
416
+ Object.keys(object).forEach(indexName => {
417
+ var _a, _b, _c, _d, _e;
418
+ const arrField = koala(this.config.formConfig).array().filter(indexName, 'name', { comparator: "=" }).getValue();
419
+ if (arrField.length === 1) {
420
+ const field = (_a = arrField[0]) !== null && _a !== void 0 ? _a : null;
421
+ if (typeof object[indexName] !== "object" ||
422
+ field.type === DynamicFormTypeFieldEnum.autocomplete ||
423
+ field.type === DynamicFormTypeFieldEnum.selectMultipleNative) {
424
+ if (field.type === DynamicFormTypeFieldEnum.textLogs) {
425
+ field.textObs = object[indexName];
426
+ }
427
+ else {
428
+ setValues.push({
429
+ name: indexName,
430
+ value: object[indexName]
431
+ });
432
+ }
433
+ }
434
+ else {
435
+ if (field.type === DynamicFormTypeFieldEnum.moreItems) {
436
+ const setValuesMoreItems = [];
437
+ const objectMoreItems = object[indexName];
438
+ objectMoreItems.forEach(objectItem => {
439
+ const moreItemValues = [];
440
+ Object.keys(objectItem).forEach(objectIndexName => {
441
+ moreItemValues.push({
442
+ name: objectIndexName,
443
+ value: objectItem[objectIndexName]
444
+ });
445
+ });
446
+ setValuesMoreItems.push(new BehaviorSubject(moreItemValues));
447
+ });
448
+ (_c = (_b = field.moreItemsConfig) === null || _b === void 0 ? void 0 : _b.setValues) === null || _c === void 0 ? void 0 : _c.next(setValuesMoreItems);
449
+ }
450
+ else if (field.type === DynamicFormTypeFieldEnum.dynamicForm) {
451
+ const dynamicFormObject = object[indexName];
452
+ const dynamicFormSetValues = [];
453
+ Object.keys(dynamicFormObject).forEach(dynamicFormIndexName => {
454
+ var _a;
455
+ const arrDynamicField = koala(field.dynamicFormConfig.formConfig).array().filter(indexName, 'name').getValue();
456
+ const dynamicField = (_a = arrDynamicField[0]) !== null && _a !== void 0 ? _a : null;
457
+ if ((dynamicField === null || dynamicField === void 0 ? void 0 : dynamicField.type) === DynamicFormTypeFieldEnum.textLogs) {
458
+ dynamicField.textObs = object[indexName];
459
+ }
460
+ else {
461
+ dynamicFormSetValues.push({
462
+ name: dynamicFormIndexName,
463
+ value: dynamicFormObject[dynamicFormIndexName]
464
+ });
465
+ }
466
+ });
467
+ (_e = (_d = field.dynamicFormConfig) === null || _d === void 0 ? void 0 : _d.setValues) === null || _e === void 0 ? void 0 : _e.next(dynamicFormSetValues);
468
+ }
469
+ else {
470
+ this.autofill(object[indexName]);
471
+ }
472
+ }
473
+ }
474
+ });
475
+ (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.setValues) === null || _b === void 0 ? void 0 : _b.next(setValues);
476
+ }
477
+ return this;
478
+ }
479
+ literalConfig(config) {
480
+ this.config.formConfig.push(config);
481
+ if (config.type === DynamicFormTypeFieldEnum.moreItems)
482
+ this.generateMoreItems();
483
+ return this;
484
+ }
485
+ generate() {
486
+ this.config.formConfig = this.config.formConfig.filter(config => config.name !== 'endMoreItems');
487
+ return this.config;
488
+ }
489
+ generateMoreItems() {
490
+ this.config.formConfig.push({
491
+ name: 'endMoreItems',
492
+ type: DynamicFormTypeFieldEnum.moreItems
493
+ });
494
+ return new DynamicFormBuilder(this.fb, this.deviceService, this.config.formConfig);
495
+ }
496
+ }
497
+
498
+ function DateMinValidator(min) {
499
+ return (control) => {
500
+ if (control.value && typeof min === 'string') {
501
+ if (new Date(control.value) < new Date(min)) {
502
+ return { dateMin: true };
503
+ }
504
+ }
505
+ return null;
506
+ };
507
+ }
508
+
509
+ function DateMaxValidator(max) {
510
+ return (control) => {
511
+ if (control.value && typeof max === 'string') {
512
+ if (new Date(control.value) > new Date(max)) {
513
+ return { dateMax: true };
514
+ }
515
+ }
516
+ return null;
517
+ };
518
+ }
519
+
520
+ class KoalaDynamicFormService {
521
+ constructor(fb, deviceService) {
522
+ this.fb = fb;
523
+ this.deviceService = deviceService;
524
+ }
525
+ build() {
526
+ return new DynamicFormBuilder(this.fb, this.deviceService);
527
+ }
528
+ updateValidator(formGroup, name, type, value) {
529
+ if (type === 'required' && typeof value !== 'boolean') {
530
+ throw new Error(`Type required cannot be a ${typeof value}`);
531
+ }
532
+ else if ((type === 'min' || type === 'max') && typeof value === "boolean") {
533
+ throw new Error(`Type ${type} cannot be a boolean`);
534
+ }
535
+ const formArray = formGroup.get('formData');
536
+ const control = formArray.controls.find(control => control.get('name').value === name);
537
+ if (control) {
538
+ const currentRequired = control.get('required').value;
539
+ const currentMin = control.get('min').value;
540
+ const currentMax = control.get('max').value;
541
+ const validators = [];
542
+ control.get('value').clearValidators();
543
+ control.get('value').setErrors(null);
544
+ if ((type === "required" && value) || currentRequired) {
545
+ validators.push(Validators.required);
546
+ control.get('value').setErrors({ required: true });
547
+ }
548
+ if ((type === "min" || currentMin)) {
549
+ if (typeof value === "number") {
550
+ validators.push(Validators.min((type === "min" ? value : currentMin)));
551
+ control.get('value').setErrors({ min: true });
552
+ }
553
+ else if (typeof value === "string") {
554
+ validators.push(DateMinValidator((type === "min" ? value : currentMin)));
555
+ control.get('value').setErrors({ dateMin: true });
556
+ }
557
+ }
558
+ if ((type === "max" || currentMax)) {
559
+ if (typeof value === "number") {
560
+ validators.push(Validators.max((type === "max" ? value : currentMax)));
561
+ control.get('value').setErrors({ max: true });
562
+ }
563
+ else if (typeof value === "string") {
564
+ validators.push(DateMaxValidator((type === "max" ? value : currentMax)));
565
+ control.get('value').setErrors({ dateMax: true });
566
+ }
567
+ }
568
+ if (type === "required") {
569
+ control.get('required').setValue(value);
570
+ }
571
+ else if (type === "min") {
572
+ control.get('min').setValue(value);
573
+ }
574
+ else if (type === "max") {
575
+ control.get('max').setValue(value);
576
+ }
577
+ control.get('value').setValidators(validators);
578
+ control.get('value').updateValueAndValidity();
579
+ }
580
+ }
581
+ emitData(form) {
582
+ const data = {};
583
+ const formArray = form.get('formData');
584
+ formArray === null || formArray === void 0 ? void 0 : formArray.controls.forEach(control => {
585
+ var _a;
586
+ if (control.get('show').value.getValue() !== false) {
587
+ let value = control.get('value').value;
588
+ if (control.get('type').value === DynamicFormTypeFieldEnum.valueList) {
589
+ if (value === null || value === undefined) {
590
+ value = '';
591
+ }
592
+ value = koala(value).string().split().getValue();
593
+ }
594
+ else if (control.get('type').value === DynamicFormTypeFieldEnum.moreItems) {
595
+ const moreItems = control.get('moreItemsConfig').value;
596
+ value = [];
597
+ moreItems.forEach(item => {
598
+ value.push(this.emitData(item.form));
599
+ });
600
+ }
601
+ else if (control.get('type').value === DynamicFormTypeFieldEnum.autocomplete) {
602
+ if (control.get('multiple').value) {
603
+ const options = control.get('autocompleteSelectedValue').value;
604
+ value = options === null || options === void 0 ? void 0 : options.map(item => item === null || item === void 0 ? void 0 : item.value);
605
+ }
606
+ else {
607
+ value = (((_a = control.get('autocompleteSelectedValue').value) === null || _a === void 0 ? void 0 : _a.value) ?
608
+ control.get('autocompleteSelectedValue').value.value :
609
+ control.get('autocompleteSelectedValue').value);
610
+ }
611
+ }
612
+ else if (control.get('type').value === DynamicFormTypeFieldEnum.dynamicForm) {
613
+ const dynamicFormConfig = control.get('dynamicFormConfig').value;
614
+ value = this.emitData(dynamicFormConfig.getValue().form);
615
+ }
616
+ else if (control.get('type').value === DynamicFormTypeFieldEnum.number) {
617
+ value = parseInt(value);
618
+ }
619
+ else if ((control.get('type').value === DynamicFormTypeFieldEnum.float ||
620
+ control.get('type').value === DynamicFormTypeFieldEnum.percent) && typeof value === "string") {
621
+ value = parseFloat(value.replace(/,/g, '.'));
622
+ }
623
+ else if (control.get('type').value === DynamicFormTypeFieldEnum.coin &&
624
+ typeof value === "string") {
625
+ value = unmaskCoin(value);
626
+ }
627
+ data[control.get('name').value] = value;
628
+ }
629
+ });
630
+ return data;
631
+ }
632
+ resetForm(form) {
633
+ const formArray = form.get('formData');
634
+ formArray.controls.forEach(control => {
635
+ if (control.get('type').value === DynamicFormTypeFieldEnum.moreItems) {
636
+ control.get('moreItemsConfig').setValue([]);
637
+ }
638
+ else {
639
+ control.get('value').reset();
640
+ }
641
+ });
642
+ }
643
+ setValuesInMoreItemsForm(subject, values) {
644
+ const valuesMoreItems = [];
645
+ values.forEach(itemValue => {
646
+ valuesMoreItems.push(new BehaviorSubject(itemValue));
647
+ });
648
+ subject.next(valuesMoreItems);
649
+ }
650
+ autocompleteFilterOnServer(request, nameConfig, indexNameByValue) {
651
+ return new Observable(observe => {
652
+ request().then(response => {
653
+ const options = [];
654
+ response.forEach(item => {
655
+ var _a;
656
+ let value = '';
657
+ if ((indexNameByValue === null || indexNameByValue === void 0 ? void 0 : indexNameByValue.indexOf(' > ')) >= 0) {
658
+ value = this.getValueByStringPath(indexNameByValue, item);
659
+ }
660
+ else if (indexNameByValue) {
661
+ value = item[indexNameByValue];
662
+ }
663
+ else {
664
+ value = item;
665
+ }
666
+ options.push({
667
+ name: koala(item).object().toString(nameConfig.propsByName, ((_a = nameConfig.delimiter) !== null && _a !== void 0 ? _a : ' ')).getValue(),
668
+ value
669
+ });
670
+ });
671
+ observe.next(options);
672
+ });
673
+ });
674
+ }
675
+ showFields(subject, names, show, clearCurrentValue = false) {
676
+ const fields = [];
677
+ names.forEach(name => {
678
+ fields.push({
679
+ name,
680
+ show,
681
+ clearCurrentValue
682
+ });
683
+ });
684
+ subject.next(fields);
685
+ }
686
+ getValueByStringPath(indexNameByValue, item) {
687
+ let value;
688
+ const partsIndex = indexNameByValue.split(' > ');
689
+ let partIndex = 0;
690
+ do {
691
+ if (!value) {
692
+ value = item[partsIndex[partIndex]];
693
+ }
694
+ else {
695
+ value = value[partsIndex[partIndex]];
696
+ }
697
+ partIndex++;
698
+ } while (partIndex < partsIndex.length);
699
+ return value;
700
+ }
701
+ }
702
+ KoalaDynamicFormService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaDynamicFormService, deps: [{ token: i1$1.FormBuilder }, { token: i2$1.DeviceDetectorService }], target: i0.ɵɵFactoryTarget.Injectable });
703
+ KoalaDynamicFormService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaDynamicFormService, providedIn: "any" });
704
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaDynamicFormService, decorators: [{
705
+ type: Injectable,
706
+ args: [{ providedIn: "any" }]
707
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i2$1.DeviceDetectorService }]; } });
708
+
709
+ class ValidationHelper {
710
+ static validateCpf(value) {
711
+ function calcChecker1(digits) {
712
+ let sum = null;
713
+ for (let j = 0; j < 9; ++j) {
714
+ sum += digits.toString().charAt(j) * (10 - j);
715
+ }
716
+ const lastSumChecker1 = sum % 11;
717
+ return lastSumChecker1 < 2 ? 0 : 11 - lastSumChecker1;
718
+ }
719
+ function calcChecker2(cpfWithChecker1) {
720
+ let sum = null;
721
+ for (let k = 0; k < 10; ++k) {
722
+ sum += cpfWithChecker1.toString().charAt(k) * (11 - k);
723
+ }
724
+ const lastSumChecker2 = sum % 11;
725
+ return lastSumChecker2 < 2 ? 0 : 11 - lastSumChecker2;
726
+ }
727
+ const cleanCPF = value.replace(/\.|\-|\s/g, '');
728
+ const firstNineDigits = cleanCPF.substring(0, 9);
729
+ const checker = cleanCPF.substring(9, 11);
730
+ if (cleanCPF.length !== 11) {
731
+ return false;
732
+ }
733
+ // Checking if all digits are equal
734
+ for (let i = 0; i < 10; i++) {
735
+ if ('' + firstNineDigits + checker === Array(12).join(`${i}`)) {
736
+ return false;
737
+ }
738
+ }
739
+ const checker1 = calcChecker1(firstNineDigits);
740
+ const checker2 = calcChecker2(firstNineDigits + '' + checker1);
741
+ return checker.toString() === checker1.toString() + checker2.toString();
742
+ }
743
+ static validateCnpj(value) {
744
+ value = value.replace(/[^\d]+/g, '');
745
+ if (value === '') {
746
+ return false;
747
+ }
748
+ if (value.length !== 14) {
749
+ return false;
750
+ }
751
+ // Elimina CNPJs invalidos conhecidos
752
+ if (value === '00000000000000' ||
753
+ value === '11111111111111' ||
754
+ value === '22222222222222' ||
755
+ value === '33333333333333' ||
756
+ value === '44444444444444' ||
757
+ value === '55555555555555' ||
758
+ value === '66666666666666' ||
759
+ value === '77777777777777' ||
760
+ value === '88888888888888' ||
761
+ value === '99999999999999') {
762
+ return false;
763
+ }
764
+ // Valida DVs
765
+ let tamanho = value.length - 2;
766
+ let numeros = value.substring(0, tamanho);
767
+ const digitos = value.substring(tamanho);
768
+ let soma = 0;
769
+ let pos = tamanho - 7;
770
+ for (let i = tamanho; i >= 1; i--) {
771
+ soma += parseInt(numeros.charAt(tamanho - i), 10) * pos--;
772
+ if (pos < 2) {
773
+ pos = 9;
774
+ }
775
+ }
776
+ let resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
777
+ if (resultado !== parseInt(digitos.charAt(0), 10)) {
778
+ return false;
779
+ }
780
+ tamanho = tamanho + 1;
781
+ numeros = value.substring(0, tamanho);
782
+ soma = 0;
783
+ pos = tamanho - 7;
784
+ for (let i = tamanho; i >= 1; i--) {
785
+ soma += parseInt(numeros.charAt(tamanho - i), 10) * pos--;
786
+ if (pos < 2) {
787
+ pos = 9;
788
+ }
789
+ }
790
+ resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
791
+ return !(resultado !== parseInt(digitos.charAt(1), 10));
792
+ }
793
+ }
794
+
795
+ function CpfValidator(control) {
796
+ if (control.value) {
797
+ if (control.value.length <= 14 && !ValidationHelper.validateCpf(control.value)) {
798
+ return { cpfInvalid: true };
799
+ }
800
+ }
801
+ return null;
802
+ }
803
+
804
+ function CnpjValidator(control) {
805
+ if (control.value) {
806
+ if (control.value.length > 14 && !ValidationHelper.validateCnpj(control.value)) {
807
+ return { cnpjInvalid: true };
808
+ }
809
+ }
810
+ return null;
811
+ }
812
+
813
+ function AutocompleteSelectedValidator(control) {
814
+ if (control.value &&
815
+ control.value.hasOwnProperty('value') &&
816
+ control.value.hasOwnProperty('name') &&
817
+ Object.keys(control.value).length === 2) {
818
+ return null;
819
+ }
820
+ return { autocompleteSelected: true };
821
+ }
822
+
823
+ class KoalaDynamicFormValidatorResultHelper {
824
+ static generate(errorMessage) {
825
+ return {
826
+ customError: {
827
+ message: errorMessage
828
+ }
829
+ };
830
+ }
831
+ }
832
+
833
+ class ShowInvalidFields {
834
+ constructor() {
835
+ }
836
+ isErrorState(control, form) {
837
+ const isSubmitted = form && form.submitted;
838
+ return !!(control && control.invalid && (control.errors || control.dirty || control.touched || isSubmitted));
839
+ }
840
+ }
841
+
842
+ class FormAbstract {
843
+ constructor(formAbstract) {
844
+ this.formAbstract = formAbstract;
845
+ this.loader = new BehaviorSubject(false);
846
+ this.btnSubmitDisabled = false;
847
+ this.getData = new BehaviorSubject(false);
848
+ }
849
+ selecionarAutocomplete(controlName, obj, indexName) {
850
+ if (obj) {
851
+ let value = indexName ? obj[indexName] : obj;
852
+ if (Array.isArray(obj)) {
853
+ value = [];
854
+ obj.forEach(item => {
855
+ value.push(indexName ? item[indexName] : item);
856
+ });
857
+ }
858
+ this.formAbstract().get(controlName).setValue(value);
859
+ }
860
+ else {
861
+ this.formAbstract().get(controlName).setValue('');
862
+ }
863
+ }
864
+ btnClickGetData() {
865
+ this.getData.next(true);
866
+ }
867
+ enableShowInvalidFields() {
868
+ this.showInvalidFields = new ShowInvalidFields();
869
+ }
870
+ loading(show = true, btnLabel) {
871
+ this.btnSubmitDisabled = show;
872
+ this.loader.next(show);
873
+ if (show) {
874
+ this.btnLabel = btnLabel ? btnLabel : 'Enviando Dados...';
875
+ }
876
+ else {
877
+ this.btnLabel = btnLabel ? btnLabel : 'Enviar';
878
+ }
879
+ }
880
+ }
881
+
882
+ class KoalaAutofocusDirective {
883
+ constructor(el) {
884
+ this.el = el;
885
+ }
886
+ ngAfterContentInit() {
887
+ if (this.koalaAutoFocus) {
888
+ setTimeout(() => {
889
+ this.el.nativeElement.focus();
890
+ }, 500);
891
+ }
892
+ }
893
+ }
894
+ KoalaAutofocusDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaAutofocusDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
895
+ KoalaAutofocusDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.3", type: KoalaAutofocusDirective, selector: "[koalaAutoFocus]", inputs: { koalaAutoFocus: "koalaAutoFocus" }, ngImport: i0 });
896
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaAutofocusDirective, decorators: [{
897
+ type: Directive,
898
+ args: [{
899
+ selector: '[koalaAutoFocus]'
900
+ }]
901
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { koalaAutoFocus: [{
902
+ type: Input
903
+ }] } });
904
+
905
+ class DynamicFormComponent extends FormAbstract {
906
+ constructor(fb, dynamicFormService) {
907
+ super(() => this.form);
908
+ this.fb = fb;
909
+ this.dynamicFormService = dynamicFormService;
910
+ this.tabIndexStart = 1;
911
+ this.typeField = DynamicFormTypeFieldEnum;
912
+ this.hoursAndMinutesMask = '00:000';
913
+ this.errorMessage = KoalaLanguageHelper;
914
+ }
915
+ ngOnInit() {
916
+ var _a;
917
+ if (!this.form.get('formData')) {
918
+ this.form.addControl('formData', this.fb.array([]));
919
+ }
920
+ this.controls = this.form.get('formData');
921
+ (_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.forEach((config, indexConfig) => {
922
+ const newFormGroup = this.newControl(config);
923
+ if (config.asyncValidators) {
924
+ newFormGroup.get('value').setAsyncValidators(config.asyncValidators);
925
+ }
926
+ newFormGroup.get('value').updateValueAndValidity();
927
+ if (config.type === DynamicFormTypeFieldEnum.dynamicForm) {
928
+ const formGroupDynamicFormsSubject = newFormGroup.get('dynamicFormConfig').value;
929
+ formGroupDynamicFormsSubject.subscribe(formGroupConfig => {
930
+ if (formGroupConfig) {
931
+ formGroupConfig.form.valueChanges.subscribe(() => {
932
+ if (formGroupConfig.form.valid && (config.valueChanges || this.showFieldsMoreItensConfig)) {
933
+ const value = this.dynamicFormService.emitData(formGroupConfig.form);
934
+ newFormGroup.get('value').setValue(value);
935
+ }
936
+ });
937
+ }
938
+ });
939
+ }
940
+ if (config.valueChanges ||
941
+ config.type === DynamicFormTypeFieldEnum.autocomplete ||
942
+ config.type === DynamicFormTypeFieldEnum.dynamicForm ||
943
+ this.showFieldsMoreItensConfig) {
944
+ if (config.type === DynamicFormTypeFieldEnum.autocomplete) {
945
+ const autocompleteOptionsSubject = newFormGroup.get('autocompleteOptions').value;
946
+ if (autocompleteOptionsSubject) {
947
+ autocompleteOptionsSubject.subscribe(options => newFormGroup.get('autocompleteOptionsFiltered').value.next(options));
948
+ }
949
+ }
950
+ newFormGroup.get('value')
951
+ .valueChanges
952
+ .pipe(debounceTime(300))
953
+ .subscribe((value) => __awaiter(this, void 0, void 0, function* () {
954
+ var _a, _b, _c, _d;
955
+ yield this.setConfigDynamicForm(newFormGroup);
956
+ if (config.type === DynamicFormTypeFieldEnum.autocomplete) {
957
+ if (value && (value.hasOwnProperty('value') &&
958
+ value.hasOwnProperty('name') &&
959
+ Object.keys(value).length === 2) || (Array.isArray(value) &&
960
+ newFormGroup.get('multiple').value)) {
961
+ if (newFormGroup.get('multiple').value) {
962
+ if (Array.isArray(value)) {
963
+ newFormGroup.get('autocompleteSelectedValue').setValue(value);
964
+ newFormGroup.get('value').setValue(value[value.length - 1], { emitEvent: false });
965
+ }
966
+ else {
967
+ if (this.validateAutocompleteSelect(newFormGroup.get('autocompleteSelectedValue').value, value)) {
968
+ newFormGroup.get('autocompleteSelectedValue').value.push(value);
969
+ }
970
+ }
971
+ if ((_a = this.autocompleteInput) === null || _a === void 0 ? void 0 : _a.nativeElement) {
972
+ this.autocompleteInput.nativeElement.value = '';
973
+ }
974
+ }
975
+ else {
976
+ newFormGroup.get('autocompleteSelectedValue').setValue(value);
977
+ }
978
+ }
979
+ else if (!newFormGroup.get('multiple').value) {
980
+ newFormGroup.get('autocompleteSelectedValue').setValue((_c = (_b = koala(this.formConfig)
981
+ .array()
982
+ .filter(newFormGroup.get('name').value, 'name')
983
+ .getValue()[0]) === null || _b === void 0 ? void 0 : _b.autocompleteDefaultValueOnClear) !== null && _c !== void 0 ? _c : null);
984
+ }
985
+ if (config.type === DynamicFormTypeFieldEnum.autocomplete) {
986
+ if (config.autocompleteType === 'all') {
987
+ const autocompleteOptionsSubject = newFormGroup.get('autocompleteOptions').value;
988
+ newFormGroup.get('autocompleteOptionsFiltered').value.next(this.autocompleteFilter(autocompleteOptionsSubject.value, value));
989
+ }
990
+ else if (config.autocompleteType === 'onDemand' && typeof value !== "object") {
991
+ const loader = newFormGroup.get('autocompleteLoading').value;
992
+ loader.next(true);
993
+ config.autocompleteFilter(value).subscribe(options => {
994
+ newFormGroup.get('autocompleteOptionsFiltered').value.next(options);
995
+ loader.next(false);
996
+ });
997
+ }
998
+ }
999
+ }
1000
+ if (config.valueChanges) {
1001
+ if (config.type === DynamicFormTypeFieldEnum.autocomplete) {
1002
+ config.valueChanges((newFormGroup.get('multiple').value ?
1003
+ newFormGroup.get('autocompleteSelectedValue').value.map(item => item.value) :
1004
+ (_d = newFormGroup.get('autocompleteSelectedValue').value) === null || _d === void 0 ? void 0 : _d.value));
1005
+ }
1006
+ else {
1007
+ config.valueChanges(value);
1008
+ }
1009
+ }
1010
+ }));
1011
+ }
1012
+ this.controls.push(newFormGroup);
1013
+ if (config.moreItemsConfig) {
1014
+ if (config.moreItemsMinItems > 0) {
1015
+ for (let min = 0; min < config.moreItemsMinItems; min++) {
1016
+ if (min <= config.moreItemsMaxItems) {
1017
+ this.addMoreItem(indexConfig);
1018
+ }
1019
+ }
1020
+ }
1021
+ if (config.moreItemsConfig.setValues) {
1022
+ config.moreItemsConfig
1023
+ .setValues
1024
+ .subscribe((values) => __awaiter(this, void 0, void 0, function* () {
1025
+ if (values.length > 0) {
1026
+ values.forEach((itemValue, indexValue) => {
1027
+ if (!this.controls.controls[indexConfig].get('moreItemsConfig').value[indexValue]) {
1028
+ this.addMoreItem(indexConfig);
1029
+ }
1030
+ setTimeout(() => {
1031
+ this.setValuesOnFields(itemValue, this.controls.controls[indexConfig].get('moreItemsConfig').value[indexValue].form);
1032
+ }, 300);
1033
+ });
1034
+ }
1035
+ }));
1036
+ }
1037
+ }
1038
+ });
1039
+ if (this.showFields) {
1040
+ this.changeVisibilityFields(this.showFields, this.form);
1041
+ }
1042
+ if (this.setValues) {
1043
+ this.setValuesOnFields(this.setValues, this.form);
1044
+ }
1045
+ }
1046
+ hoursAndMinutesApplyMask(index, event) {
1047
+ var _a;
1048
+ const control = (_a = this.controls) === null || _a === void 0 ? void 0 : _a.controls[index];
1049
+ const type = control === null || control === void 0 ? void 0 : control.get('type').value;
1050
+ if (type === DynamicFormTypeFieldEnum.hoursAndMinutes) {
1051
+ const value = control === null || control === void 0 ? void 0 : control.get('value').value;
1052
+ if (event.key == 'Backspace' && value.length < 6) {
1053
+ this.hoursAndMinutesMask = '00:000';
1054
+ }
1055
+ else if (event.key != 'Backspace' && value.length >= 6) {
1056
+ this.hoursAndMinutesMask = '000:00';
1057
+ }
1058
+ }
1059
+ }
1060
+ passwordView(index) {
1061
+ var _a;
1062
+ const control = (_a = this.controls) === null || _a === void 0 ? void 0 : _a.controls[index];
1063
+ const hidePassword = !(control === null || control === void 0 ? void 0 : control.get('hidePassword').value);
1064
+ control === null || control === void 0 ? void 0 : control.get('hidePassword').setValue(hidePassword);
1065
+ control === null || control === void 0 ? void 0 : control.get('type').setValue(hidePassword ?
1066
+ DynamicFormTypeFieldEnum.password :
1067
+ DynamicFormTypeFieldEnum.text);
1068
+ }
1069
+ addMoreItem(propIndex) {
1070
+ if (this.controls.controls[propIndex].get('moreItemsConfig').value.length < this.controls.controls[propIndex].get('moreItemsMaxItems').value) {
1071
+ const formGroup = this.fb.group({});
1072
+ this.controls.controls[propIndex].get('moreItemsConfig').value.push({
1073
+ form: formGroup,
1074
+ formConfig: this.formConfig[propIndex].moreItemsConfig.formConfig,
1075
+ showFields: new BehaviorSubject([]),
1076
+ showFieldsMoreItensConfig: this.formConfig[propIndex].moreItemsConfig.showFieldsConfig
1077
+ });
1078
+ this.controls.controls[propIndex].get('moreItemsExpanded').setValue(this.controls.controls[propIndex].get('moreItemsConfig').value.length - 1);
1079
+ const formArrayMoreItems = this.controls.controls[propIndex].get('moreItemsFormGroup');
1080
+ formArrayMoreItems.push(formGroup);
1081
+ }
1082
+ }
1083
+ removeMoreItem(propIndex, removeIndex) {
1084
+ const expandedItemIndex = removeIndex - 1;
1085
+ this.controls.controls[propIndex].get('moreItemsConfig').value.splice(removeIndex, 1);
1086
+ setTimeout(() => {
1087
+ this.controls.controls[propIndex].get('moreItemsExpanded').setValue((expandedItemIndex < 0) ? 0 : expandedItemIndex);
1088
+ }, 50);
1089
+ }
1090
+ clearAutocomplete(propIndex) {
1091
+ var _a, _b;
1092
+ if (this.controls.controls[propIndex].get('multiple').value) {
1093
+ this.controls.controls[propIndex].get('autocompleteSelectedValue').setValue([]);
1094
+ this.controls.controls[propIndex].get('value').setValue(null);
1095
+ }
1096
+ else {
1097
+ this.controls.controls[propIndex].get('autocompleteSelectedValue').setValue((_a = this.formConfig[propIndex].autocompleteDefaultValueOnClear) !== null && _a !== void 0 ? _a : null);
1098
+ this.controls.controls[propIndex].get('value').setValue((_b = this.formConfig[propIndex].autocompleteDefaultValueOnClear) !== null && _b !== void 0 ? _b : null);
1099
+ }
1100
+ }
1101
+ display(option) {
1102
+ return option ? option.name : undefined;
1103
+ }
1104
+ removeOptionOnAutocomplete(propIndex, option) {
1105
+ const value = this.controls.controls[propIndex].get('autocompleteSelectedValue').value.filter(item => item !== option);
1106
+ this.controls.controls[propIndex].get('autocompleteSelectedValue').setValue(value);
1107
+ if (value.length === 0) {
1108
+ this.controls.controls[propIndex].get('autocompleteSelectedValue').setValue([]);
1109
+ this.controls.controls[propIndex].get('value').setValue(null);
1110
+ }
1111
+ else if (this.formConfig[propIndex].valueChanges) {
1112
+ this.formConfig[propIndex].valueChanges(value.map(item => item.value));
1113
+ }
1114
+ }
1115
+ getColorChip(config) {
1116
+ return config.color;
1117
+ }
1118
+ getAutocompleteOptions(propriedade) {
1119
+ return propriedade.get('autocompleteOptionsFiltered').value;
1120
+ }
1121
+ getDynamicFormConfig(propriedade) {
1122
+ return propriedade.get('dynamicFormConfig').value;
1123
+ }
1124
+ newControl(config) {
1125
+ 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, _2, _3, _4;
1126
+ let validators = (_a = config.syncValidators) !== null && _a !== void 0 ? _a : [];
1127
+ let value = (_b = config.value) !== null && _b !== void 0 ? _b : '';
1128
+ let valueSelectedAutocomplete = (config.multiple ? [] : ((_c = config.autocompleteDefaultValueOnClear) !== null && _c !== void 0 ? _c : null));
1129
+ if (config.required === true)
1130
+ validators.push(Validators.required);
1131
+ if (config.min && typeof config.min === "number")
1132
+ validators.push(Validators.min(config.min));
1133
+ if (config.max && typeof config.max === "number")
1134
+ validators.push(Validators.max(config.max));
1135
+ if (config.type === DynamicFormTypeFieldEnum.date ||
1136
+ config.type === DynamicFormTypeFieldEnum.datetime ||
1137
+ config.type === DynamicFormTypeFieldEnum.time) {
1138
+ if (config.min && typeof config.min === "string") {
1139
+ validators.push(DateMinValidator(config.min));
1140
+ }
1141
+ if (config.max && typeof config.max === "string") {
1142
+ validators.push(DateMaxValidator(config.max));
1143
+ }
1144
+ }
1145
+ if (config.minLength)
1146
+ validators.push(Validators.minLength(config.minLength));
1147
+ if (config.maxLength)
1148
+ validators.push(Validators.maxLength(config.maxLength));
1149
+ if (config.type === DynamicFormTypeFieldEnum.cpf) {
1150
+ validators.push(CpfValidator);
1151
+ }
1152
+ else if (config.type === DynamicFormTypeFieldEnum.cnpj) {
1153
+ validators.push(CnpjValidator);
1154
+ }
1155
+ else if (config.type === DynamicFormTypeFieldEnum.email) {
1156
+ validators.push(Validators.email);
1157
+ }
1158
+ else if (config.type === DynamicFormTypeFieldEnum.autocomplete) {
1159
+ if (value) {
1160
+ valueSelectedAutocomplete = value;
1161
+ value = (config.multiple ? valueSelectedAutocomplete[0] : value);
1162
+ }
1163
+ if (config.required === true) {
1164
+ validators.push(AutocompleteSelectedValidator);
1165
+ }
1166
+ }
1167
+ else if (config.type === DynamicFormTypeFieldEnum.checkbox) {
1168
+ value = (_d = config.value) !== null && _d !== void 0 ? _d : false;
1169
+ }
1170
+ if (config.type === DynamicFormTypeFieldEnum.hoursAndMinutes &&
1171
+ value.length >= 6) {
1172
+ this.hoursAndMinutesMask = '000:00';
1173
+ }
1174
+ if (config.dynamicFormConfig) {
1175
+ const cloneDynamicFormConfig = {};
1176
+ Object.assign(cloneDynamicFormConfig, config.dynamicFormConfig);
1177
+ cloneDynamicFormConfig.form = config.dynamicFormConfig.form;
1178
+ config.dynamicFormConfig = cloneDynamicFormConfig;
1179
+ }
1180
+ if (config.show === false) {
1181
+ validators = [];
1182
+ }
1183
+ const field = this.fb.group({
1184
+ show: [new BehaviorSubject((_e = config.show) !== null && _e !== void 0 ? _e : true)],
1185
+ label: [config.label],
1186
+ name: [config.name],
1187
+ type: [config.type],
1188
+ fileButtonConfig: [{
1189
+ 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',
1190
+ 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',
1191
+ 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',
1192
+ 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',
1193
+ 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 : '*'
1194
+ }],
1195
+ dynamicFormConfig: [new BehaviorSubject(config.dynamicFormConfig)],
1196
+ dynamicFormGroup: this.fb.array([]),
1197
+ appearance: [config.appearance],
1198
+ floatLabel: [config.floatLabel],
1199
+ placeholder: [config.placeholder],
1200
+ class: [config.class],
1201
+ fieldClass: [config.fieldClass],
1202
+ textHint: [config.textHint],
1203
+ required: [(_r = config.required) !== null && _r !== void 0 ? _r : false],
1204
+ min: [(_s = config.min) !== null && _s !== void 0 ? _s : 0],
1205
+ max: [(_t = config.max) !== null && _t !== void 0 ? _t : 99999999999],
1206
+ minLength: [(_u = config.minLength) !== null && _u !== void 0 ? _u : 0],
1207
+ maxLength: [(_v = config.maxLength) !== null && _v !== void 0 ? _v : 255],
1208
+ disabled: [(_w = config.disabled) !== null && _w !== void 0 ? _w : false],
1209
+ focus: [(_x = config.focus) !== null && _x !== void 0 ? _x : false],
1210
+ multiple: [(_y = config.multiple) !== null && _y !== void 0 ? _y : false],
1211
+ opcoesSelect: [(_z = config.opcoesSelect) !== null && _z !== void 0 ? _z : []],
1212
+ hidePassword: config.type === DynamicFormTypeFieldEnum.password ? true : null,
1213
+ moreItemsButtonIconAddlabel: [config.moreItemsButtonIconAddlabel],
1214
+ moreItemsMinItems: [(_0 = config.moreItemsMinItems) !== null && _0 !== void 0 ? _0 : 0],
1215
+ moreItemsMaxItems: [(_1 = config.moreItemsMaxItems) !== null && _1 !== void 0 ? _1 : 100],
1216
+ moreItemsIcon: [config.moreItemsIcon],
1217
+ moreItemsIconFontColor: [config.moreItemsIconFontColor],
1218
+ moreItemsIconBackgroundColor: [config.moreItemsIconBackgroundColor],
1219
+ moreItemsExpanded: [''],
1220
+ moreItemsConfig: [[]],
1221
+ moreItemsFormGroup: this.fb.array([]),
1222
+ autocompleteLoading: [new BehaviorSubject(false)],
1223
+ autocompleteOptions: [config.autocompleteOptions],
1224
+ autocompleteMultipleConfig: [config.autocompleteMultipleConfig],
1225
+ autocompleteOptionsFiltered: [new BehaviorSubject([])],
1226
+ autocompleteSelectedValue: [valueSelectedAutocomplete],
1227
+ textLogs: [config === null || config === void 0 ? void 0 : config.textObs],
1228
+ customMasc: [config === null || config === void 0 ? void 0 : config.customMasc],
1229
+ customMascThousandSeparator: [(_2 = config === null || config === void 0 ? void 0 : config.customMascThousandSeparator) !== null && _2 !== void 0 ? _2 : ''],
1230
+ customMascSuffix: [(_3 = config === null || config === void 0 ? void 0 : config.customMascSuffix) !== null && _3 !== void 0 ? _3 : ''],
1231
+ customMascPrefix: [(_4 = config === null || config === void 0 ? void 0 : config.customMascPrefix) !== null && _4 !== void 0 ? _4 : ''],
1232
+ value: [{ value, disabled: config.disabled }, validators, config.asyncValidators]
1233
+ });
1234
+ if (config.autocompleteType === "onDemand") {
1235
+ const loader = field.get('autocompleteLoading').value;
1236
+ loader.next(true);
1237
+ config.autocompleteFilter('').subscribe(options => {
1238
+ field.get('autocompleteOptionsFiltered').value.next(options);
1239
+ loader.next(false);
1240
+ });
1241
+ }
1242
+ return field;
1243
+ }
1244
+ setValuesOnFields(subject, form) {
1245
+ subject.subscribe(item => {
1246
+ if (item) {
1247
+ const formArray = form.get('formData');
1248
+ for (const prop of item.values()) {
1249
+ this.setValueByProp(formArray, prop);
1250
+ }
1251
+ }
1252
+ });
1253
+ }
1254
+ changeVisibilityFields(subject, form) {
1255
+ subject.pipe(debounceTime(5)).subscribe(item => {
1256
+ var _a, _b, _c;
1257
+ if (item) {
1258
+ const formArray = form.get('formData');
1259
+ for (const prop of item.values()) {
1260
+ for (const [indexControl, control] of formArray.controls.entries()) {
1261
+ if (control.get('name').value === prop.name) {
1262
+ control.get('show').value.next(prop.show);
1263
+ const config = (_a = this.formConfig[indexControl]) !== null && _a !== void 0 ? _a : null;
1264
+ if (prop.show) {
1265
+ let validators = [];
1266
+ if (config) {
1267
+ if (config.type === DynamicFormTypeFieldEnum.dynamicForm) {
1268
+ const formArrayMoreItems = control.get('dynamicFormGroup');
1269
+ formArrayMoreItems.push((_b = config === null || config === void 0 ? void 0 : config.dynamicFormConfig) === null || _b === void 0 ? void 0 : _b.form);
1270
+ }
1271
+ else {
1272
+ validators = (_c = config.syncValidators) !== null && _c !== void 0 ? _c : [];
1273
+ if (config.required === true) {
1274
+ validators.push(Validators.required);
1275
+ }
1276
+ if (config.type === DynamicFormTypeFieldEnum.cpf) {
1277
+ validators.push(CpfValidator);
1278
+ }
1279
+ else if (config.type === DynamicFormTypeFieldEnum.cnpj) {
1280
+ validators.push(CnpjValidator);
1281
+ }
1282
+ else if (config.type === DynamicFormTypeFieldEnum.email) {
1283
+ validators.push(Validators.email);
1284
+ }
1285
+ else if (config.required === true &&
1286
+ config.type === DynamicFormTypeFieldEnum.autocomplete) {
1287
+ validators.push(AutocompleteSelectedValidator);
1288
+ }
1289
+ if (config.min && typeof config.min === "number")
1290
+ validators.push(Validators.min(config.min));
1291
+ if (config.max && typeof config.max === "number")
1292
+ validators.push(Validators.max(config.max));
1293
+ if (config.type === DynamicFormTypeFieldEnum.date ||
1294
+ config.type === DynamicFormTypeFieldEnum.datetime ||
1295
+ config.type === DynamicFormTypeFieldEnum.time) {
1296
+ if (config.min && typeof config.min === "string") {
1297
+ validators.push(DateMinValidator(config.min));
1298
+ }
1299
+ if (config.max && typeof config.max === "string") {
1300
+ validators.push(DateMaxValidator(config.max));
1301
+ }
1302
+ }
1303
+ if (config.minLength)
1304
+ validators.push(Validators.minLength(config.minLength));
1305
+ if (config.maxLength)
1306
+ validators.push(Validators.maxLength(config.maxLength));
1307
+ control.get('value').setValidators(validators);
1308
+ if (config.asyncValidators) {
1309
+ control.get('value').setAsyncValidators(config.asyncValidators);
1310
+ }
1311
+ }
1312
+ control.get('value').updateValueAndValidity();
1313
+ if (prop.clearCurrentValue) {
1314
+ control.get('value').setValue(null);
1315
+ }
1316
+ }
1317
+ }
1318
+ else {
1319
+ control.get('value').clearValidators();
1320
+ control.get('value').clearAsyncValidators();
1321
+ control.setErrors(null);
1322
+ control.get('value').setValue(null);
1323
+ control.get('value').updateValueAndValidity();
1324
+ if (config.type === DynamicFormTypeFieldEnum.dynamicForm) {
1325
+ const formGroup = control;
1326
+ formGroup.removeControl('dynamicFormGroup');
1327
+ formGroup.addControl('dynamicFormGroup', this.fb.array([]));
1328
+ }
1329
+ }
1330
+ break;
1331
+ }
1332
+ }
1333
+ }
1334
+ }
1335
+ });
1336
+ }
1337
+ autocompleteFilter(arr, value) {
1338
+ return arr.filter(filter => {
1339
+ if (typeof value === 'string') {
1340
+ if (filter) {
1341
+ let find = true;
1342
+ value.toLowerCase()
1343
+ .split(' ')
1344
+ .forEach(part => {
1345
+ if (filter.name.toLowerCase().indexOf(part) < 0) {
1346
+ find = false;
1347
+ return false;
1348
+ }
1349
+ });
1350
+ return find;
1351
+ }
1352
+ }
1353
+ else {
1354
+ return true;
1355
+ }
1356
+ });
1357
+ }
1358
+ setValueByProp(formArray, prop) {
1359
+ if (formArray) {
1360
+ if (prop.name.indexOf(' > ') >= 0) {
1361
+ let dynamicFormSubject;
1362
+ const arrPropName = prop.name.split(' > ');
1363
+ let indexPropName = 0;
1364
+ do {
1365
+ const control = formArray.controls.find(control => control.get('name').value === arrPropName[indexPropName]);
1366
+ if (indexPropName === arrPropName.length - 2) {
1367
+ dynamicFormSubject = control.get('dynamicFormConfig').value;
1368
+ const dynamicForm = dynamicFormSubject.getValue();
1369
+ if (dynamicForm.formConfig.find(fc => fc.name === arrPropName[arrPropName.length - 1])) {
1370
+ if (dynamicForm.setValues) {
1371
+ dynamicForm.setValues.next(koala(dynamicForm.setValues.getValue()).array().merge([{
1372
+ name: arrPropName[arrPropName.length - 1],
1373
+ value: prop.value
1374
+ }]).getValue());
1375
+ }
1376
+ else {
1377
+ dynamicForm.setValues = new BehaviorSubject([{
1378
+ name: arrPropName[arrPropName.length - 1],
1379
+ value: prop.value
1380
+ }]);
1381
+ }
1382
+ }
1383
+ }
1384
+ indexPropName++;
1385
+ } while (indexPropName < arrPropName.length - 1);
1386
+ }
1387
+ else {
1388
+ for (const control of formArray.controls.values()) {
1389
+ if (control.get('name').value === prop.name) {
1390
+ control.get('value').setValue(prop.value);
1391
+ break;
1392
+ }
1393
+ }
1394
+ }
1395
+ }
1396
+ }
1397
+ setConfigDynamicForm(newFormGroup) {
1398
+ return __awaiter(this, void 0, void 0, function* () {
1399
+ if (this.showFieldsMoreItensConfig) {
1400
+ const value = newFormGroup.get('value').value;
1401
+ const configs = this.showFieldsMoreItensConfig
1402
+ .filter(config => config.nameField === newFormGroup.get('name').value)
1403
+ .sort(config => {
1404
+ if (config.fnShow(value)) {
1405
+ return 1;
1406
+ }
1407
+ return -1;
1408
+ });
1409
+ for (const config of configs) {
1410
+ if (config) {
1411
+ if (config.dynamicFormConfig && config.fnShow(value)) {
1412
+ const controlDynamicFormConfig = this.controls
1413
+ .controls
1414
+ .find(control => config.fieldsToShow.indexOf(control.get('name').value) >= 0);
1415
+ const dynamicFormConfigSubject = controlDynamicFormConfig.get('dynamicFormConfig').value;
1416
+ dynamicFormConfigSubject.next(null);
1417
+ yield delay(1);
1418
+ dynamicFormConfigSubject.next(config.dynamicFormConfig(value));
1419
+ }
1420
+ this.dynamicFormService.showFields(this.showFields, config.fieldsToShow, config.fnShow(value), config.clearCurrentValue);
1421
+ }
1422
+ }
1423
+ }
1424
+ });
1425
+ }
1426
+ validateAutocompleteSelect(selectedValues, value) {
1427
+ let isValid = true;
1428
+ for (const selectedItem of selectedValues.values()) {
1429
+ if (selectedItem.name === value.name) {
1430
+ isValid = false;
1431
+ break;
1432
+ }
1433
+ }
1434
+ return isValid;
1435
+ }
1436
+ }
1437
+ DynamicFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DynamicFormComponent, deps: [{ token: i1$1.FormBuilder }, { token: KoalaDynamicFormService }], target: i0.ɵɵFactoryTarget.Component });
1438
+ DynamicFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: DynamicFormComponent, selector: "koala-dynamic-form", inputs: { form: "form", formConfig: "formConfig", showFields: "showFields", showFieldsMoreItensConfig: "showFieldsMoreItensConfig", setValues: "setValues", tabIndexStart: "tabIndexStart" }, viewQueries: [{ propertyName: "autocompleteInput", first: true, predicate: ["autocompleteInput"], descendants: true }], usesInheritance: true, ngImport: i0, 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 [thousandSeparator]=\"propriedade.get('customMascThousandSeparator').value\"\n [suffix]=\"propriedade.get('customMascSuffix').value\"\n [prefix]=\"propriedade.get('customMascPrefix').value\"\n separatorLimit=\"0\"\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 cdkTextareaAutosize\n #autosize=\"cdkTextareaAutosize\"\n\t\t [cdkAutosizeMaxRows]=\"8\"\n\t\t [cdkAutosizeMinRows]=\"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 cdkTextareaAutosize\n #autosize=\"cdkTextareaAutosize\"\n\t\t [cdkAutosizeMaxRows]=\"8\"\n\t\t [cdkAutosizeMinRows]=\"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 autocomplete=\"off\"\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 autocomplete=\"off\"\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=\"(getAutocompleteOptions(propriedade) | 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(getDynamicFormConfig(propriedade) | 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", 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"], components: [{ type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i6.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i7.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i8.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i9.ButtonComponent, selector: "koala-button", inputs: ["color", "backgroundColor", "icon", "text", "tooltip", "disabled", "koalaIcon", "koalaIconSize"] }, { type: i10.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { type: i10.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { type: DynamicFormComponent, selector: "koala-dynamic-form", inputs: ["form", "formConfig", "showFields", "showFieldsMoreItensConfig", "setValues", "tabIndexStart"] }, { type: i11.MatChipList, selector: "mat-chip-list", inputs: ["errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { type: i2.MatSpinner, selector: "mat-spinner", inputs: ["color"] }, { type: i13.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { type: i14.FileButtonComponent, selector: "koala-file-button", inputs: ["color", "backgroundColor", "icon", "text", "tooltip", "disabled", "multiple", "accept", "setFile", "updateFileList", "autoclear"], outputs: ["getFiles"] }, { type: i15.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }], directives: [{ type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i16.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { type: i16.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i16.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { type: i3$1.MatLabel, selector: "mat-label" }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i17.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i18.MaskDirective, selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "showTemplate", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: KoalaAutofocusDirective, selector: "[koalaAutoFocus]", inputs: ["koalaAutoFocus"] }, { type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i3$1.MatSuffix, selector: "[matSuffix]" }, { type: i3$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i3$1.MatError, selector: "mat-error", inputs: ["id"] }, { type: i20.CurrencyMaskDirective, selector: "[currencyMask]", inputs: ["max", "min", "options"] }, { type: i21.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { type: i1$1.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i10.MatAccordion, selector: "mat-accordion", inputs: ["multi", "hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { type: i10.MatExpansionPanelTitle, selector: "mat-panel-title" }, { type: i10.MatExpansionPanelDescription, selector: "mat-panel-description" }, { type: i10.MatExpansionPanelActionRow, selector: "mat-action-row" }, { type: i11.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { type: i11.MatChipRemove, selector: "[matChipRemove]" }, { type: i13.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { type: i11.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { type: i15.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }], pipes: { "async": i16.AsyncPipe, "date": i16.DatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1439
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DynamicFormComponent, decorators: [{
1440
+ type: Component,
1441
+ args: [{ selector: 'koala-dynamic-form', changeDetection: ChangeDetectionStrategy.OnPush, 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 [thousandSeparator]=\"propriedade.get('customMascThousandSeparator').value\"\n [suffix]=\"propriedade.get('customMascSuffix').value\"\n [prefix]=\"propriedade.get('customMascPrefix').value\"\n separatorLimit=\"0\"\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 cdkTextareaAutosize\n #autosize=\"cdkTextareaAutosize\"\n\t\t [cdkAutosizeMaxRows]=\"8\"\n\t\t [cdkAutosizeMinRows]=\"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 cdkTextareaAutosize\n #autosize=\"cdkTextareaAutosize\"\n\t\t [cdkAutosizeMaxRows]=\"8\"\n\t\t [cdkAutosizeMinRows]=\"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 autocomplete=\"off\"\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 autocomplete=\"off\"\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=\"(getAutocompleteOptions(propriedade) | 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(getDynamicFormConfig(propriedade) | 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", 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"] }]
1442
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: KoalaDynamicFormService }]; }, propDecorators: { form: [{
1443
+ type: Input
1444
+ }], formConfig: [{
1445
+ type: Input
1446
+ }], showFields: [{
1447
+ type: Input
1448
+ }], showFieldsMoreItensConfig: [{
1449
+ type: Input
1450
+ }], setValues: [{
1451
+ type: Input
1452
+ }], tabIndexStart: [{
1453
+ type: Input
1454
+ }], autocompleteInput: [{
1455
+ type: ViewChild,
1456
+ args: ['autocompleteInput']
1457
+ }] } });
1458
+
1459
+ class KoalaFormModule {
1460
+ }
1461
+ KoalaFormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1462
+ KoalaFormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaFormModule, declarations: [BtnSubmitComponent,
1463
+ DynamicFormComponent,
1464
+ KoalaAutofocusDirective], imports: [CommonModule,
1465
+ ReactiveFormsModule,
1466
+ FormsModule,
1467
+ CurrencyMaskModule, i18.NgxMaskModule, KoalaFileButtonModule,
1468
+ MatInputModule,
1469
+ MatSelectModule,
1470
+ MatRadioModule,
1471
+ MatCheckboxModule,
1472
+ MatAutocompleteModule,
1473
+ MatButtonModule,
1474
+ MatIconModule,
1475
+ MatExpansionModule,
1476
+ MatChipsModule,
1477
+ KoalaButtonModule,
1478
+ MatProgressSpinnerModule], exports: [ReactiveFormsModule,
1479
+ FormsModule,
1480
+ KoalaAutofocusDirective,
1481
+ NgxMaskModule,
1482
+ KoalaFileButtonModule,
1483
+ MatInputModule,
1484
+ MatSelectModule,
1485
+ MatRadioModule,
1486
+ MatCheckboxModule,
1487
+ MatAutocompleteModule,
1488
+ MatButtonModule,
1489
+ MatIconModule,
1490
+ MatProgressSpinnerModule,
1491
+ BtnSubmitComponent,
1492
+ DynamicFormComponent] });
1493
+ KoalaFormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaFormModule, imports: [[
1494
+ CommonModule,
1495
+ ReactiveFormsModule,
1496
+ FormsModule,
1497
+ CurrencyMaskModule,
1498
+ NgxMaskModule.forRoot(maskOptions),
1499
+ KoalaFileButtonModule,
1500
+ MatInputModule,
1501
+ MatSelectModule,
1502
+ MatRadioModule,
1503
+ MatCheckboxModule,
1504
+ MatAutocompleteModule,
1505
+ MatButtonModule,
1506
+ MatIconModule,
1507
+ MatExpansionModule,
1508
+ MatChipsModule,
1509
+ KoalaButtonModule,
1510
+ MatProgressSpinnerModule
1511
+ ], ReactiveFormsModule,
1512
+ FormsModule,
1513
+ NgxMaskModule,
1514
+ KoalaFileButtonModule,
1515
+ MatInputModule,
1516
+ MatSelectModule,
1517
+ MatRadioModule,
1518
+ MatCheckboxModule,
1519
+ MatAutocompleteModule,
1520
+ MatButtonModule,
1521
+ MatIconModule,
1522
+ MatProgressSpinnerModule] });
1523
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: KoalaFormModule, decorators: [{
1524
+ type: NgModule,
1525
+ args: [{
1526
+ declarations: [
1527
+ BtnSubmitComponent,
1528
+ DynamicFormComponent,
1529
+ KoalaAutofocusDirective
1530
+ ],
1531
+ imports: [
1532
+ CommonModule,
1533
+ ReactiveFormsModule,
1534
+ FormsModule,
1535
+ CurrencyMaskModule,
1536
+ NgxMaskModule.forRoot(maskOptions),
1537
+ KoalaFileButtonModule,
1538
+ MatInputModule,
1539
+ MatSelectModule,
1540
+ MatRadioModule,
1541
+ MatCheckboxModule,
1542
+ MatAutocompleteModule,
1543
+ MatButtonModule,
1544
+ MatIconModule,
1545
+ MatExpansionModule,
1546
+ MatChipsModule,
1547
+ KoalaButtonModule,
1548
+ MatProgressSpinnerModule
1549
+ ],
1550
+ exports: [
1551
+ ReactiveFormsModule,
1552
+ FormsModule,
1553
+ KoalaAutofocusDirective,
1554
+ NgxMaskModule,
1555
+ KoalaFileButtonModule,
1556
+ MatInputModule,
1557
+ MatSelectModule,
1558
+ MatRadioModule,
1559
+ MatCheckboxModule,
1560
+ MatAutocompleteModule,
1561
+ MatButtonModule,
1562
+ MatIconModule,
1563
+ MatProgressSpinnerModule,
1564
+ BtnSubmitComponent,
1565
+ DynamicFormComponent
1566
+ ]
1567
+ }]
1568
+ }] });
1569
+
1570
+ /**
1571
+ * Generated bundle index. Do not edit.
1572
+ */
1573
+
1574
+ export { AutocompleteSelectedValidator, BtnSubmitComponent, CnpjValidator, CpfValidator, DynamicFormComponent, DynamicFormTypeFieldEnum, FormAbstract, KoalaAutofocusDirective, KoalaDynamicFormService, KoalaDynamicFormValidatorResultHelper, KoalaFormModule, ShowInvalidFields, ValidationHelper };
1575
+ //# sourceMappingURL=koalarx-ui-form.mjs.map