@sankhyalabs/sankhyablocks 8.3.2 → 8.4.0-dev.2

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 (253) hide show
  1. package/dist/cjs/{ConfigStorage-4dd5e72c.js → ConfigStorage-0e4275f5.js} +163 -51
  2. package/dist/cjs/{DataFetcher-65199c00.js → DataFetcher-bd3d53a8.js} +78 -234
  3. package/dist/cjs/ISave-d68ce3cd.js +8 -0
  4. package/dist/cjs/PrintUtils-bcaeb82f.js +215 -0
  5. package/dist/cjs/ResourceIDUtils-5ff86aa7.js +12 -0
  6. package/dist/cjs/{SnkFormConfigManager-44717597.js → SnkFormConfigManager-5b485cd4.js} +19 -21
  7. package/dist/cjs/{auth-fetcher-7ed6d3e3.js → auth-fetcher-1583fe43.js} +2 -2
  8. package/dist/cjs/{dataunit-fetcher-102030d8.js → dataunit-fetcher-910be4ce.js} +1 -1
  9. package/dist/cjs/{form-config-fetcher-49993843.js → form-config-fetcher-f6cb55e6.js} +66 -3
  10. package/dist/cjs/index-f9e81701.js +4 -0
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/{pesquisa-fetcher-23adae20.js → pesquisa-fetcher-3356b3df.js} +1 -1
  13. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  14. package/dist/cjs/snk-actions-button.cjs.entry.js +19 -11
  15. package/dist/cjs/snk-application.cjs.entry.js +60 -44
  16. package/dist/cjs/snk-attach.cjs.entry.js +9 -14
  17. package/dist/cjs/snk-configurator.cjs.entry.js +2 -1
  18. package/dist/cjs/snk-crud.cjs.entry.js +28 -11
  19. package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -2
  20. package/dist/cjs/{snk-data-unit-e89e07bd.js → snk-data-unit-7cc1846d.js} +5 -5
  21. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  22. package/dist/cjs/snk-detail-view.cjs.entry.js +17 -13
  23. package/dist/cjs/snk-entity-list.cjs.entry.js +0 -4
  24. package/dist/cjs/snk-filter-bar.cjs.entry.js +15 -17
  25. package/dist/cjs/snk-filter-detail.cjs.entry.js +7 -16
  26. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +6 -19
  27. package/dist/cjs/snk-form-config.cjs.entry.js +7 -17
  28. package/dist/cjs/snk-form-view.cjs.entry.js +6 -1
  29. package/dist/cjs/snk-form.cjs.entry.js +13 -8
  30. package/dist/cjs/snk-grid-config.cjs.entry.js +6 -6
  31. package/dist/cjs/snk-grid.cjs.entry.js +23 -22
  32. package/dist/cjs/{snk-guides-viewer-83cd2f15.js → snk-guides-viewer-5e22097d.js} +19 -8
  33. package/dist/cjs/snk-guides-viewer.cjs.entry.js +10 -9
  34. package/dist/cjs/snk-personalized-filter.cjs.entry.js +14 -16
  35. package/dist/cjs/snk-print-selector.cjs.entry.js +2 -4
  36. package/dist/cjs/snk-simple-crud.cjs.entry.js +43 -85
  37. package/dist/cjs/snk-taskbar-custom-elements.cjs.entry.js +20 -0
  38. package/dist/cjs/snk-taskbar.cjs.entry.js +71 -5
  39. package/dist/cjs/{taskbar-elements-b98dd6e9.js → taskbar-elements-39949c7a.js} +4 -4
  40. package/dist/collection/collection-manifest.json +1 -0
  41. package/dist/collection/components/snk-actions-button/actions/index.js +3 -4
  42. package/dist/collection/components/snk-actions-button/snk-actions-button.js +8 -4
  43. package/dist/collection/components/snk-application/snk-application.js +120 -65
  44. package/dist/collection/components/snk-configurator/snk-configurator.js +19 -1
  45. package/dist/collection/components/snk-crud/snk-crud.js +44 -8
  46. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +60 -2
  47. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +27 -1
  48. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +65 -28
  49. package/dist/collection/components/snk-data-unit/snk-data-unit.js +22 -6
  50. package/dist/collection/components/snk-entity-list/snk-entity-list.js +0 -23
  51. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +8 -13
  52. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
  53. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +21 -16
  54. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +28 -12
  55. package/dist/collection/components/snk-form/SnkFormConfigManager.js +17 -19
  56. package/dist/collection/components/snk-form/snk-form.js +46 -2
  57. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +5 -15
  58. package/dist/collection/components/snk-grid/snk-grid.js +108 -16
  59. package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +19 -1
  60. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +28 -12
  61. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +23 -1
  62. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +4 -4
  63. package/dist/collection/components/snk-taskbar/snk-taskbar-custom-elements.js +43 -0
  64. package/dist/collection/components/snk-taskbar/snk-taskbar.css +4 -0
  65. package/dist/collection/components/snk-taskbar/snk-taskbar.js +126 -5
  66. package/dist/collection/lib/configs/ConfigStorage.js +33 -44
  67. package/dist/collection/lib/dataUnit/InMemoryLoader.js +23 -71
  68. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +47 -32
  69. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +0 -24
  70. package/dist/collection/lib/index.js +10 -0
  71. package/dist/collection/lib/resourceid/ResourceIDUtils.js +7 -0
  72. package/dist/collection/lib/utils/PrintUtils.js +18 -9
  73. package/dist/collection/lib/utils/urlutils.js +29 -0
  74. package/dist/components/ConfigStorage.js +161 -48
  75. package/dist/components/DataFetcher.js +79 -234
  76. package/dist/components/PrintUtils.js +213 -0
  77. package/dist/components/ResourceIDUtils.js +10 -0
  78. package/dist/components/SnkFormConfigManager.js +17 -19
  79. package/dist/components/auth-fetcher.js +1 -1
  80. package/dist/components/form-config-fetcher.js +64 -2
  81. package/dist/components/index.d.ts +1 -0
  82. package/dist/components/index.js +1 -0
  83. package/dist/components/snk-actions-button2.js +23 -9
  84. package/dist/components/snk-application2.js +145 -129
  85. package/dist/components/snk-attach2.js +1 -8
  86. package/dist/components/snk-configurator2.js +3 -1
  87. package/dist/components/snk-crud.js +27 -8
  88. package/dist/components/snk-data-unit2.js +6 -5
  89. package/dist/components/snk-detail-view2.js +26 -10
  90. package/dist/components/snk-entity-list.js +0 -4
  91. package/dist/components/snk-filter-bar2.js +12 -12
  92. package/dist/components/snk-filter-detail2.js +8 -13
  93. package/dist/components/snk-filter-modal-item2.js +5 -16
  94. package/dist/components/snk-form-config2.js +5 -15
  95. package/dist/components/snk-form-view2.js +6 -1
  96. package/dist/components/snk-form.js +9 -2
  97. package/dist/components/snk-grid-config2.js +4 -2
  98. package/dist/components/snk-grid2.js +24 -17
  99. package/dist/components/snk-personalized-filter2.js +11 -11
  100. package/dist/components/snk-print-selector.js +1 -1
  101. package/dist/components/snk-simple-crud2.js +30 -73
  102. package/dist/components/snk-taskbar-custom-elements.d.ts +11 -0
  103. package/dist/components/snk-taskbar-custom-elements.js +35 -0
  104. package/dist/components/snk-taskbar2.js +81 -9
  105. package/dist/esm/{ConfigStorage-d0e26692.js → ConfigStorage-f359573c.js} +162 -49
  106. package/dist/esm/{DataFetcher-4f5ad71c.js → DataFetcher-8daff9ad.js} +79 -234
  107. package/dist/esm/ISave-4412b20c.js +8 -0
  108. package/dist/esm/PrintUtils-3e4ff0f5.js +213 -0
  109. package/dist/esm/ResourceIDUtils-a114189a.js +10 -0
  110. package/dist/esm/{SnkFormConfigManager-457554ca.js → SnkFormConfigManager-35876bad.js} +19 -21
  111. package/dist/esm/{auth-fetcher-852e26c9.js → auth-fetcher-299fed55.js} +1 -1
  112. package/dist/esm/{dataunit-fetcher-97dd5148.js → dataunit-fetcher-bd8f9572.js} +1 -1
  113. package/dist/esm/{form-config-fetcher-ff72a867.js → form-config-fetcher-8ef7be16.js} +65 -3
  114. package/dist/esm/index-a7d3d3f1.js +4 -0
  115. package/dist/esm/loader.js +1 -1
  116. package/dist/esm/{pesquisa-fetcher-d82df64b.js → pesquisa-fetcher-27819123.js} +1 -1
  117. package/dist/esm/sankhyablocks.js +1 -1
  118. package/dist/esm/snk-actions-button.entry.js +19 -11
  119. package/dist/esm/snk-application.entry.js +60 -44
  120. package/dist/esm/snk-attach.entry.js +5 -10
  121. package/dist/esm/snk-configurator.entry.js +2 -1
  122. package/dist/esm/snk-crud.entry.js +30 -13
  123. package/dist/esm/snk-data-exporter.entry.js +3 -2
  124. package/dist/esm/{snk-data-unit-8c4d944d.js → snk-data-unit-1715d2f1.js} +5 -5
  125. package/dist/esm/snk-data-unit.entry.js +1 -1
  126. package/dist/esm/snk-detail-view.entry.js +17 -13
  127. package/dist/esm/snk-entity-list.entry.js +0 -4
  128. package/dist/esm/snk-filter-bar.entry.js +15 -17
  129. package/dist/esm/snk-filter-detail.entry.js +8 -17
  130. package/dist/esm/snk-filter-modal-item.entry.js +7 -20
  131. package/dist/esm/snk-form-config.entry.js +8 -18
  132. package/dist/esm/snk-form-view.entry.js +6 -1
  133. package/dist/esm/snk-form.entry.js +13 -8
  134. package/dist/esm/snk-grid-config.entry.js +6 -6
  135. package/dist/esm/snk-grid.entry.js +23 -22
  136. package/dist/esm/{snk-guides-viewer-202c3c4d.js → snk-guides-viewer-b0e32a7d.js} +19 -8
  137. package/dist/esm/snk-guides-viewer.entry.js +10 -9
  138. package/dist/esm/snk-personalized-filter.entry.js +14 -16
  139. package/dist/esm/snk-print-selector.entry.js +1 -3
  140. package/dist/esm/snk-simple-crud.entry.js +34 -76
  141. package/dist/esm/snk-taskbar-custom-elements.entry.js +16 -0
  142. package/dist/esm/snk-taskbar.entry.js +71 -5
  143. package/dist/esm/{taskbar-elements-2c761819.js → taskbar-elements-0a6b8b95.js} +4 -4
  144. package/dist/sankhyablocks/p-0df2ead8.entry.js +11 -0
  145. package/dist/sankhyablocks/p-324ce41e.entry.js +1 -0
  146. package/dist/sankhyablocks/p-34604220.entry.js +1 -0
  147. package/dist/sankhyablocks/p-648a7c72.entry.js +1 -0
  148. package/dist/sankhyablocks/p-688dcb4c.js +1 -0
  149. package/dist/sankhyablocks/p-6a38bda5.entry.js +1 -0
  150. package/dist/sankhyablocks/p-72fc257b.entry.js +1 -0
  151. package/dist/sankhyablocks/p-7bcd2f89.js +56 -0
  152. package/dist/sankhyablocks/p-7bd5aea7.js +1 -0
  153. package/dist/sankhyablocks/p-8014cc25.entry.js +1 -0
  154. package/dist/sankhyablocks/p-8d884fab.js +1 -0
  155. package/dist/sankhyablocks/p-928efcaa.entry.js +1 -0
  156. package/dist/sankhyablocks/p-989937ee.entry.js +1 -0
  157. package/dist/sankhyablocks/p-9a270401.entry.js +1 -0
  158. package/dist/sankhyablocks/p-9e7d65a4.js +1 -0
  159. package/dist/sankhyablocks/p-a7ee0e6f.entry.js +1 -0
  160. package/dist/sankhyablocks/p-ac0556a3.js +1 -0
  161. package/dist/sankhyablocks/p-af2d9aea.entry.js +1 -0
  162. package/dist/sankhyablocks/{p-435259af.js → p-b13cb8b5.js} +2 -2
  163. package/dist/sankhyablocks/p-b244640b.js +1 -0
  164. package/dist/sankhyablocks/p-bba91710.entry.js +1 -0
  165. package/dist/sankhyablocks/p-c555075c.entry.js +1 -0
  166. package/dist/sankhyablocks/p-c870b530.js +26 -0
  167. package/dist/sankhyablocks/{p-a2493d11.js → p-c9841939.js} +1 -1
  168. package/dist/sankhyablocks/p-d4f9ee17.entry.js +1 -0
  169. package/dist/sankhyablocks/p-d708b4ab.entry.js +1 -0
  170. package/dist/sankhyablocks/p-d84bc5c1.js +1 -0
  171. package/dist/sankhyablocks/{p-7d9302e2.js → p-de76b8a8.js} +1 -1
  172. package/dist/sankhyablocks/p-e19014a9.entry.js +1 -0
  173. package/dist/sankhyablocks/p-e1cb1f0b.js +1 -0
  174. package/dist/sankhyablocks/p-e9b53a9a.entry.js +1 -0
  175. package/dist/sankhyablocks/p-ebf8c5df.entry.js +1 -0
  176. package/dist/sankhyablocks/p-ed5f1204.entry.js +1 -0
  177. package/dist/sankhyablocks/p-f94b999e.entry.js +1 -0
  178. package/dist/sankhyablocks/p-fb1ecd0b.entry.js +1 -0
  179. package/dist/sankhyablocks/p-fd15aaac.entry.js +1 -0
  180. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  181. package/dist/types/components/snk-actions-button/actions/index.d.ts +2 -1
  182. package/dist/types/components/snk-application/snk-application.d.ts +9 -22
  183. package/dist/types/components/snk-configurator/snk-configurator.d.ts +4 -0
  184. package/dist/types/components/snk-crud/snk-crud.d.ts +6 -0
  185. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +12 -0
  186. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +5 -0
  187. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +13 -2
  188. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +4 -0
  189. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +0 -4
  190. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +0 -3
  191. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -1
  192. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +5 -4
  193. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  194. package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +5 -4
  195. package/dist/types/components/snk-form/snk-form.d.ts +9 -1
  196. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +0 -2
  197. package/dist/types/components/snk-grid/snk-grid.d.ts +17 -1
  198. package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +4 -0
  199. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +5 -1
  200. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -0
  201. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +2 -2
  202. package/dist/types/components/snk-taskbar/snk-taskbar-custom-elements.d.ts +7 -0
  203. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +27 -0
  204. package/dist/types/components.d.ts +203 -22
  205. package/dist/types/lib/configs/ConfigStorage.d.ts +11 -13
  206. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -8
  207. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
  208. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +0 -1
  209. package/dist/types/lib/index.d.ts +11 -0
  210. package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +3 -0
  211. package/dist/types/lib/utils/PrintUtils.d.ts +1 -0
  212. package/dist/types/lib/utils/urlutils.d.ts +14 -0
  213. package/package.json +2 -2
  214. package/react/components.d.ts +1 -0
  215. package/react/components.js +1 -0
  216. package/react/components.js.map +1 -1
  217. package/dist/cjs/filter-bar-config-fetcher-2ab64f92.js +0 -155
  218. package/dist/cjs/resource-fetcher-8d12fee7.js +0 -68
  219. package/dist/components/filter-bar-config-fetcher.js +0 -153
  220. package/dist/components/resource-fetcher.js +0 -66
  221. package/dist/esm/filter-bar-config-fetcher-1093db95.js +0 -153
  222. package/dist/esm/resource-fetcher-be4d1ba4.js +0 -66
  223. package/dist/sankhyablocks/p-030a2da4.entry.js +0 -1
  224. package/dist/sankhyablocks/p-1208becf.entry.js +0 -1
  225. package/dist/sankhyablocks/p-17724bee.entry.js +0 -1
  226. package/dist/sankhyablocks/p-216f081a.entry.js +0 -1
  227. package/dist/sankhyablocks/p-37b17041.js +0 -1
  228. package/dist/sankhyablocks/p-3916c825.entry.js +0 -1
  229. package/dist/sankhyablocks/p-3ffad8ca.entry.js +0 -1
  230. package/dist/sankhyablocks/p-44fe945a.entry.js +0 -1
  231. package/dist/sankhyablocks/p-4fc5a0db.entry.js +0 -1
  232. package/dist/sankhyablocks/p-564efc43.js +0 -1
  233. package/dist/sankhyablocks/p-5add4151.entry.js +0 -1
  234. package/dist/sankhyablocks/p-5de83141.entry.js +0 -1
  235. package/dist/sankhyablocks/p-6be9191f.entry.js +0 -1
  236. package/dist/sankhyablocks/p-6ee5d42c.js +0 -1
  237. package/dist/sankhyablocks/p-72d7f00c.js +0 -56
  238. package/dist/sankhyablocks/p-7352acf8.entry.js +0 -1
  239. package/dist/sankhyablocks/p-8115f7a2.js +0 -1
  240. package/dist/sankhyablocks/p-8903ffc6.js +0 -1
  241. package/dist/sankhyablocks/p-8dbb4c6c.entry.js +0 -11
  242. package/dist/sankhyablocks/p-935bfc1c.entry.js +0 -1
  243. package/dist/sankhyablocks/p-9395cf73.entry.js +0 -1
  244. package/dist/sankhyablocks/p-9d36d914.js +0 -17
  245. package/dist/sankhyablocks/p-aa6f27bd.entry.js +0 -1
  246. package/dist/sankhyablocks/p-aeaa5253.js +0 -10
  247. package/dist/sankhyablocks/p-befbc9ee.entry.js +0 -1
  248. package/dist/sankhyablocks/p-c1273e40.js +0 -1
  249. package/dist/sankhyablocks/p-c32b9d7c.entry.js +0 -1
  250. package/dist/sankhyablocks/p-c6380ea2.entry.js +0 -1
  251. package/dist/sankhyablocks/p-de69b4b0.entry.js +0 -1
  252. package/dist/sankhyablocks/p-f5c33da3.entry.js +0 -1
  253. package/dist/sankhyablocks/p-f847d53a.entry.js +0 -1
