@revolist/ui 4.0.4-rc → 4.0.6-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 (240) hide show
  1. package/MIGRATION.md +36 -0
  2. package/OWNERSHIP.md +10 -10
  3. package/README.md +22 -4
  4. package/_chunks/arrow-up-Cw8hW9vp.js +4 -0
  5. package/_chunks/badge.view-D30pMUfi.js +14 -0
  6. package/_chunks/calculator-CDWOuAcp.js +4 -0
  7. package/_chunks/{calendar-xpZ0v3xf.js → calendar-QWDyYzdo.js} +19 -19
  8. package/_chunks/chart-frame-hcOlnQ1K.js +145 -0
  9. package/_chunks/check-BwI7iCAm.js +4 -0
  10. package/_chunks/choice-chips-A6WR-WJe.js +126 -0
  11. package/_chunks/{color-palette-D8vyPfld.js → color-palette-DMJUChWC.js} +20 -22
  12. package/_chunks/color-picker-BK4W1nd6.js +143 -0
  13. package/_chunks/{component-C_T2VN5u.js → component-CMkF17YZ.js} +281 -265
  14. package/_chunks/{component-metadata-BMOOmqx5.js → component-metadata-BKd7U8OW.js} +0 -8
  15. package/_chunks/configurator-actions-By8WSL2m.js +155 -0
  16. package/_chunks/configurator-field-icon-CmcM_sPs.js +53 -0
  17. package/_chunks/{control-AHKXD5Eu.js → control-mlH7l0Uq.js} +42 -17
  18. package/_chunks/{controls-DsNi8V8I.js → controls-FUU-MUKC.js} +171 -186
  19. package/_chunks/{date-control-DrVFX13g.js → date-control-Dup_P3w5.js} +1 -1
  20. package/_chunks/{date-time-qIhp5vaX.js → date-time-9z6pAG5T.js} +317 -278
  21. package/_chunks/dialog.parts-Bi7YbXqS.js +131 -0
  22. package/_chunks/{duration-CL68Em0o.js → duration-D7oRjsmP.js} +5 -5
  23. package/_chunks/editor-popup-ByU7qiub.js +82 -0
  24. package/_chunks/field-configurator-BCINdXpU.js +223 -0
  25. package/_chunks/{framework-mount--RTLIqE-.js → framework-mount-Bk4O_T7T.js} +1 -1
  26. package/_chunks/icon-toolbar-DSjOdwM7.js +134 -0
  27. package/_chunks/magnifying-glass-CvrTDSkB.js +4 -0
  28. package/_chunks/minus-BOAR3A1C.js +4 -0
  29. package/_chunks/mount-Cw2zk58T.js +266 -0
  30. package/_chunks/{native.view-ByyZ1CT5.js → native-Blr3byjO.js} +1 -1
  31. package/_chunks/native-control-pFMuHf3G.js +644 -0
  32. package/_chunks/{number-input-BKwA5FnM.js → number-input-DqXV6vgP.js} +7 -7
  33. package/_chunks/{picker-h1P5RUgp.js → picker-gEGTu1Ki.js} +2 -2
  34. package/_chunks/plus-CbGRkIGl.js +4 -0
  35. package/_chunks/popover-controller-D-AvKQ7B.js +102 -0
  36. package/_chunks/{popup-CT2uD3go.js → popup-C35Isk7p.js} +115 -104
  37. package/_chunks/{rating-choice-DZgmaic0.js → rating-choice-DbxdUJr-.js} +1 -1
  38. package/_chunks/{reorder-list-CSlqAGHw.js → reorder-list-B0_13Sja.js} +1 -1
  39. package/_chunks/request-trail-CCSK6TJA.js +753 -0
  40. package/_chunks/rich-text-5rnc8lpI.js +842 -0
  41. package/_chunks/rotate-left-BF6G883o.js +4 -0
  42. package/_chunks/title-tooltip-Cw6LOZhb.js +11 -0
  43. package/_chunks/tooltip-D4xkio5G.js +54 -0
  44. package/_chunks/tooltip-owner-DjdvqKzz.js +19 -0
  45. package/_chunks/tooltip-session-B6X6x8G_.js +110 -0
  46. package/_chunks/tooltip-text-BXsUEmBH.js +12 -0
  47. package/_chunks/top-layer-popup-CNSDdfJV.js +59 -0
  48. package/_variables.scss +33 -32
  49. package/ai/_chat.scss +28 -3
  50. package/ai/_style.scss +55 -2
  51. package/ai/chat.d.ts +3 -1
  52. package/ai/components.d.ts +13 -2
  53. package/ai/index.d.ts +1 -0
  54. package/ai/index.js +3 -3
  55. package/ai/mount.d.ts +17 -1
  56. package/ai/results/_style.scss +83 -0
  57. package/ai/results/index.d.ts +11 -0
  58. package/ai/results/metrics.d.ts +5 -0
  59. package/ai/results/table.d.ts +5 -0
  60. package/ai/results/text.d.ts +5 -0
  61. package/ai/results/types.d.ts +29 -0
  62. package/ai/transcript.d.ts +2 -0
  63. package/ai/translations.d.ts +1 -1
  64. package/assignee/assignee.scss +5 -1
  65. package/assignee/index.js +2 -2
  66. package/avatar/index.d.ts +25 -2
  67. package/avatar/index.js +33 -32
  68. package/badge.view.d.ts +8 -0
  69. package/brush-range/component.d.ts +1 -3
  70. package/brush-range/component.js +27 -27
  71. package/buttons/remove-button.d.ts +1 -1
  72. package/buttons/remove-button.style.scss +1 -1
  73. package/buttons/svg-button.d.ts +1 -1
  74. package/buttons/svg-button.js +16 -16
  75. package/calendar/_calendar.scss +2 -2
  76. package/calendar/calendar.js +1 -1
  77. package/calendar/index.js +2 -2
  78. package/checkbox/checkbox.scss +1 -22
  79. package/choice-chips/index.d.ts +3 -1
  80. package/choice-chips/index.js +1 -1
  81. package/color-palette/color-palette.js +1 -1
  82. package/color-palette/color-palette.style.scss +1 -1
  83. package/color-palette/color-picker.js +2 -2
  84. package/color-palette/common-palettes.d.ts +1 -1
  85. package/color-palette/common-palettes.js +1 -1
  86. package/color-palette/native.d.ts +15 -2
  87. package/component-catalog.d.ts +9 -7
  88. package/configurator-actions.d.ts +67 -0
  89. package/configurator-actions.js +1 -0
  90. package/configurator-aggregation-list.d.ts +14 -0
  91. package/configurator-aggregation-list.js +61 -0
  92. package/configurator-drop-zone.d.ts +38 -0
  93. package/configurator-drop-zone.js +64 -0
  94. package/configurator-field-icon.d.ts +10 -0
  95. package/configurator-field-icon.js +1 -0
  96. package/configurator-focus.d.ts +4 -0
  97. package/configurator-focus.js +39 -0
  98. package/configurator-sections.d.ts +42 -0
  99. package/configurator-sections.js +71 -0
  100. package/control-presentation.d.ts +8 -2
  101. package/control-presentation.js +25 -20
  102. package/controls.d.ts +1 -2
  103. package/controls.js +4 -3
  104. package/core/editor-popup-position.d.ts +6 -2
  105. package/core/editor-popup.d.ts +4 -0
  106. package/core/editor-popup.js +1 -1
  107. package/core/popover-controller.d.ts +35 -0
  108. package/core/popup-ownership.d.ts +2 -0
  109. package/core/title-tooltip.d.ts +2 -0
  110. package/core/tooltip-session.d.ts +29 -0
  111. package/core/tooltip-surface.d.ts +13 -0
  112. package/core/tooltip-text.d.ts +6 -0
  113. package/core/tooltip.d.ts +35 -0
  114. package/core/top-layer-popup.d.ts +4 -0
  115. package/core/top-layer-popup.js +1 -23
  116. package/date-time/attach.d.ts +1 -1
  117. package/date-time/field.d.ts +3 -2
  118. package/date-time/index.js +1 -1
  119. package/date-time/style.scss +64 -7
  120. package/date-time/time-selection.d.ts +3 -1
  121. package/date-time/types.d.ts +5 -1
  122. package/dialog/dialog-action-footer.d.ts +17 -2
  123. package/dialog/dialog.dom.d.ts +15 -2
  124. package/dialog/dialog.dom.js +9 -9
  125. package/dialog/dialog.parts.d.ts +1 -1
  126. package/dialog/dialog.parts.js +1 -1
  127. package/distribution-chart/_distribution-chart.scss +12 -54
  128. package/distribution-chart/area-chart.js +1 -1
  129. package/distribution-chart/bar-chart.js +1 -1
  130. package/distribution-chart/index.d.ts +1 -1
  131. package/distribution-chart/line-chart.js +1 -1
  132. package/dropdown/content.js +1 -1
  133. package/dropdown/control.js +1 -1
  134. package/dropdown/editor-dropdown.style.scss +5 -0
  135. package/dropdown/index.js +2 -2
  136. package/dropdown/lookup-field.d.ts +5 -0
  137. package/dropdown/lookup-field.js +2 -1
  138. package/dropdown/popup.d.ts +2 -2
  139. package/dropdown/popup.js +1 -1
  140. package/duration/index.js +1 -1
  141. package/editor-actions.js +1 -1
  142. package/field-configurator.d.ts +27 -0
  143. package/field-configurator.js +4 -170
  144. package/field-expansion.d.ts +9 -0
  145. package/filter/filters/slider/_slider.scss +8 -25
  146. package/filter/filters/slider/control.js +2 -0
  147. package/filter/filters/slider/runtime.js +49 -22
  148. package/filter/filters/slider/single.js +1 -1
  149. package/filter-badge.js +1 -1
  150. package/filter-controls.d.ts +0 -1
  151. package/filter-controls.js +5 -6
  152. package/form-controls/index.d.ts +10 -2
  153. package/form-controls/index.js +7 -7
  154. package/form-controls/presentation.js +12 -12
  155. package/formatting/index.d.ts +1 -1
  156. package/formatting/index.js +22 -21
  157. package/formatting/styles.scss +2 -47
  158. package/framework.js +226 -222
  159. package/history-controls.js +27 -1
  160. package/icon-toolbar.d.ts +62 -0
  161. package/icon-toolbar.js +1 -0
  162. package/masked-input/index.js +1 -1
  163. package/native-control.d.ts +1 -2
  164. package/native-control.js +1 -1
  165. package/native-controls.d.ts +54 -2
  166. package/native-styles.css +1 -1
  167. package/native.js +46 -43
  168. package/number-input/index.js +1 -1
  169. package/package.json +36 -1
  170. package/pagination.js +11 -11
  171. package/pdf-viewer/index.js +1 -1
  172. package/pickers.d.ts +5 -1
  173. package/preact-mount.js +1 -1
  174. package/preact.d.ts +8 -6
  175. package/preact.js +71 -64
  176. package/rating-choice.js +1 -1
  177. package/react-control.d.ts +2 -0
  178. package/react-control.js +2 -2
  179. package/react.d.ts +5 -6
  180. package/react.js +68 -66
  181. package/reorder-list.js +1 -1
  182. package/resource-picker/resource-picker-popup.js +1 -1
  183. package/resource-picker/resource-picker.js +4 -4
  184. package/rich-text/engine.d.ts +1 -0
  185. package/rich-text/format-html.d.ts +2 -0
  186. package/rich-text/index.d.ts +4 -0
  187. package/rich-text/index.js +1 -1
  188. package/rich-text/model.d.ts +2 -0
  189. package/rich-text/style.scss +165 -70
  190. package/rich-text/syntax.d.ts +5 -0
  191. package/rich-text/translations.d.ts +2 -0
  192. package/search-input/index.js +1 -1
  193. package/search-input/native.d.ts +21 -2
  194. package/select.d.ts +3 -1
  195. package/select.js +1 -1
  196. package/status-feedback/exit-snapshot.js +4 -4
  197. package/status-feedback/popover.js +4 -4
  198. package/styles/_alert.scss +18 -4
  199. package/styles/_compositions.scss +3 -3
  200. package/styles/_editor-slider.scss +0 -2
  201. package/styles/_field-configurator.scss +147 -0
  202. package/styles/_fields-grid.scss +37 -0
  203. package/styles/_palette.scss +0 -24
  204. package/styles/_primitives.scss +28 -19
  205. package/styles/configurator-actions.scss +141 -0
  206. package/styles/{legacy-pagination.css → pagination.css} +19 -2
  207. package/styles.css +1 -1
  208. package/styles.scss +2 -2
  209. package/surfaces.d.ts +36 -2
  210. package/surfaces.js +35 -132
  211. package/svelte.js +3 -3
  212. package/switch/index.js +15 -14
  213. package/time-grid.d.ts +0 -1
  214. package/time-grid.js +38 -37
  215. package/timeline-track/index.js +2 -2
  216. package/ui.css +1 -1
  217. package/vue.d.ts +26 -30
  218. package/vue.js +117 -121
  219. package/_chunks/chart-frame-Cmc7xU1i.js +0 -130
  220. package/_chunks/choice-chips-CHQTUdLs.js +0 -110
  221. package/_chunks/color-picker-CudqPYZo.js +0 -138
  222. package/_chunks/control-tooltip-uscKfAnV.js +0 -100
  223. package/_chunks/dialog.parts-CKGkC5zP.js +0 -134
  224. package/_chunks/editor-popup-WDdtVDNA.js +0 -81
  225. package/_chunks/history-controls-B3u3INEK.js +0 -27
  226. package/_chunks/mount-DQ1cpppK.js +0 -257
  227. package/_chunks/native-control-C_yok8_-.js +0 -605
  228. package/_chunks/request-trail-DSlFix6i.js +0 -618
  229. package/_chunks/rich-text-CH7gIqOS.js +0 -636
  230. package/avatar/index.view.d.ts +0 -25
  231. package/color-palette/native.view.d.ts +0 -15
  232. package/control-presentation.view.d.ts +0 -8
  233. package/dialog/dialog-action-footer.view.d.ts +0 -20
  234. package/dialog/dialog.dom.view.d.ts +0 -15
  235. package/form-controls/index.view.d.ts +0 -10
  236. package/formatting/control-tooltip.d.ts +0 -27
  237. package/native-controls.view.d.ts +0 -54
  238. package/search-input/native.view.d.ts +0 -21
  239. package/surfaces.view.d.ts +0 -63
  240. /package/styles/{legacy-rating.css → rating.css} +0 -0
