@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-kb-80398.0 → 0.0.0-bugfix-dev-KB-83020.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) 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-application.cjs.entry.js +8 -1
  9. package/dist/cjs/snk-attach.cjs.entry.js +2 -2
  10. package/dist/cjs/snk-crud.cjs.entry.js +4 -14
  11. package/dist/cjs/snk-data-exporter.cjs.entry.js +11 -14
  12. package/dist/cjs/snk-detail-view.cjs.entry.js +3 -3
  13. package/dist/cjs/snk-grid.cjs.entry.js +16 -12
  14. package/dist/cjs/{snk-guides-viewer-bff0d27d.js → snk-guides-viewer-a029ff50.js} +2 -2
  15. package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
  16. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  17. package/dist/cjs/snk-simple-crud.cjs.entry.js +29 -83
  18. package/dist/cjs/snk-taskbar.cjs.entry.js +2 -2
  19. package/dist/cjs/{taskbar-elements-9ad1f9c0.js → taskbar-elements-7e19882d.js} +1 -1
  20. package/dist/collection/components/snk-application/snk-application.js +8 -1
  21. package/dist/collection/components/snk-crud/snk-crud.js +26 -12
  22. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +3 -9
  23. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +17 -5
  24. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +7 -4
  25. package/dist/collection/components/snk-grid/snk-grid.css +6 -0
  26. package/dist/collection/components/snk-grid/snk-grid.js +30 -3
  27. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +25 -8
  28. package/dist/collection/lib/@types/index.js +5 -0
  29. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.js +6 -1
  30. package/dist/components/ContinuousInsertUtils.js +70 -2
  31. package/dist/components/ISave.js +6 -1
  32. package/dist/components/snk-application2.js +8 -1
  33. package/dist/components/snk-crud.js +4 -13
  34. package/dist/components/snk-data-exporter2.js +17 -14
  35. package/dist/components/snk-grid2.js +9 -5
  36. package/dist/components/snk-simple-crud2.js +10 -66
  37. package/dist/esm/{ContinuousInsertUtils-6bf78c5e.js → ClientSideExporterProvider-ff89c7e9.js} +70 -2
  38. package/dist/esm/IFetchDataExporterParams-d73bed3d.js +8 -0
  39. package/dist/esm/{index-3aa4977a.js → index-b40568ff.js} +6 -1
  40. package/dist/esm/loader.js +1 -1
  41. package/dist/esm/pesquisa-grid_2.entry.js +1 -1
  42. package/dist/esm/sankhyablocks.js +1 -1
  43. package/dist/esm/snk-actions-button_5.entry.js +1 -1
  44. package/dist/esm/snk-application.entry.js +8 -1
  45. package/dist/esm/snk-attach.entry.js +2 -2
  46. package/dist/esm/snk-crud.entry.js +4 -14
  47. package/dist/esm/snk-data-exporter.entry.js +11 -14
  48. package/dist/esm/snk-detail-view.entry.js +3 -3
  49. package/dist/esm/snk-grid.entry.js +10 -6
  50. package/dist/esm/{snk-guides-viewer-454ebc07.js → snk-guides-viewer-fa45714d.js} +2 -2
  51. package/dist/esm/snk-guides-viewer.entry.js +3 -3
  52. package/dist/esm/snk-pesquisa.entry.js +1 -1
  53. package/dist/esm/snk-simple-crud.entry.js +12 -66
  54. package/dist/esm/snk-taskbar.entry.js +2 -2
  55. package/dist/esm/{taskbar-elements-d59867f1.js → taskbar-elements-d2353c64.js} +1 -1
  56. package/dist/sankhyablocks/{p-643b2aaa.entry.js → p-0b00d69c.entry.js} +1 -1
  57. package/dist/sankhyablocks/p-0f3698af.js +1 -0
  58. package/dist/sankhyablocks/{p-9a99c67b.entry.js → p-172848d4.entry.js} +1 -1
  59. package/dist/sankhyablocks/{p-7e7a7473.js → p-3fc82614.js} +1 -1
  60. package/dist/sankhyablocks/p-40e323f9.js +1 -0
  61. package/dist/sankhyablocks/p-700a4cc3.entry.js +1 -0
  62. package/dist/sankhyablocks/p-8f3f2306.js +1 -0
  63. package/dist/sankhyablocks/{p-28ca3908.entry.js → p-a962a3e4.entry.js} +1 -1
  64. package/dist/sankhyablocks/p-aa1a0f3e.entry.js +1 -0
  65. package/dist/sankhyablocks/{p-73b037a8.entry.js → p-b02e58fd.entry.js} +1 -1
  66. package/dist/sankhyablocks/{p-50bf8dbc.entry.js → p-b0ff53b7.entry.js} +1 -1
  67. package/dist/sankhyablocks/{p-91e34755.entry.js → p-c82deea7.entry.js} +1 -1
  68. package/dist/sankhyablocks/{p-bd234604.entry.js → p-d2d0535f.entry.js} +1 -1
  69. package/dist/sankhyablocks/{p-478ab2b6.js → p-de9da2f2.js} +1 -1
  70. package/dist/sankhyablocks/p-e10faff0.entry.js +11 -0
  71. package/dist/sankhyablocks/p-e36f89d1.entry.js +1 -0
  72. package/dist/sankhyablocks/p-e718fb81.entry.js +1 -0
  73. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  74. package/dist/types/components/snk-crud/snk-crud.d.ts +5 -0
  75. package/dist/types/components/snk-data-exporter/data/export-result.d.ts +2 -1
  76. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +0 -1
  77. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +2 -1
  78. package/dist/types/components/snk-data-exporter/interfaces/IRecordID.d.ts +1 -0
  79. package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +3 -1
  80. package/dist/types/components/snk-grid/snk-grid.d.ts +5 -0
  81. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +1 -1
  82. package/dist/types/components.d.ts +19 -1
  83. package/dist/types/lib/@types/index.d.ts +4 -0
  84. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +5 -1
  85. package/package.json +1 -1
  86. package/dist/sankhyablocks/p-03e6825e.js +0 -1
  87. package/dist/sankhyablocks/p-30cf616e.js +0 -1
  88. package/dist/sankhyablocks/p-6fc8bfa2.entry.js +0 -1
  89. package/dist/sankhyablocks/p-8ad7c8bc.entry.js +0 -1
  90. package/dist/sankhyablocks/p-a04f38aa.entry.js +0 -1
  91. package/dist/sankhyablocks/p-ae26e8d0.entry.js +0 -1
  92. package/dist/sankhyablocks/p-d9bb48c4.entry.js +0 -11
