@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-48463.1 → 0.0.0-bugfix-dev-KB-48570.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/cjs/snk-attach.cjs.entry.js +1 -1
  2. package/dist/cjs/snk-crud.cjs.entry.js +1 -1
  3. package/dist/cjs/snk-detail-view.cjs.entry.js +2 -2
  4. package/dist/cjs/snk-grid.cjs.entry.js +1 -1
  5. package/dist/cjs/{snk-guides-viewer-c7293cfa.js → snk-guides-viewer-75047f22.js} +1 -1
  6. package/dist/cjs/snk-guides-viewer.cjs.entry.js +2 -2
  7. package/dist/cjs/snk-simple-crud.cjs.entry.js +10 -9
  8. package/dist/cjs/snk-taskbar.cjs.entry.js +6 -9
  9. package/dist/cjs/{taskbar-elements-1e4fb2e0.js → taskbar-elements-3ecd1278.js} +1 -1
  10. package/dist/collection/components/snk-simple-crud/regular-buttons.js +3 -0
  11. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +7 -8
  12. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +1 -1
  13. package/dist/collection/components/snk-taskbar/snk-taskbar.js +5 -8
  14. package/dist/components/snk-simple-crud2.js +9 -8
  15. package/dist/components/snk-taskbar2.js +6 -9
  16. package/dist/esm/snk-attach.entry.js +1 -1
  17. package/dist/esm/snk-crud.entry.js +1 -1
  18. package/dist/esm/snk-detail-view.entry.js +2 -2
  19. package/dist/esm/snk-grid.entry.js +1 -1
  20. package/dist/esm/{snk-guides-viewer-47443f7c.js → snk-guides-viewer-8b679ee6.js} +1 -1
  21. package/dist/esm/snk-guides-viewer.entry.js +2 -2
  22. package/dist/esm/snk-simple-crud.entry.js +10 -9
  23. package/dist/esm/snk-taskbar.entry.js +6 -9
  24. package/dist/esm/{taskbar-elements-846c027c.js → taskbar-elements-2473c8ac.js} +1 -1
  25. package/dist/sankhyablocks/p-230f5148.entry.js +1 -0
  26. package/dist/sankhyablocks/{p-fca66dda.entry.js → p-4b0c5921.entry.js} +1 -1
  27. package/dist/sankhyablocks/{p-30735d1e.entry.js → p-5eaecd30.entry.js} +1 -1
  28. package/dist/sankhyablocks/p-61da4a55.entry.js +1 -0
  29. package/dist/sankhyablocks/{p-6ae58da0.js → p-8a00836e.js} +1 -1
  30. package/dist/sankhyablocks/{p-99b1926b.entry.js → p-a1c630fb.entry.js} +1 -1
  31. package/dist/sankhyablocks/p-ae4fc9a9.js +1 -0
  32. package/dist/sankhyablocks/{p-3c5b7cfc.entry.js → p-ba4871b5.entry.js} +1 -1
  33. package/dist/sankhyablocks/{p-0c9dd95e.entry.js → p-d0bc5ef3.entry.js} +1 -1
  34. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  35. package/dist/types/components/snk-simple-crud/regular-buttons.d.ts +3 -0
  36. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -2
  37. package/package.json +1 -1
  38. package/dist/sankhyablocks/p-8c13d8d6.entry.js +0 -1
  39. package/dist/sankhyablocks/p-8c49760e.js +0 -1
  40. package/dist/sankhyablocks/p-fd216f2e.entry.js +0 -1
@@ -12,7 +12,7 @@ require('./filter-item-type.enum-a7ffdaa6.js');
12
12
  require('./form-config-fetcher-9f1a13ca.js');
13
13
  const constants = require('./constants-35ddd366.js');
14
14
  const authFetcher = require('./auth-fetcher-5161d082.js');
15
- const taskbarElements = require('./taskbar-elements-1e4fb2e0.js');
15
+ const taskbarElements = require('./taskbar-elements-3ecd1278.js');
16
16
  require('./PrintUtils-bcaeb82f.js');
17
17
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
18
18
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
- const taskbarElements = require('./taskbar-elements-1e4fb2e0.js');
7
+ const taskbarElements = require('./taskbar-elements-3ecd1278.js');
8
8
  require('./DataFetcher-99f0f6ed.js');
9
9
  require('./pesquisa-fetcher-94f6b316.js');
