@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-75065.0 → 0.0.0-bugfix-dev-KB-83282.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 (62) hide show
  1. package/dist/cjs/ez-badge.cjs.entry.js +2 -14
  2. package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +387 -0
  3. package/dist/cjs/ez-combo-box.cjs.entry.js +58 -184
  4. package/dist/cjs/ez-grid.cjs.entry.js +58 -0
  5. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +186 -0
  7. package/dist/cjs/{ez-multi-selection-list_2.cjs.entry.js → ez-popover-core_2.cjs.entry.js} +115 -196
  8. package/dist/cjs/ezui.cjs.js +1 -1
  9. package/dist/cjs/index-a7b0c73d.js +8 -4
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/collection/collection-manifest.json +2 -0
  12. package/dist/collection/components/ez-badge/ez-badge.css +1 -12
  13. package/dist/collection/components/ez-badge/ez-badge.js +1 -31
  14. package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.css +205 -0
  15. package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js +426 -0
  16. package/dist/collection/components/ez-combo-box/ez-combo-box.css +0 -250
  17. package/dist/collection/components/ez-combo-box/ez-combo-box.js +61 -194
  18. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +3 -0
  19. package/dist/collection/components/ez-grid/ez-grid.js +56 -1
  20. package/dist/collection/components/ez-icon/ez-icon.css +4 -1
  21. package/dist/collection/components/ez-popover-plus/ez-popover-plus.css +0 -64
  22. package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +47 -127
  23. package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css +67 -0
  24. package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js +468 -0
  25. package/dist/custom-elements/index.d.ts +12 -0
  26. package/dist/custom-elements/index.js +395 -219
  27. package/dist/esm/ez-badge.entry.js +2 -14
  28. package/dist/esm/ez-combo-box-list_3.entry.js +381 -0
  29. package/dist/esm/ez-combo-box.entry.js +59 -185
  30. package/dist/esm/ez-grid.entry.js +59 -1
  31. package/dist/esm/ez-icon.entry.js +1 -1
  32. package/dist/esm/ez-multi-selection-list.entry.js +182 -0
  33. package/dist/esm/{ez-multi-selection-list_2.entry.js → ez-popover-core_2.entry.js} +116 -197
  34. package/dist/esm/ezui.js +1 -1
  35. package/dist/esm/index-baa5e267.js +8 -4
  36. package/dist/esm/loader.js +1 -1
  37. package/dist/ezui/ezui.esm.js +1 -1
  38. package/dist/ezui/p-3a009184.entry.js +1 -0
  39. package/dist/ezui/{p-a5950a0d.entry.js → p-53116373.entry.js} +46 -46
  40. package/dist/ezui/p-56fe5341.entry.js +1 -0
  41. package/dist/ezui/p-650e4b6d.entry.js +1 -0
  42. package/dist/ezui/p-7bd15498.entry.js +1 -0
  43. package/dist/ezui/p-dc73e1fe.entry.js +1 -0
  44. package/dist/ezui/p-f5931caa.entry.js +1 -0
  45. package/dist/types/components/ez-badge/ez-badge.d.ts +0 -5
  46. package/dist/types/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.d.ts +104 -0
  47. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +7 -16
  48. package/dist/types/components/ez-grid/ez-grid.d.ts +5 -0
  49. package/dist/types/components/ez-popover-plus/ez-popover-plus.d.ts +6 -19
  50. package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +81 -0
  51. package/dist/types/components.d.ts +218 -11
  52. package/package.json +1 -1
  53. package/react/components.d.ts +2 -0
  54. package/react/components.js +2 -0
  55. package/react/components.js.map +1 -1
  56. package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +0 -236
  57. package/dist/esm/ez-custom-form-input_2.entry.js +0 -231
  58. package/dist/ezui/p-0ca05a2f.entry.js +0 -1
  59. package/dist/ezui/p-64b461b3.entry.js +0 -1
  60. package/dist/ezui/p-cdac80f1.entry.js +0 -1
  61. package/dist/ezui/p-dc8b36c3.entry.js +0 -1
  62. package/dist/ezui/p-e75c7a23.entry.js +0 -1
