@sankhyalabs/sankhyablocks 8.15.0-rc.15 → 8.15.0-rc.17

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 (91) hide show
  1. package/dist/cjs/{SnkMessageBuilder-141aa18d.js → SnkMessageBuilder-66aa2557.js} +4 -0
  2. package/dist/cjs/{SnkMultiSelectionListDataSource-1438f8f2.js → SnkMultiSelectionListDataSource-02d18283.js} +1 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{pesquisa-fetcher-94f6b316.js → pesquisa-fetcher-02a4d132.js} +2 -2
  5. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  6. package/dist/cjs/snk-actions-button_4.cjs.entry.js +1 -1
  7. package/dist/cjs/snk-application.cjs.entry.js +2 -2
  8. package/dist/cjs/snk-attach.cjs.entry.js +1 -1
  9. package/dist/cjs/snk-crud.cjs.entry.js +1 -1
  10. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  11. package/dist/cjs/{snk-data-unit-6026a9f7.js → snk-data-unit-41c29713.js} +1 -1
  12. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  13. package/dist/cjs/snk-detail-view.cjs.entry.js +3 -3
  14. package/dist/cjs/snk-filter-bar.cjs.entry.js +16 -4
  15. package/dist/cjs/snk-filter-detail.cjs.entry.js +4 -1
  16. package/dist/cjs/snk-filter-item.cjs.entry.js +10 -6
  17. package/dist/cjs/snk-grid.cjs.entry.js +2 -2
  18. package/dist/cjs/{snk-guides-viewer-25721856.js → snk-guides-viewer-3df90eac.js} +1 -1
  19. package/dist/cjs/snk-guides-viewer.cjs.entry.js +2 -2
  20. package/dist/cjs/snk-simple-crud.cjs.entry.js +14 -5
  21. package/dist/cjs/snk-taskbar.cjs.entry.js +24 -2
  22. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +22 -1
  23. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +28 -6
  24. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +2 -1
  25. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +15 -3
  26. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +5 -2
  27. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +11 -2
  28. package/dist/collection/components/snk-taskbar/snk-taskbar.js +28 -2
  29. package/dist/collection/lib/dataUnit/InMemoryLoader.js +2 -2
  30. package/dist/collection/lib/message/resources/snk-simple-crud.msg.js +4 -0
  31. package/dist/components/SnkMessageBuilder.js +4 -0
  32. package/dist/components/dataunit-fetcher.js +2 -2
  33. package/dist/components/snk-filter-bar2.js +16 -4
  34. package/dist/components/snk-filter-detail2.js +5 -1
  35. package/dist/components/snk-filter-item2.js +11 -6
  36. package/dist/components/snk-simple-crud2.js +12 -3
  37. package/dist/components/snk-taskbar2.js +27 -3
  38. package/dist/esm/{SnkMessageBuilder-9747ddd2.js → SnkMessageBuilder-0a4becdd.js} +4 -0
  39. package/dist/esm/{SnkMultiSelectionListDataSource-aad5d4ff.js → SnkMultiSelectionListDataSource-df4f8aa2.js} +1 -1
  40. package/dist/esm/loader.js +1 -1
  41. package/dist/esm/{pesquisa-fetcher-f05a12ca.js → pesquisa-fetcher-9801cfff.js} +2 -2
  42. package/dist/esm/sankhyablocks.js +1 -1
  43. package/dist/esm/snk-actions-button_4.entry.js +1 -1
  44. package/dist/esm/snk-application.entry.js +2 -2
  45. package/dist/esm/snk-attach.entry.js +1 -1
  46. package/dist/esm/snk-crud.entry.js +1 -1
  47. package/dist/esm/snk-data-exporter.entry.js +2 -2
  48. package/dist/esm/{snk-data-unit-4c343635.js → snk-data-unit-de1d140d.js} +1 -1
  49. package/dist/esm/snk-data-unit.entry.js +2 -2
  50. package/dist/esm/snk-detail-view.entry.js +3 -3
  51. package/dist/esm/snk-filter-bar.entry.js +16 -4
  52. package/dist/esm/snk-filter-detail.entry.js +4 -1
  53. package/dist/esm/snk-filter-item.entry.js +10 -6
  54. package/dist/esm/snk-grid.entry.js +2 -2
  55. package/dist/esm/{snk-guides-viewer-b94752f2.js → snk-guides-viewer-c8a9c590.js} +1 -1
  56. package/dist/esm/snk-guides-viewer.entry.js +2 -2
  57. package/dist/esm/snk-simple-crud.entry.js +14 -5
  58. package/dist/esm/snk-taskbar.entry.js +24 -2
  59. package/dist/sankhyablocks/p-07a61550.entry.js +1 -0
  60. package/dist/sankhyablocks/{p-400097f2.entry.js → p-1b878222.entry.js} +1 -1
  61. package/dist/sankhyablocks/p-32556aa6.js +1 -0
  62. package/dist/sankhyablocks/{p-a1642e7c.entry.js → p-4d96cf6e.entry.js} +1 -1
  63. package/dist/sankhyablocks/{p-9a5d1b39.js → p-52c8e589.js} +1 -1
  64. package/dist/sankhyablocks/p-54a5d52a.entry.js +1 -0
  65. package/dist/sankhyablocks/{p-85ba3d6b.entry.js → p-5d64130f.entry.js} +1 -1
  66. package/dist/sankhyablocks/{p-88b29791.js → p-6fcb4437.js} +1 -1
  67. package/dist/sankhyablocks/{p-2d919e32.entry.js → p-85af23fe.entry.js} +1 -1
  68. package/dist/sankhyablocks/{p-b47c2963.entry.js → p-8b2dae93.entry.js} +1 -1
  69. package/dist/sankhyablocks/{p-d5cb4b5a.entry.js → p-950f4eff.entry.js} +1 -1
  70. package/dist/sankhyablocks/p-af2b94a3.entry.js +1 -0
  71. package/dist/sankhyablocks/{p-9e8618ec.entry.js → p-af589270.entry.js} +1 -1
  72. package/dist/sankhyablocks/p-b10b9934.entry.js +1 -0
  73. package/dist/sankhyablocks/{p-0bba5c9f.entry.js → p-bb3d7d9b.entry.js} +1 -1
  74. package/dist/sankhyablocks/{p-d78d4062.js → p-d9c585d8.js} +1 -1
  75. package/dist/sankhyablocks/p-e8763234.entry.js +1 -0
  76. package/dist/sankhyablocks/{p-6c9adfca.js → p-f375a652.js} +1 -1
  77. package/dist/sankhyablocks/{p-0e31adc0.entry.js → p-f7d0fab9.entry.js} +1 -1
  78. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  79. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +4 -0
  80. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +6 -2
  81. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +2 -0
  82. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +1 -0
  83. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +6 -0
  84. package/dist/types/components.d.ts +16 -0
  85. package/package.json +1 -1
  86. package/dist/sankhyablocks/p-2936303b.js +0 -1
  87. package/dist/sankhyablocks/p-86801b08.entry.js +0 -1
  88. package/dist/sankhyablocks/p-a043314f.entry.js +0 -1
  89. package/dist/sankhyablocks/p-d304659d.entry.js +0 -1
  90. package/dist/sankhyablocks/p-d6317851.entry.js +0 -1
  91. package/dist/sankhyablocks/p-e7dbe53a.entry.js +0 -1
