@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-33766.1 → 0.0.0-bugfix-dev-KB-39469.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 (221) hide show
  1. package/dist/cjs/{ConfigStorage-302bbbd4.js → ConfigStorage-d4c99a5e.js} +2 -2
  2. package/dist/cjs/{DataFetcher-ba94ed5b.js → DataFetcher-99f0f6ed.js} +5 -3
  3. package/dist/cjs/{ISave-d68ce3cd.js → ISave-e91b70a7.js} +1 -0
  4. package/dist/cjs/{SnkFormConfigManager-71c4768e.js → SnkFormConfigManager-3621bfc4.js} +2 -2
  5. package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-e7dcf408.js} +13 -0
  6. package/dist/cjs/{auth-fetcher-c8467c07.js → auth-fetcher-5161d082.js} +1 -1
  7. package/dist/cjs/{form-config-fetcher-df043d3d.js → form-config-fetcher-9f1a13ca.js} +1 -1
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/{dataunit-fetcher-bd4c52da.js → pesquisa-fetcher-c416a6b7.js} +238 -28
  10. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  11. package/dist/cjs/snk-actions-button_2.cjs.entry.js +21 -6
  12. package/dist/cjs/snk-application.cjs.entry.js +37 -8
  13. package/dist/cjs/snk-attach.cjs.entry.js +389 -58
  14. package/dist/cjs/snk-crud.cjs.entry.js +11 -9
  15. package/dist/cjs/snk-data-exporter.cjs.entry.js +4 -4
  16. package/dist/cjs/{snk-data-unit-1bc69073.js → snk-data-unit-82c08a8c.js} +1 -1
  17. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  18. package/dist/cjs/snk-detail-view.cjs.entry.js +8 -9
  19. package/dist/cjs/snk-entity-list.cjs.entry.js +5 -3
  20. package/dist/cjs/snk-filter-bar.cjs.entry.js +28 -6
  21. package/dist/cjs/snk-filter-item.cjs.entry.js +3 -0
  22. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  23. package/dist/cjs/snk-filter-modal.cjs.entry.js +2 -1
  24. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +2 -1
  25. package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
  26. package/dist/cjs/snk-form.cjs.entry.js +4 -4
  27. package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
  28. package/dist/cjs/snk-grid.cjs.entry.js +5 -4
  29. package/dist/cjs/{snk-guides-viewer-dce60912.js → snk-guides-viewer-3ab9623e.js} +8 -9
  30. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -8
  31. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  32. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  33. package/dist/cjs/snk-simple-crud.cjs.entry.js +19 -8
  34. package/dist/cjs/snk-taskbar.cjs.entry.js +51 -3
  35. package/dist/collection/collection-manifest.json +1 -1
  36. package/dist/collection/components/snk-application/__mocks__/snk-application.js +7 -0
  37. package/dist/collection/components/snk-application/snk-application.js +43 -0
  38. package/dist/collection/components/snk-attach/snk-attach.js +188 -39
  39. package/dist/collection/components/snk-attach/structure/{crud-config-builder.js → builder/anexo-sistema-crud-config.builder.js} +1 -1
  40. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +62 -0
  41. package/dist/collection/components/snk-attach/structure/{taskbar-builder.js → builder/taskbar-builder.js} +1 -1
  42. package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js +1 -0
  43. package/dist/collection/components/snk-attach/structure/{data-unit-builder.js → fetcher/factory/anexo-sistema-data-unit.factory.js} +14 -11
  44. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +111 -0
  45. package/dist/collection/components/snk-attach/structure/index.js +6 -3
  46. package/dist/collection/components/snk-crud/snk-crud.js +23 -3
  47. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +11 -2
  48. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +2 -2
  49. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +1 -1
  50. package/dist/collection/components/snk-entity-list/snk-entity-list.js +5 -3
  51. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +2 -1
  52. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +3 -0
  53. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +19 -1
  54. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +39 -2
  55. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
  56. package/dist/collection/components/snk-grid/snk-grid.js +19 -1
  57. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +2 -4
  58. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +53 -1
  59. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +17 -1
  60. package/dist/collection/components/snk-taskbar/snk-taskbar.css +17 -0
  61. package/dist/collection/components/snk-taskbar/snk-taskbar.js +88 -3
  62. package/dist/collection/lib/dataUnit/InMemoryLoader.js +1 -1
  63. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +5 -3
  64. package/dist/collection/lib/http/data-fetcher/fetchers/{attach-fetcher.js → AttachFetcher/anexo-sistema-fetcher.js} +16 -15
  65. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js +90 -0
  66. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js +1 -0
  67. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js +2 -0
  68. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js +1 -0
  69. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js +1 -0
  70. package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.js +1 -0
  71. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +31 -3
  72. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +37 -23
  73. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +21 -0
  74. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +10 -4
  75. package/dist/collection/lib/index.js +1 -1
  76. package/dist/collection/lib/message/resources/snk-attach.msg.js +13 -0
  77. package/dist/components/DataFetcher.js +5 -3
  78. package/dist/components/SnkMessageBuilder.js +13 -0
  79. package/dist/components/dataunit-fetcher.js +79 -31
  80. package/dist/components/snk-actions-button2.js +1 -0
  81. package/dist/components/snk-application2.js +32 -1
  82. package/dist/components/snk-attach2.js +394 -57
  83. package/dist/components/snk-crud.js +7 -3
  84. package/dist/components/snk-data-exporter2.js +1 -1
  85. package/dist/components/snk-detail-view2.js +3 -3
  86. package/dist/components/snk-entity-list.js +5 -3
  87. package/dist/components/snk-filter-bar2.js +26 -3
  88. package/dist/components/snk-filter-item2.js +3 -0
  89. package/dist/components/snk-filter-modal.js +4 -2
  90. package/dist/components/snk-filter-multi-select.js +2 -1
  91. package/dist/components/snk-grid2.js +3 -1
  92. package/dist/components/snk-pesquisa2.js +1 -1
  93. package/dist/components/snk-simple-crud2.js +15 -1
  94. package/dist/components/snk-taskbar2.js +55 -4
  95. package/dist/components/taskbar-actions-button2.js +17 -1
  96. package/dist/esm/{ConfigStorage-4151acc8.js → ConfigStorage-39ed8aeb.js} +2 -2
  97. package/dist/esm/{DataFetcher-aa159c5a.js → DataFetcher-a650ae58.js} +5 -3
  98. package/dist/esm/{ISave-4412b20c.js → ISave-d8c8bc59.js} +1 -0
  99. package/dist/esm/{SnkFormConfigManager-5c7d3771.js → SnkFormConfigManager-692e20c7.js} +2 -2
  100. package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-0fb796b9.js} +13 -0
  101. package/dist/esm/{auth-fetcher-c05dc474.js → auth-fetcher-17dc5b5e.js} +1 -1
  102. package/dist/esm/{form-config-fetcher-36219cd3.js → form-config-fetcher-f121f880.js} +1 -1
  103. package/dist/esm/loader.js +1 -1
  104. package/dist/esm/{dataunit-fetcher-65714f21.js → pesquisa-fetcher-ab16a2e8.js} +238 -29
  105. package/dist/esm/sankhyablocks.js +1 -1
  106. package/dist/esm/snk-actions-button_2.entry.js +21 -6
  107. package/dist/esm/snk-application.entry.js +36 -7
  108. package/dist/esm/snk-attach.entry.js +390 -59
  109. package/dist/esm/snk-crud.entry.js +11 -9
  110. package/dist/esm/snk-data-exporter.entry.js +4 -4
  111. package/dist/esm/{snk-data-unit-6208ebf0.js → snk-data-unit-5d201fb3.js} +1 -1
  112. package/dist/esm/snk-data-unit.entry.js +2 -2
  113. package/dist/esm/snk-detail-view.entry.js +8 -9
  114. package/dist/esm/snk-entity-list.entry.js +5 -3
  115. package/dist/esm/snk-filter-bar.entry.js +28 -6
  116. package/dist/esm/snk-filter-item.entry.js +3 -0
  117. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  118. package/dist/esm/snk-filter-modal.entry.js +2 -1
  119. package/dist/esm/snk-filter-multi-select.entry.js +2 -1
  120. package/dist/esm/snk-form-config.entry.js +2 -2
  121. package/dist/esm/snk-form.entry.js +4 -4
  122. package/dist/esm/snk-grid-config.entry.js +3 -3
  123. package/dist/esm/snk-grid.entry.js +5 -4
  124. package/dist/esm/{snk-guides-viewer-8b9564bd.js → snk-guides-viewer-462b4c9e.js} +8 -9
  125. package/dist/esm/snk-guides-viewer.entry.js +7 -8
  126. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  127. package/dist/esm/snk-pesquisa.entry.js +1 -1
  128. package/dist/esm/snk-simple-crud.entry.js +17 -6
  129. package/dist/esm/snk-taskbar.entry.js +52 -4
  130. package/dist/sankhyablocks/p-007f1026.entry.js +1 -0
  131. package/dist/sankhyablocks/p-0264dba5.entry.js +1 -0
  132. package/dist/sankhyablocks/{p-ff6064e7.js → p-05243555.js} +1 -1
  133. package/dist/sankhyablocks/p-0ae89faa.entry.js +1 -0
  134. package/dist/sankhyablocks/{p-cb7419e0.entry.js → p-0b0b36ac.entry.js} +1 -1
  135. package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
  136. package/dist/sankhyablocks/p-33718dfc.entry.js +1 -0
  137. package/dist/sankhyablocks/p-33bc44a6.entry.js +1 -0
  138. package/dist/sankhyablocks/p-48afb1d3.entry.js +1 -0
  139. package/dist/sankhyablocks/p-50783a8b.js +1 -0
  140. package/dist/sankhyablocks/{p-aa95fb2c.js → p-67aedbe0.js} +1 -1
  141. package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
  142. package/dist/sankhyablocks/{p-573a07c5.js → p-725d04ba.js} +1 -1
  143. package/dist/sankhyablocks/{p-e0fd9555.entry.js → p-827e4b01.entry.js} +1 -1
  144. package/dist/sankhyablocks/{p-6977a26c.entry.js → p-86801b08.entry.js} +1 -1
  145. package/dist/sankhyablocks/p-88c7dd9a.entry.js +1 -0
  146. package/dist/sankhyablocks/p-93d7e848.entry.js +1 -0
  147. package/dist/sankhyablocks/{p-7f3c7b09.entry.js → p-9d608b62.entry.js} +1 -1
  148. package/dist/sankhyablocks/{p-0d7863ed.js → p-a13ccb86.js} +1 -1
  149. package/dist/sankhyablocks/p-a3a9d37d.js +1 -0
  150. package/dist/sankhyablocks/{p-9695f78b.js → p-be75153c.js} +1 -1
  151. package/dist/sankhyablocks/p-bf2acf72.entry.js +1 -0
  152. package/dist/sankhyablocks/p-c093edc7.entry.js +1 -0
  153. package/dist/sankhyablocks/p-c4874327.entry.js +1 -0
  154. package/dist/sankhyablocks/p-c6247955.js +65 -0
  155. package/dist/sankhyablocks/{p-247a8b36.entry.js → p-d1791da2.entry.js} +1 -1
  156. package/dist/sankhyablocks/{p-761ed32f.entry.js → p-e3bd000e.entry.js} +1 -1
  157. package/dist/sankhyablocks/p-ed2dce4b.entry.js +1 -0
  158. package/dist/sankhyablocks/{p-32f0935f.js → p-f3d1c48e.js} +1 -1
  159. package/dist/sankhyablocks/{p-1d75d9f9.entry.js → p-fcdcb0e2.entry.js} +1 -1
  160. package/dist/sankhyablocks/{p-c223b7b2.entry.js → p-fd0a8d68.entry.js} +3 -3
  161. package/dist/sankhyablocks/{p-0874adb5.entry.js → p-fdc4cb9b.entry.js} +1 -1
  162. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  163. package/dist/types/components/snk-application/__mocks__/snk-application.d.ts +3 -0
  164. package/dist/types/components/snk-application/snk-application.d.ts +7 -0
  165. package/dist/types/components/snk-attach/{structure/crud-config-builder.d.ts → interfaces/ICrudConfig.d.ts} +1 -2
  166. package/dist/types/components/snk-attach/interfaces/TFetcherType.d.ts +1 -0
  167. package/dist/types/components/snk-attach/snk-attach.d.ts +27 -6
  168. package/dist/types/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.d.ts +2 -0
  169. package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +31 -0
  170. package/dist/types/components/snk-attach/structure/{taskbar-builder.d.ts → builder/taskbar-builder.d.ts} +1 -1
  171. package/dist/types/components/snk-attach/structure/fetcher/facade/fetcher.facade.d.ts +11 -0
  172. package/dist/types/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.d.ts +17 -0
  173. package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +15 -0
  174. package/dist/types/components/snk-attach/structure/index.d.ts +6 -3
  175. package/dist/types/components/snk-crud/snk-crud.d.ts +5 -0
  176. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +1 -1
  177. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +5 -0
  178. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +7 -0
  179. package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +3 -1
  180. package/dist/types/components/snk-grid/snk-grid.d.ts +5 -0
  181. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +10 -1
  182. package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +1 -0
  183. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +20 -1
  184. package/dist/types/components.d.ts +106 -2
  185. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
  186. package/dist/types/lib/http/data-fetcher/fetchers/{attach-fetcher.d.ts → AttachFetcher/anexo-sistema-fetcher.d.ts} +3 -2
  187. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.d.ts +11 -0
  188. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.d.ts +8 -0
  189. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/index.d.ts +3 -0
  190. package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.d.ts +2 -1
  191. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +2 -0
  192. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +1 -0
  193. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
  194. package/dist/types/lib/index.d.ts +1 -1
  195. package/package.json +15 -6
  196. package/dist/cjs/pesquisa-fetcher-ef050a47.js +0 -167
  197. package/dist/esm/pesquisa-fetcher-dd3ca0a5.js +0 -165
  198. package/dist/sankhyablocks/p-20726710.entry.js +0 -1
  199. package/dist/sankhyablocks/p-28564b5e.entry.js +0 -1
  200. package/dist/sankhyablocks/p-29804fc5.js +0 -60
  201. package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
  202. package/dist/sankhyablocks/p-55930465.entry.js +0 -1
  203. package/dist/sankhyablocks/p-69efa80d.entry.js +0 -1
  204. package/dist/sankhyablocks/p-7d8d7fe9.entry.js +0 -1
  205. package/dist/sankhyablocks/p-95a3778f.entry.js +0 -1
  206. package/dist/sankhyablocks/p-a9e5b094.entry.js +0 -1
  207. package/dist/sankhyablocks/p-b05ab13d.entry.js +0 -1
  208. package/dist/sankhyablocks/p-b146a9f0.entry.js +0 -1
  209. package/dist/sankhyablocks/p-bedb8ad6.entry.js +0 -1
  210. package/dist/sankhyablocks/p-cdd66657.entry.js +0 -1
  211. package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
  212. package/dist/sankhyablocks/p-d9bb09b3.js +0 -6
  213. package/dist/sankhyablocks/p-e6380c60.js +0 -1
  214. package/dist/sankhyablocks/p-ebbc17c6.js +0 -1
  215. package/dist/types/components/snk-attach/structure/data-unit-builder.d.ts +0 -15
  216. /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js → components/snk-attach/interfaces/ICrudConfig.js} +0 -0
  217. /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js → components/snk-attach/interfaces/TFetcherType.js} +0 -0
  218. /package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.js +0 -0
  219. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDelete.d.ts +0 -0
  220. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDownloadKey.d.ts +0 -0
  221. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { TaskbarElement } from "../../snk-taskbar/elements/taskbar-elements";
