@sankhyalabs/ezui 5.22.0-dev.141 → 5.22.0-dev.142

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 (37) hide show
  1. package/dist/cjs/ez-double-list.cjs.entry.js +114 -53
  2. package/dist/cjs/{ez-tooltip.cjs.entry.js → ez-filter-input_2.cjs.entry.js} +123 -1
  3. package/dist/cjs/ez-sortable-list.cjs.entry.js +3510 -0
  4. package/dist/cjs/ezui.cjs.js +1 -1
  5. package/dist/cjs/index-a7b0c73d.js +6 -6
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/collection-manifest.json +1 -0
  8. package/dist/collection/components/ez-double-list/doubleListHelper.js +9 -10
  9. package/dist/collection/components/ez-double-list/ez-double-list.css +6 -38
  10. package/dist/collection/components/ez-double-list/ez-double-list.js +168 -50
  11. package/dist/collection/components/ez-sortable-list/ez-sortable-list.css +226 -0
  12. package/dist/collection/components/ez-sortable-list/ez-sortable-list.js +582 -0
  13. package/dist/custom-elements/index.d.ts +6 -0
  14. package/dist/custom-elements/index.js +3636 -68
  15. package/dist/esm/ez-double-list.entry.js +115 -54
  16. package/dist/esm/{ez-tooltip.entry.js → ez-filter-input_2.entry.js} +124 -3
  17. package/dist/esm/ez-sortable-list.entry.js +3506 -0
  18. package/dist/esm/ezui.js +1 -1
  19. package/dist/esm/index-baa5e267.js +6 -6
  20. package/dist/esm/loader.js +1 -1
  21. package/dist/ezui/ezui.esm.js +1 -1
  22. package/dist/ezui/p-59561756.entry.js +7 -0
  23. package/dist/ezui/p-63cb493e.entry.js +1 -0
  24. package/dist/ezui/p-e4528470.entry.js +1 -0
  25. package/dist/types/components/ez-double-list/doubleListHelper.d.ts +4 -2
  26. package/dist/types/components/ez-double-list/ez-double-list.d.ts +60 -24
  27. package/dist/types/components/ez-sortable-list/ez-sortable-list.d.ts +91 -0
  28. package/dist/types/components.d.ts +185 -3
  29. package/package.json +5 -1
  30. package/react/components.d.ts +1 -0
  31. package/react/components.js +1 -0
  32. package/react/components.js.map +1 -1
  33. package/dist/cjs/ez-filter-input.cjs.entry.js +0 -129
  34. package/dist/esm/ez-filter-input.entry.js +0 -125
  35. package/dist/ezui/p-20c024f7.entry.js +0 -1
  36. package/dist/ezui/p-79044c3e.entry.js +0 -1
  37. package/dist/ezui/p-7e677b7b.entry.js +0 -1
@@ -1,7 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-baa5e267.js';
2
- import { ObjectUtils, ArrayUtils } from '@sankhyalabs/core';
2
+ import { ObjectUtils } from '@sankhyalabs/core';
3
3
  import { i as isContinuousSequence } from './ezListHelper-00fb9b8d.js';
4
- import { E as EzScrollDirection } from './EzScrollDirection-2df26c93.js';
5
4
 
