@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-76362.0 → 0.0.0-bugfix-dev-KB-75609.0

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.
Files changed (54) hide show
  1. package/dist/cjs/ez-card-item_3.cjs.entry.js +4 -17
  2. package/dist/cjs/ez-list.cjs.entry.js +151 -100
  3. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-popup.cjs.entry.js +2 -9
  5. package/dist/cjs/ez-search.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-text-area.cjs.entry.js +60 -4
  7. package/dist/cjs/ez-text-input.cjs.entry.js +2 -3
  8. package/dist/cjs/ezui.cjs.js +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/collection/components/ez-card-item/ez-card-item.css +14 -5
  11. package/dist/collection/components/ez-filter-input/ez-filter-input.css +0 -11
  12. package/dist/collection/components/ez-filter-input/ez-filter-input.js +2 -63
  13. package/dist/collection/components/ez-list/ez-list.css +5 -5
  14. package/dist/collection/components/ez-list/ez-list.js +152 -170
  15. package/dist/collection/components/ez-popover/ez-popover.css +3 -10
  16. package/dist/collection/components/ez-popup/ez-popup.css +2 -6
  17. package/dist/collection/components/ez-popup/ez-popup.js +3 -10
  18. package/dist/collection/components/ez-search/ez-search.css +1 -1
  19. package/dist/collection/components/ez-search/ez-search.js +1 -1
  20. package/dist/collection/components/ez-text-area/ez-text-area.css +49 -0
  21. package/dist/collection/components/ez-text-area/ez-text-area.js +78 -2
  22. package/dist/collection/components/ez-text-input/ez-text-input.css +13 -15
  23. package/dist/collection/components/ez-text-input/ez-text-input.js +1 -2
  24. package/dist/custom-elements/index.js +224 -138
  25. package/dist/esm/ez-card-item_3.entry.js +4 -17
  26. package/dist/esm/ez-list.entry.js +152 -101
  27. package/dist/esm/ez-popover.entry.js +1 -1
  28. package/dist/esm/ez-popup.entry.js +2 -9
  29. package/dist/esm/ez-search.entry.js +1 -1
  30. package/dist/esm/ez-text-area.entry.js +60 -4
  31. package/dist/esm/ez-text-input.entry.js +2 -3
  32. package/dist/esm/ezui.js +1 -1
  33. package/dist/esm/loader.js +1 -1
  34. package/dist/ezui/ezui.esm.js +1 -1
  35. package/dist/ezui/p-0f3b2e67.entry.js +1 -0
  36. package/dist/ezui/p-37219d42.entry.js +1 -0
  37. package/dist/ezui/p-a80b1287.entry.js +1 -0
  38. package/dist/ezui/p-b54e17d2.entry.js +1 -0
  39. package/dist/ezui/p-bfad39eb.entry.js +1 -0
  40. package/dist/ezui/p-c25f0e92.entry.js +1 -0
  41. package/dist/ezui/p-f0e2ce9d.entry.js +1 -0
  42. package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +0 -12
  43. package/dist/types/components/ez-list/ez-list.d.ts +3 -26
  44. package/dist/types/components/ez-popup/ez-popup.d.ts +2 -2
  45. package/dist/types/components/ez-text-area/ez-text-area.d.ts +13 -0
  46. package/dist/types/components.d.ts +10 -38
  47. package/package.json +1 -1
  48. package/dist/ezui/p-188f1c4c.entry.js +0 -1
  49. package/dist/ezui/p-25ac5376.entry.js +0 -1
  50. package/dist/ezui/p-86b6aa01.entry.js +0 -1
  51. package/dist/ezui/p-b3b94f72.entry.js +0 -1
  52. package/dist/ezui/p-bcd47eda.entry.js +0 -1
  53. package/dist/ezui/p-dc4ada32.entry.js +0 -1
  54. package/dist/ezui/p-f80ac647.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 = rows;
51
- this._initialRows = rows;
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
  //---------------------------------------------
