@nova-design-system/nova-react 3.22.0 → 3.24.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/_commonjsHelpers-B85MJLTf-CFO10eej.js +7 -0
- package/dist/cjs/{collapse.animation-6e0b08df-AHWzNGm_.js → collapse.animation-DZDm0vSK-C2TOIhIK.js} +3 -3
- package/dist/cjs/events.utils-B6GgGra--01N__3wY.js +23 -0
- package/dist/cjs/{fade.animation-9b939939-DV--bM4S.js → fade.animation-DcRL9lcm-DAZeHoKN.js} +75 -75
- package/dist/cjs/generated/components.server.js +292 -50
- package/dist/cjs/{grow.animation-24ad5cf8-LUp_ITEx.js → grow.animation-D7ep_aVl-BuXEDSK-.js} +5 -26
- package/dist/cjs/i18n.utils-IlwlcG9l-ku0bScip.js +2494 -0
- package/dist/cjs/{index-WPRkQD3O.js → index-kU2nW5aN.js} +12692 -7009
- package/dist/cjs/{nv-dialog.entry-CDSK9pUH.js → index.esm-D3eWMME9-CG1TVKfu.js} +1 -296
- package/dist/cjs/index.js +15 -1
- package/dist/cjs/inputmask-CSo292ul-DlvupPk6.js +3758 -0
- package/dist/cjs/{nv-accordion-item.entry-BuTvA6w9.js → nv-accordion-item.entry-Bu1tAcCq.js} +11 -10
- package/dist/cjs/{nv-accordion.entry-Dtsfw6He.js → nv-accordion.entry-jWjLdX8w.js} +9 -11
- package/dist/cjs/{nv-alert.entry-TIdfdU7Y.js → nv-alert.entry-E9ZJay_K.js} +22 -23
- package/dist/cjs/{nv-avatar.entry-CaxrhPuw.js → nv-avatar.entry-CUX7u0kR.js} +11 -11
- package/dist/cjs/{nv-badge_2.entry-CfYvTZxX.js → nv-badge_2.entry-bxpV5gxE.js} +24 -24
- package/dist/cjs/{nv-breadcrumb.entry-BCZ4MmfD.js → nv-breadcrumb.entry-Cbbb9Qeh.js} +5 -5
- package/dist/cjs/{nv-breadcrumbs.entry-DwzCE7F6.js → nv-breadcrumbs.entry-BTqnp9zO.js} +3 -3
- package/dist/cjs/{nv-button.entry-Cr_86bcZ.js → nv-button.entry-upWH19y6.js} +12 -14
- package/dist/cjs/{nv-buttongroup.entry-CWjRoHY1.js → nv-buttongroup.entry-CuZCRsnV.js} +3 -3
- package/dist/cjs/{nv-calendar.entry-CXfwNt6G.js → nv-calendar.entry-CT3mASW6.js} +113 -97
- package/dist/cjs/{nv-col.entry-CJLDS3LY.js → nv-col.entry--pCxkaTh.js} +5 -5
- package/dist/cjs/{nv-datagrid.entry-Cns8XSud.js → nv-datagrid.entry-CGCEhO8C.js} +80 -85
- package/dist/cjs/{nv-datagridcolumn.entry-CFFAipHF.js → nv-datagridcolumn.entry-Fsqc7CT_.js} +2 -1
- package/dist/cjs/nv-dialog.entry-B6OYcZxQ.js +300 -0
- package/dist/cjs/{nv-dialogfooter_2.entry-To_dGUn4.js → nv-dialogfooter_2.entry-C4fP_n2-.js} +10 -11
- package/dist/cjs/nv-drawer.entry-C5O4KvHU.js +445 -0
- package/dist/cjs/nv-drawerfooter_2.entry-C-reYJXG.js +146 -0
- package/dist/cjs/nv-fieldcheckbox.entry-bk7UNQny.js +177 -0
- package/dist/cjs/{nv-fielddate.entry-C3pXtMHL.js → nv-fielddate.entry-dqZDBVmm.js} +89 -46
- package/dist/cjs/{nv-fielddaterange.entry-CjVVPEK_.js → nv-fielddaterange.entry-wNRasXky.js} +151 -103
- package/dist/cjs/nv-fielddropdown.entry-BA15piWa.js +678 -0
- package/dist/cjs/{nv-fielddropdownitem.entry-Dah-PaE8.js → nv-fielddropdownitem.entry-DEWaf9dC.js} +7 -7
- package/dist/cjs/{nv-fieldmultiselect.entry-BMLjhqoJ.js → nv-fieldmultiselect.entry-BWY5xOAd.js} +343 -236
- package/dist/cjs/nv-fieldnumber.entry-DoYORd0d.js +187 -0
- package/dist/cjs/nv-fieldpassword.entry-CPaLj9aD.js +165 -0
- package/dist/cjs/{nv-fieldradio.entry-X_2VT1Dj.js → nv-fieldradio.entry-CvUmEaCa.js} +11 -11
- package/dist/cjs/{nv-fieldselect.entry-pSp-2rNn.js → nv-fieldselect.entry-uUIZ6hmN.js} +52 -13
- package/dist/cjs/{nv-fieldslider.entry-pZf7zzLU.js → nv-fieldslider.entry-DnvmxxYY.js} +16 -31
- package/dist/cjs/nv-fieldtext.entry-BYAJp3n_.js +163 -0
- package/dist/cjs/{nv-fieldtextarea.entry-t3Ixxi23.js → nv-fieldtextarea.entry-DU2bWYeg.js} +52 -14
- package/dist/cjs/{nv-fieldtime.entry-DY7D5_6K.js → nv-fieldtime.entry-DlMNDTht.js} +128 -84
- package/dist/cjs/{nv-icon.entry-6oYPSf4c.js → nv-icon.entry-CnUkRzaA.js} +12 -12
- package/dist/cjs/{nv-iconbutton_2.entry-ChULGovr.js → nv-iconbutton_2.entry-hqp4AcRq.js} +10 -12
- package/dist/cjs/{nv-menu.entry-sd0tatWq.js → nv-menu.entry-Dc_FvIx7.js} +18 -32
- package/dist/cjs/{nv-menuitem.entry-CCOqR7UF.js → nv-menuitem.entry-DzMhx6c_.js} +6 -5
- package/dist/cjs/nv-notification-bullet.entry-BwhHCMQF.js +76 -0
- package/dist/cjs/{nv-notification.entry-Cc3zE3yY.js → nv-notification.entry-C3m5p5BL.js} +42 -128
- package/dist/cjs/{nv-notificationcontainer.entry-DV4D6oOH.js → nv-notificationcontainer.entry-DTRNn7VE.js} +4 -4
- package/dist/cjs/{nv-popover.entry-DQSwI2jT.js → nv-popover.entry-B0c-2rO4.js} +51 -47
- package/dist/cjs/{nv-row.entry-UUuMSAY5.js → nv-row.entry-CdcjVGZv.js} +4 -4
- package/dist/cjs/nv-sidebar.entry-CiN813gQ.js +177 -0
- package/dist/cjs/nv-sidebarcontent.entry-D9hpAhK8.js +22 -0
- package/dist/cjs/nv-sidebardivider.entry-B4EMyca5.js +22 -0
- package/dist/cjs/nv-sidebarfooter.entry-CHi4qOFe.js +22 -0
- package/dist/cjs/nv-sidebargroup.entry-RVqrsyIU.js +23 -0
- package/dist/cjs/nv-sidebarheader.entry-_7ch0O3G.js +22 -0
- package/dist/cjs/nv-sidebarlogo.entry-Ch9F-JnT.js +32 -0
- package/dist/cjs/nv-sidebarnavitem.entry-DVrafSMr.js +296 -0
- package/dist/cjs/nv-sidebarnavsubitem.entry-C0XDAzma.js +35 -0
- package/dist/cjs/{nv-split.entry-CYP2bTTM.js → nv-split.entry-0HTslRAX.js} +47 -45
- package/dist/cjs/{nv-stack.entry-D35-75Vw.js → nv-stack.entry-CqO7uTQf.js} +5 -5
- package/dist/cjs/{nv-table.entry-DevWJBnL.js → nv-table.entry-DH85n8Mc.js} +9 -11
- package/dist/cjs/{nv-tableheader.entry-Hs7nUSOC.js → nv-tableheader.entry-CKfocdxD.js} +7 -7
- package/dist/cjs/{nv-toggle.entry-Eje9d--6.js → nv-toggle.entry-BHUl76Im.js} +9 -9
- package/dist/cjs/nv-togglebutton.entry-D_9COjY-.js +67 -0
- package/dist/cjs/{nv-togglebuttongroup.entry-CWN_Ucry.js → nv-togglebuttongroup.entry-C0NLbsq7.js} +10 -8
- package/dist/cjs/{nv-tooltip.entry-BGkKDEFg.js → nv-tooltip.entry-BfViGE_U.js} +5 -5
- package/dist/cjs/slide.animation-CmH5d1of-BZuw607U.js +90 -0
- package/dist/cjs/{style-value-types.es-f5d10b79-D0QCM8OB.js → style-value-types.es-xlgmw4x8-B1vLqX9m.js} +6 -3
- package/dist/cjs/{v4-a79185f4-2n0dOd_Y.js → v4-BdYh22OP-C1vaJ4yP.js} +1 -1
- package/dist/components/NvDatatable/NvDatatable.js +40 -24
- package/dist/generated/components.js +107 -0
- package/dist/generated/components.server.js +260 -50
- package/dist/providers/NotificationProvider.js +3 -4
- package/dist/types/components/NvDatatable/NvDatatable.d.ts +1 -1
- package/dist/types/components/NvDatatable/types.d.ts +8 -3
- package/dist/types/generated/components.d.ts +46 -0
- package/dist/types/generated/components.server.d.ts +46 -0
- package/package.json +2 -2
- package/dist/cjs/_commonjsHelpers-1789f0cf-BJu3ubxk.js +0 -10
- package/dist/cjs/inputmask-edcad3c1-B9Omti4z.js +0 -3749
- package/dist/cjs/nv-fieldcheckbox.entry-fdonR07Z.js +0 -138
- package/dist/cjs/nv-fielddropdown.entry-C9mXuNNj.js +0 -392
- package/dist/cjs/nv-fieldnumber.entry-DBdJviXu.js +0 -148
- package/dist/cjs/nv-fieldpassword.entry-Cim_usSM.js +0 -122
- package/dist/cjs/nv-fieldtext.entry-DlI_ExaV.js +0 -124
- package/dist/cjs/nv-togglebutton.entry-LGI7pIeK.js +0 -56
- /package/dist/cjs/{clsx-297c1ffe-BtxeOLZW.js → clsx-ChV9xqsO-BtxeOLZW.js} +0 -0
- /package/dist/cjs/{constants-69bafca2-DpB_ghPF.js → constants-BReL3Lsa-DpB_ghPF.js} +0 -0
- /package/dist/cjs/{timeline.animation-79215cd4-KteJaZPb.js → timeline.animation-CgHCo_Ho-KteJaZPb.js} +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var index = require('./index-kU2nW5aN.js');
|
|
4
|
+
var constantsBReL3Lsa = require('./constants-BReL3Lsa-DpB_ghPF.js');
|
|
5
|
+
var v4BdYh22OP = require('./v4-BdYh22OP-C1vaJ4yP.js');
|
|
6
|
+
require('@stencil/react-output-target/runtime');
|
|
6
7
|
require('react');
|
|
7
8
|
require('react-dom');
|
|
8
9
|
|
|
@@ -12,37 +13,37 @@ require('react-dom');
|
|
|
12
13
|
const FORMAT_CONFIGS = {
|
|
13
14
|
'HH': {
|
|
14
15
|
pattern: /^([0-1]?[0-9]|2[0-3])$/,
|
|
15
|
-
parts: [
|
|
16
|
+
parts: [constantsBReL3Lsa.TimeType.Hours],
|
|
16
17
|
defaultValue: '00',
|
|
17
18
|
maxLength: 2,
|
|
18
19
|
},
|
|
19
20
|
'HH:mm': {
|
|
20
21
|
pattern: /^([0-1]?[0-9]|2[0-3]):([0-5]?[0-9])$/,
|
|
21
|
-
parts: [
|
|
22
|
+
parts: [constantsBReL3Lsa.TimeType.Hours, constantsBReL3Lsa.TimeType.Minutes],
|
|
22
23
|
defaultValue: '00:00',
|
|
23
24
|
maxLength: 5,
|
|
24
25
|
},
|
|
25
26
|
'HH:mm:ss': {
|
|
26
27
|
pattern: /^([0-1]?[0-9]|2[0-3]):([0-5]?[0-9]):([0-5]?[0-9])$/,
|
|
27
|
-
parts: [
|
|
28
|
+
parts: [constantsBReL3Lsa.TimeType.Hours, constantsBReL3Lsa.TimeType.Minutes, constantsBReL3Lsa.TimeType.Seconds],
|
|
28
29
|
defaultValue: '00:00:00',
|
|
29
30
|
maxLength: 8,
|
|
30
31
|
},
|
|
31
32
|
'hh': {
|
|
32
33
|
pattern: /^(0?[1-9]|1[0-2])$/,
|
|
33
|
-
parts: [
|
|
34
|
+
parts: [constantsBReL3Lsa.TimeType.Hours],
|
|
34
35
|
defaultValue: '01',
|
|
35
36
|
maxLength: 2,
|
|
36
37
|
},
|
|
37
38
|
'hh:mm': {
|
|
38
39
|
pattern: /^(0?[1-9]|1[0-2]):([0-5]?[0-9])$/,
|
|
39
|
-
parts: [
|
|
40
|
+
parts: [constantsBReL3Lsa.TimeType.Hours, constantsBReL3Lsa.TimeType.Minutes],
|
|
40
41
|
defaultValue: '01:00',
|
|
41
42
|
maxLength: 5,
|
|
42
43
|
},
|
|
43
44
|
'hh:mm:ss': {
|
|
44
45
|
pattern: /^(0?[1-9]|1[0-2]):([0-5]?[0-9]):([0-5]?[0-9])$/,
|
|
45
|
-
parts: [
|
|
46
|
+
parts: [constantsBReL3Lsa.TimeType.Hours, constantsBReL3Lsa.TimeType.Minutes, constantsBReL3Lsa.TimeType.Seconds],
|
|
46
47
|
defaultValue: '01:00:00',
|
|
47
48
|
maxLength: 8,
|
|
48
49
|
},
|
|
@@ -56,7 +57,7 @@ function getVisibleTimeTypes(format) {
|
|
|
56
57
|
const config = FORMAT_CONFIGS[format];
|
|
57
58
|
if (!config) {
|
|
58
59
|
// Fallback for unknown formats
|
|
59
|
-
return [
|
|
60
|
+
return [constantsBReL3Lsa.TimeType.Hours, constantsBReL3Lsa.TimeType.Minutes, constantsBReL3Lsa.TimeType.Seconds];
|
|
60
61
|
}
|
|
61
62
|
return config.parts;
|
|
62
63
|
}
|
|
@@ -109,7 +110,7 @@ function parseValueByFormat(value, format) {
|
|
|
109
110
|
}
|
|
110
111
|
// Handle partial format values - try to parse what we can
|
|
111
112
|
const parts = cleanValue.split(':');
|
|
112
|
-
const result =
|
|
113
|
+
const result = { ...defaultComponents };
|
|
113
114
|
if (parts.length >= 1 && parts[0]) {
|
|
114
115
|
const hours = parseInt(parts[0], 10);
|
|
115
116
|
if (!isNaN(hours)) {
|
|
@@ -137,7 +138,7 @@ function parseValueByFormat(value, format) {
|
|
|
137
138
|
}
|
|
138
139
|
if (parts.length >= 2 &&
|
|
139
140
|
parts[1] &&
|
|
140
|
-
config.parts.includes(
|
|
141
|
+
config.parts.includes(constantsBReL3Lsa.TimeType.Minutes)) {
|
|
141
142
|
const minutes = parseInt(parts[1], 10);
|
|
142
143
|
if (!isNaN(minutes) && minutes >= 0 && minutes <= 59) {
|
|
143
144
|
result.minutes = minutes.toString().padStart(2, '0');
|
|
@@ -145,7 +146,7 @@ function parseValueByFormat(value, format) {
|
|
|
145
146
|
}
|
|
146
147
|
if (parts.length >= 3 &&
|
|
147
148
|
parts[2] &&
|
|
148
|
-
config.parts.includes(
|
|
149
|
+
config.parts.includes(constantsBReL3Lsa.TimeType.Seconds)) {
|
|
149
150
|
const seconds = parseInt(parts[2], 10);
|
|
150
151
|
if (!isNaN(seconds) && seconds >= 0 && seconds <= 59) {
|
|
151
152
|
result.seconds = seconds.toString().padStart(2, '0');
|
|
@@ -189,7 +190,7 @@ function extractRelevantComponents(components, format) {
|
|
|
189
190
|
minutes: '00',
|
|
190
191
|
seconds: '00',
|
|
191
192
|
};
|
|
192
|
-
if (config.parts.includes(
|
|
193
|
+
if (config.parts.includes(constantsBReL3Lsa.TimeType.Hours)) {
|
|
193
194
|
// Validate hours for the target format
|
|
194
195
|
const hours = parseInt(components.hours, 10);
|
|
195
196
|
if (format.startsWith('hh')) {
|
|
@@ -207,10 +208,10 @@ function extractRelevantComponents(components, format) {
|
|
|
207
208
|
// If invalid, keep the default '00'
|
|
208
209
|
}
|
|
209
210
|
}
|
|
210
|
-
if (config.parts.includes(
|
|
211
|
+
if (config.parts.includes(constantsBReL3Lsa.TimeType.Minutes)) {
|
|
211
212
|
result.minutes = components.minutes;
|
|
212
213
|
}
|
|
213
|
-
if (config.parts.includes(
|
|
214
|
+
if (config.parts.includes(constantsBReL3Lsa.TimeType.Seconds)) {
|
|
214
215
|
result.seconds = components.seconds;
|
|
215
216
|
}
|
|
216
217
|
return result;
|
|
@@ -241,17 +242,16 @@ function reconstructTimeByFormat(components, format) {
|
|
|
241
242
|
}
|
|
242
243
|
}
|
|
243
244
|
|
|
244
|
-
const nvFieldtimeCss = "nv-fieldslider .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .track-range{background:var(--components-slider-track-filled-focus)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .thumb{border-color:var(--components-slider-track-filled-focus)}nv-fieldslider[error] .slider-container .track-container .track .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb{border-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:hover{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-handler-background-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:focus{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-error)}nv-fieldtime{--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-fieldtime[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-fieldtime[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-fieldtime[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-fieldtime[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:var(--font-weight-high-emphasis)}nv-fieldtime label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--form-label-line-height)}nv-fieldtime nv-popover{width:100%;display:block;z-index:9999}nv-fieldtime nv-popover [data-scope=popover]{padding:var(--list-dropdown-padding);background-color:var(--components-list-dropdown-background);border:1px solid var(--components-list-dropdown-border);width:100%}nv-fieldtime .input-wrapper{display:flex;flex-wrap:wrap;gap:var(--form-gap-x);align-items:stretch;align-self:stretch;width:100%}nv-fieldtime .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;display:flex;justify-content:flex-start;align-items:center;position:relative;width:100%;min-height:40px;gap:0;padding-left:var(--form-field-padding-x)}nv-fieldtime .input-container:hover{border-color:var(--nv-field-border-hover)}nv-fieldtime .input-container:focus-within,nv-fieldtime .input-container:focus-within:hover,nv-fieldtime .input-container:focus,nv-fieldtime .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-fieldtime .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-fieldtime .input-container:has(input:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldtime .input-container input.time-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:var(--font-weight-medium-emphasis);line-height:var(--form-field-line-height);width:100%;width:100%;min-width:24px;flex:0 0 24px;text-align:center;padding:0;margin:0}nv-fieldtime .input-container input.time-input:focus{outline:none}nv-fieldtime .input-container input.time-input::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:var(--font-weight-low-emphasis);line-height:var(--form-field-line-height)}nv-fieldtime .input-container input.time-input[type=password]::-ms-clear,nv-fieldtime .input-container input.time-input[type=password]::-ms-reveal{display:none;width:0;height:0}nv-fieldtime .input-container input.time-input::-webkit-inner-spin-button,nv-fieldtime .input-container input.time-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}nv-fieldtime .input-container span{width:100%;text-align:center;min-width:24px;flex:0 0 24px;padding:0 4px;color:var(--components-form-field-content-text)}nv-fieldtime .input-container>nv-iconbutton{border:0px;border-radius:0px;margin-left:auto}nv-fieldtime .input-container>nv-iconbutton:focus-visible{border-radius:var(--button-md-border-radius);outline-offset:-3px}nv-fieldtime .input-container>nv-iconbutton:last-of-type{border-top-right-radius:var(--form-field-radius);border-bottom-right-radius:var(--form-field-radius)}nv-fieldtime .input-container nv-icon.validation{color:var(--nv-field-border-default);position:absolute;right:50px;top:50%;transform:translateY(-50%)}nv-fieldtime .input-container:focus,nv-fieldtime .input-container:focus-within{border-color:var(--color-focus-brand);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--color-focus-brand)}nv-fieldtime .description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height)}nv-fieldtime .error-description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}nv-fieldtime hr{border:none;border-top:1px solid var(--dropdown-divider-color, #ccc);margin:0.5rem 0}nv-fieldtime .time-dropdown{width:100%}nv-fieldtime .time-dropdown .time-columns{display:flex;justify-content:flex-start;align-items:center}nv-fieldtime .time-dropdown .time-columns .time-column{flex:1;text-align:center;max-height:200px;overflow-y:auto;scroll-behavior:smooth;scrollbar-gutter:stable both-edges;scrollbar-gutter:auto}nv-fieldtime .time-dropdown .time-columns .time-column::-webkit-scrollbar{width:6px;height:6px}nv-fieldtime .time-dropdown .time-columns .time-column::-webkit-scrollbar-track{background-color:var(--color-level-10-background);border-radius:9999px}nv-fieldtime .time-dropdown .time-columns .time-column::-webkit-scrollbar-thumb{background-color:var(--color-gray-200);border-radius:9999px}nv-fieldtime .time-dropdown .time-columns .time-column:last-child{border-right:none}nv-fieldtime .time-dropdown .time-columns .time-column .time-option{padding:var(--calendar-padding);text-align:center;cursor:pointer;transition:background-color 0.2s;border-radius:var(--list-dropdown-item-radius);color:var(--components-calendar-cell-text);font-size:var(--font-size-sm);display:flex;justify-content:center;align-items:center}nv-fieldtime .time-dropdown .time-columns .time-column .time-option:hover{background-color:var(--components-calendar-cell-background-hover);color:var(--components-calendar-cell-text-hover)}nv-fieldtime .time-dropdown .time-columns .time-column .time-option:focus,nv-fieldtime .time-dropdown .time-columns .time-column .time-option:focus-within{background-color:var(--components-calendar-cell-background-hover);color:var(--components-calendar-cell-text-hover)}nv-fieldtime .time-dropdown .time-columns .time-column .time-option.selected{background-color:var(--components-calendar-cell-background-selected);color:var(--components-calendar-cell-text-selected)}nv-fieldtime .time-dropdown .time-columns .time-column .time-option.highlighted{background-color:var(--components-calendar-cell-background-hover);color:var(--components-menu-contextual-item-content-hover)}";
|
|
245
|
-
const NvFieldtimeStyle0 = nvFieldtimeCss;
|
|
245
|
+
const nvFieldtimeCss = "nv-fieldslider .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .track-range{background:var(--components-slider-track-filled-focus)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .thumb{border-color:var(--components-slider-track-filled-focus)}nv-fieldslider[error] .slider-container .track-container .track .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb{border-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:hover{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-handler-background-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:focus{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-error)}nv-fieldtime{--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-fieldtime[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-fieldtime[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-fieldtime[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-fieldtime[required]:not([required=false]) label::after,nv-fieldtime[aria-required=true] label::after{content:\"*\";color:var(--components-form-text-required);font-weight:var(--font-weight-high-emphasis)}nv-fieldtime label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--form-label-line-height)}nv-fieldtime nv-popover{width:100%;display:block}nv-fieldtime nv-popover [data-scope=popover]{padding:var(--list-dropdown-padding);background-color:var(--components-list-dropdown-background);border:1px solid var(--components-list-dropdown-border);width:100%}nv-fieldtime nv-popover{z-index:9999}nv-fieldtime .input-wrapper{display:flex;flex-wrap:wrap;gap:var(--form-gap-x);align-items:stretch;align-self:stretch;width:100%}nv-fieldtime .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-fieldtime .input-container:hover{border-color:var(--nv-field-border-hover)}nv-fieldtime .input-container:focus-within,nv-fieldtime .input-container:focus-within:hover,nv-fieldtime .input-container:focus,nv-fieldtime .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-fieldtime .input-container:has(input:read-only){background-color:var(--components-form-field-background-readonly);border-color:var(--nv-field-border-readonly)}nv-fieldtime .input-container:has(input:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldtime .input-container{display:flex;justify-content:flex-start;align-items:center;position:relative;width:100%;min-height:40px;gap:0;padding-left:var(--form-field-padding-x)}nv-fieldtime .input-container input.time-input{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);padding:calc(var(--form-field-padding-y) - 1px) var(--form-field-padding-x);font-size:var(--form-field-font-size);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--form-field-line-height);width:100%}nv-fieldtime .input-container input.time-input:focus{outline:none}nv-fieldtime .input-container input.time-input::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:var(--font-weight-low-emphasis);line-height:var(--form-field-line-height)}nv-fieldtime .input-container input.time-input{}nv-fieldtime .input-container input.time-input[type=password]::-ms-clear,nv-fieldtime .input-container input.time-input[type=password]::-ms-reveal{display:none;width:0;height:0}nv-fieldtime .input-container input.time-input{width:100%;min-width:24px;flex:0 0 24px;text-align:center;padding:0;margin:0}nv-fieldtime .input-container input.time-input::-webkit-inner-spin-button,nv-fieldtime .input-container input.time-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}nv-fieldtime .input-container span{width:100%;text-align:center;min-width:24px;flex:0 0 24px;padding:0 4px;color:var(--components-form-field-content-text)}nv-fieldtime .input-container>nv-iconbutton{border:0px;border-radius:0px}nv-fieldtime .input-container>nv-iconbutton:focus-visible{border-radius:var(--button-md-border-radius);outline-offset:-3px}nv-fieldtime .input-container>nv-iconbutton:last-of-type{border-top-right-radius:var(--form-field-radius);border-bottom-right-radius:var(--form-field-radius)}nv-fieldtime .input-container>nv-iconbutton{margin-left:auto}nv-fieldtime .input-container nv-icon.validation{color:var(--nv-field-border-default);position:absolute;right:50px;top:50%;transform:translateY(-50%)}nv-fieldtime .input-container:focus,nv-fieldtime .input-container:focus-within{border-color:var(--color-focus-brand);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--color-focus-brand)}nv-fieldtime .description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height)}nv-fieldtime .error-description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}nv-fieldtime hr{border:none;border-top:1px solid var(--dropdown-divider-color, #ccc);margin:0.5rem 0}nv-fieldtime .time-dropdown{width:100%}nv-fieldtime .time-dropdown .time-columns{display:flex;justify-content:flex-start;align-items:center}nv-fieldtime .time-dropdown .time-columns .time-column{flex:1;text-align:center}nv-fieldtime .time-dropdown .time-columns .time-column::-webkit-scrollbar{width:6px;height:6px}nv-fieldtime .time-dropdown .time-columns .time-column::-webkit-scrollbar-track{background-color:var(--color-level-10-background);border-radius:9999px}nv-fieldtime .time-dropdown .time-columns .time-column::-webkit-scrollbar-thumb{background-color:var(--color-gray-200);border-radius:9999px}nv-fieldtime .time-dropdown .time-columns .time-column{max-height:200px;overflow-y:auto;scroll-behavior:smooth;scrollbar-gutter:stable both-edges;scrollbar-gutter:auto}nv-fieldtime .time-dropdown .time-columns .time-column:last-child{border-right:none}nv-fieldtime .time-dropdown .time-columns .time-column .time-option{padding:var(--calendar-padding);text-align:center;cursor:pointer;transition:background-color 0.2s;border-radius:var(--list-dropdown-item-radius);color:var(--components-calendar-cell-text);font-size:var(--font-size-sm);display:flex;justify-content:center;align-items:center}nv-fieldtime .time-dropdown .time-columns .time-column .time-option:hover{background-color:var(--components-calendar-cell-background-hover);color:var(--components-calendar-cell-text-hover)}nv-fieldtime .time-dropdown .time-columns .time-column .time-option:focus,nv-fieldtime .time-dropdown .time-columns .time-column .time-option:focus-within{background-color:var(--components-calendar-cell-background-hover);color:var(--components-calendar-cell-text-hover)}nv-fieldtime .time-dropdown .time-columns .time-column .time-option.selected{background-color:var(--components-calendar-cell-background-selected);color:var(--components-calendar-cell-text-selected)}nv-fieldtime .time-dropdown .time-columns .time-column .time-option.highlighted{background-color:var(--components-calendar-cell-background-hover);color:var(--components-menu-contextual-item-content-hover)}";
|
|
246
246
|
|
|
247
247
|
const NvFieldtime = class {
|
|
248
248
|
constructor(hostRef) {
|
|
249
249
|
index.registerInstance(this, hostRef);
|
|
250
|
-
this.valueChanged = index.createEvent(this, "valueChanged");
|
|
250
|
+
this.valueChanged = index.createEvent(this, "valueChanged", 3);
|
|
251
251
|
// Input elements for hours, minutes, and seconds
|
|
252
252
|
this.inputElements = {};
|
|
253
253
|
this.inputZeroAdded = {};
|
|
254
|
-
this.typeFocused =
|
|
254
|
+
this.typeFocused = constantsBReL3Lsa.TimeType.Hours;
|
|
255
255
|
/****************************************************************************/
|
|
256
256
|
//#region STATES
|
|
257
257
|
this.hours = '00';
|
|
@@ -263,7 +263,7 @@ const NvFieldtime = class {
|
|
|
263
263
|
* to ensure unique identification, facilitating proper label association and
|
|
264
264
|
* accessibility.
|
|
265
265
|
*/
|
|
266
|
-
this.inputId =
|
|
266
|
+
this.inputId = v4BdYh22OP.v4();
|
|
267
267
|
/**
|
|
268
268
|
* Display the input field's content without allowing users to change it.
|
|
269
269
|
* Users can still click on it, select, and copy the text, but they won't be
|
|
@@ -279,8 +279,18 @@ const NvFieldtime = class {
|
|
|
279
279
|
/**
|
|
280
280
|
* Marks the input field as required, ensuring that the user must fill it out
|
|
281
281
|
* before submitting the form.
|
|
282
|
+
* @note This uses the native HTML `required` attribute, which triggers browser validation.
|
|
282
283
|
*/
|
|
283
284
|
this.required = false;
|
|
285
|
+
/**
|
|
286
|
+
* Marks the input field as required for accessibility purposes without triggering
|
|
287
|
+
* native HTML validation. Use this when implementing custom validation logic.
|
|
288
|
+
* @note When set, this uses `aria-required` instead of the native `required` attribute.
|
|
289
|
+
* This allows developers to implement custom validation while maintaining accessibility.
|
|
290
|
+
* @note If this prop is not explicitly set, the component will check for the HTML attribute
|
|
291
|
+
* 'aria-required' directly to determine if it should be applied.
|
|
292
|
+
*/
|
|
293
|
+
this.ariaRequiredAttr = false;
|
|
284
294
|
/**
|
|
285
295
|
* Changes the input field’s appearance to indicate successful input or
|
|
286
296
|
* validation.
|
|
@@ -326,14 +336,7 @@ const NvFieldtime = class {
|
|
|
326
336
|
//#endregion EVENTS
|
|
327
337
|
/****************************************************************************/
|
|
328
338
|
//#region LISTENERS
|
|
329
|
-
handleOpenChanged(event) {
|
|
330
|
-
// Stop propagation to prevent the event from affecting parent components like dialogs
|
|
331
|
-
event.stopPropagation();
|
|
332
|
-
// Update `open` based on the popover state
|
|
333
|
-
this.open = event.detail;
|
|
334
|
-
}
|
|
335
339
|
handleKeyDown(event) {
|
|
336
|
-
var _a, _b;
|
|
337
340
|
if (!this.open) {
|
|
338
341
|
if (event.key === 'ArrowDown') {
|
|
339
342
|
this.open = true;
|
|
@@ -374,8 +377,8 @@ const NvFieldtime = class {
|
|
|
374
377
|
const nextTypeIndex = currentTypeIndex + 1;
|
|
375
378
|
if (nextTypeIndex < visibleTypes.length) {
|
|
376
379
|
const nextType = visibleTypes[nextTypeIndex];
|
|
377
|
-
|
|
378
|
-
|
|
380
|
+
this.inputElements[nextType]?.focus();
|
|
381
|
+
this.inputElements[nextType]?.select();
|
|
379
382
|
}
|
|
380
383
|
}
|
|
381
384
|
else if (event.key === 'Escape') {
|
|
@@ -410,11 +413,11 @@ const NvFieldtime = class {
|
|
|
410
413
|
// React to external changes, e.g., highlight current time on open
|
|
411
414
|
if (newOpen) {
|
|
412
415
|
// Re-highlight columns based on current value
|
|
413
|
-
const hourSelector = `.time-column.time-column-${
|
|
416
|
+
const hourSelector = `.time-column.time-column-${constantsBReL3Lsa.TimeType.Hours} div`;
|
|
414
417
|
this.updateColumnHighlight(hourSelector, this.hours);
|
|
415
|
-
const minutesSelector = `.time-column.time-column-${
|
|
418
|
+
const minutesSelector = `.time-column.time-column-${constantsBReL3Lsa.TimeType.Minutes} div`;
|
|
416
419
|
this.updateColumnHighlight(minutesSelector, this.minutes);
|
|
417
|
-
const secondsSelector = `.time-column.time-column-${
|
|
420
|
+
const secondsSelector = `.time-column.time-column-${constantsBReL3Lsa.TimeType.Seconds} div`;
|
|
418
421
|
this.updateColumnHighlight(secondsSelector, this.seconds);
|
|
419
422
|
}
|
|
420
423
|
}
|
|
@@ -450,13 +453,13 @@ const NvFieldtime = class {
|
|
|
450
453
|
}
|
|
451
454
|
// Update the time value based on the type
|
|
452
455
|
switch (type) {
|
|
453
|
-
case
|
|
456
|
+
case constantsBReL3Lsa.TimeType.Hours:
|
|
454
457
|
this.handleHoursChange(inputValue, type);
|
|
455
458
|
break;
|
|
456
|
-
case
|
|
459
|
+
case constantsBReL3Lsa.TimeType.Minutes:
|
|
457
460
|
this.handleMinutesChange(inputValue, type);
|
|
458
461
|
break;
|
|
459
|
-
case
|
|
462
|
+
case constantsBReL3Lsa.TimeType.Seconds:
|
|
460
463
|
this.handleSecondsChange(inputValue, type);
|
|
461
464
|
break;
|
|
462
465
|
}
|
|
@@ -466,7 +469,6 @@ const NvFieldtime = class {
|
|
|
466
469
|
this.value = reconstructedValue;
|
|
467
470
|
}
|
|
468
471
|
handleHoursChange(inputValue, type) {
|
|
469
|
-
var _a, _b;
|
|
470
472
|
const isHHFormat = this.format.startsWith('HH');
|
|
471
473
|
const maxHours = isHHFormat ? 24 : 12;
|
|
472
474
|
// Handle empty input
|
|
@@ -523,17 +525,16 @@ const NvFieldtime = class {
|
|
|
523
525
|
// Auto-navigation to next field when input is complete
|
|
524
526
|
if (this.hours.length >= 1 && !this.inputZeroAdded[type]) {
|
|
525
527
|
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
526
|
-
const currentTypeIndex = visibleTypes.indexOf(
|
|
528
|
+
const currentTypeIndex = visibleTypes.indexOf(constantsBReL3Lsa.TimeType.Hours);
|
|
527
529
|
const nextTypeIndex = currentTypeIndex + 1;
|
|
528
530
|
if (nextTypeIndex < visibleTypes.length) {
|
|
529
531
|
const nextType = visibleTypes[nextTypeIndex];
|
|
530
|
-
|
|
531
|
-
|
|
532
|
+
this.inputElements[nextType]?.focus();
|
|
533
|
+
this.inputElements[nextType]?.select();
|
|
532
534
|
}
|
|
533
535
|
}
|
|
534
536
|
}
|
|
535
537
|
handleMinutesChange(inputValue, type) {
|
|
536
|
-
var _a, _b;
|
|
537
538
|
const maxMinutes = 60;
|
|
538
539
|
// Handle empty input
|
|
539
540
|
if (inputValue.length === 0) {
|
|
@@ -589,12 +590,12 @@ const NvFieldtime = class {
|
|
|
589
590
|
// Auto-navigation to next field when input is complete
|
|
590
591
|
if (this.minutes.length >= 1 && !this.inputZeroAdded[type]) {
|
|
591
592
|
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
592
|
-
const currentTypeIndex = visibleTypes.indexOf(
|
|
593
|
+
const currentTypeIndex = visibleTypes.indexOf(constantsBReL3Lsa.TimeType.Minutes);
|
|
593
594
|
const nextTypeIndex = currentTypeIndex + 1;
|
|
594
595
|
if (nextTypeIndex < visibleTypes.length) {
|
|
595
596
|
const nextType = visibleTypes[nextTypeIndex];
|
|
596
|
-
|
|
597
|
-
|
|
597
|
+
this.inputElements[nextType]?.focus();
|
|
598
|
+
this.inputElements[nextType]?.select();
|
|
598
599
|
}
|
|
599
600
|
}
|
|
600
601
|
}
|
|
@@ -675,7 +676,6 @@ const NvFieldtime = class {
|
|
|
675
676
|
return reconstructedTime;
|
|
676
677
|
}
|
|
677
678
|
handleFocus(type) {
|
|
678
|
-
var _a, _b, _c, _d;
|
|
679
679
|
if (this.readonly || this.disabled) {
|
|
680
680
|
return;
|
|
681
681
|
}
|
|
@@ -688,15 +688,14 @@ const NvFieldtime = class {
|
|
|
688
688
|
this.open = true; // Force the popover to open
|
|
689
689
|
}
|
|
690
690
|
// Refocus on the input if it loses focus and is empty
|
|
691
|
-
if (
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
691
|
+
if (this.inputElements[type]?.value.length === 0 ||
|
|
692
|
+
this.inputElements[type]?.value === '00') {
|
|
693
|
+
this.inputElements[type]?.focus();
|
|
694
|
+
this.inputElements[type]?.select();
|
|
695
695
|
}
|
|
696
696
|
this.typeFocused = type;
|
|
697
697
|
}
|
|
698
698
|
HandleDropdownIconClick() {
|
|
699
|
-
var _a, _b;
|
|
700
699
|
if (this.disabled || this.readonly) {
|
|
701
700
|
return; // Do not toggle if disabled or read-only
|
|
702
701
|
}
|
|
@@ -708,8 +707,8 @@ const NvFieldtime = class {
|
|
|
708
707
|
else if (!this.open &&
|
|
709
708
|
firstVisibleType &&
|
|
710
709
|
this.inputElements[firstVisibleType]) {
|
|
711
|
-
|
|
712
|
-
|
|
710
|
+
this.inputElements[firstVisibleType]?.focus(); // Focus will open the popover
|
|
711
|
+
this.inputElements[firstVisibleType]?.select();
|
|
713
712
|
}
|
|
714
713
|
else {
|
|
715
714
|
console.warn('nv-fieldtime -> No visible input elements found to focus');
|
|
@@ -733,13 +732,13 @@ const NvFieldtime = class {
|
|
|
733
732
|
const option = parseInt(event.target.textContent || '0', 10);
|
|
734
733
|
// Update the time component directly without constraint validation
|
|
735
734
|
// Dropdown options are already filtered by constraints during generation
|
|
736
|
-
if (type ===
|
|
735
|
+
if (type === constantsBReL3Lsa.TimeType.Hours) {
|
|
737
736
|
this.hours = option.toString().padStart(2, '0');
|
|
738
737
|
}
|
|
739
|
-
else if (type ===
|
|
738
|
+
else if (type === constantsBReL3Lsa.TimeType.Minutes) {
|
|
740
739
|
this.minutes = option.toString().padStart(2, '0');
|
|
741
740
|
}
|
|
742
|
-
else if (type ===
|
|
741
|
+
else if (type === constantsBReL3Lsa.TimeType.Seconds) {
|
|
743
742
|
this.seconds = option.toString().padStart(2, '0');
|
|
744
743
|
}
|
|
745
744
|
// Reconstruct time in the correct format and update value
|
|
@@ -791,11 +790,11 @@ const NvFieldtime = class {
|
|
|
791
790
|
}
|
|
792
791
|
// Generate the time options based on the type
|
|
793
792
|
switch (type) {
|
|
794
|
-
case
|
|
793
|
+
case constantsBReL3Lsa.TimeType.Hours:
|
|
795
794
|
return this.generateHourOptions(stepInSeconds);
|
|
796
|
-
case
|
|
795
|
+
case constantsBReL3Lsa.TimeType.Minutes:
|
|
797
796
|
return this.generateMinuteOptions(stepInSeconds);
|
|
798
|
-
case
|
|
797
|
+
case constantsBReL3Lsa.TimeType.Seconds:
|
|
799
798
|
return this.generateSecondOptions(stepInSeconds);
|
|
800
799
|
default:
|
|
801
800
|
return [];
|
|
@@ -838,10 +837,9 @@ const NvFieldtime = class {
|
|
|
838
837
|
return hour >= 0 && hour <= 24 ? hourStr.padStart(2, '0') : null;
|
|
839
838
|
}
|
|
840
839
|
generateMinuteOptions(stepInSeconds) {
|
|
841
|
-
var _a, _b;
|
|
842
840
|
const minuteStep = Math.max(1, Math.floor((stepInSeconds % 3600) / 60)); // Ensure step >= 1
|
|
843
|
-
const minMinute =
|
|
844
|
-
const maxMinute =
|
|
841
|
+
const minMinute = this.parseMinute(this.min) ?? 0;
|
|
842
|
+
const maxMinute = this.parseMinute(this.max) ?? 59;
|
|
845
843
|
if (minMinute === 0 && maxMinute === 0)
|
|
846
844
|
return ['00']; // Handle edge case for zero minutes
|
|
847
845
|
const values = [];
|
|
@@ -868,10 +866,9 @@ const NvFieldtime = class {
|
|
|
868
866
|
return isNaN(minute) || minute < 0 || minute >= 60 ? null : minute;
|
|
869
867
|
}
|
|
870
868
|
generateSecondOptions(stepInSeconds) {
|
|
871
|
-
var _a, _b;
|
|
872
869
|
const secondStep = Math.max(1, stepInSeconds % 60); // Ensure step >= 1
|
|
873
|
-
const minSecond =
|
|
874
|
-
const maxSecond =
|
|
870
|
+
const minSecond = this.parseSecond(this.min) ?? 0;
|
|
871
|
+
const maxSecond = this.parseSecond(this.max) ?? 59;
|
|
875
872
|
if (minSecond === 0 && maxSecond === 0)
|
|
876
873
|
return ['00']; // Handle edge case for zero seconds
|
|
877
874
|
const values = [];
|
|
@@ -910,7 +907,6 @@ const NvFieldtime = class {
|
|
|
910
907
|
this.updateHighlightedItem(items, index);
|
|
911
908
|
}
|
|
912
909
|
handleHostClick(event) {
|
|
913
|
-
var _a, _b;
|
|
914
910
|
if (this.disabled || this.readonly) {
|
|
915
911
|
return;
|
|
916
912
|
}
|
|
@@ -925,13 +921,16 @@ const NvFieldtime = class {
|
|
|
925
921
|
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
926
922
|
const firstVisibleType = visibleTypes[0];
|
|
927
923
|
if (firstVisibleType && this.inputElements[firstVisibleType]) {
|
|
928
|
-
|
|
929
|
-
|
|
924
|
+
this.inputElements[firstVisibleType]?.focus();
|
|
925
|
+
this.inputElements[firstVisibleType]?.select();
|
|
930
926
|
}
|
|
931
927
|
}
|
|
932
928
|
event.preventDefault();
|
|
933
929
|
}
|
|
934
930
|
}
|
|
931
|
+
handleOpenChanged(event) {
|
|
932
|
+
this.open = event.detail;
|
|
933
|
+
}
|
|
935
934
|
//#endregion METHODS
|
|
936
935
|
/****************************************************************************/
|
|
937
936
|
//#region LIFECYCLE
|
|
@@ -978,6 +977,47 @@ const NvFieldtime = class {
|
|
|
978
977
|
//#endregion LIFECYCLE
|
|
979
978
|
/****************************************************************************/
|
|
980
979
|
//#region RENDER
|
|
980
|
+
/**
|
|
981
|
+
* Calculates aria-required and native required values based on props and attributes
|
|
982
|
+
* @returns {object} Object with ariaRequiredValue and useNativeRequired
|
|
983
|
+
*/
|
|
984
|
+
getRequiredAttributes() {
|
|
985
|
+
// Check aria-required from multiple sources:
|
|
986
|
+
// 1. JavaScript prop (most reliable)
|
|
987
|
+
// 2. HTML attribute 'aria-required' (direct HTML)
|
|
988
|
+
// 3. HTML attribute 'aria-required-attr' (from JSX kebab-case conversion)
|
|
989
|
+
// Check aria-required from multiple sources:
|
|
990
|
+
// 1. HTML attribute 'aria-required' (direct HTML) - check if explicitly set
|
|
991
|
+
// 2. JavaScript prop (when prop is explicitly set via JavaScript)
|
|
992
|
+
// We use hasAttribute to determine if the attribute was explicitly set by the user,
|
|
993
|
+
// since the prop now defaults to false (to maintain Blazor compatibility)
|
|
994
|
+
const hasAriaRequiredAttr = this.el.hasAttribute('aria-required') ||
|
|
995
|
+
this.el.hasAttribute('aria-required-attr');
|
|
996
|
+
const ariaRequiredFromAttr = hasAriaRequiredAttr
|
|
997
|
+
? this.el.getAttribute('aria-required') ||
|
|
998
|
+
this.el.getAttribute('aria-required-attr')
|
|
999
|
+
: null;
|
|
1000
|
+
// Use aria-required if the attribute was explicitly set
|
|
1001
|
+
// With reflect: true, setting the prop will also set the attribute
|
|
1002
|
+
const useAriaRequired = hasAriaRequiredAttr;
|
|
1003
|
+
// Determine the value: use attribute if it exists (prop reflects to attribute via reflect: true)
|
|
1004
|
+
// If attribute doesn't exist, the prop was never set and we don't use aria-required
|
|
1005
|
+
const ariaRequiredAttrValue = hasAriaRequiredAttr
|
|
1006
|
+
? ariaRequiredFromAttr
|
|
1007
|
+
: null;
|
|
1008
|
+
// Determine which attributes to use
|
|
1009
|
+
// If aria-required HTML attribute is present, use it (convert string to boolean)
|
|
1010
|
+
// If required is set and aria-required is not "false", use native required
|
|
1011
|
+
// If aria-required is "false", don't use native required even if required is set
|
|
1012
|
+
const ariaRequiredValue = useAriaRequired
|
|
1013
|
+
? ariaRequiredAttrValue === 'true' || ariaRequiredAttrValue === ''
|
|
1014
|
+
: undefined;
|
|
1015
|
+
const useNativeRequired = this.required && (!useAriaRequired || ariaRequiredValue === true);
|
|
1016
|
+
return {
|
|
1017
|
+
ariaRequiredValue,
|
|
1018
|
+
useNativeRequired,
|
|
1019
|
+
};
|
|
1020
|
+
}
|
|
981
1021
|
/**
|
|
982
1022
|
* Renders input fields based on the current format
|
|
983
1023
|
* Only shows fields that are relevant to the selected format
|
|
@@ -1004,11 +1044,11 @@ const NvFieldtime = class {
|
|
|
1004
1044
|
renderTimeInputField(type) {
|
|
1005
1045
|
const getValue = () => {
|
|
1006
1046
|
switch (type) {
|
|
1007
|
-
case
|
|
1047
|
+
case constantsBReL3Lsa.TimeType.Hours:
|
|
1008
1048
|
return this.hours;
|
|
1009
|
-
case
|
|
1049
|
+
case constantsBReL3Lsa.TimeType.Minutes:
|
|
1010
1050
|
return this.minutes;
|
|
1011
|
-
case
|
|
1051
|
+
case constantsBReL3Lsa.TimeType.Seconds:
|
|
1012
1052
|
return this.seconds;
|
|
1013
1053
|
default:
|
|
1014
1054
|
return '00';
|
|
@@ -1016,11 +1056,11 @@ const NvFieldtime = class {
|
|
|
1016
1056
|
};
|
|
1017
1057
|
const getPlaceholder = () => {
|
|
1018
1058
|
switch (type) {
|
|
1019
|
-
case
|
|
1059
|
+
case constantsBReL3Lsa.TimeType.Hours:
|
|
1020
1060
|
return this.format.includes('hh') ? 'hh' : 'HH';
|
|
1021
|
-
case
|
|
1061
|
+
case constantsBReL3Lsa.TimeType.Minutes:
|
|
1022
1062
|
return 'mm';
|
|
1023
|
-
case
|
|
1063
|
+
case constantsBReL3Lsa.TimeType.Seconds:
|
|
1024
1064
|
return 'ss';
|
|
1025
1065
|
default:
|
|
1026
1066
|
return '';
|
|
@@ -1028,11 +1068,11 @@ const NvFieldtime = class {
|
|
|
1028
1068
|
};
|
|
1029
1069
|
const getId = () => {
|
|
1030
1070
|
switch (type) {
|
|
1031
|
-
case
|
|
1071
|
+
case constantsBReL3Lsa.TimeType.Hours:
|
|
1032
1072
|
return this.inputId;
|
|
1033
|
-
case
|
|
1073
|
+
case constantsBReL3Lsa.TimeType.Minutes:
|
|
1034
1074
|
return `${this.inputId}-minutes`;
|
|
1035
|
-
case
|
|
1075
|
+
case constantsBReL3Lsa.TimeType.Seconds:
|
|
1036
1076
|
return `${this.inputId}-seconds`;
|
|
1037
1077
|
default:
|
|
1038
1078
|
return this.inputId;
|
|
@@ -1040,7 +1080,11 @@ const NvFieldtime = class {
|
|
|
1040
1080
|
};
|
|
1041
1081
|
// Remove min/max constraints from input elements to allow native stepper behavior
|
|
1042
1082
|
// Constraints are only applied to dropdown options, not input steppers
|
|
1043
|
-
return (index.h("input", { ref: el => (this.inputElements[type] = el), type: "number", autofocus: this.autofocus && type === getVisibleTimeTypes(this.format)[0], class: "time-input", pattern: "[0-9]*", maxlength: "3", value: getValue(), onInput: e => this.handleInputChange(e, type), placeholder: getPlaceholder(), inputMode: "numeric", onFocus: () => this.handleFocus(type), name: this.name ? `${type}-${this.name}` : type, id: getId(), readonly: this.readonly, disabled: this.disabled, required: this.
|
|
1083
|
+
return (index.h("input", { ref: el => (this.inputElements[type] = el), type: "number", autofocus: this.autofocus && type === getVisibleTimeTypes(this.format)[0], class: "time-input", pattern: "[0-9]*", maxlength: "3", value: getValue(), onInput: e => this.handleInputChange(e, type), placeholder: getPlaceholder(), inputMode: "numeric", onFocus: () => this.handleFocus(type), name: this.name ? `${type}-${this.name}` : type, id: getId(), readonly: this.readonly, disabled: this.disabled, required: this.getRequiredAttributes().useNativeRequired
|
|
1084
|
+
? this.required
|
|
1085
|
+
: undefined, ...(this.getRequiredAttributes().ariaRequiredValue !== undefined && {
|
|
1086
|
+
'aria-required': String(this.getRequiredAttributes().ariaRequiredValue),
|
|
1087
|
+
}), onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }));
|
|
1044
1088
|
}
|
|
1045
1089
|
/**
|
|
1046
1090
|
* Renders dropdown columns based on the current format
|
|
@@ -1054,15 +1098,15 @@ const NvFieldtime = class {
|
|
|
1054
1098
|
RenderTimeOptionsColumn(type) {
|
|
1055
1099
|
return (index.h("div", { class: `time-column time-column-${type}`, onScroll: e => this.handleScroll(e, type) }, this.generateInfiniteTimeOptions(type).map((option, index$1) => (index.h("div", { class: {
|
|
1056
1100
|
'time-option': true,
|
|
1057
|
-
'selected': (type ===
|
|
1058
|
-
(type ===
|
|
1059
|
-
(type ===
|
|
1101
|
+
'selected': (type === constantsBReL3Lsa.TimeType.Hours && option === this.hours) ||
|
|
1102
|
+
(type === constantsBReL3Lsa.TimeType.Minutes && option === this.minutes) ||
|
|
1103
|
+
(type === constantsBReL3Lsa.TimeType.Seconds && option === this.seconds),
|
|
1060
1104
|
}, key: `${option}-${index$1}`, onClick: e => this.handleTimeOptionClick(e, type) }, option)))));
|
|
1061
1105
|
}
|
|
1062
1106
|
render() {
|
|
1063
|
-
return (index.h(index.Host, { key: '
|
|
1064
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
1065
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '
|
|
1107
|
+
return (index.h(index.Host, { key: 'a6edfc1d50527225c9a275de73e497f6cd9652aa', onclick: (e) => this.handleHostClick(e), "aria-expanded": this.open ? 'true' : 'false' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'a82749db001869fb2246bef7126348c585e14a1a', htmlFor: this.inputId }, index.h("slot", { key: '8a96f4fad4f32b6793bee53ca94eec983c1ff09f', name: "label" }, this.label))), index.h("nv-popover", { key: 'de931598921043b8e6b44035964a5026e040afb1', ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open, onOpenChanged: this.handleOpenChanged }, index.h("div", { key: 'b7e654cdb7ce4e270ebba03d20ebe47b37063fce', class: "input-wrapper", slot: "trigger" }, index.h("slot", { key: '1cde39106fad880cdd27ed96574f8cf320fc334a', name: "before-input" }), index.h("div", { key: 'eb7d8edd89d951eff5e00eb994dd85504b44801f', class: "input-container" }, index.h("slot", { key: '48212e52a925cdfb9d897201ca8ee50b037ba573', name: "leading-input" }), this.renderTimeInputFields(), index.h("nv-iconbutton", { key: 'eb541ae9faaefb95c146f8ee9d32d533099162fc', name: 'clock', size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide time picker' : 'Show time picker', onClick: () => this.HandleDropdownIconClick() }), this.error && (index.h("nv-icon", { key: 'c25d25f96b786c96ead487dc8af2b200e372ef79', name: "alert-circle", class: "validation", size: "sm" })), this.success && (index.h("nv-icon", { key: '2c08c7caa21771c697ed191589c836f58be4e761', name: "circle-check", class: "validation", size: "sm" }))), index.h("slot", { key: '77e91dd93225a61730ea7b892c50a7517a25af71', name: "after-input" })), index.h("div", { key: '9e8abc574dd8024dc479b2fe57891b022793291b', class: "time-dropdown", slot: "content" }, index.h("div", { key: 'f232d3e7a0b43f08b801ff76f4cdbf863bfc7a4a', class: "time-columns" }, this.renderTimeDropdownColumns()))), (this.description ||
|
|
1108
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: 'ab21ffb708f50a1b38a7d21d02d5f0b920aceca8', class: "description" }, index.h("slot", { key: '56790e4cc2c6d5f57e45ef7507aee8c1a8ea5a13', name: "description" }, this.description))), (this.errorDescription ||
|
|
1109
|
+
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '392a563b5eccd2120263bd72c883ccefe66d0c02', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '8e6df58e39a9de7fdf05edb0611178c62ff9e79e', name: "error-description" }, this.errorDescription)))));
|
|
1066
1110
|
}
|
|
1067
1111
|
static get formAssociated() { return true; }
|
|
1068
1112
|
get el() { return index.getElement(this); }
|
|
@@ -1072,6 +1116,6 @@ const NvFieldtime = class {
|
|
|
1072
1116
|
"format": ["handleFormatChange"]
|
|
1073
1117
|
}; }
|
|
1074
1118
|
};
|
|
1075
|
-
NvFieldtime.style =
|
|
1119
|
+
NvFieldtime.style = nvFieldtimeCss;
|
|
1076
1120
|
|
|
1077
1121
|
exports.nv_fieldtime = NvFieldtime;
|