@sankhyalabs/sankhyablocks 8.4.1 → 8.5.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 (65) hide show
  1. package/dist/cjs/{ConfigStorage-fb53e5ef.js → ConfigStorage-c26705cc.js} +14 -1
  2. package/dist/cjs/{SnkFormConfigManager-eb7d2863.js → SnkFormConfigManager-12cd719b.js} +1 -1
  3. package/dist/cjs/snk-application.cjs.entry.js +1 -1
  4. package/dist/cjs/snk-attach.cjs.entry.js +2 -2
  5. package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
  6. package/dist/cjs/{snk-data-unit-7cc1846d.js → snk-data-unit-b662d63d.js} +0 -3
  7. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  8. package/dist/cjs/snk-detail-view.cjs.entry.js +3 -3
  9. package/dist/cjs/snk-filter-bar.cjs.entry.js +1 -1
  10. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -1
  11. package/dist/cjs/snk-form.cjs.entry.js +2 -2
  12. package/dist/cjs/snk-grid-config.cjs.entry.js +1 -1
  13. package/dist/cjs/snk-grid.cjs.entry.js +1 -1
  14. package/dist/cjs/{snk-guides-viewer-d1ad91bc.js → snk-guides-viewer-2c68848e.js} +1 -1
  15. package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
  16. package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
  17. package/dist/cjs/snk-simple-crud.cjs.entry.js +2 -2
  18. package/dist/collection/components/snk-attach/snk-attach.css +6 -0
  19. package/dist/collection/components/snk-attach/snk-attach.js +1 -1
  20. package/dist/collection/components/snk-data-unit/snk-data-unit.js +0 -10
  21. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +8 -2
  22. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +1 -1
  23. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +14 -1
  24. package/dist/components/ConfigStorage.js +14 -1
  25. package/dist/components/snk-attach2.js +2 -2
  26. package/dist/components/snk-data-unit2.js +0 -3
  27. package/dist/components/snk-simple-crud2.js +2 -2
  28. package/dist/esm/{ConfigStorage-2e1bc7e8.js → ConfigStorage-a4720a6a.js} +14 -1
  29. package/dist/esm/{SnkFormConfigManager-dfec39b7.js → SnkFormConfigManager-c470c66a.js} +1 -1
  30. package/dist/esm/snk-application.entry.js +1 -1
  31. package/dist/esm/snk-attach.entry.js +2 -2
  32. package/dist/esm/snk-data-exporter.entry.js +1 -1
  33. package/dist/esm/{snk-data-unit-1715d2f1.js → snk-data-unit-2d34567d.js} +0 -3
  34. package/dist/esm/snk-data-unit.entry.js +1 -1
  35. package/dist/esm/snk-detail-view.entry.js +3 -3
  36. package/dist/esm/snk-filter-bar.entry.js +1 -1
  37. package/dist/esm/snk-filter-modal-item.entry.js +1 -1
  38. package/dist/esm/snk-form.entry.js +2 -2
  39. package/dist/esm/snk-grid-config.entry.js +1 -1
  40. package/dist/esm/snk-grid.entry.js +1 -1
  41. package/dist/esm/{snk-guides-viewer-0ddda0e3.js → snk-guides-viewer-b2b75165.js} +1 -1
  42. package/dist/esm/snk-guides-viewer.entry.js +3 -3
  43. package/dist/esm/snk-personalized-filter.entry.js +1 -1
  44. package/dist/esm/snk-simple-crud.entry.js +2 -2
  45. package/dist/sankhyablocks/{p-7554931d.entry.js → p-267e8015.entry.js} +1 -1
  46. package/dist/sankhyablocks/{p-af528a79.entry.js → p-2d31c988.entry.js} +1 -1
  47. package/dist/sankhyablocks/{p-e1cb1f0b.js → p-309115f6.js} +1 -1
  48. package/dist/sankhyablocks/{p-2299d7ab.entry.js → p-34674758.entry.js} +1 -1
  49. package/dist/sankhyablocks/{p-01997cbe.entry.js → p-376c885b.entry.js} +1 -1
  50. package/dist/sankhyablocks/{p-42ec116e.js → p-38faeb78.js} +1 -1
  51. package/dist/sankhyablocks/{p-2f06d6b3.entry.js → p-45547a32.entry.js} +1 -1
  52. package/dist/sankhyablocks/{p-dcd8addc.entry.js → p-5f0a3361.entry.js} +1 -1
  53. package/dist/sankhyablocks/{p-2ecd24f8.entry.js → p-62e95771.entry.js} +1 -1
  54. package/dist/sankhyablocks/{p-a28eb16d.js → p-761ccda4.js} +6 -6
  55. package/dist/sankhyablocks/{p-363917d8.entry.js → p-7b66470d.entry.js} +1 -1
  56. package/dist/sankhyablocks/p-7b806346.entry.js +1 -0
  57. package/dist/sankhyablocks/{p-60d44a52.js → p-b28f0ae0.js} +1 -1
  58. package/dist/sankhyablocks/{p-82fea73a.entry.js → p-c203ce53.entry.js} +1 -1
  59. package/dist/sankhyablocks/{p-fd2a9a9d.entry.js → p-dff866ca.entry.js} +1 -1
  60. package/dist/sankhyablocks/{p-5fc1c8c2.entry.js → p-e0c68cfc.entry.js} +1 -1
  61. package/dist/sankhyablocks/{p-2693e46d.entry.js → p-ff7002d5.entry.js} +1 -1
  62. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  63. package/package.json +1 -1
  64. package/dist/collection/components/snk-data-unit/snk-data-unit.css +0 -6
  65. package/dist/sankhyablocks/p-324ce41e.entry.js +0 -1
