@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-74406.0 → 0.0.0-bugfix-dev-KB-75940.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item_2.cjs.entry.js +1416 -7
- package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +32 -11
- package/dist/cjs/ez-date-input.cjs.entry.js +4 -17
- package/dist/cjs/ez-date-time-input.cjs.entry.js +4 -16
- package/dist/cjs/ez-list.cjs.entry.js +2 -2
- package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover-plus_3.cjs.entry.js +195 -0
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +28 -158
- package/dist/cjs/ez-split-item.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/searchFormatters-b7e1ed1e.js +23 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/ez-button/ez-button.css +1 -1
- package/dist/collection/components/ez-card-item/ez-card-item.css +1 -3
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js +33 -12
- package/dist/collection/components/ez-date-input/ez-date-input.js +4 -17
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +4 -16
- package/dist/collection/components/ez-list/ez-list.js +2 -2
- package/dist/collection/components/ez-modal/ez-modal.js +1 -1
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +49 -14
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css +2 -2
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js +72 -12
- package/dist/collection/components/ez-popup/ez-popup.js +1 -1
- package/dist/collection/components/ez-search/ez-search.css +0 -219
- package/dist/collection/components/ez-search/ez-search.js +28 -167
- package/dist/collection/components/ez-search/subcomponent/search-list/search-list.css +227 -0
- package/dist/collection/components/ez-search/subcomponent/search-list/search-list.js +289 -0
- package/dist/collection/components/ez-search/utils/searchFormatters.js +18 -0
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +1 -1
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +214 -229
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-card-item_2.entry.js +1416 -7
- package/dist/esm/ez-combo-box-list_3.entry.js +32 -11
- package/dist/esm/ez-date-input.entry.js +4 -17
- package/dist/esm/ez-date-time-input.entry.js +4 -16
- package/dist/esm/ez-list.entry.js +2 -2
- package/dist/esm/ez-modal-container.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-popover-plus_3.entry.js +189 -0
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +29 -159
- package/dist/esm/ez-split-item.entry.js +1 -1
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/index-baa5e267.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/searchFormatters-8229207e.js +20 -0
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-0bffeffc.entry.js +1 -0
- package/dist/ezui/p-23b6128c.entry.js +1 -0
- package/dist/ezui/p-248d4f54.entry.js +1 -0
- package/dist/ezui/p-2872fd16.entry.js +1 -0
- package/dist/ezui/p-40a60148.js +1 -0
- package/dist/ezui/p-4e0628a7.entry.js +1 -0
- package/dist/ezui/p-788467fe.entry.js +1 -0
- package/dist/ezui/p-84b1c99e.entry.js +1 -0
- package/dist/ezui/p-b7706b43.entry.js +1 -0
- package/dist/ezui/p-c297aa52.entry.js +1 -0
- package/dist/ezui/p-d2bc2f06.entry.js +1 -0
- package/dist/ezui/p-dcf3c8e5.entry.js +1 -0
- package/dist/ezui/p-e5c3ed19.entry.js +1 -0
- package/dist/types/components/ez-calendar/ez-calendar.d.ts +3 -3
- package/dist/types/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.d.ts +1 -1
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +2 -2
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +2 -2
- package/dist/types/components/ez-popover-plus/ez-popover-plus.d.ts +9 -4
- package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +12 -2
- package/dist/types/components/ez-search/ez-search.d.ts +3 -13
- package/dist/types/components/ez-search/subcomponent/search-list/search-list.d.ts +23 -0
- package/dist/types/components/ez-search/utils/searchFormatters.d.ts +2 -0
- package/dist/types/components.d.ts +73 -5
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/ez-popover-core_2.cjs.entry.js +0 -1504
- package/dist/esm/ez-popover-core_2.entry.js +0 -1499
- package/dist/ezui/p-0faf71c5.entry.js +0 -1
- package/dist/ezui/p-15134d97.entry.js +0 -1
- package/dist/ezui/p-17eabf46.entry.js +0 -1
- package/dist/ezui/p-1ad6c61b.entry.js +0 -1
- package/dist/ezui/p-2bb2a0c4.entry.js +0 -1
- package/dist/ezui/p-3195a7a7.entry.js +0 -1
- package/dist/ezui/p-3429080c.entry.js +0 -1
- package/dist/ezui/p-58783dcf.entry.js +0 -1
- package/dist/ezui/p-65f471bc.entry.js +0 -1
- package/dist/ezui/p-7bd15498.entry.js +0 -1
- package/dist/ezui/p-cb1535f7.entry.js +0 -1
- package/dist/ezui/p-d9548bdf.entry.js +0 -1
|
@@ -28,15 +28,29 @@ const EzComboBoxList = class {
|
|
|
28
28
|
* Move a seleção para a próxima opção na lista.
|
|
29
29
|
*/
|
|
30
30
|
async nextOption() {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
var _a, _b;
|
|
32
|
+
if (!((_a = this.visibleOptions) === null || _a === void 0 ? void 0 : _a.length))
|
|
33
|
+
return;
|
|
34
|
+
const isAtLastOption = this.preSelection !== undefined && this.preSelection >= this.visibleOptions.length - 1;
|
|
35
|
+
if (!isAtLastOption) {
|
|
36
|
+
this.preSelection = this.preSelection === undefined ? 0 : this.preSelection + 1;
|
|
37
|
+
this.scrollToOption(this.visibleOptions[this.preSelection]);
|
|
38
|
+
(_b = this.onOptionHover) === null || _b === void 0 ? void 0 : _b.call(this, this.preSelection);
|
|
39
|
+
}
|
|
33
40
|
}
|
|
34
41
|
/**
|
|
35
|
-
* Move a seleção para a opção anterior na lista.
|
|
42
|
+
* Move a seleção para a opção anterior na lista, sem ultrapassar o início.
|
|
36
43
|
*/
|
|
37
44
|
async previousOption() {
|
|
38
|
-
|
|
39
|
-
|
|
45
|
+
var _a, _b;
|
|
46
|
+
if (!((_a = this.visibleOptions) === null || _a === void 0 ? void 0 : _a.length))
|
|
47
|
+
return;
|
|
48
|
+
const isAtFirstOption = this.preSelection !== undefined && this.preSelection <= 0;
|
|
49
|
+
if (!isAtFirstOption) {
|
|
50
|
+
this.preSelection = this.preSelection === undefined ? this.visibleOptions.length - 1 : this.preSelection - 1;
|
|
51
|
+
this.scrollToOption(this.visibleOptions[this.preSelection]);
|
|
52
|
+
(_b = this.onOptionHover) === null || _b === void 0 ? void 0 : _b.call(this, this.preSelection);
|
|
53
|
+
}
|
|
40
54
|
}
|
|
41
55
|
/**
|
|
42
56
|
* Seleciona a opção atualmente pré-selecionada.
|
|
@@ -106,16 +120,23 @@ const EzComboBoxList = class {
|
|
|
106
120
|
buildItem(opt, index$1) {
|
|
107
121
|
const widthValue = this.showOptionValue && this.maxWidth > 0 ? `${this.maxWidth}px` : '';
|
|
108
122
|
opt.label = opt.label || opt.value;
|
|
109
|
-
return index.h("li", { class: index$1 === this.preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.onOptionSelect(opt), onMouseOver: () => this.preSelection = index$1 }, this.showOptionValue
|
|
123
|
+
return index.h("li", { tabIndex: 1, class: index$1 === this.preSelection ? "item preselected" : "item", id: `item_${opt.value}_${index$1}`, key: `item_${opt.value}_${index$1}`, onMouseDown: () => this.onOptionSelect(opt), onMouseOver: () => this.preSelection = index$1 }, this.showOptionValue
|
|
110
124
|
? index.h("span", { class: "item__value", title: opt.value, style: { width: widthValue, minWidth: widthValue, maxWidth: widthValue } }, opt.value)
|
|
111
125
|
: undefined, index.h("span", { class: "item__label " + (this.showOptionValue ? "item__label--bold" : ""), title: opt.label }, opt.label));
|
|
112
126
|
}
|
|
113
127
|
scrollToOption(opt) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
128
|
+
if (!(opt === null || opt === void 0 ? void 0 : opt.value) || !this._optionsList)
|
|
129
|
+
return;
|
|
130
|
+
const index = this.visibleOptions.indexOf(opt);
|
|
131
|
+
if (index === -1)
|
|
132
|
+
return;
|
|
133
|
+
const liElem = this._optionsList.querySelector(`li#item_${CSS.escape(opt.value)}_${CSS.escape(String(index))}`);
|
|
134
|
+
if (liElem) {
|
|
135
|
+
liElem.scrollIntoView({
|
|
136
|
+
behavior: "smooth",
|
|
137
|
+
block: "nearest"
|
|
138
|
+
});
|
|
139
|
+
}
|
|
119
140
|
}
|
|
120
141
|
componentDidLoad() {
|
|
121
142
|
this._listWrapper.style.width = `${this.width}px`;
|
|
@@ -97,22 +97,9 @@ const EzDateInput = class {
|
|
|
97
97
|
this._changePending = false;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
showCalendar() {
|
|
101
|
-
this.handleBlur();
|
|
102
|
-
this._calendar.value = this.value;
|
|
103
|
-
let top;
|
|
104
|
-
if (this.isFixed()) {
|
|
105
|
-
top = 29;
|
|
106
|
-
this._calendar.fitHorizontal(0);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
top = this.errorMessage || this.mode === "slim" ? 6 : -13;
|
|
110
|
-
}
|
|
111
|
-
this._calendar.fitVertical(top, this._elem.clientHeight);
|
|
112
|
-
}
|
|
113
100
|
hideCalendar() {
|
|
114
101
|
this.changeValue(this._calendar.value);
|
|
115
|
-
this.
|
|
102
|
+
this._popover.hide();
|
|
116
103
|
}
|
|
117
104
|
handleBlur() {
|
|
118
105
|
if (!this._changePending) {
|
|
@@ -173,8 +160,8 @@ const EzDateInput = class {
|
|
|
173
160
|
this._textInput.value = textValue;
|
|
174
161
|
}
|
|
175
162
|
}
|
|
176
|
-
|
|
177
|
-
|
|
163
|
+
disconnectedCallback() {
|
|
164
|
+
this.hideCalendar();
|
|
178
165
|
}
|
|
179
166
|
componentDidLoad() {
|
|
180
167
|
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
@@ -187,7 +174,7 @@ const EzDateInput = class {
|
|
|
187
174
|
}
|
|
188
175
|
render() {
|
|
189
176
|
core.ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
190
|
-
return (index.h(index.Host, null, index.h("ez-text-input", { "data-element-id": core.ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, onBlur: () => this.handleBlur(), onInput: (evt) => this.handleInput(evt), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, canShowError: this.canShowError }, index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.
|
|
177
|
+
return (index.h(index.Host, null, index.h("ez-text-input", { "data-element-id": core.ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, onBlur: () => this.handleBlur(), onInput: (evt) => this.handleInput(evt), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, canShowError: this.canShowError }, index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => { var _a; return (_a = this._popover) === null || _a === void 0 ? void 0 : _a.showUnder(this._textInput); }, slot: "leftIcon" })), index.h("ez-popover-plus", { ref: elem => this._popover = elem, anchorElement: this._textInput, autoClose: true, boxWidth: 'fit-content', overlayType: 'none' }, index.h("ez-calendar", { ref: elem => this._calendar = elem, "data-element-id": core.ElementIDUtils.getInternalIDInfo("calendar"), onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); } }))));
|
|
191
178
|
}
|
|
192
179
|
get _elem() { return index.getElement(this); }
|
|
193
180
|
static get watchers() { return {
|
|
@@ -131,21 +131,9 @@ const EzDateTimeInput = class {
|
|
|
131
131
|
this.value = newValueValidated;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
showCalendar() {
|
|
135
|
-
let top;
|
|
136
|
-
if (this.isFixed()) {
|
|
137
|
-
top = 29;
|
|
138
|
-
this._calendar.fitHorizontal(0);
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
top = this.errorMessage || this.mode === "slim" ? 6 : -13;
|
|
142
|
-
}
|
|
143
|
-
this._calendar.fitVertical(top, this._elem.clientHeight);
|
|
144
|
-
this._calendar.style.visibility = 'inherit';
|
|
145
|
-
}
|
|
146
134
|
hideCalendar() {
|
|
147
135
|
this.changeValue(this._calendar.value);
|
|
148
|
-
this.
|
|
136
|
+
this._popover.hide();
|
|
149
137
|
}
|
|
150
138
|
getParsedDateTime(strValue) {
|
|
151
139
|
var _a, _b;
|
|
@@ -223,8 +211,8 @@ const EzDateTimeInput = class {
|
|
|
223
211
|
this._textInput.value = textValue;
|
|
224
212
|
}
|
|
225
213
|
}
|
|
226
|
-
|
|
227
|
-
|
|
214
|
+
disconnectedCallback() {
|
|
215
|
+
this.hideCalendar();
|
|
228
216
|
}
|
|
229
217
|
componentDidLoad() {
|
|
230
218
|
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
@@ -237,7 +225,7 @@ const EzDateTimeInput = class {
|
|
|
237
225
|
}
|
|
238
226
|
render() {
|
|
239
227
|
core.ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
240
|
-
return (index.h(index.Host, null, index.h("ez-text-input", { "data-element-id": core.ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, restrict: "0123456789/: ", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, onKeyDown: event => { this.handleKeyDown(event); }, onBlur: () => this.handleBlur(), onInput: (evt) => this.handleInput(evt), onFocus: () => this.handleFocus(), onClick: () => this.handleClick(), canShowError: this.canShowError }, index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.
|
|
228
|
+
return (index.h(index.Host, null, index.h("ez-text-input", { "data-element-id": core.ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, restrict: "0123456789/: ", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, onKeyDown: event => { this.handleKeyDown(event); }, onBlur: () => this.handleBlur(), onInput: (evt) => this.handleInput(evt), onFocus: () => this.handleFocus(), onClick: () => this.handleClick(), canShowError: this.canShowError }, index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => { var _a; return (_a = this._popover) === null || _a === void 0 ? void 0 : _a.showUnder(this._textInput); }, slot: "leftIcon" })), index.h("ez-popover-plus", { ref: elem => this._popover = elem, anchorElement: this._textInput, autoClose: true, boxWidth: 'fit-content', overlayType: 'none' }, index.h("ez-calendar", { ref: elem => this._calendar = elem, "data-element-id": core.ElementIDUtils.getInternalIDInfo("calendar"), onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); }, time: true, showSeconds: this.showSeconds }))));
|
|
241
229
|
}
|
|
242
230
|
get _elem() { return index.getElement(this); }
|
|
243
231
|
static get watchers() { return {
|
|
@@ -589,7 +589,7 @@ const EzList = class {
|
|
|
589
589
|
return { id: item.id, label: item.label, check: evt.detail };
|
|
590
590
|
}
|
|
591
591
|
renderListWithGroups() {
|
|
592
|
-
return index.h("div", { class: 'group-container', ref: el => (this._groupContainer = el), tabIndex: 0, onKeyDown: event => this.keyDownHandler(event) }, this._listGroupItems.map(group => {
|
|
592
|
+
return index.h("div", { class: 'group-container', ref: el => (this._groupContainer = el), tabIndex: this.ezSelectable ? 0 : undefined, onKeyDown: event => this.keyDownHandler(event) }, this._listGroupItems.map(group => {
|
|
593
593
|
return (index.h("div", { id: this.getDivGroupId(group.group), class: 'group', key: group.group + group.items.length, onDrop: () => this.onDropGroup(group) }, index.h("label", { draggable: false, class: 'group-name', title: group.group }, group.group), index.h("section", { class: 'section-container', onDragOver: ev => ev.preventDefault() }, index.h("div", { class: 'group-items-container' }, index.h("div", { class: 'draggable-list' }, group.items.map((item, index$1) => (index.h("li", Object.assign({ id: 'item_' + item.id, class: {
|
|
594
594
|
'selectable-container': this.ezSelectable,
|
|
595
595
|
'hover-feedback': this.hoverFeedback,
|
|
@@ -599,7 +599,7 @@ const EzList = class {
|
|
|
599
599
|
}));
|
|
600
600
|
}
|
|
601
601
|
renderList() {
|
|
602
|
-
return index.h("div", { class: 'items-container', ref: el => (this._itemContainer = el), tabIndex: 0, onKeyDown: event => {
|
|
602
|
+
return index.h("div", { class: 'items-container', ref: el => (this._itemContainer = el), tabIndex: this.ezSelectable ? 0 : undefined, onKeyDown: event => {
|
|
603
603
|
this.keyDownHandler(event);
|
|
604
604
|
} }, index.h("div", { class: 'draggable-list' }, this._listItems.map((item, index$1) => (index.h("li", Object.assign({ id: 'item_' + item.id, class: {
|
|
605
605
|
'selectable-container': this.ezSelectable,
|
|
@@ -72,7 +72,7 @@ const EzModalContainer = class {
|
|
|
72
72
|
this._closeButton.focus();
|
|
73
73
|
}
|
|
74
74
|
render() {
|
|
75
|
-
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--medium" }, 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))), (this.showCloseButton && 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
|
+
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--medium" }, 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))), (this.showCloseButton && 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", { tabIndex: -1, class: "ez-modal-container__content" }, index.h("slot", null)), index.h("div", { tabIndex: -1, 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() })));
|
|
76
76
|
}
|
|
77
77
|
get _element() { return index.getElement(this); }
|
|
78
78
|
};
|
|
@@ -36,7 +36,7 @@ const EzModal = class {
|
|
|
36
36
|
}
|
|
37
37
|
componentDidLoad() {
|
|
38
38
|
this.observeOpened();
|
|
39
|
-
new core.KeyboardManager({ propagate: false, element: this._element })
|
|
39
|
+
new core.KeyboardManager({ propagate: false, element: this._element, enableShadowDom: true })
|
|
40
40
|
.bind("Enter", this.ezModalAction.emit.bind("OK"))
|
|
41
41
|
.bind("Escape", () => this.closeModal())
|
|
42
42
|
.bind("Esc", () => this.closeModal());
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-a7b0c73d.js');
|
|
6
|
+
const core = require('@sankhyalabs/core');
|
|
7
|
+
const searchFormatters = require('./searchFormatters-b7e1ed1e.js');
|
|
8
|
+
|
|
9
|
+
const ezPopoverPlusCss = ":host{display:none}";
|
|
10
|
+
|
|
11
|
+
const EzPopoverPlus = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.ezVisibilityChange = index.createEvent(this, "ezVisibilityChange", 7);
|
|
15
|
+
this.autoClose = true;
|
|
16
|
+
this.boxWidth = "fit-content";
|
|
17
|
+
this.opened = false;
|
|
18
|
+
this.overlayType = "light";
|
|
19
|
+
this.anchorElement = undefined;
|
|
20
|
+
this.options = { horizontalGap: 0, verticalGap: 0, fromRight: false };
|
|
21
|
+
this.useAnchorSize = false;
|
|
22
|
+
this.minWidth = 150;
|
|
23
|
+
}
|
|
24
|
+
async observeOpened(newValue) {
|
|
25
|
+
if (newValue && !this._popOverCore) {
|
|
26
|
+
this.renderPopoverCore();
|
|
27
|
+
}
|
|
28
|
+
this._popOverCore.opened = newValue;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Atualiza a posição do popover.
|
|
32
|
+
*/
|
|
33
|
+
async updatePosition(top, left) {
|
|
34
|
+
var _a;
|
|
35
|
+
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.updatePosition(top, left));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Exibe o ez-popover.
|
|
39
|
+
*/
|
|
40
|
+
async show(top, left) {
|
|
41
|
+
if (!this._popOverCore) {
|
|
42
|
+
this.renderPopoverCore();
|
|
43
|
+
}
|
|
44
|
+
await this._popOverCore.show(top, left);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Ancora a exibição do popOver a um elemento HTML.
|
|
48
|
+
*/
|
|
49
|
+
async showUnder(element, options) {
|
|
50
|
+
if (!this._popOverCore) {
|
|
51
|
+
this.renderPopoverCore();
|
|
52
|
+
}
|
|
53
|
+
await this._popOverCore.showUnder(element, options);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Oculta o ez-popover.
|
|
57
|
+
*/
|
|
58
|
+
async hide() {
|
|
59
|
+
var _a;
|
|
60
|
+
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.hide());
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Altera as opções.
|
|
64
|
+
*/
|
|
65
|
+
async setOptions(options) {
|
|
66
|
+
var _a;
|
|
67
|
+
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.setOptions(options));
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Altera o elemento de ancoragem.
|
|
71
|
+
*/
|
|
72
|
+
async setAnchorElement(anchor) {
|
|
73
|
+
var _a;
|
|
74
|
+
await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.setAnchorElement(anchor));
|
|
75
|
+
}
|
|
76
|
+
renderPopoverCore() {
|
|
77
|
+
this._popOverCore = document.createElement('ez-popover-core');
|
|
78
|
+
this._popOverCore.opened = this.opened;
|
|
79
|
+
this._popOverCore.anchorElement = this.anchorElement;
|
|
80
|
+
this._popOverCore.autoClose = this.autoClose;
|
|
81
|
+
this._popOverCore.boxWidth = this.boxWidth;
|
|
82
|
+
this._popOverCore.overlayType = this.overlayType;
|
|
83
|
+
this._popOverCore.options = this.options;
|
|
84
|
+
this._popOverCore.useAnchorSize = this.useAnchorSize;
|
|
85
|
+
this._popOverCore.minWidth = this.minWidth;
|
|
86
|
+
this._popOverCore.addEventListener('ezVisibilityChange', ({ detail }) => {
|
|
87
|
+
this.ezVisibilityChange.emit(detail);
|
|
88
|
+
this.opened = detail;
|
|
89
|
+
});
|
|
90
|
+
const firstChild = this._host.children.item(0);
|
|
91
|
+
if (firstChild) {
|
|
92
|
+
this._popOverCore.appendChild(firstChild);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
console.warn('O slot do popover está vazio. Adicione conteúdo ao slot para exibição correta.');
|
|
96
|
+
}
|
|
97
|
+
document.body.appendChild(this._popOverCore);
|
|
98
|
+
}
|
|
99
|
+
render() {
|
|
100
|
+
return (index.h(index.Host, null, index.h("slot", null)));
|
|
101
|
+
}
|
|
102
|
+
get _host() { return index.getElement(this); }
|
|
103
|
+
static get watchers() { return {
|
|
104
|
+
"opened": ["observeOpened"]
|
|
105
|
+
}; }
|
|
106
|
+
};
|
|
107
|
+
EzPopoverPlus.style = ezPopoverPlusCss;
|
|
108
|
+
|
|
109
|
+
const multiSelectionBoxMessageCss = ".multi-selection__message{display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;min-height:320px;text-align:center}.multi-selection__text-message{margin-top:-30px;font-family:var(--font-pattern);font-size:var(--text--meduim);padding:var(--space-xs);color:var(--text--primary)}";
|
|
110
|
+
|
|
111
|
+
const MultiSelectionBoxMessage = class {
|
|
112
|
+
constructor(hostRef) {
|
|
113
|
+
index.registerInstance(this, hostRef);
|
|
114
|
+
this.message = undefined;
|
|
115
|
+
}
|
|
116
|
+
render() {
|
|
117
|
+
return (index.h("div", { class: "multi-selection__message" }, index.h("span", { class: "multi-selection__text-message" }, this.message)));
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
MultiSelectionBoxMessage.style = multiSelectionBoxMessageCss;
|
|
121
|
+
|
|
122
|
+
const searchListCss = ":host{--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__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--small, 6px);--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-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px)}.list-options{position:relative;z-index:var(--more-visible, 2);margin:var(--space--small) 0px;padding:0px;padding-inline-start:0px;box-sizing:border-box;width:100%;height:100%;max-height:350px;min-width:150px;display:flex;flex-direction:column;scroll-behavior:smooth;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--scrollbar--background);width:var(--space--small);max-width:var(--space--small);min-width:var(--space--small);height:var(--space--small);max-height:var(--space--small);min-height:var(--space--small)}.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)}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;margin:var(--space--medium) 0px;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__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}.item__list>li:hover{background-color:var(--ez-search--background-medium)}.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);gap:var(--space--small, 6px)}.preselected{background-color:var(--background--medium)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@supports not (scrollbar-width: thin){.item{padding-right:8px}}";
|
|
123
|
+
|
|
124
|
+
const SearchList = class {
|
|
125
|
+
constructor(hostRef) {
|
|
126
|
+
index.registerInstance(this, hostRef);
|
|
127
|
+
this.changeValue = index.createEvent(this, "changeValue", 7);
|
|
128
|
+
this.changePreSelection = index.createEvent(this, "changePreSelection", 7);
|
|
129
|
+
this._startHighlightTag = "<span class='card-item__highlight'>";
|
|
130
|
+
this._endHighlightTag = "</span>";
|
|
131
|
+
this.showLoading = undefined;
|
|
132
|
+
this.visibleOptions = [];
|
|
133
|
+
this.textEmptyList = undefined;
|
|
134
|
+
this.canShowListOptions = undefined;
|
|
135
|
+
this.value = undefined;
|
|
136
|
+
this.showOptionValue = true;
|
|
137
|
+
this.preSelection = undefined;
|
|
138
|
+
}
|
|
139
|
+
async nextOption() {
|
|
140
|
+
const newPreSelection = this.preSelection === undefined ? 0 : Math.min(this.preSelection + 1, this.visibleOptions.length - 1);
|
|
141
|
+
this.changePreSelection.emit(newPreSelection);
|
|
142
|
+
this.scrollToOption(this.visibleOptions[newPreSelection]);
|
|
143
|
+
}
|
|
144
|
+
async previousOption() {
|
|
145
|
+
const newPreSelection = this.preSelection === undefined ? 0 : Math.max(this.preSelection - 1, 0);
|
|
146
|
+
this.changePreSelection.emit(newPreSelection);
|
|
147
|
+
this.scrollToOption(this.visibleOptions[newPreSelection]);
|
|
148
|
+
}
|
|
149
|
+
selectOption(newOption) {
|
|
150
|
+
const newOptionsReplaced = Object.assign(Object.assign({}, newOption), { value: searchFormatters.replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.value), label: searchFormatters.replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.label) });
|
|
151
|
+
const newOptionsFormatted = Object.assign(Object.assign({}, newOptionsReplaced), { value: searchFormatters.replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value), label: searchFormatters.replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.label) });
|
|
152
|
+
this.changeValue.emit(newOptionsFormatted);
|
|
153
|
+
}
|
|
154
|
+
createOption(detail) {
|
|
155
|
+
let { key, title } = detail;
|
|
156
|
+
const startHighlight = new RegExp(this._startHighlightTag, 'g');
|
|
157
|
+
const endHighlight = new RegExp(this._endHighlightTag, 'g');
|
|
158
|
+
title = core.StringUtils.decodeHtmlEntities(title);
|
|
159
|
+
const option = {
|
|
160
|
+
value: key === null || key === void 0 ? void 0 : key.replace(startHighlight, '').replace(endHighlight, ''),
|
|
161
|
+
label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
|
|
162
|
+
};
|
|
163
|
+
this.selectOption(option);
|
|
164
|
+
}
|
|
165
|
+
scrollToOption(opt) {
|
|
166
|
+
window.requestAnimationFrame(() => {
|
|
167
|
+
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
168
|
+
? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
|
|
169
|
+
: undefined;
|
|
170
|
+
if (liElem) {
|
|
171
|
+
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
buildItem(opt, index$1) {
|
|
176
|
+
opt.label = opt.label || opt.value;
|
|
177
|
+
const card = {
|
|
178
|
+
key: opt.value,
|
|
179
|
+
title: opt.label,
|
|
180
|
+
details: opt.details
|
|
181
|
+
};
|
|
182
|
+
return index.h("div", { style: { "height": "100%" }, class: index$1 === this.preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.createOption(card), onMouseOver: () => this.changePreSelection.emit(index$1) }, index.h("ez-card-item", { item: card, compacted: true, enableKey: this.showOptionValue }));
|
|
183
|
+
}
|
|
184
|
+
render() {
|
|
185
|
+
return (index.h(index.Host, null, index.h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this.showLoading
|
|
186
|
+
&& this.visibleOptions.length === 0
|
|
187
|
+
&& index.h("div", { class: "message" }, index.h("span", { class: "message__no-result" }, this.textEmptyList)), this.showLoading
|
|
188
|
+
&& index.h("div", { class: "message" }, index.h("div", { class: "message__loading" })), this.canShowListOptions && this.visibleOptions.map((opt, index) => this.buildItem(opt, index)))));
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
SearchList.style = searchListCss;
|
|
192
|
+
|
|
193
|
+
exports.ez_popover_plus = EzPopoverPlus;
|
|
194
|
+
exports.multi_selection_box_message = MultiSelectionBoxMessage;
|
|
195
|
+
exports.search_list = SearchList;
|
|
@@ -35,7 +35,7 @@ const EzPopup = class {
|
|
|
35
35
|
if (this.opened && this._popupRef) {
|
|
36
36
|
this._popupRef.focus();
|
|
37
37
|
}
|
|
38
|
-
new core.KeyboardManager({ propagate: false, element: this._element })
|
|
38
|
+
new core.KeyboardManager({ propagate: false, element: this._element, enableShadowDom: true })
|
|
39
39
|
.bind("Enter", this.ezPopupAction.emit.bind("OK"))
|
|
40
40
|
.bind("Escape", () => this.closePopup())
|
|
41
41
|
.bind("Esc", () => this.closePopup());
|