@nova-design-system/nova-react 3.2.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.
- package/dist/cjs/{index-B2jv2KXv.js → index-BlWxX8x6.js} +824 -894
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/{nv-alert.entry-pxBJfmIm.js → nv-alert.entry-BLGSitrm.js} +7 -7
- package/dist/cjs/{nv-avatar.entry-CHtVctSK.js → nv-avatar.entry-CRcLMbEx.js} +7 -7
- package/dist/cjs/{nv-badge_2.entry-BO88KO1O.js → nv-badge_2.entry-BtDAr7_d.js} +1 -1
- package/dist/cjs/{nv-breadcrumb.entry-7azRtyl5.js → nv-breadcrumb.entry-PVDZoF9i.js} +1 -1
- package/dist/cjs/{nv-breadcrumbs.entry-DfZVMKpY.js → nv-breadcrumbs.entry-BY169s5F.js} +1 -1
- package/dist/cjs/{nv-button.entry-DW9SblsY.js → nv-button.entry-BpxpxFJP.js} +7 -7
- package/dist/cjs/{nv-calendar.entry-BeayRRor.js → nv-calendar.entry-BobyjFdK.js} +376 -143
- package/dist/cjs/{nv-col.entry-C6oEkSbI.js → nv-col.entry-B4BJXJw-.js} +1 -1
- package/dist/cjs/{nv-datagrid.entry-xhQP6JJP.js → nv-datagrid.entry-D5UVDiYl.js} +6 -6
- package/dist/cjs/{nv-datagridcolumn.entry-CjYmo4fM.js → nv-datagridcolumn.entry-dmpcmCIT.js} +1 -1
- package/dist/cjs/{nv-dialog.entry-mxETaZbc.js → nv-dialog.entry-BYovzkco.js} +3 -3
- package/dist/cjs/{nv-dialogfooter_2.entry-DnLg2DHy.js → nv-dialogfooter_2.entry-C9dhLKRM.js} +3 -3
- package/dist/cjs/{nv-fieldcheckbox.entry-Be9__i15.js → nv-fieldcheckbox.entry-BvFqY2dM.js} +1 -1
- package/dist/cjs/nv-fielddate.entry-CSpAcEXW.js +303 -0
- package/dist/cjs/nv-fielddaterange.entry-C14o96dd.js +439 -0
- package/dist/cjs/{nv-fielddropdown.entry-BPwviyCp.js → nv-fielddropdown.entry-C3VzNRhh.js} +2 -2
- package/dist/cjs/{nv-fielddropdownitem.entry-BGuUR9KP.js → nv-fielddropdownitem.entry-D4G4Ytus.js} +1 -1
- package/dist/cjs/{nv-fieldmultiselect.entry-Lrxr1gsi.js → nv-fieldmultiselect.entry-Ci43ZvzC.js} +2 -2
- package/dist/cjs/nv-fieldnumber.entry-nvUi-64H.js +130 -0
- package/dist/cjs/nv-fieldpassword.entry-C2uqwDah.js +121 -0
- package/dist/cjs/{nv-fieldradio.entry-CDu8xs0p.js → nv-fieldradio.entry-DL2GdKqO.js} +1 -1
- package/dist/cjs/{nv-fieldselect.entry-NEdv8bQK.js → nv-fieldselect.entry-D4AIRE24.js} +2 -2
- package/dist/cjs/{nv-fieldslider.entry-51gF9XPz.js → nv-fieldslider.entry-BNge4J69.js} +25 -20
- package/dist/cjs/nv-fieldtext.entry-BI-fdkdX.js +123 -0
- package/dist/cjs/{nv-fieldtextarea.entry-D44HbsVQ.js → nv-fieldtextarea.entry-Ct0g9Qtb.js} +2 -2
- package/dist/cjs/{nv-fieldtime.entry-MbaWbVtc.js → nv-fieldtime.entry-CmO96Py1.js} +61 -61
- package/dist/cjs/{nv-icon.entry-BSSHr-ud.js → nv-icon.entry-TepdQ1jA.js} +7 -7
- package/dist/cjs/{nv-iconbutton_2.entry-DMaO-JWz.js → nv-iconbutton_2.entry-B7Xyut9H.js} +1 -1
- package/dist/cjs/{nv-menu.entry-D5_lj9XB.js → nv-menu.entry-DHrRi_37.js} +1 -1
- package/dist/cjs/{nv-menuitem.entry-fhnYI91K.js → nv-menuitem.entry-B_D1pSYa.js} +1 -1
- package/dist/cjs/{nv-popover.entry-CYqBaVbr.js → nv-popover.entry-DyQPEQ4I.js} +1 -1
- package/dist/cjs/{nv-row.entry-BUheLufV.js → nv-row.entry-CDTv7ikK.js} +1 -1
- package/dist/cjs/{nv-stack.entry-DNPce51E.js → nv-stack.entry-A78c6BVf.js} +1 -1
- package/dist/cjs/{nv-table.entry-DXQM8l3t.js → nv-table.entry-DkwcfdJM.js} +1 -1
- package/dist/cjs/{nv-tablecolumn.entry-DROQK_0c.js → nv-tablecolumn.entry-C8VNSpDf.js} +1 -1
- package/dist/cjs/{nv-toggle.entry-fMzTrdte.js → nv-toggle.entry-vxSyUDKZ.js} +1 -1
- package/dist/cjs/{nv-tooltip.entry-yB2Ek1Cz.js → nv-tooltip.entry-BQKXRp4d.js} +1 -1
- package/dist/generated/components.js +7 -3
- package/dist/types/generated/components.d.ts +4 -4
- package/package.json +1 -1
- package/dist/cjs/nv-fielddate.entry-BlNily-X.js +0 -269
- package/dist/cjs/nv-fielddaterange.entry-CycpKoJd.js +0 -408
- package/dist/cjs/nv-fieldnumber.entry-B1VySoWj.js +0 -130
- package/dist/cjs/nv-fieldpassword.entry-D7Qlx7Bh.js +0 -121
- package/dist/cjs/nv-fieldtext.entry-Bug9zMgo.js +0 -123
- /package/dist/cjs/{constants-b97e736d-BzFAKCkR.js → constants-4faa1fae-BzFAKCkR.js} +0 -0
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-B2jv2KXv.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-in-field)}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{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);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{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);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;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-B2jv2KXv.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;max-width:480px}nv-fieldtext[fluid]:not([fluid=false]){max-width:unset}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-in-field)}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>[slot=leading-input]{display:block;margin-left:var(--form-field-padding-x)}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);width:100%}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>.input-wrapper .input-container>[slot=trailing-input]{display:block;margin-right:var(--form-field-padding-x)}nv-fieldtext>.description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);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{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);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
|
-
/**
|
|
72
|
-
* Allows the field to stretch and fill the entire width of its container.
|
|
73
|
-
*/
|
|
74
|
-
this.fluid = false;
|
|
75
|
-
//#endregion EVENTS
|
|
76
|
-
/****************************************************************************/
|
|
77
|
-
//#region METHODS
|
|
78
|
-
/**
|
|
79
|
-
* Handles the input event on the input element.
|
|
80
|
-
* Emits the inputChanged event with the new value.
|
|
81
|
-
* @param {Event} event - Event object of the input event.
|
|
82
|
-
*/
|
|
83
|
-
this.handleInput = (event) => {
|
|
84
|
-
const input = event.target;
|
|
85
|
-
this.value = input.value;
|
|
86
|
-
this.valueChanged.emit(input.value);
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* Handles focus when the input container is clicked.
|
|
90
|
-
*/
|
|
91
|
-
this.handleInputContainerClick = () => {
|
|
92
|
-
this.inputElement.focus();
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
//#endregion METHODS
|
|
96
|
-
/****************************************************************************/
|
|
97
|
-
//#region LIFECYCLE
|
|
98
|
-
componentWillRender() {
|
|
99
|
-
if (this.textInputType) {
|
|
100
|
-
this.type = this.textInputType;
|
|
101
|
-
}
|
|
102
|
-
if (this.message) {
|
|
103
|
-
this.description = this.message;
|
|
104
|
-
}
|
|
105
|
-
if (this.validation) {
|
|
106
|
-
this.errorDescription = this.validation;
|
|
107
|
-
this.error = true;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
//#endregion LIFECYCLE
|
|
111
|
-
/****************************************************************************/
|
|
112
|
-
//#region RENDER
|
|
113
|
-
render() {
|
|
114
|
-
return (index.h(index.Host, { key: '852a919f0fcf19b0b67ddf6b0cc2762fc41c9388' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '3c99f456e76ddbc6ec21d3390aea76f849d72b88', htmlFor: this.inputId }, index.h("slot", { key: '5a11c6f3f0f56b8ab05d0390fec6bd1b15763d02', name: "label" }, this.label))), index.h("div", { key: 'a305c2ffb63cfd66c70d0074fc62c823cce37f8e', class: "input-wrapper" }, index.h("slot", { key: '0efd115ea0805160dee0c4b58ad137be2aabc741', name: "before-input" }), index.h("div", { key: 'ccaaa74adf0df1667bc971eaedb4b9883061851d', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: 'f81025cb44b30e185b3057527cdc2a1662f5252a', name: "leading-input" }), index.h("input", { key: 'a8b2356d0b5372823f3da9f053d0de8e28bf8c08', 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 }), index.h("slot", { key: 'aa531021a4d3db52839c280cda21d06be6deaa79', name: "trailing-input" }), this.error && (index.h("nv-icon", { key: 'fc590ef5879887b2990912b16cc247db875af237', name: "alert-circle", class: "validation", size: "md" })), this.success && (index.h("nv-icon", { key: '68023589dc8340647b1aa5fa07f1b9bda248049d', name: "circle-check", class: "validation", size: "md" }))), index.h("slot", { key: '3d0a53914d87559eab76f4d0b8165ad1d7e4eccf', name: "after-input" })), (this.description ||
|
|
115
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '8641ee0c8638ec43d5a3da0d08ed29991cedfc6a', class: "description" }, index.h("slot", { key: 'fe4ee537f946b69ef9908f1d086046b03c777f90', name: "description" }, this.description))), (this.errorDescription ||
|
|
116
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '865c34d486b86223fbbbc81f22cd3428e4110af8', hidden: !this.error, class: "error-description" }, index.h("slot", { key: 'ac80b543c58bed6db534b8f1571a70aabf811918', name: "error-description" }, this.errorDescription)))));
|
|
117
|
-
}
|
|
118
|
-
static get formAssociated() { return true; }
|
|
119
|
-
get el() { return index.getElement(this); }
|
|
120
|
-
};
|
|
121
|
-
NvFieldtext.style = NvFieldtextStyle0;
|
|
122
|
-
|
|
123
|
-
exports.nv_fieldtext = NvFieldtext;
|
|
File without changes
|