@sankhyalabs/ezui 0.0.0-bugfix-dev-kb-74998.4 → 0.0.0-bugfix-dev-KB-75210.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/cjs/{ez-card-item_3.cjs.entry.js → ez-card-item_2.cjs.entry.js} +0 -123
  2. package/dist/cjs/ez-chart.cjs.entry.js +1 -1
  3. package/dist/cjs/ez-double-list.cjs.entry.js +287 -0
  4. package/dist/cjs/ez-filter-input.cjs.entry.js +130 -0
  5. package/dist/cjs/ez-form-view.cjs.entry.js +8 -2
  6. package/dist/cjs/ez-grid.cjs.entry.js +777 -109
  7. package/dist/cjs/ez-list.cjs.entry.js +253 -205
  8. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
  9. package/dist/cjs/ez-popup.cjs.entry.js +4 -1
  10. package/dist/cjs/ez-split-item.cjs.entry.js +3 -2
  11. package/dist/cjs/ez-split-panel.cjs.entry.js +54 -2
  12. package/dist/cjs/ezListHelper-0d3970b4.js +90 -0
  13. package/dist/cjs/ezui.cjs.js +1 -1
  14. package/dist/cjs/filter-column.cjs.entry.js +2 -2
  15. package/dist/cjs/index-a7b0c73d.js +10 -2
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/collection/collection-manifest.json +1 -0
  18. package/dist/collection/components/ez-double-list/doubleListHelper.js +82 -0
  19. package/dist/collection/components/ez-double-list/ez-double-list.css +62 -0
  20. package/dist/collection/components/ez-double-list/ez-double-list.js +440 -0
  21. package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +2 -1
  22. package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +6 -2
  23. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +4 -1
  24. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +4 -0
  25. package/dist/collection/components/ez-grid/ez-grid.css +24 -6
  26. package/dist/collection/components/ez-grid/ez-grid.js +25 -5
  27. package/dist/collection/components/ez-grid/subcomponents/filter-column.css +4 -0
  28. package/dist/collection/components/ez-grid/subcomponents/filter-column.js +1 -1
  29. package/dist/collection/components/ez-list/ez-list.js +296 -206
  30. package/dist/collection/components/ez-list/ezListHelper.js +85 -0
  31. package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.css +2 -2
  32. package/dist/collection/components/ez-popup/ez-popup.css +1 -0
  33. package/dist/collection/components/ez-popup/ez-popup.js +5 -2
  34. package/dist/collection/components/ez-split-panel/ez-split-panel.css +15 -0
  35. package/dist/collection/components/ez-split-panel/ez-split-panel.js +71 -1
  36. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +13 -2
  37. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +20 -1
  38. package/dist/custom-elements/index.d.ts +6 -0
  39. package/dist/custom-elements/index.js +1481 -338
  40. package/dist/esm/{ez-card-item_3.entry.js → ez-card-item_2.entry.js} +1 -123
  41. package/dist/esm/ez-chart.entry.js +1 -1
  42. package/dist/esm/ez-double-list.entry.js +283 -0
  43. package/dist/esm/ez-filter-input.entry.js +126 -0
  44. package/dist/esm/ez-form-view.entry.js +8 -2
  45. package/dist/esm/ez-grid.entry.js +778 -110
  46. package/dist/esm/ez-list.entry.js +253 -205
  47. package/dist/esm/ez-multi-selection-list.entry.js +1 -1
  48. package/dist/esm/ez-popup.entry.js +4 -1
  49. package/dist/esm/ez-split-item.entry.js +3 -2
  50. package/dist/esm/ez-split-panel.entry.js +54 -2
  51. package/dist/esm/ezListHelper-00fb9b8d.js +87 -0
  52. package/dist/esm/ezui.js +1 -1
  53. package/dist/esm/filter-column.entry.js +2 -2
  54. package/dist/esm/index-baa5e267.js +10 -2
  55. package/dist/esm/loader.js +1 -1
  56. package/dist/ezui/ezui.esm.js +1 -1
  57. package/dist/ezui/p-16e612fc.entry.js +1 -0
  58. package/dist/ezui/p-17eabf46.entry.js +1 -0
  59. package/dist/ezui/p-2475fd6e.entry.js +1 -0
  60. package/dist/ezui/{p-baf80b13.entry.js → p-35d467a8.entry.js} +1 -1
  61. package/dist/ezui/p-5b205c80.entry.js +1 -0
  62. package/dist/ezui/p-65f471bc.entry.js +1 -0
  63. package/dist/ezui/p-66924de6.entry.js +1 -0
  64. package/dist/ezui/p-7e677b7b.entry.js +1 -0
  65. package/dist/ezui/p-80dfc50b.js +1 -0
  66. package/dist/ezui/{p-b36542d8.entry.js → p-a6fe527a.entry.js} +1 -1
  67. package/dist/ezui/p-b46e9f59.entry.js +309 -0
  68. package/dist/ezui/p-e3e3fd7a.entry.js +1 -0
  69. package/dist/ezui/{p-2b46b37b.entry.js → p-fa6732f2.entry.js} +1 -1
  70. package/dist/types/components/ez-double-list/doubleListHelper.d.ts +10 -0
  71. package/dist/types/components/ez-double-list/ez-double-list.d.ts +87 -0
  72. package/dist/types/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.d.ts +2 -1
  73. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +4 -0
  74. package/dist/types/components/ez-grid/ez-grid.d.ts +5 -1
  75. package/dist/types/components/ez-list/ez-list.d.ts +23 -2
  76. package/dist/types/components/ez-list/ezListHelper.d.ts +20 -0
  77. package/dist/types/components/ez-popup/ez-popup.d.ts +1 -1
  78. package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +7 -0
  79. package/dist/types/components/ez-split-panel/structure/item/ez-split-item.d.ts +4 -0
  80. package/dist/types/components.d.ts +133 -13
  81. package/package.json +1 -1
  82. package/react/components.d.ts +1 -0
  83. package/react/components.js +1 -0
  84. package/react/components.js.map +1 -1
  85. package/dist/ezui/p-4575d511.entry.js +0 -1
  86. package/dist/ezui/p-90bcd2ba.entry.js +0 -1
  87. package/dist/ezui/p-bfad39eb.entry.js +0 -1
  88. package/dist/ezui/p-c806f32f.entry.js +0 -1
  89. package/dist/ezui/p-ca1ce49f.entry.js +0 -309
  90. package/dist/ezui/p-cd2e78f0.entry.js +0 -1
  91. package/dist/ezui/p-e78e0843.entry.js +0 -1
