@affino/datagrid-vue-app 0.1.38 → 0.1.39

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.
@@ -1,4 +1,4 @@
1
- import { _ as e } from "./chunks/DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-CDuio50U.js";
1
+ import { _ as e } from "./chunks/DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-BUkG_Bz7.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-Ct7ZV2zk.js";
1
+ import { _ as a } from "./chunks/DataGridAggregationsPopover.vue_vue_type_script_setup_true_lang-t6v8MqIT.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-CDuio50U.js";
1
+ import { _ as f } from "./DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-BUkG_Bz7.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as j, inject as q, ref as w, computed as v, watch as y, nextTick as P, openBlock as o, createElementBlock as n, Fragment as h, createElementVNode as e, mergeProps as I, unref as s, createCommentVNode as A, createTextVNode as G, toDisplayString as C, createBlock as L, Teleport as z, renderList as T, createVNode as O } from "vue";
2
2
  import { usePopoverController as J, useFloatingPopover as K } from "@affino/popover-vue";
3
- import { _ as k } from "./DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-DOWIAEUl.js";
3
+ import { _ as k } from "./DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-xry4J3Lx.js";
4
4
  import { d as M, r as Z } from "./dataGridOverlayThemeVars-vzY74EIz.js";
5
5
  import { u as H } from "./useDataGridDraggableOverlaySurface-BgkSR_nl.js";
6
6
  const Q = ["data-datagrid-advanced-filter-active"], U = {
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./DataGridAggregationsPopover.vue_vue_type_script_setup_true_lang-Ct7ZV2zk.js";
1
+ import { _ as f } from "./DataGridAggregationsPopover.vue_vue_type_script_setup_true_lang-t6v8MqIT.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-DOWIAEUl.js";
3
+ import { _ as O } from "./DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-xry4J3Lx.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"),
@@ -1,4 +1,4 @@
1
- import { defineComponent as Ce, inject as ke, ref as v, useAttrs as Le, computed as s, watch as V, nextTick as m, onMounted as Fe, onBeforeUnmount as Se, openBlock as b, createElementBlock as h, createElementVNode as ne, mergeProps as Ae, withModifiers as k, createBlock as Re, Teleport as Me, normalizeStyle as Be, normalizeClass as oe, Fragment as le, renderList as Ve, toDisplayString as De, createCommentVNode as U } from "vue";
1
+ import { defineComponent as Oe, inject as ke, ref as v, useAttrs as Le, computed as s, watch as V, nextTick as m, onMounted as Fe, onBeforeUnmount as Se, openBlock as b, createElementBlock as h, createElementVNode as ne, mergeProps as Ae, withModifiers as w, createBlock as Re, Teleport as Me, normalizeStyle as Be, normalizeClass as oe, Fragment as le, renderList as Ve, toDisplayString as De, createCommentVNode as U } from "vue";
2
2
  import { d as Te, r as Pe } from "./dataGridOverlayThemeVars-vzY74EIz.js";