@@ -4,11 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
+ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
7
8
  const constants = require('./constants-35ddd366.js');
8
9
  const taskbarElements = require('./taskbar-elements-3ecd1278.js');
9
10
  require('./DataFetcher-99f0f6ed.js');
10
- const pesquisaFetcher = require('./pesquisa-fetcher-94f6b316.js');
11
- const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-1438f8f2.js');
11
+ const pesquisaFetcher = require('./pesquisa-fetcher-02a4d132.js');
12
+ const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-02d18283.js');
12
13
  const index$1 = require('./index-0922807b.js');
13
14
  require('./ISave-e91b70a7.js');
14
15
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -27,7 +28,7 @@ require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilt
27
28
  const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
28
29
  const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
29
30
 
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}";
31
+ const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;row-gap:12px;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";
31
32
 
32
33
  const SnkSimpleCrud = class {
33
34
  constructor(hostRef) {
@@ -176,10 +177,15 @@ const SnkSimpleCrud = class {
176
177
  this._showPopUpGridConfig = true;
177
178
  });
178
179
  }
179
- openFormConfig() {
180
+ async openFormConfig() {
181
+ var _a, _b;
180
182
  //No momento não daremos suporte para configuraçao de formulário quando houver legacy config
181
- if (this.formLegacyConfigName)
183
+ if (this.formLegacyConfigName) {
184
+ const title = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.formConfigUnavaliable.title", undefined);
185
+ const message = (_b = this.messagesBuilder) === null || _b === void 0 ? void 0 : _b.getMessage("snkSimpleCrud.formConfigUnavaliable.message", undefined);
186
+ await this.application.alert(title, message);
182
187
  return;
188
+ }
183
189
  this._showFormConfig = true;
184
190
  }
185
191
  addGridLegacyConfigName() {
@@ -248,6 +254,9 @@ const SnkSimpleCrud = class {
248
254
  this.onModeChange();
249
255
  this.configDatasource();
250
256
  }
257
+ componentDidLoad() {
258
+ utils.CSSVarsUtils.applyVarsGrid(this._element, this._grid);
259
+ }
251
260
  configDatasource() {
252
261
  this._multiSelectionListDataSource.setApplication(this.application);
253
262
  this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
@@ -41,6 +41,8 @@ const SnkTaskbar = class {
41
41
  this._customElementsId = undefined;
42
42
  this._slotContainer = undefined;
43
43
  this._hiddenActionsList = [];
44
+ this._lastWidth = undefined;
45
+ this._hasToUpdateOverFlow = false;
44
46
  this.alignRigth = false;
45
47
  this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
46
48
  this.customContainerId = undefined;
@@ -66,6 +68,11 @@ const SnkTaskbar = class {
66
68
  var _a;
67
69
  (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate();
68
70
  }
71
+ observeLastWidth(newValue, oldValue) {
72
+ if (oldValue === 0 && newValue !== 0) {
73
+ this._hasToUpdateOverFlow = true;
74
+ }
75
+ }
69
76
  // Internal methods
70
77
  elementsFromString(strButtons) {
71
78
  const elements = [];
@@ -249,10 +256,20 @@ const SnkTaskbar = class {
249
256
  this.getCustomElements();
250
257
  }
251
258
  componentWillRender() {
259
+ this.handleDefinitions();
260
+ this.validatePresentationMode();
261
+ this.updateOverFlowIfNeeded();
262
+ }
263
+ handleDefinitions() {
252
264
  if (this._definitions == undefined && this._permissions) {
253
265
  this._definitions = this.elementsFromString(this.buttons);
254
266
  }
255
- this.validatePresentationMode();
267
+ }
268
+ updateOverFlowIfNeeded() {
269
+ if (this._hasToUpdateOverFlow) {
270
+ requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
271
+ this._hasToUpdateOverFlow = false;
272
+ }
256
273
  }
257
274
  handleOverFlow(overFlowingElements) {
258
275
  const elementsToHandle = overFlowingElements.filter(element => !this.hasToIgnoreOverFlow(element));
@@ -319,6 +336,10 @@ const SnkTaskbar = class {
319
336
  }
320
337
  componentDidRender() {
321
338
  this.appendCustomElementsInTaskbar();
339
+ this.updateLastWidth();
340
+ }
341
+ updateLastWidth() {
342
+ this._lastWidth = this._element.getBoundingClientRect().width;
322
343
  }
323
344
  disconnectedCallback() {
324
345
  var _a;
@@ -365,7 +386,8 @@ const SnkTaskbar = class {
365
386
  get _element() { return index.getElement(this); }
366
387
  static get watchers() { return {
367
388
  "buttons": ["observeButtons"],
368
- "disabledButtons": ["observeDisabledButtons"]
389
+ "disabledButtons": ["observeDisabledButtons"],
390
+ "_lastWidth": ["observeLastWidth"]
369
391
  }; }
370
392
  };
371
393
  SnkTaskbar.style = snkTaskbarCss;
@@ -8,6 +8,7 @@ export class SnkFilterDetail {
8
8
  constructor() {
9
9
  this.config = undefined;
10
10
  this.getMessage = undefined;
11
+ this.showHardFixed = true;
11
12
  }
12
13
  /**
13
14
  * Exibe o componente snk-filter-detail.
@@ -85,7 +86,9 @@ export class SnkFilterDetail {
85
86
  return Object.assign(Object.assign({}, item), { visible: false, fixed: false, value: undefined });
86
87
  }
87
88
  getPopUpHeaderButtons() {
88
- return (h(Fragment, null, !this.config.removalBlocked && this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), !this.config.hardFixed && this.buildIcon(this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), this.config.fixed ? "un-pin" : "push-pin", () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })))));
89
+ return (h(Fragment, null, !this.config.removalBlocked &&
90
+ this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), this.showHardFixed && !this.config.hardFixed &&
91
+ this.buildIcon(this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), this.config.fixed ? "un-pin" : "push-pin", () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })))));
89
92
  }
90
93
  buildIcon(title, iconName, action) {
91
94
  return (h("button", { onClick: () => action(), class: "sc-snk-filter-bar snk-filter-item__editor-header-button", ref: elem => elem && this.buildIdButton(elem, title) }, h("ez-icon", Object.assign({ title: title, iconName: iconName }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`_${title}`)}` }))));
@@ -196,6 +199,24 @@ export class SnkFilterDetail {
196
199
  "tags": [],
197
200
  "text": "Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder."
198
201
  }
202
+ },
203
+ "showHardFixed": {
204
+ "type": "boolean",
205
+ "mutable": false,
206
+ "complexType": {
207
+ "original": "boolean",
208
+ "resolved": "boolean",
209
+ "references": {}
210
+ },
211
+ "required": false,
212
+ "optional": false,
213
+ "docs": {
214
+ "tags": [],
215
+ "text": "Controla a visibilidade do bot\u00E3o de fixar elemento"
216
+ },
217
+ "attribute": "show-hard-fixed",
218
+ "reflect": false,
219
+ "defaultValue": "true"
199
220
  }
200
221
  };
201
222
  }
@@ -14,6 +14,7 @@ export class SnkFilterItem {
14
14
  this.detailIsVisible = undefined;
15
15
  this.config = undefined;
16
16
  this.getMessage = undefined;
17
+ this.showChips = true;
17
18
  }
18
19
  observeDetailIsVisible(value) {
19
20
  this.visibleChanged.emit(value);
@@ -45,19 +46,22 @@ export class SnkFilterItem {
45
46
  autoClose: true,
46
47
  innerClickTest: this.innerClickCheck,
47
48
  backClickListener: () => this.onDetailCloseCallback(),
48
- left: this.getScrollOffsetLeft(),
49
- top: this.getScrollOffsetTop(),
49
+ left: this.getOffsetLeft(),
50
+ top: this.getOffsetTop(),
50
51
  useOverlay: true,
51
52
  overlayClassName: 'ez-scrim ez-scrim--light',
52
53
  isFixed: true
53
54
  };
54
55
  }
55
- getScrollOffsetLeft() {
56
+ getOffsetLeft() {
56
57
  const padding = getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");
57
58
  const rect = this._filterItemElement.getBoundingClientRect();
58
- return `calc(${rect.x}px + ${padding})`;
59
+ // Width baseado no conteudo do snk-filter-detail. Nesse momento ele retorna 0px pois ainda não foi criado em tela.
60
+ const filterDetailWidth = 430;
61
+ const adjustRightPosition = filterDetailWidth - (document.body.clientWidth - rect.left);
62
+ return `calc(${rect.x}px + ${padding} - ${adjustRightPosition > 0 ? adjustRightPosition : 0}px)`;
59
63
  }
60
- getScrollOffsetTop() {
64
+ getOffsetTop() {
61
65
  const rect = this._filterItemElement.getBoundingClientRect();
62
66
  return (rect.y + rect.height) + "px";
63
67
  }
@@ -289,7 +293,7 @@ export class SnkFilterItem {
289
293
  }
290
294
  render() {
291
295
  const leftIcon = this.getLeftIconName();
292
- return (h(Host, null, h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail }))));
296
+ return (h(Host, null, this.showChips && (h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon && (h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" })), h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" }))), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail, showHardFixed: this.showChips }))));
293
297
  }
294
298
  static get is() { return "snk-filter-item"; }
295
299
  static get properties() {
@@ -327,6 +331,24 @@ export class SnkFilterItem {
327
331
  "tags": [],
328
332
  "text": "Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder."
329
333
  }
334
+ },
335
+ "showChips": {
336
+ "type": "boolean",
337
+ "mutable": false,
338
+ "complexType": {
339
+ "original": "boolean",
340
+ "resolved": "boolean",
341
+ "references": {}
342
+ },
343
+ "required": false,
344
+ "optional": false,
345
+ "docs": {
346
+ "tags": [],
347
+ "text": "Usado para controlar a visibilidade dos chips de filtros"
348
+ },
349
+ "attribute": "show-chips",
350
+ "reflect": false,
351
+ "defaultValue": "true"
330
352
  }
331
353
  };
332
354
  }
@@ -22,7 +22,8 @@
22
22
  }
23
23
 
24
24
  :host([data-mode="hidden"]) {
25
- display: none;
25
+ width: 0px;
26
+ height: 0px;
26
27
  }
27
28
 
28
29
  :host([data-mode="button"]) {
@@ -245,6 +245,17 @@ export class SnkFilterBar {
245
245
  filterActiveFilter(item) {
246
246
  return item.visible || item.removalBlocked;
247
247
  }
248
+ filterPersonalizedItems(item) {
249
+ return item.type === FilterItemType.PERSONALIZED;
250
+ }
251
+ getPersonalizedFilterVariableItems() {
252
+ return this.filterConfig
253
+ .filter(this.filterPersonalizedItems)
254
+ .map(item => {
255
+ const itemId = `filter-${item.id}`;
256
+ return (h("snk-filter-item", { key: item.id, id: itemId, config: Object.assign({}, item), onFocusin: () => this.itemFocused(itemId), onVisibleChanged: (evt) => this.scrollerLocked = evt.detail, onFilterChange: (event) => this.updateFilter(event.detail), getMessage: (key, props) => this.getMessage(key, props), showChips: false }));
257
+ });
258
+ }
248
259
  getFilterItems() {
249
260
  const pinnedItems = [];
250
261
  const unpinnedItems = [];
@@ -430,9 +441,10 @@ export class SnkFilterBar {
430
441
  if (this.showPersonalizedFilter) {
431
442
  return h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.handleHidePersonalizedFilter(false), onEzAfterSave: () => this.handleHidePersonalizedFilter(true), entityUri: this.dataUnit.name, configName: this.configName, resourceID: this.resourceID });
432
443
  }
433
- if (this.mode === "button")
434
- return (h(Host, { "data-mode": this.mode }, h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) })));
435
- return (h(Host, { "data-mode": this.mode }, h("div", null, h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
444
+ if (this.mode !== "regular") {
445
+ return (h(Host, { "data-mode": this.mode }, this.getPersonalizedFilterVariableItems(), this.mode === 'button' && (h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }))));
446
+ }
447
+ return (h(Host, null, h("div", null, h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
436
448
  }
437
449
  static get is() { return "snk-filter-bar"; }
438
450
  static get encapsulation() { return "scoped"; }
@@ -2,11 +2,14 @@
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
5
+
6
+ /*@doc Define a altura minima da grid.*/
7
+ --snk-simple-crud-grid--min-height: 300px;
5
8
  }
6
9
 
7
10
  .simple-crud__container {
8
11
  display: grid;
9
- grid-template-rows: max-content;
12
+ grid-template-rows: auto 1fr;
10
13
  row-gap: 12px;
11
14
  height: 100%;
12
15
  width: 100%;
@@ -23,7 +26,7 @@
23
26
 
24
27
  ez-grid {
25
28
  --ez-grid__container--shadow: none;
26
- min-height: 300px;
29
+ --ez-grid--min-height: var(--snk-simple-crud-grid--min-height);
27
30
  }
28
31
 
29
32
  ez-form {
@@ -1,4 +1,5 @@
1
1
  import { ApplicationContext, DataType, ElementIDUtils, FloatingManager, JSUtils, ObjectUtils, StringUtils, UserInterface, } from '@sankhyalabs/core';
2
+ import { CSSVarsUtils } from "@sankhyalabs/ezui/dist/collection/utils";
2
3
  import { h } from '@stencil/core';
3
4
  import { SIMPLE_CRUD_MODE, VIEW_MODE } from '../../lib/utils/constants';
4
5
  import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
@@ -150,10 +151,15 @@ export class SnkSimpleCrud {
150
151
  this._showPopUpGridConfig = true;
151
152
  });
152
153
  }
153
- openFormConfig() {
154
+ async openFormConfig() {
155
+ var _a, _b;
154
156
  //No momento não daremos suporte para configuraçao de formulário quando houver legacy config
155
- if (this.formLegacyConfigName)
157
+ if (this.formLegacyConfigName) {
158
+ const title = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.formConfigUnavaliable.title", undefined);
159
+ const message = (_b = this.messagesBuilder) === null || _b === void 0 ? void 0 : _b.getMessage("snkSimpleCrud.formConfigUnavaliable.message", undefined);
160
+ await this.application.alert(title, message);
156
161
  return;
162
+ }
157
163
  this._showFormConfig = true;
158
164
  }
159
165
  addGridLegacyConfigName() {
@@ -222,6 +228,9 @@ export class SnkSimpleCrud {
222
228
  this.onModeChange();
223
229
  this.configDatasource();
224
230
  }
231
+ componentDidLoad() {
232
+ CSSVarsUtils.applyVarsGrid(this._element, this._grid);
233
+ }
225
234
  configDatasource() {
226
235
  this._multiSelectionListDataSource.setApplication(this.application);
227
236
  this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
@@ -31,6 +31,8 @@ export class SnkTaskbar {
31
31
  this._customElementsId = undefined;
32
32
  this._slotContainer = undefined;
33
33
  this._hiddenActionsList = [];
34
+ this._lastWidth = undefined;
35
+ this._hasToUpdateOverFlow = false;
34
36
  this.alignRigth = false;
35
37
  this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
36
38
  this.customContainerId = undefined;
@@ -56,6 +58,11 @@ export class SnkTaskbar {
56
58
  var _a;
57
59
  (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate();
58
60
  }
61
+ observeLastWidth(newValue, oldValue) {
62
+ if (oldValue === 0 && newValue !== 0) {
63
+ this._hasToUpdateOverFlow = true;
64
+ }
65
+ }
59
66
  // Internal methods
60
67
  elementsFromString(strButtons) {
61
68
  const elements = [];
@@ -239,10 +246,20 @@ export class SnkTaskbar {
239
246
  this.getCustomElements();
240
247
  }
241
248
  componentWillRender() {
249
+ this.handleDefinitions();
250
+ this.validatePresentationMode();
251
+ this.updateOverFlowIfNeeded();
252
+ }
253
+ handleDefinitions() {
242
254
  if (this._definitions == undefined && this._permissions) {
243
255
  this._definitions = this.elementsFromString(this.buttons);
244
256
  }
245
- this.validatePresentationMode();
257
+ }
258
+ updateOverFlowIfNeeded() {
259
+ if (this._hasToUpdateOverFlow) {
260
+ requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
261
+ this._hasToUpdateOverFlow = false;
262
+ }
246
263
  }
247
264
  handleOverFlow(overFlowingElements) {
248
265
  const elementsToHandle = overFlowingElements.filter(element => !this.hasToIgnoreOverFlow(element));
@@ -309,6 +326,10 @@ export class SnkTaskbar {
309
326
  }
310
327
  componentDidRender() {
311
328
  this.appendCustomElementsInTaskbar();
329
+ this.updateLastWidth();
330
+ }
331
+ updateLastWidth() {
332
+ this._lastWidth = this._element.getBoundingClientRect().width;
312
333
  }
313
334
  disconnectedCallback() {
314
335
  var _a;
@@ -640,7 +661,9 @@ export class SnkTaskbar {
640
661
  "_customElements": {},
641
662
  "_customElementsId": {},
642
663
  "_slotContainer": {},
643
- "_hiddenActionsList": {}
664
+ "_hiddenActionsList": {},
665
+ "_lastWidth": {},
666
+ "_hasToUpdateOverFlow": {}
644
667
  };
645
668
  }
646
669
  static get events() {
@@ -669,6 +692,9 @@ export class SnkTaskbar {
669
692
  }, {
670
693
  "propName": "disabledButtons",
671
694
  "methodName": "observeDisabledButtons"
695
+ }, {
696
+ "propName": "_lastWidth",
697
+ "methodName": "observeLastWidth"
672
698
  }];
673
699
  }
674
700
  }
@@ -13,10 +13,10 @@ export default class InMemoryLoader {
13
13
  this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
14
14
  }
15
15
  getRecordsToLoad() {
16
- if (this._initialRecords == undefined || this.dataUnit.records.length > 0) {
16
+ if (this._initialRecords == undefined && this.dataUnit.records.length > 0) {
17
17
  this._initialRecords = this.dataUnit.records;
18
18
  }
19
- return this._initialRecords;
19
+ return [...this._initialRecords, ...this.dataUnit.getAddedRecords()];
20
20
  }
21
21
  get dataUnit() {
22
22
  return this._dataUnit;
@@ -1,4 +1,8 @@
1
1
  export const snkSimpleCrudMessages = {
2
2
  findColumn: "Busca de colunas",
3
+ formConfigUnavaliable: {
4
+ title: "Aviso",
5
+ message: 'A opção "Configurar formulário" será disponibilizada em breve. Enquanto isso, acesse a configuração do fomulário através dos layouts anteriores, HTML5 ou Flex.'
6
+ }
3
7
  };
4
8
  export default snkSimpleCrudMessages;
@@ -146,6 +146,10 @@ const snkCrudMessages = {
146
146
 
147
147
  const snkSimpleCrudMessages = {
148
148
  findColumn: "Busca de colunas",
149
+ formConfigUnavaliable: {
150
+ title: "Aviso",
151
+ message: 'A opção "Configurar formulário" será disponibilizada em breve. Enquanto isso, acesse a configuração do fomulário através dos layouts anteriores, HTML5 ou Flex.'
152
+ }
149
153
  };
150
154
 
151
155
  const fileViewerMessages = {
@@ -395,10 +395,10 @@ class InMemoryLoader {
395
395
  this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
396
396
  }
397
397
  getRecordsToLoad() {
398
- if (this._initialRecords == undefined || this.dataUnit.records.length > 0) {
398
+ if (this._initialRecords == undefined && this.dataUnit.records.length > 0) {
399
399
  this._initialRecords = this.dataUnit.records;
400
400
  }
401
- return this._initialRecords;
401
+ return [...this._initialRecords, ...this.dataUnit.getAddedRecords()];
402
402
  }
403
403
  get dataUnit() {
404
404
  return this._dataUnit;
@@ -253,7 +253,7 @@ class SnkFilterModalFactory {
253
253
  }
254
254
  }
255
255
 
256
- const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:1fr minmax(100px, 100%) 1fr 1fr;--snk-personalized-filter--z-index:var(--elevation--20, 20);--snk-personalized-filter--background-color:var(--background--xlight, #fff)}.snk-filter-bar__title.sc-snk-filter-bar{max-width:260px;display:inline-block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:16px;font-family:var(--font-pattern, Arial);font-weight:var(--text-weight--large, 600);color:var(--color--title-primary, #2B3A54);margin-top:8px}[data-mode=\"hidden\"].sc-snk-filter-bar-h{display:none}[data-mode=\"button\"].sc-snk-filter-bar-h{grid-template-columns:1fr;width:fit-content}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.filter-bar__personalized-filter.sc-snk-filter-bar{display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;overflow:auto;z-index:var(--snk-personalized-filter--z-index);background-color:var(--snk-personalized-filter--background-color)}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__scroller.sc-snk-filter-bar{height:calc(100% + var(--space-extra-small, 3px))}.snk-filter-bar__filter-item-container.sc-snk-filter-bar{display:flex;align-self:center}.snk-filter-bar__scroller.sc-snk-filter-bar .sc-snk-filter-bar:first-child{margin-left:var(--space-extra-small, 3px)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}";
256
+ const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:1fr minmax(100px, 100%) 1fr 1fr;--snk-personalized-filter--z-index:var(--elevation--20, 20);--snk-personalized-filter--background-color:var(--background--xlight, #fff)}.snk-filter-bar__title.sc-snk-filter-bar{max-width:260px;display:inline-block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:16px;font-family:var(--font-pattern, Arial);font-weight:var(--text-weight--large, 600);color:var(--color--title-primary, #2B3A54);margin-top:8px}[data-mode=\"hidden\"].sc-snk-filter-bar-h{width:0px;height:0px}[data-mode=\"button\"].sc-snk-filter-bar-h{grid-template-columns:1fr;width:fit-content}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.filter-bar__personalized-filter.sc-snk-filter-bar{display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;overflow:auto;z-index:var(--snk-personalized-filter--z-index);background-color:var(--snk-personalized-filter--background-color)}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__scroller.sc-snk-filter-bar{height:calc(100% + var(--space-extra-small, 3px))}.snk-filter-bar__filter-item-container.sc-snk-filter-bar{display:flex;align-self:center}.snk-filter-bar__scroller.sc-snk-filter-bar .sc-snk-filter-bar:first-child{margin-left:var(--space-extra-small, 3px)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}";
257
257
 
258
258
  const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
259
259
  constructor() {
@@ -496,6 +496,17 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
496
496
  filterActiveFilter(item) {
497
497
  return item.visible || item.removalBlocked;
498
498
  }
499
+ filterPersonalizedItems(item) {
500
+ return item.type === FilterItemType.PERSONALIZED;
501
+ }
502
+ getPersonalizedFilterVariableItems() {
503
+ return this.filterConfig
504
+ .filter(this.filterPersonalizedItems)
505
+ .map(item => {
506
+ const itemId = `filter-${item.id}`;
507
+ return (h("snk-filter-item", { key: item.id, id: itemId, config: Object.assign({}, item), onFocusin: () => this.itemFocused(itemId), onVisibleChanged: (evt) => this.scrollerLocked = evt.detail, onFilterChange: (event) => this.updateFilter(event.detail), getMessage: (key, props) => this.getMessage(key, props), showChips: false }));
508
+ });
509
+ }
499
510
  getFilterItems() {
500
511
  const pinnedItems = [];
501
512
  const unpinnedItems = [];
@@ -681,9 +692,10 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
681
692
  if (this.showPersonalizedFilter) {
682
693
  return h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.handleHidePersonalizedFilter(false), onEzAfterSave: () => this.handleHidePersonalizedFilter(true), entityUri: this.dataUnit.name, configName: this.configName, resourceID: this.resourceID });
683
694
  }
684
- if (this.mode === "button")
685
- return (h(Host, { "data-mode": this.mode }, h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) })));
686
- return (h(Host, { "data-mode": this.mode }, h("div", null, h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
695
+ if (this.mode !== "regular") {
696
+ return (h(Host, { "data-mode": this.mode }, this.getPersonalizedFilterVariableItems(), this.mode === 'button' && (h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }))));
697
+ }
698
+ return (h(Host, null, h("div", null, h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
687
699
  }
688
700
  get _element() { return this; }
689
701
  static get watchers() { return {
@@ -12,6 +12,7 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
12
12
  this.filterChange = createEvent(this, "filterChange", 7);
13
13
  this.config = undefined;
14
14
  this.getMessage = undefined;
15
+ this.showHardFixed = true;
15
16
  }
16
17
  /**
17
18
  * Exibe o componente snk-filter-detail.
@@ -89,7 +90,9 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
89
90
  return Object.assign(Object.assign({}, item), { visible: false, fixed: false, value: undefined });
90
91
  }
91
92
  getPopUpHeaderButtons() {
92
- return (h(Fragment, null, !this.config.removalBlocked && this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), !this.config.hardFixed && this.buildIcon(this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), this.config.fixed ? "un-pin" : "push-pin", () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })))));
93
+ return (h(Fragment, null, !this.config.removalBlocked &&
94
+ this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), this.showHardFixed && !this.config.hardFixed &&
95
+ this.buildIcon(this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), this.config.fixed ? "un-pin" : "push-pin", () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })))));
93
96
  }
94
97
  buildIcon(title, iconName, action) {
95
98
  return (h("button", { onClick: () => action(), class: "sc-snk-filter-bar snk-filter-item__editor-header-button", ref: elem => elem && this.buildIdButton(elem, title) }, h("ez-icon", Object.assign({ title: title, iconName: iconName }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`_${title}`)}` }))));
@@ -170,6 +173,7 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
170
173
  }, [0, "snk-filter-detail", {
171
174
  "config": [1040],
172
175
  "getMessage": [16],
176
+ "showHardFixed": [4, "show-hard-fixed"],
173
177
  "show": [64]
174
178
  }]);
175
179
  function defineCustomElement() {
@@ -20,6 +20,7 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
20
20
  this.detailIsVisible = undefined;
21
21
  this.config = undefined;
22
22
  this.getMessage = undefined;
23
+ this.showChips = true;
23
24
  }
24
25
  observeDetailIsVisible(value) {
25
26
  this.visibleChanged.emit(value);
@@ -51,19 +52,22 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
51
52
  autoClose: true,
52
53
  innerClickTest: this.innerClickCheck,
53
54
  backClickListener: () => this.onDetailCloseCallback(),
54
- left: this.getScrollOffsetLeft(),
55
- top: this.getScrollOffsetTop(),
55
+ left: this.getOffsetLeft(),
56
+ top: this.getOffsetTop(),
56
57
  useOverlay: true,
57
58
  overlayClassName: 'ez-scrim ez-scrim--light',
58
59
  isFixed: true
59
60
  };
60
61
  }
61
- getScrollOffsetLeft() {
62
+ getOffsetLeft() {
62
63
  const padding = getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");
63
64
  const rect = this._filterItemElement.getBoundingClientRect();
64
- return `calc(${rect.x}px + ${padding})`;
65
+ // Width baseado no conteudo do snk-filter-detail. Nesse momento ele retorna 0px pois ainda não foi criado em tela.
66
+ const filterDetailWidth = 430;
67
+ const adjustRightPosition = filterDetailWidth - (document.body.clientWidth - rect.left);
68
+ return `calc(${rect.x}px + ${padding} - ${adjustRightPosition > 0 ? adjustRightPosition : 0}px)`;
65
69
  }
66
- getScrollOffsetTop() {
70
+ getOffsetTop() {
67
71
  const rect = this._filterItemElement.getBoundingClientRect();
68
72
  return (rect.y + rect.height) + "px";
69
73
  }
@@ -295,7 +299,7 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
295
299
  }
296
300
  render() {
297
301
  const leftIcon = this.getLeftIconName();
298
- return (h(Host, null, h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail }))));
302
+ return (h(Host, null, this.showChips && (h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon && (h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" })), h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" }))), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail, showHardFixed: this.showChips }))));
299
303
  }
300
304
  get _filterItemElement() { return this; }
301
305
  static get watchers() { return {
@@ -304,6 +308,7 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
304
308
  }, [0, "snk-filter-item", {
305
309
  "config": [1040],
306
310
  "getMessage": [16],
311
+ "showChips": [4, "show-chips"],
307
312
  "detailIsVisible": [32],
308
313
  "showUp": [64],
309
314
  "hideDetail": [64]