@vielzeug/refine 1.5.0 → 1.5.2

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 (246) hide show
  1. package/dist/async.cjs +9 -9
  2. package/dist/async.cjs.map +1 -1
  3. package/dist/async.js +30 -31
  4. package/dist/async.js.map +1 -1
  5. package/dist/button.cjs +6 -6
  6. package/dist/button.cjs.map +1 -1
  7. package/dist/button.js +29 -30
  8. package/dist/button.js.map +1 -1
  9. package/dist/calendar.cjs +44 -44
  10. package/dist/calendar.cjs.map +1 -1
  11. package/dist/calendar.js +115 -117
  12. package/dist/calendar.js.map +1 -1
  13. package/dist/checkbox-group.cjs +7 -7
  14. package/dist/checkbox-group.cjs.map +1 -1
  15. package/dist/checkbox-group.js +71 -73
  16. package/dist/checkbox-group.js.map +1 -1
  17. package/dist/checkbox.cjs +3 -3
  18. package/dist/checkbox.cjs.map +1 -1
  19. package/dist/checkbox.js +28 -29
  20. package/dist/checkbox.js.map +1 -1
  21. package/dist/code-window.cjs +7 -7
  22. package/dist/code-window.cjs.map +1 -1
  23. package/dist/code-window.js +17 -18
  24. package/dist/code-window.js.map +1 -1
  25. package/dist/combobox.cjs +1 -1
  26. package/dist/combobox.cjs.map +1 -1
  27. package/dist/combobox.js +11 -12
  28. package/dist/combobox.js.map +1 -1
  29. package/dist/custom-elements.json +3581 -3581
  30. package/dist/datagrid.cjs +66 -66
  31. package/dist/datagrid.cjs.map +1 -1
  32. package/dist/datagrid.js +267 -268
  33. package/dist/datagrid.js.map +1 -1
  34. package/dist/date-picker.cjs +11 -11
  35. package/dist/date-picker.cjs.map +1 -1
  36. package/dist/date-picker.js +8 -9
  37. package/dist/date-picker.js.map +1 -1
  38. package/dist/file-input.cjs +6 -6
  39. package/dist/file-input.cjs.map +1 -1
  40. package/dist/file-input.js +50 -51
  41. package/dist/file-input.js.map +1 -1
  42. package/dist/grid.cjs +1 -1
  43. package/dist/grid.cjs.map +1 -1
  44. package/dist/grid.js +47 -48
  45. package/dist/grid.js.map +1 -1
  46. package/dist/icon.cjs +1 -1
  47. package/dist/icon.cjs.map +1 -1
  48. package/dist/icon.js +26 -27
  49. package/dist/icon.js.map +1 -1
  50. package/dist/input.cjs +20 -20
  51. package/dist/input.cjs.map +1 -1
  52. package/dist/input.js +98 -100
  53. package/dist/input.js.map +1 -1
  54. package/dist/layout/navbar/navbar.css.cjs +1 -1
  55. package/dist/layout/navbar/navbar.css.cjs.map +1 -1
  56. package/dist/layout/navbar/navbar.css.js +1 -1
  57. package/dist/layout/navbar/navbar.css.js.map +1 -1
  58. package/dist/layout/navbar/navbar.d.ts +1 -0
  59. package/dist/layout/navbar/navbar.d.ts.map +1 -1
  60. package/dist/message-composer.cjs +18 -18
  61. package/dist/message-composer.cjs.map +1 -1
  62. package/dist/message-composer.js +113 -115
  63. package/dist/message-composer.js.map +1 -1
  64. package/dist/navbar.cjs +16 -13
  65. package/dist/navbar.cjs.map +1 -1
  66. package/dist/navbar.js +84 -79
  67. package/dist/navbar.js.map +1 -1
  68. package/dist/otp-input.cjs +4 -4
  69. package/dist/otp-input.cjs.map +1 -1
  70. package/dist/otp-input.js +31 -32
  71. package/dist/otp-input.js.map +1 -1
  72. package/dist/progress.cjs +13 -13
  73. package/dist/progress.cjs.map +1 -1
  74. package/dist/progress.js +45 -46
  75. package/dist/progress.js.map +1 -1
  76. package/dist/radio-group.cjs +5 -5
  77. package/dist/radio-group.cjs.map +1 -1
  78. package/dist/radio-group.js +83 -85
  79. package/dist/radio-group.js.map +1 -1
  80. package/dist/radio.cjs +3 -3
  81. package/dist/radio.cjs.map +1 -1
  82. package/dist/radio.js +27 -28
  83. package/dist/radio.js.map +1 -1
  84. package/dist/rating.cjs +4 -4
  85. package/dist/rating.cjs.map +1 -1
  86. package/dist/rating.js +30 -31
  87. package/dist/rating.js.map +1 -1
  88. package/dist/refine.cjs +8 -5
  89. package/dist/refine.cjs.map +1 -1
  90. package/dist/refine.iife.js +8 -5
  91. package/dist/refine.iife.js.map +1 -1
  92. package/dist/refine.js +8 -5
  93. package/dist/refine.js.map +1 -1
  94. package/dist/select.cjs +4 -4
  95. package/dist/select.cjs.map +1 -1
  96. package/dist/select.js +88 -89
  97. package/dist/select.js.map +1 -1
  98. package/dist/sidebar.cjs +11 -11
  99. package/dist/sidebar.cjs.map +1 -1
  100. package/dist/sidebar.js +97 -98
  101. package/dist/sidebar.js.map +1 -1
  102. package/dist/skeleton.cjs +3 -3
  103. package/dist/skeleton.cjs.map +1 -1
  104. package/dist/skeleton.js +23 -24
  105. package/dist/skeleton.js.map +1 -1
  106. package/dist/slider.cjs +3 -3
  107. package/dist/slider.cjs.map +1 -1
  108. package/dist/slider.js +65 -66
  109. package/dist/slider.js.map +1 -1
  110. package/dist/switch.cjs +3 -3
  111. package/dist/switch.cjs.map +1 -1
  112. package/dist/switch.js +23 -24
  113. package/dist/switch.js.map +1 -1
  114. package/dist/tab-panel.cjs +7 -7
  115. package/dist/tab-panel.cjs.map +1 -1
  116. package/dist/tab-panel.js +21 -23
  117. package/dist/tab-panel.js.map +1 -1
  118. package/dist/testing.cjs +1 -1
  119. package/dist/testing.cjs.map +1 -1
  120. package/dist/testing.js +4 -5
  121. package/dist/testing.js.map +1 -1
  122. package/dist/textarea.cjs +13 -13
  123. package/dist/textarea.cjs.map +1 -1
  124. package/dist/textarea.js +92 -94
  125. package/dist/textarea.js.map +1 -1
  126. package/dist/time-picker.cjs +9 -9
  127. package/dist/time-picker.cjs.map +1 -1
  128. package/dist/time-picker.js +47 -48
  129. package/dist/time-picker.js.map +1 -1
  130. package/package.json +1 -1
  131. package/dist/ore/dist/_dev.cjs +0 -2
  132. package/dist/ore/dist/_dev.cjs.map +0 -1
  133. package/dist/ore/dist/_dev.js +0 -12
  134. package/dist/ore/dist/_dev.js.map +0 -1
  135. package/dist/ore/dist/base-element.cjs +0 -2
  136. package/dist/ore/dist/base-element.cjs.map +0 -1
  137. package/dist/ore/dist/base-element.js +0 -158
  138. package/dist/ore/dist/base-element.js.map +0 -1
  139. package/dist/ore/dist/context.cjs +0 -2
  140. package/dist/ore/dist/context.cjs.map +0 -1
  141. package/dist/ore/dist/context.js +0 -11
  142. package/dist/ore/dist/context.js.map +0 -1
  143. package/dist/ore/dist/define.cjs +0 -2
  144. package/dist/ore/dist/define.cjs.map +0 -1
  145. package/dist/ore/dist/define.js +0 -27
  146. package/dist/ore/dist/define.js.map +0 -1
  147. package/dist/ore/dist/directives/classMap.cjs +0 -1
  148. package/dist/ore/dist/directives/classMap.js +0 -1
  149. package/dist/ore/dist/directives/each.cjs +0 -1
  150. package/dist/ore/dist/directives/each.js +0 -5
  151. package/dist/ore/dist/directives/live.cjs +0 -2
  152. package/dist/ore/dist/directives/live.cjs.map +0 -1
  153. package/dist/ore/dist/directives/live.js +0 -6
  154. package/dist/ore/dist/directives/live.js.map +0 -1
  155. package/dist/ore/dist/directives/model.cjs +0 -1
  156. package/dist/ore/dist/directives/model.js +0 -3
  157. package/dist/ore/dist/directives/raw.cjs +0 -2
  158. package/dist/ore/dist/directives/raw.cjs.map +0 -1
  159. package/dist/ore/dist/directives/raw.js +0 -38
  160. package/dist/ore/dist/directives/raw.js.map +0 -1
  161. package/dist/ore/dist/directives/styleMap.cjs +0 -2
  162. package/dist/ore/dist/directives/styleMap.cjs.map +0 -1
  163. package/dist/ore/dist/directives/styleMap.js +0 -20
  164. package/dist/ore/dist/directives/styleMap.js.map +0 -1
  165. package/dist/ore/dist/directives/when.cjs +0 -2
  166. package/dist/ore/dist/directives/when.cjs.map +0 -1
  167. package/dist/ore/dist/directives/when.js +0 -38
  168. package/dist/ore/dist/directives/when.js.map +0 -1
  169. package/dist/ore/dist/directives.cjs +0 -1
  170. package/dist/ore/dist/directives.js +0 -8
  171. package/dist/ore/dist/errors.cjs +0 -3
  172. package/dist/ore/dist/errors.cjs.map +0 -1
  173. package/dist/ore/dist/errors.js +0 -50
  174. package/dist/ore/dist/errors.js.map +0 -1
  175. package/dist/ore/dist/forms/context.cjs +0 -2
  176. package/dist/ore/dist/forms/context.cjs.map +0 -1
  177. package/dist/ore/dist/forms/context.js +0 -6
  178. package/dist/ore/dist/forms/context.js.map +0 -1
  179. package/dist/ore/dist/forms/field.cjs +0 -2
  180. package/dist/ore/dist/forms/field.cjs.map +0 -1
  181. package/dist/ore/dist/forms/field.js +0 -42
  182. package/dist/ore/dist/forms/field.js.map +0 -1
  183. package/dist/ore/dist/forms.cjs +0 -1
  184. package/dist/ore/dist/forms.js +0 -3
  185. package/dist/ore/dist/observers/intersection-observe.cjs +0 -2
  186. package/dist/ore/dist/observers/intersection-observe.cjs.map +0 -1
  187. package/dist/ore/dist/observers/intersection-observe.js +0 -12
  188. package/dist/ore/dist/observers/intersection-observe.js.map +0 -1
  189. package/dist/ore/dist/observers/media-observe.cjs +0 -1
  190. package/dist/ore/dist/observers/media-observe.js +0 -1
  191. package/dist/ore/dist/observers/mutation-observe.cjs +0 -1
  192. package/dist/ore/dist/observers/mutation-observe.js +0 -1
  193. package/dist/ore/dist/observers/resize-observe.cjs +0 -2
  194. package/dist/ore/dist/observers/resize-observe.cjs.map +0 -1
  195. package/dist/ore/dist/observers/resize-observe.js +0 -20
  196. package/dist/ore/dist/observers/resize-observe.js.map +0 -1
  197. package/dist/ore/dist/observers.cjs +0 -1
  198. package/dist/ore/dist/observers.js +0 -5
  199. package/dist/ore/dist/props.cjs +0 -2
  200. package/dist/ore/dist/props.cjs.map +0 -1
  201. package/dist/ore/dist/props.js +0 -56
  202. package/dist/ore/dist/props.js.map +0 -1
  203. package/dist/ore/dist/runtime.cjs +0 -2
  204. package/dist/ore/dist/runtime.cjs.map +0 -1
  205. package/dist/ore/dist/runtime.js +0 -25
  206. package/dist/ore/dist/runtime.js.map +0 -1
  207. package/dist/ore/dist/testing/flush.cjs +0 -2
  208. package/dist/ore/dist/testing/flush.cjs.map +0 -1
  209. package/dist/ore/dist/testing/flush.js +0 -11
  210. package/dist/ore/dist/testing/flush.js.map +0 -1
  211. package/dist/ore/dist/testing/mount.cjs +0 -2
  212. package/dist/ore/dist/testing/mount.cjs.map +0 -1
  213. package/dist/ore/dist/testing/mount.js +0 -94
  214. package/dist/ore/dist/testing/mount.js.map +0 -1
  215. package/dist/ore/dist/testing/query.cjs +0 -2
  216. package/dist/ore/dist/testing/query.cjs.map +0 -1
  217. package/dist/ore/dist/testing/query.js +0 -12
  218. package/dist/ore/dist/testing/query.js.map +0 -1
  219. package/dist/ore/dist/testing/render-hook.cjs +0 -1
  220. package/dist/ore/dist/testing/render-hook.js +0 -3
  221. package/dist/ore/dist/testing/testing.cjs +0 -1
  222. package/dist/ore/dist/testing/testing.js +0 -4
  223. package/dist/ore/dist/testing/wait.cjs +0 -1
  224. package/dist/ore/dist/testing/wait.js +0 -1
  225. package/dist/ore/dist/testing.cjs +0 -1
  226. package/dist/ore/dist/testing.js +0 -6
  227. package/dist/ore/dist/types/bindings.cjs +0 -2
  228. package/dist/ore/dist/types/bindings.cjs.map +0 -1
  229. package/dist/ore/dist/types/bindings.js +0 -15
  230. package/dist/ore/dist/types/bindings.js.map +0 -1
  231. package/dist/ore/dist/types.cjs +0 -2
  232. package/dist/ore/dist/types.cjs.map +0 -1
  233. package/dist/ore/dist/types.js +0 -15
  234. package/dist/ore/dist/types.js.map +0 -1
  235. package/dist/ore/dist/utils/css.cjs +0 -2
  236. package/dist/ore/dist/utils/css.cjs.map +0 -1
  237. package/dist/ore/dist/utils/css.js +0 -18
  238. package/dist/ore/dist/utils/css.js.map +0 -1
  239. package/dist/ore/dist/utils/dom.cjs +0 -2
  240. package/dist/ore/dist/utils/dom.cjs.map +0 -1
  241. package/dist/ore/dist/utils/dom.js +0 -43
  242. package/dist/ore/dist/utils/dom.js.map +0 -1
  243. package/dist/ore/dist/utils/id.cjs +0 -2
  244. package/dist/ore/dist/utils/id.cjs.map +0 -1
  245. package/dist/ore/dist/utils/id.js +0 -4
  246. package/dist/ore/dist/utils/id.js.map +0 -1
