@carbon/web-components 2.60.0 → 2.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/custom-elements.json +1401 -361
  2. package/es/components/breadcrumb/breadcrumb.scss.js +1 -1
  3. package/es/components/breadcrumb/breadcrumb.scss.js.map +1 -1
  4. package/es/components/date-picker/date-picker-input.d.ts +13 -1
  5. package/es/components/date-picker/date-picker-input.d.ts.map +1 -1
  6. package/es/components/date-picker/date-picker-input.js +36 -16
  7. package/es/components/date-picker/date-picker-input.js.map +1 -1
  8. package/es/components/date-picker/date-picker.d.ts +6 -0
  9. package/es/components/date-picker/date-picker.d.ts.map +1 -1
  10. package/es/components/date-picker/date-picker.js +10 -2
  11. package/es/components/date-picker/date-picker.js.map +1 -1
  12. package/es/components/date-picker/date-picker.scss.js +1 -1
  13. package/es/components/date-picker/date-picker.scss.js.map +1 -1
  14. package/es/components/date-picker/defs.d.ts +18 -1
  15. package/es/components/date-picker/defs.d.ts.map +1 -1
  16. package/es/components/date-picker/defs.js +19 -1
  17. package/es/components/date-picker/defs.js.map +1 -1
  18. package/es/components/date-picker/next/adapters/web-component-adapter.d.ts +143 -0
  19. package/es/components/date-picker/next/adapters/web-component-adapter.d.ts.map +1 -0
  20. package/es/components/date-picker/next/adapters/web-component-adapter.js +215 -0
  21. package/es/components/date-picker/next/adapters/web-component-adapter.js.map +1 -0
  22. package/es/components/date-picker/next/components/calendar-renderer.d.ts +136 -0
  23. package/es/components/date-picker/next/components/calendar-renderer.d.ts.map +1 -0
  24. package/es/components/date-picker/next/components/calendar-renderer.js +278 -0
  25. package/es/components/date-picker/next/components/calendar-renderer.js.map +1 -0
  26. package/es/components/date-picker/next/components/date-picker-input-skeleton.d.ts +35 -0
  27. package/es/components/date-picker/next/components/date-picker-input-skeleton.d.ts.map +1 -0
  28. package/es/components/date-picker/next/components/date-picker-input-skeleton.js +73 -0
  29. package/es/components/date-picker/next/components/date-picker-input-skeleton.js.map +1 -0
  30. package/es/components/date-picker/next/components/date-picker-input.d.ts +196 -0
  31. package/es/components/date-picker/next/components/date-picker-input.d.ts.map +1 -0
  32. package/es/components/date-picker/next/components/date-picker-input.js +334 -0
  33. package/es/components/date-picker/next/components/date-picker-input.js.map +1 -0
  34. package/es/components/date-picker/next/components/date-picker.d.ts +329 -0
  35. package/es/components/date-picker/next/components/date-picker.d.ts.map +1 -0
  36. package/es/components/date-picker/next/components/date-picker.js +621 -0
  37. package/es/components/date-picker/next/components/date-picker.js.map +1 -0
  38. package/es/components/date-picker/next/components/date-picker.scss.js +14 -0
  39. package/es/components/date-picker/next/components/date-picker.scss.js.map +1 -0
  40. package/es/components/date-picker/next/index.d.ts +11 -0
  41. package/es/components/date-picker/next/index.d.ts.map +1 -0
  42. package/es/components/date-picker/next/index.js +11 -0
  43. package/es/components/dropdown/dropdown.d.ts +8 -0
  44. package/es/components/dropdown/dropdown.d.ts.map +1 -1
  45. package/es/components/dropdown/dropdown.js +4 -2
  46. package/es/components/dropdown/dropdown.js.map +1 -1
  47. package/es/components/fluid-date-picker/fluid-date-picker-input.d.ts +39 -0
  48. package/es/components/fluid-date-picker/fluid-date-picker-input.d.ts.map +1 -0
  49. package/es/components/fluid-date-picker/fluid-date-picker-input.js +59 -0
  50. package/es/components/fluid-date-picker/fluid-date-picker-input.js.map +1 -0
  51. package/es/components/fluid-date-picker/fluid-date-picker-skeleton.d.ts +20 -0
  52. package/es/components/fluid-date-picker/fluid-date-picker-skeleton.d.ts.map +1 -0
  53. package/es/components/fluid-date-picker/fluid-date-picker-skeleton.js +74 -0
  54. package/es/components/fluid-date-picker/fluid-date-picker-skeleton.js.map +1 -0
  55. package/es/components/fluid-date-picker/fluid-date-picker.d.ts +24 -0
  56. package/es/components/fluid-date-picker/fluid-date-picker.d.ts.map +1 -0
  57. package/es/components/fluid-date-picker/fluid-date-picker.js +51 -0
  58. package/es/components/fluid-date-picker/fluid-date-picker.js.map +1 -0
  59. package/es/components/fluid-date-picker/fluid-date-picker.scss.js +14 -0
  60. package/es/components/fluid-date-picker/fluid-date-picker.scss.js.map +1 -0
  61. package/es/components/fluid-date-picker/index.d.ts +10 -0
  62. package/es/components/fluid-date-picker/index.d.ts.map +1 -0
  63. package/es/components/fluid-date-picker/index.js +10 -0
  64. package/es/components/pagination/pagination.scss.js +1 -1
  65. package/es/components/password-input/password-input.d.ts.map +1 -1
  66. package/es/components/password-input/password-input.js +3 -2
  67. package/es/components/password-input/password-input.js.map +1 -1
  68. package/es/components/radio-button/radio-button.js +1 -1
  69. package/es/components/radio-button/radio-button.js.map +1 -1
  70. package/es/components/select/select.d.ts +8 -0
  71. package/es/components/select/select.d.ts.map +1 -1
  72. package/es/components/select/select.js +4 -2
  73. package/es/components/select/select.js.map +1 -1
  74. package/es/components/skip-to-content/skip-to-content.scss.js +1 -1
  75. package/es/components/text-input/text-input.d.ts +17 -0
  76. package/es/components/text-input/text-input.d.ts.map +1 -1
  77. package/es/components/text-input/text-input.js +28 -6
  78. package/es/components/text-input/text-input.js.map +1 -1
  79. package/es/components/textarea/textarea.d.ts.map +1 -1
  80. package/es/components/textarea/textarea.js +2 -1
  81. package/es/components/textarea/textarea.js.map +1 -1
  82. package/es/components/ui-shell/header.scss.js +1 -1
  83. package/es/components/ui-shell/header.scss.js.map +1 -1
  84. package/es/index.js +1 -1
  85. package/es-custom/components/breadcrumb/breadcrumb.scss.js +1 -1
  86. package/es-custom/components/breadcrumb/breadcrumb.scss.js.map +1 -1
  87. package/es-custom/components/date-picker/date-picker-input.d.ts +13 -1
  88. package/es-custom/components/date-picker/date-picker-input.d.ts.map +1 -1
  89. package/es-custom/components/date-picker/date-picker-input.js +36 -16
  90. package/es-custom/components/date-picker/date-picker-input.js.map +1 -1
  91. package/es-custom/components/date-picker/date-picker.d.ts +6 -0
  92. package/es-custom/components/date-picker/date-picker.d.ts.map +1 -1
  93. package/es-custom/components/date-picker/date-picker.js +10 -2
  94. package/es-custom/components/date-picker/date-picker.js.map +1 -1
  95. package/es-custom/components/date-picker/date-picker.scss.js +1 -1
  96. package/es-custom/components/date-picker/date-picker.scss.js.map +1 -1
  97. package/es-custom/components/date-picker/defs.d.ts +18 -1
  98. package/es-custom/components/date-picker/defs.d.ts.map +1 -1
  99. package/es-custom/components/date-picker/defs.js +19 -1
  100. package/es-custom/components/date-picker/defs.js.map +1 -1
  101. package/es-custom/components/date-picker/next/adapters/web-component-adapter.d.ts +143 -0
  102. package/es-custom/components/date-picker/next/adapters/web-component-adapter.d.ts.map +1 -0
  103. package/es-custom/components/date-picker/next/adapters/web-component-adapter.js +215 -0
  104. package/es-custom/components/date-picker/next/adapters/web-component-adapter.js.map +1 -0
  105. package/es-custom/components/date-picker/next/components/calendar-renderer.d.ts +136 -0
  106. package/es-custom/components/date-picker/next/components/calendar-renderer.d.ts.map +1 -0
  107. package/es-custom/components/date-picker/next/components/calendar-renderer.js +278 -0
  108. package/es-custom/components/date-picker/next/components/calendar-renderer.js.map +1 -0
  109. package/es-custom/components/date-picker/next/components/date-picker-input-skeleton.d.ts +35 -0
  110. package/es-custom/components/date-picker/next/components/date-picker-input-skeleton.d.ts.map +1 -0
  111. package/es-custom/components/date-picker/next/components/date-picker-input-skeleton.js +73 -0
  112. package/es-custom/components/date-picker/next/components/date-picker-input-skeleton.js.map +1 -0
  113. package/es-custom/components/date-picker/next/components/date-picker-input.d.ts +196 -0
  114. package/es-custom/components/date-picker/next/components/date-picker-input.d.ts.map +1 -0
  115. package/es-custom/components/date-picker/next/components/date-picker-input.js +334 -0
  116. package/es-custom/components/date-picker/next/components/date-picker-input.js.map +1 -0
  117. package/es-custom/components/date-picker/next/components/date-picker.d.ts +329 -0
  118. package/es-custom/components/date-picker/next/components/date-picker.d.ts.map +1 -0
  119. package/es-custom/components/date-picker/next/components/date-picker.js +621 -0
  120. package/es-custom/components/date-picker/next/components/date-picker.js.map +1 -0
  121. package/es-custom/components/date-picker/next/components/date-picker.scss.js +14 -0
  122. package/es-custom/components/date-picker/next/components/date-picker.scss.js.map +1 -0
  123. package/es-custom/components/date-picker/next/index.d.ts +11 -0
  124. package/es-custom/components/date-picker/next/index.d.ts.map +1 -0
  125. package/es-custom/components/date-picker/next/index.js +11 -0
  126. package/es-custom/components/dropdown/dropdown.d.ts +8 -0
  127. package/es-custom/components/dropdown/dropdown.d.ts.map +1 -1
  128. package/es-custom/components/dropdown/dropdown.js +4 -2
  129. package/es-custom/components/dropdown/dropdown.js.map +1 -1
  130. package/es-custom/components/fluid-date-picker/fluid-date-picker-input.d.ts +39 -0
  131. package/es-custom/components/fluid-date-picker/fluid-date-picker-input.d.ts.map +1 -0
  132. package/es-custom/components/fluid-date-picker/fluid-date-picker-input.js +59 -0
  133. package/es-custom/components/fluid-date-picker/fluid-date-picker-input.js.map +1 -0
  134. package/es-custom/components/fluid-date-picker/fluid-date-picker-skeleton.d.ts +20 -0
  135. package/es-custom/components/fluid-date-picker/fluid-date-picker-skeleton.d.ts.map +1 -0
  136. package/es-custom/components/fluid-date-picker/fluid-date-picker-skeleton.js +74 -0
  137. package/es-custom/components/fluid-date-picker/fluid-date-picker-skeleton.js.map +1 -0
  138. package/es-custom/components/fluid-date-picker/fluid-date-picker.d.ts +24 -0
  139. package/es-custom/components/fluid-date-picker/fluid-date-picker.d.ts.map +1 -0
  140. package/es-custom/components/fluid-date-picker/fluid-date-picker.js +51 -0
  141. package/es-custom/components/fluid-date-picker/fluid-date-picker.js.map +1 -0
  142. package/es-custom/components/fluid-date-picker/fluid-date-picker.scss.js +14 -0
  143. package/es-custom/components/fluid-date-picker/fluid-date-picker.scss.js.map +1 -0
  144. package/es-custom/components/fluid-date-picker/index.d.ts +10 -0
  145. package/es-custom/components/fluid-date-picker/index.d.ts.map +1 -0
  146. package/es-custom/components/fluid-date-picker/index.js +10 -0
  147. package/es-custom/components/pagination/pagination.scss.js +1 -1
  148. package/es-custom/components/password-input/password-input.d.ts.map +1 -1
  149. package/es-custom/components/password-input/password-input.js +3 -2
  150. package/es-custom/components/password-input/password-input.js.map +1 -1
  151. package/es-custom/components/radio-button/radio-button.js +1 -1
  152. package/es-custom/components/radio-button/radio-button.js.map +1 -1
  153. package/es-custom/components/select/select.d.ts +8 -0
  154. package/es-custom/components/select/select.d.ts.map +1 -1
  155. package/es-custom/components/select/select.js +4 -2
  156. package/es-custom/components/select/select.js.map +1 -1
  157. package/es-custom/components/skip-to-content/skip-to-content.scss.js +1 -1
  158. package/es-custom/components/text-input/text-input.d.ts +17 -0
  159. package/es-custom/components/text-input/text-input.d.ts.map +1 -1
  160. package/es-custom/components/text-input/text-input.js +28 -6
  161. package/es-custom/components/text-input/text-input.js.map +1 -1
  162. package/es-custom/components/textarea/textarea.d.ts.map +1 -1
  163. package/es-custom/components/textarea/textarea.js +2 -1
  164. package/es-custom/components/textarea/textarea.js.map +1 -1
  165. package/es-custom/components/ui-shell/header.scss.js +1 -1
  166. package/es-custom/components/ui-shell/header.scss.js.map +1 -1
  167. package/es-custom/index.js +1 -1
  168. package/lib/components/date-picker/date-picker-input.d.ts +13 -1
  169. package/lib/components/date-picker/date-picker-input.d.ts.map +1 -1
  170. package/lib/components/date-picker/date-picker.d.ts +6 -0
  171. package/lib/components/date-picker/date-picker.d.ts.map +1 -1
  172. package/lib/components/date-picker/defs.d.ts +18 -1
  173. package/lib/components/date-picker/defs.d.ts.map +1 -1
  174. package/lib/components/date-picker/defs.js +19 -0
  175. package/lib/components/date-picker/defs.js.map +1 -1
  176. package/lib/components/date-picker/next/adapters/web-component-adapter.d.ts +143 -0
  177. package/lib/components/date-picker/next/adapters/web-component-adapter.d.ts.map +1 -0
  178. package/lib/components/date-picker/next/components/calendar-renderer.d.ts +136 -0
  179. package/lib/components/date-picker/next/components/calendar-renderer.d.ts.map +1 -0
  180. package/lib/components/date-picker/next/components/date-picker-input-skeleton.d.ts +35 -0
  181. package/lib/components/date-picker/next/components/date-picker-input-skeleton.d.ts.map +1 -0
  182. package/lib/components/date-picker/next/components/date-picker-input.d.ts +196 -0
  183. package/lib/components/date-picker/next/components/date-picker-input.d.ts.map +1 -0
  184. package/lib/components/date-picker/next/components/date-picker.d.ts +329 -0
  185. package/lib/components/date-picker/next/components/date-picker.d.ts.map +1 -0
  186. package/lib/components/date-picker/next/index.d.ts +11 -0
  187. package/lib/components/date-picker/next/index.d.ts.map +1 -0
  188. package/lib/components/dropdown/dropdown.d.ts +8 -0
  189. package/lib/components/dropdown/dropdown.d.ts.map +1 -1
  190. package/lib/components/fluid-date-picker/fluid-date-picker-input.d.ts +39 -0
  191. package/lib/components/fluid-date-picker/fluid-date-picker-input.d.ts.map +1 -0
  192. package/lib/components/fluid-date-picker/fluid-date-picker-skeleton.d.ts +20 -0
  193. package/lib/components/fluid-date-picker/fluid-date-picker-skeleton.d.ts.map +1 -0
  194. package/lib/components/fluid-date-picker/fluid-date-picker.d.ts +24 -0
  195. package/lib/components/fluid-date-picker/fluid-date-picker.d.ts.map +1 -0
  196. package/lib/components/fluid-date-picker/index.d.ts +10 -0
  197. package/lib/components/fluid-date-picker/index.d.ts.map +1 -0
  198. package/lib/components/password-input/password-input.d.ts.map +1 -1
  199. package/lib/components/select/select.d.ts +8 -0
  200. package/lib/components/select/select.d.ts.map +1 -1
  201. package/lib/components/text-input/text-input.d.ts +17 -0
  202. package/lib/components/text-input/text-input.d.ts.map +1 -1
  203. package/lib/components/textarea/textarea.d.ts.map +1 -1
  204. package/package.json +10 -10
  205. package/scss/components/breadcrumb/breadcrumb.scss +4 -2
  206. package/scss/components/date-picker/date-picker.scss +6 -0
  207. package/scss/components/date-picker/next/components/date-picker.scss +124 -0
  208. package/scss/components/fluid-date-picker/fluid-date-picker.scss +282 -0
  209. package/scss/components/ui-shell/header.scss +14 -8
  210. package/telemetry.yml +29 -11
