@sankhyalabs/ezui 0.0.0-feat-dev-KB-63193.2 → 0.0.0-feat-dev-KB-63197.2
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-4c893e04.js → RecordValidationProcessor-d9af86d4.js} +37 -0
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +5 -2
- package/dist/cjs/ez-form.cjs.entry.js +3 -2
- package/dist/cjs/ez-grid.cjs.entry.js +65 -6
- package/dist/cjs/ez-scroller_2.cjs.entry.js +222 -0
- package/dist/cjs/ez-search.cjs.entry.js +29 -31
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +92 -0
- package/dist/cjs/{ez-scroller_3.cjs.entry.js → ez-tree.cjs.entry.js} +0 -215
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +10 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +5 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +32 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +11 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +20 -1
- package/dist/collection/components/ez-grid/ez-grid.css +4 -0
- package/dist/collection/components/ez-search/ez-search.js +29 -31
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css +6 -2
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js +1 -1
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css +180 -0
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.js +293 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/ModeMenuEnum.js +5 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/SizeMenuEnum.js +6 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/TypeMenuEnum.js +6 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/index.js +3 -0
- package/dist/collection/components/ez-sidebar-navigator/messages/constants.js +5 -0
- package/dist/collection/utils/form/DataBinder.js +2 -1
- package/dist/collection/utils/validators/recordvalidator/IInvalidCells.js +1 -0
- package/dist/collection/utils/validators/recordvalidator/RecordValidationProcessor.js +37 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +227 -42
- package/dist/esm/{RecordValidationProcessor-b00b8b77.js → RecordValidationProcessor-cca0dbf2.js} +37 -0
- package/dist/esm/ez-custom-form-input_2.entry.js +5 -2
- package/dist/esm/ez-form.entry.js +3 -2
- package/dist/esm/ez-grid.entry.js +65 -6
- package/dist/esm/ez-scroller_2.entry.js +217 -0
- package/dist/esm/ez-search.entry.js +29 -31
- package/dist/esm/ez-sidebar-navigator.entry.js +88 -0
- package/dist/esm/{ez-scroller_3.entry.js → ez-tree.entry.js} +3 -216
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/index-baa5e267.js +10 -2
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-12ae1104.entry.js +1 -0
- package/dist/ezui/{p-72657ff6.entry.js → p-2b332ab8.entry.js} +2 -2
- package/dist/ezui/p-4d5235f1.entry.js +1 -0
- package/dist/ezui/p-8888d9ed.entry.js +1 -0
- package/dist/ezui/p-a31b9c90.entry.js +1 -0
- package/dist/ezui/p-c574ddf0.entry.js +1 -0
- package/dist/ezui/p-cf0fc2f8.js +1 -0
- package/dist/ezui/p-ecc2c1ec.entry.js +1 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +6 -1
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +3 -0
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -1
- package/dist/types/components/ez-search/ez-search.d.ts +2 -1
- package/dist/types/components/ez-sidebar-navigator/ez-sidebar-navigator.d.ts +57 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/ModeMenuEnum.d.ts +4 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/SizeMenuEnum.d.ts +5 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/TypeMenuEnum.d.ts +5 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/index.d.ts +3 -0
- package/dist/types/components/ez-sidebar-navigator/messages/constants.d.ts +5 -0
- package/dist/types/components.d.ts +90 -0
- package/dist/types/utils/validators/recordvalidator/IInvalidCells.d.ts +5 -0
- package/dist/types/utils/validators/recordvalidator/IValidationSource.d.ts +1 -0
- package/dist/types/utils/validators/recordvalidator/RecordValidationProcessor.d.ts +1 -0
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-04f24913.js +0 -1
- package/dist/ezui/p-1c462106.entry.js +0 -1
- package/dist/ezui/p-5056284a.entry.js +0 -1
- package/dist/ezui/p-5264876b.entry.js +0 -1
- package/dist/ezui/p-91f626d3.entry.js +0 -1
package/dist/cjs/{RecordValidationProcessor-4c893e04.js → RecordValidationProcessor-d9af86d4.js}
RENAMED
|
@@ -78,7 +78,9 @@ class RecordValidationProcessor {
|
|
|
78
78
|
processValidationResult(validationResult, recordId) {
|
|
79
79
|
validationResult.forEach(invalidResult => {
|
|
80
80
|
const invalidFields = invalidResult.invalidFields;
|
|
81
|
+
this._dataUnit.savingCanceled(invalidFields, recordId);
|
|
81
82
|
if (invalidFields) {
|
|
83
|
+
this._validationSource.getInvalidFields(invalidFields, recordId);
|
|
82
84
|
invalidFields.forEach(field => {
|
|
83
85
|
this.markAsInvalid(field, recordId);
|
|
84
86
|
});
|
|
@@ -96,6 +98,41 @@ class RecordValidationProcessor {
|
|
|
96
98
|
this._dataUnit.setInvalidField(field.name, field.message, recordId);
|
|
97
99
|
this._validationSource.markAsInvalid(field, recordId);
|
|
98
100
|
}
|
|
101
|
+
validateNewRecord() {
|
|
102
|
+
return new Promise((accept, reject) => {
|
|
103
|
+
const records = this._dataUnit.getModifiedRecords();
|
|
104
|
+
for (let i = 0; i < records.length; i++) {
|
|
105
|
+
const record = records[i];
|
|
106
|
+
if (this._dataUnit.isNewRecord(record.__record__id__)) {
|
|
107
|
+
const invalidResults = [];
|
|
108
|
+
let validationResult = this.validateRequired(record);
|
|
109
|
+
if (validationResult && !validationResult.isValid) {
|
|
110
|
+
invalidResults.push(validationResult);
|
|
111
|
+
}
|
|
112
|
+
if (this._validator) {
|
|
113
|
+
validationResult = this._validator.validateRecord(record);
|
|
114
|
+
if (validationResult && !validationResult.isValid) {
|
|
115
|
+
invalidResults.push(validationResult);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (invalidResults.length > 0) {
|
|
119
|
+
invalidResults.forEach(invalidResult => {
|
|
120
|
+
const invalidFields = invalidResult.invalidFields;
|
|
121
|
+
if (invalidFields) {
|
|
122
|
+
this._validationSource.getInvalidFields(invalidFields, record.__record__id__);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
reject();
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
this._validationSource.getInvalidFields(undefined, record.__record__id__);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return accept();
|
|
134
|
+
});
|
|
135
|
+
}
|
|
99
136
|
}
|
|
100
137
|
|
|
101
138
|
exports.RecordValidationProcessor = RecordValidationProcessor;
|
|
@@ -80,7 +80,9 @@ const EzCustomFormInput = class {
|
|
|
80
80
|
if (typeof gui === 'string') {
|
|
81
81
|
gui = core.HTMLBuilder.parseElement(gui);
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
if (this.value) {
|
|
84
|
+
gui.setAttribute('value', typeof this.value === 'object' ? this.value.value : this.value);
|
|
85
|
+
}
|
|
84
86
|
this.gui = index.h("div", { key: core.StringUtils.generateUUID(), ref: el => el && el.appendChild(gui) });
|
|
85
87
|
}
|
|
86
88
|
setValue(value) {
|
|
@@ -90,8 +92,9 @@ const EzCustomFormInput = class {
|
|
|
90
92
|
return this.value;
|
|
91
93
|
}
|
|
92
94
|
handleValue(gui) {
|
|
95
|
+
var _a;
|
|
93
96
|
//@ts-ignore
|
|
94
|
-
gui.$children
|
|
97
|
+
(_a = gui.$children$) === null || _a === void 0 ? void 0 : _a.forEach((child) => {
|
|
95
98
|
child.$attrs$.value = this.value;
|
|
96
99
|
});
|
|
97
100
|
}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-a7b0c73d.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const RecordValidationProcessor = require('./RecordValidationProcessor-
|
|
7
|
+
const RecordValidationProcessor = require('./RecordValidationProcessor-d9af86d4.js');
|
|
8
8
|
require('./ApplicationUtils-c9d1205c.js');
|
|
9
9
|
require('./DialogType-2114c337.js');
|
|
10
10
|
|
|
@@ -248,7 +248,8 @@ class DataBinder {
|
|
|
248
248
|
this._recordValidatorProcessor = new RecordValidationProcessor.RecordValidationProcessor(this._dataUnit, {
|
|
249
249
|
getRequiredFields: () => this._formMetadata.getRequiredFields(),
|
|
250
250
|
markAsInvalid: field => this.markInvalid(field),
|
|
251
|
-
getMessageForField: field => this.getErrorMessage(field)
|
|
251
|
+
getMessageForField: field => this.getErrorMessage(field),
|
|
252
|
+
getInvalidFields: () => { },
|
|
252
253
|
}, recordsValidator);
|
|
253
254
|
}
|
|
254
255
|
disconnectDataUnit() {
|
|
@@ -10,7 +10,7 @@ require('./DialogType-2114c337.js');
|
|
|
10
10
|
require('./CheckMode-ecb90b87.js');
|
|
11
11
|
const ICustomRender = require('./ICustomRender-6fafffce.js');
|
|
12
12
|
const constants = require('./constants-2714478b.js');
|
|
13
|
-
const RecordValidationProcessor = require('./RecordValidationProcessor-
|
|
13
|
+
const RecordValidationProcessor = require('./RecordValidationProcessor-d9af86d4.js');
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @ag-grid-community/all-modules - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.2.1
|
|
@@ -118853,6 +118853,12 @@ class DataSourceInterceptor {
|
|
|
118853
118853
|
}
|
|
118854
118854
|
|
|
118855
118855
|
class DataSource {
|
|
118856
|
+
handleSavingCanceled(action) {
|
|
118857
|
+
var _a, _b, _c, _d;
|
|
118858
|
+
if (((_a = action.payload) === null || _a === void 0 ? void 0 : _a.fields) && ((_b = action.payload) === null || _b === void 0 ? void 0 : _b.recordId)) {
|
|
118859
|
+
this._controller.savingCanceled((_c = action.payload) === null || _c === void 0 ? void 0 : _c.fields, (_d = action.payload) === null || _d === void 0 ? void 0 : _d.recordId);
|
|
118860
|
+
}
|
|
118861
|
+
}
|
|
118856
118862
|
handleDataChanged(action) {
|
|
118857
118863
|
var _a, _b;
|
|
118858
118864
|
if (!this._options.enableGridInsert) {
|
|
@@ -118970,13 +118976,14 @@ class DataSource {
|
|
|
118970
118976
|
break;
|
|
118971
118977
|
case core.Action.DATA_SAVED:
|
|
118972
118978
|
case core.Action.EDITION_CANCELED:
|
|
118979
|
+
this._controller.clearInvalidCells();
|
|
118973
118980
|
this.handleRefreshOrReload(action);
|
|
118974
118981
|
break;
|
|
118975
118982
|
case core.Action.DATA_CHANGED:
|
|
118983
|
+
case core.Action.DATA_RESOLVED:
|
|
118976
118984
|
this.handleDataChanged(action);
|
|
118977
118985
|
break;
|
|
118978
118986
|
case core.Action.RECORDS_REMOVED:
|
|
118979
|
-
case core.Action.DATA_RESOLVED:
|
|
118980
118987
|
this.handleRefresh(action);
|
|
118981
118988
|
break;
|
|
118982
118989
|
case core.Action.SELECTION_CHANGED:
|
|
@@ -118987,6 +118994,9 @@ class DataSource {
|
|
|
118987
118994
|
case core.Action.RECORD_LOADED:
|
|
118988
118995
|
this.updateLoadedRecords(action);
|
|
118989
118996
|
break;
|
|
118997
|
+
case core.Action.SAVING_CANCELED:
|
|
118998
|
+
this.handleSavingCanceled(action);
|
|
118999
|
+
break;
|
|
118990
119000
|
}
|
|
118991
119001
|
};
|
|
118992
119002
|
this._dataUnit = dataUnit;
|
|
@@ -119669,7 +119679,8 @@ class GridEditionManager {
|
|
|
119669
119679
|
this._recordValidationProcessor = new RecordValidationProcessor.RecordValidationProcessor(this._dataUnit, {
|
|
119670
119680
|
getRequiredFields: () => this.getRequiredFields(),
|
|
119671
119681
|
markAsInvalid: () => { },
|
|
119672
|
-
getMessageForField: () => null
|
|
119682
|
+
getMessageForField: () => null,
|
|
119683
|
+
getInvalidFields: (fields, recordId) => this.setInvalidCells(fields, recordId),
|
|
119673
119684
|
}, recordsValidator);
|
|
119674
119685
|
this._useEnterLikeTab = useEnterLikeTab;
|
|
119675
119686
|
this._editionIsDisabled = editionIsDisabled;
|
|
@@ -119708,6 +119719,15 @@ class GridEditionManager {
|
|
|
119708
119719
|
})
|
|
119709
119720
|
.catch(reason => this.saveFail(reason));
|
|
119710
119721
|
}
|
|
119722
|
+
async recordValidate() {
|
|
119723
|
+
if (this._dataUnit.isDirty()) {
|
|
119724
|
+
try {
|
|
119725
|
+
await this._recordValidationProcessor.validateNewRecord();
|
|
119726
|
+
}
|
|
119727
|
+
catch (error) { }
|
|
119728
|
+
this._gridOptions.api.refreshCells({ force: true });
|
|
119729
|
+
}
|
|
119730
|
+
}
|
|
119711
119731
|
navigateByEnterKey(keyboardEvent) {
|
|
119712
119732
|
const backwards = keyboardEvent.shiftKey;
|
|
119713
119733
|
if (this._useEnterLikeTab) {
|
|
@@ -119912,6 +119932,15 @@ class GridEditionManager {
|
|
|
119912
119932
|
setCellRenders(customRenders) {
|
|
119913
119933
|
this._customRenders = customRenders;
|
|
119914
119934
|
}
|
|
119935
|
+
setInvalidCells(invalidCells, recordId) {
|
|
119936
|
+
this._invalidCells = { fields: invalidCells, recordId };
|
|
119937
|
+
}
|
|
119938
|
+
getInvalidCells() {
|
|
119939
|
+
return this._invalidCells;
|
|
119940
|
+
}
|
|
119941
|
+
clearInvalidCells() {
|
|
119942
|
+
this._invalidCells = undefined;
|
|
119943
|
+
}
|
|
119915
119944
|
}
|
|
119916
119945
|
class TargetEdition {
|
|
119917
119946
|
constructor(rowIndex, column, backwards) {
|
|
@@ -120060,6 +120089,15 @@ class AgGridController {
|
|
|
120060
120089
|
defaultColDef: {
|
|
120061
120090
|
headerClass: 'ez-grid__cell-header',
|
|
120062
120091
|
cellClass: 'ez-grid__cell-body',
|
|
120092
|
+
cellClassRules: {
|
|
120093
|
+
'grid-body__invalidValue sc-ez-grid': (params) => {
|
|
120094
|
+
var _a, _b, _c;
|
|
120095
|
+
if (this._editionManager.getInvalidCells()) {
|
|
120096
|
+
return params.data["__record__id__"] === ((_a = this._editionManager.getInvalidCells()) === null || _a === void 0 ? void 0 : _a.recordId) && ((_c = (_b = this._editionManager.getInvalidCells()) === null || _b === void 0 ? void 0 : _b.fields) === null || _c === void 0 ? void 0 : _c.map(field => field.name).includes(params.colDef.field));
|
|
120097
|
+
}
|
|
120098
|
+
return false;
|
|
120099
|
+
},
|
|
120100
|
+
},
|
|
120063
120101
|
cellStyle: {
|
|
120064
120102
|
height: '100%'
|
|
120065
120103
|
}
|
|
@@ -120302,6 +120340,7 @@ class AgGridController {
|
|
|
120302
120340
|
updateRowData(row) {
|
|
120303
120341
|
const node = this._gridOptions.api.getRowNode(row[this._idAttribName]);
|
|
120304
120342
|
node.setData(Object.assign({}, row));
|
|
120343
|
+
this._editionManager.recordValidate();
|
|
120305
120344
|
}
|
|
120306
120345
|
selectAll(quietly = false) {
|
|
120307
120346
|
try {
|
|
@@ -120384,8 +120423,21 @@ class AgGridController {
|
|
|
120384
120423
|
});
|
|
120385
120424
|
r.setData(data);
|
|
120386
120425
|
});
|
|
120426
|
+
this._gridOptions.api.refreshCells({ force: true });
|
|
120427
|
+
if (this._editionManager.getInvalidCells()) {
|
|
120428
|
+
const rowNode = this._gridOptions.api.getRowNode(this._editionManager.getInvalidCells().recordId);
|
|
120429
|
+
if (rowNode && this._editionManager.getInvalidCells().fields.length > 0) {
|
|
120430
|
+
this.startEdition(rowNode.rowIndex, this._gridOptions.columnApi.getColumn(this._editionManager.getInvalidCells().fields[0].name));
|
|
120431
|
+
}
|
|
120432
|
+
}
|
|
120387
120433
|
}
|
|
120388
120434
|
}
|
|
120435
|
+
savingCanceled(fields, recordId) {
|
|
120436
|
+
const displayedColumns = this._gridOptions.columnApi.getAllDisplayedColumns();
|
|
120437
|
+
const rowIndex = this._gridOptions.api.getRowNode(recordId).rowIndex;
|
|
120438
|
+
const columnFocus = displayedColumns.find(column => this.isColumnEditable(rowIndex, column) && fields.find(field => field.name === column.getColId()));
|
|
120439
|
+
this.startEdition(rowIndex, columnFocus);
|
|
120440
|
+
}
|
|
120389
120441
|
refresh() {
|
|
120390
120442
|
if (this._grid === undefined) {
|
|
120391
120443
|
throw new Error('Erro interno: Grid ainda não inicializado.');
|
|
@@ -120528,9 +120580,11 @@ class AgGridController {
|
|
|
120528
120580
|
//Existem colunas implícitas que não tem estado, essas colunas são sempre as primeiras.
|
|
120529
120581
|
//Como vamos reordenar, precisamos considerar o deslocamento provocado por elas.
|
|
120530
120582
|
const columnsOffset = colDef.length - columns.length;
|
|
120583
|
+
this._gridConfig = state;
|
|
120531
120584
|
let sort = [];
|
|
120532
120585
|
state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
|
|
120533
|
-
|
|
120586
|
+
var _a;
|
|
120587
|
+
const colWidth = (_a = this._gridOptions.columnApi.getColumn(cfgColumn.name)) === null || _a === void 0 ? void 0 : _a.getActualWidth();
|
|
120534
120588
|
this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
|
|
120535
120589
|
this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
|
|
120536
120590
|
visibleColumns.push(cfgColumn.name);
|
|
@@ -120545,7 +120599,6 @@ class AgGridController {
|
|
|
120545
120599
|
state: sort,
|
|
120546
120600
|
defaultState: { sort: null },
|
|
120547
120601
|
});
|
|
120548
|
-
this._gridConfig = state;
|
|
120549
120602
|
}
|
|
120550
120603
|
getAdaptiveWidth(width) {
|
|
120551
120604
|
const widthGrid = this._container.clientWidth;
|
|
@@ -120839,6 +120892,12 @@ class AgGridController {
|
|
|
120839
120892
|
this._editionManager.setCellRenders(customRenders);
|
|
120840
120893
|
(_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
|
|
120841
120894
|
}
|
|
120895
|
+
clearInvalidCells() {
|
|
120896
|
+
if (this._editionManager) {
|
|
120897
|
+
this._editionManager.clearInvalidCells();
|
|
120898
|
+
this._gridOptions.api.refreshCells({ force: true });
|
|
120899
|
+
}
|
|
120900
|
+
}
|
|
120842
120901
|
}
|
|
120843
120902
|
|
|
120844
120903
|
function enableSelectAll(total) {
|
|
@@ -121046,7 +121105,7 @@ class InMemoryFilterColumnDataSource {
|
|
|
121046
121105
|
}
|
|
121047
121106
|
}
|
|
121048
121107
|
|
|
121049
|
-
const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ez-grid__header--background-color:var(--background--xlight, #FFF);--ez-grid__selection-counter--z-index:var(--visible, 1);--ez-grid__container--shadow:0 0 16px 0 rgb(0 38 111 / 12%);--ez-grid--min-height:300px;min-height:var(--ez-grid--min-height)}.grid-header.sc-ez-grid{display:grid;justify-content:space-between;align-items:center;grid-row-start:1;grid-template-columns:1fr;background-color:var(--ez-grid__header--background-color, #FFF)}.grid__container.sc-ez-grid{padding-top:15px;margin-top:-12px;outline:none;box-shadow:var(--ez-grid__container--shadow);background-color:var(--ez-grid__header--background-color)}.grid-header__popover.sc-ez-grid{position:relative;top:var(--space--sm, 16px)}.grid-header__container.sc-ez-grid{display:flex;align-items:center}.grid-header__position.sc-ez-grid{display:flex;align-items:center;justify-content:space-between}.grid__selection-counter.sc-ez-grid{position:fixed;white-space:nowrap;transform:translate(-50%, 0px);left:50%;opacity:0;bottom:-100%;transition:opacity 0.1s, bottom 0.5s}.grid__selection-counter--opened.sc-ez-grid{opacity:1;bottom:0px}.grid__btn-close.sc-ez-grid{display:flex;align-items:center;justify-content:center;padding:0;outline:none;width:20px;height:20px;border:none;background-color:unset;cursor:pointer}.grid__btn-clear.sc-ez-grid{--ez-button--link-color:var(--color--alert-warning-900, #8C6B00);--ez-button--link--hover-color:var(--color--alert-warning-900, #8C6B00)}[no-header].sc-ez-grid-h .grid-header.sc-ez-grid{height:0;padding:0}.grid-header__pagination.sc-ez-grid{width:30%;min-width:100px;justify-content:flex-end;flex-wrap:wrap}.grid-header__left-container.sc-ez-grid{width:70%}.grid-header__pagination-label.sc-ez-grid{width:100%;white-space:nowrap}.overflowed.sc-ez-grid{display:none}";
|
|
121108
|
+
const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ez-grid__header--background-color:var(--background--xlight, #FFF);--ez-grid__selection-counter--z-index:var(--visible, 1);--ez-grid__container--shadow:0 0 16px 0 rgb(0 38 111 / 12%);--ez-grid--min-height:300px;min-height:var(--ez-grid--min-height)}.grid-header.sc-ez-grid{display:grid;justify-content:space-between;align-items:center;grid-row-start:1;grid-template-columns:1fr;background-color:var(--ez-grid__header--background-color, #FFF)}.grid__container.sc-ez-grid{padding-top:15px;margin-top:-12px;outline:none;box-shadow:var(--ez-grid__container--shadow);background-color:var(--ez-grid__header--background-color)}.grid-header__popover.sc-ez-grid{position:relative;top:var(--space--sm, 16px)}.grid-header__container.sc-ez-grid{display:flex;align-items:center}.grid-header__position.sc-ez-grid{display:flex;align-items:center;justify-content:space-between}.grid__selection-counter.sc-ez-grid{position:fixed;white-space:nowrap;transform:translate(-50%, 0px);left:50%;opacity:0;bottom:-100%;transition:opacity 0.1s, bottom 0.5s}.grid__selection-counter--opened.sc-ez-grid{opacity:1;bottom:0px}.grid__btn-close.sc-ez-grid{display:flex;align-items:center;justify-content:center;padding:0;outline:none;width:20px;height:20px;border:none;background-color:unset;cursor:pointer}.grid__btn-clear.sc-ez-grid{--ez-button--link-color:var(--color--alert-warning-900, #8C6B00);--ez-button--link--hover-color:var(--color--alert-warning-900, #8C6B00)}[no-header].sc-ez-grid-h .grid-header.sc-ez-grid{height:0;padding:0}.grid-header__pagination.sc-ez-grid{width:30%;min-width:100px;justify-content:flex-end;flex-wrap:wrap}.grid-header__left-container.sc-ez-grid{width:70%}.grid-header__pagination-label.sc-ez-grid{width:100%;white-space:nowrap}.overflowed.sc-ez-grid{display:none}.grid-body__invalidValue.sc-ez-grid{border:2px var(--color-alert--error-800) solid !important}";
|
|
121050
121109
|
|
|
121051
121110
|
const windowInstace = window;
|
|
121052
121111
|
const matches = (text, filter) => {
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-a7b0c73d.js');
|
|
6
|
+
const core = require('@sankhyalabs/core');
|
|
7
|
+
const EzScrollDirection = require('./EzScrollDirection-b2c99895.js');
|
|
8
|
+
|
|
9
|
+
const ezScrollerCss = ":host{--ez-scroller--box-shadow-color:var(--background--body, #fafcff);--ez-scroller__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-scroller__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-scroller__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-scroller__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-scroller__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-scroller__scrollbar--width:var(--space--small, 6px);--ez-scroller__max-height:unset;display:flex;cursor:grab;width:100%;overflow:hidden}.dragging{cursor:grabbing}.ez-scroller__container{display:flex;overflow-y:hidden;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:transparent transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked),.ez-scroller__container:not(.ez-scroller__container--locked):hover{scrollbar-color:var(--ez-scroller__scrollbar--color-clicked) var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container--both{overflow-y:scroll;overflow-x:scroll;flex-wrap:wrap}.ez-scroller__container--horizontal{overflow-x:scroll;flex-direction:row}.ez-scroller__container--vertical{overflow-y:scroll;flex-direction:column;max-height:var(--ez-scroller__max-height)}.ez-scroller__container::-webkit-scrollbar{background-color:transparent;width:var(--ez-scroller__scrollbar--width);height:var(--ez-scroller__scrollbar--width);max-width:var(--ez-scroller__scrollbar--width);min-width:var(--ez-scroller__scrollbar--width)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar{background-color:var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container::-webkit-scrollbar-track{visibility:hidden;background-color:transparent;border-radius:var(--ez-scroller__scrollbar--border-radius)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-track,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-track{background-color:var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container::-webkit-scrollbar-thumb{background-color:transparent;border-radius:var(--ez-scroller__scrollbar--border-radius)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb{background-color:var(--ez-scroller__scrollbar--color-default)}.ez-scroller__container::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container::-webkit-scrollbar-thumb:horizontal:hover{background-color:transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:horizontal:hover,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-scroller__scrollbar--color-hover)}.ez-scroller__container::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container::-webkit-scrollbar-thumb:horizontal:active{background-color:transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:horizontal:active,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-scroller__scrollbar--color-clicked)}.ez-scroller__wrapper{display:flex;position:relative;width:100%;height:auto}.ez-scroller__wrapper--horizontal{flex-direction:row}.ez-scroller__wrapper--vertical{flex-direction:column}.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--shadow-end::after{content:\"\";display:flex;position:absolute;z-index:1}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-end::after{width:24px;min-height:calc(100% - 10px)}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-start::before{left:0;background:linear-gradient(to right, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-end::after{right:0;background:linear-gradient(to left, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-end::after{min-width:calc(100% - 10px);height:24px}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-start::before{top:0;background:linear-gradient(to bottom, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-end::after{bottom:0;background:linear-gradient(to top, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}";
|
|
10
|
+
|
|
11
|
+
const EzScroller = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this._shadowStart = "ez-scroller__wrapper--shadow-start";
|
|
15
|
+
this._shadowEnd = "ez-scroller__wrapper--shadow-end";
|
|
16
|
+
this.isActive = false;
|
|
17
|
+
this.direction = undefined;
|
|
18
|
+
this.locked = false;
|
|
19
|
+
this.activeShadow = false;
|
|
20
|
+
}
|
|
21
|
+
//---------------------------------------------
|
|
22
|
+
// Private methods
|
|
23
|
+
//---------------------------------------------
|
|
24
|
+
getContainerClass() {
|
|
25
|
+
return `ez-scroller__container ez-scroller__container--${this.direction}
|
|
26
|
+
${this.locked || !this.isActive ? " ez-scroller__container--locked" : ""}
|
|
27
|
+
`;
|
|
28
|
+
}
|
|
29
|
+
getWrapperClass() {
|
|
30
|
+
return `ez-scroller__wrapper ez-scroller__wrapper--${this.direction}`;
|
|
31
|
+
}
|
|
32
|
+
finishDrag() {
|
|
33
|
+
if (this._controller) {
|
|
34
|
+
this._container.classList.remove("dragging");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
updateScroller() {
|
|
38
|
+
const container = this._container;
|
|
39
|
+
if (container == undefined) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
let remainingScroll;
|
|
43
|
+
if (this.direction === EzScrollDirection.EzScrollDirection.HORIZONTAL) {
|
|
44
|
+
const { scrollWidth, clientWidth, scrollLeft } = container;
|
|
45
|
+
remainingScroll = scrollWidth - clientWidth - Math.ceil(scrollLeft);
|
|
46
|
+
this._startHidden = container.scrollLeft > 0;
|
|
47
|
+
}
|
|
48
|
+
else if (this.direction === EzScrollDirection.EzScrollDirection.VERTICAL) {
|
|
49
|
+
const { scrollHeight, clientHeight, scrollTop } = container;
|
|
50
|
+
remainingScroll = scrollHeight - clientHeight - Math.ceil(scrollTop);
|
|
51
|
+
this._startHidden = container.scrollTop > 0;
|
|
52
|
+
}
|
|
53
|
+
this._endHidden = remainingScroll > 0;
|
|
54
|
+
this.isActive = this._startHidden || this._endHidden || this.isActiveScroller();
|
|
55
|
+
this.updateShadow();
|
|
56
|
+
}
|
|
57
|
+
updateShadow() {
|
|
58
|
+
const wrapper = this._wrapper;
|
|
59
|
+
if (!this.activeShadow || wrapper == undefined) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const shadowPositions = ["", "start", "end", "middle"];
|
|
63
|
+
const currentPosition = shadowPositions[Number(this._startHidden) | Number(this._endHidden) << 1];
|
|
64
|
+
if (currentPosition === "start") {
|
|
65
|
+
wrapper.classList.add(this._shadowStart);
|
|
66
|
+
wrapper.classList.remove(this._shadowEnd);
|
|
67
|
+
}
|
|
68
|
+
else if (currentPosition === "end") {
|
|
69
|
+
wrapper.classList.remove(this._shadowStart);
|
|
70
|
+
wrapper.classList.add(this._shadowEnd);
|
|
71
|
+
}
|
|
72
|
+
else if (currentPosition === "middle") {
|
|
73
|
+
wrapper.classList.add(this._shadowStart);
|
|
74
|
+
wrapper.classList.add(this._shadowEnd);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
wrapper.classList.remove(this._shadowStart);
|
|
78
|
+
wrapper.classList.remove(this._shadowEnd);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
configResize() {
|
|
82
|
+
const container = this._container;
|
|
83
|
+
if (container == undefined) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (this._resizeObserver != undefined) {
|
|
87
|
+
this._resizeObserver.unobserve(container);
|
|
88
|
+
}
|
|
89
|
+
this._resizeObserver = new ResizeObserver(core.JSUtils.debounce(this.updateScroller.bind(this), 200));
|
|
90
|
+
this._resizeObserver.observe(container);
|
|
91
|
+
}
|
|
92
|
+
getContainerElement() {
|
|
93
|
+
return index.h("div", { ref: ref => this._container = ref, class: this.getContainerClass() }, index.h("slot", null));
|
|
94
|
+
}
|
|
95
|
+
isActiveScroller() {
|
|
96
|
+
if (this._container == undefined) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
return this._container.scrollWidth > this._container.clientWidth
|
|
100
|
+
|| this._container.scrollHeight > this._container.clientHeight;
|
|
101
|
+
}
|
|
102
|
+
//---------------------------------------------
|
|
103
|
+
// Event handlers
|
|
104
|
+
//---------------------------------------------
|
|
105
|
+
clickListener(evt) {
|
|
106
|
+
if (this._controller && this._controller.didScroll()) {
|
|
107
|
+
evt.preventDefault();
|
|
108
|
+
evt.stopPropagation();
|
|
109
|
+
evt.stopImmediatePropagation();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
mouseDownHandler(evt) {
|
|
113
|
+
if (this.locked) {
|
|
114
|
+
this.finishDrag();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (!this._controller) {
|
|
118
|
+
this._controller = new ScrollCtrl(this._container);
|
|
119
|
+
}
|
|
120
|
+
this._controller.startDragg(evt);
|
|
121
|
+
this._container.classList.add("dragging");
|
|
122
|
+
}
|
|
123
|
+
mouseUpHandler() {
|
|
124
|
+
this.finishDrag();
|
|
125
|
+
}
|
|
126
|
+
mouseMoveHandler(evt) {
|
|
127
|
+
if (this.locked) {
|
|
128
|
+
this.finishDrag();
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (this._controller) {
|
|
132
|
+
if (evt.buttons === 0) {
|
|
133
|
+
this.finishDrag();
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
this._controller.doScroll(evt);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
componentDidRender() {
|
|
141
|
+
var _a, _b;
|
|
142
|
+
if (this._container == undefined) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (this.direction === EzScrollDirection.EzScrollDirection.BOTH) {
|
|
146
|
+
(_a = this._wrapper) === null || _a === void 0 ? void 0 : _a.classList.remove(this._shadowStart);
|
|
147
|
+
(_b = this._wrapper) === null || _b === void 0 ? void 0 : _b.classList.remove(this._shadowEnd);
|
|
148
|
+
this.isActive = this.isActiveScroller();
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
this._container.onscroll = this.updateScroller.bind(this);
|
|
152
|
+
this.configResize();
|
|
153
|
+
this.updateScroller();
|
|
154
|
+
}
|
|
155
|
+
render() {
|
|
156
|
+
return (index.h(index.Host, null, this.activeShadow
|
|
157
|
+
? index.h("div", { ref: ref => this._wrapper = ref, class: this.getWrapperClass() }, this.getContainerElement())
|
|
158
|
+
: this.getContainerElement()));
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
class ScrollCtrl {
|
|
162
|
+
constructor(scrollablePanel) {
|
|
163
|
+
this.scrollablePanel = scrollablePanel;
|
|
164
|
+
}
|
|
165
|
+
startDragg(evt) {
|
|
166
|
+
this.startX = this.measureX(evt);
|
|
167
|
+
this.startY = this.measureY(evt);
|
|
168
|
+
this.scrollWidth = 0;
|
|
169
|
+
this.scrollHeight = 0;
|
|
170
|
+
}
|
|
171
|
+
measureX(e) {
|
|
172
|
+
return e.pageX - this.scrollablePanel.offsetLeft;
|
|
173
|
+
}
|
|
174
|
+
measureY(e) {
|
|
175
|
+
return e.pageY - this.scrollablePanel.offsetTop;
|
|
176
|
+
}
|
|
177
|
+
doScroll(e) {
|
|
178
|
+
const x = this.measureX(e);
|
|
179
|
+
const y = this.measureY(e);
|
|
180
|
+
if (x != this.startX || y != this.startY) {
|
|
181
|
+
const scrollX = x - this.startX;
|
|
182
|
+
const scrollY = y - this.startY;
|
|
183
|
+
this.startX += scrollX;
|
|
184
|
+
this.startY += scrollY;
|
|
185
|
+
this.scrollWidth += Math.abs(scrollX);
|
|
186
|
+
this.scrollHeight += Math.abs(scrollY);
|
|
187
|
+
this.scrollablePanel.scrollLeft = Math.max(0, this.scrollablePanel.scrollLeft - scrollX);
|
|
188
|
+
this.scrollablePanel.scrollTop = Math.max(0, this.scrollablePanel.scrollTop - scrollY);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
didScroll() {
|
|
192
|
+
const tollerance = 5;
|
|
193
|
+
return this.scrollHeight > tollerance || this.scrollWidth > tollerance;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
EzScroller.style = ezScrollerCss;
|
|
197
|
+
|
|
198
|
+
const ezSidebarButtonCss = ":host{position:relative;--ez-sidebar-button--width:6px;--ez-sidebar-button--hover--width:12px;--ez-sidebar-button--height:96px;--ez-sidebar-button--background-color--xlight:var(--background--xlight, #fff);--ez-sidebar-button--background-color--primary:var(--color--primary);--ez-sidebar-button--space--small:var(--space--small, 6px);--ez-sidebar-button--space--medium:var(--space--medium, 12px);--ez-sidebar-button--box-shadow:var(--shadow--small, 0px 0px 16px rgba(0, 38, 111, 0.07));--ez-sidebar-button--hover--box-shadow:var(--shadow--hard, 0px 0px 16px rgba(43, 58, 84, 0.24));--ez-sidebar-button--border--radius-small:var(--border--radius-small);--ez-sidebar-button--border--radius-medium:var(--border--radius-medium)}button{position:absolute;display:flex;background:var(--ez-sidebar-button--background-color--xlight);border:0;border-radius:0 var(--ez-sidebar-button--border--radius-medium) var(--ez-sidebar-button--border--radius-medium) 0;box-shadow:var(--ez-sidebar-button--box-shadow);padding:0;cursor:pointer;align-items:center}span{width:var(--ez-sidebar-button--width);height:var(--ez-sidebar-button--height);margin:var(--ez-sidebar-button--space--medium) 0 var(--ez-sidebar-button--space--medium) 0;background:var(--ez-sidebar-button--background-color--primary);border-radius:0 var(--ez-sidebar-button--border--radius-small) var(--ez-sidebar-button--border--radius-small) 0}ez-icon{--ez-icon--color:var(--ez-sidebar-button--background-color--primary)}button:hover{box-shadow:var(--ez-sidebar-button--hover--box-shadow)}button:hover span{width:var(--ez-sidebar-button--hover--width);margin:var(--ez-sidebar-button--space--medium) 0 var(--ez-sidebar-button--space--medium) 0}";
|
|
199
|
+
|
|
200
|
+
const EzSidebarButton = class {
|
|
201
|
+
constructor(hostRef) {
|
|
202
|
+
index.registerInstance(this, hostRef);
|
|
203
|
+
this.ezClick = index.createEvent(this, "ezClick", 7);
|
|
204
|
+
}
|
|
205
|
+
componentDidLoad() {
|
|
206
|
+
if (this._element) {
|
|
207
|
+
core.ElementIDUtils.addIDInfo(this._element);
|
|
208
|
+
}
|
|
209
|
+
if (this._button) {
|
|
210
|
+
const dataInfo = { id: 'embedded' };
|
|
211
|
+
core.ElementIDUtils.addIDInfo(this._button, 'button', dataInfo);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
render() {
|
|
215
|
+
return (index.h("button", { type: "button", onClick: () => { this.ezClick.emit(); }, ref: (el) => this._button = el }, index.h("span", null), index.h("ez-icon", { iconName: "chevron-right" })));
|
|
216
|
+
}
|
|
217
|
+
get _element() { return index.getElement(this); }
|
|
218
|
+
};
|
|
219
|
+
EzSidebarButton.style = ezSidebarButtonCss;
|
|
220
|
+
|
|
221
|
+
exports.ez_scroller = EzScroller;
|
|
222
|
+
exports.ez_sidebar_button = EzSidebarButton;
|
|
@@ -24,7 +24,6 @@ const EzSearch = class {
|
|
|
24
24
|
this._tabPressed = false;
|
|
25
25
|
this._textEmptyList = "Nenhum resultado encontrado";
|
|
26
26
|
this._textEmptySearch = "Nenhum resultado de {0} encontrado";
|
|
27
|
-
this._lookupMode = false;
|
|
28
27
|
this._startHighlightTag = "<span class='card-item__highlight'>";
|
|
29
28
|
this._endHighlightTag = "</span>";
|
|
30
29
|
this._preSelection = undefined;
|
|
@@ -53,36 +52,30 @@ const EzSearch = class {
|
|
|
53
52
|
var _a;
|
|
54
53
|
if (this._textInput) {
|
|
55
54
|
this._textInput.errorMessage = this.errorMessage;
|
|
56
|
-
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
55
|
+
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim()) && this.errorMessage) {
|
|
57
56
|
this.setInputValue();
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
}
|
|
60
|
+
validateNewValue(newValue, oldValue) {
|
|
61
|
+
const getValue = (val) => typeof val === 'object' ? val === null || val === void 0 ? void 0 : val.value : val;
|
|
62
|
+
return (getValue(newValue) !== getValue(oldValue));
|
|
63
|
+
}
|
|
61
64
|
async observeValue(newValue, oldValue) {
|
|
62
|
-
if (this._textInput && newValue
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const newValueSelected = this.getSelectedOption(newValue);
|
|
69
|
-
const oldValueSelected = this.getSelectedOption(oldValue);
|
|
70
|
-
const currentValue = this.getSelectedOption(this.value);
|
|
71
|
-
if (this.isDifferentValues(currentValue, newValueSelected)) {
|
|
72
|
-
this.value = newValueSelected;
|
|
73
|
-
}
|
|
74
|
-
if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
|
|
75
|
-
this.setInputValue();
|
|
76
|
-
const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
|
|
77
|
-
if (!this._lookupMode) {
|
|
78
|
-
this.ezChange.emit(valueEmitted);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
this.resetOptions();
|
|
65
|
+
if (this._textInput && newValue !== oldValue && this.validateNewValue(newValue, oldValue)) {
|
|
66
|
+
if (typeof newValue === "string") {
|
|
67
|
+
await this.handleValueAsString(newValue);
|
|
68
|
+
return;
|
|
82
69
|
}
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
const newValueSelected = this.getSelectedOption(newValue);
|
|
71
|
+
const currentValue = this.getSelectedOption(this._currentValue);
|
|
72
|
+
if (this.isDifferentValues(currentValue, newValueSelected)) {
|
|
73
|
+
this._currentValue = newValueSelected;
|
|
74
|
+
this.setInputValue();
|
|
75
|
+
const valueEmitted = newValueSelected !== null && newValueSelected !== void 0 ? newValueSelected : undefined;
|
|
76
|
+
this.ezChange.emit(valueEmitted);
|
|
85
77
|
}
|
|
78
|
+
this.resetOptions();
|
|
86
79
|
}
|
|
87
80
|
}
|
|
88
81
|
observeOptions(newOptions, oldOptions) {
|
|
@@ -155,7 +148,9 @@ const EzSearch = class {
|
|
|
155
148
|
return;
|
|
156
149
|
}
|
|
157
150
|
await this.loadDescriptionValue(value);
|
|
151
|
+
this.setInputValue();
|
|
158
152
|
this.ezChange.emit(this.value);
|
|
153
|
+
this._currentValue = this.value;
|
|
159
154
|
}
|
|
160
155
|
updateListPosition() {
|
|
161
156
|
let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
|
|
@@ -212,7 +207,7 @@ const EzSearch = class {
|
|
|
212
207
|
return text;
|
|
213
208
|
}
|
|
214
209
|
getText() {
|
|
215
|
-
const currentValue = this.getSelectedOption(this.
|
|
210
|
+
const currentValue = this.getSelectedOption(this._currentValue);
|
|
216
211
|
const text = this.getFormattedText(currentValue);
|
|
217
212
|
if (text == undefined) {
|
|
218
213
|
return;
|
|
@@ -387,6 +382,7 @@ const EzSearch = class {
|
|
|
387
382
|
|| (currentValue == undefined && newOptionsReplaced != undefined && "value" in newOptionsReplaced)) {
|
|
388
383
|
const adjustedOpt = !(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value) ? undefined : newOptionsReplaced;
|
|
389
384
|
this.value = adjustedOpt;
|
|
385
|
+
this._currentValue = adjustedOpt;
|
|
390
386
|
}
|
|
391
387
|
else {
|
|
392
388
|
this.setInputValue();
|
|
@@ -407,7 +403,7 @@ const EzSearch = class {
|
|
|
407
403
|
}
|
|
408
404
|
}
|
|
409
405
|
cancelPreselection() {
|
|
410
|
-
if (!this._textInput.value && this.
|
|
406
|
+
if (!this._textInput.value && this._currentValue) {
|
|
411
407
|
this.selectOption(undefined);
|
|
412
408
|
}
|
|
413
409
|
else {
|
|
@@ -428,6 +424,7 @@ const EzSearch = class {
|
|
|
428
424
|
}
|
|
429
425
|
clearSearch() {
|
|
430
426
|
this.value = null;
|
|
427
|
+
this._currentValue = null;
|
|
431
428
|
}
|
|
432
429
|
controlListWithOnlyOne() {
|
|
433
430
|
var _a, _b;
|
|
@@ -457,11 +454,11 @@ const EzSearch = class {
|
|
|
457
454
|
if (core.StringUtils.isEmpty(this.value)) {
|
|
458
455
|
return;
|
|
459
456
|
}
|
|
460
|
-
|
|
461
|
-
if (typeof value === "object") {
|
|
457
|
+
if (!this.validateNewValue(this.value, this._currentValue)) {
|
|
462
458
|
return;
|
|
463
459
|
}
|
|
464
|
-
|
|
460
|
+
let value = this.value;
|
|
461
|
+
if (typeof value === "object") {
|
|
465
462
|
return;
|
|
466
463
|
}
|
|
467
464
|
this.loadDescriptionValue(value);
|
|
@@ -498,8 +495,8 @@ const EzSearch = class {
|
|
|
498
495
|
this.showNoResultMessage();
|
|
499
496
|
return;
|
|
500
497
|
}
|
|
501
|
-
this.
|
|
502
|
-
this.value =
|
|
498
|
+
this._currentValue = value ? Object.assign(Object.assign({}, value), { value: this.replaceHighlight(value.value), label: this.replaceHighlight(value.label) }) : value;
|
|
499
|
+
this.value = this._currentValue;
|
|
503
500
|
}
|
|
504
501
|
loadOptionValue(argument) {
|
|
505
502
|
var _a;
|
|
@@ -558,6 +555,7 @@ const EzSearch = class {
|
|
|
558
555
|
this.validateDescriptionValue();
|
|
559
556
|
}
|
|
560
557
|
componentDidLoad() {
|
|
558
|
+
this._currentValue = this.value;
|
|
561
559
|
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
|
|
562
560
|
this.setInputValue(false);
|
|
563
561
|
this._resizeObserver = new ResizeObserver((entries) => {
|