@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
@@ -1,5 +1,5 @@
1
1
  import { h, proxyCustomElement, HTMLElement, createEvent, Host } from '@stencil/core/internal/client';
2
- import { StringUtils, ApplicationContext, OVERFLOWED_CLASS_NAME, OverflowWatcher, OverflowDirection, ElementIDUtils } from '@sankhyalabs/core';
2
+ import { Action, StringUtils, ApplicationContext, OVERFLOWED_CLASS_NAME, OverflowWatcher, OverflowDirection, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { A as AuthorizationConfig } from './AuthorizationConfig.js';
4
4
  import { P as PresentationMode } from './index2.js';
5
5
  import { s as store } from './index3.js';
@@ -95,7 +95,7 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
95
95
  case TaskbarElement.MORE_OPTIONS:
96
96
  return actionButton(element, className, dataElementId, title, isEnabled, actions, action);
97
97
  case TaskbarElement.DIVIDER:
98
- return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium", "data-taskbar-divider": true });
98
+ return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin--none ez-margin-left--medium", "data-taskbar-divider": true });
99
99
  case TaskbarElement.DATA_EXPORTER:
100
100
  const provider = (_a = store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
101
101
  return h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId, "data-taskbar-element": element });
@@ -148,12 +148,27 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
148
148
  [TaskbarElement.CONFIGURATOR]: "snkTaskbar.titleConfigurator",
149
149
  [TaskbarElement.ATTACH]: "snkTaskbar.titleAttach",
150
150
  };
151
+ this.onSaveEvent = (action) => {
152
+ switch (action.type) {
153
+ case Action.FIELD_INVALIDATED:
154
+ case Action.DATA_SAVED:
155
+ case Action.SAVING_ERROR:
156
+ this._isWaitingForSave = false;
157
+ break;
158
+ case Action.SAVING_DATA:
159
+ this._isWaitingForSave = true;
160
+ break;
161
+ }
162
+ };
151
163
  this._permissions = undefined;
152
164
  this._overFlowedElements = [];
153
165
  this._customElements = undefined;
154
166
  this._customElementsId = undefined;
155
167
  this._slotContainer = undefined;
156
168
  this._hiddenActionsList = [];
169
+ this._lastWidth = undefined;
170
+ this._hasToUpdateOverFlow = false;
171
+ this._isWaitingForSave = false;
157
172
  this.alignRigth = false;
158
173
  this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
159
174
  this.customContainerId = undefined;
@@ -169,9 +184,28 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
169
184
  this.presentationMode = PresentationMode.PRIMARY;
170
185
  this.messagesBuilder = undefined;
171
186
  }
187
+ handleCustomSlotElementsLoaded(event) {
188
+ if (this.hasToSearchCustomElements(event)) {
189
+ this.getCustomElements(true);
190
+ }
191
+ }
192
+ hasToSearchCustomElements(event) {
193
+ return this.customSlotId === event.detail && !this._slotContainer;
194
+ }
172
195
  observeButtons() {
173
196
  this._definitions = undefined;
174
- requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
197
+ requestAnimationFrame(() => {
198
+ requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
199
+ });
200
+ }
201
+ observeDisabledButtons() {
202
+ var _a;
203
+ (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate();
204
+ }
205
+ observeLastWidth(newValue, oldValue) {
206
+ if (oldValue === 0 && newValue !== 0) {
207
+ this._hasToUpdateOverFlow = true;
208
+ }
175
209
  }
176
210
  // Internal methods
177
211
  elementsFromString(strButtons) {
@@ -241,7 +275,13 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
241
275
  this.dataUnit.cancelEdition();
242
276
  break;
243
277
  case TaskbarElement.SAVE:
244
- this.dataUnit.saveData();
278
+ if (!this._isWaitingForSave) {
279
+ this._isWaitingForSave = true;
280
+ this.dataUnit.saveData()
281
+ .finally(() => {
282
+ this._isWaitingForSave = false;
283
+ });
284
+ }
245
285
  break;
246
286
  }
247
287
  }
@@ -326,24 +366,30 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
326
366
  this._customElementsId.push(elementId);
327
367
  (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.addNotOverFlowElement(elementId);
328
368
  }
