keevo-components 1.5.189 → 1.5.191

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 (351) hide show
  1. package/README.md +24 -24
  2. package/ng-package.json +7 -0
  3. package/package.json +3 -22
  4. package/src/assets/.gitkeep +0 -0
  5. package/src/assets/images/LogoEvo.png +0 -0
  6. package/src/assets/images/LogoPequenaEvo.png +0 -0
  7. package/src/assets/images/background.png +0 -0
  8. package/src/assets/images/keepass-logo.png +0 -0
  9. package/src/assets/images/keepass-logo.svg +74 -0
  10. package/src/assets/images/keevo-logo.png +0 -0
  11. package/src/assets/images/logokeevo_2.png +0 -0
  12. package/src/index.ts +1 -0
  13. package/src/lib/api/base-components/base-component-button.ts +27 -0
  14. package/src/lib/api/base-components/base-component-chart.ts +105 -0
  15. package/src/lib/api/base-components/base-component-crud-form.ts +328 -0
  16. package/src/lib/api/base-components/base-component-crud-list.ts +111 -0
  17. package/src/lib/api/base-components/base-component-crud.ts +70 -0
  18. package/src/lib/api/base-components/base-component-dropdown-new.ts +112 -0
  19. package/src/lib/api/base-components/base-component-dropdown.ts +164 -0
  20. package/src/lib/api/base-components/base-component-input.ts +107 -0
  21. package/src/lib/api/base-components/base-component-multi-select.ts +136 -0
  22. package/src/lib/api/base-components/base-component.ts +46 -0
  23. package/src/lib/api/components/chart/chart.config.ts +12 -0
  24. package/src/lib/api/components/chart/chart.model.ts +9 -0
  25. package/src/lib/api/components/chart/orchart.config.ts +41 -0
  26. package/src/lib/api/components/chart/orchart.item.ts +33 -0
  27. package/src/lib/api/components/dropdown/filtro.combo.ts +4 -0
  28. package/src/lib/api/components/error/error.component.html +3 -0
  29. package/src/lib/api/components/error/error.component.scss +5 -0
  30. package/src/lib/api/components/error/error.component.ts +22 -0
  31. package/src/lib/api/components/error/kverror.module.ts +23 -0
  32. package/src/lib/api/components/table/action-item.ts +5 -0
  33. package/src/lib/api/components/table/kv-menuitem.ts +10 -0
  34. package/src/lib/api/components/table/table.config.column.ts +21 -0
  35. package/src/lib/api/components/table/table.config.ts +20 -0
  36. package/src/lib/api/components/table/table.paginate.ts +6 -0
  37. package/src/lib/api/helpers/component-providers.ts +16 -0
  38. package/src/lib/api/helpers/keevo-validators.ts +77 -0
  39. package/src/lib/api/helpers/translate-primeng.ts +25 -0
  40. package/src/lib/api/models/menu/menu.model.ts +10 -0
  41. package/{lib/api/models/menu/menucompleto.model.d.ts → src/lib/api/models/menu/menucompleto.model.ts} +7 -6
  42. package/src/lib/api/models/menu/sistemamenu.model.ts +8 -0
  43. package/src/lib/api/modules/primeng.module.ts +125 -0
  44. package/src/lib/api/services/base.api.service.ts +115 -0
  45. package/src/lib/api/services/component.service.ts +22 -0
  46. package/src/lib/api/services/form.service.ts +105 -0
  47. package/src/lib/api/services/imagens.service.ts +20 -0
  48. package/src/lib/api/services/notification.service.ts +82 -0
  49. package/src/lib/api/services/object.service.ts +20 -0
  50. package/src/lib/buttons/button-personalize/button-personalize.component.html +11 -0
  51. package/src/lib/buttons/button-personalize/button-personalize.component.scss +3 -0
  52. package/src/lib/buttons/button-personalize/button-personalize.component.ts +13 -0
  53. package/src/lib/buttons/button-popup/button-popup.component.html +12 -0
  54. package/src/lib/buttons/button-popup/button-popup.component.scss +13 -0
  55. package/src/lib/buttons/button-popup/button-popup.component.ts +30 -0
  56. package/src/lib/buttons/button-secondary/button-secondary.component.html +12 -0
  57. package/src/lib/buttons/button-secondary/button-secondary.component.scss +14 -0
  58. package/src/lib/buttons/button-secondary/button-secondary.component.ts +13 -0
  59. package/src/lib/buttons/button-success/button-success.component.html +11 -0
  60. package/src/lib/buttons/button-success/button-success.component.scss +13 -0
  61. package/src/lib/buttons/button-success/button-success.component.ts +13 -0
  62. package/src/lib/buttons/kvbutton.module.ts +25 -0
  63. package/src/lib/chart/chart.component.html +38 -0
  64. package/src/lib/chart/chart.component.scss +0 -0
  65. package/src/lib/chart/chart.component.spec.ts +28 -0
  66. package/src/lib/chart/chart.component.ts +141 -0
  67. package/src/lib/chart/kvchart.module.ts +20 -0
  68. package/src/lib/directives/template.directive.ts +15 -0
  69. package/src/lib/inputs/check/check.component.html +11 -0
  70. package/src/lib/inputs/check/check.component.scss +13 -0
  71. package/src/lib/inputs/check/check.component.ts +24 -0
  72. package/src/lib/inputs/dropdown/dropdown.component.html +91 -0
  73. package/src/lib/inputs/dropdown/dropdown.component.scss +0 -0
  74. package/src/lib/inputs/dropdown/dropdown.component.ts +28 -0
  75. package/src/lib/inputs/editor/editor.component.html +90 -0
  76. package/src/lib/inputs/editor/editor.component.scss +4 -0
  77. package/src/lib/inputs/editor/editor.component.ts +80 -0
  78. package/src/lib/inputs/input-calendar/input-calendar.component.html +30 -0
  79. package/src/lib/inputs/input-calendar/input-calendar.component.scss +0 -0
  80. package/src/lib/inputs/input-calendar/input-calendar.component.ts +81 -0
  81. package/src/lib/inputs/input-mask/input-mask.component.html +20 -0
  82. package/src/lib/inputs/input-mask/input-mask.component.scss +0 -0
  83. package/src/lib/inputs/input-mask/input-mask.component.ts +20 -0
  84. package/src/lib/inputs/input-number/input-number.component.html +22 -0
  85. package/src/lib/inputs/input-number/input-number.component.scss +0 -0
  86. package/src/lib/inputs/input-number/input-number.component.ts +52 -0
  87. package/src/lib/inputs/input-password/input-password.component.html +23 -0
  88. package/src/lib/inputs/input-password/input-password.component.scss +0 -0
  89. package/src/lib/inputs/input-password/input-password.component.ts +23 -0
  90. package/src/lib/inputs/input-text/input-text.component.html +20 -0
  91. package/src/lib/inputs/input-text/input-text.component.scss +18 -0
  92. package/src/lib/inputs/input-text/input-text.component.ts +17 -0
  93. package/src/lib/inputs/input-text-checkbox/input-text-checkbox.component.html +32 -0
  94. package/src/lib/inputs/input-text-checkbox/input-text-checkbox.component.scss +0 -0
  95. package/src/lib/inputs/input-text-checkbox/input-text-checkbox.component.spec.ts +23 -0
  96. package/src/lib/inputs/input-text-checkbox/input-text-checkbox.component.ts +36 -0
  97. package/src/lib/inputs/input-textarea/input-textarea.component.html +22 -0
  98. package/src/lib/inputs/input-textarea/input-textarea.component.scss +0 -0
  99. package/src/lib/inputs/input-textarea/input-textarea.component.ts +33 -0
  100. package/src/lib/inputs/input-time/input-time.component.html +23 -0
  101. package/src/lib/inputs/input-time/input-time.component.scss +0 -0
  102. package/src/lib/inputs/input-time/input-time.component.ts +20 -0
  103. package/src/lib/inputs/kvinputs.module.ts +64 -0
  104. package/src/lib/inputs/multi-select/multi-select.component.html +28 -0
  105. package/src/lib/inputs/multi-select/multi-select.component.scss +8 -0
  106. package/src/lib/inputs/multi-select/multi-select.component.ts +31 -0
  107. package/src/lib/inputs/radio-group/radio-group.component.html +19 -0
  108. package/src/lib/inputs/radio-group/radio-group.component.scss +15 -0
  109. package/src/lib/inputs/radio-group/radio-group.component.ts +50 -0
  110. package/src/lib/inputs/switch/switch.component.html +12 -0
  111. package/src/lib/inputs/switch/switch.component.scss +3 -0
  112. package/src/lib/inputs/switch/switch.component.ts +30 -0
  113. package/src/lib/keevo-components.module.ts +50 -0
  114. package/src/lib/label/label.component.html +6 -0
  115. package/src/lib/label/label.component.scss +9 -0
  116. package/src/lib/label/label.component.spec.ts +23 -0
  117. package/src/lib/label/label.component.ts +13 -0
  118. package/src/lib/label/label.module.ts +18 -0
  119. package/src/lib/loader/kvloader.module.ts +17 -0
  120. package/src/lib/loader/loader.component.html +1 -0
  121. package/src/lib/loader/loader.component.ts +14 -0
  122. package/src/lib/loader/loader.service.ts +26 -0
  123. package/src/lib/login/kvlogin.module.ts +28 -0
  124. package/src/lib/login/login.component.html +108 -0
  125. package/src/lib/login/login.component.scss +48 -0
  126. package/src/lib/login/login.component.spec.ts +23 -0
  127. package/src/lib/login/login.component.ts +65 -0
  128. package/src/lib/menu/kvmenu.module.ts +27 -0
  129. package/src/lib/menu/menu.component.html +342 -0
  130. package/src/lib/menu/menu.component.scss +210 -0
  131. package/src/lib/menu/menu.component.spec.ts +23 -0
  132. package/src/lib/menu/menu.component.ts +246 -0
  133. package/src/lib/orgchart/orgchart.component.html +58 -0
  134. package/src/lib/orgchart/orgchart.component.scss +21 -0
  135. package/src/lib/orgchart/orgchart.component.ts +118 -0
  136. package/src/lib/orgchart/orgchart.module.ts +14 -0
  137. package/src/lib/page-form/kv-page-form.module.ts +22 -0
  138. package/src/lib/page-form/page-form.component.html +57 -0
  139. package/src/lib/page-form/page-form.component.scss +72 -0
  140. package/src/lib/page-form/page-form.component.spec.ts +28 -0
  141. package/src/lib/page-form/page-form.component.ts +121 -0
  142. package/src/lib/picklist/kvpicklist.module.ts +20 -0
  143. package/src/lib/picklist/picklist.component.html +17 -0
  144. package/src/lib/picklist/picklist.component.scss +0 -0
  145. package/src/lib/picklist/picklist.component.spec.ts +26 -0
  146. package/src/lib/picklist/picklist.component.ts +27 -0
  147. package/src/lib/pipes/codigofile.pipe.ts +15 -0
  148. package/src/lib/pipes/cpfcnpj.pipe.ts +21 -0
  149. package/src/lib/pipes/pipes.module.ts +22 -0
  150. package/src/lib/pipes/telefone.pipe.ts +38 -0
  151. package/src/lib/styles-components.scss +11 -0
  152. package/src/lib/table/kvtable.module.ts +22 -0
  153. package/src/lib/table/table.component.html +473 -0
  154. package/src/lib/table/table.component.scss +240 -0
  155. package/src/lib/table/table.component.spec.ts +28 -0
  156. package/src/lib/table/table.component.ts +546 -0
  157. package/src/lib/tree-table/kv-treetable.component.html +649 -0
  158. package/src/lib/tree-table/kv-treetable.component.scss +315 -0
  159. package/src/lib/tree-table/kv-treetable.component.ts +390 -0
  160. package/src/lib/tree-table/kv-treetable.module.ts +18 -0
  161. package/src/lib/tree-view/kvtree-view.module.ts +19 -0
  162. package/src/lib/tree-view/tree-view.component.html +9 -0
  163. package/src/lib/tree-view/tree-view.component.scss +0 -0
  164. package/src/lib/tree-view/tree-view.component.spec.ts +23 -0
  165. package/src/lib/tree-view/tree-view.component.ts +29 -0
  166. package/src/lib/workspace/kvworkspace.module.ts +29 -0
  167. package/src/lib/workspace/workspace.component.html +108 -0
  168. package/src/lib/workspace/workspace.component.scss +83 -0
  169. package/src/lib/workspace/workspace.component.ts +75 -0
  170. package/{public-api.d.ts → src/public-api.ts} +156 -133
  171. package/tsconfig.lib.json +14 -0
  172. package/tsconfig.lib.prod.json +10 -0
  173. package/tsconfig.spec.json +14 -0
  174. package/esm2020/keevo-components.mjs +0 -5
  175. package/esm2020/lib/api/base-components/base-component-button.mjs +0 -36
  176. package/esm2020/lib/api/base-components/base-component-chart.mjs +0 -92
  177. package/esm2020/lib/api/base-components/base-component-crud-form.mjs +0 -269
  178. package/esm2020/lib/api/base-components/base-component-crud-list.mjs +0 -67
  179. package/esm2020/lib/api/base-components/base-component-crud.mjs +0 -65
  180. package/esm2020/lib/api/base-components/base-component-dropdown-new.mjs +0 -211
  181. package/esm2020/lib/api/base-components/base-component-dropdown.mjs +0 -161
  182. package/esm2020/lib/api/base-components/base-component-input.mjs +0 -94
  183. package/esm2020/lib/api/base-components/base-component-multi-select.mjs +0 -128
  184. package/esm2020/lib/api/base-components/base-component.mjs +0 -49
  185. package/esm2020/lib/api/components/chart/chart.config.mjs +0 -2
  186. package/esm2020/lib/api/components/chart/chart.model.mjs +0 -2
  187. package/esm2020/lib/api/components/chart/orchart.config.mjs +0 -2
  188. package/esm2020/lib/api/components/chart/orchart.item.mjs +0 -2
  189. package/esm2020/lib/api/components/dropdown/filtro.combo.mjs +0 -2
  190. package/esm2020/lib/api/components/error/error.component.mjs +0 -26
  191. package/esm2020/lib/api/components/error/kverror.module.mjs +0 -35
  192. package/esm2020/lib/api/components/table/action-item.mjs +0 -2
  193. package/esm2020/lib/api/components/table/kv-menuitem.mjs +0 -3
  194. package/esm2020/lib/api/components/table/table.config.column.mjs +0 -2
  195. package/esm2020/lib/api/components/table/table.config.mjs +0 -2
  196. package/esm2020/lib/api/components/table/table.paginate.mjs +0 -9
  197. package/esm2020/lib/api/helpers/component-providers.mjs +0 -16
  198. package/esm2020/lib/api/helpers/keevo-validators.mjs +0 -64
  199. package/esm2020/lib/api/helpers/translate-primeng.mjs +0 -23
  200. package/esm2020/lib/api/models/menu/menu.model.mjs +0 -2
  201. package/esm2020/lib/api/models/menu/menucompleto.model.mjs +0 -2
  202. package/esm2020/lib/api/models/menu/sistemamenu.model.mjs +0 -2
  203. package/esm2020/lib/api/modules/primeng.module.mjs +0 -247
  204. package/esm2020/lib/api/services/base.api.service.mjs +0 -74
  205. package/esm2020/lib/api/services/component.service.mjs +0 -27
  206. package/esm2020/lib/api/services/form.service.mjs +0 -84
  207. package/esm2020/lib/api/services/imagens.service.mjs +0 -22
  208. package/esm2020/lib/api/services/notification.service.mjs +0 -67
  209. package/esm2020/lib/api/services/object.service.mjs +0 -26
  210. package/esm2020/lib/buttons/button-personalize/button-personalize.component.mjs +0 -17
  211. package/esm2020/lib/buttons/button-popup/button-popup.component.mjs +0 -31
  212. package/esm2020/lib/buttons/button-secondary/button-secondary.component.mjs +0 -17
  213. package/esm2020/lib/buttons/button-success/button-success.component.mjs +0 -17
  214. package/esm2020/lib/buttons/kvbutton.module.mjs +0 -39
  215. package/esm2020/lib/chart/chart.component.mjs +0 -145
  216. package/esm2020/lib/chart/kvchart.module.mjs +0 -32
  217. package/esm2020/lib/directives/template.directive.mjs +0 -24
  218. package/esm2020/lib/inputs/check/check.component.mjs +0 -26
  219. package/esm2020/lib/inputs/dropdown/dropdown.component.mjs +0 -37
  220. package/esm2020/lib/inputs/editor/editor.component.mjs +0 -70
  221. package/esm2020/lib/inputs/input-calendar/input-calendar.component.mjs +0 -89
  222. package/esm2020/lib/inputs/input-mask/input-mask.component.mjs +0 -23
  223. package/esm2020/lib/inputs/input-number/input-number.component.mjs +0 -59
  224. package/esm2020/lib/inputs/input-password/input-password.component.mjs +0 -33
  225. package/esm2020/lib/inputs/input-text/input-text.component.mjs +0 -21
  226. package/esm2020/lib/inputs/input-text-checkbox/input-text-checkbox.component.mjs +0 -38
  227. package/esm2020/lib/inputs/input-textarea/input-textarea.component.mjs +0 -43
  228. package/esm2020/lib/inputs/input-time/input-time.component.mjs +0 -24
  229. package/esm2020/lib/inputs/kvinputs.module.mjs +0 -108
  230. package/esm2020/lib/inputs/multi-select/multi-select.component.mjs +0 -38
  231. package/esm2020/lib/inputs/radio-group/radio-group.component.mjs +0 -53
  232. package/esm2020/lib/inputs/switch/switch.component.mjs +0 -32
  233. package/esm2020/lib/keevo-components.module.mjs +0 -105
  234. package/esm2020/lib/label/label.component.mjs +0 -15
  235. package/esm2020/lib/label/label.module.mjs +0 -24
  236. package/esm2020/lib/loader/loader.component.mjs +0 -18
  237. package/esm2020/lib/loader/loader.module.mjs +0 -28
  238. package/esm2020/lib/loader/loader.service.mjs +0 -29
  239. package/esm2020/lib/login/kvlogin.module.mjs +0 -47
  240. package/esm2020/lib/login/login.component.mjs +0 -52
  241. package/esm2020/lib/menu/kvmenu.module.mjs +0 -43
  242. package/esm2020/lib/menu/menu.component.mjs +0 -237
  243. package/esm2020/lib/orgchart/orgchart.component.mjs +0 -100
  244. package/esm2020/lib/orgchart/orgchart.module.mjs +0 -24
  245. package/esm2020/lib/page-form/kv-page-form.module.mjs +0 -38
  246. package/esm2020/lib/page-form/page-form.component.mjs +0 -144
  247. package/esm2020/lib/picklist/kvpicklist.module.mjs +0 -32
  248. package/esm2020/lib/picklist/picklist.component.mjs +0 -48
  249. package/esm2020/lib/pipes/codigofile.pipe.mjs +0 -19
  250. package/esm2020/lib/pipes/cpfcnpj.pipe.mjs +0 -25
  251. package/esm2020/lib/pipes/pipes.module.mjs +0 -34
  252. package/esm2020/lib/pipes/telefone.pipe.mjs +0 -45
  253. package/esm2020/lib/table/kvtable.module.mjs +0 -32
  254. package/esm2020/lib/table/table.component.mjs +0 -499
  255. package/esm2020/lib/tree-table/kv-treetable.component.mjs +0 -371
  256. package/esm2020/lib/tree-table/kv-treetable.module.mjs +0 -32
  257. package/esm2020/lib/tree-view/kvtree-view.module.mjs +0 -28
  258. package/esm2020/lib/tree-view/tree-view.component.mjs +0 -29
  259. package/esm2020/lib/workspace/kvworkspace.module.mjs +0 -47
  260. package/esm2020/lib/workspace/workspace.component.mjs +0 -77
  261. package/esm2020/public-api.mjs +0 -137
  262. package/fesm2015/keevo-components.mjs +0 -4706
  263. package/fesm2015/keevo-components.mjs.map +0 -1
  264. package/fesm2020/keevo-components.mjs +0 -4697
  265. package/fesm2020/keevo-components.mjs.map +0 -1
  266. package/index.d.ts +0 -5
  267. package/lib/api/base-components/base-component-button.d.ts +0 -14
  268. package/lib/api/base-components/base-component-chart.d.ts +0 -40
  269. package/lib/api/base-components/base-component-crud-form.d.ts +0 -137
  270. package/lib/api/base-components/base-component-crud-list.d.ts +0 -63
  271. package/lib/api/base-components/base-component-crud.d.ts +0 -36
  272. package/lib/api/base-components/base-component-dropdown-new.d.ts +0 -14
  273. package/lib/api/base-components/base-component-dropdown.d.ts +0 -42
  274. package/lib/api/base-components/base-component-input.d.ts +0 -31
  275. package/lib/api/base-components/base-component-multi-select.d.ts +0 -35
  276. package/lib/api/base-components/base-component.d.ts +0 -21
  277. package/lib/api/components/chart/chart.config.d.ts +0 -11
  278. package/lib/api/components/chart/chart.model.d.ts +0 -9
  279. package/lib/api/components/chart/orchart.config.d.ts +0 -35
  280. package/lib/api/components/chart/orchart.item.d.ts +0 -26
  281. package/lib/api/components/dropdown/filtro.combo.d.ts +0 -4
  282. package/lib/api/components/error/error.component.d.ts +0 -12
  283. package/lib/api/components/error/kverror.module.d.ts +0 -10
  284. package/lib/api/components/table/action-item.d.ts +0 -5
  285. package/lib/api/components/table/kv-menuitem.d.ts +0 -9
  286. package/lib/api/components/table/table.config.column.d.ts +0 -21
  287. package/lib/api/components/table/table.config.d.ts +0 -17
  288. package/lib/api/components/table/table.paginate.d.ts +0 -6
  289. package/lib/api/helpers/component-providers.d.ts +0 -2
  290. package/lib/api/helpers/keevo-validators.d.ts +0 -10
  291. package/lib/api/helpers/translate-primeng.d.ts +0 -4
  292. package/lib/api/models/menu/menu.model.d.ts +0 -10
  293. package/lib/api/models/menu/sistemamenu.model.d.ts +0 -8
  294. package/lib/api/modules/primeng.module.d.ts +0 -60
  295. package/lib/api/services/base.api.service.d.ts +0 -25
  296. package/lib/api/services/component.service.d.ts +0 -11
  297. package/lib/api/services/form.service.d.ts +0 -27
  298. package/lib/api/services/imagens.service.d.ts +0 -8
  299. package/lib/api/services/notification.service.d.ts +0 -25
  300. package/lib/api/services/object.service.d.ts +0 -8
  301. package/lib/buttons/button-personalize/button-personalize.component.d.ts +0 -7
  302. package/lib/buttons/button-popup/button-popup.component.d.ts +0 -13
  303. package/lib/buttons/button-secondary/button-secondary.component.d.ts +0 -7
  304. package/lib/buttons/button-success/button-success.component.d.ts +0 -7
  305. package/lib/buttons/kvbutton.module.d.ts +0 -11
  306. package/lib/chart/chart.component.d.ts +0 -56
  307. package/lib/chart/kvchart.module.d.ts +0 -10
  308. package/lib/directives/template.directive.d.ts +0 -11
  309. package/lib/inputs/check/check.component.d.ts +0 -11
  310. package/lib/inputs/dropdown/dropdown.component.d.ts +0 -14
  311. package/lib/inputs/editor/editor.component.d.ts +0 -39
  312. package/lib/inputs/input-calendar/input-calendar.component.d.ts +0 -27
  313. package/lib/inputs/input-mask/input-mask.component.d.ts +0 -10
  314. package/lib/inputs/input-number/input-number.component.d.ts +0 -19
  315. package/lib/inputs/input-password/input-password.component.d.ts +0 -13
  316. package/lib/inputs/input-text/input-text.component.d.ts +0 -9
  317. package/lib/inputs/input-text-checkbox/input-text-checkbox.component.d.ts +0 -15
  318. package/lib/inputs/input-textarea/input-textarea.component.d.ts +0 -16
  319. package/lib/inputs/input-time/input-time.component.d.ts +0 -10
  320. package/lib/inputs/kvinputs.module.d.ts +0 -25
  321. package/lib/inputs/multi-select/multi-select.component.d.ts +0 -12
  322. package/lib/inputs/radio-group/radio-group.component.d.ts +0 -18
  323. package/lib/inputs/switch/switch.component.d.ts +0 -13
  324. package/lib/keevo-components.module.d.ts +0 -19
  325. package/lib/label/label.component.d.ts +0 -7
  326. package/lib/label/label.module.d.ts +0 -8
  327. package/lib/loader/loader.component.d.ts +0 -10
  328. package/lib/loader/loader.module.d.ts +0 -9
  329. package/lib/loader/loader.service.d.ts +0 -10
  330. package/lib/login/kvlogin.module.d.ts +0 -13
  331. package/lib/login/login.component.d.ts +0 -30
  332. package/lib/menu/kvmenu.module.d.ts +0 -12
  333. package/lib/menu/menu.component.d.ts +0 -74
  334. package/lib/orgchart/orgchart.component.d.ts +0 -27
  335. package/lib/orgchart/orgchart.module.d.ts +0 -9
  336. package/lib/page-form/kv-page-form.module.d.ts +0 -11
  337. package/lib/page-form/page-form.component.d.ts +0 -69
  338. package/lib/picklist/kvpicklist.module.d.ts +0 -10
  339. package/lib/picklist/picklist.component.d.ts +0 -20
  340. package/lib/pipes/codigofile.pipe.d.ts +0 -7
  341. package/lib/pipes/cpfcnpj.pipe.d.ts +0 -7
  342. package/lib/pipes/pipes.module.d.ts +0 -10
  343. package/lib/pipes/telefone.pipe.d.ts +0 -7
  344. package/lib/table/kvtable.module.d.ts +0 -10
  345. package/lib/table/table.component.d.ts +0 -104
  346. package/lib/tree-table/kv-treetable.component.d.ts +0 -84
  347. package/lib/tree-table/kv-treetable.module.d.ts +0 -11
  348. package/lib/tree-view/kvtree-view.module.d.ts +0 -9
  349. package/lib/tree-view/tree-view.component.d.ts +0 -14
  350. package/lib/workspace/kvworkspace.module.d.ts +0 -13
  351. package/lib/workspace/workspace.component.d.ts +0 -28
