@editora/ui-core 0.1.18 → 0.1.20

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 (307) hide show
  1. package/dist/{ElementBase-1b301e7f.js → ElementBase-EV6mVBUV.js} +1 -1
  2. package/dist/{ElementBase-909688f3.mjs → ElementBase-YlTLMsGk.mjs} +3 -3
  3. package/dist/accordion.cjs.js +3 -3
  4. package/dist/accordion.esm.js +39 -62
  5. package/dist/alert-dialog.cjs.js +19 -19
  6. package/dist/alert-dialog.esm.js +69 -87
  7. package/dist/alert.cjs.js +1 -1
  8. package/dist/alert.esm.js +4 -7
  9. package/dist/anchor.cjs.js +2 -2
  10. package/dist/anchor.esm.js +3 -3
  11. package/dist/animated-beam.cjs.js +83 -83
  12. package/dist/animated-beam.esm.js +250 -277
  13. package/dist/animated-list.cjs.js +4 -4
  14. package/dist/animated-list.esm.js +47 -61
  15. package/dist/animated-text.cjs.js +2 -2
  16. package/dist/animated-text.esm.js +13 -24
  17. package/dist/app-header.cjs.js +3 -3
  18. package/dist/app-header.esm.js +11 -13
  19. package/dist/aspect-ratio.cjs.js +1 -1
  20. package/dist/aspect-ratio.esm.js +4 -7
  21. package/dist/avatar.cjs.js +1 -1
  22. package/dist/avatar.esm.js +7 -13
  23. package/dist/badge.cjs.js +1 -1
  24. package/dist/badge.esm.js +4 -7
  25. package/dist/block-controls.cjs.js +2 -2
  26. package/dist/block-controls.esm.js +19 -35
  27. package/dist/box.cjs.js +1 -1
  28. package/dist/box.esm.js +8 -15
  29. package/dist/breadcrumb.cjs.js +2 -2
  30. package/dist/breadcrumb.esm.js +20 -37
  31. package/dist/button.cjs.js +1 -521
  32. package/dist/button.esm.js +2 -669
  33. package/dist/{calendar-2c11b824.mjs → calendar-DLY4acgn.mjs} +293 -342
  34. package/dist/{calendar-a8735e40.js → calendar-Dkof-FTK.js} +25 -25
  35. package/dist/calendar.cjs.js +1 -1
  36. package/dist/calendar.esm.js +8 -9
  37. package/dist/card.cjs.js +4 -4
  38. package/dist/card.esm.js +13 -19
  39. package/dist/chart.cjs.js +64 -64
  40. package/dist/chart.esm.js +223 -254
  41. package/dist/checkbox.cjs.js +1 -1
  42. package/dist/checkbox.esm.js +2 -3
  43. package/dist/collapsible.cjs.js +1 -1
  44. package/dist/collapsible.esm.js +5 -9
  45. package/dist/{collection-a1aac0c6.mjs → collection-C7URGjEI.mjs} +8 -14
  46. package/dist/collection.cjs.js +1 -1
  47. package/dist/collection.esm.js +4 -7
  48. package/dist/color-picker.cjs.js +9 -9
  49. package/dist/color-picker.esm.js +189 -252
  50. package/dist/combobox.cjs.js +13 -13
  51. package/dist/combobox.esm.js +93 -126
  52. package/dist/command-palette.cjs.js +3 -3
  53. package/dist/command-palette.esm.js +19 -30
  54. package/dist/command.cjs.js +4 -4
  55. package/dist/command.esm.js +41 -53
  56. package/dist/components/ui-button.d.ts +1 -0
  57. package/dist/components/ui-button.d.ts.map +1 -1
  58. package/dist/components/ui-date-picker.d.ts.map +1 -1
  59. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  60. package/dist/components/ui-date-range-time-picker.d.ts +1 -0
  61. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  62. package/dist/components/ui-date-time-picker.d.ts +1 -0
  63. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  64. package/dist/components/ui-orbiter.d.ts.map +1 -1
  65. package/dist/components/ui-skeleton.d.ts.map +1 -1
  66. package/dist/components/ui-split-button.d.ts +1 -0
  67. package/dist/components/ui-split-button.d.ts.map +1 -1
  68. package/dist/components/ui-time-picker.d.ts.map +1 -1
  69. package/dist/container.cjs.js +2 -2
  70. package/dist/container.esm.js +2 -3
  71. package/dist/context-menu.cjs.js +8 -8
  72. package/dist/context-menu.esm.js +157 -219
  73. package/dist/control-group.cjs.js +1 -1
  74. package/dist/control-group.esm.js +2 -3
  75. package/dist/data-table.cjs.js +4 -4
  76. package/dist/data-table.esm.js +299 -381
  77. package/dist/date-field.cjs.js +3 -3
  78. package/dist/date-field.esm.js +68 -80
  79. package/dist/date-picker.cjs.js +30 -9
  80. package/dist/date-picker.esm.js +90 -97
  81. package/dist/date-range-picker.cjs.js +22 -3
  82. package/dist/date-range-picker.esm.js +103 -108
  83. package/dist/date-range-time-picker.cjs.js +28 -12
  84. package/dist/date-range-time-picker.esm.js +137 -150
  85. package/dist/date-time-picker.cjs.js +25 -9
  86. package/dist/date-time-picker.esm.js +139 -155
  87. package/dist/date-time-utils-Dmost5Ee.js +1 -0
  88. package/dist/date-time-utils-y1N2gvG2.mjs +268 -0
  89. package/dist/description.cjs.js +1 -1
  90. package/dist/description.esm.js +3 -5
  91. package/dist/dialog.cjs.js +12 -12
  92. package/dist/dialog.esm.js +44 -63
  93. package/dist/direction-provider.cjs.js +1 -1
  94. package/dist/direction-provider.esm.js +2 -3
  95. package/dist/{dismissable-layer-9c7e6b58.mjs → dismissable-layer-BmPIoK80.mjs} +29 -33
  96. package/dist/dismissable-layer-DNfrKA20.js +1 -0
  97. package/dist/dismissable-layer.cjs.js +2 -2
  98. package/dist/dismissable-layer.esm.js +4 -6
  99. package/dist/dock.cjs.js +5 -5
  100. package/dist/dock.esm.js +134 -155
  101. package/dist/drawer.cjs.js +2 -2
  102. package/dist/drawer.esm.js +18 -35
  103. package/dist/dropdown.cjs.js +2 -2
  104. package/dist/dropdown.esm.js +119 -149
  105. package/dist/dropzone.cjs.js +1 -1
  106. package/dist/dropzone.esm.js +0 -1
  107. package/dist/empty-state.cjs.js +1 -1
  108. package/dist/empty-state.esm.js +1 -1
  109. package/dist/field-error.cjs.js +1 -1
  110. package/dist/field-error.esm.js +3 -5
  111. package/dist/field.cjs.js +5 -5
  112. package/dist/field.esm.js +27 -34
  113. package/dist/fieldset.cjs.js +4 -4
  114. package/dist/fieldset.esm.js +19 -24
  115. package/dist/file-upload.cjs.js +4 -4
  116. package/dist/file-upload.esm.js +69 -93
  117. package/dist/flex.cjs.js +1 -1
  118. package/dist/flex.esm.js +5 -9
  119. package/dist/floating-toolbar.cjs.js +4 -4
  120. package/dist/floating-toolbar.esm.js +60 -85
  121. package/dist/focus-scope-Bwug2gDv.js +1 -0
  122. package/dist/{focus-scope-103833ee.mjs → focus-scope-CmEsG5UZ.mjs} +39 -48
  123. package/dist/focus-scope.cjs.js +2 -2
  124. package/dist/focus-scope.esm.js +15 -20
  125. package/dist/form.cjs.js +2 -2
  126. package/dist/form.esm.js +26 -53
  127. package/dist/gantt.cjs.js +43 -43
  128. package/dist/gantt.esm.js +295 -322
  129. package/dist/grid.cjs.js +1 -1
  130. package/dist/grid.esm.js +5 -9
  131. package/dist/hover-card.cjs.js +4 -4
  132. package/dist/hover-card.esm.js +22 -28
  133. package/dist/icon-cloud.cjs.js +7 -7
  134. package/dist/icon-cloud.esm.js +48 -62
  135. package/dist/icon.cjs.js +1 -1
  136. package/dist/icon.esm.js +2 -4
  137. package/dist/index.cjs.js +1 -1
  138. package/dist/index.esm.js +378 -390
  139. package/dist/inline-edit.cjs.js +11 -11
  140. package/dist/inline-edit.esm.js +32 -36
  141. package/dist/input.cjs.js +17 -17
  142. package/dist/input.esm.js +50 -63
  143. package/dist/label.cjs.js +2 -2
  144. package/dist/label.esm.js +8 -17
  145. package/dist/layout.cjs.js +2 -2
  146. package/dist/layout.esm.js +20 -26
  147. package/dist/listbox-B6QgECax.js +46 -0
  148. package/dist/listbox-DJamVeFj.mjs +200 -0
  149. package/dist/listbox.cjs.js +1 -1
  150. package/dist/listbox.esm.js +2 -4
  151. package/dist/marquee.cjs.js +5 -5
  152. package/dist/marquee.esm.js +33 -50
  153. package/dist/masonry-grid.cjs.js +1 -1
  154. package/dist/masonry-grid.esm.js +5 -9
  155. package/dist/menu.cjs.js +3 -3
  156. package/dist/menu.esm.js +106 -126
  157. package/dist/menubar.cjs.js +5 -5
  158. package/dist/menubar.esm.js +118 -164
  159. package/dist/meter.cjs.js +2 -2
  160. package/dist/meter.esm.js +4 -4
  161. package/dist/multi-select.cjs.js +4 -4
  162. package/dist/multi-select.esm.js +120 -140
  163. package/dist/navigation-menu.cjs.js +4 -4
  164. package/dist/navigation-menu.esm.js +44 -55
  165. package/dist/number-field.cjs.js +2 -2
  166. package/dist/number-field.esm.js +73 -98
  167. package/dist/number-ticker.cjs.js +3 -3
  168. package/dist/number-ticker.esm.js +22 -43
  169. package/dist/odometer.cjs.js +1 -1
  170. package/dist/odometer.esm.js +5 -9
  171. package/dist/orbiter.cjs.js +13 -13
  172. package/dist/orbiter.esm.js +79 -90
  173. package/dist/{overlayManager-5bbd4dc3.mjs → overlayManager-BJjU1VA8.mjs} +4 -5
  174. package/dist/{overlayManager-0eda4e08.js → overlayManager-CSy3fJmJ.js} +1 -1
  175. package/dist/pagination.cjs.js +2 -2
  176. package/dist/pagination.esm.js +14 -18
  177. package/dist/{panel-group-a376cc5e.mjs → panel-group-8sVNnGxg.mjs} +24 -46
  178. package/dist/panel-group-CaD0_KQf.js +36 -0
  179. package/dist/panel-group.cjs.js +1 -1
  180. package/dist/panel-group.esm.js +2 -5
  181. package/dist/panel.cjs.js +4 -4
  182. package/dist/panel.esm.js +8 -10
  183. package/dist/password-field.cjs.js +9 -9
  184. package/dist/password-field.esm.js +62 -82
  185. package/dist/pin-input.cjs.js +3 -3
  186. package/dist/pin-input.esm.js +33 -39
  187. package/dist/placement-grid.cjs.js +4 -4
  188. package/dist/placement-grid.esm.js +108 -131
  189. package/dist/plugin-panel.cjs.js +7 -7
  190. package/dist/plugin-panel.esm.js +13 -15
  191. package/dist/popover.cjs.js +2 -2
  192. package/dist/popover.esm.js +21 -31
  193. package/dist/portal-DgpQ3Jo1.js +1 -0
  194. package/dist/{portal-fe73e5cc.mjs → portal-bR42gHvG.mjs} +43 -48
  195. package/dist/portal.cjs.js +2 -2
  196. package/dist/portal.esm.js +10 -19
  197. package/dist/{positioner-e9770c66.mjs → positioner-D0VGxtYU.mjs} +189 -209
  198. package/dist/positioner-D_fqyx_j.js +1 -0
  199. package/dist/positioner.cjs.js +2 -2
  200. package/dist/positioner.esm.js +11 -18
  201. package/dist/presence.cjs.js +1 -1
  202. package/dist/presence.esm.js +7 -13
  203. package/dist/progress.cjs.js +1 -1
  204. package/dist/progress.esm.js +5 -9
  205. package/dist/quick-actions.cjs.js +6 -6
  206. package/dist/quick-actions.esm.js +52 -62
  207. package/dist/radio-group.cjs.js +13 -13
  208. package/dist/radio-group.esm.js +39 -51
  209. package/dist/radio.cjs.js +1 -1
  210. package/dist/radio.esm.js +5 -9
  211. package/dist/rating.cjs.js +1 -1
  212. package/dist/rating.esm.js +12 -23
  213. package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
  214. package/dist/roving-focus-group.cjs.js +1 -1
  215. package/dist/roving-focus-group.esm.js +3 -5
  216. package/dist/runtime-CTaOSmBj.js +1 -0
  217. package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
  218. package/dist/runtime.cjs.js +1 -1
  219. package/dist/runtime.esm.js +6 -6
  220. package/dist/scroll-area.cjs.js +3 -3
  221. package/dist/scroll-area.esm.js +38 -46
  222. package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
  223. package/dist/section.cjs.js +1 -1
  224. package/dist/section.esm.js +1 -1
  225. package/dist/select.cjs.js +7 -7
  226. package/dist/select.esm.js +67 -97
  227. package/dist/selection-popup.cjs.js +1 -1
  228. package/dist/selection-popup.esm.js +8 -15
  229. package/dist/separator.cjs.js +1 -1
  230. package/dist/separator.esm.js +1 -1
  231. package/dist/sidebar.cjs.js +18 -18
  232. package/dist/sidebar.esm.js +117 -139
  233. package/dist/skeleton.cjs.js +11 -11
  234. package/dist/skeleton.esm.js +27 -24
  235. package/dist/slider.cjs.js +1 -1
  236. package/dist/slider.esm.js +6 -11
  237. package/dist/slot.cjs.js +4 -4
  238. package/dist/slot.esm.js +16 -19
  239. package/dist/sortable.cjs.js +45 -45
  240. package/dist/sortable.esm.js +421 -524
  241. package/dist/spinning-text.cjs.js +12 -12
  242. package/dist/spinning-text.esm.js +80 -92
  243. package/dist/split-button.cjs.js +4 -4
  244. package/dist/split-button.esm.js +77 -62
  245. package/dist/splitter.cjs.js +1 -1
  246. package/dist/splitter.esm.js +1 -1
  247. package/dist/stepper.cjs.js +8 -8
  248. package/dist/stepper.esm.js +32 -52
  249. package/dist/switch.cjs.js +7 -7
  250. package/dist/switch.esm.js +23 -31
  251. package/dist/table.cjs.js +2 -2
  252. package/dist/table.esm.js +46 -56
  253. package/dist/tabs.cjs.js +3 -3
  254. package/dist/tabs.esm.js +35 -55
  255. package/dist/tags-input.cjs.js +4 -4
  256. package/dist/tags-input.esm.js +45 -62
  257. package/dist/textarea.cjs.js +6 -6
  258. package/dist/textarea.esm.js +32 -41
  259. package/dist/time-field.cjs.js +4 -4
  260. package/dist/time-field.esm.js +70 -84
  261. package/dist/time-picker.cjs.js +29 -21
  262. package/dist/time-picker.esm.js +96 -110
  263. package/dist/timeline.cjs.js +1 -1
  264. package/dist/timeline.esm.js +3 -5
  265. package/dist/toast.cjs.js +2 -2
  266. package/dist/toast.esm.js +33 -47
  267. package/dist/toggle-group.cjs.js +6 -6
  268. package/dist/toggle-group.esm.js +85 -105
  269. package/dist/toggle.cjs.js +1 -1
  270. package/dist/toggle.esm.js +3 -5
  271. package/dist/toolbar.cjs.js +1 -1
  272. package/dist/toolbar.esm.js +13 -24
  273. package/dist/tooltip.cjs.js +2 -2
  274. package/dist/tooltip.esm.js +31 -42
  275. package/dist/transfer-list.cjs.js +19 -19
  276. package/dist/transfer-list.esm.js +98 -111
  277. package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
  278. package/dist/tree-Dx_kv_ih.js +39 -0
  279. package/dist/tree-item.cjs.js +2 -2
  280. package/dist/tree-item.esm.js +2 -3
  281. package/dist/tree.cjs.js +1 -1
  282. package/dist/tree.esm.js +2 -5
  283. package/dist/ui-button-Q0GNNWKC.mjs +665 -0
  284. package/dist/ui-button-rXQOS9QJ.js +521 -0
  285. package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
  286. package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
  287. package/dist/visually-hidden.cjs.js +1 -1
  288. package/dist/visually-hidden.esm.js +1 -1
  289. package/dist/wizard.cjs.js +14 -14
  290. package/dist/wizard.esm.js +85 -105
  291. package/package.json +3 -3
  292. package/dist/date-time-utils-66480de4.js +0 -1
  293. package/dist/date-time-utils-a2c7af25.mjs +0 -307
  294. package/dist/dismissable-layer-193e3bed.js +0 -1
  295. package/dist/focus-scope-2b12b4e7.js +0 -1
  296. package/dist/listbox-308789a0.mjs +0 -210
  297. package/dist/listbox-ef2f708e.js +0 -46
  298. package/dist/panel-group-40254cdd.js +0 -36
  299. package/dist/portal-c69756c0.js +0 -1
  300. package/dist/positioner-33529bb8.js +0 -1
  301. package/dist/runtime-3f13807b.js +0 -1
  302. package/dist/tree-0a7a8d05.js +0 -39
  303. /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
  304. /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
  305. /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
  306. /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
  307. /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { E as f } from "./ElementBase-909688f3.mjs";
