florixui 1.11.0 → 1.12.0
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/README.md +1 -1
- package/dist/components/custom/data-table.d.ts +6 -1
- package/dist/index.js +149 -135
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { clsx as e } from "clsx";
|
|
|
2
2
|
import { twMerge as t } from "tailwind-merge";
|
|
3
3
|
import * as n from "react";
|
|
4
4
|
import { createContext as r, forwardRef as i, useCallback as a, useContext as o, useEffect as s, useId as c, useImperativeHandle as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
5
|
-
import { AlertCircleIcon as p, AlertTriangle as m, ArrowLeftIcon as h, Calendar as g, Check as _, CheckIcon as v, ChevronDown as y, ChevronDownIcon as b, ChevronLeftIcon as x, ChevronRightIcon as S, ChevronUpIcon as C, ChevronsLeftIcon as w, ChevronsRightIcon as T, CircleCheckIcon as E, CircleDotIcon as D, CircleXIcon as O, Clock as k, Eye as A, EyeOff as
|
|
5
|
+
import { AlertCircleIcon as p, AlertTriangle as m, ArrowLeftIcon as h, Calendar as g, Check as _, CheckIcon as v, ChevronDown as y, ChevronDownIcon as b, ChevronLeftIcon as x, ChevronRightIcon as S, ChevronUpIcon as C, ChevronsLeftIcon as w, ChevronsRightIcon as T, CircleCheckIcon as E, CircleDotIcon as D, CircleXIcon as O, Clock as k, Eye as A, EyeOff as j, FileArchiveIcon as M, FileIcon as N, FileSpreadsheetIcon as P, FileTextIcon as F, HeadphonesIcon as I, HomeIcon as ee, ImageIcon as te, ImageUpIcon as ne, InboxIcon as L, InfoIcon as R, Layers as z, Loader2 as re, Loader2Icon as B, LoaderCircleIcon as ie, Locate as ae, Maximize as V, Minus as oe, MoreVertical as H, OctagonXIcon as se, PaintBucketIcon as ce, Plus as le, PlusCircleIcon as ue, PlusIcon as de, RefreshCwIcon as fe, SearchIcon as pe, Trash2Icon as me, TrendingDownIcon as he, TrendingUpIcon as ge, TriangleAlertIcon as _e, UploadIcon as ve, VideoIcon as ye, X as be, XIcon as U } from "lucide-react";
|
|
6
6
|
import { cva as W } from "class-variance-authority";
|
|
7
7
|
import { AlertDialog as G, Checkbox as xe, Dialog as K, DropdownMenu as q, HoverCard as Se, Label as Ce, Popover as we, Progress as Te, RadioGroup as Ee, Select as J, Separator as De, Slider as Oe, Slot as ke, Switch as Ae, Tabs as je, Toggle as Me, ToggleGroup as Ne, Tooltip as Pe } from "radix-ui";
|
|
8
8
|
import { Fragment as Y, jsx as X, jsxs as Z } from "react/jsx-runtime";
|
|
@@ -1150,11 +1150,11 @@ function pn({ error: e, errorMessage: t, helperText: n, errorId: r, helperId: i
|
|
|
1150
1150
|
}
|
|
1151
1151
|
var mn = n.forwardRef(function(e, t) {
|
|
1152
1152
|
if (e.as === "tags") return /* @__PURE__ */ X(gn, { ...e });
|
|
1153
|
-
let { className: r, wrapperClassName: i, label: a, description: o, errorMessage: s, helperText: c, required: l = !1, size: u = "default", variant: d = "default", leftIcon: f, rightIcon: p, disabled: m, startItem: h, endItem: g, loading: _ = !1, as: v = "input", id: y, error: b, ...x } = e, S = b ?? !!s, C = n.useId(), w = y || C, [T, E] = n.useState(!1), D = `${w}-error`, O = `${w}-helper`, k = `${w}-description`,
|
|
1153
|
+
let { className: r, wrapperClassName: i, label: a, description: o, errorMessage: s, helperText: c, required: l = !1, size: u = "default", variant: d = "default", leftIcon: f, rightIcon: p, disabled: m, startItem: h, endItem: g, loading: _ = !1, as: v = "input", id: y, error: b, ...x } = e, S = b ?? !!s, C = n.useId(), w = y || C, [T, E] = n.useState(!1), D = `${w}-error`, O = `${w}-helper`, k = `${w}-description`, M = [
|
|
1154
1154
|
S && s ? D : null,
|
|
1155
1155
|
!S && c ? O : null,
|
|
1156
1156
|
o ? k : null
|
|
1157
|
-
].filter(Boolean).join(" ") || void 0,
|
|
1157
|
+
].filter(Boolean).join(" ") || void 0, N = d === "alt" ? "bg-muted" : "bg-transparent dark:bg-input/30", P = l ? /* @__PURE__ */ X("span", {
|
|
1158
1158
|
"aria-hidden": !0,
|
|
1159
1159
|
className: "ml-0.5 text-destructive",
|
|
1160
1160
|
children: "*"
|
|
@@ -1167,15 +1167,15 @@ var mn = n.forwardRef(function(e, t) {
|
|
|
1167
1167
|
a && /* @__PURE__ */ Z(wt, {
|
|
1168
1168
|
htmlFor: w,
|
|
1169
1169
|
className: Q(m && "text-muted-foreground"),
|
|
1170
|
-
children: [a,
|
|
1170
|
+
children: [a, P]
|
|
1171
1171
|
}),
|
|
1172
1172
|
/* @__PURE__ */ X("textarea", {
|
|
1173
1173
|
id: w,
|
|
1174
1174
|
ref: t,
|
|
1175
1175
|
disabled: m,
|
|
1176
1176
|
"aria-invalid": S,
|
|
1177
|
-
"aria-describedby":
|
|
1178
|
-
className: Q("flex min-h-20 w-full rounded-lg border border-input px-3 py-2 text-sm outline-none transition-colors placeholder:text-muted-foreground/60",
|
|
1177
|
+
"aria-describedby": M,
|
|
1178
|
+
className: Q("flex min-h-20 w-full rounded-lg border border-input px-3 py-2 text-sm outline-none transition-colors placeholder:text-muted-foreground/60", N, "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", "aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", r),
|
|
1179
1179
|
...e
|
|
1180
1180
|
}),
|
|
1181
1181
|
/* @__PURE__ */ X(pn, {
|
|
@@ -1192,25 +1192,25 @@ var mn = n.forwardRef(function(e, t) {
|
|
|
1192
1192
|
]
|
|
1193
1193
|
});
|
|
1194
1194
|
}
|
|
1195
|
-
let { type:
|
|
1195
|
+
let { type: F, onFocus: I, ...ee } = x, te = F ?? "text", ne = te === "password", L = ne && T ? "text" : te, R = ne ? /* @__PURE__ */ X("button", {
|
|
1196
1196
|
type: "button",
|
|
1197
1197
|
onClick: () => E((e) => !e),
|
|
1198
1198
|
"aria-label": T ? "Hide password" : "Show password",
|
|
1199
1199
|
className: "cursor-pointer text-muted-foreground transition-colors hover:text-foreground",
|
|
1200
1200
|
tabIndex: -1,
|
|
1201
|
-
children: X(T ?
|
|
1202
|
-
}) : null, z = _ ? /* @__PURE__ */ X(re, { className: "size-4 animate-spin text-muted-foreground" }) : f, B =
|
|
1203
|
-
|
|
1201
|
+
children: X(T ? j : A, { className: "size-4" })
|
|
1202
|
+
}) : null, z = _ ? /* @__PURE__ */ X(re, { className: "size-4 animate-spin text-muted-foreground" }) : f, B = ne ? R : p, ie = (e) => {
|
|
1203
|
+
L === "number" && e.target.select(), I?.(e);
|
|
1204
1204
|
}, ae = !!(h || g), V = /* @__PURE__ */ X("input", {
|
|
1205
1205
|
id: w,
|
|
1206
|
-
type:
|
|
1206
|
+
type: L,
|
|
1207
1207
|
ref: t,
|
|
1208
1208
|
disabled: m,
|
|
1209
1209
|
"aria-invalid": S,
|
|
1210
|
-
"aria-describedby":
|
|
1210
|
+
"aria-describedby": M,
|
|
1211
1211
|
onFocus: ie,
|
|
1212
|
-
className: Q("w-full min-w-0 bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground/60 disabled:cursor-not-allowed", ae ? "h-full border-0 py-1 focus-visible:ring-0" : Q("rounded-lg border border-input pl-3 pr-3 py-1 transition-colors",
|
|
1213
|
-
...
|
|
1212
|
+
className: Q("w-full min-w-0 bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground/60 disabled:cursor-not-allowed", ae ? "h-full border-0 py-1 focus-visible:ring-0" : Q("rounded-lg border border-input pl-3 pr-3 py-1 transition-colors", N, u === "default" ? "h-9" : "h-8", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", "disabled:opacity-50", "aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", z && "pl-9", B && "pr-9"), ae && "pl-3 pr-3", ae && z && !h && "pl-9", ae && B && !g && "pr-9", r),
|
|
1213
|
+
...ee
|
|
1214
1214
|
});
|
|
1215
1215
|
return /* @__PURE__ */ Z("div", {
|
|
1216
1216
|
className: Q("space-y-1.5", i),
|
|
@@ -1218,11 +1218,11 @@ var mn = n.forwardRef(function(e, t) {
|
|
|
1218
1218
|
a && /* @__PURE__ */ Z(wt, {
|
|
1219
1219
|
htmlFor: w,
|
|
1220
1220
|
className: Q(m && "text-muted-foreground"),
|
|
1221
|
-
children: [a,
|
|
1221
|
+
children: [a, P]
|
|
1222
1222
|
}),
|
|
1223
1223
|
ae ? /* @__PURE__ */ Z("div", {
|
|
1224
1224
|
"aria-invalid": S,
|
|
1225
|
-
className: Q("flex items-center overflow-hidden rounded-lg border border-input transition-colors",
|
|
1225
|
+
className: Q("flex items-center overflow-hidden rounded-lg border border-input transition-colors", N, u === "default" ? "h-9" : "h-8", "focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50", "aria-[invalid=true]:border-destructive aria-[invalid=true]:ring-3 aria-[invalid=true]:ring-destructive/20 dark:aria-[invalid=true]:ring-destructive/40", m && "cursor-not-allowed opacity-50"),
|
|
1226
1226
|
children: [
|
|
1227
1227
|
h && /* @__PURE__ */ X("div", {
|
|
1228
1228
|
className: "flex h-full shrink-0 items-center justify-center border-r border-input bg-muted/40 px-3 text-sm text-muted-foreground [&_svg]:size-4",
|
|
@@ -1294,12 +1294,12 @@ function hn({ children: e, onRemove: t, disabled: n }) {
|
|
|
1294
1294
|
});
|
|
1295
1295
|
}
|
|
1296
1296
|
function gn({ value: e, onChange: t, label: r, description: i, errorMessage: a, helperText: o, required: s = !1, size: c = "default", variant: l = "default", disabled: u, placeholder: d = "Add and press Enter…", badgePosition: f = "inside", separators: p = [",", "Enter"], dedupe: m = !0, maxTags: h, error: g, className: _, wrapperClassName: v, id: y }) {
|
|
1297
|
-
let [b, x] = n.useState(""), S = n.useRef(null), C = n.useId(), w = y || C, T = `${w}-error`, E = `${w}-helper`, D = `${w}-description`, O = g ?? !!a, k = l === "alt" ? "bg-muted" : "bg-transparent dark:bg-input/30", A = f === "inside",
|
|
1297
|
+
let [b, x] = n.useState(""), S = n.useRef(null), C = n.useId(), w = y || C, T = `${w}-error`, E = `${w}-helper`, D = `${w}-description`, O = g ?? !!a, k = l === "alt" ? "bg-muted" : "bg-transparent dark:bg-input/30", A = f === "inside", j = (n) => {
|
|
1298
1298
|
let r = n.trim();
|
|
1299
1299
|
r && (m && e.some((e) => e.toLowerCase() === r.toLowerCase()) || h != null && e.length >= h || t([...e, r]));
|
|
1300
|
-
},
|
|
1301
|
-
b.trim() && (
|
|
1302
|
-
},
|
|
1300
|
+
}, M = () => {
|
|
1301
|
+
b.trim() && (j(b), x(""));
|
|
1302
|
+
}, N = (n) => t(e.filter((e, t) => t !== n));
|
|
1303
1303
|
return /* @__PURE__ */ Z("div", {
|
|
1304
1304
|
className: Q("space-y-1.5", v),
|
|
1305
1305
|
children: [
|
|
@@ -1317,7 +1317,7 @@ function gn({ value: e, onChange: t, label: r, description: i, errorMessage: a,
|
|
|
1317
1317
|
"aria-invalid": O,
|
|
1318
1318
|
className: Q("flex w-full cursor-text rounded-lg border border-input transition-colors", k, "focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", u && "cursor-not-allowed opacity-50", A ? "min-h-9 flex-wrap items-center gap-1.5 px-2 py-1.5" : Q("items-center px-3", c === "default" ? "h-9" : "h-8"), _),
|
|
1319
1319
|
children: [A && e.map((e, t) => /* @__PURE__ */ X(hn, {
|
|
1320
|
-
onRemove: () =>
|
|
1320
|
+
onRemove: () => N(t),
|
|
1321
1321
|
disabled: u,
|
|
1322
1322
|
children: e
|
|
1323
1323
|
}, `${e}-${t}`)), /* @__PURE__ */ X("input", {
|
|
@@ -1328,13 +1328,13 @@ function gn({ value: e, onChange: t, label: r, description: i, errorMessage: a,
|
|
|
1328
1328
|
let t = e.target.value;
|
|
1329
1329
|
if (p.includes(",") && t.includes(",")) {
|
|
1330
1330
|
let e = t.split(","), n = e.pop() ?? "";
|
|
1331
|
-
e.forEach((e) =>
|
|
1331
|
+
e.forEach((e) => j(e)), x(n);
|
|
1332
1332
|
} else x(t);
|
|
1333
1333
|
},
|
|
1334
1334
|
onKeyDown: (t) => {
|
|
1335
|
-
p.includes(t.key) ? (t.preventDefault(),
|
|
1335
|
+
p.includes(t.key) ? (t.preventDefault(), M()) : t.key === "Backspace" && b === "" && e.length > 0 && N(e.length - 1);
|
|
1336
1336
|
},
|
|
1337
|
-
onBlur:
|
|
1337
|
+
onBlur: M,
|
|
1338
1338
|
disabled: u,
|
|
1339
1339
|
placeholder: e.length === 0 || !A ? d : "",
|
|
1340
1340
|
"aria-invalid": O,
|
|
@@ -1345,7 +1345,7 @@ function gn({ value: e, onChange: t, label: r, description: i, errorMessage: a,
|
|
|
1345
1345
|
!A && e.length > 0 && /* @__PURE__ */ X("div", {
|
|
1346
1346
|
className: "flex flex-wrap gap-1.5",
|
|
1347
1347
|
children: e.map((e, t) => /* @__PURE__ */ X(hn, {
|
|
1348
|
-
onRemove: () =>
|
|
1348
|
+
onRemove: () => N(t),
|
|
1349
1349
|
disabled: u,
|
|
1350
1350
|
children: e
|
|
1351
1351
|
}, `${e}-${t}`))
|
|
@@ -1450,7 +1450,7 @@ vn.displayName = "PhoneInput";
|
|
|
1450
1450
|
//#region src/components/custom/alert-card.tsx
|
|
1451
1451
|
var yn = {
|
|
1452
1452
|
info: {
|
|
1453
|
-
icon:
|
|
1453
|
+
icon: R,
|
|
1454
1454
|
badge: "blue",
|
|
1455
1455
|
filled: "border-blue/30 bg-blue/10 text-blue",
|
|
1456
1456
|
iconBox: "bg-blue/10 text-blue",
|
|
@@ -1560,23 +1560,23 @@ function xn({ severity: e = "info", className: t, ...n }) {
|
|
|
1560
1560
|
var Sn = [
|
|
1561
1561
|
{
|
|
1562
1562
|
match: (e, t) => e.includes("zip") || e.includes("archive") || t.endsWith(".zip") || t.endsWith(".rar"),
|
|
1563
|
-
Icon:
|
|
1563
|
+
Icon: M
|
|
1564
1564
|
},
|
|
1565
1565
|
{
|
|
1566
1566
|
match: (e) => e.includes("audio/"),
|
|
1567
|
-
Icon:
|
|
1567
|
+
Icon: I
|
|
1568
1568
|
},
|
|
1569
1569
|
{
|
|
1570
1570
|
match: (e, t) => e.includes("excel") || t.endsWith(".xls") || t.endsWith(".xlsx"),
|
|
1571
|
-
Icon:
|
|
1571
|
+
Icon: P
|
|
1572
1572
|
},
|
|
1573
1573
|
{
|
|
1574
1574
|
match: (e) => e.startsWith("image/"),
|
|
1575
|
-
Icon:
|
|
1575
|
+
Icon: te
|
|
1576
1576
|
},
|
|
1577
1577
|
{
|
|
1578
1578
|
match: (e, t) => e.includes("pdf") || t.endsWith(".pdf") || e.includes("word") || t.endsWith(".doc") || t.endsWith(".docx"),
|
|
1579
|
-
Icon:
|
|
1579
|
+
Icon: F
|
|
1580
1580
|
},
|
|
1581
1581
|
{
|
|
1582
1582
|
match: (e) => e.includes("video/"),
|
|
@@ -1585,7 +1585,7 @@ var Sn = [
|
|
|
1585
1585
|
];
|
|
1586
1586
|
function Cn(e) {
|
|
1587
1587
|
for (let { match: t, Icon: n } of Sn) if (t(e.type, e.name)) return /* @__PURE__ */ X(n, { className: "size-5 opacity-60" });
|
|
1588
|
-
return /* @__PURE__ */ X(
|
|
1588
|
+
return /* @__PURE__ */ X(N, { className: "size-5 opacity-60" });
|
|
1589
1589
|
}
|
|
1590
1590
|
function wn({ entry: e }) {
|
|
1591
1591
|
let { file: t } = e;
|
|
@@ -1644,7 +1644,7 @@ function Tn({ variant: e = "image", accept: t = "image/*", maxSize: n = 5 * 1024
|
|
|
1644
1644
|
/* @__PURE__ */ X("div", {
|
|
1645
1645
|
"aria-hidden": "true",
|
|
1646
1646
|
className: "mb-2 flex size-11 shrink-0 items-center justify-center rounded-full border bg-background",
|
|
1647
|
-
children: /* @__PURE__ */ X(
|
|
1647
|
+
children: /* @__PURE__ */ X(ne, { className: "size-4 opacity-60" })
|
|
1648
1648
|
}),
|
|
1649
1649
|
/* @__PURE__ */ X("p", {
|
|
1650
1650
|
className: "mb-1.5 font-medium text-sm",
|
|
@@ -1751,7 +1751,7 @@ function Tn({ variant: e = "image", accept: t = "image/*", maxSize: n = 5 * 1024
|
|
|
1751
1751
|
/* @__PURE__ */ X("div", {
|
|
1752
1752
|
"aria-hidden": "true",
|
|
1753
1753
|
className: "mb-2 flex size-11 shrink-0 items-center justify-center rounded-full border bg-background",
|
|
1754
|
-
children: /* @__PURE__ */ X(
|
|
1754
|
+
children: /* @__PURE__ */ X(te, { className: "size-4 opacity-60" })
|
|
1755
1755
|
}),
|
|
1756
1756
|
/* @__PURE__ */ X("p", {
|
|
1757
1757
|
className: "mb-1.5 font-medium text-sm",
|
|
@@ -1786,15 +1786,15 @@ function Tn({ variant: e = "image", accept: t = "image/*", maxSize: n = 5 * 1024
|
|
|
1786
1786
|
function En(e) {
|
|
1787
1787
|
return typeof e == "object" && !!e && "value" in e && "label" in e;
|
|
1788
1788
|
}
|
|
1789
|
-
function Dn({ options: e = [], groups: t = [], value: r, onValueChange: i, placeholder: a = "Select option", disabled: o = !1, error: s = !1, errorMessage: c, multiple: l = !1, className: u, size: d = "default", variant: f = "default", searchable: p = !1, clearable: m = !1, getOptionLabel: h, getOptionValue: g, renderOptionLabel: _, label: y, description: x, required: S = !1, onCreateNew: C, createNewLabel: w = "New item", loading: T = !1, compactMultiple: E = !1, formatCompactDisplay: D, startItem: O, endItem: k, maxSelections: A, defaultOpen:
|
|
1790
|
-
let [
|
|
1791
|
-
|
|
1792
|
-
}, [
|
|
1789
|
+
function Dn({ options: e = [], groups: t = [], value: r, onValueChange: i, placeholder: a = "Select option", disabled: o = !1, error: s = !1, errorMessage: c, multiple: l = !1, className: u, size: d = "default", variant: f = "default", searchable: p = !1, clearable: m = !1, getOptionLabel: h, getOptionValue: g, renderOptionLabel: _, label: y, description: x, required: S = !1, onCreateNew: C, createNewLabel: w = "New item", loading: T = !1, compactMultiple: E = !1, formatCompactDisplay: D, startItem: O, endItem: k, maxSelections: A, defaultOpen: j = !1, onOpenChange: M, onLoadMore: N, hasNextPage: P = !1, isFetchingNextPage: F = !1, allowEmpty: I = !1, showSelectAll: ee = !1, readOnly: te = !1, popoverClassName: ne }) {
|
|
1790
|
+
let [L, R] = n.useState(j), z = n.useRef(!1), B = n.useRef(null), ie = n.useId(), ae = n.useCallback((e) => {
|
|
1791
|
+
te && e || (R(e), M?.(e), e && (z.current = !1));
|
|
1792
|
+
}, [M, te]), [V, oe] = n.useState(l ? Array.isArray(r) ? r : r ? [r] : [] : []);
|
|
1793
1793
|
n.useEffect(() => {
|
|
1794
1794
|
l && oe(Array.isArray(r) ? r : r ? [r] : []);
|
|
1795
1795
|
}, [l, r]), n.useEffect(() => {
|
|
1796
|
-
|
|
1797
|
-
}, [
|
|
1796
|
+
F || (z.current = !1);
|
|
1797
|
+
}, [F]);
|
|
1798
1798
|
let H = n.useCallback((e) => typeof e == "string" ? e : g ? g(e) : En(e) ? e.value : String(e), [g]), se = n.useCallback((n) => {
|
|
1799
1799
|
if (typeof n == "string") {
|
|
1800
1800
|
for (let e of t) {
|
|
@@ -1839,14 +1839,14 @@ function Dn({ options: e = [], groups: t = [], value: r, onValueChange: i, place
|
|
|
1839
1839
|
}
|
|
1840
1840
|
if (l) {
|
|
1841
1841
|
let e = V.some((e) => H(e) === n);
|
|
1842
|
-
if (!e && A && V.length >= A || e && V.length === 1 && !
|
|
1842
|
+
if (!e && A && V.length >= A || e && V.length === 1 && !I) return;
|
|
1843
1843
|
let t = e ? V.filter((e) => H(e) !== n) : [...V, r];
|
|
1844
1844
|
oe(t), i?.(t);
|
|
1845
|
-
} else i?.(r),
|
|
1845
|
+
} else i?.(r), R(!1);
|
|
1846
1846
|
}, me = l && fe.length > 0 && fe.length === V.length, he = () => {
|
|
1847
1847
|
if (l) {
|
|
1848
1848
|
if (me) {
|
|
1849
|
-
|
|
1849
|
+
I && (oe([]), i?.([]));
|
|
1850
1850
|
return;
|
|
1851
1851
|
}
|
|
1852
1852
|
A && fe.length > A || (oe(fe), i?.(fe));
|
|
@@ -1854,18 +1854,18 @@ function Dn({ options: e = [], groups: t = [], value: r, onValueChange: i, place
|
|
|
1854
1854
|
}, ge = (e) => {
|
|
1855
1855
|
e.stopPropagation(), l ? (oe([]), i?.([])) : i?.("");
|
|
1856
1856
|
}, _e = (e, t) => {
|
|
1857
|
-
if (e.stopPropagation(), V.length === 1 && !
|
|
1857
|
+
if (e.stopPropagation(), V.length === 1 && !I) return;
|
|
1858
1858
|
let n = V.filter((e) => H(e) !== H(t));
|
|
1859
1859
|
oe(n), i?.(n);
|
|
1860
1860
|
}, ve = n.useCallback((e) => {
|
|
1861
1861
|
let t = e.currentTarget;
|
|
1862
|
-
t.scrollHeight - t.scrollTop - t.clientHeight < 100 &&
|
|
1862
|
+
t.scrollHeight - t.scrollTop - t.clientHeight < 100 && N && P && !F && !z.current && (z.current = !0, N());
|
|
1863
1863
|
}, [
|
|
1864
|
-
M,
|
|
1865
1864
|
N,
|
|
1866
|
-
P
|
|
1865
|
+
P,
|
|
1866
|
+
F
|
|
1867
1867
|
]), ye = l ? V.length > 0 : !!ce, be = () => l ? null : fe.find((e) => e.value === ce)?.label || a, W = () => {
|
|
1868
|
-
!o && !
|
|
1868
|
+
!o && !te && (B.current?.focus(), R(!0));
|
|
1869
1869
|
}, G = !!(O || k), xe = l && !E, K = xe ? d === "default" ? "min-h-9" : "min-h-8" : d === "default" ? "h-9" : "h-8", q = f === "alt" ? "bg-muted" : "bg-transparent dark:bg-input/30", Se = /* @__PURE__ */ X("div", {
|
|
1870
1870
|
className: Q("flex min-w-0 flex-1 items-center gap-1.5", xe ? "py-1" : "overflow-hidden"),
|
|
1871
1871
|
children: l && V.length > 0 ? E ? /* @__PURE__ */ X("span", {
|
|
@@ -1951,7 +1951,7 @@ function Dn({ options: e = [], groups: t = [], value: r, onValueChange: i, place
|
|
|
1951
1951
|
]
|
|
1952
1952
|
}, e.value);
|
|
1953
1953
|
}, Te = /* @__PURE__ */ X(sn, {
|
|
1954
|
-
className: Q("w-(--radix-popper-anchor-width) min-w-(--radix-popper-anchor-width) p-0",
|
|
1954
|
+
className: Q("w-(--radix-popper-anchor-width) min-w-(--radix-popper-anchor-width) p-0", ne),
|
|
1955
1955
|
align: "start",
|
|
1956
1956
|
onOpenAutoFocus: (e) => {
|
|
1957
1957
|
p || e.preventDefault();
|
|
@@ -1966,7 +1966,7 @@ function Dn({ options: e = [], groups: t = [], value: r, onValueChange: i, place
|
|
|
1966
1966
|
className: "flex items-center justify-center py-6",
|
|
1967
1967
|
children: /* @__PURE__ */ X(re, { className: "size-5 animate-spin text-muted-foreground" })
|
|
1968
1968
|
}) : /* @__PURE__ */ Z(Y, { children: [
|
|
1969
|
-
l &&
|
|
1969
|
+
l && ee && fe.length > 0 && /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(en, { children: /* @__PURE__ */ Z(nn, {
|
|
1970
1970
|
value: "__select_all__",
|
|
1971
1971
|
onSelect: he,
|
|
1972
1972
|
className: "font-medium",
|
|
@@ -1987,7 +1987,7 @@ function Dn({ options: e = [], groups: t = [], value: r, onValueChange: i, place
|
|
|
1987
1987
|
variant: "ghost",
|
|
1988
1988
|
className: "w-full justify-start font-normal",
|
|
1989
1989
|
onClick: () => {
|
|
1990
|
-
C(),
|
|
1990
|
+
C(), R(!1);
|
|
1991
1991
|
},
|
|
1992
1992
|
children: [/* @__PURE__ */ X(de, {
|
|
1993
1993
|
size: 16,
|
|
@@ -1995,7 +1995,7 @@ function Dn({ options: e = [], groups: t = [], value: r, onValueChange: i, place
|
|
|
1995
1995
|
"aria-hidden": !0
|
|
1996
1996
|
}), w]
|
|
1997
1997
|
}) })] }),
|
|
1998
|
-
|
|
1998
|
+
F && /* @__PURE__ */ X("div", {
|
|
1999
1999
|
className: "flex items-center justify-center py-3",
|
|
2000
2000
|
children: /* @__PURE__ */ X(re, { className: "size-4 animate-spin text-muted-foreground" })
|
|
2001
2001
|
})
|
|
@@ -2016,14 +2016,14 @@ function Dn({ options: e = [], groups: t = [], value: r, onValueChange: i, place
|
|
|
2016
2016
|
children: [y, Ee]
|
|
2017
2017
|
}),
|
|
2018
2018
|
G ? /* @__PURE__ */ Z(an, {
|
|
2019
|
-
open:
|
|
2019
|
+
open: L,
|
|
2020
2020
|
onOpenChange: ae,
|
|
2021
2021
|
modal: !1,
|
|
2022
2022
|
children: [/* @__PURE__ */ X(on, {
|
|
2023
2023
|
asChild: !0,
|
|
2024
2024
|
children: /* @__PURE__ */ Z("div", {
|
|
2025
2025
|
"aria-invalid": s,
|
|
2026
|
-
className: Q("flex rounded-md border border-input transition-colors", xe ? "items-stretch" : "items-center overflow-hidden", q, K,
|
|
2026
|
+
className: Q("flex rounded-md border border-input transition-colors", xe ? "items-stretch" : "items-center overflow-hidden", q, K, L && "border-ring ring-3 ring-ring/50", "aria-[invalid=true]:border-destructive aria-[invalid=true]:ring-3 aria-[invalid=true]:ring-destructive/20", o && "pointer-events-none cursor-not-allowed opacity-50"),
|
|
2027
2027
|
children: [
|
|
2028
2028
|
O && /* @__PURE__ */ X("div", {
|
|
2029
2029
|
className: "flex h-full shrink-0 items-center justify-center border-r border-input bg-muted/40 px-3 text-sm text-muted-foreground [&_svg]:size-4",
|
|
@@ -2036,9 +2036,9 @@ function Dn({ options: e = [], groups: t = [], value: r, onValueChange: i, place
|
|
|
2036
2036
|
ref: B,
|
|
2037
2037
|
variant: "ghost",
|
|
2038
2038
|
role: "combobox",
|
|
2039
|
-
"aria-expanded":
|
|
2039
|
+
"aria-expanded": L,
|
|
2040
2040
|
onClick: (e) => {
|
|
2041
|
-
|
|
2041
|
+
te && (e.preventDefault(), e.stopPropagation());
|
|
2042
2042
|
},
|
|
2043
2043
|
className: Q("h-full flex-1 justify-between rounded-none border-0 px-3 py-1 font-normal text-foreground shadow-none hover:bg-transparent focus-visible:ring-0", xe ? "items-start" : "items-center", u),
|
|
2044
2044
|
children: [Se, Ce]
|
|
@@ -2051,7 +2051,7 @@ function Dn({ options: e = [], groups: t = [], value: r, onValueChange: i, place
|
|
|
2051
2051
|
})
|
|
2052
2052
|
}), Te]
|
|
2053
2053
|
}) : /* @__PURE__ */ Z(an, {
|
|
2054
|
-
open:
|
|
2054
|
+
open: L,
|
|
2055
2055
|
onOpenChange: ae,
|
|
2056
2056
|
modal: !1,
|
|
2057
2057
|
children: [/* @__PURE__ */ X(on, {
|
|
@@ -2063,12 +2063,12 @@ function Dn({ options: e = [], groups: t = [], value: r, onValueChange: i, place
|
|
|
2063
2063
|
ref: B,
|
|
2064
2064
|
variant: "outline",
|
|
2065
2065
|
role: "combobox",
|
|
2066
|
-
"aria-expanded":
|
|
2066
|
+
"aria-expanded": L,
|
|
2067
2067
|
"aria-invalid": s,
|
|
2068
2068
|
onClick: (e) => {
|
|
2069
|
-
|
|
2069
|
+
te && (e.preventDefault(), e.stopPropagation());
|
|
2070
2070
|
},
|
|
2071
|
-
className: Q("h-auto w-full justify-between px-3 py-1 font-normal text-foreground", K, xe ? "items-start" : "items-center", q,
|
|
2071
|
+
className: Q("h-auto w-full justify-between px-3 py-1 font-normal text-foreground", K, xe ? "items-start" : "items-center", q, L && "border-ring ring-3 ring-ring/50", u),
|
|
2072
2072
|
children: [Se, Ce]
|
|
2073
2073
|
})
|
|
2074
2074
|
}), Te]
|
|
@@ -2164,56 +2164,67 @@ var Ln = {
|
|
|
2164
2164
|
center: "text-center",
|
|
2165
2165
|
right: "text-right"
|
|
2166
2166
|
};
|
|
2167
|
-
function Rn({ columns: e, data: t, getRowId: r = (e, t) => String(t),
|
|
2167
|
+
function Rn({ columns: e, data: t, getRowId: r = (e, t) => String(t), isRowDisabled: i, selectable: a = !1, selectedIds: o, onSelectionChange: s, rowActions: c, loading: l = !1, emptyMessage: u = "No results.", pagination: d = !1, pageSize: f = 25, pageSizeOptions: p = [
|
|
2168
2168
|
25,
|
|
2169
2169
|
50,
|
|
2170
2170
|
100,
|
|
2171
2171
|
200
|
|
2172
|
-
], striped:
|
|
2173
|
-
let
|
|
2174
|
-
|
|
2175
|
-
|
|
2172
|
+
], striped: m = !0, stickyHeader: h = !1, maxHeight: g, fillHeight: _ = !1, onRowClick: v, className: y }) {
|
|
2173
|
+
let b = n.useMemo(() => t.map((e, t) => r(e, t)), [t, r]), C = n.useMemo(() => {
|
|
2174
|
+
let e = {};
|
|
2175
|
+
return t.forEach((t, n) => {
|
|
2176
|
+
e[r(t, n)] = i?.(t, n) ?? !1;
|
|
2177
|
+
}), e;
|
|
2178
|
+
}, [
|
|
2179
|
+
t,
|
|
2180
|
+
r,
|
|
2181
|
+
i
|
|
2182
|
+
]), E = n.useMemo(() => b.filter((e) => !C[e]), [b, C]), [D, O] = n.useState([]), k = o ?? D, A = (e) => {
|
|
2183
|
+
o === void 0 && O(e), s?.(e);
|
|
2184
|
+
}, j = E.length > 0 && E.every((e) => k.includes(e)), M = k.length > 0 && !j, N = () => A(j ? k.filter((e) => C[e]) : [...new Set([...k, ...E])]), P = (e) => {
|
|
2185
|
+
C[e] || A(k.includes(e) ? k.filter((t) => t !== e) : [...k, e]);
|
|
2186
|
+
}, F = e.length + +!!a + +!!c, [I, ee] = n.useState(f), [te, ne] = n.useState(0), L = d ? Math.max(1, Math.ceil(t.length / I)) : 1, R = Math.min(te, L - 1), z = n.useMemo(() => {
|
|
2176
2187
|
let e = t.map((e, t) => ({
|
|
2177
2188
|
row: e,
|
|
2178
2189
|
index: t
|
|
2179
2190
|
}));
|
|
2180
|
-
if (!
|
|
2181
|
-
let n =
|
|
2182
|
-
return e.slice(n, n +
|
|
2191
|
+
if (!d) return e;
|
|
2192
|
+
let n = R * I;
|
|
2193
|
+
return e.slice(n, n + I);
|
|
2183
2194
|
}, [
|
|
2184
2195
|
t,
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
]),
|
|
2196
|
+
d,
|
|
2197
|
+
R,
|
|
2198
|
+
I
|
|
2199
|
+
]), re = "px-4 py-3 first:pl-5 last:pr-5", B = "px-4 first:pl-5 last:pr-5", ie = !_ && g !== void 0 ? typeof g == "number" ? `${g}px` : g : void 0;
|
|
2189
2200
|
return /* @__PURE__ */ Z("div", {
|
|
2190
|
-
className: Q("overflow-hidden rounded-lg border",
|
|
2191
|
-
style:
|
|
2201
|
+
className: Q("overflow-hidden rounded-lg border", d && "rounded-b-none border-b-0", (_ || g !== void 0) && "flex min-h-0 flex-col [&_[data-slot=table-container]]:overflow-y-auto", _ && "min-h-0 flex-1 [&_[data-slot=table-container]]:min-h-0 [&_[data-slot=table-container]]:flex-1", !_ && g !== void 0 && "[&_[data-slot=table-container]]:max-h-(--dt-max-h)", y),
|
|
2202
|
+
style: ie ? { "--dt-max-h": ie } : void 0,
|
|
2192
2203
|
children: [/* @__PURE__ */ Z(kn, { children: [/* @__PURE__ */ X(An, {
|
|
2193
|
-
className: Q("bg-muted/60",
|
|
2204
|
+
className: Q("bg-muted/60", h && Q("sticky top-0 z-10 [&_th]:border-b [&_th]:bg-muted/95 [&_th]:backdrop-blur supports-backdrop-filter:[&_th]:bg-muted/80", "[&_th:first-child]:rounded-tl-lg [&_th:last-child]:rounded-tr-lg")),
|
|
2194
2205
|
children: /* @__PURE__ */ Z(Nn, {
|
|
2195
2206
|
className: "hover:bg-transparent",
|
|
2196
2207
|
children: [
|
|
2197
|
-
|
|
2198
|
-
className: Q("w-10",
|
|
2208
|
+
a && /* @__PURE__ */ X(Pn, {
|
|
2209
|
+
className: Q("w-10", B),
|
|
2199
2210
|
children: /* @__PURE__ */ X(On, {
|
|
2200
2211
|
"aria-label": "Select all rows",
|
|
2201
|
-
checked:
|
|
2202
|
-
onCheckedChange:
|
|
2212
|
+
checked: j ? !0 : M ? "indeterminate" : !1,
|
|
2213
|
+
onCheckedChange: N
|
|
2203
2214
|
})
|
|
2204
2215
|
}),
|
|
2205
2216
|
e.map((e) => /* @__PURE__ */ X(Pn, {
|
|
2206
2217
|
style: e.width ? { width: e.width } : void 0,
|
|
2207
|
-
className: Q("h-11 text-xs font-semibold tracking-wide text-foreground uppercase",
|
|
2218
|
+
className: Q("h-11 text-xs font-semibold tracking-wide text-foreground uppercase", B, e.align && Ln[e.align], e.className, e.headerClassName),
|
|
2208
2219
|
children: e.header
|
|
2209
2220
|
}, e.key)),
|
|
2210
|
-
|
|
2221
|
+
c && /* @__PURE__ */ X(Pn, { className: "w-12" })
|
|
2211
2222
|
]
|
|
2212
2223
|
})
|
|
2213
|
-
}), /* @__PURE__ */ X(jn, { children:
|
|
2224
|
+
}), /* @__PURE__ */ X(jn, { children: l ? /* @__PURE__ */ X(Nn, {
|
|
2214
2225
|
className: "hover:bg-transparent",
|
|
2215
2226
|
children: /* @__PURE__ */ X(Fn, {
|
|
2216
|
-
colSpan:
|
|
2227
|
+
colSpan: F,
|
|
2217
2228
|
className: "h-28 text-center",
|
|
2218
2229
|
children: /* @__PURE__ */ Z("span", {
|
|
2219
2230
|
className: "inline-flex items-center gap-2 text-muted-foreground",
|
|
@@ -2223,47 +2234,50 @@ function Rn({ columns: e, data: t, getRowId: r = (e, t) => String(t), selectable
|
|
|
2223
2234
|
}) : t.length === 0 ? /* @__PURE__ */ X(Nn, {
|
|
2224
2235
|
className: "hover:bg-transparent",
|
|
2225
2236
|
children: /* @__PURE__ */ X(Fn, {
|
|
2226
|
-
colSpan:
|
|
2237
|
+
colSpan: F,
|
|
2227
2238
|
className: "h-28 text-center text-muted-foreground",
|
|
2228
|
-
children:
|
|
2239
|
+
children: u
|
|
2229
2240
|
})
|
|
2230
|
-
}) :
|
|
2231
|
-
let r =
|
|
2241
|
+
}) : z.map(({ row: t, index: n }) => {
|
|
2242
|
+
let r = b[n], i = k.includes(r), o = C[r];
|
|
2232
2243
|
return /* @__PURE__ */ Z(Nn, {
|
|
2233
|
-
"data-state":
|
|
2234
|
-
|
|
2235
|
-
|
|
2244
|
+
"data-state": i ? "selected" : void 0,
|
|
2245
|
+
"data-disabled": o ? "" : void 0,
|
|
2246
|
+
"aria-disabled": o || void 0,
|
|
2247
|
+
onClick: v && !o ? () => v(t) : void 0,
|
|
2248
|
+
className: Q(m && !i && "odd:bg-muted/40", i && "bg-primary/10 shadow-[inset_3px_0_0_0_var(--primary)] hover:bg-primary/15", v && !o && "cursor-pointer", o && "opacity-50 hover:bg-transparent"),
|
|
2236
2249
|
children: [
|
|
2237
|
-
|
|
2238
|
-
className: Q("w-10",
|
|
2250
|
+
a && /* @__PURE__ */ X(Fn, {
|
|
2251
|
+
className: Q("w-10", re),
|
|
2239
2252
|
onClick: (e) => e.stopPropagation(),
|
|
2240
2253
|
children: /* @__PURE__ */ X(On, {
|
|
2241
2254
|
"aria-label": "Select row",
|
|
2242
|
-
checked:
|
|
2243
|
-
|
|
2255
|
+
checked: i,
|
|
2256
|
+
disabled: o,
|
|
2257
|
+
onCheckedChange: () => P(r)
|
|
2244
2258
|
})
|
|
2245
2259
|
}),
|
|
2246
2260
|
e.map((e) => /* @__PURE__ */ X(Fn, {
|
|
2247
2261
|
style: e.width ? { width: e.width } : void 0,
|
|
2248
|
-
className: Q(
|
|
2262
|
+
className: Q(re, e.align && Ln[e.align], e.className),
|
|
2249
2263
|
children: e.cell ? e.cell(t, n) : String(t[e.key] ?? "")
|
|
2250
2264
|
}, e.key)),
|
|
2251
|
-
|
|
2265
|
+
c && /* @__PURE__ */ X(Fn, {
|
|
2252
2266
|
className: "w-12 pr-3 text-right",
|
|
2253
2267
|
onClick: (e) => e.stopPropagation(),
|
|
2254
|
-
children: /* @__PURE__ */ X(pt, { items:
|
|
2268
|
+
children: /* @__PURE__ */ X(pt, { items: c(t) })
|
|
2255
2269
|
})
|
|
2256
2270
|
]
|
|
2257
2271
|
}, r);
|
|
2258
|
-
}) })] }),
|
|
2272
|
+
}) })] }), d && /* @__PURE__ */ Z("div", {
|
|
2259
2273
|
className: "flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 text-sm",
|
|
2260
2274
|
children: [/* @__PURE__ */ Z("p", {
|
|
2261
2275
|
className: "text-muted-foreground",
|
|
2262
2276
|
children: [
|
|
2263
2277
|
"Page ",
|
|
2264
|
-
t.length === 0 ? 0 :
|
|
2278
|
+
t.length === 0 ? 0 : R + 1,
|
|
2265
2279
|
" of ",
|
|
2266
|
-
|
|
2280
|
+
L,
|
|
2267
2281
|
" (",
|
|
2268
2282
|
t.length,
|
|
2269
2283
|
" total ",
|
|
@@ -2272,7 +2286,7 @@ function Rn({ columns: e, data: t, getRowId: r = (e, t) => String(t), selectable
|
|
|
2272
2286
|
]
|
|
2273
2287
|
}), /* @__PURE__ */ Z("div", {
|
|
2274
2288
|
className: "flex items-center gap-4",
|
|
2275
|
-
children: [
|
|
2289
|
+
children: [p && p.length > 0 && /* @__PURE__ */ Z("div", {
|
|
2276
2290
|
className: "flex items-center gap-2 text-muted-foreground",
|
|
2277
2291
|
children: [/* @__PURE__ */ X("span", {
|
|
2278
2292
|
className: "whitespace-nowrap",
|
|
@@ -2280,12 +2294,12 @@ function Rn({ columns: e, data: t, getRowId: r = (e, t) => String(t), selectable
|
|
|
2280
2294
|
}), /* @__PURE__ */ X(Dn, {
|
|
2281
2295
|
size: "sm",
|
|
2282
2296
|
className: "w-20",
|
|
2283
|
-
value: String(
|
|
2297
|
+
value: String(I),
|
|
2284
2298
|
onValueChange: (e) => {
|
|
2285
2299
|
let t = typeof e == "object" && e && "value" in e ? e.value : e;
|
|
2286
|
-
|
|
2300
|
+
ee(Number(t)), ne(0);
|
|
2287
2301
|
},
|
|
2288
|
-
options:
|
|
2302
|
+
options: p.map((e) => ({
|
|
2289
2303
|
value: String(e),
|
|
2290
2304
|
label: String(e)
|
|
2291
2305
|
}))
|
|
@@ -2297,32 +2311,32 @@ function Rn({ columns: e, data: t, getRowId: r = (e, t) => String(t), selectable
|
|
|
2297
2311
|
variant: "outline",
|
|
2298
2312
|
size: "icon-sm",
|
|
2299
2313
|
"aria-label": "First page",
|
|
2300
|
-
disabled:
|
|
2301
|
-
onClick: () =>
|
|
2314
|
+
disabled: R <= 0,
|
|
2315
|
+
onClick: () => ne(0),
|
|
2302
2316
|
children: /* @__PURE__ */ X(w, {})
|
|
2303
2317
|
}),
|
|
2304
2318
|
/* @__PURE__ */ X($, {
|
|
2305
2319
|
variant: "outline",
|
|
2306
2320
|
size: "icon-sm",
|
|
2307
2321
|
"aria-label": "Previous page",
|
|
2308
|
-
disabled:
|
|
2309
|
-
onClick: () =>
|
|
2322
|
+
disabled: R <= 0,
|
|
2323
|
+
onClick: () => ne(Math.max(0, R - 1)),
|
|
2310
2324
|
children: /* @__PURE__ */ X(x, {})
|
|
2311
2325
|
}),
|
|
2312
2326
|
/* @__PURE__ */ X($, {
|
|
2313
2327
|
variant: "outline",
|
|
2314
2328
|
size: "icon-sm",
|
|
2315
2329
|
"aria-label": "Next page",
|
|
2316
|
-
disabled:
|
|
2317
|
-
onClick: () =>
|
|
2330
|
+
disabled: R >= L - 1,
|
|
2331
|
+
onClick: () => ne(Math.min(L - 1, R + 1)),
|
|
2318
2332
|
children: /* @__PURE__ */ X(S, {})
|
|
2319
2333
|
}),
|
|
2320
2334
|
/* @__PURE__ */ X($, {
|
|
2321
2335
|
variant: "outline",
|
|
2322
2336
|
size: "icon-sm",
|
|
2323
2337
|
"aria-label": "Last page",
|
|
2324
|
-
disabled:
|
|
2325
|
-
onClick: () =>
|
|
2338
|
+
disabled: R >= L - 1,
|
|
2339
|
+
onClick: () => ne(L - 1),
|
|
2326
2340
|
children: /* @__PURE__ */ X(T, {})
|
|
2327
2341
|
})
|
|
2328
2342
|
]
|
|
@@ -3033,7 +3047,7 @@ function br({ className: e, ...t }) {
|
|
|
3033
3047
|
}
|
|
3034
3048
|
//#endregion
|
|
3035
3049
|
//#region src/components/custom/empty-state.tsx
|
|
3036
|
-
function xr({ icon: e = /* @__PURE__ */ X(
|
|
3050
|
+
function xr({ icon: e = /* @__PURE__ */ X(L, {}), mediaVariant: t = "icon", title: n = "No data", description: r, actions: i, ...a }) {
|
|
3037
3051
|
return /* @__PURE__ */ Z(mr, {
|
|
3038
3052
|
...a,
|
|
3039
3053
|
children: [/* @__PURE__ */ Z(hr, { children: [
|
|
@@ -3329,7 +3343,7 @@ function kr({ code: e = "404", title: t = "Page Not Found", description: n = "So
|
|
|
3329
3343
|
asChild: !0,
|
|
3330
3344
|
children: /* @__PURE__ */ Z("a", {
|
|
3331
3345
|
href: a,
|
|
3332
|
-
children: [/* @__PURE__ */ X(
|
|
3346
|
+
children: [/* @__PURE__ */ X(ee, {}), o]
|
|
3333
3347
|
})
|
|
3334
3348
|
}),
|
|
3335
3349
|
s
|
|
@@ -4306,7 +4320,7 @@ function Ai({ value: e, onChange: t, label: r, placeholder: i = "Select date & t
|
|
|
4306
4320
|
if (t.setHours(23, 59, 59, 999), e > t) return !0;
|
|
4307
4321
|
}
|
|
4308
4322
|
return !1;
|
|
4309
|
-
}, A = (/* @__PURE__ */ new Date()).getFullYear(), [
|
|
4323
|
+
}, A = (/* @__PURE__ */ new Date()).getFullYear(), [j, M] = u ?? [A - 100, A + 5], N = s ? Math.max(j, new Date(s).getFullYear()) : j, P = c ? Math.min(M, new Date(c).getFullYear()) : M, F = new Date(N, 0, 1), I = new Date(P, 11, 31), ee = _ ? new Date(e).toLocaleString("en-US", {
|
|
4310
4324
|
year: "numeric",
|
|
4311
4325
|
month: "short",
|
|
4312
4326
|
day: "2-digit",
|
|
@@ -4335,7 +4349,7 @@ function Ai({ value: e, onChange: t, label: r, placeholder: i = "Select date & t
|
|
|
4335
4349
|
className: Q("flex h-8 w-full items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-1 text-sm transition-colors outline-none dark:bg-input/30", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", p && "border-ring ring-3 ring-ring/50", !_ && "text-muted-foreground", "disabled:pointer-events-none disabled:opacity-50"),
|
|
4336
4350
|
children: [/* @__PURE__ */ X("span", {
|
|
4337
4351
|
className: "truncate",
|
|
4338
|
-
children:
|
|
4352
|
+
children: ee
|
|
4339
4353
|
}), /* @__PURE__ */ X(g, { className: "size-3.5 shrink-0 opacity-60" })]
|
|
4340
4354
|
})
|
|
4341
4355
|
}), /* @__PURE__ */ Z(sn, {
|
|
@@ -4349,8 +4363,8 @@ function Ai({ value: e, onChange: t, label: r, placeholder: i = "Select date & t
|
|
|
4349
4363
|
disabled: O,
|
|
4350
4364
|
defaultMonth: w,
|
|
4351
4365
|
captionLayout: l,
|
|
4352
|
-
startMonth:
|
|
4353
|
-
endMonth:
|
|
4366
|
+
startMonth: F,
|
|
4367
|
+
endMonth: I,
|
|
4354
4368
|
autoFocus: !0
|
|
4355
4369
|
}), a && /* @__PURE__ */ Z("div", {
|
|
4356
4370
|
className: "flex items-center gap-2 border-t px-3 py-2.5",
|
|
@@ -4868,19 +4882,19 @@ function va(e) {
|
|
|
4868
4882
|
};
|
|
4869
4883
|
}
|
|
4870
4884
|
var ya = i(function({ children: e, className: t, theme: n, styles: r, projection: i, viewport: o, onViewportChange: c, loading: p = !1, controls: m = !0, tiles: h = ma, ...g }, _) {
|
|
4871
|
-
let v = h === !1 ? [] : h, y = d(null), [b, x] = f(null), [S, C] = f(!1), [w, T] = f(!1), [E, D] = f(0), O = d(null), k = d(null), A = d(!1),
|
|
4872
|
-
|
|
4873
|
-
let
|
|
4885
|
+
let v = h === !1 ? [] : h, y = d(null), [b, x] = f(null), [S, C] = f(!1), [w, T] = f(!1), [E, D] = f(0), O = d(null), k = d(null), A = d(!1), j = o !== void 0 && c !== void 0, M = d(c);
|
|
4886
|
+
M.current = c;
|
|
4887
|
+
let N = u(() => ({
|
|
4874
4888
|
dark: r?.dark ?? pa.dark,
|
|
4875
4889
|
light: r?.light ?? pa.light
|
|
4876
4890
|
}), [r]);
|
|
4877
4891
|
l(_, () => b, [b]);
|
|
4878
|
-
let
|
|
4892
|
+
let P = a(() => {
|
|
4879
4893
|
k.current &&= (clearTimeout(k.current), null);
|
|
4880
4894
|
}, []);
|
|
4881
4895
|
s(() => {
|
|
4882
4896
|
if (!y.current) return;
|
|
4883
|
-
let e = v[0]?.url ??
|
|
4897
|
+
let e = v[0]?.url ?? N.light;
|
|
4884
4898
|
O.current = e;
|
|
4885
4899
|
let t = new He.Map({
|
|
4886
4900
|
container: y.current,
|
|
@@ -4890,17 +4904,17 @@ var ya = i(function({ children: e, className: t, theme: n, styles: r, projection
|
|
|
4890
4904
|
...g,
|
|
4891
4905
|
...o
|
|
4892
4906
|
}), n = () => {
|
|
4893
|
-
|
|
4907
|
+
P(), k.current = setTimeout(() => {
|
|
4894
4908
|
T(!0), i && t.setProjection(i);
|
|
4895
4909
|
}, 100);
|
|
4896
4910
|
}, r = () => C(!0), a = () => {
|
|
4897
|
-
A.current ||
|
|
4911
|
+
A.current || M.current?.(va(t));
|
|
4898
4912
|
};
|
|
4899
4913
|
return t.on("load", r), t.on("styledata", n), t.on("move", a), x(t), () => {
|
|
4900
|
-
|
|
4914
|
+
P(), t.off("load", r), t.off("styledata", n), t.off("move", a), t.remove(), C(!1), T(!1), x(null);
|
|
4901
4915
|
};
|
|
4902
4916
|
}, []), s(() => {
|
|
4903
|
-
if (!b || !
|
|
4917
|
+
if (!b || !j || !o || b.isMoving()) return;
|
|
4904
4918
|
let e = va(b), t = {
|
|
4905
4919
|
center: o.center ?? e.center,
|
|
4906
4920
|
zoom: o.zoom ?? e.zoom,
|
|
@@ -4910,20 +4924,20 @@ var ya = i(function({ children: e, className: t, theme: n, styles: r, projection
|
|
|
4910
4924
|
t.center[0] === e.center[0] && t.center[1] === e.center[1] && t.zoom === e.zoom && t.bearing === e.bearing && t.pitch === e.pitch || (A.current = !0, b.jumpTo(t), A.current = !1);
|
|
4911
4925
|
}, [
|
|
4912
4926
|
b,
|
|
4913
|
-
|
|
4927
|
+
j,
|
|
4914
4928
|
o
|
|
4915
4929
|
]), s(() => {
|
|
4916
4930
|
if (!b) return;
|
|
4917
|
-
let e = v[E]?.url ?? (n === "dark" ?
|
|
4918
|
-
O.current !== e && (
|
|
4931
|
+
let e = v[E]?.url ?? (n === "dark" ? N.dark : N.light);
|
|
4932
|
+
O.current !== e && (P(), O.current = e, T(!1), b.setStyle(e, { diff: !0 }));
|
|
4919
4933
|
}, [
|
|
4920
4934
|
b,
|
|
4921
4935
|
E,
|
|
4922
4936
|
n,
|
|
4923
|
-
|
|
4924
|
-
|
|
4937
|
+
N,
|
|
4938
|
+
P
|
|
4925
4939
|
]);
|
|
4926
|
-
let
|
|
4940
|
+
let F = u(() => ({
|
|
4927
4941
|
map: b,
|
|
4928
4942
|
isLoaded: S && w
|
|
4929
4943
|
}), [
|
|
@@ -4932,7 +4946,7 @@ var ya = i(function({ children: e, className: t, theme: n, styles: r, projection
|
|
|
4932
4946
|
w
|
|
4933
4947
|
]);
|
|
4934
4948
|
return /* @__PURE__ */ X(ha.Provider, {
|
|
4935
|
-
value:
|
|
4949
|
+
value: F,
|
|
4936
4950
|
children: /* @__PURE__ */ Z("div", {
|
|
4937
4951
|
ref: y,
|
|
4938
4952
|
className: Q("relative h-full w-full", t),
|
|
@@ -5716,7 +5730,7 @@ var Ya = ({ ...e }) => {
|
|
|
5716
5730
|
className: "toaster group",
|
|
5717
5731
|
icons: {
|
|
5718
5732
|
success: /* @__PURE__ */ X(E, { className: "size-4" }),
|
|
5719
|
-
info: /* @__PURE__ */ X(
|
|
5733
|
+
info: /* @__PURE__ */ X(R, { className: "size-4" }),
|
|
5720
5734
|
warning: /* @__PURE__ */ X(_e, { className: "size-4" }),
|
|
5721
5735
|
error: /* @__PURE__ */ X(se, { className: "size-4" }),
|
|
5722
5736
|
loading: /* @__PURE__ */ X(B, { className: "size-4 animate-spin" })
|