@sankhyalabs/sankhyablocks 1.4.0-beta.1 → 1.4.0-beta.11

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 (286) hide show
  1. package/dist/cjs/{SnkMessageBuilder-7717f1e4.js → SnkMessageBuilder-6c2f7bcd.js} +107 -131
  2. package/dist/cjs/_commonjsHelpers-537d719a.js +20 -0
  3. package/dist/cjs/configurableElementsStorage-93459c72.js +20 -0
  4. package/dist/cjs/constants-9056ca9e.js +84 -0
  5. package/dist/cjs/draggable.bundle-82a25c06.js +6886 -0
  6. package/dist/cjs/{filter-item-type.enum-e2e1bc5b.js → filter-item-type.enum-3daf58d3.js} +2 -0
  7. package/dist/cjs/form-config-fetcher-2de7c16a.js +6895 -0
  8. package/dist/cjs/{index-b0b676c5.js → index-20e8b68a.js} +165 -1473
  9. package/dist/cjs/loader.cjs.js +2 -18
  10. package/dist/cjs/sankhyablocks.cjs.js +4 -116
  11. package/dist/cjs/snk-application.cjs.entry.js +330 -7196
  12. package/dist/cjs/snk-config-modal.cjs.entry.js +62 -0
  13. package/dist/cjs/snk-config-options.cjs.entry.js +230 -0
  14. package/dist/cjs/snk-configurator_6.cjs.entry.js +1156 -0
  15. package/dist/cjs/snk-crud.cjs.entry.js +21 -13
  16. package/dist/cjs/snk-data-unit.cjs.entry.js +24 -32
  17. package/dist/cjs/snk-field-config_2.cjs.entry.js +135 -0
  18. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +5 -2
  19. package/dist/cjs/snk-filter-detail.cjs.entry.js +62 -5
  20. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +6 -3
  21. package/dist/cjs/snk-filter-number.cjs.entry.js +6 -3
  22. package/dist/cjs/snk-filter-period.cjs.entry.js +5 -2
  23. package/dist/cjs/snk-filter-personalized.cjs.entry.js +89 -0
  24. package/dist/cjs/snk-filter-search.cjs.entry.js +7 -13
  25. package/dist/cjs/snk-filter-text.cjs.entry.js +2 -2
  26. package/dist/cjs/snk-form-config.cjs.entry.js +957 -0
  27. package/dist/cjs/snk-form.cjs.entry.js +41 -28
  28. package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
  29. package/dist/cjs/snk-tab-config.cjs.entry.js +321 -0
  30. package/dist/cjs/{taskbar-elements-283c737e.js → taskbar-elements-9a4b1e19.js} +10 -6
  31. package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
  32. package/dist/collection/collection-manifest.json +29 -1
  33. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +1 -1
  34. package/dist/collection/components/snk-application/snk-application.js +236 -37
  35. package/dist/collection/components/snk-configurator/snk-configurator.js +261 -0
  36. package/dist/collection/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.js +16 -0
  37. package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.css +122 -0
  38. package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.js +137 -0
  39. package/dist/collection/components/snk-crud/snk-crud.js +46 -17
  40. package/dist/collection/components/snk-data-unit/snk-data-unit.js +1 -28
  41. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +100 -0
  42. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +23 -0
  43. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +24 -1
  44. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +24 -1
  45. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +23 -0
  46. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +180 -0
  47. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +22 -38
  48. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +1 -1
  49. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +2 -0
  50. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +80 -20
  51. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +65 -31
  52. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +85 -19
  53. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +222 -0
  54. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +39 -4
  55. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +250 -141
  56. package/dist/collection/components/snk-form/snk-form.css +4 -0
  57. package/dist/collection/components/snk-form/snk-form.js +108 -30
  58. package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.css +9 -0
  59. package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.js +315 -0
  60. package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.css +164 -0
  61. package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.js +140 -0
  62. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.css +185 -0
  63. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +1062 -0
  64. package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.css +272 -0
  65. package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +476 -0
  66. package/dist/collection/components/snk-grid/snk-grid.js +94 -26
  67. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +9 -5
  68. package/dist/collection/components/snk-taskbar/snk-taskbar.js +35 -3
  69. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +3 -3
  70. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +35 -0
  71. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +18 -10
  72. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +106 -3
  73. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +15 -15
  74. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +9 -1
  75. package/dist/collection/lib/index.js +1 -0
  76. package/dist/collection/lib/message/SnkMessageBuilder.js +11 -2
  77. package/dist/collection/lib/message/resources/crud-utils.msg.js +4 -0
  78. package/dist/collection/lib/message/resources/snk-configurator.msg.js +11 -0
  79. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +14 -2
  80. package/dist/collection/lib/message/resources/snk-form.msg.js +59 -2
  81. package/dist/collection/lib/message/resources/snk-taskbar.msg.js +1 -1
  82. package/dist/collection/lib/utils/CrudUtils.js +73 -0
  83. package/dist/collection/lib/utils/constants.js +72 -0
  84. package/dist/components/SnkMessageBuilder.js +108 -131
  85. package/dist/components/_commonjsHelpers.js +17 -0
  86. package/dist/components/constants.js +74 -0
  87. package/dist/components/filter-item-type.enum.js +2 -0
  88. package/dist/{sankhyablocks/snk-application.entry.js → components/form-config-fetcher.js} +88 -1347
  89. package/dist/components/index.d.ts +8 -0
  90. package/dist/components/index.js +8 -4
  91. package/dist/components/snk-application2.js +313 -7173
  92. package/dist/components/snk-config-modal.d.ts +11 -0
  93. package/dist/components/snk-config-modal.js +6 -0
  94. package/dist/components/snk-config-modal2.js +91 -0
  95. package/dist/components/snk-config-options.d.ts +11 -0
  96. package/dist/components/snk-config-options.js +6 -0
  97. package/dist/components/snk-config-options2.js +245 -0
  98. package/dist/components/snk-configurator.d.ts +11 -0
  99. package/dist/components/snk-configurator.js +6 -0
  100. package/dist/components/snk-configurator2.js +212 -0
  101. package/dist/components/snk-crud.js +76 -26
  102. package/dist/components/snk-data-unit.js +4 -13
  103. package/dist/components/snk-field-config.d.ts +11 -0
  104. package/dist/components/snk-field-config.js +6 -0
  105. package/dist/components/snk-field-config2.js +70 -0
  106. package/dist/components/snk-filter-bar2.js +354 -148
  107. package/dist/components/snk-filter-binary-select.js +5 -1
  108. package/dist/components/snk-filter-detail2.js +62 -5
  109. package/dist/components/snk-filter-item2.js +52 -33
  110. package/dist/components/snk-filter-list2.js +60 -22
  111. package/dist/components/snk-filter-modal.d.ts +11 -0
  112. package/dist/components/snk-filter-modal.js +6 -0
  113. package/dist/components/snk-filter-modal2.js +84 -0
  114. package/dist/components/snk-filter-multi-select.js +6 -2
  115. package/dist/components/snk-filter-number.js +6 -2
  116. package/dist/components/snk-filter-period.js +5 -1
  117. package/dist/components/snk-filter-personalized.d.ts +11 -0
  118. package/dist/components/snk-filter-personalized.js +108 -0
  119. package/dist/components/snk-filter-search.js +5 -12
  120. package/dist/components/snk-filter-text.js +1 -1
  121. package/dist/components/snk-form-config.d.ts +11 -0
  122. package/dist/components/snk-form-config.js +6 -0
  123. package/dist/components/snk-form-config2.js +996 -0
  124. package/dist/components/snk-form2.js +79 -29
  125. package/dist/components/snk-grid2.js +57 -32
  126. package/dist/components/snk-pesquisa2.js +1 -1
  127. package/dist/components/snk-tab-config.d.ts +11 -0
  128. package/dist/components/snk-tab-config.js +6 -0
  129. package/dist/components/snk-tab-config2.js +7220 -0
  130. package/dist/components/snk-taskbar2.js +28 -10
  131. package/dist/components/teste-pesquisa.js +1 -1
  132. package/dist/{sankhyablocks/SnkMessageBuilder-a7da466b.js → esm/SnkMessageBuilder-5792c260.js} +108 -131
  133. package/dist/esm/_commonjsHelpers-9943807e.js +17 -0
  134. package/dist/esm/configurableElementsStorage-cdc144b5.js +18 -0
  135. package/dist/esm/constants-c6039d3d.js +74 -0
  136. package/dist/esm/draggable.bundle-41d56f06.js +6884 -0
  137. package/dist/esm/{filter-item-type.enum-61fbf80a.js → filter-item-type.enum-a79b2fa8.js} +2 -0
  138. package/dist/esm/form-config-fetcher-96c6c2dc.js +6889 -0
  139. package/dist/{sankhyablocks/index-2b4d2d14.js → esm/index-e4121713.js} +165 -1466
  140. package/dist/esm/loader.js +2 -18
  141. package/dist/esm/sankhyablocks.js +4 -116
  142. package/dist/esm/snk-application.entry.js +308 -7174
  143. package/dist/esm/snk-config-modal.entry.js +58 -0
  144. package/dist/esm/snk-config-options.entry.js +226 -0
  145. package/dist/esm/snk-configurator_6.entry.js +1147 -0
  146. package/dist/esm/snk-crud.entry.js +20 -12
  147. package/dist/esm/snk-data-unit.entry.js +5 -13
  148. package/dist/esm/snk-field-config_2.entry.js +130 -0
  149. package/dist/esm/snk-filter-binary-select.entry.js +5 -2
  150. package/dist/esm/snk-filter-detail.entry.js +62 -5
  151. package/dist/esm/snk-filter-multi-select.entry.js +6 -3
  152. package/dist/esm/snk-filter-number.entry.js +6 -3
  153. package/dist/esm/snk-filter-period.entry.js +5 -2
  154. package/dist/esm/snk-filter-personalized.entry.js +85 -0
  155. package/dist/esm/snk-filter-search.entry.js +6 -12
  156. package/dist/esm/snk-filter-text.entry.js +2 -2
  157. package/dist/esm/snk-form-config.entry.js +953 -0
  158. package/dist/esm/snk-form.entry.js +40 -27
  159. package/dist/esm/snk-pesquisa.entry.js +2 -2
  160. package/dist/esm/snk-tab-config.entry.js +317 -0
  161. package/dist/{sankhyablocks/taskbar-elements-35d64ff9.js → esm/taskbar-elements-e2ed0536.js} +10 -6
  162. package/dist/esm/teste-pesquisa.entry.js +2 -2
  163. package/dist/sankhyablocks/index.esm.js +0 -1
  164. package/dist/sankhyablocks/p-029ae4e4.entry.js +1 -0
  165. package/dist/sankhyablocks/p-03f9c407.js +1 -0
  166. package/dist/sankhyablocks/p-112455b1.js +1 -0
  167. package/dist/sankhyablocks/p-12ad2a19.entry.js +1 -0
  168. package/dist/sankhyablocks/p-21c8929b.js +1 -0
  169. package/dist/sankhyablocks/p-2b891c4a.entry.js +1 -0
  170. package/dist/sankhyablocks/p-2dc76d79.entry.js +1 -0
  171. package/dist/sankhyablocks/p-361299e8.js +26 -0
  172. package/dist/sankhyablocks/p-3a276f3d.entry.js +1 -0
  173. package/dist/sankhyablocks/p-400cc777.entry.js +1 -0
  174. package/dist/sankhyablocks/p-44ce5b90.entry.js +1 -0
  175. package/dist/sankhyablocks/p-521c96f0.entry.js +1 -0
  176. package/dist/sankhyablocks/p-60eef7cd.entry.js +1 -0
  177. package/dist/sankhyablocks/p-6988f4a6.entry.js +1 -0
  178. package/dist/sankhyablocks/p-6a4162bd.entry.js +1 -0
  179. package/dist/sankhyablocks/p-776ff4d1.entry.js +1 -0
  180. package/dist/sankhyablocks/p-9ba3df4c.js +2 -0
  181. package/dist/sankhyablocks/p-9dc4426d.entry.js +1 -0
  182. package/dist/sankhyablocks/p-9dd2b8cb.js +1 -0
  183. package/dist/sankhyablocks/p-a17a4fca.entry.js +1 -0
  184. package/dist/sankhyablocks/p-a5b26df2.js +1 -0
  185. package/dist/sankhyablocks/p-b6d6b172.js +1 -0
  186. package/dist/sankhyablocks/p-cc4bef9f.entry.js +1 -0
  187. package/dist/sankhyablocks/p-d50651a3.js +1 -0
  188. package/dist/sankhyablocks/p-d690b6b5.entry.js +75 -0
  189. package/dist/sankhyablocks/p-d9fbb26f.js +1 -0
  190. package/dist/sankhyablocks/p-deb1f523.entry.js +1 -0
  191. package/dist/sankhyablocks/p-e871aa92.entry.js +1 -0
  192. package/dist/sankhyablocks/p-e9beab79.entry.js +1 -0
  193. package/dist/sankhyablocks/p-f37cdeb5.entry.js +1 -0
  194. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -129
  195. package/dist/types/components/snk-application/snk-application.d.ts +38 -16
  196. package/dist/types/components/snk-configurator/snk-configurator.d.ts +46 -0
  197. package/dist/types/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.d.ts +8 -0
  198. package/dist/types/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.d.ts +38 -0
  199. package/dist/types/components/snk-crud/snk-crud.d.ts +50 -0
  200. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +92 -0
  201. package/dist/types/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.d.ts +4 -0
  202. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +1 -0
  203. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +2 -0
  204. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +2 -0
  205. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +1 -0
  206. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +24 -0
  207. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +4 -5
  208. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +1 -0
  209. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +3 -1
  210. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +7 -1
  211. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +40 -0
  212. package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +8 -3
  213. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +26 -0
  214. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +31 -17
  215. package/dist/types/components/snk-form/snk-form.d.ts +71 -0
  216. package/dist/types/components/snk-form/subcomponents/snk-config-options/snk-config-options.d.ts +51 -0
  217. package/dist/types/components/snk-form/subcomponents/snk-field-config/snk-field-config.d.ts +32 -0
  218. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +139 -0
  219. package/dist/types/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.d.ts +97 -0
  220. package/dist/types/components/snk-grid/snk-grid.d.ts +59 -0
  221. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +6 -5
  222. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -3
  223. package/dist/types/components.d.ts +424 -24
  224. package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +1 -0
  225. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +21 -3
  226. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +7 -7
  227. package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +1 -0
  228. package/dist/types/lib/index.d.ts +1 -0
  229. package/dist/types/lib/message/resources/crud-utils.msg.d.ts +2 -0
  230. package/dist/types/lib/message/resources/snk-configurator.msg.d.ts +2 -0
  231. package/dist/types/lib/message/resources/snk-form.msg.d.ts +5 -2
  232. package/dist/types/lib/utils/CrudUtils.d.ts +6 -0
  233. package/dist/types/lib/utils/constants.d.ts +76 -0
  234. package/dist/types/lib/utils/pesquisa.d.ts +2 -1
  235. package/package.json +4 -3
  236. package/react/components.d.ts +25 -0
  237. package/react/components.js +25 -0
  238. package/react/components.js.map +1 -1
  239. package/dist/cjs/app-globals-3a1e7e63.js +0 -5
  240. package/dist/cjs/css-shim-b8158822.js +0 -6
  241. package/dist/cjs/dom-36862b77.js +0 -75
  242. package/dist/cjs/index-02201bc9.js +0 -2397
  243. package/dist/cjs/shadow-css-346c0795.js +0 -389
  244. package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -278
  245. package/dist/cjs/snk-filter-item.cjs.entry.js +0 -154
  246. package/dist/cjs/snk-filter-list.cjs.entry.js +0 -91
  247. package/dist/cjs/snk-grid.cjs.entry.js +0 -79
  248. package/dist/cjs/snk-taskbar.cjs.entry.js +0 -160
  249. package/dist/components/index2.js +0 -2384
  250. package/dist/esm/SnkMessageBuilder-a7da466b.js +0 -303
  251. package/dist/esm/app-globals-0f993ce5.js +0 -3
  252. package/dist/esm/css-shim-b3f2ee8d.js +0 -4
  253. package/dist/esm/dom-665d6011.js +0 -73
  254. package/dist/esm/index-2b4d2d14.js +0 -3262
  255. package/dist/esm/index-f1d3e4da.js +0 -2384
  256. package/dist/esm/shadow-css-b18e99d7.js +0 -387
  257. package/dist/esm/snk-filter-bar.entry.js +0 -274
  258. package/dist/esm/snk-filter-item.entry.js +0 -150
  259. package/dist/esm/snk-filter-list.entry.js +0 -87
  260. package/dist/esm/snk-grid.entry.js +0 -75
  261. package/dist/esm/snk-taskbar.entry.js +0 -156
  262. package/dist/esm/taskbar-elements-35d64ff9.js +0 -90
  263. package/dist/sankhyablocks/app-globals-0f993ce5.js +0 -3
  264. package/dist/sankhyablocks/css-shim-b3f2ee8d.js +0 -4
  265. package/dist/sankhyablocks/dom-665d6011.js +0 -73
  266. package/dist/sankhyablocks/filter-item-type.enum-61fbf80a.js +0 -12
  267. package/dist/sankhyablocks/index-f1d3e4da.js +0 -2384
  268. package/dist/sankhyablocks/shadow-css-b18e99d7.js +0 -387
  269. package/dist/sankhyablocks/snk-crud.entry.js +0 -66
  270. package/dist/sankhyablocks/snk-data-unit.entry.js +0 -276
  271. package/dist/sankhyablocks/snk-filter-bar.entry.js +0 -274
  272. package/dist/sankhyablocks/snk-filter-binary-select.entry.js +0 -43
  273. package/dist/sankhyablocks/snk-filter-detail.entry.js +0 -45
  274. package/dist/sankhyablocks/snk-filter-item.entry.js +0 -150
  275. package/dist/sankhyablocks/snk-filter-list.entry.js +0 -87
  276. package/dist/sankhyablocks/snk-filter-multi-select.entry.js +0 -19
  277. package/dist/sankhyablocks/snk-filter-number.entry.js +0 -20
  278. package/dist/sankhyablocks/snk-filter-period.entry.js +0 -33
  279. package/dist/sankhyablocks/snk-filter-search.entry.js +0 -40
  280. package/dist/sankhyablocks/snk-filter-text.entry.js +0 -18
  281. package/dist/sankhyablocks/snk-form.entry.js +0 -129
  282. package/dist/sankhyablocks/snk-grid.entry.js +0 -75
  283. package/dist/sankhyablocks/snk-pesquisa.entry.js +0 -311
  284. package/dist/sankhyablocks/snk-taskbar.entry.js +0 -156
  285. package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +0 -45
  286. package/dist/sankhyablocks/teste-pesquisa.entry.js +0 -33