@@ -1,12 +1,11 @@
1
1
  import { reducedMotionMixin as e } from "./styles/mixins/accessibility.css.js";
2
2
  import { colorThemeMixin as t } from "./styles/mixins/theme.css.js";
3
3
  import { disablableBundle as n, roundableBundle as r, sizableBundle as i, themableBundle as a } from "./shared/prop-bundles.js";
4
- import { useField as o } from "./ore/dist/forms/field.js";
5
- import "./ore/dist/forms.js";
6
- import { FORM_CTX as s, useFormContext as c } from "./inputs/shared/form-context.js";
7
- import l from "./inputs/time-picker/time-picker.css.js";
8
- import { bind as u, define as d, getHost as f, html as p, inject as m, onMounted as h, prop as g, useEmit as _ } from "@vielzeug/ore";
9
- import { computed as v, signal as y } from "@vielzeug/ripple";
4
+ import { FORM_CTX as o, useFormContext as s } from "./inputs/shared/form-context.js";
5
+ import c from "./inputs/time-picker/time-picker.css.js";
6
+ import { bind as l, define as u, getHost as d, html as f, inject as p, onMounted as m, prop as h, useEmit as g } from "@vielzeug/ore";
7
+ import { computed as _, signal as v } from "@vielzeug/ripple";
8
+ import { useField as y } from "@vielzeug/ore/forms";
10
9
  //#region src/inputs/time-picker/time-picker.ts
11
10
  function b(e) {
12
11
  if (!e) return null;
@@ -36,57 +35,57 @@ function C(e, t, n, r) {
36
35
  };
37
36
  }
38
37
  var w = "ore-time-picker";
