@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-50122.0 → 0.0.0-bugfix-dev-KB-53946.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 (200) hide show
  1. package/dist/cjs/{ConfigStorage-8d4e9d53.js → ConfigStorage-085c7117.js} +11 -12
  2. package/dist/cjs/{SnkMultiSelectionListDataSource-1438f8f2.js → IExporterProvider-f50b6846.js} +52 -5
  3. package/dist/cjs/RecordIDUtils-3735135c.js +43 -0
  4. package/dist/cjs/{SnkFormConfigManager-33995e92.js → SnkFormConfigManager-8986431f.js} +2 -2
  5. package/dist/cjs/{SnkMessageBuilder-141aa18d.js → SnkMessageBuilder-66aa2557.js} +4 -0
  6. package/dist/cjs/{auth-fetcher-bb8e9ae4.js → auth-fetcher-eddaf17f.js} +1 -1
  7. package/dist/cjs/{DataFetcher-99f0f6ed.js → form-config-fetcher-cdd644a7.js} +251 -0
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/{pesquisa-fetcher-94f6b316.js → pesquisa-fetcher-90b801fb.js} +79 -55
  10. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  11. package/dist/cjs/snk-actions-button_4.cjs.entry.js +9 -9
  12. package/dist/cjs/snk-application.cjs.entry.js +24 -24
  13. package/dist/cjs/snk-attach.cjs.entry.js +73 -52
  14. package/dist/cjs/snk-crud.cjs.entry.js +5 -5
  15. package/dist/cjs/snk-data-exporter.cjs.entry.js +199 -81
  16. package/dist/cjs/{snk-data-unit-6026a9f7.js → snk-data-unit-abd2113f.js} +3 -38
  17. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -2
  18. package/dist/cjs/snk-detail-view.cjs.entry.js +8 -8
  19. package/dist/cjs/snk-filter-bar.cjs.entry.js +23 -7
  20. package/dist/cjs/snk-filter-detail.cjs.entry.js +4 -1
  21. package/dist/cjs/snk-filter-item.cjs.entry.js +10 -6
  22. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +2 -3
  23. package/dist/cjs/snk-form-config.cjs.entry.js +1 -2
  24. package/dist/cjs/snk-form.cjs.entry.js +3 -4
  25. package/dist/cjs/snk-grid.cjs.entry.js +66 -102
  26. package/dist/cjs/{snk-guides-viewer-25721856.js → snk-guides-viewer-e4c8ee66.js} +4 -5
  27. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  28. package/dist/cjs/snk-personalized-filter.cjs.entry.js +2 -3
  29. package/dist/cjs/snk-simple-crud.cjs.entry.js +144 -36
  30. package/dist/cjs/snk-taskbar.cjs.entry.js +3 -2
  31. package/dist/cjs/{taskbar-elements-3ecd1278.js → taskbar-elements-d9392685.js} +2 -2
  32. package/dist/collection/components/snk-attach/snk-attach.js +39 -24
  33. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +1 -1
  34. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +29 -22
  35. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +90 -0
  36. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +68 -0
  37. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +48 -1
  38. package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +1 -0
  39. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +53 -0
  40. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +55 -0
  41. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +37 -47
  42. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +88 -0
  43. package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +38 -0
  44. package/dist/collection/components/snk-data-unit/snk-data-unit.js +3 -42
  45. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +22 -1
  46. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +28 -6
  47. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +2 -1
  48. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +20 -3
  49. package/dist/collection/components/snk-grid/snk-grid.js +3 -94
  50. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +5 -2
  51. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +126 -14
  52. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
  53. package/dist/collection/components/snk-taskbar/snk-taskbar.js +2 -1
  54. package/dist/collection/lib/dataUnit/InMemoryLoader.js +10 -41
  55. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +33 -0
  56. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +3 -0
  57. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +4 -0
  58. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +10 -2
  59. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +1 -0
  60. package/dist/collection/lib/message/resources/snk-simple-crud.msg.js +4 -0
  61. package/dist/components/ConfigStorage.js +1 -2
  62. package/dist/components/{field-search.js → IExporterProvider.js} +52 -7
  63. package/dist/components/ISave.js +42 -0
  64. package/dist/components/SnkMessageBuilder.js +4 -0
  65. package/dist/components/dataunit-fetcher.js +61 -44
  66. package/dist/components/form-config-fetcher.js +7022 -3
  67. package/dist/components/index2.js +198 -33
  68. package/dist/components/snk-actions-button2.js +3 -12
  69. package/dist/components/snk-application2.js +1 -1
  70. package/dist/components/snk-attach2.js +64 -44
  71. package/dist/components/snk-crud.js +3 -4
  72. package/dist/components/snk-data-exporter2.js +194 -81
  73. package/dist/components/snk-data-unit2.js +41 -39
  74. package/dist/components/snk-detail-view2.js +4 -5
  75. package/dist/components/snk-expression-item2.js +1 -1
  76. package/dist/components/snk-filter-bar2.js +21 -4
  77. package/dist/components/snk-filter-detail2.js +5 -1
  78. package/dist/components/snk-filter-item2.js +11 -6
  79. package/dist/components/snk-form-config2.js +1 -1
  80. package/dist/components/snk-grid2.js +63 -100
  81. package/dist/components/snk-personalized-filter2.js +1 -1
  82. package/dist/components/snk-simple-crud2.js +133 -23
  83. package/dist/components/snk-taskbar2.js +6 -5
  84. package/dist/esm/{ConfigStorage-6e241cd7.js → ConfigStorage-cc3f3dd3.js} +1 -2
  85. package/dist/esm/{SnkMultiSelectionListDataSource-aad5d4ff.js → IExporterProvider-9e6e0071.js} +52 -6
  86. package/dist/esm/RecordIDUtils-87d02110.js +41 -0
  87. package/dist/esm/{SnkFormConfigManager-7a4e678f.js → SnkFormConfigManager-7edda7eb.js} +2 -2
  88. package/dist/esm/{SnkMessageBuilder-9747ddd2.js → SnkMessageBuilder-0a4becdd.js} +4 -0
  89. package/dist/esm/{auth-fetcher-8ec448b0.js → auth-fetcher-11dd9cae.js} +1 -1
  90. package/dist/esm/{DataFetcher-a650ae58.js → form-config-fetcher-13cd3285.js} +250 -1
  91. package/dist/esm/loader.js +1 -1
  92. package/dist/esm/{pesquisa-fetcher-f05a12ca.js → pesquisa-fetcher-d785663b.js} +61 -44
  93. package/dist/esm/sankhyablocks.js +1 -1
  94. package/dist/esm/snk-actions-button_4.entry.js +4 -4
  95. package/dist/esm/snk-application.entry.js +6 -6
  96. package/dist/esm/snk-attach.entry.js +65 -44
  97. package/dist/esm/snk-crud.entry.js +5 -5
  98. package/dist/esm/snk-data-exporter.entry.js +199 -81
  99. package/dist/esm/{snk-data-unit-4c343635.js → snk-data-unit-29eba11a.js} +4 -39
  100. package/dist/esm/snk-data-unit.entry.js +3 -2
  101. package/dist/esm/snk-detail-view.entry.js +8 -8
  102. package/dist/esm/snk-filter-bar.entry.js +23 -7
  103. package/dist/esm/snk-filter-detail.entry.js +4 -1
  104. package/dist/esm/snk-filter-item.entry.js +10 -6
  105. package/dist/esm/snk-filter-modal-item.entry.js +2 -3
  106. package/dist/esm/snk-form-config.entry.js +1 -2
  107. package/dist/esm/snk-form.entry.js +3 -4
  108. package/dist/esm/snk-grid.entry.js +64 -100
  109. package/dist/esm/{snk-guides-viewer-b94752f2.js → snk-guides-viewer-8fc16590.js} +4 -5
  110. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  111. package/dist/esm/snk-personalized-filter.entry.js +2 -3
  112. package/dist/esm/snk-simple-crud.entry.js +132 -24
  113. package/dist/esm/snk-taskbar.entry.js +3 -2
  114. package/dist/esm/{taskbar-elements-2473c8ac.js → taskbar-elements-ad766858.js} +2 -2
  115. package/dist/sankhyablocks/p-07825198.js +1 -0
  116. package/dist/sankhyablocks/p-0ba97458.js +65 -0
  117. package/dist/sankhyablocks/p-1650f66b.entry.js +1 -0
  118. package/dist/sankhyablocks/p-1d1aa052.js +1 -0
  119. package/dist/sankhyablocks/p-1d9d07b4.entry.js +1 -0
  120. package/dist/sankhyablocks/p-250149af.entry.js +1 -0
  121. package/dist/sankhyablocks/p-2cfa05b0.entry.js +1 -0
  122. package/dist/sankhyablocks/{p-400097f2.entry.js → p-2daa70f9.entry.js} +3 -3
  123. package/dist/sankhyablocks/p-32556aa6.js +1 -0
  124. package/dist/sankhyablocks/p-33a6728e.js +26 -0
  125. package/dist/sankhyablocks/p-54a5d52a.entry.js +1 -0
  126. package/dist/sankhyablocks/p-5b6c4f46.entry.js +1 -0
  127. package/dist/sankhyablocks/p-5d9456dc.js +1 -0
  128. package/dist/sankhyablocks/{p-0624f62d.js → p-8a4c4b54.js} +6 -6
  129. package/dist/sankhyablocks/p-9863d682.js +1 -0
  130. package/dist/sankhyablocks/{p-125bb902.js → p-99b51d06.js} +1 -1
  131. package/dist/sankhyablocks/p-9c283890.entry.js +1 -0
  132. package/dist/sankhyablocks/p-9ee96756.entry.js +1 -0
  133. package/dist/sankhyablocks/p-a4c94582.entry.js +1 -0
  134. package/dist/sankhyablocks/p-c2e3a71c.entry.js +1 -0
  135. package/dist/sankhyablocks/p-c2f3ebf3.entry.js +1 -0
  136. package/dist/sankhyablocks/p-ce37e3d3.entry.js +1 -0
  137. package/dist/sankhyablocks/p-cfb98f51.entry.js +1 -0
  138. package/dist/sankhyablocks/{p-efeca7ba.js → p-d24c9dc6.js} +1 -1
  139. package/dist/sankhyablocks/p-e8763234.entry.js +1 -0
  140. package/dist/sankhyablocks/p-edd9dd1c.entry.js +1 -0
  141. package/dist/sankhyablocks/p-f51af6dd.entry.js +1 -0
  142. package/dist/sankhyablocks/p-fa84e72f.entry.js +1 -0
  143. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  144. package/dist/types/components/snk-attach/snk-attach.d.ts +2 -1
  145. package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +10 -1
  146. package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +5 -4
  147. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +13 -0
  148. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +11 -0
  149. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +21 -4
  150. package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +5 -0
  151. package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +17 -0
  152. package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +17 -0
  153. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +3 -1
  154. package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +77 -0
  155. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +3 -0
  156. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +4 -0
  157. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +6 -2
  158. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +3 -0
  159. package/dist/types/components/snk-grid/snk-grid.d.ts +0 -3
  160. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +17 -2
  161. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
  162. package/dist/types/components.d.ts +33 -0
  163. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +0 -2
  164. package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +4 -0
  165. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +2 -1
  166. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +1 -0
  167. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +1 -0
  168. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +1 -0
  169. package/package.json +1 -1
  170. package/dist/cjs/form-config-fetcher-d73f4449.js +0 -256
  171. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +0 -34
  172. package/dist/components/DataFetcher.js +0 -7023
  173. package/dist/components/index3.js +0 -199
  174. package/dist/esm/form-config-fetcher-765b8498.js +0 -253
  175. package/dist/sankhyablocks/p-004c356e.js +0 -26
  176. package/dist/sankhyablocks/p-0bba5c9f.entry.js +0 -1
  177. package/dist/sankhyablocks/p-1048bd26.entry.js +0 -1
  178. package/dist/sankhyablocks/p-20b46647.entry.js +0 -1
  179. package/dist/sankhyablocks/p-24ed6ad6.entry.js +0 -1
  180. package/dist/sankhyablocks/p-2936303b.js +0 -1
  181. package/dist/sankhyablocks/p-2d919e32.entry.js +0 -1
  182. package/dist/sankhyablocks/p-6c9adfca.js +0 -1
  183. package/dist/sankhyablocks/p-85ba3d6b.entry.js +0 -1
  184. package/dist/sankhyablocks/p-86801b08.entry.js +0 -1
  185. package/dist/sankhyablocks/p-88b29791.js +0 -1
  186. package/dist/sankhyablocks/p-9a5d1b39.js +0 -1
  187. package/dist/sankhyablocks/p-9e8618ec.entry.js +0 -1
  188. package/dist/sankhyablocks/p-a043314f.entry.js +0 -1
  189. package/dist/sankhyablocks/p-a1642e7c.entry.js +0 -1
  190. package/dist/sankhyablocks/p-ac77949b.entry.js +0 -1
  191. package/dist/sankhyablocks/p-b10b9934.entry.js +0 -1
  192. package/dist/sankhyablocks/p-b47c2963.entry.js +0 -1
  193. package/dist/sankhyablocks/p-be75153c.js +0 -1
  194. package/dist/sankhyablocks/p-bf39bdb8.entry.js +0 -1
  195. package/dist/sankhyablocks/p-d5cb4b5a.entry.js +0 -1
  196. package/dist/sankhyablocks/p-d6317851.entry.js +0 -1
  197. package/dist/sankhyablocks/p-d78d4062.js +0 -65
  198. package/dist/sankhyablocks/p-e7dbe53a.entry.js +0 -1
  199. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +0 -3
  200. /package/dist/sankhyablocks/{p-ae4fc9a9.js → p-61dd89eb.js} +0 -0
