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

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 (41) hide show
  1. package/dist/cjs/{SnkMultiSelectionListDataSource-8b5bfa05.js → SnkMultiSelectionListDataSource-d15f7aac.js} +1 -1
  2. package/dist/cjs/{pesquisa-fetcher-036a9588.js → pesquisa-fetcher-bdbbe9ac.js} +8 -4
  3. package/dist/cjs/snk-actions-button_4.cjs.entry.js +1 -1
  4. package/dist/cjs/snk-application.cjs.entry.js +1 -1
  5. package/dist/cjs/snk-attach.cjs.entry.js +1 -1
  6. package/dist/cjs/snk-crud.cjs.entry.js +1 -1
  7. package/dist/cjs/snk-detail-view.cjs.entry.js +2 -2
  8. package/dist/cjs/snk-grid.cjs.entry.js +2 -2
  9. package/dist/cjs/{snk-guides-viewer-2f61fb02.js → snk-guides-viewer-a8dd24a3.js} +1 -1
  10. package/dist/cjs/snk-guides-viewer.cjs.entry.js +2 -2
  11. package/dist/cjs/snk-simple-crud.cjs.entry.js +12 -4
  12. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +10 -2
  13. package/dist/collection/lib/dataUnit/InMemoryLoader.js +5 -1
  14. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +3 -3
  15. package/dist/components/dataunit-fetcher.js +8 -4
  16. package/dist/components/snk-simple-crud2.js +10 -2
  17. package/dist/esm/{SnkMultiSelectionListDataSource-4274be27.js → SnkMultiSelectionListDataSource-7084f3b3.js} +1 -1
  18. package/dist/esm/{pesquisa-fetcher-a9e27c84.js → pesquisa-fetcher-96d2f351.js} +8 -4
  19. package/dist/esm/snk-actions-button_4.entry.js +1 -1
  20. package/dist/esm/snk-application.entry.js +1 -1
  21. package/dist/esm/snk-attach.entry.js +1 -1
  22. package/dist/esm/snk-crud.entry.js +1 -1
  23. package/dist/esm/snk-detail-view.entry.js +2 -2
  24. package/dist/esm/snk-grid.entry.js +2 -2
  25. package/dist/esm/{snk-guides-viewer-16974807.js → snk-guides-viewer-131e9660.js} +1 -1
  26. package/dist/esm/snk-guides-viewer.entry.js +2 -2
  27. package/dist/esm/snk-simple-crud.entry.js +12 -4
  28. package/dist/sankhyablocks/{p-dcce8ca0.entry.js → p-075bba4c.entry.js} +1 -1
  29. package/dist/sankhyablocks/{p-433f0d45.entry.js → p-103c5956.entry.js} +1 -1
  30. package/dist/sankhyablocks/{p-751bd42a.entry.js → p-13ae1a89.entry.js} +1 -1
  31. package/dist/sankhyablocks/{p-d0126ca0.js → p-34a7f2ab.js} +3 -3
  32. package/dist/sankhyablocks/{p-3f88728d.js → p-5833cff9.js} +1 -1
  33. package/dist/sankhyablocks/{p-d6321b12.entry.js → p-5a2e016a.entry.js} +1 -1
  34. package/dist/sankhyablocks/{p-c6751382.entry.js → p-619c5f6f.entry.js} +1 -1
  35. package/dist/sankhyablocks/{p-1c7d57e5.entry.js → p-6f560924.entry.js} +1 -1
  36. package/dist/sankhyablocks/{p-fbc60023.js → p-8967fa78.js} +1 -1
  37. package/dist/sankhyablocks/{p-32331e9b.entry.js → p-9b1beac5.entry.js} +1 -1
  38. package/dist/sankhyablocks/{p-4ab95a67.entry.js → p-a87149e4.entry.js} +1 -1
  39. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  40. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +1 -0
  41. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const DataFetcher = require('./DataFetcher-99f0f6ed.js');
4
- const pesquisaFetcher = require('./pesquisa-fetcher-036a9588.js');
4
+ const pesquisaFetcher = require('./pesquisa-fetcher-bdbbe9ac.js');
5
5
  const core = require('@sankhyalabs/core');
6
6
  require('./index-0922807b.js');
