@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-50898.0 → 0.0.0-bugfix-dev-KB-52057.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.
- package/dist/cjs/ez-alert-list.cjs.entry.js +14 -3
- package/dist/cjs/ez-grid.cjs.entry.js +21 -16
- package/dist/cjs/ez-modal-container.cjs.entry.js +16 -6
- package/dist/cjs/ez-modal.cjs.entry.js +7 -8
- package/dist/cjs/ez-popup.cjs.entry.js +17 -11
- package/dist/cjs/ez-scroller_3.cjs.entry.js +18 -4
- package/dist/cjs/ez-search.cjs.entry.js +15 -5
- package/dist/cjs/ez-split-button.cjs.entry.js +25 -6
- package/dist/cjs/ez-split-item.cjs.entry.js +2 -2
- package/dist/cjs/ez-split-panel.cjs.entry.js +13 -5
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-alert-list/ez-alert-list.js +19 -3
- package/dist/collection/components/ez-grid/ez-grid.js +21 -16
- package/dist/collection/components/ez-modal/ez-modal.js +22 -9
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +19 -9
- package/dist/collection/components/ez-popup/ez-popup.js +18 -21
- package/dist/collection/components/ez-search/ez-search.js +15 -5
- package/dist/collection/components/ez-split-button/ez-split-button.js +25 -6
- package/dist/collection/components/ez-split-panel/ez-split-panel.js +13 -5
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +0 -7
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +1 -1
- package/dist/collection/components/ez-tree/ez-tree.css +26 -0
- package/dist/collection/components/ez-tree/interfaces/ITreeItemBadge.js +1 -0
- package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +15 -2
- package/dist/custom-elements/index.js +151 -70
- package/dist/esm/ez-alert-list.entry.js +14 -3
- package/dist/esm/ez-grid.entry.js +21 -16
- package/dist/esm/ez-modal-container.entry.js +17 -7
- package/dist/esm/ez-modal.entry.js +9 -10
- package/dist/esm/ez-popup.entry.js +19 -13
- package/dist/esm/ez-scroller_3.entry.js +18 -4
- package/dist/esm/ez-search.entry.js +15 -5
- package/dist/esm/ez-split-button.entry.js +25 -6
- package/dist/esm/ez-split-item.entry.js +2 -2
- package/dist/esm/ez-split-panel.entry.js +13 -5
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-031784b0.entry.js → p-384247cd.entry.js} +1 -1
- package/dist/ezui/p-3faa2b46.entry.js +1 -0
- package/dist/ezui/p-44c5b6a5.entry.js +1 -0
- package/dist/ezui/p-5ef056ce.entry.js +1 -0
- package/dist/ezui/{p-7a636dfc.entry.js → p-86ff298d.entry.js} +1 -1
- package/dist/ezui/p-91f626d3.entry.js +1 -0
- package/dist/ezui/p-9aefaa52.entry.js +1 -0
- package/dist/ezui/{p-65b3c23b.entry.js → p-af2ecb1b.entry.js} +1 -1
- package/dist/ezui/{p-8c82374d.entry.js → p-d9401ea0.entry.js} +1 -1
- package/dist/ezui/p-f3c526cc.entry.js +1 -0
- package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +5 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +1 -0
- package/dist/types/components/ez-guide-navigator/interfaces/IGuideItem.d.ts +0 -1
- package/dist/types/components/ez-modal/ez-modal.d.ts +9 -1
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +4 -1
- package/dist/types/components/ez-popup/ez-popup.d.ts +4 -3
- package/dist/types/components/ez-search/ez-search.d.ts +1 -0
- package/dist/types/components/ez-split-button/ez-split-button.d.ts +3 -0
- package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +1 -0
- package/dist/types/components/ez-tree/interfaces/ITreeItem.d.ts +3 -1
- package/dist/types/components/ez-tree/interfaces/ITreeItemBadge.d.ts +6 -0
- package/dist/types/components/ez-tree/subcomponents/TreeItem.d.ts +0 -1
- package/dist/types/components.d.ts +4 -0
- package/package.json +1 -1
- package/dist/ezui/p-2eb8f73b.entry.js +0 -1
- package/dist/ezui/p-58fae29b.entry.js +0 -1
- package/dist/ezui/p-5e1d036e.entry.js +0 -1
- package/dist/ezui/p-8e7031a0.entry.js +0 -1
- package/dist/ezui/p-a08b309b.entry.js +0 -1
- package/dist/ezui/p-b9fbf4e7.entry.js +0 -1
|
@@ -6,6 +6,7 @@ const ezAlertListCss = ":host {\n display: flex;\n\n /* Alert List */\n \n /
|
|
|
6
6
|
const EzAlertList = class {
|
|
7
7
|
constructor(hostRef) {
|
|
8
8
|
registerInstance(this, hostRef);
|
|
9
|
+
this._container = undefined;
|
|
9
10
|
this.alerts = [];
|
|
10
11
|
this.enableDragAndDrop = undefined;
|
|
11
12
|
this.enableExpand = true;
|
|
@@ -14,7 +15,9 @@ const EzAlertList = class {
|
|
|
14
15
|
this.expanded = false;
|
|
15
16
|
}
|
|
16
17
|
observeOpened() {
|
|
17
|
-
this.
|
|
18
|
+
if (this.opened) {
|
|
19
|
+
this.manageOverlay();
|
|
20
|
+
}
|
|
18
21
|
}
|
|
19
22
|
/**
|
|
20
23
|
* Retorna o id do alerta a partir do título e do índice.
|
|
@@ -30,6 +33,14 @@ const EzAlertList = class {
|
|
|
30
33
|
var _a;
|
|
31
34
|
return (_a = this.alerts.find((alert, index) => this.alertId(alert.title, index) === id)) === null || _a === void 0 ? void 0 : _a.title;
|
|
32
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Retorna o link para o titulo do alerta a partir do id.
|
|
38
|
+
*/
|
|
39
|
+
getLinkTitle(item) {
|
|
40
|
+
var _a;
|
|
41
|
+
const link = (_a = this.alerts.find((alert, index) => this.alertId(alert.title, index) === item.id)) === null || _a === void 0 ? void 0 : _a.link;
|
|
42
|
+
return link !== null && link !== void 0 ? link : "#";
|
|
43
|
+
}
|
|
33
44
|
/**
|
|
34
45
|
* Retorna o texto do título do alerta.
|
|
35
46
|
*/
|
|
@@ -120,7 +131,7 @@ const EzAlertList = class {
|
|
|
120
131
|
(h("div", { ref: elem => (this._overlayRef = elem) }, h("div", { class: `alert-list__container ${this.expanded ? 'expanded' : ''}`, ref: elem => (this._container = elem) }, h("div", { class: "alert-list__content" }, h("div", { class: "alert-list__header" }, h("div", { class: "alert-list__title" }, `Avisos (${this.alerts.length})`), h("div", { class: "alert-list__header__buttons" }, this.enableExpand && (h("ez-button", { mode: "icon", size: "small", iconName: "expand", onClick: () => this.toggleExpandContainer(), "data-element-id": ElementIDUtils.getInternalIDInfo('expandButton'), title: this.expanded ? 'Resumir' : 'Expandir' })), h("ez-button", { mode: "icon", size: "small", iconName: "close", "data-element-id": ElementIDUtils.getInternalIDInfo('closeButton'), onClick: () => {
|
|
121
132
|
this.opened = false;
|
|
122
133
|
}, title: 'Fechar' }))), h("div", { class: "alert-list__expandable-content" }, h("ez-list", { itemSlotBuilder: this.itemRightSlotBuilder, hoverFeedback: true, itemLeftSlotBuilder: item => {
|
|
123
|
-
return (h("a", { href:
|
|
134
|
+
return (h("a", { href: this.getLinkTitle(item), style: {
|
|
124
135
|
fontFamily: "var(--font-pattern, 'Roboto')",
|
|
125
136
|
fontSize: 'var(--text--medium, 14px)',
|
|
126
137
|
fontWeight: 'var(--text-weight--medium, 400)',
|
|
@@ -141,7 +152,7 @@ const EzAlertList = class {
|
|
|
141
152
|
}
|
|
142
153
|
get _element() { return getElement(this); }
|
|
143
154
|
static get watchers() { return {
|
|
144
|
-
"
|
|
155
|
+
"_container": ["observeOpened"]
|
|
145
156
|
}; }
|
|
146
157
|
};
|
|
147
158
|
EzAlertList.style = ezAlertListCss;
|
|
@@ -120763,10 +120763,7 @@ const EzGrid = class {
|
|
|
120763
120763
|
return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
|
|
120764
120764
|
}
|
|
120765
120765
|
observeConfig(config) {
|
|
120766
|
-
|
|
120767
|
-
return;
|
|
120768
|
-
}
|
|
120769
|
-
this._gridController.setColumnsState(config.columns);
|
|
120766
|
+
this._gridController.setColumnsState(config === null || config === void 0 ? void 0 : config.columns);
|
|
120770
120767
|
}
|
|
120771
120768
|
updatePaginationTooltip() {
|
|
120772
120769
|
if (!this._refPaginationLabelTooltip)
|
|
@@ -120824,21 +120821,29 @@ const EzGrid = class {
|
|
|
120824
120821
|
return newConfig;
|
|
120825
120822
|
}
|
|
120826
120823
|
positionSelectionCounter() {
|
|
120827
|
-
var _a;
|
|
120828
|
-
if (this._gridSelectionCounter
|
|
120824
|
+
var _a, _b;
|
|
120825
|
+
if (!this._gridSelectionCounter)
|
|
120829
120826
|
return;
|
|
120830
|
-
|
|
120831
|
-
if (this._showSelectionCounter) {
|
|
120832
|
-
const boundingContainer = (_a = this._container) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
120833
|
-
if (boundingContainer == undefined) {
|
|
120834
|
-
return;
|
|
120835
|
-
}
|
|
120836
|
-
const limitBottom = boundingContainer.bottom - 30;
|
|
120837
|
-
this._gridSelectionCounter.style.bottom = document.body.clientHeight - limitBottom + 'px';
|
|
120838
|
-
}
|
|
120839
|
-
else {
|
|
120827
|
+
if (!this._showSelectionCounter) {
|
|
120840
120828
|
this._gridSelectionCounter.style.bottom = '';
|
|
120829
|
+
return;
|
|
120841
120830
|
}
|
|
120831
|
+
const containerRect = (_a = this._container) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
120832
|
+
const selectionRect = (_b = this._gridSelectionCounter) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
|
|
120833
|
+
if (!containerRect || !selectionRect)
|
|
120834
|
+
return;
|
|
120835
|
+
const positionBottom = containerRect.bottom - 30;
|
|
120836
|
+
this._gridSelectionCounter.style.bottom = document.body.clientHeight - positionBottom + 'px';
|
|
120837
|
+
this._gridSelectionCounter.style.left = this.calculatePositionLeft(containerRect, selectionRect);
|
|
120838
|
+
}
|
|
120839
|
+
calculatePositionLeft(containerRect, selectionRect) {
|
|
120840
|
+
let selectionStart = containerRect.left + (containerRect.width / 2);
|
|
120841
|
+
const containerRightEdge = containerRect.left + this._container.clientWidth;
|
|
120842
|
+
const selectionEnd = (selectionStart - (selectionRect.width / 2)) + selectionRect.width;
|
|
120843
|
+
if (selectionEnd > containerRightEdge) {
|
|
120844
|
+
selectionStart = containerRightEdge - (selectionRect.width / 2);
|
|
120845
|
+
}
|
|
120846
|
+
return `${selectionStart}px`;
|
|
120842
120847
|
}
|
|
120843
120848
|
setEvents() {
|
|
120844
120849
|
window.removeEventListener('scroll', this.positionSelectionCounter.bind(this));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-baa5e267.js';
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
|
|
2
|
+
import { KeyboardManager } from '@sankhyalabs/core';
|
|
2
3
|
|
|
3
4
|
var ModalAction;
|
|
4
5
|
(function (ModalAction) {
|
|
@@ -31,11 +32,11 @@ const EzModalContainer = class {
|
|
|
31
32
|
this.cancelButtonStatus = undefined;
|
|
32
33
|
this.okButtonStatus = undefined;
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
async handleEzModalAction(event) {
|
|
36
|
+
var _a;
|
|
37
|
+
if ((event === null || event === void 0 ? void 0 : event.target) && (event === null || event === void 0 ? void 0 : event.target) === ((_a = this._element) === null || _a === void 0 ? void 0 : _a.parentElement)) {
|
|
38
|
+
this.closeModal();
|
|
39
|
+
}
|
|
39
40
|
}
|
|
40
41
|
cancelIsVisible() {
|
|
41
42
|
return (this.cancelButtonStatus !== ModalButtonStatus$1.HIDDEN && this.cancelButtonLabel != undefined);
|
|
@@ -46,7 +47,15 @@ const EzModalContainer = class {
|
|
|
46
47
|
componentDidLoad() {
|
|
47
48
|
window.requestAnimationFrame(() => {
|
|
48
49
|
this.ezModalAction.emit(ModalAction$1.LOAD);
|
|
50
|
+
this._modalRef.focus();
|
|
49
51
|
});
|
|
52
|
+
new KeyboardManager({ propagate: false, element: this._element })
|
|
53
|
+
.bind("Enter", this.ezModalAction.emit.bind(ModalAction$1.OK))
|
|
54
|
+
.bind("Escape", () => this.closeModal())
|
|
55
|
+
.bind("Esc", () => this.closeModal());
|
|
56
|
+
}
|
|
57
|
+
closeModal() {
|
|
58
|
+
this.ezModalAction.emit("CLOSE");
|
|
50
59
|
}
|
|
51
60
|
focusLast() {
|
|
52
61
|
if (this._okButton == undefined) {
|
|
@@ -58,8 +67,9 @@ const EzModalContainer = class {
|
|
|
58
67
|
this._closeButton.focus();
|
|
59
68
|
}
|
|
60
69
|
render() {
|
|
61
|
-
return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div",
|
|
70
|
+
return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1 }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--large" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" }))))), h("div", { class: "ez-modal-container__content" }, h("slot", null)), h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
62
71
|
}
|
|
72
|
+
get _element() { return getElement(this); }
|
|
63
73
|
};
|
|
64
74
|
EzModalContainer.style = ezModalContainerCss;
|
|
65
75
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-baa5e267.js';
|
|
2
|
-
import { FloatingManager } from '@sankhyalabs/core';
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
|
|
2
|
+
import { FloatingManager, KeyboardManager } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
4
|
const ezModalCss = ":host{--ez-modal-z-index:var(--elevation--12, 12);--ez-modal-vertical-padding:var(--space--large, 24px);--ez-modal-content-padding:24px;display:block}.modal{position:fixed;display:flex;top:0px;z-index:var(--ez-modal-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh}.modal__screen-light{background:rgba(0, 4, 12, 0.1)}.modal__screen-medium{backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.modal__vertical-padding{padding:var(--ez-modal-vertical-padding) 0}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;height:100%;box-sizing:border-box;width:100%;align-items:flex-start}.modal__container--right{animation:expand-modal--right .2s ease-in-out 1;justify-content:flex-end}.modal__container--left{animation:expand-modal--left .2s ease-in-out 1;justify-content:flex-start}.modal__content{display:flex;flex-wrap:wrap;box-sizing:border-box;max-height:100%;height:100%;overflow-y:auto;background-color:rgb(255, 255, 255);padding:var(--ez-modal-content-padding);box-shadow:rgb(0 38 111 / 12%) 0px 0px 16px 0px}.modal__content--right{border-radius:12px 0px 0px 12px}.modal__content--left{border-radius:0px 12px 12px 0px}.modal__box__container{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;border-radius:12px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
|
|
5
5
|
|
|
@@ -8,11 +8,7 @@ const EzModal = class {
|
|
|
8
8
|
registerInstance(this, hostRef);
|
|
9
9
|
this.ezCloseModal = createEvent(this, "ezCloseModal", 7);
|
|
10
10
|
this.ezOpenModal = createEvent(this, "ezOpenModal", 7);
|
|
11
|
-
this.
|
|
12
|
-
if ((ev === null || ev === void 0 ? void 0 : ev.key) === "Escape" && this.closeEsc) {
|
|
13
|
-
this.closeModal();
|
|
14
|
-
}
|
|
15
|
-
};
|
|
11
|
+
this.ezModalAction = createEvent(this, "ezModalAction", 7);
|
|
16
12
|
this.modalSize = undefined;
|
|
17
13
|
this.align = undefined;
|
|
18
14
|
this.heightMode = "regular";
|
|
@@ -24,11 +20,9 @@ const EzModal = class {
|
|
|
24
20
|
observeOpened() {
|
|
25
21
|
if (this.opened) {
|
|
26
22
|
this._overlayId = FloatingManager.subscribeOverlayControl(this._modalRef);
|
|
27
|
-
document.addEventListener("keydown", this.handleKeyboardEvent);
|
|
28
23
|
}
|
|
29
24
|
else {
|
|
30
25
|
FloatingManager.unsubscribeOverlayControl(this._modalRef || this._overlayId);
|
|
31
|
-
document.removeEventListener("keydown", this.handleKeyboardEvent);
|
|
32
26
|
}
|
|
33
27
|
}
|
|
34
28
|
closeModal() {
|
|
@@ -37,6 +31,10 @@ const EzModal = class {
|
|
|
37
31
|
}
|
|
38
32
|
componentDidLoad() {
|
|
39
33
|
this.observeOpened();
|
|
34
|
+
new KeyboardManager({ propagate: false, element: this._element })
|
|
35
|
+
.bind("Enter", this.ezModalAction.emit.bind("OK"))
|
|
36
|
+
.bind("Escape", () => this.closeModal())
|
|
37
|
+
.bind("Esc", () => this.closeModal());
|
|
40
38
|
}
|
|
41
39
|
componentDidRender() {
|
|
42
40
|
if (this.opened) {
|
|
@@ -55,10 +53,11 @@ const EzModal = class {
|
|
|
55
53
|
const scrimType = `modal__screen-${this.scrim}`;
|
|
56
54
|
return (h(Host, null, this.opened
|
|
57
55
|
?
|
|
58
|
-
h("div", { ref: ref => this._modalRef = ref, class: `modal ${scrimType} ${regularVerticalPaddingClass}`, onMouseDown: evt => this.onMouseDownHandler(evt) }, h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, h("div", { class: `modal__content ${modalContentHeightMode} ${this.modalSize}` }, h("slot", null))))
|
|
56
|
+
h("div", { ref: ref => this._modalRef = ref, class: `modal ${scrimType} ${regularVerticalPaddingClass}`, onMouseDown: evt => this.onMouseDownHandler(evt), tabIndex: -1 }, h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, h("div", { class: `modal__content ${modalContentHeightMode} ${this.modalSize}` }, h("slot", null))))
|
|
59
57
|
:
|
|
60
58
|
undefined));
|
|
61
59
|
}
|
|
60
|
+
get _element() { return getElement(this); }
|
|
62
61
|
static get watchers() { return {
|
|
63
62
|
"opened": ["observeOpened"]
|
|
64
63
|
}; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-baa5e267.js';
|
|
2
|
-
import { FloatingManager } from '@sankhyalabs/core';
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-baa5e267.js';
|
|
2
|
+
import { KeyboardManager, FloatingManager } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
4
|
const ezPopupCss = ":host{display:flex;--ez-popup-z-index:var(--elevation--24, 24);--ez-popup__container--color:var(--title--primary, #2b3a54);--ez-popup__container--padding:var(--space--large, 24px);--ez-popup__header--padding-bottom:var(--space--medium, 12px);--ez-popup__title--font-family:var(--font-pattern, \"Roboto\");--ez-popup__title--font-size:var(--title--extra-large, 24px);--ez-popup__title--color:var(--title--primary, #2b3a54);--ez-popup__title--font-weight:var(--text-weight--large, 600);--ez-popup__btn__close--icon-color:var(--title--primary, #2b3a54);--ez-popup__btn__close--icon:url('data:image/svg+xml;utf8,<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 8.2421753,6.9944578 13.743748,1.4930784 C 13.907781,1.3290628 14,1.1065946 14,0.87462511 14,0.64266712 13.907782,0.42019873 13.743748,0.25617155 13.579712,0.09215597 13.35727,6.48e-8 13.125266,6.48e-8 12.89338,6.48e-8 12.670821,0.09215634 12.506787,0.25617155 L 7.005215,5.7575508 1.5035972,0.25617155 C 1.3395631,0.09215597 1.1170968,6.48e-8 0.88511716,6.48e-8 0.65314917,6.48e-8 0.4306712,0.09215597 0.26663695,0.25617155 0.10260271,0.42019873 0.01045441,0.64266712 0.01045441,0.87462511 c 0,0.23196949 0.0921483,0.45443769 0.25618254,0.61845329 L 5.7682546,6.9944578 0.26663695,12.497027 c -0.0834745,0.08067 -0.15003245,0.1772 -0.19581514,0.283871 C 0.02505077,12.887561 9.831648e-4,13.002399 2.950369e-5,13.118395 -9.2415746e-4,13.234504 0.02125019,13.349689 0.06527245,13.457057 c 0.04401053,0.107479 0.10898307,0.205064 0.1911168,0.287137 0.0821454,0.08208 0.17979645,0.146888 0.28727561,0.190839 0.10747906,0.04395 0.22262954,0.06598 0.33872417,0.06493 0.116095,-10e-4 0.23082547,-0.0253 0.33747687,-0.07112 0.1066637,-0.04593 0.2031133,-0.112615 0.2837313,-0.196086 L 7.005215,8.2313646 12.506787,13.732768 c 0.164034,0.164027 0.386593,0.256125 0.618479,0.256125 0.232004,0 0.454446,-0.09209 0.618482,-0.256125 C 13.907781,13.568741 14,13.346308 14,13.114315 14,12.882323 13.90779,12.659888 13.743748,12.495861 Z\"/></svg>')}.overlay{position:fixed;display:flex;top:0px;z-index:var(--ez-popup-z-index, 24);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup{display:flex;height:100%;align-items:center;justify-content:center;box-sizing:border-box}.popup__container{width:100%;max-height:90%;height:100%;display:flex;flex-wrap:wrap;overflow:hidden;outline:none;background:#FFFF;color:var(--ez-popup__container--color);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--ez-popup__container--padding)}.popup__container--auto{height:auto}.popup__content{box-sizing:border-box;height:100%;width:100%}.popup__expandable-content{box-sizing:border-box;width:100%;height:calc(100% - 44px)}.popup__header{width:100%;display:flex}.popup__header--padding{padding-bottom:var(--ez-popup__header--padding-bottom)}.popup__title{display:flex;margin:0;width:100%;font-family:var(--ez-popup__title--font-family);font-size:var(--ez-popup__title--font-size);font-weight:var(--ez-popup__title--font-weight);color:var(--ez-popup__title--color);line-height:1.3}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:var(--ez-popup__btn__close--icon-color);width:14px;height:14px;-webkit-mask-image:var(--ez-popup__btn__close--icon);mask-image:var(--ez-popup__btn__close--icon)}.btn-close--solo{width:100%}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}.ez-popup__size-limit--x-small{min-width:350px;max-width:560px}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
|
|
5
5
|
|
|
@@ -25,11 +25,19 @@ const EzPopup = class {
|
|
|
25
25
|
observeConfig() {
|
|
26
26
|
this.manageOverflow();
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
this.
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
componentDidLoad() {
|
|
29
|
+
if (this.opened && this._popupRef) {
|
|
30
|
+
this._popupRef.focus();
|
|
31
|
+
}
|
|
32
|
+
new KeyboardManager({ propagate: false, element: this._element })
|
|
33
|
+
.bind("Enter", this.ezPopupAction.emit.bind("OK"))
|
|
34
|
+
.bind("Escape", () => this.closePopup())
|
|
35
|
+
.bind("Esc", () => this.closePopup());
|
|
36
|
+
}
|
|
37
|
+
closePopup() {
|
|
38
|
+
this.opened = false;
|
|
39
|
+
this.manageOverflow();
|
|
40
|
+
this.ezClosePopup.emit();
|
|
33
41
|
}
|
|
34
42
|
manageOverflow() {
|
|
35
43
|
if (this.opened) {
|
|
@@ -41,25 +49,23 @@ const EzPopup = class {
|
|
|
41
49
|
}
|
|
42
50
|
manageOverlay() {
|
|
43
51
|
if (this.opened) {
|
|
44
|
-
this._overlayId = FloatingManager.subscribeOverlayControl(this.
|
|
52
|
+
this._overlayId = FloatingManager.subscribeOverlayControl(this._popupRef);
|
|
45
53
|
}
|
|
46
54
|
else {
|
|
47
|
-
FloatingManager.unsubscribeOverlayControl(this.
|
|
55
|
+
FloatingManager.unsubscribeOverlayControl(this._popupRef || this._overlayId);
|
|
48
56
|
}
|
|
49
57
|
}
|
|
50
58
|
getGridSize() {
|
|
51
59
|
return this._sizeClasses[this.size] || this._sizeClasses["medium"];
|
|
52
60
|
}
|
|
53
61
|
componentDidRender() {
|
|
54
|
-
if (this._container) {
|
|
55
|
-
this._container.focus();
|
|
56
|
-
}
|
|
57
62
|
this.manageOverlay();
|
|
58
63
|
}
|
|
59
64
|
render() {
|
|
60
|
-
return (h(Host, null, this.opened ? (h("div", { class: "overlay", ref: ref => this.
|
|
65
|
+
return (h(Host, null, this.opened ? (h("div", { class: "overlay", ref: ref => this._popupRef = ref, tabIndex: -1 }, h("div", { class: "popup col " + this.getGridSize() }, h("div", { class: "popup__container " + (this.heightMode === "auto" ? "popup__container--auto" : "") }, h("div", { class: "popup__content" }, h("div", { class: "popup__header " + (this.useHeader ? "popup__header--padding" : "") }, this.useHeader &&
|
|
61
66
|
h(Fragment, null, !!this.ezTitle && h("div", { class: "popup__title" }, this.ezTitle), h("button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", onClick: () => { this.opened = false; this.ezClosePopup.emit(); } }))), h("div", { class: "popup__expandable-content" }, h("slot", null))))))) : undefined));
|
|
62
67
|
}
|
|
68
|
+
get _element() { return getElement(this); }
|
|
63
69
|
static get watchers() { return {
|
|
64
70
|
"opened": ["observeConfig"]
|
|
65
71
|
}; }
|
|
@@ -242,7 +242,7 @@ const TreeItem = (props) => {
|
|
|
242
242
|
itemsList.push(treeItem);
|
|
243
243
|
}
|
|
244
244
|
return (h("ul", { class: level === 1 ? "first-level" : undefined },
|
|
245
|
-
h("li", Object.assign({ title: tooltipResolver(treeItem, !disabled, level), class: `tree-item ${treeItem.id !== selectedId ?
|
|
245
|
+
h("li", Object.assign({ title: tooltipResolver(treeItem, !disabled, level), class: `tree-item ${treeItem.id !== selectedId ? "tree-item-error" : ""}`, onClick: () => available && itemClick(treeItem) }, {
|
|
246
246
|
disabled,
|
|
247
247
|
selected: treeItem.id === selectedId,
|
|
248
248
|
[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezTreeItem_${treeItem.id}`)
|
|
@@ -250,11 +250,25 @@ const TreeItem = (props) => {
|
|
|
250
250
|
h("div", { class: "item-label-container" },
|
|
251
251
|
h("div", { class: "item-icon-box" }, expandable &&
|
|
252
252
|
h("ez-icon", { id: treeItem.id, class: "item-icon", size: "small", iconName: iconResolver(treeItem, expanded, level), onClick: () => available && iconClick(treeItem) })),
|
|
253
|
-
h("label", { class: "item-label" }, treeItem.label)),
|
|
254
|
-
|
|
253
|
+
h("label", { class: `item-label ${treeItem.bold ? "item-label--bold" : ""}` }, treeItem.label)),
|
|
254
|
+
getBadgeElement(treeItem.id, treeItem.badge, treeItem.id === selectedId)),
|
|
255
255
|
expanded
|
|
256
256
|
&& node.getChildren().map(child => h(TreeItem, { selectedId: selectedId, node: child, itemClick: itemClick, iconClick: iconClick, level: level + 1, iconResolver: iconResolver, tooltipResolver: tooltipResolver, itemsList: itemsList }))));
|
|
257
257
|
};
|
|
258
|
+
function getBadgeElement(itemId, badge, isSelectedItem) {
|
|
259
|
+
if (badge == undefined) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
if (typeof badge === "string") {
|
|
263
|
+
return h("div", { class: `tree-item-badge ${isSelectedItem ? null : badge}` }, badge === "error" &&
|
|
264
|
+
h("ez-icon", { id: `${itemId}-badge-error`, class: "tree-item-badge-error-icon", size: "x-small", style: { color: 'white' }, iconName: "alert-circle" }));
|
|
265
|
+
}
|
|
266
|
+
if (badge.type === "text") {
|
|
267
|
+
return h("div", { id: `${itemId}-badge-text`, class: "tree-item-badge-text" }, badge.text);
|
|
268
|
+
}
|
|
269
|
+
return h("div", null,
|
|
270
|
+
h("ez-icon", { id: `${itemId}-badge-icon`, class: "tree-item-badge-icon", style: { "--ez-icon--color": `var(--ez-tree__badge--icon-color--${badge.iconColor || "default"})` }, iconName: badge.iconName }));
|
|
271
|
+
}
|
|
258
272
|
|
|
259
273
|
class Node {
|
|
260
274
|
constructor(tree, item, parent, isPlaceHolder = false) {
|
|
@@ -498,7 +512,7 @@ class Tree extends Node {
|
|
|
498
512
|
}
|
|
499
513
|
}
|
|
500
514
|
|
|
501
|
-
const ezTreeCss = ":host{--ez-tree--border-radius:var(--border--radius-small, 8px);--ez-tree--padding-inline-start:20px;--ez-tree--margin:var(--space--extra-small, 3px);--ez-tree--margin-right:calc(var(--space--small, 6px) + 2px);--ez-tree--font-family:var(--font-pattern, Arial);--ez-tree--font-size:var(--text--medium, 14px);--ez-tree--selected--font-weight:var(--text-weight--large, 600);--ez-tree--font-weight:var(--text-weight--small, 400);--ez-tree--color:var(--title--primary, #2B3A54);--ez-tree--selected--color:var(--color--primary, #008561);--ez-tree--disabled--color:var(--text--disable, #AFB6C0);--ez-tree__tree-item--height:var(--size-medium, 18px);--ez-tree__tree-item--padding:var(--space--small, 6px);--ez-tree__tree-item--background-color:var(--background--xlight, #FFFFFF);--ez-tree__tree-item--selected--background-color:var(--color--primary-300, #E2F4EF);--ez-tree__tree-item--hover--background-color:var(--background--medium, #F0F3F7);--ez-tree__tree-item--disabled--background-color:var(--ez-tree__tree-Item--background-color);--ez-tree__item-icon-box--height:var(--ez-tree__tree-item--height);--ez-tree__item-icon-box--width:var(--size-medium, 18px);--ez-tree__item-icon-box--padding:var(--ez-tree__tree-item--padding);display:flex;flex-direction:column;margin:0 var(--ez-tree--margin) var(--ez-tree--margin) var(--ez-tree--margin);outline:none}ul{list-style-type:none;margin:0;padding-inline-start:var(--ez-tree--padding-inline-start)}ul.first-level{padding-inline-start:0}.tree-item-badge{width:16px;height:16px;background:transparent;border-radius:50%;transition:all 300ms ease-in-out;display:flex;align-items:center;justify-content:center}.tree-item-badge-error-icon{--ez-icon--color:white}.tree-item-badge.error{background:var(--color--error)}.tree-item-badge.warning{background:var(--color--warning)}.tree-item-badge.success{background:var(--color--success)}.item-label-container{display:flex;align-items:center}.tree-item{display:flex;align-items:center;margin-top:var(--ez-tree--margin);margin-right:var(--ez-tree--margin-right);border-radius:var(--ez-tree--border-radius);height:var(--ez-tree__tree-item--height);padding:var(--ez-tree__tree-item--padding);justify-content:space-between}.tree-item[selected]{background-color:var(--ez-tree__tree-item--selected--background-color)}.tree-item:hover{background-color:var(--ez-tree__tree-item--hover--background-color)}.tree-item[disabled],.tree-item[disabled]:hover{background-color:var(--ez-tree__tree-item--disabled--background-color)}.item-icon-box{display:flex;align-items:center;justify-content:center;width:var(--ez-tree__item-icon-box--width);height:var(--ez-tree__item-icon-box--height);padding:var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) 0}.item-icon{--ez-icon--color:var(--ez-tree--color)}.item-icon:hover{cursor:pointer}.tree-item[selected] .item-icon{--ez-icon--color:var(--ez-tree--selected--color)}.tree-item[disabled] .item-icon{cursor:unset;--ez-icon--color:var(--ez-tree--disabled--color)}.item-label{cursor:inherit;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.tree-item[selected] .item-label{color:var(--ez-tree--selected--color);font-weight:var(--ez-tree--selected--font-weight)}.tree-item[disabled] .item-label{color:var(--ez-tree--disabled--color)}";
|
|
515
|
+
const ezTreeCss = ":host{--ez-tree--border-radius:var(--border--radius-small, 8px);--ez-tree--padding-inline-start:20px;--ez-tree--margin:var(--space--extra-small, 3px);--ez-tree--margin-right:calc(var(--space--small, 6px) + 2px);--ez-tree--font-family:var(--font-pattern, Arial);--ez-tree--font-size:var(--text--medium, 14px);--ez-tree--selected--font-weight:var(--text-weight--large, 600);--ez-tree--font-weight:var(--text-weight--small, 400);--ez-tree--color:var(--title--primary, #2B3A54);--ez-tree--selected--color:var(--color--primary, #008561);--ez-tree--disabled--color:var(--text--disable, #AFB6C0);--ez-tree--font-weight--bold:var(--text-weight--large, 600);--ez-tree__tree-item--height:var(--size-medium, 18px);--ez-tree__tree-item--padding:var(--space--small, 6px);--ez-tree__tree-item--background-color:var(--background--xlight, #FFFFFF);--ez-tree__tree-item--selected--background-color:var(--color--primary-300, #E2F4EF);--ez-tree__tree-item--hover--background-color:var(--background--medium, #F0F3F7);--ez-tree__tree-item--disabled--background-color:var(--ez-tree__tree-Item--background-color);--ez-tree__item-icon-box--height:var(--ez-tree__tree-item--height);--ez-tree__item-icon-box--width:var(--size-medium, 18px);--ez-tree__item-icon-box--padding:var(--ez-tree__tree-item--padding);--ez-tree__badge--icon-color--default:var(--title--primary, #2B3A54);--ez-tree__badge--icon-color--error:var(--color--error, #da4453);--ez-tree__badge--icon-color--success:var(--color-alert--success-800, #157a00);--ez-tree__badge--icon-color--warning:var(--color--warning, #f2d410);--ez-tree__badge--icon-color--disabled:var(--text--disable, #AFB6C0);display:flex;flex-direction:column;margin:0 var(--ez-tree--margin) var(--ez-tree--margin) var(--ez-tree--margin);outline:none}ul{list-style-type:none;margin:0;padding-inline-start:var(--ez-tree--padding-inline-start)}ul.first-level{padding-inline-start:0}.tree-item-badge{width:16px;height:16px;background:transparent;border-radius:50%;transition:all 300ms ease-in-out;display:flex;align-items:center;justify-content:center}.tree-item-badge-error-icon{--ez-icon--color:white}.tree-item-badge-text{font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.tree-item-badge.error{background:var(--color--error)}.tree-item-badge.warning{background:var(--color--warning)}.tree-item-badge.success{background:var(--color--success)}.item-label-container{display:flex;align-items:center}.tree-item{display:flex;align-items:center;margin-top:var(--ez-tree--margin);margin-right:var(--ez-tree--margin-right);border-radius:var(--ez-tree--border-radius);height:var(--ez-tree__tree-item--height);padding:var(--ez-tree__tree-item--padding);justify-content:space-between}.tree-item[selected]{background-color:var(--ez-tree__tree-item--selected--background-color)}.tree-item:hover{background-color:var(--ez-tree__tree-item--hover--background-color)}.tree-item[disabled],.tree-item[disabled]:hover{background-color:var(--ez-tree__tree-item--disabled--background-color)}.item-icon-box{display:flex;align-items:center;justify-content:center;width:var(--ez-tree__item-icon-box--width);height:var(--ez-tree__item-icon-box--height);padding:var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) 0}.item-icon{--ez-icon--color:var(--ez-tree--color)}.item-icon:hover{cursor:pointer}.tree-item[selected] .item-icon{--ez-icon--color:var(--ez-tree--selected--color)}.tree-item[disabled] .item-icon{cursor:unset;--ez-icon--color:var(--ez-tree--disabled--color)}.item-label{cursor:inherit;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.item-label--bold{font-weight:var(--ez-tree--font-weight--bold)}.tree-item[selected] .item-label{color:var(--ez-tree--selected--color);font-weight:var(--ez-tree--selected--font-weight)}.tree-item[disabled] .item-label{color:var(--ez-tree--disabled--color)}";
|
|
502
516
|
|
|
503
517
|
const EzTree = class {
|
|
504
518
|
constructor(hostRef) {
|
|
@@ -214,6 +214,9 @@ const EzSearch = class {
|
|
|
214
214
|
if (typeof value === "string" || value instanceof String) {
|
|
215
215
|
return this._visibleOptions.find(o => o.value === value);
|
|
216
216
|
}
|
|
217
|
+
if (value) {
|
|
218
|
+
return Object.assign(Object.assign({}, value), { value: this.replaceHighlight(value === null || value === void 0 ? void 0 : value.value), label: this.replaceHighlight(value === null || value === void 0 ? void 0 : value.label) });
|
|
219
|
+
}
|
|
217
220
|
return value;
|
|
218
221
|
}
|
|
219
222
|
updateVisibleOptions() {
|
|
@@ -312,7 +315,7 @@ const EzSearch = class {
|
|
|
312
315
|
}
|
|
313
316
|
scrollToOption(opt) {
|
|
314
317
|
window.requestAnimationFrame(() => {
|
|
315
|
-
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value) ? this._optionsList.querySelector(`div#item_${opt.value.replace(/[<>\[\]#=]/g, '\\$&').replace(/:/g, '\\:')}`) : undefined;
|
|
318
|
+
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value) ? this._optionsList.querySelector(`div#item_${this.replaceHighlight(opt.value).replace(/[<>\[\]#=]/g, '\\$&').replace(/:/g, '\\:')}`) : undefined;
|
|
316
319
|
if (liElem)
|
|
317
320
|
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
318
321
|
});
|
|
@@ -355,15 +358,22 @@ const EzSearch = class {
|
|
|
355
358
|
this._source = [];
|
|
356
359
|
this.updateVisibleOptions();
|
|
357
360
|
}
|
|
361
|
+
replaceHighlight(value) {
|
|
362
|
+
const startHighlight = new RegExp(this._startHighlightTag, 'g');
|
|
363
|
+
const endHighlight = new RegExp(this._endHighlightTag, 'g');
|
|
364
|
+
return (value !== null && value !== void 0 ? value : "").replace(startHighlight, '').replace(endHighlight, '');
|
|
365
|
+
}
|
|
358
366
|
selectOption(newOption) {
|
|
359
367
|
var _a, _b;
|
|
360
368
|
const currentValue = this.getSelectedOption(this.value);
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
369
|
+
const newOptionsReplaced = Object.assign(Object.assign({}, newOption), { value: this.replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.value), label: this.replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.label) });
|
|
370
|
+
if ((((_a = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value) === null || _b === void 0 ? void 0 : _b.toString()))
|
|
371
|
+
|| (currentValue == undefined && newOptionsReplaced != undefined && "value" in newOptionsReplaced)) {
|
|
372
|
+
const adjustedOpt = !(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value) ? undefined : newOptionsReplaced;
|
|
364
373
|
this.value = adjustedOpt;
|
|
365
374
|
}
|
|
366
375
|
else {
|
|
376
|
+
this.setInputValue();
|
|
367
377
|
this.resetOptions();
|
|
368
378
|
}
|
|
369
379
|
this._visibleOptions = [];
|
|
@@ -473,7 +483,7 @@ const EzSearch = class {
|
|
|
473
483
|
return;
|
|
474
484
|
}
|
|
475
485
|
this._lookupMode = true;
|
|
476
|
-
this.value = value;
|
|
486
|
+
this.value = value ? Object.assign(Object.assign({}, value), { value: this.replaceHighlight(value.value), label: this.replaceHighlight(value.label) }) : value;
|
|
477
487
|
}
|
|
478
488
|
loadOptionValue(argument) {
|
|
479
489
|
var _a;
|
|
@@ -72,22 +72,38 @@ const EzSplitButton = class {
|
|
|
72
72
|
evt.stopPropagation();
|
|
73
73
|
this.closeDropdown();
|
|
74
74
|
}
|
|
75
|
+
resolveOffsetParentRect() {
|
|
76
|
+
var _a, _b;
|
|
77
|
+
const offsetParentRect = (_b = (_a = this.dropdownParent) === null || _a === void 0 ? void 0 : _a.offsetParent) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
|
|
78
|
+
const scrollLeft = window.scrollX || document.documentElement.scrollLeft;
|
|
79
|
+
const scrollTop = window.scrollY || document.documentElement.scrollTop;
|
|
80
|
+
const rectWithoutScroll = {
|
|
81
|
+
top: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.top) + scrollTop,
|
|
82
|
+
left: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.left) + scrollLeft,
|
|
83
|
+
bottom: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.bottom) + scrollTop,
|
|
84
|
+
right: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.right) + scrollLeft,
|
|
85
|
+
width: offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.width,
|
|
86
|
+
height: offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.height
|
|
87
|
+
};
|
|
88
|
+
this.offsetParentRect = rectWithoutScroll;
|
|
89
|
+
}
|
|
75
90
|
/**
|
|
76
91
|
* Método responsável em posicionar o dropdown na tela.
|
|
77
92
|
* Faz com que o dropdown se ajuste automaticamente ao espaco na tela
|
|
78
93
|
*/
|
|
79
94
|
positionDropdown() {
|
|
95
|
+
var _a, _b, _c, _d, _e, _f;
|
|
80
96
|
const { rightButton: _rightButton, dropdownParent: _dropdownParent } = this;
|
|
81
97
|
const rightButtonRect = _rightButton.getBoundingClientRect();
|
|
82
98
|
const dropdownParentRect = _dropdownParent.getBoundingClientRect();
|
|
83
|
-
const spaceBelow = window.innerHeight - rightButtonRect.bottom;
|
|
84
|
-
const spaceAbove = rightButtonRect.top;
|
|
85
|
-
const spaceRight = window.innerWidth - rightButtonRect.
|
|
99
|
+
const spaceBelow = window.innerHeight - (rightButtonRect.bottom + ((_a = this.offsetParentRect) === null || _a === void 0 ? void 0 : _a.top));
|
|
100
|
+
const spaceAbove = rightButtonRect.top + ((_b = this.offsetParentRect) === null || _b === void 0 ? void 0 : _b.top);
|
|
101
|
+
const spaceRight = window.innerWidth - (rightButtonRect.left + ((_c = this.offsetParentRect) === null || _c === void 0 ? void 0 : _c.left));
|
|
86
102
|
const spaceLeft = rightButtonRect.left;
|
|
87
103
|
const hasSpaceBelow = spaceBelow < dropdownParentRect.height && spaceAbove > dropdownParentRect.height;
|
|
88
104
|
const hasSpaceRight = spaceRight < dropdownParentRect.width && spaceLeft > dropdownParentRect.width;
|
|
89
|
-
let top = `${rightButtonRect.bottom + window.scrollY}px`;
|
|
90
|
-
let left = `${rightButtonRect.left + window.scrollX}px`;
|
|
105
|
+
let top = `${rightButtonRect.bottom - ((_d = this.offsetParentRect) === null || _d === void 0 ? void 0 : _d.top) + window.scrollY}px`;
|
|
106
|
+
let left = `${rightButtonRect.left - ((_e = this.offsetParentRect) === null || _e === void 0 ? void 0 : _e.left) + window.scrollX}px`;
|
|
91
107
|
let bottom = 'auto';
|
|
92
108
|
if (hasSpaceBelow) {
|
|
93
109
|
bottom = `${window.innerHeight - rightButtonRect.top - window.scrollY}px`;
|
|
@@ -95,7 +111,7 @@ const EzSplitButton = class {
|
|
|
95
111
|
_dropdownParent.style.maxHeight = `${spaceAbove}px`;
|
|
96
112
|
}
|
|
97
113
|
if (hasSpaceRight) {
|
|
98
|
-
left = `${rightButtonRect.right - dropdownParentRect.width + window.scrollX}px`;
|
|
114
|
+
left = `${rightButtonRect.right - dropdownParentRect.width - ((_f = this.offsetParentRect) === null || _f === void 0 ? void 0 : _f.left) + window.scrollX}px`;
|
|
99
115
|
}
|
|
100
116
|
_dropdownParent.style.top = top;
|
|
101
117
|
_dropdownParent.style.bottom = bottom;
|
|
@@ -108,6 +124,9 @@ const EzSplitButton = class {
|
|
|
108
124
|
componentWillLoad() {
|
|
109
125
|
this.setEvents();
|
|
110
126
|
}
|
|
127
|
+
componentWillRender() {
|
|
128
|
+
this.resolveOffsetParentRect();
|
|
129
|
+
}
|
|
111
130
|
componentDidLoad() {
|
|
112
131
|
if (this._element)
|
|
113
132
|
ElementIDUtils.addIDInfo(this._element);
|
|
@@ -5,7 +5,7 @@ import './DialogType-54a62731.js';
|
|
|
5
5
|
import './CheckMode-bdb2ec19.js';
|
|
6
6
|
import '@sankhyalabs/core';
|
|
7
7
|
|
|
8
|
-
const ezSplitItemCss = "
|
|
8
|
+
const ezSplitItemCss = ".box_split-item{background-color:var(--background--xlight);width:100%;height:100%;border-radius:var(--border--radius-medium);box-shadow:var(--shadow);flex-direction:column;overflow:hidden;display:flex;padding:var(--space--nano)}.box_split-item>.ez-split-item--content{overflow:auto}.expanded__item{position:absolute;z-index:var(--more-visible);top:0;left:0;width:100%;height:100%}.ez-split-item--header{display:flex;align-items:center;justify-content:space-between}.ez-split-item--header-title{flex:1;white-space:nowrap;overflow:hidden}.ez-split-item--header-title h3{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}.ez-split-item--header-buttons{display:flex;align-items:center}.ez-split-item--content{display:block;height:100%}h3.ez-margin--small{margin-left:var(--space--small)}";
|
|
9
9
|
|
|
10
10
|
const SplitItem = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -25,7 +25,7 @@ const SplitItem = class {
|
|
|
25
25
|
CSSVarsUtils.applyVarsGrid(this._element, this._slot.children[0]);
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
|
-
return (h(Host, { class: `box_split-item ${this._expanded ? 'expanded__item' : ''}`, ref: el => (this._element = el) }, h("div", { class: "ez-split-item--header" }, h("slot", { name: "leftButtons" }), h("div", { class: "ez-split-item--header-title" }, this.label && (h("h3", { class: "ez-text ez-text--primary ez-title ez-title--small ez-margin--small", title: this.label }, this.label))), h("div", { class: "ez-split-item--header-buttons" }, this.enableExpand && (h("ez-button", { size: "small", mode: "icon", iconName: "expand", class: 'ez-button--tertiary', onClick: () => this.toggleExpandItem(), title: this._expanded ? 'Resumir' : 'Expandir' })), h("slot", { name: "rightButtons" }))), h("div", { class: "ez-split-item--content", ref: el => (this._slot = el) }, h("slot", null))));
|
|
28
|
+
return (h(Host, { class: `box_split-item ${this._expanded ? 'expanded__item' : ''}`, ref: el => (this._element = el) }, h("div", { class: "ez-split-item--header" }, h("slot", { name: "leftButtons" }), h("div", { class: "ez-split-item--header-title" }, this.label && (h("h3", { class: "ez-text ez-text--primary ez-title ez-title--small ez-margin--small", title: this.label }, this.label))), h("div", { class: "ez-split-item--header-buttons" }, this.enableExpand && (h("ez-button", { size: "small", mode: "icon", iconName: "expand", class: 'ez-button--tertiary', onClick: () => this.toggleExpandItem(), title: this._expanded ? 'Resumir' : 'Expandir' })), h("slot", { name: "rightButtons" }))), h("div", { class: "ez-split-item--content grid_height-0", ref: el => (this._slot = el) }, h("slot", null))));
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
SplitItem.style = ezSplitItemCss;
|
|
@@ -784,17 +784,25 @@ const SplitPanel = class {
|
|
|
784
784
|
};
|
|
785
785
|
return style;
|
|
786
786
|
}
|
|
787
|
-
|
|
788
|
-
let template = '';
|
|
787
|
+
calcFreeSpacePercentage() {
|
|
789
788
|
const inUseSpacePercentage = this._items.reduce((accumulator, currentValue) => {
|
|
790
789
|
var _a;
|
|
791
790
|
return accumulator + (((_a = currentValue.size) === null || _a === void 0 ? void 0 : _a.includes('%')) ? Number(currentValue.size.replace("%", "")) : 0);
|
|
792
791
|
}, 0);
|
|
793
|
-
const
|
|
792
|
+
const itemsWithoutSizeAmount = this._items.filter((item) => item.size === undefined).length;
|
|
793
|
+
if (!itemsWithoutSizeAmount || !inUseSpacePercentage) {
|
|
794
|
+
return null;
|
|
795
|
+
}
|
|
796
|
+
const freeSpacePercentage = ((100 - inUseSpacePercentage) / itemsWithoutSizeAmount);
|
|
797
|
+
return freeSpacePercentage;
|
|
798
|
+
}
|
|
799
|
+
getGridTemplate() {
|
|
800
|
+
let template = '';
|
|
801
|
+
const freeSpacePercentage = this.calcFreeSpacePercentage();
|
|
794
802
|
this._items.forEach((col, index) => {
|
|
795
803
|
let size = col.size || '1fr';
|
|
796
|
-
if (!col.size &&
|
|
797
|
-
size = `${
|
|
804
|
+
if (!col.size && freeSpacePercentage) {
|
|
805
|
+
size = `${freeSpacePercentage}%`;
|
|
798
806
|
}
|
|
799
807
|
if (index === this._items.length - 1) {
|
|
800
808
|
template += ` ${size}`;
|