@affino/datagrid-vue-app 0.1.62 → 0.1.64

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 (39) hide show
  1. package/README.md +16 -0
  2. package/dist/advanced-filter.js +1 -1
  3. package/dist/aggregations.js +1 -1
  4. package/dist/chunks/{DataGridAdvancedFilterPopover-C_MjEKFo.js → DataGridAdvancedFilterPopover-p_hnZLCA.js} +1 -1
  5. package/dist/chunks/{DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-DxZakgyj.js → DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-AVmOe3Bv.js} +1 -1
  6. package/dist/chunks/{DataGridAggregationsPopover-C8kdwv0O.js → DataGridAggregationsPopover-Bzbn6Nuy.js} +1 -1
  7. package/dist/chunks/{DataGridAggregationsPopover.vue_vue_type_script_setup_true_lang-t6v8MqIT.js → DataGridAggregationsPopover.vue_vue_type_script_setup_true_lang-TgxL5evy.js} +1 -1
  8. package/dist/chunks/DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-CpC_nuMk.js +419 -0
  9. package/dist/chunks/DataGridGanttStageEntry-DGDFifU8.js +12216 -0
  10. package/dist/chunks/useDataGridAppRowModel-DF6K2Rd8.js +5409 -0
  11. package/dist/gantt.js +1 -1
  12. package/dist/gestures/dataGridTouchPanGuard.d.ts +1 -0
  13. package/dist/index.js +597 -573
  14. package/dist/internal.js +3 -3
  15. package/dist/overlays/DataGridCellComboboxEditor.vue.d.ts +1 -0
  16. package/dist/perf/dataGridPerfTrace.d.ts +7 -0
  17. package/dist/stage/DataGridTableStageCenterPane.vue.d.ts +9 -0
  18. package/dist/stage/DataGridTableStageHeader.vue.d.ts +11 -1
  19. package/dist/stage/DataGridTableStagePinnedPane.vue.d.ts +10 -1
  20. package/dist/stage/dataGridMouseEventGuards.d.ts +17 -0
  21. package/dist/stage/dataGridTableStage.types.d.ts +4 -1
  22. package/dist/stage/dataGridTableStageBody.types.d.ts +15 -1
  23. package/dist/stage/useDataGridStageCellRendering.d.ts +4 -1
  24. package/dist/stage/useDataGridStageCellState.d.ts +2 -0
  25. package/dist/stage/useDataGridStageChromeCanvas.d.ts +1 -0
  26. package/dist/stage/useDataGridStageFocusRuntime.d.ts +3 -0
  27. package/dist/stage/useDataGridStageOverlays.d.ts +1 -0
  28. package/dist/stage/useDataGridStagePointerInteractions.d.ts +6 -0
  29. package/dist/stage/useDataGridStageRenderApis.d.ts +15 -1
  30. package/dist/stage/useDataGridStageRenderApis.grouped.d.ts +16 -2
  31. package/dist/stage/useDataGridStageRowIndex.d.ts +1 -0
  32. package/dist/stage/useDataGridStageViewportRuntime.d.ts +8 -2
  33. package/dist/stage/useDataGridTableStageHistory.d.ts +3 -0
  34. package/dist/stage/useDataGridTableStageRuntime.d.ts +1 -0
  35. package/dist/stage/useDataGridTableStageScrollSync.d.ts +8 -0
  36. package/package.json +3 -3
  37. package/dist/chunks/DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-xry4J3Lx.js +0 -389
  38. package/dist/chunks/DataGridGanttStageEntry-B-Igcclh.js +0 -11013
  39. package/dist/chunks/useDataGridAppRowModel-B8E788Tu.js +0 -5278
package/README.md CHANGED
@@ -1268,6 +1268,7 @@ Object form:
1268
1268
  Columns can provide a `cellRenderer` callback that returns Vue content for the display layer.
1269
1269
  If a custom cell also needs keyboard-accessible interaction without breaking the grid-owned focus model, declare `cellInteraction` on the column and use `context.interactive` inside the renderer.
1270
1270
  For grouped rows, prefer `groupCellRenderer` so you receive structured group metadata instead of reverse-engineering the formatted disclosure label.
