@nova-design-system/nova-webcomponents 3.17.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.
Files changed (197) hide show
  1. package/dist/cjs/index.cjs.js +21 -3
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/native.cjs.js +1 -1
  5. package/dist/cjs/nv-datagrid.cjs.entry.js +1 -1
  6. package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -1
  7. package/dist/cjs/nv-fieldtime.cjs.entry.js +556 -496
  8. package/dist/cjs/nv-fieldtime.cjs.entry.js.map +1 -1
  9. package/dist/cjs/nv-icon.cjs.entry.js +2 -2
  10. package/dist/cjs/nv-icon.cjs.entry.js.map +1 -1
  11. package/dist/cjs/nv-iconbutton_2.cjs.entry.js +2 -2
  12. package/dist/cjs/nv-menu.cjs.entry.js +1 -1
  13. package/dist/cjs/nv-menuitem.cjs.entry.js +1 -1
  14. package/dist/cjs/nv-notification.cjs.entry.js +1 -1
  15. package/dist/cjs/nv-notificationcontainer.cjs.entry.js +1 -1
  16. package/dist/cjs/nv-popover.cjs.entry.js +1 -1
  17. package/dist/cjs/nv-row.cjs.entry.js +1 -1
  18. package/dist/cjs/nv-split.cjs.entry.js +1 -1
  19. package/dist/cjs/nv-stack.cjs.entry.js +1 -1
  20. package/dist/cjs/nv-table.cjs.entry.js +1 -1
  21. package/dist/cjs/nv-toggle.cjs.entry.js +2 -2
  22. package/dist/cjs/nv-togglebutton.cjs.entry.js +1 -1
  23. package/dist/cjs/nv-togglebuttongroup.cjs.entry.js +1 -1
  24. package/dist/cjs/nv-tooltip.cjs.entry.js +1 -1
  25. package/dist/collection/components/nv-datagrid/nv-datagrid.css +4 -4
  26. package/dist/collection/components/nv-fieldtime/nv-fieldtime.docs.js +6 -0
  27. package/dist/collection/components/nv-fieldtime/nv-fieldtime.docs.js.map +1 -1
  28. package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +331 -497
  29. package/dist/collection/components/nv-fieldtime/nv-fieldtime.js.map +1 -1
  30. package/dist/collection/components/nv-fieldtime/styles/nv-fieldtime.css +1 -0
  31. package/dist/collection/components/nv-fieldtime/utils/format-utils.js +236 -0
  32. package/dist/collection/components/nv-fieldtime/utils/format-utils.js.map +1 -0
  33. package/dist/collection/components/nv-icon/nv-icon.js +1 -1
  34. package/dist/collection/components/nv-icon/nv-icons.js +1 -1
  35. package/dist/collection/components/nv-icon/nv-icons.js.map +1 -1
  36. package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +1 -1
  37. package/dist/collection/components/nv-loader/nv-loader.js +1 -1
  38. package/dist/collection/components/nv-menu/nv-menu.js +1 -1
  39. package/dist/collection/components/nv-menuitem/nv-menuitem.js +2 -2
  40. package/dist/collection/components/nv-notification/nv-notification.js +1 -1
  41. package/dist/collection/components/nv-notificationcontainer/nv-notificationcontainer.js +1 -1
  42. package/dist/collection/components/nv-popover/nv-popover.js +1 -1
  43. package/dist/collection/components/nv-row/nv-row.js +1 -1
  44. package/dist/collection/components/nv-split/nv-split.js +1 -1
  45. package/dist/collection/components/nv-stack/nv-stack.js +1 -1
  46. package/dist/collection/components/nv-table/nv-table.js +1 -1
  47. package/dist/collection/components/nv-toggle/nv-toggle.js +2 -2
  48. package/dist/collection/components/nv-togglebutton/nv-togglebutton.js +1 -1
  49. package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.js +1 -1
  50. package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
  51. package/dist/components/index.js +21 -3
  52. package/dist/components/index.js.map +1 -1
  53. package/dist/components/nv-accordion-item.js +1 -1
  54. package/dist/components/nv-accordion.js +4 -4
  55. package/dist/components/nv-alert.js +1 -1
  56. package/dist/components/nv-avatar.js +1 -1
  57. package/dist/components/nv-badge.js +1 -1
  58. package/dist/components/nv-breadcrumb.js +2 -2
  59. package/dist/components/nv-button.js +1 -1
  60. package/dist/components/nv-datagrid.js +3 -3
  61. package/dist/components/nv-datagrid.js.map +1 -1
  62. package/dist/components/nv-dialog.js +4 -4
  63. package/dist/components/nv-dialogfooter.js +1 -1
  64. package/dist/components/nv-fielddate.js +4 -4
  65. package/dist/components/nv-fielddaterange.js +4 -4
  66. package/dist/components/nv-fielddropdown.js +5 -5
  67. package/dist/components/nv-fielddropdownitem.js +1 -1
  68. package/dist/components/nv-fieldmultiselect.js +5 -5
  69. package/dist/components/nv-fieldnumber.js +1 -1
  70. package/dist/components/nv-fieldpassword.js +3 -3
  71. package/dist/components/nv-fieldselect.js +3 -3
  72. package/dist/components/nv-fieldslider.js +4 -4
  73. package/dist/components/nv-fieldtext.js +1 -1
  74. package/dist/components/nv-fieldtime.js +562 -501
  75. package/dist/components/nv-fieldtime.js.map +1 -1
  76. package/dist/components/nv-icon.js +1 -1
  77. package/dist/components/nv-iconbutton.js +1 -1
  78. package/dist/components/nv-loader.js +1 -1
  79. package/dist/components/nv-menu.js +4 -4
  80. package/dist/components/nv-menuitem.js +1 -1
  81. package/dist/components/nv-notification.js +2 -2
  82. package/dist/components/nv-notificationcontainer.js +1 -1
  83. package/dist/components/nv-popover.js +1 -1
  84. package/dist/components/nv-row.js +1 -1
  85. package/dist/components/nv-split.js +1 -1
  86. package/dist/components/nv-stack.js +1 -1
  87. package/dist/components/nv-table.js +1 -1
  88. package/dist/components/nv-toggle.js +2 -2
  89. package/dist/components/nv-togglebutton.js +1 -1
  90. package/dist/components/nv-togglebuttongroup.js +1 -1
  91. package/dist/components/nv-tooltip.js +1 -1
  92. package/dist/components/{p-31478080.js → p-015330b8.js} +2 -2
  93. package/dist/components/{p-31478080.js.map → p-015330b8.js.map} +1 -1
  94. package/dist/components/{p-7b5102c8.js → p-1bd396b1.js} +4 -4
  95. package/dist/components/{p-7b5102c8.js.map → p-1bd396b1.js.map} +1 -1
  96. package/dist/components/{p-9e7468e3.js → p-2574f8c2.js} +2 -2
  97. package/dist/components/{p-9e7468e3.js.map → p-2574f8c2.js.map} +1 -1
  98. package/dist/components/{p-f2bac2aa.js → p-4cd6f629.js} +2 -2
  99. package/dist/components/{p-f2bac2aa.js.map → p-4cd6f629.js.map} +1 -1
  100. package/dist/components/{p-2cc83e0c.js → p-5e315239.js} +2 -2
  101. package/dist/components/{p-2cc83e0c.js.map → p-5e315239.js.map} +1 -1
  102. package/dist/components/{p-7112612c.js → p-6ca3d847.js} +4 -4
  103. package/dist/components/{p-7112612c.js.map → p-6ca3d847.js.map} +1 -1
  104. package/dist/components/{p-98429fd7.js → p-c981bb48.js} +2 -2
  105. package/dist/components/{p-98429fd7.js.map → p-c981bb48.js.map} +1 -1
  106. package/dist/components/{p-0fd23531.js → p-d1b02966.js} +4 -4
  107. package/dist/components/{p-0fd23531.js.map → p-d1b02966.js.map} +1 -1
  108. package/dist/components/{p-6f2b257e.js → p-ea45f1ab.js} +3 -3
  109. package/dist/components/{p-6f2b257e.js.map → p-ea45f1ab.js.map} +1 -1
  110. package/dist/components/{p-63595ea1.js → p-ebfecbaa.js} +2 -2
  111. package/dist/components/{p-63595ea1.js.map → p-ebfecbaa.js.map} +1 -1
  112. package/dist/components/{p-47d499b4.js → p-ed43bcec.js} +3 -3
  113. package/dist/components/{p-47d499b4.js.map → p-ed43bcec.js.map} +1 -1
  114. package/dist/components/{p-378e3127.js → p-fabbaf47.js} +4 -4
  115. package/dist/components/{p-378e3127.js.map → p-fabbaf47.js.map} +1 -1
  116. package/dist/components/{p-df5d76a5.js → p-fca4d85b.js} +3 -3
  117. package/dist/components/{p-df5d76a5.js.map → p-fca4d85b.js.map} +1 -1
  118. package/dist/esm/index.js +21 -3
  119. package/dist/esm/index.js.map +1 -1
  120. package/dist/esm/loader.js +1 -1
  121. package/dist/esm/native.js +1 -1
  122. package/dist/esm/nv-datagrid.entry.js +1 -1
  123. package/dist/esm/nv-datagrid.entry.js.map +1 -1
  124. package/dist/esm/nv-fieldtime.entry.js +557 -497
  125. package/dist/esm/nv-fieldtime.entry.js.map +1 -1
  126. package/dist/esm/nv-icon.entry.js +2 -2
  127. package/dist/esm/nv-icon.entry.js.map +1 -1
  128. package/dist/esm/nv-iconbutton_2.entry.js +2 -2
  129. package/dist/esm/nv-menu.entry.js +1 -1
  130. package/dist/esm/nv-menuitem.entry.js +1 -1
  131. package/dist/esm/nv-notification.entry.js +1 -1
  132. package/dist/esm/nv-notificationcontainer.entry.js +1 -1
  133. package/dist/esm/nv-popover.entry.js +1 -1
  134. package/dist/esm/nv-row.entry.js +1 -1
  135. package/dist/esm/nv-split.entry.js +1 -1
  136. package/dist/esm/nv-stack.entry.js +1 -1
  137. package/dist/esm/nv-table.entry.js +1 -1
  138. package/dist/esm/nv-toggle.entry.js +2 -2
  139. package/dist/esm/nv-togglebutton.entry.js +1 -1
  140. package/dist/esm/nv-togglebuttongroup.entry.js +1 -1
  141. package/dist/esm/nv-tooltip.entry.js +1 -1
  142. package/dist/native/index.esm.js +1 -1
  143. package/dist/native/index.esm.js.map +1 -1
  144. package/dist/native/native.esm.js +1 -1
  145. package/dist/native/native.esm.js.map +1 -1
  146. package/dist/native/{p-f30e0be6.entry.js → p-00d1e5e1.entry.js} +2 -2
  147. package/dist/native/{p-4eaf417d.entry.js → p-122c78c3.entry.js} +2 -2
  148. package/dist/native/{p-4eaf417d.entry.js.map → p-122c78c3.entry.js.map} +1 -1
  149. package/dist/native/{p-91fab6c2.entry.js → p-14d2f70a.entry.js} +2 -2
  150. package/dist/native/{p-d94bf052.entry.js → p-3464b86a.entry.js} +2 -2
  151. package/dist/native/{p-638967bf.entry.js → p-417fba7d.entry.js} +2 -2
  152. package/dist/native/{p-52d2c0ae.entry.js → p-4e6fb719.entry.js} +2 -2
  153. package/dist/native/{p-cb0293ec.entry.js → p-539666dd.entry.js} +2 -2
  154. package/dist/native/{p-2364aefa.entry.js → p-5c678bc7.entry.js} +2 -2
  155. package/dist/native/{p-bcf41cd0.entry.js → p-5e70f9ce.entry.js} +2 -2
  156. package/dist/native/{p-278613a3.entry.js → p-5f98d4cd.entry.js} +2 -2
  157. package/dist/native/p-8c053954.entry.js +2 -0
  158. package/dist/native/p-8c053954.entry.js.map +1 -0
  159. package/dist/native/{p-2dfd786f.entry.js → p-ad029453.entry.js} +2 -2
  160. package/dist/native/{p-9d7e099f.entry.js → p-ae43eee2.entry.js} +2 -2
  161. package/dist/native/{p-26513cbd.entry.js → p-b72b5e88.entry.js} +2 -2
  162. package/dist/native/{p-26513cbd.entry.js.map → p-b72b5e88.entry.js.map} +1 -1
  163. package/dist/native/{p-ce97ce24.entry.js → p-ca39f78d.entry.js} +2 -2
  164. package/dist/native/{p-647a0765.entry.js → p-da2060a5.entry.js} +2 -2
  165. package/dist/native/{p-14e622e1.entry.js → p-e5b7ce4e.entry.js} +2 -2
  166. package/dist/types/components/nv-fieldtime/nv-fieldtime.d.ts +50 -2
  167. package/dist/types/components/nv-fieldtime/utils/format-utils.d.ts +63 -0
  168. package/dist/types/components/nv-icon/nv-icons.d.ts +1 -1
  169. package/dist/types/components.d.ts +20 -3
  170. package/dist/vscode-data.json +3 -3
  171. package/hydrate/index.js +571 -523
  172. package/hydrate/index.mjs +571 -523
  173. package/package.json +1 -1
  174. package/dist/cjs/string.utils-9c581350.js +0 -25
  175. package/dist/cjs/string.utils-9c581350.js.map +0 -1
  176. package/dist/components/p-a5c8eee9.js +0 -22
  177. package/dist/components/p-a5c8eee9.js.map +0 -1
  178. package/dist/esm/string.utils-16aed4a7.js +0 -22
  179. package/dist/esm/string.utils-16aed4a7.js.map +0 -1
  180. package/dist/native/p-a5c8eee9.js +0 -2
  181. package/dist/native/p-a5c8eee9.js.map +0 -1
  182. package/dist/native/p-ddc41f1f.entry.js +0 -2
  183. package/dist/native/p-ddc41f1f.entry.js.map +0 -1
  184. /package/dist/native/{p-f30e0be6.entry.js.map → p-00d1e5e1.entry.js.map} +0 -0
  185. /package/dist/native/{p-91fab6c2.entry.js.map → p-14d2f70a.entry.js.map} +0 -0
  186. /package/dist/native/{p-d94bf052.entry.js.map → p-3464b86a.entry.js.map} +0 -0
  187. /package/dist/native/{p-638967bf.entry.js.map → p-417fba7d.entry.js.map} +0 -0
  188. /package/dist/native/{p-52d2c0ae.entry.js.map → p-4e6fb719.entry.js.map} +0 -0
  189. /package/dist/native/{p-cb0293ec.entry.js.map → p-539666dd.entry.js.map} +0 -0
  190. /package/dist/native/{p-2364aefa.entry.js.map → p-5c678bc7.entry.js.map} +0 -0
  191. /package/dist/native/{p-bcf41cd0.entry.js.map → p-5e70f9ce.entry.js.map} +0 -0
  192. /package/dist/native/{p-278613a3.entry.js.map → p-5f98d4cd.entry.js.map} +0 -0
  193. /package/dist/native/{p-2dfd786f.entry.js.map → p-ad029453.entry.js.map} +0 -0
  194. /package/dist/native/{p-9d7e099f.entry.js.map → p-ae43eee2.entry.js.map} +0 -0
  195. /package/dist/native/{p-ce97ce24.entry.js.map → p-ca39f78d.entry.js.map} +0 -0
  196. /package/dist/native/{p-647a0765.entry.js.map → p-da2060a5.entry.js.map} +0 -0
  197. /package/dist/native/{p-14e622e1.entry.js.map → p-e5b7ce4e.entry.js.map} +0 -0