@@ -0,0 +1,644 @@
1
+ import { c as e, i as t, u as n } from "./preact.module-BBM36DnO.js";
2
+ import { c as r, i, n as a, o, r as s, s as c, t as l } from "./hooks.module-CG3gN83z.js";
3
+ import { t as u } from "./jsxRuntime.module-F6UFnpT-.js";
4
+ import { renderPreactInto as d } from "../preact-mount.js";
5
+ import { i as f } from "./top-layer-popup-CNSDdfJV.js";
6
+ import { t as p } from "./title-tooltip-Cw6LOZhb.js";
7
+ import { t as m } from "./field-context-D57PnBbH.js";
8
+ import { r as h, t as g } from "./popup-C35Isk7p.js";
9
+ import { useDropdownService as _ } from "../dropdown/dropdown.service.js";
10
+ import { RemoveButton as v } from "../buttons/remove-button.js";
11
+ import { t as y } from "./chevron-down-GbplLa6s.js";
12
+ import { registerControl as b, renderControl as x } from "../control-presentation.js";
13
+ //#region src/dropdown/remote.ts
14
+ var S = {
15
+ loading: "Loading…",
16
+ empty: "No results found",
17
+ error: "Unable to load options.",
18
+ retry: "Retry",
19
+ loadMore: "Load more",
20
+ unavailable: (e) => `Unavailable (${String(e)})`
21
+ }, C = class {
22
+ source;
23
+ context;
24
+ changed;
25
+ text;
26
+ settings;
27
+ cache = /* @__PURE__ */ new Map();
28
+ ids = [];
29
+ items = [];
30
+ query = "";
31
+ cursor;
32
+ seen = /* @__PURE__ */ new Set();
33
+ searchAbort;
34
+ resolveAbort;
35
+ timer;
36
+ generation = 0;
37
+ resolution = 0;
38
+ disposed = !1;
39
+ loading = !1;
40
+ searchFailed = !1;
41
+ failedCursor;
42
+ resolveFailed = !1;
43
+ opened = !1;
44
+ constructor(e, t, n, r = S, i = {}) {
45
+ this.source = e, this.context = t, this.changed = n, this.text = r, this.settings = i;
46
+ }
47
+ remember(e) {
48
+ for (let t of e) {
49
+ if (typeof t.value != "string" && (typeof t.value != "number" || !Number.isFinite(t.value))) throw TypeError("Remote dropdown values must be finite numeric or string IDs.");
50
+ this.cache.set(t.value, t);
51
+ }
52
+ }
53
+ emit() {
54
+ this.disposed || this.changed({
55
+ items: [...this.items],
56
+ selected: this.ids.map((e) => this.cache.get(e) ?? {
57
+ value: e,
58
+ label: this.text.unavailable(e),
59
+ unresolved: !0
60
+ }),
61
+ loading: this.loading,
62
+ error: this.searchFailed || this.resolveFailed,
63
+ hasMore: this.cursor !== void 0
64
+ });
65
+ }
66
+ setSelected(e, t = []) {
67
+ this.remember(t), this.ids = [...new Set(e)], this.resolveAbort?.abort();
68
+ let n = ++this.resolution, r = this.ids.filter((e) => !this.cache.has(e));
69
+ if (this.resolveFailed = !1, this.emit(), !r.length || this.disposed) return;
70
+ let i = this.resolveAbort = new AbortController();
71
+ Promise.resolve().then(() => this.source.resolve({
72
+ ids: r,
73
+ signal: i.signal,
74
+ context: this.context
75
+ })).then((e) => {
76
+ this.disposed || i.signal.aborted || n !== this.resolution || (this.remember(e), this.emit());
77
+ }).catch(() => {
78
+ this.disposed || i.signal.aborted || n !== this.resolution || (this.resolveFailed = !0, this.emit());
79
+ });
80
+ }
81
+ search(e, t = !1) {
82
+ this.disposed || (this.opened = !0, this.query = e, this.searchAbort?.abort(), clearTimeout(this.timer), ++this.generation, this.items = [], this.cursor = void 0, this.seen.clear(), this.loading = !0, this.searchFailed = !1, this.emit(), t ? this.page(void 0, this.generation) : this.timer = setTimeout(() => void this.page(void 0, this.generation), this.settings.debounceMs ?? 200));
83
+ }
84
+ async page(e, t) {
85
+ if (this.disposed || t !== this.generation || this.seen.has(e)) return;
86
+ this.seen.add(e), this.loading = !0, this.searchFailed = !1, this.emit();
87
+ let n = this.searchAbort = new AbortController();
88
+ try {
89
+ let r = await this.source.search({
90
+ query: this.query,
91
+ cursor: e,
92
+ pageSize: this.settings.pageSize ?? 50,
93
+ signal: n.signal,
94
+ context: this.context
95
+ });
96
+ if (this.disposed || n.signal.aborted || t !== this.generation) return;
97
+ this.remember(r.items);
98
+ let i = new Map(this.items.map((e) => [e.value, e]));
99
+ r.items.forEach((e) => i.set(e.value, e)), this.items = [...i.values()], this.cursor = r.nextCursor ?? void 0, this.seen.has(this.cursor) && (this.cursor = void 0);
100
+ } catch {
101
+ if (this.disposed || n.signal.aborted || t !== this.generation) return;
102
+ this.seen.delete(e), this.failedCursor = e, this.searchFailed = !0;
103
+ } finally {
104
+ !this.disposed && !n.signal.aborted && t === this.generation && (this.loading = !1, this.emit());
105
+ }
106
+ }
107
+ loadMore() {
108
+ !this.loading && !this.searchFailed && this.cursor !== void 0 && this.page(this.cursor, this.generation);
109
+ }
110
+ retry() {
111
+ this.resolveFailed && this.setSelected(this.ids), this.searchFailed && this.opened && this.page(this.failedCursor, this.generation);
112
+ }
113
+ close() {
114
+ this.opened = !1, this.searchAbort?.abort(), clearTimeout(this.timer), ++this.generation, this.loading = !1, this.emit();
115
+ }
116
+ destroy() {
117
+ this.disposed = !0, this.close(), this.resolveAbort?.abort(), ++this.resolution;
118
+ }
119
+ };
120
+ //#endregion
121
+ //#region src/dropdown/remote-hook.ts
122
+ function w(e) {
123
+ let t = a(() => ({
124
+ ...S,
125
+ ...e.remoteText
126
+ }), [e.remoteText]), [n, o] = i({
127
+ items: [],
128
+ selected: [],
129
+ loading: !1,
130
+ error: !1,
131
+ hasMore: !1
132
+ }), c = l(), u = e.value === null || e.value === void 0 ? [] : Array.isArray(e.value) ? e.value : [e.value], d = JSON.stringify(u);
133
+ return s(() => {
134
+ if (!e.dataSource || e.disabled) {
135
+ o({
136
+ items: [],
137
+ selected: [],
138
+ loading: !1,
139
+ error: !1,
140
+ hasMore: !1
141
+ });
142
+ return;
143
+ }
144
+ let n = new C(e.dataSource, e.dataContext, o, t);
145
+ return c.current = n, () => {
146
+ n.destroy(), c.current === n && (c.current = void 0);
147
+ };
148
+ }, [
149
+ e.dataSource,
150
+ e.dataContext,
151
+ e.disabled,
152
+ t
153
+ ]), s(() => {
154
+ c.current?.setSelected(u, e.source);
155
+ }, [
156
+ d,
157
+ e.source,
158
+ e.dataSource,
159
+ e.dataContext,
160
+ e.disabled,
161
+ t
162
+ ]), r(() => {
163
+ e.open ? c.current?.search(e.initialQuery, !0) : c.current?.close();
164
+ }, [
165
+ e.open,
166
+ e.dataSource,
167
+ e.dataContext,
168
+ e.disabled,
169
+ e.initialQuery,
170
+ t
171
+ ]), {
172
+ ...n,
173
+ text: t,
174
+ search: (e) => c.current?.search(e),
175
+ loadMore: () => c.current?.loadMore(),
176
+ retry: () => c.current?.retry()
177
+ };
178
+ }
179
+ //#endregion
180
+ //#region src/dropdown/content.tsx
181
+ function T({ options: e, selectedValues: t, remote: n, value: i, onChange: a, config: o, multiSelect: c, search: d, searchPlaceholder: f, listboxId: p, searchId: m, renderOption: h, renderNoResults: g, onClose: v, onTabNavigation: y, theme: b }) {
182
+ let x = l(null), S = l(null), C = l(null), w = l(!1), { searchValue: T, focusedIndex: D, selectedOptions: ee, filteredOptions: O, handleSelect: te, handleKeyDown: k, handleSearchChange: A, setFocusedIndex: j } = _(e, i, a, o, v, n && {
183
+ selected: t ?? [],
184
+ search: n.search
185
+ }), M = D >= 0 && D < O.length && !O[D].disabled ? `${p}-option-${D}` : void 0;
186
+ return s(() => {
187
+ let e = C.current;
188
+ if (!w.current || !e || !M) return;
189
+ w.current = !1;
190
+ let t = e.ownerDocument.getElementById(M);
191
+ if (!t) return;
192
+ let n = e.getBoundingClientRect(), { top: r, bottom: i } = t.getBoundingClientRect();
193
+ r < n.top ? e.scrollTop += r - n.top : i > n.bottom && (e.scrollTop += i - n.bottom);
194
+ }), r(() => {
195
+ if (!o.autoFocus) return;
196
+ let e = () => {
197
+ d && x.current ? x.current.focus({ preventScroll: !0 }) : S.current?.focus({ preventScroll: !0 });
198
+ }, t = S.current?.ownerDocument.defaultView ?? (typeof window < "u" ? window : void 0);
199
+ if (!t) return;
200
+ e();
201
+ let n = t.setTimeout(e, 0), r = t.requestAnimationFrame(e), i = t.setTimeout(e, 16);
202
+ return () => {
203
+ t.clearTimeout(n), t.cancelAnimationFrame(r), t.clearTimeout(i);
204
+ };
205
+ }, [o.autoFocus, d]), /* @__PURE__ */ u("div", {
206
+ ref: S,
207
+ className: "dropdown-listbox",
208
+ "data-theme": b ?? "default",
209
+ role: "listbox",
210
+ id: p,
211
+ "aria-multiselectable": c,
212
+ "aria-activedescendant": M,
213
+ tabIndex: -1,
214
+ "aria-busy": n?.loading,
215
+ onScrollCapture: (e) => {
216
+ let t = e.target;
217
+ n && t.scrollHeight - t.scrollTop - t.clientHeight < 48 && n.loadMore();
218
+ },
219
+ onKeyUp: (e) => e.stopPropagation(),
220
+ onKeyDown: (e) => {
221
+ if (e.stopPropagation(), e.key === "Escape") e.preventDefault(), e.stopPropagation(), v(!1);
222
+ else if (e.key === "Tab") {
223
+ if (o.nativeTabNavigation && y) {
224
+ y();
225
+ return;
226
+ }
227
+ e.preventDefault(), e.stopPropagation(), o.closeOnTab && v(!0);
228
+ } else (e.key !== " " || e.target !== x.current) && (w.current = e.key === "ArrowDown" || e.key === "ArrowUp", k(e));
229
+ },
230
+ children: [
231
+ d && /* @__PURE__ */ u("div", {
232
+ className: "dropdown-search",
233
+ children: /* @__PURE__ */ u("input", {
234
+ ref: x,
235
+ type: "text",
236
+ id: m,
237
+ className: `dropdown-search-input ${b ? `theme-${b}` : ""}`,
238
+ placeholder: f,
239
+ value: T,
240
+ onChange: A,
241
+ onInput: A,
242
+ "aria-label": o.searchAriaLabel ?? "Search options"
243
+ })
244
+ }),
245
+ n?.loading && /* @__PURE__ */ u("div", {
246
+ role: "status",
247
+ children: n.text.loading
248
+ }),
249
+ n?.error && /* @__PURE__ */ u("div", {
250
+ role: "alert",
251
+ children: [
252
+ n.text.error,
253
+ " ",
254
+ /* @__PURE__ */ u(B, {
255
+ onClick: n.retry,
256
+ children: n.text.retry
257
+ })
258
+ ]
259
+ }),
260
+ /* @__PURE__ */ u(E, {
261
+ options: e,
262
+ filteredOptions: O,
263
+ multiSelect: c,
264
+ focusedIndex: D,
265
+ selectedOptions: ee,
266
+ onKeyDown: k,
267
+ onSelect: te,
268
+ onFocusChange: j,
269
+ renderOption: h,
270
+ renderNoResults: n ? () => n.loading || n.error ? null : n.text.empty : g,
271
+ dropdownListRef: C,
272
+ theme: b,
273
+ optionIdPrefix: p
274
+ }),
275
+ n?.hasMore && /* @__PURE__ */ u(B, {
276
+ disabled: n.loading,
277
+ onClick: n.loadMore,
278
+ children: n.text.loadMore
279
+ })
280
+ ]
281
+ });
282
+ }
283
+ function E({ options: n, filteredOptions: r, multiSelect: i, focusedIndex: a, selectedOptions: s, onKeyDown: c, onSelect: l, onFocusChange: d, renderOption: f, renderNoResults: p, dropdownListRef: m, theme: h, optionIdPrefix: g }) {
284
+ let _ = o((e) => s.some((t) => JSON.stringify(t.value) === JSON.stringify(e.value)), [s]), v = o((t, n) => {
285
+ let r = _(t), o = a === n;
286
+ return /* @__PURE__ */ u("li", {
287
+ id: `${g}-option-${n}`,
288
+ role: "option",
289
+ "data-value": typeof t.value == "string" || typeof t.value == "number" ? String(t.value) : void 0,
290
+ "aria-selected": r,
291
+ "aria-disabled": t.disabled,
292
+ tabIndex: -1,
293
+ className: `dropdown-option ${r ? "selected" : ""} ${o ? "focused" : ""} ${t.disabled ? "disabled" : ""} ${h ? `theme-${h}` : ""}`,
294
+ onClick: () => l(t),
295
+ onMouseEnter: () => {
296
+ t.disabled || d(n);
297
+ },
298
+ children: f ? f(e, t, r) : /* @__PURE__ */ u("div", {
299
+ className: "option-content",
300
+ children: [i && /* @__PURE__ */ u("input", {
301
+ type: "checkbox",
302
+ checked: r,
303
+ readOnly: !0,
304
+ disabled: t.disabled,
305
+ tabIndex: -1,
306
+ "aria-hidden": "true"
307
+ }), /* @__PURE__ */ u("span", { children: t.label })]
308
+ })
309
+ }, `${t.label}-${n}`);
310
+ }, [
311
+ a,
312
+ l,
313
+ _,
314
+ i,
315
+ f,
316
+ d,
317
+ h
318
+ ]);
319
+ return /* @__PURE__ */ u(t, { children: /* @__PURE__ */ u("ul", {
320
+ ref: m,
321
+ className: "dropdown-options",
322
+ role: "presentation",
323
+ tabIndex: -1,
324
+ children: r.length > 0 ? r.map(v) : /* @__PURE__ */ u("li", {
325
+ className: "no-results",
326
+ children: p ? p(e) : /* @__PURE__ */ u("span", { children: "No results found" })
327
+ })
328
+ }) });
329
+ }
330
+ //#endregion
331
+ //#region src/dropdown/index.tsx
332
+ var D = ({ options: t, className: n, renderValue: r }) => /* @__PURE__ */ u("span", {
333
+ className: `selected-value ${n}`,
334
+ children: r ? r(e, t[0]) : t[0].label
335
+ }), ee = ({ options: t, removeOption: n, className: r, renderValue: i, disabled: a, removeLabel: o }) => /* @__PURE__ */ u("div", {
336
+ className: `selected-values ${r}`,
337
+ children: t.map((t, r) => /* @__PURE__ */ u("span", {
338
+ className: "selected-tag",
339
+ children: [i ? i(e, t) : t.label, !a && !t.disabled && /* @__PURE__ */ u(v, {
340
+ compact: !0,
341
+ onClick: (e) => {
342
+ e.stopPropagation(), n(t);
343
+ },
344
+ locale: {
345
+ title: o?.(t.label) ?? `Remove ${t.label}`,
346
+ ariaLabel: o?.(t.label) ?? `Remove ${t.label}`
347
+ }
348
+ })]
349
+ }, r))
350
+ }), O = ({ className: e }) => /* @__PURE__ */ u("span", {
351
+ className: `dropdown-arrow ${e}`,
352
+ "aria-hidden": "true",
353
+ dangerouslySetInnerHTML: { __html: y }
354
+ }), te = ({ placeholder: e, className: t }) => [/* @__PURE__ */ u("span", {
355
+ className: `placeholder px-2 ${t}`,
356
+ children: e
357
+ }), /* @__PURE__ */ u(O, { className: "mr-2" })];
358
+ function k({ source: t, triggerAttributes: n, dataSource: o, dataContext: s, remoteText: c, value: d, onChange: m, placeholder: h = "Select an option", disabled: _ = !1, name: v, id: y, className: b = "", style: x, config: S = {}, renderContent: C, renderOption: E, renderValue: k, renderPlaceholder: A, renderSelectedValue: j, renderNoResults: M, onClose: N, beforeOutsideClose: P, environment: F }) {
359
+ let { search: I = !1, searchPlaceholder: L = "Search...", closeOnClickOutside: R = !0, autoOpen: z = !1, multiSelect: B = !1, portalTarget: V, ariaLabel: H, ariaLabelledBy: ne, ariaDescribedBy: re, popupClassName: ie, maxHeight: ae } = S, { title: oe, ...se } = n ?? {}, U = p(typeof oe == "string" ? oe : void 0), W = V ?? (S.topLayer ? U.current?.closest("dialog[open], [role=dialog], revo-grid") : void 0) ?? (typeof document < "u" ? document.body : null), G = a(() => y || `dropdown-${Math.random().toString(36).substring(2, 9)}`, [y]), K = `${G}-listbox`, ce = `${G}-search`, q = `${G}-menu`, [J, Y] = i(z && !_), [le, ue] = i(!_ && (z || !!S.autoFocus)), de = l(z), fe = S.theme ?? "default";
360
+ r(() => {
361
+ z && !de.current && !_ && (ue(!0), Y(!0)), de.current = z;
362
+ }, [z, _]), r(() => {
363
+ _ && J && (Y(!1), N?.(!1));
364
+ }, [_, J]);
365
+ let X = w({
366
+ dataSource: o,
367
+ dataContext: s,
368
+ remoteText: c,
369
+ value: d,
370
+ disabled: _,
371
+ source: t,
372
+ open: J,
373
+ initialQuery: S.initialSearch ?? ""
374
+ }), Z = o ? [...new Map([...X.selected, ...X.items].map((e) => [e.value, e])).values()] : t, Q = a(() => {
375
+ if (d === void 0) return [];
376
+ if (B && Array.isArray(d)) return Z.filter((e) => d.some((t) => JSON.stringify(t) === JSON.stringify(e.value)));
377
+ {
378
+ let e = Z.find((e) => JSON.stringify(e.value) === JSON.stringify(d));
379
+ return e ? [e] : [];
380
+ }
381
+ }, [
382
+ d,
383
+ Z,
384
+ B
385
+ ]), pe = () => {
386
+ _ || Y((e) => {
387
+ let t = !e;
388
+ return t && ue(!0), t;
389
+ });
390
+ }, $ = (e = !1) => {
391
+ Y((t) => (t && N?.(e), !1));
392
+ };
393
+ r(() => {
394
+ if (!J) return;
395
+ let e = U.current;
396
+ if (e) return F?.onOpen?.(e, $);
397
+ }, [J]);
398
+ let me = (e) => {
399
+ if (!(_ || e.disabled)) {
400
+ if (B) {
401
+ let t = Q.some((t) => JSON.stringify(t.value) === JSON.stringify(e.value)), n;
402
+ n = t ? Q.filter((t) => JSON.stringify(t.value) !== JSON.stringify(e.value)) : [...Q, e], m && m(n.map((e) => e.value));
403
+ } else m && m(e.value), $();
404
+ }
405
+ };
406
+ r(() => {
407
+ if (!R || !J) return;
408
+ let e = W?.ownerDocument ?? U.current?.ownerDocument ?? (typeof document < "u" ? document : void 0);
409
+ if (!e) return;
410
+ let t = (t) => {
411
+ let n = e.getElementById(q), r = t.target;
412
+ if (n && r && !f(n, r) && U.current && !U.current.contains(r)) {
413
+ if (P?.() === !1) {
414
+ t.preventDefault(), t.stopImmediatePropagation();
415
+ return;
416
+ }
417
+ $();
418
+ }
419
+ }, n = !!P;
420
+ return e.addEventListener("pointerdown", t, n), () => {
421
+ e.removeEventListener("pointerdown", t, n);
422
+ };
423
+ }, [
424
+ R,
425
+ J,
426
+ q,
427
+ W,
428
+ P
429
+ ]);
430
+ let he = () => {
431
+ let t = [O({})];
432
+ return j ? j(e, Q, t) : Q.length > 0 ? B ? [/* @__PURE__ */ u(ee, {
433
+ options: Q,
434
+ removeOption: me,
435
+ renderValue: k,
436
+ disabled: _,
437
+ removeLabel: S.removeLabel
438
+ }), /* @__PURE__ */ u(O, { className: "mr-2" })] : [/* @__PURE__ */ u(D, {
439
+ options: Q,
440
+ renderValue: k
441
+ }), /* @__PURE__ */ u(O, { className: "mr-2" })] : A ? A(e, h, t) : /* @__PURE__ */ u(te, { placeholder: h });
442
+ }, ge = () => /* @__PURE__ */ u(g, {
443
+ onPointerRelease: F?.onPointerRelease,
444
+ topLayer: S.topLayer,
445
+ triggerRef: U,
446
+ portalTarget: W,
447
+ theme: fe,
448
+ dropdownMenuId: q,
449
+ popupClassName: ie,
450
+ maxHeight: ae,
451
+ children: C ? C({
452
+ id: K,
453
+ close: $
454
+ }) : /* @__PURE__ */ u(T, {
455
+ options: o ? X.items : Z,
456
+ selectedValues: o ? X.selected : void 0,
457
+ remote: o ? X : void 0,
458
+ value: d,
459
+ onChange: (e) => {
460
+ if (!_ && (m?.(e), !B)) {
461
+ let e = U.current;
462
+ e?.ownerDocument.defaultView?.requestAnimationFrame(() => {
463
+ let t = e.ownerDocument.activeElement;
464
+ e.isConnected && (!t || t === e.ownerDocument.body || f(e, t)) && e.focus({ preventScroll: !0 });
465
+ });
466
+ }
467
+ },
468
+ config: {
469
+ ...S,
470
+ autoFocus: S.autoFocus || le
471
+ },
472
+ multiSelect: B,
473
+ search: !!o || I,
474
+ searchPlaceholder: L,
475
+ listboxId: K,
476
+ searchId: ce,
477
+ renderOption: E,
478
+ renderNoResults: M,
479
+ onClose: $,
480
+ onTabNavigation: () => {
481
+ $(), U.current?.focus();
482
+ },
483
+ theme: fe
484
+ })
485
+ });
486
+ return /* @__PURE__ */ u("div", {
487
+ className: `dropdown-container ${b} ${_ ? "disabled" : ""}`,
488
+ style: x,
489
+ children: [
490
+ /* @__PURE__ */ u("div", {
491
+ ...se,
492
+ ref: U,
493
+ className: `dropdown-trigger ${J ? "open" : ""}`,
494
+ role: "combobox",
495
+ "data-value": Array.isArray(d) ? JSON.stringify(d) : d == null ? "" : String(d),
496
+ "aria-haspopup": C ? "dialog" : "listbox",
497
+ "aria-expanded": J && !_,
498
+ "aria-disabled": _,
499
+ "aria-owns": K,
500
+ "aria-controls": K,
501
+ "aria-label": H,
502
+ "aria-labelledby": ne,
503
+ "aria-describedby": re,
504
+ tabIndex: _ ? -1 : 0,
505
+ onClick: _ ? void 0 : pe,
506
+ onKeyDown: (e) => {
507
+ _ || e.target !== e.currentTarget || (J && e.key === "Tab" && S.nativeTabNavigation ? (e.stopPropagation(), $()) : J && e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), $()) : !J && (e.key === "Enter" || e.key === " " || e.key === "ArrowDown") && (e.preventDefault(), e.stopPropagation(), pe()));
508
+ },
509
+ children: he()
510
+ }),
511
+ J && !_ && ge(),
512
+ v && /* @__PURE__ */ u("input", {
513
+ type: "hidden",
514
+ name: v,
515
+ value: JSON.stringify(B ? Q.map((e) => e.value) : Q[0]?.value || "")
516
+ })
517
+ ]
518
+ });
519
+ }
520
+ var A = (e, t) => {
521
+ d(e, /* @__PURE__ */ u(k, { ...t }));
522
+ }, j = (e) => {
523
+ d(e, null);
524
+ };
525
+ //#endregion
526
+ //#region src/select.tsx
527
+ function M(e) {
528
+ return Array.isArray(e) ? e.map(M).join("") : n(e) ? M(e.props.children) : e == null || typeof e == "boolean" ? "" : String(e);
529
+ }
530
+ function N(e, r, i = "", a = !1) {
531
+ if (Array.isArray(e)) return e.flatMap((e) => N(e, r, i, a));
532
+ if (!n(e)) return [];
533
+ let o = e.props;
534
+ if (e.type === t) return N(o.children, r, i, a);
535
+ if (e.type === "optgroup") return N(o.children, r, o.label ?? "", a || !!o.disabled);
536
+ let s = r ? r(o) : o, c = {
537
+ ...s,
538
+ disabled: o.disabled || s.disabled,
539
+ hidden: o.hidden || s.hidden
540
+ }, l = String(c.label ?? M(c.children)).trim();
541
+ return [{
542
+ value: String(c.value ?? l),
543
+ label: i ? `${i}: ${l}` : l,
544
+ disabled: a || !!c.disabled,
545
+ hidden: !!c.hidden,
546
+ selected: !!c.selected
547
+ }];
548
+ }
549
+ function P(e) {
550
+ let { children: n, environment: r, value: a, defaultValue: o, onValueChange: s, optionPolicy: l, multiple: d, disabled: f, name: p, class: h, className: g, style: _, ...v } = e, y = c(m), b = y.disabled || !!f, x = N(n, l), [S, C] = i(() => {
551
+ let e = o ?? (d ? x.filter((e) => e.selected).map((e) => e.value) : x.find((e) => e.selected)?.value ?? x[0]?.value ?? "");
552
+ return Array.isArray(e) ? [...e] : String(e);
553
+ }), w = a === void 0 ? S : Array.isArray(a) ? [...a] : String(a), T = Array.isArray(w) ? w : [w], E = x.filter((e) => !e.hidden || T.includes(e.value)), D = `rv-select rv-select-control ${typeof h == "string" ? h : ""} ${g ?? ""}`.replace(/\brv-control\b/g, "").trim();
554
+ return /* @__PURE__ */ u(t, { children: [/* @__PURE__ */ u(k, {
555
+ environment: r,
556
+ renderOption: (e, t) => /* @__PURE__ */ u("span", {
557
+ "data-select-option": t.value,
558
+ children: t.label
559
+ }),
560
+ source: E,
561
+ value: w,
562
+ disabled: !!b,
563
+ className: D,
564
+ style: _,
565
+ triggerAttributes: {
566
+ ...v,
567
+ "data-select-value": Array.isArray(w) ? JSON.stringify(w) : w
568
+ },
569
+ config: {
570
+ nativeTabNavigation: !0,
571
+ multiSelect: !!d,
572
+ topLayer: !0,
573
+ ariaLabel: v["aria-label"],
574
+ ariaLabelledBy: v["aria-labelledby"] ?? (v["aria-label"] ? void 0 : y.labelId),
575
+ ariaDescribedBy: v["aria-describedby"] ?? y.hintId
576
+ },
577
+ onChange: (e) => {
578
+ let t = d ? Array.isArray(e) ? e : [e] : String(Array.isArray(e) ? e[0] ?? "" : e);
579
+ a === void 0 && C(t), s?.(t);
580
+ }
581
+ }), p && T.map((e) => /* @__PURE__ */ u("input", {
582
+ type: "hidden",
583
+ name: p,
584
+ value: e,
585
+ disabled: !!b
586
+ }))] });
587
+ }
588
+ //#endregion
589
+ //#region src/fieldset.tsx
590
+ function F(e) {
591
+ let t = c(m), n = t.disabled || !!e.disabled;
592
+ return /* @__PURE__ */ u(m.Provider, {
593
+ value: {
594
+ ...t,
595
+ disabled: n
596
+ },
597
+ children: /* @__PURE__ */ u("fieldset", {
598
+ ...e,
599
+ disabled: n
600
+ })
601
+ });
602
+ }
603
+ //#endregion
604
+ //#region src/native-control.tsx
605
+ function I(t, n, ...r) {
606
+ let { onChange: i, ...a } = n, o = x(e, t, a, ...r);
607
+ return i && !(t === "button" && n.busy) && Object.assign(o.props, { onChange: i }), o;
608
+ }
609
+ function L(e, t) {
610
+ let n = p(typeof e == "string" ? e : void 0);
611
+ return o((e) => {
612
+ n.current = e, typeof t == "function" ? t(e) : t && (t.current = e);
613
+ }, [t]);
614
+ }
615
+ var R = b(h(({ title: e, ...t }, n) => {
616
+ let r = L(e, n);
617
+ return I("input", {
618
+ ...t,
619
+ ref: r
620
+ });
621
+ }), "input"), z = b(h(({ children: e, title: t, ...n }, r) => {
622
+ let i = L(t, r);
623
+ return I("textarea", {
624
+ ...n,
625
+ ref: i
626
+ }, e);
627
+ }), "textarea"), B = b(h(({ children: e, title: t, ...n }, r) => {
628
+ let i = p(typeof t == "string" ? t : void 0), a = o((e) => {
629
+ i.current = e, typeof r == "function" ? r(e) : r && (r.current = e);
630
+ }, [r]);
631
+ return I("button", {
632
+ ...n,
633
+ ref: a,
634
+ "aria-label": n["aria-label"] ?? (!e && typeof t == "string" ? t : void 0)
635
+ }, e);
636
+ }), "button"), V = b(h(({ children: e, title: t, ...n }, r) => {
637
+ let i = L(t, r);
638
+ return I("summary", {
639
+ ...n,
640
+ ref: i
641
+ }, e);
642
+ }), "summary"), H = b(P, "select");
643
+ //#endregion
644
+ export { z as a, N as c, j as d, E as f, V as i, k as l, R as n, F as o, T as p, H as r, P as s, B as t, A as u };
@@ -1,8 +1,8 @@
1
1
  import { c as e, i as t, t as n } from "./hooks.module-CG3gN83z.js";
