@sankhyalabs/ezui 1.1.113 → 1.1.116
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-combo-box.cjs.entry.js +13 -4
- 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-grid.cjs.entry.js +74 -12
- 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 +3 -2
- 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-combo-box/ez-combo-box.js +31 -4
- 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-grid/controller/DataUnitBridge.js +14 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +60 -11
- 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 +2 -1
- package/dist/collection/components/test-du/test-du.js +2 -1
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +250 -63
- package/dist/esm/ez-combo-box.entry.js +13 -4
- 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-grid.entry.js +74 -12
- 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 +3 -2
- 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-2f14fe3d.entry.js +1 -0
- package/dist/ezui/{p-a038e7a5.entry.js → p-3cd17150.entry.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-7247379d.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-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-grid/controller/EzGridController.d.ts +16 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +5 -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 +1 -0
- package/dist/types/components.d.ts +153 -0
- package/package.json +6 -5
- 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-65893e25.entry.js +0 -1
- package/dist/ezui/p-9aecc079.entry.js +0 -1
- package/dist/ezui/p-9ea5b22e.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
|
@@ -8,11 +8,14 @@ import { SortMode, UserInterface } from "@sankhyalabs/core/dist/dataunit/metadat
|
|
|
8
8
|
export default class AgGridController {
|
|
9
9
|
constructor(enterprise) {
|
|
10
10
|
this._menuItems = [];
|
|
11
|
+
this._idAttribName = "__record__id__";
|
|
11
12
|
this._enterprise = enterprise;
|
|
12
13
|
}
|
|
13
14
|
getSort() {
|
|
14
15
|
const sortedColumns = [];
|
|
15
|
-
this._gridOptions.
|
|
16
|
+
this._gridOptions.columnApi.getColumnState()
|
|
17
|
+
.sort((colA, colB) => colA.sortIndex - colB.sortIndex)
|
|
18
|
+
.forEach(({ colId, sort }) => {
|
|
16
19
|
if (sort) {
|
|
17
20
|
const field = this._dataUnit.getField(colId);
|
|
18
21
|
const mode = sort === "asc" ? SortMode.ASC : SortMode.DESC;
|
|
@@ -37,10 +40,9 @@ export default class AgGridController {
|
|
|
37
40
|
this._gridOptions = {
|
|
38
41
|
localeText: gridTerms,
|
|
39
42
|
rowModelType: "serverSide",
|
|
40
|
-
serverSideStoreType: "partial",
|
|
41
43
|
rowSelection: this._multipleSelection ? "multiple" : "single",
|
|
42
44
|
serverSideDatasource: new DataSource(this._dataUnit, this._serverURL),
|
|
43
|
-
getRowNodeId: (params) => params.
|
|
45
|
+
getRowNodeId: (params) => typeof params === "string" ? params : params[this._idAttribName],
|
|
44
46
|
getMainMenuItems: (params) => {
|
|
45
47
|
const column = params.column;
|
|
46
48
|
const items = [column.isPinned() ? "clearPinned" : "pinLeft", "separator"];
|
|
@@ -50,14 +52,9 @@ export default class AgGridController {
|
|
|
50
52
|
}));
|
|
51
53
|
return items;
|
|
52
54
|
},
|
|
53
|
-
onViewportChanged: (
|
|
54
|
-
if (this.
|
|
55
|
-
|
|
56
|
-
this._dataUnit.getSelection().forEach(id => {
|
|
57
|
-
let node = evt.api.getRowNode(id);
|
|
58
|
-
node.setSelected(true);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
55
|
+
onViewportChanged: () => {
|
|
56
|
+
if (this._dataUnit) {
|
|
57
|
+
this.selectRows(this._dataUnit.getSelection());
|
|
61
58
|
}
|
|
62
59
|
}
|
|
63
60
|
};
|
|
@@ -98,6 +95,58 @@ export default class AgGridController {
|
|
|
98
95
|
}
|
|
99
96
|
this._gridOptions.api.setRowData(data);
|
|
100
97
|
}
|
|
98
|
+
addRows(rows) {
|
|
99
|
+
if (this._grid === undefined) {
|
|
100
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
101
|
+
}
|
|
102
|
+
this._gridOptions.api.applyServerSideTransaction({ add: rows });
|
|
103
|
+
}
|
|
104
|
+
selectRows(rowIds) {
|
|
105
|
+
if (this._grid === undefined) {
|
|
106
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
107
|
+
}
|
|
108
|
+
if (rowIds && rowIds.length > 0) {
|
|
109
|
+
rowIds.forEach(rowId => {
|
|
110
|
+
const row = this._gridOptions.api.getRowNode(rowId);
|
|
111
|
+
if (row) {
|
|
112
|
+
row.setSelected(true);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
removeRows(rowIds) {
|
|
118
|
+
if (this._grid === undefined) {
|
|
119
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
120
|
+
}
|
|
121
|
+
this._gridOptions.api.applyServerSideTransaction({ remove: rowIds });
|
|
122
|
+
}
|
|
123
|
+
changeValues(changes, rowIds) {
|
|
124
|
+
if (this._grid === undefined) {
|
|
125
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
126
|
+
}
|
|
127
|
+
if (changes) {
|
|
128
|
+
let rowNodes;
|
|
129
|
+
if (rowIds) {
|
|
130
|
+
rowNodes = [];
|
|
131
|
+
rowIds.forEach(id => {
|
|
132
|
+
const rowNode = this._gridOptions.api.getRowNode(id);
|
|
133
|
+
if (rowNode) {
|
|
134
|
+
rowNodes.push(rowNode);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
rowNodes = this._gridOptions.api.getSelectedNodes();
|
|
140
|
+
}
|
|
141
|
+
rowNodes.forEach(r => {
|
|
142
|
+
const data = r.data;
|
|
143
|
+
Object.entries(changes).forEach(([field, value]) => {
|
|
144
|
+
data[field] = value;
|
|
145
|
+
});
|
|
146
|
+
r.setData(data);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
101
150
|
refresh() {
|
|
102
151
|
if (this._grid === undefined) {
|
|
103
152
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
@@ -7,6 +7,10 @@ export class EzNumberInput {
|
|
|
7
7
|
* Deixa o campo disponível ou não para uso.
|
|
8
8
|
*/
|
|
9
9
|
this.enabled = true;
|
|
10
|
+
/**
|
|
11
|
+
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
12
|
+
*/
|
|
13
|
+
this.mode = "regular";
|
|
10
14
|
}
|
|
11
15
|
setLabel() {
|
|
12
16
|
this._textInput.label = this.label;
|
|
@@ -63,7 +67,7 @@ export class EzNumberInput {
|
|
|
63
67
|
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
64
68
|
}
|
|
65
69
|
render() {
|
|
66
|
-
return (h("ez-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 }));
|
|
70
|
+
return (h("ez-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, mode: this.mode }));
|
|
67
71
|
}
|
|
68
72
|
static get is() { return "ez-number-input"; }
|
|
69
73
|
static get encapsulation() { return "shadow"; }
|
|
@@ -176,6 +180,24 @@ export class EzNumberInput {
|
|
|
176
180
|
},
|
|
177
181
|
"attribute": "pretty-precision",
|
|
178
182
|
"reflect": false
|
|
183
|
+
},
|
|
184
|
+
"mode": {
|
|
185
|
+
"type": "string",
|
|
186
|
+
"mutable": false,
|
|
187
|
+
"complexType": {
|
|
188
|
+
"original": "string",
|
|
189
|
+
"resolved": "string",
|
|
190
|
+
"references": {}
|
|
191
|
+
},
|
|
192
|
+
"required": false,
|
|
193
|
+
"optional": false,
|
|
194
|
+
"docs": {
|
|
195
|
+
"tags": [],
|
|
196
|
+
"text": "Define o modo do tamanho do campo; op\u00E7\u00F5es: slim e regular."
|
|
197
|
+
},
|
|
198
|
+
"attribute": "mode",
|
|
199
|
+
"reflect": true,
|
|
200
|
+
"defaultValue": "\"regular\""
|
|
179
201
|
}
|
|
180
202
|
}; }
|
|
181
203
|
static get events() { return [{
|
|
@@ -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 {
|