@sankhyalabs/ezui 1.1.115 → 1.1.118
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/{ApplicationUtils-c8f07135.js → ApplicationUtils-93721afc.js} +1 -4
- package/dist/cjs/ez-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +6 -2
- package/dist/cjs/ez-date-input.cjs.entry.js +6 -2
- package/dist/cjs/ez-date-time-input.cjs.entry.js +6 -2
- package/dist/cjs/ez-filter-input.cjs.entry.js +73 -0
- package/dist/cjs/ez-form.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +5 -1
- package/dist/cjs/ez-search.cjs.entry.js +17 -13
- package/dist/cjs/ez-text-area.cjs.entry.js +28 -9
- package/dist/cjs/ez-text-input.cjs.entry.js +11 -6
- package/dist/cjs/ez-time-input.cjs.entry.js +7 -2
- package/dist/cjs/ez-toast.cjs.entry.js +53 -10
- package/dist/cjs/ez-upload.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/test-du.cjs.entry.js +2 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ez-button/ez-button.css +2 -3
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +24 -2
- package/dist/collection/components/ez-date-input/ez-date-input.js +24 -2
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +24 -2
- package/dist/collection/components/ez-filter-input/ez-filter-input.css +4 -0
- package/dist/collection/components/ez-filter-input/ez-filter-input.js +248 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js +23 -1
- package/dist/collection/components/ez-search/ez-search.js +35 -13
- package/dist/collection/components/ez-text-area/ez-text-area.css +71 -1
- package/dist/collection/components/ez-text-area/ez-text-area.js +67 -9
- package/dist/collection/components/ez-text-input/ez-text-input.css +78 -0
- package/dist/collection/components/ez-text-input/ez-text-input.js +29 -6
- package/dist/collection/components/ez-time-input/ez-time-input.js +25 -2
- package/dist/collection/components/ez-toast/ez-toast.css +1 -1
- package/dist/collection/components/ez-toast/ez-toast.js +72 -16
- package/dist/collection/components/test-du/test-du.js +2 -1
- package/dist/collection/utils/ApplicationUtils.js +1 -4
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +221 -62
- package/dist/esm/{ApplicationUtils-36e38de9.js → ApplicationUtils-3ca0e68d.js} +1 -4
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +6 -2
- package/dist/esm/ez-date-input.entry.js +6 -2
- package/dist/esm/ez-date-time-input.entry.js +6 -2
- package/dist/esm/ez-filter-input.entry.js +69 -0
- package/dist/esm/ez-form.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +5 -1
- package/dist/esm/ez-search.entry.js +17 -13
- package/dist/esm/ez-text-area.entry.js +28 -9
- package/dist/esm/ez-text-input.entry.js +11 -6
- package/dist/esm/ez-time-input.entry.js +7 -2
- package/dist/esm/ez-toast.entry.js +54 -11
- package/dist/esm/ez-upload.entry.js +1 -1
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/test-du.entry.js +2 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-01169201.entry.js +1 -0
- package/dist/ezui/p-055f1b6a.entry.js +1 -0
- package/dist/ezui/{p-f26f6d67.entry.js → p-126d33e2.entry.js} +1 -1
- package/dist/ezui/{p-3602ab8c.entry.js → p-1339fde7.entry.js} +1 -1
- package/dist/ezui/p-25e050f5.entry.js +1 -0
- package/dist/ezui/p-2f14fe3d.entry.js +1 -0
- package/dist/ezui/{p-62daf508.js → p-3c71a597.js} +1 -1
- package/dist/ezui/p-43feac7d.entry.js +1 -0
- package/dist/ezui/p-6f39077b.entry.js +1 -0
- package/dist/ezui/p-83d5f1ca.entry.js +1 -0
- package/dist/ezui/p-8c447785.entry.js +1 -0
- package/dist/ezui/p-8f2d46f8.entry.js +1 -0
- package/dist/ezui/p-c13353f1.entry.js +1 -0
- package/dist/ezui/p-d3d3e2ac.entry.js +1 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +4 -0
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +4 -0
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +4 -0
- package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +52 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +4 -0
- package/dist/types/components/ez-search/ez-search.d.ts +24 -20
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +11 -0
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +4 -0
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +4 -0
- package/dist/types/components/ez-toast/ez-toast.d.ts +15 -1
- package/dist/types/components.d.ts +154 -1
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-25e87823.entry.js +0 -1
- package/dist/ezui/p-3a8bf0a8.entry.js +0 -1
- package/dist/ezui/p-44d4f8d6.entry.js +0 -1
- package/dist/ezui/p-7247379d.entry.js +0 -1
- package/dist/ezui/p-73d45b12.entry.js +0 -1
- package/dist/ezui/p-8248690a.entry.js +0 -1
- package/dist/ezui/p-9aecc079.entry.js +0 -1
- package/dist/ezui/p-bc2834fa.entry.js +0 -1
- package/dist/ezui/p-c27495d9.entry.js +0 -1
- package/dist/ezui/p-fb73f557.entry.js +0 -1
|
@@ -3,21 +3,25 @@ import CSSVarsUtils from "../../utils/CSSVarsUtils";
|
|
|
3
3
|
export class EzSearch {
|
|
4
4
|
constructor() {
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
* Deixa o campo disponível ou não.
|
|
7
|
+
*/
|
|
8
8
|
this.enabled = true;
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* Ajusta a opção de mostrar o "value" ao selecionar uma opção.
|
|
11
|
+
*/
|
|
12
12
|
this.showSelectedValue = true;
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
* Ajusta a opção de mostrar o "value" para cada opção.
|
|
15
|
+
*/
|
|
16
16
|
this.showOptionValue = true;
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
* Remove a opção vazia da lista de opções
|
|
19
|
+
*/
|
|
20
20
|
this.suppressEmptyOption = false;
|
|
21
|
+
/**
|
|
22
|
+
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
23
|
+
*/
|
|
24
|
+
this.mode = "regular";
|
|
21
25
|
}
|
|
22
26
|
updateValue() {
|
|
23
27
|
if (this._comboElement) {
|
|
@@ -25,14 +29,14 @@ export class EzSearch {
|
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
* Realiza o foco no componente de pesquisa
|
|
33
|
+
*/
|
|
30
34
|
async setFocus() {
|
|
31
35
|
this._comboElement.setFocus();
|
|
32
36
|
}
|
|
33
37
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
* Remove o foco no componente de pesquisa
|
|
39
|
+
*/
|
|
36
40
|
async setBlur() {
|
|
37
41
|
this._comboElement.setBlur();
|
|
38
42
|
}
|
|
@@ -45,7 +49,7 @@ export class EzSearch {
|
|
|
45
49
|
CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
|
|
46
50
|
}
|
|
47
51
|
render() {
|
|
48
|
-
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, suppressEmptyOption: this.suppressEmptyOption }));
|
|
52
|
+
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, suppressEmptyOption: this.suppressEmptyOption, mode: this.mode }));
|
|
49
53
|
}
|
|
50
54
|
;
|
|
51
55
|
static get is() { return "ez-search"; }
|
|
@@ -203,6 +207,24 @@ export class EzSearch {
|
|
|
203
207
|
"attribute": "suppress-empty-option",
|
|
204
208
|
"reflect": false,
|
|
205
209
|
"defaultValue": "false"
|
|
210
|
+
},
|
|
211
|
+
"mode": {
|
|
212
|
+
"type": "string",
|
|
213
|
+
"mutable": false,
|
|
214
|
+
"complexType": {
|
|
215
|
+
"original": "string",
|
|
216
|
+
"resolved": "string",
|
|
217
|
+
"references": {}
|
|
218
|
+
},
|
|
219
|
+
"required": false,
|
|
220
|
+
"optional": false,
|
|
221
|
+
"docs": {
|
|
222
|
+
"tags": [],
|
|
223
|
+
"text": "Define o modo do tamanho do campo; op\u00E7\u00F5es: slim e regular."
|
|
224
|
+
},
|
|
225
|
+
"attribute": "mode",
|
|
226
|
+
"reflect": true,
|
|
227
|
+
"defaultValue": "\"regular\""
|
|
206
228
|
}
|
|
207
229
|
}; }
|
|
208
230
|
static get events() { return [{
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
/*@doc Define a família da fonte do input, label e caixa de mensagem do componente.*/
|
|
12
12
|
--text-area--font-family: var(--font-pattern, Arial);
|
|
13
13
|
/*@doc Define o peso da fonte do label do componente.*/
|
|
14
|
-
--text-area--font-weight: var(--text-weight--
|
|
14
|
+
--text-area--font-weight: var(--text-weight--medium, 400);
|
|
15
15
|
/*@doc Define a cor da fonte do input e label do componente.*/
|
|
16
16
|
--text-area--color: var(--title--primary, #000);
|
|
17
17
|
|
|
@@ -162,4 +162,74 @@ textarea:disabled {
|
|
|
162
162
|
|
|
163
163
|
.textarea__label--disabled {
|
|
164
164
|
color: var(--text-area__input--disabled--color);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.textarea--slim {
|
|
168
|
+
/*public*/
|
|
169
|
+
margin-top: var(--space--small, 6px);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.textarea--slim::-webkit-input-placeholder { /* Edge */
|
|
173
|
+
/*public*/
|
|
174
|
+
font-family: var(--text-area--font-family);
|
|
175
|
+
font-size: var(--text-area--font-size);
|
|
176
|
+
font-weight: var(--text-area--font-weight);
|
|
177
|
+
color: var(--text-area--color);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.textarea--slim:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
|
|
181
|
+
/*public*/
|
|
182
|
+
font-family: var(--text-area--font-family);
|
|
183
|
+
font-size: var(--text-area--font-size);
|
|
184
|
+
font-weight: var(--text-area--font-weight);
|
|
185
|
+
color: var(--text-area--color);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.textarea--slim::-moz-placeholder { /* Mozilla Firefox 19+ */
|
|
189
|
+
/*public*/
|
|
190
|
+
font-family: var(--text-area--font-family);
|
|
191
|
+
font-size: var(--text-area--font-size);
|
|
192
|
+
font-weight: var(--text-area--font-weight);
|
|
193
|
+
color: var(--text-area--color);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.textarea--slim:-ms-input-placeholder { /* Internet Explorer 10-11 */
|
|
197
|
+
/*public*/
|
|
198
|
+
font-family: var(--text-area--font-family);
|
|
199
|
+
font-size: var(--text-area--font-size);
|
|
200
|
+
font-weight: var(--text-area--font-weight);
|
|
201
|
+
color: var(--text-area--color);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.textarea--slim::placeholder {
|
|
205
|
+
/*public*/
|
|
206
|
+
font-family: var(--text-area--font-family);
|
|
207
|
+
font-size: var(--text-area--font-size);
|
|
208
|
+
font-weight: var(--text-area--font-weight);
|
|
209
|
+
color: var(--text-area--color);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.textarea--slim:disabled::-webkit-input-placeholder { /* WebKit browsers */
|
|
213
|
+
/*public*/
|
|
214
|
+
color: var(--text-area__input--disabled--color);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.textarea--slim:disabled:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
|
|
218
|
+
/*public*/
|
|
219
|
+
color: var(--text-area__input--disabled--color);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.textarea--slim:disabled::-moz-placeholder { /* Mozilla Firefox 19+ */
|
|
223
|
+
/*public*/
|
|
224
|
+
color: var(--text-area__input--disabled--color);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.textarea--slim:disabled:-ms-input-placeholder { /* Internet Explorer 10+ */
|
|
228
|
+
/*public*/
|
|
229
|
+
color: var(--text-area__input--disabled--color);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.textarea--slim:disabled::placeholder {
|
|
233
|
+
/*public*/
|
|
234
|
+
color: var(--text-area__input--disabled--color);
|
|
165
235
|
}
|
|
@@ -6,19 +6,24 @@ export class EzTextArea {
|
|
|
6
6
|
*/
|
|
7
7
|
this.enabled = true;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Permite exibir a mensagem de erro.
|
|
10
10
|
*/
|
|
11
|
-
this.
|
|
11
|
+
this.canShowError = true;
|
|
12
|
+
/**
|
|
13
|
+
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
14
|
+
*/
|
|
15
|
+
this.mode = "regular";
|
|
12
16
|
}
|
|
13
17
|
showError() {
|
|
18
|
+
var _a, _b;
|
|
14
19
|
const hasError = typeof this.errorMessage === 'string' && this.errorMessage !== '';
|
|
15
20
|
if (hasError) {
|
|
16
21
|
this._container.classList.add('hasError');
|
|
17
|
-
this._messageBoxElem.classList.add('hasError');
|
|
22
|
+
(_a = this._messageBoxElem) === null || _a === void 0 ? void 0 : _a.classList.add('hasError');
|
|
18
23
|
}
|
|
19
24
|
else {
|
|
20
25
|
this._container.classList.remove('hasError');
|
|
21
|
-
this._messageBoxElem.classList.remove('hasError');
|
|
26
|
+
(_b = this._messageBoxElem) === null || _b === void 0 ? void 0 : _b.classList.remove('hasError');
|
|
22
27
|
}
|
|
23
28
|
}
|
|
24
29
|
updateInputValue() {
|
|
@@ -27,8 +32,18 @@ export class EzTextArea {
|
|
|
27
32
|
this.adjustFloatingLabel();
|
|
28
33
|
this.ezChange.emit(this.value);
|
|
29
34
|
}
|
|
35
|
+
adjustRowsForMode() {
|
|
36
|
+
if (this._initialRows == undefined) {
|
|
37
|
+
this._initialRows = this.rows > 0 ? this.rows : undefined;
|
|
38
|
+
}
|
|
39
|
+
this.rows = this._initialRows > 0 ? this._initialRows : this.mode != "slim" ? 4 : 2;
|
|
40
|
+
}
|
|
41
|
+
adjustRowsValue() {
|
|
42
|
+
this.rows = this.rows > 0 ? this.rows : this.mode != "slim" ? 4 : 2;
|
|
43
|
+
this._initialRows = this.rows;
|
|
44
|
+
}
|
|
30
45
|
adjustFloatingLabel() {
|
|
31
|
-
if (this.label) {
|
|
46
|
+
if (this.label && this._labelElem) {
|
|
32
47
|
const hasValue = this.value && this.value.toString().length > 0;
|
|
33
48
|
const containsFloatedClass = this._labelElem.classList.contains("textarea__label--floated");
|
|
34
49
|
if (hasValue || this.isFocused()) {
|
|
@@ -88,15 +103,17 @@ export class EzTextArea {
|
|
|
88
103
|
componentDidLoad() {
|
|
89
104
|
this.showError();
|
|
90
105
|
this.adjustFloatingLabel();
|
|
106
|
+
this.adjustRowsForMode();
|
|
91
107
|
}
|
|
92
108
|
render() {
|
|
93
109
|
return (h(Host, null,
|
|
94
110
|
h("div", { class: "textarea", ref: (el) => this._container = el },
|
|
95
|
-
this.label ?
|
|
111
|
+
this.label && this.mode != "slim" ?
|
|
96
112
|
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)
|
|
97
113
|
: null,
|
|
98
|
-
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 })),
|
|
99
|
-
|
|
114
|
+
h("textarea", { onFocus: () => this.handleFocus(), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, class: this.mode == "slim" ? "textarea--slim" : "", placeholder: this.mode == "slim" && this.label ? this.label : "", onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, onKeyDown: event => event.stopPropagation(), rows: this.rows })),
|
|
115
|
+
this.canShowError && this.mode != "slim" &&
|
|
116
|
+
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
|
|
100
117
|
}
|
|
101
118
|
static get is() { return "ez-text-area"; }
|
|
102
119
|
static get encapsulation() { return "shadow"; }
|
|
@@ -208,8 +225,43 @@ export class EzTextArea {
|
|
|
208
225
|
"text": "Ajusta o n\u00FAmero de linhas e consequentemente o height do textarea. Valor default: 4"
|
|
209
226
|
},
|
|
210
227
|
"attribute": "rows",
|
|
228
|
+
"reflect": true
|
|
229
|
+
},
|
|
230
|
+
"canShowError": {
|
|
231
|
+
"type": "boolean",
|
|
232
|
+
"mutable": false,
|
|
233
|
+
"complexType": {
|
|
234
|
+
"original": "boolean",
|
|
235
|
+
"resolved": "boolean",
|
|
236
|
+
"references": {}
|
|
237
|
+
},
|
|
238
|
+
"required": false,
|
|
239
|
+
"optional": false,
|
|
240
|
+
"docs": {
|
|
241
|
+
"tags": [],
|
|
242
|
+
"text": "Permite exibir a mensagem de erro."
|
|
243
|
+
},
|
|
244
|
+
"attribute": "can-show-error",
|
|
245
|
+
"reflect": true,
|
|
246
|
+
"defaultValue": "true"
|
|
247
|
+
},
|
|
248
|
+
"mode": {
|
|
249
|
+
"type": "string",
|
|
250
|
+
"mutable": false,
|
|
251
|
+
"complexType": {
|
|
252
|
+
"original": "string",
|
|
253
|
+
"resolved": "string",
|
|
254
|
+
"references": {}
|
|
255
|
+
},
|
|
256
|
+
"required": false,
|
|
257
|
+
"optional": false,
|
|
258
|
+
"docs": {
|
|
259
|
+
"tags": [],
|
|
260
|
+
"text": "Define o modo do tamanho do campo; op\u00E7\u00F5es: slim e regular."
|
|
261
|
+
},
|
|
262
|
+
"attribute": "mode",
|
|
211
263
|
"reflect": true,
|
|
212
|
-
"defaultValue": "
|
|
264
|
+
"defaultValue": "\"regular\""
|
|
213
265
|
}
|
|
214
266
|
}; }
|
|
215
267
|
static get events() { return [{
|
|
@@ -269,5 +321,11 @@ export class EzTextArea {
|
|
|
269
321
|
}, {
|
|
270
322
|
"propName": "value",
|
|
271
323
|
"methodName": "updateInputValue"
|
|
324
|
+
}, {
|
|
325
|
+
"propName": "mode",
|
|
326
|
+
"methodName": "adjustRowsForMode"
|
|
327
|
+
}, {
|
|
328
|
+
"propName": "rows",
|
|
329
|
+
"methodName": "adjustRowsValue"
|
|
272
330
|
}]; }
|
|
273
331
|
}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
--ez-text-input--width: 100%;
|
|
7
7
|
/*@doc Define a largura do slot que contém o ícone.*/
|
|
8
8
|
--ez-text-input__icon--width: 48px;
|
|
9
|
+
/*@doc Define a altura do componente em modo "slim".*/
|
|
10
|
+
--ez-text-input--height--slim: 32px;
|
|
9
11
|
|
|
10
12
|
/* general */
|
|
11
13
|
/*@doc Define o raio da borda do input do componente.*/
|
|
@@ -110,6 +112,10 @@ input.hasError {
|
|
|
110
112
|
border-color: var(--ez-text-input__input--error--border-color);
|
|
111
113
|
}
|
|
112
114
|
|
|
115
|
+
input:disabled.hasError {
|
|
116
|
+
color: var(--ez-text-input__input--disabled--color);
|
|
117
|
+
}
|
|
118
|
+
|
|
113
119
|
input.text--right {
|
|
114
120
|
text-align: right;
|
|
115
121
|
}
|
|
@@ -193,4 +199,76 @@ input.text--right {
|
|
|
193
199
|
.input--with--label {
|
|
194
200
|
/*public*/
|
|
195
201
|
padding-bottom: 0;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.input--slim {
|
|
205
|
+
/*public*/
|
|
206
|
+
padding-top: var(--space--small, 3px);
|
|
207
|
+
padding-bottom: var(--space--small, 3px);
|
|
208
|
+
height: var(--ez-text-input--height--slim);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.input--slim::-webkit-input-placeholder { /* Edge */
|
|
212
|
+
/*public*/
|
|
213
|
+
font-family: var(--ez-text-input--font-family);
|
|
214
|
+
font-size: var(--ez-text-input--font-size);
|
|
215
|
+
font-weight: var(--ez-text-input--font-weight);
|
|
216
|
+
color: var(--ez-text-input--color);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.input--slim:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
|
|
220
|
+
/*public*/
|
|
221
|
+
font-family: var(--ez-text-input--font-family);
|
|
222
|
+
font-size: var(--ez-text-input--font-size);
|
|
223
|
+
font-weight: var(--ez-text-input--font-weight);
|
|
224
|
+
color: var(--ez-text-input--color);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.input--slim::-moz-placeholder { /* Mozilla Firefox 19+ */
|
|
228
|
+
/*public*/
|
|
229
|
+
font-family: var(--ez-text-input--font-family);
|
|
230
|
+
font-size: var(--ez-text-input--font-size);
|
|
231
|
+
font-weight: var(--ez-text-input--font-weight);
|
|
232
|
+
color: var(--ez-text-input--color);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.input--slim:-ms-input-placeholder { /* Internet Explorer 10-11 */
|
|
236
|
+
/*public*/
|
|
237
|
+
font-family: var(--ez-text-input--font-family);
|
|
238
|
+
font-size: var(--ez-text-input--font-size);
|
|
239
|
+
font-weight: var(--ez-text-input--font-weight);
|
|
240
|
+
color: var(--ez-text-input--color);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.input--slim::placeholder {
|
|
244
|
+
/*public*/
|
|
245
|
+
font-family: var(--ez-text-input--font-family);
|
|
246
|
+
font-size: var(--ez-text-input--font-size);
|
|
247
|
+
font-weight: var(--ez-text-input--font-weight);
|
|
248
|
+
color: var(--ez-text-input--color);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.input--slim:disabled::-webkit-input-placeholder { /* WebKit browsers */
|
|
252
|
+
/*public*/
|
|
253
|
+
color: var(--ez-text-input__input--disabled--color);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.input--slim:disabled:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
|
|
257
|
+
/*public*/
|
|
258
|
+
color: var(--ez-text-input__input--disabled--color);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.input--slim:disabled::-moz-placeholder { /* Mozilla Firefox 19+ */
|
|
262
|
+
/*public*/
|
|
263
|
+
color: var(--ez-text-input__input--disabled--color);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.input--slim:disabled:-ms-input-placeholder { /* Internet Explorer 10+ */
|
|
267
|
+
/*public*/
|
|
268
|
+
color: var(--ez-text-input__input--disabled--color);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.input--slim:disabled::placeholder {
|
|
272
|
+
/*public*/
|
|
273
|
+
color: var(--ez-text-input__input--disabled--color);
|
|
196
274
|
}
|
|
@@ -10,16 +10,21 @@ export class EzTextInput {
|
|
|
10
10
|
* Permite exibir a mensagem de erro.
|
|
11
11
|
*/
|
|
12
12
|
this.canShowError = true;
|
|
13
|
+
/**
|
|
14
|
+
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
15
|
+
*/
|
|
16
|
+
this.mode = "regular";
|
|
13
17
|
}
|
|
14
18
|
showError() {
|
|
19
|
+
var _a, _b;
|
|
15
20
|
const hasError = typeof this.errorMessage === "string" && this.errorMessage !== "";
|
|
16
21
|
if (hasError) {
|
|
17
22
|
this._inputElem.classList.add("hasError");
|
|
18
|
-
this._messageBoxElem.classList.add("hasError");
|
|
23
|
+
(_a = this._messageBoxElem) === null || _a === void 0 ? void 0 : _a.classList.add("hasError");
|
|
19
24
|
}
|
|
20
25
|
else {
|
|
21
26
|
this._inputElem.classList.remove("hasError");
|
|
22
|
-
this._messageBoxElem.classList.remove("hasError");
|
|
27
|
+
(_b = this._messageBoxElem) === null || _b === void 0 ? void 0 : _b.classList.remove("hasError");
|
|
23
28
|
}
|
|
24
29
|
}
|
|
25
30
|
prepareMask() {
|
|
@@ -124,7 +129,7 @@ export class EzTextInput {
|
|
|
124
129
|
content.style.overflow = "hidden";
|
|
125
130
|
content.style.top = "0px";
|
|
126
131
|
content.style.width = "var(--ez-text-input__icon--width)";
|
|
127
|
-
content.style.height = "var(--ez-text-input--height)";
|
|
132
|
+
content.style.height = this.mode != "slim" ? "var(--ez-text-input--height)" : "var(--ez-text-input--height--slim)";
|
|
128
133
|
if (slot.name == "leftIcon") {
|
|
129
134
|
content.style.left = "0px";
|
|
130
135
|
content.style.borderRadius = "var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)";
|
|
@@ -177,12 +182,12 @@ export class EzTextInput {
|
|
|
177
182
|
render() {
|
|
178
183
|
return (h(Host, null,
|
|
179
184
|
h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }),
|
|
180
|
-
this.label ?
|
|
185
|
+
this.label && this.mode != "slim" ?
|
|
181
186
|
h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "input__label" : "input__label input__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
|
|
182
187
|
: null,
|
|
183
|
-
h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }),
|
|
188
|
+
h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", class: this.mode == "slim" ? "input--slim" : "", placeholder: this.mode == "slim" && this.label ? this.label : "", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }),
|
|
184
189
|
h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }),
|
|
185
|
-
this.canShowError &&
|
|
190
|
+
this.canShowError && this.mode != "slim" &&
|
|
186
191
|
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
|
|
187
192
|
}
|
|
188
193
|
static get is() { return "ez-text-input"; }
|
|
@@ -331,6 +336,24 @@ export class EzTextInput {
|
|
|
331
336
|
},
|
|
332
337
|
"attribute": "restrict",
|
|
333
338
|
"reflect": false
|
|
339
|
+
},
|
|
340
|
+
"mode": {
|
|
341
|
+
"type": "string",
|
|
342
|
+
"mutable": false,
|
|
343
|
+
"complexType": {
|
|
344
|
+
"original": "string",
|
|
345
|
+
"resolved": "string",
|
|
346
|
+
"references": {}
|
|
347
|
+
},
|
|
348
|
+
"required": false,
|
|
349
|
+
"optional": false,
|
|
350
|
+
"docs": {
|
|
351
|
+
"tags": [],
|
|
352
|
+
"text": "Define o modo do tamanho do campo; op\u00E7\u00F5es: slim e regular."
|
|
353
|
+
},
|
|
354
|
+
"attribute": "mode",
|
|
355
|
+
"reflect": true,
|
|
356
|
+
"defaultValue": "\"regular\""
|
|
334
357
|
}
|
|
335
358
|
}; }
|
|
336
359
|
static get events() { return [{
|
|
@@ -12,6 +12,10 @@ export class EzTimeInput {
|
|
|
12
12
|
* Define se o componente irá ou não considerar os segundos
|
|
13
13
|
*/
|
|
14
14
|
this.showSeconds = false;
|
|
15
|
+
/**
|
|
16
|
+
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
17
|
+
*/
|
|
18
|
+
this.mode = "regular";
|
|
15
19
|
}
|
|
16
20
|
prepareMask() {
|
|
17
21
|
if (this.showSeconds) {
|
|
@@ -73,7 +77,8 @@ export class EzTimeInput {
|
|
|
73
77
|
}
|
|
74
78
|
}
|
|
75
79
|
clearField() {
|
|
76
|
-
this.viewValue =
|
|
80
|
+
this.viewValue = '';
|
|
81
|
+
this.value = undefined;
|
|
77
82
|
}
|
|
78
83
|
handleChange() {
|
|
79
84
|
this.viewValue = this._inputElem.value;
|
|
@@ -97,7 +102,7 @@ export class EzTimeInput {
|
|
|
97
102
|
}
|
|
98
103
|
render() {
|
|
99
104
|
return (h(Host, null,
|
|
100
|
-
h("ez-text-input", { ref: (el) => this._inputElem = el, value: this.viewValue, enabled: this.enabled, label: this.label, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, errorMessage: this.errorMessage },
|
|
105
|
+
h("ez-text-input", { ref: (el) => this._inputElem = el, value: this.viewValue, enabled: this.enabled, label: this.label, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, errorMessage: this.errorMessage, mode: this.mode },
|
|
101
106
|
h("ez-icon", { slot: "leftIcon", href: getSpritePath("timer-outline") }))));
|
|
102
107
|
}
|
|
103
108
|
static get is() { return "ez-time-input"; }
|
|
@@ -213,6 +218,24 @@ export class EzTimeInput {
|
|
|
213
218
|
"attribute": "show-seconds",
|
|
214
219
|
"reflect": true,
|
|
215
220
|
"defaultValue": "false"
|
|
221
|
+
},
|
|
222
|
+
"mode": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"mutable": false,
|
|
225
|
+
"complexType": {
|
|
226
|
+
"original": "string",
|
|
227
|
+
"resolved": "string",
|
|
228
|
+
"references": {}
|
|
229
|
+
},
|
|
230
|
+
"required": false,
|
|
231
|
+
"optional": false,
|
|
232
|
+
"docs": {
|
|
233
|
+
"tags": [],
|
|
234
|
+
"text": "Define o modo do tamanho do campo; op\u00E7\u00F5es: slim e regular."
|
|
235
|
+
},
|
|
236
|
+
"attribute": "mode",
|
|
237
|
+
"reflect": true,
|
|
238
|
+
"defaultValue": "\"regular\""
|
|
216
239
|
}
|
|
217
240
|
}; }
|
|
218
241
|
static get methods() { return {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { Component, h, Prop,
|
|
1
|
+
import { Component, h, Method, Prop, Host, forceUpdate } from '@stencil/core';
|
|
2
2
|
export class EzToast {
|
|
3
3
|
constructor() {
|
|
4
|
+
this._nextMessages = [];
|
|
5
|
+
this._currentMessageInfo = { message: "", fadeTime: undefined, useIcon: undefined };
|
|
6
|
+
this._toastOpenedClass = "toast__container--opened";
|
|
7
|
+
this._lastTimeOut = undefined;
|
|
4
8
|
this._lang = "pt"; // Controla qual idioma será usado para definir a regras de hifenização.
|
|
5
9
|
/**
|
|
6
10
|
* Controla o tempo de exibição do componente em milissegundos.
|
|
@@ -18,21 +22,61 @@ export class EzToast {
|
|
|
18
22
|
/**
|
|
19
23
|
* Exibe o componente na tela.
|
|
20
24
|
*/
|
|
21
|
-
async show() {
|
|
22
|
-
|
|
25
|
+
async show(message, fadeTime, useIcon, canClose) {
|
|
26
|
+
return new Promise(resolve => {
|
|
27
|
+
var _a;
|
|
28
|
+
if ((_a = this.container) === null || _a === void 0 ? void 0 : _a.classList.contains(this._toastOpenedClass)) {
|
|
29
|
+
this._nextMessages.push({ message, fadeTime, useIcon, canClose, callBack: resolve });
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
this._currentMessageInfo.message = message || this.message;
|
|
33
|
+
this._currentMessageInfo.fadeTime = fadeTime || this.fadeTime;
|
|
34
|
+
this._currentMessageInfo.useIcon = useIcon || this.useIcon;
|
|
35
|
+
this._currentMessageInfo.callBack = resolve;
|
|
36
|
+
if (canClose) {
|
|
37
|
+
this._currentMessageInfo.canClose = this.canClose;
|
|
38
|
+
}
|
|
39
|
+
forceUpdate(this);
|
|
40
|
+
this.displayToast();
|
|
41
|
+
this._lastTimeOut = setTimeout(() => {
|
|
42
|
+
this.hideToast();
|
|
43
|
+
}, this._currentMessageInfo.fadeTime + 400);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
hideToast() {
|
|
48
|
+
this.makeToastInvisible();
|
|
49
|
+
if (this._nextMessages.length > 0) {
|
|
50
|
+
if (this._currentMessageInfo.callBack) {
|
|
51
|
+
this._currentMessageInfo.callBack(true);
|
|
52
|
+
}
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
let newMessageInfo = this._nextMessages.shift();
|
|
55
|
+
this.show(newMessageInfo.message, newMessageInfo.fadeTime, newMessageInfo.useIcon);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (this._currentMessageInfo.callBack) {
|
|
59
|
+
this._currentMessageInfo.callBack(true);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
makeToastInvisible() {
|
|
63
|
+
this.container.classList.remove(this._toastOpenedClass);
|
|
64
|
+
this.container.style.animation = `none`;
|
|
65
|
+
if (this._lastTimeOut)
|
|
66
|
+
clearTimeout(this._lastTimeOut);
|
|
67
|
+
}
|
|
68
|
+
displayToast() {
|
|
69
|
+
this.container.classList.add(this._toastOpenedClass);
|
|
23
70
|
this.container.style.animation = `fadein 0.5s, fadeout 0.5s ${this.fadeTime / 1000}s`;
|
|
24
|
-
setTimeout(() => {
|
|
25
|
-
this.container.classList.remove("toast__container--oppened");
|
|
26
|
-
this.container.style.animation = `none`;
|
|
27
|
-
}, this.fadeTime + 400);
|
|
28
71
|
}
|
|
29
72
|
render() {
|
|
30
|
-
return (h(
|
|
31
|
-
this.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
73
|
+
return (h(Host, null,
|
|
74
|
+
h("div", { ref: (el) => this.container = el, class: "toast__container" },
|
|
75
|
+
this._currentMessageInfo.useIcon &&
|
|
76
|
+
h("slot", { name: "icon" }),
|
|
77
|
+
h("div", { lang: this._lang, class: this._currentMessageInfo.useIcon ? "message__container message__conteiner--icon" : "message__container", title: this._currentMessageInfo.message, innerHTML: this._currentMessageInfo.message }),
|
|
78
|
+
this._currentMessageInfo.canClose &&
|
|
79
|
+
h("button", { class: "btn-close", onClick: () => { this.hideToast(); } }))));
|
|
36
80
|
}
|
|
37
81
|
static get is() { return "ez-toast"; }
|
|
38
82
|
static get encapsulation() { return "shadow"; }
|
|
@@ -118,14 +162,26 @@ export class EzToast {
|
|
|
118
162
|
static get methods() { return {
|
|
119
163
|
"show": {
|
|
120
164
|
"complexType": {
|
|
121
|
-
"signature": "() => Promise<
|
|
122
|
-
"parameters": [
|
|
165
|
+
"signature": "(message: string, fadeTime: number, useIcon: boolean, canClose?: boolean) => Promise<unknown>",
|
|
166
|
+
"parameters": [{
|
|
167
|
+
"tags": [],
|
|
168
|
+
"text": ""
|
|
169
|
+
}, {
|
|
170
|
+
"tags": [],
|
|
171
|
+
"text": ""
|
|
172
|
+
}, {
|
|
173
|
+
"tags": [],
|
|
174
|
+
"text": ""
|
|
175
|
+
}, {
|
|
176
|
+
"tags": [],
|
|
177
|
+
"text": ""
|
|
178
|
+
}],
|
|
123
179
|
"references": {
|
|
124
180
|
"Promise": {
|
|
125
181
|
"location": "global"
|
|
126
182
|
}
|
|
127
183
|
},
|
|
128
|
-
"return": "Promise<
|
|
184
|
+
"return": "Promise<unknown>"
|
|
129
185
|
},
|
|
130
186
|
"docs": {
|
|
131
187
|
"text": "Exibe o componente na tela.",
|
|
@@ -7,7 +7,8 @@ export class TestDu {
|
|
|
7
7
|
private _ezDateTimeInput// : HTMLEzDateTimeInput;
|
|
8
8
|
private _ezNumberInput// : HTMLEzNumberInput
|
|
9
9
|
private _ezSearch// : HTMLEzSearch
|
|
10
|
-
private _ezUpload// : HTMLEzUpload
|
|
10
|
+
private _ezUpload// : HTMLEzUpload
|
|
11
|
+
private _ezFilterInput// : HTMLEzFilterInput*/
|
|
11
12
|
componentWillLoad() {
|
|
12
13
|
this.dataUnit = new DataUnit("testes_com_formulario");
|
|
13
14
|
this.dataUnit.metadata = {
|
|
@@ -24,10 +24,7 @@ export default class ApplicationUtils {
|
|
|
24
24
|
toast = document.createElement("ez-toast");
|
|
25
25
|
window.document.body.appendChild(toast);
|
|
26
26
|
}
|
|
27
|
-
toast.
|
|
28
|
-
toast.message = message;
|
|
29
|
-
toast.fadeTime = 4000;
|
|
30
|
-
toast.show();
|
|
27
|
+
toast.show(message, 4000, false, options.canClose);
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
30
|
ApplicationUtils.defaultMessageOptions = {
|