@sankhyalabs/sankhyablocks 1.3.31-beta.17 → 1.3.31-beta.18

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 (98) hide show
  1. package/dist/cjs/{SnkMessageBuilder-cb132e6d.js → SnkMessageBuilder-02c2ca02.js} +7 -3
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  4. package/dist/cjs/snk-application.cjs.entry.js +376 -256
  5. package/dist/cjs/snk-crud.cjs.entry.js +2 -1
  6. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  7. package/dist/cjs/snk-filter-bar.cjs.entry.js +61 -13
  8. package/dist/cjs/snk-filter-detail.cjs.entry.js +6 -1
  9. package/dist/cjs/snk-filter-item.cjs.entry.js +12 -0
  10. package/dist/cjs/snk-filter-list.cjs.entry.js +2 -2
  11. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +23 -0
  12. package/dist/cjs/snk-filter-number.cjs.entry.js +2 -1
  13. package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
  14. package/dist/cjs/snk-form.cjs.entry.js +19 -1
  15. package/dist/cjs/snk-grid.cjs.entry.js +15 -5
  16. package/dist/cjs/snk-taskbar.cjs.entry.js +14 -11
  17. package/dist/cjs/{taskbar-elements-efa44ff1.js → taskbar-elements-283c737e.js} +36 -17
  18. package/dist/cjs/taskbar-processor-6bd0d35c.js +47 -0
  19. package/dist/collection/collection-manifest.json +1 -0
  20. package/dist/collection/components/snk-crud/snk-crud.js +41 -3
  21. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +64 -0
  22. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +2 -1
  23. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +1 -1
  24. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +6 -1
  25. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +35 -0
  26. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +53 -2
  27. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +15 -0
  28. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +60 -12
  29. package/dist/collection/components/snk-form/snk-form.js +41 -1
  30. package/dist/collection/components/snk-grid/snk-grid.js +35 -3
  31. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +35 -17
  32. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +43 -0
  33. package/dist/collection/components/snk-taskbar/snk-taskbar.js +36 -11
  34. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +375 -255
  35. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +7 -3
  36. package/dist/components/SnkMessageBuilder.js +7 -3
  37. package/dist/components/index.d.ts +1 -0
  38. package/dist/components/index.js +1 -0
  39. package/dist/components/snk-application2.js +375 -255
  40. package/dist/components/snk-crud.js +4 -2
  41. package/dist/components/snk-filter-bar2.js +61 -13
  42. package/dist/components/snk-filter-detail2.js +6 -1
  43. package/dist/components/snk-filter-item2.js +14 -1
  44. package/dist/components/snk-filter-list2.js +5 -2
  45. package/dist/components/snk-filter-multi-select.d.ts +11 -0
  46. package/dist/components/snk-filter-multi-select.js +39 -0
  47. package/dist/components/snk-filter-number.js +2 -1
  48. package/dist/components/snk-filter-search.js +1 -1
  49. package/dist/components/snk-form2.js +20 -1
  50. package/dist/components/snk-grid2.js +15 -4
  51. package/dist/components/snk-taskbar2.js +49 -27
  52. package/dist/components/taskbar-processor.js +45 -0
  53. package/dist/{sankhyablocks/SnkMessageBuilder-cff80920.js → esm/SnkMessageBuilder-65d431bd.js} +7 -3
  54. package/dist/esm/loader.js +1 -1
  55. package/dist/esm/sankhyablocks.js +1 -1
  56. package/dist/esm/snk-application.entry.js +376 -256
  57. package/dist/esm/snk-crud.entry.js +3 -2
  58. package/dist/esm/snk-data-unit.entry.js +1 -1
  59. package/dist/esm/snk-filter-bar.entry.js +61 -13
  60. package/dist/esm/snk-filter-detail.entry.js +6 -1
  61. package/dist/esm/snk-filter-item.entry.js +12 -0
  62. package/dist/esm/snk-filter-list.entry.js +2 -2
  63. package/dist/esm/snk-filter-multi-select.entry.js +19 -0
  64. package/dist/esm/snk-filter-number.entry.js +2 -1
  65. package/dist/esm/snk-filter-search.entry.js +1 -1
  66. package/dist/esm/snk-form.entry.js +19 -1
  67. package/dist/esm/snk-grid.entry.js +15 -5
  68. package/dist/esm/snk-taskbar.entry.js +14 -11
  69. package/dist/esm/taskbar-elements-35d64ff9.js +90 -0
  70. package/dist/esm/taskbar-processor-aa6772c9.js +45 -0
  71. package/dist/{esm/SnkMessageBuilder-cff80920.js → sankhyablocks/SnkMessageBuilder-65d431bd.js} +7 -3
  72. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  73. package/dist/sankhyablocks/snk-application.entry.js +376 -256
  74. package/dist/sankhyablocks/snk-crud.entry.js +3 -2
  75. package/dist/sankhyablocks/snk-data-unit.entry.js +1 -1
  76. package/dist/sankhyablocks/snk-filter-bar.entry.js +61 -13
  77. package/dist/sankhyablocks/snk-filter-detail.entry.js +6 -1
  78. package/dist/sankhyablocks/snk-filter-item.entry.js +12 -0
  79. package/dist/sankhyablocks/snk-filter-list.entry.js +2 -2
  80. package/dist/sankhyablocks/snk-filter-multi-select.entry.js +19 -0
  81. package/dist/sankhyablocks/snk-filter-number.entry.js +2 -1
  82. package/dist/sankhyablocks/snk-filter-search.entry.js +1 -1
  83. package/dist/sankhyablocks/snk-form.entry.js +19 -1
  84. package/dist/sankhyablocks/snk-grid.entry.js +15 -5
  85. package/dist/sankhyablocks/snk-taskbar.entry.js +14 -11
  86. package/dist/sankhyablocks/taskbar-elements-35d64ff9.js +90 -0
  87. package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +45 -0
  88. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +7 -0
  89. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +1 -0
  90. package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +3 -0
  91. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +5 -3
  92. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +3 -2
  93. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +12 -0
  94. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +17 -1
  95. package/dist/types/components.d.ts +78 -2
  96. package/package.json +1 -1
  97. package/dist/esm/taskbar-elements-c119510a.js +0 -72
  98. package/dist/sankhyablocks/taskbar-elements-c119510a.js +0 -72
