@nysds/nys-textarea 1.23.2 → 1.24.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.js +2 -2
- package/dist/nys-textarea.js.map +1 -1
- package/package.json +5 -5
package/dist/nys-textarea.js
CHANGED
|
@@ -8,13 +8,13 @@ import "@nysds/nys-errormessage";
|
|
|
8
8
|
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
9
9
|
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
10
10
|
*
|
|
11
|
-
* Textarea Component v1.
|
|
11
|
+
* Textarea Component v1.24.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.24.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
|
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.23.2\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 * @usage\n * - Use to collect multiple lines of open-ended text input (e.g., comments, descriptions, feedback).\n * - Don't use for short or single-line input. Use `<nys-textinput>` instead.\n * - Don't 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 // Derive the required message before rendering, not after, so the write\n // _manageRequire() makes from firstUpdated()/updated() is a no-op and Lit\n // doesn't schedule a second update (see lit.dev/msg/change-in-update).\n if (\n !this.hasUpdated ||\n changedProperties.has(\"value\") ||\n changedProperties.has(\"required\") ||\n changedProperties.has(\"readonly\")\n ) {\n this.internalValidationMessage =\n this.required && !this.value ? \"This field is required\" : \"\";\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;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,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.24.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 * @usage\n * - Use to collect multiple lines of open-ended text input (e.g., comments, descriptions, feedback).\n * - Don't use for short or single-line input. Use `<nys-textinput>` instead.\n * - Don't 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 // Derive the required message before rendering, not after, so the write\n // _manageRequire() makes from firstUpdated()/updated() is a no-op and Lit\n // doesn't schedule a second update (see lit.dev/msg/change-in-update).\n if (\n !this.hasUpdated ||\n changedProperties.has(\"value\") ||\n changedProperties.has(\"required\") ||\n changedProperties.has(\"readonly\")\n ) {\n this.internalValidationMessage =\n this.required && !this.value ? \"This field is required\" : \"\";\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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DgC,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;AAuUzB,eAAe,IAAI,cAAc,KACpC,eAAe,OAAO,gBAAgBA,CAAW;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nysds/nys-textarea",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.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",
|
|
@@ -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.24.0",
|
|
27
|
+
"@nysds/nys-label": "^1.24.0",
|
|
28
|
+
"@nysds/nys-errormessage": "^1.24.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@nysds/internals": "^1.
|
|
31
|
+
"@nysds/internals": "^1.24.0",
|
|
32
32
|
"lit": "^3.3.1",
|
|
33
33
|
"typescript": "^5.9.3",
|
|
34
34
|
"vite": "^7.3.1"
|