@sebgroup/green-core 3.17.4 → 3.18.0-rc.20260818070119654
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/components/textarea/textarea.component.js +17 -6
- package/custom-elements.json +6502 -6369
- package/gds-element.js +1 -1
- package/generated/mcp/card-pattern-01/api.md +7 -0
- package/generated/mcp/components.json +1 -1
- package/generated/mcp/icons.json +1 -1
- package/generated/mcp/index.json +1 -1
- package/generated/mcp/tokens.json +1 -1
- package/generated/react/card-pattern-01/index.d.ts +7 -0
- package/generated/react/index.d.ts +10 -10
- package/generated/react/index.js +10 -10
- package/package.json +1 -1
- package/patterns/card-pattern-01/card-pattern-01.component.d.ts +6 -1
- package/patterns/card-pattern-01/card-pattern-01.component.js +92 -46
- package/utils/helpers/custom-element-scoping.js +1 -1
|
@@ -200,7 +200,10 @@ let Textarea = class extends GdsFormControlElement {
|
|
|
200
200
|
connectedCallback() {
|
|
201
201
|
super.connectedCallback();
|
|
202
202
|
if (this.hasAttribute("rows")) {
|
|
203
|
-
|
|
203
|
+
const parsed = Number(this.rows);
|
|
204
|
+
if (Number.isFinite(parsed) && parsed > 0) {
|
|
205
|
+
this._initialRows = parsed;
|
|
206
|
+
}
|
|
204
207
|
}
|
|
205
208
|
this._setAutoHeight();
|
|
206
209
|
this.addEventListener("slotchange", this._handleSlotChange);
|
|
@@ -274,18 +277,26 @@ let Textarea = class extends GdsFormControlElement {
|
|
|
274
277
|
} else {
|
|
275
278
|
const computedStyle = getComputedStyle(element);
|
|
276
279
|
const lineHeight = parseFloat(computedStyle.lineHeight);
|
|
277
|
-
const contentHeight = element.scrollHeight;
|
|
278
|
-
const requiredRows = Math.ceil(contentHeight / lineHeight);
|
|
279
280
|
const minRows = this._initialRows ?? this._defaultRows;
|
|
280
|
-
|
|
281
|
-
|
|
281
|
+
if (!Number.isFinite(lineHeight) || lineHeight <= 0) {
|
|
282
|
+
this.rows = minRows;
|
|
283
|
+
element.style.setProperty("--_lines", minRows.toString());
|
|
284
|
+
} else {
|
|
285
|
+
const contentHeight = element.scrollHeight;
|
|
286
|
+
const requiredRows = Math.ceil(contentHeight / lineHeight);
|
|
287
|
+
this.rows = Math.max(minRows, requiredRows);
|
|
288
|
+
element.style.setProperty("--_lines", this.rows.toString());
|
|
289
|
+
}
|
|
282
290
|
}
|
|
283
291
|
}
|
|
284
292
|
});
|
|
285
293
|
}
|
|
286
294
|
_handleRowsChange() {
|
|
287
295
|
if (this.hasAttribute("rows")) {
|
|
288
|
-
|
|
296
|
+
const parsed = Number(this.rows);
|
|
297
|
+
if (Number.isFinite(parsed) && parsed > 0) {
|
|
298
|
+
this._initialRows = parsed;
|
|
299
|
+
}
|
|
289
300
|
}
|
|
290
301
|
this.elTextareaAsync.then((element) => {
|
|
291
302
|
if (this.resizable === "false") {
|