@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-63774.0 → 0.0.0-bugfix-dev-KB-55889.1

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 (115) hide show
  1. package/dist/cjs/{ContinuousInsertUtils-807730a8.js → IExporterProvider-9ac15aaf.js} +3 -36
  2. package/dist/cjs/{SnkMessageBuilder-bae64d0d.js → SnkMessageBuilder-cceebbae.js} +1 -5
  3. package/dist/cjs/{dataunit-fetcher-f89461c1.js → dataunit-fetcher-4b12f70c.js} +17 -45
  4. package/dist/cjs/{field-search-68e34bf4.js → field-search-f56aa7d6.js} +1 -5
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  7. package/dist/cjs/snk-actions-button_4.cjs.entry.js +1 -1
  8. package/dist/cjs/snk-application.cjs.entry.js +2 -2
  9. package/dist/cjs/snk-attach.cjs.entry.js +4 -2
  10. package/dist/cjs/snk-crud.cjs.entry.js +2 -5
  11. package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
  12. package/dist/cjs/{snk-data-unit-47202e42.js → snk-data-unit-ed17da6b.js} +18 -24
  13. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  14. package/dist/cjs/snk-detail-view.cjs.entry.js +4 -4
  15. package/dist/cjs/snk-filter-bar.cjs.entry.js +15 -19
  16. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
  17. package/dist/cjs/snk-grid.cjs.entry.js +14 -54
  18. package/dist/cjs/{snk-guides-viewer-68777d37.js → snk-guides-viewer-866447ab.js} +4 -8
  19. package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
  20. package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
  21. package/dist/cjs/snk-simple-crud.cjs.entry.js +13 -45
  22. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +4 -2
  23. package/dist/collection/components/snk-crud/snk-crud.js +1 -22
  24. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +2 -24
  25. package/dist/collection/components/snk-data-unit/snk-data-unit.js +16 -22
  26. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +1 -1
  27. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
  28. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +14 -44
  29. package/dist/collection/components/snk-grid/snk-grid.css +1 -1
  30. package/dist/collection/components/snk-grid/snk-grid.js +7 -67
  31. package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +1 -1
  32. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +1 -0
  33. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +9 -60
  34. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +1 -5
  35. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +3 -3
  36. package/dist/collection/lib/dataUnit/InMemoryLoader.js +4 -2
  37. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +9 -34
  38. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +2 -9
  39. package/dist/collection/lib/message/resources/snk-grid.msg.js +1 -5
  40. package/dist/components/{ContinuousInsertUtils.js → IExporterProvider.js} +5 -40
  41. package/dist/components/SnkMessageBuilder.js +1 -5
  42. package/dist/components/dataunit-fetcher.js +15 -45
  43. package/dist/components/snk-attach2.js +4 -2
  44. package/dist/components/snk-crud.js +1 -5
  45. package/dist/components/snk-data-unit2.js +17 -23
  46. package/dist/components/snk-detail-view2.js +3 -8
  47. package/dist/components/snk-filter-bar2.js +15 -20
  48. package/dist/components/snk-filter-checkbox-list.js +1 -1
  49. package/dist/components/snk-grid2.js +8 -50
  50. package/dist/components/snk-simple-bar2.js +1 -1
  51. package/dist/components/snk-simple-crud2.js +7 -41
  52. package/dist/esm/{ContinuousInsertUtils-1a82a768.js → IExporterProvider-09df2e3e.js} +5 -37
  53. package/dist/esm/{SnkMessageBuilder-6fff4a4c.js → SnkMessageBuilder-ae87b754.js} +1 -5
  54. package/dist/esm/{dataunit-fetcher-c24c76c6.js → dataunit-fetcher-3aac1a53.js} +15 -45
  55. package/dist/esm/{field-search-f8b1d91e.js → field-search-efbe307f.js} +1 -5
  56. package/dist/esm/loader.js +1 -1
  57. package/dist/esm/sankhyablocks.js +1 -1
  58. package/dist/esm/snk-actions-button_4.entry.js +1 -1
  59. package/dist/esm/snk-application.entry.js +2 -2
  60. package/dist/esm/snk-attach.entry.js +4 -2
  61. package/dist/esm/snk-crud.entry.js +2 -5
  62. package/dist/esm/snk-data-exporter.entry.js +3 -3
  63. package/dist/esm/{snk-data-unit-de45e0e1.js → snk-data-unit-6888df8f.js} +18 -24
  64. package/dist/esm/snk-data-unit.entry.js +3 -3
  65. package/dist/esm/snk-detail-view.entry.js +4 -4
  66. package/dist/esm/snk-filter-bar.entry.js +15 -19
  67. package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
  68. package/dist/esm/snk-grid.entry.js +9 -49
  69. package/dist/esm/{snk-guides-viewer-b5dd30e6.js → snk-guides-viewer-cb8a0b48.js} +4 -8
  70. package/dist/esm/snk-guides-viewer.entry.js +3 -3
  71. package/dist/esm/snk-simple-bar.entry.js +1 -1
  72. package/dist/esm/snk-simple-crud.entry.js +9 -41
  73. package/dist/sankhyablocks/p-0e9a872d.entry.js +1 -0
  74. package/dist/sankhyablocks/{p-694e1c4a.entry.js → p-16969508.entry.js} +1 -1
  75. package/dist/sankhyablocks/p-1ab19772.js +1 -0
  76. package/dist/sankhyablocks/p-1f47a0b2.entry.js +1 -0
  77. package/dist/sankhyablocks/p-3757394b.entry.js +1 -0
  78. package/dist/sankhyablocks/{p-eb9f0407.entry.js → p-3d542b58.entry.js} +1 -1
  79. package/dist/sankhyablocks/{p-da34270e.entry.js → p-439a50fb.entry.js} +1 -1
  80. package/dist/sankhyablocks/p-53c1d25d.entry.js +1 -0
  81. package/dist/sankhyablocks/{p-62e048c6.entry.js → p-559bfb9b.entry.js} +1 -1
  82. package/dist/sankhyablocks/{p-a42e7a1e.entry.js → p-640140b3.entry.js} +1 -1
  83. package/dist/sankhyablocks/p-7c4aabe2.js +1 -0
  84. package/dist/sankhyablocks/p-88aa931b.entry.js +1 -0
  85. package/dist/sankhyablocks/{p-bccfc262.js → p-9cbef862.js} +1 -1
  86. package/dist/sankhyablocks/p-a31e761f.js +1 -0
  87. package/dist/sankhyablocks/{p-5f157b09.entry.js → p-aaa3ee68.entry.js} +1 -1
  88. package/dist/sankhyablocks/p-b2caaaf9.entry.js +1 -0
  89. package/dist/sankhyablocks/{p-7eef0898.entry.js → p-bc4b94d2.entry.js} +1 -1
  90. package/dist/sankhyablocks/p-c2495304.js +1 -0
  91. package/dist/sankhyablocks/p-f8698ad3.js +60 -0
  92. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  93. package/dist/types/components/snk-crud/snk-crud.d.ts +0 -4
  94. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +0 -5
  95. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +2 -2
  96. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +0 -4
  97. package/dist/types/components/snk-grid/snk-grid.d.ts +0 -12
  98. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -10
  99. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +0 -1
  100. package/dist/types/components.d.ts +0 -40
  101. package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +2 -12
  102. package/package.json +1 -1
  103. package/dist/collection/lib/utils/ContinuousInsertUtils.js +0 -31
  104. package/dist/sankhyablocks/p-0035ad6e.entry.js +0 -1
  105. package/dist/sankhyablocks/p-0911e61a.entry.js +0 -1
  106. package/dist/sankhyablocks/p-17425c72.js +0 -1
  107. package/dist/sankhyablocks/p-23736d75.js +0 -1
  108. package/dist/sankhyablocks/p-3ae9d08a.js +0 -1
  109. package/dist/sankhyablocks/p-3e3cc017.js +0 -1
  110. package/dist/sankhyablocks/p-50779ad3.entry.js +0 -1
  111. package/dist/sankhyablocks/p-7ac7932c.js +0 -60
  112. package/dist/sankhyablocks/p-b9679243.entry.js +0 -1
  113. package/dist/sankhyablocks/p-c2e468c9.entry.js +0 -1
  114. package/dist/sankhyablocks/p-e16e87fc.entry.js +0 -1
  115. package/dist/types/lib/utils/ContinuousInsertUtils.d.ts +0 -10