10
10
  const index$1 = require('./index-0922807b.js');
@@ -14,9 +14,9 @@ require('@sankhyalabs/ezui/dist/collection/utils/constants');
14
14
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
15
15
  require('./filter-item-type.enum-a7ffdaa6.js');
16
16
  require('./form-config-fetcher-9f1a13ca.js');
17
- const taskbarElements = require('./taskbar-elements-1e4fb2e0.js');
17
+ const taskbarElements = require('./taskbar-elements-3ecd1278.js');
18
18
  const constants = require('./constants-35ddd366.js');
19
- const snkGuidesViewer = require('./snk-guides-viewer-c7293cfa.js');
19
+ const snkGuidesViewer = require('./snk-guides-viewer-75047f22.js');
20
20
  const SnkMessageBuilder = require('./SnkMessageBuilder-141aa18d.js');
21
21
  require('./ConfigStorage-d4c99a5e.js');
22
22
  require('./PrintUtils-bcaeb82f.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 UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
8
- const taskbarElements = require('./taskbar-elements-1e4fb2e0.js');
8
+ const taskbarElements = require('./taskbar-elements-3ecd1278.js');
9
9
  const ConfigStorage = require('./ConfigStorage-d4c99a5e.js');
10
10
  const index$1 = require('./index-0922807b.js');
11
11
  const fieldSearch = require('./field-search-f56aa7d6.js');
@@ -5,7 +5,7 @@ const core = require('@sankhyalabs/core');
5
5
  const SnkFormConfigManager = require('./SnkFormConfigManager-0ffd098d.js');
6
6
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
7
7
  const fieldSearch = require('./field-search-f56aa7d6.js');
8
- const taskbarElements = require('./taskbar-elements-1e4fb2e0.js');
8
+ const taskbarElements = require('./taskbar-elements-3ecd1278.js');
9
9
  const constants = require('./constants-35ddd366.js');
10
10
  require('./DataFetcher-99f0f6ed.js');
11
11
  require('./pesquisa-fetcher-94f6b316.js');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkGuidesViewer = require('./snk-guides-viewer-c7293cfa.js');
5
+ const snkGuidesViewer = require('./snk-guides-viewer-75047f22.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
8
  require('./SnkFormConfigManager-0ffd098d.js');
@@ -14,7 +14,7 @@ require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
14
  require('./filter-item-type.enum-a7ffdaa6.js');
15
15
  require('@sankhyalabs/ezui/dist/collection/utils/form');
16
16
  require('./field-search-f56aa7d6.js');
17
- require('./taskbar-elements-1e4fb2e0.js');
17
+ require('./taskbar-elements-3ecd1278.js');
18
18
  require('./index-0922807b.js');
19
19
  require('./index-102ba62d.js');
20
20
  require('./constants-35ddd366.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 constants = require('./constants-35ddd366.js');
8
- const taskbarElements = require('./taskbar-elements-1e4fb2e0.js');
8
+ const taskbarElements = require('./taskbar-elements-3ecd1278.js');
9
9
  require('./DataFetcher-99f0f6ed.js');
10
10
  const pesquisaFetcher = require('./pesquisa-fetcher-94f6b316.js');
11
11
  const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-5213120b.js');
@@ -24,6 +24,9 @@ require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
24
24
  require('./ResourceIDUtils-5ff86aa7.js');
25
25
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
26
26
 
27
+ const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
28
+ const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
29
+
27
30
  const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:max-content;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;min-height:300px}ez-form.sc-snk-simple-crud{min-height:300px}";
28
31
 
29
32
  const SnkSimpleCrud = class {
@@ -35,8 +38,6 @@ const SnkSimpleCrud = class {
35
38
  this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
36
39
  this.configuratorSave = index.createEvent(this, "configuratorSave", 7);
37
40
  this.configuratorCancel = index.createEvent(this, "configuratorCancel", 7);
38
- this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
39
- this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
40
41
  this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
41
42
  this._keyDownHandler = (event) => this.keyDownListener(event);
42
43
  this._taskbarProcessor = new fieldSearch.TaskbarProcessor({
@@ -68,7 +69,7 @@ const SnkSimpleCrud = class {
68
69
  this.showConfiguratorButtons = undefined;
69
70
  }
70
71
  getButtons(selected, changeModeBtn) {
71
- return this.addConfigButton(this.resolveInMemoryBtns(selected ? this.REGULAR_DEFAULT_BTNS : this.REGULAR_SELECTED_BTNS)
72
+ return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
72
73
  .concat(changeModeBtn));
73
74
  }
74
75
  addConfigButton(buttons) {
@@ -342,9 +343,7 @@ const SnkSimpleCrud = class {
342
343
  return (_b = (_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : this._formFields;
343
344
  }
344
345
  handleFormSetFields(fields) {
345
- if (!core.ObjectUtils.equals(this._formFields, fields)) {
346
- this._formFields = fields !== null && fields !== void 0 ? fields : [];
347
- }
346
+ this._formFields = fields !== null && fields !== void 0 ? fields : [];
348
347
  }
349
348
  fieldsOptionLoader(argument) {
350
349
  const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
@@ -445,13 +444,15 @@ const SnkSimpleCrud = class {
445
444
  }
446
445
  /* istanbul ignore next */
447
446
  render() {
448
- var _a, _b, _c;
447
+ var _a;
449
448
  if (this.dataUnit == undefined) {
450
449
  return;
451
450
  }
452
451
  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)
453
452
  ? undefined
454
- : 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._showFormConfig ? "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), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this._showFormConfig && 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._resourceID, 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._resourceID }))));
453
+ : 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._showFormConfig ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.formConfig,
454
+ // config={this._formConfigManager?.getConfig(this.dataState?.insertionMode, this.dataUnit)}
455
+ fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this._showFormConfig && 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._resourceID, 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._resourceID }))));
455
456
  }
456
457
  get _element() { return index.getElement(this); }
457
458
  static get watchers() { return {
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
8
- const taskbarElements = require('./taskbar-elements-1e4fb2e0.js');
8
+ const taskbarElements = require('./taskbar-elements-3ecd1278.js');
9
9
  const index$1 = require('./index-0922807b.js');
10
10
  require('./index-102ba62d.js');
11
11
 
@@ -58,7 +58,9 @@ const SnkTaskbar = class {
58
58
  }
59
59
  observeButtons() {
60
60
  this._definitions = undefined;
61
- requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
61
+ requestAnimationFrame(() => {
62
+ requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
63
+ });
62
64
  }
63
65
  // Internal methods
64
66
  elementsFromString(strButtons) {
@@ -213,7 +215,7 @@ const SnkTaskbar = class {
213
215
  this._customElementsId.push(elementId);
214
216
  (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.addNotOverFlowElement(elementId);
215
217
  }
216
- return index.h("span", { key: elementId, id: elementId });
218
+ return index.h("span", { class: "ez-padding-left--medium", key: elementId, id: elementId });
217
219
  }
218
220
  getCustomElements() {
219
221
  var _a, _b;
@@ -337,12 +339,7 @@ const SnkTaskbar = class {
337
339
  let index$1 = 0;
338
340
  return (index.h(index.Host, { class: this.getHostClasses() }, this.removeEmpty(this._definitions.map((elem) => {
339
341
  var _a, _b;
340
- if (elem === taskbarElements.TaskbarElement.DIVIDER) {
341
- index$1 = 0;
342
- }
343
- else {
344
- index$1++;
345
- }
342
+ index$1++;
346
343
  if (taskbarElements.TaskbarElement[elem]) {
347
344
  return this.getElement(index$1, taskbarElements.TaskbarElement[elem]);
348
345
  }
@@ -91,7 +91,7 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
91
91
  case exports.TaskbarElement.MORE_OPTIONS:
92
92
  return actionButton(element, className, dataElementId, title, isEnabled, actions, action);
93
93
  case exports.TaskbarElement.DIVIDER:
94
- return index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium", "data-taskbar-divider": true });
94
+ return index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin--none ez-margin-left--medium", "data-taskbar-divider": true });
95
95
  case exports.TaskbarElement.DATA_EXPORTER:
96
96
  const provider = (_a = index$1.store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
97
97
  return index.h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId, "data-taskbar-element": element });
@@ -0,0 +1,3 @@
1
+ const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
2
+ const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
3
+ export { REGULAR_DEFAULT_BTNS, REGULAR_SELECTED_BTNS };
@@ -9,10 +9,9 @@ import SnkMultiSelectionListDataSource from '../snk-grid/filtercolumn/SnkMultiSe
9
9
  import { buildFieldSearch, openFieldSearch } from '../snk-taskbar/subcomponents/field-search';
10
10
  import { ConfigStorage } from '../../lib/configs/ConfigStorage';
11
11
  import { SnkFormConfigManager } from '../snk-form-config/SnkFormConfigManager';
12
+ import { REGULAR_DEFAULT_BTNS, REGULAR_SELECTED_BTNS } from './regular-buttons';
12
13
  export class SnkSimpleCrud {
13
14
  constructor() {
14
- this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
15
- this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
16
15
  this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
17
16
  this._keyDownHandler = (event) => this.keyDownListener(event);
18
17
  this._taskbarProcessor = new TaskbarProcessor({
@@ -44,7 +43,7 @@ export class SnkSimpleCrud {
44
43
  this.showConfiguratorButtons = undefined;
45
44
  }
46
45
  getButtons(selected, changeModeBtn) {
47
- return this.addConfigButton(this.resolveInMemoryBtns(selected ? this.REGULAR_DEFAULT_BTNS : this.REGULAR_SELECTED_BTNS)
46
+ return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
48
47
  .concat(changeModeBtn));
49
48
  }
50
49
  addConfigButton(buttons) {
@@ -318,9 +317,7 @@ export class SnkSimpleCrud {
318
317
  return (_b = (_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : this._formFields;
319
318
  }
320
319
  handleFormSetFields(fields) {
321
- if (!ObjectUtils.equals(this._formFields, fields)) {
322
- this._formFields = fields !== null && fields !== void 0 ? fields : [];
323
- }
320
+ this._formFields = fields !== null && fields !== void 0 ? fields : [];
324
321
  }
325
322
  fieldsOptionLoader(argument) {
326
323
  const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
@@ -421,13 +418,15 @@ export class SnkSimpleCrud {
421
418
  }
422
419
  /* istanbul ignore next */
423
420
  render() {
424
- var _a, _b, _c;
421
+ var _a;
425
422
  if (this.dataUnit == undefined) {
426
423
  return;
427
424
  }
428
425
  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)
429
426
  ? undefined
430
- : 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._showFormConfig ? "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), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this._showFormConfig && 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._resourceID, 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._resourceID }))));
427
+ : 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._showFormConfig ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.formConfig,
428
+ // config={this._formConfigManager?.getConfig(this.dataState?.insertionMode, this.dataUnit)}
429
+ fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this._showFormConfig && 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._resourceID, 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._resourceID }))));
431
430
  }
432
431
  static get is() { return "snk-simple-crud"; }
433
432
  static get encapsulation() { return "scoped"; }
@@ -88,7 +88,7 @@ export const buildElem = (element, className, dataElementId, getTitle, action, i
88
88
  case TaskbarElement.MORE_OPTIONS:
89
89
  return actionButton(element, className, dataElementId, title, isEnabled, actions, action);
90
90
  case TaskbarElement.DIVIDER:
91
- return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium", "data-taskbar-divider": true });
91
+ return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin--none ez-margin-left--medium", "data-taskbar-divider": true });
92
92
  case TaskbarElement.DATA_EXPORTER:
93
93
  const provider = (_a = store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
94
94
  return h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId, "data-taskbar-element": element });
@@ -48,7 +48,9 @@ export class SnkTaskbar {
48
48
  }
49
49
  observeButtons() {
50
50
  this._definitions = undefined;
51
- requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
51
+ requestAnimationFrame(() => {
52
+ requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
53
+ });
52
54
  }
53
55
  // Internal methods
54
56
  elementsFromString(strButtons) {
@@ -203,7 +205,7 @@ export class SnkTaskbar {
203
205
  this._customElementsId.push(elementId);
204
206
  (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.addNotOverFlowElement(elementId);
205
207
  }
206
- return h("span", { key: elementId, id: elementId });
208
+ return h("span", { class: "ez-padding-left--medium", key: elementId, id: elementId });
207
209
  }
208
210
  getCustomElements() {
209
211
  var _a, _b;
@@ -327,12 +329,7 @@ export class SnkTaskbar {
327
329
  let index = 0;
328
330
  return (h(Host, { class: this.getHostClasses() }, this.removeEmpty(this._definitions.map((elem) => {
329
331
  var _a, _b;
330
- if (elem === TaskbarElement.DIVIDER) {
331
- index = 0;
332
- }
333
- else {
334
- index++;
335
- }
332
+ index++;
336
333
  if (TaskbarElement[elem]) {
337
334
  return this.getElement(index, TaskbarElement[elem]);
338
335
  }
@@ -25,6 +25,9 @@ import { d as defineCustomElement$4 } from './snk-select-box2.js';
25
25
  import { d as defineCustomElement$3 } from './snk-tab-config2.js';
26
26
  import { d as defineCustomElement$1 } from './taskbar-actions-button2.js';
27
27
 
28
+ const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
29
+ const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
30
+
28
31
  const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:max-content;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;min-height:300px}ez-form.sc-snk-simple-crud{min-height:300px}";
29
32
 
30
33
  const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
@@ -37,8 +40,6 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
37
40
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
38
41
  this.configuratorSave = createEvent(this, "configuratorSave", 7);
39
42
  this.configuratorCancel = createEvent(this, "configuratorCancel", 7);
40
- this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
41
- this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
42
43
  this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
43
44
  this._keyDownHandler = (event) => this.keyDownListener(event);
44
45
  this._taskbarProcessor = new TaskbarProcessor({
@@ -70,7 +71,7 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
70
71
  this.showConfiguratorButtons = undefined;
71
72
  }
72
73
  getButtons(selected, changeModeBtn) {
73
- return this.addConfigButton(this.resolveInMemoryBtns(selected ? this.REGULAR_DEFAULT_BTNS : this.REGULAR_SELECTED_BTNS)
74
+ return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
74
75
  .concat(changeModeBtn));
75
76
  }
76
77
  addConfigButton(buttons) {
@@ -344,9 +345,7 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
344
345
  return (_b = (_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : this._formFields;
345
346
  }
346
347
  handleFormSetFields(fields) {
347
- if (!ObjectUtils.equals(this._formFields, fields)) {
348
- this._formFields = fields !== null && fields !== void 0 ? fields : [];
349
- }
348
+ this._formFields = fields !== null && fields !== void 0 ? fields : [];
350
349
  }
351
350
  fieldsOptionLoader(argument) {
352
351
  const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
@@ -447,13 +446,15 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
447
446
  }
448
447
  /* istanbul ignore next */
449
448
  render() {
450
- var _a, _b, _c;
449
+ var _a;
451
450
  if (this.dataUnit == undefined) {
452
451
  return;
453
452
  }
454
453
  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)
455
454
  ? undefined
456
- : 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._showFormConfig ? "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), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this._showFormConfig && 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._resourceID, 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._resourceID }))));
455
+ : 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._showFormConfig ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.formConfig,
456
+ // config={this._formConfigManager?.getConfig(this.dataState?.insertionMode, this.dataUnit)}
457
+ fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this._showFormConfig && 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._resourceID, 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._resourceID }))));
457
458
  }
458
459
  get _element() { return this; }
459
460
  static get watchers() { return {
@@ -95,7 +95,7 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
95
95
  case TaskbarElement.MORE_OPTIONS:
96
96
  return actionButton(element, className, dataElementId, title, isEnabled, actions, action);
97
97
  case TaskbarElement.DIVIDER:
98
- return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium", "data-taskbar-divider": true });
98
+ return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin--none ez-margin-left--medium", "data-taskbar-divider": true });
99
99
  case TaskbarElement.DATA_EXPORTER:
100
100
  const provider = (_a = store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
101
101
  return h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId, "data-taskbar-element": element });
@@ -171,7 +171,9 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
171
171
  }
172
172
  observeButtons() {
173
173
  this._definitions = undefined;
174
- requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
174
+ requestAnimationFrame(() => {
175
+ requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
176
+ });
175
177
  }
176
178
  // Internal methods
177
179
  elementsFromString(strButtons) {
@@ -326,7 +328,7 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
326
328
  this._customElementsId.push(elementId);
327
329
  (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.addNotOverFlowElement(elementId);
328
330
  }
329
- return h("span", { key: elementId, id: elementId });
331
+ return h("span", { class: "ez-padding-left--medium", key: elementId, id: elementId });
330
332
  }
331
333
  getCustomElements() {
332
334
  var _a, _b;
@@ -450,12 +452,7 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
450
452
  let index = 0;
451
453
  return (h(Host, { class: this.getHostClasses() }, this.removeEmpty(this._definitions.map((elem) => {
452
454
  var _a, _b;
453
- if (elem === TaskbarElement.DIVIDER) {
454
- index = 0;
455
- }
456
- else {
457
- index++;
458
- }
455
+ index++;
459
456
  if (TaskbarElement[elem]) {
460
457
  return this.getElement(index, TaskbarElement[elem]);
461
458
  }
@@ -8,7 +8,7 @@ import './filter-item-type.enum-d45e026f.js';
8
8
  import './form-config-fetcher-f121f880.js';
9
9
  import { d as VIEW_MODE } from './constants-8457af36.js';
10
10
  import { A as AutorizationType } from './auth-fetcher-17dc5b5e.js';
11
- import { T as TaskbarElement } from './taskbar-elements-846c027c.js';
11
+ import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
12
12
  import './PrintUtils-3e4ff0f5.js';
13
13
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
14
14
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { StringUtils, ElementIDUtils, ApplicationContext, JSUtils, FloatingManager } from '@sankhyalabs/core';
3
- import { T as TaskbarElement } from './taskbar-elements-846c027c.js';
3
+ import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
4
4
  import './DataFetcher-a650ae58.js';
5
5
  import './pesquisa-fetcher-f05a12ca.js';
6
6
  import { P as PresentationMode } from './index-0ece87a6.js';
@@ -10,9 +10,9 @@ import '@sankhyalabs/ezui/dist/collection/utils/constants';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
11
  import './filter-item-type.enum-d45e026f.js';
12
12
  import './form-config-fetcher-f121f880.js';
13
- import { T as TaskbarElement } from './taskbar-elements-846c027c.js';
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-47443f7c.js';
15
+ import { S as SnkGuidesViewer } from './snk-guides-viewer-8b679ee6.js';
16
16
  import { S as SnkMessageBuilder } from './SnkMessageBuilder-9747ddd2.js';
17
17
  import './ConfigStorage-39ed8aeb.js';
18
18
  import './PrintUtils-3e4ff0f5.js';
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils, ApplicationContext, StringUtils, DataType } from '@sankhyalabs/core';
3
3
  import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
4
- import { T as TaskbarElement } from './taskbar-elements-846c027c.js';
4
+ import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
5
5
  import { C as ConfigStorage } from './ConfigStorage-39ed8aeb.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';
@@ -3,7 +3,7 @@ import { Action, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { S as SnkFormConfigManager } from './SnkFormConfigManager-dd450734.js';
4
4
  import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
5
  import { o as openFieldSearch, T as TaskbarProcessor, b as buildFieldSearch } from './field-search-efbe307f.js';
6
- import { T as TaskbarElement } from './taskbar-elements-846c027c.js';
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
9
  import './pesquisa-fetcher-f05a12ca.js';
@@ -1,4 +1,4 @@
1
- export { S as snk_guides_viewer } from './snk-guides-viewer-47443f7c.js';
1
+ export { S as snk_guides_viewer } from './snk-guides-viewer-8b679ee6.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
4
  import './SnkFormConfigManager-dd450734.js';
@@ -10,7 +10,7 @@ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
10
  import './filter-item-type.enum-d45e026f.js';
11
11
  import '@sankhyalabs/ezui/dist/collection/utils/form';
12
12
  import './field-search-efbe307f.js';
13
- import './taskbar-elements-846c027c.js';
13
+ import './taskbar-elements-2473c8ac.js';
14
14
  import './index-0ece87a6.js';
15
15
  import './index-bdf75557.js';
16
16
  import './constants-8457af36.js';
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { StringUtils, ApplicationContext, ObjectUtils, DataType, UserInterface, JSUtils, FloatingManager, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { d as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-8457af36.js';
4
- import { T as TaskbarElement } from './taskbar-elements-846c027c.js';
4
+ import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
5
5
  import './DataFetcher-a650ae58.js';
6
6
  import { I as InMemoryLoader } from './pesquisa-fetcher-f05a12ca.js';
7
7
  import { S as SnkMultiSelectionListDataSource, C as CrudUtils } from './SnkMultiSelectionListDataSource-7e7eada5.js';
@@ -20,6 +20,9 @@ import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
20
20
  import './ResourceIDUtils-a114189a.js';
21
21
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
22
22
 
23
+ const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
24
+ const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
25
+
23
26
  const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:max-content;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;min-height:300px}ez-form.sc-snk-simple-crud{min-height:300px}";
24
27
 
25
28
  const SnkSimpleCrud = class {
@@ -31,8 +34,6 @@ const SnkSimpleCrud = class {
31
34
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
32
35
  this.configuratorSave = createEvent(this, "configuratorSave", 7);
33
36
  this.configuratorCancel = createEvent(this, "configuratorCancel", 7);
34
- this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
35
- this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
36
37
  this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
37
38
  this._keyDownHandler = (event) => this.keyDownListener(event);
38
39
  this._taskbarProcessor = new TaskbarProcessor({
@@ -64,7 +65,7 @@ const SnkSimpleCrud = class {
64
65
  this.showConfiguratorButtons = undefined;
65
66
  }
66
67
  getButtons(selected, changeModeBtn) {
67
- return this.addConfigButton(this.resolveInMemoryBtns(selected ? this.REGULAR_DEFAULT_BTNS : this.REGULAR_SELECTED_BTNS)
68
+ return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
68
69
  .concat(changeModeBtn));
69
70
  }
70
71
  addConfigButton(buttons) {
@@ -338,9 +339,7 @@ const SnkSimpleCrud = class {
338
339
  return (_b = (_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : this._formFields;
339
340
  }
340
341
  handleFormSetFields(fields) {
341
- if (!ObjectUtils.equals(this._formFields, fields)) {
342
- this._formFields = fields !== null && fields !== void 0 ? fields : [];
343
- }
342
+ this._formFields = fields !== null && fields !== void 0 ? fields : [];
344
343
  }
345
344
  fieldsOptionLoader(argument) {
346
345
  const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
@@ -441,13 +440,15 @@ const SnkSimpleCrud = class {
441
440
  }
442
441
  /* istanbul ignore next */
443
442
  render() {
444
- var _a, _b, _c;
443
+ var _a;
445
444
  if (this.dataUnit == undefined) {
446
445
  return;
447
446
  }
448
447
  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)
449
448
  ? undefined
450
- : 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._showFormConfig ? "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), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this._showFormConfig && 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._resourceID, 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._resourceID }))));
449
+ : 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._showFormConfig ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.formConfig,
450
+ // config={this._formConfigManager?.getConfig(this.dataState?.insertionMode, this.dataUnit)}
451
+ fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this._showFormConfig && 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._resourceID, 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._resourceID }))));
451
452
  }
452
453
  get _element() { return getElement(this); }
453
454
  static get watchers() { return {
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { StringUtils, ApplicationContext, OVERFLOWED_CLASS_NAME, OverflowWatcher, OverflowDirection, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { A as AuthorizationConfig } from './AuthorizationConfig-dcbd207a.js';
4
- import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-846c027c.js';
4
+ import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-2473c8ac.js';
5
5
  import { P as PresentationMode } from './index-0ece87a6.js';
6
6
  import './index-bdf75557.js';
7
7
 
@@ -54,7 +54,9 @@ const SnkTaskbar = class {
54
54
  }
55
55
  observeButtons() {
56
56
  this._definitions = undefined;
57
- requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
57
+ requestAnimationFrame(() => {
58
+ requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
59
+ });
58
60
  }
59
61
  // Internal methods
60
62
  elementsFromString(strButtons) {
@@ -209,7 +211,7 @@ const SnkTaskbar = class {
209
211
  this._customElementsId.push(elementId);
210
212
  (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.addNotOverFlowElement(elementId);
211
213
  }
212
- return h("span", { key: elementId, id: elementId });
214
+ return h("span", { class: "ez-padding-left--medium", key: elementId, id: elementId });
213
215
  }
214
216
  getCustomElements() {
215
217
  var _a, _b;
@@ -333,12 +335,7 @@ const SnkTaskbar = class {
333
335
  let index = 0;
334
336
  return (h(Host, { class: this.getHostClasses() }, this.removeEmpty(this._definitions.map((elem) => {
335
337
  var _a, _b;
336
- if (elem === TaskbarElement.DIVIDER) {
337
- index = 0;
338
- }
339
- else {
340
- index++;
341
- }
338
+ index++;
342
339
  if (TaskbarElement[elem]) {
343
340
  return this.getElement(index, TaskbarElement[elem]);
344
341
  }