@@ -1,9 +1,12 @@
1
1
  /* eslint-disable react/jsx-no-bind */
2
- import { Host, h, } from "@stencil/core";
2
+ import { Host, h, forceUpdate, } from "@stencil/core";
3
3
  import { v4 as uuidv4 } from "uuid";
4
- import { startsWithIgnoreCase } from "../../utils/string.utils";
5
4
  import { TimeType } from "../../utils/constants";
5
+ import { parseValueByFormat, reconstructTimeByFormat, isValidFormatValue, FORMAT_CONFIGS, getVisibleTimeTypes, } from "./utils/format-utils";
6
6
  /**
7
+ * A format-aware time input component that displays only relevant input fields based on the specified format.
8
+ * The component ensures consistency between the format property and both input validation and value emission.
9
+ *
7
10
  * @slot label - Content to be placed as the label, will override the label prop.
8
11
  * @slot before-input - Content to be placed before the input text, outside the input container.
9
12
  * @slot after-input - Content to be placed after the input text, outside the input container.
@@ -66,6 +69,10 @@ export class NvFieldtime {
66
69
  * - hh: 12-hour format (01-12)
67
70
  * - hh:mm: 12-hour format with minutes (01:00-12:59)
68
71
  * - hh:mm:ss: 12-hour format with minutes and seconds (01:00:00-12:59:59)
72
+ *
73
+ * The component automatically shows only the relevant input fields based on the selected format.
74
+ * When the format changes dynamically, the component re-parses the current value and updates
75
+ * the visible fields accordingly.
69
76
  */
70
77
  this.format = 'HH:mm:ss';