@@ -2,6 +2,7 @@
2
2
 
3
3
  const formConfigFetcher = require('./form-config-fetcher-037d16de.js');
4
4
  const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
5
+ const core = require('@sankhyalabs/core');
5
6
  const DataFetcher = require('./DataFetcher-3f9e6ee2.js');
6
7
 
7
8
  class GridConfigFetcher extends formConfigFetcher.ResourceFetcher {
@@ -139,7 +140,19 @@ class FilterBarConfigFetcher extends formConfigFetcher.ResourceFetcher {
139
140
  var _a, _b;
140
141
  if (item.type === filterItemType_enum.FilterItemType.MULTI_LIST) {
141
142
  const multiListValue = item.value;
142
- item.value = (_b = (_a = multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.elements) !== null && _a !== void 0 ? _a : multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.members) !== null && _b !== void 0 ? _b : multiListValue;
143
+ /**
144
+ * Existe um bug no HTML5 onde ele salva a configuração do filtro na FilterBar como objeto em vez de array
145
+ * Esse cenário ocorre quando há apenas um item na configuração do filtro
146
+ */
147
+ let multilistValueArray = (_b = (_a = multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.elements) !== null && _a !== void 0 ? _a : multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.members) !== null && _b !== void 0 ? _b : multiListValue;
148
+ // Precisamos verificar se o objeto existe ou está unfefined
149
+ multilistValueArray = multilistValueArray !== null && multilistValueArray !== void 0 ? multilistValueArray : [];
150
+ multilistValueArray = Array.isArray(multilistValueArray) ? multilistValueArray : [multilistValueArray];
151
+ // Existem cenários onde o HTML5 não salva o Id do filtro, apenas seu label e value
152
+ multilistValueArray = multilistValueArray.map(itemRaw => {
153
+ return Object.assign(Object.assign({}, itemRaw), { id: itemRaw.id ? itemRaw.id : itemRaw.value });
154
+ });
155
+ item.value = core.ObjectUtils.copy(multilistValueArray);
143
156
  }
144
157
  return item;
145
158
  });
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const ConfigStorage = require('./ConfigStorage-fb53e5ef.js');
3
+ const ConfigStorage = require('./ConfigStorage-c26705cc.js');
4
4
  const core = require('@sankhyalabs/core');
5
5
  const formConfigFetcher = require('./form-config-fetcher-037d16de.js');
6
6
 
@@ -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 utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
- const ConfigStorage = require('./ConfigStorage-fb53e5ef.js');
8
+ const ConfigStorage = require('./ConfigStorage-c26705cc.js');
9
9
  const DataFetcher = require('./DataFetcher-3f9e6ee2.js');
10
10
  const authFetcher = require('./auth-fetcher-8ba4a15e.js');
11
11
  const dataunitFetcher = require('./dataunit-fetcher-f4023df4.js');
@@ -338,7 +338,7 @@ const crudConfig = {
338
338
  },
