@sankhyalabs/sankhyablocks 8.15.0-rc.8 → 8.15.0

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 (237) hide show
  1. package/dist/cjs/{ConfigStorage-d4c99a5e.js → ConfigStorage-942ce74b.js} +70 -7
  2. package/dist/cjs/{DataFetcher-99f0f6ed.js → DataFetcher-313debd8.js} +13 -5
  3. package/dist/cjs/{SnkFormConfigManager-3621bfc4.js → SnkFormConfigManager-f9dc0d28.js} +21 -13
  4. package/dist/cjs/{SnkMessageBuilder-e7dcf408.js → SnkMessageBuilder-66aa2557.js} +6 -1
  5. package/dist/cjs/SnkMultiSelectionListDataSource-303e85d1.js +140 -0
  6. package/dist/cjs/{auth-fetcher-5161d082.js → auth-fetcher-54f5ff9d.js} +1 -1
  7. package/dist/cjs/{form-config-fetcher-9f1a13ca.js → form-config-fetcher-2dd00e5b.js} +13 -1
  8. package/dist/cjs/index-f9e81701.js +2 -10
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{pesquisa-fetcher-8bbee432.js → pesquisa-fetcher-213797ec.js} +273 -50
  11. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  12. package/dist/cjs/{snk-actions-button_2.cjs.entry.js → snk-actions-button_4.cjs.entry.js} +519 -4
  13. package/dist/cjs/snk-application.cjs.entry.js +13 -8
  14. package/dist/cjs/snk-attach.cjs.entry.js +67 -47
  15. package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
  16. package/dist/cjs/snk-crud.cjs.entry.js +26 -18
  17. package/dist/cjs/snk-custom-slot-elements.cjs.entry.js +6 -2
  18. package/dist/cjs/snk-data-exporter.cjs.entry.js +10 -6
  19. package/dist/cjs/{snk-data-unit-82c08a8c.js → snk-data-unit-41c29713.js} +1 -1
  20. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  21. package/dist/cjs/snk-detail-view.cjs.entry.js +9 -10
  22. package/dist/cjs/snk-filter-bar.cjs.entry.js +31 -7
  23. package/dist/cjs/snk-filter-detail.cjs.entry.js +4 -1
  24. package/dist/cjs/snk-filter-item.cjs.entry.js +10 -6
  25. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  26. package/dist/cjs/snk-form-config.cjs.entry.js +8 -2
  27. package/dist/cjs/snk-form.cjs.entry.js +11 -4
  28. package/dist/cjs/snk-grid.cjs.entry.js +41 -22
  29. package/dist/cjs/{snk-guides-viewer-100c3098.js → snk-guides-viewer-4b6ecda8.js} +21 -12
  30. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -8
  31. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  32. package/dist/cjs/snk-simple-crud.cjs.entry.js +256 -22
  33. package/dist/cjs/snk-taskbar.cjs.entry.js +75 -17
  34. package/dist/cjs/{taskbar-elements-1e4fb2e0.js → taskbar-elements-3ecd1278.js} +1 -1
  35. package/dist/collection/collection-manifest.json +6 -6
  36. package/dist/collection/components/snk-application/snk-application.js +42 -2
  37. package/dist/collection/components/snk-attach/snk-attach.js +39 -24
  38. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +1 -1
  39. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +29 -22
  40. package/dist/collection/components/snk-configurator/snk-configurator.js +1 -1
  41. package/dist/collection/components/snk-crud/snk-crud.js +71 -11
  42. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -2
  43. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +50 -7
  44. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.css +1 -1
  45. package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.js +22 -1
  46. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +7 -3
  47. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +22 -1
  48. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +28 -6
  49. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +2 -1
  50. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +44 -3
  51. package/dist/collection/components/snk-form/snk-form.js +25 -1
  52. package/dist/collection/components/{snk-form → snk-form-config}/SnkFormConfigManager.js +20 -12
  53. package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.js +11 -5
  54. package/dist/collection/components/snk-grid/snk-grid.js +86 -16
  55. package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.js +130 -123
  56. package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.js +1 -1
  57. package/dist/collection/components/snk-simple-crud/regular-buttons.js +3 -0
  58. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +10 -2
  59. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +421 -17
  60. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +1 -1
  61. package/dist/collection/components/snk-taskbar/snk-taskbar.js +91 -16
  62. package/dist/collection/lib/configs/ConfigStorage.js +63 -3
  63. package/dist/collection/lib/dataUnit/InMemoryLoader.js +9 -40
  64. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +33 -0
  65. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +13 -5
  66. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +12 -0
  67. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +6 -3
  68. package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +2 -1
  69. package/dist/collection/lib/message/resources/snk-simple-crud.msg.js +4 -0
  70. package/dist/collection/lib/utils/CrudUtils.js +13 -1
  71. package/dist/components/ConfigStorage.js +68 -5
  72. package/dist/components/DataFetcher.js +13 -5
  73. package/dist/components/SnkFormConfigManager.js +19 -11
  74. package/dist/components/SnkMessageBuilder.js +6 -1
  75. package/dist/components/dataunit-fetcher.js +41 -39
  76. package/dist/components/field-search.js +93 -3
  77. package/dist/components/form-config-fetcher.js +12 -0
  78. package/dist/components/index.d.ts +6 -6
  79. package/dist/components/snk-application2.js +9 -1
  80. package/dist/components/snk-attach2.js +115 -52
  81. package/dist/components/snk-configurator2.js +1 -1
  82. package/dist/components/snk-crud.js +23 -11
  83. package/dist/components/snk-custom-slot-elements.js +7 -3
  84. package/dist/components/snk-data-exporter2.js +7 -3
  85. package/dist/components/snk-detail-view2.js +48 -11
  86. package/dist/components/snk-filter-bar2.js +29 -4
  87. package/dist/components/snk-filter-detail2.js +5 -1
  88. package/dist/components/snk-filter-item2.js +11 -6
  89. package/dist/components/snk-form-config2.js +7 -1
  90. package/dist/components/snk-form.js +8 -0
  91. package/dist/components/snk-grid-config2.js +128 -102
  92. package/dist/components/snk-grid2.js +42 -18
  93. package/dist/components/snk-simple-crud2.js +317 -29
  94. package/dist/components/snk-taskbar2.js +81 -20
  95. package/dist/esm/{ConfigStorage-39ed8aeb.js → ConfigStorage-86187da3.js} +70 -7
  96. package/dist/esm/{DataFetcher-a650ae58.js → DataFetcher-c1baf61d.js} +13 -5
  97. package/dist/esm/{SnkFormConfigManager-692e20c7.js → SnkFormConfigManager-f53f9f87.js} +21 -13
  98. package/dist/esm/{SnkMessageBuilder-0fb796b9.js → SnkMessageBuilder-0a4becdd.js} +6 -1
  99. package/dist/esm/SnkMultiSelectionListDataSource-36918dbf.js +133 -0
  100. package/dist/esm/{auth-fetcher-17dc5b5e.js → auth-fetcher-039abba3.js} +1 -1
  101. package/dist/esm/{form-config-fetcher-f121f880.js → form-config-fetcher-30fb808f.js} +13 -1
  102. package/dist/esm/index-a7d3d3f1.js +2 -10
  103. package/dist/esm/loader.js +1 -1
  104. package/dist/esm/{pesquisa-fetcher-5a8cae10.js → pesquisa-fetcher-fe6f3826.js} +262 -43
  105. package/dist/esm/sankhyablocks.js +1 -1
  106. package/dist/esm/{snk-actions-button_2.entry.js → snk-actions-button_4.entry.js} +518 -5
  107. package/dist/esm/snk-application.entry.js +13 -8
  108. package/dist/esm/snk-attach.entry.js +66 -46
  109. package/dist/esm/snk-configurator.entry.js +1 -1
  110. package/dist/esm/snk-crud.entry.js +26 -18
  111. package/dist/esm/snk-custom-slot-elements.entry.js +7 -3
  112. package/dist/esm/snk-data-exporter.entry.js +10 -6
  113. package/dist/esm/{snk-data-unit-5d201fb3.js → snk-data-unit-de1d140d.js} +1 -1
  114. package/dist/esm/snk-data-unit.entry.js +2 -2
  115. package/dist/esm/snk-detail-view.entry.js +9 -10
  116. package/dist/esm/snk-filter-bar.entry.js +31 -7
  117. package/dist/esm/snk-filter-detail.entry.js +4 -1
  118. package/dist/esm/snk-filter-item.entry.js +10 -6
  119. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  120. package/dist/esm/snk-form-config.entry.js +9 -3
  121. package/dist/esm/snk-form.entry.js +11 -4
  122. package/dist/esm/snk-grid.entry.js +42 -23
  123. package/dist/esm/{snk-guides-viewer-36a01f1c.js → snk-guides-viewer-113be3fd.js} +21 -12
  124. package/dist/esm/snk-guides-viewer.entry.js +7 -8
  125. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  126. package/dist/esm/snk-simple-crud.entry.js +257 -23
  127. package/dist/esm/snk-taskbar.entry.js +76 -18
  128. package/dist/esm/{taskbar-elements-846c027c.js → taskbar-elements-2473c8ac.js} +1 -1
  129. package/dist/sankhyablocks/p-032fe52e.js +1 -0
  130. package/dist/sankhyablocks/p-07a61550.entry.js +1 -0
  131. package/dist/sankhyablocks/p-0899e0b5.entry.js +1 -0
  132. package/dist/sankhyablocks/p-14a08904.entry.js +1 -0
  133. package/dist/sankhyablocks/p-154a7f33.entry.js +1 -0
  134. package/dist/sankhyablocks/p-15802c59.entry.js +1 -0
  135. package/dist/sankhyablocks/p-164666b1.js +65 -0
  136. package/dist/sankhyablocks/p-21a81901.entry.js +1 -0
  137. package/dist/sankhyablocks/p-32556aa6.js +1 -0
  138. package/dist/sankhyablocks/p-328585d0.entry.js +1 -0
  139. package/dist/sankhyablocks/p-47bad461.entry.js +11 -0
  140. package/dist/sankhyablocks/{p-f3d1c48e.js → p-52c8e589.js} +1 -1
  141. package/dist/sankhyablocks/p-54a5d52a.entry.js +1 -0
  142. package/dist/sankhyablocks/p-5cb07080.js +1 -0
  143. package/dist/sankhyablocks/p-74d349c3.entry.js +1 -0
  144. package/dist/sankhyablocks/p-7663f597.entry.js +1 -0
  145. package/dist/sankhyablocks/{p-50783a8b.js → p-913a9979.js} +1 -1
  146. package/dist/sankhyablocks/{p-827e4b01.entry.js → p-a1d72395.entry.js} +1 -1
  147. package/dist/sankhyablocks/p-add17f6a.entry.js +1 -0
  148. package/dist/sankhyablocks/p-ae4fc9a9.js +1 -0
  149. package/dist/sankhyablocks/p-af1ac81f.entry.js +1 -0
  150. package/dist/sankhyablocks/p-aff76a53.js +56 -0
  151. package/dist/sankhyablocks/p-b4525fc0.entry.js +1 -0
  152. package/dist/sankhyablocks/p-cce0865d.js +1 -0
  153. package/dist/sankhyablocks/{p-be75153c.js → p-dc7c9047.js} +1 -1
  154. package/dist/sankhyablocks/p-dec65f6c.entry.js +1 -0
  155. package/dist/sankhyablocks/p-df5451c7.js +26 -0
  156. package/dist/sankhyablocks/p-e8763234.entry.js +1 -0
  157. package/dist/sankhyablocks/{p-9d608b62.entry.js → p-eae7a817.entry.js} +1 -1
  158. package/dist/sankhyablocks/p-ee9536bc.entry.js +1 -0
  159. package/dist/sankhyablocks/p-f13f7616.entry.js +1 -0
  160. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  161. package/dist/types/components/snk-application/snk-application.d.ts +8 -0
  162. package/dist/types/components/snk-attach/snk-attach.d.ts +2 -1
  163. package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +10 -1
  164. package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +5 -4
  165. package/dist/types/components/snk-crud/snk-crud.d.ts +12 -0
  166. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +1 -1
  167. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +11 -1
  168. package/dist/types/components/snk-custom-slot-elements/snk-custom-slot-elements.d.ts +6 -0
  169. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +4 -0
  170. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +6 -2
  171. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +8 -0
  172. package/dist/types/components/snk-form/snk-form.d.ts +6 -1
  173. package/dist/types/components/{snk-form → snk-form-config}/SnkFormConfigManager.d.ts +2 -1
  174. package/dist/types/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.d.ts +4 -3
  175. package/dist/types/components/snk-grid/snk-grid.d.ts +14 -1
  176. package/dist/types/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.d.ts +11 -6
  177. package/dist/types/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.d.ts +1 -1
  178. package/dist/types/components/snk-simple-crud/regular-buttons.d.ts +3 -0
  179. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +76 -3
  180. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
  181. package/dist/types/components.d.ts +171 -10
  182. package/dist/types/lib/configs/ConfigStorage.d.ts +21 -1
  183. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +0 -2
  184. package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +4 -0
  185. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +2 -0
  186. package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +2 -1
  187. package/dist/types/lib/utils/CrudUtils.d.ts +3 -0
  188. package/package.json +1 -1
  189. package/dist/cjs/PreloadManager-84466da6.js +0 -224
  190. package/dist/cjs/SnkMultiSelectionListDataSource-ba5838c2.js +0 -49
  191. package/dist/cjs/snk-grid-config.cjs.entry.js +0 -483
  192. package/dist/cjs/snk-select-box.cjs.entry.js +0 -25
  193. package/dist/esm/PreloadManager-c1c2f2b4.js +0 -222
  194. package/dist/esm/SnkMultiSelectionListDataSource-44494b0e.js +0 -43
  195. package/dist/esm/snk-grid-config.entry.js +0 -479
  196. package/dist/esm/snk-select-box.entry.js +0 -21
  197. package/dist/sankhyablocks/p-05243555.js +0 -1
  198. package/dist/sankhyablocks/p-094c30cb.js +0 -1
  199. package/dist/sankhyablocks/p-11ad137d.entry.js +0 -1
  200. package/dist/sankhyablocks/p-2ae395fe.entry.js +0 -1
  201. package/dist/sankhyablocks/p-3e2e2424.entry.js +0 -1
  202. package/dist/sankhyablocks/p-3e91d5ea.entry.js +0 -1
  203. package/dist/sankhyablocks/p-453c01a8.entry.js +0 -1
  204. package/dist/sankhyablocks/p-5e681b7b.js +0 -65
  205. package/dist/sankhyablocks/p-5f74c859.entry.js +0 -1
  206. package/dist/sankhyablocks/p-67aedbe0.js +0 -56
  207. package/dist/sankhyablocks/p-69754d94.entry.js +0 -1
  208. package/dist/sankhyablocks/p-725d04ba.js +0 -1
  209. package/dist/sankhyablocks/p-86801b08.entry.js +0 -1
  210. package/dist/sankhyablocks/p-8c13d8d6.entry.js +0 -1
  211. package/dist/sankhyablocks/p-8c49760e.js +0 -1
  212. package/dist/sankhyablocks/p-98674137.entry.js +0 -1
  213. package/dist/sankhyablocks/p-a13ccb86.js +0 -26
  214. package/dist/sankhyablocks/p-bf658a8a.entry.js +0 -11
  215. package/dist/sankhyablocks/p-c143a240.js +0 -1
  216. package/dist/sankhyablocks/p-c22c1d8e.js +0 -1
  217. package/dist/sankhyablocks/p-c4874327.entry.js +0 -1
  218. package/dist/sankhyablocks/p-d0844d18.entry.js +0 -1
  219. package/dist/sankhyablocks/p-d6317851.entry.js +0 -1
  220. package/dist/sankhyablocks/p-d7cda92f.entry.js +0 -1
  221. package/dist/sankhyablocks/p-d7d85fa9.entry.js +0 -1
  222. package/dist/sankhyablocks/p-e3bd000e.entry.js +0 -1
  223. package/dist/sankhyablocks/p-ee619e29.entry.js +0 -1
  224. package/dist/sankhyablocks/p-fcdcb0e2.entry.js +0 -1
  225. package/dist/sankhyablocks/p-fdc4cb9b.entry.js +0 -1
  226. /package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.css +0 -0
  227. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.css +0 -0
  228. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.js +0 -0
  229. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.css +0 -0
  230. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.js +0 -0
  231. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.css +0 -0
  232. /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.js +0 -0
  233. /package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.css +0 -0
  234. /package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.css +0 -0
  235. /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.d.ts +0 -0
  236. /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.d.ts +0 -0
  237. /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.d.ts +0 -0