1271
+ If an authored renderer throws, the stage preserves the cell wrapper and falls back to the resolved `displayValue` for that cell.
1271
1272
 
1272
1273
  ```vue
1273
1274
  <script setup lang="ts">
@@ -1339,6 +1340,7 @@ const columns: DataGridAppColumnInput<Row>[] = [
1339
1340
  - `column` and `columnIndex`
1340
1341
  - `value`: raw string value used by the stage
1341
1342
  - `displayValue`: formatted display string after presentation rules
1343
+ - `surface`: rendered surface metadata; `surface.kind` is `"real"` for materialized rows and `"placeholder"` for visual placeholder rows
1342
1344
  - `interactive`: resolved cell interaction contract when the column declares `cellInteraction`; otherwise `null`
1343
1345
 
1344
1346
  `groupCellRenderer` receives the same display fields for group rows plus `group`, which includes:
@@ -1386,9 +1388,23 @@ Guidelines:
1386
1388
  - keep group expand/collapse behind an explicit trigger inside `groupCellRenderer`; do not rely on the whole group cell acting as the disclosure target
1387
1389
  - the grid shell still owns focus, selection, fill, clipboard, menus, and editing; `cellInteraction` only adds semantic invoke behavior inside that model
1388
1390
  - prefer pure render output from row data over local mutable renderer state
1391
+ - do not mutate grid state, row data, selection, focus, or editor state while the renderer is running
1392
+ - avoid synchronous layout reads such as `getBoundingClientRect()`, `clientWidth`, or computed-style reads inside renderers; measure layout in your surrounding app lifecycle instead
1393
+ - return bounded Vue content for each cell; expensive charts, popovers, network work, or observers should mount lazily behind explicit user intent
1394
+ - provide stable keys for repeated child VNodes returned from a renderer so virtualized row/column remounts do not lose child identity unnecessarily
1395
+ - treat `surface.kind === "placeholder"` as a display-only state; do not assume placeholder rows are persisted or editable until the grid materializes them through the placeholder-row policy
1396
+ - keep per-cell renderer work proportional to one cell because the stage invokes renderers synchronously for every rendered center and pinned cell
1389
1397
  - keep identifiers, derived values, and formula-result columns read-only where appropriate
1390
1398
  - if a renderer caches local UI state, listen for targeted app-layer cell refresh and re-sync on refresh
1391
1399
 
1400
+ Performance expectations:
1401
+
1402
+ - Renderers run in the same Vue render pass as virtualized row and column window updates.
1403
+ - Wide grids, pinned panes, and pinned-bottom rows multiply the number of rendered cell surfaces.
1404
+ - Renderer exceptions are isolated to the affected cell and fall back to `displayValue`; they are still application bugs and should be fixed rather than used as control flow.
1405
+ - The grid may use lightweight display-value rendering during active touch scroll; renderers must not be the only place where essential text, ARIA labels, selection state, or edit affordances exist.
1406
+ - Enterprise custom-renderer scenarios should be validated with the browser-frame/perf gates documented in `docs/perf/datagrid-performance-gates.md` before being treated as a performance baseline.
1407
+
1392
1408
  ### System checkbox interactions
1393
1409
 
1394
1410
  The built-in row-selection checkbox column uses the same `cellInteraction` contract internally.
@@ -1,4 +1,4 @@
1
- import { _ as e } from "./chunks/DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-DxZakgyj.js";
1
+ import { _ as e } from "./chunks/DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-AVmOe3Bv.js";
2
2
  export {
3
3
  e as DataGridAdvancedFilterPopover
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as a } from "./chunks/DataGridAggregationsPopover.vue_vue_type_script_setup_true_lang-t6v8MqIT.js";
1
+ import { _ as a } from "./chunks/DataGridAggregationsPopover.vue_vue_type_script_setup_true_lang-TgxL5evy.js";
2
2
  export {
3
3
  a as DataGridAggregationsPopover
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-DxZakgyj.js";
1
+ import { _ as f } from "./DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-AVmOe3Bv.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as N, inject as z, ref as A, computed as c, watch as w, nextTick as O, openBlock as i, createElementBlock as u, Fragment as C, createElementVNode as a, mergeProps as F, unref as _, createCommentVNode as P, createTextVNode as K, toDisplayString as l, createBlock as M, Teleport as U, renderList as T, createVNode as k } from "vue";
2
2
  import { usePopoverController as Z, useFloatingPopover as H } from "@affino/popover-vue";
3
- import { _ as L } from "./DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-xry4J3Lx.js";
3
+ import { _ as L } from "./DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-CpC_nuMk.js";
4
4
  import { d as J, r as Q } from "./dataGridOverlayThemeVars-vzY74EIz.js";
5
5
  import { D } from "./dataGridAdvancedFilter-xnME5bRa.js";
6
6
  import { u as W } from "./useDataGridDraggableOverlaySurface-BgkSR_nl.js";
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./DataGridAggregationsPopover.vue_vue_type_script_setup_true_lang-t6v8MqIT.js";
1
+ import { _ as f } from "./DataGridAggregationsPopover.vue_vue_type_script_setup_true_lang-TgxL5evy.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as V, inject as E, ref as b, computed as d, watch as _, nextTick as m, openBlock as l, createElementBlock as i, Fragment as y, createElementVNode as e, mergeProps as k, unref as f, toDisplayString as h, createBlock as G, Teleport as D, createVNode as C, renderList as I, createCommentVNode as L } from "vue";
2
2
  import { usePopoverController as j, useFloatingPopover as z } from "@affino/popover-vue";
3
- import { _ as O } from "./DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-xry4J3Lx.js";
3
+ import { _ as O } from "./DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-CpC_nuMk.js";
4
4
  import { d as q, r as K } from "./dataGridOverlayThemeVars-vzY74EIz.js";
5
5
  const U = ["disabled", "title"], H = { class: "datagrid-aggregations__header" }, J = /* @__PURE__ */ e("div", null, [
6
6
  /* @__PURE__ */ e("div", { class: "datagrid-aggregations__eyebrow" }, "Aggregations"),
@@ -0,0 +1,419 @@
1
+ import { defineComponent as Se, inject as Pe, ref as v, useAttrs as Re, computed as s, watch as $, nextTick as m, onMounted as Me, onBeforeUnmount as Be, openBlock as b, createElementBlock as h, createElementVNode as ae, mergeProps as Ve, withModifiers as O, createBlock as De, Teleport as Te, normalizeStyle as Ne, normalizeClass as ie, Fragment as re, renderList as $e, toDisplayString as Ge, createCommentVNode as z } from "vue";
2
+ import { d as He, r as Ue } from "./dataGridOverlayThemeVars-vzY74EIz.js";
3
+ function We(n = {}) {
4
+ return {
5
+ open: n.open ?? !1,
6
+ filter: n.filter ?? "",
7
+ activeIndex: n.activeIndex ?? -1
8
+ };
9
+ }
10
+ function P(n, l) {
11
+ return n.open === l ? n : {
12
+ ...n,
13
+ open: l
14
+ };
15
+ }
16
+ function q(n, l) {
17
+ return n.filter === l ? n : {
18
+ ...n,
19
+ filter: l
20
+ };
21
+ }
22
+ function R(n, l, t) {
23
+ const r = Ke(l, t);
24
+ return r === n.activeIndex ? n : {
25
+ ...n,
26
+ activeIndex: r
27
+ };
28
+ }
29
+ function ue(n, l, t, r = !0) {
30
+ if (t <= 0 || l === 0)
31
+ return n;
32
+ if (n.activeIndex < 0)
33
+ return R(n, l > 0 ? 0 : t - 1, t);
34
+ const u = n.activeIndex + Math.trunc(l);
35
+ return r ? R(n, Xe(u, t), t) : R(n, u, t);
36
+ }
37
+ function Ke(n, l) {
38
+ if (l <= 0)
39
+ return -1;
40
+ if (!Number.isFinite(n))
41
+ return 0;
42
+ const t = Math.trunc(n);
43
+ return t < 0 ? 0 : t >= l ? l - 1 : t;
44
+ }
45
+ function Xe(n, l) {
46
+ return (n % l + l) % l;
47
+ }
48
+ const ze = 0, qe = 1, je = 2, Je = 3, Ye = 4, Ze = 5, Qe = 6, et = 7, ce = 100;
49
+ function tt(n, l) {
50
+ const t = j(l);
51
+ if (t.length === 0)
52
+ return [...n];
53
+ const r = n.map((u, c) => ({
54
+ option: u,
55
+ score: nt(u, t),
56
+ originalIndex: c
57
+ })).filter((u) => u.score < ce);
58
+ return r.sort((u, c) => {
59
+ if (u.score !== c.score)
60
+ return u.score - c.score;
61
+ const k = u.option.label.length, d = c.option.label.length;
62
+ return k !== d ? k - d : u.originalIndex - c.originalIndex;
63
+ }), r.map((u) => u.option);
64
+ }
65
+ function nt(n, l) {
66
+ const t = j(n.label), r = j(n.value);
67
+ return t === l ? ze : r === l ? qe : t.startsWith(l) ? je : r.startsWith(l) ? Je : se(t, l) ? Ye : se(r, l) ? Ze : t.includes(l) ? Qe : r.includes(l) ? et : ce;
68
+ }
69
+ function se(n, l) {
70
+ return n.length === 0 || l.length === 0 ? !1 : n.split(/[^a-z0-9]+/i).some((t) => t.length > 0 && t.startsWith(l));
71
+ }
72
+ function j(n) {
73
+ return n.trim().toLocaleLowerCase();
74
+ }
75
+ const lt = ["id", "name", "value", "placeholder", "disabled", "aria-busy", "aria-invalid", "aria-expanded", "aria-activedescendant"], ot = ["data-affino-popover-sticky"], at = {
76
+ key: 0,
77
+ class: "datagrid-cell-combobox__empty"
78
+ }, it = ["id", "aria-selected", "data-option-index", "onMousemove", "onClick"], rt = { class: "datagrid-cell-combobox__option-label" }, ut = {
79
+ key: 0,
80
+ class: "datagrid-cell-combobox__option-state",
81
+ "aria-hidden": "true"
82
+ }, st = {
83
+ key: 0,
84
+ class: "datagrid-cell-combobox__empty"
85
+ }, ct = {
86
+ inheritAttrs: !1
87
+ }, xt = /* @__PURE__ */ Se({
88
+ ...ct,
89
+ __name: "DataGridFilterableCombobox",
90
+ props: {
91
+ value: {},
92
+ options: { default: () => [] },
93
+ loadOptions: {},
94
+ placeholder: { default: "Type to filter" },
95
+ disabled: { type: Boolean, default: !1 },
96
+ openOnMount: { type: Boolean, default: !0 },
97
+ initialFilter: { default: "" },
98
+ openOnFocus: { type: Boolean, default: !0 },
99
+ inlinePanel: { type: Boolean, default: !1 },
100
+ stickyPopoverId: {}
101
+ },
102
+ emits: ["commit", "cancel", "optionsResolved"],
103
+ setup(n, { emit: l }) {
104
+ const t = n, r = l, u = Pe(He, v(null)), c = Re(), k = v(null), d = v(null), L = v(null), J = v({}), G = v({}), M = v("below"), F = v(""), I = v(!1), A = v(null), B = v([]), o = v(We({ open: !1 })), S = `datagrid-filterable-combobox-${Math.random().toString(36).slice(2, 10)}`, de = `${S}-input`, ve = `${S}-field`;
105
+ let E = 0, _ = null;
106
+ const fe = s(() => {
107
+ const {
108
+ class: e,
109
+ id: a,
110
+ name: i,
111
+ style: f,
112
+ type: w,
113
+ value: le,
114
+ placeholder: oe,
115
+ disabled: dt,
116
+ onInput: vt,
117
+ onFocus: ft,
118
+ onBlur: pt,
119
+ onKeydown: mt,
120
+ onClick: bt,
121
+ ...Ae
122
+ } = c;
123
+ return Ae;
124
+ }), pe = s(() => String(c.id ?? de)), me = s(() => String(c.name ?? ve)), be = s(() => [
125
+ "cell-editor-control",
126
+ "datagrid-cell-combobox__input",
127
+ c.class
128
+ ]), he = s(() => c.style), _e = s(() => {
129
+ if (A.value)
130
+ return "true";
131
+ const e = c["aria-invalid"];
132
+ if (e === !0 || e === "true")
133
+ return "true";
134
+ if (!(e === !1 || e === "false" || e == null))
135
+ return e === "grammar" || e === "spelling" ? e : "true";
136
+ }), xe = s(() => {
137
+ if (!t.inlinePanel)
138
+ return "body";
139
+ }), H = s(() => Y.value.find((e) => e.value === t.value) ?? null), Y = s(() => t.loadOptions && B.value.length > 0 ? B.value : t.options), p = s(() => tt(Y.value, o.value.filter)), x = s(() => o.value.activeIndex), V = s(() => x.value >= 0 ? p.value[x.value] ?? null : null), ye = s(() => x.value >= 0 ? Z(x.value) : void 0), D = s(() => o.value.open);
140
+ function Z(e) {
141
+ return `${S}-option-${e}`;
142
+ }
143
+ function ge() {
144
+ J.value = Ue(u.value);
145
+ }
146
+ function U() {
147
+ F.value = H.value?.label ?? t.value;
148
+ }
149
+ function Q() {
150
+ F.value = t.initialFilter;
151
+ }
152
+ function C(e) {
153
+ const a = p.value;
154
+ if (a.length === 0) {
155
+ o.value = {
156
+ ...o.value,
157
+ activeIndex: -1
158
+ };
159
+ return;
160
+ }
161
+ let i = 0;
162
+ if (e && H.value) {
163
+ const f = a.findIndex((w) => w.value === H.value?.value);
164
+ f >= 0 && (i = f);
165
+ }
166
+ o.value = R(o.value, i, a.length);
167
+ }
168
+ async function W(e) {
169
+ if (!t.loadOptions)
170
+ return;
171
+ const a = E + 1;
172
+ E = a, I.value = !0, A.value = null;
173
+ try {
174
+ const i = await t.loadOptions(e);
175
+ if (a !== E)
176
+ return;
177
+ B.value = i, r("optionsResolved", i), C(!0), m(() => {
178
+ y(), g();
179
+ });
180
+ } catch (i) {
181
+ if (a !== E)
182
+ return;
183
+ A.value = i instanceof Error ? i.message : "options-load-failed", B.value = [], C(!1);
184
+ } finally {
185
+ a === E && (I.value = !1);
186
+ }
187
+ }
188
+ function y() {
189
+ if (t.inlinePanel) {
190
+ M.value = "below", G.value = {
191
+ position: "absolute",
192
+ top: "calc(100% - 1px)",
193
+ left: "0px",
194
+ width: "100%",
195
+ maxHeight: "260px",
196
+ zIndex: "4"
197
+ };
198
+ return;
199
+ }
200
+ if (typeof window > "u" || !d.value)
201
+ return;
202
+ const e = d.value.getBoundingClientRect(), a = Math.max(e.width, 160), i = Math.min(L.value?.offsetHeight ?? 220, 260), w = window.innerHeight - e.bottom - 8 < Math.min(180, i) && e.top > i + 12;
203
+ M.value = w ? "above" : "below";
204
+ const le = w ? Math.max(8, e.top - i + 1) : Math.min(window.innerHeight - i - 8, e.bottom - 1), oe = Math.min(
205
+ Math.max(8, e.left),
206
+ Math.max(8, window.innerWidth - a - 8)
207
+ );
208
+ G.value = {
209
+ position: "fixed",
210
+ top: `${le}px`,
211
+ left: `${oe}px`,
212
+ width: `${a}px`,
213
+ maxHeight: "260px",
214
+ zIndex: "240"
215
+ };
216
+ }
217
+ function ee() {
218
+ if (_ == null || typeof window > "u") {
219
+ _ = null;
220
+ return;
221
+ }
222
+ window.cancelAnimationFrame(_), _ = null;
223
+ }
224
+ function we() {
225
+ if (typeof window > "u") {
226
+ y();
227
+ return;
228
+ }
229
+ _ == null && (_ = window.requestAnimationFrame(() => {
230
+ _ = null, D.value && y();
231
+ }));
232
+ }
233
+ function g() {
234
+ if (!L.value || x.value < 0)
235
+ return;
236
+ L.value.querySelector(`[data-option-index="${x.value}"]`)?.scrollIntoView({ block: "nearest" });
237
+ }
238
+ function K() {
239
+ t.disabled || (o.value = P(o.value, !0), C(!0), m(() => {
240
+ if (y(), g(), d.value?.focus({ preventScroll: !0 }), !!d.value) {
241
+ if (o.value.filter.length > 0) {
242
+ const e = d.value.value.length;
243
+ d.value.setSelectionRange(e, e);
244
+ return;
245
+ }
246
+ d.value.select();
247
+ }
248
+ }), t.loadOptions && W(o.value.filter));
249
+ }
250
+ function T() {
251
+ ee(), o.value = P(o.value, !1);
252
+ }
253
+ function Ie(e) {
254
+ return e instanceof Node && (k.value?.contains(e) === !0 || L.value?.contains(e) === !0);
255
+ }
256
+ function Ee() {
257
+ if (o.value.filter.trim().length === 0)
258
+ return t.value;
259
+ if (V.value)
260
+ return V.value.value;
261
+ const e = F.value.trim().toLocaleLowerCase();
262
+ return e.length === 0 ? t.value : p.value.find((i) => i.label.trim().toLocaleLowerCase() === e || i.value.trim().toLocaleLowerCase() === e)?.value ?? t.value;
263
+ }
264
+ function te(e = "stay") {
265
+ I.value || A.value || (T(), r("commit", Ee(), e));
266
+ }
267
+ function ne(e, a = "stay") {
268
+ I.value || A.value || (T(), r("commit", e, a));
269
+ }
270
+ function X(e) {
271
+ o.value = R(o.value, e, p.value.length), m(g);
272
+ }
273
+ function Ce() {
274
+ t.openOnFocus && K();
275
+ }
276
+ function Oe() {
277
+ K();
278
+ }
279
+ function ke(e) {
280
+ if (t.disabled)
281
+ return;
282
+ const a = e.target.value;
283
+ F.value = a, o.value = q(o.value, a), o.value = P(o.value, !0), C(!1), m(() => {
284
+ y(), g();
285
+ }), t.loadOptions && W(a);
286
+ }
287
+ function Le() {
288
+ m(() => {
289
+ Ie(document.activeElement) || te("stay");
290
+ });
291
+ }
292
+ function Fe(e) {
293
+ if (!t.disabled && !(e.isComposing || e.key === "Process" || e.keyCode === 229)) {
294
+ if (e.key === "ArrowDown") {
295
+ e.preventDefault(), o.value = P(o.value, !0), o.value = ue(o.value, 1, p.value.length, !0), m(g);
296
+ return;
297
+ }
298
+ if (e.key === "ArrowUp") {
299
+ e.preventDefault(), o.value = P(o.value, !0), o.value = ue(o.value, -1, p.value.length, !0), m(g);
300
+ return;
301
+ }
302
+ if (e.key === "Home") {
303
+ e.preventDefault(), X(0);
304
+ return;
305
+ }
306
+ if (e.key === "End") {
307
+ e.preventDefault(), X(Math.max(0, p.value.length - 1));
308
+ return;
309
+ }
310
+ if (e.key === "Enter" || e.key === "Tab") {
311
+ if (e.preventDefault(), V.value) {
312
+ ne(V.value.value, e.shiftKey ? "previous" : "next");
313
+ return;
314
+ }
315
+ te(e.shiftKey ? "previous" : "next");
316
+ return;
317
+ }
318
+ e.key === "Escape" && (e.preventDefault(), T(), r("cancel"));
319
+ }
320
+ }
321
+ function N() {
322
+ D.value && we();
323
+ }
324
+ return $(() => t.options, () => {
325
+ t.loadOptions || (C(!0), m(y));
326
+ }, { immediate: !0 }), $(() => t.value, () => {
327
+ U();
328
+ }), $(() => t.initialFilter, (e) => {
329
+ document.activeElement !== d.value && (o.value = q(o.value, e), e.length > 0 ? (Q(), W(e)) : U(), C(!0), m(() => {
330
+ y(), g();
331
+ }));
332
+ }), $(() => t.disabled, (e) => {
333
+ e && T();
334
+ }), Me(() => {
335
+ ge(), t.initialFilter.length > 0 ? (o.value = q(o.value, t.initialFilter), Q()) : U(), t.openOnMount && K(), typeof window < "u" && (window.addEventListener("resize", N), window.addEventListener("scroll", N, { capture: !0, passive: !0 }));
336
+ }), Be(() => {
337
+ E += 1, ee(), typeof window < "u" && (window.removeEventListener("resize", N), window.removeEventListener("scroll", N, { capture: !0 }));
338
+ }), (e, a) => (b(), h("div", {
339
+ ref_key: "rootEl",
340
+ ref: k,
341
+ class: "datagrid-cell-combobox"
342
+ }, [
343
+ ae("input", Ve({
344
+ ref_key: "inputEl",
345
+ ref: d
346
+ }, fe.value, {
347
+ id: pe.value,
348
+ name: me.value,
349
+ class: be.value,
350
+ style: he.value,
351
+ type: "text",
352
+ role: "combobox",
353
+ value: F.value,
354
+ placeholder: e.placeholder,
355
+ disabled: e.disabled,
356
+ "aria-busy": I.value ? "true" : void 0,
357
+ "aria-invalid": _e.value,
358
+ "aria-expanded": D.value ? "true" : "false",
359
+ "aria-controls": S,
360
+ "aria-autocomplete": "list",
361
+ "aria-activedescendant": ye.value,
362
+ onFocus: Ce,
363
+ onMousedown: a[0] || (a[0] = O(() => {
364
+ }, ["stop"])),
365
+ onContextmenu: a[1] || (a[1] = O(() => {
366
+ }, ["stop"])),
367
+ onClick: O(Oe, ["stop"]),
368
+ onInput: ke,
369
+ onKeydown: O(Fe, ["stop"]),
370
+ onBlur: Le
371
+ }), null, 16, lt),
372
+ (b(), De(Te, {
373
+ to: xe.value,
374
+ disabled: e.inlinePanel
375
+ }, [
376
+ D.value ? (b(), h("div", {
377
+ key: 0,
378
+ id: S,
379
+ ref_key: "panelEl",
380
+ ref: L,
381
+ class: ie(["datagrid-cell-combobox__panel", {
382
+ "datagrid-cell-combobox__panel--inline": e.inlinePanel,
383
+ "datagrid-cell-combobox__panel--attached-below": M.value === "below",
384
+ "datagrid-cell-combobox__panel--attached-above": M.value === "above"
385
+ }]),
386
+ "data-affino-popover-sticky": e.stickyPopoverId || void 0,
387
+ style: Ne([J.value, G.value]),
388
+ role: "listbox",
389
+ onMousedown: a[2] || (a[2] = O(() => {
390
+ }, ["prevent"]))
391
+ }, [
392
+ I.value ? (b(), h("div", at, "Loading options...")) : (b(), h(re, { key: 1 }, [
393
+ (b(!0), h(re, null, $e(p.value, (i, f) => (b(), h("button", {
394
+ id: Z(f),
395
+ key: `${i.value}-${f}`,
396
+ type: "button",
397
+ class: ie(["datagrid-cell-combobox__option", {
398
+ "datagrid-cell-combobox__option--active": f === x.value,
399
+ "datagrid-cell-combobox__option--selected": i.value === e.value
400
+ }]),
401
+ role: "option",
402
+ "aria-selected": i.value === e.value ? "true" : "false",
403
+ "data-option-index": f,
404
+ onMousemove: (w) => X(f),
405
+ onClick: O((w) => ne(i.value), ["stop"])
406
+ }, [
407
+ ae("span", rt, Ge(i.label), 1),
408
+ i.value === e.value ? (b(), h("span", ut)) : z("", !0)
409
+ ], 42, it))), 128)),
410
+ p.value.length === 0 ? (b(), h("div", st, " No matching options ")) : z("", !0)
411
+ ], 64))
412
+ ], 46, ot)) : z("", !0)
413
+ ], 8, ["to", "disabled"]))
414
+ ], 512));
415
+ }
416
+ });
417
+ export {
418
+ xt as _
419
+ };