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