@sankhyalabs/sankhyablocks 8.16.0-dev.81 → 8.16.0-dev.83

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. package/dist/cjs/{ContinuousInsertUtils-c27b439e.js → ClientSideExporterProvider-6b781452.js} +70 -1
  2. package/dist/cjs/IFetchDataExporterParams-e78ec415.js +8 -0
  3. package/dist/cjs/{index-1dfc7a6e.js → index-e3e39724.js} +5 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +1 -1
  6. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  7. package/dist/cjs/snk-actions-button_5.cjs.entry.js +1 -1
  8. package/dist/cjs/snk-attach.cjs.entry.js +2 -2
  9. package/dist/cjs/snk-crud.cjs.entry.js +2 -2
  10. package/dist/cjs/snk-data-exporter.cjs.entry.js +11 -14
  11. package/dist/cjs/snk-detail-view.cjs.entry.js +3 -3
  12. package/dist/cjs/snk-grid.cjs.entry.js +16 -12
  13. package/dist/cjs/{snk-guides-viewer-bff0d27d.js → snk-guides-viewer-a029ff50.js} +2 -2
  14. package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
  15. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  16. package/dist/cjs/snk-simple-crud.cjs.entry.js +24 -78
  17. package/dist/cjs/snk-taskbar.cjs.entry.js +2 -2
  18. package/dist/cjs/{taskbar-elements-9ad1f9c0.js → taskbar-elements-7e19882d.js} +1 -1
  19. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +3 -9
  20. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +17 -5
  21. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +7 -4
  22. package/dist/collection/components/snk-grid/snk-grid.css +6 -0
  23. package/dist/collection/components/snk-grid/snk-grid.js +30 -3
  24. package/dist/collection/lib/@types/index.js +5 -0
  25. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.js +6 -1
  26. package/dist/components/ContinuousInsertUtils.js +70 -2
  27. package/dist/components/ISave.js +6 -1
  28. package/dist/components/snk-data-exporter2.js +17 -14
  29. package/dist/components/snk-grid2.js +9 -5
  30. package/dist/components/snk-simple-crud2.js +3 -59
  31. package/dist/esm/{ContinuousInsertUtils-6bf78c5e.js → ClientSideExporterProvider-ff89c7e9.js} +70 -2
  32. package/dist/esm/IFetchDataExporterParams-d73bed3d.js +8 -0
  33. package/dist/esm/{index-3aa4977a.js → index-b40568ff.js} +6 -1
  34. package/dist/esm/loader.js +1 -1
  35. package/dist/esm/pesquisa-grid_2.entry.js +1 -1
  36. package/dist/esm/sankhyablocks.js +1 -1
  37. package/dist/esm/snk-actions-button_5.entry.js +1 -1
  38. package/dist/esm/snk-attach.entry.js +2 -2
  39. package/dist/esm/snk-crud.entry.js +2 -2
  40. package/dist/esm/snk-data-exporter.entry.js +11 -14
  41. package/dist/esm/snk-detail-view.entry.js +3 -3
  42. package/dist/esm/snk-grid.entry.js +10 -6
  43. package/dist/esm/{snk-guides-viewer-454ebc07.js → snk-guides-viewer-fa45714d.js} +2 -2
  44. package/dist/esm/snk-guides-viewer.entry.js +3 -3
  45. package/dist/esm/snk-pesquisa.entry.js +1 -1
  46. package/dist/esm/snk-simple-crud.entry.js +6 -60
  47. package/dist/esm/snk-taskbar.entry.js +2 -2
  48. package/dist/esm/{taskbar-elements-d59867f1.js → taskbar-elements-d2353c64.js} +1 -1
  49. package/dist/sankhyablocks/{p-643b2aaa.entry.js → p-0b00d69c.entry.js} +1 -1
  50. package/dist/sankhyablocks/p-0f3698af.js +1 -0
  51. package/dist/sankhyablocks/{p-9a99c67b.entry.js → p-172848d4.entry.js} +1 -1
  52. package/dist/sankhyablocks/{p-ae26e8d0.entry.js → p-38c062b1.entry.js} +1 -1
  53. package/dist/sankhyablocks/{p-7e7a7473.js → p-3fc82614.js} +1 -1
  54. package/dist/sankhyablocks/p-40e323f9.js +1 -0
  55. package/dist/sankhyablocks/p-700a4cc3.entry.js +1 -0
  56. package/dist/sankhyablocks/p-8f3f2306.js +1 -0
  57. package/dist/sankhyablocks/{p-28ca3908.entry.js → p-a962a3e4.entry.js} +1 -1
  58. package/dist/sankhyablocks/p-aa1a0f3e.entry.js +1 -0
  59. package/dist/sankhyablocks/{p-73b037a8.entry.js → p-b02e58fd.entry.js} +1 -1
  60. package/dist/sankhyablocks/{p-50bf8dbc.entry.js → p-b0ff53b7.entry.js} +1 -1
  61. package/dist/sankhyablocks/{p-91e34755.entry.js → p-c82deea7.entry.js} +1 -1
  62. package/dist/sankhyablocks/{p-bd234604.entry.js → p-d2d0535f.entry.js} +1 -1
  63. package/dist/sankhyablocks/{p-478ab2b6.js → p-de9da2f2.js} +1 -1
  64. package/dist/sankhyablocks/p-e36f89d1.entry.js +1 -0
  65. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  66. package/dist/types/components/snk-data-exporter/data/export-result.d.ts +2 -1
  67. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +0 -1
  68. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +2 -1
  69. package/dist/types/components/snk-data-exporter/interfaces/IRecordID.d.ts +1 -0
  70. package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +3 -1
  71. package/dist/types/components/snk-grid/snk-grid.d.ts +5 -0
  72. package/dist/types/components.d.ts +9 -1
  73. package/dist/types/lib/@types/index.d.ts +4 -0
  74. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +5 -1
  75. package/package.json +1 -1
  76. package/dist/sankhyablocks/p-03e6825e.js +0 -1
  77. package/dist/sankhyablocks/p-1bd8eae1.entry.js +0 -1
  78. package/dist/sankhyablocks/p-30cf616e.js +0 -1
  79. package/dist/sankhyablocks/p-6fc8bfa2.entry.js +0 -1
  80. package/dist/sankhyablocks/p-a04f38aa.entry.js +0 -1