@@ -4,26 +4,31 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
+ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
7
8
  const constants = require('./constants-35ddd366.js');
8
- const taskbarElements = require('./taskbar-elements-1e4fb2e0.js');
9
- require('./DataFetcher-99f0f6ed.js');
10
- const pesquisaFetcher = require('./pesquisa-fetcher-8bbee432.js');
9
+ const taskbarElements = require('./taskbar-elements-3ecd1278.js');
10
+ require('./DataFetcher-313debd8.js');
11
+ const pesquisaFetcher = require('./pesquisa-fetcher-213797ec.js');
12
+ const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-303e85d1.js');
11
13
  const index$1 = require('./index-0922807b.js');
12
14
  require('./ISave-e91b70a7.js');
13
15
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
14
16
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
15
- require('./PreloadManager-84466da6.js');
16
17
  require('./filter-item-type.enum-a7ffdaa6.js');
17
- require('./form-config-fetcher-9f1a13ca.js');
18
+ const formConfigFetcher = require('./form-config-fetcher-2dd00e5b.js');
18
19
  const fieldSearch = require('./field-search-f56aa7d6.js');
19
- const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-ba5838c2.js');
20
+ const ConfigStorage = require('./ConfigStorage-942ce74b.js');
21
+ const SnkFormConfigManager = require('./SnkFormConfigManager-f9dc0d28.js');
20
22
  require('./index-102ba62d.js');