39
- d(w, {
38
+ u(w, {
40
39
  formAssociated: !0,
41
40
  props: {
42
41
  ...a,
43
42
  ...i,
44
43
  ...n,
45
44
  ...r,
46
- error: g.string(),
47
- fullwidth: g.bool(!1),
48
- helper: g.string(),
49
- label: g.string(),
50
- "label-placement": g.oneOf(["inset", "outside"], "inset"),
51
- max: g.string(),
52
- min: g.string(),
53
- "minute-step": g.number(5),
54
- name: g.string(),
55
- placeholder: g.string(),
56
- required: g.bool(!1),
57
- "time-format": g.oneOf(["12", "24"], "24"),
58
- value: g.string(),
59
- variant: g.string()
45
+ error: h.string(),
46
+ fullwidth: h.bool(!1),
47
+ helper: h.string(),
48
+ label: h.string(),
49
+ "label-placement": h.oneOf(["inset", "outside"], "inset"),
50
+ max: h.string(),
51
+ min: h.string(),
52
+ "minute-step": h.number(5),
53
+ name: h.string(),
54
+ placeholder: h.string(),
55
+ required: h.bool(!1),
56
+ "time-format": h.oneOf(["12", "24"], "24"),
57
+ value: h.string(),
58
+ variant: h.string()
60
59
  },
61
60
  setup(e) {
62
- let t = f(), n = _(), r = y(!1), i = y(b(e.value.value)), a = c(e, m(s)), l = a.disabled;
63
- o({
64
- disabled: l,
61
+ let t = d(), n = g(), r = v(!1), i = v(b(e.value.value)), a = s(e, p(o)), c = a.disabled;
62
+ y({
63
+ disabled: c,
65
64
  toFormValue: (e) => e || null,
66
- value: v(() => {
65
+ value: _(() => {
67
66
  let e = i.value;
68
67
  return e ? x(e.hours, e.minutes) : "";
69
68
  })
70
69
  });
71
- let d = v(() => e["time-format"].value ?? "24"), g = v(() => Math.max(1, Math.min(59, e["minute-step"].value ?? 5))), w = v(() => i.value ? S(i.value.hours, i.value.minutes, d.value) : e.placeholder.value || ""), T = v(() => d.value === "12" ? Array.from({ length: 12 }, (e, t) => t + 1) : Array.from({ length: 24 }, (e, t) => t)), E = v(() => {
72
- let e = g.value, t = [];
70
+ let u = _(() => e["time-format"].value ?? "24"), h = _(() => Math.max(1, Math.min(59, e["minute-step"].value ?? 5))), w = _(() => i.value ? S(i.value.hours, i.value.minutes, u.value) : e.placeholder.value || ""), T = _(() => u.value === "12" ? Array.from({ length: 12 }, (e, t) => t + 1) : Array.from({ length: 24 }, (e, t) => t)), E = _(() => {
71
+ let e = h.value, t = [];
73
72
  for (let n = 0; n < 60; n += e) t.push(n);
74
73
  return t;
75
74
  }), D = `time-picker-${Math.random().toString(36).slice(2, 9)}-dropdown`;
76
75
  function O(e) {
77
- if (d.value === "24") return e;
76
+ if (u.value === "24") return e;
78
77
  let t = e % 12;
79
78
  return t === 0 ? 12 : t;
80
79
  }
81
80
  function k(e, t) {
82
- return d.value === "24" ? e : t === "AM" ? e === 12 ? 0 : e : e === 12 ? 12 : e + 12;
81
+ return u.value === "24" ? e : t === "AM" ? e === 12 ? 0 : e : e === 12 ? 12 : e + 12;
83
82
  }
84
83
  function A(t, n) {
85
84
  let r = t * 60 + n, i = b(e.min.value), a = b(e.max.value);
86
85
  return !!(i && r < i.hours * 60 + i.minutes || a && r > a.hours * 60 + a.minutes);
87
86
  }
88
- let j = y(i.value?.hours ?? 0), M = y(i.value?.minutes ?? 0), N = y((i.value?.hours ?? 0) >= 12 ? "PM" : "AM"), P = e.value.value;
89
- h(() => {
87
+ let j = v(i.value?.hours ?? 0), M = v(i.value?.minutes ?? 0), N = v((i.value?.hours ?? 0) >= 12 ? "PM" : "AM"), P = e.value.value;
88
+ m(() => {
90
89
  let t = setInterval(() => {
91
90
  let t = e.value.value;
92
91
  if (t !== P) {
@@ -98,20 +97,20 @@ d(w, {
98
97
  return () => clearInterval(t);
99
98
  });
100
99
  function F(t, r) {
101
- let a = C(t, r, e.min.value, e.max.value), o = Math.round(a.minutes / g.value) * g.value, s = Math.min(o, 59);
100
+ let a = C(t, r, e.min.value, e.max.value), o = Math.round(a.minutes / h.value) * h.value, s = Math.min(o, 59);
102
101
  i.value = {
103
102
  hours: a.hours,
104
103
  minutes: s
105
104
  }, n("change", { value: x(a.hours, s) });
106
105
  }
107
106
  function I(e) {
108
- let t = d.value === "12" ? k(j.value, N.value) : j.value;
107
+ let t = u.value === "12" ? k(j.value, N.value) : j.value;
109
108
  M.value = e, F(t, e), R();
110
109
  }
111
110
  function L() {
112
- if (l.value) return;
111
+ if (c.value) return;
113
112
  let e = i.value;
114
- e ? (j.value = d.value === "12" ? O(e.hours) : e.hours, M.value = e.minutes, N.value = e.hours >= 12 ? "PM" : "AM") : (j.value = d.value === "12" ? 12 : 0, M.value = 0, N.value = "AM"), r.value = !0;
113
+ e ? (j.value = u.value === "12" ? O(e.hours) : e.hours, M.value = e.minutes, N.value = e.hours >= 12 ? "PM" : "AM") : (j.value = u.value === "12" ? 12 : 0, M.value = 0, N.value = "AM"), r.value = !0;
115
114
  }
116
115
  function R() {
117
116
  r.value = !1;
@@ -122,9 +121,9 @@ d(w, {
122
121
  function B(e) {
123
122
  r.value && (e.composedPath().includes(t) || R());
124
123
  }
125
- h(() => (document.addEventListener("pointerdown", B, { capture: !0 }), () => document.removeEventListener("pointerdown", B, { capture: !0 })));
124
+ m(() => (document.addEventListener("pointerdown", B, { capture: !0 }), () => document.removeEventListener("pointerdown", B, { capture: !0 })));
126
125
  function V(e) {
127
- l.value || (e.key === "Enter" || e.key === " " ? (e.preventDefault(), z()) : e.key === "Escape" && r.value ? (e.preventDefault(), R()) : (e.key === "ArrowDown" || e.key === "ArrowUp") && !r.value && (e.preventDefault(), L()));
126
+ c.value || (e.key === "Enter" || e.key === " " ? (e.preventDefault(), z()) : e.key === "Escape" && r.value ? (e.preventDefault(), R()) : (e.key === "ArrowDown" || e.key === "ArrowUp") && !r.value && (e.preventDefault(), L()));
128
127
  }
129
128
  function H(e) {
130
129
  e.key === "Escape" && (e.preventDefault(), R());
@@ -140,7 +139,7 @@ d(w, {
140
139
  function G(e) {
141
140
  (e.key === "ArrowUp" || e.key === "ArrowDown") && (e.preventDefault(), N.value = N.value === "AM" ? "PM" : "AM");
142
141
  }
143
- return u({ attr: { open: () => r.value ? !0 : void 0 } }), p`
142
+ return l({ attr: { open: () => r.value ? !0 : void 0 } }), f`
144
143
  <!-- Trigger -->
145
144
  <ore-input
146
145
  class="trigger"
@@ -150,7 +149,7 @@ d(w, {
150
149
  aria-haspopup="listbox"
151
150
  aria-controls="${D}"
152
151
  :aria-expanded="${() => String(r.value)}"
153
- :aria-disabled="${() => l.value ? "true" : null}"
152
+ :aria-disabled="${() => c.value ? "true" : null}"
154
153
  :value="${() => w.value}"
155
154
  :label="${() => e.label.value ?? ""}"
156
155
  :placeholder="${() => e.placeholder.value ?? ""}"
@@ -161,7 +160,7 @@ d(w, {
161
160
  :rounded="${() => e.rounded?.value ?? void 0}"
162
161
  :helper="${() => e.helper.value ?? ""}"
163
162
  :error="${() => e.error.value ?? ""}"
164
- ?disabled="${() => l.value ? !0 : void 0}"
163
+ ?disabled="${() => c.value ? !0 : void 0}"
165
164
  ?required="${() => e.required.value ? !0 : void 0}"
166
165
  ?fullwidth="${() => e.fullwidth.value ? !0 : void 0}"
167
166
  @click="${z}"
@@ -183,8 +182,8 @@ d(w, {
183
182
  <div class="col-label" aria-hidden="true">HH</div>
184
183
  <div class="col-scroll">
185
184
  ${() => T.value.map((e) => {
186
- let t = A(d.value === "12" ? k(e, N.value) : e, M.value);
187
- return p`<div
185
+ let t = A(u.value === "12" ? k(e, N.value) : e, M.value);
186
+ return f`<div
188
187
  class="option"
189
188
  part="option"
190
189
  role="option"
@@ -209,8 +208,8 @@ d(w, {
209
208
  <div class="col-label" aria-hidden="true">MM</div>
210
209
  <div class="col-scroll">
211
210
  ${() => E.value.map((e) => {
212
- let t = A(d.value === "12" ? k(j.value, N.value) : j.value, e);
213
- return p`<div
211
+ let t = A(u.value === "12" ? k(j.value, N.value) : j.value, e);
212
+ return f`<div
214
213
  class="option"
215
214
  part="option"
216
215
  role="option"
@@ -229,10 +228,10 @@ d(w, {
229
228
  </div>
230
229
 
231
230
  <!-- AM/PM column (12h mode only) -->
232
- ${() => d.value === "12" ? p` <div class="col col-period" part="column" role="group" aria-label="Period">
231
+ ${() => u.value === "12" ? f` <div class="col col-period" part="column" role="group" aria-label="Period">
233
232
  <div class="col-label" aria-hidden="true">AM/PM</div>
234
233
  <div class="col-scroll">
235
- ${["AM", "PM"].map((e) => p`<div
234
+ ${["AM", "PM"].map((e) => f`<div
236
235
  class="option"
237
236
  part="option"
238
237
  role="option"
@@ -245,7 +244,7 @@ d(w, {
245
244
  ${e}
246
245
  </div>`)}
247
246
  </div>
248
- </div>` : p``}
247
+ </div>` : f``}
249
248
  </div>
250
249
  </div>
251
250
  `;
@@ -254,7 +253,7 @@ d(w, {
254
253
  styles: [
255
254
  t,
256
255
  e,
257
- l
256
+ c
258
257
  ]
259
258
  });
260
259
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"time-picker.js","names":[],"sources":["../src/inputs/time-picker/time-picker.ts"],"sourcesContent":["import { define, html, inject, prop, bind, getHost, onMounted, useEmit } from '@vielzeug/ore';\nimport { useField } from '@vielzeug/ore/forms';\nimport { computed, signal } from '@vielzeug/ripple';\n\nimport type { VisualVariant } from '../../shared';\n\nimport '../../content/icon/icon';\nimport '../input/input';\nimport { disablableBundle, roundableBundle, sizableBundle, themableBundle } from '../../shared';\nimport { colorThemeMixin, reducedMotionMixin } from '../../styles';\nimport { FORM_CTX, useFormContext } from '../shared/form-context';\nimport componentStyles from './time-picker.css?inline';\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport type OreTimePickerEvents = {\n change: { value: string | null };\n};\n\nexport type OreTimePickerProps = {\n /** Theme color */\n color?: string;\n /** Disable the picker */\n disabled?: boolean;\n /** Validation error message */\n error?: string;\n /** Expand to container width */\n fullwidth?: boolean;\n /** Helper text below the field */\n helper?: string;\n /** Visible label */\n label?: string;\n /** Label placement */\n 'label-placement'?: 'inset' | 'outside';\n /** Maximum selectable time in HH:MM format (24-hour) */\n max?: string;\n /** Minimum selectable time in HH:MM format (24-hour) */\n min?: string;\n /** Minute step interval (1–59) */\n 'minute-step'?: number;\n /** Form field name */\n name?: string;\n /** Placeholder shown in the trigger */\n placeholder?: string;\n /** Mark field as required */\n required?: boolean;\n /** Border radius */\n rounded?: string;\n /** Component size */\n size?: string;\n /** Display format: '12' for AM/PM, '24' for 24-hour (default: '24') */\n 'time-format'?: '12' | '24';\n /** Selected time in HH:MM format (24-hour) */\n value?: string;\n /** Visual variant */\n variant?: Exclude<VisualVariant, 'text' | 'frost'>;\n};\n\n// ── Helpers ───────────────────────────────────────────────────────────────────\n\n/** Parse \"HH:MM\" → { hours: 0-23, minutes: 0-59 } | null */\nfunction parseTime(val: string | undefined | null): { hours: number; minutes: number } | null {\n if (!val) return null;\n\n const match = /^(\\d{1,2}):(\\d{2})$/.exec(val.trim());\n\n if (!match) return null;\n\n const h = Number(match[1]);\n const m = Number(match[2]);\n\n if (h < 0 || h > 23 || m < 0 || m > 59) return null;\n\n return { hours: h, minutes: m };\n}\n\n/** Format { hours, minutes } → \"HH:MM\" (24-hour, zero-padded) */\nfunction formatTime(h: number, m: number): string {\n return `${String(h).padStart(2, '0')}:${String(m).padStart(2, '0')}`;\n}\n\n/** Format for display label (respects 12/24 mode) */\nfunction formatDisplay(h: number, m: number, format: '12' | '24'): string {\n if (format === '12') {\n const period = h >= 12 ? 'PM' : 'AM';\n const displayH = h % 12 === 0 ? 12 : h % 12;\n\n return `${String(displayH).padStart(2, '0')}:${String(m).padStart(2, '0')} ${period}`;\n }\n\n return formatTime(h, m);\n}\n\n/** Clamp value to [min, max] in total minutes */\nfunction clampTime(\n h: number,\n m: number,\n minVal: string | undefined | null,\n maxVal: string | undefined | null,\n): { hours: number; minutes: number } {\n const total = h * 60 + m;\n const minParsed = parseTime(minVal);\n const maxParsed = parseTime(maxVal);\n const minMins = minParsed ? minParsed.hours * 60 + minParsed.minutes : 0;\n const maxMins = maxParsed ? maxParsed.hours * 60 + maxParsed.minutes : 23 * 60 + 59;\n const clamped = Math.min(Math.max(total, minMins), maxMins);\n\n return { hours: Math.floor(clamped / 60), minutes: clamped % 60 };\n}\n\n/**\n * An accessible time picker with a scrollable clock dropdown.\n * Supports 12/24-hour display formats, min/max bounds, minute steps, and form association.\n *\n * @element ore-time-picker\n *\n * @attr {string} value - Selected time in HH:MM (24-hour) format\n * @attr {string} min - Minimum selectable time (HH:MM)\n * @attr {string} max - Maximum selectable time (HH:MM)\n * @attr {string} label - Label text\n * @attr {string} label-placement - 'inset' | 'outside'\n * @attr {string} placeholder - Trigger placeholder\n * @attr {boolean} disabled - Disable the picker\n * @attr {boolean} required - Required field\n * @attr {string} name - Form field name\n * @attr {string} error - Error message\n * @attr {string} helper - Helper text\n * @attr {string} color - Theme color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'\n * @attr {string} size - Component size: 'sm' | 'md' | 'lg'\n * @attr {string} variant - Visual variant: 'solid' | 'flat' | 'bordered' | 'outline' | 'ghost'\n * @attr {string} rounded - Border radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'\n * @attr {string} time-format - '12' or '24' (default: '24')\n * @attr {number} minute-step - Minute increment (default: 5)\n *\n * @fires change - Fired when a time is selected. detail: { value: string | null }\n *\n * @slot label - Custom label for the trigger field\n * @slot prefix - Content before the trigger text (e.g. icon)\n * @slot helper - Custom helper text\n * @slot error - Custom error content\n *\n * @cssprop --time-picker-bg - Dropdown background\n * @cssprop --time-picker-border-color - Dropdown border color\n * @cssprop --time-picker-radius - Dropdown border radius\n * @cssprop --time-picker-shadow - Dropdown shadow\n * @cssprop --time-picker-selected-bg - Selected option background\n * @cssprop --time-picker-option-hover-bg - Option hover background\n *\n * @part field - The trigger field\n * @part dropdown - The floating time dropdown\n * @part column - A scrollable column (hours / minutes / period)\n * @part option - An individual time option cell\n *\n * @example\n * ```html\n * <!-- 24-hour clock, 15-minute steps -->\n * <ore-time-picker label=\"Meeting time\" value=\"09:30\" minute-step=\"15\" color=\"primary\"></ore-time-picker>\n *\n * <!-- 12-hour AM/PM format -->\n * <ore-time-picker label=\"Appointment\" time-format=\"12\" minute-step=\"30\"></ore-time-picker>\n *\n * <!-- Outside label, bordered variant -->\n * <ore-time-picker label=\"Start time\" label-placement=\"outside\" variant=\"bordered\"></ore-time-picker>\n * ```\n */\nexport const TIME_PICKER_TAG = 'ore-time-picker' as const;\n\ndefine<OreTimePickerProps>(TIME_PICKER_TAG, {\n formAssociated: true,\n props: {\n ...themableBundle,\n ...sizableBundle,\n ...disablableBundle,\n ...roundableBundle,\n error: prop.string(),\n fullwidth: prop.bool(false),\n helper: prop.string(),\n label: prop.string(),\n 'label-placement': prop.oneOf(['inset', 'outside'] as const, 'inset'),\n max: prop.string(),\n min: prop.string(),\n 'minute-step': prop.number(5),\n name: prop.string(),\n placeholder: prop.string(),\n required: prop.bool(false),\n 'time-format': prop.oneOf(['12', '24'] as const, '24'),\n value: prop.string(),\n variant: prop.string<'flat' | 'solid' | 'bordered' | 'outline' | 'ghost'>(),\n },\n\n setup(props) {\n const el = getHost();\n const emit = useEmit<OreTimePickerEvents>();\n\n // ── Signals ──────────────────────────────────────────────────────────────\n\n const isOpen = signal(false);\n const selectedTime = signal<{ hours: number; minutes: number } | null>(parseTime(props.value.value));\n\n // ── Form context ─────────────────────────────────────────────────────────\n\n const formCtx = inject(FORM_CTX);\n const fCtxProps = useFormContext(props, formCtx);\n const isDisabled = fCtxProps.disabled;\n\n // ── Form value ────────────────────────────────────────────────────────────\n\n useField<string>({\n disabled: isDisabled,\n toFormValue: (v) => v || null,\n value: computed(() => {\n const t = selectedTime.value;\n\n return t ? formatTime(t.hours, t.minutes) : '';\n }),\n });\n\n // ── Computed helpers ──────────────────────────────────────────────────────\n\n const fmt = computed(() => props['time-format'].value ?? '24');\n const minuteStep = computed(() => Math.max(1, Math.min(59, props['minute-step'].value ?? 5)));\n\n const triggerText = computed(() => {\n if (!selectedTime.value) return props.placeholder.value || '';\n\n return formatDisplay(selectedTime.value.hours, selectedTime.value.minutes, fmt.value as '12' | '24');\n });\n\n /** All hour options for the column (0-23 in 24h; 1-12 in 12h) */\n const hourOptions = computed<number[]>(() => {\n if (fmt.value === '12') {\n return Array.from({ length: 12 }, (_, i) => i + 1);\n }\n\n return Array.from({ length: 24 }, (_, i) => i);\n });\n\n /** All minute options for the column, stepped */\n const minuteOptions = computed<number[]>(() => {\n const step = minuteStep.value;\n const opts: number[] = [];\n\n for (let m = 0; m < 60; m += step) opts.push(m);\n\n return opts;\n });\n\n const dialogId = `time-picker-${Math.random().toString(36).slice(2, 9)}-dropdown`;\n\n /** Convert 24h hour to display hour in current format */\n function toDisplayHour(h24: number): number {\n if (fmt.value === '24') return h24;\n\n const h12 = h24 % 12;\n\n return h12 === 0 ? 12 : h12;\n }\n\n /** Convert display hour + period → 24h hour */\n function to24Hour(displayHour: number, period: 'AM' | 'PM'): number {\n if (fmt.value === '24') return displayHour;\n\n if (period === 'AM') return displayHour === 12 ? 0 : displayHour;\n\n return displayHour === 12 ? 12 : displayHour + 12;\n }\n\n /** Whether a given HH:MM is out of [min, max] */\n function isTimeDisabled(h: number, m: number): boolean {\n const total = h * 60 + m;\n const minParsed = parseTime(props.min.value);\n const maxParsed = parseTime(props.max.value);\n\n if (minParsed && total < minParsed.hours * 60 + minParsed.minutes) return true;\n\n if (maxParsed && total > maxParsed.hours * 60 + maxParsed.minutes) return true;\n\n return false;\n }\n\n // ── State for focused/pending selection ───────────────────────────────────\n\n /** Pending hour (24h) while user is navigating columns */\n const pendingHour = signal<number>(selectedTime.value?.hours ?? 0);\n /** Pending minute */\n const pendingMinute = signal<number>(selectedTime.value?.minutes ?? 0);\n /** Pending period (12h mode) */\n const pendingPeriod = signal<'AM' | 'PM'>((selectedTime.value?.hours ?? 0) >= 12 ? 'PM' : 'AM');\n\n // ── Sync value prop externally ────────────────────────────────────────────\n\n let lastValueProp = props.value.value;\n\n onMounted(() => {\n const interval = setInterval(() => {\n const current = props.value.value;\n\n if (current !== lastValueProp) {\n lastValueProp = current;\n\n const parsed = parseTime(current);\n\n selectedTime.value = parsed;\n\n if (parsed) {\n pendingHour.value = parsed.hours;\n pendingMinute.value = parsed.minutes;\n pendingPeriod.value = parsed.hours >= 12 ? 'PM' : 'AM';\n }\n }\n }, 50);\n\n return () => clearInterval(interval);\n });\n\n // ── Commit ────────────────────────────────────────────────────────────────\n\n function commit(h24: number, m: number): void {\n const clamped = clampTime(h24, m, props.min.value, props.max.value);\n const snapped = Math.round(clamped.minutes / minuteStep.value) * minuteStep.value;\n const snappedMin = Math.min(snapped, 59);\n\n selectedTime.value = { hours: clamped.hours, minutes: snappedMin };\n emit('change', { value: formatTime(clamped.hours, snappedMin) });\n }\n\n function commitFromMinute(m: number): void {\n const h24 = fmt.value === '12' ? to24Hour(pendingHour.value, pendingPeriod.value) : pendingHour.value;\n\n pendingMinute.value = m;\n commit(h24, m);\n closePicker();\n }\n\n // ── Open / close ──────────────────────────────────────────────────────────\n\n function openPicker(): void {\n if (isDisabled.value) return;\n\n const current = selectedTime.value;\n\n if (current) {\n pendingHour.value = fmt.value === '12' ? toDisplayHour(current.hours) : current.hours;\n pendingMinute.value = current.minutes;\n pendingPeriod.value = current.hours >= 12 ? 'PM' : 'AM';\n } else {\n pendingHour.value = fmt.value === '12' ? 12 : 0;\n pendingMinute.value = 0;\n pendingPeriod.value = 'AM';\n }\n\n isOpen.value = true;\n }\n\n function closePicker(): void {\n isOpen.value = false;\n }\n\n function handleTriggerClick(): void {\n if (isOpen.value) closePicker();\n else openPicker();\n }\n\n // ── Outside click ─────────────────────────────────────────────────────────\n\n function handleOutsideClick(e: PointerEvent | MouseEvent): void {\n if (!isOpen.value) return;\n\n if (!e.composedPath().includes(el)) closePicker();\n }\n\n onMounted(() => {\n document.addEventListener('pointerdown', handleOutsideClick, { capture: true });\n\n return () => document.removeEventListener('pointerdown', handleOutsideClick, { capture: true });\n });\n\n // ── Keyboard ──────────────────────────────────────────────────────────────\n\n function handleTriggerKeydown(e: KeyboardEvent): void {\n if (isDisabled.value) return;\n\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleTriggerClick();\n } else if (e.key === 'Escape' && isOpen.value) {\n e.preventDefault();\n closePicker();\n } else if ((e.key === 'ArrowDown' || e.key === 'ArrowUp') && !isOpen.value) {\n e.preventDefault();\n openPicker();\n }\n }\n\n function handleDropdownKeydown(e: KeyboardEvent): void {\n if (e.key === 'Escape') {\n e.preventDefault();\n closePicker();\n }\n }\n\n function handleHourKeydown(e: KeyboardEvent): void {\n const opts = hourOptions.value;\n const idx = opts.indexOf(pendingHour.value);\n\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n pendingHour.value = opts[(idx - 1 + opts.length) % opts.length];\n } else if (e.key === 'ArrowDown') {\n e.preventDefault();\n pendingHour.value = opts[(idx + 1) % opts.length];\n }\n }\n\n function handleMinuteKeydown(e: KeyboardEvent): void {\n const opts = minuteOptions.value;\n const idx = opts.indexOf(pendingMinute.value);\n\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n pendingMinute.value = opts[(idx - 1 + opts.length) % opts.length];\n } else if (e.key === 'ArrowDown') {\n e.preventDefault();\n pendingMinute.value = opts[(idx + 1) % opts.length];\n }\n }\n\n function handlePeriodKeydown(e: KeyboardEvent): void {\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n pendingPeriod.value = pendingPeriod.value === 'AM' ? 'PM' : 'AM';\n }\n }\n\n // ── Host bindings ─────────────────────────────────────────────────────────\n\n bind({\n attr: {\n open: () => (isOpen.value ? true : undefined),\n },\n });\n\n // ── ore-input prop helpers ────────────────────────────────────────────────\n\n const inputValue = () => triggerText.value;\n const inputLabel = () => props.label.value ?? '';\n const inputPlaceholder = () => props.placeholder.value ?? '';\n const inputLabelPlacement = () => props['label-placement'].value ?? 'inset';\n const inputColor = () => props.color?.value ?? undefined;\n const inputSize = () => fCtxProps.size?.value ?? undefined;\n const inputVariant = () => fCtxProps.variant?.value ?? undefined;\n const inputRounded = () => props.rounded?.value ?? undefined;\n const inputHelper = () => props.helper.value ?? '';\n const inputError = () => props.error.value ?? '';\n const inputDisabled = () => (isDisabled.value ? true : undefined);\n const inputRequired = () => (props.required.value ? true : undefined);\n const inputFullwidth = () => (props.fullwidth.value ? true : undefined);\n\n return html`\n <!-- Trigger -->\n <ore-input\n class=\"trigger\"\n readonly\n tabindex=\"0\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-controls=\"${dialogId}\"\n :aria-expanded=\"${() => String(isOpen.value)}\"\n :aria-disabled=\"${() => (isDisabled.value ? 'true' : null)}\"\n :value=\"${inputValue}\"\n :label=\"${inputLabel}\"\n :placeholder=\"${inputPlaceholder}\"\n :label-placement=\"${inputLabelPlacement}\"\n :color=\"${inputColor}\"\n :size=\"${inputSize}\"\n :variant=\"${inputVariant}\"\n :rounded=\"${inputRounded}\"\n :helper=\"${inputHelper}\"\n :error=\"${inputError}\"\n ?disabled=\"${inputDisabled}\"\n ?required=\"${inputRequired}\"\n ?fullwidth=\"${inputFullwidth}\"\n @click=\"${handleTriggerClick}\"\n @keydown=\"${handleTriggerKeydown}\">\n <ore-icon slot=\"suffix\" name=\"clock\" size=\"16\" stroke-width=\"1.75\" aria-hidden=\"true\"></ore-icon>\n </ore-input>\n\n <!-- Dropdown -->\n <div\n class=\"dropdown\"\n id=\"${dialogId}\"\n role=\"listbox\"\n aria-label=\"${() => (props.label.value ? `${props.label.value} — select time` : 'Select time')}\"\n ?data-open=\"${isOpen}\"\n @keydown=\"${handleDropdownKeydown}\">\n <div class=\"cols-row\">\n <!-- Hours column -->\n <div class=\"col\" part=\"column\" role=\"group\" aria-label=\"Hours\">\n <div class=\"col-label\" aria-hidden=\"true\">HH</div>\n <div class=\"col-scroll\">\n ${() =>\n hourOptions.value.map((h) => {\n const h24 = fmt.value === '12' ? to24Hour(h, pendingPeriod.value) : h;\n const disabled = isTimeDisabled(h24, pendingMinute.value);\n\n return html`<div\n class=\"option\"\n part=\"option\"\n role=\"option\"\n tabindex=\"${() => (pendingHour.value === h && !disabled ? '0' : '-1')}\"\n :aria-selected=\"${() => String(pendingHour.value === h)}\"\n :aria-disabled=\"${() => String(disabled)}\"\n ?data-disabled=\"${() => disabled}\"\n @click=\"${() => {\n if (!disabled) pendingHour.value = h;\n }}\"\n @keydown=\"${handleHourKeydown}\">\n ${String(h).padStart(2, '0')}\n </div>`;\n })}\n </div>\n </div>\n\n <div class=\"col-sep\" aria-hidden=\"true\">:</div>\n\n <!-- Minutes column -->\n <div class=\"col\" part=\"column\" role=\"group\" aria-label=\"Minutes\">\n <div class=\"col-label\" aria-hidden=\"true\">MM</div>\n <div class=\"col-scroll\">\n ${() =>\n minuteOptions.value.map((m) => {\n const h24 = fmt.value === '12' ? to24Hour(pendingHour.value, pendingPeriod.value) : pendingHour.value;\n const disabled = isTimeDisabled(h24, m);\n\n return html`<div\n class=\"option\"\n part=\"option\"\n role=\"option\"\n tabindex=\"${() => (pendingMinute.value === m && !disabled ? '0' : '-1')}\"\n :aria-selected=\"${() => String(pendingMinute.value === m)}\"\n :aria-disabled=\"${() => String(disabled)}\"\n ?data-disabled=\"${() => disabled}\"\n @click=\"${() => {\n if (!disabled) commitFromMinute(m);\n }}\"\n @keydown=\"${handleMinuteKeydown}\">\n ${String(m).padStart(2, '0')}\n </div>`;\n })}\n </div>\n </div>\n\n <!-- AM/PM column (12h mode only) -->\n ${() =>\n fmt.value === '12'\n ? html` <div class=\"col col-period\" part=\"column\" role=\"group\" aria-label=\"Period\">\n <div class=\"col-label\" aria-hidden=\"true\">AM/PM</div>\n <div class=\"col-scroll\">\n ${(['AM', 'PM'] as const).map(\n (p) =>\n html`<div\n class=\"option\"\n part=\"option\"\n role=\"option\"\n tabindex=\"${() => (pendingPeriod.value === p ? '0' : '-1')}\"\n :aria-selected=\"${() => String(pendingPeriod.value === p)}\"\n @click=\"${() => {\n pendingPeriod.value = p;\n }}\"\n @keydown=\"${handlePeriodKeydown}\">\n ${p}\n </div>`,\n )}\n </div>\n </div>`\n : html``}\n </div>\n </div>\n `;\n },\n\n shadow: { delegatesFocus: true },\n styles: [colorThemeMixin, reducedMotionMixin, componentStyles],\n});\n"],"mappings":";;;;;;;;;;AA6DA,SAAS,EAAU,GAA2E;CAC5F,IAAI,CAAC,GAAK,OAAO;CAEjB,IAAM,IAAQ,sBAAsB,KAAK,EAAI,KAAK,CAAC;CAEnD,IAAI,CAAC,GAAO,OAAO;CAEnB,IAAM,IAAI,OAAO,EAAM,EAAE,GACnB,IAAI,OAAO,EAAM,EAAE;CAIzB,OAFI,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,KAAW,OAExC;EAAE,OAAO;EAAG,SAAS;CAAE;AAChC;AAGA,SAAS,EAAW,GAAW,GAAmB;CAChD,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,SAAS,GAAG,GAA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Ac,QAAQ;EACxB,EAAE;sCACU,EAAoB;4BAC9B,EAAE;+BAEV,EAAE;;0BAGN,CAAI,GAAG;;;;CAIrB;CAEA,QAAQ,EAAE,gBAAgB,GAAK;CAC/B,QAAQ;EAAC;EAAiB;EAAoB;CAAe;AAC/D,CAAC"}
1
+ {"version":3,"file":"time-picker.js","names":[],"sources":["../src/inputs/time-picker/time-picker.ts"],"sourcesContent":["import { define, html, inject, prop, bind, getHost, onMounted, useEmit } from '@vielzeug/ore';\nimport { useField } from '@vielzeug/ore/forms';\nimport { computed, signal } from '@vielzeug/ripple';\n\nimport type { VisualVariant } from '../../shared';\n\nimport '../../content/icon/icon';\nimport '../input/input';\nimport { disablableBundle, roundableBundle, sizableBundle, themableBundle } from '../../shared';\nimport { colorThemeMixin, reducedMotionMixin } from '../../styles';\nimport { FORM_CTX, useFormContext } from '../shared/form-context';\nimport componentStyles from './time-picker.css?inline';\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport type OreTimePickerEvents = {\n change: { value: string | null };\n};\n\nexport type OreTimePickerProps = {\n /** Theme color */\n color?: string;\n /** Disable the picker */\n disabled?: boolean;\n /** Validation error message */\n error?: string;\n /** Expand to container width */\n fullwidth?: boolean;\n /** Helper text below the field */\n helper?: string;\n /** Visible label */\n label?: string;\n /** Label placement */\n 'label-placement'?: 'inset' | 'outside';\n /** Maximum selectable time in HH:MM format (24-hour) */\n max?: string;\n /** Minimum selectable time in HH:MM format (24-hour) */\n min?: string;\n /** Minute step interval (1–59) */\n 'minute-step'?: number;\n /** Form field name */\n name?: string;\n /** Placeholder shown in the trigger */\n placeholder?: string;\n /** Mark field as required */\n required?: boolean;\n /** Border radius */\n rounded?: string;\n /** Component size */\n size?: string;\n /** Display format: '12' for AM/PM, '24' for 24-hour (default: '24') */\n 'time-format'?: '12' | '24';\n /** Selected time in HH:MM format (24-hour) */\n value?: string;\n /** Visual variant */\n variant?: Exclude<VisualVariant, 'text' | 'frost'>;\n};\n\n// ── Helpers ───────────────────────────────────────────────────────────────────\n\n/** Parse \"HH:MM\" → { hours: 0-23, minutes: 0-59 } | null */\nfunction parseTime(val: string | undefined | null): { hours: number; minutes: number } | null {\n if (!val) return null;\n\n const match = /^(\\d{1,2}):(\\d{2})$/.exec(val.trim());\n\n if (!match) return null;\n\n const h = Number(match[1]);\n const m = Number(match[2]);\n\n if (h < 0 || h > 23 || m < 0 || m > 59) return null;\n\n return { hours: h, minutes: m };\n}\n\n/** Format { hours, minutes } → \"HH:MM\" (24-hour, zero-padded) */\nfunction formatTime(h: number, m: number): string {\n return `${String(h).padStart(2, '0')}:${String(m).padStart(2, '0')}`;\n}\n\n/** Format for display label (respects 12/24 mode) */\nfunction formatDisplay(h: number, m: number, format: '12' | '24'): string {\n if (format === '12') {\n const period = h >= 12 ? 'PM' : 'AM';\n const displayH = h % 12 === 0 ? 12 : h % 12;\n\n return `${String(displayH).padStart(2, '0')}:${String(m).padStart(2, '0')} ${period}`;\n }\n\n return formatTime(h, m);\n}\n\n/** Clamp value to [min, max] in total minutes */\nfunction clampTime(\n h: number,\n m: number,\n minVal: string | undefined | null,\n maxVal: string | undefined | null,\n): { hours: number; minutes: number } {\n const total = h * 60 + m;\n const minParsed = parseTime(minVal);\n const maxParsed = parseTime(maxVal);\n const minMins = minParsed ? minParsed.hours * 60 + minParsed.minutes : 0;\n const maxMins = maxParsed ? maxParsed.hours * 60 + maxParsed.minutes : 23 * 60 + 59;\n const clamped = Math.min(Math.max(total, minMins), maxMins);\n\n return { hours: Math.floor(clamped / 60), minutes: clamped % 60 };\n}\n\n/**\n * An accessible time picker with a scrollable clock dropdown.\n * Supports 12/24-hour display formats, min/max bounds, minute steps, and form association.\n *\n * @element ore-time-picker\n *\n * @attr {string} value - Selected time in HH:MM (24-hour) format\n * @attr {string} min - Minimum selectable time (HH:MM)\n * @attr {string} max - Maximum selectable time (HH:MM)\n * @attr {string} label - Label text\n * @attr {string} label-placement - 'inset' | 'outside'\n * @attr {string} placeholder - Trigger placeholder\n * @attr {boolean} disabled - Disable the picker\n * @attr {boolean} required - Required field\n * @attr {string} name - Form field name\n * @attr {string} error - Error message\n * @attr {string} helper - Helper text\n * @attr {string} color - Theme color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'\n * @attr {string} size - Component size: 'sm' | 'md' | 'lg'\n * @attr {string} variant - Visual variant: 'solid' | 'flat' | 'bordered' | 'outline' | 'ghost'\n * @attr {string} rounded - Border radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'\n * @attr {string} time-format - '12' or '24' (default: '24')\n * @attr {number} minute-step - Minute increment (default: 5)\n *\n * @fires change - Fired when a time is selected. detail: { value: string | null }\n *\n * @slot label - Custom label for the trigger field\n * @slot prefix - Content before the trigger text (e.g. icon)\n * @slot helper - Custom helper text\n * @slot error - Custom error content\n *\n * @cssprop --time-picker-bg - Dropdown background\n * @cssprop --time-picker-border-color - Dropdown border color\n * @cssprop --time-picker-radius - Dropdown border radius\n * @cssprop --time-picker-shadow - Dropdown shadow\n * @cssprop --time-picker-selected-bg - Selected option background\n * @cssprop --time-picker-option-hover-bg - Option hover background\n *\n * @part field - The trigger field\n * @part dropdown - The floating time dropdown\n * @part column - A scrollable column (hours / minutes / period)\n * @part option - An individual time option cell\n *\n * @example\n * ```html\n * <!-- 24-hour clock, 15-minute steps -->\n * <ore-time-picker label=\"Meeting time\" value=\"09:30\" minute-step=\"15\" color=\"primary\"></ore-time-picker>\n *\n * <!-- 12-hour AM/PM format -->\n * <ore-time-picker label=\"Appointment\" time-format=\"12\" minute-step=\"30\"></ore-time-picker>\n *\n * <!-- Outside label, bordered variant -->\n * <ore-time-picker label=\"Start time\" label-placement=\"outside\" variant=\"bordered\"></ore-time-picker>\n * ```\n */\nexport const TIME_PICKER_TAG = 'ore-time-picker' as const;\n\ndefine<OreTimePickerProps>(TIME_PICKER_TAG, {\n formAssociated: true,\n props: {\n ...themableBundle,\n ...sizableBundle,\n ...disablableBundle,\n ...roundableBundle,\n error: prop.string(),\n fullwidth: prop.bool(false),\n helper: prop.string(),\n label: prop.string(),\n 'label-placement': prop.oneOf(['inset', 'outside'] as const, 'inset'),\n max: prop.string(),\n min: prop.string(),\n 'minute-step': prop.number(5),\n name: prop.string(),\n placeholder: prop.string(),\n required: prop.bool(false),\n 'time-format': prop.oneOf(['12', '24'] as const, '24'),\n value: prop.string(),\n variant: prop.string<'flat' | 'solid' | 'bordered' | 'outline' | 'ghost'>(),\n },\n\n setup(props) {\n const el = getHost();\n const emit = useEmit<OreTimePickerEvents>();\n\n // ── Signals ──────────────────────────────────────────────────────────────\n\n const isOpen = signal(false);\n const selectedTime = signal<{ hours: number; minutes: number } | null>(parseTime(props.value.value));\n\n // ── Form context ─────────────────────────────────────────────────────────\n\n const formCtx = inject(FORM_CTX);\n const fCtxProps = useFormContext(props, formCtx);\n const isDisabled = fCtxProps.disabled;\n\n // ── Form value ────────────────────────────────────────────────────────────\n\n useField<string>({\n disabled: isDisabled,\n toFormValue: (v) => v || null,\n value: computed(() => {\n const t = selectedTime.value;\n\n return t ? formatTime(t.hours, t.minutes) : '';\n }),\n });\n\n // ── Computed helpers ──────────────────────────────────────────────────────\n\n const fmt = computed(() => props['time-format'].value ?? '24');\n const minuteStep = computed(() => Math.max(1, Math.min(59, props['minute-step'].value ?? 5)));\n\n const triggerText = computed(() => {\n if (!selectedTime.value) return props.placeholder.value || '';\n\n return formatDisplay(selectedTime.value.hours, selectedTime.value.minutes, fmt.value as '12' | '24');\n });\n\n /** All hour options for the column (0-23 in 24h; 1-12 in 12h) */\n const hourOptions = computed<number[]>(() => {\n if (fmt.value === '12') {\n return Array.from({ length: 12 }, (_, i) => i + 1);\n }\n\n return Array.from({ length: 24 }, (_, i) => i);\n });\n\n /** All minute options for the column, stepped */\n const minuteOptions = computed<number[]>(() => {\n const step = minuteStep.value;\n const opts: number[] = [];\n\n for (let m = 0; m < 60; m += step) opts.push(m);\n\n return opts;\n });\n\n const dialogId = `time-picker-${Math.random().toString(36).slice(2, 9)}-dropdown`;\n\n /** Convert 24h hour to display hour in current format */\n function toDisplayHour(h24: number): number {\n if (fmt.value === '24') return h24;\n\n const h12 = h24 % 12;\n\n return h12 === 0 ? 12 : h12;\n }\n\n /** Convert display hour + period → 24h hour */\n function to24Hour(displayHour: number, period: 'AM' | 'PM'): number {\n if (fmt.value === '24') return displayHour;\n\n if (period === 'AM') return displayHour === 12 ? 0 : displayHour;\n\n return displayHour === 12 ? 12 : displayHour + 12;\n }\n\n /** Whether a given HH:MM is out of [min, max] */\n function isTimeDisabled(h: number, m: number): boolean {\n const total = h * 60 + m;\n const minParsed = parseTime(props.min.value);\n const maxParsed = parseTime(props.max.value);\n\n if (minParsed && total < minParsed.hours * 60 + minParsed.minutes) return true;\n\n if (maxParsed && total > maxParsed.hours * 60 + maxParsed.minutes) return true;\n\n return false;\n }\n\n // ── State for focused/pending selection ───────────────────────────────────\n\n /** Pending hour (24h) while user is navigating columns */\n const pendingHour = signal<number>(selectedTime.value?.hours ?? 0);\n /** Pending minute */\n const pendingMinute = signal<number>(selectedTime.value?.minutes ?? 0);\n /** Pending period (12h mode) */\n const pendingPeriod = signal<'AM' | 'PM'>((selectedTime.value?.hours ?? 0) >= 12 ? 'PM' : 'AM');\n\n // ── Sync value prop externally ────────────────────────────────────────────\n\n let lastValueProp = props.value.value;\n\n onMounted(() => {\n const interval = setInterval(() => {\n const current = props.value.value;\n\n if (current !== lastValueProp) {\n lastValueProp = current;\n\n const parsed = parseTime(current);\n\n selectedTime.value = parsed;\n\n if (parsed) {\n pendingHour.value = parsed.hours;\n pendingMinute.value = parsed.minutes;\n pendingPeriod.value = parsed.hours >= 12 ? 'PM' : 'AM';\n }\n }\n }, 50);\n\n return () => clearInterval(interval);\n });\n\n // ── Commit ────────────────────────────────────────────────────────────────\n\n function commit(h24: number, m: number): void {\n const clamped = clampTime(h24, m, props.min.value, props.max.value);\n const snapped = Math.round(clamped.minutes / minuteStep.value) * minuteStep.value;\n const snappedMin = Math.min(snapped, 59);\n\n selectedTime.value = { hours: clamped.hours, minutes: snappedMin };\n emit('change', { value: formatTime(clamped.hours, snappedMin) });\n }\n\n function commitFromMinute(m: number): void {\n const h24 = fmt.value === '12' ? to24Hour(pendingHour.value, pendingPeriod.value) : pendingHour.value;\n\n pendingMinute.value = m;\n commit(h24, m);\n closePicker();\n }\n\n // ── Open / close ──────────────────────────────────────────────────────────\n\n function openPicker(): void {\n if (isDisabled.value) return;\n\n const current = selectedTime.value;\n\n if (current) {\n pendingHour.value = fmt.value === '12' ? toDisplayHour(current.hours) : current.hours;\n pendingMinute.value = current.minutes;\n pendingPeriod.value = current.hours >= 12 ? 'PM' : 'AM';\n } else {\n pendingHour.value = fmt.value === '12' ? 12 : 0;\n pendingMinute.value = 0;\n pendingPeriod.value = 'AM';\n }\n\n isOpen.value = true;\n }\n\n function closePicker(): void {\n isOpen.value = false;\n }\n\n function handleTriggerClick(): void {\n if (isOpen.value) closePicker();\n else openPicker();\n }\n\n // ── Outside click ─────────────────────────────────────────────────────────\n\n function handleOutsideClick(e: PointerEvent | MouseEvent): void {\n if (!isOpen.value) return;\n\n if (!e.composedPath().includes(el)) closePicker();\n }\n\n onMounted(() => {\n document.addEventListener('pointerdown', handleOutsideClick, { capture: true });\n\n return () => document.removeEventListener('pointerdown', handleOutsideClick, { capture: true });\n });\n\n // ── Keyboard ──────────────────────────────────────────────────────────────\n\n function handleTriggerKeydown(e: KeyboardEvent): void {\n if (isDisabled.value) return;\n\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleTriggerClick();\n } else if (e.key === 'Escape' && isOpen.value) {\n e.preventDefault();\n closePicker();\n } else if ((e.key === 'ArrowDown' || e.key === 'ArrowUp') && !isOpen.value) {\n e.preventDefault();\n openPicker();\n }\n }\n\n function handleDropdownKeydown(e: KeyboardEvent): void {\n if (e.key === 'Escape') {\n e.preventDefault();\n closePicker();\n }\n }\n\n function handleHourKeydown(e: KeyboardEvent): void {\n const opts = hourOptions.value;\n const idx = opts.indexOf(pendingHour.value);\n\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n pendingHour.value = opts[(idx - 1 + opts.length) % opts.length];\n } else if (e.key === 'ArrowDown') {\n e.preventDefault();\n pendingHour.value = opts[(idx + 1) % opts.length];\n }\n }\n\n function handleMinuteKeydown(e: KeyboardEvent): void {\n const opts = minuteOptions.value;\n const idx = opts.indexOf(pendingMinute.value);\n\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n pendingMinute.value = opts[(idx - 1 + opts.length) % opts.length];\n } else if (e.key === 'ArrowDown') {\n e.preventDefault();\n pendingMinute.value = opts[(idx + 1) % opts.length];\n }\n }\n\n function handlePeriodKeydown(e: KeyboardEvent): void {\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n pendingPeriod.value = pendingPeriod.value === 'AM' ? 'PM' : 'AM';\n }\n }\n\n // ── Host bindings ─────────────────────────────────────────────────────────\n\n bind({\n attr: {\n open: () => (isOpen.value ? true : undefined),\n },\n });\n\n // ── ore-input prop helpers ────────────────────────────────────────────────\n\n const inputValue = () => triggerText.value;\n const inputLabel = () => props.label.value ?? '';\n const inputPlaceholder = () => props.placeholder.value ?? '';\n const inputLabelPlacement = () => props['label-placement'].value ?? 'inset';\n const inputColor = () => props.color?.value ?? undefined;\n const inputSize = () => fCtxProps.size?.value ?? undefined;\n const inputVariant = () => fCtxProps.variant?.value ?? undefined;\n const inputRounded = () => props.rounded?.value ?? undefined;\n const inputHelper = () => props.helper.value ?? '';\n const inputError = () => props.error.value ?? '';\n const inputDisabled = () => (isDisabled.value ? true : undefined);\n const inputRequired = () => (props.required.value ? true : undefined);\n const inputFullwidth = () => (props.fullwidth.value ? true : undefined);\n\n return html`\n <!-- Trigger -->\n <ore-input\n class=\"trigger\"\n readonly\n tabindex=\"0\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-controls=\"${dialogId}\"\n :aria-expanded=\"${() => String(isOpen.value)}\"\n :aria-disabled=\"${() => (isDisabled.value ? 'true' : null)}\"\n :value=\"${inputValue}\"\n :label=\"${inputLabel}\"\n :placeholder=\"${inputPlaceholder}\"\n :label-placement=\"${inputLabelPlacement}\"\n :color=\"${inputColor}\"\n :size=\"${inputSize}\"\n :variant=\"${inputVariant}\"\n :rounded=\"${inputRounded}\"\n :helper=\"${inputHelper}\"\n :error=\"${inputError}\"\n ?disabled=\"${inputDisabled}\"\n ?required=\"${inputRequired}\"\n ?fullwidth=\"${inputFullwidth}\"\n @click=\"${handleTriggerClick}\"\n @keydown=\"${handleTriggerKeydown}\">\n <ore-icon slot=\"suffix\" name=\"clock\" size=\"16\" stroke-width=\"1.75\" aria-hidden=\"true\"></ore-icon>\n </ore-input>\n\n <!-- Dropdown -->\n <div\n class=\"dropdown\"\n id=\"${dialogId}\"\n role=\"listbox\"\n aria-label=\"${() => (props.label.value ? `${props.label.value} — select time` : 'Select time')}\"\n ?data-open=\"${isOpen}\"\n @keydown=\"${handleDropdownKeydown}\">\n <div class=\"cols-row\">\n <!-- Hours column -->\n <div class=\"col\" part=\"column\" role=\"group\" aria-label=\"Hours\">\n <div class=\"col-label\" aria-hidden=\"true\">HH</div>\n <div class=\"col-scroll\">\n ${() =>\n hourOptions.value.map((h) => {\n const h24 = fmt.value === '12' ? to24Hour(h, pendingPeriod.value) : h;\n const disabled = isTimeDisabled(h24, pendingMinute.value);\n\n return html`<div\n class=\"option\"\n part=\"option\"\n role=\"option\"\n tabindex=\"${() => (pendingHour.value === h && !disabled ? '0' : '-1')}\"\n :aria-selected=\"${() => String(pendingHour.value === h)}\"\n :aria-disabled=\"${() => String(disabled)}\"\n ?data-disabled=\"${() => disabled}\"\n @click=\"${() => {\n if (!disabled) pendingHour.value = h;\n }}\"\n @keydown=\"${handleHourKeydown}\">\n ${String(h).padStart(2, '0')}\n </div>`;\n })}\n </div>\n </div>\n\n <div class=\"col-sep\" aria-hidden=\"true\">:</div>\n\n <!-- Minutes column -->\n <div class=\"col\" part=\"column\" role=\"group\" aria-label=\"Minutes\">\n <div class=\"col-label\" aria-hidden=\"true\">MM</div>\n <div class=\"col-scroll\">\n ${() =>\n minuteOptions.value.map((m) => {\n const h24 = fmt.value === '12' ? to24Hour(pendingHour.value, pendingPeriod.value) : pendingHour.value;\n const disabled = isTimeDisabled(h24, m);\n\n return html`<div\n class=\"option\"\n part=\"option\"\n role=\"option\"\n tabindex=\"${() => (pendingMinute.value === m && !disabled ? '0' : '-1')}\"\n :aria-selected=\"${() => String(pendingMinute.value === m)}\"\n :aria-disabled=\"${() => String(disabled)}\"\n ?data-disabled=\"${() => disabled}\"\n @click=\"${() => {\n if (!disabled) commitFromMinute(m);\n }}\"\n @keydown=\"${handleMinuteKeydown}\">\n ${String(m).padStart(2, '0')}\n </div>`;\n })}\n </div>\n </div>\n\n <!-- AM/PM column (12h mode only) -->\n ${() =>\n fmt.value === '12'\n ? html` <div class=\"col col-period\" part=\"column\" role=\"group\" aria-label=\"Period\">\n <div class=\"col-label\" aria-hidden=\"true\">AM/PM</div>\n <div class=\"col-scroll\">\n ${(['AM', 'PM'] as const).map(\n (p) =>\n html`<div\n class=\"option\"\n part=\"option\"\n role=\"option\"\n tabindex=\"${() => (pendingPeriod.value === p ? '0' : '-1')}\"\n :aria-selected=\"${() => String(pendingPeriod.value === p)}\"\n @click=\"${() => {\n pendingPeriod.value = p;\n }}\"\n @keydown=\"${handlePeriodKeydown}\">\n ${p}\n </div>`,\n )}\n </div>\n </div>`\n : html``}\n </div>\n </div>\n `;\n },\n\n shadow: { delegatesFocus: true },\n styles: [colorThemeMixin, reducedMotionMixin, componentStyles],\n});\n"],"mappings":";;;;;;;;;AA6DA,SAAS,EAAU,GAA2E;CAC5F,IAAI,CAAC,GAAK,OAAO;CAEjB,IAAM,IAAQ,sBAAsB,KAAK,EAAI,KAAK,CAAC;CAEnD,IAAI,CAAC,GAAO,OAAO;CAEnB,IAAM,IAAI,OAAO,EAAM,EAAE,GACnB,IAAI,OAAO,EAAM,EAAE;CAIzB,OAFI,IAAI,KAAK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AG,GAAG,EAAE;;EAEjC,CAAC,EAAE;;;;;kBAMP,EAAI,UAAU,OACV,CAAI;;;sBAGG,CAAC,MAAM,IAAI,CAAC,CAAW,KACvB,MACC,CAAI;;;;4CAIiB,EAAc,UAAU,IAAI,MAAM,KAAM;kDACnC,OAAO,EAAc,UAAU,CAAC,EAAE;0CAC1C;GACd,EAAc,QAAQ;EACxB,EAAE;sCACU,EAAoB;4BAC9B,EAAE;+BAEV,EAAE;;0BAGN,CAAI,GAAG;;;;CAIrB;CAEA,QAAQ,EAAE,gBAAgB,GAAK;CAC/B,QAAQ;EAAC;EAAiB;EAAoB;CAAe;AAC/D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vielzeug/refine",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "Accessible, themeable web components built on Ore custom element primitives",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,2 +0,0 @@
1
- var e=!globalThis.__ORE_PROD__;function t(t){e&&console.warn(`[@vielzeug/ore] ${t}`)}function n(t,...n){e&&console.error(`[@vielzeug/ore] ${t}`,...n)}exports.error=n,exports.warn=t;
2
- //# sourceMappingURL=_dev.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_dev.cjs","names":[],"sources":["../../../../ore/dist/_dev.js"],"sourcesContent":["var e=!globalThis.__ORE_PROD__;function t(t){e&&console.warn(`[@vielzeug/ore] ${t}`)}function n(t,...n){e&&console.error(`[@vielzeug/ore] ${t}`,...n)}export{n as error,t as warn};\n//# sourceMappingURL=_dev.js.map"],"mappings":"AAAA,IAAI,EAAE,CAAC,WAAW,aAAa,SAAS,EAAE,EAAE,CAAC,GAAG,QAAQ,KAAK,mBAAmB,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,QAAQ,MAAM,mBAAmB,IAAI,GAAG,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- //#region ../ore/dist/_dev.js
2
- var e = !globalThis.__ORE_PROD__;
3
- function t(t) {
4
- e && console.warn(`[@vielzeug/ore] ${t}`);
5
- }
6
- function n(t, ...n) {
7
- e && console.error(`[@vielzeug/ore] ${t}`, ...n);
8
- }
9
- //#endregion
10
- export { n as error, t as warn };
11
-
12
- //# sourceMappingURL=_dev.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_dev.js","names":[],"sources":["../../../../ore/dist/_dev.js"],"sourcesContent":["var e=!globalThis.__ORE_PROD__;function t(t){e&&console.warn(`[@vielzeug/ore] ${t}`)}function n(t,...n){e&&console.error(`[@vielzeug/ore] ${t}`,...n)}export{n as error,t as warn};\n//# sourceMappingURL=_dev.js.map"],"mappings":";AAAA,IAAI,IAAE,CAAC,WAAW;AAAa,SAAS,EAAE,GAAE;CAAC,KAAG,QAAQ,KAAK,mBAAmB,GAAG;AAAC;AAAC,SAAS,EAAE,GAAE,GAAG,GAAE;CAAC,KAAG,QAAQ,MAAM,mBAAmB,KAAI,GAAG,CAAC;AAAC"}
@@ -1,2 +0,0 @@
1
- const e=require("./_dev.cjs"),t=require("./errors.cjs");require("./types/bindings.cjs");const n=require("./runtime.cjs"),r=require("./utils/css.cjs"),i=require("./props.cjs"),a=require("./types.cjs");let o=require("@vielzeug/ripple");var s=()=>({formResetCallbacks:[],generation:0,mountCallbacks:[],phase:a.ComponentPhase.UNINITIALIZED,scope:(0,o.scope)(),templateResult:null}),c=class extends HTMLElement{static _definition;static _normalizedPropDefs;static formAssociated=!1;static observedAttributes=[];_component;constructor(){super();let e=this.constructor._definition;e?.shadow!==!1&&this.attachShadow({mode:`open`,...e?.shadow}),this._component=s()}connectedCallback(){(0,o.untrack)(()=>{this._component.phase===a.ComponentPhase.UNINITIALIZED&&this._runSetup(),this._init()}),this.dispatchEvent(new CustomEvent(a.LIFECYCLE_EVENTS.CONNECT,{bubbles:!1,composed:!1}))}attributeChangedCallback(e,t,n){if(t===n)return;let r=i.getPropMeta(this,e);if(!r)return;let a=r.parse(n);Object.is((0,o.untrack)(()=>r.signal.value),a)||(r.signal.value=a)}disconnectedCallback(){this._component.generation++,this._component.phase=a.ComponentPhase.UNMOUNTED,this.dispatchEvent(new CustomEvent(a.LIFECYCLE_EVENTS.DISCONNECT,{bubbles:!1,composed:!1})),this._component.scope.dispose(),this._component.formResetCallbacks=[],this._component.mountCallbacks=[],this._component.phase=a.ComponentPhase.UNINITIALIZED,this._component.scope=(0,o.scope)(),this._component.templateResult=null}formResetCallback(){for(let e of this._component.formResetCallbacks)try{e()}catch(e){this._handleSetupError(e,`form-reset`)}}_handleSetupError(e,n=`setup`){let r=e instanceof Error?e:Error(String(e)),i=new t.OreLifecycleError(`<${this.localName}> failed during ${this._component.phase} (${n})`,{cause:r,component:this.localName,phase:n}),a=this.constructor._definition;if(a?.onError)try{return a.onError(i,this)}catch{}t.reportRuntimeError(i,this)}_runSetup(){this._component.phase=a.ComponentPhase.SETUP_RUNNING;let e=this.constructor._definition,t=this.constructor._normalizedPropDefs,r={element:this,formResetCallbacks:[],mountCallbacks:[]};try{let o;if(this._component.scope.run(()=>{o=n.runWithContext(r,()=>{let n=t?i.createProps(this,t):{};return e.setup(n)})}),this._component.mountCallbacks.push(...r.mountCallbacks),this._component.formResetCallbacks.push(...r.formResetCallbacks),o!=null&&typeof o.then==`function`){let t=this._component.mountCallbacks.splice(0);this._component.phase=a.ComponentPhase.LOADING,e.loading&&(this._component.templateResult=e.loading()),this._runSetupAsync(o,t,this._component.generation)}else this._component.templateResult=o??null,this._component.phase=a.ComponentPhase.SETUP_DONE}catch(e){let t=this._handleSetupError(e);if(t)this._component.templateResult=t,this._component.phase=a.ComponentPhase.SETUP_DONE;else throw this._component.phase=a.ComponentPhase.UNINITIALIZED,e}}_isStale(e){return this._component.generation!==e||!this.isConnected}async _runSetupAsync(t,n,r){try{let i=await t;if(this._isStale(r)){e.warn(`<${this.localName}> async setup result discarded — element disconnected before setup resolved.`);return}this._component.templateResult=i??null,this._component.phase=a.ComponentPhase.SETUP_DONE,this._component.mountCallbacks.push(...n),i&&this._applyResult(i),this._scheduleMountCallbacks()}catch(t){if(this._isStale(r)){e.warn(`<${this.localName}> async setup error discarded — element disconnected before setup resolved.`);return}let n=this._handleSetupError(t,`async-setup`);n?(this._component.templateResult=n,this._component.phase=a.ComponentPhase.SETUP_DONE,this._applyResult(n)):this._component.phase=a.ComponentPhase.UNINITIALIZED}}_applyResult(e){e&&((this.shadowRoot??this).replaceChildren(e.fragment),this._component.scope.run(()=>{e.apply(n.onCleanup)}))}_init(){this._applyStyles(),this._mountTemplate(),this._component.phase===a.ComponentPhase.SETUP_DONE&&this._scheduleMountCallbacks()}_applyStyles(){let e=this.constructor._definition;this.shadowRoot&&e?.styles?.length&&(this.shadowRoot.adoptedStyleSheets=e.styles.map(r.loadStylesheet))}_mountTemplate(){let e=this._component.templateResult;e&&this._applyResult(e)}_scheduleMountCallbacks(){if(this._component.mountCallbacks.length===0)return;let e=this._component.generation;queueMicrotask(()=>{if(this._isStale(e))return;let t=this._component.mountCallbacks.splice(0);for(let e of t)try{let t={element:this,formResetCallbacks:[],mountCallbacks:[]};this._component.scope.run(()=>{n.runWithContext(t,()=>{let t=e();typeof t==`function`&&n.onCleanup(t)})}),t.mountCallbacks.length>0&&this._component.mountCallbacks.push(...t.mountCallbacks),t.formResetCallbacks.length>0&&this._component.formResetCallbacks.push(...t.formResetCallbacks)}catch(e){this._handleSetupError(e,`mounted`)}this._component.mountCallbacks.length>0&&this._scheduleMountCallbacks()})}};exports.BaseElement=c;
2
- //# sourceMappingURL=base-element.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-element.cjs","names":["s","c","o","i","a","t","e","r","l"],"sources":["../../../../ore/dist/base-element.js"],"sourcesContent":["import{warn as e}from\"./_dev.js\";import{OreLifecycleError as t,reportRuntimeError as n}from\"./errors.js\";import\"./types/bindings.js\";import{onCleanup as r,runWithContext as i}from\"./runtime.js\";import{createProps as a,getPropMeta as o}from\"./props.js\";import{ComponentPhase as s,LIFECYCLE_EVENTS as c}from\"./types.js\";import{loadStylesheet as l}from\"./utils/css.js\";import{scope as u,untrack as d}from\"@vielzeug/ripple\";var f=()=>({formResetCallbacks:[],generation:0,mountCallbacks:[],phase:s.UNINITIALIZED,scope:u(),templateResult:null}),p=class extends HTMLElement{static _definition;static _normalizedPropDefs;static formAssociated=!1;static observedAttributes=[];_component;constructor(){super();let e=this.constructor._definition;e?.shadow!==!1&&this.attachShadow({mode:`open`,...e?.shadow}),this._component=f()}connectedCallback(){d(()=>{this._component.phase===s.UNINITIALIZED&&this._runSetup(),this._init()}),this.dispatchEvent(new CustomEvent(c.CONNECT,{bubbles:!1,composed:!1}))}attributeChangedCallback(e,t,n){if(t===n)return;let r=o(this,e);if(!r)return;let i=r.parse(n);Object.is(d(()=>r.signal.value),i)||(r.signal.value=i)}disconnectedCallback(){this._component.generation++,this._component.phase=s.UNMOUNTED,this.dispatchEvent(new CustomEvent(c.DISCONNECT,{bubbles:!1,composed:!1})),this._component.scope.dispose(),this._component.formResetCallbacks=[],this._component.mountCallbacks=[],this._component.phase=s.UNINITIALIZED,this._component.scope=u(),this._component.templateResult=null}formResetCallback(){for(let e of this._component.formResetCallbacks)try{e()}catch(e){this._handleSetupError(e,`form-reset`)}}_handleSetupError(e,r=`setup`){let i=e instanceof Error?e:Error(String(e)),a=new t(`<${this.localName}> failed during ${this._component.phase} (${r})`,{cause:i,component:this.localName,phase:r}),o=this.constructor._definition;if(o?.onError)try{return o.onError(a,this)}catch{}n(a,this)}_runSetup(){this._component.phase=s.SETUP_RUNNING;let e=this.constructor._definition,t=this.constructor._normalizedPropDefs,n={element:this,formResetCallbacks:[],mountCallbacks:[]};try{let r;if(this._component.scope.run(()=>{r=i(n,()=>{let n=t?a(this,t):{};return e.setup(n)})}),this._component.mountCallbacks.push(...n.mountCallbacks),this._component.formResetCallbacks.push(...n.formResetCallbacks),r!=null&&typeof r.then==`function`){let t=this._component.mountCallbacks.splice(0);this._component.phase=s.LOADING,e.loading&&(this._component.templateResult=e.loading()),this._runSetupAsync(r,t,this._component.generation)}else this._component.templateResult=r??null,this._component.phase=s.SETUP_DONE}catch(e){let t=this._handleSetupError(e);if(t)this._component.templateResult=t,this._component.phase=s.SETUP_DONE;else throw this._component.phase=s.UNINITIALIZED,e}}_isStale(e){return this._component.generation!==e||!this.isConnected}async _runSetupAsync(t,n,r){try{let i=await t;if(this._isStale(r)){e(`<${this.localName}> async setup result discarded — element disconnected before setup resolved.`);return}this._component.templateResult=i??null,this._component.phase=s.SETUP_DONE,this._component.mountCallbacks.push(...n),i&&this._applyResult(i),this._scheduleMountCallbacks()}catch(t){if(this._isStale(r)){e(`<${this.localName}> async setup error discarded — element disconnected before setup resolved.`);return}let n=this._handleSetupError(t,`async-setup`);n?(this._component.templateResult=n,this._component.phase=s.SETUP_DONE,this._applyResult(n)):this._component.phase=s.UNINITIALIZED}}_applyResult(e){e&&((this.shadowRoot??this).replaceChildren(e.fragment),this._component.scope.run(()=>{e.apply(r)}))}_init(){this._applyStyles(),this._mountTemplate(),this._component.phase===s.SETUP_DONE&&this._scheduleMountCallbacks()}_applyStyles(){let e=this.constructor._definition;this.shadowRoot&&e?.styles?.length&&(this.shadowRoot.adoptedStyleSheets=e.styles.map(l))}_mountTemplate(){let e=this._component.templateResult;e&&this._applyResult(e)}_scheduleMountCallbacks(){if(this._component.mountCallbacks.length===0)return;let e=this._component.generation;queueMicrotask(()=>{if(this._isStale(e))return;let t=this._component.mountCallbacks.splice(0);for(let e of t)try{let t={element:this,formResetCallbacks:[],mountCallbacks:[]};this._component.scope.run(()=>{i(t,()=>{let t=e();typeof t==`function`&&r(t)})}),t.mountCallbacks.length>0&&this._component.mountCallbacks.push(...t.mountCallbacks),t.formResetCallbacks.length>0&&this._component.formResetCallbacks.push(...t.formResetCallbacks)}catch(e){this._handleSetupError(e,`mounted`)}this._component.mountCallbacks.length>0&&this._scheduleMountCallbacks()})}};export{p as BaseElement};\n//# sourceMappingURL=base-element.js.map"],"mappings":"0OAAoa,IAAI,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AE,CAAC,OAAO,CAAC,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,WAAW,QAAQP,EAAAA,eAAE,YAAY,KAAK,wBAAwB,CAAC,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,YAAY,YAAY,KAAK,YAAY,GAAG,QAAQ,SAAS,KAAK,WAAW,mBAAmB,EAAE,OAAO,IAAIQ,EAAAA,cAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,KAAK,WAAW,eAAe,GAAG,KAAK,aAAa,CAAC,CAAC,CAAC,yBAAyB,CAAC,GAAG,KAAK,WAAW,eAAe,SAAS,EAAE,OAAO,IAAI,EAAE,KAAK,WAAW,WAAW,mBAAmB,CAAC,GAAG,KAAK,SAAS,CAAC,EAAE,OAAO,IAAI,EAAE,KAAK,WAAW,eAAe,OAAO,CAAC,EAAE,IAAI,IAAI,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,QAAQ,KAAK,mBAAmB,CAAC,EAAE,eAAe,CAAC,CAAC,EAAE,KAAK,WAAW,MAAM,QAAQ,CAAC,EAAA,eAAE,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,GAAG,YAAYD,EAAAA,UAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,eAAe,OAAO,GAAG,KAAK,WAAW,eAAe,KAAK,GAAG,EAAE,cAAc,EAAE,EAAE,mBAAmB,OAAO,GAAG,KAAK,WAAW,mBAAmB,KAAK,GAAG,EAAE,kBAAkB,CAAC,OAAO,EAAE,CAAC,KAAK,kBAAkB,EAAE,SAAS,CAAC,CAAC,KAAK,WAAW,eAAe,OAAO,GAAG,KAAK,wBAAwB,CAAC,CAAC,CAAC,CAAC"}
@@ -1,158 +0,0 @@
1
- import { warn as e } from "./_dev.js";
2
- import { OreLifecycleError as t, reportRuntimeError as n } from "./errors.js";
3
- import "./types/bindings.js";
4
- import { onCleanup as r, runWithContext as i } from "./runtime.js";
5
- import { loadStylesheet as a } from "./utils/css.js";
6
- import { createProps as o, getPropMeta as s } from "./props.js";
7
- import { ComponentPhase as c, LIFECYCLE_EVENTS as l } from "./types.js";
8
- import { scope as u, untrack as d } from "@vielzeug/ripple";
9
- //#region ../ore/dist/base-element.js
10
- var f = () => ({
11
- formResetCallbacks: [],
12
- generation: 0,
13
- mountCallbacks: [],
14
- phase: c.UNINITIALIZED,
15
- scope: u(),
16
- templateResult: null
17
- }), p = class extends HTMLElement {
18
- static _definition;
19
- static _normalizedPropDefs;
20
- static formAssociated = !1;
21
- static observedAttributes = [];
22
- _component;
23
- constructor() {
24
- super();
25
- let e = this.constructor._definition;
26
- e?.shadow !== !1 && this.attachShadow({
27
- mode: "open",
28
- ...e?.shadow
29
- }), this._component = f();
30
- }
31
- connectedCallback() {
32
- d(() => {
33
- this._component.phase === c.UNINITIALIZED && this._runSetup(), this._init();
34
- }), this.dispatchEvent(new CustomEvent(l.CONNECT, {
35
- bubbles: !1,
36
- composed: !1
37
- }));
38
- }
39
- attributeChangedCallback(e, t, n) {
40
- if (t === n) return;
41
- let r = s(this, e);
42
- if (!r) return;
43
- let i = r.parse(n);
44
- Object.is(d(() => r.signal.value), i) || (r.signal.value = i);
45
- }
46
- disconnectedCallback() {
47
- this._component.generation++, this._component.phase = c.UNMOUNTED, this.dispatchEvent(new CustomEvent(l.DISCONNECT, {
48
- bubbles: !1,
49
- composed: !1
50
- })), this._component.scope.dispose(), this._component.formResetCallbacks = [], this._component.mountCallbacks = [], this._component.phase = c.UNINITIALIZED, this._component.scope = u(), this._component.templateResult = null;
51
- }
52
- formResetCallback() {
53
- for (let e of this._component.formResetCallbacks) try {
54
- e();
55
- } catch (e) {
56
- this._handleSetupError(e, "form-reset");
57
- }
58
- }
59
- _handleSetupError(e, r = "setup") {
60
- let i = e instanceof Error ? e : Error(String(e)), a = new t(`<${this.localName}> failed during ${this._component.phase} (${r})`, {
61
- cause: i,
62
- component: this.localName,
63
- phase: r
64
- }), o = this.constructor._definition;
65
- if (o?.onError) try {
66
- return o.onError(a, this);
67
- } catch {}
68
- n(a, this);
69
- }
70
- _runSetup() {
71
- this._component.phase = c.SETUP_RUNNING;
72
- let e = this.constructor._definition, t = this.constructor._normalizedPropDefs, n = {
73
- element: this,
74
- formResetCallbacks: [],
75
- mountCallbacks: []
76
- };
77
- try {
78
- let r;
79
- if (this._component.scope.run(() => {
80
- r = i(n, () => {
81
- let n = t ? o(this, t) : {};
82
- return e.setup(n);
83
- });
84
- }), this._component.mountCallbacks.push(...n.mountCallbacks), this._component.formResetCallbacks.push(...n.formResetCallbacks), r != null && typeof r.then == "function") {
85
- let t = this._component.mountCallbacks.splice(0);
86
- this._component.phase = c.LOADING, e.loading && (this._component.templateResult = e.loading()), this._runSetupAsync(r, t, this._component.generation);
87
- } else this._component.templateResult = r ?? null, this._component.phase = c.SETUP_DONE;
88
- } catch (e) {
89
- let t = this._handleSetupError(e);
90
- if (t) this._component.templateResult = t, this._component.phase = c.SETUP_DONE;
91
- else throw this._component.phase = c.UNINITIALIZED, e;
92
- }
93
- }
94
- _isStale(e) {
95
- return this._component.generation !== e || !this.isConnected;
96
- }
97
- async _runSetupAsync(t, n, r) {
98
- try {
99
- let i = await t;
100
- if (this._isStale(r)) {
101
- e(`<${this.localName}> async setup result discarded — element disconnected before setup resolved.`);
102
- return;
103
- }
104
- this._component.templateResult = i ?? null, this._component.phase = c.SETUP_DONE, this._component.mountCallbacks.push(...n), i && this._applyResult(i), this._scheduleMountCallbacks();
105
- } catch (t) {
106
- if (this._isStale(r)) {
107
- e(`<${this.localName}> async setup error discarded — element disconnected before setup resolved.`);
108
- return;
109
- }
110
- let n = this._handleSetupError(t, "async-setup");
111
- n ? (this._component.templateResult = n, this._component.phase = c.SETUP_DONE, this._applyResult(n)) : this._component.phase = c.UNINITIALIZED;
112
- }
113
- }
114
- _applyResult(e) {
115
- e && ((this.shadowRoot ?? this).replaceChildren(e.fragment), this._component.scope.run(() => {
116
- e.apply(r);
117
- }));
118
- }
119
- _init() {
120
- this._applyStyles(), this._mountTemplate(), this._component.phase === c.SETUP_DONE && this._scheduleMountCallbacks();
121
- }
122
- _applyStyles() {
123
- let e = this.constructor._definition;
124
- this.shadowRoot && e?.styles?.length && (this.shadowRoot.adoptedStyleSheets = e.styles.map(a));
125
- }
126
- _mountTemplate() {
127
- let e = this._component.templateResult;
128
- e && this._applyResult(e);
129
- }
130
- _scheduleMountCallbacks() {
131
- if (this._component.mountCallbacks.length === 0) return;
132
- let e = this._component.generation;
133
- queueMicrotask(() => {
134
- if (this._isStale(e)) return;
135
- let t = this._component.mountCallbacks.splice(0);
136
- for (let e of t) try {
137
- let t = {
138
- element: this,
139
- formResetCallbacks: [],
140
- mountCallbacks: []
141
- };
142
- this._component.scope.run(() => {
143
- i(t, () => {
144
- let t = e();
145
- typeof t == "function" && r(t);
146
- });
147
- }), t.mountCallbacks.length > 0 && this._component.mountCallbacks.push(...t.mountCallbacks), t.formResetCallbacks.length > 0 && this._component.formResetCallbacks.push(...t.formResetCallbacks);
148
- } catch (e) {
149
- this._handleSetupError(e, "mounted");
150
- }
151
- this._component.mountCallbacks.length > 0 && this._scheduleMountCallbacks();
152
- });
153
- }
154
- };
155
- //#endregion
156
- export { p as BaseElement };
157
-
158
- //# sourceMappingURL=base-element.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-element.js","names":["s","u","c","o","d","i","a","t","e","r","l"],"sources":["../../../../ore/dist/base-element.js"],"sourcesContent":["import{warn as e}from\"./_dev.js\";import{OreLifecycleError as t,reportRuntimeError as n}from\"./errors.js\";import\"./types/bindings.js\";import{onCleanup as r,runWithContext as i}from\"./runtime.js\";import{createProps as a,getPropMeta as o}from\"./props.js\";import{ComponentPhase as s,LIFECYCLE_EVENTS as c}from\"./types.js\";import{loadStylesheet as l}from\"./utils/css.js\";import{scope as u,untrack as d}from\"@vielzeug/ripple\";var f=()=>({formResetCallbacks:[],generation:0,mountCallbacks:[],phase:s.UNINITIALIZED,scope:u(),templateResult:null}),p=class extends HTMLElement{static _definition;static _normalizedPropDefs;static formAssociated=!1;static observedAttributes=[];_component;constructor(){super();let e=this.constructor._definition;e?.shadow!==!1&&this.attachShadow({mode:`open`,...e?.shadow}),this._component=f()}connectedCallback(){d(()=>{this._component.phase===s.UNINITIALIZED&&this._runSetup(),this._init()}),this.dispatchEvent(new CustomEvent(c.CONNECT,{bubbles:!1,composed:!1}))}attributeChangedCallback(e,t,n){if(t===n)return;let r=o(this,e);if(!r)return;let i=r.parse(n);Object.is(d(()=>r.signal.value),i)||(r.signal.value=i)}disconnectedCallback(){this._component.generation++,this._component.phase=s.UNMOUNTED,this.dispatchEvent(new CustomEvent(c.DISCONNECT,{bubbles:!1,composed:!1})),this._component.scope.dispose(),this._component.formResetCallbacks=[],this._component.mountCallbacks=[],this._component.phase=s.UNINITIALIZED,this._component.scope=u(),this._component.templateResult=null}formResetCallback(){for(let e of this._component.formResetCallbacks)try{e()}catch(e){this._handleSetupError(e,`form-reset`)}}_handleSetupError(e,r=`setup`){let i=e instanceof Error?e:Error(String(e)),a=new t(`<${this.localName}> failed during ${this._component.phase} (${r})`,{cause:i,component:this.localName,phase:r}),o=this.constructor._definition;if(o?.onError)try{return o.onError(a,this)}catch{}n(a,this)}_runSetup(){this._component.phase=s.SETUP_RUNNING;let e=this.constructor._definition,t=this.constructor._normalizedPropDefs,n={element:this,formResetCallbacks:[],mountCallbacks:[]};try{let r;if(this._component.scope.run(()=>{r=i(n,()=>{let n=t?a(this,t):{};return e.setup(n)})}),this._component.mountCallbacks.push(...n.mountCallbacks),this._component.formResetCallbacks.push(...n.formResetCallbacks),r!=null&&typeof r.then==`function`){let t=this._component.mountCallbacks.splice(0);this._component.phase=s.LOADING,e.loading&&(this._component.templateResult=e.loading()),this._runSetupAsync(r,t,this._component.generation)}else this._component.templateResult=r??null,this._component.phase=s.SETUP_DONE}catch(e){let t=this._handleSetupError(e);if(t)this._component.templateResult=t,this._component.phase=s.SETUP_DONE;else throw this._component.phase=s.UNINITIALIZED,e}}_isStale(e){return this._component.generation!==e||!this.isConnected}async _runSetupAsync(t,n,r){try{let i=await t;if(this._isStale(r)){e(`<${this.localName}> async setup result discarded — element disconnected before setup resolved.`);return}this._component.templateResult=i??null,this._component.phase=s.SETUP_DONE,this._component.mountCallbacks.push(...n),i&&this._applyResult(i),this._scheduleMountCallbacks()}catch(t){if(this._isStale(r)){e(`<${this.localName}> async setup error discarded — element disconnected before setup resolved.`);return}let n=this._handleSetupError(t,`async-setup`);n?(this._component.templateResult=n,this._component.phase=s.SETUP_DONE,this._applyResult(n)):this._component.phase=s.UNINITIALIZED}}_applyResult(e){e&&((this.shadowRoot??this).replaceChildren(e.fragment),this._component.scope.run(()=>{e.apply(r)}))}_init(){this._applyStyles(),this._mountTemplate(),this._component.phase===s.SETUP_DONE&&this._scheduleMountCallbacks()}_applyStyles(){let e=this.constructor._definition;this.shadowRoot&&e?.styles?.length&&(this.shadowRoot.adoptedStyleSheets=e.styles.map(l))}_mountTemplate(){let e=this._component.templateResult;e&&this._applyResult(e)}_scheduleMountCallbacks(){if(this._component.mountCallbacks.length===0)return;let e=this._component.generation;queueMicrotask(()=>{if(this._isStale(e))return;let t=this._component.mountCallbacks.splice(0);for(let e of t)try{let t={element:this,formResetCallbacks:[],mountCallbacks:[]};this._component.scope.run(()=>{i(t,()=>{let t=e();typeof t==`function`&&r(t)})}),t.mountCallbacks.length>0&&this._component.mountCallbacks.push(...t.mountCallbacks),t.formResetCallbacks.length>0&&this._component.formResetCallbacks.push(...t.formResetCallbacks)}catch(e){this._handleSetupError(e,`mounted`)}this._component.mountCallbacks.length>0&&this._scheduleMountCallbacks()})}};export{p as BaseElement};\n//# sourceMappingURL=base-element.js.map"],"mappings":";;;;;;;;;AAAoa,IAAI,WAAO;CAAC,oBAAmB,CAAC;CAAE,YAAW;CAAE,gBAAe,CAAC;CAAE,OAAMA,EAAE;CAAc,OAAMC,EAAE;CAAE,gBAAe;AAAI,IAAG,IAAE,cAAc,YAAW;CAAC,OAAO;CAAY,OAAO;CAAo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