@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-75065.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-badge.cjs.entry.js +2 -14
- 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-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +186 -0
- package/dist/cjs/{ez-multi-selection-list_2.cjs.entry.js → ez-popover-core_2.cjs.entry.js} +115 -196
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +8 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/ez-badge/ez-badge.css +1 -12
- package/dist/collection/components/ez-badge/ez-badge.js +1 -31
- 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-icon/ez-icon.css +4 -1
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.css +0 -64
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +47 -127
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css +67 -0
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js +468 -0
- package/dist/custom-elements/index.d.ts +12 -0
- package/dist/custom-elements/index.js +395 -219
- package/dist/esm/ez-badge.entry.js +2 -14
- 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-icon.entry.js +1 -1
- package/dist/esm/ez-multi-selection-list.entry.js +182 -0
- package/dist/esm/{ez-multi-selection-list_2.entry.js → ez-popover-core_2.entry.js} +116 -197
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/index-baa5e267.js +8 -4
- 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-56fe5341.entry.js +1 -0
- package/dist/ezui/p-650e4b6d.entry.js +1 -0
- package/dist/ezui/p-7bd15498.entry.js +1 -0
- package/dist/ezui/p-dc73e1fe.entry.js +1 -0
- package/dist/ezui/p-f5931caa.entry.js +1 -0
- package/dist/types/components/ez-badge/ez-badge.d.ts +0 -5
- 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 +6 -19
- package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +81 -0
- package/dist/types/components.d.ts +218 -11
- package/package.json +1 -1
- package/react/components.d.ts +2 -0
- package/react/components.js +2 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +0 -236
- package/dist/esm/ez-custom-form-input_2.entry.js +0 -231
- package/dist/ezui/p-0ca05a2f.entry.js +0 -1
- package/dist/ezui/p-64b461b3.entry.js +0 -1
- package/dist/ezui/p-cdac80f1.entry.js +0 -1
- package/dist/ezui/p-dc8b36c3.entry.js +0 -1
- package/dist/ezui/p-e75c7a23.entry.js +0 -1
|
@@ -10,7 +10,7 @@ require('./DialogType-2114c337.js');
|
|
|
10
10
|
require('./CheckMode-ecb90b87.js');
|
|
11
11
|
require('./ICustomRender-6fafffce.js');
|
|
12
12
|
|
|
13
|
-
const ezComboBoxCss = ":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-
|
|
13
|
+
const ezComboBoxCss = ":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn--color:var(--title--primary, #2B3A54);--ez-combo-box__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-hover--color:var(--color--primary, #4e4e4e);width:var(--ez-combo-box--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)}.btn{outline:none;border:none;background:none;cursor:pointer;padding:0px;color:var(--ez-combo-box__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:disabled:hover{cursor:not-allowed;color:var(--ez-combo-box__btn-disabled--color)}.btn:hover{color:var(--ez-combo-box__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}.text-input-slot-container{--ez-text-input__icon--width:32px;--ez-text-input__min-width:var(--ez-combo-box__min-width);--ez-text-input__max-width:var(--ez-combo-box__max-width)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
|
|
14
14
|
|
|
15
15
|
const EzComboBox = class {
|
|
16
16
|
constructor(hostRef) {
|
|
@@ -22,11 +22,13 @@ const EzComboBox = class {
|
|
|
22
22
|
this._tabPressed = false;
|
|
23
23
|
this._textEmptyList = "Nenhum resultado encontrado";
|
|
24
24
|
this._lookupMode = false;
|
|
25
|
+
this.isOpen = false;
|
|
25
26
|
this._preSelection = undefined;
|
|
26
27
|
this._visibleOptions = undefined;
|
|
27
28
|
this._startLoading = false;
|
|
28
29
|
this._showLoading = true;
|
|
29
30
|
this._criteria = undefined;
|
|
31
|
+
this._textInputReady = undefined;
|
|
30
32
|
this.limitCharsToSearch = 3;
|
|
31
33
|
this.value = undefined;
|
|
32
34
|
this.label = undefined;
|
|
@@ -132,63 +134,6 @@ const EzComboBox = class {
|
|
|
132
134
|
async clearValue() {
|
|
133
135
|
this.clearSearch();
|
|
134
136
|
}
|
|
135
|
-
scrollListener() {
|
|
136
|
-
var _a;
|
|
137
|
-
if (this._floatingID == undefined) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
if ((_a = this.listOptionsPosition) === null || _a === void 0 ? void 0 : _a.hardPosition) {
|
|
141
|
-
this.hideOptions();
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
window.requestAnimationFrame(() => {
|
|
145
|
-
this.updateListPosition();
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
updateListPosition() {
|
|
150
|
-
let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
|
|
151
|
-
const elementRect = this._listWrapper.getBoundingClientRect();
|
|
152
|
-
const containerRect = this._listContainer.getBoundingClientRect();
|
|
153
|
-
const textInputRect = this._textInput.getBoundingClientRect();
|
|
154
|
-
const limitHeight = bottomLimit || window.innerHeight;
|
|
155
|
-
const neededHeight = containerRect.bottom + elementRect.height;
|
|
156
|
-
if (!fromBottom && (elementRect.top < 0 || neededHeight > limitHeight)) {
|
|
157
|
-
fromBottom = true;
|
|
158
|
-
}
|
|
159
|
-
if (!hardPosition) {
|
|
160
|
-
verticalPosition = verticalPosition || 0;
|
|
161
|
-
horizontalPosition = horizontalPosition || 0;
|
|
162
|
-
if (fromBottom) {
|
|
163
|
-
verticalPosition = window.innerHeight - textInputRect.top + verticalPosition;
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
verticalPosition += containerRect.top;
|
|
167
|
-
}
|
|
168
|
-
if (fromRight) {
|
|
169
|
-
horizontalPosition = window.innerWidth - textInputRect.right + horizontalPosition;
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
horizontalPosition += containerRect.left;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
if (verticalPosition != undefined) {
|
|
176
|
-
this._listWrapper.style[fromBottom ? "bottom" : "top"] = `${verticalPosition}px`;
|
|
177
|
-
this._listWrapper.style[fromBottom ? "top" : "bottom"] = "";
|
|
178
|
-
}
|
|
179
|
-
if (horizontalPosition != undefined) {
|
|
180
|
-
this._listWrapper.style[fromRight ? "right" : "left"] = `${horizontalPosition}px`;
|
|
181
|
-
this._listWrapper.style[fromRight ? "left" : "right"] = "";
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
getListPosition() {
|
|
185
|
-
if (this.listOptionsPosition) {
|
|
186
|
-
return this.listOptionsPosition;
|
|
187
|
-
}
|
|
188
|
-
return {
|
|
189
|
-
verticalPosition: 6
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
137
|
isDifferentValues(firstValue, secondValue) {
|
|
193
138
|
return core.ObjectUtils.objectToString(firstValue || {}) !== core.ObjectUtils.objectToString(secondValue || {});
|
|
194
139
|
}
|
|
@@ -261,85 +206,24 @@ const EzComboBox = class {
|
|
|
261
206
|
}
|
|
262
207
|
return 0;
|
|
263
208
|
}
|
|
264
|
-
buildItem(opt, index$1) {
|
|
265
|
-
const widthValue = this.showOptionValue && this._maxWidthValue > 0 ? `${this._maxWidthValue}px` : '';
|
|
266
|
-
opt.label = opt.label || opt.value;
|
|
267
|
-
return index.h("li", { class: index$1 === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.selectOption(opt), onMouseOver: () => this._preSelection = index$1 }, this.showOptionValue
|
|
268
|
-
? index.h("span", { class: "item__value", title: opt.value, style: { width: widthValue, minWidth: widthValue, maxWidth: widthValue } }, opt.value)
|
|
269
|
-
: undefined, index.h("span", { class: "item__label " + (this.showOptionValue ? "item__label--bold" : ""), title: opt.label }, opt.label));
|
|
270
|
-
}
|
|
271
209
|
showOptions() {
|
|
272
210
|
var _a, _b;
|
|
273
211
|
if (!this.enabled)
|
|
274
212
|
return;
|
|
275
|
-
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
213
|
+
this.openPopover();
|
|
278
214
|
const valueString = (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : this.value;
|
|
279
215
|
const indexValue = this._visibleOptions.findIndex(option => option.value === valueString);
|
|
280
216
|
this._preSelection = indexValue === -1 ? 0 : indexValue;
|
|
281
217
|
if (!!this._resizeObserver)
|
|
282
218
|
this._resizeObserver.observe(this._textInput);
|
|
283
|
-
this._floatingID = core.FloatingManager.float(this._listWrapper, this._listContainer, { autoClose: true, isFixed: true, backClickListener: () => this.hideOptions() });
|
|
284
219
|
this.setFocus();
|
|
285
|
-
window.requestAnimationFrame(() => {
|
|
286
|
-
this.updateListPosition();
|
|
287
|
-
if (!this.listOptionsPosition) {
|
|
288
|
-
this._listWrapper.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
220
|
}
|
|
292
221
|
hideOptions() {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
296
|
-
this._floatingID = undefined;
|
|
222
|
+
var _a;
|
|
223
|
+
(_a = this._popover) === null || _a === void 0 ? void 0 : _a.hide();
|
|
297
224
|
if (!!this._resizeObserver)
|
|
298
225
|
this._resizeObserver.unobserve(this._textInput);
|
|
299
226
|
}
|
|
300
|
-
isOptionsVisible() {
|
|
301
|
-
return this._floatingID !== undefined && core.FloatingManager.isFloating(this._floatingID);
|
|
302
|
-
}
|
|
303
|
-
nextOption() {
|
|
304
|
-
if (!this.isOptionsVisible()) {
|
|
305
|
-
return;
|
|
306
|
-
}
|
|
307
|
-
this.showOptions();
|
|
308
|
-
this._preSelection = this._preSelection === undefined ? 0 : Math.min(this._preSelection + 1, this._visibleOptions.length - 1);
|
|
309
|
-
this.scrollToOption(this._visibleOptions[this._preSelection]);
|
|
310
|
-
}
|
|
311
|
-
previousOption() {
|
|
312
|
-
this._preSelection = this._preSelection === undefined ? 0 : Math.max(this._preSelection - 1, 0);
|
|
313
|
-
this.scrollToOption(this._visibleOptions[this._preSelection]);
|
|
314
|
-
}
|
|
315
|
-
scrollToOption(opt) {
|
|
316
|
-
window.requestAnimationFrame(() => {
|
|
317
|
-
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value) ? this._optionsList.querySelector(`li#item_${opt.value.replace(/[<>\[\]#=]/g, '\\$&').replace(/:/g, '\\:')}`) : undefined;
|
|
318
|
-
if (liElem)
|
|
319
|
-
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
selectCurrentOption(focusOnInput = true) {
|
|
323
|
-
if (this._preSelection !== undefined) {
|
|
324
|
-
this.selectOption(this._visibleOptions[this._preSelection], focusOnInput);
|
|
325
|
-
this._preSelection = undefined;
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
this.controlListWithOnlyOne(focusOnInput);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
controlListWithOnlyOne(focusOnInput = true) {
|
|
332
|
-
var _a;
|
|
333
|
-
const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
|
|
334
|
-
if ((source === null || source === void 0 ? void 0 : source.length) > 0) {
|
|
335
|
-
let title = core.StringUtils.decodeHtmlEntities(source[0].label);
|
|
336
|
-
const option = {
|
|
337
|
-
value: source[0].value,
|
|
338
|
-
label: title,
|
|
339
|
-
};
|
|
340
|
-
this.selectOption(option, focusOnInput);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
227
|
updateSource(source) {
|
|
344
228
|
this._startLoading = false;
|
|
345
229
|
if (source instanceof Promise) {
|
|
@@ -365,12 +249,13 @@ const EzComboBox = class {
|
|
|
365
249
|
}
|
|
366
250
|
}
|
|
367
251
|
selectOption(newOption, focusOnInput = true) {
|
|
368
|
-
var _a, _b;
|
|
252
|
+
var _a, _b, _c;
|
|
369
253
|
const currentValue = this.getSelectedOption(this.value);
|
|
370
254
|
if ((((_a = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOption === null || newOption === void 0 ? void 0 : newOption.value) === null || _b === void 0 ? void 0 : _b.toString()))
|
|
371
255
|
|| (currentValue == undefined && newOption != undefined && "value" in newOption)) {
|
|
372
256
|
const adjustedOpt = !(newOption === null || newOption === void 0 ? void 0 : newOption.value) ? undefined : newOption;
|
|
373
257
|
this.value = adjustedOpt;
|
|
258
|
+
(_c = this._popover) === null || _c === void 0 ? void 0 : _c.hide();
|
|
374
259
|
}
|
|
375
260
|
else {
|
|
376
261
|
this.resetOptions();
|
|
@@ -423,6 +308,11 @@ const EzComboBox = class {
|
|
|
423
308
|
//---------------------------------------------
|
|
424
309
|
// Lifecycle web component
|
|
425
310
|
//---------------------------------------------
|
|
311
|
+
componentDidRender() {
|
|
312
|
+
if (this._textInput) {
|
|
313
|
+
this._textInputReady = true;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
426
316
|
componentWillLoad() {
|
|
427
317
|
if (this.options === undefined) {
|
|
428
318
|
this.options = [];
|
|
@@ -441,15 +331,6 @@ const EzComboBox = class {
|
|
|
441
331
|
}
|
|
442
332
|
this.loadOptions(SearchMode.PRELOAD);
|
|
443
333
|
}
|
|
444
|
-
componentDidRender() {
|
|
445
|
-
var _a;
|
|
446
|
-
if (this._floatingID === undefined) {
|
|
447
|
-
this._listWrapper.remove();
|
|
448
|
-
}
|
|
449
|
-
(_a = this._optionsList) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".item").forEach((elem) => {
|
|
450
|
-
core.ElementIDUtils.addIDInfoIfNotExists(elem, "itemComboBox");
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
334
|
componentDidLoad() {
|
|
454
335
|
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
|
|
455
336
|
this.setInputValue(false);
|
|
@@ -457,10 +338,12 @@ const EzComboBox = class {
|
|
|
457
338
|
window.requestAnimationFrame(() => {
|
|
458
339
|
if (!Array.isArray(entries) || !entries.length)
|
|
459
340
|
return;
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
341
|
+
if (!this._textInput)
|
|
342
|
+
return;
|
|
343
|
+
if (!this._comboBoxList)
|
|
344
|
+
return;
|
|
345
|
+
const textInputWidth = this._textInput.clientWidth;
|
|
346
|
+
this._comboBoxList.width = textInputWidth;
|
|
464
347
|
});
|
|
465
348
|
});
|
|
466
349
|
if (this.autoFocus) {
|
|
@@ -469,6 +352,13 @@ const EzComboBox = class {
|
|
|
469
352
|
});
|
|
470
353
|
}
|
|
471
354
|
}
|
|
355
|
+
disconnectedCallback() {
|
|
356
|
+
var _a;
|
|
357
|
+
(_a = this._popover) === null || _a === void 0 ? void 0 : _a.remove();
|
|
358
|
+
if (this._resizeObserver) {
|
|
359
|
+
this._resizeObserver.disconnect();
|
|
360
|
+
}
|
|
361
|
+
}
|
|
472
362
|
//---------------------------------------------
|
|
473
363
|
// Event handlers
|
|
474
364
|
//---------------------------------------------
|
|
@@ -508,65 +398,48 @@ const EzComboBox = class {
|
|
|
508
398
|
this.showOptions();
|
|
509
399
|
}
|
|
510
400
|
keyDownHandler(event) {
|
|
511
|
-
|
|
512
|
-
if (event.ctrlKey) {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
//não é interessante deixar o evento propagar;
|
|
518
|
-
event.stopPropagation();
|
|
519
|
-
event.stopImmediatePropagation();
|
|
520
|
-
event.preventDefault();
|
|
521
|
-
}
|
|
401
|
+
var _a, _b, _c, _d, _e, _f;
|
|
402
|
+
if (event.ctrlKey && (event.key === "f" || event.key === "F")) {
|
|
403
|
+
this.loadOptions(SearchMode.ADVANCED);
|
|
404
|
+
event.preventDefault();
|
|
405
|
+
event.stopPropagation();
|
|
406
|
+
return;
|
|
522
407
|
}
|
|
523
408
|
switch (event.key) {
|
|
524
409
|
case "ArrowDown":
|
|
525
|
-
event.
|
|
526
|
-
if (this.canShowListOptions())
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
410
|
+
event.preventDefault();
|
|
411
|
+
if (this.canShowListOptions()) {
|
|
412
|
+
this.showOptions();
|
|
413
|
+
(_a = this._comboBoxList) === null || _a === void 0 ? void 0 : _a.nextOption();
|
|
414
|
+
}
|
|
530
415
|
break;
|
|
531
416
|
case "ArrowUp":
|
|
532
|
-
event.
|
|
533
|
-
if (this.canShowListOptions())
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
417
|
+
event.preventDefault();
|
|
418
|
+
if (this.canShowListOptions()) {
|
|
419
|
+
this.showOptions();
|
|
420
|
+
(_b = this._comboBoxList) === null || _b === void 0 ? void 0 : _b.previousOption();
|
|
421
|
+
}
|
|
537
422
|
break;
|
|
538
423
|
case "Enter":
|
|
539
|
-
this.
|
|
540
|
-
|
|
541
|
-
this.selectCurrentOption();
|
|
424
|
+
if (this.isOpen) {
|
|
425
|
+
event.preventDefault();
|
|
426
|
+
(_c = this._comboBoxList) === null || _c === void 0 ? void 0 : _c.selectCurrentOption();
|
|
542
427
|
}
|
|
543
428
|
break;
|
|
544
429
|
case "Escape":
|
|
545
|
-
if (this.
|
|
546
|
-
event.
|
|
430
|
+
if (this.isOpen) {
|
|
431
|
+
event.preventDefault();
|
|
432
|
+
(_d = this._popover) === null || _d === void 0 ? void 0 : _d.hide();
|
|
547
433
|
}
|
|
548
|
-
this.cancelPreselection();
|
|
549
|
-
this.resetOptions();
|
|
550
434
|
break;
|
|
551
435
|
case "Tab":
|
|
552
436
|
this._tabPressed = true;
|
|
553
|
-
if (this.
|
|
554
|
-
this.selectCurrentOption(
|
|
437
|
+
if (this.isOpen) {
|
|
438
|
+
(_e = this._comboBoxList) === null || _e === void 0 ? void 0 : _e.selectCurrentOption();
|
|
439
|
+
(_f = this._popover) === null || _f === void 0 ? void 0 : _f.hide();
|
|
555
440
|
}
|
|
556
|
-
this.resetOptions();
|
|
557
441
|
break;
|
|
558
442
|
}
|
|
559
|
-
//ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
|
|
560
|
-
//Por exemplo, quando o usuário dá um Enter, além de selecionar
|
|
561
|
-
//um valor, também significa que a ateração finalizou,
|
|
562
|
-
//e o contexto pode reagir (fechar um popup por exemplo).
|
|
563
|
-
//event.stopPropagation();
|
|
564
|
-
}
|
|
565
|
-
//O evento deve ter sua propagação interrompida, apenas se a lista de opções estiver sendo exibida.
|
|
566
|
-
handleEventPropagation(event) {
|
|
567
|
-
if (this._listContainer.hasChildNodes() && this.stopPropagateEnterKeyEvent) {
|
|
568
|
-
event.stopPropagation();
|
|
569
|
-
}
|
|
570
443
|
}
|
|
571
444
|
onTextInputFocusOutHandler() {
|
|
572
445
|
if (this.hideErrorOnFocusOut)
|
|
@@ -575,14 +448,15 @@ const EzComboBox = class {
|
|
|
575
448
|
canShowListOptions() {
|
|
576
449
|
return !this._showLoading && this._visibleOptions.length > 0;
|
|
577
450
|
}
|
|
451
|
+
openPopover() {
|
|
452
|
+
var _a;
|
|
453
|
+
this.isOpen = true;
|
|
454
|
+
(_a = this._popover) === null || _a === void 0 ? void 0 : _a.show();
|
|
455
|
+
}
|
|
578
456
|
render() {
|
|
457
|
+
var _a;
|
|
579
458
|
core.ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
|
|
580
|
-
return (index.h(index.Host, null, index.h("ez-text-input", { "data-element-id": core.ElementIDUtils.getInternalIDInfo("textInput"), class: `text-input-slot-container ${this.suppressSearch ? "suppressed-search-input" : ""}`, ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, index.h("button", { class: "btn", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, index.h("ez-icon", { iconName: "chevron-down" }))), index.h("
|
|
581
|
-
&& this._visibleOptions.length === 0
|
|
582
|
-
&& index.h("div", { class: "message" }, index.h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
|
|
583
|
-
&& index.h("div", { class: "message" }, index.h("div", { class: "message__loading" })), this.showOptionValue
|
|
584
|
-
? index.h("span", { class: "item__value item__value--hidden", ref: elem => this._itemValueBasis = elem })
|
|
585
|
-
: undefined, this.canShowListOptions() && this._visibleOptions.map((opt, index) => this.buildItem(opt, index)))))));
|
|
459
|
+
return (index.h(index.Host, null, index.h("ez-text-input", { "data-element-id": core.ElementIDUtils.getInternalIDInfo("textInput"), class: `text-input-slot-container ${this.suppressSearch ? "suppressed-search-input" : ""}`, ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, index.h("button", { class: "btn", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, index.h("ez-icon", { iconName: "chevron-down" }))), index.h("ez-popover-plus", { ref: elem => this._popover = elem, anchorElement: this._textInput, autoClose: true, boxWidth: 'fit-content', overlayType: 'none', onEzVisibilityChange: event => this.isOpen = event.detail }, index.h("ez-combo-box-list", { ref: ref => this._comboBoxList = ref, showLoading: this._showLoading, visibleOptions: this._visibleOptions, textEmptyList: this._textEmptyList, showOptionValue: this.showOptionValue, preSelection: this._preSelection, maxWidth: this._maxWidthValue, width: (_a = this._textInput) === null || _a === void 0 ? void 0 : _a.clientWidth, onOptionSelect: (opt) => this.selectOption(opt), onOptionHover: (index) => this._preSelection = index }))));
|
|
586
460
|
}
|
|
587
461
|
get el() { return index.getElement(this); }
|
|
588
462
|
static get watchers() { return {
|
|
@@ -65833,6 +65833,9 @@ class AgGridController {
|
|
|
65833
65833
|
if (cfgColumn.customWidth != undefined) {
|
|
65834
65834
|
return cfgColumn.customWidth;
|
|
65835
65835
|
}
|
|
65836
|
+
if (cfgColumn.width != undefined) {
|
|
65837
|
+
return cfgColumn.width;
|
|
65838
|
+
}
|
|
65836
65839
|
const field = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(cfgColumn.name);
|
|
65837
65840
|
if ((field === null || field === void 0 ? void 0 : field.userInterface) === core.UserInterface.SEARCH) {
|
|
65838
65841
|
return this.DEFAULT_MAX_SIZE;
|
|
@@ -66412,6 +66415,20 @@ const EzGrid = class {
|
|
|
66412
66415
|
.then(() => this.resetPaginationState());
|
|
66413
66416
|
}
|
|
66414
66417
|
}
|
|
66418
|
+
nextRecord() {
|
|
66419
|
+
if (this.dataUnit) {
|
|
66420
|
+
if (this.dataUnit.getSelectionInfo().records.length === 0) {
|
|
66421
|
+
this.dataUnit.selectFirst();
|
|
66422
|
+
return;
|
|
66423
|
+
}
|
|
66424
|
+
this.dataUnit.nextRecord();
|
|
66425
|
+
}
|
|
66426
|
+
}
|
|
66427
|
+
previousRecord() {
|
|
66428
|
+
if (this.dataUnit) {
|
|
66429
|
+
this.dataUnit.previousRecord();
|
|
66430
|
+
}
|
|
66431
|
+
}
|
|
66415
66432
|
resetPaginationState() {
|
|
66416
66433
|
var _a;
|
|
66417
66434
|
this._paginationChangedByKeyboard = false;
|
|
@@ -66494,6 +66511,7 @@ const EzGrid = class {
|
|
|
66494
66511
|
this._gridController.configFilterColumn(this._filterColumn);
|
|
66495
66512
|
if (this.paginationCounterMode === 'auto')
|
|
66496
66513
|
this._initHeaderOverflowWatcher();
|
|
66514
|
+
this.initKeyboardManager();
|
|
66497
66515
|
}
|
|
66498
66516
|
handlePaginationChange(selectFirstRecord, paginationInfo) {
|
|
66499
66517
|
var _a;
|
|
@@ -66560,6 +66578,7 @@ const EzGrid = class {
|
|
|
66560
66578
|
var _a, _b;
|
|
66561
66579
|
(_a = this._headerOverflowWatcher) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
66562
66580
|
(_b = this._gridController) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
66581
|
+
this.removeShortcuts();
|
|
66563
66582
|
}
|
|
66564
66583
|
connectedCallback() {
|
|
66565
66584
|
var _a;
|
|
@@ -66598,6 +66617,45 @@ const EzGrid = class {
|
|
|
66598
66617
|
return "left__header-expanded";
|
|
66599
66618
|
return "left__header-contracted";
|
|
66600
66619
|
}
|
|
66620
|
+
async initKeyboardManager() {
|
|
66621
|
+
this._keyboardManager = new core.KeyboardManager({ propagate: false, element: this._element });
|
|
66622
|
+
this._keyboardManager
|
|
66623
|
+
.bind("ctrl + .", () => {
|
|
66624
|
+
if (!this._paginationInfo)
|
|
66625
|
+
return;
|
|
66626
|
+
this.nextRecord();
|
|
66627
|
+
}, { description: "Avança para o próximo registro.", element: this._element })
|
|
66628
|
+
.bind("ctrl + ,", () => {
|
|
66629
|
+
if (!this._paginationInfo)
|
|
66630
|
+
return;
|
|
66631
|
+
this.previousRecord();
|
|
66632
|
+
}, { description: "Retorna ao registro anterior.", element: this._element })
|
|
66633
|
+
.bind("ctrl + alt + ArrowLeft", () => {
|
|
66634
|
+
if (!this._paginationInfo)
|
|
66635
|
+
return;
|
|
66636
|
+
const { currentPage } = this._paginationInfo;
|
|
66637
|
+
if (currentPage > 0) {
|
|
66638
|
+
this.previousPage();
|
|
66639
|
+
}
|
|
66640
|
+
}, { description: "Retorna a pagina anterior.", element: this._element })
|
|
66641
|
+
.bind("ctrl + alt + ArrowRight", () => {
|
|
66642
|
+
if (!this._paginationInfo)
|
|
66643
|
+
return;
|
|
66644
|
+
const { hasMore } = this._paginationInfo;
|
|
66645
|
+
if (hasMore) {
|
|
66646
|
+
this.nextPage();
|
|
66647
|
+
}
|
|
66648
|
+
}, { description: "Avança para a próxima página.", element: this._element });
|
|
66649
|
+
}
|
|
66650
|
+
async removeShortcuts() {
|
|
66651
|
+
if (this._keyboardManager) {
|
|
66652
|
+
this._keyboardManager
|
|
66653
|
+
.unbind("ctrl + .")
|
|
66654
|
+
.unbind("ctrl + ,")
|
|
66655
|
+
.unbind("ctrl + alt + ArrowLeft")
|
|
66656
|
+
.unbind("ctrl + alt + ArrowRight");
|
|
66657
|
+
}
|
|
66658
|
+
}
|
|
66601
66659
|
render() {
|
|
66602
66660
|
var _a;
|
|
66603
66661
|
return (index.h(index.Host, { "no-header": this.hideHeader() }, index.h("div", { class: {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-a7b0c73d.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
|
|
8
|
-
const ezIconCss = ":host{display:flex;overflow:hidden;position:relative;--ez-icon--color:var(--icon--color, #ffffff)}svg{display:flex;justify-content:center;align-items:center;fill:var(--ez-icon--color)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{font-family:'ez-icons' !important;font-size:16px;font-style:normal
|
|
8
|
+
const ezIconCss = ":host{display:flex;overflow:hidden;position:relative;--ez-icon--color:var(--icon--color, #ffffff)}svg{display:flex;justify-content:center;align-items:center;fill:var(--ez-icon--color)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{color:var(--ez-icon--color)}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{font-family:'ez-icons' !important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ez-icon-2chevron-down:before{content:\"\\ea01\"}.ez-icon-2chevron-up:before{content:\"\\ea02\"}.ez-icon-acao:before{content:\"\\ea03\"}.ez-icon-account-outline:before{content:\"\\ea04\"}.ez-icon-account:before{content:\"\\ea05\"}.ez-icon-add-to-cart:before{content:\"\\ea06\"}.ez-icon-alert-circle-inverted:before{content:\"\\ea07\"}.ez-icon-alert-circle:before{content:\"\\ea08\"}.ez-icon-alert-mail:before{content:\"\\ea09\"}.ez-icon-alert-popup:before{content:\"\\ea0a\"}.ez-icon-anexo:before{content:\"\\ea0b\"}.ez-icon-antecipação:before{content:\"\\ea0c\"}.ez-icon-apps:before{content:\"\\ea0d\"}.ez-icon-arrow-forward:before{content:\"\\ea0e\"}.ez-icon-arrow-upward:before{content:\"\\ea0f\"}.ez-icon-arrow_back:before{content:\"\\ea10\"}.ez-icon-arrow_downward:before{content:\"\\ea11\"}.ez-icon-baixa:before{content:\"\\ea12\"}.ez-icon-balance:before{content:\"\\ea13\"}.ez-icon-bell-inverted:before{content:\"\\ea14\"}.ez-icon-bell:before{content:\"\\ea15\"}.ez-icon-boleto:before{content:\"\\ea16\"}.ez-icon-boolean:before{content:\"\\ea17\"}.ez-icon-business-center:before{content:\"\\ea18\"}.ez-icon-calendar-clock:before{content:\"\\ea19\"}.ez-icon-calendar:before{content:\"\\ea1a\"}.ez-icon-cart-history:before{content:\"\\ea1b\"}.ez-icon-cash-remove:before{content:\"\\ea1c\"}.ez-icon-check-circle-inverted:before{content:\"\\ea1d\"}.ez-icon-check-circle:before{content:\"\\ea1e\"}.ez-icon-check:before{content:\"\\ea1f\"}.ez-icon-chevron-down:before{content:\"\\ea20\"}.ez-icon-chevron-left:before{content:\"\\ea21\"}.ez-icon-chevron-right:before{content:\"\\ea22\"}.ez-icon-chevron-up:before{content:\"\\ea23\"}.ez-icon-circle--medium:before{content:\"\\ea24\"}.ez-icon-circle:before{content:\"\\ea25\"}.ez-icon-clean-cart:before{content:\"\\ea26\"}.ez-icon-cleaning:before{content:\"\\ea27\"}.ez-icon-clipboard:before{content:\"\\ea28\"}.ez-icon-clock-rotate-left:before{content:\"\\ea29\"}.ez-icon-close:before{content:\"\\ea2a\"}.ez-icon-cobrar:before{content:\"\\ea2b\"}.ez-icon-code:before{content:\"\\ea2c\"}.ez-icon-configuration:before{content:\"\\ea2d\"}.ez-icon-content-cut:before{content:\"\\ea2e\"}.ez-icon-copy:before{content:\"\\ea2f\"}.ez-icon-credit_card:before{content:\"\\ea30\"}.ez-icon-crop:before{content:\"\\ea31\"}.ez-icon-custom:before{content:\"\\ea32\"}.ez-icon-delete-file:before{content:\"\\ea33\"}.ez-icon-delete:before{content:\"\\ea34\"}.ez-icon-description:before{content:\"\\ea35\"}.ez-icon-dividir:before{content:\"\\ea36\"}.ez-icon-docx:before{content:\"\\ea37\"}.ez-icon-dot-notification:before{content:\"\\ea38\"}.ez-icon-dots-horizontal:before{content:\"\\ea39\"}.ez-icon-dots-vertical:before{content:\"\\ea3a\"}.ez-icon-drag-indicator:before{content:\"\\ea3b\"}.ez-icon-dual-chevron-down:before{content:\"\\ea3c\"}.ez-icon-dual-chevron-left:before{content:\"\\ea3d\"}.ez-icon-dual-chevron-right:before{content:\"\\ea3e\"}.ez-icon-dual-chevron-up:before{content:\"\\ea3f\"}.ez-icon-edit-file:before{content:\"\\ea40\"}.ez-icon-edit-table:before{content:\"\\ea41\"}.ez-icon-edit-time:before{content:\"\\ea42\"}.ez-icon-edit-value:before{content:\"\\ea43\"}.ez-icon-edit:before{content:\"\\ea44\"}.ez-icon-email:before{content:\"\\ea45\"}.ez-icon-estorno:before{content:\"\\ea46\"}.ez-icon-exe:before{content:\"\\ea47\"}.ez-icon-expand:before{content:\"\\ea48\"}.ez-icon-expandir_card:before{content:\"\\ea49\"}.ez-icon-extrato:before{content:\"\\ea4a\"}.ez-icon-eye-off:before{content:\"\\ea4b\"}.ez-icon-eye:before{content:\"\\ea4c\"}.ez-icon-favorite:before{content:\"\\ea4d\"}.ez-icon-figma:before{content:\"\\ea4e\"}.ez-icon-file-download:before{content:\"\\ea4f\"}.ez-icon-file-upload:before{content:\"\\ea50\"}.ez-icon-filter:before{content:\"\\ea51\"}.ez-icon-find-file:before{content:\"\\ea52\"}.ez-icon-find-page:before{content:\"\\ea53\"}.ez-icon-format-color-fill:before{content:\"\\ea54\"}.ez-icon-generic:before{content:\"\\ea55\"}.ez-icon-gif:before{content:\"\\ea56\"}.ez-icon-graph_bar:before{content:\"\\ea57\"}.ez-icon-handshake:before{content:\"\\ea58\"}.ez-icon-help-inverted:before{content:\"\\ea59\"}.ez-icon-help:before{content:\"\\ea5a\"}.ez-icon-hide-list:before{content:\"\\ea5b\"}.ez-icon-hide_menu:before{content:\"\\ea5c\"}.ez-icon-hierarchical-tree:before{content:\"\\ea5d\"}.ez-icon-home:before{content:\"\\ea5e\"}.ez-icon-icons104:before{content:\"\\ea5f\"}.ez-icon-language:before{content:\"\\ea60\"}.ez-icon-launch:before{content:\"\\ea61\"}.ez-icon-lightbulb:before{content:\"\\ea62\"}.ez-icon-list:before{content:\"\\ea63\"}.ez-icon-location:before{content:\"\\ea64\"}.ez-icon-lock-outline:before{content:\"\\ea65\"}.ez-icon-lock:before{content:\"\\ea66\"}.ez-icon-menu:before{content:\"\\ea67\"}.ez-icon-mid:before{content:\"\\ea68\"}.ez-icon-minus:before{content:\"\\ea69\"}.ez-icon-money-off:before{content:\"\\ea6a\"}.ez-icon-money:before{content:\"\\ea6b\"}.ez-icon-more:before{content:\"\\ea6c\"}.ez-icon-mp3:before{content:\"\\ea6d\"}.ez-icon-mp4:before{content:\"\\ea6e\"}.ez-icon-multiple-files:before{content:\"\\ea6f\"}.ez-icon-north-west:before{content:\"\\ea70\"}.ez-icon-number:before{content:\"\\ea71\"}.ez-icon-ordem-ascendente:before{content:\"\\ea72\"}.ez-icon-ordem-descendente:before{content:\"\\ea73\"}.ez-icon-parcelar:before{content:\"\\ea74\"}.ez-icon-pause:before{content:\"\\ea75\"}.ez-icon-payments:before{content:\"\\ea76\"}.ez-icon-pdf:before{content:\"\\ea77\"}.ez-icon-play:before{content:\"\\ea78\"}.ez-icon-plus:before{content:\"\\ea79\"}.ez-icon-png:before{content:\"\\ea7a\"}.ez-icon-power:before{content:\"\\ea7b\"}.ez-icon-pptx:before{content:\"\\ea7c\"}.ez-icon-preview:before{content:\"\\ea7d\"}.ez-icon-print:before{content:\"\\ea7e\"}.ez-icon-push-pin:before{content:\"\\ea7f\"}.ez-icon-rateio:before{content:\"\\ea80\"}.ez-icon-receipt:before{content:\"\\ea81\"}.ez-icon-recolher_card:before{content:\"\\ea82\"}.ez-icon-remove-from-cart:before{content:\"\\ea83\"}.ez-icon-restore:before{content:\"\\ea84\"}.ez-icon-return:before{content:\"\\ea85\"}.ez-icon-sankhya-place:before{content:\"\\ea86\"}.ez-icon-save:before{content:\"\\ea87\"}.ez-icon-search:before{content:\"\\ea88\"}.ez-icon-settings-inverted:before{content:\"\\ea89\"}.ez-icon-settings:before{content:\"\\ea8a\"}.ez-icon-share:before{content:\"\\ea8b\"}.ez-icon-shield:before{content:\"\\ea8c\"}.ez-icon-show-list:before{content:\"\\ea8d\"}.ez-icon-show_menu:before{content:\"\\ea8e\"}.ez-icon-south-east:before{content:\"\\ea8f\"}.ez-icon-sync:before{content:\"\\ea90\"}.ez-icon-table:before{content:\"\\ea91\"}.ez-icon-tag_code:before{content:\"\\ea92\"}.ez-icon-text:before{content:\"\\ea93\"}.ez-icon-timeline:before{content:\"\\ea94\"}.ez-icon-timer-outline:before{content:\"\\ea95\"}.ez-icon-trending-up:before{content:\"\\ea96\"}.ez-icon-tune:before{content:\"\\ea97\"}.ez-icon-txt:before{content:\"\\ea98\"}.ez-icon-un-pin:before{content:\"\\ea99\"}.ez-icon-unfold_less:before{content:\"\\ea9a\"}.ez-icon-unfold_more:before{content:\"\\ea9b\"}.ez-icon-user-circle:before{content:\"\\ea9c\"}.ez-icon-warning-outline:before{content:\"\\ea9d\"}.ez-icon-warning_triangle:before{content:\"\\ea9e\"}.ez-icon-whatshot:before{content:\"\\ea9f\"}.ez-icon-xlsx:before{content:\"\\eaa0\"}.ez-icon-zip:before{content:\"\\eaa1\"}.x-small--font{font-size:12px}.small--font{font-size:16px}.medium--font{font-size:20px}.large--font{font-size:24px}.x-large--font{font-size:30px}";
|
|
9
9
|
|
|
10
10
|
const EzIcon = class {
|
|
11
11
|
constructor(hostRef) {
|