@@ -1,7 +1,8 @@
1
1
  import { Host, h } from '@stencil/core';
2
- import { Action, ApplicationContext, DataUnitAction, ObjectUtils, DataType, JSUtils } from '@sankhyalabs/core';
2
+ import { Action, ApplicationContext, DataUnitAction, ObjectUtils } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { OperationMap, SnkMessageBuilder } from '../../lib/message/SnkMessageBuilder';
5
+ import { getSelectedIDs } from '../snk-data-exporter/utils/RecordIDUtils';
5
6
  export class SnkDataUnit {
6
7
  constructor() {
7
8
  this._onDataUnitResolve = [];
@@ -117,43 +118,7 @@ export class SnkDataUnit {
117
118
  * @returns Retorna a lista de IDs dos registros selecionados.
118
119
  */
119
120
  async getSelectedRecordsIDsInfo() {
120
- var _a;
121
- const selectionInfo = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectionInfo();
122
- if (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isAllRecords()) {
123
- return [];
124
- }
125
- const selectedRecordsIDsInfo = [];
126
- const selectedRecords = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.records;
127
- if ((selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) > 0) {
128
- selectedRecords.forEach(({ __record__id__ }) => {
129
- if (!this.dataUnit.isNewRecord(__record__id__)) {
130
- /*
131
- Esse if foi necessário para tratar corretamente o ID
132
- do record quando está sendo utilizado no modo standAlone
133
- isso não faz a exportação da grid funcionar no modo standAlone
134
- mas deixa de causar erro nas oprações de CRUD.
135
- */
136
- if (!JSUtils.isBase64(__record__id__)) {
137
- selectedRecordsIDsInfo.push({
138
- name: "__record__id__",
139
- type: DataType.TEXT,
140
- value: __record__id__
141
- });
142
- return;
143
- }
144
- const revertBase64ToObject = JSON.parse(window.atob(__record__id__));
145
- Object.entries(revertBase64ToObject).forEach(([name, value]) => {
146
- var _a;
147
- const metadataField = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(name);
148
- if (metadataField == undefined) {
149
- return;
150
- }
151
- selectedRecordsIDsInfo.push(Object.assign({ name, type: metadataField.dataType }, value));
152
- });
153
- }
154
- });
155
- }
156
- return selectedRecordsIDsInfo;
121
+ return Promise.resolve(getSelectedIDs(this.dataUnit));
157
122
  }
158
123
  getCleanOnCopyFields() {
159
124
  var _a;
@@ -774,10 +739,6 @@ export class SnkDataUnit {
774
739
  },
775
740
  "Array": {
776
741
  "location": "global"
777
- },
778
- "Record": {
779
- "location": "import",
780
- "path": "@sankhyalabs/core"
781
742
  }
782
743
  },
783
744
  "return": "Promise<IRecordID[]>"
@@ -8,6 +8,7 @@ export class SnkFilterDetail {
8
8
  constructor() {
9
9
  this.config = undefined;
10
10
  this.getMessage = undefined;
11
+ this.showHardFixed = true;
11
12
  }
12
13
  /**
13
14
  * Exibe o componente snk-filter-detail.
@@ -85,7 +86,9 @@ export class SnkFilterDetail {
85
86
  return Object.assign(Object.assign({}, item), { visible: false, fixed: false, value: undefined });
86
87
  }
87
88
  getPopUpHeaderButtons() {
88
- return (h(Fragment, null, !this.config.removalBlocked && this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), !this.config.hardFixed && this.buildIcon(this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), this.config.fixed ? "un-pin" : "push-pin", () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })))));
89
+ return (h(Fragment, null, !this.config.removalBlocked &&
90
+ this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), this.showHardFixed && !this.config.hardFixed &&
91
+ this.buildIcon(this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), this.config.fixed ? "un-pin" : "push-pin", () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })))));
89
92
  }
90
93
  buildIcon(title, iconName, action) {
91
94
  return (h("button", { onClick: () => action(), class: "sc-snk-filter-bar snk-filter-item__editor-header-button", ref: elem => elem && this.buildIdButton(elem, title) }, h("ez-icon", Object.assign({ title: title, iconName: iconName }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`_${title}`)}` }))));
@@ -196,6 +199,24 @@ export class SnkFilterDetail {
196
199
  "tags": [],
197
200
  "text": "Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder."
198
201
  }
202
+ },
203
+ "showHardFixed": {
204
+ "type": "boolean",
205
+ "mutable": false,
206
+ "complexType": {
207
+ "original": "boolean",
208
+ "resolved": "boolean",
209
+ "references": {}
210
+ },
211
+ "required": false,
212
+ "optional": false,
213
+ "docs": {
214
+ "tags": [],
215
+ "text": "Controla a visibilidade do bot\u00E3o de fixar elemento"
216
+ },
217
+ "attribute": "show-hard-fixed",
218
+ "reflect": false,
219
+ "defaultValue": "true"
199
220
  }
200
221
  };
201
222
  }
@@ -14,6 +14,7 @@ export class SnkFilterItem {
14
14
  this.detailIsVisible = undefined;
15
15
  this.config = undefined;
16
16
  this.getMessage = undefined;
17
+ this.showChips = true;
17
18
  }
18
19
  observeDetailIsVisible(value) {
19
20
  this.visibleChanged.emit(value);
@@ -45,19 +46,22 @@ export class SnkFilterItem {
45
46
  autoClose: true,
46
47
  innerClickTest: this.innerClickCheck,
47
48
  backClickListener: () => this.onDetailCloseCallback(),
48
- left: this.getScrollOffsetLeft(),
49
- top: this.getScrollOffsetTop(),
49
+ left: this.getOffsetLeft(),
50
+ top: this.getOffsetTop(),
50
51
  useOverlay: true,
51
52
  overlayClassName: 'ez-scrim ez-scrim--light',
52
53
  isFixed: true
53
54
  };
54
55
  }
55
- getScrollOffsetLeft() {
56
+ getOffsetLeft() {
56
57
  const padding = getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");
57
58
  const rect = this._filterItemElement.getBoundingClientRect();
58
- return `calc(${rect.x}px + ${padding})`;
59
+ // Width baseado no conteudo do snk-filter-detail. Nesse momento ele retorna 0px pois ainda não foi criado em tela.
60
+ const filterDetailWidth = 430;
61
+ const adjustRightPosition = filterDetailWidth - (document.body.clientWidth - rect.left);
62
+ return `calc(${rect.x}px + ${padding} - ${adjustRightPosition > 0 ? adjustRightPosition : 0}px)`;
59
63
  }
60
- getScrollOffsetTop() {
64
+ getOffsetTop() {
61
65
  const rect = this._filterItemElement.getBoundingClientRect();
62
66
  return (rect.y + rect.height) + "px";
63
67
  }
@@ -289,7 +293,7 @@ export class SnkFilterItem {
289
293
  }
290
294
  render() {
291
295
  const leftIcon = this.getLeftIconName();
292
- return (h(Host, null, h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail }))));
296
+ return (h(Host, null, this.showChips && (h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon && (h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" })), h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" }))), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail, showHardFixed: this.showChips }))));
293
297
  }
294
298
  static get is() { return "snk-filter-item"; }
295
299
  static get properties() {
@@ -327,6 +331,24 @@ export class SnkFilterItem {
327
331
  "tags": [],
328
332
  "text": "Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder."
329
333
  }
334
+ },
335
+ "showChips": {
336
+ "type": "boolean",
337
+ "mutable": false,
338
+ "complexType": {
339
+ "original": "boolean",
340
+ "resolved": "boolean",
341
+ "references": {}
342
+ },
343
+ "required": false,
344
+ "optional": false,
345
+ "docs": {
346
+ "tags": [],
347
+ "text": "Usado para controlar a visibilidade dos chips de filtros"
348
+ },
349
+ "attribute": "show-chips",
350
+ "reflect": false,
351
+ "defaultValue": "true"
330
352
  }
331
353
  };
332
354
  }
@@ -22,7 +22,8 @@
22
22
  }
23
23
 
24
24
  :host([data-mode="hidden"]) {
25
- display: none;
25
+ width: 0px;
26
+ height: 0px;
26
27
  }
27
28
 
28
29
  :host([data-mode="button"]) {
@@ -42,6 +42,11 @@ export class SnkFilterBar {
42
42
  this.personalizedFilterId = undefined;
43
43
  }
44
44
  observeFilterConfig(newValue, oldValue) {
45
+ if (ObjectUtils.equals(newValue, oldValue))
46
+ return;
47
+ this.handleFilterConfigsChanged(oldValue, newValue);
48
+ }
49
+ handleFilterConfigsChanged(oldValue, newValue) {
45
50
  if (oldValue != undefined && newValue == undefined) {
46
51
  this._loadingPending = true;
47
52
  this._configUpdated = true;
@@ -245,6 +250,17 @@ export class SnkFilterBar {
245
250
  filterActiveFilter(item) {
246
251
  return item.visible || item.removalBlocked;
247
252
  }
253
+ filterPersonalizedItems(item) {
254
+ return item.type === FilterItemType.PERSONALIZED;
255
+ }
256
+ getPersonalizedFilterVariableItems() {
257
+ return this.filterConfig
258
+ .filter(this.filterPersonalizedItems)
259
+ .map(item => {
260
+ const itemId = `filter-${item.id}`;
261
+ return (h("snk-filter-item", { key: item.id, id: itemId, config: Object.assign({}, item), onFocusin: () => this.itemFocused(itemId), onVisibleChanged: (evt) => this.scrollerLocked = evt.detail, onFilterChange: (event) => this.updateFilter(event.detail), getMessage: (key, props) => this.getMessage(key, props), showChips: false }));
262
+ });
263
+ }
248
264
  getFilterItems() {
249
265
  const pinnedItems = [];
250
266
  const unpinnedItems = [];
@@ -430,9 +446,10 @@ export class SnkFilterBar {
430
446
  if (this.showPersonalizedFilter) {
431
447
  return h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.handleHidePersonalizedFilter(false), onEzAfterSave: () => this.handleHidePersonalizedFilter(true), entityUri: this.dataUnit.name, configName: this.configName, resourceID: this.resourceID });
432
448
  }
433
- if (this.mode === "button")
434
- return (h(Host, { "data-mode": this.mode }, h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) })));
435
- return (h(Host, { "data-mode": this.mode }, h("div", null, h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
449
+ if (this.mode !== "regular") {
450
+ return (h(Host, { "data-mode": this.mode }, this.getPersonalizedFilterVariableItems(), this.mode === 'button' && (h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }))));
451
+ }
452
+ return (h(Host, null, h("div", null, h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
436
453
  }
437
454
  static get is() { return "snk-filter-bar"; }
438
455
  static get encapsulation() { return "scoped"; }
@@ -1,6 +1,5 @@
1
1
  import { h, Fragment } from '@stencil/core';
2
- import { ApplicationContext, DataType, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
3
- import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
2
+ import { ApplicationContext, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
4
3
  import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
5
4
  import { ConfigStorage } from '../../lib/configs/ConfigStorage';
6
5
  import { PresentationMode } from '../../lib/@types';
@@ -10,6 +9,7 @@ import SnkMultiSelectionListDataSource from './filtercolumn/SnkMultiSelectionLis
10
9
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
11
10
  import { buildFieldSearch, openFieldSearch } from '../snk-taskbar/subcomponents/field-search';
12
11
  import { CrudUtils } from '../../lib';
12
+ import ServerSideExporterProvider from '../snk-data-exporter/providers/ServerSideExporterProvider';
13
13
  export class SnkGrid {
14
14
  constructor() {
15
15
  this._topTaskbarProcessor = new TaskbarProcessor({
@@ -155,99 +155,8 @@ export class SnkGrid {
155
155
  });
156
156
  evt.stopPropagation();
157
157
  }
158
- buildColumnsMetadata(gridColumns) {
159
- const columnsMetadata = [];
160
- gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach((column) => {
161
- var _a, _b;
162
- /**
163
- * TODO: Analisar e criar uma melhor forma de tratar essa validação do "RECDESP".
164
- */
165
- if (column.hidden && column.name !== "RECDESP") {
166
- return;
167
- }
168
- const fieldData = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
169
- const columnData = {
170
- label: column.label,
171
- id: column.name,
172
- width: column.width,
173
- type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
174
- userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface
175
- };
176
- columnsMetadata.push(columnData);
177
- if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
178
- const mergedFrom = fieldData.properties.mergedFrom;
179
- const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
180
- const descriptionColumn = {
181
- label: fieldData.properties.DESCRIPTIONENTITY,
182
- id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
183
- width: 200,
184
- type: DataType.TEXT,
185
- userInterface: UserInterface.LONGTEXT
186
- };
187
- columnsMetadata.push(descriptionColumn);
188
- }
189
- });
190
- return columnsMetadata || [];
191
- }
192
- getPaginationInfo() {
193
- var _a;
194
- return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo();
195
- }
196
- getExporterOffset(paginationInfo) {
197
- if (paginationInfo == undefined) {
198
- return;
199
- }
200
- const offset = paginationInfo.firstRecord;
201
- if (offset > 0) {
202
- return (offset - 1);
203
- }
204
- return offset;
205
- }
206
158
  async dataExporterProviderStore() {
207
- var _a;
208
- const selectedIDs = await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecordsIDsInfo());
209
- const dataExporterProvider = {
210
- getFilters: () => {
211
- var _a;
212
- return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getAppliedFilters();
213
- },
214
- getColumnsMetadata: async () => {
215
- var _a;
216
- const columnsState = await ((_a = this._grid) === null || _a === void 0 ? void 0 : _a.getColumnsState());
217
- return this.buildColumnsMetadata(columnsState);
218
- },
219
- getOrders: () => {
220
- var _a;
221
- return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSort();
222
- },
223
- getResourceURI: () => {
224
- var _a;
225
- return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.name;
226
- },
227
- getSelectedNumber: () => {
228
- var _a, _b;
229
- return (_b = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectionInfo) === null || _b === void 0 ? void 0 : _b.length;
230
- },
231
- getTotalRecords: () => {
232
- var _a, _b, _c;
233
- const { total } = ((_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
234
- return total !== null && total !== void 0 ? total : (_c = (_b = this._dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
235
- },
236
- getSelectedIDs: () => {
237
- return selectedIDs || [];
238
- },
239
- getOffset: () => {
240
- return this.getExporterOffset(this.getPaginationInfo());
241
- },
242
- getLimit: () => {
243
- var _a;
244
- return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.pageSize;
245
- },
246
- getRecordID: () => {
247
- var _a, _b, _c;
248
- return (_c = (_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
249
- }
250
- };
159
+ const dataExporterProvider = new ServerSideExporterProvider(this._dataUnit, this._grid);
251
160
  store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
252
161
  }
253
162
  addElementID() {
@@ -2,11 +2,14 @@
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
5
+
6
+ /*@doc Define a altura minima da grid.*/
7
+ --snk-simple-crud-grid--min-height: 300px;
5
8
  }
6
9
 
7
10
  .simple-crud__container {
8
11
  display: grid;
9
- grid-template-rows: max-content;
12
+ grid-template-rows: auto 1fr;
10
13
  row-gap: 12px;
11
14
  height: 100%;
12
15
  width: 100%;
@@ -23,7 +26,7 @@
23
26
 
24
27
  ez-grid {
25
28
  --ez-grid__container--shadow: none;
26
- min-height: 300px;
29
+ --ez-grid--min-height: var(--snk-simple-crud-grid--min-height);
27
30
  }
28
31
 
29
32
  ez-form {