7
7
  require('./ISave-e91b70a7.js');
@@ -247,13 +247,13 @@ function applySorting(records, dataUnit, sorting) {
247
247
  return records.sort(sortingFunction);
248
248
  }
249
249
  function buildPaginationInfo(records, offset = 0, limit = 0) {
250
- const lastRecord = Math.min(offset + limit, records.length);
250
+ const lastRecord = Math.min(offset + limit, records === null || records === void 0 ? void 0 : records.length);
251
251
  return {
252
252
  currentPage: limit === 0 ? 0 : Math.ceil(offset / limit),
253
253
  firstRecord: offset,
254
254
  lastRecord: lastRecord,
255
- total: records.length,
256
- hasMore: !!(records.length - lastRecord),
255
+ total: records === null || records === void 0 ? void 0 : records.length,
256
+ hasMore: !!((records === null || records === void 0 ? void 0 : records.length) - lastRecord),
257
257
  };
258
258
  }
259
259
 
@@ -272,7 +272,11 @@ class InMemoryLoader {
272
272
  if (this._initialRecords == undefined && this.dataUnit.records.length > 0) {
273
273
  this._initialRecords = this.dataUnit.records;
274
274
  }
275
- return [...this._initialRecords, ...this.dataUnit.getAddedRecords()];
275
+ const addedRecords = this.dataUnit.getAddedRecords();
276
+ if (addedRecords) {
277
+ return [...this._initialRecords, ...addedRecords];
278
+ }
279
+ return this._initialRecords;
276
280
  }
