@sankhyalabs/ezui 5.16.0 → 5.17.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-actions-button.cjs.entry.js +53 -25
- package/dist/cjs/ez-combo-box.cjs.entry.js +4 -3
- package/dist/cjs/ez-form.cjs.entry.js +30 -0
- package/dist/cjs/ez-grid.cjs.entry.js +20 -0
- package/dist/cjs/ez-search.cjs.entry.js +2 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-actions-button/ez-actions-button.css +4 -0
- package/dist/collection/components/ez-actions-button/ez-actions-button.js +104 -26
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +22 -3
- package/dist/collection/components/ez-form/ez-form.js +73 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +3 -0
- package/dist/collection/components/ez-grid/ez-grid.js +63 -1
- package/dist/collection/components/ez-search/ez-search.js +20 -1
- package/dist/collection/utils/form/DataBinder.js +10 -0
- package/dist/collection/utils/interfaces/IAction.js +1 -0
- package/dist/custom-elements/index.js +112 -32
- package/dist/esm/ez-actions-button.entry.js +53 -25
- package/dist/esm/ez-combo-box.entry.js +4 -3
- package/dist/esm/ez-form.entry.js +30 -0
- package/dist/esm/ez-grid.entry.js +20 -0
- package/dist/esm/ez-search.entry.js +2 -1
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-3e7cc8a4.entry.js +1 -0
- package/dist/ezui/p-8252d9b5.entry.js +1 -0
- package/dist/ezui/{p-00dd6f68.entry.js → p-8a7533c9.entry.js} +1 -1
- package/dist/ezui/p-f8653522.entry.js +1 -0
- package/dist/ezui/p-ffa8ec98.entry.js +1 -0
- package/dist/types/components/ez-actions-button/ez-actions-button.d.ts +15 -7
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +4 -1
- package/dist/types/components/ez-form/ez-form.d.ts +14 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +4 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +1 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +8 -0
- package/dist/types/components/ez-search/ez-search.d.ts +4 -0
- package/dist/types/components.d.ts +54 -2
- package/dist/types/utils/form/DataBinder.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/interfaces/IAction.d.ts +7 -0
- package/package.json +1 -1
- package/dist/ezui/p-07e537da.entry.js +0 -1
- package/dist/ezui/p-7526f2b6.entry.js +0 -1
- package/dist/ezui/p-b0663be7.entry.js +0 -1
- package/dist/ezui/p-b806cd19.entry.js +0 -1
|
@@ -16,6 +16,12 @@ export class EzActionsButton {
|
|
|
16
16
|
return true;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
+
do {
|
|
20
|
+
if (floatingContainer.contains(node)) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
node = node.offsetParent;
|
|
24
|
+
} while (node != undefined && node != document.getRootNode());
|
|
19
25
|
}
|
|
20
26
|
return false;
|
|
21
27
|
};
|
|
@@ -39,6 +45,25 @@ export class EzActionsButton {
|
|
|
39
45
|
}
|
|
40
46
|
this._floatingID = undefined;
|
|
41
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Apresenta a lista de ações.
|
|
50
|
+
*/
|
|
51
|
+
async showActions() {
|
|
52
|
+
if (!this.enabled) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const options = this.getFloatOptions();
|
|
56
|
+
this._floatingID = FloatingManager.float(this._actionsList, this._listContainer, options);
|
|
57
|
+
const sideLimit = this.getSideLimit();
|
|
58
|
+
if (sideLimit != undefined) {
|
|
59
|
+
options.left = sideLimit;
|
|
60
|
+
FloatingManager.updateFloatPosition(this._actionsList, this._listContainer, options);
|
|
61
|
+
}
|
|
62
|
+
window.requestAnimationFrame(() => {
|
|
63
|
+
this._actionsList.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
64
|
+
});
|
|
65
|
+
this.ezPopoverOpen.emit(this._actionsList);
|
|
66
|
+
}
|
|
42
67
|
/**
|
|
43
68
|
* Verifica se a lista de ações está aberta.
|
|
44
69
|
*/
|
|
@@ -51,7 +76,8 @@ export class EzActionsButton {
|
|
|
51
76
|
innerClickTest: this.innerClickCheck,
|
|
52
77
|
isFixed: true,
|
|
53
78
|
top: this.getPositionTop(),
|
|
54
|
-
left: this.getPositionLeft()
|
|
79
|
+
left: this.getPositionLeft(),
|
|
80
|
+
backClickListener: () => this._floatingID = undefined
|
|
55
81
|
};
|
|
56
82
|
}
|
|
57
83
|
getSideLimit() {
|
|
@@ -63,21 +89,6 @@ export class EzActionsButton {
|
|
|
63
89
|
}
|
|
64
90
|
return;
|
|
65
91
|
}
|
|
66
|
-
showActions() {
|
|
67
|
-
if (!this.enabled) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
const options = this.getFloatOptions();
|
|
71
|
-
this._floatingID = FloatingManager.float(this._actionsList, this._listContainer, options);
|
|
72
|
-
const sideLimit = this.getSideLimit();
|
|
73
|
-
if (sideLimit != undefined) {
|
|
74
|
-
options.left = sideLimit;
|
|
75
|
-
FloatingManager.updateFloatPosition(this._actionsList, this._listContainer, options);
|
|
76
|
-
}
|
|
77
|
-
window.requestAnimationFrame(() => {
|
|
78
|
-
this._actionsList.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
92
|
updatePosition() {
|
|
82
93
|
if (!this.enabled || this._floatingID == undefined) {
|
|
83
94
|
return;
|
|
@@ -160,14 +171,18 @@ export class EzActionsButton {
|
|
|
160
171
|
}
|
|
161
172
|
}
|
|
162
173
|
}
|
|
174
|
+
disconnectedCallback() {
|
|
175
|
+
this.ezDisconnectedActionButtons.emit();
|
|
176
|
+
}
|
|
163
177
|
componentDidLoad() {
|
|
164
178
|
CSSVarsUtils.applyVarsButton(this._element, this._button);
|
|
165
179
|
ElementIDUtils.addIDInfo(this._element);
|
|
166
180
|
this.controlScrollPage();
|
|
167
181
|
}
|
|
168
182
|
componentDidRender() {
|
|
183
|
+
var _a;
|
|
169
184
|
if (this._floatingID == undefined) {
|
|
170
|
-
this._actionsList.remove();
|
|
185
|
+
(_a = this._actionsList) === null || _a === void 0 ? void 0 : _a.remove();
|
|
171
186
|
}
|
|
172
187
|
if (this.hasLabelOrCheckOption()) {
|
|
173
188
|
if (!!this.value) {
|
|
@@ -178,6 +193,23 @@ export class EzActionsButton {
|
|
|
178
193
|
}
|
|
179
194
|
}
|
|
180
195
|
}
|
|
196
|
+
buildActionElement(action) {
|
|
197
|
+
var _a;
|
|
198
|
+
if (!action) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (action.itemBuilder != undefined) {
|
|
202
|
+
const customContent = action.itemBuilder(this._element, action);
|
|
203
|
+
if (typeof customContent === "string") {
|
|
204
|
+
return h("div", { class: "ez-actions-button__btn-action", innerHTML: customContent });
|
|
205
|
+
}
|
|
206
|
+
return customContent;
|
|
207
|
+
}
|
|
208
|
+
return h("ez-button", { size: "small", label: action.label, onClick: () => this.actionClick(action), enabled: action.enabled, class: "ez-actions-button__btn-action" +
|
|
209
|
+
(this.checkOption || this.hasIconName() ? " ez-actions-button__btn-action--spaced" : "") }, this.checkOption && ((_a = this._selectedAction) === null || _a === void 0 ? void 0 : _a.value) === action.value &&
|
|
210
|
+
h("ez-icon", { class: "ez-actions-button__icon-check", slot: "leftIcon", size: "small", iconName: "check" }), !this.checkOption && action.iconName &&
|
|
211
|
+
h("ez-icon", { class: "ez-actions-button__icon-item", slot: "leftIcon", size: "small", iconName: action.iconName }));
|
|
212
|
+
}
|
|
181
213
|
render() {
|
|
182
214
|
var _a;
|
|
183
215
|
return (h(Host, null, h("ez-button", { ref: elem => this._button = elem, class: (this.isTransparent ? "ez-actions-button__btn-transparent" : "") +
|
|
@@ -185,13 +217,7 @@ export class EzActionsButton {
|
|
|
185
217
|
h("ez-icon", { class: "ez-actions-button__icon-right", slot: "rightIcon", iconName: this.displayIcon || "dots-vertical" })), h("section", { class: "ez-actions-button__list-container", ref: elem => this._listContainer = elem }, this.arrowActive &&
|
|
186
218
|
h("div", { class: "ez-actions-button__arrow ez-actions-button__arrow--" + (this.size || "small") +
|
|
187
219
|
(this.isTransparent ? " ez-actions-button__arrow--upped" : "") }), h("div", { ref: elem => this._actionsList = elem, class: "ez-actions-button__actions-list ez-actions-button__actions-list--max-height" +
|
|
188
|
-
(this.arrowActive && !this.isTransparent ? " ez-actions-button__actions-list--lowered" : "") }, this.actions.map(action =>
|
|
189
|
-
var _a;
|
|
190
|
-
return h("ez-button", { size: "small", label: action.label, onClick: () => this.actionClick(action), enabled: action.enabled, class: "ez-actions-button__btn-action" +
|
|
191
|
-
(this.checkOption || this.hasIconName() ? " ez-actions-button__btn-action--spaced" : "") }, this.checkOption && ((_a = this._selectedAction) === null || _a === void 0 ? void 0 : _a.value) === action.value &&
|
|
192
|
-
h("ez-icon", { class: "ez-actions-button__icon-check", slot: "leftIcon", size: "small", iconName: "check" }), !this.checkOption && action.iconName &&
|
|
193
|
-
h("ez-icon", { class: "ez-actions-button__icon-item", slot: "leftIcon", size: "small", iconName: action.iconName }));
|
|
194
|
-
})))));
|
|
220
|
+
(this.arrowActive && !this.isTransparent ? " ez-actions-button__actions-list--lowered" : "") }, this.actions.map(action => this.buildActionElement(action))))));
|
|
195
221
|
}
|
|
196
222
|
static get is() { return "ez-actions-button"; }
|
|
197
223
|
static get encapsulation() { return "shadow"; }
|
|
@@ -236,7 +262,8 @@ export class EzActionsButton {
|
|
|
236
262
|
"location": "global"
|
|
237
263
|
},
|
|
238
264
|
"IAction": {
|
|
239
|
-
"location": "
|
|
265
|
+
"location": "import",
|
|
266
|
+
"path": "../../utils"
|
|
240
267
|
}
|
|
241
268
|
}
|
|
242
269
|
},
|
|
@@ -394,10 +421,45 @@ export class EzActionsButton {
|
|
|
394
421
|
"resolved": "IAction",
|
|
395
422
|
"references": {
|
|
396
423
|
"IAction": {
|
|
397
|
-
"location": "
|
|
424
|
+
"location": "import",
|
|
425
|
+
"path": "../../utils"
|
|
398
426
|
}
|
|
399
427
|
}
|
|
400
428
|
}
|
|
429
|
+
}, {
|
|
430
|
+
"method": "ezPopoverOpen",
|
|
431
|
+
"name": "ezPopoverOpen",
|
|
432
|
+
"bubbles": true,
|
|
433
|
+
"cancelable": true,
|
|
434
|
+
"composed": true,
|
|
435
|
+
"docs": {
|
|
436
|
+
"tags": [],
|
|
437
|
+
"text": "Emitido ao mostrar a lista de a\u00E7\u00F5es"
|
|
438
|
+
},
|
|
439
|
+
"complexType": {
|
|
440
|
+
"original": "HTMLElement",
|
|
441
|
+
"resolved": "HTMLElement",
|
|
442
|
+
"references": {
|
|
443
|
+
"HTMLElement": {
|
|
444
|
+
"location": "global"
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}, {
|
|
449
|
+
"method": "ezDisconnectedActionButtons",
|
|
450
|
+
"name": "ezDisconnectedActionButtons",
|
|
451
|
+
"bubbles": true,
|
|
452
|
+
"cancelable": true,
|
|
453
|
+
"composed": true,
|
|
454
|
+
"docs": {
|
|
455
|
+
"tags": [],
|
|
456
|
+
"text": "Emitido quando componente \u00E9 desconectado da DOM"
|
|
457
|
+
},
|
|
458
|
+
"complexType": {
|
|
459
|
+
"original": "void",
|
|
460
|
+
"resolved": "void",
|
|
461
|
+
"references": {}
|
|
462
|
+
}
|
|
401
463
|
}];
|
|
402
464
|
}
|
|
403
465
|
static get methods() {
|
|
@@ -418,6 +480,22 @@ export class EzActionsButton {
|
|
|
418
480
|
"tags": []
|
|
419
481
|
}
|
|
420
482
|
},
|
|
483
|
+
"showActions": {
|
|
484
|
+
"complexType": {
|
|
485
|
+
"signature": "() => Promise<void>",
|
|
486
|
+
"parameters": [],
|
|
487
|
+
"references": {
|
|
488
|
+
"Promise": {
|
|
489
|
+
"location": "global"
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
"return": "Promise<void>"
|
|
493
|
+
},
|
|
494
|
+
"docs": {
|
|
495
|
+
"text": "Apresenta a lista de a\u00E7\u00F5es.",
|
|
496
|
+
"tags": []
|
|
497
|
+
}
|
|
498
|
+
},
|
|
421
499
|
"isOpened": {
|
|
422
500
|
"complexType": {
|
|
423
501
|
"signature": "() => Promise<boolean>",
|
|
@@ -5,7 +5,6 @@ import { REQUIRED_INFO } from "../../utils/constants";
|
|
|
5
5
|
export class EzComboBox {
|
|
6
6
|
constructor() {
|
|
7
7
|
this._changeDeboucingTimeout = null;
|
|
8
|
-
this._limitCharsToSearch = 3;
|
|
9
8
|
this._deboucingTime = 300;
|
|
10
9
|
this._maxWidthValue = 0;
|
|
11
10
|
this._tabPressed = false;
|
|
@@ -17,6 +16,7 @@ export class EzComboBox {
|
|
|
17
16
|
this._startLoading = false;
|
|
18
17
|
this._showLoading = true;
|
|
19
18
|
this._criteria = undefined;
|
|
19
|
+
this.limitCharsToSearch = 3;
|
|
20
20
|
this.value = undefined;
|
|
21
21
|
this.label = undefined;
|
|
22
22
|
this.enabled = true;
|
|
@@ -555,7 +555,6 @@ export class EzComboBox {
|
|
|
555
555
|
return;
|
|
556
556
|
}
|
|
557
557
|
const argument = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.trim();
|
|
558
|
-
const argumentNumber = this.buildNumberArgument(argument);
|
|
559
558
|
if (!this._criteria) {
|
|
560
559
|
this._textInput.value = event.data || argument;
|
|
561
560
|
}
|
|
@@ -564,7 +563,9 @@ export class EzComboBox {
|
|
|
564
563
|
if (this.searchMode) {
|
|
565
564
|
this._showLoading = false;
|
|
566
565
|
this.clearSource();
|
|
567
|
-
|
|
566
|
+
const enoughChars = argument.length >= this.limitCharsToSearch;
|
|
567
|
+
const argumentNumber = this.buildNumberArgument(argument);
|
|
568
|
+
if (enoughChars || !isNaN(argumentNumber)) {
|
|
568
569
|
this._showLoading = true;
|
|
569
570
|
this._changeDeboucingTimeout = window.setTimeout(() => {
|
|
570
571
|
this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
|
|
@@ -674,6 +675,24 @@ export class EzComboBox {
|
|
|
674
675
|
}
|
|
675
676
|
static get properties() {
|
|
676
677
|
return {
|
|
678
|
+
"limitCharsToSearch": {
|
|
679
|
+
"type": "number",
|
|
680
|
+
"mutable": false,
|
|
681
|
+
"complexType": {
|
|
682
|
+
"original": "number",
|
|
683
|
+
"resolved": "number",
|
|
684
|
+
"references": {}
|
|
685
|
+
},
|
|
686
|
+
"required": false,
|
|
687
|
+
"optional": false,
|
|
688
|
+
"docs": {
|
|
689
|
+
"tags": [],
|
|
690
|
+
"text": "Define o limite de caracteres m\u00EDnimo para realizar uma pesquisa"
|
|
691
|
+
},
|
|
692
|
+
"attribute": "limit-chars-to-search",
|
|
693
|
+
"reflect": false,
|
|
694
|
+
"defaultValue": "3"
|
|
695
|
+
},
|
|
677
696
|
"value": {
|
|
678
697
|
"type": "string",
|
|
679
698
|
"mutable": true,
|
|
@@ -14,6 +14,7 @@ export class EzForm {
|
|
|
14
14
|
this.dataUnit = undefined;
|
|
15
15
|
this.config = undefined;
|
|
16
16
|
this.recordsValidator = undefined;
|
|
17
|
+
this.fieldToFocus = undefined;
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
20
|
* Realiza validação no conteúdo de todos os campos.
|
|
@@ -48,6 +49,7 @@ export class EzForm {
|
|
|
48
49
|
if (currentSheet == undefined) {
|
|
49
50
|
return;
|
|
50
51
|
}
|
|
52
|
+
this.ezFormSetFields.emit(fields);
|
|
51
53
|
const idFormSheet = `${StringUtils.replaceAccentuatedChars(StringUtils.toCamelCase(currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.label), false)}_selectorContainer`;
|
|
52
54
|
return (h("div", { class: "dynamic-content", "data-element-id": idFormSheet }, h("ez-form-view", { class: "ez-row ez-padding-vertical--small", fields: fields })));
|
|
53
55
|
}
|
|
@@ -79,6 +81,22 @@ export class EzForm {
|
|
|
79
81
|
metadata.addRequiredFields(this._staticFields.filter(f => f.dataset.required).map(f => f.dataset.fieldName));
|
|
80
82
|
this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")), this.dataUnit.dataUnitId, metadata, this.recordsValidator);
|
|
81
83
|
this.ezReady.emit();
|
|
84
|
+
this.handleFieldToFocus();
|
|
85
|
+
}
|
|
86
|
+
handleFieldToFocus() {
|
|
87
|
+
var _a;
|
|
88
|
+
if (this.fieldToFocus == undefined) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const currentSheet = selectCurrentSheet((_a = this._store) === null || _a === void 0 ? void 0 : _a.getState());
|
|
92
|
+
const fields = currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.fields;
|
|
93
|
+
if (!fields.some(item => item.name === this.fieldToFocus)) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
requestAnimationFrame(() => {
|
|
97
|
+
this._dataBinder.setFocus(this.fieldToFocus);
|
|
98
|
+
this.ezFormRequestClearFieldToFocus.emit();
|
|
99
|
+
});
|
|
82
100
|
}
|
|
83
101
|
disconnectedCallback() {
|
|
84
102
|
this.dataUnit.unsubscribe(this.onDataUnitAction);
|
|
@@ -166,11 +184,66 @@ export class EzForm {
|
|
|
166
184
|
"tags": [],
|
|
167
185
|
"text": "Define um validador respons\u00E1vel pela integridade dos registros."
|
|
168
186
|
}
|
|
187
|
+
},
|
|
188
|
+
"fieldToFocus": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"mutable": false,
|
|
191
|
+
"complexType": {
|
|
192
|
+
"original": "string",
|
|
193
|
+
"resolved": "string",
|
|
194
|
+
"references": {}
|
|
195
|
+
},
|
|
196
|
+
"required": false,
|
|
197
|
+
"optional": false,
|
|
198
|
+
"docs": {
|
|
199
|
+
"tags": [],
|
|
200
|
+
"text": "Determina o campo que deve ficar em evid\u00EAncia."
|
|
201
|
+
},
|
|
202
|
+
"attribute": "field-to-focus",
|
|
203
|
+
"reflect": false
|
|
169
204
|
}
|
|
170
205
|
};
|
|
171
206
|
}
|
|
172
207
|
static get events() {
|
|
173
208
|
return [{
|
|
209
|
+
"method": "ezFormRequestClearFieldToFocus",
|
|
210
|
+
"name": "ezFormRequestClearFieldToFocus",
|
|
211
|
+
"bubbles": true,
|
|
212
|
+
"cancelable": true,
|
|
213
|
+
"composed": true,
|
|
214
|
+
"docs": {
|
|
215
|
+
"tags": [],
|
|
216
|
+
"text": "Emitido quando o campo recebe foco"
|
|
217
|
+
},
|
|
218
|
+
"complexType": {
|
|
219
|
+
"original": "void",
|
|
220
|
+
"resolved": "void",
|
|
221
|
+
"references": {}
|
|
222
|
+
}
|
|
223
|
+
}, {
|
|
224
|
+
"method": "ezFormSetFields",
|
|
225
|
+
"name": "ezFormSetFields",
|
|
226
|
+
"bubbles": true,
|
|
227
|
+
"cancelable": true,
|
|
228
|
+
"composed": true,
|
|
229
|
+
"docs": {
|
|
230
|
+
"tags": [],
|
|
231
|
+
"text": "Emitido quando o campo recebe foco"
|
|
232
|
+
},
|
|
233
|
+
"complexType": {
|
|
234
|
+
"original": "Array<IFieldConfig>",
|
|
235
|
+
"resolved": "IFieldConfig[]",
|
|
236
|
+
"references": {
|
|
237
|
+
"Array": {
|
|
238
|
+
"location": "global"
|
|
239
|
+
},
|
|
240
|
+
"IFieldConfig": {
|
|
241
|
+
"location": "import",
|
|
242
|
+
"path": "../../utils/form/interfaces"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}, {
|
|
174
247
|
"method": "ezReady",
|
|
175
248
|
"name": "ezReady",
|
|
176
249
|
"bubbles": true,
|
|
@@ -44,6 +44,9 @@ export default class AgGridController {
|
|
|
44
44
|
getGridConfig() {
|
|
45
45
|
return this._gridConfig;
|
|
46
46
|
}
|
|
47
|
+
locateColumn(columnName) {
|
|
48
|
+
this._gridOptions.api.ensureColumnVisible(columnName);
|
|
49
|
+
}
|
|
47
50
|
getSort(_dataUnitName, defaultSorting) {
|
|
48
51
|
const sortedColumns = [];
|
|
49
52
|
this._gridOptions.columnApi
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementIDUtils, JSUtils, } from '@sankhyalabs/core';
|
|
1
|
+
import { ElementIDUtils, JSUtils, StringUtils, } from '@sankhyalabs/core';
|
|
2
2
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
|
3
3
|
import { h, Host } from '@stencil/core';
|
|
4
4
|
import AgGridController from './controller/ag-grid/AgGridController';
|
|
@@ -6,6 +6,11 @@ import { SelectionCounter } from './subcomponents/selection-counter';
|
|
|
6
6
|
import { ApplicationUtils } from '../../utils';
|
|
7
7
|
import InMemoryFilterColumnDataSource from './utils/InMemoryFilterColumnDataSource';
|
|
8
8
|
const windowInstace = window;
|
|
9
|
+
const matches = (text, filter) => {
|
|
10
|
+
const normalizedText = StringUtils.replaceAccentuatedCharsLower(text.toLocaleLowerCase());
|
|
11
|
+
const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(filter.toLocaleLowerCase());
|
|
12
|
+
return normalizedText.includes(normalizedFilter);
|
|
13
|
+
};
|
|
9
14
|
export class EzGrid {
|
|
10
15
|
constructor() {
|
|
11
16
|
this._gridController = new AgGridController(false);
|
|
@@ -76,6 +81,18 @@ export class EzGrid {
|
|
|
76
81
|
async quickFilter(term) {
|
|
77
82
|
this._gridController.quickFilter(term);
|
|
78
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Localiza determinada coluna tornando-a visível.
|
|
86
|
+
*/
|
|
87
|
+
async locateColumn(columnName) {
|
|
88
|
+
this._gridController.locateColumn(columnName);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Usa um argumento para filtrar as colunas po label
|
|
92
|
+
*/
|
|
93
|
+
async filterColumns(search) {
|
|
94
|
+
return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
|
|
95
|
+
}
|
|
79
96
|
observeConfig(config) {
|
|
80
97
|
this._gridController.setColumnsState(config.columns);
|
|
81
98
|
}
|
|
@@ -814,6 +831,51 @@ export class EzGrid {
|
|
|
814
831
|
"text": "Aplica um filtro r\u00E1pido.",
|
|
815
832
|
"tags": []
|
|
816
833
|
}
|
|
834
|
+
},
|
|
835
|
+
"locateColumn": {
|
|
836
|
+
"complexType": {
|
|
837
|
+
"signature": "(columnName: string) => Promise<void>",
|
|
838
|
+
"parameters": [{
|
|
839
|
+
"tags": [],
|
|
840
|
+
"text": ""
|
|
841
|
+
}],
|
|
842
|
+
"references": {
|
|
843
|
+
"Promise": {
|
|
844
|
+
"location": "global"
|
|
845
|
+
}
|
|
846
|
+
},
|
|
847
|
+
"return": "Promise<void>"
|
|
848
|
+
},
|
|
849
|
+
"docs": {
|
|
850
|
+
"text": "Localiza determinada coluna tornando-a vis\u00EDvel.",
|
|
851
|
+
"tags": []
|
|
852
|
+
}
|
|
853
|
+
},
|
|
854
|
+
"filterColumns": {
|
|
855
|
+
"complexType": {
|
|
856
|
+
"signature": "(search: string) => Promise<Array<EzGridColumn>>",
|
|
857
|
+
"parameters": [{
|
|
858
|
+
"tags": [],
|
|
859
|
+
"text": ""
|
|
860
|
+
}],
|
|
861
|
+
"references": {
|
|
862
|
+
"Promise": {
|
|
863
|
+
"location": "global"
|
|
864
|
+
},
|
|
865
|
+
"EzGridColumn": {
|
|
866
|
+
"location": "import",
|
|
867
|
+
"path": "./controller/EzGridController"
|
|
868
|
+
},
|
|
869
|
+
"Array": {
|
|
870
|
+
"location": "global"
|
|
871
|
+
}
|
|
872
|
+
},
|
|
873
|
+
"return": "Promise<EzGridColumn[]>"
|
|
874
|
+
},
|
|
875
|
+
"docs": {
|
|
876
|
+
"text": "Usa um argumento para filtrar as colunas po label",
|
|
877
|
+
"tags": []
|
|
878
|
+
}
|
|
817
879
|
}
|
|
818
880
|
};
|
|
819
881
|
}
|
|
@@ -16,6 +16,7 @@ export class EzSearch {
|
|
|
16
16
|
this.hideErrorOnFocusOut = true;
|
|
17
17
|
this.listOptionsPosition = undefined;
|
|
18
18
|
this.isTextSearch = false;
|
|
19
|
+
this.ignoreLimitCharsToSearch = false;
|
|
19
20
|
}
|
|
20
21
|
observeErrorMessage() {
|
|
21
22
|
if (this._comboElement) {
|
|
@@ -73,7 +74,7 @@ export class EzSearch {
|
|
|
73
74
|
}
|
|
74
75
|
render() {
|
|
75
76
|
ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
76
|
-
return (h("ez-combo-box", { "data-element-id": ElementIDUtils.getInternalIDInfo("combo"), ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, hideErrorOnFocusOut: this.hideErrorOnFocusOut, optionLoader: this.optionLoader, searchMode: true, onEzChange: event => this.onComboChange(event), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue, suppressEmptyOption: this.suppressEmptyOption, mode: this.mode, canShowError: this.canShowError, listOptionsPosition: this.listOptionsPosition, isTextSearch: this.isTextSearch }));
|
|
77
|
+
return (h("ez-combo-box", { "data-element-id": ElementIDUtils.getInternalIDInfo("combo"), ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, hideErrorOnFocusOut: this.hideErrorOnFocusOut, optionLoader: this.optionLoader, searchMode: true, onEzChange: event => this.onComboChange(event), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue, suppressEmptyOption: this.suppressEmptyOption, mode: this.mode, canShowError: this.canShowError, listOptionsPosition: this.listOptionsPosition, isTextSearch: this.isTextSearch, limitCharsToSearch: this.ignoreLimitCharsToSearch ? 0 : 3 }));
|
|
77
78
|
}
|
|
78
79
|
;
|
|
79
80
|
static get is() { return "ez-search"; }
|
|
@@ -339,6 +340,24 @@ export class EzSearch {
|
|
|
339
340
|
"attribute": "is-text-search",
|
|
340
341
|
"reflect": false,
|
|
341
342
|
"defaultValue": "false"
|
|
343
|
+
},
|
|
344
|
+
"ignoreLimitCharsToSearch": {
|
|
345
|
+
"type": "boolean",
|
|
346
|
+
"mutable": false,
|
|
347
|
+
"complexType": {
|
|
348
|
+
"original": "boolean",
|
|
349
|
+
"resolved": "boolean",
|
|
350
|
+
"references": {}
|
|
351
|
+
},
|
|
352
|
+
"required": false,
|
|
353
|
+
"optional": false,
|
|
354
|
+
"docs": {
|
|
355
|
+
"tags": [],
|
|
356
|
+
"text": "Define se deve ignorar o limite de caracteres m\u00EDnimo para realizar uma pesquisa"
|
|
357
|
+
},
|
|
358
|
+
"attribute": "ignore-limit-chars-to-search",
|
|
359
|
+
"reflect": false,
|
|
360
|
+
"defaultValue": "false"
|
|
342
361
|
}
|
|
343
362
|
};
|
|
344
363
|
}
|
|
@@ -75,6 +75,16 @@ export default class DataBinder {
|
|
|
75
75
|
this.updateErrorMessage(field.name, fieldElement, field.message);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
+
setFocus(fieldName) {
|
|
79
|
+
if (!this._fields.has(fieldName)) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const fieldElement = this._fields.get(fieldName).field;
|
|
83
|
+
if (typeof fieldElement["setFocus"] != "function") {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
fieldElement["setFocus"]();
|
|
87
|
+
}
|
|
78
88
|
clearInvalid(recordId) {
|
|
79
89
|
this._dataUnit.clearInvalid(recordId);
|
|
80
90
|
this._fields.forEach(fieldBinder => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|