@@ -4,12 +4,12 @@ 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 taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
7
+ const taskbarElements = require('./taskbar-elements-7e19882d.js');
8
8
  const ConfigStorage = require('./ConfigStorage-d024aec8.js');
9
- const index$1 = require('./index-1dfc7a6e.js');
9
+ const index$1 = require('./index-e3e39724.js');
10
10
  const fieldSearch = require('./field-search-68e34bf4.js');
11
11
  const index$2 = require('./index-102ba62d.js');
12
- const ContinuousInsertUtils = require('./ContinuousInsertUtils-c27b439e.js');
12
+ const ClientSideExporterProvider = require('./ClientSideExporterProvider-6b781452.js');
13
13
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
14
14
  require('./DataFetcher-65879b2c.js');
15
15
  require('./pesquisa-fetcher-5c583c93.js');
@@ -22,12 +22,13 @@ require('./form-config-fetcher-90126e4c.js');
22
22
  require('./constants-241934b3.js');
23
23
  const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
24
24
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
25
+ require('./IFetchDataExporterParams-e78ec415.js');
25
26
  require('./PrintUtils-bcaeb82f.js');
26
27
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
27
28
  require('@sankhyalabs/core/dist/utils/SortingUtils');
28
29
  require('./ResourceIDUtils-5ff86aa7.js');
29
30
 
