@koalarx/ui 14.0.7 → 14.0.9

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