@revolist/ui 4.0.1-rc → 4.0.3-rc

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 (288) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +345 -262
  3. package/_chunks/calendar-xpZ0v3xf.js +258 -0
  4. package/_chunks/chart-frame-Cmc7xU1i.js +130 -0
  5. package/_chunks/choice-chips-CHQTUdLs.js +110 -0
  6. package/_chunks/clock-BOhPNlW3.js +4 -0
  7. package/_chunks/{color-palette-BmZ7kH9R.js → color-palette-D8vyPfld.js} +41 -41
  8. package/_chunks/color-picker-CudqPYZo.js +138 -0
  9. package/_chunks/component-C_T2VN5u.js +863 -0
  10. package/_chunks/{component-metadata-BENbgTjU.js → component-metadata-BMOOmqx5.js} +0 -4
  11. package/_chunks/control-AHKXD5Eu.js +93 -0
  12. package/_chunks/{control-tooltip-BCNzQCXE.js → control-tooltip-uscKfAnV.js} +29 -29
  13. package/_chunks/{controller-CmLo-Ajc.js → controller-hRBm_Lfz.js} +15 -15
  14. package/_chunks/{controls-NEL5tDaz.js → controls-DsNi8V8I.js} +229 -214
  15. package/_chunks/{date-control-CYCkb1aQ.js → date-control-DrVFX13g.js} +21 -21
  16. package/_chunks/date-time-qIhp5vaX.js +768 -0
  17. package/_chunks/{delete-button-DnpmDNEJ.js → delete-button-CW9vjLnk.js} +7 -7
  18. package/_chunks/dialog.parts-CKGkC5zP.js +134 -0
  19. package/_chunks/duration-CL68Em0o.js +272 -0
  20. package/_chunks/editor-commit-Bq3wSgvr.js +12 -0
  21. package/_chunks/{editor-popup-B7fu_A_T.js → editor-popup-WDdtVDNA.js} +8 -8
  22. package/_chunks/field-context-D57PnBbH.js +5 -0
  23. package/_chunks/framework-mount--RTLIqE-.js +54 -0
  24. package/_chunks/history-controls-B3u3INEK.js +27 -0
  25. package/_chunks/hooks.module-CG3gN83z.js +157 -0
  26. package/_chunks/jsxRuntime.module-F6UFnpT-.js +30 -0
  27. package/_chunks/mount-DQ1cpppK.js +257 -0
  28. package/_chunks/native-control-C_yok8_-.js +605 -0
  29. package/_chunks/native.view-ByyZ1CT5.js +32 -0
  30. package/_chunks/{number-input-NnH57J4j.js → number-input-BKwA5FnM.js} +89 -89
  31. package/_chunks/picker-h1P5RUgp.js +122 -0
  32. package/_chunks/popup-CT2uD3go.js +367 -0
  33. package/_chunks/preact.module-BBM36DnO.js +290 -0
  34. package/_chunks/{rating-choice-CWAsNQNS.js → rating-choice-DZgmaic0.js} +10 -10
  35. package/_chunks/render-m5eMMwFR.js +83 -0
  36. package/_chunks/reorder-list-CSlqAGHw.js +59 -0
  37. package/_chunks/request-trail-DSlFix6i.js +618 -0
  38. package/_chunks/rich-text-CH7gIqOS.js +636 -0
  39. package/_chunks/rotate-right-Iha5ScJ1.js +4 -0
  40. package/_form.scss +1 -1
  41. package/_vendor/preact/LICENSE +21 -0
  42. package/_vendor/preact/compat/src/index.d.ts +353 -0
  43. package/_vendor/preact/compat/src/suspense-list.d.ts +16 -0
  44. package/_vendor/preact/compat/src/suspense.d.ts +19 -0
  45. package/_vendor/preact/hooks/src/index.d.ts +145 -0
  46. package/_vendor/preact/src/dom.d.ts +2548 -0
  47. package/_vendor/preact/src/index.d.ts +373 -0
  48. package/_vendor/preact/src/jsx.d.ts +2958 -0
  49. package/activity-message.d.ts +1 -1
  50. package/activity-message.js +16 -16
  51. package/ai/_chat.scss +195 -0
  52. package/ai/_style.scss +105 -34
  53. package/ai/chat.d.ts +63 -0
  54. package/ai/components.d.ts +20 -4
  55. package/ai/index.d.ts +2 -0
  56. package/ai/index.js +3 -3
  57. package/ai/mount.d.ts +30 -1
  58. package/ai/prompt-history.d.ts +13 -0
  59. package/ai/request-trail.d.ts +1 -1
  60. package/ai/transcript.d.ts +25 -0
  61. package/ai/translation-context.d.ts +1 -1
  62. package/ai/translations.d.ts +1 -1
  63. package/alert.d.ts +2 -2
  64. package/angular/angular.js +0 -3
  65. package/assignee/field.d.ts +2 -2
  66. package/assignee/index.js +86 -87
  67. package/assignee/layout.d.ts +2 -2
  68. package/assignee/picker.d.ts +1 -1
  69. package/avatar/index.js +25 -25
  70. package/avatar/index.view.d.ts +1 -1
  71. package/brush-range/component.d.ts +1 -1
  72. package/brush-range/component.js +30 -30
  73. package/buttons/delete-button.d.ts +2 -1
  74. package/buttons/delete-button.js +1 -1
  75. package/buttons/remove-button.d.ts +1 -1
  76. package/buttons/remove-button.js +3 -3
  77. package/buttons/svg-button.d.ts +2 -1
  78. package/buttons/svg-button.js +35 -35
  79. package/calendar/_calendar.scss +7 -2
  80. package/calendar/calendar.d.ts +1 -1
  81. package/calendar/calendar.js +1 -1
  82. package/calendar/caption.d.ts +1 -1
  83. package/calendar/day.d.ts +1 -1
  84. package/calendar/day.js +4 -4
  85. package/calendar/header.d.ts +1 -1
  86. package/calendar/header.js +35 -35
  87. package/calendar/index.js +2 -2
  88. package/calendar/month-grid.d.ts +1 -1
  89. package/calendar/month-grid.js +37 -37
  90. package/calendar/picker.d.ts +1 -1
  91. package/calendar/types.d.ts +1 -1
  92. package/calendar/year-grid.d.ts +1 -1
  93. package/calendar/year-grid.js +12 -12
  94. package/checkbox/index.d.ts +2 -2
  95. package/checkbox/index.js +9 -9
  96. package/choice-chips/index.d.ts +1 -1
  97. package/choice-chips/index.js +1 -1
  98. package/color-palette/color-palette.d.ts +1 -1
  99. package/color-palette/color-palette.js +1 -1
  100. package/color-palette/color-picker.d.ts +1 -1
  101. package/color-palette/color-picker.js +2 -2
  102. package/component-catalog.d.ts +34 -23
  103. package/control-attributes.js +7 -7
  104. package/control-presentation.js +18 -18
  105. package/controls.d.ts +12 -10
  106. package/controls.js +3 -3
  107. package/core/editor-commit.d.ts +1 -1
  108. package/core/editor-popup.d.ts +1 -1
  109. package/core/editor-popup.js +1 -1
  110. package/date-time/date-control.d.ts +1 -1
  111. package/date-time/field.d.ts +2 -2
  112. package/date-time/index.js +1 -1
  113. package/date-time/picker.d.ts +1 -1
  114. package/date-time/style.scss +4 -4
  115. package/date-time/time-control.d.ts +1 -1
  116. package/date-time/time-selection.d.ts +1 -1
  117. package/date-time/types.d.ts +1 -1
  118. package/dialog/dialog-action-footer.view.d.ts +1 -1
  119. package/dialog/dialog.dom.js +52 -52
  120. package/dialog/dialog.parts.d.ts +18 -18
  121. package/dialog/dialog.parts.js +1 -1
  122. package/dialog/dialog.preact.d.ts +1 -1
  123. package/dialog/dialog.preact.js +6 -6
  124. package/distribution-chart/area-chart.d.ts +1 -1
  125. package/distribution-chart/area-chart.js +25 -25
  126. package/distribution-chart/bar-chart.d.ts +6 -3
  127. package/distribution-chart/bar-chart.js +10 -6
  128. package/distribution-chart/chart-frame.d.ts +3 -2
  129. package/distribution-chart/index.d.ts +1 -1
  130. package/distribution-chart/index.js +6 -6
  131. package/distribution-chart/line-chart.d.ts +1 -1
  132. package/distribution-chart/line-chart.js +9 -9
  133. package/distribution-chart/types.d.ts +1 -1
  134. package/dropdown/content.d.ts +3 -2
  135. package/dropdown/content.js +1 -141
  136. package/dropdown/control.d.ts +14 -0
  137. package/dropdown/control.js +1 -0
  138. package/dropdown/control.view.d.ts +6 -0
  139. package/dropdown/dropdown.service.d.ts +1 -1
  140. package/dropdown/dropdown.service.js +9 -9
  141. package/dropdown/dropdown.types.d.ts +4 -0
  142. package/dropdown/editor-dropdown.style.scss +37 -9
  143. package/dropdown/index.d.ts +1 -1
  144. package/dropdown/index.js +3 -4
  145. package/dropdown/lookup-field.d.ts +1 -1
  146. package/dropdown/lookup-field.js +41 -41
  147. package/dropdown/popup.d.ts +1 -1
  148. package/dropdown/popup.js +1 -140
  149. package/duration/controls.d.ts +1 -1
  150. package/duration/index.d.ts +2 -2
  151. package/duration/index.js +1 -1
  152. package/duration/style.scss +1 -1
  153. package/editor-actions.d.ts +1 -1
  154. package/editor-actions.js +21 -20
  155. package/editor-layout/index.d.ts +1 -1
  156. package/editor-layout/index.js +27 -27
  157. package/field-configurator.d.ts +1 -1
  158. package/field-configurator.js +93 -93
  159. package/field-reorder.hook.js +32 -32
  160. package/fieldset.d.ts +3 -0
  161. package/filter/filters/slider/preact.js +3 -3
  162. package/filter/filters/slider/single.d.ts +1 -1
  163. package/filter/filters/slider/single.js +23 -23
  164. package/filter-badge.d.ts +1 -1
  165. package/filter-badge.js +23 -22
  166. package/filter-controls.d.ts +1 -1
  167. package/filter-controls.js +30 -30
  168. package/form-controls/field-context.d.ts +5 -0
  169. package/form-controls/index.js +16 -21
  170. package/form-controls/index.view.d.ts +2 -4
  171. package/form-controls/presentation.d.ts +1 -1
  172. package/form-controls/presentation.js +59 -51
  173. package/formatting/comparison-preview.d.ts +1 -1
  174. package/formatting/control-tooltip.d.ts +1 -1
  175. package/formatting/icon-controls.d.ts +1 -1
  176. package/formatting/index.js +105 -100
  177. package/formatting/inspector-section.d.ts +1 -1
  178. package/formatting/typography-controls.d.ts +1 -1
  179. package/framework-mount.d.ts +1 -1
  180. package/framework.js +215 -207
  181. package/history-controls.d.ts +14 -0
  182. package/history-controls.js +1 -0
  183. package/icons/icon.d.ts +1 -1
  184. package/icons/icon.js +1 -1
  185. package/legend.d.ts +1 -1
  186. package/legend.js +12 -12
  187. package/masked-input/index.d.ts +1 -1
  188. package/masked-input/index.js +109 -109
  189. package/native-control.d.ts +14 -12
  190. package/native-control.js +3 -26
  191. package/native-styles.css +1 -1
  192. package/native.js +40 -39
  193. package/number-input/index.d.ts +1 -1
  194. package/number-input/index.js +1 -1
  195. package/package.json +18 -14
  196. package/pagination.d.ts +3 -0
  197. package/pagination.js +43 -33
  198. package/pdf-viewer/component.d.ts +1 -1
  199. package/pdf-viewer/controller.js +1 -1
  200. package/pdf-viewer/header.d.ts +1 -1
  201. package/pdf-viewer/index.js +13 -13
  202. package/pdf-viewer/search-bar.d.ts +1 -1
  203. package/pdf-viewer/status.d.ts +1 -1
  204. package/pdf-viewer/style.scss +3 -4
  205. package/pdf-viewer/toolbar.d.ts +1 -1
  206. package/pickers.d.ts +1 -1
  207. package/preact-mount.d.ts +1 -1
  208. package/preact-mount.js +1 -1
  209. package/preact.d.ts +2 -0
  210. package/preact.js +62 -62
  211. package/rating-choice.d.ts +1 -1
  212. package/rating-choice.js +1 -1
  213. package/react-adapter.d.ts +1 -1
  214. package/react-control.d.ts +0 -1
  215. package/react-control.js +2 -2
  216. package/react.d.ts +13 -3
  217. package/react.js +71 -88
  218. package/reorder-list.d.ts +1 -1
  219. package/reorder-list.js +1 -1
  220. package/resource-picker/resource-picker-avatar.d.ts +1 -1
  221. package/resource-picker/resource-picker-avatar.js +14 -14
  222. package/resource-picker/resource-picker-option.d.ts +1 -1
  223. package/resource-picker/resource-picker-option.js +28 -28
  224. package/resource-picker/resource-picker-popup.d.ts +1 -1
  225. package/resource-picker/resource-picker-popup.js +3 -3
  226. package/resource-picker/resource-picker.d.ts +1 -1
  227. package/resource-picker/resource-picker.js +88 -88
  228. package/resource-picker/resource-picker.scss +6 -3
  229. package/rich-text/engine.d.ts +16 -19
  230. package/rich-text/index.d.ts +7 -7
  231. package/rich-text/index.js +1 -1
  232. package/rich-text/model.d.ts +4 -3
  233. package/rich-text/render-model.d.ts +4 -5
  234. package/rich-text/style.scss +3 -12
  235. package/rich-text/toolbar.d.ts +7 -7
  236. package/rich-text/translations.d.ts +3 -15
  237. package/search-input/index.js +12 -12
  238. package/segmented-switch/index.d.ts +1 -1
  239. package/segmented-switch/index.js +1 -1
  240. package/select.d.ts +20 -0
  241. package/select.js +1 -0
  242. package/status-feedback/exit-snapshot.js +4 -4
  243. package/status-feedback/index.js +2 -2
  244. package/status-feedback/popover.js +10 -10
  245. package/status-feedback/render.d.ts +2 -2
  246. package/status-feedback/render.js +3 -44
  247. package/status-feedback/status-feedback.scss +7 -0
  248. package/status-feedback/types.d.ts +4 -0
  249. package/status-feedback/use-auto-dismiss.d.ts +3 -0
  250. package/styles/_compositions.scss +3 -1
  251. package/styles/_control.scss +12 -4
  252. package/styles/_primitives.scss +9 -8
  253. package/styles.css +1 -1
  254. package/surfaces.js +49 -49
  255. package/svelte/UiComponent.server.js +1 -48
  256. package/svelte/UiComponent.svelte +0 -21
  257. package/svelte.js +33 -68
  258. package/switch/index.js +15 -15
  259. package/time-grid.d.ts +1 -1
  260. package/time-grid.js +58 -58
  261. package/timeline-track/component.d.ts +5 -1
  262. package/timeline-track/index.js +91 -74
  263. package/timeline-track/model.d.ts +9 -0
  264. package/timeline-track/model.js +10 -1
  265. package/ui.css +1 -1
  266. package/vue-adapter.d.ts +1 -1
  267. package/vue.d.ts +138 -119
  268. package/vue.js +150 -174
  269. package/_chunks/calendar-BsDxCYhI.js +0 -248
  270. package/_chunks/chart-frame-BvxbmEU9.js +0 -126
  271. package/_chunks/choice-chips-0HfOnK_4.js +0 -110
  272. package/_chunks/color-picker-BRv-__AM.js +0 -138
  273. package/_chunks/component-D4PH5UZT.js +0 -859
  274. package/_chunks/date-time-DjucJmbc.js +0 -769
  275. package/_chunks/dialog.parts-Dt3KinUz.js +0 -134
  276. package/_chunks/dropdown-CkGQBm1Q.js +0 -357
  277. package/_chunks/duration-BCaktcvz.js +0 -270
  278. package/_chunks/editor-commit-D6Rf5rGz.js +0 -12
  279. package/_chunks/framework-mount-BKIOsvY-.js +0 -54
  280. package/_chunks/mount-0-8opf1j.js +0 -90
  281. package/_chunks/native.view-8q_nwQ7x.js +0 -32
  282. package/_chunks/picker-oazJ7sO_.js +0 -121
  283. package/_chunks/reorder-list-BV3kZXso.js +0 -59
  284. package/_chunks/request-trail-D0oVzdRd.js +0 -347
  285. package/_chunks/rich-text-2Rla349o.js +0 -477
  286. package/react-native-select.d.ts +0 -6
  287. package/rich-text/syntax.d.ts +0 -2
  288. package/vue-native-select.d.ts +0 -9
