@sankhyalabs/ezui 1.1.66 → 1.1.69
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 +1 -1
- package/dist/cjs/ez-button_16.cjs.entry.js +48 -56
- package/dist/cjs/ez-dialog.cjs.entry.js +3 -0
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +9 -9
- package/dist/cjs/ez-popover.cjs.entry.js +1 -5
- package/dist/cjs/ez-popup.cjs.entry.js +1 -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-action-chip/ez-action-chip.css +2 -1
- package/dist/collection/components/ez-action-chip/ez-action-chip.js +1 -1
- package/dist/collection/components/ez-button/ez-button.css +47 -45
- package/dist/collection/components/ez-button/ez-button.js +5 -5
- package/dist/collection/components/ez-calendar/ez-calendar.css +2 -2
- package/dist/collection/components/ez-check/ez-check.css +78 -78
- package/dist/collection/components/ez-check/ez-check.js +7 -7
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +2 -2
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +1 -1
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +6 -6
- package/dist/collection/components/ez-date-input/ez-date-input.js +9 -9
- package/dist/collection/components/ez-dialog/ez-dialog.js +5 -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-label-chip/ez-label-chip.css +2 -1
- package/dist/collection/components/ez-label-chip/ez-label-chip.js +1 -1
- package/dist/collection/components/ez-modal/ez-modal.css +1 -1
- package/dist/collection/components/ez-modal/ez-modal.js +4 -4
- package/dist/collection/components/ez-number-input/ez-number-input.js +11 -11
- package/dist/collection/components/ez-numeric-input/ez-numeric-input.css +1 -1
- package/dist/collection/components/ez-numeric-input/ez-numeric-input.js +9 -9
- package/dist/collection/components/ez-popover/ez-popover.css +1 -1
- package/dist/collection/components/ez-popover/ez-popover.js +0 -4
- package/dist/collection/components/ez-popup/ez-popup.css +2 -2
- package/dist/collection/components/ez-popup/ez-popup.js +3 -3
- package/dist/collection/components/ez-search/ez-search.js +5 -5
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +1 -1
- package/dist/collection/components/ez-text-area/ez-text-area.css +6 -0
- package/dist/collection/components/ez-text-area/ez-text-area.js +9 -9
- package/dist/collection/components/ez-text-input/ez-text-input.css +68 -60
- package/dist/collection/components/ez-text-input/ez-text-input.js +14 -38
- package/dist/collection/components/ez-time-input/ez-time-input.css +8 -0
- package/dist/collection/components/ez-time-input/ez-time-input.js +9 -9
- package/dist/collection/components/ez-toast/ez-toast.css +2 -2
- package/dist/collection/components/ez-upload/ez-upload.css +4 -1
- package/dist/collection/components/ez-upload/ez-upload.js +3 -3
- package/dist/custom-elements/index.js +78 -87
- package/dist/esm/ez-action-chip.entry.js +1 -1
- package/dist/esm/ez-button_16.entry.js +48 -56
- package/dist/esm/ez-dialog.entry.js +3 -0
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +9 -9
- package/dist/esm/ez-popover.entry.js +1 -5
- package/dist/esm/ez-popup.entry.js +1 -1
- 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-169d99a1.entry.js +1 -0
- package/dist/ezui/{p-4f4b8aae.entry.js → p-1c33a56d.entry.js} +1 -1
- package/dist/ezui/{p-d8a47f23.entry.js → p-74e4415e.entry.js} +1 -1
- package/dist/ezui/{p-6a6f9712.entry.js → p-ee5058c1.entry.js} +1 -1
- package/dist/ezui/{p-7f528c19.entry.js → p-f7d7fb7f.entry.js} +1 -1
- package/dist/types/components/ez-action-chip/ez-action-chip.d.ts +1 -1
- package/dist/types/components/ez-button/ez-button.d.ts +1 -1
- package/dist/types/components/ez-check/ez-check.d.ts +3 -3
- package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +1 -1
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +3 -3
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +2 -2
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +4 -1
- package/dist/types/components/ez-icon/ez-icon.d.ts +6 -0
- package/dist/types/components/ez-label-chip/ez-label-chip.d.ts +1 -1
- package/dist/types/components/ez-modal/ez-modal.d.ts +3 -3
- 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 +3 -3
- package/dist/types/components/ez-popup/ez-popup.d.ts +2 -2
- package/dist/types/components/ez-search/ez-search.d.ts +3 -3
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +1 -1
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +4 -4
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +4 -8
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +2 -2
- package/dist/types/components/ez-upload/ez-upload.d.ts +3 -3
- package/dist/types/components.d.ts +88 -81
- package/package.json +2 -1
- package/dist/ezui/p-afc553a4.entry.js +0 -1
|
@@ -2,12 +2,12 @@ import { Component, Prop, h, Watch, Method, Event, Host } from '@stencil/core';
|
|
|
2
2
|
export class EzCheck {
|
|
3
3
|
constructor() {
|
|
4
4
|
/**
|
|
5
|
-
* Deixa o campo disponível ou não
|
|
5
|
+
* Deixa o campo disponível ou não para interação com o usuário.
|
|
6
6
|
*/
|
|
7
7
|
this.enabled = true;
|
|
8
8
|
/**
|
|
9
9
|
* Existem dois modos de visualização: regular e switch.
|
|
10
|
-
* Se esta propriedade for omitida, o componete assume o formato "regular"
|
|
10
|
+
* Se esta propriedade for omitida, o componete assume o formato "regular".
|
|
11
11
|
* No modo "regular" a visualização é a tradicional de uma caixinha marcada/desmarcada.
|
|
12
12
|
* No modo "switch" o campo tem uma interface em formato de um pino liga/desliga.
|
|
13
13
|
*/
|
|
@@ -48,14 +48,14 @@ export class EzCheck {
|
|
|
48
48
|
getLabelClasses() {
|
|
49
49
|
let classes = "label";
|
|
50
50
|
if (!this.enabled) {
|
|
51
|
-
classes
|
|
51
|
+
classes += " label--disabled";
|
|
52
52
|
}
|
|
53
53
|
return classes;
|
|
54
54
|
}
|
|
55
55
|
render() {
|
|
56
56
|
return (h(Host, null,
|
|
57
57
|
h("input", { type: "checkbox", class: "regularMode", checked: this.value === true, onChange: () => { this.changeValue(); }, disabled: !this.enabled, ref: (el) => this._inputElem = el }),
|
|
58
|
-
this.label ? h("label", { class: this.getLabelClasses(), onClick: () => { this.changeValue(); }, title: this.label }, this.label) :
|
|
58
|
+
this.label ? h("label", { class: this.getLabelClasses(), onClick: () => { this.changeValue(); }, title: this.label }, this.label) : undefined));
|
|
59
59
|
}
|
|
60
60
|
static get is() { return "ez-check"; }
|
|
61
61
|
static get encapsulation() { return "shadow"; }
|
|
@@ -78,7 +78,7 @@ export class EzCheck {
|
|
|
78
78
|
"optional": false,
|
|
79
79
|
"docs": {
|
|
80
80
|
"tags": [],
|
|
81
|
-
"text": "
|
|
81
|
+
"text": "T\u00EDtulo do campo"
|
|
82
82
|
},
|
|
83
83
|
"attribute": "label",
|
|
84
84
|
"reflect": true
|
|
@@ -112,7 +112,7 @@ export class EzCheck {
|
|
|
112
112
|
"optional": false,
|
|
113
113
|
"docs": {
|
|
114
114
|
"tags": [],
|
|
115
|
-
"text": "Deixa o campo dispon\u00EDvel ou n\u00E3o
|
|
115
|
+
"text": "Deixa o campo dispon\u00EDvel ou n\u00E3o para intera\u00E7\u00E3o com o usu\u00E1rio."
|
|
116
116
|
},
|
|
117
117
|
"attribute": "enabled",
|
|
118
118
|
"reflect": true,
|
|
@@ -130,7 +130,7 @@ export class EzCheck {
|
|
|
130
130
|
"optional": false,
|
|
131
131
|
"docs": {
|
|
132
132
|
"tags": [],
|
|
133
|
-
"text": "Existem dois modos de visualiza\u00E7\u00E3o: regular e switch.\nSe esta propriedade for omitida, o componete assume o formato \"regular\"
|
|
133
|
+
"text": "Existem dois modos de visualiza\u00E7\u00E3o: regular e switch.\nSe esta propriedade for omitida, o componete assume o formato \"regular\".\nNo modo \"regular\" a visualiza\u00E7\u00E3o \u00E9 a tradicional de uma caixinha marcada/desmarcada.\nNo modo \"switch\" o campo tem uma interface em formato de um pino liga/desliga."
|
|
134
134
|
},
|
|
135
135
|
"attribute": "mode",
|
|
136
136
|
"reflect": true,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
:host {
|
|
2
|
-
/*@doc Define a altura do componente quando
|
|
2
|
+
/*@doc Define a altura do componente quando colapsado.*/
|
|
3
3
|
--collapsible-box--height: 42px;
|
|
4
4
|
|
|
5
5
|
/*@doc Define o tamanho da fonte do header.*/
|
|
6
6
|
--collapsible-box--font-size: var(--title--medium, 14px);
|
|
7
7
|
/*@doc Define a família da fonte do header.*/
|
|
8
8
|
--collapsible-box--font-family: var(--font-pattern, Arial);
|
|
9
|
-
/*@doc Define o peso da fonte header.*/
|
|
9
|
+
/*@doc Define o peso da fonte do header.*/
|
|
10
10
|
--collapsible-box--font-weight: var(--text-weight--large, 600);
|
|
11
11
|
/*@doc Define a cor da fonte do header.*/
|
|
12
12
|
--collapsible-box--color: var(--title--primary);
|
|
@@ -58,7 +58,7 @@ export class EzComboBox {
|
|
|
58
58
|
//FIXME: Provavelmente isso fará com que o popup abra em uma
|
|
59
59
|
//posição errada no futuro. Preferi fazer simples no começo,
|
|
60
60
|
//porque não quis onerar o text input com essa funcionalidade...
|
|
61
|
-
const top = this.
|
|
61
|
+
const top = this.errorMessage ? '0px' : '-17px';
|
|
62
62
|
this._floatingID = FloatingManager.float(this._optionsList, this._listContainer, { autoClose: true, top });
|
|
63
63
|
window.requestAnimationFrame(() => {
|
|
64
64
|
this._optionsList.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' });
|
|
@@ -228,7 +228,7 @@ export class EzComboBox {
|
|
|
228
228
|
}
|
|
229
229
|
render() {
|
|
230
230
|
return (h(Host, null,
|
|
231
|
-
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(),
|
|
231
|
+
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 ?
|
|
232
232
|
h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-search", onClick: () => { this.loadOptions('ADVANCED'); }, slot: "leftIcon" })
|
|
233
233
|
:
|
|
234
234
|
h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-options", slot: "rightIcon", onClick: () => this.showOptions() })),
|
|
@@ -277,7 +277,7 @@ export class EzComboBox {
|
|
|
277
277
|
"optional": false,
|
|
278
278
|
"docs": {
|
|
279
279
|
"tags": [],
|
|
280
|
-
"text": "
|
|
280
|
+
"text": "T\u00EDtulo do campo"
|
|
281
281
|
},
|
|
282
282
|
"attribute": "label",
|
|
283
283
|
"reflect": true
|
|
@@ -319,10 +319,10 @@ export class EzComboBox {
|
|
|
319
319
|
"optional": false,
|
|
320
320
|
"docs": {
|
|
321
321
|
"tags": [],
|
|
322
|
-
"text": "Array no formato \"{value: string, label: string} que alimenta as op\u00E7\u00F5es do Combobox
|
|
322
|
+
"text": "Array no formato \"{value: string, label: string}\" que alimenta as op\u00E7\u00F5es do Combobox"
|
|
323
323
|
}
|
|
324
324
|
},
|
|
325
|
-
"
|
|
325
|
+
"errorMessage": {
|
|
326
326
|
"type": "string",
|
|
327
327
|
"mutable": true,
|
|
328
328
|
"complexType": {
|
|
@@ -336,7 +336,7 @@ export class EzComboBox {
|
|
|
336
336
|
"tags": [],
|
|
337
337
|
"text": "Quando h\u00E1 um problema de valida\u00E7\u00E3o, serve como orienta\u00E7\u00E3o ao usu\u00E1rio"
|
|
338
338
|
},
|
|
339
|
-
"attribute": "
|
|
339
|
+
"attribute": "error-message",
|
|
340
340
|
"reflect": true
|
|
341
341
|
},
|
|
342
342
|
"searchmode": {
|
|
@@ -11,7 +11,7 @@ export class EzDateInput {
|
|
|
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) {
|
|
@@ -20,7 +20,7 @@ export class EzDateInput {
|
|
|
20
20
|
}
|
|
21
21
|
changeValue(newValue) {
|
|
22
22
|
newValue = newValue == null ? null : DateUtils.clearTime(newValue);
|
|
23
|
-
this._textInput.
|
|
23
|
+
this._textInput.errorMessage = "";
|
|
24
24
|
if (this.getTextValue(newValue) !== this.getTextValue(this.value)) {
|
|
25
25
|
this.value = newValue;
|
|
26
26
|
this.ezChange.emit();
|
|
@@ -32,7 +32,7 @@ export class EzDateInput {
|
|
|
32
32
|
//FIXME: Provavelmente isso fará com que o popup abra em uma
|
|
33
33
|
//posição errada no futuro. Preferi fazer simples no começo,
|
|
34
34
|
//porque não quis onerar o text input com essa funcionalidade...
|
|
35
|
-
const top = this._textInput.
|
|
35
|
+
const top = this._textInput.errorMessage ? 0 : -17;
|
|
36
36
|
this._calendar.fitVertical(top, this._elem.clientHeight);
|
|
37
37
|
}
|
|
38
38
|
hideCalendar() {
|
|
@@ -51,7 +51,7 @@ export class EzDateInput {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
|
-
this._textInput.
|
|
54
|
+
this._textInput.errorMessage = "O valor digitado não é uma data válida";
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
getTextValue(d) {
|
|
@@ -60,7 +60,7 @@ export class EzDateInput {
|
|
|
60
60
|
render() {
|
|
61
61
|
return (h(Host, null,
|
|
62
62
|
h("ez-text-input", { class: "text-input", ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => { if (event.key === 'H' || event.key === 'h')
|
|
63
|
-
this.changeValue(new Date()); }, label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: "0123456789/", enabled: this.enabled,
|
|
63
|
+
this.changeValue(new Date()); }, label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage },
|
|
64
64
|
h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })),
|
|
65
65
|
h("ez-calendar", { onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem })));
|
|
66
66
|
}
|
|
@@ -85,7 +85,7 @@ export class EzDateInput {
|
|
|
85
85
|
"optional": false,
|
|
86
86
|
"docs": {
|
|
87
87
|
"tags": [],
|
|
88
|
-
"text": "
|
|
88
|
+
"text": "T\u00EDtulo do campo"
|
|
89
89
|
},
|
|
90
90
|
"attribute": "label",
|
|
91
91
|
"reflect": true
|
|
@@ -127,7 +127,7 @@ export class EzDateInput {
|
|
|
127
127
|
"reflect": true,
|
|
128
128
|
"defaultValue": "true"
|
|
129
129
|
},
|
|
130
|
-
"
|
|
130
|
+
"errorMessage": {
|
|
131
131
|
"type": "string",
|
|
132
132
|
"mutable": true,
|
|
133
133
|
"complexType": {
|
|
@@ -141,7 +141,7 @@ export class EzDateInput {
|
|
|
141
141
|
"tags": [],
|
|
142
142
|
"text": "Quando h\u00E1 um problema de valida\u00E7\u00E3o, serve como orienta\u00E7\u00E3o ao usu\u00E1rio"
|
|
143
143
|
},
|
|
144
|
-
"attribute": "
|
|
144
|
+
"attribute": "error-message",
|
|
145
145
|
"reflect": true
|
|
146
146
|
}
|
|
147
147
|
}; }
|
|
@@ -166,7 +166,7 @@ export class EzDateInput {
|
|
|
166
166
|
"propName": "label",
|
|
167
167
|
"methodName": "setLabel"
|
|
168
168
|
}, {
|
|
169
|
-
"propName": "
|
|
169
|
+
"propName": "errorMessage",
|
|
170
170
|
"methodName": "setErrorMessage"
|
|
171
171
|
}, {
|
|
172
172
|
"propName": "value",
|
|
@@ -36,6 +36,9 @@ export class EzDialog {
|
|
|
36
36
|
this._currentMessage = this._messageQueue.shift();
|
|
37
37
|
forceUpdate(this);
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Faz com que o componente seja exibido.
|
|
41
|
+
*/
|
|
39
42
|
async show(title, message, critical, confirm, icon) {
|
|
40
43
|
this.opened = true;
|
|
41
44
|
return new Promise(resolve => {
|
|
@@ -175,7 +178,7 @@ export class EzDialog {
|
|
|
175
178
|
"optional": false,
|
|
176
179
|
"docs": {
|
|
177
180
|
"tags": [],
|
|
178
|
-
"text": "Define o \u00EDcone a ser exibido ao lado do t\u00EDtulo do"
|
|
181
|
+
"text": "Define o \u00EDcone a ser exibido ao lado do t\u00EDtulo do componente"
|
|
179
182
|
},
|
|
180
183
|
"attribute": "personalized-icon-path",
|
|
181
184
|
"reflect": false
|
|
@@ -276,7 +279,7 @@ export class EzDialog {
|
|
|
276
279
|
"return": "Promise<boolean>"
|
|
277
280
|
},
|
|
278
281
|
"docs": {
|
|
279
|
-
"text": "",
|
|
282
|
+
"text": "Faz com que o componente seja exibido.",
|
|
280
283
|
"tags": []
|
|
281
284
|
}
|
|
282
285
|
}
|
|
@@ -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 ícone
|
|
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 \u00EDcone"
|
|
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
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
--lc__label__container--border: 1px solid;
|
|
23
23
|
/*@doc Define a cor da borda do container.*/
|
|
24
24
|
--lc__label__container--border-color-strokes: var(--color--strokes, #DCE0E8);
|
|
25
|
-
/*@doc Define a cor do texto, do ícone do label (quando o chip está ativo)
|
|
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
|
--lc__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
|
--lc__label__container-color--disable-secondary: var(--color--disable-secondary, #F2F5F8);
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
--lc__label__container--text--disabled: var(--text--disable, #AFB6C0);
|
|
39
39
|
|
|
40
40
|
/* Buttons */
|
|
41
|
+
/* @doc Contém o ícone do botão de fechamento. */
|
|
41
42
|
--lc__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>');
|
|
42
43
|
}
|
|
43
44
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
:host {
|
|
2
|
-
/*@doc Define a camada que o componente será exibido.*/
|
|
2
|
+
/*@doc Define a camada em que o componente será exibido.*/
|
|
3
3
|
--modal-z-index: var(--most-visible, 3);
|
|
4
4
|
/*@doc Define o espaçamento vertical do conteúdo do modal.*/
|
|
5
5
|
--modal-vertical-padding: var(--space--large, 24px);
|
|
@@ -6,7 +6,7 @@ export class EzModal {
|
|
|
6
6
|
*/
|
|
7
7
|
this.oppened = true;
|
|
8
8
|
/**
|
|
9
|
-
* Define se o modal será fechado ao
|
|
9
|
+
* Define se o modal será fechado ao clicar ESC
|
|
10
10
|
*/
|
|
11
11
|
this.closeesc = false;
|
|
12
12
|
/**
|
|
@@ -124,7 +124,7 @@ export class EzModal {
|
|
|
124
124
|
"optional": false,
|
|
125
125
|
"docs": {
|
|
126
126
|
"tags": [],
|
|
127
|
-
"text": "Define o tamanho do modal
|
|
127
|
+
"text": "Define o tamanho do modal. Devem ser utilizados os tamanhos definidos de colunas como \"col-sd-3\""
|
|
128
128
|
},
|
|
129
129
|
"attribute": "modalsize",
|
|
130
130
|
"reflect": false
|
|
@@ -141,7 +141,7 @@ export class EzModal {
|
|
|
141
141
|
"optional": false,
|
|
142
142
|
"docs": {
|
|
143
143
|
"tags": [],
|
|
144
|
-
"text": "Define o alinhamento do modal
|
|
144
|
+
"text": "Define o alinhamento do modal. Seus valores podem ser 'right' ou 'left'"
|
|
145
145
|
},
|
|
146
146
|
"attribute": "align",
|
|
147
147
|
"reflect": false
|
|
@@ -176,7 +176,7 @@ export class EzModal {
|
|
|
176
176
|
"optional": false,
|
|
177
177
|
"docs": {
|
|
178
178
|
"tags": [],
|
|
179
|
-
"text": "Define se o modal ser\u00E1 fechado ao
|
|
179
|
+
"text": "Define se o modal ser\u00E1 fechado ao clicar ESC"
|
|
180
180
|
},
|
|
181
181
|
"attribute": "closeesc",
|
|
182
182
|
"reflect": false,
|
|
@@ -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",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
display: block;
|
|
3
3
|
width: 100%;
|
|
4
|
-
/*@doc Define a cor
|
|
4
|
+
/*@doc Define a cor de fundo do input.*/
|
|
5
5
|
--it__input--background-color: var(--background--medium, #e0e0e0);
|
|
6
6
|
/*@doc Define a cor da borda do input.*/
|
|
7
7
|
--it__input--border-color: var(--it__input--background-color);
|
|
@@ -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"; }
|
|
@@ -64,7 +64,7 @@ export class EzNumericInput {
|
|
|
64
64
|
"optional": false,
|
|
65
65
|
"docs": {
|
|
66
66
|
"tags": [],
|
|
67
|
-
"text": "
|
|
67
|
+
"text": "T\u00EDtulo do campo"
|
|
68
68
|
},
|
|
69
69
|
"attribute": "label",
|
|
70
70
|
"reflect": true
|
|
@@ -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": {
|
|
@@ -164,7 +164,7 @@ export class EzNumericInput {
|
|
|
164
164
|
"composed": true,
|
|
165
165
|
"docs": {
|
|
166
166
|
"tags": [],
|
|
167
|
-
"text": "
|
|
167
|
+
"text": "Evento disparado quando o estado do componente \u00E9 alterado (onEzChange)."
|
|
168
168
|
},
|
|
169
169
|
"complexType": {
|
|
170
170
|
"original": "string",
|
|
@@ -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",
|
|
@@ -52,8 +52,6 @@ export class EzPopover {
|
|
|
52
52
|
if (_container.shadowRoot && _container.shadowRoot.contains(node)) {
|
|
53
53
|
return true;
|
|
54
54
|
}
|
|
55
|
-
//Here: we pass this._box as parameter but we need to change to _host
|
|
56
|
-
//because we need to get the lasChild (inner content to put in slot)
|
|
57
55
|
_container = this._host;
|
|
58
56
|
return !_container.lastElementChild.shadowRoot ? _container.contains(node) : _container.lastElementChild.shadowRoot.contains(node);
|
|
59
57
|
}
|
|
@@ -78,8 +76,6 @@ export class EzPopover {
|
|
|
78
76
|
if (_container.shadowRoot && _container.shadowRoot.contains(node)) {
|
|
79
77
|
return true;
|
|
80
78
|
}
|
|
81
|
-
// Here: we pass this._box as parameter but we need to change to _host
|
|
82
|
-
// because we need to get the lasChild (inner content to put in slot)
|
|
83
79
|
_container = this._host;
|
|
84
80
|
return !_container.lastElementChild.shadowRoot ? _container.contains(node) : _container.lastElementChild.shadowRoot.contains(node);
|
|
85
81
|
}
|