1
+ import { E as f } from "./ElementBase-YlTLMsGk.mjs";
2
2
  const v = `
3
3
  <svg viewBox="0 0 20 20" aria-hidden="true" focusable="false">
4
4
  <path d="m6 6 8 8M14 6l-8 8" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
@@ -310,11 +310,11 @@ const v = `
310
310
  }
311
311
  }
312
312
  `;
313
- function d(h) {
314
- return h.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
313
+ function d(l) {
314
+ return l.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
315
315
  }
316
- function x(h, t) {
317
- const e = Number(h);
316
+ function x(l, t) {
317
+ const e = Number(l);
318
318
  return Number.isFinite(e) ? e : t;
319
319
  }
320
320
  class y extends f {
@@ -359,11 +359,10 @@ class y extends f {
359
359
  this._detachListeners(), this._debounceTimer && (clearTimeout(this._debounceTimer), this._debounceTimer = null), this._formUnregister && (this._formUnregister(), this._formUnregister = null), super.disconnectedCallback();
360
360
  }
361
361
  attributeChangedCallback(t, e, i) {
362
- if (e === i)
363
- return;
362
+ if (e === i) return;
364
363
  if (t === "name" && this._tryRegisterWithForm(), t === "value" && this._textarea) {
365
- const r = i || "";
366
- this._textarea.value !== r && (this._textarea.value = r), this._syncDynamicUi(), this._applyAutosize();
364
+ const a = i || "";
365
+ this._textarea.value !== a && (this._textarea.value = a), this._syncDynamicUi(), this._applyAutosize();
367
366
  return;
368
367
  }
369
368
  if ((/* @__PURE__ */ new Set([
@@ -391,8 +390,7 @@ class y extends f {
391
390
  "autofocus"
392
391
  ])).has(t)) {
393
392
  this._syncControlAttrs(), this._syncDynamicUi(), this._applyAutosize(), t === "autofocus" && this.hasAttribute("autofocus") && queueMicrotask(() => {
394
- var r;
395
- (r = this._textarea) == null || r.focus();
393
+ this._textarea?.focus();
396
394
  });
397
395
  return;
398
396
  }
@@ -405,20 +403,18 @@ class y extends f {
405
403
  this.setAttribute("value", t || "");
406
404
  }
407
405
  _tryRegisterWithForm() {
408
- var t;
409
406
  try {
410
- const e = (t = this.closest) == null ? void 0 : t.call(this, "ui-form"), i = this.getAttribute("name");
411
- if (!e || typeof e.registerField != "function" || !i)
412
- return;
413
- this._formUnregister = e.registerField(i, {
414
- name: i,
407
+ const t = this.closest?.("ui-form"), e = this.getAttribute("name");
408
+ if (!t || typeof t.registerField != "function" || !e) return;
409
+ this._formUnregister = t.registerField(e, {
410
+ name: e,
415
411
  getValue: () => this.value,
416
- setValue: (a) => {
417
- this.value = a;
412
+ setValue: (i) => {
413
+ this.value = i;
418
414
  },
419
415
  validate: async () => this._textarea ? { valid: this._textarea.checkValidity(), message: this._textarea.validationMessage || void 0 } : { valid: !0 },
420
- setError: (a) => {
421
- a ? (this.setAttribute("validation", "error"), this.setAttribute("data-error", a)) : (this.removeAttribute("validation"), this.removeAttribute("data-error"));
416
+ setError: (i) => {
417
+ i ? (this.setAttribute("validation", "error"), this.setAttribute("data-error", i)) : (this.removeAttribute("validation"), this.removeAttribute("data-error"));
422
418
  }
423
419
  });
424
420
  } catch {
@@ -428,21 +424,18 @@ class y extends f {
428
424
  this._textarea && (this._textarea.removeEventListener("input", this._onInput), this._textarea.removeEventListener("change", this._onChange)), this._clearBtn && this._clearBtn.removeEventListener("click", this._onClear), this._clearBtn = null;
429
425
  }
430
426
  _syncControlAttrs() {
431
- if (!this._textarea)
432
- return;
433
- const t = this.getAttribute("placeholder") || "", e = this.getAttribute("maxlength"), i = this.getAttribute("minlength"), a = x(this.getAttribute("rows"), 4), r = this.hasAttribute("disabled"), c = this.hasAttribute("readonly"), n = this.hasAttribute("required"), o = this.getAttribute("name") || "", s = this.getAttribute("resize") || "vertical", p = this.getAttribute("validation"), b = this.getAttribute("color"), l = this.getAttribute("radius");
434
- this._textarea.placeholder = t, this._textarea.disabled = r, this._textarea.readOnly = c, this._textarea.required = n, this._textarea.rows = Math.max(1, a), this._textarea.name = o, this._textarea.style.resize = s, e && Number.isFinite(Number(e)) ? this._textarea.maxLength = Number(e) : this._textarea.removeAttribute("maxlength"), i && Number.isFinite(Number(i)) ? this._textarea.minLength = Number(i) : this._textarea.removeAttribute("minlength"), p === "error" ? this._textarea.setAttribute("aria-invalid", "true") : this._textarea.removeAttribute("aria-invalid"), b ? this.style.setProperty("--ui-textarea-accent", b) : this.style.removeProperty("--ui-textarea-accent"), l && l !== "none" && l !== "large" && l !== "full" ? this.style.setProperty("--ui-textarea-radius", l) : this.style.removeProperty("--ui-textarea-radius");
435
- const u = [], g = !!(this.getAttribute("description") || this.querySelector('[slot="description"]')), m = !!(this.getAttribute("data-error") || this.querySelector('[slot="error"]'));
436
- g && u.push(`${this._uid}-description`), m && u.push(`${this._uid}-error`), (this.hasAttribute("show-count") || this.hasAttribute("maxlength")) && u.push(`${this._uid}-count`), !!(this.getAttribute("label") || this.querySelector('[slot="label"]')) ? this._textarea.setAttribute("aria-labelledby", `${this._uid}-label`) : this._textarea.removeAttribute("aria-labelledby"), u.length ? this._textarea.setAttribute("aria-describedby", u.join(" ")) : this._textarea.removeAttribute("aria-describedby");
427
+ if (!this._textarea) return;
428
+ const t = this.getAttribute("placeholder") || "", e = this.getAttribute("maxlength"), i = this.getAttribute("minlength"), r = x(this.getAttribute("rows"), 4), a = this.hasAttribute("disabled"), u = this.hasAttribute("readonly"), s = this.hasAttribute("required"), c = this.getAttribute("name") || "", h = this.getAttribute("resize") || "vertical", p = this.getAttribute("validation"), b = this.getAttribute("color"), o = this.getAttribute("radius");
429
+ this._textarea.placeholder = t, this._textarea.disabled = a, this._textarea.readOnly = u, this._textarea.required = s, this._textarea.rows = Math.max(1, r), this._textarea.name = c, this._textarea.style.resize = h, e && Number.isFinite(Number(e)) ? this._textarea.maxLength = Number(e) : this._textarea.removeAttribute("maxlength"), i && Number.isFinite(Number(i)) ? this._textarea.minLength = Number(i) : this._textarea.removeAttribute("minlength"), p === "error" ? this._textarea.setAttribute("aria-invalid", "true") : this._textarea.removeAttribute("aria-invalid"), b ? this.style.setProperty("--ui-textarea-accent", b) : this.style.removeProperty("--ui-textarea-accent"), o && o !== "none" && o !== "large" && o !== "full" ? this.style.setProperty("--ui-textarea-radius", o) : this.style.removeProperty("--ui-textarea-radius");
430
+ const n = [], g = !!(this.getAttribute("description") || this.querySelector('[slot="description"]')), m = !!(this.getAttribute("data-error") || this.querySelector('[slot="error"]'));
431
+ g && n.push(`${this._uid}-description`), m && n.push(`${this._uid}-error`), (this.hasAttribute("show-count") || this.hasAttribute("maxlength")) && n.push(`${this._uid}-count`), !!(this.getAttribute("label") || this.querySelector('[slot="label"]')) ? this._textarea.setAttribute("aria-labelledby", `${this._uid}-label`) : this._textarea.removeAttribute("aria-labelledby"), n.length ? this._textarea.setAttribute("aria-describedby", n.join(" ")) : this._textarea.removeAttribute("aria-describedby");
437
432
  }
438
433
  _syncDynamicUi() {
439
- var a;
440
- const t = ((a = this._textarea) == null ? void 0 : a.value) || this.getAttribute("value") || "", e = this.getAttribute("maxlength"), i = this.hasAttribute("clearable");
434
+ const t = this._textarea?.value || this.getAttribute("value") || "", e = this.getAttribute("maxlength"), i = this.hasAttribute("clearable");
441
435
  this._clearBtn && (i && t && !this.hasAttribute("disabled") && !this.hasAttribute("readonly") ? this._clearBtn.removeAttribute("hidden") : this._clearBtn.setAttribute("hidden", "")), this._countEl && (this.hasAttribute("show-count") || !!e ? (this._countEl.removeAttribute("hidden"), e && Number.isFinite(Number(e)) ? this._countEl.textContent = `${t.length} / ${Number(e)}` : this._countEl.textContent = `${t.length}`) : this._countEl.setAttribute("hidden", ""));
442
436
  }
443
437
  _applyAutosize() {
444
- if (!this._textarea)
445
- return;
438
+ if (!this._textarea) return;
446
439
  if (!this.hasAttribute("autosize")) {
447
440
  this._textarea.style.height = "", this._textarea.style.overflowY = "";
448
441
  return;
@@ -450,8 +443,8 @@ class y extends f {
450
443
  this._textarea.style.height = "auto";
451
444
  const t = this._textarea.scrollHeight, e = x(this.getAttribute("max-rows"), 0);
452
445
  if (e > 0) {
453
- const i = getComputedStyle(this._textarea), a = parseFloat(i.lineHeight || "20") || 20, r = parseFloat(i.borderTopWidth || "0") || 0, c = parseFloat(i.borderBottomWidth || "0") || 0, n = parseFloat(i.paddingTop || "0") || 0, o = parseFloat(i.paddingBottom || "0") || 0, s = a * e + r + c + n + o;
454
- this._textarea.style.height = `${Math.min(t, s)}px`, this._textarea.style.overflowY = t > s ? "auto" : "hidden";
446
+ const i = getComputedStyle(this._textarea), r = parseFloat(i.lineHeight || "20") || 20, a = parseFloat(i.borderTopWidth || "0") || 0, u = parseFloat(i.borderBottomWidth || "0") || 0, s = parseFloat(i.paddingTop || "0") || 0, c = parseFloat(i.paddingBottom || "0") || 0, h = r * e + a + u + s + c;
447
+ this._textarea.style.height = `${Math.min(t, h)}px`, this._textarea.style.overflowY = t > h ? "auto" : "hidden";
455
448
  return;
456
449
  }
457
450
  this._textarea.style.height = `${t}px`, this._textarea.style.overflowY = "hidden";
@@ -485,29 +478,27 @@ class y extends f {
485
478
  t.preventDefault(), !(this.hasAttribute("disabled") || this.hasAttribute("readonly")) && (this.value = "", this._textarea && (this._textarea.value = "", this._textarea.focus()), this._syncDynamicUi(), this._applyAutosize(), this._emit("input", ""), this._emit("change", ""), this.dispatchEvent(new CustomEvent("clear", { bubbles: !0, composed: !0 })));
486
479
  }
487
480
  render() {
488
- var o;
489
- const t = this.getAttribute("value") || "", e = this.getAttribute("label") || "", i = this.getAttribute("description") || "", a = this.getAttribute("data-error") || "", r = !!(e || i || this.querySelector('[slot="label"]') || this.querySelector('[slot="description"]')), n = this.hasAttribute("clearable") && !!t && !this.hasAttribute("disabled") && !this.hasAttribute("readonly");
481
+ const t = this.getAttribute("value") || "", e = this.getAttribute("label") || "", i = this.getAttribute("description") || "", r = this.getAttribute("data-error") || "", a = !!(e || i || this.querySelector('[slot="label"]') || this.querySelector('[slot="description"]')), s = this.hasAttribute("clearable") && !!t && !this.hasAttribute("disabled") && !this.hasAttribute("readonly");
490
482
  this.setContent(`
