@sankhyalabs/ezui 1.1.73 → 1.1.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-action-chip.cjs.entry.js +2 -2
- package/dist/cjs/ez-button_16.cjs.entry.js +179 -165
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-label-chip.cjs.entry.js +12 -12
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +21 -2
- package/dist/cjs/ez-toast.cjs.entry.js +5 -2
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/{index-4d2896bb.js → index-9431aeeb.js} +2 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/ez-action-chip/ez-action-chip.css +21 -21
- package/dist/collection/components/ez-action-chip/ez-action-chip.js +1 -1
- package/dist/collection/components/ez-button/ez-button.css +62 -43
- package/dist/collection/components/ez-button/ez-button.js +9 -2
- package/dist/collection/components/ez-calendar/ez-calendar.css +64 -64
- package/dist/collection/components/ez-calendar/ez-calendar.js +12 -9
- 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 +2 -2
- package/dist/collection/components/ez-date-input/ez-date-input.css +17 -3
- package/dist/collection/components/ez-date-input/ez-date-input.js +2 -2
- 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 +8 -8
- 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 +22 -22
- package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +7 -7
- package/dist/collection/components/ez-label-chip/ez-label-chip.css +49 -49
- package/dist/collection/components/ez-label-chip/ez-label-chip.js +11 -11
- package/dist/collection/components/ez-numeric-input/ez-numeric-input.css +4 -4
- package/dist/collection/components/ez-search/ez-search.js +9 -9
- package/dist/collection/components/ez-text-area/ez-text-area.css +48 -48
- package/dist/collection/components/ez-text-input/ez-text-input.css +60 -60
- package/dist/collection/components/ez-text-input/ez-text-input.js +16 -16
- package/dist/collection/components/ez-time-input/ez-time-input.js +3 -2
- package/dist/collection/components/ez-toast/ez-toast.css +9 -9
- package/dist/collection/components/ez-toast/ez-toast.js +4 -1
- package/dist/collection/components/ez-upload/ez-upload.css +41 -41
- package/dist/collection/components/ez-upload/ez-upload.js +53 -50
- package/dist/collection/utils/AssetsUtils.js +19 -0
- package/dist/custom-elements/index.js +219 -183
- package/dist/esm/ez-action-chip.entry.js +2 -2
- package/dist/esm/ez-button_16.entry.js +179 -165
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-label-chip.entry.js +12 -12
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +21 -2
- package/dist/esm/ez-toast.entry.js +5 -2
- package/dist/esm/ezui.js +2 -2
- package/dist/esm/{index-33153059.js → index-fd3c8023.js} +2 -1
- package/dist/esm/loader.js +2 -2
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-67410dfa.entry.js → p-11ae4ae7.entry.js} +1 -1
- package/dist/ezui/{p-50464bdf.entry.js → p-47fa3d6c.entry.js} +1 -1
- package/dist/ezui/p-66954a04.entry.js +1 -0
- package/dist/ezui/p-823ff0a0.entry.js +1 -0
- package/dist/ezui/{p-7f3bc6d9.entry.js → p-8ab6168f.entry.js} +1 -1
- package/dist/ezui/{p-15743b09.entry.js → p-9c1fb51c.entry.js} +1 -1
- package/dist/ezui/{p-061d21ba.entry.js → p-9d85125b.entry.js} +1 -1
- package/dist/ezui/p-a0b6eee2.entry.js +1 -0
- package/dist/ezui/p-a7b546b2.entry.js +1 -0
- package/dist/ezui/p-c833c94f.entry.js +1 -0
- package/dist/ezui/{p-8818da66.entry.js → p-d443f020.entry.js} +1 -1
- package/dist/ezui/{p-4df6f855.js → p-e0ab3746.js} +1 -1
- package/dist/types/components/ez-action-chip/ez-action-chip.d.ts +2 -2
- package/dist/types/components/ez-calendar/ez-calendar.d.ts +4 -1
- package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +3 -3
- 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-label-chip/ez-label-chip.d.ts +2 -2
- package/dist/types/components/ez-search/ez-search.d.ts +5 -5
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +1 -1
- package/dist/types/components/ez-toast/ez-toast.d.ts +3 -0
- package/dist/types/components/ez-upload/ez-upload.d.ts +10 -7
- package/dist/types/components.d.ts +47 -38
- package/dist/types/utils/AssetsUtils.d.ts +1 -0
- package/package.json +1 -1
- package/dist/ezui/p-0db8d49b.entry.js +0 -1
- package/dist/ezui/p-129b53df.entry.js +0 -1
- package/dist/ezui/p-25953d44.entry.js +0 -1
- package/dist/ezui/p-74809665.entry.js +0 -1
- package/dist/ezui/p-a99f8d42.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Component, Host, h, Element, Prop } from
|
|
2
|
-
import DataUnit from
|
|
1
|
+
import { Component, Host, h, Element, Prop } from "@stencil/core";
|
|
2
|
+
import DataUnit from "./DataUnit";
|
|
3
3
|
export class FormMetadata {
|
|
4
4
|
buildField(element) {
|
|
5
5
|
let label = element.getAttribute("label");
|
|
@@ -11,7 +11,7 @@ export class FormMetadata {
|
|
|
11
11
|
label = "Selecione uma das opções:";
|
|
12
12
|
}
|
|
13
13
|
const objOpts = {};
|
|
14
|
-
Array.from(element.getElementsByTagName(
|
|
14
|
+
Array.from(element.getElementsByTagName("OPTION")).forEach((optElem, index) => {
|
|
15
15
|
const optValue = optElem.getAttribute("value") || index;
|
|
16
16
|
const optLabel = optElem.textContent;
|
|
17
17
|
objOpts[optValue] = optLabel;
|
|
@@ -19,15 +19,15 @@ export class FormMetadata {
|
|
|
19
19
|
properties.push({ name: "options", value: JSON.stringify(objOpts) });
|
|
20
20
|
}
|
|
21
21
|
else if (userInterface === "FILE") {
|
|
22
|
-
const urlElement = element.querySelector(
|
|
23
|
-
const headersElement = element.querySelectorAll(
|
|
22
|
+
const urlElement = element.querySelector("URL");
|
|
23
|
+
const headersElement = element.querySelectorAll("HEADERS>HEADER");
|
|
24
24
|
if (urlElement) {
|
|
25
25
|
properties.push({ name: "URL", value: urlElement.textContent });
|
|
26
26
|
}
|
|
27
27
|
if (headersElement && headersElement.length > 0) {
|
|
28
28
|
const headers = {};
|
|
29
29
|
headersElement.forEach(header => {
|
|
30
|
-
headers[header.getAttribute(
|
|
30
|
+
headers[header.getAttribute("name")] = header.textContent;
|
|
31
31
|
});
|
|
32
32
|
properties.push({ name: "HEADERS", value: JSON.stringify(headers) });
|
|
33
33
|
}
|
|
@@ -53,7 +53,7 @@ export class FormMetadata {
|
|
|
53
53
|
}
|
|
54
54
|
buildFieldSet(dataUnit, element) {
|
|
55
55
|
const label = element.getAttribute("label");
|
|
56
|
-
const fields = Array.from(element.getElementsByTagName(
|
|
56
|
+
const fields = Array.from(element.getElementsByTagName("FIELD")).map(f => {
|
|
57
57
|
const field = this.buildField(f);
|
|
58
58
|
dataUnit.addFieldMetadata(field);
|
|
59
59
|
return { name: field.name };
|
|
@@ -70,7 +70,7 @@ export class FormMetadata {
|
|
|
70
70
|
Array.from(elements).forEach(child => {
|
|
71
71
|
const tagName = child.tagName.toUpperCase();
|
|
72
72
|
switch (tagName) {
|
|
73
|
-
case
|
|
73
|
+
case "FIELD":
|
|
74
74
|
if (!form.items) {
|
|
75
75
|
form.items = [];
|
|
76
76
|
}
|
|
@@ -78,13 +78,13 @@ export class FormMetadata {
|
|
|
78
78
|
dataUnit.addFieldMetadata(f);
|
|
79
79
|
form.items.push({ name: f.name });
|
|
80
80
|
break;
|
|
81
|
-
case
|
|
81
|
+
case "FIELD-SET":
|
|
82
82
|
if (!form.items) {
|
|
83
83
|
form.items = [];
|
|
84
84
|
}
|
|
85
85
|
form.items.push(this.buildFieldSet(dataUnit, child));
|
|
86
86
|
break;
|
|
87
|
-
case
|
|
87
|
+
case "SUB-FORM":
|
|
88
88
|
if (!form.subForms) {
|
|
89
89
|
form.subForms = [];
|
|
90
90
|
}
|
|
@@ -93,7 +93,7 @@ export class FormMetadata {
|
|
|
93
93
|
const subDuName = child.getAttribute("dataunit");
|
|
94
94
|
let subDu;
|
|
95
95
|
if (subDuName) {
|
|
96
|
-
subDu = new DataUnit(subDuName,
|
|
96
|
+
subDu = new DataUnit(subDuName, "noname", child.hasAttribute("many") ? "N" : "1");
|
|
97
97
|
}
|
|
98
98
|
else {
|
|
99
99
|
subDu = dataUnit;
|
|
@@ -108,7 +108,7 @@ export class FormMetadata {
|
|
|
108
108
|
if (!this.dataunit) {
|
|
109
109
|
this.dataunit = "dataunit_" + (this.name || this.label || new Date().getTime());
|
|
110
110
|
}
|
|
111
|
-
const du = new DataUnit(this.dataunit,
|
|
111
|
+
const du = new DataUnit(this.dataunit, "noname", this.many ? "N" : "1");
|
|
112
112
|
this.metadata = this.fromElements(this._host.children, this.label, this.name, du, this.autoload);
|
|
113
113
|
}
|
|
114
114
|
render() {
|
|
@@ -19,19 +19,19 @@ export const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
19
19
|
dataUnit.changeValue(name, newValue);
|
|
20
20
|
};
|
|
21
21
|
switch (userInterface) {
|
|
22
|
-
case
|
|
22
|
+
case "LONGTEXT":
|
|
23
23
|
return h("div", { class: "col col--sd-12 padding--small" }, loadingData ? h("place-holder", null) :
|
|
24
|
-
h("ez-text-area", { value: value ||
|
|
25
|
-
case
|
|
26
|
-
case
|
|
24
|
+
h("ez-text-area", { value: value || "", label: formattedLabel, onEzChange: evt => changeFieldHandler(evt.target["value"]), errorMessage: errorMessage, ref: elem => scrollToView(forceScroll, elem), key: key, enabled: isEnabled }));
|
|
25
|
+
case "CHECKBOX":
|
|
26
|
+
case "SWITCH":
|
|
27
27
|
return h("div", { class: "col col--sd-12 col--tb-3 padding--small align--middle padding-bottom--large" }, loadingData ? h("place-holder", null) :
|
|
28
|
-
h("ez-check", { value: value, label: label, enabled: isEnabled, mode: userInterface === "CHECKBOX" ? "regular" : "switch", onEzChange: (event) => changeFieldHandler(event.target[
|
|
29
|
-
case
|
|
30
|
-
const optsObj = properties ? JSON.parse(getProp(properties,
|
|
28
|
+
h("ez-check", { value: value, label: label, enabled: isEnabled, mode: userInterface === "CHECKBOX" ? "regular" : "switch", onEzChange: (event) => changeFieldHandler(event.target["value"]), ref: elem => scrollToView(forceScroll, elem), key: key }));
|
|
29
|
+
case "OPTIONSELECTOR":
|
|
30
|
+
const optsObj = properties ? JSON.parse(getProp(properties, "options")) : {};
|
|
31
31
|
const normalized = Object.keys(optsObj).map(key => { return { value: key, label: optsObj[key] }; });
|
|
32
32
|
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? h("place-holder", null) :
|
|
33
|
-
h("ez-combo-box", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target[
|
|
34
|
-
case
|
|
33
|
+
h("ez-combo-box", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target["value"]), errorMessage: errorMessage, ref: elem => scrollToView(forceScroll, elem), key: key, options: normalized }));
|
|
34
|
+
case "SEARCH":
|
|
35
35
|
const context = {
|
|
36
36
|
__MAIN_FORM: form,
|
|
37
37
|
__DATA_UNIT: dataUnit.name,
|
|
@@ -55,38 +55,38 @@ export const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
if (criteriaList.length > 0) {
|
|
58
|
-
context[
|
|
58
|
+
context["CRITERIA"] = criteriaList;
|
|
59
59
|
}
|
|
60
60
|
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? h("place-holder", null) :
|
|
61
|
-
h("ez-search", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target[
|
|
61
|
+
h("ez-search", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target["value"]), errorMessage: errorMessage, optionLoader: (argument) => {
|
|
62
62
|
if (form) {
|
|
63
63
|
return form.loadSearch(argument, context);
|
|
64
64
|
}
|
|
65
65
|
}, ref: elem => scrollToView(forceScroll, elem), key: key }));
|
|
66
|
-
case
|
|
67
|
-
const target = getProp(properties,
|
|
68
|
-
const strHeaders = getProp(properties,
|
|
66
|
+
case "FILE":
|
|
67
|
+
const target = getProp(properties, "URL");
|
|
68
|
+
const strHeaders = getProp(properties, "HEADERS");
|
|
69
69
|
const headers = strHeaders ? JSON.parse(strHeaders) : {};
|
|
70
70
|
const maxfiles = Number(getProp(properties, "maxfiles") || 0);
|
|
71
71
|
return (h("div", { class: "col col--sd-12 padding--small" }, loadingData ? h("place-holder", null) :
|
|
72
|
-
h("ez-upload", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.detail),
|
|
73
|
-
case
|
|
72
|
+
h("ez-upload", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.detail), urlUpload: target, requestHeaders: headers, maxFiles: maxfiles })));
|
|
73
|
+
case "DATE":
|
|
74
74
|
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? h("place-holder", null) :
|
|
75
|
-
h("ez-date-input", { value: !value ? null : DateUtils.clearTime(value), label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target[
|
|
76
|
-
case
|
|
77
|
-
case
|
|
75
|
+
h("ez-date-input", { value: !value ? null : DateUtils.clearTime(value), label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target["value"]), errorMessage: errorMessage, ref: elem => scrollToView(forceScroll, elem), key: key }));
|
|
76
|
+
case "DECIMALNUMBER":
|
|
77
|
+
case "INTEGERNUMBER":
|
|
78
78
|
let precision = 0;
|
|
79
79
|
let prettyPrecision = 0;
|
|
80
|
-
if (userInterface ===
|
|
80
|
+
if (userInterface === "DECIMALNUMBER") {
|
|
81
81
|
precision = Number(getProp(properties, "precision") || 2);
|
|
82
82
|
prettyPrecision = Number(getProp(properties, "prettyprecision") || precision);
|
|
83
83
|
}
|
|
84
84
|
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? h("place-holder", null) :
|
|
85
|
-
h("ez-numeric-input", { value: !value ? null : value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target[
|
|
85
|
+
h("ez-numeric-input", { value: !value ? null : value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target["value"]), errorMessage: errorMessage, precision: precision, prettyprecision: prettyPrecision, ref: elem => scrollToView(forceScroll, elem), key: key }));
|
|
86
86
|
//IMAGE, DATETIME, ELAPSEDTIME, PASSWORD, MASKEDTEXT, HTML
|
|
87
87
|
default:
|
|
88
88
|
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? h("place-holder", null) :
|
|
89
|
-
h("ez-text-input", { value: value, label: formattedLabel, enabled: isEnabled, loading: loadingData, onInput: (event) => changeFieldHandler(event.target[
|
|
89
|
+
h("ez-text-input", { value: value, label: formattedLabel, enabled: isEnabled, loading: loadingData, onInput: (event) => changeFieldHandler(event.target["value"]), errorMessage: errorMessage, ref: elem => scrollToView(forceScroll, elem), key: key }));
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
function getProp(properties, name) {
|
|
@@ -23,13 +23,13 @@ export const NavigationBar = ({ dataUnit: du, buttonProps, enabled }) => {
|
|
|
23
23
|
|| buttonProps.cancelVisible
|
|
24
24
|
|| buttonProps.reloadVisible) {
|
|
25
25
|
return h("div", { class: "col col--sd-12 align--right" },
|
|
26
|
-
buttonProps.previousVisible ? h("ez-button", { key: du.name +
|
|
27
|
-
buttonProps.nextVisible ? h("ez-button", { key: du.name +
|
|
28
|
-
buttonProps.removeVisible ? h("ez-button", { key: du.name +
|
|
29
|
-
buttonProps.addVisible ? h("ez-button", { key: du.name +
|
|
30
|
-
buttonProps.reloadVisible ? h("ez-button", { key: du.name +
|
|
31
|
-
buttonProps.cancelVisible ? h("ez-button", { key: du.name +
|
|
32
|
-
buttonProps.saveVisible ? h("ez-button", { key: du.name +
|
|
26
|
+
buttonProps.previousVisible ? h("ez-button", { key: du.name + "_previous", title: "Registro anterior", mode: "icon", enabled: enabled && du.hasPrevious(), onClick: () => du.previous(), image: "/themes/default/images/icons/actions-sprite.svg#previous-circle-inverted", class: "button--secondary margin-right--medium" }) : null,
|
|
27
|
+
buttonProps.nextVisible ? h("ez-button", { key: du.name + "_next", title: "Pr\u00F3ximo registro", mode: "icon", enabled: enabled && du.hasNext(), onClick: () => du.next(), image: "/themes/default/images/icons/actions-sprite.svg#next-circle-inverted", class: "button--secondary margin-right--medium" }) : null,
|
|
28
|
+
buttonProps.removeVisible ? h("ez-button", { key: du.name + "_remove", label: "Remover", enabled: enabled && du.hasCurrentRecord(), onClick: () => removeHandler(du), image: "/themes/default/images/icons/actions-sprite.svg#minus-circle-inverted", class: "button--secondary margin-right--medium" }) : null,
|
|
29
|
+
buttonProps.addVisible ? h("ez-button", { key: du.name + "_add", label: "Adicionar", enabled: enabled, onClick: () => du.insert(), class: "button--secondary margin-right--medium" }) : null,
|
|
30
|
+
buttonProps.reloadVisible ? h("ez-button", { key: du.name + "_reload", title: "Recarregar", enabled: enabled, mode: "icon", onClick: () => du.load(), image: "/themes/default/images/icons/actions-sprite.svg#rotate", class: "button--secondary margin-right--medium" }) : null,
|
|
31
|
+
buttonProps.cancelVisible ? h("ez-button", { key: du.name + "_cancel", label: "Cancelar", enabled: enabled && du.hasChanges(), onClick: () => du.cancel(), class: "button--secondary margin-right--medium" }) : null,
|
|
32
|
+
buttonProps.saveVisible ? h("ez-button", { key: du.name + "_save", label: "Salvar", enabled: enabled && du.hasChanges(), onClick: () => saveHandler(du), class: "button--primary margin-right--medium" }) : null);
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
35
|
return null;
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
/* dimensions */
|
|
3
3
|
/*@doc Define a altura do chip.*/
|
|
4
|
-
--
|
|
4
|
+
--ez-label-chip--height: 36px;
|
|
5
5
|
|
|
6
6
|
/* Label */
|
|
7
7
|
/*@doc Define o tamanho do label.*/
|
|
8
|
-
--
|
|
8
|
+
--ez-label-chip__label--font-size: var(--text--medium, 14px);
|
|
9
9
|
/*@doc Define a família da fonte do label.*/
|
|
10
|
-
--
|
|
10
|
+
--ez-label-chip__label--font-family: var(--font-pattern, Arial);
|
|
11
11
|
/*@doc Define o peso da fonte do label.*/
|
|
12
|
-
--
|
|
12
|
+
--ez-label-chip__label--font-weight: var(--text-weight--large, 600);
|
|
13
13
|
/*@doc Define o espaçamento do label.*/
|
|
14
|
-
--
|
|
14
|
+
--ez-label-chip__label--space--medium: var(--space--medium, 12px);
|
|
15
15
|
/*@doc Define a cor do texto e do ícone.*/
|
|
16
|
-
--
|
|
16
|
+
--ez-label-chip__label--title--primary: var(--title--primary, #919191);
|
|
17
17
|
|
|
18
18
|
/* Label Container */
|
|
19
19
|
/*@doc Define o raio da borda do container do chip.*/
|
|
20
|
-
--
|
|
20
|
+
--ez-label-chip__label__container--border-radius: var(--border--radius-large, 24px);
|
|
21
21
|
/*@doc Define o estilo da borda do container.*/
|
|
22
|
-
--
|
|
22
|
+
--ez-label-chip__label__container--border: 1px solid;
|
|
23
23
|
/*@doc Define a cor da borda do container.*/
|
|
24
|
-
--
|
|
24
|
+
--ez-label-chip__label__container--border-color-strokes: var(--color--strokes, #DCE0E8);
|
|
25
25
|
/*@doc Define a cor do texto, do ícone do label e do botão de remoção (quando o chip está ativo).*/
|
|
26
|
-
--
|
|
26
|
+
--ez-label-chip__label__container--color-primary: var(--color--primary, #008561);
|
|
27
27
|
/*@doc Define a cor da borda e do fundo quando o chip está desativado.*/
|
|
28
|
-
--
|
|
28
|
+
--ez-label-chip__label__container-color--disable-secondary: var(--color--disable-secondary, #F2F5F8);
|
|
29
29
|
/*@doc Define a cor de fundo do container quando ativo.*/
|
|
30
|
-
--
|
|
30
|
+
--ez-label-chip__label__container--background-color: #0085610F;
|
|
31
31
|
/*@doc Define a cor da borda do container quando ativo.*/
|
|
32
|
-
--
|
|
32
|
+
--ez-label-chip__label__container--border-color: #0085610F;
|
|
33
33
|
/*@doc Define a cor da borda do container quando o cursor está sobre ele.*/
|
|
34
|
-
--
|
|
34
|
+
--ez-label-chip__label__container--default--border-color--hover: var(--color--primary-600, #007a5a);
|
|
35
35
|
/*@doc Define a cor do fundo do container quando o cursor está sobre ele.*/
|
|
36
|
-
--
|
|
36
|
+
--ez-label-chip__label__container--default--background-color--hover: var(--color--primary-200, #f2faf8);
|
|
37
37
|
/*@doc Define a cor do texto e do ícone quando o chip está desabilitado.*/
|
|
38
|
-
--
|
|
38
|
+
--ez-label-chip__label__container--text--disabled: var(--text--disable, #AFB6C0);
|
|
39
39
|
|
|
40
40
|
/* Buttons */
|
|
41
41
|
/* @doc Contém o ícone do botão de fechamento. */
|
|
42
|
-
--
|
|
42
|
+
--ez-label-chip__btn__close--image: url('data:image/svg+xml;utf8,<svg width="8" height="8" viewBox="0 0 8 8" xmlns="http://www.w3.org/2000/svg"><path d="M 4.7098145,3.9968334 7.8535703,0.85318776 C 7.9473034,0.75946455 8,0.63233985 8,0.49978585 8,0.36723841 7.947304,0.24011361 7.8535703,0.14638378 7.7598354,0.05266059 7.6327257,6.48e-8 7.500152,6.48e-8 7.3676457,6.48e-8 7.2404691,0.0526608 7.1467354,0.14638378 L 4.00298,3.2900293 0.8591984,0.14638378 C 0.76546463,0.05266059 0.63834103,6.48e-8 0.50578123,6.48e-8 0.3732281,6.48e-8 0.24609783,0.05266059 0.15236397,0.14638378 0.05863012,0.24011361 0.00597395,0.36723841 0.00597395,0.49978585 c 0,0.132554 0.05265617,0.2596787 0.14639002,0.35340191 L 3.2961455,3.9968334 0.15236397,7.1411589 C 0.10466427,7.1872561 0.06663114,7.2424161 0.04046961,7.303371 0.01431473,7.3643212 5.6180845e-4,7.429943 1.6859246e-5,7.4962264 -5.2808998e-4,7.5625744 0.01214297,7.6283944 0.03729854,7.6897476 c 0.02514888,0.061416 0.06227604,0.1171794 0.1092096,0.1640783 0.0469402,0.046903 0.10274083,0.083936 0.16415749,0.1090508 0.0614166,0.025114 0.12721688,0.037703 0.19355667,0.037103 0.06634,-5.714e-4 0.13190027,-0.014457 0.19284393,-0.04064 0.0609507,-0.026246 0.11606474,-0.064351 0.16213217,-0.1120492 L 4.00298,4.7036374 7.1467354,7.8472967 c 0.093734,0.09373 0.2209103,0.1463572 0.3534166,0.1463572 0.1325737,0 0.2596834,-0.052623 0.3534183,-0.1463572 C 7.9473034,7.753567 8,7.6264624 8,7.493895 8,7.3613281 7.9473086,7.2342224 7.8535703,7.1404927 Z"/></svg>');
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.btn-close {
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
.btn-close::after {
|
|
56
56
|
content: '';
|
|
57
57
|
display: flex;
|
|
58
|
-
background-color: var(--
|
|
58
|
+
background-color: var(--ez-label-chip__label__container--color-primary);
|
|
59
59
|
width: 8px;
|
|
60
60
|
height: 8px;
|
|
61
|
-
-webkit-mask-image: var(--
|
|
62
|
-
mask-image: var(--
|
|
61
|
+
-webkit-mask-image: var(--ez-label-chip__btn__close--image);
|
|
62
|
+
mask-image: var(--ez-label-chip__btn__close--image);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.label__container {
|
|
@@ -71,18 +71,18 @@
|
|
|
71
71
|
align-items: center;
|
|
72
72
|
background-color: #FFFFFF;
|
|
73
73
|
align-self: center;
|
|
74
|
-
color: var(--
|
|
75
|
-
fill: var(--
|
|
76
|
-
border: var(--
|
|
77
|
-
border-radius: var(--
|
|
78
|
-
border-color: var(--
|
|
79
|
-
padding-right: var(--
|
|
80
|
-
padding-left: var(--
|
|
74
|
+
color: var(--ez-label-chip__label--title--primary);
|
|
75
|
+
fill: var(--ez-label-chip__label--title--primary);
|
|
76
|
+
border: var(--ez-label-chip__label__container--border);
|
|
77
|
+
border-radius: var(--ez-label-chip__label__container--border-radius);
|
|
78
|
+
border-color: var(--ez-label-chip__label__container--border-color-strokes);
|
|
79
|
+
padding-right: var(--ez-label-chip__label--space--medium);
|
|
80
|
+
padding-left: var(--ez-label-chip__label--space--medium);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
.label__container:hover {
|
|
84
|
-
border-color: var(--
|
|
85
|
-
background-color: var(--
|
|
84
|
+
border-color: var(--ez-label-chip__label__container--default--border-color--hover);
|
|
85
|
+
background-color: var(--ez-label-chip__label__container--default--background-color--hover);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
.label__container--active {
|
|
@@ -93,14 +93,14 @@
|
|
|
93
93
|
position: relative;
|
|
94
94
|
align-items: center;
|
|
95
95
|
align-self: center;
|
|
96
|
-
border: var(--
|
|
97
|
-
border-radius: var(--
|
|
98
|
-
padding-right: var(--
|
|
99
|
-
padding-left: var(--
|
|
100
|
-
fill: var(--
|
|
101
|
-
color: var(--
|
|
102
|
-
border-color: var(--
|
|
103
|
-
background-color: var(--
|
|
96
|
+
border: var(--ez-label-chip__label__container--border);
|
|
97
|
+
border-radius: var(--ez-label-chip__label__container--border-radius);
|
|
98
|
+
padding-right: var(--ez-label-chip__label--space--medium);
|
|
99
|
+
padding-left: var(--ez-label-chip__label--space--medium);
|
|
100
|
+
fill: var(--ez-label-chip__label__container--color-primary);
|
|
101
|
+
color: var(--ez-label-chip__label__container--color-primary);
|
|
102
|
+
border-color: var(--ez-label-chip__label__container--border-color);
|
|
103
|
+
background-color: var(--ez-label-chip__label__container--background-color);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
|
|
@@ -111,26 +111,26 @@
|
|
|
111
111
|
position: relative;
|
|
112
112
|
align-items: center;
|
|
113
113
|
align-self: center;
|
|
114
|
-
border: var(--
|
|
115
|
-
border-color: var(--
|
|
116
|
-
border-radius: var(--
|
|
117
|
-
padding-right: var(--
|
|
118
|
-
padding-left: var(--
|
|
119
|
-
fill: var(--
|
|
120
|
-
color: var(--
|
|
121
|
-
background-color: var(--
|
|
114
|
+
border: var(--ez-label-chip__label__container--border);
|
|
115
|
+
border-color: var(--ez-label-chip__label__container-color--disable-secondary);
|
|
116
|
+
border-radius: var(--ez-label-chip__label__container--border-radius);
|
|
117
|
+
padding-right: var(--ez-label-chip__label--space--medium);
|
|
118
|
+
padding-left: var(--ez-label-chip__label--space--medium);
|
|
119
|
+
fill: var(--ez-label-chip__label__container--text--disabled);
|
|
120
|
+
color: var(--ez-label-chip__label__container--text--disabled);
|
|
121
|
+
background-color: var(--ez-label-chip__label__container-color--disable-secondary);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
label {
|
|
125
125
|
/*private*/
|
|
126
126
|
display: flex;
|
|
127
127
|
align-items: center;
|
|
128
|
-
font-weight: var(--
|
|
128
|
+
font-weight: var(--ez-label-chip__label--font-weight);
|
|
129
129
|
cursor: pointer;
|
|
130
130
|
/*public*/
|
|
131
|
-
height: var(--
|
|
132
|
-
font-family: var(--
|
|
133
|
-
font-size: var(--
|
|
131
|
+
height: var(--ez-label-chip--height);
|
|
132
|
+
font-family: var(--ez-label-chip__label--font-family);
|
|
133
|
+
font-size: var(--ez-label-chip__label--font-size);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
.label__icon {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Prop, h, Method, Watch, Event } from
|
|
1
|
+
import { Component, Prop, h, Method, Watch, Event } from "@stencil/core";
|
|
2
2
|
export class EzLabelChip {
|
|
3
3
|
constructor() {
|
|
4
4
|
/**
|
|
@@ -34,7 +34,7 @@ export class EzLabelChip {
|
|
|
34
34
|
//---------------------------------------------
|
|
35
35
|
handleClick(ev) {
|
|
36
36
|
const target = ev.target;
|
|
37
|
-
if (target.assignedSlot === null && !target.classList.contains(
|
|
37
|
+
if (target.assignedSlot === null && !target.classList.contains("label__icon")) {
|
|
38
38
|
this.valueChange.emit(this.value);
|
|
39
39
|
this.swichState();
|
|
40
40
|
}
|
|
@@ -46,13 +46,13 @@ export class EzLabelChip {
|
|
|
46
46
|
}
|
|
47
47
|
reflectChange() {
|
|
48
48
|
if (this._divElem) {
|
|
49
|
-
this._divElem.classList.remove(
|
|
50
|
-
this._divElem.classList.remove(
|
|
49
|
+
this._divElem.classList.remove("label__container--active");
|
|
50
|
+
this._divElem.classList.remove("label__container");
|
|
51
51
|
if (this.value) {
|
|
52
|
-
this._divElem.classList.add(
|
|
52
|
+
this._divElem.classList.add("label__container--active");
|
|
53
53
|
}
|
|
54
54
|
else {
|
|
55
|
-
this._divElem.classList.add(
|
|
55
|
+
this._divElem.classList.add("label__container");
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -62,7 +62,7 @@ export class EzLabelChip {
|
|
|
62
62
|
componentDidLoad() {
|
|
63
63
|
if (this._divElem) {
|
|
64
64
|
if (this.value) {
|
|
65
|
-
this._divElem.classList.add(
|
|
65
|
+
this._divElem.classList.add("label__container--active");
|
|
66
66
|
}
|
|
67
67
|
else {
|
|
68
68
|
this.handleEnabledState();
|
|
@@ -70,12 +70,12 @@ export class EzLabelChip {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
handleEnabledState() {
|
|
73
|
-
this._divElem.classList.remove(
|
|
73
|
+
this._divElem.classList.remove("label__container--disabled");
|
|
74
74
|
if (!this.enabled) {
|
|
75
|
-
this._divElem.classList.remove(
|
|
76
|
-
this._divElem.classList.add(
|
|
75
|
+
this._divElem.classList.remove("label__container");
|
|
76
|
+
this._divElem.classList.add("label__container--disabled");
|
|
77
77
|
if (this._labelElem) {
|
|
78
|
-
this._labelElem.style.cursor =
|
|
78
|
+
this._labelElem.style.cursor = "default";
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
display: block;
|
|
3
3
|
width: 100%;
|
|
4
4
|
/*@doc Define a cor de fundo do input.*/
|
|
5
|
-
--
|
|
5
|
+
--ez-text-input__input--background-color: var(--background--medium, #e0e0e0);
|
|
6
6
|
/*@doc Define a cor da borda do input.*/
|
|
7
|
-
--
|
|
7
|
+
--ez-text-input__input--border-color: var(--ez-text-input__input--background-color);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.text-input {
|
|
11
|
-
--
|
|
12
|
-
--
|
|
11
|
+
--ez-text-input__input--background-color: inherit;
|
|
12
|
+
--ez-text-input__input--border-color: inherit;
|
|
13
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Event, h, Prop, Watch } from
|
|
1
|
+
import { Component, Event, h, Prop, Watch } from "@stencil/core";
|
|
2
2
|
export class EzSearch {
|
|
3
3
|
constructor() {
|
|
4
4
|
/**
|
|
@@ -8,11 +8,11 @@ export class EzSearch {
|
|
|
8
8
|
/**
|
|
9
9
|
* Ajusta a opção de mostrar o "value" ao selecionar uma opção.
|
|
10
10
|
*/
|
|
11
|
-
this.
|
|
11
|
+
this.showSelectedValue = true;
|
|
12
12
|
/**
|
|
13
13
|
* Ajusta a opção de mostrar o "value" para cada opção.
|
|
14
14
|
*/
|
|
15
|
-
this.
|
|
15
|
+
this.showOptionValue = true;
|
|
16
16
|
}
|
|
17
17
|
updateValue() {
|
|
18
18
|
if (this._comboElement) {
|
|
@@ -25,7 +25,7 @@ export class EzSearch {
|
|
|
25
25
|
this.ezChange.emit(evt.detail);
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
|
-
return (h("ez-combo-box", { ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, optionLoader: this.
|
|
28
|
+
return (h("ez-combo-box", { ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, optionLoader: this.optionLoader, searchMode: true, onEzChange: evt => this.onComboChange(evt), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue }));
|
|
29
29
|
}
|
|
30
30
|
;
|
|
31
31
|
static get is() { return "ez-search"; }
|
|
@@ -111,7 +111,7 @@ export class EzSearch {
|
|
|
111
111
|
"attribute": "error-message",
|
|
112
112
|
"reflect": true
|
|
113
113
|
},
|
|
114
|
-
"
|
|
114
|
+
"optionLoader": {
|
|
115
115
|
"type": "unknown",
|
|
116
116
|
"mutable": false,
|
|
117
117
|
"complexType": {
|
|
@@ -130,7 +130,7 @@ export class EzSearch {
|
|
|
130
130
|
"text": "Fun\u00E7\u00E3o respons\u00E1vel por carregar as op\u00E7\u00F5es dinamicamente"
|
|
131
131
|
}
|
|
132
132
|
},
|
|
133
|
-
"
|
|
133
|
+
"showSelectedValue": {
|
|
134
134
|
"type": "boolean",
|
|
135
135
|
"mutable": false,
|
|
136
136
|
"complexType": {
|
|
@@ -144,11 +144,11 @@ export class EzSearch {
|
|
|
144
144
|
"tags": [],
|
|
145
145
|
"text": "Ajusta a op\u00E7\u00E3o de mostrar o \"value\" ao selecionar uma op\u00E7\u00E3o."
|
|
146
146
|
},
|
|
147
|
-
"attribute": "
|
|
147
|
+
"attribute": "show-selected-value",
|
|
148
148
|
"reflect": false,
|
|
149
149
|
"defaultValue": "true"
|
|
150
150
|
},
|
|
151
|
-
"
|
|
151
|
+
"showOptionValue": {
|
|
152
152
|
"type": "boolean",
|
|
153
153
|
"mutable": false,
|
|
154
154
|
"complexType": {
|
|
@@ -162,7 +162,7 @@ export class EzSearch {
|
|
|
162
162
|
"tags": [],
|
|
163
163
|
"text": "Ajusta a op\u00E7\u00E3o de mostrar o \"value\" para cada op\u00E7\u00E3o."
|
|
164
164
|
},
|
|
165
|
-
"attribute": "
|
|
165
|
+
"attribute": "show-option-value",
|
|
166
166
|
"reflect": false,
|
|
167
167
|
"defaultValue": "true"
|
|
168
168
|
}
|