@warkypublic/oranguru 0.0.41 → 0.0.43

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
@@ -297,7 +297,7 @@ export declare const Former: ForwardRefExoticComponent<FormerProps<any> & {
297
297
  children?: ReactNode | undefined;
298
298
  } & RefAttributes<FormerRef<any>>>;
299
299
 
300
- export declare type FormerAPICallType<T extends FieldValues = any> = (mode: 'mutate' | 'read', request: RequestType, value?: T, key?: number | string) => Promise<T>;
300
+ export declare type FormerAPICallType<T extends FieldValues = any> = (mode: 'mutate' | 'read', request: FormRequestType, value?: T, key?: number | string) => Promise<T>;
301
301
 
302
302
  export declare const FormerButtonArea: () => JSX.Element;
303
303
 
@@ -345,7 +345,7 @@ export declare interface FormerProps<T extends FieldValues = any> {
345
345
  onOpen?: (data?: T) => void;
346
346
  opened?: boolean;
347
347
  primeData?: T;
348
- request: RequestType;
348
+ request: FormRequestType;
349
349
  uniqueKeyField?: string;
350
350
  useFormProps?: UseFormProps<T>;
351
351
  values?: T;
@@ -390,13 +390,13 @@ export declare interface FormerState<T extends FieldValues = any> {
390
390
  reset: (e?: default_2.BaseSyntheticEvent<object, any, any> | undefined) => Promise<void>;
391
391
  save: (e?: default_2.BaseSyntheticEvent<object, any, any> | undefined) => Promise<T | undefined>;
392
392
  scrollAreaProps?: ScrollAreaAutosizeProps;
393
- setRequest: (request: RequestType) => void;
393
+ setRequest: (request: FormRequestType) => void;
394
394
  setState: <K extends keyof FormStateAndProps<T>>(key: K, value: Partial<FormStateAndProps<T>>[K]) => void;
395
395
  setStateFN: <K extends keyof FormStateAndProps<T>>(key: K, value: (current: FormStateAndProps<T>[K]) => Partial<FormStateAndProps<T>[K]>) => Promise<void>;
396
396
  validate: () => Promise<boolean>;
397
397
  }
398
398
 
399
- declare type FormRequestType = 'change' | 'delete' | 'insert' | 'select';
399
+ declare type FormRequestType = 'change' | 'delete' | 'insert' | 'select' | 'update' | 'view';
400
400
 
401
401
  export declare type FormStateAndProps<T extends FieldValues = any> = FormerProps<T> & Partial<FormerState<T>>;
402
402
 
@@ -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>;
@@ -793,8 +793,6 @@ export declare class ReactErrorBoundary extends default_2.Component<ErrorBoundar
793
793
  retry(): void;
794
794
  }
795
795
 