2
2
  import { t as r } from "./jsxRuntime.module-F6UFnpT-.js";
3
- import { n as i } from "./native-control-C_yok8_-.js";
4
- import { n as a } from "./controls-DsNi8V8I.js";
5
- import { createControlId as o } from "../core/control-id.js";
3
+ import { createControlId as i } from "../core/control-id.js";
4
+ import { n as a } from "./native-control-pFMuHf3G.js";
5
+ import { t as o } from "./controls-FUU-MUKC.js";
6
6
  import { EditorActions as s } from "../editor-actions.js";
7
7
  //#region src/number-input/model.ts
8
8
  var c = {
@@ -158,7 +158,7 @@ function v({ value: l, options: u, apply: d, cancel: f, initialSelection: p = "a
158
158
  } catch {
159
159
  return String(l ?? "");
160
160
  }
161
- }), [y, b] = t(""), [x] = t(() => o("rv-number")), S = n(null), C = n(!1), w = {
161
+ }), [y, b] = t(""), [x] = t(() => i("rv-number")), S = n(null), C = n(!1), w = {
162
162
  ...c,
163
163
  ...u.text
164
164
  }, T = h(g, u), E = T.error ?? y, D = T.error !== void 0 || !!y, O = () => {
@@ -190,7 +190,7 @@ function v({ value: l, options: u, apply: d, cancel: f, initialSelection: p = "a
190
190
  /* @__PURE__ */ r("div", {
191
191
  class: "rv-number-draft__entry",
192
192
  children: [
193
- /* @__PURE__ */ r(i, {
193
+ /* @__PURE__ */ r(a, {
194
194
  ref: S,
195
195
  id: x,
196
196
  class: "rv-control",
@@ -208,13 +208,13 @@ function v({ value: l, options: u, apply: d, cancel: f, initialSelection: p = "a
208
208
  },
209
209
  onInput: (e) => k(e.currentTarget.value)
210
210
  }),
211
- /* @__PURE__ */ r(a, {
211
+ /* @__PURE__ */ r(o, {
212
212
  "aria-label": w.decrease,
213
213
  disabled: T.error !== void 0,
214
214
  onClick: () => A(-1),
215
215
  children: "−"
216
216
  }),
217
- /* @__PURE__ */ r(a, {
217
+ /* @__PURE__ */ r(o, {
218
218
  "aria-label": w.increase,
219
219
  disabled: T.error !== void 0,
220
220
  onClick: () => A(1),
@@ -1,11 +1,11 @@
1
1
  import { i as e } from "./preact.module-BBM36DnO.js";
2
2
  import { i as t } from "./hooks.module-CG3gN83z.js";
3
3
  import { t as n } from "./jsxRuntime.module-F6UFnpT-.js";
4
- import { t as r } from "./native-control-C_yok8_-.js";
4
+ import { t as r } from "./native-control-pFMuHf3G.js";
5
5
  import { DEFAULT_CALENDAR_TRANSLATIONS as i } from "../calendar/translations.js";
6
6
  import { n as a } from "./iso-B0YHBK7m.js";
7
7
  import { f as o, h as s, m as c, o as l, p as u } from "./model-mPO2tG2f.js";
8
- import { t as d } from "./calendar-xpZ0v3xf.js";
8
+ import { t as d } from "./calendar-QWDyYzdo.js";
9
9
  //#region src/calendar/picker.tsx
10
10
  function f(f) {
11
11
  let { selected: p, onSelectionChange: ee, presets: m, mode: h = "single", min: g = 0, max: _ = Infinity, required: v = !1, excludeDisabled: y = !1, month: b, defaultMonth: x, onMonthChange: S, ...C } = f, w = typeof p == "string" ? p : Array.isArray(p) ? p[0] : p?.from, [T, E] = t(x ?? w ?? f.referenceDate ?? s()), [D, O] = t(w ?? T), [k, A] = t(), [j, M] = t(), N = (e) => {