@@ -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();
@@ -124,7 +70,7 @@ const SnkSimpleCrud = class {
124
70
  this.formConfig = undefined;
125
71
  this._formFields = [];
126
72
  this._fieldsProps = new Map();
127
- this._enableContinuousInsert = true;
73
+ this.enableContinuousInsert = false;
128
74
  this.multipleSelection = undefined;
129
75
  this.useCancelConfirm = true;
130
76
  this.pageSize = 150;
@@ -408,10 +354,10 @@ 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
- this._continuousInsertUtils.getConfig().then(value => this._enableContinuousInsert = value);
360
+ this._continuousInsertUtils.getConfig().then(value => this.enableContinuousInsert = value);
415
361
  }
416
362
  }
417
363
  componentDidLoad() {
@@ -663,9 +609,9 @@ const SnkSimpleCrud = class {
663
609
  : this.getFieldSearch(actionButton, item)
664
610
  }];
665
611
  if (this.enableGridInsert) {
666
- hardList.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert, () => {
667
- this._enableContinuousInsert = !this._enableContinuousInsert;
668
- this._continuousInsertUtils.handleSaveConfig(this._enableContinuousInsert);
612
+ hardList.push(this._continuousInsertUtils.actionContinuousInsert(this.enableContinuousInsert, () => {
613
+ this.enableContinuousInsert = !this.enableContinuousInsert;
614
+ this._continuousInsertUtils.handleSaveConfig(this.enableContinuousInsert);
669
615
  }));
670
616
  }
671
617
  if (this.isGridInsertActive())
@@ -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;
@@ -176,7 +176,14 @@ export class SnkApplication {
176
176
  const allAccess = {};
177
177
  allAccess['isSup'] = auths.isSup;
178
178
  Object.entries(AutorizationType).forEach((data) => {
179
- allAccess[data[0]] = auths.actions[data[1]] || false;
179
+ if (data[1] === AutorizationType.CLONE) {
180
+ const insertPermission = auths.actions[AutorizationType.INSERT] || false;
181
+ const clonePermission = auths.actions[AutorizationType.CLONE] || false;
182
+ allAccess[data[0]] = insertPermission && clonePermission;
183
+ }
184
+ else {
185
+ allAccess[data[0]] = auths.actions[data[1]] || false;
186
+ }
180
187
  });
181
188
  resolve(allAccess);
182
189
  }).catch(error => reject(error));