@@ -0,0 +1,468 @@
1
+ import { computePosition, flip, shift } from "@floating-ui/dom";
2
+ import { h, Host } from "@stencil/core";
3
+ export class EzPopoverCore {
4
+ constructor() {
5
+ this.TIME_DEBOUNCE = 500;
6
+ this.autoClose = true;
7
+ this.boxWidth = "fit-content";
8
+ this.opened = false;
9
+ this.overlayType = "light";
10
+ this.anchorElement = undefined;
11
+ this.options = { horizontalGap: 0, verticalGap: 0, fromRight: false };
12
+ }
13
+ async observeOpened(newValue, oldValue) {
14
+ if (newValue === oldValue)
15
+ return;
16
+ if (newValue) {
17
+ this.openPopover();
18
+ }
19
+ else {
20
+ this.hidePopover();
21
+ }
22
+ this.ezVisibilityChange.emit(newValue);
23
+ return;
24
+ }
25
+ /**
26
+ * Atualiza a posição do popover.
27
+ */
28
+ async updatePosition(top, left) {
29
+ this.updateOptionPosition(top, left);
30
+ await this.updatePositionPopover();
31
+ }
32
+ /**
33
+ * Exibe o ez-popover.
34
+ */
35
+ async show(top, left) {
36
+ this.updateOptionPosition(top, left);
37
+ this.opened = true;
38
+ }
39
+ /**
40
+ * Ancora a exibição do popOver a um elemento HTML.
41
+ */
42
+ async showUnder(element, options) {
43
+ if (options) {
44
+ this.options = options;
45
+ }
46
+ this.anchorElement = element;
47
+ this.opened = true;
48
+ }
49
+ /**
50
+ * Oculta o ez-popover.
51
+ */
52
+ async hide() {
53
+ this.opened = false;
54
+ }
55
+ /**
56
+ * Altera as opções.
57
+ */
58
+ async setOptions(options) {
59
+ Object.assign(this.options, options);
60
+ }
61
+ /**
62
+ * Altera o elemento de ancoragem.
63
+ */
64
+ async setAnchorElement(anchor) {
65
+ this.anchorElement = anchor;
66
+ }
67
+ parseSizePixel(sizePixel, defaultValue) {
68
+ if (!sizePixel) {
69
+ return defaultValue !== null && defaultValue !== void 0 ? defaultValue : 0;
70
+ }
71
+ if (typeof sizePixel === "string") {
72
+ return Number(sizePixel.replace("px", ""));
73
+ }
74
+ return sizePixel !== null && sizePixel !== void 0 ? sizePixel : 0;
75
+ }
76
+ updateOptionPosition(top, left) {
77
+ Object.assign(this.options, {
78
+ horizontalGap: this.parseSizePixel(left, this.options.horizontalGap),
79
+ verticalGap: this.parseSizePixel(top, this.options.verticalGap),
80
+ });
81
+ }
82
+ async updatePositionPopover() {
83
+ if (!this._box || !this.opened) {
84
+ return;
85
+ }
86
+ if (!this.anchorElement) {
87
+ this.anchorElement = this._host;
88
+ }
89
+ if (typeof this.anchorElement === 'string') {
90
+ this.anchorElement = document.getElementById(this.anchorElement);
91
+ }
92
+ await computePosition(this.anchorElement, this._box, {
93
+ placement: this.options.fromRight ? 'bottom-end' : 'bottom-start',
94
+ middleware: [flip(), shift({ padding: 5 })],
95
+ strategy: 'fixed',
96
+ }).then(({ x, y, placement }) => {
97
+ const newTop = placement.includes("bottom") ? y + this.options.verticalGap : y - this.options.verticalGap;
98
+ const newLeft = placement.includes("start") ? x + this.options.horizontalGap : x - this.options.horizontalGap;
99
+ Object.assign(this._box.style, {
100
+ top: `${newTop}px`,
101
+ left: `${newLeft}px`,
102
+ });
103
+ });
104
+ }
105
+ hidePopover() {
106
+ if (!this._box) {
107
+ return;
108
+ }
109
+ this._box.style.display = '';
110
+ this.hideOverlay();
111
+ this.ezVisibilityChange.emit(false);
112
+ }
113
+ async openPopover() {
114
+ if (!this._box) {
115
+ return;
116
+ }
117
+ if (this.opened) {
118
+ this._box.style.display = 'flex';
119
+ this._box.style.visibility = 'hidden';
120
+ await this.updatePositionPopover();
121
+ this.openOverlay();
122
+ this.ezVisibilityChange.emit(true);
123
+ this._box.style.visibility = 'visible';
124
+ }
125
+ }
126
+ openOverlay() {
127
+ if (!this._overlay || !this._overlayIsActive) {
128
+ return;
129
+ }
130
+ this._overlay.style.display = 'block';
131
+ }
132
+ hideOverlay() {
133
+ if (!this._overlay) {
134
+ return;
135
+ }
136
+ this._overlay.style.display = 'none';
137
+ }
138
+ checkStatusOverlay() {
139
+ if (this.overlayType !== "none") {
140
+ return true;
141
+ }
142
+ if (this.overlayType === "none" && this.autoClose) {
143
+ return true;
144
+ }
145
+ return false;
146
+ }
147
+ updatePositionDebounce() {
148
+ if (!this.opened) {
149
+ return;
150
+ }
151
+ clearTimeout(this._timeoutDebounce);
152
+ this._timeoutDebounce = setTimeout(() => {
153
+ this.updatePositionPopover();
154
+ }, this.TIME_DEBOUNCE);
155
+ }
156
+ componentWillLoad() {
157
+ window.addEventListener('scroll', this.updatePositionDebounce.bind(this), true);
158
+ window.addEventListener('resize', this.updatePositionDebounce.bind(this), true);
159
+ }
160
+ componentDidLoad() {
161
+ this._overlayIsActive = this.checkStatusOverlay();
162
+ this._resizeObserver = new ResizeObserver(this.updatePositionPopover.bind(this));
163
+ this._resizeObserver.observe(this._box);
164
+ this.openPopover();
165
+ }
166
+ disconnectedCallback() {
167
+ window.removeEventListener('scroll', this.updatePositionDebounce.bind(this), true);
168
+ window.removeEventListener('resize', this.updatePositionDebounce.bind(this), true);
169
+ this._resizeObserver.disconnect();
170
+ }
171
+ render() {
172
+ return (h(Host, null, h("div", { ref: el => this._overlay = el, onClick: () => this.hide(), class: `popover__overlay popover__overlay--${this.overlayType}` }), h("section", { ref: el => this._box = el, class: {
173
+ "popover__box": true,
174
+ "popover__box--fit-content": this.boxWidth === "fit-content",
175
+ "popover__box--full-width": this.boxWidth !== "fit-content",
176
+ } }, h("slot", null))));
177
+ }
178
+ static get is() { return "ez-popover-core"; }
179
+ static get encapsulation() { return "shadow"; }
180
+ static get originalStyleUrls() {
181
+ return {
182
+ "$": ["ez-popover-core.css"]
183
+ };
184
+ }
185
+ static get styleUrls() {
186
+ return {
187
+ "$": ["ez-popover-core.css"]
188
+ };
189
+ }
190
+ static get properties() {
191
+ return {
192
+ "autoClose": {
193
+ "type": "boolean",
194
+ "mutable": false,
195
+ "complexType": {
196
+ "original": "boolean",
197
+ "resolved": "boolean",
198
+ "references": {}
199
+ },
200
+ "required": false,
201
+ "optional": false,
202
+ "docs": {
203
+ "tags": [],
204
+ "text": "Define que ser\u00E1 fechado automaticamente quando o usu\u00E1rio clicar fora do conte\u00FAdo."
205
+ },
206
+ "attribute": "auto-close",
207
+ "reflect": true,
208
+ "defaultValue": "true"
209
+ },
210
+ "boxWidth": {
211
+ "type": "string",
212
+ "mutable": false,
213
+ "complexType": {
214
+ "original": "\"full-width\" | \"fit-content\"",
215
+ "resolved": "\"fit-content\" | \"full-width\"",
216
+ "references": {}
217
+ },
218
+ "required": false,
219
+ "optional": false,
220
+ "docs": {
221
+ "tags": [],
222
+ "text": "Ajusta o comportamento da largura do popover."
223
+ },
224
+ "attribute": "box-width",
225
+ "reflect": true,
226
+ "defaultValue": "\"fit-content\""
227
+ },
228
+ "opened": {
229
+ "type": "boolean",
230
+ "mutable": true,
231
+ "complexType": {
232
+ "original": "boolean",
233
+ "resolved": "boolean",
234
+ "references": {}
235
+ },
236
+ "required": false,
237
+ "optional": false,
238
+ "docs": {
239
+ "tags": [],
240
+ "text": "Define se o ez-popover est\u00E1 aberto."
241
+ },
242
+ "attribute": "opened",
243
+ "reflect": true,
244
+ "defaultValue": "false"
245
+ },
246
+ "overlayType": {
247
+ "type": "string",
248
+ "mutable": false,
249
+ "complexType": {
250
+ "original": "\"medium\" | \"light\" | \"none\"",
251
+ "resolved": "\"light\" | \"medium\" | \"none\"",
252
+ "references": {}
253
+ },
254
+ "required": false,
255
+ "optional": false,
256
+ "docs": {
257
+ "tags": [],
258
+ "text": "Define o tipo de overlay do popover."
259
+ },
260
+ "attribute": "overlay-type",
261
+ "reflect": true,
262
+ "defaultValue": "\"light\""
263
+ },
264
+ "anchorElement": {
265
+ "type": "string",
266
+ "mutable": true,
267
+ "complexType": {
268
+ "original": "HTMLElement | string",
269
+ "resolved": "HTMLElement | string",
270
+ "references": {
271
+ "HTMLElement": {
272
+ "location": "global"
273
+ }
274
+ }
275
+ },
276
+ "required": false,
277
+ "optional": false,
278
+ "docs": {
279
+ "tags": [],
280
+ "text": "Define o elemento de ancoragem."
281
+ },
282
+ "attribute": "anchor-element",
283
+ "reflect": true
284
+ },
285
+ "options": {
286
+ "type": "unknown",
287
+ "mutable": true,
288
+ "complexType": {
289
+ "original": "IEzPopoverAnchorOptions",
290
+ "resolved": "IEzPopoverAnchorOptions",
291
+ "references": {
292
+ "IEzPopoverAnchorOptions": {
293
+ "location": "local"
294
+ }
295
+ }
296
+ },
297
+ "required": false,
298
+ "optional": false,
299
+ "docs": {
300
+ "tags": [],
301
+ "text": "Define as op\u00E7\u00F5es do elemento."
302
+ },
303
+ "defaultValue": "{ horizontalGap: 0, verticalGap: 0, fromRight: false }"
304
+ }
305
+ };
306
+ }
307
+ static get events() {
308
+ return [{
309
+ "method": "ezVisibilityChange",
310
+ "name": "ezVisibilityChange",
311
+ "bubbles": true,
312
+ "cancelable": true,
313
+ "composed": true,
314
+ "docs": {
315
+ "tags": [],
316
+ "text": "Emitido quando acontece a altera\u00E7\u00E3o de estado do componente."
317
+ },
318
+ "complexType": {
319
+ "original": "boolean",
320
+ "resolved": "boolean",
321
+ "references": {}
322
+ }
323
+ }];
324
+ }
325
+ static get methods() {
326
+ return {
327
+ "updatePosition": {
328
+ "complexType": {
329
+ "signature": "(top?: string, left?: string) => Promise<void>",
330
+ "parameters": [{
331
+ "tags": [],
332
+ "text": ""
333
+ }, {
334
+ "tags": [],
335
+ "text": ""
336
+ }],
337
+ "references": {
338
+ "Promise": {
339
+ "location": "global"
340
+ }
341
+ },
342
+ "return": "Promise<void>"
343
+ },
344
+ "docs": {
345
+ "text": "Atualiza a posi\u00E7\u00E3o do popover.",
346
+ "tags": []
347
+ }
348
+ },
349
+ "show": {
350
+ "complexType": {
351
+ "signature": "(top?: string | number, left?: string | number) => Promise<void>",
352
+ "parameters": [{
353
+ "tags": [],
354
+ "text": ""
355
+ }, {
356
+ "tags": [],
357
+ "text": ""
358
+ }],
359
+ "references": {
360
+ "Promise": {
361
+ "location": "global"
362
+ }
363
+ },
364
+ "return": "Promise<void>"
365
+ },
366
+ "docs": {
367
+ "text": "Exibe o ez-popover.",
368
+ "tags": []
369
+ }
370
+ },
371
+ "showUnder": {
372
+ "complexType": {
373
+ "signature": "(element: HTMLElement | string, options?: IEzPopoverAnchorOptions) => Promise<void>",
374
+ "parameters": [{
375
+ "tags": [],
376
+ "text": ""
377
+ }, {
378
+ "tags": [],
379
+ "text": ""
380
+ }],
381
+ "references": {
382
+ "Promise": {
383
+ "location": "global"
384
+ },
385
+ "HTMLElement": {
386
+ "location": "global"
387
+ },
388
+ "IEzPopoverAnchorOptions": {
389
+ "location": "local"
390
+ }
391
+ },
392
+ "return": "Promise<void>"
393
+ },
394
+ "docs": {
395
+ "text": "Ancora a exibi\u00E7\u00E3o do popOver a um elemento HTML.",
396
+ "tags": []
397
+ }
398
+ },
399
+ "hide": {
400
+ "complexType": {
401
+ "signature": "() => Promise<void>",
402
+ "parameters": [],
403
+ "references": {
404
+ "Promise": {
405
+ "location": "global"
406
+ }
407
+ },
408
+ "return": "Promise<void>"
409
+ },
410
+ "docs": {
411
+ "text": "Oculta o ez-popover.",
412
+ "tags": []
413
+ }
414
+ },
415
+ "setOptions": {
416
+ "complexType": {
417
+ "signature": "(options: IEzPopoverAnchorOptions) => Promise<void>",
418
+ "parameters": [{
419
+ "tags": [],
420
+ "text": ""
421
+ }],
422
+ "references": {
423
+ "Promise": {
424
+ "location": "global"
425
+ },
426
+ "IEzPopoverAnchorOptions": {
427
+ "location": "local"
428
+ }
429
+ },
430
+ "return": "Promise<void>"
431
+ },
432
+ "docs": {
433
+ "text": "Altera as op\u00E7\u00F5es.",
434
+ "tags": []
435
+ }
436
+ },
437
+ "setAnchorElement": {
438
+ "complexType": {
439
+ "signature": "(anchor: HTMLElement | string) => Promise<void>",
440
+ "parameters": [{
441
+ "tags": [],
442
+ "text": ""
443
+ }],
444
+ "references": {
445
+ "Promise": {
446
+ "location": "global"
447
+ },
448
+ "HTMLElement": {
449
+ "location": "global"
450
+ }
451
+ },
452
+ "return": "Promise<void>"
453
+ },
454
+ "docs": {
455
+ "text": "Altera o elemento de ancoragem.",
456
+ "tags": []
457
+ }
458
+ }
459
+ };
460
+ }
461
+ static get elementRef() { return "_host"; }
462
+ static get watchers() {
463
+ return [{
464
+ "propName": "opened",
465
+ "methodName": "observeOpened"
466
+ }];
467
+ }
468
+ }
@@ -86,6 +86,12 @@ export const EzComboBox: {
86
86
  new (): EzComboBox;
87
87
  };
88
88
 
89
+ interface EzComboBoxList extends Components.EzComboBoxList, HTMLElement {}
90
+ export const EzComboBoxList: {
91
+ prototype: EzComboBoxList;
92
+ new (): EzComboBoxList;
93
+ };
94
+
89
95
  interface EzCustomFormInput extends Components.EzCustomFormInput, HTMLElement {}
90
96
  export const EzCustomFormInput: {
91
97
  prototype: EzCustomFormInput;
@@ -206,6 +212,12 @@ export const EzPopover: {
206
212
  new (): EzPopover;
207
213
  };
208
214
 
215
+ interface EzPopoverCore extends Components.EzPopoverCore, HTMLElement {}
216
+ export const EzPopoverCore: {
217
+ prototype: EzPopoverCore;
218
+ new (): EzPopoverCore;
219
+ };
220
+
209
221
  interface EzPopoverPlus extends Components.EzPopoverPlus, HTMLElement {}
210
222
  export const EzPopoverPlus: {
211
223
  prototype: EzPopoverPlus;