@sankhyalabs/ezui 1.1.76 → 1.1.79
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/AssetsUtils-02db4f46.js +24 -0
- package/dist/cjs/CSSVarsUtils-66e86394.js +18 -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_3.cjs.entry.js +520 -0
- package/dist/cjs/ez-calendar_13.cjs.entry.js +2417 -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-grid.cjs.entry.js +110375 -0
- package/dist/cjs/ez-icon.cjs.entry.js +30 -0
- package/dist/cjs/ez-label-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal_2.cjs.entry.js +370 -0
- 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 -28
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +3 -3
- package/dist/cjs/{index-9431aeeb.js → index-2003dec4.js} +1 -15
- package/dist/cjs/index-a2266984.js +7417 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +8 -5
- 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 +16 -1
- package/dist/collection/components/ez-button/ez-button.js +27 -2
- 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-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 +2 -2
- package/dist/collection/components/ez-date-input/ez-date-input.js +1 -1
- 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/DataBinder.js +44 -0
- package/dist/collection/components/ez-form/ez-form.css +1 -15
- package/dist/collection/components/ez-form/ez-form.js +109 -428
- package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +45 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.js +11 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.js +14 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +5 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/FileInput.tpl.js +5 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.js +13 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.js +5 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/TextArea.tpl.js +5 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/TextInput.tpl.js +5 -0
- package/dist/collection/components/ez-form/store/form.slice.js +38 -0
- package/dist/collection/components/ez-form/structure/FormItem.js +11 -0
- package/dist/collection/components/ez-form/structure/FormSheet.js +5 -0
- package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +86 -0
- 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.js +1 -0
- 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 +87 -0
- package/dist/collection/servidor.js +94 -94
- package/dist/collection/utils/{Application.js → ApplicationUtils.js} +4 -4
- package/dist/collection/utils/CSSVarsUtils.js +6 -6
- package/dist/custom-elements/index.d.ts +32 -14
- package/dist/custom-elements/index.js +119419 -3209
- package/dist/esm/AssetsUtils-76ca41e1.js +22 -0
- package/dist/esm/CSSVarsUtils-aeee9825.js +16 -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_3.entry.js +514 -0
- package/dist/esm/ez-calendar_13.entry.js +2401 -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-grid.entry.js +110371 -0
- package/dist/esm/ez-icon.entry.js +26 -0
- package/dist/esm/ez-label-chip.entry.js +1 -1
- package/dist/esm/ez-modal_2.entry.js +365 -0
- 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 +4 -22
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/{index-fd3c8023.js → index-077c7fcf.js} +1 -15
- package/dist/esm/index-afe19542.js +7410 -0
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-00b837e2.js +1 -0
- package/dist/ezui/{p-a0b6eee2.entry.js → p-0a2056d9.entry.js} +1 -1
- package/dist/ezui/p-0d8368fc.entry.js +1 -0
- package/dist/ezui/p-1e36e3ff.entry.js +1 -0
- package/dist/ezui/p-446ec85b.js +1 -0
- package/dist/ezui/p-5509ee41.entry.js +369 -0
- package/dist/ezui/{p-d443f020.entry.js → p-57ea4b84.entry.js} +1 -1
- package/dist/ezui/{p-66954a04.entry.js → p-6d157776.entry.js} +1 -1
- package/dist/ezui/p-7a1f2e0e.entry.js +1 -0
- package/dist/ezui/p-7de3c95d.js +1 -0
- package/dist/ezui/p-857ead8e.entry.js +1 -0
- package/dist/ezui/p-8b099482.js +1 -0
- package/dist/ezui/p-920bb8c9.entry.js +1 -0
- package/dist/ezui/p-9be02ecf.entry.js +1 -0
- package/dist/ezui/p-a4a39579.entry.js +1 -0
- package/dist/ezui/p-c89629eb.js +1 -0
- package/dist/ezui/p-d5699f29.entry.js +1 -0
- package/dist/ezui/p-d64a3939.entry.js +1 -0
- package/dist/ezui/{p-823ff0a0.entry.js → p-da31cd21.entry.js} +1 -1
- 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-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/DataBinder.d.ts +10 -0
- package/dist/types/components/ez-form/ez-form.d.ts +24 -32
- package/dist/types/components/ez-form/fieldbuilder/FieldBuilder.d.ts +2 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.d.ts +3 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.d.ts +4 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +4 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/FileInput.tpl.d.ts +4 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +8 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.d.ts +4 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/TextArea.tpl.d.ts +4 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/TextInput.tpl.d.ts +4 -0
- package/dist/types/components/ez-form/store/form.slice.d.ts +24 -0
- package/dist/types/components/ez-form/structure/FormItem.d.ts +9 -0
- package/dist/types/components/ez-form/structure/FormSheet.d.ts +9 -0
- package/dist/types/components/ez-form/structure/FormSheetMetadata.d.ts +27 -0
- 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/test-du/test-du.d.ts +12 -0
- package/dist/types/components.d.ts +271 -175
- 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/CSSVarsUtils.d.ts +1 -1
- package/package.json +10 -8
- package/react/components.d.ts +6 -3
- package/react/components.js +6 -3
- 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 -4079
- package/dist/cjs/ez-list.cjs.entry.js +0 -174
- package/dist/cjs/ez-modal.cjs.entry.js +0 -65
- package/dist/cjs/ez-number-input.cjs.entry.js +0 -250
- package/dist/collection/components/ez-form/assets/trash-can-outline.svg +0 -3
- package/dist/collection/components/ez-form/store/Form.actions.js +0 -132
- package/dist/collection/components/ez-form/store/Form.reducer.js +0 -194
- package/dist/collection/components/ez-form/store/Form.selectors.js +0 -44
- package/dist/collection/components/ez-form/subcomponents/DataUnit.js +0 -301
- package/dist/collection/components/ez-form/subcomponents/FormMetadata.js +0 -8
- package/dist/collection/components/ez-form/subcomponents/css/place-holder.css +0 -24
- package/dist/collection/components/ez-form/subcomponents/form-metadata.js +0 -227
- package/dist/collection/components/ez-form/subcomponents/place-holder.js +0 -14
- package/dist/collection/components/ez-form/subcomponents/structure/Field.js +0 -95
- package/dist/collection/components/ez-form/subcomponents/structure/FieldSet.js +0 -27
- package/dist/collection/components/ez-form/subcomponents/structure/FormSheet.js +0 -41
- package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +0 -37
- 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 -4060
- package/dist/esm/ez-list.entry.js +0 -170
- package/dist/esm/ez-modal.entry.js +0 -61
- package/dist/esm/ez-number-input.entry.js +0 -246
- package/dist/ezui/assets/trash-can-outline.svg +0 -3
- package/dist/ezui/p-11ae4ae7.entry.js +0 -1
- package/dist/ezui/p-47fa3d6c.entry.js +0 -1
- package/dist/ezui/p-8ab6168f.entry.js +0 -1
- package/dist/ezui/p-9c1fb51c.entry.js +0 -1
- package/dist/ezui/p-9d85125b.entry.js +0 -1
- package/dist/ezui/p-9dfccb16.js +0 -1
- package/dist/ezui/p-a7b546b2.entry.js +0 -1
- package/dist/ezui/p-c833c94f.entry.js +0 -1
- package/dist/ezui/p-d1889704.js +0 -1
- package/dist/ezui/p-e0ab3746.js +0 -1
- package/dist/types/components/ez-form/store/Form.actions.d.ts +0 -111
- package/dist/types/components/ez-form/store/Form.reducer.d.ts +0 -20
- package/dist/types/components/ez-form/store/Form.selectors.d.ts +0 -14
- package/dist/types/components/ez-form/subcomponents/DataUnit.d.ts +0 -91
- package/dist/types/components/ez-form/subcomponents/FormMetadata.d.ts +0 -24
- package/dist/types/components/ez-form/subcomponents/form-metadata.d.ts +0 -16
- package/dist/types/components/ez-form/subcomponents/place-holder.d.ts +0 -3
- package/dist/types/components/ez-form/subcomponents/structure/Field.d.ts +0 -11
- package/dist/types/components/ez-form/subcomponents/structure/FieldSet.d.ts +0 -13
- package/dist/types/components/ez-form/subcomponents/structure/FormSheet.d.ts +0 -14
- package/dist/types/components/ez-form/subcomponents/structure/NavigationBar.d.ts +0 -19
- package/dist/types/components/ez-numeric-input/ez-numeric-input.d.ts +0 -45
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export const buildComboBox = ({ name, label }, properties) => {
|
|
3
|
+
const prop = properties === null || properties === void 0 ? void 0 : properties.options;
|
|
4
|
+
let options;
|
|
5
|
+
if (typeof prop === "string") {
|
|
6
|
+
const parsed = JSON.parse(prop);
|
|
7
|
+
options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
options = prop;
|
|
11
|
+
}
|
|
12
|
+
return (h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
13
|
+
h("ez-combo-box", { label: label, "data-field-name": name, key: name, options: options })));
|
|
14
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export const buildFile = ({ name, label }) => {
|
|
3
|
+
return (h("div", { class: "col col--sd-12 padding--small" },
|
|
4
|
+
h("ez-upload", { label: label, urlUpload: "", requestHeaders: "", maxFiles: 10, "data-field-name": name, key: name })));
|
|
5
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export const buildDecimal = ({ name, label }, properties) => {
|
|
3
|
+
const precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
|
|
4
|
+
const prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
|
|
5
|
+
return buildNumeric(name, label, precision, prettyPrecision);
|
|
6
|
+
};
|
|
7
|
+
export const buildInteger = ({ name, label }) => {
|
|
8
|
+
return buildNumeric(name, label, 0, 0);
|
|
9
|
+
};
|
|
10
|
+
function buildNumeric(fieldName, fieldLabel, precision, prettyPrecision) {
|
|
11
|
+
return (h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
12
|
+
h("ez-number-input", { label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
|
|
13
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export const buildSearch = ({ name, label }) => {
|
|
3
|
+
return (h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
4
|
+
h("ez-search", { label: label, optionLoader: (_argument) => { }, "data-field-name": name, key: name })));
|
|
5
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const inicialState = {};
|
|
2
|
+
/////////////////////////////// REDUCERS ///////////////////////////////
|
|
3
|
+
export function formReducer(state = inicialState, action) {
|
|
4
|
+
switch (action.type) {
|
|
5
|
+
case FormActions.METADATA_LOADED:
|
|
6
|
+
return Object.assign(Object.assign({}, state), { formMetadata: action.payload });
|
|
7
|
+
case FormActions.CHANGE_TAB:
|
|
8
|
+
return Object.assign(Object.assign({}, state), { currentSheet: action.payload });
|
|
9
|
+
default:
|
|
10
|
+
return state;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/////////////////////////////// ACTION CREATORS ///////////////////////////////
|
|
14
|
+
export function loadMetadata(formMetadata) {
|
|
15
|
+
return {
|
|
16
|
+
type: FormActions.METADATA_LOADED,
|
|
17
|
+
payload: formMetadata
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export function changeTab(currentSheet) {
|
|
21
|
+
return {
|
|
22
|
+
type: FormActions.CHANGE_TAB,
|
|
23
|
+
payload: currentSheet
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/////////////////////////////// SELECTORS ///////////////////////////////
|
|
27
|
+
export function selectFormMetadata(state) {
|
|
28
|
+
return state.formMetadata;
|
|
29
|
+
}
|
|
30
|
+
export function selectCurrentSheet(state) {
|
|
31
|
+
return state.currentSheet ? state.formMetadata.getSheet(state.currentSheet) : Array.from(state.formMetadata.getAllSheets().values())[0];
|
|
32
|
+
}
|
|
33
|
+
/////////////////////////////// TYPES ///////////////////////////////
|
|
34
|
+
var FormActions;
|
|
35
|
+
(function (FormActions) {
|
|
36
|
+
FormActions["METADATA_LOADED"] = "FORM/METADATA_LOADED";
|
|
37
|
+
FormActions["CHANGE_TAB"] = "FORM/CHANGE_TAB";
|
|
38
|
+
})(FormActions || (FormActions = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { buildField } from "../fieldbuilder/FieldBuilder";
|
|
3
|
+
export const FormItem = ({ source }) => {
|
|
4
|
+
if ("items" in source) {
|
|
5
|
+
const fieldSet = source;
|
|
6
|
+
return h("ez-collapsible-box", { label: source.label }, fieldSet.items.map(fi => buildField(fi)));
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
return buildField(source);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export class FormMetadata {
|
|
2
|
+
constructor() {
|
|
3
|
+
this._sheets = new Map();
|
|
4
|
+
this._requiredFields = [];
|
|
5
|
+
}
|
|
6
|
+
getSheet(name) {
|
|
7
|
+
return this._sheets.get(name);
|
|
8
|
+
}
|
|
9
|
+
getAllSheets() {
|
|
10
|
+
return this._sheets;
|
|
11
|
+
}
|
|
12
|
+
addSheet(sheet) {
|
|
13
|
+
this._sheets.set(sheet.name, sheet);
|
|
14
|
+
this._requiredFields = this._requiredFields.concat(sheet.requiredFields);
|
|
15
|
+
}
|
|
16
|
+
getRequiredFields() {
|
|
17
|
+
return this._requiredFields;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export const buildFromDataUnit = (dataUnit) => {
|
|
21
|
+
var _a;
|
|
22
|
+
const unitMD = dataUnit.metadata;
|
|
23
|
+
const metadata = new FormMetadata();
|
|
24
|
+
if (unitMD) {
|
|
25
|
+
const visibleFields = (_a = unitMD.fields) === null || _a === void 0 ? void 0 : _a.filter(descriptor => descriptor.visible !== false);
|
|
26
|
+
metadata.addSheet({
|
|
27
|
+
label: unitMD.label,
|
|
28
|
+
name: unitMD.name,
|
|
29
|
+
items: visibleFields.map(descriptor => { return { descriptor }; }),
|
|
30
|
+
requiredFields: visibleFields
|
|
31
|
+
.filter(descriptor => descriptor.required)
|
|
32
|
+
.map(descriptor => descriptor.name)
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return metadata;
|
|
36
|
+
};
|
|
37
|
+
export const buildFromConfig = (fields, dataUnit) => {
|
|
38
|
+
const sheets = new Map();
|
|
39
|
+
const requiredFields = [];
|
|
40
|
+
fields.forEach(config => {
|
|
41
|
+
if (config.visible !== false) {
|
|
42
|
+
const tab = config.tab || "Geral";
|
|
43
|
+
const descriptor = dataUnit.getField(config.name);
|
|
44
|
+
if (!sheets.has(tab)) {
|
|
45
|
+
sheets.set(tab, new Map());
|
|
46
|
+
}
|
|
47
|
+
let isRequired = false;
|
|
48
|
+
if (config.required === undefined) {
|
|
49
|
+
if (descriptor) {
|
|
50
|
+
isRequired = descriptor.required;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
isRequired = config.required;
|
|
55
|
+
}
|
|
56
|
+
if (isRequired) {
|
|
57
|
+
requiredFields.push(config.name);
|
|
58
|
+
}
|
|
59
|
+
const tabItens = sheets.get(tab);
|
|
60
|
+
const fieldMD = { config, descriptor };
|
|
61
|
+
const group = config.group;
|
|
62
|
+
if (group) {
|
|
63
|
+
const key = `group::${group}`;
|
|
64
|
+
if (!tabItens.has(key)) {
|
|
65
|
+
tabItens.set(key, { label: group, items: [fieldMD] });
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
tabItens.get(key).items.push(fieldMD);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
tabItens.set(config.name, fieldMD);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
const metadata = new FormMetadata();
|
|
77
|
+
sheets.forEach((value, key) => {
|
|
78
|
+
metadata.addSheet({
|
|
79
|
+
label: key,
|
|
80
|
+
name: key,
|
|
81
|
+
items: Array.from(value.values()),
|
|
82
|
+
requiredFields
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
return metadata;
|
|
86
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Action } from "@sankhyalabs/core";
|
|
2
|
+
export default class DataUnitBridge {
|
|
3
|
+
constructor(gridController, dataUnit) {
|
|
4
|
+
this._gridController = gridController;
|
|
5
|
+
this._dataUnit = dataUnit;
|
|
6
|
+
this._dataUnit.subscribe(action => this.processAction(action));
|
|
7
|
+
}
|
|
8
|
+
processAction(action) {
|
|
9
|
+
switch (action.type) {
|
|
10
|
+
case Action.METADATA_LOADED:
|
|
11
|
+
const columnDefs = [];
|
|
12
|
+
this._dataUnit.metadata.fields.forEach(f => {
|
|
13
|
+
if (f.visible !== false) {
|
|
14
|
+
columnDefs.push({ label: f.label, name: f.name });
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
this._gridController.setColumnsDef(columnDefs, true);
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { Grid as EnterpriseGrid } from "ag-grid-enterprise";
|
|
2
|
+
import { Grid } from "ag-grid-community";
|
|
3
|
+
import gridTerms from "./i18n/pt-BR.js";
|
|
4
|
+
import HeaderColumnTemplate from "./template/HeaderColumnTemplate.js";
|
|
5
|
+
import DataSource from "./DataSource";
|
|
6
|
+
export default class AgGridController {
|
|
7
|
+
constructor(enterprise) {
|
|
8
|
+
this._menuItems = [];
|
|
9
|
+
this._enterprise = enterprise;
|
|
10
|
+
}
|
|
11
|
+
initDatagrid(container, options) {
|
|
12
|
+
if (this._grid === undefined) {
|
|
13
|
+
this._columnStateChangeCallback = options.onColumnStateChange;
|
|
14
|
+
this._selectionChangeCallback = options.onSelectionChange;
|
|
15
|
+
this._paginationChangeCallback = options.onPaginationChange;
|
|
16
|
+
this._multipleSelection = options.allowMultipleSelection;
|
|
17
|
+
this._pageSize = options.pageSize;
|
|
18
|
+
this._serverURL = options.serverURL;
|
|
19
|
+
this._dataUnit = options.dataUnit;
|
|
20
|
+
this._gridOptions = {
|
|
21
|
+
localeText: gridTerms,
|
|
22
|
+
rowModelType: "serverSide",
|
|
23
|
+
serverSideStoreType: "partial",
|
|
24
|
+
rowSelection: this._multipleSelection ? "multiple" : "single",
|
|
25
|
+
serverSideDatasource: new DataSource(this._dataUnit, this._serverURL),
|
|
26
|
+
getMainMenuItems: (params) => {
|
|
27
|
+
const column = params.column;
|
|
28
|
+
const items = [column.isPinned() ? "clearPinned" : "pinLeft", "separator"];
|
|
29
|
+
this._menuItems.forEach(m => items.push({
|
|
30
|
+
name: m.label,
|
|
31
|
+
action: () => m.action(column.getColId(), m.name)
|
|
32
|
+
}));
|
|
33
|
+
return items;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
this.setOptionsEvents(this._gridOptions);
|
|
37
|
+
this.setOptionsPagination(this._gridOptions);
|
|
38
|
+
this.setOptionsSupress(this._gridOptions);
|
|
39
|
+
if (this._enterprise) {
|
|
40
|
+
this._grid = new EnterpriseGrid(container, this._gridOptions);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this._grid = new Grid(container, this._gridOptions);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
setOptionsEvents(opt) {
|
|
48
|
+
opt.onSortChanged = e => this.onCallStateChange("sort", e);
|
|
49
|
+
opt.onColumnResized = e => this.onCallStateChange("columnResize", e);
|
|
50
|
+
opt.onColumnPinned = e => this.onCallStateChange("columnPinned", e);
|
|
51
|
+
opt.onColumnMoved = e => this.onCallStateChange("columnMoved", e);
|
|
52
|
+
opt.onColumnVisible = e => this.onCallStateChange("visibleChange", e);
|
|
53
|
+
opt.onSelectionChanged = e => this.onSelectionChange(e);
|
|
54
|
+
opt.onPaginationChanged = () => this.onPaginationChange();
|
|
55
|
+
}
|
|
56
|
+
setOptionsPagination(opt) {
|
|
57
|
+
opt.pagination = (this._pageSize > -1);
|
|
58
|
+
opt.paginationPageSize = this._pageSize;
|
|
59
|
+
opt.cacheBlockSize = this._pageSize;
|
|
60
|
+
}
|
|
61
|
+
setOptionsSupress(opt) {
|
|
62
|
+
opt.suppressDragLeaveHidesColumns = true;
|
|
63
|
+
opt.suppressPaginationPanel = true;
|
|
64
|
+
opt.suppressMenuHide = true;
|
|
65
|
+
}
|
|
66
|
+
setData(data) {
|
|
67
|
+
if (this._grid === undefined) {
|
|
68
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
69
|
+
}
|
|
70
|
+
this._gridOptions.api.setRowData(data);
|
|
71
|
+
}
|
|
72
|
+
setColumnsDef(cols, showCheckSelection) {
|
|
73
|
+
if (this._grid === undefined) {
|
|
74
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
75
|
+
}
|
|
76
|
+
const colDefs = [];
|
|
77
|
+
if (showCheckSelection) {
|
|
78
|
+
colDefs.push({
|
|
79
|
+
headerName: "",
|
|
80
|
+
checkboxSelection: true,
|
|
81
|
+
headerCheckboxSelection: false,
|
|
82
|
+
width: 100,
|
|
83
|
+
suppressMovable: true
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
cols.forEach(c => {
|
|
87
|
+
colDefs.push(this.buildColDef(c));
|
|
88
|
+
});
|
|
89
|
+
this._gridOptions.api.setColumnDefs(colDefs);
|
|
90
|
+
}
|
|
91
|
+
getColumnsDef() {
|
|
92
|
+
if (this._grid === undefined) {
|
|
93
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
94
|
+
}
|
|
95
|
+
const colDef = this._gridOptions.columnApi.getAllColumns();
|
|
96
|
+
return colDef.map(c => {
|
|
97
|
+
const def = c.getColDef();
|
|
98
|
+
const colDef = { name: def.field, label: def.headerName };
|
|
99
|
+
this.conditionalSet(colDef, "sortable", def.sortable);
|
|
100
|
+
this.conditionalSet(colDef, "resizable", def.resizable);
|
|
101
|
+
this.conditionalSet(colDef, "sort", def.sort);
|
|
102
|
+
this.conditionalSet(colDef, "sortIndex", def.sortIndex);
|
|
103
|
+
this.conditionalSet(colDef, "width", def.width);
|
|
104
|
+
this.conditionalSet(colDef, "pinned", def.pinned !== null);
|
|
105
|
+
this.conditionalSet(colDef, "hidden", def.hide);
|
|
106
|
+
return colDef;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
setColumnsState(state) {
|
|
110
|
+
if (this._grid === undefined) {
|
|
111
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
112
|
+
}
|
|
113
|
+
this._gridOptions.columnApi.applyColumnState({ state: state.map(s => this.buildColState(s)) });
|
|
114
|
+
}
|
|
115
|
+
getColumnsState() {
|
|
116
|
+
if (this._grid === undefined) {
|
|
117
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
118
|
+
}
|
|
119
|
+
const colState = this._gridOptions.columnApi.getColumnState();
|
|
120
|
+
return colState.map(s => {
|
|
121
|
+
const def = this._gridOptions.columnApi.getColumn(s.colId).getColDef();
|
|
122
|
+
const label = def.headerName;
|
|
123
|
+
const name = def.checkboxSelection ? "__SELECTION__" : s.colId;
|
|
124
|
+
const colState = { label, name };
|
|
125
|
+
this.conditionalSet(colState, "sort", s.sort);
|
|
126
|
+
this.conditionalSet(colState, "sortIndex", s.sortIndex);
|
|
127
|
+
this.conditionalSet(colState, "width", s.width);
|
|
128
|
+
this.conditionalSet(colState, "pinned", s.pinned !== null);
|
|
129
|
+
this.conditionalSet(colState, "hidden", s.hide);
|
|
130
|
+
return colState;
|
|
131
|
+
}).filter(c => c.name !== "__SELECTION__");
|
|
132
|
+
}
|
|
133
|
+
getSelection() {
|
|
134
|
+
return this._gridOptions.api.getSelectedRows();
|
|
135
|
+
}
|
|
136
|
+
addColumnMenuItem(item) {
|
|
137
|
+
this._menuItems.push(item);
|
|
138
|
+
}
|
|
139
|
+
nextPage() {
|
|
140
|
+
this._gridOptions.api.paginationGoToNextPage();
|
|
141
|
+
}
|
|
142
|
+
previousPage() {
|
|
143
|
+
this._gridOptions.api.paginationGoToPreviousPage();
|
|
144
|
+
}
|
|
145
|
+
buildColDef(source) {
|
|
146
|
+
return {
|
|
147
|
+
headerName: source.label,
|
|
148
|
+
field: source.name,
|
|
149
|
+
sortable: true,
|
|
150
|
+
resizable: true,
|
|
151
|
+
headerComponentParams: {
|
|
152
|
+
template: HeaderColumnTemplate
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
buildColState(source) {
|
|
157
|
+
return {
|
|
158
|
+
colId: source.name,
|
|
159
|
+
sort: source.sort,
|
|
160
|
+
sortIndex: source.sortIndex,
|
|
161
|
+
width: source.width,
|
|
162
|
+
pinned: source.pinned ? "left" : null,
|
|
163
|
+
hide: source.hidden
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
onCallStateChange(type, e) {
|
|
167
|
+
const finished = !("finished" in e) || e["finished"];
|
|
168
|
+
if (finished && this._columnStateChangeCallback) {
|
|
169
|
+
this._columnStateChangeCallback(type, this.getColumnsState());
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
onSelectionChange(e) {
|
|
173
|
+
if (this._selectionChangeCallback) {
|
|
174
|
+
this._selectionChangeCallback(e.api.getSelectedRows());
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
onPaginationChange() {
|
|
178
|
+
if (this._paginationChangeCallback) {
|
|
179
|
+
if (this._gridOptions.api) {
|
|
180
|
+
const api = this._gridOptions.api;
|
|
181
|
+
const currentPage = api.paginationGetCurrentPage();
|
|
182
|
+
const isLastPage = api.paginationGetTotalPages() === (currentPage + 1);
|
|
183
|
+
const pageSize = api.paginationGetPageSize();
|
|
184
|
+
const totalRows = api.paginationGetRowCount();
|
|
185
|
+
const pageStart = currentPage * pageSize + 1;
|
|
186
|
+
const pageEnd = Math.min(totalRows, (currentPage + 1) * pageSize);
|
|
187
|
+
this._paginationChangeCallback({
|
|
188
|
+
hasPrevious: currentPage > 0,
|
|
189
|
+
hasNext: !isLastPage,
|
|
190
|
+
currentPage: currentPage + 1,
|
|
191
|
+
pageStart,
|
|
192
|
+
pageEnd,
|
|
193
|
+
totalRows
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
conditionalSet(host, attribute, value) {
|
|
199
|
+
if (value !== null && value !== undefined && value !== false) {
|
|
200
|
+
host[attribute] = value;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import Server from "./mock/Server";
|
|
2
|
+
export default class DataSource {
|
|
3
|
+
constructor(dataUnit, serverURL) {
|
|
4
|
+
this._dataUnit = dataUnit;
|
|
5
|
+
this._serverURL = serverURL;
|
|
6
|
+
}
|
|
7
|
+
getRows(params) {
|
|
8
|
+
if (this._useMockedServer) {
|
|
9
|
+
if (this._mockedServer === undefined) {
|
|
10
|
+
this.loadData()
|
|
11
|
+
.then(data => {
|
|
12
|
+
this._mockedServer = new Server(data.rowData);
|
|
13
|
+
params.success(this._mockedServer.getData(params.request));
|
|
14
|
+
})
|
|
15
|
+
.catch(() => params.fail());
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
params.success(this._mockedServer.getData(params.request));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
this.loadData()
|
|
23
|
+
.then(data => params.success(data))
|
|
24
|
+
.catch(() => params.fail());
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
loadData() {
|
|
28
|
+
return new Promise((resolve, reject) => {
|
|
29
|
+
if (this._dataUnit) {
|
|
30
|
+
this._dataUnit.loadData().then(rowData => resolve({ rowData, rowCount: rowData.length }));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
fetch(this._serverURL)
|
|
34
|
+
.then(response => {
|
|
35
|
+
response.json().then(rowData => resolve({ rowData }));
|
|
36
|
+
})
|
|
37
|
+
.catch(() => reject());
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const gridTerms = {
|
|
2
|
+
// for filter panel
|
|
3
|
+
page: "Página",
|
|
4
|
+
more: "mais",
|
|
5
|
+
to: "para",
|
|
6
|
+
of: "de",
|
|
7
|
+
next: "Próximo",
|
|
8
|
+
last: "Último",
|
|
9
|
+
first: "Primeiro",
|
|
10
|
+
previous: "Anterior",
|
|
11
|
+
loadingOoo: "Carregar",
|
|
12
|
+
// for set filter
|
|
13
|
+
selectAll: "Selecionar tudo",
|
|
14
|
+
searchOoo: "Procurar",
|
|
15
|
+
blanks: "Vazio",
|
|
16
|
+
// for number filter and text filter
|
|
17
|
+
filterOoo: "Filtrar",
|
|
18
|
+
applyFilter: "Aplicar filtro",
|
|
19
|
+
// for number filter
|
|
20
|
+
equals: "Igual",
|
|
21
|
+
lessThan: "Menor que",
|
|
22
|
+
greaterThan: "Maior que",
|
|
23
|
+
// for text filter
|
|
24
|
+
contains: "Contém",
|
|
25
|
+
startsWith: "Começa com",
|
|
26
|
+
endsWith: "Termina com",
|
|
27
|
+
// the header of the default group column
|
|
28
|
+
group: "Grupo",
|
|
29
|
+
// tool panel
|
|
30
|
+
columns: "Colunas",
|
|
31
|
+
rowGroupColumns: "Colunas do grupo de linhas",
|
|
32
|
+
rowGroupColumnsEmptyMessage: "Colunas do grupo de linhas vazias",
|
|
33
|
+
valueColumns: "Valores das colunas",
|
|
34
|
+
pivotMode: "Modo pivô",
|
|
35
|
+
groups: "Grupos",
|
|
36
|
+
values: "Valores",
|
|
37
|
+
pivots: "Pivôs",
|
|
38
|
+
valueColumnsEmptyMessage: "Valores de colunas vazias",
|
|
39
|
+
pivotColumnsEmptyMessage: "Pivôs de colunas vazias",
|
|
40
|
+
toolPanelButton: "Botão de painel de ferramentas",
|
|
41
|
+
// other
|
|
42
|
+
noRowsToShow: "Não há registros para mostrar.",
|
|
43
|
+
// enterprise menu
|
|
44
|
+
pinColumn: "Fixar coluna",
|
|
45
|
+
valueAggregation: "Agregar valor",
|
|
46
|
+
autosizeThiscolumn: "Redimensionar esta coluna",
|
|
47
|
+
autosizeAllColumns: "Redimensionar todas colunas",
|
|
48
|
+
groupBy: "Agrupar por",
|
|
49
|
+
ungroupBy: "Desagrupar por",
|
|
50
|
+
resetColumns: "Resetar colunas",
|
|
51
|
+
expandAll: "Expandir tudo",
|
|
52
|
+
collapseAll: "Contrair tudo",
|
|
53
|
+
toolPanel: "Painel de ferramentas",
|
|
54
|
+
export: "Exportar",
|
|
55
|
+
csvExport: "Exportar para CSV",
|
|
56
|
+
excelExport: "Exportar para Excel",
|
|
57
|
+
// enterprise menu pinning
|
|
58
|
+
pinLeft: "Fixar coluna",
|
|
59
|
+
pinRight: "Fixar a direita",
|
|
60
|
+
noPin: "Desfixar coluna",
|
|
61
|
+
// enterprise menu aggregation and status panel
|
|
62
|
+
sum: "Soma",
|
|
63
|
+
min: "Mínimo",
|
|
64
|
+
max: "Máximo",
|
|
65
|
+
none: "Nenhum",
|
|
66
|
+
count: "Contagem",
|
|
67
|
+
average: "Média",
|
|
68
|
+
// standard menu
|
|
69
|
+
copy: "Copiar",
|
|
70
|
+
copyWithHeaders: "Copiar com cabeçalho",
|
|
71
|
+
ctrlC: "Ctrl+C",
|
|
72
|
+
paste: "Colar",
|
|
73
|
+
ctrlV: "Ctrl+V"
|
|
74
|
+
};
|
|
75
|
+
export default gridTerms;
|
|
@@ -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
|
+
}
|