@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-75065.0 → 0.0.0-bugfix-dev-KB-76625.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-card-item_2.cjs.entry.js +1415 -7
  3. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +186 -0
  5. package/dist/cjs/ez-popover-plus_3.cjs.entry.js +184 -0
  6. package/dist/cjs/ez-search.cjs.entry.js +28 -158
  7. package/dist/cjs/ezui.cjs.js +1 -1
  8. package/dist/cjs/index-a7b0c73d.js +8 -4
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/searchFormatters-b7e1ed1e.js +23 -0
  11. package/dist/collection/collection-manifest.json +3 -1
  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-card-item/ez-card-item.css +1 -3
  15. package/dist/collection/components/ez-icon/ez-icon.css +4 -1
  16. package/dist/collection/components/ez-popover-plus/ez-popover-plus.css +0 -64
  17. package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +56 -130
  18. package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css +67 -0
  19. package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js +527 -0
  20. package/dist/collection/components/ez-search/ez-search.css +0 -219
  21. package/dist/collection/components/ez-search/ez-search.js +28 -167
  22. package/dist/collection/components/ez-search/subcomponent/search-list/search-list.css +227 -0
  23. package/dist/collection/components/ez-search/subcomponent/search-list/search-list.js +289 -0
  24. package/dist/collection/components/ez-search/utils/searchFormatters.js +18 -0
  25. package/dist/custom-elements/index.d.ts +12 -0
  26. package/dist/custom-elements/index.js +263 -196
  27. package/dist/esm/ez-badge.entry.js +2 -14
  28. package/dist/esm/ez-card-item_2.entry.js +1415 -7
  29. package/dist/esm/ez-icon.entry.js +1 -1
  30. package/dist/esm/ez-multi-selection-list.entry.js +182 -0
  31. package/dist/esm/ez-popover-plus_3.entry.js +178 -0
  32. package/dist/esm/ez-search.entry.js +29 -159
  33. package/dist/esm/ezui.js +1 -1
  34. package/dist/esm/index-baa5e267.js +8 -4
  35. package/dist/esm/loader.js +1 -1
  36. package/dist/esm/searchFormatters-8229207e.js +20 -0
  37. package/dist/ezui/ezui.esm.js +1 -1
  38. package/dist/ezui/p-31da1b57.entry.js +1 -0
  39. package/dist/ezui/p-37201156.entry.js +1 -0
  40. package/dist/ezui/p-40a60148.js +1 -0
  41. package/dist/ezui/p-56fe5341.entry.js +1 -0
  42. package/dist/ezui/p-650e4b6d.entry.js +1 -0
  43. package/dist/ezui/p-b7706b43.entry.js +1 -0
  44. package/dist/ezui/p-dc73e1fe.entry.js +1 -0
  45. package/dist/types/components/ez-badge/ez-badge.d.ts +0 -5
  46. package/dist/types/components/ez-popover-plus/ez-popover-plus.d.ts +8 -20
  47. package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +91 -0
  48. package/dist/types/components/ez-search/ez-search.d.ts +3 -13
  49. package/dist/types/components/ez-search/subcomponent/search-list/search-list.d.ts +23 -0
  50. package/dist/types/components/ez-search/utils/searchFormatters.d.ts +2 -0
  51. package/dist/types/components.d.ts +157 -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-multi-selection-list_2.cjs.entry.js +0 -1585
  57. package/dist/esm/ez-multi-selection-list_2.entry.js +0 -1580
  58. package/dist/ezui/p-0ca05a2f.entry.js +0 -1
  59. package/dist/ezui/p-58783dcf.entry.js +0 -1
  60. package/dist/ezui/p-65f471bc.entry.js +0 -1
  61. package/dist/ezui/p-cdac80f1.entry.js +0 -1
  62. package/dist/ezui/p-e75c7a23.entry.js +0 -1