@@ -1 +1 @@
1
- {"version":3,"file":"text-input.js","names":["ifNonEmpty","styles","customElement"],"sources":["../../../src/components/text-input/text-input.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { prefix } from '../../globals/settings';\nimport { iconLoader } from '../../globals/internal/icon-loader';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport WarningFilled16 from '@carbon/icons/es/warning--filled/16.js';\nimport WarningAltFilled16 from '@carbon/icons/es/warning--alt--filled/16.js';\nimport View16 from '@carbon/icons/es/view/16.js';\nimport ViewOff16 from '@carbon/icons/es/view--off/16.js';\nimport FormMixin from '../../globals/mixins/form';\nimport ValidityMixin from '../../globals/mixins/validity';\nimport {\n INPUT_COLOR_SCHEME,\n INPUT_SIZE,\n INPUT_TOOLTIP_ALIGNMENT,\n INPUT_TOOLTIP_DIRECTION,\n INPUT_TYPE,\n} from './defs';\nimport styles from './text-input.scss?lit';\n\nexport {\n INPUT_COLOR_SCHEME,\n INPUT_SIZE,\n INPUT_TOOLTIP_ALIGNMENT,\n INPUT_TOOLTIP_DIRECTION,\n INPUT_TYPE,\n};\n\n/**\n * Text Input element. Supports all the usual attributes for textual input types\n *\n * @element cds-custom-text-input\n * @slot helper-text - The helper text.\n * @slot label-text - The label text.\n * @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n@customElement(`${prefix}-text-input`)\nclass CDSTextInput extends ValidityMixin(FormMixin(LitElement)) {\n /**\n * `true` if there is an AI Label.\n */\n protected _hasAILabel = false;\n\n /**\n * Handles `slotchange` event.\n */\n protected _handleSlotChange({ target }: Event) {\n const hasContent = (target as HTMLSlotElement)\n .assignedNodes()\n .filter((elem) =>\n (elem as HTMLElement).matches !== undefined\n ? (elem as HTMLElement).matches(\n (this.constructor as typeof CDSTextInput).aiLabelItem\n ) ||\n // remove reference to slug in v12\n (elem as HTMLElement).matches(\n (this.constructor as typeof CDSTextInput).slugItem\n )\n : false\n );\n\n this._hasAILabel = Boolean(hasContent);\n (hasContent[0] as HTMLElement).setAttribute('size', 'mini');\n this.requestUpdate();\n }\n /**\n * The underlying input element\n */\n @query('input')\n protected _input!: HTMLInputElement;\n\n @query('slot[name=\"helper-text\"]')\n protected _slotHelperTextNode!: HTMLSlotElement;\n\n /**\n * The internal value.\n */\n protected _value = '';\n\n /**\n * Handles `oninput` event on the `input`.\n *\n * @param event The event.\n * @param event.target The event target.\n */\n protected _handleInput({ target }: Event) {\n this.value = (target as HTMLInputElement).value;\n }\n\n _handleFormdata(event: FormDataEvent) {\n const { formData } = event;\n const { disabled, name, value } = this;\n if (!disabled) {\n formData.append(name, value);\n }\n }\n\n protected _handleHelperTextSlotChange() {\n this.requestUpdate();\n }\n\n /**\n * May be any of the standard HTML autocomplete options\n */\n @property()\n autocomplete = '';\n\n /**\n * Sets the input to be focussed automatically on page load. Defaults to false\n */\n @property({ type: Boolean })\n autofocus = false;\n\n /**\n * Controls the disabled state of the input\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Specify whether to display the character counter\n */\n @property({ type: Boolean, attribute: 'enable-counter', reflect: true })\n enableCounter = false;\n\n /**\n * The helper text.\n */\n @property({ attribute: 'helper-text' })\n helperText = '';\n\n /**\n * Specify if the currently value is invalid.\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * Message which is displayed if the value is invalid.\n */\n @property({ attribute: 'invalid-text' })\n invalidText = '';\n\n /**\n * Max character count allowed for input. This is needed in order for enableCounter to display\n */\n @property({ type: Number, attribute: 'max-count', reflect: true })\n maxCount;\n\n /**\n * Specify whether the control is currently in warning state\n */\n @property({ type: Boolean, reflect: true })\n warn = false;\n\n /**\n * Provide the text that is displayed when the control is in warning state\n */\n @property({ attribute: 'warn-text' })\n warnText = '';\n\n /**\n * Specify whether you want the underlying label to be visually hidden\n */\n @property({ attribute: 'hide-label', type: Boolean, reflect: true })\n hideLabel = false;\n\n /**\n * Generic label that will be used as the textual representation of what this field is for\n */\n @property({ attribute: 'label' })\n label = '';\n\n /**\n * Name for the input in the `FormData`\n */\n @property()\n name = '';\n\n /**\n * Pattern to validate the input against for HTML validity checking\n */\n @property()\n pattern = '';\n\n /**\n * Value to display when the input has an empty `value`\n */\n @property({ reflect: true })\n placeholder = '';\n\n /**\n * Specify if the component should be read-only\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n /**\n * Boolean property to set the required status\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * The special validity message for `required`.\n */\n @property({ attribute: 'required-validity-message' })\n requiredValidityMessage = 'Please fill out this field.';\n\n /**\n * \"Hide password\" tooltip text on password visibility toggle\n *\n * @deprecated will be removed in the next major version, use `cds-custom-password-input` instead\n */\n @property()\n hidePasswordLabel = 'Hide password';\n\n /**\n * \"Show password\" tooltip text on password visibility toggle\n *\n * @deprecated will be removed in the next major version, use `cds-custom-password-input` instead\n */\n @property()\n showPasswordLabel = 'Show password';\n\n /**\n * Boolean property to render password visibility toggle\n *\n * @deprecated will be removed in the next major version, use `cds-custom-password-input` instead\n */\n @property({\n type: Boolean,\n attribute: 'show-password-visibility-toggle',\n reflect: true,\n })\n showPasswordVisibilityToggle = false;\n\n /**\n * The input box size.\n */\n @property({ reflect: true })\n size?: INPUT_SIZE;\n\n @property({ type: Boolean })\n isFluid = false;\n\n /**\n * true to use the inline version.\n */\n @property({ type: Boolean, reflect: true })\n inline = false;\n\n /**\n * Specify the alignment of the tooltip to the icon-only button.\n * Can be one of: start, center, or end.\n */\n @property()\n tooltipAlignment = INPUT_TOOLTIP_ALIGNMENT.CENTER;\n\n /**\n * Specify the direction of the tooltip for icon-only buttons.\n * Can be either top, right, bottom, or left.\n */\n @property()\n tooltipDirection = INPUT_TOOLTIP_DIRECTION.BOTTOM;\n\n /**\n * The type of the input. Can be one of the types listed in the INPUT_TYPE enum\n */\n @property({ reflect: true })\n type = INPUT_TYPE.TEXT;\n\n /**\n * The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n @property({ attribute: 'validity-message' })\n validityMessage = '';\n\n /**\n * The value of the input.\n */\n @property({ reflect: true })\n get value() {\n // FIXME: Figure out how to deal with TS2611\n // once we have the input we can directly query for the value\n if (this._input) {\n return this._input.value;\n }\n // but before then _value will work fine\n return this._value;\n }\n\n set value(value) {\n const oldValue = this._value;\n this._value = value;\n // make sure that lit-element updates the right properties\n this.requestUpdate('value', oldValue);\n // we set the value directly on the input (when available)\n // so that programatic manipulation updates the UI correctly\n if (this._input) {\n this._input.value = value;\n }\n }\n\n /**\n * Handles password visibility toggle button click\n *\n * @deprecated will be removed in the next major version, use `cds-custom-password-input` instead\n */\n private togglePasswordVisibility() {\n this.type =\n this.type === INPUT_TYPE.PASSWORD ? INPUT_TYPE.TEXT : INPUT_TYPE.PASSWORD;\n }\n\n render() {\n const {\n disabled,\n enableCounter,\n helperText,\n hideLabel,\n inline,\n isFluid,\n invalid,\n invalidText,\n label,\n maxCount,\n readonly,\n required,\n size,\n type,\n warn,\n warnText,\n value,\n _handleInput: handleInput,\n _hasAILabel: hasAILabel,\n _handleSlotChange: handleSlotChange,\n } = this;\n\n const invalidIcon = iconLoader(WarningFilled16, {\n class: `${prefix}--text-input__invalid-icon`,\n });\n\n const warnIcon = iconLoader(WarningAltFilled16, {\n class: `${prefix}--text-input__invalid-icon ${prefix}--text-input__invalid-icon--warning`,\n });\n\n const normalizedProps: {\n disabled: boolean;\n invalid: boolean;\n warn: boolean;\n 'slot-name': string;\n 'slot-text': string;\n icon: ReturnType<typeof iconLoader>;\n } = {\n disabled: !readonly && disabled,\n invalid: !readonly && invalid,\n warn: !readonly && !invalid && warn,\n 'slot-name': '',\n 'slot-text': '',\n icon: null,\n };\n\n if (normalizedProps.invalid) {\n normalizedProps.icon = invalidIcon;\n normalizedProps['slot-name'] = 'invalid-text';\n normalizedProps['slot-text'] = invalidText;\n } else if (normalizedProps.warn) {\n normalizedProps.icon = warnIcon;\n normalizedProps['slot-name'] = 'warn-text';\n normalizedProps['slot-text'] = warnText;\n }\n\n const counterClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--text-input__label-counter`]: true,\n [`${prefix}--label--disabled`]: disabled,\n });\n\n const inputWrapperClasses = classMap({\n [`${prefix}--form-item`]: true,\n [`${prefix}--text-input-wrapper`]: true,\n [`${prefix}--text-input-wrapper--inline`]: inline,\n [`${prefix}--text-input-wrapper--readonly`]: readonly,\n [`${prefix}--text-input-wrapper--inline--invalid`]:\n inline && normalizedProps.invalid,\n });\n\n const inputClasses = classMap({\n [`${prefix}--text-input`]: true,\n [`${prefix}--text-input--invalid`]: normalizedProps.invalid,\n [`${prefix}--text-input--warning`]: normalizedProps.warn,\n [`${prefix}--text-input--${size}`]: size !== undefined, // TODO V12 - remove this class\n [`${prefix}--layout--size-${size}`]: size !== undefined,\n [`${prefix}--password-input`]: type === INPUT_TYPE.PASSWORD, // TODO: deprecated, remove in v12\n });\n\n const fieldOuterWrapperClasses = classMap({\n [`${prefix}--text-input__field-outer-wrapper`]: true,\n [`${prefix}--text-input__field-outer-wrapper--inline`]: inline,\n });\n\n const fieldWrapperClasses = classMap({\n [`${prefix}--text-input__field-wrapper`]: true,\n [`${prefix}--text-input__field-wrapper--warning`]: normalizedProps.warn,\n [`${prefix}--text-input__field-wrapper--decorator`]: hasAILabel,\n });\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--visually-hidden`]: hideLabel,\n [`${prefix}--label--disabled`]: normalizedProps.disabled,\n [`${prefix}--label--inline`]: inline,\n });\n\n const helperTextClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: normalizedProps.disabled,\n [`${prefix}--form__helper-text--inline`]: inline,\n });\n\n // TODO: deprecated, remove in v12\n const passwordIsVisible = type !== INPUT_TYPE.PASSWORD;\n const passwordVisibilityIcon = passwordIsVisible\n ? iconLoader(ViewOff16, { class: `${prefix}--icon-visibility-off` })\n : iconLoader(View16, { class: `${prefix}--icon-visibility-on` });\n\n // TODO: deprecated, remove in v12\n const passwordVisibilityToggleClasses = classMap({\n [`${prefix}--text-input--password__visibility__toggle`]: true,\n [`${prefix}--btn`]: true,\n [`${prefix}--btn--icon-only`]: true,\n [`${prefix}--tooltip__trigger`]: true,\n [`${prefix}--tooltip--a11y`]: true,\n [`${prefix}--btn--disabled`]: normalizedProps.disabled,\n [`${prefix}--tooltip--${this.tooltipDirection}`]: this.tooltipDirection,\n [`${prefix}--tooltip--align-${this.tooltipAlignment}`]:\n this.tooltipAlignment,\n });\n\n // TODO: deprecated, remove in v12\n const passwordButtonLabel = html`\n <span class=\"${prefix}--assistive-text\">\n ${passwordIsVisible ? this.hidePasswordLabel : this.showPasswordLabel}\n </span>\n `;\n\n // TODO: deprecated, remove in v12\n const passwordVisibilityButton = () => html`\n <button\n type=\"button\"\n class=\"${passwordVisibilityToggleClasses}\"\n ?disabled=\"${normalizedProps.disabled}\"\n @click=\"${this.togglePasswordVisibility}\">\n ${!normalizedProps.disabled ? passwordButtonLabel : null}\n ${passwordVisibilityIcon}\n </button>\n `;\n\n const textCount = value?.length;\n\n const counter =\n enableCounter && maxCount\n ? html` <label class=\"${counterClasses}\">\n <slot name=\"label-text\">${textCount}/${maxCount}</slot>\n </label>`\n : null;\n\n const labelWrapper = html`<div class=\"${prefix}--text-input__label-wrapper\">\n <label class=\"${labelClasses}\">\n <slot name=\"label-text\">${label}</slot>\n </label>\n ${counter}\n </div>`;\n\n const hasHelperText =\n helperText || (this._slotHelperTextNode?.assignedNodes().length ?? 0) > 0;\n\n const helper = html`<div\n class=\"${helperTextClasses}\"\n id=\"helper-text\"\n ?hidden=\"${normalizedProps.invalid ||\n normalizedProps.warn ||\n !hasHelperText}\">\n <slot\n name=\"helper-text\"\n @slotchange=\"${this._handleHelperTextSlotChange}\">\n ${helperText}\n </slot>\n </div>`;\n\n const validationMessage =\n normalizedProps.invalid || normalizedProps.warn\n ? html`<div\n class=\"${prefix}--form-requirement\"\n ?hidden=\"${!normalizedProps.invalid && !normalizedProps.warn}\">\n <slot name=\"${normalizedProps['slot-name']}\">\n ${normalizedProps['slot-text']}\n </slot>\n </div>`\n : null;\n\n return html`\n <div class=\"${inputWrapperClasses}\">\n ${!inline\n ? labelWrapper\n : html`<div class=\"${prefix}--text-input__label-helper-wrapper\">\n ${labelWrapper}\n </div>`}\n <div class=\"${fieldOuterWrapperClasses}\">\n <div class=\"${fieldWrapperClasses}\" ?data-invalid=\"${invalid}\">\n <input\n autocomplete=\"${this.autocomplete}\"\n ?autofocus=\"${this.autofocus}\"\n class=\"${inputClasses}\"\n ?data-invalid=\"${invalid}\"\n ?disabled=\"${disabled}\"\n ?aria-describedby=\"${hasHelperText ? 'helper-text' : undefined}\"\n id=\"input\"\n name=\"${ifNonEmpty(this.name)}\"\n pattern=\"${ifNonEmpty(this.pattern)}\"\n placeholder=\"${ifNonEmpty(this.placeholder)}\"\n ?readonly=\"${readonly}\"\n ?required=\"${required}\"\n type=\"${ifNonEmpty(type)}\"\n .value=\"${this._value}\"\n maxlength=\"${ifNonEmpty(maxCount)}\"\n @input=\"${handleInput}\" />\n ${normalizedProps.icon}\n <slot name=\"ai-label\" @slotchange=\"${handleSlotChange}\"></slot>\n <slot name=\"slug\" @slotchange=\"${handleSlotChange}\"></slot>\n ${this.showPasswordVisibilityToggle &&\n (type === INPUT_TYPE.PASSWORD || type === INPUT_TYPE.TEXT)\n ? passwordVisibilityButton()\n : null}\n ${isFluid\n ? html`<hr class=\"${prefix}--text-input__divider\" />`\n : null}\n ${isFluid && !inline ? validationMessage : null}\n </div>\n\n ${/* Non-fluid: validation and helper outside field wrapper */ ''}\n ${!isFluid && !inline ? validationMessage || helper : null}\n </div>\n ${inline && !isFluid\n ? html`<div class=\"${prefix}--text-input__label-helper-wrapper\">\n ${!isFluid ? validationMessage || helper : null}\n </div>`\n : null}\n </div>\n `;\n }\n\n updated() {\n this.toggleAttribute('ai-label', this._hasAILabel);\n const label = this.shadowRoot?.querySelector(\"slot[name='ai-label']\");\n\n if (label) {\n label?.classList.toggle(\n `${prefix}--slug--revert`,\n this.querySelector(`${prefix}-ai-label`)?.hasAttribute('revert-active')\n );\n } else {\n this.shadowRoot\n ?.querySelector(\"slot[name='slug']\")\n ?.classList.toggle(\n `${prefix}--slug--revert`,\n this.querySelector(`${prefix}-slug`)?.hasAttribute('revert-active')\n );\n }\n }\n\n /**\n * A selector that will return the slug item.\n *\n * remove in v12\n */\n static get slugItem() {\n return `${prefix}-slug`;\n }\n\n /**\n * A selector that will return the AI Label item.\n */\n static get aiLabelItem() {\n return `${prefix}-ai-label`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles;\n}\n\nexport default CDSTextInput;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAA,eAAA,MACM,qBAAqB,cAAc,UAAU,UAAU,CAAC,CAAC,CAAC;;;qBAItC;gBAoCL;sBA4BJ;mBAMH;kBAMD;uBAMK;oBAMH;iBAMH;qBAMI;cAYP;kBAMI;mBAMC;eAMJ;cAMD;iBAMG;qBAMI;kBAMH;kBAMA;iCAMe;2BAQN;2BAQA;sCAYW;iBASrB;gBAMD;;;;yBA0BS;;;;;CAtOlB,kBAA4B,EAAE,UAAiB;EAC7C,MAAM,aAAc,OACjB,cAAc,CAAC,CACf,QAAQ,SACN,KAAqB,YAAY,KAAA,IAC7B,KAAqB,QACnB,KAAK,YAAoC,WAC5C,KAEC,KAAqB,QACnB,KAAK,YAAoC,QAC5C,IACA,KACN;EAEF,KAAK,cAAc,QAAQ,UAAU;EACrC,WAAY,EAAE,CAAiB,aAAa,QAAQ,MAAM;EAC1D,KAAK,cAAc;CACrB;;;;;;;CAqBA,aAAuB,EAAE,UAAiB;EACxC,KAAK,QAAS,OAA4B;CAC5C;CAEA,gBAAgB,OAAsB;EACpC,MAAM,EAAE,aAAa;EACrB,MAAM,EAAE,UAAU,MAAM,UAAU;EAClC,IAAI,CAAC,UACH,SAAS,OAAO,MAAM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CAAA;YAOzC,SAAS,CAAA,GAAA,aAAA,WAAA,oBAAA,KAAA,CAAA;YAOT,SAAS,CAAA,GAAA,aAAA,WAAA,oBAAA,KAAA,CAAA;YAMT,SAAS,EAAE,SAAS,KAAK,CAAC,CAAA,GAAA,aAAA,WAAA,QAAA,KAAA,CAAA;YAM1B,SAAS,EAAE,WAAW,mBAAmB,CAAC,CAAA,GAAA,aAAA,WAAA,mBAAA,KAAA,CAAA;YAM1C,SAAS,EAAE,SAAS,KAAK,CAAC,CAAA,GAAA,aAAA,WAAA,SAAA,IAAA;2BArP5BC,cAAc,gBAAsB,CAAA,GAAA,YAAA;AA8iBrC,IAAA,qBAAe"}
1
+ {"version":3,"file":"text-input.js","names":["ifNonEmpty","styles","customElement"],"sources":["../../../src/components/text-input/text-input.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { prefix } from '../../globals/settings';\nimport { iconLoader } from '../../globals/internal/icon-loader';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport WarningFilled16 from '@carbon/icons/es/warning--filled/16.js';\nimport WarningAltFilled16 from '@carbon/icons/es/warning--alt--filled/16.js';\nimport View16 from '@carbon/icons/es/view/16.js';\nimport ViewOff16 from '@carbon/icons/es/view--off/16.js';\nimport FormMixin from '../../globals/mixins/form';\nimport ValidityMixin from '../../globals/mixins/validity';\nimport {\n INPUT_COLOR_SCHEME,\n INPUT_SIZE,\n INPUT_TOOLTIP_ALIGNMENT,\n INPUT_TOOLTIP_DIRECTION,\n INPUT_TYPE,\n} from './defs';\nimport styles from './text-input.scss?lit';\n\nexport {\n INPUT_COLOR_SCHEME,\n INPUT_SIZE,\n INPUT_TOOLTIP_ALIGNMENT,\n INPUT_TOOLTIP_DIRECTION,\n INPUT_TYPE,\n};\n\n/**\n * Text Input element. Supports all the usual attributes for textual input types\n *\n * @element cds-custom-text-input\n * @slot helper-text - The helper text.\n * @slot label-text - The label text.\n * @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n@customElement(`${prefix}-text-input`)\nclass CDSTextInput extends ValidityMixin(FormMixin(LitElement)) {\n /**\n * `true` if there is an AI Label.\n */\n protected _hasAILabel = false;\n\n /**\n * Handles `slotchange` event.\n */\n protected _handleSlotChange({ target }: Event) {\n const hasContent = (target as HTMLSlotElement)\n .assignedNodes()\n .filter((elem) =>\n (elem as HTMLElement).matches !== undefined\n ? (elem as HTMLElement).matches(\n (this.constructor as typeof CDSTextInput).aiLabelItem\n ) ||\n // remove reference to slug in v12\n (elem as HTMLElement).matches(\n (this.constructor as typeof CDSTextInput).slugItem\n )\n : false\n );\n\n this._hasAILabel = Boolean(hasContent);\n (hasContent[0] as HTMLElement).setAttribute('size', 'mini');\n this.requestUpdate();\n }\n /**\n * The underlying input element\n */\n @query('input')\n protected _input!: HTMLInputElement;\n\n @query('slot[name=\"helper-text\"]')\n protected _slotHelperTextNode!: HTMLSlotElement;\n\n /**\n * The `<slot>` element for the AI label in the shadow DOM.\n */\n @query(\"slot[name='ai-label']\")\n private _slotAILabelNode!: HTMLSlotElement;\n\n /**\n * The `<slot>` element for the slug in the shadow DOM.\n */\n @query(\"slot[name='slug']\")\n private _slotSlugNode!: HTMLSlotElement;\n\n /**\n * The internal value.\n */\n protected _value = '';\n\n /**\n * Handles `oninput` event on the `input`.\n *\n * @param event The event.\n * @param event.target The event target.\n */\n protected _handleInput({ target }: Event) {\n this.value = (target as HTMLInputElement).value;\n }\n\n /**\n * Handles `onchange` event on the `input`.\n *\n * The native `change` event is not composed, so it stops at the shadow root\n * and never reaches listeners on the host. This re-emits it as a composed event so\n * consumers can listen for `change` on `<cds-custom-text-input>` exactly as they\n * would on a native `<input>`.\n */\n protected _handleChange() {\n this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));\n }\n\n _handleFormdata(event: FormDataEvent) {\n const { formData } = event;\n const { disabled, name, value } = this;\n if (!disabled) {\n formData.append(name, value);\n }\n }\n\n protected _handleHelperTextSlotChange() {\n this.requestUpdate();\n }\n\n /**\n * May be any of the standard HTML autocomplete options\n */\n @property()\n autocomplete = '';\n\n /**\n * Sets the input to be focussed automatically on page load. Defaults to false\n */\n @property({ type: Boolean })\n autofocus = false;\n\n /**\n * Controls the disabled state of the input\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Specify whether to display the character counter\n */\n @property({ type: Boolean, attribute: 'enable-counter', reflect: true })\n enableCounter = false;\n\n /**\n * The helper text.\n */\n @property({ attribute: 'helper-text' })\n helperText = '';\n\n /**\n * Specify if the currently value is invalid.\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * Message which is displayed if the value is invalid.\n */\n @property({ attribute: 'invalid-text' })\n invalidText = '';\n\n /**\n * Max character count allowed for input. This is needed in order for enableCounter to display\n */\n @property({ type: Number, attribute: 'max-count', reflect: true })\n maxCount;\n\n /**\n * Specify whether the control is currently in warning state\n */\n @property({ type: Boolean, reflect: true })\n warn = false;\n\n /**\n * Provide the text that is displayed when the control is in warning state\n */\n @property({ attribute: 'warn-text' })\n warnText = '';\n\n /**\n * Specify whether you want the underlying label to be visually hidden\n */\n @property({ attribute: 'hide-label', type: Boolean, reflect: true })\n hideLabel = false;\n\n /**\n * Generic label that will be used as the textual representation of what this field is for\n */\n @property({ attribute: 'label' })\n label = '';\n\n /**\n * Name for the input in the `FormData`\n */\n @property()\n name = '';\n\n /**\n * Pattern to validate the input against for HTML validity checking\n */\n @property()\n pattern = '';\n\n /**\n * Value to display when the input has an empty `value`\n */\n @property({ reflect: true })\n placeholder = '';\n\n /**\n * Specify if the component should be read-only\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n /**\n * Boolean property to set the required status\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * The special validity message for `required`.\n */\n @property({ attribute: 'required-validity-message' })\n requiredValidityMessage = 'Please fill out this field.';\n\n /**\n * \"Hide password\" tooltip text on password visibility toggle\n *\n * @deprecated will be removed in the next major version, use `cds-custom-password-input` instead\n */\n @property()\n hidePasswordLabel = 'Hide password';\n\n /**\n * \"Show password\" tooltip text on password visibility toggle\n *\n * @deprecated will be removed in the next major version, use `cds-custom-password-input` instead\n */\n @property()\n showPasswordLabel = 'Show password';\n\n /**\n * Boolean property to render password visibility toggle\n *\n * @deprecated will be removed in the next major version, use `cds-custom-password-input` instead\n */\n @property({\n type: Boolean,\n attribute: 'show-password-visibility-toggle',\n reflect: true,\n })\n showPasswordVisibilityToggle = false;\n\n /**\n * The input box size.\n */\n @property({ reflect: true })\n size?: INPUT_SIZE;\n\n @property({ type: Boolean })\n isFluid = false;\n\n /**\n * true to use the inline version.\n */\n @property({ type: Boolean, reflect: true })\n inline = false;\n\n /**\n * Specify the alignment of the tooltip to the icon-only button.\n * Can be one of: start, center, or end.\n */\n @property()\n tooltipAlignment = INPUT_TOOLTIP_ALIGNMENT.CENTER;\n\n /**\n * Specify the direction of the tooltip for icon-only buttons.\n * Can be either top, right, bottom, or left.\n */\n @property()\n tooltipDirection = INPUT_TOOLTIP_DIRECTION.BOTTOM;\n\n /**\n * The type of the input. Can be one of the types listed in the INPUT_TYPE enum\n */\n @property({ reflect: true })\n type = INPUT_TYPE.TEXT;\n\n /**\n * The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n @property({ attribute: 'validity-message' })\n validityMessage = '';\n\n /**\n * The value of the input.\n */\n @property({ reflect: true })\n get value() {\n // FIXME: Figure out how to deal with TS2611\n // once we have the input we can directly query for the value\n if (this._input) {\n return this._input.value;\n }\n // but before then _value will work fine\n return this._value;\n }\n\n set value(value) {\n const oldValue = this._value;\n this._value = value;\n // make sure that lit-element updates the right properties\n this.requestUpdate('value', oldValue);\n // we set the value directly on the input (when available)\n // so that programatic manipulation updates the UI correctly\n if (this._input) {\n this._input.value = value;\n }\n }\n\n /**\n * Handles password visibility toggle button click\n *\n * @deprecated will be removed in the next major version, use `cds-custom-password-input` instead\n */\n private togglePasswordVisibility() {\n this.type =\n this.type === INPUT_TYPE.PASSWORD ? INPUT_TYPE.TEXT : INPUT_TYPE.PASSWORD;\n }\n\n render() {\n const {\n disabled,\n enableCounter,\n helperText,\n hideLabel,\n inline,\n isFluid,\n invalid,\n invalidText,\n label,\n maxCount,\n readonly,\n required,\n size,\n type,\n warn,\n warnText,\n value,\n _handleInput: handleInput,\n _handleChange: handleChange,\n _hasAILabel: hasAILabel,\n _handleSlotChange: handleSlotChange,\n } = this;\n\n const invalidIcon = iconLoader(WarningFilled16, {\n class: `${prefix}--text-input__invalid-icon`,\n });\n\n const warnIcon = iconLoader(WarningAltFilled16, {\n class: `${prefix}--text-input__invalid-icon ${prefix}--text-input__invalid-icon--warning`,\n });\n\n const normalizedProps: {\n disabled: boolean;\n invalid: boolean;\n warn: boolean;\n 'slot-name': string;\n 'slot-text': string;\n icon: ReturnType<typeof iconLoader>;\n } = {\n disabled: !readonly && disabled,\n invalid: !readonly && invalid,\n warn: !readonly && !invalid && warn,\n 'slot-name': '',\n 'slot-text': '',\n icon: null,\n };\n\n if (normalizedProps.invalid) {\n normalizedProps.icon = invalidIcon;\n normalizedProps['slot-name'] = 'invalid-text';\n normalizedProps['slot-text'] = invalidText;\n } else if (normalizedProps.warn) {\n normalizedProps.icon = warnIcon;\n normalizedProps['slot-name'] = 'warn-text';\n normalizedProps['slot-text'] = warnText;\n }\n\n const counterClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--text-input__label-counter`]: true,\n [`${prefix}--label--disabled`]: disabled,\n });\n\n const inputWrapperClasses = classMap({\n [`${prefix}--form-item`]: true,\n [`${prefix}--text-input-wrapper`]: true,\n [`${prefix}--text-input-wrapper--inline`]: inline,\n [`${prefix}--text-input-wrapper--readonly`]: readonly,\n [`${prefix}--text-input-wrapper--inline--invalid`]:\n inline && normalizedProps.invalid,\n });\n\n const inputClasses = classMap({\n [`${prefix}--text-input`]: true,\n [`${prefix}--text-input--invalid`]: normalizedProps.invalid,\n [`${prefix}--text-input--warning`]: normalizedProps.warn,\n [`${prefix}--text-input--${size}`]: size !== undefined, // TODO V12 - remove this class\n [`${prefix}--layout--size-${size}`]: size !== undefined,\n [`${prefix}--password-input`]: type === INPUT_TYPE.PASSWORD, // TODO: deprecated, remove in v12\n });\n\n const fieldOuterWrapperClasses = classMap({\n [`${prefix}--text-input__field-outer-wrapper`]: true,\n [`${prefix}--text-input__field-outer-wrapper--inline`]: inline,\n });\n\n const fieldWrapperClasses = classMap({\n [`${prefix}--text-input__field-wrapper`]: true,\n [`${prefix}--text-input__field-wrapper--warning`]: normalizedProps.warn,\n [`${prefix}--text-input__field-wrapper--decorator`]: hasAILabel,\n });\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--visually-hidden`]: hideLabel,\n [`${prefix}--label--disabled`]: normalizedProps.disabled,\n [`${prefix}--label--inline`]: inline,\n });\n\n const helperTextClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: normalizedProps.disabled,\n [`${prefix}--form__helper-text--inline`]: inline,\n });\n\n // TODO: deprecated, remove in v12\n const passwordIsVisible = type !== INPUT_TYPE.PASSWORD;\n const passwordVisibilityIcon = passwordIsVisible\n ? iconLoader(ViewOff16, { class: `${prefix}--icon-visibility-off` })\n : iconLoader(View16, { class: `${prefix}--icon-visibility-on` });\n\n // TODO: deprecated, remove in v12\n const passwordVisibilityToggleClasses = classMap({\n [`${prefix}--text-input--password__visibility__toggle`]: true,\n [`${prefix}--btn`]: true,\n [`${prefix}--btn--icon-only`]: true,\n [`${prefix}--tooltip__trigger`]: true,\n [`${prefix}--tooltip--a11y`]: true,\n [`${prefix}--btn--disabled`]: normalizedProps.disabled,\n [`${prefix}--tooltip--${this.tooltipDirection}`]: this.tooltipDirection,\n [`${prefix}--tooltip--align-${this.tooltipAlignment}`]:\n this.tooltipAlignment,\n });\n\n // TODO: deprecated, remove in v12\n const passwordButtonLabel = html`\n <span class=\"${prefix}--assistive-text\">\n ${passwordIsVisible ? this.hidePasswordLabel : this.showPasswordLabel}\n </span>\n `;\n\n // TODO: deprecated, remove in v12\n const passwordVisibilityButton = () => html`\n <button\n type=\"button\"\n class=\"${passwordVisibilityToggleClasses}\"\n ?disabled=\"${normalizedProps.disabled}\"\n @click=\"${this.togglePasswordVisibility}\">\n ${!normalizedProps.disabled ? passwordButtonLabel : null}\n ${passwordVisibilityIcon}\n </button>\n `;\n\n const textCount = value?.length;\n\n const counter =\n enableCounter && maxCount\n ? html` <label class=\"${counterClasses}\">\n <slot name=\"label-text\">${textCount}/${maxCount}</slot>\n </label>`\n : null;\n\n const labelWrapper = html`<div class=\"${prefix}--text-input__label-wrapper\">\n <label class=\"${labelClasses}\" for=\"input\">\n <slot name=\"label-text\">${label}</slot>\n </label>\n ${counter}\n </div>`;\n\n const hasHelperText =\n helperText || (this._slotHelperTextNode?.assignedNodes().length ?? 0) > 0;\n\n const helper = html`<div\n class=\"${helperTextClasses}\"\n id=\"helper-text\"\n ?hidden=\"${normalizedProps.invalid ||\n normalizedProps.warn ||\n !hasHelperText}\">\n <slot\n name=\"helper-text\"\n @slotchange=\"${this._handleHelperTextSlotChange}\">\n ${helperText}\n </slot>\n </div>`;\n\n const validationMessage =\n normalizedProps.invalid || normalizedProps.warn\n ? html`<div\n class=\"${prefix}--form-requirement\"\n id=\"error-text\"\n ?hidden=\"${!normalizedProps.invalid && !normalizedProps.warn}\">\n <slot name=\"${normalizedProps['slot-name']}\">\n ${normalizedProps['slot-text']}\n </slot>\n </div>`\n : null;\n\n // Mirrors `cds-custom-select`: the validation message takes precedence over the\n // helper text, which is hidden while the input is invalid or in warning.\n let describedBy: string | undefined;\n if (normalizedProps.invalid || normalizedProps.warn) {\n describedBy = 'error-text';\n } else if (hasHelperText) {\n describedBy = 'helper-text';\n }\n\n return html`\n <div class=\"${inputWrapperClasses}\">\n ${!inline\n ? labelWrapper\n : html`<div class=\"${prefix}--text-input__label-helper-wrapper\">\n ${labelWrapper}\n </div>`}\n <div class=\"${fieldOuterWrapperClasses}\">\n <div class=\"${fieldWrapperClasses}\" ?data-invalid=\"${invalid}\">\n <input\n autocomplete=\"${this.autocomplete}\"\n ?autofocus=\"${this.autofocus}\"\n class=\"${inputClasses}\"\n ?data-invalid=\"${invalid}\"\n ?disabled=\"${disabled}\"\n aria-describedby=\"${ifDefined(describedBy)}\"\n id=\"input\"\n name=\"${ifNonEmpty(this.name)}\"\n pattern=\"${ifNonEmpty(this.pattern)}\"\n placeholder=\"${ifNonEmpty(this.placeholder)}\"\n ?readonly=\"${readonly}\"\n ?required=\"${required}\"\n type=\"${ifNonEmpty(type)}\"\n .value=\"${this._value}\"\n maxlength=\"${ifNonEmpty(maxCount)}\"\n @input=\"${handleInput}\"\n @change=\"${handleChange}\" />\n ${normalizedProps.icon}\n <slot name=\"ai-label\" @slotchange=\"${handleSlotChange}\"></slot>\n <slot name=\"slug\" @slotchange=\"${handleSlotChange}\"></slot>\n ${this.showPasswordVisibilityToggle &&\n (type === INPUT_TYPE.PASSWORD || type === INPUT_TYPE.TEXT)\n ? passwordVisibilityButton()\n : null}\n ${isFluid\n ? html`<hr class=\"${prefix}--text-input__divider\" />`\n : null}\n ${isFluid && !inline ? validationMessage : null}\n </div>\n\n ${/* Non-fluid: validation and helper outside field wrapper */ ''}\n ${!isFluid && !inline ? validationMessage || helper : null}\n </div>\n ${inline && !isFluid\n ? html`<div class=\"${prefix}--text-input__label-helper-wrapper\">\n ${!isFluid ? validationMessage || helper : null}\n </div>`\n : null}\n </div>\n `;\n }\n\n updated() {\n this.toggleAttribute('ai-label', this._hasAILabel);\n const label = this._slotAILabelNode;\n\n if (label) {\n label?.classList.toggle(\n `${prefix}--slug--revert`,\n this.querySelector(`${prefix}-ai-label`)?.hasAttribute('revert-active')\n );\n } else {\n this._slotSlugNode?.classList.toggle(\n `${prefix}--slug--revert`,\n this.querySelector(`${prefix}-slug`)?.hasAttribute('revert-active')\n );\n }\n }\n\n /**\n * A selector that will return the slug item.\n *\n * remove in v12\n */\n static get slugItem() {\n return `${prefix}-slug`;\n }\n\n /**\n * A selector that will return the AI Label item.\n */\n static get aiLabelItem() {\n return `${prefix}-ai-label`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles;\n}\n\nexport default CDSTextInput;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,IAAA,eAAA,MACM,qBAAqB,cAAc,UAAU,UAAU,CAAC,CAAC,CAAC;;;qBAItC;gBAgDL;sBAwCJ;mBAMH;kBAMD;uBAMK;oBAMH;iBAMH;qBAMI;cAYP;kBAMI;mBAMC;eAMJ;cAMD;iBAMG;qBAMI;kBAMH;kBAMA;iCAMe;2BAQN;2BAQA;sCAYW;iBASrB;gBAMD;;;;yBA0BS;;;;;CA9PlB,kBAA4B,EAAE,UAAiB;EAC7C,MAAM,aAAc,OACjB,cAAc,CAAC,CACf,QAAQ,SACN,KAAqB,YAAY,KAAA,IAC7B,KAAqB,QACnB,KAAK,YAAoC,WAC5C,KAEC,KAAqB,QACnB,KAAK,YAAoC,QAC5C,IACA,KACN;EAEF,KAAK,cAAc,QAAQ,UAAU;EACrC,WAAY,EAAE,CAAiB,aAAa,QAAQ,MAAM;EAC1D,KAAK,cAAc;CACrB;;;;;;;CAiCA,aAAuB,EAAE,UAAiB;EACxC,KAAK,QAAS,OAA4B;CAC5C;;;;;;;;;CAUA,gBAA0B;EACxB,KAAK,cAAc,IAAI,MAAM,UAAU;GAAE,SAAS;GAAM,UAAU;EAAK,CAAC,CAAC;CAC3E;CAEA,gBAAgB,OAAsB;EACpC,MAAM,EAAE,aAAa;EACrB,MAAM,EAAE,UAAU,MAAM,UAAU;EAClC,I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AAO,IAAI,IAAI;IAyBf;;;OAGG;IACH,OAAO,CAAC,eAAe;IAqBvB,oBAAoB;IAKpB,MAAM,CAAC,iBAAiB;;;;;;;MAGtB;IACF,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,WAAW,CAAC"}
@@ -175,7 +175,8 @@ let CDSTextarea = class CDSTextarea extends text_input_default {
175
175
  maxlength="${this.counterMode === "character" ? if_non_empty_default(this.maxCount) : ""}"
176
176
  @keydown="${this._onKeyDown}"
177
177
  @paste="${this._onPaste}"
178
- @input="${this._handleInput}"></textarea>
178
+ @input="${this._handleInput}"
179
+ @change="${this._handleChange}"></textarea>
179
180
  <slot name="ai-label" @slotchange="${this._handleSlotChange}"></slot>
180
181
  <slot name="slug" @slotchange="${this._handleSlotChange}"></slot>
181
182
  ${this.isFluid ? html`
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.js","names":["CDSTextInput","ifNonEmpty","styles","customElement"],"sources":["../../../src/components/textarea/textarea.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2025\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { prefix } from '../../globals/settings';\nimport WarningFilled16 from '@carbon/icons/es/warning--filled/16.js';\nimport WarningAltFilled16 from '@carbon/icons/es/warning--alt--filled/16.js';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport CDSTextInput from '../text-input/text-input';\nimport styles from './textarea.scss?lit';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { iconLoader } from '../../globals/internal/icon-loader';\n\n/**\n * Text area.\n *\n * @element cds-custom-textarea\n * @slot helper-text - The helper text.\n * @slot label-text - The label text.\n * @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n@customElement(`${prefix}-textarea`)\nclass CDSTextarea extends CDSTextInput {\n /**\n * Manually handles maxCount for counterMode = 'word'\n * @param event The keyboard event.\n */\n protected _onKeyDown(evt: KeyboardEvent) {\n if (!this.disabled && this.enableCounter && this.counterMode === 'word') {\n const currentWordCount = this.value?.match(/\\p{L}+/gu)?.length || 0;\n if (\n (this.maxCount &&\n currentWordCount >= this.maxCount &&\n evt.key === ' ') ||\n (this.maxCount &&\n currentWordCount >= this.maxCount &&\n evt.key === 'Enter')\n ) {\n evt.preventDefault();\n }\n }\n }\n\n /**\n * Handles `onPaste` event on the `<input>`.\n * Manually handles maxCount for counterMode = 'word' when\n * the user is pasting text\n *\n * @param event The clipboard event.\n */\n protected _onPaste(evt: ClipboardEvent) {\n if (\n this.counterMode === 'word' &&\n this.enableCounter &&\n typeof this.maxCount !== 'undefined'\n ) {\n const existingWords: string[] =\n this._textarea.value.match(/\\p{L}+/gu) || [];\n const pastedWords: string[] =\n evt.clipboardData?.getData('Text').match(/\\p{L}+/gu) || [];\n\n const totalWords = existingWords.length + pastedWords.length;\n\n if (totalWords > this.maxCount) {\n evt.preventDefault();\n\n const allowedWords = existingWords\n .concat(pastedWords)\n .slice(0, this.maxCount);\n\n this._textarea.value = allowedWords.join(' ');\n this._textarea.dispatchEvent(\n new InputEvent('input', {\n inputType: 'insertFromPaste',\n data: allowedWords.join(' '),\n bubbles: true,\n })\n );\n }\n }\n }\n /**\n * Handles `oninput` event on the `<input>`.\n *\n * @param event The event.\n * @param event.target The event target.\n */\n protected _handleInput({ target }: Event) {\n this.value = (target as HTMLTextAreaElement).value;\n }\n\n /**\n * The number of columns for the textarea to show by default\n */\n @property({ type: Number })\n cols;\n\n /**\n * Specify whether the textarea is fluid or not\n */\n @property({ type: Boolean })\n isFluid = false;\n\n /**\n * Specify the method used for calculating the counter number\n */\n @property({\n type: String,\n reflect: true,\n hasChanged(newVal: string, oldVal: string) {\n if ((newVal === 'character' || newVal === 'word') && newVal !== oldVal) {\n return true;\n }\n return false;\n },\n attribute: 'counter-mode',\n })\n counterMode: 'character' | 'word' = 'character';\n\n /**\n * ID to link the `label` and `textarea`\n */\n @property()\n id = '';\n\n /**\n * Pattern to validate the textarea against for HTML validity checking\n */\n @property()\n pattern = '';\n\n /**\n * Boolean property to set the required status\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * The number of rows for the textarea to show by default\n */\n @property()\n rows = 4;\n\n /**\n * Get a reference to the underlying textarea so we can directly apply values.\n * This lets us fixe a bug where after a user would clear text, the value wouldn't update programmatically\n */\n @query('textarea')\n protected _textarea!: HTMLTextAreaElement;\n\n /**\n * The previous counterMode selected. This lets the counterMode state update\n * when the user toggles between both modes.\n */\n private _prevCounterMode: 'character' | 'word' = this.counterMode;\n\n /**\n * Observes the textarea wrapper’s size to re-measure helper/invalid/warn text width when\n * cols is updated\n */\n private _resizeObserver?: ResizeObserver;\n\n render() {\n const { enableCounter, maxCount } = this;\n\n const textCount = this.value?.length ?? 0;\n const wordCount = this.value?.match(/\\p{L}+/gu)?.length || 0;\n\n const invalidIcon = iconLoader(WarningFilled16, {\n class: `${prefix}--text-area__invalid-icon`,\n });\n\n const warnIcon = iconLoader(WarningAltFilled16, {\n class: `${prefix}--text-area__invalid-icon ${prefix}--text-area__invalid-icon--warning`,\n });\n\n const textareaClasses = classMap({\n [`${prefix}--text-area`]: true,\n [`${prefix}--text-area--warn`]: this.warn,\n [`${prefix}--text-area--invalid`]: this.invalid,\n [`${prefix}--text-area__wrapper--decorator`]: this._hasAILabel,\n });\n\n const textareaWrapperClasses = classMap({\n [`${prefix}--text-area__wrapper`]: true,\n [`${prefix}--text-area__wrapper--cols`]: this.cols,\n [`${prefix}--text-area__wrapper--warn`]: this.warn,\n [`${prefix}--text-area__wrapper--readonly`]: this.readonly,\n });\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--visually-hidden`]: this.hideLabel,\n [`${prefix}--label--disabled`]: this.disabled,\n });\n\n const counterClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--label--disabled`]: this.disabled,\n [`${prefix}--text-area__label-counter`]: true,\n });\n\n const helperTextClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: this.disabled,\n });\n\n const counter =\n enableCounter && maxCount\n ? html` <label class=\"${counterClasses}\">\n <slot name=\"label-text\"\n >${this.counterMode === 'word'\n ? wordCount\n : textCount}/${maxCount}</slot\n >\n </label>`\n : null;\n\n const icon = () => {\n if (this.invalid) {\n return invalidIcon;\n } else if (this.warn && !this.invalid) {\n return warnIcon;\n }\n return null;\n };\n\n const helper = html`\n <div class=\"${helperTextClasses}\" id=\"helper-text\">\n <slot name=\"helper-text\">${this.helperText}</slot>\n </div>\n `;\n\n const normalizedProps = {\n invalid: this.invalid,\n warn: this.warn,\n 'slot-name': this.invalid ? 'invalid-text' : 'warn-text',\n 'slot-text': this.invalid ? this.invalidText : this.warnText,\n };\n\n const validationMessage = html`\n <div\n class=\"${prefix}--form-requirement\"\n ?hidden=\"${!normalizedProps.invalid && !normalizedProps.warn}\">\n <slot name=\"${normalizedProps['slot-name']}\">\n ${normalizedProps['slot-text']} ${this.isFluid ? icon() : null}\n </slot>\n </div>\n `;\n\n return html`\n <div class=\"${prefix}--text-area__label-wrapper\">\n <label class=\"${labelClasses}\" for=\"input\">\n <slot name=\"label-text\"> ${this.label} </slot>\n </label>\n ${counter}\n </div>\n <div class=\"${textareaWrapperClasses}\" ?data-invalid=\"${this.invalid}\">\n ${!this.isFluid ? icon() : null}\n <textarea\n autocomplete=\"${this.autocomplete}\"\n ?autofocus=\"${this.autofocus}\"\n class=\"${textareaClasses}\"\n cols=\"${ifDefined(this.cols)}\"\n ?data-invalid=\"${this.invalid}\"\n ?disabled=\"${this.disabled}\"\n id=\"input\"\n name=\"${ifNonEmpty(this.name)}\"\n pattern=\"${ifNonEmpty(this.pattern)}\"\n placeholder=\"${ifNonEmpty(this.placeholder)}\"\n ?readonly=\"${this.readonly}\"\n ?required=\"${this.required}\"\n rows=\"${ifDefined(this.rows)}\"\n .value=\"${this.value}\"\n maxlength=\"${this.counterMode === 'character'\n ? ifNonEmpty(this.maxCount)\n : ''}\"\n @keydown=\"${this._onKeyDown}\"\n @paste=\"${this._onPaste}\"\n @input=\"${this._handleInput}\"></textarea>\n <slot name=\"ai-label\" @slotchange=\"${this._handleSlotChange}\"></slot>\n <slot name=\"slug\" @slotchange=\"${this._handleSlotChange}\"></slot>\n ${this.isFluid\n ? html`\n <hr class=\"${prefix}--text-area__divider\" />\n ${validationMessage}\n `\n : null}\n </div>\n ${/* Non-fluid: validation and helper outside field wrapper */ ''}\n ${!this.isFluid ? html` ${helper} ${validationMessage} ` : null}\n `;\n }\n updated(): void {\n super.updated?.();\n if (this.counterMode !== this._prevCounterMode) {\n const textarea = this._textarea;\n if (textarea) {\n if (this.counterMode === 'character') {\n textarea.setAttribute('maxlength', String(this.maxCount));\n } else {\n textarea.removeAttribute('maxlength');\n }\n }\n this._prevCounterMode = this.counterMode;\n }\n\n const wrapper = this.shadowRoot?.querySelector<HTMLElement>(\n `.${prefix}--text-area__wrapper`\n );\n if (!wrapper) return;\n\n this._resizeObserver = new ResizeObserver(() => {\n this._measureWrapper();\n });\n this._resizeObserver.observe(wrapper);\n }\n\n /**\n * Measures the width of the wrapper and applies that to the max-width of the\n * helper-text and invalid/warn-text\n */\n private _measureWrapper() {\n const wrapper = this.shadowRoot?.querySelector<HTMLElement>(\n `.${prefix}--text-area__wrapper`\n );\n\n const wrapperWidth = wrapper?.scrollWidth;\n\n const helper = this.shadowRoot?.querySelector<HTMLElement>(\n `.${prefix}--form__helper-text`\n );\n const requirement = this.shadowRoot?.querySelector<HTMLElement>(\n `.${prefix}--form-requirement`\n );\n [helper, requirement].forEach((el) => {\n if (el) {\n el.style.maxWidth = `${wrapperWidth}px`;\n el.style.overflowWrap = 'break-word';\n }\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback?.();\n this._resizeObserver?.disconnect();\n }\n\n static shadowRootOptions = {\n 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U,KAAK,YAAY,cAC/B,0BACF,EAAA,EAE8B;EAQ9B,CANe,KAAK,YAAY,cAC9B,yBACF,GACoB,KAAK,YAAY,cACnC,wBACF,CACoB,CAAC,CAAC,SAAS,OAAO;GACpC,IAAI,IAAI;IACN,GAAG,MAAM,WAAW,GAAG,aAAa;IACpC,GAAG,MAAM,eAAe;GAC1B;EACF,CAAC;CACH;CAEA,uBAAuB;EACrB,MAAM,uBAAuB;EAC7B,KAAK,iBAAiB,WAAW;CACnC;;2BAE2B;GACzB,GAAG,WAAW;GACd,gBAAgB;EAClB;;;gBACgBC;;AAClB;YAnQG,SAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,YAAA,WAAA,QAAA,KAAA,CAAA;YAMzB,SAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,GAAA,YAAA,WAAA,WAAA,KAAA,CAAA;YAM1B,SAAS;CACR,MAAM;CACN,SAAS;CACT,WAAW,QAAgB,QAAgB;EACzC,KAAK,WAAW,eAAe,WAAW,WAAW,WAAW,QAC9D,OAAO;EAET,OAAO;CACT;CACA,WAAW;AACb,CAAC,CAAA,GAAA,YAAA,WAAA,eAAA,KAAA,CAAA;YAMA,SAAS,CAAA,GAAA,YAAA,WAAA,MAAA,KAAA,CAAA;YAMT,SAAS,CAAA,GAAA,YAAA,WAAA,WAAA,KAAA,CAAA;YAMT,SAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,YAAA,WAAA,YAAA,KAAA,CAAA;YAMzC,SAAS,CAAA,GAAA,YAAA,WAAA,QAAA,KAAA,CAAA;YAOT,MAAM,UAAU,CAAA,GAAA,YAAA,WAAA,aAAA,KAAA,CAAA;0BA9HlBC,cAAc,cAAoB,CAAA,GAAA,WAAA;AA8UnC,IAAA,mBAAe"}
1
+ {"version":3,"file":"textarea.js","names":["CDSTextInput","ifNonEmpty","styles","customElement"],"sources":["../../../src/components/textarea/textarea.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2025\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { prefix } from '../../globals/settings';\nimport WarningFilled16 from '@carbon/icons/es/warning--filled/16.js';\nimport WarningAltFilled16 from '@carbon/icons/es/warning--alt--filled/16.js';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport CDSTextInput from '../text-input/text-input';\nimport styles from './textarea.scss?lit';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { iconLoader } from '../../globals/internal/icon-loader';\n\n/**\n * Text area.\n *\n * @element cds-custom-textarea\n * @slot helper-text - The helper text.\n * @slot label-text - The label text.\n * @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n@customElement(`${prefix}-textarea`)\nclass CDSTextarea extends CDSTextInput {\n /**\n * Manually handles maxCount for counterMode = 'word'\n * @param event The keyboard event.\n */\n protected _onKeyDown(evt: KeyboardEvent) {\n if (!this.disabled && this.enableCounter && this.counterMode === 'word') {\n const currentWordCount = this.value?.match(/\\p{L}+/gu)?.length || 0;\n if (\n (this.maxCount &&\n currentWordCount >= this.maxCount &&\n evt.key === ' ') ||\n (this.maxCount &&\n currentWordCount >= this.maxCount &&\n evt.key === 'Enter')\n ) {\n evt.preventDefault();\n }\n }\n }\n\n /**\n * Handles `onPaste` event on the `<input>`.\n * Manually handles maxCount for counterMode = 'word' when\n * the user is pasting text\n *\n * @param event The clipboard event.\n */\n protected _onPaste(evt: ClipboardEvent) {\n if (\n this.counterMode === 'word' &&\n this.enableCounter &&\n typeof this.maxCount !== 'undefined'\n ) {\n const existingWords: string[] =\n this._textarea.value.match(/\\p{L}+/gu) || [];\n const pastedWords: string[] =\n evt.clipboardData?.getData('Text').match(/\\p{L}+/gu) || [];\n\n const totalWords = existingWords.length + pastedWords.length;\n\n if (totalWords > this.maxCount) {\n evt.preventDefault();\n\n const allowedWords = existingWords\n .concat(pastedWords)\n .slice(0, this.maxCount);\n\n this._textarea.value = allowedWords.join(' ');\n this._textarea.dispatchEvent(\n new InputEvent('input', {\n inputType: 'insertFromPaste',\n data: allowedWords.join(' '),\n bubbles: true,\n })\n );\n }\n }\n }\n /**\n * Handles `oninput` event on the `<input>`.\n *\n * @param event The event.\n * @param event.target The event target.\n */\n protected _handleInput({ target }: Event) {\n this.value = (target as HTMLTextAreaElement).value;\n }\n\n /**\n * The number of columns for the textarea to show by default\n */\n @property({ type: Number })\n cols;\n\n /**\n * Specify whether the textarea is fluid or not\n */\n @property({ type: Boolean })\n isFluid = false;\n\n /**\n * Specify the method used for calculating the counter number\n */\n @property({\n type: String,\n reflect: true,\n hasChanged(newVal: string, oldVal: string) {\n if ((newVal === 'character' || newVal === 'word') && newVal !== oldVal) {\n return true;\n }\n return false;\n },\n attribute: 'counter-mode',\n })\n counterMode: 'character' | 'word' = 'character';\n\n /**\n * ID to link the `label` and `textarea`\n */\n @property()\n id = '';\n\n /**\n * Pattern to validate the textarea against for HTML validity checking\n */\n @property()\n pattern = '';\n\n /**\n * Boolean property to set the required status\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * The number of rows for the textarea to show by default\n */\n @property()\n rows = 4;\n\n /**\n * Get a reference to the underlying textarea so we can directly apply values.\n * This lets us fixe a bug where after a user would clear text, the value wouldn't update programmatically\n */\n @query('textarea')\n protected _textarea!: HTMLTextAreaElement;\n\n /**\n * The previous counterMode selected. This lets the counterMode state update\n * when the user toggles between both modes.\n */\n private _prevCounterMode: 'character' | 'word' = this.counterMode;\n\n /**\n * Observes the textarea wrapper’s size to re-measure helper/invalid/warn text width when\n * cols is updated\n */\n private _resizeObserver?: ResizeObserver;\n\n render() {\n const { enableCounter, maxCount } = this;\n\n const textCount = this.value?.length ?? 0;\n const wordCount = this.value?.match(/\\p{L}+/gu)?.length || 0;\n\n const invalidIcon = iconLoader(WarningFilled16, {\n class: `${prefix}--text-area__invalid-icon`,\n });\n\n const warnIcon = iconLoader(WarningAltFilled16, {\n class: `${prefix}--text-area__invalid-icon ${prefix}--text-area__invalid-icon--warning`,\n });\n\n const textareaClasses = classMap({\n [`${prefix}--text-area`]: true,\n [`${prefix}--text-area--warn`]: this.warn,\n [`${prefix}--text-area--invalid`]: this.invalid,\n [`${prefix}--text-area__wrapper--decorator`]: this._hasAILabel,\n });\n\n const textareaWrapperClasses = classMap({\n [`${prefix}--text-area__wrapper`]: true,\n [`${prefix}--text-area__wrapper--cols`]: this.cols,\n [`${prefix}--text-area__wrapper--warn`]: this.warn,\n [`${prefix}--text-area__wrapper--readonly`]: this.readonly,\n });\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--visually-hidden`]: this.hideLabel,\n [`${prefix}--label--disabled`]: this.disabled,\n });\n\n const counterClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--label--disabled`]: this.disabled,\n [`${prefix}--text-area__label-counter`]: true,\n });\n\n const helperTextClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: this.disabled,\n });\n\n const counter =\n enableCounter && maxCount\n ? html` <label class=\"${counterClasses}\">\n <slot name=\"label-text\"\n >${this.counterMode === 'word'\n ? wordCount\n : textCount}/${maxCount}</slot\n >\n </label>`\n : null;\n\n const icon = () => {\n if (this.invalid) {\n return invalidIcon;\n } else if (this.warn && !this.invalid) {\n return warnIcon;\n }\n return null;\n };\n\n const helper = html`\n <div class=\"${helperTextClasses}\" id=\"helper-text\">\n <slot name=\"helper-text\">${this.helperText}</slot>\n </div>\n `;\n\n const normalizedProps = {\n invalid: this.invalid,\n warn: this.warn,\n 'slot-name': this.invalid ? 'invalid-text' : 'warn-text',\n 'slot-text': this.invalid ? this.invalidText : this.warnText,\n };\n\n const validationMessage = html`\n <div\n class=\"${prefix}--form-requirement\"\n ?hidden=\"${!normalizedProps.invalid && !normalizedProps.warn}\">\n <slot name=\"${normalizedProps['slot-name']}\">\n ${normalizedProps['slot-text']} ${this.isFluid ? icon() : null}\n </slot>\n </div>\n `;\n\n return html`\n <div class=\"${prefix}--text-area__label-wrapper\">\n <label class=\"${labelClasses}\" for=\"input\">\n <slot name=\"label-text\"> ${this.label} </slot>\n </label>\n ${counter}\n </div>\n <div class=\"${textareaWrapperClasses}\" ?data-invalid=\"${this.invalid}\">\n ${!this.isFluid ? icon() : null}\n <textarea\n autocomplete=\"${this.autocomplete}\"\n ?autofocus=\"${this.autofocus}\"\n class=\"${textareaClasses}\"\n cols=\"${ifDefined(this.cols)}\"\n ?data-invalid=\"${this.invalid}\"\n ?disabled=\"${this.disabled}\"\n id=\"input\"\n name=\"${ifNonEmpty(this.name)}\"\n pattern=\"${ifNonEmpty(this.pattern)}\"\n placeholder=\"${ifNonEmpty(this.placeholder)}\"\n ?readonly=\"${this.readonly}\"\n ?required=\"${this.required}\"\n rows=\"${ifDefined(this.rows)}\"\n .value=\"${this.value}\"\n maxlength=\"${this.counterMode === 'character'\n ? ifNonEmpty(this.maxCount)\n : ''}\"\n @keydown=\"${this._onKeyDown}\"\n @paste=\"${this._onPaste}\"\n @input=\"${this._handleInput}\"\n @change=\"${this._handleChange}\"></textarea>\n <slot name=\"ai-label\" @slotchange=\"${this._handleSlotChange}\"></slot>\n <slot name=\"slug\" @slotchange=\"${this._handleSlotChange}\"></slot>\n ${this.isFluid\n ? html`\n <hr class=\"${prefix}--text-area__divider\" />\n ${validationMessage}\n `\n : null}\n </div>\n ${/* Non-fluid: validation and helper outside field wrapper */ ''}\n ${!this.isFluid ? html` ${helper} ${validationMessage} ` : null}\n `;\n }\n updated(): void {\n super.updated?.();\n if (this.counterMode !== this._prevCounterMode) {\n const textarea = this._textarea;\n if (textarea) {\n if (this.counterMode === 'character') {\n textarea.setAttribute('maxlength', String(this.maxCount));\n } else {\n textarea.removeAttribute('maxlength');\n }\n }\n this._prevCounterMode = this.counterMode;\n }\n\n const wrapper = this.shadowRoot?.querySelector<HTMLElement>(\n `.${prefix}--text-area__wrapper`\n );\n if (!wrapper) return;\n\n this._resizeObserver = new ResizeObserver(() => {\n this._measureWrapper();\n });\n this._resizeObserver.observe(wrapper);\n }\n\n /**\n * Measures the width of the wrapper and applies that to the max-width of the\n * helper-text and invalid/warn-text\n */\n private _measureWrapper() {\n const wrapper = this.shadowRoot?.querySelector<HTMLElement>(\n `.${prefix}--text-area__wrapper`\n );\n\n const wrapperWidth = wrapper?.scrollWidth;\n\n const helper = this.shadowRoot?.querySelector<HTMLElement>(\n `.${prefix}--form__helper-text`\n );\n const requirement = this.shadowRoot?.querySelector<HTMLElement>(\n `.${prefix}--form-requirement`\n );\n [helper, requirement].forEach((el) => {\n if (el) {\n el.style.maxWidth = `${wrapperWidth}px`;\n el.style.overflowWrap = 'break-word';\n }\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback?.();\n this._resizeObserver?.disconnect();\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles;\n}\n\nexport default CDSTextarea;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,IAAA,cAAA,MACM,oBAAoBA,mBAAa;;;iBA+E3B;qBAgB0B;YAM/B;iBAMK;kBAMC;cAMJ;0BAa0C,KAAK;;;;;;CA/HtD,WAAqB,KAAoB;EACvC,IAAI,CAAC,KAAK,YAAY,KAAK,iBAAiB,KAAK,gBAAgB,QAAQ;GACvE,MAAM,mBAAmB,KAAK,OAAO,MAAM,UAAU,CAAC,EAAE,UAAU;GAClE,IACG,KAAK,YACJ,oBAAoB,KAAK,YACzB,IAAI,QAAQ,OACb,KAAK,YACJ,oBAAoB,KAAK,YACzB,IAAI,QAAQ,SAEd,IAAI,eAAe;EAEvB;CACF;;;;;;;;CASA,SAAmB,KAAqB;EACtC,IACE,KAAK,gBAAgB,UACrB,KAAK,iBACL,OAAO,KAAK,aAAa,aACzB;GACA,MAAM,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