@@ -0,0 +1,283 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-baa5e267.js';
2
+ import { ObjectUtils, ArrayUtils } from '@sankhyalabs/core';
3
+ import { i as isContinuousSequence } from './ezListHelper-00fb9b8d.js';
4
+ import { E as EzScrollDirection } from './EzScrollDirection-2df26c93.js';
5
+
6
+ function moveItems(selectedItemsList, itemsList, foward) {
7
+ if (!selectedItemsList.length)
8
+ return [...itemsList];
9
+ if (!itemsList.length)
10
+ return [];
11
+ const selectedIndexes = getItemsIndex(selectedItemsList, itemsList);
12
+ const startIndex = getMinValue(selectedIndexes);
13
+ const endIndex = getMaxValue(selectedIndexes);
14
+ return moveRange(startIndex, endIndex, foward, itemsList);
15
+ }
16
+ function getMinValue(numbers) {
17
+ if (numbers.length === 0)
18
+ return 0;
19
+ return numbers.reduce((min, current) => (current < min ? current : min), numbers[0]);
20
+ }
21
+ function getMaxValue(numbers) {
22
+ if (numbers.length === 0)
23
+ return 0;
24
+ return numbers.reduce((max, current) => (current > max ? current : max), numbers[0]);
25
+ }
26
+ function getItemsIndex(selectedItemsList, itemsList) {
27
+ return selectedItemsList.map(selectedId => itemsList.findIndex(original => original.id === selectedId));
28
+ }
29
+ function moveRange(startIndex, endIndex, moveForward, listItem) {
30
+ if (startIndex < 0 || endIndex >= listItem.length || startIndex > endIndex)
31
+ return listItem;
32
+ if (moveForward)
33
+ return moveFoward(endIndex, startIndex, listItem);
34
+ return moveBackward(startIndex, endIndex, listItem);
35
+ }
36
+ function moveBackward(startIndex, endIndex, listItem) {
37
+ if (startIndex === 0)
38
+ return listItem;
39
+ const beforeRange = listItem.slice(0, startIndex - 1);
40
+ const range = listItem.slice(startIndex, endIndex + 1);
41
+ const afterRange = listItem.slice(endIndex + 1);
42
+ const movedItem = listItem[startIndex - 1];
43
+ return [...beforeRange, ...range, movedItem, ...afterRange];
44
+ }
45
+ function moveFoward(endIndex, startIndex, listItem) {
46
+ if (endIndex === listItem.length - 1)
47
+ return listItem;
48
+ const beforeRange = listItem.slice(0, startIndex);
49
+ const range = listItem.slice(startIndex, endIndex + 1);
50
+ const afterRange = listItem.slice(endIndex + 1);
51
+ const movedItem = afterRange.shift();
52
+ return movedItem
53
+ ? [...beforeRange, movedItem, ...range, ...afterRange]
54
+ : listItem;
55
+ }
56
+ function transferAll({ from, to, selectedFrom, selectedTo }) {
57
+ to = [...to.map(i => setItemSelection(i, false)), ...from.map(i => setItemSelection(i, true))];
58
+ selectedFrom = [];
59
+ selectedTo = [...from.map(({ id }) => id)];
60
+ from = [];
61
+ return { from, to, selectedFrom, selectedTo };
62
+ }
63
+ function transferItems({ from, to, selectedFrom, selectedTo }) {
64
+ if (!from.length)
65
+ return { from, to, selectedFrom, selectedTo };
66
+ const itemsToTransfer = getItemsToTransfer(to, selectedFrom, from);
67
+ if (!itemsToTransfer.length)
68
+ 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 };
78
+ }
79
+ function getItemsToTransfer(to, selectedFrom, from) {
80
+ const toListIds = to.map(item => item.id);
81
+ //Não deve transferir um item que já existe na lista destino
82
+ const itemsToTransferId = selectedFrom.filter((id) => !toListIds.includes(id));
83
+ return from.filter(({ id }) => itemsToTransferId.includes(id));
84
+ }
85
+ function setItemSelection(item, select) {
86
+ return Object.assign(Object.assign({}, item), { selected: select });
87
+ }
88
+
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}";
90
+
91
+ const EzDoubleList = class {
92
+ constructor(hostRef) {
93
+ registerInstance(this, hostRef);
94
+ this.ezLeftListChanged = createEvent(this, "ezLeftListChanged", 7);
95
+ this.ezRightListChanged = createEvent(this, "ezRightListChanged", 7);
96
+ this.LEFT_LIST_ID = 'LEFT-LIST-ID';
97
+ this.RIGHT_LIST_ID = 'RIGHT-LIST-ID';
98
+ this.LEFT_FILTER_ID = 'LEFT-FILTER-ID';
99
+ this.RIGHT_FILTER_ID = 'RIGHT-FILTER-ID';
100
+ this.leftList = [];
101
+ this.leftTitle = undefined;
102
+ this.rightList = [];
103
+ this.entityLabel = 'item';
104
+ this.entityLabelPlural = 'itens';
105
+ this.leftListLabel = 'disponíveis';
106
+ this.rightListLabel = 'selecionados';
107
+ this.rightTitle = undefined;
108
+ this.leftFilteredList = [];
109
+ this.rightFilteredList = [];
110
+ this.selectedLeftList = [];
111
+ this.selectedRightList = [];
112
+ this.isFilteringLeft = false;
113
+ this.isFilteringRight = false;
114
+ }
115
+ async resetSelectedLists() {
116
+ this.selectedLeftList = [];
117
+ this.selectedRightList = [];
118
+ }
119
+ observeLeftList(newValue, oldValue) {
120
+ if (ObjectUtils.equals(newValue, oldValue))
121
+ return;
122
+ this.ezLeftListChanged.emit(newValue);
123
+ }
124
+ observeRightList(newValue, oldValue) {
125
+ if (ObjectUtils.equals(newValue, oldValue))
126
+ return;
127
+ this.ezRightListChanged.emit(newValue);
128
+ }
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
+ async handleChangeLeft({ detail }) {
138
+ this.leftList = [...detail];
139
+ this.selectedLeftList = [...detail.filter(item => item.selected)];
140
+ await this.leftEzListInstance.clearHistory();
141
+ }
142
+ async handleChangeRight({ detail }) {
143
+ this.rightList = [...detail];
144
+ this.selectedRightList = [...detail.filter(item => item.selected)];
145
+ await this.rightEzListInstance.clearHistory();
146
+ }
147
+ enableTransferAllToRight() {
148
+ return this.leftList.length > 0;
149
+ }
150
+ enableTransferAllToLeft() {
151
+ return this.rightList.length > 0;
152
+ }
153
+ enableTransferToRight() {
154
+ return this.selectedLeftList.length > 0;
155
+ }
156
+ enableTransferToLeft() {
157
+ return this.selectedRightList.length > 0;
158
+ }
159
+ enableMoveUp(moveAll) {
160
+ if (this.isFilteringRight)
161
+ return false;
162
+ const selectedIndexes = this.getRightSelectedItemsIndex();
163
+ return this.selectedRightList.length > 0
164
+ && !selectedIndexes.includes(0)
165
+ && (moveAll ? true : isContinuousSequence(selectedIndexes));
166
+ }
167
+ enableMoveDown(moveAll) {
168
+ if (this.isFilteringRight)
169
+ return false;
170
+ const selectedIndexes = this.getRightSelectedItemsIndex();
171
+ const lastIndex = this.rightList.length - 1;
172
+ return this.selectedRightList.length > 0
173
+ && !selectedIndexes.includes(lastIndex)
174
+ && (moveAll ? true : isContinuousSequence(selectedIndexes));
175
+ }
176
+ getRightSelectedItemsIndex() {
177
+ return this.selectedRightList.map(id => this.rightList.findIndex(original => original.id === id));
178
+ }
179
+ transferToRight() {
180
+ const { from, to, selectedFrom, selectedTo } = transferItems(this.buildTransferToRightConfig());
181
+ this.leftList = [...from];
182
+ this.rightList = [...to];
183
+ this.selectedLeftList = [...selectedFrom];
184
+ this.selectedRightList = [...selectedTo];
185
+ }
186
+ transferToLeft() {
187
+ const { from, to, selectedFrom, selectedTo } = transferItems(this.buildTransferToLeftConfig());
188
+ this.rightList = [...from];
189
+ this.leftList = [...to];
190
+ this.selectedRightList = [...selectedFrom];
191
+ this.selectedLeftList = [...selectedTo];
192
+ }
193
+ handleTransferAllToRight() {
194
+ const { from, to, selectedFrom, selectedTo } = transferAll(this.buildTransferToRightConfig());
195
+ this.leftList = [...from];
196
+ this.rightList = [...to];
197
+ this.selectedLeftList = [...selectedFrom];
198
+ this.selectedRightList = [...selectedTo];
199
+ }
200
+ handleTransferAllToLeft() {
201
+ const { from, to, selectedFrom, selectedTo } = transferAll(this.buildTransferToLeftConfig());
202
+ this.rightList = [...from];
203
+ this.leftList = [...to];
204
+ this.selectedRightList = [...selectedFrom];
205
+ this.selectedLeftList = [...selectedTo];
206
+ }
207
+ buildTransferToRightConfig() {
208
+ return {
209
+ from: this.leftList,
210
+ to: this.rightList,
211
+ selectedFrom: this.selectedLeftList,
212
+ selectedTo: this.selectedRightList,
213
+ };
214
+ }
215
+ buildTransferToLeftConfig() {
216
+ return {
217
+ from: this.rightList,
218
+ to: this.leftList,
219
+ selectedFrom: this.selectedRightList,
220
+ selectedTo: this.selectedLeftList,
221
+ };
222
+ }
223
+ handleMoveUp() {
224
+ this.rightList = [...moveItems(this.selectedRightList, this.rightList, false)];
225
+ }
226
+ handleMoveDown() {
227
+ this.rightList = [...moveItems(this.selectedRightList, this.rightList, true)];
228
+ }
229
+ handleMoveToTop() {
230
+ const { itemsToKeep, itemsToMove } = this.getItemsToKeepAndToMove();
231
+ this.rightList = [...itemsToMove, ...itemsToKeep];
232
+ }
233
+ handleMoveToBottom() {
234
+ const { itemsToKeep, itemsToMove } = this.getItemsToKeepAndToMove();
235
+ this.rightList = [...itemsToKeep, ...itemsToMove];
236
+ }
237
+ handleSelectLeftItem({ detail }) {
238
+ this.selectedLeftList = [...detail.map(({ id }) => id)];
239
+ }
240
+ handleSelectRightItem({ detail }) {
241
+ this.selectedRightList = [...detail.map(({ id }) => id)];
242
+ }
243
+ getItemsToKeepAndToMove() {
244
+ const itemsToKeep = this.rightList.filter(item => !this.selectedRightList.includes(item.id));
245
+ const itemsToMove = this.rightList.filter(item => this.selectedRightList.includes(item.id));
246
+ return { itemsToKeep, itemsToMove };
247
+ }
248
+ handleTransferToRight() {
249
+ this.transferToRight();
250
+ this.leftFilteredList = [];
251
+ this.leftEzFilterInput.value = '';
252
+ }
253
+ handleTransferToLeft() {
254
+ this.transferToLeft();
255
+ this.rightFilteredList = [];
256
+ this.rightEzFilterInput.value = '';
257
+ }
258
+ buildTotalizer(list) {
259
+ return `Total de ${list.length} ${list.length === 1 ? this.entityLabel : this.entityLabelPlural}`;
260
+ }
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) })));
266
+ }
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) })));
272
+ }
273
+ 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) }))));
275
+ }
276
+ static get watchers() { return {
277
+ "leftList": ["observeLeftList"],
278
+ "rightList": ["observeRightList"]
279
+ }; }
280
+ };
281
+ EzDoubleList.style = ezDoubleListCss;
282
+
283
+ export { EzDoubleList as ez_double_list };
@@ -0,0 +1,126 @@
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-baa5e267.js';
2
+ import { ElementIDUtils } from '@sankhyalabs/core';
3
+ import { C as CSSVarsUtils } from './CSSVarsUtils-71ce76be.js';
4
+
5
+ const ezFilterInputCss = ":host{display:block;width:100%}";
6
+
7
+ const EzFilterInput = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.ezChange = createEvent(this, "ezChange", 7);
11
+ this.ezSearching = createEvent(this, "ezSearching", 7);
12
+ this.ezFocusIn = createEvent(this, "ezFocusIn", 7);
13
+ this._searchingText = "";
14
+ this.handleFocus = () => {
15
+ if (this._searchingText === "") {
16
+ this._textInput.value = "";
17
+ }
18
+ else {
19
+ this._textInput.value = this._searchingText;
20
+ }
21
+ this.ezFocusIn.emit();
22
+ };
23
+ this.label = undefined;
24
+ this.value = undefined;
25
+ this.enabled = true;
26
+ this.errorMessage = undefined;
27
+ this.restrict = undefined;
28
+ this.mode = "regular";
29
+ this.asyncSearch = false;
30
+ this.canShowError = true;
31
+ this.autoFocus = false;
32
+ this.noMargin = 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, noMargin: this.noMargin }, 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;
125
+
126
+ export { EzFilterInput as ez_filter_input };
@@ -32,9 +32,14 @@ const buildDate = ({ name, label, readOnly, canShowError }) => {
32
32
  return (h("div", { class: "ez-col ez-col--sd-12" },
33
33
  h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError, noMargin: true })));