@@ -0,0 +1,28 @@
1
+ /* tslint:disable:no-unused-variable */
2
+ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3
+ import { By } from '@angular/platform-browser';
4
+ import { DebugElement } from '@angular/core';
5
+
6
+ import { TableComponent } from './table.component';
7
+
8
+ describe('TableComponent', () => {
9
+ let component: TableComponent;
10
+ let fixture: ComponentFixture<TableComponent>;
11
+
12
+ beforeEach(async(() => {
13
+ TestBed.configureTestingModule({
14
+ declarations: [ TableComponent ]
15
+ })
16
+ .compileComponents();
17
+ }));
18
+
19
+ beforeEach(() => {
20
+ fixture = TestBed.createComponent(TableComponent);
21
+ component = fixture.componentInstance;
22
+ fixture.detectChanges();
23
+ });
24
+
25
+ it('should create', () => {
26
+ expect(component).toBeTruthy();
27
+ });
28
+ });
@@ -0,0 +1,546 @@
1
+ import { DatePipe, DecimalPipe } from '@angular/common';
2
+ import {
3
+ Component,
4
+ ContentChildren,
5
+ ElementRef,
6
+ EventEmitter,
7
+ HostListener,
8
+ Input,
9
+ OnInit,
10
+ Output,
11
+ QueryList,
12
+ Renderer2,
13
+ TemplateRef,
14
+ ViewChild,
15
+ } from '@angular/core';
16
+ import { Table } from 'primeng/table';
17
+ import { TableConfig } from '../api/components/table/table.config';
18
+ import { TableConfigColumn } from '../api/components/table/table.config.column';
19
+ import { TablePaginate } from '../api/components/table/table.paginate';
20
+ import { TemplateDirective } from '../directives/template.directive';
21
+ import { CodigoFipePipe } from '../pipes/codigofile.pipe';
22
+ import { CpfCnpjPipe } from '../pipes/cpfcnpj.pipe';
23
+ import { TelefonePipe } from '../pipes/telefone.pipe';
24
+ import { KvMenuItem } from '../api/components/table/kv-menuitem';
25
+ import { DomSanitizer } from '@angular/platform-browser';
26
+
27
+ const imgDefault = '/9j/4AAQSkZJRgABAQIAdgB2AAD/4QBiRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAMAAAITAAMAAAABAAEAAAAAAAAAAAB2AAAAAQAAAHYAAAAB/9sAQwADAgICAgIDAgICAwMDAwQGBAQEBAQIBgYFBgkICgoJCAkJCgwPDAoLDgsJCQ0RDQ4PEBAREAoMEhMSEBMPEBAQ/9sAQwEDAwMEAwQIBAQIEAsJCxAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQ/8AAEQgAkACQAwERAAIRAQMRAf/EAB0AAQABBAMBAAAAAAAAAAAAAAAGAQIHCAMECQX/xABBEAACAQQABQICCAQDBAsAAAABAgMABAURBgcSITETQQhRCRQVGSJVldEyYYGRQlJiFiM3OF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scr4KyfCy4YGbcBxZgOJog2IyMcsgQO8Dfhlj7KTtT3IBYAsNrvwTXRSamVUK8t+3Hr4Ofm086T+5DbF/flfPNXxtmk8D69ZzCVDGpIsV6hQWGx86EWGx86Cw6hQmxQsaCxSoJPkZ/i3h/hmMtl8jHFIULpAv4pZOzEaUdxsqQGOl35IrBPqZVOrzH7cevgzSqebP8A24b4pcMOdss3xtkm8DCPGPMDL8XS+mS1nYBQBaRykqx2Dtz26zsDWxoaGhvZPO1VbMqnZ4LT86nRUtBLpknFaKLW3rlnbB2evwRetM3hQCgFAKAUAoC6GaW3lSeCV45Y2Do6MQysDsEEeCDUpuF3RDSiVnkTzh7nFn8VELbLQJlYlXSM7+nKOwA24B6h2PkFiTsmrKTtSbLVo1vL56+fMq5+ypcx3lvd14rjy+rK1if4zmxwXkelZL6WykeT01S6hK78aYsvUqjv5LDWjvQ71Zy9pU8x2vb16ZWzNnVEtXtf06T+CS2GWxWVEhxeStbwRa9T0Jlk6N71vpJ1vR/sa3IJkEzwNP0dzTjlxy7KNNX1O3WQ8CgOpf5fE4ro+08naWfq7KevMsfVrzrqI35H96xxzIJfjaXqzJBLjmeBN+iI1k+a/BeN6lS/lvZElMbJaxFvG9sGbpRl7eQx3sa2O9aczaVPLdr39Ol8G1L2dUTFe1vXptciAcQc4s/lYjbYmBMVEy6dkf1JTsEHTkAKO48DqBGw1Vk/ak2ZhB+lfPMtJGypct70x72nBcOfHyxy4kDmmmuJnuLiV5ZZWLu7sWZmJ2SSe5JPvVa24ndlmkoVZZFtQSKAUAoD/9k=';
28
+
29
+ @Component({
30
+ selector: 'kv-table',
31
+ templateUrl: './table.component.html',
32
+ styleUrls: ['./table.component.scss'],
33
+ })
34
+ export class TableComponent implements OnInit {
35
+ config!: TableConfig;
36
+ pesquisaValue!: string;
37
+ globalFilterFields: string[] = [];
38
+ actionsTemplate!: TemplateRef<any>;
39
+
40
+ selectedSize: string = '';
41
+
42
+ tamanhoTela!: number;
43
+
44
+ menuItems: KvMenuItem[] = [];
45
+ menuColumns: KvMenuItem[] = [];
46
+
47
+ checked: boolean = true;
48
+
49
+ columns: TableConfigColumn[] = [];
50
+ deletedColuns: TableConfigColumn[] = [];
51
+
52
+ menuFiltro: boolean = false;
53
+ checkboxClicked: boolean = false;
54
+
55
+ showFiltrosAvancados: boolean = false;
56
+
57
+ @ContentChildren(TemplateDirective) templates!: QueryList<any>;
58
+ @Input('templates') _templates!: any;
59
+
60
+ @ViewChild('table', { static: false }) table!: Table;
61
+ deletedColumnsIndex!: any[];
62
+
63
+ @Input('config') set setConfig(value: TableConfig) {
64
+ this.config = {
65
+ enableCation: value.enableCation || true,
66
+ enableSelect: value.enableSelect || false,
67
+ enableFilter: value.enableFilter || true,
68
+ ...value,
69
+ };
70
+
71
+ if (this.config.enableFilter) {
72
+ this.config.columns.forEach((col) => {
73
+ this.globalFilterFields.push(col.field);
74
+ });
75
+ }
76
+ }
77
+
78
+ @Input() dataSource: any;
79
+ @Input() selectedItems: any[] = [];
80
+ @Input() totalRecords!: number;
81
+ @Input() paginator: boolean = true;
82
+ @Input() rowsPerPageOptions!: number[];
83
+ @Input() rows: number = 5;
84
+ @Input() pageLinksOptions: number = 1;
85
+ @Input() showFirstLastIcon: boolean = false;
86
+ @Input() tableSize!: number;
87
+ @Input() applyStyle: Function = (rowData: any, col: TableConfigColumn) => '';
88
+ @Input() acoesLinhaTabela: boolean = true;
89
+ @Input() filterColumnsBtn: boolean = false;
90
+ @Input() filtrosAvancados: boolean = false;
91
+
92
+ @Output() onActiveItem: EventEmitter<any> = new EventEmitter();
93
+ @Output() onActiveItemLote: EventEmitter<any> = new EventEmitter();
94
+ @Output() onPaginate: EventEmitter<any> = new EventEmitter();
95
+ @Output() onSelectionChange: EventEmitter<any> = new EventEmitter();
96
+ @Output() doubleClickEvent: EventEmitter<any> = new EventEmitter();
97
+ @Output() filterField: EventEmitter<any> = new EventEmitter();
98
+ @Output() filtrosAvancadosEmit: EventEmitter<boolean> = new EventEmitter();
99
+
100
+
101
+
102
+ @ViewChild('menuFiltroDiv') menuFiltroDiv!: ElementRef;
103
+ @ViewChild('botaoFiltro') botaoFiltro!: ElementRef;
104
+
105
+ constructor(
106
+ private readonly datePipe: DatePipe,
107
+ private readonly decimalPipe: DecimalPipe,
108
+ private readonly codigoFipePipe: CodigoFipePipe,
109
+ private readonly cpfCnpjPipe: CpfCnpjPipe,
110
+ private readonly telefonePipe: TelefonePipe,
111
+ private renderer: Renderer2,
112
+ private elementRef: ElementRef,
113
+ private sanitizer: DomSanitizer
114
+ ) {
115
+ this.isRowSelectable = this.isRowSelectable.bind(this);
116
+ }
117
+
118
+ ngOnInit() {
119
+ this.adjustTableSize();
120
+ this.tamanhoTela = window.innerWidth;
121
+ // this.criarMenuColumns();
122
+ this.config.columns.forEach((col: any) => {
123
+ this.columns.push(col);
124
+ });
125
+ this.checkHideColumns();
126
+ }
127
+
128
+ @HostListener('window:resize', ['$event'])
129
+ onWindowResize() {
130
+ this.adjustTableSize();
131
+ this.tamanhoTela = window.innerWidth;
132
+ }
133
+
134
+ public activeItem(rowData: any) {
135
+ this.onActiveItem.emit(rowData);
136
+ }
137
+
138
+ public activeItemLote(rowData: any) {
139
+ this.onActiveItemLote.emit(rowData);
140
+ }
141
+
142
+ isBooleanField(rowData: any, col: TableConfigColumn): boolean {
143
+ return typeof rowData[col.field] == 'boolean';
144
+ }
145
+
146
+ isChipField(col: TableConfigColumn): boolean {
147
+ return col.fieldType == 'chip';
148
+ }
149
+
150
+ isImageField(col: TableConfigColumn): boolean {
151
+ let retorno = col.fieldType && col.fieldType === 'image' ? true : false;
152
+ return retorno;
153
+ }
154
+
155
+ // isVisibleCheckbox(rowData: any): boolean {
156
+ // return this.config.visibleControlCheckboxFunction? this.config.visibleControlCheckboxFunction(rowData): true;
157
+ // }
158
+
159
+ isRowSelectable(event: any) {
160
+ return !this.isDisabledCheckbox(event.data);;
161
+ }
162
+ isDisabledCheckbox(rowData: any): boolean {
163
+ return this.config.disableControlCheckboxFunction ? this.config.disableControlCheckboxFunction(rowData) : false;
164
+ }
165
+
166
+ loadImage(rowData: any, col: TableConfigColumn): string {
167
+ /*
168
+ Nossa coluna de imagem trabalha com strings do tipo: base64 ou url
169
+ */
170
+ let retorno = `data:image/jpg;base64, ${imgDefault}`;
171
+ if (rowData && col && rowData[col.field] && rowData[col.field] !== '') {
172
+ if (rowData[col.field].includes('http'))
173
+ retorno = rowData[col.field];
174
+ else
175
+ retorno = `data:image/jpg;base64, ${rowData[col.field]}`;
176
+ }
177
+
178
+ return retorno;
179
+ }
180
+
181
+ public onGlobalFilter(table: Table, event: Event) {
182
+ this.filterField.emit((event.target as HTMLInputElement).value);
183
+ table.filterGlobal((event.target as HTMLInputElement).value, 'contains');
184
+ }
185
+
186
+ public paginate(event: any) {
187
+ if (event) {
188
+ let paginaInicial =
189
+ (event?.first > 0 ? event.first / event.rows : event.first) + 1;
190
+ let termoPesquisa = '';
191
+ let ordenacao = '';
192
+
193
+ if (event.globalFilter) termoPesquisa = event.globalFilter;
194
+
195
+ if (event.sortField)
196
+ ordenacao = `${event.sortField} ${event.sortOrder === 1 ? 'ASC' : 'DESC'
197
+ }`;
198
+
199
+ const objeto: TablePaginate = {
200
+ paginaInicial: paginaInicial,
201
+ tamanhoPagina: event.rows,
202
+ termoPesquisa: termoPesquisa,
203
+ ordenacao: ordenacao,
204
+ };
205
+
206
+ this.onPaginate.emit(objeto);
207
+ }
208
+ }
209
+
210
+ selectionChange(value = []) {
211
+ this.onSelectionChange.emit(value);
212
+ }
213
+
214
+ returnRowClass(rowData: any, col: TableConfigColumn) {
215
+ let value = rowData[col.field];
216
+ let rowClass: string;
217
+
218
+ this.tableSize > 800 ? (rowClass = 'text-base') : (rowClass = 'text-sm');
219
+
220
+ if (col.expiredDate == true) {
221
+ new Date(value) < new Date()
222
+ ? (rowClass = rowClass + ' text-red-400 font-semibold')
223
+ : '';
224
+ }
225
+ return rowClass;
226
+ }
227
+
228
+ expiredFile(rowData: any, col: TableConfigColumn): boolean {
229
+ let value = rowData['datavencimento'];
230
+ return new Date(value) < new Date() && col.field == 'area';
231
+ }
232
+
233
+ transformValue(rowData: any, col: TableConfigColumn) {
234
+ let value = rowData[col.field];
235
+
236
+ if (value != null) {
237
+ if (!col.pipe) {
238
+ return value;
239
+ }
240
+
241
+ switch (col.pipe) {
242
+ case 'date':
243
+ return this.datePipe.transform(value, 'dd/MM/yyyy');
244
+ case 'decimal':
245
+ return this.decimalPipe.transform(value, '1.2-2', 'pt-BR');
246
+ case 'cpfcnpj':
247
+ return this.cpfCnpjPipe.transform(value);
248
+ case 'telefone':
249
+ return this.telefonePipe.transform(value);
250
+ case 'codigofipe':
251
+ return this.codigoFipePipe.transform(value);
252
+ case 'money':
253
+ return this.formatarValor(value);
254
+ case 'percentage':
255
+ return `${value} %`;
256
+
257
+ default:
258
+ break;
259
+ }
260
+ }
261
+ }
262
+
263
+ formatarValor(valor: number): string {
264
+ const formatter = new Intl.NumberFormat('pt-BR', {
265
+ style: 'currency',
266
+ currency: 'BRL',
267
+ });
268
+
269
+ return formatter.format(valor);
270
+ }
271
+
272
+ adjustTableSize() {
273
+ if (this.tableSize < 800) {
274
+ this.selectedSize = 'p-datatable-sm';
275
+ } else {
276
+ this.selectedSize = '';
277
+ }
278
+ }
279
+
280
+ doubleClick(e: any, rowData: any) {
281
+ let eventDoubleClick = { event: e, rowData: rowData };
282
+
283
+ let array: string[] = [];
284
+ e.target.classList.forEach((x: any) => array.push(x));
285
+
286
+ if (array.find((x: any) => x == 'ng-star-inserted') != undefined)
287
+ this.doubleClickEvent.emit(eventDoubleClick);
288
+ }
289
+
290
+ centralizarColunas(col: any): string {
291
+ if (col.centralize) {
292
+ return 'text-align: center';
293
+ } else return '';
294
+ }
295
+
296
+ alignColunas(col: any): string {
297
+ if (col.align) {
298
+ return `text-align: ${col.align}`;
299
+ } else return '';
300
+ }
301
+
302
+ alignColunasHeader(col: any): string {
303
+ if (col.align) {
304
+ if (col.align == 'right') return 'justify-content: end';
305
+ else return '';
306
+ } else return '';
307
+ }
308
+
309
+ retornarCampo(action: KvMenuItem, rowData: any, field: string): string {
310
+ const _function = action.dynamicfields
311
+ ? (action.dynamicfields[field] as Function)
312
+ : null;
313
+ const _field: string = _function
314
+ ? _function.apply(action, [rowData])
315
+ : action[field];
316
+ return _field;
317
+ }
318
+
319
+ retornarRow(rowData: any, col: any, field: string): string {
320
+ const _rowaction = this.config.rows ? this.config.rows[col.field] : null;
321
+ const _field: string =
322
+ _rowaction && _rowaction[field]
323
+ ? _rowaction[field].constructor === Function
324
+ ? _rowaction[field].apply(this, [rowData])
325
+ : _rowaction[field]
326
+ : null;
327
+ return _field;
328
+ }
329
+
330
+ exibirCampo(field: any, rowData: any) {
331
+ let visible = field.visible ? field.visible(rowData) : true;
332
+
333
+ // if (field != undefined && field != null && field != '') {
334
+ // const value = rowData[field];
335
+ // return value;
336
+ // }
337
+ return visible;
338
+ }
339
+
340
+ criarMenusModal(data: any) {
341
+ if (this.config.actions && data) {
342
+ const items = this.config.actions.map((action) => {
343
+ const icon = this.retornarCampo(action, data, 'icon');
344
+ const tooltip = this.retornarCampo(action, data, 'tooltip');
345
+ const tooltipPosition = this.retornarCampo(action, data, 'tooltipPosition');
346
+ const label = this.retornarCampo(action, data, 'label');
347
+ const command: any = this.retornarCampo(action, data, 'command');
348
+ const visible: boolean = action.visible ? action.visible(data) : true;
349
+ const disabled: boolean = action.disabled
350
+ ? action.disabled(data)
351
+ : false;
352
+
353
+ const menuInsert: KvMenuItem = {
354
+ label,
355
+ icon,
356
+ tooltip,
357
+ tooltipPosition,
358
+ command,
359
+ disabled,
360
+ visible,
361
+ };
362
+
363
+ let item = this.menuItems.filter(
364
+ (x) => x.command == menuInsert.command
365
+ );
366
+
367
+ if (item.length == 0) this.menuItems.push(menuInsert);
368
+ else {
369
+ if (menuInsert.label != item[0].label) {
370
+ let index = this.menuItems.indexOf(item[0]);
371
+ this.menuItems.splice(index, 1);
372
+ }
373
+
374
+ if (menuInsert.visible != item[0].visible) {
375
+ let index = this.menuItems.indexOf(item[0]);
376
+ this.menuItems.splice(index, 1);
377
+ }
378
+
379
+ if (menuInsert.disabled != item[0].disabled) {
380
+ let index = this.menuItems.indexOf(item[0]);
381
+ this.menuItems.splice(index, 1);
382
+ }
383
+ }
384
+ });
385
+ }
386
+ }
387
+
388
+ returnClassChip(rowData: any, col: any): string {
389
+ return `chip-style w-auto border-round-2xl p-2 text-${this.retornarRow(
390
+ rowData,
391
+ col,
392
+ 'stylechip'
393
+ )} border-${this.retornarRow(rowData, col, 'stylechip')}`;
394
+ }
395
+
396
+ returnClassIcon(rowData: any, col: any): string {
397
+ return this.retornarRow(rowData, col, 'iconrow');
398
+ }
399
+
400
+ returnTooltipIcon(rowData: any, col: any): string {
401
+ return this.retornarRow(rowData, col, 'tooltipiconrow');
402
+ }
403
+
404
+ deleteColumn(field: string) {
405
+ let index: number;
406
+
407
+ let column: TableConfigColumn | undefined = this.config.columns.find(
408
+ (x: TableConfigColumn) => x.field == field
409
+ );
410
+ if (column) {
411
+ index = this.config.columns.indexOf(column);
412
+ this.config.columns.splice(index, 1);
413
+ this.deletedColuns.push(column);
414
+ }
415
+ }
416
+
417
+ addColumn(field: string) {
418
+ let index: number;
419
+
420
+ let column: TableConfigColumn | undefined = this.config.columns.find(
421
+ (x: TableConfigColumn) => x.field == field
422
+ );
423
+
424
+ if (!column) {
425
+ let deletedColumn: TableConfigColumn | undefined =
426
+ this.deletedColuns.find((x: TableConfigColumn) => x.field == field);
427
+
428
+ if (deletedColumn != undefined) {
429
+ index = this.deletedColuns.indexOf(deletedColumn);
430
+ this.deletedColuns.slice(index, 1);
431
+ this.config.columns.push(deletedColumn);
432
+ }
433
+ }
434
+ }
435
+
436
+ dinamicColumnSet(e: any, col: any) {
437
+ col.checked = e.checked;
438
+ if (e.checked) this.addColumn(col.field);
439
+ else this.deleteColumn(col.field);
440
+
441
+ if (col.position) this.config.columns.sort(this.sortByPosition());
442
+ }
443
+
444
+ // abrirMenuFiltro(e: any) {
445
+ // this.menuFiltro = !this.menuFiltro;
446
+ // this.checkboxClicked = false;
447
+
448
+ // if (this.tamanhoTela < 700)
449
+ // this.styleSetter('left', (this.botaoFiltro.nativeElement.offsetLeft - 288) + 'px')
450
+ // else
451
+ // this.styleSetter('left', (this.botaoFiltro.nativeElement.offsetLeft + 40) + 'px')
452
+
453
+ // this.styleSetter('top', this.botaoFiltro.nativeElement.offsetTop + 'px')
454
+ // this.styleSetter('visibility', this.menuFiltro ? 'visible' : 'hidden')
455
+ // }
456
+
457
+ // fecharMenuFiltro() {
458
+ // this.menuFiltro = false;
459
+ // this.checkboxClicked = false;
460
+
461
+ // this.styleSetter('visibility', 'hidden')
462
+ // }
463
+
464
+ // @HostListener('document:keydown.escape', ['$event'])
465
+ // onEscapeKey(event: KeyboardEvent) {
466
+ // if (this.filterColumnsBtn == true && this.menuFiltro == true) {
467
+ // this.fecharMenuFiltro();
468
+ // }
469
+ // }
470
+
471
+ // @HostListener('document:click', ['$event'])
472
+ // onClickEvent(event: any) {
473
+ // if (this.filterColumnsBtn == true && this.menuFiltro == true) {
474
+ // const clickedElement = event.target as HTMLElement;
475
+ // const menuFiltroDiv =
476
+ // this.elementRef.nativeElement.querySelector('#menuFiltroDiv');
477
+ // const botaoFiltro =
478
+ // this.elementRef.nativeElement.querySelector('#botaoFiltro');
479
+ // const isCheckboxClicked =
480
+ // clickedElement.classList.toString().includes('p-checkbox') ||
481
+ // event.target.classList.toString() == '';
482
+ // const isInsideMenu =
483
+ // menuFiltroDiv?.contains(clickedElement) ||
484
+ // botaoFiltro?.contains(clickedElement) ||
485
+ // isCheckboxClicked;
486
+
487
+ // if (!isInsideMenu) this.fecharMenuFiltro();
488
+ // }
489
+ // }
490
+
491
+ checkMenuFiltro(col: any) {
492
+ let deletedColumn: TableConfigColumn | undefined = this.deletedColuns.find(
493
+ (x: TableConfigColumn) => x.field == col.field
494
+ );
495
+ if (deletedColumn) col.checked = false;
496
+ else col.checked = true;
497
+ }
498
+
499
+ sortByPosition() {
500
+ return function (elem1: any, elem2: any) {
501
+ if (elem1.position < elem2.position) {
502
+ return -1;
503
+ } else if (elem1.position > elem2.position) {
504
+ return 1;
505
+ } else {
506
+ return 0;
507
+ }
508
+ };
509
+ }
510
+
511
+ callDisabled(action: KvMenuItem, data: any): boolean {
512
+ if (action?.disabled) {
513
+ return action.disabled(data);
514
+ }
515
+ return false;
516
+ }
517
+
518
+ dinamicDisableColumn(col: TableConfigColumn): boolean {
519
+ if (col.fixedColumn) return col.fixedColumn;
520
+ else return false;
521
+ }
522
+
523
+ checkHideColumns() {
524
+ let hideColumnsConfig = this.columns.filter(
525
+ (col) => col.hideColumn == true
526
+ );
527
+ hideColumnsConfig.forEach((col) => this.deleteColumn(col.field));
528
+ }
529
+
530
+ getCustomTemplate(templatename: string): TemplateRef<any> {
531
+ return this._templates[templatename];
532
+ }
533
+
534
+ // styleSetter(style: string, data: string) {
535
+ // this.renderer?.setStyle(
536
+ // this.menuFiltroDiv.nativeElement,
537
+ // style,
538
+ // data
539
+ // );
540
+ // }
541
+
542
+ filtrosAvancadosEvent(e: any) {
543
+ this.showFiltrosAvancados = !this.showFiltrosAvancados;
544
+ this.filtrosAvancadosEmit.emit(this.showFiltrosAvancados)
545
+ }
546
+ }