277
281
  get dataUnit() {
278
282
  return this._dataUnit;
@@ -6,7 +6,7 @@ const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const DataFetcher = require('./DataFetcher-99f0f6ed.js');
8
8
  const ParamType = require('./ParamType-90b440a0.js');
9
- require('./pesquisa-fetcher-036a9588.js');
9
+ require('./pesquisa-fetcher-bdbbe9ac.js');
10
10
  require('./index-0922807b.js');
11
11
  require('./ISave-e91b70a7.js');
12
12
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -8,7 +8,7 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const ConfigStorage = require('./ConfigStorage-8d4e9d53.js');
9
9
  const DataFetcher = require('./DataFetcher-99f0f6ed.js');
10
10
  const authFetcher = require('./auth-fetcher-bb8e9ae4.js');
11
- const pesquisaFetcher = require('./pesquisa-fetcher-036a9588.js');
11
+ const pesquisaFetcher = require('./pesquisa-fetcher-bdbbe9ac.js');
12
12
  const SnkMessageBuilder = require('./SnkMessageBuilder-66aa2557.js');
13
13
  require('./form-config-fetcher-d73f4449.js');
14
14
  require('./filter-item-type.enum-a7ffdaa6.js');
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const DataFetcher = require('./DataFetcher-99f0f6ed.js');
8
- const pesquisaFetcher = require('./pesquisa-fetcher-036a9588.js');
8
+ const pesquisaFetcher = require('./pesquisa-fetcher-bdbbe9ac.js');
9
9
  require('./index-0922807b.js');
10
10
  const ISave = require('./ISave-e91b70a7.js');
11
11
  require('./filter-item-type.enum-a7ffdaa6.js');
@@ -6,7 +6,7 @@ const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const taskbarElements = require('./taskbar-elements-3ecd1278.js');
8
8
  require('./DataFetcher-99f0f6ed.js');
9
- require('./pesquisa-fetcher-036a9588.js');
9
+ require('./pesquisa-fetcher-bdbbe9ac.js');
10
10
  const index$1 = require('./index-0922807b.js');
11
11
  require('./ISave-e91b70a7.js');
12
12
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -7,7 +7,7 @@ const core = require('@sankhyalabs/core');
7
7
  const SnkFormConfigManager = require('./SnkFormConfigManager-33995e92.js');
8
8
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
9
9
  require('./DataFetcher-99f0f6ed.js');
10
- require('./pesquisa-fetcher-036a9588.js');
10
+ require('./pesquisa-fetcher-bdbbe9ac.js');
11
11
  const index$1 = require('./index-0922807b.js');
12
12
  require('./ISave-e91b70a7.js');
13
13
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -16,7 +16,7 @@ require('./filter-item-type.enum-a7ffdaa6.js');
16
16
  require('./form-config-fetcher-d73f4449.js');
17
17
  const taskbarElements = require('./taskbar-elements-3ecd1278.js');
18
18
  const constants = require('./constants-35ddd366.js');
19
- const snkGuidesViewer = require('./snk-guides-viewer-2f61fb02.js');
19
+ const snkGuidesViewer = require('./snk-guides-viewer-a8dd24a3.js');
20
20
  const SnkMessageBuilder = require('./SnkMessageBuilder-66aa2557.js');
21
21
  require('./ConfigStorage-8d4e9d53.js');
22
22
  require('./PrintUtils-bcaeb82f.js');
@@ -10,10 +10,10 @@ const ConfigStorage = require('./ConfigStorage-8d4e9d53.js');
10
10
  const index$1 = require('./index-0922807b.js');
11
11
  const fieldSearch = require('./field-search-f56aa7d6.js');
12
12
  const index$2 = require('./index-102ba62d.js');
13
- const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-8b5bfa05.js');
13
+ const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-d15f7aac.js');
14
14
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
15
15
  require('./DataFetcher-99f0f6ed.js');
16
- require('./pesquisa-fetcher-036a9588.js');
16
+ require('./pesquisa-fetcher-bdbbe9ac.js');
17
17
  require('./ISave-e91b70a7.js');
18
18
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
19
19
  require('./filter-item-type.enum-a7ffdaa6.js');
@@ -8,7 +8,7 @@ const fieldSearch = require('./field-search-f56aa7d6.js');
8
8
  const taskbarElements = require('./taskbar-elements-3ecd1278.js');
9
9
  const constants = require('./constants-35ddd366.js');
10
10
  require('./DataFetcher-99f0f6ed.js');
11
- require('./pesquisa-fetcher-036a9588.js');
11
+ require('./pesquisa-fetcher-bdbbe9ac.js');
12
12
  const index$1 = require('./index-0922807b.js');
13
13
  require('./ISave-e91b70a7.js');
14
14
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkGuidesViewer = require('./snk-guides-viewer-2f61fb02.js');
5
+ const snkGuidesViewer = require('./snk-guides-viewer-a8dd24a3.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
8
  require('./SnkFormConfigManager-33995e92.js');
@@ -18,7 +18,7 @@ require('./taskbar-elements-3ecd1278.js');
18
18
  require('./index-0922807b.js');
19
19
  require('./index-102ba62d.js');
20
20
  require('./constants-35ddd366.js');
21
- require('./pesquisa-fetcher-036a9588.js');
21
+ require('./pesquisa-fetcher-bdbbe9ac.js');
22
22
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
23
23
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
24
24
  require('./ResourceIDUtils-5ff86aa7.js');
@@ -8,8 +8,8 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const constants = require('./constants-35ddd366.js');
9
9
  const taskbarElements = require('./taskbar-elements-3ecd1278.js');
10
10
  require('./DataFetcher-99f0f6ed.js');
11
- const pesquisaFetcher = require('./pesquisa-fetcher-036a9588.js');
12
- const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-8b5bfa05.js');
11
+ const pesquisaFetcher = require('./pesquisa-fetcher-bdbbe9ac.js');
12
+ const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-d15f7aac.js');
13
13
  const index$1 = require('./index-0922807b.js');
14
14
  require('./ISave-e91b70a7.js');
15
15
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -533,15 +533,23 @@ const SnkSimpleCrud = class {
533
533
  resolveResourceID() {
534
534
  return core.StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
535
535
  }
536
+ getFormConfig() {
537
+ var _a, _b;
538
+ const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields);
539
+ if (!this.configName && !configFromManager) {
540
+ return this.formConfig;
541
+ }
542
+ return configFromManager;
543
+ }
536
544
  /* istanbul ignore next */
537
545
  render() {
538
- var _a, _b, _c;
546
+ var _a;
539
547
  if (this.dataUnit == undefined) {
540
548
  return;
541
549
  }
542
550
  return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }, index.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(pesquisaFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
543
551
  ? undefined
544
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: (_b = this._formConfigManager) === null || _b === void 0 ? void 0 : _b.getConfig((_c = this.dataState) === null || _c === void 0 ? void 0 : _c.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index.h("div", { id: `${this._customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }))), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
552
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index.h("div", { id: `${this._customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }))), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
545
553
  }
546
554
  get _element() { return index.getElement(this); }
547
555
  static get watchers() { return {
@@ -507,15 +507,23 @@ export class SnkSimpleCrud {
507
507
  resolveResourceID() {
508
508
  return StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
509
509
  }
510
+ getFormConfig() {
511
+ var _a, _b;
512
+ const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields);
513
+ if (!this.configName && !configFromManager) {
514
+ return this.formConfig;
515
+ }
516
+ return configFromManager;
517
+ }
510
518
  /* istanbul ignore next */
511
519
  render() {
512
- var _a, _b, _c;
520
+ var _a;
513
521
  if (this.dataUnit == undefined) {
514
522
  return;
515
523
  }
516
524
  return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, 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(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
517
525
  ? undefined
518
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: (_b = this._formConfigManager) === null || _b === void 0 ? void 0 : _b.getConfig((_c = this.dataState) === null || _c === void 0 ? void 0 : _c.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && 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 })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
526
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && 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 })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
519
527
  }
520
528
  static get is() { return "snk-simple-crud"; }
521
529
  static get encapsulation() { return "scoped"; }
@@ -15,7 +15,11 @@ export default class InMemoryLoader {
15
15
  if (this._initialRecords == undefined && this.dataUnit.records.length > 0) {
16
16
  this._initialRecords = this.dataUnit.records;
17
17
  }
18
- return [...this._initialRecords, ...this.dataUnit.getAddedRecords()];
18
+ const addedRecords = this.dataUnit.getAddedRecords();
19
+ if (addedRecords) {
20
+ return [...this._initialRecords, ...addedRecords];
21
+ }
22
+ return this._initialRecords;
19
23
  }
20
24
  get dataUnit() {
21
25
  return this._dataUnit;
@@ -22,12 +22,12 @@ export function applySorting(records, dataUnit, sorting) {
22
22
  return records.sort(sortingFunction);
23
23
  }
24
24
  export function buildPaginationInfo(records, offset = 0, limit = 0) {
25
- const lastRecord = Math.min(offset + limit, records.length);
25
+ const lastRecord = Math.min(offset + limit, records === null || records === void 0 ? void 0 : records.length);
26
26
  return {
27
27
  currentPage: limit === 0 ? 0 : Math.ceil(offset / limit),
28
28
  firstRecord: offset,
29
29
  lastRecord: lastRecord,
30
- total: records.length,
31
- hasMore: !!(records.length - lastRecord),
30
+ total: records === null || records === void 0 ? void 0 : records.length,
31
+ hasMore: !!((records === null || records === void 0 ? void 0 : records.length) - lastRecord),
32
32
  };
33
33
  }
@@ -405,13 +405,13 @@ function applySorting(records, dataUnit, sorting) {
405
405
  return records.sort(sortingFunction);
406
406
  }
407
407
  function buildPaginationInfo(records, offset = 0, limit = 0) {
408
- const lastRecord = Math.min(offset + limit, records.length);
408
+ const lastRecord = Math.min(offset + limit, records === null || records === void 0 ? void 0 : records.length);
409
409
  return {
410
410
  currentPage: limit === 0 ? 0 : Math.ceil(offset / limit),
411
411
  firstRecord: offset,
412
412
  lastRecord: lastRecord,
413
- total: records.length,
414
- hasMore: !!(records.length - lastRecord),
413
+ total: records === null || records === void 0 ? void 0 : records.length,
414
+ hasMore: !!((records === null || records === void 0 ? void 0 : records.length) - lastRecord),
415
415
  };
416
416
  }
417
417
 
@@ -430,7 +430,11 @@ class InMemoryLoader {
430
430
  if (this._initialRecords == undefined && this.dataUnit.records.length > 0) {
431
431
  this._initialRecords = this.dataUnit.records;
432
432
  }
433
- return [...this._initialRecords, ...this.dataUnit.getAddedRecords()];
433
+ const addedRecords = this.dataUnit.getAddedRecords();
434
+ if (addedRecords) {
435
+ return [...this._initialRecords, ...addedRecords];
436
+ }
437
+ return this._initialRecords;
434
438
  }
435
439
  get dataUnit() {
436
440
  return this._dataUnit;
@@ -535,15 +535,23 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
535
535
  resolveResourceID() {
536
536
  return StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
537
537
  }
538
+ getFormConfig() {
539
+ var _a, _b;
540
+ const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields);
541
+ if (!this.configName && !configFromManager) {
542
+ return this.formConfig;
543
+ }
544
+ return configFromManager;
545
+ }
538
546
  /* istanbul ignore next */
539
547
  render() {
540
- var _a, _b, _c;
548
+ var _a;
541
549
  if (this.dataUnit == undefined) {
542
550
  return;
543
551
  }
544
552
  return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, 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(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
545
553
  ? undefined
546
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: (_b = this._formConfigManager) === null || _b === void 0 ? void 0 : _b.getConfig((_c = this.dataState) === null || _c === void 0 ? void 0 : _c.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && 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 })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
554
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && 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 })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
547
555
  }
548
556
  get _element() { return this; }
549
557
  static get watchers() { return {
@@ -1,5 +1,5 @@
1
1
  import { D as DataFetcher } from './DataFetcher-a650ae58.js';
2
- import { a as PreloadManager } from './pesquisa-fetcher-a9e27c84.js';
2
+ import { a as PreloadManager } from './pesquisa-fetcher-96d2f351.js';
3
3
  import { SortMode, ApplicationContext, UserInterface, DateUtils } from '@sankhyalabs/core';
4
4
  import './index-0ece87a6.js';
5
5
  import './ISave-d8c8bc59.js';
@@ -245,13 +245,13 @@ function applySorting(records, dataUnit, sorting) {
245
245
  return records.sort(sortingFunction);
246
246
  }
247
247
  function buildPaginationInfo(records, offset = 0, limit = 0) {
248
- const lastRecord = Math.min(offset + limit, records.length);
248
+ const lastRecord = Math.min(offset + limit, records === null || records === void 0 ? void 0 : records.length);
249
249
  return {
250
250
  currentPage: limit === 0 ? 0 : Math.ceil(offset / limit),
251
251
  firstRecord: offset,
252
252
  lastRecord: lastRecord,
253
- total: records.length,
254
- hasMore: !!(records.length - lastRecord),
253
+ total: records === null || records === void 0 ? void 0 : records.length,
254
+ hasMore: !!((records === null || records === void 0 ? void 0 : records.length) - lastRecord),
255
255
  };
256
256
  }
257
257
 
@@ -270,7 +270,11 @@ class InMemoryLoader {
270
270
  if (this._initialRecords == undefined && this.dataUnit.records.length > 0) {
271
271
  this._initialRecords = this.dataUnit.records;
272
272
  }
273
- return [...this._initialRecords, ...this.dataUnit.getAddedRecords()];
273
+ const addedRecords = this.dataUnit.getAddedRecords();
274
+ if (addedRecords) {
275
+ return [...this._initialRecords, ...addedRecords];
276
+ }
277
+ return this._initialRecords;
274
278
  }
275
279
  get dataUnit() {
276
280
  return this._dataUnit;
@@ -2,7 +2,7 @@ import { r as registerInstance, h, H as Host, g as getElement, c as createEvent
2
2
  import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { D as DataFetcher } from './DataFetcher-a650ae58.js';
4
4
  import { P as ParamType } from './ParamType-d5152b06.js';
5
- import './pesquisa-fetcher-a9e27c84.js';
5
+ import './pesquisa-fetcher-96d2f351.js';
6
6
  import './index-0ece87a6.js';
7
7
  import './ISave-d8c8bc59.js';
8
8
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
@@ -4,7 +4,7 @@ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { C as ConfigStorage } from './ConfigStorage-6e241cd7.js';
5
5
  import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-a650ae58.js';
6
6
  import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-8ec448b0.js';
7
- import { D as DataUnitFetcher, P as PesquisaFetcher } from './pesquisa-fetcher-a9e27c84.js';
7
+ import { D as DataUnitFetcher, P as PesquisaFetcher } from './pesquisa-fetcher-96d2f351.js';
8
8
  import { S as SnkMessageBuilder } from './SnkMessageBuilder-0a4becdd.js';
9
9
  import './form-config-fetcher-765b8498.js';
10
10
  import './filter-item-type.enum-d45e026f.js';
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-a7d3d3f1.js';
2
2
  import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataUnit } from '@sankhyalabs/core';
3
3
  import { D as DataFetcher } from './DataFetcher-a650ae58.js';
4
- import { a as PreloadManager, b as applyFilter, c as applySorting, d as buildPaginationInfo, D as DataUnitFetcher, I as InMemoryLoader } from './pesquisa-fetcher-a9e27c84.js';
4
+ import { a as PreloadManager, b as applyFilter, c as applySorting, d as buildPaginationInfo, D as DataUnitFetcher, I as InMemoryLoader } from './pesquisa-fetcher-96d2f351.js';
5
5
  import './index-0ece87a6.js';
6
6
  import { S as SaveErrorsEnum } from './ISave-d8c8bc59.js';
7
7
  import './filter-item-type.enum-d45e026f.js';
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
2
2
  import { StringUtils, ElementIDUtils, ApplicationContext, JSUtils, FloatingManager } from '@sankhyalabs/core';
3
3
  import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
4
4
  import './DataFetcher-a650ae58.js';
5
- import './pesquisa-fetcher-a9e27c84.js';
5
+ import './pesquisa-fetcher-96d2f351.js';
6
6
  import { P as PresentationMode } from './index-0ece87a6.js';
7
7
  import './ISave-d8c8bc59.js';
8
8
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
@@ -3,7 +3,7 @@ import { Action } from '@sankhyalabs/core';
3
3
  import { S as SnkFormConfigManager } from './SnkFormConfigManager-7a4e678f.js';
4
4
  import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
5
  import './DataFetcher-a650ae58.js';
6
- import './pesquisa-fetcher-a9e27c84.js';
6
+ import './pesquisa-fetcher-96d2f351.js';
7
7
  import { P as PresentationMode } from './index-0ece87a6.js';
8
8
  import './ISave-d8c8bc59.js';
9
9
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
@@ -12,7 +12,7 @@ import './filter-item-type.enum-d45e026f.js';
12
12
  import './form-config-fetcher-765b8498.js';
13
13
  import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
14
14
  import { d as VIEW_MODE } from './constants-8457af36.js';
15
- import { S as SnkGuidesViewer } from './snk-guides-viewer-16974807.js';
15
+ import { S as SnkGuidesViewer } from './snk-guides-viewer-131e9660.js';
16
16
  import { S as SnkMessageBuilder } from './SnkMessageBuilder-0a4becdd.js';
17
17
  import './ConfigStorage-6e241cd7.js';
18
18
  import './PrintUtils-3e4ff0f5.js';
@@ -6,10 +6,10 @@ import { C as ConfigStorage } from './ConfigStorage-6e241cd7.js';
6
6
  import { P as PresentationMode } from './index-0ece87a6.js';
7
7
  import { T as TaskbarProcessor, o as openFieldSearch, b as buildFieldSearch } from './field-search-efbe307f.js';
8
8
  import { s as store } from './index-bdf75557.js';
9
- import { S as SnkMultiSelectionListDataSource, C as CrudUtils } from './SnkMultiSelectionListDataSource-4274be27.js';
9
+ import { S as SnkMultiSelectionListDataSource, C as CrudUtils } from './SnkMultiSelectionListDataSource-7084f3b3.js';
10
10
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
11
11
  import './DataFetcher-a650ae58.js';
12
- import './pesquisa-fetcher-a9e27c84.js';
12
+ import './pesquisa-fetcher-96d2f351.js';
13
13
  import './ISave-d8c8bc59.js';
14
14
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
15
15
  import './filter-item-type.enum-d45e026f.js';
@@ -6,7 +6,7 @@ import { o as openFieldSearch, T as TaskbarProcessor, b as buildFieldSearch } fr
6
6
  import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
7
7
  import { d as VIEW_MODE } from './constants-8457af36.js';
8
8
  import './DataFetcher-a650ae58.js';
9
- import './pesquisa-fetcher-a9e27c84.js';
9
+ import './pesquisa-fetcher-96d2f351.js';
10
10
  import { P as PresentationMode } from './index-0ece87a6.js';
11
11
  import './ISave-d8c8bc59.js';
12
12
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
@@ -1,4 +1,4 @@
1
- export { S as snk_guides_viewer } from './snk-guides-viewer-16974807.js';
1
+ export { S as snk_guides_viewer } from './snk-guides-viewer-131e9660.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
4
  import './SnkFormConfigManager-7a4e678f.js';
@@ -14,7 +14,7 @@ import './taskbar-elements-2473c8ac.js';
14
14
  import './index-0ece87a6.js';
15
15
  import './index-bdf75557.js';
16
16
  import './constants-8457af36.js';
17
- import './pesquisa-fetcher-a9e27c84.js';
17
+ import './pesquisa-fetcher-96d2f351.js';
18
18
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
19
19
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
20
20
  import './ResourceIDUtils-a114189a.js';
@@ -4,8 +4,8 @@ import { CSSVarsUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { d as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-8457af36.js';
5
5
  import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
6
6
  import './DataFetcher-a650ae58.js';
7
- import { I as InMemoryLoader } from './pesquisa-fetcher-a9e27c84.js';
8
- import { S as SnkMultiSelectionListDataSource, C as CrudUtils } from './SnkMultiSelectionListDataSource-4274be27.js';
7
+ import { I as InMemoryLoader } from './pesquisa-fetcher-96d2f351.js';
8
+ import { S as SnkMultiSelectionListDataSource, C as CrudUtils } from './SnkMultiSelectionListDataSource-7084f3b3.js';
9
9
  import { P as PresentationMode } from './index-0ece87a6.js';
10
10
  import './ISave-d8c8bc59.js';
11
11
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
@@ -529,15 +529,23 @@ const SnkSimpleCrud = class {
529
529
  resolveResourceID() {
530
530
  return StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
531
531
  }
532
+ getFormConfig() {
533
+ var _a, _b;
534
+ const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields);
535
+ if (!this.configName && !configFromManager) {
536
+ return this.formConfig;
537
+ }
538
+ return configFromManager;
539
+ }
532
540
  /* istanbul ignore next */
533
541
  render() {
534
- var _a, _b, _c;
542
+ var _a;
535
543
  if (this.dataUnit == undefined) {
536
544
  return;
537
545
  }
538
546
  return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, 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(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
539
547
  ? undefined
540
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: (_b = this._formConfigManager) === null || _b === void 0 ? void 0 : _b.getConfig((_c = this.dataState) === null || _c === void 0 ? void 0 : _c.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && 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 })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
548
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && 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 })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
541
549
  }
542
550
  get _element() { return getElement(this); }
543
551
  static get watchers() { return {
@@ -1 +1 @@
1
- export{S as snk_guides_viewer}from"./p-fbc60023.js";import"./p-d2d301a6.js";import"@sankhyalabs/core";import"./p-efeca7ba.js";import"./p-0624f62d.js";import"./p-004c356e.js";import"./p-be75153c.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"@sankhyalabs/ezui/dist/collection/utils/form";import"./p-c2495304.js";import"./p-ae4fc9a9.js";import"./p-38289a55.js";import"./p-6dc031de.js";import"./p-b0ef4383.js";import"./p-d0126ca0.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"./p-688dcb4c.js";import"./p-21749402.js";import"@sankhyalabs/core/dist/dataunit/DataUnit";
1
+ export{S as snk_guides_viewer}from"./p-8967fa78.js";import"./p-d2d301a6.js";import"@sankhyalabs/core";import"./p-efeca7ba.js";import"./p-0624f62d.js";import"./p-004c356e.js";import"./p-be75153c.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"@sankhyalabs/ezui/dist/collection/utils/form";import"./p-c2495304.js";import"./p-ae4fc9a9.js";import"./p-38289a55.js";import"./p-6dc031de.js";import"./p-b0ef4383.js";import"./p-34a7f2ab.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"./p-688dcb4c.js";import"./p-21749402.js";import"@sankhyalabs/core/dist/dataunit/DataUnit";