@sankhyalabs/sankhyablocks 8.15.0-dev.53 → 8.15.0-dev.54

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 (166) hide show
  1. package/dist/cjs/{ConfigStorage-8d4e9d53.js → ConfigStorage-085c7117.js} +11 -12
  2. package/dist/cjs/{SnkMultiSelectionListDataSource-d15f7aac.js → IExporterProvider-955812ad.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/{auth-fetcher-bb8e9ae4.js → auth-fetcher-eddaf17f.js} +1 -1
  6. package/dist/cjs/{DataFetcher-99f0f6ed.js → form-config-fetcher-cdd644a7.js} +251 -0
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/{pesquisa-fetcher-bdbbe9ac.js → pesquisa-fetcher-6e934fb5.js} +30 -16
  9. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  10. package/dist/cjs/snk-actions-button_4.cjs.entry.js +8 -9
  11. package/dist/cjs/snk-application.cjs.entry.js +22 -23
  12. package/dist/cjs/snk-attach.cjs.entry.js +12 -13
  13. package/dist/cjs/snk-crud.cjs.entry.js +4 -5
  14. package/dist/cjs/snk-data-exporter.cjs.entry.js +195 -78
  15. package/dist/cjs/{snk-data-unit-41c29713.js → snk-data-unit-abd2113f.js} +2 -37
  16. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -1
  17. package/dist/cjs/snk-detail-view.cjs.entry.js +6 -7
  18. package/dist/cjs/snk-filter-bar.cjs.entry.js +2 -3
  19. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +2 -3
  20. package/dist/cjs/snk-form-config.cjs.entry.js +1 -2
  21. package/dist/cjs/snk-form.cjs.entry.js +3 -4
  22. package/dist/cjs/snk-grid.cjs.entry.js +65 -102
  23. package/dist/cjs/{snk-guides-viewer-a8dd24a3.js → snk-guides-viewer-4e8b517b.js} +4 -5
  24. package/dist/cjs/snk-guides-viewer.cjs.entry.js +6 -7
  25. package/dist/cjs/snk-personalized-filter.cjs.entry.js +2 -3
  26. package/dist/cjs/snk-simple-crud.cjs.entry.js +115 -32
  27. package/dist/cjs/snk-taskbar.cjs.entry.js +3 -2
  28. package/dist/cjs/{taskbar-elements-3ecd1278.js → taskbar-elements-d9392685.js} +2 -2
  29. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +90 -0
  30. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +68 -0
  31. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +48 -1
  32. package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +1 -0
  33. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +53 -0
  34. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +55 -0
  35. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +35 -45
  36. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +88 -0
  37. package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +38 -0
  38. package/dist/collection/components/snk-data-unit/snk-data-unit.js +3 -42
  39. package/dist/collection/components/snk-grid/snk-grid.js +3 -94
  40. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +81 -9
  41. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
  42. package/dist/collection/components/snk-taskbar/snk-taskbar.js +2 -1
  43. package/dist/collection/lib/dataUnit/InMemoryLoader.js +1 -1
  44. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +3 -0
  45. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +4 -0
  46. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +8 -1
  47. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +1 -0
  48. package/dist/components/ConfigStorage.js +1 -2
  49. package/dist/components/{field-search.js → IExporterProvider.js} +52 -7
  50. package/dist/components/ISave.js +42 -0
  51. package/dist/components/dataunit-fetcher.js +18 -4
  52. package/dist/components/form-config-fetcher.js +7022 -3
  53. package/dist/components/index2.js +198 -33
  54. package/dist/components/snk-actions-button2.js +3 -12
  55. package/dist/components/snk-application2.js +1 -1
  56. package/dist/components/snk-attach2.js +3 -4
  57. package/dist/components/snk-crud.js +3 -4
  58. package/dist/components/snk-data-exporter2.js +192 -79
  59. package/dist/components/snk-data-unit2.js +41 -39
  60. package/dist/components/snk-detail-view2.js +4 -5
  61. package/dist/components/snk-expression-item2.js +1 -1
  62. package/dist/components/snk-form-config2.js +1 -1
  63. package/dist/components/snk-grid2.js +63 -100
  64. package/dist/components/snk-personalized-filter2.js +1 -1
  65. package/dist/components/snk-simple-crud2.js +101 -16
  66. package/dist/components/snk-taskbar2.js +6 -5
  67. package/dist/esm/{ConfigStorage-6e241cd7.js → ConfigStorage-cc3f3dd3.js} +1 -2
  68. package/dist/esm/{SnkMultiSelectionListDataSource-7084f3b3.js → IExporterProvider-6ebf47ab.js} +52 -6
  69. package/dist/esm/RecordIDUtils-87d02110.js +41 -0
  70. package/dist/esm/{SnkFormConfigManager-7a4e678f.js → SnkFormConfigManager-7edda7eb.js} +2 -2
  71. package/dist/esm/{auth-fetcher-8ec448b0.js → auth-fetcher-11dd9cae.js} +1 -1
  72. package/dist/esm/{DataFetcher-a650ae58.js → form-config-fetcher-13cd3285.js} +250 -1
  73. package/dist/esm/loader.js +1 -1
  74. package/dist/esm/{pesquisa-fetcher-96d2f351.js → pesquisa-fetcher-4eed47c6.js} +18 -4
  75. package/dist/esm/sankhyablocks.js +1 -1
  76. package/dist/esm/snk-actions-button_4.entry.js +3 -4
  77. package/dist/esm/snk-application.entry.js +4 -5
  78. package/dist/esm/snk-attach.entry.js +4 -5
  79. package/dist/esm/snk-crud.entry.js +4 -5
  80. package/dist/esm/snk-data-exporter.entry.js +195 -78
  81. package/dist/esm/{snk-data-unit-de1d140d.js → snk-data-unit-29eba11a.js} +3 -38
  82. package/dist/esm/snk-data-unit.entry.js +2 -1
  83. package/dist/esm/snk-detail-view.entry.js +6 -7
  84. package/dist/esm/snk-filter-bar.entry.js +2 -3
  85. package/dist/esm/snk-filter-modal-item.entry.js +2 -3
  86. package/dist/esm/snk-form-config.entry.js +1 -2
  87. package/dist/esm/snk-form.entry.js +3 -4
  88. package/dist/esm/snk-grid.entry.js +63 -100
  89. package/dist/esm/{snk-guides-viewer-131e9660.js → snk-guides-viewer-2742a9db.js} +4 -5
  90. package/dist/esm/snk-guides-viewer.entry.js +6 -7
  91. package/dist/esm/snk-personalized-filter.entry.js +2 -3
  92. package/dist/esm/snk-simple-crud.entry.js +102 -19
  93. package/dist/esm/snk-taskbar.entry.js +3 -2
  94. package/dist/esm/{taskbar-elements-2473c8ac.js → taskbar-elements-ad766858.js} +2 -2
  95. package/dist/sankhyablocks/p-07825198.js +1 -0
  96. package/dist/sankhyablocks/p-1d9d07b4.entry.js +1 -0
  97. package/dist/sankhyablocks/p-201e5588.entry.js +1 -0
  98. package/dist/sankhyablocks/p-33a6728e.js +26 -0
  99. package/dist/sankhyablocks/p-37afb96a.js +1 -0
  100. package/dist/sankhyablocks/p-411fe937.entry.js +1 -0
  101. package/dist/sankhyablocks/p-44d52fc6.js +1 -0
  102. package/dist/sankhyablocks/p-4ddf7add.entry.js +1 -0
  103. package/dist/sankhyablocks/p-7b797d8f.entry.js +1 -0
  104. package/dist/sankhyablocks/p-87cb937d.js +65 -0
  105. package/dist/sankhyablocks/{p-0624f62d.js → p-8a4c4b54.js} +6 -6
  106. package/dist/sankhyablocks/p-9863d682.js +1 -0
  107. package/dist/sankhyablocks/{p-125bb902.js → p-99b51d06.js} +1 -1
  108. package/dist/sankhyablocks/p-9ee96756.entry.js +1 -0
  109. package/dist/sankhyablocks/p-a4c94582.entry.js +1 -0
  110. package/dist/sankhyablocks/p-bf209f48.entry.js +1 -0
  111. package/dist/sankhyablocks/p-c2f3ebf3.entry.js +1 -0
  112. package/dist/sankhyablocks/p-c3c0ad0b.entry.js +1 -0
  113. package/dist/sankhyablocks/{p-619c5f6f.entry.js → p-c801a38a.entry.js} +2 -2
  114. package/dist/sankhyablocks/p-cfb98f51.entry.js +1 -0
  115. package/dist/sankhyablocks/{p-efeca7ba.js → p-d24c9dc6.js} +1 -1
  116. package/dist/sankhyablocks/p-e4225e8b.entry.js +1 -0
  117. package/dist/sankhyablocks/p-edd9dd1c.entry.js +1 -0
  118. package/dist/sankhyablocks/p-fa84e72f.entry.js +1 -0
  119. package/dist/sankhyablocks/p-fd44c905.entry.js +1 -0
  120. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  121. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +13 -0
  122. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +11 -0
  123. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +21 -4
  124. package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +5 -0
  125. package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +17 -0
  126. package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +17 -0
  127. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +3 -1
  128. package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +77 -0
  129. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +3 -0
  130. package/dist/types/components/snk-grid/snk-grid.d.ts +0 -3
  131. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +14 -2
  132. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
  133. package/dist/types/components.d.ts +16 -0
  134. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +2 -1
  135. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +1 -0
  136. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +1 -0
  137. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +1 -0
  138. package/package.json +1 -1
  139. package/dist/cjs/form-config-fetcher-d73f4449.js +0 -256
  140. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +0 -34
  141. package/dist/components/DataFetcher.js +0 -7023
  142. package/dist/components/index3.js +0 -199
  143. package/dist/esm/form-config-fetcher-765b8498.js +0 -253
  144. package/dist/sankhyablocks/p-004c356e.js +0 -26
  145. package/dist/sankhyablocks/p-075bba4c.entry.js +0 -1
  146. package/dist/sankhyablocks/p-07a61550.entry.js +0 -1
  147. package/dist/sankhyablocks/p-103c5956.entry.js +0 -1
  148. package/dist/sankhyablocks/p-1048bd26.entry.js +0 -1
  149. package/dist/sankhyablocks/p-13ae1a89.entry.js +0 -1
  150. package/dist/sankhyablocks/p-24ed6ad6.entry.js +0 -1
  151. package/dist/sankhyablocks/p-34a7f2ab.js +0 -65
  152. package/dist/sankhyablocks/p-52c8e589.js +0 -1
  153. package/dist/sankhyablocks/p-5833cff9.js +0 -1
  154. package/dist/sankhyablocks/p-5a2e016a.entry.js +0 -1
  155. package/dist/sankhyablocks/p-6f560924.entry.js +0 -1
  156. package/dist/sankhyablocks/p-8967fa78.js +0 -1
  157. package/dist/sankhyablocks/p-9b1beac5.entry.js +0 -1
  158. package/dist/sankhyablocks/p-a87149e4.entry.js +0 -1
  159. package/dist/sankhyablocks/p-ac77949b.entry.js +0 -1
  160. package/dist/sankhyablocks/p-b10b9934.entry.js +0 -1
  161. package/dist/sankhyablocks/p-be75153c.js +0 -1
  162. package/dist/sankhyablocks/p-bf39bdb8.entry.js +0 -1
  163. package/dist/sankhyablocks/p-f7d0fab9.entry.js +0 -1
  164. package/dist/sankhyablocks/p-f7d9d148.entry.js +0 -1
  165. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +0 -3
  166. /package/dist/sankhyablocks/{p-ae4fc9a9.js → p-61dd89eb.js} +0 -0
@@ -4,25 +4,79 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
- const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
8
- const taskbarElements = require('./taskbar-elements-3ecd1278.js');
9
- const ConfigStorage = require('./ConfigStorage-8d4e9d53.js');
7
+ const taskbarElements = require('./taskbar-elements-d9392685.js');
8
+ const ConfigStorage = require('./ConfigStorage-085c7117.js');
10
9
  const index$1 = require('./index-0922807b.js');
11
10
  const fieldSearch = require('./field-search-f56aa7d6.js');
12
11
  const index$2 = require('./index-102ba62d.js');
13
- const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-d15f7aac.js');
12
+ const IExporterProvider = require('./IExporterProvider-955812ad.js');
14
13
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
15
- require('./DataFetcher-99f0f6ed.js');
16
- require('./pesquisa-fetcher-bdbbe9ac.js');
14
+ require('./form-config-fetcher-cdd644a7.js');
15
+ require('./pesquisa-fetcher-6e934fb5.js');
17
16
  require('./ISave-e91b70a7.js');
18
17
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
18
+ require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
19
19
  require('./filter-item-type.enum-a7ffdaa6.js');
20
- require('./form-config-fetcher-d73f4449.js');
20
+ const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
21
21
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
22
22
  require('./PrintUtils-bcaeb82f.js');
23
23
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
24
24
  require('./ResourceIDUtils-5ff86aa7.js');
25
25
 
26
+ class ServerSideExporterProvider extends IExporterProvider.CommonsExporter {
27
+ getFilters() {
28
+ var _a;
29
+ return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getAppliedFilters();
30
+ }
31
+ getOrders() {
32
+ var _a;
33
+ return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSort();
34
+ }
35
+ getResourceURI() {
36
+ var _a;
37
+ return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.name;
38
+ }
39
+ getSelectedNumber() {
40
+ return this.dataUnit.getSelectionInfo().length;
41
+ }
42
+ getTotalRecords() {
43
+ var _a, _b, _c;
44
+ const { total } = ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
45
+ 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;
46
+ }
47
+ getSelectedIDs() {
48
+ return RecordIDUtils.getSelectedIDs(this.dataUnit);
49
+ }
50
+ getOffset() {
51
+ return this.getExporterOffset(this.getPaginationInfo());
52
+ }
53
+ getPageSize() {
54
+ var _a;
55
+ return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.pageSize;
56
+ }
57
+ getExportLimit() {
58
+ return 5000;
59
+ }
60
+ getRecordID() {
61
+ var _a, _b, _c;
62
+ 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__;
63
+ }
64
+ getPaginationInfo() {
65
+ var _a;
66
+ return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo();
67
+ }
68
+ getExporterOffset(paginationInfo) {
69
+ if (paginationInfo == undefined) {
70
+ return;
71
+ }
72
+ const offset = paginationInfo.firstRecord;
73
+ if (offset > 0) {
74
+ return (offset - 1);
75
+ }
76
+ return offset;
77
+ }
78
+ }
79
+
26
80
  const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{width:100%;display:flex;flex-wrap:nowrap;justify-content:flex-end}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:var(--snk-grid-min-height)}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";
