@nova-design-system/nova-react 3.1.0 → 3.3.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 (50) hide show
  1. package/dist/cjs/{index-Cn-oNJnW.js → index-BlWxX8x6.js} +2199 -1452
  2. package/dist/cjs/index.js +2 -1
  3. package/dist/cjs/{nv-alert.entry-BFwufSUQ.js → nv-alert.entry-BLGSitrm.js} +7 -7
  4. package/dist/cjs/{nv-avatar.entry-Do1K4s3s.js → nv-avatar.entry-CRcLMbEx.js} +7 -7
  5. package/dist/cjs/{nv-badge_2.entry-NTGHyFdg.js → nv-badge_2.entry-BtDAr7_d.js} +1 -1
  6. package/dist/cjs/{nv-breadcrumb.entry-oPVGJYlk.js → nv-breadcrumb.entry-PVDZoF9i.js} +1 -1
  7. package/dist/cjs/{nv-breadcrumbs.entry-BsOw153b.js → nv-breadcrumbs.entry-BY169s5F.js} +1 -1
  8. package/dist/cjs/{nv-button.entry-13tdBiRr.js → nv-button.entry-BpxpxFJP.js} +7 -7
  9. package/dist/cjs/{nv-calendar.entry-u9MgGb83.js → nv-calendar.entry-BobyjFdK.js} +389 -177
  10. package/dist/cjs/{nv-col.entry-DFhv-GI7.js → nv-col.entry-B4BJXJw-.js} +1 -1
  11. package/dist/cjs/{nv-datagrid.entry-BoB17gvI.js → nv-datagrid.entry-D5UVDiYl.js} +100 -108
  12. package/dist/cjs/{nv-datagridcolumn.entry-C3MYBmfS.js → nv-datagridcolumn.entry-dmpcmCIT.js} +2 -2
  13. package/dist/cjs/{nv-dialog.entry-OA3qL3Tx.js → nv-dialog.entry-BYovzkco.js} +3 -3
  14. package/dist/cjs/{nv-dialogfooter_2.entry-LAQYSiGV.js → nv-dialogfooter_2.entry-C9dhLKRM.js} +3 -3
  15. package/dist/cjs/{nv-fieldcheckbox.entry-CP7SDzVO.js → nv-fieldcheckbox.entry-BvFqY2dM.js} +1 -1
  16. package/dist/cjs/nv-fielddate.entry-CSpAcEXW.js +303 -0
  17. package/dist/cjs/nv-fielddaterange.entry-C14o96dd.js +439 -0
  18. package/dist/cjs/{nv-fielddropdown.entry-Nwric1vT.js → nv-fielddropdown.entry-C3VzNRhh.js} +84 -60
  19. package/dist/cjs/{nv-fielddropdownitem.entry-CiqSw5VL.js → nv-fielddropdownitem.entry-D4G4Ytus.js} +1 -1
  20. package/dist/cjs/{nv-fieldmultiselect.entry-QKNIBcW1.js → nv-fieldmultiselect.entry-Ci43ZvzC.js} +116 -104
  21. package/dist/cjs/nv-fieldnumber.entry-nvUi-64H.js +130 -0
  22. package/dist/cjs/nv-fieldpassword.entry-C2uqwDah.js +121 -0
  23. package/dist/cjs/{nv-fieldradio.entry-Dxc6ZCyb.js → nv-fieldradio.entry-DL2GdKqO.js} +1 -1
  24. package/dist/cjs/{nv-fieldselect.entry-Cys0KRyG.js → nv-fieldselect.entry-D4AIRE24.js} +2 -2
  25. package/dist/cjs/nv-fieldslider.entry-BNge4J69.js +665 -0
  26. package/dist/cjs/nv-fieldtext.entry-BI-fdkdX.js +123 -0
  27. package/dist/cjs/nv-fieldtextarea.entry-Ct0g9Qtb.js +198 -0
  28. package/dist/cjs/{nv-fieldtime.entry-BqxiFlLI.js → nv-fieldtime.entry-CmO96Py1.js} +67 -67
  29. package/dist/cjs/nv-icon.entry-TepdQ1jA.js +79 -0
  30. package/dist/cjs/{nv-iconbutton_2.entry-BLNrQz9Q.js → nv-iconbutton_2.entry-B7Xyut9H.js} +3 -3
  31. package/dist/cjs/{nv-menu.entry-7IDfPmZ8.js → nv-menu.entry-DHrRi_37.js} +2 -2
  32. package/dist/cjs/{nv-menuitem.entry-B9cjy7O8.js → nv-menuitem.entry-B_D1pSYa.js} +2 -2
  33. package/dist/cjs/{nv-popover.entry-ChLYZ3zY.js → nv-popover.entry-DyQPEQ4I.js} +2 -2
  34. package/dist/cjs/{nv-row.entry-DiLY8Vbc.js → nv-row.entry-CDTv7ikK.js} +2 -2
  35. package/dist/cjs/{nv-stack.entry-MpPzmg5_.js → nv-stack.entry-A78c6BVf.js} +2 -2
  36. package/dist/cjs/{nv-table.entry-cME3Zuq2.js → nv-table.entry-DkwcfdJM.js} +3 -3
  37. package/dist/cjs/{nv-tablecolumn.entry-DSctDxCS.js → nv-tablecolumn.entry-C8VNSpDf.js} +1 -1
  38. package/dist/cjs/{nv-toggle.entry-EBWm3Xy5.js → nv-toggle.entry-vxSyUDKZ.js} +3 -3
  39. package/dist/cjs/{nv-tooltip.entry-q6rJLq1C.js → nv-tooltip.entry-BQKXRp4d.js} +3 -3
  40. package/dist/generated/components.js +15 -3
  41. package/dist/types/generated/components.d.ts +8 -3
  42. package/package.json +1 -1
  43. package/dist/cjs/nv-fielddate.entry-CD7PX6yA.js +0 -269
  44. package/dist/cjs/nv-fielddaterange.entry-BVBVGmly.js +0 -353
  45. package/dist/cjs/nv-fieldnumber.entry-DfHcI-sO.js +0 -130
  46. package/dist/cjs/nv-fieldpassword.entry-b2pUmS8F.js +0 -121
  47. package/dist/cjs/nv-fieldtext.entry-DCZWLFFp.js +0 -123
  48. package/dist/cjs/nv-fieldtextarea.entry-DEeRdtZ7.js +0 -198
  49. package/dist/cjs/nv-icon.entry-CzEdUDdA.js +0 -79
  50. /package/dist/cjs/{constants-b97e736d-BzFAKCkR.js → constants-4faa1fae-BzFAKCkR.js} +0 -0
