@nysds/nys-textarea 1.21.0 → 1.22.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.
- package/dist/nys-textarea.d.ts +47 -4
- package/dist/nys-textarea.js +156 -124
- package/dist/nys-textarea.js.map +1 -1
- package/package.json +7 -7
package/dist/nys-textarea.d.ts
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
import { NysFormControlElement } from "@nysds/internals";
|
|
2
2
|
import "@nysds/nys-label";
|
|
3
3
|
import "@nysds/nys-errormessage";
|
|
4
|
+
/** Detail payload for the `nys-input` event. */
|
|
5
|
+
export interface NysTextareaInputDetail {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
/** The `nys-input` event, fired on each keystroke. */
|
|
11
|
+
export type NysTextareaInputEvent = CustomEvent<NysTextareaInputDetail>;
|
|
12
|
+
/** Detail payload for the `nys-change` event. */
|
|
13
|
+
export interface NysTextareaChangeDetail {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}
|
|
18
|
+
/** The `nys-change` event, fired when the value is committed. */
|
|
19
|
+
export type NysTextareaChangeEvent = CustomEvent<NysTextareaChangeDetail>;
|
|
20
|
+
/** Detail payload for the `nys-select` event. */
|
|
21
|
+
export interface NysTextareaSelectDetail {
|
|
22
|
+
id: string;
|
|
23
|
+
value: string;
|
|
24
|
+
}
|
|
25
|
+
/** The `nys-select` event, fired when the user selects text. */
|
|
26
|
+
export type NysTextareaSelectEvent = CustomEvent<NysTextareaSelectDetail>;
|
|
27
|
+
/** Detail payload for the `nys-selectionchange` event. */
|
|
28
|
+
export interface NysTextareaSelectionchangeDetail {
|
|
29
|
+
id: string;
|
|
30
|
+
value: string;
|
|
31
|
+
}
|
|
32
|
+
/** The `nys-selectionchange` event, fired when the text selection changes. */
|
|
33
|
+
export type NysTextareaSelectionchangeEvent = CustomEvent<NysTextareaSelectionchangeDetail>;
|
|
4
34
|
/**
|
|
5
35
|
* A multi-line text input for collecting longer responses like comments, descriptions, or feedback.
|
|
6
36
|
* Form-associated with validation support via ElementInternals.
|
|
@@ -13,10 +43,21 @@ import "@nysds/nys-errormessage";
|
|
|
13
43
|
*
|
|
14
44
|
* @slot description - Custom HTML description content below the label.
|
|
15
45
|
*
|
|
16
|
-
* @
|
|
17
|
-
*
|
|
18
|
-
* @fires nys-
|
|
19
|
-
* @fires nys-
|
|
46
|
+
* @formControl value nys-change nys-input
|
|
47
|
+
*
|
|
48
|
+
* @fires {NysTextareaInputEvent} nys-input - Fired on each input. Detail: `{id, name, value}`.
|
|
49
|
+
* @fires {NysTextareaChangeEvent} nys-change - Fired when the value is committed (native `change`). Detail: `{id, name, value}`.
|
|
50
|
+
* @fires {Event} nys-focus - Fired when the textarea gains focus.
|
|
51
|
+
* @fires {Event} nys-blur - Fired when the textarea loses focus. Triggers validation.
|
|
52
|
+
* @fires {NysTextareaSelectEvent} nys-select - Fired when the user selects text. Detail: `{id, value}`.
|
|
53
|
+
* @fires {NysTextareaSelectionchangeEvent} nys-selectionchange - Fired when the text selection changes. Detail: `{id, value}`.
|
|
54
|
+
*
|
|
55
|
+
* @usagedos
|
|
56
|
+
* - Use to collect multiple lines of open-ended text input (e.g., comments, descriptions, feedback).
|
|
57
|
+
*
|
|
58
|
+
* @usagedonts
|
|
59
|
+
* - Use for short or single-line input. Use `<nys-textinput>` instead.
|
|
60
|
+
* - Use when input should be selected from predefined options. Use `<nys-select>`, `<nys-radiobutton>`, or `<nys-checkbox>` instead.
|
|
20
61
|
*
|
|
21
62
|
* @example Basic
|
|
22
63
|
* ```html
|
|
@@ -144,6 +185,7 @@ export declare class NysTextarea extends NysFormControlElement {
|
|
|
144
185
|
connectedCallback(): void;
|
|
145
186
|
disconnectedCallback(): void;
|
|
146
187
|
firstUpdated(): void;
|
|
188
|
+
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
147
189
|
updated(changedProperties: Map<string | number | symbol, unknown>): Promise<void>;
|
|
148
190
|
/**
|
|
149
191
|
* Form Integration
|
|
@@ -165,6 +207,7 @@ export declare class NysTextarea extends NysFormControlElement {
|
|
|
165
207
|
* --------------------------------------------------------------------------
|
|
166
208
|
*/
|
|
167
209
|
private _handleInput;
|
|
210
|
+
private _handleChange;
|
|
168
211
|
private _handleFocus;
|
|
169
212
|
private _handleBlur;
|
|
170
213
|
private _handleSelect;
|
package/dist/nys-textarea.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { property as
|
|
1
|
+
import { LitElement as f, unsafeCSS as _, html as x } from "lit";
|
|
2
|
+
import { property as r } from "lit/decorators.js";
|
|
3
3
|
import { ifDefined as h } from "lit/directives/if-defined.js";
|
|
4
4
|
import "@nysds/nys-label";
|
|
5
5
|
import "@nysds/nys-errormessage";
|
|
@@ -8,63 +8,74 @@ import "@nysds/nys-errormessage";
|
|
|
8
8
|
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
9
9
|
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
10
10
|
*
|
|
11
|
-
* Textarea Component v1.
|
|
11
|
+
* Textarea Component v1.22.0
|
|
12
12
|
* Part of the New York State Design System
|
|
13
13
|
* Repository: https://github.com/its-hcd/nysds
|
|
14
14
|
* License: MIT
|
|
15
15
|
*/
|
|
16
16
|
/*!
|
|
17
|
-
* New York State Design System v1.
|
|
17
|
+
* New York State Design System v1.22.0
|
|
18
18
|
* Description: A design system for New York State's digital products.
|
|
19
19
|
* Repository: https://github.com/its-hcd/nysds
|
|
20
20
|
* License: MIT
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
|
-
function
|
|
24
|
-
return `${o}-${Date.now()}-${
|
|
22
|
+
let g = 0;
|
|
23
|
+
function m(o) {
|
|
24
|
+
return `${o}-${Date.now()}-${g++}`;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
function c(o, e, t) {
|
|
27
|
+
o.dispatchEvent(
|
|
28
|
+
new CustomEvent(e, { detail: t, bubbles: !0, composed: !0 })
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
function v(o, e) {
|
|
32
|
+
o.dispatchEvent(
|
|
33
|
+
new Event(`nys-${e}`, { bubbles: !0, composed: !0 })
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
const b = (o) => {
|
|
27
37
|
class e extends o {
|
|
28
38
|
get idPrefix() {
|
|
29
39
|
return this.localName || "nys-element";
|
|
30
40
|
}
|
|
31
41
|
ensureId() {
|
|
32
|
-
this.id || (this.id =
|
|
42
|
+
this.id || (this.id = m(this.idPrefix));
|
|
33
43
|
}
|
|
34
44
|
connectedCallback() {
|
|
35
45
|
super.connectedCallback(), this.ensureId();
|
|
36
46
|
}
|
|
37
47
|
}
|
|
38
48
|
return e;
|
|
39
|
-
},
|
|
49
|
+
}, w = (o) => {
|
|
40
50
|
class e extends b(o) {
|
|
41
|
-
constructor(
|
|
42
|
-
super(...
|
|
51
|
+
constructor() {
|
|
52
|
+
super(...arguments), this.__internals = null;
|
|
43
53
|
}
|
|
44
54
|
get internals() {
|
|
45
55
|
if (this.__internals) return this.__internals;
|
|
46
|
-
if (typeof this.attachInternals == "function")
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
56
|
+
if (typeof this.attachInternals == "function")
|
|
57
|
+
try {
|
|
58
|
+
this.__internals = this.attachInternals();
|
|
59
|
+
} catch {
|
|
60
|
+
this.__internals = null;
|
|
61
|
+
}
|
|
51
62
|
return this.__internals;
|
|
52
63
|
}
|
|
53
64
|
get defaultRole() {
|
|
54
65
|
return null;
|
|
55
66
|
}
|
|
56
|
-
setHostAria(
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
n
|
|
67
|
+
setHostAria(n, i) {
|
|
68
|
+
const l = this.internals;
|
|
69
|
+
if (l && n in l) {
|
|
70
|
+
l[n] = i;
|
|
60
71
|
return;
|
|
61
72
|
}
|
|
62
|
-
const d =
|
|
73
|
+
const d = V(n);
|
|
63
74
|
i === null ? this.removeAttribute(d) : this.setAttribute(d, i);
|
|
64
75
|
}
|
|
65
76
|
reflectDefaultSemantics() {
|
|
66
|
-
const
|
|
67
|
-
|
|
77
|
+
const n = this.defaultRole;
|
|
78
|
+
n && this.setHostAria("role", n);
|
|
68
79
|
}
|
|
69
80
|
connectedCallback() {
|
|
70
81
|
super.connectedCallback(), this.reflectDefaultSemantics();
|
|
@@ -72,21 +83,33 @@ var b = (o) => {
|
|
|
72
83
|
}
|
|
73
84
|
return e;
|
|
74
85
|
};
|
|
75
|
-
function
|
|
86
|
+
function V(o) {
|
|
76
87
|
if (o === "role") return "role";
|
|
77
88
|
const e = o.replace(/^aria/, "");
|
|
78
89
|
return "aria-" + e.charAt(0).toLowerCase() + e.slice(1);
|
|
79
90
|
}
|
|
80
|
-
|
|
81
|
-
const
|
|
91
|
+
const $ = (o) => {
|
|
92
|
+
const e = class extends w(o) {
|
|
93
|
+
constructor() {
|
|
94
|
+
super(...arguments), this.__internalValidationMessage = "";
|
|
95
|
+
}
|
|
96
|
+
get internalValidationMessage() {
|
|
97
|
+
return this.__internalValidationMessage;
|
|
98
|
+
}
|
|
99
|
+
set internalValidationMessage(i) {
|
|
100
|
+
i !== this.__internalValidationMessage && (this.__internalValidationMessage = i, this.requestUpdate("internalValidationMessage"));
|
|
101
|
+
}
|
|
102
|
+
resolvedErrorMessage() {
|
|
103
|
+
return this.errorMessage || this.internalValidationMessage;
|
|
104
|
+
}
|
|
82
105
|
setFormValue(i) {
|
|
83
106
|
this.internals?.setFormValue(i ?? null);
|
|
84
107
|
}
|
|
85
|
-
setValidityFromState(i,
|
|
86
|
-
const
|
|
87
|
-
if (!
|
|
88
|
-
const
|
|
89
|
-
|
|
108
|
+
setValidityFromState(i, l, d) {
|
|
109
|
+
const y = this.internals;
|
|
110
|
+
if (!y) return;
|
|
111
|
+
const p = Object.values(i).some(Boolean);
|
|
112
|
+
p ? y.setValidity(i, l ?? "Invalid value", d) : y.setValidity({}), this.setHostAria("ariaInvalid", p ? "true" : "false");
|
|
90
113
|
}
|
|
91
114
|
clearValidity() {
|
|
92
115
|
this.internals?.setValidity({}), this.setHostAria("ariaInvalid", "false");
|
|
@@ -98,20 +121,17 @@ var w = (o) => {
|
|
|
98
121
|
return this.internals?.reportValidity() ?? !0;
|
|
99
122
|
}
|
|
100
123
|
formResetCallback() {
|
|
101
|
-
this.clearValidity();
|
|
124
|
+
this.internalValidationMessage = "", this.clearValidity();
|
|
102
125
|
}
|
|
103
126
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
for (var i = void 0, n = o.length - 1, d; n >= 0; n--)
|
|
111
|
-
(d = o[n]) && (i = d(e, t, i) || i);
|
|
112
|
-
return i && V(e, t, i), i;
|
|
127
|
+
return e.formAssociated = !0, e;
|
|
128
|
+
}, S = /* @__PURE__ */ $(f), q = ':host{--_nys-textarea-width: 100%;--_nys-textarea-border-radius: var(--nys-radius-md, 4px);--_nys-textarea-border-width: var(--nys-border-width-sm, 1px);--_nys-textarea-border-color: var(--nys-color-neutral-400, #909395);--_nys-textarea-padding: var(--nys-space-200, 16px);--_nys-textarea-gap: var(--nys-space-50, 4px);--_nys-textarea-color: var(--nys-color-ink, #1b1b1b);--_nys-textarea-color--placeholder: var( --nys-color-text-weaker, var(--nys-color-neutral-500, #797c7f) );--_nys-textarea-outline-color--hover: var(--nys-color-neutral-900, #1b1b1b);--_nys-textarea-outline-width: var(--nys-border-width-sm, 1px);--_nys-textarea-outline-color--focus: var(--nys-color-focus, #004dd1);--_nys-textarea-background-color--disabled: var( --nys-color-neutral-10, #f6f6f6 );--_nys-textarea-border-color--disabled: var(--nys-color-neutral-200, #bec0c1);--_nys-textarea-color--disabled: var( --nys-color-text-disabled, var(--nys-color-neutral-200, #bec0c1) );--_nys-textarea-font-family: var( --nys-font-family-ui, var( --nys-font-family-sans, "Proxima Nova", "Helvetica Neue", "Helvetica", "Arial", sans-serif ) );--_nys-textarea-font-size: var(--nys-font-size-ui-md, 16px);--_nys-textarea-font-weight: var(--nys-font-weight-regular, 400);--_nys-textarea-line-height: var(--nys-font-lineheight-ui-md, 24px);--nys-textarea-letterspacing-ui: var( --nys-font-letterspacing-ui-md, var(--nys-font-letterspacing-400, .044px) )}:host([width=sm]){--_nys-textarea-width: var(--nys-form-width-sm, 88px)}:host([width=md]){--_nys-textarea-width: var(--nys-form-width-md, 200px)}:host([width=lg]){--_nys-textarea-width: var(--nys-form-width-lg, 384px)}:host([width=full]){--_nys-textarea-width: 100%;flex:1}:host([showError]){--_nys-textarea-border-color: var(--nys-color-danger, #b52c2c)}:host([inverted]){--_nys-textarea-outline-color--focus: var(--nys-color-focus-reverse, #7aa5e7)}.nys-textarea{font-weight:var(--_nys-textarea-font-weight);font-family:var(--_nys-textarea-font-family);line-height:var(--_nys-textarea-line-height);letter-spacing:var(--nys-textarea-letterspacing-ui);color:var(--_nys-textarea-color);gap:var(--_nys-textarea-gap);display:flex;flex-direction:column}.nys-textarea__textarea{color:var(--_nys-textarea-color);font-size:var(--_nys-textarea-font-size);font-family:var(--_nys-textarea-font-family);border-radius:var(--_nys-textarea-border-radius);border:solid var(--_nys-textarea-border-color) var(--_nys-textarea-border-width);padding:var(--_nys-textarea-padding);width:var(--_nys-textarea-width);line-height:var(--_nys-textarea-line-height);max-width:var(--_nys-textarea-width);box-sizing:border-box}.nys-textarea__textarea::placeholder{color:var(--_nys-textarea-color--placeholder)}.nys-textarea__textarea.none{resize:none}.nys-textarea__textarea:hover:not(:disabled):not(:focus):not([readonly]){outline:solid var(--_nys-textarea-outline-width) var(--_nys-textarea-outline-color--hover);border-color:var(--_nys-textarea-outline-color--hover)}.nys-textarea__textarea:focus:not([readonly]){outline:solid var(--_nys-textarea-outline-width) var(--_nys-textarea-outline-color--focus);border-color:var(--_nys-textarea-outline-color--focus);caret-color:var(--_nys-textarea-outline-color--focus)}.nys-textarea__textarea:disabled,.nys-textarea__textarea:disabled::placeholder{background-color:var(--_nys-textarea-background-color--disabled);border-color:var(--_nys-textarea-border-color--disabled);color:var(--_nys-textarea-color--disabled);cursor:not-allowed}';
|
|
129
|
+
var E = Object.defineProperty, s = (o, e, t, n) => {
|
|
130
|
+
for (var i = void 0, l = o.length - 1, d; l >= 0; l--)
|
|
131
|
+
(d = o[l]) && (i = d(e, t, i) || i);
|
|
132
|
+
return i && E(e, t, i), i;
|
|
113
133
|
};
|
|
114
|
-
const
|
|
134
|
+
const u = class u extends S {
|
|
115
135
|
constructor() {
|
|
116
136
|
super(...arguments), this.id = "", this.name = "", this.label = "", this.description = "", this.placeholder = "", this.value = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.optional = !1, this.tooltip = "", this.inverted = !1, this.form = null, this.maxlength = null, this.width = "full", this.rows = 4, this.resize = "vertical", this.showError = !1, this.errorMessage = "", this.ariaLabel = "", this._hasUserInteracted = !1;
|
|
117
137
|
}
|
|
@@ -131,10 +151,13 @@ const c = class c extends $ {
|
|
|
131
151
|
firstUpdated() {
|
|
132
152
|
this._setValue();
|
|
133
153
|
}
|
|
154
|
+
willUpdate(e) {
|
|
155
|
+
e.has("rows") && this.rows == null && (this.rows = 4);
|
|
156
|
+
}
|
|
134
157
|
async updated(e) {
|
|
135
|
-
if (await Promise.resolve(), e.has("value") && this._setValue(), e.has("
|
|
158
|
+
if (await Promise.resolve(), e.has("value") && this._setValue(), e.has("readonly") || e.has("required")) {
|
|
136
159
|
const t = this.shadowRoot?.querySelector("textarea");
|
|
137
|
-
t && (t.required = this.required && !this.readonly);
|
|
160
|
+
t && (t.required = this.required && !this.readonly), this._manageRequire();
|
|
138
161
|
}
|
|
139
162
|
}
|
|
140
163
|
/**
|
|
@@ -147,12 +170,19 @@ const c = class c extends $ {
|
|
|
147
170
|
_manageRequire() {
|
|
148
171
|
const e = this.shadowRoot?.querySelector("textarea");
|
|
149
172
|
if (!e) return;
|
|
150
|
-
|
|
151
|
-
|
|
173
|
+
this.required && !this.value ? (this.internalValidationMessage = "This field is required", this.setValidityFromState(
|
|
174
|
+
{ valueMissing: !0 },
|
|
175
|
+
this.resolvedErrorMessage(),
|
|
176
|
+
e
|
|
177
|
+
)) : (this.internalValidationMessage = "", this.clearValidity(), this._hasUserInteracted = !1);
|
|
152
178
|
}
|
|
153
179
|
_setValidityMessage(e = "") {
|
|
154
180
|
const t = this.shadowRoot?.querySelector("textarea");
|
|
155
|
-
t && (this.showError = !!e, this.
|
|
181
|
+
t && (this.showError = !!e, this.internalValidationMessage = e, e ? this.setValidityFromState(
|
|
182
|
+
{ customError: !0 },
|
|
183
|
+
this.resolvedErrorMessage(),
|
|
184
|
+
t
|
|
185
|
+
) : this.clearValidity());
|
|
156
186
|
}
|
|
157
187
|
_validate() {
|
|
158
188
|
const e = this.shadowRoot?.querySelector("textarea");
|
|
@@ -164,7 +194,7 @@ const c = class c extends $ {
|
|
|
164
194
|
formResetCallback() {
|
|
165
195
|
this.value = "";
|
|
166
196
|
const e = this.shadowRoot?.querySelector("textarea");
|
|
167
|
-
e && (e.value = "", e.setAttribute("aria-invalid", "false")), this.showError = !1, this.clearValidity(), this.requestUpdate();
|
|
197
|
+
e && (e.value = "", e.setAttribute("aria-invalid", "false")), this.showError = !1, this.internalValidationMessage = "", this.clearValidity(), this.requestUpdate();
|
|
168
198
|
}
|
|
169
199
|
/**
|
|
170
200
|
* Functions
|
|
@@ -179,8 +209,8 @@ const c = class c extends $ {
|
|
|
179
209
|
e.preventDefault(), this._hasUserInteracted = !0, this._validate();
|
|
180
210
|
const t = this.shadowRoot?.querySelector("textarea");
|
|
181
211
|
if (t) {
|
|
182
|
-
const
|
|
183
|
-
|
|
212
|
+
const n = this.internals?.form;
|
|
213
|
+
n ? Array.from(n.elements).find(
|
|
184
214
|
(d) => typeof d.checkValidity == "function" && !d.checkValidity()
|
|
185
215
|
) === this && t.focus() : t.focus();
|
|
186
216
|
}
|
|
@@ -192,48 +222,49 @@ const c = class c extends $ {
|
|
|
192
222
|
// Handle input event to check pattern validity
|
|
193
223
|
_handleInput(e) {
|
|
194
224
|
const t = e.target;
|
|
195
|
-
this.value = t.value, this.setFormValue(this.value), this._hasUserInteracted && this._validate(), this
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
225
|
+
this.value = t.value, this.setFormValue(this.value), this._hasUserInteracted && this._validate(), c(this, "nys-input", {
|
|
226
|
+
id: this.id,
|
|
227
|
+
name: this.name,
|
|
228
|
+
value: this.value
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
// Handle native change (value committed on blur after edits)
|
|
232
|
+
_handleChange(e) {
|
|
233
|
+
const t = e.target;
|
|
234
|
+
this.value = t.value, c(this, "nys-change", {
|
|
235
|
+
id: this.id,
|
|
236
|
+
name: this.name,
|
|
237
|
+
value: this.value
|
|
238
|
+
});
|
|
202
239
|
}
|
|
203
240
|
// Handle focus event
|
|
204
241
|
_handleFocus() {
|
|
205
|
-
this
|
|
206
|
-
new Event("nys-focus", { bubbles: !0, composed: !0 })
|
|
207
|
-
);
|
|
242
|
+
v(this, "focus");
|
|
208
243
|
}
|
|
209
244
|
// Handle blur event
|
|
210
245
|
_handleBlur() {
|
|
211
|
-
this._hasUserInteracted || (this._hasUserInteracted = !0), this._validate(), this
|
|
212
|
-
new Event("nys-blur", { bubbles: !0, composed: !0 })
|
|
213
|
-
);
|
|
246
|
+
this._hasUserInteracted || (this._hasUserInteracted = !0), this._validate(), v(this, "blur");
|
|
214
247
|
}
|
|
215
248
|
_handleSelect(e) {
|
|
216
249
|
const t = e.target;
|
|
217
|
-
this.value = t.value, this
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
composed: !0
|
|
222
|
-
})
|
|
223
|
-
);
|
|
250
|
+
this.value = t.value, c(this, "nys-select", {
|
|
251
|
+
id: this.id,
|
|
252
|
+
value: this.value
|
|
253
|
+
});
|
|
224
254
|
}
|
|
225
255
|
_handleSelectionChange(e) {
|
|
226
256
|
const t = e.target;
|
|
227
|
-
this.value = t.value,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
257
|
+
this.value = t.value, c(
|
|
258
|
+
this,
|
|
259
|
+
"nys-selectionchange",
|
|
260
|
+
{
|
|
261
|
+
id: this.id,
|
|
262
|
+
value: this.value
|
|
263
|
+
}
|
|
233
264
|
);
|
|
234
265
|
}
|
|
235
266
|
render() {
|
|
236
|
-
return
|
|
267
|
+
return x`
|
|
237
268
|
<div class="nys-textarea">
|
|
238
269
|
<nys-label
|
|
239
270
|
id="${this.id}--label"
|
|
@@ -274,6 +305,7 @@ const c = class c extends $ {
|
|
|
274
305
|
.rows=${this.rows}
|
|
275
306
|
form=${h(this.form || void 0)}
|
|
276
307
|
@input=${this._handleInput}
|
|
308
|
+
@change=${this._handleChange}
|
|
277
309
|
@focus="${this._handleFocus}"
|
|
278
310
|
@blur="${this._handleBlur}"
|
|
279
311
|
@select="${this._handleSelect}"
|
|
@@ -282,79 +314,79 @@ const c = class c extends $ {
|
|
|
282
314
|
<nys-errormessage
|
|
283
315
|
id=${this.id + "--error"}
|
|
284
316
|
?showError=${this.showError}
|
|
285
|
-
errorMessage=${this.
|
|
317
|
+
errorMessage=${this.resolvedErrorMessage()}
|
|
286
318
|
></nys-errormessage>
|
|
287
319
|
</div>
|
|
288
320
|
`;
|
|
289
321
|
}
|
|
290
322
|
};
|
|
291
|
-
|
|
292
|
-
...
|
|
323
|
+
u.styles = _(q), u.shadowRootOptions = {
|
|
324
|
+
...f.shadowRootOptions,
|
|
293
325
|
delegatesFocus: !0
|
|
294
326
|
};
|
|
295
|
-
let
|
|
327
|
+
let a = u;
|
|
296
328
|
s([
|
|
297
|
-
|
|
298
|
-
],
|
|
329
|
+
r({ type: String, reflect: !0 })
|
|
330
|
+
], a.prototype, "id");
|
|
299
331
|
s([
|
|
300
|
-
|
|
301
|
-
],
|
|
332
|
+
r({ type: String, reflect: !0 })
|
|
333
|
+
], a.prototype, "name");
|
|
302
334
|
s([
|
|
303
|
-
|
|
304
|
-
],
|
|
335
|
+
r({ type: String })
|
|
336
|
+
], a.prototype, "label");
|
|
305
337
|
s([
|
|
306
|
-
|
|
307
|
-
],
|
|
338
|
+
r({ type: String })
|
|
339
|
+
], a.prototype, "description");
|
|
308
340
|
s([
|
|
309
|
-
|
|
310
|
-
],
|
|
341
|
+
r({ type: String })
|
|
342
|
+
], a.prototype, "placeholder");
|
|
311
343
|
s([
|
|
312
|
-
|
|
313
|
-
],
|
|
344
|
+
r({ type: String })
|
|
345
|
+
], a.prototype, "value");
|
|
314
346
|
s([
|
|
315
|
-
|
|
316
|
-
],
|
|
347
|
+
r({ type: Boolean, reflect: !0 })
|
|
348
|
+
], a.prototype, "disabled");
|
|
317
349
|
s([
|
|
318
|
-
|
|
319
|
-
],
|
|
350
|
+
r({ type: Boolean, reflect: !0 })
|
|
351
|
+
], a.prototype, "readonly");
|
|
320
352
|
s([
|
|
321
|
-
|
|
322
|
-
],
|
|
353
|
+
r({ type: Boolean, reflect: !0 })
|
|
354
|
+
], a.prototype, "required");
|
|
323
355
|
s([
|
|
324
|
-
|
|
325
|
-
],
|
|
356
|
+
r({ type: Boolean, reflect: !0 })
|
|
357
|
+
], a.prototype, "optional");
|
|
326
358
|
s([
|
|
327
|
-
|
|
328
|
-
],
|
|
359
|
+
r({ type: String })
|
|
360
|
+
], a.prototype, "tooltip");
|
|
329
361
|
s([
|
|
330
|
-
|
|
331
|
-
],
|
|
362
|
+
r({ type: Boolean, reflect: !0 })
|
|
363
|
+
], a.prototype, "inverted");
|
|
332
364
|
s([
|
|
333
|
-
|
|
334
|
-
],
|
|
365
|
+
r({ type: String, reflect: !0 })
|
|
366
|
+
], a.prototype, "form");
|
|
335
367
|
s([
|
|
336
|
-
|
|
337
|
-
],
|
|
368
|
+
r({ type: Number })
|
|
369
|
+
], a.prototype, "maxlength");
|
|
338
370
|
s([
|
|
339
|
-
|
|
340
|
-
],
|
|
371
|
+
r({ type: String, reflect: !0 })
|
|
372
|
+
], a.prototype, "width");
|
|
341
373
|
s([
|
|
342
|
-
|
|
343
|
-
],
|
|
374
|
+
r({ type: Number })
|
|
375
|
+
], a.prototype, "rows");
|
|
344
376
|
s([
|
|
345
|
-
|
|
346
|
-
],
|
|
377
|
+
r({ type: String, reflect: !0 })
|
|
378
|
+
], a.prototype, "resize");
|
|
347
379
|
s([
|
|
348
|
-
|
|
349
|
-
],
|
|
380
|
+
r({ type: Boolean, reflect: !0 })
|
|
381
|
+
], a.prototype, "showError");
|
|
350
382
|
s([
|
|
351
|
-
|
|
352
|
-
],
|
|
383
|
+
r({ type: String })
|
|
384
|
+
], a.prototype, "errorMessage");
|
|
353
385
|
s([
|
|
354
|
-
|
|
355
|
-
],
|
|
356
|
-
customElements.get("nys-textarea") || customElements.define("nys-textarea",
|
|
386
|
+
r({ type: String })
|
|
387
|
+
], a.prototype, "ariaLabel");
|
|
388
|
+
customElements.get("nys-textarea") || customElements.define("nys-textarea", a);
|
|
357
389
|
export {
|
|
358
|
-
|
|
390
|
+
a as NysTextarea
|
|
359
391
|
};
|
|
360
392
|
//# sourceMappingURL=nys-textarea.js.map
|
package/dist/nys-textarea.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nys-textarea.js","sources":["../../internals/dist/index.js","../src/nys-textarea.ts"],"sourcesContent":["import { LitElement as u } from \"lit\";\n/*!\n * New York State Design System v1.21.0\n * Description: A design system for New York State's digital products.\n * Repository: https://github.com/its-hcd/nysds\n * License: MIT\n */\nvar y = 0;\nfunction f(e) {\n return `${e}-${Date.now()}-${y++}`;\n}\nvar p = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, v = {\n labelledby: \"ariaLabel\",\n describedby: \"ariaDescription\"\n};\nfunction A(e) {\n return \"ariaDescribedByElements\" in e;\n}\nfunction R(e) {\n return e === \"errormessage\" ? \"aria-errormessage\" : `aria-${e}`;\n}\nfunction d(e) {\n return e.filter((r) => !!r);\n}\nfunction _(e) {\n return e.map((r) => (r.id || (r.id = f(\"nys-ref\")), r.id));\n}\nfunction V(e, r, a) {\n const t = d(a), n = R(r);\n t.length ? e.setAttribute(n, _(t).join(\" \")) : e.removeAttribute(n);\n}\nfunction x(e, r, a, t, n) {\n const i = d(t), s = p[a], l = r;\n if (s && A(r)) {\n l[s] = i.length ? i : null;\n return;\n }\n const o = v[a];\n if (!o) return;\n const c = n ?? (i.length ? i.map((m) => m.textContent?.trim() ?? \"\").filter(Boolean).join(\" \") : \"\");\n o in l ? l[o] = c || null : c ? e.setAttribute(a === \"labelledby\" ? \"aria-label\" : \"aria-description\", c) : e.removeAttribute(a === \"labelledby\" ? \"aria-label\" : \"aria-description\");\n}\nvar E = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, C = {\n labelledby: \"aria-label\",\n describedby: \"aria-description\"\n};\nfunction L(e, r, a) {\n const t = d(a), n = E[r], i = C[r], s = e;\n if (n && n in e && (s[n] = t.length ? t : null), !i) return;\n const l = t.map((o) => o.textContent?.trim() ?? \"\").filter(Boolean).join(\" \");\n l ? e.setAttribute(i, l) : e.removeAttribute(i);\n}\nvar b = (e) => {\n class r extends e {\n get idPrefix() {\n return this.localName || \"nys-element\";\n }\n ensureId() {\n this.id || (this.id = f(this.idPrefix));\n }\n connectedCallback() {\n super.connectedCallback(), this.ensureId();\n }\n }\n return r;\n}, P = /* @__PURE__ */ b(u), h = (e) => {\n class r extends b(e) {\n constructor(...t) {\n super(...t), this.__internals = null;\n }\n get internals() {\n if (this.__internals) return this.__internals;\n if (typeof this.attachInternals == \"function\") try {\n this.__internals = this.attachInternals();\n } catch {\n this.__internals = null;\n }\n return this.__internals;\n }\n get defaultRole() {\n return null;\n }\n setHostAria(t, n) {\n const i = this.internals;\n if (i && t in i) {\n i[t] = n;\n return;\n }\n const s = g(t);\n n === null ? this.removeAttribute(s) : this.setAttribute(s, n);\n }\n reflectDefaultSemantics() {\n const t = this.defaultRole;\n t && this.setHostAria(\"role\", t);\n }\n connectedCallback() {\n super.connectedCallback(), this.reflectDefaultSemantics();\n }\n }\n return r;\n};\nfunction g(e) {\n if (e === \"role\") return \"role\";\n const r = e.replace(/^aria/, \"\");\n return \"aria-\" + r.charAt(0).toLowerCase() + r.slice(1);\n}\nvar T = /* @__PURE__ */ h(u), I = (e) => {\n class r extends h(e) {\n static {\n this.formAssociated = !0;\n }\n setFormValue(t) {\n this.internals?.setFormValue(t ?? null);\n }\n setValidityFromState(t, n, i) {\n const s = this.internals;\n if (!s) return;\n const l = Object.values(t).some(Boolean);\n l ? s.setValidity(t, n ?? \"Invalid value\", i) : s.setValidity({}), this.setHostAria(\"ariaInvalid\", l ? \"true\" : \"false\");\n }\n clearValidity() {\n this.internals?.setValidity({}), this.setHostAria(\"ariaInvalid\", \"false\");\n }\n checkValidity() {\n return this.internals?.checkValidity() ?? !0;\n }\n reportValidity() {\n return this.internals?.reportValidity() ?? !0;\n }\n formResetCallback() {\n this.clearValidity();\n }\n }\n return r;\n}, w = /* @__PURE__ */ I(u);\nfunction O(e) {\n const r = e.tagName.toLowerCase(), a = /* @__PURE__ */ new Set(), t = (n) => {\n n.querySelectorAll(\"*\").forEach((i) => {\n const s = i.tagName.toLowerCase();\n s.startsWith(\"nys-\") && s !== r && !customElements.get(s) && a.add(s), i.shadowRoot && t(i.shadowRoot);\n });\n };\n return e.shadowRoot && t(e.shadowRoot), t(e), [...a].sort();\n}\nexport {\n I as FormControlMixin,\n b as IdentifiedMixin,\n P as NysElement,\n w as NysFormControlElement,\n T as NysReflectsAriaElement,\n h as ReflectsAriaMixin,\n V as associateControl,\n L as associateControlRefs,\n x as associateHost,\n O as findUnregisteredChildren,\n f as generateId,\n A as supportsElementRefs\n};\n\n//# sourceMappingURL=index.js.map","import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { NysFormControlElement } from \"@nysds/internals\";\n// These internal elements are rendered inside this component's shadow DOM, so\n// they must be registered whenever nys-textarea is used. Importing them here\n// (intentional side effect) guarantees the visible label and error message —\n// which the accessible name/error association depends on — always render.\nimport \"@nysds/nys-label\";\nimport \"@nysds/nys-errormessage\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-textarea.scss?inline\";\n\n/**\n * A multi-line text input for collecting longer responses like comments, descriptions, or feedback.\n * Form-associated with validation support via ElementInternals.\n *\n * Use for detailed responses needing multiple lines. For single-line input, use `nys-textinput`.\n * For predefined options, use `nys-select`, `nys-radiobutton`, or `nys-checkbox`.\n *\n * @summary Multi-line text input for comments, descriptions, and feedback.\n * @element nys-textarea\n *\n * @slot description - Custom HTML description content below the label.\n *\n * @fires nys-input - Fired on input change. Detail: `{id, value}`.\n * @fires nys-focus - Fired when textarea gains focus.\n * @fires nys-blur - Fired when textarea loses focus. Triggers validation.\n * @fires nys-select - Fired when user selects text. Detail: `{id, value}`.\n *\n * @example Basic\n * ```html\n * <nys-textarea label=\"Comments\"></nys-textarea>\n * ```\n *\n * @example Disabled\n * ```html\n * <nys-textarea label=\"Comments\" disabled></nys-textarea>\n * ```\n *\n * @example Readonly\n * ```html\n * <nys-textarea label=\"Comments\" readonly value=\"You can see me but not edit me\"></nys-textarea>\n * ```\n *\n * @example Required\n * ```html\n * <nys-textarea label=\"Describe the incident\" required></nys-textarea>\n * ```\n *\n * @example Optional\n * ```html\n * <nys-textarea label=\"Comments\" optional></nys-textarea>\n * ```\n *\n * @example Max length\n * ```html\n * <nys-textarea label=\"Comments\" maxlength=\"100\"></nys-textarea>\n * ```\n *\n * @example Width Small\n * ```html\n * <nys-textarea label=\"Comments\" width=\"sm\"></nys-textarea>\n * ```\n *\n * @example Width Medium\n * ```html\n * <nys-textarea label=\"Comments\" width=\"md\"></nys-textarea>\n * ```\n *\n * @example Width Large\n * ```html\n * <nys-textarea label=\"Comments\" width=\"lg\"></nys-textarea>\n * ```\n *\n * @example Description\n * ```html\n * <nys-textarea label=\"Describe the incident\" description=\"Please provide details\"></nys-textarea>\n * ```\n *\n * @example Description Slot\n * ```html\n * <nys-textarea label=\"Describe the incident\">\n * <div slot=\"description\">Please provide details</div>\n * </nys-textarea>\n * ```\n */\n\nexport class NysTextarea extends NysFormControlElement {\n static styles = unsafeCSS(styles);\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /** Unique identifier. Auto-generated if not provided. */\n @property({ type: String, reflect: true }) id = \"\";\n\n /** Name for form submission. */\n @property({ type: String, reflect: true }) name = \"\";\n\n /** Visible label text. Required for accessibility. */\n @property({ type: String }) label = \"\";\n\n /** Helper text below label. Use slot for custom HTML. */\n @property({ type: String }) description = \"\";\n\n /** Placeholder text. Don't use as label replacement. */\n @property({ type: String }) placeholder = \"\";\n\n /** Current textarea value. */\n @property({ type: String }) value = \"\";\n\n /** Prevents interaction. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Makes textarea readonly but focusable. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Marks as required. Shows \"Required\" flag and validates on blur. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /** Shows \"Optional\" flag. Use when most fields are required. */\n @property({ type: Boolean, reflect: true }) optional = false;\n\n /** Tooltip text shown on hover/focus of info icon. */\n @property({ type: String }) tooltip = \"\";\n\n /** Adjusts colors for dark backgrounds. */\n @property({ type: Boolean, reflect: true }) inverted = false;\n\n /** Form `id` to associate with when textarea is outside form element. */\n @property({ type: String, reflect: true }) form: string | null = null;\n\n /** Maximum character length. */\n @property({ type: Number }) maxlength: number | null = null;\n\n /**\n * Textarea width: `sm` (88px), `md` (200px), `lg` (384px), `full` (100%, default).\n * @default \"full\"\n */\n @property({ type: String, reflect: true }) width:\n | \"sm\"\n | \"md\"\n | \"lg\"\n | \"full\" = \"full\";\n\n /**\n * Visible height in lines.\n * @default 4\n */\n @property({ type: Number }) rows = 4;\n\n /**\n * Resize behavior: `vertical` (default, user can resize height), `none` (fixed size).\n * @default \"vertical\"\n */\n @property({ type: String, reflect: true }) resize: \"vertical\" | \"none\" =\n \"vertical\";\n\n /** Shows error message when true. Set by validation or manually. */\n @property({ type: Boolean, reflect: true }) showError = false;\n\n /** Error message text. Shown only when `showError` is true. */\n @property({ type: String }) errorMessage = \"\";\n\n /** Accessible label used only when no visible `label` is provided. */\n @property({ type: String }) ariaLabel = \"\";\n\n private _hasUserInteracted = false; // need this flag for \"eager mode\"\n\n /**\n * Lifecycle methods\n * --------------------------------------------------------------------------\n * Form association, ElementInternals, and id generation are provided by\n * NysFormControlElement (@nysds/internals).\n */\n\n connectedCallback() {\n // super.connectedCallback() (NysFormControlElement) assigns an id when one\n // is not provided and reflects default semantics.\n super.connectedCallback();\n this.addEventListener(\"invalid\", this._handleInvalid);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener(\"invalid\", this._handleInvalid);\n }\n\n firstUpdated() {\n // This ensures our element always participates in the form\n this._setValue();\n }\n\n async updated(changedProperties: Map<string | number | symbol, unknown>) {\n await Promise.resolve();\n\n if (changedProperties.has(\"value\")) {\n this._setValue();\n }\n if (changedProperties.has(\"rows\")) {\n this.rows = this.rows ?? 4;\n }\n if (\n changedProperties.has(\"readonly\") ||\n changedProperties.has(\"required\")\n ) {\n const input = this.shadowRoot?.querySelector(\"textarea\");\n\n if (input) input.required = this.required && !this.readonly;\n }\n }\n\n /**\n * Form Integration\n * --------------------------------------------------------------------------\n */\n\n private _setValue() {\n this.setFormValue(this.value);\n this._manageRequire();\n }\n\n private _manageRequire() {\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n\n if (!textarea) return;\n\n const message = this.errorMessage || \"This field is required\";\n const isInvalid = this.required && !this.value;\n\n if (isInvalid) {\n this.setValidityFromState({ valueMissing: true }, message, textarea);\n } else {\n this.clearValidity();\n this._hasUserInteracted = false; // Reset lazy validation when valid\n }\n }\n\n private _setValidityMessage(message: string = \"\") {\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n if (!textarea) return;\n\n // Toggle the HTML <div> tag error message\n this.showError = !!message;\n // If user sets errorMessage, this will always override the native validation message\n if (this.errorMessage?.trim() && message !== \"\") {\n message = this.errorMessage;\n }\n\n if (message) {\n this.setValidityFromState({ customError: true }, message, textarea);\n } else {\n this.clearValidity();\n }\n }\n\n private _validate() {\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n if (!textarea) return;\n\n // Get the native validation state\n let message = textarea.validationMessage;\n\n this._setValidityMessage(message);\n }\n\n // This callback is automatically called when the parent form is reset.\n public formResetCallback() {\n this.value = \"\";\n\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n if (textarea) {\n textarea.value = \"\";\n textarea.setAttribute(\"aria-invalid\", \"false\");\n }\n\n // Reset validation UI\n this.showError = false;\n this.clearValidity();\n\n // Re-render UI\n this.requestUpdate();\n }\n\n /**\n * Functions\n * --------------------------------------------------------------------------\n */\n\n // This helper function is called to perform the element's native validation.\n checkValidity(): boolean {\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n return textarea ? textarea.checkValidity() : true;\n }\n\n private _handleInvalid(event: Event) {\n event.preventDefault();\n this._hasUserInteracted = true; // Start aggressive mode due to form submission\n this._validate();\n\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n if (textarea) {\n // Focus only if this is the first invalid element (top-down approach)\n const form = this.internals?.form;\n if (form) {\n const elements = Array.from(form.elements) as Array<\n HTMLElement & { checkValidity?: () => boolean }\n >;\n // Find the first element in the form that is invalid\n const firstInvalidElement = elements.find(\n (element) =>\n typeof element.checkValidity === \"function\" &&\n !element.checkValidity(),\n );\n if (firstInvalidElement === this) {\n textarea.focus();\n }\n } else {\n // If not part of a form, simply focus.\n textarea.focus();\n }\n }\n }\n\n /**\n * Event Handlers\n * --------------------------------------------------------------------------\n */\n\n // Handle input event to check pattern validity\n private _handleInput(event: Event) {\n const textarea = event.target as HTMLInputElement;\n this.value = textarea.value;\n this.setFormValue(this.value);\n\n // Field is invalid after unfocused, validate aggressively on each input (e.g. Eager mode: a combination of aggressive and lazy.)\n if (this._hasUserInteracted) {\n this._validate();\n }\n\n this.dispatchEvent(\n new CustomEvent(\"nys-input\", {\n detail: { id: this.id, value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n // Handle focus event\n private _handleFocus() {\n this.dispatchEvent(\n new Event(\"nys-focus\", { bubbles: true, composed: true }),\n );\n }\n\n // Handle blur event\n private _handleBlur() {\n if (!this._hasUserInteracted) {\n this._hasUserInteracted = true; // At initial unfocus: if textarea is invalid, start aggressive mode\n }\n\n this._validate();\n this.dispatchEvent(\n new Event(\"nys-blur\", { bubbles: true, composed: true }),\n );\n }\n\n private _handleSelect(e: Event) {\n const select = e.target as HTMLSelectElement;\n this.value = select.value;\n this.dispatchEvent(\n new CustomEvent(\"nys-select\", {\n detail: { id: this.id, value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _handleSelectionChange(e: Event) {\n const select = e.target as HTMLSelectElement;\n this.value = select.value;\n this.dispatchEvent(\n new CustomEvent(\"nys-selectionchange\", {\n detail: { id: this.id, value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n render() {\n return html`\n <div class=\"nys-textarea\">\n <nys-label\n id=\"${this.id}--label\"\n label=${this.label}\n description=${this.description}\n flag=${this.required && !this.readonly\n ? \"required\"\n : this.optional\n ? \"optional\"\n : \"\"}\n tooltip=${this.tooltip}\n ?inverted=${this.inverted}\n >\n <slot name=\"description\" slot=\"description\">${this.description}</slot>\n </nys-label>\n <textarea\n class=\"nys-textarea__textarea ${this.resize}\"\n name=${this.name}\n id=${this.id}\n .value=${this.value}\n ?disabled=${this.disabled}\n ?required=${this.required && !this.readonly}\n ?readonly=${this.readonly}\n aria-disabled=${ifDefined(this.disabled ? \"true\" : undefined)}\n aria-required=${ifDefined(this.required ? \"true\" : undefined)}\n aria-labelledby=${ifDefined(\n this.label ? this.id + \"--label\" : undefined,\n )}\n aria-label=${ifDefined(\n !this.label && this.ariaLabel ? this.ariaLabel : undefined,\n )}\n aria-description=${ifDefined(this.description || undefined)}\n aria-invalid=${this.showError ? \"true\" : \"false\"}\n aria-errormessage=${this.id + \"--error\"}\n aria-describedby=${ifDefined(\n this.showError ? this.id + \"--error\" : undefined,\n )}\n placeholder=${ifDefined(\n this.placeholder ? this.placeholder : undefined,\n )}\n maxlength=${ifDefined(this.maxlength ?? undefined)}\n .rows=${this.rows}\n form=${ifDefined(this.form || undefined)}\n @input=${this._handleInput}\n @focus=\"${this._handleFocus}\"\n @blur=\"${this._handleBlur}\"\n @select=\"${this._handleSelect}\"\n @selectionchange=\"${this._handleSelectionChange}\"\n ></textarea>\n <nys-errormessage\n id=${this.id + \"--error\"}\n ?showError=${this.showError}\n errorMessage=${this.internals!.validationMessage || this.errorMessage}\n ></nys-errormessage>\n </div>\n `;\n }\n}\n\nif (!customElements.get(\"nys-textarea\")) {\n customElements.define(\"nys-textarea\", NysTextarea);\n}\n"],"names":["LitElement","unsafeCSS","html","property","ifDefined","y","f","e","r","h","t","n","i","s","I","_r","l","w","u","_NysTextarea","NysFormControlElement","changedProperties","input","textarea","message","event","form","element","select","styles","NysTextarea","__decorateClass"],"mappings":"AACA,SAAA,cAAAA,GAAA,aAAAC,GAAA,QAAAC,SAAA;AAAA,SAAA,YAAAC,SAAA;AAAA,SAAA,aAAAC,SAAA;AAAA,OAAA;AAAA,OAAA;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,IAAIC,IAAI;AACR,SAASC,EAAEC,GAAG;AACZ,SAAO,GAAGA,CAAC,IAAI,KAAK,KAAK,IAAIF,GAAG;AAClC;AAgDG,IAAC,IAAI,CAACE,MAAM;AAAA,EACb,MAAMC,UAAUD,EAAE;AAAA,IAChB,IAAI,WAAW;AACb,aAAO,KAAK,aAAa;AAAA,IAC3B;A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,EAyCiC,WAAA,UAAA;AAGDC,EAAA;AAAA,EAA1C5B,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GA5C9B2B,EA4CgC,WAAA,MAAA;AAGfC,EAAA;AAAA,EAA3B5B,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA/Cf2B,EA+CiB,WAAA,WAAA;AAMeC,EAAA;AAAA,EAA1C5B,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GArD9B2B,EAqDgC,WAAA,OAAA;AAUfC,EAAA;AAAA,EAA3B5B,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA/Df2B,EA+DiB,WAAA,MAAA;AAMeC,EAAA;AAAA,EAA1C5B,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GArE9B2B,EAqEgC,WAAA,QAAA;AAICC,EAAA;AAAA,EAA3C5B,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAzE/B2B,EAyEiC,WAAA,WAAA;AAGhBC,EAAA;AAAA,EAA3B5B,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA5Ef2B,EA4EiB,WAAA,cAAA;AAGAC,EAAA;AAAA,EAA3B5B,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA/Ef2B,EA+EiB,WAAA,WAAA;AAgSzB,eAAe,IAAI,cAAc,KACpC,eAAe,OAAO,gBAAgBA,CAAW;"}
|
|
1
|
+
{"version":3,"file":"nys-textarea.js","sources":["../../internals/dist/index.js","../src/nys-textarea.ts"],"sourcesContent":["import { LitElement as u } from \"lit\";\n/*!\n * New York State Design System v1.22.0\n * Description: A design system for New York State's digital products.\n * Repository: https://github.com/its-hcd/nysds\n * License: MIT\n */\nlet y = 0;\nfunction f(e) {\n return `${e}-${Date.now()}-${y++}`;\n}\nfunction N(e, t, s) {\n e.dispatchEvent(\n new CustomEvent(t, { detail: s, bubbles: !0, composed: !0 })\n );\n}\nfunction I(e, t) {\n e.dispatchEvent(\n new Event(`nys-${t}`, { bubbles: !0, composed: !0 })\n );\n}\nconst p = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, g = {\n labelledby: \"ariaLabel\",\n describedby: \"ariaDescription\"\n};\nfunction _(e) {\n return \"ariaDescribedByElements\" in e;\n}\nfunction E(e) {\n return e === \"errormessage\" ? \"aria-errormessage\" : `aria-${e}`;\n}\nfunction d(e) {\n return e.filter((t) => !!t);\n}\nfunction A(e) {\n return e.map((t) => (t.id || (t.id = f(\"nys-ref\")), t.id));\n}\nfunction w(e, t, s) {\n const n = d(s), i = E(t);\n n.length ? e.setAttribute(i, A(n).join(\" \")) : e.removeAttribute(i);\n}\nfunction x(e, t, s, n, i) {\n const r = d(n), a = p[s], l = t;\n if (a && _(t)) {\n l[a] = r.length ? r : null;\n return;\n }\n const o = g[s];\n if (!o) return;\n const c = i ?? (r.length ? r.map((m) => m.textContent?.trim() ?? \"\").filter(Boolean).join(\" \") : \"\");\n o in l ? l[o] = c || null : c ? e.setAttribute(\n s === \"labelledby\" ? \"aria-label\" : \"aria-description\",\n c\n ) : e.removeAttribute(\n s === \"labelledby\" ? \"aria-label\" : \"aria-description\"\n );\n}\nconst R = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, V = {\n labelledby: \"aria-label\",\n describedby: \"aria-description\"\n};\nfunction L(e, t, s) {\n const n = d(s), i = R[t], r = V[t], a = e;\n if (i && i in e && (a[i] = n.length ? n : null), !r) return;\n const l = n.map((o) => o.textContent?.trim() ?? \"\").filter(Boolean).join(\" \");\n l ? e.setAttribute(r, l) : e.removeAttribute(r);\n}\nconst h = (e) => {\n class t extends e {\n get idPrefix() {\n return this.localName || \"nys-element\";\n }\n ensureId() {\n this.id || (this.id = f(this.idPrefix));\n }\n connectedCallback() {\n super.connectedCallback(), this.ensureId();\n }\n }\n return t;\n}, P = /* @__PURE__ */ h(u), b = (e) => {\n class t extends h(e) {\n constructor() {\n super(...arguments), this.__internals = null;\n }\n get internals() {\n if (this.__internals) return this.__internals;\n if (typeof this.attachInternals == \"function\")\n try {\n this.__internals = this.attachInternals();\n } catch {\n this.__internals = null;\n }\n return this.__internals;\n }\n get defaultRole() {\n return null;\n }\n setHostAria(n, i) {\n const r = this.internals;\n if (r && n in r) {\n r[n] = i;\n return;\n }\n const a = v(n);\n i === null ? this.removeAttribute(a) : this.setAttribute(a, i);\n }\n reflectDefaultSemantics() {\n const n = this.defaultRole;\n n && this.setHostAria(\"role\", n);\n }\n connectedCallback() {\n super.connectedCallback(), this.reflectDefaultSemantics();\n }\n }\n return t;\n};\nfunction v(e) {\n if (e === \"role\") return \"role\";\n const t = e.replace(/^aria/, \"\");\n return \"aria-\" + t.charAt(0).toLowerCase() + t.slice(1);\n}\nconst T = /* @__PURE__ */ b(u), C = (e) => {\n const s = class s extends b(e) {\n constructor() {\n super(...arguments), this.__internalValidationMessage = \"\";\n }\n get internalValidationMessage() {\n return this.__internalValidationMessage;\n }\n set internalValidationMessage(i) {\n i !== this.__internalValidationMessage && (this.__internalValidationMessage = i, this.requestUpdate(\"internalValidationMessage\"));\n }\n resolvedErrorMessage() {\n return this.errorMessage || this.internalValidationMessage;\n }\n setFormValue(i) {\n this.internals?.setFormValue(i ?? null);\n }\n setValidityFromState(i, r, a) {\n const l = this.internals;\n if (!l) return;\n const o = Object.values(i).some(Boolean);\n o ? l.setValidity(i, r ?? \"Invalid value\", a) : l.setValidity({}), this.setHostAria(\"ariaInvalid\", o ? \"true\" : \"false\");\n }\n clearValidity() {\n this.internals?.setValidity({}), this.setHostAria(\"ariaInvalid\", \"false\");\n }\n checkValidity() {\n return this.internals?.checkValidity() ?? !0;\n }\n reportValidity() {\n return this.internals?.reportValidity() ?? !0;\n }\n formResetCallback() {\n this.internalValidationMessage = \"\", this.clearValidity();\n }\n };\n s.formAssociated = !0;\n let t = s;\n return t;\n}, O = /* @__PURE__ */ C(u);\nfunction B(e) {\n const t = e.tagName.toLowerCase(), s = /* @__PURE__ */ new Set(), n = (i) => {\n i.querySelectorAll(\"*\").forEach((r) => {\n const a = r.tagName.toLowerCase();\n a.startsWith(\"nys-\") && a !== t && !customElements.get(a) && s.add(a), r.shadowRoot && n(r.shadowRoot);\n });\n };\n return e.shadowRoot && n(e.shadowRoot), n(e), [...s].sort();\n}\nexport {\n C as FormControlMixin,\n h as IdentifiedMixin,\n P as NysElement,\n O as NysFormControlElement,\n T as NysReflectsAriaElement,\n b as ReflectsAriaMixin,\n w as associateControl,\n L as associateControlRefs,\n x as associateHost,\n N as dispatchNysEvent,\n I as dispatchNysFocusBlur,\n B as findUnregisteredChildren,\n f as generateId,\n _ as supportsElementRefs\n};\n//# sourceMappingURL=index.js.map\n","import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport {\n NysFormControlElement,\n dispatchNysEvent,\n dispatchNysFocusBlur,\n} from \"@nysds/internals\";\n// These internal elements are rendered inside this component's shadow DOM, so\n// they must be registered whenever nys-textarea is used. Importing them here\n// (intentional side effect) guarantees the visible label and error message —\n// which the accessible name/error association depends on — always render.\nimport \"@nysds/nys-label\";\nimport \"@nysds/nys-errormessage\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-textarea.scss?inline\";\n\n/** Detail payload for the `nys-input` event. */\nexport interface NysTextareaInputDetail {\n id: string;\n name: string;\n value: string;\n}\n\n/** The `nys-input` event, fired on each keystroke. */\nexport type NysTextareaInputEvent = CustomEvent<NysTextareaInputDetail>;\n\n/** Detail payload for the `nys-change` event. */\nexport interface NysTextareaChangeDetail {\n id: string;\n name: string;\n value: string;\n}\n\n/** The `nys-change` event, fired when the value is committed. */\nexport type NysTextareaChangeEvent = CustomEvent<NysTextareaChangeDetail>;\n\n/** Detail payload for the `nys-select` event. */\nexport interface NysTextareaSelectDetail {\n id: string;\n value: string;\n}\n\n/** The `nys-select` event, fired when the user selects text. */\nexport type NysTextareaSelectEvent = CustomEvent<NysTextareaSelectDetail>;\n\n/** Detail payload for the `nys-selectionchange` event. */\nexport interface NysTextareaSelectionchangeDetail {\n id: string;\n value: string;\n}\n\n/** The `nys-selectionchange` event, fired when the text selection changes. */\nexport type NysTextareaSelectionchangeEvent =\n CustomEvent<NysTextareaSelectionchangeDetail>;\n\n/**\n * A multi-line text input for collecting longer responses like comments, descriptions, or feedback.\n * Form-associated with validation support via ElementInternals.\n *\n * Use for detailed responses needing multiple lines. For single-line input, use `nys-textinput`.\n * For predefined options, use `nys-select`, `nys-radiobutton`, or `nys-checkbox`.\n *\n * @summary Multi-line text input for comments, descriptions, and feedback.\n * @element nys-textarea\n *\n * @slot description - Custom HTML description content below the label.\n *\n * @formControl value nys-change nys-input\n *\n * @fires {NysTextareaInputEvent} nys-input - Fired on each input. Detail: `{id, name, value}`.\n * @fires {NysTextareaChangeEvent} nys-change - Fired when the value is committed (native `change`). Detail: `{id, name, value}`.\n * @fires {Event} nys-focus - Fired when the textarea gains focus.\n * @fires {Event} nys-blur - Fired when the textarea loses focus. Triggers validation.\n * @fires {NysTextareaSelectEvent} nys-select - Fired when the user selects text. Detail: `{id, value}`.\n * @fires {NysTextareaSelectionchangeEvent} nys-selectionchange - Fired when the text selection changes. Detail: `{id, value}`.\n *\n * @usagedos\n * - Use to collect multiple lines of open-ended text input (e.g., comments, descriptions, feedback).\n *\n * @usagedonts\n * - Use for short or single-line input. Use `<nys-textinput>` instead.\n * - Use when input should be selected from predefined options. Use `<nys-select>`, `<nys-radiobutton>`, or `<nys-checkbox>` instead.\n *\n * @example Basic\n * ```html\n * <nys-textarea label=\"Comments\"></nys-textarea>\n * ```\n *\n * @example Disabled\n * ```html\n * <nys-textarea label=\"Comments\" disabled></nys-textarea>\n * ```\n *\n * @example Readonly\n * ```html\n * <nys-textarea label=\"Comments\" readonly value=\"You can see me but not edit me\"></nys-textarea>\n * ```\n *\n * @example Required\n * ```html\n * <nys-textarea label=\"Describe the incident\" required></nys-textarea>\n * ```\n *\n * @example Optional\n * ```html\n * <nys-textarea label=\"Comments\" optional></nys-textarea>\n * ```\n *\n * @example Max length\n * ```html\n * <nys-textarea label=\"Comments\" maxlength=\"100\"></nys-textarea>\n * ```\n *\n * @example Width Small\n * ```html\n * <nys-textarea label=\"Comments\" width=\"sm\"></nys-textarea>\n * ```\n *\n * @example Width Medium\n * ```html\n * <nys-textarea label=\"Comments\" width=\"md\"></nys-textarea>\n * ```\n *\n * @example Width Large\n * ```html\n * <nys-textarea label=\"Comments\" width=\"lg\"></nys-textarea>\n * ```\n *\n * @example Description\n * ```html\n * <nys-textarea label=\"Describe the incident\" description=\"Please provide details\"></nys-textarea>\n * ```\n *\n * @example Description Slot\n * ```html\n * <nys-textarea label=\"Describe the incident\">\n * <div slot=\"description\">Please provide details</div>\n * </nys-textarea>\n * ```\n */\n\nexport class NysTextarea extends NysFormControlElement {\n static styles = unsafeCSS(styles);\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /** Unique identifier. Auto-generated if not provided. */\n @property({ type: String, reflect: true }) id = \"\";\n\n /** Name for form submission. */\n @property({ type: String, reflect: true }) name = \"\";\n\n /** Visible label text. Required for accessibility. */\n @property({ type: String }) label = \"\";\n\n /** Helper text below label. Use slot for custom HTML. */\n @property({ type: String }) description = \"\";\n\n /** Placeholder text. Don't use as label replacement. */\n @property({ type: String }) placeholder = \"\";\n\n /** Current textarea value. */\n @property({ type: String }) value = \"\";\n\n /** Prevents interaction. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Makes textarea readonly but focusable. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Marks as required. Shows \"Required\" flag and validates on blur. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /** Shows \"Optional\" flag. Use when most fields are required. */\n @property({ type: Boolean, reflect: true }) optional = false;\n\n /** Tooltip text shown on hover/focus of info icon. */\n @property({ type: String }) tooltip = \"\";\n\n /** Adjusts colors for dark backgrounds. */\n @property({ type: Boolean, reflect: true }) inverted = false;\n\n /** Form `id` to associate with when textarea is outside form element. */\n @property({ type: String, reflect: true }) form: string | null = null;\n\n /** Maximum character length. */\n @property({ type: Number }) maxlength: number | null = null;\n\n /**\n * Textarea width: `sm` (88px), `md` (200px), `lg` (384px), `full` (100%, default).\n * @default \"full\"\n */\n @property({ type: String, reflect: true }) width:\n | \"sm\"\n | \"md\"\n | \"lg\"\n | \"full\" = \"full\";\n\n /**\n * Visible height in lines.\n * @default 4\n */\n @property({ type: Number }) rows = 4;\n\n /**\n * Resize behavior: `vertical` (default, user can resize height), `none` (fixed size).\n * @default \"vertical\"\n */\n @property({ type: String, reflect: true }) resize: \"vertical\" | \"none\" =\n \"vertical\";\n\n /** Shows error message when true. Set by validation or manually. */\n @property({ type: Boolean, reflect: true }) showError = false;\n\n /** Error message text. Shown only when `showError` is true. */\n @property({ type: String }) errorMessage = \"\";\n\n /** Accessible label used only when no visible `label` is provided. */\n @property({ type: String }) ariaLabel = \"\";\n\n private _hasUserInteracted = false; // need this flag for \"eager mode\"\n\n /**\n * Lifecycle methods\n * --------------------------------------------------------------------------\n * Form association, ElementInternals, and id generation are provided by\n * NysFormControlElement (@nysds/internals).\n */\n\n connectedCallback() {\n // super.connectedCallback() (NysFormControlElement) assigns an id when one\n // is not provided and reflects default semantics.\n super.connectedCallback();\n this.addEventListener(\"invalid\", this._handleInvalid);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener(\"invalid\", this._handleInvalid);\n }\n\n firstUpdated() {\n // This ensures our element always participates in the form\n this._setValue();\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n if (changedProperties.has(\"rows\") && this.rows == null) {\n this.rows = 4;\n }\n }\n\n async updated(changedProperties: Map<string | number | symbol, unknown>) {\n await Promise.resolve();\n\n if (changedProperties.has(\"value\")) {\n this._setValue();\n }\n if (\n changedProperties.has(\"readonly\") ||\n changedProperties.has(\"required\")\n ) {\n const input = this.shadowRoot?.querySelector(\"textarea\");\n\n if (input) input.required = this.required && !this.readonly;\n\n // Re-sync ElementInternals, not just the shadow <textarea>: `required`\n // can arrive as a late property write (e.g. a framework wrapper\n // setting it post-hydration, after firstUpdated already ran\n // _setValue()/_manageRequire() once against the old value). Without\n // this, ElementInternals keeps reporting valid, the native `invalid`\n // event never fires on submit, and showError never flips even though\n // the field is genuinely required and empty.\n this._manageRequire();\n }\n }\n\n /**\n * Form Integration\n * --------------------------------------------------------------------------\n */\n\n private _setValue() {\n this.setFormValue(this.value);\n this._manageRequire();\n }\n\n private _manageRequire() {\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n\n if (!textarea) return;\n\n const isInvalid = this.required && !this.value;\n\n if (isInvalid) {\n this.internalValidationMessage = \"This field is required\";\n this.setValidityFromState(\n { valueMissing: true },\n this.resolvedErrorMessage(),\n textarea,\n );\n } else {\n this.internalValidationMessage = \"\";\n this.clearValidity();\n this._hasUserInteracted = false; // Reset lazy validation when valid\n }\n }\n\n private _setValidityMessage(message: string = \"\") {\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n if (!textarea) return;\n\n // Toggle the HTML <div> tag error message\n this.showError = !!message;\n // Store the component's own validation text; a consumer-supplied\n // errorMessage always wins via resolvedErrorMessage().\n this.internalValidationMessage = message;\n\n if (message) {\n this.setValidityFromState(\n { customError: true },\n this.resolvedErrorMessage(),\n textarea,\n );\n } else {\n this.clearValidity();\n }\n }\n\n private _validate() {\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n if (!textarea) return;\n\n // Get the native validation state\n let message = textarea.validationMessage;\n\n this._setValidityMessage(message);\n }\n\n // This callback is automatically called when the parent form is reset.\n public formResetCallback() {\n this.value = \"\";\n\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n if (textarea) {\n textarea.value = \"\";\n textarea.setAttribute(\"aria-invalid\", \"false\");\n }\n\n // Reset validation UI. Clears only the component's own validation text;\n // a consumer-supplied errorMessage is never touched.\n this.showError = false;\n this.internalValidationMessage = \"\";\n this.clearValidity();\n\n // Re-render UI\n this.requestUpdate();\n }\n\n /**\n * Functions\n * --------------------------------------------------------------------------\n */\n\n // This helper function is called to perform the element's native validation.\n checkValidity(): boolean {\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n return textarea ? textarea.checkValidity() : true;\n }\n\n private _handleInvalid(event: Event) {\n event.preventDefault();\n this._hasUserInteracted = true; // Start aggressive mode due to form submission\n this._validate();\n\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n if (textarea) {\n // Focus only if this is the first invalid element (top-down approach)\n const form = this.internals?.form;\n if (form) {\n const elements = Array.from(form.elements) as Array<\n HTMLElement & { checkValidity?: () => boolean }\n >;\n // Find the first element in the form that is invalid\n const firstInvalidElement = elements.find(\n (element) =>\n typeof element.checkValidity === \"function\" &&\n !element.checkValidity(),\n );\n if (firstInvalidElement === this) {\n textarea.focus();\n }\n } else {\n // If not part of a form, simply focus.\n textarea.focus();\n }\n }\n }\n\n /**\n * Event Handlers\n * --------------------------------------------------------------------------\n */\n\n // Handle input event to check pattern validity\n private _handleInput(event: Event) {\n const textarea = event.target as HTMLInputElement;\n this.value = textarea.value;\n this.setFormValue(this.value);\n\n // Field is invalid after unfocused, validate aggressively on each input (e.g. Eager mode: a combination of aggressive and lazy.)\n if (this._hasUserInteracted) {\n this._validate();\n }\n\n dispatchNysEvent<NysTextareaInputDetail>(this, \"nys-input\", {\n id: this.id,\n name: this.name,\n value: this.value,\n });\n }\n\n // Handle native change (value committed on blur after edits)\n private _handleChange(event: Event) {\n const textarea = event.target as HTMLTextAreaElement;\n this.value = textarea.value;\n dispatchNysEvent<NysTextareaChangeDetail>(this, \"nys-change\", {\n id: this.id,\n name: this.name,\n value: this.value,\n });\n }\n\n // Handle focus event\n private _handleFocus() {\n dispatchNysFocusBlur(this, \"focus\");\n }\n\n // Handle blur event\n private _handleBlur() {\n if (!this._hasUserInteracted) {\n this._hasUserInteracted = true; // At initial unfocus: if textarea is invalid, start aggressive mode\n }\n\n this._validate();\n dispatchNysFocusBlur(this, \"blur\");\n }\n\n private _handleSelect(e: Event) {\n const textarea = e.target as HTMLTextAreaElement;\n this.value = textarea.value;\n dispatchNysEvent<NysTextareaSelectDetail>(this, \"nys-select\", {\n id: this.id,\n value: this.value,\n });\n }\n\n private _handleSelectionChange(e: Event) {\n const textarea = e.target as HTMLTextAreaElement;\n this.value = textarea.value;\n dispatchNysEvent<NysTextareaSelectionchangeDetail>(\n this,\n \"nys-selectionchange\",\n {\n id: this.id,\n value: this.value,\n },\n );\n }\n\n render() {\n return html`\n <div class=\"nys-textarea\">\n <nys-label\n id=\"${this.id}--label\"\n label=${this.label}\n description=${this.description}\n flag=${this.required && !this.readonly\n ? \"required\"\n : this.optional\n ? \"optional\"\n : \"\"}\n tooltip=${this.tooltip}\n ?inverted=${this.inverted}\n >\n <slot name=\"description\" slot=\"description\">${this.description}</slot>\n </nys-label>\n <textarea\n class=\"nys-textarea__textarea ${this.resize}\"\n name=${this.name}\n id=${this.id}\n .value=${this.value}\n ?disabled=${this.disabled}\n ?required=${this.required && !this.readonly}\n ?readonly=${this.readonly}\n aria-disabled=${ifDefined(this.disabled ? \"true\" : undefined)}\n aria-required=${ifDefined(this.required ? \"true\" : undefined)}\n aria-labelledby=${ifDefined(\n this.label ? this.id + \"--label\" : undefined,\n )}\n aria-label=${ifDefined(\n !this.label && this.ariaLabel ? this.ariaLabel : undefined,\n )}\n aria-description=${ifDefined(this.description || undefined)}\n aria-invalid=${this.showError ? \"true\" : \"false\"}\n aria-errormessage=${this.id + \"--error\"}\n aria-describedby=${ifDefined(\n this.showError ? this.id + \"--error\" : undefined,\n )}\n placeholder=${ifDefined(\n this.placeholder ? this.placeholder : undefined,\n )}\n maxlength=${ifDefined(this.maxlength ?? undefined)}\n .rows=${this.rows}\n form=${ifDefined(this.form || undefined)}\n @input=${this._handleInput}\n @change=${this._handleChange}\n @focus=\"${this._handleFocus}\"\n @blur=\"${this._handleBlur}\"\n @select=\"${this._handleSelect}\"\n @selectionchange=\"${this._handleSelectionChange}\"\n ></textarea>\n <nys-errormessage\n id=${this.id + \"--error\"}\n ?showError=${this.showError}\n errorMessage=${this.resolvedErrorMessage()}\n ></nys-errormessage>\n </div>\n `;\n }\n}\n\nif (!customElements.get(\"nys-textarea\")) {\n customElements.define(\"nys-textarea\", NysTextarea);\n}\n"],"names":["LitElement","unsafeCSS","html","property","ifDefined","y","f","e","N","t","s","I","h","b","r","a","v","C","l","o","O","u","_NysTextarea","NysFormControlElement","changedProperties","input","textarea","message","event","form","element","dispatchNysEvent","dispatchNysFocusBlur","styles","NysTextarea","__decorateClass"],"mappings":"AACA,SAAA,cAAAA,GAAA,aAAAC,GAAA,QAAAC,SAAA;AAAA,SAAA,YAAAC,SAAA;AAAA,SAAA,aAAAC,SAAA;AAAA,OAAA;AAAA,OAAA;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,IAAIC,IAAI;AACR,SAASC,EAAEC,GAAG;AACZ,SAAO,GAAGA,CAAC,IAAI,KAAK,KAAK,IAAIF,GAAG;AAClC;AACA,SAASG,EAAED,GAAGE,GAAGC,GAAG;AAClB,EAAAH,EAAE;AAAA,IACA,IAAI,YAAYE,GAAG,EAAE,QAAQC,GAAG,SAAS,IAAI,UAAU,GAAE,CAAE;AAAA,EAC/D;AACA;AACA,SAASC,EAAEJ,GAAGE,GAAG;AACf,EAAAF,EAAE;AAAA,IACA,IAAI,MAAM,OAAOE,CAAC,IAAI,EAAE,SAAS,IAAI,UAAU,GAAE,CAAE;AAAA,EACvD;AACA;AAqDK,MAACG,IAAI,CAACL,MAAM;AAAA,EACf,MAAME,UAAUF,EAAE;AAAA,IAChB,IAAI,WAAW;AACb,aAAO,KAAK,aAAa;AAAA,IAC3B;AAAA,IACA,WAAW;AACT,WAAK,OAAO,KAAK,KAAKD,EAAE,KAAK,QAAQ;AAAA,IACvC;AAAA,IACA,oBAAoB;AAClB,YAAM,kBAAiB,GAAI,KAAK,SAAQ;AAAA,IAC1C;AAA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AS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAtCf+B,EAsCiB,WAAA,SAAA;AAGgBC,EAAA;AAAA,EAA3ChC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAzC/B+B,EAyCiC,WAAA,UAAA;AAGDC,EAAA;AAAA,EAA1ChC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GA5C9B+B,EA4CgC,WAAA,MAAA;AAGfC,EAAA;AAAA,EAA3BhC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA/Cf+B,EA+CiB,WAAA,WAAA;AAMeC,EAAA;AAAA,EAA1ChC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GArD9B+B,EAqDgC,WAAA,OAAA;AAUfC,EAAA;AAAA,EAA3BhC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA/Df+B,EA+DiB,WAAA,MAAA;AAMeC,EAAA;AAAA,EAA1ChC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GArE9B+B,EAqEgC,WAAA,QAAA;AAICC,EAAA;AAAA,EAA3ChC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAzE/B+B,EAyEiC,WAAA,WAAA;AAGhBC,EAAA;AAAA,EAA3BhC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA5Ef+B,EA4EiB,WAAA,cAAA;AAGAC,EAAA;AAAA,EAA3BhC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA/Ef+B,EA+EiB,WAAA,WAAA;AA0TzB,eAAe,IAAI,cAAc,KACpC,eAAe,OAAO,gBAAgBA,CAAW;"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nysds/nys-textarea",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"description": "The Textarea component from the NYS Design System.",
|
|
5
5
|
"module": "dist/nys-textarea.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"
|
|
10
|
-
"
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/nys-textarea.js"
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"lit-analyze": "lit-analyzer '**/*.ts'"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@nysds/nys-icon": "^1.
|
|
27
|
-
"@nysds/nys-label": "^1.
|
|
28
|
-
"@nysds/nys-errormessage": "^1.
|
|
26
|
+
"@nysds/nys-icon": "^1.22.0",
|
|
27
|
+
"@nysds/nys-label": "^1.22.0",
|
|
28
|
+
"@nysds/nys-errormessage": "^1.22.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@nysds/internals": "^1.
|
|
31
|
+
"@nysds/internals": "^1.22.0",
|
|
32
32
|
"lit": "^3.3.1",
|
|
33
33
|
"typescript": "^5.9.3",
|
|
34
34
|
"vite": "^7.3.1"
|