27
81
 
28
82
  const SnkGrid = class {
@@ -54,7 +108,7 @@ const SnkGrid = class {
54
108
  this._gridConfig = undefined;
55
109
  this._popUpGridConfig = false;
56
110
  this._showSnkFilterBar = true;
57
- this.columnFilterDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
111
+ this.columnFilterDataSource = new IExporterProvider.SnkMultiSelectionListDataSource();
58
112
  this.configName = undefined;
59
113
  this.filterBarTitle = undefined;
60
114
  this.resourceID = undefined;
@@ -142,7 +196,7 @@ const SnkGrid = class {
142
196
  }
143
197
  setGridConfig(config) {
144
198
  this._gridConfig = config;
145
- SnkMultiSelectionListDataSource.CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
199
+ IExporterProvider.CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
146
200
  }
147
201
  loadConfig() {
148
202
  ConfigStorage.ConfigStorage.loadGridConfig(this.configName, this.resourceID)
@@ -173,99 +227,8 @@ const SnkGrid = class {
173
227
  });
174
228
  evt.stopPropagation();
175
229
  }
176
- buildColumnsMetadata(gridColumns) {
177
- const columnsMetadata = [];
178
- gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach((column) => {
179
- var _a, _b;
180
- /**
181
- * TODO: Analisar e criar uma melhor forma de tratar essa validação do "RECDESP".
182
- */
183
- if (column.hidden && column.name !== "RECDESP") {
184
- return;
185
- }
186
- const fieldData = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
187
- const columnData = {
188
- label: column.label,
189
- id: column.name,
190
- width: column.width,
191
- type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
192
- userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface
193
- };
194
- columnsMetadata.push(columnData);
195
- if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
196
- const mergedFrom = fieldData.properties.mergedFrom;
197
- const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
198
- const descriptionColumn = {
199
- label: fieldData.properties.DESCRIPTIONENTITY,
200
- id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
201
- width: 200,
202
- type: core.DataType.TEXT,
203
- userInterface: UnitMetadata.UserInterface.LONGTEXT
204
- };
205
- columnsMetadata.push(descriptionColumn);
206
- }
207
- });
208
- return columnsMetadata || [];
209
- }
210
- getPaginationInfo() {
211
- var _a;
212
- return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo();
213
- }
214
- getExporterOffset(paginationInfo) {
215
- if (paginationInfo == undefined) {
216
- return;
217
- }
218
- const offset = paginationInfo.firstRecord;
219
- if (offset > 0) {
220
- return (offset - 1);
221
- }
222
- return offset;
223
- }
224
230
  async dataExporterProviderStore() {
225
- var _a;
226
- const selectedIDs = await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecordsIDsInfo());
227
- const dataExporterProvider = {
228
- getFilters: () => {
229
- var _a;
230
- return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getAppliedFilters();
231
- },
232
- getColumnsMetadata: async () => {
233
- var _a;
234
- const columnsState = await ((_a = this._grid) === null || _a === void 0 ? void 0 : _a.getColumnsState());
235
- return this.buildColumnsMetadata(columnsState);
236
- },
237
- getOrders: () => {
238
- var _a;
239
- return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSort();
240
- },
241
- getResourceURI: () => {
242
- var _a;
243
- return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.name;
244
- },
245
- getSelectedNumber: () => {
246
- var _a, _b;
247
- return (_b = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectionInfo) === null || _b === void 0 ? void 0 : _b.length;
248
- },
249
- getTotalRecords: () => {
250
- var _a, _b, _c;
251
- const { total } = ((_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
252
- 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;
253
- },
254
- getSelectedIDs: () => {
255
- return selectedIDs || [];
256
- },
257
- getOffset: () => {
258
- return this.getExporterOffset(this.getPaginationInfo());
259
- },
260
- getLimit: () => {
261
- var _a;
262
- return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.pageSize;
263
- },
264
- getRecordID: () => {
265
- var _a, _b, _c;
266
- 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__;
267
- }
268
- };
231
+ const dataExporterProvider = new ServerSideExporterProvider(this._dataUnit, this._grid);
269
232
  index$2.store.set("exporterProviders", Object.assign(Object.assign({}, index$2.store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
270
233
  }
271
234
  addElementID() {
@@ -273,7 +236,7 @@ const SnkGrid = class {
273
236
  core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
274
237
  }
275
238
  finshLoading() {
276
- SnkMultiSelectionListDataSource.CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
239
+ IExporterProvider.CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
277
240
  this.addElementID();
278
241
  if (this.columnFilterDataSource != undefined) {
279
242
  this.columnFilterDataSource.setApplication(this._application);
@@ -2,19 +2,18 @@
2
2
 
3
3
  const index = require('./index-f9e81701.js');
4
4
  const core = require('@sankhyalabs/core');
5
- const SnkFormConfigManager = require('./SnkFormConfigManager-33995e92.js');
5
+ const SnkFormConfigManager = require('./SnkFormConfigManager-8986431f.js');
6
6
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
7
7
  const fieldSearch = require('./field-search-f56aa7d6.js');
8
- const taskbarElements = require('./taskbar-elements-3ecd1278.js');
8
+ const taskbarElements = require('./taskbar-elements-d9392685.js');
9
9
  const constants = require('./constants-35ddd366.js');
10
- require('./DataFetcher-99f0f6ed.js');
11
- require('./pesquisa-fetcher-bdbbe9ac.js');
10
+ require('./form-config-fetcher-cdd644a7.js');
11
+ require('./pesquisa-fetcher-6e934fb5.js');
12
12
  const index$1 = require('./index-0922807b.js');
13
13
  require('./ISave-e91b70a7.js');
14
14
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
15
15
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
16
16
  require('./filter-item-type.enum-a7ffdaa6.js');
17
- require('./form-config-fetcher-d73f4449.js');
18
17
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
19
18
 
20
19
  const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-medium:var(--space--medium, 12px);--snk-guides-viewer__header--min-height:94px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-medium);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-medium)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-medium));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-medium))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
@@ -2,23 +2,22 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkGuidesViewer = require('./snk-guides-viewer-a8dd24a3.js');
5
+ const snkGuidesViewer = require('./snk-guides-viewer-4e8b517b.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
- require('./SnkFormConfigManager-33995e92.js');
9
- require('./ConfigStorage-8d4e9d53.js');
10
- require('./form-config-fetcher-d73f4449.js');
11
- require('./DataFetcher-99f0f6ed.js');
8
+ require('./SnkFormConfigManager-8986431f.js');
9
+ require('./ConfigStorage-085c7117.js');
10
+ require('./form-config-fetcher-cdd644a7.js');
12
11
  require('./PrintUtils-bcaeb82f.js');
13
12
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
13
  require('./filter-item-type.enum-a7ffdaa6.js');
15
14
  require('@sankhyalabs/ezui/dist/collection/utils/form');
16
15
  require('./field-search-f56aa7d6.js');
17
- require('./taskbar-elements-3ecd1278.js');
16
+ require('./taskbar-elements-d9392685.js');
18
17
  require('./index-0922807b.js');
19
18
  require('./index-102ba62d.js');
20
19
  require('./constants-35ddd366.js');
21
- require('./pesquisa-fetcher-bdbbe9ac.js');
20
+ require('./pesquisa-fetcher-6e934fb5.js');
22
21
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
23
22
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
24
23
  require('./ResourceIDUtils-5ff86aa7.js');
@@ -5,13 +5,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-0184ffbb.js');
8
- const ConfigStorage = require('./ConfigStorage-8d4e9d53.js');
8
+ const ConfigStorage = require('./ConfigStorage-085c7117.js');
9
9
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
10
10
  const index$1 = require('./index-c5771aba.js');
11
11
  const index$2 = require('./index-102ba62d.js');
12
12
  require('./filter-item-type.enum-a7ffdaa6.js');
13
- require('./form-config-fetcher-d73f4449.js');
14
- require('./DataFetcher-99f0f6ed.js');
13
+ require('./form-config-fetcher-cdd644a7.js');
15
14
  require('./PrintUtils-bcaeb82f.js');
16
15
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
17
16
 
@@ -2,24 +2,24 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-f9e81701.js');
5
+ const index$1 = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const constants = require('./constants-35ddd366.js');
9
- const taskbarElements = require('./taskbar-elements-3ecd1278.js');
10
- require('./DataFetcher-99f0f6ed.js');
11
- const pesquisaFetcher = require('./pesquisa-fetcher-bdbbe9ac.js');
12
- const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-d15f7aac.js');
13
- const index$1 = require('./index-0922807b.js');
9
+ const taskbarElements = require('./taskbar-elements-d9392685.js');
10
+ const formConfigFetcher = require('./form-config-fetcher-cdd644a7.js');
11
+ const pesquisaFetcher = require('./pesquisa-fetcher-6e934fb5.js');
12
+ const IExporterProvider = require('./IExporterProvider-955812ad.js');
13
+ const index = require('./index-0922807b.js');
14
14
  require('./ISave-e91b70a7.js');
15
15
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
16
16
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
17
17
  require('./filter-item-type.enum-a7ffdaa6.js');
18
- const formConfigFetcher = require('./form-config-fetcher-d73f4449.js');
19
18
  const fieldSearch = require('./field-search-f56aa7d6.js');
20
- const ConfigStorage = require('./ConfigStorage-8d4e9d53.js');
21
- const SnkFormConfigManager = require('./SnkFormConfigManager-33995e92.js');
22
- require('./index-102ba62d.js');
19
+ const ConfigStorage = require('./ConfigStorage-085c7117.js');
20
+ const SnkFormConfigManager = require('./SnkFormConfigManager-8986431f.js');
21
+ const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
22
+ const index$2 = require('./index-102ba62d.js');
23
23
  require('./PrintUtils-bcaeb82f.js');
24
24
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
25
25
  require('./ResourceIDUtils-5ff86aa7.js');
@@ -28,25 +28,75 @@ require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilt
28
28
  const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
29
29
  const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
30
30
 
31
+ class ClientSideExporterProvider extends IExporterProvider.CommonsExporter {
32
+ getSelectedNumber() {
33
+ return this.dataUnit.getSelectionInfo().length;
34
+ }
35
+ getTotalRecords() {
36
+ var _a, _b, _c;
37
+ const { total } = ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
38
+ 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;
39
+ }
40
+ getSelectedIDs() {
41
+ return RecordIDUtils.getSelectedIDs(this.dataUnit);
42
+ }
43
+ getRecordID() {
44
+ var _a, _b, _c;
45
+ 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__;
46
+ }
47
+ async getRecords() {
48
+ if (this.dataUnit.records.length === 0) {
49
+ return Promise.resolve([]);
50
+ }
51
+ const selectionInfo = this.dataUnit.getSelectionInfo();
52
+ const records = selectionInfo.isEmpty() || selectionInfo.isAllRecords() ? await selectionInfo.getAllRecords() : selectionInfo.records;
53
+ return Promise.resolve(records == undefined ? [] : records);
54
+ }
55
+ getHiddenOptions() {
56
+ return [
57
+ index.DataExporterOption.EXPORT_BY_EMAIL,
58
+ index.DataExporterOption.EXPORT_PDF_TO_EMAIL,
59
+ index.DataExporterOption.EXPORT_XLS_TO_EMAIL,
60
+ index.DataExporterOption.EXPORT_PAGE_TO_PDF,
61
+ index.DataExporterOption.EXPORT_PAGE_TO_XLS
62
+ ];
63
+ }
64
+ formatValue(record, column) {
65
+ const { id, descriptionFrom } = column;
66
+ const value = record[descriptionFrom || id];
67
+ if (value == undefined) {
68
+ return "";
69
+ }
70
+ if (descriptionFrom != undefined) {
71
+ return value.label;
72
+ }
73
+ const fieldDescriptor = this.dataUnit.getField(id);
74
+ if (fieldDescriptor.userInterface === core.UserInterface.SEARCH) {
75
+ return value.value;
76
+ }
77
+ return this.dataUnit.getFormattedValue(id, value);
78
+ }
79
+ }
80
+
31
81
  const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;row-gap:12px;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";
32
82
 
33
83
  const SnkSimpleCrud = class {
34
84
  constructor(hostRef) {
35
- index.registerInstance(this, hostRef);
36
- this.dataStateChange = index.createEvent(this, "dataStateChange", 3);
37
- this.dataUnitReady = index.createEvent(this, "dataUnitReady", 3);
38
- this.actionClick = index.createEvent(this, "actionClick", 7);
39
- this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
40
- this.configuratorSave = index.createEvent(this, "configuratorSave", 7);
41
- this.configuratorCancel = index.createEvent(this, "configuratorCancel", 7);
42
- this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
85
+ index$1.registerInstance(this, hostRef);
86
+ this.dataStateChange = index$1.createEvent(this, "dataStateChange", 3);
87
+ this.dataUnitReady = index$1.createEvent(this, "dataUnitReady", 3);
88
+ this.actionClick = index$1.createEvent(this, "actionClick", 7);
89
+ this.formItemsReady = index$1.createEvent(this, "formItemsReady", 7);
90
+ this.configuratorSave = index$1.createEvent(this, "configuratorSave", 7);
91
+ this.configuratorCancel = index$1.createEvent(this, "configuratorCancel", 7);
92
+ this._multiSelectionListDataSource = new IExporterProvider.SnkMultiSelectionListDataSource();
43
93
  this._keyDownHandler = (event) => this.keyDownListener(event);
44
94
  this._formConfigFetcher = new formConfigFetcher.FormConfigFetcher();
45
95
  this._taskbarProcessor = new fieldSearch.TaskbarProcessor({
46
- "snkSimpleCrudTaskbar.form_regular": this.getButtons(false, taskbarElements.TaskbarElement.GRID_MODE),
47
- "snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, taskbarElements.TaskbarElement.FORM_MODE),
48
- "snkSimpleCrudTaskbar.form_selected": this.getButtons(true, taskbarElements.TaskbarElement.GRID_MODE),
49
- "snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, taskbarElements.TaskbarElement.FORM_MODE),
96
+ "snkSimpleCrudTaskbar.form_regular": this.getButtons(false, [taskbarElements.TaskbarElement.GRID_MODE]),
97
+ "snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, [taskbarElements.TaskbarElement.DATA_EXPORTER, taskbarElements.TaskbarElement.FORM_MODE]),
98
+ "snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [taskbarElements.TaskbarElement.GRID_MODE]),
99
+ "snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, [taskbarElements.TaskbarElement.DATA_EXPORTER, taskbarElements.TaskbarElement.FORM_MODE]),
50
100
  "snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
51
101
  });
52
102
  this._showPopUpGridConfig = false;
@@ -57,12 +107,14 @@ const SnkSimpleCrud = class {
57
107
  this._customContainerId = `SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${core.StringUtils.generateUUID()}`;
58
108
  this.dataState = undefined;
59
109
  this.dataUnit = undefined;
110
+ this.entityName = undefined;
60
111
  this.mode = constants.SIMPLE_CRUD_MODE.SERVER;
61
112
  this.gridConfig = undefined;
62
113
  this.formConfig = undefined;
63
114
  this._formFields = [];
64
115
  this.multipleSelection = undefined;
65
116
  this.useCancelConfirm = true;
117
+ this.pageSize = 150;
66
118
  this.resourceID = undefined;
67
119
  this.taskbarManager = undefined;
68
120
  this.messagesBuilder = undefined;
@@ -84,9 +136,9 @@ const SnkSimpleCrud = class {
84
136
  this.loadFormConfig(true);
85
137
  this.loadGridConfig(true);
86
138
  }
87
- getButtons(selected, changeModeBtn) {
139
+ getButtons(selected, extraButtons) {
88
140
  return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
89
- .concat(changeModeBtn));
141
+ .concat(extraButtons));
90
142
  }
91
143
  addConfigButton(buttons) {
92
144
  if (this.configName === undefined) {
@@ -126,6 +178,12 @@ const SnkSimpleCrud = class {
126
178
  }
127
179
  evt.stopPropagation();
128
180
  }
181
+ async onChangeEntityName(newValue) {
182
+ if (this.dataUnit)
183
+ return;
184
+ const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
185
+ this.dataUnit = await application.getDataUnit(newValue, null, null, this.configName);
186
+ }
129
187
  onModeChange() {
130
188
  if (this.mode == constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
131
189
  this.initInMemoryDataUnit();
@@ -238,6 +296,7 @@ const SnkSimpleCrud = class {
238
296
  }
239
297
  async componentWillRender() {
240
298
  this._resourceID = await this.application.getResourceID();
299
+ this.dataExporterProviderStore();
241
300
  this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.getTaskBarDisabledButtons());
242
301
  if (this.configName === undefined) {
243
302
  return;
@@ -262,13 +321,13 @@ const SnkSimpleCrud = class {
262
321
  this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
263
322
  }
264
323
  getTaskBarId() {
265
- var _a, _b, _c;
324
+ var _a, _b;
266
325
  if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) {
267
326
  return "snkSimpleCrudTaskbar.finish_edition";
268
327
  }
269
328
  if (((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo) &&
270
329
  !this.dataState.selectionInfo.isAllRecords() &&
271
- ((_c = this.dataState.selectionInfo.records) === null || _c === void 0 ? void 0 : _c.length) > 0) {
330
+ this.dataState.selectionInfo.length > 0) {
272
331
  return this._currentViewMode === constants.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
273
332
  }
274
333
  return this._currentViewMode === constants.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
@@ -457,8 +516,8 @@ const SnkSimpleCrud = class {
457
516
  }
458
517
  getTopTaskBarId() {
459
518
  var _a;
460
- return ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? `snkGridTopTaskbar.finish_edition${index$1.PresentationMode.PRIMARY}` :
461
- `snkGridTopTaskbar.regular${index$1.PresentationMode.PRIMARY}`;
519
+ return ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? `snkGridTopTaskbar.finish_edition${index.PresentationMode.PRIMARY}` :
520
+ `snkGridTopTaskbar.regular${index.PresentationMode.PRIMARY}`;
462
521
  }
463
522
  async keyDownListener(event) {
464
523
  if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
@@ -508,12 +567,26 @@ const SnkSimpleCrud = class {
508
567
  .then(() => {
509
568
  this.setGridConfig(config);
510
569
  this.closeGridConfig();
570
+ this.dataExporterProviderStore();
511
571
  });
512
572
  evt.stopPropagation();
513
573
  }
574
+ async dataExporterProviderStore() {
575
+ if (this.dataUnit == undefined) {
576
+ return;
577
+ }
578
+ if (this._grid == undefined) {
579
+ return;
580
+ }
581
+ const dataExporterProvider = new ClientSideExporterProvider(this.dataUnit, this._grid);
582
+ index$2.store.set("exporterProviders", Object.assign(Object.assign({}, index$2.store.get("exporterProviders")), { [this.getDataExporterStoreKey()]: dataExporterProvider }));
583
+ }
584
+ getDataExporterStoreKey() {
585
+ return `SnkSimpleCrudDataExporter:${this.configName == undefined ? this.dataUnit.name : this.configName}`;
586
+ }
514
587
  setGridConfig(config) {
515
588
  this.gridConfig = config;
516
- SnkMultiSelectionListDataSource.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
589
+ IExporterProvider.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
517
590
  }
518
591
  setFormConfig(config, forceUpdate) {
519
592
  if (this.formConfig && !forceUpdate)
@@ -526,6 +599,15 @@ const SnkSimpleCrud = class {
526
599
  closeFormConfig() {
527
600
  this._showFormConfig = false;
528
601
  }
602
+ getPageSize() {
603
+ if (this.mode === constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
604
+ return 0;
605
+ }
606
+ if (this.pageSize == undefined) {
607
+ return 150;
608
+ }
609
+ return this.pageSize;
610
+ }
529
611
  //No momento não daremos suporte para configuração de formulário quando houver formLegacyConfigName
530
612
  handleShowFormConfig() {
531
613
  return this._showFormConfig && !this.formLegacyConfigName;
@@ -547,13 +629,14 @@ const SnkSimpleCrud = class {
547
629
  if (this.dataUnit == undefined) {
548
630
  return;
549
631
  }
550
- return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }, index.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(pesquisaFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
632
+ return (index$1.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index$1.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: index.PresentationMode.SECONDARY }, index$1.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index$1.h("stack-item", null, index$1.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(pesquisaFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
551
633
  ? undefined
552
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index.h("div", { id: `${this._customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }))), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
634
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, index$1.h("ez-form", { class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index$1.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index$1.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
553
635
  }
554
- get _element() { return index.getElement(this); }
636
+ get _element() { return index$1.getElement(this); }
555
637
  static get watchers() { return {
556
638
  "resourceID": ["handleResourceIDChanged"],
639
+ "entityName": ["onChangeEntityName"],
557
640
  "mode": ["onModeChange"],
558
641
  "dataState": ["observeDataState"],
559
642
  "formLegacyConfigName": ["observeFormLegacy"],
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
8
- const taskbarElements = require('./taskbar-elements-3ecd1278.js');
8
+ const taskbarElements = require('./taskbar-elements-d9392685.js');
9
9
  const index$1 = require('./index-0922807b.js');
10
10
  require('./index-102ba62d.js');
11
11
 
@@ -166,8 +166,9 @@ const SnkTaskbar = class {
166
166
  className += "ez-padding-left--medium";
167
167
  }
168
168
  const taskbarElement = taskbarElements.TaskbarElement[def.toString()];
169
+ const dataExporterStoreKey = this._element.dataset.exporterStoreKey || this.configName;
169
170
  if (taskbarElement) {
170
- return taskbarElements.buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.buildDynamicActionsList(), this.configName, this.presentationMode);
171
+ return taskbarElements.buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.buildDynamicActionsList(), dataExporterStoreKey, this.presentationMode);
171
172
  }
172
173
  else {
173
174
  return taskbarElements.buildCustomButton(def, className, this.getIdElemBtnCustom(def), elem => this.elementClick(elem), elem => this.isEnabled(elem));
@@ -50,7 +50,7 @@ const buildCustomButton = (def, className, dataElementId, action, isEnabled) =>
50
50
  return textButton(def.name, className, dataElementId, text, hint, action, isEnabled);
51
51
  }
52
52
  };
53
- const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions, configName, presentationMode) => {
53
+ const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions, dataExporterStoreKey, presentationMode) => {
54
54
  var _a;
55
55
  const title = getTitle(element);
56
56
  switch (element) {
@@ -93,7 +93,7 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
93
93
  case exports.TaskbarElement.DIVIDER:
94
94
  return index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin--none ez-margin-left--medium", "data-taskbar-divider": true });
95
95
  case exports.TaskbarElement.DATA_EXPORTER:
96
- const provider = (_a = index$1.store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
96
+ const provider = (_a = index$1.store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[dataExporterStoreKey];
97
97
  return index.h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId, "data-taskbar-element": element });
98
98
  case exports.TaskbarElement.ATTACH:
99
99
  return iconButton("anexo", element, className, dataElementId, title, action, isEnabled);