@@ -0,0 +1,67 @@
1
+ :host {
2
+
3
+ /* box */
4
+ /*@doc Define o raio da borda do popover.*/
5
+ --ez-popover__box--border-radius: var(--border--radius-medium, 12px);
6
+ /*@doc Define a sombra do popover.*/
7
+ --ez-popover__box--box-shadow: var(--shadow, 0px 0px 16px 0px #000);
8
+ /*@doc Define a cor de fundo do popover.*/
9
+ --ez-popover__box--background-color: var(--background--xlight, #fff);
10
+ /*@doc Define a camada de visibilidade do popover.*/
11
+ --ez-popover__box--z-index: var(--elevation--20, 20);
12
+
13
+ /***************
14
+ host style
15
+ ***************/
16
+ /*private*/
17
+ position: relative;
18
+ display: flex;
19
+ user-select: none;
20
+ }
21
+
22
+ .popover__overlay {
23
+ display: none;
24
+ position: fixed;
25
+ padding: 0;
26
+ top: 0px;
27
+ left: 0px;
28
+ width: 100%;
29
+ height: 100vh;
30
+ box-sizing: border-box;
31
+ z-index: var(--elevation--16, 16);
32
+ }
33
+
34
+ .popover__overlay--light {
35
+ background-color: rgba(var(--rgb-background--overlay), var(--opacity--bright));
36
+ }
37
+
38
+ .popover__overlay--medium {
39
+ background-color: rgba(var(--rgb-background--overlay), var(--opacity--soft));
40
+ backdrop-filter: blur(var(--background-blur--medium));
41
+ }
42
+
43
+ .popover__box {
44
+ /*private*/
45
+ display: none;
46
+ position: fixed;
47
+ top: 0;
48
+ left: 0;
49
+
50
+ z-index: var(--ez-popover__box--z-index);
51
+ flex-direction: column;
52
+
53
+ height: fit-content;
54
+
55
+ /*public*/
56
+ background-color: var(--ez-popover__box--background-color);
57
+ border-radius: var(--ez-popover__box--border-radius);
58
+ box-shadow: var(--ez-popover__box--box-shadow);
59
+ }
60
+
61
+ .popover__box--fit-content {
62
+ width: fit-content;
63
+ }
64
+
65
+ .popover__box--full-width {
66
+ width: calc(100% - 10px);
67
+ }
@@ -0,0 +1,527 @@
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
+ this.useAnchorSize = false;
13
+ this.minWidth = 150;
14
+ }
15
+ observeOpened(newValue, oldValue) {
16
+ if (newValue !== oldValue) {
17
+ if (newValue) {
18
+ this.openPopover();
19
+ }
20
+ else {
21
+ this.hidePopover();
22
+ }
23
+ }
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
+ getElement(element) {
83
+ if (typeof element === 'string') {
84
+ return document.getElementById(element);
85
+ }
86
+ return element;
87
+ }
88
+ getAnchorElement() {
89
+ if (!this.anchorElement) {
90
+ return this._host;
91
+ }
92
+ if (Array.isArray(this.anchorElement)) {
93
+ for (const element of this.anchorElement) {
94
+ const htmlElement = this.getElement(element);
95
+ if (htmlElement) {
96
+ return htmlElement;
97
+ }
98
+ }
99
+ }
100
+ return this.getElement(this.anchorElement);
101
+ }
102
+ async updatePositionPopover() {
103
+ if (!this._box || !this.opened) {
104
+ return;
105
+ }
106
+ const currentAnchorElement = this.getAnchorElement();
107
+ if (this.useAnchorSize) {
108
+ const anchorSize = currentAnchorElement.getBoundingClientRect().width;
109
+ const width = anchorSize < this.minWidth ? this.minWidth : anchorSize;
110
+ this._box.style.width = `${width}px`;
111
+ }
112
+ await computePosition(currentAnchorElement, this._box, {
113
+ placement: this.options.fromRight ? 'bottom-end' : 'bottom-start',
114
+ middleware: [flip(), shift({ padding: 5 })],
115
+ strategy: 'fixed',
116
+ }).then(({ x, y, placement }) => {
117
+ const newTop = placement.includes("bottom") ? y + this.options.verticalGap : y - this.options.verticalGap;
118
+ const newLeft = placement.includes("start") ? x + this.options.horizontalGap : x - this.options.horizontalGap;
119
+ Object.assign(this._box.style, {
120
+ top: `${newTop}px`,
121
+ left: `${newLeft}px`,
122
+ });
123
+ });
124
+ }
125
+ hidePopover() {
126
+ if (!this._box) {
127
+ return;
128
+ }
129
+ this._box.style.display = '';
130
+ this.hideOverlay();
131
+ this.ezVisibilityChange.emit(false);
132
+ }
133
+ async openPopover() {
134
+ if (!this._box) {
135
+ return;
136
+ }
137
+ if (this.opened) {
138
+ this._box.style.display = 'flex';
139
+ this._box.style.visibility = 'hidden';
140
+ await this.updatePositionPopover();
141
+ this.openOverlay();
142
+ this.ezVisibilityChange.emit(true);
143
+ this._box.style.visibility = 'visible';
144
+ }
145
+ }
146
+ openOverlay() {
147
+ if (!this._overlay || !this._overlayIsActive) {
148
+ return;
149
+ }
150
+ this._overlay.style.display = 'block';
151
+ }
152
+ hideOverlay() {
153
+ if (!this._overlay) {
154
+ return;
155
+ }
156
+ this._overlay.style.display = 'none';
157
+ }
158
+ checkStatusOverlay() {
159
+ if (this.overlayType !== "none") {
160
+ return true;
161
+ }
162
+ if (this.overlayType === "none" && this.autoClose) {
163
+ return true;
164
+ }
165
+ return false;
166
+ }
167
+ updatePositionDebounce() {
168
+ if (!this.opened) {
169
+ return;
170
+ }
171
+ clearTimeout(this._timeoutDebounce);
172
+ this._timeoutDebounce = setTimeout(() => {
173
+ this.updatePositionPopover();
174
+ }, this.TIME_DEBOUNCE);
175
+ }
176
+ componentWillLoad() {
177
+ window.addEventListener('scroll', this.updatePositionDebounce.bind(this), true);
178
+ window.addEventListener('resize', this.updatePositionDebounce.bind(this), true);
179
+ }
180
+ componentDidLoad() {
181
+ this._overlayIsActive = this.checkStatusOverlay();
182
+ this._resizeObserver = new ResizeObserver(this.updatePositionPopover.bind(this));
183
+ this._resizeObserver.observe(this._box);
184
+ this.openPopover();
185
+ }
186
+ disconnectedCallback() {
187
+ window.removeEventListener('scroll', this.updatePositionDebounce.bind(this), true);
188
+ window.removeEventListener('resize', this.updatePositionDebounce.bind(this), true);
189
+ this._resizeObserver.disconnect();
190
+ }
191
+ render() {
192
+ 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: {
193
+ "popover__box": true,
194
+ "popover__box--fit-content": this.boxWidth === "fit-content",
195
+ "popover__box--full-width": this.boxWidth !== "fit-content",
196
+ } }, h("slot", null))));
197
+ }
198
+ static get is() { return "ez-popover-core"; }
199
+ static get encapsulation() { return "shadow"; }
200
+ static get originalStyleUrls() {
201
+ return {
202
+ "$": ["ez-popover-core.css"]
203
+ };
204
+ }
205
+ static get styleUrls() {
206
+ return {
207
+ "$": ["ez-popover-core.css"]
208
+ };
209
+ }
210
+ static get properties() {
211
+ return {
212
+ "autoClose": {
213
+ "type": "boolean",
214
+ "mutable": false,
215
+ "complexType": {
216
+ "original": "boolean",
217
+ "resolved": "boolean",
218
+ "references": {}
219
+ },
220
+ "required": false,
221
+ "optional": false,
222
+ "docs": {
223
+ "tags": [],
224
+ "text": "Define que ser\u00E1 fechado automaticamente quando o usu\u00E1rio clicar fora do conte\u00FAdo."
225
+ },
226
+ "attribute": "auto-close",
227
+ "reflect": true,
228
+ "defaultValue": "true"
229
+ },
230
+ "boxWidth": {
231
+ "type": "string",
232
+ "mutable": false,
233
+ "complexType": {
234
+ "original": "\"full-width\" | \"fit-content\"",
235
+ "resolved": "\"fit-content\" | \"full-width\"",
236
+ "references": {}
237
+ },
238
+ "required": false,
239
+ "optional": false,
240
+ "docs": {
241
+ "tags": [],
242
+ "text": "Ajusta o comportamento da largura do popover."
243
+ },
244
+ "attribute": "box-width",
245
+ "reflect": true,
246
+ "defaultValue": "\"fit-content\""
247
+ },
248
+ "opened": {
249
+ "type": "boolean",
250
+ "mutable": true,
251
+ "complexType": {
252
+ "original": "boolean",
253
+ "resolved": "boolean",
254
+ "references": {}
255
+ },
256
+ "required": false,
257
+ "optional": false,
258
+ "docs": {
259
+ "tags": [],
260
+ "text": "Define se o ez-popover est\u00E1 aberto."
261
+ },
262
+ "attribute": "opened",
263
+ "reflect": true,
264
+ "defaultValue": "false"
265
+ },
266
+ "overlayType": {
267
+ "type": "string",
268
+ "mutable": false,
269
+ "complexType": {
270
+ "original": "\"medium\" | \"light\" | \"none\"",
271
+ "resolved": "\"light\" | \"medium\" | \"none\"",
272
+ "references": {}
273
+ },
274
+ "required": false,
275
+ "optional": false,
276
+ "docs": {
277
+ "tags": [],
278
+ "text": "Define o tipo de overlay do popover."
279
+ },
280
+ "attribute": "overlay-type",
281
+ "reflect": true,
282
+ "defaultValue": "\"light\""
283
+ },
284
+ "anchorElement": {
285
+ "type": "string",
286
+ "mutable": true,
287
+ "complexType": {
288
+ "original": "Array<HTMLElement | string> | HTMLElement | string",
289
+ "resolved": "(string | HTMLElement)[] | HTMLElement | string",
290
+ "references": {
291
+ "Array": {
292
+ "location": "global"
293
+ },
294
+ "HTMLElement": {
295
+ "location": "global"
296
+ }
297
+ }
298
+ },
299
+ "required": false,
300
+ "optional": false,
301
+ "docs": {
302
+ "tags": [],
303
+ "text": "Define o elemento de ancoragem."
304
+ },
305
+ "attribute": "anchor-element",
306
+ "reflect": true
307
+ },
308
+ "options": {
309
+ "type": "unknown",
310
+ "mutable": true,
311
+ "complexType": {
312
+ "original": "IEzPopoverAnchorOptions",
313
+ "resolved": "IEzPopoverAnchorOptions",
314
+ "references": {
315
+ "IEzPopoverAnchorOptions": {
316
+ "location": "local"
317
+ }
318
+ }
319
+ },
320
+ "required": false,
321
+ "optional": false,
322
+ "docs": {
323
+ "tags": [],
324
+ "text": "Define as op\u00E7\u00F5es do elemento."
325
+ },
326
+ "defaultValue": "{ horizontalGap: 0, verticalGap: 0, fromRight: false }"
327
+ },
328
+ "useAnchorSize": {
329
+ "type": "boolean",
330
+ "mutable": false,
331
+ "complexType": {
332
+ "original": "boolean",
333
+ "resolved": "boolean",
334
+ "references": {}
335
+ },
336
+ "required": false,
337
+ "optional": false,
338
+ "docs": {
339
+ "tags": [],
340
+ "text": "Define se o elemento manter\u00E1 o mesmo tamanho do componente de ancora."
341
+ },
342
+ "attribute": "use-anchor-size",
343
+ "reflect": true,
344
+ "defaultValue": "false"
345
+ },
346
+ "minWidth": {
347
+ "type": "number",
348
+ "mutable": false,
349
+ "complexType": {
350
+ "original": "number",
351
+ "resolved": "number",
352
+ "references": {}
353
+ },
354
+ "required": false,
355
+ "optional": false,
356
+ "docs": {
357
+ "tags": [],
358
+ "text": "Define a largura m\u00EDnima do elemento (apenas ser\u00E1 considerada caso a propriedade useAnchorSize seja verdadeira)."
359
+ },
360
+ "attribute": "min-width",
361
+ "reflect": true,
362
+ "defaultValue": "150"
363
+ }
364
+ };
365
+ }
366
+ static get events() {
367
+ return [{
368
+ "method": "ezVisibilityChange",
369
+ "name": "ezVisibilityChange",
370
+ "bubbles": true,
371
+ "cancelable": true,
372
+ "composed": true,
373
+ "docs": {
374
+ "tags": [],
375
+ "text": "Emitido quando acontece a altera\u00E7\u00E3o de estado do componente."
376
+ },
377
+ "complexType": {
378
+ "original": "boolean",
379
+ "resolved": "boolean",
380
+ "references": {}
381
+ }
382
+ }];
383
+ }
384
+ static get methods() {
385
+ return {
386
+ "updatePosition": {
387
+ "complexType": {
388
+ "signature": "(top?: string, left?: string) => Promise<void>",
389
+ "parameters": [{
390
+ "tags": [],
391
+ "text": ""
392
+ }, {
393
+ "tags": [],
394
+ "text": ""
395
+ }],
396
+ "references": {
397
+ "Promise": {
398
+ "location": "global"
399
+ }
400
+ },
401
+ "return": "Promise<void>"
402
+ },
403
+ "docs": {
404
+ "text": "Atualiza a posi\u00E7\u00E3o do popover.",
405
+ "tags": []
406
+ }
407
+ },
408
+ "show": {
409
+ "complexType": {
410
+ "signature": "(top?: string | number, left?: string | number) => Promise<void>",
411
+ "parameters": [{
412
+ "tags": [],
413
+ "text": ""
414
+ }, {
415
+ "tags": [],
416
+ "text": ""
417
+ }],
418
+ "references": {
419
+ "Promise": {
420
+ "location": "global"
421
+ }
422
+ },
423
+ "return": "Promise<void>"
424
+ },
425
+ "docs": {
426
+ "text": "Exibe o ez-popover.",
427
+ "tags": []
428
+ }
429
+ },
430
+ "showUnder": {
431
+ "complexType": {
432
+ "signature": "(element: HTMLElement | string, options?: IEzPopoverAnchorOptions) => Promise<void>",
433
+ "parameters": [{
434
+ "tags": [],
435
+ "text": ""
436
+ }, {
437
+ "tags": [],
438
+ "text": ""
439
+ }],
440
+ "references": {
441
+ "Promise": {
442
+ "location": "global"
443
+ },
444
+ "HTMLElement": {
445
+ "location": "global"
446
+ },
447
+ "IEzPopoverAnchorOptions": {
448
+ "location": "local"
449
+ }
450
+ },
451
+ "return": "Promise<void>"
452
+ },
453
+ "docs": {
454
+ "text": "Ancora a exibi\u00E7\u00E3o do popOver a um elemento HTML.",
455
+ "tags": []
456
+ }
457
+ },
458
+ "hide": {
459
+ "complexType": {
460
+ "signature": "() => Promise<void>",
461
+ "parameters": [],
462
+ "references": {
463
+ "Promise": {
464
+ "location": "global"
465
+ }
466
+ },
467
+ "return": "Promise<void>"
468
+ },
469
+ "docs": {
470
+ "text": "Oculta o ez-popover.",
471
+ "tags": []
472
+ }
473
+ },
474
+ "setOptions": {
475
+ "complexType": {
476
+ "signature": "(options: IEzPopoverAnchorOptions) => Promise<void>",
477
+ "parameters": [{
478
+ "tags": [],
479
+ "text": ""
480
+ }],
481
+ "references": {
482
+ "Promise": {
483
+ "location": "global"
484
+ },
485
+ "IEzPopoverAnchorOptions": {
486
+ "location": "local"
487
+ }
488
+ },
489
+ "return": "Promise<void>"
490
+ },
491
+ "docs": {
492
+ "text": "Altera as op\u00E7\u00F5es.",
493
+ "tags": []
494
+ }
495
+ },
496
+ "setAnchorElement": {
497
+ "complexType": {
498
+ "signature": "(anchor: HTMLElement | string) => Promise<void>",
499
+ "parameters": [{
500
+ "tags": [],
501
+ "text": ""
502
+ }],
503
+ "references": {
504
+ "Promise": {
505
+ "location": "global"
506
+ },
507
+ "HTMLElement": {
508
+ "location": "global"
509
+ }
510
+ },
511
+ "return": "Promise<void>"
512
+ },
513
+ "docs": {
514
+ "text": "Altera o elemento de ancoragem.",
515
+ "tags": []
516
+ }
517
+ }
518
+ };
519
+ }
520
+ static get elementRef() { return "_host"; }
521
+ static get watchers() {
522
+ return [{
523
+ "propName": "opened",
524
+ "methodName": "observeOpened"
525
+ }];
526
+ }
527
+ }