796
- export declare type RequestType = 'delete' | 'insert' | 'select' | 'update' | 'view';
797
-
798
796
  export declare interface SentryConfig {
799
797
  beforeSend?: (event: any) => any | null;
800
798
  dsn: string;
@@ -855,15 +853,13 @@ export declare const useBoxerStore: {
855
853
  export declare const useFormerState: <T extends FieldValues = FieldValues>(options?: Partial<UseFormerStateProps<T>>) => {
856
854
  former: {
857
855
  onChange: ((value: T, state: Partial< FormStateAndProps<T>>) => void) | undefined;
858
- onClose: ((data?: T | undefined) => void) | undefined;
859
- opened: boolean | undefined;
860
856
  values?: T | undefined;
861
857
  primeData?: T | undefined;
862
- request?: RequestType | undefined;
858
+ request: FormRequestType;
863
859
  };
864
860
  formerWrapper: {
865
- onClose: ((data?: T | undefined) => void) | undefined;
866
- opened: boolean | undefined;
861
+ onClose: Required<UseFormerStateProps<T>>["onClose"];
862
+ opened: Required<UseFormerStateProps<T>>["opened"];
867
863
  };
868
864
  open: (request: UseFormerStateProps<T>["request"], data: UseFormerStateProps<T>["values"]) => void;
869
865
  updateState: (updates: Partial<UseFormerStateProps<T>>) => void;
package/dist/lib.es.js CHANGED
@@ -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 _:
@@ -56,7 +56,7 @@ function Cn() {
56
56
  return "Suspense";
57
57
  case S:
58
58
  return "SuspenseList";
59
- case L:
59
+ case N:
60
60
  return "Activity";
61
61
  }
62
62
  if (typeof h == "object")
@@ -69,7 +69,7 @@ function Cn() {
69
69
  return h.displayName || "Context";
70
70
  case R:
71
71
  return (h._context.displayName || "Context") + ".Consumer";
72
- case N:
72
+ case L:
73
73
  var b = h.render;
74
74
  return h = h.displayName, h || (h = b.displayName || b.name || "", h = h !== "" ? "ForwardRef(" + h + ")" : "ForwardRef"), h;
75
75
  case E:
@@ -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"), L = /* @__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"), N = /* @__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,
@@ -565,8 +565,8 @@ class Mn {
565
565
  let y, _;
566
566
  if (p !== void 0 && this.options.lanes > 1) {
567
567
  y = p;
568
- const O = c[y], N = O !== void 0 ? u[O] : void 0;
569
- _ = N ? N.end + this.options.gap : t + n;
568
+ const O = c[y], L = O !== void 0 ? u[O] : void 0;
569
+ _ = L ? L.end + this.options.gap : t + n;
570
570
  } else {
571
571
  const O = this.options.lanes === 1 ? u[m - 1] : this.getFurthestMeasurement(u, m);
572
572
  _ = O ? O.end + this.options.gap : t + n, y = O ? O.lane : m % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(m, y);
@@ -1040,14 +1040,14 @@ const Ln = (r) => {
1040
1040
  onBufferChange: x,
1041
1041
  onChange: R,
1042
1042
  opened: O,
1043
- openOnClear: N,
1043
+ openOnClear: L,
1044
1044
  placeholder: w,
1045
1045
  scrollAreaProps: S,
1046
1046
  search: E,
1047
1047
  selectedOptionIndex: D,
1048
- selectFirst: L,
1049
- setInput: T,
1050
- setOpened: M,
1048
+ selectFirst: N,
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 && N ? q(0) : (R?.(C ? [] : null), A(""), M(""), t.current?.focus()), L && F(!0);
1102
+ }, [G, N, C, R, A, M, L, 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(() => {
1146
- L && (i?.length ?? 0) > 0 && !C && (j || q?.(0));
1147
- }, [L, i, C]), Ge(o, () => ({
1145
+ }, [j, i, g, E, C, O, x, M, A]), I(() => {
1146
+ N && (i?.length ?? 0) > 0 && !C && (j || q?.(0));
1147
+ }, [N, i, C]), Ge(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,
@@ -2141,7 +2141,7 @@ const lo = (r) => {
2141
2141
  e((f) => ({ ...f, ...l }));
2142
2142
  }, { onChange: n, onClose: s, opened: i, ...a } = o;
2143
2143
  return {
2144
- former: { ...a, onChange: n, onClose: s, opened: i },
2144
+ former: { ...a, onChange: n },
2145
2145
  formerWrapper: { onClose: s, opened: i },
2146
2146
  open: (l, f) => {
2147
2147
  e((u) => ({ ...u, opened: !0, primeData: f, request: l, values: f }));
@@ -2447,13 +2447,13 @@ function Qn() {
2447
2447
  var E = m(w);
2448
2448
  return g !== void 0 && g(S, E) ? (R = w, S) : (R = w, O = E);
2449
2449
  }
2450
- var x = !1, R, O, N = c === void 0 ? null : c;
2450
+ var x = !1, R, O, L = c === void 0 ? null : c;
2451
2451
  return [
2452
2452
  function() {
2453
2453
  return C(u());
2454
2454
  },
2455
- N === null ? void 0 : function() {
2456
- return C(N());
2455
+ L === null ? void 0 : function() {
2456
+ return C(L());
2457
2457
  }
2458
2458
  ];
2459
2459
  },
@@ -2499,13 +2499,13 @@ function Zn() {
2499
2499
  var E = m(w);
2500
2500
  return g !== void 0 && g(S, E) ? (R = w, S) : (R = w, O = E);
2501
2501
  }
2502
- var x = !1, R, O, N = c === void 0 ? null : c;
2502
+ var x = !1, R, O, L = c === void 0 ? null : c;
2503
2503
  return [
2504
2504
  function() {
2505
2505
  return C(u());
2506
2506
  },
2507
- N === null ? void 0 : function() {
2508
- return C(N());
2507
+ L === null ? void 0 : function() {
2508
+ return C(L());
2509
2509
  }
2510
2510
  ];
2511
2511
  },
@@ -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
  })
@@ -3766,17 +3766,17 @@ function Ar(r) {
3766
3766
  e("loadingData", !1);
3767
3767
  return;
3768
3768
  }
3769
- const N = new AbortController();
3769
+ const L = new AbortController();
3770
3770
  await o("_active_requests", (S) => [
3771
3771
  ...S ?? [],
3772
- { controller: N, page: l }
3772
+ { controller: L, page: l }
3773
3773
  ]);
3774
3774
  const w = await fetch(
3775
3775
  `${r.url}?x-limit=${String(c ?? 50)}&x-offset=${String((c ?? 50) * l)}`,
3776
3776
  {
3777
3777
  headers: C,
3778
3778
  method: "GET",
3779
- signal: N?.signal
3779
+ signal: L?.signal
3780
3780
  }
3781
3781
  );
3782
3782
  if (w.ok) {
@@ -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: () => {
@@ -4093,7 +4095,7 @@ const Mt = $.memo(() => {
4093
4095
  setStateFN: w.setStateFN,
4094
4096
  uniqueid: w.uniqueid,
4095
4097
  values: w.values
4096
- })), N = yn(
4098
+ })), L = yn(
4097
4099
  (w) => {
4098
4100
  m(0, "all").then(() => {
4099
4101
  c("refreshCells")?.(), c("_events")?.dispatchEvent?.(
@@ -4110,35 +4112,37 @@ const Mt = $.memo(() => {
4110
4112
  );
4111
4113
  return I(() => {
4112
4114
  O && (async () => {
4113
- const S = c("_page_data"), E = c("pageSize"), D = c("keyField") ?? "id", L = [];
4114
- for (const T in O) {
4115
- let M = -1;
4115
+ const S = c("_page_data"), E = c("pageSize"), D = c("keyField") ?? "id", N = [];
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
+ N.push(F);
4129
4131
  break;
4130
4132
  }
4131
4133
  }
4132
- if (!(M >= 0)) {
4134
+ if (F >= 0)
4135
+ N.push(F);
4136
+ else {
4133
4137
  const B = await u(A);
4134
- B && L.push(B);
4138
+ B !== null && N.push(B);
4135
4139
  }
4136
4140
  }
4137
- return L;
4141
+ return N;
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,
@@ -4165,7 +4169,7 @@ const Mt = $.memo(() => {
4165
4169
  o.current = "";
4166
4170
  return;
4167
4171
  }
4168
- o.current !== y && (N(y), o.current = y);
4172
+ o.current !== y && (L(y), o.current = y);
4169
4173
  }, [y]), I(() => {
4170
4174
  l && (x("_gridSelection", {
4171
4175
  columns: ne.empty(),
@@ -4210,10 +4214,10 @@ const Mt = $.memo(() => {
4210
4214
  const w = c("_events"), S = () => {
4211
4215
  const E = c("selectFirstRowOnMount");
4212
4216
  if (c("ready") && E) {
4213
- const L = c("scrollToRowKey");
4214
- if (L && L >= 0)
4217
+ const N = c("scrollToRowKey");
4218
+ if (N && N >= 0)
4215
4219
  return;
4216
- const T = c("keyField") ?? "id", A = c("_page_data")?.[0]?.[0], B = A?.[T] ?? -1, G = c("values") ?? [];
4220
+ const M = c("keyField") ?? "id", A = c("_page_data")?.[0]?.[0], B = A?.[M] ?? -1, G = c("values") ?? [];
4217
4221
  if (!(O && O.length > 0) && B && B > 0 && (G.length ?? 0) === 0) {
4218
4222
  const j = [A, ...G], J = c("onChange");
4219
4223
  J ? J(j) : x("values", j), x("scrollToRowKey", B);
@@ -4225,16 +4229,16 @@ const Mt = $.memo(() => {
4225
4229
  };
4226
4230
  }, [g, C]), I(() => {
4227
4231
  const w = c("ready"), S = c("_glideref"), E = c("getRowIndexByKey"), D = _ ?? p;
4228
- D && S && w && E?.(D).then((L) => {
4229
- if (L !== void 0) {
4230
- if (_) {
4231
- const T = c("onChange"), M = [{ [c("keyField") ?? "id"]: _ }];
4232
- JSON.stringify(c("values")) !== JSON.stringify(M) && (T ? T(M) : x("values", M));
4232
+ D && S && w && E?.(D).then((N) => {
4233
+ if (N !== void 0) {
4234
+ if (console.log("Scrolling to selected row:", N, _, p), _) {
4235
+ const M = c("onChange"), F = [{ [c("keyField") ?? "id"]: _ }];
4236
+ JSON.stringify(c("values")) !== JSON.stringify(F) && (M ? M(F) : x("values", F));
4233
4237
  }
4234
- S.scrollTo(0, L), c("_events").dispatchEvent(
4238
+ S.scrollTo(0, N), c("_events").dispatchEvent(
4235
4239
  new CustomEvent("scrollToRowKeyFound", {
4236
4240
  detail: {
4237
- rowNumber: L,
4241
+ rowNumber: N,
4238
4242
  scrollToRowKey: p,
4239
4243
  selectedRowKey: _
4240
4244
  }
@@ -4362,14 +4366,14 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4362
4366
  onCellEdited: x,
4363
4367
  onColumnMoved: R,
4364
4368
  onColumnProposeMove: O,
4365
- onColumnResize: N,
4369
+ onColumnResize: L,
4366
4370
  onContextClick: w,
4367
4371
  onHeaderClicked: S,
4368
4372
  onHeaderMenuClick: E,
4369
4373
  onItemHovered: D,
4370
- onVisibleRegionChanged: L,
4371
- renderColumns: T,
4372
- rowHeight: M,
4374
+ onVisibleRegionChanged: N,
4375
+ renderColumns: M,
4376
+ rowHeight: F,
4373
4377
  sections: A,
4374
4378
  selectMode: B,
4375
4379
  setState: G,
@@ -4446,7 +4450,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4446
4450
  vn,
4447
4451
  {
4448
4452
  cellActivationBehavior: "double-click",
4449
- columns: T ?? [],
4453
+ columns: M ?? [],
4450
4454
  columnSelect: "none",
4451
4455
  drawFocusRing: !0,
4452
4456
  height: e ?? 400,
@@ -4481,7 +4485,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4481
4485
  onCellEdited: x,
4482
4486
  onColumnMoved: R,
4483
4487
  onColumnProposeMove: O,
4484
- onColumnResize: N,
4488
+ onColumnResize: L,
4485
4489
  onGridSelectionChange: (h) => {
4486
4490
  let b = ne.empty();
4487
4491
  const k = u("_gridSelection"), v = u("keyField") ?? "id", z = u("getRowBuffer");
@@ -4493,7 +4497,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4493
4497
  if (b.length === 0)
4494
4498
  for (const P of k?.rows ?? [])
4495
4499
  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));
4500
+ (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
4501
  },
4498
4502
  onHeaderClicked: S,
4499
4503
  onHeaderContextMenu: (h, b) => {
@@ -4503,14 +4507,14 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4503
4507
  },
4504
4508
  onHeaderMenuClick: E,
4505
4509
  onItemHovered: D,
4506
- onVisibleRegionChanged: L,
4510
+ onVisibleRegionChanged: N,
4507
4511
  ref: Z,
4508
4512
  rightElement: A?.rightElementDisabled ? void 0 : /* @__PURE__ */ d.jsxs(we, { children: [
4509
4513
  A?.rightElementStart,
4510
4514
  /* @__PURE__ */ d.jsx(Pr, {}),
4511
4515
  A?.rightElementEnd
4512
4516
  ] }),
4513
- rowHeight: M ?? 22,
4517
+ rowHeight: F ?? 22,
4514
4518
  rows: J ?? 0,
4515
4519
  theme: q.gridTheme,
4516
4520
  width: n ?? 200