@nova-design-system/nova-react 3.0.0-beta.41 → 3.0.0-beta.42

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 (89) hide show
  1. package/dist/cjs/_commonjsHelpers-1789f0cf-BJu3ubxk.js +10 -0
  2. package/dist/cjs/clsx-297c1ffe-BtxeOLZW.js +5 -0
  3. package/dist/cjs/constants-98e2dcc2-C0SBCapP.js +250 -0
  4. package/dist/cjs/dom.utils-ac71e0ef-CmIwRr6O.js +168 -0
  5. package/dist/cjs/events.utils-fe1d907f-01N__3wY.js +23 -0
  6. package/dist/cjs/fade.animation-2a077983-aKN0EDTo.js +1832 -0
  7. package/dist/cjs/index-C8UfzrMI.js +26405 -0
  8. package/dist/cjs/index-CinzsZ8D.js +26405 -0
  9. package/dist/cjs/index.js +48 -0
  10. package/dist/cjs/inputmask-edcad3c1-B9Omti4z.js +3749 -0
  11. package/dist/cjs/nv-alert.entry-8esWDUyU.js +173 -0
  12. package/dist/cjs/nv-alert.entry-BVY_rxey.js +173 -0
  13. package/dist/cjs/nv-avatar.entry-CO6bt4k6.js +67 -0
  14. package/dist/cjs/nv-avatar.entry-pREKtiv2.js +67 -0
  15. package/dist/cjs/nv-badge_2.entry-wDuiCwys.js +195 -0
  16. package/dist/cjs/nv-badge_2.entry-xfXsesV0.js +195 -0
  17. package/dist/cjs/nv-base.entry-BO-6krwg.js +71 -0
  18. package/dist/cjs/nv-base.entry-DwtTXK_n.js +71 -0
  19. package/dist/cjs/nv-breadcrumb.entry-B0hIeE83.js +45 -0
  20. package/dist/cjs/nv-breadcrumb.entry-DTwjCmMI.js +45 -0
  21. package/dist/cjs/nv-breadcrumbs.entry-Cq0LsIFs.js +20 -0
  22. package/dist/cjs/nv-breadcrumbs.entry-jn5hRjpQ.js +20 -0
  23. package/dist/cjs/nv-button.entry-DaSGnB1L.js +162 -0
  24. package/dist/cjs/nv-button.entry-DxzA6-My.js +162 -0
  25. package/dist/cjs/nv-calendar.entry-BC6NDsVl.js +1036 -0
  26. package/dist/cjs/nv-calendar.entry-DKz-iBnp.js +1036 -0
  27. package/dist/cjs/nv-col.entry-DNUY559i.js +37 -0
  28. package/dist/cjs/nv-col.entry-X7jkNThH.js +37 -0
  29. package/dist/cjs/nv-datagrid.entry-Cp8RCSEv.js +3671 -0
  30. package/dist/cjs/nv-datagrid.entry-DL-Fyo4l.js +3671 -0
  31. package/dist/cjs/nv-datagridcolumn.entry-CR9_1fsZ.js +18 -0
  32. package/dist/cjs/nv-datagridcolumn.entry-CyTG5E7M.js +18 -0
  33. package/dist/cjs/nv-dialog.entry-BjTJ5FFL.js +784 -0
  34. package/dist/cjs/nv-dialog.entry-Do_uALC6.js +784 -0
  35. package/dist/cjs/nv-dialogfooter_2.entry-DJ8qS9q6.js +134 -0
  36. package/dist/cjs/nv-dialogfooter_2.entry-DJkKzEgO.js +134 -0
  37. package/dist/cjs/nv-fieldcheckbox.entry-C0DmeqXD.js +137 -0
  38. package/dist/cjs/nv-fieldcheckbox.entry-DoGQX-5D.js +137 -0
  39. package/dist/cjs/nv-fielddate.entry-D-PjbYaA.js +278 -0
  40. package/dist/cjs/nv-fielddate.entry-DRX2mfZL.js +278 -0
  41. package/dist/cjs/nv-fielddaterange.entry-BrC5jKLp.js +355 -0
  42. package/dist/cjs/nv-fielddaterange.entry-ka3JiDvT.js +355 -0
  43. package/dist/cjs/nv-fielddropdown.entry-DUAKFYgw.js +391 -0
  44. package/dist/cjs/nv-fielddropdown.entry-MsUR1kVe.js +391 -0
  45. package/dist/cjs/nv-fielddropdownitem.entry-BsbvJERH.js +70 -0
  46. package/dist/cjs/nv-fielddropdownitem.entry-DRM-Zljt.js +70 -0
  47. package/dist/cjs/nv-fieldmultiselect.entry-DFr-ZICs.js +1060 -0
  48. package/dist/cjs/nv-fieldmultiselect.entry-Dr8FfT_W.js +1060 -0
  49. package/dist/cjs/nv-fieldnumber.entry-DZsM1vmO.js +126 -0
  50. package/dist/cjs/nv-fieldnumber.entry-ezdDvJh_.js +126 -0
  51. package/dist/cjs/nv-fieldpassword.entry-Biw__M2W.js +115 -0
  52. package/dist/cjs/nv-fieldpassword.entry-D4a8SnGr.js +115 -0
  53. package/dist/cjs/nv-fieldradio.entry-Co7WX2vI.js +102 -0
  54. package/dist/cjs/nv-fieldradio.entry-ZL7KgEZ7.js +102 -0
  55. package/dist/cjs/nv-fieldselect.entry-D6eRsM9T.js +365 -0
  56. package/dist/cjs/nv-fieldselect.entry-sTbv_flF.js +365 -0
  57. package/dist/cjs/nv-fieldtext.entry-DKdxC2cG.js +119 -0
  58. package/dist/cjs/nv-fieldtext.entry-DRPCH6Sf.js +119 -0
  59. package/dist/cjs/nv-fieldtextarea.entry-BwJCUiVW.js +194 -0
  60. package/dist/cjs/nv-fieldtextarea.entry-Dc_TGlmI.js +194 -0
  61. package/dist/cjs/nv-fieldtime.entry-CXRtpWt1.js +1011 -0
  62. package/dist/cjs/nv-fieldtime.entry-uU-IET2k.js +1011 -0
  63. package/dist/cjs/nv-icon.entry-iipuvT3D.js +79 -0
  64. package/dist/cjs/nv-icon.entry-xltjoSa2.js +79 -0
  65. package/dist/cjs/nv-iconbutton_2.entry-BsXvYbCi.js +163 -0
  66. package/dist/cjs/nv-iconbutton_2.entry-Dx4usGkY.js +163 -0
  67. package/dist/cjs/nv-menu.entry-D3qvf_0H.js +227 -0
  68. package/dist/cjs/nv-menu.entry-DFEYw_KZ.js +227 -0
  69. package/dist/cjs/nv-menuitem.entry-3t6TixM7.js +58 -0
  70. package/dist/cjs/nv-menuitem.entry-BeTXOtir.js +58 -0
  71. package/dist/cjs/nv-popover.entry-Bv6kuTK_.js +1960 -0
  72. package/dist/cjs/nv-popover.entry-Zt25YeAv.js +1960 -0
  73. package/dist/cjs/nv-row.entry-BPK1Li7w.js +21 -0
  74. package/dist/cjs/nv-row.entry-Bwzlub3i.js +21 -0
  75. package/dist/cjs/nv-stack.entry-ByaO-0TJ.js +30 -0
  76. package/dist/cjs/nv-stack.entry-bhess4lQ.js +30 -0
  77. package/dist/cjs/nv-table.entry-C7Hd57Iq.js +338 -0
  78. package/dist/cjs/nv-table.entry-D3U4dFcw.js +338 -0
  79. package/dist/cjs/nv-tablecolumn.entry-BDCw_45v.js +18 -0
  80. package/dist/cjs/nv-tablecolumn.entry-BzwWPlLf.js +18 -0
  81. package/dist/cjs/nv-toggle.entry-BTqGH_H0.js +79 -0
  82. package/dist/cjs/nv-toggle.entry-DXpNGkbz.js +79 -0
  83. package/dist/cjs/nv-tooltip.entry-BDZfrLHv.js +44 -0
  84. package/dist/cjs/nv-tooltip.entry-CvCZZV88.js +44 -0
  85. package/dist/cjs/timeline.animation-1b88f052-B8-vCVrY.js +105 -0
  86. package/dist/cjs/v4-a79185f4-2n0dOd_Y.js +56 -0
  87. package/dist/generated/components.js +16 -0
  88. package/dist/types/generated/components.d.ts +19 -3
  89. package/package.json +1 -1