491
483
  <style>${_}</style>
492
484
  <div class="shell" part="shell">
493
- <div class="meta" part="meta" ${r ? "" : "hidden"}>
485
+ <div class="meta" part="meta" ${a ? "" : "hidden"}>
494
486
  <label id="${this._uid}-label" class="label" part="label"><slot name="label">${d(e)}</slot></label>
495
487
  <div id="${this._uid}-description" class="description" part="description"><slot name="description">${d(i)}</slot></div>
496
488
  </div>
497
489
 
498
490
  <div class="field" part="field">
499
491
  <textarea part="textarea"></textarea>
500
- <button type="button" part="clear" class="clear-btn" aria-label="Clear text" ${n ? "" : "hidden"}>${v}</button>
492
+ <button type="button" part="clear" class="clear-btn" aria-label="Clear text" ${s ? "" : "hidden"}>${v}</button>
501
493
  </div>
502
494
 
503
495
  <div class="footer" part="footer">
504
- <div id="${this._uid}-error" class="error" part="error"><slot name="error">${d(a)}</slot></div>
496
+ <div id="${this._uid}-error" class="error" part="error"><slot name="error">${d(r)}</slot></div>
505
497
  <div id="${this._uid}-count" class="count" part="count" hidden></div>
506
498
  </div>