@@ -1,353 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-Cn-oNJnW.js');
4
- var inputmaskEdcad3c1 = require('./inputmask-edcad3c1-B9Omti4z.js');
5
- var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
6
- require('react');
7
- require('./_commonjsHelpers-1789f0cf-BJu3ubxk.js');
8
-
9
- const nvFielddaterangeCss = "nv-fielddaterange{--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;max-width:480px}nv-fielddaterange[fluid]:not([fluid=false]){max-width:unset}nv-fielddaterange[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-fielddaterange[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-fielddaterange[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-fielddaterange[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:700}nv-fielddaterange 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-fielddaterange nv-popover{width:100%;display:block}nv-fielddaterange nv-popover [data-scope=popover]{padding:0;background-color:var(--components-list-dropdown-background);border:1px solid var(--components-list-dropdown-border);width:auto}nv-fielddaterange nv-popover [slot=content]{display:block;width:100%}nv-fielddaterange .input-wrapper{display:flex;flex-wrap:wrap;gap:var(--form-gap-x);align-items:stretch;align-self:stretch;display:flex;align-items:center;gap:8px}nv-fielddaterange .input-wrapper .input-container{display:flex;flex-grow:1;justify-content:center;align-items:center;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, 1);background:var(--nv-field-background);transition:all 150ms ease-out}nv-fielddaterange .input-wrapper .input-container:hover{border-color:var(--nv-field-border-hover)}nv-fielddaterange .input-wrapper .input-container:focus-within,nv-fielddaterange .input-wrapper .input-container:focus-within:hover,nv-fielddaterange .input-wrapper .input-container:focus,nv-fielddaterange .input-wrapper .input-container:focus:hover{border-color:var(--nv-field-border-focus);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fielddaterange .input-wrapper .input-container:has(input:read-only){opacity:0.5;background-color:var(--components-form-field-background-readonly);border-color:var(--nv-field-border-readonly)}nv-fielddaterange .input-wrapper .input-container:has(input:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fielddaterange .input-wrapper .input-container input{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);padding:var(--form-field-padding-y) var(--form-field-padding-x);font-size:var(--form-field-font-size);font-style:normal;font-weight:500;line-height:var(--form-field-line-height);width:100%;width:100%}nv-fielddaterange .input-wrapper .input-container input:focus{outline:none}nv-fielddaterange .input-wrapper .input-container input::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-fielddaterange .input-wrapper .input-container>nv-iconbutton{border:0px;border-radius:0px}nv-fielddaterange .input-wrapper .input-container>nv-iconbutton:focus-visible{border-radius:var(--button-md-border-radius);outline-offset:-3px}nv-fielddaterange .input-wrapper .input-container nv-icon.validation{color:var(--nv-field-border-default)}nv-fielddaterange .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-fielddaterange .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)}nv-fielddaterange .range-inputs{display:flex;align-items:center;gap:8px}nv-fielddaterange .range-inputs input{flex:1;border:none;outline:none;padding:0;font-size:var(--form-field-font-size);color:var(--components-form-field-content-text);background:transparent;min-width:0;text-align:center}nv-fielddaterange .range-inputs input::placeholder{color:var(--components-form-field-content-placeholder)}nv-fielddaterange .range-inputs input:disabled{cursor:not-allowed;color:var(--components-form-field-content-text);background-color:var(--components-form-field-background-disabled)}";
10
- const NvFielddaterangeStyle0 = nvFielddaterangeCss;
11
-
12
- const NvFielddaterange = class {
13
- constructor(hostRef) {
14
- index.registerInstance(this, hostRef);
15
- this.dateRangeChange = index.createEvent(this, "dateRangeChange");
16
- this.popoverId = v4A79185f4.v4();
17
- /****************************************************************************/
18
- //#region PROPERTIES
19
- /**
20
- * Sets the ID for the start input element and the for attribute of the associated
21
- * label. If no ID is provided, a random one will be automatically generated.
22
- */
23
- this.startInputId = v4A79185f4.v4();
24
- /**
25
- * Sets the ID for the end input element and the for attribute of the associated
26
- * label. If no ID is provided, a random one will be automatically generated.
27
- */
28
- this.endInputId = v4A79185f4.v4();
29
- /**
30
- * Disables both input fields.
31
- */
32
- this.disabled = false;
33
- /**
34
- * Sets both input fields as read-only.
35
- */
36
- this.readonly = false;
37
- /**
38
- * Marks both input fields as required.
39
- */
40
- this.required = false;
41
- /**
42
- * Indicates an error state.
43
- */
44
- this.error = false;
45
- /**
46
- * Indicates a success state.
47
- */
48
- this.success = false;
49
- /**
50
- * Autofocus the start input when the component is mounted.
51
- */
52
- this.autofocus = false;
53
- /**
54
- * The initial value of the date range (in string format).
55
- */
56
- this.value = '';
57
- /**
58
- * The current value of the start date in string format.
59
- */
60
- this.startValue = '';
61
- /**
62
- * The current value of the end date in string format.
63
- */
64
- this.endValue = '';
65
- /**
66
- * Controls the opening of the popover.
67
- */
68
- this.open = false;
69
- /**
70
- * First day of the week 0 = Sunday, 1 = Monday, etc.
71
- * @default 1
72
- */
73
- this.firstDayOfWeek = 1;
74
- /**
75
- * Number of calendars to display
76
- * @default 2
77
- */
78
- this.numberOfCalendars = 2;
79
- /**
80
- * Minimum date for selection ISO string format, ex: 2025-01-01
81
- */
82
- this.min = '';
83
- /**
84
- * Maximum date for selection ISO string format, ex: 2025-12-31
85
- */
86
- this.max = '';
87
- /** Locale for date formatting
88
- * @default 'en-BE'
89
- */
90
- this.locale = 'en-BE';
91
- /** Date format ex: YYYY-MM-DD, DD-MM-YYYY, etc.
92
- * @default 'YYYY-MM-DD'
93
- */
94
- this.dateFormat = 'YYYY-MM-DD';
95
- /**
96
- * Footer placement
97
- * @default 'bottom'
98
- */
99
- this.shortcutsPlacement = 'bottom';
100
- /**
101
- * Show action buttons
102
- * @default false
103
- */
104
- this.showActions = false;
105
- /**
106
- * Allows the field to stretch and fill the entire width of its container.
107
- */
108
- this.fluid = false;
109
- /**
110
- * Closes the popover when a click is detected outside the component.
111
- * @param {MouseEvent} event - The mouse event
112
- */
113
- this.handleClickOutside = (event) => {
114
- if (this.open && this.el && !this.el.contains(event.target)) {
115
- this.open = false;
116
- }
117
- };
118
- /**
119
- * Handles the input event on the start input element.
120
- * @param {Event} event - The input event
121
- */
122
- this.handleStartInput = (event) => {
123
- if (this.readonly || this.disabled) {
124
- event.preventDefault();
125
- return;
126
- }
127
- const input = event.target;
128
- this.startValue = input.value;
129
- this.dateRangeChange.emit({ start: input.value, end: this.endValue });
130
- this.updateCalendarValue();
131
- };
132
- /**
133
- * Handles the input event on the end input element.
134
- * @param {Event} event - The input event
135
- */
136
- this.handleEndInput = (event) => {
137
- if (this.readonly || this.disabled) {
138
- event.preventDefault();
139
- return;
140
- }
141
- const input = event.target;
142
- this.endValue = input.value;
143
- this.dateRangeChange.emit({ start: this.startValue, end: input.value });
144
- this.updateCalendarValue();
145
- };
146
- /**
147
- * Handles focus events on the input elements.
148
- * @param {FocusEvent} event - The focus event
149
- */
150
- this.handleFocus = (event) => {
151
- if (this.readonly || this.disabled) {
152
- event.preventDefault();
153
- event.target.blur();
154
- return;
155
- }
156
- // Open the popover when an input is focused
157
- this.open = true;
158
- };
159
- /**
160
- * Toggles the opening/closing of the popover.
161
- */
162
- this.toggleCalendar = () => {
163
- if (this.readonly || this.disabled) {
164
- return;
165
- }
166
- this.open = !this.open;
167
- };
168
- }
169
- //#endregion PROPERTIES
170
- /****************************************************************************/
171
- //#region METHODS
172
- /**
173
- * Converts the nv-calendar date format to the format expected by Inputmask.
174
- * @param {string} format - The date format to convert
175
- * @returns {string} The converted format for Inputmask
176
- */
177
- convertToInputmaskFormat(format) {
178
- // If the format is not specified, use the default format YYYY-MM-DD
179
- if (!format) {
180
- return 'dd/mm/yyyy';
181
- }
182
- const formatMap = {
183
- 'YYYY-MM-DD': 'yyyy-mm-dd',
184
- 'DD/MM/YYYY': 'dd/mm/yyyy',
185
- 'MM/DD/YYYY': 'mm/dd/yyyy',
186
- 'DD.MM.YYYY': 'dd.mm.yyyy',
187
- 'YYYYMMDD': 'yyyymmdd',
188
- };
189
- return formatMap[format] || 'dd/mm/yyyy';
190
- }
191
- /**
192
- * Update the calendar's rangeValue property
193
- */
194
- updateCalendarValue() {
195
- const calendar = this.el.querySelector('nv-calendar');
196
- if (calendar && this.startValue && this.endValue) {
197
- calendar.rangeValue = {
198
- start: this.startValue,
199
- end: this.endValue,
200
- };
201
- }
202
- }
203
- //#endregion METHODS
204
- /****************************************************************************/
205
- //#region LIFECYCLE
206
- connectedCallback() {
207
- document.addEventListener('click', this.handleClickOutside);
208
- }
209
- componentWillLoad() {
210
- if (this.value) {
211
- try {
212
- const range = JSON.parse(this.value);
213
- this.startValue = range.start || '';
214
- this.endValue = range.end || '';
215
- }
216
- catch (error) {
217
- console.error('Invalid JSON for value:');
218
- console.error(error);
219
- }
220
- }
221
- }
222
- componentDidLoad() {
223
- const inputs = this.el.querySelectorAll('.input-wrapper input');
224
- inputs.forEach((input) => {
225
- const inputMask = new inputmaskEdcad3c1.Inputmask({
226
- alias: 'datetime',
227
- inputFormat: this.convertToInputmaskFormat(this.dateFormat),
228
- placeholder: '_',
229
- clearIncomplete: false,
230
- showMaskOnHover: false,
231
- showMaskOnFocus: false,
232
- clearMaskOnLostFocus: false,
233
- insertMode: true,
234
- rightAlign: false,
235
- oncomplete: function (e) {
236
- const input = e.target;
237
- const event = new CustomEvent('input', { bubbles: true });
238
- input.dispatchEvent(event);
239
- },
240
- });
241
- inputMask.mask(input);
242
- // Set the value after applying the mask
243
- if (input.name === this.startName && this.startValue) {
244
- requestAnimationFrame(() => {
245
- input.value = this.startValue;
246
- const event = new CustomEvent('input', { bubbles: true });
247
- input.dispatchEvent(event);
248
- });
249
- }
250
- else if (input.name === this.endName && this.endValue) {
251
- requestAnimationFrame(() => {
252
- input.value = this.endValue;
253
- const event = new CustomEvent('input', { bubbles: true });
254
- input.dispatchEvent(event);
255
- });
256
- }
257
- });
258
- }
259
- componentDidRender() {
260
- const inputs = this.el.querySelectorAll('.input-wrapper input');
261
- inputs.forEach((input) => {
262
- const value = input.name === this.startName
263
- ? this.startValue
264
- : this.endName
265
- ? this.endValue
266
- : '';
267
- if (value) {
268
- // Make sure the value is defined both as a property and attribute
269
- requestAnimationFrame(() => {
270
- input.value = value;
271
- input.setAttribute('value', value);
272
- });
273
- }
274
- });
275
- }
276
- disconnectedCallback() {
277
- document.removeEventListener('click', this.handleClickOutside);
278
- }
279
- /**
280
- * Handles the range date selection event from nv-calendar.
281
- * @param {CustomEvent<DateRange>} event - The custom event
282
- */
283
- handleRangeDateChange(event) {
284
- const { start, end } = event.detail || {};
285
- // Check that both dates are defined
286
- if (start && end) {
287
- this.startValue = start;
288
- this.endValue = end;
289
- this.dateRangeChange.emit({
290
- start: this.startValue,
291
- end: this.endValue,
292
- });
293
- if (!this.showActions) {
294
- this.open = false;
295
- }
296
- }
297
- }
298
- handleClosePopover() {
299
- this.open = false;
300
- }
301
- handleApplyDateRange() {
302
- this.open = false;
303
- }
304
- /**
305
- * Handles keyboard events.
306
- * @param {KeyboardEvent} event - The keyboard event
307
- */
308
- handleKeyDown(event) {
309
- if (!this.open) {
310
- if (event.key === 'ArrowDown') {
311
- this.open = true;
312
- event.preventDefault();
313
- return;
314
- }
315
- return;
316
- }
317
- if (!this.popoverElement) {
318
- console.warn('nv-fielddaterange -> Popover element is not defined');
319
- return;
320
- }
321
- }
322
- handleValueChange(newValue) {
323
- try {
324
- const range = JSON.parse(newValue);
325
- this.startValue = range.start || '';
326
- this.endValue = range.end || '';
327
- }
328
- catch (error) {
329
- console.error('Invalid JSON for value:', error);
330
- }
331
- }
332
- //#endregion EVENTS
333
- /****************************************************************************/
334
- //#region RENDER
335
- render() {
336
- return (index.h(index.Host, { key: '9a86c3e67127ffdbfd67bf3d1ed7231ff1953c20' }, ((this.label && this.label.length > 0) ||
337
- this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '2e289da417fe9056d7a411382d8cf7413a2584f7', htmlFor: this.startInputId }, index.h("slot", { key: 'dded9fc8dc9ee2bc37547daf4d72c51ff6fa05b4', name: "label" }, this.label))), index.h("nv-popover", { key: 'a683217e7c21aa85091656f6e88834a6f1ba9d2b', ref: el => (this.popoverElement = el), id: this.popoverId, triggerMode: "controlled", placement: "bottom-start", open: this.open }, index.h("div", { key: '659a3bdc6f008c3b38cdbac18727a2c44d81ca30', slot: "trigger", class: "input-wrapper" }, index.h("slot", { key: '127890f146a8c959fb48b86e05991984c1d48cdb', name: "before-input" }), index.h("div", { key: '244b4809da40407e2fe6b80b51236277deb92233', class: "input-container" }, index.h("slot", { key: '7098d56dc45d7aa20995c412910463485559bc60', name: "leading-input" }), index.h("div", { key: 'dae09fc6e139301d1de4378fbee3e3e98b17ee56', class: "range-inputs" }, index.h("input", { key: '5fd4543e2ce1fbd157d80a8ad1e9ddba2d907b84', id: this.startInputId, type: "text", placeholder: this.startPlaceholder, name: this.startName, disabled: this.disabled, readOnly: this.readonly, required: this.required, autofocus: this.autofocus, value: this.startValue, onInput: this.handleStartInput, onFocus: this.handleFocus, "data-scope": "date-range" }), index.h("svg", { key: '1e8bd37b3cb4a7755ab79603baf359f1710a133e', xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "icon icon-tabler icons-tabler-outline icon-tabler-arrows-move-horizontal" }, index.h("path", { key: 'a2d7c5e4ecd18264625b7a23bee25f079e74bd68', stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), index.h("path", { key: '3aae4cbe301f41b5f4baddf97763c6e25990d8f0', d: "M18 9l3 3l-3 3" }), index.h("path", { key: 'e7d2051a2cfb213943284b1344ab2410367a94cf', d: "M15 12h6" }), index.h("path", { key: '5a010518ec9fa67a9cd57fddfde943e0b1e1bc87', d: "M6 9l-3 3l3 3" }), index.h("path", { key: 'd306b27327ffb3d3e2f56183eff389c5dfab9a74', d: "M3 12h6" })), index.h("input", { key: '21db190063ebbba0952d0a505ed50b30f5990022', id: this.endInputId, type: "text", placeholder: this.endPlaceholder, name: this.endName, disabled: this.disabled, readOnly: this.readonly, required: this.required, value: this.endValue, onInput: this.handleEndInput, onFocus: this.handleFocus, "data-scope": "date-range" })), this.error && (index.h("nv-icon", { key: '9e13cae015f7514fffc1f300417c9b2ce8821834', name: "alert-circle", class: "validation", size: "md" })), this.success && (index.h("nv-icon", { key: '437d6a83af2b88feb9aac140bf5fd24d40fd4737', name: "circle-check", class: "validation", size: "md" })), index.h("nv-iconbutton", { key: '1e601ef8c2fd9017bc2ae7b2a5aee16bcb3f8484', class: "toggle-calendar-icon", name: "calendar", size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide calendar' : 'Show calendar', "aria-pressed": this.open.toString(), onClick: this.toggleCalendar, tabIndex: this.disabled ? -1 : 0 })), index.h("slot", { key: '03f8321ba62c537d6f0ed57a787d637deebc13ad', name: "after-input" })), index.h("div", { key: '02f20014c5ea3220f89e1789330b4b75f14a929e', slot: "content" }, index.h("nv-calendar", { key: '94d69454bdb2d86252ac809bd6d3bbfa38ff5059', dateFormat: this.dateFormat, rangeValue: this.startValue && this.endValue
338
- ? {
339
- start: this.startValue,
340
- end: this.endValue,
341
- }
342
- : null, firstDayOfWeek: this.firstDayOfWeek, numberOfCalendars: this.numberOfCalendars, min: this.min, max: this.max, locale: this.locale, shortcutsPlacement: this.shortcutsPlacement, showActions: this.showActions, shortcuts: this.shortcuts, showWeekNumbers: this.showWeekNumbers, disabledDates: this.disabledDates, selectionType: "range" }))), ((this.description && this.description.length > 0) ||
343
- this.el.querySelector('[slot="description"]')) && (index.h("div", { key: 'af16ac5b05633198fcd91f4ad1513b981ceca4db', class: "description" }, index.h("slot", { key: 'affaa713de178e9d8e8d4e9b210166a9502f5685', name: "description" }, this.description))), (this.errorDescription ||
344
- this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '5dfb1d255607efdb7290ffaace2ce18eedf1f123', hidden: !this.error, class: "error-description" }, this.el.querySelector('[slot="error-description"]') ? (index.h("slot", { name: "error-description" })) : (this.errorDescription))), index.h("slot", { key: '89a4cef668960f0e205916142b6cb192e18cab4c' })));
345
- }
346
- get el() { return index.getElement(this); }
347
- static get watchers() { return {
348
- "value": ["handleValueChange"]
349
- }; }
350
- };
351
- NvFielddaterange.style = NvFielddaterangeStyle0;
352
-
353
- exports.nv_fielddaterange = NvFielddaterange;
@@ -1,130 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-Cn-oNJnW.js');
4
- var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
5
- require('react');
6
-
7
- const nvFieldnumberCss = "nv-fieldnumber {\n --nv-field-border-default: var(--components-form-field-border-default);\n --nv-field-border-hover: var(--components-form-field-border-hover);\n --nv-field-border-focus: var(--components-form-field-border-focus);\n --nv-field-border-disabled: var(--components-form-field-border-default);\n --nv-field-border-readonly: var(--components-form-field-border-default);\n --nv-field-focus-box-shadow: var(--color-focus-brand);\n --nv-field-background: var(--components-form-field-background-default);\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--form-gap-y);\n box-sizing: border-box;\n max-width: 480px;\n}\nnv-fieldnumber[fluid]:not([fluid=false]) {\n max-width: unset;\n}\nnv-fieldnumber[readonly]:not([readonly=false]) {\n --nv-field-border-default: var(--components-form-field-border-readonly);\n --nv-field-border-hover: var(--nv-field-border-default);\n --nv-field-border-focus: var(--components-form-field-border-focus);\n --nv-field-border-disabled: var(--nv-field-border-default);\n --nv-field-border-readonly: var(--nv-field-border-default);\n --nv-field-background: var(--components-form-field-background-readonly);\n}\nnv-fieldnumber[error]:not([error=false]) {\n --nv-field-border-default: var(--components-form-field-border-error);\n --nv-field-border-hover: var(--nv-field-border-default);\n --nv-field-border-focus: var(--nv-field-border-default);\n --nv-field-border-disabled: var(--nv-field-border-default);\n --nv-field-border-readonly: var(--nv-field-border-default);\n --nv-field-focus-box-shadow: var(--color-focus-destructive);\n}\nnv-fieldnumber[success]:not([success=false]) {\n --nv-field-border-default: var(--components-form-field-border-success);\n --nv-field-border-hover: var(--nv-field-border-default);\n --nv-field-border-focus: var(--nv-field-border-default);\n --nv-field-border-disabled: var(--nv-field-border-default);\n --nv-field-border-readonly: var(--nv-field-border-default);\n --nv-field-focus-box-shadow: var(--color-focus-success);\n}\nnv-fieldnumber[required]:not([required=false]) label::after {\n content: \"*\";\n color: var(--components-form-text-required);\n font-weight: 700;\n}\nnv-fieldnumber label {\n display: flex;\n align-items: center;\n gap: var(--form-label-gap);\n align-self: stretch;\n color: var(--components-form-text-label-default);\n font-family: \"TT Norms Pro\", sans-serif;\n font-size: var(--form-label-font-size);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-label-line-height);\n}\nnv-fieldnumber .input-wrapper {\n display: flex;\n flex-wrap: wrap;\n gap: var(--form-gap-x);\n align-items: stretch;\n align-self: stretch;\n}\nnv-fieldnumber .input-wrapper .input-container {\n display: flex;\n flex-grow: 1;\n justify-content: center;\n align-items: center;\n align-self: stretch;\n border-radius: var(--form-field-radius);\n border-width: 1px;\n border-style: solid;\n border-color: var(--nv-field-border-default);\n opacity: var(--components-form-opacity-default, 1);\n background: var(--nv-field-background);\n transition: all 150ms ease-out;\n container-type: inline-size;\n container-name: field-number-input-container;\n overflow: hidden;\n position: relative;\n}\nnv-fieldnumber .input-wrapper .input-container:hover {\n border-color: var(--nv-field-border-hover);\n}\nnv-fieldnumber .input-wrapper .input-container:focus-within, nv-fieldnumber .input-wrapper .input-container:focus-within:hover, nv-fieldnumber .input-wrapper .input-container:focus, nv-fieldnumber .input-wrapper .input-container:focus:hover {\n border-color: var(--nv-field-border-focus);\n box-shadow: 0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow);\n}\nnv-fieldnumber .input-wrapper .input-container:has(input:read-only) {\n opacity: 0.5;\n background-color: var(--components-form-field-background-readonly);\n border-color: var(--nv-field-border-readonly);\n}\nnv-fieldnumber .input-wrapper .input-container:has(input:disabled) {\n opacity: 0.5;\n background-color: var(--components-form-field-background-disabled);\n border-color: var(--nv-field-border-disabled);\n}\nnv-fieldnumber .input-wrapper .input-container input {\n display: flex;\n align-items: center;\n flex: 1 0 0;\n overflow: hidden;\n background-color: transparent;\n color: var(--components-form-field-content-text);\n padding: var(--form-field-padding-y) var(--form-field-padding-x);\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-field-line-height);\n width: 100%;\n width: 100%;\n appearance: textfield;\n}\nnv-fieldnumber .input-wrapper .input-container input:focus {\n outline: none;\n}\nnv-fieldnumber .input-wrapper .input-container input::placeholder {\n overflow: hidden;\n color: var(--components-form-field-content-placeholder);\n text-overflow: ellipsis;\n font-family: \"TT Norms Pro\", sans-serif;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 400;\n line-height: var(--form-field-line-height);\n}\nnv-fieldnumber .input-wrapper .input-container input::-webkit-inner-spin-button, nv-fieldnumber .input-wrapper .input-container input::-webkit-outer-spin-button {\n appearance: none;\n margin: 0;\n}\nnv-fieldnumber .input-wrapper .input-container nv-icon.validation {\n color: var(--nv-field-border-default);\n margin-right: var(--form-field-gap);\n}\nnv-fieldnumber .input-wrapper .input-container > nv-iconbutton {\n border: 0px;\n border-radius: 0px;\n}\nnv-fieldnumber .input-wrapper .input-container > nv-iconbutton:focus-visible {\n border-radius: var(--button-md-border-radius);\n outline-offset: -3px;\n}\nnv-fieldnumber .input-wrapper .input-container .stepper {\n display: flex;\n border-left: var(--notification-border-width-low-emphasis) solid var(--components-form-field-border-readonly);\n}\nnv-fieldnumber .input-wrapper .input-container .stepper > nv-iconbutton {\n border: 0px;\n border-radius: 0px;\n border-radius: 0px;\n}\nnv-fieldnumber .input-wrapper .input-container .stepper > nv-iconbutton:focus-visible {\n border-radius: var(--button-md-border-radius);\n outline-offset: -3px;\n}\n@container field-number-input-container (width < 150px) {\n nv-fieldnumber .input-wrapper .input-container .stepper-spacer {\n display: none;\n }\n nv-fieldnumber .input-wrapper .input-container .stepper {\n display: none;\n }\n}\nnv-fieldnumber .description {\n align-self: stretch;\n color: var(--components-form-text-description-default);\n font-family: \"TT Norms Pro\", sans-serif;\n font-size: var(--form-description-font-size);\n font-style: normal;\n line-height: var(--form-description-line-height);\n}\nnv-fieldnumber .error-description {\n align-self: stretch;\n color: var(--components-form-text-description-default);\n font-family: \"TT Norms Pro\", sans-serif;\n font-size: var(--form-description-font-size);\n font-style: normal;\n line-height: var(--form-description-line-height);\n color: var(--components-form-text-description-error);\n}";
8
- const NvFieldnumberStyle0 = nvFieldnumberCss;
9
-
10
- const NvFieldnumber = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.valueChanged = index.createEvent(this, "valueChanged");
14
- //#endregion DEPRECATED
15
- /****************************************************************************/
16
- //#region PROPERTIES
17
- /**
18
- * Sets the ID for the input element and the for attribute of the associated
19
- * label. If no ID is provided, a random one will be automatically generated
20
- * to ensure unique identification, facilitating proper label association and
21
- * accessibility.
22
- */
23
- this.inputId = v4A79185f4.v4();
24
- /**
25
- * The disabled prop lets you turn off the input field so that users can’t
26
- * type in it. When disabled, the field is grayed out and won’t respond to#
27
- * clicks or touches.
28
- */
29
- this.disabled = false;
30
- /**
31
- * Display the input field’s content without allowing users to change it.
32
- * Users can still click on it, select, and copy the text, but they won’t be
33
- * able to type or delete anything.
34
- */
35
- this.readonly = false;
36
- /**
37
- * Marks the input field as required, ensuring that the user must fill it out
38
- * before submitting the form.
39
- */
40
- this.required = false;
41
- /**
42
- * Alters the input field’s appearance to indicate an error, helping users
43
- * identify fields that need correction.
44
- * @validator error
45
- */
46
- this.error = false;
47
- /**
48
- * Changes the input field’s appearance to indicate successful input or
49
- * validation.
50
- */
51
- this.success = false;
52
- /**
53
- * Define the increment value for the input field. It determines how much the
54
- * value will increase or decrease when the user clicks the stepper buttons.
55
- */
56
- this.step = 1;
57
- /**
58
- * Applies focus to the input field as soon as the component is mounted. This
59
- * is equivalent to setting the native autofocus attribute on an <input>
60
- * element.
61
- */
62
- this.autofocus = false;
63
- /**
64
- * Allows the field to stretch and fill the entire width of its container.
65
- */
66
- this.fluid = false;
67
- //#endregion WATCHERS
68
- /****************************************************************************/
69
- //#region METHODS
70
- this.handleInput = (event) => {
71
- const input = event.target;
72
- this.value = Number(input.value);
73
- };
74
- this.handleInputContainerClick = () => {
75
- this.inputElement.focus();
76
- };
77
- this.handlePlus = () => {
78
- this.inputElement.stepUp();
79
- this.value = Number(this.inputElement.value);
80
- };
81
- this.handleMinus = () => {
82
- this.inputElement.stepDown();
83
- this.value = Number(this.inputElement.value);
84
- };
85
- // prevents text selection when clicking the buttons multiple times
86
- this.preventSelection = (event) => {
87
- event.preventDefault();
88
- };
89
- this.isMinValueReached = () => {
90
- return this.min !== undefined && this.value <= this.min;
91
- };
92
- this.isMaxValueReached = () => {
93
- return this.max !== undefined && this.value >= this.max;
94
- };
95
- }
96
- //#endregion EVENTS
97
- /****************************************************************************/
98
- //#region WATCHERS
99
- watchValueHandler(newValue) {
100
- this.valueChanged.emit(newValue);
101
- }
102
- //#endregion METHODS
103
- /****************************************************************************/
104
- //#region LIFECYCLE
105
- componentWillRender() {
106
- if (this.message) {
107
- this.description = this.message;
108
- }
109
- if (this.validation) {
110
- this.errorDescription = this.validation;
111
- this.error = true;
112
- }
113
- }
114
- //#endregion LIFECYCLE
115
- /****************************************************************************/
116
- //#region RENDER
117
- render() {
118
- return (index.h(index.Host, { key: 'ff097af3b023ea85fe549331219fd147aaf5d587' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'fbb5a460baf515c9f41068126db0dfc80f3aba64', htmlFor: this.inputId }, index.h("slot", { key: '27963c9e2f61213b1897e117a68a2cb0d56e7d0f', name: "label" }, this.label))), index.h("div", { key: 'f1f53b27aabd76cfe478ca0de182fd0d181e1c4b', class: "input-wrapper" }, index.h("slot", { key: 'f5f0fe6e8fbaa63bb961a5216eba0d0a10ca4cf7', name: "before-input" }), index.h("div", { key: '6d615f206e6b0ed3b228c75601fd7608b1aa4869', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: 'd4cbd09db77e7998020289b44d43be1c37c1197a', name: "leading-input" }), index.h("input", { key: 'fa8620fa422b1b96a05630da3f5bed20281b8d19', id: this.inputId, ref: e => (this.inputElement = e), placeholder: this.placeholder, name: this.name, type: "number", autofocus: this.autofocus, required: this.required, max: this.max, min: this.min, step: this.step, value: this.value, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput }), this.error && (index.h("nv-icon", { key: '0787893a02fbebf2bec97f4285d4b396fc1a474d', name: "alert-circle", class: "validation", size: "md" })), this.success && (index.h("nv-icon", { key: 'd2d244b7a2280c3b7719927d6550a28c75743a48', name: "circle-check", class: "validation", size: "md" })), index.h("div", { key: 'ebe05dafe4b7ec67dbe59d5da612f2f5e6951e3f', class: "stepper" }, index.h("nv-iconbutton", { key: '3112ee0b6f5b3982290cd1ec006653d48d3db626', size: "md", name: "minus", emphasis: "lower", onClick: this.handleMinus, disabled: this.isMinValueReached(), onMouseDown: this.preventSelection, tabindex: "-1" }), index.h("nv-iconbutton", { key: 'e3cdf3ca761ebd647e13f23df44c4e18879b8913', size: "md", name: "plus", emphasis: "lower", onClick: this.handlePlus, disabled: this.isMaxValueReached(), onMouseDown: this.preventSelection, tabindex: "-1" }))), index.h("slot", { key: 'c6de7aaff35002e78e5a27d5f37fe06297b3693f', name: "after-input" })), (this.description ||
119
- this.el.querySelector('[slot="description"]')) && (index.h("div", { key: 'e2c1ea1eb866593cee0eb4218dba9665cd8a321c', class: "description" }, index.h("slot", { key: '1fd324333be676116f5d614bb2dc7448ecd7d3a1', name: "description" }, this.description))), (this.errorDescription ||
120
- this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: 'adb8565f5204849caff31758f739d732f2eb5a01', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '0f2ec09a50e98855cc3f2451c75bd6dca4a6baec', name: "error-description" }, this.errorDescription)))));
121
- }
122
- static get formAssociated() { return true; }
123
- get el() { return index.getElement(this); }
124
- static get watchers() { return {
125
- "value": ["watchValueHandler"]
126
- }; }
127
- };
128
- NvFieldnumber.style = NvFieldnumberStyle0;
129
-
130
- exports.nv_fieldnumber = NvFieldnumber;
@@ -1,121 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-Cn-oNJnW.js');
4
- var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
5
- require('react');
6
-
7
- const nvFieldpasswordCss = "nv-fieldpassword{--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;max-width:480px}nv-fieldpassword[fluid]:not([fluid=false]){max-width:unset}nv-fieldpassword[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-fieldpassword[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-fieldpassword[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-fieldpassword[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:700}nv-fieldpassword 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-fieldpassword .input-wrapper{display:flex;flex-wrap:wrap;gap:var(--form-gap-x);align-items:stretch;align-self:stretch}nv-fieldpassword .input-wrapper .input-container{display:flex;flex-grow:1;justify-content:center;align-items:center;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, 1);background:var(--nv-field-background);transition:all 150ms ease-out;position:relative}nv-fieldpassword .input-wrapper .input-container:hover{border-color:var(--nv-field-border-hover)}nv-fieldpassword .input-wrapper .input-container:focus-within,nv-fieldpassword .input-wrapper .input-container:focus-within:hover,nv-fieldpassword .input-wrapper .input-container:focus,nv-fieldpassword .input-wrapper .input-container:focus:hover{border-color:var(--nv-field-border-focus);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fieldpassword .input-wrapper .input-container:has(input:read-only){opacity:0.5;background-color:var(--components-form-field-background-readonly);border-color:var(--nv-field-border-readonly)}nv-fieldpassword .input-wrapper .input-container:has(input:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldpassword .input-wrapper .input-container input{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);padding:var(--form-field-padding-y) var(--form-field-padding-x);font-size:var(--form-field-font-size);font-style:normal;font-weight:500;line-height:var(--form-field-line-height);width:100%}nv-fieldpassword .input-wrapper .input-container input:focus{outline:none}nv-fieldpassword .input-wrapper .input-container input::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-fieldpassword .input-wrapper .input-container>nv-iconbutton{border:0px;border-radius:0px}nv-fieldpassword .input-wrapper .input-container>nv-iconbutton:focus-visible{border-radius:var(--button-md-border-radius);outline-offset:-3px}nv-fieldpassword .input-wrapper .input-container nv-icon.validation{color:var(--nv-field-border-default)}nv-fieldpassword .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-fieldpassword .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)}";
8
- const NvFieldpasswordStyle0 = nvFieldpasswordCss;
9
-
10
- const NvFieldpassword = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.valueChanged = index.createEvent(this, "valueChanged");
14
- /****************************************************************************/
15
- //#region PROPERTIES
16
- /**
17
- * Sets the ID for the input element and the for attribute of the associated
18
- * label. If no ID is provided, a random one will be automatically generated
19
- * to ensure unique identification, facilitating proper label association and
20
- * accessibility.
21
- */
22
- this.inputId = v4A79185f4.v4();
23
- /**
24
- * The disabled prop lets you turn off the input field so that users can’t
25
- * type in it. When disabled, the field is grayed out and won’t respond to#
26
- * clicks or touches.
27
- */
28
- this.disabled = false;
29
- /**
30
- * Display the input field’s content without allowing users to change it.
31
- * Users can still click on it, select, and copy the text, but they won’t be
32
- * able to type or delete anything.
33
- */
34
- this.readonly = false;
35
- /**
36
- * Marks the input field as required, ensuring that the user must fill it out
37
- * before submitting the form.
38
- */
39
- this.required = false;
40
- /**
41
- * Alters the input field’s appearance to indicate an error, helping users
42
- * identify fields that need correction.
43
- * @validator error
44
- */
45
- this.error = false;
46
- /**
47
- * Changes the input field’s appearance to indicate successful input or
48
- * validation.
49
- */
50
- this.success = false;
51
- /**
52
- * Defines the type of the input.
53
- * @default 'text'
54
- */
55
- this.mode = 'text';
56
- /**
57
- * The autocomplete prop helps users fill out the input field faster by
58
- * suggesting entries they’ve used before, like their email or address.
59
- * You can turn it on to make forms more convenient or off to ensure users
60
- * always type in fresh data.
61
- */
62
- this.autocomplete = 'off';
63
- /**
64
- * Hide the button to show/hide the password.
65
- */
66
- this.hidePasswordIcon = false;
67
- /**
68
- * Show/hide the password programmatically.
69
- */
70
- this.showPassword = false;
71
- /**
72
- * Applies focus to the input field as soon as the component is mounted. This
73
- * is equivalent to setting the native autofocus attribute on an <input>
74
- * element.
75
- */
76
- this.autofocus = false;
77
- /**
78
- * Allows the field to stretch and fill the entire width of its container.
79
- */
80
- this.fluid = false;
81
- //#endregion EVENTS
82
- /****************************************************************************/
83
- //#region METHODS
84
- this.handleInputContainerClick = () => {
85
- this.inputElement.focus();
86
- };
87
- this.togglePasswordVisibility = () => {
88
- this.showPasswordState = !this.showPasswordState;
89
- };
90
- this.handleInput = (event) => {
91
- const input = event.target;
92
- this.value = input.value; // Update the input value without worrying about the space
93
- this.valueChanged.emit(input.value);
94
- };
95
- }
96
- handleShowPasswordChange(newValue) {
97
- this.showPasswordState = newValue;
98
- }
99
- //#endregion METHODS
100
- /****************************************************************************/
101
- //#region LIFECYCLE
102
- componentWillLoad() {
103
- this.showPasswordState = this.showPassword;
104
- }
105
- //#endregion LIFECYCLE
106
- /****************************************************************************/
107
- //#region RENDER
108
- render() {
109
- return (index.h(index.Host, { key: '79c3035769b9053d53d62526b2e0d430d5f944ae' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '2341f2b9ae8c5acb8ce48e15caae8a629a1c0333', htmlFor: this.inputId }, index.h("slot", { key: 'ad2301f92adf58c460d4ca76681330b133db2f33', name: "label" }, this.label))), index.h("div", { key: 'c12f8401a41c6761686b74e725dd91911eaafbb0', class: "input-wrapper" }, index.h("slot", { key: 'badd6d65663029bc3252ef0818bb1c6220d01ddf', name: "before-input" }), index.h("div", { key: '0ffb2332657f893c00fe2ca68f4bbbd622bb31f1', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: 'afa1daa6fab0f2a46ab46f0c99e4e4cf10d7a1fe', name: "leading-input" }), index.h("input", { key: 'cc567c4a7fe51a24a99c7a471294d7f6086d8b2d', id: this.inputId, ref: e => (this.inputElement = e), autofocus: this.autofocus, autocomplete: this.autocomplete, placeholder: this.placeholder, name: this.name, type: this.showPasswordState ? 'text' : 'password', inputMode: this.mode, value: this.value, required: this.required, maxlength: this.maxlength, minlength: this.minlength, pattern: this.pattern, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput }), (this.success || this.error) && (index.h("nv-icon", { key: '7087d6e35b30de786f3ded46fc74dc9987af6afa', name: this.success ? 'circle-check' : 'alert-circle', class: "validation", size: "md" })), !this.hidePasswordIcon && (index.h("nv-iconbutton", { key: '6fe5e3936ef42c79ed8a5b8a959a22ecbbe52fd6', name: this.showPasswordState ? 'eye' : 'eye-off', size: "md", emphasis: "lower", onClick: this.togglePasswordVisibility, "aria-label": this.showPasswordState ? 'Hide password' : 'Show password', "aria-pressed": this.showPasswordState.toString() }))), index.h("slot", { key: 'eab04665ad3394860ad30e366eaf18ae4aee445a', name: "after-input" })), (this.description ||
110
- this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '5bc5bd055301bf5fe1b801c2091cd3307c79104f', class: "description" }, index.h("slot", { key: '133ebfcb219aaa0c5fd64e4442c1125b26c623b4', name: "description" }, this.description))), (this.errorDescription ||
111
- this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '2a319732006d29becaa602ae16f2d8e885214931', hidden: !this.error, class: "error-description" }, index.h("slot", { key: 'e6e75fe487745820b1b8d3de1ed52df8aa9652d4', name: "error-description" }, this.errorDescription)))));
112
- }
113
- static get formAssociated() { return true; }
114
- get el() { return index.getElement(this); }
115
- static get watchers() { return {
116
- "showPassword": ["handleShowPasswordChange"]
117
- }; }
118
- };
119
- NvFieldpassword.style = NvFieldpasswordStyle0;
120
-
121
- exports.nv_fieldpassword = NvFieldpassword;