@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.js
CHANGED
|
@@ -22622,23 +22622,247 @@ class NvFieldtextarea {
|
|
|
22622
22622
|
}
|
|
22623
22623
|
|
|
22624
22624
|
/**
|
|
22625
|
-
*
|
|
22626
|
-
* @param {string} str - The string to check.
|
|
22627
|
-
* @param {string} prefix - The prefix to check for.
|
|
22628
|
-
* @returns {boolean} - True if the string starts with the prefix, ignoring case.
|
|
22629
|
-
* @example startsWithIgnoreCase('Hello, world!', 'hello') // true
|
|
22630
|
-
* @example startsWithIgnoreCase('Hello, world!', 'world') // false
|
|
22625
|
+
* Format configurations for all supported time formats
|
|
22631
22626
|
*/
|
|
22632
|
-
|
|
22633
|
-
|
|
22627
|
+
const FORMAT_CONFIGS = {
|
|
22628
|
+
'HH': {
|
|
22629
|
+
pattern: /^([0-1]?[0-9]|2[0-3])$/,
|
|
22630
|
+
parts: [TimeType.Hours],
|
|
22631
|
+
defaultValue: '00',
|
|
22632
|
+
maxLength: 2,
|
|
22633
|
+
},
|
|
22634
|
+
'HH:mm': {
|
|
22635
|
+
pattern: /^([0-1]?[0-9]|2[0-3]):([0-5]?[0-9])$/,
|
|
22636
|
+
parts: [TimeType.Hours, TimeType.Minutes],
|
|
22637
|
+
defaultValue: '00:00',
|
|
22638
|
+
maxLength: 5,
|
|
22639
|
+
},
|
|
22640
|
+
'HH:mm:ss': {
|
|
22641
|
+
pattern: /^([0-1]?[0-9]|2[0-3]):([0-5]?[0-9]):([0-5]?[0-9])$/,
|
|
22642
|
+
parts: [TimeType.Hours, TimeType.Minutes, TimeType.Seconds],
|
|
22643
|
+
defaultValue: '00:00:00',
|
|
22644
|
+
maxLength: 8,
|
|
22645
|
+
},
|
|
22646
|
+
'hh': {
|
|
22647
|
+
pattern: /^(0?[1-9]|1[0-2])$/,
|
|
22648
|
+
parts: [TimeType.Hours],
|
|
22649
|
+
defaultValue: '01',
|
|
22650
|
+
maxLength: 2,
|
|
22651
|
+
},
|
|
22652
|
+
'hh:mm': {
|
|
22653
|
+
pattern: /^(0?[1-9]|1[0-2]):([0-5]?[0-9])$/,
|
|
22654
|
+
parts: [TimeType.Hours, TimeType.Minutes],
|
|
22655
|
+
defaultValue: '01:00',
|
|
22656
|
+
maxLength: 5,
|
|
22657
|
+
},
|
|
22658
|
+
'hh:mm:ss': {
|
|
22659
|
+
pattern: /^(0?[1-9]|1[0-2]):([0-5]?[0-9]):([0-5]?[0-9])$/,
|
|
22660
|
+
parts: [TimeType.Hours, TimeType.Minutes, TimeType.Seconds],
|
|
22661
|
+
defaultValue: '01:00:00',
|
|
22662
|
+
maxLength: 8,
|
|
22663
|
+
},
|
|
22664
|
+
};
|
|
22665
|
+
/**
|
|
22666
|
+
* Returns the visible time types for a given format
|
|
22667
|
+
* @param {string} format - The time format string
|
|
22668
|
+
* @returns {TimeType[]} Array of TimeType values that should be visible
|
|
22669
|
+
*/
|
|
22670
|
+
function getVisibleTimeTypes(format) {
|
|
22671
|
+
const config = FORMAT_CONFIGS[format];
|
|
22672
|
+
if (!config) {
|
|
22673
|
+
// Fallback for unknown formats
|
|
22674
|
+
return [TimeType.Hours, TimeType.Minutes, TimeType.Seconds];
|
|
22675
|
+
}
|
|
22676
|
+
return config.parts;
|
|
22677
|
+
}
|
|
22678
|
+
/**
|
|
22679
|
+
* Validates if a given value string matches the expected format pattern
|
|
22680
|
+
* @param {string} value - The time value string to validate
|
|
22681
|
+
* @param {string} format - The expected time format
|
|
22682
|
+
* @returns {boolean} True if the value matches the format, false otherwise
|
|
22683
|
+
*/
|
|
22684
|
+
function isValidFormatValue(value, format) {
|
|
22685
|
+
if (!value || !format) {
|
|
22686
|
+
return false;
|
|
22687
|
+
}
|
|
22688
|
+
const config = FORMAT_CONFIGS[format];
|
|
22689
|
+
if (!config) {
|
|
22634
22690
|
return false;
|
|
22635
|
-
|
|
22691
|
+
}
|
|
22692
|
+
return config.pattern.test(value);
|
|
22693
|
+
}
|
|
22694
|
+
/**
|
|
22695
|
+
* Parses a time value string according to the specified format
|
|
22696
|
+
* Handles both full and partial time strings with backward compatibility
|
|
22697
|
+
* @param {string} value - The time value string to parse
|
|
22698
|
+
* @param {string} format - The target time format
|
|
22699
|
+
* @returns {TimeComponents} TimeComponents object with parsed hours, minutes, and seconds
|
|
22700
|
+
*/
|
|
22701
|
+
function parseValueByFormat(value, format) {
|
|
22702
|
+
const config = FORMAT_CONFIGS[format];
|
|
22703
|
+
const defaultComponents = {
|
|
22704
|
+
hours: format.startsWith('hh') ? '01' : '00',
|
|
22705
|
+
minutes: '00',
|
|
22706
|
+
seconds: '00',
|
|
22707
|
+
};
|
|
22708
|
+
if (!value || !config) {
|
|
22709
|
+
return defaultComponents;
|
|
22710
|
+
}
|
|
22711
|
+
// Clean the input value - remove non-numeric characters except colons
|
|
22712
|
+
const cleanValue = value.replace(/[^0-9:]/g, '');
|
|
22713
|
+
// Try to match the exact format first
|
|
22714
|
+
const exactMatch = cleanValue.match(config.pattern);
|
|
22715
|
+
if (exactMatch) {
|
|
22716
|
+
return extractComponentsFromMatch(exactMatch, format);
|
|
22717
|
+
}
|
|
22718
|
+
// Handle backward compatibility - parse full format values when format is shorter
|
|
22719
|
+
const fullFormatPattern = /^([0-1]?[0-9]|2[0-3]):([0-5]?[0-9]):([0-5]?[0-9])$/;
|
|
22720
|
+
const fullMatch = cleanValue.match(fullFormatPattern);
|
|
22721
|
+
if (fullMatch) {
|
|
22722
|
+
const fullComponents = extractComponentsFromMatch(fullMatch, 'HH:mm:ss');
|
|
22723
|
+
return extractRelevantComponents(fullComponents, format);
|
|
22724
|
+
}
|
|
22725
|
+
// Handle partial format values - try to parse what we can
|
|
22726
|
+
const parts = cleanValue.split(':');
|
|
22727
|
+
const result = Object.assign({}, defaultComponents);
|
|
22728
|
+
if (parts.length >= 1 && parts[0]) {
|
|
22729
|
+
const hours = parseInt(parts[0], 10);
|
|
22730
|
+
if (!isNaN(hours)) {
|
|
22731
|
+
if (format.startsWith('hh')) {
|
|
22732
|
+
// 12-hour format validation
|
|
22733
|
+
if (hours >= 1 && hours <= 12) {
|
|
22734
|
+
result.hours = hours.toString().padStart(2, '0');
|
|
22735
|
+
}
|
|
22736
|
+
else {
|
|
22737
|
+
// Invalid hour for 12-hour format, keep default
|
|
22738
|
+
result.hours = defaultComponents.hours;
|
|
22739
|
+
}
|
|
22740
|
+
}
|
|
22741
|
+
else {
|
|
22742
|
+
// 24-hour format validation
|
|
22743
|
+
if (hours >= 0 && hours <= 23) {
|
|
22744
|
+
result.hours = hours.toString().padStart(2, '0');
|
|
22745
|
+
}
|
|
22746
|
+
else {
|
|
22747
|
+
// Invalid hour for 24-hour format, keep default
|
|
22748
|
+
result.hours = defaultComponents.hours;
|
|
22749
|
+
}
|
|
22750
|
+
}
|
|
22751
|
+
}
|
|
22752
|
+
}
|
|
22753
|
+
if (parts.length >= 2 &&
|
|
22754
|
+
parts[1] &&
|
|
22755
|
+
config.parts.includes(TimeType.Minutes)) {
|
|
22756
|
+
const minutes = parseInt(parts[1], 10);
|
|
22757
|
+
if (!isNaN(minutes) && minutes >= 0 && minutes <= 59) {
|
|
22758
|
+
result.minutes = minutes.toString().padStart(2, '0');
|
|
22759
|
+
}
|
|
22760
|
+
}
|
|
22761
|
+
if (parts.length >= 3 &&
|
|
22762
|
+
parts[2] &&
|
|
22763
|
+
config.parts.includes(TimeType.Seconds)) {
|
|
22764
|
+
const seconds = parseInt(parts[2], 10);
|
|
22765
|
+
if (!isNaN(seconds) && seconds >= 0 && seconds <= 59) {
|
|
22766
|
+
result.seconds = seconds.toString().padStart(2, '0');
|
|
22767
|
+
}
|
|
22768
|
+
}
|
|
22769
|
+
return result;
|
|
22770
|
+
}
|
|
22771
|
+
/**
|
|
22772
|
+
* Extracts time components from a regex match result
|
|
22773
|
+
* @param {RegExpMatchArray} match - The regex match result
|
|
22774
|
+
* @param {string} format - The format that was matched
|
|
22775
|
+
* @returns {TimeComponents} TimeComponents object
|
|
22776
|
+
*/
|
|
22777
|
+
function extractComponentsFromMatch(match, format) {
|
|
22778
|
+
const result = {
|
|
22779
|
+
hours: format.startsWith('hh') ? '01' : '00',
|
|
22780
|
+
minutes: '00',
|
|
22781
|
+
seconds: '00',
|
|
22782
|
+
};
|
|
22783
|
+
if (match[1]) {
|
|
22784
|
+
result.hours = parseInt(match[1], 10).toString().padStart(2, '0');
|
|
22785
|
+
}
|
|
22786
|
+
if (match[2]) {
|
|
22787
|
+
result.minutes = parseInt(match[2], 10).toString().padStart(2, '0');
|
|
22788
|
+
}
|
|
22789
|
+
if (match[3]) {
|
|
22790
|
+
result.seconds = parseInt(match[3], 10).toString().padStart(2, '0');
|
|
22791
|
+
}
|
|
22792
|
+
return result;
|
|
22793
|
+
}
|
|
22794
|
+
/**
|
|
22795
|
+
* Extracts only the relevant components based on the target format
|
|
22796
|
+
* @param {TimeComponents} components - Full time components
|
|
22797
|
+
* @param {string} format - Target format to extract components for
|
|
22798
|
+
* @returns {TimeComponents} TimeComponents with only relevant parts
|
|
22799
|
+
*/
|
|
22800
|
+
function extractRelevantComponents(components, format) {
|
|
22801
|
+
const config = FORMAT_CONFIGS[format];
|
|
22802
|
+
const result = {
|
|
22803
|
+
hours: format.startsWith('hh') ? '01' : '00',
|
|
22804
|
+
minutes: '00',
|
|
22805
|
+
seconds: '00',
|
|
22806
|
+
};
|
|
22807
|
+
if (config.parts.includes(TimeType.Hours)) {
|
|
22808
|
+
// Validate hours for the target format
|
|
22809
|
+
const hours = parseInt(components.hours, 10);
|
|
22810
|
+
if (format.startsWith('hh')) {
|
|
22811
|
+
// 12-hour format validation
|
|
22812
|
+
if (hours >= 1 && hours <= 12) {
|
|
22813
|
+
result.hours = components.hours;
|
|
22814
|
+
}
|
|
22815
|
+
// If invalid, keep the default '01'
|
|
22816
|
+
}
|
|
22817
|
+
else {
|
|
22818
|
+
// 24-hour format validation
|
|
22819
|
+
if (hours >= 0 && hours <= 23) {
|
|
22820
|
+
result.hours = components.hours;
|
|
22821
|
+
}
|
|
22822
|
+
// If invalid, keep the default '00'
|
|
22823
|
+
}
|
|
22824
|
+
}
|
|
22825
|
+
if (config.parts.includes(TimeType.Minutes)) {
|
|
22826
|
+
result.minutes = components.minutes;
|
|
22827
|
+
}
|
|
22828
|
+
if (config.parts.includes(TimeType.Seconds)) {
|
|
22829
|
+
result.seconds = components.seconds;
|
|
22830
|
+
}
|
|
22831
|
+
return result;
|
|
22832
|
+
}
|
|
22833
|
+
/**
|
|
22834
|
+
* Reconstructs a time string from components according to the specified format
|
|
22835
|
+
* @param {TimeComponents} components - Time components to reconstruct
|
|
22836
|
+
* @param {string} format - Target format for reconstruction
|
|
22837
|
+
* @returns {string} Formatted time string
|
|
22838
|
+
*/
|
|
22839
|
+
function reconstructTimeByFormat(components, format) {
|
|
22840
|
+
const config = FORMAT_CONFIGS[format];
|
|
22841
|
+
if (!config) {
|
|
22842
|
+
return `${components.hours}:${components.minutes}:${components.seconds}`;
|
|
22843
|
+
}
|
|
22844
|
+
switch (format) {
|
|
22845
|
+
case 'HH':
|
|
22846
|
+
case 'hh':
|
|
22847
|
+
return components.hours;
|
|
22848
|
+
case 'HH:mm':
|
|
22849
|
+
case 'hh:mm':
|
|
22850
|
+
return `${components.hours}:${components.minutes}`;
|
|
22851
|
+
case 'HH:mm:ss':
|
|
22852
|
+
case 'hh:mm:ss':
|
|
22853
|
+
return `${components.hours}:${components.minutes}:${components.seconds}`;
|
|
22854
|
+
default:
|
|
22855
|
+
return `${components.hours}:${components.minutes}:${components.seconds}`;
|
|
22856
|
+
}
|
|
22636
22857
|
}
|
|
22637
22858
|
|
|
22638
|
-
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)}";
|
|
22859
|
+
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)}";
|
|
22639
22860
|
var NvFieldtimeStyle0 = nvFieldtimeCss;
|
|
22640
22861
|
|
|
22641
22862
|
/**
|
|
22863
|
+
* A format-aware time input component that displays only relevant input fields based on the specified format.
|
|
22864
|
+
* The component ensures consistency between the format property and both input validation and value emission.
|
|
22865
|
+
*
|
|
22642
22866
|
* @slot label - Content to be placed as the label, will override the label prop.
|
|
22643
22867
|
* @slot before-input - Content to be placed before the input text, outside the input container.
|
|
22644
22868
|
* @slot after-input - Content to be placed after the input text, outside the input container.
|
|
@@ -22703,6 +22927,10 @@ class NvFieldtime {
|
|
|
22703
22927
|
* - hh: 12-hour format (01-12)
|
|
22704
22928
|
* - hh:mm: 12-hour format with minutes (01:00-12:59)
|
|
22705
22929
|
* - hh:mm:ss: 12-hour format with minutes and seconds (01:00:00-12:59:59)
|
|
22930
|
+
*
|
|
22931
|
+
* The component automatically shows only the relevant input fields based on the selected format.
|
|
22932
|
+
* When the format changes dynamically, the component re-parses the current value and updates
|
|
22933
|
+
* the visible fields accordingly.
|
|
22706
22934
|
*/
|
|
22707
22935
|
this.format = 'HH:mm:ss';
|
|
22708
22936
|
/**
|
|
@@ -22731,7 +22959,7 @@ class NvFieldtime {
|
|
|
22731
22959
|
this.open = event.detail;
|
|
22732
22960
|
}
|
|
22733
22961
|
handleKeyDown(event) {
|
|
22734
|
-
var _a, _b
|
|
22962
|
+
var _a, _b;
|
|
22735
22963
|
if (!this.open) {
|
|
22736
22964
|
if (event.key === 'ArrowDown') {
|
|
22737
22965
|
this.open = true;
|
|
@@ -22766,20 +22994,22 @@ class NvFieldtime {
|
|
|
22766
22994
|
else if (event.key === 'Enter' && currentIndex >= 0) {
|
|
22767
22995
|
event.preventDefault();
|
|
22768
22996
|
items[currentIndex].click();
|
|
22769
|
-
|
|
22770
|
-
|
|
22771
|
-
|
|
22772
|
-
|
|
22773
|
-
|
|
22774
|
-
|
|
22775
|
-
(
|
|
22776
|
-
(
|
|
22997
|
+
// Navigate to the next visible field
|
|
22998
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
22999
|
+
const currentTypeIndex = visibleTypes.indexOf(this.typeFocused);
|
|
23000
|
+
const nextTypeIndex = currentTypeIndex + 1;
|
|
23001
|
+
if (nextTypeIndex < visibleTypes.length) {
|
|
23002
|
+
const nextType = visibleTypes[nextTypeIndex];
|
|
23003
|
+
(_a = this.inputElements[nextType]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
23004
|
+
(_b = this.inputElements[nextType]) === null || _b === void 0 ? void 0 : _b.select();
|
|
22777
23005
|
}
|
|
22778
23006
|
}
|
|
22779
23007
|
else if (event.key === 'Escape') {
|
|
22780
23008
|
event.preventDefault();
|
|
22781
|
-
|
|
22782
|
-
|
|
23009
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23010
|
+
const firstVisibleType = visibleTypes[0];
|
|
23011
|
+
if (firstVisibleType && this.inputElements[firstVisibleType]) {
|
|
23012
|
+
this.inputElements[firstVisibleType].blur();
|
|
22783
23013
|
}
|
|
22784
23014
|
}
|
|
22785
23015
|
}
|
|
@@ -22787,6 +23017,18 @@ class NvFieldtime {
|
|
|
22787
23017
|
/****************************************************************************/
|
|
22788
23018
|
//#region WATCHERS
|
|
22789
23019
|
handleValueChange(newValue) {
|
|
23020
|
+
// Parse the new value and ensure it's in the correct format
|
|
23021
|
+
if (newValue) {
|
|
23022
|
+
const components = parseValueByFormat(newValue, this.format);
|
|
23023
|
+
const formattedValue = reconstructTimeByFormat(components, this.format);
|
|
23024
|
+
// Only emit if the formatted value is different from what we received
|
|
23025
|
+
// This prevents infinite loops while ensuring format consistency
|
|
23026
|
+
if (formattedValue !== newValue) {
|
|
23027
|
+
this.value = formattedValue;
|
|
23028
|
+
return; // The watcher will be called again with the formatted value
|
|
23029
|
+
}
|
|
23030
|
+
}
|
|
23031
|
+
// Emit the value in the correct format
|
|
22790
23032
|
this.valueChanged.emit(newValue);
|
|
22791
23033
|
}
|
|
22792
23034
|
handleOpenChange(newOpen) {
|
|
@@ -22801,12 +23043,34 @@ class NvFieldtime {
|
|
|
22801
23043
|
this.updateColumnHighlight(secondsSelector, this.seconds);
|
|
22802
23044
|
}
|
|
22803
23045
|
}
|
|
23046
|
+
handleFormatChange(newFormat, oldFormat) {
|
|
23047
|
+
if (newFormat === oldFormat) {
|
|
23048
|
+
return; // No change, nothing to do
|
|
23049
|
+
}
|
|
23050
|
+
// Re-parse the current value with the new format
|
|
23051
|
+
const currentValue = this.value || this.reconstructTime();
|
|
23052
|
+
// Parse the current value using the old format to get the time components
|
|
23053
|
+
const components = parseValueByFormat(currentValue, oldFormat || 'HH:mm:ss');
|
|
23054
|
+
// Update the component state with the parsed components
|
|
23055
|
+
this.hours = components.hours;
|
|
23056
|
+
this.minutes = components.minutes;
|
|
23057
|
+
this.seconds = components.seconds;
|
|
23058
|
+
// Reconstruct the time value in the new format
|
|
23059
|
+
const newValue = reconstructTimeByFormat(components, newFormat);
|
|
23060
|
+
// Update the value, which will trigger the value watcher and emit the event
|
|
23061
|
+
this.value = newValue;
|
|
23062
|
+
}
|
|
22804
23063
|
//#endregion WATCHERS
|
|
22805
23064
|
/****************************************************************************/
|
|
22806
23065
|
//#region METHODS
|
|
22807
23066
|
handleInputChange(e, type) {
|
|
22808
23067
|
const inputElement = e.target;
|
|
22809
23068
|
const inputValue = inputElement.value.replace(/[^0-9]/g, ''); // Only keep numeric input
|
|
23069
|
+
// Check if this field is visible for the current format
|
|
23070
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23071
|
+
if (!visibleTypes.includes(type)) {
|
|
23072
|
+
return; // Don't process input for non-visible fields
|
|
23073
|
+
}
|
|
22810
23074
|
// Update the time value based on the type
|
|
22811
23075
|
switch (type) {
|
|
22812
23076
|
case TimeType.Hours:
|
|
@@ -22819,489 +23083,230 @@ class NvFieldtime {
|
|
|
22819
23083
|
this.handleSecondsChange(inputValue, type);
|
|
22820
23084
|
break;
|
|
22821
23085
|
}
|
|
22822
|
-
// Reconstruct time from inputs
|
|
22823
|
-
const
|
|
22824
|
-
|
|
23086
|
+
// Reconstruct time from inputs in the correct format
|
|
23087
|
+
const reconstructedValue = this.reconstructTime();
|
|
23088
|
+
// Update the value, which will trigger the watcher and emit the event
|
|
23089
|
+
this.value = reconstructedValue;
|
|
22825
23090
|
}
|
|
22826
23091
|
handleHoursChange(inputValue, type) {
|
|
22827
|
-
var _a, _b
|
|
23092
|
+
var _a, _b;
|
|
22828
23093
|
const isHHFormat = this.format.startsWith('HH');
|
|
22829
23094
|
const maxHours = isHHFormat ? 24 : 12;
|
|
22830
|
-
|
|
22831
|
-
|
|
22832
|
-
|
|
22833
|
-
|
|
23095
|
+
// Handle empty input
|
|
23096
|
+
if (inputValue.length === 0) {
|
|
23097
|
+
this.hours = '00';
|
|
23098
|
+
return;
|
|
23099
|
+
}
|
|
22834
23100
|
if (inputValue.length === 1) {
|
|
22835
23101
|
this.inputZeroAdded[type] = true;
|
|
22836
23102
|
const newInputValue = inputValue.padStart(2, '0');
|
|
22837
|
-
|
|
22838
|
-
if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
|
|
22839
|
-
this.hours = minHour;
|
|
22840
|
-
}
|
|
22841
|
-
else {
|
|
22842
|
-
this.hours = '00';
|
|
22843
|
-
reputedToZero = true;
|
|
22844
|
-
}
|
|
22845
|
-
}
|
|
22846
|
-
else {
|
|
22847
|
-
if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
|
|
22848
|
-
this.hours = minHour;
|
|
22849
|
-
}
|
|
22850
|
-
else {
|
|
22851
|
-
this.hours = newInputValue;
|
|
22852
|
-
}
|
|
22853
|
-
}
|
|
23103
|
+
this.hours = newInputValue;
|
|
22854
23104
|
}
|
|
22855
23105
|
else if (this.inputZeroAdded[type]) {
|
|
22856
23106
|
this.inputZeroAdded[type] = false;
|
|
22857
23107
|
const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
|
|
22858
23108
|
const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
|
|
23109
|
+
// Only apply format validation (not min/max constraints)
|
|
22859
23110
|
if (parsedNewInputValue >= maxHours) {
|
|
22860
|
-
|
|
22861
|
-
this.hours = minHour;
|
|
22862
|
-
}
|
|
22863
|
-
else {
|
|
22864
|
-
this.hours = '00';
|
|
22865
|
-
reputedToZero = true;
|
|
22866
|
-
}
|
|
23111
|
+
this.hours = '00';
|
|
22867
23112
|
}
|
|
22868
23113
|
else {
|
|
22869
|
-
|
|
22870
|
-
if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
|
|
22871
|
-
this.hours = minHour;
|
|
22872
|
-
}
|
|
22873
|
-
else {
|
|
22874
|
-
this.hours = '00';
|
|
22875
|
-
reputedToZero = true;
|
|
22876
|
-
}
|
|
22877
|
-
}
|
|
22878
|
-
else {
|
|
22879
|
-
if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
|
|
22880
|
-
this.hours = minHour;
|
|
22881
|
-
}
|
|
22882
|
-
else {
|
|
22883
|
-
this.hours = newInputValue;
|
|
22884
|
-
}
|
|
22885
|
-
}
|
|
23114
|
+
this.hours = newInputValue;
|
|
22886
23115
|
}
|
|
22887
23116
|
}
|
|
22888
23117
|
else if (inputValue.length > 2) {
|
|
22889
23118
|
if (inputValue.startsWith('00')) {
|
|
22890
23119
|
this.inputZeroAdded[type] = true;
|
|
22891
23120
|
const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
|
|
22892
|
-
|
|
22893
|
-
if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
|
|
22894
|
-
this.hours = minHour;
|
|
22895
|
-
}
|
|
22896
|
-
else {
|
|
22897
|
-
this.hours = '00';
|
|
22898
|
-
reputedToZero = true;
|
|
22899
|
-
}
|
|
22900
|
-
}
|
|
22901
|
-
else {
|
|
22902
|
-
if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
|
|
22903
|
-
this.hours = minHour;
|
|
22904
|
-
}
|
|
22905
|
-
else {
|
|
22906
|
-
this.hours = newInputValue;
|
|
22907
|
-
}
|
|
22908
|
-
}
|
|
23121
|
+
this.hours = newInputValue;
|
|
22909
23122
|
}
|
|
22910
23123
|
else {
|
|
22911
23124
|
const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
|
|
22912
23125
|
const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
|
|
23126
|
+
// Only apply format validation (not min/max constraints)
|
|
22913
23127
|
if (parsedNewInputValue >= maxHours) {
|
|
22914
|
-
|
|
22915
|
-
this.hours = minHour;
|
|
22916
|
-
reputedToZero = true;
|
|
22917
|
-
}
|
|
22918
|
-
else {
|
|
22919
|
-
this.hours = '00';
|
|
22920
|
-
reputedToZero = true;
|
|
22921
|
-
}
|
|
23128
|
+
this.hours = '00';
|
|
22922
23129
|
}
|
|
22923
23130
|
else {
|
|
22924
|
-
|
|
22925
|
-
if (minHour &&
|
|
22926
|
-
parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
|
|
22927
|
-
this.hours = minHour;
|
|
22928
|
-
}
|
|
22929
|
-
else {
|
|
22930
|
-
this.hours = '00';
|
|
22931
|
-
reputedToZero = true;
|
|
22932
|
-
}
|
|
22933
|
-
}
|
|
22934
|
-
else {
|
|
22935
|
-
if (minHour && parsedNewInputValue < parseInt(minHour, 10)) {
|
|
22936
|
-
this.hours = minHour;
|
|
22937
|
-
}
|
|
22938
|
-
else {
|
|
22939
|
-
this.hours = parsedNewInputValue.toString();
|
|
22940
|
-
}
|
|
22941
|
-
}
|
|
23131
|
+
this.hours = parsedNewInputValue.toString();
|
|
22942
23132
|
}
|
|
22943
23133
|
}
|
|
22944
23134
|
}
|
|
22945
23135
|
else {
|
|
22946
|
-
const
|
|
22947
|
-
|
|
23136
|
+
const parsedNewInputValue = parseInt(inputValue, 10) || 0;
|
|
23137
|
+
// Only apply format validation (not min/max constraints)
|
|
22948
23138
|
if (parsedNewInputValue >= maxHours) {
|
|
22949
|
-
|
|
22950
|
-
this.hours = minHour;
|
|
22951
|
-
}
|
|
22952
|
-
else {
|
|
22953
|
-
this.hours = '00';
|
|
22954
|
-
reputedToZero = true;
|
|
22955
|
-
}
|
|
23139
|
+
this.hours = '00';
|
|
22956
23140
|
}
|
|
22957
23141
|
else {
|
|
22958
|
-
|
|
22959
|
-
|
|
22960
|
-
reputedToZero = true;
|
|
22961
|
-
}
|
|
22962
|
-
else {
|
|
22963
|
-
if (minHour && parsedNewInputValue < parseInt(minHour, 10)) {
|
|
22964
|
-
this.hours = minHour;
|
|
22965
|
-
}
|
|
22966
|
-
else {
|
|
22967
|
-
this.hours = parsedNewInputValue.toString();
|
|
22968
|
-
}
|
|
22969
|
-
}
|
|
23142
|
+
// For direct input, remove unnecessary leading zeros (e.g., '01' becomes '1')
|
|
23143
|
+
this.hours = parsedNewInputValue.toString();
|
|
22970
23144
|
}
|
|
22971
23145
|
}
|
|
22972
|
-
|
|
22973
|
-
|
|
22974
|
-
|
|
22975
|
-
|
|
22976
|
-
|
|
22977
|
-
|
|
22978
|
-
|
|
22979
|
-
|
|
22980
|
-
|
|
23146
|
+
// Auto-navigation to next field when input is complete
|
|
23147
|
+
if (this.hours.length >= 1 && !this.inputZeroAdded[type]) {
|
|
23148
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23149
|
+
const currentTypeIndex = visibleTypes.indexOf(TimeType.Hours);
|
|
23150
|
+
const nextTypeIndex = currentTypeIndex + 1;
|
|
23151
|
+
if (nextTypeIndex < visibleTypes.length) {
|
|
23152
|
+
const nextType = visibleTypes[nextTypeIndex];
|
|
23153
|
+
(_a = this.inputElements[nextType]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
23154
|
+
(_b = this.inputElements[nextType]) === null || _b === void 0 ? void 0 : _b.select();
|
|
23155
|
+
}
|
|
22981
23156
|
}
|
|
22982
23157
|
}
|
|
22983
23158
|
handleMinutesChange(inputValue, type) {
|
|
22984
|
-
var _a, _b
|
|
23159
|
+
var _a, _b;
|
|
22985
23160
|
const maxMinutes = 60;
|
|
22986
|
-
|
|
22987
|
-
|
|
22988
|
-
|
|
23161
|
+
// Handle empty input
|
|
23162
|
+
if (inputValue.length === 0) {
|
|
23163
|
+
this.minutes = '00';
|
|
23164
|
+
return;
|
|
23165
|
+
}
|
|
22989
23166
|
if (inputValue.length === 1) {
|
|
22990
23167
|
this.inputZeroAdded[type] = true;
|
|
22991
23168
|
const newInputValue = inputValue.padStart(2, '0');
|
|
22992
|
-
|
|
22993
|
-
if (minMinute && parseInt(newInputValue, 10) < minMinute) {
|
|
22994
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
22995
|
-
}
|
|
22996
|
-
else {
|
|
22997
|
-
this.minutes = '00';
|
|
22998
|
-
reputedToZero = true;
|
|
22999
|
-
}
|
|
23000
|
-
}
|
|
23001
|
-
else {
|
|
23002
|
-
if (minMinute && parseInt(newInputValue, 10) < minMinute) {
|
|
23003
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23004
|
-
}
|
|
23005
|
-
else {
|
|
23006
|
-
this.minutes = newInputValue;
|
|
23007
|
-
}
|
|
23008
|
-
}
|
|
23169
|
+
this.minutes = newInputValue;
|
|
23009
23170
|
}
|
|
23010
23171
|
else if (this.inputZeroAdded[type]) {
|
|
23011
23172
|
this.inputZeroAdded[type] = false;
|
|
23012
23173
|
const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
|
|
23013
23174
|
const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
|
|
23175
|
+
// Only apply format validation (not min/max constraints)
|
|
23014
23176
|
if (parsedNewInputValue >= maxMinutes) {
|
|
23015
|
-
|
|
23016
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23017
|
-
}
|
|
23018
|
-
else {
|
|
23019
|
-
this.minutes = '00';
|
|
23020
|
-
reputedToZero = true;
|
|
23021
|
-
}
|
|
23177
|
+
this.minutes = '00';
|
|
23022
23178
|
}
|
|
23023
23179
|
else {
|
|
23024
|
-
|
|
23025
|
-
if (minMinute && parseInt(newInputValue, 10) < minMinute) {
|
|
23026
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23027
|
-
}
|
|
23028
|
-
else {
|
|
23029
|
-
this.minutes = '00';
|
|
23030
|
-
reputedToZero = true;
|
|
23031
|
-
}
|
|
23032
|
-
}
|
|
23033
|
-
else {
|
|
23034
|
-
if (minMinute && parsedNewInputValue < minMinute) {
|
|
23035
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23036
|
-
}
|
|
23037
|
-
else {
|
|
23038
|
-
this.minutes = newInputValue;
|
|
23039
|
-
}
|
|
23040
|
-
}
|
|
23180
|
+
this.minutes = newInputValue;
|
|
23041
23181
|
}
|
|
23042
23182
|
}
|
|
23043
23183
|
else if (inputValue.length > 2) {
|
|
23044
23184
|
if (inputValue.startsWith('00')) {
|
|
23045
23185
|
this.inputZeroAdded[type] = true;
|
|
23046
23186
|
const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
|
|
23047
|
-
|
|
23048
|
-
if (minMinute && parseInt(newInputValue, 10) < minMinute) {
|
|
23049
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23050
|
-
}
|
|
23051
|
-
else {
|
|
23052
|
-
this.minutes = '00';
|
|
23053
|
-
reputedToZero = true;
|
|
23054
|
-
}
|
|
23055
|
-
}
|
|
23056
|
-
else {
|
|
23057
|
-
if (minMinute && parseInt(newInputValue, 10) < minMinute) {
|
|
23058
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23059
|
-
}
|
|
23060
|
-
else {
|
|
23061
|
-
this.minutes = newInputValue;
|
|
23062
|
-
}
|
|
23063
|
-
}
|
|
23187
|
+
this.minutes = newInputValue;
|
|
23064
23188
|
}
|
|
23065
23189
|
else {
|
|
23066
23190
|
const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
|
|
23067
23191
|
const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
|
|
23192
|
+
// Only apply format validation (not min/max constraints)
|
|
23068
23193
|
if (parsedNewInputValue >= maxMinutes) {
|
|
23069
|
-
|
|
23070
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23071
|
-
}
|
|
23072
|
-
else {
|
|
23073
|
-
this.minutes = '00';
|
|
23074
|
-
reputedToZero = true;
|
|
23075
|
-
}
|
|
23194
|
+
this.minutes = '00';
|
|
23076
23195
|
}
|
|
23077
23196
|
else {
|
|
23078
|
-
|
|
23079
|
-
if (minMinute && parseInt(newInputValue, 10) < minMinute) {
|
|
23080
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23081
|
-
}
|
|
23082
|
-
else {
|
|
23083
|
-
this.minutes = '00';
|
|
23084
|
-
reputedToZero = true;
|
|
23085
|
-
}
|
|
23086
|
-
}
|
|
23087
|
-
else {
|
|
23088
|
-
if (minMinute && parsedNewInputValue < minMinute) {
|
|
23089
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23090
|
-
}
|
|
23091
|
-
else {
|
|
23092
|
-
this.minutes = parsedNewInputValue.toString();
|
|
23093
|
-
}
|
|
23094
|
-
}
|
|
23197
|
+
this.minutes = parsedNewInputValue.toString();
|
|
23095
23198
|
}
|
|
23096
23199
|
}
|
|
23097
23200
|
}
|
|
23098
23201
|
else {
|
|
23099
|
-
const
|
|
23100
|
-
|
|
23202
|
+
const parsedNewInputValue = parseInt(inputValue, 10) || 0;
|
|
23203
|
+
// Only apply format validation (not min/max constraints)
|
|
23101
23204
|
if (parsedNewInputValue >= maxMinutes) {
|
|
23102
|
-
|
|
23103
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23104
|
-
}
|
|
23105
|
-
else {
|
|
23106
|
-
this.minutes = '00';
|
|
23107
|
-
reputedToZero = true;
|
|
23108
|
-
}
|
|
23205
|
+
this.minutes = '00';
|
|
23109
23206
|
}
|
|
23110
23207
|
else {
|
|
23111
|
-
|
|
23112
|
-
|
|
23113
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23114
|
-
}
|
|
23115
|
-
else {
|
|
23116
|
-
this.minutes = '00';
|
|
23117
|
-
reputedToZero = true;
|
|
23118
|
-
}
|
|
23119
|
-
}
|
|
23120
|
-
else {
|
|
23121
|
-
if (minMinute && parsedNewInputValue < minMinute) {
|
|
23122
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23123
|
-
}
|
|
23124
|
-
else {
|
|
23125
|
-
this.minutes = parsedNewInputValue.toString();
|
|
23126
|
-
}
|
|
23127
|
-
}
|
|
23208
|
+
// For direct input, remove unnecessary leading zeros (e.g., '01' becomes '1')
|
|
23209
|
+
this.minutes = parsedNewInputValue.toString();
|
|
23128
23210
|
}
|
|
23129
23211
|
}
|
|
23130
|
-
|
|
23131
|
-
|
|
23132
|
-
|
|
23133
|
-
|
|
23134
|
-
|
|
23135
|
-
|
|
23136
|
-
|
|
23137
|
-
|
|
23138
|
-
|
|
23212
|
+
// Auto-navigation to next field when input is complete
|
|
23213
|
+
if (this.minutes.length >= 1 && !this.inputZeroAdded[type]) {
|
|
23214
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23215
|
+
const currentTypeIndex = visibleTypes.indexOf(TimeType.Minutes);
|
|
23216
|
+
const nextTypeIndex = currentTypeIndex + 1;
|
|
23217
|
+
if (nextTypeIndex < visibleTypes.length) {
|
|
23218
|
+
const nextType = visibleTypes[nextTypeIndex];
|
|
23219
|
+
(_a = this.inputElements[nextType]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
23220
|
+
(_b = this.inputElements[nextType]) === null || _b === void 0 ? void 0 : _b.select();
|
|
23221
|
+
}
|
|
23139
23222
|
}
|
|
23140
23223
|
}
|
|
23141
23224
|
handleSecondsChange(inputValue, type) {
|
|
23142
|
-
var _a, _b, _c, _d;
|
|
23143
23225
|
const maxSeconds = 60;
|
|
23144
|
-
|
|
23145
|
-
|
|
23146
|
-
|
|
23226
|
+
// Handle empty input
|
|
23227
|
+
if (inputValue.length === 0) {
|
|
23228
|
+
this.seconds = '00';
|
|
23229
|
+
return;
|
|
23230
|
+
}
|
|
23147
23231
|
if (inputValue.length === 1) {
|
|
23148
23232
|
this.inputZeroAdded[type] = true;
|
|
23149
23233
|
const newInputValue = inputValue.padStart(2, '0');
|
|
23150
|
-
|
|
23151
|
-
if (minSecond && parseInt(newInputValue, 10) < minSecond) {
|
|
23152
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23153
|
-
}
|
|
23154
|
-
else {
|
|
23155
|
-
this.seconds = '00';
|
|
23156
|
-
reputedToZero = true;
|
|
23157
|
-
}
|
|
23158
|
-
}
|
|
23159
|
-
else {
|
|
23160
|
-
if (minSecond && parseInt(newInputValue, 10) < minSecond) {
|
|
23161
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23162
|
-
}
|
|
23163
|
-
else {
|
|
23164
|
-
this.seconds = newInputValue;
|
|
23165
|
-
}
|
|
23166
|
-
}
|
|
23234
|
+
this.seconds = newInputValue;
|
|
23167
23235
|
}
|
|
23168
23236
|
else if (this.inputZeroAdded[type]) {
|
|
23169
23237
|
this.inputZeroAdded[type] = false;
|
|
23170
23238
|
const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
|
|
23171
23239
|
const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
|
|
23240
|
+
// Only apply format validation (not min/max constraints)
|
|
23172
23241
|
if (parsedNewInputValue >= maxSeconds) {
|
|
23173
|
-
|
|
23174
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23175
|
-
}
|
|
23176
|
-
else {
|
|
23177
|
-
this.seconds = '00';
|
|
23178
|
-
reputedToZero = true;
|
|
23179
|
-
}
|
|
23242
|
+
this.seconds = '00';
|
|
23180
23243
|
}
|
|
23181
23244
|
else {
|
|
23182
|
-
|
|
23183
|
-
if (minSecond && parseInt(newInputValue, 10) < minSecond) {
|
|
23184
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23185
|
-
}
|
|
23186
|
-
else {
|
|
23187
|
-
this.seconds = '00';
|
|
23188
|
-
reputedToZero = true;
|
|
23189
|
-
}
|
|
23190
|
-
}
|
|
23191
|
-
else {
|
|
23192
|
-
if (minSecond && parsedNewInputValue < minSecond) {
|
|
23193
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23194
|
-
}
|
|
23195
|
-
else {
|
|
23196
|
-
this.seconds = newInputValue;
|
|
23197
|
-
}
|
|
23198
|
-
}
|
|
23245
|
+
this.seconds = newInputValue;
|
|
23199
23246
|
}
|
|
23200
23247
|
}
|
|
23201
23248
|
else if (inputValue.length > 2) {
|
|
23202
23249
|
const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
|
|
23203
23250
|
const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
|
|
23251
|
+
// Only apply format validation (not min/max constraints)
|
|
23204
23252
|
if (parsedNewInputValue >= maxSeconds) {
|
|
23205
|
-
|
|
23206
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23207
|
-
}
|
|
23208
|
-
else {
|
|
23209
|
-
this.seconds = '00';
|
|
23210
|
-
reputedToZero = true;
|
|
23211
|
-
}
|
|
23253
|
+
this.seconds = '00';
|
|
23212
23254
|
}
|
|
23213
23255
|
else {
|
|
23214
|
-
|
|
23215
|
-
if (minSecond && parseInt(newInputValue, 10) < minSecond) {
|
|
23216
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23217
|
-
}
|
|
23218
|
-
else {
|
|
23219
|
-
this.seconds = '00';
|
|
23220
|
-
reputedToZero = true;
|
|
23221
|
-
}
|
|
23222
|
-
}
|
|
23223
|
-
else {
|
|
23224
|
-
if (minSecond && parsedNewInputValue < minSecond) {
|
|
23225
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23226
|
-
}
|
|
23227
|
-
else {
|
|
23228
|
-
this.seconds = parsedNewInputValue.toString();
|
|
23229
|
-
}
|
|
23230
|
-
}
|
|
23256
|
+
this.seconds = parsedNewInputValue.toString();
|
|
23231
23257
|
}
|
|
23232
23258
|
}
|
|
23233
23259
|
else {
|
|
23234
|
-
const
|
|
23235
|
-
|
|
23260
|
+
const parsedNewInputValue = parseInt(inputValue, 10) || 0;
|
|
23261
|
+
// Only apply format validation (not min/max constraints)
|
|
23236
23262
|
if (parsedNewInputValue >= maxSeconds) {
|
|
23237
|
-
|
|
23238
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23239
|
-
}
|
|
23240
|
-
else {
|
|
23241
|
-
this.seconds = '00';
|
|
23242
|
-
reputedToZero = true;
|
|
23243
|
-
}
|
|
23263
|
+
this.seconds = '00';
|
|
23244
23264
|
}
|
|
23245
23265
|
else {
|
|
23246
|
-
|
|
23247
|
-
|
|
23248
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23249
|
-
}
|
|
23250
|
-
else {
|
|
23251
|
-
this.seconds = '00';
|
|
23252
|
-
reputedToZero = true;
|
|
23253
|
-
}
|
|
23254
|
-
}
|
|
23255
|
-
else {
|
|
23256
|
-
if (minSecond && parsedNewInputValue < minSecond) {
|
|
23257
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23258
|
-
}
|
|
23259
|
-
else {
|
|
23260
|
-
this.seconds = parsedNewInputValue.toString();
|
|
23261
|
-
}
|
|
23262
|
-
}
|
|
23266
|
+
// For direct input, remove unnecessary leading zeros (e.g., '01' becomes '1')
|
|
23267
|
+
this.seconds = parsedNewInputValue.toString();
|
|
23263
23268
|
}
|
|
23264
23269
|
}
|
|
23265
|
-
|
|
23266
|
-
(_c = this.inputElements[TimeType.Seconds]) === null || _c === void 0 ? void 0 : _c.focus();
|
|
23267
|
-
(_d = this.inputElements[TimeType.Seconds]) === null || _d === void 0 ? void 0 : _d.select();
|
|
23268
|
-
}
|
|
23270
|
+
// No auto-navigation for seconds field as it's typically the last field
|
|
23269
23271
|
}
|
|
23270
|
-
// Parse a
|
|
23272
|
+
// Parse a time string according to the current format
|
|
23271
23273
|
parseTime(timeString) {
|
|
23272
23274
|
if (!timeString) {
|
|
23273
23275
|
return;
|
|
23274
23276
|
}
|
|
23275
|
-
|
|
23276
|
-
const
|
|
23277
|
-
|
|
23278
|
-
|
|
23279
|
-
|
|
23280
|
-
|
|
23281
|
-
const minSecond = this.parseSecond(this.min) || second;
|
|
23282
|
-
this.hours = minHour.padStart(2, '0');
|
|
23283
|
-
this.minutes = minMinute.toString().padStart(2, '0');
|
|
23284
|
-
this.seconds = minSecond.toString().padStart(2, '0');
|
|
23277
|
+
// Use format-aware parsing without constraint application
|
|
23278
|
+
const components = parseValueByFormat(timeString, this.format);
|
|
23279
|
+
// Set the parsed values without applying min/max constraints
|
|
23280
|
+
this.hours = components.hours;
|
|
23281
|
+
this.minutes = components.minutes;
|
|
23282
|
+
this.seconds = components.seconds;
|
|
23285
23283
|
}
|
|
23286
23284
|
reconstructTime() {
|
|
23287
|
-
|
|
23288
|
-
|
|
23289
|
-
|
|
23290
|
-
|
|
23291
|
-
|
|
23292
|
-
|
|
23293
|
-
|
|
23294
|
-
|
|
23295
|
-
|
|
23296
|
-
|
|
23297
|
-
|
|
23285
|
+
const components = {
|
|
23286
|
+
hours: this.hours,
|
|
23287
|
+
minutes: this.minutes,
|
|
23288
|
+
seconds: this.seconds,
|
|
23289
|
+
};
|
|
23290
|
+
// Ensure the reconstructed time is in the correct format
|
|
23291
|
+
const reconstructedTime = reconstructTimeByFormat(components, this.format);
|
|
23292
|
+
// Validate that the reconstructed time matches the expected format
|
|
23293
|
+
if (!isValidFormatValue(reconstructedTime, this.format)) {
|
|
23294
|
+
// If invalid, return the default value for this format
|
|
23295
|
+
const config = FORMAT_CONFIGS[this.format];
|
|
23296
|
+
return config ? config.defaultValue : reconstructedTime;
|
|
23298
23297
|
}
|
|
23298
|
+
return reconstructedTime;
|
|
23299
23299
|
}
|
|
23300
23300
|
handleFocus(type) {
|
|
23301
23301
|
var _a, _b, _c, _d;
|
|
23302
23302
|
if (this.readonly || this.disabled) {
|
|
23303
23303
|
return;
|
|
23304
23304
|
}
|
|
23305
|
+
// Check if this field is visible for the current format
|
|
23306
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23307
|
+
if (!visibleTypes.includes(type)) {
|
|
23308
|
+
return; // Don't handle focus for non-visible fields
|
|
23309
|
+
}
|
|
23305
23310
|
if (!this.open) {
|
|
23306
23311
|
this.open = true; // Force the popover to open
|
|
23307
23312
|
}
|
|
@@ -23314,33 +23319,23 @@ class NvFieldtime {
|
|
|
23314
23319
|
this.typeFocused = type;
|
|
23315
23320
|
}
|
|
23316
23321
|
HandleDropdownIconClick() {
|
|
23317
|
-
var _a, _b
|
|
23322
|
+
var _a, _b;
|
|
23318
23323
|
if (this.disabled || this.readonly) {
|
|
23319
23324
|
return; // Do not toggle if disabled or read-only
|
|
23320
23325
|
}
|
|
23321
|
-
|
|
23322
|
-
|
|
23323
|
-
|
|
23324
|
-
else if (this.open && this.inputElements[TimeType.Minutes]) {
|
|
23325
|
-
this.open = false; // Close the popover if it is open
|
|
23326
|
-
}
|
|
23327
|
-
else if (this.open && this.inputElements[TimeType.Seconds]) {
|
|
23326
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23327
|
+
const firstVisibleType = visibleTypes[0];
|
|
23328
|
+
if (this.open) {
|
|
23328
23329
|
this.open = false; // Close the popover if it is open
|
|
23329
23330
|
}
|
|
23330
|
-
else if (!this.open &&
|
|
23331
|
-
|
|
23332
|
-
|
|
23333
|
-
|
|
23334
|
-
|
|
23335
|
-
(_c = this.inputElements[TimeType.Minutes]) === null || _c === void 0 ? void 0 : _c.focus(); // Focus will open the popover
|
|
23336
|
-
(_d = this.inputElements[TimeType.Minutes]) === null || _d === void 0 ? void 0 : _d.select();
|
|
23337
|
-
}
|
|
23338
|
-
else if (!this.open && this.inputElements[TimeType.Seconds]) {
|
|
23339
|
-
(_e = this.inputElements[TimeType.Seconds]) === null || _e === void 0 ? void 0 : _e.focus(); // Focus will open the popover
|
|
23340
|
-
(_f = this.inputElements[TimeType.Seconds]) === null || _f === void 0 ? void 0 : _f.select();
|
|
23331
|
+
else if (!this.open &&
|
|
23332
|
+
firstVisibleType &&
|
|
23333
|
+
this.inputElements[firstVisibleType]) {
|
|
23334
|
+
(_a = this.inputElements[firstVisibleType]) === null || _a === void 0 ? void 0 : _a.focus(); // Focus will open the popover
|
|
23335
|
+
(_b = this.inputElements[firstVisibleType]) === null || _b === void 0 ? void 0 : _b.select();
|
|
23341
23336
|
}
|
|
23342
23337
|
else {
|
|
23343
|
-
console.warn('nv-fieldtime -> No input elements found to focus
|
|
23338
|
+
console.warn('nv-fieldtime -> No visible input elements found to focus');
|
|
23344
23339
|
}
|
|
23345
23340
|
}
|
|
23346
23341
|
updateHighlightedItem(items, index) {
|
|
@@ -23359,6 +23354,8 @@ class NvFieldtime {
|
|
|
23359
23354
|
}
|
|
23360
23355
|
handleTimeOptionClick(event, type) {
|
|
23361
23356
|
const option = parseInt(event.target.textContent || '0', 10);
|
|
23357
|
+
// Update the time component directly without constraint validation
|
|
23358
|
+
// Dropdown options are already filtered by constraints during generation
|
|
23362
23359
|
if (type === TimeType.Hours) {
|
|
23363
23360
|
this.hours = option.toString().padStart(2, '0');
|
|
23364
23361
|
}
|
|
@@ -23368,8 +23365,9 @@ class NvFieldtime {
|
|
|
23368
23365
|
else if (type === TimeType.Seconds) {
|
|
23369
23366
|
this.seconds = option.toString().padStart(2, '0');
|
|
23370
23367
|
}
|
|
23371
|
-
|
|
23372
|
-
|
|
23368
|
+
// Reconstruct time in the correct format and update value
|
|
23369
|
+
const reconstructedTime = this.reconstructTime();
|
|
23370
|
+
this.value = reconstructedTime;
|
|
23373
23371
|
}
|
|
23374
23372
|
handleInputBlur() {
|
|
23375
23373
|
// Use a delay to check if the focus is still within the popover
|
|
@@ -23428,17 +23426,29 @@ class NvFieldtime {
|
|
|
23428
23426
|
}
|
|
23429
23427
|
generateHourOptions(stepInSeconds) {
|
|
23430
23428
|
const hourStep = Math.max(1, Math.floor(stepInSeconds / 3600)); // Prevent step < 1
|
|
23431
|
-
const
|
|
23432
|
-
|
|
23433
|
-
const
|
|
23434
|
-
const
|
|
23435
|
-
const
|
|
23429
|
+
const is12HourFormat = this.format.startsWith('hh');
|
|
23430
|
+
// Set proper hour ranges based on format
|
|
23431
|
+
const defaultMaxHour = is12HourFormat ? 12 : 23;
|
|
23432
|
+
const defaultMinHour = is12HourFormat ? 1 : 0;
|
|
23433
|
+
const maxHour = this.parseHour(this.max, this.format);
|
|
23434
|
+
const minHour = this.parseHour(this.min, this.format);
|
|
23435
|
+
const maxHourValue = maxHour ? parseInt(maxHour, 10) : defaultMaxHour;
|
|
23436
|
+
const minHourValue = minHour ? parseInt(minHour, 10) : defaultMinHour;
|
|
23436
23437
|
const values = [];
|
|
23437
|
-
for (let i = minHourValue; i
|
|
23438
|
-
|
|
23438
|
+
for (let i = minHourValue; i <= maxHourValue; i += hourStep) {
|
|
23439
|
+
const hourStr = i.toString().padStart(2, '0');
|
|
23440
|
+
values.push(hourStr);
|
|
23439
23441
|
}
|
|
23440
23442
|
return values;
|
|
23441
23443
|
}
|
|
23444
|
+
/**
|
|
23445
|
+
* Parse hour value from min/max constraint strings for dropdown generation only.
|
|
23446
|
+
* This method is used exclusively for filtering dropdown options and should not
|
|
23447
|
+
* affect input values or validation.
|
|
23448
|
+
* @param {string} value - The time string to parse (e.g., "14:30" or "02:30")
|
|
23449
|
+
* @param {string} format - The time format string (e.g., "HH:mm" or "hh:mm")
|
|
23450
|
+
* @returns {string} The parsed hour string or null if invalid
|
|
23451
|
+
*/
|
|
23442
23452
|
parseHour(value, format) {
|
|
23443
23453
|
if (!value)
|
|
23444
23454
|
return null;
|
|
@@ -23456,13 +23466,21 @@ class NvFieldtime {
|
|
|
23456
23466
|
const minMinute = (_a = this.parseMinute(this.min)) !== null && _a !== void 0 ? _a : 0;
|
|
23457
23467
|
const maxMinute = (_b = this.parseMinute(this.max)) !== null && _b !== void 0 ? _b : 59;
|
|
23458
23468
|
if (minMinute === 0 && maxMinute === 0)
|
|
23459
|
-
return ['00']; // Handle edge case for zero
|
|
23469
|
+
return ['00']; // Handle edge case for zero minutes
|
|
23460
23470
|
const values = [];
|
|
23461
23471
|
for (let i = minMinute; i <= maxMinute; i += minuteStep) {
|
|
23462
|
-
|
|
23472
|
+
const minuteStr = i.toString().padStart(2, '0');
|
|
23473
|
+
values.push(minuteStr);
|
|
23463
23474
|
}
|
|
23464
23475
|
return values;
|
|
23465
23476
|
}
|
|
23477
|
+
/**
|
|
23478
|
+
* Parse minute value from min/max constraint strings for dropdown generation only.
|
|
23479
|
+
* This method is used exclusively for filtering dropdown options and should not
|
|
23480
|
+
* affect input values or validation.
|
|
23481
|
+
* @param {string} value - The time string to parse (e.g., "14:30" or "02:30")
|
|
23482
|
+
* @returns {number} The parsed minute number or null if invalid
|
|
23483
|
+
*/
|
|
23466
23484
|
parseMinute(value) {
|
|
23467
23485
|
if (!value)
|
|
23468
23486
|
return null;
|
|
@@ -23481,10 +23499,18 @@ class NvFieldtime {
|
|
|
23481
23499
|
return ['00']; // Handle edge case for zero seconds
|
|
23482
23500
|
const values = [];
|
|
23483
23501
|
for (let i = minSecond; i <= maxSecond; i += secondStep) {
|
|
23484
|
-
|
|
23502
|
+
const secondStr = i.toString().padStart(2, '0');
|
|
23503
|
+
values.push(secondStr);
|
|
23485
23504
|
}
|
|
23486
23505
|
return values;
|
|
23487
23506
|
}
|
|
23507
|
+
/**
|
|
23508
|
+
* Parse second value from min/max constraint strings for dropdown generation only.
|
|
23509
|
+
* This method is used exclusively for filtering dropdown options and should not
|
|
23510
|
+
* affect input values or validation.
|
|
23511
|
+
* @param {string} value - The time string to parse (e.g., "14:30:45" or "02:30:45")
|
|
23512
|
+
* @returns {number} The parsed second number or null if invalid
|
|
23513
|
+
*/
|
|
23488
23514
|
parseSecond(value) {
|
|
23489
23515
|
if (!value)
|
|
23490
23516
|
return null;
|
|
@@ -23501,10 +23527,6 @@ class NvFieldtime {
|
|
|
23501
23527
|
const repetitions = Math.ceil(300 / totalOptions);
|
|
23502
23528
|
return Array(repetitions).fill(options).flat();
|
|
23503
23529
|
}
|
|
23504
|
-
getCurrentTime() {
|
|
23505
|
-
const currentTime = new Date();
|
|
23506
|
-
return currentTime.toLocaleTimeString(); // Returns the time in the locale's format
|
|
23507
|
-
}
|
|
23508
23530
|
updateColumnHighlight(selector, value) {
|
|
23509
23531
|
const items = Array.from(this.el.querySelectorAll(selector));
|
|
23510
23532
|
const index = items.findIndex(x => x.textContent === value);
|
|
@@ -23522,8 +23544,13 @@ class NvFieldtime {
|
|
|
23522
23544
|
}
|
|
23523
23545
|
if (!this.open) {
|
|
23524
23546
|
if (this.inputElements) {
|
|
23525
|
-
|
|
23526
|
-
|
|
23547
|
+
// Focus on the first visible field based on format
|
|
23548
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23549
|
+
const firstVisibleType = visibleTypes[0];
|
|
23550
|
+
if (firstVisibleType && this.inputElements[firstVisibleType]) {
|
|
23551
|
+
(_a = this.inputElements[firstVisibleType]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
23552
|
+
(_b = this.inputElements[firstVisibleType]) === null || _b === void 0 ? void 0 : _b.select();
|
|
23553
|
+
}
|
|
23527
23554
|
}
|
|
23528
23555
|
event.preventDefault();
|
|
23529
23556
|
}
|
|
@@ -23533,17 +23560,23 @@ class NvFieldtime {
|
|
|
23533
23560
|
//#region LIFECYCLE
|
|
23534
23561
|
componentWillLoad() {
|
|
23535
23562
|
document.addEventListener('click', this.handleClickOutside.bind(this));
|
|
23536
|
-
//
|
|
23563
|
+
// Initialize component state based on format and value
|
|
23537
23564
|
if (this.value) {
|
|
23565
|
+
// Parse the provided value using format-aware parsing without constraint application
|
|
23538
23566
|
this.parseTime(this.value);
|
|
23539
23567
|
}
|
|
23540
23568
|
else {
|
|
23541
|
-
|
|
23542
|
-
|
|
23543
|
-
const
|
|
23544
|
-
|
|
23545
|
-
this.
|
|
23546
|
-
this.
|
|
23569
|
+
// Initialize with format-appropriate default values without any constraint application
|
|
23570
|
+
// Use format-specific defaults: '01' for 12-hour formats, '00' for 24-hour formats
|
|
23571
|
+
const defaultComponents = parseValueByFormat('', this.format);
|
|
23572
|
+
// Set default values directly without any min/max constraint validation
|
|
23573
|
+
this.hours = defaultComponents.hours;
|
|
23574
|
+
this.minutes = defaultComponents.minutes;
|
|
23575
|
+
this.seconds = defaultComponents.seconds;
|
|
23576
|
+
// Set the initial value in the correct format without constraint validation
|
|
23577
|
+
// This ensures the component has a proper initial state for the value watcher
|
|
23578
|
+
const initialValue = reconstructTimeByFormat(defaultComponents, this.format);
|
|
23579
|
+
this.value = initialValue;
|
|
23547
23580
|
}
|
|
23548
23581
|
}
|
|
23549
23582
|
connectedCallback() {
|
|
@@ -23553,63 +23586,94 @@ class NvFieldtime {
|
|
|
23553
23586
|
document.removeEventListener('click', this.handleClickOutside.bind(this));
|
|
23554
23587
|
}
|
|
23555
23588
|
componentDidLoad() {
|
|
23556
|
-
|
|
23557
|
-
|
|
23558
|
-
|
|
23559
|
-
|
|
23560
|
-
|
|
23561
|
-
|
|
23562
|
-
|
|
23563
|
-
|
|
23564
|
-
|
|
23565
|
-
|
|
23566
|
-
|
|
23567
|
-
second = secondAmPm;
|
|
23568
|
-
}
|
|
23569
|
-
// Parse hour as integer for calculations
|
|
23570
|
-
let parsedHour = parseInt(hour, 10);
|
|
23571
|
-
// Convert hour to 24-hour format based on AM/PM (if present)
|
|
23572
|
-
if (amPm) {
|
|
23573
|
-
if (amPm === 'PM' && parsedHour < 12) {
|
|
23574
|
-
parsedHour += 12; // Convert PM to 24-hour
|
|
23575
|
-
}
|
|
23576
|
-
else if (amPm === 'AM' && parsedHour === 12) {
|
|
23577
|
-
parsedHour = 0; // Midnight in 24-hour format
|
|
23578
|
-
}
|
|
23579
|
-
}
|
|
23580
|
-
// Adjust for 12-hour format if necessary
|
|
23581
|
-
if (this.format.startsWith('hh')) {
|
|
23582
|
-
if (parsedHour === 0) {
|
|
23583
|
-
hour = '12'; // Midnight in 12-hour format
|
|
23584
|
-
}
|
|
23585
|
-
else if (parsedHour > 12) {
|
|
23586
|
-
hour = (parsedHour - 12).toString(); // Convert 24-hour to 12-hour
|
|
23587
|
-
}
|
|
23588
|
-
else {
|
|
23589
|
-
hour = parsedHour.toString();
|
|
23590
|
-
}
|
|
23591
|
-
}
|
|
23592
|
-
else {
|
|
23593
|
-
hour = parsedHour.toString(); // Use 24-hour format directly
|
|
23594
|
-
}
|
|
23595
|
-
// Pad hour, minute, and second to ensure two digits
|
|
23596
|
-
hour = hour.padStart(2, '0');
|
|
23597
|
-
minute = minute.padStart(2, '0');
|
|
23598
|
-
second = second.padStart(2, '0');
|
|
23599
|
-
// Update highlighted items for hours
|
|
23600
|
-
const hourSelector = `.time-column.time-column-hours div`;
|
|
23601
|
-
this.updateColumnHighlight(hourSelector, hour);
|
|
23602
|
-
// Update highlighted items for minutes
|
|
23603
|
-
const minuteSelector = `.time-column.time-column-minutes div`;
|
|
23604
|
-
this.updateColumnHighlight(minuteSelector, minute);
|
|
23605
|
-
// Update highlighted items for seconds
|
|
23606
|
-
const secondSelector = `.time-column.time-column-seconds div`;
|
|
23607
|
-
this.updateColumnHighlight(secondSelector, second);
|
|
23608
|
-
}
|
|
23589
|
+
// Initialize dropdown highlighting based on current component state
|
|
23590
|
+
// This ensures proper visual feedback without applying any constraints
|
|
23591
|
+
// Update highlighted items for hours based on current state
|
|
23592
|
+
const hourSelector = `.time-column.time-column-hours div`;
|
|
23593
|
+
this.updateColumnHighlight(hourSelector, this.hours);
|
|
23594
|
+
// Update highlighted items for minutes based on current state
|
|
23595
|
+
const minuteSelector = `.time-column.time-column-minutes div`;
|
|
23596
|
+
this.updateColumnHighlight(minuteSelector, this.minutes);
|
|
23597
|
+
// Update highlighted items for seconds based on current state
|
|
23598
|
+
const secondSelector = `.time-column.time-column-seconds div`;
|
|
23599
|
+
this.updateColumnHighlight(secondSelector, this.seconds);
|
|
23609
23600
|
}
|
|
23610
23601
|
//#endregion LIFECYCLE
|
|
23611
23602
|
/****************************************************************************/
|
|
23612
23603
|
//#region RENDER
|
|
23604
|
+
/**
|
|
23605
|
+
* Renders input fields based on the current format
|
|
23606
|
+
* Only shows fields that are relevant to the selected format
|
|
23607
|
+
* @returns {HTMLElement[]} Array of HTML elements for time input fields
|
|
23608
|
+
*/
|
|
23609
|
+
renderTimeInputFields() {
|
|
23610
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23611
|
+
const elements = [];
|
|
23612
|
+
visibleTypes.forEach((type, index) => {
|
|
23613
|
+
// Add separator colon before minutes and seconds (but not before the first field)
|
|
23614
|
+
if (index > 0) {
|
|
23615
|
+
elements.push(hAsync("span", null, ":"));
|
|
23616
|
+
}
|
|
23617
|
+
// Add the input field for this time type
|
|
23618
|
+
elements.push(this.renderTimeInputField(type));
|
|
23619
|
+
});
|
|
23620
|
+
return elements;
|
|
23621
|
+
}
|
|
23622
|
+
/**
|
|
23623
|
+
* Renders a single time input field for the specified type
|
|
23624
|
+
* @param {TimeType} type - The time type to render input for
|
|
23625
|
+
* @returns {HTMLInputElement} HTML input element for the specified time type
|
|
23626
|
+
*/
|
|
23627
|
+
renderTimeInputField(type) {
|
|
23628
|
+
const getValue = () => {
|
|
23629
|
+
switch (type) {
|
|
23630
|
+
case TimeType.Hours:
|
|
23631
|
+
return this.hours;
|
|
23632
|
+
case TimeType.Minutes:
|
|
23633
|
+
return this.minutes;
|
|
23634
|
+
case TimeType.Seconds:
|
|
23635
|
+
return this.seconds;
|
|
23636
|
+
default:
|
|
23637
|
+
return '00';
|
|
23638
|
+
}
|
|
23639
|
+
};
|
|
23640
|
+
const getPlaceholder = () => {
|
|
23641
|
+
switch (type) {
|
|
23642
|
+
case TimeType.Hours:
|
|
23643
|
+
return this.format.includes('hh') ? 'hh' : 'HH';
|
|
23644
|
+
case TimeType.Minutes:
|
|
23645
|
+
return 'mm';
|
|
23646
|
+
case TimeType.Seconds:
|
|
23647
|
+
return 'ss';
|
|
23648
|
+
default:
|
|
23649
|
+
return '';
|
|
23650
|
+
}
|
|
23651
|
+
};
|
|
23652
|
+
const getId = () => {
|
|
23653
|
+
switch (type) {
|
|
23654
|
+
case TimeType.Hours:
|
|
23655
|
+
return this.inputId;
|
|
23656
|
+
case TimeType.Minutes:
|
|
23657
|
+
return `${this.inputId}-minutes`;
|
|
23658
|
+
case TimeType.Seconds:
|
|
23659
|
+
return `${this.inputId}-seconds`;
|
|
23660
|
+
default:
|
|
23661
|
+
return this.inputId;
|
|
23662
|
+
}
|
|
23663
|
+
};
|
|
23664
|
+
// Remove min/max constraints from input elements to allow native stepper behavior
|
|
23665
|
+
// Constraints are only applied to dropdown options, not input steppers
|
|
23666
|
+
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() }));
|
|
23667
|
+
}
|
|
23668
|
+
/**
|
|
23669
|
+
* Renders dropdown columns based on the current format
|
|
23670
|
+
* Only shows columns that are relevant to the selected format
|
|
23671
|
+
* @returns {HTMLElement[]} Array of HTML elements for time dropdown columns
|
|
23672
|
+
*/
|
|
23673
|
+
renderTimeDropdownColumns() {
|
|
23674
|
+
const visibleTypes = getVisibleTimeTypes(this.format);
|
|
23675
|
+
return visibleTypes.map(type => this.RenderTimeOptionsColumn(type));
|
|
23676
|
+
}
|
|
23613
23677
|
RenderTimeOptionsColumn(type) {
|
|
23614
23678
|
return (hAsync("div", { class: `time-column time-column-${type}`, onScroll: e => this.handleScroll(e, type) }, this.generateInfiniteTimeOptions(type).map((option, index) => (hAsync("div", { class: {
|
|
23615
23679
|
'time-option': true,
|
|
@@ -23619,32 +23683,16 @@ class NvFieldtime {
|
|
|
23619
23683
|
}, key: `${option}-${index}`, onClick: e => this.handleTimeOptionClick(e, type) }, option)))));
|
|
23620
23684
|
}
|
|
23621
23685
|
render() {
|
|
23622
|
-
return (hAsync(Host, { key: '
|
|
23623
|
-
hAsync("
|
|
23624
|
-
|
|
23625
|
-
: TimeType.Hours, id: this.inputId, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
|
|
23626
|
-
], this.format.includes('mm') && [
|
|
23627
|
-
hAsync("span", { key: '74f9604ffd54e0c0bbd88996e32fdcb08f2c3645' }, ":"),
|
|
23628
|
-
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
|
|
23629
|
-
? `${TimeType.Minutes}-${this.name}`
|
|
23630
|
-
: TimeType.Minutes, id: `${this.inputId}-minutes`, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
|
|
23631
|
-
], this.format.includes('ss') && [
|
|
23632
|
-
hAsync("span", { key: '878bc9ce7557e9cf9471803a86956a9184d0ccb5' }, ":"),
|
|
23633
|
-
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
|
|
23634
|
-
? `${TimeType.Seconds}-${this.name}`
|
|
23635
|
-
: TimeType.Seconds, id: `${this.inputId}-seconds`, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
|
|
23636
|
-
], 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') &&
|
|
23637
|
-
this.RenderTimeOptionsColumn(TimeType.Hours), this.format.includes('mm') &&
|
|
23638
|
-
this.RenderTimeOptionsColumn(TimeType.Minutes), this.format.includes('ss') &&
|
|
23639
|
-
this.RenderTimeOptionsColumn(TimeType.Seconds)))), (this.description ||
|
|
23640
|
-
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: '1076ded73b32ff9afbd0f02184febcc82f8d839e', class: "description" }, hAsync("slot", { key: '479d09b299d0e380533a6cd689ce7f03aa92ea8e', name: "description" }, this.description))), (this.errorDescription ||
|
|
23641
|
-
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)))));
|
|
23686
|
+
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 ||
|
|
23687
|
+
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: '735447b328a8264739d3185ce6c65d48a01ec801', class: "description" }, hAsync("slot", { key: '86387e48804b2ac1842c64b4cf4f5ca9f34a6719', name: "description" }, this.description))), (this.errorDescription ||
|
|
23688
|
+
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)))));
|
|
23642
23689
|
}
|
|
23643
23690
|
static get formAssociated() { return true; }
|
|
23644
23691
|
get el() { return getElement(this); }
|
|
23645
23692
|
static get watchers() { return {
|
|
23646
23693
|
"value": ["handleValueChange"],
|
|
23647
|
-
"open": ["handleOpenChange"]
|
|
23694
|
+
"open": ["handleOpenChange"],
|
|
23695
|
+
"format": ["handleFormatChange"]
|
|
23648
23696
|
}; }
|
|
23649
23697
|
static get style() { return NvFieldtimeStyle0; }
|
|
23650
23698
|
static get cmpMeta() { return {
|
|
@@ -23744,7 +23792,7 @@ class NvIcon {
|
|
|
23744
23792
|
/****************************************************************************/
|
|
23745
23793
|
//#region RENDER
|
|
23746
23794
|
render() {
|
|
23747
|
-
return (hAsync(Host, { key: '
|
|
23795
|
+
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}` }))));
|
|
23748
23796
|
}
|
|
23749
23797
|
static get style() { return NvIconStyle0; }
|
|
23750
23798
|
static get cmpMeta() { return {
|
|
@@ -23888,7 +23936,7 @@ class NvIconbutton {
|
|
|
23888
23936
|
/****************************************************************************/
|
|
23889
23937
|
//#region RENDER
|
|
23890
23938
|
render() {
|
|
23891
|
-
return (hAsync(Host, { key: '
|
|
23939
|
+
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' })));
|
|
23892
23940
|
}
|
|
23893
23941
|
static get formAssociated() { return true; }
|
|
23894
23942
|
get el() { return getElement(this); }
|
|
@@ -23936,7 +23984,7 @@ class NvLoader {
|
|
|
23936
23984
|
//#region RENDER
|
|
23937
23985
|
/* <slot> empty to force rendering change */
|
|
23938
23986
|
render() {
|
|
23939
|
-
return (hAsync(Host, { key: '
|
|
23987
|
+
return (hAsync(Host, { key: '4692310e37f31424602a1592cb0648e9bf95a609', class: clsx(this.size && `size-${this.size}`, this.color && `color-${this.color}`) }));
|
|
23940
23988
|
}
|
|
23941
23989
|
static get style() { return NvLoaderStyle0; }
|
|
23942
23990
|
static get cmpMeta() { return {
|
|
@@ -24159,7 +24207,7 @@ class NvMenu {
|
|
|
24159
24207
|
});
|
|
24160
24208
|
}
|
|
24161
24209
|
render() {
|
|
24162
|
-
return (hAsync(Host, { key: '
|
|
24210
|
+
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" })))));
|
|
24163
24211
|
}
|
|
24164
24212
|
get el() { return getElement(this); }
|
|
24165
24213
|
static get watchers() { return {
|
|
@@ -24233,7 +24281,7 @@ class NvMenuitem {
|
|
|
24233
24281
|
/****************************************************************************/
|
|
24234
24282
|
//#region RENDER
|
|
24235
24283
|
render() {
|
|
24236
|
-
return (hAsync(Host, { key: '
|
|
24284
|
+
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" })));
|
|
24237
24285
|
}
|
|
24238
24286
|
get el() { return getElement(this); }
|
|
24239
24287
|
static get style() { return NvMenuitemStyle0; }
|
|
@@ -24418,7 +24466,7 @@ class NvNotification {
|
|
|
24418
24466
|
//#region RENDER
|
|
24419
24467
|
render() {
|
|
24420
24468
|
var _a, _b, _c;
|
|
24421
|
-
return (hAsync(Host, { key: '
|
|
24469
|
+
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" })))))));
|
|
24422
24470
|
}
|
|
24423
24471
|
get el() { return getElement(this); }
|
|
24424
24472
|
static get style() { return NvNotificationStyle0; }
|
|
@@ -24478,7 +24526,7 @@ class NvNotificationContainer {
|
|
|
24478
24526
|
/****************************************************************************/
|
|
24479
24527
|
//#region RENDER
|
|
24480
24528
|
render() {
|
|
24481
|
-
return (hAsync(Host, { key: '
|
|
24529
|
+
return (hAsync(Host, { key: '23a42b8ff4be4ca749656567ad5cbc64bba70466', class: `position-${this.position}` }, hAsync("slot", { key: '48a48d6b6e2580f072918192cf59e73cd3dfc1f5' })));
|
|
24482
24530
|
}
|
|
24483
24531
|
static get style() { return NvNotificationcontainerStyle0; }
|
|
24484
24532
|
static get cmpMeta() { return {
|
|
@@ -26879,7 +26927,7 @@ class NvPopover {
|
|
|
26879
26927
|
/****************************************************************************/
|
|
26880
26928
|
//#region RENDER
|
|
26881
26929
|
render() {
|
|
26882
|
-
return (hAsync(Host, { key: '
|
|
26930
|
+
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" }))));
|
|
26883
26931
|
}
|
|
26884
26932
|
get el() { return getElement(this); }
|
|
26885
26933
|
static get watchers() { return {
|
|
@@ -26926,7 +26974,7 @@ class NvRow {
|
|
|
26926
26974
|
/****************************************************************************/
|
|
26927
26975
|
//#region RENDER
|
|
26928
26976
|
render() {
|
|
26929
|
-
return (hAsync(Host, { key: '
|
|
26977
|
+
return (hAsync(Host, { key: '664375922c55485e6b297f0e64950db684ecffa3' }, hAsync("slot", { key: '194e45ce439cadb2bdba17072070d3926a746d3f' })));
|
|
26930
26978
|
}
|
|
26931
26979
|
static get style() { return NvRowStyle0; }
|
|
26932
26980
|
static get cmpMeta() { return {
|
|
@@ -27264,7 +27312,7 @@ class NvSplit {
|
|
|
27264
27312
|
/****************************************************************************/
|
|
27265
27313
|
//#region RENDER
|
|
27266
27314
|
render() {
|
|
27267
|
-
return (hAsync(Host, { key: '
|
|
27315
|
+
return (hAsync(Host, { key: 'b0874368ed8b3c1b5cd0676a1c8181e827369ad7', "data-dragging": this.isDragging.toString() }, hAsync("slot", { key: 'a0e35a851390bf1f0ffcf065fdeb23cba3c75c9c', name: "pane" }), hAsync("slot", { key: 'a80dbbc4862c3a30aac9e89d6b80a19245083c42', name: "gutter" })));
|
|
27268
27316
|
}
|
|
27269
27317
|
get el() { return getElement(this); }
|
|
27270
27318
|
static get watchers() { return {
|
|
@@ -27314,7 +27362,7 @@ class NvStack {
|
|
|
27314
27362
|
/****************************************************************************/
|
|
27315
27363
|
//#region RENDER
|
|
27316
27364
|
render() {
|
|
27317
|
-
return (hAsync(Host, { key: '
|
|
27365
|
+
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' })));
|
|
27318
27366
|
}
|
|
27319
27367
|
static get style() { return NvStackStyle0; }
|
|
27320
27368
|
static get cmpMeta() { return {
|
|
@@ -27568,7 +27616,7 @@ class NvTable {
|
|
|
27568
27616
|
/****************************************************************************/
|
|
27569
27617
|
//#region RENDER
|
|
27570
27618
|
render() {
|
|
27571
|
-
return (hAsync(Host, { key: '
|
|
27619
|
+
return (hAsync(Host, { key: '37c5e773664fc7bc324d46c003057f322e118c0d' }, hAsync("slot", { key: '28decbb3d75da3471a95d9130fdb8206df811270' })));
|
|
27572
27620
|
}
|
|
27573
27621
|
get host() { return getElement(this); }
|
|
27574
27622
|
static get style() { return NvTableStyle0; }
|
|
@@ -27646,8 +27694,8 @@ class NvToggle {
|
|
|
27646
27694
|
/****************************************************************************/
|
|
27647
27695
|
//#region RENDER
|
|
27648
27696
|
render() {
|
|
27649
|
-
return (hAsync(Host, { key: '
|
|
27650
|
-
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: '
|
|
27697
|
+
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 ||
|
|
27698
|
+
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: 'db7d0a200c66e234142b455686afdd409337b336', class: "description" }, hAsync("slot", { key: '171bb20b639a07bda52cb788fb367a51d6dbe7f8', name: "description" }, this.description))))));
|
|
27651
27699
|
}
|
|
27652
27700
|
static get formAssociated() { return true; }
|
|
27653
27701
|
get el() { return getElement(this); }
|
|
@@ -27723,7 +27771,7 @@ class NvTogglebutton {
|
|
|
27723
27771
|
/****************************************************************************/
|
|
27724
27772
|
//#region RENDER
|
|
27725
27773
|
render() {
|
|
27726
|
-
return (hAsync(Host, { key: '
|
|
27774
|
+
return (hAsync(Host, { key: '6965d7bd520347f5236cca32ca674875a9a4fd2f', role: "button", tabindex: "0", "aria-pressed": String(this.active), onClick: this.handleClick }, hAsync("slot", { key: '45ddd14b67904252c2e78b6357fbd33790facf23' })));
|
|
27727
27775
|
}
|
|
27728
27776
|
static get style() { return NvTogglebuttonStyle0; }
|
|
27729
27777
|
static get cmpMeta() { return {
|
|
@@ -27897,7 +27945,7 @@ class NvTogglebuttongroup {
|
|
|
27897
27945
|
/****************************************************************************/
|
|
27898
27946
|
//#region RENDER
|
|
27899
27947
|
render() {
|
|
27900
|
-
return (hAsync(Host, { key: '
|
|
27948
|
+
return (hAsync(Host, { key: '4e075360c060e6de5af80325f7b91e7573f89b16' }, hAsync("slot", { key: '7b361c2d608b17cb91814d279aac842e666fda5a' })));
|
|
27901
27949
|
}
|
|
27902
27950
|
get el() { return getElement(this); }
|
|
27903
27951
|
static get watchers() { return {
|
|
@@ -27968,7 +28016,7 @@ class NvTooltip {
|
|
|
27968
28016
|
/****************************************************************************/
|
|
27969
28017
|
//#region RENDER
|
|
27970
28018
|
render() {
|
|
27971
|
-
return (hAsync(Host, { key: '
|
|
28019
|
+
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" }))));
|
|
27972
28020
|
}
|
|
27973
28021
|
get el() { return getElement(this); }
|
|
27974
28022
|
static get style() { return NvTooltipStyle0; }
|