@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-83282.0 → 0.0.0-bugfix-dev-KB-75065.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 +15 -3
- 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.cjs.entry.js +185 -59
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +236 -0
- 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 +1 -59
- 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-popover-core_2.cjs.entry.js → ez-multi-selection-list_2.cjs.entry.js} +197 -116
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- 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-a7b0c73d.js → index-9e5554cb.js} +7 -8
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +0 -2
- package/dist/collection/components/ez-badge/ez-badge.css +12 -1
- package/dist/collection/components/ez-badge/ez-badge.js +31 -1
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +250 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +194 -61
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +0 -3
- package/dist/collection/components/ez-grid/ez-grid.js +1 -56
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.css +64 -0
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +127 -47
- package/dist/custom-elements/index.d.ts +0 -12
- package/dist/custom-elements/index.js +218 -394
- 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 +15 -3
- 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.entry.js +186 -60
- package/dist/esm/ez-custom-form-input_2.entry.js +231 -0
- 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 +2 -60
- 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-popover-core_2.entry.js → ez-multi-selection-list_2.entry.js} +197 -116
- package/dist/esm/ez-number-input.entry.js +1 -1
- 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-baa5e267.js → index-5a720e56.js} +7 -9
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-000159dc.entry.js +1 -0
- package/dist/ezui/{p-44caad9a.entry.js → p-0378416a.entry.js} +1 -1
- package/dist/ezui/{p-65f471bc.entry.js → p-03b0ed5a.entry.js} +1 -1
- package/dist/ezui/{p-5b205c80.entry.js → p-044d46d5.entry.js} +1 -1
- package/dist/ezui/{p-a4cee65d.entry.js → p-0cfbbe82.entry.js} +1 -1
- package/dist/ezui/{p-77a4bd35.entry.js → p-11bfeca3.entry.js} +1 -1
- package/dist/ezui/{p-7e677b7b.entry.js → p-2069c78a.entry.js} +1 -1
- package/dist/ezui/{p-31b71e50.entry.js → p-23dab72f.entry.js} +1 -1
- package/dist/ezui/{p-17eabf46.entry.js → p-24b42f3d.entry.js} +1 -1
- package/dist/ezui/{p-556468d9.entry.js → p-3791d9c8.entry.js} +1 -1
- package/dist/ezui/{p-1ad6c61b.entry.js → p-3885e66e.entry.js} +1 -1
- package/dist/ezui/p-3af64edd.entry.js +1 -0
- package/dist/ezui/{p-fa6732f2.entry.js → p-44b39e81.entry.js} +1 -1
- package/dist/ezui/{p-c1527804.entry.js → p-4818b8ce.entry.js} +1 -1
- package/dist/ezui/{p-d9548bdf.entry.js → p-5010315a.entry.js} +1 -1
- package/dist/ezui/{p-ea54d056.entry.js → p-68b2e579.entry.js} +1 -1
- package/dist/ezui/{p-1f50fa05.entry.js → p-6b51c9cc.entry.js} +1 -1
- package/dist/ezui/{p-2bb2a0c4.entry.js → p-6d31c43c.entry.js} +1 -1
- package/dist/ezui/{p-6cdd3e0a.entry.js → p-6d8b3298.entry.js} +1 -1
- package/dist/ezui/p-6ec40dec.entry.js +1 -0
- package/dist/ezui/{p-5ed81457.entry.js → p-6fc26622.entry.js} +1 -1
- package/dist/ezui/{p-da1b4a38.entry.js → p-708b196e.entry.js} +1 -1
- package/dist/ezui/{p-555c9018.entry.js → p-7567ccdd.entry.js} +1 -1
- package/dist/ezui/{p-1e7a8633.entry.js → p-81461d2f.entry.js} +1 -1
- package/dist/ezui/{p-8df1ca33.entry.js → p-82fa4b09.entry.js} +1 -1
- package/dist/ezui/{p-0fa52b0f.entry.js → p-88c615f0.entry.js} +1 -1
- package/dist/ezui/{p-56fe5341.entry.js → p-9066b0b0.entry.js} +1 -1
- package/dist/ezui/{p-09de35a2.entry.js → p-91ccae0c.entry.js} +1 -1
- package/dist/ezui/{p-c0d9c4f8.entry.js → p-92748142.entry.js} +1 -1
- package/dist/ezui/{p-0faf71c5.entry.js → p-92fbaf2b.entry.js} +1 -1
- package/dist/ezui/{p-e6a9041d.entry.js → p-9e95bfeb.entry.js} +1 -1
- package/dist/ezui/{p-3195a7a7.entry.js → p-9fc250d4.entry.js} +1 -1
- package/dist/ezui/{p-53116373.entry.js → p-a3319796.entry.js} +46 -46
- package/dist/ezui/{p-990b4318.entry.js → p-a921e3e7.entry.js} +1 -1
- package/dist/ezui/{p-3429080c.entry.js → p-b22889ea.entry.js} +1 -1
- package/dist/ezui/{p-17be134a.entry.js → p-b2f6bc0a.entry.js} +1 -1
- package/dist/ezui/{p-cb1535f7.entry.js → p-b9282c79.entry.js} +1 -1
- package/dist/ezui/{p-e347df9c.entry.js → p-bef7daac.entry.js} +1 -1
- package/dist/ezui/{p-9f5fa3f9.entry.js → p-c2b20f78.entry.js} +1 -1
- package/dist/ezui/{p-17de16e5.entry.js → p-c96fbbef.entry.js} +1 -1
- package/dist/ezui/{p-2f45506d.entry.js → p-ca8936df.entry.js} +1 -1
- package/dist/ezui/p-cba34702.entry.js +1 -0
- package/dist/ezui/{p-20c024f7.entry.js → p-cf33bc48.entry.js} +1 -1
- package/dist/ezui/{p-58783dcf.entry.js → p-cf3b60fd.entry.js} +1 -1
- package/dist/ezui/{p-a80b1287.entry.js → p-dfca5946.entry.js} +1 -1
- package/dist/ezui/{p-7fdd479f.entry.js → p-e18d9e6a.entry.js} +1 -1
- package/dist/ezui/{p-fd0a19d6.entry.js → p-e3f8660b.entry.js} +1 -1
- package/dist/ezui/{p-23a36bb6.js → p-e4c7eb39.js} +2 -2
- package/dist/ezui/{p-0306dff7.entry.js → p-e6b38ade.entry.js} +1 -1
- package/dist/ezui/{p-b26f6c5b.entry.js → p-f30e0590.entry.js} +1 -1
- package/dist/ezui/{p-cf87aacb.entry.js → p-f4da7e1e.entry.js} +1 -1
- package/dist/ezui/{p-6e429cff.entry.js → p-fc194825.entry.js} +1 -1
- package/dist/ezui/p-fcc78b7f.entry.js +1 -0
- package/dist/types/components/ez-badge/ez-badge.d.ts +5 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +16 -7
- package/dist/types/components/ez-grid/ez-grid.d.ts +0 -5
- package/dist/types/components/ez-popover-plus/ez-popover-plus.d.ts +19 -6
- package/dist/types/components.d.ts +11 -218
- package/package.json +1 -1
- package/react/components.d.ts +0 -2
- package/react/components.js +0 -2
- package/react/components.js.map +1 -1
- package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +0 -387
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +0 -186
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.css +0 -205
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js +0 -426
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css +0 -67
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js +0 -468
- package/dist/esm/ez-combo-box-list_3.entry.js +0 -381
- package/dist/esm/ez-multi-selection-list.entry.js +0 -182
- package/dist/ezui/p-3a009184.entry.js +0 -1
- package/dist/ezui/p-650e4b6d.entry.js +0 -1
- package/dist/ezui/p-7bd15498.entry.js +0 -1
- package/dist/ezui/p-bc2f844e.entry.js +0 -1
- package/dist/ezui/p-dc73e1fe.entry.js +0 -1
- package/dist/ezui/p-f5931caa.entry.js +0 -1
- package/dist/types/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.d.ts +0 -104
- package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +0 -81
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementIDUtils, JSUtils, OverflowWatcher, OVERFLOWED_CLASS_NAME, StringUtils, ApplicationContext,
|
|
1
|
+
import { ElementIDUtils, JSUtils, OverflowWatcher, OVERFLOWED_CLASS_NAME, StringUtils, ApplicationContext, } 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,20 +362,6 @@ 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
|
-
}
|
|
379
365
|
resetPaginationState() {
|
|
380
366
|
var _a;
|
|
381
367
|
this._paginationChangedByKeyboard = false;
|
|
@@ -458,7 +444,6 @@ export class EzGrid {
|
|
|
458
444
|
this._gridController.configFilterColumn(this._filterColumn);
|
|
459
445
|
if (this.paginationCounterMode === 'auto')
|
|
460
446
|
this._initHeaderOverflowWatcher();
|
|
461
|
-
this.initKeyboardManager();
|
|
462
447
|
}
|
|
463
448
|
handlePaginationChange(selectFirstRecord, paginationInfo) {
|
|
464
449
|
var _a;
|
|
@@ -525,7 +510,6 @@ export class EzGrid {
|
|
|
525
510
|
var _a, _b;
|
|
526
511
|
(_a = this._headerOverflowWatcher) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
527
512
|
(_b = this._gridController) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
528
|
-
this.removeShortcuts();
|
|
529
513
|
}
|
|
530
514
|
connectedCallback() {
|
|
531
515
|
var _a;
|
|
@@ -564,45 +548,6 @@ export class EzGrid {
|
|
|
564
548
|
return "left__header-expanded";
|
|
565
549
|
return "left__header-contracted";
|
|
566
550
|
}
|
|
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
|
-
}
|
|
606
551
|
render() {
|
|
607
552
|
var _a;
|
|
608
553
|
return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: {
|
|
@@ -1,3 +1,67 @@
|
|
|
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 {
|
|
2
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);
|
|
3
67
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { computePosition, flip, shift } from "@floating-ui/dom";
|
|
2
|
+
import { h, Host } from "@stencil/core";
|
|
2
3
|
export class EzPopoverPlus {
|
|
3
4
|
constructor() {
|
|
5
|
+
this.TIME_DEBOUNCE = 500;
|
|
4
6
|
this.autoClose = true;
|
|
5
7
|
this.boxWidth = "fit-content";
|
|
6
8
|
this.opened = false;
|
|
@@ -8,80 +10,167 @@ export class EzPopoverPlus {
|
|
|
8
10
|
this.anchorElement = undefined;
|
|
9
11
|
this.options = { horizontalGap: 0, verticalGap: 0, fromRight: false };
|
|
10
12
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
async observeOpened(newValue, oldValue) {
|
|
14
|
+
if (newValue !== oldValue) {
|
|
15
|
+
if (newValue) {
|
|
16
|
+
this.openPopover();
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
this.hidePopover();
|
|
20
|
+
}
|
|
21
|
+
this.ezVisibilityChange.emit(newValue);
|
|
22
|
+
return;
|
|
17
23
|
}
|
|
18
|
-
this._popOverCore.opened = newValue;
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
21
26
|
* Atualiza a posição do popover.
|
|
22
27
|
*/
|
|
23
28
|
async updatePosition(top, left) {
|
|
24
|
-
|
|
25
|
-
await
|
|
29
|
+
this.updateOptionPosition(top, left);
|
|
30
|
+
await this.updatePositionPopover();
|
|
26
31
|
}
|
|
27
32
|
/**
|
|
28
33
|
* Exibe o ez-popover.
|
|
29
34
|
*/
|
|
30
35
|
async show(top, left) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
await this._popOverCore.show(top, left);
|
|
36
|
+
this.updateOptionPosition(top, left);
|
|
37
|
+
this.opened = true;
|
|
35
38
|
}
|
|
36
39
|
/**
|
|
37
40
|
* Ancora a exibição do popOver a um elemento HTML.
|
|
38
41
|
*/
|
|
39
42
|
async showUnder(element, options) {
|
|
40
|
-
if (
|
|
41
|
-
this.
|
|
43
|
+
if (options) {
|
|
44
|
+
this.options = options;
|
|
42
45
|
}
|
|
43
|
-
|
|
46
|
+
this.anchorElement = element;
|
|
47
|
+
this.opened = true;
|
|
44
48
|
}
|
|
45
49
|
/**
|
|
46
50
|
* Oculta o ez-popover.
|
|
47
51
|
*/
|
|
48
52
|
async hide() {
|
|
49
|
-
|
|
50
|
-
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.hide());
|
|
53
|
+
this.opened = false;
|
|
51
54
|
}
|
|
52
55
|
/**
|
|
53
56
|
* Altera as opções.
|
|
54
57
|
*/
|
|
55
58
|
async setOptions(options) {
|
|
56
|
-
|
|
57
|
-
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.setOptions(options));
|
|
59
|
+
Object.assign(this.options, options);
|
|
58
60
|
}
|
|
59
61
|
/**
|
|
60
62
|
* Altera o elemento de ancoragem.
|
|
61
63
|
*/
|
|
62
64
|
async setAnchorElement(anchor) {
|
|
63
|
-
|
|
64
|
-
|
|
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);
|
|
65
112
|
}
|
|
66
|
-
|
|
67
|
-
this.
|
|
68
|
-
|
|
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);
|
|
113
|
+
async openPopover() {
|
|
114
|
+
if (!this._box) {
|
|
115
|
+
return;
|
|
77
116
|
}
|
|
78
|
-
|
|
79
|
-
|
|
117
|
+
this._box.style.display = 'flex';
|
|
118
|
+
this._box.style.visibility = 'hidden';
|
|
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;
|
|
80
148
|
}
|
|
81
|
-
|
|
149
|
+
clearTimeout(this._timeoutDebounce);
|
|
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();
|
|
82
167
|
}
|
|
83
168
|
render() {
|
|
84
|
-
return (h(Host, null, h("
|
|
169
|
+
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: {
|
|
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))));
|
|
85
174
|
}
|
|
86
175
|
static get is() { return "ez-popover-plus"; }
|
|
87
176
|
static get encapsulation() { return "shadow"; }
|
|
@@ -373,13 +462,4 @@ export class EzPopoverPlus {
|
|
|
373
462
|
"methodName": "observeOpened"
|
|
374
463
|
}];
|
|
375
464
|
}
|
|
376
|
-
static get listeners() {
|
|
377
|
-
return [{
|
|
378
|
-
"name": "ezVisibilityChange",
|
|
379
|
-
"method": "listenerEzVisibilityChange",
|
|
380
|
-
"target": undefined,
|
|
381
|
-
"capture": false,
|
|
382
|
-
"passive": false
|
|
383
|
-
}];
|
|
384
|
-
}
|
|
385
465
|
}
|
|
@@ -86,12 +86,6 @@ 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
|
-
|
|
95
89
|
interface EzCustomFormInput extends Components.EzCustomFormInput, HTMLElement {}
|
|
96
90
|
export const EzCustomFormInput: {
|
|
97
91
|
prototype: EzCustomFormInput;
|
|
@@ -212,12 +206,6 @@ export const EzPopover: {
|
|
|
212
206
|
new (): EzPopover;
|
|
213
207
|
};
|
|
214
208
|
|
|
215
|
-
interface EzPopoverCore extends Components.EzPopoverCore, HTMLElement {}
|
|
216
|
-
export const EzPopoverCore: {
|
|
217
|
-
prototype: EzPopoverCore;
|
|
218
|
-
new (): EzPopoverCore;
|
|
219
|
-
};
|
|
220
|
-
|
|
221
209
|
interface EzPopoverPlus extends Components.EzPopoverPlus, HTMLElement {}
|
|
222
210
|
export const EzPopoverPlus: {
|
|
223
211
|
prototype: EzPopoverPlus;
|