@nova-design-system/nova-react 3.0.0-beta.47 → 3.1.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/{constants-98e2dcc2-C0SBCapP.js → constants-b97e736d-BzFAKCkR.js} +11 -0
- package/dist/cjs/{index-Byv3Vmev.js → index-Cn-oNJnW.js} +1839 -1420
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/{nv-alert.entry-BXY4KXbF.js → nv-alert.entry-BFwufSUQ.js} +11 -11
- package/dist/cjs/{nv-avatar.entry-BnPSKkJJ.js → nv-avatar.entry-Do1K4s3s.js} +7 -7
- package/dist/cjs/nv-badge_2.entry-NTGHyFdg.js +204 -0
- package/dist/cjs/{nv-breadcrumb.entry-D5vGHLOG.js → nv-breadcrumb.entry-oPVGJYlk.js} +1 -1
- package/dist/cjs/{nv-breadcrumbs.entry-CsaqAsnb.js → nv-breadcrumbs.entry-BsOw153b.js} +1 -1
- package/dist/cjs/{nv-button.entry-DzZfGZGy.js → nv-button.entry-13tdBiRr.js} +7 -7
- package/dist/cjs/nv-calendar.entry-u9MgGb83.js +1064 -0
- package/dist/cjs/{nv-col.entry-Cng8NaTW.js → nv-col.entry-DFhv-GI7.js} +1 -1
- package/dist/cjs/{nv-datagrid.entry-BbAOzpiO.js → nv-datagrid.entry-BoB17gvI.js} +377 -40
- package/dist/cjs/{nv-datagridcolumn.entry-CRogHbVM.js → nv-datagridcolumn.entry-C3MYBmfS.js} +1 -1
- package/dist/cjs/{nv-dialog.entry-BSIZGYGF.js → nv-dialog.entry-OA3qL3Tx.js} +19 -13
- package/dist/cjs/{nv-dialogfooter_2.entry-Q4_li_QU.js → nv-dialogfooter_2.entry-LAQYSiGV.js} +3 -3
- package/dist/cjs/{nv-fieldcheckbox.entry-DmgzfmRd.js → nv-fieldcheckbox.entry-CP7SDzVO.js} +1 -1
- package/dist/cjs/{nv-fielddate.entry-qAvLX_Ru.js → nv-fielddate.entry-CD7PX6yA.js} +9 -18
- package/dist/cjs/{nv-fielddaterange.entry-DVB8Rwxk.js → nv-fielddaterange.entry-BVBVGmly.js} +27 -29
- package/dist/cjs/{nv-fielddropdown.entry-DKXmoXeW.js → nv-fielddropdown.entry-Nwric1vT.js} +13 -6
- package/dist/cjs/{nv-fielddropdownitem.entry-BVLVXi0e.js → nv-fielddropdownitem.entry-CiqSw5VL.js} +2 -2
- package/dist/cjs/{nv-fieldmultiselect.entry-DrTbd3Dj.js → nv-fieldmultiselect.entry-QKNIBcW1.js} +11 -5
- package/dist/cjs/nv-fieldnumber.entry-DfHcI-sO.js +130 -0
- package/dist/cjs/nv-fieldpassword.entry-b2pUmS8F.js +121 -0
- package/dist/cjs/{nv-fieldradio.entry-CVEY4v6F.js → nv-fieldradio.entry-Dxc6ZCyb.js} +4 -4
- package/dist/cjs/{nv-fieldselect.entry-BrCUuRWa.js → nv-fieldselect.entry-Cys0KRyG.js} +11 -7
- package/dist/cjs/nv-fieldtext.entry-DCZWLFFp.js +123 -0
- package/dist/cjs/{nv-fieldtextarea.entry-B4qiLmX1.js → nv-fieldtextarea.entry-DEeRdtZ7.js} +9 -5
- package/dist/cjs/{nv-fieldtime.entry-Bp2IWjhN.js → nv-fieldtime.entry-BqxiFlLI.js} +71 -68
- package/dist/cjs/nv-icon.entry-CzEdUDdA.js +79 -0
- package/dist/cjs/{nv-iconbutton_2.entry-BRPAGl2S.js → nv-iconbutton_2.entry-BLNrQz9Q.js} +3 -3
- package/dist/cjs/{nv-menu.entry-BiWiIZAm.js → nv-menu.entry-7IDfPmZ8.js} +4 -2
- package/dist/cjs/{nv-menuitem.entry-CFkXoZ_r.js → nv-menuitem.entry-B9cjy7O8.js} +2 -2
- package/dist/cjs/{nv-popover.entry-KT1iQUJk.js → nv-popover.entry-ChLYZ3zY.js} +2 -2
- package/dist/cjs/{nv-row.entry-Cs2GDrcu.js → nv-row.entry-DiLY8Vbc.js} +2 -2
- package/dist/cjs/{nv-stack.entry-Ci7pxGSo.js → nv-stack.entry-MpPzmg5_.js} +2 -2
- package/dist/cjs/{nv-table.entry-N4MV8Y6E.js → nv-table.entry-cME3Zuq2.js} +3 -3
- package/dist/cjs/{nv-tablecolumn.entry-CTz4jsZl.js → nv-tablecolumn.entry-DSctDxCS.js} +1 -1
- package/dist/cjs/{nv-toggle.entry-m10-ncYR.js → nv-toggle.entry-EBWm3Xy5.js} +3 -3
- package/dist/cjs/{nv-tooltip.entry-B6aRDto3.js → nv-tooltip.entry-q6rJLq1C.js} +2 -2
- package/dist/generated/components.js +4 -1
- package/dist/types/generated/components.d.ts +14 -7
- package/package.json +1 -1
- package/dist/cjs/nv-badge_2.entry-BsI3B8Rr.js +0 -195
- package/dist/cjs/nv-calendar.entry-CGKv_-gO.js +0 -1065
- package/dist/cjs/nv-fieldnumber.entry-DegbEHRL.js +0 -126
- package/dist/cjs/nv-fieldpassword.entry-gqjlEl7a.js +0 -117
- package/dist/cjs/nv-fieldtext.entry-q9NnqL5c.js +0 -119
- package/dist/cjs/nv-icon.entry-B1ax9cJS.js +0 -79
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var
|
|
3
|
+
var index = require('./index-Cn-oNJnW.js');
|
|
4
|
+
var constantsB97e736d = require('./constants-b97e736d-BzFAKCkR.js');
|
|
5
5
|
var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
|
|
6
6
|
require('react');
|
|
7
7
|
|
|
@@ -19,7 +19,7 @@ function startsWithIgnoreCase(str, prefix) {
|
|
|
19
19
|
return str.toLowerCase().startsWith(prefix.toLowerCase());
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
const nvFieldtimeCss = "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}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)}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:700}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:\"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-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 .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:500;line-height:var(--form-field-line-height);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:\"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-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-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{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-fieldtime .error-description{align-self:stretch;color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}nv-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}nv-fieldtime .time-dropdown .time-columns .time-column::-webkit-scrollbar{width:
|
|
22
|
+
const nvFieldtimeCss = "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)}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:700}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:\"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-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 .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:500;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:\"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-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-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{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-fieldtime .error-description{align-self:stretch;color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}nv-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;padding-right:2px;max-height:200px;overflow-y:auto;scroll-behavior:smooth;scrollbar-gutter:stable both-edges}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(--list-dropdown-item-padding-y) var(--list-dropdown-item-padding-x);text-align:center;cursor:pointer;transition:background-color 0.2s;height:40px;border-radius:var(--list-dropdown-item-radius);display:flex;justify-content:center;align-items:center}nv-fieldtime .time-dropdown .time-columns .time-column .time-option:hover{background-color:var(--components-list-dropdown-item-background-hover);color:var(--components-list-dropdown-item-label-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-list-dropdown-item-background-hover);color:var(--components-list-dropdown-item-label-hover)}nv-fieldtime .time-dropdown .time-columns .time-column .time-option.selected{background-color:var(--components-list-dropdown-item-background-active);color:var(--components-list-dropdown-item-label-active);border-width:1px;border-style:solid;border-color:var(--components-list-dropdown-item-border-active)}nv-fieldtime .time-dropdown .time-columns .time-column .time-option.highlighted{background-color:var(--components-list-dropdown-item-background-hover);color:var(--components-menu-contextual-item-content-hover)}";
|
|
23
23
|
const NvFieldtimeStyle0 = nvFieldtimeCss;
|
|
24
24
|
|
|
25
25
|
const NvFieldtime = class {
|
|
@@ -29,7 +29,7 @@ const NvFieldtime = class {
|
|
|
29
29
|
// Input elements for hours, minutes, and seconds
|
|
30
30
|
this.inputElements = {};
|
|
31
31
|
this.inputZeroAdded = {};
|
|
32
|
-
this.typeFocused =
|
|
32
|
+
this.typeFocused = constantsB97e736d.TimeType.Hours;
|
|
33
33
|
/****************************************************************************/
|
|
34
34
|
//#region STATES
|
|
35
35
|
this.hours = '00';
|
|
@@ -101,7 +101,10 @@ const NvFieldtime = class {
|
|
|
101
101
|
/****************************************************************************/
|
|
102
102
|
//#region LISTENERS
|
|
103
103
|
handleOpenChanged(event) {
|
|
104
|
-
|
|
104
|
+
// Stop propagation to prevent the event from affecting parent components like dialogs
|
|
105
|
+
event.stopPropagation();
|
|
106
|
+
// Update `open` based on the popover state
|
|
107
|
+
this.open = event.detail;
|
|
105
108
|
}
|
|
106
109
|
handleKeyDown(event) {
|
|
107
110
|
var _a, _b, _c, _d;
|
|
@@ -139,20 +142,20 @@ const NvFieldtime = class {
|
|
|
139
142
|
else if (event.key === 'Enter' && currentIndex >= 0) {
|
|
140
143
|
event.preventDefault();
|
|
141
144
|
items[currentIndex].click();
|
|
142
|
-
if (this.typeFocused ===
|
|
143
|
-
(_a = this.inputElements[
|
|
144
|
-
(_b = this.inputElements[
|
|
145
|
+
if (this.typeFocused === constantsB97e736d.TimeType.Hours) {
|
|
146
|
+
(_a = this.inputElements[constantsB97e736d.TimeType.Minutes]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
147
|
+
(_b = this.inputElements[constantsB97e736d.TimeType.Minutes]) === null || _b === void 0 ? void 0 : _b.select();
|
|
145
148
|
}
|
|
146
|
-
else if (this.typeFocused ===
|
|
147
|
-
this.typeFocused ===
|
|
148
|
-
(_c = this.inputElements[
|
|
149
|
-
(_d = this.inputElements[
|
|
149
|
+
else if (this.typeFocused === constantsB97e736d.TimeType.Minutes ||
|
|
150
|
+
this.typeFocused === constantsB97e736d.TimeType.Seconds) {
|
|
151
|
+
(_c = this.inputElements[constantsB97e736d.TimeType.Seconds]) === null || _c === void 0 ? void 0 : _c.focus();
|
|
152
|
+
(_d = this.inputElements[constantsB97e736d.TimeType.Seconds]) === null || _d === void 0 ? void 0 : _d.select();
|
|
150
153
|
}
|
|
151
154
|
}
|
|
152
155
|
else if (event.key === 'Escape') {
|
|
153
156
|
event.preventDefault();
|
|
154
|
-
if (this.inputElements[
|
|
155
|
-
this.inputElements[
|
|
157
|
+
if (this.inputElements[constantsB97e736d.TimeType.Hours]) {
|
|
158
|
+
this.inputElements[constantsB97e736d.TimeType.Hours].blur();
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
}
|
|
@@ -170,13 +173,13 @@ const NvFieldtime = class {
|
|
|
170
173
|
const inputValue = inputElement.value.replace(/[^0-9]/g, ''); // Only keep numeric input
|
|
171
174
|
// Update the time value based on the type
|
|
172
175
|
switch (type) {
|
|
173
|
-
case
|
|
176
|
+
case constantsB97e736d.TimeType.Hours:
|
|
174
177
|
this.handleHoursChange(inputValue, type);
|
|
175
178
|
break;
|
|
176
|
-
case
|
|
179
|
+
case constantsB97e736d.TimeType.Minutes:
|
|
177
180
|
this.handleMinutesChange(inputValue, type);
|
|
178
181
|
break;
|
|
179
|
-
case
|
|
182
|
+
case constantsB97e736d.TimeType.Seconds:
|
|
180
183
|
this.handleSecondsChange(inputValue, type);
|
|
181
184
|
break;
|
|
182
185
|
}
|
|
@@ -332,12 +335,12 @@ const NvFieldtime = class {
|
|
|
332
335
|
if (this.hours.length === 2 &&
|
|
333
336
|
!this.inputZeroAdded[type] &&
|
|
334
337
|
!reputedToZero) {
|
|
335
|
-
(_a = this.inputElements[
|
|
336
|
-
(_b = this.inputElements[
|
|
338
|
+
(_a = this.inputElements[constantsB97e736d.TimeType.Minutes]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
339
|
+
(_b = this.inputElements[constantsB97e736d.TimeType.Minutes]) === null || _b === void 0 ? void 0 : _b.select();
|
|
337
340
|
}
|
|
338
341
|
else if (reputedToZero) {
|
|
339
|
-
(_c = this.inputElements[
|
|
340
|
-
(_d = this.inputElements[
|
|
342
|
+
(_c = this.inputElements[constantsB97e736d.TimeType.Hours]) === null || _c === void 0 ? void 0 : _c.focus();
|
|
343
|
+
(_d = this.inputElements[constantsB97e736d.TimeType.Hours]) === null || _d === void 0 ? void 0 : _d.select();
|
|
341
344
|
}
|
|
342
345
|
}
|
|
343
346
|
handleMinutesChange(inputValue, type) {
|
|
@@ -490,12 +493,12 @@ const NvFieldtime = class {
|
|
|
490
493
|
if (this.minutes.length === 2 &&
|
|
491
494
|
!this.inputZeroAdded[type] &&
|
|
492
495
|
!reputedToZero) {
|
|
493
|
-
(_c = this.inputElements[
|
|
494
|
-
(_d = this.inputElements[
|
|
496
|
+
(_c = this.inputElements[constantsB97e736d.TimeType.Seconds]) === null || _c === void 0 ? void 0 : _c.focus();
|
|
497
|
+
(_d = this.inputElements[constantsB97e736d.TimeType.Seconds]) === null || _d === void 0 ? void 0 : _d.select();
|
|
495
498
|
}
|
|
496
499
|
else if (reputedToZero) {
|
|
497
|
-
(_e = this.inputElements[
|
|
498
|
-
(_f = this.inputElements[
|
|
500
|
+
(_e = this.inputElements[constantsB97e736d.TimeType.Minutes]) === null || _e === void 0 ? void 0 : _e.focus();
|
|
501
|
+
(_f = this.inputElements[constantsB97e736d.TimeType.Minutes]) === null || _f === void 0 ? void 0 : _f.select();
|
|
499
502
|
}
|
|
500
503
|
}
|
|
501
504
|
handleSecondsChange(inputValue, type) {
|
|
@@ -623,8 +626,8 @@ const NvFieldtime = class {
|
|
|
623
626
|
}
|
|
624
627
|
}
|
|
625
628
|
if (reputedToZero) {
|
|
626
|
-
(_c = this.inputElements[
|
|
627
|
-
(_d = this.inputElements[
|
|
629
|
+
(_c = this.inputElements[constantsB97e736d.TimeType.Seconds]) === null || _c === void 0 ? void 0 : _c.focus();
|
|
630
|
+
(_d = this.inputElements[constantsB97e736d.TimeType.Seconds]) === null || _d === void 0 ? void 0 : _d.select();
|
|
628
631
|
}
|
|
629
632
|
}
|
|
630
633
|
// Parse a continuous time string (e.g., "123456") into hours, minutes, and seconds
|
|
@@ -678,26 +681,26 @@ const NvFieldtime = class {
|
|
|
678
681
|
if (this.disabled || this.readonly) {
|
|
679
682
|
return; // Do not toggle if disabled or read-only
|
|
680
683
|
}
|
|
681
|
-
if (this.open && this.inputElements[
|
|
684
|
+
if (this.open && this.inputElements[constantsB97e736d.TimeType.Hours]) {
|
|
682
685
|
this.open = false; // Close the popover if it is open
|
|
683
686
|
}
|
|
684
|
-
else if (this.open && this.inputElements[
|
|
687
|
+
else if (this.open && this.inputElements[constantsB97e736d.TimeType.Minutes]) {
|
|
685
688
|
this.open = false; // Close the popover if it is open
|
|
686
689
|
}
|
|
687
|
-
else if (this.open && this.inputElements[
|
|
690
|
+
else if (this.open && this.inputElements[constantsB97e736d.TimeType.Seconds]) {
|
|
688
691
|
this.open = false; // Close the popover if it is open
|
|
689
692
|
}
|
|
690
|
-
else if (!this.open && this.inputElements[
|
|
691
|
-
(_a = this.inputElements[
|
|
692
|
-
(_b = this.inputElements[
|
|
693
|
+
else if (!this.open && this.inputElements[constantsB97e736d.TimeType.Hours]) {
|
|
694
|
+
(_a = this.inputElements[constantsB97e736d.TimeType.Hours]) === null || _a === void 0 ? void 0 : _a.focus(); // Focus will open the popover
|
|
695
|
+
(_b = this.inputElements[constantsB97e736d.TimeType.Hours]) === null || _b === void 0 ? void 0 : _b.select();
|
|
693
696
|
}
|
|
694
|
-
else if (!this.open && this.inputElements[
|
|
695
|
-
(_c = this.inputElements[
|
|
696
|
-
(_d = this.inputElements[
|
|
697
|
+
else if (!this.open && this.inputElements[constantsB97e736d.TimeType.Minutes]) {
|
|
698
|
+
(_c = this.inputElements[constantsB97e736d.TimeType.Minutes]) === null || _c === void 0 ? void 0 : _c.focus(); // Focus will open the popover
|
|
699
|
+
(_d = this.inputElements[constantsB97e736d.TimeType.Minutes]) === null || _d === void 0 ? void 0 : _d.select();
|
|
697
700
|
}
|
|
698
|
-
else if (!this.open && this.inputElements[
|
|
699
|
-
(_e = this.inputElements[
|
|
700
|
-
(_f = this.inputElements[
|
|
701
|
+
else if (!this.open && this.inputElements[constantsB97e736d.TimeType.Seconds]) {
|
|
702
|
+
(_e = this.inputElements[constantsB97e736d.TimeType.Seconds]) === null || _e === void 0 ? void 0 : _e.focus(); // Focus will open the popover
|
|
703
|
+
(_f = this.inputElements[constantsB97e736d.TimeType.Seconds]) === null || _f === void 0 ? void 0 : _f.select();
|
|
701
704
|
}
|
|
702
705
|
else {
|
|
703
706
|
console.warn('nv-fieldtime -> No input elements found to focus or to blur');
|
|
@@ -719,13 +722,13 @@ const NvFieldtime = class {
|
|
|
719
722
|
}
|
|
720
723
|
handleTimeOptionClick(event, type) {
|
|
721
724
|
const option = parseInt(event.target.textContent || '0', 10);
|
|
722
|
-
if (type ===
|
|
725
|
+
if (type === constantsB97e736d.TimeType.Hours) {
|
|
723
726
|
this.hours = option.toString().padStart(2, '0');
|
|
724
727
|
}
|
|
725
|
-
else if (type ===
|
|
728
|
+
else if (type === constantsB97e736d.TimeType.Minutes) {
|
|
726
729
|
this.minutes = option.toString().padStart(2, '0');
|
|
727
730
|
}
|
|
728
|
-
else if (type ===
|
|
731
|
+
else if (type === constantsB97e736d.TimeType.Seconds) {
|
|
729
732
|
this.seconds = option.toString().padStart(2, '0');
|
|
730
733
|
}
|
|
731
734
|
const reconstructTime = this.reconstructTime();
|
|
@@ -776,11 +779,11 @@ const NvFieldtime = class {
|
|
|
776
779
|
}
|
|
777
780
|
// Generate the time options based on the type
|
|
778
781
|
switch (type) {
|
|
779
|
-
case
|
|
782
|
+
case constantsB97e736d.TimeType.Hours:
|
|
780
783
|
return this.generateHourOptions(stepInSeconds);
|
|
781
|
-
case
|
|
784
|
+
case constantsB97e736d.TimeType.Minutes:
|
|
782
785
|
return this.generateMinuteOptions(stepInSeconds);
|
|
783
|
-
case
|
|
786
|
+
case constantsB97e736d.TimeType.Seconds:
|
|
784
787
|
return this.generateSecondOptions(stepInSeconds);
|
|
785
788
|
default:
|
|
786
789
|
return [];
|
|
@@ -882,8 +885,8 @@ const NvFieldtime = class {
|
|
|
882
885
|
}
|
|
883
886
|
if (!this.open) {
|
|
884
887
|
if (this.inputElements) {
|
|
885
|
-
(_a = this.inputElements[
|
|
886
|
-
(_b = this.inputElements[
|
|
888
|
+
(_a = this.inputElements[constantsB97e736d.TimeType.Hours]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
889
|
+
(_b = this.inputElements[constantsB97e736d.TimeType.Hours]) === null || _b === void 0 ? void 0 : _b.select();
|
|
887
890
|
}
|
|
888
891
|
event.preventDefault();
|
|
889
892
|
}
|
|
@@ -973,32 +976,32 @@ const NvFieldtime = class {
|
|
|
973
976
|
RenderTimeOptionsColumn(type) {
|
|
974
977
|
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: {
|
|
975
978
|
'time-option': true,
|
|
976
|
-
'selected': (type ===
|
|
977
|
-
(type ===
|
|
978
|
-
(type ===
|
|
979
|
+
'selected': (type === constantsB97e736d.TimeType.Hours && option === this.hours) ||
|
|
980
|
+
(type === constantsB97e736d.TimeType.Minutes && option === this.minutes) ||
|
|
981
|
+
(type === constantsB97e736d.TimeType.Seconds && option === this.seconds),
|
|
979
982
|
}, key: `${option}-${index$1}`, onClick: e => this.handleTimeOptionClick(e, type) }, option)))));
|
|
980
983
|
}
|
|
981
984
|
render() {
|
|
982
|
-
return (index.h(index.Host, { key: '
|
|
983
|
-
index.h("input", { key: '
|
|
984
|
-
? `${
|
|
985
|
-
:
|
|
985
|
+
return (index.h(index.Host, { key: '35103e6a56955d04ad395b286aaaeaca1493a20e', onclick: e => this.handleHostClick(e) }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '38ffb7ddf37dc7d3f355975c3ae348f5581d384a', htmlFor: this.inputId }, index.h("slot", { key: '1c41f684aaefd52ae677837ffd55a9895b95524a', name: "label" }, this.label))), index.h("nv-popover", { key: '325272affdd386690964974b73579f7314e8b464', ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, index.h("div", { key: '707b2fcd563ea92b818bf5599f8f68f7425fbdc6', class: "input-wrapper", slot: "trigger" }, index.h("slot", { key: '813597cca8808f9f298eadc8a0dde73714bfcff3', name: "before-input" }), index.h("div", { key: '47f26e41427825610e37380c929b24dcddb2dc62', class: "input-container" }, index.h("slot", { key: 'fd17ba01bb66bfcb9972a8145f31f94c8ef21fe1', name: "leading-input" }), startsWithIgnoreCase(this.format, 'HH') && [
|
|
986
|
+
index.h("input", { key: '759608690e370bdb8a61f2d622133558c77c6d0c', ref: el => (this.inputElements[constantsB97e736d.TimeType.Hours] = el), type: "number", autofocus: this.autofocus, class: "time-input", pattern: "[0-9]*", maxlength: "3", value: this.hours, onInput: e => this.handleInputChange(e, constantsB97e736d.TimeType.Hours), placeholder: this.format.includes('hh') ? 'hh' : 'HH', inputMode: "numeric", onFocus: () => this.handleFocus(constantsB97e736d.TimeType.Hours), name: this.name
|
|
987
|
+
? `${constantsB97e736d.TimeType.Hours}-${this.name}`
|
|
988
|
+
: constantsB97e736d.TimeType.Hours, id: this.inputId, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
|
|
986
989
|
], this.format.includes('mm') && [
|
|
987
|
-
index.h("span", { key: '
|
|
988
|
-
index.h("input", { key: '
|
|
989
|
-
? `${
|
|
990
|
-
:
|
|
990
|
+
index.h("span", { key: 'a377170431ef27f284d368e56d6236c64067e0ca' }, ":"),
|
|
991
|
+
index.h("input", { key: '6cc8faeed02d689a1353966888b0b4dedd8ecb98', ref: el => (this.inputElements[constantsB97e736d.TimeType.Minutes] = el), type: "number", autofocus: this.autofocus, class: "time-input", pattern: "[0-9]*", maxlength: "3", value: this.minutes, onInput: e => this.handleInputChange(e, constantsB97e736d.TimeType.Minutes), placeholder: "mm", inputMode: "numeric", onFocus: () => this.handleFocus(constantsB97e736d.TimeType.Minutes), name: this.name
|
|
992
|
+
? `${constantsB97e736d.TimeType.Minutes}-${this.name}`
|
|
993
|
+
: constantsB97e736d.TimeType.Minutes, id: `${this.inputId}-minutes`, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
|
|
991
994
|
], this.format.includes('ss') && [
|
|
992
|
-
index.h("span", { key: '
|
|
993
|
-
index.h("input", { key: '
|
|
994
|
-
? `${
|
|
995
|
-
:
|
|
996
|
-
], index.h("nv-iconbutton", { key: '
|
|
997
|
-
this.RenderTimeOptionsColumn(
|
|
998
|
-
this.RenderTimeOptionsColumn(
|
|
999
|
-
this.RenderTimeOptionsColumn(
|
|
1000
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
1001
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '
|
|
995
|
+
index.h("span", { key: '13da159f3ff13969d501968881569658d06c50fb' }, ":"),
|
|
996
|
+
index.h("input", { key: 'cbac3e8a980397c8f32e1f1056aec8b7aab3be0b', ref: el => (this.inputElements[constantsB97e736d.TimeType.Seconds] = el), type: "number", autofocus: this.autofocus, class: "time-input", pattern: "[0-9]*", maxlength: "3", value: this.seconds, onInput: e => this.handleInputChange(e, constantsB97e736d.TimeType.Seconds), placeholder: "ss", inputMode: "numeric", onFocus: () => this.handleFocus(constantsB97e736d.TimeType.Seconds), name: this.name
|
|
997
|
+
? `${constantsB97e736d.TimeType.Seconds}-${this.name}`
|
|
998
|
+
: constantsB97e736d.TimeType.Seconds, id: `${this.inputId}-seconds`, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
|
|
999
|
+
], index.h("nv-iconbutton", { key: 'a1a59be923f3529d1d2dbad02b322306fdd6dcb6', name: this.open ? 'chevron-top' : 'chevron-down', size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide time picker' : 'Show time picker', "aria-pressed": this.open.toString(), onClick: () => this.HandleDropdownIconClick() }), this.error && (index.h("nv-icon", { key: '7f51d7b568096e6aee23560d5fe6e52018711aa3', name: "alert-circle", class: "validation", size: "sm" })), this.success && (index.h("nv-icon", { key: '1c94f8138e808ec3a7690079dc8c8ea210ebb1da', name: "circle-check", class: "validation", size: "sm" }))), index.h("slot", { key: '7aa247775d7f59eb452fa9f4b511b3a92c88b8fe', name: "after-input" })), index.h("div", { key: 'b4dab6c5161e69b217748916026f41d9157bb786', class: "time-dropdown", slot: "content" }, index.h("div", { key: '6d865e6aa3b4d278e4ebff064d417ea42c1d4fe1', class: "time-columns" }, startsWithIgnoreCase(this.format, 'HH') &&
|
|
1000
|
+
this.RenderTimeOptionsColumn(constantsB97e736d.TimeType.Hours), this.format.includes('mm') &&
|
|
1001
|
+
this.RenderTimeOptionsColumn(constantsB97e736d.TimeType.Minutes), this.format.includes('ss') &&
|
|
1002
|
+
this.RenderTimeOptionsColumn(constantsB97e736d.TimeType.Seconds)))), (this.description ||
|
|
1003
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '03922dee26128b93d4e8d7f936ada9d3981d1e36', class: "description" }, index.h("slot", { key: '4aa71a2b10e488c845106aace0a972df790eb450', name: "description" }, this.description))), (this.errorDescription ||
|
|
1004
|
+
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '657232381bcc3644eae65a1beae302c8136b9e8b', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '0559dbdb62c70b19c73839a2795dc23fa97eddb1', name: "error-description" }, this.errorDescription)))));
|
|
1002
1005
|
}
|
|
1003
1006
|
static get formAssociated() { return true; }
|
|
1004
1007
|
get el() { return index.getElement(this); }
|