1
+ import { TaskbarElement } from "../../../snk-taskbar/elements/taskbar-elements";
2
2
  import { ApplicationContext } from "@sankhyalabs/core";
3
3
  const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
4
4
  const getMessage = (key) => {
@@ -1,28 +1,31 @@
1
1
  import { Action, ApplicationContext, DataType } from "@sankhyalabs/core";
2
- import { SaveErrorsEnum } from "../../../lib/http/data-fetcher/fetchers/fecthAttach/interfaces";
3
- import { VIEW_MODE } from "../../../lib/utils/constants";
4
- import PreloadManager from '../../../lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager';
5
- export class AttachmentDataUnitBuilder {
2
+ import { SaveErrorsEnum } from "../../../../../lib/http/data-fetcher/fetchers/AttachFetcher/interfaces";
3
+ import { VIEW_MODE } from "../../../../../lib/utils/constants";
4
+ import PreloadManager from '../../../../../lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager';
5
+ export class AnexoSistemaDataUnitFactory {
6
6
  constructor(entityName, getMessage) {
7
7
  this.entityName = entityName;
8
8
  this.getMessage = getMessage;
9
9
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
10
10
  }
11
- initLoaders(dataUnit, attachFetcher, onSuccess) {
11
+ initLoaders(dataUnit, fetcher, onSuccess) {
12
12
  if (!this.loader)
13
13
  this.loader = dataUnit.dataLoader;
14
14
  dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
15
- dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, attachFetcher).then((recordIds) => {
15
+ dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, fetcher).then((recordIds) => {
16
16
  if (recordIds.length)
17
17
  onSuccess();
18
18
  return recordIds;
19
19
  });
20
- dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, attachFetcher).then((recordIds) => {
20
+ dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, fetcher).then((recordIds) => {
21
21
  if (recordIds.length)
22
22
  onSuccess();
23
23
  return recordIds;
24
24
  });
25
25
  }
26
+ metadataLoader(dataUnit) {
27
+ throw new Error("Method not implemented.");
28
+ }
26
29
  dataLoader(dataUnit, request) {
27
30
  return new Promise(resolve => {
28
31
  this.loader(dataUnit, request).then(response => {
@@ -38,11 +41,11 @@ export class AttachmentDataUnitBuilder {
38
41
  });
39
42
  });
40
43
  }
41
- saveLoader(changes, attachFetcher) {
44
+ saveLoader(changes, fetcher) {
42
45
  return new Promise((resolve) => {
43
46
  var _a;
44
47
  const change = Array.isArray(changes) ? changes[0] : {};
45
- const savePromise = ((_a = change === null || change === void 0 ? void 0 : change.record) === null || _a === void 0 ? void 0 : _a.NUATTACH) >= 0 ? attachFetcher.edit.bind(attachFetcher) : attachFetcher.save.bind(attachFetcher);
48
+ const savePromise = ((_a = change === null || change === void 0 ? void 0 : change.record) === null || _a === void 0 ? void 0 : _a.NUATTACH) >= 0 ? fetcher.edit.bind(fetcher) : fetcher.save.bind(fetcher);
46
49
  savePromise(change).then((records) => {
47
50
  resolve(records);
48
51
  }).catch((error) => {
@@ -62,11 +65,11 @@ export class AttachmentDataUnitBuilder {
62
65
  });
63
66
  });
64
67
  }
65
- removeLoader(dataUnit, ids, attachFetcher) {
68
+ removeLoader(dataUnit, ids, fetcher) {
66
69
  return new Promise((resolve) => {
67
70
  const { records } = dataUnit.getSelectionInfo();
68
71
  const recordToDelete = records[0];
69
- attachFetcher.delete(recordToDelete).then(() => {
72
+ fetcher.delete(recordToDelete).then(() => {
70
73
  PreloadManager.removeRecords(dataUnit, [recordToDelete]);
71
74
  return resolve(ids);
72
75
  });
@@ -0,0 +1,111 @@
1
+ import { Action, ApplicationContext, StringUtils } from "@sankhyalabs/core";
2
+ import { SaveErrorsEnum } from "../../../../../lib/http/data-fetcher/fetchers/AttachFetcher/interfaces";
3
+ import { AutorizationType } from "../../../../../lib/http/data-fetcher/fetchers/auth-fetcher";
4
+ import { attachFetcherMetadataBuilder } from "../../builder/attach-crud-config.builder";
5
+ import { VIEW_MODE } from "../../../../../lib/utils/constants";
6
+ const SERVICE_LOAD = "Attach.load";
7
+ export class AttachFetcherDataUnitFactory {
8
+ constructor(getMessage) {
9
+ this.getMessage = getMessage;
10
+ this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
11
+ }
12
+ initLoaders(dataUnit, fetcher, onSuccess) {
13
+ dataUnit.metadataLoader = (dataUnit) => this.metadataLoader(dataUnit);
14
+ dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
15
+ dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, fetcher).then((recordIds) => {
16
+ if (recordIds.length)
17
+ onSuccess();
18
+ return recordIds;
19
+ });
20
+ dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, fetcher).then((recordIds) => {
21
+ if (recordIds.length)
22
+ onSuccess();
23
+ return recordIds;
24
+ });
25
+ }
26
+ metadataLoader(_) {
27
+ return Promise.resolve(attachFetcherMetadataBuilder);
28
+ }
29
+ async dataLoader(_, request) {
30
+ if (!request.source) {
31
+ return Promise.resolve({ records: [] });
32
+ }
33
+ const criteria = {
34
+ criteria: {
35
+ codata: request.source,
36
+ tipoAnexo: "N"
37
+ }
38
+ };
39
+ const applicationDataFetcher = await this._application.getDataFetcher();
40
+ const { anexos: { anexo = [] } } = await applicationDataFetcher.callServiceBroker(SERVICE_LOAD, JSON.stringify(criteria));
41
+ const records = [];
42
+ anexo.forEach((param) => {
43
+ records.push(Object.assign({ __record__id__: StringUtils.generateUUID(), CAMINHO_ARQUIVO: [{
44
+ name: param === null || param === void 0 ? void 0 : param.ARQUIVO,
45
+ }] }, param));
46
+ });
47
+ return Promise.resolve({ records });
48
+ }
49
+ saveLoader(changes, fetcher) {
50
+ return new Promise((resolve) => {
51
+ const change = Array.isArray(changes) ? changes[0] : {};
52
+ fetcher.save(change)
53
+ .then(resolve)
54
+ .catch((error) => {
55
+ if (error.message === SaveErrorsEnum.DESCRIPTION_CANNOT_BE_CHANGED) {
56
+ this._application.alert(this.getMessage('snkAttach.alertValidation.descriptionCannotBeChanged.title'), this.getMessage('snkAttach.alertValidation.descriptionCannotBeChanged.message'));
57
+ return resolve([]);
58
+ }
59
+ if (error.message === SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME) {
60
+ this._application.alert(this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.title'), this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.message'));
61
+ return resolve([]);
62
+ }
63
+ if (error.message === SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED) {
64
+ this._application.alert(this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.title'), this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.message'));
65
+ return resolve([]);
66
+ }
67
+ if (error.message) {
68
+ this._application.error((error.title || error.name), error.message);
69
+ return resolve([]);
70
+ }
71
+ resolve([]);
72
+ });
73
+ });
74
+ }
75
+ removeLoader(dataUnit, ids, fetcher) {
76
+ return new Promise((resolve) => {
77
+ dataUnit.getSelectionInfo().records.forEach(async (record) => {
78
+ this._application.hasAccess(AutorizationType.REMOVE)
79
+ .then(async (hasAccess) => {
80
+ if (hasAccess) {
81
+ await fetcher.delete(record);
82
+ resolve(ids);
83
+ }
84
+ });
85
+ });
86
+ });
87
+ }
88
+ getFilters() {
89
+ throw new Error('Method not implemented.');
90
+ }
91
+ getInterceptions(dataUnit, action, crudRef) {
92
+ return new Promise((resolve) => {
93
+ if (action.type === Action.EDITION_CANCELED) {
94
+ if (!dataUnit.isDirty())
95
+ return resolve(action);
96
+ return this._application.confirm(this.getMessage('snkAttach.cancelConfirmation.title'), this.getMessage('snkAttach.cancelConfirmation.message')).then((cancellationConfirmed) => {
97
+ if (cancellationConfirmed) {
98
+ crudRef.goToView(VIEW_MODE.GRID);
99
+ return resolve(action);
100
+ }
101
+ return resolve(undefined);
102
+ });
103
+ }
104
+ if (action.type === Action.DATA_SAVED) {
105
+ dataUnit.loadData();
106
+ return resolve(action);
107
+ }
108
+ resolve(action);
109
+ });
110
+ }
111
+ }
@@ -1,3 +1,6 @@
1
- export * from './data-unit-builder';
2
- export * from './taskbar-builder';
3
- export * from './crud-config-builder';
1
+ export * from './fetcher/facade/fetcher.facade';
2
+ export * from './fetcher/factory/anexo-sistema-data-unit.factory';
3
+ export * from './fetcher/factory/attach-fetcher-data-unit.factory';
4
+ export * from './builder/taskbar-builder';
5
+ export * from './builder/anexo-sistema-crud-config.builder';
6
+ export * from './builder/attach-crud-config.builder';
@@ -30,6 +30,7 @@ export class SnkCrud {
30
30
  this.presentationMode = PresentationMode.PRIMARY;
31
31
  this.messagesBuilder = undefined;
32
32
  this.useEnterLikeTab = false;
33
+ this.disablePersonalizedFilter = undefined;
33
34
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
34
35
  }
35
36
  /**
@@ -162,7 +163,8 @@ export class SnkCrud {
162
163
  window.removeEventListener("keydown", this._keyDownHandler);
163
164
  }
164
165
  async initKeyboardManager() {
165
- const keyboardManager = await this._application.getKeyboardManager();
166
+ var _a;
167
+ const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
166
168
  if (keyboardManager) {
167
169
  const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
168
170
  async function saveDataUnitHandlingFocus() {
@@ -211,7 +213,8 @@ export class SnkCrud {
211
213
  }
212
214
  }
213
215
  async removeShortcuts() {
214
- const keyboardManager = await this._application.getKeyboardManager();
216
+ var _a;
217
+ const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
215
218
  if (keyboardManager) {
216
219
  keyboardManager
217
220
  .unbind("F6")
@@ -278,7 +281,7 @@ export class SnkCrud {
278
281
  return;
279
282
  }
280
283
  this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
281
- return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
284
+ return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
282
285
  }
283
286
  static get is() { return "snk-crud"; }
284
287
  static get encapsulation() { return "scoped"; }
@@ -514,6 +517,23 @@ export class SnkCrud {
514
517
  "attribute": "use-enter-like-tab",
515
518
  "reflect": false,
516
519
  "defaultValue": "false"
520
+ },
521
+ "disablePersonalizedFilter": {
522
+ "type": "boolean",
523
+ "mutable": false,
524
+ "complexType": {
525
+ "original": "boolean",
526
+ "resolved": "boolean",
527
+ "references": {}
528
+ },
529
+ "required": false,
530
+ "optional": false,
531
+ "docs": {
532
+ "tags": [],
533
+ "text": "Desabilita a apresenta\u00E7\u00E3o da op\u00E7\u00E3o de filtros personalizados na filter bar (chip de filtros) \ne no modal lateral de filtros (container de filtros personalizados)."
534
+ },
535
+ "attribute": "disable-personalized-filter",
536
+ "reflect": false
517
537
  }
518
538
  };
519
539
  }
@@ -25,7 +25,7 @@ snk-form-view {
25
25
  position: relative;
26
26
  padding-left: 0px;
27
27
  padding-top: 0px;
28
-
28
+
29
29
  /*public*/
30
30
  padding-right: var(--snk-guides-viewer--space-large);
31
31
  padding-bottom: var(--snk-guides-viewer--space-large);
@@ -57,6 +57,15 @@ snk-form-view {
57
57
  margin-bottom: var(--snk-guides-viewer--space-medium);
58
58
  }
59
59
 
60
+ .snk-guides-viewer__header-breadcrumb{
61
+ width: 25%;
62
+ display: flex;
63
+ }
64
+
65
+ .snk-guides-viewer__header-taskbar{
66
+ width: 75%;
67
+ }
68
+
60
69
  .snk-guides-viewer__container {
61
70
  /*private*/
62
71
  display: grid;
@@ -88,4 +97,4 @@ snk-form-view {
88
97
  min-height: 100%;
89
98
  align-items: flex-start;
90
99
  align-content: flex-start;
91
- }
100
+ }
@@ -383,7 +383,7 @@ export class SnkGuidesViewer {
383
383
  }
384
384
  buildTaskBar() {
385
385
  var _a;
386
- return h("div", { class: `ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.getActionsList(), messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
386
+ return h("div", { class: `snk-guides-viewer__header-taskbar ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.getActionsList(), messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS", alignRigth: true }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
387
387
  }
388
388
  async dataUnitActionHandler(action) {
389
389
  var _a;
@@ -442,7 +442,7 @@ export class SnkGuidesViewer {
442
442
  }
443
443
  this.loadTaskbarProcessor();
444
444
  const showGuides = this._guides && (this._guides.length > 1);
445
- return (h("section", { class: "snk-guides-viewer" }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.getMessage("snkCrud.title")), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
445
+ return (h("section", { class: "snk-guides-viewer" }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.getMessage("snkCrud.title")), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
446
446
  h("div", { class: "ez-margin-top--extra-small" }, h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != PresentationMode.SECONDARY && this.buildTaskBar()), h("div", { class: "snk-guides-viewer__container" }, showGuides ?
447
447
  h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
448
448
  :
@@ -239,7 +239,7 @@ export class SnkDataExporter {
239
239
  pkObject[`PK_${name}`] = { type: this.parseDataType(type), value };
240
240
  pkObject['pks'] = [];
241
241
  }
242
- const dataFields = { nome: name, tipo: type, valor: value };
242
+ const dataFields = { nome: name, tipo: this.parseDataType(type), valor: value };
243
243
  fields['fields'].push(dataFields);
244
244
  pkObject['pks'].push(fields);
245
245
  });
@@ -56,16 +56,18 @@ export class SnkEntityList {
56
56
  this.loadListSource();
57
57
  }
58
58
  optionLoader(searchArgument) {
59
- var _a, _b, _c, _d;
59
+ var _a, _b, _c, _d, _e, _f;
60
60
  const { mode, argument } = searchArgument;
61
61
  if (this._application === undefined) {
62
62
  return;
63
63
  }
64
64
  const searchOptions = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.searchContext) === null || _c === void 0 ? void 0 : _c.searchOptions;
65
+ const criteria = (_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.props) === null || _e === void 0 ? void 0 : _e.criteria;
65
66
  const options = {
66
- entityDescription: (_d = this.config) === null || _d === void 0 ? void 0 : _d.label,
67
+ entityDescription: (_f = this.config) === null || _f === void 0 ? void 0 : _f.label,
67
68
  entity: this._entityName,
68
- searchOptions: searchOptions
69
+ searchOptions: searchOptions,
70
+ criteria,
69
71
  };
70
72
  return this._application.executePreparedSearch(mode, argument, options);
71
73
  }
@@ -10,7 +10,8 @@ export class SnkFilterMultiSelect {
10
10
  * Emitido quando acontece a alteração de valor do componente snk-filter-multi-select
11
11
  */
12
12
  ezChangeListener(evt) {
13
- this.value = evt.detail.value;
13
+ var _a;
14
+ this.value = (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value;
14
15
  this.valueChanged.emit(this.value);
15
16
  }
16
17
  /**
@@ -254,6 +254,9 @@ export class SnkFilterItem {
254
254
  }
255
255
  canClearFilter() {
256
256
  const { value, groupedItems = [] } = this.config;
257
+ if (value != undefined && this.config.type === FilterItemType.MULTI_LIST) {
258
+ return value.some((item) => item.check);
259
+ }
257
260
  return value !== undefined || groupedItems.some(item => item.visible);
258
261
  }
259
262
  getRightIconName() {
@@ -17,6 +17,7 @@ export class SnkFilterModal {
17
17
  this.editPersonalizedFilter = undefined;
18
18
  this.deletePersonalizedFilter = undefined;
19
19
  this.filtersToDelete = [];
20
+ this.disablePersonalizedFilter = undefined;
20
21
  }
21
22
  /**
22
23
  * Emitido quando um filtro personalizado é deletado.
@@ -233,7 +234,7 @@ export class SnkFilterModal {
233
234
  const customFilters = this.filters.filter(filter => filter.filterType === FilterType.CUSTOM_FILTER);
234
235
  const quickFilters = this.filters.filter(filter => filter.filterType === FilterType.QUICK_FILTER);
235
236
  const otherFilters = this.filters.filter(filter => filter.filterType === FilterType.OTHER_FILTERS);
236
- return (h("ez-modal-container", { class: "snk-filter-modal__container", modalTitle: this._modalTitle, cancelButtonLabel: this._cancelButtonLabel, okButtonLabel: this._okButtonLabel, onEzModalAction: this.modalActionListener.bind(this) }, h("div", { class: "snk-filter-modal__content ez-col--sd-12" }, this.renderCollapsibleFilterBox(this.getCustomMessage('customFilters'), customFilters, false, false), this.renderCollapsibleFilterBox(this.getCustomMessage('quickFilters'), quickFilters, false), otherFilters.map(filter => this.renderCollapsibleFilterBox(filter.label, [filter], true)))));
237
+ return (h("ez-modal-container", { class: "snk-filter-modal__container", modalTitle: this._modalTitle, cancelButtonLabel: this._cancelButtonLabel, okButtonLabel: this._okButtonLabel, onEzModalAction: this.modalActionListener.bind(this) }, h("div", { class: "snk-filter-modal__content ez-col--sd-12" }, !this.disablePersonalizedFilter && this.renderCollapsibleFilterBox(this.getCustomMessage('customFilters'), customFilters, false, false), this.renderCollapsibleFilterBox(this.getCustomMessage('quickFilters'), quickFilters, false), otherFilters.map(filter => this.renderCollapsibleFilterBox(filter.label, [filter], true)))));
237
238
  }
238
239
  static get is() { return "snk-filter-modal"; }
239
240
  static get originalStyleUrls() {
@@ -411,6 +412,23 @@ export class SnkFilterModal {
411
412
  "text": "Guarda filtros a serem deletados no Apply do modal"
412
413
  },
413
414
  "defaultValue": "[]"
415
+ },
416
+ "disablePersonalizedFilter": {
417
+ "type": "boolean",
418
+ "mutable": false,
419
+ "complexType": {
420
+ "original": "boolean",
421
+ "resolved": "boolean",
422
+ "references": {}
423
+ },
424
+ "required": false,
425
+ "optional": false,
426
+ "docs": {
427
+ "tags": [],
428
+ "text": "Desabilita a apresenta\u00E7\u00E3o da op\u00E7\u00E3o de filtros personalizados na filter bar (chip de filtros) \ne no modal lateral de filtros (container de filtros personalizados)."
429
+ },
430
+ "attribute": "disable-personalized-filter",
431
+ "reflect": false
414
432
  }
415
433
  };
416
434
  }
@@ -11,6 +11,7 @@ export class SnkFilterBar {
11
11
  this._updateSequence = [];
12
12
  this._loadingPending = false;
13
13
  this._configUpdated = false;
14
+ this._firstLoad = true;
14
15
  this._pendingVariables = false;
15
16
  this._customfiltersToBeUpdated = [];
16
17
  this._calculateSortIndex = (item) => {
@@ -31,6 +32,7 @@ export class SnkFilterBar {
31
32
  this.resourceID = undefined;
32
33
  this.filterConfig = undefined;
33
34
  this.messagesBuilder = undefined;
35
+ this.disablePersonalizedFilter = undefined;
34
36
  this.allowDefault = undefined;
35
37
  this.scrollerLocked = false;
36
38
  this.showPersonalizedFilter = false;
@@ -164,13 +166,27 @@ export class SnkFilterBar {
164
166
  return;
165
167
  }
166
168
  this._loadingPending = false;
167
- this.dataUnit.loadData(undefined, undefined, true);
169
+ this.doLoadData(this.dataUnit.getLastLoadRequest() != undefined);
168
170
  }
169
171
  if (this._configUpdated) {
170
172
  this._configUpdated = false;
171
173
  ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
172
174
  }
173
175
  }
176
+ async doLoadData(forceReload = false) {
177
+ try {
178
+ if (this._firstLoad && !forceReload) {
179
+ let autoLoad = await this._application.getBooleanParam("global.carregar.registros.iniciar.tela");
180
+ if (!autoLoad) {
181
+ return;
182
+ }
183
+ }
184
+ this.dataUnit.loadData(undefined, undefined, true);
185
+ }
186
+ finally {
187
+ this._firstLoad = false;
188
+ }
189
+ }
174
190
  /**
175
191
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
176
192
  * através de um pequeno modulo na estrutura da aplicação:
@@ -179,6 +195,9 @@ export class SnkFilterBar {
179
195
  */
180
196
  getMessage(key, params, defaultValue) {
181
197
  var _a;
198
+ if (this.messagesBuilder == undefined && this._application) {
199
+ this.messagesBuilder = this._application.messagesBuilder;
200
+ }
182
201
  return ((_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params)) || defaultValue;
183
202
  }
184
203
  getFilter(_dataUnit) {
@@ -205,7 +224,7 @@ export class SnkFilterBar {
205
224
  registryFilterProvider() {
206
225
  this.dataUnit.addFilterProvider(this);
207
226
  if (this.filterConfig) {
208
- this.dataUnit.loadData(undefined, undefined, true);
227
+ this.doLoadData();
209
228
  }
210
229
  }
211
230
  itemFocused(selectedItem) {
@@ -340,6 +359,7 @@ export class SnkFilterBar {
340
359
  filterConfig: filtersConfigCopy,
341
360
  configName: this.configName,
342
361
  onComplete: callbackOnApplyFilter,
362
+ disablePersonalizedFilter: this.disablePersonalizedFilter,
343
363
  getMessage: (key, props) => this.getMessage(key, props),
344
364
  onAddPersonalizedFilter: () => this.addPersonalizedFilter(),
345
365
  onEditPersonalizedFilter: (id) => this.editPersonalizedFilter(id),
@@ -510,6 +530,23 @@ export class SnkFilterBar {
510
530
  "tags": [],
511
531
  "text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
512
532
  }
533
+ },
534
+ "disablePersonalizedFilter": {
535
+ "type": "boolean",
536
+ "mutable": false,
537
+ "complexType": {
538
+ "original": "boolean",
539
+ "resolved": "boolean",
540
+ "references": {}
541
+ },
542
+ "required": false,
543
+ "optional": false,
544
+ "docs": {
545
+ "tags": [],
546
+ "text": "Desabilita a apresenta\u00E7\u00E3o da op\u00E7\u00E3o de filtros personalizados na filter bar (chip de filtros) \ne no modal lateral de filtros (container de filtros personalizados)."
547
+ },
548
+ "attribute": "disable-personalized-filter",
549
+ "reflect": false
513
550
  }
514
551
  };
515
552
  }
@@ -1,10 +1,11 @@
1
1
  import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
2
2
  class SnkFilterModalFactory {
3
- constructor({ filterConfig, configName, onComplete, getMessage, onAddPersonalizedFilter, onEditPersonalizedFilter, onDeletePersonalizedFilter }) {
3
+ constructor({ filterConfig, configName, onComplete, getMessage, disablePersonalizedFilter, onAddPersonalizedFilter, onEditPersonalizedFilter, onDeletePersonalizedFilter }) {
4
4
  this._filterConfig = filterConfig;
5
5
  this._configName = configName;
6
6
  this._onComplete = onComplete;
7
7
  this._getMessage = getMessage;
8
+ this._disablePersonalizedFilter = disablePersonalizedFilter;
8
9
  this._addPersonalizedFilterFn = onAddPersonalizedFilter;
9
10
  this._editPersonalizedFilterFn = onEditPersonalizedFilter;
10
11
  this._onDeletePersonalizedFilter = onDeletePersonalizedFilter;
@@ -18,6 +19,7 @@ class SnkFilterModalFactory {
18
19
  filterModal.className = "ez-size-height--full";
19
20
  filterModal.filters = this._filterConfig;
20
21
  filterModal.configName = this._configName;
22
+ filterModal.disablePersonalizedFilter = this._disablePersonalizedFilter;
21
23
  filterModal.getMessage = this._getMessage.bind(this);
22
24
  filterModal.applyFilters = this.applyFilters.bind(this);
23
25
  filterModal.closeModal = () => this._closeModal();
@@ -52,6 +52,7 @@ export class SnkGrid {
52
52
  this.taskbarCustomContainerId = undefined;
53
53
  this.gridHeaderCustomSlotId = 'GRID_HEADER_CUSTOM_ELEMENTS';
54
54
  this.topTaskbarCustomSlotId = 'GRID_TASKBAR_CUSTOM_ELEMENTS';
55
+ this.disablePersonalizedFilter = undefined;
55
56
  }
56
57
  /**
57
58
  * Exibe a janela de configurações da grade.
@@ -399,7 +400,7 @@ export class SnkGrid {
399
400
  return undefined;
400
401
  }
401
402
  return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
402
- h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail) }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
403
+ h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
403
404
  }
404
405
  static get is() { return "snk-grid"; }
405
406
  static get encapsulation() { return "scoped"; }
@@ -742,6 +743,23 @@ export class SnkGrid {
742
743
  "attribute": "top-taskbar-custom-slot-id",
743
744
  "reflect": false,
744
745
  "defaultValue": "'GRID_TASKBAR_CUSTOM_ELEMENTS'"
746
+ },
747
+ "disablePersonalizedFilter": {
748
+ "type": "boolean",
749
+ "mutable": false,
750
+ "complexType": {
751
+ "original": "boolean",
752
+ "resolved": "boolean",
753
+ "references": {}
754
+ },
755
+ "required": false,
756
+ "optional": false,
757
+ "docs": {
758
+ "tags": [],
759
+ "text": "Desabilita a apresenta\u00E7\u00E3o da op\u00E7\u00E3o de filtros personalizados na filter bar (chip de filtros) \ne no modal lateral de filtros (container de filtros personalizados)."
760
+ },
761
+ "attribute": "disable-personalized-filter",
762
+ "reflect": false
745
763
  }
746
764
  };
747
765
  }
@@ -6,7 +6,7 @@
6
6
  --snk-pesquisa--font-family: var(--font-pattern, Arial);
7
7
  /*@doc Define o peso da fonte do componente.*/
8
8
  --snk-pesquisa--font-weight: var(--text-weight--medium, 400);
9
-
9
+
10
10
  /* records */
11
11
  /*@doc Define a cor da fonte do indicador de registros do componente.*/
12
12
  --snk-pesquisa__records--color: var(--text--primary, #626e82);
@@ -39,7 +39,6 @@
39
39
  /*@doc Define a largura da barra de rolagem do componente.*/
40
40
  --snk-pesquisa__scrollbar--width: var(--space--medium, 12px);
41
41
 
42
- max-height: 100%;
43
42
  height: 100%;
44
43
  display: flex;
45
44
  flex-direction: column;
@@ -70,7 +69,6 @@
70
69
  .snk-pesquisa__content {
71
70
  display: flex;
72
71
  flex-direction: column;
73
- height: 100%;
74
72
  overflow-y: auto;
75
73
  scrollbar-width: thin;
76
74
 
@@ -148,4 +146,4 @@
148
146
  .snk-pesquisa__btn:hover {
149
147
  /*public*/
150
148
  color: var(--snk-pesquisa__btn-hover--color);
151
- }
149
+ }