@warkypublic/oranguru 0.0.42 → 0.0.44

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.
package/dist/lib.d.ts CHANGED
@@ -625,7 +625,7 @@ export declare interface GridlerState {
625
625
  _visibleArea: Rectangle;
626
626
  _visiblePages: Rectangle;
627
627
  addError: (err: string, ...args: Array<any>) => void;
628
- askAPIRowNumber?: (key: string) => Promise<number>;
628
+ askAPIRowNumber?: (key: string) => Promise<null | number>;
629
629
  colFilters?: Array<FilterOption>;
630
630
  colOrder?: Record<string, number>;
631
631
  colSize?: Record<string, number>;
@@ -859,7 +859,7 @@ export declare const useFormerState: <T extends FieldValues = FieldValues>(optio
859
859
  };
860
860
  formerWrapper: {
861
861
  onClose: Required<UseFormerStateProps<T>>["onClose"];
862
- opened: UseFormerStateProps<T>["opened"];
862
+ opened: Required<UseFormerStateProps<T>>["opened"];
863
863
  };
864
864
  open: (request: UseFormerStateProps<T>["request"], data: UseFormerStateProps<T>["values"]) => void;
865
865
  updateState: (updates: Partial<UseFormerStateProps<T>>) => void;
package/dist/lib.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as ye from "react";
2
- import $, { forwardRef as Be, useMemo as yt, useRef as U, useCallback as oe, useEffect as I, useImperativeHandle as Ge, useState as se, createElement as ce, createContext as zt, useContext as $t } from "react";
3
- import { TextInput as Ve, Loader as Nt, ActionIcon as _e, Combobox as te, Checkbox as Lt, useVirtualizedCombobox as Bt, ScrollArea as Gt, rem as We, Group as we, Button as re, Paper as Vt, Text as Ke, Collapse as qt, Code as Ht, Switch as wt, Tooltip as Q, ScrollAreaAutosize as Wt, LoadingOverlay as Kt, Drawer as Ut, Modal as Jt, Popover as Re, VisuallyHidden as Yt, NativeSelect as Xt, PasswordInput as Qt, Textarea as Zt, Portal as en, Menu as K, Stack as bt, Select as tn, useMantineTheme as nn, useMantineColorScheme as rn, lighten as Ue, darken as on } from "@mantine/core";
2
+ import $, { forwardRef as Be, useMemo as yt, useRef as U, useCallback as oe, useEffect as I, useImperativeHandle as Ve, useState as se, createElement as ce, createContext as zt, useContext as $t } from "react";
3
+ import { TextInput as Ge, Loader as Nt, ActionIcon as _e, Combobox as te, Checkbox as Lt, useVirtualizedCombobox as Bt, ScrollArea as Vt, rem as We, Group as we, Button as re, Paper as Gt, Text as Ke, Collapse as qt, Code as Ht, Switch as wt, Tooltip as Q, ScrollAreaAutosize as Wt, LoadingOverlay as Kt, Drawer as Ut, Modal as Jt, Popover as Re, VisuallyHidden as Yt, NativeSelect as Xt, PasswordInput as Qt, Textarea as Zt, Portal as en, Menu as K, Stack as bt, Select as tn, useMantineTheme as nn, useMantineColorScheme as rn, lighten as Ue, darken as on } from "@mantine/core";
4
4
  import { flushSync as sn } from "react-dom";
5
5
  import { createSyncStore as Ce } from "@warkypublic/zustandsyncstore";
6
6
  import { produce as H } from "immer";
@@ -43,7 +43,7 @@ function Cn() {
43
43
  function r(h) {
44
44
  if (h == null) return null;
45
45
  if (typeof h == "function")
46
- return h.$$typeof === T ? null : h.displayName || h.name || null;
46
+ return h.$$typeof === M ? null : h.displayName || h.name || null;
47
47
  if (typeof h == "string") return h;
48
48
  switch (h) {
49
49
  case _:
@@ -115,7 +115,7 @@ function Cn() {
115
115
  }
116
116
  }
117
117
  function n() {
118
- var h = M.A;
118
+ var h = F.A;
119
119
  return h === null ? null : h.getOwner();
120
120
  }
121
121
  function s() {
@@ -147,14 +147,14 @@ function Cn() {
147
147
  )), h = this.props.ref, h !== void 0 ? h : null;
148
148
  }
149
149
  function f(h, b, k, v, z, P) {
150
- var F = k.ref;
150
+ var T = k.ref;
151
151
  return h = {
152
152
  $$typeof: p,
153
153
  type: h,
154
154
  key: b,
155
155
  props: k,
156
156
  _owner: v
157
- }, (F !== void 0 ? F : null) !== null ? Object.defineProperty(h, "ref", {
157
+ }, (T !== void 0 ? T : null) !== null ? Object.defineProperty(h, "ref", {
158
158
  enumerable: !1,
159
159
  get: l
160
160
  }) : Object.defineProperty(h, "ref", { enumerable: !1, value: null }), h._store = {}, Object.defineProperty(h._store, "validated", {
@@ -180,24 +180,24 @@ function Cn() {
180
180
  }), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
181
181
  }
182
182
  function u(h, b, k, v, z, P) {
183
- var F = b.children;
184
- if (F !== void 0)
183
+ var T = b.children;
184
+ if (T !== void 0)
185
185
  if (v)
186
- if (B(F)) {
187
- for (v = 0; v < F.length; v++)
188
- c(F[v]);
189
- Object.freeze && Object.freeze(F);
186
+ if (B(T)) {
187
+ for (v = 0; v < T.length; v++)
188
+ c(T[v]);
189
+ Object.freeze && Object.freeze(T);
190
190
  } else
191
191
  console.error(
192
192
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
193
193
  );
194
- else c(F);
194
+ else c(T);
195
195
  if (A.call(b, "key")) {
196
- F = r(h);
196
+ T = r(h);
197
197
  var ee = Object.keys(b).filter(function(Ee) {
198
198
  return Ee !== "key";
199
199
  });
200
- v = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", q[F + v] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
200
+ v = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", q[T + v] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
201
201
  `A props object containing a "key" prop is being spread into JSX:
202
202
  let props = %s;
203
203
  <%s {...props} />
@@ -205,22 +205,22 @@ React keys must be passed directly to JSX without using spread:
205
205
  let props = %s;
206
206
  <%s key={someKey} {...props} />`,
207
207
  v,
208
- F,
208
+ T,
209
209
  ee,
210
- F
211
- ), q[F + v] = !0);
210
+ T
211
+ ), q[T + v] = !0);
212
212
  }
213
- if (F = null, k !== void 0 && (e(k), F = "" + k), i(b) && (e(b.key), F = "" + b.key), "key" in b) {
213
+ if (T = null, k !== void 0 && (e(k), T = "" + k), i(b) && (e(b.key), T = "" + b.key), "key" in b) {
214
214
  k = {};
215
215
  for (var ie in b)
216
216
  ie !== "key" && (k[ie] = b[ie]);
217
217
  } else k = b;
218
- return F && a(
218
+ return T && a(
219
219
  k,
220
220
  typeof h == "function" ? h.displayName || h.name || "Unknown" : h
221
221
  ), f(
222
222
  h,
223
- F,
223
+ T,
224
224
  k,
225
225
  n(),
226
226
  z,
@@ -233,7 +233,7 @@ React keys must be passed directly to JSX without using spread:
233
233
  function m(h) {
234
234
  return typeof h == "object" && h !== null && h.$$typeof === p;
235
235
  }
236
- var g = $, p = /* @__PURE__ */ Symbol.for("react.transitional.element"), y = /* @__PURE__ */ Symbol.for("react.portal"), _ = /* @__PURE__ */ Symbol.for("react.fragment"), C = /* @__PURE__ */ Symbol.for("react.strict_mode"), x = /* @__PURE__ */ Symbol.for("react.profiler"), R = /* @__PURE__ */ Symbol.for("react.consumer"), O = /* @__PURE__ */ Symbol.for("react.context"), N = /* @__PURE__ */ Symbol.for("react.forward_ref"), w = /* @__PURE__ */ Symbol.for("react.suspense"), S = /* @__PURE__ */ Symbol.for("react.suspense_list"), E = /* @__PURE__ */ Symbol.for("react.memo"), D = /* @__PURE__ */ Symbol.for("react.lazy"), L = /* @__PURE__ */ Symbol.for("react.activity"), T = /* @__PURE__ */ Symbol.for("react.client.reference"), M = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, B = Array.isArray, G = console.createTask ? console.createTask : function() {
236
+ var g = $, p = /* @__PURE__ */ Symbol.for("react.transitional.element"), y = /* @__PURE__ */ Symbol.for("react.portal"), _ = /* @__PURE__ */ Symbol.for("react.fragment"), C = /* @__PURE__ */ Symbol.for("react.strict_mode"), x = /* @__PURE__ */ Symbol.for("react.profiler"), R = /* @__PURE__ */ Symbol.for("react.consumer"), O = /* @__PURE__ */ Symbol.for("react.context"), N = /* @__PURE__ */ Symbol.for("react.forward_ref"), w = /* @__PURE__ */ Symbol.for("react.suspense"), S = /* @__PURE__ */ Symbol.for("react.suspense_list"), E = /* @__PURE__ */ Symbol.for("react.memo"), D = /* @__PURE__ */ Symbol.for("react.lazy"), L = /* @__PURE__ */ Symbol.for("react.activity"), M = /* @__PURE__ */ Symbol.for("react.client.reference"), F = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, B = Array.isArray, G = console.createTask ? console.createTask : function() {
237
237
  return null;
238
238
  };
239
239
  g = {
@@ -246,7 +246,7 @@ React keys must be passed directly to JSX without using spread:
246
246
  s
247
247
  )(), Z = G(t(s)), q = {};
248
248
  de.Fragment = _, de.jsx = function(h, b, k) {
249
- var v = 1e4 > M.recentlyCreatedOwnerStacks++;
249
+ var v = 1e4 > F.recentlyCreatedOwnerStacks++;
250
250
  return u(
251
251
  h,
252
252
  b,
@@ -256,7 +256,7 @@ React keys must be passed directly to JSX without using spread:
256
256
  v ? G(t(h)) : Z
257
257
  );
258
258
  }, de.jsxs = function(h, b, k) {
259
- var v = 1e4 > M.recentlyCreatedOwnerStacks++;
259
+ var v = 1e4 > F.recentlyCreatedOwnerStacks++;
260
260
  return u(
261
261
  h,
262
262
  b,
@@ -984,7 +984,7 @@ const { Provider: $n, useStore: Nn } = Ce(
984
984
  }
985
985
  ) : null;
986
986
  return /* @__PURE__ */ d.jsx(
987
- Ve,
987
+ Ge,
988
988
  {
989
989
  disabled: n,
990
990
  error: s,
@@ -1046,8 +1046,8 @@ const Ln = (r) => {
1046
1046
  search: E,
1047
1047
  selectedOptionIndex: D,
1048
1048
  selectFirst: L,
1049
- setInput: T,
1050
- setOpened: M,
1049
+ setInput: M,
1050
+ setOpened: F,
1051
1051
  setSearch: A,
1052
1052
  setSelectedOptionIndex: B,
1053
1053
  showAll: G,
@@ -1089,23 +1089,23 @@ const Ln = (r) => {
1089
1089
  const z = typeof v == "string" ? parseInt(v, 10) : v, P = i[z];
1090
1090
  if (P)
1091
1091
  if (C) {
1092
- const F = Array.isArray(j) ? j : [], ie = F.includes(P.value) ? F.filter((Oe) => Oe !== P.value) : [...F, P.value];
1092
+ const T = Array.isArray(j) ? j : [], ie = T.includes(P.value) ? T.filter((Oe) => Oe !== P.value) : [...T, P.value];
1093
1093
  R?.(ie);
1094
1094
  const Ee = i.filter((Oe) => ie.includes(Oe.value));
1095
1095
  x?.(Ee);
1096
1096
  } else
1097
- R?.(P.value), A(""), T(P.label), n.current = P.value, M(!1);
1097
+ R?.(P.value), A(""), M(P.label), n.current = P.value, F(!1);
1098
1098
  },
1099
- [i, C, j, R, x, A, T, M]
1099
+ [i, C, j, R, x, A, M, F]
1100
1100
  ), h = oe(() => {
1101
- G && L ? q(0) : (R?.(C ? [] : null), A(""), T(""), t.current?.focus()), N && M(!0);
1102
- }, [G, L, C, R, A, T, N, M, q]), b = Bt({
1101
+ G && L ? q(0) : (R?.(C ? [] : null), A(""), M(""), t.current?.focus()), N && F(!0);
1102
+ }, [G, L, C, R, A, M, N, F, q]), b = Bt({
1103
1103
  getOptionId: (v) => String(v),
1104
1104
  onDropdownClose: () => {
1105
- M(!1);
1105
+ F(!1);
1106
1106
  },
1107
1107
  onDropdownOpen: () => {
1108
- (!j || C && (!Array.isArray(j) || j.length === 0)) && (A(""), T("")), b.selectFirstOption();
1108
+ (!j || C && (!Array.isArray(j) || j.length === 0)) && (A(""), M("")), b.selectFirstOption();
1109
1109
  },
1110
1110
  onSelectedOptionSubmit: q,
1111
1111
  opened: O,
@@ -1130,10 +1130,10 @@ const Ln = (r) => {
1130
1130
  }, [E, O]), I(() => {
1131
1131
  if (C) {
1132
1132
  const v = i.filter((z) => Array.isArray(j) && j.includes(z.value)).map((z) => z.label).join(", ");
1133
- !O && g !== v && (T(v), A(""));
1133
+ !O && g !== v && (M(v), A(""));
1134
1134
  } else {
1135
1135
  const v = i.find((z) => z.value === j)?.label;
1136
- g !== v && (E ?? "") === "" && n.current !== j && j ? T(v ?? "") : !j && !n.current && (E ?? "") === "" && (A(""), T(""));
1136
+ g !== v && (E ?? "") === "" && n.current !== j && j ? M(v ?? "") : !j && !n.current && (E ?? "") === "" && (A(""), M(""));
1137
1137
  }
1138
1138
  if (C) {
1139
1139
  const v = i.filter((z) => Array.isArray(j) && j.includes(z.value)) ?? [];
@@ -1142,21 +1142,21 @@ const Ln = (r) => {
1142
1142
  const v = i?.find((z) => z.value === j) ?? null;
1143
1143
  s.current?.value !== v?.value && (x?.(v), s.current = v);
1144
1144
  }
1145
- }, [j, i, g, E, C, O, x, T, A]), I(() => {
1145
+ }, [j, i, g, E, C, O, x, M, A]), I(() => {
1146
1146
  L && (i?.length ?? 0) > 0 && !C && (j || q?.(0));
1147
- }, [L, i, C]), Ge(o, () => ({
1147
+ }, [L, i, C]), Ve(o, () => ({
1148
1148
  clear: () => {
1149
1149
  h();
1150
1150
  },
1151
1151
  close: () => {
1152
- M(!1), b.closeDropdown();
1152
+ F(!1), b.closeDropdown();
1153
1153
  },
1154
1154
  focus: () => {
1155
1155
  t.current?.focus();
1156
1156
  },
1157
1157
  getValue: () => j,
1158
1158
  open: () => {
1159
- M(!0), b.openDropdown();
1159
+ F(!0), b.openDropdown();
1160
1160
  },
1161
1161
  setValue: (v) => {
1162
1162
  R?.(v);
@@ -1178,11 +1178,11 @@ const Ln = (r) => {
1178
1178
  isFetching: p,
1179
1179
  label: y,
1180
1180
  onBlur: () => {
1181
- !j && !C && (A(""), T(""), b.closeDropdown(), M(!1));
1181
+ !j && !C && (A(""), M(""), b.closeDropdown(), F(!1));
1182
1182
  },
1183
1183
  onClear: h,
1184
1184
  onSearch: (v) => {
1185
- A(v.currentTarget.value), T(v.currentTarget.value), M(!0);
1185
+ A(v.currentTarget.value), M(v.currentTarget.value), F(!0);
1186
1186
  },
1187
1187
  placeholder: w,
1188
1188
  ref: t,
@@ -1198,7 +1198,7 @@ const Ln = (r) => {
1198
1198
  p: 2,
1199
1199
  ...f,
1200
1200
  children: O && k.length > 0 ? /* @__PURE__ */ d.jsx(te.Options, { children: /* @__PURE__ */ d.jsx(
1201
- Gt.Autosize,
1201
+ Vt.Autosize,
1202
1202
  {
1203
1203
  ...S,
1204
1204
  mah: _ ?? 200,
@@ -1252,7 +1252,7 @@ const Ln = (r) => {
1252
1252
  Ot.displayName = "BoxerInner";
1253
1253
  const Bn = $.forwardRef((r, o) => /* @__PURE__ */ d.jsx($n, { ...r, children: /* @__PURE__ */ d.jsx(Ot, { ref: o }) }));
1254
1254
  Bn.displayName = "Boxer";
1255
- class Gn {
1255
+ class Vn {
1256
1256
  config = { enabled: !0 };
1257
1257
  reporters = [];
1258
1258
  sentryInstance = null;
@@ -1358,7 +1358,7 @@ class Gn {
1358
1358
  this.reporters.push(e);
1359
1359
  }
1360
1360
  }
1361
- const De = new Gn();
1361
+ const De = new Vn();
1362
1362
  class oo extends $.PureComponent {
1363
1363
  constructor(o) {
1364
1364
  super(o), this.state = {
@@ -1393,11 +1393,11 @@ class oo extends $.PureComponent {
1393
1393
  ] }) : this.props.children;
1394
1394
  }
1395
1395
  }
1396
- let Vn = {
1396
+ let Gn = {
1397
1397
  disabled: !1,
1398
1398
  onError: void 0
1399
1399
  };
1400
- const ke = () => ({ ...Vn });
1400
+ const ke = () => ({ ...Gn });
1401
1401
  class so extends $.Component {
1402
1402
  constructor(o) {
1403
1403
  super(o), this.state = {
@@ -1513,7 +1513,7 @@ class so extends $.Component {
1513
1513
  )
1514
1514
  ] }),
1515
1515
  this.state.error && /* @__PURE__ */ d.jsxs(
1516
- Vt,
1516
+ Gt,
1517
1517
  {
1518
1518
  p: "md",
1519
1519
  shadow: "xs",
@@ -1953,7 +1953,7 @@ const { Provider: qn, useStore: me } = Ce(
1953
1953
  values: y,
1954
1954
  ...g
1955
1955
  });
1956
- return Ge(
1956
+ return Ve(
1957
1957
  e,
1958
1958
  () => ({
1959
1959
  close: async () => {
@@ -2278,7 +2278,7 @@ const lo = (r) => {
2278
2278
  control: o,
2279
2279
  name: e,
2280
2280
  render: ({ field: i, formState: a }) => /* @__PURE__ */ d.jsx(Q, { label: n ?? "", withArrow: !0, children: /* @__PURE__ */ ce(
2281
- Ve,
2281
+ Ge,
2282
2282
  {
2283
2283
  ...s,
2284
2284
  ...i,
@@ -3178,7 +3178,7 @@ const Rr = [
3178
3178
  }), l;
3179
3179
  });
3180
3180
  }, [s, r.column.id, r.options, r.storeState]), /* @__PURE__ */ d.jsx(
3181
- Ve,
3181
+ Ge,
3182
3182
  {
3183
3183
  onChange: (i) => n(i.target.value),
3184
3184
  rightSection: /* @__PURE__ */ d.jsx(_e, { color: "gray", onClick: () => n(""), variant: "filled", children: /* @__PURE__ */ d.jsx(qe, { color: "red" }) }),
@@ -3321,14 +3321,14 @@ const Rr = [
3321
3321
  }
3322
3322
  }
3323
3323
  if (n > 0)
3324
- return console.log("Local row index", n, e), n;
3324
+ return n;
3325
3325
  }
3326
3326
  if (n > 0)
3327
3327
  return n;
3328
3328
  if (typeof t.askAPIRowNumber == "function") {
3329
3329
  const l = await t.askAPIRowNumber(String(e));
3330
3330
  if (l && l >= 0)
3331
- return console.log("Remote row index", n, e), l;
3331
+ return l;
3332
3332
  }
3333
3333
  }
3334
3334
  },
@@ -3405,8 +3405,8 @@ const Rr = [
3405
3405
  ), t.glideProps?.onCellActivated?.(e);
3406
3406
  },
3407
3407
  onCellClicked: (e, t) => {
3408
- const n = o(), [s, i] = e;
3409
- n.glideProps?.onCellClicked && n.glideProps?.onCellClicked?.(e, t), n.values?.length && n.onChange && n.onChange(n.values), n._events.dispatchEvent(
3408
+ const n = o(), [s, i] = e, a = n.getRowBuffer(i);
3409
+ n.glideProps?.onCellClicked && n.glideProps?.onCellClicked?.(e, t), n.values?.length && n.values?.length > 0 ? n.onChange && n.onChange(n.values) : a && n.onChange && n.onChange([a]), n._events.dispatchEvent(
3410
3410
  new CustomEvent("onCellClicked", {
3411
3411
  detail: { cell: e, col: s, row: i, state: n }
3412
3412
  })
@@ -3806,6 +3806,8 @@ function Ar(r) {
3806
3806
  ), a = oe(
3807
3807
  async (l) => {
3808
3808
  const f = t("colFilters");
3809
+ if (!l)
3810
+ return null;
3809
3811
  if (r && r.url) {
3810
3812
  const u = new Headers(), c = [
3811
3813
  { type: "limit", value: String(10) },
@@ -3827,7 +3829,7 @@ function Ar(r) {
3827
3829
  for (const y in fe(c))
3828
3830
  u.set(y, p[y]);
3829
3831
  }
3830
- const m = new AbortController(), g = await fetch(`${r.url}?x-fetch-rownumber=${l}}`, {
3832
+ const m = new AbortController(), g = await fetch(`${r.url}?x-fetch-rownumber=${l}`, {
3831
3833
  headers: u,
3832
3834
  method: "GET",
3833
3835
  signal: m?.signal
@@ -3891,7 +3893,7 @@ function Tr(r) {
3891
3893
  _ !== void 0 && (l = a.getRowBuffer(_));
3892
3894
  }
3893
3895
  const p = typeof r.descriptionField == "string" ? l?.[r.descriptionField] : typeof r.descriptionField == "function" && l ? r.descriptionField(l) : void 0;
3894
- i === "other" && c.push({
3896
+ (i === "other" || i === "cell" && !l) && c.push({
3895
3897
  c: "blue",
3896
3898
  label: "Add",
3897
3899
  onClick: () => {
@@ -4016,7 +4018,7 @@ function Pr() {
4016
4018
  }
4017
4019
  function Dr(r, o) {
4018
4020
  const [e, t] = W((n) => [n.setStateFN, n.getState]);
4019
- return Ge(o, () => ({
4021
+ return Ve(o, () => ({
4020
4022
  getGlideRef: () => t("_glideref"),
4021
4023
  getState: t,
4022
4024
  isEmpty: () => t("isEmpty"),
@@ -4111,34 +4113,36 @@ const Mt = $.memo(() => {
4111
4113
  return I(() => {
4112
4114
  O && (async () => {
4113
4115
  const S = c("_page_data"), E = c("pageSize"), D = c("keyField") ?? "id", L = [];
4114
- for (const T in O) {
4115
- let M = -1;
4116
+ for (const M in O) {
4117
+ let F = -1;
4116
4118
  const A = String(
4117
- typeof O?.[T] == "object" ? O?.[T]?.[D] : typeof O?.[T] == "string" ? O?.[T] : void 0
4119
+ typeof O?.[M] == "object" ? O?.[M]?.[D] : typeof O?.[M] == "string" ? O?.[M] : void 0
4118
4120
  );
4119
4121
  for (const B in S) {
4120
4122
  for (const G in S[B]) {
4121
4123
  const j = Number(B) * E + Number(G);
4122
4124
  if (String(S[B][G]?.[D]) === A) {
4123
- M = j;
4125
+ F = j;
4124
4126
  break;
4125
4127
  }
4126
4128
  }
4127
- if (M >= 0) {
4128
- L.push(M);
4129
+ if (F >= 0) {
4130
+ L.push(F);
4129
4131
  break;
4130
4132
  }
4131
4133
  }
4132
- if (!(M >= 0)) {
4134
+ if (F >= 0)
4135
+ L.push(F);
4136
+ else {
4133
4137
  const B = await u(A);
4134
- B && L.push(B);
4138
+ B !== null && L.push(B);
4135
4139
  }
4136
4140
  }
4137
4141
  return L;
4138
4142
  })().then((S) => {
4139
4143
  let E = ne.empty();
4140
4144
  S.forEach((D) => {
4141
- E = E.add(D);
4145
+ D !== void 0 && (E = E.add(D));
4142
4146
  }), R("_gridSelectionRows", () => E), R("_gridSelection", (D) => ({
4143
4147
  columns: D?.columns ?? ne.empty(),
4144
4148
  ...D,
@@ -4213,9 +4217,11 @@ const Mt = $.memo(() => {
4213
4217
  const L = c("scrollToRowKey");
4214
4218
  if (L && L >= 0)
4215
4219
  return;
4216
- const T = c("keyField") ?? "id", A = c("_page_data")?.[0]?.[0], B = A?.[T] ?? -1, G = c("values") ?? [];
4217
- if (!(O && O.length > 0) && B && B > 0 && (G.length ?? 0) === 0) {
4218
- const j = [A, ...G], J = c("onChange");
4220
+ const M = c("keyField") ?? "id", A = c("_page_data")?.[0]?.[0], B = A?.[M] ?? -1, G = c("values") ?? [];
4221
+ if (!A)
4222
+ return;
4223
+ if (B && B > 0 && (G.length ?? 0) === 0) {
4224
+ const j = [A], J = c("onChange");
4219
4225
  J ? J(j) : x("values", j), x("scrollToRowKey", B);
4220
4226
  }
4221
4227
  }
@@ -4223,13 +4229,13 @@ const Mt = $.memo(() => {
4223
4229
  return w?.addEventListener("loadPage", S), () => {
4224
4230
  w?.removeEventListener("loadPage", S);
4225
4231
  };
4226
- }, [g, C]), I(() => {
4232
+ }, [g, C, O]), I(() => {
4227
4233
  const w = c("ready"), S = c("_glideref"), E = c("getRowIndexByKey"), D = _ ?? p;
4228
4234
  D && S && w && E?.(D).then((L) => {
4229
4235
  if (L !== void 0) {
4230
4236
  if (_) {
4231
- const T = c("onChange"), M = [{ [c("keyField") ?? "id"]: _ }];
4232
- JSON.stringify(c("values")) !== JSON.stringify(M) && (T ? T(M) : x("values", M));
4237
+ const M = c("onChange"), F = [{ [c("keyField") ?? "id"]: _ }];
4238
+ JSON.stringify(c("values")) !== JSON.stringify(F) && (M ? M(F) : x("values", F));
4233
4239
  }
4234
4240
  S.scrollTo(0, L), c("_events").dispatchEvent(
4235
4241
  new CustomEvent("scrollToRowKeyFound", {
@@ -4299,9 +4305,9 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4299
4305
  fill="${r.fgColor ?? "currentColor"}"
4300
4306
  d="M2.22 9.967L7.97 4.22l.085-.074l.058-.038l.072-.039l.105-.04l.105-.022l.052-.005L8.5 4l.057.002l.092.013l.107.03l.085.037l.054.03l.063.044l.072.064l5.75 5.747a.75.75 0 0 1-.976 1.133l-.084-.072L9.25 6.56v16.69a.75.75 0 0 1-1.493.102l-.007-.102V6.56l-4.47 4.468a.75.75 0 0 1-.976.072l-.084-.072a.75.75 0 0 1-.073-.977zM19.5 4a.75.75 0 0 1 .743.648l.007.102v16.687l4.47-4.467l.084-.073a.75.75 0 0 1 1.049 1.05l-.073.083l-5.728 5.727a.75.75 0 0 1-1.031.07l-.073-.07l-5.728-5.727l-.073-.084a.75.75 0 0 1-.007-.882l.08-.094l.084-.073a.75.75 0 0 1 .882-.007l.094.08l4.47 4.469V4.75l.007-.102A.75.75 0 0 1 19.5 4"
4301
4307
  ></path>
4302
- </svg>`, Br = "_container_1nbyf_1", Gr = {
4308
+ </svg>`, Br = "_container_1nbyf_1", Vr = {
4303
4309
  container: Br
4304
- }, Vr = (r) => (o) => o % 2 === 0 ? void 0 : {
4310
+ }, Gr = (r) => (o) => o % 2 === 0 ? void 0 : {
4305
4311
  bgCell: r === "dark" ? "#303030" : "#e1effc"
4306
4312
  }, qr = () => {
4307
4313
  const r = nn(), { colorScheme: o } = rn(), { enableOddEvenRowColor: e, focused: t } = W((c) => ({
@@ -4343,7 +4349,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4343
4349
  }, [l, f] = se(a);
4344
4350
  return I(() => {
4345
4351
  f(a);
4346
- }, [o, t]), { getRowThemeOverride: (c) => e ? Vr(o)(c) : void 0, gridTheme: l };
4352
+ }, [o, t]), { getRowThemeOverride: (c) => e ? Gr(o)(c) : void 0, gridTheme: l };
4347
4353
  }, Hr = () => {
4348
4354
  const r = $.useRef(null), o = $.useRef(!1), { height: e, ref: t, width: n } = wn({ box: "content-box" }), {
4349
4355
  _gridSelection: s,
@@ -4368,8 +4374,8 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4368
4374
  onHeaderMenuClick: E,
4369
4375
  onItemHovered: D,
4370
4376
  onVisibleRegionChanged: L,
4371
- renderColumns: T,
4372
- rowHeight: M,
4377
+ renderColumns: M,
4378
+ rowHeight: F,
4373
4379
  sections: A,
4374
4380
  selectMode: B,
4375
4381
  setState: G,
@@ -4425,7 +4431,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4425
4431
  /* @__PURE__ */ d.jsxs(
4426
4432
  "div",
4427
4433
  {
4428
- className: Gr.container,
4434
+ className: Vr.container,
4429
4435
  "data-focused": a,
4430
4436
  onContextMenu: (h) => {
4431
4437
  h.preventDefault(), o.current || (o.current = !0, w("other", h), setTimeout(() => {
@@ -4446,7 +4452,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4446
4452
  vn,
4447
4453
  {
4448
4454
  cellActivationBehavior: "double-click",
4449
- columns: T ?? [],
4455
+ columns: M ?? [],
4450
4456
  columnSelect: "none",
4451
4457
  drawFocusRing: !0,
4452
4458
  height: e ?? 400,
@@ -4493,7 +4499,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4493
4499
  if (b.length === 0)
4494
4500
  for (const P of k?.rows ?? [])
4495
4501
  z && z(P)?.[v] && (b = b.hasIndex(P) ? b : b.add(P));
4496
- console.log("Debug:onGridSelectionChange", k, h), (JSON.stringify(k?.columns) !== JSON.stringify(h.columns) || JSON.stringify(k?.rows) !== JSON.stringify(b) || JSON.stringify(k?.current) !== JSON.stringify(h.current)) && (G("_gridSelection", { ...h, rows: b }), G("_gridSelectionRows", b));
4502
+ (JSON.stringify(k?.columns) !== JSON.stringify(h.columns) || JSON.stringify(k?.rows) !== JSON.stringify(b) || JSON.stringify(k?.current) !== JSON.stringify(h.current)) && (G("_gridSelection", { ...h, rows: b }), G("_gridSelectionRows", b));
4497
4503
  },
4498
4504
  onHeaderClicked: S,
4499
4505
  onHeaderContextMenu: (h, b) => {
@@ -4510,7 +4516,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4510
4516
  /* @__PURE__ */ d.jsx(Pr, {}),
4511
4517
  A?.rightElementEnd
4512
4518
  ] }),
4513
- rowHeight: M ?? 22,
4519
+ rowHeight: F ?? 22,
4514
4520
  rows: J ?? 0,
4515
4521
  theme: q.gridTheme,
4516
4522
  width: n ?? 200