@sankhyalabs/ezui 1.1.94 → 1.1.97
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/{CSSVarsUtils-66e86394.js → CSSVarsUtils-8fbdf2e0.js} +1 -0
- package/dist/cjs/StringUtils-0ba09df4.js +57 -0
- package/dist/cjs/UnitMetadata-2e11c5d3.js +1310 -0
- package/dist/cjs/ez-button_3.cjs.entry.js +578 -0
- package/dist/cjs/ez-calendar_14.cjs.entry.js +2657 -0
- package/dist/cjs/{ez-button_11.cjs.entry.js → ez-grid.cjs.entry.js} +27 -1501
- package/dist/cjs/ez-icon.cjs.entry.js +42 -0
- package/dist/cjs/ez-modal_2.cjs.entry.js +317 -0
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +7 -7
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-check/ez-check.css +4 -3
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +52 -3
- package/dist/collection/components/ez-form/DataBinder.js +13 -0
- package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +4 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.js +4 -4
- package/dist/collection/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.js +2 -2
- package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +2 -2
- package/dist/collection/components/ez-form/fieldbuilder/tpl/FileInput.tpl.js +2 -2
- package/dist/collection/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.js +6 -6
- package/dist/collection/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.js +2 -2
- package/dist/collection/components/ez-form/fieldbuilder/tpl/TextArea.tpl.js +2 -2
- package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +14 -8
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +3 -2
- package/dist/collection/components/ez-grid/ez-grid.css +8 -0
- package/dist/collection/components/ez-grid/ez-grid.js +3 -3
- package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +28 -4
- package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +6 -5
- package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +10 -7
- package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.js +12 -17
- package/dist/collection/components/ez-icon/ez-icon.css +5 -0
- package/dist/collection/components/ez-list/ez-list.js +2 -2
- package/dist/collection/components/ez-text-input/ez-text-input.css +2 -2
- package/dist/collection/components/ez-text-input/ez-text-input.js +24 -1
- package/dist/collection/components/test-du/test-du.js +1 -1
- package/dist/collection/utils/CSSVarsUtils.js +1 -0
- package/dist/custom-elements/index.js +290 -6376
- package/dist/esm/{CSSVarsUtils-aeee9825.js → CSSVarsUtils-667e0016.js} +1 -0
- package/dist/esm/StringUtils-cbf10229.js +55 -0
- package/dist/esm/UnitMetadata-8b1bbaa2.js +1304 -0
- package/dist/esm/ez-button_3.entry.js +572 -0
- package/dist/esm/ez-calendar_14.entry.js +2640 -0
- package/dist/esm/{ez-button_11.entry.js → ez-grid.entry.js} +23 -1487
- package/dist/esm/ez-icon.entry.js +38 -0
- package/dist/esm/ez-modal_2.entry.js +312 -0
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +2 -2
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-07b60fe9.js +1 -0
- package/dist/ezui/p-2336c9ce.entry.js +1 -0
- package/dist/ezui/p-2f84ba72.js +1 -0
- package/dist/ezui/{p-4b5c4408.entry.js → p-45a25c30.entry.js} +1 -1
- package/dist/ezui/{p-ca42d682.entry.js → p-532b5b24.entry.js} +46 -46
- package/dist/ezui/p-614fbb4e.entry.js +1 -0
- package/dist/ezui/p-7165ac4f.entry.js +1 -0
- package/dist/ezui/p-90f6d8a0.entry.js +1 -0
- package/dist/ezui/{p-7e1d9c29.entry.js → p-d3f87e18.entry.js} +1 -1
- package/dist/ezui/p-d54c157f.js +1 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +8 -0
- package/dist/types/components/ez-form/DataBinder.d.ts +1 -0
- package/dist/types/components/ez-form/ez-form.d.ts +6 -1
- package/dist/types/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.d.ts +2 -1
- package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +2 -1
- package/dist/types/components/ez-form/fieldbuilder/tpl/FileInput.tpl.d.ts +2 -1
- package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +4 -2
- package/dist/types/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.d.ts +2 -1
- package/dist/types/components/ez-form/fieldbuilder/tpl/TextArea.tpl.d.ts +2 -1
- package/dist/types/components/ez-grid/subcomponents/select-box/select-box.d.ts +6 -4
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +4 -0
- package/dist/types/components.d.ts +26 -2
- package/package.json +2 -2
- package/dist/cjs/ApplicationUtils-d1c1db56.js +0 -35
- package/dist/cjs/ez-calendar.cjs.entry.js +0 -224
- package/dist/cjs/ez-collapsible-box_7.cjs.entry.js +0 -853
- package/dist/cjs/ez-combo-box.cjs.entry.js +0 -254
- package/dist/cjs/ez-form.cjs.entry.js +0 -753
- package/dist/cjs/index-5c8eb919.js +0 -7460
- package/dist/esm/ApplicationUtils-01280a9d.js +0 -33
- package/dist/esm/ez-calendar.entry.js +0 -220
- package/dist/esm/ez-collapsible-box_7.entry.js +0 -843
- package/dist/esm/ez-combo-box.entry.js +0 -250
- package/dist/esm/ez-form.entry.js +0 -749
- package/dist/esm/index-4688c617.js +0 -7452
- package/dist/ezui/p-278ce681.entry.js +0 -1
- package/dist/ezui/p-33d1247f.entry.js +0 -1
- package/dist/ezui/p-5793a2e1.entry.js +0 -1
- package/dist/ezui/p-68f6b75e.entry.js +0 -1
- package/dist/ezui/p-7107d7ef.js +0 -1
- package/dist/ezui/p-7ff8b7f7.js +0 -1
- package/dist/ezui/p-8b099482.js +0 -1
|
@@ -15,6 +15,14 @@ export class EzComboBox {
|
|
|
15
15
|
* Ajusta a opção de mostrar o "value" para cada opção. Por padrão não mostra
|
|
16
16
|
*/
|
|
17
17
|
this.showOptionValue = false;
|
|
18
|
+
/**
|
|
19
|
+
* Remove a opção vazia da lista de opções
|
|
20
|
+
*/
|
|
21
|
+
this.suppressEmptyOption = false;
|
|
22
|
+
/**
|
|
23
|
+
* Permite exibir a mensagem de erro.
|
|
24
|
+
*/
|
|
25
|
+
this.canShowError = true;
|
|
18
26
|
}
|
|
19
27
|
internalUpdate() {
|
|
20
28
|
if (this._inputElement) {
|
|
@@ -45,7 +53,12 @@ export class EzComboBox {
|
|
|
45
53
|
const upperCriteria = this._criteria.toUpperCase();
|
|
46
54
|
opts = opts.filter(opt => opt.label.toLocaleUpperCase().indexOf(upperCriteria) > -1);
|
|
47
55
|
}
|
|
48
|
-
this.
|
|
56
|
+
if (this.suppressEmptyOption) {
|
|
57
|
+
this._visibleOptions = opts;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
this._visibleOptions = [{ value: undefined, label: "" }].concat(opts);
|
|
61
|
+
}
|
|
49
62
|
}
|
|
50
63
|
buildItem(opt, index) {
|
|
51
64
|
return h("li", { class: index === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.selectOption(opt), onMouseOver: () => this._preSelection = undefined },
|
|
@@ -59,7 +72,7 @@ export class EzComboBox {
|
|
|
59
72
|
//FIXME: Provavelmente isso fará com que o popup abra em uma
|
|
60
73
|
//posição errada no futuro. Preferi fazer simples no começo,
|
|
61
74
|
//porque não quis onerar o text input com essa funcionalidade...
|
|
62
|
-
const top = this.errorMessage ? "0px" : "-17px";
|
|
75
|
+
const top = (this.errorMessage || !this.canShowError) ? "0px" : "-17px";
|
|
63
76
|
this._floatingID = FloatingManager.float(this._optionsList, this._listContainer, { autoClose: true, top });
|
|
64
77
|
window.requestAnimationFrame(() => {
|
|
65
78
|
this._optionsList.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
@@ -232,7 +245,7 @@ export class EzComboBox {
|
|
|
232
245
|
}
|
|
233
246
|
render() {
|
|
234
247
|
return (h(Host, null,
|
|
235
|
-
h("ez-text-input", { ref: elem => this._inputElement = elem, enabled: this.enabled, onInput: evt => this.onTextInputChangeHandler(evt), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onEzChange: event => event.stopPropagation(), onKeyDown: event => this.keyDownHandler(event), label: this.label, value: this.getText(), errorMessage: this.errorMessage }, this.searchMode ?
|
|
248
|
+
h("ez-text-input", { ref: elem => this._inputElement = elem, enabled: this.enabled, onInput: evt => this.onTextInputChangeHandler(evt), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onEzChange: event => event.stopPropagation(), onKeyDown: event => this.keyDownHandler(event), label: this.label, value: this.getText(), canShowError: this.canShowError, errorMessage: this.errorMessage }, this.searchMode ?
|
|
236
249
|
h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-search", onClick: () => { this.loadOptions("ADVANCED"); }, slot: "leftIcon" })
|
|
237
250
|
:
|
|
238
251
|
h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-options", slot: "rightIcon", onClick: () => this.showOptions() })),
|
|
@@ -414,6 +427,42 @@ export class EzComboBox {
|
|
|
414
427
|
"tags": [],
|
|
415
428
|
"text": "Fun\u00E7\u00E3o respons\u00E1vel por carregar as op\u00E7\u00F5es dinamicamente"
|
|
416
429
|
}
|
|
430
|
+
},
|
|
431
|
+
"suppressEmptyOption": {
|
|
432
|
+
"type": "boolean",
|
|
433
|
+
"mutable": false,
|
|
434
|
+
"complexType": {
|
|
435
|
+
"original": "boolean",
|
|
436
|
+
"resolved": "boolean",
|
|
437
|
+
"references": {}
|
|
438
|
+
},
|
|
439
|
+
"required": false,
|
|
440
|
+
"optional": false,
|
|
441
|
+
"docs": {
|
|
442
|
+
"tags": [],
|
|
443
|
+
"text": "Remove a op\u00E7\u00E3o vazia da lista de op\u00E7\u00F5es"
|
|
444
|
+
},
|
|
445
|
+
"attribute": "suppress-empty-option",
|
|
446
|
+
"reflect": false,
|
|
447
|
+
"defaultValue": "false"
|
|
448
|
+
},
|
|
449
|
+
"canShowError": {
|
|
450
|
+
"type": "boolean",
|
|
451
|
+
"mutable": false,
|
|
452
|
+
"complexType": {
|
|
453
|
+
"original": "boolean",
|
|
454
|
+
"resolved": "boolean",
|
|
455
|
+
"references": {}
|
|
456
|
+
},
|
|
457
|
+
"required": false,
|
|
458
|
+
"optional": false,
|
|
459
|
+
"docs": {
|
|
460
|
+
"tags": [],
|
|
461
|
+
"text": "Permite exibir a mensagem de erro."
|
|
462
|
+
},
|
|
463
|
+
"attribute": "can-show-error",
|
|
464
|
+
"reflect": true,
|
|
465
|
+
"defaultValue": "true"
|
|
417
466
|
}
|
|
418
467
|
}; }
|
|
419
468
|
static get states() { return {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ApplicationContext } from "@sankhyalabs/core";
|
|
1
2
|
export default class DataBinder {
|
|
2
3
|
constructor(dataUnit) {
|
|
3
4
|
this._fields = new Map();
|
|
@@ -25,6 +26,7 @@ export default class DataBinder {
|
|
|
25
26
|
oldBind.destroy();
|
|
26
27
|
}
|
|
27
28
|
this._fields.set(fieldName, Bind.create(fieldName, field, (fieldName, newValue) => this.setFieldValue(fieldName, newValue)));
|
|
29
|
+
this.bindSearchOptionsLoader(fieldName, field);
|
|
28
30
|
}
|
|
29
31
|
setFieldValue(fieldName, newValue) {
|
|
30
32
|
if (this._dataUnit.records.length === 0) {
|
|
@@ -32,6 +34,17 @@ export default class DataBinder {
|
|
|
32
34
|
}
|
|
33
35
|
this._dataUnit.setFieldValue(fieldName, newValue);
|
|
34
36
|
}
|
|
37
|
+
bindSearchOptionsLoader(fieldName, field) {
|
|
38
|
+
if (field.nodeName === "EZ-SEARCH" && field["optionLoader"] === undefined) {
|
|
39
|
+
const loader = ApplicationContext.getContextValue("__EZUI__SEARCH__OPTION__LOADER__");
|
|
40
|
+
if (loader) {
|
|
41
|
+
const fm = this._dataUnit.getField(fieldName);
|
|
42
|
+
field["optionLoader"] = (arg) => {
|
|
43
|
+
loader(arg, fm.properties, this._dataUnit);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
35
48
|
}
|
|
36
49
|
class Bind {
|
|
37
50
|
destroy() {
|
|
@@ -24,7 +24,6 @@ export const buildField = (field) => {
|
|
|
24
24
|
let builder;
|
|
25
25
|
let props;
|
|
26
26
|
if (descriptor) {
|
|
27
|
-
builder = uiBuilders.get(descriptor.userInterface);
|
|
28
27
|
if (!config.label) {
|
|
29
28
|
config.label = descriptor.label;
|
|
30
29
|
}
|
|
@@ -34,7 +33,11 @@ export const buildField = (field) => {
|
|
|
34
33
|
if (config.required === undefined) {
|
|
35
34
|
config.required = descriptor.required;
|
|
36
35
|
}
|
|
36
|
+
if (config.readOnly === undefined) {
|
|
37
|
+
config.readOnly = descriptor.readOnly;
|
|
38
|
+
}
|
|
37
39
|
props = descriptor.properties;
|
|
40
|
+
builder = uiBuilders.get(descriptor.userInterface);
|
|
38
41
|
}
|
|
39
42
|
if (config.required) {
|
|
40
43
|
config.label = `* ${config.label} (obrigatório)`;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
export const buildSwitch = (fieldConfig) => {
|
|
3
|
-
return buildField(fieldConfig.name, fieldConfig.label, true);
|
|
3
|
+
return buildField(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, true);
|
|
4
4
|
};
|
|
5
5
|
export const buildCheckBox = (fieldConfig) => {
|
|
6
|
-
return buildField(fieldConfig.name, fieldConfig.label, false);
|
|
6
|
+
return buildField(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, false);
|
|
7
7
|
};
|
|
8
|
-
function buildField(fieldName, fieldLabel, switchMode = false) {
|
|
8
|
+
function buildField(fieldName, fieldLabel, readOnly, switchMode = false) {
|
|
9
9
|
return (h("div", { class: "col col--sd-12 col--tb-3 padding--small align--middle padding-bottom--large" },
|
|
10
|
-
h("ez-check", { label: fieldLabel, mode: switchMode ? "switch" : "regular", "data-field-name": fieldName, key: fieldName })));
|
|
10
|
+
h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? "switch" : "regular", "data-field-name": fieldName, key: fieldName })));
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const buildComboBox = ({ name, label }, properties) => {
|
|
2
|
+
export const buildComboBox = ({ name, label, readOnly }, properties) => {
|
|
3
3
|
const prop = properties === null || properties === void 0 ? void 0 : properties.options;
|
|
4
4
|
let options;
|
|
5
5
|
if (typeof prop === "string") {
|
|
@@ -10,5 +10,5 @@ export const buildComboBox = ({ name, label }, properties) => {
|
|
|
10
10
|
options = prop;
|
|
11
11
|
}
|
|
12
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 })));
|
|
13
|
+
h("ez-combo-box", { enabled: !readOnly, label: label, "data-field-name": name, key: name, options: options })));
|
|
14
14
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const buildDate = ({ name, label }) => {
|
|
2
|
+
export const buildDate = ({ name, label, readOnly }) => {
|
|
3
3
|
return (h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
4
|
-
h("ez-date-input", { label: label, "data-field-name": name, key: name })));
|
|
4
|
+
h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
5
5
|
};
|
|
6
6
|
export const buildTimeDate = ({ name, label }) => {
|
|
7
7
|
return (h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const buildFile = ({ name, label }) => {
|
|
2
|
+
export const buildFile = ({ name, label, readOnly }) => {
|
|
3
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 })));
|
|
4
|
+
h("ez-upload", { enabled: !readOnly, label: label, urlUpload: "", requestHeaders: "", maxFiles: 10, "data-field-name": name, key: name })));
|
|
5
5
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const buildDecimal = ({ name, label }, properties) => {
|
|
2
|
+
export const buildDecimal = ({ name, label, readOnly }, properties) => {
|
|
3
3
|
const precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
|
|
4
4
|
const prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
|
|
5
|
-
return buildNumeric(name, label, precision, prettyPrecision);
|
|
5
|
+
return buildNumeric(name, label, readOnly, precision, prettyPrecision);
|
|
6
6
|
};
|
|
7
|
-
export const buildInteger = ({ name, label }) => {
|
|
8
|
-
return buildNumeric(name, label, 0, 0);
|
|
7
|
+
export const buildInteger = ({ name, label, readOnly }) => {
|
|
8
|
+
return buildNumeric(name, label, readOnly, 0, 0);
|
|
9
9
|
};
|
|
10
|
-
function buildNumeric(fieldName, fieldLabel, precision, prettyPrecision) {
|
|
10
|
+
function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision) {
|
|
11
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 })));
|
|
12
|
+
h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
|
|
13
13
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const buildSearch = ({ name, label }) => {
|
|
2
|
+
export const buildSearch = ({ name, label, readOnly }) => {
|
|
3
3
|
return (h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
4
|
-
h("ez-search", {
|
|
4
|
+
h("ez-search", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const buildTextArea = ({ name, label }) => {
|
|
2
|
+
export const buildTextArea = ({ name, label, readOnly }) => {
|
|
3
3
|
return (h("div", { class: "col col--sd-12 padding--small", key: name },
|
|
4
|
-
h("ez-text-area", { label: label, "data-field-name": name })));
|
|
4
|
+
h("ez-text-area", { enabled: !readOnly, label: label, "data-field-name": name })));
|
|
5
5
|
};
|
|
@@ -42,6 +42,10 @@ export const buildFromDataUnit = (dataUnit) => {
|
|
|
42
42
|
}
|
|
43
43
|
return metadata;
|
|
44
44
|
};
|
|
45
|
+
function getTabConfig(tab, sheets) {
|
|
46
|
+
const tabConfig = (typeof tab === "string" ? Array.from(sheets.keys()).find(t => t.label === tab) : tab);
|
|
47
|
+
return tabConfig || { label: tab, visible: true };
|
|
48
|
+
}
|
|
45
49
|
export const buildFromConfig = (fields, dataUnit) => {
|
|
46
50
|
const sheets = new Map();
|
|
47
51
|
const requiredFields = [];
|
|
@@ -49,12 +53,13 @@ export const buildFromConfig = (fields, dataUnit) => {
|
|
|
49
53
|
fields.forEach(config => {
|
|
50
54
|
var _a;
|
|
51
55
|
if (config.visible !== false) {
|
|
52
|
-
const
|
|
56
|
+
const tabConfig = getTabConfig(config.tab || "Geral", sheets);
|
|
53
57
|
const descriptor = dataUnit.getField(config.name);
|
|
54
|
-
if (descriptor) {
|
|
55
|
-
if (!sheets.has(
|
|
56
|
-
sheets.set(
|
|
58
|
+
if (descriptor && tabConfig.visible) {
|
|
59
|
+
if (!sheets.has(tabConfig)) {
|
|
60
|
+
sheets.set(tabConfig, new Map());
|
|
57
61
|
}
|
|
62
|
+
const tabItens = sheets.get(tabConfig);
|
|
58
63
|
const isRequired = config.required === undefined ? descriptor.required : config.required;
|
|
59
64
|
if (isRequired) {
|
|
60
65
|
requiredFields.push(config.name);
|
|
@@ -63,7 +68,6 @@ export const buildFromConfig = (fields, dataUnit) => {
|
|
|
63
68
|
if (clearOnCopy) {
|
|
64
69
|
cleanOnCopyFields.push(config.name);
|
|
65
70
|
}
|
|
66
|
-
const tabItens = sheets.get(tab);
|
|
67
71
|
const fieldMD = { config, descriptor };
|
|
68
72
|
const group = config.group;
|
|
69
73
|
if (group) {
|
|
@@ -82,10 +86,12 @@ export const buildFromConfig = (fields, dataUnit) => {
|
|
|
82
86
|
}
|
|
83
87
|
});
|
|
84
88
|
const metadata = new FormMetadata();
|
|
85
|
-
sheets.
|
|
89
|
+
Array.from(sheets.entries())
|
|
90
|
+
.sort((a, b) => (a[0].order || 10000) - (b[0].order || 10000))
|
|
91
|
+
.forEach(([key, value]) => {
|
|
86
92
|
metadata.addSheet({
|
|
87
|
-
label: key,
|
|
88
|
-
name: key,
|
|
93
|
+
label: key.label,
|
|
94
|
+
name: key.label,
|
|
89
95
|
items: Array.from(value.values()),
|
|
90
96
|
requiredFields,
|
|
91
97
|
cleanOnCopyFields
|
|
@@ -97,8 +97,9 @@ export default class AgGridController {
|
|
|
97
97
|
headerName: "",
|
|
98
98
|
checkboxSelection: true,
|
|
99
99
|
headerCheckboxSelection: false,
|
|
100
|
-
width:
|
|
101
|
-
suppressMovable: true
|
|
100
|
+
width: 24,
|
|
101
|
+
suppressMovable: true,
|
|
102
|
+
suppressMenu: true
|
|
102
103
|
});
|
|
103
104
|
}
|
|
104
105
|
cols.forEach(c => {
|
|
@@ -14,6 +14,14 @@
|
|
|
14
14
|
align-items: center;
|
|
15
15
|
|
|
16
16
|
/*public*/
|
|
17
|
+
background-color: var(--ezgrid__header--background-color, #FFF);
|
|
18
|
+
z-index: var(--visible);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.grid__container{
|
|
22
|
+
box-shadow: 0 0 16px 0 rgb(0 38 111 / 12%);
|
|
23
|
+
padding-top: 15px;
|
|
24
|
+
margin-top: -12px;
|
|
17
25
|
background-color: var(--ezgrid__header--background-color);
|
|
18
26
|
}
|
|
19
27
|
|
|
@@ -91,8 +91,8 @@ export class EzGrid {
|
|
|
91
91
|
h("div", { class: "text text--primary text--medium margin-right--medium" },
|
|
92
92
|
h("strong", { class: "text text--primary text--medium" }, `${this._navigationFirstRow}-${this._navigationLastRow}`),
|
|
93
93
|
` de ${this._navigationTotalRows}`),
|
|
94
|
-
h("ez-button", { size: "small", iconName: "chevron-left", class: "
|
|
95
|
-
h("ez-button", { size: "small", iconName: "chevron-right", class: "
|
|
94
|
+
h("ez-button", { size: "small", iconName: "chevron-left", class: "margin-right--medium", mode: "icon", enabled: this._navigationHasPrevious, onClick: () => this._gridController.previousPage(), label: "P\u00E1gina anterior" }),
|
|
95
|
+
h("ez-button", { size: "small", iconName: "chevron-right", class: "margin-right--medium", mode: "icon", enabled: this._navigationHasNext, onClick: () => this._gridController.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })
|
|
96
96
|
];
|
|
97
97
|
}
|
|
98
98
|
applyConfig(cols) {
|
|
@@ -109,7 +109,7 @@ export class EzGrid {
|
|
|
109
109
|
}
|
|
110
110
|
render() {
|
|
111
111
|
return (h(Host, null,
|
|
112
|
-
h("div", { class: "box box--shadow padding--medium grid-header
|
|
112
|
+
h("div", { class: "box box--shadow padding--medium grid-header" },
|
|
113
113
|
h("div", { class: "grid-header__container" },
|
|
114
114
|
h("slot", { name: "leftButtons" })),
|
|
115
115
|
h("div", { class: "grid-header__container" },
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
--ez-grid-config__title--font-family: var(--font-pattern, "Sora");
|
|
19
19
|
|
|
20
|
-
--ez-grid-config__title--font-weight: var(--text-weight--large,
|
|
20
|
+
--ez-grid-config__title--font-weight: var(--text-weight--large, 700);
|
|
21
21
|
|
|
22
22
|
/*@doc Define o tamanho da fonte utilizada para o subtitulo do componente.*/
|
|
23
23
|
--ez-grid-config__subtitle--font-size: var(--text--medium, 14px);
|
|
@@ -31,6 +31,15 @@
|
|
|
31
31
|
/*@doc Define o raio da borda da barra de rolagem do componente.*/
|
|
32
32
|
--ez-grid-config__main__scrollbar--border-radius: var(--border--radius-medium, 12px);
|
|
33
33
|
|
|
34
|
+
/* @doc Define o estilo do texto do grupo da lista. */
|
|
35
|
+
--ez-grid__group--font-family: var(--font-pattern, "Sora");
|
|
36
|
+
/* @doc Define o tamanho do texto do grupo da lista. */
|
|
37
|
+
--ez-grid__group--font-size: var(--text--medium, 14px);
|
|
38
|
+
/* @doc Define o peso do texto do grupo da lista. */
|
|
39
|
+
--ez-grid__group--font-weight: var(--text-weight--large, 600);
|
|
40
|
+
/* @doc Define o espaçamento inferior do grupo da lista. */
|
|
41
|
+
--ez-grid__group--padding-bottom: var(--space-small, 6px);
|
|
42
|
+
|
|
34
43
|
display: grid;
|
|
35
44
|
grid-template-rows: auto 1fr auto;
|
|
36
45
|
max-height: 100%;
|
|
@@ -44,6 +53,9 @@
|
|
|
44
53
|
ez-list {
|
|
45
54
|
height: 100%;
|
|
46
55
|
}
|
|
56
|
+
.heigth-calc{
|
|
57
|
+
max-height: calc(100% - 24px);
|
|
58
|
+
}
|
|
47
59
|
|
|
48
60
|
.grid-config__footer {
|
|
49
61
|
padding-top: var(--ez-grid-config__footer--padding-top);
|
|
@@ -71,21 +83,27 @@ ez-list {
|
|
|
71
83
|
|
|
72
84
|
.title-container {
|
|
73
85
|
display: flex;
|
|
74
|
-
justify-content:
|
|
86
|
+
justify-content: space-between;
|
|
75
87
|
align-items: center;
|
|
88
|
+
width: 359px;
|
|
76
89
|
}
|
|
77
90
|
|
|
78
91
|
.subtitle {
|
|
79
92
|
font-family: var(--ez-grid-config__subtitle--font-family);
|
|
80
93
|
font-size: var(--ez-grid-config__subtitle--font-size);
|
|
94
|
+
color: var(--text--primary);
|
|
81
95
|
}
|
|
82
96
|
|
|
83
97
|
.title {
|
|
84
98
|
display: flex;
|
|
85
|
-
font-family: var(--ez-grid-config__title--font-family);
|
|
86
99
|
margin: 0;
|
|
100
|
+
font-family: var(--ez-grid-config__title--font-family);
|
|
101
|
+
font-size: var(--title--large);
|
|
87
102
|
font-weight: var(--ez-grid-config__title--font-weight);
|
|
88
|
-
line-height:
|
|
103
|
+
line-height: normal;
|
|
104
|
+
letter-spacing: 0em;
|
|
105
|
+
text-align: left;
|
|
106
|
+
color: var(--title--primary);
|
|
89
107
|
}
|
|
90
108
|
|
|
91
109
|
.grid-config__main::-webkit-scrollbar-track {
|
|
@@ -102,4 +120,10 @@ ez-list {
|
|
|
102
120
|
width: var(--ez-grid-config__scrollbar--width);
|
|
103
121
|
max-width: var(--ez-grid-config__scrollbar--width);
|
|
104
122
|
min-width: var(--ez-grid-config__scrollbar--width);
|
|
123
|
+
}
|
|
124
|
+
.group-name {
|
|
125
|
+
font-family: var(--ez-grid__group--font-family);
|
|
126
|
+
font-size: var(--ez-grid__group--font-size);
|
|
127
|
+
font-weight: var(--ez-grid__group--font-weight);
|
|
128
|
+
padding-bottom: var(--ez-grid__group--padding-bottom);
|
|
105
129
|
}
|
|
@@ -65,7 +65,7 @@ export class GridConfig {
|
|
|
65
65
|
let newList = [...this.columns];
|
|
66
66
|
let newItem = newList.find(item => item.label === updatedItem.label);
|
|
67
67
|
if (newItem) {
|
|
68
|
-
newItem.sort = sortOrder;
|
|
68
|
+
newItem.sort = sortOrder.value;
|
|
69
69
|
}
|
|
70
70
|
this.columns = newList;
|
|
71
71
|
}
|
|
@@ -122,7 +122,7 @@ export class GridConfig {
|
|
|
122
122
|
searchingText = (_a = evt.currentTarget) === null || _a === void 0 ? void 0 : _a.value;
|
|
123
123
|
}
|
|
124
124
|
let newSelected = -1;
|
|
125
|
-
if (this.selectedTab === "Ordenação") {
|
|
125
|
+
if (this.selectedTab === "Ordenação das linhas") {
|
|
126
126
|
if (searchingText) {
|
|
127
127
|
const matchedIndexes = [];
|
|
128
128
|
let orderListDatasource;
|
|
@@ -210,7 +210,7 @@ export class GridConfig {
|
|
|
210
210
|
handleTabChange(ev) {
|
|
211
211
|
var _a;
|
|
212
212
|
if ((_a = ev === null || ev === void 0 ? void 0 : ev.target) === null || _a === void 0 ? void 0 : _a.selectedTab) {
|
|
213
|
-
if (ev.target.selectedTab === "Ordenação") {
|
|
213
|
+
if (ev.target.selectedTab === "Ordenação das linhas") {
|
|
214
214
|
this._columnListHistory = this._columnList.dataSource;
|
|
215
215
|
this.createOrderList();
|
|
216
216
|
}
|
|
@@ -249,13 +249,14 @@ export class GridConfig {
|
|
|
249
249
|
h("div", { class: "button-close" },
|
|
250
250
|
h("ez-button", { mode: 'icon', image: getSpritePath("close"), size: 'medium', onClick: () => this.closeConfig() }))),
|
|
251
251
|
h("div", { class: "tabselector-container" },
|
|
252
|
-
h("ez-tabselector", { selectedTab: this.selectedTab, selectedIndex: 0, onEzChange: (ev) => { this.handleTabChange(ev); }, tabs: 'Colunas, Ordena\u00E7\u00E3o' })),
|
|
252
|
+
h("ez-tabselector", { selectedTab: this.selectedTab, selectedIndex: 0, onEzChange: (ev) => { this.handleTabChange(ev); }, tabs: 'Colunas, Ordena\u00E7\u00E3o das linhas' })),
|
|
253
253
|
h("div", null,
|
|
254
254
|
h("ez-text-input", { ref: (el) => this._searchElement = el, label: "Localizar coluna", onKeyUp: evt => this.locateColumn(evt) },
|
|
255
255
|
h("ez-icon", { slot: "leftIcon", size: "medium", href: getSpritePath("search") })))),
|
|
256
256
|
h("div", { class: "grid-config__main" },
|
|
257
257
|
h("ez-list", { ref: (el) => this._columnList = el, class: this.selectedTab === "Colunas" ? "" : "hidden", dataSource: this._columListItems, onEzChange: ev => this.handleColumnListChange(ev), ezDraggable: true, ezSelectable: true, itemSlotBuilder: (item, group) => this.buildColumnListSlot(item, group), useGroups: true }),
|
|
258
|
-
h("
|
|
258
|
+
h("div", { class: this.selectedTab === "Ordenação das linhas" ? "group-name" : "hidden" }, "Sequ\u00EAncia da ordena\u00E7\u00E3o"),
|
|
259
|
+
h("ez-list", { ref: (el) => this._orderList = el, class: this.selectedTab === "Ordenação das linhas" ? "heigth-calc" : "hidden", dataSource: this._orderListItems, ezSelectable: true, ezDraggable: true, itemSlotBuilder: (item) => this.buildOrderListSlot(item) })),
|
|
259
260
|
h("div", { class: "grid-config__footer" },
|
|
260
261
|
h("ez-button", { class: "padding-right--medium", label: "Cancelar", onClick: () => this.closeConfig() }),
|
|
261
262
|
h("ez-button", { label: "Concluir", class: "button--primary", onClick: () => this.finish() }))));
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
|
|
2
|
+
ez-combo-box{
|
|
3
|
+
width: 100px;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.grid-config-combo{
|
|
7
|
+
--ez-text-input--height: 28px;
|
|
8
|
+
--ez-text-input__input--background-color: #fff;
|
|
9
|
+
--ez-text-input__input--border-color: #dce0e8;
|
|
10
|
+
}
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
import { Component, Event, h, Prop } from '@stencil/core';
|
|
2
2
|
export class SelectBox {
|
|
3
|
-
|
|
4
|
-
this.
|
|
5
|
-
}
|
|
6
|
-
componentDidRender() {
|
|
7
|
-
if (this._selectElem) {
|
|
8
|
-
if (this.selectedOption) {
|
|
9
|
-
this._selectElem.value = this.selectedOption;
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
this._selectElem.value = "na";
|
|
13
|
-
}
|
|
14
|
-
}
|
|
3
|
+
constructor() {
|
|
4
|
+
this.selectedOption = { value: "na", label: "N/A" };
|
|
15
5
|
}
|
|
16
6
|
render() {
|
|
17
|
-
return (h("
|
|
7
|
+
return (h("ez-combo-box", { class: "grid-config-combo inverted", label: "", value: this.selectedOption, enabled: true, canShowError: false, suppressEmptyOption: true },
|
|
18
8
|
h("option", { value: "na" }, "N/A"),
|
|
19
9
|
h("option", { value: "asc" }, "A-Z"),
|
|
20
10
|
h("option", { value: "desc" }, "Z-A")));
|
|
@@ -33,9 +23,13 @@ export class SelectBox {
|
|
|
33
23
|
"type": "string",
|
|
34
24
|
"mutable": false,
|
|
35
25
|
"complexType": {
|
|
36
|
-
"original": "string",
|
|
37
|
-
"resolved": "string",
|
|
38
|
-
"references": {
|
|
26
|
+
"original": "Option|string",
|
|
27
|
+
"resolved": "Option | string",
|
|
28
|
+
"references": {
|
|
29
|
+
"Option": {
|
|
30
|
+
"location": "global"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
39
33
|
},
|
|
40
34
|
"required": false,
|
|
41
35
|
"optional": false,
|
|
@@ -44,7 +38,8 @@ export class SelectBox {
|
|
|
44
38
|
"text": ""
|
|
45
39
|
},
|
|
46
40
|
"attribute": "selected-option",
|
|
47
|
-
"reflect": false
|
|
41
|
+
"reflect": false,
|
|
42
|
+
"defaultValue": "{value: \"na\", label: \"N/A\"}"
|
|
48
43
|
}
|
|
49
44
|
}; }
|
|
50
45
|
static get events() { return [{
|
|
@@ -37,6 +37,11 @@ svg {
|
|
|
37
37
|
width: 30px;
|
|
38
38
|
height: 30px;
|
|
39
39
|
}
|
|
40
|
+
|
|
41
|
+
[class^="ez-icon-"], [class*=" ez-icon-"] {
|
|
42
|
+
color: var(--ez-icon--color);
|
|
43
|
+
}
|
|
44
|
+
|
|
40
45
|
/*
|
|
41
46
|
START CSS GENERATED BY EZ-DESIGN ICONS, SEE MORE AT ez-design\scripts\fontsGenerator.js.
|
|
42
47
|
WHEN ADD NEW ICONS THIS CSS NEED TO BE UPDATED
|
|
@@ -55,7 +55,7 @@ export class EzList {
|
|
|
55
55
|
newList.forEach(groupItem => {
|
|
56
56
|
groupItem.items.forEach(item => {
|
|
57
57
|
if (item.label == selectedItem.label) {
|
|
58
|
-
item.selected =
|
|
58
|
+
item.selected = true;
|
|
59
59
|
}
|
|
60
60
|
else {
|
|
61
61
|
item.selected = false;
|
|
@@ -68,7 +68,7 @@ export class EzList {
|
|
|
68
68
|
let newList = [...this._listItems];
|
|
69
69
|
newList.forEach(item => {
|
|
70
70
|
if (item.label === selectedItem.label) {
|
|
71
|
-
item.selected =
|
|
71
|
+
item.selected = true;
|
|
72
72
|
}
|
|
73
73
|
else {
|
|
74
74
|
item.selected = false;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
/*@doc Define a família da fonte do input, label e caixa de mensagem do componente.*/
|
|
16
16
|
--ez-text-input--font-family: var(--font-pattern, Arial);
|
|
17
17
|
/*@doc Define o peso da fonte do label do componente.*/
|
|
18
|
-
--ez-text-input--font-weight: var(--text-weight--
|
|
18
|
+
--ez-text-input--font-weight: var(--text-weight--medium, 400);
|
|
19
19
|
/*@doc Define a cor da fonte do input e label do componente.*/
|
|
20
20
|
--ez-text-input--color: var(--title--primary, #000);
|
|
21
21
|
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
--ez-text-input__input--border-color: var(--ez-text-input__input--background-color);
|
|
29
29
|
/*no modo normal usamos a borda com a mesma cor do bg*/
|
|
30
30
|
/*@doc Define a cor da borda do input quando focado.*/
|
|
31
|
-
--ez-text-input__input--focus--border-color: var(--color--
|
|
31
|
+
--ez-text-input__input--focus--border-color: var(--color--primary, #008561);
|
|
32
32
|
/*@doc Define a cor de fundo do input quando desabilitado.*/
|
|
33
33
|
--ez-text-input__input--disabled--background-color: var(--color--disable-secondary, #F2F5F8);
|
|
34
34
|
/*@doc Define a cor do texto do input.*/
|
|
@@ -6,6 +6,10 @@ export class EzTextInput {
|
|
|
6
6
|
* Deixa o campo disponível ou não para digitação.
|
|
7
7
|
*/
|
|
8
8
|
this.enabled = true;
|
|
9
|
+
/**
|
|
10
|
+
* Permite exibir a mensagem de erro.
|
|
11
|
+
*/
|
|
12
|
+
this.canShowError = true;
|
|
9
13
|
}
|
|
10
14
|
showError() {
|
|
11
15
|
const hasError = typeof this.errorMessage === "string" && this.errorMessage !== "";
|
|
@@ -178,7 +182,8 @@ export class EzTextInput {
|
|
|
178
182
|
: null,
|
|
179
183
|
h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }),
|
|
180
184
|
h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }),
|
|
181
|
-
|
|
185
|
+
this.canShowError &&
|
|
186
|
+
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
|
|
182
187
|
}
|
|
183
188
|
static get is() { return "ez-text-input"; }
|
|
184
189
|
static get encapsulation() { return "shadow"; }
|
|
@@ -292,6 +297,24 @@ export class EzTextInput {
|
|
|
292
297
|
"attribute": "mask",
|
|
293
298
|
"reflect": false
|
|
294
299
|
},
|
|
300
|
+
"canShowError": {
|
|
301
|
+
"type": "boolean",
|
|
302
|
+
"mutable": false,
|
|
303
|
+
"complexType": {
|
|
304
|
+
"original": "boolean",
|
|
305
|
+
"resolved": "boolean",
|
|
306
|
+
"references": {}
|
|
307
|
+
},
|
|
308
|
+
"required": false,
|
|
309
|
+
"optional": false,
|
|
310
|
+
"docs": {
|
|
311
|
+
"tags": [],
|
|
312
|
+
"text": "Permite exibir a mensagem de erro."
|
|
313
|
+
},
|
|
314
|
+
"attribute": "can-show-error",
|
|
315
|
+
"reflect": true,
|
|
316
|
+
"defaultValue": "true"
|
|
317
|
+
},
|
|
295
318
|
"restrict": {
|
|
296
319
|
"type": "string",
|
|
297
320
|
"mutable": false,
|
|
@@ -3,6 +3,7 @@ export default class CSSVarsUtils {
|
|
|
3
3
|
if (child) {
|
|
4
4
|
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--background-color');
|
|
5
5
|
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--border-color');
|
|
6
|
+
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input--height');
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
9
|
static applyIfExists(host, element, varName) {
|