339
339
  };
340
340
 
341
- const snkAttachCss = ".snk-attach__header.sc-snk-attach,.snk-attach__crud-section.sc-snk-attach{padding:0 var(--space--lg)}.snk-attach__file-info.sc-snk-attach{padding:var(--space--small);max-width:50%}";
341
+ const snkAttachCss = ".snk-attach__header.sc-snk-attach,.snk-attach__crud-section.sc-snk-attach{padding:0 var(--space--lg)}.snk-attach__file-info.sc-snk-attach{padding:var(--space--small);max-width:50%}.snk-attach__main.sc-snk-attach{height:85%}.ez-box__container.sc-snk-attach{height:100%}";
342
342
 
343
343
  const RESOURCE_ID = 'AnexoSistema';
344
344
  const DATA_UNIT_NAME = 'br.com.sankhya.core.v3.anexoSistema';
@@ -436,7 +436,7 @@ const SnkAttach = class {
436
436
  var _a, _b;
437
437
  if (!this.dataUnit)
438
438
  return null;
439
- return (index.h("main", null, index.h("header", { class: "snk-attach__header" }, index.h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, index.h("div", { slot: "rightSlot" }, index.h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), index.h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, index.h("div", { class: "ez-box__container" }, index.h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this.dataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick }, index.h("div", { slot: "snkSimpleCrudHeader" }, index.h("div", { class: "ez-flex ez-flex--column" }, index.h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), index.h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
439
+ return (index.h("main", { class: "snk-attach__main" }, index.h("header", { class: "snk-attach__header" }, index.h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, index.h("div", { slot: "rightSlot" }, index.h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), index.h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, index.h("div", { class: "ez-box__container" }, index.h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this.dataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick }, index.h("div", { slot: "snkSimpleCrudHeader" }, index.h("div", { class: "ez-flex ez-flex--column" }, index.h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), index.h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
440
440
  }
441
441
  static get watchers() { return {
442
442
  "registerKey": ["registerKeyWatcher"]
@@ -8,7 +8,7 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const index = require('./index-0e663819.js');
9
9
  const constants = require('./constants-d187e03e.js');
10
10
  const DataFetcher = require('./DataFetcher-3f9e6ee2.js');
11
- const snkDataUnit = require('./snk-data-unit-7cc1846d.js');
11
+ const snkDataUnit = require('./snk-data-unit-b662d63d.js');
12
12
  require('./_commonjsHelpers-537d719a.js');
13
13
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
14
  require('./PrintUtils-bcaeb82f.js');
@@ -5,8 +5,6 @@ const core = require('@sankhyalabs/core');
5
5
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
6
6
  const SnkMessageBuilder = require('./SnkMessageBuilder-d0abb63d.js');
7
7
 
8
- const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%;width:100%}";
9
-
10
8
  const SnkDataUnit = class {
11
9
  constructor(hostRef) {
12
10
  index.registerInstance(this, hostRef);
@@ -447,6 +445,5 @@ class DataStateImpl {
447
445
  return this.selectionInfo.records;
448
446
  }
449
447
  }
450
- SnkDataUnit.style = snkDataUnitCss;
451
448
 
452
449
  exports.SnkDataUnit = SnkDataUnit;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkDataUnit = require('./snk-data-unit-7cc1846d.js');
5
+ const snkDataUnit = require('./snk-data-unit-b662d63d.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
8
  require('@sankhyalabs/ezui/dist/collection/utils');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-f9e81701.js');
6
- const SnkFormConfigManager = require('./SnkFormConfigManager-eb7d2863.js');
6
+ const SnkFormConfigManager = require('./SnkFormConfigManager-12cd719b.js');
7
7
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
8
8
  require('./DataFetcher-3f9e6ee2.js');
9
9
  require('./pesquisa-fetcher-b5b42098.js');
@@ -16,9 +16,9 @@ require('./filter-item-type.enum-aa823a00.js');
16
16
  require('./form-config-fetcher-037d16de.js');
17
17
  const taskbarElements = require('./taskbar-elements-39949c7a.js');
18
18
  const constants = require('./constants-d187e03e.js');
19
- const snkGuidesViewer = require('./snk-guides-viewer-d1ad91bc.js');
19
+ const snkGuidesViewer = require('./snk-guides-viewer-2c68848e.js');
20
20
  const SnkMessageBuilder = require('./SnkMessageBuilder-d0abb63d.js');
21
- require('./ConfigStorage-fb53e5ef.js');
21
+ require('./ConfigStorage-c26705cc.js');
22
22
  require('./_commonjsHelpers-537d719a.js');
23
23
  require('./PrintUtils-bcaeb82f.js');
24
24
  require('./index-102ba62d.js');
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index$1 = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const EzScrollDirection = require('@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection');
8
- const ConfigStorage = require('./ConfigStorage-fb53e5ef.js');
8
+ const ConfigStorage = require('./ConfigStorage-c26705cc.js');
9
9
  const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
10
10
  const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
11
11
  const index = require('./index-c5771aba.js');
@@ -6,7 +6,7 @@ const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
8
8
  const presentationMode = require('./presentationMode-52ec3bdd.js');
9
- const ConfigStorage = require('./ConfigStorage-fb53e5ef.js');
9
+ const ConfigStorage = require('./ConfigStorage-c26705cc.js');
10
10
  const filterType_enum = require('./filter-type.enum-b14ce507.js');
11
11
  require('./form-config-fetcher-037d16de.js');
12
12
  require('./DataFetcher-3f9e6ee2.js');
@@ -4,9 +4,9 @@ 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 SnkFormConfigManager = require('./SnkFormConfigManager-eb7d2863.js');
7
+ const SnkFormConfigManager = require('./SnkFormConfigManager-12cd719b.js');
8
8
  const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
9
- require('./ConfigStorage-fb53e5ef.js');
9
+ require('./ConfigStorage-c26705cc.js');
10
10
  require('./form-config-fetcher-037d16de.js');
11
11
  require('./DataFetcher-3f9e6ee2.js');
12
12
  require('./_commonjsHelpers-537d719a.js');
@@ -6,7 +6,7 @@ const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const CheckMode = require('@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode');
9
- const ConfigStorage = require('./ConfigStorage-fb53e5ef.js');
9
+ const ConfigStorage = require('./ConfigStorage-c26705cc.js');
10
10
  const constants = require('./constants-d187e03e.js');
11
11
  require('./form-config-fetcher-037d16de.js');
12
12
  require('./DataFetcher-3f9e6ee2.js');
@@ -6,7 +6,7 @@ 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
8
  const taskbarElements = require('./taskbar-elements-39949c7a.js');
9
- const ConfigStorage = require('./ConfigStorage-fb53e5ef.js');
9
+ const ConfigStorage = require('./ConfigStorage-c26705cc.js');
10
10
  const index$1 = require('./index-0e663819.js');
11
11
  const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
12
12
  const index$2 = require('./index-102ba62d.js');
@@ -2,7 +2,7 @@
2
2
 
3
3
  const index = require('./index-f9e81701.js');
4
4
  const core = require('@sankhyalabs/core');
5
- const SnkFormConfigManager = require('./SnkFormConfigManager-eb7d2863.js');
5
+ const SnkFormConfigManager = require('./SnkFormConfigManager-12cd719b.js');
6
6
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
7
7
  const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
8
8
  const taskbarElements = require('./taskbar-elements-39949c7a.js');
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkGuidesViewer = require('./snk-guides-viewer-d1ad91bc.js');
5
+ const snkGuidesViewer = require('./snk-guides-viewer-2c68848e.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
- require('./SnkFormConfigManager-eb7d2863.js');
9
- require('./ConfigStorage-fb53e5ef.js');
8
+ require('./SnkFormConfigManager-12cd719b.js');
9
+ require('./ConfigStorage-c26705cc.js');
10
10
  require('./form-config-fetcher-037d16de.js');
11
11
  require('./DataFetcher-3f9e6ee2.js');
12
12
  require('./_commonjsHelpers-537d719a.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 PersonalizedFilterUtils = require('./PersonalizedFilterUtils-1aeb625d.js');
8
- const ConfigStorage = require('./ConfigStorage-fb53e5ef.js');
8
+ const ConfigStorage = require('./ConfigStorage-c26705cc.js');
9
9
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
10
10
  const index$1 = require('./index-c5771aba.js');
11
11
  const index$2 = require('./index-102ba62d.js');
@@ -106,7 +106,7 @@ class InMemoryLoader {
106
106
  }
107
107
  InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME = "InMemoryDataUnit";
108
108
 
109
- 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:auto;row-gap:12px;height:100%;width:100%}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;min-height:300px}ez-form.sc-snk-simple-crud{min-height:300px}";
109
+ 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}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;min-height:300px}ez-form.sc-snk-simple-crud{min-height:300px}";
110
110
 
111
111
  const SnkSimpleCrud = class {
112
112
  constructor(hostRef) {
@@ -281,7 +281,7 @@ const SnkSimpleCrud = class {
281
281
  }
282
282
  render() {
283
283
  var _a;
284
- 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-flex ez-box ez-box--shadow" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", 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, 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", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
284
+ 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 ez-margin-bottom--large", 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, 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", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
285
285
  ? undefined
286
286
  : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
287
287
  }
@@ -6,3 +6,9 @@
6
6
  padding: var(--space--small);
7
7
  max-width: 50%;
8
8
  }
9
+ .snk-attach__main{
10
+ height: 85%;
11
+ }
12
+ .ez-box__container{
13
+ height: 100%;
14
+ }
@@ -98,7 +98,7 @@ export class SnkAttach {
98
98
  var _a, _b;
99
99
  if (!this.dataUnit)
100
100
  return null;
101
- return (h("main", null, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this.dataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
101
+ return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this.dataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
102
102
  }
103
103
  static get is() { return "snk-attach"; }
104
104
  static get encapsulation() { return "scoped"; }
@@ -406,16 +406,6 @@ export class SnkDataUnit {
406
406
  }
407
407
  static get is() { return "snk-data-unit"; }
408
408
  static get encapsulation() { return "scoped"; }
409
- static get originalStyleUrls() {
410
- return {
411
- "$": ["snk-data-unit.css"]
412
- };
413
- }
414
- static get styleUrls() {
415
- return {
416
- "$": ["snk-data-unit.css"]
417
- };
418
- }
419
409
  static get properties() {
420
410
  return {
421
411
  "dataState": {
@@ -6,12 +6,16 @@
6
6
 
7
7
  .simple-crud__container {
8
8
  display: grid;
9
- grid-template-rows: auto;
9
+ grid-template-rows: max-content;
10
10
  row-gap: 12px;
11
11
  height: 100%;
12
12
  width: 100%;
13
13
  }
14
14
 
15
+ .simple-crud__container-section {
16
+ flex-wrap: unset;
17
+ flex-direction: column;
18
+ }
15
19
  ez-grid {
16
20
  --ez-grid__container--shadow: none;
17
21
  min-height: 300px;
@@ -19,4 +23,6 @@ ez-grid {
19
23
 
20
24
  ez-form {
21
25
  min-height: 300px;
22
- }
26
+ }
27
+
28
+
@@ -174,7 +174,7 @@ export class SnkSimpleCrud {
174
174
  }
175
175
  render() {
176
176
  var _a;
177
- 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-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", 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, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
177
+ 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 ez-margin-bottom--large", 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, 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", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
178
178
  ? undefined
179
179
  : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
180
180
  }
@@ -12,6 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  };
13
13
  import FilterItemType from '../../../../components/snk-filter-bar/filter-item/filter-item-type.enum';
14
14
  import { ResourceFetcher } from './resource-fetcher';
15
+ import { ObjectUtils } from '@sankhyalabs/core';
15
16
  function normalizeValue(value, type) {
16
17
  if (value == undefined) {
17
18
  return value;
@@ -96,7 +97,19 @@ export default class FilterBarConfigFetcher extends ResourceFetcher {
96
97
  var _a, _b;
97
98
  if (item.type === FilterItemType.MULTI_LIST) {
98
99
  const multiListValue = item.value;
99
- item.value = (_b = (_a = multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.elements) !== null && _a !== void 0 ? _a : multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.members) !== null && _b !== void 0 ? _b : multiListValue;
100
+ /**
101
+ * Existe um bug no HTML5 onde ele salva a configuração do filtro na FilterBar como objeto em vez de array
102
+ * Esse cenário ocorre quando há apenas um item na configuração do filtro
103
+ */
104
+ let multilistValueArray = (_b = (_a = multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.elements) !== null && _a !== void 0 ? _a : multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.members) !== null && _b !== void 0 ? _b : multiListValue;
105
+ // Precisamos verificar se o objeto existe ou está unfefined
106
+ multilistValueArray = multilistValueArray !== null && multilistValueArray !== void 0 ? multilistValueArray : [];
107
+ multilistValueArray = Array.isArray(multilistValueArray) ? multilistValueArray : [multilistValueArray];
108
+ // Existem cenários onde o HTML5 não salva o Id do filtro, apenas seu label e value
109
+ multilistValueArray = multilistValueArray.map(itemRaw => {
110
+ return Object.assign(Object.assign({}, itemRaw), { id: itemRaw.id ? itemRaw.id : itemRaw.value });
111
+ });
112
+ item.value = ObjectUtils.copy(multilistValueArray);
100
113
  }
101
114
  return item;
102
115
  });
@@ -1,5 +1,6 @@
1
1
  import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher.js';
2
2
  import { F as FilterItemType } from './filter-item-type.enum.js';
3
+ import { ObjectUtils } from '@sankhyalabs/core';
3
4
  import { d as dist, D as DataFetcher } from './DataFetcher.js';
4
5
 
5
6
  var __rest = (undefined && undefined.__rest) || function (s, e) {
@@ -97,7 +98,19 @@ class FilterBarConfigFetcher extends ResourceFetcher {
97
98
  var _a, _b;
98
99
  if (item.type === FilterItemType.MULTI_LIST) {
99
100
  const multiListValue = item.value;
100
- item.value = (_b = (_a = multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.elements) !== null && _a !== void 0 ? _a : multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.members) !== null && _b !== void 0 ? _b : multiListValue;
101
+ /**
102
+ * Existe um bug no HTML5 onde ele salva a configuração do filtro na FilterBar como objeto em vez de array
103
+ * Esse cenário ocorre quando há apenas um item na configuração do filtro
104
+ */
105
+ let multilistValueArray = (_b = (_a = multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.elements) !== null && _a !== void 0 ? _a : multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.members) !== null && _b !== void 0 ? _b : multiListValue;
106
+ // Precisamos verificar se o objeto existe ou está unfefined
107
+ multilistValueArray = multilistValueArray !== null && multilistValueArray !== void 0 ? multilistValueArray : [];
108
+ multilistValueArray = Array.isArray(multilistValueArray) ? multilistValueArray : [multilistValueArray];
109
+ // Existem cenários onde o HTML5 não salva o Id do filtro, apenas seu label e value
110
+ multilistValueArray = multilistValueArray.map(itemRaw => {
111
+ return Object.assign(Object.assign({}, itemRaw), { id: itemRaw.id ? itemRaw.id : itemRaw.value });
112
+ });
113
+ item.value = ObjectUtils.copy(multilistValueArray);
101
114
  }
102
115
  return item;
103
116
  });
@@ -333,7 +333,7 @@ const crudConfig = {
333
333
  },
334
334
  };
335
335
 
336
- const snkAttachCss = ".snk-attach__header.sc-snk-attach,.snk-attach__crud-section.sc-snk-attach{padding:0 var(--space--lg)}.snk-attach__file-info.sc-snk-attach{padding:var(--space--small);max-width:50%}";
336
+ const snkAttachCss = ".snk-attach__header.sc-snk-attach,.snk-attach__crud-section.sc-snk-attach{padding:0 var(--space--lg)}.snk-attach__file-info.sc-snk-attach{padding:var(--space--small);max-width:50%}.snk-attach__main.sc-snk-attach{height:85%}.ez-box__container.sc-snk-attach{height:100%}";
337
337
 
338
338
  const RESOURCE_ID = 'AnexoSistema';
339
339
  const DATA_UNIT_NAME = 'br.com.sankhya.core.v3.anexoSistema';
@@ -432,7 +432,7 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
432
432
  var _a, _b;
433
433
  if (!this.dataUnit)
434
434
  return null;
435
- return (h("main", null, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this.dataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
435
+ return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this.dataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
436
436
  }
437
437
  static get watchers() { return {
438
438
  "registerKey": ["registerKeyWatcher"]
@@ -3,8 +3,6 @@ import { Action, ObjectUtils, JSUtils, ApplicationContext, DataType } from '@san
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { O as OperationMap, S as SnkMessageBuilder } from './SnkMessageBuilder.js';
5
5
 
6
- const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%;width:100%}";
7
-
8
6
  const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
9
7
  constructor() {
10
8
  super();
@@ -423,7 +421,6 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
423
421
  "dataUnit": ["observeDataUnit"],
424
422
  "messagesBuilder": ["observeMessagesBuilder"]
425
423
  }; }
426
- static get style() { return snkDataUnitCss; }
427
424
  }, [2, "snk-data-unit", {
428
425
  "dataState": [1040],
429
426
  "messagesBuilder": [1040],
@@ -101,7 +101,7 @@ class InMemoryLoader {
101
101
  }
102
102
  InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME = "InMemoryDataUnit";
103
103
 
104
- 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:auto;row-gap:12px;height:100%;width:100%}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;min-height:300px}ez-form.sc-snk-simple-crud{min-height:300px}";
104
+ 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}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;min-height:300px}ez-form.sc-snk-simple-crud{min-height:300px}";
105
105
 
106
106
  const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
107
107
  constructor() {
@@ -277,7 +277,7 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
277
277
  }
278
278
  render() {
279
279
  var _a;
280
- 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-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", 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, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
280
+ 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 ez-margin-bottom--large", 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, 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", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
281
281
  ? undefined
282
282
  : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
283
283
  }
@@ -1,5 +1,6 @@
1
1
  import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-5df96b19.js';
2
2
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
3
+ import { ObjectUtils } from '@sankhyalabs/core';
3
4
  import { d as dist, D as DataFetcher } from './DataFetcher-bc95bc22.js';
4
5
 
5
6
  class GridConfigFetcher extends ResourceFetcher {
@@ -137,7 +138,19 @@ class FilterBarConfigFetcher extends ResourceFetcher {
137
138
  var _a, _b;
138
139
  if (item.type === FilterItemType.MULTI_LIST) {
139
140
  const multiListValue = item.value;
140
- item.value = (_b = (_a = multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.elements) !== null && _a !== void 0 ? _a : multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.members) !== null && _b !== void 0 ? _b : multiListValue;
141
+ /**
142
+ * Existe um bug no HTML5 onde ele salva a configuração do filtro na FilterBar como objeto em vez de array
143
+ * Esse cenário ocorre quando há apenas um item na configuração do filtro
144
+ */
145
+ let multilistValueArray = (_b = (_a = multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.elements) !== null && _a !== void 0 ? _a : multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.members) !== null && _b !== void 0 ? _b : multiListValue;
146
+ // Precisamos verificar se o objeto existe ou está unfefined
147
+ multilistValueArray = multilistValueArray !== null && multilistValueArray !== void 0 ? multilistValueArray : [];
148
+ multilistValueArray = Array.isArray(multilistValueArray) ? multilistValueArray : [multilistValueArray];
149
+ // Existem cenários onde o HTML5 não salva o Id do filtro, apenas seu label e value
150
+ multilistValueArray = multilistValueArray.map(itemRaw => {
151
+ return Object.assign(Object.assign({}, itemRaw), { id: itemRaw.id ? itemRaw.id : itemRaw.value });
152
+ });
153
+ item.value = ObjectUtils.copy(multilistValueArray);
141
154
  }
142
155
  return item;
143
156
  });
@@ -1,4 +1,4 @@
1
- import { C as ConfigStorage } from './ConfigStorage-2e1bc7e8.js';
1
+ import { C as ConfigStorage } from './ConfigStorage-a4720a6a.js';
2
2
  import { ObjectUtils } from '@sankhyalabs/core';
3
3
  import { F as FormConfigFetcher } from './form-config-fetcher-5df96b19.js';
4
4
 
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, OnboardingUtils, DependencyType, ElementIDUtils, DataType, ApplicationContext, ErrorTracking } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
- import { C as ConfigStorage } from './ConfigStorage-2e1bc7e8.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-a4720a6a.js';
5
5
  import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-bc95bc22.js';
6
6
  import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-c76146d0.js';
7
7
  import { D as DataUnitFetcher } from './dataunit-fetcher-b64f839d.js';
@@ -334,7 +334,7 @@ const crudConfig = {
334
334
  },
335
335
  };
336
336
 
337
- const snkAttachCss = ".snk-attach__header.sc-snk-attach,.snk-attach__crud-section.sc-snk-attach{padding:0 var(--space--lg)}.snk-attach__file-info.sc-snk-attach{padding:var(--space--small);max-width:50%}";
337
+ const snkAttachCss = ".snk-attach__header.sc-snk-attach,.snk-attach__crud-section.sc-snk-attach{padding:0 var(--space--lg)}.snk-attach__file-info.sc-snk-attach{padding:var(--space--small);max-width:50%}.snk-attach__main.sc-snk-attach{height:85%}.ez-box__container.sc-snk-attach{height:100%}";
338
338
 
339
339
  const RESOURCE_ID = 'AnexoSistema';
340
340
  const DATA_UNIT_NAME = 'br.com.sankhya.core.v3.anexoSistema';
@@ -432,7 +432,7 @@ const SnkAttach = class {
432
432
  var _a, _b;
433
433
  if (!this.dataUnit)
434
434
  return null;
435
- return (h("main", null, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this.dataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
435
+ return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this.dataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
436
436
  }
437
437
  static get watchers() { return {
438
438
  "registerKey": ["registerKeyWatcher"]
@@ -4,7 +4,7 @@ import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/
4
4
  import { D as DataExporterOption, a as DataExporterFormat, b as DataExporterType } from './index-1564817d.js';
5
5
  import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-3644f1b6.js';
6
6
  import { D as DataFetcher } from './DataFetcher-bc95bc22.js';
7
- import { S as SnkDataUnit } from './snk-data-unit-1715d2f1.js';
7
+ import { S as SnkDataUnit } from './snk-data-unit-2d34567d.js';
8
8
  import './_commonjsHelpers-9943807e.js';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
10
  import './PrintUtils-3e4ff0f5.js';
@@ -3,8 +3,6 @@ import { Action, ObjectUtils, JSUtils, ApplicationContext, DataType } from '@san
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { O as OperationMap, S as SnkMessageBuilder } from './SnkMessageBuilder-68c1c25a.js';
5
5
 
6
- const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%;width:100%}";
7
-
8
6
  const SnkDataUnit = class {
9
7
  constructor(hostRef) {
10
8
  registerInstance(this, hostRef);
@@ -445,6 +443,5 @@ class DataStateImpl {
445
443
  return this.selectionInfo.records;
446
444
  }
447
445
  }
448
- SnkDataUnit.style = snkDataUnitCss;
449
446
 
450
447
  export { SnkDataUnit as S };
@@ -1,4 +1,4 @@
1
- export { S as snk_data_unit } from './snk-data-unit-1715d2f1.js';
1
+ export { S as snk_data_unit } from './snk-data-unit-2d34567d.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
4
  import '@sankhyalabs/ezui/dist/collection/utils';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host } from './index-a7d3d3f1.js';
2
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-dfec39b7.js';
2
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-c470c66a.js';
3
3
  import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
4
4
  import './DataFetcher-bc95bc22.js';
5
5
  import './pesquisa-fetcher-7e282f7e.js';
@@ -12,9 +12,9 @@ import './filter-item-type.enum-5028ed3f.js';
12
12
  import './form-config-fetcher-5df96b19.js';
13
13
  import { T as TaskbarElement } from './taskbar-elements-0a6b8b95.js';
14
14
  import { c as VIEW_MODE } from './constants-3644f1b6.js';
15
- import { S as SnkGuidesViewer } from './snk-guides-viewer-0ddda0e3.js';
15
+ import { S as SnkGuidesViewer } from './snk-guides-viewer-b2b75165.js';
16
16
  import { S as SnkMessageBuilder } from './SnkMessageBuilder-68c1c25a.js';
17
- import './ConfigStorage-2e1bc7e8.js';
17
+ import './ConfigStorage-a4720a6a.js';
18
18
  import './_commonjsHelpers-9943807e.js';
19
19
  import './PrintUtils-3e4ff0f5.js';
20
20
  import './index-bdf75557.js';
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { DataType, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
4
- import { C as ConfigStorage } from './ConfigStorage-2e1bc7e8.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-a4720a6a.js';
5
5
  import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
6
6
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
7
7
  import { F as FilterOperand } from './index-ae591a44.js';
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
2
2
  import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
4
4
  import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
5
- import { C as ConfigStorage } from './ConfigStorage-2e1bc7e8.js';
5
+ import { C as ConfigStorage } from './ConfigStorage-a4720a6a.js';
6
6
  import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
7
7
  import './form-config-fetcher-5df96b19.js';
8
8
  import './DataFetcher-bc95bc22.js';