@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-76625.0 → 0.0.0-bugfix-dev-KB-83282.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-card-item_2.cjs.entry.js +7 -1415
- package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +387 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +58 -184
- package/dist/cjs/ez-grid.cjs.entry.js +58 -0
- package/dist/cjs/ez-popover-core_2.cjs.entry.js +1504 -0
- package/dist/cjs/ez-search.cjs.entry.js +158 -28
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +6 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/ez-card-item/ez-card-item.css +3 -1
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.css +205 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js +426 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +0 -250
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +61 -194
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +3 -0
- package/dist/collection/components/ez-grid/ez-grid.js +56 -1
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +27 -33
- 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 +18 -77
- package/dist/collection/components/ez-search/ez-search.css +219 -0
- package/dist/collection/components/ez-search/ez-search.js +167 -28
- package/dist/custom-elements/index.d.ts +6 -6
- package/dist/custom-elements/index.js +468 -359
- package/dist/esm/ez-card-item_2.entry.js +7 -1415
- package/dist/esm/ez-combo-box-list_3.entry.js +381 -0
- package/dist/esm/ez-combo-box.entry.js +59 -185
- package/dist/esm/ez-grid.entry.js +59 -1
- package/dist/esm/ez-popover-core_2.entry.js +1499 -0
- package/dist/esm/ez-search.entry.js +159 -29
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/index-baa5e267.js +6 -6
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-3a009184.entry.js +1 -0
- package/dist/ezui/{p-a5950a0d.entry.js → p-53116373.entry.js} +46 -46
- package/dist/ezui/p-58783dcf.entry.js +1 -0
- package/dist/ezui/p-65f471bc.entry.js +1 -0
- package/dist/ezui/p-7bd15498.entry.js +1 -0
- package/dist/ezui/p-f5931caa.entry.js +1 -0
- package/dist/types/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.d.ts +104 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +7 -16
- package/dist/types/components/ez-grid/ez-grid.d.ts +5 -0
- package/dist/types/components/ez-popover-plus/ez-popover-plus.d.ts +4 -5
- package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +2 -12
- package/dist/types/components/ez-search/ez-search.d.ts +13 -3
- package/dist/types/components.d.ts +127 -66
- package/package.json +1 -1
- package/react/components.d.ts +1 -1
- package/react/components.js +1 -1
- package/react/components.js.map +1 -1
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +0 -236
- package/dist/cjs/ez-popover-plus_3.cjs.entry.js +0 -184
- package/dist/cjs/searchFormatters-b7e1ed1e.js +0 -23
- package/dist/collection/components/ez-search/subcomponent/search-list/search-list.css +0 -227
- package/dist/collection/components/ez-search/subcomponent/search-list/search-list.js +0 -289
- package/dist/collection/components/ez-search/utils/searchFormatters.js +0 -18
- package/dist/esm/ez-custom-form-input_2.entry.js +0 -231
- package/dist/esm/ez-popover-plus_3.entry.js +0 -178
- package/dist/esm/searchFormatters-8229207e.js +0 -20
- package/dist/ezui/p-31da1b57.entry.js +0 -1
- package/dist/ezui/p-37201156.entry.js +0 -1
- package/dist/ezui/p-40a60148.js +0 -1
- package/dist/ezui/p-64b461b3.entry.js +0 -1
- package/dist/ezui/p-b7706b43.entry.js +0 -1
- package/dist/ezui/p-dc8b36c3.entry.js +0 -1
- package/dist/types/components/ez-search/subcomponent/search-list/search-list.d.ts +0 -23
- package/dist/types/components/ez-search/utils/searchFormatters.d.ts +0 -2
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import CSSVarsUtils from "../../utils/CSSVarsUtils";
|
|
3
|
-
import { ElementIDUtils, ObjectUtils, StringUtils } from "@sankhyalabs/core";
|
|
3
|
+
import { ElementIDUtils, FloatingManager, ObjectUtils, StringUtils } from "@sankhyalabs/core";
|
|
4
4
|
import { ApplicationUtils } from "../../utils";
|
|
5
5
|
import { REQUIRED_INFO } from "../../utils/constants";
|
|
6
|
-
import { replaceHighlight, replaceQuotes } from "./utils/searchFormatters";
|
|
7
6
|
export class EzSearch {
|
|
8
7
|
constructor() {
|
|
9
8
|
this._changeDeboucingTimeout = null;
|
|
@@ -134,6 +133,20 @@ export class EzSearch {
|
|
|
134
133
|
async clearValue() {
|
|
135
134
|
this.clearSearch();
|
|
136
135
|
}
|
|
136
|
+
scrollListener() {
|
|
137
|
+
var _a;
|
|
138
|
+
if (this._floatingID == undefined) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if ((_a = this.listOptionsPosition) === null || _a === void 0 ? void 0 : _a.hardPosition) {
|
|
142
|
+
this.hideOptions();
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
window.requestAnimationFrame(() => {
|
|
146
|
+
this.updateListPosition();
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
137
150
|
async handleValueAsString(value) {
|
|
138
151
|
if (this.getSelectedOption(value)) {
|
|
139
152
|
this.setInputValue();
|
|
@@ -147,6 +160,49 @@ export class EzSearch {
|
|
|
147
160
|
this.ezChange.emit(this.value);
|
|
148
161
|
this._currentValue = this.value;
|
|
149
162
|
}
|
|
163
|
+
updateListPosition() {
|
|
164
|
+
let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
|
|
165
|
+
const elementRect = this._listWrapper.getBoundingClientRect();
|
|
166
|
+
const containerRect = this._listContainer.getBoundingClientRect();
|
|
167
|
+
const textInputRect = this._textInput.getBoundingClientRect();
|
|
168
|
+
const limitHeight = bottomLimit || window.innerHeight;
|
|
169
|
+
const neededHeight = containerRect.bottom + elementRect.height;
|
|
170
|
+
if (!fromBottom && (elementRect.top < 0 || neededHeight > limitHeight)) {
|
|
171
|
+
fromBottom = true;
|
|
172
|
+
}
|
|
173
|
+
if (!hardPosition) {
|
|
174
|
+
verticalPosition = verticalPosition || 0;
|
|
175
|
+
horizontalPosition = horizontalPosition || 0;
|
|
176
|
+
if (fromBottom) {
|
|
177
|
+
verticalPosition = window.innerHeight - textInputRect.top + verticalPosition;
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
verticalPosition += containerRect.top;
|
|
181
|
+
}
|
|
182
|
+
if (fromRight) {
|
|
183
|
+
horizontalPosition = window.innerWidth - textInputRect.right + horizontalPosition;
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
horizontalPosition += containerRect.left;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (verticalPosition != undefined) {
|
|
190
|
+
this._listWrapper.style[fromBottom ? "bottom" : "top"] = `${verticalPosition}px`;
|
|
191
|
+
this._listWrapper.style[fromBottom ? "top" : "bottom"] = "";
|
|
192
|
+
}
|
|
193
|
+
if (horizontalPosition != undefined) {
|
|
194
|
+
this._listWrapper.style[fromRight ? "right" : "left"] = `${horizontalPosition}px`;
|
|
195
|
+
this._listWrapper.style[fromRight ? "left" : "right"] = "";
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
getListPosition() {
|
|
199
|
+
if (this.listOptionsPosition) {
|
|
200
|
+
return this.listOptionsPosition;
|
|
201
|
+
}
|
|
202
|
+
return {
|
|
203
|
+
verticalPosition: 6
|
|
204
|
+
};
|
|
205
|
+
}
|
|
150
206
|
isDifferentValues(firstValue, secondValue) {
|
|
151
207
|
return ObjectUtils.objectToString(firstValue || {}) !== ObjectUtils.objectToString(secondValue || {});
|
|
152
208
|
}
|
|
@@ -161,14 +217,24 @@ export class EzSearch {
|
|
|
161
217
|
getText() {
|
|
162
218
|
const currentValue = this.getSelectedOption(this._currentValue);
|
|
163
219
|
const text = this.getFormattedText(currentValue);
|
|
164
|
-
return replaceQuotes(text);
|
|
220
|
+
return this.replaceQuotes(text);
|
|
221
|
+
}
|
|
222
|
+
replaceQuotes(text) {
|
|
223
|
+
if (text == undefined) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
return String(text)
|
|
227
|
+
.replace(/&/g, '&')
|
|
228
|
+
.replace(/</g, '<')
|
|
229
|
+
.replace(/>/g, '>')
|
|
230
|
+
.replace(/"/g, '"');
|
|
165
231
|
}
|
|
166
232
|
getSelectedOption(value) {
|
|
167
233
|
if (typeof value === "string" || value instanceof String) {
|
|
168
234
|
return this._visibleOptions.find(o => o.value === value);
|
|
169
235
|
}
|
|
170
236
|
if (value) {
|
|
171
|
-
return Object.assign(Object.assign({}, value), { value: replaceHighlight(value === null || value === void 0 ? void 0 : value.value), label: replaceHighlight(value === null || value === void 0 ? void 0 : value.label) });
|
|
237
|
+
return Object.assign(Object.assign({}, value), { value: this.replaceHighlight(value === null || value === void 0 ? void 0 : value.value), label: this.replaceHighlight(value === null || value === void 0 ? void 0 : value.label) });
|
|
172
238
|
}
|
|
173
239
|
return value;
|
|
174
240
|
}
|
|
@@ -206,19 +272,75 @@ export class EzSearch {
|
|
|
206
272
|
}
|
|
207
273
|
return 0;
|
|
208
274
|
}
|
|
275
|
+
createOption(detail) {
|
|
276
|
+
let { key, title } = detail;
|
|
277
|
+
const startHighlight = new RegExp(this._startHighlightTag, 'g');
|
|
278
|
+
const endHighlight = new RegExp(this._endHighlightTag, 'g');
|
|
279
|
+
title = StringUtils.decodeHtmlEntities(title);
|
|
280
|
+
const option = {
|
|
281
|
+
value: key === null || key === void 0 ? void 0 : key.replace(startHighlight, '').replace(endHighlight, ''),
|
|
282
|
+
label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
|
|
283
|
+
};
|
|
284
|
+
this.selectOption(option);
|
|
285
|
+
}
|
|
286
|
+
buildItem(opt, index) {
|
|
287
|
+
opt.label = opt.label || opt.value;
|
|
288
|
+
const card = {
|
|
289
|
+
key: opt.value,
|
|
290
|
+
title: opt.label,
|
|
291
|
+
details: opt.details
|
|
292
|
+
};
|
|
293
|
+
return h("div", { style: { "height": "100%" }, class: index === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.createOption(card), onMouseOver: () => this._preSelection = index }, h("ez-card-item", { item: card, compacted: true, enableKey: this.showOptionValue }));
|
|
294
|
+
}
|
|
209
295
|
showOptions() {
|
|
210
296
|
if (!this.enabled)
|
|
211
297
|
return;
|
|
212
298
|
if (this.isOptionsVisible()) {
|
|
213
299
|
return;
|
|
214
300
|
}
|
|
215
|
-
|
|
301
|
+
if (!!this._resizeObserver)
|
|
302
|
+
this._resizeObserver.observe(this._textInput);
|
|
303
|
+
this._floatingID = FloatingManager.float(this._listWrapper, this._listContainer, { autoClose: false, isFixed: true, backClickListener: () => this.hideOptions() });
|
|
304
|
+
this.setFocus();
|
|
305
|
+
window.requestAnimationFrame(() => {
|
|
306
|
+
this.updateListPosition();
|
|
307
|
+
if (!this.listOptionsPosition) {
|
|
308
|
+
this._listWrapper.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
309
|
+
}
|
|
310
|
+
});
|
|
216
311
|
}
|
|
217
312
|
hideOptions() {
|
|
218
|
-
this.
|
|
313
|
+
if (this._floatingID !== undefined) {
|
|
314
|
+
FloatingManager.close(this._floatingID);
|
|
315
|
+
}
|
|
316
|
+
this._floatingID = undefined;
|
|
317
|
+
if (!!this._resizeObserver)
|
|
318
|
+
this._resizeObserver.unobserve(this._textInput);
|
|
219
319
|
}
|
|
220
320
|
isOptionsVisible() {
|
|
221
|
-
return this.
|
|
321
|
+
return this._floatingID !== undefined && FloatingManager.isFloating(this._floatingID);
|
|
322
|
+
}
|
|
323
|
+
nextOption() {
|
|
324
|
+
if (!this.isOptionsVisible()) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
this.showOptions();
|
|
328
|
+
this._preSelection = this._preSelection === undefined ? 0 : Math.min(this._preSelection + 1, this._visibleOptions.length - 1);
|
|
329
|
+
this.scrollToOption(this._visibleOptions[this._preSelection]);
|
|
330
|
+
}
|
|
331
|
+
previousOption() {
|
|
332
|
+
this._preSelection = this._preSelection === undefined ? 0 : Math.max(this._preSelection - 1, 0);
|
|
333
|
+
this.scrollToOption(this._visibleOptions[this._preSelection]);
|
|
334
|
+
}
|
|
335
|
+
scrollToOption(opt) {
|
|
336
|
+
window.requestAnimationFrame(() => {
|
|
337
|
+
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
338
|
+
? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
|
|
339
|
+
: undefined;
|
|
340
|
+
if (liElem) {
|
|
341
|
+
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
342
|
+
}
|
|
343
|
+
});
|
|
222
344
|
}
|
|
223
345
|
selectCurrentOption() {
|
|
224
346
|
if (this._preSelection !== undefined) {
|
|
@@ -261,11 +383,17 @@ export class EzSearch {
|
|
|
261
383
|
this._source = [];
|
|
262
384
|
this.updateVisibleOptions();
|
|
263
385
|
}
|
|
386
|
+
replaceHighlight(value) {
|
|
387
|
+
const startHighlight = new RegExp(this._startHighlightTag, 'g');
|
|
388
|
+
const endHighlight = new RegExp(this._endHighlightTag, 'g');
|
|
389
|
+
const newValue = String(value !== null && value !== void 0 ? value : "").replace(startHighlight, '').replace(endHighlight, '');
|
|
390
|
+
return this.replaceQuotes(newValue);
|
|
391
|
+
}
|
|
264
392
|
selectOption(newOption, focusOnInput = true) {
|
|
265
393
|
var _a, _b;
|
|
266
394
|
const currentValue = this.getSelectedOption(this.value);
|
|
267
|
-
const newOptionsReplaced = Object.assign(Object.assign({}, newOption), { value: replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.value), label: replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.label) });
|
|
268
|
-
const newOptionsFormatted = Object.assign(Object.assign({}, newOptionsReplaced), { value: replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value), label: replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.label) });
|
|
395
|
+
const newOptionsReplaced = Object.assign(Object.assign({}, newOption), { value: this.replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.value), label: this.replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.label) });
|
|
396
|
+
const newOptionsFormatted = Object.assign(Object.assign({}, newOptionsReplaced), { value: this.replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value), label: this.replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.label) });
|
|
269
397
|
if ((((_a = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOptionsFormatted === null || newOptionsFormatted === void 0 ? void 0 : newOptionsFormatted.value) === null || _b === void 0 ? void 0 : _b.toString()))
|
|
270
398
|
|| (currentValue == undefined && newOptionsFormatted != undefined && "value" in newOptionsFormatted)) {
|
|
271
399
|
const adjustedOpt = !(newOptionsFormatted === null || newOptionsFormatted === void 0 ? void 0 : newOptionsFormatted.value) ? undefined : newOptionsFormatted;
|
|
@@ -375,7 +503,7 @@ export class EzSearch {
|
|
|
375
503
|
this.showNoResultMessage();
|
|
376
504
|
return;
|
|
377
505
|
}
|
|
378
|
-
this._currentValue = value ? Object.assign(Object.assign({}, value), { value: replaceHighlight(value.value), label: replaceHighlight(value.label) }) : value;
|
|
506
|
+
this._currentValue = value ? Object.assign(Object.assign({}, value), { value: this.replaceHighlight(value.value), label: this.replaceHighlight(value.label) }) : value;
|
|
379
507
|
this.value = this._currentValue;
|
|
380
508
|
this.setTextInputValue();
|
|
381
509
|
}
|
|
@@ -384,7 +512,7 @@ export class EzSearch {
|
|
|
384
512
|
if (this.value === undefined || this.value === null)
|
|
385
513
|
return;
|
|
386
514
|
const textValue = (typeof this.value === 'string') ? this.value : this.getFormattedText(this.value);
|
|
387
|
-
this._textInput.value = replaceQuotes(textValue);
|
|
515
|
+
this._textInput.value = this.replaceQuotes(textValue);
|
|
388
516
|
}
|
|
389
517
|
}
|
|
390
518
|
loadOptionValue(argument) {
|
|
@@ -421,7 +549,7 @@ export class EzSearch {
|
|
|
421
549
|
return;
|
|
422
550
|
}
|
|
423
551
|
let text = this.getFormattedText(this.value);
|
|
424
|
-
text = replaceQuotes(text);
|
|
552
|
+
text = this.replaceQuotes(text);
|
|
425
553
|
this._textInput.value = text;
|
|
426
554
|
}
|
|
427
555
|
//---------------------------------------------
|
|
@@ -448,6 +576,9 @@ export class EzSearch {
|
|
|
448
576
|
}
|
|
449
577
|
componentDidRender() {
|
|
450
578
|
var _a;
|
|
579
|
+
if (this._floatingID === undefined) {
|
|
580
|
+
this._listWrapper.remove();
|
|
581
|
+
}
|
|
451
582
|
(_a = this._optionsList) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".item").forEach((elem) => {
|
|
452
583
|
ElementIDUtils.addIDInfoIfNotExists(elem, "itemSearch");
|
|
453
584
|
});
|
|
@@ -459,6 +590,10 @@ export class EzSearch {
|
|
|
459
590
|
window.requestAnimationFrame(() => {
|
|
460
591
|
if (!Array.isArray(entries) || !entries.length)
|
|
461
592
|
return;
|
|
593
|
+
const { clientWidth } = this._listContainer;
|
|
594
|
+
if (clientWidth > 0 && !!this._listWrapper) {
|
|
595
|
+
this._listWrapper.style.width = `${clientWidth}px`;
|
|
596
|
+
}
|
|
462
597
|
});
|
|
463
598
|
});
|
|
464
599
|
await this.handleInitialValue();
|
|
@@ -525,7 +660,7 @@ export class EzSearch {
|
|
|
525
660
|
this._changeDeboucingTimeout = null;
|
|
526
661
|
}
|
|
527
662
|
}
|
|
528
|
-
|
|
663
|
+
keyDownHandler(event) {
|
|
529
664
|
this._tabPressed = false;
|
|
530
665
|
if (event.ctrlKey) {
|
|
531
666
|
if (event.key === "f" || event.key === "F") {
|
|
@@ -541,20 +676,15 @@ export class EzSearch {
|
|
|
541
676
|
switch (event.key) {
|
|
542
677
|
case "ArrowDown":
|
|
543
678
|
event.stopPropagation();
|
|
544
|
-
if (this.canShowListOptions())
|
|
679
|
+
if (this.canShowListOptions())
|
|
545
680
|
event.preventDefault();
|
|
546
|
-
|
|
547
|
-
if (!this.isOptionsVisible()) {
|
|
548
|
-
this.showOptions();
|
|
549
|
-
}
|
|
550
|
-
await this._searchList.nextOption();
|
|
681
|
+
this.nextOption();
|
|
551
682
|
break;
|
|
552
683
|
case "ArrowUp":
|
|
553
684
|
event.stopPropagation();
|
|
554
|
-
if (this.canShowListOptions())
|
|
685
|
+
if (this.canShowListOptions())
|
|
555
686
|
event.preventDefault();
|
|
556
|
-
|
|
557
|
-
await this._searchList.previousOption();
|
|
687
|
+
this.previousOption();
|
|
558
688
|
break;
|
|
559
689
|
case "Enter":
|
|
560
690
|
this.handleEventPropagation(event);
|
|
@@ -576,7 +706,7 @@ export class EzSearch {
|
|
|
576
706
|
}
|
|
577
707
|
//O evento deve ter sua propagação interrompida, apenas se a lista de opções estiver sendo exibida.
|
|
578
708
|
handleEventPropagation(event) {
|
|
579
|
-
if (this.
|
|
709
|
+
if (this._listContainer.hasChildNodes() && this.stopPropagateEnterKeyEvent) {
|
|
580
710
|
event.stopPropagation();
|
|
581
711
|
}
|
|
582
712
|
}
|
|
@@ -588,17 +718,17 @@ export class EzSearch {
|
|
|
588
718
|
return !this._showLoading && this._visibleOptions.length > 0;
|
|
589
719
|
}
|
|
590
720
|
canShowLoadSpinDescription() {
|
|
591
|
-
return this._showLoadingDescription &&
|
|
592
|
-
}
|
|
593
|
-
onChangePreSelection(value) {
|
|
594
|
-
this._preSelection = value;
|
|
721
|
+
return this._showLoadingDescription && this._floatingID == undefined;
|
|
595
722
|
}
|
|
596
723
|
render() {
|
|
597
724
|
var _a;
|
|
598
725
|
ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
|
|
599
726
|
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, h("button", { class: "btn", slot: "leftIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, this.canShowLoadSpinDescription() ? h("div", { class: "message__loading" }) : h("ez-icon", { iconName: "search" })), (((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value) && (this._criteria || this.value) || this.ensureClearButtonVisible)
|
|
600
727
|
? h("button", { class: "btn btn__close", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
|
|
601
|
-
: undefined), h("
|
|
728
|
+
: undefined), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this._showLoading
|
|
729
|
+
&& this._visibleOptions.length === 0
|
|
730
|
+
&& h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
|
|
731
|
+
&& h("div", { class: "message" }, h("div", { class: "message__loading" })), h("span", { class: "item__value item__value--hidden", ref: elem => this._itemValueBasis = elem }), this.canShowListOptions() && this._visibleOptions.map((opt, index) => this.buildItem(opt, index)))))));
|
|
602
732
|
}
|
|
603
733
|
static get is() { return "ez-search"; }
|
|
604
734
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1146,6 +1276,15 @@ export class EzSearch {
|
|
|
1146
1276
|
"methodName": "observeOptions"
|
|
1147
1277
|
}];
|
|
1148
1278
|
}
|
|
1279
|
+
static get listeners() {
|
|
1280
|
+
return [{
|
|
1281
|
+
"name": "scroll",
|
|
1282
|
+
"method": "scrollListener",
|
|
1283
|
+
"target": "window",
|
|
1284
|
+
"capture": true,
|
|
1285
|
+
"passive": true
|
|
1286
|
+
}];
|
|
1287
|
+
}
|
|
1149
1288
|
}
|
|
1150
1289
|
var SearchMode;
|
|
1151
1290
|
(function (SearchMode) {
|
|
@@ -86,6 +86,12 @@ export const EzComboBox: {
|
|
|
86
86
|
new (): EzComboBox;
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
+
interface EzComboBoxList extends Components.EzComboBoxList, HTMLElement {}
|
|
90
|
+
export const EzComboBoxList: {
|
|
91
|
+
prototype: EzComboBoxList;
|
|
92
|
+
new (): EzComboBoxList;
|
|
93
|
+
};
|
|
94
|
+
|
|
89
95
|
interface EzCustomFormInput extends Components.EzCustomFormInput, HTMLElement {}
|
|
90
96
|
export const EzCustomFormInput: {
|
|
91
97
|
prototype: EzCustomFormInput;
|
|
@@ -350,12 +356,6 @@ export const MultiSelectionBoxMessage: {
|
|
|
350
356
|
new (): MultiSelectionBoxMessage;
|
|
351
357
|
};
|
|
352
358
|
|
|
353
|
-
interface SearchList extends Components.SearchList, HTMLElement {}
|
|
354
|
-
export const SearchList: {
|
|
355
|
-
prototype: SearchList;
|
|
356
|
-
new (): SearchList;
|
|
357
|
-
};
|
|
358
|
-
|
|
359
359
|
/**
|
|
360
360
|
* Utility to define all custom elements within this package using the tag name provided in the component's source.
|
|
361
361
|
* When defining each custom element, it will also check it's safe to define by:
|