@sankhyalabs/ezui 1.1.64 → 1.1.68
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-button_16.cjs.entry.js +44 -52
- package/dist/cjs/ez-number-input.cjs.entry.js +9 -9
- package/dist/cjs/ez-popover.cjs.entry.js +10 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +6 -6
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-button/ez-button.css +45 -41
- package/dist/collection/components/ez-button/ez-button.js +2 -2
- package/dist/collection/components/ez-check/ez-check.css +78 -78
- package/dist/collection/components/ez-check/ez-check.js +1 -1
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +4 -4
- package/dist/collection/components/ez-date-input/ez-date-input.js +8 -8
- package/dist/collection/components/ez-form/subcomponents/form-metadata.js +2 -2
- package/dist/collection/components/ez-form/subcomponents/structure/Field.js +6 -6
- package/dist/collection/components/ez-icon/ez-icon.css +3 -1
- package/dist/collection/components/ez-icon/ez-icon.js +5 -3
- package/dist/collection/components/ez-number-input/ez-number-input.js +11 -11
- package/dist/collection/components/ez-numeric-input/ez-numeric-input.js +7 -7
- package/dist/collection/components/ez-popover/ez-popover.css +1 -1
- package/dist/collection/components/ez-popover/ez-popover.js +26 -1
- package/dist/collection/components/ez-search/ez-search.js +3 -3
- package/dist/collection/components/ez-text-area/ez-text-area.js +5 -5
- package/dist/collection/components/ez-text-input/ez-text-input.css +60 -60
- package/dist/collection/components/ez-text-input/ez-text-input.js +11 -35
- package/dist/collection/components/ez-time-input/ez-time-input.js +8 -8
- package/dist/custom-elements/index.js +77 -76
- package/dist/esm/ez-button_16.entry.js +44 -52
- package/dist/esm/ez-number-input.entry.js +9 -9
- package/dist/esm/ez-popover.entry.js +11 -2
- package/dist/esm/ez-time-input.entry.js +6 -6
- 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-d8a47f23.entry.js → p-74e4415e.entry.js} +1 -1
- package/dist/ezui/p-7d066b1c.entry.js +1 -0
- package/dist/ezui/p-ee5058c1.entry.js +1 -0
- package/dist/ezui/{p-7f528c19.entry.js → p-f7d7fb7f.entry.js} +1 -1
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -1
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +1 -1
- package/dist/types/components/ez-icon/ez-icon.d.ts +6 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +1 -1
- package/dist/types/components/ez-numeric-input/ez-numeric-input.d.ts +1 -1
- package/dist/types/components/ez-popover/ez-popover.d.ts +6 -0
- package/dist/types/components/ez-search/ez-search.d.ts +1 -1
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +1 -1
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +1 -5
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +1 -1
- package/dist/types/components.d.ts +32 -24
- package/package.json +2 -1
- package/dist/ezui/p-171bdc12.entry.js +0 -1
- package/dist/ezui/p-46275da0.entry.js +0 -1
|
@@ -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, child.hasAttribute("many") ? 'N' : '1');
|
|
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, this.many ? 'N' : '1');
|
|
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() {
|
|
@@ -21,7 +21,7 @@ export const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
21
21
|
switch (userInterface) {
|
|
22
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 || '', label: formattedLabel, onEzChange: evt => changeFieldHandler(evt.target['value']),
|
|
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
25
|
case 'CHECKBOX':
|
|
26
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) :
|
|
@@ -30,7 +30,7 @@ export const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
30
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['value']),
|
|
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
34
|
case 'SEARCH':
|
|
35
35
|
const context = {
|
|
36
36
|
__MAIN_FORM: form,
|
|
@@ -58,7 +58,7 @@ export const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
58
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['value']),
|
|
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
|
}
|
|
@@ -72,7 +72,7 @@ export const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
72
72
|
h("ez-upload", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.detail), urlupload: target, requestheaders: headers, maxfiles: maxfiles })));
|
|
73
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['value']),
|
|
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
76
|
case 'DECIMALNUMBER':
|
|
77
77
|
case 'INTEGERNUMBER':
|
|
78
78
|
let precision = 0;
|
|
@@ -82,11 +82,11 @@ export const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
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['value']),
|
|
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['value']),
|
|
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) {
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
display: block;
|
|
3
3
|
overflow: hidden;
|
|
4
4
|
position: relative;
|
|
5
|
+
/* @doc Define a cor do ícone. */
|
|
6
|
+
--ez-icon--color: var(--icon--color, #ffffff);
|
|
5
7
|
}
|
|
6
8
|
|
|
7
9
|
svg {
|
|
8
10
|
display: flex;
|
|
9
11
|
justify-content: center;
|
|
10
12
|
align-items: center;
|
|
11
|
-
fill: var(--color
|
|
13
|
+
fill: var(--ez-icon--color);
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
.x-small {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Component, h, Host, Prop } from '@stencil/core';
|
|
2
2
|
export class EzIcon {
|
|
3
3
|
constructor() {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Tamanho do icone
|
|
6
|
+
*/
|
|
5
7
|
this.size = 'medium';
|
|
6
8
|
}
|
|
7
9
|
isSprite() {
|
|
@@ -36,7 +38,7 @@ export class EzIcon {
|
|
|
36
38
|
"optional": false,
|
|
37
39
|
"docs": {
|
|
38
40
|
"tags": [],
|
|
39
|
-
"text": ""
|
|
41
|
+
"text": "Tamanho do icone"
|
|
40
42
|
},
|
|
41
43
|
"attribute": "size",
|
|
42
44
|
"reflect": true,
|
|
@@ -54,7 +56,7 @@ export class EzIcon {
|
|
|
54
56
|
"optional": false,
|
|
55
57
|
"docs": {
|
|
56
58
|
"tags": [],
|
|
57
|
-
"text": ""
|
|
59
|
+
"text": "Path da imagem"
|
|
58
60
|
},
|
|
59
61
|
"attribute": "href",
|
|
60
62
|
"reflect": true
|
|
@@ -31,7 +31,7 @@ export class NumberInput {
|
|
|
31
31
|
this.checkNumberValidation = (valuePtBRorNumber) => {
|
|
32
32
|
try {
|
|
33
33
|
if (valuePtBRorNumber != "" && NumberUtils.format(valuePtBRorNumber, this.precision, this.prettyprecision) === "NaN") {
|
|
34
|
-
this.
|
|
34
|
+
this.errorMessage = `Valor não é um número válido`;
|
|
35
35
|
this.value = undefined;
|
|
36
36
|
this.strvalue = undefined;
|
|
37
37
|
if (this._inputElem) {
|
|
@@ -41,14 +41,14 @@ export class NumberInput {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
catch (err) {
|
|
44
|
-
this.
|
|
44
|
+
this.errorMessage = err.message;
|
|
45
45
|
return false;
|
|
46
46
|
}
|
|
47
47
|
return true;
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
showError() {
|
|
51
|
-
const hasError = typeof this.
|
|
51
|
+
const hasError = typeof this.errorMessage === 'string' && this.errorMessage !== '';
|
|
52
52
|
if (this._inputElem) {
|
|
53
53
|
if (hasError) {
|
|
54
54
|
this._inputElem.classList.add('hasError');
|
|
@@ -76,7 +76,7 @@ export class NumberInput {
|
|
|
76
76
|
if (isNaN(newValue) && newValue !== undefined) {
|
|
77
77
|
this.value = undefined;
|
|
78
78
|
this.strvalue = "";
|
|
79
|
-
this.
|
|
79
|
+
this.errorMessage = `Valor não é um número válido`;
|
|
80
80
|
this.adjustFloatingLabel();
|
|
81
81
|
}
|
|
82
82
|
else {
|
|
@@ -122,7 +122,7 @@ export class NumberInput {
|
|
|
122
122
|
async handleFocusout() {
|
|
123
123
|
//Setting value and strvalue by stringinput
|
|
124
124
|
if (this._inputElem) {
|
|
125
|
-
this.
|
|
125
|
+
this.errorMessage = "";
|
|
126
126
|
if (this._inputElem.value !== "") {
|
|
127
127
|
this._inputElem.value = this.settingStrValueIntNumber(this._inputElem.value);
|
|
128
128
|
const value = NumberUtils.keepOnlyDecimalSeparator(this._inputElem.value, this.formatnumber.toUpperCase());
|
|
@@ -134,7 +134,7 @@ export class NumberInput {
|
|
|
134
134
|
this._inputElem.value = this.formatnumber.toUpperCase() !== "EN-US" ? NumberUtils.format(value, this.precision, this.prettyprecision) : NumberUtils.changeFormat(NumberUtils.format(value, this.precision, this.prettyprecision));
|
|
135
135
|
}
|
|
136
136
|
catch (e) {
|
|
137
|
-
this.
|
|
137
|
+
this.errorMessage = e.message;
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
@@ -189,7 +189,7 @@ export class NumberInput {
|
|
|
189
189
|
this._inputElem.value = this.formatnumber.toUpperCase() !== "EN-US" ? NumberUtils.format(value, this.precision, this.prettyprecision) : NumberUtils.changeFormat(NumberUtils.format(value, this.precision, this.prettyprecision));
|
|
190
190
|
}
|
|
191
191
|
catch (e) {
|
|
192
|
-
this.
|
|
192
|
+
this.errorMessage = e.message;
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
195
|
this.strvalue = this._inputElem.value;
|
|
@@ -231,7 +231,7 @@ export class NumberInput {
|
|
|
231
231
|
labelInput,
|
|
232
232
|
h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", value: this.strvalue, disabled: !this.enabled, onInput: this.handleChange.bind(this), onFocusout: this.handleFocusout.bind(this) }),
|
|
233
233
|
h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }),
|
|
234
|
-
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el }, this.
|
|
234
|
+
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el }, this.errorMessage)));
|
|
235
235
|
}
|
|
236
236
|
static get is() { return "ez-number-input"; }
|
|
237
237
|
static get encapsulation() { return "shadow"; }
|
|
@@ -311,7 +311,7 @@ export class NumberInput {
|
|
|
311
311
|
"reflect": true,
|
|
312
312
|
"defaultValue": "true"
|
|
313
313
|
},
|
|
314
|
-
"
|
|
314
|
+
"errorMessage": {
|
|
315
315
|
"type": "string",
|
|
316
316
|
"mutable": true,
|
|
317
317
|
"complexType": {
|
|
@@ -325,7 +325,7 @@ export class NumberInput {
|
|
|
325
325
|
"tags": [],
|
|
326
326
|
"text": "Quando h\u00E1 um problema de valida\u00E7\u00E3o, serve como orienta\u00E7\u00E3o ao usu\u00E1rio"
|
|
327
327
|
},
|
|
328
|
-
"attribute": "
|
|
328
|
+
"attribute": "error-message",
|
|
329
329
|
"reflect": true
|
|
330
330
|
},
|
|
331
331
|
"precision": {
|
|
@@ -467,7 +467,7 @@ export class NumberInput {
|
|
|
467
467
|
}; }
|
|
468
468
|
static get elementRef() { return "el"; }
|
|
469
469
|
static get watchers() { return [{
|
|
470
|
-
"propName": "
|
|
470
|
+
"propName": "errorMessage",
|
|
471
471
|
"methodName": "showError"
|
|
472
472
|
}, {
|
|
473
473
|
"propName": "precision",
|
|
@@ -11,7 +11,7 @@ export class EzNumericInput {
|
|
|
11
11
|
this._textInput.label = this.label;
|
|
12
12
|
}
|
|
13
13
|
setErrorMessage() {
|
|
14
|
-
this._textInput.
|
|
14
|
+
this._textInput.errorMessage = this.errorMessage;
|
|
15
15
|
}
|
|
16
16
|
applyValueToInput() {
|
|
17
17
|
if (this._textInput) {
|
|
@@ -19,7 +19,7 @@ export class EzNumericInput {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
changeValue(newValue) {
|
|
22
|
-
this._textInput.
|
|
22
|
+
this._textInput.errorMessage = "";
|
|
23
23
|
if (newValue !== this.value) {
|
|
24
24
|
this.value = newValue;
|
|
25
25
|
this.ezChange.emit();
|
|
@@ -28,7 +28,7 @@ export class EzNumericInput {
|
|
|
28
28
|
parseNumber() {
|
|
29
29
|
const parsedNumber = this._textInput.value ? NumberUtils.stringToNumber(this._textInput.value) : null;
|
|
30
30
|
if (parsedNumber != null && isNaN(parsedNumber)) {
|
|
31
|
-
this._textInput.
|
|
31
|
+
this._textInput.errorMessage = "O valor digitado não é um número válido";
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
34
|
this.changeValue(parsedNumber);
|
|
@@ -41,7 +41,7 @@ export class EzNumericInput {
|
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
|
-
return (h("ez-text-input", { class: "text-input", ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled,
|
|
44
|
+
return (h("ez-text-input", { class: "text-input", ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage }));
|
|
45
45
|
}
|
|
46
46
|
static get is() { return "ez-numeric-input"; }
|
|
47
47
|
static get encapsulation() { return "shadow"; }
|
|
@@ -104,7 +104,7 @@ export class EzNumericInput {
|
|
|
104
104
|
"reflect": true,
|
|
105
105
|
"defaultValue": "true"
|
|
106
106
|
},
|
|
107
|
-
"
|
|
107
|
+
"errorMessage": {
|
|
108
108
|
"type": "string",
|
|
109
109
|
"mutable": true,
|
|
110
110
|
"complexType": {
|
|
@@ -118,7 +118,7 @@ export class EzNumericInput {
|
|
|
118
118
|
"tags": [],
|
|
119
119
|
"text": "Quando h\u00E1 um problema de valida\u00E7\u00E3o, serve como orienta\u00E7\u00E3o ao usu\u00E1rio"
|
|
120
120
|
},
|
|
121
|
-
"attribute": "
|
|
121
|
+
"attribute": "error-message",
|
|
122
122
|
"reflect": true
|
|
123
123
|
},
|
|
124
124
|
"precision": {
|
|
@@ -176,7 +176,7 @@ export class EzNumericInput {
|
|
|
176
176
|
"propName": "label",
|
|
177
177
|
"methodName": "setLabel"
|
|
178
178
|
}, {
|
|
179
|
-
"propName": "
|
|
179
|
+
"propName": "errorMessage",
|
|
180
180
|
"methodName": "setErrorMessage"
|
|
181
181
|
}, {
|
|
182
182
|
"propName": "value",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, h, Method, Element, Host, Prop } from '@stencil/core';
|
|
1
|
+
import { Component, h, Method, Element, Host, Prop, Event, Watch } from '@stencil/core';
|
|
2
2
|
import { FloatingManager } from '@sankhyalabs/core';
|
|
3
3
|
export class EzPopover {
|
|
4
4
|
constructor() {
|
|
@@ -30,6 +30,11 @@ export class EzPopover {
|
|
|
30
30
|
*/
|
|
31
31
|
this.boxwidth = 'fit-content';
|
|
32
32
|
}
|
|
33
|
+
dispatchVisibilityChange(newValue, oldValue) {
|
|
34
|
+
if (newValue != oldValue) {
|
|
35
|
+
this.ezVisibilityChange.emit(newValue);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
33
38
|
/**
|
|
34
39
|
* Atualiza a posição do popover em relação ao componente pai.
|
|
35
40
|
*/
|
|
@@ -239,6 +244,22 @@ export class EzPopover {
|
|
|
239
244
|
"reflect": true
|
|
240
245
|
}
|
|
241
246
|
}; }
|
|
247
|
+
static get events() { return [{
|
|
248
|
+
"method": "ezVisibilityChange",
|
|
249
|
+
"name": "ezVisibilityChange",
|
|
250
|
+
"bubbles": true,
|
|
251
|
+
"cancelable": true,
|
|
252
|
+
"composed": true,
|
|
253
|
+
"docs": {
|
|
254
|
+
"tags": [],
|
|
255
|
+
"text": "Evento disparado ao exibir/ocultar o componente."
|
|
256
|
+
},
|
|
257
|
+
"complexType": {
|
|
258
|
+
"original": "boolean",
|
|
259
|
+
"resolved": "boolean",
|
|
260
|
+
"references": {}
|
|
261
|
+
}
|
|
262
|
+
}]; }
|
|
242
263
|
static get methods() { return {
|
|
243
264
|
"updatePosition": {
|
|
244
265
|
"complexType": {
|
|
@@ -320,4 +341,8 @@ export class EzPopover {
|
|
|
320
341
|
}
|
|
321
342
|
}; }
|
|
322
343
|
static get elementRef() { return "_host"; }
|
|
344
|
+
static get watchers() { return [{
|
|
345
|
+
"propName": "isOpened",
|
|
346
|
+
"methodName": "dispatchVisibilityChange"
|
|
347
|
+
}]; }
|
|
323
348
|
}
|
|
@@ -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,
|
|
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"; }
|
|
@@ -94,7 +94,7 @@ export class EzSearch {
|
|
|
94
94
|
"reflect": true,
|
|
95
95
|
"defaultValue": "true"
|
|
96
96
|
},
|
|
97
|
-
"
|
|
97
|
+
"errorMessage": {
|
|
98
98
|
"type": "string",
|
|
99
99
|
"mutable": true,
|
|
100
100
|
"complexType": {
|
|
@@ -108,7 +108,7 @@ export class EzSearch {
|
|
|
108
108
|
"tags": [],
|
|
109
109
|
"text": "Quando h\u00E1 um problema de valida\u00E7\u00E3o, serve como orienta\u00E7\u00E3o ao usu\u00E1rio"
|
|
110
110
|
},
|
|
111
|
-
"attribute": "
|
|
111
|
+
"attribute": "error-message",
|
|
112
112
|
"reflect": true
|
|
113
113
|
},
|
|
114
114
|
"optionloader": {
|
|
@@ -11,7 +11,7 @@ export class EzTextArea {
|
|
|
11
11
|
this.rows = 4;
|
|
12
12
|
}
|
|
13
13
|
showError() {
|
|
14
|
-
const hasError = typeof this.
|
|
14
|
+
const hasError = typeof this.errorMessage === 'string' && this.errorMessage !== '';
|
|
15
15
|
if (hasError) {
|
|
16
16
|
this._container.classList.add('hasError');
|
|
17
17
|
this._messageBoxElem.classList.add('hasError');
|
|
@@ -95,7 +95,7 @@ export class EzTextArea {
|
|
|
95
95
|
h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "textarea__label" : "textarea__label textarea__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
|
|
96
96
|
: null,
|
|
97
97
|
h("textarea", { onFocus: () => this.handleFocus(), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, onKeyDown: event => event.stopPropagation(), rows: this.rows })),
|
|
98
|
-
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.
|
|
98
|
+
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
|
|
99
99
|
}
|
|
100
100
|
static get is() { return "ez-text-area"; }
|
|
101
101
|
static get encapsulation() { return "shadow"; }
|
|
@@ -175,7 +175,7 @@ export class EzTextArea {
|
|
|
175
175
|
"attribute": "loading",
|
|
176
176
|
"reflect": true
|
|
177
177
|
},
|
|
178
|
-
"
|
|
178
|
+
"errorMessage": {
|
|
179
179
|
"type": "string",
|
|
180
180
|
"mutable": true,
|
|
181
181
|
"complexType": {
|
|
@@ -189,7 +189,7 @@ export class EzTextArea {
|
|
|
189
189
|
"tags": [],
|
|
190
190
|
"text": "Quando h\u00E1 um problema de valida\u00E7\u00E3o, serve como orienta\u00E7\u00E3o ao usu\u00E1rio"
|
|
191
191
|
},
|
|
192
|
-
"attribute": "
|
|
192
|
+
"attribute": "error-message",
|
|
193
193
|
"reflect": true
|
|
194
194
|
},
|
|
195
195
|
"rows": {
|
|
@@ -263,7 +263,7 @@ export class EzTextArea {
|
|
|
263
263
|
}; }
|
|
264
264
|
static get elementRef() { return "_hostElement"; }
|
|
265
265
|
static get watchers() { return [{
|
|
266
|
-
"propName": "
|
|
266
|
+
"propName": "errorMessage",
|
|
267
267
|
"methodName": "showError"
|
|
268
268
|
}, {
|
|
269
269
|
"propName": "value",
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
/* dimensions */
|
|
3
|
-
--
|
|
4
|
-
--
|
|
5
|
-
--
|
|
3
|
+
--text-input--height: 42px;
|
|
4
|
+
--text-input--width: 100%;
|
|
5
|
+
--text-input__icon--width: 48px;
|
|
6
6
|
|
|
7
7
|
/* general */
|
|
8
|
-
--
|
|
9
|
-
--
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
--
|
|
8
|
+
--text-input--border-radius: var(--border--radius-medium, 12px);
|
|
9
|
+
--text-input--font-size: var(--text--medium, 14px);
|
|
10
|
+
--text-input--font-family: var(--font-pattern, Arial);
|
|
11
|
+
--text-input--font-weight: var(--text-weight--large, 500);
|
|
12
|
+
--text-input--color: var(--title--primary, #000);
|
|
13
13
|
|
|
14
14
|
/* input */
|
|
15
15
|
/*@doc Define a cor de fundo do input.*/
|
|
16
|
-
--
|
|
16
|
+
--text-input__input--background-color: var(--background--medium, #e0e0e0);
|
|
17
17
|
/*@doc Define o estilo da borda do input.*/
|
|
18
|
-
--
|
|
18
|
+
--text-input__input--border: var(--border--medium, 2px solid);
|
|
19
19
|
/*@doc Define a cor da borda do input.*/
|
|
20
|
-
--
|
|
20
|
+
--text-input__input--border-color: var(--text-input__input--background-color);
|
|
21
21
|
/*no modo normal usamos a borda com a mesma cor do bg*/
|
|
22
22
|
/*@doc Define a cor da borda do input quando focado.*/
|
|
23
|
-
--
|
|
23
|
+
--text-input__input--focus--border-color: var(--color--alert-cold-800, #042EFF);
|
|
24
24
|
/*@doc Define a cor de fundo do input quando desabilitado.*/
|
|
25
|
-
--
|
|
25
|
+
--text-input__input--disabled--background-color: var(--color--disable-secondary, #F2F5F8);
|
|
26
26
|
/*@doc Define a cor do texto do input.*/
|
|
27
|
-
--
|
|
27
|
+
--text-input__input--disabled--color: var(--text--disable, #AFB6C0);
|
|
28
28
|
/*@doc Define a cor da borda do input quando com erro.*/
|
|
29
|
-
--
|
|
29
|
+
--text-input__input--error--border-color: #CC2936;
|
|
30
30
|
|
|
31
31
|
/* message box */
|
|
32
32
|
/*@doc Define o tamanho da fonte da mensagem abaixo do input.*/
|
|
33
|
-
--
|
|
33
|
+
--text-input__message_box--font-size: var(--text--small, 12px);
|
|
34
34
|
/*@doc Define a cor da fonte da mensagem quando info.*/
|
|
35
|
-
--
|
|
35
|
+
--text-input__message_box--info--color: var(--color--success, #22085d);
|
|
36
36
|
/*@doc Define a cor da fonte da mensagem quando erro.*/
|
|
37
|
-
--
|
|
37
|
+
--text-input__message_box--error--color: var(--color--error, #FF0000);
|
|
38
38
|
|
|
39
39
|
/* label */
|
|
40
40
|
/*@doc Define o posicionamento do label.*/
|
|
41
|
-
--
|
|
41
|
+
--text-input__label--floating--top: 6px;
|
|
42
42
|
/*@doc Define o posicionamento do label.*/
|
|
43
|
-
--
|
|
43
|
+
--text-input__label--padding-top: 12px;
|
|
44
44
|
/*@doc Define o espaçamento esquerdo do label.*/
|
|
45
|
-
--
|
|
45
|
+
--text-input__label--padding-left: 14px;
|
|
46
46
|
/*@doc Define o espaçamento direito do label.*/
|
|
47
|
-
--
|
|
47
|
+
--text-input__label--padding-right: 12px;
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
/***************
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
flex-wrap: wrap;
|
|
56
56
|
position: relative;
|
|
57
57
|
/*public*/
|
|
58
|
-
width: var(--
|
|
58
|
+
width: var(--text-input--width);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
input {
|
|
@@ -66,40 +66,40 @@ input {
|
|
|
66
66
|
font-weight: var(--text-weight--large, 600);
|
|
67
67
|
|
|
68
68
|
/*public*/
|
|
69
|
-
height: var(--
|
|
70
|
-
border-radius: var(--
|
|
71
|
-
font-family: var(--
|
|
72
|
-
font-size: var(--
|
|
73
|
-
border: var(--
|
|
74
|
-
border-color: var(--
|
|
75
|
-
background-color: var(--
|
|
76
|
-
color: var(--
|
|
69
|
+
height: var(--text-input--height);
|
|
70
|
+
border-radius: var(--text-input--border-radius);
|
|
71
|
+
font-family: var(--text-input--font-family);
|
|
72
|
+
font-size: var(--text-input--font-size);
|
|
73
|
+
border: var(--text-input__input--border);
|
|
74
|
+
border-color: var(--text-input__input--border-color);
|
|
75
|
+
background-color: var(--text-input__input--background-color);
|
|
76
|
+
color: var(--text-input--color);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
input:disabled {
|
|
80
80
|
/*public*/
|
|
81
|
-
background-color: var(--
|
|
82
|
-
color: var(--
|
|
81
|
+
background-color: var(--text-input__input--disabled--background-color);
|
|
82
|
+
color: var(--text-input__input--disabled--color);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
input:focus {
|
|
86
86
|
/*private*/
|
|
87
87
|
outline: none;
|
|
88
88
|
/*public*/
|
|
89
|
-
border-color: var(--
|
|
89
|
+
border-color: var(--text-input__input--focus--border-color);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
input.icon--left {
|
|
93
|
-
padding-left: var(--
|
|
93
|
+
padding-left: var(--text-input__icon--width);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
input.icon--right {
|
|
97
|
-
padding-right: var(--
|
|
97
|
+
padding-right: var(--text-input__icon--width);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
input.hasError {
|
|
101
|
-
color: var(--
|
|
102
|
-
border-color: var(--
|
|
101
|
+
color: var(--text-input--color);
|
|
102
|
+
border-color: var(--text-input__input--error--border-color);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
input.text--right {
|
|
@@ -118,14 +118,14 @@ input.text--right {
|
|
|
118
118
|
white-space: nowrap;
|
|
119
119
|
|
|
120
120
|
/*public*/
|
|
121
|
-
font-family: var(--
|
|
122
|
-
font-size: var(--
|
|
123
|
-
color: var(--
|
|
121
|
+
font-family: var(--text-input--font-family);
|
|
122
|
+
font-size: var(--text-input__message_box--font-size);
|
|
123
|
+
color: var(--text-input__message_box--info--color);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
.hasError {
|
|
127
127
|
/*public*/
|
|
128
|
-
color: var(--
|
|
128
|
+
color: var(--text-input__message_box--error--color);
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
.input__label {
|
|
@@ -138,49 +138,49 @@ input.text--right {
|
|
|
138
138
|
white-space: nowrap;
|
|
139
139
|
-webkit-transition: font-size .05s, top .05s;
|
|
140
140
|
transition: font-size .05s, top .05s;
|
|
141
|
-
width: calc(100% - var(--
|
|
142
|
-
left: var(--
|
|
141
|
+
width: calc(100% - var(--text-input__label--padding-right));
|
|
142
|
+
left: var(--text-input--space--medium);
|
|
143
143
|
|
|
144
144
|
/*public*/
|
|
145
|
-
font-family: var(--
|
|
146
|
-
font-size: var(--
|
|
147
|
-
font-weight: var(--
|
|
148
|
-
color: var(--
|
|
149
|
-
top: var(--
|
|
150
|
-
left: var(--
|
|
151
|
-
padding-right: var(--
|
|
145
|
+
font-family: var(--text-input--font-family);
|
|
146
|
+
font-size: var(--text-input--font-size);
|
|
147
|
+
font-weight: var(--text-input--font-weight);
|
|
148
|
+
color: var(--text-input--color);
|
|
149
|
+
top: var(--text-input__label--padding-top);
|
|
150
|
+
left: var(--text-input__label--padding-left);
|
|
151
|
+
padding-right: var(--text-input__label--padding-right);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
.input__label--floated {
|
|
155
|
-
font-family: var(--
|
|
155
|
+
font-family: var(--text-input--font-family);
|
|
156
156
|
font-size: var(--text--extra-small);
|
|
157
157
|
color: var(--text--primary);
|
|
158
|
-
top: var(--
|
|
158
|
+
top: var(--text-input__label--floating--top);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
.input__label--disabled {
|
|
162
|
-
color: var(--
|
|
162
|
+
color: var(--text-input__input--disabled--color);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
.input__label--left {
|
|
166
166
|
/*public*/
|
|
167
167
|
text-align: left;
|
|
168
|
-
left: calc(var(--
|
|
168
|
+
left: calc(var(--text-input__icon--width) + 2px);
|
|
169
169
|
/*borda*/
|
|
170
|
-
width: calc(100% - var(--
|
|
170
|
+
width: calc(100% - var(--text-input__icon--width));
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
.input__label--right {
|
|
174
174
|
/*public*/
|
|
175
|
-
right: var(--
|
|
176
|
-
width: calc(100% - var(--
|
|
175
|
+
right: var(--text-input__icon--width);
|
|
176
|
+
width: calc(100% - var(--text-input__icon--width));
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
/* ISSO TA ERRADO CRIAR INPUT__LABEL--BOTH */
|
|
180
180
|
.input__label--left.input__label--right {
|
|
181
|
-
left: calc(var(--
|
|
181
|
+
left: calc(var(--text-input__icon--width) + 2px);
|
|
182
182
|
/*borda*/
|
|
183
|
-
width: calc(100% - var(--
|
|
183
|
+
width: calc(100% - var(--text-input__icon--width) * 2);
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
.input--with--label {
|