@@ -9,15 +9,15 @@ const constants = require('./constants-35ddd366.js');
9
9
  const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
10
10
  require('./DataFetcher-cadeef8e.js');
11
11
  require('./pesquisa-fetcher-ca89181c.js');
12
- const ContinuousInsertUtils = require('./ContinuousInsertUtils-807730a8.js');
12
+ const IExporterProvider = require('./IExporterProvider-9ac15aaf.js');
13
13
  const index = require('./index-1dfc7a6e.js');
14
14
  require('./ISave-e91b70a7.js');
15
15
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
16
16
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
17
- const dataunitFetcher = require('./dataunit-fetcher-f89461c1.js');
17
+ const dataunitFetcher = require('./dataunit-fetcher-4b12f70c.js');
18
18
  require('./filter-item-type.enum-a7ffdaa6.js');
19
19
  const formConfigFetcher = require('./form-config-fetcher-ed497282.js');
20
- const fieldSearch = require('./field-search-68e34bf4.js');
20
+ const fieldSearch = require('./field-search-f56aa7d6.js');
21
21
  const ConfigStorage = require('./ConfigStorage-ecc0ed20.js');
22
22
  const SnkFormConfigManager = require('./SnkFormConfigManager-f1c92f79.js');
23
23
  const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
@@ -31,7 +31,7 @@ require('./ResourceIDUtils-5ff86aa7.js');
31
31
  const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
