@sankhyalabs/ezui 5.22.0-dev.35 → 5.22.0-dev.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/{ez-dropdown.cjs.entry.js → ez-dropdown_2.cjs.entry.js} +75 -8
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +61 -5
- package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +2 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-button/ez-button.css +10 -11
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +1 -1
- package/dist/collection/components/ez-date-input/ez-date-input.css +1 -1
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.css +1 -1
- package/dist/collection/components/ez-dropdown/ez-dropdown.js +33 -8
- package/dist/collection/components/ez-search/ez-search.css +2 -2
- package/dist/collection/components/ez-split-button/ez-split-button.css +47 -11
- package/dist/collection/components/ez-text-area/ez-text-area.css +73 -28
- package/dist/collection/components/ez-text-area/ez-text-area.js +79 -3
- package/dist/collection/components/ez-text-input/ez-text-input.css +27 -33
- package/dist/custom-elements/index.js +83 -21
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +1 -1
- package/dist/esm/ez-date-input.entry.js +1 -1
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/{ez-dropdown.entry.js → ez-dropdown_2.entry.js} +75 -9
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +61 -5
- package/dist/esm/ez-text-input.entry.js +1 -1
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/index-baa5e267.js +2 -6
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-0f3b2e67.entry.js +1 -0
- package/dist/ezui/{p-4b819b58.entry.js → p-62732269.entry.js} +1 -1
- package/dist/ezui/p-9d9ecb7c.entry.js +1 -0
- package/dist/ezui/p-a2e5b8c3.entry.js +1 -0
- package/dist/ezui/{p-9b3234c1.entry.js → p-b3b94f72.entry.js} +1 -1
- package/dist/ezui/{p-af95cd16.entry.js → p-b95632e8.entry.js} +1 -1
- package/dist/ezui/{p-692b43be.entry.js → p-c25f0e92.entry.js} +1 -1
- package/dist/ezui/{p-072e6347.entry.js → p-c4320a39.entry.js} +1 -1
- package/dist/ezui/{p-583e6dab.entry.js → p-f299c608.entry.js} +1 -1
- package/dist/types/components/ez-dropdown/ez-dropdown.d.ts +4 -0
- package/dist/types/components/ez-dropdown/structure/DropdownItem.d.ts +1 -1
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +13 -0
- package/dist/types/components.d.ts +12 -0
- package/package.json +1 -1
- package/dist/cjs/ez-skeleton.cjs.entry.js +0 -67
- package/dist/esm/ez-skeleton.entry.js +0 -63
- package/dist/ezui/p-85c8baae.entry.js +0 -1
- package/dist/ezui/p-9050d2cd.entry.js +0 -1
- package/dist/ezui/p-d018387a.entry.js +0 -1
- package/dist/ezui/p-dce2398f.entry.js +0 -1
|
@@ -2,6 +2,8 @@ import { ElementIDUtils } from '@sankhyalabs/core';
|
|
|
2
2
|
import { h, Host } from '@stencil/core';
|
|
3
3
|
export class EzTextArea {
|
|
4
4
|
constructor() {
|
|
5
|
+
this.LINE_HEIGHT = 24;
|
|
6
|
+
this.HEIGHT_RATIO = 1.4;
|
|
5
7
|
this.label = undefined;
|
|
6
8
|
this.value = undefined;
|
|
7
9
|
this.enabled = true;
|
|
@@ -10,6 +12,7 @@ export class EzTextArea {
|
|
|
10
12
|
this.canShowError = true;
|
|
11
13
|
this.mode = "regular";
|
|
12
14
|
this.enableResize = false;
|
|
15
|
+
this.autoRows = false;
|
|
13
16
|
}
|
|
14
17
|
observeErrorMessage() {
|
|
15
18
|
var _a, _b, _c, _d;
|
|
@@ -47,8 +50,17 @@ export class EzTextArea {
|
|
|
47
50
|
observeRows() {
|
|
48
51
|
const rows = this.rows > 0 ? this.rows : this.mode != "slim" ? 4 : 2;
|
|
49
52
|
if (rows !== this.rows) {
|
|
50
|
-
this.rows
|
|
51
|
-
|
|
53
|
+
this.updateRows(rows);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
observeAutoRows() {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
if (this.autoRows) {
|
|
59
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
60
|
+
this.initializeResizeObserver();
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
(_b = this._resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
52
64
|
}
|
|
53
65
|
}
|
|
54
66
|
//---------------------------------------------
|
|
@@ -117,6 +129,42 @@ export class EzTextArea {
|
|
|
117
129
|
isFocused() {
|
|
118
130
|
return this._hostElement.shadowRoot.activeElement !== null;
|
|
119
131
|
}
|
|
132
|
+
updateRows(newRows) {
|
|
133
|
+
this.rows = newRows;
|
|
134
|
+
this._initialRows = newRows;
|
|
135
|
+
}
|
|
136
|
+
calculateMaxRows() {
|
|
137
|
+
const parentElement = this._hostElement.parentElement;
|
|
138
|
+
if (!parentElement) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const height = Math.max((parentElement === null || parentElement === void 0 ? void 0 : parentElement.clientHeight) || 0, this.LINE_HEIGHT);
|
|
142
|
+
if (height > 0) {
|
|
143
|
+
const maxRows = Math.floor(height / this.LINE_HEIGHT * this.HEIGHT_RATIO);
|
|
144
|
+
if (maxRows !== this.rows) {
|
|
145
|
+
this.updateRows(maxRows);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
initializeResizeObserver() {
|
|
150
|
+
if (!this.autoRows) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const parentElement = this._hostElement.parentElement;
|
|
154
|
+
if (parentElement) {
|
|
155
|
+
try {
|
|
156
|
+
if (this._resizeObserver != undefined) {
|
|
157
|
+
this._resizeObserver.unobserve(parentElement);
|
|
158
|
+
}
|
|
159
|
+
this._resizeObserver = new ResizeObserver(this.calculateMaxRows.bind(this));
|
|
160
|
+
this._resizeObserver.observe(parentElement);
|
|
161
|
+
}
|
|
162
|
+
catch (e) {
|
|
163
|
+
console.warn(e);
|
|
164
|
+
}
|
|
165
|
+
this.calculateMaxRows();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
120
168
|
//---------------------------------------------
|
|
121
169
|
// Event handlers
|
|
122
170
|
//---------------------------------------------
|
|
@@ -139,6 +187,13 @@ export class EzTextArea {
|
|
|
139
187
|
this._container.classList.add("textarea--focus");
|
|
140
188
|
}
|
|
141
189
|
}
|
|
190
|
+
connectedCallback() {
|
|
191
|
+
this.initializeResizeObserver();
|
|
192
|
+
}
|
|
193
|
+
disconnectedCallback() {
|
|
194
|
+
var _a;
|
|
195
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
196
|
+
}
|
|
142
197
|
//---------------------------------------------
|
|
143
198
|
// Lifecycle web component
|
|
144
199
|
//---------------------------------------------
|
|
@@ -149,7 +204,7 @@ export class EzTextArea {
|
|
|
149
204
|
}
|
|
150
205
|
render() {
|
|
151
206
|
ElementIDUtils.addIDInfoIfNotExists(this._hostElement, 'input');
|
|
152
|
-
return (h(Host, null, h("div", { class: "textarea"
|
|
207
|
+
return (h(Host, null, h("div", { class: `textarea ${this.enabled ? "" : "textarea--disabled"}`, ref: (el) => this._container = el }, this.label && this.mode != "slim" ?
|
|
153
208
|
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)
|
|
154
209
|
: null, h("textarea", { onFocus: () => this.handleFocus(), "data-element-id": ElementIDUtils.getInternalIDInfo("input"), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, class: {
|
|
155
210
|
"textarea--slim": this.mode === "slim",
|
|
@@ -311,6 +366,24 @@ export class EzTextArea {
|
|
|
311
366
|
"attribute": "enable-resize",
|
|
312
367
|
"reflect": true,
|
|
313
368
|
"defaultValue": "false"
|
|
369
|
+
},
|
|
370
|
+
"autoRows": {
|
|
371
|
+
"type": "boolean",
|
|
372
|
+
"mutable": false,
|
|
373
|
+
"complexType": {
|
|
374
|
+
"original": "boolean",
|
|
375
|
+
"resolved": "boolean",
|
|
376
|
+
"references": {}
|
|
377
|
+
},
|
|
378
|
+
"required": false,
|
|
379
|
+
"optional": false,
|
|
380
|
+
"docs": {
|
|
381
|
+
"tags": [],
|
|
382
|
+
"text": "Ativa a op\u00E7\u00E3o de fazer as linhas do componente serem baseados na altura m\u00E1xima."
|
|
383
|
+
},
|
|
384
|
+
"attribute": "auto-rows",
|
|
385
|
+
"reflect": true,
|
|
386
|
+
"defaultValue": "false"
|
|
314
387
|
}
|
|
315
388
|
};
|
|
316
389
|
}
|
|
@@ -423,6 +496,9 @@ export class EzTextArea {
|
|
|
423
496
|
}, {
|
|
424
497
|
"propName": "rows",
|
|
425
498
|
"methodName": "observeRows"
|
|
499
|
+
}, {
|
|
500
|
+
"propName": "autoRows",
|
|
501
|
+
"methodName": "observeAutoRows"
|
|
426
502
|
}];
|
|
427
503
|
}
|
|
428
504
|
}
|
|
@@ -23,20 +23,25 @@
|
|
|
23
23
|
|
|
24
24
|
/* input */
|
|
25
25
|
/*@doc Define a cor de fundo do input.*/
|
|
26
|
-
--ez-text-input__input--background-color: var(--background--
|
|
26
|
+
--ez-text-input__input--background-color: var(--background--light, #ffffff);
|
|
27
27
|
/*@doc Define o estilo da borda do input.*/
|
|
28
|
-
--ez-text-input__input--border: var(--border--
|
|
28
|
+
--ez-text-input__input--border: var(--border--small, 1px solid);
|
|
29
29
|
/*@doc Define a cor da borda do input.*/
|
|
30
|
-
--ez-text-input__input--border-color: var(--
|
|
31
|
-
/*no modo normal usamos a borda com a mesma cor do bg*/
|
|
30
|
+
--ez-text-input__input--border-color: var(--color--strokes,#DCE0E8);
|
|
32
31
|
/*@doc Define a cor da borda do input quando focado.*/
|
|
33
32
|
--ez-text-input__input--focus--border-color: var(--color--primary, #008561);
|
|
33
|
+
|
|
34
|
+
/* input disabled */
|
|
34
35
|
/*@doc Define a cor de fundo do input quando desabilitado.*/
|
|
35
|
-
--ez-text-input__input--disabled--background-color: var(--
|
|
36
|
+
--ez-text-input__input--disabled--background-color: var(--background--medium, #F0F3F7);
|
|
36
37
|
/*@doc Define a cor do texto do input.*/
|
|
37
|
-
--ez-text-input__input--disabled--color: var(--text--
|
|
38
|
+
--ez-text-input__input--disabled--color: var(--text--primary, #626E82);
|
|
39
|
+
|
|
40
|
+
/* input error */
|
|
38
41
|
/*@doc Define a cor da borda do input quando com erro.*/
|
|
39
|
-
--ez-text-input__input--error--border-color:
|
|
42
|
+
--ez-text-input__input--error--border-color: var(--color-alert--error-800,#BD0025);
|
|
43
|
+
|
|
44
|
+
|
|
40
45
|
/*@doc Define a cor do input quando não possuir borda*/
|
|
41
46
|
--ez-text-input__input--noborder-color: white;
|
|
42
47
|
/*@doc Define o padding do input*/
|
|
@@ -44,11 +49,11 @@
|
|
|
44
49
|
|
|
45
50
|
/* message box */
|
|
46
51
|
/*@doc Define o tamanho da fonte da mensagem abaixo do input.*/
|
|
47
|
-
--ez-text-input__message_box--font-size: var(--text--small,
|
|
52
|
+
--ez-text-input__message_box--font-size: var(--text--extra-small, 10px);
|
|
48
53
|
/*@doc Define a cor da fonte da mensagem quando info.*/
|
|
49
54
|
--ez-text-input__message_box--info--color: var(--color--success, #22085d);
|
|
50
55
|
/*@doc Define a cor da fonte da mensagem quando erro.*/
|
|
51
|
-
--ez-text-input__message_box--error--color: var(--color--error
|
|
56
|
+
--ez-text-input__message_box--error--color: var(--color-alert--error-800,#BD0025);
|
|
52
57
|
|
|
53
58
|
/* label */
|
|
54
59
|
/*@doc Define o posicionamento do label.*/
|
|
@@ -61,7 +66,9 @@
|
|
|
61
66
|
--ez-text-input__label--padding-right: 12px;
|
|
62
67
|
|
|
63
68
|
/*@doc Define a cor do ícone do slot.*/
|
|
64
|
-
--ez-text-input__input--focus--icon-color: var(--
|
|
69
|
+
--ez-text-input__input--focus--icon-color: var(--title--primary, #2B3A54);
|
|
70
|
+
/*@doc Define a cor do ícone do slot quando disabled.*/
|
|
71
|
+
--ez-text-input__input--disabled--focus--icon-color: var(--text--primary, #626E82);
|
|
65
72
|
|
|
66
73
|
|
|
67
74
|
/***************
|
|
@@ -101,6 +108,7 @@ input:disabled {
|
|
|
101
108
|
/*public*/
|
|
102
109
|
background-color: var(--ez-text-input__input--disabled--background-color);
|
|
103
110
|
color: var(--ez-text-input__input--disabled--color);
|
|
111
|
+
cursor: not-allowed;
|
|
104
112
|
}
|
|
105
113
|
|
|
106
114
|
input:focus {
|
|
@@ -131,16 +139,17 @@ input.text--right {
|
|
|
131
139
|
text-align: right;
|
|
132
140
|
}
|
|
133
141
|
|
|
142
|
+
input:disabled,
|
|
134
143
|
input:read-only {
|
|
135
|
-
cursor:
|
|
144
|
+
cursor: not-allowed;
|
|
136
145
|
}
|
|
137
146
|
|
|
138
147
|
.message-box {
|
|
139
148
|
/*private*/
|
|
140
|
-
min-height:
|
|
149
|
+
min-height: 14px;
|
|
141
150
|
min-width: 100%;
|
|
142
151
|
margin-top: 3px;
|
|
143
|
-
line-height:
|
|
152
|
+
line-height: 10px;
|
|
144
153
|
overflow: hidden;
|
|
145
154
|
text-overflow: ellipsis;
|
|
146
155
|
white-space: nowrap;
|
|
@@ -188,6 +197,7 @@ input:read-only {
|
|
|
188
197
|
|
|
189
198
|
.input__label--disabled {
|
|
190
199
|
color: var(--ez-text-input__input--disabled--color);
|
|
200
|
+
cursor: not-allowed;
|
|
191
201
|
}
|
|
192
202
|
|
|
193
203
|
.input__label--left {
|
|
@@ -268,26 +278,10 @@ input:read-only {
|
|
|
268
278
|
color: var(--ez-text-input--color);
|
|
269
279
|
}
|
|
270
280
|
|
|
271
|
-
.input--slim:disabled::-webkit-input-placeholder
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
.input--slim:disabled:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
|
|
277
|
-
/*public*/
|
|
278
|
-
color: var(--ez-text-input__input--disabled--color);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.input--slim:disabled::-moz-placeholder { /* Mozilla Firefox 19+ */
|
|
282
|
-
/*public*/
|
|
283
|
-
color: var(--ez-text-input__input--disabled--color);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
.input--slim:disabled:-ms-input-placeholder { /* Internet Explorer 10+ */
|
|
287
|
-
/*public*/
|
|
288
|
-
color: var(--ez-text-input__input--disabled--color);
|
|
289
|
-
}
|
|
290
|
-
|
|
281
|
+
.input--slim:disabled::-webkit-input-placeholder, /* WebKit browsers */
|
|
282
|
+
.input--slim:disabled:-moz-placeholder, /* Mozilla Firefox 4 to 18 */
|
|
283
|
+
.input--slim:disabled::-moz-placeholder, /* Mozilla Firefox 19+ */
|
|
284
|
+
.input--slim:disabled:-ms-input-placeholder, /* Internet Explorer 10+ */
|
|
291
285
|
.input--slim:disabled::placeholder {
|
|
292
286
|
/*public*/
|
|
293
287
|
color: var(--ez-text-input__input--disabled--color);
|