@sankhyalabs/ezui 1.1.67 → 1.1.70
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 +133 -144
- package/dist/cjs/ez-dialog.cjs.entry.js +7 -1
- package/dist/cjs/ez-modal.cjs.entry.js +16 -69
- package/dist/cjs/ez-number-input.cjs.entry.js +9 -9
- package/dist/cjs/ez-popover.cjs.entry.js +13 -18
- package/dist/cjs/ez-popup.cjs.entry.js +2 -2
- 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 +48 -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.css +46 -44
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +38 -39
- package/dist/collection/components/ez-date-input/ez-date-input.js +9 -9
- package/dist/collection/components/ez-dialog/ez-dialog.css +43 -43
- package/dist/collection/components/ez-dialog/ez-dialog.js +10 -4
- package/dist/collection/components/ez-form/subcomponents/structure/Field.js +6 -6
- package/dist/collection/components/ez-form/subcomponents/structure/FormSheet.js +1 -1
- 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 +30 -83
- 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 +4 -5
- package/dist/collection/components/ez-popover/ez-popover.js +25 -30
- package/dist/collection/components/ez-popup/ez-popup.css +7 -7
- package/dist/collection/components/ez-popup/ez-popup.js +4 -4
- package/dist/collection/components/ez-search/ez-search.js +5 -5
- package/dist/collection/components/ez-tabselector/ez-tabselector.css +7 -10
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +68 -70
- 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 +198 -261
- package/dist/esm/ez-action-chip.entry.js +1 -1
- package/dist/esm/ez-button_16.entry.js +133 -144
- package/dist/esm/ez-dialog.entry.js +7 -1
- package/dist/esm/ez-modal.entry.js +16 -69
- package/dist/esm/ez-number-input.entry.js +9 -9
- package/dist/esm/ez-popover.entry.js +13 -18
- package/dist/esm/ez-popup.entry.js +2 -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-1bc9ddad.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-a7e23f65.entry.js +1 -0
- package/dist/ezui/p-a88ee12f.entry.js +1 -0
- package/dist/ezui/p-b692a0ab.entry.js +1 -0
- package/dist/ezui/p-b6e0fd3e.entry.js +1 -0
- 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 +8 -8
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +2 -2
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +8 -2
- 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 +9 -9
- 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-popover/ez-popover.d.ts +4 -5
- package/dist/types/components/ez-popup/ez-popup.d.ts +3 -3
- package/dist/types/components/ez-search/ez-search.d.ts +3 -3
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +19 -10
- 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 +142 -114
- package/package.json +2 -1
- package/dist/ezui/p-7c7dbfcb.entry.js +0 -1
- package/dist/ezui/p-8c8f1c00.entry.js +0 -1
- package/dist/ezui/p-afc553a4.entry.js +0 -1
- package/dist/ezui/p-d185d7e8.entry.js +0 -1
- package/dist/ezui/p-ee5058c1.entry.js +0 -1
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
import { Component, Event, Element, h, Prop, Host } from
|
|
1
|
+
import { Component, Event, Element, h, Prop, Host } from "@stencil/core";
|
|
2
2
|
export class EzTabselector {
|
|
3
3
|
constructor() {
|
|
4
|
-
this.
|
|
5
|
-
if (ev.key ===
|
|
6
|
-
this.
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
9
|
-
this.handleTabClick(this.
|
|
4
|
+
this.setFocusedParam = (ev) => {
|
|
5
|
+
if (ev.key === "Enter") {
|
|
6
|
+
this.selectedIndex = this.focusedIndex;
|
|
7
|
+
this.focusedIndex = undefined;
|
|
8
|
+
this.selectedTab = this._processedTabs[this.selectedIndex]["tabKey"];
|
|
9
|
+
this.handleTabClick(this.selectedTab, parseInt(this.selectedIndex));
|
|
10
10
|
ev.preventDefault();
|
|
11
|
-
this.setFocusedTab(this.
|
|
11
|
+
this.setFocusedTab(this.selectedIndex);
|
|
12
12
|
}
|
|
13
|
-
else if (ev.key ===
|
|
13
|
+
else if (ev.key === "ArrowLeft" || ev.key === "ArrowRight") {
|
|
14
14
|
let operator = undefined;
|
|
15
|
-
if (ev.key ===
|
|
15
|
+
if (ev.key === "ArrowLeft") {
|
|
16
16
|
operator = false;
|
|
17
17
|
}
|
|
18
|
-
else if (ev.key ===
|
|
18
|
+
else if (ev.key === "ArrowRight") {
|
|
19
19
|
operator = true;
|
|
20
20
|
}
|
|
21
21
|
else {
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
if (this.
|
|
24
|
+
if (this.focusedIndex === undefined) {
|
|
25
25
|
if (operator === false) {
|
|
26
|
-
this.
|
|
26
|
+
this.focusedIndex = this.selectedIndex !== undefined ? (parseInt(this.selectedIndex) - 1).toString() : undefined;
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
|
-
this.
|
|
29
|
+
this.focusedIndex = this.selectedIndex !== undefined ? (parseInt(this.selectedIndex) + 1).toString() : undefined;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
33
33
|
if (operator === false) {
|
|
34
|
-
this.
|
|
34
|
+
this.focusedIndex = (parseInt(this.focusedIndex) - 1).toString();
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
|
-
this.
|
|
37
|
+
this.focusedIndex = (parseInt(this.focusedIndex) + 1).toString();
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
if (parseInt(this.
|
|
41
|
-
this.
|
|
40
|
+
if (parseInt(this.focusedIndex) < 0) {
|
|
41
|
+
this.focusedIndex = "0";
|
|
42
42
|
}
|
|
43
|
-
else if (parseInt(this.
|
|
44
|
-
this.
|
|
43
|
+
else if (parseInt(this.focusedIndex) > this._processedTabs.length - 1) {
|
|
44
|
+
this.focusedIndex = (this._processedTabs.length - 1).toString();
|
|
45
45
|
}
|
|
46
|
-
this.
|
|
47
|
-
this.setFocusedTab(this.
|
|
48
|
-
this.
|
|
46
|
+
this.setFocusedBtn(true, this.focusedIndex);
|
|
47
|
+
this.setFocusedTab(this.focusedIndex);
|
|
48
|
+
this.ezChange.emit();
|
|
49
49
|
}
|
|
50
|
-
else if (ev.key ===
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
53
|
-
this.handleTabClick(this.
|
|
50
|
+
else if (ev.key === "Tab" || ev.key === "Escape") {
|
|
51
|
+
this.focusedIndex = undefined;
|
|
52
|
+
this.selectedTab = this._processedTabs[this.selectedIndex]["tabKey"];
|
|
53
|
+
this.handleTabClick(this.selectedTab, parseInt(this.selectedIndex));
|
|
54
54
|
ev.preventDefault();
|
|
55
|
-
this.setFocusedTab(this.
|
|
55
|
+
this.setFocusedTab(this.selectedIndex);
|
|
56
56
|
}
|
|
57
57
|
// this.setFocusedTab();
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
handleTabClick(tab, index) {
|
|
61
|
-
this.
|
|
62
|
-
this.
|
|
63
|
-
this.
|
|
64
|
-
this.
|
|
65
|
-
this.
|
|
61
|
+
this.selectedIndex = index.toString();
|
|
62
|
+
this.focusedIndex = undefined;
|
|
63
|
+
this.selectedTab = tab;
|
|
64
|
+
this.ezChange.emit();
|
|
65
|
+
this.setFocusedBtn(false, this.selectedIndex);
|
|
66
66
|
}
|
|
67
67
|
componentWillRender() {
|
|
68
68
|
if (!this._processedTabs) {
|
|
69
69
|
this._processedTabs = [];
|
|
70
70
|
if (this.tabs) {
|
|
71
|
-
this.tabs.split(
|
|
71
|
+
this.tabs.split(",").forEach((label) => {
|
|
72
72
|
label = label.trim();
|
|
73
73
|
this._processedTabs.push(new Tab(label, label));
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
this._hostElem.querySelectorAll(
|
|
77
|
-
const tabKey = elem.getAttribute(
|
|
78
|
-
const label = elem.getAttribute(
|
|
76
|
+
this._hostElem.querySelectorAll("ez-tab").forEach((elem) => {
|
|
77
|
+
const tabKey = elem.getAttribute("tabKey");
|
|
78
|
+
const label = elem.getAttribute("label");
|
|
79
79
|
const t = new Tab(label, tabKey);
|
|
80
80
|
const content = elem.firstChild;
|
|
81
81
|
if (content) {
|
|
82
|
-
content.setAttribute(
|
|
82
|
+
content.setAttribute("slot", "tab" + this._processedTabs.length);
|
|
83
83
|
this._hostElem.appendChild(content);
|
|
84
84
|
}
|
|
85
85
|
this._processedTabs.push(t);
|
|
@@ -103,7 +103,7 @@ export class EzTabselector {
|
|
|
103
103
|
const container = this._scrollContainer;
|
|
104
104
|
if (container) {
|
|
105
105
|
let lastTab = null;
|
|
106
|
-
container.querySelectorAll(
|
|
106
|
+
container.querySelectorAll(".tab").forEach((tab) => {
|
|
107
107
|
if (tab.getBoundingClientRect().right < container.clientWidth) {
|
|
108
108
|
lastTab = tab;
|
|
109
109
|
}
|
|
@@ -122,18 +122,18 @@ export class EzTabselector {
|
|
|
122
122
|
this._startHidden = container.scrollLeft > 0;
|
|
123
123
|
this._endHidden = remainingScroll > 0;
|
|
124
124
|
if (this._startHidden) {
|
|
125
|
-
this._backwardButton.classList.remove(
|
|
125
|
+
this._backwardButton.classList.remove("hidden");
|
|
126
126
|
}
|
|
127
127
|
else {
|
|
128
|
-
this._backwardButton.classList.add(
|
|
128
|
+
this._backwardButton.classList.add("hidden");
|
|
129
129
|
}
|
|
130
130
|
if (this._endHidden) {
|
|
131
|
-
this._forwardButton.classList.remove(
|
|
131
|
+
this._forwardButton.classList.remove("hidden");
|
|
132
132
|
}
|
|
133
133
|
else {
|
|
134
|
-
this._forwardButton.classList.add(
|
|
134
|
+
this._forwardButton.classList.add("hidden");
|
|
135
135
|
}
|
|
136
|
-
const classNames = [
|
|
136
|
+
const classNames = ["", "startHidden", "endHidden", "midle"];
|
|
137
137
|
const currentClass = classNames[Number(this._startHidden) | Number(this._endHidden) << 1];
|
|
138
138
|
classNames.forEach((name) => {
|
|
139
139
|
if (name !== currentClass && container.classList.contains(name)) {
|
|
@@ -150,11 +150,9 @@ export class EzTabselector {
|
|
|
150
150
|
this._scrollCallBack = window.setTimeout(() => { this.updateScroll(); }, 200);
|
|
151
151
|
}
|
|
152
152
|
setFocusedTab(index) {
|
|
153
|
-
window.clearTimeout(this.
|
|
154
|
-
this.
|
|
153
|
+
window.clearTimeout(this._scrollCallBackTest);
|
|
154
|
+
this._scrollCallBackTest = window.setTimeout(() => {
|
|
155
155
|
const tabtoscroll = this._scrollContainer.querySelector(`#tab${index}`);
|
|
156
|
-
console.log('tabtoscroll => ID', `#tab${this.selectedindex}`);
|
|
157
|
-
console.log('tabtoscroll', tabtoscroll);
|
|
158
156
|
tabtoscroll.scrollIntoView();
|
|
159
157
|
}, 200);
|
|
160
158
|
}
|
|
@@ -163,16 +161,16 @@ export class EzTabselector {
|
|
|
163
161
|
this._textMesurement = this._hostElem.shadowRoot.ownerDocument.createElement("canvas");
|
|
164
162
|
}
|
|
165
163
|
const context = this._textMesurement.getContext("2d");
|
|
166
|
-
context.font =
|
|
167
|
-
return Math.min(220, 24 + context.measureText(text).width) +
|
|
164
|
+
context.font = "14px Sora, Algerian";
|
|
165
|
+
return Math.min(220, 24 + context.measureText(text).width) + "px";
|
|
168
166
|
}
|
|
169
167
|
;
|
|
170
|
-
|
|
171
|
-
const tabsButtons = this._scrollContainer.querySelectorAll(
|
|
168
|
+
setFocusedBtn(visible, parameter) {
|
|
169
|
+
const tabsButtons = this._scrollContainer.querySelectorAll(".tab");
|
|
172
170
|
tabsButtons.forEach((el) => {
|
|
173
|
-
el.classList.remove(
|
|
174
|
-
if (el.id ===
|
|
175
|
-
el.classList.add(
|
|
171
|
+
el.classList.remove("is-focused");
|
|
172
|
+
if (el.id === "tab" + parameter && visible) {
|
|
173
|
+
el.classList.add("is-focused");
|
|
176
174
|
}
|
|
177
175
|
;
|
|
178
176
|
});
|
|
@@ -180,13 +178,13 @@ export class EzTabselector {
|
|
|
180
178
|
render() {
|
|
181
179
|
return (h(Host, null,
|
|
182
180
|
h("button", { class: "backward-button", ref: (el) => this._backwardButton = el, onClick: () => this.scrollBackward() }),
|
|
183
|
-
h("div", { class: "scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.
|
|
184
|
-
const labelStyle = {
|
|
181
|
+
h("div", { class: "scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.setFocusedParam(ev) }, this._processedTabs.map((tab, index) => {
|
|
182
|
+
const labelStyle = { "min-width": this.getTextWidth(tab.label) };
|
|
185
183
|
const tabId = "tab" + index;
|
|
186
|
-
const isSelected = index === parseInt(this.
|
|
184
|
+
const isSelected = index === parseInt(this.selectedIndex) || (this.selectedTab && tab.tabKey === this.selectedTab);
|
|
187
185
|
if (isSelected) {
|
|
188
|
-
this.
|
|
189
|
-
this.
|
|
186
|
+
this.selectedTab = tab.tabKey;
|
|
187
|
+
this.selectedIndex = index.toString();
|
|
190
188
|
}
|
|
191
189
|
return h("button", { id: tabId, class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab.tabKey, index), style: labelStyle },
|
|
192
190
|
h("span", { class: "tab-label", title: tab.label }, tab.label),
|
|
@@ -203,7 +201,7 @@ export class EzTabselector {
|
|
|
203
201
|
"$": ["ez-tabselector.css"]
|
|
204
202
|
}; }
|
|
205
203
|
static get properties() { return {
|
|
206
|
-
"
|
|
204
|
+
"selectedIndex": {
|
|
207
205
|
"type": "string",
|
|
208
206
|
"mutable": true,
|
|
209
207
|
"complexType": {
|
|
@@ -215,12 +213,12 @@ export class EzTabselector {
|
|
|
215
213
|
"optional": false,
|
|
216
214
|
"docs": {
|
|
217
215
|
"tags": [],
|
|
218
|
-
"text": ""
|
|
216
|
+
"text": "Define o index da aba selecionada."
|
|
219
217
|
},
|
|
220
|
-
"attribute": "
|
|
218
|
+
"attribute": "selected-index",
|
|
221
219
|
"reflect": true
|
|
222
220
|
},
|
|
223
|
-
"
|
|
221
|
+
"selectedTab": {
|
|
224
222
|
"type": "string",
|
|
225
223
|
"mutable": true,
|
|
226
224
|
"complexType": {
|
|
@@ -232,9 +230,9 @@ export class EzTabselector {
|
|
|
232
230
|
"optional": false,
|
|
233
231
|
"docs": {
|
|
234
232
|
"tags": [],
|
|
235
|
-
"text": ""
|
|
233
|
+
"text": "Define a aba selecionada."
|
|
236
234
|
},
|
|
237
|
-
"attribute": "
|
|
235
|
+
"attribute": "selected-tab",
|
|
238
236
|
"reflect": true
|
|
239
237
|
},
|
|
240
238
|
"tabs": {
|
|
@@ -249,21 +247,21 @@ export class EzTabselector {
|
|
|
249
247
|
"optional": false,
|
|
250
248
|
"docs": {
|
|
251
249
|
"tags": [],
|
|
252
|
-
"text": ""
|
|
250
|
+
"text": "Define o nome das abas do componente, separadas por v\u00EDrgulas \",\"."
|
|
253
251
|
},
|
|
254
252
|
"attribute": "tabs",
|
|
255
253
|
"reflect": false
|
|
256
254
|
}
|
|
257
255
|
}; }
|
|
258
256
|
static get events() { return [{
|
|
259
|
-
"method": "
|
|
260
|
-
"name": "
|
|
257
|
+
"method": "ezChange",
|
|
258
|
+
"name": "ezChange",
|
|
261
259
|
"bubbles": true,
|
|
262
260
|
"cancelable": true,
|
|
263
261
|
"composed": true,
|
|
264
262
|
"docs": {
|
|
265
263
|
"tags": [],
|
|
266
|
-
"text": "
|
|
264
|
+
"text": "Evento emitido ao clicar para abrir o popup (onChange)."
|
|
267
265
|
},
|
|
268
266
|
"complexType": {
|
|
269
267
|
"original": "string",
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
/* dimensions */
|
|
3
|
+
/*@doc Define a largura do componente.*/
|
|
3
4
|
--ta--width: 100%;
|
|
4
5
|
|
|
5
6
|
/* general */
|
|
7
|
+
/*@doc Define o raio da borda do input do componente.*/
|
|
6
8
|
--ta--border-radius: var(--border--radius-medium, 12px);
|
|
9
|
+
/*@doc Define o tamanho da fonte do input e label do componente.*/
|
|
7
10
|
--ta--font-size: var(--text--medium, 14px);
|
|
11
|
+
/*@doc Define a família da fonte do input, label e caixa de mensagem do componente.*/
|
|
8
12
|
--ta--font-family: var(--font-pattern, Arial);
|
|
13
|
+
/*@doc Define o peso da fonte do label do componente.*/
|
|
9
14
|
--ta--font-weight: var(--text-weight--large, 500);
|
|
15
|
+
/*@doc Define a cor da fonte do input e label do componente.*/
|
|
10
16
|
--ta--color: var(--title--primary, #000);
|
|
11
17
|
|
|
12
18
|
/* input */
|
|
@@ -6,12 +6,12 @@ export class EzTextArea {
|
|
|
6
6
|
*/
|
|
7
7
|
this.enabled = true;
|
|
8
8
|
/**
|
|
9
|
-
* Ajusta o
|
|
9
|
+
* Ajusta o número de linhas e consequentemente o height do textarea. Valor default: 4
|
|
10
10
|
*/
|
|
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"; }
|
|
@@ -118,7 +118,7 @@ export class EzTextArea {
|
|
|
118
118
|
"optional": false,
|
|
119
119
|
"docs": {
|
|
120
120
|
"tags": [],
|
|
121
|
-
"text": "
|
|
121
|
+
"text": "T\u00EDtulo do campo"
|
|
122
122
|
},
|
|
123
123
|
"attribute": "label",
|
|
124
124
|
"reflect": true
|
|
@@ -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": {
|
|
@@ -204,7 +204,7 @@ export class EzTextArea {
|
|
|
204
204
|
"optional": false,
|
|
205
205
|
"docs": {
|
|
206
206
|
"tags": [],
|
|
207
|
-
"text": "Ajusta o
|
|
207
|
+
"text": "Ajusta o n\u00FAmero de linhas e consequentemente o height do textarea. Valor default: 4"
|
|
208
208
|
},
|
|
209
209
|
"attribute": "rows",
|
|
210
210
|
"reflect": true,
|
|
@@ -219,7 +219,7 @@ export class EzTextArea {
|
|
|
219
219
|
"composed": true,
|
|
220
220
|
"docs": {
|
|
221
221
|
"tags": [],
|
|
222
|
-
"text": "
|
|
222
|
+
"text": "Evento disparado quando o estado do componente \u00E9 alterado (onEzChange)."
|
|
223
223
|
},
|
|
224
224
|
"complexType": {
|
|
225
225
|
"original": "string",
|
|
@@ -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,58 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
/* dimensions */
|
|
3
|
-
|
|
4
|
-
--
|
|
5
|
-
|
|
3
|
+
/*@doc Define a altura do componente.*/
|
|
4
|
+
--text-input--height: 42px;
|
|
5
|
+
/*@doc Define a largura do componente.*/
|
|
6
|
+
--text-input--width: 100%;
|
|
7
|
+
/*@doc Define a largura do slot que contém o ícone.*/
|
|
8
|
+
--text-input__icon--width: 48px;
|
|
6
9
|
|
|
7
10
|
/* general */
|
|
8
|
-
|
|
9
|
-
--
|
|
10
|
-
|
|
11
|
-
--
|
|
12
|
-
|
|
11
|
+
/*@doc Define o raio da borda do input do componente.*/
|
|
12
|
+
--text-input--border-radius: var(--border--radius-medium, 12px);
|
|
13
|
+
/*@doc Define o tamanho da fonte do input e label do componente.*/
|
|
14
|
+
--text-input--font-size: var(--text--medium, 14px);
|
|
15
|
+
/*@doc Define a família da fonte do input, label e caixa de mensagem do componente.*/
|
|
16
|
+
--text-input--font-family: var(--font-pattern, Arial);
|
|
17
|
+
/*@doc Define o peso da fonte do label do componente.*/
|
|
18
|
+
--text-input--font-weight: var(--text-weight--large, 500);
|
|
19
|
+
/*@doc Define a cor da fonte do input e label do componente.*/
|
|
20
|
+
--text-input--color: var(--title--primary, #000);
|
|
13
21
|
|
|
14
22
|
/* input */
|
|
15
23
|
/*@doc Define a cor de fundo do input.*/
|
|
16
|
-
--
|
|
24
|
+
--text-input__input--background-color: var(--background--medium, #e0e0e0);
|
|
17
25
|
/*@doc Define o estilo da borda do input.*/
|
|
18
|
-
--
|
|
26
|
+
--text-input__input--border: var(--border--medium, 2px solid);
|
|
19
27
|
/*@doc Define a cor da borda do input.*/
|
|
20
|
-
--
|
|
28
|
+
--text-input__input--border-color: var(--text-input__input--background-color);
|
|
21
29
|
/*no modo normal usamos a borda com a mesma cor do bg*/
|
|
22
30
|
/*@doc Define a cor da borda do input quando focado.*/
|
|
23
|
-
--
|
|
31
|
+
--text-input__input--focus--border-color: var(--color--alert-cold-800, #042EFF);
|
|
24
32
|
/*@doc Define a cor de fundo do input quando desabilitado.*/
|
|
25
|
-
--
|
|
33
|
+
--text-input__input--disabled--background-color: var(--color--disable-secondary, #F2F5F8);
|
|
26
34
|
/*@doc Define a cor do texto do input.*/
|
|
27
|
-
--
|
|
35
|
+
--text-input__input--disabled--color: var(--text--disable, #AFB6C0);
|
|
28
36
|
/*@doc Define a cor da borda do input quando com erro.*/
|
|
29
|
-
--
|
|
37
|
+
--text-input__input--error--border-color: #CC2936;
|
|
30
38
|
|
|
31
39
|
/* message box */
|
|
32
40
|
/*@doc Define o tamanho da fonte da mensagem abaixo do input.*/
|
|
33
|
-
--
|
|
41
|
+
--text-input__message_box--font-size: var(--text--small, 12px);
|
|
34
42
|
/*@doc Define a cor da fonte da mensagem quando info.*/
|
|
35
|
-
--
|
|
43
|
+
--text-input__message_box--info--color: var(--color--success, #22085d);
|
|
36
44
|
/*@doc Define a cor da fonte da mensagem quando erro.*/
|
|
37
|
-
--
|
|
45
|
+
--text-input__message_box--error--color: var(--color--error, #FF0000);
|
|
38
46
|
|
|
39
47
|
/* label */
|
|
40
48
|
/*@doc Define o posicionamento do label.*/
|
|
41
|
-
--
|
|
49
|
+
--text-input__label--floating--top: 6px;
|
|
42
50
|
/*@doc Define o posicionamento do label.*/
|
|
43
|
-
--
|
|
51
|
+
--text-input__label--padding-top: 12px;
|
|
44
52
|
/*@doc Define o espaçamento esquerdo do label.*/
|
|
45
|
-
--
|
|
53
|
+
--text-input__label--padding-left: 14px;
|
|
46
54
|
/*@doc Define o espaçamento direito do label.*/
|
|
47
|
-
--
|
|
55
|
+
--text-input__label--padding-right: 12px;
|
|
48
56
|
|
|
49
57
|
|
|
50
58
|
/***************
|
|
@@ -55,7 +63,7 @@
|
|
|
55
63
|
flex-wrap: wrap;
|
|
56
64
|
position: relative;
|
|
57
65
|
/*public*/
|
|
58
|
-
width: var(--
|
|
66
|
+
width: var(--text-input--width);
|
|
59
67
|
}
|
|
60
68
|
|
|
61
69
|
input {
|
|
@@ -66,40 +74,40 @@ input {
|
|
|
66
74
|
font-weight: var(--text-weight--large, 600);
|
|
67
75
|
|
|
68
76
|
/*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(--
|
|
77
|
+
height: var(--text-input--height);
|
|
78
|
+
border-radius: var(--text-input--border-radius);
|
|
79
|
+
font-family: var(--text-input--font-family);
|
|
80
|
+
font-size: var(--text-input--font-size);
|
|
81
|
+
border: var(--text-input__input--border);
|
|
82
|
+
border-color: var(--text-input__input--border-color);
|
|
83
|
+
background-color: var(--text-input__input--background-color);
|
|
84
|
+
color: var(--text-input--color);
|
|
77
85
|
}
|
|
78
86
|
|
|
79
87
|
input:disabled {
|
|
80
88
|
/*public*/
|
|
81
|
-
background-color: var(--
|
|
82
|
-
color: var(--
|
|
89
|
+
background-color: var(--text-input__input--disabled--background-color);
|
|
90
|
+
color: var(--text-input__input--disabled--color);
|
|
83
91
|
}
|
|
84
92
|
|
|
85
93
|
input:focus {
|
|
86
94
|
/*private*/
|
|
87
95
|
outline: none;
|
|
88
96
|
/*public*/
|
|
89
|
-
border-color: var(--
|
|
97
|
+
border-color: var(--text-input__input--focus--border-color);
|
|
90
98
|
}
|
|
91
99
|
|
|
92
100
|
input.icon--left {
|
|
93
|
-
padding-left: var(--
|
|
101
|
+
padding-left: var(--text-input__icon--width);
|
|
94
102
|
}
|
|
95
103
|
|
|
96
104
|
input.icon--right {
|
|
97
|
-
padding-right: var(--
|
|
105
|
+
padding-right: var(--text-input__icon--width);
|
|
98
106
|
}
|
|
99
107
|
|
|
100
108
|
input.hasError {
|
|
101
|
-
color: var(--
|
|
102
|
-
border-color: var(--
|
|
109
|
+
color: var(--text-input--color);
|
|
110
|
+
border-color: var(--text-input__input--error--border-color);
|
|
103
111
|
}
|
|
104
112
|
|
|
105
113
|
input.text--right {
|
|
@@ -118,14 +126,14 @@ input.text--right {
|
|
|
118
126
|
white-space: nowrap;
|
|
119
127
|
|
|
120
128
|
/*public*/
|
|
121
|
-
font-family: var(--
|
|
122
|
-
font-size: var(--
|
|
123
|
-
color: var(--
|
|
129
|
+
font-family: var(--text-input--font-family);
|
|
130
|
+
font-size: var(--text-input__message_box--font-size);
|
|
131
|
+
color: var(--text-input__message_box--info--color);
|
|
124
132
|
}
|
|
125
133
|
|
|
126
134
|
.hasError {
|
|
127
135
|
/*public*/
|
|
128
|
-
color: var(--
|
|
136
|
+
color: var(--text-input__message_box--error--color);
|
|
129
137
|
}
|
|
130
138
|
|
|
131
139
|
.input__label {
|
|
@@ -138,49 +146,49 @@ input.text--right {
|
|
|
138
146
|
white-space: nowrap;
|
|
139
147
|
-webkit-transition: font-size .05s, top .05s;
|
|
140
148
|
transition: font-size .05s, top .05s;
|
|
141
|
-
width: calc(100% - var(--
|
|
142
|
-
left: var(--
|
|
149
|
+
width: calc(100% - var(--text-input__label--padding-right));
|
|
150
|
+
left: var(--text-input--space--medium);
|
|
143
151
|
|
|
144
152
|
/*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(--
|
|
153
|
+
font-family: var(--text-input--font-family);
|
|
154
|
+
font-size: var(--text-input--font-size);
|
|
155
|
+
font-weight: var(--text-input--font-weight);
|
|
156
|
+
color: var(--text-input--color);
|
|
157
|
+
top: var(--text-input__label--padding-top);
|
|
158
|
+
left: var(--text-input__label--padding-left);
|
|
159
|
+
padding-right: var(--text-input__label--padding-right);
|
|
152
160
|
}
|
|
153
161
|
|
|
154
162
|
.input__label--floated {
|
|
155
|
-
font-family: var(--
|
|
163
|
+
font-family: var(--text-input--font-family);
|
|
156
164
|
font-size: var(--text--extra-small);
|
|
157
165
|
color: var(--text--primary);
|
|
158
|
-
top: var(--
|
|
166
|
+
top: var(--text-input__label--floating--top);
|
|
159
167
|
}
|
|
160
168
|
|
|
161
169
|
.input__label--disabled {
|
|
162
|
-
color: var(--
|
|
170
|
+
color: var(--text-input__input--disabled--color);
|
|
163
171
|
}
|
|
164
172
|
|
|
165
173
|
.input__label--left {
|
|
166
174
|
/*public*/
|
|
167
175
|
text-align: left;
|
|
168
|
-
left: calc(var(--
|
|
176
|
+
left: calc(var(--text-input__icon--width) + 2px);
|
|
169
177
|
/*borda*/
|
|
170
|
-
width: calc(100% - var(--
|
|
178
|
+
width: calc(100% - var(--text-input__icon--width));
|
|
171
179
|
}
|
|
172
180
|
|
|
173
181
|
.input__label--right {
|
|
174
182
|
/*public*/
|
|
175
|
-
right: var(--
|
|
176
|
-
width: calc(100% - var(--
|
|
183
|
+
right: var(--text-input__icon--width);
|
|
184
|
+
width: calc(100% - var(--text-input__icon--width));
|
|
177
185
|
}
|
|
178
186
|
|
|
179
187
|
/* ISSO TA ERRADO CRIAR INPUT__LABEL--BOTH */
|
|
180
188
|
.input__label--left.input__label--right {
|
|
181
|
-
left: calc(var(--
|
|
189
|
+
left: calc(var(--text-input__icon--width) + 2px);
|
|
182
190
|
/*borda*/
|
|
183
|
-
width: calc(100% - var(--
|
|
191
|
+
width: calc(100% - var(--text-input__icon--width) * 2);
|
|
184
192
|
}
|
|
185
193
|
|
|
186
194
|
.input--with--label {
|