71
78
  /**
@@ -94,7 +101,7 @@ export class NvFieldtime {
94
101
  this.open = event.detail;
95
102
  }
96
103
  handleKeyDown(event) {
97
- var _a, _b, _c, _d;
104
+ var _a, _b;
98
105
  if (!this.open) {
99
106
  if (event.key === 'ArrowDown') {
100
107
  this.open = true;
@@ -129,20 +136,22 @@ export class NvFieldtime {
129
136
  else if (event.key === 'Enter' && currentIndex >= 0) {
130
137
  event.preventDefault();
131
138
  items[currentIndex].click();
132
- if (this.typeFocused === TimeType.Hours) {
133
- (_a = this.inputElements[TimeType.Minutes]) === null || _a === void 0 ? void 0 : _a.focus();
134
- (_b = this.inputElements[TimeType.Minutes]) === null || _b === void 0 ? void 0 : _b.select();
135
- }
136
- else if (this.typeFocused === TimeType.Minutes ||
137
- this.typeFocused === TimeType.Seconds) {
138
- (_c = this.inputElements[TimeType.Seconds]) === null || _c === void 0 ? void 0 : _c.focus();
139
- (_d = this.inputElements[TimeType.Seconds]) === null || _d === void 0 ? void 0 : _d.select();
139
+ // Navigate to the next visible field
140
+ const visibleTypes = getVisibleTimeTypes(this.format);
141
+ const currentTypeIndex = visibleTypes.indexOf(this.typeFocused);
142
+ const nextTypeIndex = currentTypeIndex + 1;
143
+ if (nextTypeIndex < visibleTypes.length) {
144
+ const nextType = visibleTypes[nextTypeIndex];
145
+ (_a = this.inputElements[nextType]) === null || _a === void 0 ? void 0 : _a.focus();
146
+ (_b = this.inputElements[nextType]) === null || _b === void 0 ? void 0 : _b.select();
140
147
  }
141
148
  }
142
149
  else if (event.key === 'Escape') {
143
150
  event.preventDefault();
144
- if (this.inputElements[TimeType.Hours]) {
145
- this.inputElements[TimeType.Hours].blur();
151
+ const visibleTypes = getVisibleTimeTypes(this.format);
152
+ const firstVisibleType = visibleTypes[0];
153
+ if (firstVisibleType && this.inputElements[firstVisibleType]) {
154
+ this.inputElements[firstVisibleType].blur();
146
155
  }
147
156
  }
148
157
  }
@@ -150,6 +159,18 @@ export class NvFieldtime {
150
159
  /****************************************************************************/
151
160
  //#region WATCHERS
152
161
  handleValueChange(newValue) {
162
+ // Parse the new value and ensure it's in the correct format
163
+ if (newValue) {
164
+ const components = parseValueByFormat(newValue, this.format);
165
+ const formattedValue = reconstructTimeByFormat(components, this.format);
166
+ // Only emit if the formatted value is different from what we received
167
+ // This prevents infinite loops while ensuring format consistency
168
+ if (formattedValue !== newValue) {
169
+ this.value = formattedValue;
170
+ return; // The watcher will be called again with the formatted value
171
+ }
172
+ }
173
+ // Emit the value in the correct format
153
174
  this.valueChanged.emit(newValue);
154
175
  }
155
176
  handleOpenChange(newOpen) {
@@ -164,12 +185,36 @@ export class NvFieldtime {
164
185
  this.updateColumnHighlight(secondsSelector, this.seconds);
165
186
  }
166
187
  }
188
+ handleFormatChange(newFormat, oldFormat) {
189
+ if (newFormat === oldFormat) {
190
+ return; // No change, nothing to do
191
+ }
192
+ // Re-parse the current value with the new format
193
+ const currentValue = this.value || this.reconstructTime();
194
+ // Parse the current value using the old format to get the time components
195
+ const components = parseValueByFormat(currentValue, oldFormat || 'HH:mm:ss');
196
+ // Update the component state with the parsed components
197
+ this.hours = components.hours;
198
+ this.minutes = components.minutes;
199
+ this.seconds = components.seconds;
200
+ // Reconstruct the time value in the new format
201
+ const newValue = reconstructTimeByFormat(components, newFormat);
202
+ // Update the value, which will trigger the value watcher and emit the event
203
+ this.value = newValue;
204
+ // Force a re-render to update the visible input fields
205
+ forceUpdate(this.el);
206
+ }
167
207
  //#endregion WATCHERS
168
208
  /****************************************************************************/
169
209
  //#region METHODS
170
210
  handleInputChange(e, type) {
171
211
  const inputElement = e.target;
172
212
  const inputValue = inputElement.value.replace(/[^0-9]/g, ''); // Only keep numeric input
213
+ // Check if this field is visible for the current format
214
+ const visibleTypes = getVisibleTimeTypes(this.format);
215
+ if (!visibleTypes.includes(type)) {
216
+ return; // Don't process input for non-visible fields
217
+ }
173
218
  // Update the time value based on the type
174
219
  switch (type) {
175
220
  case TimeType.Hours:
@@ -182,489 +227,230 @@ export class NvFieldtime {
182
227
  this.handleSecondsChange(inputValue, type);
183
228
  break;
184
229
  }
185
- // Reconstruct time from inputs
186
- const currentValue = this.reconstructTime();
187
- this.value = currentValue;
230
+ // Reconstruct time from inputs in the correct format
231
+ const reconstructedValue = this.reconstructTime();
232
+ // Update the value, which will trigger the watcher and emit the event
233
+ this.value = reconstructedValue;
188
234
  }
189
235
  handleHoursChange(inputValue, type) {
190
- var _a, _b, _c, _d;
236
+ var _a, _b;
191
237
  const isHHFormat = this.format.startsWith('HH');
192
238
  const maxHours = isHHFormat ? 24 : 12;
193
- let reputedToZero = false;
194
- const maxHour = this.parseHour(this.max, this.format) ||
195
- (this.format.startsWith('hh') ? '12' : '24');
196
- const minHour = this.parseHour(this.min, this.format) || '00';
239
+ // Handle empty input
240
+ if (inputValue.length === 0) {
241
+ this.hours = '00';
242
+ return;
243
+ }
197
244
  if (inputValue.length === 1) {
198
245
  this.inputZeroAdded[type] = true;
199
246
  const newInputValue = inputValue.padStart(2, '0');
200
- if (maxHour && parseInt(newInputValue, 10) > parseInt(maxHour, 10)) {
201
- if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
202
- this.hours = minHour;
203
- }
204
- else {
205
- this.hours = '00';
206
- reputedToZero = true;
207
- }
208
- }
209
- else {
210
- if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
211
- this.hours = minHour;
212
- }
213
- else {
214
- this.hours = newInputValue;
215
- }
216
- }
247
+ this.hours = newInputValue;
217
248
  }
218
249
  else if (this.inputZeroAdded[type]) {
219
250
  this.inputZeroAdded[type] = false;
220
251
  const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
221
252
  const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
253
+ // Only apply format validation (not min/max constraints)
222
254
  if (parsedNewInputValue >= maxHours) {
223
- if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
224
- this.hours = minHour;
225
- }
226
- else {
227
- this.hours = '00';
228
- reputedToZero = true;
229
- }
255
+ this.hours = '00';
230
256
  }
231
257
  else {
232
- if (maxHour && parseInt(newInputValue, 10) > parseInt(maxHour, 10)) {
233
- if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
234
- this.hours = minHour;
235
- }
236
- else {
237
- this.hours = '00';
238
- reputedToZero = true;
239
- }
240
- }
241
- else {
242
- if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
243
- this.hours = minHour;
244
- }
245
- else {
246
- this.hours = newInputValue;
247
- }
248
- }
258
+ this.hours = newInputValue;
249
259
  }
250
260
  }
251
261
  else if (inputValue.length > 2) {
252
262
  if (inputValue.startsWith('00')) {
253
263
  this.inputZeroAdded[type] = true;
254
264
  const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
255
- if (maxHour && parseInt(newInputValue, 10) > parseInt(maxHour, 10)) {
256
- if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
257
- this.hours = minHour;
258
- }
259
- else {
260
- this.hours = '00';
261
- reputedToZero = true;
262
- }
263
- }
264
- else {
265
- if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
266
- this.hours = minHour;
267
- }
268
- else {
269
- this.hours = newInputValue;
270
- }
271
- }
265
+ this.hours = newInputValue;
272
266
  }
273
267
  else {
274
268
  const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
275
269
  const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
270
+ // Only apply format validation (not min/max constraints)
276
271
  if (parsedNewInputValue >= maxHours) {
277
- if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
278
- this.hours = minHour;
279
- reputedToZero = true;
280
- }
281
- else {
282
- this.hours = '00';
283
- reputedToZero = true;
284
- }
272
+ this.hours = '00';
285
273
  }
286
274
  else {
287
- if (maxHour && parsedNewInputValue > parseInt(maxHour, 10)) {
288
- if (minHour &&
289
- parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
290
- this.hours = minHour;
291
- }
292
- else {
293
- this.hours = '00';
294
- reputedToZero = true;
295
- }
296
- }
297
- else {
298
- if (minHour && parsedNewInputValue < parseInt(minHour, 10)) {
299
- this.hours = minHour;
300
- }
301
- else {
302
- this.hours = parsedNewInputValue.toString();
303
- }
304
- }
275
+ this.hours = parsedNewInputValue.toString();
305
276
  }
306
277
  }
307
278
  }
