@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-75065.1 → 0.0.0-bugfix-dev-KB-83282.1
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.
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-badge.cjs.entry.js +3 -15
- package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-chart.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +387 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +59 -185
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-double-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +59 -1
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +186 -0
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/{ez-multi-selection-list_2.cjs.entry.js → ez-popover-core_2.cjs.entry.js} +116 -197
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-panel.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ez-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/ez-tree.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +1 -1
- package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/filter-column.cjs.entry.js +1 -1
- package/dist/cjs/{index-9e5554cb.js → index-a7b0c73d.js} +8 -7
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/ez-badge/ez-badge.css +1 -12
- package/dist/collection/components/ez-badge/ez-badge.js +1 -31
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.css +205 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js +426 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +0 -250
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +61 -194
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +3 -0
- package/dist/collection/components/ez-grid/ez-grid.js +56 -1
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.css +0 -64
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +47 -127
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css +67 -0
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js +468 -0
- package/dist/custom-elements/index.d.ts +12 -0
- package/dist/custom-elements/index.js +394 -218
- package/dist/esm/ez-actions-button.entry.js +1 -1
- package/dist/esm/ez-alert-list.entry.js +1 -1
- package/dist/esm/ez-alert.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-badge.entry.js +3 -15
- package/dist/esm/ez-breadcrumb.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-card-item_2.entry.js +1 -1
- package/dist/esm/ez-chart.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box-list_3.entry.js +381 -0
- package/dist/esm/ez-combo-box.entry.js +60 -186
- package/dist/esm/ez-date-input.entry.js +1 -1
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-double-list.entry.js +1 -1
- package/dist/esm/ez-dropdown_2.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-filter-input.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +60 -2
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-multi-selection-list.entry.js +182 -0
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/{ez-multi-selection-list_2.entry.js → ez-popover-core_2.entry.js} +116 -197
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-scroller_2.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +1 -1
- package/dist/esm/ez-split-item.entry.js +1 -1
- package/dist/esm/ez-split-panel.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ez-tooltip.entry.js +1 -1
- package/dist/esm/ez-tree.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +1 -1
- package/dist/esm/ez-view-stack.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/filter-column.entry.js +1 -1
- package/dist/esm/{index-5a720e56.js → index-baa5e267.js} +9 -7
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-e6b38ade.entry.js → p-0306dff7.entry.js} +1 -1
- package/dist/ezui/{p-91ccae0c.entry.js → p-09de35a2.entry.js} +1 -1
- package/dist/ezui/{p-88c615f0.entry.js → p-0fa52b0f.entry.js} +1 -1
- package/dist/ezui/{p-92fbaf2b.entry.js → p-0faf71c5.entry.js} +1 -1
- package/dist/ezui/{p-b2f6bc0a.entry.js → p-17be134a.entry.js} +1 -1
- package/dist/ezui/{p-c96fbbef.entry.js → p-17de16e5.entry.js} +1 -1
- package/dist/ezui/{p-24b42f3d.entry.js → p-17eabf46.entry.js} +1 -1
- package/dist/ezui/{p-3885e66e.entry.js → p-1ad6c61b.entry.js} +1 -1
- package/dist/ezui/{p-81461d2f.entry.js → p-1e7a8633.entry.js} +1 -1
- package/dist/ezui/{p-6b51c9cc.entry.js → p-1f50fa05.entry.js} +1 -1
- package/dist/ezui/{p-cf33bc48.entry.js → p-20c024f7.entry.js} +1 -1
- package/dist/ezui/{p-e4c7eb39.js → p-23a36bb6.js} +2 -2
- package/dist/ezui/{p-6d31c43c.entry.js → p-2bb2a0c4.entry.js} +1 -1
- package/dist/ezui/{p-ca8936df.entry.js → p-2f45506d.entry.js} +1 -1
- package/dist/ezui/{p-9fc250d4.entry.js → p-3195a7a7.entry.js} +1 -1
- package/dist/ezui/{p-23dab72f.entry.js → p-31b71e50.entry.js} +1 -1
- package/dist/ezui/{p-b22889ea.entry.js → p-3429080c.entry.js} +1 -1
- package/dist/ezui/{p-0378416a.entry.js → p-44caad9a.entry.js} +1 -1
- package/dist/ezui/{p-a3319796.entry.js → p-53116373.entry.js} +46 -46
- package/dist/ezui/{p-7567ccdd.entry.js → p-555c9018.entry.js} +1 -1
- package/dist/ezui/{p-3791d9c8.entry.js → p-556468d9.entry.js} +1 -1
- package/dist/ezui/{p-9066b0b0.entry.js → p-56fe5341.entry.js} +1 -1
- package/dist/ezui/{p-cf3b60fd.entry.js → p-58783dcf.entry.js} +1 -1
- package/dist/ezui/{p-044d46d5.entry.js → p-5b205c80.entry.js} +1 -1
- package/dist/ezui/{p-6fc26622.entry.js → p-5ed81457.entry.js} +1 -1
- package/dist/ezui/p-650e4b6d.entry.js +1 -0
- package/dist/ezui/{p-03b0ed5a.entry.js → p-65f471bc.entry.js} +1 -1
- package/dist/ezui/{p-6d8b3298.entry.js → p-6cdd3e0a.entry.js} +1 -1
- package/dist/ezui/{p-fc194825.entry.js → p-6e429cff.entry.js} +1 -1
- package/dist/ezui/{p-11bfeca3.entry.js → p-77a4bd35.entry.js} +1 -1
- package/dist/ezui/p-7bd15498.entry.js +1 -0
- package/dist/ezui/{p-2069c78a.entry.js → p-7e677b7b.entry.js} +1 -1
- package/dist/ezui/{p-e18d9e6a.entry.js → p-7fdd479f.entry.js} +1 -1
- package/dist/ezui/{p-82fa4b09.entry.js → p-8df1ca33.entry.js} +1 -1
- package/dist/ezui/{p-a921e3e7.entry.js → p-990b4318.entry.js} +1 -1
- package/dist/ezui/{p-c2b20f78.entry.js → p-9f5fa3f9.entry.js} +1 -1
- package/dist/ezui/{p-0cfbbe82.entry.js → p-a4cee65d.entry.js} +1 -1
- package/dist/ezui/{p-dfca5946.entry.js → p-a80b1287.entry.js} +1 -1
- package/dist/ezui/{p-f30e0590.entry.js → p-b26f6c5b.entry.js} +1 -1
- package/dist/ezui/p-bc2f844e.entry.js +1 -0
- package/dist/ezui/{p-92748142.entry.js → p-c0d9c4f8.entry.js} +1 -1
- package/dist/ezui/{p-4818b8ce.entry.js → p-c1527804.entry.js} +1 -1
- package/dist/ezui/p-c297aa52.entry.js +1 -0
- package/dist/ezui/{p-b9282c79.entry.js → p-cb1535f7.entry.js} +1 -1
- package/dist/ezui/{p-f4da7e1e.entry.js → p-cf87aacb.entry.js} +1 -1
- package/dist/ezui/{p-5010315a.entry.js → p-d9548bdf.entry.js} +1 -1
- package/dist/ezui/{p-708b196e.entry.js → p-da1b4a38.entry.js} +1 -1
- package/dist/ezui/p-dc73e1fe.entry.js +1 -0
- package/dist/ezui/{p-bef7daac.entry.js → p-e347df9c.entry.js} +1 -1
- package/dist/ezui/{p-9e95bfeb.entry.js → p-e6a9041d.entry.js} +1 -1
- package/dist/ezui/{p-68b2e579.entry.js → p-ea54d056.entry.js} +1 -1
- package/dist/ezui/p-f5931caa.entry.js +1 -0
- package/dist/ezui/{p-44b39e81.entry.js → p-fa6732f2.entry.js} +1 -1
- package/dist/ezui/{p-e3f8660b.entry.js → p-fd0a19d6.entry.js} +1 -1
- package/dist/types/components/ez-badge/ez-badge.d.ts +0 -5
- package/dist/types/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.d.ts +104 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +7 -16
- package/dist/types/components/ez-grid/ez-grid.d.ts +5 -0
- package/dist/types/components/ez-popover-plus/ez-popover-plus.d.ts +6 -19
- package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +81 -0
- package/dist/types/components.d.ts +218 -11
- package/package.json +1 -1
- package/react/components.d.ts +2 -0
- package/react/components.js +2 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +0 -236
- package/dist/esm/ez-custom-form-input_2.entry.js +0 -231
- package/dist/ezui/p-000159dc.entry.js +0 -1
- package/dist/ezui/p-3af64edd.entry.js +0 -1
- package/dist/ezui/p-6ec40dec.entry.js +0 -1
- package/dist/ezui/p-cba34702.entry.js +0 -1
- package/dist/ezui/p-fcc78b7f.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementIDUtils, JSUtils, OverflowWatcher, OVERFLOWED_CLASS_NAME, StringUtils, ApplicationContext, } from '@sankhyalabs/core';
|
|
1
|
+
import { ElementIDUtils, JSUtils, OverflowWatcher, OVERFLOWED_CLASS_NAME, StringUtils, ApplicationContext, KeyboardManager, } from '@sankhyalabs/core';
|
|
2
2
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
|
3
3
|
import { Host, h } from '@stencil/core';
|
|
4
4
|
import { ApplicationUtils } from '../../utils';
|
|
@@ -362,6 +362,20 @@ export class EzGrid {
|
|
|
362
362
|
.then(() => this.resetPaginationState());
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
+
nextRecord() {
|
|
366
|
+
if (this.dataUnit) {
|
|
367
|
+
if (this.dataUnit.getSelectionInfo().records.length === 0) {
|
|
368
|
+
this.dataUnit.selectFirst();
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
this.dataUnit.nextRecord();
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
previousRecord() {
|
|
375
|
+
if (this.dataUnit) {
|
|
376
|
+
this.dataUnit.previousRecord();
|
|
377
|
+
}
|
|
378
|
+
}
|
|
365
379
|
resetPaginationState() {
|
|
366
380
|
var _a;
|
|
367
381
|
this._paginationChangedByKeyboard = false;
|
|
@@ -444,6 +458,7 @@ export class EzGrid {
|
|
|
444
458
|
this._gridController.configFilterColumn(this._filterColumn);
|
|
445
459
|
if (this.paginationCounterMode === 'auto')
|
|
446
460
|
this._initHeaderOverflowWatcher();
|
|
461
|
+
this.initKeyboardManager();
|
|
447
462
|
}
|
|
448
463
|
handlePaginationChange(selectFirstRecord, paginationInfo) {
|
|
449
464
|
var _a;
|
|
@@ -510,6 +525,7 @@ export class EzGrid {
|
|
|
510
525
|
var _a, _b;
|
|
511
526
|
(_a = this._headerOverflowWatcher) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
512
527
|
(_b = this._gridController) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
528
|
+
this.removeShortcuts();
|
|
513
529
|
}
|
|
514
530
|
connectedCallback() {
|
|
515
531
|
var _a;
|
|
@@ -548,6 +564,45 @@ export class EzGrid {
|
|
|
548
564
|
return "left__header-expanded";
|
|
549
565
|
return "left__header-contracted";
|
|
550
566
|
}
|
|
567
|
+
async initKeyboardManager() {
|
|
568
|
+
this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
|
|
569
|
+
this._keyboardManager
|
|
570
|
+
.bind("ctrl + .", () => {
|
|
571
|
+
if (!this._paginationInfo)
|
|
572
|
+
return;
|
|
573
|
+
this.nextRecord();
|
|
574
|
+
}, { description: "Avança para o próximo registro.", element: this._element })
|
|
575
|
+
.bind("ctrl + ,", () => {
|
|
576
|
+
if (!this._paginationInfo)
|
|
577
|
+
return;
|
|
578
|
+
this.previousRecord();
|
|
579
|
+
}, { description: "Retorna ao registro anterior.", element: this._element })
|
|
580
|
+
.bind("ctrl + alt + ArrowLeft", () => {
|
|
581
|
+
if (!this._paginationInfo)
|
|
582
|
+
return;
|
|
583
|
+
const { currentPage } = this._paginationInfo;
|
|
584
|
+
if (currentPage > 0) {
|
|
585
|
+
this.previousPage();
|
|
586
|
+
}
|
|
587
|
+
}, { description: "Retorna a pagina anterior.", element: this._element })
|
|
588
|
+
.bind("ctrl + alt + ArrowRight", () => {
|
|
589
|
+
if (!this._paginationInfo)
|
|
590
|
+
return;
|
|
591
|
+
const { hasMore } = this._paginationInfo;
|
|
592
|
+
if (hasMore) {
|
|
593
|
+
this.nextPage();
|
|
594
|
+
}
|
|
595
|
+
}, { description: "Avança para a próxima página.", element: this._element });
|
|
596
|
+
}
|
|
597
|
+
async removeShortcuts() {
|
|
598
|
+
if (this._keyboardManager) {
|
|
599
|
+
this._keyboardManager
|
|
600
|
+
.unbind("ctrl + .")
|
|
601
|
+
.unbind("ctrl + ,")
|
|
602
|
+
.unbind("ctrl + alt + ArrowLeft")
|
|
603
|
+
.unbind("ctrl + alt + ArrowRight");
|
|
604
|
+
}
|
|
605
|
+
}
|
|
551
606
|
render() {
|
|
552
607
|
var _a;
|
|
553
608
|
return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: {
|
|
@@ -1,67 +1,3 @@
|
|
|
1
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(--most-visible, 4);
|
|
12
|
-
|
|
13
|
-
/***************
|
|
14
|
-
host style
|
|
15
|
-
***************/
|
|
16
|
-
/*private*/
|
|
17
|
-
position: relative;
|
|
18
|
-
display: flex;
|
|
19
|
-
user-select: none;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.popover__overlay {
|
|
23
2
|
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(--more-visible--2x, 3);
|
|
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
3
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { h, Host } from "@stencil/core";
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
3
2
|
export class EzPopoverPlus {
|
|
4
3
|
constructor() {
|
|
5
|
-
this.TIME_DEBOUNCE = 500;
|
|
6
4
|
this.autoClose = true;
|
|
7
5
|
this.boxWidth = "fit-content";
|
|
8
6
|
this.opened = false;
|
|
@@ -10,167 +8,80 @@ export class EzPopoverPlus {
|
|
|
10
8
|
this.anchorElement = undefined;
|
|
11
9
|
this.options = { horizontalGap: 0, verticalGap: 0, fromRight: false };
|
|
12
10
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
this.hidePopover();
|
|
20
|
-
}
|
|
21
|
-
this.ezVisibilityChange.emit(newValue);
|
|
22
|
-
return;
|
|
11
|
+
listenerEzVisibilityChange({ detail }) {
|
|
12
|
+
this.ezVisibilityChange.emit(detail);
|
|
13
|
+
}
|
|
14
|
+
async observeOpened(newValue) {
|
|
15
|
+
if (newValue && !this._popOverCore) {
|
|
16
|
+
this.renderPopoverCore();
|
|
23
17
|
}
|
|
18
|
+
this._popOverCore.opened = newValue;
|
|
24
19
|
}
|
|
25
20
|
/**
|
|
26
21
|
* Atualiza a posição do popover.
|
|
27
22
|
*/
|
|
28
23
|
async updatePosition(top, left) {
|
|
29
|
-
|
|
30
|
-
await this.
|
|
24
|
+
var _a;
|
|
25
|
+
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.updatePosition(top, left));
|
|
31
26
|
}
|
|
32
27
|
/**
|
|
33
28
|
* Exibe o ez-popover.
|
|
34
29
|
*/
|
|
35
30
|
async show(top, left) {
|
|
36
|
-
this.
|
|
37
|
-
|
|
31
|
+
if (!this._popOverCore) {
|
|
32
|
+
this.renderPopoverCore();
|
|
33
|
+
}
|
|
34
|
+
await this._popOverCore.show(top, left);
|
|
38
35
|
}
|
|
39
36
|
/**
|
|
40
37
|
* Ancora a exibição do popOver a um elemento HTML.
|
|
41
38
|
*/
|
|
42
39
|
async showUnder(element, options) {
|
|
43
|
-
if (
|
|
44
|
-
this.
|
|
40
|
+
if (!this._popOverCore) {
|
|
41
|
+
this.renderPopoverCore();
|
|
45
42
|
}
|
|
46
|
-
this.
|
|
47
|
-
this.opened = true;
|
|
43
|
+
await this._popOverCore.showUnder(element, options);
|
|
48
44
|
}
|
|
49
45
|
/**
|
|
50
46
|
* Oculta o ez-popover.
|
|
51
47
|
*/
|
|
52
48
|
async hide() {
|
|
53
|
-
|
|
49
|
+
var _a;
|
|
50
|
+
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.hide());
|
|
54
51
|
}
|
|
55
52
|
/**
|
|
56
53
|
* Altera as opções.
|
|
57
54
|
*/
|
|
58
55
|
async setOptions(options) {
|
|
59
|
-
|
|
56
|
+
var _a;
|
|
57
|
+
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.setOptions(options));
|
|
60
58
|
}
|
|
61
59
|
/**
|
|
62
60
|
* Altera o elemento de ancoragem.
|
|
63
61
|
*/
|
|
64
62
|
async setAnchorElement(anchor) {
|
|
65
|
-
|
|
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);
|
|
63
|
+
var _a;
|
|
64
|
+
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.setAnchorElement(anchor));
|
|
112
65
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
66
|
+
renderPopoverCore() {
|
|
67
|
+
this._popOverCore = document.createElement('ez-popover-core');
|
|
68
|
+
this._popOverCore.opened = this.opened;
|
|
69
|
+
this._popOverCore.anchorElement = this.anchorElement;
|
|
70
|
+
this._popOverCore.autoClose = this.autoClose;
|
|
71
|
+
this._popOverCore.boxWidth = this.boxWidth;
|
|
72
|
+
this._popOverCore.overlayType = this.overlayType;
|
|
73
|
+
this._popOverCore.options = this.options;
|
|
74
|
+
const firstChild = this._host.children.item(0);
|
|
75
|
+
if (firstChild) {
|
|
76
|
+
this._popOverCore.appendChild(firstChild);
|
|
116
77
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
await this.updatePositionPopover();
|
|
120
|
-
this.openOverlay();
|
|
121
|
-
this.ezVisibilityChange.emit(true);
|
|
122
|
-
this._box.style.visibility = 'visible';
|
|
123
|
-
}
|
|
124
|
-
openOverlay() {
|
|
125
|
-
if (!this._overlay || !this._overlayIsActive) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
this._overlay.style.display = 'block';
|
|
129
|
-
}
|
|
130
|
-
hideOverlay() {
|
|
131
|
-
if (!this._overlay) {
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
this._overlay.style.display = 'none';
|
|
135
|
-
}
|
|
136
|
-
checkStatusOverlay() {
|
|
137
|
-
if (this.overlayType !== "none") {
|
|
138
|
-
return true;
|
|
139
|
-
}
|
|
140
|
-
if (this.overlayType === "none" && this.autoClose) {
|
|
141
|
-
return true;
|
|
142
|
-
}
|
|
143
|
-
return false;
|
|
144
|
-
}
|
|
145
|
-
updatePositionDebounce() {
|
|
146
|
-
if (!this.opened) {
|
|
147
|
-
return;
|
|
78
|
+
else {
|
|
79
|
+
console.warn('O slot do popover está vazio. Adicione conteúdo ao slot para exibição correta.');
|
|
148
80
|
}
|
|
149
|
-
|
|
150
|
-
this._timeoutDebounce = setTimeout(() => {
|
|
151
|
-
this.updatePositionPopover();
|
|
152
|
-
}, this.TIME_DEBOUNCE);
|
|
153
|
-
}
|
|
154
|
-
componentWillLoad() {
|
|
155
|
-
window.addEventListener('scroll', this.updatePositionDebounce.bind(this), true);
|
|
156
|
-
window.addEventListener('resize', this.updatePositionDebounce.bind(this), true);
|
|
157
|
-
}
|
|
158
|
-
componentDidLoad() {
|
|
159
|
-
this._overlayIsActive = this.checkStatusOverlay();
|
|
160
|
-
this._resizeObserver = new ResizeObserver(this.updatePositionPopover.bind(this));
|
|
161
|
-
this._resizeObserver.observe(this._box);
|
|
162
|
-
}
|
|
163
|
-
disconnectedCallback() {
|
|
164
|
-
window.removeEventListener('scroll', this.updatePositionDebounce.bind(this), true);
|
|
165
|
-
window.removeEventListener('resize', this.updatePositionDebounce.bind(this), true);
|
|
166
|
-
this._resizeObserver.disconnect();
|
|
81
|
+
document.body.appendChild(this._popOverCore);
|
|
167
82
|
}
|
|
168
83
|
render() {
|
|
169
|
-
return (h(Host, null, h("
|
|
170
|
-
"popover__box": true,
|
|
171
|
-
"popover__box--fit-content": this.boxWidth === "fit-content",
|
|
172
|
-
"popover__box--full-width": this.boxWidth !== "fit-content",
|
|
173
|
-
} }, h("slot", null))));
|
|
84
|
+
return (h(Host, null, h("slot", null)));
|
|
174
85
|
}
|
|
175
86
|
static get is() { return "ez-popover-plus"; }
|
|
176
87
|
static get encapsulation() { return "shadow"; }
|
|
@@ -462,4 +373,13 @@ export class EzPopoverPlus {
|
|
|
462
373
|
"methodName": "observeOpened"
|
|
463
374
|
}];
|
|
464
375
|
}
|
|
376
|
+
static get listeners() {
|
|
377
|
+
return [{
|
|
378
|
+
"name": "ezVisibilityChange",
|
|
379
|
+
"method": "listenerEzVisibilityChange",
|
|
380
|
+
"target": undefined,
|
|
381
|
+
"capture": false,
|
|
382
|
+
"passive": false
|
|
383
|
+
}];
|
|
384
|
+
}
|
|
465
385
|
}
|
|
@@ -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(--most-visible, 4);
|
|
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(--more-visible--2x, 3);
|
|
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
|
+
}
|