@warkypublic/oranguru 0.0.45 → 0.0.46
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.cjs.js +5 -5
- package/dist/lib.cjs.js.map +1 -1
- package/dist/lib.es.js +215 -211
- package/dist/lib.es.js.map +1 -1
- package/package.json +1 -1
package/dist/lib.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as ye from "react";
|
|
2
|
-
import $, { forwardRef as Be, useMemo as yt, useRef as
|
|
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
|
|
2
|
+
import $, { forwardRef as Be, useMemo as yt, useRef as J, 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 U, 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
|
-
import { produce as
|
|
6
|
+
import { produce as W } from "immer";
|
|
7
7
|
import { IconX as qe, IconExclamationCircle as an, IconDeviceFloppy as ln, IconGrid4x4 as Ie, IconSquarePlus as cn, IconEdit as Je, IconTrashX as Ye, IconExclamationMark as un, IconRefresh as dn, IconMenu2 as fn } from "@tabler/icons-react";
|
|
8
8
|
import { useForm as hn, FormProvider as mn, Controller as he } from "react-hook-form";
|
|
9
9
|
import { newUUID as gn, getUUID as xt } from "@warkypublic/artemis-kit";
|
|
@@ -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 ===
|
|
46
|
+
return h.$$typeof === T ? 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
|
|
59
|
+
case B:
|
|
60
60
|
return "Activity";
|
|
61
61
|
}
|
|
62
62
|
if (typeof h == "object")
|
|
@@ -65,9 +65,9 @@ function Cn() {
|
|
|
65
65
|
), h.$$typeof) {
|
|
66
66
|
case y:
|
|
67
67
|
return "Portal";
|
|
68
|
-
case O:
|
|
69
|
-
return h.displayName || "Context";
|
|
70
68
|
case R:
|
|
69
|
+
return h.displayName || "Context";
|
|
70
|
+
case O:
|
|
71
71
|
return (h._context.displayName || "Context") + ".Consumer";
|
|
72
72
|
case N:
|
|
73
73
|
var b = h.render;
|
|
@@ -115,14 +115,14 @@ function Cn() {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
function n() {
|
|
118
|
-
var h =
|
|
118
|
+
var h = M.A;
|
|
119
119
|
return h === null ? null : h.getOwner();
|
|
120
120
|
}
|
|
121
121
|
function s() {
|
|
122
122
|
return Error("react-stack-top-frame");
|
|
123
123
|
}
|
|
124
124
|
function i(h) {
|
|
125
|
-
if (
|
|
125
|
+
if (j.call(h, "key")) {
|
|
126
126
|
var b = Object.getOwnPropertyDescriptor(h, "key").get;
|
|
127
127
|
if (b && b.isReactWarning) return !1;
|
|
128
128
|
}
|
|
@@ -130,7 +130,7 @@ function Cn() {
|
|
|
130
130
|
}
|
|
131
131
|
function a(h, b) {
|
|
132
132
|
function k() {
|
|
133
|
-
|
|
133
|
+
A || (A = !0, console.error(
|
|
134
134
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
135
135
|
b
|
|
136
136
|
));
|
|
@@ -142,19 +142,19 @@ function Cn() {
|
|
|
142
142
|
}
|
|
143
143
|
function l() {
|
|
144
144
|
var h = r(this.type);
|
|
145
|
-
return
|
|
145
|
+
return q[h] || (q[h] = !0, console.error(
|
|
146
146
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
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
|
|
150
|
+
var F = 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
|
-
}, (
|
|
157
|
+
}, (F !== void 0 ? F : 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
|
|
184
|
-
if (
|
|
183
|
+
var F = b.children;
|
|
184
|
+
if (F !== void 0)
|
|
185
185
|
if (v)
|
|
186
|
-
if (
|
|
187
|
-
for (v = 0; v <
|
|
188
|
-
c(
|
|
189
|
-
Object.freeze && Object.freeze(
|
|
186
|
+
if (G(F)) {
|
|
187
|
+
for (v = 0; v < F.length; v++)
|
|
188
|
+
c(F[v]);
|
|
189
|
+
Object.freeze && Object.freeze(F);
|
|
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(
|
|
195
|
-
if (
|
|
196
|
-
|
|
194
|
+
else c(F);
|
|
195
|
+
if (j.call(b, "key")) {
|
|
196
|
+
F = 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}",
|
|
200
|
+
v = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", H[F + 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
|
-
|
|
208
|
+
F,
|
|
209
209
|
ee,
|
|
210
|
-
|
|
211
|
-
),
|
|
210
|
+
F
|
|
211
|
+
), H[F + v] = !0);
|
|
212
212
|
}
|
|
213
|
-
if (
|
|
213
|
+
if (F = null, k !== void 0 && (e(k), F = "" + k), i(b) && (e(b.key), F = "" + 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
|
|
218
|
+
return F && a(
|
|
219
219
|
k,
|
|
220
220
|
typeof h == "function" ? h.displayName || h.name || "Unknown" : h
|
|
221
221
|
), f(
|
|
222
222
|
h,
|
|
223
|
-
|
|
223
|
+
F,
|
|
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"),
|
|
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"), O = /* @__PURE__ */ Symbol.for("react.consumer"), R = /* @__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"), B = /* @__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, j = Object.prototype.hasOwnProperty, G = Array.isArray, L = console.createTask ? console.createTask : function() {
|
|
237
237
|
return null;
|
|
238
238
|
};
|
|
239
239
|
g = {
|
|
@@ -241,29 +241,29 @@ React keys must be passed directly to JSX without using spread:
|
|
|
241
241
|
return h();
|
|
242
242
|
}
|
|
243
243
|
};
|
|
244
|
-
var
|
|
244
|
+
var A, q = {}, Y = g.react_stack_bottom_frame.bind(
|
|
245
245
|
g,
|
|
246
246
|
s
|
|
247
|
-
)(), Z =
|
|
247
|
+
)(), Z = L(t(s)), H = {};
|
|
248
248
|
de.Fragment = _, de.jsx = function(h, b, k) {
|
|
249
|
-
var v = 1e4 >
|
|
249
|
+
var v = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
250
250
|
return u(
|
|
251
251
|
h,
|
|
252
252
|
b,
|
|
253
253
|
k,
|
|
254
254
|
!1,
|
|
255
255
|
v ? Error("react-stack-top-frame") : Y,
|
|
256
|
-
v ?
|
|
256
|
+
v ? L(t(h)) : Z
|
|
257
257
|
);
|
|
258
258
|
}, de.jsxs = function(h, b, k) {
|
|
259
|
-
var v = 1e4 >
|
|
259
|
+
var v = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
260
260
|
return u(
|
|
261
261
|
h,
|
|
262
262
|
b,
|
|
263
263
|
k,
|
|
264
264
|
!0,
|
|
265
265
|
v ? Error("react-stack-top-frame") : Y,
|
|
266
|
-
v ?
|
|
266
|
+
v ? L(t(h)) : Z
|
|
267
267
|
);
|
|
268
268
|
};
|
|
269
269
|
})()), de;
|
|
@@ -285,8 +285,8 @@ function le(r, o, e) {
|
|
|
285
285
|
t = c;
|
|
286
286
|
let g;
|
|
287
287
|
if (e.key && ((l = e.debug) != null && l.call(e)) && (g = Date.now()), n = o(...c), e.key && ((f = e.debug) != null && f.call(e))) {
|
|
288
|
-
const p = Math.round((Date.now() - u) * 100) / 100, y = Math.round((Date.now() - g) * 100) / 100, _ = y / 16, C = (x,
|
|
289
|
-
for (x = String(x); x.length <
|
|
288
|
+
const p = Math.round((Date.now() - u) * 100) / 100, y = Math.round((Date.now() - g) * 100) / 100, _ = y / 16, C = (x, O) => {
|
|
289
|
+
for (x = String(x); x.length < O; )
|
|
290
290
|
x = " " + x;
|
|
291
291
|
return x;
|
|
292
292
|
};
|
|
@@ -565,18 +565,18 @@ class Mn {
|
|
|
565
565
|
let y, _;
|
|
566
566
|
if (p !== void 0 && this.options.lanes > 1) {
|
|
567
567
|
y = p;
|
|
568
|
-
const
|
|
568
|
+
const R = c[y], N = R !== void 0 ? u[R] : void 0;
|
|
569
569
|
_ = N ? N.end + this.options.gap : t + n;
|
|
570
570
|
} else {
|
|
571
|
-
const
|
|
572
|
-
_ =
|
|
571
|
+
const R = this.options.lanes === 1 ? u[m - 1] : this.getFurthestMeasurement(u, m);
|
|
572
|
+
_ = R ? R.end + this.options.gap : t + n, y = R ? R.lane : m % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(m, y);
|
|
573
573
|
}
|
|
574
|
-
const C = l.get(g), x = typeof C == "number" ? C : this.options.estimateSize(m),
|
|
574
|
+
const C = l.get(g), x = typeof C == "number" ? C : this.options.estimateSize(m), O = _ + x;
|
|
575
575
|
u[m] = {
|
|
576
576
|
index: m,
|
|
577
577
|
start: _,
|
|
578
578
|
size: x,
|
|
579
|
-
end:
|
|
579
|
+
end: O,
|
|
580
580
|
key: g,
|
|
581
581
|
lane: y
|
|
582
582
|
}, c[y] = m;
|
|
@@ -888,7 +888,7 @@ const { Provider: $n, useStore: Nn } = Ce(
|
|
|
888
888
|
search: e
|
|
889
889
|
});
|
|
890
890
|
r(
|
|
891
|
-
|
|
891
|
+
W((a) => {
|
|
892
892
|
t ? (a.boxerData = i.data, a.page = 0) : a.boxerData = [...a.boxerData ?? [], ...i.data], a.total = i.total, a.hasMore = a.boxerData.length < i.total, a.isFetching = !1;
|
|
893
893
|
})
|
|
894
894
|
);
|
|
@@ -910,7 +910,7 @@ const { Provider: $n, useStore: Nn } = Ce(
|
|
|
910
910
|
loadMore: async () => {
|
|
911
911
|
const e = o();
|
|
912
912
|
!e.hasMore || e.isFetching || (r(
|
|
913
|
-
|
|
913
|
+
W((t) => {
|
|
914
914
|
t.page = t.page + 1;
|
|
915
915
|
})
|
|
916
916
|
), await e.fetchData(e.search));
|
|
@@ -936,7 +936,7 @@ const { Provider: $n, useStore: Nn } = Ce(
|
|
|
936
936
|
},
|
|
937
937
|
setState: (e, t) => {
|
|
938
938
|
r(
|
|
939
|
-
|
|
939
|
+
W((n) => {
|
|
940
940
|
n[e] = t;
|
|
941
941
|
})
|
|
942
942
|
);
|
|
@@ -1024,7 +1024,7 @@ const Ln = (r) => {
|
|
|
1024
1024
|
);
|
|
1025
1025
|
}), [o, n, e, t]) };
|
|
1026
1026
|
}, Ot = $.forwardRef((r, o) => {
|
|
1027
|
-
const e =
|
|
1027
|
+
const e = J(null), t = J(null), n = J(null), s = J(null), {
|
|
1028
1028
|
boxerData: i,
|
|
1029
1029
|
clearable: a,
|
|
1030
1030
|
comboBoxProps: l,
|
|
@@ -1038,20 +1038,20 @@ const Ln = (r) => {
|
|
|
1038
1038
|
mah: _,
|
|
1039
1039
|
multiSelect: C,
|
|
1040
1040
|
onBufferChange: x,
|
|
1041
|
-
onChange:
|
|
1042
|
-
opened:
|
|
1041
|
+
onChange: O,
|
|
1042
|
+
opened: R,
|
|
1043
1043
|
openOnClear: N,
|
|
1044
1044
|
placeholder: w,
|
|
1045
1045
|
scrollAreaProps: S,
|
|
1046
1046
|
search: E,
|
|
1047
1047
|
selectedOptionIndex: D,
|
|
1048
|
-
selectFirst:
|
|
1049
|
-
setInput:
|
|
1050
|
-
setOpened:
|
|
1051
|
-
setSearch:
|
|
1052
|
-
setSelectedOptionIndex:
|
|
1053
|
-
showAll:
|
|
1054
|
-
value:
|
|
1048
|
+
selectFirst: B,
|
|
1049
|
+
setInput: T,
|
|
1050
|
+
setOpened: M,
|
|
1051
|
+
setSearch: j,
|
|
1052
|
+
setSelectedOptionIndex: G,
|
|
1053
|
+
showAll: L,
|
|
1054
|
+
value: A
|
|
1055
1055
|
} = Nn((v) => ({
|
|
1056
1056
|
boxerData: v.boxerData,
|
|
1057
1057
|
clearable: v.clearable,
|
|
@@ -1080,86 +1080,86 @@ const Ln = (r) => {
|
|
|
1080
1080
|
setSelectedOptionIndex: v.setSelectedOptionIndex,
|
|
1081
1081
|
showAll: v.showAll,
|
|
1082
1082
|
value: v.value
|
|
1083
|
-
})),
|
|
1084
|
-
count:
|
|
1083
|
+
})), q = i.length, Y = zn({
|
|
1084
|
+
count: q,
|
|
1085
1085
|
estimateSize: () => 36,
|
|
1086
1086
|
getScrollElement: () => e.current
|
|
1087
|
-
}), Z = Y.getVirtualItems(),
|
|
1087
|
+
}), Z = Y.getVirtualItems(), H = oe(
|
|
1088
1088
|
(v) => {
|
|
1089
1089
|
const z = typeof v == "string" ? parseInt(v, 10) : v, P = i[z];
|
|
1090
1090
|
if (P)
|
|
1091
1091
|
if (C) {
|
|
1092
|
-
const
|
|
1093
|
-
|
|
1092
|
+
const F = Array.isArray(A) ? A : [], ie = F.includes(P.value) ? F.filter((Oe) => Oe !== P.value) : [...F, P.value];
|
|
1093
|
+
O?.(ie);
|
|
1094
1094
|
const Ee = i.filter((Oe) => ie.includes(Oe.value));
|
|
1095
1095
|
x?.(Ee);
|
|
1096
1096
|
} else
|
|
1097
|
-
|
|
1097
|
+
O?.(P.value), j(""), T(P.label), n.current = P.value, M(!1);
|
|
1098
1098
|
},
|
|
1099
|
-
[i, C,
|
|
1099
|
+
[i, C, A, O, x, j, T, M]
|
|
1100
1100
|
), h = oe(() => {
|
|
1101
|
-
|
|
1102
|
-
}, [
|
|
1101
|
+
L && B ? H(0) : (O?.(C ? [] : null), j(""), T(""), t.current?.focus()), N && M(!0);
|
|
1102
|
+
}, [L, B, C, O, j, T, N, M, H]), b = Bt({
|
|
1103
1103
|
getOptionId: (v) => String(v),
|
|
1104
1104
|
onDropdownClose: () => {
|
|
1105
|
-
|
|
1105
|
+
M(!1);
|
|
1106
1106
|
},
|
|
1107
1107
|
onDropdownOpen: () => {
|
|
1108
|
-
(!
|
|
1108
|
+
(!A || C && (!Array.isArray(A) || A.length === 0)) && (j(""), T("")), b.selectFirstOption();
|
|
1109
1109
|
},
|
|
1110
|
-
onSelectedOptionSubmit:
|
|
1111
|
-
opened:
|
|
1110
|
+
onSelectedOptionSubmit: H,
|
|
1111
|
+
opened: R,
|
|
1112
1112
|
selectedOptionIndex: D,
|
|
1113
1113
|
setSelectedOptionIndex: (v) => {
|
|
1114
|
-
|
|
1114
|
+
G(v), v !== -1 && Y.scrollToIndex(v);
|
|
1115
1115
|
},
|
|
1116
1116
|
totalOptionsCount: i.length
|
|
1117
1117
|
}), { options: k } = Ln({
|
|
1118
1118
|
boxerData: i,
|
|
1119
1119
|
multiSelect: C,
|
|
1120
|
-
onOptionSubmit:
|
|
1121
|
-
value:
|
|
1120
|
+
onOptionSubmit: H,
|
|
1121
|
+
value: A
|
|
1122
1122
|
});
|
|
1123
1123
|
return I(() => {
|
|
1124
1124
|
c("", !0);
|
|
1125
1125
|
}, []), I(() => {
|
|
1126
1126
|
const v = setTimeout(() => {
|
|
1127
|
-
E !== void 0 &&
|
|
1127
|
+
E !== void 0 && R && c(E, !0);
|
|
1128
1128
|
}, 300);
|
|
1129
1129
|
return () => clearTimeout(v);
|
|
1130
|
-
}, [E,
|
|
1130
|
+
}, [E, R]), I(() => {
|
|
1131
1131
|
if (C) {
|
|
1132
|
-
const v = i.filter((z) => Array.isArray(
|
|
1133
|
-
!
|
|
1132
|
+
const v = i.filter((z) => Array.isArray(A) && A.includes(z.value)).map((z) => z.label).join(", ");
|
|
1133
|
+
!R && g !== v && (T(v), j(""));
|
|
1134
1134
|
} else {
|
|
1135
|
-
const v = i.find((z) => z.value ===
|
|
1136
|
-
g !== v && (E ?? "") === "" && n.current !==
|
|
1135
|
+
const v = i.find((z) => z.value === A)?.label;
|
|
1136
|
+
g !== v && (E ?? "") === "" && n.current !== A && A ? T(v ?? "") : !A && !n.current && (E ?? "") === "" && (j(""), T(""));
|
|
1137
1137
|
}
|
|
1138
1138
|
if (C) {
|
|
1139
|
-
const v = i.filter((z) => Array.isArray(
|
|
1139
|
+
const v = i.filter((z) => Array.isArray(A) && A.includes(z.value)) ?? [];
|
|
1140
1140
|
JSON.stringify(s.current) !== JSON.stringify(v) && (x?.(v), s.current = v);
|
|
1141
1141
|
} else {
|
|
1142
|
-
const v = i?.find((z) => z.value ===
|
|
1142
|
+
const v = i?.find((z) => z.value === A) ?? null;
|
|
1143
1143
|
s.current?.value !== v?.value && (x?.(v), s.current = v);
|
|
1144
1144
|
}
|
|
1145
|
-
}, [
|
|
1146
|
-
|
|
1147
|
-
}, [
|
|
1145
|
+
}, [A, i, g, E, C, R, x, T, j]), I(() => {
|
|
1146
|
+
B && (i?.length ?? 0) > 0 && !C && (A || H?.(0));
|
|
1147
|
+
}, [B, i, C]), Ve(o, () => ({
|
|
1148
1148
|
clear: () => {
|
|
1149
1149
|
h();
|
|
1150
1150
|
},
|
|
1151
1151
|
close: () => {
|
|
1152
|
-
|
|
1152
|
+
M(!1), b.closeDropdown();
|
|
1153
1153
|
},
|
|
1154
1154
|
focus: () => {
|
|
1155
1155
|
t.current?.focus();
|
|
1156
1156
|
},
|
|
1157
|
-
getValue: () =>
|
|
1157
|
+
getValue: () => A,
|
|
1158
1158
|
open: () => {
|
|
1159
|
-
|
|
1159
|
+
M(!0), b.openDropdown();
|
|
1160
1160
|
},
|
|
1161
1161
|
setValue: (v) => {
|
|
1162
|
-
|
|
1162
|
+
O?.(v);
|
|
1163
1163
|
}
|
|
1164
1164
|
})), /* @__PURE__ */ d.jsxs(
|
|
1165
1165
|
te,
|
|
@@ -1178,11 +1178,11 @@ const Ln = (r) => {
|
|
|
1178
1178
|
isFetching: p,
|
|
1179
1179
|
label: y,
|
|
1180
1180
|
onBlur: () => {
|
|
1181
|
-
!
|
|
1181
|
+
!A && !C && (j(""), T(""), b.closeDropdown(), M(!1));
|
|
1182
1182
|
},
|
|
1183
1183
|
onClear: h,
|
|
1184
1184
|
onSearch: (v) => {
|
|
1185
|
-
|
|
1185
|
+
j(v.currentTarget.value), T(v.currentTarget.value), M(!0);
|
|
1186
1186
|
},
|
|
1187
1187
|
placeholder: w,
|
|
1188
1188
|
ref: t,
|
|
@@ -1197,7 +1197,7 @@ const Ln = (r) => {
|
|
|
1197
1197
|
},
|
|
1198
1198
|
p: 2,
|
|
1199
1199
|
...f,
|
|
1200
|
-
children:
|
|
1200
|
+
children: R && k.length > 0 ? /* @__PURE__ */ d.jsx(te.Options, { children: /* @__PURE__ */ d.jsx(
|
|
1201
1201
|
Vt.Autosize,
|
|
1202
1202
|
{
|
|
1203
1203
|
...S,
|
|
@@ -1680,14 +1680,14 @@ const { Provider: qn, useStore: me } = Ce(
|
|
|
1680
1680
|
},
|
|
1681
1681
|
setState: (e, t) => {
|
|
1682
1682
|
r(
|
|
1683
|
-
|
|
1683
|
+
W((n) => {
|
|
1684
1684
|
n[e] = t;
|
|
1685
1685
|
})
|
|
1686
1686
|
);
|
|
1687
1687
|
},
|
|
1688
1688
|
setStateFN: (e, t) => new Promise((s, i) => {
|
|
1689
1689
|
r(
|
|
1690
|
-
|
|
1690
|
+
W((a) => {
|
|
1691
1691
|
if (typeof t == "function")
|
|
1692
1692
|
a[e] = t(a[e]);
|
|
1693
1693
|
else
|
|
@@ -2436,18 +2436,18 @@ function Qn() {
|
|
|
2436
2436
|
function() {
|
|
2437
2437
|
function C(w) {
|
|
2438
2438
|
if (!x) {
|
|
2439
|
-
if (x = !0,
|
|
2439
|
+
if (x = !0, O = w, w = m(w), g !== void 0 && y.hasValue) {
|
|
2440
2440
|
var S = y.value;
|
|
2441
2441
|
if (g(S, w))
|
|
2442
|
-
return
|
|
2442
|
+
return R = S;
|
|
2443
2443
|
}
|
|
2444
|
-
return
|
|
2444
|
+
return R = w;
|
|
2445
2445
|
}
|
|
2446
|
-
if (S =
|
|
2446
|
+
if (S = R, t(O, w)) return S;
|
|
2447
2447
|
var E = m(w);
|
|
2448
|
-
return g !== void 0 && g(S, E) ? (
|
|
2448
|
+
return g !== void 0 && g(S, E) ? (O = w, S) : (O = w, R = E);
|
|
2449
2449
|
}
|
|
2450
|
-
var x = !1,
|
|
2450
|
+
var x = !1, O, R, N = c === void 0 ? null : c;
|
|
2451
2451
|
return [
|
|
2452
2452
|
function() {
|
|
2453
2453
|
return C(u());
|
|
@@ -2487,19 +2487,19 @@ function Zn() {
|
|
|
2487
2487
|
function() {
|
|
2488
2488
|
function C(w) {
|
|
2489
2489
|
if (!x) {
|
|
2490
|
-
if (x = !0,
|
|
2490
|
+
if (x = !0, O = w, w = m(w), g !== void 0 && y.hasValue) {
|
|
2491
2491
|
var S = y.value;
|
|
2492
2492
|
if (g(S, w))
|
|
2493
|
-
return
|
|
2493
|
+
return R = S;
|
|
2494
2494
|
}
|
|
2495
|
-
return
|
|
2495
|
+
return R = w;
|
|
2496
2496
|
}
|
|
2497
|
-
if (S =
|
|
2497
|
+
if (S = R, t(O, w))
|
|
2498
2498
|
return S;
|
|
2499
2499
|
var E = m(w);
|
|
2500
|
-
return g !== void 0 && g(S, E) ? (
|
|
2500
|
+
return g !== void 0 && g(S, E) ? (O = w, S) : (O = w, R = E);
|
|
2501
2501
|
}
|
|
2502
|
-
var x = !1,
|
|
2502
|
+
var x = !1, O, R, N = c === void 0 ? null : c;
|
|
2503
2503
|
return [
|
|
2504
2504
|
function() {
|
|
2505
2505
|
return C(u());
|
|
@@ -2914,7 +2914,7 @@ function Oo({
|
|
|
2914
2914
|
program: a,
|
|
2915
2915
|
throttleMs: l = 0
|
|
2916
2916
|
}) {
|
|
2917
|
-
const f =
|
|
2917
|
+
const f = J(0), u = J(!1), c = J(!1), m = oe(
|
|
2918
2918
|
async (y) => {
|
|
2919
2919
|
const _ = Date.now(), C = _ - f.current;
|
|
2920
2920
|
if (!u.current && !(l > 0 && C < l))
|
|
@@ -3028,7 +3028,7 @@ const { Provider: Cr, useStore: At } = Ce(
|
|
|
3028
3028
|
menus: [],
|
|
3029
3029
|
setInstanceState: (e, t, n) => {
|
|
3030
3030
|
r(
|
|
3031
|
-
|
|
3031
|
+
W((s) => {
|
|
3032
3032
|
const i = s?.menus?.findIndex((a) => a.id === e);
|
|
3033
3033
|
i >= 0 && (s.menus[i][t] = n);
|
|
3034
3034
|
})
|
|
@@ -3036,7 +3036,7 @@ const { Provider: Cr, useStore: At } = Ce(
|
|
|
3036
3036
|
},
|
|
3037
3037
|
setState: (e, t) => {
|
|
3038
3038
|
r(
|
|
3039
|
-
|
|
3039
|
+
W((n) => {
|
|
3040
3040
|
n[e] = t;
|
|
3041
3041
|
})
|
|
3042
3042
|
);
|
|
@@ -3044,7 +3044,7 @@ const { Provider: Cr, useStore: At } = Ce(
|
|
|
3044
3044
|
show: (e, t) => {
|
|
3045
3045
|
const n = o(), s = n.menus.findIndex((a) => a.id === e), i = n.menus[s] ? { ...n.menus[s] } : {};
|
|
3046
3046
|
Object.assign(i, t), i.id = i.id ?? e, i.visible = !(i.visible ?? !1), s < 0 ? n.setState("menus", [...n.menus, i]) : r(
|
|
3047
|
-
|
|
3047
|
+
W((a) => {
|
|
3048
3048
|
a.menus || (a.menus = []), a.menus[s] = { ...a.menus[s], ...i };
|
|
3049
3049
|
})
|
|
3050
3050
|
);
|
|
@@ -3064,7 +3064,7 @@ function Er() {
|
|
|
3064
3064
|
}));
|
|
3065
3065
|
return /* @__PURE__ */ d.jsx(en, { id: `bmm_portal_${o}`, children: $.Children.toArray(
|
|
3066
3066
|
r?.map((n, s) => /* @__PURE__ */ ce(
|
|
3067
|
-
|
|
3067
|
+
U,
|
|
3068
3068
|
{
|
|
3069
3069
|
shadow: "md",
|
|
3070
3070
|
width: t ?? "300",
|
|
@@ -3075,14 +3075,14 @@ function Er() {
|
|
|
3075
3075
|
},
|
|
3076
3076
|
opened: n.visible
|
|
3077
3077
|
},
|
|
3078
|
-
/* @__PURE__ */ d.jsx(
|
|
3078
|
+
/* @__PURE__ */ d.jsx(U.Target, { children: /* @__PURE__ */ d.jsx(
|
|
3079
3079
|
"div",
|
|
3080
3080
|
{
|
|
3081
3081
|
id: `bmm_${o}_${s}_target`,
|
|
3082
3082
|
style: { left: n.x, position: "fixed", top: n.y, visibility: "hidden" }
|
|
3083
3083
|
}
|
|
3084
3084
|
) }),
|
|
3085
|
-
/* @__PURE__ */ d.jsx(
|
|
3085
|
+
/* @__PURE__ */ d.jsx(U.Dropdown, { children: n.renderer ? n.renderer : $.Children.toArray(
|
|
3086
3086
|
n.items?.map((i, a) => /* @__PURE__ */ d.jsx(
|
|
3087
3087
|
Ft,
|
|
3088
3088
|
{
|
|
@@ -3096,9 +3096,9 @@ function Er() {
|
|
|
3096
3096
|
}
|
|
3097
3097
|
const Ft = ({ children: r, label: o, ...e }) => {
|
|
3098
3098
|
const [t, n] = se(!1);
|
|
3099
|
-
return typeof e.renderer == "function" ? e.renderer({ ...e, loading: t, renderer: void 0, setLoading: n }) : typeof e.renderer == "object" ? e.renderer : e.isDivider ? /* @__PURE__ */ d.jsx(
|
|
3100
|
-
/* @__PURE__ */ d.jsx(
|
|
3101
|
-
|
|
3099
|
+
return typeof e.renderer == "function" ? e.renderer({ ...e, loading: t, renderer: void 0, setLoading: n }) : typeof e.renderer == "object" ? e.renderer : e.isDivider ? /* @__PURE__ */ d.jsx(U.Divider, {}) : e.items && e.items.length > 0 ? /* @__PURE__ */ d.jsxs(U.Sub, { children: [
|
|
3100
|
+
/* @__PURE__ */ d.jsx(U.Sub.Target, { children: /* @__PURE__ */ d.jsx(
|
|
3101
|
+
U.Sub.Item,
|
|
3102
3102
|
{
|
|
3103
3103
|
...e,
|
|
3104
3104
|
disabled: t,
|
|
@@ -3115,7 +3115,7 @@ const Ft = ({ children: r, label: o, ...e }) => {
|
|
|
3115
3115
|
children: r ?? o
|
|
3116
3116
|
}
|
|
3117
3117
|
) }),
|
|
3118
|
-
/* @__PURE__ */ d.jsx(
|
|
3118
|
+
/* @__PURE__ */ d.jsx(U.Sub.Dropdown, { children: $.Children.toArray(
|
|
3119
3119
|
e.items.map((s, i) => /* @__PURE__ */ d.jsx(
|
|
3120
3120
|
Ft,
|
|
3121
3121
|
{
|
|
@@ -3124,11 +3124,11 @@ const Ft = ({ children: r, label: o, ...e }) => {
|
|
|
3124
3124
|
`bmm_subitem_${s?.id ?? ""}${i}`
|
|
3125
3125
|
))
|
|
3126
3126
|
) })
|
|
3127
|
-
] }) : !e.onClick && !e.onClickAsync ? /* @__PURE__ */ d.jsxs(
|
|
3127
|
+
] }) : !e.onClick && !e.onClickAsync ? /* @__PURE__ */ d.jsxs(U.Label, { ...e, children: [
|
|
3128
3128
|
" ",
|
|
3129
3129
|
r ?? o
|
|
3130
3130
|
] }) : /* @__PURE__ */ d.jsx(
|
|
3131
|
-
|
|
3131
|
+
U.Item,
|
|
3132
3132
|
{
|
|
3133
3133
|
...e,
|
|
3134
3134
|
disabled: t,
|
|
@@ -3235,7 +3235,7 @@ const Rr = [
|
|
|
3235
3235
|
d="M15 17.5a.5.5 0 0 1-1 0V3.707l-2.146 2.147a.5.5 0 0 1-.708-.708l3-3a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L15 3.707zM2.5 16a.5.5 0 0 1 0-1h9a.5.5 0 0 1 0 1zM5 12.5a.5.5 0 0 0 .5.5h6a.5.5 0 0 0 0-1h-6a.5.5 0 0 0-.5.5M8.5 10a.5.5 0 0 1 0-1h3a.5.5 0 0 1 0 1z"
|
|
3236
3236
|
></path>
|
|
3237
3237
|
</svg>
|
|
3238
|
-
`, ve = (r) => /* @__PURE__ */ d.jsx("img", { alt: r.alt ?? "Sprite Image", src: `data:image/svg+xml;utf8,${r.sprite({ ...r, sprite: void 0 })}` }), { Provider: jr, useStore:
|
|
3238
|
+
`, ve = (r) => /* @__PURE__ */ d.jsx("img", { alt: r.alt ?? "Sprite Image", src: `data:image/svg+xml;utf8,${r.sprite({ ...r, sprite: void 0 })}` }), { Provider: jr, useStore: K } = Ce(
|
|
3239
3239
|
(r, o) => ({
|
|
3240
3240
|
_events: new EventTarget(),
|
|
3241
3241
|
_loadingList: ne.empty(),
|
|
@@ -3249,7 +3249,7 @@ const Rr = [
|
|
|
3249
3249
|
addError: (e, ...t) => {
|
|
3250
3250
|
const n = o();
|
|
3251
3251
|
console.log("Gridler Error", n.uniqueid, e, t), r(
|
|
3252
|
-
|
|
3252
|
+
W((s) => {
|
|
3253
3253
|
s.errors = [...s.errors, e];
|
|
3254
3254
|
})
|
|
3255
3255
|
);
|
|
@@ -3309,6 +3309,8 @@ const Rr = [
|
|
|
3309
3309
|
},
|
|
3310
3310
|
getRowIndexByKey: async (e) => {
|
|
3311
3311
|
const t = o();
|
|
3312
|
+
if (e == null)
|
|
3313
|
+
return;
|
|
3312
3314
|
let n = -1;
|
|
3313
3315
|
if (t.ready) {
|
|
3314
3316
|
const s = t._page_data, i = t.pageSize, a = t.keyField ?? "id";
|
|
@@ -3634,14 +3636,14 @@ const Rr = [
|
|
|
3634
3636
|
},
|
|
3635
3637
|
setState: (e, t) => {
|
|
3636
3638
|
r(
|
|
3637
|
-
|
|
3639
|
+
W((n) => {
|
|
3638
3640
|
n[e] = t;
|
|
3639
3641
|
})
|
|
3640
3642
|
);
|
|
3641
3643
|
},
|
|
3642
3644
|
setStateFN: (e, t) => new Promise((s, i) => {
|
|
3643
3645
|
r(
|
|
3644
|
-
|
|
3646
|
+
W((a) => {
|
|
3645
3647
|
if (typeof t == "function")
|
|
3646
3648
|
a[e] = t(a[e]);
|
|
3647
3649
|
else
|
|
@@ -3708,7 +3710,7 @@ const Rr = [
|
|
|
3708
3710
|
}
|
|
3709
3711
|
);
|
|
3710
3712
|
function Ar(r) {
|
|
3711
|
-
const [o, e, t, n, s] =
|
|
3713
|
+
const [o, e, t, n, s] = K((l) => [
|
|
3712
3714
|
l.setStateFN,
|
|
3713
3715
|
l.setState,
|
|
3714
3716
|
l.getState,
|
|
@@ -3750,19 +3752,19 @@ function Ar(r) {
|
|
|
3750
3752
|
type: "custom-sql-w",
|
|
3751
3753
|
value: r.filter
|
|
3752
3754
|
}), (r.options ?? []).length > 0 && x.push(...r.options ?? []);
|
|
3753
|
-
const
|
|
3754
|
-
if (r.hotfields && r.hotfields.length > 0 &&
|
|
3755
|
+
const O = f?.filter((S) => !S.virtual)?.map((S) => S.id) ?? [];
|
|
3756
|
+
if (r.hotfields && r.hotfields.length > 0 && O?.push(r.hotfields.join(",")), _ && (O.includes(_) || O.push(_)), O && O.length > 0 && x.push({
|
|
3755
3757
|
type: "select-fields",
|
|
3756
|
-
value:
|
|
3758
|
+
value: O.join(",")
|
|
3757
3759
|
}), x && x.length > 0) {
|
|
3758
3760
|
const S = fe(x);
|
|
3759
3761
|
for (const E in fe(x))
|
|
3760
3762
|
C.set(E, S[E]);
|
|
3761
3763
|
}
|
|
3762
|
-
const
|
|
3764
|
+
const R = y?.findIndex((S) => S.page === l) ?? -1;
|
|
3763
3765
|
if (y?.forEach((S) => {
|
|
3764
3766
|
(S.page >= 0 && S.page < l - 2 || l >= 0 && S.page > l + 2) && S.controller?.abort?.();
|
|
3765
|
-
}), y &&
|
|
3767
|
+
}), y && R >= 0 && y[R]) {
|
|
3766
3768
|
e("loadingData", !1);
|
|
3767
3769
|
return;
|
|
3768
3770
|
}
|
|
@@ -3859,7 +3861,7 @@ function Ar(r) {
|
|
|
3859
3861
|
const Fr = $.memo(Ar);
|
|
3860
3862
|
Fr.displayName = "Gridler-GlidlerAPIAdaptorForGoLangv2";
|
|
3861
3863
|
function Tr(r) {
|
|
3862
|
-
const [o, e, t, n] =
|
|
3864
|
+
const [o, e, t, n] = K((i) => [
|
|
3863
3865
|
i.getState,
|
|
3864
3866
|
i.mounted,
|
|
3865
3867
|
i.setState,
|
|
@@ -3963,7 +3965,7 @@ function Tr(r) {
|
|
|
3963
3965
|
}), [r.getMenuItems, e]), /* @__PURE__ */ d.jsx(d.Fragment, {});
|
|
3964
3966
|
}
|
|
3965
3967
|
function Mr(r) {
|
|
3966
|
-
const [o, e, t] =
|
|
3968
|
+
const [o, e, t] = K((u) => [u.setState, u.getState, u.mounted]), { colFilters: n, colSort: s, columns: i, searchStr: a } = K((u) => ({
|
|
3967
3969
|
colFilters: u.colFilters,
|
|
3968
3970
|
colOrder: u.colOrder,
|
|
3969
3971
|
colSize: u.colSize,
|
|
@@ -4000,7 +4002,7 @@ function Mr(r) {
|
|
|
4000
4002
|
const Tt = $.memo(Mr);
|
|
4001
4003
|
Tt.displayName = "Gridler-GlidlerLocalDataAdaptor";
|
|
4002
4004
|
function Pr() {
|
|
4003
|
-
const { loadingData: r, onContextClick: o } =
|
|
4005
|
+
const { loadingData: r, onContextClick: o } = K((e) => ({
|
|
4004
4006
|
loadingData: e.loadingData,
|
|
4005
4007
|
onContextClick: e.onContextClick
|
|
4006
4008
|
}));
|
|
@@ -4017,7 +4019,7 @@ function Pr() {
|
|
|
4017
4019
|
);
|
|
4018
4020
|
}
|
|
4019
4021
|
function Dr(r, o) {
|
|
4020
|
-
const [e, t] =
|
|
4022
|
+
const [e, t] = K((n) => [n.setStateFN, n.getState]);
|
|
4021
4023
|
return Ve(o, () => ({
|
|
4022
4024
|
getGlideRef: () => t("_glideref"),
|
|
4023
4025
|
getState: t,
|
|
@@ -4049,14 +4051,14 @@ function Dr(r, o) {
|
|
|
4049
4051
|
}
|
|
4050
4052
|
const zr = $.forwardRef(Dr);
|
|
4051
4053
|
function $r() {
|
|
4052
|
-
const { _activeTooltip: r, tooltipBarProps: o } =
|
|
4054
|
+
const { _activeTooltip: r, tooltipBarProps: o } = K((e) => ({
|
|
4053
4055
|
_activeTooltip: e._activeTooltip,
|
|
4054
4056
|
tooltipBarProps: e.tooltipBarProps
|
|
4055
4057
|
}));
|
|
4056
4058
|
return /* @__PURE__ */ d.jsx("div", { "data-tooltip-bar": !0, style: { minHeight: "24px" }, ...o, children: r });
|
|
4057
4059
|
}
|
|
4058
4060
|
const Mt = $.memo(() => {
|
|
4059
|
-
const r =
|
|
4061
|
+
const r = J(0), o = J(""), e = J(null), {
|
|
4060
4062
|
_glideref: t,
|
|
4061
4063
|
_gridSelectionRows: n,
|
|
4062
4064
|
colFilters: s,
|
|
@@ -4073,9 +4075,9 @@ const Mt = $.memo(() => {
|
|
|
4073
4075
|
selectedRowKey: _,
|
|
4074
4076
|
selectFirstRowOnMount: C,
|
|
4075
4077
|
setState: x,
|
|
4076
|
-
setStateFN:
|
|
4077
|
-
values:
|
|
4078
|
-
} =
|
|
4078
|
+
setStateFN: O,
|
|
4079
|
+
values: R
|
|
4080
|
+
} = K((w) => ({
|
|
4079
4081
|
_glideref: w._glideref,
|
|
4080
4082
|
_gridSelectionRows: w._gridSelectionRows,
|
|
4081
4083
|
colFilters: w.colFilters,
|
|
@@ -4111,45 +4113,47 @@ const Mt = $.memo(() => {
|
|
|
4111
4113
|
}
|
|
4112
4114
|
);
|
|
4113
4115
|
return I(() => {
|
|
4114
|
-
|
|
4115
|
-
const
|
|
4116
|
-
for (const M in
|
|
4117
|
-
let
|
|
4118
|
-
const
|
|
4119
|
-
typeof
|
|
4116
|
+
R && (async (S) => {
|
|
4117
|
+
const E = c("_page_data"), D = c("pageSize"), B = c("keyField") ?? "id", T = [];
|
|
4118
|
+
for (const M in S) {
|
|
4119
|
+
let j = -1;
|
|
4120
|
+
const G = String(
|
|
4121
|
+
typeof S?.[M] == "object" ? S?.[M]?.[B] : typeof S?.[M] == "string" ? S?.[M] : void 0
|
|
4120
4122
|
);
|
|
4121
|
-
|
|
4122
|
-
for (const
|
|
4123
|
-
const
|
|
4124
|
-
|
|
4125
|
-
|
|
4123
|
+
if (G) {
|
|
4124
|
+
for (const L in E) {
|
|
4125
|
+
for (const A in E[L]) {
|
|
4126
|
+
const q = Number(L) * D + Number(A);
|
|
4127
|
+
if (String(E[L][A]?.[B]) === G) {
|
|
4128
|
+
j = q;
|
|
4129
|
+
break;
|
|
4130
|
+
}
|
|
4131
|
+
}
|
|
4132
|
+
if (j >= 0) {
|
|
4133
|
+
T.push(j);
|
|
4126
4134
|
break;
|
|
4127
4135
|
}
|
|
4128
4136
|
}
|
|
4129
|
-
if (
|
|
4130
|
-
|
|
4131
|
-
|
|
4137
|
+
if (j >= 0)
|
|
4138
|
+
T.push(j);
|
|
4139
|
+
else {
|
|
4140
|
+
const L = await u(G);
|
|
4141
|
+
L !== null && T.push(L);
|
|
4132
4142
|
}
|
|
4133
4143
|
}
|
|
4134
|
-
if (F >= 0)
|
|
4135
|
-
L.push(F);
|
|
4136
|
-
else {
|
|
4137
|
-
const B = await u(A);
|
|
4138
|
-
B !== null && L.push(B);
|
|
4139
|
-
}
|
|
4140
4144
|
}
|
|
4141
|
-
return
|
|
4142
|
-
})().then((S) => {
|
|
4145
|
+
return T;
|
|
4146
|
+
})(R).then((S) => {
|
|
4143
4147
|
let E = ne.empty();
|
|
4144
4148
|
S.forEach((D) => {
|
|
4145
4149
|
D !== void 0 && (E = E.add(D));
|
|
4146
|
-
}),
|
|
4150
|
+
}), O("_gridSelectionRows", () => E), O("_gridSelection", (D) => ({
|
|
4147
4151
|
columns: D?.columns ?? ne.empty(),
|
|
4148
4152
|
...D,
|
|
4149
4153
|
rows: E
|
|
4150
4154
|
}));
|
|
4151
4155
|
});
|
|
4152
|
-
}, [
|
|
4156
|
+
}, [R]), I(() => {
|
|
4153
4157
|
const w = c("onChange");
|
|
4154
4158
|
if (w && typeof w == "function") {
|
|
4155
4159
|
const E = c("getGridSelectedRows")(), D = c("values");
|
|
@@ -4175,7 +4179,7 @@ const Mt = $.memo(() => {
|
|
|
4175
4179
|
columns: ne.empty(),
|
|
4176
4180
|
current: void 0,
|
|
4177
4181
|
rows: ne.empty()
|
|
4178
|
-
}), x("_gridSelectionRows", ne.empty()),
|
|
4182
|
+
}), x("_gridSelectionRows", ne.empty()), O("renderColumns", (w) => w?.map((S) => ({
|
|
4179
4183
|
...S,
|
|
4180
4184
|
icon: S.id && l?.find((E) => E.id === S.id)?.direction ? l?.find((E) => E.id === S.id)?.direction === "asc" ? "sortup" : "sortdown" : S.defaultIcon ?? "sort"
|
|
4181
4185
|
}))).then(() => {
|
|
@@ -4196,14 +4200,14 @@ const Mt = $.memo(() => {
|
|
|
4196
4200
|
);
|
|
4197
4201
|
}), e.current = s);
|
|
4198
4202
|
}, [s]), I(() => {
|
|
4199
|
-
a &&
|
|
4203
|
+
a && O("renderColumns", (w) => w?.map((S) => ({
|
|
4200
4204
|
...S,
|
|
4201
4205
|
width: S.id && a?.[S.id] ? a?.[S.id] : S.width
|
|
4202
4206
|
}))).then(() => {
|
|
4203
4207
|
c("refreshCells")?.();
|
|
4204
4208
|
});
|
|
4205
4209
|
}, [a]), I(() => {
|
|
4206
|
-
i &&
|
|
4210
|
+
i && O("renderColumns", (w) => w?.sort((E, D) => i[E.id] > i[D.id] ? 1 : -1)).then(() => {
|
|
4207
4211
|
c("refreshCells")?.();
|
|
4208
4212
|
});
|
|
4209
4213
|
}, [i]), I(() => {
|
|
@@ -4214,33 +4218,33 @@ const Mt = $.memo(() => {
|
|
|
4214
4218
|
const w = c("_events"), S = () => {
|
|
4215
4219
|
const E = c("selectFirstRowOnMount");
|
|
4216
4220
|
if (c("ready") && E) {
|
|
4217
|
-
const
|
|
4218
|
-
if (
|
|
4221
|
+
const B = c("scrollToRowKey");
|
|
4222
|
+
if (B && B >= 0)
|
|
4219
4223
|
return;
|
|
4220
|
-
const
|
|
4221
|
-
if (!
|
|
4224
|
+
const T = c("keyField") ?? "id", j = c("_page_data")?.[0]?.[0], G = j?.[T] ?? -1, L = c("values") ?? [];
|
|
4225
|
+
if (!j)
|
|
4222
4226
|
return;
|
|
4223
|
-
if (
|
|
4224
|
-
const
|
|
4225
|
-
|
|
4227
|
+
if (G && G > 0 && (L.length ?? 0) === 0) {
|
|
4228
|
+
const A = [j], q = c("onChange");
|
|
4229
|
+
q ? q(A) : x("values", A), x("scrollToRowKey", G);
|
|
4226
4230
|
}
|
|
4227
4231
|
}
|
|
4228
4232
|
};
|
|
4229
4233
|
return w?.addEventListener("loadPage", S), () => {
|
|
4230
4234
|
w?.removeEventListener("loadPage", S);
|
|
4231
4235
|
};
|
|
4232
|
-
}, [g, C,
|
|
4236
|
+
}, [g, C, R]), I(() => {
|
|
4233
4237
|
const w = c("ready"), S = c("_glideref"), E = c("getRowIndexByKey"), D = _ ?? p;
|
|
4234
|
-
D && S && w && E?.(D).then((
|
|
4235
|
-
if (
|
|
4238
|
+
D && S && w && E?.(D).then((B) => {
|
|
4239
|
+
if (B !== void 0) {
|
|
4236
4240
|
if (_) {
|
|
4237
|
-
const
|
|
4238
|
-
JSON.stringify(c("values")) !== JSON.stringify(
|
|
4241
|
+
const T = c("onChange"), M = [{ [c("keyField") ?? "id"]: _ }];
|
|
4242
|
+
JSON.stringify(c("values")) !== JSON.stringify(M) && (T ? T(M) : x("values", M));
|
|
4239
4243
|
}
|
|
4240
|
-
S.scrollTo(0,
|
|
4244
|
+
S.scrollTo(0, B), c("_events").dispatchEvent(
|
|
4241
4245
|
new CustomEvent("scrollToRowKeyFound", {
|
|
4242
4246
|
detail: {
|
|
4243
|
-
rowNumber:
|
|
4247
|
+
rowNumber: B,
|
|
4244
4248
|
scrollToRowKey: p,
|
|
4245
4249
|
selectedRowKey: _
|
|
4246
4250
|
}
|
|
@@ -4275,7 +4279,7 @@ const Pt = $.memo(() => {
|
|
|
4275
4279
|
s,
|
|
4276
4280
|
i,
|
|
4277
4281
|
a
|
|
4278
|
-
] =
|
|
4282
|
+
] = K((l) => [
|
|
4279
4283
|
l.setState,
|
|
4280
4284
|
l.getState,
|
|
4281
4285
|
l._glideref,
|
|
@@ -4310,7 +4314,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
|
|
|
4310
4314
|
}, Gr = (r) => (o) => o % 2 === 0 ? void 0 : {
|
|
4311
4315
|
bgCell: r === "dark" ? "#303030" : "#e1effc"
|
|
4312
4316
|
}, qr = () => {
|
|
4313
|
-
const r = nn(), { colorScheme: o } = rn(), { enableOddEvenRowColor: e, focused: t } =
|
|
4317
|
+
const r = nn(), { colorScheme: o } = rn(), { enableOddEvenRowColor: e, focused: t } = K((c) => ({
|
|
4314
4318
|
enableOddEvenRowColor: c.enableOddEvenRowColor,
|
|
4315
4319
|
focused: c.focused
|
|
4316
4320
|
})), n = {
|
|
@@ -4366,23 +4370,23 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
|
|
|
4366
4370
|
onCellActivated: _,
|
|
4367
4371
|
onCellClicked: C,
|
|
4368
4372
|
onCellEdited: x,
|
|
4369
|
-
onColumnMoved:
|
|
4370
|
-
onColumnProposeMove:
|
|
4373
|
+
onColumnMoved: O,
|
|
4374
|
+
onColumnProposeMove: R,
|
|
4371
4375
|
onColumnResize: N,
|
|
4372
4376
|
onContextClick: w,
|
|
4373
4377
|
onHeaderClicked: S,
|
|
4374
4378
|
onHeaderMenuClick: E,
|
|
4375
4379
|
onItemHovered: D,
|
|
4376
|
-
onVisibleRegionChanged:
|
|
4377
|
-
renderColumns:
|
|
4378
|
-
rowHeight:
|
|
4379
|
-
sections:
|
|
4380
|
-
selectMode:
|
|
4381
|
-
setState:
|
|
4382
|
-
setStateFN:
|
|
4383
|
-
total_rows:
|
|
4380
|
+
onVisibleRegionChanged: B,
|
|
4381
|
+
renderColumns: T,
|
|
4382
|
+
rowHeight: M,
|
|
4383
|
+
sections: j,
|
|
4384
|
+
selectMode: G,
|
|
4385
|
+
setState: L,
|
|
4386
|
+
setStateFN: A,
|
|
4387
|
+
total_rows: q,
|
|
4384
4388
|
widthProp: Y
|
|
4385
|
-
} =
|
|
4389
|
+
} = K((h) => ({
|
|
4386
4390
|
_gridSelection: h._gridSelection,
|
|
4387
4391
|
allowMultiSelect: h.allowMultiSelect,
|
|
4388
4392
|
focused: h.focused,
|
|
@@ -4414,10 +4418,10 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
|
|
|
4414
4418
|
total_rows: h.total_rows,
|
|
4415
4419
|
widthProp: h.width
|
|
4416
4420
|
})), Z = bn(r, (h) => {
|
|
4417
|
-
|
|
4421
|
+
A("_glideref", () => h ?? void 0);
|
|
4418
4422
|
const b = u("ready"), k = !!(h && y);
|
|
4419
|
-
b !== k &&
|
|
4420
|
-
}),
|
|
4423
|
+
b !== k && L("ready", k);
|
|
4424
|
+
}), H = qr();
|
|
4421
4425
|
return /* @__PURE__ */ d.jsxs(
|
|
4422
4426
|
bt,
|
|
4423
4427
|
{
|
|
@@ -4427,7 +4431,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
|
|
|
4427
4431
|
justify: "stretch",
|
|
4428
4432
|
w: Y ?? "100%",
|
|
4429
4433
|
children: [
|
|
4430
|
-
|
|
4434
|
+
j?.top,
|
|
4431
4435
|
/* @__PURE__ */ d.jsxs(
|
|
4432
4436
|
"div",
|
|
4433
4437
|
{
|
|
@@ -4447,12 +4451,12 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
|
|
|
4447
4451
|
width: "100%"
|
|
4448
4452
|
},
|
|
4449
4453
|
children: [
|
|
4450
|
-
|
|
4454
|
+
j?.left,
|
|
4451
4455
|
n && n > 0 && e && e > 0 && /* @__PURE__ */ d.jsx(
|
|
4452
4456
|
vn,
|
|
4453
4457
|
{
|
|
4454
4458
|
cellActivationBehavior: "double-click",
|
|
4455
|
-
columns:
|
|
4459
|
+
columns: T ?? [],
|
|
4456
4460
|
columnSelect: "none",
|
|
4457
4461
|
drawFocusRing: !0,
|
|
4458
4462
|
height: e ?? 400,
|
|
@@ -4473,7 +4477,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
|
|
|
4473
4477
|
...c,
|
|
4474
4478
|
getCellContent: l,
|
|
4475
4479
|
getCellsForSelection: f,
|
|
4476
|
-
getRowThemeOverride:
|
|
4480
|
+
getRowThemeOverride: H.getRowThemeOverride,
|
|
4477
4481
|
gridSelection: s,
|
|
4478
4482
|
headerHeight: g ?? 32,
|
|
4479
4483
|
headerIcons: { sort: Lr, sortdown: Ne, sortup: Le },
|
|
@@ -4485,21 +4489,21 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
|
|
|
4485
4489
|
}, 100));
|
|
4486
4490
|
},
|
|
4487
4491
|
onCellEdited: x,
|
|
4488
|
-
onColumnMoved:
|
|
4489
|
-
onColumnProposeMove:
|
|
4492
|
+
onColumnMoved: O,
|
|
4493
|
+
onColumnProposeMove: R,
|
|
4490
4494
|
onColumnResize: N,
|
|
4491
4495
|
onGridSelectionChange: (h) => {
|
|
4492
4496
|
let b = ne.empty();
|
|
4493
4497
|
const k = u("_gridSelection"), v = u("keyField") ?? "id", z = u("getRowBuffer");
|
|
4494
4498
|
for (const P of h.rows)
|
|
4495
4499
|
z && z(P)?.[v] && (b = b.hasIndex(P) ? b : b.add(P));
|
|
4496
|
-
if (
|
|
4500
|
+
if (G === "row" && h.current?.range)
|
|
4497
4501
|
for (let P = h.current.range.y; P < h.current.range.y + h.current.range.height; P++)
|
|
4498
4502
|
z && z(P)?.[v] && (b = b.hasIndex(P) ? b : b.add(P));
|
|
4499
4503
|
if (b.length === 0)
|
|
4500
4504
|
for (const P of k?.rows ?? [])
|
|
4501
4505
|
z && z(P)?.[v] && (b = b.hasIndex(P) ? b : b.add(P));
|
|
4502
|
-
(JSON.stringify(k?.columns) !== JSON.stringify(h.columns) || JSON.stringify(k?.rows) !== JSON.stringify(b) || JSON.stringify(k?.current) !== JSON.stringify(h.current)) && (
|
|
4506
|
+
(JSON.stringify(k?.columns) !== JSON.stringify(h.columns) || JSON.stringify(k?.rows) !== JSON.stringify(b) || JSON.stringify(k?.current) !== JSON.stringify(h.current)) && (L("_gridSelection", { ...h, rows: b }), L("_gridSelectionRows", b));
|
|
4503
4507
|
},
|
|
4504
4508
|
onHeaderClicked: S,
|
|
4505
4509
|
onHeaderContextMenu: (h, b) => {
|
|
@@ -4509,28 +4513,28 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
|
|
|
4509
4513
|
},
|
|
4510
4514
|
onHeaderMenuClick: E,
|
|
4511
4515
|
onItemHovered: D,
|
|
4512
|
-
onVisibleRegionChanged:
|
|
4516
|
+
onVisibleRegionChanged: B,
|
|
4513
4517
|
ref: Z,
|
|
4514
|
-
rightElement:
|
|
4515
|
-
|
|
4518
|
+
rightElement: j?.rightElementDisabled ? void 0 : /* @__PURE__ */ d.jsxs(we, { children: [
|
|
4519
|
+
j?.rightElementStart,
|
|
4516
4520
|
/* @__PURE__ */ d.jsx(Pr, {}),
|
|
4517
|
-
|
|
4521
|
+
j?.rightElementEnd
|
|
4518
4522
|
] }),
|
|
4519
|
-
rowHeight:
|
|
4520
|
-
rows:
|
|
4521
|
-
theme:
|
|
4523
|
+
rowHeight: M ?? 22,
|
|
4524
|
+
rows: q ?? 0,
|
|
4525
|
+
theme: H.gridTheme,
|
|
4522
4526
|
width: n ?? 200
|
|
4523
4527
|
}
|
|
4524
4528
|
),
|
|
4525
4529
|
/* @__PURE__ */ d.jsx(Mt, {}),
|
|
4526
4530
|
!m && /* @__PURE__ */ d.jsx(Pt, {}),
|
|
4527
|
-
|
|
4531
|
+
j?.right
|
|
4528
4532
|
]
|
|
4529
4533
|
}
|
|
4530
4534
|
),
|
|
4531
4535
|
/* @__PURE__ */ d.jsxs("div", { style: { flexGrow: 0 }, children: [
|
|
4532
4536
|
/* @__PURE__ */ d.jsx($r, {}),
|
|
4533
|
-
|
|
4537
|
+
j?.bottom
|
|
4534
4538
|
] })
|
|
4535
4539
|
]
|
|
4536
4540
|
}
|
|
@@ -4596,7 +4600,7 @@ export {
|
|
|
4596
4600
|
fo as useFormerState,
|
|
4597
4601
|
wo as useGlobalStateStore,
|
|
4598
4602
|
Ro as useGlobalStateStoreContext,
|
|
4599
|
-
|
|
4603
|
+
K as useGridlerStore,
|
|
4600
4604
|
At as useMantineBetterMenus
|
|
4601
4605
|
};
|
|
4602
4606
|
//# sourceMappingURL=lib.es.js.map
|