@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-78812-2.0 → 0.0.0-bugfix-dev-KB-76362.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/RecordValidationProcessor-10846595.js +108 -0
- package/dist/cjs/ez-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item_3.cjs.entry.js +19 -12
- package/dist/cjs/ez-chart.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +10 -46
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +2 -3
- package/dist/cjs/ez-date-input.cjs.entry.js +2 -8
- package/dist/cjs/ez-date-time-input.cjs.entry.js +2 -8
- package/dist/cjs/ez-dialog.cjs.entry.js +2 -10
- package/dist/cjs/ez-form-view.cjs.entry.js +2 -2
- package/dist/cjs/ez-form.cjs.entry.js +325 -5
- package/dist/cjs/ez-grid.cjs.entry.js +70518 -14636
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +100 -151
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +0 -7
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +22 -67
- package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-panel.cjs.entry.js +4 -14
- package/dist/cjs/ez-text-area.cjs.entry.js +4 -66
- package/dist/cjs/ez-text-input.cjs.entry.js +7 -49
- package/dist/cjs/ez-time-input.cjs.entry.js +0 -6
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ez-button/ez-button.css +2 -2
- package/dist/collection/components/ez-card-item/ez-card-item.css +5 -14
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +14 -75
- package/dist/collection/components/ez-date-input/ez-date-input.js +4 -35
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +4 -35
- package/dist/collection/components/ez-dialog/ez-dialog.css +3 -3
- package/dist/collection/components/ez-dialog/ez-dialog.js +1 -9
- package/dist/collection/components/ez-filter-input/ez-filter-input.css +11 -0
- package/dist/collection/components/ez-filter-input/ez-filter-input.js +52 -22
- package/dist/collection/components/ez-form/ez-form.js +0 -1
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +2 -3
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +2 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +27 -100
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +0 -8
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +46 -164
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +0 -7
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js +0 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js +0 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +0 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +0 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js +1 -4
- package/dist/collection/components/ez-grid/ez-grid.js +3 -90
- package/dist/collection/components/ez-icon/ez-icon.css +149 -153
- package/dist/collection/components/ez-list/ez-list.css +5 -5
- package/dist/collection/components/ez-list/ez-list.js +170 -152
- package/dist/collection/components/ez-modal/ez-modal.css +0 -4
- package/dist/collection/components/ez-modal/ez-modal.js +2 -2
- package/dist/collection/components/ez-number-input/ez-number-input.js +0 -25
- package/dist/collection/components/ez-popover/ez-popover.css +10 -3
- package/dist/collection/components/ez-popup/ez-popup.css +8 -4
- package/dist/collection/components/ez-search/ez-search.css +1 -1
- package/dist/collection/components/ez-search/ez-search.js +24 -94
- package/dist/collection/components/ez-split-button/ez-split-button.css +2 -2
- package/dist/collection/components/ez-split-panel/ez-split-panel.js +4 -35
- package/dist/collection/components/ez-text-area/ez-text-area.css +0 -49
- package/dist/collection/components/ez-text-area/ez-text-area.js +2 -102
- package/dist/collection/components/ez-text-input/ez-text-input.css +53 -27
- package/dist/collection/components/ez-text-input/ez-text-input.js +6 -84
- package/dist/collection/components/ez-time-input/ez-time-input.js +0 -24
- package/dist/collection/utils/form/DataBinder.js +3 -18
- package/dist/collection/utils/form/FormMetadata.js +1 -1
- package/dist/collection/utils/interfaces/AbstractFieldMetadata.js +1 -1
- package/dist/custom-elements/index.js +71099 -15536
- package/dist/esm/RecordValidationProcessor-9c6cc267.js +105 -0
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-card-item_3.entry.js +19 -12
- package/dist/esm/ez-chart.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +11 -47
- package/dist/esm/ez-custom-form-input_2.entry.js +2 -3
- package/dist/esm/ez-date-input.entry.js +2 -8
- package/dist/esm/ez-date-time-input.entry.js +2 -8
- package/dist/esm/ez-dialog.entry.js +2 -10
- package/dist/esm/ez-form-view.entry.js +2 -2
- package/dist/esm/ez-form.entry.js +324 -4
- package/dist/esm/ez-grid.entry.js +70545 -14663
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +101 -152
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +0 -7
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +22 -67
- package/dist/esm/ez-split-button.entry.js +1 -1
- package/dist/esm/ez-split-panel.entry.js +5 -15
- package/dist/esm/ez-text-area.entry.js +4 -66
- package/dist/esm/ez-text-input.entry.js +7 -49
- package/dist/esm/ez-time-input.entry.js +0 -6
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-00687830.entry.js +1 -0
- package/dist/ezui/p-044d46d5.entry.js +1 -0
- package/dist/ezui/p-11b09aa1.entry.js +1 -0
- package/dist/ezui/p-190c190f.entry.js +304 -0
- package/dist/ezui/p-2de9f0aa.entry.js +1 -0
- package/dist/ezui/p-36180f4d.entry.js +1 -0
- package/dist/ezui/{p-2f53435e.entry.js → p-3b546374.entry.js} +1 -1
- package/dist/ezui/p-3f8c33e0.entry.js +1 -0
- package/dist/ezui/p-52100a6e.entry.js +1 -0
- package/dist/ezui/p-5a40c77a.entry.js +1 -0
- package/dist/ezui/p-61059f6b.entry.js +1 -0
- package/dist/ezui/p-68267f59.entry.js +1 -0
- package/dist/ezui/p-823cc11b.entry.js +1 -0
- package/dist/ezui/p-85b500bb.entry.js +1 -0
- package/dist/ezui/p-8ac13678.entry.js +1 -0
- package/dist/ezui/p-940760bf.entry.js +1 -0
- package/dist/ezui/p-9e08ddb0.entry.js +1 -0
- package/dist/ezui/p-b2a1398f.entry.js +1 -0
- package/dist/ezui/p-ba5f4ee7.entry.js +1 -0
- package/dist/ezui/p-d40b93a7.entry.js +1 -0
- package/dist/ezui/p-d4aba783.entry.js +1 -0
- package/dist/ezui/p-e3ec7422.entry.js +1 -0
- package/dist/ezui/p-f291db18.entry.js +1 -0
- package/dist/ezui/p-f42855b9.js +1 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -7
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +1 -6
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +1 -6
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +0 -2
- package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +11 -4
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +0 -12
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +2 -7
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +1 -2
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -19
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +1 -3
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/cellRendererStatus.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/selectionHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellEditor.d.ts +0 -1
- package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +1 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +1 -11
- package/dist/types/components/ez-list/ez-list.d.ts +26 -3
- package/dist/types/components/ez-modal/ez-modal.d.ts +1 -1
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +0 -4
- package/dist/types/components/ez-search/ez-search.d.ts +2 -10
- package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +0 -4
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +0 -17
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +0 -9
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +0 -4
- package/dist/types/components.d.ts +44 -114
- package/dist/types/utils/form/DataBinder.d.ts +0 -3
- package/package.json +4 -11
- package/dist/cjs/DataBinder-3b083480.js +0 -445
- package/dist/cjs/FocusResolver-885f2173.js +0 -35
- package/dist/collection/components/ez-split-panel/interfaces/IPanelSizeInfo.js +0 -1
- package/dist/collection/utils/FocusResolver.js +0 -31
- package/dist/esm/DataBinder-02fa9bb9.js +0 -441
- package/dist/esm/FocusResolver-1ccbf850.js +0 -33
- package/dist/ezui/p-16e21a40.entry.js +0 -1
- package/dist/ezui/p-33675dae.entry.js +0 -1
- package/dist/ezui/p-397e3026.entry.js +0 -1
- package/dist/ezui/p-3af64edd.entry.js +0 -1
- package/dist/ezui/p-3c10cd94.entry.js +0 -1
- package/dist/ezui/p-3cc9b84a.entry.js +0 -1
- package/dist/ezui/p-3d38bfea.entry.js +0 -1
- package/dist/ezui/p-455e737c.js +0 -1
- package/dist/ezui/p-46a46507.entry.js +0 -1
- package/dist/ezui/p-6bc25bc8.entry.js +0 -1
- package/dist/ezui/p-6bda82d1.entry.js +0 -1
- package/dist/ezui/p-6d31c43c.entry.js +0 -1
- package/dist/ezui/p-7f5afb1f.entry.js +0 -1
- package/dist/ezui/p-8f026744.entry.js +0 -1
- package/dist/ezui/p-9fddffe3.entry.js +0 -309
- package/dist/ezui/p-a4ee2991.entry.js +0 -1
- package/dist/ezui/p-aa7779d0.entry.js +0 -1
- package/dist/ezui/p-be34c77f.entry.js +0 -1
- package/dist/ezui/p-bfc30e61.entry.js +0 -1
- package/dist/ezui/p-bfc59380.entry.js +0 -1
- package/dist/ezui/p-d960a031.entry.js +0 -1
- package/dist/ezui/p-dc628ed3.js +0 -1
- package/dist/ezui/p-dfca5946.entry.js +0 -1
- package/dist/ezui/p-efbe0b73.entry.js +0 -1
- package/dist/types/components/ez-split-panel/interfaces/IPanelSizeInfo.d.ts +0 -9
- package/dist/types/utils/FocusResolver.d.ts +0 -5
|
@@ -38,8 +38,7 @@ export class EzSearch {
|
|
|
38
38
|
this.options = undefined;
|
|
39
39
|
this.suppressSearch = false;
|
|
40
40
|
this.ensureClearButtonVisible = false;
|
|
41
|
-
this.suppressPreLoad =
|
|
42
|
-
this.autoFocus = false;
|
|
41
|
+
this.suppressPreLoad = false;
|
|
43
42
|
}
|
|
44
43
|
observeErrorMessage() {
|
|
45
44
|
var _a;
|
|
@@ -50,21 +49,12 @@ export class EzSearch {
|
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
|
-
getValue(val) {
|
|
54
|
-
return typeof val === 'object' ? val === null || val === void 0 ? void 0 : val.value : val;
|
|
55
|
-
}
|
|
56
52
|
validateNewValue(newValue, oldValue) {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
const newValueIsValid = parsedNewValue !== "[object Object]";
|
|
60
|
-
const valuesIsDifferent = parsedNewValue !== parsedOldValue;
|
|
61
|
-
if (newValueIsValid && valuesIsDifferent) {
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
return false;
|
|
53
|
+
const getValue = (val) => typeof val === 'object' ? val === null || val === void 0 ? void 0 : val.value : val;
|
|
54
|
+
return (getValue(newValue) !== getValue(oldValue));
|
|
65
55
|
}
|
|
66
56
|
async observeValue(newValue, oldValue) {
|
|
67
|
-
if (this._textInput && this.validateNewValue(newValue, oldValue)) {
|
|
57
|
+
if (this._textInput && newValue !== oldValue && this.validateNewValue(newValue, oldValue)) {
|
|
68
58
|
if (typeof newValue === "string") {
|
|
69
59
|
await this.handleValueAsString(newValue);
|
|
70
60
|
return;
|
|
@@ -107,9 +97,9 @@ export class EzSearch {
|
|
|
107
97
|
/**
|
|
108
98
|
* Aplica o foco no campo.
|
|
109
99
|
*/
|
|
110
|
-
async setFocus(
|
|
100
|
+
async setFocus() {
|
|
111
101
|
if (this._textInput) {
|
|
112
|
-
this._textInput.setFocus(
|
|
102
|
+
this._textInput.setFocus();
|
|
113
103
|
}
|
|
114
104
|
}
|
|
115
105
|
/**
|
|
@@ -152,9 +142,6 @@ export class EzSearch {
|
|
|
152
142
|
return;
|
|
153
143
|
}
|
|
154
144
|
await this.loadDescriptionValue(value);
|
|
155
|
-
if (!this._currentValue) {
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
145
|
this.setInputValue();
|
|
159
146
|
this.ezChange.emit(this.value);
|
|
160
147
|
this._currentValue = this.value;
|
|
@@ -210,7 +197,7 @@ export class EzSearch {
|
|
|
210
197
|
return;
|
|
211
198
|
}
|
|
212
199
|
let text = (!this.showSelectedValue || currentValue.value == undefined) ? currentValue.label : currentValue.label ? `${currentValue.value} - ${currentValue.label}` : currentValue.value;
|
|
213
|
-
text = text
|
|
200
|
+
text = text.replace(new RegExp(this._startHighlightTag, 'g'), '').replace(new RegExp(this._endHighlightTag, 'g'), '');
|
|
214
201
|
return text;
|
|
215
202
|
}
|
|
216
203
|
getText() {
|
|
@@ -370,7 +357,7 @@ export class EzSearch {
|
|
|
370
357
|
this.updateVisibleOptions();
|
|
371
358
|
if (this._tabPressed) {
|
|
372
359
|
this._tabPressed = false;
|
|
373
|
-
this.controlEmptySearch(
|
|
360
|
+
this.controlEmptySearch();
|
|
374
361
|
}
|
|
375
362
|
}
|
|
376
363
|
else {
|
|
@@ -385,16 +372,15 @@ export class EzSearch {
|
|
|
385
372
|
replaceHighlight(value) {
|
|
386
373
|
const startHighlight = new RegExp(this._startHighlightTag, 'g');
|
|
387
374
|
const endHighlight = new RegExp(this._endHighlightTag, 'g');
|
|
388
|
-
return
|
|
375
|
+
return (value !== null && value !== void 0 ? value : "").replace(startHighlight, '').replace(endHighlight, '');
|
|
389
376
|
}
|
|
390
|
-
selectOption(newOption
|
|
377
|
+
selectOption(newOption) {
|
|
391
378
|
var _a, _b;
|
|
392
379
|
const currentValue = this.getSelectedOption(this.value);
|
|
393
380
|
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) });
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
const adjustedOpt = !(newOptionsFormatted === null || newOptionsFormatted === void 0 ? void 0 : newOptionsFormatted.value) ? undefined : newOptionsFormatted;
|
|
381
|
+
if ((((_a = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value) === null || _b === void 0 ? void 0 : _b.toString()))
|
|
382
|
+
|| (currentValue == undefined && newOptionsReplaced != undefined && "value" in newOptionsReplaced)) {
|
|
383
|
+
const adjustedOpt = !(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value) ? undefined : newOptionsReplaced;
|
|
398
384
|
this.value = adjustedOpt;
|
|
399
385
|
this._currentValue = adjustedOpt;
|
|
400
386
|
}
|
|
@@ -404,11 +390,6 @@ export class EzSearch {
|
|
|
404
390
|
}
|
|
405
391
|
this._visibleOptions = [];
|
|
406
392
|
this.clearSource();
|
|
407
|
-
if (focusOnInput) {
|
|
408
|
-
setTimeout(() => {
|
|
409
|
-
this.setFocus();
|
|
410
|
-
}, 0);
|
|
411
|
-
}
|
|
412
393
|
}
|
|
413
394
|
loadOptions(mode, argument = "") {
|
|
414
395
|
this._criteria = argument;
|
|
@@ -445,7 +426,7 @@ export class EzSearch {
|
|
|
445
426
|
this.value = null;
|
|
446
427
|
this._currentValue = null;
|
|
447
428
|
}
|
|
448
|
-
controlListWithOnlyOne(
|
|
429
|
+
controlListWithOnlyOne() {
|
|
449
430
|
var _a, _b;
|
|
450
431
|
const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
|
|
451
432
|
if ((source === null || source === void 0 ? void 0 : source.length) > 0) {
|
|
@@ -456,17 +437,17 @@ export class EzSearch {
|
|
|
456
437
|
value: (_b = source[0].value) === null || _b === void 0 ? void 0 : _b.replace(startHighlight, '').replace(endHighlight, ''),
|
|
457
438
|
label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
|
|
458
439
|
};
|
|
459
|
-
this.selectOption(option
|
|
440
|
+
this.selectOption(option);
|
|
460
441
|
}
|
|
461
442
|
}
|
|
462
|
-
controlEmptySearch(
|
|
443
|
+
controlEmptySearch() {
|
|
463
444
|
var _a;
|
|
464
445
|
if (!((_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
465
446
|
this.clearSearch();
|
|
466
447
|
ApplicationUtils.info(this._textEmptyList);
|
|
467
448
|
}
|
|
468
449
|
else {
|
|
469
|
-
this.controlListWithOnlyOne(
|
|
450
|
+
this.controlListWithOnlyOne();
|
|
470
451
|
}
|
|
471
452
|
}
|
|
472
453
|
async loadDescriptionValue(argument) {
|
|
@@ -537,19 +518,6 @@ export class EzSearch {
|
|
|
537
518
|
this._preSelection = undefined;
|
|
538
519
|
this.updateVisibleOptions();
|
|
539
520
|
}
|
|
540
|
-
async handleInitialValue() {
|
|
541
|
-
const valueIsValid = !!this.getValue(this.value);
|
|
542
|
-
if (!valueIsValid) {
|
|
543
|
-
return;
|
|
544
|
-
}
|
|
545
|
-
if (typeof this.value === "string") {
|
|
546
|
-
await this.handleValueAsString(this.value);
|
|
547
|
-
return;
|
|
548
|
-
}
|
|
549
|
-
let text = this.getFormattedText(this.value);
|
|
550
|
-
text = this.replaceQuotes(text);
|
|
551
|
-
this._textInput.value = text;
|
|
552
|
-
}
|
|
553
521
|
//---------------------------------------------
|
|
554
522
|
// Lifecycle web component
|
|
555
523
|
//---------------------------------------------
|
|
@@ -581,9 +549,10 @@ export class EzSearch {
|
|
|
581
549
|
ElementIDUtils.addIDInfoIfNotExists(elem, "itemSearch");
|
|
582
550
|
});
|
|
583
551
|
}
|
|
584
|
-
|
|
552
|
+
componentDidLoad() {
|
|
585
553
|
this._currentValue = this.value;
|
|
586
554
|
CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
|
|
555
|
+
this.setInputValue(false);
|
|
587
556
|
this._resizeObserver = new ResizeObserver((entries) => {
|
|
588
557
|
window.requestAnimationFrame(() => {
|
|
589
558
|
if (!Array.isArray(entries) || !entries.length)
|
|
@@ -594,16 +563,6 @@ export class EzSearch {
|
|
|
594
563
|
}
|
|
595
564
|
});
|
|
596
565
|
});
|
|
597
|
-
await this.handleInitialValue();
|
|
598
|
-
if (this.autoFocus) {
|
|
599
|
-
requestAnimationFrame(() => {
|
|
600
|
-
this.setFocus({ selectText: true });
|
|
601
|
-
});
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
disconnectedCallback() {
|
|
605
|
-
var _a;
|
|
606
|
-
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
607
566
|
}
|
|
608
567
|
//---------------------------------------------
|
|
609
568
|
// Event handlers
|
|
@@ -673,16 +632,12 @@ export class EzSearch {
|
|
|
673
632
|
}
|
|
674
633
|
switch (event.key) {
|
|
675
634
|
case "ArrowDown":
|
|
676
|
-
event.stopPropagation();
|
|
677
|
-
if (this.canShowListOptions())
|
|
678
|
-
event.preventDefault();
|
|
679
635
|
this.nextOption();
|
|
636
|
+
event.stopPropagation();
|
|
680
637
|
break;
|
|
681
638
|
case "ArrowUp":
|
|
682
|
-
event.stopPropagation();
|
|
683
|
-
if (this.canShowListOptions())
|
|
684
|
-
event.preventDefault();
|
|
685
639
|
this.previousOption();
|
|
640
|
+
event.stopPropagation();
|
|
686
641
|
break;
|
|
687
642
|
case "Enter":
|
|
688
643
|
this.handleEventPropagation(event);
|
|
@@ -693,7 +648,7 @@ export class EzSearch {
|
|
|
693
648
|
break;
|
|
694
649
|
case "Tab":
|
|
695
650
|
this._tabPressed = true;
|
|
696
|
-
this.controlListWithOnlyOne(
|
|
651
|
+
this.controlListWithOnlyOne();
|
|
697
652
|
break;
|
|
698
653
|
}
|
|
699
654
|
//ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
|
|
@@ -1099,24 +1054,6 @@ export class EzSearch {
|
|
|
1099
1054
|
},
|
|
1100
1055
|
"attribute": "suppress-pre-load",
|
|
1101
1056
|
"reflect": false,
|
|
1102
|
-
"defaultValue": "true"
|
|
1103
|
-
},
|
|
1104
|
-
"autoFocus": {
|
|
1105
|
-
"type": "boolean",
|
|
1106
|
-
"mutable": false,
|
|
1107
|
-
"complexType": {
|
|
1108
|
-
"original": "boolean",
|
|
1109
|
-
"resolved": "boolean",
|
|
1110
|
-
"references": {}
|
|
1111
|
-
},
|
|
1112
|
-
"required": false,
|
|
1113
|
-
"optional": false,
|
|
1114
|
-
"docs": {
|
|
1115
|
-
"tags": [],
|
|
1116
|
-
"text": "Se true o campo de texto receber\u00E1 o foco ao ser renderizado."
|
|
1117
|
-
},
|
|
1118
|
-
"attribute": "auto-focus",
|
|
1119
|
-
"reflect": false,
|
|
1120
1057
|
"defaultValue": "false"
|
|
1121
1058
|
}
|
|
1122
1059
|
};
|
|
@@ -1173,18 +1110,11 @@ export class EzSearch {
|
|
|
1173
1110
|
},
|
|
1174
1111
|
"setFocus": {
|
|
1175
1112
|
"complexType": {
|
|
1176
|
-
"signature": "(
|
|
1177
|
-
"parameters": [
|
|
1178
|
-
"tags": [],
|
|
1179
|
-
"text": ""
|
|
1180
|
-
}],
|
|
1113
|
+
"signature": "() => Promise<void>",
|
|
1114
|
+
"parameters": [],
|
|
1181
1115
|
"references": {
|
|
1182
1116
|
"Promise": {
|
|
1183
1117
|
"location": "global"
|
|
1184
|
-
},
|
|
1185
|
-
"TFocusOptions": {
|
|
1186
|
-
"location": "import",
|
|
1187
|
-
"path": "../ez-text-input/ez-text-input"
|
|
1188
1118
|
}
|
|
1189
1119
|
},
|
|
1190
1120
|
"return": "Promise<void>"
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
/*@doc Define a cor de fundo quando o cursor está sobre o botão.*/
|
|
42
42
|
--ez-split-button--hover--background-color: var(--background--light, #ffffff);
|
|
43
43
|
/*@doc Define a cor do texto quando o botão está desabilitado.*/
|
|
44
|
-
--ez-split-button--disabled-color: var(--text--
|
|
44
|
+
--ez-split-button--disabled-color: var(--text--disable);
|
|
45
45
|
/*@doc Define a cor de fundo quando o botão está desabilitado.*/
|
|
46
|
-
--ez-split-button--disabled--background-color: var(--
|
|
46
|
+
--ez-split-button--disabled--background-color: var(--color--disable-secondary);
|
|
47
47
|
/*@doc Define o estido da borda quando o botão está selecionado.*/
|
|
48
48
|
--ez-split-button--focus--border: var(--border--medium, 2px) var(--color--primary-300);
|
|
49
49
|
/*@doc Define a sombra do botão quando selecionado.*/
|
|
@@ -38,7 +38,7 @@ export class SplitPanel {
|
|
|
38
38
|
this.initSplit();
|
|
39
39
|
this._mutationObserver = new MutationObserver((mutationsList) => {
|
|
40
40
|
for (const mutation of mutationsList) {
|
|
41
|
-
if (mutation.type === 'childList' &&
|
|
41
|
+
if (mutation.type === 'childList' && this._buildInProgress === false) {
|
|
42
42
|
this._buildInProgress = true;
|
|
43
43
|
window.requestAnimationFrame(() => {
|
|
44
44
|
this.rebuildLayout();
|
|
@@ -61,29 +61,20 @@ export class SplitPanel {
|
|
|
61
61
|
if (!this._items.length) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
this._element.style[this.direction
|
|
64
|
+
this._element.style[this.direction == 'row' ? 'grid-template-rows' : 'grid-template-columns'] = this.getGridTemplate();
|
|
65
65
|
Split(this.getGutters());
|
|
66
66
|
}
|
|
67
|
-
handlePanelDragEnd() {
|
|
68
|
-
const items = this._items.map(item => ({
|
|
69
|
-
id: item.id,
|
|
70
|
-
height: item.clientHeight,
|
|
71
|
-
width: item.clientWidth,
|
|
72
|
-
}));
|
|
73
|
-
this.resizeEnd.emit({ panelId: this._element.id, items });
|
|
74
|
-
}
|
|
75
67
|
getGutters() {
|
|
76
68
|
const gutters = {
|
|
77
69
|
columnGutters: [],
|
|
78
70
|
rowGutters: [],
|
|
79
|
-
onDragEnd: () => this.handlePanelDragEnd()
|
|
80
71
|
};
|
|
81
72
|
if (!this._items.length) {
|
|
82
73
|
return gutters;
|
|
83
74
|
}
|
|
84
|
-
const proToChange = this.direction
|
|
75
|
+
const proToChange = this.direction == 'row' ? 'rowGutters' : 'columnGutters';
|
|
85
76
|
this._items.forEach((item, index) => {
|
|
86
|
-
if (index
|
|
77
|
+
if (index == this._items.length - 1)
|
|
87
78
|
return;
|
|
88
79
|
let gutterTrack = item.dataset.trackNumber;
|
|
89
80
|
if (index === this._items.length - 1) {
|
|
@@ -199,28 +190,6 @@ export class SplitPanel {
|
|
|
199
190
|
}
|
|
200
191
|
};
|
|
201
192
|
}
|
|
202
|
-
static get events() {
|
|
203
|
-
return [{
|
|
204
|
-
"method": "resizeEnd",
|
|
205
|
-
"name": "resizeEnd",
|
|
206
|
-
"bubbles": true,
|
|
207
|
-
"cancelable": true,
|
|
208
|
-
"composed": true,
|
|
209
|
-
"docs": {
|
|
210
|
-
"tags": [],
|
|
211
|
-
"text": ""
|
|
212
|
-
},
|
|
213
|
-
"complexType": {
|
|
214
|
-
"original": "IPanelSizeInfo",
|
|
215
|
-
"resolved": "IPanelSizeInfo",
|
|
216
|
-
"references": {
|
|
217
|
-
"IPanelSizeInfo": {
|
|
218
|
-
"location": "global"
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}];
|
|
223
|
-
}
|
|
224
193
|
static get methods() {
|
|
225
194
|
return {
|
|
226
195
|
"rebuildLayout": {
|
|
@@ -51,20 +51,6 @@
|
|
|
51
51
|
/*@doc Define o espaçamento direito do label.*/
|
|
52
52
|
--text-area__label--padding-right: 12px;
|
|
53
53
|
|
|
54
|
-
/* scrollbar */
|
|
55
|
-
/*@doc Define a cor da barra de rolagem do componente.*/
|
|
56
|
-
--text-area__scrollbar--color-default: var(--scrollbar--default, #626e82);
|
|
57
|
-
/*@doc Define a cor de fundo da barra de rolagem do componente.*/
|
|
58
|
-
--text-area__scrollbar--color-background: var(--scrollbar--background, #E5EAF0);
|
|
59
|
-
/*@doc Define a cor do hover na barra de rolagem do componente.*/
|
|
60
|
-
--text-area__scrollbar--color-hover: var(--scrollbar--hover, #2B3A54);
|
|
61
|
-
/*@doc Define a cor do active na barra de rolagem do componente.*/
|
|
62
|
-
--text-area__scrollbar--color-clicked: var(--scrollbar--clicked, #a2abb9);
|
|
63
|
-
/*@doc Define o raio da borda da barra de rolagem do componente.*/
|
|
64
|
-
--text-area__scrollbar--border-radius: var(--border--radius-small, 6px);
|
|
65
|
-
/*@doc Define a largura da barra de rolagem do componente.*/
|
|
66
|
-
--text-area__scrollbar--width: var(--space--medium, 12px);
|
|
67
|
-
|
|
68
54
|
/***************
|
|
69
55
|
host style
|
|
70
56
|
***************/
|
|
@@ -91,9 +77,6 @@ textarea {
|
|
|
91
77
|
font-size: var(--text-area--font-size);
|
|
92
78
|
color: var(--text-area--color);
|
|
93
79
|
margin-top: calc(var(--space--medium, 12px) + 4px);
|
|
94
|
-
|
|
95
|
-
scrollbar-width: thin;
|
|
96
|
-
scrollbar-color: var(--text-area__scrollbar--color-clicked) var(--text-area__scrollbar--color-background);
|
|
97
80
|
}
|
|
98
81
|
|
|
99
82
|
textarea:focus {
|
|
@@ -109,38 +92,6 @@ textarea:disabled {
|
|
|
109
92
|
cursor: not-allowed;
|
|
110
93
|
}
|
|
111
94
|
|
|
112
|
-
textarea::-webkit-scrollbar {
|
|
113
|
-
background-color: var(--text-area__scrollbar--color-background);
|
|
114
|
-
|
|
115
|
-
width: var(--text-area__scrollbar--width);
|
|
116
|
-
max-width: var(--text-area__scrollbar--width);
|
|
117
|
-
min-width: var(--text-area__scrollbar--width);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
textarea::-webkit-scrollbar-thumb {
|
|
121
|
-
/*public*/
|
|
122
|
-
background-color: var(--text-area__scrollbar--color-default);
|
|
123
|
-
border-radius: var(--text-area__scrollbar--border-radius);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
textarea::-webkit-scrollbar-track {
|
|
127
|
-
/*public*/
|
|
128
|
-
background-color: var(--text-area__scrollbar--color-background);
|
|
129
|
-
border-radius: var(--text-area__scrollbar--border-radius);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
textarea::-webkit-scrollbar-thumb:vertical:hover,
|
|
133
|
-
textarea::-webkit-scrollbar-thumb:horizontal:hover {
|
|
134
|
-
/*public*/
|
|
135
|
-
background-color: var(--text-area__scrollbar--color-hover);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
textarea::-webkit-scrollbar-thumb:vertical:active,
|
|
139
|
-
textarea::-webkit-scrollbar-thumb:horizontal:active {
|
|
140
|
-
/*public*/
|
|
141
|
-
background-color: var(--text-area__scrollbar--color-clicked);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
95
|
.textarea {
|
|
145
96
|
/*private*/
|
|
146
97
|
width: 100%;
|
|
@@ -2,8 +2,6 @@ import { ElementIDUtils } from '@sankhyalabs/core';
|
|
|
2
2
|
import { h, Host } from '@stencil/core';
|
|
3
3
|
export class EzTextArea {
|
|
4
4
|
constructor() {
|
|
5
|
-
this.LINE_HEIGHT = 24;
|
|
6
|
-
this.HEIGHT_RATIO = 1.4;
|
|
7
5
|
this.label = undefined;
|
|
8
6
|
this.value = undefined;
|
|
9
7
|
this.enabled = true;
|
|
@@ -12,8 +10,6 @@ export class EzTextArea {
|
|
|
12
10
|
this.canShowError = true;
|
|
13
11
|
this.mode = "regular";
|
|
14
12
|
this.enableResize = false;
|
|
15
|
-
this.autoRows = false;
|
|
16
|
-
this.autoFocus = false;
|
|
17
13
|
}
|
|
18
14
|
observeErrorMessage() {
|
|
19
15
|
var _a, _b, _c, _d;
|
|
@@ -51,17 +47,8 @@ export class EzTextArea {
|
|
|
51
47
|
observeRows() {
|
|
52
48
|
const rows = this.rows > 0 ? this.rows : this.mode != "slim" ? 4 : 2;
|
|
53
49
|
if (rows !== this.rows) {
|
|
54
|
-
this.
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
observeAutoRows() {
|
|
58
|
-
var _a, _b;
|
|
59
|
-
if (this.autoRows) {
|
|
60
|
-
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
61
|
-
this.initializeResizeObserver();
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
(_b = this._resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
50
|
+
this.rows = rows;
|
|
51
|
+
this._initialRows = rows;
|
|
65
52
|
}
|
|
66
53
|
}
|
|
67
54
|
//---------------------------------------------
|
|
@@ -130,42 +117,6 @@ export class EzTextArea {
|
|
|
130
117
|
isFocused() {
|
|
131
118
|
return this._hostElement.shadowRoot.activeElement !== null;
|
|
132
119
|
}
|
|
133
|
-
updateRows(newRows) {
|
|
134
|
-
this.rows = newRows;
|
|
135
|
-
this._initialRows = newRows;
|
|
136
|
-
}
|
|
137
|
-
calculateMaxRows() {
|
|
138
|
-
const parentElement = this._hostElement.parentElement;
|
|
139
|
-
if (!parentElement) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
const height = Math.max((parentElement === null || parentElement === void 0 ? void 0 : parentElement.clientHeight) || 0, this.LINE_HEIGHT);
|
|
143
|
-
if (height > 0) {
|
|
144
|
-
const maxRows = Math.floor(height / this.LINE_HEIGHT * this.HEIGHT_RATIO);
|
|
145
|
-
if (maxRows !== this.rows) {
|
|
146
|
-
this.updateRows(maxRows);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
initializeResizeObserver() {
|
|
151
|
-
if (!this.autoRows) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
const parentElement = this._hostElement.parentElement;
|
|
155
|
-
if (parentElement) {
|
|
156
|
-
try {
|
|
157
|
-
if (this._resizeObserver != undefined) {
|
|
158
|
-
this._resizeObserver.unobserve(parentElement);
|
|
159
|
-
}
|
|
160
|
-
this._resizeObserver = new ResizeObserver(this.calculateMaxRows.bind(this));
|
|
161
|
-
this._resizeObserver.observe(parentElement);
|
|
162
|
-
}
|
|
163
|
-
catch (e) {
|
|
164
|
-
console.warn(e);
|
|
165
|
-
}
|
|
166
|
-
this.calculateMaxRows();
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
120
|
//---------------------------------------------
|
|
170
121
|
// Event handlers
|
|
171
122
|
//---------------------------------------------
|
|
@@ -188,13 +139,6 @@ export class EzTextArea {
|
|
|
188
139
|
this._container.classList.add("textarea--focus");
|
|
189
140
|
}
|
|
190
141
|
}
|
|
191
|
-
connectedCallback() {
|
|
192
|
-
this.initializeResizeObserver();
|
|
193
|
-
}
|
|
194
|
-
disconnectedCallback() {
|
|
195
|
-
var _a;
|
|
196
|
-
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
197
|
-
}
|
|
198
142
|
//---------------------------------------------
|
|
199
143
|
// Lifecycle web component
|
|
200
144
|
//---------------------------------------------
|
|
@@ -202,11 +146,6 @@ export class EzTextArea {
|
|
|
202
146
|
this.observeErrorMessage();
|
|
203
147
|
this.adjustFloatingLabel();
|
|
204
148
|
this.observeMode();
|
|
205
|
-
if (this.autoFocus) {
|
|
206
|
-
requestAnimationFrame(() => {
|
|
207
|
-
this.setFocus();
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
149
|
}
|
|
211
150
|
render() {
|
|
212
151
|
ElementIDUtils.addIDInfoIfNotExists(this._hostElement, 'input');
|
|
@@ -372,42 +311,6 @@ export class EzTextArea {
|
|
|
372
311
|
"attribute": "enable-resize",
|
|
373
312
|
"reflect": true,
|
|
374
313
|
"defaultValue": "false"
|
|
375
|
-
},
|
|
376
|
-
"autoRows": {
|
|
377
|
-
"type": "boolean",
|
|
378
|
-
"mutable": false,
|
|
379
|
-
"complexType": {
|
|
380
|
-
"original": "boolean",
|
|
381
|
-
"resolved": "boolean",
|
|
382
|
-
"references": {}
|
|
383
|
-
},
|
|
384
|
-
"required": false,
|
|
385
|
-
"optional": false,
|
|
386
|
-
"docs": {
|
|
387
|
-
"tags": [],
|
|
388
|
-
"text": "Ativa a op\u00E7\u00E3o de fazer as linhas do componente serem baseados na altura m\u00E1xima."
|
|
389
|
-
},
|
|
390
|
-
"attribute": "auto-rows",
|
|
391
|
-
"reflect": true,
|
|
392
|
-
"defaultValue": "false"
|
|
393
|
-
},
|
|
394
|
-
"autoFocus": {
|
|
395
|
-
"type": "boolean",
|
|
396
|
-
"mutable": false,
|
|
397
|
-
"complexType": {
|
|
398
|
-
"original": "boolean",
|
|
399
|
-
"resolved": "boolean",
|
|
400
|
-
"references": {}
|
|
401
|
-
},
|
|
402
|
-
"required": false,
|
|
403
|
-
"optional": false,
|
|
404
|
-
"docs": {
|
|
405
|
-
"tags": [],
|
|
406
|
-
"text": "Se true o campo de texto receber\u00E1 o foco ao ser renderizado."
|
|
407
|
-
},
|
|
408
|
-
"attribute": "auto-focus",
|
|
409
|
-
"reflect": false,
|
|
410
|
-
"defaultValue": "false"
|
|
411
314
|
}
|
|
412
315
|
};
|
|
413
316
|
}
|
|
@@ -520,9 +423,6 @@ export class EzTextArea {
|
|
|
520
423
|
}, {
|
|
521
424
|
"propName": "rows",
|
|
522
425
|
"methodName": "observeRows"
|
|
523
|
-
}, {
|
|
524
|
-
"propName": "autoRows",
|
|
525
|
-
"methodName": "observeAutoRows"
|
|
526
426
|
}];
|
|
527
427
|
}
|
|
528
428
|
}
|