@@ -1,20 +1,21 @@
1
- export { S as snk_guides_viewer } from './snk-guides-viewer-202c3c4d.js';
1
+ export { S as snk_guides_viewer } from './snk-guides-viewer-b0e32a7d.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
- import './SnkFormConfigManager-457554ca.js';
5
- import './ConfigStorage-d0e26692.js';
6
- import './form-config-fetcher-ff72a867.js';
7
- import './DataFetcher-4f5ad71c.js';
4
+ import './SnkFormConfigManager-35876bad.js';
5
+ import './ConfigStorage-f359573c.js';
6
+ import './form-config-fetcher-8ef7be16.js';
7
+ import './DataFetcher-8daff9ad.js';
8
8
  import './_commonjsHelpers-9943807e.js';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
- import './resource-fetcher-be4d1ba4.js';
11
- import './filter-bar-config-fetcher-1093db95.js';
10
+ import './PrintUtils-3e4ff0f5.js';
12
11
  import './filter-item-type.enum-5028ed3f.js';
13
12
  import '@sankhyalabs/ezui/dist/collection/utils/form';
14
13
  import './taskbar-processor-94402e6e.js';
15
- import './taskbar-elements-2c761819.js';
14
+ import './taskbar-elements-0a6b8b95.js';
16
15
  import './index-1564817d.js';
17
16
  import './index-bdf75557.js';
18
17
  import './constants-3644f1b6.js';
19
- import './pesquisa-fetcher-d82df64b.js';
18
+ import './pesquisa-fetcher-27819123.js';
19
+ import './ISave-4412b20c.js';
20
+ import '@sankhyalabs/ezui/dist/collection/utils/constants';
20
21
  import '@sankhyalabs/core/dist/dataunit/DataUnit';