@@ -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
  }
@@ -6,8 +6,6 @@
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
- --ez-text-input__icon--left--width: var(--ez-text-input__icon--width);
10
- --ez-text-input__icon--right--width: var(--ez-text-input__icon--width);
11
9
  /*@doc Define a altura do componente em modo "slim".*/
12
10
  --ez-text-input--height--slim: 32px;
13
11
 
@@ -104,8 +102,6 @@ input {
104
102
  color: var(--ez-text-input--color);
105
103
  font-weight: var(--ez-text-input--font-weight);
106
104
  padding: var(--ez-text-input__input--padding);
107
- text-overflow: ellipsis;
108
- overflow: hidden;
109
105
  }
110
106
 
111
107
  input:disabled {
@@ -123,11 +119,11 @@ input:focus {
123
119
  }
124
120
 
125
121
  input.icon--left {
126
- padding-left: var(--ez-text-input__icon--left--width);
122
+ padding-left: var(--ez-text-input__icon--width);
127
123
  }
128
124
 
129
125
  input.icon--right {
130
- padding-right: var(--ez-text-input__icon--right--width);
126
+ padding-right: var(--ez-text-input__icon--width);
131
127
  }
132
128
 
133
129
  input.hasError {
@@ -204,23 +200,25 @@ input:read-only {
204
200
  cursor: not-allowed;
205
201
  }
206
202
 
207
- .input__label--left.input__label--right {
208
- left: calc(var(--ez-text-input__icon--left--width) + 2px);
209
- /*borda*/
210
- width: calc(100% - (var(--ez-text-input__icon--right--width) + var(--ez-text-input__icon--left--width)));
211
- }
212
203
  .input__label--left {
213
204
  /*public*/
214
205
  text-align: left;
215
- left: calc(var(--ez-text-input__icon--left--width) + 2px);
206
+ left: calc(var(--ez-text-input__icon--width) + 2px);
216
207
  /*borda*/
217
- width: calc(100% - var(--ez-text-input__icon--left--width));
208
+ width: calc(100% - var(--ez-text-input__icon--width));
218
209
  }
219
210
 
220
211
  .input__label--right {
221
212
  /*public*/
222
- right: var(--ez-text-input__icon--right--width);
223
- width: calc(100% - var(--ez-text-input__icon--right--width));
213
+ right: var(--ez-text-input__icon--width);
214
+ width: calc(100% - var(--ez-text-input__icon--width));
215
+ }
216
+
217
+ /* ISSO TA ERRADO CRIAR INPUT__LABEL--BOTH */
218
+ .input__label--left.input__label--right {
219
+ left: calc(var(--ez-text-input__icon--width) + 2px);
220
+ /*borda*/
221
+ width: calc(100% - var(--ez-text-input__icon--width) * 2);
224
222
  }
225
223
 
226
224
  .input--with--label {
@@ -165,9 +165,9 @@ export class EzTextInput {
165
165
  content.style.justifyContent = "center";
166
166
  content.style.overflow = "hidden";
167
167
  content.style.top = "0px";
168
+ content.style.width = "var(--ez-text-input__icon--width)";
168
169
  content.style.height = this.mode != "slim" ? "var(--ez-text-input--height)" : "var(--ez-text-input--height--slim)";
169
170
  if (slot.name == "leftIcon") {
170
- content.style.width = "var(--ez-text-input__icon--left--width)";
171
171
  content.style.left = "0px";
172
172
  content.style.borderRadius = "var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)";
173
173
  this._inputElem.classList.add("icon--left");
@@ -177,7 +177,6 @@ export class EzTextInput {
177
177
  this._contentLeftSlot = content;
178
178
  }
179
179
  else if (slot.name == "rightIcon") {
180
- content.style.width = "var(--ez-text-input__icon--right--width)";
181
180
  content.style.right = "0px";
182
181
  content.style.borderRadius = "0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0";
183
182
  this._inputElem.classList.add("icon--right");