507
499
  </div>
508
- `), this._detachListeners(), this._textarea = this.root.querySelector("textarea"), this._clearBtn = this.root.querySelector(".clear-btn"), this._countEl = this.root.querySelector(".count"), this._textarea && (this._textarea.value = t, this._syncControlAttrs(), this._syncDynamicUi(), this._applyAutosize(), this._textarea.addEventListener("input", this._onInput), this._textarea.addEventListener("change", this._onChange), (o = this._clearBtn) == null || o.addEventListener("click", this._onClear), this.hasAttribute("autofocus") && queueMicrotask(() => {
509
- var s;
510
- (s = this._textarea) == null || s.focus();
500
+ `), this._detachListeners(), this._textarea = this.root.querySelector("textarea"), this._clearBtn = this.root.querySelector(".clear-btn"), this._countEl = this.root.querySelector(".count"), this._textarea && (this._textarea.value = t, this._syncControlAttrs(), this._syncDynamicUi(), this._applyAutosize(), this._textarea.addEventListener("input", this._onInput), this._textarea.addEventListener("change", this._onChange), this._clearBtn?.addEventListener("click", this._onClear), this.hasAttribute("autofocus") && queueMicrotask(() => {
501
+ this._textarea?.focus();
511
502
  }));
512
503
  }