32
32
  const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
33
33
 
34
- class ClientSideExporterProvider extends ContinuousInsertUtils.CommonsExporter {
34
+ class ClientSideExporterProvider extends IExporterProvider.CommonsExporter {
35
35
  getSelectedNumber() {
36
36
  return this.dataUnit.getSelectionInfo().length;
37
37
  }
@@ -86,7 +86,7 @@ class ClientSideExporterProvider extends ContinuousInsertUtils.CommonsExporter {
86
86
  }
87
87
  }
88
88
 
89
- 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--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";
89
+ const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;row-gap:12px;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";
90
90
 
91
91
  const SnkSimpleCrud = class {
92
92
  constructor(hostRef) {
@@ -97,7 +97,7 @@ const SnkSimpleCrud = class {
97
97
  this.formItemsReady = index$1.createEvent(this, "formItemsReady", 7);
98
98
  this.configuratorSave = index$1.createEvent(this, "configuratorSave", 7);
99
99
  this.configuratorCancel = index$1.createEvent(this, "configuratorCancel", 7);
100
- this._multiSelectionListDataSource = new ContinuousInsertUtils.SnkMultiSelectionListDataSource();
100
+ this._multiSelectionListDataSource = new IExporterProvider.SnkMultiSelectionListDataSource();
101
101
  this._keyDownHandler = (event) => this.keyDownListener(event);
102
102
  this._formConfigFetcher = new formConfigFetcher.FormConfigFetcher();
103
103
  this._customEditors = new Map();
@@ -107,7 +107,7 @@ const SnkSimpleCrud = class {
107
107
  "snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, [taskbarElements.TaskbarElement.DATA_EXPORTER, taskbarElements.TaskbarElement.FORM_MODE]),
108
108
  "snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [taskbarElements.TaskbarElement.GRID_MODE]),
109
109
  "snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, [taskbarElements.TaskbarElement.DATA_EXPORTER, taskbarElements.TaskbarElement.FORM_MODE]),
110
- "snkSimpleCrudTaskbar.finish_edition": this.getFinishEditionButtonsCallback.bind(this)
110
+ "snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
111
111
  });
112
112
  this._showPopUpGridConfig = false;
113
113
  this._showFormConfig = false;
@@ -123,12 +123,10 @@ const SnkSimpleCrud = class {
123
123
  this.formConfig = undefined;
124
124
  this._formFields = [];
125
125
  this._fieldsProps = new Map();
126
- this._enableContinuousInsert = true;
127
126
  this.multipleSelection = undefined;
128
127
  this.useCancelConfirm = true;
129
128
  this.pageSize = 150;
130
129
  this.resourceID = undefined;
131
- this.enableGridInsert = false;
132
130
  this.taskbarManager = undefined;
133
131
  this.messagesBuilder = undefined;
134
132
  this.useEnterLikeTab = false;
@@ -198,13 +196,6 @@ const SnkSimpleCrud = class {
198
196
  newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
199
197
  this._fieldsProps = newCustomFieldProps;
200
198
  }
201
- getFinishEditionButtonsCallback() {
202
- const btns = ["CANCEL", "SAVE"];
203
- if (this.enableGridInsert && this._currentViewMode !== constants.VIEW_MODE.ATTACHMENT) {
204
- btns.push(this._currentViewMode === constants.VIEW_MODE.GRID ? taskbarElements.TaskbarElement.FORM_MODE : taskbarElements.TaskbarElement.GRID_MODE);
205
- }
206
- return btns;
207
- }
208
199
  getButtons(selected, extraButtons) {
209
200
  return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
210
201
  .concat(extraButtons));
@@ -408,11 +399,7 @@ const SnkSimpleCrud = class {
408
399
  this.processMetadata();
409
400
  this.onModeChange();
410
401
  this.configDatasource();
411
- this._rmPrecisionCustomValueFormatter = new ContinuousInsertUtils.RmPrecisionCustomValueFormatter();
412
- this._continuousInsertUtils = new ContinuousInsertUtils.ContinuousInsertUtils(this.application, this.resolveResourceID(), this.configName);
413
- if (this.enableGridInsert) {
414
- this._continuousInsertUtils.getConfig().then(value => this._enableContinuousInsert = value);
415
- }
402
+ this._rmPrecisionCustomValueFormatter = new IExporterProvider.RmPrecisionCustomValueFormatter();
416
403
  }
417
404
  componentDidLoad() {
418
405
  utils.CSSVarsUtils.applyVarsGrid(this._element, this._grid);
@@ -647,9 +634,6 @@ const SnkSimpleCrud = class {
647
634
  const options = filteredFields.map(field => ({ value: field.name, label: field.label }));
648
635
  return Promise.resolve(options);
649
636
  }
650
- isGridInsertActive() {
651
- return this.enableGridInsert && this.dataUnit.hasNewRecord();
652
- }
653
637
  getActionsList() {
654
638
  var _a, _b;
655
639
  const hardList = [{
@@ -661,22 +645,11 @@ const SnkSimpleCrud = class {
661
645
  ? this.getColumnSearch(actionButton, item)
662
646
  : this.getFieldSearch(actionButton, item)
663
647
  }];
664
- if (this.enableGridInsert) {
665
- hardList.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert, this.handleEnableContinuousInsert));
666
- }
667
- if (this.isGridInsertActive())
668
- return hardList;
669
648
  if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
670
649
  const taskbarID = this.getTopTaskBarId();
671
650
  return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this.dataState, this.actionsList));
672
651
  }
673
- if (this.actionsList)
674
- return hardList.concat(this.actionsList);
675
- return hardList;
676
- }
677
- handleEnableContinuousInsert() {
678
- this._enableContinuousInsert = !this._enableContinuousInsert;
679
- this._continuousInsertUtils.handleSaveConfig(this._enableContinuousInsert);
652
+ return hardList.concat(this.actionsList);
680
653
  }
681
654
  getTopTaskBarId() {
682
655
  var _a;
@@ -750,7 +723,7 @@ const SnkSimpleCrud = class {
750
723
  }
751
724
  setGridConfig(config) {
752
725
  this.gridConfig = config;
753
- ContinuousInsertUtils.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
726
+ IExporterProvider.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
754
727
  }
755
728
  setFormConfig(config, forceUpdate) {
756
729
  if (this.formConfig && !forceUpdate)
@@ -795,21 +768,16 @@ const SnkSimpleCrud = class {
795
768
  }
796
769
  this._formConfigManager.setConfig(this.formConfig);
797
770
  }
798
- handleDataUnitOnInsertionMode() {
799
- if (this.enableGridInsert)
800
- return;
801
- this.goToView(constants.VIEW_MODE.FORM);
802
- }
803
771
  /* istanbul ignore next */
804
772
  render() {
805
773
  var _a;
806
774
  if (this.dataUnit == undefined) {
807
775
  return;
808
776
  }
809
- const taskbarContent = (index$1.h("snk-taskbar", { class: this._currentViewMode === constants.VIEW_MODE.FORM && "ez-box ez-box--shadow 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" })));
810
- 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 ez-box--shadow simple-crud__container-section" }, this._currentViewMode === constants.VIEW_MODE.FORM && taskbarContent, 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)
777
+ const taskbarContent = (index$1.h("snk-taskbar", { class: this._currentViewMode === constants.VIEW_MODE.FORM && "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: index.PresentationMode.SECONDARY }, index$1.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
778
+ 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.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, 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 ez-box--shadow simple-crud__container-section" }, this._currentViewMode === constants.VIEW_MODE.FORM && taskbarContent, 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)
811
779
  ? undefined
812
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert }, this._currentViewMode === constants.VIEW_MODE.GRID && taskbarContent, index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, index$1.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index$1.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index$1.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
780
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus }, this._currentViewMode === constants.VIEW_MODE.GRID && taskbarContent, index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, index$1.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index$1.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index$1.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
813
781
  }
814
782
  get _element() { return index$1.getElement(this); }
815
783
  static get watchers() { return {
@@ -3,7 +3,7 @@ import { SaveErrorsEnum } from '../../../../../lib/http/data-fetcher/fetchers/At
3
3
  import { AutorizationType } from '../../../../../lib/http/data-fetcher/fetchers/auth-fetcher';
4
4
  import { attachFetcherMetadataBuilder } from '../../builder/attach-crud-config.builder';
5
5
  import { VIEW_MODE } from '../../../../../lib/utils/constants';
6
- import { buildLoadDataResponse } from '../../../../../lib/dataUnit/dataUnitInMemoryUtils';
6
+ import { applyFilter, applySorting, buildPaginationInfo } from '../../../../../lib/dataUnit/dataUnitInMemoryUtils';
7
7
  const SERVICE_LOAD = "Attach.load";
8
8
  export class AttachFetcherDataUnitFactory {
9
9
  constructor(getMessage) {
@@ -49,7 +49,9 @@ export class AttachFetcherDataUnitFactory {
49
49
  });
50
50
  this._records = records;
51
51
  }
52
- return buildLoadDataResponse(this._records, dataUnit, request);
52
+ let records = applyFilter(this._records, dataUnit, request.filters);
53
+ records = applySorting(records, dataUnit, request.sort);
54
+ return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
53
55
  }
54
56
  saveLoader(changes, fetcher) {
55
57
  return new Promise((resolve) => {
@@ -39,7 +39,6 @@ export class SnkCrud {
39
39
  this.disablePersonalizedFilter = undefined;
40
40
  this.autoLoad = undefined;
41
41
  this.autoFocus = true;
42
- this.enableGridInsert = false;
43
42
  this.domainMessagesBuilder = undefined;
44
43
  this.setCustomFormTitle = undefined;
45
44
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
@@ -166,8 +165,6 @@ export class SnkCrud {
166
165
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
167
166
  }
168
167
  insertionModeHandler() {
169
- if (this.enableGridInsert)
170
- return;
171
168
  this.gridToForm();
172
169
  }
173
170
  cancelHandler() {
@@ -383,7 +380,7 @@ export class SnkCrud {
383
380
  return;
384
381
  }
385
382
  this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
386
- return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, 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 }, 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 }, 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" }))));
383
+ return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, 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 }, 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, getCustomTitle: this.setCustomFormTitle }, 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" }))));
387
384
  }
388
385
  static get is() { return "snk-crud"; }
389
386
  static get encapsulation() { return "scoped"; }
@@ -740,24 +737,6 @@ export class SnkCrud {
740
737
  "reflect": false,
741
738
  "defaultValue": "true"
742
739
  },
743
- "enableGridInsert": {
744
- "type": "boolean",
745
- "mutable": false,
746
- "complexType": {
747
- "original": "boolean",
748
- "resolved": "boolean",
749
- "references": {}
750
- },
751
- "required": false,
752
- "optional": true,
753
- "docs": {
754
- "tags": [],
755
- "text": "Ativa inser\u00E7\u00E3o de registros no modo grade."
756
- },
757
- "attribute": "enable-grid-insert",
758
- "reflect": false,
759
- "defaultValue": "false"
760
- },
761
740
  "domainMessagesBuilder": {
762
741
  "type": "string",
763
742
  "mutable": false,
@@ -27,7 +27,6 @@ export class SnkGuidesViewer {
27
27
  this.resourceID = undefined;
28
28
  this.detailTaskbarCustomContainerId = undefined;
29
29
  this.formLegacyConfigName = undefined;
30
- this.enableGridInsert = false;
31
30
  this.getCustomTitle = undefined;
32
31
  this._hasToCreateFieldSearch = true;
33
32
  this._breadcrumbItems = [];
@@ -97,7 +96,7 @@ export class SnkGuidesViewer {
97
96
  this._container.focus();
98
97
  }
99
98
  exitViewer() {
100
- if (!this.enableGridInsert && this.dataUnit.isDirty()) {
99
+ if (this.dataUnit.isDirty()) {
101
100
  this.dataUnit.cancelEdition({ after: () => this.exit.emit() });
102
101
  }
103
102
  else {
@@ -206,13 +205,10 @@ export class SnkGuidesViewer {
206
205
  const invisibleButtons = this.getInvisibleButtons();
207
206
  this._taskbarProcessor = new TaskbarProcessor({
208
207
  "snkGuideViewer.regular": btnsRegularMode,
209
- "snkGuideViewer.finish_edition": ["CANCEL", "SAVE", this.handleAddGridMode()],
208
+ "snkGuideViewer.finish_edition": ["CANCEL", "SAVE"],
210
209
  });
211
210
  this._taskbarProcessor.process(taskbarId, this.taskbarManager, this.dataState, disabledButtons, invisibleButtons);
212
211
  }
213
- handleAddGridMode() {
214
- return this.enableGridInsert ? TaskbarElement.GRID_MODE : "";
215
- }
216
212
  getInvisibleButtons() {
217
213
  const invisibleButtons = [];
218
214
  if (this.dataState && this.dataState.selectionInfo.mode === SelectionMode.ALL_RECORDS)
@@ -807,24 +803,6 @@ export class SnkGuidesViewer {
807
803
  "attribute": "form-legacy-config-name",
808
804
  "reflect": false
809
805
  },
810
- "enableGridInsert": {
811
- "type": "boolean",
812
- "mutable": false,
813
- "complexType": {
814
- "original": "boolean",
815
- "resolved": "boolean",
816
- "references": {}
817
- },
818
- "required": false,
819
- "optional": true,
820
- "docs": {
821
- "tags": [],
822
- "text": "Ativa inser\u00E7\u00E3o de registros no modo grade."
823
- },
824
- "attribute": "enable-grid-insert",
825
- "reflect": false,
826
- "defaultValue": "false"
827
- },
828
806
  "getCustomTitle": {
829
807
  "type": "unknown",
830
808
  "mutable": false,
@@ -479,14 +479,7 @@ export class SnkDataUnit {
479
479
  }
480
480
  handleRecordsRemoved(action) {
481
481
  var _a, _b;
482
- const cachedRecords = action.payload.cachedRecords;
483
- let removeFinishMsg;
484
- if ((cachedRecords === null || cachedRecords === void 0 ? void 0 : cachedRecords.length) > 1) {
485
- removeFinishMsg = this.getMessage("snkDataUnit.removeAllInfo", { size: cachedRecords.length });
486
- }
487
- else {
488
- removeFinishMsg = this.getMessage("snkDataUnit.removeInfo", action.payload.cachedRecords[0]);
489
- }
482
+ let removeFinishMsg = this.buildRemoveFinishMessage(action);
490
483
  if (removeFinishMsg != undefined) {
491
484
  this.showSuccessMessage(removeFinishMsg);
492
485
  }
@@ -497,6 +490,14 @@ export class SnkDataUnit {
497
490
  this.dataUnit.gotoPage(page);
498
491
  }
499
492
  }
493
+ buildRemoveFinishMessage(action) {
494
+ const records = action.payload.records;
495
+ if (!records || !records.length)
496
+ return undefined;
497
+ if ((records === null || records === void 0 ? void 0 : records.length) > 1)
498
+ return this.getMessage('snkDataUnit.removeAllInfo', { size: records.length });
499
+ return this.getMessage('snkDataUnit.removeInfo', records);
500
+ }
500
501
  /**
501
502
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
502
503
  * através de um pequeno modulo na estrutura da aplicação:
@@ -540,26 +541,19 @@ export class SnkDataUnit {
540
541
  return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
541
542
  }
542
543
  }
543
- updateMetadataWithRMP() {
544
- this.fillFieldsWithRmp(this.dataUnit.metadata);
545
- this.fillFieldsWithRmPrecision(this.dataUnit.metadata);
546
- const dataUnitUpdatedMetadata = this.handleDULinksOnMetadataLoaded(this.dataUnit.metadata);
547
- this.dataUnit.metadata = dataUnitUpdatedMetadata;
548
- }
549
- async loadDataUnit() {
550
- var _a, _b;
544
+ async loadDataUnit(forceMetadataLoad = true) {
545
+ var _a;
551
546
  if (this.dataUnit == null && this._application && this.entityName) {
552
547
  this.dataUnit = await this.getDataUnitParentOrChild();
553
548
  }
554
549
  if (this.dataUnit) {
555
550
  this.dataUnit.pageSize = this.pageSize;
556
551
  this.dataUnit.unsubscribe(this._dataUnitObserver);
557
- this.dataUnit.subscribe(this._dataUnitObserver);
558
- if ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.metadata) {
559
- this.updateMetadataWithRMP();
560
- }
561
552
  this.dataUnit.addInterceptor(this);
562
- if ((_b = this.dataUnit.records) === null || _b === void 0 ? void 0 : _b.length) {
553
+ this.dataUnit.subscribe(this._dataUnitObserver);
554
+ if (forceMetadataLoad || !this.dataUnit.metadata)
555
+ await this.dataUnit.loadMetadata();
556
+ if ((_a = this.dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) {
563
557
  const { records } = this.getMetadataByRow(this.dataUnit);
564
558
  this.dataUnit.records = records;
565
559
  }
@@ -647,7 +641,7 @@ export class SnkDataUnit {
647
641
  }
648
642
  }
649
643
  async componentDidLoad() {
650
- await this.loadDataUnit();
644
+ await this.loadDataUnit(false);
651
645
  this.handlerLinkFields();
652
646
  }
653
647
  render() {
@@ -19,7 +19,7 @@ export class SnkFilterCheckboxList {
19
19
  this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
20
20
  }
21
21
  renderOptions() {
22
- return this.optionsList.map(option => (h("ez-check", { label: option.label, onEzChange: (event) => this.handleToggleCheck(option, event.detail), value: !!this.isChecked(option.name) })));
22
+ return this.optionsList.map(option => (h("ez-check", { label: option.label, compact: true, onEzChange: (event) => this.handleToggleCheck(option, event.detail), value: !!this.isChecked(option.name) })));
23
23
  }
24
24
  isChecked(itemName) {
25
25
  var _a;
@@ -105,7 +105,7 @@
105
105
 
106
106
  .snk-filter-bar__filter-item-container {
107
107
  display: flex;
108
- align-items: start;
108
+ align-self: center;
109
109
  }
110
110
 
111
111
  .snk-filter-bar__scroller :first-child {
@@ -1,4 +1,4 @@
1
- import { ApplicationContext, ElementIDUtils, ObjectUtils, ErrorException } from '@sankhyalabs/core';
1
+ import { ApplicationContext, ElementIDUtils, ErrorException, ObjectUtils } from '@sankhyalabs/core';
2
2
  import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
3
3
  import { h, Host } from '@stencil/core';
4
4
  import { ConfigStorage } from '../../lib/configs/ConfigStorage';
@@ -27,7 +27,6 @@ export class SnkFilterBar {
27
27
  this._filtersComparator = (a, b) => {
28
28
  return this._calculateSortIndex(b) - this._calculateSortIndex(a);
29
29
  };
30
- this.customFilterBarConfig = undefined;
31
30
  this.dataUnit = undefined;
32
31
  this.title = undefined;
33
32
  this.configName = undefined;
@@ -338,23 +337,20 @@ export class SnkFilterBar {
338
337
  }
339
338
  }
340
339
  async loadConfigFromStorage(clearCache) {
341
- try {
342
- if (clearCache) {
343
- await ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
344
- }
345
- let config;
346
- if (this.customFilterBarConfig) {
347
- config = await this.customFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name });
348
- }
349
- else {
350
- config = await ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name });
351
- }
352
- this.filterConfig = config.map(item => this.normalizeItem(item));
353
- this.filterConfig.sort((a, b) => this._filtersComparator(a, b));
354
- }
355
- catch (e) {
356
- throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), e);
340
+ if (clearCache) {
341
+ await ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
357
342
  }
343
+ return new Promise(accept => {
344
+ ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name })
345
+ .then((filters) => {
346
+ accept();
347
+ this.filterConfig = filters.map(item => this.normalizeItem(item));
348
+ this.filterConfig.sort((a, b) => this._filtersComparator(a, b));
349
+ })
350
+ .catch(reason => {
351
+ throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
352
+ });
353
+ });
358
354
  }
359
355
  attachDataUnit() {
360
356
  if (this.dataUnit == undefined) {
@@ -481,32 +477,6 @@ export class SnkFilterBar {
481
477
  }
482
478
  static get properties() {
483
479
  return {
484
- "customFilterBarConfig": {
485
- "type": "unknown",
486
- "mutable": false,
487
- "complexType": {
488
- "original": "(configName: string, resourceId: string, options: any) => Promise<Array<SnkFilterItemConfig>>",
489
- "resolved": "(configName: string, resourceId: string, options: any) => Promise<SnkFilterItemConfig[]>",
490
- "references": {
491
- "Promise": {
492
- "location": "global"
493
- },
494
- "Array": {
495
- "location": "global"
496
- },
497
- "SnkFilterItemConfig": {
498
- "location": "import",
499
- "path": "./filter-item/snk-filter-item"
500
- }
501
- }
502
- },
503
- "required": false,
504
- "optional": true,
505
- "docs": {
506
- "tags": [],
507
- "text": "Loader customizado para carregar as configura\u00E7\u00F5es"
508
- }
509
- },
510
480
  "dataUnit": {
511
481
  "type": "unknown",
512
482
  "mutable": true,
@@ -1,6 +1,6 @@
1
1
  :host {
2
2
  --snk-grid-min-height: 300px;
3
- --snk-grid-padding: var(--space--small);
3
+ --snk-grid-padding: var(--space--lg);
4
4
  }
5
5
 
6
6
  .snk-grid__container {