308
279
  else {
309
- const newInputValue = inputValue.padStart(2, '0');
310
- const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
280
+ const parsedNewInputValue = parseInt(inputValue, 10) || 0;
281
+ // Only apply format validation (not min/max constraints)
311
282
  if (parsedNewInputValue >= maxHours) {
312
- if (minHour && parseInt(newInputValue, 10) < parseInt(minHour, 10)) {
313
- this.hours = minHour;
314
- }
315
- else {
316
- this.hours = '00';
317
- reputedToZero = true;
318
- }
283
+ this.hours = '00';
319
284
  }
320
285
  else {
321
- if (maxHour && parsedNewInputValue > parseInt(maxHour, 10)) {
322
- this.hours = '00';
323
- reputedToZero = true;
324
- }
325
- else {
326
- if (minHour && parsedNewInputValue < parseInt(minHour, 10)) {
327
- this.hours = minHour;
328
- }
329
- else {
330
- this.hours = parsedNewInputValue.toString();
331
- }
332
- }
286
+ // For direct input, remove unnecessary leading zeros (e.g., '01' becomes '1')
287
+ this.hours = parsedNewInputValue.toString();
333
288
  }
334
289
  }
335
- if (this.hours.length === 2 &&
336
- !this.inputZeroAdded[type] &&
337
- !reputedToZero) {
338
- (_a = this.inputElements[TimeType.Minutes]) === null || _a === void 0 ? void 0 : _a.focus();
339
- (_b = this.inputElements[TimeType.Minutes]) === null || _b === void 0 ? void 0 : _b.select();
340
- }
341
- else if (reputedToZero) {
342
- (_c = this.inputElements[TimeType.Hours]) === null || _c === void 0 ? void 0 : _c.focus();
343
- (_d = this.inputElements[TimeType.Hours]) === null || _d === void 0 ? void 0 : _d.select();
290
+ // Auto-navigation to next field when input is complete
291
+ if (this.hours.length >= 1 && !this.inputZeroAdded[type]) {
292
+ const visibleTypes = getVisibleTimeTypes(this.format);
293
+ const currentTypeIndex = visibleTypes.indexOf(TimeType.Hours);
294
+ const nextTypeIndex = currentTypeIndex + 1;
295
+ if (nextTypeIndex < visibleTypes.length) {
296
+ const nextType = visibleTypes[nextTypeIndex];
297
+ (_a = this.inputElements[nextType]) === null || _a === void 0 ? void 0 : _a.focus();
298
+ (_b = this.inputElements[nextType]) === null || _b === void 0 ? void 0 : _b.select();
299
+ }
344
300
  }
345
301
  }
