@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-64375.0 → 0.0.0-bugfix-dev-kb-62422.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-grid.cjs.entry.js +11 -21
- package/dist/cjs/ez-search.cjs.entry.js +1 -11
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +11 -21
- package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js +40 -0
- package/dist/collection/components/ez-search/ez-search.js +1 -11
- package/dist/custom-elements/index.js +12 -32
- package/dist/esm/ez-grid.entry.js +11 -21
- package/dist/esm/ez-search.entry.js +1 -11
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-1c462106.entry.js +1 -0
- package/dist/ezui/{p-97db197f.entry.js → p-6ebee89c.entry.js} +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +2 -4
- package/dist/types/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.d.ts +6 -0
- package/dist/types/components/ez-search/ez-search.d.ts +0 -1
- package/package.json +1 -1
- package/dist/ezui/p-42566f9e.entry.js +0 -1
|
@@ -119875,9 +119875,7 @@ class AgGridController {
|
|
|
119875
119875
|
this.STATUS_COL_ID = 'statusColumn';
|
|
119876
119876
|
this.RECORD_ARCHIVE_COL_ID = '__RECORD_ARCHIVE__';
|
|
119877
119877
|
this.BLOCK_LOAD_DEBOUNCE = 100;
|
|
119878
|
-
this.
|
|
119879
|
-
this.DEFAULT_ICON_SIZE = 12;
|
|
119880
|
-
this.DEFAULT_MAX_SIZE = 200;
|
|
119878
|
+
this.DOC_WIDTH = 1150;
|
|
119881
119879
|
this._menuItems = [];
|
|
119882
119880
|
this._idAttribName = '__record__id__';
|
|
119883
119881
|
this._gridConfig = [];
|
|
@@ -120421,7 +120419,7 @@ class AgGridController {
|
|
|
120421
120419
|
const columnsOffset = colDef.length - columns.length;
|
|
120422
120420
|
let sort = [];
|
|
120423
120421
|
state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
|
|
120424
|
-
const colWidth = this.
|
|
120422
|
+
const colWidth = this._gridOptions.columnApi.getColumn(cfgColumn.name).getActualWidth();
|
|
120425
120423
|
this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
|
|
120426
120424
|
this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
|
|
120427
120425
|
visibleColumns.push(cfgColumn.name);
|
|
@@ -120438,6 +120436,11 @@ class AgGridController {
|
|
|
120438
120436
|
});
|
|
120439
120437
|
this._gridConfig = state;
|
|
120440
120438
|
}
|
|
120439
|
+
getAdaptiveWidth(width) {
|
|
120440
|
+
const widthGrid = this._container.clientWidth;
|
|
120441
|
+
const adaptiveWidth = (this.DOC_WIDTH * width) / widthGrid;
|
|
120442
|
+
return Math.round(adaptiveWidth);
|
|
120443
|
+
}
|
|
120441
120444
|
getColumnsState() {
|
|
120442
120445
|
if (this._grid === undefined) {
|
|
120443
120446
|
throw new Error('Erro interno: Grid ainda não inicializado.');
|
|
@@ -120445,13 +120448,15 @@ class AgGridController {
|
|
|
120445
120448
|
const colState = this._gridOptions.columnApi.getColumnState();
|
|
120446
120449
|
return colState
|
|
120447
120450
|
.map(s => {
|
|
120448
|
-
const
|
|
120451
|
+
const column = this._gridOptions.columnApi.getColumn(s.colId);
|
|
120452
|
+
const def = column.getColDef();
|
|
120453
|
+
const width = this.getAdaptiveWidth(column.getActualWidth());
|
|
120449
120454
|
const label = def.headerName;
|
|
120450
120455
|
const name = def.checkboxSelection ? '__SELECTION__' : s.colId;
|
|
120451
120456
|
const colState = { label, name };
|
|
120452
120457
|
this.conditionalSet(colState, 'sort', s.sort);
|
|
120453
120458
|
this.conditionalSet(colState, 'sortIndex', s.sortIndex);
|
|
120454
|
-
this.conditionalSet(colState, 'width',
|
|
120459
|
+
this.conditionalSet(colState, 'width', width);
|
|
120455
120460
|
this.conditionalSet(colState, 'pinned', s.pinned !== null);
|
|
120456
120461
|
this.conditionalSet(colState, 'hidden', s.hide);
|
|
120457
120462
|
const props = new Map();
|
|
@@ -120705,21 +120710,6 @@ class AgGridController {
|
|
|
120705
120710
|
host[attribute] = value;
|
|
120706
120711
|
}
|
|
120707
120712
|
}
|
|
120708
|
-
getColumnWidth(cfgColumn) {
|
|
120709
|
-
var _a, _b;
|
|
120710
|
-
if (cfgColumn == undefined) {
|
|
120711
|
-
return;
|
|
120712
|
-
}
|
|
120713
|
-
if (cfgColumn.customWidth != undefined) {
|
|
120714
|
-
return cfgColumn.customWidth;
|
|
120715
|
-
}
|
|
120716
|
-
const field = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(cfgColumn.name);
|
|
120717
|
-
if ((field === null || field === void 0 ? void 0 : field.userInterface) === core.UserInterface.SEARCH) {
|
|
120718
|
-
return this.DEFAULT_MAX_SIZE;
|
|
120719
|
-
}
|
|
120720
|
-
const labelSize = (((_b = field === null || field === void 0 ? void 0 : field.label) === null || _b === void 0 ? void 0 : _b.length) || 0) * this.DEFAULT_FONT_SIZE + this.DEFAULT_ICON_SIZE;
|
|
120721
|
-
return labelSize > this.DEFAULT_MAX_SIZE ? this.DEFAULT_MAX_SIZE : labelSize;
|
|
120722
|
-
}
|
|
120723
120713
|
setCellEditors(customEditors) {
|
|
120724
120714
|
var _a;
|
|
120725
120715
|
if (!this._editionManager) {
|
|
@@ -59,15 +59,7 @@ const EzSearch = class {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
async observeValue(newValue, oldValue) {
|
|
62
|
-
if (core.ObjectUtils.equals(newValue, oldValue))
|
|
63
|
-
return;
|
|
64
|
-
if (core.ObjectUtils.hasEquivalentProps(newValue, oldValue) && this._textInput.value) {
|
|
65
|
-
this.value = this._currentValue;
|
|
66
|
-
this._lookupMode = false;
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
62
|
if (this._textInput && newValue != oldValue) {
|
|
70
|
-
this._currentValue = newValue;
|
|
71
63
|
try {
|
|
72
64
|
if (typeof newValue === "string") {
|
|
73
65
|
await this.handleValueAsString(newValue);
|
|
@@ -158,10 +150,8 @@ const EzSearch = class {
|
|
|
158
150
|
}
|
|
159
151
|
}
|
|
160
152
|
async handleValueAsString(value) {
|
|
161
|
-
|
|
162
|
-
if (selectedOption) {
|
|
153
|
+
if (this.getSelectedOption(value)) {
|
|
163
154
|
this.setInputValue();
|
|
164
|
-
this.ezChange.emit(selectedOption);
|
|
165
155
|
return;
|
|
166
156
|
}
|
|
167
157
|
await this.loadDescriptionValue(value);
|
|
@@ -34,9 +34,7 @@ export default class AgGridController {
|
|
|
34
34
|
this.STATUS_COL_ID = 'statusColumn';
|
|
35
35
|
this.RECORD_ARCHIVE_COL_ID = '__RECORD_ARCHIVE__';
|
|
36
36
|
this.BLOCK_LOAD_DEBOUNCE = 100;
|
|
37
|
-
this.
|
|
38
|
-
this.DEFAULT_ICON_SIZE = 12;
|
|
39
|
-
this.DEFAULT_MAX_SIZE = 200;
|
|
37
|
+
this.DOC_WIDTH = 1150;
|
|
40
38
|
this._menuItems = [];
|
|
41
39
|
this._idAttribName = '__record__id__';
|
|
42
40
|
this._gridConfig = [];
|
|
@@ -580,7 +578,7 @@ export default class AgGridController {
|
|
|
580
578
|
const columnsOffset = colDef.length - columns.length;
|
|
581
579
|
let sort = [];
|
|
582
580
|
state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
|
|
583
|
-
const colWidth = this.
|
|
581
|
+
const colWidth = this._gridOptions.columnApi.getColumn(cfgColumn.name).getActualWidth();
|
|
584
582
|
this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
|
|
585
583
|
this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
|
|
586
584
|
visibleColumns.push(cfgColumn.name);
|
|
@@ -597,6 +595,11 @@ export default class AgGridController {
|
|
|
597
595
|
});
|
|
598
596
|
this._gridConfig = state;
|
|
599
597
|
}
|
|
598
|
+
getAdaptiveWidth(width) {
|
|
599
|
+
const widthGrid = this._container.clientWidth;
|
|
600
|
+
const adaptiveWidth = (this.DOC_WIDTH * width) / widthGrid;
|
|
601
|
+
return Math.round(adaptiveWidth);
|
|
602
|
+
}
|
|
600
603
|
getColumnsState() {
|
|
601
604
|
if (this._grid === undefined) {
|
|
602
605
|
throw new Error('Erro interno: Grid ainda não inicializado.');
|
|
@@ -604,13 +607,15 @@ export default class AgGridController {
|
|
|
604
607
|
const colState = this._gridOptions.columnApi.getColumnState();
|
|
605
608
|
return colState
|
|
606
609
|
.map(s => {
|
|
607
|
-
const
|
|
610
|
+
const column = this._gridOptions.columnApi.getColumn(s.colId);
|
|
611
|
+
const def = column.getColDef();
|
|
612
|
+
const width = this.getAdaptiveWidth(column.getActualWidth());
|
|
608
613
|
const label = def.headerName;
|
|
609
614
|
const name = def.checkboxSelection ? '__SELECTION__' : s.colId;
|
|
610
615
|
const colState = { label, name };
|
|
611
616
|
this.conditionalSet(colState, 'sort', s.sort);
|
|
612
617
|
this.conditionalSet(colState, 'sortIndex', s.sortIndex);
|
|
613
|
-
this.conditionalSet(colState, 'width',
|
|
618
|
+
this.conditionalSet(colState, 'width', width);
|
|
614
619
|
this.conditionalSet(colState, 'pinned', s.pinned !== null);
|
|
615
620
|
this.conditionalSet(colState, 'hidden', s.hide);
|
|
616
621
|
const props = new Map();
|
|
@@ -864,21 +869,6 @@ export default class AgGridController {
|
|
|
864
869
|
host[attribute] = value;
|
|
865
870
|
}
|
|
866
871
|
}
|
|
867
|
-
getColumnWidth(cfgColumn) {
|
|
868
|
-
var _a, _b;
|
|
869
|
-
if (cfgColumn == undefined) {
|
|
870
|
-
return;
|
|
871
|
-
}
|
|
872
|
-
if (cfgColumn.customWidth != undefined) {
|
|
873
|
-
return cfgColumn.customWidth;
|
|
874
|
-
}
|
|
875
|
-
const field = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(cfgColumn.name);
|
|
876
|
-
if ((field === null || field === void 0 ? void 0 : field.userInterface) === UserInterface.SEARCH) {
|
|
877
|
-
return this.DEFAULT_MAX_SIZE;
|
|
878
|
-
}
|
|
879
|
-
const labelSize = (((_b = field === null || field === void 0 ? void 0 : field.label) === null || _b === void 0 ? void 0 : _b.length) || 0) * this.DEFAULT_FONT_SIZE + this.DEFAULT_ICON_SIZE;
|
|
880
|
-
return labelSize > this.DEFAULT_MAX_SIZE ? this.DEFAULT_MAX_SIZE : labelSize;
|
|
881
|
-
}
|
|
882
872
|
setCellEditors(customEditors) {
|
|
883
873
|
var _a;
|
|
884
874
|
if (!this._editionManager) {
|
package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { StringUtils } from "@sankhyalabs/core";
|
|
2
|
+
const columnsState = [{
|
|
3
|
+
colId: StringUtils.generateUUID(),
|
|
4
|
+
}];
|
|
5
|
+
const colDef = {
|
|
6
|
+
headerName: 'name',
|
|
7
|
+
checkboxSelection: false,
|
|
8
|
+
};
|
|
9
|
+
export const gridEditionImplementation = {
|
|
10
|
+
getComponents: () => ({}),
|
|
11
|
+
configureGrid: (option) => (Object.assign(Object.assign({}, option), { api: {
|
|
12
|
+
setHeaderHeight: () => { },
|
|
13
|
+
forEachNode: () => { },
|
|
14
|
+
}, context: {}, columnApi: {
|
|
15
|
+
moveColumn: () => { },
|
|
16
|
+
setColumnWidth: () => { },
|
|
17
|
+
setColumnsVisible: () => { },
|
|
18
|
+
applyColumnState: () => { },
|
|
19
|
+
getColumns: () => ([]),
|
|
20
|
+
getColumn: () => ({
|
|
21
|
+
getActualWidth: () => 30,
|
|
22
|
+
getColDef: () => colDef,
|
|
23
|
+
}),
|
|
24
|
+
getColumnState: () => columnsState,
|
|
25
|
+
} }))
|
|
26
|
+
};
|
|
27
|
+
export function buildOptions(dataUnit) {
|
|
28
|
+
return ({
|
|
29
|
+
allowMultipleSelection: true,
|
|
30
|
+
dataUnit,
|
|
31
|
+
onColumnStateChange: () => { },
|
|
32
|
+
onDoubleClick: () => { },
|
|
33
|
+
onPaginationChange: () => { },
|
|
34
|
+
onPaginationUpdate: () => { },
|
|
35
|
+
onSelectionChange: () => { },
|
|
36
|
+
serverURL: '',
|
|
37
|
+
statusResolver: {},
|
|
38
|
+
useEnterLikeTab: true,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
@@ -47,15 +47,7 @@ export class EzSearch {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
async observeValue(newValue, oldValue) {
|
|
50
|
-
if (ObjectUtils.equals(newValue, oldValue))
|
|
51
|
-
return;
|
|
52
|
-
if (ObjectUtils.hasEquivalentProps(newValue, oldValue) && this._textInput.value) {
|
|
53
|
-
this.value = this._currentValue;
|
|
54
|
-
this._lookupMode = false;
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
50
|
if (this._textInput && newValue != oldValue) {
|
|
58
|
-
this._currentValue = newValue;
|
|
59
51
|
try {
|
|
60
52
|
if (typeof newValue === "string") {
|
|
61
53
|
await this.handleValueAsString(newValue);
|
|
@@ -146,10 +138,8 @@ export class EzSearch {
|
|
|
146
138
|
}
|
|
147
139
|
}
|
|
148
140
|
async handleValueAsString(value) {
|
|
149
|
-
|
|
150
|
-
if (selectedOption) {
|
|
141
|
+
if (this.getSelectedOption(value)) {
|
|
151
142
|
this.setInputValue();
|
|
152
|
-
this.ezChange.emit(selectedOption);
|
|
153
143
|
return;
|
|
154
144
|
}
|
|
155
145
|
await this.loadDescriptionValue(value);
|
|
@@ -125438,9 +125438,7 @@ class AgGridController {
|
|
|
125438
125438
|
this.STATUS_COL_ID = 'statusColumn';
|
|
125439
125439
|
this.RECORD_ARCHIVE_COL_ID = '__RECORD_ARCHIVE__';
|
|
125440
125440
|
this.BLOCK_LOAD_DEBOUNCE = 100;
|
|
125441
|
-
this.
|
|
125442
|
-
this.DEFAULT_ICON_SIZE = 12;
|
|
125443
|
-
this.DEFAULT_MAX_SIZE = 200;
|
|
125441
|
+
this.DOC_WIDTH = 1150;
|
|
125444
125442
|
this._menuItems = [];
|
|
125445
125443
|
this._idAttribName = '__record__id__';
|
|
125446
125444
|
this._gridConfig = [];
|
|
@@ -125984,7 +125982,7 @@ class AgGridController {
|
|
|
125984
125982
|
const columnsOffset = colDef.length - columns.length;
|
|
125985
125983
|
let sort = [];
|
|
125986
125984
|
state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
|
|
125987
|
-
const colWidth = this.
|
|
125985
|
+
const colWidth = this._gridOptions.columnApi.getColumn(cfgColumn.name).getActualWidth();
|
|
125988
125986
|
this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
|
|
125989
125987
|
this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
|
|
125990
125988
|
visibleColumns.push(cfgColumn.name);
|
|
@@ -126001,6 +125999,11 @@ class AgGridController {
|
|
|
126001
125999
|
});
|
|
126002
126000
|
this._gridConfig = state;
|
|
126003
126001
|
}
|
|
126002
|
+
getAdaptiveWidth(width) {
|
|
126003
|
+
const widthGrid = this._container.clientWidth;
|
|
126004
|
+
const adaptiveWidth = (this.DOC_WIDTH * width) / widthGrid;
|
|
126005
|
+
return Math.round(adaptiveWidth);
|
|
126006
|
+
}
|
|
126004
126007
|
getColumnsState() {
|
|
126005
126008
|
if (this._grid === undefined) {
|
|
126006
126009
|
throw new Error('Erro interno: Grid ainda não inicializado.');
|
|
@@ -126008,13 +126011,15 @@ class AgGridController {
|
|
|
126008
126011
|
const colState = this._gridOptions.columnApi.getColumnState();
|
|
126009
126012
|
return colState
|
|
126010
126013
|
.map(s => {
|
|
126011
|
-
const
|
|
126014
|
+
const column = this._gridOptions.columnApi.getColumn(s.colId);
|
|
126015
|
+
const def = column.getColDef();
|
|
126016
|
+
const width = this.getAdaptiveWidth(column.getActualWidth());
|
|
126012
126017
|
const label = def.headerName;
|
|
126013
126018
|
const name = def.checkboxSelection ? '__SELECTION__' : s.colId;
|
|
126014
126019
|
const colState = { label, name };
|
|
126015
126020
|
this.conditionalSet(colState, 'sort', s.sort);
|
|
126016
126021
|
this.conditionalSet(colState, 'sortIndex', s.sortIndex);
|
|
126017
|
-
this.conditionalSet(colState, 'width',
|
|
126022
|
+
this.conditionalSet(colState, 'width', width);
|
|
126018
126023
|
this.conditionalSet(colState, 'pinned', s.pinned !== null);
|
|
126019
126024
|
this.conditionalSet(colState, 'hidden', s.hide);
|
|
126020
126025
|
const props = new Map();
|
|
@@ -126268,21 +126273,6 @@ class AgGridController {
|
|
|
126268
126273
|
host[attribute] = value;
|
|
126269
126274
|
}
|
|
126270
126275
|
}
|
|
126271
|
-
getColumnWidth(cfgColumn) {
|
|
126272
|
-
var _a, _b;
|
|
126273
|
-
if (cfgColumn == undefined) {
|
|
126274
|
-
return;
|
|
126275
|
-
}
|
|
126276
|
-
if (cfgColumn.customWidth != undefined) {
|
|
126277
|
-
return cfgColumn.customWidth;
|
|
126278
|
-
}
|
|
126279
|
-
const field = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(cfgColumn.name);
|
|
126280
|
-
if ((field === null || field === void 0 ? void 0 : field.userInterface) === UserInterface.SEARCH) {
|
|
126281
|
-
return this.DEFAULT_MAX_SIZE;
|
|
126282
|
-
}
|
|
126283
|
-
const labelSize = (((_b = field === null || field === void 0 ? void 0 : field.label) === null || _b === void 0 ? void 0 : _b.length) || 0) * this.DEFAULT_FONT_SIZE + this.DEFAULT_ICON_SIZE;
|
|
126284
|
-
return labelSize > this.DEFAULT_MAX_SIZE ? this.DEFAULT_MAX_SIZE : labelSize;
|
|
126285
|
-
}
|
|
126286
126276
|
setCellEditors(customEditors) {
|
|
126287
126277
|
var _a;
|
|
126288
126278
|
if (!this._editionManager) {
|
|
@@ -128724,15 +128714,7 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
128724
128714
|
}
|
|
128725
128715
|
}
|
|
128726
128716
|
async observeValue(newValue, oldValue) {
|
|
128727
|
-
if (ObjectUtils$1.equals(newValue, oldValue))
|
|
128728
|
-
return;
|
|
128729
|
-
if (ObjectUtils$1.hasEquivalentProps(newValue, oldValue) && this._textInput.value) {
|
|
128730
|
-
this.value = this._currentValue;
|
|
128731
|
-
this._lookupMode = false;
|
|
128732
|
-
return;
|
|
128733
|
-
}
|
|
128734
128717
|
if (this._textInput && newValue != oldValue) {
|
|
128735
|
-
this._currentValue = newValue;
|
|
128736
128718
|
try {
|
|
128737
128719
|
if (typeof newValue === "string") {
|
|
128738
128720
|
await this.handleValueAsString(newValue);
|
|
@@ -128823,10 +128805,8 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
128823
128805
|
}
|
|
128824
128806
|
}
|
|
128825
128807
|
async handleValueAsString(value) {
|
|
128826
|
-
|
|
128827
|
-
if (selectedOption) {
|
|
128808
|
+
if (this.getSelectedOption(value)) {
|
|
128828
128809
|
this.setInputValue();
|
|
128829
|
-
this.ezChange.emit(selectedOption);
|
|
128830
128810
|
return;
|
|
128831
128811
|
}
|
|
128832
128812
|
await this.loadDescriptionValue(value);
|
|
@@ -119871,9 +119871,7 @@ class AgGridController {
|
|
|
119871
119871
|
this.STATUS_COL_ID = 'statusColumn';
|
|
119872
119872
|
this.RECORD_ARCHIVE_COL_ID = '__RECORD_ARCHIVE__';
|
|
119873
119873
|
this.BLOCK_LOAD_DEBOUNCE = 100;
|
|
119874
|
-
this.
|
|
119875
|
-
this.DEFAULT_ICON_SIZE = 12;
|
|
119876
|
-
this.DEFAULT_MAX_SIZE = 200;
|
|
119874
|
+
this.DOC_WIDTH = 1150;
|
|
119877
119875
|
this._menuItems = [];
|
|
119878
119876
|
this._idAttribName = '__record__id__';
|
|
119879
119877
|
this._gridConfig = [];
|
|
@@ -120417,7 +120415,7 @@ class AgGridController {
|
|
|
120417
120415
|
const columnsOffset = colDef.length - columns.length;
|
|
120418
120416
|
let sort = [];
|
|
120419
120417
|
state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
|
|
120420
|
-
const colWidth = this.
|
|
120418
|
+
const colWidth = this._gridOptions.columnApi.getColumn(cfgColumn.name).getActualWidth();
|
|
120421
120419
|
this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
|
|
120422
120420
|
this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
|
|
120423
120421
|
visibleColumns.push(cfgColumn.name);
|
|
@@ -120434,6 +120432,11 @@ class AgGridController {
|
|
|
120434
120432
|
});
|
|
120435
120433
|
this._gridConfig = state;
|
|
120436
120434
|
}
|
|
120435
|
+
getAdaptiveWidth(width) {
|
|
120436
|
+
const widthGrid = this._container.clientWidth;
|
|
120437
|
+
const adaptiveWidth = (this.DOC_WIDTH * width) / widthGrid;
|
|
120438
|
+
return Math.round(adaptiveWidth);
|
|
120439
|
+
}
|
|
120437
120440
|
getColumnsState() {
|
|
120438
120441
|
if (this._grid === undefined) {
|
|
120439
120442
|
throw new Error('Erro interno: Grid ainda não inicializado.');
|
|
@@ -120441,13 +120444,15 @@ class AgGridController {
|
|
|
120441
120444
|
const colState = this._gridOptions.columnApi.getColumnState();
|
|
120442
120445
|
return colState
|
|
120443
120446
|
.map(s => {
|
|
120444
|
-
const
|
|
120447
|
+
const column = this._gridOptions.columnApi.getColumn(s.colId);
|
|
120448
|
+
const def = column.getColDef();
|
|
120449
|
+
const width = this.getAdaptiveWidth(column.getActualWidth());
|
|
120445
120450
|
const label = def.headerName;
|
|
120446
120451
|
const name = def.checkboxSelection ? '__SELECTION__' : s.colId;
|
|
120447
120452
|
const colState = { label, name };
|
|
120448
120453
|
this.conditionalSet(colState, 'sort', s.sort);
|
|
120449
120454
|
this.conditionalSet(colState, 'sortIndex', s.sortIndex);
|
|
120450
|
-
this.conditionalSet(colState, 'width',
|
|
120455
|
+
this.conditionalSet(colState, 'width', width);
|
|
120451
120456
|
this.conditionalSet(colState, 'pinned', s.pinned !== null);
|
|
120452
120457
|
this.conditionalSet(colState, 'hidden', s.hide);
|
|
120453
120458
|
const props = new Map();
|
|
@@ -120701,21 +120706,6 @@ class AgGridController {
|
|
|
120701
120706
|
host[attribute] = value;
|
|
120702
120707
|
}
|
|
120703
120708
|
}
|
|
120704
|
-
getColumnWidth(cfgColumn) {
|
|
120705
|
-
var _a, _b;
|
|
120706
|
-
if (cfgColumn == undefined) {
|
|
120707
|
-
return;
|
|
120708
|
-
}
|
|
120709
|
-
if (cfgColumn.customWidth != undefined) {
|
|
120710
|
-
return cfgColumn.customWidth;
|
|
120711
|
-
}
|
|
120712
|
-
const field = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(cfgColumn.name);
|
|
120713
|
-
if ((field === null || field === void 0 ? void 0 : field.userInterface) === UserInterface.SEARCH) {
|
|
120714
|
-
return this.DEFAULT_MAX_SIZE;
|
|
120715
|
-
}
|
|
120716
|
-
const labelSize = (((_b = field === null || field === void 0 ? void 0 : field.label) === null || _b === void 0 ? void 0 : _b.length) || 0) * this.DEFAULT_FONT_SIZE + this.DEFAULT_ICON_SIZE;
|
|
120717
|
-
return labelSize > this.DEFAULT_MAX_SIZE ? this.DEFAULT_MAX_SIZE : labelSize;
|
|
120718
|
-
}
|
|
120719
120709
|
setCellEditors(customEditors) {
|
|
120720
120710
|
var _a;
|
|
120721
120711
|
if (!this._editionManager) {
|
|
@@ -55,15 +55,7 @@ const EzSearch = class {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
async observeValue(newValue, oldValue) {
|
|
58
|
-
if (ObjectUtils.equals(newValue, oldValue))
|
|
59
|
-
return;
|
|
60
|
-
if (ObjectUtils.hasEquivalentProps(newValue, oldValue) && this._textInput.value) {
|
|
61
|
-
this.value = this._currentValue;
|
|
62
|
-
this._lookupMode = false;
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
58
|
if (this._textInput && newValue != oldValue) {
|
|
66
|
-
this._currentValue = newValue;
|
|
67
59
|
try {
|
|
68
60
|
if (typeof newValue === "string") {
|
|
69
61
|
await this.handleValueAsString(newValue);
|
|
@@ -154,10 +146,8 @@ const EzSearch = class {
|
|
|
154
146
|
}
|
|
155
147
|
}
|
|
156
148
|
async handleValueAsString(value) {
|
|
157
|
-
|
|
158
|
-
if (selectedOption) {
|
|
149
|
+
if (this.getSelectedOption(value)) {
|
|
159
150
|
this.setInputValue();
|
|
160
|
-
this.ezChange.emit(selectedOption);
|
|
161
151
|
return;
|
|
162
152
|
}
|
|
163
153
|
await this.loadDescriptionValue(value);
|
package/dist/ezui/ezui.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-23a36bb6.js";export{s as setNonce}from"./p-23a36bb6.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o(JSON.parse('[["p-97db197f",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"selectionToastConfig":[16],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"columnfilterDataSource":[16],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"autoFocus":[4,"auto-focus"],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"_showSelectionCounter":[32],"_isAllSelection":[32],"_currentPageSelected":[32],"_selectionCount":[32],"_hasLeftButtons":[32],"_customFormatters":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64],"locateColumn":[64],"filterColumns":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"refreshSelectedRows":[64],"getCustomValueFormatter":[64],"setFocus":[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["p-6e429cff",[[1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32],"disableItem":[64],"openGuideNavidator":[64],"enableItem":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"selectGuide":[64],"getParent":[64]}]]],["p-09de35a2",[[1,"ez-alert-list",{"alerts":[1040],"enableDragAndDrop":[516,"enable-drag-and-drop"],"enableExpand":[516,"enable-expand"],"itemRightSlotBuilder":[16],"opened":[1540],"expanded":[1540],"_container":[32]}]]],["p-bcb53f27",[[1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32],"hideActions":[64],"showActions":[64],"isOpened":[64]}]]],["p-1e7a8633",[[1,"ez-breadcrumb",{"items":[1040],"fillMode":[1025,"fill-mode"],"maxItems":[1026,"max-items"],"positionEllipsis":[1026,"position-ellipsis"],"visibleItems":[32],"hiddenItems":[32],"showDropdown":[32],"collapseConfigPosition":[32]}]]],["p-49456b34",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"beforeClose":[1040],"show":[64]},[[8,"keydown","handleKeyDown"]]]]],["p-30775e7f",[[6,"ez-modal-container",{"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"showTitleBar":[4,"show-title-bar"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"cancelButtonStatus":[1,"cancel-button-status"],"okButtonStatus":[1,"ok-button-status"]},[[4,"ezCloseModal","handleEzModalAction"]]]]],["p-3faa2b46",[[1,"ez-split-button",{"enabled":[516],"iconName":[513,"icon-name"],"image":[513],"items":[16],"label":[513],"leftTitle":[513,"left-title"],"rightTitle":[513,"right-title"],"mode":[513],"size":[513],"show":[32],"setBlur":[64],"setLeftButtonFocus":[64],"setRightButtonFocus":[64]},[[2,"click","clickListener"]]]]],["p-922ac38b",[[4,"ez-split-item",{"label":[1],"enableExpand":[516,"enable-expand"],"size":[1],"_expanded":[32]}]]],["p-1f50fa05",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["p-650e4b6d",[[1,"ez-badge",{"size":[513],"label":[513],"iconLeft":[513,"icon-left"],"iconRight":[513,"icon-right"],"position":[1040],"hasSlot":[32]}]]],["p-17be134a",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"showNativeTooltip":[4,"show-native-tooltip"],"setFocus":[64],"setBlur":[64]}]]],["p-555c9018",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["p-bc2f844e",[[0,"ez-application"]]],["p-ffef392d",[[1,"ez-chart",{"type":[1],"xAxis":[16],"yAxis":[16],"chartTitle":[1,"chart-title"],"chartSubTitle":[1,"chart-sub-title"],"legendEnabled":[4,"legend-enabled"],"series":[16],"width":[2],"height":[2]}]]],["p-5ed81457",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["p-f3c526cc",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"heightMode":[1,"height-mode"],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"],"scrim":[1]}]]],["p-d9401ea0",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"]}]]],["p-9f5fa3f9",[[1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]]],["p-85c8baae",[[0,"ez-skeleton",{"count":[2],"variant":[1],"width":[1],"height":[1],"marginBottom":[1,"margin-bottom"],"animation":[1]}]]],["p-1285c902",[[0,"ez-split-panel",{"direction":[1],"anchorToExpand":[4,"anchor-to-expand"],"rebuildLayout":[64]}]]],["p-8df1ca33",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["p-44caad9a",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["p-7af81663",[[0,"multi-selection-box-message",{"message":[1]}],[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"asyncSearch":[516,"async-search"],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"setValue":[64],"endSearch":[64]}],[1,"ez-card-item",{"item":[16],"enableKey":[4,"enable-key"]}]]],["p-784fe207",[[2,"ez-multi-selection-list",{"columnName":[1,"column-name"],"dataSource":[16],"useOptions":[1028,"use-options"],"options":[1040],"isTextSearch":[4,"is-text-search"],"filteredOptions":[32],"displayOptions":[32],"viewScenario":[32],"displayOptionToCheckAllItems":[32],"clearFilteredOptions":[64]}]]],["p-baf80b13",[[0,"filter-column",{"opened":[4],"columnName":[1,"column-name"],"columnLabel":[1,"column-label"],"gridHeaderHidden":[4,"grid-header-hidden"],"noHeaderTaskBar":[1028,"no-header-task-bar"],"dataSource":[16],"dataUnit":[16],"options":[1040],"selectedItems":[32],"fieldDescriptor":[32],"useOptions":[32],"isTextSearch":[32],"hide":[64],"show":[64]}]]],["p-2dcb50d4",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]]],["p-84e439b9",[[1,"ez-collapsible-box",{"value":[1540],"boxBordered":[4,"box-bordered"],"label":[513],"subtitle":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32],"showHide":[64],"applyFocusTextEdit":[64],"cancelEdition":[64]}]]],["p-7922142b",[[1,"ez-combo-box",{"limitCharsToSearch":[2,"limit-chars-to-search"],"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]},[[11,"scroll","scrollListener"]]]]],["p-e85c48d7",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-2097d0cf",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"canShowError":[516,"can-show-error"],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"_value":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-a80b1287",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"overlayType":[513,"overlay-type"],"updatePosition":[64],"show":[64],"showUnder":[64],"hide":[64]}]]],["p-3b4eeeb6",[[1,"ez-list",{"dataSource":[1040],"listMode":[1,"list-mode"],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"itemLeftSlotBuilder":[1040],"hoverFeedback":[1028,"hover-feedback"],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64],"removeSelection":[64]}]]],["p-0306dff7",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"fitHorizontal":[64],"hide":[64]},[[11,"scroll","scrollListener"]]]]],["p-5bd5e68f",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"],"password":[4],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-bae4e180",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-af95cd16",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-072e6347",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]},[[4,"click","handleClickOutside"]]]]],["p-9050d2cd",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"enableResize":[516,"enable-resize"],"appendTextToSelection":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-77a4bd35",[[1,"ez-upload",{"label":[1],"subtitle":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["p-91f626d3",[[1,"ez-tree",{"items":[1040],"value":[1040],"selectedId":[1537,"selected-id"],"iconResolver":[16],"tooltipResolver":[16],"_tree":[32],"_waintingForLoad":[32],"selectItem":[64],"openItem":[64],"disableItem":[64],"enableItem":[64],"addChild":[64],"applyFilter":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"getParent":[64]},[[2,"keydown","onKeyDownListener"]]],[1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isActive":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"]]],["p-1a35324b",[[2,"ez-custom-form-input",{"customEditor":[16],"formViewField":[16],"value":[1032],"detailContext":[1,"detail-context"],"builderFallback":[16],"gui":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}],[1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32],"applyFocusSelect":[64]}]]],["p-42566f9e",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"canShowError":[516,"can-show-error"],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"ignoreLimitCharsToSearch":[4,"ignore-limit-chars-to-search"],"options":[1040],"suppressSearch":[4,"suppress-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]},[[11,"scroll","scrollListener"]]]]],["p-bf79aaa1",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[1540],"mode":[513],"compact":[4],"getMode":[64],"setFocus":[64]}]]],["p-7bc07c31",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["p-13d2fe2d",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]},[[2,"click","clickListener"]]]]],["p-3b56d2ef",[[2,"ez-form-view",{"fields":[16],"_customEditors":[32],"showUp":[64],"addCustomEditor":[64],"setFieldProp":[64]}]]],["p-1ee2479b",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"onlyStaticFields":[4,"only-static-fields"],"_fieldsProps":[32],"validate":[64],"addCustomEditor":[64],"setFieldProp":[64]}]]]]'),e)));
|
|
1
|
+
import{p as e,b as o}from"./p-23a36bb6.js";export{s as setNonce}from"./p-23a36bb6.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o(JSON.parse('[["p-6ebee89c",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"selectionToastConfig":[16],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"columnfilterDataSource":[16],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"autoFocus":[4,"auto-focus"],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"_showSelectionCounter":[32],"_isAllSelection":[32],"_currentPageSelected":[32],"_selectionCount":[32],"_hasLeftButtons":[32],"_customFormatters":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64],"locateColumn":[64],"filterColumns":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"refreshSelectedRows":[64],"getCustomValueFormatter":[64],"setFocus":[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["p-6e429cff",[[1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32],"disableItem":[64],"openGuideNavidator":[64],"enableItem":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"selectGuide":[64],"getParent":[64]}]]],["p-09de35a2",[[1,"ez-alert-list",{"alerts":[1040],"enableDragAndDrop":[516,"enable-drag-and-drop"],"enableExpand":[516,"enable-expand"],"itemRightSlotBuilder":[16],"opened":[1540],"expanded":[1540],"_container":[32]}]]],["p-bcb53f27",[[1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32],"hideActions":[64],"showActions":[64],"isOpened":[64]}]]],["p-1e7a8633",[[1,"ez-breadcrumb",{"items":[1040],"fillMode":[1025,"fill-mode"],"maxItems":[1026,"max-items"],"positionEllipsis":[1026,"position-ellipsis"],"visibleItems":[32],"hiddenItems":[32],"showDropdown":[32],"collapseConfigPosition":[32]}]]],["p-49456b34",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"beforeClose":[1040],"show":[64]},[[8,"keydown","handleKeyDown"]]]]],["p-30775e7f",[[6,"ez-modal-container",{"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"showTitleBar":[4,"show-title-bar"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"cancelButtonStatus":[1,"cancel-button-status"],"okButtonStatus":[1,"ok-button-status"]},[[4,"ezCloseModal","handleEzModalAction"]]]]],["p-3faa2b46",[[1,"ez-split-button",{"enabled":[516],"iconName":[513,"icon-name"],"image":[513],"items":[16],"label":[513],"leftTitle":[513,"left-title"],"rightTitle":[513,"right-title"],"mode":[513],"size":[513],"show":[32],"setBlur":[64],"setLeftButtonFocus":[64],"setRightButtonFocus":[64]},[[2,"click","clickListener"]]]]],["p-922ac38b",[[4,"ez-split-item",{"label":[1],"enableExpand":[516,"enable-expand"],"size":[1],"_expanded":[32]}]]],["p-1f50fa05",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["p-650e4b6d",[[1,"ez-badge",{"size":[513],"label":[513],"iconLeft":[513,"icon-left"],"iconRight":[513,"icon-right"],"position":[1040],"hasSlot":[32]}]]],["p-17be134a",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"showNativeTooltip":[4,"show-native-tooltip"],"setFocus":[64],"setBlur":[64]}]]],["p-555c9018",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["p-bc2f844e",[[0,"ez-application"]]],["p-ffef392d",[[1,"ez-chart",{"type":[1],"xAxis":[16],"yAxis":[16],"chartTitle":[1,"chart-title"],"chartSubTitle":[1,"chart-sub-title"],"legendEnabled":[4,"legend-enabled"],"series":[16],"width":[2],"height":[2]}]]],["p-5ed81457",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["p-f3c526cc",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"heightMode":[1,"height-mode"],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"],"scrim":[1]}]]],["p-d9401ea0",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"]}]]],["p-9f5fa3f9",[[1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]]],["p-85c8baae",[[0,"ez-skeleton",{"count":[2],"variant":[1],"width":[1],"height":[1],"marginBottom":[1,"margin-bottom"],"animation":[1]}]]],["p-1285c902",[[0,"ez-split-panel",{"direction":[1],"anchorToExpand":[4,"anchor-to-expand"],"rebuildLayout":[64]}]]],["p-8df1ca33",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["p-44caad9a",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["p-7af81663",[[0,"multi-selection-box-message",{"message":[1]}],[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"asyncSearch":[516,"async-search"],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"setValue":[64],"endSearch":[64]}],[1,"ez-card-item",{"item":[16],"enableKey":[4,"enable-key"]}]]],["p-784fe207",[[2,"ez-multi-selection-list",{"columnName":[1,"column-name"],"dataSource":[16],"useOptions":[1028,"use-options"],"options":[1040],"isTextSearch":[4,"is-text-search"],"filteredOptions":[32],"displayOptions":[32],"viewScenario":[32],"displayOptionToCheckAllItems":[32],"clearFilteredOptions":[64]}]]],["p-baf80b13",[[0,"filter-column",{"opened":[4],"columnName":[1,"column-name"],"columnLabel":[1,"column-label"],"gridHeaderHidden":[4,"grid-header-hidden"],"noHeaderTaskBar":[1028,"no-header-task-bar"],"dataSource":[16],"dataUnit":[16],"options":[1040],"selectedItems":[32],"fieldDescriptor":[32],"useOptions":[32],"isTextSearch":[32],"hide":[64],"show":[64]}]]],["p-2dcb50d4",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]]],["p-84e439b9",[[1,"ez-collapsible-box",{"value":[1540],"boxBordered":[4,"box-bordered"],"label":[513],"subtitle":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32],"showHide":[64],"applyFocusTextEdit":[64],"cancelEdition":[64]}]]],["p-7922142b",[[1,"ez-combo-box",{"limitCharsToSearch":[2,"limit-chars-to-search"],"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]},[[11,"scroll","scrollListener"]]]]],["p-e85c48d7",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-2097d0cf",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"canShowError":[516,"can-show-error"],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"_value":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-a80b1287",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"overlayType":[513,"overlay-type"],"updatePosition":[64],"show":[64],"showUnder":[64],"hide":[64]}]]],["p-3b4eeeb6",[[1,"ez-list",{"dataSource":[1040],"listMode":[1,"list-mode"],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"itemLeftSlotBuilder":[1040],"hoverFeedback":[1028,"hover-feedback"],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64],"removeSelection":[64]}]]],["p-0306dff7",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"fitHorizontal":[64],"hide":[64]},[[11,"scroll","scrollListener"]]]]],["p-5bd5e68f",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"],"password":[4],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-bae4e180",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-af95cd16",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-072e6347",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]},[[4,"click","handleClickOutside"]]]]],["p-9050d2cd",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"enableResize":[516,"enable-resize"],"appendTextToSelection":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-77a4bd35",[[1,"ez-upload",{"label":[1],"subtitle":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["p-91f626d3",[[1,"ez-tree",{"items":[1040],"value":[1040],"selectedId":[1537,"selected-id"],"iconResolver":[16],"tooltipResolver":[16],"_tree":[32],"_waintingForLoad":[32],"selectItem":[64],"openItem":[64],"disableItem":[64],"enableItem":[64],"addChild":[64],"applyFilter":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"getParent":[64]},[[2,"keydown","onKeyDownListener"]]],[1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isActive":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"]]],["p-1a35324b",[[2,"ez-custom-form-input",{"customEditor":[16],"formViewField":[16],"value":[1032],"detailContext":[1,"detail-context"],"builderFallback":[16],"gui":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}],[1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32],"applyFocusSelect":[64]}]]],["p-1c462106",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"canShowError":[516,"can-show-error"],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"ignoreLimitCharsToSearch":[4,"ignore-limit-chars-to-search"],"options":[1040],"suppressSearch":[4,"suppress-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]},[[11,"scroll","scrollListener"]]]]],["p-bf79aaa1",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[1540],"mode":[513],"compact":[4],"getMode":[64],"setFocus":[64]}]]],["p-7bc07c31",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["p-13d2fe2d",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]},[[2,"click","clickListener"]]]]],["p-3b56d2ef",[[2,"ez-form-view",{"fields":[16],"_customEditors":[32],"showUp":[64],"addCustomEditor":[64],"setFieldProp":[64]}]]],["p-1ee2479b",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"onlyStaticFields":[4,"only-static-fields"],"_fieldsProps":[32],"validate":[64],"addCustomEditor":[64],"setFieldProp":[64]}]]]]'),e)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as t,h as e,H as s,g as r}from"./p-23a36bb6.js";import{C as o}from"./p-9e11fc7b.js";import{ObjectUtils as a,StringUtils as l,FloatingManager as h,ElementIDUtils as n}from"@sankhyalabs/core";import{A as c}from"./p-2187f86c.js";import"./p-ab574d59.js";import"./p-b853763b.js";import"./p-4607fb89.js";import{R as d}from"./p-05e1f4e7.js";const u=class{constructor(e){i(this,e),this.ezChange=t(this,"ezChange",7),this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._textEmptyList="Nenhum resultado encontrado",this._textEmptySearch="Nenhum resultado de {0} encontrado",this._lookupMode=!1,this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._criteria=void 0,this.value=void 0,this.label=void 0,this.enabled=!0,this.errorMessage=void 0,this.optionLoader=void 0,this.showSelectedValue=!0,this.showOptionValue=!0,this.suppressEmptyOption=!1,this.mode="regular",this.canShowError=!0,this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.ignoreLimitCharsToSearch=!1,this.options=void 0,this.suppressSearch=!1}observeErrorMessage(){var i;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(i=this.errorMessage)||void 0===i?void 0:i.trim())||this.setInputValue())}async observeValue(i,t){if(this._textInput&&i!=t)try{if("string"==typeof i)return void await this.handleValueAsString(i);const e=this.getSelectedOption(i),s=this.getSelectedOption(t),r=this.getSelectedOption(this.value);this.isDifferentValues(r,e)&&(this.value=e),this.isDifferentValues(e,s)&&(this.setInputValue(),this._lookupMode||this.ezChange.emit(null===e?void 0:e)),this.resetOptions()}finally{this._lookupMode=!1}}observeOptions(i,t){(null==i?void 0:i.join(""))!==(null==t?void 0:t.join(""))&&this.loadOptions(v.PRELOAD)}async getValueAsync(){return new Promise(this._showLoading?i=>{let t=setInterval((()=>{this._showLoading||(clearInterval(t),i(this.value))}),100)}:i=>i(this.value))}async setFocus(){this._textInput&&this._textInput.setFocus()}async setBlur(){this._textInput&&this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async clearValue(){this.clearSearch()}scrollListener(){var i;null!=this._floatingID&&((null===(i=this.listOptionsPosition)||void 0===i?void 0:i.hardPosition)?this.hideOptions():window.requestAnimationFrame((()=>{this.updateListPosition()})))}async handleValueAsString(i){this.getSelectedOption(i)?this.setInputValue():(await this.loadDescriptionValue(i),this.ezChange.emit(this.value))}updateListPosition(){let{verticalPosition:i,horizontalPosition:t,fromBottom:e,fromRight:s,bottomLimit:r,hardPosition:o}=this.getListPosition();const a=this._listWrapper.getBoundingClientRect(),l=this._listContainer.getBoundingClientRect(),h=this._textInput.getBoundingClientRect(),n=r||window.innerHeight;!e&&(a.top<0||l.bottom+a.height>n)&&(e=!0),o||(i=i||0,t=t||0,e?i=window.innerHeight-h.top+i:i+=l.top,s?t=window.innerWidth-h.right+t:t+=l.left),null!=i&&(this._listWrapper.style[e?"bottom":"top"]=`${i}px`,this._listWrapper.style[e?"top":"bottom"]=""),null!=t&&(this._listWrapper.style[s?"right":"left"]=`${t}px`,this._listWrapper.style[s?"left":"right"]="")}getListPosition(){return this.listOptionsPosition?this.listOptionsPosition:{verticalPosition:this.errorMessage||!this.canShowError||"slim"===this.mode?6:-13}}isDifferentValues(i,t){return a.objectToString(i||{})!==a.objectToString(t||{})}getFormattedText(i){if(null==i)return;let t=this.showSelectedValue&&null!=i.value?`${i.value} - ${i.label}`:i.label;return t=t.replace(new RegExp(this._startHighlightTag,"g"),"").replace(new RegExp(this._endHighlightTag,"g"),""),t}getText(){const i=this.getSelectedOption(this.value),t=this.getFormattedText(i);if(null!=t)return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}getSelectedOption(i){return"string"==typeof i||i instanceof String?this._visibleOptions.find((t=>t.value===i)):i?Object.assign(Object.assign({},i),{value:this.replaceHighlight(null==i?void 0:i.value),label:this.replaceHighlight(null==i?void 0:i.label)}):i}updateVisibleOptions(){let i=this._source||[];this._visibleOptions=this.suppressEmptyOption?i:[{value:void 0,label:""}].concat(i),this._maxWidthValue=this.getMaxWidthValue()}getMaxWidthValue(){var i;const t=[];return null===(i=this._visibleOptions)||void 0===i||i.forEach((i=>{const e=this.getWidthValue(i.value);t.includes(e)||t.push(e)})),t.length>1?Math.max(...t):0}getWidthValue(i){if(null!=this._itemValueBasis){const t=this._itemValueBasis;if(null!=i)return t.innerHTML=i,t.clientWidth>0?t.clientWidth+2:0;t.innerHTML=""}return 0}createOption(i){let{key:t,title:e}=i;const s=new RegExp(this._startHighlightTag,"g"),r=new RegExp(this._endHighlightTag,"g");e=l.decodeHtmlEntities(e);const o={value:null==t?void 0:t.replace(s,"").replace(r,""),label:null==e?void 0:e.replace(s,"").replace(r,"")};this.selectOption(o)}buildItem(i,t){i.label=i.label||i.value;const s={key:i.value,title:i.label,details:i.details};return e("div",{style:{height:"100%"},class:t===this._preSelection?"item preselected":"item",id:`item_${i.value}`,onMouseDown:()=>this.createOption(s),onMouseOver:()=>this._preSelection=t},e("ez-card-item",{item:s}))}showOptions(){this.enabled&&(this.isOptionsVisible()||(this._resizeObserver&&this._resizeObserver.observe(this._textInput),this._floatingID=h.float(this._listWrapper,this._listContainer,{autoClose:!1,isFixed:!0,backClickListener:()=>this.hideOptions()}),this.setFocus(),window.requestAnimationFrame((()=>{this.updateListPosition(),this.listOptionsPosition||this._listWrapper.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}))))}hideOptions(){void 0!==this._floatingID&&h.close(this._floatingID),this._floatingID=void 0,this._resizeObserver&&this._resizeObserver.unobserve(this._textInput)}isOptionsVisible(){return void 0!==this._floatingID&&h.isFloating(this._floatingID)}nextOption(){this.isOptionsVisible()&&(this.showOptions(),this._preSelection=void 0===this._preSelection?0:Math.min(this._preSelection+1,this._visibleOptions.length-1),this.scrollToOption(this._visibleOptions[this._preSelection]))}previousOption(){this._preSelection=void 0===this._preSelection?0:Math.max(this._preSelection-1,0),this.scrollToOption(this._visibleOptions[this._preSelection])}scrollToOption(i){window.requestAnimationFrame((()=>{const t=(null==i?void 0:i.value)?this._optionsList.querySelector(`div#item_${i.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g,"\\$1")}`):void 0;t&&t.scrollIntoView({behavior:"smooth",block:"nearest"})}))}selectCurrentOption(){void 0!==this._preSelection?(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0):this.controlListWithOnlyOne()}updateSource(i){this._startLoading=!1,i instanceof Promise?(this._showLoading=!0,i.then((i=>{this._showLoading=!1,this.updateSource(i)})).catch((()=>this._showLoading=!1)),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(i)?(this._source=i,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1,this.controlEmptySearch())):this.selectOption(i))}clearSource(){this._source=[],this.updateVisibleOptions()}replaceHighlight(i){const t=new RegExp(this._startHighlightTag,"g"),e=new RegExp(this._endHighlightTag,"g");return(null!=i?i:"").replace(t,"").replace(e,"")}selectOption(i){var t,e;const s=this.getSelectedOption(this.value),r=Object.assign(Object.assign({},i),{value:this.replaceHighlight(null==i?void 0:i.value),label:this.replaceHighlight(null==i?void 0:i.label)});(null===(t=null==s?void 0:s.value)||void 0===t?void 0:t.toString())!==(null===(e=null==r?void 0:r.value)||void 0===e?void 0:e.toString())||null==s&&null!=r&&"value"in r?this.value=(null==r?void 0:r.value)?r:void 0:(this.setInputValue(),this.resetOptions()),this._visibleOptions=[],this.clearSource()}loadOptions(i,t=""){this._criteria=t,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:i,argument:t}):this.options)}cancelPreselection(){!this._textInput.value&&this.value?this.selectOption(void 0):window.setTimeout((()=>{this.setInputValue()}),this._deboucingTime),this.resetOptions()}setInputValue(i=!0){const t=this.getText();(this._textInput.value||"")!==t&&(this._textInput.value=t,i&&(this.errorMessage=null))}clearSearch(){this.value=null}controlListWithOnlyOne(){var i,t;const e=null===(i=this._visibleOptions)||void 0===i?void 0:i.filter((i=>""!==i.label&&null!=i.value));if((null==e?void 0:e.length)>0){const i=new RegExp(this._startHighlightTag,"g"),s=new RegExp(this._endHighlightTag,"g");let r=l.decodeHtmlEntities(e[0].label);const o={value:null===(t=e[0].value)||void 0===t?void 0:t.replace(i,"").replace(s,""),label:null==r?void 0:r.replace(i,"").replace(s,"")};this.selectOption(o)}}controlEmptySearch(){var i;(null===(i=this._visibleOptions)||void 0===i?void 0:i.length)?this.controlListWithOnlyOne():(this.clearSearch(),c.info(this._textEmptyList))}validateDescriptionValue(){if(l.isEmpty(this.value))return;let i=this.value;"object"!=typeof i&&(l.isEmpty(i)||this.loadDescriptionValue(i))}async loadDescriptionValue(i){var t,e;if(null==i)return;if((null===(t=this.options)||void 0===t?void 0:t.length)>0)return void this.loadOptionValue(i);const s={mode:v.PREDICTIVE,argument:i},r=await(null===(e=this.optionLoader)||void 0===e?void 0:e.call(this,s));null!=r&&(r instanceof Promise?r.then((i=>{this.setDescriptionValue(i)})):this.setDescriptionValue(r))}setDescriptionValue(i){const t=(null==i?void 0:i[0])||i;null!=t&&Object.keys(t).length?(this._lookupMode=!0,this.value=t?Object.assign(Object.assign({},t),{value:this.replaceHighlight(t.value),label:this.replaceHighlight(t.label)}):t):this.showNoResultMessage()}loadOptionValue(i){var t;const e=null===(t=this.options)||void 0===t?void 0:t.find((t=>t.value===i));null!=e?this.selectOption(e):this.showNoResultMessage()}async showNoResultMessage(){this.clearSearch(),c.info(this._textEmptySearch.replace("{0}",this.getFieldLabel()))}getFieldLabel(){var i;return null===(i=this.label)||void 0===i?void 0:i.replace(d,"").toUpperCase()}resetOptions(){this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}componentWillLoad(){if(void 0===this.options){this.options=[];const i=this.el.querySelectorAll("option");i&&i.forEach((i=>{let t=i.innerText,e=i.getAttribute("value"),s=i.getAttribute("details");e||(e=t),this.options.push({label:t,value:e,details:s}),i.hidden=!0}))}this.updateSource([])}componentDidRender(){var i;void 0===this._floatingID&&this._listWrapper.remove(),null===(i=this._optionsList)||void 0===i||i.querySelectorAll(".item").forEach((i=>{n.addIDInfoIfNotExists(i,"itemSearch")})),this.validateDescriptionValue()}componentDidLoad(){o.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1),this._resizeObserver=new ResizeObserver((i=>{window.requestAnimationFrame((()=>{if(!Array.isArray(i)||!i.length)return;const{clientWidth:t}=this._listContainer;t>0&&this._listWrapper&&(this._listWrapper.style.width=`${t}px`)}))}))}handlerIconClick(){this.loadOptions(v.ADVANCED)}buildNumberArgument(i){return this.isTextSearch?NaN:Number(i||void 0)}onTextInputChangeHandler(i){var t;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(i)}),this._deboucingTime));const e=null===(t=i.target.value)||void 0===t?void 0:t.trim(),s=this.buildNumberArgument(e);this._criteria||(this._textInput.value=i.data||e),this._criteria=e,e?(this._showLoading=!1,this.clearSource(),!isNaN(s)||e.length>=this._limitCharsToSearch?(this._showLoading=!0,this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions(v.PREDICTIVE,isNaN(s)?e:s.toString())}),this._deboucingTime),this.showOptions()):this.hideOptions()):(this.hideOptions(),this._showLoading=!1,this.clearSource())}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}keyDownHandler(i){switch(this._tabPressed=!1,i.ctrlKey&&("f"!==i.key&&"F"!==i.key||(this.loadOptions(v.ADVANCED),i.stopPropagation(),i.stopImmediatePropagation(),i.preventDefault())),i.key){case"ArrowDown":this.nextOption(),i.stopPropagation();break;case"ArrowUp":this.previousOption(),i.stopPropagation();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.cancelPreselection();break;case"Tab":this._tabPressed=!0,this.controlListWithOnlyOne()}}onTextInputFocusOutHandler(){this.hideErrorOnFocusOut&&this.cancelPreselection()}canShowListOptions(){return!this._showLoading&&this._visibleOptions.length>0}render(){var i;return n.addIDInfoIfNotExists(this.el,"input"),e(s,null,e("ez-text-input",{"data-element-id":n.getInternalIDInfo("textInput"),class:this.suppressSearch?"suppressed-search-input":"",ref:i=>this._textInput=i,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:i=>this.onTextInputChangeHandler(i),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:i=>this.keyDownHandler(i),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode},e("button",{class:"btn",slot:"leftIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},e("ez-icon",{iconName:"search"})),(null===(i=this._textInput)||void 0===i?void 0:i.value)&&(this._criteria||this.value)?e("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},e("ez-icon",{iconName:"close"})):void 0),e("section",{class:"list-container",ref:i=>this._listContainer=i},e("div",{class:"list-wrapper",ref:i=>this._listWrapper=i},e("ul",{class:"list-options",ref:i=>this._optionsList=i},!this._showLoading&&0===this._visibleOptions.length&&e("div",{class:"message"},e("span",{class:"message__no-result"},this._textEmptyList)),this._showLoading&&e("div",{class:"message"},e("div",{class:"message__loading"})),e("span",{class:"item__value item__value--hidden",ref:i=>this._itemValueBasis=i}),this.canShowListOptions()&&this._visibleOptions.map(((i,t)=>this.buildItem(i,t)))))))}get el(){return r(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"],options:["observeOptions"]}}};var v;!function(i){i.ADVANCED="ADVANCED",i.PRELOAD="PRELOAD",i.PREDICTIVE="PREDICTIVE"}(v||(v={})),u.style=":host{--ez-search--height:42px;--ez-search--width:100%;--ez-search__icon--width:48px;--ez-search--border-radius:var(--border--radius-medium, 12px);--ez-search--border-radius-small:var(--border--radius-small, 6px);--ez-search--font-size:var(--text--medium, 14px);--ez-search--font-family:var(--font-pattern, Arial);--ez-search--font-weight--large:var(--text-weight--large, 500);--ez-search--font-weight--medium:var(--text-weight--medium, 400);--ez-search--background-color--xlight:var(--background--xlight, #fff);--ez-search--background-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px);--ez-search__input--background-color:var(--background--medium, #e0e0e0);--ez-search__input--border:var(--border--medium, 2px solid);--ez-search__input--border-color:var(--ez-search__input--background-color);--ez-search__input--focus--border-color:var(--color--primary, #008561);--ez-search__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-search__input--disabled--color:var(--text--disable, #AFB6C0);--ez-search__input--error--border-color:#CC2936;--ez-search__btn--color:var(--title--primary, #2B3A54);--ez-search__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-search__btn-hover--color:var(--color--primary, #4e4e4e);--ez-search__label--color:var(--title--primary, #2B3A54);--ez-search__list-title--primary:var(--title--primary, #2B3A54);--ez-search__list-text--primary:var(--text--primary, #626e82);--ez-search__list-height:calc(var(--ez-search--font-size) + var(--ez-search--space--medium) + 4px);--ez-search__list-min-width:64px;--ez-search--space--medium:var(--space--medium, 12px);--ez-search--space--small:var(--space--small, 6px);--ez-search__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-search__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-search__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-search__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-search__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-search__scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-search--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{min-width:var(--ez-search__list-min-width);overflow:auto;position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:0;z-index:var(--more-visible, 2);max-height:350px;min-width:150px;background-color:var(--ez-search--background-color--xlight);border-radius:var(--ez-search--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);padding:var(--ez-search--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;padding:0;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-search__scrollbar--color-background);width:var(--ez-search__scrollbar--width);max-width:var(--ez-search__scrollbar--width);min-width:var(--ez-search__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-search__scrollbar--color-background);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-search__scrollbar--color-default);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-search__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-search__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-search--border-radius-small);padding:var(--ez-search--space--small);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size);line-height:var(--ez-search--line-height)}.item__label{font-weight:var(--ez-search--font-weight--medium)}.item__label--bold{font-weight:var(--ez-search--font-weight--large)}.item__value{text-align:center;color:var(--ez-search__list-text--primary);font-weight:var(--ez-search--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-search__list-height)}.message__no-result{color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-search__list-title--primary);border-top:3px solid transparent}.item__list>li:hover{background-color:var(--ez-search--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-search__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-search__btn-disabled--color)}.btn:disabled:hover{cursor:unset;color:var(--ez-search__btn-disabled--color)}.btn:hover{color:var(--ez-search__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{u as ez_search}
|