@nova-design-system/nova-react 3.0.0-beta.43 → 3.0.0-beta.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-CinzsZ8D.js → index-S09Gr7Tw.js} +180 -218
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/{nv-alert.entry-BVY_rxey.js → nv-alert.entry-DH8Qd2s2.js} +1 -1
- package/dist/cjs/{nv-avatar.entry-pREKtiv2.js → nv-avatar.entry-B3-elLZC.js} +1 -1
- package/dist/cjs/{nv-badge_2.entry-wDuiCwys.js → nv-badge_2.entry-D15EDzX0.js} +2 -2
- package/dist/cjs/{nv-base.entry-DwtTXK_n.js → nv-base.entry-D-_RUZTX.js} +1 -1
- package/dist/cjs/{nv-breadcrumb.entry-B0hIeE83.js → nv-breadcrumb.entry-DG49Nj1L.js} +2 -2
- package/dist/cjs/{nv-breadcrumbs.entry-Cq0LsIFs.js → nv-breadcrumbs.entry-BqJO5pbN.js} +1 -1
- package/dist/cjs/{nv-button.entry-DaSGnB1L.js → nv-button.entry-CN9kB98T.js} +6 -4
- package/dist/cjs/{nv-calendar.entry-BC6NDsVl.js → nv-calendar.entry-CMEgSU64.js} +6 -6
- package/dist/cjs/{nv-col.entry-DNUY559i.js → nv-col.entry-wcZ9HHAb.js} +1 -1
- package/dist/cjs/{nv-datagrid.entry-Cp8RCSEv.js → nv-datagrid.entry-GCLeN2qT.js} +32 -5
- package/dist/cjs/{nv-datagridcolumn.entry-CR9_1fsZ.js → nv-datagridcolumn.entry-lgIz71UU.js} +1 -1
- package/dist/cjs/{nv-dialog.entry-BjTJ5FFL.js → nv-dialog.entry-DfY0TaYp.js} +17 -13
- package/dist/cjs/{nv-dialogfooter_2.entry-DJkKzEgO.js → nv-dialogfooter_2.entry-OByWsulH.js} +6 -6
- package/dist/cjs/{nv-fieldcheckbox.entry-C0DmeqXD.js → nv-fieldcheckbox.entry-Bqpe9BK3.js} +2 -2
- package/dist/cjs/{nv-fielddate.entry-DRX2mfZL.js → nv-fielddate.entry-DJePv6tR.js} +1 -1
- package/dist/cjs/{nv-fielddaterange.entry-ka3JiDvT.js → nv-fielddaterange.entry--YC750sX.js} +1 -1
- package/dist/cjs/{nv-fielddropdown.entry-DUAKFYgw.js → nv-fielddropdown.entry-BPlTlc_S.js} +45 -75
- package/dist/cjs/{nv-fielddropdownitem.entry-BsbvJERH.js → nv-fielddropdownitem.entry-zwoGySum.js} +7 -9
- package/dist/cjs/{nv-fieldmultiselect.entry-DFr-ZICs.js → nv-fieldmultiselect.entry-Bg_v0LUF.js} +7 -49
- package/dist/cjs/{nv-fieldnumber.entry-ezdDvJh_.js → nv-fieldnumber.entry-BLNaq7yr.js} +1 -1
- package/dist/cjs/{nv-fieldpassword.entry-D4a8SnGr.js → nv-fieldpassword.entry-iSEdS5R8.js} +1 -1
- package/dist/cjs/{nv-fieldradio.entry-Co7WX2vI.js → nv-fieldradio.entry-Dov4vZkh.js} +1 -1
- package/dist/cjs/{nv-fieldselect.entry-sTbv_flF.js → nv-fieldselect.entry-NmpesarX.js} +1 -1
- package/dist/cjs/{nv-fieldtext.entry-DRPCH6Sf.js → nv-fieldtext.entry-r6oQajRS.js} +1 -1
- package/dist/cjs/{nv-fieldtextarea.entry-BwJCUiVW.js → nv-fieldtextarea.entry-CJ2yQkfi.js} +1 -1
- package/dist/cjs/{nv-fieldtime.entry-uU-IET2k.js → nv-fieldtime.entry-Bxoj6N53.js} +1 -1
- package/dist/cjs/nv-icon.entry-CWKRt8F0.js +79 -0
- package/dist/cjs/{nv-iconbutton_2.entry-Dx4usGkY.js → nv-iconbutton_2.entry-CnbscpNn.js} +1 -1
- package/dist/cjs/{nv-menu.entry-D3qvf_0H.js → nv-menu.entry-wC7oSruP.js} +1 -1
- package/dist/cjs/{nv-menuitem.entry-3t6TixM7.js → nv-menuitem.entry-BVSa1vrS.js} +1 -1
- package/dist/cjs/{nv-popover.entry-Bv6kuTK_.js → nv-popover.entry-ChP1we3l.js} +12 -10
- package/dist/cjs/{nv-row.entry-BPK1Li7w.js → nv-row.entry-D6FeFpzG.js} +1 -1
- package/dist/cjs/{nv-stack.entry-ByaO-0TJ.js → nv-stack.entry-zjJmztkO.js} +1 -1
- package/dist/cjs/{nv-table.entry-C7Hd57Iq.js → nv-table.entry-CGX0jsR3.js} +2 -2
- package/dist/cjs/{nv-tablecolumn.entry-BDCw_45v.js → nv-tablecolumn.entry-Cwdmo_RY.js} +1 -1
- package/dist/cjs/{nv-toggle.entry-BTqGH_H0.js → nv-toggle.entry-BvToMkI2.js} +2 -2
- package/dist/cjs/{nv-tooltip.entry-BDZfrLHv.js → nv-tooltip.entry-DZ7_lB-p.js} +2 -2
- package/dist/generated/components.js +3 -3
- package/dist/types/generated/components.d.ts +3 -5
- package/package.json +1 -1
- package/dist/cjs/index-C8UfzrMI.js +0 -26405
- package/dist/cjs/nv-alert.entry-8esWDUyU.js +0 -173
- package/dist/cjs/nv-avatar.entry-CO6bt4k6.js +0 -67
- package/dist/cjs/nv-badge_2.entry-xfXsesV0.js +0 -195
- package/dist/cjs/nv-base.entry-BO-6krwg.js +0 -71
- package/dist/cjs/nv-breadcrumb.entry-DTwjCmMI.js +0 -45
- package/dist/cjs/nv-breadcrumbs.entry-jn5hRjpQ.js +0 -20
- package/dist/cjs/nv-button.entry-DxzA6-My.js +0 -162
- package/dist/cjs/nv-calendar.entry-DKz-iBnp.js +0 -1036
- package/dist/cjs/nv-col.entry-X7jkNThH.js +0 -37
- package/dist/cjs/nv-datagrid.entry-DL-Fyo4l.js +0 -3671
- package/dist/cjs/nv-datagridcolumn.entry-CyTG5E7M.js +0 -18
- package/dist/cjs/nv-dialog.entry-Do_uALC6.js +0 -784
- package/dist/cjs/nv-dialogfooter_2.entry-DJ8qS9q6.js +0 -134
- package/dist/cjs/nv-fieldcheckbox.entry-DoGQX-5D.js +0 -137
- package/dist/cjs/nv-fielddate.entry-D-PjbYaA.js +0 -278
- package/dist/cjs/nv-fielddaterange.entry-BrC5jKLp.js +0 -355
- package/dist/cjs/nv-fielddropdown.entry-MsUR1kVe.js +0 -391
- package/dist/cjs/nv-fielddropdownitem.entry-DRM-Zljt.js +0 -70
- package/dist/cjs/nv-fieldmultiselect.entry-Dr8FfT_W.js +0 -1060
- package/dist/cjs/nv-fieldnumber.entry-DZsM1vmO.js +0 -126
- package/dist/cjs/nv-fieldpassword.entry-Biw__M2W.js +0 -115
- package/dist/cjs/nv-fieldradio.entry-ZL7KgEZ7.js +0 -102
- package/dist/cjs/nv-fieldselect.entry-D6eRsM9T.js +0 -365
- package/dist/cjs/nv-fieldtext.entry-DKdxC2cG.js +0 -119
- package/dist/cjs/nv-fieldtextarea.entry-Dc_TGlmI.js +0 -194
- package/dist/cjs/nv-fieldtime.entry-CXRtpWt1.js +0 -1011
- package/dist/cjs/nv-icon.entry-iipuvT3D.js +0 -79
- package/dist/cjs/nv-icon.entry-xltjoSa2.js +0 -79
- package/dist/cjs/nv-iconbutton_2.entry-BsXvYbCi.js +0 -163
- package/dist/cjs/nv-menu.entry-DFEYw_KZ.js +0 -227
- package/dist/cjs/nv-menuitem.entry-BeTXOtir.js +0 -58
- package/dist/cjs/nv-popover.entry-Zt25YeAv.js +0 -1960
- package/dist/cjs/nv-row.entry-Bwzlub3i.js +0 -21
- package/dist/cjs/nv-stack.entry-bhess4lQ.js +0 -30
- package/dist/cjs/nv-table.entry-D3U4dFcw.js +0 -338
- package/dist/cjs/nv-tablecolumn.entry-BzwWPlLf.js +0 -18
- package/dist/cjs/nv-toggle.entry-DXpNGkbz.js +0 -79
- package/dist/cjs/nv-tooltip.entry-CvCZZV88.js +0 -44
|
@@ -1,365 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-C8UfzrMI.js');
|
|
4
|
-
var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
|
|
5
|
-
require('react');
|
|
6
|
-
|
|
7
|
-
const nvFieldselectCss = "nv-fieldselect{--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-fieldselect[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-fieldselect[display-value]:not([display-value=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-fieldselect[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-fieldselect[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-fieldselect[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:700}nv-fieldselect[multiple]:not([multiple=false]) .select-wrapper>.select-container>.select-icons{top:var(--form-field-padding-y);right:var(--form-field-padding-x)}nv-fieldselect[multiple]:not([multiple=false]) .select-wrapper>.select-container>select{height:100%;box-sizing:border-box}nv-fieldselect 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-fieldselect .select-wrapper{display:flex;flex-wrap:wrap;align-items:stretch;align-self:stretch}nv-fieldselect .select-wrapper .select-container{position:relative;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);background:var(--nv-field-background);transition:all 150ms ease-out}nv-fieldselect .select-wrapper .select-container:hover{border-color:var(--nv-field-border-hover)}nv-fieldselect .select-wrapper .select-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-fieldselect .select-wrapper .select-container:has(select:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldselect .select-wrapper .select-container>.select-icons{position:absolute;right:0;top:0;pointer-events:none}nv-fieldselect .select-wrapper .select-container>.select-icons>nv-iconbutton{border:0px;border-radius:0px}nv-fieldselect .select-wrapper .select-container>.select-icons>nv-iconbutton:focus-visible{border-radius:var(--button-md-border-radius);outline-offset:-3px}nv-fieldselect .select-wrapper .select-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)}nv-fieldselect .select-wrapper .select-container input:focus{outline:none}nv-fieldselect .select-wrapper .select-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-fieldselect .select-wrapper .select-container input:read-only{opacity:0.5;background-color:var(--components-form-field-background-readonly, rgba(0, 0, 0, 0.1));border-color:var(--nv-field-border-readonly)}nv-fieldselect .select-wrapper .select-container select{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;height:var(--form-field-line-height);padding:var(--form-field-padding-y) var(--form-field-padding-x);box-sizing:content-box;-webkit-appearance:none;-moz-appearance:none;cursor:pointer}nv-fieldselect .select-wrapper .select-container select:focus{outline:none}nv-fieldselect .select-wrapper .select-container select::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-fieldselect .select-wrapper .select-container select option{font-size:var(--form-field-font-size, 16px);font-style:normal;font-weight:500;line-height:var(--form-field-line-height, 24px)}nv-fieldselect .select-wrapper .select-container select.hidden{display:none}nv-fieldselect .select-wrapper .select-container nv-icon.readonly-icon{color:var(--nv-field-border-default)}nv-fieldselect .select-wrapper .select-container nv-icon.validation{color:var(--nv-field-border-default)}nv-fieldselect .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-fieldselect .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 NvFieldselectStyle0 = nvFieldselectCss;
|
|
9
|
-
|
|
10
|
-
const NvFieldselect = class {
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
index.registerInstance(this, hostRef);
|
|
13
|
-
this.valueChanged = index.createEvent(this, "valueChanged");
|
|
14
|
-
//#endregion DEPRECATED
|
|
15
|
-
/****************************************************************************/
|
|
16
|
-
//#region STATES
|
|
17
|
-
this.computedDisplayValue = '';
|
|
18
|
-
this.internalReadonly = false;
|
|
19
|
-
/**
|
|
20
|
-
* Parsed options stored internally
|
|
21
|
-
*/
|
|
22
|
-
this.parsedOptions = [];
|
|
23
|
-
//#endregion STATES
|
|
24
|
-
/****************************************************************************/
|
|
25
|
-
//#region PROPERTIES
|
|
26
|
-
/**
|
|
27
|
-
* Sets the ID for the select element and the for attribute of the associated
|
|
28
|
-
* label. If no ID is provided, a random one will be automatically generated
|
|
29
|
-
* to ensure unique identification, facilitating proper label association and
|
|
30
|
-
* accessibility.
|
|
31
|
-
*/
|
|
32
|
-
this.inputId = v4A79185f4.v4();
|
|
33
|
-
/**
|
|
34
|
-
* The disabled prop lets you turn off the select field so that users can’t
|
|
35
|
-
* choose something. When disabled, the field is grayed out and won’t respond to
|
|
36
|
-
* clicks or touches.
|
|
37
|
-
*/
|
|
38
|
-
this.disabled = false;
|
|
39
|
-
/**
|
|
40
|
-
* Display the select field’s content without allowing users to change it.
|
|
41
|
-
* Users can still click on it, select, and copy the text, but they won’t be
|
|
42
|
-
* able to change or delete anything.
|
|
43
|
-
*/
|
|
44
|
-
this.readonly = false;
|
|
45
|
-
/**
|
|
46
|
-
* Marks the select field as required, ensuring that the user must fill it out
|
|
47
|
-
* before submitting the form.
|
|
48
|
-
*/
|
|
49
|
-
this.required = false;
|
|
50
|
-
/**
|
|
51
|
-
* Alters the select field’s appearance to indicate an error, helping users
|
|
52
|
-
* identify fields that need correction.
|
|
53
|
-
* @validator error
|
|
54
|
-
*/
|
|
55
|
-
this.error = false;
|
|
56
|
-
/**
|
|
57
|
-
* Changes the select field’s appearance to indicate successful input or
|
|
58
|
-
* validation.
|
|
59
|
-
*/
|
|
60
|
-
this.success = false;
|
|
61
|
-
/**
|
|
62
|
-
* When enabled, allows the select to handle multiple selections.
|
|
63
|
-
*/
|
|
64
|
-
this.multiple = false;
|
|
65
|
-
/**
|
|
66
|
-
* The value of the select field.
|
|
67
|
-
* - If `multiple` is `false`, it's a single string.
|
|
68
|
-
* - If `multiple` is `true`, it's a comma-separated string of selected values.
|
|
69
|
-
*/
|
|
70
|
-
this.value = '';
|
|
71
|
-
/**
|
|
72
|
-
* When enabled, displays the value element instead of the label when readonly.
|
|
73
|
-
* By default, the label is displayed in readonly mode. Also it automatically
|
|
74
|
-
* sets the component to readonly.
|
|
75
|
-
*/
|
|
76
|
-
this.displayValue = false;
|
|
77
|
-
/**
|
|
78
|
-
* Applies focus to the input field as soon as the component is mounted. This
|
|
79
|
-
* is equivalent to setting the native autofocus attribute on a <select>
|
|
80
|
-
* element.
|
|
81
|
-
*/
|
|
82
|
-
this.autofocus = false;
|
|
83
|
-
//#endregion WATCHERS
|
|
84
|
-
/****************************************************************************/
|
|
85
|
-
//#region METHODS
|
|
86
|
-
/**
|
|
87
|
-
* Handles the change event on the select element. This method is used to
|
|
88
|
-
* update the value property when the selected options change. It is also
|
|
89
|
-
* used to emit the selectChanged event when the selected value changes.
|
|
90
|
-
* @param {Event} event - The change event on the select element.
|
|
91
|
-
* @emits selectChanged
|
|
92
|
-
*/
|
|
93
|
-
this.handleSelectChange = (event) => {
|
|
94
|
-
const select = event.target;
|
|
95
|
-
let selectedValues = Array.from(select.selectedOptions).map(option => option.value);
|
|
96
|
-
if (!this.multiple) {
|
|
97
|
-
selectedValues = selectedValues.slice(0, 1);
|
|
98
|
-
}
|
|
99
|
-
this.value = this.multiple
|
|
100
|
-
? selectedValues.join(', ')
|
|
101
|
-
: selectedValues[0] || '';
|
|
102
|
-
this.valueChanged.emit(this.value);
|
|
103
|
-
// Update form value
|
|
104
|
-
this.setFormValue();
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* Handles focus when the select container is clicked.
|
|
108
|
-
*/
|
|
109
|
-
this.handleSelectContainerClick = () => {
|
|
110
|
-
if (!this.internalReadonly && this.selectElement) {
|
|
111
|
-
this.selectElement.focus();
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
//#endregion EVENTS
|
|
116
|
-
/****************************************************************************/
|
|
117
|
-
//#region WATCHERS
|
|
118
|
-
/**
|
|
119
|
-
* Updates the display value when the value property changes. This watcher is
|
|
120
|
-
* used to update the display value when the selected value changes. This is
|
|
121
|
-
* necessary for readonly select fields to display the selected value.
|
|
122
|
-
* @internal This watcher is not intended to be called outside of the component.
|
|
123
|
-
* @param {string} newValue - The new value of the select field.
|
|
124
|
-
*/
|
|
125
|
-
updateDisplayValueWatcher(newValue) {
|
|
126
|
-
this.updateDisplayValue();
|
|
127
|
-
if (this.selectElement) {
|
|
128
|
-
const selectedValues = newValue.split(',').map(val => val.trim());
|
|
129
|
-
const options = this.selectElement.options;
|
|
130
|
-
if (options) {
|
|
131
|
-
Array.from(options).forEach(option => {
|
|
132
|
-
option.selected = this.multiple
|
|
133
|
-
? selectedValues.includes(option.value)
|
|
134
|
-
: option.value === selectedValues[0];
|
|
135
|
-
});
|
|
136
|
-
if (!this.multiple) {
|
|
137
|
-
this.selectElement.value = newValue; // Only set when not multiple
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
this.selectElement.value = selectedValues[0] || '';
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
// Update form value
|
|
145
|
-
this.setFormValue();
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Watcher for the displayValue prop to ensure internalReadonly is true when displayValue is true.
|
|
149
|
-
* @param {boolean} newValue - The new value of displayValue.
|
|
150
|
-
*/
|
|
151
|
-
handleDisplayValueChange(newValue) {
|
|
152
|
-
this.internalReadonly = newValue; // Set internalReadonly to true if displayValue is true
|
|
153
|
-
if (this.readonly) {
|
|
154
|
-
this.internalReadonly = true;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Watcher for the readonly prop to ensure internalReadonly is true when readonly is true.
|
|
159
|
-
* @param {boolean} newValue - The new value of readonly.
|
|
160
|
-
*/
|
|
161
|
-
handleReadonlyChange(newValue) {
|
|
162
|
-
this.internalReadonly = newValue; // Set internalReadonly to true if displayValue is true
|
|
163
|
-
if (this.displayValue) {
|
|
164
|
-
this.internalReadonly = true;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Parse options and update the internal state
|
|
169
|
-
* @param {string} newValue - The new value of options
|
|
170
|
-
*/
|
|
171
|
-
handleOptionsChange(newValue) {
|
|
172
|
-
if (typeof newValue === 'string') {
|
|
173
|
-
try {
|
|
174
|
-
const parsedOpts = JSON.parse(newValue);
|
|
175
|
-
this.parsedOptions = [...parsedOpts];
|
|
176
|
-
// Update the value if an option is pre-selected
|
|
177
|
-
const selectedOption = parsedOpts.find(opt => opt.selected);
|
|
178
|
-
if (selectedOption) {
|
|
179
|
-
this.value = selectedOption.value;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
catch (error) {
|
|
183
|
-
console.error('Error parsing options:', error);
|
|
184
|
-
this.parsedOptions = [];
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Updates the display value of the select field. This method is used to
|
|
190
|
-
* update the display value when the selected value changes. This is necessary
|
|
191
|
-
* for readonly select fields to display the selected value. This method is
|
|
192
|
-
* called in the componentDidLoad lifecycle hook and the updateDisplayValueWatcher
|
|
193
|
-
* watcher.
|
|
194
|
-
* @internal This method is not intended to be called outside of the component.
|
|
195
|
-
*/
|
|
196
|
-
updateDisplayValue() {
|
|
197
|
-
if (this.internalReadonly && !this.displayValue) {
|
|
198
|
-
if (this.multiple) {
|
|
199
|
-
const selectedLabels = this.value
|
|
200
|
-
.split(',')
|
|
201
|
-
.map(key => key.trim())
|
|
202
|
-
.map(key => this.getLabelFromId(key) || '')
|
|
203
|
-
.filter(label => label !== '');
|
|
204
|
-
this.computedDisplayValue = selectedLabels.join(', ') || '';
|
|
205
|
-
}
|
|
206
|
-
else {
|
|
207
|
-
this.computedDisplayValue = this.getLabelFromId(this.value) || '';
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
else if (this.internalReadonly && this.displayValue) {
|
|
211
|
-
this.computedDisplayValue = this.value || '';
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Retrieves the label from the <option> elements based on the provided key (value).
|
|
216
|
-
* This method uses the id or value attribute directly from the <select> options.
|
|
217
|
-
* @param {string} key - The key (value) for which to find the corresponding label.
|
|
218
|
-
* @returns {string} The label if found; otherwise, an empty string.
|
|
219
|
-
*/
|
|
220
|
-
getLabelFromId(key) {
|
|
221
|
-
this.ensureSelectElement();
|
|
222
|
-
if (!this.selectElement) {
|
|
223
|
-
return '';
|
|
224
|
-
}
|
|
225
|
-
// Cache the option list
|
|
226
|
-
const options = this.selectElement.options;
|
|
227
|
-
if (options) {
|
|
228
|
-
const option = Array.from(options).find(option => option.value === key);
|
|
229
|
-
return option ? option.textContent.trim() || '' : '';
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
-
return '';
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Sets the value of the form element for form submission. This method is
|
|
237
|
-
* called when the selected value changes or when the value property is set.
|
|
238
|
-
* @internal This method is not intended to be called outside of the component.
|
|
239
|
-
*/
|
|
240
|
-
setFormValue() {
|
|
241
|
-
this.internals.setFormValue(this.value);
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Ensures the select element is available. This method is used to ensure
|
|
245
|
-
* the select element is available before attempting to access it.
|
|
246
|
-
* @internal This method is not intended to be called outside of the component.
|
|
247
|
-
*/
|
|
248
|
-
ensureSelectElement() {
|
|
249
|
-
if (!this.selectElement) {
|
|
250
|
-
this.selectElement = this.el.querySelector('select');
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
//#endregion METHODS
|
|
254
|
-
/****************************************************************************/
|
|
255
|
-
//#region LIFECYCLE
|
|
256
|
-
componentWillRender() {
|
|
257
|
-
this.updateDisplayValue(); // Ensure display value is updated before render
|
|
258
|
-
if (this.message) {
|
|
259
|
-
this.description = this.message;
|
|
260
|
-
}
|
|
261
|
-
if (this.validation) {
|
|
262
|
-
this.errorDescription = this.validation;
|
|
263
|
-
this.error = true;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Lifecycle method that is called before the component is rendered. This is
|
|
268
|
-
* where the internal state is set up before rendering occurs.
|
|
269
|
-
*/
|
|
270
|
-
componentWillLoad() {
|
|
271
|
-
// Set internalReadonly based on the readonly prop
|
|
272
|
-
this.internalReadonly = this.readonly;
|
|
273
|
-
// Ensure internalReadonly is true if displayValue is true during loading
|
|
274
|
-
if (this.displayValue) {
|
|
275
|
-
this.internalReadonly = true;
|
|
276
|
-
}
|
|
277
|
-
if ('attachInternals' in this.el) {
|
|
278
|
-
this.internals = this.el.attachInternals();
|
|
279
|
-
}
|
|
280
|
-
else {
|
|
281
|
-
// Fallback logic for browsers without attachInternals support
|
|
282
|
-
this.internals = {
|
|
283
|
-
setFormValue: (value) => {
|
|
284
|
-
const formElement = this.el.closest('form');
|
|
285
|
-
if (formElement) {
|
|
286
|
-
const input = document.createElement('input');
|
|
287
|
-
input.type = 'hidden';
|
|
288
|
-
input.name = this.name;
|
|
289
|
-
input.value = value;
|
|
290
|
-
formElement.appendChild(input);
|
|
291
|
-
}
|
|
292
|
-
},
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
// Initialize value as an empty string if multiple is true
|
|
296
|
-
if (this.multiple && typeof this.value !== 'string') {
|
|
297
|
-
this.value = '';
|
|
298
|
-
}
|
|
299
|
-
// Parse initial options if present
|
|
300
|
-
if (this.options) {
|
|
301
|
-
this.handleOptionsChange(this.options);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Lifecycle method that is called after the component has been rendered.
|
|
306
|
-
* This is where the display value is updated and the initial select element's
|
|
307
|
-
* state is set.
|
|
308
|
-
*/
|
|
309
|
-
componentDidLoad() {
|
|
310
|
-
this.updateDisplayValue();
|
|
311
|
-
if (this.selectElement) {
|
|
312
|
-
// Only set the value for single selection, skip for multiple
|
|
313
|
-
if (!this.multiple) {
|
|
314
|
-
this.selectElement.value = this.value;
|
|
315
|
-
}
|
|
316
|
-
const selectedValues = this.multiple
|
|
317
|
-
? this.value.split(',').map(v => v.trim())
|
|
318
|
-
: [this.value];
|
|
319
|
-
const options = this.selectElement.options;
|
|
320
|
-
if (options) {
|
|
321
|
-
Array.from(options).forEach(option => {
|
|
322
|
-
option.selected = this.multiple
|
|
323
|
-
? selectedValues.includes(option.value)
|
|
324
|
-
: option.value === selectedValues[0];
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
// Handle case where there are no options
|
|
329
|
-
this.selectElement.value = selectedValues[0] || '';
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
// Set the initial form value
|
|
333
|
-
this.setFormValue();
|
|
334
|
-
}
|
|
335
|
-
//#endregion LIFECYCLE
|
|
336
|
-
/****************************************************************************/
|
|
337
|
-
//#region RENDERING
|
|
338
|
-
/**
|
|
339
|
-
* The render method creates the HTML structure for the component, including
|
|
340
|
-
* the label, select element, and any error or description messages. It also
|
|
341
|
-
* applies the appropriate CSS classes based on the readonly state and
|
|
342
|
-
* displayValue prop. This method is called when the component is rendered.
|
|
343
|
-
* @returns {HTMLStencilElement} The HTML element to render.
|
|
344
|
-
*/
|
|
345
|
-
render() {
|
|
346
|
-
return (index.h(index.Host, { key: 'f3614ec629d76c4fb811b4e85ecab7cdca786449' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'f24419d5a235ce0f58f668c15dc1858f5a86b2d5', htmlFor: this.inputId }, index.h("slot", { key: 'af63f2c843e858566ad977479453d0ebf9bc80d9', name: "label" }, this.label))), index.h("div", { key: 'd42269a48811225be663589cb6bf3cb5c1d893ca', class: "select-wrapper" }, index.h("slot", { key: 'c49624918405346061949589c76b59c8962d04b8', name: "before-input" }), index.h("div", { key: '4e32f2c04a9f6bc421959c0b6263cd958ad28bee', class: "select-container", onClick: this.handleSelectContainerClick }, index.h("slot", { key: '77b588a9849025a7bc58ece147d9eab0c201249e', name: "leading-input" }), this.internalReadonly && (index.h("input", { key: '76b07bef102a5ceaa9444b169c7b1fc413d8a20d', id: this.inputId + '-readonly', type: "text", value: this.computedDisplayValue, readonly: true, class: "readonly-input", "aria-readonly": "true", "aria-label": this.label, "aria-describedby": this.error
|
|
347
|
-
? `${this.inputId}-error`
|
|
348
|
-
: `${this.inputId}-description` })), index.h("select", { key: '0a7da256c44c786f0851ba813a3ca00bd0de22bd', id: this.inputId, ref: el => (this.selectElement = el), name: this.name, autofocus: this.autofocus, disabled: this.disabled, required: this.required, multiple: this.multiple, onChange: this.handleSelectChange, class: this.internalReadonly ? 'hidden' : '', "aria-label": this.label, "aria-describedby": this.error
|
|
349
|
-
? `${this.inputId}-error`
|
|
350
|
-
: `${this.inputId}-description` }, this.parsedOptions.length > 0 ? (this.parsedOptions.map(option => (index.h("option", { value: option.value, selected: option.selected, disabled: option.disabled }, option.label)))) : (index.h("slot", null))), index.h("div", { key: '5260bda862cb8c97b57848a45f0c9b4926d32260', class: "select-icons" }, this.error && (index.h("nv-icon", { key: '0e2be13e1bfabe915e9a4948af4f09292c985473', name: "alert-circle", class: "validation", size: "md" })), this.success && (index.h("nv-icon", { key: 'ee2bd6bcd64a3a67bf072fb69724b17793d12001', name: "circle-check", class: "validation", size: "md" })), !this.multiple && (index.h("nv-iconbutton", { key: 'c85a05b727e2d46e6aca1aebeaa7f0d3174d732c', name: "chevron-down", size: "md", emphasis: "lower", tabIndex: -1 })))), index.h("slot", { key: 'c4b62aea98c59eca30d67faef655761e468f02a2', name: "after-input" })), (this.description ||
|
|
351
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '1449f4e20dc8e59549f5770a7257f8f9087d74c9', class: "description", id: `${this.inputId}-description` }, index.h("slot", { key: '11afa3dde4f6e2e3a151f015ab192e03dca4e44e', name: "description" }, this.description))), (this.errorDescription ||
|
|
352
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: 'ddee980cf7a321803290eda163c68de71feaa918', class: "error-description", id: `${this.inputId}-error` }, index.h("slot", { key: 'cee981b78d8fb07bd9f840f3917ba6c59883b6c2', name: "error-description" }, this.errorDescription)))));
|
|
353
|
-
}
|
|
354
|
-
static get formAssociated() { return true; }
|
|
355
|
-
get el() { return index.getElement(this); }
|
|
356
|
-
static get watchers() { return {
|
|
357
|
-
"value": ["updateDisplayValueWatcher"],
|
|
358
|
-
"displayValue": ["handleDisplayValueChange"],
|
|
359
|
-
"readonly": ["handleReadonlyChange"],
|
|
360
|
-
"options": ["handleOptionsChange"]
|
|
361
|
-
}; }
|
|
362
|
-
};
|
|
363
|
-
NvFieldselect.style = NvFieldselectStyle0;
|
|
364
|
-
|
|
365
|
-
exports.nv_fieldselect = NvFieldselect;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-C8UfzrMI.js');
|
|
4
|
-
var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
|
|
5
|
-
require('react');
|
|
6
|
-
|
|
7
|
-
const nvFieldtextCss = "nv-fieldtext{--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-fieldtext[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-fieldtext[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-fieldtext[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-fieldtext[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:700}nv-fieldtext>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-fieldtext>.input-wrapper{display:flex;flex-wrap:wrap;gap:var(--form-gap-x);align-items:stretch;align-self:stretch}nv-fieldtext>.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-fieldtext>.input-wrapper .input-container:hover{border-color:var(--nv-field-border-hover)}nv-fieldtext>.input-wrapper .input-container:focus-within,nv-fieldtext>.input-wrapper .input-container:focus-within:hover,nv-fieldtext>.input-wrapper .input-container:focus,nv-fieldtext>.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-fieldtext>.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-fieldtext>.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-fieldtext>.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)}nv-fieldtext>.input-wrapper .input-container input:focus{outline:none}nv-fieldtext>.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-fieldtext>.input-wrapper .input-container nv-icon.validation{color:var(--nv-field-border-default);margin-right:var(--form-gap-x)}nv-fieldtext>.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-fieldtext>.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 NvFieldtextStyle0 = nvFieldtextCss;
|
|
9
|
-
|
|
10
|
-
const NvFieldtext = 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 type prop lets you specify what kind of information the input field
|
|
26
|
-
* should accept. Choose 'text' for general words or sentences, 'tel' for
|
|
27
|
-
* phone numbers, or 'email' for email addresses. This makes sure users get
|
|
28
|
-
* the right keyboard and validation for what they need to enter.
|
|
29
|
-
*/
|
|
30
|
-
this.type = 'text';
|
|
31
|
-
/**
|
|
32
|
-
* The disabled prop lets you turn off the input field so that users can’t
|
|
33
|
-
* type in it. When disabled, the field is grayed out and won’t respond to
|
|
34
|
-
* clicks or touches.
|
|
35
|
-
*/
|
|
36
|
-
this.disabled = false;
|
|
37
|
-
/**
|
|
38
|
-
* Display the input field’s content without allowing users to change it.
|
|
39
|
-
* Users can still click on it, select, and copy the text, but they won’t be
|
|
40
|
-
* able to type or delete anything.
|
|
41
|
-
*/
|
|
42
|
-
this.readonly = false;
|
|
43
|
-
/**
|
|
44
|
-
* Marks the input field as required, ensuring that the user must fill it out
|
|
45
|
-
* before submitting the form.
|
|
46
|
-
*/
|
|
47
|
-
this.required = false;
|
|
48
|
-
/**
|
|
49
|
-
* Alters the input field’s appearance to indicate an error, helping users
|
|
50
|
-
* identify fields that need correction.
|
|
51
|
-
* @validator error
|
|
52
|
-
*/
|
|
53
|
-
this.error = false;
|
|
54
|
-
/**
|
|
55
|
-
* Changes the input field’s appearance to indicate successful input or
|
|
56
|
-
* validation.
|
|
57
|
-
*/
|
|
58
|
-
this.success = false;
|
|
59
|
-
/**
|
|
60
|
-
* When used with the email input type, this prop enables the field to accept
|
|
61
|
-
* multiple email addresses. Users can enter several addresses, separating
|
|
62
|
-
* each one with a comma, allowing the form to handle multiple recipients.
|
|
63
|
-
*/
|
|
64
|
-
this.multiple = false;
|
|
65
|
-
/**
|
|
66
|
-
* Applies focus to the input field as soon as the component is mounted. This
|
|
67
|
-
* is equivalent to setting the native autofocus attribute on an <input>
|
|
68
|
-
* element.
|
|
69
|
-
*/
|
|
70
|
-
this.autofocus = false;
|
|
71
|
-
//#endregion EVENTS
|
|
72
|
-
/****************************************************************************/
|
|
73
|
-
//#region METHODS
|
|
74
|
-
/**
|
|
75
|
-
* Handles the input event on the input element.
|
|
76
|
-
* Emits the inputChanged event with the new value.
|
|
77
|
-
* @param {Event} event - Event object of the input event.
|
|
78
|
-
*/
|
|
79
|
-
this.handleInput = (event) => {
|
|
80
|
-
const input = event.target;
|
|
81
|
-
this.value = input.value;
|
|
82
|
-
this.valueChanged.emit(input.value);
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* Handles focus when the input container is clicked.
|
|
86
|
-
*/
|
|
87
|
-
this.handleInputContainerClick = () => {
|
|
88
|
-
this.inputElement.focus();
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
//#endregion METHODS
|
|
92
|
-
/****************************************************************************/
|
|
93
|
-
//#region LIFECYCLE
|
|
94
|
-
componentWillRender() {
|
|
95
|
-
if (this.textInputType) {
|
|
96
|
-
this.type = this.textInputType;
|
|
97
|
-
}
|
|
98
|
-
if (this.message) {
|
|
99
|
-
this.description = this.message;
|
|
100
|
-
}
|
|
101
|
-
if (this.validation) {
|
|
102
|
-
this.errorDescription = this.validation;
|
|
103
|
-
this.error = true;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
//#endregion LIFECYCLE
|
|
107
|
-
/****************************************************************************/
|
|
108
|
-
//#region RENDER
|
|
109
|
-
render() {
|
|
110
|
-
return (index.h(index.Host, { key: 'c2087a4b6384599a1cc52b18b8c4f981f9de5368' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'cff1e42c5a60b4a21af73baa86c45f7cc25520cc', htmlFor: this.inputId }, index.h("slot", { key: '2bc682d07f905ecb9e02b12b114fee9e88a8c1dd', name: "label" }, this.label))), index.h("div", { key: '84e4440e2a774d7ea0fa92cc9b70ebb1dc75c001', class: "input-wrapper" }, index.h("slot", { key: 'd35fce40a0bb9927bb734628968b6ccfd0a38fe9', name: "before-input" }), index.h("div", { key: '2e3ef34b8cee6187f5996ba4475266f4db65d93f', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: '0504980d073238202e51eccde3f4d38f133e883e', name: "leading-input" }), index.h("input", { key: '8208b2ac4c2c8181bcac9542e838aa14bf19c897', id: this.inputId, ref: e => (this.inputElement = e), placeholder: this.placeholder, name: this.name, type: this.type, disabled: this.disabled, readOnly: this.readonly, required: this.required, maxlength: this.maxlength, minlength: this.minlength, pattern: this.pattern, autofocus: this.autofocus, autocomplete: this.autocomplete, multiple: this.multiple, value: this.value, onInput: this.handleInput }), this.error && (index.h("nv-icon", { key: 'f1ade80215e39b7fcc1b28ee8b5bd3a075df1f21', name: "alert-circle", class: "validation", size: "md" })), this.success && (index.h("nv-icon", { key: '15c0df99a2cc6033f760ef9966a1d5c75bcbfac3', name: "circle-check", class: "validation", size: "md" }))), index.h("slot", { key: '2374d49838eaed58f9564a7dbb2b7162e828950b', name: "after-input" })), (this.description ||
|
|
111
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: 'f28c3e325fbcca0de0aabb94914d2049d8165bb6', class: "description" }, index.h("slot", { key: 'e4bfe4450070f1b15ff67ccfffaf474f59f0aa3d', name: "description" }, this.description))), (this.errorDescription ||
|
|
112
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '9413a8cd161b7458f6e9d8cb3f0c52128f6861e3', hidden: !this.error, class: "error-description" }, index.h("slot", { key: 'a831645d3c45469e92ec24a8e6c92b7285a0b3f1', name: "error-description" }, this.errorDescription)))));
|
|
113
|
-
}
|
|
114
|
-
static get formAssociated() { return true; }
|
|
115
|
-
get el() { return index.getElement(this); }
|
|
116
|
-
};
|
|
117
|
-
NvFieldtext.style = NvFieldtextStyle0;
|
|
118
|
-
|
|
119
|
-
exports.nv_fieldtext = NvFieldtext;
|