@sankhyalabs/ezui 5.21.0-dev.4 → 5.21.0-dev.6
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-modal-container.cjs.entry.js +2 -2
- package/dist/cjs/ez-search.cjs.entry.js +5 -2
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
- package/dist/collection/components/ez-search/ez-search.js +5 -2
- package/dist/custom-elements/index.js +7 -4
- package/dist/esm/ez-modal-container.entry.js +2 -2
- package/dist/esm/ez-search.entry.js +5 -2
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-7c770f14.entry.js +1 -0
- package/dist/ezui/p-991a7077.entry.js +1 -0
- package/package.json +1 -1
- package/dist/ezui/p-44c5b6a5.entry.js +0 -1
- package/dist/ezui/p-9aefaa52.entry.js +0 -1
|
@@ -22,7 +22,7 @@ var ModalButtonStatus;
|
|
|
22
22
|
})(ModalButtonStatus || (ModalButtonStatus = {}));
|
|
23
23
|
const ModalButtonStatus$1 = ModalButtonStatus;
|
|
24
24
|
|
|
25
|
-
const ezModalContainerCss = ".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:clip;display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x)}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";
|
|
25
|
+
const ezModalContainerCss = ".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:clip;display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header-container.sc-ez-modal-container:focus-visible{outline:none}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x)}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";
|
|
26
26
|
|
|
27
27
|
const EzModalContainer = class {
|
|
28
28
|
constructor(hostRef) {
|
|
@@ -71,7 +71,7 @@ const EzModalContainer = class {
|
|
|
71
71
|
this._closeButton.focus();
|
|
72
72
|
}
|
|
73
73
|
render() {
|
|
74
|
-
return (index.h(index.Host, null, index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), index.h("div", { ref: ref => this._modalRef = ref, tabIndex: -1 }, this.showTitleBar && (index.h("div", { class: "ez-modal-container__header ez-margin-bottom--large" }, index.h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, index.h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (index.h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), index.h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE) }, index.h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" }))))), index.h("div", { class: "ez-modal-container__content" }, index.h("slot", null)), index.h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (index.h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (index.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) }))), index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
74
|
+
return (index.h(index.Host, null, index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), index.h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (index.h("div", { class: "ez-modal-container__header ez-margin-bottom--large" }, index.h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, index.h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (index.h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), index.h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE) }, index.h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" }))))), index.h("div", { class: "ez-modal-container__content" }, index.h("slot", null)), index.h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (index.h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (index.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) }))), index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
75
75
|
}
|
|
76
76
|
get _element() { return index.getElement(this); }
|
|
77
77
|
};
|
|
@@ -319,9 +319,12 @@ const EzSearch = class {
|
|
|
319
319
|
}
|
|
320
320
|
scrollToOption(opt) {
|
|
321
321
|
window.requestAnimationFrame(() => {
|
|
322
|
-
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
323
|
-
|
|
322
|
+
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
323
|
+
? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
|
|
324
|
+
: undefined;
|
|
325
|
+
if (liElem) {
|
|
324
326
|
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
327
|
+
}
|
|
325
328
|
});
|
|
326
329
|
}
|
|
327
330
|
selectCurrentOption() {
|
|
@@ -47,7 +47,7 @@ export class EzModalContainer {
|
|
|
47
47
|
this._closeButton.focus();
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
|
-
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.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.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
50
|
+
return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, 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.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.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
51
51
|
}
|
|
52
52
|
static get is() { return "ez-modal-container"; }
|
|
53
53
|
static get encapsulation() { return "scoped"; }
|
|
@@ -308,9 +308,12 @@ export class EzSearch {
|
|
|
308
308
|
}
|
|
309
309
|
scrollToOption(opt) {
|
|
310
310
|
window.requestAnimationFrame(() => {
|
|
311
|
-
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
312
|
-
|
|
311
|
+
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
312
|
+
? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
|
|
313
|
+
: undefined;
|
|
314
|
+
if (liElem) {
|
|
313
315
|
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
316
|
+
}
|
|
314
317
|
});
|
|
315
318
|
}
|
|
316
319
|
selectCurrentOption() {
|
|
@@ -126829,7 +126829,7 @@ var ModalButtonStatus;
|
|
|
126829
126829
|
})(ModalButtonStatus || (ModalButtonStatus = {}));
|
|
126830
126830
|
const ModalButtonStatus$1 = ModalButtonStatus;
|
|
126831
126831
|
|
|
126832
|
-
const ezModalContainerCss = ".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:clip;display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x)}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";
|
|
126832
|
+
const ezModalContainerCss = ".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:clip;display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header-container.sc-ez-modal-container:focus-visible{outline:none}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x)}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";
|
|
126833
126833
|
|
|
126834
126834
|
const EzModalContainer$1 = class extends HTMLElement$1 {
|
|
126835
126835
|
constructor() {
|
|
@@ -126879,7 +126879,7 @@ const EzModalContainer$1 = class extends HTMLElement$1 {
|
|
|
126879
126879
|
this._closeButton.focus();
|
|
126880
126880
|
}
|
|
126881
126881
|
render() {
|
|
126882
|
-
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() })));
|
|
126882
|
+
return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, 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() })));
|
|
126883
126883
|
}
|
|
126884
126884
|
get _element() { return this; }
|
|
126885
126885
|
static get style() { return ezModalContainerCss; }
|
|
@@ -128008,9 +128008,12 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
128008
128008
|
}
|
|
128009
128009
|
scrollToOption(opt) {
|
|
128010
128010
|
window.requestAnimationFrame(() => {
|
|
128011
|
-
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
128012
|
-
|
|
128011
|
+
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
128012
|
+
? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
|
|
128013
|
+
: undefined;
|
|
128014
|
+
if (liElem) {
|
|
128013
128015
|
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
128016
|
+
}
|
|
128014
128017
|
});
|
|
128015
128018
|
}
|
|
128016
128019
|
selectCurrentOption() {
|
|
@@ -18,7 +18,7 @@ var ModalButtonStatus;
|
|
|
18
18
|
})(ModalButtonStatus || (ModalButtonStatus = {}));
|
|
19
19
|
const ModalButtonStatus$1 = ModalButtonStatus;
|
|
20
20
|
|
|
21
|
-
const ezModalContainerCss = ".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:clip;display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x)}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";
|
|
21
|
+
const ezModalContainerCss = ".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:clip;display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header-container.sc-ez-modal-container:focus-visible{outline:none}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x)}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";
|
|
22
22
|
|
|
23
23
|
const EzModalContainer = class {
|
|
24
24
|
constructor(hostRef) {
|
|
@@ -67,7 +67,7 @@ const EzModalContainer = class {
|
|
|
67
67
|
this._closeButton.focus();
|
|
68
68
|
}
|
|
69
69
|
render() {
|
|
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() })));
|
|
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, class: "ez-modal-container__header-container" }, 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() })));
|
|
71
71
|
}
|
|
72
72
|
get _element() { return getElement(this); }
|
|
73
73
|
};
|
|
@@ -315,9 +315,12 @@ const EzSearch = class {
|
|
|
315
315
|
}
|
|
316
316
|
scrollToOption(opt) {
|
|
317
317
|
window.requestAnimationFrame(() => {
|
|
318
|
-
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
319
|
-
|
|
318
|
+
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
319
|
+
? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
|
|
320
|
+
: undefined;
|
|
321
|
+
if (liElem) {
|
|
320
322
|
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
323
|
+
}
|
|
321
324
|
});
|
|
322
325
|
}
|
|
323
326
|
selectCurrentOption() {
|
package/dist/ezui/ezui.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-23a36bb6.js";export{s as setNonce}from"./p-23a36bb6.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o(JSON.parse('[["p-b44741b0",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"selectionToastConfig":[16],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"columnfilterDataSource":[16],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"_showSelectionCounter":[32],"_isAllSelection":[32],"_currentPageSelected":[32],"_selectionCount":[32],"_hasLeftButtons":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64],"locateColumn":[64],"filterColumns":[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["p-6e429cff",[[1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32],"disableItem":[64],"openGuideNavidator":[64],"enableItem":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"selectGuide":[64],"getParent":[64]}]]],["p-09de35a2",[[1,"ez-alert-list",{"alerts":[1040],"enableDragAndDrop":[516,"enable-drag-and-drop"],"enableExpand":[516,"enable-expand"],"itemRightSlotBuilder":[16],"opened":[1540],"expanded":[1540],"_container":[32]}]]],["p-99ead599",[[1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32],"hideActions":[64],"showActions":[64],"isOpened":[64]}]]],["p-1e7a8633",[[1,"ez-breadcrumb",{"items":[1040],"fillMode":[1025,"fill-mode"],"maxItems":[1026,"max-items"],"positionEllipsis":[1026,"position-ellipsis"],"visibleItems":[32],"hiddenItems":[32],"showDropdown":[32],"collapseConfigPosition":[32]}]]],["p-49456b34",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"beforeClose":[1040],"show":[64]},[[8,"keydown","handleKeyDown"]]]]],["p-44c5b6a5",[[6,"ez-modal-container",{"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"showTitleBar":[4,"show-title-bar"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"cancelButtonStatus":[1,"cancel-button-status"],"okButtonStatus":[1,"ok-button-status"]},[[4,"ezCloseModal","handleEzModalAction"]]]]],["p-3faa2b46",[[1,"ez-split-button",{"enabled":[516],"iconName":[513,"icon-name"],"image":[513],"items":[16],"label":[513],"leftTitle":[513,"left-title"],"rightTitle":[513,"right-title"],"mode":[513],"size":[513],"show":[32],"setBlur":[64],"setLeftButtonFocus":[64],"setRightButtonFocus":[64]},[[2,"click","clickListener"]]]]],["p-637f69f2",[[4,"ez-split-item",{"label":[1],"enableExpand":[516,"enable-expand"],"size":[1],"_expanded":[32]}]]],["p-1f50fa05",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["p-650e4b6d",[[1,"ez-badge",{"size":[513],"label":[513],"iconLeft":[513,"icon-left"],"iconRight":[513,"icon-right"],"position":[1040],"hasSlot":[32]}]]],["p-17be134a",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"showNativeTooltip":[4,"show-native-tooltip"],"setFocus":[64],"setBlur":[64]}]]],["p-555c9018",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["p-bc2f844e",[[0,"ez-application"]]],["p-5ed81457",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["p-f3c526cc",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"heightMode":[1,"height-mode"],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"],"scrim":[1]}]]],["p-d9401ea0",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"]}]]],["p-9f5fa3f9",[[1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]]],["p-85c8baae",[[0,"ez-skeleton",{"count":[2],"variant":[1],"width":[1],"height":[1],"marginBottom":[1,"margin-bottom"],"animation":[1]}]]],["p-af2ecb1b",[[0,"ez-split-panel",{"direction":[1],"anchorToExpand":[4,"anchor-to-expand"],"rebuildLayout":[64]}]]],["p-8df1ca33",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["p-44caad9a",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["p-cc2dc4f4",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]]],["p-0447d17c",[[1,"ez-collapsible-box",{"value":[1540],"boxBordered":[4,"box-bordered"],"label":[513],"subtitle":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32],"showHide":[64],"applyFocusTextEdit":[64],"cancelEdition":[64]}]]],["p-bae3d0aa",[[1,"ez-combo-box",{"limitCharsToSearch":[2,"limit-chars-to-search"],"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]},[[11,"scroll","scrollListener"]]]]],["p-e85c48d7",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-b567fa8c",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"canShowError":[516,"can-show-error"],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-a80b1287",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"overlayType":[513,"overlay-type"],"updatePosition":[64],"show":[64],"showUnder":[64],"hide":[64]}]]],["p-8defa6d3",[[1,"ez-list",{"dataSource":[1040],"listMode":[1,"list-mode"],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"itemLeftSlotBuilder":[1040],"hoverFeedback":[1028,"hover-feedback"],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64],"removeSelection":[64]}]]],["p-0306dff7",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"fitHorizontal":[64],"hide":[64]},[[11,"scroll","scrollListener"]]]]],["p-5bd5e68f",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"],"password":[4],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-784fe207",[[2,"ez-multi-selection-list",{"columnName":[1,"column-name"],"dataSource":[16],"useOptions":[1028,"use-options"],"options":[1040],"isTextSearch":[4,"is-text-search"],"filteredOptions":[32],"displayOptions":[32],"viewScenario":[32],"displayOptionToCheckAllItems":[32],"clearFilteredOptions":[64]}]]],["p-baf80b13",[[0,"filter-column",{"opened":[4],"columnName":[1,"column-name"],"columnLabel":[1,"column-label"],"gridHeaderHidden":[4,"grid-header-hidden"],"noHeaderTaskBar":[1028,"no-header-task-bar"],"dataSource":[16],"dataUnit":[16],"options":[1040],"selectedItems":[32],"fieldDescriptor":[32],"useOptions":[32],"isTextSearch":[32],"hide":[64],"show":[64]}]]],["p-bae4e180",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-af95cd16",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-072e6347",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]},[[4,"click","handleClickOutside"]]]]],["p-9050d2cd",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"enableResize":[516,"enable-resize"],"appendTextToSelection":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-77a4bd35",[[1,"ez-upload",{"label":[1],"subtitle":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["p-20ec22c0",[[1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32],"applyFocusSelect":[64]}]]],["p-91f626d3",[[1,"ez-tree",{"items":[1040],"value":[1040],"selectedId":[1537,"selected-id"],"iconResolver":[16],"tooltipResolver":[16],"_tree":[32],"_waintingForLoad":[32],"selectItem":[64],"openItem":[64],"disableItem":[64],"enableItem":[64],"addChild":[64],"applyFilter":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"getParent":[64]},[[2,"keydown","onKeyDownListener"]]],[1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isActive":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"]]],["p-9aefaa52",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"canShowError":[516,"can-show-error"],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"ignoreLimitCharsToSearch":[4,"ignore-limit-chars-to-search"],"options":[1040],"suppressSearch":[4,"suppress-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]},[[11,"scroll","scrollListener"]]]]],["p-bf79aaa1",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[1540],"mode":[513],"compact":[4],"getMode":[64],"setFocus":[64]}]]],["p-7bc07c31",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["p-b041333c",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]},[[2,"click","clickListener"]]]]],["p-7af81663",[[0,"multi-selection-box-message",{"message":[1]}],[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"asyncSearch":[516,"async-search"],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"setValue":[64],"endSearch":[64]}],[1,"ez-card-item",{"item":[16],"enableKey":[4,"enable-key"]}]]],["p-db77a984",[[2,"ez-form-view",{"fields":[16],"showUp":[64]}]]],["p-2a1a0e04",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"validate":[64]}]]]]'),e)));
|
|
1
|
+
import{p as e,b as o}from"./p-23a36bb6.js";export{s as setNonce}from"./p-23a36bb6.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o(JSON.parse('[["p-b44741b0",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"selectionToastConfig":[16],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"columnfilterDataSource":[16],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"_showSelectionCounter":[32],"_isAllSelection":[32],"_currentPageSelected":[32],"_selectionCount":[32],"_hasLeftButtons":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64],"locateColumn":[64],"filterColumns":[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["p-6e429cff",[[1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32],"disableItem":[64],"openGuideNavidator":[64],"enableItem":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"selectGuide":[64],"getParent":[64]}]]],["p-09de35a2",[[1,"ez-alert-list",{"alerts":[1040],"enableDragAndDrop":[516,"enable-drag-and-drop"],"enableExpand":[516,"enable-expand"],"itemRightSlotBuilder":[16],"opened":[1540],"expanded":[1540],"_container":[32]}]]],["p-99ead599",[[1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32],"hideActions":[64],"showActions":[64],"isOpened":[64]}]]],["p-1e7a8633",[[1,"ez-breadcrumb",{"items":[1040],"fillMode":[1025,"fill-mode"],"maxItems":[1026,"max-items"],"positionEllipsis":[1026,"position-ellipsis"],"visibleItems":[32],"hiddenItems":[32],"showDropdown":[32],"collapseConfigPosition":[32]}]]],["p-49456b34",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"beforeClose":[1040],"show":[64]},[[8,"keydown","handleKeyDown"]]]]],["p-991a7077",[[6,"ez-modal-container",{"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"showTitleBar":[4,"show-title-bar"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"cancelButtonStatus":[1,"cancel-button-status"],"okButtonStatus":[1,"ok-button-status"]},[[4,"ezCloseModal","handleEzModalAction"]]]]],["p-3faa2b46",[[1,"ez-split-button",{"enabled":[516],"iconName":[513,"icon-name"],"image":[513],"items":[16],"label":[513],"leftTitle":[513,"left-title"],"rightTitle":[513,"right-title"],"mode":[513],"size":[513],"show":[32],"setBlur":[64],"setLeftButtonFocus":[64],"setRightButtonFocus":[64]},[[2,"click","clickListener"]]]]],["p-637f69f2",[[4,"ez-split-item",{"label":[1],"enableExpand":[516,"enable-expand"],"size":[1],"_expanded":[32]}]]],["p-1f50fa05",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["p-650e4b6d",[[1,"ez-badge",{"size":[513],"label":[513],"iconLeft":[513,"icon-left"],"iconRight":[513,"icon-right"],"position":[1040],"hasSlot":[32]}]]],["p-17be134a",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"showNativeTooltip":[4,"show-native-tooltip"],"setFocus":[64],"setBlur":[64]}]]],["p-555c9018",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["p-bc2f844e",[[0,"ez-application"]]],["p-5ed81457",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["p-f3c526cc",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"heightMode":[1,"height-mode"],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"],"scrim":[1]}]]],["p-d9401ea0",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"]}]]],["p-9f5fa3f9",[[1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]]],["p-85c8baae",[[0,"ez-skeleton",{"count":[2],"variant":[1],"width":[1],"height":[1],"marginBottom":[1,"margin-bottom"],"animation":[1]}]]],["p-af2ecb1b",[[0,"ez-split-panel",{"direction":[1],"anchorToExpand":[4,"anchor-to-expand"],"rebuildLayout":[64]}]]],["p-8df1ca33",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["p-44caad9a",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["p-cc2dc4f4",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]]],["p-0447d17c",[[1,"ez-collapsible-box",{"value":[1540],"boxBordered":[4,"box-bordered"],"label":[513],"subtitle":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32],"showHide":[64],"applyFocusTextEdit":[64],"cancelEdition":[64]}]]],["p-bae3d0aa",[[1,"ez-combo-box",{"limitCharsToSearch":[2,"limit-chars-to-search"],"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]},[[11,"scroll","scrollListener"]]]]],["p-e85c48d7",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-b567fa8c",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"canShowError":[516,"can-show-error"],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-a80b1287",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"overlayType":[513,"overlay-type"],"updatePosition":[64],"show":[64],"showUnder":[64],"hide":[64]}]]],["p-8defa6d3",[[1,"ez-list",{"dataSource":[1040],"listMode":[1,"list-mode"],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"itemLeftSlotBuilder":[1040],"hoverFeedback":[1028,"hover-feedback"],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64],"removeSelection":[64]}]]],["p-0306dff7",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"fitHorizontal":[64],"hide":[64]},[[11,"scroll","scrollListener"]]]]],["p-5bd5e68f",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"],"password":[4],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-784fe207",[[2,"ez-multi-selection-list",{"columnName":[1,"column-name"],"dataSource":[16],"useOptions":[1028,"use-options"],"options":[1040],"isTextSearch":[4,"is-text-search"],"filteredOptions":[32],"displayOptions":[32],"viewScenario":[32],"displayOptionToCheckAllItems":[32],"clearFilteredOptions":[64]}]]],["p-baf80b13",[[0,"filter-column",{"opened":[4],"columnName":[1,"column-name"],"columnLabel":[1,"column-label"],"gridHeaderHidden":[4,"grid-header-hidden"],"noHeaderTaskBar":[1028,"no-header-task-bar"],"dataSource":[16],"dataUnit":[16],"options":[1040],"selectedItems":[32],"fieldDescriptor":[32],"useOptions":[32],"isTextSearch":[32],"hide":[64],"show":[64]}]]],["p-bae4e180",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-af95cd16",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-072e6347",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]},[[4,"click","handleClickOutside"]]]]],["p-9050d2cd",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"enableResize":[516,"enable-resize"],"appendTextToSelection":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-77a4bd35",[[1,"ez-upload",{"label":[1],"subtitle":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["p-20ec22c0",[[1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32],"applyFocusSelect":[64]}]]],["p-91f626d3",[[1,"ez-tree",{"items":[1040],"value":[1040],"selectedId":[1537,"selected-id"],"iconResolver":[16],"tooltipResolver":[16],"_tree":[32],"_waintingForLoad":[32],"selectItem":[64],"openItem":[64],"disableItem":[64],"enableItem":[64],"addChild":[64],"applyFilter":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"getParent":[64]},[[2,"keydown","onKeyDownListener"]]],[1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isActive":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"]]],["p-7c770f14",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"canShowError":[516,"can-show-error"],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"ignoreLimitCharsToSearch":[4,"ignore-limit-chars-to-search"],"options":[1040],"suppressSearch":[4,"suppress-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]},[[11,"scroll","scrollListener"]]]]],["p-bf79aaa1",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[1540],"mode":[513],"compact":[4],"getMode":[64],"setFocus":[64]}]]],["p-7bc07c31",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["p-b041333c",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]},[[2,"click","clickListener"]]]]],["p-7af81663",[[0,"multi-selection-box-message",{"message":[1]}],[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"asyncSearch":[516,"async-search"],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"setValue":[64],"endSearch":[64]}],[1,"ez-card-item",{"item":[16],"enableKey":[4,"enable-key"]}]]],["p-db77a984",[[2,"ez-form-view",{"fields":[16],"showUp":[64]}]]],["p-2a1a0e04",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"validate":[64]}]]]]'),e)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as t,h as e,H as s,g as r}from"./p-23a36bb6.js";import{C as o}from"./p-9e11fc7b.js";import{ObjectUtils as a,StringUtils as l,FloatingManager as h,ElementIDUtils as n}from"@sankhyalabs/core";import{A as c}from"./p-2187f86c.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{R as d}from"./p-05e1f4e7.js";const u=class{constructor(e){i(this,e),this.ezChange=t(this,"ezChange",7),this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._textEmptyList="Nenhum resultado encontrado",this._textEmptySearch="Nenhum resultado de {0} encontrado",this._lookupMode=!1,this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._criteria=void 0,this.value=void 0,this.label=void 0,this.enabled=!0,this.errorMessage=void 0,this.optionLoader=void 0,this.showSelectedValue=!0,this.showOptionValue=!0,this.suppressEmptyOption=!1,this.mode="regular",this.canShowError=!0,this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.ignoreLimitCharsToSearch=!1,this.options=void 0,this.suppressSearch=!1}observeErrorMessage(){var i;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(i=this.errorMessage)||void 0===i?void 0:i.trim())||this.setInputValue())}observeValue(i,t){if(this._textInput&&i!=t)try{if("string"===i)return void this.setInputValue();const e=this.getSelectedOption(i),s=this.getSelectedOption(t),r=this.getSelectedOption(this.value);this.isDifferentValues(r,e)&&(this.value=e),this.isDifferentValues(e,s)&&(this.setInputValue(),this._lookupMode||this.ezChange.emit(null===e?void 0:e)),this.resetOptions()}finally{this._lookupMode=!1}}observeOptions(i,t){(null==i?void 0:i.join(""))!==(null==t?void 0:t.join(""))&&this.loadOptions(v.PRELOAD)}async getValueAsync(){return new Promise(this._showLoading?i=>{let t=setInterval((()=>{this._showLoading||(clearInterval(t),i(this.value))}),100)}:i=>i(this.value))}async setFocus(){this._textInput&&this._textInput.setFocus()}async setBlur(){this._textInput&&this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async clearValue(){this.clearSearch()}scrollListener(){var i;null!=this._floatingID&&((null===(i=this.listOptionsPosition)||void 0===i?void 0:i.hardPosition)?this.hideOptions():window.requestAnimationFrame((()=>{this.updateListPosition()})))}updateListPosition(){let{verticalPosition:i,horizontalPosition:t,fromBottom:e,fromRight:s,bottomLimit:r,hardPosition:o}=this.getListPosition();const a=this._listWrapper.getBoundingClientRect(),l=this._listContainer.getBoundingClientRect(),h=this._textInput.getBoundingClientRect(),n=r||window.innerHeight;!e&&(a.top<0||l.bottom+a.height>n)&&(e=!0),o||(i=i||0,t=t||0,e?i=window.innerHeight-h.top+i:i+=l.top,s?t=window.innerWidth-h.right+t:t+=l.left),null!=i&&(this._listWrapper.style[e?"bottom":"top"]=`${i}px`,this._listWrapper.style[e?"top":"bottom"]=""),null!=t&&(this._listWrapper.style[s?"right":"left"]=`${t}px`,this._listWrapper.style[s?"left":"right"]="")}getListPosition(){return this.listOptionsPosition?this.listOptionsPosition:{verticalPosition:this.errorMessage||!this.canShowError||"slim"===this.mode?6:-13}}isDifferentValues(i,t){return a.objectToString(i||{})!==a.objectToString(t||{})}getFormattedText(i){if(null==i)return;let t=this.showSelectedValue&&null!=i.value?`${i.value} - ${i.label}`:i.label;return t=t.replace(new RegExp(this._startHighlightTag,"g"),"").replace(new RegExp(this._endHighlightTag,"g"),""),t}getText(){const i=this.getSelectedOption(this.value),t=this.getFormattedText(i);if(null!=t)return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}getSelectedOption(i){return"string"==typeof i||i instanceof String?this._visibleOptions.find((t=>t.value===i)):i?Object.assign(Object.assign({},i),{value:this.replaceHighlight(null==i?void 0:i.value),label:this.replaceHighlight(null==i?void 0:i.label)}):i}updateVisibleOptions(){let i=this._source||[];this._visibleOptions=this.suppressEmptyOption?i:[{value:void 0,label:""}].concat(i),this._maxWidthValue=this.getMaxWidthValue()}getMaxWidthValue(){var i;const t=[];return null===(i=this._visibleOptions)||void 0===i||i.forEach((i=>{const e=this.getWidthValue(i.value);t.includes(e)||t.push(e)})),t.length>1?Math.max(...t):0}getWidthValue(i){if(null!=this._itemValueBasis){const t=this._itemValueBasis;if(null!=i)return t.innerHTML=i,t.clientWidth>0?t.clientWidth+2:0;t.innerHTML=""}return 0}createOption(i){let{key:t,title:e}=i;const s=new RegExp(this._startHighlightTag,"g"),r=new RegExp(this._endHighlightTag,"g");e=l.decodeHtmlEntities(e);const o={value:null==t?void 0:t.replace(s,"").replace(r,""),label:null==e?void 0:e.replace(s,"").replace(r,"")};this.selectOption(o)}buildItem(i,t){i.label=i.label||i.value;const s={key:i.value,title:i.label,details:i.details};return e("div",{style:{height:"100%"},class:t===this._preSelection?"item preselected":"item",id:`item_${i.value}`,onMouseDown:()=>this.createOption(s),onMouseOver:()=>this._preSelection=t},e("ez-card-item",{item:s}))}showOptions(){this.enabled&&(this.isOptionsVisible()||(this._resizeObserver&&this._resizeObserver.observe(this._textInput),this._floatingID=h.float(this._listWrapper,this._listContainer,{autoClose:!1,isFixed:!0,backClickListener:()=>this.hideOptions()}),this.setFocus(),window.requestAnimationFrame((()=>{this.updateListPosition(),this.listOptionsPosition||this._listWrapper.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}))))}hideOptions(){void 0!==this._floatingID&&h.close(this._floatingID),this._floatingID=void 0,this._resizeObserver&&this._resizeObserver.unobserve(this._textInput)}isOptionsVisible(){return void 0!==this._floatingID&&h.isFloating(this._floatingID)}nextOption(){this.isOptionsVisible()&&(this.showOptions(),this._preSelection=void 0===this._preSelection?0:Math.min(this._preSelection+1,this._visibleOptions.length-1),this.scrollToOption(this._visibleOptions[this._preSelection]))}previousOption(){this._preSelection=void 0===this._preSelection?0:Math.max(this._preSelection-1,0),this.scrollToOption(this._visibleOptions[this._preSelection])}scrollToOption(i){window.requestAnimationFrame((()=>{const t=(null==i?void 0:i.value)?this._optionsList.querySelector(`div#item_${i.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g,"\\$1")}`):void 0;t&&t.scrollIntoView({behavior:"smooth",block:"nearest"})}))}selectCurrentOption(){void 0!==this._preSelection?(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0):this.controlListWithOnlyOne()}updateSource(i){this._startLoading=!1,i instanceof Promise?(this._showLoading=!0,i.then((i=>{this._showLoading=!1,this.updateSource(i)})).catch((()=>this._showLoading=!1)),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(i)?(this._source=i,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1,this.controlEmptySearch())):this.selectOption(i))}clearSource(){this._source=[],this.updateVisibleOptions()}replaceHighlight(i){const t=new RegExp(this._startHighlightTag,"g"),e=new RegExp(this._endHighlightTag,"g");return(null!=i?i:"").replace(t,"").replace(e,"")}selectOption(i){var t,e;const s=this.getSelectedOption(this.value),r=Object.assign(Object.assign({},i),{value:this.replaceHighlight(null==i?void 0:i.value),label:this.replaceHighlight(null==i?void 0:i.label)});(null===(t=null==s?void 0:s.value)||void 0===t?void 0:t.toString())!==(null===(e=null==r?void 0:r.value)||void 0===e?void 0:e.toString())||null==s&&null!=r&&"value"in r?this.value=(null==r?void 0:r.value)?r:void 0:(this.setInputValue(),this.resetOptions()),this._visibleOptions=[],this.clearSource()}loadOptions(i,t=""){this._criteria=t,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:i,argument:t}):this.options)}cancelPreselection(){!this._textInput.value&&this.value?this.selectOption(void 0):window.setTimeout((()=>{this.setInputValue()}),this._deboucingTime),this.resetOptions()}setInputValue(i=!0){const t=this.getText();(this._textInput.value||"")!==t&&(this._textInput.value=t,i&&(this.errorMessage=null))}clearSearch(){this.value=null}controlListWithOnlyOne(){var i,t;const e=null===(i=this._visibleOptions)||void 0===i?void 0:i.filter((i=>""!==i.label&&null!=i.value));if((null==e?void 0:e.length)>0){const i=new RegExp(this._startHighlightTag,"g"),s=new RegExp(this._endHighlightTag,"g");let r=l.decodeHtmlEntities(e[0].label);const o={value:null===(t=e[0].value)||void 0===t?void 0:t.replace(i,"").replace(s,""),label:null==r?void 0:r.replace(i,"").replace(s,"")};this.selectOption(o)}}controlEmptySearch(){var i;(null===(i=this._visibleOptions)||void 0===i?void 0:i.length)?this.controlListWithOnlyOne():(this.clearSearch(),c.info(this._textEmptyList))}validateDescriptionValue(){if(l.isEmpty(this.value))return;let i=this.value;"object"!=typeof i&&(l.isEmpty(i)||this.loadDescriptionValue(i))}async loadDescriptionValue(i){var t,e;if(null==i)return;if((null===(t=this.options)||void 0===t?void 0:t.length)>0)return void this.loadOptionValue(i);const s={mode:v.PREDICTIVE,argument:i},r=await(null===(e=this.optionLoader)||void 0===e?void 0:e.call(this,s));null!=r&&(r instanceof Promise?r.then((i=>{this.setDescriptionValue(i)})):this.setDescriptionValue(r))}setDescriptionValue(i){const t=(null==i?void 0:i[0])||i;null!=t&&Object.keys(t).length?(this._lookupMode=!0,this.value=t?Object.assign(Object.assign({},t),{value:this.replaceHighlight(t.value),label:this.replaceHighlight(t.label)}):t):this.showNoResultMessage()}loadOptionValue(i){var t;const e=null===(t=this.options)||void 0===t?void 0:t.find((t=>t.value===i));null!=e?this.selectOption(e):this.showNoResultMessage()}async showNoResultMessage(){this.clearSearch(),c.info(this._textEmptySearch.replace("{0}",this.getFieldLabel()))}getFieldLabel(){var i;return null===(i=this.label)||void 0===i?void 0:i.replace(d,"").toUpperCase()}resetOptions(){this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}componentWillLoad(){if(void 0===this.options){this.options=[];const i=this.el.querySelectorAll("option");i&&i.forEach((i=>{let t=i.innerText,e=i.getAttribute("value"),s=i.getAttribute("details");e||(e=t),this.options.push({label:t,value:e,details:s}),i.hidden=!0}))}this.updateSource([])}componentDidRender(){var i;void 0===this._floatingID&&this._listWrapper.remove(),null===(i=this._optionsList)||void 0===i||i.querySelectorAll(".item").forEach((i=>{n.addIDInfoIfNotExists(i,"itemSearch")})),this.validateDescriptionValue()}componentDidLoad(){o.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1),this._resizeObserver=new ResizeObserver((i=>{window.requestAnimationFrame((()=>{if(!Array.isArray(i)||!i.length)return;const{clientWidth:t}=this._listContainer;t>0&&this._listWrapper&&(this._listWrapper.style.width=`${t}px`)}))}))}handlerIconClick(){this.loadOptions(v.ADVANCED)}buildNumberArgument(i){return this.isTextSearch?NaN:Number(i||void 0)}onTextInputChangeHandler(i){var t;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(i)}),this._deboucingTime));const e=null===(t=i.target.value)||void 0===t?void 0:t.trim(),s=this.buildNumberArgument(e);this._criteria||(this._textInput.value=i.data||e),this._criteria=e,e?(this._showLoading=!1,this.clearSource(),!isNaN(s)||e.length>=this._limitCharsToSearch?(this._showLoading=!0,this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions(v.PREDICTIVE,isNaN(s)?e:s.toString())}),this._deboucingTime),this.showOptions()):this.hideOptions()):(this.hideOptions(),this._showLoading=!1,this.clearSource())}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}keyDownHandler(i){switch(this._tabPressed=!1,i.ctrlKey&&("f"!==i.key&&"F"!==i.key||(this.loadOptions(v.ADVANCED),i.stopPropagation(),i.stopImmediatePropagation(),i.preventDefault())),i.key){case"ArrowDown":this.nextOption(),i.stopPropagation();break;case"ArrowUp":this.previousOption(),i.stopPropagation();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.cancelPreselection();break;case"Tab":this._tabPressed=!0,this.controlListWithOnlyOne()}}onTextInputFocusOutHandler(){this.hideErrorOnFocusOut&&this.cancelPreselection()}canShowListOptions(){return!this._showLoading&&this._visibleOptions.length>0}render(){var i;return n.addIDInfoIfNotExists(this.el,"input"),e(s,null,e("ez-text-input",{"data-element-id":n.getInternalIDInfo("textInput"),class:this.suppressSearch?"suppressed-search-input":"",ref:i=>this._textInput=i,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:i=>this.onTextInputChangeHandler(i),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:i=>this.keyDownHandler(i),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode},e("button",{class:"btn",slot:"leftIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},e("ez-icon",{iconName:"search"})),(null===(i=this._textInput)||void 0===i?void 0:i.value)&&(this._criteria||this.value)?e("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},e("ez-icon",{iconName:"close"})):void 0),e("section",{class:"list-container",ref:i=>this._listContainer=i},e("div",{class:"list-wrapper",ref:i=>this._listWrapper=i},e("ul",{class:"list-options",ref:i=>this._optionsList=i},!this._showLoading&&0===this._visibleOptions.length&&e("div",{class:"message"},e("span",{class:"message__no-result"},this._textEmptyList)),this._showLoading&&e("div",{class:"message"},e("div",{class:"message__loading"})),e("span",{class:"item__value item__value--hidden",ref:i=>this._itemValueBasis=i}),this.canShowListOptions()&&this._visibleOptions.map(((i,t)=>this.buildItem(i,t)))))))}get el(){return r(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"],options:["observeOptions"]}}};var v;!function(i){i.ADVANCED="ADVANCED",i.PRELOAD="PRELOAD",i.PREDICTIVE="PREDICTIVE"}(v||(v={})),u.style=":host{--ez-search--height:42px;--ez-search--width:100%;--ez-search__icon--width:48px;--ez-search--border-radius:var(--border--radius-medium, 12px);--ez-search--border-radius-small:var(--border--radius-small, 6px);--ez-search--font-size:var(--text--medium, 14px);--ez-search--font-family:var(--font-pattern, Arial);--ez-search--font-weight--large:var(--text-weight--large, 500);--ez-search--font-weight--medium:var(--text-weight--medium, 400);--ez-search--background-color--xlight:var(--background--xlight, #fff);--ez-search--background-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px);--ez-search__input--background-color:var(--background--medium, #e0e0e0);--ez-search__input--border:var(--border--medium, 2px solid);--ez-search__input--border-color:var(--ez-search__input--background-color);--ez-search__input--focus--border-color:var(--color--primary, #008561);--ez-search__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-search__input--disabled--color:var(--text--disable, #AFB6C0);--ez-search__input--error--border-color:#CC2936;--ez-search__btn--color:var(--title--primary, #2B3A54);--ez-search__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-search__btn-hover--color:var(--color--primary, #4e4e4e);--ez-search__label--color:var(--title--primary, #2B3A54);--ez-search__list-title--primary:var(--title--primary, #2B3A54);--ez-search__list-text--primary:var(--text--primary, #626e82);--ez-search__list-height:calc(var(--ez-search--font-size) + var(--ez-search--space--medium) + 4px);--ez-search__list-min-width:64px;--ez-search--space--medium:var(--space--medium, 12px);--ez-search--space--small:var(--space--small, 6px);--ez-search__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-search__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-search__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-search__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-search__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-search__scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-search--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{min-width:var(--ez-search__list-min-width);overflow:auto;position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:0;z-index:var(--more-visible, 2);max-height:350px;min-width:150px;background-color:var(--ez-search--background-color--xlight);border-radius:var(--ez-search--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);padding:var(--ez-search--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;padding:0;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-search__scrollbar--color-background);width:var(--ez-search__scrollbar--width);max-width:var(--ez-search__scrollbar--width);min-width:var(--ez-search__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-search__scrollbar--color-background);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-search__scrollbar--color-default);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-search__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-search__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-search--border-radius-small);padding:var(--ez-search--space--small);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size);line-height:var(--ez-search--line-height)}.item__label{font-weight:var(--ez-search--font-weight--medium)}.item__label--bold{font-weight:var(--ez-search--font-weight--large)}.item__value{text-align:center;color:var(--ez-search__list-text--primary);font-weight:var(--ez-search--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-search__list-height)}.message__no-result{color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-search__list-title--primary);border-top:3px solid transparent}.item__list>li:hover{background-color:var(--ez-search--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-search__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-search__btn-disabled--color)}.btn:disabled:hover{cursor:unset;color:var(--ez-search__btn-disabled--color)}.btn:hover{color:var(--ez-search__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{u as ez_search}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as o,H as a,g as i}from"./p-23a36bb6.js";import{KeyboardManager as n}from"@sankhyalabs/core";var l;!function(e){e.CLOSE="CLOSE",e.OK="OK",e.CANCEL="CANCEL",e.LOAD="LOAD"}(l||(l={}));const s=l;var r;!function(e){e.ENABLED="ENABLED",e.DISABLED="DISABLED",e.HIDDEN="HIDDEN"}(r||(r={}));const c=r,d=class{constructor(o){e(this,o),this.ezModalAction=t(this,"ezModalAction",7),this.modalTitle=void 0,this.modalSubTitle=void 0,this.showTitleBar=!0,this.cancelButtonLabel=void 0,this.okButtonLabel=void 0,this.cancelButtonStatus=void 0,this.okButtonStatus=void 0}async handleEzModalAction(e){var t;(null==e?void 0:e.target)&&(null==e?void 0:e.target)===(null===(t=this._element)||void 0===t?void 0:t.parentElement)&&this.closeModal()}cancelIsVisible(){return this.cancelButtonStatus!==c.HIDDEN&&null!=this.cancelButtonLabel}okIsVisible(){return this.okButtonStatus!==c.HIDDEN&&null!=this.okButtonLabel}componentDidLoad(){window.requestAnimationFrame((()=>{this.ezModalAction.emit(s.LOAD),this._modalRef.focus()})),new n({propagate:!1,element:this._element}).bind("Enter",this.ezModalAction.emit.bind(s.OK)).bind("Escape",(()=>this.closeModal())).bind("Esc",(()=>this.closeModal()))}closeModal(){this.ezModalAction.emit("CLOSE")}focusLast(){null!=this._okButton&&this._okButton.setFocus()}focusFirst(){this._closeButton.focus()}render(){return o(a,null,o("button",{class:"ez-modal-container__focus-ctrl",onFocusin:()=>this.focusLast()}),o("div",{ref:e=>this._modalRef=e,tabIndex:-1,class:"ez-modal-container__header-container"},this.showTitleBar&&o("div",{class:"ez-modal-container__header ez-margin-bottom--large"},o("div",{class:"ez-col ez-align--middle ez-modal-container__title"},o("h2",{class:"ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small"},this.modalTitle),this.modalSubTitle&&o("div",{class:"ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small"},this.modalSubTitle)),o("button",{ref:e=>this._closeButton=e,class:"ez-modal-container__close-button",onClick:()=>this.ezModalAction.emit(s.CLOSE)},o("ez-icon",{class:"ez-modal-container__close-icon",size:"medium",iconName:"close"})))),o("div",{class:"ez-modal-container__content"},o("slot",null)),o("div",{class:"ez-modal-container__footer"},this.cancelIsVisible()&&o("ez-button",{label:this.cancelButtonLabel,enabled:this.cancelButtonStatus!==c.DISABLED,onClick:()=>this.ezModalAction.emit(s.CANCEL)}),this.okIsVisible()&&o("ez-button",{ref:e=>this._okButton=e,class:"ez-button--primary",label:this.okButtonLabel,enabled:this.okButtonStatus!==c.DISABLED,onClick:()=>this.ezModalAction.emit(s.OK)})),o("button",{class:"ez-modal-container__focus-ctrl",onFocusin:()=>this.focusFirst()}))}get _element(){return i(this)}};d.style=".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:clip;display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header-container.sc-ez-modal-container:focus-visible{outline:none}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x)}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";export{d as ez_modal_container}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as o,H as i,g as a}from"./p-23a36bb6.js";import{KeyboardManager as n}from"@sankhyalabs/core";var s;!function(e){e.CLOSE="CLOSE",e.OK="OK",e.CANCEL="CANCEL",e.LOAD="LOAD"}(s||(s={}));const l=s;var r;!function(e){e.ENABLED="ENABLED",e.DISABLED="DISABLED",e.HIDDEN="HIDDEN"}(r||(r={}));const c=r,d=class{constructor(o){e(this,o),this.ezModalAction=t(this,"ezModalAction",7),this.modalTitle=void 0,this.modalSubTitle=void 0,this.showTitleBar=!0,this.cancelButtonLabel=void 0,this.okButtonLabel=void 0,this.cancelButtonStatus=void 0,this.okButtonStatus=void 0}async handleEzModalAction(e){var t;(null==e?void 0:e.target)&&(null==e?void 0:e.target)===(null===(t=this._element)||void 0===t?void 0:t.parentElement)&&this.closeModal()}cancelIsVisible(){return this.cancelButtonStatus!==c.HIDDEN&&null!=this.cancelButtonLabel}okIsVisible(){return this.okButtonStatus!==c.HIDDEN&&null!=this.okButtonLabel}componentDidLoad(){window.requestAnimationFrame((()=>{this.ezModalAction.emit(l.LOAD),this._modalRef.focus()})),new n({propagate:!1,element:this._element}).bind("Enter",this.ezModalAction.emit.bind(l.OK)).bind("Escape",(()=>this.closeModal())).bind("Esc",(()=>this.closeModal()))}closeModal(){this.ezModalAction.emit("CLOSE")}focusLast(){null!=this._okButton&&this._okButton.setFocus()}focusFirst(){this._closeButton.focus()}render(){return o(i,null,o("button",{class:"ez-modal-container__focus-ctrl",onFocusin:()=>this.focusLast()}),o("div",{ref:e=>this._modalRef=e,tabIndex:-1},this.showTitleBar&&o("div",{class:"ez-modal-container__header ez-margin-bottom--large"},o("div",{class:"ez-col ez-align--middle ez-modal-container__title"},o("h2",{class:"ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small"},this.modalTitle),this.modalSubTitle&&o("div",{class:"ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small"},this.modalSubTitle)),o("button",{ref:e=>this._closeButton=e,class:"ez-modal-container__close-button",onClick:()=>this.ezModalAction.emit(l.CLOSE)},o("ez-icon",{class:"ez-modal-container__close-icon",size:"medium",iconName:"close"})))),o("div",{class:"ez-modal-container__content"},o("slot",null)),o("div",{class:"ez-modal-container__footer"},this.cancelIsVisible()&&o("ez-button",{label:this.cancelButtonLabel,enabled:this.cancelButtonStatus!==c.DISABLED,onClick:()=>this.ezModalAction.emit(l.CANCEL)}),this.okIsVisible()&&o("ez-button",{ref:e=>this._okButton=e,class:"ez-button--primary",label:this.okButtonLabel,enabled:this.okButtonStatus!==c.DISABLED,onClick:()=>this.ezModalAction.emit(l.OK)})),o("button",{class:"ez-modal-container__focus-ctrl",onFocusin:()=>this.focusFirst()}))}get _element(){return a(this)}};d.style=".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:clip;display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x)}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";export{d as ez_modal_container}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,c as t,h as e,H as s,g as r}from"./p-23a36bb6.js";import{C as o}from"./p-9e11fc7b.js";import{ObjectUtils as a,StringUtils as l,FloatingManager as h,ElementIDUtils as n}from"@sankhyalabs/core";import{A as c}from"./p-2187f86c.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{R as d}from"./p-05e1f4e7.js";const u=class{constructor(e){i(this,e),this.ezChange=t(this,"ezChange",7),this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._textEmptyList="Nenhum resultado encontrado",this._textEmptySearch="Nenhum resultado de {0} encontrado",this._lookupMode=!1,this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._criteria=void 0,this.value=void 0,this.label=void 0,this.enabled=!0,this.errorMessage=void 0,this.optionLoader=void 0,this.showSelectedValue=!0,this.showOptionValue=!0,this.suppressEmptyOption=!1,this.mode="regular",this.canShowError=!0,this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.ignoreLimitCharsToSearch=!1,this.options=void 0,this.suppressSearch=!1}observeErrorMessage(){var i;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(i=this.errorMessage)||void 0===i?void 0:i.trim())||this.setInputValue())}observeValue(i,t){if(this._textInput&&i!=t)try{if("string"===i)return void this.setInputValue();const e=this.getSelectedOption(i),s=this.getSelectedOption(t),r=this.getSelectedOption(this.value);this.isDifferentValues(r,e)&&(this.value=e),this.isDifferentValues(e,s)&&(this.setInputValue(),this._lookupMode||this.ezChange.emit(null===e?void 0:e)),this.resetOptions()}finally{this._lookupMode=!1}}observeOptions(i,t){(null==i?void 0:i.join(""))!==(null==t?void 0:t.join(""))&&this.loadOptions(v.PRELOAD)}async getValueAsync(){return new Promise(this._showLoading?i=>{let t=setInterval((()=>{this._showLoading||(clearInterval(t),i(this.value))}),100)}:i=>i(this.value))}async setFocus(){this._textInput&&this._textInput.setFocus()}async setBlur(){this._textInput&&this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async clearValue(){this.clearSearch()}scrollListener(){var i;null!=this._floatingID&&((null===(i=this.listOptionsPosition)||void 0===i?void 0:i.hardPosition)?this.hideOptions():window.requestAnimationFrame((()=>{this.updateListPosition()})))}updateListPosition(){let{verticalPosition:i,horizontalPosition:t,fromBottom:e,fromRight:s,bottomLimit:r,hardPosition:o}=this.getListPosition();const a=this._listWrapper.getBoundingClientRect(),l=this._listContainer.getBoundingClientRect(),h=this._textInput.getBoundingClientRect(),n=r||window.innerHeight;!e&&(a.top<0||l.bottom+a.height>n)&&(e=!0),o||(i=i||0,t=t||0,e?i=window.innerHeight-h.top+i:i+=l.top,s?t=window.innerWidth-h.right+t:t+=l.left),null!=i&&(this._listWrapper.style[e?"bottom":"top"]=`${i}px`,this._listWrapper.style[e?"top":"bottom"]=""),null!=t&&(this._listWrapper.style[s?"right":"left"]=`${t}px`,this._listWrapper.style[s?"left":"right"]="")}getListPosition(){return this.listOptionsPosition?this.listOptionsPosition:{verticalPosition:this.errorMessage||!this.canShowError||"slim"===this.mode?6:-13}}isDifferentValues(i,t){return a.objectToString(i||{})!==a.objectToString(t||{})}getFormattedText(i){if(null==i)return;let t=this.showSelectedValue&&null!=i.value?`${i.value} - ${i.label}`:i.label;return t=t.replace(new RegExp(this._startHighlightTag,"g"),"").replace(new RegExp(this._endHighlightTag,"g"),""),t}getText(){const i=this.getSelectedOption(this.value),t=this.getFormattedText(i);if(null!=t)return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}getSelectedOption(i){return"string"==typeof i||i instanceof String?this._visibleOptions.find((t=>t.value===i)):i?Object.assign(Object.assign({},i),{value:this.replaceHighlight(null==i?void 0:i.value),label:this.replaceHighlight(null==i?void 0:i.label)}):i}updateVisibleOptions(){let i=this._source||[];this._visibleOptions=this.suppressEmptyOption?i:[{value:void 0,label:""}].concat(i),this._maxWidthValue=this.getMaxWidthValue()}getMaxWidthValue(){var i;const t=[];return null===(i=this._visibleOptions)||void 0===i||i.forEach((i=>{const e=this.getWidthValue(i.value);t.includes(e)||t.push(e)})),t.length>1?Math.max(...t):0}getWidthValue(i){if(null!=this._itemValueBasis){const t=this._itemValueBasis;if(null!=i)return t.innerHTML=i,t.clientWidth>0?t.clientWidth+2:0;t.innerHTML=""}return 0}createOption(i){let{key:t,title:e}=i;const s=new RegExp(this._startHighlightTag,"g"),r=new RegExp(this._endHighlightTag,"g");e=l.decodeHtmlEntities(e);const o={value:null==t?void 0:t.replace(s,"").replace(r,""),label:null==e?void 0:e.replace(s,"").replace(r,"")};this.selectOption(o)}buildItem(i,t){i.label=i.label||i.value;const s={key:i.value,title:i.label,details:i.details};return e("div",{style:{height:"100%"},class:t===this._preSelection?"item preselected":"item",id:`item_${i.value}`,onMouseDown:()=>this.createOption(s),onMouseOver:()=>this._preSelection=t},e("ez-card-item",{item:s}))}showOptions(){this.enabled&&(this.isOptionsVisible()||(this._resizeObserver&&this._resizeObserver.observe(this._textInput),this._floatingID=h.float(this._listWrapper,this._listContainer,{autoClose:!1,isFixed:!0,backClickListener:()=>this.hideOptions()}),this.setFocus(),window.requestAnimationFrame((()=>{this.updateListPosition(),this.listOptionsPosition||this._listWrapper.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}))))}hideOptions(){void 0!==this._floatingID&&h.close(this._floatingID),this._floatingID=void 0,this._resizeObserver&&this._resizeObserver.unobserve(this._textInput)}isOptionsVisible(){return void 0!==this._floatingID&&h.isFloating(this._floatingID)}nextOption(){this.isOptionsVisible()&&(this.showOptions(),this._preSelection=void 0===this._preSelection?0:Math.min(this._preSelection+1,this._visibleOptions.length-1),this.scrollToOption(this._visibleOptions[this._preSelection]))}previousOption(){this._preSelection=void 0===this._preSelection?0:Math.max(this._preSelection-1,0),this.scrollToOption(this._visibleOptions[this._preSelection])}scrollToOption(i){window.requestAnimationFrame((()=>{const t=(null==i?void 0:i.value)?this._optionsList.querySelector(`div#item_${this.replaceHighlight(i.value).replace(/[<>\[\]#=]/g,"\\$&").replace(/:/g,"\\:")}`):void 0;t&&t.scrollIntoView({behavior:"smooth",block:"nearest"})}))}selectCurrentOption(){void 0!==this._preSelection?(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0):this.controlListWithOnlyOne()}updateSource(i){this._startLoading=!1,i instanceof Promise?(this._showLoading=!0,i.then((i=>{this._showLoading=!1,this.updateSource(i)})).catch((()=>this._showLoading=!1)),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(i)?(this._source=i,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1,this.controlEmptySearch())):this.selectOption(i))}clearSource(){this._source=[],this.updateVisibleOptions()}replaceHighlight(i){const t=new RegExp(this._startHighlightTag,"g"),e=new RegExp(this._endHighlightTag,"g");return(null!=i?i:"").replace(t,"").replace(e,"")}selectOption(i){var t,e;const s=this.getSelectedOption(this.value),r=Object.assign(Object.assign({},i),{value:this.replaceHighlight(null==i?void 0:i.value),label:this.replaceHighlight(null==i?void 0:i.label)});(null===(t=null==s?void 0:s.value)||void 0===t?void 0:t.toString())!==(null===(e=null==r?void 0:r.value)||void 0===e?void 0:e.toString())||null==s&&null!=r&&"value"in r?this.value=(null==r?void 0:r.value)?r:void 0:(this.setInputValue(),this.resetOptions()),this._visibleOptions=[],this.clearSource()}loadOptions(i,t=""){this._criteria=t,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:i,argument:t}):this.options)}cancelPreselection(){!this._textInput.value&&this.value?this.selectOption(void 0):window.setTimeout((()=>{this.setInputValue()}),this._deboucingTime),this.resetOptions()}setInputValue(i=!0){const t=this.getText();(this._textInput.value||"")!==t&&(this._textInput.value=t,i&&(this.errorMessage=null))}clearSearch(){this.value=null}controlListWithOnlyOne(){var i,t;const e=null===(i=this._visibleOptions)||void 0===i?void 0:i.filter((i=>""!==i.label&&null!=i.value));if((null==e?void 0:e.length)>0){const i=new RegExp(this._startHighlightTag,"g"),s=new RegExp(this._endHighlightTag,"g");let r=l.decodeHtmlEntities(e[0].label);const o={value:null===(t=e[0].value)||void 0===t?void 0:t.replace(i,"").replace(s,""),label:null==r?void 0:r.replace(i,"").replace(s,"")};this.selectOption(o)}}controlEmptySearch(){var i;(null===(i=this._visibleOptions)||void 0===i?void 0:i.length)?this.controlListWithOnlyOne():(this.clearSearch(),c.info(this._textEmptyList))}validateDescriptionValue(){if(l.isEmpty(this.value))return;let i=this.value;"object"!=typeof i&&(l.isEmpty(i)||this.loadDescriptionValue(i))}async loadDescriptionValue(i){var t,e;if(null==i)return;if((null===(t=this.options)||void 0===t?void 0:t.length)>0)return void this.loadOptionValue(i);const s={mode:v.PREDICTIVE,argument:i},r=await(null===(e=this.optionLoader)||void 0===e?void 0:e.call(this,s));null!=r&&(r instanceof Promise?r.then((i=>{this.setDescriptionValue(i)})):this.setDescriptionValue(r))}setDescriptionValue(i){const t=(null==i?void 0:i[0])||i;null!=t&&Object.keys(t).length?(this._lookupMode=!0,this.value=t?Object.assign(Object.assign({},t),{value:this.replaceHighlight(t.value),label:this.replaceHighlight(t.label)}):t):this.showNoResultMessage()}loadOptionValue(i){var t;const e=null===(t=this.options)||void 0===t?void 0:t.find((t=>t.value===i));null!=e?this.selectOption(e):this.showNoResultMessage()}async showNoResultMessage(){this.clearSearch(),c.info(this._textEmptySearch.replace("{0}",this.getFieldLabel()))}getFieldLabel(){var i;return null===(i=this.label)||void 0===i?void 0:i.replace(d,"").toUpperCase()}resetOptions(){this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}componentWillLoad(){if(void 0===this.options){this.options=[];const i=this.el.querySelectorAll("option");i&&i.forEach((i=>{let t=i.innerText,e=i.getAttribute("value"),s=i.getAttribute("details");e||(e=t),this.options.push({label:t,value:e,details:s}),i.hidden=!0}))}this.updateSource([])}componentDidRender(){var i;void 0===this._floatingID&&this._listWrapper.remove(),null===(i=this._optionsList)||void 0===i||i.querySelectorAll(".item").forEach((i=>{n.addIDInfoIfNotExists(i,"itemSearch")})),this.validateDescriptionValue()}componentDidLoad(){o.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1),this._resizeObserver=new ResizeObserver((i=>{window.requestAnimationFrame((()=>{if(!Array.isArray(i)||!i.length)return;const{clientWidth:t}=this._listContainer;t>0&&this._listWrapper&&(this._listWrapper.style.width=`${t}px`)}))}))}handlerIconClick(){this.loadOptions(v.ADVANCED)}buildNumberArgument(i){return this.isTextSearch?NaN:Number(i||void 0)}onTextInputChangeHandler(i){var t;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(i)}),this._deboucingTime));const e=null===(t=i.target.value)||void 0===t?void 0:t.trim(),s=this.buildNumberArgument(e);this._criteria||(this._textInput.value=i.data||e),this._criteria=e,e?(this._showLoading=!1,this.clearSource(),!isNaN(s)||e.length>=this._limitCharsToSearch?(this._showLoading=!0,this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions(v.PREDICTIVE,isNaN(s)?e:s.toString())}),this._deboucingTime),this.showOptions()):this.hideOptions()):(this.hideOptions(),this._showLoading=!1,this.clearSource())}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}keyDownHandler(i){switch(this._tabPressed=!1,i.ctrlKey&&("f"!==i.key&&"F"!==i.key||(this.loadOptions(v.ADVANCED),i.stopPropagation(),i.stopImmediatePropagation(),i.preventDefault())),i.key){case"ArrowDown":this.nextOption(),i.stopPropagation();break;case"ArrowUp":this.previousOption(),i.stopPropagation();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.cancelPreselection();break;case"Tab":this._tabPressed=!0,this.controlListWithOnlyOne()}}onTextInputFocusOutHandler(){this.hideErrorOnFocusOut&&this.cancelPreselection()}canShowListOptions(){return!this._showLoading&&this._visibleOptions.length>0}render(){var i;return n.addIDInfoIfNotExists(this.el,"input"),e(s,null,e("ez-text-input",{"data-element-id":n.getInternalIDInfo("textInput"),class:this.suppressSearch?"suppressed-search-input":"",ref:i=>this._textInput=i,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:i=>this.onTextInputChangeHandler(i),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:i=>this.keyDownHandler(i),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode},e("button",{class:"btn",slot:"leftIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},e("ez-icon",{iconName:"search"})),(null===(i=this._textInput)||void 0===i?void 0:i.value)&&(this._criteria||this.value)?e("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},e("ez-icon",{iconName:"close"})):void 0),e("section",{class:"list-container",ref:i=>this._listContainer=i},e("div",{class:"list-wrapper",ref:i=>this._listWrapper=i},e("ul",{class:"list-options",ref:i=>this._optionsList=i},!this._showLoading&&0===this._visibleOptions.length&&e("div",{class:"message"},e("span",{class:"message__no-result"},this._textEmptyList)),this._showLoading&&e("div",{class:"message"},e("div",{class:"message__loading"})),e("span",{class:"item__value item__value--hidden",ref:i=>this._itemValueBasis=i}),this.canShowListOptions()&&this._visibleOptions.map(((i,t)=>this.buildItem(i,t)))))))}get el(){return r(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"],options:["observeOptions"]}}};var v;!function(i){i.ADVANCED="ADVANCED",i.PRELOAD="PRELOAD",i.PREDICTIVE="PREDICTIVE"}(v||(v={})),u.style=":host{--ez-search--height:42px;--ez-search--width:100%;--ez-search__icon--width:48px;--ez-search--border-radius:var(--border--radius-medium, 12px);--ez-search--border-radius-small:var(--border--radius-small, 6px);--ez-search--font-size:var(--text--medium, 14px);--ez-search--font-family:var(--font-pattern, Arial);--ez-search--font-weight--large:var(--text-weight--large, 500);--ez-search--font-weight--medium:var(--text-weight--medium, 400);--ez-search--background-color--xlight:var(--background--xlight, #fff);--ez-search--background-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px);--ez-search__input--background-color:var(--background--medium, #e0e0e0);--ez-search__input--border:var(--border--medium, 2px solid);--ez-search__input--border-color:var(--ez-search__input--background-color);--ez-search__input--focus--border-color:var(--color--primary, #008561);--ez-search__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-search__input--disabled--color:var(--text--disable, #AFB6C0);--ez-search__input--error--border-color:#CC2936;--ez-search__btn--color:var(--title--primary, #2B3A54);--ez-search__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-search__btn-hover--color:var(--color--primary, #4e4e4e);--ez-search__label--color:var(--title--primary, #2B3A54);--ez-search__list-title--primary:var(--title--primary, #2B3A54);--ez-search__list-text--primary:var(--text--primary, #626e82);--ez-search__list-height:calc(var(--ez-search--font-size) + var(--ez-search--space--medium) + 4px);--ez-search__list-min-width:64px;--ez-search--space--medium:var(--space--medium, 12px);--ez-search--space--small:var(--space--small, 6px);--ez-search__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-search__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-search__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-search__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-search__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-search__scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-search--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{min-width:var(--ez-search__list-min-width);overflow:auto;position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:0;z-index:var(--more-visible, 2);max-height:350px;min-width:150px;background-color:var(--ez-search--background-color--xlight);border-radius:var(--ez-search--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);padding:var(--ez-search--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;padding:0;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-search__scrollbar--color-background);width:var(--ez-search__scrollbar--width);max-width:var(--ez-search__scrollbar--width);min-width:var(--ez-search__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-search__scrollbar--color-background);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-search__scrollbar--color-default);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-search__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-search__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-search--border-radius-small);padding:var(--ez-search--space--small);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size);line-height:var(--ez-search--line-height)}.item__label{font-weight:var(--ez-search--font-weight--medium)}.item__label--bold{font-weight:var(--ez-search--font-weight--large)}.item__value{text-align:center;color:var(--ez-search__list-text--primary);font-weight:var(--ez-search--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-search__list-height)}.message__no-result{color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-search__list-title--primary);border-top:3px solid transparent}.item__list>li:hover{background-color:var(--ez-search--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-search__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-search__btn-disabled--color)}.btn:disabled:hover{cursor:unset;color:var(--ez-search__btn-disabled--color)}.btn:hover{color:var(--ez-search__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{u as ez_search}
|