@sankhyalabs/ezui 1.1.75 → 1.1.78
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/ApplicationUtils-d1c1db56.js +35 -0
- package/dist/cjs/AssetsUtils-dd585fba.js +24 -0
- package/dist/cjs/CSSVarsUtils-66e86394.js +18 -0
- package/dist/cjs/DataUnit-fdd7c70e.js +474 -0
- package/dist/cjs/DateUtils-716769e0.js +46 -0
- package/dist/cjs/ez-action-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +26 -0
- package/dist/cjs/ez-button_11.cjs.entry.js +111771 -0
- package/dist/cjs/ez-calendar.cjs.entry.js +217 -0
- package/dist/cjs/ez-collapsible-box_6.cjs.entry.js +634 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +254 -0
- package/dist/cjs/ez-date-time-input.cjs.entry.js +133 -0
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +1838 -0
- package/dist/cjs/ez-label-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +36 -212
- package/dist/cjs/ez-popover.cjs.entry.js +3 -3
- package/dist/cjs/ez-popup.cjs.entry.js +2 -2
- package/dist/cjs/ez-time-input.cjs.entry.js +10 -9
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +3 -3
- package/dist/cjs/form-metadata.cjs.entry.js +129 -0
- package/dist/cjs/index-40ebb2be.js +7422 -0
- package/dist/cjs/{index-4d2896bb.js → index-4e4bae01.js} +3 -5
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +8 -3
- package/dist/collection/components/ez-application/ez-application.css +3 -0
- package/dist/collection/components/ez-application/ez-application.js +35 -0
- package/dist/collection/components/ez-button/ez-button.css +78 -44
- package/dist/collection/components/ez-button/ez-button.js +36 -4
- package/dist/collection/components/ez-calendar/ez-calendar.css +70 -3
- package/dist/collection/components/ez-calendar/ez-calendar.js +173 -24
- package/dist/collection/components/ez-check/ez-check.css +78 -78
- package/dist/collection/components/ez-check/ez-check.js +3 -3
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +34 -34
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +12 -12
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +65 -54
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +5 -0
- package/dist/collection/components/ez-date-input/ez-date-input.css +17 -3
- package/dist/collection/components/ez-date-input/ez-date-input.js +3 -3
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.css +44 -0
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +243 -0
- package/dist/collection/components/ez-form/ez-form.js +37 -35
- package/dist/collection/components/ez-form/store/Form.actions.js +16 -16
- package/dist/collection/components/ez-form/store/Form.reducer.js +17 -17
- package/dist/collection/components/ez-form/subcomponents/DataUnit.js +11 -11
- package/dist/collection/components/ez-form/subcomponents/form-metadata.js +12 -12
- package/dist/collection/components/ez-form/subcomponents/place-holder.js +1 -1
- package/dist/collection/components/ez-form/subcomponents/structure/Field.js +21 -21
- package/dist/collection/components/ez-form/subcomponents/structure/FormSheet.js +1 -1
- package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +9 -9
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +21 -0
- package/dist/collection/components/ez-grid/controller/EzGridController.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +203 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +41 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/i18n/pt-BR.js +75 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/mock/Server.js +69 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/template/HeaderColumnTemplate.js +12 -0
- package/dist/collection/components/ez-grid/ez-grid.css +15 -0
- package/dist/collection/components/ez-grid/ez-grid.js +414 -0
- package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +105 -0
- package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +354 -0
- package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +7 -0
- package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.js +66 -0
- package/dist/collection/components/ez-icon/ez-icon.css +1 -1
- package/dist/collection/components/ez-list/ez-list.css +227 -44
- package/dist/collection/components/ez-list/ez-list.js +529 -149
- package/dist/collection/components/ez-modal/ez-modal.css +4 -4
- package/dist/collection/components/ez-modal/ez-modal.js +1 -1
- package/dist/collection/components/ez-number-input/ez-number-input.css +1 -165
- package/dist/collection/components/ez-number-input/ez-number-input.js +53 -339
- package/dist/collection/components/ez-popover/ez-popover.css +10 -6
- package/dist/collection/components/ez-popup/ez-popup.css +25 -27
- package/dist/collection/components/ez-search/ez-search.js +6 -1
- package/dist/collection/components/ez-tabselector/ez-tabselector.css +0 -1
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +3 -3
- package/dist/collection/components/ez-text-area/ez-text-area.js +1 -0
- package/dist/collection/components/ez-text-input/ez-text-input.css +60 -60
- package/dist/collection/components/ez-text-input/ez-text-input.js +17 -16
- package/dist/collection/components/ez-time-input/ez-time-input.js +3 -2
- package/dist/collection/components/ez-upload/ez-upload.js +3 -3
- package/dist/collection/components/test-du/test-du.css +3 -0
- package/dist/collection/components/test-du/test-du.js +45 -0
- package/dist/collection/servidor.js +94 -94
- package/dist/collection/utils/{Application.js → ApplicationUtils.js} +4 -4
- package/dist/collection/utils/AssetsUtils.js +19 -0
- package/dist/collection/utils/CSSVarsUtils.js +6 -6
- package/dist/custom-elements/index.d.ts +36 -6
- package/dist/custom-elements/index.js +120886 -2964
- package/dist/esm/ApplicationUtils-01280a9d.js +33 -0
- package/dist/esm/AssetsUtils-3803e935.js +22 -0
- package/dist/esm/CSSVarsUtils-aeee9825.js +16 -0
- package/dist/esm/DataUnit-1cd45202.js +464 -0
- package/dist/esm/DateUtils-0a1bbd7a.js +44 -0
- package/dist/esm/ez-action-chip.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +22 -0
- package/dist/esm/ez-button_11.entry.js +111757 -0
- package/dist/esm/ez-calendar.entry.js +213 -0
- package/dist/esm/ez-collapsible-box_6.entry.js +625 -0
- package/dist/esm/ez-combo-box.entry.js +250 -0
- package/dist/esm/ez-date-time-input.entry.js +129 -0
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +1834 -0
- package/dist/esm/ez-label-chip.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +36 -212
- package/dist/esm/ez-popover.entry.js +3 -3
- package/dist/esm/ez-popup.entry.js +2 -2
- package/dist/esm/ez-time-input.entry.js +5 -4
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/form-metadata.entry.js +125 -0
- package/dist/esm/{index-33153059.js → index-1dacecd3.js} +3 -6
- package/dist/esm/index-ca8700cb.js +7414 -0
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-14bee38e.entry.js +1 -0
- package/dist/ezui/p-37a611ea.js +1 -0
- package/dist/ezui/p-3a09c678.entry.js +1 -0
- package/dist/ezui/p-43c15c94.entry.js +1 -0
- package/dist/ezui/{p-34d288d0.entry.js → p-516d0e0f.entry.js} +1 -1
- package/dist/ezui/{p-0d476efb.entry.js → p-5a86e18a.entry.js} +1 -1
- package/dist/ezui/{p-47406a6e.entry.js → p-5da66d3e.entry.js} +1 -1
- package/dist/ezui/p-7107d7ef.js +1 -0
- package/dist/ezui/p-72ff3c95.entry.js +1 -0
- package/dist/ezui/p-74f978db.entry.js +369 -0
- package/dist/ezui/p-88f45a83.entry.js +1 -0
- package/dist/ezui/p-8b099482.js +1 -0
- package/dist/ezui/p-8d6cdd3e.entry.js +1 -0
- package/dist/ezui/p-8f4851a6.js +1 -0
- package/dist/ezui/p-9dfd537e.js +1 -0
- package/dist/ezui/p-a0331955.entry.js +1 -0
- package/dist/ezui/p-a15093e3.entry.js +1 -0
- package/dist/ezui/{p-8818da66.entry.js → p-a18a2d7b.entry.js} +1 -1
- package/dist/ezui/p-a19f2af3.entry.js +1 -0
- package/dist/ezui/p-c6d469fc.entry.js +1 -0
- package/dist/ezui/p-c89629eb.js +1 -0
- package/dist/ezui/p-da929c01.js +1 -0
- package/dist/ezui/p-f3c5f27e.entry.js +1 -0
- package/dist/types/components/ez-application/ez-application.d.ts +10 -0
- package/dist/types/components/ez-button/ez-button.d.ts +5 -0
- package/dist/types/components/ez-calendar/ez-calendar.d.ts +21 -0
- package/dist/types/components/ez-check/ez-check.d.ts +1 -1
- package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +3 -3
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -0
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +42 -0
- package/dist/types/components/ez-form/ez-form.d.ts +9 -9
- package/dist/types/components/ez-form/subcomponents/DataUnit.d.ts +1 -1
- package/dist/types/components/ez-form/subcomponents/form-metadata.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/DataUnitBridge.d.ts +8 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +195 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +34 -0
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/i18n/pt-BR.d.ts +2 -0
- package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +8 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +78 -0
- package/dist/types/components/ez-grid/subcomponents/gridconfig/grid-config.d.ts +30 -0
- package/dist/types/components/ez-grid/subcomponents/select-box/select-box.d.ts +9 -0
- package/dist/types/components/ez-list/ez-list.d.ts +70 -17
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +29 -63
- package/dist/types/components/ez-search/ez-search.d.ts +2 -0
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +1 -1
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +1 -1
- package/dist/types/components/test-du/test-du.d.ts +6 -0
- package/dist/types/components.d.ts +289 -139
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/dist/types/utils/{Application.d.ts → ApplicationUtils.d.ts} +1 -1
- package/dist/types/utils/AssetsUtils.d.ts +1 -0
- package/dist/types/utils/CSSVarsUtils.d.ts +1 -1
- package/package.json +10 -8
- package/react/components.d.ts +6 -1
- package/react/components.js +6 -1
- package/react/components.js.map +1 -1
- package/dist/cjs/CSSVarsUtils-f8827674.js +0 -18
- package/dist/cjs/RequestMetadata-2cd01e8a.js +0 -531
- package/dist/cjs/ez-button_16.cjs.entry.js +0 -4071
- package/dist/cjs/ez-list.cjs.entry.js +0 -174
- package/dist/cjs/ez-modal.cjs.entry.js +0 -65
- package/dist/collection/components/ez-numeric-input/ez-numeric-input.css +0 -13
- package/dist/collection/components/ez-numeric-input/ez-numeric-input.js +0 -185
- package/dist/esm/CSSVarsUtils-e0128b01.js +0 -16
- package/dist/esm/RequestMetadata-c265c9d5.js +0 -527
- package/dist/esm/ez-button_16.entry.js +0 -4052
- package/dist/esm/ez-list.entry.js +0 -170
- package/dist/esm/ez-modal.entry.js +0 -61
- package/dist/ezui/p-061d21ba.entry.js +0 -1
- package/dist/ezui/p-15743b09.entry.js +0 -1
- package/dist/ezui/p-46d07e59.entry.js +0 -1
- package/dist/ezui/p-4df6f855.js +0 -1
- package/dist/ezui/p-50464bdf.entry.js +0 -1
- package/dist/ezui/p-67410dfa.entry.js +0 -1
- package/dist/ezui/p-7be54779.entry.js +0 -1
- package/dist/ezui/p-7f3bc6d9.entry.js +0 -1
- package/dist/ezui/p-9dfccb16.js +0 -1
- package/dist/ezui/p-d1889704.js +0 -1
- package/dist/types/components/ez-numeric-input/ez-numeric-input.d.ts +0 -45
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export default class Server {
|
|
2
|
+
constructor(data) {
|
|
3
|
+
this._data = data;
|
|
4
|
+
}
|
|
5
|
+
getData(request) {
|
|
6
|
+
const finalArray = this.sort(this.filter(this._data, request), request);
|
|
7
|
+
return { rowData: finalArray.slice(request.startRow, request.endRow), rowCount: finalArray.length };
|
|
8
|
+
}
|
|
9
|
+
filter(data, _request) {
|
|
10
|
+
return data;
|
|
11
|
+
}
|
|
12
|
+
sort(data, _request) {
|
|
13
|
+
return data;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/* alasql.options.cache = false;
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
getData: function (request) {
|
|
20
|
+
var results = executeQuery(request);
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
success: true,
|
|
24
|
+
rows: results,
|
|
25
|
+
lastRow: getLastRowIndex(request, results),
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
function executeQuery(request) {
|
|
31
|
+
var sql = buildSql(request);
|
|
32
|
+
|
|
33
|
+
console.log("[FakeServer] - about to execute query:", sql);
|
|
34
|
+
|
|
35
|
+
return alasql(sql, [allData]);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function buildSql(request) {
|
|
39
|
+
return "SELECT * FROM ?" + orderBySql(request) + limitSql(request);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function orderBySql(request) {
|
|
43
|
+
var sortModel = request.sortModel;
|
|
44
|
+
|
|
45
|
+
if (sortModel.length === 0) return "";
|
|
46
|
+
|
|
47
|
+
var sorts = sortModel.map(function (s) {
|
|
48
|
+
return s.colId + " " + s.sort.toUpperCase();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
return " ORDER BY " + sorts.join(", ");
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function limitSql(request) {
|
|
55
|
+
var blockSize = request.endRow - request.startRow;
|
|
56
|
+
|
|
57
|
+
return " LIMIT " + (blockSize + 1) + " OFFSET " + request.startRow;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function getLastRowIndex(request, results) {
|
|
61
|
+
if (!results || results.length === 0) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
var currentLastRow = request.startRow + results.length;
|
|
66
|
+
|
|
67
|
+
return currentLastRow <= request.endRow ? currentLastRow : -1;
|
|
68
|
+
}
|
|
69
|
+
}*/
|
package/dist/collection/components/ez-grid/controller/ag-grid/template/HeaderColumnTemplate.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const HeaderColumnTemplate = `<div class="ag-cell-label-container" role="presentation">
|
|
2
|
+
<span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>
|
|
3
|
+
<div ref="eLabel" class="ag-header-cell-label" role="presentation" unselectable="on">
|
|
4
|
+
<span ref="eText" class="ag-header-cell-text" unselectable="on"></span>
|
|
5
|
+
<span ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>
|
|
6
|
+
<span ref="eSortAsc" class="ag-header-icon ag-header-label-icon ag-sort-ascending-icon" aria-hidden="true"></span>
|
|
7
|
+
<span ref="eSortDesc" class="ag-header-icon ag-header-label-icon ag-sort-descending-icon" aria-hidden="true"></span>
|
|
8
|
+
<span ref="eSortNone" class="ag-header-icon ag-header-label-icon ag-sort-none-icon" aria-hidden="true"></span>
|
|
9
|
+
</div>
|
|
10
|
+
</div>`;
|
|
11
|
+
|
|
12
|
+
export default HeaderColumnTemplate;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
|
|
3
|
+
/*@doc Define a cor de fundo do header do componente.*/
|
|
4
|
+
--ezgrid__header--background-color: var(--background--xlight, #FFF)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.grid__header {
|
|
8
|
+
/*private*/
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: flex-end;
|
|
11
|
+
align-items: center;
|
|
12
|
+
|
|
13
|
+
/*public*/
|
|
14
|
+
background-color: var(--ezgrid__header--background-color);
|
|
15
|
+
}
|
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
import { Component, h, Host, Prop, Method, Event, State } from "@stencil/core";
|
|
2
|
+
import AgGridController from "./controller/ag-grid/AgGridController";
|
|
3
|
+
import { getSpritePath } from "../../utils/AssetsUtils";
|
|
4
|
+
import DataUnitBridge from "./controller/DataUnitBridge";
|
|
5
|
+
export class EzGrid {
|
|
6
|
+
constructor() {
|
|
7
|
+
this._gridController = new AgGridController(false);
|
|
8
|
+
this._popUpVisible = false;
|
|
9
|
+
/**
|
|
10
|
+
* Determina o número de linhas de cada página. Caso informado o valor -1
|
|
11
|
+
* não haverá paginação.
|
|
12
|
+
*/
|
|
13
|
+
this.pageSize = -1;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Método responsável por receber a definição das colunas
|
|
17
|
+
*/
|
|
18
|
+
async setColumnsDef(cols) {
|
|
19
|
+
this._gridController.setColumnsDef(cols, this.multipleSelection);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Adiciona item de menu nas colunas.
|
|
23
|
+
*/
|
|
24
|
+
async addColumnMenuItem(label, name, action) {
|
|
25
|
+
this._gridController.addColumnMenuItem({ label, name, action });
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Método responsável por aplicar estado pré-existente nas colunas do grid.
|
|
29
|
+
*/
|
|
30
|
+
async setColumnsState(state) {
|
|
31
|
+
this._gridController.setColumnsState(state);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Método de carga dos registros. Os objetos deste array devem conter atributos
|
|
35
|
+
* para as colunas desejadas.
|
|
36
|
+
*/
|
|
37
|
+
async setData(data) {
|
|
38
|
+
this._gridController.setData(data);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Retorna as linhas selecionadas na grade.
|
|
42
|
+
*/
|
|
43
|
+
async getSelection() {
|
|
44
|
+
return Promise.resolve(this._gridController.getSelection());
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Método retornar o estado atual das colunas do grid.
|
|
48
|
+
*/
|
|
49
|
+
async getColumnsState() {
|
|
50
|
+
return Promise.resolve(this._gridController.getColumnsState());
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Método retornar o estado atual das colunas do grid.
|
|
54
|
+
*/
|
|
55
|
+
async getColumns() {
|
|
56
|
+
return Promise.resolve(this._gridController.getColumnsDef());
|
|
57
|
+
}
|
|
58
|
+
componentWillLoad() {
|
|
59
|
+
if (this.dataUnit) {
|
|
60
|
+
this._dataUnitBridge = new DataUnitBridge(this._gridController, this.dataUnit);
|
|
61
|
+
addEventListener("ezSelectionChange", (evt) => this.dataUnit.setSelection(evt.detail.map((r) => r.__record__id__)));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
componentDidLoad() {
|
|
65
|
+
this._gridController.initDatagrid(this._container, {
|
|
66
|
+
onColumnStateChange: (type, state) => this.ezColumnStateChange.emit({ type, state }),
|
|
67
|
+
onSelectionChange: (selection) => this.ezSelectionChange.emit(selection),
|
|
68
|
+
onPaginationChange: (status) => {
|
|
69
|
+
this._navigationHasPrevious = status.hasPrevious;
|
|
70
|
+
this._navigationHasNext = status.hasNext;
|
|
71
|
+
this._navigationFirstRow = status.pageStart;
|
|
72
|
+
this._navigationLastRow = status.pageEnd;
|
|
73
|
+
this._navigationTotalRows = status.totalRows;
|
|
74
|
+
},
|
|
75
|
+
allowMultipleSelection: this.multipleSelection,
|
|
76
|
+
pageSize: this.pageSize,
|
|
77
|
+
serverURL: this.serverUrl,
|
|
78
|
+
dataUnit: this.dataUnit
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
getPaginationControl() {
|
|
82
|
+
if (this.pageSize === -1) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
return [
|
|
86
|
+
h("div", { class: "text text--primary text--medium margin-right--medium" },
|
|
87
|
+
h("strong", { class: "text text--primary text--medium" }, `${this._navigationFirstRow}-${this._navigationLastRow}`),
|
|
88
|
+
` de ${this._navigationTotalRows}`),
|
|
89
|
+
h("ez-button", { size: "small", image: getSpritePath("chevron-left"), class: "button--secondary margin-right--medium", mode: "icon", enabled: this._navigationHasPrevious, onClick: () => this._gridController.previousPage(), label: "P\u00E1gina anterior" }),
|
|
90
|
+
h("ez-button", { size: "small", image: getSpritePath("chevron-right"), class: "button--secondary margin-right--medium", mode: "icon", enabled: this._navigationHasNext, onClick: () => this._gridController.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
applyConfig(cols) {
|
|
94
|
+
this._gridController.setColumnsState(cols);
|
|
95
|
+
this.closeConfig();
|
|
96
|
+
}
|
|
97
|
+
closeConfig() {
|
|
98
|
+
this._popUpVisible = false;
|
|
99
|
+
}
|
|
100
|
+
openConfig() {
|
|
101
|
+
this._gridConfig.columns = this._gridController.getColumnsState().filter(c => c.name);
|
|
102
|
+
this._gridConfig.selectedTab = "Colunas";
|
|
103
|
+
this._popUpVisible = true;
|
|
104
|
+
}
|
|
105
|
+
render() {
|
|
106
|
+
return (h(Host, null,
|
|
107
|
+
h("div", { class: "box box--shadow padding--medium grid__header margin-bottom--small" },
|
|
108
|
+
this.getPaginationControl(),
|
|
109
|
+
h("ez-button", { size: "small", image: getSpritePath("settings"), class: "button--secondary", mode: "icon", onClick: () => { this.openConfig(); } })),
|
|
110
|
+
h("div", { class: "grid__container ag-sankhya-theme", ref: elem => this._container = elem }),
|
|
111
|
+
h("div", { class: "grid__footer" }),
|
|
112
|
+
h("ez-modal", { modalSize: "small", closeEsc: true, closeOutsideClick: true, opened: this._popUpVisible, onEzCloseModal: () => this._popUpVisible = false },
|
|
113
|
+
h("grid-config", { ref: ref => this._gridConfig = ref, selectedTab: "Colunas", onConfigFinish: evt => this.applyConfig(evt.detail), onConfigCancel: _evt => this.closeConfig() }))));
|
|
114
|
+
}
|
|
115
|
+
static get is() { return "ez-grid"; }
|
|
116
|
+
static get originalStyleUrls() { return {
|
|
117
|
+
"$": ["ez-grid.css"]
|
|
118
|
+
}; }
|
|
119
|
+
static get styleUrls() { return {
|
|
120
|
+
"$": ["ez-grid.css"]
|
|
121
|
+
}; }
|
|
122
|
+
static get assetsDirs() { return ["../assets"]; }
|
|
123
|
+
static get properties() { return {
|
|
124
|
+
"multipleSelection": {
|
|
125
|
+
"type": "boolean",
|
|
126
|
+
"mutable": false,
|
|
127
|
+
"complexType": {
|
|
128
|
+
"original": "boolean",
|
|
129
|
+
"resolved": "boolean",
|
|
130
|
+
"references": {}
|
|
131
|
+
},
|
|
132
|
+
"required": false,
|
|
133
|
+
"optional": false,
|
|
134
|
+
"docs": {
|
|
135
|
+
"tags": [],
|
|
136
|
+
"text": "Habilita a sele\u00E7\u00E3o de v\u00E1rias linhas"
|
|
137
|
+
},
|
|
138
|
+
"attribute": "multiple-selection",
|
|
139
|
+
"reflect": false
|
|
140
|
+
},
|
|
141
|
+
"pageSize": {
|
|
142
|
+
"type": "number",
|
|
143
|
+
"mutable": false,
|
|
144
|
+
"complexType": {
|
|
145
|
+
"original": "number",
|
|
146
|
+
"resolved": "number",
|
|
147
|
+
"references": {}
|
|
148
|
+
},
|
|
149
|
+
"required": false,
|
|
150
|
+
"optional": false,
|
|
151
|
+
"docs": {
|
|
152
|
+
"tags": [],
|
|
153
|
+
"text": "Determina o n\u00FAmero de linhas de cada p\u00E1gina. Caso informado o valor -1\nn\u00E3o haver\u00E1 pagina\u00E7\u00E3o."
|
|
154
|
+
},
|
|
155
|
+
"attribute": "page-size",
|
|
156
|
+
"reflect": false,
|
|
157
|
+
"defaultValue": "-1"
|
|
158
|
+
},
|
|
159
|
+
"serverUrl": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"mutable": false,
|
|
162
|
+
"complexType": {
|
|
163
|
+
"original": "string",
|
|
164
|
+
"resolved": "string",
|
|
165
|
+
"references": {}
|
|
166
|
+
},
|
|
167
|
+
"required": false,
|
|
168
|
+
"optional": false,
|
|
169
|
+
"docs": {
|
|
170
|
+
"tags": [],
|
|
171
|
+
"text": "Endere\u00E7o do servidor. Se informado, o pr\u00F3prio datagrid controlar\u00E1 a obten\u00E7\u00E3o\ndos dados, anulando a necessidade de acionar o m\u00E9todo \"setData(data)\""
|
|
172
|
+
},
|
|
173
|
+
"attribute": "server-url",
|
|
174
|
+
"reflect": false
|
|
175
|
+
},
|
|
176
|
+
"dataUnit": {
|
|
177
|
+
"type": "unknown",
|
|
178
|
+
"mutable": false,
|
|
179
|
+
"complexType": {
|
|
180
|
+
"original": "DataUnit",
|
|
181
|
+
"resolved": "DataUnit",
|
|
182
|
+
"references": {
|
|
183
|
+
"DataUnit": {
|
|
184
|
+
"location": "import",
|
|
185
|
+
"path": "@sankhyalabs/core"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"required": false,
|
|
190
|
+
"optional": false,
|
|
191
|
+
"docs": {
|
|
192
|
+
"tags": [],
|
|
193
|
+
"text": ""
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}; }
|
|
197
|
+
static get states() { return {
|
|
198
|
+
"_navigationHasPrevious": {},
|
|
199
|
+
"_navigationHasNext": {},
|
|
200
|
+
"_navigationFirstRow": {},
|
|
201
|
+
"_navigationLastRow": {},
|
|
202
|
+
"_navigationTotalRows": {},
|
|
203
|
+
"_popUpVisible": {}
|
|
204
|
+
}; }
|
|
205
|
+
static get events() { return [{
|
|
206
|
+
"method": "ezColumnStateChange",
|
|
207
|
+
"name": "ezColumnStateChange",
|
|
208
|
+
"bubbles": true,
|
|
209
|
+
"cancelable": true,
|
|
210
|
+
"composed": true,
|
|
211
|
+
"docs": {
|
|
212
|
+
"tags": [],
|
|
213
|
+
"text": "Evento disparado ao mudar o estado das colunas do grid. Ordena\u00E7\u00E3o, largura, etc."
|
|
214
|
+
},
|
|
215
|
+
"complexType": {
|
|
216
|
+
"original": "EzGridColumStateEvent",
|
|
217
|
+
"resolved": "EzGridColumStateEvent",
|
|
218
|
+
"references": {
|
|
219
|
+
"EzGridColumStateEvent": {
|
|
220
|
+
"location": "import",
|
|
221
|
+
"path": "./controller/EzGridController"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}, {
|
|
226
|
+
"method": "ezSelectionChange",
|
|
227
|
+
"name": "ezSelectionChange",
|
|
228
|
+
"bubbles": true,
|
|
229
|
+
"cancelable": true,
|
|
230
|
+
"composed": true,
|
|
231
|
+
"docs": {
|
|
232
|
+
"tags": [],
|
|
233
|
+
"text": "Evento disparado ao selecionar linhas da grade."
|
|
234
|
+
},
|
|
235
|
+
"complexType": {
|
|
236
|
+
"original": "Array<any>",
|
|
237
|
+
"resolved": "any[]",
|
|
238
|
+
"references": {
|
|
239
|
+
"Array": {
|
|
240
|
+
"location": "global"
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}]; }
|
|
245
|
+
static get methods() { return {
|
|
246
|
+
"setColumnsDef": {
|
|
247
|
+
"complexType": {
|
|
248
|
+
"signature": "(cols: Array<EzGridColumn>) => Promise<any>",
|
|
249
|
+
"parameters": [{
|
|
250
|
+
"tags": [],
|
|
251
|
+
"text": ""
|
|
252
|
+
}],
|
|
253
|
+
"references": {
|
|
254
|
+
"Promise": {
|
|
255
|
+
"location": "global"
|
|
256
|
+
},
|
|
257
|
+
"Array": {
|
|
258
|
+
"location": "global"
|
|
259
|
+
},
|
|
260
|
+
"EzGridColumn": {
|
|
261
|
+
"location": "import",
|
|
262
|
+
"path": "./controller/EzGridController"
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"return": "Promise<any>"
|
|
266
|
+
},
|
|
267
|
+
"docs": {
|
|
268
|
+
"text": "M\u00E9todo respons\u00E1vel por receber a defini\u00E7\u00E3o das colunas",
|
|
269
|
+
"tags": []
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
"addColumnMenuItem": {
|
|
273
|
+
"complexType": {
|
|
274
|
+
"signature": "(label: string, name: string, action: Function) => Promise<any>",
|
|
275
|
+
"parameters": [{
|
|
276
|
+
"tags": [],
|
|
277
|
+
"text": ""
|
|
278
|
+
}, {
|
|
279
|
+
"tags": [],
|
|
280
|
+
"text": ""
|
|
281
|
+
}, {
|
|
282
|
+
"tags": [],
|
|
283
|
+
"text": ""
|
|
284
|
+
}],
|
|
285
|
+
"references": {
|
|
286
|
+
"Promise": {
|
|
287
|
+
"location": "global"
|
|
288
|
+
},
|
|
289
|
+
"Function": {
|
|
290
|
+
"location": "global"
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
"return": "Promise<any>"
|
|
294
|
+
},
|
|
295
|
+
"docs": {
|
|
296
|
+
"text": "Adiciona item de menu nas colunas.",
|
|
297
|
+
"tags": []
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
"setColumnsState": {
|
|
301
|
+
"complexType": {
|
|
302
|
+
"signature": "(state: Array<EzGridColumn>) => Promise<any>",
|
|
303
|
+
"parameters": [{
|
|
304
|
+
"tags": [],
|
|
305
|
+
"text": ""
|
|
306
|
+
}],
|
|
307
|
+
"references": {
|
|
308
|
+
"Promise": {
|
|
309
|
+
"location": "global"
|
|
310
|
+
},
|
|
311
|
+
"Array": {
|
|
312
|
+
"location": "global"
|
|
313
|
+
},
|
|
314
|
+
"EzGridColumn": {
|
|
315
|
+
"location": "import",
|
|
316
|
+
"path": "./controller/EzGridController"
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
"return": "Promise<any>"
|
|
320
|
+
},
|
|
321
|
+
"docs": {
|
|
322
|
+
"text": "M\u00E9todo respons\u00E1vel por aplicar estado pr\u00E9-existente nas colunas do grid.",
|
|
323
|
+
"tags": []
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
"setData": {
|
|
327
|
+
"complexType": {
|
|
328
|
+
"signature": "(data: Array<any>) => Promise<any>",
|
|
329
|
+
"parameters": [{
|
|
330
|
+
"tags": [],
|
|
331
|
+
"text": ""
|
|
332
|
+
}],
|
|
333
|
+
"references": {
|
|
334
|
+
"Promise": {
|
|
335
|
+
"location": "global"
|
|
336
|
+
},
|
|
337
|
+
"Array": {
|
|
338
|
+
"location": "global"
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"return": "Promise<any>"
|
|
342
|
+
},
|
|
343
|
+
"docs": {
|
|
344
|
+
"text": "M\u00E9todo de carga dos registros. Os objetos deste array devem conter atributos\npara as colunas desejadas.",
|
|
345
|
+
"tags": []
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
"getSelection": {
|
|
349
|
+
"complexType": {
|
|
350
|
+
"signature": "() => Promise<Array<any>>",
|
|
351
|
+
"parameters": [],
|
|
352
|
+
"references": {
|
|
353
|
+
"Promise": {
|
|
354
|
+
"location": "global"
|
|
355
|
+
},
|
|
356
|
+
"Array": {
|
|
357
|
+
"location": "global"
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
"return": "Promise<any[]>"
|
|
361
|
+
},
|
|
362
|
+
"docs": {
|
|
363
|
+
"text": "Retorna as linhas selecionadas na grade.",
|
|
364
|
+
"tags": []
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
"getColumnsState": {
|
|
368
|
+
"complexType": {
|
|
369
|
+
"signature": "() => Promise<Array<EzGridColumn>>",
|
|
370
|
+
"parameters": [],
|
|
371
|
+
"references": {
|
|
372
|
+
"Promise": {
|
|
373
|
+
"location": "global"
|
|
374
|
+
},
|
|
375
|
+
"EzGridColumn": {
|
|
376
|
+
"location": "import",
|
|
377
|
+
"path": "./controller/EzGridController"
|
|
378
|
+
},
|
|
379
|
+
"Array": {
|
|
380
|
+
"location": "global"
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
"return": "Promise<EzGridColumn[]>"
|
|
384
|
+
},
|
|
385
|
+
"docs": {
|
|
386
|
+
"text": "M\u00E9todo retornar o estado atual das colunas do grid.",
|
|
387
|
+
"tags": []
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
"getColumns": {
|
|
391
|
+
"complexType": {
|
|
392
|
+
"signature": "() => Promise<Array<EzGridColumn>>",
|
|
393
|
+
"parameters": [],
|
|
394
|
+
"references": {
|
|
395
|
+
"Promise": {
|
|
396
|
+
"location": "global"
|
|
397
|
+
},
|
|
398
|
+
"EzGridColumn": {
|
|
399
|
+
"location": "import",
|
|
400
|
+
"path": "./controller/EzGridController"
|
|
401
|
+
},
|
|
402
|
+
"Array": {
|
|
403
|
+
"location": "global"
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
"return": "Promise<EzGridColumn[]>"
|
|
407
|
+
},
|
|
408
|
+
"docs": {
|
|
409
|
+
"text": "M\u00E9todo retornar o estado atual das colunas do grid.",
|
|
410
|
+
"tags": []
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}; }
|
|
414
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
|
|
3
|
+
/*@doc Define o espaçamento utilizado no rodapé do componente.*/
|
|
4
|
+
--ez-grid-config__footer--padding-top: var(--space--medium, 12px);
|
|
5
|
+
|
|
6
|
+
/*@doc Define o espaçamento utilizado no centro do componente.*/
|
|
7
|
+
--ez-grid-config__main--padding-right: var(--space--medium, 12px);
|
|
8
|
+
|
|
9
|
+
/*@doc Define o espaçamento utilizado no seletor de abas do componente.*/
|
|
10
|
+
--ez-grid-config__tabselector-container--padding: var(--space--medium, 12px);
|
|
11
|
+
|
|
12
|
+
/*@doc Define o espaçamento utilizado à esquerda do botão de fechar do componente.*/
|
|
13
|
+
--ez-grid-config__button-close--padding-left: var(--space--medium, 12px);
|
|
14
|
+
|
|
15
|
+
/*@doc Define o estilo da fonte utilizada para o subtitulo do componente.*/
|
|
16
|
+
--ez-grid-config__subtitle--font-family: var(--font-pattern, "Sora");
|
|
17
|
+
|
|
18
|
+
--ez-grid-config__title--font-family: var(--font-pattern, "Sora");
|
|
19
|
+
|
|
20
|
+
--ez-grid-config__title--font-weight: var(--text-weight--large, 14px);
|
|
21
|
+
|
|
22
|
+
/*@doc Define o tamanho da fonte utilizada para o subtitulo do componente.*/
|
|
23
|
+
--ez-grid-config__subtitle--font-size: var(--text--medium, 14px);
|
|
24
|
+
|
|
25
|
+
/*@doc Define a largura da barra de rolagem do componente.*/
|
|
26
|
+
--ez-grid-config__scrollbar--width: var(--space--medium, 12px);
|
|
27
|
+
|
|
28
|
+
/*@doc Define a cor da barra de rolagem do componente.*/
|
|
29
|
+
--ez-grid-config__main__scrollbar--background-color: var(--text--primary, #626e82);
|
|
30
|
+
|
|
31
|
+
/*@doc Define o raio da borda da barra de rolagem do componente.*/
|
|
32
|
+
--ez-grid-config__main__scrollbar--border-radius: var(--border--radius-medium, 12px);
|
|
33
|
+
|
|
34
|
+
display: grid;
|
|
35
|
+
grid-template-rows: auto 1fr auto;
|
|
36
|
+
max-height: 100%;
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.padding-right--medium {
|
|
41
|
+
padding-right: var(--space--medium);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
ez-list {
|
|
45
|
+
height: 100%;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.grid-config__footer {
|
|
49
|
+
padding-top: var(--ez-grid-config__footer--padding-top);
|
|
50
|
+
display: flex;
|
|
51
|
+
justify-content: flex-end;
|
|
52
|
+
width: 100%;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.hidden {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.grid-config__main {
|
|
60
|
+
padding-right: var(--ez-grid-config__main--padding-right);
|
|
61
|
+
overflow-y: auto;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.tabselector-container {
|
|
65
|
+
padding: var(--ez-grid-config__tabselector-container--padding) 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.button-close {
|
|
69
|
+
padding-left: var(--ez-grid-config__button-close--padding-left);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.title-container {
|
|
73
|
+
display: flex;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
align-items: center;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.subtitle {
|
|
79
|
+
font-family: var(--ez-grid-config__subtitle--font-family);
|
|
80
|
+
font-size: var(--ez-grid-config__subtitle--font-size);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.title {
|
|
84
|
+
display: flex;
|
|
85
|
+
font-family: var(--ez-grid-config__title--font-family);
|
|
86
|
+
margin: 0;
|
|
87
|
+
font-weight: var(--ez-grid-config__title--font-weight);
|
|
88
|
+
line-height: 1.3;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.grid-config__main::-webkit-scrollbar-track {
|
|
92
|
+
background-color: #f0f2f5;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.grid-config__main::-webkit-scrollbar-thumb {
|
|
96
|
+
background-color: var(--ez-grid-config__main__scrollbar--background-color);
|
|
97
|
+
border-radius: var(--ez-grid-config__main__scrollbar--border-radius);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.grid-config__main::-webkit-scrollbar {
|
|
101
|
+
background-color: #f0f2f5;
|
|
102
|
+
width: var(--ez-grid-config__scrollbar--width);
|
|
103
|
+
max-width: var(--ez-grid-config__scrollbar--width);
|
|
104
|
+
min-width: var(--ez-grid-config__scrollbar--width);
|
|
105
|
+
}
|