@sankhyalabs/sankhyablocks 5.19.1 → 6.0.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 (298) hide show
  1. package/dist/cjs/ConfigStorage-0a738cdc.js +304 -0
  2. package/dist/cjs/IExpressionItem-1090c3fd.js +7 -0
  3. package/dist/cjs/PersonalizedFilterUtils-7d959e91.js +229 -0
  4. package/dist/cjs/{SnkFormConfigManager-69df3f74.js → SnkFormConfigManager-a583f503.js} +1 -1
  5. package/dist/cjs/{SnkMessageBuilder-3b5b5614.js → SnkMessageBuilder-8a2d3f26.js} +65 -4
  6. package/dist/cjs/{filter-bar-config-fetcher-a14536bf.js → filter-bar-config-fetcher-75219599.js} +34 -11
  7. package/dist/cjs/{index-de79181a.js → index-59a3e2de.js} +1 -1
  8. package/dist/cjs/{index-f400b1d6.js → index-614af008.js} +2 -0
  9. package/dist/cjs/{index-21bd01e1.js → index-aaaa2af5.js} +6 -1
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/sankhyablocks.cjs.js +2 -2
  12. package/dist/cjs/snk-actions-button.cjs.entry.js +2 -2
  13. package/dist/cjs/snk-actions-form.cjs.entry.js +1 -1
  14. package/dist/cjs/snk-application.cjs.entry.js +4 -4
  15. package/dist/cjs/snk-attach.cjs.entry.js +4 -4
  16. package/dist/cjs/snk-client-confirm.cjs.entry.js +1 -1
  17. package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
  18. package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
  19. package/dist/cjs/snk-crud.cjs.entry.js +4 -4
  20. package/dist/cjs/snk-data-exporter.cjs.entry.js +4 -4
  21. package/dist/cjs/{snk-data-unit-e9c20097.js → snk-data-unit-53fc9200.js} +2 -2
  22. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  23. package/dist/cjs/snk-detail-view.cjs.entry.js +10 -10
  24. package/dist/cjs/snk-entity-list.cjs.entry.js +6 -4
  25. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  26. package/dist/cjs/snk-expression-group.cjs.entry.js +246 -0
  27. package/dist/cjs/{snk-filter-field-search_2.cjs.entry.js → snk-expression-item_3.cjs.entry.js} +327 -66
  28. package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
  29. package/dist/cjs/snk-filter-bar.cjs.entry.js +161 -72
  30. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  31. package/dist/cjs/snk-filter-detail.cjs.entry.js +54 -69
  32. package/dist/cjs/snk-filter-item.cjs.entry.js +21 -7
  33. package/dist/cjs/snk-filter-list.cjs.entry.js +1 -1
  34. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +57 -29
  35. package/dist/cjs/snk-filter-modal.cjs.entry.js +66 -12
  36. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
  37. package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
  38. package/dist/cjs/snk-filter-period.cjs.entry.js +5 -3
  39. package/dist/cjs/snk-filter-personalized.cjs.entry.js +135 -55
  40. package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
  41. package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
  42. package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
  43. package/dist/cjs/snk-form-summary.cjs.entry.js +1 -1
  44. package/dist/cjs/snk-form-view.cjs.entry.js +1 -1
  45. package/dist/cjs/snk-form.cjs.entry.js +4 -4
  46. package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
  47. package/dist/cjs/snk-grid.cjs.entry.js +7 -7
  48. package/dist/cjs/{snk-guides-viewer-c8843478.js → snk-guides-viewer-10ffca10.js} +5 -5
  49. package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
  50. package/dist/cjs/snk-personalized-filter.cjs.entry.js +166 -94
  51. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  52. package/dist/cjs/snk-select-box.cjs.entry.js +1 -1
  53. package/dist/cjs/snk-simple-bar.cjs.entry.js +45 -0
  54. package/dist/cjs/{snk-simple-bar_2.cjs.entry.js → snk-simple-crud.cjs.entry.js} +5 -43
  55. package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
  56. package/dist/cjs/snk-taskbar.cjs.entry.js +4 -4
  57. package/dist/cjs/{taskbar-elements-3be287d6.js → taskbar-elements-068aa945.js} +3 -3
  58. package/dist/cjs/{taskbar-processor-02f0fc84.js → taskbar-processor-6442c585.js} +1 -1
  59. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  60. package/dist/collection/collection-manifest.json +2 -1
  61. package/dist/collection/components/snk-entity-list/snk-entity-list.js +6 -4
  62. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +34 -12
  63. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +4 -2
  64. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.css +66 -0
  65. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.js +370 -0
  66. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +52 -68
  67. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +20 -6
  68. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +1 -0
  69. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +110 -10
  70. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +98 -27
  71. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +21 -0
  72. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +100 -49
  73. package/dist/collection/components/snk-filter-bar/types/custom-element-filter.js +1 -0
  74. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +22 -3
  75. package/dist/collection/components/snk-filter-bar/utils/filters-mock.js +96 -0
  76. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.css +1 -1
  77. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js +27 -6
  78. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css +39 -2
  79. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +276 -30
  80. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.css +73 -0
  81. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js +443 -0
  82. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.js +16 -24
  83. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.css +18 -4
  84. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js +131 -21
  85. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionGroup.js +0 -0
  86. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.js +5 -1
  87. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IParameter.js +1 -0
  88. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IPersonalizedFilter.js +1 -0
  89. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.js +3 -0
  90. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js +1 -1
  91. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +184 -15
  92. package/dist/collection/lib/@types/index.js +2 -0
  93. package/dist/collection/lib/configs/ConfigStorage.js +15 -0
  94. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +36 -13
  95. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +106 -4
  96. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +15 -2
  97. package/dist/collection/lib/message/resources/snk-filter-field-search.msg.js +2 -0
  98. package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js +48 -2
  99. package/dist/components/ConfigStorage.js +180 -1
  100. package/dist/components/PersonalizedFilterUtils.js +227 -0
  101. package/dist/components/SnkMessageBuilder.js +65 -4
  102. package/dist/components/filter-bar-config-fetcher.js +34 -11
  103. package/dist/components/index.d.ts +2 -1
  104. package/dist/components/index.js +1 -0
  105. package/dist/components/index2.js +3 -1
  106. package/dist/components/snk-crud.js +65 -35
  107. package/dist/components/snk-data-exporter2.js +1 -1
  108. package/dist/components/snk-detail-view2.js +99 -44
  109. package/dist/components/snk-entity-list.js +6 -4
  110. package/dist/components/snk-expression-group.d.ts +11 -0
  111. package/dist/components/snk-expression-group.js +6 -0
  112. package/dist/components/snk-expression-group2.js +296 -0
  113. package/dist/components/snk-expression-item2.js +133 -46
  114. package/dist/components/snk-filter-bar2.js +195 -68
  115. package/dist/components/snk-filter-detail2.js +52 -68
  116. package/dist/components/snk-filter-field-search2.js +26 -5
  117. package/dist/components/snk-filter-item2.js +20 -6
  118. package/dist/components/snk-filter-modal-item2.js +54 -27
  119. package/dist/components/snk-filter-modal.js +68 -12
  120. package/dist/components/snk-filter-param-config2.js +3 -57
  121. package/dist/components/snk-filter-period.js +4 -2
  122. package/dist/components/snk-filter-personalized.js +139 -58
  123. package/dist/components/snk-grid2.js +52 -16
  124. package/dist/components/snk-personalized-filter.js +1 -153
  125. package/dist/components/snk-personalized-filter2.js +238 -0
  126. package/dist/esm/ConfigStorage-9f4d2e67.js +300 -0
  127. package/dist/esm/IExpressionItem-2e922b2c.js +7 -0
  128. package/dist/esm/PersonalizedFilterUtils-202cd721.js +227 -0
  129. package/dist/esm/{SnkFormConfigManager-e60367a0.js → SnkFormConfigManager-def999fe.js} +1 -1
  130. package/dist/esm/{SnkMessageBuilder-188a38bb.js → SnkMessageBuilder-cc4d1599.js} +65 -4
  131. package/dist/esm/{filter-bar-config-fetcher-edc48f4b.js → filter-bar-config-fetcher-bd2070a3.js} +34 -11
  132. package/dist/esm/{index-cfd4bb13.js → index-8c3d76a6.js} +6 -1
  133. package/dist/esm/{index-507e19ec.js → index-a255b326.js} +3 -1
  134. package/dist/esm/{index-8efbf198.js → index-d60ca0ac.js} +1 -1
  135. package/dist/esm/loader.js +3 -3
  136. package/dist/esm/sankhyablocks.js +3 -3
  137. package/dist/esm/snk-actions-button.entry.js +2 -2
  138. package/dist/esm/snk-actions-form.entry.js +1 -1
  139. package/dist/esm/snk-application.entry.js +4 -4
  140. package/dist/esm/snk-attach.entry.js +4 -4
  141. package/dist/esm/snk-client-confirm.entry.js +1 -1
  142. package/dist/esm/snk-config-options.entry.js +1 -1
  143. package/dist/esm/snk-configurator.entry.js +1 -1
  144. package/dist/esm/snk-crud.entry.js +4 -4
  145. package/dist/esm/snk-data-exporter.entry.js +4 -4
  146. package/dist/esm/{snk-data-unit-79b1583a.js → snk-data-unit-97824457.js} +2 -2
  147. package/dist/esm/snk-data-unit.entry.js +3 -3
  148. package/dist/esm/snk-detail-view.entry.js +10 -10
  149. package/dist/esm/snk-entity-list.entry.js +7 -5
  150. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  151. package/dist/esm/snk-expression-group.entry.js +242 -0
  152. package/dist/esm/{snk-filter-field-search_2.entry.js → snk-expression-item_3.entry.js} +326 -66
  153. package/dist/esm/snk-field-config.entry.js +1 -1
  154. package/dist/esm/snk-filter-bar.entry.js +156 -67
  155. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  156. package/dist/esm/snk-filter-detail.entry.js +55 -70
  157. package/dist/esm/snk-filter-item.entry.js +21 -7
  158. package/dist/esm/snk-filter-list.entry.js +1 -1
  159. package/dist/esm/snk-filter-modal-item.entry.js +57 -29
  160. package/dist/esm/snk-filter-modal.entry.js +66 -12
  161. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  162. package/dist/esm/snk-filter-number.entry.js +1 -1
  163. package/dist/esm/snk-filter-period.entry.js +5 -3
  164. package/dist/esm/snk-filter-personalized.entry.js +135 -55
  165. package/dist/esm/snk-filter-search.entry.js +1 -1
  166. package/dist/esm/snk-filter-text.entry.js +1 -1
  167. package/dist/esm/snk-form-config.entry.js +1 -1
  168. package/dist/esm/snk-form-summary.entry.js +1 -1
  169. package/dist/esm/snk-form-view.entry.js +1 -1
  170. package/dist/esm/snk-form.entry.js +4 -4
  171. package/dist/esm/snk-grid-config.entry.js +3 -3
  172. package/dist/esm/snk-grid.entry.js +7 -7
  173. package/dist/esm/{snk-guides-viewer-59d3a78c.js → snk-guides-viewer-0380f3df.js} +5 -5
  174. package/dist/esm/snk-guides-viewer.entry.js +9 -9
  175. package/dist/esm/snk-personalized-filter.entry.js +166 -94
  176. package/dist/esm/snk-pesquisa.entry.js +1 -1
  177. package/dist/esm/snk-select-box.entry.js +1 -1
  178. package/dist/esm/snk-simple-bar.entry.js +41 -0
  179. package/dist/esm/{snk-simple-bar_2.entry.js → snk-simple-crud.entry.js} +7 -44
  180. package/dist/esm/snk-tab-config.entry.js +1 -1
  181. package/dist/esm/snk-taskbar.entry.js +4 -4
  182. package/dist/esm/{taskbar-elements-8ff33c26.js → taskbar-elements-26d0fba3.js} +3 -3
  183. package/dist/esm/{taskbar-processor-20de6616.js → taskbar-processor-dfef41a8.js} +1 -1
  184. package/dist/esm/teste-pesquisa.entry.js +1 -1
  185. package/dist/sankhyablocks/{p-f27dc5e9.entry.js → p-00d1cac4.entry.js} +1 -1
  186. package/dist/sankhyablocks/{p-b9667fbe.js → p-066ee142.js} +2 -2
  187. package/dist/sankhyablocks/p-09a058ba.entry.js +1 -0
  188. package/dist/sankhyablocks/{p-82bc4666.entry.js → p-0dec4d29.entry.js} +1 -1
  189. package/dist/sankhyablocks/{p-1e6a95f5.entry.js → p-12632b8e.entry.js} +1 -1
  190. package/dist/sankhyablocks/{p-384c4a6b.js → p-18b34bb4.js} +1 -1
  191. package/dist/sankhyablocks/{p-538c057a.entry.js → p-2ad89e28.entry.js} +1 -1
  192. package/dist/sankhyablocks/p-2d5108b3.js +1 -0
  193. package/dist/sankhyablocks/{p-ff398057.entry.js → p-34cd4b39.entry.js} +1 -1
  194. package/dist/sankhyablocks/p-36ecb6ab.js +1 -0
  195. package/dist/sankhyablocks/p-372e0185.entry.js +1 -0
  196. package/dist/sankhyablocks/p-3be34bd1.entry.js +1 -0
  197. package/dist/sankhyablocks/p-3d45107f.js +1 -0
  198. package/dist/sankhyablocks/{p-28c12f65.js → p-463e0936.js} +1 -1
  199. package/dist/sankhyablocks/{p-e701646c.entry.js → p-49d628d1.entry.js} +1 -1
  200. package/dist/sankhyablocks/{p-e642bf7a.entry.js → p-50db4bc4.entry.js} +1 -1
  201. package/dist/sankhyablocks/{p-093febff.entry.js → p-5427566a.entry.js} +1 -1
  202. package/dist/sankhyablocks/{p-6a02e236.js → p-590d8900.js} +1 -1
  203. package/dist/sankhyablocks/p-5a6c090e.entry.js +1 -0
  204. package/dist/sankhyablocks/p-639be4aa.entry.js +1 -0
  205. package/dist/sankhyablocks/{p-e2bb9c9a.entry.js → p-67a19b48.entry.js} +1 -1
  206. package/dist/sankhyablocks/{p-19692f92.js → p-69770075.js} +1 -1
  207. package/dist/sankhyablocks/p-6d4169fc.entry.js +1 -0
  208. package/dist/sankhyablocks/{p-0b40c655.js → p-708ee8ee.js} +1 -1
  209. package/dist/sankhyablocks/{p-9af04fc7.entry.js → p-718cc24b.entry.js} +1 -1
  210. package/dist/sankhyablocks/{p-2d0fc912.entry.js → p-7946512f.entry.js} +1 -1
  211. package/dist/sankhyablocks/{p-900b2889.entry.js → p-7a5e1be7.entry.js} +1 -1
  212. package/dist/sankhyablocks/p-801b8858.js +68 -0
  213. package/dist/sankhyablocks/{p-80e52e85.entry.js → p-847b9506.entry.js} +1 -1
  214. package/dist/sankhyablocks/{p-56d70073.entry.js → p-8d541539.entry.js} +1 -1
  215. package/dist/sankhyablocks/{p-584a315a.entry.js → p-8e98a893.entry.js} +1 -1
  216. package/dist/sankhyablocks/p-9731180c.entry.js +1 -0
  217. package/dist/sankhyablocks/p-a6055eb9.entry.js +1 -0
  218. package/dist/sankhyablocks/{p-b680fa7a.entry.js → p-a655ea15.entry.js} +1 -1
  219. package/dist/sankhyablocks/{p-eae124e3.entry.js → p-a8b06801.entry.js} +1 -1
  220. package/dist/sankhyablocks/{p-b25450ab.js → p-a8e5ded0.js} +1 -1
  221. package/dist/sankhyablocks/{p-6ac29569.entry.js → p-b66b99d9.entry.js} +1 -1
  222. package/dist/sankhyablocks/p-b7efc49a.entry.js +1 -0
  223. package/dist/sankhyablocks/{p-9c7f7214.entry.js → p-b91ee370.entry.js} +1 -1
  224. package/dist/sankhyablocks/{p-e551b19a.entry.js → p-b940798f.entry.js} +1 -1
  225. package/dist/sankhyablocks/{p-72e78de0.entry.js → p-bbefb3b2.entry.js} +1 -1
  226. package/dist/sankhyablocks/p-bdd61fa8.entry.js +1 -0
  227. package/dist/sankhyablocks/{p-f8c66aa3.entry.js → p-c06973e7.entry.js} +1 -1
  228. package/dist/sankhyablocks/{p-257c71a7.entry.js → p-c17e19a2.entry.js} +1 -1
  229. package/dist/sankhyablocks/p-c6bf66e0.js +1 -0
  230. package/dist/sankhyablocks/p-cf90a195.entry.js +1 -0
  231. package/dist/sankhyablocks/{p-44c2ed16.entry.js → p-d11c5026.entry.js} +1 -1
  232. package/dist/sankhyablocks/p-d5145c3f.entry.js +1 -0
  233. package/dist/sankhyablocks/p-de328b00.entry.js +1 -0
  234. package/dist/sankhyablocks/{p-971abcc2.entry.js → p-e500863b.entry.js} +1 -1
  235. package/dist/sankhyablocks/{p-22e44b9d.entry.js → p-e824aef2.entry.js} +1 -1
  236. package/dist/sankhyablocks/{p-4ce96831.entry.js → p-eb24c092.entry.js} +1 -1
  237. package/dist/sankhyablocks/{p-4c2015a9.js → p-eb90de43.js} +1 -1
  238. package/dist/sankhyablocks/p-ebb8de34.entry.js +1 -0
  239. package/dist/sankhyablocks/{p-8652d177.entry.js → p-fc512cbe.entry.js} +1 -1
  240. package/dist/sankhyablocks/{p-786ae316.entry.js → p-fced1d89.entry.js} +1 -1
  241. package/dist/sankhyablocks/{p-e0b4aec3.entry.js → p-fdb43927.entry.js} +1 -1
  242. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  243. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.d.ts +85 -0
  244. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +6 -6
  245. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +2 -0
  246. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +18 -1
  247. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +14 -6
  248. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +10 -3
  249. package/dist/types/components/snk-filter-bar/types/custom-element-filter.d.ts +6 -0
  250. package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +10 -1
  251. package/dist/types/components/snk-filter-bar/utils/filters-mock.d.ts +92 -15
  252. package/dist/types/components/snk-filter-field-search/interfaces/index.d.ts +5 -11
  253. package/dist/types/components/snk-filter-field-search/snk-filter-field-search.d.ts +3 -0
  254. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +39 -6
  255. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.d.ts +82 -0
  256. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.d.ts +1 -1
  257. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.d.ts +13 -1
  258. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionGroup.d.ts +0 -0
  259. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.d.ts +23 -3
  260. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IParameter.d.ts +21 -0
  261. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IPersonalizedFilter.d.ts +11 -0
  262. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.d.ts +3 -0
  263. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.d.ts +14 -2
  264. package/dist/types/components.d.ts +169 -10
  265. package/dist/types/lib/@types/index.d.ts +3 -1
  266. package/dist/types/lib/configs/ConfigStorage.d.ts +5 -0
  267. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +4 -2
  268. package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +5 -0
  269. package/dist/types/lib/store/index.d.ts +1 -2
  270. package/package.json +5 -5
  271. package/react/components.d.ts +1 -0
  272. package/react/components.js +1 -0
  273. package/react/components.js.map +1 -1
  274. package/dist/cjs/ConfigStorage-f68c3607.js +0 -124
  275. package/dist/cjs/index-8d94b7e0.js +0 -7
  276. package/dist/cjs/snk-expression-item.cjs.entry.js +0 -213
  277. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +0 -214
  278. package/dist/esm/ConfigStorage-e6c17998.js +0 -121
  279. package/dist/esm/index-620ac460.js +0 -7
  280. package/dist/esm/snk-expression-item.entry.js +0 -209
  281. package/dist/sankhyablocks/p-0b6ddb67.entry.js +0 -1
  282. package/dist/sankhyablocks/p-0c2afa63.entry.js +0 -1
  283. package/dist/sankhyablocks/p-343699ad.entry.js +0 -1
  284. package/dist/sankhyablocks/p-471568c7.entry.js +0 -1
  285. package/dist/sankhyablocks/p-6c2c71ca.js +0 -1
  286. package/dist/sankhyablocks/p-8ce9ea9f.entry.js +0 -1
  287. package/dist/sankhyablocks/p-8efb0f47.entry.js +0 -1
  288. package/dist/sankhyablocks/p-9a448ff9.entry.js +0 -1
  289. package/dist/sankhyablocks/p-9e50681c.entry.js +0 -1
  290. package/dist/sankhyablocks/p-9f66bc54.entry.js +0 -1
  291. package/dist/sankhyablocks/p-b1c02726.js +0 -1
  292. package/dist/sankhyablocks/p-b34d23fa.js +0 -1
  293. package/dist/sankhyablocks/p-c20dd153.entry.js +0 -1
  294. package/dist/sankhyablocks/p-cbb5c440.entry.js +0 -1
  295. package/dist/sankhyablocks/p-f3241ada.entry.js +0 -1
  296. package/dist/sankhyablocks/p-f4184ce7.js +0 -1
  297. package/dist/sankhyablocks/p-ff96b509.entry.js +0 -27
  298. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +0 -40