3
3
  function Ne(n = {}) {
4
4
  return {
@@ -58,8 +58,8 @@ function Je(n, o) {
58
58
  return r.sort((u, c) => {
59
59
  if (u.score !== c.score)
60
60
  return u.score - c.score;
61
- const w = u.option.label.length, d = c.option.label.length;
62
- return w !== d ? w - d : u.originalIndex - c.originalIndex;
61
+ const I = u.option.label.length, d = c.option.label.length;
62
+ return I !== d ? I - d : u.originalIndex - c.originalIndex;
63
63
  }), r.map((u) => u.option);
64
64
  }
65
65
  function Ye(n, o) {
@@ -84,7 +84,7 @@ const Ze = ["id", "name", "value", "placeholder", "disabled", "aria-expanded", "
84
84
  class: "datagrid-cell-combobox__empty"
85
85
  }, at = {
86
86
  inheritAttrs: !1
87
- }, pt = /* @__PURE__ */ Ce({
87
+ }, pt = /* @__PURE__ */ Oe({
88
88
  ...at,
89
89
  __name: "DataGridFilterableCombobox",
90
90
  props: {
@@ -101,7 +101,7 @@ const Ze = ["id", "name", "value", "placeholder", "disabled", "aria-expanded", "
101
101
  },
102
102
  emits: ["commit", "cancel", "optionsResolved"],
103
103
  setup(n, { emit: o }) {
104
- const t = n, r = o, u = ke(Te, v(null)), c = Le(), w = v(null), d = v(null), I = v(null), q = v({}), D = v({}), S = v("below"), E = v(""), T = v(!1), P = v([]), l = v(Ne({ open: !1 })), O = `datagrid-filterable-combobox-${Math.random().toString(36).slice(2, 10)}`, ue = `${O}-input`, se = `${O}-field`;
104
+ const t = n, r = o, u = ke(Te, v(null)), c = Le(), I = v(null), d = v(null), E = v(null), q = v({}), D = v({}), S = v("below"), C = v(""), T = v(!1), P = v([]), l = v(Ne({ open: !1 })), O = `datagrid-filterable-combobox-${Math.random().toString(36).slice(2, 10)}`, ue = `${O}-input`, se = `${O}-field`;
105
105
  let A = 0;
106
106
  const ce = s(() => {
107
107
  const {
@@ -118,9 +118,9 @@ const Ze = ["id", "name", "value", "placeholder", "disabled", "aria-expanded", "
118
118
  onBlur: st,
119
119
  onKeydown: ct,
120
120
  onClick: dt,
121
- ...Oe
121
+ ...Ce
122
122
  } = c;
123
- return Oe;
123
+ return Ce;
124
124
  }), de = s(() => String(c.id ?? ue)), ve = s(() => String(c.name ?? se)), fe = s(() => [
125
125
  "cell-editor-control",
126
126
  "datagrid-cell-combobox__input",
@@ -136,12 +136,12 @@ const Ze = ["id", "name", "value", "placeholder", "disabled", "aria-expanded", "
136
136
  q.value = Pe(u.value);
137
137
  }
138
138
  function G() {
139
- E.value = N.value?.label ?? t.value;
139
+ C.value = N.value?.label ?? t.value;
140
140
  }
141
141
  function Y() {
142
- E.value = t.initialFilter;
142
+ C.value = t.initialFilter;
143
143
  }
144
- function C(e) {
144
+ function k(e) {
145
145
  const a = p.value;
146
146
  if (a.length === 0) {
147
147
  l.value = {
@@ -166,7 +166,7 @@ const Ze = ["id", "name", "value", "placeholder", "disabled", "aria-expanded", "
166
166
  const i = await t.loadOptions(e);
167
167
  if (a !== A)
168
168
  return;
169
- P.value = i, r("optionsResolved", i), C(!0), m(() => {
169
+ P.value = i, r("optionsResolved", i), k(!0), m(() => {
170
170
  g(), x();
171
171
  });
172
172
  } finally {
@@ -187,7 +187,7 @@ const Ze = ["id", "name", "value", "placeholder", "disabled", "aria-expanded", "
187
187
  }
188
188
  if (typeof window > "u" || !d.value)
189
189
  return;
190
- const e = d.value.getBoundingClientRect(), a = Math.max(e.width, 160), i = Math.min(I.value?.offsetHeight ?? 220, 260), y = window.innerHeight - e.bottom - 8 < Math.min(180, i) && e.top > i + 12;
190
+ const e = d.value.getBoundingClientRect(), a = Math.max(e.width, 160), i = Math.min(E.value?.offsetHeight ?? 220, 260), y = window.innerHeight - e.bottom - 8 < Math.min(180, i) && e.top > i + 12;
191
191
  S.value = y ? "above" : "below";
192
192
  const ee = y ? Math.max(8, e.top - i + 1) : Math.min(window.innerHeight - i - 8, e.bottom - 1), te = Math.min(
193
193
  Math.max(8, e.left),
@@ -203,12 +203,12 @@ const Ze = ["id", "name", "value", "placeholder", "disabled", "aria-expanded", "
203
203
  };
204
204
  }
205
205
  function x() {
206
- if (!I.value || _.value < 0)
206
+ if (!E.value || _.value < 0)
207
207
  return;
208
- I.value.querySelector(`[data-option-index="${_.value}"]`)?.scrollIntoView({ block: "nearest" });
208
+ E.value.querySelector(`[data-option-index="${_.value}"]`)?.scrollIntoView({ block: "nearest" });
209
209
  }
210
210
  function W() {
211
- t.disabled || (l.value = L(l.value, !0), C(!0), m(() => {
211
+ t.disabled || (l.value = L(l.value, !0), k(!0), m(() => {
212
212
  if (g(), x(), d.value?.focus({ preventScroll: !0 }), !!d.value) {
213
213
  if (l.value.filter.length > 0) {
214
214
  const e = d.value.value.length;
@@ -223,14 +223,14 @@ const Ze = ["id", "name", "value", "placeholder", "disabled", "aria-expanded", "
223
223
  l.value = L(l.value, !1);
224
224
  }
225
225
  function _e(e) {
226
- return e instanceof Node && (w.value?.contains(e) === !0 || I.value?.contains(e) === !0);
226
+ return e instanceof Node && (I.value?.contains(e) === !0 || E.value?.contains(e) === !0);
227
227
  }
228
228
  function xe() {
229
229
  if (l.value.filter.trim().length === 0)
230
230
  return t.value;
231
231
  if (R.value)
232
232
  return R.value.value;
233
- const e = E.value.trim().toLocaleLowerCase();
233
+ const e = C.value.trim().toLocaleLowerCase();
234
234
  return e.length === 0 ? t.value : p.value.find((i) => i.label.trim().toLocaleLowerCase() === e || i.value.trim().toLocaleLowerCase() === e)?.value ?? t.value;
235
235
  }
236
236
  function Z(e = "stay") {
@@ -252,7 +252,7 @@ const Ze = ["id", "name", "value", "placeholder", "disabled", "aria-expanded", "
252
252
  if (t.disabled)
253
253
  return;
254
254
  const a = e.target.value;
255
- E.value = a, l.value = X(l.value, a), l.value = L(l.value, !0), C(!1), m(() => {
255
+ C.value = a, l.value = X(l.value, a), l.value = L(l.value, !0), k(!1), m(() => {
256
256
  g(), x();
257
257
  }), t.loadOptions && H(a);
258
258
  }
@@ -294,11 +294,11 @@ const Ze = ["id", "name", "value", "placeholder", "disabled", "aria-expanded", "
294
294
  $.value && g();
295
295
  }
296
296
  return V(() => t.options, () => {
297
- t.loadOptions || (C(!0), m(g));
297
+ t.loadOptions || (k(!0), m(g));
298
298
  }, { immediate: !0 }), V(() => t.value, () => {
299
299
  G();
300
300
  }), V(() => t.initialFilter, (e) => {
301
- document.activeElement !== d.value && (l.value = X(l.value, e), e.length > 0 ? (Y(), H(e)) : G(), C(!0), m(() => {
301
+ document.activeElement !== d.value && (l.value = X(l.value, e), e.length > 0 ? (Y(), H(e)) : G(), k(!0), m(() => {
302
302
  g(), x();
303
303
  }));
304
304
  }), V(() => t.disabled, (e) => {
@@ -309,7 +309,7 @@ const Ze = ["id", "name", "value", "placeholder", "disabled", "aria-expanded", "
309
309
  typeof window < "u" && (window.removeEventListener("resize", B), window.removeEventListener("scroll", B, !0));
310
310
  }), (e, a) => (b(), h("div", {
311
311
  ref_key: "rootEl",
312
- ref: w,
312
+ ref: I,
313
313
  class: "datagrid-cell-combobox"
314
314
  }, [
315
315
  ne("input", Ae({
@@ -322,7 +322,7 @@ const Ze = ["id", "name", "value", "placeholder", "disabled", "aria-expanded", "
322
322
  style: pe.value,
323
323
  type: "text",
324
324
  role: "combobox",
325
- value: E.value,
325
+ value: C.value,
326
326
  placeholder: e.placeholder,
327
327
  disabled: e.disabled,
328
328
  "aria-expanded": $.value ? "true" : "false",
@@ -330,11 +330,13 @@ const Ze = ["id", "name", "value", "placeholder", "disabled", "aria-expanded", "
330
330
  "aria-autocomplete": "list",
331
331
  "aria-activedescendant": be.value,
332
332
  onFocus: ye,
333
- onMousedown: a[0] || (a[0] = k(() => {
333
+ onMousedown: a[0] || (a[0] = w(() => {
334
334
  }, ["stop"])),
335
- onClick: k(ge, ["stop"]),
335
+ onContextmenu: a[1] || (a[1] = w(() => {
336
+ }, ["stop"])),
337
+ onClick: w(ge, ["stop"]),
336
338
  onInput: we,
337
- onKeydown: k(Ee, ["stop"]),
339
+ onKeydown: w(Ee, ["stop"]),
338
340
  onBlur: Ie
339
341
  }), null, 16, Ze),
340
342
  (b(), Re(Me, {
@@ -345,7 +347,7 @@ const Ze = ["id", "name", "value", "placeholder", "disabled", "aria-expanded", "
345
347
  key: 0,
346
348
  id: O,
347
349
  ref_key: "panelEl",
348
- ref: I,
350
+ ref: E,
349
351
  class: oe(["datagrid-cell-combobox__panel", {
350
352
  "datagrid-cell-combobox__panel--inline": e.inlinePanel,
351
353
  "datagrid-cell-combobox__panel--attached-below": S.value === "below",
@@ -354,7 +356,7 @@ const Ze = ["id", "name", "value", "placeholder", "disabled", "aria-expanded", "
354
356
  "data-affino-popover-sticky": e.stickyPopoverId || void 0,
355
357
  style: Be([q.value, D.value]),
356
358
  role: "listbox",
357
- onMousedown: a[1] || (a[1] = k(() => {
359
+ onMousedown: a[2] || (a[2] = w(() => {
358
360
  }, ["prevent"]))
359
361
  }, [
360
362
  T.value ? (b(), h("div", et, "Loading options...")) : (b(), h(le, { key: 1 }, [
@@ -370,7 +372,7 @@ const Ze = ["id", "name", "value", "placeholder", "disabled", "aria-expanded", "
370
372
  "aria-selected": i.value === e.value ? "true" : "false",
371
373
  "data-option-index": f,
372
374
  onMousemove: (y) => K(f),
373
- onClick: k((y) => Q(i.value), ["stop"])
375
+ onClick: w((y) => Q(i.value), ["stop"])
374
376
  }, [
375
377
  ne("span", nt, De(i.label), 1),
376
378
  i.value === e.value ? (b(), h("span", ot)) : U("", !0)