@@ -0,0 +1,768 @@
1
+ import { i as e } from "./preact.module-BBM36DnO.js";
2
+ import { c as t, i as n, n as r, r as i, t as a } from "./hooks.module-CG3gN83z.js";
3
+ import { t as o } from "./jsxRuntime.module-F6UFnpT-.js";
4
+ import { SvgIcon as s } from "../icons/icon.js";
5
+ import { n as c } from "./native-control-C_yok8_-.js";
6
+ import { createPreactElement as l, releasePreactElement as u } from "../preact-mount.js";
7
+ import { R as d, n as f } from "./controls-DsNi8V8I.js";
8
+ import { createControlId as p } from "../core/control-id.js";
9
+ import { EditorList as m, EditorListItem as h } from "../editor-layout/index.js";
10
+ import { t as g } from "./clock-BOhPNlW3.js";
11
+ import { i as _, s as v } from "./iso-B0YHBK7m.js";
12
+ import { f as y, h as b, m as x, p as S } from "./model-mPO2tG2f.js";
13
+ import { n as C, t as w } from "./date-control-DrVFX13g.js";
14
+ import { t as T } from "./picker-h1P5RUgp.js";
15
+ import { t as E } from "./editor-popup-WDdtVDNA.js";
16
+ import { n as D } from "./editor-commit-Bq3wSgvr.js";
17
+ import { EditorActions as O } from "../editor-actions.js";
18
+ //#region ../dates/src/date-controls.ts
19
+ var k = /^(\d{4})-(\d{2})-(\d{2})$/, A = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/, j = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
20
+ function M(e, t, n = "minute") {
21
+ if (Number.isNaN(t.getTime())) return "";
22
+ let r = `${P(t.getHours())}:${P(t.getMinutes())}${n === "second" ? `:${P(t.getSeconds())}` : ""}`;
23
+ if (e === "time") return r;
24
+ let i = _(t);
25
+ return e === "date" ? i : `${i}T${r}`;
26
+ }
27
+ function N(e, t, n = /* @__PURE__ */ new Date()) {
28
+ if (e === "time") {
29
+ let e = j.exec(t);
30
+ if (!e) return;
31
+ let r = Number(e[1]), i = Number(e[2]), a = Number(e[3] ?? 0);
32
+ if (r > 23 || i > 59 || a > 59 || Number.isNaN(n.getTime())) return;
33
+ let o = new Date(n.getTime());
34
+ return o.setHours(r, i, a, 0), o;
35
+ }
36
+ let r = e === "date" ? k.exec(t) : A.exec(t);
37
+ if (!r) return;
38
+ let i = Number(r[1]), a = Number(r[2]), o = Number(r[3]), s = Number(r[4] ?? 0), c = Number(r[5] ?? 0), l = Number(r[6] ?? 0), u = Number((r[7] ?? "").padEnd(3, "0")), d = /* @__PURE__ */ new Date(0);
39
+ if (d.setFullYear(i, a - 1, o), d.setHours(s, c, l, u), !(a < 1 || a > 12 || o < 1 || d.getFullYear() !== i || d.getMonth() !== a - 1 || d.getDate() !== o || d.getHours() !== s || d.getMinutes() !== c || d.getSeconds() !== l || d.getMilliseconds() !== u)) return d;
40
+ }
41
+ function P(e) {
42
+ return String(e).padStart(2, "0");
43
+ }
44
+ //#endregion
45
+ //#region ../dates/src/civil-time.ts
46
+ var F = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/;
47
+ function I(e) {
48
+ let t = /* @__PURE__ */ new Date(0);
49
+ return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(e.hour, e.minute, e.second, 0), t.getTime();
50
+ }
51
+ function L(e) {
52
+ let t = F.exec(e);
53
+ if (!t) return;
54
+ let n = {
55
+ year: Number(t[1]),
56
+ month: Number(t[2]),
57
+ day: Number(t[3]),
58
+ hour: Number(t[4]),
59
+ minute: Number(t[5]),
60
+ second: Number(t[6] ?? 0)
61
+ }, r = new Date(I(n)), i = {
62
+ year: r.getUTCFullYear(),
63
+ month: r.getUTCMonth() + 1,
64
+ day: r.getUTCDate(),
65
+ hour: r.getUTCHours(),
66
+ minute: r.getUTCMinutes(),
67
+ second: r.getUTCSeconds()
68
+ };
69
+ return Object.keys(n).every((e) => n[e] === i[e]) ? n : void 0;
70
+ }
71
+ //#endregion
72
+ //#region ../dates/src/temporal-controls.ts
73
+ function R(e) {
74
+ return e.split("T")[0];
75
+ }
76
+ function z(e) {
77
+ return e.includes("T") ? e.split("T")[1] : e;
78
+ }
79
+ function B(e, t, n) {
80
+ return n === "datetime" ? `${e}T${t.includes("T") ? z(t) : "00:00"}` : e;
81
+ }
82
+ function V(e, t, n) {
83
+ return n === "datetime" ? `${R(e)}T${t}` : t;
84
+ }
85
+ function H(e, t) {
86
+ return e === "date" ? v(t) : e === "datetime" ? !!L(t.replace(/(\d{2}:\d{2}:\d{2})\.\d{1,3}$/, "$1")) : !!N(e, t);
87
+ }
88
+ function U(e) {
89
+ let t = N("time", e);
90
+ return t ? t.getHours() * 3600 + t.getMinutes() * 60 + t.getSeconds() : void 0;
91
+ }
92
+ function W(e, t) {
93
+ let n = U(e);
94
+ if (n === void 0) return !1;
95
+ let r = t.min ? U(t.min) : void 0, i = t.max ? U(t.max) : void 0;
96
+ return (r === void 0 || n >= r) && (i === void 0 || n <= i) && (t.step === void 0 || t.step > 0 && (n - (r ?? 0)) % t.step === 0);
97
+ }
98
+ function G(e, t, n = "minute", r) {
99
+ let i = N("time", e);
100
+ return i ? new Intl.DateTimeFormat(r ?? (t === "12h" ? "en-US" : "en-GB"), {
101
+ hour: "2-digit",
102
+ minute: "2-digit",
103
+ ...n === "second" ? { second: "2-digit" } : {},
104
+ hourCycle: t === "12h" ? "h12" : "h23"
105
+ }).format(i) : e;
106
+ }
107
+ function K(e, t = "minute", n) {
108
+ if (e = e.replace(/[\u200e\u200f\u061c]/g, "").trim(), n) {
109
+ let t = new Intl.NumberFormat(n, { useGrouping: !1 });
110
+ for (let n = 0; n < 10; n++) e = e.split(t.format(n)).join(String(n));
111
+ let r = new Intl.DateTimeFormat(n, {
112
+ hour: "numeric",
113
+ hourCycle: "h12"
114
+ });
115
+ for (let [t, n] of [[1, "AM"], [13, "PM"]]) {
116
+ let i = r.formatToParts(new Date(2e3, 0, 1, t)).find((e) => e.type === "dayPeriod")?.value;
117
+ i && (e = e.replace(i, n));
118
+ }
119
+ let i = new Intl.DateTimeFormat(n, {
120
+ hour: "2-digit",
121
+ minute: "2-digit",
122
+ second: "2-digit",
123
+ hourCycle: "h23"
124
+ }).formatToParts(new Date(2e3, 0, 1, 13, 45, 20));
125
+ for (let t of i) t.type === "literal" && t.value.trim() && (e = e.split(t.value).join(":"));
126
+ e = e.replace(/^\s*(AM|PM)\s*(.*)$/i, "$2 $1");
127
+ }
128
+ let r = N("time", e.trim());
129
+ if (r) return M("time", r, t);
130
+ let i = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*([ap])\.?m\.?$/i.exec(e.trim());
131
+ if (!i) return;
132
+ let a = Number(i[1]);
133
+ if (a < 1 || a > 12) return;
134
+ let o = N("time", `${String(a % 12 + (i[4].toLowerCase() === "p" ? 12 : 0)).padStart(2, "0")}:${i[2]}:${i[3] ?? "00"}`);
135
+ return o ? M("time", o, t) : void 0;
136
+ }
137
+ //#endregion
138
+ //#region ../dates/src/time-selection.ts
139
+ function q(e) {
140
+ let t = e.min ? U(e.min) : void 0, n = e.max ? U(e.max) : void 0, r = e.step ?? (e.precision === "second" ? 1 : 60);
141
+ if (!Number.isFinite(r) || r <= 0) return [];
142
+ let i = e.precision === "second" ? 1 : 60, a = [];
143
+ for (let e = 0; e < 86400; e += i) (t === void 0 || e >= t) && (n === void 0 || e <= n) && (e - (t ?? 0)) % r === 0 && a.push(e);
144
+ return a;
145
+ }
146
+ function J(e, t = "minute") {
147
+ let n = (e) => String(e).padStart(2, "0");
148
+ return `${n(Math.floor(e / 3600))}:${n(Math.floor(e / 60) % 60)}${t === "second" ? `:${n(e % 60)}` : ""}`;
149
+ }
150
+ function ee(e, t) {
151
+ return e === "12h" || e === "locale" && !!new Intl.DateTimeFormat(t, { hour: "numeric" }).resolvedOptions().hour12;
152
+ }
153
+ function te(e, t) {
154
+ return new Intl.DateTimeFormat(t, {
155
+ hour: "numeric",
156
+ hourCycle: "h12"
157
+ }).formatToParts(new Date(2e3, 0, 1, e ? 13 : 1)).find((e) => e.type === "dayPeriod")?.value ?? (e ? "PM" : "AM");
158
+ }
159
+ function ne(e, t, n) {
160
+ let r = U(t), i = r ?? e[0] ?? 0, a = Math.floor(i / 3600), o = Math.floor(i / 60) % 60, s = i % 60, c = {
161
+ hour: /* @__PURE__ */ new Map(),
162
+ minute: /* @__PURE__ */ new Map(),
163
+ second: /* @__PURE__ */ new Map(),
164
+ period: /* @__PURE__ */ new Map()
165
+ }, l = (e, t, n, r) => {
166
+ let i = c[e].get(t);
167
+ (i === void 0 || Math.abs(n - r) < Math.abs(i - r)) && c[e].set(t, n);
168
+ };
169
+ for (let t of e) {
170
+ let e = Math.floor(t / 3600), r = Math.floor(t / 60) % 60, i = t % 60;
171
+ (!n || Math.floor(e / 12) === Math.floor(a / 12)) && l("hour", e, t, e * 3600 + o * 60 + s), e === a && l("minute", r, t, a * 3600 + r * 60 + s), e === a && r === o && l("second", i, t, a * 3600 + o * 60 + i);
172
+ let c = Math.floor(e / 12);
173
+ l("period", c, t, (a % 12 + c * 12) * 3600 + o * 60 + s);
174
+ }
175
+ return {
176
+ columns: c,
177
+ hour: a,
178
+ minute: o,
179
+ second: s,
180
+ period: Math.floor(a / 12),
181
+ hasValue: r !== void 0
182
+ };
183
+ }
184
+ //#endregion
185
+ //#region src/date-time/types.ts
186
+ var Y = {
187
+ date: "Date",
188
+ dates: "Dates",
189
+ invalidDate: "Enter a valid date in the indicated format.",
190
+ outOfRange: "The date is outside the allowed range.",
191
+ disabledDate: "This date is unavailable.",
192
+ invalidRange: "Enter a complete range with the start before or equal to the end.",
193
+ selectionCount: "The selection does not meet the allowed count or length.",
194
+ requiredValue: "A value is required.",
195
+ startDate: "Start date",
196
+ endDate: "End date",
197
+ startTime: "Start time",
198
+ endTime: "End time",
199
+ time: "Time",
200
+ hours: "Hour",
201
+ minutes: "Minute",
202
+ seconds: "Second",
203
+ dayPeriod: "Period",
204
+ noTimes: "No available times.",
205
+ invalid: "Enter a valid value within the allowed range.",
206
+ chooseDate: "Choose date",
207
+ chooseTime: "Choose time"
208
+ };
209
+ function X(e, t) {
210
+ return (e === "time" ? t?.chooseTime ?? t?.chooseDate : t?.chooseDate) ?? (e === "time" ? Y.chooseTime : Y.chooseDate);
211
+ }
212
+ //#endregion
213
+ //#region src/date-time/validation.ts
214
+ function Z(e, t, n = "") {
215
+ let { kind: r = "date", selection: i = "single", value: a, calendar: o = {} } = e, s = {
216
+ ...Y,
217
+ ...e.text
218
+ }, c = a && !Array.isArray(a) && typeof a == "object" ? a : void 0, l = typeof a == "string" ? a : "", u = c?.from ?? "", d = c?.to ?? "", f = e.required ?? o.required ?? !1, p = c ? [u, d] : Array.isArray(a) ? a : l ? [l] : [], m = (e) => v(e) && (!o.minDate || e >= o.minDate) && (!o.maxDate || e <= o.maxDate) && !o.isDateDisabled?.(e) && !o.isMonthDisabled?.(y(e, o.calendarSystem)), h = (t) => H(r, t) && (r === "time" || m(R(t))) && (r === "date" || W(z(t), {
219
+ min: e.minTime,
220
+ max: e.maxTime,
221
+ step: e.timeStep
222
+ })), g = c && d ? x(R(u), R(d)) : 0, _ = i === "multiple" ? p.length : g, b = !p.length && !f || i === "single" || (!o.min || _ >= o.min) && (o.max === void 0 || _ <= o.max), C = (() => {
223
+ if (r === "time" || !c?.to || !o.excludeDisabled || !p.every(h)) return !0;
224
+ if (g > 366e3) return !1;
225
+ for (let e = R(u); e <= R(d); e = S(e, 1)) if (!m(e)) return !1;
226
+ return !0;
227
+ })(), w = "", T = r === "time" || p.every((e) => {
228
+ let n = R(e);
229
+ if (!v(n)) return !1;
230
+ let r = o.validateSelection?.(n, {
231
+ month: o.month ?? t,
232
+ view: o.defaultView ?? "month",
233
+ referenceDate: o.referenceDate,
234
+ selection: c ? {
235
+ from: R(u),
236
+ to: R(d || u)
237
+ } : {
238
+ from: n,
239
+ to: n
240
+ }
241
+ });
242
+ return typeof r == "string" && (w = r), r !== !1 && typeof r != "string";
243
+ }), E = !n && b && T && C && (!f || p.length > 0) && p.every(h) && (i !== "multiple" || new Set(p).size === p.length) && (!c || !!d && u <= d) && (i !== "multiple" || r === "date"), D = (t) => e.text?.[t] ?? e.text?.invalid ?? s[t] ?? s.invalid, O = r === "time" ? [] : p.map(R);
244
+ return {
245
+ valid: E,
246
+ errorMessage: n || w || (!p.length && f ? D("requiredValue") : c && (!u || !d) ? D("invalidRange") : O.some((e) => !v(e)) ? D("invalidDate") : O.some((e) => o.minDate && e < o.minDate || o.maxDate && e > o.maxDate) ? D("outOfRange") : O.some((e) => !m(e)) || !C ? D("disabledDate") : c && (!d || u > d) ? D("invalidRange") : !b || i === "multiple" && new Set(p).size !== p.length ? D("selectionCount") : s.invalid),
247
+ validDate: m
248
+ };
249
+ }
250
+ //#endregion
251
+ //#region src/date-time/time-control.tsx
252
+ function re({ value: e, label: t, format: r = "locale", precision: i = "minute", locale: a, min: s, max: l, step: u, onChange: d }) {
253
+ let [f, p] = n(!1), [m, h] = n("");
254
+ if (r === "locale") return /* @__PURE__ */ o(c, {
255
+ type: "time",
256
+ "aria-label": t,
257
+ value: e,
258
+ min: s,
259
+ max: l,
260
+ step: u ?? (i === "second" ? 1 : 60),
261
+ onInput: (e) => d(e.currentTarget.value)
262
+ });
263
+ let g = G(e, r, i, a);
264
+ return /* @__PURE__ */ o(c, {
265
+ type: "text",
266
+ "aria-label": t,
267
+ value: f ? m : g,
268
+ "aria-invalid": !!e && !W(e, {
269
+ min: s,
270
+ max: l,
271
+ step: u
272
+ }),
273
+ placeholder: r === "12h" ? "09:00 AM" : "09:00",
274
+ onFocus: () => {
275
+ p(!0), h(g);
276
+ },
277
+ onBlur: () => p(!1),
278
+ onInput: (e) => {
279
+ let t = e.currentTarget.value;
280
+ h(t), d(t ? K(t, i, a) ?? t : "");
281
+ }
282
+ });
283
+ }
284
+ //#endregion
285
+ //#region src/date-time/time-selection.tsx
286
+ function ie({ label: e, accessibleLabel: t, values: n, selected: r, choices: s, display: c, onSelect: l }) {
287
+ let u = a(null), d = r !== void 0 && s.has(r), f = d ? r : n.find((e) => s.has(e));
288
+ i(() => {
289
+ let e = u.current;
290
+ if (!e) return;
291
+ let t = () => {
292
+ let t = e.querySelector("[aria-selected=\"true\"], [tabindex=\"0\"]");
293
+ t && e.clientHeight && (e.scrollTop = t.offsetTop - (e.clientHeight - t.clientHeight) / 2);
294
+ };
295
+ t();
296
+ let n = new ResizeObserver(t);
297
+ return n.observe(e), () => n.disconnect();
298
+ }, [r, f]);
299
+ let p = (e) => {
300
+ let t = s.get(Number(e));
301
+ t !== void 0 && l(t);
302
+ };
303
+ return /* @__PURE__ */ o("div", {
304
+ class: "rv-time-selection__column",
305
+ children: [/* @__PURE__ */ o("span", {
306
+ class: "rv-time-selection__label",
307
+ children: e
308
+ }), /* @__PURE__ */ o(m, {
309
+ label: t,
310
+ listRef: u,
311
+ variant: "plain",
312
+ className: "rv-time-selection__list",
313
+ onSelect: p,
314
+ children: n.map((e) => /* @__PURE__ */ o(h, {
315
+ value: String(e),
316
+ selected: r === e && d,
317
+ disabled: !s.has(e),
318
+ tabIndex: e === f ? 0 : -1,
319
+ onClick: () => p(String(e)),
320
+ children: c(e)
321
+ }, e))
322
+ })]
323
+ });
324
+ }
325
+ function Q({ value: e, label: t, text: n, onChange: i, format: a = "locale", precision: s = "minute", locale: c, min: l, max: u, step: d }) {
326
+ let f = ee(a, c), p = r(() => q({
327
+ min: l,
328
+ max: u,
329
+ step: d,
330
+ precision: s
331
+ }), [
332
+ l,
333
+ u,
334
+ d,
335
+ s
336
+ ]), m = r(() => ne(p, e, f), [
337
+ p,
338
+ e,
339
+ f
340
+ ]), h = r(() => new Intl.NumberFormat(c, {
341
+ minimumIntegerDigits: 2,
342
+ useGrouping: !1
343
+ }), [c]), g = (e) => i(J(e, s)), _ = (e, n, r, i = (e) => h.format(e)) => /* @__PURE__ */ o(ie, {
344
+ label: n,
345
+ accessibleLabel: `${t}: ${n}`,
346
+ values: r,
347
+ selected: m.hasValue ? m[e] : void 0,
348
+ choices: m.columns[e],
349
+ display: i,
350
+ onSelect: g
351
+ }), v = (e, t = 0) => Array.from({ length: e }, (e, n) => t + n);
352
+ return /* @__PURE__ */ o("section", {
353
+ class: "rv-time-selection",
354
+ children: [
355
+ /* @__PURE__ */ o("label", {
356
+ class: "rv-time-selection__entry",
357
+ children: [/* @__PURE__ */ o("span", { children: t }), /* @__PURE__ */ o(re, {
358
+ value: e,
359
+ label: t,
360
+ format: a,
361
+ precision: s,
362
+ locale: c,
363
+ min: l,
364
+ max: u,
365
+ step: d,
366
+ onChange: i
367
+ })]
368
+ }),
369
+ /* @__PURE__ */ o("div", {
370
+ class: `rv-time-selection__columns${s === "second" ? " rv-time-selection__columns--seconds" : ""}`,
371
+ children: [
372
+ _("hour", n.hours, v(f ? 12 : 24, f ? m.period * 12 : 0), (e) => h.format(f ? e % 12 || 12 : e)),
373
+ _("minute", n.minutes, v(60)),
374
+ s === "second" && _("second", n.seconds, v(60))
375
+ ]
376
+ }),
377
+ f && /* @__PURE__ */ o("div", {
378
+ class: "rv-time-selection__period",
379
+ children: _("period", n.dayPeriod, [0, 1], (e) => te(e, c))
380
+ }),
381
+ !p.length && /* @__PURE__ */ o("p", {
382
+ class: "rv-time-selection__empty",
383
+ role: "status",
384
+ children: n.noTimes
385
+ })
386
+ ]
387
+ });
388
+ }
389
+ //#endregion
390
+ //#region src/date-time/picker.tsx
391
+ function ae(r) {
392
+ let { kind: i = "date", selection: a = "single", value: s, onChange: c, calendar: l = {} } = r, u = {
393
+ ...Y,
394
+ ...r.text
395
+ }, [m] = n(() => p("rv-date-error")), h = (e) => i === "date" ? e : R(e), g = {
396
+ locale: l.locale,
397
+ ...typeof r.dateInput == "object" ? r.dateInput : {}
398
+ }, [_, x] = n(r.endpoint === "to" ? "to" : void 0), [S, C] = n(""), E = s && !Array.isArray(s) && typeof s == "object" ? s : void 0, D = typeof s == "string" ? s : "", O = Array.isArray(s) ? s : [], k = E?.from ?? "", A = E?.to ?? "", j = R(i === "time" ? b() : r.endpoint === "to" ? A : k || D || O[0] || ""), [M, N] = n(() => l.defaultMonth ?? y(v(j) ? j : b(), l.calendarSystem)), P = r.required ?? l.required ?? !1, { valid: F, errorMessage: I, validDate: L } = Z(r, M, S);
399
+ t(() => r.onValidityChange?.(!!F), [F]);
400
+ let H = (e) => {
401
+ C(""), c(e);
402
+ }, U = (e) => {
403
+ H(e), i === "date" && a !== "multiple" && Z({
404
+ ...r,
405
+ value: e
406
+ }, M).valid && r.onSelectionComplete?.(e);
407
+ }, W = (e) => {
408
+ if (!L(e)) return;
409
+ let t = y(e, l.calendarSystem);
410
+ t !== (l.month ?? M) && (N(t), l.onMonthChange?.(t));
411
+ }, G = (e, t) => {
412
+ if (typeof t != "string") return;
413
+ W(t);
414
+ let n = {
415
+ from: k,
416
+ to: A,
417
+ [e]: t ? B(t, e === "from" ? k : A, i) : ""
418
+ };
419
+ H(!n.from && !n.to ? null : n);
420
+ }, K = (e, t, n, i = !0) => /* @__PURE__ */ o("label", {
421
+ class: `rv-temporal-picker__time${i ? "" : " rv-temporal-picker__time--single"}`,
422
+ children: [i && /* @__PURE__ */ o("span", { children: t }), /* @__PURE__ */ o(re, {
423
+ label: t,
424
+ value: e ? z(e) : "",
425
+ min: r.minTime,
426
+ max: r.maxTime,
427
+ step: r.timeStep,
428
+ precision: r.precision,
429
+ format: r.timeFormat,
430
+ locale: l.locale,
431
+ onChange: n
432
+ })]
433
+ }), q = {
434
+ ...l,
435
+ month: l.month ?? M,
436
+ onMonthChange: (e) => {
437
+ N(e), l.onMonthChange?.(e);
438
+ },
439
+ required: P,
440
+ onInvalidSelection: (e, t) => {
441
+ C(e || u.invalid), l.onInvalidSelection?.(e, t);
442
+ }
443
+ }, J;
444
+ if (a === "multiple") J = {
445
+ ...q,
446
+ mode: "multiple",
447
+ selected: O.filter(v),
448
+ onSelectionChange: (e) => U([...e])
449
+ };
450
+ else if (a === "range" && !_) J = {
451
+ ...q,
452
+ mode: "range",
453
+ selected: k && v(R(k)) ? {
454
+ from: R(k),
455
+ ...A && v(R(A)) ? { to: R(A) } : {}
456
+ } : void 0,
457
+ onSelectionChange: (e) => U(e ? {
458
+ from: B(e.from, k, i),
459
+ ...e.to ? { to: B(e.to, A, i) } : {}
460
+ } : null)
461
+ };
462
+ else {
463
+ let e = a === "range" ? _ === "to" ? A : k : D;
464
+ J = {
465
+ ...q,
466
+ mode: "single",
467
+ selected: e && v(R(e)) ? R(e) : void 0,
468
+ onSelectionChange: (t) => {
469
+ U(a === "range" ? t ? {
470
+ from: k,
471
+ to: A,
472
+ [_ ?? "from"]: B(t, e, i)
473
+ } : null : t ? B(t, D, i) : null);
474
+ }
475
+ };
476
+ }
477
+ return /* @__PURE__ */ o("div", {
478
+ class: `rv-temporal-picker rv-temporal-picker--${i}`,
479
+ children: [
480
+ r.dateInput === !1 && a === "range" && i !== "time" && /* @__PURE__ */ o("div", {
481
+ class: `rv-temporal-picker__endpoints ${r.classNames?.endpoints ?? ""}`,
482
+ children: [/* @__PURE__ */ o(f, {
483
+ "aria-label": `${u.startDate}: ${k}`,
484
+ "aria-pressed": _ !== "to",
485
+ onClick: () => {
486
+ x(void 0), k && N(y(R(k), l.calendarSystem)), C("");
487
+ },
488
+ children: k ? R(k) : "—"
489
+ }), /* @__PURE__ */ o(f, {
490
+ "aria-label": `${u.endDate}: ${A}`,
491
+ "aria-pressed": _ === "to",
492
+ onClick: () => {
493
+ x("to"), A && N(y(R(A), l.calendarSystem)), C("");
494
+ },
495
+ children: A ? R(A) : "—"
496
+ })]
497
+ }),
498
+ /* @__PURE__ */ o("div", {
499
+ class: "rv-temporal-picker__header",
500
+ children: i !== "time" && r.dateInput !== !1 && /* @__PURE__ */ o("div", {
501
+ class: `rv-temporal-picker__dates ${a === "range" ? `rv-temporal-picker__endpoints ${r.classNames?.endpoints ?? ""}` : ""}`,
502
+ children: a === "range" ? /* @__PURE__ */ o(e, { children: [/* @__PURE__ */ o("div", {
503
+ class: "rv-temporal-picker__endpoint",
504
+ role: "group",
505
+ "aria-label": u.startDate,
506
+ children: [/* @__PURE__ */ o(w, {
507
+ label: u.startDate,
508
+ value: h(k),
509
+ options: g,
510
+ invalid: !F,
511
+ errorId: m,
512
+ onFocus: () => x(void 0),
513
+ onChange: (e) => G("from", e)
514
+ }), i === "datetime" && K(k, u.startTime, (e) => H({
515
+ from: V(k, e, i),
516
+ ...A ? { to: A } : {}
517
+ }), !1)]
518
+ }), /* @__PURE__ */ o("div", {
519
+ class: "rv-temporal-picker__endpoint",
520
+ role: "group",
521
+ "aria-label": u.endDate,
522
+ children: [/* @__PURE__ */ o(w, {
523
+ label: u.endDate,
524
+ value: h(A),
525
+ options: g,
526
+ invalid: !F,
527
+ errorId: m,
528
+ onFocus: () => x("to"),
529
+ onChange: (e) => G("to", e)
530
+ }), i === "datetime" && K(A, u.endTime, (e) => H({
531
+ from: k,
532
+ to: V(A, e, i)
533
+ }), !1)]
534
+ })] }) : /* @__PURE__ */ o(w, {
535
+ label: a === "multiple" ? u.dates : u.date,
536
+ value: a === "multiple" ? O : h(D),
537
+ multiple: a === "multiple",
538
+ options: g,
539
+ invalid: !F,
540
+ errorId: m,
541
+ onChange: (e) => {
542
+ typeof e == "string" && W(e), H(Array.isArray(e) ? e : e ? B(e, D, i) : null);
543
+ }
544
+ })
545
+ })
546
+ }),
547
+ /* @__PURE__ */ o("div", {
548
+ class: "rv-temporal-picker__body",
549
+ children: [i !== "time" && /* @__PURE__ */ o(T, { ...J }), i !== "date" && a !== "range" && /* @__PURE__ */ o(Q, {
550
+ value: z(D),
551
+ label: u.time,
552
+ text: u,
553
+ format: r.timeFormat,
554
+ precision: r.precision,
555
+ locale: l.locale,
556
+ min: r.minTime,
557
+ max: r.maxTime,
558
+ step: r.timeStep,
559
+ onChange: (e) => H(V(D, e, i))
560
+ })]
561
+ }),
562
+ i !== "date" && a === "range" && (i === "time" || r.dateInput === !1) && /* @__PURE__ */ o("div", {
563
+ class: "rv-temporal-picker__times",
564
+ children: [i === "time" ? /* @__PURE__ */ o(Q, {
565
+ value: z(k),
566
+ label: u.startTime,
567
+ text: u,
568
+ format: r.timeFormat,
569
+ precision: r.precision,
570
+ locale: l.locale,
571
+ min: r.minTime,
572
+ max: r.maxTime,
573
+ step: r.timeStep,
574
+ onChange: (e) => H({
575
+ from: e,
576
+ ...A ? { to: A } : {}
577
+ })
578
+ }) : K(k, u.startTime, (e) => H({
579
+ from: V(k, e, i),
580
+ ...A ? { to: A } : {}
581
+ })), i === "time" ? /* @__PURE__ */ o(Q, {
582
+ value: z(A),
583
+ label: u.endTime,
584
+ text: u,
585
+ format: r.timeFormat,
586
+ precision: r.precision,
587
+ locale: l.locale,
588
+ min: r.minTime,
589
+ max: r.maxTime,
590
+ step: r.timeStep,
591
+ onChange: (e) => H({
592
+ from: k,
593
+ to: e
594
+ })
595
+ }) : K(A, u.endTime, (e) => H({
596
+ from: k,
597
+ to: V(A, e, i)
598
+ }))]
599
+ }),
600
+ !F && /* @__PURE__ */ o(d, {
601
+ tone: "danger",
602
+ children: /* @__PURE__ */ o("span", {
603
+ id: m,
604
+ children: I
605
+ })
606
+ })
607
+ ]
608
+ });
609
+ }
610
+ //#endregion
611
+ //#region src/date-time/field.tsx
612
+ function $({ value: e, options: t, apply: r, cancel: i, clearable: a = !0 }) {
613
+ let [s, c] = n(e), [l, u] = n(!1), [f, p] = n(""), m = (e) => {
614
+ c(e), p("");
615
+ }, h = t.autoApply !== !1, g = JSON.stringify(s) !== JSON.stringify(e), _ = (e) => {
616
+ let t = r(e) || "";
617
+ return p(t), !t;
618
+ }, v = () => l ? _(s) : !1;
619
+ return D(() => !g || v(), h), /* @__PURE__ */ o("div", {
620
+ class: `rv-temporal-draft${t.kind === "time" ? " rv-temporal-draft--time" : ""}`,
621
+ onKeyDown: (e) => {
622
+ e.key === "Enter" && !e.isComposing && (e.ctrlKey || e.metaKey || h && e.target instanceof HTMLInputElement) && (e.preventDefault(), v());
623
+ },
624
+ children: [
625
+ /* @__PURE__ */ o(ae, {
626
+ ...t,
627
+ value: s,
628
+ onChange: m,
629
+ onValidityChange: u,
630
+ onSelectionComplete: h ? _ : void 0
631
+ }),
632
+ f && /* @__PURE__ */ o(d, {
633
+ tone: "danger",
634
+ children: f
635
+ }),
636
+ /* @__PURE__ */ o(O, {
637
+ text: t.actions,
638
+ showConfirm: t.showActions ?? !h,
639
+ disabled: !l,
640
+ apply: v,
641
+ cancel: i,
642
+ clear: !a || (t.required ?? t.calendar?.required) ? void 0 : () => {
643
+ let e = t.selection === "multiple" ? [] : null;
644
+ m(e), h && _(e);
645
+ }
646
+ })
647
+ ]
648
+ });
649
+ }
650
+ function oe({ value: e, kind: t = "date", picker: n, onValueChange: r, onInput: l, formatValue: u, parseValue: d, ...p }) {
651
+ let m = a(null), h = a(), _ = a({
652
+ value: e,
653
+ kind: t,
654
+ picker: n,
655
+ onValueChange: r,
656
+ input: p
657
+ });
658
+ return _.current = {
659
+ value: e,
660
+ kind: t,
661
+ picker: n,
662
+ onValueChange: r,
663
+ input: p
664
+ }, i(() => () => h.current?.close(), []), i(() => {
665
+ (p.disabled || p.readOnly) && h.current?.close();
666
+ }, [p.disabled, p.readOnly]), /* @__PURE__ */ o("span", {
667
+ class: "rv-date-time-field",
668
+ children: [/* @__PURE__ */ o(c, {
669
+ ...p,
670
+ type: "text",
671
+ value: u?.(e) ?? e,
672
+ placeholder: p.placeholder ?? (t === "date" ? "YYYY-MM-DD" : t === "time" ? "HH:mm" : "YYYY-MM-DDTHH:mm"),
673
+ onInput: (e) => {
674
+ l?.(e);
675
+ let t = d ? d(e.currentTarget.value) : e.currentTarget.value;
676
+ t !== void 0 && r?.(t);
677
+ }
678
+ }), /* @__PURE__ */ o(f, {
679
+ ref: m,
680
+ variant: "ghost",
681
+ "aria-label": X(t, n?.text),
682
+ disabled: p.disabled || p.readOnly,
683
+ onClick: () => {
684
+ m.current && !h.current && (h.current = E(m.current, (r) => /* @__PURE__ */ o($, {
685
+ value: e || null,
686
+ options: {
687
+ ...n,
688
+ required: n?.required ?? p.required,
689
+ kind: t,
690
+ selection: "single"
691
+ },
692
+ cancel: r,
693
+ apply: (e) => {
694
+ !_.current.input.disabled && !_.current.input.readOnly && _.current.onValueChange?.(typeof e == "string" ? e : ""), r();
695
+ }
696
+ }), {
697
+ label: X(t, n?.text),
698
+ className: t === "time" ? "rv-editor-popup--time" : t === "datetime" ? "rv-editor-popup--datetime" : void 0,
699
+ onClose: () => {
700
+ h.current = void 0;
701
+ }
702
+ }));
703
+ },
704
+ children: /* @__PURE__ */ o(s, { svg: t === "time" ? g : C })
705
+ })]
706
+ });
707
+ }
708
+ //#endregion
709
+ //#region src/date-time/attach.tsx
710
+ function se(e, t, n) {
711
+ let r, i = l(e.ownerDocument, /* @__PURE__ */ o(f, {
712
+ variant: "ghost",
713
+ disabled: e.disabled || e.readOnly,
714
+ "aria-label": X(t.kind ?? "date", t.text),
715
+ onClick: () => {
716
+ e.disabled || e.readOnly || r || (r = E(e, (r) => /* @__PURE__ */ o($, {
717
+ value: e.value || null,
718
+ options: {
719
+ ...t,
720
+ selection: "single",
721
+ required: t.required ?? t.calendar?.required ?? e.required
722
+ },
723
+ cancel: r,
724
+ apply: (t) => {
725
+ !e.disabled && !e.readOnly && n(typeof t == "string" ? t : ""), r();
726
+ }
727
+ }), {
728
+ className: t.kind === "time" ? "rv-editor-popup--time" : t.kind === "datetime" ? "rv-editor-popup--datetime" : void 0,
729
+ label: X(t.kind ?? "date", t.text),
730
+ onClose: () => {
731
+ r = void 0;
732
+ }
733
+ }));
734
+ },
735
+ children: /* @__PURE__ */ o(s, { svg: t.kind === "time" ? g : C })
736
+ }));
737
+ e.after(i);
738
+ let a = e.ownerDocument.defaultView?.MutationObserver, c = a ? new a(() => {
739
+ i.disabled = e.disabled || e.readOnly, i.disabled && r?.close();
740
+ }) : void 0;
741
+ return c?.observe(e, {
742
+ attributes: !0,
743
+ attributeFilter: ["disabled", "readonly"]
744
+ }), () => {
745
+ c?.disconnect(), r?.close(), u(i), i.remove();
746
+ };
747
+ }
748
+ //#endregion
749
+ //#region src/date-time/value.tsx
750
+ function ce(e, t) {
751
+ let n = Number.isFinite(t.maxVisibleDates) ? Math.max(1, Math.floor(t.maxVisibleDates)) : 2, r = t.multiple ? t.values.slice(0, n) : t.values, i = t.values.length - r.length;
752
+ return e("span", {
753
+ class: "rv-temporal-value",
754
+ role: t.fullValue ? "group" : void 0,
755
+ dir: t.dir ?? "auto",
756
+ title: t.fullValue || void 0,
757
+ "data-tooltip": t.fullValue || void 0,
758
+ "aria-label": t.fullValue || void 0
759
+ }, [...r.map((t) => e("span", {
760
+ class: "rv-badge rv-temporal-value__item",
761
+ "aria-hidden": "true"
762
+ }, t)), i > 0 ? e("span", {
763
+ class: "rv-badge rv-temporal-value__more",
764
+ "aria-hidden": "true"
765
+ }, `+${i}`) : null]);
766
+ }
767
+ //#endregion
768
+ export { ae as a, $ as i, se as n, Y as o, oe as r, X as s, ce as t };