@@ -9,10 +9,6 @@ export class SnkDataUnit {
9
9
  * Determina quantas linhas são retornadas por página
10
10
  */
11
11
  this.pageSize = 150;
12
- /**
13
- * Quando ativada essa propriedade faz com que haja uma carga imediata no DataUnit
14
- */
15
- this.autoLoad = true;
16
12
  this._dataUnitObserver = (action) => {
17
13
  const duState = {
18
14
  insertionMode: false,
@@ -172,7 +168,7 @@ export class SnkDataUnit {
172
168
  }
173
169
  else {
174
170
  const removeConfirmationTitle = this.getMessage("snkDataUnit.removeConfirmationTitle");
175
- ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, "delete", DialogType.CRITICAL, { btnConfirmDanger: true })
171
+ ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, "delete", DialogType.WARN)
176
172
  .then((result) => resolve(result ? action : undefined));
177
173
  }
178
174
  }
@@ -234,11 +230,6 @@ export class SnkDataUnit {
234
230
  while (resolver = this._onDataUnitResolve.pop()) {
235
231
  resolver(this.dataUnit);
236
232
  }
237
- if (this.autoLoad) {
238
- setTimeout(() => {
239
- this.dataUnit.loadData();
240
- }, 500); //TODO: Ajustar para aguardar filterProvider do dataunit estar pronto.
241
- }
242
233
  }