346
302
  handleMinutesChange(inputValue, type) {
347
- var _a, _b, _c, _d, _e, _f;
303
+ var _a, _b;
348
304
  const maxMinutes = 60;
349
- let reputedToZero = false;
350
- const minMinute = (_a = this.parseMinute(this.min)) !== null && _a !== void 0 ? _a : 0;
351
- const maxMinute = (_b = this.parseMinute(this.max)) !== null && _b !== void 0 ? _b : 59;
305
+ // Handle empty input
306
+ if (inputValue.length === 0) {
307
+ this.minutes = '00';
308
+ return;
309
+ }
352
310
  if (inputValue.length === 1) {
353
311
  this.inputZeroAdded[type] = true;
354
312
  const newInputValue = inputValue.padStart(2, '0');
355
- if (maxMinute && parseInt(newInputValue, 10) > maxMinute) {
356
- if (minMinute && parseInt(newInputValue, 10) < minMinute) {
357
- this.minutes = minMinute.toString().padStart(2, '0');
358
- }
359
- else {
360
- this.minutes = '00';
361
- reputedToZero = true;
362
- }
363
- }
364
- else {
365
- if (minMinute && parseInt(newInputValue, 10) < minMinute) {
366
- this.minutes = minMinute.toString().padStart(2, '0');
367
- }
368
- else {
369
- this.minutes = newInputValue;
370
- }
371
- }
313
+ this.minutes = newInputValue;
372
314
  }
373
315
  else if (this.inputZeroAdded[type]) {
374
316
  this.inputZeroAdded[type] = false;
375
317
  const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
376
318
  const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
319
+ // Only apply format validation (not min/max constraints)
377
320
  if (parsedNewInputValue >= maxMinutes) {
378
- if (minMinute && parseInt(newInputValue, 10) < minMinute) {
379
- this.minutes = minMinute.toString().padStart(2, '0');
380
- }
381
- else {
382
- this.minutes = '00';
383
- reputedToZero = true;
384
- }
321
+ this.minutes = '00';
385
322
  }
386
323
  else {
387
- if (maxMinute && parsedNewInputValue > maxMinute) {
388
- if (minMinute && parseInt(newInputValue, 10) < minMinute) {
389
- this.minutes = minMinute.toString().padStart(2, '0');
390
- }
391
- else {
392
- this.minutes = '00';
393
- reputedToZero = true;
394
- }
395
- }
396
- else {
397
- if (minMinute && parsedNewInputValue < minMinute) {
398
- this.minutes = minMinute.toString().padStart(2, '0');
399
- }
400
- else {
401
- this.minutes = newInputValue;
402
- }
403
- }
324
+ this.minutes = newInputValue;
404
325
  }
405
326
  }
406
327
  else if (inputValue.length > 2) {
407
328
  if (inputValue.startsWith('00')) {
408
329
  this.inputZeroAdded[type] = true;
409
330
  const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
410
- if (maxMinute && parseInt(newInputValue, 10) > maxMinute) {
411
- if (minMinute && parseInt(newInputValue, 10) < minMinute) {
412
- this.minutes = minMinute.toString().padStart(2, '0');
413
- }
414
- else {
415
- this.minutes = '00';
416
- reputedToZero = true;
417
- }
418
- }
419
- else {
420
- if (minMinute && parseInt(newInputValue, 10) < minMinute) {
421
- this.minutes = minMinute.toString().padStart(2, '0');
422
- }
423
- else {
424
- this.minutes = newInputValue;
425
- }
426
- }
331
+ this.minutes = newInputValue;
427
332
  }
428
333
  else {
429
334
  const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
430
335
  const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
336
+ // Only apply format validation (not min/max constraints)
431
337
  if (parsedNewInputValue >= maxMinutes) {
432
- if (minMinute && parseInt(newInputValue, 10) < minMinute) {
433
- this.minutes = minMinute.toString().padStart(2, '0');
434
- }
435
- else {
436
- this.minutes = '00';
437
- reputedToZero = true;
438
- }
338
+ this.minutes = '00';
439
339
  }
440
340
  else {
441
- if (maxMinute && parsedNewInputValue > maxMinute) {
442
- if (minMinute && parseInt(newInputValue, 10) < minMinute) {
443
- this.minutes = minMinute.toString().padStart(2, '0');
444
- }
445
- else {
446
- this.minutes = '00';
447
- reputedToZero = true;
448
- }
449
- }
450
- else {
451
- if (minMinute && parsedNewInputValue < minMinute) {
452
- this.minutes = minMinute.toString().padStart(2, '0');
453
- }
454
- else {
455
- this.minutes = parsedNewInputValue.toString();
456
- }
457
- }
341
+ this.minutes = parsedNewInputValue.toString();
458
342
  }
459
343
  }
460
344
  }
461
345
  else {
462
- const newInputValue = inputValue.padStart(2, '0');
463
- const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
346
+ const parsedNewInputValue = parseInt(inputValue, 10) || 0;
347
+ // Only apply format validation (not min/max constraints)
464
348
  if (parsedNewInputValue >= maxMinutes) {
465
- if (minMinute && parseInt(newInputValue, 10) < minMinute) {
466
- this.minutes = minMinute.toString().padStart(2, '0');
467
- }
468
- else {
469
- this.minutes = '00';
470
- reputedToZero = true;
471
- }
349
+ this.minutes = '00';
472
350
  }
473
351
  else {
474
- if (maxMinute && parsedNewInputValue > maxMinute) {
475
- if (minMinute && parseInt(newInputValue, 10) < minMinute) {
476
- this.minutes = minMinute.toString().padStart(2, '0');
477
- }
478
- else {
479
- this.minutes = '00';
480
- reputedToZero = true;
481
- }
482
- }
483
- else {
484
- if (minMinute && parsedNewInputValue < minMinute) {
485
- this.minutes = minMinute.toString().padStart(2, '0');
486
- }
487
- else {
488
- this.minutes = parsedNewInputValue.toString();
489
- }
490
- }
352
+ // For direct input, remove unnecessary leading zeros (e.g., '01' becomes '1')
353
+ this.minutes = parsedNewInputValue.toString();
491
354
  }
492
355
  }
493
- if (this.minutes.length === 2 &&
494
- !this.inputZeroAdded[type] &&
495
- !reputedToZero) {
496
- (_c = this.inputElements[TimeType.Seconds]) === null || _c === void 0 ? void 0 : _c.focus();
497
- (_d = this.inputElements[TimeType.Seconds]) === null || _d === void 0 ? void 0 : _d.select();
498
- }
499
- else if (reputedToZero) {
500
- (_e = this.inputElements[TimeType.Minutes]) === null || _e === void 0 ? void 0 : _e.focus();
501
- (_f = this.inputElements[TimeType.Minutes]) === null || _f === void 0 ? void 0 : _f.select();
356
+ // Auto-navigation to next field when input is complete
357
+ if (this.minutes.length >= 1 && !this.inputZeroAdded[type]) {
358
+ const visibleTypes = getVisibleTimeTypes(this.format);
359
+ const currentTypeIndex = visibleTypes.indexOf(TimeType.Minutes);
360
+ const nextTypeIndex = currentTypeIndex + 1;
361
+ if (nextTypeIndex < visibleTypes.length) {
362
+ const nextType = visibleTypes[nextTypeIndex];
363
+ (_a = this.inputElements[nextType]) === null || _a === void 0 ? void 0 : _a.focus();
364
+ (_b = this.inputElements[nextType]) === null || _b === void 0 ? void 0 : _b.select();
365
+ }
502
366
  }
503
367
  }
504
368
  handleSecondsChange(inputValue, type) {
505
- var _a, _b, _c, _d;
506
369
  const maxSeconds = 60;
507
- let reputedToZero = false;
508
- const minSecond = (_a = this.parseSecond(this.min)) !== null && _a !== void 0 ? _a : 0;
509
- const maxSecond = (_b = this.parseSecond(this.max)) !== null && _b !== void 0 ? _b : 59;
370
+ // Handle empty input
371
+ if (inputValue.length === 0) {
372
+ this.seconds = '00';
373
+ return;
374
+ }
510
375
  if (inputValue.length === 1) {
511
376
  this.inputZeroAdded[type] = true;
512
377
  const newInputValue = inputValue.padStart(2, '0');
513
- if (maxSecond && parseInt(newInputValue, 10) > maxSecond) {
514
- if (minSecond && parseInt(newInputValue, 10) < minSecond) {
515
- this.seconds = minSecond.toString().padStart(2, '0');
516
- }
517
- else {
518
- this.seconds = '00';
519
- reputedToZero = true;
520
- }
521
- }
522
- else {
523
- if (minSecond && parseInt(newInputValue, 10) < minSecond) {
524
- this.seconds = minSecond.toString().padStart(2, '0');
525
- }
526
- else {
527
- this.seconds = newInputValue;
528
- }
529
- }
378
+ this.seconds = newInputValue;
530
379
  }
531
380
  else if (this.inputZeroAdded[type]) {
532
381
  this.inputZeroAdded[type] = false;
533
382
  const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
534
383
  const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
384
+ // Only apply format validation (not min/max constraints)
535
385
  if (parsedNewInputValue >= maxSeconds) {
536
- if (minSecond && parseInt(newInputValue, 10) < minSecond) {
537
- this.seconds = minSecond.toString().padStart(2, '0');
538
- }
539
- else {
540
- this.seconds = '00';
541
- reputedToZero = true;
542
- }
386
+ this.seconds = '00';
543
387
  }
544
388
  else {
545
- if (maxSecond && parsedNewInputValue > maxSecond) {
546
- if (minSecond && parseInt(newInputValue, 10) < minSecond) {
547
- this.seconds = minSecond.toString().padStart(2, '0');
548
- }
549
- else {
550
- this.seconds = '00';
551
- reputedToZero = true;
552
- }
553
- }
554
- else {
555
- if (minSecond && parsedNewInputValue < minSecond) {
556
- this.seconds = minSecond.toString().padStart(2, '0');
557
- }
558
- else {
559
- this.seconds = newInputValue;
560
- }
561
- }
389
+ this.seconds = newInputValue;
562
390
  }
563
391
  }
564
392
  else if (inputValue.length > 2) {
565
393
  const newInputValue = inputValue.slice(1, 3).padStart(2, '0');
566
394
  const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
395
+ // Only apply format validation (not min/max constraints)
567
396
  if (parsedNewInputValue >= maxSeconds) {
568
- if (minSecond && parseInt(newInputValue, 10) < minSecond) {
569
- this.seconds = minSecond.toString().padStart(2, '0');
570
- }
571
- else {
572
- this.seconds = '00';
573
- reputedToZero = true;
574
- }
397
+ this.seconds = '00';
575
398
  }
576
399
  else {
577
- if (maxSecond && parsedNewInputValue > maxSecond) {
578
- if (minSecond && parseInt(newInputValue, 10) < minSecond) {
579
- this.seconds = minSecond.toString().padStart(2, '0');
580
- }
581
- else {
582
- this.seconds = '00';
583
- reputedToZero = true;
584
- }
585
- }
586
- else {
587
- if (minSecond && parsedNewInputValue < minSecond) {
588
- this.seconds = minSecond.toString().padStart(2, '0');
589
- }
590
- else {
591
- this.seconds = parsedNewInputValue.toString();
592
- }
593
- }
400
+ this.seconds = parsedNewInputValue.toString();
594
401
  }
595
402
  }
596
403
  else {
597
- const newInputValue = inputValue.padStart(2, '0');
598
- const parsedNewInputValue = parseInt(newInputValue, 10) || 0;
404
+ const parsedNewInputValue = parseInt(inputValue, 10) || 0;
405
+ // Only apply format validation (not min/max constraints)
599
406
  if (parsedNewInputValue >= maxSeconds) {
600
- if (minSecond && parseInt(newInputValue, 10) < minSecond) {
601
- this.seconds = minSecond.toString().padStart(2, '0');
602
- }
603
- else {
604
- this.seconds = '00';
605
- reputedToZero = true;
606
- }
407
+ this.seconds = '00';
607
408
  }
608
409
  else {
609
- if (maxSecond && parsedNewInputValue > maxSecond) {
610
- if (minSecond && parseInt(newInputValue, 10) < minSecond) {
611
- this.seconds = minSecond.toString().padStart(2, '0');
612
- }
613
- else {
614
- this.seconds = '00';
615
- reputedToZero = true;
616
- }
617
- }
618
- else {
619
- if (minSecond && parsedNewInputValue < minSecond) {
620
- this.seconds = minSecond.toString().padStart(2, '0');
621
- }
622
- else {
623
- this.seconds = parsedNewInputValue.toString();
624
- }
625
- }
410
+ // For direct input, remove unnecessary leading zeros (e.g., '01' becomes '1')
411
+ this.seconds = parsedNewInputValue.toString();
626
412
  }
627
413
  }
628
- if (reputedToZero) {
629
- (_c = this.inputElements[TimeType.Seconds]) === null || _c === void 0 ? void 0 : _c.focus();
630
- (_d = this.inputElements[TimeType.Seconds]) === null || _d === void 0 ? void 0 : _d.select();
631
- }
414
+ // No auto-navigation for seconds field as it's typically the last field
632
415
  }
633
- // Parse a continuous time string (e.g., "123456") into hours, minutes, and seconds
416
+ // Parse a time string according to the current format
634
417
  parseTime(timeString) {
635
418
  if (!timeString) {
636
419
  return;
637
420
  }
638
- const cleanedTime = timeString.replace(/[^0-9]/g, '').padStart(6, '0');
639
- const hour = cleanedTime.slice(0, 2);
640
- const minute = cleanedTime.slice(2, 4);
641
- const second = cleanedTime.slice(4, 6);
642
- const minHour = this.parseHour(this.min, this.format) || hour;
643
- const minMinute = this.parseMinute(this.min) || minute;
644
- const minSecond = this.parseSecond(this.min) || second;
645
- this.hours = minHour.padStart(2, '0');
646
- this.minutes = minMinute.toString().padStart(2, '0');
647
- this.seconds = minSecond.toString().padStart(2, '0');
421
+ // Use format-aware parsing without constraint application
422
+ const components = parseValueByFormat(timeString, this.format);
423
+ // Set the parsed values without applying min/max constraints
424
+ this.hours = components.hours;
425
+ this.minutes = components.minutes;
426
+ this.seconds = components.seconds;
648
427
  }
649
428
  reconstructTime() {
650
- if (this.format === 'HH' || this.format === 'hh') {
651
- return this.hours;
652
- }
653
- else if (this.format === 'HH:mm' || this.format === 'hh:mm') {
654
- return `${this.hours}:${this.minutes}`;
655
- }
656
- else if (this.format === 'HH:mm:ss' || this.format === 'hh:mm:ss') {
657
- return `${this.hours}:${this.minutes}:${this.seconds}`;
658
- }
659
- else {
660
- return `${this.hours}:${this.minutes}:${this.seconds}`;
429
+ const components = {
430
+ hours: this.hours,
431
+ minutes: this.minutes,
432
+ seconds: this.seconds,
433
+ };
434
+ // Ensure the reconstructed time is in the correct format
435
+ const reconstructedTime = reconstructTimeByFormat(components, this.format);
436
+ // Validate that the reconstructed time matches the expected format
437
+ if (!isValidFormatValue(reconstructedTime, this.format)) {
438
+ // If invalid, return the default value for this format
439
+ const config = FORMAT_CONFIGS[this.format];
440
+ return config ? config.defaultValue : reconstructedTime;
661
441
  }
442
+ return reconstructedTime;
662
443
  }
663
444
  handleFocus(type) {
664
445
  var _a, _b, _c, _d;
665
446
  if (this.readonly || this.disabled) {
666
447
  return;
667
448
  }
449
+ // Check if this field is visible for the current format
450
+ const visibleTypes = getVisibleTimeTypes(this.format);
451
+ if (!visibleTypes.includes(type)) {
452
+ return; // Don't handle focus for non-visible fields
453
+ }
668
454
  if (!this.open) {
669
455
  this.open = true; // Force the popover to open
670
456
  }
@@ -677,33 +463,23 @@ export class NvFieldtime {
677
463
  this.typeFocused = type;
678
464
  }
679
465
  HandleDropdownIconClick() {
680
- var _a, _b, _c, _d, _e, _f;
466
+ var _a, _b;
681
467
  if (this.disabled || this.readonly) {
682
468
  return; // Do not toggle if disabled or read-only
683
469
  }
684
- if (this.open && this.inputElements[TimeType.Hours]) {
685
- this.open = false; // Close the popover if it is open
686
- }
687
- else if (this.open && this.inputElements[TimeType.Minutes]) {
688
- this.open = false; // Close the popover if it is open
689
- }
690
- else if (this.open && this.inputElements[TimeType.Seconds]) {
470
+ const visibleTypes = getVisibleTimeTypes(this.format);
471
+ const firstVisibleType = visibleTypes[0];
472
+ if (this.open) {
691
473
  this.open = false; // Close the popover if it is open
692
474
  }
693
- else if (!this.open && this.inputElements[TimeType.Hours]) {
694
- (_a = this.inputElements[TimeType.Hours]) === null || _a === void 0 ? void 0 : _a.focus(); // Focus will open the popover
695
- (_b = this.inputElements[TimeType.Hours]) === null || _b === void 0 ? void 0 : _b.select();
696
- }
697
- else if (!this.open && this.inputElements[TimeType.Minutes]) {
698
- (_c = this.inputElements[TimeType.Minutes]) === null || _c === void 0 ? void 0 : _c.focus(); // Focus will open the popover
699
- (_d = this.inputElements[TimeType.Minutes]) === null || _d === void 0 ? void 0 : _d.select();
700
- }
701
- else if (!this.open && this.inputElements[TimeType.Seconds]) {
702
- (_e = this.inputElements[TimeType.Seconds]) === null || _e === void 0 ? void 0 : _e.focus(); // Focus will open the popover
703
- (_f = this.inputElements[TimeType.Seconds]) === null || _f === void 0 ? void 0 : _f.select();
475
+ else if (!this.open &&
476
+ firstVisibleType &&
477
+ this.inputElements[firstVisibleType]) {
478
+ (_a = this.inputElements[firstVisibleType]) === null || _a === void 0 ? void 0 : _a.focus(); // Focus will open the popover
479
+ (_b = this.inputElements[firstVisibleType]) === null || _b === void 0 ? void 0 : _b.select();
704
480
  }
705
481
  else {
706
- console.warn('nv-fieldtime -> No input elements found to focus or to blur');
482
+ console.warn('nv-fieldtime -> No visible input elements found to focus');
707
483
  }
708
484
  }
709
485
  updateHighlightedItem(items, index) {
@@ -722,6 +498,8 @@ export class NvFieldtime {
722
498
  }
723
499
  handleTimeOptionClick(event, type) {
724
500
  const option = parseInt(event.target.textContent || '0', 10);
501
+ // Update the time component directly without constraint validation
502
+ // Dropdown options are already filtered by constraints during generation
725
503
  if (type === TimeType.Hours) {
726
504
  this.hours = option.toString().padStart(2, '0');
727
505
  }
@@ -731,8 +509,9 @@ export class NvFieldtime {
731
509
  else if (type === TimeType.Seconds) {
732
510
  this.seconds = option.toString().padStart(2, '0');
733
511
  }
734
- const reconstructTime = this.reconstructTime();
735
- this.value = reconstructTime;
512
+ // Reconstruct time in the correct format and update value
513
+ const reconstructedTime = this.reconstructTime();
514
+ this.value = reconstructedTime;
736
515
  }
737
516
  handleInputBlur() {
738
517
  // Use a delay to check if the focus is still within the popover
@@ -791,17 +570,29 @@ export class NvFieldtime {
791
570
  }
792
571
  generateHourOptions(stepInSeconds) {
793
572
  const hourStep = Math.max(1, Math.floor(stepInSeconds / 3600)); // Prevent step < 1
794
- const maxHour = this.parseHour(this.max, this.format) ||
795
- (this.format.startsWith('hh') ? '12' : '24');
796
- const minHour = this.parseHour(this.min, this.format) || '00';
797
- const maxHourValue = parseInt(maxHour, 10);
798
- const minHourValue = parseInt(minHour, 10);
573
+ const is12HourFormat = this.format.startsWith('hh');
574
+ // Set proper hour ranges based on format
575
+ const defaultMaxHour = is12HourFormat ? 12 : 23;
576
+ const defaultMinHour = is12HourFormat ? 1 : 0;
577
+ const maxHour = this.parseHour(this.max, this.format);
578
+ const minHour = this.parseHour(this.min, this.format);
579
+ const maxHourValue = maxHour ? parseInt(maxHour, 10) : defaultMaxHour;
580
+ const minHourValue = minHour ? parseInt(minHour, 10) : defaultMinHour;
799
581
  const values = [];
800
- for (let i = minHourValue; i < maxHourValue; i += hourStep) {
801
- values.push(i.toString().padStart(2, '0'));
582
+ for (let i = minHourValue; i <= maxHourValue; i += hourStep) {
583
+ const hourStr = i.toString().padStart(2, '0');
584
+ values.push(hourStr);
802
585
  }
803
586
  return values;
804
587
  }
588
+ /**
589
+ * Parse hour value from min/max constraint strings for dropdown generation only.
590
+ * This method is used exclusively for filtering dropdown options and should not
591
+ * affect input values or validation.
592
+ * @param {string} value - The time string to parse (e.g., "14:30" or "02:30")
593
+ * @param {string} format - The time format string (e.g., "HH:mm" or "hh:mm")
594
+ * @returns {string} The parsed hour string or null if invalid
595
+ */
805
596
  parseHour(value, format) {
806
597
  if (!value)
807
598
  return null;
@@ -819,13 +610,21 @@ export class NvFieldtime {
819
610
  const minMinute = (_a = this.parseMinute(this.min)) !== null && _a !== void 0 ? _a : 0;
820
611
  const maxMinute = (_b = this.parseMinute(this.max)) !== null && _b !== void 0 ? _b : 59;
821
612
  if (minMinute === 0 && maxMinute === 0)
822
- return ['00']; // Handle edge case for zero seconds
613
+ return ['00']; // Handle edge case for zero minutes
823
614
  const values = [];
824
615
  for (let i = minMinute; i <= maxMinute; i += minuteStep) {
825
- values.push(i.toString().padStart(2, '0'));
616
+ const minuteStr = i.toString().padStart(2, '0');
617
+ values.push(minuteStr);
826
618
  }
827
619
  return values;
828
620
  }
621
+ /**
622
+ * Parse minute value from min/max constraint strings for dropdown generation only.
623
+ * This method is used exclusively for filtering dropdown options and should not
624
+ * affect input values or validation.
625
+ * @param {string} value - The time string to parse (e.g., "14:30" or "02:30")
626
+ * @returns {number} The parsed minute number or null if invalid
627
+ */
829
628
  parseMinute(value) {
830
629
  if (!value)
831
630
  return null;
@@ -844,10 +643,18 @@ export class NvFieldtime {
844
643
  return ['00']; // Handle edge case for zero seconds
845
644
  const values = [];
846
645
  for (let i = minSecond; i <= maxSecond; i += secondStep) {
847
- values.push(i.toString().padStart(2, '0'));
646
+ const secondStr = i.toString().padStart(2, '0');
647
+ values.push(secondStr);
848
648
  }
849
649
  return values;
850
650
  }
651
+ /**
652
+ * Parse second value from min/max constraint strings for dropdown generation only.
653
+ * This method is used exclusively for filtering dropdown options and should not
654
+ * affect input values or validation.
655
+ * @param {string} value - The time string to parse (e.g., "14:30:45" or "02:30:45")
656
+ * @returns {number} The parsed second number or null if invalid
657
+ */
851
658
  parseSecond(value) {
852
659
  if (!value)
853
660
  return null;
@@ -864,10 +671,6 @@ export class NvFieldtime {
864
671
  const repetitions = Math.ceil(300 / totalOptions);
865
672
  return Array(repetitions).fill(options).flat();
866
673
  }
867
- getCurrentTime() {
868
- const currentTime = new Date();
869
- return currentTime.toLocaleTimeString(); // Returns the time in the locale's format
870
- }
871
674
  updateColumnHighlight(selector, value) {
872
675
  const items = Array.from(this.el.querySelectorAll(selector));
873
676
  const index = items.findIndex(x => x.textContent === value);
@@ -885,8 +688,13 @@ export class NvFieldtime {
885
688
  }
886
689
  if (!this.open) {
887
690
  if (this.inputElements) {
888
- (_a = this.inputElements[TimeType.Hours]) === null || _a === void 0 ? void 0 : _a.focus();
889
- (_b = this.inputElements[TimeType.Hours]) === null || _b === void 0 ? void 0 : _b.select();
691
+ // Focus on the first visible field based on format
692
+ const visibleTypes = getVisibleTimeTypes(this.format);
693
+ const firstVisibleType = visibleTypes[0];
694
+ if (firstVisibleType && this.inputElements[firstVisibleType]) {
695
+ (_a = this.inputElements[firstVisibleType]) === null || _a === void 0 ? void 0 : _a.focus();
696
+ (_b = this.inputElements[firstVisibleType]) === null || _b === void 0 ? void 0 : _b.select();
697
+ }
890
698
  }
891
699
  event.preventDefault();
892
700
  }
@@ -896,17 +704,23 @@ export class NvFieldtime {
896
704
  //#region LIFECYCLE
897
705
  componentWillLoad() {
898
706
  document.addEventListener('click', this.handleClickOutside.bind(this));
899
- // If an initial value is passed, parse it
707
+ // Initialize component state based on format and value
900
708
  if (this.value) {
709
+ // Parse the provided value using format-aware parsing without constraint application
901
710
  this.parseTime(this.value);
902
711
  }
903
712
  else {
904
- const minHour = this.parseHour(this.min, this.format) || '00';
905
- const minMinute = this.parseMinute(this.min) || 0;
906
- const minSecond = this.parseSecond(this.min) || 0;
907
- this.hours = minHour.padStart(2, '0');
908
- this.minutes = minMinute.toString().padStart(2, '0');
909
- this.seconds = minSecond.toString().padStart(2, '0');
713
+ // Initialize with format-appropriate default values without any constraint application
714
+ // Use format-specific defaults: '01' for 12-hour formats, '00' for 24-hour formats
715
+ const defaultComponents = parseValueByFormat('', this.format);
716
+ // Set default values directly without any min/max constraint validation
717
+ this.hours = defaultComponents.hours;
718
+ this.minutes = defaultComponents.minutes;
719
+ this.seconds = defaultComponents.seconds;
720
+ // Set the initial value in the correct format without constraint validation
721
+ // This ensures the component has a proper initial state for the value watcher
722
+ const initialValue = reconstructTimeByFormat(defaultComponents, this.format);
723
+ this.value = initialValue;
910
724
  }
911
725
  }
912
726
  connectedCallback() {
@@ -916,63 +730,94 @@ export class NvFieldtime {
916
730
  document.removeEventListener('click', this.handleClickOutside.bind(this));
917
731
  }
918
732
  componentDidLoad() {
919
- if (!this.value) {
920
- const currentTime = this.getCurrentTime();
921
- // Split time into components
922
- // eslint-disable-next-line prefer-const
923
- let [hour, minute, secondAmPm] = currentTime.split(':');
924
- let second, amPm;
925
- // Check if AM/PM is present and split accordingly
926
- if (secondAmPm.includes(' ')) {
927
- [second, amPm] = secondAmPm.split(' ');
928
- }
929
- else {
930
- second = secondAmPm;
733
+ // Initialize dropdown highlighting based on current component state
734
+ // This ensures proper visual feedback without applying any constraints
735
+ // Update highlighted items for hours based on current state
736
+ const hourSelector = `.time-column.time-column-hours div`;
737
+ this.updateColumnHighlight(hourSelector, this.hours);
738
+ // Update highlighted items for minutes based on current state
739
+ const minuteSelector = `.time-column.time-column-minutes div`;
740
+ this.updateColumnHighlight(minuteSelector, this.minutes);
741
+ // Update highlighted items for seconds based on current state
742
+ const secondSelector = `.time-column.time-column-seconds div`;
743
+ this.updateColumnHighlight(secondSelector, this.seconds);
744
+ }
745
+ //#endregion LIFECYCLE
746
+ /****************************************************************************/
747
+ //#region RENDER
748
+ /**
749
+ * Renders input fields based on the current format
750
+ * Only shows fields that are relevant to the selected format
751
+ * @returns {HTMLElement[]} Array of HTML elements for time input fields
752
+ */
753
+ renderTimeInputFields() {
754
+ const visibleTypes = getVisibleTimeTypes(this.format);
755
+ const elements = [];
756
+ visibleTypes.forEach((type, index) => {
757
+ // Add separator colon before minutes and seconds (but not before the first field)
758
+ if (index > 0) {
759
+ elements.push(h("span", null, ":"));
931
760
  }
932
- // Parse hour as integer for calculations
933
- let parsedHour = parseInt(hour, 10);
934
- // Convert hour to 24-hour format based on AM/PM (if present)
935
- if (amPm) {
936
- if (amPm === 'PM' && parsedHour < 12) {
937
- parsedHour += 12; // Convert PM to 24-hour
938
- }
939
- else if (amPm === 'AM' && parsedHour === 12) {
940
- parsedHour = 0; // Midnight in 24-hour format
941
- }
761
+ // Add the input field for this time type
762
+ elements.push(this.renderTimeInputField(type));
763
+ });
764
+ return elements;
765
+ }
766
+ /**
767
+ * Renders a single time input field for the specified type
768
+ * @param {TimeType} type - The time type to render input for
769
+ * @returns {HTMLInputElement} HTML input element for the specified time type
770
+ */
771
+ renderTimeInputField(type) {
772
+ const getValue = () => {
773
+ switch (type) {
774
+ case TimeType.Hours:
775
+ return this.hours;
776
+ case TimeType.Minutes:
777
+ return this.minutes;
778
+ case TimeType.Seconds:
779
+ return this.seconds;
780
+ default:
781
+ return '00';
942
782
  }
943
- // Adjust for 12-hour format if necessary
944
- if (this.format.startsWith('hh')) {
945
- if (parsedHour === 0) {
946
- hour = '12'; // Midnight in 12-hour format
947
- }
948
- else if (parsedHour > 12) {
949
- hour = (parsedHour - 12).toString(); // Convert 24-hour to 12-hour
950
- }
951
- else {
952
- hour = parsedHour.toString();
953
- }
783
+ };
784
+ const getPlaceholder = () => {
785
+ switch (type) {
786
+ case TimeType.Hours:
787
+ return this.format.includes('hh') ? 'hh' : 'HH';
788
+ case TimeType.Minutes:
789
+ return 'mm';
790
+ case TimeType.Seconds:
791
+ return 'ss';
792
+ default:
793
+ return '';
954
794
  }
955
- else {
956
- hour = parsedHour.toString(); // Use 24-hour format directly
795
+ };
796
+ const getId = () => {
797
+ switch (type) {
798
+ case TimeType.Hours:
799
+ return this.inputId;
800
+ case TimeType.Minutes:
801
+ return `${this.inputId}-minutes`;
802
+ case TimeType.Seconds:
803
+ return `${this.inputId}-seconds`;
804
+ default:
805
+ return this.inputId;
957
806
  }
958
- // Pad hour, minute, and second to ensure two digits
959
- hour = hour.padStart(2, '0');
960
- minute = minute.padStart(2, '0');
961
- second = second.padStart(2, '0');
962
- // Update highlighted items for hours
963
- const hourSelector = `.time-column.time-column-hours div`;
964
- this.updateColumnHighlight(hourSelector, hour);
965
- // Update highlighted items for minutes
966
- const minuteSelector = `.time-column.time-column-minutes div`;
967
- this.updateColumnHighlight(minuteSelector, minute);
968
- // Update highlighted items for seconds
969
- const secondSelector = `.time-column.time-column-seconds div`;
970
- this.updateColumnHighlight(secondSelector, second);
971
- }
807
+ };
808
+ // Remove min/max constraints from input elements to allow native stepper behavior
809
+ // Constraints are only applied to dropdown options, not input steppers
810
+ return (h("input", { ref: el => (this.inputElements[type] = el), type: "number", autofocus: this.autofocus && type === getVisibleTimeTypes(this.format)[0], class: "time-input", pattern: "[0-9]*", maxlength: "3", value: getValue(), onInput: e => this.handleInputChange(e, type), placeholder: getPlaceholder(), inputMode: "numeric", onFocus: () => this.handleFocus(type), name: this.name ? `${type}-${this.name}` : type, id: getId(), readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }));
811
+ }
812
+ /**
813
+ * Renders dropdown columns based on the current format
814
+ * Only shows columns that are relevant to the selected format
815
+ * @returns {HTMLElement[]} Array of HTML elements for time dropdown columns
816
+ */
817
+ renderTimeDropdownColumns() {
818
+ const visibleTypes = getVisibleTimeTypes(this.format);
819
+ return visibleTypes.map(type => this.RenderTimeOptionsColumn(type));
972
820
  }
973
- //#endregion LIFECYCLE
974
- /****************************************************************************/
975
- //#region RENDER
976
821
  RenderTimeOptionsColumn(type) {
977
822
  return (h("div", { class: `time-column time-column-${type}`, onScroll: e => this.handleScroll(e, type) }, this.generateInfiniteTimeOptions(type).map((option, index) => (h("div", { class: {
978
823
  'time-option': true,
@@ -982,26 +827,9 @@ export class NvFieldtime {
982
827
  }, key: `${option}-${index}`, onClick: e => this.handleTimeOptionClick(e, type) }, option)))));
983
828
  }
984
829
  render() {
985
- return (h(Host, { key: 'ef5f12cdbd62c18033f57ff176775b5ee62ebb85', onclick: e => this.handleHostClick(e) }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: '64e20904debf287e69e5717f2d28ac4a700b7f15', htmlFor: this.inputId }, h("slot", { key: 'e0644a80e23854ca06baf8b52b00649a0e6f1ed9', name: "label" }, this.label))), h("nv-popover", { key: '98d71eeb73ce93c16c488e80f79bbe269a44ddc3', ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, h("div", { key: '9a7d256f3c64aed3314338c8306540d92dddaad0', class: "input-wrapper", slot: "trigger" }, h("slot", { key: 'ac0e04737b86e4767e4c249ee95e4b69a41ea387', name: "before-input" }), h("div", { key: '1f04ff2f539048eb00500b2fbbeaf86ce1698065', class: "input-container" }, h("slot", { key: '60ee3a49ea9ca9509224c57dc64f3ccab7f89312', name: "leading-input" }), startsWithIgnoreCase(this.format, 'HH') && [
986
- h("input", { key: 'cb8a979ce6e4d83074e0c9046bbf3a60821e5262', ref: el => (this.inputElements[TimeType.Hours] = el), type: "number", autofocus: this.autofocus, class: "time-input", pattern: "[0-9]*", maxlength: "3", value: this.hours, onInput: e => this.handleInputChange(e, TimeType.Hours), placeholder: this.format.includes('hh') ? 'hh' : 'HH', inputMode: "numeric", onFocus: () => this.handleFocus(TimeType.Hours), name: this.name
987
- ? `${TimeType.Hours}-${this.name}`
988
- : TimeType.Hours, id: this.inputId, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
989
- ], this.format.includes('mm') && [
990
- h("span", { key: '74f9604ffd54e0c0bbd88996e32fdcb08f2c3645' }, ":"),
991
- h("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
992
- ? `${TimeType.Minutes}-${this.name}`
993
- : TimeType.Minutes, id: `${this.inputId}-minutes`, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
994
- ], this.format.includes('ss') && [
995
- h("span", { key: '878bc9ce7557e9cf9471803a86956a9184d0ccb5' }, ":"),
996
- h("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
997
- ? `${TimeType.Seconds}-${this.name}`
998
- : TimeType.Seconds, id: `${this.inputId}-seconds`, readonly: this.readonly, disabled: this.disabled, required: this.required, onKeyDown: e => this.handleKeyDown(e), onBlur: () => this.handleInputBlur() }),
999
- ], h("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 && (h("nv-icon", { key: '4b2356cf95131af213a4e98feede16fc8c4963db', name: "alert-circle", class: "validation", size: "sm" })), this.success && (h("nv-icon", { key: 'f9b0e61037049a36ac900d1af9ecc71b211ebd88', name: "circle-check", class: "validation", size: "sm" }))), h("slot", { key: '6177abde559c57f2b0586368ead1a61d7b543838', name: "after-input" })), h("div", { key: 'f6d5205a5011411550179f9337143163cb547fb1', class: "time-dropdown", slot: "content" }, h("div", { key: '9f0b3e1423bef197b269c5b11ce744cabc2bd6c4', class: "time-columns" }, startsWithIgnoreCase(this.format, 'HH') &&
1000
- this.RenderTimeOptionsColumn(TimeType.Hours), this.format.includes('mm') &&
1001
- this.RenderTimeOptionsColumn(TimeType.Minutes), this.format.includes('ss') &&
1002
- this.RenderTimeOptionsColumn(TimeType.Seconds)))), (this.description ||
1003
- this.el.querySelector('[slot="description"]')) && (h("div", { key: '1076ded73b32ff9afbd0f02184febcc82f8d839e', class: "description" }, h("slot", { key: '479d09b299d0e380533a6cd689ce7f03aa92ea8e', name: "description" }, this.description))), (this.errorDescription ||
1004
- this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '5615246dbd797c300be357be37d3b9d0aee56e31', hidden: !this.error, class: "error-description" }, h("slot", { key: '6568ea3f9e0bdf85dd280c645956f8e0bb592e35', name: "error-description" }, this.errorDescription)))));
830
+ return (h(Host, { key: '315b0a732c1ef8bee7aaa0141ce533ec265e35ab', onclick: (e) => this.handleHostClick(e), "aria-expanded": this.open ? 'true' : 'false' }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: '100b75accd50c277e3ddd13c007e55dad8c6f8b7', htmlFor: this.inputId }, h("slot", { key: 'cec67688f98fc7976299a2f55ba8ba859e4ecacc', name: "label" }, this.label))), h("nv-popover", { key: 'feaaefb107251368db809babb02b8f8c7cb7baf0', ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, h("div", { key: 'c539917597eebdd92bb2e832d1fd9d6afceb5c04', class: "input-wrapper", slot: "trigger" }, h("slot", { key: '5a869349e9fd7a422d596f5bd05402d5559a6f2b', name: "before-input" }), h("div", { key: '27dac6987b28d08bb54b9ffc70ddade28f527a9c', class: "input-container" }, h("slot", { key: '9df638bb3d58df138a360966925b04092f1d4b9a', name: "leading-input" }), this.renderTimeInputFields(), h("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 && (h("nv-icon", { key: '15b593ce4e850d18a5f5f93120ae84e84054cffe', name: "alert-circle", class: "validation", size: "sm" })), this.success && (h("nv-icon", { key: '85e4a38c3ef64552fc7a47448471d4276ee5cc46', name: "circle-check", class: "validation", size: "sm" }))), h("slot", { key: '45cc1c26bc40425df62382a371ab658dd18aefa8', name: "after-input" })), h("div", { key: '23432dd354491420e42400d9eeb22bc23e36623e', class: "time-dropdown", slot: "content" }, h("div", { key: 'efb53556077c85ee94a8fe345a03d67a3e36cdc1', class: "time-columns" }, this.renderTimeDropdownColumns()))), (this.description ||
831
+ this.el.querySelector('[slot="description"]')) && (h("div", { key: '735447b328a8264739d3185ce6c65d48a01ec801', class: "description" }, h("slot", { key: '86387e48804b2ac1842c64b4cf4f5ca9f34a6719', name: "description" }, this.description))), (this.errorDescription ||
832
+ this.el.querySelector('[slot="error-description"]')) && (h("div", { key: 'b6cc406c6a872b5ebb83a35a84852e143781e12f', hidden: !this.error, class: "error-description" }, h("slot", { key: 'c9dc284e202b081a61346796d21e73c8647c7daa', name: "error-description" }, this.errorDescription)))));
1005
833
  }
1006
834
  static get is() { return "nv-fieldtime"; }
1007
835
  static get formAssociated() { return true; }
@@ -1231,7 +1059,7 @@ export class NvFieldtime {
1231
1059
  "optional": false,
1232
1060
  "docs": {
1233
1061
  "tags": [],
1234
- "text": "Specifies the time format to be used.\nAvailable formats:\n- HH: 24-hour format (00-23)\n- HH:mm: 24-hour format with minutes (00:00-23:59)\n- HH:mm:ss: 24-hour format with minutes and seconds (00:00:00-23:59:59)\n- hh: 12-hour format (01-12)\n- hh:mm: 12-hour format with minutes (01:00-12:59)\n- hh:mm:ss: 12-hour format with minutes and seconds (01:00:00-12:59:59)"
1062
+ "text": "Specifies the time format to be used.\nAvailable formats:\n- HH: 24-hour format (00-23)\n- HH:mm: 24-hour format with minutes (00:00-23:59)\n- HH:mm:ss: 24-hour format with minutes and seconds (00:00:00-23:59:59)\n- hh: 12-hour format (01-12)\n- hh:mm: 12-hour format with minutes (01:00-12:59)\n- hh:mm:ss: 12-hour format with minutes and seconds (01:00:00-12:59:59)\n\nThe component automatically shows only the relevant input fields based on the selected format.\nWhen the format changes dynamically, the component re-parses the current value and updates\nthe visible fields accordingly."
1235
1063
  },
1236
1064
  "getter": false,
1237
1065
  "setter": false,
@@ -1373,8 +1201,11 @@ export class NvFieldtime {
1373
1201
  "cancelable": true,
1374
1202
  "composed": true,
1375
1203
  "docs": {
1376
- "tags": [],
1377
- "text": "Emit an event when the time value changes.\nThe event detail contains the new time value (HH, HH:mm or HH:mm:ss)."
1204
+ "tags": [{
1205
+ "name": "bind",
1206
+ "text": "value"
1207
+ }],
1208
+ "text": "Emit an event when the time value changes.\nThe event detail contains the new time value in the format specified by the format property."
1378
1209
  },
1379
1210
  "complexType": {
1380
1211
  "original": "string",
@@ -1391,6 +1222,9 @@ export class NvFieldtime {
1391
1222
  }, {
1392
1223
  "propName": "open",
1393
1224
  "methodName": "handleOpenChange"
1225
+ }, {
1226
+ "propName": "format",
1227
+ "methodName": "handleFormatChange"
1394
1228
  }];
1395
1229
  }
1396
1230
  static get listeners() {