34
34
  };
35
- const buildTime = ({ name, label, readOnly, canShowError }) => {
35
+ const buildTime = ({ name, label, readOnly, canShowError, props }) => {
36
+ var _a;
37
+ return (h("div", { class: "ez-col ez-col--sd-12" },
38
+ h("ez-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError, noMargin: true, "show-seconds": (_a = props === null || props === void 0 ? void 0 : props.showSeconds) !== null && _a !== void 0 ? _a : false })));
39
+ };
40
+ const buildTimeSeconds = ({ name, label, readOnly, canShowError }) => {
36
41
  return (h("div", { class: "ez-col ez-col--sd-12" },
37
- h("ez-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError, noMargin: true })));
42
+ h("ez-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError, noMargin: true, showSeconds: true })));
38
43
  };
39
44
  const buildDateTime = ({ name, label, readOnly, contextName, canShowError }) => {
40
45
  return (h("div", { class: "ez-col ez-col--sd-12" },
@@ -90,6 +95,7 @@ uiBuilders.set(UserInterface.SWITCH, buildSwitch);
90
95
  uiBuilders.set(UserInterface.OPTIONSELECTOR, buildComboBox);
91
96
  uiBuilders.set(UserInterface.DATE, buildDate);
92
97
  uiBuilders.set(UserInterface.TIME, buildTime);
98
+ uiBuilders.set(UserInterface.ELAPSEDTIME, buildTimeSeconds);
93
99
  uiBuilders.set(UserInterface.DATETIME, buildDateTime);
94
100
  uiBuilders.set(UserInterface.FILE, buildFile);
95
101
  uiBuilders.set(UserInterface.DECIMALNUMBER, buildDecimal);