@@ -1,17 +1,16 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-a7d3d3f1.js';
2
2
  import { StringUtils, ObjectUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-75fb0106.js';
4
- import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-d0e26692.js';
4
+ import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-f359573c.js';
5
5
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
6
6
  import { a as FilterGroupCondition } from './index-ae591a44.js';
7
7
  import { s as store } from './index-bdf75557.js';
8
8
  import './filter-item-type.enum-5028ed3f.js';
9
- import './form-config-fetcher-ff72a867.js';
10
- import './DataFetcher-4f5ad71c.js';
9
+ import './form-config-fetcher-8ef7be16.js';
10
+ import './DataFetcher-8daff9ad.js';
11
11
  import './_commonjsHelpers-9943807e.js';
12
12
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
13
- import './resource-fetcher-be4d1ba4.js';
14
- import './filter-bar-config-fetcher-1093db95.js';
13
+ import './PrintUtils-3e4ff0f5.js';
15
14
 
16
15
  const snkPersonalizedFilterCss = ".sc-snk-personalized-filter-h{display:flex;height:100%;padding:var(--space--large, 24px);--snk-personalized-filter--width:100%;--snk-personalized-filter--height:100%;--snk-personalized-filter--background-color-line:var(--color--disable-secondary);--snk-personalized-filter--margin-line:var(--border--radius-medium, 12px)}.snk-personalized-filter.sc-snk-personalized-filter{height:var(--snk-personalized-filter--width);width:var(--snk-personalized-filter--height)}.snk-personalized-filter__header-actions.sc-snk-personalized-filter{display:flex;gap:var(--space--medium)}.snk-personalized-filter__group.sc-snk-personalized-filter{flex:1}.snk-personalized-filter__expression-input--line.sc-snk-personalized-filter{width:100%;height:2px;background-color:var(--snk-personalized-filter--background-color-line);margin-top:var(--snk-personalized-filter--margin-line);margin-bottom:var(--snk-personalized-filter--margin-line)}.ez-box__main.sc-snk-personalized-filter{height:90%}.snk-personalized-filter__button-mode.sc-snk-personalized-filter{height:35px}";
17
16
 
@@ -41,6 +40,7 @@ const SnkPersonalizedFilter = class {
41
40
  this.entityUri = undefined;
42
41
  this.filterId = undefined;
43
42
  this.configName = undefined;
43
+ this.resourceID = undefined;
44
44
  }
45
45
  /*
46
46
  * Cria um novo filtro se não houver nenhum filtro existente
@@ -77,17 +77,15 @@ const SnkPersonalizedFilter = class {
77
77
  this._filterAssistent = ObjectUtils.copy(newPersonalizedFilter);
78
78
  }
79
79
  loadFilter(newValue, oldValue) {
80
- if (newValue == null || oldValue == newValue) {
80
+ if (newValue == null || oldValue == newValue || this.resourceID == undefined) {
81
81
  return;
82
82
  }
83
- ConfigStorage.get().then((_instance) => {
84
- ConfigStorage.loadPersonalizedFilter(newValue, this.configName)
85
- .then((resp) => {
86
- const personalizedFilter = this.addLabelToItems(resp);
87
- this._filterAssistent = personalizedFilter;
88
- this._originalFilterAssistent = ObjectUtils.copy(personalizedFilter);
89
- this._filterAssistentMode = this._filterAssistent.hasOwnProperty("assistent") && this._filterAssistent.assistent != undefined;
90
- });
83
+ ConfigStorage.loadPersonalizedFilter(newValue, this.resourceID, this.configName)
84
+ .then((resp) => {
85
+ const personalizedFilter = this.addLabelToItems(resp);
86
+ this._filterAssistent = personalizedFilter;
87
+ this._originalFilterAssistent = ObjectUtils.copy(personalizedFilter);
88
+ this._filterAssistentMode = this._filterAssistent.hasOwnProperty("assistent") && this._filterAssistent.assistent != undefined;
91
89
  });
92
90
  }
93
91
  componentWillLoad() {
@@ -112,7 +110,7 @@ const SnkPersonalizedFilter = class {
112
110
  return this._application.messagesBuilder.getMessage(key, params);
113
111
  }
114
112
  saveFilter() {
115
- ConfigStorage.savePersonalizedFilter(this._filterAssistent, this.configName).then((personalizedFilter) => {
113
+ ConfigStorage.savePersonalizedFilter(this._filterAssistent, this.resourceID, this.configName).then((personalizedFilter) => {
116
114
  this._elButtonSave.enabled = false;
117
115
  const messageToken = !!this._filterAssistent.id ? 'confirmEdit' : 'confirmSave';
118
116
  ApplicationUtils.info(this.getMessage(`snkPersonalizedFilter.${messageToken}.title`), { iconName: "check" });
@@ -123,7 +121,7 @@ const SnkPersonalizedFilter = class {
123
121
  });
124
122
  }
125
123
  removeFilter() {
126
- ConfigStorage.removePersonalizedFilter(this._filterAssistent, this.configName);
124
+ ConfigStorage.removePersonalizedFilter(this._filterAssistent, this.resourceID, this.configName);
127
125
  }
128
126
  hasChangesToSave() {
129
127
  return JSON.stringify(this._filterAssistent) === JSON.stringify(this._originalFilterAssistent);
@@ -1,10 +1,8 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
- import { P as PrintUtils } from './DataFetcher-4f5ad71c.js';
2
+ import { P as PrintUtils } from './PrintUtils-3e4ff0f5.js';
3
3
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
5
5
  import ModalButtonStatus from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container/modal-button-status';
6
- import './_commonjsHelpers-9943807e.js';
7
- import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
8
6
 
9
7
  const snkPrintSelectorCss = ".sc-snk-print-selector-h{max-height:100%}ez-modal-container.sc-snk-print-selector{--ez-modal-container-overflow-y:hidden}ez-list.sc-snk-print-selector{height:100%}.list-scroll.sc-snk-print-selector{height:100%;overflow-y:auto;padding-right:var(--snk-grid-config__main--padding-right)}.with-header.sc-snk-print-selector{max-height:calc(100% - 125px)}.without-header.sc-snk-print-selector{max-height:calc(100% - 85px)}.list-scroll.sc-snk-print-selector::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.hidden.sc-snk-print-selector{display:none}";
10
8
 
@@ -1,43 +1,61 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
- import { DataUnit, StringUtils, SortMode, DataType, ChangeOperation, ObjectUtils, ApplicationContext, UserInterface } from '@sankhyalabs/core';
2
+ import { DataUnit, defaultDataLoader, StringUtils, ChangeOperation, ObjectUtils, ApplicationContext, DataType, UserInterface } from '@sankhyalabs/core';
3
3
  import { c as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-3644f1b6.js';
4
- import { T as TaskbarElement } from './taskbar-elements-2c761819.js';
5
- import './DataFetcher-4f5ad71c.js';
6
- import './pesquisa-fetcher-d82df64b.js';
4
+ import { T as TaskbarElement } from './taskbar-elements-0a6b8b95.js';
5
+ import './DataFetcher-8daff9ad.js';
6
+ import './pesquisa-fetcher-27819123.js';
7
7
  import { P as PresentationMode } from './index-1564817d.js';
8
+ import './ISave-4412b20c.js';
9
+ import '@sankhyalabs/ezui/dist/collection/utils/constants';
10
+ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
+ import './filter-item-type.enum-5028ed3f.js';
12
+ import './form-config-fetcher-8ef7be16.js';
8
13
  import { T as TaskbarProcessor } from './taskbar-processor-94402e6e.js';
9
- import { DISTINCT_FILTER_NAME_PREFIX } from '@sankhyalabs/ezui/dist/collection/utils/constants';
10
14
  import { S as SnkMultiSelectionListDataSource } from './SnkMultiSelectionListDataSource-892f37f9.js';
11
15
  import './index-bdf75557.js';
12
16
  import './_commonjsHelpers-9943807e.js';
13
- import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
17
+ import './PrintUtils-3e4ff0f5.js';
14
18
 
15
19
  class InMemoryLoader {
16
20
  constructor(metadata, records) {
17
- this.records = records || [];
21
+ this.records = records;
18
22
  this.metadata = metadata;
19
23
  this._dataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
20
24
  this._dataUnit.metadataLoader = () => this.metadaLoader();
21
- this._dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
25
+ this._dataUnit.dataLoader = (dataUnit, request) => defaultDataLoader(dataUnit, request, this.getRecordsToLoad());
22
26
  this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
23
27
  this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
24
28
  this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
25
29
  }
30
+ getRecordsToLoad() {
31
+ if (this._initialRecords) {
32
+ try {
33
+ return this._initialRecords;
34
+ }
35
+ finally {
36
+ this._initialRecords = undefined;
37
+ }
38
+ }
39
+ return this.dataUnit.records;
40
+ }
26
41
  get dataUnit() {
27
42
  return this._dataUnit;
28
43
  }
29
44
  get records() {
30
- return this._records;
45
+ return this.dataUnit.records;
31
46
  }
32
47
  set records(records) {
33
- this._records = records === null || records === void 0 ? void 0 : records.map(record => {
48
+ const newRecords = records === null || records === void 0 ? void 0 : records.map(record => {
34
49
  if (!record["__record__id__"]) {
35
50
  record["__record__id__"] = this.generateUniqueId();
36
51
  }
37
52
  return record;
38
53
  });
39
54
  if (this._dataUnit) {
40
- this._dataUnit.records = [...this._records];
55
+ this._dataUnit.records = newRecords;
56
+ }
57
+ else {
58
+ this._initialRecords = newRecords;
41
59
  }
42
60
  }
43
61
  get metadata() {
@@ -55,76 +73,16 @@ class InMemoryLoader {
55
73
  metadaLoader() {
56
74
  return Promise.resolve(this._metadata);
57
75
  }
58
- dataLoader(dataUnit, request) {
59
- const filters = this.getColumnFilters(dataUnit);
60
- let records = this.applyFilters(filters);
61
- if (request.sort) {
62
- request.sort.forEach(sort => {
63
- records = records.sort((recordA, recordB) => {
64
- const fieldA = recordA[sort.field];
65
- const fieldB = recordB[sort.field];
66
- const sortFn = this.getSortFn(sort.dataType);
67
- return sortFn(fieldA, fieldB) * (sort.mode == SortMode.ASC ? 1 : -1);
68
- });
69
- });
70
- }
71
- return Promise.resolve({ records: records });
72
- }
73
- applyFilters(filters) {
74
- let records = [...this._records];
75
- filters.forEach(filter => {
76
- records = records.filter(record => { var _a; return filter.values.includes((_a = record[filter.column]) === null || _a === void 0 ? void 0 : _a.toString()); });
77
- });
78
- return records;
79
- }
80
- getColumnFilters(dataUnit) {
81
- var _a, _b;
82
- const allFilters = (_a = dataUnit.getFilters()) !== null && _a !== void 0 ? _a : [];
83
- const columnFilters = (_b = allFilters.filter(filter => { var _a; return (_a = filter.name) === null || _a === void 0 ? void 0 : _a.includes(DISTINCT_FILTER_NAME_PREFIX); })) !== null && _b !== void 0 ? _b : [];
84
- return columnFilters.map(filter => {
85
- var _a, _b;
86
- return {
87
- column: (_b = (_a = filter.name) === null || _a === void 0 ? void 0 : _a.replace(DISTINCT_FILTER_NAME_PREFIX, "")) !== null && _b !== void 0 ? _b : "",
88
- values: filter.params.map(param => param.value),
89
- };
90
- });
91
- }
92
- getSortFn(type) {
93
- switch (type) {
94
- case DataType.NUMBER:
95
- return this.sortNumber;
96
- case DataType.DATE:
97
- return this.sortDate;
98
- case DataType.OBJECT:
99
- return this.sortObject;
100
- default:
101
- return StringUtils.compare;
102
- }
103
- }
104
- sortObject(a, b) {
105
- return StringUtils.compare(a === null || a === void 0 ? void 0 : a["label"], b === null || b === void 0 ? void 0 : b["label"]);
106
- }
107
- sortNumber(a, b) {
108
- return a - b;
109
- }
110
- sortDate(a, b) {
111
- let timeA = a.getTime(), timeB = b.getTime();
112
- return timeA === timeB ? 0 : (timeA < timeB ? -1 : 1);
113
- }
114
76
  saveLoader(_dataUnit, changes) {
115
77
  return new Promise((resolve) => {
116
78
  let dataUnitRecords = [];
117
79
  changes.forEach(change => {
118
80
  let { record, updatingFields, operation } = change;
119
- let isAdd = false;
81
+ const changedRecord = Object.assign(Object.assign({}, record), updatingFields);
120
82
  if (operation === ChangeOperation.INSERT ||
121
83
  operation === ChangeOperation.COPY) {
122
- record["__old__id__"] = record["__record__id__"];
123
- record["__record__id__"] = this.generateUniqueId();
124
- isAdd = true;
125
- }
126
- const changedRecord = Object.assign(Object.assign({}, record), updatingFields);
127
- if (isAdd) {
84
+ changedRecord["__old__id__"] = record["__record__id__"];
85
+ changedRecord["__record__id__"] = this.generateUniqueId();
128
86
  this.records.push(changedRecord);
129
87
  }
130
88
  else {
@@ -138,7 +96,6 @@ class InMemoryLoader {
138
96
  }
139
97
  removeLoader(_dataUnit, recordIds) {
140
98
  return new Promise((resolve) => {
141
- this._records = this._records.filter(record => !recordIds.includes(record["__record__id__"]));
142
99
  resolve(recordIds);
143
100
  });
144
101
  }
@@ -153,6 +110,7 @@ const SnkSimpleCrud = class {
153
110
  this.dataStateChange = createEvent(this, "dataStateChange", 3);
154
111
  this.dataUnitReady = createEvent(this, "dataUnitReady", 3);
155
112
  this.actionClick = createEvent(this, "actionClick", 7);
113
+ this.formItemsReady = createEvent(this, "formItemsReady", 7);
156
114
  this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER"];
157
115
  this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER"];
158
116
  this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
@@ -319,7 +277,7 @@ const SnkSimpleCrud = class {
319
277
  }
320
278
  render() {
321
279
  var _a;
322
- return (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(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", 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, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
280
+ return (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(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", 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, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
323
281
  ? undefined
324
282
  : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
325
283
  }
@@ -0,0 +1,16 @@
1
+ import { r as registerInstance, h, H as Host } from './index-a7d3d3f1.js';
2
+
3
+ const snkTaskbarCss = ".sc-snk-taskbar-custom-elements-h{display:flex}.taskbar-custom-elements-container.sc-snk-taskbar-custom-elements{display:none}";
4
+
5
+ const SnkTaskbarCustomElements = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.slot = 'TASKBAR_CUSTOM_ELEMENTS';
9
+ }
10
+ render() {
11
+ return (h(Host, { slot: this.slot }, h("div", { id: this.slot, class: "taskbar-custom-elements-container" }, h("slot", null))));
12
+ }
13
+ };
14
+ SnkTaskbarCustomElements.style = snkTaskbarCss;
15
+
16
+ export { SnkTaskbarCustomElements as snk_taskbar_custom_elements };
@@ -1,16 +1,17 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { StringUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { A as AuthorizationConfig } from './AuthorizationConfig-dcbd207a.js';
4
- import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-2c761819.js';
4
+ import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-0a6b8b95.js';
5
5
  import { P as PresentationMode } from './index-1564817d.js';
6
6
  import './index-bdf75557.js';
7
7
 
8
- const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}";
8
+ const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}.taskbar-custom-elements-container.sc-snk-taskbar{display:none}";
9
9
 
10
10
  const SnkTaskbar = class {
11
11
  constructor(hostRef) {
12
12
  registerInstance(this, hostRef);
13
13
  this.actionClick = createEvent(this, "actionClick", 7);
14
+ this.TASKBAR_ITEM_ID_PREFIX = 'TASKBAR_ITEM_';
14
15
  this._titleKeyByElement = {
15
16
  [TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
16
17
  [TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
@@ -28,7 +29,13 @@ const SnkTaskbar = class {
28
29
  [TaskbarElement.ATTACH]: "snkTaskbar.titleAttach",
29
30
  };
30
31
  this._permissions = undefined;
32
+ this._customElements = undefined;
33
+ this._customElementsId = undefined;
34
+ this._slotContainer = undefined;
35
+ this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
36
+ this.customContainerId = undefined;
31
37
  this.configName = undefined;
38
+ this.resourceID = undefined;
32
39
  this.buttons = undefined;
33
40
  this.customButtons = undefined;
34
41
  this.actionsList = undefined;
@@ -167,14 +174,52 @@ const SnkTaskbar = class {
167
174
  return true;
168
175
  });
169
176
  }
177
+ appendCustomElementsInTaskbar() {
178
+ this._customElementsId.forEach(id => {
179
+ const elementId = id.replace(this.TASKBAR_ITEM_ID_PREFIX, '');
180
+ const customElement = this._customElements.get(elementId);
181
+ const container = this._element.querySelector(`#${id}`);
182
+ if (container) {
183
+ container === null || container === void 0 ? void 0 : container.appendChild(customElement);
184
+ }
185
+ else {
186
+ this.unlinkCustomElementFromTaskbar(customElement);
187
+ }
188
+ });
189
+ }
190
+ addCustomElementContainer(elem) {
191
+ const elementId = `${this.TASKBAR_ITEM_ID_PREFIX}${elem}`;
192
+ if (!this._customElementsId.includes(elementId)) {
193
+ this._customElementsId.push(elementId);
194
+ }
195
+ return h("span", { key: elementId, id: elementId });
196
+ }
197
+ getCustomElements() {
198
+ var _a, _b;
199
+ this._customElementsId = [];
200
+ this._customElements = new Map();
201
+ this._slotContainer = this.buildSlotContainer();
202
+ const customElementsArray = Array.from((_b = (_a = this._slotContainer) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : []);
203
+ customElementsArray.forEach(item => this._customElements.set(item.id, item));
204
+ }
205
+ buildSlotContainer() {
206
+ if (this.customContainerId) {
207
+ const container = document.querySelector(`#${this.customContainerId}`);
208
+ return container === null || container === void 0 ? void 0 : container.querySelector(`#${this.customSlotId}`);
209
+ }
210
+ else {
211
+ return this._element.querySelector(`#${this.customSlotId}`);
212
+ }
213
+ }
170
214
  componentWillLoad() {
171
215
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
172
216
  if (this._application) {
173
- this._application.getAllAccess().then(access => this._permissions = access);
217
+ this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
174
218
  }
175
219
  else {
176
220
  this._permissions = {};
177
221
  }
222
+ this.getCustomElements();
178
223
  }
179
224
  componentWillRender() {
180
225
  if (this._definitions == undefined && this._permissions) {
@@ -186,12 +231,30 @@ const SnkTaskbar = class {
186
231
  const dataInfo = { dataUnit: this.dataUnit };
187
232
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
188
233
  }
234
+ componentDidRender() {
235
+ this.appendCustomElementsInTaskbar();
236
+ }
237
+ disconnectedCallback() {
238
+ this.unlinkAllCustomElements();
239
+ }
240
+ unlinkAllCustomElements() {
241
+ var _a;
242
+ (_a = this._customElementsId) === null || _a === void 0 ? void 0 : _a.forEach(id => {
243
+ const elementId = id.replace(this.TASKBAR_ITEM_ID_PREFIX, '');
244
+ const customElement = this._customElements.get(elementId);
245
+ this.unlinkCustomElementFromTaskbar(customElement);
246
+ });
247
+ }
248
+ unlinkCustomElementFromTaskbar(customElement) {
249
+ this._slotContainer.appendChild(customElement);
250
+ }
189
251
  render() {
190
252
  if (this._definitions === undefined) {
191
253
  return undefined;
192
254
  }
193
255
  let index = 0;
194
256
  return (h(Host, null, this.removeEmpty(this._definitions.map((elem) => {
257
+ var _a;
195
258
  if (elem === TaskbarElement.DIVIDER) {
196
259
  index = 0;
197
260
  }
@@ -201,11 +264,14 @@ const SnkTaskbar = class {
201
264
  if (TaskbarElement[elem]) {
202
265
  return this.getElement(index, TaskbarElement[elem]);
203
266
  }
204
- if (this.customButtons.has(elem)) {
267
+ if ((_a = this.customButtons) === null || _a === void 0 ? void 0 : _a.has(elem)) {
205
268
  return this.getElement(index, this.customButtons.get(elem));
206
269
  }
270
+ if (this._customElements.has(elem)) {
271
+ return this.addCustomElementContainer(elem);
272
+ }
207
273
  return h("slot", { name: elem });
208
- }))));
274
+ })), h("div", { class: "taskbar-custom-elements-container" }, h("slot", { name: this.customSlotId }))));
209
275
  }
210
276
  get _element() { return getElement(this); }
211
277
  static get watchers() { return {
@@ -100,18 +100,18 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
100
100
  }
101
101
  };
102
102
  function textButton(name, className, dataElementId, text, title, action, isEnabled) {
103
- return h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
103
+ return h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
104
104
  }
105
105
  function iconButton(iconName, name, className, dataElementId, title, action, isEnabled) {
106
- return h("ez-button", { title: title, mode: "icon", size: "small", class: className, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
106
+ return h("ez-button", { key: dataElementId, title: title, mode: "icon", size: "small", class: className, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
107
107
  }
108
108
  function iconTextButton(iconName, name, className, dataElementId, text, title, action, isEnabled) {
109
- return h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) },
109
+ return h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) },
110
110
  h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
111
111
  }
112
112
  function actionButton(element, className, dataElementId, title, action, isEnabled, actions) {
113
113
  return actions && actions.length > 0
114
- ? h("ez-actions-button", { title: title, size: "small", "data-element-id": dataElementId, arrowActive: true, class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions })
114
+ ? h("ez-actions-button", { key: dataElementId, title: title, size: "small", "data-element-id": dataElementId, arrowActive: true, class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions })
115
115
  : undefined;
116
116
  }
117
117
 
@@ -0,0 +1,11 @@
1
+ import{r as t,c as s,h as e,g as i}from"./p-d2d301a6.js";import{WaitingChangeException as n,WarningException as r,ErrorException as a,ObjectUtils as o,DateUtils as c,StringUtils as h,OnboardingUtils as u,DependencyType as l,ElementIDUtils as p,ApplicationContext as d,ErrorTracking as m,DataType as w}from"@sankhyalabs/core";import{d as f,D as y,U as P}from"./p-ac0556a3.js";import{ApplicationUtils as g}from"@sankhyalabs/ezui/dist/collection/utils";import{P as I}from"./p-b13cb8b5.js";import{C as _}from"./p-7bcd2f89.js";import{D as v}from"./p-de76b8a8.js";import{A,a as S}from"./p-b244640b.js";import{S as E}from"./p-ae6aff81.js";import"./p-112455b1.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-8d884fab.js";import"./p-c870b530.js";import"./p-584d7212.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";class b{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}rejectionHandler(t){const s=t.reason;s instanceof n||(s?this.processException(s):this._app.isDebugMode().then((t=>{t&&this._app.error("Promise rejeitada","Erro interno: Uma promise foi rejeitada sem razão determinada.")})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return'<br><a href="#" onclick="try{window.workspace.openHelp(\'_tbcode:'+t+"')} catch(e){alert('Não é possível abrir a ajuda fora do workspace Sankhya');}\">Código: "+t+"</a>"}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t.errorCode)),t instanceof n||t instanceof r?this._app.alert(t.title,t.message):t instanceof a?this._app.error(t.title,t.message):this._app.isDebugMode().then((s=>{if(s)if(t instanceof Error)this._app.error(t.name,t.message);else{const s=(null==t?void 0:t.title)||"Erro detectado",e="string"==typeof t?t:t.message||`Erro interno "${o.objectToString(t)}"`;this._app.error(s,e)}}))}}function C(){const t=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(C=function(){return t})()}const T=D;function D(t,s){const e=C();return(D=function(t){return e[t-=392]})(t,s)}!function(){const t=D,s=C();for(;;)try{if(951926==-parseInt(t(398))/1+-parseInt(t(393))/2+parseInt(t(395))/3+-parseInt(t(400))/4*(parseInt(t(392))/5)+-parseInt(t(401))/6*(-parseInt(t(402))/7)+parseInt(t(397))/8+-parseInt(t(399))/9*(-parseInt(t(394))/10))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();const N=T(396);class O{constructor(){this.templateByQuery=new Map,this.cancel=[],this.buildTemplates()}buildTemplates(){this.templateByQuery.set("fetchTotals",f.gql`query($filters: [InputFilter!] $name: String!) {
2
+ $queryAlias$: fetchTotals(name: $name, filters: $filters ){
3
+ name
4
+ value
5
+ }
6
+ }`)}fetchTotals(t,s,e=[]){const i=`${t}_${s}`,n=this.cancel.findIndex((t=>t[i]));return n>=0&&(this.cancel[n][i](),this.cancel.splice(n,1)),Promise.race([new Promise((t=>this.cancel.push({[i]:t}))),this.getTotals(t,s,e)]).then((t=>{let s=new Map;if(t){s=t;const e=this.cancel.findIndex((t=>t[i]));e>=0&&this.cancel.splice(e,1)}return s}))}getTotals(t,s,e=[]){return new Promise(((i,n)=>{y.get().callGraphQL({query:this.templateByQuery.get("fetchTotals"),values:{name:`totals://${t}/${s}`,filters:e}}).then((t=>{if(t.length>0){const s=new Map;return t.forEach((t=>s.set(t.name,parseFloat(t.value)))),i(s)}return n("Não foi possível recuperar os totalizadores")})).catch(n)}))}}var L;class k{static openAppActivity(t,s){var e;null===(e=window.workspace)||void 0===e||e.openAppActivity(t,s)}static getAppLabel(t){if(null!=(null===window||void 0===window?void 0:window.workspace))return null==window.workspace.getAppLabel&&(window.workspace.getAppLabel=t=>(t||"").split(".").pop()),window.workspace.getAppLabel(t)}}k.resourceID=null===(L=window.workspace)||void 0===L?void 0:L.resourceID;class j{static webConnectionCaller(t,s,e){var i;null===(i=window.AppletCaller)||void 0===i||i.webConnectionCaller(t,s,e)}}class U{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",f.gql`query($name: String!) {
7
+ $queryAlias$: fetchResource(name: $name){
8
+ name
9
+ resource
10
+ }
11
+ }`)}async getParam(t){const s=`param://application?params=${t}`;return y.get().callGraphQL({values:{name:s},query:this.templateByQuery.get("fetchParam")})}async asString(t){const s=await this.getParam(t);return this.getValue(s)}async asInteger(t){const s=await this.getParam(t);return parseInt(this.getValue(s))}async asFloat(t){const s=await this.getParam(t);return parseFloat(this.getValue(s))}async asBoolean(t){const s=await this.getParam(t);return"S"===this.getValue(s)}async asDate(t){const s=await this.getParam(t);return c.strToDate(this.getValue(s))}async getBatchParams(t){const s=await this.getParam(t.join(",")),e={};return s.forEach((t=>e[t.name]=t.resource)),e}getValue(t={}){if(Array.isArray(t)&&t.length>0&&(t=t[0]),h.isEmpty(t.resource))return"";try{const s=o.stringToObject(t.resource),[e]=Object.keys(s);return s[e]}catch(t){console.warn("Erro ao converter string JSON.")}}}const $=R;function R(t,s){const e=M();return(R=function(t){return e[t-=378]})(t,s)}function M(){const t=["true","863GKWjmo","parse","56355fjjjAm","isSup","putAccess","4324480sjuCdS","hasOwnProperty","239748okvJLB","name","6055770tXeRaU","actions","forEach","7RPRvzn","1042CHxkUw","2988126NIwRMm","20MTNzmH","authorizationSf","item","string","hasAccess","isArray","Objeto não pode ser indefinido.","3071943fWslZp","parseFromJSON"];return(M=function(){return t})()}!function(){const t=R,s=M();for(;;)try{if(281287==parseInt(t(399))/1*(-parseInt(t(387))/2)+-parseInt(t(401))/3+parseInt(t(381))/4*(-parseInt(t(389))/5)+parseInt(t(388))/6*(-parseInt(t(386))/7)+parseInt(t(379))/8+parseInt(t(396))/9+parseInt(t(383))/10)break;s.push(s.shift())}catch(t){s.push(s.shift())}}();class q{[$(397)](t){const s=$;if(typeof(t=utxt(t[s(390)]))==s(392)&&(t=JSON[s(400)](t)),null==t)throw Error(s(395));const e=new F("S"===t[s(402)]||!0===t[s(402)]);return Array[s(394)](t[s(391)])&&t[s(391)][s(385)]((t=>e.putAccess(t[s(382)],String(t.status)==s(398)))),e}}class F{constructor(t){const s=$;this.isSup=t,this[s(384)]={}}[$(378)](t,s){this[$(384)][t]=s}[$(393)](t){const s=$;if(this[s(402)])return!0;let e=!0;return this[s(384)][s(380)](t)&&(e=this.actions[t]),e}isUserSup(){return this.isSup}}const x=class{constructor(e){t(this,e),this.applicationLoaded=s(this,"applicationLoaded",7),this.applicationLoading=s(this,"applicationLoading",7),this._authPromises=[],this._duCache=new Map,this._duPromises=new Map,this._requestListener=new z,this.messagesBuilder=void 0,this.configName=void 0}get parameters(){return this._parameters||(this._parameters=new U),this._parameters}async getAuth(t){return null==t?this.getApplicationAuth():new Promise(((s,e)=>{this.authFetcher.getData(t).then((t=>{s(t)})).catch((t=>{e(t)}))}))}async getApplicationAuth(){return this._auth?Promise.resolve(this._auth):new Promise(((t,s)=>{const e=this._authPromises.length>0;this._authPromises.push(new H(t,s)),e||this.authFetcher.getData(this.applicationResourceID).then((t=>{for(this._auth=t;this._authPromises.length>0;)this._authPromises.pop().resolve(this._auth)})).catch((t=>{for(;this._authPromises.length>0;)this._authPromises.pop().reject(t)}))}))}async isUserSup(){return new Promise(((t,s)=>{this.getAuth().then((e=>{this.getAuthList(e).then((s=>{t(s.isSup)})).catch((t=>s(t)))}))}))}async callServiceBroker(t,s,e){return y.get().callServiceBroker(t,s,e)}initOnboarding(t){return u.getInstance().init(t,window.envContext),Promise.resolve()}async hasAccess(t,s){return new Promise(((e,i)=>{this.getAuth(s).then((s=>{this.getAuthList(s).then((s=>{e(s.isSup||s.actions[t])})).catch((t=>i(t)))}))}))}async getAllAccess(t){return new Promise(((s,e)=>{this.getAuth(t).then((t=>{this.getAuthList(t).then((t=>{const e={};e.isSup=t.isSup,Object.entries(A).forEach((s=>{e[s[0]]=t.actions[s[1]]||!1})),s(e)})).catch((t=>e(t)))}))}))}async getStringParam(t){return this.parameters.asString(t)}async getIntParam(t){return this.parameters.asInteger(t)}async getFloatParam(t){return this.parameters.asFloat(t)}async getBooleanParam(t){return this.parameters.asBoolean(t)}async getDateParam(t){return this.parameters.asDate(t)}async showPopUp(t,s="full",e=!0){this.clearContent(this._popUp),this._popUp.appendChild(t),this._popUp.opened=!0,this._popUp.heightMode=s,this._popUp.useHeader=e,"EZ-MODAL-CONTAINER"===t.tagName&&(this._popUp.useHeader=!1)}async showModal(t){this.clearContent(this._rightModal),this._rightModal.appendChild(t),this._rightModal.opened=!0}async closeModal(){this.clearContent(this._rightModal),this._rightModal.opened=!1}async closePopUp(){this.clearContent(this._popUp),this._popUp.opened=!1,this._popUp.useHeader=!0,this._popUp.heightMode="full"}async temOpcional(t){const s=t.split(",");return new Promise(((t,e)=>{this.getAttributeFromHTMLWrapper("opc0009").then((i=>{"1"===i?t(!0):Promise.all(s.map((t=>this.getAttributeFromHTMLWrapper("opc"+t)))).then((s=>{t(s.includes("1"))})).catch((t=>{e(t)}))})).catch((t=>{e(t)}))}))}async getConfig(t){let s={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:t,tipo:"T"}}};return new Promise(((t,e)=>{y.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(s)).then((s=>{var e;return t(null===(e=s.config)||void 0===e?void 0:e.data)})).catch((t=>e(t)))}))}async saveConfig(t,s){let e={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:t,tipo:"T",data:s}}};return new Promise(((t,s)=>{y.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(e)).then((s=>t(s))).catch((t=>s(t)))}))}async getAttributeFromHTMLWrapper(t){return Promise.resolve(window[t])}async openApp(t,s){k.openAppActivity(t,s)}async webConnection(t,s,e){this.getStringParam(t).then((t=>{j.webConnectionCaller(t,s,e)}))}getDuPromissesStack(t){let s;return t&&(s=this._duPromises.get(t),s||(s=[],this._duPromises.set(t,s))),s||[]}async createDataunit(t,s,e,i,n){return null==n&&(n=this.applicationResourceID),new Promise(((r,a)=>{const o=this.getDuPromissesStack(s),c=o.length>0;if(o.push(new H(r,a)),!c){const r=this.dataUnitFetcher.getDataUnit(t,n,e,i);r.loadMetadata().then((()=>{for(s&&this.updateDataunitCache(void 0,s,r);o.length>0;)o.pop().resolve(r)})).catch((t=>{for(;o.length>0;)o.pop().reject(t)}))}}))}async updateDataunitCache(t,s,e){t&&this._duCache.delete(t),this._duCache.set(s,e)}async getDataUnit(t,s,e,i,n){return new Promise(((r,a)=>{const o=this._duCache.get(s);o?r(o):this.createDataunit(t,s,e,i,n).then((t=>{r(t)})).catch((t=>a(t)))}))}async addClientEvent(t,s){return new Promise((e=>{y.addClientEvent(t,s),e()}))}async removeClientEvent(t){return new Promise((s=>{y.removeClientEvent(t),s()}))}async hasClientEvent(t){return new Promise((s=>{s(y.hasClientEvent(t))}))}async callServiceBroker(t,s,e){return y.get().callServiceBroker(t,s,e)}get applicationResourceID(){return this._applicationResourceID||(this._applicationResourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||k.resourceID||"unknown.resource.id"),this._applicationResourceID}async getResourceID(){return Promise.resolve(this.applicationResourceID)}async getUserID(){return Promise.resolve(window.UID)}async alert(t,s,e,i){return g.alert(t,s,e,i)}async error(t,s,e,i){return g.error(t,s,e,i)}async success(t,s,e,i){return g.success(t,s,e,i)}async message(t,s,e,i){return g.message(t,s,e,i)}async confirm(t,s,e,i,n){return g.confirm(t,s,e,i,n)}async info(t,s){return g.info(t,s)}async loadTotals(t,s,e){return this.totalsFetcher.fetchTotals(t,s,e)}async getAuthList(t){return await(new q).parseFromJSON(t)}get urlParams(){return this._urlParams||(this._urlParams=P.getQueryParams(location.search)),this._urlParams}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new v),this._dataUnitFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new O),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new I),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new S),this._authFetcher}async executeSearch(t,s,e){const i=null==e?void 0:e.getField(s);if(i){const{mode:s,argument:n}=t,{ENTITYNAME:r,CODEFIELD:a,DESCRIPTIONFIELD:o,ROOTENTITY:c,DESCRIPTIONENTITY:h}=i.properties,u=i.dependencies;let p;const d={rootEntity:c,descriptionFieldName:o,codeFieldName:a,showInactives:!1,dataUnitId:e.dataUnitId};return null==u||u.filter((t=>t.masterFields)).forEach((t=>{var s;t.type===l.SEARCHING&&(null===(s=t.masterFields)||void 0===s?void 0:s.length)>0&&(p={expression:t.expression,params:t.masterFields.map((t=>{const s=e.getField(t),i=(null==s?void 0:s.dataType)||w.TEXT,n=e.getFieldValue(t);if(null==n)throw this.alert("Erro ao pesquisar",`É necessario informar o campo ${s.label} para executar a pesquisa.`),new Error(`É necessario informar o campo ${s.label} para executar a pesquisa.`);return{name:t,value:n,dataType:i}}))})})),this.executePreparedSearch(s,n,{entity:r,entityDescription:h,criteria:p,searchOptions:d})}}async executePreparedSearch(t,s,e){const{entity:i,entityDescription:n,criteria:r,searchOptions:a}=e;return"ADVANCED"===t?new Promise((t=>{const e=document.createElement("snk-pesquisa");e[p.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${i}`,e.argument=s,e.searchLoader=t=>this.pesquisaFetcher.loadAdvancedSearch(i,t,r,a),e.selectItem=s=>{t(s),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(n),this.showPopUp(e)})):this.pesquisaFetcher.loadSearchOptions(i,s,r,a)}async isDebugMode(){return new Promise((t=>{t(window.isDebugMode)}))}async getAppLabel(){return k.getAppLabel(this.applicationResourceID)}addSearchListener(t,s,e){return new Promise((i=>{i(this.pesquisaFetcher.addSearchListener(t,s.dataUnitId,e))}))}importScript(t){return new Promise((s=>{this.getApplicationPath().then((e=>{let i=[];Array.isArray(t)||(i=[t]),i.forEach((t=>{const s=document.createElement("script");s.src=`${e}/${t}`,s.async=!0,document.body.appendChild(s)})),s()}))}))}getApplicationPath(){return new Promise((t=>{"dev"!==window.applicationenv&&t(`/${window.MGE_MODULE_NAME}/labsApps/${window.APPLICATION_NAME}/build`),t("")}))}executeSelectDistinct(t,s,e){return this.dataUnitFetcher.loadSelectDistinct(t,s,e)}getDataFetcher(){return Promise.resolve(y.get())}clearContent(t){t&&Array.from(t.children).forEach((s=>{t.removeChild(s)}))}clearPopUpTitle(){this._popUp.ezTitle=""}setPopUpTitle(t){this._popUp.ezTitle=t}componentWillLoad(){d.setContextValue("__SNK__APPLICATION__LOADING__",!0),this._errorHandler=new b(this),this.messagesBuilder=new E,d.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${P.getUrlBase()}/mge/upload/file`),d.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,s,e)=>this.executeSearch(t,s,e))),d.setContextValue("__EZUI__GRID_LICENSE__",N),m.init(),_.preload(this.applicationResourceID,this.configName)}connectedCallback(){d.setContextValue("__SNK__APPLICATION__",this),y.addRequestListener(this._requestListener)}disconnectedCallback(){y.removeRequestListener(this._requestListener)}componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{d.setContextValue("__SNK__APPLICATION__LOADING__",!1),this.applicationLoaded.emit(!0)})),p.addIDInfo(this._element,`resource_${this.applicationResourceID}`)}render(){return e("div",null,e("ez-loading-bar",{ref:t=>this._requestListener.loadingBar=t}),e("ez-popup",{opened:!1,ref:t=>this._popUp=t,onEzClosePopup:()=>this.closePopUp()}),e("ez-modal",{opened:!1,ref:t=>this._rightModal=t,"modal-size":"small",closeOutsideClick:!0,closeEsc:!0}))}get _element(){return i(this)}};class z{constructor(){this._debounceTime=1e3,this._ignoredNameTypes=["totals"],this._countRequest=0}onRequestStart(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest++,this.loadingBar.show(),this._timerLoading&&clearTimeout(this._timerLoading))}onRequestEnd(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest--,this._timerLoading=setTimeout((()=>{this._countRequest<=0&&this.loadingBar.hide()}),this._debounceTime))}isIgnoreLoadingOnRequest(t){var s;if(1==(null===(s=null==t?void 0:t.requestBody)||void 0===s?void 0:s.length)){const{name:s}=t.requestBody[0].variables;if(s){const t=s.split(":");return this._ignoredNameTypes.indexOf(t[0])>=0}}return!1}}class H{constructor(t,s){this.resolve=t,this.reject=s}}x.style=".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";export{x as snk_application}
@@ -0,0 +1 @@
1
+ export{S as snk_data_unit}from"./p-e1cb1f0b.js";import"./p-d2d301a6.js";import"@sankhyalabs/core";import"@sankhyalabs/ezui/dist/collection/utils";import"./p-ae6aff81.js";
@@ -0,0 +1 @@
1
+ import{r as s,h as t,H as e}from"./p-d2d301a6.js";const a=class{constructor(t){s(this,t),this.slot="TASKBAR_CUSTOM_ELEMENTS"}render(){return t(e,{slot:this.slot},t("div",{id:this.slot,class:"taskbar-custom-elements-container"},t("slot",null)))}};a.style=".sc-snk-taskbar-custom-elements-h{display:flex}.taskbar-custom-elements-container.sc-snk-taskbar-custom-elements{display:none}";export{a as snk_taskbar_custom_elements}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as i,H as e,g as h}from"./p-d2d301a6.js";import{StringUtils as n,ApplicationContext as a,ElementIDUtils as r}from"@sankhyalabs/core";import{A as o}from"./p-dc36cfbf.js";import{T as l,V as d,A as k,b as u,a as c}from"./p-c9841939.js";import{P as m}from"./p-5534e08c.js";import"./p-6dc031de.js";const v=class{constructor(i){t(this,i),this.actionClick=s(this,"actionClick",7),this.TASKBAR_ITEM_ID_PREFIX="TASKBAR_ITEM_",this._titleKeyByElement={[l.UPDATE]:"snkTaskbar.titleUpdate",[l.PREVIOUS]:"snkTaskbar.titlePrevious",[l.NEXT]:"snkTaskbar.titleNext",[l.REFRESH]:"snkTaskbar.titleRefresh",[l.CLONE]:"snkTaskbar.titleClone",[l.REMOVE]:"snkTaskbar.titleRemove",[l.MORE_OPTIONS]:"snkTaskbar.titleMoreOptions",[l.INSERT]:"snkTaskbar.titleInsert",[l.CANCEL]:"snkTaskbar.titleCancel",[l.SAVE]:"snkTaskbar.titleSave",[l.GRID_MODE]:"snkTaskbar.titleGridMode",[l.FORM_MODE]:"snkTaskbar.titleFormMode",[l.CONFIGURATOR]:"snkTaskbar.titleConfigurator",[l.ATTACH]:"snkTaskbar.titleAttach"},this._permissions=void 0,this._customElements=void 0,this._customElementsId=void 0,this._slotContainer=void 0,this.customSlotId="TASKBAR_CUSTOM_ELEMENTS",this.customContainerId=void 0,this.configName=void 0,this.resourceID=void 0,this.buttons=void 0,this.customButtons=void 0,this.actionsList=void 0,this.primaryButton=void 0,this.disabledButtons=void 0,this.dataUnit=void 0,this.presentationMode=m.PRIMARY,this.messagesBuilder=void 0}observeButtons(){this._definitions=void 0}elementsFromString(t){const s=[];return null==t||t.split(",").forEach((t=>{t=t.trim(),(d[t]||this.isAllowed(t))&&s.push(t.trim())})),s}isAllowed(t){return t===k.CONFIGURATOR?!!this._permissions&&(this._permissions.isSup||this._permissions[o.CONFIG_GRID]||this._permissions[o.CONFIG]):!k[t]||!!this._permissions&&(this._permissions.isSup||this._permissions[t])}getTitle(t){var s;let i;return i=this.isAllowed(t)?this._titleKeyByElement[t]:"snkTaskbar.forbidden",i?null===(s=this.messagesBuilder)||void 0===s?void 0:s.getMessage(i,{}):""}elementClick(t){if(this.dataUnit)switch(t){case l.PREVIOUS:this.dataUnit.previousRecord();break;case l.NEXT:this.dataUnit.nextRecord();break;case l.REFRESH:this.dataUnit.loadData();break;case l.CLONE:this.dataUnit.copySelected();break;case l.REMOVE:this.dataUnit.removeSelectedRecords();break;case l.INSERT:this.dataUnit.addRecord();break;case l.CANCEL:this.dataUnit.cancelEdition();break;case l.SAVE:this.dataUnit.saveData()}this.isEnabled(t)&&this.actionClick.emit(t)}isEnabled(t){return!(!this.isAllowed(t)||this.disabledButtons&&this.disabledButtons.includes(t))}validatePresentationMode(){Object.values(m).includes(this.presentationMode)||(this.presentationMode=m.PRIMARY)}getElement(t,s){let i=s===this.primaryButton?"ez-button--primary ":"";return t>1&&(i+="ez-padding-left--medium"),l[s.toString()]?u(s,i,this.getIdElemBtnNative(s),(t=>this.getTitle(t)),(t=>this.elementClick(t)),(t=>this.isEnabled(t)),this.actionsList,this.configName,this.presentationMode):c(s,i,this.getIdElemBtnCustom(s),(t=>this.elementClick(t)),(t=>this.isEnabled(t)))}getIdElemBtnNative(t){return n.toCamelCase(t)}getIdElemBtnCustom(t){return n.toCamelCase(t.name)}isDivider(t){var s;return void 0!==t&&(null===(s=t.t)||void 0===s?void 0:s["data-taskbar-divider"])}removeEmpty(t){let s;return t.filter((t=>!(null==t||this.isDivider(s)&&this.isDivider(t)||(s=t,0))))}appendCustomElementsInTaskbar(){this._customElementsId.forEach((t=>{const s=t.replace(this.TASKBAR_ITEM_ID_PREFIX,""),i=this._customElements.get(s),e=this._element.querySelector(`#${t}`);e?null==e||e.appendChild(i):this.unlinkCustomElementFromTaskbar(i)}))}addCustomElementContainer(t){const s=`${this.TASKBAR_ITEM_ID_PREFIX}${t}`;return this._customElementsId.includes(s)||this._customElementsId.push(s),i("span",{key:s,id:s})}getCustomElements(){var t,s;this._customElementsId=[],this._customElements=new Map,this._slotContainer=this.buildSlotContainer(),Array.from(null!==(s=null===(t=this._slotContainer)||void 0===t?void 0:t.children)&&void 0!==s?s:[]).forEach((t=>this._customElements.set(t.id,t)))}buildSlotContainer(){if(this.customContainerId){const t=document.querySelector(`#${this.customContainerId}`);return null==t?void 0:t.querySelector(`#${this.customSlotId}`)}return this._element.querySelector(`#${this.customSlotId}`)}componentWillLoad(){this._application=a.getContextValue("__SNK__APPLICATION__"),this._application?this._application.getAllAccess(this.resourceID).then((t=>this._permissions=t)):this._permissions={},this.getCustomElements()}componentWillRender(){null==this._definitions&&this._permissions&&(this._definitions=this.elementsFromString(this.buttons)),this.validatePresentationMode()}componentDidLoad(){r.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}componentDidRender(){this.appendCustomElementsInTaskbar()}disconnectedCallback(){this.unlinkAllCustomElements()}unlinkAllCustomElements(){var t;null===(t=this._customElementsId)||void 0===t||t.forEach((t=>{const s=t.replace(this.TASKBAR_ITEM_ID_PREFIX,""),i=this._customElements.get(s);this.unlinkCustomElementFromTaskbar(i)}))}unlinkCustomElementFromTaskbar(t){this._slotContainer.appendChild(t)}render(){if(void 0===this._definitions)return;let t=0;return i(e,null,this.removeEmpty(this._definitions.map((s=>{var e;return s===l.DIVIDER?t=0:t++,l[s]?this.getElement(t,l[s]):(null===(e=this.customButtons)||void 0===e?void 0:e.has(s))?this.getElement(t,this.customButtons.get(s)):this._customElements.has(s)?this.addCustomElementContainer(s):i("slot",{name:s})}))),i("div",{class:"taskbar-custom-elements-container"},i("slot",{name:this.customSlotId})))}get _element(){return h(this)}static get watchers(){return{buttons:["observeButtons"]}}};v.style=".sc-snk-taskbar-h{display:flex}.taskbar-custom-elements-container.sc-snk-taskbar{display:none}";export{v as snk_taskbar}
@@ -0,0 +1 @@
1
+ import{ApplicationContext as s}from"@sankhyalabs/core";class a{static async getResourceID(){return s.getContextValue("__SNK__APPLICATION__").getResourceID()}}export{a as R}
@@ -0,0 +1 @@
1
+ import{r as i,c as t,h as n,H as s,g as o}from"./p-d2d301a6.js";import{StringUtils as r,ElementIDUtils as e}from"@sankhyalabs/core";import{ApplicationUtils as l,DialogType as a}from"@sankhyalabs/ezui/dist/collection/utils";import{CheckMode as d}from"@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode";import{C as c}from"./p-7bcd2f89.js";import{O as g}from"./p-4a78e118.js";import"./p-c870b530.js";import"./p-ac0556a3.js";import"./p-112455b1.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-8d884fab.js";import"./p-584d7212.js";const h=class{constructor(n){i(this,n),this.configChange=t(this,"configChange",7),this.configCancel=t(this,"configCancel",7),this._orderListItems=[],this._orderPriorityList=[],this._columListItems=[],this._selectedIndex=-1,this._dataChanged=!1,this._componenteInternalKey=Date.now(),this.selectedIndex=0,this.application=void 0,this.columns=void 0,this.config=void 0,this.configName=void 0,this.resourceID=void 0}getMessage(i,t){return this.application.messagesBuilder.getMessage(i,t)}createOrderList(){let i=[];this.columns.filter((i=>{var t;return r.getBooleanValue(null===(t=null==i?void 0:i.props)||void 0===t?void 0:t.get("sortable"),!0)})).forEach((t=>{var n;let s=null===(n=this.config)||void 0===n?void 0:n.columns.find((i=>i.name===t.name)),o={name:t.name,label:t.label};s&&(o.orderIndex=s.orderIndex,o.ascending=s.ascending),t.hidden||i.push(o)})),i.sort(((i,t)=>0!=i.orderIndex||0!=t.orderIndex||null==i.ascending&&null==t.ascending?null!=i.ascending&&null!=t.ascending?i.orderIndex-t.orderIndex:null!=i.ascending||null!=t.ascending?null!=i.ascending?-1:null!=t.ascending?1:0:i.orderIndex-t.orderIndex:null!=i.ascending?-1:null!=t.ascending?1:0)),this._orderListItems=i}createColumnList(){let i={group:this.getMessage("snkGridConfig.group.visible"),items:[]},t={group:this.getMessage("snkGridConfig.group.hidden"),items:[],sort:g.asc.value};this.columns.forEach((n=>{let s={label:n.label};n.hidden?t.items.push(s):i.items.push(s)})),this._columListItems=[i,t]}buildColumnListSlot(i,t){const s=`configItem_${r.replaceAccentuatedChars(r.toCamelCase(i.label))}`;return n("div",null,n("ez-check",{mode:d.SWITCH,id:d.SWITCH+((null==i?void 0:i.label)||"")+((null==t?void 0:t.group)||""),value:t.group===this.getMessage("snkGridConfig.group.visible"),"data-element-id":s,onEzChange:t=>{this.switchColumnGroup(t,i)}}))}buildOrderListSlot(i){const t=`${this._element.getAttribute(e.DATA_ELEMENT_ID_ATTRIBUTE_NAME)}_configItem_${r.toCamelCase(i.label)}`;let s=g.none.value;return null!=(null==i?void 0:i.ascending)&&(s=1==i.ascending?g.asc.value:g.desc.value),n("div",null,n("snk-select-box",{selectedOption:s,key:"snk-select-box-"+this._componenteInternalKey+"-"+i,"data-element-id":t,onEzChange:t=>{t.stopPropagation(),this.updateOrder(t.detail,i.label)}}))}updateOrder(i,t){var n;this._dataChanged=!0;let s,o=[...this.columns],r=o.find((i=>i.label===t));r&&(r.sort=i.value===g.none.value?void 0:i.value),(null===(n=this._orderPriorityList)||void 0===n?void 0:n.length)>0?(this._orderPriorityList.find((i=>i.label===r.label)).sort=i,this._orderPriorityList.filter((i=>i.sort)).map(((i,t)=>{i.label===r.label&&(r.sortIndex=t)}))):(s=o.filter((i=>i.sort&&!0!==i.hidden)).map(((i,t)=>({label:i.label,orderIndex:t}))),s.forEach((i=>{o.find((t=>t.label===i.label)).sortIndex=i.orderIndex}))),this.columns=o}switchColumnGroup(i,t){i.stopPropagation();let n=[...this._columListItems];if(this._dataChanged=!0,!0===i.detail){let i=n.find((i=>i.group===this.getMessage("snkGridConfig.group.hidden"))),s=i.items.findIndex((i=>i.label===t.label));s>=0&&i.items.splice(s,1),n.find((i=>i.group===this.getMessage("snkGridConfig.group.visible"))).items.push(t),this._columListItems=n,this.createOrderList()}else if(!1===i.detail){let i=n.find((i=>i.group===this.getMessage("snkGridConfig.group.visible"))),s=i.items.findIndex((i=>i.label===t.label));s>=0&&i.items.splice(s,1),n.find((i=>i.group===this.getMessage("snkGridConfig.group.hidden"))).items.push(t),this._columListItems=n,this.createOrderList()}}finish(){if(!this._dataChanged)return void this.closeConfig();let i=[];this._columListItems.forEach((t=>{t.items.forEach((n=>{const s=this.columns.find((i=>i.label===n.label));let o=Object.assign({},s);o.hidden=t.group===this.getMessage("snkGridConfig.group.hidden"),i.push(o)}))})),this.columns=i,this._dataChanged=!1,this.closeConfig(),this.save()}save(){var i;let t;t=this.config?this.config:this.createConfigFromState(this.columns);let n,s=[];if((null===(i=this._orderPriorityList)||void 0===i?void 0:i.length)>0){n=this.columns.filter((i=>i.sort&&!0!==i.hidden)).map((i=>({label:i.label,orderIndex:0})));let i=0,t=[];this._orderPriorityList.forEach((s=>{let o=n.find((i=>i.label===s.label));o&&(o.orderIndex=i,t.push(o),i++)})),t.length>0&&(n=t)}for(let i=0;i<this.columns.length;i++){const r=this.columns[i];let e=t.columns.find((i=>r.name===i.name));!0===r.hidden&&e||(e?e.width=r.width:!1===r.hidden&&(e={name:r.name,width:r.width,orderIndex:0}),e&&(r.sort?(e.ascending=r.sort.toUpperCase()===g.asc.value,n?o(r,e):e.orderIndex=r.sortIndex):(delete e.ascending,e.orderIndex=0),s.push(e)))}function o(i,t){if(n){let s=n.find((t=>t.label===i.label));s&&(t.orderIndex=s.orderIndex)}}t.columns=s,c.saveGridConfig(t,this.configName,this.resourceID).then((i=>{this.configChange.emit(i),this._orderList.clearHistory(),l.info(this.getMessage("snkGridConfig.info.successfullyConfigSaved"),{iconName:"check"})}))}createConfigFromState(i){let t={columns:[]};return i.forEach((i=>{if(!i.hidden){let n={name:i.name};i.width&&(n.width=i.width),i.sort?(n.ascending=i.sort.toUpperCase()===g.asc.value,n.orderIndex=i.sortIndex):n.orderIndex=0,n&&t.columns.push(n)}})),t}async locateColumn(i,t){var n;const s="Enter"===i.key;t||(t=null===(n=i.currentTarget)||void 0===n?void 0:n.value);let o=-1;if(1===this.selectedIndex)if(t){const i=[];let n,r;if(await this._orderList.getList().then((s=>{n=s,n.forEach(((n,s)=>{this.compareWords(n,t)&&i.push(s)}))})),i.length>0){if(s)for(let t=0;t<i.length;t++)if(i[t]>this._selectedIndex){o=i[t];break}-1===o&&(o=i[0])}this._selectedIndex=o,r=n[o],r?this._orderList.setSelection(r,!0):this._orderList.removeSelection()}else this._orderList.removeSelection();else if(t){const i=[];if(this.columns.forEach(((n,s)=>{this.compareWords(n,t)&&i.push(s)})),i.length>0){if(s)for(let t=0;t<i.length;t++)if(i[t]>this._selectedIndex){o=i[t];break}-1===o&&(o=i[0])}this._selectedIndex=o;let n=this.columns[o];if(n){const i=this._columListItems.map((i=>i.items)).flat().find((i=>i.label===n.label));i&&this._columnList.setSelection(i,!0)}else this._columnList.removeSelection()}else this._columnList.removeSelection()}compareWords(i,t){var n,s;const o=null===(n=r.replaceAccentuatedChars(null==i?void 0:i.label))||void 0===n?void 0:n.toUpperCase(),e=null===(s=r.replaceAccentuatedChars(t))||void 0===s?void 0:s.toUpperCase();return!r.isEmpty(o)&&!r.isEmpty(e)&&o.includes(e)}getColumnNames(){const i=[];return i.push(this.getMessage("snkGridConfig.tab.columns")),i.push(this.getMessage("snkGridConfig.tab.lineOrdering")),i.join(",")}closeConfig(){if(this._orderList.scrollToTop(),this._columnList.scrollToTop(),this._searchElement.value="",this._dataChanged){let i={canClose:!1,labelCancel:this.getMessage("snkGridConfig.confirm.cancel"),labelConfirm:this.getMessage("snkGridConfig.confirm.save"),btnConfirmDanger:!1};l.confirm(this.getMessage("snkGridConfig.confirm.alert"),this.getMessage("snkGridConfig.confirm.msgCancel"),null,a.WARN,i).then((i=>{i?this.finish():(this._dataChanged=!1,this.configCancel.emit(),this._orderList.clearHistory(),this._componenteInternalKey=Date.now())}))}else this.configCancel.emit(),this._orderList.clearHistory()}handleTabChange(i){null!=(null==i?void 0:i.index)&&(this.selectedIndex!==i.index&&(0===i.index?this._orderList.scrollToTop():1===i.index&&this._columnList.scrollToTop(),this._searchElement.value=""),1===i.index&&this.createOrderList(),this.selectedIndex=i.index)}handleColumnListChange(i){var t;if(i.detail){let n=null===(t=i.detail.find((i=>i.group===this.getMessage("snkGridConfig.group.visible"))))||void 0===t?void 0:t.items;n&&(this._dataChanged=!0,this._orderListItems=n)}}handleOrderListChange(i){if(i.detail){let t=i.detail;t&&(this._dataChanged=!0,this._orderPriorityList=t)}}componentWillRender(){var i;(null===(i=this.columns)||void 0===i?void 0:i.length)>0&&this.createColumnList()}componentDidRender(){var i;(null===(i=this.columns)||void 0===i?void 0:i.length)>0&&this.locateColumn(new KeyboardEvent("arrow-right",{key:"ArrowRight"}),this._searchElement.value)}componentDidLoad(){e.addIDInfo(this._element)}render(){return n(s,null,n("div",{class:"grid-config__header"},n("div",{class:"title-container"},n("div",{class:""},n("label",{class:"title"},this.getMessage("snkGridConfig.gridConfiguration")),n("label",{class:"subtitle"},this.getMessage("snkGridConfig.columnVisibilityOrder"))),n("div",{class:"button-close"},n("ez-button",{mode:"icon",iconName:"close",size:"medium",onClick:()=>this.closeConfig()}))),n("div",{class:"tabselector-container"},n("ez-tabselector",{selectedIndex:this.selectedIndex,onEzChange:i=>{this.handleTabChange(i.detail)},tabs:this.getColumnNames()})),n("div",null,n("ez-text-input",{"data-element-id":"searchColums",ref:i=>this._searchElement=i,label:this.getMessage("snkGridConfig.findColumn"),onKeyUp:i=>this.locateColumn(i)},n("ez-icon",{slot:"leftIcon",size:"medium",iconName:"search"})))),n("div",{class:"grid-config__main"},n("ez-list",{ref:i=>this._columnList=i,class:0===this.selectedIndex?"":"hidden",dataSource:this._columListItems,onEzChange:i=>this.handleColumnListChange(i),ezDraggable:!0,ezSelectable:!0,itemSlotBuilder:(i,t)=>this.buildColumnListSlot(i,t),useGroups:!0,"data-element-id":"configCols"}),n("div",{class:1===this.selectedIndex?"group-name":"hidden"},this.getMessage("snkGridConfig.info.sortingSequence")),n("ez-list",{ref:i=>this._orderList=i,class:1===this.selectedIndex?"height-calc":"hidden",dataSource:this._orderListItems,ezSelectable:!0,onEzChange:i=>this.handleOrderListChange(i),ezDraggable:!0,itemSlotBuilder:i=>this.buildOrderListSlot(i),"data-element-id":"configDataOrder"})),n("div",{class:"grid-config__footer"},n("ez-button",{class:"padding-right--medium",label:this.getMessage("snkGridConfig.cancel"),onClick:()=>this.closeConfig()}),n("ez-button",{label:this.getMessage("snkGridConfig.complete"),class:"ez-button--primary",onClick:()=>this.finish()})))}static get assetsDirs(){return["../assets"]}get _element(){return o(this)}};h.style='.sc-snk-grid-config-h{--snk-grid-config__footer--padding-top:var(--space--medium, 12px);--snk-grid-config__main--padding-right:var(--space--medium, 12px);--snk-grid-config__tabselector-container--padding:var(--space--medium, 12px);--snk-grid-config__button-close--padding-left:var(--space--medium, 12px);--snk-grid-config__title--color:var(--title--primary, #2B3A54);--snk-grid-config__title--font-family:var(--font-pattern, "Roboto");--snk-grid-config__title--font-size:var(--title--large, 20px);--snk-grid-config__title--font-weight:var(--text-weight--extra-large, 700);--snk-grid-config__subtitle--font-family:var(--font-pattern, "Roboto");--snk-grid-config__subtitle--font-size:var(--text--medium, 14px);--snk-grid-config__group--font-family:var(--font-pattern, "Roboto");--snk-grid-config__group--font-size:var(--text--medium, 14px);--snk-grid-config__group--font-weight:var(--text-weight--large, 600);--snk-grid-config__group--padding-bottom:var(--space-small, 6px);--snk-grid-config__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-grid-config__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-grid-config__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-grid-config__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-grid-config__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-grid-config__scrollbar--width:var(--space--medium, 12px);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}@media screen and (min-width: 480px){.sc-snk-grid-config-h{width:359px;max-width:359px}}.padding-right--medium.sc-snk-grid-config{padding-right:var(--space--medium)}ez-list.sc-snk-grid-config{height:100%}.height-calc.sc-snk-grid-config{max-height:calc(100% - 24px)}.grid-config__footer.sc-snk-grid-config{display:flex;justify-content:flex-end;width:100%;padding-top:var(--snk-grid-config__footer--padding-top)}.hidden.sc-snk-grid-config{display:none}.tabselector-container.sc-snk-grid-config{padding:var(--snk-grid-config__tabselector-container--padding) 0}.button-close.sc-snk-grid-config{padding-left:var(--snk-grid-config__button-close--padding-left)}.title-container.sc-snk-grid-config{display:flex;justify-content:space-between;align-items:center;width:100%}.title.sc-snk-grid-config{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-grid-config__title--color);font-size:var(--snk-grid-config__title--font-size);font-family:var(--snk-grid-config__title--font-family);font-weight:var(--snk-grid-config__title--font-weight)}.subtitle.sc-snk-grid-config{color:var(--text--primary);font-size:var(--snk-grid-config__subtitle--font-size);font-family:var(--snk-grid-config__subtitle--font-family)}.grid-config__main.sc-snk-grid-config{overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-grid-config__scrollbar--color-clicked) var(--snk-grid-config__scrollbar--color-background);padding-right:var(--snk-grid-config__main--padding-right)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar{width:var(--snk-grid-config__scrollbar--width);max-width:var(--snk-grid-config__scrollbar--width);min-width:var(--snk-grid-config__scrollbar--width);background-color:var(--snk-grid-config__scrollbar--color-background)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-track{background-color:var(--snk-grid-config__scrollbar--color-background);border-radius:var(--snk-grid-config__scrollbar--border-radius)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb{background-color:var(--snk-grid-config__scrollbar--color-default);border-radius:var(--snk-grid-config__scrollbar--border-radius)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:vertical:hover,.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-grid-config__scrollbar--color-hover)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:vertical:active,.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-grid-config__scrollbar--color-clicked)}.group-name.sc-snk-grid-config{font-family:var(--snk-grid-config__group--font-family);font-size:var(--snk-grid-config__group--font-size);font-weight:var(--snk-grid-config__group--font-weight);padding-bottom:var(--snk-grid-config__group--padding-bottom)}';export{h as snk_grid_config}
@@ -0,0 +1 @@
1
+ import{r as t,h as e,H as i,g as s}from"./p-d2d301a6.js";import{P as r}from"./p-8d884fab.js";import{ApplicationUtils as h}from"@sankhyalabs/ezui/dist/collection/utils";import{ElementIDUtils as l,ApplicationContext as n}from"@sankhyalabs/core";import a from"@sankhyalabs/ezui/dist/collection/components/ez-modal-container/modal-button-status";const o=class{constructor(e){t(this,e),this.APPLY="OK",this.CANCEL="CANCEL",this.CLOSE="CLOSE",this.REMOTE_PRINTERS_TAB="0",this.LOCAL_PRINTERS_TAB="1",this._hasRemotePrinters=!1,this._hasLocalPrinters=!1,this._localPrinters=[],this._isSingleJob=!1,this._saveSubstitute=!1,this.buildIdTabSelector=()=>{const t=[{label:this.getMessage("snkPrintSelector.title.localPrintersTab"),tabKey:this.LOCAL_PRINTERS_TAB,index:Number(this.LOCAL_PRINTERS_TAB)}];return this._printServerActive&&t.unshift({label:this.getMessage("snkPrintSelector.title.remotePrintersTab"),tabKey:this.REMOTE_PRINTERS_TAB,index:Number(this.REMOTE_PRINTERS_TAB)}),[...t]},this._printServerActive=!1,this._selectedPrinter=void 0,this._remotePrintersDataSource=[],this._localPrintersDataSource=[],this._printJobData=void 0}async openPrintSelector(t){return new Promise((e=>{this._printJobData=t,this._isSingleJob=1===this._printJobData.pendingPrinters.length,this._printServerActive=this._printJobData.printServerActive,this._printServerActive?this.buildRemotePrinters():(this.buildLocalPrinters(),this._viewStack.show(+this.LOCAL_PRINTERS_TAB)),this._ezPopup.opened=!0,this._printerResolver=e}))}closePrintSelector(){this._ezPopup.opened=!1,this.element.remove()}handleModalAction(t){switch(t){case this.APPLY:this.handleApply();break;case this.CANCEL:case this.CLOSE:this.handleCancel()}}async handleCancel(){await h.confirm(this.getMessage("snkPrintSelector.title.warning"),this.getMessage("snkPrintSelector.message.canceledPrint"))&&(this.closePrintSelector(),this._printerResolver({selectedPrinter:void 0,saveSubstitute:!1}))}handleApply(){this._printerResolver({selectedPrinter:this._selectedPrinter,saveSubstitute:this._saveSubstitute}),this.closePrintSelector()}onChangeTab(t){t.detail.tabKey===this.LOCAL_PRINTERS_TAB&&this.buildLocalPrinters(),this._viewStack.show(+t.detail.tabKey)}buildRemotePrinters(){const t=[];this._printJobData.printServers.forEach((e=>{t.push({group:e.printServerUri,items:e.printerList.map((t=>({label:t.printerName,group:e.printServerUri})))})})),this._remotePrintersDataSource=t,this._hasRemotePrinters=this._remotePrintersDataSource.length>0}buildLocalPrinters(){this._localPrintersDataSource.length>0||(this._localPrinters=r.getInstance().getLocalPrinters(),this._localPrintersDataSource=this._localPrinters.map((t=>({label:t.nome}))),this._hasLocalPrinters=this._localPrintersDataSource.length>0)}onSelectPrinter(t,e){if(e)return this._hasRemotePrinters&&this._remotePrintersList.removeSelection(),void(this._selectedPrinter=this._localPrinters.find((e=>e.nome===t.label)));this._hasLocalPrinters&&this._localPrintersList.removeSelection();const i=this._printJobData.printServers.find((e=>e.printServerUri===t.group));this._selectedPrinter=null==i?void 0:i.printerList.find((e=>e.printerName===t.label))}renderNoPrinters(){return e("div",{class:"ez-flex ez-flex--justify-center ez-flex--align-items-center ez-size-height--full ez-size-width--full"},e("span",{class:"ez-text ez-text--primary ez-text--medium"},this.getMessage("snkPrintSelector.message.noPrinters")))}buildPrinterIcon(){return e("ez-icon",{iconName:"print",style:{marginRight:"var(--space--small)"}})}getElementID(t){return{[l.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:l.getInternalIDInfo(t)}}getMessage(t){return this._application.messagesBuilder.getMessage(t,void 0)}componentWillLoad(){this._application=n.getContextValue("__SNK__APPLICATION__")}componentDidLoad(){this.element&&l.addIDInfo(this.element)}render(){return e(i,null,e("ez-popup",Object.assign({size:"small",heightMode:"full",useHeader:!1,ref:t=>this._ezPopup=t},this.getElementID("snk-print-selector")),e("ez-modal-container",{modalTitle:this.getMessage("snkPrintSelector.title.printerSelection"),okButtonLabel:this.getMessage("snkPrintSelector.button.print"),okButtonStatus:this._selectedPrinter?a.ENABLED:a.DISABLED,cancelButtonLabel:this.getMessage("snkPrintSelector.button.cancel"),onEzModalAction:t=>this.handleModalAction(t.detail)},this._isSingleJob&&e("div",{class:"ez-flex ez-margin-bottom--large"},e("div",{class:"ez-flex ez-margin-right--large"},e("span",{class:"ez-text ez-text--bold ez-text--medium ez-padding-right--small"},this.getMessage("snkPrintSelector.subtitle.document")),e("span",{class:"ez-text ez-text--primary ez-text--medium"},this._printJobData.pendingPrinters[0].docTypeDescription)),e("div",{class:"ez-flex ez-margin-right--large"},e("span",{class:"ez-text ez-text--bold ez-text--medium ez-padding-right--small"},this.getMessage("snkPrintSelector.subtitle.jobs")),e("span",{class:"ez-text ez-text--primary ez-text--medium"},this._printJobData.pendingPrinters[0].printJobCount))),e("ez-tabselector",{tabs:this.buildIdTabSelector(),onEzChange:t=>this.onChangeTab(t),selectedTab:this._printServerActive?this.REMOTE_PRINTERS_TAB:this.LOCAL_PRINTERS_TAB}),e("ez-view-stack",{ref:t=>this._viewStack=t},e("stack-item",{hidePolicy:"hide"},this._printServerActive&&e("div",{class:"list-scroll ez-size-height--full "+(this._isSingleJob?"with-header":"without-header")},e("ez-list",{ref:t=>this._remotePrintersList=t,class:"ez-padding-top--medium "+(this._hasRemotePrinters?"":"hidden"),dataSource:this._remotePrintersDataSource,onEzSelectItem:t=>this.onSelectPrinter(t.detail,!1),itemLeftSlotBuilder:this.buildPrinterIcon,useGroups:!0,ezSelectable:!0,hoverFeedback:!0,"data-element-id":"remotePrintersList"}),!this._hasRemotePrinters&&this.renderNoPrinters())),e("stack-item",{hidePolicy:"hide"},e("div",{class:"list-scroll ez-size-height--full "+(this._isSingleJob?"with-header":"without-header")},e("ez-list",{ref:t=>this._localPrintersList=t,class:"ez-padding-top--medium "+(this._hasLocalPrinters?"":"hidden"),dataSource:this._localPrintersDataSource,onEzSelectItem:t=>this.onSelectPrinter(t.detail,!0),itemLeftSlotBuilder:this.buildPrinterIcon,ezSelectable:!0,hoverFeedback:!0}),!this._hasLocalPrinters&&this.renderNoPrinters()))),e("ez-check",{label:this.getMessage("snkPrintSelector.message.savePrinter"),onEzChange:t=>this._saveSubstitute=t.detail,compact:!0}))))}get element(){return s(this)}};o.style=".sc-snk-print-selector-h{max-height:100%}ez-modal-container.sc-snk-print-selector{--ez-modal-container-overflow-y:hidden}ez-list.sc-snk-print-selector{height:100%}.list-scroll.sc-snk-print-selector{height:100%;overflow-y:auto;padding-right:var(--snk-grid-config__main--padding-right)}.with-header.sc-snk-print-selector{max-height:calc(100% - 125px)}.without-header.sc-snk-print-selector{max-height:calc(100% - 85px)}.list-scroll.sc-snk-print-selector::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.hidden.sc-snk-print-selector{display:none}";export{o as snk_print_selector}