@nova-design-system/nova-webcomponents 3.18.0-beta.0 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +20 -2
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/native.cjs.js +1 -1
- package/dist/cjs/nv-fieldtime.cjs.entry.js +556 -496
- package/dist/cjs/nv-fieldtime.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-icon.cjs.entry.js +1 -1
- package/dist/cjs/nv-iconbutton_2.cjs.entry.js +2 -2
- package/dist/cjs/nv-menu.cjs.entry.js +1 -1
- package/dist/cjs/nv-menuitem.cjs.entry.js +1 -1
- package/dist/cjs/nv-notification.cjs.entry.js +1 -1
- package/dist/cjs/nv-notificationcontainer.cjs.entry.js +1 -1
- package/dist/cjs/nv-popover.cjs.entry.js +1 -1
- package/dist/cjs/nv-row.cjs.entry.js +1 -1
- package/dist/cjs/nv-split.cjs.entry.js +1 -1
- package/dist/cjs/nv-stack.cjs.entry.js +1 -1
- package/dist/cjs/nv-table.cjs.entry.js +1 -1
- package/dist/cjs/nv-toggle.cjs.entry.js +2 -2
- package/dist/cjs/nv-togglebutton.cjs.entry.js +1 -1
- package/dist/cjs/nv-togglebuttongroup.cjs.entry.js +1 -1
- package/dist/cjs/nv-tooltip.cjs.entry.js +1 -1
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.docs.js +6 -0
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.docs.js.map +1 -1
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +331 -497
- package/dist/collection/components/nv-fieldtime/nv-fieldtime.js.map +1 -1
- package/dist/collection/components/nv-fieldtime/styles/nv-fieldtime.css +1 -0
- package/dist/collection/components/nv-fieldtime/utils/format-utils.js +236 -0
- package/dist/collection/components/nv-fieldtime/utils/format-utils.js.map +1 -0
- package/dist/collection/components/nv-icon/nv-icon.js +1 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +1 -1
- package/dist/collection/components/nv-loader/nv-loader.js +1 -1
- package/dist/collection/components/nv-menu/nv-menu.js +1 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.js +1 -1
- package/dist/collection/components/nv-notification/nv-notification.js +1 -1
- package/dist/collection/components/nv-notificationcontainer/nv-notificationcontainer.js +1 -1
- package/dist/collection/components/nv-popover/nv-popover.js +1 -1
- package/dist/collection/components/nv-row/nv-row.js +1 -1
- package/dist/collection/components/nv-split/nv-split.js +1 -1
- package/dist/collection/components/nv-stack/nv-stack.js +1 -1
- package/dist/collection/components/nv-table/nv-table.js +1 -1
- package/dist/collection/components/nv-toggle/nv-toggle.js +2 -2
- package/dist/collection/components/nv-togglebutton/nv-togglebutton.js +1 -1
- package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.js +1 -1
- package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
- package/dist/components/index.js +20 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/nv-accordion-item.js +1 -1
- package/dist/components/nv-accordion.js +4 -4
- package/dist/components/nv-alert.js +1 -1
- package/dist/components/nv-avatar.js +1 -1
- package/dist/components/nv-badge.js +1 -1
- package/dist/components/nv-breadcrumb.js +2 -2
- package/dist/components/nv-button.js +1 -1
- package/dist/components/nv-datagrid.js +2 -2
- package/dist/components/nv-dialog.js +4 -4
- package/dist/components/nv-dialogfooter.js +1 -1
- package/dist/components/nv-fielddate.js +4 -4
- package/dist/components/nv-fielddaterange.js +4 -4
- package/dist/components/nv-fielddropdown.js +5 -5
- package/dist/components/nv-fielddropdownitem.js +1 -1
- package/dist/components/nv-fieldmultiselect.js +5 -5
- package/dist/components/nv-fieldnumber.js +1 -1
- package/dist/components/nv-fieldpassword.js +3 -3
- package/dist/components/nv-fieldselect.js +3 -3
- package/dist/components/nv-fieldslider.js +4 -4
- package/dist/components/nv-fieldtext.js +1 -1
- package/dist/components/nv-fieldtime.js +562 -501
- package/dist/components/nv-fieldtime.js.map +1 -1
- package/dist/components/nv-icon.js +1 -1
- package/dist/components/nv-iconbutton.js +1 -1
- package/dist/components/nv-loader.js +1 -1
- package/dist/components/nv-menu.js +4 -4
- package/dist/components/nv-menuitem.js +1 -1
- package/dist/components/nv-notification.js +2 -2
- package/dist/components/nv-notificationcontainer.js +1 -1
- package/dist/components/nv-popover.js +1 -1
- package/dist/components/nv-row.js +1 -1
- package/dist/components/nv-split.js +1 -1
- package/dist/components/nv-stack.js +1 -1
- package/dist/components/nv-table.js +1 -1
- package/dist/components/nv-toggle.js +2 -2
- package/dist/components/nv-togglebutton.js +1 -1
- package/dist/components/nv-togglebuttongroup.js +1 -1
- package/dist/components/nv-tooltip.js +1 -1
- package/dist/components/{p-811c9225.js → p-015330b8.js} +2 -2
- package/dist/components/{p-811c9225.js.map → p-015330b8.js.map} +1 -1
- package/dist/components/{p-e43a36c4.js → p-1bd396b1.js} +4 -4
- package/dist/components/{p-e43a36c4.js.map → p-1bd396b1.js.map} +1 -1
- package/dist/components/{p-9e7468e3.js → p-2574f8c2.js} +2 -2
- package/dist/components/{p-9e7468e3.js.map → p-2574f8c2.js.map} +1 -1
- package/dist/components/{p-6e67bfc0.js → p-4cd6f629.js} +2 -2
- package/dist/components/{p-6e67bfc0.js.map → p-4cd6f629.js.map} +1 -1
- package/dist/components/{p-766a3f49.js → p-5e315239.js} +2 -2
- package/dist/components/{p-766a3f49.js.map → p-5e315239.js.map} +1 -1
- package/dist/components/{p-7684ad27.js → p-6ca3d847.js} +4 -4
- package/dist/components/{p-7684ad27.js.map → p-6ca3d847.js.map} +1 -1
- package/dist/components/{p-98429fd7.js → p-c981bb48.js} +2 -2
- package/dist/components/{p-98429fd7.js.map → p-c981bb48.js.map} +1 -1
- package/dist/components/{p-147cefeb.js → p-d1b02966.js} +4 -4
- package/dist/components/{p-147cefeb.js.map → p-d1b02966.js.map} +1 -1
- package/dist/components/{p-6f2b257e.js → p-ea45f1ab.js} +3 -3
- package/dist/components/{p-6f2b257e.js.map → p-ea45f1ab.js.map} +1 -1
- package/dist/components/{p-63595ea1.js → p-ebfecbaa.js} +2 -2
- package/dist/components/{p-63595ea1.js.map → p-ebfecbaa.js.map} +1 -1
- package/dist/components/{p-be6e2884.js → p-ed43bcec.js} +2 -2
- package/dist/components/{p-be6e2884.js.map → p-ed43bcec.js.map} +1 -1
- package/dist/components/{p-47a33f6b.js → p-fabbaf47.js} +4 -4
- package/dist/components/{p-47a33f6b.js.map → p-fabbaf47.js.map} +1 -1
- package/dist/components/{p-ec31af69.js → p-fca4d85b.js} +3 -3
- package/dist/components/{p-ec31af69.js.map → p-fca4d85b.js.map} +1 -1
- package/dist/esm/index.js +20 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/native.js +1 -1
- package/dist/esm/nv-fieldtime.entry.js +557 -497
- package/dist/esm/nv-fieldtime.entry.js.map +1 -1
- package/dist/esm/nv-icon.entry.js +1 -1
- package/dist/esm/nv-iconbutton_2.entry.js +2 -2
- package/dist/esm/nv-menu.entry.js +1 -1
- package/dist/esm/nv-menuitem.entry.js +1 -1
- package/dist/esm/nv-notification.entry.js +1 -1
- package/dist/esm/nv-notificationcontainer.entry.js +1 -1
- package/dist/esm/nv-popover.entry.js +1 -1
- package/dist/esm/nv-row.entry.js +1 -1
- package/dist/esm/nv-split.entry.js +1 -1
- package/dist/esm/nv-stack.entry.js +1 -1
- package/dist/esm/nv-table.entry.js +1 -1
- package/dist/esm/nv-toggle.entry.js +2 -2
- package/dist/esm/nv-togglebutton.entry.js +1 -1
- package/dist/esm/nv-togglebuttongroup.entry.js +1 -1
- package/dist/esm/nv-tooltip.entry.js +1 -1
- package/dist/native/index.esm.js +1 -1
- package/dist/native/index.esm.js.map +1 -1
- package/dist/native/native.esm.js +1 -1
- package/dist/native/native.esm.js.map +1 -1
- package/dist/native/{p-f30e0be6.entry.js → p-00d1e5e1.entry.js} +2 -2
- package/dist/native/{p-91fab6c2.entry.js → p-14d2f70a.entry.js} +2 -2
- package/dist/native/{p-d94bf052.entry.js → p-3464b86a.entry.js} +2 -2
- package/dist/native/{p-638967bf.entry.js → p-417fba7d.entry.js} +2 -2
- package/dist/native/{p-52d2c0ae.entry.js → p-4e6fb719.entry.js} +2 -2
- package/dist/native/{p-cb0293ec.entry.js → p-539666dd.entry.js} +2 -2
- package/dist/native/{p-2364aefa.entry.js → p-5c678bc7.entry.js} +2 -2
- package/dist/native/{p-bcf41cd0.entry.js → p-5e70f9ce.entry.js} +2 -2
- package/dist/native/{p-278613a3.entry.js → p-5f98d4cd.entry.js} +2 -2
- package/dist/native/p-8c053954.entry.js +2 -0
- package/dist/native/p-8c053954.entry.js.map +1 -0
- package/dist/native/{p-2dfd786f.entry.js → p-ad029453.entry.js} +2 -2
- package/dist/native/{p-9d7e099f.entry.js → p-ae43eee2.entry.js} +2 -2
- package/dist/native/{p-74572fce.entry.js → p-b72b5e88.entry.js} +2 -2
- package/dist/native/{p-ce97ce24.entry.js → p-ca39f78d.entry.js} +2 -2
- package/dist/native/{p-647a0765.entry.js → p-da2060a5.entry.js} +2 -2
- package/dist/native/{p-14e622e1.entry.js → p-e5b7ce4e.entry.js} +2 -2
- package/dist/types/components/nv-fieldtime/nv-fieldtime.d.ts +50 -2
- package/dist/types/components/nv-fieldtime/utils/format-utils.d.ts +63 -0
- package/dist/types/components.d.ts +20 -3
- package/dist/vscode-data.json +2 -2
- package/hydrate/index.js +569 -521
- package/hydrate/index.mjs +569 -521
- package/package.json +1 -1
- package/dist/cjs/string.utils-9c581350.js +0 -25
- package/dist/cjs/string.utils-9c581350.js.map +0 -1
- package/dist/components/p-a5c8eee9.js +0 -22
- package/dist/components/p-a5c8eee9.js.map +0 -1
- package/dist/esm/string.utils-16aed4a7.js +0 -22
- package/dist/esm/string.utils-16aed4a7.js.map +0 -1
- package/dist/native/p-a5c8eee9.js +0 -2
- package/dist/native/p-a5c8eee9.js.map +0 -1
- package/dist/native/p-ddc41f1f.entry.js +0 -2
- package/dist/native/p-ddc41f1f.entry.js.map +0 -1
- /package/dist/native/{p-f30e0be6.entry.js.map → p-00d1e5e1.entry.js.map} +0 -0
- /package/dist/native/{p-91fab6c2.entry.js.map → p-14d2f70a.entry.js.map} +0 -0
- /package/dist/native/{p-d94bf052.entry.js.map → p-3464b86a.entry.js.map} +0 -0
- /package/dist/native/{p-638967bf.entry.js.map → p-417fba7d.entry.js.map} +0 -0
- /package/dist/native/{p-52d2c0ae.entry.js.map → p-4e6fb719.entry.js.map} +0 -0
- /package/dist/native/{p-cb0293ec.entry.js.map → p-539666dd.entry.js.map} +0 -0
- /package/dist/native/{p-2364aefa.entry.js.map → p-5c678bc7.entry.js.map} +0 -0
- /package/dist/native/{p-bcf41cd0.entry.js.map → p-5e70f9ce.entry.js.map} +0 -0
- /package/dist/native/{p-278613a3.entry.js.map → p-5f98d4cd.entry.js.map} +0 -0
- /package/dist/native/{p-2dfd786f.entry.js.map → p-ad029453.entry.js.map} +0 -0
- /package/dist/native/{p-9d7e099f.entry.js.map → p-ae43eee2.entry.js.map} +0 -0
- /package/dist/native/{p-74572fce.entry.js.map → p-b72b5e88.entry.js.map} +0 -0
- /package/dist/native/{p-ce97ce24.entry.js.map → p-ca39f78d.entry.js.map} +0 -0
- /package/dist/native/{p-647a0765.entry.js.map → p-da2060a5.entry.js.map} +0 -0
- /package/dist/native/{p-14e622e1.entry.js.map → p-e5b7ce4e.entry.js.map} +0 -0
package/hydrate/index.mjs
CHANGED
|
@@ -22618,23 +22618,247 @@ class NvFieldtextarea {
|
|
|
22618
22618
|
}
|
|
22619
22619
|
|
|
22620
22620
|
/**
|
|
22621
|
-
*
|
|
22622
|
-
* @param {string} str - The string to check.
|
|
22623
|
-
* @param {string} prefix - The prefix to check for.
|
|
22624
|
-
* @returns {boolean} - True if the string starts with the prefix, ignoring case.
|
|
22625
|
-
* @example startsWithIgnoreCase('Hello, world!', 'hello') // true
|
|
22626
|
-
* @example startsWithIgnoreCase('Hello, world!', 'world') // false
|
|
22621
|
+
* Format configurations for all supported time formats
|
|
22627
22622
|
*/
|
|
22628
|
-
|
|
22629
|
-
|
|
22623
|
+
const FORMAT_CONFIGS = {
|
|
22624
|
+
'HH': {
|
|
22625
|
+
pattern: /^([0-1]?[0-9]|2[0-3])$/,
|
|
22626
|
+
parts: [TimeType.Hours],
|
|
22627
|
+
defaultValue: '00',
|
|
22628
|
+
maxLength: 2,
|
|
22629
|
+
},
|
|
22630
|
+
'HH:mm': {
|
|
22631
|
+
pattern: /^([0-1]?[0-9]|2[0-3]):([0-5]?[0-9])$/,
|
|
22632
|
+
parts: [TimeType.Hours, TimeType.Minutes],
|
|
22633
|
+
defaultValue: '00:00',
|
|
22634
|
+
maxLength: 5,
|
|
22635
|
+
},
|
|
22636
|
+
'HH:mm:ss': {
|
|
22637
|
+
pattern: /^([0-1]?[0-9]|2[0-3]):([0-5]?[0-9]):([0-5]?[0-9])$/,
|
|
22638
|
+
parts: [TimeType.Hours, TimeType.Minutes, TimeType.Seconds],
|
|
22639
|
+
defaultValue: '00:00:00',
|
|
22640
|
+
maxLength: 8,
|
|
22641
|
+
},
|
|
22642
|
+
'hh': {
|
|
22643
|
+
pattern: /^(0?[1-9]|1[0-2])$/,
|
|
22644
|
+
parts: [TimeType.Hours],
|
|
22645
|
+
defaultValue: '01',
|
|
22646
|
+
maxLength: 2,
|
|
22647
|
+
},
|
|
22648
|
+
'hh:mm': {
|
|
22649
|
+
pattern: /^(0?[1-9]|1[0-2]):([0-5]?[0-9])$/,
|
|
22650
|
+
parts: [TimeType.Hours, TimeType.Minutes],
|
|
22651
|
+
defaultValue: '01:00',
|
|
22652
|
+
maxLength: 5,
|
|
22653
|
+
},
|
|
22654
|
+
'hh:mm:ss': {
|
|
22655
|
+
pattern: /^(0?[1-9]|1[0-2]):([0-5]?[0-9]):([0-5]?[0-9])$/,
|
|
22656
|
+
parts: [TimeType.Hours, TimeType.Minutes, TimeType.Seconds],
|
|
22657
|
+
defaultValue: '01:00:00',
|
|
22658
|
+
maxLength: 8,
|
|
22659
|
+
},
|
|
22660
|
+
};
|
|
22661
|
+
/**
|
|
22662
|
+
* Returns the visible time types for a given format
|
|
22663
|
+
* @param {string} format - The time format string
|
|
22664
|
+
* @returns {TimeType[]} Array of TimeType values that should be visible
|
|
22665
|
+
*/
|
|
22666
|
+
function getVisibleTimeTypes(format) {
|
|
22667
|
+
const config = FORMAT_CONFIGS[format];
|
|
22668
|
+
if (!config) {
|
|
22669
|
+
// Fallback for unknown formats
|
|
22670
|
+
return [TimeType.Hours, TimeType.Minutes, TimeType.Seconds];
|
|
22671
|
+
}
|
|
22672
|
+
return config.parts;
|
|
22673
|
+
}
|
|
22674
|
+
/**
|
|
22675
|
+
* Validates if a given value string matches the expected format pattern
|
|
22676
|
+
* @param {string} value - The time value string to validate
|
|
22677
|
+
* @param {string} format - The expected time format
|
|
22678
|
+
* @returns {boolean} True if the value matches the format, false otherwise
|
|
22679
|
+
*/
|
|
22680
|
+
function isValidFormatValue(value, format) {
|
|
22681
|
+
if (!value || !format) {
|
|
22682
|
+
return false;
|
|
22683
|
+
}
|
|
22684
|
+
const config = FORMAT_CONFIGS[format];
|
|
22685
|
+
if (!config) {
|
|
22630
22686
|
return false;
|
|
22631
|
-
|
|
22687
|
+
}
|
|
22688
|
+
return config.pattern.test(value);
|
|
22689
|
+
}
|
|
22690
|
+
/**
|
|
22691
|
+
* Parses a time value string according to the specified format
|
|
22692
|
+
* Handles both full and partial time strings with backward compatibility
|
|
22693
|
+
* @param {string} value - The time value string to parse
|
|
22694
|
+
* @param {string} format - The target time format
|
|
22695
|
+
* @returns {TimeComponents} TimeComponents object with parsed hours, minutes, and seconds
|
|
22696
|
+
*/
|
|
22697
|
+
function parseValueByFormat(value, format) {
|
|
22698
|
+
const config = FORMAT_CONFIGS[format];
|
|
22699
|
+
const defaultComponents = {
|
|
22700
|
+
hours: format.startsWith('hh') ? '01' : '00',
|
|
22701
|
+
minutes: '00',
|
|
22702
|
+
seconds: '00',
|
|
22703
|
+
};
|
|
22704
|
+
if (!value || !config) {
|
|
22705
|
+
return defaultComponents;
|
|
22706
|
+
}
|
|
22707
|
+
// Clean the input value - remove non-numeric characters except colons
|
|
22708
|
+
const cleanValue = value.replace(/[^0-9:]/g, '');
|
|
22709
|
+
// Try to match the exact format first
|
|
22710
|
+
const exactMatch = cleanValue.match(config.pattern);
|
|
22711
|
+
if (exactMatch) {
|
|
22712
|
+
return extractComponentsFromMatch(exactMatch, format);
|
|
22713
|
+
}
|
|
22714
|
+
// Handle backward compatibility - parse full format values when format is shorter
|
|
22715
|
+
const fullFormatPattern = /^([0-1]?[0-9]|2[0-3]):([0-5]?[0-9]):([0-5]?[0-9])$/;
|
|
22716
|
+
const fullMatch = cleanValue.match(fullFormatPattern);
|
|
22717
|
+
if (fullMatch) {
|
|
22718
|
+
const fullComponents = extractComponentsFromMatch(fullMatch, 'HH:mm:ss');
|
|
22719
|
+
return extractRelevantComponents(fullComponents, format);
|
|
22720
|
+
}
|
|
22721
|
+
// Handle partial format values - try to parse what we can
|
|
22722
|
+
const parts = cleanValue.split(':');
|
|
22723
|
+
const result = Object.assign({}, defaultComponents);
|
|
22724
|
+
if (parts.length >= 1 && parts[0]) {
|
|
22725
|
+
const hours = parseInt(parts[0], 10);
|
|
22726
|
+
if (!isNaN(hours)) {
|
|
22727
|
+
if (format.startsWith('hh')) {
|
|
22728
|
+
// 12-hour format validation
|
|
22729
|
+
if (hours >= 1 && hours <= 12) {
|
|
22730
|
+
result.hours = hours.toString().padStart(2, '0');
|
|
22731
|
+
}
|
|
22732
|
+
else {
|
|
22733
|
+
// Invalid hour for 12-hour format, keep default
|
|
22734
|
+
result.hours = defaultComponents.hours;
|
|
22735
|
+
}
|
|
22736
|
+
}
|
|
22737
|
+
else {
|
|
22738
|
+
// 24-hour format validation
|
|
22739
|
+
if (hours >= 0 && hours <= 23) {
|
|
22740
|
+
result.hours = hours.toString().padStart(2, '0');
|
|
22741
|
+
}
|
|
22742
|
+
else {
|
|
22743
|
+
// Invalid hour for 24-hour format, keep default
|
|
22744
|
+
result.hours = defaultComponents.hours;
|
|
22745
|
+
}
|
|
22746
|
+
}
|
|
22747
|
+
}
|
|
22748
|
+
}
|
|
22749
|
+
if (parts.length >= 2 &&
|
|
22750
|
+
parts[1] &&
|
|
22751
|
+
config.parts.includes(TimeType.Minutes)) {
|
|
22752
|
+
const minutes = parseInt(parts[1], 10);
|
|
22753
|
+
if (!isNaN(minutes) && minutes >= 0 && minutes <= 59) {
|
|
22754
|
+
result.minutes = minutes.toString().padStart(2, '0');
|
|
22755
|
+
}
|
|
22756
|
+
}
|
|
22757
|
+
if (parts.length >= 3 &&
|
|
22758
|
+
parts[2] &&
|
|
22759
|
+
config.parts.includes(TimeType.Seconds)) {
|
|
22760
|
+
const seconds = parseInt(parts[2], 10);
|
|
22761
|
+
if (!isNaN(seconds) && seconds >= 0 && seconds <= 59) {
|
|
22762
|
+
result.seconds = seconds.toString().padStart(2, '0');
|
|
22763
|
+
}
|
|
22764
|
+
}
|
|
22765
|
+
return result;
|
|
22766
|
+
}
|
|
22767
|
+
/**
|
|
22768
|
+
* Extracts time components from a regex match result
|
|
22769
|
+
* @param {RegExpMatchArray} match - The regex match result
|
|
22770
|
+
* @param {string} format - The format that was matched
|
|
22771
|
+
* @returns {TimeComponents} TimeComponents object
|
|
22772
|
+
*/
|
|
22773
|
+
function extractComponentsFromMatch(match, format) {
|
|
22774
|
+
const result = {
|
|
22775
|
+
hours: format.startsWith('hh') ? '01' : '00',
|
|
22776
|
+
minutes: '00',
|
|
22777
|
+
seconds: '00',
|
|
22778
|
+
};
|
|
22779
|
+
if (match[1]) {
|
|
22780
|
+
result.hours = parseInt(match[1], 10).toString().padStart(2, '0');
|
|
22781
|
+
}
|
|
22782
|
+
if (match[2]) {
|
|
22783
|
+
result.minutes = parseInt(match[2], 10).toString().padStart(2, '0');
|
|
22784
|
+
}
|
|
22785
|
+
if (match[3]) {
|
|
22786
|
+
result.seconds = parseInt(match[3], 10).toString().padStart(2, '0');
|
|
22787
|
+
}
|
|
22788
|
+
return result;
|
|
22789
|
+
}
|
|
22790
|
+
/**
|
|
22791
|
+
* Extracts only the relevant components based on the target format
|
|
22792
|
+
* @param {TimeComponents} components - Full time components
|
|
22793
|
+
* @param {string} format - Target format to extract components for
|
|
22794
|
+
* @returns {TimeComponents} TimeComponents with only relevant parts
|
|
22795
|
+
*/
|
|
22796
|
+
function extractRelevantComponents(components, format) {
|
|
22797
|
+
const config = FORMAT_CONFIGS[format];
|
|
22798
|
+
const result = {
|
|
22799
|
+
hours: format.startsWith('hh') ? '01' : '00',
|
|
22800
|
+
minutes: '00',
|
|
22801
|
+
seconds: '00',
|
|
22802
|
+
};
|
|
22803
|
+
if (config.parts.includes(TimeType.Hours)) {
|
|
22804
|
+
// Validate hours for the target format
|
|
22805
|
+
const hours = parseInt(components.hours, 10);
|
|
22806
|
+
if (format.startsWith('hh')) {
|
|
22807
|
+
// 12-hour format validation
|
|
22808
|
+
if (hours >= 1 && hours <= 12) {
|
|
22809
|
+
result.hours = components.hours;
|
|
22810
|
+
}
|
|
22811
|
+
// If invalid, keep the default '01'
|
|
22812
|
+
}
|
|
22813
|
+
else {
|
|
22814
|
+
// 24-hour format validation
|
|
22815
|
+
if (hours >= 0 && hours <= 23) {
|
|
22816
|
+
result.hours = components.hours;
|
|
22817
|
+
}
|
|
22818
|
+
// If invalid, keep the default '00'
|
|
22819
|
+
}
|
|
22820
|
+
}
|
|
22821
|
+
if (config.parts.includes(TimeType.Minutes)) {
|
|
22822
|
+
result.minutes = components.minutes;
|
|
22823
|
+
}
|
|
22824
|
+
if (config.parts.includes(TimeType.Seconds)) {
|
|
22825
|
+
result.seconds = components.seconds;
|
|
22826
|
+
}
|
|
22827
|
+
return result;
|
|
22828
|
+
}
|
|
22829
|
+
/**
|
|
22830
|
+
* Reconstructs a time string from components according to the specified format
|
|
22831
|
+
* @param {TimeComponents} components - Time components to reconstruct
|
|
22832
|
+
* @param {string} format - Target format for reconstruction
|
|
22833
|
+
* @returns {string} Formatted time string
|
|
22834
|
+
*/
|
|
22835
|
+
function reconstructTimeByFormat(components, format) {
|
|
22836
|
+
const config = FORMAT_CONFIGS[format];
|
|
22837
|
+
if (!config) {
|
|
22838
|
+
return `${components.hours}:${components.minutes}:${components.seconds}`;
|
|
22839
|
+
}
|
|
22840
|
+
switch (format) {
|
|
22841
|
+
case 'HH':
|
|
22842
|
+
case 'hh':
|
|
22843
|
+
return components.hours;
|
|
22844
|
+
case 'HH:mm':
|
|
22845
|
+
case 'hh:mm':
|
|
22846
|
+
return `${components.hours}:${components.minutes}`;
|
|
22847
|
+
case 'HH:mm:ss':
|
|
22848
|
+
case 'hh:mm:ss':
|
|
22849
|
+
return `${components.hours}:${components.minutes}:${components.seconds}`;
|
|
22850
|
+
default:
|
|
22851
|
+
return `${components.hours}:${components.minutes}:${components.seconds}`;
|
|
22852
|
+
}
|
|
22632
22853
|
}
|
|
22633
22854
|
|
|
22634
|
-
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}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)}";
|
|
22855
|
+
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)}";
|
|
22635
22856
|
var NvFieldtimeStyle0 = nvFieldtimeCss;
|
|
22636
22857
|
|
|
22637
22858
|
/**
|
|
22859
|
+
* A format-aware time input component that displays only relevant input fields based on the specified format.
|
|
22860
|
+
* The component ensures consistency between the format property and both input validation and value emission.
|
|
22861
|
+
*
|
|
22638
22862
|
* @slot label - Content to be placed as the label, will override the label prop.
|
|
22639
22863
|
* @slot before-input - Content to be placed before the input text, outside the input container.
|
|
22640
22864
|
* @slot after-input - Content to be placed after the input text, outside the input container.
|
|
@@ -22699,6 +22923,10 @@ class NvFieldtime {
|
|
|
22699
22923
|
* - hh: 12-hour format (01-12)
|
|
22700
22924
|
* - hh:mm: 12-hour format with minutes (01:00-12:59)
|
|
22701
22925
|
* - hh:mm:ss: 12-hour format with minutes and seconds (01:00:00-12:59:59)
|
|
22926
|
+
*
|
|
22927
|
+
* The component automatically shows only the relevant input fields based on the selected format.
|
|
22928
|
+
* When the format changes dynamically, the component re-parses the current value and updates
|
|
22929
|
+
* the visible fields accordingly.
|
|
22702
22930
|
*/
|
|
22703
22931
|
this.format = 'HH:mm:ss';
|
|
22704
22932
|
/**
|
|
@@ -22727,7 +22955,7 @@ class NvFieldtime {
|
|
|
22727
22955
|
this.open = event.detail;
|
|
22728
22956
|
}
|
|
22729
22957
|
handleKeyDown(event) {
|
|
22730
|
-
var _a, _b
|
|
22958
|
+
var _a, _b;
|
|
22731
22959
|
if (!this.open) {
|
|
22732
22960
|
if (event.key === 'ArrowDown') {
|
|
22733
22961
|
this.open = true;
|
|
@@ -22762,20 +22990,22 @@ class NvFieldtime {
|
|
|
22762
22990
|
else if (event.key === 'Enter' && currentIndex >= 0) {
|
|
22763
22991
|
event.preventDefault();
|
|
22764
22992
|
items[currentIndex].click();
|
|
22765
|
-
|
|
22766
|
-
|
|
22767
|
-
|
|
22768
|
-
|
|
22769
|
-
|
|
22770
|
-
|
|
22771
|
-
(
|
|
22772
|
-
(
|
|
22993
|
+
// Navigate to the next visible field
|
|
22994
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
22995
|
+
const currentTypeIndex = visibleTypes.indexOf(this.typeFocused);
|
|
22996
|
+
const nextTypeIndex = currentTypeIndex + 1;
|
|
22997
|
+
if (nextTypeIndex < visibleTypes.length) {
|
|
22998
|
+
const nextType = visibleTypes[nextTypeIndex];
|
|
22999
|
+
(_a = this.inputElements[nextType]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
23000
|
+
(_b = this.inputElements[nextType]) === null || _b === void 0 ? void 0 : _b.select();
|
|
22773
23001
|
}
|
|
22774
23002
|
}
|
|
22775
23003
|
else if (event.key === 'Escape') {
|
|
22776
23004
|
event.preventDefault();
|
|
22777
|
-
|
|
22778
|
-
|
|
23005
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23006
|
+
const firstVisibleType = visibleTypes[0];
|
|
23007
|
+
if (firstVisibleType && this.inputElements[firstVisibleType]) {
|
|
23008
|
+
this.inputElements[firstVisibleType].blur();
|
|
22779
23009
|
}
|
|
22780
23010
|
}
|
|
22781
23011
|
}
|
|
@@ -22783,6 +23013,18 @@ class NvFieldtime {
|
|
|
22783
23013
|
/****************************************************************************/
|
|
22784
23014
|
//#region WATCHERS
|
|
22785
23015
|
handleValueChange(newValue) {
|
|
23016
|
+
// Parse the new value and ensure it's in the correct format
|
|
23017
|
+
if (newValue) {
|
|
23018
|
+
const components = parseValueByFormat(newValue, this.format);
|
|
23019
|
+
const formattedValue = reconstructTimeByFormat(components, this.format);
|
|
23020
|
+
// Only emit if the formatted value is different from what we received
|
|
23021
|
+
// This prevents infinite loops while ensuring format consistency
|
|
23022
|
+
if (formattedValue !== newValue) {
|
|
23023
|
+
this.value = formattedValue;
|
|
23024
|
+
return; // The watcher will be called again with the formatted value
|
|
23025
|
+
}
|
|
23026
|
+
}
|
|
23027
|
+
// Emit the value in the correct format
|
|
22786
23028
|
this.valueChanged.emit(newValue);
|
|
22787
23029
|
}
|
|
22788
23030
|
handleOpenChange(newOpen) {
|
|
@@ -22797,12 +23039,34 @@ class NvFieldtime {
|
|
|
22797
23039
|
this.updateColumnHighlight(secondsSelector, this.seconds);
|
|
22798
23040
|
}
|
|
22799
23041
|
}
|
|
23042
|
+
handleFormatChange(newFormat, oldFormat) {
|
|
23043
|
+
if (newFormat === oldFormat) {
|
|
23044
|
+
return; // No change, nothing to do
|
|
23045
|
+
}
|
|
23046
|
+
// Re-parse the current value with the new format
|
|
23047
|
+
const currentValue = this.value || this.reconstructTime();
|
|
23048
|
+
// Parse the current value using the old format to get the time components
|
|
23049
|
+
const components = parseValueByFormat(currentValue, oldFormat || 'HH:mm:ss');
|
|
23050
|
+
// Update the component state with the parsed components
|
|
23051
|
+
this.hours = components.hours;
|
|
23052
|
+
this.minutes = components.minutes;
|
|
23053
|
+
this.seconds = components.seconds;
|
|
23054
|
+
// Reconstruct the time value in the new format
|
|
23055
|
+
const newValue = reconstructTimeByFormat(components, newFormat);
|
|
23056
|
+
// Update the value, which will trigger the value watcher and emit the event
|
|
23057
|
+
this.value = newValue;
|
|
23058
|
+
}
|
|
22800
23059
|
//#endregion WATCHERS
|
|
22801
23060
|
/****************************************************************************/
|
|
22802
23061
|
//#region METHODS
|
|
22803
23062
|
handleInputChange(e, type) {
|
|
22804
23063
|
const inputElement = e.target;
|
|
22805
23064
|
const inputValue = inputElement.value.replace(/[^0-9]/g, ''); // Only keep numeric input
|
|
23065
|
+
// Check if this field is visible for the current format
|
|
23066
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23067
|
+
if (!visibleTypes.includes(type)) {
|
|
23068
|
+
return; // Don't process input for non-visible fields
|
|
23069
|
+
}
|
|
22806
23070
|
// Update the time value based on the type
|
|
22807
23071
|
switch (type) {
|
|
22808
23072
|
case TimeType.Hours:
|
|
@@ -22815,489 +23079,230 @@ class NvFieldtime {
|
|
|
22815
23079
|
this.handleSecondsChange(inputValue, type);
|
|
22816
23080
|
break;
|
|
22817
23081
|
}
|
|
22818
|
-
// Reconstruct time from inputs
|
|
22819
|
-
const
|
|
22820
|
-
|
|
23082
|
+
// Reconstruct time from inputs in the correct format
|
|
23083
|
+
const reconstructedValue = this.reconstructTime();
|
|
23084
|
+
// Update the value, which will trigger the watcher and emit the event
|
|
23085
|
+
this.value = reconstructedValue;
|
|
22821
23086
|
}
|
|
22822
23087
|
handleHoursChange(inputValue, type) {
|
|
22823
|
-
var _a, _b
|
|
23088
|
+
var _a, _b;
|
|
22824
23089
|
const isHHFormat = this.format.startsWith('HH');
|
|
22825
23090
|
const maxHours = isHHFormat ? 24 : 12;
|
|
22826
|
-
|
|
22827
|
-
|
|
22828
|
-
|
|
22829
|
-
|
|
23091
|
+
// Handle empty input
|
|
23092
|
+
if (inputValue.length === 0) {
|
|
23093
|
+
this.hours = '00';
|
|
23094
|
+
return;
|
|
23095
|
+
}
|
|
22830
23096
|
if (inputValue.length === 1) {
|
|
22831
23097
|
this.inputZeroAdded[type] = true;
|
|
22832
23098
|
const newInputValue = inputValue.padStart(2, '0');
|
|
22833
|
-
|
|
22834
|
-
if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
|
|
22835
|
-
this.hours = minHour;
|
|
22836
|
-
}
|
|
22837
|
-
else {
|
|
22838
|
-
this.hours = '00';
|
|
22839
|
-
reputedToZero = true;
|
|
22840
|
-
}
|
|
22841
|
-
}
|
|
22842
|
-
else {
|
|
22843
|
-
if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
|
|
22844
|
-
this.hours = minHour;
|
|
22845
|
-
}
|
|
22846
|
-
else {
|
|
22847
|
-
this.hours = newInputValue;
|
|
22848
|
-
}
|
|
22849
|
-
}
|
|
23099
|
+
this.hours = newInputValue;
|
|
22850
23100
|
}
|
|
22851
23101
|
else if (this.inputZeroAdded[type]) {
|
|
22852
23102
|
this.inputZeroAdded[type] = false;
|
|
22853
23103
|
const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
|
|
22854
23104
|
const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
|
|
23105
|
+
// Only apply format validation (not min/max constraints)
|
|
22855
23106
|
if (parsedNewInputValue >= maxHours) {
|
|
22856
|
-
|
|
22857
|
-
this.hours = minHour;
|
|
22858
|
-
}
|
|
22859
|
-
else {
|
|
22860
|
-
this.hours = '00';
|
|
22861
|
-
reputedToZero = true;
|
|
22862
|
-
}
|
|
23107
|
+
this.hours = '00';
|
|
22863
23108
|
}
|
|
22864
23109
|
else {
|
|
22865
|
-
|
|
22866
|
-
if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
|
|
22867
|
-
this.hours = minHour;
|
|
22868
|
-
}
|
|
22869
|
-
else {
|
|
22870
|
-
this.hours = '00';
|
|
22871
|
-
reputedToZero = true;
|
|
22872
|
-
}
|
|
22873
|
-
}
|
|
22874
|
-
else {
|
|
22875
|
-
if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
|
|
22876
|
-
this.hours = minHour;
|
|
22877
|
-
}
|
|
22878
|
-
else {
|
|
22879
|
-
this.hours = newInputValue;
|
|
22880
|
-
}
|
|
22881
|
-
}
|
|
23110
|
+
this.hours = newInputValue;
|
|
22882
23111
|
}
|
|
22883
23112
|
}
|
|
22884
23113
|
else if (inputValue.length > 2) {
|
|
22885
23114
|
if (inputValue.startsWith('00')) {
|
|
22886
23115
|
this.inputZeroAdded[type] = true;
|
|
22887
23116
|
const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
|
|
22888
|
-
|
|
22889
|
-
if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
|
|
22890
|
-
this.hours = minHour;
|
|
22891
|
-
}
|
|
22892
|
-
else {
|
|
22893
|
-
this.hours = '00';
|
|
22894
|
-
reputedToZero = true;
|
|
22895
|
-
}
|
|
22896
|
-
}
|
|
22897
|
-
else {
|
|
22898
|
-
if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
|
|
22899
|
-
this.hours = minHour;
|
|
22900
|
-
}
|
|
22901
|
-
else {
|
|
22902
|
-
this.hours = newInputValue;
|
|
22903
|
-
}
|
|
22904
|
-
}
|
|
23117
|
+
this.hours = newInputValue;
|
|
22905
23118
|
}
|
|
22906
23119
|
else {
|
|
22907
23120
|
const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
|
|
22908
23121
|
const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
|
|
23122
|
+
// Only apply format validation (not min/max constraints)
|
|
22909
23123
|
if (parsedNewInputValue >= maxHours) {
|
|
22910
|
-
|
|
22911
|
-
this.hours = minHour;
|
|
22912
|
-
reputedToZero = true;
|
|
22913
|
-
}
|
|
22914
|
-
else {
|
|
22915
|
-
this.hours = '00';
|
|
22916
|
-
reputedToZero = true;
|
|
22917
|
-
}
|
|
23124
|
+
this.hours = '00';
|
|
22918
23125
|
}
|
|
22919
23126
|
else {
|
|
22920
|
-
|
|
22921
|
-
if (minHour &&
|
|
22922
|
-
parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
|
|
22923
|
-
this.hours = minHour;
|
|
22924
|
-
}
|
|
22925
|
-
else {
|
|
22926
|
-
this.hours = '00';
|
|
22927
|
-
reputedToZero = true;
|
|
22928
|
-
}
|
|
22929
|
-
}
|
|
22930
|
-
else {
|
|
22931
|
-
if (minHour && parsedNewInputValue < parseInt(minHour, 10)) {
|
|
22932
|
-
this.hours = minHour;
|
|
22933
|
-
}
|
|
22934
|
-
else {
|
|
22935
|
-
this.hours = parsedNewInputValue.toString();
|
|
22936
|
-
}
|
|
22937
|
-
}
|
|
23127
|
+
this.hours = parsedNewInputValue.toString();
|
|
22938
23128
|
}
|
|
22939
23129
|
}
|
|
22940
23130
|
}
|
|
22941
23131
|
else {
|
|
22942
|
-
const
|
|
22943
|
-
|
|
23132
|
+
const parsedNewInputValue = parseInt(inputValue, 10) || 0;
|
|
23133
|
+
// Only apply format validation (not min/max constraints)
|
|
22944
23134
|
if (parsedNewInputValue >= maxHours) {
|
|
22945
|
-
|
|
22946
|
-
this.hours = minHour;
|
|
22947
|
-
}
|
|
22948
|
-
else {
|
|
22949
|
-
this.hours = '00';
|
|
22950
|
-
reputedToZero = true;
|
|
22951
|
-
}
|
|
23135
|
+
this.hours = '00';
|
|
22952
23136
|
}
|
|
22953
23137
|
else {
|
|
22954
|
-
|
|
22955
|
-
|
|
22956
|
-
reputedToZero = true;
|
|
22957
|
-
}
|
|
22958
|
-
else {
|
|
22959
|
-
if (minHour && parsedNewInputValue < parseInt(minHour, 10)) {
|
|
22960
|
-
this.hours = minHour;
|
|
22961
|
-
}
|
|
22962
|
-
else {
|
|
22963
|
-
this.hours = parsedNewInputValue.toString();
|
|
22964
|
-
}
|
|
22965
|
-
}
|
|
23138
|
+
// For direct input, remove unnecessary leading zeros (e.g., '01' becomes '1')
|
|
23139
|
+
this.hours = parsedNewInputValue.toString();
|
|
22966
23140
|
}
|
|
22967
23141
|
}
|
|
22968
|
-
|
|
22969
|
-
|
|
22970
|
-
|
|
22971
|
-
|
|
22972
|
-
|
|
22973
|
-
|
|
22974
|
-
|
|
22975
|
-
|
|
22976
|
-
|
|
23142
|
+
// Auto-navigation to next field when input is complete
|
|
23143
|
+
if (this.hours.length >= 1 && !this.inputZeroAdded[type]) {
|
|
23144
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23145
|
+
const currentTypeIndex = visibleTypes.indexOf(TimeType.Hours);
|
|
23146
|
+
const nextTypeIndex = currentTypeIndex + 1;
|
|
23147
|
+
if (nextTypeIndex < visibleTypes.length) {
|
|
23148
|
+
const nextType = visibleTypes[nextTypeIndex];
|
|
23149
|
+
(_a = this.inputElements[nextType]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
23150
|
+
(_b = this.inputElements[nextType]) === null || _b === void 0 ? void 0 : _b.select();
|
|
23151
|
+
}
|
|
22977
23152
|
}
|
|
22978
23153
|
}
|
|
22979
23154
|
handleMinutesChange(inputValue, type) {
|
|
22980
|
-
var _a, _b
|
|
23155
|
+
var _a, _b;
|
|
22981
23156
|
const maxMinutes = 60;
|
|
22982
|
-
|
|
22983
|
-
|
|
22984
|
-
|
|
23157
|
+
// Handle empty input
|
|
23158
|
+
if (inputValue.length === 0) {
|
|
23159
|
+
this.minutes = '00';
|
|
23160
|
+
return;
|
|
23161
|
+
}
|
|
22985
23162
|
if (inputValue.length === 1) {
|
|
22986
23163
|
this.inputZeroAdded[type] = true;
|
|
22987
23164
|
const newInputValue = inputValue.padStart(2, '0');
|
|
22988
|
-
|
|
22989
|
-
if (minMinute && parseInt(newInputValue, 10) < minMinute) {
|
|
22990
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
22991
|
-
}
|
|
22992
|
-
else {
|
|
22993
|
-
this.minutes = '00';
|
|
22994
|
-
reputedToZero = true;
|
|
22995
|
-
}
|
|
22996
|
-
}
|
|
22997
|
-
else {
|
|
22998
|
-
if (minMinute && parseInt(newInputValue, 10) < minMinute) {
|
|
22999
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23000
|
-
}
|
|
23001
|
-
else {
|
|
23002
|
-
this.minutes = newInputValue;
|
|
23003
|
-
}
|
|
23004
|
-
}
|
|
23165
|
+
this.minutes = newInputValue;
|
|
23005
23166
|
}
|
|
23006
23167
|
else if (this.inputZeroAdded[type]) {
|
|
23007
23168
|
this.inputZeroAdded[type] = false;
|
|
23008
23169
|
const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
|
|
23009
23170
|
const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
|
|
23171
|
+
// Only apply format validation (not min/max constraints)
|
|
23010
23172
|
if (parsedNewInputValue >= maxMinutes) {
|
|
23011
|
-
|
|
23012
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23013
|
-
}
|
|
23014
|
-
else {
|
|
23015
|
-
this.minutes = '00';
|
|
23016
|
-
reputedToZero = true;
|
|
23017
|
-
}
|
|
23173
|
+
this.minutes = '00';
|
|
23018
23174
|
}
|
|
23019
23175
|
else {
|
|
23020
|
-
|
|
23021
|
-
if (minMinute && parseInt(newInputValue, 10) < minMinute) {
|
|
23022
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23023
|
-
}
|
|
23024
|
-
else {
|
|
23025
|
-
this.minutes = '00';
|
|
23026
|
-
reputedToZero = true;
|
|
23027
|
-
}
|
|
23028
|
-
}
|
|
23029
|
-
else {
|
|
23030
|
-
if (minMinute && parsedNewInputValue < minMinute) {
|
|
23031
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23032
|
-
}
|
|
23033
|
-
else {
|
|
23034
|
-
this.minutes = newInputValue;
|
|
23035
|
-
}
|
|
23036
|
-
}
|
|
23176
|
+
this.minutes = newInputValue;
|
|
23037
23177
|
}
|
|
23038
23178
|
}
|
|
23039
23179
|
else if (inputValue.length > 2) {
|
|
23040
23180
|
if (inputValue.startsWith('00')) {
|
|
23041
23181
|
this.inputZeroAdded[type] = true;
|
|
23042
23182
|
const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
|
|
23043
|
-
|
|
23044
|
-
if (minMinute && parseInt(newInputValue, 10) < minMinute) {
|
|
23045
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23046
|
-
}
|
|
23047
|
-
else {
|
|
23048
|
-
this.minutes = '00';
|
|
23049
|
-
reputedToZero = true;
|
|
23050
|
-
}
|
|
23051
|
-
}
|
|
23052
|
-
else {
|
|
23053
|
-
if (minMinute && parseInt(newInputValue, 10) < minMinute) {
|
|
23054
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23055
|
-
}
|
|
23056
|
-
else {
|
|
23057
|
-
this.minutes = newInputValue;
|
|
23058
|
-
}
|
|
23059
|
-
}
|
|
23183
|
+
this.minutes = newInputValue;
|
|
23060
23184
|
}
|
|
23061
23185
|
else {
|
|
23062
23186
|
const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
|
|
23063
23187
|
const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
|
|
23188
|
+
// Only apply format validation (not min/max constraints)
|
|
23064
23189
|
if (parsedNewInputValue >= maxMinutes) {
|
|
23065
|
-
|
|
23066
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23067
|
-
}
|
|
23068
|
-
else {
|
|
23069
|
-
this.minutes = '00';
|
|
23070
|
-
reputedToZero = true;
|
|
23071
|
-
}
|
|
23190
|
+
this.minutes = '00';
|
|
23072
23191
|
}
|
|
23073
23192
|
else {
|
|
23074
|
-
|
|
23075
|
-
if (minMinute && parseInt(newInputValue, 10) < minMinute) {
|
|
23076
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23077
|
-
}
|
|
23078
|
-
else {
|
|
23079
|
-
this.minutes = '00';
|
|
23080
|
-
reputedToZero = true;
|
|
23081
|
-
}
|
|
23082
|
-
}
|
|
23083
|
-
else {
|
|
23084
|
-
if (minMinute && parsedNewInputValue < minMinute) {
|
|
23085
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23086
|
-
}
|
|
23087
|
-
else {
|
|
23088
|
-
this.minutes = parsedNewInputValue.toString();
|
|
23089
|
-
}
|
|
23090
|
-
}
|
|
23193
|
+
this.minutes = parsedNewInputValue.toString();
|
|
23091
23194
|
}
|
|
23092
23195
|
}
|
|
23093
23196
|
}
|
|
23094
23197
|
else {
|
|
23095
|
-
const
|
|
23096
|
-
|
|
23198
|
+
const parsedNewInputValue = parseInt(inputValue, 10) || 0;
|
|
23199
|
+
// Only apply format validation (not min/max constraints)
|
|
23097
23200
|
if (parsedNewInputValue >= maxMinutes) {
|
|
23098
|
-
|
|
23099
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23100
|
-
}
|
|
23101
|
-
else {
|
|
23102
|
-
this.minutes = '00';
|
|
23103
|
-
reputedToZero = true;
|
|
23104
|
-
}
|
|
23201
|
+
this.minutes = '00';
|
|
23105
23202
|
}
|
|
23106
23203
|
else {
|
|
23107
|
-
|
|
23108
|
-
|
|
23109
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23110
|
-
}
|
|
23111
|
-
else {
|
|
23112
|
-
this.minutes = '00';
|
|
23113
|
-
reputedToZero = true;
|
|
23114
|
-
}
|
|
23115
|
-
}
|
|
23116
|
-
else {
|
|
23117
|
-
if (minMinute && parsedNewInputValue < minMinute) {
|
|
23118
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23119
|
-
}
|
|
23120
|
-
else {
|
|
23121
|
-
this.minutes = parsedNewInputValue.toString();
|
|
23122
|
-
}
|
|
23123
|
-
}
|
|
23204
|
+
// For direct input, remove unnecessary leading zeros (e.g., '01' becomes '1')
|
|
23205
|
+
this.minutes = parsedNewInputValue.toString();
|
|
23124
23206
|
}
|
|
23125
23207
|
}
|
|
23126
|
-
|
|
23127
|
-
|
|
23128
|
-
|
|
23129
|
-
|
|
23130
|
-
|
|
23131
|
-
|
|
23132
|
-
|
|
23133
|
-
|
|
23134
|
-
|
|
23208
|
+
// Auto-navigation to next field when input is complete
|
|
23209
|
+
if (this.minutes.length >= 1 && !this.inputZeroAdded[type]) {
|
|
23210
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23211
|
+
const currentTypeIndex = visibleTypes.indexOf(TimeType.Minutes);
|
|
23212
|
+
const nextTypeIndex = currentTypeIndex + 1;
|
|
23213
|
+
if (nextTypeIndex < visibleTypes.length) {
|
|
23214
|
+
const nextType = visibleTypes[nextTypeIndex];
|
|
23215
|
+
(_a = this.inputElements[nextType]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
23216
|
+
(_b = this.inputElements[nextType]) === null || _b === void 0 ? void 0 : _b.select();
|
|
23217
|
+
}
|
|
23135
23218
|
}
|
|
23136
23219
|
}
|
|
23137
23220
|
handleSecondsChange(inputValue, type) {
|
|
23138
|
-
var _a, _b, _c, _d;
|
|
23139
23221
|
const maxSeconds = 60;
|
|
23140
|
-
|
|
23141
|
-
|
|
23142
|
-
|
|
23222
|
+
// Handle empty input
|
|
23223
|
+
if (inputValue.length === 0) {
|
|
23224
|
+
this.seconds = '00';
|
|
23225
|
+
return;
|
|
23226
|
+
}
|
|
23143
23227
|
if (inputValue.length === 1) {
|
|
23144
23228
|
this.inputZeroAdded[type] = true;
|
|
23145
23229
|
const newInputValue = inputValue.padStart(2, '0');
|
|
23146
|
-
|
|
23147
|
-
if (minSecond && parseInt(newInputValue, 10) < minSecond) {
|
|
23148
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23149
|
-
}
|
|
23150
|
-
else {
|
|
23151
|
-
this.seconds = '00';
|
|
23152
|
-
reputedToZero = true;
|
|
23153
|
-
}
|
|
23154
|
-
}
|
|
23155
|
-
else {
|
|
23156
|
-
if (minSecond && parseInt(newInputValue, 10) < minSecond) {
|
|
23157
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23158
|
-
}
|
|
23159
|
-
else {
|
|
23160
|
-
this.seconds = newInputValue;
|
|
23161
|
-
}
|
|
23162
|
-
}
|
|
23230
|
+
this.seconds = newInputValue;
|
|
23163
23231
|
}
|
|
23164
23232
|
else if (this.inputZeroAdded[type]) {
|
|
23165
23233
|
this.inputZeroAdded[type] = false;
|
|
23166
23234
|
const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
|
|
23167
23235
|
const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
|
|
23236
|
+
// Only apply format validation (not min/max constraints)
|
|
23168
23237
|
if (parsedNewInputValue >= maxSeconds) {
|
|
23169
|
-
|
|
23170
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23171
|
-
}
|
|
23172
|
-
else {
|
|
23173
|
-
this.seconds = '00';
|
|
23174
|
-
reputedToZero = true;
|
|
23175
|
-
}
|
|
23238
|
+
this.seconds = '00';
|
|
23176
23239
|
}
|
|
23177
23240
|
else {
|
|
23178
|
-
|
|
23179
|
-
if (minSecond && parseInt(newInputValue, 10) < minSecond) {
|
|
23180
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23181
|
-
}
|
|
23182
|
-
else {
|
|
23183
|
-
this.seconds = '00';
|
|
23184
|
-
reputedToZero = true;
|
|
23185
|
-
}
|
|
23186
|
-
}
|
|
23187
|
-
else {
|
|
23188
|
-
if (minSecond && parsedNewInputValue < minSecond) {
|
|
23189
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23190
|
-
}
|
|
23191
|
-
else {
|
|
23192
|
-
this.seconds = newInputValue;
|
|
23193
|
-
}
|
|
23194
|
-
}
|
|
23241
|
+
this.seconds = newInputValue;
|
|
23195
23242
|
}
|
|
23196
23243
|
}
|
|
23197
23244
|
else if (inputValue.length > 2) {
|
|
23198
23245
|
const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
|
|
23199
23246
|
const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
|
|
23247
|
+
// Only apply format validation (not min/max constraints)
|
|
23200
23248
|
if (parsedNewInputValue >= maxSeconds) {
|
|
23201
|
-
|
|
23202
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23203
|
-
}
|
|
23204
|
-
else {
|
|
23205
|
-
this.seconds = '00';
|
|
23206
|
-
reputedToZero = true;
|
|
23207
|
-
}
|
|
23249
|
+
this.seconds = '00';
|
|
23208
23250
|
}
|
|
23209
23251
|
else {
|
|
23210
|
-
|
|
23211
|
-
if (minSecond && parseInt(newInputValue, 10) < minSecond) {
|
|
23212
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23213
|
-
}
|
|
23214
|
-
else {
|
|
23215
|
-
this.seconds = '00';
|
|
23216
|
-
reputedToZero = true;
|
|
23217
|
-
}
|
|
23218
|
-
}
|
|
23219
|
-
else {
|
|
23220
|
-
if (minSecond && parsedNewInputValue < minSecond) {
|
|
23221
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23222
|
-
}
|
|
23223
|
-
else {
|
|
23224
|
-
this.seconds = parsedNewInputValue.toString();
|
|
23225
|
-
}
|
|
23226
|
-
}
|
|
23252
|
+
this.seconds = parsedNewInputValue.toString();
|
|
23227
23253
|
}
|
|
23228
23254
|
}
|
|
23229
23255
|
else {
|
|
23230
|
-
const
|
|
23231
|
-
|
|
23256
|
+
const parsedNewInputValue = parseInt(inputValue, 10) || 0;
|
|
23257
|
+
// Only apply format validation (not min/max constraints)
|
|
23232
23258
|
if (parsedNewInputValue >= maxSeconds) {
|
|
23233
|
-
|
|
23234
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23235
|
-
}
|
|
23236
|
-
else {
|
|
23237
|
-
this.seconds = '00';
|
|
23238
|
-
reputedToZero = true;
|
|
23239
|
-
}
|
|
23259
|
+
this.seconds = '00';
|
|
23240
23260
|
}
|
|
23241
23261
|
else {
|
|
23242
|
-
|
|
23243
|
-
|
|
23244
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23245
|
-
}
|
|
23246
|
-
else {
|
|
23247
|
-
this.seconds = '00';
|
|
23248
|
-
reputedToZero = true;
|
|
23249
|
-
}
|
|
23250
|
-
}
|
|
23251
|
-
else {
|
|
23252
|
-
if (minSecond && parsedNewInputValue < minSecond) {
|
|
23253
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23254
|
-
}
|
|
23255
|
-
else {
|
|
23256
|
-
this.seconds = parsedNewInputValue.toString();
|
|
23257
|
-
}
|
|
23258
|
-
}
|
|
23262
|
+
// For direct input, remove unnecessary leading zeros (e.g., '01' becomes '1')
|
|
23263
|
+
this.seconds = parsedNewInputValue.toString();
|
|
23259
23264
|
}
|
|
23260
23265
|
}
|
|
23261
|
-
|
|
23262
|
-
(_c = this.inputElements[TimeType.Seconds]) === null || _c === void 0 ? void 0 : _c.focus();
|
|
23263
|
-
(_d = this.inputElements[TimeType.Seconds]) === null || _d === void 0 ? void 0 : _d.select();
|
|
23264
|
-
}
|
|
23266
|
+
// No auto-navigation for seconds field as it's typically the last field
|
|
23265
23267
|
}
|
|
23266
|
-
// Parse a
|
|
23268
|
+
// Parse a time string according to the current format
|
|
23267
23269
|
parseTime(timeString) {
|
|
23268
23270
|
if (!timeString) {
|
|
23269
23271
|
return;
|
|
23270
23272
|
}
|
|
23271
|
-
|
|
23272
|
-
const
|
|
23273
|
-
|
|
23274
|
-
|
|
23275
|
-
|
|
23276
|
-
|
|
23277
|
-
const minSecond = this.parseSecond(this.min) || second;
|
|
23278
|
-
this.hours = minHour.padStart(2, '0');
|
|
23279
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23280
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23273
|
+
// Use format-aware parsing without constraint application
|
|
23274
|
+
const components = parseValueByFormat(timeString, this.format);
|
|
23275
|
+
// Set the parsed values without applying min/max constraints
|
|
23276
|
+
this.hours = components.hours;
|
|
23277
|
+
this.minutes = components.minutes;
|
|
23278
|
+
this.seconds = components.seconds;
|
|
23281
23279
|
}
|
|
23282
23280
|
reconstructTime() {
|
|
23283
|
-
|
|
23284
|
-
|
|
23285
|
-
|
|
23286
|
-
|
|
23287
|
-
|
|
23288
|
-
|
|
23289
|
-
|
|
23290
|
-
|
|
23291
|
-
|
|
23292
|
-
|
|
23293
|
-
|
|
23281
|
+
const components = {
|
|
23282
|
+
hours: this.hours,
|
|
23283
|
+
minutes: this.minutes,
|
|
23284
|
+
seconds: this.seconds,
|
|
23285
|
+
};
|
|
23286
|
+
// Ensure the reconstructed time is in the correct format
|
|
23287
|
+
const reconstructedTime = reconstructTimeByFormat(components, this.format);
|
|
23288
|
+
// Validate that the reconstructed time matches the expected format
|
|
23289
|
+
if (!isValidFormatValue(reconstructedTime, this.format)) {
|
|
23290
|
+
// If invalid, return the default value for this format
|
|
23291
|
+
const config = FORMAT_CONFIGS[this.format];
|
|
23292
|
+
return config ? config.defaultValue : reconstructedTime;
|
|
23294
23293
|
}
|
|
23294
|
+
return reconstructedTime;
|
|
23295
23295
|
}
|
|
23296
23296
|
handleFocus(type) {
|
|
23297
23297
|
var _a, _b, _c, _d;
|
|
23298
23298
|
if (this.readonly || this.disabled) {
|
|
23299
23299
|
return;
|
|
23300
23300
|
}
|
|
23301
|
+
// Check if this field is visible for the current format
|
|
23302
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23303
|
+
if (!visibleTypes.includes(type)) {
|
|
23304
|
+
return; // Don't handle focus for non-visible fields
|
|
23305
|
+
}
|
|
23301
23306
|
if (!this.open) {
|
|
23302
23307
|
this.open = true; // Force the popover to open
|
|
23303
23308
|
}
|
|
@@ -23310,33 +23315,23 @@ class NvFieldtime {
|
|
|
23310
23315
|
this.typeFocused = type;
|
|
23311
23316
|
}
|
|
23312
23317
|
HandleDropdownIconClick() {
|
|
23313
|
-
var _a, _b
|
|
23318
|
+
var _a, _b;
|
|
23314
23319
|
if (this.disabled || this.readonly) {
|
|
23315
23320
|
return; // Do not toggle if disabled or read-only
|
|
23316
23321
|
}
|
|
23317
|
-
|
|
23318
|
-
|
|
23319
|
-
|
|
23320
|
-
else if (this.open && this.inputElements[TimeType.Minutes]) {
|
|
23321
|
-
this.open = false; // Close the popover if it is open
|
|
23322
|
-
}
|
|
23323
|
-
else if (this.open && this.inputElements[TimeType.Seconds]) {
|
|
23322
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23323
|
+
const firstVisibleType = visibleTypes[0];
|
|
23324
|
+
if (this.open) {
|
|
23324
23325
|
this.open = false; // Close the popover if it is open
|
|
23325
23326
|
}
|
|
23326
|
-
else if (!this.open &&
|
|
23327
|
-
|
|
23328
|
-
|
|
23329
|
-
|
|
23330
|
-
|
|
23331
|
-
(_c = this.inputElements[TimeType.Minutes]) === null || _c === void 0 ? void 0 : _c.focus(); // Focus will open the popover
|
|
23332
|
-
(_d = this.inputElements[TimeType.Minutes]) === null || _d === void 0 ? void 0 : _d.select();
|
|
23333
|
-
}
|
|
23334
|
-
else if (!this.open && this.inputElements[TimeType.Seconds]) {
|
|
23335
|
-
(_e = this.inputElements[TimeType.Seconds]) === null || _e === void 0 ? void 0 : _e.focus(); // Focus will open the popover
|
|
23336
|
-
(_f = this.inputElements[TimeType.Seconds]) === null || _f === void 0 ? void 0 : _f.select();
|
|
23327
|
+
else if (!this.open &&
|
|
23328
|
+
firstVisibleType &&
|
|
23329
|
+
this.inputElements[firstVisibleType]) {
|
|
23330
|
+
(_a = this.inputElements[firstVisibleType]) === null || _a === void 0 ? void 0 : _a.focus(); // Focus will open the popover
|
|
23331
|
+
(_b = this.inputElements[firstVisibleType]) === null || _b === void 0 ? void 0 : _b.select();
|
|
23337
23332
|
}
|
|
23338
23333
|
else {
|
|
23339
|
-
console.warn('nv-fieldtime -> No input elements found to focus
|
|
23334
|
+
console.warn('nv-fieldtime -> No visible input elements found to focus');
|
|
23340
23335
|
}
|
|
23341
23336
|
}
|
|
23342
23337
|
updateHighlightedItem(items, index) {
|
|
@@ -23355,6 +23350,8 @@ class NvFieldtime {
|
|
|
23355
23350
|
}
|
|
23356
23351
|
handleTimeOptionClick(event, type) {
|
|
23357
23352
|
const option = parseInt(event.target.textContent || '0', 10);
|
|
23353
|
+
// Update the time component directly without constraint validation
|
|
23354
|
+
// Dropdown options are already filtered by constraints during generation
|
|
23358
23355
|
if (type === TimeType.Hours) {
|
|
23359
23356
|
this.hours = option.toString().padStart(2, '0');
|
|
23360
23357
|
}
|
|
@@ -23364,8 +23361,9 @@ class NvFieldtime {
|
|
|
23364
23361
|
else if (type === TimeType.Seconds) {
|
|
23365
23362
|
this.seconds = option.toString().padStart(2, '0');
|
|
23366
23363
|
}
|
|
23367
|
-
|
|
23368
|
-
|
|
23364
|
+
// Reconstruct time in the correct format and update value
|
|
23365
|
+
const reconstructedTime = this.reconstructTime();
|
|
23366
|
+
this.value = reconstructedTime;
|
|
23369
23367
|
}
|
|
23370
23368
|
handleInputBlur() {
|
|
23371
23369
|
// Use a delay to check if the focus is still within the popover
|
|
@@ -23424,17 +23422,29 @@ class NvFieldtime {
|
|
|
23424
23422
|
}
|
|
23425
23423
|
generateHourOptions(stepInSeconds) {
|
|
23426
23424
|
const hourStep = Math.max(1, Math.floor(stepInSeconds / 3600)); // Prevent step < 1
|
|
23427
|
-
const
|
|
23428
|
-
|
|
23429
|
-
const
|
|
23430
|
-
const
|
|
23431
|
-
const
|
|
23425
|
+
const is12HourFormat = this.format.startsWith('hh');
|
|
23426
|
+
// Set proper hour ranges based on format
|
|
23427
|
+
const defaultMaxHour = is12HourFormat ? 12 : 23;
|
|
23428
|
+
const defaultMinHour = is12HourFormat ? 1 : 0;
|
|
23429
|
+
const maxHour = this.parseHour(this.max, this.format);
|
|
23430
|
+
const minHour = this.parseHour(this.min, this.format);
|
|
23431
|
+
const maxHourValue = maxHour ? parseInt(maxHour, 10) : defaultMaxHour;
|
|
23432
|
+
const minHourValue = minHour ? parseInt(minHour, 10) : defaultMinHour;
|
|
23432
23433
|
const values = [];
|
|
23433
|
-
for (let i = minHourValue; i
|
|
23434
|
-
|
|
23434
|
+
for (let i = minHourValue; i <= maxHourValue; i += hourStep) {
|
|
23435
|
+
const hourStr = i.toString().padStart(2, '0');
|
|
23436
|
+
values.push(hourStr);
|
|
23435
23437
|
}
|
|
23436
23438
|
return values;
|
|
23437
23439
|
}
|
|
23440
|
+
/**
|
|
23441
|
+
* Parse hour value from min/max constraint strings for dropdown generation only.
|
|
23442
|
+
* This method is used exclusively for filtering dropdown options and should not
|
|
23443
|
+
* affect input values or validation.
|
|
23444
|
+
* @param {string} value - The time string to parse (e.g., "14:30" or "02:30")
|
|
23445
|
+
* @param {string} format - The time format string (e.g., "HH:mm" or "hh:mm")
|
|
23446
|
+
* @returns {string} The parsed hour string or null if invalid
|
|
23447
|
+
*/
|
|
23438
23448
|
parseHour(value, format) {
|
|
23439
23449
|
if (!value)
|
|
23440
23450
|
return null;
|
|
@@ -23452,13 +23462,21 @@ class NvFieldtime {
|
|
|
23452
23462
|
const minMinute = (_a = this.parseMinute(this.min)) !== null && _a !== void 0 ? _a : 0;
|
|
23453
23463
|
const maxMinute = (_b = this.parseMinute(this.max)) !== null && _b !== void 0 ? _b : 59;
|
|
23454
23464
|
if (minMinute === 0 && maxMinute === 0)
|
|
23455
|
-
return ['00']; // Handle edge case for zero
|
|
23465
|
+
return ['00']; // Handle edge case for zero minutes
|
|
23456
23466
|
const values = [];
|
|
23457
23467
|
for (let i = minMinute; i <= maxMinute; i += minuteStep) {
|
|
23458
|
-
|
|
23468
|
+
const minuteStr = i.toString().padStart(2, '0');
|
|
23469
|
+
values.push(minuteStr);
|
|
23459
23470
|
}
|
|
23460
23471
|
return values;
|
|
23461
23472
|
}
|
|
23473
|
+
/**
|
|
23474
|
+
* Parse minute value from min/max constraint strings for dropdown generation only.
|
|
23475
|
+
* This method is used exclusively for filtering dropdown options and should not
|
|
23476
|
+
* affect input values or validation.
|
|
23477
|
+
* @param {string} value - The time string to parse (e.g., "14:30" or "02:30")
|
|
23478
|
+
* @returns {number} The parsed minute number or null if invalid
|
|
23479
|
+
*/
|
|
23462
23480
|
parseMinute(value) {
|
|
23463
23481
|
if (!value)
|
|
23464
23482
|
return null;
|
|
@@ -23477,10 +23495,18 @@ class NvFieldtime {
|
|
|
23477
23495
|
return ['00']; // Handle edge case for zero seconds
|
|
23478
23496
|
const values = [];
|
|
23479
23497
|
for (let i = minSecond; i <= maxSecond; i += secondStep) {
|
|
23480
|
-
|
|
23498
|
+
const secondStr = i.toString().padStart(2, '0');
|
|
23499
|
+
values.push(secondStr);
|
|
23481
23500
|
}
|
|
23482
23501
|
return values;
|
|
23483
23502
|
}
|
|
23503
|
+
/**
|
|
23504
|
+
* Parse second value from min/max constraint strings for dropdown generation only.
|
|
23505
|
+
* This method is used exclusively for filtering dropdown options and should not
|
|
23506
|
+
* affect input values or validation.
|
|
23507
|
+
* @param {string} value - The time string to parse (e.g., "14:30:45" or "02:30:45")
|
|
23508
|
+
* @returns {number} The parsed second number or null if invalid
|
|
23509
|
+
*/
|
|
23484
23510
|
parseSecond(value) {
|
|
23485
23511
|
if (!value)
|
|
23486
23512
|
return null;
|
|
@@ -23497,10 +23523,6 @@ class NvFieldtime {
|
|
|
23497
23523
|
const repetitions = Math.ceil(300 / totalOptions);
|
|
23498
23524
|
return Array(repetitions).fill(options).flat();
|
|
23499
23525
|
}
|
|
23500
|
-
getCurrentTime() {
|
|
23501
|
-
const currentTime = new Date();
|
|
23502
|
-
return currentTime.toLocaleTimeString(); // Returns the time in the locale's format
|
|
23503
|
-
}
|
|
23504
23526
|
updateColumnHighlight(selector, value) {
|
|
23505
23527
|
const items = Array.from(this.el.querySelectorAll(selector));
|
|
23506
23528
|
const index = items.findIndex(x => x.textContent === value);
|
|
@@ -23518,8 +23540,13 @@ class NvFieldtime {
|
|
|
23518
23540
|
}
|
|
23519
23541
|
if (!this.open) {
|
|
23520
23542
|
if (this.inputElements) {
|
|
23521
|
-
|
|
23522
|
-
|
|
23543
|
+
// Focus on the first visible field based on format
|
|
23544
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23545
|
+
const firstVisibleType = visibleTypes[0];
|
|
23546
|
+
if (firstVisibleType && this.inputElements[firstVisibleType]) {
|
|
23547
|
+
(_a = this.inputElements[firstVisibleType]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
23548
|
+
(_b = this.inputElements[firstVisibleType]) === null || _b === void 0 ? void 0 : _b.select();
|
|
23549
|
+
}
|
|
23523
23550
|
}
|
|
23524
23551
|
event.preventDefault();
|
|
23525
23552
|
}
|
|
@@ -23529,17 +23556,23 @@ class NvFieldtime {
|
|
|
23529
23556
|
//#region LIFECYCLE
|
|
23530
23557
|
componentWillLoad() {
|
|
23531
23558
|
document.addEventListener('click', this.handleClickOutside.bind(this));
|
|
23532
|
-
//
|
|
23559
|
+
// Initialize component state based on format and value
|
|
23533
23560
|
if (this.value) {
|
|
23561
|
+
// Parse the provided value using format-aware parsing without constraint application
|
|
23534
23562
|
this.parseTime(this.value);
|
|
23535
23563
|
}
|
|
23536
23564
|
else {
|
|
23537
|
-
|
|
23538
|
-
|
|
23539
|
-
const
|
|
23540
|
-
|
|
23541
|
-
this.
|
|
23542
|
-
this.
|
|
23565
|
+
// Initialize with format-appropriate default values without any constraint application
|
|
23566
|
+
// Use format-specific defaults: '01' for 12-hour formats, '00' for 24-hour formats
|
|
23567
|
+
const defaultComponents = parseValueByFormat('', this.format);
|
|
23568
|
+
// Set default values directly without any min/max constraint validation
|
|
23569
|
+
this.hours = defaultComponents.hours;
|
|
23570
|
+
this.minutes = defaultComponents.minutes;
|
|
23571
|
+
this.seconds = defaultComponents.seconds;
|
|
23572
|
+
// Set the initial value in the correct format without constraint validation
|
|
23573
|
+
// This ensures the component has a proper initial state for the value watcher
|
|
23574
|
+
const initialValue = reconstructTimeByFormat(defaultComponents, this.format);
|
|
23575
|
+
this.value = initialValue;
|
|
23543
23576
|
}
|
|
23544
23577
|
}
|
|
23545
23578
|
connectedCallback() {
|
|
@@ -23549,63 +23582,94 @@ class NvFieldtime {
|
|
|
23549
23582
|
document.removeEventListener('click', this.handleClickOutside.bind(this));
|
|
23550
23583
|
}
|
|
23551
23584
|
componentDidLoad() {
|
|
23552
|
-
|
|
23553
|
-
|
|
23554
|
-
|
|
23555
|
-
|
|
23556
|
-
|
|
23557
|
-
|
|
23558
|
-
|
|
23559
|
-
|
|
23560
|
-
|
|
23561
|
-
|
|
23562
|
-
|
|
23563
|
-
second = secondAmPm;
|
|
23564
|
-
}
|
|
23565
|
-
// Parse hour as integer for calculations
|
|
23566
|
-
let parsedHour = parseInt(hour, 10);
|
|
23567
|
-
// Convert hour to 24-hour format based on AM/PM (if present)
|
|
23568
|
-
if (amPm) {
|
|
23569
|
-
if (amPm === 'PM' && parsedHour < 12) {
|
|
23570
|
-
parsedHour += 12; // Convert PM to 24-hour
|
|
23571
|
-
}
|
|
23572
|
-
else if (amPm === 'AM' && parsedHour === 12) {
|
|
23573
|
-
parsedHour = 0; // Midnight in 24-hour format
|
|
23574
|
-
}
|
|
23575
|
-
}
|
|
23576
|
-
// Adjust for 12-hour format if necessary
|
|
23577
|
-
if (this.format.startsWith('hh')) {
|
|
23578
|
-
if (parsedHour === 0) {
|
|
23579
|
-
hour = '12'; // Midnight in 12-hour format
|
|
23580
|
-
}
|
|
23581
|
-
else if (parsedHour > 12) {
|
|
23582
|
-
hour = (parsedHour - 12).toString(); // Convert 24-hour to 12-hour
|
|
23583
|
-
}
|
|
23584
|
-
else {
|
|
23585
|
-
hour = parsedHour.toString();
|
|
23586
|
-
}
|
|
23587
|
-
}
|
|
23588
|
-
else {
|
|
23589
|
-
hour = parsedHour.toString(); // Use 24-hour format directly
|
|
23590
|
-
}
|
|
23591
|
-
// Pad hour, minute, and second to ensure two digits
|
|
23592
|
-
hour = hour.padStart(2, '0');
|
|
23593
|
-
minute = minute.padStart(2, '0');
|
|
23594
|
-
second = second.padStart(2, '0');
|
|
23595
|
-
// Update highlighted items for hours
|
|
23596
|
-
const hourSelector = `.time-column.time-column-hours div`;
|
|
23597
|
-
this.updateColumnHighlight(hourSelector, hour);
|
|
23598
|
-
// Update highlighted items for minutes
|
|
23599
|
-
const minuteSelector = `.time-column.time-column-minutes div`;
|
|
23600
|
-
this.updateColumnHighlight(minuteSelector, minute);
|
|
23601
|
-
// Update highlighted items for seconds
|
|
23602
|
-
const secondSelector = `.time-column.time-column-seconds div`;
|
|
23603
|
-
this.updateColumnHighlight(secondSelector, second);
|
|
23604
|
-
}
|
|
23585
|
+
// Initialize dropdown highlighting based on current component state
|
|
23586
|
+
// This ensures proper visual feedback without applying any constraints
|
|
23587
|
+
// Update highlighted items for hours based on current state
|
|
23588
|
+
const hourSelector = `.time-column.time-column-hours div`;
|
|
23589
|
+
this.updateColumnHighlight(hourSelector, this.hours);
|
|
23590
|
+
// Update highlighted items for minutes based on current state
|
|
23591
|
+
const minuteSelector = `.time-column.time-column-minutes div`;
|
|
23592
|
+
this.updateColumnHighlight(minuteSelector, this.minutes);
|
|
23593
|
+
// Update highlighted items for seconds based on current state
|
|
23594
|
+
const secondSelector = `.time-column.time-column-seconds div`;
|
|
23595
|
+
this.updateColumnHighlight(secondSelector, this.seconds);
|
|
23605
23596
|
}
|
|
23606
23597
|
//#endregion LIFECYCLE
|
|
23607
23598
|
/****************************************************************************/
|
|
23608
23599
|
//#region RENDER
|
|
23600
|
+
/**
|
|
23601
|
+
* Renders input fields based on the current format
|
|
23602
|
+
* Only shows fields that are relevant to the selected format
|
|
23603
|
+
* @returns {HTMLElement[]} Array of HTML elements for time input fields
|
|
23604
|
+
*/
|
|
23605
|
+
renderTimeInputFields() {
|
|
23606
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23607
|
+
const elements = [];
|
|
23608
|
+
visibleTypes.forEach((type, index) => {
|
|
23609
|
+
// Add separator colon before minutes and seconds (but not before the first field)
|
|
23610
|
+
if (index > 0) {
|
|
23611
|
+
elements.push(hAsync("span", null, ":"));
|
|
23612
|
+
}
|
|
23613
|
+
// Add the input field for this time type
|
|
23614
|
+
elements.push(this.renderTimeInputField(type));
|
|
23615
|
+
});
|
|
23616
|
+
return elements;
|
|
23617
|
+
}
|
|
23618
|
+
/**
|
|
23619
|
+
* Renders a single time input field for the specified type
|
|
23620
|
+
* @param {TimeType} type - The time type to render input for
|
|
23621
|
+
* @returns {HTMLInputElement} HTML input element for the specified time type
|
|
23622
|
+
*/
|
|
23623
|
+
renderTimeInputField(type) {
|
|
23624
|
+
const getValue = () => {
|
|
23625
|
+
switch (type) {
|
|
23626
|
+
case TimeType.Hours:
|
|
23627
|
+
return this.hours;
|
|
23628
|
+
case TimeType.Minutes:
|
|
23629
|
+
return this.minutes;
|
|
23630
|
+
case TimeType.Seconds:
|
|
23631
|
+
return this.seconds;
|
|
23632
|
+
default:
|
|
23633
|
+
return '00';
|
|
23634
|
+
}
|
|
23635
|
+
};
|
|
23636
|
+
const getPlaceholder = () => {
|
|
23637
|
+
switch (type) {
|
|
23638
|
+
case TimeType.Hours:
|
|
23639
|
+
return this.format.includes('hh') ? 'hh' : 'HH';
|
|
23640
|
+
case TimeType.Minutes:
|
|
23641
|
+
return 'mm';
|
|
23642
|
+
case TimeType.Seconds:
|
|
23643
|
+
return 'ss';
|
|
23644
|
+
default:
|
|
23645
|
+
return '';
|
|
23646
|
+
}
|
|
23647
|
+
};
|
|
23648
|
+
const getId = () => {
|
|
23649
|
+
switch (type) {
|
|
23650
|
+
case TimeType.Hours:
|
|
23651
|
+
return this.inputId;
|
|
23652
|
+
case TimeType.Minutes:
|
|
23653
|
+
return `${this.inputId}-minutes`;
|
|
23654
|
+
case TimeType.Seconds:
|
|
23655
|
+
return `${this.inputId}-seconds`;
|
|
23656
|
+
default:
|
|
23657
|
+
return this.inputId;
|
|
23658
|
+
}
|
|
23659
|
+
};
|
|
23660
|
+
// Remove min/max constraints from input elements to allow native stepper behavior
|
|
23661
|
+
// Constraints are only applied to dropdown options, not input steppers
|
|
23662
|
+
return (hAsync("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.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }));
|
|
23663
|
+
}
|
|
23664
|
+
/**
|
|
23665
|
+
* Renders dropdown columns based on the current format
|
|
23666
|
+
* Only shows columns that are relevant to the selected format
|
|
23667
|
+
* @returns {HTMLElement[]} Array of HTML elements for time dropdown columns
|
|
23668
|
+
*/
|
|
23669
|
+
renderTimeDropdownColumns() {
|
|
23670
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23671
|
+
return visibleTypes.map(type => this.RenderTimeOptionsColumn(type));
|
|
23672
|
+
}
|
|
23609
23673
|
RenderTimeOptionsColumn(type) {
|
|
23610
23674
|
return (hAsync("div", { class: `time-column time-column-${type}`, onScroll: e => this.handleScroll(e, type) }, this.generateInfiniteTimeOptions(type).map((option, index) => (hAsync("div", { class: {
|
|
23611
23675
|
'time-option': true,
|
|
@@ -23615,32 +23679,16 @@ class NvFieldtime {
|
|
|
23615
23679
|
}, key: `${option}-${index}`, onClick: e => this.handleTimeOptionClick(e, type) }, option)))));
|
|
23616
23680
|
}
|
|
23617
23681
|
render() {
|
|
23618
|
-
return (hAsync(Host, { key: '
|
|
23619
|
-
hAsync("
|
|
23620
|
-
|
|
23621
|
-
: TimeType.Hours, id: this.inputId, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
|
|
23622
|
-
], this.format.includes('mm') && [
|
|
23623
|
-
hAsync("span", { key: '74f9604ffd54e0c0bbd88996e32fdcb08f2c3645' }, ":"),
|
|
23624
|
-
hAsync("input", { key: '52f9b637bba804cac6fadff06e8b077bb2f5748a', ref: el => (this.inputElements[TimeType.Minutes] = el), type: "number", autofocus: this.autofocus, class: "time-input", pattern: "[0-9]*", maxlength: "3", value: this.minutes, onInput: e => this.handleInputChange(e, TimeType.Minutes), placeholder: "mm", inputMode: "numeric", onFocus: () => this.handleFocus(TimeType.Minutes), name: this.name
|
|
23625
|
-
? `${TimeType.Minutes}-${this.name}`
|
|
23626
|
-
: TimeType.Minutes, id: `${this.inputId}-minutes`, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
|
|
23627
|
-
], this.format.includes('ss') && [
|
|
23628
|
-
hAsync("span", { key: '878bc9ce7557e9cf9471803a86956a9184d0ccb5' }, ":"),
|
|
23629
|
-
hAsync("input", { key: 'b074d4d3ef80f66e7dbe051b6bc53f151661f409', ref: el => (this.inputElements[TimeType.Seconds] = el), type: "number", autofocus: this.autofocus, class: "time-input", pattern: "[0-9]*", maxlength: "3", value: this.seconds, onInput: e => this.handleInputChange(e, TimeType.Seconds), placeholder: "ss", inputMode: "numeric", onFocus: () => this.handleFocus(TimeType.Seconds), name: this.name
|
|
23630
|
-
? `${TimeType.Seconds}-${this.name}`
|
|
23631
|
-
: TimeType.Seconds, id: `${this.inputId}-seconds`, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
|
|
23632
|
-
], hAsync("nv-iconbutton", { key: '3f5d78116ee60d1874a4629d9cf36a06d52b7df4', name: 'clock', size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide time picker' : 'Show time picker', onClick: () => this.HandleDropdownIconClick() }), this.error && (hAsync("nv-icon", { key: '4b2356cf95131af213a4e98feede16fc8c4963db', name: "alert-circle", class: "validation", size: "sm" })), this.success && (hAsync("nv-icon", { key: 'f9b0e61037049a36ac900d1af9ecc71b211ebd88', name: "circle-check", class: "validation", size: "sm" }))), hAsync("slot", { key: '6177abde559c57f2b0586368ead1a61d7b543838', name: "after-input" })), hAsync("div", { key: 'f6d5205a5011411550179f9337143163cb547fb1', class: "time-dropdown", slot: "content" }, hAsync("div", { key: '9f0b3e1423bef197b269c5b11ce744cabc2bd6c4', class: "time-columns" }, startsWithIgnoreCase(this.format, 'HH') &&
|
|
23633
|
-
this.RenderTimeOptionsColumn(TimeType.Hours), this.format.includes('mm') &&
|
|
23634
|
-
this.RenderTimeOptionsColumn(TimeType.Minutes), this.format.includes('ss') &&
|
|
23635
|
-
this.RenderTimeOptionsColumn(TimeType.Seconds)))), (this.description ||
|
|
23636
|
-
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: '1076ded73b32ff9afbd0f02184febcc82f8d839e', class: "description" }, hAsync("slot", { key: '479d09b299d0e380533a6cd689ce7f03aa92ea8e', name: "description" }, this.description))), (this.errorDescription ||
|
|
23637
|
-
this.el.querySelector('[slot="error-description"]')) && (hAsync("div", { key: '5615246dbd797c300be357be37d3b9d0aee56e31', hidden: !this.error, class: "error-description" }, hAsync("slot", { key: '6568ea3f9e0bdf85dd280c645956f8e0bb592e35', name: "error-description" }, this.errorDescription)))));
|
|
23682
|
+
return (hAsync(Host, { key: '315b0a732c1ef8bee7aaa0141ce533ec265e35ab', onclick: (e) => this.handleHostClick(e), "aria-expanded": this.open ? 'true' : 'false' }, (this.label || this.el.querySelector('[slot="label"]')) && (hAsync("label", { key: '100b75accd50c277e3ddd13c007e55dad8c6f8b7', htmlFor: this.inputId }, hAsync("slot", { key: 'cec67688f98fc7976299a2f55ba8ba859e4ecacc', name: "label" }, this.label))), hAsync("nv-popover", { key: 'feaaefb107251368db809babb02b8f8c7cb7baf0', ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, hAsync("div", { key: 'c539917597eebdd92bb2e832d1fd9d6afceb5c04', class: "input-wrapper", slot: "trigger" }, hAsync("slot", { key: '5a869349e9fd7a422d596f5bd05402d5559a6f2b', name: "before-input" }), hAsync("div", { key: '27dac6987b28d08bb54b9ffc70ddade28f527a9c', class: "input-container" }, hAsync("slot", { key: '9df638bb3d58df138a360966925b04092f1d4b9a', name: "leading-input" }), this.renderTimeInputFields(), hAsync("nv-iconbutton", { key: '8d6796d9fc57ef2a934bfe79621ff76def8e9507', name: 'clock', size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide time picker' : 'Show time picker', onClick: () => this.HandleDropdownIconClick() }), this.error && (hAsync("nv-icon", { key: '15b593ce4e850d18a5f5f93120ae84e84054cffe', name: "alert-circle", class: "validation", size: "sm" })), this.success && (hAsync("nv-icon", { key: '85e4a38c3ef64552fc7a47448471d4276ee5cc46', name: "circle-check", class: "validation", size: "sm" }))), hAsync("slot", { key: '45cc1c26bc40425df62382a371ab658dd18aefa8', name: "after-input" })), hAsync("div", { key: '23432dd354491420e42400d9eeb22bc23e36623e', class: "time-dropdown", slot: "content" }, hAsync("div", { key: 'efb53556077c85ee94a8fe345a03d67a3e36cdc1', class: "time-columns" }, this.renderTimeDropdownColumns()))), (this.description ||
|
|
23683
|
+
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: '735447b328a8264739d3185ce6c65d48a01ec801', class: "description" }, hAsync("slot", { key: '86387e48804b2ac1842c64b4cf4f5ca9f34a6719', name: "description" }, this.description))), (this.errorDescription ||
|
|
23684
|
+
this.el.querySelector('[slot="error-description"]')) && (hAsync("div", { key: 'b6cc406c6a872b5ebb83a35a84852e143781e12f', hidden: !this.error, class: "error-description" }, hAsync("slot", { key: 'c9dc284e202b081a61346796d21e73c8647c7daa', name: "error-description" }, this.errorDescription)))));
|
|
23638
23685
|
}
|
|
23639
23686
|
static get formAssociated() { return true; }
|
|
23640
23687
|
get el() { return getElement(this); }
|
|
23641
23688
|
static get watchers() { return {
|
|
23642
23689
|
"value": ["handleValueChange"],
|
|
23643
|
-
"open": ["handleOpenChange"]
|
|
23690
|
+
"open": ["handleOpenChange"],
|
|
23691
|
+
"format": ["handleFormatChange"]
|
|
23644
23692
|
}; }
|
|
23645
23693
|
static get style() { return NvFieldtimeStyle0; }
|
|
23646
23694
|
static get cmpMeta() { return {
|
|
@@ -23740,7 +23788,7 @@ class NvIcon {
|
|
|
23740
23788
|
/****************************************************************************/
|
|
23741
23789
|
//#region RENDER
|
|
23742
23790
|
render() {
|
|
23743
|
-
return (hAsync(Host, { key: '
|
|
23791
|
+
return (hAsync(Host, { key: '6e9c51edb80741f70c2d8f3a9b60670fcdbf1ffd', class: clsx(this.color && `${this.color}`), role: "img", "aria-label": `${this.name}-icon` }, hAsync("svg", { key: '2df0f05d51b54ab78d4764375ae73c83c86a0c1c', stroke: "currentColor", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: `nv-icon-${this.size}` }, hAsync("use", { key: '6fb545fc4072b0de4edf5d76d15a0547dd5dd12e', href: `#nvicon_${this.name}` }))));
|
|
23744
23792
|
}
|
|
23745
23793
|
static get style() { return NvIconStyle0; }
|
|
23746
23794
|
static get cmpMeta() { return {
|
|
@@ -23884,7 +23932,7 @@ class NvIconbutton {
|
|
|
23884
23932
|
/****************************************************************************/
|
|
23885
23933
|
//#region RENDER
|
|
23886
23934
|
render() {
|
|
23887
|
-
return (hAsync(Host, { key: '
|
|
23935
|
+
return (hAsync(Host, { key: '4cda6f8b0c762c08964c5a4a882331d84eaa4514', role: "button", type: this.type, tabindex: "0", disabled: this.disabled ? true : undefined, class: clsx('root', `size-${this.size}`, `emphasis-${this.emphasis}`, this.loading && 'loading', `shape-${this.shape}`), onClick: this.handleClick }, this.loading && hAsync("nv-loader", { key: 'f433d942bad470a376ef8164e73b7025d15bd39e', size: this.size }), !this.loading && hAsync("nv-icon", { key: '1ceebfa6b5907dac279efff65a0f6d977d062453', name: this.name, size: this.size }), hAsync("slot", { key: 'd7f882e9c8dc0fcdb1bbb9ff783f7d387036d043' })));
|
|
23888
23936
|
}
|
|
23889
23937
|
static get formAssociated() { return true; }
|
|
23890
23938
|
get el() { return getElement(this); }
|
|
@@ -23932,7 +23980,7 @@ class NvLoader {
|
|
|
23932
23980
|
//#region RENDER
|
|
23933
23981
|
/* <slot> empty to force rendering change */
|
|
23934
23982
|
render() {
|
|
23935
|
-
return (hAsync(Host, { key: '
|
|
23983
|
+
return (hAsync(Host, { key: '4692310e37f31424602a1592cb0648e9bf95a609', class: clsx(this.size && `size-${this.size}`, this.color && `color-${this.color}`) }));
|
|
23936
23984
|
}
|
|
23937
23985
|
static get style() { return NvLoaderStyle0; }
|
|
23938
23986
|
static get cmpMeta() { return {
|
|
@@ -24155,7 +24203,7 @@ class NvMenu {
|
|
|
24155
24203
|
});
|
|
24156
24204
|
}
|
|
24157
24205
|
render() {
|
|
24158
|
-
return (hAsync(Host, { key: '
|
|
24206
|
+
return (hAsync(Host, { key: 'e563f1a78be7cd37b0fe353882cd5874f3a12e60' }, hAsync("slot", { key: 'd91afe28b83121707e752532d349fdc9b983ea71', name: "trigger" }), hAsync("nv-popover", { key: '90c1fc4e30d9cd7b02bd5ad620b3eb824f82d058', ref: el => (this.popoverElement = el), triggerMode: "click", triggerElement: this.triggerElement, placement: this.placement, nested: this.nested, open: this.open }, this.items ? (hAsync("ul", { slot: "content" }, this.renderMenuItems())) : (hAsync("slot", { name: "content" })))));
|
|
24159
24207
|
}
|
|
24160
24208
|
get el() { return getElement(this); }
|
|
24161
24209
|
static get watchers() { return {
|
|
@@ -24229,7 +24277,7 @@ class NvMenuitem {
|
|
|
24229
24277
|
/****************************************************************************/
|
|
24230
24278
|
//#region RENDER
|
|
24231
24279
|
render() {
|
|
24232
|
-
return (hAsync(Host, { key: '
|
|
24280
|
+
return (hAsync(Host, { key: '96933ba797e263a6c56e4b079227498eff19989e', role: "menuitem", tabindex: this.disabled ? '-1' : '0' }, this.icon && hAsync("nv-icon", { key: '17fd121521b54f2065b91a0921d7a2573139086e', name: this.icon }), hAsync("slot", { key: 'e503e3667ee008f6c370d928c2ba0781b1240200' }), this.label && hAsync("span", { key: '521f094eb6e3a4015424ef1516a10d6fa454d8ab', "data-scope": "text" }, this.label), this.shortcut && !this.hasSubmenu && hAsync("kbd", { key: 'e27628004929e519503dac10f7c278b8a9330176' }, this.shortcut), this.hasSubmenu && hAsync("nv-icon", { key: 'c706e459412f628a397f1b4d38010c5de23d643f', name: "chevron-right" })));
|
|
24233
24281
|
}
|
|
24234
24282
|
get el() { return getElement(this); }
|
|
24235
24283
|
static get style() { return NvMenuitemStyle0; }
|
|
@@ -24414,7 +24462,7 @@ class NvNotification {
|
|
|
24414
24462
|
//#region RENDER
|
|
24415
24463
|
render() {
|
|
24416
24464
|
var _a, _b, _c;
|
|
24417
|
-
return (hAsync(Host, { key: '
|
|
24465
|
+
return (hAsync(Host, { key: '6e0908c4dc5bbd289b756703f19e932165da7eeb', role: this.getAriaRole(), "aria-live": this.getAriaLive(), "aria-atomic": true, "aria-labelledby": (_a = this.getHeadingId()) !== null && _a !== void 0 ? _a : null, "aria-describedby": (_b = this.getMessageId()) !== null && _b !== void 0 ? _b : null, tabindex: "-1" }, hAsync("div", { key: 'c14fb6bcbfc7048bd1d2171e489e2b1d4a8d3486', "data-scope": "container", ref: el => (this.container = el) }, this.dismissible && (hAsync("button", { key: 'dbc3162958edc2655d59e770b1e27f8226b2a2ec', "data-scope": "dismiss", type: "button", onClick: this.dismiss.bind(this) }, hAsync("nv-icon", { key: '8ddb1a6ec22c343f5df6158418a4bf434b1d1169', name: "x", size: "sm" }))), hAsync("nv-icon", { key: '29e12bb41102cedf3f0b7d8680a265535b69ff23', name: (_c = this.icon) !== null && _c !== void 0 ? _c : this.getDefaultIcon(), size: "md", "data-scope": "icon" }), hAsync("div", { key: '996b53cdfa47b14769a08d23b9971475521b94e0', "data-scope": "content" }, (this.heading || this.headingSlot) && (hAsync("p", { key: '110046b680b485d323c49f0836589235aa695ff0', id: this.getHeadingId(), "data-scope": "heading" }, hAsync("slot", { key: 'f256cd10825ee24b4caef51c46ac8e9f7af152c0', name: "heading" }, this.heading))), (this.message || this.messageSlot) && (hAsync("p", { key: '73573a91e4cea1acdf12b428f217562eb4df5cf3', id: this.getMessageId(), "data-scope": "message" }, hAsync("slot", { key: '9bb41cd075367cc9c223ccd4fdb0ff47871941a6', name: "content" }, this.message))), this.actionsSlot && (hAsync("div", { key: '7fff75429d22bf9344f077672c18bfe583e99301', "data-scope": "actions" }, hAsync("slot", { key: 'e77b1c3e310db84e3965f097e595f11a8b32ebc3', name: "actions" })))))));
|
|
24418
24466
|
}
|
|
24419
24467
|
get el() { return getElement(this); }
|
|
24420
24468
|
static get style() { return NvNotificationStyle0; }
|
|
@@ -24474,7 +24522,7 @@ class NvNotificationContainer {
|
|
|
24474
24522
|
/****************************************************************************/
|
|
24475
24523
|
//#region RENDER
|
|
24476
24524
|
render() {
|
|
24477
|
-
return (hAsync(Host, { key: '
|
|
24525
|
+
return (hAsync(Host, { key: '23a42b8ff4be4ca749656567ad5cbc64bba70466', class: `position-${this.position}` }, hAsync("slot", { key: '48a48d6b6e2580f072918192cf59e73cd3dfc1f5' })));
|
|
24478
24526
|
}
|
|
24479
24527
|
static get style() { return NvNotificationcontainerStyle0; }
|
|
24480
24528
|
static get cmpMeta() { return {
|
|
@@ -26875,7 +26923,7 @@ class NvPopover {
|
|
|
26875
26923
|
/****************************************************************************/
|
|
26876
26924
|
//#region RENDER
|
|
26877
26925
|
render() {
|
|
26878
|
-
return (hAsync(Host, { key: '
|
|
26926
|
+
return (hAsync(Host, { key: '8fdb18b1233e2f988d16b85927bbf5b1f7f47630' }, hAsync("slot", { key: '3dfc19787da335fa0e6b38fe2aebfa1a9df04ea8', name: "trigger" }), hAsync("div", { key: 'd529ca4a2efb62d6bfab679d85acbfb8002e1442', "data-scope": "popover", "data-strategy": this.strategy, hidden: true, ref: el => (this.popoverElement = el) }, this.hasArrow && (hAsync("div", { key: 'bb187c48e62a9653af8649c1a0670534499f6060', "data-scope": "arrow", ref: el => (this.arrowElement = el) })), hAsync("slot", { key: 'b60efb50e864ac0f530fcb7b9fc52c53924f29b1', name: "content" }))));
|
|
26879
26927
|
}
|
|
26880
26928
|
get el() { return getElement(this); }
|
|
26881
26929
|
static get watchers() { return {
|
|
@@ -26922,7 +26970,7 @@ class NvRow {
|
|
|
26922
26970
|
/****************************************************************************/
|
|
26923
26971
|
//#region RENDER
|
|
26924
26972
|
render() {
|
|
26925
|
-
return (hAsync(Host, { key: '
|
|
26973
|
+
return (hAsync(Host, { key: '664375922c55485e6b297f0e64950db684ecffa3' }, hAsync("slot", { key: '194e45ce439cadb2bdba17072070d3926a746d3f' })));
|
|
26926
26974
|
}
|
|
26927
26975
|
static get style() { return NvRowStyle0; }
|
|
26928
26976
|
static get cmpMeta() { return {
|
|
@@ -27260,7 +27308,7 @@ class NvSplit {
|
|
|
27260
27308
|
/****************************************************************************/
|
|
27261
27309
|
//#region RENDER
|
|
27262
27310
|
render() {
|
|
27263
|
-
return (hAsync(Host, { key: '
|
|
27311
|
+
return (hAsync(Host, { key: 'b0874368ed8b3c1b5cd0676a1c8181e827369ad7', "data-dragging": this.isDragging.toString() }, hAsync("slot", { key: 'a0e35a851390bf1f0ffcf065fdeb23cba3c75c9c', name: "pane" }), hAsync("slot", { key: 'a80dbbc4862c3a30aac9e89d6b80a19245083c42', name: "gutter" })));
|
|
27264
27312
|
}
|
|
27265
27313
|
get el() { return getElement(this); }
|
|
27266
27314
|
static get watchers() { return {
|
|
@@ -27310,7 +27358,7 @@ class NvStack {
|
|
|
27310
27358
|
/****************************************************************************/
|
|
27311
27359
|
//#region RENDER
|
|
27312
27360
|
render() {
|
|
27313
|
-
return (hAsync(Host, { key: '
|
|
27361
|
+
return (hAsync(Host, { key: '66123f22ad4a6ebefe8663c795274eb900d2c178', class: clsx(this.fill && 'nv-stack-fill', this.flex && 'nv-stack-flex', this.full && 'w-full', this.gutter && !this.vertical && `gap-x-${this.gutter}`, this.gutter && this.vertical && `gap-y-${this.gutter}`, this.vertical && 'nv-stack-vertical') }, hAsync("slot", { key: '7b3d395c3490664f0e2f337a04f69cc717ed6c0e' })));
|
|
27314
27362
|
}
|
|
27315
27363
|
static get style() { return NvStackStyle0; }
|
|
27316
27364
|
static get cmpMeta() { return {
|
|
@@ -27564,7 +27612,7 @@ class NvTable {
|
|
|
27564
27612
|
/****************************************************************************/
|
|
27565
27613
|
//#region RENDER
|
|
27566
27614
|
render() {
|
|
27567
|
-
return (hAsync(Host, { key: '
|
|
27615
|
+
return (hAsync(Host, { key: '37c5e773664fc7bc324d46c003057f322e118c0d' }, hAsync("slot", { key: '28decbb3d75da3471a95d9130fdb8206df811270' })));
|
|
27568
27616
|
}
|
|
27569
27617
|
get host() { return getElement(this); }
|
|
27570
27618
|
static get style() { return NvTableStyle0; }
|
|
@@ -27642,8 +27690,8 @@ class NvToggle {
|
|
|
27642
27690
|
/****************************************************************************/
|
|
27643
27691
|
//#region RENDER
|
|
27644
27692
|
render() {
|
|
27645
|
-
return (hAsync(Host, { key: '
|
|
27646
|
-
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: '
|
|
27693
|
+
return (hAsync(Host, { key: '3e1eecaddeab51801343663989a1554ae62794be', class: clsx(this.labelPlacement === 'before' && 'label-placement-before') }, hAsync("div", { key: 'a67b9c8c0159d6b2a1f87d06d536116475fd9683', class: "input-container" }, hAsync("input", { key: '2ce5d01313da8fe74cdac78616c051236aa3102e', type: "checkbox", id: this.inputId, name: this.name, autocomplete: "off", value: this.value, checked: Boolean(this.checked), disabled: this.disabled || this.readonly, readonly: this.readonly })), hAsync("div", { key: '0e7e1960fc3cd8ff1c79b3c8d4fc306e2b761bfc', class: "text-container" }, (this.label || this.el.querySelector('[slot="label"]')) && (hAsync("label", { key: '0325700fc58d39878821a4b1871cb433eda18199', htmlFor: this.inputId, class: clsx(this.hideLabel && 'visually-hidden') }, hAsync("slot", { key: '4b627dbbad2f52446a0ebb4eacdfe3d6d5ccdbb0', name: "label" }, this.label))), (this.description ||
|
|
27694
|
+
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: 'db7d0a200c66e234142b455686afdd409337b336', class: "description" }, hAsync("slot", { key: '171bb20b639a07bda52cb788fb367a51d6dbe7f8', name: "description" }, this.description))))));
|
|
27647
27695
|
}
|
|
27648
27696
|
static get formAssociated() { return true; }
|
|
27649
27697
|
get el() { return getElement(this); }
|
|
@@ -27719,7 +27767,7 @@ class NvTogglebutton {
|
|
|
27719
27767
|
/****************************************************************************/
|
|
27720
27768
|
//#region RENDER
|
|
27721
27769
|
render() {
|
|
27722
|
-
return (hAsync(Host, { key: '
|
|
27770
|
+
return (hAsync(Host, { key: '6965d7bd520347f5236cca32ca674875a9a4fd2f', role: "button", tabindex: "0", "aria-pressed": String(this.active), onClick: this.handleClick }, hAsync("slot", { key: '45ddd14b67904252c2e78b6357fbd33790facf23' })));
|
|
27723
27771
|
}
|
|
27724
27772
|
static get style() { return NvTogglebuttonStyle0; }
|
|
27725
27773
|
static get cmpMeta() { return {
|
|
@@ -27893,7 +27941,7 @@ class NvTogglebuttongroup {
|
|
|
27893
27941
|
/****************************************************************************/
|
|
27894
27942
|
//#region RENDER
|
|
27895
27943
|
render() {
|
|
27896
|
-
return (hAsync(Host, { key: '
|
|
27944
|
+
return (hAsync(Host, { key: '4e075360c060e6de5af80325f7b91e7573f89b16' }, hAsync("slot", { key: '7b361c2d608b17cb91814d279aac842e666fda5a' })));
|
|
27897
27945
|
}
|
|
27898
27946
|
get el() { return getElement(this); }
|
|
27899
27947
|
static get watchers() { return {
|
|
@@ -27964,7 +28012,7 @@ class NvTooltip {
|
|
|
27964
28012
|
/****************************************************************************/
|
|
27965
28013
|
//#region RENDER
|
|
27966
28014
|
render() {
|
|
27967
|
-
return (hAsync(Host, { key: '
|
|
28015
|
+
return (hAsync(Host, { key: 'bbf9407ca59c3e6122cbdc7c9e3aefe56b64311d' }, hAsync("slot", { key: 'b13ae1307843e66cd018ce204c94147b53a26649' }), hAsync("nv-popover", { key: '12d9bdca8d68eff93f6aa80304535df3be127c32', triggerMode: "hover", hasArrow: true, placement: this.placement, strategy: this.strategy, triggerElement: this.triggerElement, groupName: 'tooltip', enterDelay: this.enterDelay }, hAsync("p", { key: '6f4e64e97cc644f9da030e30b1069150c47c2985', slot: "content" }, this.message), hAsync("slot", { key: '2b55d3b0c1279ce0a8bf165be1b26fe854e91d47', name: "content" }))));
|
|
27968
28016
|
}
|
|
27969
28017
|
get el() { return getElement(this); }
|
|
27970
28018
|
static get style() { return NvTooltipStyle0; }
|