243
234
  }
244
235
  }
@@ -402,24 +393,6 @@ export class SnkDataUnit {
402
393
  "tags": [],
403
394
  "text": "Executado ap\u00F3s a a\u00E7\u00E3o de salvar"
404
395
  }
405
- },
406
- "autoLoad": {
407
- "type": "boolean",
408
- "mutable": false,
409
- "complexType": {
410
- "original": "boolean",
411
- "resolved": "boolean",
412
- "references": {}
413
- },
414
- "required": false,
415
- "optional": false,
416
- "docs": {
417
- "tags": [],
418
- "text": "Quando ativada essa propriedade faz com que haja uma carga imediata no DataUnit"
419
- },
420
- "attribute": "auto-load",
421
- "reflect": false,
422
- "defaultValue": "true"
423
396
  }
424
397
  };
425
398
  }
@@ -0,0 +1,100 @@
1
+ import { DataType } from "@sankhyalabs/core";
2
+ import { toString } from "@sankhyalabs/core/dist/dataunit/metadata/DataType";
3
+ import FilterItemType from "../filter-item-type.enum";
4
+ const buildFilter = (item) => {
5
+ switch (item.type) {
6
+ case FilterItemType.DEFAULT_FILTER:
7
+ return buildDefault(item);
8
+ case FilterItemType.BINARY_SELECT:
9
+ return buildBinary(item);
10
+ case FilterItemType.MULTI_SELECT:
11
+ return buildMultSelect(item);
12
+ case FilterItemType.PERIOD:
13
+ return buildPeriod(item);
14
+ case FilterItemType.SEARCH:
15
+ return buildSearch(item);
16
+ case FilterItemType.TEXT:
17
+ return buildText(item);
18
+ case FilterItemType.NUMBER:
19
+ return buildNumber(item);
20
+ case FilterItemType.PERSONALIZED:
21
+ return buildPersonalized(item);
22
+ default:
23
+ return undefined;
24
+ }
25
+ };
26
+ export default buildFilter;
27
+ function buildDefault(item) {
28
+ return { name: item.id, expression: item.props.expression, params: [] };
29
+ }
30
+ function buildBinary(item) {
31
+ const { id, value, props } = item;
32
+ const options = props.options;
33
+ const selectedOption = options.find(opt => opt.name === value);
34
+ return { name: id, expression: selectedOption.expression, params: [] };
35
+ }
36
+ function buildMultSelect(item) {
37
+ const { id, value, props } = item;
38
+ return { name: id, expression: props.expression, params: [{ name: id, dataType: DataType.TEXT, value }] };
39
+ }
40
+ function buildPeriod(item) {
41
+ const { id, value, props } = item;
42
+ let { end, start } = value;
43
+ if (typeof end === "string") {
44
+ end = new Date(end);
45
+ }
46
+ if (typeof start === "string") {
47
+ start = new Date(start);
48
+ }
49
+ const params = [];
50
+ let expression;
51
+ if (end && start) {
52
+ expression = props.expression.fullfill;
53
+ params.push({ name: `${id}.START`, dataType: DataType.DATE, value: toString(DataType.DATE, start) }, { name: `${id}.END`, dataType: DataType.DATE, value: toString(DataType.DATE, end) });
54
+ }
55
+ else {
56
+ if (start) {
57
+ expression = props.expression.onlystart;
58
+ params.push({ name: id, dataType: DataType.DATE, value: toString(DataType.DATE, start) });
59
+ }
60
+ else {
61
+ expression = props.expression.onlyend;
62
+ params.push({ name: id, dataType: DataType.DATE, value: toString(DataType.DATE, end) });
63
+ }
64
+ }
65
+ return { name: id, expression, params };
66
+ }
67
+ function buildSearch(item) {
68
+ const { id, value, props } = item;
69
+ const expression = props.expression;
70
+ return { name: id, expression, params: [{ name: id, dataType: DataType.TEXT, value: toString(DataType.TEXT, value.value) }] };
71
+ }
72
+ function buildText(item) {
73
+ const { id, value, props } = item;
74
+ const expression = props.expression;
75
+ return { name: id, expression, params: [{ name: id, dataType: DataType.TEXT, value: toString(DataType.TEXT, value) }] };
76
+ }
77
+ function buildNumber(item) {
78
+ const { id, value, props } = item;
79
+ const expression = props.expression;
80
+ return { name: id, expression, params: [{ name: id, dataType: DataType.NUMBER, value: toString(DataType.NUMBER, value) }] };
81
+ }
82
+ function buildPersonalized(item) {
83
+ var _a;
84
+ const { id, value, props } = item;
85
+ const expression = props.expression;
86
+ return {
87
+ name: id, expression, params: (((_a = props.personalizedFilter) === null || _a === void 0 ? void 0 : _a.parameters) || []).map((param, index) => {
88
+ const valuesArray = Array.from(value);
89
+ const dataType = param.dataType;
90
+ let paramValue = (index >= 0 && index < valuesArray.length ? valuesArray[index] : null);
91
+ if (paramValue != undefined && typeof paramValue === "object" && "value" in paramValue) {
92
+ paramValue = paramValue["value"];
93
+ }
94
+ if (paramValue == undefined && dataType === DataType.BOOLEAN) {
95
+ paramValue = false;
96
+ }
97
+ return { name: param.name, dataType, value: typeof paramValue === "string" ? paramValue : toString(dataType, paramValue) };
98
+ })
99
+ };
100
+ }
@@ -27,6 +27,9 @@ export class SnkFilterBinarySelect {
27
27
  this.value = undefined;
28
28
  }