513
504
  shouldRenderOnAttributeChange(t, e, i) {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const T=require("./ElementBase-1b301e7f.js"),c=require("./date-time-utils-66480de4.js");require("./calendar-a8735e40.js");require("./scroll-lock-d7b0df21.js");require("./positioner-33529bb8.js");let M=0;const C=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const C=require("./ElementBase-EV6mVBUV.js"),c=require("./date-time-utils-Dmost5Ee.js");let T=0;const B=`
2
2
  :host {
3
3
  --ui-time-field-border-color: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 78%, transparent);
4
4
  --ui-time-field-border: 1px solid var(--ui-time-field-border-color);
@@ -127,8 +127,8 @@
127
127
  :host([readonly]) .segment {
128
128
  cursor: default;
129
129
  }
130
- `;function _(l,e){return c.parseTimeInput(l||"",!0)||null}function b(l){return{hour:l.hours%12||12,meridiem:l.hours>=12?"PM":"AM"}}function A(l,e){return e==="AM"?l===12?0:l:l===12?12:l+12}function I(l){return l==="meridiem"?"AM":l==="hour"?"HH":l==="minute"?"MM":"SS"}class p extends T.ElementBase{constructor(){super(),this._value=null,this._activeSegment="hour",this._segmentButtons=new Map,this._segmentsEl=null,this._shellEl=null,this._errorEl=null,this._formUnregister=null,this._bufferBySegment={hour:"",minute:"",second:""},this._bufferTimer=null,this._internals=null,this._uid=`ui-time-field-${++M}`,this._defaultValue=null;try{this._internals=typeof this.attachInternals=="function"?this.attachInternals():null}catch{this._internals=null}this._onSegmentKeyDown=this._onSegmentKeyDown.bind(this),this._onSegmentClick=this._onSegmentClick.bind(this),this._onFocusIn=this._onFocusIn.bind(this),this._onFocusOut=this._onFocusOut.bind(this)}static get observedAttributes(){return["value","min","max","format","seconds","label","description","data-error","required","disabled","readonly","name","locale"]}get value(){return this._value||""}set value(e){this._setValue(e||null,"api")}clearValue(){this._setValue(null,"clear")}formResetCallback(){this._setValue(this._defaultValue,"form")}connectedCallback(){super.connectedCallback(),this._defaultValue==null&&(this._defaultValue=this.getAttribute("value")),this._registerWithForm()}disconnectedCallback(){this._formUnregister&&(this._formUnregister(),this._formUnregister=null),this._bufferTimer!=null&&(window.clearTimeout(this._bufferTimer),this._bufferTimer=null),super.disconnectedCallback()}attributeChangedCallback(e,i,t){i!==t&&(e==="value"&&(this._value=this._normalizeTimeValue(t)),e==="name"&&this.isConnected&&this._registerWithForm(),this._shellEl&&this._syncUi())}shouldRenderOnAttributeChange(){return!1}render(){var e,i;this.setContent(`
131
- <style>${C}</style>
130
+ `;function b(l,e){return c.parseTimeInput(l||"")||null}function p(l){return{hour:l.hours%12||12,meridiem:l.hours>=12?"PM":"AM"}}function E(l,e){return e==="AM"?l===12?0:l:l===12?12:l+12}function V(l){return l==="meridiem"?"AM":l==="hour"?"HH":l==="minute"?"MM":"SS"}const g=class g extends C.ElementBase{constructor(){super(),this._value=null,this._activeSegment="hour",this._segmentButtons=new Map,this._segmentsEl=null,this._shellEl=null,this._errorEl=null,this._formUnregister=null,this._bufferBySegment={hour:"",minute:"",second:""},this._bufferTimer=null,this._internals=null,this._uid=`ui-time-field-${++T}`,this._defaultValue=null;try{this._internals=typeof this.attachInternals=="function"?this.attachInternals():null}catch{this._internals=null}this._onSegmentKeyDown=this._onSegmentKeyDown.bind(this),this._onSegmentClick=this._onSegmentClick.bind(this),this._onFocusIn=this._onFocusIn.bind(this),this._onFocusOut=this._onFocusOut.bind(this)}static get observedAttributes(){return["value","min","max","format","seconds","label","description","data-error","required","disabled","readonly","name","locale"]}get value(){return this._value||""}set value(e){this._setValue(e||null,"api")}clearValue(){this._setValue(null,"clear")}formResetCallback(){this._setValue(this._defaultValue,"form")}connectedCallback(){super.connectedCallback(),this._defaultValue==null&&(this._defaultValue=this.getAttribute("value")),this._registerWithForm()}disconnectedCallback(){this._formUnregister&&(this._formUnregister(),this._formUnregister=null),this._bufferTimer!=null&&(window.clearTimeout(this._bufferTimer),this._bufferTimer=null),super.disconnectedCallback()}attributeChangedCallback(e,i,t){i!==t&&(e==="value"&&(this._value=this._normalizeTimeValue(t)),e==="name"&&this.isConnected&&this._registerWithForm(),this._shellEl&&this._syncUi())}shouldRenderOnAttributeChange(){return!1}render(){this.setContent(`
131
+ <style>${B}</style>
132
132
  <div class="root">
133
133
  <div class="meta" hidden>
134
134
  <div class="label" hidden><span class="label-text"></span><span class="required" hidden>*</span></div>
@@ -139,4 +139,4 @@
139
139
  </div>
140
140
  <div class="error" part="error" hidden></div>
141
141
  </div>
142
- `),this._segmentsEl=this.root.querySelector(".segments"),this._shellEl=this.root.querySelector(".shell"),this._errorEl=this.root.querySelector(".error"),(e=this._shellEl)==null||e.addEventListener("focusin",this._onFocusIn),(i=this._shellEl)==null||i.addEventListener("focusout",this._onFocusOut),this._value=this._normalizeTimeValue(this.getAttribute("value")),this._syncFormValue(),this._syncUi()}_showSeconds(){return this.hasAttribute("seconds")}_is12h(){return(this.getAttribute("format")||"").toLowerCase()==="12h"}_normalizeTimeValue(e){const i=c.parseTimeInput(e||"",!0);if(!i)return null;const t=c.formatTime(i,this._showSeconds()),r=this.getAttribute("min"),s=this.getAttribute("max");return c.clampTime(t,r,s)}_partsOrFallback(){return _(this._value,this._showSeconds())||_(this.getAttribute("min"),this._showSeconds())||{hours:9,minutes:0,seconds:0}}_order(){const e=["hour","minute"];return this._showSeconds()&&e.push("second"),this._is12h()&&e.push("meridiem"),e}_focusSegment(e){var i;this._activeSegment=e,this._syncUi(),(i=this._segmentButtons.get(e))==null||i.focus()}_moveSegmentFocus(e){const i=this._order(),t=i.indexOf(this._activeSegment),r=i[(t+e+i.length)%i.length];this._focusSegment(r)}_setBuffer(e,i){this._bufferBySegment[e]=i,this._bufferTimer!=null&&window.clearTimeout(this._bufferTimer),this._bufferTimer=window.setTimeout(()=>{this._bufferBySegment.hour="",this._bufferBySegment.minute="",this._bufferBySegment.second="",this._bufferTimer=null},900)}_applyParts(e,i){const t=this._normalizeTimeValue(c.formatTime(e,this._showSeconds()));this._setValue(t,i)}_setValue(e,i){const t=this._normalizeTimeValue(e);if(t===this._value){this._syncFormValue(),this._syncUi();return}const r=this._value;this._value=t,t?this.setAttribute("value",t):this.removeAttribute("value"),this._syncFormValue(),this._syncUi(),this.dispatchEvent(new CustomEvent("change",{detail:{value:t,previousValue:r,source:i},bubbles:!0,composed:!0}))}_syncFormValue(){var e;try{(e=this._internals)==null||e.setFormValue(this.value||"")}catch{}}_increment(e,i){const t=this._partsOrFallback();if(e==="meridiem"){t.hours=(t.hours+12)%24,this._applyParts(t,"keyboard");return}const u=(t.hours*3600+t.minutes*60+t.seconds+i*(e==="hour"?3600:e==="minute"?60:1)+86400)%86400,a={hours:Math.floor(u/3600),minutes:Math.floor(u%3600/60),seconds:u%60};this._applyParts(a,"keyboard")}_applyNumericInput(e,i){const t=`${this._bufferBySegment[e]}${i}`.slice(-2);if(this._setBuffer(e,t),t.length<2)return;const r=this._partsOrFallback(),s=Number(t);if(Number.isFinite(s)){if(e==="hour")if(this._is12h()){const{meridiem:u}=b(r),a=Math.min(Math.max(s,1),12);r.hours=A(a,u)}else r.hours=Math.min(Math.max(s,0),23);else e==="minute"?r.minutes=Math.min(Math.max(s,0),59):r.seconds=Math.min(Math.max(s,0),59);this._applyParts(r,"keyboard"),this._moveSegmentFocus(1)}}_onSegmentClick(e){const i=e.currentTarget.getAttribute("data-segment");i&&this._focusSegment(i)}_onSegmentKeyDown(e){if(this.hasAttribute("disabled")||this.hasAttribute("readonly"))return;const i=e.currentTarget.getAttribute("data-segment");if(i){if(e.key==="ArrowLeft"){e.preventDefault(),this._moveSegmentFocus(-1);return}if(e.key==="ArrowRight"){e.preventDefault(),this._moveSegmentFocus(1);return}if(e.key==="ArrowUp"||e.key==="ArrowDown"){e.preventDefault(),this._increment(i,e.key==="ArrowUp"?1:-1);return}if(e.key==="Backspace"||e.key==="Delete"){e.preventDefault(),this.clearValue();return}if(i==="meridiem"&&/^[ap]$/i.test(e.key)){e.preventDefault();const t=this._partsOrFallback(),r=e.key.toLowerCase()==="a"?"AM":"PM",s=b(t).hour;t.hours=A(s,r),this._applyParts(t,"keyboard");return}/^\d$/.test(e.key)&&i!=="meridiem"&&(e.preventDefault(),this._applyNumericInput(i,e.key))}}_registerWithForm(){var e;this._formUnregister&&(this._formUnregister(),this._formUnregister=null);try{const t=this.getRootNode().host,s=((e=t==null?void 0:t.closest)==null?void 0:e.call(t,"ui-form"))||null||this.closest("ui-form"),u=this.getAttribute("name");s&&typeof s.registerField=="function"&&u&&(this._formUnregister=s.registerField(u,{name:u,getValue:()=>this.value,setValue:a=>this._setValue(a?String(a):null,"form"),validate:async()=>this.hasAttribute("required")&&!this.value?{valid:!1,message:"Time is required"}:{valid:!0},setError:a=>{a?this.setAttribute("data-error",a):this.removeAttribute("data-error"),this._syncUi()}}))}catch{}}_onFocusIn(){var e;(e=this._shellEl)==null||e.setAttribute("data-focused","true")}_onFocusOut(e){var i,t;(i=this._shellEl)!=null&&i.contains(e.relatedTarget)||(t=this._shellEl)==null||t.setAttribute("data-focused","false")}_syncUi(){if(!this._segmentsEl||!this._shellEl||!this._errorEl)return;const e=this.root.activeElement,i=!!e&&this._segmentsEl.contains(e),t=(this.getAttribute("label")||"").trim(),r=(this.getAttribute("description")||"").trim(),s=(this.getAttribute("data-error")||"").trim(),u=this.root.querySelector(".meta"),a=this.root.querySelector(".label"),E=this.root.querySelector(".label-text"),k=this.root.querySelector(".required"),m=this.root.querySelector(".description"),g=`${this._uid}-label`,y=`${this._uid}-description`,v=`${this._uid}-error`;u.hidden=!t&&!r,a.hidden=!t,a.id=t?g:"",E.textContent=t,k.hidden=!this.hasAttribute("required"),m.hidden=!r,m.id=r?y:"",m.textContent=r,this._errorEl.hidden=!s,this._errorEl.id=s?v:"",this._errorEl.textContent=s,this._shellEl.setAttribute("data-invalid",s?"true":"false"),this._shellEl.setAttribute("role","group"),t?this._shellEl.setAttribute("aria-labelledby",g):this._shellEl.removeAttribute("aria-labelledby");const x=[r?y:null,s?v:null].filter(Boolean).join(" ");x?this._shellEl.setAttribute("aria-describedby",x):this._shellEl.removeAttribute("aria-describedby"),this._shellEl.setAttribute("aria-invalid",s?"true":"false"),this._shellEl.setAttribute("aria-required",this.hasAttribute("required")?"true":"false"),this._shellEl.setAttribute("aria-disabled",this.hasAttribute("disabled")?"true":"false"),this._shellEl.setAttribute("aria-readonly",this.hasAttribute("readonly")?"true":"false");const d=_(this._value,this._showSeconds()),w=this._order(),f=[];this._segmentButtons.clear();const S=d?b(d):null;if(w.forEach((n,F)=>{if(F>0){const h=document.createElement("span");h.className="literal",h.textContent=n==="meridiem"?" ":":",f.push(h)}const o=document.createElement("button");if(o.type="button",o.className="segment",o.setAttribute("data-segment",n),o.setAttribute("data-active",this._activeSegment===n?"true":"false"),o.setAttribute("data-empty",d?"false":"true"),o.setAttribute("aria-label",n==="hour"?"Hour":n==="minute"?"Minute":n==="second"?"Second":"AM or PM"),o.tabIndex=this._activeSegment===n?0:-1,o.disabled=this.hasAttribute("disabled"),o.addEventListener("click",this._onSegmentClick),o.addEventListener("keydown",this._onSegmentKeyDown),!d)o.textContent=I(n);else if(n==="hour"){const h=this._is12h()?S.hour:d.hours;o.textContent=String(h).padStart(2,"0")}else n==="minute"?o.textContent=String(d.minutes).padStart(2,"0"):n==="second"?o.textContent=String(d.seconds).padStart(2,"0"):o.textContent=S.meridiem;this._segmentButtons.set(n,o),f.push(o)}),this._segmentsEl.replaceChildren(...f),i){const n=this._segmentButtons.get(this._activeSegment);try{n==null||n.focus({preventScroll:!0})}catch{n==null||n.focus()}}}}p.formAssociated=!0;typeof customElements<"u"&&!customElements.get("ui-time-field")&&customElements.define("ui-time-field",p);exports.UITimeField=p;
142
+ `),this._segmentsEl=this.root.querySelector(".segments"),this._shellEl=this.root.querySelector(".shell"),this._errorEl=this.root.querySelector(".error"),this._shellEl?.addEventListener("focusin",this._onFocusIn),this._shellEl?.addEventListener("focusout",this._onFocusOut),this._value=this._normalizeTimeValue(this.getAttribute("value")),this._syncFormValue(),this._syncUi()}_showSeconds(){return this.hasAttribute("seconds")}_is12h(){return(this.getAttribute("format")||"").toLowerCase()==="12h"}_normalizeTimeValue(e){const i=c.parseTimeInput(e||"");if(!i)return null;const t=c.formatTime(i,this._showSeconds()),s=this.getAttribute("min"),r=this.getAttribute("max");return c.clampTime(t,s,r)}_partsOrFallback(){return b(this._value,this._showSeconds())||b(this.getAttribute("min"),this._showSeconds())||{hours:9,minutes:0,seconds:0}}_order(){const e=["hour","minute"];return this._showSeconds()&&e.push("second"),this._is12h()&&e.push("meridiem"),e}_focusSegment(e){this._activeSegment=e,this._syncUi(),this._segmentButtons.get(e)?.focus()}_moveSegmentFocus(e){const i=this._order(),t=i.indexOf(this._activeSegment),s=i[(t+e+i.length)%i.length];this._focusSegment(s)}_setBuffer(e,i){this._bufferBySegment[e]=i,this._bufferTimer!=null&&window.clearTimeout(this._bufferTimer),this._bufferTimer=window.setTimeout(()=>{this._bufferBySegment.hour="",this._bufferBySegment.minute="",this._bufferBySegment.second="",this._bufferTimer=null},900)}_applyParts(e,i){const t=this._normalizeTimeValue(c.formatTime(e,this._showSeconds()));this._setValue(t,i)}_setValue(e,i){const t=this._normalizeTimeValue(e);if(t===this._value){this._syncFormValue(),this._syncUi();return}const s=this._value;this._value=t,t?this.setAttribute("value",t):this.removeAttribute("value"),this._syncFormValue(),this._syncUi(),this.dispatchEvent(new CustomEvent("change",{detail:{value:t,previousValue:s,source:i},bubbles:!0,composed:!0}))}_syncFormValue(){try{this._internals?.setFormValue(this.value||"")}catch{}}_increment(e,i){const t=this._partsOrFallback();if(e==="meridiem"){t.hours=(t.hours+12)%24,this._applyParts(t,"keyboard");return}const a=(t.hours*3600+t.minutes*60+t.seconds+i*(e==="hour"?3600:e==="minute"?60:1)+86400)%86400,d={hours:Math.floor(a/3600),minutes:Math.floor(a%3600/60),seconds:a%60};this._applyParts(d,"keyboard")}_applyNumericInput(e,i){const t=`${this._bufferBySegment[e]}${i}`.slice(-2);if(this._setBuffer(e,t),t.length<2)return;const s=this._partsOrFallback(),r=Number(t);if(Number.isFinite(r)){if(e==="hour")if(this._is12h()){const{meridiem:a}=p(s),d=Math.min(Math.max(r,1),12);s.hours=E(d,a)}else s.hours=Math.min(Math.max(r,0),23);else e==="minute"?s.minutes=Math.min(Math.max(r,0),59):s.seconds=Math.min(Math.max(r,0),59);this._applyParts(s,"keyboard"),this._moveSegmentFocus(1)}}_onSegmentClick(e){const i=e.currentTarget.getAttribute("data-segment");i&&this._focusSegment(i)}_onSegmentKeyDown(e){if(this.hasAttribute("disabled")||this.hasAttribute("readonly"))return;const i=e.currentTarget.getAttribute("data-segment");if(i){if(e.key==="ArrowLeft"){e.preventDefault(),this._moveSegmentFocus(-1);return}if(e.key==="ArrowRight"){e.preventDefault(),this._moveSegmentFocus(1);return}if(e.key==="ArrowUp"||e.key==="ArrowDown"){e.preventDefault(),this._increment(i,e.key==="ArrowUp"?1:-1);return}if(e.key==="Backspace"||e.key==="Delete"){e.preventDefault(),this.clearValue();return}if(i==="meridiem"&&/^[ap]$/i.test(e.key)){e.preventDefault();const t=this._partsOrFallback(),s=e.key.toLowerCase()==="a"?"AM":"PM",r=p(t).hour;t.hours=E(r,s),this._applyParts(t,"keyboard");return}/^\d$/.test(e.key)&&i!=="meridiem"&&(e.preventDefault(),this._applyNumericInput(i,e.key))}}_registerWithForm(){this._formUnregister&&(this._formUnregister(),this._formUnregister=null);try{const s=this.getRootNode().host?.closest?.("ui-form")||null||this.closest("ui-form"),r=this.getAttribute("name");s&&typeof s.registerField=="function"&&r&&(this._formUnregister=s.registerField(r,{name:r,getValue:()=>this.value,setValue:a=>this._setValue(a?String(a):null,"form"),validate:async()=>this.hasAttribute("required")&&!this.value?{valid:!1,message:"Time is required"}:{valid:!0},setError:a=>{a?this.setAttribute("data-error",a):this.removeAttribute("data-error"),this._syncUi()}}))}catch{}}_onFocusIn(){this._shellEl?.setAttribute("data-focused","true")}_onFocusOut(e){this._shellEl?.contains(e.relatedTarget)||this._shellEl?.setAttribute("data-focused","false")}_syncUi(){if(!this._segmentsEl||!this._shellEl||!this._errorEl)return;const e=this.root.activeElement,i=!!e&&this._segmentsEl.contains(e),t=(this.getAttribute("label")||"").trim(),s=(this.getAttribute("description")||"").trim(),r=(this.getAttribute("data-error")||"").trim(),a=this.root.querySelector(".meta"),d=this.root.querySelector(".label"),k=this.root.querySelector(".label-text"),w=this.root.querySelector(".required"),f=this.root.querySelector(".description"),y=`${this._uid}-label`,v=`${this._uid}-description`,x=`${this._uid}-error`;a.hidden=!t&&!s,d.hidden=!t,d.id=t?y:"",k.textContent=t,w.hidden=!this.hasAttribute("required"),f.hidden=!s,f.id=s?v:"",f.textContent=s,this._errorEl.hidden=!r,this._errorEl.id=r?x:"",this._errorEl.textContent=r,this._shellEl.setAttribute("data-invalid",r?"true":"false"),this._shellEl.setAttribute("role","group"),t?this._shellEl.setAttribute("aria-labelledby",y):this._shellEl.removeAttribute("aria-labelledby");const S=[s?v:null,r?x:null].filter(Boolean).join(" ");S?this._shellEl.setAttribute("aria-describedby",S):this._shellEl.removeAttribute("aria-describedby"),this._shellEl.setAttribute("aria-invalid",r?"true":"false"),this._shellEl.setAttribute("aria-required",this.hasAttribute("required")?"true":"false"),this._shellEl.setAttribute("aria-disabled",this.hasAttribute("disabled")?"true":"false"),this._shellEl.setAttribute("aria-readonly",this.hasAttribute("readonly")?"true":"false");const u=b(this._value,this._showSeconds()),F=this._order(),_=[];this._segmentButtons.clear();const A=u?p(u):null;if(F.forEach((o,M)=>{if(M>0){const h=document.createElement("span");h.className="literal",h.textContent=o==="meridiem"?" ":":",_.push(h)}const n=document.createElement("button");if(n.type="button",n.className="segment",n.setAttribute("data-segment",o),n.setAttribute("data-active",this._activeSegment===o?"true":"false"),n.setAttribute("data-empty",u?"false":"true"),n.setAttribute("aria-label",o==="hour"?"Hour":o==="minute"?"Minute":o==="second"?"Second":"AM or PM"),n.tabIndex=this._activeSegment===o?0:-1,n.disabled=this.hasAttribute("disabled"),n.addEventListener("click",this._onSegmentClick),n.addEventListener("keydown",this._onSegmentKeyDown),!u)n.textContent=V(o);else if(o==="hour"){const h=this._is12h()?A.hour:u.hours;n.textContent=String(h).padStart(2,"0")}else o==="minute"?n.textContent=String(u.minutes).padStart(2,"0"):o==="second"?n.textContent=String(u.seconds).padStart(2,"0"):n.textContent=A.meridiem;this._segmentButtons.set(o,n),_.push(n)}),this._segmentsEl.replaceChildren(..._),i){const o=this._segmentButtons.get(this._activeSegment);try{o?.focus({preventScroll:!0})}catch{o?.focus()}}}};g.formAssociated=!0;let m=g;typeof customElements<"u"&&!customElements.get("ui-time-field")&&customElements.define("ui-time-field",m);exports.UITimeField=m;
@@ -1,10 +1,7 @@
1
- import { E as M } from "./ElementBase-909688f3.mjs";
2
- import { q as A, u as x, v as T } from "./date-time-utils-a2c7af25.mjs";
3
- import "./calendar-2c11b824.mjs";
4
- import "./scroll-lock-31da444f.mjs";
5
- import "./positioner-e9770c66.mjs";
6
- let V = 0;
7
- const B = `
1
+ import { E as V } from "./ElementBase-YlTLMsGk.mjs";
2
+ import { q as k, u as A, v as B } from "./date-time-utils-y1N2gvG2.mjs";
3
+ let T = 0;
4
+ const I = `
8
5
  :host {
9
6
  --ui-time-field-border-color: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 78%, transparent);
10
7
  --ui-time-field-border: 1px solid var(--ui-time-field-border-color);
@@ -135,20 +132,20 @@ const B = `
135
132
  }
136
133
  `;
137
134
  function f(l, e) {
138
- return A(l || "", !0) || null;
135
+ return k(l || "") || null;
139
136
  }
140
137
  function _(l) {
141
138
  return { hour: l.hours % 12 || 12, meridiem: l.hours >= 12 ? "PM" : "AM" };
142
139
  }
143
- function S(l, e) {
140
+ function E(l, e) {
144
141
  return e === "AM" ? l === 12 ? 0 : l : l === 12 ? 12 : l + 12;
145
142
  }
146
- function I(l) {
143
+ function q(l) {
147
144
  return l === "meridiem" ? "AM" : l === "hour" ? "HH" : l === "minute" ? "MM" : "SS";
148
145
  }
149
- class E extends M {
146
+ const p = class p extends V {
150
147
  constructor() {
151
- super(), this._value = null, this._activeSegment = "hour", this._segmentButtons = /* @__PURE__ */ new Map(), this._segmentsEl = null, this._shellEl = null, this._errorEl = null, this._formUnregister = null, this._bufferBySegment = { hour: "", minute: "", second: "" }, this._bufferTimer = null, this._internals = null, this._uid = `ui-time-field-${++V}`, this._defaultValue = null;
148
+ super(), this._value = null, this._activeSegment = "hour", this._segmentButtons = /* @__PURE__ */ new Map(), this._segmentsEl = null, this._shellEl = null, this._errorEl = null, this._formUnregister = null, this._bufferBySegment = { hour: "", minute: "", second: "" }, this._bufferTimer = null, this._internals = null, this._uid = `ui-time-field-${++T}`, this._defaultValue = null;
152
149
  try {
153
150
  this._internals = typeof this.attachInternals == "function" ? this.attachInternals() : null;
154
151
  } catch {
@@ -184,9 +181,8 @@ class E extends M {
184
181
  return !1;
185
182
  }
186
183
  render() {
187
- var e, i;
188
184
  this.setContent(`
189
- <style>${B}</style>
185
+ <style>${I}</style>
190
186
  <div class="root">
191
187
  <div class="meta" hidden>
192
188
  <div class="label" hidden><span class="label-text"></span><span class="required" hidden>*</span></div>
@@ -197,7 +193,7 @@ class E extends M {
197
193
  </div>
198
194
  <div class="error" part="error" hidden></div>
199
195
  </div>
200
- `), this._segmentsEl = this.root.querySelector(".segments"), this._shellEl = this.root.querySelector(".shell"), this._errorEl = this.root.querySelector(".error"), (e = this._shellEl) == null || e.addEventListener("focusin", this._onFocusIn), (i = this._shellEl) == null || i.addEventListener("focusout", this._onFocusOut), this._value = this._normalizeTimeValue(this.getAttribute("value")), this._syncFormValue(), this._syncUi();
196
+ `), this._segmentsEl = this.root.querySelector(".segments"), this._shellEl = this.root.querySelector(".shell"), this._errorEl = this.root.querySelector(".error"), this._shellEl?.addEventListener("focusin", this._onFocusIn), this._shellEl?.addEventListener("focusout", this._onFocusOut), this._value = this._normalizeTimeValue(this.getAttribute("value")), this._syncFormValue(), this._syncUi();
201
197
  }
202
198
  _showSeconds() {
203
199
  return this.hasAttribute("seconds");
@@ -206,11 +202,10 @@ class E extends M {
206
202
  return (this.getAttribute("format") || "").toLowerCase() === "12h";
207
203
  }
208
204
  _normalizeTimeValue(e) {
209
- const i = A(e || "", !0);
210
- if (!i)
211
- return null;
212
- const t = x(i, this._showSeconds()), r = this.getAttribute("min"), s = this.getAttribute("max");
213
- return T(t, r, s);
205
+ const i = k(e || "");
206
+ if (!i) return null;
207
+ const t = A(i, this._showSeconds()), s = this.getAttribute("min"), r = this.getAttribute("max");
208
+ return B(t, s, r);
214
209
  }
215
210
  _partsOrFallback() {
216
211
  return f(this._value, this._showSeconds()) || f(this.getAttribute("min"), this._showSeconds()) || { hours: 9, minutes: 0, seconds: 0 };
@@ -220,12 +215,11 @@ class E extends M {
220
215
  return this._showSeconds() && e.push("second"), this._is12h() && e.push("meridiem"), e;
221
216
  }
222
217
  _focusSegment(e) {
223
- var i;
224
- this._activeSegment = e, this._syncUi(), (i = this._segmentButtons.get(e)) == null || i.focus();
218
+ this._activeSegment = e, this._syncUi(), this._segmentButtons.get(e)?.focus();
225
219
  }
226
220
  _moveSegmentFocus(e) {
227
- const i = this._order(), t = i.indexOf(this._activeSegment), r = i[(t + e + i.length) % i.length];
228
- this._focusSegment(r);
221
+ const i = this._order(), t = i.indexOf(this._activeSegment), s = i[(t + e + i.length) % i.length];
222
+ this._focusSegment(s);
229
223
  }
230
224
  _setBuffer(e, i) {
231
225
  this._bufferBySegment[e] = i, this._bufferTimer != null && window.clearTimeout(this._bufferTimer), this._bufferTimer = window.setTimeout(() => {
@@ -233,7 +227,7 @@ class E extends M {
233
227
  }, 900);
234
228
  }
235
229
  _applyParts(e, i) {
236
- const t = this._normalizeTimeValue(x(e, this._showSeconds()));
230
+ const t = this._normalizeTimeValue(A(e, this._showSeconds()));
237
231
  this._setValue(t, i);
238
232
  }
239
233
  _setValue(e, i) {
@@ -242,19 +236,18 @@ class E extends M {
242
236
  this._syncFormValue(), this._syncUi();
243
237
  return;
244
238
  }
245
- const r = this._value;
239
+ const s = this._value;
246
240
  this._value = t, t ? this.setAttribute("value", t) : this.removeAttribute("value"), this._syncFormValue(), this._syncUi(), this.dispatchEvent(
247
241
  new CustomEvent("change", {
248
- detail: { value: t, previousValue: r, source: i },
242
+ detail: { value: t, previousValue: s, source: i },
249
243
  bubbles: !0,
250
244
  composed: !0
251
245
  })
252
246
  );
253
247
  }
254
248
  _syncFormValue() {
255
- var e;
256
249
  try {
257
- (e = this._internals) == null || e.setFormValue(this.value || "");
250
+ this._internals?.setFormValue(this.value || "");
258
251
  } catch {
259
252
  }
260
253
  }
@@ -264,28 +257,26 @@ class E extends M {
264
257
  t.hours = (t.hours + 12) % 24, this._applyParts(t, "keyboard");
265
258
  return;
266
259
  }
267
- const u = (t.hours * 3600 + t.minutes * 60 + t.seconds + i * (e === "hour" ? 3600 : e === "minute" ? 60 : 1) + 86400) % 86400, a = {
268
- hours: Math.floor(u / 3600),
269
- minutes: Math.floor(u % 3600 / 60),
270
- seconds: u % 60
260
+ const a = (t.hours * 3600 + t.minutes * 60 + t.seconds + i * (e === "hour" ? 3600 : e === "minute" ? 60 : 1) + 86400) % 86400, h = {
261
+ hours: Math.floor(a / 3600),
262
+ minutes: Math.floor(a % 3600 / 60),
263
+ seconds: a % 60
271
264
  };
272
- this._applyParts(a, "keyboard");
265
+ this._applyParts(h, "keyboard");
273
266
  }
274
267
  _applyNumericInput(e, i) {
275
268
  const t = `${this._bufferBySegment[e]}${i}`.slice(-2);
276
- if (this._setBuffer(e, t), t.length < 2)
277
- return;
278
- const r = this._partsOrFallback(), s = Number(t);
279
- if (Number.isFinite(s)) {
269
+ if (this._setBuffer(e, t), t.length < 2) return;
270
+ const s = this._partsOrFallback(), r = Number(t);
271
+ if (Number.isFinite(r)) {
280
272
  if (e === "hour")
281
273
  if (this._is12h()) {
282
- const { meridiem: u } = _(r), a = Math.min(Math.max(s, 1), 12);
283
- r.hours = S(a, u);
274
+ const { meridiem: a } = _(s), h = Math.min(Math.max(r, 1), 12);
275
+ s.hours = E(h, a);
284
276
  } else
285
- r.hours = Math.min(Math.max(s, 0), 23);
286
- else
287
- e === "minute" ? r.minutes = Math.min(Math.max(s, 0), 59) : r.seconds = Math.min(Math.max(s, 0), 59);
288
- this._applyParts(r, "keyboard"), this._moveSegmentFocus(1);
277
+ s.hours = Math.min(Math.max(r, 0), 23);
278
+ else e === "minute" ? s.minutes = Math.min(Math.max(r, 0), 59) : s.seconds = Math.min(Math.max(r, 0), 59);
279
+ this._applyParts(s, "keyboard"), this._moveSegmentFocus(1);
289
280
  }
290
281
  }
291
282
  _onSegmentClick(e) {
@@ -293,8 +284,7 @@ class E extends M {
293
284
  i && this._focusSegment(i);
294
285
  }
295
286
  _onSegmentKeyDown(e) {
296
- if (this.hasAttribute("disabled") || this.hasAttribute("readonly"))
297
- return;
287
+ if (this.hasAttribute("disabled") || this.hasAttribute("readonly")) return;
298
288
  const i = e.currentTarget.getAttribute("data-segment");
299
289
  if (i) {
300
290
  if (e.key === "ArrowLeft") {
@@ -315,20 +305,19 @@ class E extends M {
315
305
  }
316
306
  if (i === "meridiem" && /^[ap]$/i.test(e.key)) {
317
307
  e.preventDefault();
318
- const t = this._partsOrFallback(), r = e.key.toLowerCase() === "a" ? "AM" : "PM", s = _(t).hour;
319
- t.hours = S(s, r), this._applyParts(t, "keyboard");
308
+ const t = this._partsOrFallback(), s = e.key.toLowerCase() === "a" ? "AM" : "PM", r = _(t).hour;
309
+ t.hours = E(r, s), this._applyParts(t, "keyboard");
320
310
  return;
321
311
  }
322
312
  /^\d$/.test(e.key) && i !== "meridiem" && (e.preventDefault(), this._applyNumericInput(i, e.key));
323
313
  }
324
314
  }
325
315
  _registerWithForm() {
326
- var e;
327
316
  this._formUnregister && (this._formUnregister(), this._formUnregister = null);
328
317
  try {
329
- const t = this.getRootNode().host, s = ((e = t == null ? void 0 : t.closest) == null ? void 0 : e.call(t, "ui-form")) || null || this.closest("ui-form"), u = this.getAttribute("name");
330
- s && typeof s.registerField == "function" && u && (this._formUnregister = s.registerField(u, {
331
- name: u,
318
+ const s = this.getRootNode().host?.closest?.("ui-form") || null || this.closest("ui-form"), r = this.getAttribute("name");
319
+ s && typeof s.registerField == "function" && r && (this._formUnregister = s.registerField(r, {
320
+ name: r,
332
321
  getValue: () => this.value,
333
322
  setValue: (a) => this._setValue(a ? String(a) : null, "form"),
334
323
  validate: async () => this.hasAttribute("required") && !this.value ? { valid: !1, message: "Time is required" } : { valid: !0 },
@@ -340,49 +329,46 @@ class E extends M {
340
329
  }
341
330
  }
342
331
  _onFocusIn() {
343
- var e;
344
- (e = this._shellEl) == null || e.setAttribute("data-focused", "true");
332
+ this._shellEl?.setAttribute("data-focused", "true");
345
333
  }
346
334
  _onFocusOut(e) {
347
- var i, t;
348
- (i = this._shellEl) != null && i.contains(e.relatedTarget) || (t = this._shellEl) == null || t.setAttribute("data-focused", "false");
335
+ this._shellEl?.contains(e.relatedTarget) || this._shellEl?.setAttribute("data-focused", "false");
349
336
  }
350
337
  _syncUi() {
351
- if (!this._segmentsEl || !this._shellEl || !this._errorEl)
352
- return;
353
- const e = this.root.activeElement, i = !!e && this._segmentsEl.contains(e), t = (this.getAttribute("label") || "").trim(), r = (this.getAttribute("description") || "").trim(), s = (this.getAttribute("data-error") || "").trim(), u = this.root.querySelector(".meta"), a = this.root.querySelector(".label"), k = this.root.querySelector(".label-text"), w = this.root.querySelector(".required"), c = this.root.querySelector(".description"), b = `${this._uid}-label`, p = `${this._uid}-description`, g = `${this._uid}-error`;
354
- u.hidden = !t && !r, a.hidden = !t, a.id = t ? b : "", k.textContent = t, w.hidden = !this.hasAttribute("required"), c.hidden = !r, c.id = r ? p : "", c.textContent = r, this._errorEl.hidden = !s, this._errorEl.id = s ? g : "", this._errorEl.textContent = s, this._shellEl.setAttribute("data-invalid", s ? "true" : "false"), this._shellEl.setAttribute("role", "group"), t ? this._shellEl.setAttribute("aria-labelledby", b) : this._shellEl.removeAttribute("aria-labelledby");
355
- const y = [r ? p : null, s ? g : null].filter(Boolean).join(" ");
356
- y ? this._shellEl.setAttribute("aria-describedby", y) : this._shellEl.removeAttribute("aria-describedby"), this._shellEl.setAttribute("aria-invalid", s ? "true" : "false"), this._shellEl.setAttribute("aria-required", this.hasAttribute("required") ? "true" : "false"), this._shellEl.setAttribute("aria-disabled", this.hasAttribute("disabled") ? "true" : "false"), this._shellEl.setAttribute("aria-readonly", this.hasAttribute("readonly") ? "true" : "false");
357
- const d = f(this._value, this._showSeconds()), F = this._order(), m = [];
338
+ if (!this._segmentsEl || !this._shellEl || !this._errorEl) return;
339
+ const e = this.root.activeElement, i = !!e && this._segmentsEl.contains(e), t = (this.getAttribute("label") || "").trim(), s = (this.getAttribute("description") || "").trim(), r = (this.getAttribute("data-error") || "").trim(), a = this.root.querySelector(".meta"), h = this.root.querySelector(".label"), w = this.root.querySelector(".label-text"), F = this.root.querySelector(".required"), c = this.root.querySelector(".description"), g = `${this._uid}-label`, y = `${this._uid}-description`, v = `${this._uid}-error`;
340
+ a.hidden = !t && !s, h.hidden = !t, h.id = t ? g : "", w.textContent = t, F.hidden = !this.hasAttribute("required"), c.hidden = !s, c.id = s ? y : "", c.textContent = s, this._errorEl.hidden = !r, this._errorEl.id = r ? v : "", this._errorEl.textContent = r, this._shellEl.setAttribute("data-invalid", r ? "true" : "false"), this._shellEl.setAttribute("role", "group"), t ? this._shellEl.setAttribute("aria-labelledby", g) : this._shellEl.removeAttribute("aria-labelledby");
341
+ const x = [s ? y : null, r ? v : null].filter(Boolean).join(" ");
342
+ x ? this._shellEl.setAttribute("aria-describedby", x) : this._shellEl.removeAttribute("aria-describedby"), this._shellEl.setAttribute("aria-invalid", r ? "true" : "false"), this._shellEl.setAttribute("aria-required", this.hasAttribute("required") ? "true" : "false"), this._shellEl.setAttribute("aria-disabled", this.hasAttribute("disabled") ? "true" : "false"), this._shellEl.setAttribute("aria-readonly", this.hasAttribute("readonly") ? "true" : "false");
343
+ const u = f(this._value, this._showSeconds()), C = this._order(), m = [];
358
344
  this._segmentButtons.clear();
359
- const v = d ? _(d) : null;
360
- if (F.forEach((o, C) => {
361
- if (C > 0) {
362
- const h = document.createElement("span");
363
- h.className = "literal", h.textContent = o === "meridiem" ? " " : ":", m.push(h);
345
+ const S = u ? _(u) : null;
346
+ if (C.forEach((n, M) => {
347
+ if (M > 0) {
348
+ const d = document.createElement("span");
349
+ d.className = "literal", d.textContent = n === "meridiem" ? " " : ":", m.push(d);
364
350
  }
365
- const n = document.createElement("button");
366
- if (n.type = "button", n.className = "segment", n.setAttribute("data-segment", o), n.setAttribute("data-active", this._activeSegment === o ? "true" : "false"), n.setAttribute("data-empty", d ? "false" : "true"), n.setAttribute("aria-label", o === "hour" ? "Hour" : o === "minute" ? "Minute" : o === "second" ? "Second" : "AM or PM"), n.tabIndex = this._activeSegment === o ? 0 : -1, n.disabled = this.hasAttribute("disabled"), n.addEventListener("click", this._onSegmentClick), n.addEventListener("keydown", this._onSegmentKeyDown), !d)
367
- n.textContent = I(o);
368
- else if (o === "hour") {
369
- const h = this._is12h() ? v.hour : d.hours;
370
- n.textContent = String(h).padStart(2, "0");
371
- } else
372
- o === "minute" ? n.textContent = String(d.minutes).padStart(2, "0") : o === "second" ? n.textContent = String(d.seconds).padStart(2, "0") : n.textContent = v.meridiem;
373
- this._segmentButtons.set(o, n), m.push(n);
351
+ const o = document.createElement("button");
352
+ if (o.type = "button", o.className = "segment", o.setAttribute("data-segment", n), o.setAttribute("data-active", this._activeSegment === n ? "true" : "false"), o.setAttribute("data-empty", u ? "false" : "true"), o.setAttribute("aria-label", n === "hour" ? "Hour" : n === "minute" ? "Minute" : n === "second" ? "Second" : "AM or PM"), o.tabIndex = this._activeSegment === n ? 0 : -1, o.disabled = this.hasAttribute("disabled"), o.addEventListener("click", this._onSegmentClick), o.addEventListener("keydown", this._onSegmentKeyDown), !u)
353
+ o.textContent = q(n);
354
+ else if (n === "hour") {
355
+ const d = this._is12h() ? S.hour : u.hours;
356
+ o.textContent = String(d).padStart(2, "0");
357
+ } else n === "minute" ? o.textContent = String(u.minutes).padStart(2, "0") : n === "second" ? o.textContent = String(u.seconds).padStart(2, "0") : o.textContent = S.meridiem;
358
+ this._segmentButtons.set(n, o), m.push(o);
374
359
  }), this._segmentsEl.replaceChildren(...m), i) {
375
- const o = this._segmentButtons.get(this._activeSegment);
360
+ const n = this._segmentButtons.get(this._activeSegment);
376
361
  try {
377
- o == null || o.focus({ preventScroll: !0 });
362
+ n?.focus({ preventScroll: !0 });
378
363
  } catch {
379
- o == null || o.focus();
364
+ n?.focus();
380
365
  }
381
366
  }
382
367
  }
383
- }
384
- E.formAssociated = !0;
385
- typeof customElements < "u" && !customElements.get("ui-time-field") && customElements.define("ui-time-field", E);
368
+ };
369
+ p.formAssociated = !0;
370
+ let b = p;
371
+ typeof customElements < "u" && !customElements.get("ui-time-field") && customElements.define("ui-time-field", b);
386
372
  export {
387
- E as UITimeField
373
+ b as UITimeField
388
374
  };