329
- return h("span", { key: elementId, id: elementId });
369
+ return h("span", { class: "ez-padding-left--medium", key: elementId, id: elementId });
330
370
  }
331
- getCustomElements() {
371
+ getCustomElements(searchOnDocument) {
332
372
  var _a, _b;
333
373
  this._customElementsId = [];
334
374
  this._customElements = new Map();
335
- this._slotContainer = this.buildSlotContainer();
375
+ this._slotContainer = this.buildSlotContainer(searchOnDocument);
336
376
  const customElementsArray = Array.from((_b = (_a = this._slotContainer) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : []);
337
377
  customElementsArray.forEach(item => this._customElements.set(item.id, item));
338
378
  }
339
- buildSlotContainer() {
379
+ buildSlotContainer(searchOnDocument) {
380
+ let slotContainer;
340
381
  if (this.customContainerId) {
341
382
  const container = document.querySelector(`#${this.customContainerId}`);
342
- return container === null || container === void 0 ? void 0 : container.querySelector(`#${this.customSlotId}`);
383
+ slotContainer = container === null || container === void 0 ? void 0 : container.querySelector(`#${this.customSlotId}`);
343
384
  }
344
385
  else {
345
- return this._element.querySelector(`#${this.customSlotId}`);
386
+ slotContainer = this._element.querySelector(`#${this.customSlotId}`);
387
+ }
388
+ // Caso nõa encontre o slot container dentro do próprio elemento, tenta buscar na DOM do document.
389
+ if (searchOnDocument && !slotContainer) {
390
+ slotContainer = document.querySelector(`#${this.customSlotId}`);
346
391
  }
392
+ return slotContainer;
347
393
  }
348
394
  componentWillLoad() {
349
395
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
@@ -356,10 +402,20 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
356
402
  this.getCustomElements();
357
403
  }
358
404
  componentWillRender() {
405
+ this.handleDefinitions();
406
+ this.validatePresentationMode();
407
+ this.updateOverFlowIfNeeded();
408
+ }
409
+ handleDefinitions() {
359
410
  if (this._definitions == undefined && this._permissions) {
360
411
  this._definitions = this.elementsFromString(this.buttons);
361
412
  }
362
- this.validatePresentationMode();
413
+ }
414
+ updateOverFlowIfNeeded() {
415
+ if (this._hasToUpdateOverFlow) {
416
+ requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
417
+ this._hasToUpdateOverFlow = false;
418
+ }
363
419
  }
364
420
  handleOverFlow(overFlowingElements) {
365
421
  const elementsToHandle = overFlowingElements.filter(element => !this.hasToIgnoreOverFlow(element));
@@ -423,9 +479,14 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
423
479
  const dataInfo = { dataUnit: this.dataUnit };
424
480
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
425
481
  this.handleOverFlowStrategy();
482
+ this.dataUnit.subscribe(this.onSaveEvent);
426
483
  }
427
484
  componentDidRender() {
428
485
  this.appendCustomElementsInTaskbar();
486
+ this.updateLastWidth();
487
+ }
488
+ updateLastWidth() {
489
+ this._lastWidth = this._element.getBoundingClientRect().width;
429
490
  }
430
491
  disconnectedCallback() {
431
492
  var _a;
@@ -450,12 +511,7 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
450
511
  let index = 0;
451
512
  return (h(Host, { class: this.getHostClasses() }, this.removeEmpty(this._definitions.map((elem) => {
452
513
  var _a, _b;
453
- if (elem === TaskbarElement.DIVIDER) {
454
- index = 0;
455
- }
456
- else {
457
- index++;
458
- }
514
+ index++;
459
515
  if (TaskbarElement[elem]) {
460
516
  return this.getElement(index, TaskbarElement[elem]);
461
517
  }
@@ -476,7 +532,9 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
476
532
  }
477
533
  get _element() { return this; }
478
534
  static get watchers() { return {
479
- "buttons": ["observeButtons"]
535
+ "buttons": ["observeButtons"],
536
+ "disabledButtons": ["observeDisabledButtons"],
537
+ "_lastWidth": ["observeLastWidth"]
480
538
  }; }
481
539
  static get style() { return snkTaskbarCss; }
482
540
  }, [6, "snk-taskbar", {
@@ -499,8 +557,11 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
499
557
  "_customElements": [32],
500
558
  "_customElementsId": [32],
501
559
  "_slotContainer": [32],
502
- "_hiddenActionsList": [32]
503
- }]);
560
+ "_hiddenActionsList": [32],
561
+ "_lastWidth": [32],
562
+ "_hasToUpdateOverFlow": [32],
563
+ "_isWaitingForSave": [32]
564
+ }, [[8, "snkCustomSlotElementsLoaded", "handleCustomSlotElementsLoaded"]]]);
504
565
  function defineCustomElement() {
505
566
  if (typeof customElements === "undefined") {
506
567
  return;
@@ -1,7 +1,7 @@
1
- import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-f121f880.js';
1
+ import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-30fb808f.js';
2
2
  import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
3
3
  import { ObjectUtils } from '@sankhyalabs/core';
4
- import { d as dist, D as DataFetcher } from './DataFetcher-a650ae58.js';
4
+ import { d as dist, D as DataFetcher } from './DataFetcher-c1baf61d.js';
5
5
 
6
6
  class GridConfigFetcher extends ResourceFetcher {
7
7
  constructor() {
@@ -232,7 +232,7 @@ class PersonalizedFilterFetcher {
232
232
  assistent
233
233
  }
234
234
  }`);
235
- this.templateByQuery.set("savePersonalizedFilter", dist.gql `
235
+ this.templateByQuery.set("savePersonalizedFilter", dist.gql `
236
236
  mutation($name: String!, $filterAssistent: InputFilterAssistent!) {
237
237
  $queryAlias$: savePersonalizedFilter(name: $name, filterAssistent: $filterAssistent) {
238
238
  id
@@ -254,11 +254,11 @@ class PersonalizedFilterFetcher {
254
254
  }
255
255
  }`);
256
256
  }
257
- async loadPersonalizedFilter(resourceID, filterID, configName) {
257
+ async loadPersonalizedFilter(resourceID, filterID, configName, legacyConfigName) {
258
258
  return new Promise((resolve, reject) => {
259
259
  DataFetcher.get()
260
260
  .callGraphQL({
261
- values: { name: this.resolveURI(resourceID, configName) + "/" + filterID },
261
+ values: { name: this.resolveURI(resourceID, configName) + "/" + filterID + this.resolveLegacyConfigName(legacyConfigName) },
262
262
  query: this.templateByQuery.get("fetchFilterAssistent"),
263
263
  })
264
264
  .then((resp) => {
@@ -270,6 +270,9 @@ class PersonalizedFilterFetcher {
270
270
  });
271
271
  });
272
272
  }
273
+ resolveLegacyConfigName(legacyConfigName) {
274
+ return legacyConfigName ? `?legacyResourceID=${legacyConfigName}` : '';
275
+ }
273
276
  async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
274
277
  if (!personalizedFilter || Object.keys(personalizedFilter).length == 0) {
275
278
  return Promise.reject(new Error("personalizedFilter não pode ser vazio"));
@@ -358,11 +361,30 @@ var CONFIG_SOURCE;
358
361
  CONFIG_SOURCE["filterBar"] = "filterBar";
359
362
  })(CONFIG_SOURCE || (CONFIG_SOURCE = {}));
360
363
  class ConfigStorage {
361
- static preload(resourceID, configName) {
364
+ static addFilterBarLegacyConfig(configName, legacyConfigName) {
365
+ this.validateConfigName(configName, legacyConfigName);
366
+ this.filterBarLegacyConfig.set(configName, legacyConfigName);
367
+ }
368
+ static addFormLegacyConfig(configName, legacyConfigName) {
369
+ this.validateConfigName(configName, legacyConfigName);
370
+ this.formLegacyConfig.set(configName, legacyConfigName);
371
+ }
372
+ static addGridLegacyConfig(configName, legacyConfigName) {
373
+ this.validateConfigName(configName, legacyConfigName);
374
+ this.gridLegacyConfig.set(configName, legacyConfigName);
375
+ }
376
+ static preload(resourceID, configName, legacyConfigs) {
377
+ if (configName && (legacyConfigs === null || legacyConfigs === void 0 ? void 0 : legacyConfigs.gridLegacyConfig)) {
378
+ ConfigStorage.addGridLegacyConfig(configName, legacyConfigs.gridLegacyConfig);
379
+ }
380
+ if (configName && (legacyConfigs === null || legacyConfigs === void 0 ? void 0 : legacyConfigs.formLegacyConfig)) {
381
+ ConfigStorage.addFormLegacyConfig(configName, legacyConfigs.formLegacyConfig);
382
+ }
362
383
  ConfigStorage.loadFormConfig(configName, resourceID);
363
384
  ConfigStorage.loadGridConfig(configName, resourceID);
364
385
  }
365
386
  static async loadFilterBarConfig(name, resourceID, urlParams) {
387
+ urlParams = this.handleLegacyConfig(name, CONFIG_SOURCE.filterBar, urlParams);
366
388
  const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.filterBar, resourceID);
367
389
  if (!ConfigStorage.configById.has(cacheID)) {
368
390
  ConfigStorage.configById.set(cacheID, ConfigStorage.filterBarConfigFetcher.getConfig(resourceID, name, urlParams));
@@ -370,6 +392,7 @@ class ConfigStorage {
370
392
  return ConfigStorage.configById.get(cacheID);
371
393
  }
372
394
  static async loadFormConfig(name, resourceID) {
395
+ name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.form);
373
396
  const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.form, resourceID);
374
397
  if (!ConfigStorage.configById.has(cacheID)) {
375
398
  ConfigStorage.configById.set(cacheID, ConfigStorage.formConfigFetcher.loadFormConfig(name, resourceID));
@@ -377,6 +400,7 @@ class ConfigStorage {
377
400
  return ConfigStorage.configById.get(cacheID);
378
401
  }
379
402
  static async loadGridConfig(name, resourceID) {
403
+ name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
380
404
  const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.grid, resourceID);
381
405
  if (!ConfigStorage.configById.has(cacheID)) {
382
406
  ConfigStorage.configById.set(cacheID, ConfigStorage.gridConfigFetcher.getConfig(name, resourceID));
@@ -388,6 +412,7 @@ class ConfigStorage {
388
412
  return this.filterBarConfigFetcher.saveConfig(config, resourceID, name);
389
413
  }
390
414
  static async saveFormConfig(config, name, resourceID) {
415
+ name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.form);
391
416
  await this.deleteFormConfigCache(name, resourceID);
392
417
  return this.formConfigFetcher.saveConfig(config, name, resourceID);
393
418
  }
@@ -402,7 +427,8 @@ class ConfigStorage {
402
427
  return this.gridConfigFetcher.saveConfig(config, name, resourceID);
403
428
  }
404
429
  static async loadPersonalizedFilter(filterId, resourceID, configName) {
405
- return this.personalizedFilterFetcher.loadPersonalizedFilter(resourceID, filterId, configName);
430
+ const legacyConfigName = this.filterBarLegacyConfig.get(configName);
431
+ return this.personalizedFilterFetcher.loadPersonalizedFilter(resourceID, filterId, configName, legacyConfigName);
406
432
  }
407
433
  static async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
408
434
  //Ao criar ou alterar um filtro personalizado,
@@ -425,6 +451,38 @@ class ConfigStorage {
425
451
  static async deleteFilterBarConfigCache(name, resourceID) {
426
452
  await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.filterBar);
427
453
  }
454
+ static validateConfigName(configName, legacyConfigName) {
455
+ if (!configName)
456
+ throw Error(this.CONFIG_NAME_ERROR_MESSAGE);
457
+ if (!legacyConfigName)
458
+ throw Error(this.LEGACY_CONFIG_NAME_ERROR_MESSAGE);
459
+ }
460
+ static handleLegacyConfig(configName, configSource, urlParams) {
461
+ let legacyConfigName;
462
+ switch (configSource) {
463
+ case CONFIG_SOURCE.filterBar:
464
+ legacyConfigName = this.filterBarLegacyConfig.get(configName);
465
+ break;
466
+ case CONFIG_SOURCE.grid:
467
+ legacyConfigName = this.gridLegacyConfig.get(configName);
468
+ break;
469
+ case CONFIG_SOURCE.form:
470
+ legacyConfigName = this.formLegacyConfig.get(configName);
471
+ }
472
+ const params = urlParams ? Object.assign({}, urlParams) : {};
473
+ if (legacyConfigName) {
474
+ params['legacyResourceID'] = legacyConfigName;
475
+ }
476
+ return params;
477
+ }
478
+ static handleLegacyConfigAsString(name, source) {
479
+ const params = this.handleLegacyConfig(name, source);
480
+ const legacyResourceID = params['legacyResourceID'];
481
+ if (legacyResourceID) {
482
+ name = name + `?legacyResourceID=${legacyResourceID}`;
483
+ }
484
+ return name;
485
+ }
428
486
  static async deleteConfigCache(name, resourceID, source) {
429
487
  const cacheID = ConfigStorage.buildCacheID(name, source, resourceID);
430
488
  this.configById.delete(cacheID);
@@ -436,6 +494,11 @@ class ConfigStorage {
436
494
  return `req_${source}_${name}_${resourceID}`;
437
495
  }
438
496
  }
497
+ ConfigStorage.CONFIG_NAME_ERROR_MESSAGE = "ConfigName precisa ser informado.";
498
+ ConfigStorage.LEGACY_CONFIG_NAME_ERROR_MESSAGE = "LegacyConfigName precisa ser informado.";
499
+ ConfigStorage.filterBarLegacyConfig = new Map();
500
+ ConfigStorage.formLegacyConfig = new Map();
501
+ ConfigStorage.gridLegacyConfig = new Map();
439
502
  ConfigStorage.configById = new Map();
440
503
  ConfigStorage.filterBarConfigFetcher = new FilterBarConfigFetcher();
441
504
  ConfigStorage.formConfigFetcher = new FormConfigFetcher();
@@ -6875,12 +6875,19 @@ class DataFetcher {
6875
6875
  //Reject promises with errors from query
6876
6876
  errorsResponse.forEach((errorResponse) => {
6877
6877
  Object.entries(errorResponse).forEach(async ([key, val]) => {
6878
- var _a;
6879
6878
  const waitingRequest = watingRequestsById.get(val.request.variables[val.index].queryID);
6880
6879
  const hasClientEvent = await this.proccesGraphQLClientEvents(extensions, waitingRequest.request, waitingRequest.resolve, waitingRequest.reject);
6881
- if (!hasClientEvent) {
6882
- (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
6883
- }
6880
+ Promise.race([
6881
+ waitingRequest.promise,
6882
+ new Promise((resolve) => {
6883
+ resolve(false);
6884
+ })
6885
+ ]).then((data) => {
6886
+ var _a;
6887
+ if (!hasClientEvent || data === false) {
6888
+ (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
6889
+ }
6890
+ });
6884
6891
  });
6885
6892
  });
6886
6893
  //Resolve promises with data from query
@@ -6893,7 +6900,8 @@ class DataFetcher {
6893
6900
  });
6894
6901
  }
6895
6902
  buildGraphQlURL(quietMode) {
6896
- const mgeSession = window["mgeSession"];
6903
+ const urlParams = UrlUtils.getQueryParams(location.search);
6904
+ const mgeSession = `${window['mgeSession'] || urlParams.get("mgeSession")}`;
6897
6905
  let url = `${this.resolveURL() + DataFetcher.getGraphQLPath()}`;
6898
6906
  if (mgeSession) {
6899
6907
  url += `?mgeSession=${mgeSession}`;
@@ -1,6 +1,6 @@
1
- import { C as ConfigStorage } from './ConfigStorage-39ed8aeb.js';
1
+ import { C as ConfigStorage } from './ConfigStorage-86187da3.js';
2
2
  import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
3
- import { F as FormConfigFetcher } from './form-config-fetcher-f121f880.js';
3
+ import { F as FormConfigFetcher } from './form-config-fetcher-30fb808f.js';
4
4
 
5
5
  class SnkFormConfigManager {
6
6
  constructor(configName, resourceID, onConfigChange) {
@@ -8,6 +8,11 @@ class SnkFormConfigManager {
8
8
  this._configName = configName;
9
9
  this._onConfigChange = onConfigChange;
10
10
  }
11
+ addFormLegacyConfig(legacyConfigName) {
12
+ if (this._configName) {
13
+ ConfigStorage.addFormLegacyConfig(this._configName, legacyConfigName);
14
+ }
15
+ }
11
16
  async loadConfig() {
12
17
  return new Promise(resolve => {
13
18
  ConfigStorage.loadFormConfig(this._configName, this._resourceID)
@@ -93,16 +98,19 @@ class SnkFormConfigManager {
93
98
  const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
94
99
  return normalizedText.includes(normalizedFilter);
95
100
  }
96
- getInsertionConfig(dataUnit) {
97
- const fields = this.getFieldsList(dataUnit).filter(field => {
98
- if (dataUnit) {
99
- const def = dataUnit.getField(field.name);
100
- if (def && def.readOnly) {
101
- return false;
101
+ getInsertionConfig(dataUnit, ignoreReadOnlyFormFields) {
102
+ let fields = this.getFieldsList(dataUnit);
103
+ if (ignoreReadOnlyFormFields) {
104
+ fields = fields.filter(field => {
105
+ if (dataUnit) {
106
+ const def = dataUnit.getField(field.name);
107
+ if (def && def.readOnly) {
108
+ return false;
109
+ }
102
110
  }
103
- }
104
- return !field.readOnly;
105
- });
111
+ return !field.readOnly;
112
+ });
113
+ }
106
114
  return Object.assign(Object.assign({}, this._config), { fields });
107
115
  }
108
116
  setConfig(config) {
@@ -122,8 +130,8 @@ class SnkFormConfigManager {
122
130
  this._onConfigChange(Object.assign({}, this._config));
123
131
  }
124
132
  }
125
- getConfig(insertionMode, dataUnit) {
126
- return insertionMode ? this.getInsertionConfig(dataUnit) : Object.assign({}, this._config);
133
+ getConfig(insertionMode, dataUnit, ignoreReadOnlyFormFields) {
134
+ return insertionMode ? this.getInsertionConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true) : Object.assign({}, this._config);
127
135
  }
128
136
  getFormConfigFetcher() {
129
137
  if (this._formConfigFetcher == undefined) {
@@ -146,6 +146,10 @@ const snkCrudMessages = {
146
146
 
147
147
  const snkSimpleCrudMessages = {
148
148
  findColumn: "Busca de colunas",
149
+ formConfigUnavaliable: {
150
+ title: "Aviso",
151
+ message: 'A opção "Configurar formulário" será disponibilizada em breve. Enquanto isso, acesse a configuração do fomulário através dos layouts anteriores, HTML5 ou Flex.'
152
+ }
149
153
  };
150
154
 
151
155
  const fileViewerMessages = {
@@ -286,7 +290,8 @@ const snkDataExporterMessages = {
286
290
  },
287
291
  message: {
288
292
  emailSuccess: "E-mail enviado com sucesso",
289
- exportError: "Usuário sem permissão",
293
+ exportError: "Falha ao exportar dados",
294
+ unknownFailure: "O motivo da falha não pode ser identificado.",
290
295
  exportPermission: "O usuário não possui permissão para exportar o arquivo.",
291
296
  },
292
297
  title: {
@@ -0,0 +1,133 @@
1
+ import { D as DataFetcher } from './DataFetcher-c1baf61d.js';
2
+ import { a as PreloadManager } from './pesquisa-fetcher-fe6f3826.js';
3
+ import { SortMode, ApplicationContext, UserInterface, DateUtils } from '@sankhyalabs/core';
4
+ import './index-0ece87a6.js';
5
+ import './ISave-d8c8bc59.js';
6
+ import '@sankhyalabs/ezui/dist/collection/utils/constants';
7
+ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
8
+ import './filter-item-type.enum-d45e026f.js';
9
+ import './form-config-fetcher-30fb808f.js';
10
+ import InMemoryFilterColumnDataSource from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
11
+
12
+ class CrudUtils {
13
+ static assertDefaultSorting(gridConfig, dataUnit) {
14
+ if (gridConfig && dataUnit) {
15
+ dataUnit.defaultSorting = gridConfig
16
+ .columns
17
+ .filter(col => col.ascending != undefined)
18
+ .sort((colA, colB) => colA.orderIndex - colB.orderIndex)
19
+ .map(({ name: field, ascending }) => {
20
+ const { dataType } = dataUnit.getField(field);
21
+ return { field, dataType, mode: ascending ? SortMode.ASC : SortMode.DESC };
22
+ });
23
+ }
24
+ }
25
+ static find(entityName, fields, criteria, onlyFirst = true, criteriaExpression, orderBy) {
26
+ const SERVICE_CRUD_FIND = "mge@crud.find";
27
+ let parsedFields = [];
28
+ let parsedCriteria = [];
29
+ let literalCriteria = {};
30
+ let application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
31
+ if (fields) {
32
+ if (!Array.isArray(fields)) {
33
+ throw new Error(application.messagesBuilder.getMessage("crudUtils.errorArray", null));
34
+ }
35
+ fields.forEach((fieldName) => {
36
+ parsedFields.push({
37
+ name: fieldName
38
+ });
39
+ });
40
+ }
41
+ if (criteria) {
42
+ for (const key in criteria) {
43
+ if (criteria.hasOwnProperty(key)) {
44
+ parsedCriteria.push({ nome: key, valor: criteria[key] });
45
+ }
46
+ }
47
+ }
48
+ if (criteriaExpression) {
49
+ literalCriteria = {
50
+ expression: {
51
+ $: criteriaExpression
52
+ }
53
+ };
54
+ }
55
+ let request = {
56
+ requestBody: {
57
+ entity: {
58
+ name: entityName,
59
+ criterio: parsedCriteria,
60
+ fields: {
61
+ field: parsedFields
62
+ },
63
+ literalCriteria: literalCriteria,
64
+ orderby: orderBy
65
+ }
66
+ }
67
+ };
68
+ return new Promise((resolve) => {
69
+ DataFetcher.get().callServiceBroker(SERVICE_CRUD_FIND, JSON.stringify(request)).then((result) => {
70
+ var _a;
71
+ let entities = (_a = result.entidades) === null || _a === void 0 ? void 0 : _a.entidade;
72
+ if (entities != undefined) {
73
+ let crudFindResult = {
74
+ fields: new Map()
75
+ };
76
+ for (let key in entities) {
77
+ let fieldValue = entities[key];
78
+ if (fieldValue.hasOwnProperty('$')) {
79
+ crudFindResult.fields.set(key, fieldValue.$);
80
+ }
81
+ if (onlyFirst) {
82
+ break;
83
+ }
84
+ }
85
+ resolve(crudFindResult);
86
+ }
87
+ else {
88
+ resolve(null);
89
+ }
90
+ });
91
+ });
92
+ }
93
+ }
94
+
95
+ class SnkMultiSelectionListDataSource {
96
+ setDataUnit(dataUnit) {
97
+ this._dataUnit = dataUnit;
98
+ }
99
+ setApplication(application) {
100
+ this._application = application;
101
+ }
102
+ formatLabel(fieldName, value) {
103
+ const { userInterface } = this._dataUnit.getField(fieldName);
104
+ if (userInterface === UserInterface.DATETIME) {
105
+ return DateUtils.formatDate(this._dataUnit.valueFromString(fieldName, value));
106
+ }
107
+ return String(this._dataUnit.getFormattedValue(fieldName, value));
108
+ }
109
+ async getStaticOptions(fieldName) {
110
+ if (fieldName == undefined) {
111
+ return Promise.resolve(undefined);
112
+ }
113
+ return Promise.resolve(await PreloadManager.getDistinct(this._dataUnit, fieldName));
114
+ }
115
+ fetchData(filterTerm, fieldName) {
116
+ return new Promise(resolve => {
117
+ this._application.executeSelectDistinct(this._dataUnit, fieldName, filterTerm).then(result => {
118
+ resolve(result.map(item => {
119
+ const field = this._dataUnit.getField(fieldName);
120
+ if (field.userInterface === UserInterface.SEARCH) {
121
+ return Object.assign(Object.assign({}, JSON.parse(item)), { check: true });
122
+ }
123
+ return { value: item, label: this.formatLabel(fieldName, item), check: true };
124
+ }));
125
+ });
126
+ });
127
+ }
128
+ sortItems(fieldName, items) {
129
+ return InMemoryFilterColumnDataSource.defaultSorterMultSelectionOption(this._dataUnit, fieldName, items);
130
+ }
131
+ }
132
+
133
+ export { CrudUtils as C, SnkMultiSelectionListDataSource as S };
@@ -1,5 +1,5 @@
1
1
  import { ObjectUtils } from '@sankhyalabs/core';
2
- import { R as ResourceFetcher } from './form-config-fetcher-f121f880.js';
2
+ import { R as ResourceFetcher } from './form-config-fetcher-30fb808f.js';
3
3
 
4
4
  class AuthFetcher extends ResourceFetcher {
5
5
  getData(resourceID) {
@@ -1,4 +1,4 @@
1
- import { d as dist, D as DataFetcher } from './DataFetcher-a650ae58.js';
1
+ import { d as dist, D as DataFetcher } from './DataFetcher-c1baf61d.js';
2
2
  import { ObjectUtils } from '@sankhyalabs/core';
3
3
 
4
4
  class ResourceFetcher {
@@ -230,6 +230,18 @@ class FormConfigFetcher extends ResourceFetcher {
230
230
  }
231
231
  return `cfg://${authority}/${resourceID}`;
232
232
  }
233
+ async fetchLegacyConfigurableForm(configName) {
234
+ const payload = { 'requestBody': { 'config': { 'chave': configName, 'tipo': 'T' } } };
235
+ const response = await DataFetcher.get().callServiceBroker('SystemUtilsSP.getConf', JSON.stringify(payload));
236
+ if (ObjectUtils.isEmpty(response))
237
+ return undefined;
238
+ return this.buildLegacyConfigurableForm(response);
239
+ }
240
+ buildLegacyConfigurableForm(config) {
241
+ var _a, _b, _c;
242
+ const rawFields = (_c = (_b = (_a = config === null || config === void 0 ? void 0 : config.formConfig) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.field) !== null && _c !== void 0 ? _c : [];
243
+ return { emptyConfig: false, fields: Array.isArray(rawFields) ? rawFields : [rawFields] };
244
+ }
233
245
  }
234
246
  var UserConfigType;
235
247
  (function (UserConfigType) {
@@ -2182,10 +2182,6 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2182
2182
  return import(
2183
2183
  /* webpackMode: "lazy" */
2184
2184
  './snk-attach.entry.js').then(processMod, consoleError);
2185
- case 'snk-grid-config':
2186
- return import(
2187
- /* webpackMode: "lazy" */
2188
- './snk-grid-config.entry.js').then(processMod, consoleError);
2189
2185
  case 'snk-simple-crud':
2190
2186
  return import(
2191
2187
  /* webpackMode: "lazy" */
@@ -2194,10 +2190,6 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2194
2190
  return import(
2195
2191
  /* webpackMode: "lazy" */
2196
2192
  './snk-personalized-filter.entry.js').then(processMod, consoleError);
2197
- case 'snk-select-box':
2198
- return import(
2199
- /* webpackMode: "lazy" */
2200
- './snk-select-box.entry.js').then(processMod, consoleError);
2201
2193
  case 'snk-filter-advanced-mode_2':
2202
2194
  return import(
2203
2195
  /* webpackMode: "lazy" */
@@ -2206,10 +2198,10 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2206
2198
  return import(
2207
2199
  /* webpackMode: "lazy" */
2208
2200
  './snk-filter-detail.entry.js').then(processMod, consoleError);
2209
- case 'snk-actions-button_2':
2201
+ case 'snk-actions-button_4':
2210
2202
  return import(
2211
2203
  /* webpackMode: "lazy" */
2212
- './snk-actions-button_2.entry.js').then(processMod, consoleError);
2204
+ './snk-actions-button_4.entry.js').then(processMod, consoleError);
2213
2205
  case 'snk-simple-bar':
2214
2206
  return import(
2215
2207
  /* webpackMode: "lazy" */