@@ -1,213 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index$1 = require('./index-21bd01e1.js');
6
- const core = require('@sankhyalabs/core');
7
- const index$3 = require('./index-8d94b7e0.js');
8
- const utils = require('@sankhyalabs/ezui/dist/collection/utils');
9
- const FieldBuilder = require('@sankhyalabs/ezui/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder');
10
- const index = require('./index-f400b1d6.js');
11
- const index$2 = require('./index-de79181a.js');
12
-
13
- const FilterOperandDefault = [
14
- { value: index.FilterOperand.EQUAL, label: "Igual (=)" },
15
- { value: index.FilterOperand.DIFFERENT, label: "Diferente (<>)" },
16
- { value: index.FilterOperand.LIKE, label: "Contendo (LIKE)" },
17
- { value: index.FilterOperand.IN, label: "Contido em (IN)" },
18
- { value: index.FilterOperand.START_WITH, label: "Iniciado com (%?)" },
19
- { value: index.FilterOperand.FINISHED_WITH, label: "Terminado com (?%)" },
20
- { value: index.FilterOperand.NULL, label: "Vazio (NULL)" },
21
- { value: index.FilterOperand.NOT_NULL, label: "Não Vazio (NOT NULL)" },
22
- { value: index.FilterOperand.LARGER, label: "Maior (>)" },
23
- { value: index.FilterOperand.LARGER_EQUAL, label: "Maior ou Igual (>=)" },
24
- { value: index.FilterOperand.SMALLER, label: "Menor (<)" },
25
- { value: index.FilterOperand.SMALLER_EQUAL, label: "Menor ou Igual (<=)" }
26
- ];
27
- const FilterOperandTypeTextSearch = [
28
- { value: index.FilterOperand.EQUAL, label: "Igual (=)" },
29
- { value: index.FilterOperand.DIFFERENT, label: "Diferente (<>)" },
30
- { value: index.FilterOperand.LIKE, label: "Contendo (LIKE)" },
31
- { value: index.FilterOperand.IN, label: "Contido em (IN)" },
32
- { value: index.FilterOperand.START_WITH, label: "Iniciado com (%?)" },
33
- { value: index.FilterOperand.FINISHED_WITH, label: "Terminado com (?%)" },
34
- { value: index.FilterOperand.NULL, label: "Vazio (NULL)" },
35
- { value: index.FilterOperand.NOT_NULL, label: "Não Vazio (NOT NULL)" }
36
- ];
37
- const FIELD_TYPE_SEARCH_AND_TEXT = [
38
- core.UserInterface.SEARCH,
39
- core.UserInterface.SHORTTEXT,
40
- core.UserInterface.PASSWORD,
41
- core.UserInterface.MASKEDTEXT,
42
- core.UserInterface.LONGTEXT,
43
- core.UserInterface.HTML
44
- ];
45
-
46
- const snkExpressionItemCss = ".sc-snk-expression-item-h{display:flex;width:100%;--snk-expression-item--background-color:var(--background--xlight, #fff);--snk-expression-item__itens--padding:var(--space--small, 6px);--snk-expression-item__width--input-operator:220px;--snk-expression-item__width--input-value:240px;--snk-expression-item__width--input-value-variable:176px;--snk-expression-item--border-radius:var(--border--radius-medium, 12px);--snk-expression-item--border-color:var(--color--strokes, #DCE0E8);--snk-expression-item--border-style:var(--border--small, 1px solid)}.box.sc-snk-expression-item{width:100%;height:100%;background:var(--snk-expression-item--background-color);margin:var(--space--small, 6px);border:var(--snk-expression-item--border-color) var(--snk-expression-item--border-style);border-radius:var(--snk-expression-item--border-radius)}.box__container.sc-snk-expression-item{display:flex;align-items:center;justify-content:space-between;white-space:nowrap;margin:var(--space--small, 6px)}.box__container--input-filter.sc-snk-expression-item{width:100%}.box__container--input-operator.sc-snk-expression-item{display:flex;width:var(--snk-expression-item__width--input-operator);min-width:var(--snk-expression-item__width--input-operator)}.box__container--input-value.sc-snk-expression-item{display:flex;width:var(--snk-expression-item__width--input-value);min-width:var(--snk-expression-item__width--input-value)}.box__container--input-value-variable.sc-snk-expression-item{display:flex;width:var(--snk-expression-item__width--input-value-variable);min-width:var(--snk-expression-item__width--input-value-variable)}.box__container--button-delete.sc-snk-expression-item{display:flex}.box__container.sc-snk-expression-item>div.sc-snk-expression-item{padding-left:var(--snk-expression-item__itens--padding);padding-right:var(--snk-expression-item__itens--padding)}.box__container--button-delete--icon.sc-snk-expression-item{width:42px;min-width:42px}.box__container--input-value-variable--icon.sc-snk-expression-item{cursor:pointer}";
47
-
48
- const SnkExpressionItem = class {
49
- constructor(hostRef) {
50
- index$1.registerInstance(this, hostRef);
51
- this.ezFilterItemChange = index$1.createEvent(this, "ezFilterItemChange", 7);
52
- this.ezFilterItemRemove = index$1.createEvent(this, "ezFilterItemRemove", 7);
53
- this.application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
54
- this.filterOperandDefault = FilterOperandDefault;
55
- this.filterOperandTypeTextSearch = FilterOperandTypeTextSearch;
56
- this._showValueVariable = false;
57
- this._fieldSelected = undefined;
58
- this._optionNotNull = false;
59
- this.expression = undefined;
60
- this.canRemove = true;
61
- this.messagesBuilder = undefined;
62
- }
63
- expressionChanged(newValue, oldValue) {
64
- if (newValue !== oldValue) {
65
- this.ezFilterItemChange.emit(newValue);
66
- }
67
- }
68
- componentWillLoad() {
69
- this._dataSourceFetcher = index$2.store.get("filterFieldsDataSource");
70
- index$2.store.onChange('filterFieldsDataSource', () => {
71
- this._dataSourceFetcher = index$2.store.get("filterFieldsDataSource");
72
- });
73
- }
74
- setValueExpression(key, value) {
75
- this.expression[key] = value;
76
- this.expressionChanged(this.expression);
77
- }
78
- getMessage(key, params) {
79
- return this.application.messagesBuilder.getMessage(key, params);
80
- }
81
- handleSelectItem(filterField) {
82
- if (filterField.type === index$3.SelectedItemType.FIELD) {
83
- const field = filterField;
84
- this._fieldSelected = field;
85
- this.setValueExpression("fieldName", field.name);
86
- }
87
- }
88
- handleFocus() {
89
- if (this._elFilterFieldSearch)
90
- this._elFilterFieldSearch.show();
91
- }
92
- handleChangeFilterInput(evt) {
93
- this._elFilterFieldSearch.applyFilter(evt.detail);
94
- }
95
- handleChangeValueVariable(showValueVariable) {
96
- this._showValueVariable = showValueVariable;
97
- if (this._elFieldDynamic) {
98
- this._elFieldDynamic.value = undefined;
99
- this._elFieldDynamic.enabled = !showValueVariable;
100
- }
101
- }
102
- openSnkFilterParamConfig() {
103
- var _a;
104
- (_a = this._elFilterParamConfigRef) === null || _a === void 0 ? void 0 : _a.open(this.expression).then(this.onOpenPromiseReady.bind(this)).catch(error => {
105
- console.error(error);
106
- });
107
- }
108
- onOpenPromiseReady(changes) {
109
- this.expression = changes;
110
- }
111
- buildOptionsOperator() {
112
- var _a;
113
- if (FIELD_TYPE_SEARCH_AND_TEXT.includes((_a = this._fieldSelected) === null || _a === void 0 ? void 0 : _a.userInterface)) {
114
- return this.filterOperandTypeTextSearch;
115
- }
116
- else {
117
- return this.filterOperandDefault;
118
- }
119
- }
120
- handleChangeOperator(optionSelected) {
121
- this.checkOptionIsNull(optionSelected);
122
- this.setValueExpression("operand", optionSelected);
123
- }
124
- checkOptionIsNull(optionSelected) {
125
- if (optionSelected === index.FilterOperand.NULL || optionSelected === index.FilterOperand.NOT_NULL) {
126
- this._optionNotNull = true;
127
- if (this._elFieldDynamic) {
128
- this._elFieldDynamic.enabled = false;
129
- this._elFieldDynamic.value = undefined;
130
- }
131
- }
132
- else {
133
- this._optionNotNull = false;
134
- if (this._elFieldDynamic) {
135
- this._elFieldDynamic.enabled = this._showValueVariable ? false : true;
136
- }
137
- }
138
- }
139
- confirmRemove(evt) {
140
- evt.preventDefault();
141
- evt.stopPropagation();
142
- utils.ApplicationUtils.confirm(this.getMessage("snkPersonalizedFilter.confirm.title"), this.getMessage("snkPersonalizedFilter.confirm.description"))
143
- .then((canRemove) => {
144
- if (canRemove) {
145
- this.ezFilterItemRemove.emit(this.expression);
146
- }
147
- });
148
- }
149
- buildFieldByType() {
150
- var _a, _b;
151
- if (!this._fieldSelected)
152
- return;
153
- const inputFieldData = (_a = FieldBuilder.fieldBuilder(this.configureFieldByType())) === null || _a === void 0 ? void 0 : _a.$children$.shift();
154
- if (this._optionNotNull && inputFieldData || ((_b = this._elValueVariable) === null || _b === void 0 ? void 0 : _b.value) && inputFieldData) {
155
- inputFieldData.$attrs$.enabled = false;
156
- }
157
- return index$1.h(inputFieldData.$tag$, Object.assign(Object.assign({}, inputFieldData.$attrs$), { ref: (el) => {
158
- this._elFieldDynamic = el;
159
- } }));
160
- }
161
- configureFieldByType() {
162
- const field = {
163
- userInterface: this._fieldSelected.userInterface,
164
- name: this._fieldSelected.name,
165
- label: this._fieldSelected.label,
166
- canShowError: false
167
- };
168
- switch (field.userInterface) {
169
- case core.UserInterface.OPTIONSELECTOR:
170
- field.props = {
171
- options: this._fieldSelected.properties.map(option => ({
172
- value: option.value,
173
- label: option.name,
174
- })),
175
- };
176
- break;
177
- case core.UserInterface.LONGTEXT:
178
- field.rows = 1;
179
- break;
180
- case core.UserInterface.SEARCH:
181
- field.optionLoader = searchArgument => this.setCriteriaSearch(searchArgument, this.application);
182
- break;
183
- }
184
- return field;
185
- }
186
- setCriteriaSearch({ mode, argument }, application) {
187
- if (application == undefined)
188
- return;
189
- const searchOptions = {
190
- showInactives: false
191
- };
192
- const options = {
193
- entity: this._fieldSelected.properties.ENTITYNAME,
194
- searchOptions: searchOptions,
195
- entityDescription: this._fieldSelected.label
196
- };
197
- return application.executePreparedSearch(mode, argument, options);
198
- }
199
- render() {
200
- var _a;
201
- return (index$1.h(index$1.Host, null, index$1.h("div", { class: "box" }, index$1.h("div", { class: "box__container" }, index$1.h("div", { class: "box__container--input-filter" }, index$1.h("ez-filter-input", { value: (_a = this._fieldSelected) === null || _a === void 0 ? void 0 : _a.path, label: this.getMessage("snkPersonalizedFilter.info.labelSearchField"), canShowError: false, onEzChange: (evt) => this.handleChangeFilterInput(evt), onFocus: () => this.handleFocus() }), index$1.h("snk-filter-field-search", { ref: ref => this._elFilterFieldSearch = ref, searchable: false, onEzSelectFilterItem: (ev) => this.handleSelectItem(ev.detail), fieldsDataSource: this._dataSourceFetcher })), index$1.h("div", { class: "box__container--input-operator" }, index$1.h("ez-combo-box", { label: this.getMessage("snkPersonalizedFilter.info.labelOperator"), canShowError: false, options: this.buildOptionsOperator(), onEzChange: (evt) => this.handleChangeOperator(evt.detail.value), suppressEmptyOption: true })), index$1.h("div", { class: "box__container--input-value" }, !this._fieldSelected ?
202
- index$1.h("ez-number-input", { label: "Valor", canShowError: false, enabled: (!this._showValueVariable && !this._optionNotNull) }) :
203
- this.buildFieldByType()), index$1.h("div", { class: "box__container--input-value-variable", title: this.getMessage("snkPersonalizedFilter.info.titleTooltip") }, !this._optionNotNull &&
204
- index$1.h("ez-check", { ref: ref => this._elValueVariable = ref, label: this.getMessage("snkPersonalizedFilter.info.labelValueVarible"), mode: utils.CheckMode.SWITCH, onEzChange: (evt) => this.handleChangeValueVariable(evt.detail) }), (this._showValueVariable && !this._optionNotNull) &&
205
- index$1.h("ez-icon", { class: "box__container--input-value-variable--icon", size: "large", iconName: "settings-inverted", onClick: () => this.openSnkFilterParamConfig() }), index$1.h("snk-filter-param-config", { ref: (el) => this._elFilterParamConfigRef = el, messagesBuilder: this.messagesBuilder })), index$1.h("div", { class: "box__container--button-delete" }, index$1.h("div", { class: "box__container--button-delete--icon" }, this.canRemove && index$1.h("ez-button", { mode: "icon", iconName: "delete", onClick: (evt) => this.confirmRemove(evt) })))))));
206
- }
207
- static get watchers() { return {
208
- "expression": ["expressionChanged"]
209
- }; }
210
- };
211
- SnkExpressionItem.style = snkExpressionItemCss;
212
-
213
- exports.snk_expression_item = SnkExpressionItem;
@@ -1,214 +0,0 @@
1
- import { ApplicationContext, ElementIDUtils, UserInterface } from '@sankhyalabs/core';
2
- import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
3
- import { h, Host } from '@stencil/core';
4
- import { CheckMode } from "@sankhyalabs/ezui/dist/collection/utils";
5
- import FilterItemType from '../filter-item-type.enum';
6
- export class SnkFilterPersonalized {
7
- constructor() {
8
- this.config = undefined;
9
- this.value = undefined;
10
- this.fix = undefined;
11
- this.unfix = undefined;
12
- }
13
- componentDidLoad() {
14
- if (this._element) {
15
- ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
16
- }
17
- }
18
- getValue(param, index) {
19
- if (this.value && index >= 0 && index < this.value.length) {
20
- const rawValue = this.value[index];
21
- if (param.type === UserInterface.SEARCH) {
22
- return rawValue;
23
- }
24
- return convertType(param.dataType, rawValue);
25
- }
26
- return undefined;
27
- }
28
- setValue(index, value) {
29
- if (this.value == undefined) {
30
- this.value = Array(index).fill(null);
31
- }
32
- else {
33
- this.value = [...this.value];
34
- }
35
- this.value[index] = value;
36
- if (this.value.filter(item => item != undefined).length == 0) {
37
- this.value = null;
38
- }
39
- this.valueChanged.emit(this.value || []);
40
- }
41
- doSearch(mode, argument, param) {
42
- const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
43
- return new Promise((resolve, reject) => {
44
- application.executePreparedSearch(mode, argument, param.searchContext)
45
- .then(result => {
46
- resolve(result);
47
- }).catch(reason => {
48
- reject(reason);
49
- });
50
- });
51
- }
52
- getParamsInterface() {
53
- var _a, _b, _c;
54
- const params = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.personalizedFilter) === null || _c === void 0 ? void 0 : _c.parameters;
55
- return params.map((param, index) => {
56
- var _a;
57
- const elemId = 'param_' + index;
58
- switch (param.type) {
59
- case UserInterface.SEARCH:
60
- return h("ez-search", { id: elemId, suppressEmptyOption: true, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail), label: param.label, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, param) });
61
- case UserInterface.SWITCH:
62
- case UserInterface.CHECKBOX:
63
- const mode = UserInterface.SWITCH === param.type ? CheckMode.SWITCH : CheckMode.REGULAR;
64
- return h("ez-check", { id: elemId, class: "ez-padding-bottom--medium", mode: mode, value: this.getValue(param, index), label: param.label, onEzChange: evt => this.setValue(index, evt.detail) });
65
- case UserInterface.DECIMALNUMBER:
66
- case UserInterface.INTEGERNUMBER:
67
- return h("ez-number-input", { id: elemId, label: param.label, value: this.getValue(param, index), precision: (_a = param.props) === null || _a === void 0 ? void 0 : _a.precision, onEzChange: evt => this.setValue(index, evt.detail) });
68
- case UserInterface.OPTIONSELECTOR:
69
- return h("ez-combo-box", { id: elemId, label: param.label, value: this.getValue(param, index), options: param.options, onEzChange: evt => { var _a; return this.setValue(index, (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); } });
70
- case UserInterface.DATE:
71
- return h("ez-date-input", { id: elemId, label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
72
- case UserInterface.DATETIME:
73
- return h("ez-date-time-input", { id: elemId, label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
74
- default:
75
- return h("ez-text-input", { id: elemId, label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
76
- }
77
- });
78
- }
79
- /**
80
- * Exibe o componente snk-filter-personalized
81
- */
82
- async show() {
83
- const elem = document.querySelector("#param_0");
84
- if (elem) {
85
- elem["setFocus"]();
86
- }
87
- }
88
- render() {
89
- if (!this.config || this.config.type !== FilterItemType.PERSONALIZED) {
90
- return undefined;
91
- }
92
- return (h(Host, null, this.getParamsInterface()));
93
- }
94
- static get is() { return "snk-filter-personalized"; }
95
- static get properties() {
96
- return {
97
- "config": {
98
- "type": "unknown",
99
- "mutable": false,
100
- "complexType": {
101
- "original": "SnkFilterItemConfig",
102
- "resolved": "SnkFilterItemConfig",
103
- "references": {
104
- "SnkFilterItemConfig": {
105
- "location": "import",
106
- "path": "../snk-filter-item"
107
- }
108
- }
109
- },
110
- "required": false,
111
- "optional": false,
112
- "docs": {
113
- "tags": [],
114
- "text": "Define as configura\u00E7\u00F5es do componente snk-filter-personalized"
115
- }
116
- },
117
- "value": {
118
- "type": "unknown",
119
- "mutable": true,
120
- "complexType": {
121
- "original": "Array<IOption|boolean|string|number|Date>",
122
- "resolved": "(string | number | boolean | Date | IOption)[]",
123
- "references": {
124
- "Array": {
125
- "location": "global"
126
- },
127
- "IOption": {
128
- "location": "import",
129
- "path": "@sankhyalabs/ezui/dist/types/components/ez-combo-box/ez-combo-box"
130
- },
131
- "Date": {
132
- "location": "global"
133
- }
134
- }
135
- },
136
- "required": false,
137
- "optional": false,
138
- "docs": {
139
- "tags": [],
140
- "text": "Define o valor do componente snk-filter-personalized"
141
- }
142
- },
143
- "fix": {
144
- "type": "unknown",
145
- "mutable": false,
146
- "complexType": {
147
- "original": "()=>void",
148
- "resolved": "() => void",
149
- "references": {}
150
- },
151
- "required": false,
152
- "optional": false,
153
- "docs": {
154
- "tags": [],
155
- "text": ""
156
- }
157
- },
158
- "unfix": {
159
- "type": "unknown",
160
- "mutable": false,
161
- "complexType": {
162
- "original": "()=>void",
163
- "resolved": "() => void",
164
- "references": {}
165
- },
166
- "required": false,
167
- "optional": false,
168
- "docs": {
169
- "tags": [],
170
- "text": ""
171
- }
172
- }
173
- };
174
- }
175
- static get events() {
176
- return [{
177
- "method": "valueChanged",
178
- "name": "valueChanged",
179
- "bubbles": true,
180
- "cancelable": true,
181
- "composed": true,
182
- "docs": {
183
- "tags": [],
184
- "text": "Emitido quando o valor do filtro \u00E9 alterado."
185
- },
186
- "complexType": {
187
- "original": "any",
188
- "resolved": "any",
189
- "references": {}
190
- }
191
- }];
192
- }
193
- static get methods() {
194
- return {
195
- "show": {
196
- "complexType": {
197
- "signature": "() => Promise<void>",
198
- "parameters": [],
199
- "references": {
200
- "Promise": {
201
- "location": "global"
202
- }
203
- },
204
- "return": "Promise<void>"
205
- },
206
- "docs": {
207
- "text": "Exibe o componente snk-filter-personalized",
208
- "tags": []
209
- }
210
- }
211
- };
212
- }
213
- static get elementRef() { return "_element"; }
214
- }
@@ -1,121 +0,0 @@
1
- import { ApplicationContext } from '@sankhyalabs/core';
2
- import { F as FormConfigFetcher } from './form-config-fetcher-cac8cd96.js';
3
- import { R as ResourceFetcher } from './resource-fetcher-02642924.js';
4
- import { F as FilterBarConfigFetcher } from './filter-bar-config-fetcher-edc48f4b.js';
5
-
6
- class GridConfigFetcher extends ResourceFetcher {
7
- constructor() {
8
- super(...arguments);
9
- this.GRID_CONFIG_VERSION = "V3:";
10
- }
11
- getConfig(gridName, resourceID) {
12
- const completePath = this.getPath(resourceID, gridName);
13
- return new Promise((resolve, reject) => {
14
- this.loadResource(completePath)
15
- .then(loadedResource => {
16
- let config = undefined;
17
- if (loadedResource) {
18
- config = JSON.parse(loadedResource);
19
- }
20
- resolve(config);
21
- }).catch((error) => {
22
- reject(error);
23
- });
24
- });
25
- }
26
- saveConfig(config, gridName, resourceID) {
27
- const completePath = this.getPath(resourceID, gridName);
28
- return new Promise((resolve, reject) => {
29
- this.saveResource(config, completePath)
30
- .then((resp) => {
31
- resolve(JSON.parse(resp.resource));
32
- })
33
- .catch((error) => {
34
- reject(error);
35
- });
36
- });
37
- }
38
- getPath(resourceID, name) {
39
- if (name) {
40
- return `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}/${name}`;
41
- }
42
- return `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
43
- }
44
- }
45
-
46
- const CONFIG_SOURCE = {
47
- form: "form",
48
- grid: "grid",
49
- filterBar: "filterBar"
50
- };
51
- class ConfigStorage {
52
- static async get() {
53
- if (!ConfigStorage.instance) {
54
- const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
55
- if (application != undefined) {
56
- const configName = application.configName;
57
- const resourceID = await application.getResourceID();
58
- ConfigStorage.instance = new ConfigStorage();
59
- ConfigStorage.resourceID = resourceID;
60
- ConfigStorage.instance.loadFilterBarConfig(configName);
61
- ConfigStorage.instance.loadFormConfig(configName);
62
- ConfigStorage.instance.loadGridConfig(configName);
63
- }
64
- }
65
- return this.instance;
66
- }
67
- async loadFilterBarConfig(name) {
68
- const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.filterBar);
69
- if (!ConfigStorage.configById.has(cacheID)) {
70
- ConfigStorage.configById.set(cacheID, ConfigStorage.filterBarConfigFetcher.getConfig(ConfigStorage.resourceID, name));
71
- }
72
- return ConfigStorage.configById.get(cacheID);
73
- }
74
- async loadFormConfig(name) {
75
- const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.form);
76
- if (!ConfigStorage.configById.has(cacheID)) {
77
- ConfigStorage.configById.set(cacheID, ConfigStorage.formConfigFetcher.loadFormConfig(name, ConfigStorage.resourceID));
78
- }
79
- return ConfigStorage.configById.get(cacheID);
80
- }
81
- async loadGridConfig(name) {
82
- const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.grid);
83
- if (!ConfigStorage.configById.has(cacheID)) {
84
- ConfigStorage.configById.set(cacheID, ConfigStorage.gridConfigFetcher.getConfig(name, ConfigStorage.resourceID));
85
- }
86
- return ConfigStorage.configById.get(cacheID);
87
- }
88
- static async saveFilterBarConfig(config, name) {
89
- const cacheID = this.buildCacheID(name, CONFIG_SOURCE.filterBar);
90
- this.configById.delete(cacheID);
91
- return this.filterBarConfigFetcher.saveConfig(config, this.resourceID, name);
92
- }
93
- static async saveFormConfig(config, name) {
94
- const cacheID = this.buildCacheID(name, CONFIG_SOURCE.form);
95
- this.configById.delete(cacheID);
96
- return this.formConfigFetcher.saveConfig(config, name, this.resourceID);
97
- }
98
- static async saveCardState(config, name) {
99
- return this.formConfigFetcher.saveCardState(config, name, this.resourceID);
100
- }
101
- static async saveGridConfig(config, name) {
102
- if (config == undefined) {
103
- return;
104
- }
105
- const cacheID = this.buildCacheID(name, CONFIG_SOURCE.grid);
106
- this.configById.delete(cacheID);
107
- return this.gridConfigFetcher.saveConfig(config, name, this.resourceID);
108
- }
109
- static buildCacheID(name, source) {
110
- if (name == undefined) {
111
- return `req_${source}_${this.resourceID}`;
112
- }
113
- return `req_${source}_${name}_${this.resourceID}`;
114
- }
115
- }
116
- ConfigStorage.configById = new Map();
117
- ConfigStorage.filterBarConfigFetcher = new FilterBarConfigFetcher();
118
- ConfigStorage.formConfigFetcher = new FormConfigFetcher();
119
- ConfigStorage.gridConfigFetcher = new GridConfigFetcher();
120
-
121
- export { ConfigStorage as C, GridConfigFetcher as G };
@@ -1,7 +0,0 @@
1
- var SelectedItemType;
2
- (function (SelectedItemType) {
3
- SelectedItemType["LINK"] = "LINK";
4
- SelectedItemType["FIELD"] = "FIELD";
5
- })(SelectedItemType || (SelectedItemType = {}));
6
-
7
- export { SelectedItemType as S };