@@ -5,10 +5,11 @@ import { d as defineCustomElement$3 } from './snk-filter-detail2.js';
5
5
  import { d as defineCustomElement$2 } from './snk-filter-item2.js';
6
6
  import { d as defineCustomElement$1 } from './snk-filter-list2.js';
7
7
 
8
- const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--more-visible, 1);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;flex-grow:0}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.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)}.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.preselected.sc-snk-filter-bar{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}";
8
+ const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--more-visible, 1);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;flex-grow:0}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.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)}.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.preselected.sc-snk-filter-bar{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%}";
9
9
 
10
10
  const PERSONALIZED_FILTER = "PERSONALIZED_FILTER";
11
11
  const DEFAULT_FILTER = "DEFAULT_FILTER";
12
+ const CLEAR_ALL_FILTERS = "CLEAR_ALL_FILTERS";
12
13
  const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
13
14
  constructor() {
14
15
  super();
@@ -56,6 +57,9 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
56
57
  //FIXME: ajustar o backend para não exigir parametros
57
58
  return { name: id, expression: selectedOption.expression, params: [] };
58
59
  }
60
+ if (type === FilterItemType.MULTI_SELECT) {
61
+ return { name: id, expression: props.expression, params: [{ name: id, dataType: DataType.TEXT, value }] };
62
+ }
59
63
  if (type === FilterItemType.PERIOD) {
60
64
  const { end, start } = value;
61
65
  const params = [];
@@ -127,11 +131,11 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
127
131
  getFilterItems() {
128
132
  const pinnedItems = [];
129
133
  const unpinnedItems = [];
130
- this._items = this.filterConfig
134
+ this.filterConfig
131
135
  .filter(item => item.visible)
132
136
  .sort((a, b) => this._filtersComparator(a, b))
133
- .map((item, index) => {
134
- const filterItem = (h("snk-filter-item", { config: item, class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
137
+ .forEach((item, index) => {
138
+ const filterItem = (h("snk-filter-item", { id: `filter-${item.id}`, config: item, class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
135
139
  if (item.fixed || item.hardFixed) {
136
140
  pinnedItems.push(filterItem);
137
141
  }
@@ -149,25 +153,36 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
149
153
  return elements;
150
154
  }
151
155
  calculateUpdateSequence(item) {
152
- this._updateSequence = this._updateSequence.filter(itemId => item.id !== itemId);
153
- this._updateSequence.push(item.id);
156
+ if (item) {
157
+ this._updateSequence = this._updateSequence.filter(itemId => item.id !== itemId);
158
+ this._updateSequence.push(item.id);
159
+ }
154
160
  }
155
161
  filterChangeListener(evt) {
156
162
  this.updateFilter(evt.detail);
157
163
  }
158
- updateFilter(newItem) {
164
+ updateFilter(newItem, clear = false) {
159
165
  this.calculateUpdateSequence(newItem);
160
- let needRefresh = false;
166
+ let upToDate = false;
161
167
  this.filterConfig = this.filterConfig.map(item => {
162
- if (item.id === newItem.id) {
163
- needRefresh = ObjectUtils.objectToString(item.value) !== ObjectUtils.objectToString(newItem.value);
164
- return newItem;
168
+ if (clear) {
169
+ if (item.value != undefined) {
170
+ upToDate = true;
171
+ }
172
+ return Object.assign(Object.assign({}, item), { value: undefined });
173
+ }
174
+ else {
175
+ if (item.id === newItem.id) {
176
+ upToDate = ObjectUtils.objectToString(item.value) !== ObjectUtils.objectToString(newItem.value);
177
+ return newItem;
178
+ }
165
179
  }
166
180
  return item;
167
181
  });
168
- if (needRefresh) {
182
+ if (upToDate) {
169
183
  this.dataUnit.loadData();
170
184
  }
185
+ return upToDate;
171
186
  }
172
187
  getAddListItems() {
173
188
  const hiddenItems = this.filterConfig
@@ -180,17 +195,50 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
180
195
  { name: DEFAULT_FILTER, label: this.getMessage("snkFilterBar.defaultFilter"), iconName: "configuration", kind: "FOOTER" }
181
196
  ]);
182
197
  }
198
+ getActiveClass() {
199
+ const filterApplied = this.filterConfig.filter(item => item.value != undefined).length > 0;
200
+ return filterApplied ? "sc-snk-filter-bar snk-filter-bar__filter-list-items-button--active" : "";
201
+ }
202
+ getAppliedListItems() {
203
+ const appliedItems = this.filterConfig
204
+ .filter(item => item.value != undefined)
205
+ .sort(this._filtersComparator);
206
+ return appliedItems.map(filter => {
207
+ return { name: filter.id, label: filter.label, kind: "FILTER", iconName: null };
208
+ }).concat([
209
+ { name: CLEAR_ALL_FILTERS, label: this.getMessage("snkFilterBar.clearAllFilters"), iconName: "cleaning", kind: "FOOTER" }
210
+ ]);
211
+ }
183
212
  addFilterHandler(itemName) {
184
213
  const filterItem = this.filterConfig.find(currentFilter => currentFilter.id === itemName);
185
214
  if (filterItem) {
186
215
  this.updateFilter(Object.assign(Object.assign({}, filterItem), { visible: true }));
216
+ window.requestAnimationFrame(() => {
217
+ const itemElement = this._element.querySelector("#filter-" + itemName);
218
+ if (itemElement) {
219
+ itemElement.showUp();
220
+ }
221
+ });
222
+ }
223
+ }
224
+ appliedFilterHandler(itemName) {
225
+ if (itemName === CLEAR_ALL_FILTERS) {
226
+ if (this.updateFilter(null, true)) {
227
+ this._application.info(this.getMessage("snkFilterBar.successfullyCleaned"), { iconName: "check" });
228
+ }
229
+ }
230
+ else {
231
+ const itemElement = this._element.querySelector("#filter-" + itemName);
232
+ if (itemElement) {
233
+ itemElement.showUp(true);
234
+ }
187
235
  }
188
236
  }
189
237
  render() {
190
238
  if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
191
239
  return undefined;
192
240
  }
193
- return (h(Host, null, h("ez-scroller", { direction: "horizontal" }, this.getFilterItems()), h("ez-button", { mode: "icon", size: "small", iconName: "filter", class: "ez-padding-left--medium" }), h("snk-filter-list", { items: this.getAddListItems(), label: this.getMessage("snkFilterBar.addFilter"), getMessage: (key, params) => this.getMessage(key, params), class: "ez-padding-left--medium", onSnkItemSelected: evt => this.addFilterHandler(evt.detail) }, h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
241
+ return (h(Host, null, h("ez-scroller", { direction: "horizontal" }, this.getFilterItems()), h("snk-filter-list", { items: this.getAppliedListItems(), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyAppliedFiltersList"), findFilterText: this.getMessage("snkFilterBar.findFilter"), iconName: "filter", class: "ez-padding-left--medium", buttonClass: this.getActiveClass(), onSnkItemSelected: evt => this.appliedFilterHandler(evt.detail) }), h("snk-filter-list", { items: this.getAddListItems(), label: this.getMessage("snkFilterBar.addFilter"), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyFiltersList"), findFilterText: this.getMessage("snkFilterBar.findField"), class: "ez-padding-left--medium", onSnkItemSelected: evt => this.addFilterHandler(evt.detail) }, h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
194
242
  }
195
243
  get _element() { return this; }
196
244
  static get style() { return snkFilterBarCss; }
@@ -14,6 +14,8 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
14
14
  switch (this.config.type) {
15
15
  case FilterItemType.BINARY_SELECT:
16
16
  return "snk-filter-binary-select";
17
+ case FilterItemType.MULTI_SELECT:
18
+ return "snk-filter-multi-select";
17
19
  case FilterItemType.PERIOD:
18
20
  return "snk-filter-period";
19
21
  case FilterItemType.SEARCH:
@@ -23,12 +25,15 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
23
25
  }
24
26
  return "snk-filter-text";
25
27
  }
28
+ removeItem() {
29
+ this.changeConfig(Object.assign(Object.assign({}, this.config), { visible: false, fixed: false, value: undefined }));
30
+ }
26
31
  getPopUpHeaderButtons() {
27
32
  if (this.config.hardFixed) {
28
33
  return undefined;
29
34
  }
30
35
  return ([
31
- h("ez-icon", { title: this.getMessage("snkFilterBar.removeFilter"), class: "sc-snk-filter-bar snk-filter-item__editor-header-button", iconName: "delete", onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { visible: false })) }),
36
+ h("ez-icon", { title: this.getMessage("snkFilterBar.removeFilter"), class: "sc-snk-filter-bar snk-filter-item__editor-header-button", iconName: "delete", onClick: () => this.removeItem() }),
32
37
  h("ez-icon", { title: this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), class: "ez-margin-left--small sc-snk-filter-bar snk-filter-item__editor-header-button", iconName: this.config.fixed ? "un-pin" : "push-pin", onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })) })
33
38
  ]);
34
39
  }
@@ -27,6 +27,14 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
27
27
  return false;
28
28
  };
29
29
  }
30
+ async showUp(open = false) {
31
+ this._filterItemElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
32
+ if (open) {
33
+ window.requestAnimationFrame(() => {
34
+ this.showDetail();
35
+ });
36
+ }
37
+ }
30
38
  showDetail() {
31
39
  this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, { autoClose: true, innerClickTest: this.innerClickCheck, left: this.getScrollOffset() });
32
40
  this.detailIsVisible = true;
@@ -81,6 +89,10 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
81
89
  return optTwo.label;
82
90
  }
83
91
  }
92
+ if (type === FilterItemType.MULTI_SELECT) {
93
+ const opt = props.options.find(opt => opt.value === value);
94
+ return `${label}: ${opt.label}`;
95
+ }
84
96
  if (type === FilterItemType.PERIOD) {
85
97
  const period = value;
86
98
  const dateFormater = new Intl.DateTimeFormat("pt-BR");
@@ -127,7 +139,8 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
127
139
  }, [0, "snk-filter-item", {
128
140
  "config": [1040],
129
141
  "getMessage": [16],
130
- "detailIsVisible": [32]
142
+ "detailIsVisible": [32],
143
+ "showUp": [64]
131
144
  }, [[2, "click", "clickListener"], [2, "mousedown", "mouseDownListener"], [0, "filterChange", "filterChangeListener"]]]);
132
145
  function defineCustomElement() {
133
146
  if (typeof customElements === "undefined") {
@@ -67,7 +67,7 @@ const SnkFilterList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
67
67
  getFilterItems() {
68
68
  const items = this.items ? ArrayUtils.applyStringFilter(this._filterArgument, this.items.filter(item => item.kind === "FILTER")) : [];
69
69
  if (items.length === 0) {
70
- return h("div", { class: "ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-items-container--empty" }, this.getMessage("snkFilterBar.emptyFilterList"));
70
+ return h("div", { class: "ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-items-container--empty" }, this.emptyText);
71
71
  }
72
72
  const hideItems = !this._filterArgument && !this._showAll && (items.length > MAX_FILTERS + 1);
73
73
  if (hideItems) {
@@ -80,7 +80,7 @@ const SnkFilterList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
80
80
  return this.items.filter(item => item.kind === "FOOTER");
81
81
  }
82
82
  render() {
83
- return (h(Host, { class: "ez-flex ez-flex--column" }, h("ez-button", { label: this.label, onClick: () => this.buttonClick(), mode: this.iconName ? "icon" : undefined, iconName: this.iconName, size: "small" }, h("slot", { name: "leftIcon" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("div", { class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem }, h("ez-filter-input", { ref: ref => this._filterInput = ref, mode: "slim", label: this.getMessage("snkFilterBar.findFilter"), value: this._filterArgument, onEzChange: (evt) => this._filterArgument = evt.detail }), this.getFilterItems(), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), this.items ? this.getFooterItems().map(item => this.buildItemElement(item)) : undefined))));
83
+ return (h(Host, { class: "ez-flex ez-flex--column" }, h("ez-button", { class: this.buttonClass, label: this.label, onClick: () => this.buttonClick(), mode: this.iconName ? "icon" : undefined, iconName: this.iconName, size: "small" }, h("slot", { name: "leftIcon" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("div", { class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem }, h("ez-filter-input", { ref: ref => this._filterInput = ref, mode: "slim", label: this.findFilterText, value: this._filterArgument, onEzChange: (evt) => this._filterArgument = evt.detail }), this.getFilterItems(), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), this.items ? this.getFooterItems().map(item => this.buildItemElement(item)) : undefined))));
84
84
  }
85
85
  get _element() { return this; }
86
86
  }, [4, "snk-filter-list", {
@@ -88,6 +88,9 @@ const SnkFilterList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
88
88
  "iconName": [1, "icon-name"],
89
89
  "items": [16],
90
90
  "getMessage": [16],
91
+ "emptyText": [1, "empty-text"],
92
+ "findFilterText": [1, "find-filter-text"],
93
+ "buttonClass": [1, "button-class"],
91
94
  "_filterArgument": [32],
92
95
  "_showAll": [32]
93
96
  }]);
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkFilterMultiSelect extends Components.SnkFilterMultiSelect, HTMLElement {}
4
+ export const SnkFilterMultiSelect: {
5
+ prototype: SnkFilterMultiSelect;
6
+ new (): SnkFilterMultiSelect;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,39 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+ import { F as FilterItemType } from './filter-item-type.enum.js';
3
+
4
+ const SnkFilterMultiSelect$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
5
+ constructor() {
6
+ super();
7
+ this.__registerHost();
8
+ }
9
+ ezChangeListener(evt) {
10
+ this.value = evt.detail.value;
11
+ }
12
+ render() {
13
+ if (!this.config || this.config.type !== FilterItemType.MULTI_SELECT) {
14
+ return undefined;
15
+ }
16
+ return (h("ez-combo-box", { label: this.config.label, value: this.config.value, options: this.config.props.options }));
17
+ }
18
+ }, [0, "snk-filter-multi-select", {
19
+ "value": [1544],
20
+ "config": [16]
21
+ }, [[0, "ezChange", "ezChangeListener"]]]);
22
+ function defineCustomElement$1() {
23
+ if (typeof customElements === "undefined") {
24
+ return;
25
+ }
26
+ const components = ["snk-filter-multi-select"];
27
+ components.forEach(tagName => { switch (tagName) {
28
+ case "snk-filter-multi-select":
29
+ if (!customElements.get(tagName)) {
30
+ customElements.define(tagName, SnkFilterMultiSelect$1);
31
+ }
32
+ break;
33
+ } });
34
+ }
35
+
36
+ const SnkFilterMultiSelect = SnkFilterMultiSelect$1;
37
+ const defineCustomElement = defineCustomElement$1;
38
+
39
+ export { SnkFilterMultiSelect, defineCustomElement };
@@ -10,10 +10,11 @@ const SnkFilterPeriod = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
10
10
  this.value = evt.detail;
11
11
  }
12
12
  render() {
13
+ var _a;
13
14
  if (!this.config || this.config.type !== FilterItemType.NUMBER) {
14
15
  return undefined;
15
16
  }
16
- return (h("ez-number-input", { label: this.config.label, value: this.config.value }));
17
+ return (h("ez-number-input", { label: this.config.label, value: this.config.value, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision }));
17
18
  }
18
19
  }, [0, "snk-filter-number", {
19
20
  "config": [16],
@@ -34,7 +34,7 @@ const SnkFilterSearch$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
34
34
  if (!this.config || this.config.type !== FilterItemType.SEARCH) {
35
35
  return undefined;
36
36
  }
37
- return (h("ez-search", { value: this.config.value, label: this.config.label, ref: ref => this._searchInput = ref, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument) }));
37
+ return (h("ez-search", { suppressEmptyOption: true, value: this.config.value, label: this.config.label, ref: ref => this._searchInput = ref, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument) }));
38
38
  }
39
39
  }, [0, "snk-filter-search", {
40
40
  "config": [16],
@@ -1,5 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { a as ApplicationContext } from './index2.js';
3
+ import { T as TaskbarProcessor } from './taskbar-processor.js';
3
4
  import { d as defineCustomElement$1 } from './snk-taskbar2.js';
4
5
 
5
6
  const snkFormCss = ".sc-snk-form-h{display:block}.snk-form.sc-snk-form{position:relative;padding:var(--space--large);padding-top:var(--space--medium)}.snk-form__header.sc-snk-form{position:relative;padding-top:var(--space--medium);padding-bottom:var(--space--medium);margin-bottom:var(--space--medium)}.snk-form__header--fixed.sc-snk-form{position:sticky;top:0;background:var(--background--body);z-index:var(--more-visible, 2);padding-left:var(--space--large);padding-right:var(--space--large);margin-left:calc(var(--space--large) * -1);margin-right:calc(var(--space--large) * -1);width:calc(100% + (var(--space--large) * 2))}";
@@ -10,6 +11,10 @@ const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
10
11
  this.__registerHost();
11
12
  this.exit = createEvent(this, "exit", 7);
12
13
  this.actionClick = createEvent(this, "actionClick", 7);
14
+ this._taskbarProcessor = new TaskbarProcessor({
15
+ "snkForm.regular": ["PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "GRID_MODE", "INSERT"],
16
+ "snkForm.finish_edition": ["CANCEL", "SAVE"]
17
+ });
13
18
  }
14
19
  getFormConfig() {
15
20
  return (this._dataState && this._dataState.insertionMode ? this._insertionFormConfig : this._editionFormConfig);
@@ -100,11 +105,24 @@ const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
100
105
  parent = parent.parentElement;
101
106
  }
102
107
  }
108
+ componentWillRender() {
109
+ var _a;
110
+ const taskbarId = ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "snkForm.finish_edition" : "snkForm.regular";
111
+ const disabledButtons = [];
112
+ if (!this._dataState || !this._dataState.hasPrevious) {
113
+ disabledButtons.push("PREVIOUS");
114
+ }
115
+ if (!this._dataState || !this._dataState.hasNext) {
116
+ disabledButtons.push("NEXT");
117
+ }
118
+ this._taskbarProcessor.process(taskbarId, this.taskbarManager, this._dataState, disabledButtons);
119
+ }
103
120
  render() {
121
+ var _a;
104
122
  if (!this._configLoaded || !this._dataUnit || !this._dataState) {
105
123
  return undefined;
106
124
  }
107
- return (h("section", { class: "snk-form" }, h("div", { class: "snk-form__header snk-form__header--fixed ez-row" }, h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6", key: "formHeader" }, h("ez-button", { title: this.getMessage("snkForm.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small", onClick: () => this.exitForm() }), h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.getMessage("snkForm.title"))), h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right" }, h("snk-taskbar", { key: "formTaskbar", buttons: this._dataState.isDirty ? "CANCEL,SAVE" : "PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,INSERT", primaryButton: this._dataState.isDirty ? "SAVE" : "INSERT", disabledButtons: this.getDisabledButtons(), actionsList: this.actionsList, dataUnit: this._dataUnit }))), h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { key: "ezForm" + this._snkDataUnit.entityName, dataUnit: this._dataUnit, config: this.getFormConfig(), recordsValidator: this.recordsValidator }))))));
125
+ return (h("section", { class: "snk-form" }, h("div", { class: "snk-form__header snk-form__header--fixed ez-row" }, h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6", key: "formHeader" }, h("ez-button", { title: this.getMessage("snkForm.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small", onClick: () => this.exitForm() }), h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.getMessage("snkForm.title"))), h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right" }, h("snk-taskbar", { key: "formTaskbar", buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, primaryButton: ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", dataUnit: this._dataUnit }))), h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { key: "ezForm" + this._snkDataUnit.entityName, dataUnit: this._dataUnit, config: this.getFormConfig(), recordsValidator: this.recordsValidator }))))));
108
126
  }
109
127
  get _element() { return this; }
110
128
  static get style() { return snkFormCss; }
@@ -112,6 +130,7 @@ const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
112
130
  "configName": [1, "config-name"],
113
131
  "recordsValidator": [16],
114
132
  "actionsList": [16],
133
+ "taskbarManager": [16],
115
134
  "_dataUnit": [32],
116
135
  "_configLoaded": [32],
117
136
  "_dataState": [32],
@@ -1,6 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { a as ApplicationContext } from './index2.js';
3
3
  import { T as TaskbarElement, d as defineCustomElement$1 } from './snk-taskbar2.js';
4
+ import { T as TaskbarProcessor } from './taskbar-processor.js';
4
5
  import { d as defineCustomElement$5 } from './snk-filter-bar2.js';
5
6
  import { d as defineCustomElement$4 } from './snk-filter-detail2.js';
6
7
  import { d as defineCustomElement$3 } from './snk-filter-item2.js';
@@ -14,9 +15,13 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
14
15
  this.__registerHost();
15
16
  this.actionClick = createEvent(this, "actionClick", 7);
16
17
  this.gridDoubleClick = createEvent(this, "gridDoubleClick", 7);
17
- }
18
- getHeaderButtons() {
19
- return this._dataState && this._dataState.selectedRecords.length > 0 ? "UPDATE,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,REFRESH" : "REFRESH";
18
+ this._topTaskbarProcessor = new TaskbarProcessor({
19
+ "snkGridTopTaskbar": ["FORM_MODE", "CONFIG_GRID", "INSERT"]
20
+ });
21
+ this._headerTaskbarProcessor = new TaskbarProcessor({
22
+ "snkGridHeaderTaskbar.unselected": ["REFRESH"],
23
+ "snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"]
24
+ });
20
25
  }
21
26
  actionClickHandler(evt) {
22
27
  if (evt.detail === TaskbarElement.CONFIG_GRID && this._grid) {
@@ -57,17 +62,23 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
57
62
  parent = parent.parentElement;
58
63
  }
59
64
  }
65
+ componentWillRender() {
66
+ const headerTaskbarId = this._dataState && this._dataState.selectedRecords.length > 0 ? "snkGridHeaderTaskbar.selected" : "snkGridHeaderTaskbar.unselected";
67
+ this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState);
68
+ this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState);
69
+ }
60
70
  render() {
61
71
  if (!this._configLoaded || !this._dataUnit) {
62
72
  return undefined;
63
73
  }
64
- return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-padding-bottom--medium ez-margin-bottom--medium" }, h("snk-filter-bar", { class: "snk-grid__filter-bar ez-align--top" }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", onActionClick: evt => this.actionClickHandler(evt), key: "topTaskbar", dataUnit: this._dataUnit, buttons: "FORM_MODE,CONFIG_GRID,INSERT", primaryButton: "INSERT" })), h("ez-grid", { ref: ref => this._grid = ref, dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: evt => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit() }, h("snk-taskbar", { dataUnit: this._dataUnit, buttons: this.getHeaderButtons(), slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" }))));
74
+ return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-padding-bottom--medium ez-margin-bottom--medium" }, h("snk-filter-bar", { class: "snk-grid__filter-bar ez-align--top" }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", onActionClick: evt => this.actionClickHandler(evt), key: "topTaskbar", dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), h("ez-grid", { ref: ref => this._grid = ref, dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: evt => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit() }, h("snk-taskbar", { dataUnit: this._dataUnit, buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" }))));
65
75
  }
66
76
  get _element() { return this; }
67
77
  static get style() { return snkGridCss; }
68
78
  }, [6, "snk-grid", {
69
79
  "configName": [1, "config-name"],
70
80
  "actionsList": [16],
81
+ "taskbarManager": [16],
71
82
  "_dataUnit": [32],
72
83
  "_configLoaded": [32],
73
84
  "_dataState": [32],
@@ -30,43 +30,61 @@ var VisibleWhenForbidden;
30
30
  (function (VisibleWhenForbidden) {
31
31
  VisibleWhenForbidden["CONFIG_GRID"] = "CONFIG_GRID";
32
32
  })(VisibleWhenForbidden || (VisibleWhenForbidden = {}));
33
+ const buildCustomButton = (def, className, action, isEnabled) => {
34
+ const { hint, text, iconName } = def;
35
+ if (iconName) {
36
+ if (text) {
37
+ return iconTextButton(iconName, def.name, className, hint, text, action, isEnabled);
38
+ }
39
+ else {
40
+ return iconButton(iconName, def.name, className, hint, action, isEnabled);
41
+ }
42
+ }
43
+ else {
44
+ return textButton(def.name, className, text, hint, action, isEnabled);
45
+ }
46
+ };
33
47
  const buildElem = (element, className, getTitle, action, isEnabled, actions) => {
48
+ const title = getTitle(element);
34
49
  switch (element) {
35
50
  case TaskbarElement.PREVIOUS:
36
- return iconButton("chevron-left", element, className, getTitle, action, isEnabled);
51
+ return iconButton("chevron-left", element, className, title, action, isEnabled);
37
52
  case TaskbarElement.NEXT:
38
- return iconButton("chevron-right", element, className, getTitle, action, isEnabled);
53
+ return iconButton("chevron-right", element, className, title, action, isEnabled);
39
54
  case TaskbarElement.REFRESH:
40
- return iconButton("sync", element, className, getTitle, action, isEnabled);
55
+ return iconButton("sync", element, className, title, action, isEnabled);
41
56
  case TaskbarElement.UPDATE:
42
- return iconButton("edit", element, className, getTitle, action, isEnabled);
57
+ return iconButton("edit", element, className, title, action, isEnabled);
43
58
  case TaskbarElement.CLONE:
44
- return iconButton("copy", element, className, getTitle, action, isEnabled);
59
+ return iconButton("copy", element, className, title, action, isEnabled);
45
60
  case TaskbarElement.REMOVE:
46
- return iconButton("delete", element, className, getTitle, action, isEnabled);
61
+ return iconButton("delete", element, className, title, action, isEnabled);
47
62
  case TaskbarElement.INSERT:
48
- return iconTextButton("plus", element, className, getTitle, action, isEnabled);
63
+ return iconTextButton("plus", element, className, title, title, action, isEnabled);
49
64
  case TaskbarElement.CANCEL:
50
- return h("ez-button", { title: getTitle(element), label: getTitle(element), size: "small", enabled: isEnabled(element), onClick: () => action(element) });
65
+ return textButton(element, className, title, title, action, isEnabled);
51
66
  case TaskbarElement.SAVE:
52
- return iconTextButton("save", element, className, getTitle, action, isEnabled);
67
+ return iconTextButton("save", element, className, title, title, action, isEnabled);
53
68
  case TaskbarElement.GRID_MODE:
54
- return iconButton("table", element, className, getTitle, action, isEnabled);
69
+ return iconButton("table", element, className, title, action, isEnabled);
55
70
  case TaskbarElement.FORM_MODE:
56
- return iconButton("list", element, className, getTitle, action, isEnabled);
71
+ return iconButton("list", element, className, title, action, isEnabled);
57
72
  case TaskbarElement.CONFIG_GRID:
58
- return iconButton("settings-inverted", element, className, getTitle, action, isEnabled);
73
+ return iconButton("settings-inverted", element, className, title, action, isEnabled);
59
74
  case TaskbarElement.MORE_OPTIONS:
60
- return actions && actions.length > 0 ? h("ez-actions-button", { title: getTitle(element), size: "small", class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions }) : undefined;
75
+ return actions && actions.length > 0 ? h("ez-actions-button", { title: title, size: "small", class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions }) : undefined;
61
76
  case TaskbarElement.DIVIDER:
62
77
  return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium" });
63
78
  }
64
79
  };
65
- function iconButton(iconName, element, className, getTitle, action, isEnabled) {
66
- return h("ez-button", { key: iconName, title: getTitle(element), mode: "icon", size: "small", class: className, iconName: iconName, enabled: isEnabled(element), onClick: () => action(element) });
80
+ function textButton(name, className, text, title, action, isEnabled) {
81
+ return h("ez-button", { title: title, label: text, size: "small", class: className, enabled: isEnabled(name), onClick: () => action(name) });
67
82
  }
68
- function iconTextButton(iconName, element, className, getTitle, action, isEnabled) {
69
- return h("ez-button", { key: iconName, title: getTitle(element), label: getTitle(element), size: "small", class: className, enabled: isEnabled(element), onClick: () => action(element) },
83
+ function iconButton(iconName, name, className, title, action, isEnabled) {
84
+ return h("ez-button", { name: iconName, title: title, mode: "icon", size: "small", class: className, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
85
+ }
86
+ function iconTextButton(iconName, name, className, text, title, action, isEnabled) {
87
+ return h("ez-button", { name: iconName, title: title, label: text, size: "small", class: className, enabled: isEnabled(name), onClick: () => action(name) },
70
88
  h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
71
89
  }
72
90
 
@@ -169,13 +187,16 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
169
187
  return !(this.disabledButtons && this.disabledButtons.includes(elem));
170
188
  }
171
189
  getElement(index, def) {
172
- let element;
173
190
  let className = def === this.primaryButton ? "ez-button--primary " : "";
174
191
  if (index > 1) {
175
192
  className += "ez-padding-left--medium";
176
193
  }
177
- element = buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
178
- return element;
194
+ if (TaskbarElement[def.toString()]) {
195
+ return buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
196
+ }
197
+ else {
198
+ return buildCustomButton(def, className, elem => this.elementClick(elem), elem => this.isEnabled(elem));
199
+ }
179
200
  }
180
201
  // Lifecycle
181
202
  componentWillLoad() {
@@ -197,20 +218,20 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
197
218
  return undefined;
198
219
  }
199
220
  let index = 0;
200
- return (h(Host, null, this._definitions.map((btn) => {
201
- if (btn === TaskbarElement.DIVIDER) {
221
+ return (h(Host, null, this._definitions.map((elem) => {
222
+ if (elem === TaskbarElement.DIVIDER) {
202
223
  index = 0;
203
224
  }
204
225
  else {
205
226
  index++;
206
227
  }
207
- if (TaskbarElement[btn]) {
208
- return this.getElement(index, TaskbarElement[btn]);
228
+ if (TaskbarElement[elem]) {
229
+ return this.getElement(index, TaskbarElement[elem]);
209
230
  }
210
- else {
211
- index;
212
- return h("slot", { name: btn });
231
+ if (this.customButtons.has(elem)) {
232
+ return this.getElement(index, this.customButtons.get(elem));
213
233
  }
234
+ return h("slot", { name: elem });
214
235
  })));
215
236
  }
216
237
  static get watchers() { return {
@@ -219,6 +240,7 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
219
240
  static get style() { return snkTaskbarCss; }
220
241
  }, [6, "snk-taskbar", {
221
242
  "buttons": [1],
243
+ "customButtons": [16],
222
244
  "actionsList": [16],
223
245
  "primaryButton": [1, "primary-button"],
224
246
  "disabledButtons": [16],
@@ -0,0 +1,45 @@
1
+ class TaskbarProcessor {
2
+ constructor(defaultButtons) {
3
+ this._defaultButtons = defaultButtons;
4
+ }
5
+ process(taskbarId, taskbarManager, dataState, disabledButtons = []) {
6
+ var _a;
7
+ this.customButtons = new Map();
8
+ this.buttons = "";
9
+ this.disabledButtons = [];
10
+ (_a = this.getButtonsArray(taskbarId, taskbarManager, dataState)) === null || _a === void 0 ? void 0 : _a.forEach(btnDef => {
11
+ let buttonName;
12
+ if (typeof btnDef === "string") {
13
+ buttonName = btnDef;
14
+ }
15
+ else {
16
+ const customBtn = btnDef;
17
+ this.customButtons.set(customBtn.name, customBtn);
18
+ buttonName = customBtn.name;
19
+ }
20
+ if (!this.isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabledButtons)) {
21
+ this.disabledButtons.push(buttonName);
22
+ }
23
+ if (this.buttons.length > 0) {
24
+ this.buttons += ",";
25
+ }
26
+ this.buttons += buttonName;
27
+ });
28
+ }
29
+ getButtonsArray(taskbarId, taskbarManager, dataState) {
30
+ const defaults = this._defaultButtons[taskbarId];
31
+ if (taskbarManager) {
32
+ return taskbarManager.getButtons(taskbarId, dataState, [...defaults]);
33
+ }
34
+ return defaults;
35
+ }
36
+ isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabled) {
37
+ const originalValue = disabled.includes(buttonName) ? false : true;
38
+ if (taskbarManager && taskbarManager.isEnabled) {
39
+ return taskbarManager.isEnabled(taskbarId, dataState, buttonName, originalValue);
40
+ }
41
+ return originalValue;
42
+ }
43
+ }
44
+
45
+ export { TaskbarProcessor as T };
@@ -144,11 +144,15 @@ const snkFilterBarMessages = {
144
144
  "removeFilter": "Remover filtro",
145
145
  "cleanFilter": "Limpar",
146
146
  "applyFilter": "Aplicar",
147
- "findFilter": "Buscar campo...",
148
- "emptyFilterList": " há campos disponíveis",
147
+ "findFilter": "Buscar filtros...",
148
+ "findField": "Buscar filtros...",
149
+ "emptyFiltersList": "Não há filtros disponíveis",
150
+ "emptyAppliedFiltersList": "Não há filtros aplicados",
149
151
  "customFilter": "Filtro personalizado",
150
152
  "defaultFilter": "Filtro padrao",
151
- "failToLoadConfig": "Falha ao buscar configuração de filtros"
153
+ "failToLoadConfig": "Falha ao buscar configuração de filtros",
154
+ "clearAllFilters": "Limpar todos os filtros",
155
+ "successfullyCleaned": "Filtro limpo com sucesso!"
152
156
  };
153
157
 
154
158
  const snkFormMessages = {