@@ -4,6 +4,7 @@ import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
4
4
  import { PresentationMode } from '../../lib';
5
5
  import { VIEW_MODE } from '../../lib/utils/constants';
6
6
  import { AutorizationType } from '../../lib/http/data-fetcher/fetchers/auth-fetcher';
7
+ import { ExporterStrategy } from '../../lib/@types';
7
8
  /**
8
9
  * É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
9
10
  * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
@@ -45,6 +46,7 @@ export class SnkCrud {
45
46
  this.domainMessagesBuilder = undefined;
46
47
  this.ignoreReadOnlyFormFields = undefined;
47
48
  this.setCustomFormTitle = undefined;
49
+ this.strategyExporter = ExporterStrategy.SERVER_SIDE;
48
50
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
49
51
  }
50
52
  /**
@@ -297,15 +299,6 @@ export class SnkCrud {
297
299
  .bind("F8", handleAddRecord.bind(this), { description: "Adiciona um novo registro.", element: this._element })
298
300
  .bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
299
301
  .bind("ctrl + F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
300
- .bind("ctrl + .", () => {
301
- if (dataUnit.getSelectionInfo().records.length === 0) {
302
- return dataUnit.selectFirst();
303
- }
304
- return dataUnit.nextRecord();
305
- }, {
306
- description: "Avança para o próximo registro.", element: this._element
307
- })
308
- .bind("ctrl + ,", dataUnit.previousRecord.bind(dataUnit), { description: "Retorna ao registro anterior.", element: this._element })
309
302
  .bind("F5", async () => {
310
303
  const currentView = await this._viewStack.getSelectedIndex();
311
304
  if (VIEW_MODE.GRID === currentView) {
@@ -333,8 +326,6 @@ export class SnkCrud {
333
326
  .unbind("F8")
334
327
  .unbind("F9")
335
328
  .unbind("ctrl + F9")
336
- .unbind("ctrl + .")
337
- .unbind("ctrl + ,")
338
329
  .unbind("F5")
339
330
  .unbind("Escape");
340
331
  }
@@ -391,7 +382,7 @@ export class SnkCrud {
391
382
  return;
392
383
  }
393
384
  this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
394
- return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
385
+ return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
395
386
  }
396
387
  static get is() { return "snk-crud"; }
397
388
  static get encapsulation() { return "scoped"; }
@@ -850,6 +841,29 @@ export class SnkCrud {
850
841
  "tags": [],
851
842
  "text": "Define uma fun\u00E7\u00E3o para configurar um t\u00EDtulo cusotmizado no modo formul\u00E1rio."
852
843
  }
844
+ },
845
+ "strategyExporter": {
846
+ "type": "string",
847
+ "mutable": true,
848
+ "complexType": {
849
+ "original": "IExporterStrategyMode",
850
+ "resolved": "\"ClientSideExporterStrategy\" | \"ServerSideExporterStrategy\"",
851
+ "references": {
852
+ "IExporterStrategyMode": {
853
+ "location": "import",
854
+ "path": "../snk-data-exporter/interfaces/IRecordID"
855
+ }
856
+ }
857
+ },
858
+ "required": false,
859
+ "optional": false,
860
+ "docs": {
861
+ "tags": [],
862
+ "text": "Modo de exporta\u00E7\u00E3o dos dados."
863
+ },
864
+ "attribute": "strategy-exporter",
865
+ "reflect": false,
866
+ "defaultValue": "ExporterStrategy.SERVER_SIDE"
853
867
  }
854
868
  };
855
869
  }
@@ -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
  }