@@ -0,0 +1,194 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-CinzsZ8D.js');
4
+ var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
5
+ var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
6
+ require('react');
7
+
8
+ const nvFieldtextareaCss = "nv-fieldtextarea{--nv-field-border-default:var(--components-form-field-border-default);--nv-field-border-hover:var(--components-form-field-border-hover);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--components-form-field-border-default);--nv-field-border-readonly:var(--components-form-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-brand);--nv-field-background:var(--components-form-field-background-default);display:flex;flex-direction:column;align-items:flex-start;gap:var(--form-gap-y);box-sizing:border-box}nv-fieldtextarea[readonly]:not([readonly=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fieldtextarea[error]:not([error=false]){--nv-field-border-default:var(--components-form-field-border-error);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-destructive)}nv-fieldtextarea[success]:not([success=false]){--nv-field-border-default:var(--components-form-field-border-success);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-success)}nv-fieldtextarea[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:700}nv-fieldtextarea label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:500;line-height:var(--form-label-line-height)}nv-fieldtextarea .textarea-wrapper{display:flex;flex-wrap:wrap;gap:var(--form-gap-x);align-items:stretch;align-self:stretch}nv-fieldtextarea .textarea-wrapper .textarea-container{display:flex;flex-grow:1;padding:calc(var(--form-field-padding-y) - 1px) var(--form-field-padding-x);justify-content:center;align-items:center;gap:var(--form-field-gap);align-self:stretch;border-radius:var(--form-field-radius);border-width:1px;border-style:solid;border-color:var(--nv-field-border-default);opacity:var(--components-form-opacity-default);background:var(--nv-field-background);transition:all 150ms ease-out}nv-fieldtextarea .textarea-wrapper .textarea-container:hover{border-color:var(--nv-field-border-hover)}nv-fieldtextarea .textarea-wrapper .textarea-container:focus-within{border-color:var(--nv-field-border-focus);box-shadow:0 0 0 var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fieldtextarea .textarea-wrapper .textarea-container:has(textarea:read-only){opacity:0.5;background-color:var(--components-form-field-background-readonly);border-color:var(--nv-field-border-readonly)}nv-fieldtextarea .textarea-wrapper .textarea-container:has(textarea:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldtextarea .textarea-wrapper .textarea-container textarea{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);text-overflow:ellipsis;font-size:var(--form-field-font-size);font-style:normal;font-weight:500;line-height:var(--form-field-line-height)}nv-fieldtextarea .textarea-wrapper .textarea-container textarea:focus{outline:none}nv-fieldtextarea .textarea-wrapper .textarea-container textarea::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:400;line-height:var(--form-field-line-height)}nv-fieldtextarea .textarea-wrapper .textarea-container nv-icon.validation{color:var(--nv-field-border-default)}nv-fieldtextarea .description{align-self:stretch;color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height)}nv-fieldtextarea .error-description{align-self:stretch;color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}";
9
+ const NvFieldtextareaStyle0 = nvFieldtextareaCss;
10
+
11
+ const NvFieldtextarea = class {
12
+ constructor(hostRef) {
13
+ index.registerInstance(this, hostRef);
14
+ this.valueChanged = index.createEvent(this, "valueChanged");
15
+ //#endregion DEPRECATED
16
+ /****************************************************************************/
17
+ //#region PROPERTIES
18
+ /**
19
+ * Sets the ID for the input element and the for attribute of the associated
20
+ * label. If no ID is provided, a random one will be automatically generated
21
+ * to ensure unique identification, facilitating proper label association and
22
+ * accessibility.
23
+ */
24
+ this.inputId = v4A79185f4.v4();
25
+ /**
26
+ * The disabled prop lets you turn off the textarea field so that users can’t
27
+ * type in it. When disabled, the field is grayed out and won’t respond to#
28
+ * clicks or touches.
29
+ */
30
+ this.disabled = false;
31
+ /**
32
+ * Display the textarea field’s content without allowing users to change it.
33
+ * Users can still click on it, select, and copy the text, but they won’t be
34
+ * able to type or delete anything.
35
+ */
36
+ this.readonly = false;
37
+ /**
38
+ * Marks the textarea field as required, ensuring that the user must fill it out
39
+ * before submitting the form.
40
+ */
41
+ this.required = false;
42
+ /**
43
+ * Alters the textarea field’s appearance to indicate an error, helping users
44
+ * identify fields that need correction.
45
+ * @validator error
46
+ */
47
+ this.error = false;
48
+ /**
49
+ * Changes the textarea field’s appearance to indicate successful textarea or
50
+ * validation.
51
+ */
52
+ this.success = false;
53
+ /**
54
+ * The number of visible text lines for the control. The default is 3. This
55
+ * can be useful when you want to limit the size of the textarea field or when
56
+ * you want to make the textarea field smaller to fit a specific layout. The
57
+ * textarea field will expand vertically to fit the text as the user types.
58
+ */
59
+ this.rows = 3;
60
+ /**
61
+ * Controls the resize property of a textarea. It can be set to none, both,
62
+ * horizontal, or vertical. The default is vertical.
63
+ */
64
+ this.resize = 'vertical';
65
+ /**
66
+ * Enable this to make the textarea automatically resize as the user types,
67
+ * adjusting the height to fit the content. For the best experience, avoid
68
+ * vertical resizing, as it’s controlled by this feature. Horizontal resizing
69
+ * can still be allowed if desired.
70
+ */
71
+ this.autosize = false;
72
+ /**
73
+ * Applies focus to the input field as soon as the component is mounted. This
74
+ * is equivalent to setting the native autofocus attribute on a <textarea>
75
+ * element.
76
+ */
77
+ this.autofocus = false;
78
+ //#endregion WATCHERS
79
+ /****************************************************************************/
80
+ //#region METHODS
81
+ this.handleTextarea = (event) => {
82
+ const textarea = event.target;
83
+ this.value = textarea.value;
84
+ this.valueChanged.emit(textarea.value);
85
+ };
86
+ this.handleTextareaContainerClick = () => {
87
+ this.textareaElement.focus();
88
+ };
89
+ }
90
+ //#endregion EVENTS
91
+ /****************************************************************************/
92
+ //#region WATCHERS
93
+ /**
94
+ * If autosize is true, we need to make sure to update the min-height when
95
+ * the rows change.
96
+ */
97
+ rowsChanged() {
98
+ if (this.autosize) {
99
+ this.adjustTextareaHeight();
100
+ }
101
+ }
102
+ /**
103
+ * If autosize is true, we need to make sure to update the height and
104
+ * min-height, if false, we need to remove the height property.
105
+ */
106
+ autosizeChanged() {
107
+ var _a;
108
+ if (this.autosize) {
109
+ this.adjustTextareaHeight();
110
+ }
111
+ else {
112
+ (_a = this.textareaElement) === null || _a === void 0 ? void 0 : _a.style.removeProperty('height');
113
+ }
114
+ }
115
+ /**
116
+ * Make sure to adjust the height of the textarea when the value changes
117
+ * programmatically or by typing when autosize is on.
118
+ */
119
+ handleValueChange() {
120
+ if (this.autosize) {
121
+ this.adjustTextareaHeight();
122
+ }
123
+ }
124
+ adjustTextareaHeight() {
125
+ if (this.textareaElement && this.autosize) {
126
+ /**
127
+ * The first requestAnimationFrame ensures that the DOM has applied any
128
+ * pending changes (e.g., value updates or attribute changes) before
129
+ * proceeding to the next frame.
130
+ */
131
+ requestAnimationFrame(() => {
132
+ /**
133
+ * The second requestAnimationFrame ensures that the browser has fully
134
+ * recalculated layout and styles based on the updated DOM, such as
135
+ * recalculating scrollHeight for the textarea after the new value is
136
+ * rendered.
137
+ */
138
+ requestAnimationFrame(() => {
139
+ this.textareaElement.style.height = 'auto';
140
+ const computedStyle = window.getComputedStyle(this.textareaElement);
141
+ const lineHeight = parseFloat(computedStyle.lineHeight);
142
+ const paddingTop = parseFloat(computedStyle.paddingTop);
143
+ const paddingBottom = parseFloat(computedStyle.paddingBottom);
144
+ const borderTopWidth = parseFloat(computedStyle.borderTopWidth);
145
+ const borderBottomWidth = parseFloat(computedStyle.borderBottomWidth);
146
+ // Calculate min-height based on rows
147
+ const minHeight = lineHeight * this.rows +
148
+ paddingTop +
149
+ paddingBottom +
150
+ borderTopWidth +
151
+ borderBottomWidth;
152
+ this.textareaElement.style.minHeight = `${minHeight}px`;
153
+ this.textareaElement.style.height =
154
+ this.textareaElement.scrollHeight + 'px';
155
+ });
156
+ });
157
+ }
158
+ }
159
+ //#endregion METHODS
160
+ /****************************************************************************/
161
+ //#region LIFECYCLE
162
+ componentWillRender() {
163
+ if (this.message) {
164
+ this.description = this.message;
165
+ }
166
+ if (this.validation) {
167
+ this.errorDescription = this.validation;
168
+ this.error = true;
169
+ }
170
+ }
171
+ componentDidLoad() {
172
+ if (this.autosize) {
173
+ this.adjustTextareaHeight();
174
+ }
175
+ }
176
+ //#endregion LIFECYCLE
177
+ /****************************************************************************/
178
+ //#region RENDER
179
+ render() {
180
+ return (index.h(index.Host, { key: '967dc1eda269d0e3df1351d3e34b8be14f9cb639' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '4337acb56fc6712eb0a3e509b2a551043b43eadf', htmlFor: this.inputId }, index.h("slot", { key: 'c7229aad2d78f79fad1f103908976efefe282b01', name: "label" }, this.label))), index.h("div", { key: 'a33155dbb4d6b5d481503225136435690eebf819', class: "textarea-wrapper" }, index.h("div", { key: '14dbd33038acef44773bcf925dcb1fa9531bb6e9', class: "textarea-container", onClick: this.handleTextareaContainerClick }, index.h("textarea", { key: 'eee274bac197d25f99114f95684996e1fa933b57', id: this.inputId, ref: e => (this.textareaElement = e), placeholder: this.placeholder, autofocus: this.autofocus, name: this.name, disabled: this.disabled, readOnly: this.readonly, required: this.required, maxlength: this.maxlength, minlength: this.minlength, autocomplete: "off", value: this.value, onInput: this.handleTextarea, rows: this.rows, class: clsx297c1ffe.clsx(this.resize === 'none' && 'resize-none', this.resize === 'vertical' && 'resize-y', this.resize === 'horizontal' && 'resize-x', this.resize === 'both' && 'resize') }))), (this.description ||
181
+ this.el.querySelector('[slot="description"]')) && (index.h("div", { key: 'f3f214c3a3e3ee03b3ac44d7dcf6224f3d58585d', class: "description" }, index.h("slot", { key: '803bf10aec909ab4c55098818df6bcd3e22a1957', name: "description" }, this.description))), (this.errorDescription ||
182
+ this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: 'aefd1d3ed4ed2535b06cd314ffe0b19506f7510d', hidden: !this.error, class: "error-description" }, index.h("slot", { key: 'e43344938bda4acb4523998e9d21f5b6d8300d1a', name: "error-description" }, this.errorDescription)))));
183
+ }
184
+ static get formAssociated() { return true; }
185
+ get el() { return index.getElement(this); }
186
+ static get watchers() { return {
187
+ "rows": ["rowsChanged"],
188
+ "autosize": ["autosizeChanged"],
189
+ "value": ["handleValueChange"]
190
+ }; }
191
+ };
192
+ NvFieldtextarea.style = NvFieldtextareaStyle0;
193
+
194
+ exports.nv_fieldtextarea = NvFieldtextarea;
@@ -0,0 +1,194 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-C8UfzrMI.js');
4
+ var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
5
+ var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
6
+ require('react');
7
+
8
+ const nvFieldtextareaCss = "nv-fieldtextarea{--nv-field-border-default:var(--components-form-field-border-default);--nv-field-border-hover:var(--components-form-field-border-hover);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--components-form-field-border-default);--nv-field-border-readonly:var(--components-form-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-brand);--nv-field-background:var(--components-form-field-background-default);display:flex;flex-direction:column;align-items:flex-start;gap:var(--form-gap-y);box-sizing:border-box}nv-fieldtextarea[readonly]:not([readonly=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fieldtextarea[error]:not([error=false]){--nv-field-border-default:var(--components-form-field-border-error);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-destructive)}nv-fieldtextarea[success]:not([success=false]){--nv-field-border-default:var(--components-form-field-border-success);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-success)}nv-fieldtextarea[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:700}nv-fieldtextarea label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:500;line-height:var(--form-label-line-height)}nv-fieldtextarea .textarea-wrapper{display:flex;flex-wrap:wrap;gap:var(--form-gap-x);align-items:stretch;align-self:stretch}nv-fieldtextarea .textarea-wrapper .textarea-container{display:flex;flex-grow:1;padding:calc(var(--form-field-padding-y) - 1px) var(--form-field-padding-x);justify-content:center;align-items:center;gap:var(--form-field-gap);align-self:stretch;border-radius:var(--form-field-radius);border-width:1px;border-style:solid;border-color:var(--nv-field-border-default);opacity:var(--components-form-opacity-default);background:var(--nv-field-background);transition:all 150ms ease-out}nv-fieldtextarea .textarea-wrapper .textarea-container:hover{border-color:var(--nv-field-border-hover)}nv-fieldtextarea .textarea-wrapper .textarea-container:focus-within{border-color:var(--nv-field-border-focus);box-shadow:0 0 0 var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fieldtextarea .textarea-wrapper .textarea-container:has(textarea:read-only){opacity:0.5;background-color:var(--components-form-field-background-readonly);border-color:var(--nv-field-border-readonly)}nv-fieldtextarea .textarea-wrapper .textarea-container:has(textarea:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldtextarea .textarea-wrapper .textarea-container textarea{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);text-overflow:ellipsis;font-size:var(--form-field-font-size);font-style:normal;font-weight:500;line-height:var(--form-field-line-height)}nv-fieldtextarea .textarea-wrapper .textarea-container textarea:focus{outline:none}nv-fieldtextarea .textarea-wrapper .textarea-container textarea::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:400;line-height:var(--form-field-line-height)}nv-fieldtextarea .textarea-wrapper .textarea-container nv-icon.validation{color:var(--nv-field-border-default)}nv-fieldtextarea .description{align-self:stretch;color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height)}nv-fieldtextarea .error-description{align-self:stretch;color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}";
9
+ const NvFieldtextareaStyle0 = nvFieldtextareaCss;
10
+
11
+ const NvFieldtextarea = class {
12
+ constructor(hostRef) {
13
+ index.registerInstance(this, hostRef);
14
+ this.valueChanged = index.createEvent(this, "valueChanged");
15
+ //#endregion DEPRECATED
16
+ /****************************************************************************/
17
+ //#region PROPERTIES
18
+ /**
19
+ * Sets the ID for the input element and the for attribute of the associated
20
+ * label. If no ID is provided, a random one will be automatically generated
21
+ * to ensure unique identification, facilitating proper label association and
22
+ * accessibility.
23
+ */
24
+ this.inputId = v4A79185f4.v4();
25
+ /**
26
+ * The disabled prop lets you turn off the textarea field so that users can’t
27
+ * type in it. When disabled, the field is grayed out and won’t respond to#
28
+ * clicks or touches.
29
+ */
30
+ this.disabled = false;
31
+ /**
32
+ * Display the textarea field’s content without allowing users to change it.
33
+ * Users can still click on it, select, and copy the text, but they won’t be
34
+ * able to type or delete anything.
35
+ */
36
+ this.readonly = false;
37
+ /**
38
+ * Marks the textarea field as required, ensuring that the user must fill it out
39
+ * before submitting the form.
40
+ */
41
+ this.required = false;
42
+ /**
43
+ * Alters the textarea field’s appearance to indicate an error, helping users
44
+ * identify fields that need correction.
45
+ * @validator error
46
+ */
47
+ this.error = false;
48
+ /**
49
+ * Changes the textarea field’s appearance to indicate successful textarea or
50
+ * validation.
51
+ */
52
+ this.success = false;
53
+ /**
54
+ * The number of visible text lines for the control. The default is 3. This
55
+ * can be useful when you want to limit the size of the textarea field or when
56
+ * you want to make the textarea field smaller to fit a specific layout. The
57
+ * textarea field will expand vertically to fit the text as the user types.
58
+ */
59
+ this.rows = 3;
60
+ /**
61
+ * Controls the resize property of a textarea. It can be set to none, both,
62
+ * horizontal, or vertical. The default is vertical.
63
+ */
64
+ this.resize = 'vertical';
65
+ /**
66
+ * Enable this to make the textarea automatically resize as the user types,
67
+ * adjusting the height to fit the content. For the best experience, avoid
68
+ * vertical resizing, as it’s controlled by this feature. Horizontal resizing
69
+ * can still be allowed if desired.
70
+ */
71
+ this.autosize = false;
72
+ /**
73
+ * Applies focus to the input field as soon as the component is mounted. This
74
+ * is equivalent to setting the native autofocus attribute on a <textarea>
75
+ * element.
76
+ */
77
+ this.autofocus = false;
78
+ //#endregion WATCHERS
79
+ /****************************************************************************/
80
+ //#region METHODS
81
+ this.handleTextarea = (event) => {
82
+ const textarea = event.target;
83
+ this.value = textarea.value;
84
+ this.valueChanged.emit(textarea.value);
85
+ };
86
+ this.handleTextareaContainerClick = () => {
87
+ this.textareaElement.focus();
88
+ };
89
+ }
90
+ //#endregion EVENTS
91
+ /****************************************************************************/
92
+ //#region WATCHERS
93
+ /**
94
+ * If autosize is true, we need to make sure to update the min-height when
95
+ * the rows change.
96
+ */
97
+ rowsChanged() {
98
+ if (this.autosize) {
99
+ this.adjustTextareaHeight();
100
+ }
101
+ }
102
+ /**
103
+ * If autosize is true, we need to make sure to update the height and
104
+ * min-height, if false, we need to remove the height property.
105
+ */
106
+ autosizeChanged() {
107
+ var _a;
108
+ if (this.autosize) {
109
+ this.adjustTextareaHeight();
110
+ }
111
+ else {
112
+ (_a = this.textareaElement) === null || _a === void 0 ? void 0 : _a.style.removeProperty('height');
113
+ }
114
+ }
115
+ /**
116
+ * Make sure to adjust the height of the textarea when the value changes
117
+ * programmatically or by typing when autosize is on.
118
+ */
119
+ handleValueChange() {
120
+ if (this.autosize) {
121
+ this.adjustTextareaHeight();
122
+ }
123
+ }
124
+ adjustTextareaHeight() {
125
+ if (this.textareaElement && this.autosize) {
126
+ /**
127
+ * The first requestAnimationFrame ensures that the DOM has applied any
128
+ * pending changes (e.g., value updates or attribute changes) before
129
+ * proceeding to the next frame.
130
+ */
131
+ requestAnimationFrame(() => {
132
+ /**
133
+ * The second requestAnimationFrame ensures that the browser has fully
134
+ * recalculated layout and styles based on the updated DOM, such as
135
+ * recalculating scrollHeight for the textarea after the new value is
136
+ * rendered.
137
+ */
138
+ requestAnimationFrame(() => {
139
+ this.textareaElement.style.height = 'auto';
140
+ const computedStyle = window.getComputedStyle(this.textareaElement);
141
+ const lineHeight = parseFloat(computedStyle.lineHeight);
142
+ const paddingTop = parseFloat(computedStyle.paddingTop);
143
+ const paddingBottom = parseFloat(computedStyle.paddingBottom);
144
+ const borderTopWidth = parseFloat(computedStyle.borderTopWidth);
145
+ const borderBottomWidth = parseFloat(computedStyle.borderBottomWidth);
146
+ // Calculate min-height based on rows
147
+ const minHeight = lineHeight * this.rows +
148
+ paddingTop +
149
+ paddingBottom +
150
+ borderTopWidth +
151
+ borderBottomWidth;
152
+ this.textareaElement.style.minHeight = `${minHeight}px`;
153
+ this.textareaElement.style.height =
154
+ this.textareaElement.scrollHeight + 'px';
155
+ });
156
+ });
157
+ }
158
+ }
159
+ //#endregion METHODS
160
+ /****************************************************************************/
161
+ //#region LIFECYCLE
162
+ componentWillRender() {
163
+ if (this.message) {
164
+ this.description = this.message;
165
+ }
166
+ if (this.validation) {
167
+ this.errorDescription = this.validation;
168
+ this.error = true;
169
+ }
170
+ }
171
+ componentDidLoad() {
172
+ if (this.autosize) {
173
+ this.adjustTextareaHeight();
174
+ }
175
+ }
176
+ //#endregion LIFECYCLE
177
+ /****************************************************************************/
178
+ //#region RENDER
179
+ render() {
180
+ return (index.h(index.Host, { key: '4167c4cdd03726b439429616faa39b63881bb019' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '6c533d08a24e989f85421e76b33828e32f4c61dc', htmlFor: this.inputId }, index.h("slot", { key: '49224679ecabbc78da7e83025e024e4510b7646b', name: "label" }, this.label))), index.h("div", { key: '1688bae5f38d7fff8709f84774d8e758d57bc464', class: "textarea-wrapper" }, index.h("div", { key: 'b2c338e20f44e9de7f2fde4a19f4650add0a0bc3', class: "textarea-container", onClick: this.handleTextareaContainerClick }, index.h("textarea", { key: '4f8be0bba0ff3c1bca0ef8dfea368b288cf8f621', id: this.inputId, ref: e => (this.textareaElement = e), placeholder: this.placeholder, autofocus: this.autofocus, name: this.name, disabled: this.disabled, readOnly: this.readonly, required: this.required, maxlength: this.maxlength, minlength: this.minlength, autocomplete: "off", value: this.value, onInput: this.handleTextarea, rows: this.rows, class: clsx297c1ffe.clsx(this.resize === 'none' && 'resize-none', this.resize === 'vertical' && 'resize-y', this.resize === 'horizontal' && 'resize-x', this.resize === 'both' && 'resize') }))), (this.description ||
181
+ this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '7a5a3bef54b5682b0bc47c0431c40032ce27bf9d', class: "description" }, index.h("slot", { key: 'cc61f8f2b146f1776aceb3efde29e4409083d908', name: "description" }, this.description))), (this.errorDescription ||
182
+ this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '5a97f4acfcc6c0b372f99a27aa9ad9bdd8caddd2', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '2857c340bf29495cb49927ea220f2a3e8f0c161c', name: "error-description" }, this.errorDescription)))));
183
+ }
184
+ static get formAssociated() { return true; }
185
+ get el() { return index.getElement(this); }
186
+ static get watchers() { return {
187
+ "rows": ["rowsChanged"],
188
+ "autosize": ["autosizeChanged"],
189
+ "value": ["handleValueChange"]
190
+ }; }
191
+ };
192
+ NvFieldtextarea.style = NvFieldtextareaStyle0;
193
+
194
+ exports.nv_fieldtextarea = NvFieldtextarea;