@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-52057.0 → 0.0.0-bugfix-dev-59880.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/ICustomRender-6fafffce.js +13 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -0
- package/dist/cjs/ez-alert-list.cjs.entry.js +6 -4
- package/dist/cjs/ez-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -0
- package/dist/cjs/{ez-text-edit.cjs.entry.js → ez-custom-form-input_2.cjs.entry.js} +86 -0
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -0
- package/dist/cjs/ez-form-view.cjs.entry.js +36 -4
- package/dist/cjs/ez-form.cjs.entry.js +51 -2
- package/dist/cjs/ez-grid.cjs.entry.js +322 -19
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +2 -2
- package/dist/cjs/ez-number-input.cjs.entry.js +9 -2
- package/dist/cjs/ez-search.cjs.entry.js +6 -2
- package/dist/cjs/ez-split-item.cjs.entry.js +2 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ez-alert-list/ez-alert-list.js +6 -4
- package/dist/collection/components/ez-button/ez-button.css +7 -0
- package/dist/collection/components/ez-button/ez-button.js +1 -1
- package/dist/collection/components/ez-date-input/ez-date-input.js +1 -0
- package/dist/collection/components/ez-form/ez-form.js +130 -4
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +245 -0
- package/dist/collection/components/ez-form-view/ez-form-view.js +92 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +3 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +62 -4
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +35 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +58 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.js +40 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.js +11 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.js +11 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +6 -3
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellRender.js +40 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellRender.js +1 -0
- package/dist/collection/components/ez-grid/ez-grid.js +206 -2
- package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js +1 -0
- package/dist/collection/components/ez-grid/interfaces/index.js +1 -0
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +3 -11
- package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js +22 -0
- package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js +19 -0
- package/dist/collection/components/ez-list/ez-list.css +6 -2
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
- package/dist/collection/components/ez-number-input/ez-number-input.js +12 -1
- package/dist/collection/components/ez-search/ez-search.js +5 -2
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +1 -1
- package/dist/collection/utils/customEditor/interfaces/ICustomEditor.js +5 -0
- package/dist/collection/utils/customEditor/interfaces/ICustomEditorInfo.js +1 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRender.js +5 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRenderInfo.js +1 -0
- package/dist/collection/utils/index.js +2 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +539 -44
- package/dist/esm/ICustomRender-875b5a40.js +13 -0
- package/dist/esm/ez-actions-button.entry.js +1 -0
- package/dist/esm/ez-alert-list.entry.js +6 -4
- package/dist/esm/ez-button.entry.js +2 -2
- package/dist/esm/ez-collapsible-box.entry.js +1 -0
- package/dist/esm/ez-combo-box.entry.js +1 -0
- package/dist/esm/{ez-text-edit.entry.js → ez-custom-form-input_2.entry.js} +88 -3
- package/dist/esm/ez-date-input.entry.js +1 -0
- package/dist/esm/ez-form-view.entry.js +36 -4
- package/dist/esm/ez-form.entry.js +51 -2
- package/dist/esm/ez-grid.entry.js +322 -19
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +2 -2
- package/dist/esm/ez-number-input.entry.js +9 -2
- package/dist/esm/ez-search.entry.js +6 -2
- package/dist/esm/ez-split-item.entry.js +2 -1
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/index-baa5e267.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-09de35a2.entry.js +1 -0
- package/dist/ezui/p-13d2fe2d.entry.js +1 -0
- package/dist/ezui/{p-384247cd.entry.js → p-1f96ba9a.entry.js} +2 -2
- package/dist/ezui/p-204b1439.entry.js +1 -0
- package/dist/ezui/p-2b8da3a4.entry.js +1 -0
- package/dist/ezui/p-30775e7f.entry.js +1 -0
- package/dist/ezui/p-4607fb89.js +1 -0
- package/dist/ezui/{p-2a1a0e04.entry.js → p-77362d3a.entry.js} +1 -1
- package/dist/ezui/{p-8defa6d3.entry.js → p-786559c5.entry.js} +1 -1
- package/dist/ezui/p-7922142b.entry.js +1 -0
- package/dist/ezui/p-84e439b9.entry.js +1 -0
- package/dist/ezui/p-922ac38b.entry.js +1 -0
- package/dist/ezui/p-bae4e180.entry.js +1 -0
- package/dist/ezui/p-bcb53f27.entry.js +1 -0
- package/dist/ezui/p-c942e4a7.entry.js +1 -0
- package/dist/ezui/p-e90dd4eb.entry.js +1 -0
- package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +2 -2
- package/dist/types/components/ez-form/ez-form.d.ts +20 -1
- package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +41 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +29 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +19 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +14 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +3 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +15 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellRender.d.ts +10 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +30 -1
- package/dist/types/components/ez-grid/interfaces/ICustomFormatter.d.ts +5 -0
- package/dist/types/components/ez-grid/interfaces/index.d.ts +1 -0
- package/dist/types/components/ez-grid/subcomponents/utils/selectionCounterUtils.d.ts +4 -0
- package/dist/types/components/ez-grid/test/resources/gridDataUnit.d.ts +2 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +1 -0
- package/dist/types/components.d.ts +120 -4
- package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +29 -0
- package/dist/types/utils/customEditor/interfaces/ICustomEditorInfo.d.ts +5 -0
- package/dist/types/utils/customRender/interfaces/ICustomRender.d.ts +29 -0
- package/dist/types/utils/customRender/interfaces/ICustomRenderInfo.d.ts +5 -0
- package/dist/types/utils/index.d.ts +2 -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-0447d17c.entry.js +0 -1
- package/dist/ezui/p-20ec22c0.entry.js +0 -1
- package/dist/ezui/p-44c5b6a5.entry.js +0 -1
- package/dist/ezui/p-5ef056ce.entry.js +0 -1
- package/dist/ezui/p-86ff298d.entry.js +0 -1
- package/dist/ezui/p-99ead599.entry.js +0 -1
- package/dist/ezui/p-9aefaa52.entry.js +0 -1
- package/dist/ezui/p-9f1e89c9.entry.js +0 -1
- package/dist/ezui/p-b041333c.entry.js +0 -1
- package/dist/ezui/p-b567fa8c.entry.js +0 -1
- package/dist/ezui/p-bae3d0aa.entry.js +0 -1
- package/dist/ezui/p-db77a984.entry.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DataType, UserInterface } from "@sankhyalabs/core";
|
|
2
|
+
export const metadata = {
|
|
3
|
+
name: 'metadatada',
|
|
4
|
+
label: 'metadatada',
|
|
5
|
+
fields: [{
|
|
6
|
+
name: 'FIELDNAME',
|
|
7
|
+
label: 'Test',
|
|
8
|
+
dataType: DataType.TEXT,
|
|
9
|
+
userInterface: UserInterface.SHORTTEXT,
|
|
10
|
+
}],
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DataType, UserInterface } from "@sankhyalabs/core";
|
|
2
|
+
export const metadata = {
|
|
3
|
+
name: 'metadatada',
|
|
4
|
+
label: 'metadatada',
|
|
5
|
+
fields: [{
|
|
6
|
+
name: 'FIELDNAME',
|
|
7
|
+
label: 'Test',
|
|
8
|
+
dataType: DataType.TEXT,
|
|
9
|
+
userInterface: UserInterface.SHORTTEXT,
|
|
10
|
+
}],
|
|
11
|
+
};
|
|
@@ -20,9 +20,9 @@ export default class EzCellEditor {
|
|
|
20
20
|
init(params) {
|
|
21
21
|
const fieldName = params.column.getColId();
|
|
22
22
|
const dataUnit = params.context.dataUnit;
|
|
23
|
-
|
|
24
|
-
const builder = uiBuilders.get(
|
|
25
|
-
this._gui = builder(
|
|
23
|
+
this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
|
|
24
|
+
const builder = uiBuilders.get(this._fieldMetadata.userInterface) || buildTextInput;
|
|
25
|
+
this._gui = builder(this._fieldMetadata);
|
|
26
26
|
if (this._gui.valueSetter != undefined) {
|
|
27
27
|
this._gui.valueSetter(params.value);
|
|
28
28
|
}
|
|
@@ -46,4 +46,7 @@ export default class EzCellEditor {
|
|
|
46
46
|
isPopup() {
|
|
47
47
|
return this._gui.isPopUp;
|
|
48
48
|
}
|
|
49
|
+
getFieldMetadata() {
|
|
50
|
+
return this._fieldMetadata;
|
|
51
|
+
}
|
|
49
52
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { buildEditorMetadata } from "./IEditorMetadata";
|
|
2
|
+
export default class EzCellRender {
|
|
3
|
+
init(params) {
|
|
4
|
+
const span = document.createElement('span');
|
|
5
|
+
this._currentParams = params;
|
|
6
|
+
span.textContent = params.value;
|
|
7
|
+
const fieldName = params.column.getColId();
|
|
8
|
+
const dataUnit = params.context.dataUnit;
|
|
9
|
+
this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
|
|
10
|
+
this._gui = span;
|
|
11
|
+
}
|
|
12
|
+
refresh() {
|
|
13
|
+
try {
|
|
14
|
+
this._currentParams.refreshCell();
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
catch (_a) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
getGui() {
|
|
22
|
+
return this._gui;
|
|
23
|
+
}
|
|
24
|
+
afterGuiAttached() {
|
|
25
|
+
this.focusIn();
|
|
26
|
+
}
|
|
27
|
+
focusIn() {
|
|
28
|
+
this._gui.focus();
|
|
29
|
+
this._gui.setFocus({ selectText: true });
|
|
30
|
+
}
|
|
31
|
+
getValue() {
|
|
32
|
+
return this._currentParams.getValue();
|
|
33
|
+
}
|
|
34
|
+
isPopup() {
|
|
35
|
+
return this._gui.isPopUp;
|
|
36
|
+
}
|
|
37
|
+
getFieldMetadata() {
|
|
38
|
+
return this._fieldMetadata;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -15,6 +15,8 @@ export class EzGrid {
|
|
|
15
15
|
constructor() {
|
|
16
16
|
this._gridController = new AgGridController(false);
|
|
17
17
|
this._messageFilterAppliedSuccess = 'Filtro de coluna aplicado com sucesso!';
|
|
18
|
+
this._customEditor = new Map();
|
|
19
|
+
this._customRenders = new Map();
|
|
18
20
|
this._paginationInfo = undefined;
|
|
19
21
|
this._paginationChangedByKeyboard = true;
|
|
20
22
|
this._showSelectionCounter = false;
|
|
@@ -22,6 +24,7 @@ export class EzGrid {
|
|
|
22
24
|
this._currentPageSelected = undefined;
|
|
23
25
|
this._selectionCount = undefined;
|
|
24
26
|
this._hasLeftButtons = false;
|
|
27
|
+
this._customFormatters = new Map();
|
|
25
28
|
this.multipleSelection = undefined;
|
|
26
29
|
this.config = undefined;
|
|
27
30
|
this.selectionToastConfig = undefined;
|
|
@@ -93,6 +96,63 @@ export class EzGrid {
|
|
|
93
96
|
async filterColumns(search) {
|
|
94
97
|
return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
|
|
95
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Registra um editor customizado para campos da grade e formulário.
|
|
101
|
+
*/
|
|
102
|
+
async addCustomEditor(fieldName, customEditor, detailContext) {
|
|
103
|
+
const newCustomEditor = new Map(this._customEditor);
|
|
104
|
+
newCustomEditor.set(fieldName, {
|
|
105
|
+
customEditor,
|
|
106
|
+
detailContext,
|
|
107
|
+
});
|
|
108
|
+
this._customEditor = newCustomEditor;
|
|
109
|
+
this._gridController.setCellEditors(newCustomEditor);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Registra um render customizado para colunas da grid.
|
|
113
|
+
*/
|
|
114
|
+
async addGridCustomRender(fieldName, customRender, detailContext) {
|
|
115
|
+
const newCustomRenders = new Map(this._customRenders);
|
|
116
|
+
newCustomRenders.set(fieldName, { customRender, detailContext });
|
|
117
|
+
this._customRenders = newCustomRenders;
|
|
118
|
+
this._gridController.setCellRenders(newCustomRenders);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Registra um formatador de valores para uma coluna da grid.
|
|
122
|
+
*/
|
|
123
|
+
async addCustomValueFormatter(columnName, customFormatter) {
|
|
124
|
+
if (!columnName || !customFormatter) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const newCustomFormatters = new Map(this._customFormatters);
|
|
128
|
+
newCustomFormatters.set(columnName, customFormatter);
|
|
129
|
+
this._customFormatters = newCustomFormatters;
|
|
130
|
+
this._gridController.setCustomFormatters(newCustomFormatters);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Remove o formatador de valores de uma coluna da grid.
|
|
134
|
+
*/
|
|
135
|
+
async removeCustomValueFormatter(columnName) {
|
|
136
|
+
if (!columnName) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const newCustomFormatters = new Map(this._customFormatters);
|
|
140
|
+
newCustomFormatters.delete(columnName);
|
|
141
|
+
this._customFormatters = newCustomFormatters;
|
|
142
|
+
this._gridController.setCustomFormatters(newCustomFormatters);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Atualiza linhas da grade.
|
|
146
|
+
*/
|
|
147
|
+
async refreshSelectedRows() {
|
|
148
|
+
this._gridController.refreshSelectedRows();
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Retorna o formatador customizado da coluna caso exista.
|
|
152
|
+
*/
|
|
153
|
+
async getCustomValueFormatter(columnName) {
|
|
154
|
+
return this._customFormatters.get(columnName);
|
|
155
|
+
}
|
|
96
156
|
observeConfig(config) {
|
|
97
157
|
this._gridController.setColumnsState(config === null || config === void 0 ? void 0 : config.columns);
|
|
98
158
|
}
|
|
@@ -294,7 +354,8 @@ export class EzGrid {
|
|
|
294
354
|
statusResolver: this.statusResolver,
|
|
295
355
|
useEnterLikeTab: this.useEnterLikeTab,
|
|
296
356
|
recordsValidator: this.recordsValidator,
|
|
297
|
-
editionIsDisabled: () => !this.canEdit
|
|
357
|
+
editionIsDisabled: () => !this.canEdit,
|
|
358
|
+
customFormatters: this._customFormatters
|
|
298
359
|
});
|
|
299
360
|
if (this.config) {
|
|
300
361
|
this.observeConfig(this.config);
|
|
@@ -612,7 +673,8 @@ export class EzGrid {
|
|
|
612
673
|
"_isAllSelection": {},
|
|
613
674
|
"_currentPageSelected": {},
|
|
614
675
|
"_selectionCount": {},
|
|
615
|
-
"_hasLeftButtons": {}
|
|
676
|
+
"_hasLeftButtons": {},
|
|
677
|
+
"_customFormatters": {}
|
|
616
678
|
};
|
|
617
679
|
}
|
|
618
680
|
static get events() {
|
|
@@ -946,6 +1008,148 @@ export class EzGrid {
|
|
|
946
1008
|
"text": "Usa um argumento para filtrar as colunas po label",
|
|
947
1009
|
"tags": []
|
|
948
1010
|
}
|
|
1011
|
+
},
|
|
1012
|
+
"addCustomEditor": {
|
|
1013
|
+
"complexType": {
|
|
1014
|
+
"signature": "(fieldName: string, customEditor: ICustomEditor, detailContext?: string) => Promise<void>",
|
|
1015
|
+
"parameters": [{
|
|
1016
|
+
"tags": [],
|
|
1017
|
+
"text": ""
|
|
1018
|
+
}, {
|
|
1019
|
+
"tags": [],
|
|
1020
|
+
"text": ""
|
|
1021
|
+
}, {
|
|
1022
|
+
"tags": [],
|
|
1023
|
+
"text": ""
|
|
1024
|
+
}],
|
|
1025
|
+
"references": {
|
|
1026
|
+
"Promise": {
|
|
1027
|
+
"location": "global"
|
|
1028
|
+
},
|
|
1029
|
+
"ICustomEditor": {
|
|
1030
|
+
"location": "import",
|
|
1031
|
+
"path": "../../utils/customEditor/interfaces/ICustomEditor"
|
|
1032
|
+
}
|
|
1033
|
+
},
|
|
1034
|
+
"return": "Promise<void>"
|
|
1035
|
+
},
|
|
1036
|
+
"docs": {
|
|
1037
|
+
"text": "Registra um editor customizado para campos da grade e formul\u00E1rio.",
|
|
1038
|
+
"tags": []
|
|
1039
|
+
}
|
|
1040
|
+
},
|
|
1041
|
+
"addGridCustomRender": {
|
|
1042
|
+
"complexType": {
|
|
1043
|
+
"signature": "(fieldName: string, customRender: ICustomRender, detailContext?: string) => Promise<void>",
|
|
1044
|
+
"parameters": [{
|
|
1045
|
+
"tags": [],
|
|
1046
|
+
"text": ""
|
|
1047
|
+
}, {
|
|
1048
|
+
"tags": [],
|
|
1049
|
+
"text": ""
|
|
1050
|
+
}, {
|
|
1051
|
+
"tags": [],
|
|
1052
|
+
"text": ""
|
|
1053
|
+
}],
|
|
1054
|
+
"references": {
|
|
1055
|
+
"Promise": {
|
|
1056
|
+
"location": "global"
|
|
1057
|
+
},
|
|
1058
|
+
"ICustomRender": {
|
|
1059
|
+
"location": "import",
|
|
1060
|
+
"path": "../../utils/customRender/interfaces/ICustomRender"
|
|
1061
|
+
}
|
|
1062
|
+
},
|
|
1063
|
+
"return": "Promise<void>"
|
|
1064
|
+
},
|
|
1065
|
+
"docs": {
|
|
1066
|
+
"text": "Registra um render customizado para colunas da grid.",
|
|
1067
|
+
"tags": []
|
|
1068
|
+
}
|
|
1069
|
+
},
|
|
1070
|
+
"addCustomValueFormatter": {
|
|
1071
|
+
"complexType": {
|
|
1072
|
+
"signature": "(columnName: string, customFormatter: ICustomFormatter) => Promise<void>",
|
|
1073
|
+
"parameters": [{
|
|
1074
|
+
"tags": [],
|
|
1075
|
+
"text": ""
|
|
1076
|
+
}, {
|
|
1077
|
+
"tags": [],
|
|
1078
|
+
"text": ""
|
|
1079
|
+
}],
|
|
1080
|
+
"references": {
|
|
1081
|
+
"Promise": {
|
|
1082
|
+
"location": "global"
|
|
1083
|
+
},
|
|
1084
|
+
"ICustomFormatter": {
|
|
1085
|
+
"location": "import",
|
|
1086
|
+
"path": "./interfaces"
|
|
1087
|
+
}
|
|
1088
|
+
},
|
|
1089
|
+
"return": "Promise<void>"
|
|
1090
|
+
},
|
|
1091
|
+
"docs": {
|
|
1092
|
+
"text": "Registra um formatador de valores para uma coluna da grid.",
|
|
1093
|
+
"tags": []
|
|
1094
|
+
}
|
|
1095
|
+
},
|
|
1096
|
+
"removeCustomValueFormatter": {
|
|
1097
|
+
"complexType": {
|
|
1098
|
+
"signature": "(columnName: string) => Promise<void>",
|
|
1099
|
+
"parameters": [{
|
|
1100
|
+
"tags": [],
|
|
1101
|
+
"text": ""
|
|
1102
|
+
}],
|
|
1103
|
+
"references": {
|
|
1104
|
+
"Promise": {
|
|
1105
|
+
"location": "global"
|
|
1106
|
+
}
|
|
1107
|
+
},
|
|
1108
|
+
"return": "Promise<void>"
|
|
1109
|
+
},
|
|
1110
|
+
"docs": {
|
|
1111
|
+
"text": "Remove o formatador de valores de uma coluna da grid.",
|
|
1112
|
+
"tags": []
|
|
1113
|
+
}
|
|
1114
|
+
},
|
|
1115
|
+
"refreshSelectedRows": {
|
|
1116
|
+
"complexType": {
|
|
1117
|
+
"signature": "() => Promise<void>",
|
|
1118
|
+
"parameters": [],
|
|
1119
|
+
"references": {
|
|
1120
|
+
"Promise": {
|
|
1121
|
+
"location": "global"
|
|
1122
|
+
}
|
|
1123
|
+
},
|
|
1124
|
+
"return": "Promise<void>"
|
|
1125
|
+
},
|
|
1126
|
+
"docs": {
|
|
1127
|
+
"text": "Atualiza linhas da grade.",
|
|
1128
|
+
"tags": []
|
|
1129
|
+
}
|
|
1130
|
+
},
|
|
1131
|
+
"getCustomValueFormatter": {
|
|
1132
|
+
"complexType": {
|
|
1133
|
+
"signature": "(columnName: string) => Promise<ICustomFormatter | undefined>",
|
|
1134
|
+
"parameters": [{
|
|
1135
|
+
"tags": [],
|
|
1136
|
+
"text": ""
|
|
1137
|
+
}],
|
|
1138
|
+
"references": {
|
|
1139
|
+
"Promise": {
|
|
1140
|
+
"location": "global"
|
|
1141
|
+
},
|
|
1142
|
+
"ICustomFormatter": {
|
|
1143
|
+
"location": "import",
|
|
1144
|
+
"path": "./interfaces"
|
|
1145
|
+
}
|
|
1146
|
+
},
|
|
1147
|
+
"return": "Promise<ICustomFormatter>"
|
|
1148
|
+
},
|
|
1149
|
+
"docs": {
|
|
1150
|
+
"text": "Retorna o formatador customizado da coluna caso exista.",
|
|
1151
|
+
"tags": []
|
|
1152
|
+
}
|
|
949
1153
|
}
|
|
950
1154
|
};
|
|
951
1155
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ElementIDUtils } from "@sankhyalabs/core";
|
|
2
2
|
import { h } from "@stencil/core";
|
|
3
|
+
import { buildSelectAllLabel, buildSelectAllTitle, enableSelectAll, getText } from './utils/selectionCounterUtils';
|
|
3
4
|
export const SelectionCounter = (props) => {
|
|
4
5
|
const { selectionCount, currentPageSelected, allRecordSelected, paginationInfo, canSelectAll, onSelectAll, onSelectPage, onClearAll, onClose } = props;
|
|
5
|
-
const { total, hasMore } = paginationInfo || {};
|
|
6
|
+
const { total, hasMore, count } = paginationInfo || {};
|
|
6
7
|
const shouldRenderSelectionButton = () => {
|
|
7
8
|
if ((!allRecordSelected && selectionCount === total) || (allRecordSelected && !hasMore))
|
|
8
9
|
return false;
|
|
@@ -11,17 +12,8 @@ export const SelectionCounter = (props) => {
|
|
|
11
12
|
return !!paginationInfo && (currentPageSelected || allRecordSelected);
|
|
12
13
|
};
|
|
13
14
|
return (h("div", Object.assign({ class: "ez-box ez-box--shadow-small" }, getElementID("ezGridSelectionCounter")), h("div", { class: "ez-flex ez-flex--align-items-center ez-size-width--full ez-padding-horizontal--medium" }, h("div", { class: "ez-flex ez-flex--wrap ez-flex--align-items-baseline ez-flex--justify-center" }, h("label", Object.assign({ innerHTML: getText(selectionCount, allRecordSelected), class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium ez-margin-top--medium" }, getElementID("ezGridSelectionCounter_label"))), h("div", { class: "ez-flex ez-margin-right--medium" }, shouldRenderSelectionButton() &&
|
|
14
|
-
h("ez-button", Object.assign({ class: "ez-margin-right--medium", label:
|
|
15
|
+
h("ez-button", Object.assign({ title: buildSelectAllTitle(total), enabled: enableSelectAll(total), class: "ez-margin-right--medium", label: buildSelectAllLabel(allRecordSelected, count, total), mode: "link", onClick: allRecordSelected ? onSelectPage : onSelectAll }, getElementID(`ezGridSelectionCounter_select${allRecordSelected ? "Page" : "All"}`))), h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar Sele\u00E7\u00E3o", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))), h("button", Object.assign({ class: "grid__btn-close", title: "Fechar", onClick: onClose }, getElementID("ezGridSelectionCounter_close")), h("ez-icon", { iconName: "close" })))));
|
|
15
16
|
};
|
|
16
|
-
function getText(selectionCount, allSelectedRecords) {
|
|
17
|
-
if (allSelectedRecords) {
|
|
18
|
-
return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
const pluralChar = selectionCount > 1 ? "s" : "";
|
|
22
|
-
return `Há <strong>${selectionCount} registro${pluralChar}</strong> selecionado${pluralChar}.`;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
17
|
function getElementID(sufix) {
|
|
26
18
|
return {
|
|
27
19
|
[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function enableSelectAll(total) {
|
|
2
|
+
return total !== undefined;
|
|
3
|
+
}
|
|
4
|
+
export function buildSelectAllLabel(allRecordSelected, count, total) {
|
|
5
|
+
if (allRecordSelected)
|
|
6
|
+
return 'Selecionar apenas a página atual';
|
|
7
|
+
if (total === undefined)
|
|
8
|
+
return `Carregando todos os ${count} registros`;
|
|
9
|
+
return `Selecionar todos os ${total} registros`;
|
|
10
|
+
}
|
|
11
|
+
export function buildSelectAllTitle(total) {
|
|
12
|
+
if (enableSelectAll(total))
|
|
13
|
+
return '';
|
|
14
|
+
return 'Aguarde o carregamento para selecionar o registro de todas as páginas';
|
|
15
|
+
}
|
|
16
|
+
export function getText(selectionCount, allSelectedRecords) {
|
|
17
|
+
if (allSelectedRecords) {
|
|
18
|
+
return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
|
|
19
|
+
}
|
|
20
|
+
const pluralCharacter = selectionCount > 1 ? "s" : "";
|
|
21
|
+
return `Há <strong>${selectionCount} registro${pluralCharacter}</strong> selecionado${pluralCharacter} na grade.`;
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DataType, DataUnit, StringUtils } from "@sankhyalabs/core";
|
|
2
|
+
export function getDataUnit() {
|
|
3
|
+
const dataUnit = new DataUnit('EzGridDU');
|
|
4
|
+
dataUnit.pageSize = 3;
|
|
5
|
+
dataUnit.metadata = {
|
|
6
|
+
name: "exemplo.datagrid",
|
|
7
|
+
label: "Exemplo data grid",
|
|
8
|
+
fields: [
|
|
9
|
+
{ name: "PRODUTO", label: "Produto", dataType: DataType.TEXT },
|
|
10
|
+
{ name: "QUANTIDADE", label: "Quantidade", dataType: DataType.NUMBER }
|
|
11
|
+
]
|
|
12
|
+
};
|
|
13
|
+
dataUnit.records = [
|
|
14
|
+
{ __record__id__: StringUtils.generateUUID(), "PRODUTO": "Mamão", "QUANTIDADE": 1 },
|
|
15
|
+
{ __record__id__: StringUtils.generateUUID(), "PRODUTO": "Mexerica", "QUANTIDADE": 2 }
|
|
16
|
+
];
|
|
17
|
+
dataUnit.selectFirst();
|
|
18
|
+
return dataUnit;
|
|
19
|
+
}
|
|
@@ -168,14 +168,18 @@ p {
|
|
|
168
168
|
display: flex;
|
|
169
169
|
|
|
170
170
|
/*public*/
|
|
171
|
-
padding: var(--space--2xs, 8px) var(--space--3xs, 4px);
|
|
172
|
-
margin: var(--ez-list__item--margin);
|
|
173
171
|
font-family: var(--ez-list__item--font-family);
|
|
174
172
|
font-size: var(--ez-list__item--font-size);
|
|
175
173
|
color: var(--ez-list__item--color);
|
|
176
174
|
border-bottom: var(--ez-list__item--border-bottom, none) var(--ez-list__item--border-bottom-color);
|
|
177
175
|
}
|
|
178
176
|
|
|
177
|
+
.draggable-list li > div {
|
|
178
|
+
/*public*/
|
|
179
|
+
padding: var(--space--2xs, 8px) var(--space--3xs, 4px);
|
|
180
|
+
margin: var(--ez-list__item--margin);
|
|
181
|
+
}
|
|
182
|
+
|
|
179
183
|
.over {
|
|
180
184
|
/*public*/
|
|
181
185
|
border-top: 1px dashed var(--ez-list__over--border--color);
|
|
@@ -47,7 +47,7 @@ export class EzModalContainer {
|
|
|
47
47
|
this._closeButton.focus();
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
|
-
return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1 }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--large" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" }))))), h("div", { class: "ez-modal-container__content" }, h("slot", null)), h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
50
|
+
return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--large" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" }))))), h("div", { class: "ez-modal-container__content" }, h("slot", null)), h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
51
51
|
}
|
|
52
52
|
static get is() { return "ez-modal-container"; }
|
|
53
53
|
static get encapsulation() { return "scoped"; }
|
|
@@ -82,12 +82,17 @@ export class EzNumberInput {
|
|
|
82
82
|
}
|
|
83
83
|
this._changePending = false;
|
|
84
84
|
}
|
|
85
|
+
observePrecision() {
|
|
86
|
+
if (this._textInput) {
|
|
87
|
+
this.setInputValue();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
85
90
|
validateValue(value) {
|
|
86
91
|
return isNaN(value) || value === undefined ? null : value;
|
|
87
92
|
}
|
|
88
93
|
getTextValue(value) {
|
|
89
94
|
if (value != undefined) {
|
|
90
|
-
return this.precision
|
|
95
|
+
return this.precision >= 0 ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
|
|
91
96
|
}
|
|
92
97
|
return undefined;
|
|
93
98
|
}
|
|
@@ -455,6 +460,12 @@ export class EzNumberInput {
|
|
|
455
460
|
}, {
|
|
456
461
|
"propName": "value",
|
|
457
462
|
"methodName": "observeValue"
|
|
463
|
+
}, {
|
|
464
|
+
"propName": "precision",
|
|
465
|
+
"methodName": "observePrecision"
|
|
466
|
+
}, {
|
|
467
|
+
"propName": "prettyPrecision",
|
|
468
|
+
"methodName": "observePrecision"
|
|
458
469
|
}];
|
|
459
470
|
}
|
|
460
471
|
}
|
|
@@ -308,9 +308,12 @@ export class EzSearch {
|
|
|
308
308
|
}
|
|
309
309
|
scrollToOption(opt) {
|
|
310
310
|
window.requestAnimationFrame(() => {
|
|
311
|
-
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
312
|
-
|
|
311
|
+
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
312
|
+
? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
|
|
313
|
+
: undefined;
|
|
314
|
+
if (liElem) {
|
|
313
315
|
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
316
|
+
}
|
|
314
317
|
});
|
|
315
318
|
}
|
|
316
319
|
selectCurrentOption() {
|
|
@@ -17,7 +17,7 @@ export class SplitItem {
|
|
|
17
17
|
CSSVarsUtils.applyVarsGrid(this._element, this._slot.children[0]);
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
|
-
return (h(Host, { class: `box_split-item ${this._expanded ? 'expanded__item' : ''}`, ref: el => (this._element = el) }, h("div", { class: "ez-split-item--header" }, h("slot", { name: "leftButtons" }), h("div", { class: "ez-split-item--header-title" }, this.label && (h("h3", { class: "ez-text ez-text--primary ez-title ez-title--small ez-margin--small", title: this.label }, this.label))), h("div", { class: "ez-split-item--header-buttons" }, this.enableExpand && (h("ez-button", { size: "small", mode: "icon", iconName: "expand", class: 'ez-button--tertiary', onClick: () => this.toggleExpandItem(), title: this._expanded ? 'Resumir' : 'Expandir' }))
|
|
20
|
+
return (h(Host, { class: `box_split-item ${this._expanded ? 'expanded__item' : ''}`, ref: el => (this._element = el) }, h("div", { class: "ez-split-item--header" }, h("slot", { name: "leftButtons" }), h("div", { class: "ez-split-item--header-title" }, this.label && (h("h3", { class: "ez-text ez-text--primary ez-title ez-title--small ez-margin--small", title: this.label }, this.label))), h("div", { class: "ez-split-item--header-buttons" }, h("slot", { name: "rightButtons" }), this.enableExpand && (h("ez-button", { size: "small", mode: "icon", iconName: "expand", class: 'ez-button--tertiary', onClick: () => this.toggleExpandItem(), title: this._expanded ? 'Resumir' : 'Expandir' })))), h("div", { class: "ez-split-item--content grid_height-0", ref: el => (this._slot = el) }, h("slot", null))));
|
|
21
21
|
}
|
|
22
22
|
static get is() { return "ez-split-item"; }
|
|
23
23
|
static get originalStyleUrls() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,3 +4,5 @@ export { DialogType } from '../components/ez-dialog/DialogType';
|
|
|
4
4
|
export { CheckMode } from '../components/ez-check/CheckMode';
|
|
5
5
|
export { FormMetadata } from './form/FormMetadata';
|
|
6
6
|
export { default as DataBinder } from './form/DataBinder';
|
|
7
|
+
export { CustomEditorSource } from './customEditor/interfaces/ICustomEditor';
|
|
8
|
+
export { CustomRenderSource } from './customRender/interfaces/ICustomRender';
|
|
@@ -80,6 +80,12 @@ export const EzComboBox: {
|
|
|
80
80
|
new (): EzComboBox;
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
interface EzCustomFormInput extends Components.EzCustomFormInput, HTMLElement {}
|
|
84
|
+
export const EzCustomFormInput: {
|
|
85
|
+
prototype: EzCustomFormInput;
|
|
86
|
+
new (): EzCustomFormInput;
|
|
87
|
+
};
|
|
88
|
+
|
|
83
89
|
interface EzDateInput extends Components.EzDateInput, HTMLElement {}
|
|
84
90
|
export const EzDateInput: {
|
|
85
91
|
prototype: EzDateInput;
|