21
23
  require('./PrintUtils-bcaeb82f.js');
22
- require('./ResourceIDUtils-5ff86aa7.js');
23
24
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
25
+ require('./ResourceIDUtils-5ff86aa7.js');
24
26
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
25
27
 
26
- const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:max-content;row-gap:12px;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;min-height:300px}ez-form.sc-snk-simple-crud{min-height:300px}";
28
+ const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
29
+ const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
30
+
31
+ const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;row-gap:12px;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";
27
32
 
28
33
  const SnkSimpleCrud = class {
29
34
  constructor(hostRef) {
@@ -32,20 +37,24 @@ const SnkSimpleCrud = class {
32
37
  this.dataUnitReady = index.createEvent(this, "dataUnitReady", 3);
33
38
  this.actionClick = index.createEvent(this, "actionClick", 7);
34
39
  this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
35
- this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
36
- this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
40
+ this.configuratorSave = index.createEvent(this, "configuratorSave", 7);
41
+ this.configuratorCancel = index.createEvent(this, "configuratorCancel", 7);
37
42
  this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
38
43
  this._keyDownHandler = (event) => this.keyDownListener(event);
44
+ this._formConfigFetcher = new formConfigFetcher.FormConfigFetcher();
39
45
  this._taskbarProcessor = new fieldSearch.TaskbarProcessor({
40
- "snkSimpleCrudTaskbar.form_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(taskbarElements.TaskbarElement.GRID_MODE),
41
- "snkSimpleCrudTaskbar.grid_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(taskbarElements.TaskbarElement.FORM_MODE),
42
- "snkSimpleCrudTaskbar.form_selected": this.resolveInMemoryBtns(this.REGULAR_SELECTED_BTNS).concat(taskbarElements.TaskbarElement.GRID_MODE),
43
- "snkSimpleCrudTaskbar.grid_selected": this.resolveInMemoryBtns(this.REGULAR_SELECTED_BTNS).concat(taskbarElements.TaskbarElement.FORM_MODE),
46
+ "snkSimpleCrudTaskbar.form_regular": this.getButtons(false, taskbarElements.TaskbarElement.GRID_MODE),
47
+ "snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, taskbarElements.TaskbarElement.FORM_MODE),
48
+ "snkSimpleCrudTaskbar.form_selected": this.getButtons(true, taskbarElements.TaskbarElement.GRID_MODE),
49
+ "snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, taskbarElements.TaskbarElement.FORM_MODE),
44
50
  "snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
45
51
  });
52
+ this._showPopUpGridConfig = false;
53
+ this._showFormConfig = false;
46
54
  this._currentViewMode = constants.VIEW_MODE.GRID;
47
55
  this._config = undefined;
48
56
  this._fieldToGetFocus = undefined;
57
+ this._customContainerId = `SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${core.StringUtils.generateUUID()}`;
49
58
  this.dataState = undefined;
50
59
  this.dataUnit = undefined;
51
60
  this.mode = constants.SIMPLE_CRUD_MODE.SERVER;
@@ -54,11 +63,39 @@ const SnkSimpleCrud = class {
54
63
  this._formFields = [];
55
64
  this.multipleSelection = undefined;
56
65
  this.useCancelConfirm = true;
66
+ this.resourceID = undefined;
57
67
  this.taskbarManager = undefined;
58
68
  this.messagesBuilder = undefined;
59
69
  this.useEnterLikeTab = false;
60
70
  this.actionsList = undefined;
61
71
  this.configName = undefined;
72
+ this.showConfiguratorButtons = undefined;
73
+ this.gridLegacyConfigName = undefined;
74
+ this.formLegacyConfigName = undefined;
75
+ this.ignoreReadOnlyFormFields = false;
76
+ }
77
+ handleResourceIDChanged(newValue, oldValue) {
78
+ if (core.StringUtils.isEmpty(newValue)) {
79
+ return;
80
+ }
81
+ if (newValue === oldValue) {
82
+ return;
83
+ }
84
+ this.loadFormConfig(true);
85
+ this.loadGridConfig(true);
86
+ }
87
+ getButtons(selected, changeModeBtn) {
88
+ return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
89
+ .concat(changeModeBtn));
90
+ }
91
+ addConfigButton(buttons) {
92
+ if (this.configName === undefined) {
93
+ return buttons;
94
+ }
95
+ return buttons.concat(taskbarElements.TaskbarElement.CONFIGURATOR);
96
+ }
97
+ get application() {
98
+ return core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
62
99
  }
63
100
  resolveInMemoryBtns(taskbarButtons) {
64
101
  const newTaskBarConfig = [...taskbarButtons];
@@ -78,7 +115,10 @@ const SnkSimpleCrud = class {
78
115
  }
79
116
  actionClickListener(evt) {
80
117
  const act = evt.detail;
81
- if (act === taskbarElements.TaskbarElement.GRID_MODE) {
118
+ if (act === taskbarElements.TaskbarElement.CONFIGURATOR) {
119
+ this._snkConfigurator.open();
120
+ }
121
+ else if (act === taskbarElements.TaskbarElement.GRID_MODE) {
82
122
  this.goToView(constants.VIEW_MODE.GRID);
83
123
  }
84
124
  else if (act === taskbarElements.TaskbarElement.FORM_MODE) {
@@ -96,17 +136,129 @@ const SnkSimpleCrud = class {
96
136
  this.dataStateChange.emit(newValue);
97
137
  }
98
138
  }
99
- componentWillRender() {
139
+ async observeFormLegacy(newValue, oldValue) {
140
+ await this.handleUpdateFormLegacyConfig(newValue, oldValue);
141
+ }
142
+ async observeGridLegacy(newValue, oldValue) {
143
+ await this.handleUpdateGridLegacyConfig(newValue, oldValue);
144
+ }
145
+ async handleUpdateGridLegacyConfig(newValue, oldValue) {
146
+ if (newValue == undefined || newValue == oldValue) {
147
+ return;
148
+ }
149
+ if (!this._gridConfigAlreadyLoaded) {
150
+ return;
151
+ }
152
+ await this.loadGridConfig(true);
153
+ }
154
+ async handleUpdateFormLegacyConfig(newValue, oldValue) {
155
+ if (newValue == undefined || newValue == oldValue) {
156
+ return;
157
+ }
158
+ if (!this._formConfigAlreadyLoaded) {
159
+ return;
160
+ }
161
+ this.loadFormConfig(true);
162
+ }
163
+ openConfig(viewMode) {
164
+ this._snkConfigurator.close();
165
+ if (viewMode === constants.VIEW_MODE.GRID) {
166
+ this.openGridConfig();
167
+ }
168
+ else if (viewMode === constants.VIEW_MODE.FORM) {
169
+ this.openFormConfig();
170
+ }
171
+ }
172
+ openGridConfig() {
173
+ this._grid.getColumnsState()
174
+ .then((gridColumns) => {
175
+ this._snkGridConfig.columns = gridColumns.filter(c => c.name);
176
+ this._snkGridConfig.selectedIndex = 0;
177
+ this._showPopUpGridConfig = true;
178
+ });
179
+ }
180
+ async openFormConfig() {
181
+ var _a, _b;
182
+ //No momento não daremos suporte para configuraçao de formulário quando houver legacy config
183
+ if (this.formLegacyConfigName) {
184
+ const title = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.formConfigUnavaliable.title", undefined);
185
+ const message = (_b = this.messagesBuilder) === null || _b === void 0 ? void 0 : _b.getMessage("snkSimpleCrud.formConfigUnavaliable.message", undefined);
186
+ await this.application.alert(title, message);
187
+ return;
188
+ }
189
+ this._showFormConfig = true;
190
+ }
191
+ addGridLegacyConfigName() {
192
+ if (this.gridLegacyConfigName && this.configName) {
193
+ ConfigStorage.ConfigStorage.addGridLegacyConfig(this.configName, this.gridLegacyConfigName);
194
+ }
195
+ }
196
+ loadGridConfig(forceUpdate) {
197
+ if (this.configName === undefined) {
198
+ return;
199
+ }
200
+ if ((this.gridConfig != undefined || this._gridConfigAlreadyLoaded) && !forceUpdate) {
201
+ return;
202
+ }
203
+ this.addGridLegacyConfigName();
204
+ this._gridConfigAlreadyLoaded = true;
205
+ return new Promise((accept, reject) => {
206
+ ConfigStorage.ConfigStorage.loadGridConfig(this.configName, this.resolveResourceID())
207
+ .then(config => {
208
+ this.setGridConfig(config);
209
+ accept();
210
+ })
211
+ .catch(reason => {
212
+ reject(reason);
213
+ });
214
+ });
215
+ }
216
+ formConfigIsLoaded() {
217
+ return this.formConfig != undefined || this._formConfigAlreadyLoaded;
218
+ }
219
+ async loadFormConfig(forceLoad = false) {
220
+ if (this.configName === undefined) {
221
+ return;
222
+ }
223
+ if (this._formConfigManager == undefined) {
224
+ this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID());
225
+ this._formConfigManager.setConfig(this.formConfig);
226
+ }
227
+ if (this.formConfigIsLoaded() && !forceLoad) {
228
+ return;
229
+ }
230
+ this._formConfigAlreadyLoaded = true;
231
+ let loadedLegacyConfig = await this._formConfigFetcher.fetchLegacyConfigurableForm(this.formLegacyConfigName);
232
+ if (loadedLegacyConfig != undefined) {
233
+ this._formConfigManager.setConfig(loadedLegacyConfig);
234
+ this.setFormConfig(loadedLegacyConfig);
235
+ return;
236
+ }
237
+ this.setFormConfig(await this._formConfigManager.loadConfig());
238
+ }
239
+ async componentWillRender() {
240
+ this._resourceID = await this.application.getResourceID();
100
241
  this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.getTaskBarDisabledButtons());
242
+ if (this.configName === undefined) {
243
+ return;
244
+ }
245
+ if (this.gridConfig != undefined || this._gridConfigAlreadyLoaded) {
246
+ return;
247
+ }
248
+ await this.addGridLegacyConfigName();
249
+ this.loadGridConfig();
250
+ this.loadFormConfig();
101
251
  }
102
252
  componentWillLoad() {
103
253
  this.processMetadata();
104
254
  this.onModeChange();
105
255
  this.configDatasource();
106
256
  }
257
+ componentDidLoad() {
258
+ utils.CSSVarsUtils.applyVarsGrid(this._element, this._grid);
259
+ }
107
260
  configDatasource() {
108
- const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
109
- this._multiSelectionListDataSource.setApplication(application);
261
+ this._multiSelectionListDataSource.setApplication(this.application);
110
262
  this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
111
263
  }
112
264
  getTaskBarId() {
@@ -147,6 +299,27 @@ const SnkSimpleCrud = class {
147
299
  getRecords() {
148
300
  return Promise.resolve(this.dataUnit.records);
149
301
  }
302
+ /**
303
+ * Usado para abrir o configurator do CRUD
304
+ */
305
+ async openConfigurator() {
306
+ var _a;
307
+ (_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.open();
308
+ }
309
+ /**
310
+ * Usado para fechar o configurator do CRUD
311
+ */
312
+ async closeConfigurator() {
313
+ var _a;
314
+ (_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close();
315
+ }
316
+ updateConfig() {
317
+ if (this._formConfigManager == undefined) {
318
+ this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID());
319
+ }
320
+ this._formConfigManager.setConfig(this.formConfig);
321
+ return;
322
+ }
150
323
  processMetadata() {
151
324
  const fieldsMetadataElem = this._element.querySelectorAll("snk-field-metadata");
152
325
  const fieldMetadata = [];
@@ -201,6 +374,14 @@ const SnkSimpleCrud = class {
201
374
  this.dataUnit.clearSelection();
202
375
  }
203
376
  }
377
+ handleConfiguratorEvent(evt, type) {
378
+ evt.stopImmediatePropagation();
379
+ if (type === 'SAVE') {
380
+ this.configuratorSave.emit();
381
+ return;
382
+ }
383
+ this.configuratorCancel.emit();
384
+ }
204
385
  getColumnSearch(actionButton, item) {
205
386
  if (this._columnSearch != undefined) {
206
387
  return this._columnSearch;
@@ -242,7 +423,9 @@ const SnkSimpleCrud = class {
242
423
  return (_b = (_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : this._formFields;
243
424
  }
244
425
  handleFormSetFields(fields) {
245
- this._formFields = fields !== null && fields !== void 0 ? fields : [];
426
+ if (!core.ObjectUtils.equals(this._formFields, fields)) {
427
+ this._formFields = fields !== null && fields !== void 0 ? fields : [];
428
+ }
246
429
  }
247
430
  fieldsOptionLoader(argument) {
248
431
  const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
@@ -314,16 +497,67 @@ const SnkSimpleCrud = class {
314
497
  disconnectedCallback() {
315
498
  window.removeEventListener("keydown", this._keyDownHandler);
316
499
  }
500
+ gridConfigChangeHandler(evt) {
501
+ const config = evt.detail;
502
+ ConfigStorage.ConfigStorage.saveGridConfig(config, this.configName, this.resolveResourceID());
503
+ evt.stopPropagation();
504
+ }
505
+ modalConfigChangeHandler(evt) {
506
+ const config = evt.detail;
507
+ this._grid.setColumnsState(config.columns)
508
+ .then(() => {
509
+ this.setGridConfig(config);
510
+ this.closeGridConfig();
511
+ });
512
+ evt.stopPropagation();
513
+ }
514
+ setGridConfig(config) {
515
+ this.gridConfig = config;
516
+ SnkMultiSelectionListDataSource.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
517
+ }
518
+ setFormConfig(config, forceUpdate) {
519
+ if (this.formConfig && !forceUpdate)
520
+ return;
521
+ this.formConfig = config;
522
+ }
523
+ closeGridConfig() {
524
+ this._showPopUpGridConfig = false;
525
+ }
526
+ closeFormConfig() {
527
+ this._showFormConfig = false;
528
+ }
529
+ //No momento não daremos suporte para configuração de formulário quando houver formLegacyConfigName
530
+ handleShowFormConfig() {
531
+ return this._showFormConfig && !this.formLegacyConfigName;
532
+ }
533
+ resolveResourceID() {
534
+ return core.StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
535
+ }
536
+ getFormConfig() {
537
+ var _a, _b;
538
+ const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields);
539
+ if (!this.configName && !configFromManager) {
540
+ return this.formConfig;
541
+ }
542
+ return configFromManager;
543
+ }
544
+ /* istanbul ignore next */
317
545
  render() {
318
546
  var _a;
319
- return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }, index.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(pesquisaFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
547
+ if (this.dataUnit == undefined) {
548
+ return;
549
+ }
550
+ return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }, index.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(pesquisaFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
320
551
  ? undefined
321
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { class: "ez-margin-top--large", dataUnit: this.dataUnit, config: this.formConfig, fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }))))));
552
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index.h("div", { id: `${this._customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }))), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
322
553
  }
323
554
  get _element() { return index.getElement(this); }
324
555
  static get watchers() { return {
556
+ "resourceID": ["handleResourceIDChanged"],
325
557
  "mode": ["onModeChange"],
326
- "dataState": ["observeDataState"]
558
+ "dataState": ["observeDataState"],
559
+ "formLegacyConfigName": ["observeFormLegacy"],
560
+ "gridLegacyConfigName": ["observeGridLegacy"]
327
561
  }; }
328
562
  };
329
563
  SnkSimpleCrud.style = snkSimpleCrudCss;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
8
- const taskbarElements = require('./taskbar-elements-1e4fb2e0.js');
8
+ const taskbarElements = require('./taskbar-elements-3ecd1278.js');
9
9
  const index$1 = require('./index-0922807b.js');
10
10
  require('./index-102ba62d.js');
11
11
 
@@ -35,12 +35,27 @@ const SnkTaskbar = class {
35
35
  [taskbarElements.TaskbarElement.CONFIGURATOR]: "snkTaskbar.titleConfigurator",
36
36
  [taskbarElements.TaskbarElement.ATTACH]: "snkTaskbar.titleAttach",
37
37
  };
38
+ this.onSaveEvent = (action) => {
39
+ switch (action.type) {
40
+ case core.Action.FIELD_INVALIDATED:
41
+ case core.Action.DATA_SAVED:
42
+ case core.Action.SAVING_ERROR:
43
+ this._isWaitingForSave = false;
44
+ break;
45
+ case core.Action.SAVING_DATA:
46
+ this._isWaitingForSave = true;
47
+ break;
48
+ }
49
+ };
38
50
  this._permissions = undefined;
39
51
  this._overFlowedElements = [];
40
52
  this._customElements = undefined;
41
53
  this._customElementsId = undefined;
42
54
  this._slotContainer = undefined;
43
55
  this._hiddenActionsList = [];
56
+ this._lastWidth = undefined;
57
+ this._hasToUpdateOverFlow = false;
58
+ this._isWaitingForSave = false;
44
59
  this.alignRigth = false;
45
60
  this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
46
61
  this.customContainerId = undefined;
@@ -56,9 +71,28 @@ const SnkTaskbar = class {
56
71
  this.presentationMode = index$1.PresentationMode.PRIMARY;
57
72
  this.messagesBuilder = undefined;
58
73
  }
74
+ handleCustomSlotElementsLoaded(event) {
75
+ if (this.hasToSearchCustomElements(event)) {
76
+ this.getCustomElements(true);
77
+ }
78
+ }
79
+ hasToSearchCustomElements(event) {
80
+ return this.customSlotId === event.detail && !this._slotContainer;
81
+ }
59
82
  observeButtons() {
60
83
  this._definitions = undefined;
61
- requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
84
+ requestAnimationFrame(() => {
85
+ requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
86
+ });
87
+ }
88
+ observeDisabledButtons() {
89
+ var _a;
90
+ (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate();
91
+ }
92
+ observeLastWidth(newValue, oldValue) {
93
+ if (oldValue === 0 && newValue !== 0) {
94
+ this._hasToUpdateOverFlow = true;
95
+ }
62
96
  }
63
97
  // Internal methods
64
98
  elementsFromString(strButtons) {
@@ -128,7 +162,13 @@ const SnkTaskbar = class {
128
162
  this.dataUnit.cancelEdition();
129
163
  break;
130
164
  case taskbarElements.TaskbarElement.SAVE:
131
- this.dataUnit.saveData();
165
+ if (!this._isWaitingForSave) {
166
+ this._isWaitingForSave = true;
167
+ this.dataUnit.saveData()
168
+ .finally(() => {
169
+ this._isWaitingForSave = false;
170
+ });
171
+ }
132
172
  break;
133
173
  }
134
174
  }
@@ -213,24 +253,30 @@ const SnkTaskbar = class {
213
253
  this._customElementsId.push(elementId);
214
254
  (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.addNotOverFlowElement(elementId);
215
255
  }
216
- return index.h("span", { key: elementId, id: elementId });
256
+ return index.h("span", { class: "ez-padding-left--medium", key: elementId, id: elementId });
217
257
  }
218
- getCustomElements() {
258
+ getCustomElements(searchOnDocument) {
219
259
  var _a, _b;
220
260
  this._customElementsId = [];
221
261
  this._customElements = new Map();
222
- this._slotContainer = this.buildSlotContainer();
262
+ this._slotContainer = this.buildSlotContainer(searchOnDocument);
223
263
  const customElementsArray = Array.from((_b = (_a = this._slotContainer) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : []);
224
264
  customElementsArray.forEach(item => this._customElements.set(item.id, item));
225
265
  }
226
- buildSlotContainer() {
266
+ buildSlotContainer(searchOnDocument) {
267
+ let slotContainer;
227
268
  if (this.customContainerId) {
228
269
  const container = document.querySelector(`#${this.customContainerId}`);
229
- return container === null || container === void 0 ? void 0 : container.querySelector(`#${this.customSlotId}`);
270
+ slotContainer = container === null || container === void 0 ? void 0 : container.querySelector(`#${this.customSlotId}`);
230
271
  }
231
272
  else {
232
- return this._element.querySelector(`#${this.customSlotId}`);
273
+ slotContainer = this._element.querySelector(`#${this.customSlotId}`);
274
+ }
275
+ // Caso nõa encontre o slot container dentro do próprio elemento, tenta buscar na DOM do document.
276
+ if (searchOnDocument && !slotContainer) {
277
+ slotContainer = document.querySelector(`#${this.customSlotId}`);
233
278
  }
279
+ return slotContainer;
234
280
  }
235
281
  componentWillLoad() {
236
282
  this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
@@ -243,10 +289,20 @@ const SnkTaskbar = class {
243
289
  this.getCustomElements();
244
290
  }
245
291
  componentWillRender() {
292
+ this.handleDefinitions();
293
+ this.validatePresentationMode();
294
+ this.updateOverFlowIfNeeded();
295
+ }
296
+ handleDefinitions() {
246
297
  if (this._definitions == undefined && this._permissions) {
247
298
  this._definitions = this.elementsFromString(this.buttons);
248
299
  }
249
- this.validatePresentationMode();
300
+ }
301
+ updateOverFlowIfNeeded() {
302
+ if (this._hasToUpdateOverFlow) {
303
+ requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
304
+ this._hasToUpdateOverFlow = false;
305
+ }
250
306
  }
251
307
  handleOverFlow(overFlowingElements) {
252
308
  const elementsToHandle = overFlowingElements.filter(element => !this.hasToIgnoreOverFlow(element));
@@ -310,9 +366,14 @@ const SnkTaskbar = class {
310
366
  const dataInfo = { dataUnit: this.dataUnit };
311
367
  core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
312
368
  this.handleOverFlowStrategy();
369
+ this.dataUnit.subscribe(this.onSaveEvent);
313
370
  }
314
371
  componentDidRender() {
315
372
  this.appendCustomElementsInTaskbar();
373
+ this.updateLastWidth();
374
+ }
375
+ updateLastWidth() {
376
+ this._lastWidth = this._element.getBoundingClientRect().width;
316
377
  }
317
378
  disconnectedCallback() {
318
379
  var _a;
@@ -337,12 +398,7 @@ const SnkTaskbar = class {
337
398
  let index$1 = 0;
338
399
  return (index.h(index.Host, { class: this.getHostClasses() }, this.removeEmpty(this._definitions.map((elem) => {
339
400
  var _a, _b;
340
- if (elem === taskbarElements.TaskbarElement.DIVIDER) {
341
- index$1 = 0;
342
- }
343
- else {
344
- index$1++;
345
- }
401
+ index$1++;
346
402
  if (taskbarElements.TaskbarElement[elem]) {
347
403
  return this.getElement(index$1, taskbarElements.TaskbarElement[elem]);
348
404
  }
@@ -363,7 +419,9 @@ const SnkTaskbar = class {
363
419
  }
364
420
  get _element() { return index.getElement(this); }
365
421
  static get watchers() { return {
366
- "buttons": ["observeButtons"]
422
+ "buttons": ["observeButtons"],
423
+ "disabledButtons": ["observeDisabledButtons"],
424
+ "_lastWidth": ["observeLastWidth"]
367
425
  }; }
368
426
  };
369
427
  SnkTaskbar.style = snkTaskbarCss;
@@ -91,7 +91,7 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
91
91
  case exports.TaskbarElement.MORE_OPTIONS:
92
92
  return actionButton(element, className, dataElementId, title, isEnabled, actions, action);
93
93
  case exports.TaskbarElement.DIVIDER:
94
- return index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium", "data-taskbar-divider": true });
94
+ return index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin--none ez-margin-left--medium", "data-taskbar-divider": true });
95
95
  case exports.TaskbarElement.DATA_EXPORTER:
96
96
  const provider = (_a = index$1.store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
97
97
  return index.h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId, "data-taskbar-element": element });
@@ -6,7 +6,6 @@
6
6
  "./components/snk-taskbar/snk-taskbar.js",
7
7
  "./components/snk-filter-bar/filter-list/snk-filter-list.js",
8
8
  "./components/snk-print-selector/snk-print-selector.js",
9
- "./components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js",
10
9
  "./components/snk-actions-button/snk-actions-button.js",
11
10
  "./components/snk-actions-button/subcomponents/snk-actions-form.js",
12
11
  "./components/snk-actions-button/subcomponents/snk-client-confirm.js",
@@ -35,12 +34,13 @@
35
34
  "./components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js",
36
35
  "./components/snk-filter-field-search/snk-filter-field-search.js",
37
36
  "./components/snk-form/snk-form.js",
38
- "./components/snk-form/subcomponents/snk-config-options/snk-config-options.js",
39
- "./components/snk-form/subcomponents/snk-field-config/snk-field-config.js",
40
- "./components/snk-form/subcomponents/snk-form-config/snk-form-config.js",
37
+ "./components/snk-form-config/subcomponents/snk-tab-config/snk-tab-config.js",
38
+ "./components/snk-form-config/snk-form-config.js",
39
+ "./components/snk-form-config/subcomponents/snk-config-options/snk-config-options.js",
40
+ "./components/snk-form-config/subcomponents/snk-field-config/snk-field-config.js",
41
41
  "./components/snk-grid/snk-grid.js",
42
- "./components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js",
43
- "./components/snk-grid/subcomponents/snk-select-box/snk-select-box.js",
42
+ "./components/snk-grid-config/snk-grid-config.js",
43
+ "./components/snk-grid-config/snk-select-box/snk-select-box.js",
44
44
  "./components/snk-personalized-filter/snk-personalized-filter.js",
45
45
  "./components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js",
46
46
  "./components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js",