@m3e/textarea-autosize 1.0.0-rc.2 → 1.0.0-rc.3

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.
@@ -1235,25 +1235,6 @@
1235
1235
  "kind": "mixin",
1236
1236
  "description": "Mixin that adds support for custom event attributes.",
1237
1237
  "name": "EventAttribute",
1238
- "members": [
1239
- {
1240
- "kind": "method",
1241
- "name": "dispatchEvent",
1242
- "return": {
1243
- "type": {
1244
- "text": "boolean"
1245
- }
1246
- },
1247
- "parameters": [
1248
- {
1249
- "name": "event",
1250
- "type": {
1251
- "text": "Event"
1252
- }
1253
- }
1254
- ]
1255
- }
1256
- ],
1257
1238
  "parameters": [
1258
1239
  {
1259
1240
  "name": "base",
@@ -1551,6 +1532,17 @@
1551
1532
  "description": "Mixin to augment an element with behavior used to submit a form.",
1552
1533
  "name": "FormSubmitter",
1553
1534
  "members": [
1535
+ {
1536
+ "kind": "field",
1537
+ "name": "formAssociated",
1538
+ "type": {
1539
+ "text": "boolean"
1540
+ },
1541
+ "static": true,
1542
+ "readonly": true,
1543
+ "default": "true",
1544
+ "description": "Indicates that this custom element participates in form submission, validation, and form state restoration."
1545
+ },
1554
1546
  {
1555
1547
  "kind": "field",
1556
1548
  "name": "name",
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Adapted from Angular Material CDK Text Field
3
+ * Source: https://github.com/angular/components/blob/main/src/cdk/text-field/autosize.ts
4
+ *
5
+ * @license MIT
6
+ * Copyright (c) 2025 Google LLC
7
+ * See LICENSE file in the project root for full license text.
8
+ */
9
+ import { CSSResultGroup, LitElement, PropertyValues } from "lit";
10
+ declare const M3eTextareaAutosizeElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").HtmlForMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor & typeof LitElement;
11
+ /**
12
+ * A non-visual element used to automatically resize a `textarea` to fit its content.
13
+ *
14
+ * @description
15
+ * The `m3e-textarea-autosize` component automatically adjusts the height of a linked `textarea` to fit its content,
16
+ * preserving layout integrity and user experience. This non-visual element listens to input changes and applies
17
+ * dynamic resizing, constrained by optional row limits. It supports declarative configuration via attributes and
18
+ * can be disabled when manual control is preferred.
19
+ *
20
+ * @example
21
+ * The following example illustrates the `m3e-textarea-autosize` in conjunction with the `m3e-form-field` to
22
+ * automatically resize a field's `textarea` with a 5 row limit.
23
+ * ```html
24
+ * <m3e-form-field>
25
+ * <label slot="label" for="fld">Textarea Autosize</label>
26
+ * <textarea id="fld"></textarea>
27
+ * <m3e-textarea-autosize for="fld" max-rows="5"></m3e-textarea-autosize>
28
+ * </m3e-form-field>
29
+ * ```
30
+ *
31
+ * @tag m3e-textarea-autosize
32
+ *
33
+ * @attr disabled - Whether auto-sizing is disabled.
34
+ * @attr for - The query selector used to specify the element related to this element.
35
+ * @attr max-rows - The maximum amount of rows in the `textarea`.
36
+ * @attr min-rows - The minimum amount of rows in the `textarea`.
37
+ */
38
+ export declare class M3eTextareaAutosizeElement extends M3eTextareaAutosizeElement_base {
39
+ #private;
40
+ /** The styles of the element. */
41
+ static styles: CSSResultGroup;
42
+ /**
43
+ * The maximum amount of rows in the `textarea`.
44
+ * @default 0
45
+ */
46
+ maxRows: number;
47
+ /**
48
+ * The minimum amount of rows in the `textarea`.
49
+ * @default 0
50
+ */
51
+ minRows: number;
52
+ /**
53
+ * Whether auto-sizing is disabled.
54
+ * @default false
55
+ */
56
+ disabled: boolean;
57
+ /** @inheritdoc */
58
+ attach(control: HTMLElement): void;
59
+ /** @inheritdoc */
60
+ detach(): void;
61
+ /** @inheritdoc */
62
+ connectedCallback(): void;
63
+ /** @inheritdoc */
64
+ protected updated(_changedProperties: PropertyValues<this>): void;
65
+ /**
66
+ * Resize the `textarea` to fit its content.
67
+ * @param {boolean} [force=false] - Whether to force a height recalculation.
68
+ */
69
+ resizeToFitContent(force?: boolean): void;
70
+ /** Resets the `textarea` to its original size. */
71
+ reset(): void;
72
+ /** @private */
73
+ private _handleWindowResize;
74
+ }
75
+ declare global {
76
+ interface HTMLElementTagNameMap {
77
+ "m3e-textarea-autosize": M3eTextareaAutosizeElement;
78
+ }
79
+ }
80
+ export {};
81
+ //# sourceMappingURL=TextareaAutosizeElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextareaAutosizeElement.d.ts","sourceRoot":"","sources":["../../src/TextareaAutosizeElement.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAO,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;;AAKtE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBACa,0BAA2B,SAAQ,+BAAiC;;IAC/E,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAIpC;IAaF;;;OAGG;IACgD,OAAO,SAAK;IAE/D;;;OAGG;IACgD,OAAO,SAAK;IAE/D;;;OAGG;IACyC,QAAQ,UAAS;IAE7D,kBAAkB;IACT,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAc3C,kBAAkB;IACT,MAAM,IAAI,IAAI;IAUvB,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IAKlC,kBAAkB;cACC,OAAO,CAAC,kBAAkB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAY1E;;;OAGG;IACH,kBAAkB,CAAC,KAAK,GAAE,OAAe,GAAG,IAAI;IA2BhD,kDAAkD;IAClD,KAAK;IAyHL,eAAe;IAEf,OAAO,CAAC,mBAAmB;CAI5B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,uBAAuB,EAAE,0BAA0B,CAAC;KACrD;CACF"}
@@ -0,0 +1,2 @@
1
+ export * from "./TextareaAutosizeElement";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m3e/textarea-autosize",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0-rc.3",
4
4
  "description": "Textarea Autosize for M3E",
5
5
  "author": "matraic <matraic@yahoo.com>",
6
6
  "license": "MIT",
@@ -28,7 +28,7 @@
28
28
  "clean": "rimraf dist"
29
29
  },
30
30
  "peerDependencies": {
31
- "@m3e/core": "1.0.0-rc.2",
31
+ "@m3e/core": "1.0.0-rc.3",
32
32
  "lit": "^3.3.0"
33
33
  },
34
34
  "devDependencies": {