wg-design 0.7.2 → 0.8.1
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/index.cjs +5 -5
- package/dist/index.mjs +1220 -475
- package/dist/src/components/Slider/slider.d.ts +4 -0
- package/dist/src/components/Textarea/textarea.d.ts +3 -0
- package/dist/src/components/WgDesignProvider/WgDesignProvider.d.ts +57 -0
- package/dist/src/components/index.d.ts +3 -0
- package/dist/wg-design.css +1 -1
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -19036,27 +19036,722 @@ function AS({ className: e, ...t }) {
|
|
|
19036
19036
|
});
|
|
19037
19037
|
}
|
|
19038
19038
|
//#endregion
|
|
19039
|
+
//#region node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
19040
|
+
function jS(e, t) {
|
|
19041
|
+
if (typeof e == "function") return e(t);
|
|
19042
|
+
e != null && (e.current = t);
|
|
19043
|
+
}
|
|
19044
|
+
function MS(...e) {
|
|
19045
|
+
return (t) => {
|
|
19046
|
+
let n = !1, r = e.map((e) => {
|
|
19047
|
+
let r = jS(e, t);
|
|
19048
|
+
return !n && typeof r == "function" && (n = !0), r;
|
|
19049
|
+
});
|
|
19050
|
+
if (n) return () => {
|
|
19051
|
+
for (let t = 0; t < r.length; t++) {
|
|
19052
|
+
let n = r[t];
|
|
19053
|
+
typeof n == "function" ? n() : jS(e[t], null);
|
|
19054
|
+
}
|
|
19055
|
+
};
|
|
19056
|
+
};
|
|
19057
|
+
}
|
|
19058
|
+
function NS(...e) {
|
|
19059
|
+
return p.useCallback(MS(...e), e);
|
|
19060
|
+
}
|
|
19061
|
+
//#endregion
|
|
19062
|
+
//#region node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
19063
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
19064
|
+
function PS(e) {
|
|
19065
|
+
let t = /* @__PURE__ */ FS(e), n = p.forwardRef((e, n) => {
|
|
19066
|
+
let { children: r, ...i } = e, a = p.Children.toArray(r), o = a.find(LS);
|
|
19067
|
+
if (o) {
|
|
19068
|
+
let e = o.props.children, r = a.map((t) => t === o ? p.Children.count(e) > 1 ? p.Children.only(null) : p.isValidElement(e) ? e.props.children : null : t);
|
|
19069
|
+
return /* @__PURE__ */ D(t, {
|
|
19070
|
+
...i,
|
|
19071
|
+
ref: n,
|
|
19072
|
+
children: p.isValidElement(e) ? p.cloneElement(e, void 0, r) : null
|
|
19073
|
+
});
|
|
19074
|
+
}
|
|
19075
|
+
return /* @__PURE__ */ D(t, {
|
|
19076
|
+
...i,
|
|
19077
|
+
ref: n,
|
|
19078
|
+
children: r
|
|
19079
|
+
});
|
|
19080
|
+
});
|
|
19081
|
+
return n.displayName = `${e}.Slot`, n;
|
|
19082
|
+
}
|
|
19083
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
19084
|
+
function FS(e) {
|
|
19085
|
+
let t = p.forwardRef((e, t) => {
|
|
19086
|
+
let { children: n, ...r } = e;
|
|
19087
|
+
if (p.isValidElement(n)) {
|
|
19088
|
+
let e = zS(n), i = RS(r, n.props);
|
|
19089
|
+
return n.type !== p.Fragment && (i.ref = t ? MS(t, e) : e), p.cloneElement(n, i);
|
|
19090
|
+
}
|
|
19091
|
+
return p.Children.count(n) > 1 ? p.Children.only(null) : null;
|
|
19092
|
+
});
|
|
19093
|
+
return t.displayName = `${e}.SlotClone`, t;
|
|
19094
|
+
}
|
|
19095
|
+
var IS = Symbol("radix.slottable");
|
|
19096
|
+
function LS(e) {
|
|
19097
|
+
return p.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === IS;
|
|
19098
|
+
}
|
|
19099
|
+
function RS(e, t) {
|
|
19100
|
+
let n = { ...t };
|
|
19101
|
+
for (let r in t) {
|
|
19102
|
+
let i = e[r], a = t[r];
|
|
19103
|
+
/^on[A-Z]/.test(r) ? i && a ? n[r] = (...e) => {
|
|
19104
|
+
let t = a(...e);
|
|
19105
|
+
return i(...e), t;
|
|
19106
|
+
} : i && (n[r] = i) : r === "style" ? n[r] = {
|
|
19107
|
+
...i,
|
|
19108
|
+
...a
|
|
19109
|
+
} : r === "className" && (n[r] = [i, a].filter(Boolean).join(" "));
|
|
19110
|
+
}
|
|
19111
|
+
return {
|
|
19112
|
+
...e,
|
|
19113
|
+
...n
|
|
19114
|
+
};
|
|
19115
|
+
}
|
|
19116
|
+
function zS(e) {
|
|
19117
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
19118
|
+
return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
19119
|
+
}
|
|
19120
|
+
//#endregion
|
|
19121
|
+
//#region node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
19122
|
+
var BS = [
|
|
19123
|
+
"a",
|
|
19124
|
+
"button",
|
|
19125
|
+
"div",
|
|
19126
|
+
"form",
|
|
19127
|
+
"h2",
|
|
19128
|
+
"h3",
|
|
19129
|
+
"img",
|
|
19130
|
+
"input",
|
|
19131
|
+
"label",
|
|
19132
|
+
"li",
|
|
19133
|
+
"nav",
|
|
19134
|
+
"ol",
|
|
19135
|
+
"p",
|
|
19136
|
+
"select",
|
|
19137
|
+
"span",
|
|
19138
|
+
"svg",
|
|
19139
|
+
"ul"
|
|
19140
|
+
].reduce((e, t) => {
|
|
19141
|
+
let n = /* @__PURE__ */ PS(`Primitive.${t}`), r = p.forwardRef((e, r) => {
|
|
19142
|
+
let { asChild: i, ...a } = e, o = i ? n : t;
|
|
19143
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ D(o, {
|
|
19144
|
+
...a,
|
|
19145
|
+
ref: r
|
|
19146
|
+
});
|
|
19147
|
+
});
|
|
19148
|
+
return r.displayName = `Primitive.${t}`, {
|
|
19149
|
+
...e,
|
|
19150
|
+
[t]: r
|
|
19151
|
+
};
|
|
19152
|
+
}, {});
|
|
19153
|
+
//#endregion
|
|
19154
|
+
//#region node_modules/@radix-ui/react-context/dist/index.mjs
|
|
19155
|
+
function VS(e, t = []) {
|
|
19156
|
+
let n = [];
|
|
19157
|
+
function r(t, r) {
|
|
19158
|
+
let i = p.createContext(r), a = n.length;
|
|
19159
|
+
n = [...n, r];
|
|
19160
|
+
let o = (t) => {
|
|
19161
|
+
let { scope: n, children: r, ...o } = t, s = n?.[e]?.[a] || i, c = p.useMemo(() => o, Object.values(o));
|
|
19162
|
+
return /* @__PURE__ */ D(s.Provider, {
|
|
19163
|
+
value: c,
|
|
19164
|
+
children: r
|
|
19165
|
+
});
|
|
19166
|
+
};
|
|
19167
|
+
o.displayName = t + "Provider";
|
|
19168
|
+
function s(n, o) {
|
|
19169
|
+
let s = o?.[e]?.[a] || i, c = p.useContext(s);
|
|
19170
|
+
if (c) return c;
|
|
19171
|
+
if (r !== void 0) return r;
|
|
19172
|
+
throw Error(`\`${n}\` must be used within \`${t}\``);
|
|
19173
|
+
}
|
|
19174
|
+
return [o, s];
|
|
19175
|
+
}
|
|
19176
|
+
let i = () => {
|
|
19177
|
+
let t = n.map((e) => p.createContext(e));
|
|
19178
|
+
return function(n) {
|
|
19179
|
+
let r = n?.[e] || t;
|
|
19180
|
+
return p.useMemo(() => ({ [`__scope${e}`]: {
|
|
19181
|
+
...n,
|
|
19182
|
+
[e]: r
|
|
19183
|
+
} }), [n, r]);
|
|
19184
|
+
};
|
|
19185
|
+
};
|
|
19186
|
+
return i.scopeName = e, [r, HS(i, ...t)];
|
|
19187
|
+
}
|
|
19188
|
+
function HS(...e) {
|
|
19189
|
+
let t = e[0];
|
|
19190
|
+
if (e.length === 1) return t;
|
|
19191
|
+
let n = () => {
|
|
19192
|
+
let n = e.map((e) => ({
|
|
19193
|
+
useScope: e(),
|
|
19194
|
+
scopeName: e.scopeName
|
|
19195
|
+
}));
|
|
19196
|
+
return function(e) {
|
|
19197
|
+
let r = n.reduce((t, { useScope: n, scopeName: r }) => {
|
|
19198
|
+
let i = n(e)[`__scope${r}`];
|
|
19199
|
+
return {
|
|
19200
|
+
...t,
|
|
19201
|
+
...i
|
|
19202
|
+
};
|
|
19203
|
+
}, {});
|
|
19204
|
+
return p.useMemo(() => ({ [`__scope${t.scopeName}`]: r }), [r]);
|
|
19205
|
+
};
|
|
19206
|
+
};
|
|
19207
|
+
return n.scopeName = t.scopeName, n;
|
|
19208
|
+
}
|
|
19209
|
+
//#endregion
|
|
19210
|
+
//#region node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
19211
|
+
function US(e) {
|
|
19212
|
+
let t = e + "CollectionProvider", [n, r] = VS(t), [i, a] = n(t, {
|
|
19213
|
+
collectionRef: { current: null },
|
|
19214
|
+
itemMap: /* @__PURE__ */ new Map()
|
|
19215
|
+
}), o = (e) => {
|
|
19216
|
+
let { scope: t, children: n } = e, r = m.useRef(null), a = m.useRef(/* @__PURE__ */ new Map()).current;
|
|
19217
|
+
return /* @__PURE__ */ D(i, {
|
|
19218
|
+
scope: t,
|
|
19219
|
+
itemMap: a,
|
|
19220
|
+
collectionRef: r,
|
|
19221
|
+
children: n
|
|
19222
|
+
});
|
|
19223
|
+
};
|
|
19224
|
+
o.displayName = t;
|
|
19225
|
+
let s = e + "CollectionSlot", c = /* @__PURE__ */ PS(s), l = m.forwardRef((e, t) => {
|
|
19226
|
+
let { scope: n, children: r } = e;
|
|
19227
|
+
return /* @__PURE__ */ D(c, {
|
|
19228
|
+
ref: NS(t, a(s, n).collectionRef),
|
|
19229
|
+
children: r
|
|
19230
|
+
});
|
|
19231
|
+
});
|
|
19232
|
+
l.displayName = s;
|
|
19233
|
+
let u = e + "CollectionItemSlot", d = "data-radix-collection-item", f = /* @__PURE__ */ PS(u), p = m.forwardRef((e, t) => {
|
|
19234
|
+
let { scope: n, children: r, ...i } = e, o = m.useRef(null), s = NS(t, o), c = a(u, n);
|
|
19235
|
+
return m.useEffect(() => (c.itemMap.set(o, {
|
|
19236
|
+
ref: o,
|
|
19237
|
+
...i
|
|
19238
|
+
}), () => void c.itemMap.delete(o))), /* @__PURE__ */ D(f, {
|
|
19239
|
+
[d]: "",
|
|
19240
|
+
ref: s,
|
|
19241
|
+
children: r
|
|
19242
|
+
});
|
|
19243
|
+
});
|
|
19244
|
+
p.displayName = u;
|
|
19245
|
+
function h(t) {
|
|
19246
|
+
let n = a(e + "CollectionConsumer", t);
|
|
19247
|
+
return m.useCallback(() => {
|
|
19248
|
+
let e = n.collectionRef.current;
|
|
19249
|
+
if (!e) return [];
|
|
19250
|
+
let t = Array.from(e.querySelectorAll(`[${d}]`));
|
|
19251
|
+
return Array.from(n.itemMap.values()).sort((e, n) => t.indexOf(e.ref.current) - t.indexOf(n.ref.current));
|
|
19252
|
+
}, [n.collectionRef, n.itemMap]);
|
|
19253
|
+
}
|
|
19254
|
+
return [
|
|
19255
|
+
{
|
|
19256
|
+
Provider: o,
|
|
19257
|
+
Slot: l,
|
|
19258
|
+
ItemSlot: p
|
|
19259
|
+
},
|
|
19260
|
+
h,
|
|
19261
|
+
r
|
|
19262
|
+
];
|
|
19263
|
+
}
|
|
19264
|
+
typeof window < "u" && window.document && window.document.createElement;
|
|
19265
|
+
function WS(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
19266
|
+
return function(r) {
|
|
19267
|
+
if (e?.(r), n === !1 || !r.defaultPrevented) return t?.(r);
|
|
19268
|
+
};
|
|
19269
|
+
}
|
|
19270
|
+
//#endregion
|
|
19271
|
+
//#region node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
19272
|
+
var GS = globalThis?.document ? p.useLayoutEffect : () => {}, KS = p.useInsertionEffect || GS;
|
|
19273
|
+
function qS({ prop: e, defaultProp: t, onChange: n = () => {}, caller: r }) {
|
|
19274
|
+
let [i, a, o] = JS({
|
|
19275
|
+
defaultProp: t,
|
|
19276
|
+
onChange: n
|
|
19277
|
+
}), s = e !== void 0, c = s ? e : i;
|
|
19278
|
+
{
|
|
19279
|
+
let t = p.useRef(e !== void 0);
|
|
19280
|
+
p.useEffect(() => {
|
|
19281
|
+
let e = t.current;
|
|
19282
|
+
e !== s && console.warn(`${r} is changing from ${e ? "controlled" : "uncontrolled"} to ${s ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`), t.current = s;
|
|
19283
|
+
}, [s, r]);
|
|
19284
|
+
}
|
|
19285
|
+
return [c, p.useCallback((t) => {
|
|
19286
|
+
if (s) {
|
|
19287
|
+
let n = YS(t) ? t(e) : t;
|
|
19288
|
+
n !== e && o.current?.(n);
|
|
19289
|
+
} else a(t);
|
|
19290
|
+
}, [
|
|
19291
|
+
s,
|
|
19292
|
+
e,
|
|
19293
|
+
a,
|
|
19294
|
+
o
|
|
19295
|
+
])];
|
|
19296
|
+
}
|
|
19297
|
+
function JS({ defaultProp: e, onChange: t }) {
|
|
19298
|
+
let [n, r] = p.useState(e), i = p.useRef(n), a = p.useRef(t);
|
|
19299
|
+
return KS(() => {
|
|
19300
|
+
a.current = t;
|
|
19301
|
+
}, [t]), p.useEffect(() => {
|
|
19302
|
+
i.current !== n && (a.current?.(n), i.current = n);
|
|
19303
|
+
}, [n, i]), [
|
|
19304
|
+
n,
|
|
19305
|
+
r,
|
|
19306
|
+
a
|
|
19307
|
+
];
|
|
19308
|
+
}
|
|
19309
|
+
function YS(e) {
|
|
19310
|
+
return typeof e == "function";
|
|
19311
|
+
}
|
|
19312
|
+
//#endregion
|
|
19313
|
+
//#region node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
19314
|
+
var XS = p.createContext(void 0);
|
|
19315
|
+
function ZS(e) {
|
|
19316
|
+
let t = p.useContext(XS);
|
|
19317
|
+
return e || t || "ltr";
|
|
19318
|
+
}
|
|
19319
|
+
//#endregion
|
|
19320
|
+
//#region node_modules/@radix-ui/react-use-previous/dist/index.mjs
|
|
19321
|
+
function QS(e) {
|
|
19322
|
+
let t = p.useRef({
|
|
19323
|
+
value: e,
|
|
19324
|
+
previous: e
|
|
19325
|
+
});
|
|
19326
|
+
return p.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
|
|
19327
|
+
}
|
|
19328
|
+
//#endregion
|
|
19329
|
+
//#region node_modules/@radix-ui/react-use-size/dist/index.mjs
|
|
19330
|
+
function $S(e) {
|
|
19331
|
+
let [t, n] = p.useState(void 0);
|
|
19332
|
+
return GS(() => {
|
|
19333
|
+
if (e) {
|
|
19334
|
+
n({
|
|
19335
|
+
width: e.offsetWidth,
|
|
19336
|
+
height: e.offsetHeight
|
|
19337
|
+
});
|
|
19338
|
+
let t = new ResizeObserver((t) => {
|
|
19339
|
+
if (!Array.isArray(t) || !t.length) return;
|
|
19340
|
+
let r = t[0], i, a;
|
|
19341
|
+
if ("borderBoxSize" in r) {
|
|
19342
|
+
let e = r.borderBoxSize, t = Array.isArray(e) ? e[0] : e;
|
|
19343
|
+
i = t.inlineSize, a = t.blockSize;
|
|
19344
|
+
} else i = e.offsetWidth, a = e.offsetHeight;
|
|
19345
|
+
n({
|
|
19346
|
+
width: i,
|
|
19347
|
+
height: a
|
|
19348
|
+
});
|
|
19349
|
+
});
|
|
19350
|
+
return t.observe(e, { box: "border-box" }), () => t.unobserve(e);
|
|
19351
|
+
} else n(void 0);
|
|
19352
|
+
}, [e]), t;
|
|
19353
|
+
}
|
|
19354
|
+
//#endregion
|
|
19355
|
+
//#region node_modules/@radix-ui/number/dist/index.mjs
|
|
19356
|
+
function eC(e, [t, n]) {
|
|
19357
|
+
return Math.min(n, Math.max(t, e));
|
|
19358
|
+
}
|
|
19359
|
+
//#endregion
|
|
19360
|
+
//#region node_modules/@radix-ui/react-slider/dist/index.mjs
|
|
19361
|
+
var tC = ["PageUp", "PageDown"], nC = [
|
|
19362
|
+
"ArrowUp",
|
|
19363
|
+
"ArrowDown",
|
|
19364
|
+
"ArrowLeft",
|
|
19365
|
+
"ArrowRight"
|
|
19366
|
+
], rC = {
|
|
19367
|
+
"from-left": [
|
|
19368
|
+
"Home",
|
|
19369
|
+
"PageDown",
|
|
19370
|
+
"ArrowDown",
|
|
19371
|
+
"ArrowLeft"
|
|
19372
|
+
],
|
|
19373
|
+
"from-right": [
|
|
19374
|
+
"Home",
|
|
19375
|
+
"PageDown",
|
|
19376
|
+
"ArrowDown",
|
|
19377
|
+
"ArrowRight"
|
|
19378
|
+
],
|
|
19379
|
+
"from-bottom": [
|
|
19380
|
+
"Home",
|
|
19381
|
+
"PageDown",
|
|
19382
|
+
"ArrowDown",
|
|
19383
|
+
"ArrowLeft"
|
|
19384
|
+
],
|
|
19385
|
+
"from-top": [
|
|
19386
|
+
"Home",
|
|
19387
|
+
"PageDown",
|
|
19388
|
+
"ArrowUp",
|
|
19389
|
+
"ArrowLeft"
|
|
19390
|
+
]
|
|
19391
|
+
}, iC = "Slider", [aC, oC, sC] = US(iC), [cC, lC] = VS(iC, [sC]), [uC, dC] = cC(iC), fC = p.forwardRef((e, t) => {
|
|
19392
|
+
let { name: n, min: r = 0, max: i = 100, step: a = 1, orientation: o = "horizontal", disabled: s = !1, minStepsBetweenThumbs: c = 0, defaultValue: l = [r], value: u, onValueChange: d = () => {}, onValueCommit: f = () => {}, inverted: m = !1, form: h, ...g } = e, _ = p.useRef(/* @__PURE__ */ new Set()), v = p.useRef(0), y = o === "horizontal" ? hC : gC, [b = [], x] = qS({
|
|
19393
|
+
prop: u,
|
|
19394
|
+
defaultProp: l,
|
|
19395
|
+
onChange: (e) => {
|
|
19396
|
+
[..._.current][v.current]?.focus(), d(e);
|
|
19397
|
+
}
|
|
19398
|
+
}), S = p.useRef(b);
|
|
19399
|
+
function C(e) {
|
|
19400
|
+
E(e, AC(b, e));
|
|
19401
|
+
}
|
|
19402
|
+
function w(e) {
|
|
19403
|
+
E(e, v.current);
|
|
19404
|
+
}
|
|
19405
|
+
function T() {
|
|
19406
|
+
let e = S.current[v.current];
|
|
19407
|
+
b[v.current] !== e && f(b);
|
|
19408
|
+
}
|
|
19409
|
+
function E(e, t, { commit: n } = { commit: !1 }) {
|
|
19410
|
+
let o = FC(a), s = eC(IC(Math.round((e - r) / a) * a + r, o), [r, i]);
|
|
19411
|
+
x((e = []) => {
|
|
19412
|
+
let r = DC(e, s, t);
|
|
19413
|
+
if (NC(r, c * a)) {
|
|
19414
|
+
v.current = r.indexOf(s);
|
|
19415
|
+
let t = String(r) !== String(e);
|
|
19416
|
+
return t && n && f(r), t ? r : e;
|
|
19417
|
+
} else return e;
|
|
19418
|
+
});
|
|
19419
|
+
}
|
|
19420
|
+
return /* @__PURE__ */ D(uC, {
|
|
19421
|
+
scope: e.__scopeSlider,
|
|
19422
|
+
name: n,
|
|
19423
|
+
disabled: s,
|
|
19424
|
+
min: r,
|
|
19425
|
+
max: i,
|
|
19426
|
+
valueIndexToChangeRef: v,
|
|
19427
|
+
thumbs: _.current,
|
|
19428
|
+
values: b,
|
|
19429
|
+
orientation: o,
|
|
19430
|
+
form: h,
|
|
19431
|
+
children: /* @__PURE__ */ D(aC.Provider, {
|
|
19432
|
+
scope: e.__scopeSlider,
|
|
19433
|
+
children: /* @__PURE__ */ D(aC.Slot, {
|
|
19434
|
+
scope: e.__scopeSlider,
|
|
19435
|
+
children: /* @__PURE__ */ D(y, {
|
|
19436
|
+
"aria-disabled": s,
|
|
19437
|
+
"data-disabled": s ? "" : void 0,
|
|
19438
|
+
...g,
|
|
19439
|
+
ref: t,
|
|
19440
|
+
onPointerDown: WS(g.onPointerDown, () => {
|
|
19441
|
+
s || (S.current = b);
|
|
19442
|
+
}),
|
|
19443
|
+
min: r,
|
|
19444
|
+
max: i,
|
|
19445
|
+
inverted: m,
|
|
19446
|
+
onSlideStart: s ? void 0 : C,
|
|
19447
|
+
onSlideMove: s ? void 0 : w,
|
|
19448
|
+
onSlideEnd: s ? void 0 : T,
|
|
19449
|
+
onHomeKeyDown: () => !s && E(r, 0, { commit: !0 }),
|
|
19450
|
+
onEndKeyDown: () => !s && E(i, b.length - 1, { commit: !0 }),
|
|
19451
|
+
onStepKeyDown: ({ event: e, direction: t }) => {
|
|
19452
|
+
if (!s) {
|
|
19453
|
+
let n = tC.includes(e.key) || e.shiftKey && nC.includes(e.key) ? 10 : 1, r = v.current, i = b[r];
|
|
19454
|
+
E(i + a * n * t, r, { commit: !0 });
|
|
19455
|
+
}
|
|
19456
|
+
}
|
|
19457
|
+
})
|
|
19458
|
+
})
|
|
19459
|
+
})
|
|
19460
|
+
});
|
|
19461
|
+
});
|
|
19462
|
+
fC.displayName = iC;
|
|
19463
|
+
var [pC, mC] = cC(iC, {
|
|
19464
|
+
startEdge: "left",
|
|
19465
|
+
endEdge: "right",
|
|
19466
|
+
size: "width",
|
|
19467
|
+
direction: 1
|
|
19468
|
+
}), hC = p.forwardRef((e, t) => {
|
|
19469
|
+
let { min: n, max: r, dir: i, inverted: a, onSlideStart: o, onSlideMove: s, onSlideEnd: c, onStepKeyDown: l, ...u } = e, [d, f] = p.useState(null), m = NS(t, (e) => f(e)), h = p.useRef(void 0), g = ZS(i), _ = g === "ltr", v = _ && !a || !_ && a;
|
|
19470
|
+
function y(e) {
|
|
19471
|
+
let t = h.current || d.getBoundingClientRect(), i = PC([0, t.width], v ? [n, r] : [r, n]);
|
|
19472
|
+
return h.current = t, i(e - t.left);
|
|
19473
|
+
}
|
|
19474
|
+
return /* @__PURE__ */ D(pC, {
|
|
19475
|
+
scope: e.__scopeSlider,
|
|
19476
|
+
startEdge: v ? "left" : "right",
|
|
19477
|
+
endEdge: v ? "right" : "left",
|
|
19478
|
+
direction: v ? 1 : -1,
|
|
19479
|
+
size: "width",
|
|
19480
|
+
children: /* @__PURE__ */ D(_C, {
|
|
19481
|
+
dir: g,
|
|
19482
|
+
"data-orientation": "horizontal",
|
|
19483
|
+
...u,
|
|
19484
|
+
ref: m,
|
|
19485
|
+
style: {
|
|
19486
|
+
...u.style,
|
|
19487
|
+
"--radix-slider-thumb-transform": "translateX(-50%)"
|
|
19488
|
+
},
|
|
19489
|
+
onSlideStart: (e) => {
|
|
19490
|
+
let t = y(e.clientX);
|
|
19491
|
+
o?.(t);
|
|
19492
|
+
},
|
|
19493
|
+
onSlideMove: (e) => {
|
|
19494
|
+
let t = y(e.clientX);
|
|
19495
|
+
s?.(t);
|
|
19496
|
+
},
|
|
19497
|
+
onSlideEnd: () => {
|
|
19498
|
+
h.current = void 0, c?.();
|
|
19499
|
+
},
|
|
19500
|
+
onStepKeyDown: (e) => {
|
|
19501
|
+
let t = rC[v ? "from-left" : "from-right"].includes(e.key);
|
|
19502
|
+
l?.({
|
|
19503
|
+
event: e,
|
|
19504
|
+
direction: t ? -1 : 1
|
|
19505
|
+
});
|
|
19506
|
+
}
|
|
19507
|
+
})
|
|
19508
|
+
});
|
|
19509
|
+
}), gC = p.forwardRef((e, t) => {
|
|
19510
|
+
let { min: n, max: r, inverted: i, onSlideStart: a, onSlideMove: o, onSlideEnd: s, onStepKeyDown: c, ...l } = e, u = p.useRef(null), d = NS(t, u), f = p.useRef(void 0), m = !i;
|
|
19511
|
+
function h(e) {
|
|
19512
|
+
let t = f.current || u.current.getBoundingClientRect(), i = PC([0, t.height], m ? [r, n] : [n, r]);
|
|
19513
|
+
return f.current = t, i(e - t.top);
|
|
19514
|
+
}
|
|
19515
|
+
return /* @__PURE__ */ D(pC, {
|
|
19516
|
+
scope: e.__scopeSlider,
|
|
19517
|
+
startEdge: m ? "bottom" : "top",
|
|
19518
|
+
endEdge: m ? "top" : "bottom",
|
|
19519
|
+
size: "height",
|
|
19520
|
+
direction: m ? 1 : -1,
|
|
19521
|
+
children: /* @__PURE__ */ D(_C, {
|
|
19522
|
+
"data-orientation": "vertical",
|
|
19523
|
+
...l,
|
|
19524
|
+
ref: d,
|
|
19525
|
+
style: {
|
|
19526
|
+
...l.style,
|
|
19527
|
+
"--radix-slider-thumb-transform": "translateY(50%)"
|
|
19528
|
+
},
|
|
19529
|
+
onSlideStart: (e) => {
|
|
19530
|
+
let t = h(e.clientY);
|
|
19531
|
+
a?.(t);
|
|
19532
|
+
},
|
|
19533
|
+
onSlideMove: (e) => {
|
|
19534
|
+
let t = h(e.clientY);
|
|
19535
|
+
o?.(t);
|
|
19536
|
+
},
|
|
19537
|
+
onSlideEnd: () => {
|
|
19538
|
+
f.current = void 0, s?.();
|
|
19539
|
+
},
|
|
19540
|
+
onStepKeyDown: (e) => {
|
|
19541
|
+
let t = rC[m ? "from-bottom" : "from-top"].includes(e.key);
|
|
19542
|
+
c?.({
|
|
19543
|
+
event: e,
|
|
19544
|
+
direction: t ? -1 : 1
|
|
19545
|
+
});
|
|
19546
|
+
}
|
|
19547
|
+
})
|
|
19548
|
+
});
|
|
19549
|
+
}), _C = p.forwardRef((e, t) => {
|
|
19550
|
+
let { __scopeSlider: n, onSlideStart: r, onSlideMove: i, onSlideEnd: a, onHomeKeyDown: o, onEndKeyDown: s, onStepKeyDown: c, ...l } = e, u = dC(iC, n);
|
|
19551
|
+
return /* @__PURE__ */ D(BS.span, {
|
|
19552
|
+
...l,
|
|
19553
|
+
ref: t,
|
|
19554
|
+
onKeyDown: WS(e.onKeyDown, (e) => {
|
|
19555
|
+
e.key === "Home" ? (o(e), e.preventDefault()) : e.key === "End" ? (s(e), e.preventDefault()) : tC.concat(nC).includes(e.key) && (c(e), e.preventDefault());
|
|
19556
|
+
}),
|
|
19557
|
+
onPointerDown: WS(e.onPointerDown, (e) => {
|
|
19558
|
+
let t = e.target;
|
|
19559
|
+
t.setPointerCapture(e.pointerId), e.preventDefault(), u.thumbs.has(t) ? t.focus() : r(e);
|
|
19560
|
+
}),
|
|
19561
|
+
onPointerMove: WS(e.onPointerMove, (e) => {
|
|
19562
|
+
e.target.hasPointerCapture(e.pointerId) && i(e);
|
|
19563
|
+
}),
|
|
19564
|
+
onPointerUp: WS(e.onPointerUp, (e) => {
|
|
19565
|
+
let t = e.target;
|
|
19566
|
+
t.hasPointerCapture(e.pointerId) && (t.releasePointerCapture(e.pointerId), a(e));
|
|
19567
|
+
})
|
|
19568
|
+
});
|
|
19569
|
+
}), vC = "SliderTrack", yC = p.forwardRef((e, t) => {
|
|
19570
|
+
let { __scopeSlider: n, ...r } = e, i = dC(vC, n);
|
|
19571
|
+
return /* @__PURE__ */ D(BS.span, {
|
|
19572
|
+
"data-disabled": i.disabled ? "" : void 0,
|
|
19573
|
+
"data-orientation": i.orientation,
|
|
19574
|
+
...r,
|
|
19575
|
+
ref: t
|
|
19576
|
+
});
|
|
19577
|
+
});
|
|
19578
|
+
yC.displayName = vC;
|
|
19579
|
+
var bC = "SliderRange", xC = p.forwardRef((e, t) => {
|
|
19580
|
+
let { __scopeSlider: n, ...r } = e, i = dC(bC, n), a = mC(bC, n), o = NS(t, p.useRef(null)), s = i.values.length, c = i.values.map((e) => OC(e, i.min, i.max)), l = s > 1 ? Math.min(...c) : 0, u = 100 - Math.max(...c);
|
|
19581
|
+
return /* @__PURE__ */ D(BS.span, {
|
|
19582
|
+
"data-orientation": i.orientation,
|
|
19583
|
+
"data-disabled": i.disabled ? "" : void 0,
|
|
19584
|
+
...r,
|
|
19585
|
+
ref: o,
|
|
19586
|
+
style: {
|
|
19587
|
+
...e.style,
|
|
19588
|
+
[a.startEdge]: l + "%",
|
|
19589
|
+
[a.endEdge]: u + "%"
|
|
19590
|
+
}
|
|
19591
|
+
});
|
|
19592
|
+
});
|
|
19593
|
+
xC.displayName = bC;
|
|
19594
|
+
var SC = "SliderThumb", CC = p.forwardRef((e, t) => {
|
|
19595
|
+
let n = oC(e.__scopeSlider), [r, i] = p.useState(null), a = NS(t, (e) => i(e)), o = p.useMemo(() => r ? n().findIndex((e) => e.ref.current === r) : -1, [n, r]);
|
|
19596
|
+
return /* @__PURE__ */ D(wC, {
|
|
19597
|
+
...e,
|
|
19598
|
+
ref: a,
|
|
19599
|
+
index: o
|
|
19600
|
+
});
|
|
19601
|
+
}), wC = p.forwardRef((e, t) => {
|
|
19602
|
+
let { __scopeSlider: n, index: r, name: i, ...a } = e, o = dC(SC, n), s = mC(SC, n), [c, l] = p.useState(null), u = NS(t, (e) => l(e)), d = c ? o.form || !!c.closest("form") : !0, f = $S(c), m = o.values[r], h = m === void 0 ? 0 : OC(m, o.min, o.max), g = kC(r, o.values.length), _ = f?.[s.size], v = _ ? jC(_, h, s.direction) : 0;
|
|
19603
|
+
return p.useEffect(() => {
|
|
19604
|
+
if (c) return o.thumbs.add(c), () => {
|
|
19605
|
+
o.thumbs.delete(c);
|
|
19606
|
+
};
|
|
19607
|
+
}, [c, o.thumbs]), /* @__PURE__ */ O("span", {
|
|
19608
|
+
style: {
|
|
19609
|
+
transform: "var(--radix-slider-thumb-transform)",
|
|
19610
|
+
position: "absolute",
|
|
19611
|
+
[s.startEdge]: `calc(${h}% + ${v}px)`
|
|
19612
|
+
},
|
|
19613
|
+
children: [/* @__PURE__ */ D(aC.ItemSlot, {
|
|
19614
|
+
scope: e.__scopeSlider,
|
|
19615
|
+
children: /* @__PURE__ */ D(BS.span, {
|
|
19616
|
+
role: "slider",
|
|
19617
|
+
"aria-label": e["aria-label"] || g,
|
|
19618
|
+
"aria-valuemin": o.min,
|
|
19619
|
+
"aria-valuenow": m,
|
|
19620
|
+
"aria-valuemax": o.max,
|
|
19621
|
+
"aria-orientation": o.orientation,
|
|
19622
|
+
"data-orientation": o.orientation,
|
|
19623
|
+
"data-disabled": o.disabled ? "" : void 0,
|
|
19624
|
+
tabIndex: o.disabled ? void 0 : 0,
|
|
19625
|
+
...a,
|
|
19626
|
+
ref: u,
|
|
19627
|
+
style: m === void 0 ? { display: "none" } : e.style,
|
|
19628
|
+
onFocus: WS(e.onFocus, () => {
|
|
19629
|
+
o.valueIndexToChangeRef.current = r;
|
|
19630
|
+
})
|
|
19631
|
+
})
|
|
19632
|
+
}), d && /* @__PURE__ */ D(EC, {
|
|
19633
|
+
name: i ?? (o.name ? o.name + (o.values.length > 1 ? "[]" : "") : void 0),
|
|
19634
|
+
form: o.form,
|
|
19635
|
+
value: m
|
|
19636
|
+
}, r)]
|
|
19637
|
+
});
|
|
19638
|
+
});
|
|
19639
|
+
CC.displayName = SC;
|
|
19640
|
+
var TC = "RadioBubbleInput", EC = p.forwardRef(({ __scopeSlider: e, value: t, ...n }, r) => {
|
|
19641
|
+
let i = p.useRef(null), a = NS(i, r), o = QS(t);
|
|
19642
|
+
return p.useEffect(() => {
|
|
19643
|
+
let e = i.current;
|
|
19644
|
+
if (!e) return;
|
|
19645
|
+
let n = window.HTMLInputElement.prototype, r = Object.getOwnPropertyDescriptor(n, "value").set;
|
|
19646
|
+
if (o !== t && r) {
|
|
19647
|
+
let n = new Event("input", { bubbles: !0 });
|
|
19648
|
+
r.call(e, t), e.dispatchEvent(n);
|
|
19649
|
+
}
|
|
19650
|
+
}, [o, t]), /* @__PURE__ */ D(BS.input, {
|
|
19651
|
+
style: { display: "none" },
|
|
19652
|
+
...n,
|
|
19653
|
+
ref: a,
|
|
19654
|
+
defaultValue: t
|
|
19655
|
+
});
|
|
19656
|
+
});
|
|
19657
|
+
EC.displayName = TC;
|
|
19658
|
+
function DC(e = [], t, n) {
|
|
19659
|
+
let r = [...e];
|
|
19660
|
+
return r[n] = t, r.sort((e, t) => e - t);
|
|
19661
|
+
}
|
|
19662
|
+
function OC(e, t, n) {
|
|
19663
|
+
return eC(100 / (n - t) * (e - t), [0, 100]);
|
|
19664
|
+
}
|
|
19665
|
+
function kC(e, t) {
|
|
19666
|
+
if (t > 2) return `Value ${e + 1} of ${t}`;
|
|
19667
|
+
if (t === 2) return ["Minimum", "Maximum"][e];
|
|
19668
|
+
}
|
|
19669
|
+
function AC(e, t) {
|
|
19670
|
+
if (e.length === 1) return 0;
|
|
19671
|
+
let n = e.map((e) => Math.abs(e - t)), r = Math.min(...n);
|
|
19672
|
+
return n.indexOf(r);
|
|
19673
|
+
}
|
|
19674
|
+
function jC(e, t, n) {
|
|
19675
|
+
let r = e / 2;
|
|
19676
|
+
return (r - PC([0, 50], [0, r])(t) * n) * n;
|
|
19677
|
+
}
|
|
19678
|
+
function MC(e) {
|
|
19679
|
+
return e.slice(0, -1).map((t, n) => e[n + 1] - t);
|
|
19680
|
+
}
|
|
19681
|
+
function NC(e, t) {
|
|
19682
|
+
if (t > 0) {
|
|
19683
|
+
let n = MC(e);
|
|
19684
|
+
return Math.min(...n) >= t;
|
|
19685
|
+
}
|
|
19686
|
+
return !0;
|
|
19687
|
+
}
|
|
19688
|
+
function PC(e, t) {
|
|
19689
|
+
return (n) => {
|
|
19690
|
+
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
19691
|
+
let r = (t[1] - t[0]) / (e[1] - e[0]);
|
|
19692
|
+
return t[0] + r * (n - e[0]);
|
|
19693
|
+
};
|
|
19694
|
+
}
|
|
19695
|
+
function FC(e) {
|
|
19696
|
+
return (String(e).split(".")[1] || "").length;
|
|
19697
|
+
}
|
|
19698
|
+
function IC(e, t) {
|
|
19699
|
+
let n = 10 ** t;
|
|
19700
|
+
return Math.round(e * n) / n;
|
|
19701
|
+
}
|
|
19702
|
+
var LC = fC, RC = yC, zC = xC, BC = CC;
|
|
19703
|
+
//#endregion
|
|
19704
|
+
//#region src/components/Slider/slider.tsx
|
|
19705
|
+
function VC({ className: e, defaultValue: t, value: n, min: r = 0, max: i = 100, ...a }) {
|
|
19706
|
+
let o = p.useMemo(() => Array.isArray(n) ? n : Array.isArray(t) ? t : [r, i], [
|
|
19707
|
+
n,
|
|
19708
|
+
t,
|
|
19709
|
+
r,
|
|
19710
|
+
i
|
|
19711
|
+
]);
|
|
19712
|
+
return /* @__PURE__ */ O(LC, {
|
|
19713
|
+
"data-slot": "slider",
|
|
19714
|
+
defaultValue: t,
|
|
19715
|
+
value: n,
|
|
19716
|
+
min: r,
|
|
19717
|
+
max: i,
|
|
19718
|
+
className: W("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col", e),
|
|
19719
|
+
...a,
|
|
19720
|
+
children: [/* @__PURE__ */ D(RC, {
|
|
19721
|
+
"data-slot": "slider-track",
|
|
19722
|
+
className: W("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),
|
|
19723
|
+
children: /* @__PURE__ */ D(zC, {
|
|
19724
|
+
"data-slot": "slider-range",
|
|
19725
|
+
className: W("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")
|
|
19726
|
+
})
|
|
19727
|
+
}), Array.from({ length: o.length }, (e, t) => /* @__PURE__ */ D(BC, {
|
|
19728
|
+
"data-slot": "slider-thumb",
|
|
19729
|
+
className: "border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
19730
|
+
}, t))]
|
|
19731
|
+
});
|
|
19732
|
+
}
|
|
19733
|
+
//#endregion
|
|
19039
19734
|
//#region node_modules/@base-ui/react/esm/switch/root/SwitchRootContext.js
|
|
19040
|
-
var
|
|
19041
|
-
process.env.NODE_ENV !== "production" && (
|
|
19042
|
-
function
|
|
19043
|
-
let e = p.useContext(
|
|
19735
|
+
var HC = /* @__PURE__ */ p.createContext(void 0);
|
|
19736
|
+
process.env.NODE_ENV !== "production" && (HC.displayName = "SwitchRootContext");
|
|
19737
|
+
function UC() {
|
|
19738
|
+
let e = p.useContext(HC);
|
|
19044
19739
|
if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? ue(63) : "Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.");
|
|
19045
19740
|
return e;
|
|
19046
19741
|
}
|
|
19047
19742
|
//#endregion
|
|
19048
19743
|
//#region node_modules/@base-ui/react/esm/switch/root/SwitchRootDataAttributes.js
|
|
19049
|
-
var
|
|
19744
|
+
var WC = /* @__PURE__ */ function(e) {
|
|
19050
19745
|
return e.checked = "data-checked", e.unchecked = "data-unchecked", e.disabled = "data-disabled", e.readonly = "data-readonly", e.required = "data-required", e.valid = "data-valid", e.invalid = "data-invalid", e.touched = "data-touched", e.dirty = "data-dirty", e.filled = "data-filled", e.focused = "data-focused", e;
|
|
19051
|
-
}({}),
|
|
19746
|
+
}({}), GC = {
|
|
19052
19747
|
...js,
|
|
19053
19748
|
checked(e) {
|
|
19054
|
-
return e ? { [
|
|
19749
|
+
return e ? { [WC.checked]: "" } : { [WC.unchecked]: "" };
|
|
19055
19750
|
}
|
|
19056
19751
|
};
|
|
19057
19752
|
//#endregion
|
|
19058
19753
|
//#region node_modules/@base-ui/react/esm/internals/labelable-provider/useLabelableId.js
|
|
19059
|
-
function
|
|
19754
|
+
function KC(e = {}) {
|
|
19060
19755
|
let { id: t, implicit: n = !1, controlRef: r } = e, { controlId: i, registerControlId: a } = Ks(), o = Ls(t), s = n ? i : void 0, c = fe(() => Symbol("labelable-control")), l = p.useRef(!1), u = p.useRef(t != null), d = K(() => {
|
|
19061
19756
|
!l.current || a === we || (l.current = !1, a(c.current, void 0));
|
|
19062
19757
|
});
|
|
@@ -19090,8 +19785,8 @@ function FS(e = {}) {
|
|
|
19090
19785
|
}
|
|
19091
19786
|
//#endregion
|
|
19092
19787
|
//#region node_modules/@base-ui/react/esm/switch/root/SwitchRoot.js
|
|
19093
|
-
var
|
|
19094
|
-
let { checked: n, className: r, defaultChecked: i, "aria-labelledby": a, form: o, id: s, inputRef: c, name: l, nativeButton: u = !1, onCheckedChange: d, readOnly: f = !1, required: m = !1, disabled: h = !1, render: g, uncheckedValue: _, value: v, style: y, ...b } = e, { clearErrors: x } = Ws(), { state: S, setTouched: C, setDirty: w, validityData: T, setFilled: E, setFocused: k, shouldValidateOnChange: A, validationMode: j, disabled: M, name: N, validation: P } = zs(), { labelId: F } = Ks(), ee = M || h, te = N ?? l, ne = K(d), re = p.useRef(null), L = pe(re, c, P.inputRef), ie = p.useRef(null), R = Ls(), ae =
|
|
19788
|
+
var qC = /* @__PURE__ */ p.forwardRef(function(e, t) {
|
|
19789
|
+
let { checked: n, className: r, defaultChecked: i, "aria-labelledby": a, form: o, id: s, inputRef: c, name: l, nativeButton: u = !1, onCheckedChange: d, readOnly: f = !1, required: m = !1, disabled: h = !1, render: g, uncheckedValue: _, value: v, style: y, ...b } = e, { clearErrors: x } = Ws(), { state: S, setTouched: C, setDirty: w, validityData: T, setFilled: E, setFocused: k, shouldValidateOnChange: A, validationMode: j, disabled: M, name: N, validation: P } = zs(), { labelId: F } = Ks(), ee = M || h, te = N ?? l, ne = K(d), re = p.useRef(null), L = pe(re, c, P.inputRef), ie = p.useRef(null), R = Ls(), ae = KC({
|
|
19095
19790
|
id: s,
|
|
19096
19791
|
implicit: !1,
|
|
19097
19792
|
controlRef: ie
|
|
@@ -19197,9 +19892,9 @@ var IS = /* @__PURE__ */ p.forwardRef(function(e, t) {
|
|
|
19197
19892
|
b,
|
|
19198
19893
|
se
|
|
19199
19894
|
],
|
|
19200
|
-
stateAttributesMapping:
|
|
19895
|
+
stateAttributesMapping: GC
|
|
19201
19896
|
});
|
|
19202
|
-
return /* @__PURE__ */ O(
|
|
19897
|
+
return /* @__PURE__ */ O(HC.Provider, {
|
|
19203
19898
|
value: fe,
|
|
19204
19899
|
children: [
|
|
19205
19900
|
me,
|
|
@@ -19216,30 +19911,30 @@ var IS = /* @__PURE__ */ p.forwardRef(function(e, t) {
|
|
|
19216
19911
|
]
|
|
19217
19912
|
});
|
|
19218
19913
|
});
|
|
19219
|
-
process.env.NODE_ENV !== "production" && (
|
|
19914
|
+
process.env.NODE_ENV !== "production" && (qC.displayName = "SwitchRoot");
|
|
19220
19915
|
//#endregion
|
|
19221
19916
|
//#region node_modules/@base-ui/react/esm/switch/thumb/SwitchThumb.js
|
|
19222
|
-
var
|
|
19223
|
-
let { render: n, className: r, style: i, ...a } = e, { state: o } = zs(), s =
|
|
19917
|
+
var JC = /* @__PURE__ */ p.forwardRef(function(e, t) {
|
|
19918
|
+
let { render: n, className: r, style: i, ...a } = e, { state: o } = zs(), s = UC();
|
|
19224
19919
|
return ke("span", e, {
|
|
19225
19920
|
state: {
|
|
19226
19921
|
...o,
|
|
19227
19922
|
...s
|
|
19228
19923
|
},
|
|
19229
19924
|
ref: t,
|
|
19230
|
-
stateAttributesMapping:
|
|
19925
|
+
stateAttributesMapping: GC,
|
|
19231
19926
|
props: a
|
|
19232
19927
|
});
|
|
19233
19928
|
});
|
|
19234
|
-
process.env.NODE_ENV !== "production" && (
|
|
19929
|
+
process.env.NODE_ENV !== "production" && (JC.displayName = "SwitchThumb");
|
|
19235
19930
|
//#endregion
|
|
19236
19931
|
//#region src/components/Switch/switch.tsx
|
|
19237
|
-
function
|
|
19238
|
-
return /* @__PURE__ */ D(
|
|
19932
|
+
function YC({ className: e, ...t }) {
|
|
19933
|
+
return /* @__PURE__ */ D(qC, {
|
|
19239
19934
|
"data-slot": "switch",
|
|
19240
19935
|
className: W("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-xs transition-all outline-none", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "disabled:cursor-not-allowed disabled:opacity-50", "data-unchecked:bg-input dark:data-unchecked:bg-input/80", "data-checked:bg-primary", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", e),
|
|
19241
19936
|
...t,
|
|
19242
|
-
children: /* @__PURE__ */ D(
|
|
19937
|
+
children: /* @__PURE__ */ D(JC, {
|
|
19243
19938
|
"data-slot": "switch-thumb",
|
|
19244
19939
|
className: W("bg-background pointer-events-none block size-4 rounded-full shadow-sm ring-0 transition-transform", "data-unchecked:translate-x-0", "data-checked:translate-x-4")
|
|
19245
19940
|
})
|
|
@@ -19247,7 +19942,7 @@ function RS({ className: e, ...t }) {
|
|
|
19247
19942
|
}
|
|
19248
19943
|
//#endregion
|
|
19249
19944
|
//#region src/components/Table/CheckFilter.tsx
|
|
19250
|
-
var
|
|
19945
|
+
var XC = ({ label: e, value: t, onChange: n, className: r }) => /* @__PURE__ */ O(ar, {
|
|
19251
19946
|
render: /* @__PURE__ */ D("span", {}),
|
|
19252
19947
|
variant: "outline",
|
|
19253
19948
|
className: W("cursor-pointer", r),
|
|
@@ -19262,24 +19957,24 @@ var zS = ({ label: e, value: t, onChange: n, className: r }) => /* @__PURE__ */
|
|
|
19262
19957
|
});
|
|
19263
19958
|
//#endregion
|
|
19264
19959
|
//#region node_modules/@tanstack/table-core/build/lib/index.mjs
|
|
19265
|
-
function
|
|
19960
|
+
function ZC(e, t) {
|
|
19266
19961
|
return typeof e == "function" ? e(t) : e;
|
|
19267
19962
|
}
|
|
19268
|
-
function
|
|
19963
|
+
function QC(e, t) {
|
|
19269
19964
|
return (n) => {
|
|
19270
19965
|
t.setState((t) => ({
|
|
19271
19966
|
...t,
|
|
19272
|
-
[e]:
|
|
19967
|
+
[e]: ZC(n, t[e])
|
|
19273
19968
|
}));
|
|
19274
19969
|
};
|
|
19275
19970
|
}
|
|
19276
|
-
function
|
|
19971
|
+
function $C(e) {
|
|
19277
19972
|
return e instanceof Function;
|
|
19278
19973
|
}
|
|
19279
|
-
function
|
|
19974
|
+
function ew(e) {
|
|
19280
19975
|
return Array.isArray(e) && e.every((e) => typeof e == "number");
|
|
19281
19976
|
}
|
|
19282
|
-
function
|
|
19977
|
+
function tw(e, t) {
|
|
19283
19978
|
let n = [], r = (e) => {
|
|
19284
19979
|
e.forEach((e) => {
|
|
19285
19980
|
n.push(e);
|
|
@@ -19318,7 +20013,7 @@ function $(e, t, n, r) {
|
|
|
19318
20013
|
onChange: r
|
|
19319
20014
|
};
|
|
19320
20015
|
}
|
|
19321
|
-
function
|
|
20016
|
+
function nw(e, t, n, r) {
|
|
19322
20017
|
let i = {
|
|
19323
20018
|
id: `${t.id}_${n.id}`,
|
|
19324
20019
|
row: t,
|
|
@@ -19343,7 +20038,7 @@ function GS(e, t, n, r) {
|
|
|
19343
20038
|
r.createCell == null || r.createCell(i, n, t, e);
|
|
19344
20039
|
}, {}), i;
|
|
19345
20040
|
}
|
|
19346
|
-
function
|
|
20041
|
+
function rw(e, t, n, r) {
|
|
19347
20042
|
let i = {
|
|
19348
20043
|
...e._getDefaultColumnDef(),
|
|
19349
20044
|
...t
|
|
@@ -19369,8 +20064,8 @@ function KS(e, t, n, r) {
|
|
|
19369
20064
|
for (let t of e._features) t.createColumn == null || t.createColumn(c, e);
|
|
19370
20065
|
return c;
|
|
19371
20066
|
}
|
|
19372
|
-
var
|
|
19373
|
-
function
|
|
20067
|
+
var iw = "debugHeaders";
|
|
20068
|
+
function aw(e, t, n) {
|
|
19374
20069
|
let r = {
|
|
19375
20070
|
id: n.id ?? t.id,
|
|
19376
20071
|
column: t,
|
|
@@ -19398,7 +20093,7 @@ function JS(e, t, n) {
|
|
|
19398
20093
|
t.createHeader == null || t.createHeader(r, e);
|
|
19399
20094
|
}), r;
|
|
19400
20095
|
}
|
|
19401
|
-
var
|
|
20096
|
+
var ow = { createTable: (e) => {
|
|
19402
20097
|
e.getHeaderGroups = Q(() => [
|
|
19403
20098
|
e.getAllColumns(),
|
|
19404
20099
|
e.getVisibleLeafColumns(),
|
|
@@ -19406,34 +20101,34 @@ var YS = { createTable: (e) => {
|
|
|
19406
20101
|
e.getState().columnPinning.right
|
|
19407
20102
|
], (t, n, r, i) => {
|
|
19408
20103
|
let a = r?.map((e) => n.find((t) => t.id === e)).filter(Boolean) ?? [], o = i?.map((e) => n.find((t) => t.id === e)).filter(Boolean) ?? [], s = n.filter((e) => !(r != null && r.includes(e.id)) && !(i != null && i.includes(e.id)));
|
|
19409
|
-
return
|
|
20104
|
+
return sw(t, [
|
|
19410
20105
|
...a,
|
|
19411
20106
|
...s,
|
|
19412
20107
|
...o
|
|
19413
20108
|
], e);
|
|
19414
|
-
}, $(e.options,
|
|
20109
|
+
}, $(e.options, iw, "getHeaderGroups")), e.getCenterHeaderGroups = Q(() => [
|
|
19415
20110
|
e.getAllColumns(),
|
|
19416
20111
|
e.getVisibleLeafColumns(),
|
|
19417
20112
|
e.getState().columnPinning.left,
|
|
19418
20113
|
e.getState().columnPinning.right
|
|
19419
|
-
], (t, n, r, i) => (n = n.filter((e) => !(r != null && r.includes(e.id)) && !(i != null && i.includes(e.id))),
|
|
20114
|
+
], (t, n, r, i) => (n = n.filter((e) => !(r != null && r.includes(e.id)) && !(i != null && i.includes(e.id))), sw(t, n, e, "center")), $(e.options, iw, "getCenterHeaderGroups")), e.getLeftHeaderGroups = Q(() => [
|
|
19420
20115
|
e.getAllColumns(),
|
|
19421
20116
|
e.getVisibleLeafColumns(),
|
|
19422
20117
|
e.getState().columnPinning.left
|
|
19423
|
-
], (t, n, r) =>
|
|
20118
|
+
], (t, n, r) => sw(t, r?.map((e) => n.find((t) => t.id === e)).filter(Boolean) ?? [], e, "left"), $(e.options, iw, "getLeftHeaderGroups")), e.getRightHeaderGroups = Q(() => [
|
|
19424
20119
|
e.getAllColumns(),
|
|
19425
20120
|
e.getVisibleLeafColumns(),
|
|
19426
20121
|
e.getState().columnPinning.right
|
|
19427
|
-
], (t, n, r) =>
|
|
20122
|
+
], (t, n, r) => sw(t, r?.map((e) => n.find((t) => t.id === e)).filter(Boolean) ?? [], e, "right"), $(e.options, iw, "getRightHeaderGroups")), e.getFooterGroups = Q(() => [e.getHeaderGroups()], (e) => [...e].reverse(), $(e.options, iw, "getFooterGroups")), e.getLeftFooterGroups = Q(() => [e.getLeftHeaderGroups()], (e) => [...e].reverse(), $(e.options, iw, "getLeftFooterGroups")), e.getCenterFooterGroups = Q(() => [e.getCenterHeaderGroups()], (e) => [...e].reverse(), $(e.options, iw, "getCenterFooterGroups")), e.getRightFooterGroups = Q(() => [e.getRightHeaderGroups()], (e) => [...e].reverse(), $(e.options, iw, "getRightFooterGroups")), e.getFlatHeaders = Q(() => [e.getHeaderGroups()], (e) => e.map((e) => e.headers).flat(), $(e.options, iw, "getFlatHeaders")), e.getLeftFlatHeaders = Q(() => [e.getLeftHeaderGroups()], (e) => e.map((e) => e.headers).flat(), $(e.options, iw, "getLeftFlatHeaders")), e.getCenterFlatHeaders = Q(() => [e.getCenterHeaderGroups()], (e) => e.map((e) => e.headers).flat(), $(e.options, iw, "getCenterFlatHeaders")), e.getRightFlatHeaders = Q(() => [e.getRightHeaderGroups()], (e) => e.map((e) => e.headers).flat(), $(e.options, iw, "getRightFlatHeaders")), e.getCenterLeafHeaders = Q(() => [e.getCenterFlatHeaders()], (e) => e.filter((e) => {
|
|
19428
20123
|
var t;
|
|
19429
20124
|
return !((t = e.subHeaders) != null && t.length);
|
|
19430
|
-
}), $(e.options,
|
|
20125
|
+
}), $(e.options, iw, "getCenterLeafHeaders")), e.getLeftLeafHeaders = Q(() => [e.getLeftFlatHeaders()], (e) => e.filter((e) => {
|
|
19431
20126
|
var t;
|
|
19432
20127
|
return !((t = e.subHeaders) != null && t.length);
|
|
19433
|
-
}), $(e.options,
|
|
20128
|
+
}), $(e.options, iw, "getLeftLeafHeaders")), e.getRightLeafHeaders = Q(() => [e.getRightFlatHeaders()], (e) => e.filter((e) => {
|
|
19434
20129
|
var t;
|
|
19435
20130
|
return !((t = e.subHeaders) != null && t.length);
|
|
19436
|
-
}), $(e.options,
|
|
20131
|
+
}), $(e.options, iw, "getRightLeafHeaders")), e.getLeafHeaders = Q(() => [
|
|
19437
20132
|
e.getLeftHeaderGroups(),
|
|
19438
20133
|
e.getCenterHeaderGroups(),
|
|
19439
20134
|
e.getRightHeaderGroups()
|
|
@@ -19441,9 +20136,9 @@ var YS = { createTable: (e) => {
|
|
|
19441
20136
|
...e[0]?.headers ?? [],
|
|
19442
20137
|
...t[0]?.headers ?? [],
|
|
19443
20138
|
...n[0]?.headers ?? []
|
|
19444
|
-
].map((e) => e.getLeafHeaders()).flat(), $(e.options,
|
|
20139
|
+
].map((e) => e.getLeafHeaders()).flat(), $(e.options, iw, "getLeafHeaders"));
|
|
19445
20140
|
} };
|
|
19446
|
-
function
|
|
20141
|
+
function sw(e, t, n, r) {
|
|
19447
20142
|
let i = 0, a = function(e, t) {
|
|
19448
20143
|
t === void 0 && (t = 1), i = Math.max(i, t), e.filter((e) => e.getIsVisible()).forEach((e) => {
|
|
19449
20144
|
var n;
|
|
@@ -19461,7 +20156,7 @@ function XS(e, t, n, r) {
|
|
|
19461
20156
|
let o = [...a].reverse()[0], s = e.column.depth === i.depth, c, l = !1;
|
|
19462
20157
|
if (s && e.column.parent ? c = e.column.parent : (c = e.column, l = !0), o && o?.column === c) o.subHeaders.push(e);
|
|
19463
20158
|
else {
|
|
19464
|
-
let i =
|
|
20159
|
+
let i = aw(n, c, {
|
|
19465
20160
|
id: [
|
|
19466
20161
|
r,
|
|
19467
20162
|
t,
|
|
@@ -19478,7 +20173,7 @@ function XS(e, t, n, r) {
|
|
|
19478
20173
|
i.headers.push(e), e.headerGroup = i;
|
|
19479
20174
|
}), o.push(i), t > 0 && s(a, t - 1);
|
|
19480
20175
|
};
|
|
19481
|
-
s(t.map((e, t) =>
|
|
20176
|
+
s(t.map((e, t) => aw(n, e, {
|
|
19482
20177
|
depth: i,
|
|
19483
20178
|
index: t
|
|
19484
20179
|
})), i - 1), o.reverse();
|
|
@@ -19496,7 +20191,7 @@ function XS(e, t, n, r) {
|
|
|
19496
20191
|
});
|
|
19497
20192
|
return c(o[0]?.headers ?? []), o;
|
|
19498
20193
|
}
|
|
19499
|
-
var
|
|
20194
|
+
var cw = (e, t, n, r, i, a, o) => {
|
|
19500
20195
|
let s = {
|
|
19501
20196
|
id: t,
|
|
19502
20197
|
index: r,
|
|
@@ -19517,7 +20212,7 @@ var ZS = (e, t, n, r, i, a, o) => {
|
|
|
19517
20212
|
},
|
|
19518
20213
|
renderValue: (t) => s.getValue(t) ?? e.options.renderFallbackValue,
|
|
19519
20214
|
subRows: a ?? [],
|
|
19520
|
-
getLeafRows: () =>
|
|
20215
|
+
getLeafRows: () => tw(s.subRows, (e) => e.subRows),
|
|
19521
20216
|
getParentRow: () => s.parentId ? e.getRow(s.parentId, !0) : void 0,
|
|
19522
20217
|
getParentRows: () => {
|
|
19523
20218
|
let e = [], t = s;
|
|
@@ -19528,7 +20223,7 @@ var ZS = (e, t, n, r, i, a, o) => {
|
|
|
19528
20223
|
}
|
|
19529
20224
|
return e.reverse();
|
|
19530
20225
|
},
|
|
19531
|
-
getAllCells: Q(() => [e.getAllLeafColumns()], (t) => t.map((t) =>
|
|
20226
|
+
getAllCells: Q(() => [e.getAllLeafColumns()], (t) => t.map((t) => nw(e, s, t, t.id)), $(e.options, "debugRows", "getAllCells")),
|
|
19532
20227
|
_getAllCellsByColumnId: Q(() => [s.getAllCells()], (e) => e.reduce((e, t) => (e[t.column.id] = t, e), {}), $(e.options, "debugRows", "getAllCellsByColumnId"))
|
|
19533
20228
|
};
|
|
19534
20229
|
for (let t = 0; t < e._features.length; t++) {
|
|
@@ -19536,87 +20231,87 @@ var ZS = (e, t, n, r, i, a, o) => {
|
|
|
19536
20231
|
n == null || n.createRow == null || n.createRow(s, e);
|
|
19537
20232
|
}
|
|
19538
20233
|
return s;
|
|
19539
|
-
},
|
|
20234
|
+
}, lw = { createColumn: (e, t) => {
|
|
19540
20235
|
e._getFacetedRowModel = t.options.getFacetedRowModel && t.options.getFacetedRowModel(t, e.id), e.getFacetedRowModel = () => e._getFacetedRowModel ? e._getFacetedRowModel() : t.getPreFilteredRowModel(), e._getFacetedUniqueValues = t.options.getFacetedUniqueValues && t.options.getFacetedUniqueValues(t, e.id), e.getFacetedUniqueValues = () => e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getFacetedMinMaxValues = t.options.getFacetedMinMaxValues && t.options.getFacetedMinMaxValues(t, e.id), e.getFacetedMinMaxValues = () => {
|
|
19541
20236
|
if (e._getFacetedMinMaxValues) return e._getFacetedMinMaxValues();
|
|
19542
20237
|
};
|
|
19543
|
-
} },
|
|
20238
|
+
} }, uw = (e, t, n) => {
|
|
19544
20239
|
var r, i;
|
|
19545
20240
|
let a = n == null || (r = n.toString()) == null ? void 0 : r.toLowerCase();
|
|
19546
20241
|
return !!(!((i = e.getValue(t)) == null || (i = i.toString()) == null || (i = i.toLowerCase()) == null) && i.includes(a));
|
|
19547
20242
|
};
|
|
19548
|
-
|
|
19549
|
-
var
|
|
20243
|
+
uw.autoRemove = (e) => bw(e);
|
|
20244
|
+
var dw = (e, t, n) => {
|
|
19550
20245
|
var r;
|
|
19551
20246
|
return !!(!((r = e.getValue(t)) == null || (r = r.toString()) == null) && r.includes(n));
|
|
19552
20247
|
};
|
|
19553
|
-
|
|
19554
|
-
var
|
|
20248
|
+
dw.autoRemove = (e) => bw(e);
|
|
20249
|
+
var fw = (e, t, n) => {
|
|
19555
20250
|
var r;
|
|
19556
20251
|
return ((r = e.getValue(t)) == null || (r = r.toString()) == null ? void 0 : r.toLowerCase()) === n?.toLowerCase();
|
|
19557
20252
|
};
|
|
19558
|
-
|
|
19559
|
-
var
|
|
19560
|
-
|
|
19561
|
-
var
|
|
20253
|
+
fw.autoRemove = (e) => bw(e);
|
|
20254
|
+
var pw = (e, t, n) => e.getValue(t)?.includes(n);
|
|
20255
|
+
pw.autoRemove = (e) => bw(e);
|
|
20256
|
+
var mw = (e, t, n) => !n.some((n) => {
|
|
19562
20257
|
var r;
|
|
19563
20258
|
return !((r = e.getValue(t)) != null && r.includes(n));
|
|
19564
20259
|
});
|
|
19565
|
-
|
|
19566
|
-
var
|
|
19567
|
-
|
|
19568
|
-
var
|
|
19569
|
-
|
|
19570
|
-
var
|
|
19571
|
-
|
|
19572
|
-
var
|
|
20260
|
+
mw.autoRemove = (e) => bw(e) || !(e != null && e.length);
|
|
20261
|
+
var hw = (e, t, n) => n.some((n) => e.getValue(t)?.includes(n));
|
|
20262
|
+
hw.autoRemove = (e) => bw(e) || !(e != null && e.length);
|
|
20263
|
+
var gw = (e, t, n) => e.getValue(t) === n;
|
|
20264
|
+
gw.autoRemove = (e) => bw(e);
|
|
20265
|
+
var _w = (e, t, n) => e.getValue(t) == n;
|
|
20266
|
+
_w.autoRemove = (e) => bw(e);
|
|
20267
|
+
var vw = (e, t, n) => {
|
|
19573
20268
|
let [r, i] = n, a = e.getValue(t);
|
|
19574
20269
|
return a >= r && a <= i;
|
|
19575
20270
|
};
|
|
19576
|
-
|
|
20271
|
+
vw.resolveFilterValue = (e) => {
|
|
19577
20272
|
let [t, n] = e, r = typeof t == "number" ? t : parseFloat(t), i = typeof n == "number" ? n : parseFloat(n), a = t === null || Number.isNaN(r) ? -Infinity : r, o = n === null || Number.isNaN(i) ? Infinity : i;
|
|
19578
20273
|
if (a > o) {
|
|
19579
20274
|
let e = a;
|
|
19580
20275
|
a = o, o = e;
|
|
19581
20276
|
}
|
|
19582
20277
|
return [a, o];
|
|
19583
|
-
},
|
|
19584
|
-
var
|
|
19585
|
-
includesString:
|
|
19586
|
-
includesStringSensitive:
|
|
19587
|
-
equalsString:
|
|
19588
|
-
arrIncludes:
|
|
19589
|
-
arrIncludesAll:
|
|
19590
|
-
arrIncludesSome:
|
|
19591
|
-
equals:
|
|
19592
|
-
weakEquals:
|
|
19593
|
-
inNumberRange:
|
|
20278
|
+
}, vw.autoRemove = (e) => bw(e) || bw(e[0]) && bw(e[1]);
|
|
20279
|
+
var yw = {
|
|
20280
|
+
includesString: uw,
|
|
20281
|
+
includesStringSensitive: dw,
|
|
20282
|
+
equalsString: fw,
|
|
20283
|
+
arrIncludes: pw,
|
|
20284
|
+
arrIncludesAll: mw,
|
|
20285
|
+
arrIncludesSome: hw,
|
|
20286
|
+
equals: gw,
|
|
20287
|
+
weakEquals: _w,
|
|
20288
|
+
inNumberRange: vw
|
|
19594
20289
|
};
|
|
19595
|
-
function
|
|
20290
|
+
function bw(e) {
|
|
19596
20291
|
return e == null || e === "";
|
|
19597
20292
|
}
|
|
19598
|
-
var
|
|
20293
|
+
var xw = {
|
|
19599
20294
|
getDefaultColumnDef: () => ({ filterFn: "auto" }),
|
|
19600
20295
|
getInitialState: (e) => ({
|
|
19601
20296
|
columnFilters: [],
|
|
19602
20297
|
...e
|
|
19603
20298
|
}),
|
|
19604
20299
|
getDefaultOptions: (e) => ({
|
|
19605
|
-
onColumnFiltersChange:
|
|
20300
|
+
onColumnFiltersChange: QC("columnFilters", e),
|
|
19606
20301
|
filterFromLeafRows: !1,
|
|
19607
20302
|
maxLeafRowFilterDepth: 100
|
|
19608
20303
|
}),
|
|
19609
20304
|
createColumn: (e, t) => {
|
|
19610
20305
|
e.getAutoFilterFn = () => {
|
|
19611
20306
|
let n = t.getCoreRowModel().flatRows[0]?.getValue(e.id);
|
|
19612
|
-
return typeof n == "string" ?
|
|
19613
|
-
}, e.getFilterFn = () =>
|
|
20307
|
+
return typeof n == "string" ? yw.includesString : typeof n == "number" ? yw.inNumberRange : typeof n == "boolean" || typeof n == "object" && n ? yw.equals : Array.isArray(n) ? yw.arrIncludes : yw.weakEquals;
|
|
20308
|
+
}, e.getFilterFn = () => $C(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : t.options.filterFns?.[e.columnDef.filterFn] ?? yw[e.columnDef.filterFn], e.getCanFilter = () => (e.columnDef.enableColumnFilter ?? !0) && (t.options.enableColumnFilters ?? !0) && (t.options.enableFilters ?? !0) && !!e.accessorFn, e.getIsFiltered = () => e.getFilterIndex() > -1, e.getFilterValue = () => {
|
|
19614
20309
|
var n;
|
|
19615
20310
|
return (n = t.getState().columnFilters) == null || (n = n.find((t) => t.id === e.id)) == null ? void 0 : n.value;
|
|
19616
20311
|
}, e.getFilterIndex = () => t.getState().columnFilters?.findIndex((t) => t.id === e.id) ?? -1, e.setFilterValue = (n) => {
|
|
19617
20312
|
t.setColumnFilters((t) => {
|
|
19618
|
-
let r = e.getFilterFn(), i = t?.find((t) => t.id === e.id), a =
|
|
19619
|
-
if (
|
|
20313
|
+
let r = e.getFilterFn(), i = t?.find((t) => t.id === e.id), a = ZC(n, i ? i.value : void 0);
|
|
20314
|
+
if (Sw(r, a, e)) return t?.filter((t) => t.id !== e.id) ?? [];
|
|
19620
20315
|
let o = {
|
|
19621
20316
|
id: e.id,
|
|
19622
20317
|
value: a
|
|
@@ -19631,19 +20326,19 @@ var uC = {
|
|
|
19631
20326
|
createTable: (e) => {
|
|
19632
20327
|
e.setColumnFilters = (t) => {
|
|
19633
20328
|
let n = e.getAllLeafColumns();
|
|
19634
|
-
e.options.onColumnFiltersChange == null || e.options.onColumnFiltersChange((e) =>
|
|
20329
|
+
e.options.onColumnFiltersChange == null || e.options.onColumnFiltersChange((e) => ZC(t, e)?.filter((e) => {
|
|
19635
20330
|
let t = n.find((t) => t.id === e.id);
|
|
19636
|
-
return !(t &&
|
|
20331
|
+
return !(t && Sw(t.getFilterFn(), e.value, t));
|
|
19637
20332
|
}));
|
|
19638
20333
|
}, e.resetColumnFilters = (t) => {
|
|
19639
20334
|
e.setColumnFilters(t ? [] : e.initialState?.columnFilters ?? []);
|
|
19640
20335
|
}, e.getPreFilteredRowModel = () => e.getCoreRowModel(), e.getFilteredRowModel = () => (!e._getFilteredRowModel && e.options.getFilteredRowModel && (e._getFilteredRowModel = e.options.getFilteredRowModel(e)), e.options.manualFiltering || !e._getFilteredRowModel ? e.getPreFilteredRowModel() : e._getFilteredRowModel());
|
|
19641
20336
|
}
|
|
19642
20337
|
};
|
|
19643
|
-
function
|
|
20338
|
+
function Sw(e, t, n) {
|
|
19644
20339
|
return (e && e.autoRemove ? e.autoRemove(t, n) : !1) || t === void 0 || typeof t == "string" && !t;
|
|
19645
20340
|
}
|
|
19646
|
-
var
|
|
20341
|
+
var Cw = {
|
|
19647
20342
|
sum: (e, t, n) => n.reduce((t, n) => {
|
|
19648
20343
|
let r = n.getValue(e);
|
|
19649
20344
|
return t + (typeof r == "number" ? r : 0);
|
|
@@ -19679,7 +20374,7 @@ var fC = {
|
|
|
19679
20374
|
median: (e, t) => {
|
|
19680
20375
|
if (!t.length) return;
|
|
19681
20376
|
let n = t.map((t) => t.getValue(e));
|
|
19682
|
-
if (!
|
|
20377
|
+
if (!ew(n)) return;
|
|
19683
20378
|
if (n.length === 1) return n[0];
|
|
19684
20379
|
let r = Math.floor(n.length / 2), i = n.sort((e, t) => e - t);
|
|
19685
20380
|
return n.length % 2 == 0 ? (i[r - 1] + i[r]) / 2 : i[r];
|
|
@@ -19687,7 +20382,7 @@ var fC = {
|
|
|
19687
20382
|
unique: (e, t) => Array.from(new Set(t.map((t) => t.getValue(e))).values()),
|
|
19688
20383
|
uniqueCount: (e, t) => new Set(t.map((t) => t.getValue(e))).size,
|
|
19689
20384
|
count: (e, t) => t.length
|
|
19690
|
-
},
|
|
20385
|
+
}, ww = {
|
|
19691
20386
|
getDefaultColumnDef: () => ({
|
|
19692
20387
|
aggregatedCell: (e) => {
|
|
19693
20388
|
var t;
|
|
@@ -19700,7 +20395,7 @@ var fC = {
|
|
|
19700
20395
|
...e
|
|
19701
20396
|
}),
|
|
19702
20397
|
getDefaultOptions: (e) => ({
|
|
19703
|
-
onGroupingChange:
|
|
20398
|
+
onGroupingChange: QC("grouping", e),
|
|
19704
20399
|
groupedColumnMode: "reorder"
|
|
19705
20400
|
}),
|
|
19706
20401
|
createColumn: (e, t) => {
|
|
@@ -19713,11 +20408,11 @@ var fC = {
|
|
|
19713
20408
|
};
|
|
19714
20409
|
}, e.getAutoAggregationFn = () => {
|
|
19715
20410
|
let n = t.getCoreRowModel().flatRows[0]?.getValue(e.id);
|
|
19716
|
-
if (typeof n == "number") return
|
|
19717
|
-
if (Object.prototype.toString.call(n) === "[object Date]") return
|
|
20411
|
+
if (typeof n == "number") return Cw.sum;
|
|
20412
|
+
if (Object.prototype.toString.call(n) === "[object Date]") return Cw.extent;
|
|
19718
20413
|
}, e.getAggregationFn = () => {
|
|
19719
20414
|
if (!e) throw Error();
|
|
19720
|
-
return
|
|
20415
|
+
return $C(e.columnDef.aggregationFn) ? e.columnDef.aggregationFn : e.columnDef.aggregationFn === "auto" ? e.getAutoAggregationFn() : t.options.aggregationFns?.[e.columnDef.aggregationFn] ?? Cw[e.columnDef.aggregationFn];
|
|
19721
20416
|
};
|
|
19722
20417
|
},
|
|
19723
20418
|
createTable: (e) => {
|
|
@@ -19739,20 +20434,20 @@ var fC = {
|
|
|
19739
20434
|
};
|
|
19740
20435
|
}
|
|
19741
20436
|
};
|
|
19742
|
-
function
|
|
20437
|
+
function Tw(e, t, n) {
|
|
19743
20438
|
if (!(t != null && t.length) || !n) return e;
|
|
19744
20439
|
let r = e.filter((e) => !t.includes(e.id));
|
|
19745
20440
|
return n === "remove" ? r : [...t.map((t) => e.find((e) => e.id === t)).filter(Boolean), ...r];
|
|
19746
20441
|
}
|
|
19747
|
-
var
|
|
20442
|
+
var Ew = {
|
|
19748
20443
|
getInitialState: (e) => ({
|
|
19749
20444
|
columnOrder: [],
|
|
19750
20445
|
...e
|
|
19751
20446
|
}),
|
|
19752
|
-
getDefaultOptions: (e) => ({ onColumnOrderChange:
|
|
20447
|
+
getDefaultOptions: (e) => ({ onColumnOrderChange: QC("columnOrder", e) }),
|
|
19753
20448
|
createColumn: (e, t) => {
|
|
19754
|
-
e.getIndex = Q((e) => [
|
|
19755
|
-
let r =
|
|
20449
|
+
e.getIndex = Q((e) => [Lw(t, e)], (t) => t.findIndex((t) => t.id === e.id), $(t.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (n) => Lw(t, n)[0]?.id === e.id, e.getIsLastColumn = (n) => {
|
|
20450
|
+
let r = Lw(t, n);
|
|
19756
20451
|
return r[r.length - 1]?.id === e.id;
|
|
19757
20452
|
};
|
|
19758
20453
|
},
|
|
@@ -19774,18 +20469,18 @@ var hC = {
|
|
|
19774
20469
|
}
|
|
19775
20470
|
i = [...i, ...n];
|
|
19776
20471
|
}
|
|
19777
|
-
return
|
|
20472
|
+
return Tw(i, t, n);
|
|
19778
20473
|
}, $(e.options, "debugTable", "_getOrderColumnsFn"));
|
|
19779
20474
|
}
|
|
19780
|
-
},
|
|
20475
|
+
}, Dw = () => ({
|
|
19781
20476
|
left: [],
|
|
19782
20477
|
right: []
|
|
19783
|
-
}),
|
|
20478
|
+
}), Ow = {
|
|
19784
20479
|
getInitialState: (e) => ({
|
|
19785
|
-
columnPinning:
|
|
20480
|
+
columnPinning: Dw(),
|
|
19786
20481
|
...e
|
|
19787
20482
|
}),
|
|
19788
|
-
getDefaultOptions: (e) => ({ onColumnPinningChange:
|
|
20483
|
+
getDefaultOptions: (e) => ({ onColumnPinningChange: QC("columnPinning", e) }),
|
|
19789
20484
|
createColumn: (e, t) => {
|
|
19790
20485
|
e.pin = (n) => {
|
|
19791
20486
|
let r = e.getLeafColumns().map((e) => e.id).filter(Boolean);
|
|
@@ -19825,7 +20520,7 @@ var hC = {
|
|
|
19825
20520
|
})), $(t.options, "debugRows", "getRightVisibleCells"));
|
|
19826
20521
|
},
|
|
19827
20522
|
createTable: (e) => {
|
|
19828
|
-
e.setColumnPinning = (t) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(t), e.resetColumnPinning = (t) => e.setColumnPinning(t ?
|
|
20523
|
+
e.setColumnPinning = (t) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(t), e.resetColumnPinning = (t) => e.setColumnPinning(t ? Dw() : e.initialState?.columnPinning ?? Dw()), e.getIsSomeColumnsPinned = (t) => {
|
|
19829
20524
|
let n = e.getState().columnPinning;
|
|
19830
20525
|
return t ? !!n[t]?.length : !!(n.left?.length || n.right?.length);
|
|
19831
20526
|
}, e.getLeftLeafColumns = Q(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (e, t) => (t ?? []).map((t) => e.find((e) => e.id === t)).filter(Boolean), $(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = Q(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (e, t) => (t ?? []).map((t) => e.find((e) => e.id === t)).filter(Boolean), $(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = Q(() => [
|
|
@@ -19838,44 +20533,44 @@ var hC = {
|
|
|
19838
20533
|
}, $(e.options, "debugColumns", "getCenterLeafColumns"));
|
|
19839
20534
|
}
|
|
19840
20535
|
};
|
|
19841
|
-
function
|
|
20536
|
+
function kw(e) {
|
|
19842
20537
|
return e || (typeof document < "u" ? document : null);
|
|
19843
20538
|
}
|
|
19844
|
-
var
|
|
20539
|
+
var Aw = {
|
|
19845
20540
|
size: 150,
|
|
19846
20541
|
minSize: 20,
|
|
19847
20542
|
maxSize: 2 ** 53 - 1
|
|
19848
|
-
},
|
|
20543
|
+
}, jw = () => ({
|
|
19849
20544
|
startOffset: null,
|
|
19850
20545
|
startSize: null,
|
|
19851
20546
|
deltaOffset: null,
|
|
19852
20547
|
deltaPercentage: null,
|
|
19853
20548
|
isResizingColumn: !1,
|
|
19854
20549
|
columnSizingStart: []
|
|
19855
|
-
}),
|
|
19856
|
-
getDefaultColumnDef: () =>
|
|
20550
|
+
}), Mw = {
|
|
20551
|
+
getDefaultColumnDef: () => Aw,
|
|
19857
20552
|
getInitialState: (e) => ({
|
|
19858
20553
|
columnSizing: {},
|
|
19859
|
-
columnSizingInfo:
|
|
20554
|
+
columnSizingInfo: jw(),
|
|
19860
20555
|
...e
|
|
19861
20556
|
}),
|
|
19862
20557
|
getDefaultOptions: (e) => ({
|
|
19863
20558
|
columnResizeMode: "onEnd",
|
|
19864
20559
|
columnResizeDirection: "ltr",
|
|
19865
|
-
onColumnSizingChange:
|
|
19866
|
-
onColumnSizingInfoChange:
|
|
20560
|
+
onColumnSizingChange: QC("columnSizing", e),
|
|
20561
|
+
onColumnSizingInfoChange: QC("columnSizingInfo", e)
|
|
19867
20562
|
}),
|
|
19868
20563
|
createColumn: (e, t) => {
|
|
19869
20564
|
e.getSize = () => {
|
|
19870
20565
|
let n = t.getState().columnSizing[e.id];
|
|
19871
|
-
return Math.min(Math.max(e.columnDef.minSize ??
|
|
20566
|
+
return Math.min(Math.max(e.columnDef.minSize ?? Aw.minSize, n ?? e.columnDef.size ?? Aw.size), e.columnDef.maxSize ?? Aw.maxSize);
|
|
19872
20567
|
}, e.getStart = Q((e) => [
|
|
19873
20568
|
e,
|
|
19874
|
-
|
|
20569
|
+
Lw(t, e),
|
|
19875
20570
|
t.getState().columnSizing
|
|
19876
20571
|
], (t, n) => n.slice(0, e.getIndex(t)).reduce((e, t) => e + t.getSize(), 0), $(t.options, "debugColumns", "getStart")), e.getAfter = Q((e) => [
|
|
19877
20572
|
e,
|
|
19878
|
-
|
|
20573
|
+
Lw(t, e),
|
|
19879
20574
|
t.getState().columnSizing
|
|
19880
20575
|
], (t, n) => n.slice(e.getIndex(t) + 1).reduce((e, t) => e + t.getSize(), 0), $(t.options, "debugColumns", "getAfter")), e.resetSize = () => {
|
|
19881
20576
|
t.setColumnSizing((t) => {
|
|
@@ -19899,8 +20594,8 @@ var yC = {
|
|
|
19899
20594
|
}, e.getResizeHandler = (n) => {
|
|
19900
20595
|
let r = t.getColumn(e.column.id), i = r?.getCanResize();
|
|
19901
20596
|
return (a) => {
|
|
19902
|
-
if (!r || !i || (a.persist == null || a.persist(),
|
|
19903
|
-
let o = e.getSize(), s = e ? e.getLeafHeaders().map((e) => [e.column.id, e.column.getSize()]) : [[r.id, r.getSize()]], c =
|
|
20597
|
+
if (!r || !i || (a.persist == null || a.persist(), Fw(a) && a.touches && a.touches.length > 1)) return;
|
|
20598
|
+
let o = e.getSize(), s = e ? e.getLeafHeaders().map((e) => [e.column.id, e.column.getSize()]) : [[r.id, r.getSize()]], c = Fw(a) ? Math.round(a.touches[0].clientX) : a.clientX, l = {}, u = (e, n) => {
|
|
19904
20599
|
typeof n == "number" && (t.setColumnSizingInfo((e) => {
|
|
19905
20600
|
let r = t.options.columnResizeDirection === "rtl" ? -1 : 1, i = (n - (e?.startOffset ?? 0)) * r, a = Math.max(i / (e?.startSize ?? 0), -.999999);
|
|
19906
20601
|
return e.columnSizingStart.forEach((e) => {
|
|
@@ -19925,7 +20620,7 @@ var yC = {
|
|
|
19925
20620
|
deltaPercentage: null,
|
|
19926
20621
|
columnSizingStart: []
|
|
19927
20622
|
}));
|
|
19928
|
-
}, p =
|
|
20623
|
+
}, p = kw(n), m = {
|
|
19929
20624
|
moveHandler: (e) => d(e.clientX),
|
|
19930
20625
|
upHandler: (e) => {
|
|
19931
20626
|
p?.removeEventListener("mousemove", m.moveHandler), p?.removeEventListener("mouseup", m.upHandler), f(e.clientX);
|
|
@@ -19935,8 +20630,8 @@ var yC = {
|
|
|
19935
20630
|
upHandler: (e) => {
|
|
19936
20631
|
p?.removeEventListener("touchmove", h.moveHandler), p?.removeEventListener("touchend", h.upHandler), e.cancelable && (e.preventDefault(), e.stopPropagation()), f(e.touches[0]?.clientX);
|
|
19937
20632
|
}
|
|
19938
|
-
}, g =
|
|
19939
|
-
|
|
20633
|
+
}, g = Pw() ? { passive: !1 } : !1;
|
|
20634
|
+
Fw(a) ? (p?.addEventListener("touchmove", h.moveHandler, g), p?.addEventListener("touchend", h.upHandler, g)) : (p?.addEventListener("mousemove", m.moveHandler, g), p?.addEventListener("mouseup", m.upHandler, g)), t.setColumnSizingInfo((e) => ({
|
|
19940
20635
|
...e,
|
|
19941
20636
|
startOffset: c,
|
|
19942
20637
|
startSize: o,
|
|
@@ -19952,12 +20647,12 @@ var yC = {
|
|
|
19952
20647
|
e.setColumnSizing = (t) => e.options.onColumnSizingChange == null ? void 0 : e.options.onColumnSizingChange(t), e.setColumnSizingInfo = (t) => e.options.onColumnSizingInfoChange == null ? void 0 : e.options.onColumnSizingInfoChange(t), e.resetColumnSizing = (t) => {
|
|
19953
20648
|
e.setColumnSizing(t ? {} : e.initialState.columnSizing ?? {});
|
|
19954
20649
|
}, e.resetHeaderSizeInfo = (t) => {
|
|
19955
|
-
e.setColumnSizingInfo(t ?
|
|
20650
|
+
e.setColumnSizingInfo(t ? jw() : e.initialState.columnSizingInfo ?? jw());
|
|
19956
20651
|
}, e.getTotalSize = () => e.getHeaderGroups()[0]?.headers.reduce((e, t) => e + t.getSize(), 0) ?? 0, e.getLeftTotalSize = () => e.getLeftHeaderGroups()[0]?.headers.reduce((e, t) => e + t.getSize(), 0) ?? 0, e.getCenterTotalSize = () => e.getCenterHeaderGroups()[0]?.headers.reduce((e, t) => e + t.getSize(), 0) ?? 0, e.getRightTotalSize = () => e.getRightHeaderGroups()[0]?.headers.reduce((e, t) => e + t.getSize(), 0) ?? 0;
|
|
19957
20652
|
}
|
|
19958
|
-
},
|
|
19959
|
-
function
|
|
19960
|
-
if (typeof
|
|
20653
|
+
}, Nw = null;
|
|
20654
|
+
function Pw() {
|
|
20655
|
+
if (typeof Nw == "boolean") return Nw;
|
|
19961
20656
|
let e = !1;
|
|
19962
20657
|
try {
|
|
19963
20658
|
let t = { get passive() {
|
|
@@ -19967,17 +20662,17 @@ function CC() {
|
|
|
19967
20662
|
} catch {
|
|
19968
20663
|
e = !1;
|
|
19969
20664
|
}
|
|
19970
|
-
return
|
|
20665
|
+
return Nw = e, Nw;
|
|
19971
20666
|
}
|
|
19972
|
-
function
|
|
20667
|
+
function Fw(e) {
|
|
19973
20668
|
return e.type === "touchstart";
|
|
19974
20669
|
}
|
|
19975
|
-
var
|
|
20670
|
+
var Iw = {
|
|
19976
20671
|
getInitialState: (e) => ({
|
|
19977
20672
|
columnVisibility: {},
|
|
19978
20673
|
...e
|
|
19979
20674
|
}),
|
|
19980
|
-
getDefaultOptions: (e) => ({ onColumnVisibilityChange:
|
|
20675
|
+
getDefaultOptions: (e) => ({ onColumnVisibilityChange: QC("columnVisibility", e) }),
|
|
19981
20676
|
createColumn: (e, t) => {
|
|
19982
20677
|
e.toggleVisibility = (n) => {
|
|
19983
20678
|
e.getCanHide() && t.setColumnVisibility((t) => ({
|
|
@@ -20016,20 +20711,20 @@ var TC = {
|
|
|
20016
20711
|
};
|
|
20017
20712
|
}
|
|
20018
20713
|
};
|
|
20019
|
-
function
|
|
20714
|
+
function Lw(e, t) {
|
|
20020
20715
|
return t ? t === "center" ? e.getCenterVisibleLeafColumns() : t === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
|
|
20021
20716
|
}
|
|
20022
|
-
var
|
|
20717
|
+
var Rw = { createTable: (e) => {
|
|
20023
20718
|
e._getGlobalFacetedRowModel = e.options.getFacetedRowModel && e.options.getFacetedRowModel(e, "__global__"), e.getGlobalFacetedRowModel = () => e.options.manualFiltering || !e._getGlobalFacetedRowModel ? e.getPreFilteredRowModel() : e._getGlobalFacetedRowModel(), e._getGlobalFacetedUniqueValues = e.options.getFacetedUniqueValues && e.options.getFacetedUniqueValues(e, "__global__"), e.getGlobalFacetedUniqueValues = () => e._getGlobalFacetedUniqueValues ? e._getGlobalFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getGlobalFacetedMinMaxValues = e.options.getFacetedMinMaxValues && e.options.getFacetedMinMaxValues(e, "__global__"), e.getGlobalFacetedMinMaxValues = () => {
|
|
20024
20719
|
if (e._getGlobalFacetedMinMaxValues) return e._getGlobalFacetedMinMaxValues();
|
|
20025
20720
|
};
|
|
20026
|
-
} },
|
|
20721
|
+
} }, zw = {
|
|
20027
20722
|
getInitialState: (e) => ({
|
|
20028
20723
|
globalFilter: void 0,
|
|
20029
20724
|
...e
|
|
20030
20725
|
}),
|
|
20031
20726
|
getDefaultOptions: (e) => ({
|
|
20032
|
-
onGlobalFilterChange:
|
|
20727
|
+
onGlobalFilterChange: QC("globalFilter", e),
|
|
20033
20728
|
globalFilterFn: "auto",
|
|
20034
20729
|
getColumnCanGlobalFilter: (t) => {
|
|
20035
20730
|
var n;
|
|
@@ -20041,22 +20736,22 @@ var DC = { createTable: (e) => {
|
|
|
20041
20736
|
e.getCanGlobalFilter = () => (e.columnDef.enableGlobalFilter ?? !0) && (t.options.enableGlobalFilter ?? !0) && (t.options.enableFilters ?? !0) && ((t.options.getColumnCanGlobalFilter == null ? void 0 : t.options.getColumnCanGlobalFilter(e)) ?? !0) && !!e.accessorFn;
|
|
20042
20737
|
},
|
|
20043
20738
|
createTable: (e) => {
|
|
20044
|
-
e.getGlobalAutoFilterFn = () =>
|
|
20739
|
+
e.getGlobalAutoFilterFn = () => yw.includesString, e.getGlobalFilterFn = () => {
|
|
20045
20740
|
let { globalFilterFn: t } = e.options;
|
|
20046
|
-
return
|
|
20741
|
+
return $C(t) ? t : t === "auto" ? e.getGlobalAutoFilterFn() : e.options.filterFns?.[t] ?? yw[t];
|
|
20047
20742
|
}, e.setGlobalFilter = (t) => {
|
|
20048
20743
|
e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(t);
|
|
20049
20744
|
}, e.resetGlobalFilter = (t) => {
|
|
20050
20745
|
e.setGlobalFilter(t ? void 0 : e.initialState.globalFilter);
|
|
20051
20746
|
};
|
|
20052
20747
|
}
|
|
20053
|
-
},
|
|
20748
|
+
}, Bw = {
|
|
20054
20749
|
getInitialState: (e) => ({
|
|
20055
20750
|
expanded: {},
|
|
20056
20751
|
...e
|
|
20057
20752
|
}),
|
|
20058
20753
|
getDefaultOptions: (e) => ({
|
|
20059
|
-
onExpandedChange:
|
|
20754
|
+
onExpandedChange: QC("expanded", e),
|
|
20060
20755
|
paginateExpandedRows: !0
|
|
20061
20756
|
}),
|
|
20062
20757
|
createTable: (e) => {
|
|
@@ -20127,18 +20822,18 @@ var DC = { createTable: (e) => {
|
|
|
20127
20822
|
};
|
|
20128
20823
|
};
|
|
20129
20824
|
}
|
|
20130
|
-
},
|
|
20131
|
-
pageIndex:
|
|
20132
|
-
pageSize:
|
|
20133
|
-
}),
|
|
20825
|
+
}, Vw = 0, Hw = 10, Uw = () => ({
|
|
20826
|
+
pageIndex: Vw,
|
|
20827
|
+
pageSize: Hw
|
|
20828
|
+
}), Ww = {
|
|
20134
20829
|
getInitialState: (e) => ({
|
|
20135
20830
|
...e,
|
|
20136
20831
|
pagination: {
|
|
20137
|
-
...
|
|
20832
|
+
...Uw(),
|
|
20138
20833
|
...e?.pagination
|
|
20139
20834
|
}
|
|
20140
20835
|
}),
|
|
20141
|
-
getDefaultOptions: (e) => ({ onPaginationChange:
|
|
20836
|
+
getDefaultOptions: (e) => ({ onPaginationChange: QC("pagination", e) }),
|
|
20142
20837
|
createTable: (e) => {
|
|
20143
20838
|
let t = !1, n = !1;
|
|
20144
20839
|
e._autoResetPageIndex = () => {
|
|
@@ -20154,11 +20849,11 @@ var DC = { createTable: (e) => {
|
|
|
20154
20849
|
e.resetPageIndex(), n = !1;
|
|
20155
20850
|
});
|
|
20156
20851
|
}
|
|
20157
|
-
}, e.setPagination = (t) => e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange((e) =>
|
|
20158
|
-
e.setPagination(t ?
|
|
20852
|
+
}, e.setPagination = (t) => e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange((e) => ZC(t, e)), e.resetPagination = (t) => {
|
|
20853
|
+
e.setPagination(t ? Uw() : e.initialState.pagination ?? Uw());
|
|
20159
20854
|
}, e.setPageIndex = (t) => {
|
|
20160
20855
|
e.setPagination((n) => {
|
|
20161
|
-
let r =
|
|
20856
|
+
let r = ZC(t, n.pageIndex), i = e.options.pageCount === void 0 || e.options.pageCount === -1 ? 2 ** 53 - 1 : e.options.pageCount - 1;
|
|
20162
20857
|
return r = Math.max(0, Math.min(r, i)), {
|
|
20163
20858
|
...n,
|
|
20164
20859
|
pageIndex: r
|
|
@@ -20166,13 +20861,13 @@ var DC = { createTable: (e) => {
|
|
|
20166
20861
|
});
|
|
20167
20862
|
}, e.resetPageIndex = (t) => {
|
|
20168
20863
|
var n;
|
|
20169
|
-
e.setPageIndex(t ?
|
|
20864
|
+
e.setPageIndex(t ? Vw : ((n = e.initialState) == null || (n = n.pagination) == null ? void 0 : n.pageIndex) ?? Vw);
|
|
20170
20865
|
}, e.resetPageSize = (t) => {
|
|
20171
20866
|
var n;
|
|
20172
|
-
e.setPageSize(t ?
|
|
20867
|
+
e.setPageSize(t ? Hw : ((n = e.initialState) == null || (n = n.pagination) == null ? void 0 : n.pageSize) ?? Hw);
|
|
20173
20868
|
}, e.setPageSize = (t) => {
|
|
20174
20869
|
e.setPagination((e) => {
|
|
20175
|
-
let n = Math.max(1,
|
|
20870
|
+
let n = Math.max(1, ZC(t, e.pageSize)), r = e.pageSize * e.pageIndex, i = Math.floor(r / n);
|
|
20176
20871
|
return {
|
|
20177
20872
|
...e,
|
|
20178
20873
|
pageIndex: i,
|
|
@@ -20180,7 +20875,7 @@ var DC = { createTable: (e) => {
|
|
|
20180
20875
|
};
|
|
20181
20876
|
});
|
|
20182
20877
|
}, e.setPageCount = (t) => e.setPagination((n) => {
|
|
20183
|
-
let r =
|
|
20878
|
+
let r = ZC(t, e.options.pageCount ?? -1);
|
|
20184
20879
|
return typeof r == "number" && (r = Math.max(-1, r)), {
|
|
20185
20880
|
...n,
|
|
20186
20881
|
pageCount: r
|
|
@@ -20193,15 +20888,15 @@ var DC = { createTable: (e) => {
|
|
|
20193
20888
|
return n === -1 ? !0 : n === 0 ? !1 : t < n - 1;
|
|
20194
20889
|
}, e.previousPage = () => e.setPageIndex((e) => e - 1), e.nextPage = () => e.setPageIndex((e) => e + 1), e.firstPage = () => e.setPageIndex(0), e.lastPage = () => e.setPageIndex(e.getPageCount() - 1), e.getPrePaginationRowModel = () => e.getExpandedRowModel(), e.getPaginationRowModel = () => (!e._getPaginationRowModel && e.options.getPaginationRowModel && (e._getPaginationRowModel = e.options.getPaginationRowModel(e)), e.options.manualPagination || !e._getPaginationRowModel ? e.getPrePaginationRowModel() : e._getPaginationRowModel()), e.getPageCount = () => e.options.pageCount ?? Math.ceil(e.getRowCount() / e.getState().pagination.pageSize), e.getRowCount = () => e.options.rowCount ?? e.getPrePaginationRowModel().rows.length;
|
|
20195
20890
|
}
|
|
20196
|
-
},
|
|
20891
|
+
}, Gw = () => ({
|
|
20197
20892
|
top: [],
|
|
20198
20893
|
bottom: []
|
|
20199
|
-
}),
|
|
20894
|
+
}), Kw = {
|
|
20200
20895
|
getInitialState: (e) => ({
|
|
20201
|
-
rowPinning:
|
|
20896
|
+
rowPinning: Gw(),
|
|
20202
20897
|
...e
|
|
20203
20898
|
}),
|
|
20204
|
-
getDefaultOptions: (e) => ({ onRowPinningChange:
|
|
20899
|
+
getDefaultOptions: (e) => ({ onRowPinningChange: QC("rowPinning", e) }),
|
|
20205
20900
|
createRow: (e, t) => {
|
|
20206
20901
|
e.pin = (n, r, i) => {
|
|
20207
20902
|
let a = r ? e.getLeafRows().map((e) => {
|
|
@@ -20240,7 +20935,7 @@ var DC = { createTable: (e) => {
|
|
|
20240
20935
|
};
|
|
20241
20936
|
},
|
|
20242
20937
|
createTable: (e) => {
|
|
20243
|
-
e.setRowPinning = (t) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(t), e.resetRowPinning = (t) => e.setRowPinning(t ?
|
|
20938
|
+
e.setRowPinning = (t) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(t), e.resetRowPinning = (t) => e.setRowPinning(t ? Gw() : e.initialState?.rowPinning ?? Gw()), e.getIsSomeRowsPinned = (t) => {
|
|
20244
20939
|
let n = e.getState().rowPinning;
|
|
20245
20940
|
return t ? !!n[t]?.length : !!(n.top?.length || n.bottom?.length);
|
|
20246
20941
|
}, e._getPinnedRows = (t, n, r) => (e.options.keepPinnedRows ?? !0 ? (n ?? []).map((t) => {
|
|
@@ -20258,13 +20953,13 @@ var DC = { createTable: (e) => {
|
|
|
20258
20953
|
return e.filter((e) => !r.has(e.id));
|
|
20259
20954
|
}, $(e.options, "debugRows", "getCenterRows"));
|
|
20260
20955
|
}
|
|
20261
|
-
},
|
|
20956
|
+
}, qw = {
|
|
20262
20957
|
getInitialState: (e) => ({
|
|
20263
20958
|
rowSelection: {},
|
|
20264
20959
|
...e
|
|
20265
20960
|
}),
|
|
20266
20961
|
getDefaultOptions: (e) => ({
|
|
20267
|
-
onRowSelectionChange:
|
|
20962
|
+
onRowSelectionChange: QC("rowSelection", e),
|
|
20268
20963
|
enableRowSelection: !0,
|
|
20269
20964
|
enableMultiRowSelection: !0,
|
|
20270
20965
|
enableSubRowSelection: !0
|
|
@@ -20283,17 +20978,17 @@ var DC = { createTable: (e) => {
|
|
|
20283
20978
|
}, e.toggleAllPageRowsSelected = (t) => e.setRowSelection((n) => {
|
|
20284
20979
|
let r = t === void 0 ? !e.getIsAllPageRowsSelected() : t, i = { ...n };
|
|
20285
20980
|
return e.getRowModel().rows.forEach((t) => {
|
|
20286
|
-
|
|
20981
|
+
Jw(i, t.id, r, !0, e);
|
|
20287
20982
|
}), i;
|
|
20288
|
-
}), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = Q(() => [e.getState().rowSelection, e.getCoreRowModel()], (t, n) => Object.keys(t).length ?
|
|
20983
|
+
}), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = Q(() => [e.getState().rowSelection, e.getCoreRowModel()], (t, n) => Object.keys(t).length ? Yw(e, n) : {
|
|
20289
20984
|
rows: [],
|
|
20290
20985
|
flatRows: [],
|
|
20291
20986
|
rowsById: {}
|
|
20292
|
-
}, $(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = Q(() => [e.getState().rowSelection, e.getFilteredRowModel()], (t, n) => Object.keys(t).length ?
|
|
20987
|
+
}, $(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = Q(() => [e.getState().rowSelection, e.getFilteredRowModel()], (t, n) => Object.keys(t).length ? Yw(e, n) : {
|
|
20293
20988
|
rows: [],
|
|
20294
20989
|
flatRows: [],
|
|
20295
20990
|
rowsById: {}
|
|
20296
|
-
}, $(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = Q(() => [e.getState().rowSelection, e.getSortedRowModel()], (t, n) => Object.keys(t).length ?
|
|
20991
|
+
}, $(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = Q(() => [e.getState().rowSelection, e.getSortedRowModel()], (t, n) => Object.keys(t).length ? Yw(e, n) : {
|
|
20297
20992
|
rows: [],
|
|
20298
20993
|
flatRows: [],
|
|
20299
20994
|
rowsById: {}
|
|
@@ -20321,17 +21016,17 @@ var DC = { createTable: (e) => {
|
|
|
20321
21016
|
t.setRowSelection((a) => {
|
|
20322
21017
|
if (n = n === void 0 ? !i : n, e.getCanSelect() && i === n) return a;
|
|
20323
21018
|
let o = { ...a };
|
|
20324
|
-
return
|
|
21019
|
+
return Jw(o, e.id, n, r?.selectChildren ?? !0, t), o;
|
|
20325
21020
|
});
|
|
20326
21021
|
}, e.getIsSelected = () => {
|
|
20327
21022
|
let { rowSelection: n } = t.getState();
|
|
20328
|
-
return
|
|
21023
|
+
return Xw(e, n);
|
|
20329
21024
|
}, e.getIsSomeSelected = () => {
|
|
20330
21025
|
let { rowSelection: n } = t.getState();
|
|
20331
|
-
return
|
|
21026
|
+
return Zw(e, n) === "some";
|
|
20332
21027
|
}, e.getIsAllSubRowsSelected = () => {
|
|
20333
21028
|
let { rowSelection: n } = t.getState();
|
|
20334
|
-
return
|
|
21029
|
+
return Zw(e, n) === "all";
|
|
20335
21030
|
}, e.getCanSelect = () => typeof t.options.enableRowSelection == "function" ? t.options.enableRowSelection(e) : t.options.enableRowSelection ?? !0, e.getCanSelectSubRows = () => typeof t.options.enableSubRowSelection == "function" ? t.options.enableSubRowSelection(e) : t.options.enableSubRowSelection ?? !0, e.getCanMultiSelect = () => typeof t.options.enableMultiRowSelection == "function" ? t.options.enableMultiRowSelection(e) : t.options.enableMultiRowSelection ?? !0, e.getToggleSelectedHandler = () => {
|
|
20336
21031
|
let t = e.getCanSelect();
|
|
20337
21032
|
return (n) => {
|
|
@@ -20339,16 +21034,16 @@ var DC = { createTable: (e) => {
|
|
|
20339
21034
|
};
|
|
20340
21035
|
};
|
|
20341
21036
|
}
|
|
20342
|
-
},
|
|
21037
|
+
}, Jw = (e, t, n, r, i) => {
|
|
20343
21038
|
var a;
|
|
20344
21039
|
let o = i.getRow(t, !0);
|
|
20345
|
-
n ? (o.getCanMultiSelect() || Object.keys(e).forEach((t) => delete e[t]), o.getCanSelect() && (e[t] = !0)) : delete e[t], r && (a = o.subRows) != null && a.length && o.getCanSelectSubRows() && o.subRows.forEach((t) =>
|
|
21040
|
+
n ? (o.getCanMultiSelect() || Object.keys(e).forEach((t) => delete e[t]), o.getCanSelect() && (e[t] = !0)) : delete e[t], r && (a = o.subRows) != null && a.length && o.getCanSelectSubRows() && o.subRows.forEach((t) => Jw(e, t.id, n, r, i));
|
|
20346
21041
|
};
|
|
20347
|
-
function
|
|
21042
|
+
function Yw(e, t) {
|
|
20348
21043
|
let n = e.getState().rowSelection, r = [], i = {}, a = function(e, t) {
|
|
20349
21044
|
return e.map((e) => {
|
|
20350
21045
|
var t;
|
|
20351
|
-
let o =
|
|
21046
|
+
let o = Xw(e, n);
|
|
20352
21047
|
if (o && (r.push(e), i[e.id] = e), (t = e.subRows) != null && t.length && (e = {
|
|
20353
21048
|
...e,
|
|
20354
21049
|
subRows: a(e.subRows)
|
|
@@ -20361,32 +21056,32 @@ function RC(e, t) {
|
|
|
20361
21056
|
rowsById: i
|
|
20362
21057
|
};
|
|
20363
21058
|
}
|
|
20364
|
-
function
|
|
21059
|
+
function Xw(e, t) {
|
|
20365
21060
|
return t[e.id] ?? !1;
|
|
20366
21061
|
}
|
|
20367
|
-
function
|
|
21062
|
+
function Zw(e, t, n) {
|
|
20368
21063
|
var r;
|
|
20369
21064
|
if (!((r = e.subRows) != null && r.length)) return !1;
|
|
20370
21065
|
let i = !0, a = !1;
|
|
20371
21066
|
return e.subRows.forEach((e) => {
|
|
20372
|
-
if (!(a && !i) && (e.getCanSelect() && (
|
|
20373
|
-
let n =
|
|
21067
|
+
if (!(a && !i) && (e.getCanSelect() && (Xw(e, t) ? a = !0 : i = !1), e.subRows && e.subRows.length)) {
|
|
21068
|
+
let n = Zw(e, t);
|
|
20374
21069
|
n === "all" ? a = !0 : (n === "some" && (a = !0), i = !1);
|
|
20375
21070
|
}
|
|
20376
21071
|
}), i ? "all" : a ? "some" : !1;
|
|
20377
21072
|
}
|
|
20378
|
-
var
|
|
21073
|
+
var Qw = /([0-9]+)/gm, $w = (e, t, n) => sT(oT(e.getValue(n)).toLowerCase(), oT(t.getValue(n)).toLowerCase()), eT = (e, t, n) => sT(oT(e.getValue(n)), oT(t.getValue(n))), tT = (e, t, n) => aT(oT(e.getValue(n)).toLowerCase(), oT(t.getValue(n)).toLowerCase()), nT = (e, t, n) => aT(oT(e.getValue(n)), oT(t.getValue(n))), rT = (e, t, n) => {
|
|
20379
21074
|
let r = e.getValue(n), i = t.getValue(n);
|
|
20380
21075
|
return r > i ? 1 : r < i ? -1 : 0;
|
|
20381
|
-
},
|
|
20382
|
-
function
|
|
21076
|
+
}, iT = (e, t, n) => aT(e.getValue(n), t.getValue(n));
|
|
21077
|
+
function aT(e, t) {
|
|
20383
21078
|
return e === t ? 0 : e > t ? 1 : -1;
|
|
20384
21079
|
}
|
|
20385
|
-
function
|
|
21080
|
+
function oT(e) {
|
|
20386
21081
|
return typeof e == "number" ? isNaN(e) || e === Infinity || e === -Infinity ? "" : String(e) : typeof e == "string" ? e : "";
|
|
20387
21082
|
}
|
|
20388
|
-
function
|
|
20389
|
-
let n = e.split(
|
|
21083
|
+
function sT(e, t) {
|
|
21084
|
+
let n = e.split(Qw).filter(Boolean), r = t.split(Qw).filter(Boolean);
|
|
20390
21085
|
for (; n.length && r.length;) {
|
|
20391
21086
|
let e = n.shift(), t = r.shift(), i = parseInt(e, 10), a = parseInt(t, 10), o = [i, a].sort();
|
|
20392
21087
|
if (isNaN(o[0])) {
|
|
@@ -20400,22 +21095,22 @@ function XC(e, t) {
|
|
|
20400
21095
|
}
|
|
20401
21096
|
return n.length - r.length;
|
|
20402
21097
|
}
|
|
20403
|
-
var
|
|
20404
|
-
alphanumeric:
|
|
20405
|
-
alphanumericCaseSensitive:
|
|
20406
|
-
text:
|
|
20407
|
-
textCaseSensitive:
|
|
20408
|
-
datetime:
|
|
20409
|
-
basic:
|
|
20410
|
-
},
|
|
20411
|
-
|
|
20412
|
-
|
|
20413
|
-
|
|
20414
|
-
|
|
20415
|
-
|
|
20416
|
-
|
|
20417
|
-
|
|
20418
|
-
|
|
21098
|
+
var cT = {
|
|
21099
|
+
alphanumeric: $w,
|
|
21100
|
+
alphanumericCaseSensitive: eT,
|
|
21101
|
+
text: tT,
|
|
21102
|
+
textCaseSensitive: nT,
|
|
21103
|
+
datetime: rT,
|
|
21104
|
+
basic: iT
|
|
21105
|
+
}, lT = [
|
|
21106
|
+
ow,
|
|
21107
|
+
Iw,
|
|
21108
|
+
Ew,
|
|
21109
|
+
Ow,
|
|
21110
|
+
lw,
|
|
21111
|
+
xw,
|
|
21112
|
+
Rw,
|
|
21113
|
+
zw,
|
|
20419
21114
|
{
|
|
20420
21115
|
getInitialState: (e) => ({
|
|
20421
21116
|
sorting: [],
|
|
@@ -20426,7 +21121,7 @@ var ZC = {
|
|
|
20426
21121
|
sortUndefined: 1
|
|
20427
21122
|
}),
|
|
20428
21123
|
getDefaultOptions: (e) => ({
|
|
20429
|
-
onSortingChange:
|
|
21124
|
+
onSortingChange: QC("sorting", e),
|
|
20430
21125
|
isMultiSortEvent: (e) => e.shiftKey
|
|
20431
21126
|
}),
|
|
20432
21127
|
createColumn: (e, t) => {
|
|
@@ -20434,13 +21129,13 @@ var ZC = {
|
|
|
20434
21129
|
let n = t.getFilteredRowModel().flatRows.slice(10), r = !1;
|
|
20435
21130
|
for (let t of n) {
|
|
20436
21131
|
let n = t?.getValue(e.id);
|
|
20437
|
-
if (Object.prototype.toString.call(n) === "[object Date]") return
|
|
20438
|
-
if (typeof n == "string" && (r = !0, n.split(
|
|
21132
|
+
if (Object.prototype.toString.call(n) === "[object Date]") return cT.datetime;
|
|
21133
|
+
if (typeof n == "string" && (r = !0, n.split(Qw).length > 1)) return cT.alphanumeric;
|
|
20439
21134
|
}
|
|
20440
|
-
return r ?
|
|
21135
|
+
return r ? cT.text : cT.basic;
|
|
20441
21136
|
}, e.getAutoSortDir = () => typeof t.getFilteredRowModel().flatRows[0]?.getValue(e.id) == "string" ? "asc" : "desc", e.getSortingFn = () => {
|
|
20442
21137
|
if (!e) throw Error();
|
|
20443
|
-
return
|
|
21138
|
+
return $C(e.columnDef.sortingFn) ? e.columnDef.sortingFn : e.columnDef.sortingFn === "auto" ? e.getAutoSortingFn() : t.options.sortingFns?.[e.columnDef.sortingFn] ?? cT[e.columnDef.sortingFn];
|
|
20444
21139
|
}, e.toggleSorting = (n, r) => {
|
|
20445
21140
|
let i = e.getNextSortingOrder(), a = n != null;
|
|
20446
21141
|
t.setSorting((o) => {
|
|
@@ -20477,16 +21172,16 @@ var ZC = {
|
|
|
20477
21172
|
}, e.getPreSortedRowModel = () => e.getGroupedRowModel(), e.getSortedRowModel = () => (!e._getSortedRowModel && e.options.getSortedRowModel && (e._getSortedRowModel = e.options.getSortedRowModel(e)), e.options.manualSorting || !e._getSortedRowModel ? e.getPreSortedRowModel() : e._getSortedRowModel());
|
|
20478
21173
|
}
|
|
20479
21174
|
},
|
|
20480
|
-
|
|
20481
|
-
|
|
20482
|
-
|
|
20483
|
-
|
|
20484
|
-
|
|
20485
|
-
|
|
21175
|
+
ww,
|
|
21176
|
+
Bw,
|
|
21177
|
+
Ww,
|
|
21178
|
+
Kw,
|
|
21179
|
+
qw,
|
|
21180
|
+
Mw
|
|
20486
21181
|
];
|
|
20487
|
-
function
|
|
21182
|
+
function uT(e) {
|
|
20488
21183
|
process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
|
|
20489
|
-
let t = [...
|
|
21184
|
+
let t = [...lT, ...e._features ?? []], n = { _features: t }, r = n._features.reduce((e, t) => Object.assign(e, t.getDefaultOptions == null ? void 0 : t.getDefaultOptions(n)), {}), i = (e) => n.options.mergeOptions ? n.options.mergeOptions(r, e) : {
|
|
20490
21185
|
...r,
|
|
20491
21186
|
...e
|
|
20492
21187
|
}, a = { ...e.initialState ?? {} };
|
|
@@ -20512,7 +21207,7 @@ function $C(e) {
|
|
|
20512
21207
|
n.setState(n.initialState);
|
|
20513
21208
|
},
|
|
20514
21209
|
setOptions: (e) => {
|
|
20515
|
-
n.options = i(
|
|
21210
|
+
n.options = i(ZC(e, n.options));
|
|
20516
21211
|
},
|
|
20517
21212
|
getState: () => n.options.state,
|
|
20518
21213
|
setState: (e) => {
|
|
@@ -20542,7 +21237,7 @@ function $C(e) {
|
|
|
20542
21237
|
getAllColumns: Q(() => [n._getColumnDefs()], (e) => {
|
|
20543
21238
|
let t = function(e, r, i) {
|
|
20544
21239
|
return i === void 0 && (i = 0), e.map((e) => {
|
|
20545
|
-
let a =
|
|
21240
|
+
let a = rw(n, e, i, r), o = e;
|
|
20546
21241
|
return a.columns = o.columns ? t(o.columns, a, i + 1) : [], a;
|
|
20547
21242
|
});
|
|
20548
21243
|
};
|
|
@@ -20563,7 +21258,7 @@ function $C(e) {
|
|
|
20563
21258
|
}
|
|
20564
21259
|
return n;
|
|
20565
21260
|
}
|
|
20566
|
-
function
|
|
21261
|
+
function dT() {
|
|
20567
21262
|
return (e) => Q(() => [e.options.data], (t) => {
|
|
20568
21263
|
let n = {
|
|
20569
21264
|
rows: [],
|
|
@@ -20573,7 +21268,7 @@ function ew() {
|
|
|
20573
21268
|
i === void 0 && (i = 0);
|
|
20574
21269
|
let o = [];
|
|
20575
21270
|
for (let c = 0; c < t.length; c++) {
|
|
20576
|
-
let l =
|
|
21271
|
+
let l = cw(e, e._getRowId(t[c], c, a), t[c], c, i, void 0, a?.id);
|
|
20577
21272
|
if (n.flatRows.push(l), n.rowsById[l.id] = l, o.push(l), e.options.getSubRows) {
|
|
20578
21273
|
var s;
|
|
20579
21274
|
l.originalSubRows = e.options.getSubRows(t[c], c), (s = l.originalSubRows) != null && s.length && (l.subRows = r(l.originalSubRows, i + 1, l));
|
|
@@ -20584,7 +21279,7 @@ function ew() {
|
|
|
20584
21279
|
return n.rows = r(t), n;
|
|
20585
21280
|
}, $(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
|
|
20586
21281
|
}
|
|
20587
|
-
function
|
|
21282
|
+
function fT() {
|
|
20588
21283
|
return (e) => Q(() => [e.getState().sorting, e.getPreSortedRowModel()], (t, n) => {
|
|
20589
21284
|
if (!n.rows.length || !(t != null && t.length)) return n;
|
|
20590
21285
|
let r = e.getState().sorting, i = [], a = r.filter((t) => e.getColumn(t.id)?.getCanSort()), o = {};
|
|
@@ -20626,28 +21321,28 @@ function tw() {
|
|
|
20626
21321
|
}
|
|
20627
21322
|
//#endregion
|
|
20628
21323
|
//#region node_modules/@tanstack/react-table/build/lib/index.mjs
|
|
20629
|
-
function
|
|
20630
|
-
return e ?
|
|
21324
|
+
function pT(e, t) {
|
|
21325
|
+
return e ? mT(e) ? /* @__PURE__ */ p.createElement(e, t) : e : null;
|
|
20631
21326
|
}
|
|
20632
|
-
function
|
|
20633
|
-
return
|
|
21327
|
+
function mT(e) {
|
|
21328
|
+
return hT(e) || typeof e == "function" || gT(e);
|
|
20634
21329
|
}
|
|
20635
|
-
function
|
|
21330
|
+
function hT(e) {
|
|
20636
21331
|
return typeof e == "function" && (() => {
|
|
20637
21332
|
let t = Object.getPrototypeOf(e);
|
|
20638
21333
|
return t.prototype && t.prototype.isReactComponent;
|
|
20639
21334
|
})();
|
|
20640
21335
|
}
|
|
20641
|
-
function
|
|
21336
|
+
function gT(e) {
|
|
20642
21337
|
return typeof e == "object" && typeof e.$$typeof == "symbol" && ["react.memo", "react.forward_ref"].includes(e.$$typeof.description);
|
|
20643
21338
|
}
|
|
20644
|
-
function
|
|
21339
|
+
function _T(e) {
|
|
20645
21340
|
let t = {
|
|
20646
21341
|
state: {},
|
|
20647
21342
|
onStateChange: () => {},
|
|
20648
21343
|
renderFallbackValue: null,
|
|
20649
21344
|
...e
|
|
20650
|
-
}, [n] = p.useState(() => ({ current:
|
|
21345
|
+
}, [n] = p.useState(() => ({ current: uT(t) })), [r, i] = p.useState(() => n.current.initialState);
|
|
20651
21346
|
return n.current.setOptions((t) => ({
|
|
20652
21347
|
...t,
|
|
20653
21348
|
...e,
|
|
@@ -20661,39 +21356,75 @@ function ow(e) {
|
|
|
20661
21356
|
})), n.current;
|
|
20662
21357
|
}
|
|
20663
21358
|
//#endregion
|
|
21359
|
+
//#region src/components/WgDesignProvider/WgDesignProvider.tsx
|
|
21360
|
+
var vT = { table: {
|
|
21361
|
+
noResults: "No results found",
|
|
21362
|
+
filters: "Filters",
|
|
21363
|
+
filter: "Filter",
|
|
21364
|
+
dateRange: "Date range",
|
|
21365
|
+
selected: "selected",
|
|
21366
|
+
clear: "Clear",
|
|
21367
|
+
apply: "Apply",
|
|
21368
|
+
clearSearch: "Clear search",
|
|
21369
|
+
previous: "Previous",
|
|
21370
|
+
next: "Next",
|
|
21371
|
+
itemsPerPage: "per page",
|
|
21372
|
+
showingResults: ({ from: e, to: t, total: n }) => `Showing ${e}-${t} of ${n}`,
|
|
21373
|
+
sort: "Sort",
|
|
21374
|
+
sortBy: "Sort by",
|
|
21375
|
+
selectField: "Select field",
|
|
21376
|
+
sortDirection: "Sort direction",
|
|
21377
|
+
ascending: "Ascending",
|
|
21378
|
+
descending: "Descending",
|
|
21379
|
+
filterModalDescription: "Filter and sorting options"
|
|
21380
|
+
} }, yT = p.createContext(vT);
|
|
21381
|
+
function bT({ labels: e, children: t }) {
|
|
21382
|
+
let n = p.useMemo(() => ({ table: {
|
|
21383
|
+
...vT.table,
|
|
21384
|
+
...e?.table
|
|
21385
|
+
} }), [e]);
|
|
21386
|
+
return /* @__PURE__ */ D(yT.Provider, {
|
|
21387
|
+
value: n,
|
|
21388
|
+
children: t
|
|
21389
|
+
});
|
|
21390
|
+
}
|
|
21391
|
+
function xT() {
|
|
21392
|
+
return p.useContext(yT);
|
|
21393
|
+
}
|
|
21394
|
+
//#endregion
|
|
20664
21395
|
//#region src/components/Table/DataTableMobile.tsx
|
|
20665
|
-
var
|
|
20666
|
-
let n = (e) => e.columnDef.meta || {},
|
|
20667
|
-
if (!
|
|
20668
|
-
let t =
|
|
21396
|
+
var ST = ({ table: e, noResultsLabel: t }) => {
|
|
21397
|
+
let n = xT().table, r = (e) => e.columnDef.meta || {}, i = (e) => r(e).mobile || {}, a = e.getAllLeafColumns().find((e) => i(e).cardTitle), o = a ? i(a).cardIcon : void 0, s = (e) => {
|
|
21398
|
+
if (!a) return;
|
|
21399
|
+
let t = i(a).cardTitle;
|
|
20669
21400
|
if (typeof t == "string") return t;
|
|
20670
|
-
let n = e.getVisibleCells().find((e) => e.column.id ===
|
|
20671
|
-
if (n) return
|
|
20672
|
-
}, s = (e) => {
|
|
20673
|
-
let t = e.getVisibleCells().find((e) => r(e.column).primary);
|
|
20674
|
-
return t ? nw(t.column.columnDef.cell, t.getContext()) : null;
|
|
21401
|
+
let n = e.getVisibleCells().find((e) => e.column.id === a.id);
|
|
21402
|
+
if (n) return pT(n.column.columnDef.cell, n.getContext());
|
|
20675
21403
|
}, c = (e) => {
|
|
20676
|
-
let t = e.getVisibleCells().find((e) =>
|
|
20677
|
-
return t ?
|
|
20678
|
-
}, l = (e
|
|
21404
|
+
let t = e.getVisibleCells().find((e) => i(e.column).primary);
|
|
21405
|
+
return t ? pT(t.column.columnDef.cell, t.getContext()) : null;
|
|
21406
|
+
}, l = (e) => {
|
|
21407
|
+
let t = e.getVisibleCells().find((e) => i(e.column).action);
|
|
21408
|
+
return t ? pT(t.column.columnDef.cell, t.getContext()) : null;
|
|
21409
|
+
}, u = (e, t) => {
|
|
20679
21410
|
let n = t.getVisibleCells().find((t) => t.column.id === e)?.column;
|
|
20680
21411
|
if (!n) return !1;
|
|
20681
|
-
let
|
|
20682
|
-
return !!(
|
|
20683
|
-
},
|
|
21412
|
+
let r = i(n);
|
|
21413
|
+
return !!(r.primary || r.action || r.cardTitle || r.hideFromBody);
|
|
21414
|
+
}, d = (e) => {
|
|
20684
21415
|
let t = {};
|
|
20685
21416
|
return e.forEach((e) => {
|
|
20686
|
-
let n =
|
|
20687
|
-
t[
|
|
21417
|
+
let n = i(e.column).group, r = typeof n == "number" && !isNaN(n) ? n : 99;
|
|
21418
|
+
t[r] || (t[r] = []), t[r].push(e);
|
|
20688
21419
|
}), Object.entries(t).sort(([e], [t]) => Number(e) - Number(t)).map(([e, t], n, r) => /* @__PURE__ */ D("div", {
|
|
20689
21420
|
className: W(t.length > 1 ? "flex flex-wrap gap-4 border-b py-2" : "space-y-2 border-b py-2", n === r.length - 1 && "border-b-0"),
|
|
20690
21421
|
children: t.map((e) => /* @__PURE__ */ D("div", {
|
|
20691
21422
|
className: t.length > 1 ? "min-w-0 flex-1" : "",
|
|
20692
|
-
children:
|
|
21423
|
+
children: f(e)
|
|
20693
21424
|
}, e.id))
|
|
20694
21425
|
}, e));
|
|
20695
|
-
},
|
|
20696
|
-
let t = e.column, n =
|
|
21426
|
+
}, f = (e) => {
|
|
21427
|
+
let t = e.column, n = i(t).label || (typeof t.columnDef.header == "function" ? void 0 : t.columnDef.header);
|
|
20697
21428
|
return /* @__PURE__ */ O("dl", {
|
|
20698
21429
|
className: "space-y-1",
|
|
20699
21430
|
children: [n && /* @__PURE__ */ D("dt", {
|
|
@@ -20701,20 +21432,20 @@ var sw = ({ table: e, noResultsLabel: t = "No results found" }) => {
|
|
|
20701
21432
|
children: n
|
|
20702
21433
|
}), /* @__PURE__ */ D("dd", {
|
|
20703
21434
|
className: "text-foreground text-sm font-medium",
|
|
20704
|
-
children:
|
|
21435
|
+
children: pT(t.columnDef.cell, e.getContext())
|
|
20705
21436
|
})]
|
|
20706
21437
|
});
|
|
20707
|
-
},
|
|
21438
|
+
}, p = e.getRowModel().rows;
|
|
20708
21439
|
return /* @__PURE__ */ D("div", {
|
|
20709
21440
|
className: "space-y-4",
|
|
20710
|
-
children:
|
|
21441
|
+
children: p.length === 0 ? /* @__PURE__ */ D("div", {
|
|
20711
21442
|
className: "bg-card text-card-foreground rounded-xl border shadow-sm",
|
|
20712
21443
|
children: /* @__PURE__ */ D("div", {
|
|
20713
21444
|
className: "text-muted-foreground px-6 py-12 text-center text-base font-medium",
|
|
20714
|
-
children: t
|
|
21445
|
+
children: t ?? n.noResults
|
|
20715
21446
|
})
|
|
20716
|
-
}) :
|
|
20717
|
-
let t =
|
|
21447
|
+
}) : p.map((e) => {
|
|
21448
|
+
let t = c(e), n = l(e), r = e.getVisibleCells(), a = r.filter((t) => !u(t.column.id, e)), f = s(e), p = r.find((e) => i(e.column).primary)?.column.columnDef.meta?.mobile || {};
|
|
20718
21449
|
return /* @__PURE__ */ O("div", {
|
|
20719
21450
|
className: "bg-card text-card-foreground overflow-hidden rounded-xl border shadow-sm",
|
|
20720
21451
|
"data-testid": `row-${e.id}`,
|
|
@@ -20724,11 +21455,11 @@ var sw = ({ table: e, noResultsLabel: t = "No results found" }) => {
|
|
|
20724
21455
|
className: "flex items-center justify-between gap-3",
|
|
20725
21456
|
children: [/* @__PURE__ */ O("div", {
|
|
20726
21457
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
20727
|
-
children: [
|
|
21458
|
+
children: [o && /* @__PURE__ */ D("div", {
|
|
20728
21459
|
className: "flex-shrink-0",
|
|
20729
|
-
children: /* @__PURE__ */ D(
|
|
21460
|
+
children: /* @__PURE__ */ D(o, { className: "text-muted-foreground size-5" })
|
|
20730
21461
|
}), /* @__PURE__ */ O("div", {
|
|
20731
|
-
className: W("min-w-0 flex-1", !
|
|
21462
|
+
className: W("min-w-0 flex-1", !o && "ml-2"),
|
|
20732
21463
|
children: [f && /* @__PURE__ */ D("h3", {
|
|
20733
21464
|
className: "text-foreground text-base leading-tight font-semibold break-words",
|
|
20734
21465
|
children: f
|
|
@@ -20743,7 +21474,7 @@ var sw = ({ table: e, noResultsLabel: t = "No results found" }) => {
|
|
|
20743
21474
|
})]
|
|
20744
21475
|
})
|
|
20745
21476
|
}), /* @__PURE__ */ O("div", {
|
|
20746
|
-
className: W("px-6 pb-6", { "pt-2": !(
|
|
21477
|
+
className: W("px-6 pb-6", { "pt-2": !(o || f || t || n) }),
|
|
20747
21478
|
children: [
|
|
20748
21479
|
p.primaryPosition === "body-highlight" && t && /* @__PURE__ */ D("div", {
|
|
20749
21480
|
className: W("mb-3 border-b pb-3", p.primaryClass),
|
|
@@ -20752,7 +21483,7 @@ var sw = ({ table: e, noResultsLabel: t = "No results found" }) => {
|
|
|
20752
21483
|
children: t
|
|
20753
21484
|
})
|
|
20754
21485
|
}),
|
|
20755
|
-
|
|
21486
|
+
d(a),
|
|
20756
21487
|
n && /* @__PURE__ */ D("div", {
|
|
20757
21488
|
className: "pt-4",
|
|
20758
21489
|
children: /* @__PURE__ */ D("div", {
|
|
@@ -20768,7 +21499,7 @@ var sw = ({ table: e, noResultsLabel: t = "No results found" }) => {
|
|
|
20768
21499
|
};
|
|
20769
21500
|
//#endregion
|
|
20770
21501
|
//#region src/components/Table/hooks.ts
|
|
20771
|
-
function
|
|
21502
|
+
function CT(e) {
|
|
20772
21503
|
return T(v((t) => {
|
|
20773
21504
|
let n = window.matchMedia(e);
|
|
20774
21505
|
return n.addEventListener("change", t), () => {
|
|
@@ -20776,10 +21507,10 @@ function cw(e) {
|
|
|
20776
21507
|
};
|
|
20777
21508
|
}, [e]), () => window.matchMedia(e).matches, () => !1);
|
|
20778
21509
|
}
|
|
20779
|
-
function
|
|
20780
|
-
return
|
|
21510
|
+
function wT() {
|
|
21511
|
+
return CT("only screen and (max-width: 767px)");
|
|
20781
21512
|
}
|
|
20782
|
-
function
|
|
21513
|
+
function TT(e, t) {
|
|
20783
21514
|
let [n, r] = w(e);
|
|
20784
21515
|
return b(() => {
|
|
20785
21516
|
let n = setTimeout(() => r(e), t);
|
|
@@ -20788,7 +21519,7 @@ function uw(e, t) {
|
|
|
20788
21519
|
}
|
|
20789
21520
|
//#endregion
|
|
20790
21521
|
//#region src/components/Table/Table.tsx
|
|
20791
|
-
function
|
|
21522
|
+
function ET({ className: e, ...t }) {
|
|
20792
21523
|
return /* @__PURE__ */ D("div", {
|
|
20793
21524
|
"data-slot": "table-container",
|
|
20794
21525
|
className: "relative w-full overflow-x-auto",
|
|
@@ -20799,49 +21530,49 @@ function dw({ className: e, ...t }) {
|
|
|
20799
21530
|
})
|
|
20800
21531
|
});
|
|
20801
21532
|
}
|
|
20802
|
-
function
|
|
21533
|
+
function DT({ className: e, ...t }) {
|
|
20803
21534
|
return /* @__PURE__ */ D("thead", {
|
|
20804
21535
|
"data-slot": "table-header",
|
|
20805
21536
|
className: W("[&_tr]:border-b", e),
|
|
20806
21537
|
...t
|
|
20807
21538
|
});
|
|
20808
21539
|
}
|
|
20809
|
-
function
|
|
21540
|
+
function OT({ className: e, ...t }) {
|
|
20810
21541
|
return /* @__PURE__ */ D("tbody", {
|
|
20811
21542
|
"data-slot": "table-body",
|
|
20812
21543
|
className: W("[&_tr:last-child]:border-0", e),
|
|
20813
21544
|
...t
|
|
20814
21545
|
});
|
|
20815
21546
|
}
|
|
20816
|
-
function
|
|
21547
|
+
function kT({ className: e, ...t }) {
|
|
20817
21548
|
return /* @__PURE__ */ D("tfoot", {
|
|
20818
21549
|
"data-slot": "table-footer",
|
|
20819
21550
|
className: W("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0", e),
|
|
20820
21551
|
...t
|
|
20821
21552
|
});
|
|
20822
21553
|
}
|
|
20823
|
-
function
|
|
21554
|
+
function AT({ className: e, ...t }) {
|
|
20824
21555
|
return /* @__PURE__ */ D("tr", {
|
|
20825
21556
|
"data-slot": "table-row",
|
|
20826
21557
|
className: W("data-[state=selected]:bg-muted border-b transition-colors", e),
|
|
20827
21558
|
...t
|
|
20828
21559
|
});
|
|
20829
21560
|
}
|
|
20830
|
-
function
|
|
21561
|
+
function jT({ className: e, ...t }) {
|
|
20831
21562
|
return /* @__PURE__ */ D("th", {
|
|
20832
21563
|
"data-slot": "table-head",
|
|
20833
21564
|
className: W("text-foreground h-10 px-3 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", e),
|
|
20834
21565
|
...t
|
|
20835
21566
|
});
|
|
20836
21567
|
}
|
|
20837
|
-
function
|
|
21568
|
+
function MT({ className: e, ...t }) {
|
|
20838
21569
|
return /* @__PURE__ */ D("td", {
|
|
20839
21570
|
"data-slot": "table-cell",
|
|
20840
21571
|
className: W("px-3 py-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", e),
|
|
20841
21572
|
...t
|
|
20842
21573
|
});
|
|
20843
21574
|
}
|
|
20844
|
-
function
|
|
21575
|
+
function NT({ className: e, ...t }) {
|
|
20845
21576
|
return /* @__PURE__ */ D("caption", {
|
|
20846
21577
|
"data-slot": "table-caption",
|
|
20847
21578
|
className: W("text-muted-foreground mt-4 text-sm", e),
|
|
@@ -20850,88 +21581,88 @@ function vw({ className: e, ...t }) {
|
|
|
20850
21581
|
}
|
|
20851
21582
|
//#endregion
|
|
20852
21583
|
//#region src/components/Table/DataTable.tsx
|
|
20853
|
-
function
|
|
20854
|
-
let p =
|
|
21584
|
+
function PT({ columns: e, data: r, onRowClick: a, isLoading: o = !1, className: s, disableMobileList: c = !1, sorting: l, onSortingChange: u, skeletonRows: d = 4, noResultsLabel: f }) {
|
|
21585
|
+
let p = xT().table, m = f ?? p.noResults, h = wT(), g = !c && h, [_, v] = w([]), y = !!u, b = y ? l : _, x = y ? u : v, S = _T({
|
|
20855
21586
|
data: r,
|
|
20856
21587
|
columns: e,
|
|
20857
|
-
getCoreRowModel:
|
|
20858
|
-
...
|
|
21588
|
+
getCoreRowModel: dT(),
|
|
21589
|
+
...y ? {
|
|
20859
21590
|
manualSorting: !0,
|
|
20860
|
-
onSortingChange:
|
|
20861
|
-
state: { sorting:
|
|
21591
|
+
onSortingChange: x,
|
|
21592
|
+
state: { sorting: b }
|
|
20862
21593
|
} : {
|
|
20863
|
-
getSortedRowModel:
|
|
20864
|
-
onSortingChange:
|
|
20865
|
-
state: { sorting:
|
|
21594
|
+
getSortedRowModel: fT(),
|
|
21595
|
+
onSortingChange: x,
|
|
21596
|
+
state: { sorting: b }
|
|
20866
21597
|
}
|
|
20867
21598
|
});
|
|
20868
|
-
return
|
|
20869
|
-
table:
|
|
20870
|
-
noResultsLabel:
|
|
21599
|
+
return g ? /* @__PURE__ */ D(ST, {
|
|
21600
|
+
table: S,
|
|
21601
|
+
noResultsLabel: m
|
|
20871
21602
|
}) : /* @__PURE__ */ D("div", {
|
|
20872
21603
|
className: W("w-full", s),
|
|
20873
21604
|
children: /* @__PURE__ */ D("div", {
|
|
20874
21605
|
"data-slot": "data-table",
|
|
20875
21606
|
className: "bg-card rounded-md border",
|
|
20876
|
-
children: /* @__PURE__ */ O(
|
|
21607
|
+
children: /* @__PURE__ */ O(ET, { children: [/* @__PURE__ */ D(DT, { children: S.getHeaderGroups().map((e) => /* @__PURE__ */ D(AT, { children: e.headers.filter((e) => !e.column.columnDef.meta?.desktopHidden).map((e) => /* @__PURE__ */ D(jT, { children: e.isPlaceholder ? null : /* @__PURE__ */ O("div", {
|
|
20877
21608
|
className: W(e.column.getCanSort() ? "cursor-pointer select-none" : "", "flex items-center space-x-2"),
|
|
20878
21609
|
onClick: e.column.getToggleSortingHandler(),
|
|
20879
|
-
children: [/* @__PURE__ */ D("div", { children:
|
|
21610
|
+
children: [/* @__PURE__ */ D("div", { children: pT(e.column.columnDef.header, e.getContext()) }), e.column.getCanSort() && /* @__PURE__ */ D("div", {
|
|
20880
21611
|
className: "flex size-4 items-center justify-center",
|
|
20881
21612
|
children: {
|
|
20882
21613
|
asc: /* @__PURE__ */ D(t, { className: "size-4" }),
|
|
20883
21614
|
desc: /* @__PURE__ */ D(i, { className: "size-4" })
|
|
20884
21615
|
}[e.column.getIsSorted()] ?? /* @__PURE__ */ D(n, { className: "text-muted-foreground size-4" })
|
|
20885
21616
|
})]
|
|
20886
|
-
}) }, e.id)) }, e.id)) }), /* @__PURE__ */ D(
|
|
21617
|
+
}) }, e.id)) }, e.id)) }), /* @__PURE__ */ D(OT, { children: o ? /* @__PURE__ */ D(E, { children: Array.from(Array(d)).map((e, t) => /* @__PURE__ */ D(AT, { children: S.getVisibleLeafColumns().filter((e) => !e.columnDef.meta?.desktopHidden).map((e) => /* @__PURE__ */ D(MT, { children: /* @__PURE__ */ D(AS, {
|
|
20887
21618
|
className: "rounded-full",
|
|
20888
21619
|
style: { maxWidth: `${Math.floor(Math.random() * 51) + 150}px` }
|
|
20889
|
-
}) }, e.id)) }, t)) }) :
|
|
21620
|
+
}) }, e.id)) }, t)) }) : S.getRowModel().rows?.length ? S.getRowModel().rows.map((e) => /* @__PURE__ */ D(AT, {
|
|
20890
21621
|
"data-testid": `row-${e.id}`,
|
|
20891
21622
|
"data-state": e.getIsSelected() && "selected",
|
|
20892
21623
|
onClick: () => a?.(e.original),
|
|
20893
21624
|
className: W(a && "hover:bg-muted/50 cursor-pointer"),
|
|
20894
|
-
children: e.getVisibleCells().filter((e) => !e.column.columnDef.meta?.desktopHidden).map((e) => /* @__PURE__ */ D(
|
|
20895
|
-
}, e.id)) : /* @__PURE__ */ D(
|
|
21625
|
+
children: e.getVisibleCells().filter((e) => !e.column.columnDef.meta?.desktopHidden).map((e) => /* @__PURE__ */ D(MT, { children: pT(e.column.columnDef.cell, e.getContext()) }, e.id))
|
|
21626
|
+
}, e.id)) : /* @__PURE__ */ D(AT, { children: /* @__PURE__ */ D(MT, {
|
|
20896
21627
|
colSpan: e.filter((e) => !e.meta?.desktopHidden).length,
|
|
20897
21628
|
className: "text-muted-foreground pointer-events-none h-24 text-center",
|
|
20898
|
-
children:
|
|
21629
|
+
children: m
|
|
20899
21630
|
}) }) })] })
|
|
20900
21631
|
})
|
|
20901
21632
|
});
|
|
20902
21633
|
}
|
|
20903
21634
|
//#endregion
|
|
20904
21635
|
//#region src/components/Table/DataTableFilterHeaderMobileSorting.tsx
|
|
20905
|
-
var
|
|
20906
|
-
let l = e?.[0],
|
|
20907
|
-
|
|
21636
|
+
var FT = ({ sorting: e, onSortingChange: t, sortableColumns: n = [], sortLabel: r, sortByLabel: i, selectFieldLabel: a, sortDirectionLabel: o, ascendingLabel: s, descendingLabel: c }) => {
|
|
21637
|
+
let l = xT().table, u = r ?? l.sort, d = i ?? l.sortBy, f = a ?? l.selectField, p = o ?? l.sortDirection, m = s ?? l.ascending, h = c ?? l.descending, g = e?.[0], _ = g && n.find((e) => e.id === g.id), v = g?.desc ? "desc" : "asc", [y, b] = w(_?.id), [x, S] = w(v), C = (e) => {
|
|
21638
|
+
b(e), t && t([{
|
|
20908
21639
|
id: e,
|
|
20909
|
-
desc:
|
|
21640
|
+
desc: x === "desc"
|
|
20910
21641
|
}]);
|
|
20911
|
-
},
|
|
20912
|
-
|
|
20913
|
-
id:
|
|
21642
|
+
}, T = (e) => {
|
|
21643
|
+
S(e), y && t && t([{
|
|
21644
|
+
id: y,
|
|
20914
21645
|
desc: e === "desc"
|
|
20915
21646
|
}]);
|
|
20916
21647
|
};
|
|
20917
21648
|
return n.length === 0 ? null : /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("h3", {
|
|
20918
21649
|
className: "mb-4 text-lg font-semibold",
|
|
20919
|
-
children:
|
|
21650
|
+
children: u
|
|
20920
21651
|
}), /* @__PURE__ */ O("div", {
|
|
20921
21652
|
className: "space-y-4",
|
|
20922
21653
|
children: [/* @__PURE__ */ O("div", {
|
|
20923
21654
|
className: "flex flex-col space-y-2",
|
|
20924
21655
|
children: [/* @__PURE__ */ D("label", {
|
|
20925
21656
|
className: "text-sm font-medium",
|
|
20926
|
-
children:
|
|
21657
|
+
children: d
|
|
20927
21658
|
}), /* @__PURE__ */ O(Ox, {
|
|
20928
21659
|
fullWidth: !0,
|
|
20929
|
-
value:
|
|
20930
|
-
onChange: (e) =>
|
|
21660
|
+
value: y ?? "",
|
|
21661
|
+
onChange: (e) => C(e.target.value),
|
|
20931
21662
|
children: [/* @__PURE__ */ D(kx, {
|
|
20932
21663
|
value: "",
|
|
20933
21664
|
disabled: !0,
|
|
20934
|
-
children:
|
|
21665
|
+
children: f
|
|
20935
21666
|
}), n.map((e) => /* @__PURE__ */ D(kx, {
|
|
20936
21667
|
value: e.id,
|
|
20937
21668
|
children: typeof e.header == "string" ? e.header : e.id
|
|
@@ -20941,18 +21672,18 @@ var bw = ({ sorting: e, onSortingChange: t, sortableColumns: n = [], sortLabel:
|
|
|
20941
21672
|
className: "flex flex-col space-y-2",
|
|
20942
21673
|
children: [/* @__PURE__ */ D("label", {
|
|
20943
21674
|
className: "text-sm font-medium",
|
|
20944
|
-
children:
|
|
21675
|
+
children: p
|
|
20945
21676
|
}), /* @__PURE__ */ O(Ox, {
|
|
20946
21677
|
fullWidth: !0,
|
|
20947
|
-
value:
|
|
20948
|
-
onChange: (e) =>
|
|
20949
|
-
disabled: !
|
|
21678
|
+
value: x,
|
|
21679
|
+
onChange: (e) => T(e.target.value),
|
|
21680
|
+
disabled: !y,
|
|
20950
21681
|
children: [/* @__PURE__ */ D(kx, {
|
|
20951
21682
|
value: "asc",
|
|
20952
|
-
children:
|
|
21683
|
+
children: m
|
|
20953
21684
|
}), /* @__PURE__ */ D(kx, {
|
|
20954
21685
|
value: "desc",
|
|
20955
|
-
children:
|
|
21686
|
+
children: h
|
|
20956
21687
|
})]
|
|
20957
21688
|
})]
|
|
20958
21689
|
})]
|
|
@@ -20960,7 +21691,8 @@ var bw = ({ sorting: e, onSortingChange: t, sortableColumns: n = [], sortLabel:
|
|
|
20960
21691
|
};
|
|
20961
21692
|
//#endregion
|
|
20962
21693
|
//#region src/components/Table/FilterModal.tsx
|
|
20963
|
-
function
|
|
21694
|
+
function IT({ open: e, onClose: t, title: n, children: r, footer: i, className: a, descriptionLabel: o }) {
|
|
21695
|
+
let s = xT().table;
|
|
20964
21696
|
return /* @__PURE__ */ D(mm, {
|
|
20965
21697
|
open: e,
|
|
20966
21698
|
onOpenChange: (e) => {
|
|
@@ -20973,7 +21705,7 @@ function xw({ open: e, onClose: t, title: n, children: r, footer: i, className:
|
|
|
20973
21705
|
className: "flex-shrink-0",
|
|
20974
21706
|
children: [/* @__PURE__ */ D(bm, { children: n }), /* @__PURE__ */ D(xm, {
|
|
20975
21707
|
className: "sr-only",
|
|
20976
|
-
children: o
|
|
21708
|
+
children: o ?? s.filterModalDescription
|
|
20977
21709
|
})]
|
|
20978
21710
|
}),
|
|
20979
21711
|
/* @__PURE__ */ D("div", {
|
|
@@ -20990,28 +21722,28 @@ function xw({ open: e, onClose: t, title: n, children: r, footer: i, className:
|
|
|
20990
21722
|
}
|
|
20991
21723
|
//#endregion
|
|
20992
21724
|
//#region src/components/Table/DateRangeFilter.tsx
|
|
20993
|
-
var
|
|
20994
|
-
let
|
|
21725
|
+
var LT = () => /* @__PURE__ */ D("span", { className: "bg-border inline-block h-5 w-px align-middle" }), RT = ({ from: e, to: t, label: n, onChange: i, filterLabel: a, clearLabel: o, applyLabel: s, formatDate: c = (e) => e.toLocaleDateString() }) => {
|
|
21726
|
+
let l = xT().table, d = a ?? l.dateRange, f = o ?? l.clear, p = s ?? l.apply, [m, h] = w(!1), g = wT(), [_, v] = w({
|
|
20995
21727
|
from: e,
|
|
20996
21728
|
to: t
|
|
20997
|
-
}),
|
|
21729
|
+
}), y = () => {
|
|
20998
21730
|
i({
|
|
20999
|
-
from:
|
|
21000
|
-
to:
|
|
21001
|
-
}),
|
|
21002
|
-
},
|
|
21003
|
-
|
|
21731
|
+
from: _?.from,
|
|
21732
|
+
to: _?.to
|
|
21733
|
+
}), h(!1);
|
|
21734
|
+
}, b = () => {
|
|
21735
|
+
v({
|
|
21004
21736
|
from: void 0,
|
|
21005
21737
|
to: void 0
|
|
21006
21738
|
}), i({
|
|
21007
21739
|
from: void 0,
|
|
21008
21740
|
to: void 0
|
|
21009
|
-
}),
|
|
21010
|
-
},
|
|
21741
|
+
}), h(!1);
|
|
21742
|
+
}, x = /* @__PURE__ */ O(E, { children: [
|
|
21011
21743
|
/* @__PURE__ */ D(u, { className: "size-4" }),
|
|
21012
|
-
n ||
|
|
21744
|
+
n || d,
|
|
21013
21745
|
e && t ? /* @__PURE__ */ O(E, { children: [
|
|
21014
|
-
/* @__PURE__ */ D(
|
|
21746
|
+
/* @__PURE__ */ D(LT, {}),
|
|
21015
21747
|
/* @__PURE__ */ O("span", { children: [c(e), " "] }),
|
|
21016
21748
|
/* @__PURE__ */ D(r, { className: "size-4" }),
|
|
21017
21749
|
/* @__PURE__ */ O("span", { children: [
|
|
@@ -21020,66 +21752,66 @@ var Sw = () => /* @__PURE__ */ D("span", { className: "bg-border inline-block h-
|
|
|
21020
21752
|
" "
|
|
21021
21753
|
] })
|
|
21022
21754
|
] }) : null
|
|
21023
|
-
] }),
|
|
21755
|
+
] }), S = /* @__PURE__ */ O("div", {
|
|
21024
21756
|
className: "flex justify-end gap-2",
|
|
21025
21757
|
children: [/* @__PURE__ */ D(ar, {
|
|
21026
21758
|
variant: "outline",
|
|
21027
21759
|
size: "sm",
|
|
21028
|
-
onClick:
|
|
21029
|
-
children:
|
|
21760
|
+
onClick: b,
|
|
21761
|
+
children: f
|
|
21030
21762
|
}), /* @__PURE__ */ D(ar, {
|
|
21031
21763
|
size: "sm",
|
|
21032
|
-
onClick:
|
|
21033
|
-
children:
|
|
21764
|
+
onClick: y,
|
|
21765
|
+
children: p
|
|
21034
21766
|
})]
|
|
21035
21767
|
});
|
|
21036
|
-
return
|
|
21768
|
+
return g ? /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(ar, {
|
|
21037
21769
|
className: "justify-start",
|
|
21038
21770
|
variant: "outline",
|
|
21039
|
-
onClick: () =>
|
|
21040
|
-
children:
|
|
21041
|
-
}), /* @__PURE__ */ D(
|
|
21042
|
-
open:
|
|
21043
|
-
onClose: () =>
|
|
21044
|
-
title: n ||
|
|
21045
|
-
footer:
|
|
21771
|
+
onClick: () => h(!0),
|
|
21772
|
+
children: x
|
|
21773
|
+
}), /* @__PURE__ */ D(IT, {
|
|
21774
|
+
open: m,
|
|
21775
|
+
onClose: () => h(!1),
|
|
21776
|
+
title: n || d,
|
|
21777
|
+
footer: S,
|
|
21046
21778
|
children: /* @__PURE__ */ D(ys, {
|
|
21047
21779
|
mode: "range",
|
|
21048
|
-
defaultMonth:
|
|
21780
|
+
defaultMonth: _?.from,
|
|
21049
21781
|
numberOfMonths: 1,
|
|
21050
|
-
selected:
|
|
21051
|
-
onSelect:
|
|
21782
|
+
selected: _,
|
|
21783
|
+
onSelect: v,
|
|
21052
21784
|
className: "bg-transparent p-0",
|
|
21053
21785
|
fullScreen: !0,
|
|
21054
21786
|
buttonVariant: "outline"
|
|
21055
21787
|
})
|
|
21056
21788
|
})] }) : /* @__PURE__ */ O(CS, {
|
|
21057
|
-
open:
|
|
21058
|
-
onOpenChange:
|
|
21789
|
+
open: m,
|
|
21790
|
+
onOpenChange: h,
|
|
21059
21791
|
children: [/* @__PURE__ */ D(wS, {
|
|
21060
21792
|
render: /* @__PURE__ */ D(ar, { variant: "outline" }),
|
|
21061
|
-
children:
|
|
21793
|
+
children: x
|
|
21062
21794
|
}), /* @__PURE__ */ O(TS, {
|
|
21063
21795
|
className: "w-auto p-4",
|
|
21064
21796
|
align: "start",
|
|
21065
21797
|
children: [/* @__PURE__ */ D(ys, {
|
|
21066
21798
|
mode: "range",
|
|
21067
|
-
defaultMonth:
|
|
21799
|
+
defaultMonth: _?.from,
|
|
21068
21800
|
numberOfMonths: 2,
|
|
21069
|
-
selected:
|
|
21070
|
-
onSelect:
|
|
21801
|
+
selected: _,
|
|
21802
|
+
onSelect: v,
|
|
21071
21803
|
className: "bg-transparent p-0"
|
|
21072
21804
|
}), /* @__PURE__ */ D("div", {
|
|
21073
21805
|
className: "mt-4",
|
|
21074
|
-
children:
|
|
21806
|
+
children: S
|
|
21075
21807
|
})]
|
|
21076
21808
|
})]
|
|
21077
21809
|
});
|
|
21078
|
-
},
|
|
21079
|
-
let
|
|
21810
|
+
}, zT = ({ value: e, onChange: t, className: n, clearLabel: r, ...i }) => {
|
|
21811
|
+
let a = xT().table, [o, s] = w(e || ""), c = TT(o, 300);
|
|
21080
21812
|
return b(() => {
|
|
21081
|
-
t(
|
|
21082
|
-
}, [
|
|
21813
|
+
t(c || void 0);
|
|
21814
|
+
}, [c]), /* @__PURE__ */ O("div", {
|
|
21083
21815
|
className: W("relative", n),
|
|
21084
21816
|
children: [
|
|
21085
21817
|
/* @__PURE__ */ D(d, {
|
|
@@ -21087,57 +21819,57 @@ var Sw = () => /* @__PURE__ */ D("span", { className: "bg-border inline-block h-
|
|
|
21087
21819
|
className: "text-muted-foreground absolute top-1/2 left-2 -translate-y-1/2"
|
|
21088
21820
|
}),
|
|
21089
21821
|
/* @__PURE__ */ D(Dx, {
|
|
21090
|
-
value:
|
|
21091
|
-
onChange: (e) =>
|
|
21822
|
+
value: o,
|
|
21823
|
+
onChange: (e) => s(e.target.value || ""),
|
|
21092
21824
|
...i,
|
|
21093
21825
|
className: W("px-8", n)
|
|
21094
21826
|
}),
|
|
21095
|
-
|
|
21827
|
+
o && /* @__PURE__ */ D("button", {
|
|
21096
21828
|
type: "button",
|
|
21097
|
-
"aria-label": r,
|
|
21829
|
+
"aria-label": r ?? a.clearSearch,
|
|
21098
21830
|
className: "text-muted-foreground hover:text-foreground absolute top-1/2 right-2 -translate-y-1/2 focus:outline-none",
|
|
21099
|
-
onClick: () =>
|
|
21831
|
+
onClick: () => s(""),
|
|
21100
21832
|
children: /* @__PURE__ */ D(f, { size: 16 })
|
|
21101
21833
|
})
|
|
21102
21834
|
]
|
|
21103
21835
|
});
|
|
21104
|
-
},
|
|
21105
|
-
let
|
|
21106
|
-
n(
|
|
21107
|
-
},
|
|
21108
|
-
|
|
21109
|
-
},
|
|
21110
|
-
|
|
21111
|
-
},
|
|
21112
|
-
|
|
21113
|
-
},
|
|
21836
|
+
}, BT = () => /* @__PURE__ */ D("span", { className: "bg-border inline-block h-5 w-px align-middle" }), VT = ({ value: e = [], options: t, onChange: n, label: r, multiple: i = !0, filterLabel: a, selectedLabel: o, clearLabel: s, applyLabel: c }) => {
|
|
21837
|
+
let l = xT().table, [d, f] = w(!1), [p, m] = w(e), h = wT(), g = a ?? l.filter, _ = o ?? l.selected, v = s ?? l.clear, y = c ?? l.apply, b = () => {
|
|
21838
|
+
n(p), f(!1);
|
|
21839
|
+
}, x = () => {
|
|
21840
|
+
m([]), n([]), f(!1);
|
|
21841
|
+
}, S = (e) => {
|
|
21842
|
+
m([e]), n([e]), f(!1);
|
|
21843
|
+
}, C = (e) => {
|
|
21844
|
+
m((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
21845
|
+
}, T = h && t.length > 1, k = /* @__PURE__ */ O(E, { children: [
|
|
21114
21846
|
/* @__PURE__ */ D(u, { className: "size-4" }),
|
|
21115
|
-
r ||
|
|
21116
|
-
|
|
21847
|
+
r || g,
|
|
21848
|
+
p.length > 0 && /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(BT, {}), /* @__PURE__ */ D("span", {
|
|
21117
21849
|
className: "inline-flex align-middle",
|
|
21118
|
-
children:
|
|
21119
|
-
let e = t.find((e) => e.value ===
|
|
21850
|
+
children: p.length === 1 ? (() => {
|
|
21851
|
+
let e = t.find((e) => e.value === p[0]);
|
|
21120
21852
|
return e ? /* @__PURE__ */ D("span", {
|
|
21121
21853
|
className: "inline-flex items-center",
|
|
21122
21854
|
children: e.label
|
|
21123
21855
|
}) : null;
|
|
21124
21856
|
})() : /* @__PURE__ */ O("span", { children: [
|
|
21125
|
-
|
|
21857
|
+
p.length,
|
|
21126
21858
|
"+ ",
|
|
21127
|
-
|
|
21859
|
+
_
|
|
21128
21860
|
] })
|
|
21129
21861
|
})] })
|
|
21130
|
-
] }),
|
|
21131
|
-
className: W("flex cursor-pointer items-center gap-2",
|
|
21862
|
+
] }), A = t.map((e) => /* @__PURE__ */ O("label", {
|
|
21863
|
+
className: W("flex cursor-pointer items-center gap-2", T && "py-2 !text-2xl"),
|
|
21132
21864
|
children: [i ? /* @__PURE__ */ D("input", {
|
|
21133
21865
|
type: "checkbox",
|
|
21134
|
-
checked:
|
|
21135
|
-
onChange: () =>
|
|
21866
|
+
checked: p.includes(e.value),
|
|
21867
|
+
onChange: () => C(e.value),
|
|
21136
21868
|
className: "accent-primary"
|
|
21137
21869
|
}) : /* @__PURE__ */ D("input", {
|
|
21138
21870
|
type: "radio",
|
|
21139
|
-
checked:
|
|
21140
|
-
onChange: () =>
|
|
21871
|
+
checked: p[0] === e.value,
|
|
21872
|
+
onChange: () => S(e.value),
|
|
21141
21873
|
className: "accent-primary",
|
|
21142
21874
|
name: r || "select-filter"
|
|
21143
21875
|
}), /* @__PURE__ */ D("div", {
|
|
@@ -21145,72 +21877,72 @@ var Sw = () => /* @__PURE__ */ D("span", { className: "bg-border inline-block h-
|
|
|
21145
21877
|
children: e.label
|
|
21146
21878
|
})]
|
|
21147
21879
|
}, e.value));
|
|
21148
|
-
return
|
|
21880
|
+
return T ? /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(ar, {
|
|
21149
21881
|
variant: "outline",
|
|
21150
21882
|
className: "justify-start",
|
|
21151
|
-
onClick: () =>
|
|
21152
|
-
children:
|
|
21153
|
-
}), /* @__PURE__ */ D(
|
|
21154
|
-
open:
|
|
21155
|
-
onClose: () =>
|
|
21156
|
-
title: r ||
|
|
21883
|
+
onClick: () => f(!0),
|
|
21884
|
+
children: k
|
|
21885
|
+
}), /* @__PURE__ */ D(IT, {
|
|
21886
|
+
open: d,
|
|
21887
|
+
onClose: () => f(!1),
|
|
21888
|
+
title: r || g,
|
|
21157
21889
|
footer: i ? /* @__PURE__ */ O("div", {
|
|
21158
21890
|
className: "flex justify-end gap-2",
|
|
21159
21891
|
children: [/* @__PURE__ */ D(ar, {
|
|
21160
21892
|
variant: "outline",
|
|
21161
21893
|
size: "sm",
|
|
21162
|
-
onClick:
|
|
21163
|
-
children:
|
|
21894
|
+
onClick: x,
|
|
21895
|
+
children: v
|
|
21164
21896
|
}), /* @__PURE__ */ D(ar, {
|
|
21165
21897
|
size: "sm",
|
|
21166
|
-
onClick:
|
|
21167
|
-
children:
|
|
21898
|
+
onClick: b,
|
|
21899
|
+
children: y
|
|
21168
21900
|
})]
|
|
21169
21901
|
}) : void 0,
|
|
21170
|
-
children:
|
|
21902
|
+
children: A
|
|
21171
21903
|
})] }) : /* @__PURE__ */ O(CS, {
|
|
21172
|
-
open:
|
|
21173
|
-
onOpenChange:
|
|
21904
|
+
open: d,
|
|
21905
|
+
onOpenChange: f,
|
|
21174
21906
|
children: [/* @__PURE__ */ D(wS, {
|
|
21175
21907
|
render: /* @__PURE__ */ D(ar, { variant: "outline" }),
|
|
21176
|
-
children:
|
|
21908
|
+
children: k
|
|
21177
21909
|
}), /* @__PURE__ */ O(TS, {
|
|
21178
21910
|
className: "w-56 p-4",
|
|
21179
21911
|
align: "start",
|
|
21180
21912
|
children: [/* @__PURE__ */ D("div", {
|
|
21181
21913
|
className: "flex max-h-96 flex-col gap-2 overflow-y-auto",
|
|
21182
|
-
children:
|
|
21914
|
+
children: A
|
|
21183
21915
|
}), i && /* @__PURE__ */ O("div", {
|
|
21184
21916
|
className: "mt-4 flex justify-end gap-2",
|
|
21185
21917
|
children: [/* @__PURE__ */ D(ar, {
|
|
21186
21918
|
variant: "outline",
|
|
21187
21919
|
size: "sm",
|
|
21188
|
-
onClick:
|
|
21189
|
-
children:
|
|
21920
|
+
onClick: x,
|
|
21921
|
+
children: v
|
|
21190
21922
|
}), /* @__PURE__ */ D(ar, {
|
|
21191
21923
|
size: "sm",
|
|
21192
|
-
onClick:
|
|
21193
|
-
children:
|
|
21924
|
+
onClick: b,
|
|
21925
|
+
children: y
|
|
21194
21926
|
})]
|
|
21195
21927
|
})]
|
|
21196
21928
|
})]
|
|
21197
21929
|
});
|
|
21198
|
-
},
|
|
21199
|
-
let h =
|
|
21930
|
+
}, HT = _(({ query: e, placeholder: t, handleFilterChange: n, handleResetFilters: r, hasActiveFilters: i, filters: a = [], sorting: o, onSortingChange: s, sortableColumns: c = [], modalTitle: l, filtersLabel: d, clearLabel: f, applyLabel: p }, m) => {
|
|
21931
|
+
let h = xT().table, g = d ?? h.filters, _ = f ?? h.clear, v = p ?? h.apply, y = wT(), [b, x] = w(!1), S = (e, t) => e.type === "select" ? /* @__PURE__ */ D(VT, {
|
|
21200
21932
|
label: e.label,
|
|
21201
21933
|
value: e.value,
|
|
21202
21934
|
options: e.options,
|
|
21203
21935
|
onChange: e.onChange,
|
|
21204
21936
|
clearLabel: f,
|
|
21205
21937
|
applyLabel: p
|
|
21206
|
-
}, t) : e.type === "dateRange" ? /* @__PURE__ */ D(
|
|
21938
|
+
}, t) : e.type === "dateRange" ? /* @__PURE__ */ D(RT, {
|
|
21207
21939
|
label: e.label,
|
|
21208
21940
|
from: e.from,
|
|
21209
21941
|
to: e.to,
|
|
21210
21942
|
onChange: e.onChange,
|
|
21211
21943
|
clearLabel: f,
|
|
21212
21944
|
applyLabel: p
|
|
21213
|
-
}, t) : e.type === "check" ? /* @__PURE__ */ D(
|
|
21945
|
+
}, t) : e.type === "check" ? /* @__PURE__ */ D(XC, {
|
|
21214
21946
|
label: e.label,
|
|
21215
21947
|
value: e.value,
|
|
21216
21948
|
onChange: e.onChange
|
|
@@ -21222,54 +21954,54 @@ var Sw = () => /* @__PURE__ */ D("span", { className: "bg-border inline-block h-
|
|
|
21222
21954
|
className: "flex w-full flex-row flex-wrap items-stretch justify-end gap-2 md:items-center md:justify-between",
|
|
21223
21955
|
children: [/* @__PURE__ */ D("div", {
|
|
21224
21956
|
className: "flex-grow",
|
|
21225
|
-
children: /* @__PURE__ */ D(
|
|
21957
|
+
children: /* @__PURE__ */ D(zT, {
|
|
21226
21958
|
value: e,
|
|
21227
21959
|
placeholder: t,
|
|
21228
21960
|
onChange: (e) => n("q", e),
|
|
21229
21961
|
className: "w-full max-w-sm"
|
|
21230
21962
|
})
|
|
21231
|
-
}),
|
|
21963
|
+
}), y ? /* @__PURE__ */ D("div", {
|
|
21232
21964
|
className: "flex items-center justify-end gap-2",
|
|
21233
21965
|
children: (a.length > 0 || c.length > 0) && /* @__PURE__ */ O(ar, {
|
|
21234
|
-
onClick: () =>
|
|
21966
|
+
onClick: () => x(!0),
|
|
21235
21967
|
variant: "outline",
|
|
21236
21968
|
size: "sm",
|
|
21237
21969
|
className: "relative flex items-center gap-2",
|
|
21238
21970
|
children: [
|
|
21239
21971
|
/* @__PURE__ */ D(u, { className: "size-4" }),
|
|
21240
21972
|
i && /* @__PURE__ */ D("span", { className: "bg-primary absolute top-2.5 left-6.5 size-2 rounded-full" }),
|
|
21241
|
-
|
|
21973
|
+
g
|
|
21242
21974
|
]
|
|
21243
21975
|
})
|
|
21244
21976
|
}) : a.length > 0 && /* @__PURE__ */ D("div", {
|
|
21245
21977
|
className: "flex flex-0 items-center justify-end gap-2",
|
|
21246
|
-
children: a.map((e, t) =>
|
|
21978
|
+
children: a.map((e, t) => S(e, t))
|
|
21247
21979
|
})]
|
|
21248
|
-
}),
|
|
21249
|
-
open:
|
|
21250
|
-
onClose: () =>
|
|
21251
|
-
title: l ||
|
|
21980
|
+
}), y && (a.length > 0 || c.length > 0) && /* @__PURE__ */ D(IT, {
|
|
21981
|
+
open: b,
|
|
21982
|
+
onClose: () => x(!1),
|
|
21983
|
+
title: l || g,
|
|
21252
21984
|
footer: /* @__PURE__ */ O("div", {
|
|
21253
21985
|
className: "flex justify-end gap-2",
|
|
21254
21986
|
children: [/* @__PURE__ */ D(ar, {
|
|
21255
21987
|
onClick: () => {
|
|
21256
|
-
r?.(), s?.([]),
|
|
21988
|
+
r?.(), s?.([]), x(!1);
|
|
21257
21989
|
},
|
|
21258
21990
|
variant: "outline",
|
|
21259
21991
|
size: "sm",
|
|
21260
|
-
children:
|
|
21992
|
+
children: _
|
|
21261
21993
|
}), /* @__PURE__ */ D(ar, {
|
|
21262
|
-
onClick: () =>
|
|
21994
|
+
onClick: () => x(!1),
|
|
21263
21995
|
size: "sm",
|
|
21264
|
-
children:
|
|
21996
|
+
children: v
|
|
21265
21997
|
})]
|
|
21266
21998
|
}),
|
|
21267
21999
|
children: /* @__PURE__ */ O("div", {
|
|
21268
22000
|
className: "space-y-8",
|
|
21269
22001
|
children: [a.length > 0 && /* @__PURE__ */ D("div", {
|
|
21270
22002
|
className: "flex flex-col space-y-4",
|
|
21271
|
-
children: a.map((e, t) =>
|
|
21272
|
-
}), /* @__PURE__ */ D(
|
|
22003
|
+
children: a.map((e, t) => S(e, t))
|
|
22004
|
+
}), /* @__PURE__ */ D(FT, {
|
|
21273
22005
|
sorting: o,
|
|
21274
22006
|
onSortingChange: s,
|
|
21275
22007
|
sortableColumns: c
|
|
@@ -21278,22 +22010,22 @@ var Sw = () => /* @__PURE__ */ D("span", { className: "bg-border inline-block h-
|
|
|
21278
22010
|
})]
|
|
21279
22011
|
});
|
|
21280
22012
|
});
|
|
21281
|
-
|
|
22013
|
+
HT.displayName = "DataTableFilterHeader";
|
|
21282
22014
|
//#endregion
|
|
21283
22015
|
//#region src/components/Table/DataTableMobileSorting.tsx
|
|
21284
|
-
var
|
|
21285
|
-
let
|
|
21286
|
-
return
|
|
21287
|
-
open:
|
|
22016
|
+
var UT = ({ table: e, sortLabel: r, sortByLabel: a, selectFieldLabel: o, sortDirectionLabel: s, ascendingLabel: c, descendingLabel: l, clearLabel: u, applyLabel: d }) => {
|
|
22017
|
+
let f = xT().table, p = r ?? f.sort, m = a ?? f.sortBy, h = o ?? f.selectField, g = s ?? f.sortDirection, _ = c ?? f.ascending, v = l ?? f.descending, y = u ?? f.clear, b = d ?? f.apply, [x, C] = w(!1), T = e.getState().sorting, E = e.options.onSortingChange, k = S(() => e.getAllLeafColumns().filter((e) => e.getCanSort()), [e]), A = T?.[0], j = A && k.find((e) => e.id === A.id), M = A?.desc ? "desc" : "asc", [N, P] = w(j?.id), [F, I] = w(M);
|
|
22018
|
+
return k.length === 0 || !E ? null : /* @__PURE__ */ O(CS, {
|
|
22019
|
+
open: x,
|
|
21288
22020
|
onOpenChange: (e) => {
|
|
21289
|
-
e && (
|
|
22021
|
+
e && (P(j?.id), I(M)), C(e);
|
|
21290
22022
|
},
|
|
21291
22023
|
children: [/* @__PURE__ */ O(wS, {
|
|
21292
22024
|
render: /* @__PURE__ */ D(ar, {
|
|
21293
22025
|
variant: "outline",
|
|
21294
22026
|
className: "flex items-center gap-2"
|
|
21295
22027
|
}),
|
|
21296
|
-
children: [D(
|
|
22028
|
+
children: [D(j ? M === "asc" ? t : i : n, { className: "size-4" }), /* @__PURE__ */ D("span", { children: j ? typeof j.columnDef.header == "function" ? j.id : j.columnDef.header : p })]
|
|
21297
22029
|
}), /* @__PURE__ */ D(TS, {
|
|
21298
22030
|
className: "min-w-64 p-4",
|
|
21299
22031
|
align: "start",
|
|
@@ -21304,16 +22036,16 @@ var Ow = ({ table: e, sortLabel: r = "Sort", sortByLabel: a = "Sort by", selectF
|
|
|
21304
22036
|
className: "flex flex-col space-y-2",
|
|
21305
22037
|
children: [/* @__PURE__ */ D("label", {
|
|
21306
22038
|
className: "text-sm font-medium",
|
|
21307
|
-
children:
|
|
22039
|
+
children: m
|
|
21308
22040
|
}), /* @__PURE__ */ O(Ox, {
|
|
21309
22041
|
fullWidth: !0,
|
|
21310
|
-
value:
|
|
21311
|
-
onChange: (e) =>
|
|
22042
|
+
value: N ?? "",
|
|
22043
|
+
onChange: (e) => P(e.target.value),
|
|
21312
22044
|
children: [/* @__PURE__ */ D(kx, {
|
|
21313
22045
|
value: "",
|
|
21314
22046
|
disabled: !0,
|
|
21315
|
-
children:
|
|
21316
|
-
}),
|
|
22047
|
+
children: h
|
|
22048
|
+
}), k.map((e) => /* @__PURE__ */ D(kx, {
|
|
21317
22049
|
value: e.id,
|
|
21318
22050
|
children: typeof e.columnDef.header == "function" ? e.id : e.columnDef.header
|
|
21319
22051
|
}, e.id))]
|
|
@@ -21323,18 +22055,18 @@ var Ow = ({ table: e, sortLabel: r = "Sort", sortByLabel: a = "Sort by", selectF
|
|
|
21323
22055
|
className: "flex flex-col space-y-2",
|
|
21324
22056
|
children: [/* @__PURE__ */ D("label", {
|
|
21325
22057
|
className: "text-sm font-medium",
|
|
21326
|
-
children:
|
|
22058
|
+
children: g
|
|
21327
22059
|
}), /* @__PURE__ */ O(Ox, {
|
|
21328
22060
|
fullWidth: !0,
|
|
21329
|
-
value:
|
|
21330
|
-
onChange: (e) =>
|
|
21331
|
-
disabled: !
|
|
22061
|
+
value: F,
|
|
22062
|
+
onChange: (e) => I(e.target.value),
|
|
22063
|
+
disabled: !N,
|
|
21332
22064
|
children: [/* @__PURE__ */ D(kx, {
|
|
21333
22065
|
value: "asc",
|
|
21334
|
-
children:
|
|
22066
|
+
children: _
|
|
21335
22067
|
}), /* @__PURE__ */ D(kx, {
|
|
21336
22068
|
value: "desc",
|
|
21337
|
-
children:
|
|
22069
|
+
children: v
|
|
21338
22070
|
})]
|
|
21339
22071
|
})]
|
|
21340
22072
|
}),
|
|
@@ -21344,64 +22076,68 @@ var Ow = ({ table: e, sortLabel: r = "Sort", sortByLabel: a = "Sort by", selectF
|
|
|
21344
22076
|
variant: "outline",
|
|
21345
22077
|
size: "sm",
|
|
21346
22078
|
onClick: () => {
|
|
21347
|
-
|
|
22079
|
+
P(void 0), I("asc"), E([]), C(!1);
|
|
21348
22080
|
},
|
|
21349
|
-
children:
|
|
22081
|
+
children: y
|
|
21350
22082
|
}), /* @__PURE__ */ D(ar, {
|
|
21351
22083
|
size: "sm",
|
|
21352
22084
|
onClick: () => {
|
|
21353
|
-
|
|
21354
|
-
id:
|
|
21355
|
-
desc:
|
|
21356
|
-
}] : []),
|
|
22085
|
+
E(N ? [{
|
|
22086
|
+
id: N,
|
|
22087
|
+
desc: F === "desc"
|
|
22088
|
+
}] : []), C(!1);
|
|
21357
22089
|
},
|
|
21358
|
-
children:
|
|
22090
|
+
children: b
|
|
21359
22091
|
})]
|
|
21360
22092
|
})
|
|
21361
22093
|
]
|
|
21362
22094
|
})
|
|
21363
22095
|
})]
|
|
21364
22096
|
});
|
|
21365
|
-
},
|
|
22097
|
+
}, WT = [
|
|
21366
22098
|
10,
|
|
21367
22099
|
25,
|
|
21368
22100
|
50,
|
|
21369
22101
|
100
|
|
21370
|
-
],
|
|
21371
|
-
|
|
21372
|
-
|
|
21373
|
-
|
|
21374
|
-
|
|
21375
|
-
children: r.map((e) => /* @__PURE__ */ O(kx, {
|
|
22102
|
+
], GT = ({ value: e, onValueChange: t, className: n, options: r = WT, itemsPerPageLabel: i }) => {
|
|
22103
|
+
let a = xT().table, o = i ?? a.itemsPerPage;
|
|
22104
|
+
return /* @__PURE__ */ D(Ox, {
|
|
22105
|
+
size: "sm",
|
|
22106
|
+
className: n,
|
|
21376
22107
|
value: e.toString(),
|
|
21377
|
-
|
|
21378
|
-
|
|
21379
|
-
|
|
21380
|
-
|
|
21381
|
-
|
|
21382
|
-
|
|
21383
|
-
|
|
22108
|
+
onChange: (e) => t(parseInt(e.target.value, 10)),
|
|
22109
|
+
children: r.map((e) => /* @__PURE__ */ O(kx, {
|
|
22110
|
+
value: e.toString(),
|
|
22111
|
+
children: [
|
|
22112
|
+
e,
|
|
22113
|
+
" ",
|
|
22114
|
+
o
|
|
22115
|
+
]
|
|
22116
|
+
}, e))
|
|
22117
|
+
});
|
|
22118
|
+
}, KT = ({ pagination: e, pageSize: t, className: n, formatLabel: r }) => {
|
|
22119
|
+
let i = xT().table;
|
|
21384
22120
|
if (!e || e.count === 0) return null;
|
|
21385
|
-
let
|
|
21386
|
-
from:
|
|
21387
|
-
to:
|
|
21388
|
-
total:
|
|
21389
|
-
})
|
|
22121
|
+
let a = e.current, o = e.count, s = (a - 1) * t + 1, c = Math.min(a * t, o), l = (r ?? i.showingResults)({
|
|
22122
|
+
from: s,
|
|
22123
|
+
to: c,
|
|
22124
|
+
total: o
|
|
22125
|
+
});
|
|
21390
22126
|
return /* @__PURE__ */ D("div", {
|
|
21391
22127
|
className: W("text-muted-foreground text-sm whitespace-nowrap", n),
|
|
21392
|
-
children:
|
|
22128
|
+
children: l
|
|
21393
22129
|
});
|
|
21394
|
-
},
|
|
21395
|
-
let c =
|
|
21396
|
-
return
|
|
22130
|
+
}, qT = ({ pagination: e, onPageChange: t, pageSize: n = 10, onPageSizeChange: r, previousLabel: i, nextLabel: a, itemsPerPageLabel: o, formatResultsLabel: s }) => {
|
|
22131
|
+
let c = xT().table, u = wT(), d = e.current, f = e.pages, p = d - 1 > 4 / 2 && f > 4, m = f - d + 1 > 4 / 2 && f > 4;
|
|
22132
|
+
return f <= 1 && e.count <= n ? null : /* @__PURE__ */ O("div", {
|
|
21397
22133
|
className: "flex items-center justify-between",
|
|
21398
|
-
children: [!
|
|
22134
|
+
children: [!u && /* @__PURE__ */ O("div", {
|
|
21399
22135
|
className: "flex flex-shrink-0 items-center gap-4",
|
|
21400
|
-
children: [r && /* @__PURE__ */ D(
|
|
22136
|
+
children: [r && /* @__PURE__ */ D(GT, {
|
|
21401
22137
|
value: n,
|
|
21402
22138
|
onValueChange: r,
|
|
21403
22139
|
itemsPerPageLabel: o
|
|
21404
|
-
}), /* @__PURE__ */ D(
|
|
22140
|
+
}), /* @__PURE__ */ D(KT, {
|
|
21405
22141
|
pagination: e,
|
|
21406
22142
|
pageSize: n,
|
|
21407
22143
|
formatLabel: s
|
|
@@ -21410,35 +22146,44 @@ var Ow = ({ table: e, sortLabel: r = "Sort", sortByLabel: a = "Sort by", selectF
|
|
|
21410
22146
|
className: "md:justify-end",
|
|
21411
22147
|
children: /* @__PURE__ */ O(Mx, { children: [
|
|
21412
22148
|
/* @__PURE__ */ D(Nx, { children: /* @__PURE__ */ D(Fx, {
|
|
21413
|
-
label: i,
|
|
21414
|
-
onClick: () =>
|
|
21415
|
-
"aria-disabled":
|
|
22149
|
+
label: i ?? c.previous,
|
|
22150
|
+
onClick: () => d > 1 && t(d - 1),
|
|
22151
|
+
"aria-disabled": d === 1
|
|
21416
22152
|
}) }),
|
|
21417
|
-
|
|
22153
|
+
p && /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(Nx, { children: /* @__PURE__ */ D(Px, {
|
|
21418
22154
|
onClick: () => t(1),
|
|
21419
22155
|
children: 1
|
|
21420
|
-
}) }),
|
|
22156
|
+
}) }), d > 2 && /* @__PURE__ */ D(Nx, { children: /* @__PURE__ */ D(l, { className: "size-4" }) })] }),
|
|
21421
22157
|
(() => {
|
|
21422
|
-
if (
|
|
21423
|
-
let e =
|
|
21424
|
-
return e < 1 && (e = 1, t = 4), t >
|
|
22158
|
+
if (f <= 4) return Array.from({ length: f }, (e, t) => t + 1);
|
|
22159
|
+
let e = d - 2, t = d + 2;
|
|
22160
|
+
return e < 1 && (e = 1, t = 4), t > f && (e = f - 4 + 1, t = f), p && e++, m && t--, Array.from({ length: t - e + 1 }, (t, n) => e + n);
|
|
21425
22161
|
})().map((e) => /* @__PURE__ */ D(Nx, { children: /* @__PURE__ */ D(Px, {
|
|
21426
|
-
isActive: e ===
|
|
22162
|
+
isActive: e === d,
|
|
21427
22163
|
onClick: () => t(e),
|
|
21428
22164
|
children: e
|
|
21429
22165
|
}) }, e)),
|
|
21430
|
-
|
|
21431
|
-
onClick: () => t(
|
|
21432
|
-
children:
|
|
22166
|
+
m && /* @__PURE__ */ O(E, { children: [f - d > 2 && /* @__PURE__ */ D(Nx, { children: /* @__PURE__ */ D(l, { className: "size-4" }) }), /* @__PURE__ */ D(Nx, { children: /* @__PURE__ */ D(Px, {
|
|
22167
|
+
onClick: () => t(f),
|
|
22168
|
+
children: f
|
|
21433
22169
|
}) })] }),
|
|
21434
22170
|
/* @__PURE__ */ D(Nx, { children: /* @__PURE__ */ D(Ix, {
|
|
21435
|
-
label: a,
|
|
21436
|
-
onClick: () =>
|
|
21437
|
-
"aria-disabled":
|
|
22171
|
+
label: a ?? c.next,
|
|
22172
|
+
onClick: () => d < f && t(d + 1),
|
|
22173
|
+
"aria-disabled": d === f
|
|
21438
22174
|
}) })
|
|
21439
22175
|
] })
|
|
21440
22176
|
})]
|
|
21441
22177
|
});
|
|
21442
22178
|
};
|
|
21443
22179
|
//#endregion
|
|
21444
|
-
|
|
22180
|
+
//#region src/components/Textarea/textarea.tsx
|
|
22181
|
+
function JT({ className: e, ...t }) {
|
|
22182
|
+
return /* @__PURE__ */ D("textarea", {
|
|
22183
|
+
"data-slot": "textarea",
|
|
22184
|
+
className: W("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", e),
|
|
22185
|
+
...t
|
|
22186
|
+
});
|
|
22187
|
+
}
|
|
22188
|
+
//#endregion
|
|
22189
|
+
export { hn as Badge, ar as Button, rr as ButtonGroup, ys as Calendar, bs as CalendarDayButton, XC as CheckFilter, Oc as Checkbox, PT as DataTable, HT as DataTableFilterHeader, FT as DataTableFilterHeaderMobileSorting, ST as DataTableMobile, UT as DataTableMobileSorting, qT as DataTablePagination, RT as DateRangeFilter, zT as DebouncedSearchInput, mm as Dialog, gm as DialogClose, _m as DialogContent, xm as DialogDescription, ym as DialogFooter, vm as DialogHeader, bm as DialogTitle, hm as DialogTrigger, Tx as DynamicIcon, IT as FilterModal, Ex as IconButton, Dx as Input, Ox as NativeSelect, Ax as NativeSelectOptGroup, kx as NativeSelectOption, GT as PageSizeSelector, jx as Pagination, Mx as PaginationContent, Lx as PaginationEllipsis, Nx as PaginationItem, Px as PaginationLink, Ix as PaginationNext, Fx as PaginationPrevious, CS as Popover, ES as PopoverClose, TS as PopoverContent, wS as PopoverTrigger, KT as ResultsCounter, VT as SelectFilter, kS as Separator, AS as Skeleton, VC as Slider, YC as Switch, ET as Table, OT as TableBody, NT as TableCaption, MT as TableCell, kT as TableFooter, jT as TableHead, DT as TableHeader, AT as TableRow, JT as Textarea, bT as WgDesignProvider, mn as badgeVariants, er as buttonGroupVariants, ir as buttonVariants, vT as defaultWgDesignLabels, OS as separatorVariants, nr as useButtonGroup, TT as useDebounce, wT as useIsMobile, CT as useMediaQuery, xT as useWgDesignLabels };
|