@nova-design-system/nova-react 3.0.0-beta.40 → 3.0.0-beta.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_commonjsHelpers-1789f0cf-BJu3ubxk.js +10 -0
- package/dist/cjs/clsx-297c1ffe-BtxeOLZW.js +5 -0
- package/dist/cjs/constants-98e2dcc2-C0SBCapP.js +250 -0
- package/dist/cjs/dom.utils-ac71e0ef-CmIwRr6O.js +168 -0
- package/dist/cjs/events.utils-fe1d907f-01N__3wY.js +23 -0
- package/dist/cjs/fade.animation-2a077983-aKN0EDTo.js +1832 -0
- package/dist/cjs/index-C8UfzrMI.js +26405 -0
- package/dist/cjs/index-CinzsZ8D.js +26405 -0
- package/dist/cjs/index.js +48 -0
- package/dist/cjs/inputmask-edcad3c1-B9Omti4z.js +3749 -0
- package/dist/cjs/nv-alert.entry-8esWDUyU.js +173 -0
- package/dist/cjs/nv-alert.entry-BVY_rxey.js +173 -0
- package/dist/cjs/nv-avatar.entry-CO6bt4k6.js +67 -0
- package/dist/cjs/nv-avatar.entry-pREKtiv2.js +67 -0
- package/dist/cjs/nv-badge_2.entry-wDuiCwys.js +195 -0
- package/dist/cjs/nv-badge_2.entry-xfXsesV0.js +195 -0
- package/dist/cjs/nv-base.entry-BO-6krwg.js +71 -0
- package/dist/cjs/nv-base.entry-DwtTXK_n.js +71 -0
- package/dist/cjs/nv-breadcrumb.entry-B0hIeE83.js +45 -0
- package/dist/cjs/nv-breadcrumb.entry-DTwjCmMI.js +45 -0
- package/dist/cjs/nv-breadcrumbs.entry-Cq0LsIFs.js +20 -0
- package/dist/cjs/nv-breadcrumbs.entry-jn5hRjpQ.js +20 -0
- package/dist/cjs/nv-button.entry-DaSGnB1L.js +162 -0
- package/dist/cjs/nv-button.entry-DxzA6-My.js +162 -0
- package/dist/cjs/nv-calendar.entry-BC6NDsVl.js +1036 -0
- package/dist/cjs/nv-calendar.entry-DKz-iBnp.js +1036 -0
- package/dist/cjs/nv-col.entry-DNUY559i.js +37 -0
- package/dist/cjs/nv-col.entry-X7jkNThH.js +37 -0
- package/dist/cjs/nv-datagrid.entry-Cp8RCSEv.js +3671 -0
- package/dist/cjs/nv-datagrid.entry-DL-Fyo4l.js +3671 -0
- package/dist/cjs/nv-datagridcolumn.entry-CR9_1fsZ.js +18 -0
- package/dist/cjs/nv-datagridcolumn.entry-CyTG5E7M.js +18 -0
- package/dist/cjs/nv-dialog.entry-BjTJ5FFL.js +784 -0
- package/dist/cjs/nv-dialog.entry-Do_uALC6.js +784 -0
- package/dist/cjs/nv-dialogfooter_2.entry-DJ8qS9q6.js +134 -0
- package/dist/cjs/nv-dialogfooter_2.entry-DJkKzEgO.js +134 -0
- package/dist/cjs/nv-fieldcheckbox.entry-C0DmeqXD.js +137 -0
- package/dist/cjs/nv-fieldcheckbox.entry-DoGQX-5D.js +137 -0
- package/dist/cjs/nv-fielddate.entry-D-PjbYaA.js +278 -0
- package/dist/cjs/nv-fielddate.entry-DRX2mfZL.js +278 -0
- package/dist/cjs/nv-fielddaterange.entry-BrC5jKLp.js +355 -0
- package/dist/cjs/nv-fielddaterange.entry-ka3JiDvT.js +355 -0
- package/dist/cjs/nv-fielddropdown.entry-DUAKFYgw.js +391 -0
- package/dist/cjs/nv-fielddropdown.entry-MsUR1kVe.js +391 -0
- package/dist/cjs/nv-fielddropdownitem.entry-BsbvJERH.js +70 -0
- package/dist/cjs/nv-fielddropdownitem.entry-DRM-Zljt.js +70 -0
- package/dist/cjs/nv-fieldmultiselect.entry-DFr-ZICs.js +1060 -0
- package/dist/cjs/nv-fieldmultiselect.entry-Dr8FfT_W.js +1060 -0
- package/dist/cjs/nv-fieldnumber.entry-DZsM1vmO.js +126 -0
- package/dist/cjs/nv-fieldnumber.entry-ezdDvJh_.js +126 -0
- package/dist/cjs/nv-fieldpassword.entry-Biw__M2W.js +115 -0
- package/dist/cjs/nv-fieldpassword.entry-D4a8SnGr.js +115 -0
- package/dist/cjs/nv-fieldradio.entry-Co7WX2vI.js +102 -0
- package/dist/cjs/nv-fieldradio.entry-ZL7KgEZ7.js +102 -0
- package/dist/cjs/nv-fieldselect.entry-D6eRsM9T.js +365 -0
- package/dist/cjs/nv-fieldselect.entry-sTbv_flF.js +365 -0
- package/dist/cjs/nv-fieldtext.entry-DKdxC2cG.js +119 -0
- package/dist/cjs/nv-fieldtext.entry-DRPCH6Sf.js +119 -0
- package/dist/cjs/nv-fieldtextarea.entry-BwJCUiVW.js +194 -0
- package/dist/cjs/nv-fieldtextarea.entry-Dc_TGlmI.js +194 -0
- package/dist/cjs/nv-fieldtime.entry-CXRtpWt1.js +1011 -0
- package/dist/cjs/nv-fieldtime.entry-uU-IET2k.js +1011 -0
- package/dist/cjs/nv-icon.entry-iipuvT3D.js +79 -0
- package/dist/cjs/nv-icon.entry-xltjoSa2.js +79 -0
- package/dist/cjs/nv-iconbutton_2.entry-BsXvYbCi.js +163 -0
- package/dist/cjs/nv-iconbutton_2.entry-Dx4usGkY.js +163 -0
- package/dist/cjs/nv-menu.entry-D3qvf_0H.js +227 -0
- package/dist/cjs/nv-menu.entry-DFEYw_KZ.js +227 -0
- package/dist/cjs/nv-menuitem.entry-3t6TixM7.js +58 -0
- package/dist/cjs/nv-menuitem.entry-BeTXOtir.js +58 -0
- package/dist/cjs/nv-popover.entry-Bv6kuTK_.js +1960 -0
- package/dist/cjs/nv-popover.entry-Zt25YeAv.js +1960 -0
- package/dist/cjs/nv-row.entry-BPK1Li7w.js +21 -0
- package/dist/cjs/nv-row.entry-Bwzlub3i.js +21 -0
- package/dist/cjs/nv-stack.entry-ByaO-0TJ.js +30 -0
- package/dist/cjs/nv-stack.entry-bhess4lQ.js +30 -0
- package/dist/cjs/nv-table.entry-C7Hd57Iq.js +338 -0
- package/dist/cjs/nv-table.entry-D3U4dFcw.js +338 -0
- package/dist/cjs/nv-tablecolumn.entry-BDCw_45v.js +18 -0
- package/dist/cjs/nv-tablecolumn.entry-BzwWPlLf.js +18 -0
- package/dist/cjs/nv-toggle.entry-BTqGH_H0.js +79 -0
- package/dist/cjs/nv-toggle.entry-DXpNGkbz.js +79 -0
- package/dist/cjs/nv-tooltip.entry-BDZfrLHv.js +44 -0
- package/dist/cjs/nv-tooltip.entry-CvCZZV88.js +44 -0
- package/dist/cjs/timeline.animation-1b88f052-B8-vCVrY.js +105 -0
- package/dist/cjs/v4-a79185f4-2n0dOd_Y.js +56 -0
- package/dist/generated/components.js +16 -0
- package/dist/types/generated/components.d.ts +19 -3
- package/package.json +14 -5
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-C8UfzrMI.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 nvFielddateCss = "nv-fielddate{--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-fielddate[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-fielddate[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-fielddate[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-fielddate[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:700}nv-fielddate 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-fielddate nv-popover{width:100%;display:block}nv-fielddate 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-fielddate nv-popover [slot=content]{display:block;width:100%}nv-fielddate .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-fielddate .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-fielddate .input-wrapper .input-container:hover{border-color:var(--nv-field-border-hover)}nv-fielddate .input-wrapper .input-container:focus-within,nv-fielddate .input-wrapper .input-container:focus-within:hover,nv-fielddate .input-wrapper .input-container:focus,nv-fielddate .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-fielddate .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-fielddate .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-fielddate .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-fielddate .input-wrapper .input-container input:focus{outline:none}nv-fielddate .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-fielddate .input-wrapper .input-container>nv-iconbutton{border:0px;border-radius:0px}nv-fielddate .input-wrapper .input-container>nv-iconbutton:focus-visible{border-radius:var(--button-md-border-radius);outline-offset:-3px}nv-fielddate .input-wrapper .input-container nv-icon.validation{color:var(--nv-field-border-default)}nv-fielddate .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-fielddate .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)}";
|
|
10
|
+
const NvFielddateStyle0 = nvFielddateCss;
|
|
11
|
+
|
|
12
|
+
const NvFielddate = class {
|
|
13
|
+
constructor(hostRef) {
|
|
14
|
+
index.registerInstance(this, hostRef);
|
|
15
|
+
this.dateChange = index.createEvent(this, "dateChange");
|
|
16
|
+
this.popoverId = v4A79185f4.v4();
|
|
17
|
+
/****************************************************************************/
|
|
18
|
+
//#region PROPERTIES
|
|
19
|
+
/**
|
|
20
|
+
* Sets the ID for the 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.inputId = v4A79185f4.v4();
|
|
24
|
+
/**
|
|
25
|
+
* Disables the input field.
|
|
26
|
+
*/
|
|
27
|
+
this.disabled = false;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the input field as read-only.
|
|
30
|
+
*/
|
|
31
|
+
this.readonly = false;
|
|
32
|
+
/**
|
|
33
|
+
* Marks the input field as required.
|
|
34
|
+
*/
|
|
35
|
+
this.required = false;
|
|
36
|
+
/**
|
|
37
|
+
* Indicates an error state.
|
|
38
|
+
*/
|
|
39
|
+
this.error = false;
|
|
40
|
+
/**
|
|
41
|
+
* Indicates a success state.
|
|
42
|
+
*/
|
|
43
|
+
this.success = false;
|
|
44
|
+
/**
|
|
45
|
+
* Autofocus the input when the component is mounted.
|
|
46
|
+
*/
|
|
47
|
+
this.autofocus = false;
|
|
48
|
+
/**
|
|
49
|
+
* The initial value of the input (date in string format).
|
|
50
|
+
*/
|
|
51
|
+
this.value = '';
|
|
52
|
+
/**
|
|
53
|
+
* The current value of the input date in string format.
|
|
54
|
+
*/
|
|
55
|
+
this.singleValue = '';
|
|
56
|
+
/**
|
|
57
|
+
* Controls the opening of the popover.
|
|
58
|
+
*/
|
|
59
|
+
this.open = false;
|
|
60
|
+
/**
|
|
61
|
+
* First day of the week 0 = Sunday, 1 = Monday, etc.
|
|
62
|
+
* @default 1
|
|
63
|
+
*/
|
|
64
|
+
this.firstDayOfWeek = 1;
|
|
65
|
+
/**
|
|
66
|
+
* Number of calendars to display
|
|
67
|
+
* @default 1
|
|
68
|
+
*/
|
|
69
|
+
this.numberOfCalendars = 1;
|
|
70
|
+
/**
|
|
71
|
+
* Minimum date for selection ISO string format, ex: 2025-01-01
|
|
72
|
+
*/
|
|
73
|
+
this.min = '';
|
|
74
|
+
/**
|
|
75
|
+
* Maximum date for selection ISO string format, ex: 2025-12-31
|
|
76
|
+
*/
|
|
77
|
+
this.max = '';
|
|
78
|
+
/** Locale for date formatting
|
|
79
|
+
* @default 'en-BE'
|
|
80
|
+
*/
|
|
81
|
+
this.locale = 'en-BE';
|
|
82
|
+
/** Date format ex: YYYY-MM-DD, DD-MM-YYYY, etc.
|
|
83
|
+
* @default 'YYYY-MM-DD'
|
|
84
|
+
* @note If the date format is in UTC mode, the date will be displayed in UTC time.
|
|
85
|
+
* @note If the date format is not in UTC mode, the date will be displayed in the local time.
|
|
86
|
+
*/
|
|
87
|
+
this.dateFormat = 'YYYY-MM-DD';
|
|
88
|
+
/**
|
|
89
|
+
* Footer placement
|
|
90
|
+
* @default 'bottom'
|
|
91
|
+
*/
|
|
92
|
+
this.shortcutsPlacement = 'bottom';
|
|
93
|
+
/**
|
|
94
|
+
* Show action buttons
|
|
95
|
+
* @default false
|
|
96
|
+
*/
|
|
97
|
+
this.showActions = false;
|
|
98
|
+
/**
|
|
99
|
+
* Custom actions to display in the footer
|
|
100
|
+
* JSON array of objects with the following properties:
|
|
101
|
+
* - label: string
|
|
102
|
+
* - onClick: function
|
|
103
|
+
* @default '[]'
|
|
104
|
+
*/
|
|
105
|
+
this.shortcuts = '[]';
|
|
106
|
+
/**
|
|
107
|
+
* Disabled dates ISO string array
|
|
108
|
+
* @default '[]'
|
|
109
|
+
*/
|
|
110
|
+
this.disabledDates = '[]';
|
|
111
|
+
/**
|
|
112
|
+
* Closes the popover when a click is detected outside the component.
|
|
113
|
+
* @param {MouseEvent} event - The click event.
|
|
114
|
+
*/
|
|
115
|
+
this.handleClickOutside = (event) => {
|
|
116
|
+
if (this.open && this.el && !this.el.contains(event.target)) {
|
|
117
|
+
this.open = false;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Focuses the input when the input container is clicked.
|
|
122
|
+
* @param {MouseEvent} event - The click event.
|
|
123
|
+
*/
|
|
124
|
+
this.handleInputContainerClick = (event) => {
|
|
125
|
+
if (this.readonly || this.disabled) {
|
|
126
|
+
event.preventDefault();
|
|
127
|
+
event.stopPropagation();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
this.inputElement.focus();
|
|
131
|
+
// Select the first characters based on the date format
|
|
132
|
+
const format = this.dateFormat;
|
|
133
|
+
if (format.startsWith('DD')) {
|
|
134
|
+
this.inputElement.setSelectionRange(0, 2);
|
|
135
|
+
}
|
|
136
|
+
else if (format.startsWith('MM')) {
|
|
137
|
+
this.inputElement.setSelectionRange(0, 2);
|
|
138
|
+
}
|
|
139
|
+
else if (format.startsWith('YYYY')) {
|
|
140
|
+
this.inputElement.setSelectionRange(0, 4);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Handles the input event on the input element.
|
|
145
|
+
* Updates the singleValue and emits the dateChange event.
|
|
146
|
+
* @param {Event} event - The input event.
|
|
147
|
+
*/
|
|
148
|
+
this.handleInput = (event) => {
|
|
149
|
+
if (this.readonly || this.disabled) {
|
|
150
|
+
event.preventDefault();
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const input = event.target;
|
|
154
|
+
this.singleValue = input.value;
|
|
155
|
+
this.dateChange.emit({ value: input.value });
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Toggles the opening/closing of the popover.
|
|
159
|
+
*/
|
|
160
|
+
this.toggleCalendar = () => {
|
|
161
|
+
if (this.readonly || this.disabled) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
this.open = !this.open;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Handles focus events on the input element.
|
|
168
|
+
* @param {FocusEvent} event - The focus event.
|
|
169
|
+
*/
|
|
170
|
+
this.handleFocus = (event) => {
|
|
171
|
+
if (this.readonly || this.disabled) {
|
|
172
|
+
event.preventDefault();
|
|
173
|
+
event.target.blur();
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
//#endregion PROPERTIES
|
|
179
|
+
/****************************************************************************/
|
|
180
|
+
//#region METHODS
|
|
181
|
+
/**
|
|
182
|
+
* Converts the nv-calendar date format to the format expected by Inputmask.
|
|
183
|
+
* @param {string} format - The date format.
|
|
184
|
+
* @returns {string} Format adapted for Inputmask.
|
|
185
|
+
*/
|
|
186
|
+
convertToInputmaskFormat(format) {
|
|
187
|
+
switch (format) {
|
|
188
|
+
case 'DD/MM/YYYY':
|
|
189
|
+
return 'dd/mm/yyyy';
|
|
190
|
+
case 'MM/DD/YYYY':
|
|
191
|
+
return 'mm/dd/yyyy';
|
|
192
|
+
case 'YYYY-MM-DD':
|
|
193
|
+
return 'yyyy-mm-dd';
|
|
194
|
+
case 'DD.MM.YYYY':
|
|
195
|
+
return 'dd.mm.yyyy';
|
|
196
|
+
case 'YYYYMMDD':
|
|
197
|
+
return 'yyyymmdd';
|
|
198
|
+
default:
|
|
199
|
+
return format;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
//#endregion METHODS
|
|
203
|
+
/****************************************************************************/
|
|
204
|
+
//#region LIFECYCLE
|
|
205
|
+
connectedCallback() {
|
|
206
|
+
document.addEventListener('click', this.handleClickOutside);
|
|
207
|
+
}
|
|
208
|
+
componentWillLoad() {
|
|
209
|
+
if (this.value) {
|
|
210
|
+
this.singleValue = this.value;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
componentDidLoad() {
|
|
214
|
+
const inputs = this.el.querySelectorAll('.input-wrapper input');
|
|
215
|
+
inputs.forEach((input) => {
|
|
216
|
+
inputmaskEdcad3c1.Inputmask({
|
|
217
|
+
alias: 'datetime',
|
|
218
|
+
inputFormat: this.convertToInputmaskFormat(this.dateFormat),
|
|
219
|
+
placeholder: '_'.repeat(this.dateFormat.length),
|
|
220
|
+
}).mask(input);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
disconnectedCallback() {
|
|
224
|
+
document.removeEventListener('click', this.handleClickOutside);
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Handles the single date selection event from nv-calendar.
|
|
228
|
+
* Updates the input value and closes the popover.
|
|
229
|
+
* @param {CustomEvent} event - The event from nv-calendar.
|
|
230
|
+
*/
|
|
231
|
+
handleSingleDateChange(event) {
|
|
232
|
+
const value = event.detail;
|
|
233
|
+
this.singleValue = value;
|
|
234
|
+
this.dateChange.emit({ value });
|
|
235
|
+
if (!this.showActions) {
|
|
236
|
+
this.open = false;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
handleClosePopover() {
|
|
240
|
+
this.open = false;
|
|
241
|
+
}
|
|
242
|
+
handleKeyDown(event) {
|
|
243
|
+
if (!this.open) {
|
|
244
|
+
if (event.key === 'ArrowDown') {
|
|
245
|
+
this.open = true;
|
|
246
|
+
event.preventDefault();
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
// Verify if the popover element is defined
|
|
252
|
+
if (!this.popoverElement) {
|
|
253
|
+
console.warn('nv-fielddate -> Popover element is not defined');
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
handleValueChange(newValue) {
|
|
258
|
+
this.singleValue = newValue;
|
|
259
|
+
}
|
|
260
|
+
//#endregion EVENTS
|
|
261
|
+
/****************************************************************************/
|
|
262
|
+
//#region RENDER
|
|
263
|
+
render() {
|
|
264
|
+
return (index.h(index.Host, { key: '7528622493ff8256275d57c31b0f7ce53f67904e' }, ((this.label && this.label.length > 0) ||
|
|
265
|
+
this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '7e3bc0273ba7e6fff6727875d92e8e3983196f32', htmlFor: this.inputId }, index.h("slot", { key: 'f384ada454778fb416001c6bcc883146b7f9a59d', name: "label" }, this.label))), index.h("nv-popover", { key: '65b22631c4f88bc8f3109a591e7d698da693a421', ref: el => (this.popoverElement = el), id: this.popoverId, triggerMode: "controlled", placement: "bottom-start", open: this.open }, index.h("div", { key: '8b1d051e9b381bdb449affba6a885f0e592b9439', slot: "trigger", class: "input-wrapper" }, index.h("slot", { key: 'd6a469cd46cb57e50176cb11c1c7bf96f0d7a776', name: "before-input" }), index.h("div", { key: 'ec11add30aaf6e597fa75ddca2d6fe9a9103ae87', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: 'a75e84bb7fad922ab341fa006d57fc69e75cfdb7', name: "leading-input" }), index.h("input", { key: 'b592011badb9abbeb9b761403559be25ca189ff0', id: this.inputId, ref: e => (this.inputElement = e), placeholder: this.placeholder, name: this.name, disabled: this.disabled, readOnly: this.readonly, required: this.required, autofocus: this.autofocus, value: this.singleValue, onInput: this.handleInput, onFocus: this.handleFocus }), index.h("nv-iconbutton", { key: 'd10e211811b98874bdaf5d1c61a82487f86a9a2d', class: "toggle-calendar-icon", name: "calendar" //{this.open ? 'chevron-top' : 'chevron-down'}
|
|
266
|
+
,
|
|
267
|
+
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: 'bae46e0cded86617977b52a6b304732c51cdcba6', name: "after-input" })), index.h("div", { key: 'd0c619279207a439ca85146d4a333ef0520c2d16', slot: "content" }, index.h("nv-calendar", { key: 'c7f2db2bf06c46cd07ad35a1670652527dea5354', dateFormat: this.dateFormat, singleValue: this.singleValue, 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 }))), ((this.description && this.description.length > 0) ||
|
|
268
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '91f99c0758253ef46a73f995d8f284c27bbf2795', class: "description" }, index.h("slot", { key: 'a6be4e1ce405819981c3fcf710d5fadbd64e87f3', name: "description" }, this.description))), (this.errorDescription ||
|
|
269
|
+
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '8eba4bf20122f3834ba512901c581c2215ebad9d', hidden: !this.error, class: "error-description" }, this.el.querySelector('[slot="error-description"]') ? (index.h("slot", { name: "error-description" })) : (this.errorDescription))), index.h("slot", { key: '76d7e46d6ac178660a931a8251c366b600af6bc1' })));
|
|
270
|
+
}
|
|
271
|
+
get el() { return index.getElement(this); }
|
|
272
|
+
static get watchers() { return {
|
|
273
|
+
"value": ["handleValueChange"]
|
|
274
|
+
}; }
|
|
275
|
+
};
|
|
276
|
+
NvFielddate.style = NvFielddateStyle0;
|
|
277
|
+
|
|
278
|
+
exports.nv_fielddate = NvFielddate;
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CinzsZ8D.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 nvFielddateCss = "nv-fielddate{--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-fielddate[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-fielddate[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-fielddate[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-fielddate[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:700}nv-fielddate 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-fielddate nv-popover{width:100%;display:block}nv-fielddate 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-fielddate nv-popover [slot=content]{display:block;width:100%}nv-fielddate .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-fielddate .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-fielddate .input-wrapper .input-container:hover{border-color:var(--nv-field-border-hover)}nv-fielddate .input-wrapper .input-container:focus-within,nv-fielddate .input-wrapper .input-container:focus-within:hover,nv-fielddate .input-wrapper .input-container:focus,nv-fielddate .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-fielddate .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-fielddate .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-fielddate .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-fielddate .input-wrapper .input-container input:focus{outline:none}nv-fielddate .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-fielddate .input-wrapper .input-container>nv-iconbutton{border:0px;border-radius:0px}nv-fielddate .input-wrapper .input-container>nv-iconbutton:focus-visible{border-radius:var(--button-md-border-radius);outline-offset:-3px}nv-fielddate .input-wrapper .input-container nv-icon.validation{color:var(--nv-field-border-default)}nv-fielddate .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-fielddate .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)}";
|
|
10
|
+
const NvFielddateStyle0 = nvFielddateCss;
|
|
11
|
+
|
|
12
|
+
const NvFielddate = class {
|
|
13
|
+
constructor(hostRef) {
|
|
14
|
+
index.registerInstance(this, hostRef);
|
|
15
|
+
this.dateChange = index.createEvent(this, "dateChange");
|
|
16
|
+
this.popoverId = v4A79185f4.v4();
|
|
17
|
+
/****************************************************************************/
|
|
18
|
+
//#region PROPERTIES
|
|
19
|
+
/**
|
|
20
|
+
* Sets the ID for the 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.inputId = v4A79185f4.v4();
|
|
24
|
+
/**
|
|
25
|
+
* Disables the input field.
|
|
26
|
+
*/
|
|
27
|
+
this.disabled = false;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the input field as read-only.
|
|
30
|
+
*/
|
|
31
|
+
this.readonly = false;
|
|
32
|
+
/**
|
|
33
|
+
* Marks the input field as required.
|
|
34
|
+
*/
|
|
35
|
+
this.required = false;
|
|
36
|
+
/**
|
|
37
|
+
* Indicates an error state.
|
|
38
|
+
*/
|
|
39
|
+
this.error = false;
|
|
40
|
+
/**
|
|
41
|
+
* Indicates a success state.
|
|
42
|
+
*/
|
|
43
|
+
this.success = false;
|
|
44
|
+
/**
|
|
45
|
+
* Autofocus the input when the component is mounted.
|
|
46
|
+
*/
|
|
47
|
+
this.autofocus = false;
|
|
48
|
+
/**
|
|
49
|
+
* The initial value of the input (date in string format).
|
|
50
|
+
*/
|
|
51
|
+
this.value = '';
|
|
52
|
+
/**
|
|
53
|
+
* The current value of the input date in string format.
|
|
54
|
+
*/
|
|
55
|
+
this.singleValue = '';
|
|
56
|
+
/**
|
|
57
|
+
* Controls the opening of the popover.
|
|
58
|
+
*/
|
|
59
|
+
this.open = false;
|
|
60
|
+
/**
|
|
61
|
+
* First day of the week 0 = Sunday, 1 = Monday, etc.
|
|
62
|
+
* @default 1
|
|
63
|
+
*/
|
|
64
|
+
this.firstDayOfWeek = 1;
|
|
65
|
+
/**
|
|
66
|
+
* Number of calendars to display
|
|
67
|
+
* @default 1
|
|
68
|
+
*/
|
|
69
|
+
this.numberOfCalendars = 1;
|
|
70
|
+
/**
|
|
71
|
+
* Minimum date for selection ISO string format, ex: 2025-01-01
|
|
72
|
+
*/
|
|
73
|
+
this.min = '';
|
|
74
|
+
/**
|
|
75
|
+
* Maximum date for selection ISO string format, ex: 2025-12-31
|
|
76
|
+
*/
|
|
77
|
+
this.max = '';
|
|
78
|
+
/** Locale for date formatting
|
|
79
|
+
* @default 'en-BE'
|
|
80
|
+
*/
|
|
81
|
+
this.locale = 'en-BE';
|
|
82
|
+
/** Date format ex: YYYY-MM-DD, DD-MM-YYYY, etc.
|
|
83
|
+
* @default 'YYYY-MM-DD'
|
|
84
|
+
* @note If the date format is in UTC mode, the date will be displayed in UTC time.
|
|
85
|
+
* @note If the date format is not in UTC mode, the date will be displayed in the local time.
|
|
86
|
+
*/
|
|
87
|
+
this.dateFormat = 'YYYY-MM-DD';
|
|
88
|
+
/**
|
|
89
|
+
* Footer placement
|
|
90
|
+
* @default 'bottom'
|
|
91
|
+
*/
|
|
92
|
+
this.shortcutsPlacement = 'bottom';
|
|
93
|
+
/**
|
|
94
|
+
* Show action buttons
|
|
95
|
+
* @default false
|
|
96
|
+
*/
|
|
97
|
+
this.showActions = false;
|
|
98
|
+
/**
|
|
99
|
+
* Custom actions to display in the footer
|
|
100
|
+
* JSON array of objects with the following properties:
|
|
101
|
+
* - label: string
|
|
102
|
+
* - onClick: function
|
|
103
|
+
* @default '[]'
|
|
104
|
+
*/
|
|
105
|
+
this.shortcuts = '[]';
|
|
106
|
+
/**
|
|
107
|
+
* Disabled dates ISO string array
|
|
108
|
+
* @default '[]'
|
|
109
|
+
*/
|
|
110
|
+
this.disabledDates = '[]';
|
|
111
|
+
/**
|
|
112
|
+
* Closes the popover when a click is detected outside the component.
|
|
113
|
+
* @param {MouseEvent} event - The click event.
|
|
114
|
+
*/
|
|
115
|
+
this.handleClickOutside = (event) => {
|
|
116
|
+
if (this.open && this.el && !this.el.contains(event.target)) {
|
|
117
|
+
this.open = false;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Focuses the input when the input container is clicked.
|
|
122
|
+
* @param {MouseEvent} event - The click event.
|
|
123
|
+
*/
|
|
124
|
+
this.handleInputContainerClick = (event) => {
|
|
125
|
+
if (this.readonly || this.disabled) {
|
|
126
|
+
event.preventDefault();
|
|
127
|
+
event.stopPropagation();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
this.inputElement.focus();
|
|
131
|
+
// Select the first characters based on the date format
|
|
132
|
+
const format = this.dateFormat;
|
|
133
|
+
if (format.startsWith('DD')) {
|
|
134
|
+
this.inputElement.setSelectionRange(0, 2);
|
|
135
|
+
}
|
|
136
|
+
else if (format.startsWith('MM')) {
|
|
137
|
+
this.inputElement.setSelectionRange(0, 2);
|
|
138
|
+
}
|
|
139
|
+
else if (format.startsWith('YYYY')) {
|
|
140
|
+
this.inputElement.setSelectionRange(0, 4);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Handles the input event on the input element.
|
|
145
|
+
* Updates the singleValue and emits the dateChange event.
|
|
146
|
+
* @param {Event} event - The input event.
|
|
147
|
+
*/
|
|
148
|
+
this.handleInput = (event) => {
|
|
149
|
+
if (this.readonly || this.disabled) {
|
|
150
|
+
event.preventDefault();
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const input = event.target;
|
|
154
|
+
this.singleValue = input.value;
|
|
155
|
+
this.dateChange.emit({ value: input.value });
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Toggles the opening/closing of the popover.
|
|
159
|
+
*/
|
|
160
|
+
this.toggleCalendar = () => {
|
|
161
|
+
if (this.readonly || this.disabled) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
this.open = !this.open;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Handles focus events on the input element.
|
|
168
|
+
* @param {FocusEvent} event - The focus event.
|
|
169
|
+
*/
|
|
170
|
+
this.handleFocus = (event) => {
|
|
171
|
+
if (this.readonly || this.disabled) {
|
|
172
|
+
event.preventDefault();
|
|
173
|
+
event.target.blur();
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
//#endregion PROPERTIES
|
|
179
|
+
/****************************************************************************/
|
|
180
|
+
//#region METHODS
|
|
181
|
+
/**
|
|
182
|
+
* Converts the nv-calendar date format to the format expected by Inputmask.
|
|
183
|
+
* @param {string} format - The date format.
|
|
184
|
+
* @returns {string} Format adapted for Inputmask.
|
|
185
|
+
*/
|
|
186
|
+
convertToInputmaskFormat(format) {
|
|
187
|
+
switch (format) {
|
|
188
|
+
case 'DD/MM/YYYY':
|
|
189
|
+
return 'dd/mm/yyyy';
|
|
190
|
+
case 'MM/DD/YYYY':
|
|
191
|
+
return 'mm/dd/yyyy';
|
|
192
|
+
case 'YYYY-MM-DD':
|
|
193
|
+
return 'yyyy-mm-dd';
|
|
194
|
+
case 'DD.MM.YYYY':
|
|
195
|
+
return 'dd.mm.yyyy';
|
|
196
|
+
case 'YYYYMMDD':
|
|
197
|
+
return 'yyyymmdd';
|
|
198
|
+
default:
|
|
199
|
+
return format;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
//#endregion METHODS
|
|
203
|
+
/****************************************************************************/
|
|
204
|
+
//#region LIFECYCLE
|
|
205
|
+
connectedCallback() {
|
|
206
|
+
document.addEventListener('click', this.handleClickOutside);
|
|
207
|
+
}
|
|
208
|
+
componentWillLoad() {
|
|
209
|
+
if (this.value) {
|
|
210
|
+
this.singleValue = this.value;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
componentDidLoad() {
|
|
214
|
+
const inputs = this.el.querySelectorAll('.input-wrapper input');
|
|
215
|
+
inputs.forEach((input) => {
|
|
216
|
+
inputmaskEdcad3c1.Inputmask({
|
|
217
|
+
alias: 'datetime',
|
|
218
|
+
inputFormat: this.convertToInputmaskFormat(this.dateFormat),
|
|
219
|
+
placeholder: '_'.repeat(this.dateFormat.length),
|
|
220
|
+
}).mask(input);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
disconnectedCallback() {
|
|
224
|
+
document.removeEventListener('click', this.handleClickOutside);
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Handles the single date selection event from nv-calendar.
|
|
228
|
+
* Updates the input value and closes the popover.
|
|
229
|
+
* @param {CustomEvent} event - The event from nv-calendar.
|
|
230
|
+
*/
|
|
231
|
+
handleSingleDateChange(event) {
|
|
232
|
+
const value = event.detail;
|
|
233
|
+
this.singleValue = value;
|
|
234
|
+
this.dateChange.emit({ value });
|
|
235
|
+
if (!this.showActions) {
|
|
236
|
+
this.open = false;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
handleClosePopover() {
|
|
240
|
+
this.open = false;
|
|
241
|
+
}
|
|
242
|
+
handleKeyDown(event) {
|
|
243
|
+
if (!this.open) {
|
|
244
|
+
if (event.key === 'ArrowDown') {
|
|
245
|
+
this.open = true;
|
|
246
|
+
event.preventDefault();
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
// Verify if the popover element is defined
|
|
252
|
+
if (!this.popoverElement) {
|
|
253
|
+
console.warn('nv-fielddate -> Popover element is not defined');
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
handleValueChange(newValue) {
|
|
258
|
+
this.singleValue = newValue;
|
|
259
|
+
}
|
|
260
|
+
//#endregion EVENTS
|
|
261
|
+
/****************************************************************************/
|
|
262
|
+
//#region RENDER
|
|
263
|
+
render() {
|
|
264
|
+
return (index.h(index.Host, { key: 'df11f4f395a48f6288b20a242cccdacc9d7b397c' }, ((this.label && this.label.length > 0) ||
|
|
265
|
+
this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'bebb3787dcef1ea73bada36586bdd678f0ce0556', htmlFor: this.inputId }, index.h("slot", { key: '52be6fb452bcd9471708376e708e9a8126af73c2', name: "label" }, this.label))), index.h("nv-popover", { key: '6e1cc0a602641ec43be99ca990d64f175ff7bac8', ref: el => (this.popoverElement = el), id: this.popoverId, triggerMode: "controlled", placement: "bottom-start", open: this.open }, index.h("div", { key: '7cc0bcc9df49252d209caa22b61358c230d2f0dd', slot: "trigger", class: "input-wrapper" }, index.h("slot", { key: '13037bdfe258561afd35c23fd1cb94ed96bbba9d', name: "before-input" }), index.h("div", { key: '5a0c1bce690feb834f6183c57772d7b2eed0a8a6', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: '73842b222ba5059f1f09a4ce57b662710a1e341a', name: "leading-input" }), index.h("input", { key: '2e4de521b0d1d735fd4170eefacfe4e8f5bbcf33', id: this.inputId, ref: e => (this.inputElement = e), placeholder: this.placeholder, name: this.name, disabled: this.disabled, readOnly: this.readonly, required: this.required, autofocus: this.autofocus, value: this.singleValue, onInput: this.handleInput, onFocus: this.handleFocus }), index.h("nv-iconbutton", { key: 'dff7fe7f4a49a3da8ed44235ef719e726a40db87', class: "toggle-calendar-icon", name: "calendar" //{this.open ? 'chevron-top' : 'chevron-down'}
|
|
266
|
+
,
|
|
267
|
+
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: 'aafa39739ae3f907cef45d95094ef643833d50ad', name: "after-input" })), index.h("div", { key: '38cbef48ee7b053ad7c277e8125fcbf6d11c636c', slot: "content" }, index.h("nv-calendar", { key: 'dd5f1b3f1d7fcb17a47d90be58949fffe89e3ad4', dateFormat: this.dateFormat, singleValue: this.singleValue, 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 }))), ((this.description && this.description.length > 0) ||
|
|
268
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '92526d3d8ed3bce713a5b30097df182b0ea22d4f', class: "description" }, index.h("slot", { key: 'd2a3a35577c08e3dd21c1c48eb6c6e3959abb7da', name: "description" }, this.description))), (this.errorDescription ||
|
|
269
|
+
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: 'd4ba884604a01e2376691d382fb530576c02f029', hidden: !this.error, class: "error-description" }, this.el.querySelector('[slot="error-description"]') ? (index.h("slot", { name: "error-description" })) : (this.errorDescription))), index.h("slot", { key: '443c990302fa9aaef0e6fe732738d4f8e4570717' })));
|
|
270
|
+
}
|
|
271
|
+
get el() { return index.getElement(this); }
|
|
272
|
+
static get watchers() { return {
|
|
273
|
+
"value": ["handleValueChange"]
|
|
274
|
+
}; }
|
|
275
|
+
};
|
|
276
|
+
NvFielddate.style = NvFielddateStyle0;
|
|
277
|
+
|
|
278
|
+
exports.nv_fielddate = NvFielddate;
|