6
5
  function moveItems(selectedItemsList, itemsList, foward) {
7
6
  if (!selectedItemsList.length)
@@ -60,21 +59,20 @@ function transferAll({ from, to, selectedFrom, selectedTo }) {
60
59
  from = [];
61
60
  return { from, to, selectedFrom, selectedTo };
62
61
  }
63
- function transferItems({ from, to, selectedFrom, selectedTo }) {
62
+ function transferItems({ from, to, selectedFrom, selectedTo, insertIndex = to.length, }) {
64
63
  if (!from.length)
65
64
  return { from, to, selectedFrom, selectedTo };
66
65
  const itemsToTransfer = getItemsToTransfer(to, selectedFrom, from);
67
66
  if (!itemsToTransfer.length)
68
67
  return { from, to, selectedFrom, selectedTo };
69
- to = [
70
- ...to.map(i => setItemSelection(i, false)),
71
- ...itemsToTransfer.map(i => setItemSelection(i, true))
72
- ];
73
- const selectedFromIds = selectedFrom.map(id => id);
74
- from = [...from.filter(item => !selectedFromIds.includes(item.id))];
75
- selectedTo = [...selectedFrom];
76
- selectedFrom = [];
77
- return { from, to, selectedFrom, selectedTo };
68
+ let updatedTo = to.map(i => setItemSelection(i, false));
69
+ updatedTo.splice(insertIndex, 0, ...itemsToTransfer.map(i => setItemSelection(i, true)));
70
+ return {
71
+ from: from.filter(item => !selectedFrom.includes(item.id)),
72
+ to: updatedTo,
73
+ selectedFrom: [],
74
+ selectedTo: [...selectedFrom],
75
+ };
78
76
  }
79
77
  function getItemsToTransfer(to, selectedFrom, from) {
80
78
  const toListIds = to.map(item => item.id);
@@ -86,7 +84,7 @@ function setItemSelection(item, select) {
86
84
  return Object.assign(Object.assign({}, item), { selected: select });
87
85
  }
88
86
 
89
- const ezDoubleListCss = ".sc-ez-double-list-h{display:flex;flex-direction:row;gap:8px;align-items:center;font-family:var(--font-pattern, \"Roboto\")}.group.sc-ez-double-list{display:flex;justify-content:space-between;gap:10px;flex-direction:column;border:var(--border--small) var(--color--strokes);border-radius:var(--border--radius-medium);width:350px;height:400px}.group__header.sc-ez-double-list{background:var(--background--body);padding:10px;border-radius:var(--border--radius-medium) var(--border--radius-medium) 0 0}.group__label.sc-ez-double-list{font-weight:var(--text-weight--large);font-size:var(--text--medium);color:var(--title--primary);margin-bottom:10px;display:block}.group__totalizer.sc-ez-double-list{padding:5px 10px;background:var(--background--body);font-weight:var(--text-weight--medium);font-size:var(--text--medium);color:var(--text--secondary);border-radius:0 0 var(--border--radius-medium) var(--border--radius-medium)}.empty-message.sc-ez-double-list{font-weight:var(--text-weight--medium);font-size:var(--text--medium);color:var(--text--secondary);text-align:center;margin:auto}.list__container.sc-ez-double-list{height:100%;min-height:150px;overflow:auto;display:flex}.actions__column.sc-ez-double-list{display:flex;flex-direction:column;gap:4px}";
87
+ const ezDoubleListCss = ".sc-ez-double-list-h{display:flex;flex-direction:row;gap:8px;align-items:center;font-family:var(--font-pattern, \"Roboto\");width:100%}@media screen and (max-width: 1366px){.group.sc-ez-double-list{height:350px}}.list__container.sc-ez-double-list{height:100%;width:100%;min-height:150px;overflow:auto;display:flex}.actions__column.sc-ez-double-list{display:flex;flex-direction:column;gap:4px}";
90
88
 
91
89
  const EzDoubleList = class {
92
90
  constructor(hostRef) {
@@ -95,8 +93,6 @@ const EzDoubleList = class {
95
93
  this.ezRightListChanged = createEvent(this, "ezRightListChanged", 7);
96
94
  this.LEFT_LIST_ID = 'LEFT-LIST-ID';
97
95
  this.RIGHT_LIST_ID = 'RIGHT-LIST-ID';
98
- this.LEFT_FILTER_ID = 'LEFT-FILTER-ID';
99
- this.RIGHT_FILTER_ID = 'RIGHT-FILTER-ID';
100
96
  this.leftList = [];
101
97
  this.leftTitle = undefined;
102
98
  this.rightList = [];
@@ -104,7 +100,10 @@ const EzDoubleList = class {
104
100
  this.entityLabelPlural = 'itens';
105
101
  this.leftListLabel = 'disponíveis';
106
102
  this.rightListLabel = 'selecionados';
103
+ this.useOnlyRightList = false;
107
104
  this.rightTitle = undefined;
105
+ this.emptyMessage = undefined;
106
+ this.slotsListBuilder = undefined;
108
107
  this.leftFilteredList = [];
109
108
  this.rightFilteredList = [];
110
109
  this.selectedLeftList = [];
@@ -126,23 +125,31 @@ const EzDoubleList = class {
126
125
  return;
127
126
  this.ezRightListChanged.emit(newValue);
128
127
  }
129
- handleFilterChangeLeft(value) {
130
- this.leftFilteredList = ArrayUtils.applyStringFilter(value, this.leftList, true, 'label');
131
- this.isFilteringLeft = this.leftFilteredList.length !== this.leftList.length;
132
- }
133
- handleFilterChangeRight(value) {
134
- this.rightFilteredList = ArrayUtils.applyStringFilter(value, this.rightList, true, 'label');
135
- this.isFilteringRight = this.rightFilteredList.length !== this.rightList.length;
136
- }
137
128
  async handleChangeLeft({ detail }) {
138
- this.leftList = [...detail];
139
- this.selectedLeftList = [...detail.filter(item => item.selected)];
140
- await this.leftEzListInstance.clearHistory();
129
+ if (!detail.to.getAttribute('id') || detail.to.getAttribute('id') !== this.RIGHT_LIST_ID) {
130
+ this.leftList = [...this.reorderArray(detail.dataSource, detail.selectItens, detail.newIndex)];
131
+ return;
132
+ }
133
+ detail.selectItens = detail.selectItens.filter(id => this.rightList.every(item => item.id !== id));
134
+ this.leftList = [...detail.dataSource];
135
+ this.selectedLeftList = [...detail.selectItens];
136
+ this.transferToRight(detail === null || detail === void 0 ? void 0 : detail.newIndex);
141
137
  }
142
138
  async handleChangeRight({ detail }) {
143
- this.rightList = [...detail];
144
- this.selectedRightList = [...detail.filter(item => item.selected)];
145
- await this.rightEzListInstance.clearHistory();
139
+ if (!detail.to.getAttribute('id') || detail.to.getAttribute('id') !== this.LEFT_LIST_ID) {
140
+ this.rightList = [...this.reorderArray(detail.dataSource, detail.selectItens, detail.newIndex)];
141
+ return;
142
+ }
143
+ detail.selectItens = detail.selectItens.filter(id => this.leftList.every(item => item.id !== id));
144
+ this.rightList = [...detail.dataSource];
145
+ this.selectedRightList = [...detail.selectItens];
146
+ this.transferToLeft(detail === null || detail === void 0 ? void 0 : detail.newIndex);
147
+ }
148
+ reorderArray(allItems, itemIdsToMove, insertIndex) {
149
+ const filteredItems = allItems.filter(i => !itemIdsToMove.includes(i.id));
150
+ const itemsToMove = allItems.filter(i => itemIdsToMove.includes(i.id));
151
+ filteredItems.splice(insertIndex, 0, ...itemsToMove);
152
+ return filteredItems;
146
153
  }
147
154
  enableTransferAllToRight() {
148
155
  return this.leftList.length > 0;
@@ -176,33 +183,43 @@ const EzDoubleList = class {
176
183
  getRightSelectedItemsIndex() {
177
184
  return this.selectedRightList.map(id => this.rightList.findIndex(original => original.id === id));
178
185
  }
179
- transferToRight() {
180
- const { from, to, selectedFrom, selectedTo } = transferItems(this.buildTransferToRightConfig());
181
- this.leftList = [...from];
186
+ transferToRight(insertIndex) {
187
+ const { from, to, selectedFrom, selectedTo } = transferItems(Object.assign(Object.assign({}, this.buildTransferToRightConfig()), { insertIndex: insertIndex !== null && insertIndex !== void 0 ? insertIndex : 0 }));
188
+ //Eh preciso limpar a lista antes de atualiza-la por conta de um bug no ciclo de vida do sortable.js
189
+ this.leftList = [];
190
+ requestAnimationFrame(() => this.leftList = [...from]);
182
191
  this.rightList = [...to];
183
192
  this.selectedLeftList = [...selectedFrom];
184
193
  this.selectedRightList = [...selectedTo];
185
194
  }
186
- transferToLeft() {
187
- const { from, to, selectedFrom, selectedTo } = transferItems(this.buildTransferToLeftConfig());
188
- this.rightList = [...from];
195
+ transferToLeft(insertIndex) {
196
+ const { from, to, selectedFrom, selectedTo } = transferItems(Object.assign(Object.assign({}, this.buildTransferToLeftConfig()), { insertIndex: insertIndex !== null && insertIndex !== void 0 ? insertIndex : 0 }));
197
+ //Eh preciso limpar a lista antes de atualiza-la por conta de um bug no ciclo de vida do sortable.js
198
+ this.rightList = [];
199
+ requestAnimationFrame(() => this.rightList = [...from]);
189
200
  this.leftList = [...to];
190
201
  this.selectedRightList = [...selectedFrom];
191
202
  this.selectedLeftList = [...selectedTo];
192
203
  }
193
- handleTransferAllToRight() {
204
+ async handleTransferAllToRight() {
194
205
  const { from, to, selectedFrom, selectedTo } = transferAll(this.buildTransferToRightConfig());
195
206
  this.leftList = [...from];
196
207
  this.rightList = [...to];
197
208
  this.selectedLeftList = [...selectedFrom];
198
209
  this.selectedRightList = [...selectedTo];
210
+ requestAnimationFrame(async () => {
211
+ await this.clearSelectionAll();
212
+ });
199
213
  }
200
- handleTransferAllToLeft() {
214
+ async handleTransferAllToLeft() {
201
215
  const { from, to, selectedFrom, selectedTo } = transferAll(this.buildTransferToLeftConfig());
202
216
  this.rightList = [...from];
203
217
  this.leftList = [...to];
204
218
  this.selectedRightList = [...selectedFrom];
205
219
  this.selectedLeftList = [...selectedTo];
220
+ requestAnimationFrame(async () => {
221
+ await this.clearSelectionAll();
222
+ });
206
223
  }
207
224
  buildTransferToRightConfig() {
208
225
  return {
@@ -245,33 +262,77 @@ const EzDoubleList = class {
245
262
  const itemsToMove = this.rightList.filter(item => this.selectedRightList.includes(item.id));
246
263
  return { itemsToKeep, itemsToMove };
247
264
  }
248
- handleTransferToRight() {
265
+ async handleTransferToRight() {
249
266
  this.transferToRight();
250
267
  this.leftFilteredList = [];
251
- this.leftEzFilterInput.value = '';
268
+ await this.leftEzListInstance.clearSelection();
252
269
  }
253
- handleTransferToLeft() {
270
+ async handleTransferToLeft() {
254
271
  this.transferToLeft();
255
272
  this.rightFilteredList = [];
256
- this.rightEzFilterInput.value = '';
273
+ await this.rightEzListInstance.clearSelection();
257
274
  }
258
- buildTotalizer(list) {
259
- return `Total de ${list.length} ${list.length === 1 ? this.entityLabel : this.entityLabelPlural}`;
275
+ async clearSelectionAll() {
276
+ await this.rightEzListInstance.clearSelection();
277
+ await this.leftEzListInstance.clearSelection();
260
278
  }
261
- renderLeftList() {
262
- if (!this.leftList.length) {
263
- return h("span", { class: 'empty-message' }, "Nenhum ", this.entityLabel, " dispon\u00EDvel");
264
- }
265
- return (h("ez-scroller", { direction: EzScrollDirection.VERTICAL, activeShadow: true }, h("ez-list", { ref: (ref) => this.leftEzListInstance = ref, id: this.LEFT_LIST_ID, hoverFeedback: true, dataSource: this.isFilteringLeft ? this.leftFilteredList : this.leftList, ezDraggable: !this.isFilteringLeft, enableMultipleSelection: true, onEzChange: this.handleChangeLeft.bind(this), ezSelectable: true, onEzSelectMultipleItems: this.handleSelectLeftItem.bind(this), onEzDoubleClick: this.handleTransferToRight.bind(this) })));
279
+ handleChooseLeft() {
280
+ requestAnimationFrame(async () => {
281
+ await this.rightEzListInstance.clearSelection();
282
+ });
266
283
  }
267
- renderRightList() {
268
- if (!this.rightList.length) {
269
- return h("span", { class: 'empty-message' }, "Nenhum ", this.entityLabel, " selecionado");
270
- }
271
- return (h("ez-scroller", { direction: EzScrollDirection.VERTICAL, activeShadow: true }, h("ez-list", { ref: (ref) => this.rightEzListInstance = ref, id: this.RIGHT_LIST_ID, hoverFeedback: true, dataSource: this.isFilteringRight ? this.rightFilteredList : this.rightList, ezDraggable: !this.isFilteringRight, enableMultipleSelection: true, onEzChange: this.handleChangeRight.bind(this), ezSelectable: true, onEzSelectMultipleItems: this.handleSelectRightItem.bind(this), onEzDoubleClick: this.handleTransferToLeft.bind(this) })));
284
+ handleChooseRight() {
285
+ if (this.useOnlyRightList)
286
+ return;
287
+ requestAnimationFrame(async () => {
288
+ await this.leftEzListInstance.clearSelection();
289
+ });
290
+ }
291
+ renderList(props) {
292
+ const { idSortableList, list, isFiltering, filteredList, emptyMessage, slotConfig, callbacks, title } = props;
293
+ return (h("ez-sortable-list", { ref: callbacks === null || callbacks === void 0 ? void 0 : callbacks.setRef, title: title, idSortableList: idSortableList, emptyMessage: emptyMessage, class: "ez-size-height--full", dataSource: isFiltering ? filteredList : list, hoverFeedback: true, enableMultipleSelection: true, removeItensMoved: true, entityLabel: this.entityLabel, entityLabelPlural: this.entityLabelPlural, itemRightSlotBuilder: slotConfig === null || slotConfig === void 0 ? void 0 : slotConfig.itemRightSlotBuilder, itemLeftSlotBuilder: slotConfig === null || slotConfig === void 0 ? void 0 : slotConfig.itemLeftSlotBuilder, onItemsReordered: callbacks === null || callbacks === void 0 ? void 0 : callbacks.onChange.bind(this), onEzSelectItens: callbacks === null || callbacks === void 0 ? void 0 : callbacks.onSelect.bind(this), onEzDoubleClick: callbacks === null || callbacks === void 0 ? void 0 : callbacks.onDoubleClick.bind(this), onEzChoose: callbacks === null || callbacks === void 0 ? void 0 : callbacks.onChoose.bind(this) }));
272
294
  }
273
295
  render() {
274
- return (h(Host, null, h("div", { class: 'group' }, h("div", { class: 'group__header' }, h("span", { class: 'group__label' }, this.leftTitle), h("ez-filter-input", { ref: (ref) => this.leftEzFilterInput = ref, id: this.LEFT_FILTER_ID, label: `Buscar ${this.entityLabel}`, mode: 'slim', onEzChange: evt => this.handleFilterChangeLeft(evt.detail) })), h("div", { class: 'list__container' }, this.renderLeftList()), h("div", { class: 'group__totalizer' }, this.buildTotalizer(this.leftList))), h("div", { class: 'actions__column' }, h("ez-button", { mode: 'icon', iconName: 'dual-chevron-right', enabled: this.enableTransferAllToRight(), title: `Mover todos para ${this.leftListLabel}`, size: 'small', onClick: this.handleTransferAllToRight.bind(this) }), h("ez-button", { mode: 'icon', iconName: 'chevron-right', enabled: this.enableTransferToRight(), title: `Mover para ${this.leftListLabel}`, size: 'small', onClick: this.handleTransferToRight.bind(this) }), h("ez-button", { mode: 'icon', iconName: 'chevron-left', enabled: this.enableTransferToLeft(), title: `Mover para ${this.rightListLabel}`, size: 'small', onClick: this.handleTransferToLeft.bind(this) }), h("ez-button", { mode: 'icon', iconName: 'dual-chevron-left', enabled: this.enableTransferAllToLeft(), title: `Mover todos para ${this.rightListLabel}`, size: 'small', onClick: this.handleTransferAllToLeft.bind(this) })), h("div", { class: 'group' }, h("div", { class: 'group__header' }, h("span", { class: 'group__label' }, this.rightTitle), h("ez-filter-input", { ref: (ref) => this.rightEzFilterInput = ref, id: this.RIGHT_FILTER_ID, label: `Buscar ${this.entityLabel}`, mode: 'slim', onEzChange: evt => this.handleFilterChangeRight(evt.detail) })), h("div", { class: 'list__container' }, this.renderRightList()), h("div", { class: 'group__totalizer' }, this.buildTotalizer(this.rightList))), h("div", { class: 'actions__column' }, h("ez-button", { mode: 'icon', iconName: 'dual-chevron-up', enabled: this.enableMoveUp(true), title: 'Mover para primeira posi\u00E7\u00E3o', size: 'small', onClick: this.handleMoveToTop.bind(this) }), h("ez-button", { mode: 'icon', iconName: 'chevron-up', enabled: this.enableMoveUp(), title: 'Mover para cima', size: 'small', onClick: this.handleMoveUp.bind(this) }), h("ez-button", { mode: 'icon', iconName: 'chevron-down', enabled: this.enableMoveDown(), title: 'Mover para baixo', size: 'small', onClick: this.handleMoveDown.bind(this) }), h("ez-button", { mode: 'icon', iconName: 'dual-chevron-down', enabled: this.enableMoveDown(true), title: 'Mover para \u00FAltima posi\u00E7\u00E3o', size: 'small', onClick: this.handleMoveToBottom.bind(this) }))));
296
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
297
+ return (h(Host, null, !this.useOnlyRightList &&
298
+ h("div", { class: "list__container" }, this.leftList && this.renderList({
299
+ idSortableList: this.LEFT_LIST_ID,
300
+ list: this.leftList,
301
+ title: this.leftTitle,
302
+ isFiltering: this.isFilteringLeft,
303
+ filteredList: this.leftFilteredList,
304
+ emptyMessage: !!((_a = this.emptyMessage) === null || _a === void 0 ? void 0 : _a.LEFT_LIST) ? this.emptyMessage.LEFT_LIST : `Nenhum ${this.entityLabel} disponível`,
305
+ slotConfig: {
306
+ itemRightSlotBuilder: (_c = (_b = this.slotsListBuilder) === null || _b === void 0 ? void 0 : _b.LEFT_LIST) === null || _c === void 0 ? void 0 : _c.itemRightSlotBuilder,
307
+ itemLeftSlotBuilder: (_e = (_d = this.slotsListBuilder) === null || _d === void 0 ? void 0 : _d.LEFT_LIST) === null || _e === void 0 ? void 0 : _e.itemLeftSlotBuilder,
308
+ },
309
+ callbacks: {
310
+ setRef: (ref) => this.leftEzListInstance = ref,
311
+ onChange: (evt) => this.handleChangeLeft(evt),
312
+ onSelect: this.handleSelectLeftItem.bind(this),
313
+ onDoubleClick: this.handleTransferToRight.bind(this),
314
+ onChoose: this.handleChooseLeft.bind(this),
315
+ },
316
+ })), !this.useOnlyRightList &&
317
+ h("div", { class: 'actions__column' }, h("ez-button", { mode: "icon", iconName: "dual-chevron-right", enabled: this.enableTransferAllToRight(), title: `Mover todos para ${this.rightListLabel}`, size: "small", onClick: this.handleTransferAllToRight.bind(this) }), h("ez-button", { mode: "icon", iconName: "chevron-right", enabled: this.enableTransferToRight(), title: `Mover para ${this.rightListLabel}`, size: "small", onClick: this.handleTransferToRight.bind(this) }), h("ez-button", { mode: "icon", iconName: "chevron-left", enabled: this.enableTransferToLeft(), title: `Mover para ${this.leftListLabel}`, size: "small", onClick: this.handleTransferToLeft.bind(this) }), h("ez-button", { mode: "icon", iconName: "dual-chevron-left", enabled: this.enableTransferAllToLeft(), title: `Mover todos para ${this.leftListLabel}`, size: "small", onClick: this.handleTransferAllToLeft.bind(this) })), h("div", { class: "list__container" }, this.rightList && this.renderList({
318
+ idSortableList: this.RIGHT_LIST_ID,
319
+ list: this.rightList,
320
+ title: this.rightTitle,
321
+ isFiltering: this.isFilteringRight,
322
+ filteredList: this.rightFilteredList,
323
+ emptyMessage: !!((_f = this.emptyMessage) === null || _f === void 0 ? void 0 : _f.RIGHT_LIST) ? this.emptyMessage.RIGHT_LIST : `Nenhum ${this.entityLabel} selecionado`,
324
+ slotConfig: {
325
+ itemRightSlotBuilder: (_h = (_g = this.slotsListBuilder) === null || _g === void 0 ? void 0 : _g.RIGHT_LIST) === null || _h === void 0 ? void 0 : _h.itemRightSlotBuilder,
326
+ itemLeftSlotBuilder: (_k = (_j = this.slotsListBuilder) === null || _j === void 0 ? void 0 : _j.RIGHT_LIST) === null || _k === void 0 ? void 0 : _k.itemLeftSlotBuilder,
327
+ },
328
+ callbacks: {
329
+ setRef: (ref) => this.rightEzListInstance = ref,
330
+ onChange: (evt) => this.handleChangeRight(evt),
331
+ onSelect: this.handleSelectRightItem.bind(this),
332
+ onDoubleClick: this.handleTransferToLeft.bind(this),
333
+ onChoose: this.handleChooseRight.bind(this),
334
+ },
335
+ })), h("div", { class: 'actions__column' }, h("ez-button", { mode: "icon", iconName: "dual-chevron-up", enabled: this.enableMoveUp(true), title: "Mover para primeira posi\u00E7\u00E3o", size: "small", onClick: this.handleMoveToTop.bind(this) }), h("ez-button", { mode: "icon", iconName: "chevron-up", enabled: this.enableMoveUp(), title: "Mover para cima", size: "small", onClick: this.handleMoveUp.bind(this) }), h("ez-button", { mode: "icon", iconName: "chevron-down", enabled: this.enableMoveDown(), title: "Mover para baixo", size: "small", onClick: this.handleMoveDown.bind(this) }), h("ez-button", { mode: "icon", iconName: "dual-chevron-down", enabled: this.enableMoveDown(true), title: "Mover para \u00FAltima posi\u00E7\u00E3o", size: "small", onClick: this.handleMoveToBottom.bind(this) }))));
275
336
  }
276
337
  static get watchers() { return {
277
338
  "leftList": ["observeLeftList"],
@@ -1,6 +1,127 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-baa5e267.js';
2
- import { c as computePosition, o as offset, f as flip, s as shift, a as arrow } from './floating-ui.dom.esm-5d3da819.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-baa5e267.js';
3
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
+ import { C as CSSVarsUtils } from './CSSVarsUtils-acba92d7.js';
4
+ import { c as computePosition, o as offset, f as flip, s as shift, a as arrow } from './floating-ui.dom.esm-5d3da819.js';
5
+
6
+ const ezFilterInputCss = ":host{display:block;width:100%}";
7
+
8
+ const EzFilterInput = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.ezChange = createEvent(this, "ezChange", 7);
12
+ this.ezSearching = createEvent(this, "ezSearching", 7);
13
+ this.ezFocusIn = createEvent(this, "ezFocusIn", 7);
14
+ this._searchingText = "";
15
+ this.handleFocus = () => {
16
+ if (this._searchingText === "") {
17
+ this._textInput.value = "";
18
+ }
19
+ else {
20
+ this._textInput.value = this._searchingText;
21
+ }
22
+ this.ezFocusIn.emit();
23
+ };
24
+ this.label = undefined;
25
+ this.value = undefined;
26
+ this.enabled = true;
27
+ this.errorMessage = undefined;
28
+ this.restrict = undefined;
29
+ this.mode = "regular";
30
+ this.asyncSearch = false;
31
+ this.canShowError = true;
32
+ this.autoFocus = false;
33
+ }
34
+ observeLabel() {
35
+ if (this._textInput) {
36
+ this._textInput.label = this.label;
37
+ }
38
+ }
39
+ observeErrorMessage() {
40
+ if (this._textInput) {
41
+ this._textInput.errorMessage = this.errorMessage;
42
+ }
43
+ }
44
+ observeValue(newValue, oldValue) {
45
+ if (this._textInput && newValue != oldValue) {
46
+ this._textInput.value = newValue;
47
+ this.ezChange.emit(newValue);
48
+ }
49
+ }
50
+ /**
51
+ * Aplica o foco no campo.
52
+ */
53
+ async setFocus(options) {
54
+ this._textInput.setFocus(options);
55
+ }
56
+ /**
57
+ * Remove o foco do campo.
58
+ */
59
+ async setBlur() {
60
+ this._textInput.setBlur();
61
+ }
62
+ /**
63
+ * Retorna se o conteúdo é inválido.
64
+ */
65
+ async isInvalid() {
66
+ return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
67
+ }
68
+ /**
69
+ * Método responsável por setar um novo valor ao campo.
70
+ */
71
+ async setValue(newValue) {
72
+ if (!this.asyncSearch || this._textInput == undefined) {
73
+ return;
74
+ }
75
+ if (newValue !== this.value) {
76
+ this.value = newValue;
77
+ this._searchingText = "";
78
+ }
79
+ else {
80
+ this._textInput.value = newValue;
81
+ }
82
+ }
83
+ /**
84
+ * Método responsável por resetar o valor do campo para o ultimo valor inputado.
85
+ */
86
+ async endSearch() {
87
+ if (!this.asyncSearch || this._textInput == undefined) {
88
+ return;
89
+ }
90
+ if (this._textInput.value !== this.value) {
91
+ this._textInput.value = this.value;
92
+ }
93
+ }
94
+ handleChange(evt) {
95
+ const newValue = evt.detail;
96
+ this.errorMessage = "";
97
+ if (this.asyncSearch) {
98
+ this._searchingText = newValue;
99
+ this.ezSearching.emit(newValue);
100
+ }
101
+ else if (newValue !== this.value) {
102
+ this.value = newValue;
103
+ }
104
+ }
105
+ componentDidLoad() {
106
+ CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
107
+ if (this.autoFocus) {
108
+ requestAnimationFrame(() => {
109
+ this.setFocus({ selectText: true });
110
+ });
111
+ }
112
+ }
113
+ render() {
114
+ ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
115
+ return (h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, label: this.label, onEzChange: evt => this.handleChange(evt), value: this.value, enabled: this.enabled, errorMessage: this.errorMessage, restrict: this.restrict, mode: this.mode, onFocusin: this.handleFocus, canShowError: this.canShowError }, h("ez-icon", { slot: "leftIcon", iconName: "search" })));
116
+ }
117
+ get _elem() { return getElement(this); }
118
+ static get watchers() { return {
119
+ "label": ["observeLabel"],
120
+ "errorMessage": ["observeErrorMessage"],
121
+ "value": ["observeValue"]
122
+ }; }
123
+ };
124
+ EzFilterInput.style = ezFilterInputCss;
4
125
 
5
126
  const ezTooltipCss = ":host{--triangle-size:8px;width:100%}.tooltip{position:absolute;z-index:var(--elevation--24);padding:var(--space--extra-small, 3px) var(--space--small, 6px);border-radius:var(--border--radius-small);box-sizing:border-box;font-family:var(--font-pattern\t, 'Roboto', sans-serif);font-size:var(--text--small, 12px);font-weight:var(--text-weight--medium, 400);text-align:center;width:max-content;display:none}.arrow{position:absolute;width:var(--triangle-size);height:var(--triangle-size);transform:rotate(45deg)}.default-tooltip{background:var(--title--primary, #2b3a54);color:var(--color--inverted)}.default-tooltip .arrow{background:var(--title--primary, #2b3a54)}.error-tooltip{background:var(--color-alert--error-800, #BD0025);color:var(--color--error-200, #F7E0E5)}.error-tooltip .arrow{background:var(--color-alert--error-800, #BD0025)}.success-tooltip{background:var(--color--success, #00cb94);color:var(--color--success-200, #EBFFFA)}.success-tooltip .arrow{background:var(--color--success, #00cb94)}.warning-tooltip{background:var(--color--warning, #f2d410);color:var(--color--warning-200, #FDF8D8)}.warning-tooltip .arrow{background:var(--color--warning, #f2d410)}";
6
127
 
@@ -128,4 +249,4 @@ const EzTooltip = class {
128
249
  };
129
250
  EzTooltip.style = ezTooltipCss;
130
251
 
131
- export { EzTooltip as ez_tooltip };
252
+ export { EzFilterInput as ez_filter_input, EzTooltip as ez_tooltip };