29
29
  }
30
+ async show() {
31
+ this._checkOne.setFocus();
32
+ }
30
33
  render() {
31
34
  if (!this.config || this.config.type !== FilterItemType.BINARY_SELECT) {
32
35
  return undefined;
@@ -76,6 +79,26 @@ export class SnkFilterBinarySelect {
76
79
  }
77
80
  };
78
81
  }
82
+ static get methods() {
83
+ return {
84
+ "show": {
85
+ "complexType": {
86
+ "signature": "() => Promise<void>",
87
+ "parameters": [],
88
+ "references": {
89
+ "Promise": {
90
+ "location": "global"
91
+ }
92
+ },
93
+ "return": "Promise<void>"
94
+ },
95
+ "docs": {
96
+ "text": "",
97
+ "tags": []
98
+ }
99
+ }
100
+ };
101
+ }
79
102
  static get listeners() {
80
103
  return [{
81
104
  "name": "ezChange",
@@ -4,11 +4,14 @@ export class SnkFilterMultiSelect {
4
4
  ezChangeListener(evt) {
5
5
  this.value = evt.detail.value;
6
6
  }
7
+ async show() {
8
+ this._comboElement.setFocus();
9
+ }
7
10
  render() {
8
11
  if (!this.config || this.config.type !== FilterItemType.MULTI_SELECT) {
9
12
  return undefined;
10
13
  }
11
- return (h("ez-combo-box", { label: this.config.label, value: this.config.value, options: this.config.props.options }));
14
+ return (h("ez-combo-box", { ref: ref => this._comboElement = ref, label: this.config.label, value: this.config.value, options: this.config.props.options }));
12
15
  }
13
16
  static get is() { return "snk-filter-multi-select"; }
14
17
  static get properties() {
@@ -52,6 +55,26 @@ export class SnkFilterMultiSelect {
52
55
  }
53
56
  };
54
57
  }
58
+ static get methods() {
59
+ return {
60
+ "show": {
61
+ "complexType": {
62
+ "signature": "() => Promise<void>",
63
+ "parameters": [],
64
+ "references": {
65
+ "Promise": {
66
+ "location": "global"
67
+ }
68
+ },
69
+ "return": "Promise<void>"
70
+ },
71
+ "docs": {
72
+ "text": "",
73
+ "tags": []
74
+ }
75
+ }
76
+ };
77
+ }
55
78
  static get listeners() {
56
79
  return [{
57
80
  "name": "ezChange",
@@ -4,12 +4,15 @@ export class SnkFilterPeriod {
4
4
  ezChangeListener(evt) {
5
5
  this.value = evt.detail;
6
6
  }
7
+ async show() {
8
+ this._numberElement.setFocus();
9
+ }
7
10
  render() {
8
11
  var _a;
9
12
  if (!this.config || this.config.type !== FilterItemType.NUMBER) {
10
13
  return undefined;
11
14
  }
12
- return (h("ez-number-input", { label: this.config.label, value: this.config.value, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision }));
15
+ return (h("ez-number-input", { ref: ref => this._numberElement = ref, label: this.config.label, value: this.config.value, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision }));
13
16
  }
14
17
  static get is() { return "snk-filter-number"; }
15
18
  static get properties() {
@@ -53,6 +56,26 @@ export class SnkFilterPeriod {
53
56
  }
54
57
  };
55
58
  }
59
+ static get methods() {
60
+ return {
61
+ "show": {
62
+ "complexType": {
63
+ "signature": "() => Promise<void>",
64
+ "parameters": [],
65
+ "references": {
66
+ "Promise": {
67
+ "location": "global"
68
+ }
69
+ },
70
+ "return": "Promise<void>"
71
+ },
72
+ "docs": {
73
+ "text": "",
74
+ "tags": []
75
+ }
76
+ }
77
+ };
78
+ }
56
79
  static get listeners() {
57
80
  return [{
58
81
  "name": "ezChange",
@@ -18,6 +18,9 @@ export class SnkFilterPeriod {
18
18
  }
19
19
  return null;
20
20
  }
21
+ async show() {
22
+ this._startDate.setFocus();
23
+ }
21
24
  render() {
22
25
  if (!this.config || this.config.type !== FilterItemType.PERIOD) {
23
26
  return undefined;
@@ -66,6 +69,26 @@ export class SnkFilterPeriod {
66
69
  }
67
70
  };
68
71
  }
72
+ static get methods() {
73
+ return {
74
+ "show": {
75
+ "complexType": {
76
+ "signature": "() => Promise<void>",
77
+ "parameters": [],
78
+ "references": {
79
+ "Promise": {
80
+ "location": "global"
81
+ }
82
+ },
83
+ "return": "Promise<void>"
84
+ },
85
+ "docs": {
86
+ "text": "",
87
+ "tags": []
88
+ }
89
+ }
90
+ };
91
+ }
69
92
  static get listeners() {
70
93
  return [{
71
94
  "name": "ezChange",
@@ -0,0 +1,180 @@
1
+ import { ApplicationContext, 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
+ getValue(param, index) {
8
+ if (this.value && index >= 0 && index < this.value.length) {
9
+ const rawValue = this.value[index];
10
+ if (param.type === UserInterface.SEARCH) {
11
+ return rawValue;
12
+ }
13
+ return convertType(param.dataType, rawValue);
14
+ }
15
+ return undefined;
16
+ }
17
+ setValue(index, value) {
18
+ if (this.value == undefined) {
19
+ this.value = Array(index).fill(null);
20
+ }
21
+ else {
22
+ this.value = [...this.value];
23
+ }
24
+ this.value[index] = value;
25
+ if (this.value.filter(item => item != undefined).length == 0) {
26
+ this.value = null;
27
+ }
28
+ }
29
+ doSearch(mode, argument, param) {
30
+ const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
31
+ return new Promise((resolve, reject) => {
32
+ application.executePreparedSearch(mode, argument, param.searchContext)
33
+ .then(result => {
34
+ resolve(result);
35
+ }).catch(reason => {
36
+ reject(reason);
37
+ });
38
+ });
39
+ }
40
+ getParamsInterface() {
41
+ var _a, _b, _c;
42
+ 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;
43
+ return params.map((param, index) => {
44
+ var _a;
45
+ const elemId = 'param_' + index;
46
+ switch (param.type) {
47
+ case UserInterface.SEARCH:
48
+ 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) });
49
+ case UserInterface.SWITCH:
50
+ case UserInterface.CHECKBOX:
51
+ const mode = UserInterface.SWITCH === param.type ? CheckMode.SWITCH : CheckMode.REGULAR;
52
+ 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) });
53
+ case UserInterface.DECIMALNUMBER:
54
+ case UserInterface.INTEGERNUMBER:
55
+ 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) });
56
+ case UserInterface.OPTIONSELECTOR:
57
+ 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); } });
58
+ case UserInterface.DATE:
59
+ return h("ez-date-input", { id: elemId, label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
60
+ case UserInterface.DATETIME:
61
+ return h("ez-date-time-input", { id: elemId, label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
62
+ default:
63
+ return h("ez-text-input", { id: elemId, label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
64
+ }
65
+ });
66
+ }
67
+ async show() {
68
+ const elem = document.querySelector("#param_0");
69
+ if (elem) {
70
+ elem["setFocus"]();
71
+ }
72
+ }
73
+ render() {
74
+ if (!this.config || this.config.type !== FilterItemType.PERSONALIZED) {
75
+ return undefined;
76
+ }
77
+ return (h(Host, null, this.getParamsInterface()));
78
+ }
79
+ static get is() { return "snk-filter-personalized"; }
80
+ static get properties() {
81
+ return {
82
+ "config": {
83
+ "type": "unknown",
84
+ "mutable": false,
85
+ "complexType": {
86
+ "original": "SnkFilterItemConfig",
87
+ "resolved": "SnkFilterItemConfig",
88
+ "references": {
89
+ "SnkFilterItemConfig": {
90
+ "location": "import",
91
+ "path": "../snk-filter-item"
92
+ }
93
+ }
94
+ },
95
+ "required": false,
96
+ "optional": false,
97
+ "docs": {
98
+ "tags": [],
99
+ "text": ""
100
+ }
101
+ },
102
+ "value": {
103
+ "type": "unknown",
104
+ "mutable": true,
105
+ "complexType": {
106
+ "original": "Array<IOption|boolean|string|number|Date>",
107
+ "resolved": "(string | number | boolean | Date | IOption)[]",
108
+ "references": {
109
+ "Array": {
110
+ "location": "global"
111
+ },
112
+ "IOption": {
113
+ "location": "import",
114
+ "path": "@sankhyalabs/ezui/dist/types/components/ez-combo-box/ez-combo-box"
115
+ },
116
+ "Date": {
117
+ "location": "global"
118
+ }
119
+ }
120
+ },
121
+ "required": false,
122
+ "optional": false,
123
+ "docs": {
124
+ "tags": [],
125
+ "text": ""
126
+ }
127
+ },
128
+ "fix": {
129
+ "type": "unknown",
130
+ "mutable": false,
131
+ "complexType": {
132
+ "original": "()=>void",
133
+ "resolved": "() => void",
134
+ "references": {}
135
+ },
136
+ "required": false,
137
+ "optional": false,
138
+ "docs": {
139
+ "tags": [],
140
+ "text": ""
141
+ }
142
+ },
143
+ "unfix": {
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
+ };
159
+ }
160
+ static get methods() {
161
+ return {
162
+ "show": {
163
+ "complexType": {
164
+ "signature": "() => Promise<void>",
165
+ "parameters": [],
166
+ "references": {
167
+ "Promise": {
168
+ "location": "global"
169
+ }
170
+ },
171
+ "return": "Promise<void>"
172
+ },
173
+ "docs": {
174
+ "text": "",
175
+ "tags": []
176
+ }
177
+ }
178
+ };
179
+ }
180
+ }
@@ -7,24 +7,18 @@ export class SnkFilterSearch {
7
7
  }
8
8
  doSearch(mode, argument) {
9
9
  const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
10
- if (this.fix) {
11
- this.fix();
12
- }
13
10
  return new Promise((resolve, reject) => {
14
11
  application.executePreparedSearch(mode, argument, this.config.props.searchContext)
15
12
  .then(result => {
16
13
  resolve(result);
17
- if (this.unfix) {
18
- this.unfix();
19
- }
20
14
  }).catch(reason => {
21
15
  reject(reason);
22
- if (this.unfix) {
23
- this.unfix();
24
- }
25
16
  });
26
17
  });
27
18
  }
19
+ async show() {
20
+ this._searchInput.setFocus();
21
+ }
28
22
  render() {
29
23
  if (!this.config || this.config.type !== FilterItemType.SEARCH) {
30
24
  return undefined;
@@ -58,10 +52,10 @@ export class SnkFilterSearch {
58
52
  "type": "unknown",
59
53
  "mutable": false,
60
54
  "complexType": {
61
- "original": "Option",
62
- "resolved": "Option",
55
+ "original": "IOption",
56
+ "resolved": "IOption",
63
57
  "references": {
64
- "Option": {
58
+ "IOption": {
65
59
  "location": "import",
66
60
  "path": "@sankhyalabs/ezui/dist/types/components/ez-combo-box/ez-combo-box"
67
61
  }
@@ -73,35 +67,25 @@ export class SnkFilterSearch {
73
67
  "tags": [],
74
68
  "text": ""
75
69
  }
76
- },
77
- "fix": {
78
- "type": "unknown",
79
- "mutable": false,
80
- "complexType": {
81
- "original": "()=>void",
82
- "resolved": "() => void",
83
- "references": {}
84
- },
85
- "required": false,
86
- "optional": false,
87
- "docs": {
88
- "tags": [],
89
- "text": ""
90
- }
91
- },
92
- "unfix": {
93
- "type": "unknown",
94
- "mutable": false,
70
+ }
71
+ };
72
+ }
73
+ static get methods() {
74
+ return {
75
+ "show": {
95
76
  "complexType": {
96
- "original": "()=>void",
97
- "resolved": "() => void",
98
- "references": {}
77
+ "signature": "() => Promise<void>",
78
+ "parameters": [],
79
+ "references": {
80
+ "Promise": {
81
+ "location": "global"
82
+ }
83
+ },
84
+ "return": "Promise<void>"
99
85
  },
100
- "required": false,
101
- "optional": false,
102
86
  "docs": {
103
- "tags": [],
104
- "text": ""
87
+ "text": "",
88
+ "tags": []
105
89
  }
106
90
  }
107
91
  };
@@ -7,7 +7,7 @@ export class SnkFilterText {
7
7
  if (!this.config) {
8
8
  return undefined;
9
9
  }
10
- return (h("ez-text-input", { label: this.config.label, value: this.config.value }));
10
+ return (h("ez-text-input", { ref: ref => this._textInputElement = ref, label: this.config.label, value: this.config.value }));
11
11
  }
12
12
  static get is() { return "snk-filter-text"; }
13
13
  static get properties() {
@@ -6,5 +6,7 @@ var FilterItemType;
6
6
  FilterItemType["SEARCH"] = "SEARCH";
7
7
  FilterItemType["TEXT"] = "TEXT";
8
8
  FilterItemType["NUMBER"] = "NUMBER";
9
+ FilterItemType["DEFAULT_FILTER"] = "DEFAULT_FILTER";
10
+ FilterItemType["PERSONALIZED"] = "PERSONALIZED";
9
11
  })(FilterItemType || (FilterItemType = {}));
10
12
  export default FilterItemType;