30
- class ServerSideExporterProvider extends ContinuousInsertUtils.CommonsExporter {
31
+ class ServerSideExporterProvider extends ClientSideExporterProvider.CommonsExporter {
31
32
  getFilters() {
32
33
  var _a;
33
34
  return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getAppliedFilters();
@@ -81,7 +82,7 @@ class ServerSideExporterProvider extends ContinuousInsertUtils.CommonsExporter {
81
82
  }
82
83
  }
83
84
 
84
- const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px;--snk-grid-padding:var(--space--small)}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%;padding:var(--snk-grid-padding)}.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}";
85
+ const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px;--snk-grid-padding:var(--space--small)}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%;padding:var(--snk-grid-padding)}.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}.snk-grid-container__footer.sc-snk-grid{background-color:var(--background--xlight, #FFF);border-radius:0 0 var(--border--radius-medium) var(--border--radius-medium);box-shadow:var(--shadow--small)}";
85
86
 
86
87
  const SnkGrid = class {
87
88
  constructor(hostRef) {
@@ -123,7 +124,7 @@ const SnkGrid = class {
123
124
  this._popUpGridConfig = false;
124
125
  this._showSnkFilterBar = true;
125
126
  this._enableContinuousInsert = false;
126
- this.columnFilterDataSource = new ContinuousInsertUtils.SnkMultiSelectionListDataSource();
127
+ this.columnFilterDataSource = new ClientSideExporterProvider.SnkMultiSelectionListDataSource();
127
128
  this.enableLockManagerLoadingComp = false;
128
129
  this.enableLockManagerTaskbarClick = false;
129
130
  this.configName = undefined;
@@ -150,6 +151,7 @@ const SnkGrid = class {
150
151
  this.autoFocus = true;
151
152
  this.enableGridInsert = false;
152
153
  this.outlineMode = false;
154
+ this.strategyExporter = index$1.ExporterStrategy.SERVER_SIDE;
153
155
  }
154
156
  reloadConfig() {
155
157
  this.loadConfig();
@@ -283,7 +285,7 @@ const SnkGrid = class {
283
285
  }
284
286
  setGridConfig(config) {
285
287
  this._gridConfig = config;
286
- ContinuousInsertUtils.CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
288
+ ClientSideExporterProvider.CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
287
289
  }
288
290
  fixColumNameCharset(columnName) {
289
291
  try {
@@ -329,7 +331,9 @@ const SnkGrid = class {
329
331
  evt.stopPropagation();
330
332
  }
331
333
  async dataExporterProviderStore() {
332
- const dataExporterProvider = new ServerSideExporterProvider(this._dataUnit, this._grid);
334
+ const dataExporterProvider = this.strategyExporter === index$1.ExporterStrategy.SERVER_SIDE
335
+ ? new ServerSideExporterProvider(this._dataUnit, this._grid)
336
+ : new ClientSideExporterProvider.ClientSideExporterProvider(this._dataUnit, this._grid);
333
337
  index$2.store.set("exporterProviders", Object.assign(Object.assign({}, index$2.store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
334
338
  }
335
339
  addElementID() {
@@ -353,7 +357,7 @@ const SnkGrid = class {
353
357
  }
354
358
  finishLoading() {
355
359
  this._dataUnit.addInterceptor(this.dataUnitInterceptor);
356
- ContinuousInsertUtils.CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
360
+ ClientSideExporterProvider.CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
357
361
  this.addElementID();
358
362
  if (this.columnFilterDataSource != undefined) {
359
363
  this.columnFilterDataSource.setApplication(this._application);
@@ -408,10 +412,10 @@ const SnkGrid = class {
408
412
  }
409
413
  parent = parent.parentElement;
410
414
  }
411
- this._rmPrecisionCustomValueFormatter = new ContinuousInsertUtils.RmPrecisionCustomValueFormatter();
415
+ this._rmPrecisionCustomValueFormatter = new ClientSideExporterProvider.RmPrecisionCustomValueFormatter();
412
416
  this.addGridLegacyConfigName();
413
417
  this.loadConfig();
414
- this._continuousInsertUtils = new ContinuousInsertUtils.ContinuousInsertUtils(this._application, this.resourceID, this.configName);
418
+ this._continuousInsertUtils = new ClientSideExporterProvider.ContinuousInsertUtils(this._application, this.resourceID, this.configName);
415
419
  if (this.enableGridInsert) {
416
420
  this._continuousInsertUtils.getConfig().then(value => this._enableContinuousInsert = value);
417
421
  }
@@ -555,7 +559,7 @@ const SnkGrid = class {
555
559
  return undefined;
556
560
  }
557
561
  return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
558
- index.h(index.Fragment, null, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, 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, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.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' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.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, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), 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 }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, 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.resourceID }))));
562
+ index.h(index.Fragment, null, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, 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, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.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' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.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, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), 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 }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, 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.resourceID }))));
559
563
  }
560
564
  get _element() { return index.getElement(this); }
561
565
  static get watchers() { return {
@@ -5,11 +5,11 @@ const core = require('@sankhyalabs/core');
5
5
  const SnkFormConfigManager = require('./SnkFormConfigManager-c11d8468.js');
6
6
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
7
7
  const fieldSearch = require('./field-search-68e34bf4.js');
8
- const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
8
+ const taskbarElements = require('./taskbar-elements-7e19882d.js');
9
9
  const constants = require('./constants-241934b3.js');
10
10
  require('./DataFetcher-65879b2c.js');
11
11
  require('./pesquisa-fetcher-5c583c93.js');
12
- const index$1 = require('./index-1dfc7a6e.js');
12
+ const index$1 = require('./index-e3e39724.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');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkGuidesViewer = require('./snk-guides-viewer-bff0d27d.js');
5
+ const snkGuidesViewer = require('./snk-guides-viewer-a029ff50.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
8
  require('./SnkFormConfigManager-c11d8468.js');
@@ -15,8 +15,8 @@ require('./filter-item-type.enum-a7ffdaa6.js');
15
15
  require('./constants-241934b3.js');
16
16
  require('@sankhyalabs/ezui/dist/collection/utils/form');
17
17
  require('./field-search-68e34bf4.js');
18
- require('./taskbar-elements-9ad1f9c0.js');
19
- require('./index-1dfc7a6e.js');
18
+ require('./taskbar-elements-7e19882d.js');
19
+ require('./index-e3e39724.js');
20
20
  require('./index-102ba62d.js');
21
21
  require('./pesquisa-fetcher-5c583c93.js');
22
22
  require('./ISave-e91b70a7.js');
@@ -6,7 +6,7 @@ const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const pesquisaFetcher = require('./pesquisa-fetcher-5c583c93.js');
8
8
  require('./DataFetcher-65879b2c.js');
9
- require('./index-1dfc7a6e.js');
9
+ require('./index-e3e39724.js');
10
10
  require('./ISave-e91b70a7.js');
11
11
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
12
12
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
@@ -2,15 +2,15 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index$1 = require('./index-f9e81701.js');
5
+ const index = 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-241934b3.js');
9
- const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
9
+ const taskbarElements = require('./taskbar-elements-7e19882d.js');
10
10
  require('./DataFetcher-65879b2c.js');
11
11
  require('./pesquisa-fetcher-5c583c93.js');
12
- const ContinuousInsertUtils = require('./ContinuousInsertUtils-c27b439e.js');
13
- const index = require('./index-1dfc7a6e.js');
12
+ const ClientSideExporterProvider = require('./ClientSideExporterProvider-6b781452.js');
13
+ const index$1 = require('./index-e3e39724.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');
@@ -20,10 +20,11 @@ const formConfigFetcher = require('./form-config-fetcher-90126e4c.js');
20
20
  const fieldSearch = require('./field-search-68e34bf4.js');
21
21
  const ConfigStorage = require('./ConfigStorage-d024aec8.js');
22
22
  const SnkFormConfigManager = require('./SnkFormConfigManager-c11d8468.js');
23
- const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
24
23
  const index$2 = require('./index-102ba62d.js');
25
24
  require('./PrintUtils-bcaeb82f.js');
26
25
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
26
+ require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
27
+ require('./IFetchDataExporterParams-e78ec415.js');
27
28
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
28
29
  require('@sankhyalabs/core/dist/utils/SortingUtils');
29
30
  require('./ResourceIDUtils-5ff86aa7.js');
@@ -31,73 +32,18 @@ require('./ResourceIDUtils-5ff86aa7.js');
31
32
  const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
32
33
  const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
33
34
 
34
- class ClientSideExporterProvider extends ContinuousInsertUtils.CommonsExporter {
35
- getSelectedNumber() {
36
- return this.dataUnit.getSelectionInfo().length;
37
- }
38
- getTotalRecords() {
39
- var _a, _b, _c;
40
- const { total } = ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
41
- 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;
42
- }
43
- getSelectedIDs() {
44
- return GetSelectedRecordsIDsInfo.getSelectedRecordsIDsInfo(this.dataUnit);
45
- }
46
- getRecordID() {
47
- var _a, _b, _c;
48
- 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__;
49
- }
50
- async getRecords() {
51
- if (this.dataUnit.records.length === 0) {
52
- return Promise.resolve([]);
53
- }
54
- const selectionInfo = this.dataUnit.getSelectionInfo();
55
- const records = selectionInfo.isEmpty() || selectionInfo.isAllRecords() ? await selectionInfo.getAllRecords() : selectionInfo.records;
56
- return Promise.resolve(records == undefined ? [] : records);
57
- }
58
- getHiddenOptions() {
59
- return [
60
- index.DataExporterOption.EXPORT_BY_EMAIL,
61
- index.DataExporterOption.EXPORT_PDF_TO_EMAIL,
62
- index.DataExporterOption.EXPORT_XLS_TO_EMAIL,
63
- index.DataExporterOption.EXPORT_PAGE_TO_PDF,
64
- index.DataExporterOption.EXPORT_PAGE_TO_XLS
65
- ];
66
- }
67
- formatValue(record, column) {
68
- const { id, descriptionFrom } = column;
69
- const value = record[descriptionFrom || id];
70
- if (value == undefined) {
71
- return "";
72
- }
73
- if (descriptionFrom != undefined) {
74
- return value.label;
75
- }
76
- const fieldDescriptor = this.dataUnit.getField(id);
77
- if (fieldDescriptor.userInterface === core.UserInterface.SEARCH) {
78
- return value.value;
79
- }
80
- if (column.customFormatter) {
81
- const ezGridColumn = this.getColumnsState().find(columnState => column.id === columnState.name);
82
- const formattedValue = column.customFormatter.format(value, ezGridColumn, record.__record__id__);
83
- return formattedValue;
84
- }
85
- return this.dataUnit.getFormattedValue(id, value);
86
- }
87
- }
88
-
89
35
  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;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__container--shadow--outline:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";
90
36
 
91
37
  const SnkSimpleCrud = class {
92
38
  constructor(hostRef) {
93
- index$1.registerInstance(this, hostRef);
94
- this.dataStateChange = index$1.createEvent(this, "dataStateChange", 3);
95
- this.dataUnitReady = index$1.createEvent(this, "dataUnitReady", 3);
96
- this.actionClick = index$1.createEvent(this, "actionClick", 7);
97
- this.formItemsReady = index$1.createEvent(this, "formItemsReady", 7);
98
- this.configuratorSave = index$1.createEvent(this, "configuratorSave", 7);
99
- this.configuratorCancel = index$1.createEvent(this, "configuratorCancel", 7);
100
- this._multiSelectionListDataSource = new ContinuousInsertUtils.SnkMultiSelectionListDataSource();
39
+ index.registerInstance(this, hostRef);
40
+ this.dataStateChange = index.createEvent(this, "dataStateChange", 3);
41
+ this.dataUnitReady = index.createEvent(this, "dataUnitReady", 3);
42
+ this.actionClick = index.createEvent(this, "actionClick", 7);
43
+ this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
44
+ this.configuratorSave = index.createEvent(this, "configuratorSave", 7);
45
+ this.configuratorCancel = index.createEvent(this, "configuratorCancel", 7);
46
+ this._multiSelectionListDataSource = new ClientSideExporterProvider.SnkMultiSelectionListDataSource();
101
47
  this._keyDownHandler = (event) => this.keyDownListener(event);
102
48
  this._formConfigFetcher = new formConfigFetcher.FormConfigFetcher();
103
49
  this._customEditors = new Map();
@@ -408,8 +354,8 @@ const SnkSimpleCrud = class {
408
354
  this.processMetadata();
409
355
  this.onModeChange();
410
356
  this.configDatasource();
411
- this._rmPrecisionCustomValueFormatter = new ContinuousInsertUtils.RmPrecisionCustomValueFormatter();
412
- this._continuousInsertUtils = new ContinuousInsertUtils.ContinuousInsertUtils(this.application, this.resolveResourceID(), this.configName);
357
+ this._rmPrecisionCustomValueFormatter = new ClientSideExporterProvider.RmPrecisionCustomValueFormatter();
358
+ this._continuousInsertUtils = new ClientSideExporterProvider.ContinuousInsertUtils(this.application, this.resolveResourceID(), this.configName);
413
359
  if (this.enableGridInsert) {
414
360
  this._continuousInsertUtils.getConfig().then(value => this.enableContinuousInsert = value);
415
361
  }
@@ -680,8 +626,8 @@ const SnkSimpleCrud = class {
680
626
  }
681
627
  getTopTaskBarId() {
682
628
  var _a;
683
- return ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? `snkGridTopTaskbar.finish_edition${index.PresentationMode.PRIMARY}` :
684
- `snkGridTopTaskbar.regular${index.PresentationMode.PRIMARY}`;
629
+ return ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? `snkGridTopTaskbar.finish_edition${index$1.PresentationMode.PRIMARY}` :
630
+ `snkGridTopTaskbar.regular${index$1.PresentationMode.PRIMARY}`;
685
631
  }
686
632
  async keyDownListener(event) {
687
633
  if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
@@ -744,7 +690,7 @@ const SnkSimpleCrud = class {
744
690
  if (this._grid == undefined) {
745
691
  return;
746
692
  }
747
- const dataExporterProvider = new ClientSideExporterProvider(this.dataUnit, this._grid);
693
+ const dataExporterProvider = new ClientSideExporterProvider.ClientSideExporterProvider(this.dataUnit, this._grid);
748
694
  index$2.store.set("exporterProviders", Object.assign(Object.assign({}, index$2.store.get("exporterProviders")), { [this.getDataExporterStoreKey()]: dataExporterProvider }));
749
695
  }
750
696
  getDataExporterStoreKey() {
@@ -752,7 +698,7 @@ const SnkSimpleCrud = class {
752
698
  }
753
699
  setGridConfig(config) {
754
700
  this.gridConfig = config;
755
- ContinuousInsertUtils.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
701
+ ClientSideExporterProvider.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
756
702
  }
757
703
  setFormConfig(config, forceUpdate) {
758
704
  if (this.formConfig && !forceUpdate)
@@ -823,7 +769,7 @@ const SnkSimpleCrud = class {
823
769
  }
824
770
  renderTaskbarContent() {
825
771
  var _a;
826
- return (index$1.h("snk-taskbar", { class: this._currentViewMode === constants.VIEW_MODE.FORM && `ez-box ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow-xsmall'} ez-padding--small`, 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" })));
772
+ return (index.h("snk-taskbar", { class: this._currentViewMode === constants.VIEW_MODE.FORM && `ez-box ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow-xsmall'} ez-padding--small`, 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$1.PresentationMode.SECONDARY }, index.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
827
773
  }
828
774
  /* istanbul ignore next */
829
775
  render() {
@@ -831,11 +777,11 @@ const SnkSimpleCrud = class {
831
777
  if (this.dataUnit == undefined) {
832
778
  return;
833
779
  }
834
- return (index$1.h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, 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.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: `ez-box ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow'} simple-crud__container-section` }, 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(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
780
+ return (index.h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, 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.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: `ez-box ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow'} simple-crud__container-section` }, 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(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
835
781
  ? undefined
836
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this.enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, this.renderTaskbarContent(), index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, this.renderTaskbarContent(), index$1.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), index$1.h("snk-simple-form-config", { ref: (ref) => this._snkSimpleFormConfig = ref, dataUnit: this.dataUnit, onSnkConfigSaved: this.handleFormConfigSaved.bind(this), configName: (_a = this.formLegacyConfigName) !== null && _a !== void 0 ? _a : this.configName })), 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() }))));
782
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this.enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, this.renderTaskbarContent(), index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, this.renderTaskbarContent(), index.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), index.h("snk-simple-form-config", { ref: (ref) => this._snkSimpleFormConfig = ref, dataUnit: this.dataUnit, onSnkConfigSaved: this.handleFormConfigSaved.bind(this), configName: (_a = this.formLegacyConfigName) !== null && _a !== void 0 ? _a : this.configName })), 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() }))));
837
783
  }
838
- get _element() { return index$1.getElement(this); }
784
+ get _element() { return index.getElement(this); }
839
785
  static get watchers() { return {
840
786
  "resourceID": ["handleResourceIDChanged"],
841
787
  "entityName": ["onChangeEntityName"],
@@ -5,8 +5,8 @@ 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-9ad1f9c0.js');
9
- const index$1 = require('./index-1dfc7a6e.js');
8
+ const taskbarElements = require('./taskbar-elements-7e19882d.js');
9
+ const index$1 = require('./index-e3e39724.js');
10
10
  require('./index-102ba62d.js');
11
11
 
12
12
  const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex;flex-wrap:wrap}.no-wrap.sc-snk-taskbar-h{flex-wrap:nowrap}.full-width.sc-snk-taskbar-h{width:100%}.align-right.sc-snk-taskbar-h{justify-content:flex-end}.overflowed.sc-snk-taskbar{display:none}";
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const index = require('./index-f9e81701.js');
4
- const index$2 = require('./index-1dfc7a6e.js');
4
+ const index$2 = require('./index-e3e39724.js');
5
5
  const index$1 = require('./index-102ba62d.js');
6
6
 
7
7
  exports.TaskbarElement = void 0;
@@ -10,17 +10,11 @@ export default class ClientSideExporterStrategy {
10
10
  const visibleColumns = getVisibleColumns(columns);
11
11
  return visibleColumns;
12
12
  }
13
- async getColumns(resolveProps) {
14
- var _a;
15
- if ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) {
16
- return await this.getParsedColumns();
17
- }
18
- return await this._provider.getColumnsMetadata();
19
- }
20
13
  async executeExport(resolveProps) {
14
+ var _a;
21
15
  const { methodName, gridTitle } = resolveProps;
22
- const records = await this._provider.getRecords();
23
- const columns = await this.getColumns(resolveProps);
16
+ const records = await this._provider.getRecords(resolveProps.type);
17
+ const columns = ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
24
18
  const [serviceName, processor] = this.getExecutor(methodName);
25
19
  const payload = {
26
20
  serviceName,
@@ -2,6 +2,7 @@ import { CommonsExporter } from "../interfaces/IExporterProvider";
2
2
  import { UserInterface } from "@sankhyalabs/core";
3
3
  import { getSelectedRecordsIDsInfo as getSelectedIDs } from '../../../lib/utils/GetSelectedRecordsIDsInfo';
4
4
  import { DataExporterOption } from "../../../lib/@types";
5
+ import { IExportType } from "../../../lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams";
5
6
  export default class ClientSideExporterProvider extends CommonsExporter {
6
7
  getSelectedNumber() {
7
8
  return this.dataUnit.getSelectionInfo().length;
@@ -18,13 +19,24 @@ export default class ClientSideExporterProvider extends CommonsExporter {
18
19
  var _a, _b, _c;
19
20
  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__;
20
21
  }
21
- async getRecords() {
22
- if (this.dataUnit.records.length === 0) {
23
- return Promise.resolve([]);
22
+ async getRecords(exportType) {
23
+ if (this.dataUnit.records.length === 0)
24
+ return [];
25
+ switch (exportType) {
26
+ case IExportType.ALL:
27
+ return this.dataUnit.getSelectionInfo().getAllRecords();
28
+ case IExportType.SELECTION:
29
+ return this.resolveRecordsFromSelection();
30
+ case IExportType.PAGE:
31
+ return this.dataUnit.records;
32
+ default:
33
+ return this.resolveRecordsFromSelection();
24
34
  }
35
+ }
36
+ resolveRecordsFromSelection() {
25
37
  const selectionInfo = this.dataUnit.getSelectionInfo();
26
- const records = selectionInfo.isEmpty() || selectionInfo.isAllRecords() ? await selectionInfo.getAllRecords() : selectionInfo.records;
27
- return Promise.resolve(records == undefined ? [] : records);
38
+ const selectionRecords = selectionInfo.isEmpty() || selectionInfo.isAllRecords() ? selectionInfo.getAllRecords() : selectionInfo.records;
39
+ return selectionRecords.length ? selectionRecords : this.dataUnit.records;
28
40
  }
29
41
  getHiddenOptions() {
30
42
  return [
@@ -1,6 +1,7 @@
1
1
  import { ApplicationContext, DataType, ElementIDUtils } from '@sankhyalabs/core';
2
2
  import { h, Host } from '@stencil/core';
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
+ import { IExportType } from '../../lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams';
4
5
  import { ItemBuilder } from './structure/ItemBuilder';
5
6
  import { DataExporterFormat, DataExporterOption, DataExporterType } from '../../lib/@types';
6
7
  import { REPORT_LAUNCHER_RESOURCE_ID } from '../../lib/utils/constants';
@@ -105,7 +106,9 @@ export class SnkDataExporter {
105
106
  });
106
107
  }
107
108
  getExporterStrategy() {
108
- return this.provider.getRecords == undefined ? new ServerSideExporterStrategy(this.provider) : new ClientSideExporterStrategy(this.provider);
109
+ return this.provider.getRecords == undefined
110
+ ? new ServerSideExporterStrategy(this.provider)
111
+ : new ClientSideExporterStrategy(this.provider);
109
112
  }
110
113
  getOptionKey(option) {
111
114
  return Object.keys(DataExporterOption)
@@ -115,12 +118,12 @@ export class SnkDataExporter {
115
118
  }
116
119
  getExportType(option) {
117
120
  if (option === DataExporterOption.EXPORT_ALL_RECORDS_TO_PDF || option === DataExporterOption.EXPORT_ALL_RECORDS_TO_XLS) {
118
- return 'all';
121
+ return IExportType.ALL;
119
122
  }
120
123
  if (option === DataExporterOption.EXPORT_PAGE_TO_PDF || option === DataExporterOption.EXPORT_PAGE_TO_XLS) {
121
- return 'page';
124
+ return IExportType.PAGE;
122
125
  }
123
- return 'selection';
126
+ return IExportType.SELECTION;
124
127
  }
125
128
  async dispatchExporter(option) {
126
129
  var _a, _b, _c;
@@ -32,4 +32,10 @@
32
32
 
33
33
  .snk-grid-container__without-shadow {
34
34
  --ezgrid__container--shadow: unset;
35
+ }
36
+
37
+ .snk-grid-container__footer {
38
+ background-color: var(--background--xlight, #FFF);
39
+ border-radius: 0 0 var(--border--radius-medium) var(--border--radius-medium);
40
+ box-shadow: var(--shadow--small);
35
41
  }
@@ -2,7 +2,7 @@ import { h, Fragment, } from '@stencil/core';
2
2
  import { Action as DUAction, ApplicationContext, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
3
3
  import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
4
4
  import { ConfigStorage } from '../../lib/configs/ConfigStorage';
5
- import { PresentationMode } from '../../lib/@types';
5
+ import { ExporterStrategy, PresentationMode } from '../../lib/@types';
6
6
  import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
7
7
  import store from "../../lib/store";
8
8
  import SnkMultiSelectionListDataSource from './filtercolumn/SnkMultiSelectionListDataSource';
@@ -12,6 +12,7 @@ import { CrudUtils } from '../../lib';
12
12
  import RmPrecisionCustomValueFormatter from '../../lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter';
13
13
  import ServerSideExporterProvider from '../snk-data-exporter/providers/ServerSideExporterProvider';
14
14
  import { ContinuousInsertUtils } from '../../lib/utils/ContinuousInsertUtils';
15
+ import ClientSideExporterProvider from '../snk-data-exporter/providers/ClientSideExporterProvider';
15
16
  export class SnkGrid {
16
17
  constructor() {
17
18
  this._customEditors = new Map();
@@ -76,6 +77,7 @@ export class SnkGrid {
76
77
  this.autoFocus = true;
77
78
  this.enableGridInsert = false;
78
79
  this.outlineMode = false;
80
+ this.strategyExporter = ExporterStrategy.SERVER_SIDE;
79
81
  }
80
82
  reloadConfig() {
81
83
  this.loadConfig();
@@ -255,7 +257,9 @@ export class SnkGrid {
255
257
  evt.stopPropagation();
256
258
  }
257
259
  async dataExporterProviderStore() {
258
- const dataExporterProvider = new ServerSideExporterProvider(this._dataUnit, this._grid);
260
+ const dataExporterProvider = this.strategyExporter === ExporterStrategy.SERVER_SIDE
261
+ ? new ServerSideExporterProvider(this._dataUnit, this._grid)
262
+ : new ClientSideExporterProvider(this._dataUnit, this._grid);
259
263
  store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
260
264
  }
261
265
  addElementID() {
@@ -481,7 +485,7 @@ export class SnkGrid {
481
485
  return undefined;
482
486
  }
483
487
  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--extra-small" }, this._showSnkFilterBar &&
484
- h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, 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, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp }), 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, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), 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), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
488
+ h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, 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, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp }), 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, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), 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 snk-grid-container__footer" }, 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), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
485
489
  }
486
490
  static get is() { return "snk-grid"; }
487
491
  static get encapsulation() { return "scoped"; }
@@ -999,6 +1003,29 @@ export class SnkGrid {
999
1003
  "attribute": "outline-mode",
1000
1004
  "reflect": false,
1001
1005
  "defaultValue": "false"
1006
+ },
1007
+ "strategyExporter": {
1008
+ "type": "string",
1009
+ "mutable": true,
1010
+ "complexType": {
1011
+ "original": "IExporterStrategyMode",
1012
+ "resolved": "\"ClientSideExporterStrategy\" | \"ServerSideExporterStrategy\"",
1013
+ "references": {
1014
+ "IExporterStrategyMode": {
1015
+ "location": "import",
1016
+ "path": "../snk-data-exporter/interfaces/IRecordID"
1017
+ }
1018
+ }
1019
+ },
1020
+ "required": false,
1021
+ "optional": false,
1022
+ "docs": {
1023
+ "tags": [],
1024
+ "text": "Modo de exporta\u00E7\u00E3o dos dados."
1025
+ },
1026
+ "attribute": "strategy-exporter",
1027
+ "reflect": false,
1028
+ "defaultValue": "ExporterStrategy.SERVER_SIDE"
1002
1029
  }
1003
1030
  };
1004
1031
  }
@@ -35,3 +35,8 @@ export var DataExporterType;
35
35
  DataExporterType["EXPORT_PDF_TO_EMAIL"] = "PDF";
36
36
  DataExporterType["EXPORT_XLS_TO_EMAIL"] = "XLS";
37
37
  })(DataExporterType || (DataExporterType = {}));
38
+ export var ExporterStrategy;
39
+ (function (ExporterStrategy) {
40
+ ExporterStrategy["SERVER_SIDE"] = "ServerSideExporterStrategy";
41
+ ExporterStrategy["CLIENT_SIDE"] = "ClientSideExporterStrategy";
42
+ })(ExporterStrategy || (ExporterStrategy = {}));
@@ -1 +1,6 @@
1
- export {};
1
+ export var IExportType;
2
+ (function (IExportType) {
3
+ IExportType["ALL"] = "all";
4
+ IExportType["PAGE"] = "page";
5
+ IExportType["SELECTION"] = "selection";
6
+ })(IExportType || (IExportType = {}));