@sentio/ui-core 0.1.3 → 0.1.5
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.css +505 -40
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +133 -22
- package/dist/index.d.ts +133 -22
- package/dist/index.js +1046 -208
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1030 -185
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +7 -6
package/dist/index.mjs
CHANGED
|
@@ -46,39 +46,41 @@ import React from "react";
|
|
|
46
46
|
import { ClipLoader } from "react-spinners";
|
|
47
47
|
import { cx as classNames2 } from "class-variance-authority";
|
|
48
48
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
49
|
-
var SpinLoading = React.forwardRef(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
),
|
|
68
|
-
/* @__PURE__ */ jsx2("div", { className: "absolute left-[50%] top-[50%] z-[1] -translate-y-6", children: /* @__PURE__ */ jsx2(
|
|
69
|
-
ClipLoader,
|
|
70
|
-
{
|
|
71
|
-
loading,
|
|
72
|
-
color: "#3B82F6",
|
|
73
|
-
size,
|
|
74
|
-
cssOverride: {
|
|
75
|
-
borderWidth: 3
|
|
49
|
+
var SpinLoading = React.forwardRef(
|
|
50
|
+
function Spinner(args, ref) {
|
|
51
|
+
const {
|
|
52
|
+
loading = false,
|
|
53
|
+
children,
|
|
54
|
+
className,
|
|
55
|
+
size = 48,
|
|
56
|
+
showMask,
|
|
57
|
+
maskOpacity = 80
|
|
58
|
+
} = args;
|
|
59
|
+
return /* @__PURE__ */ jsxs2("div", { ref, className: classNames2("relative", className), children: [
|
|
60
|
+
showMask && loading && /* @__PURE__ */ jsx2(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
className: classNames2(
|
|
64
|
+
"absolute bottom-0 left-0 right-0 top-0 z-[1]",
|
|
65
|
+
maskOpacity ? `bg-white dark:bg-sentio-gray-100/${maskOpacity}` : "dark:bg-sentio-gray-100 bg-white"
|
|
66
|
+
)
|
|
76
67
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ jsx2("div", { className: "absolute left-[50%] top-[50%] z-[1] -translate-y-6", children: /* @__PURE__ */ jsx2(
|
|
70
|
+
ClipLoader,
|
|
71
|
+
{
|
|
72
|
+
loading,
|
|
73
|
+
color: "#3B82F6",
|
|
74
|
+
size,
|
|
75
|
+
cssOverride: {
|
|
76
|
+
borderWidth: 3
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
) }),
|
|
80
|
+
children
|
|
81
|
+
] });
|
|
82
|
+
}
|
|
83
|
+
);
|
|
82
84
|
|
|
83
85
|
// src/common/CopyButton.tsx
|
|
84
86
|
import {
|
|
@@ -270,7 +272,11 @@ var CopyButton = ({
|
|
|
270
272
|
};
|
|
271
273
|
|
|
272
274
|
// src/common/NewButton.tsx
|
|
273
|
-
import {
|
|
275
|
+
import {
|
|
276
|
+
cloneElement,
|
|
277
|
+
forwardRef,
|
|
278
|
+
useMemo
|
|
279
|
+
} from "react";
|
|
274
280
|
|
|
275
281
|
// src/common/DivTooltip.tsx
|
|
276
282
|
import React2, { useRef as useRef2, useState as useState2, useEffect as useEffect2 } from "react";
|
|
@@ -406,7 +412,7 @@ var PopoverTooltip = ({
|
|
|
406
412
|
!hideArrow && placement === "bottom" && /* @__PURE__ */ jsx4(
|
|
407
413
|
"div",
|
|
408
414
|
{
|
|
409
|
-
className: "arrow dark:
|
|
415
|
+
className: "arrow dark:bg-sentio-gray-100 before:border-border-color -translate-y-[7px] bg-white before:visible before:border before:border-b-0 before:border-r-0",
|
|
410
416
|
ref: arrowRef,
|
|
411
417
|
style: {
|
|
412
418
|
left: arrowX ?? 0,
|
|
@@ -540,23 +546,30 @@ var buttonClass = cva(["inline-flex", "items-center", "font-medium"], {
|
|
|
540
546
|
disabled: false
|
|
541
547
|
}
|
|
542
548
|
});
|
|
543
|
-
function Proccessing({
|
|
549
|
+
function Proccessing({
|
|
550
|
+
className,
|
|
551
|
+
light
|
|
552
|
+
}) {
|
|
544
553
|
return /* @__PURE__ */ jsxs5("svg", { className: `h-5 w-5 animate-spin ${className}`, viewBox: "0 0 24 24", children: [
|
|
545
554
|
/* @__PURE__ */ jsx5(
|
|
546
555
|
"circle",
|
|
547
556
|
{
|
|
548
|
-
className: light ? "opacity-5" : "opacity-10",
|
|
549
557
|
cx: "12",
|
|
550
558
|
cy: "12",
|
|
551
559
|
r: "10",
|
|
552
560
|
stroke: "currentColor",
|
|
553
|
-
strokeWidth: "4"
|
|
561
|
+
strokeWidth: "4",
|
|
562
|
+
style: {
|
|
563
|
+
opacity: light ? 0.05 : 0.1
|
|
564
|
+
}
|
|
554
565
|
}
|
|
555
566
|
),
|
|
556
567
|
/* @__PURE__ */ jsx5(
|
|
557
568
|
"path",
|
|
558
569
|
{
|
|
559
|
-
|
|
570
|
+
style: {
|
|
571
|
+
opacity: light ? 0.5 : 0.75
|
|
572
|
+
},
|
|
560
573
|
fill: "currentColor",
|
|
561
574
|
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
562
575
|
}
|
|
@@ -619,12 +632,17 @@ function Button({
|
|
|
619
632
|
iconEl2 = /* @__PURE__ */ jsx5(
|
|
620
633
|
Proccessing,
|
|
621
634
|
{
|
|
622
|
-
className: cx(
|
|
635
|
+
className: cx(
|
|
636
|
+
pIconClass({ size }),
|
|
637
|
+
role == "primary" ? "text-white" : ""
|
|
638
|
+
),
|
|
623
639
|
light: role !== "primary"
|
|
624
640
|
}
|
|
625
641
|
);
|
|
626
642
|
} else if (icon) {
|
|
627
|
-
iconEl2 = cloneElement(icon, {
|
|
643
|
+
iconEl2 = cloneElement(icon, {
|
|
644
|
+
className: cx(icon.props.className, iconClasses)
|
|
645
|
+
});
|
|
628
646
|
}
|
|
629
647
|
return iconEl2;
|
|
630
648
|
}, [icon, iconClasses, processing, role]);
|
|
@@ -2030,7 +2048,7 @@ var FlatTree = (props) => {
|
|
|
2030
2048
|
var FlatTree_default = memo3(FlatTree);
|
|
2031
2049
|
|
|
2032
2050
|
// src/common/text/LinkifyText.tsx
|
|
2033
|
-
import
|
|
2051
|
+
import linkifyHtml from "linkify-html";
|
|
2034
2052
|
import DOMPurify from "dompurify";
|
|
2035
2053
|
import { memo as memo4 } from "react";
|
|
2036
2054
|
import { isString as isString2, isUndefined, isNull } from "lodash";
|
|
@@ -2046,7 +2064,7 @@ if (DOMPurify?.addHook) {
|
|
|
2046
2064
|
});
|
|
2047
2065
|
}
|
|
2048
2066
|
var renderTextWithColoredNumbers = (text) => {
|
|
2049
|
-
const numberRegex = /\b(\d+(?:\.\d+)?)\b/g;
|
|
2067
|
+
const numberRegex = /\b(\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b/g;
|
|
2050
2068
|
return text.replace(numberRegex, (match, number, offset2) => {
|
|
2051
2069
|
const before = text.charAt(offset2 - 1);
|
|
2052
2070
|
const after = text.charAt(offset2 + match.length);
|
|
@@ -2070,7 +2088,7 @@ var LinkifyText = memo4(function LinkifyText2({
|
|
|
2070
2088
|
}
|
|
2071
2089
|
return null;
|
|
2072
2090
|
}
|
|
2073
|
-
const linkStr =
|
|
2091
|
+
const linkStr = linkifyHtml(
|
|
2074
2092
|
isHighlightNumbers ? renderTextWithColoredNumbers(text) : text,
|
|
2075
2093
|
{
|
|
2076
2094
|
attributes: {
|
|
@@ -2094,15 +2112,96 @@ import { useContext as useContext4 } from "react";
|
|
|
2094
2112
|
|
|
2095
2113
|
// src/utils/extension-context.ts
|
|
2096
2114
|
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
2115
|
+
|
|
2116
|
+
// src/utils/use-dark-mode.ts
|
|
2117
|
+
import { useEffect as useEffect7, useState as useState9 } from "react";
|
|
2118
|
+
var DarkModeListener = class _DarkModeListener {
|
|
2119
|
+
constructor() {
|
|
2120
|
+
this.isDarkMode = false;
|
|
2121
|
+
this.listeners = [];
|
|
2122
|
+
this.init();
|
|
2123
|
+
}
|
|
2124
|
+
static get instance() {
|
|
2125
|
+
if (!this._instance) {
|
|
2126
|
+
this._instance = new _DarkModeListener();
|
|
2127
|
+
}
|
|
2128
|
+
return this._instance;
|
|
2129
|
+
}
|
|
2130
|
+
addListener(listener) {
|
|
2131
|
+
this.listeners.push(listener);
|
|
2132
|
+
}
|
|
2133
|
+
removeListener(listener) {
|
|
2134
|
+
this.listeners = this.listeners.filter((l) => l !== listener);
|
|
2135
|
+
}
|
|
2136
|
+
get darkMode() {
|
|
2137
|
+
return this.isDarkMode;
|
|
2138
|
+
}
|
|
2139
|
+
_sync(theme = "system") {
|
|
2140
|
+
let isDarkMode = false;
|
|
2141
|
+
if (theme === "system") {
|
|
2142
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2143
|
+
isDarkMode = mediaQuery.matches;
|
|
2144
|
+
localStorage.setItem("theme", "system");
|
|
2145
|
+
} else if (theme === "light") {
|
|
2146
|
+
isDarkMode = false;
|
|
2147
|
+
localStorage.removeItem("theme");
|
|
2148
|
+
} else {
|
|
2149
|
+
isDarkMode = theme === "dark";
|
|
2150
|
+
localStorage.setItem("theme", "dark");
|
|
2151
|
+
}
|
|
2152
|
+
this.isDarkMode = isDarkMode;
|
|
2153
|
+
document.body.classList.remove("light", "dark");
|
|
2154
|
+
document.body.classList.add(isDarkMode ? "dark" : "light");
|
|
2155
|
+
this.listeners.forEach((listener) => listener(isDarkMode));
|
|
2156
|
+
}
|
|
2157
|
+
toggleDarkMode() {
|
|
2158
|
+
this.isDarkMode = document.body.classList.contains("dark");
|
|
2159
|
+
this._sync(this.isDarkMode ? "light" : "dark");
|
|
2160
|
+
}
|
|
2161
|
+
setDarkMode(value) {
|
|
2162
|
+
this._sync(value);
|
|
2163
|
+
}
|
|
2164
|
+
init() {
|
|
2165
|
+
this.isDarkMode = document.body.classList.contains("dark");
|
|
2166
|
+
const observer = new MutationObserver((mutationsList) => {
|
|
2167
|
+
for (const mutation of mutationsList) {
|
|
2168
|
+
if (mutation.type === "attributes" && mutation.attributeName === "class") {
|
|
2169
|
+
const isDarkMode = document.body.classList.contains("dark");
|
|
2170
|
+
if (this.isDarkMode !== isDarkMode) {
|
|
2171
|
+
this.isDarkMode = isDarkMode;
|
|
2172
|
+
this.listeners.forEach((listener) => listener(isDarkMode));
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
});
|
|
2177
|
+
const config = {
|
|
2178
|
+
attributes: true,
|
|
2179
|
+
// Observe attribute changes
|
|
2180
|
+
attributeFilter: ["class"]
|
|
2181
|
+
// Only observe changes to the 'class' attribute
|
|
2182
|
+
};
|
|
2183
|
+
observer.observe(document.body, config);
|
|
2184
|
+
}
|
|
2185
|
+
};
|
|
2186
|
+
var useDarkMode = () => {
|
|
2187
|
+
const [isDarkMode, setIsDarkMode] = useState9(false);
|
|
2188
|
+
useEffect7(() => {
|
|
2189
|
+
const instance = DarkModeListener.instance;
|
|
2190
|
+
setIsDarkMode(instance.darkMode);
|
|
2191
|
+
instance.addListener(setIsDarkMode);
|
|
2192
|
+
return () => {
|
|
2193
|
+
instance.removeListener(setIsDarkMode);
|
|
2194
|
+
};
|
|
2195
|
+
}, []);
|
|
2196
|
+
return isDarkMode;
|
|
2197
|
+
};
|
|
2198
|
+
|
|
2199
|
+
// src/utils/extension-context.ts
|
|
2097
2200
|
var SvgFolderContext = createContext3("");
|
|
2098
2201
|
var useDetectExtenstion = () => {
|
|
2099
2202
|
const folderPath = useContext3(SvgFolderContext);
|
|
2100
2203
|
return Boolean(folderPath);
|
|
2101
2204
|
};
|
|
2102
|
-
var DarkModeContext = createContext3(false);
|
|
2103
|
-
var useDarkMode = () => {
|
|
2104
|
-
return useContext3(DarkModeContext);
|
|
2105
|
-
};
|
|
2106
2205
|
|
|
2107
2206
|
// src/common/Empty.tsx
|
|
2108
2207
|
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
@@ -2203,15 +2302,742 @@ var HeaderToolsContent = ({
|
|
|
2203
2302
|
return /* @__PURE__ */ jsx18("div", { className: classNames11("w-full overflow-hidden", className), children });
|
|
2204
2303
|
};
|
|
2205
2304
|
|
|
2305
|
+
// src/common/SlideOver.tsx
|
|
2306
|
+
import { Fragment as Fragment5, useCallback as useCallback7, useEffect as useEffect8, useRef as useRef5 } from "react";
|
|
2307
|
+
import { Dialog as Dialog2, Transition as Transition2 } from "@headlessui/react";
|
|
2308
|
+
import { XMarkIcon as XIcon } from "@heroicons/react/24/outline";
|
|
2309
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2310
|
+
function SlideOver({
|
|
2311
|
+
title,
|
|
2312
|
+
open,
|
|
2313
|
+
onClose,
|
|
2314
|
+
children,
|
|
2315
|
+
size,
|
|
2316
|
+
headAddon,
|
|
2317
|
+
triggerClose = "all",
|
|
2318
|
+
noAnimation
|
|
2319
|
+
}) {
|
|
2320
|
+
const onDialogClose = useCallback7(() => {
|
|
2321
|
+
if (triggerClose === "all") {
|
|
2322
|
+
onClose();
|
|
2323
|
+
}
|
|
2324
|
+
}, [triggerClose, onClose]);
|
|
2325
|
+
const openRef = useRef5(open);
|
|
2326
|
+
openRef.current = open;
|
|
2327
|
+
useEffect8(() => {
|
|
2328
|
+
function handleKeyDown(event) {
|
|
2329
|
+
if (event.key === "Escape") {
|
|
2330
|
+
event.preventDefault();
|
|
2331
|
+
event.stopPropagation();
|
|
2332
|
+
if (openRef.current) {
|
|
2333
|
+
onClose();
|
|
2334
|
+
}
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
if (triggerClose === "button") {
|
|
2338
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
2339
|
+
return () => {
|
|
2340
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
2341
|
+
};
|
|
2342
|
+
}
|
|
2343
|
+
}, [triggerClose, onClose]);
|
|
2344
|
+
const contentNode = /* @__PURE__ */ jsx19("div", { className: "fixed inset-0 overflow-hidden", children: /* @__PURE__ */ jsxs16("div", { className: "absolute inset-y-0 right-0 flex max-w-full pl-10 sm:pl-16", children: [
|
|
2345
|
+
/* @__PURE__ */ jsx19("div", { className: "max-w-2xl max-w-3xl max-w-4xl max-w-5xl max-w-6xl max-w-7xl" }),
|
|
2346
|
+
/* @__PURE__ */ jsxs16(
|
|
2347
|
+
Dialog2.Panel,
|
|
2348
|
+
{
|
|
2349
|
+
className: `dark:bg-sentio-gray-100 pointer-events-auto flex h-full w-screen flex-col overflow-x-hidden border-l bg-white shadow-md max-w-${size || "2xl"}`,
|
|
2350
|
+
children: [
|
|
2351
|
+
/* @__PURE__ */ jsx19("div", { className: "dark:bg-sentio-gray-100 relative border-b bg-white px-4 py-3", children: /* @__PURE__ */ jsxs16("div", { className: "flex h-auto items-start justify-between space-x-3 sm:h-5", children: [
|
|
2352
|
+
/* @__PURE__ */ jsx19("div", { className: "flex-1 space-y-1", children: /* @__PURE__ */ jsx19(Dialog2.Title, { className: "text-text-foreground text-[15px] font-semibold", children: title }) }),
|
|
2353
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex-0 flex h-auto items-center sm:h-5", children: [
|
|
2354
|
+
headAddon,
|
|
2355
|
+
/* @__PURE__ */ jsxs16(
|
|
2356
|
+
"button",
|
|
2357
|
+
{
|
|
2358
|
+
type: "button",
|
|
2359
|
+
className: "hover:text-text-foreground ml-2 text-gray-800 dark:text-gray-500",
|
|
2360
|
+
onClick: () => onClose(),
|
|
2361
|
+
children: [
|
|
2362
|
+
/* @__PURE__ */ jsx19("span", { className: "sr-only", children: "Close panel" }),
|
|
2363
|
+
/* @__PURE__ */ jsx19(XIcon, { className: "h-5 w-5", "aria-hidden": "true" })
|
|
2364
|
+
]
|
|
2365
|
+
}
|
|
2366
|
+
)
|
|
2367
|
+
] })
|
|
2368
|
+
] }) }),
|
|
2369
|
+
/* @__PURE__ */ jsx19("div", { className: "flex flex-1 overflow-y-auto overflow-x-hidden", children })
|
|
2370
|
+
]
|
|
2371
|
+
}
|
|
2372
|
+
)
|
|
2373
|
+
] }) });
|
|
2374
|
+
if (noAnimation) {
|
|
2375
|
+
return /* @__PURE__ */ jsx19(
|
|
2376
|
+
Dialog2,
|
|
2377
|
+
{
|
|
2378
|
+
open,
|
|
2379
|
+
as: "div",
|
|
2380
|
+
className: "relative z-10",
|
|
2381
|
+
id: "test",
|
|
2382
|
+
onClose: onDialogClose,
|
|
2383
|
+
children: contentNode
|
|
2384
|
+
}
|
|
2385
|
+
);
|
|
2386
|
+
}
|
|
2387
|
+
return /* @__PURE__ */ jsx19(Transition2.Root, { show: open, as: "div", children: /* @__PURE__ */ jsx19(
|
|
2388
|
+
Dialog2,
|
|
2389
|
+
{
|
|
2390
|
+
static: true,
|
|
2391
|
+
as: "div",
|
|
2392
|
+
className: "relative z-10",
|
|
2393
|
+
id: "test",
|
|
2394
|
+
onClose: onDialogClose,
|
|
2395
|
+
children: /* @__PURE__ */ jsx19(
|
|
2396
|
+
Transition2.Child,
|
|
2397
|
+
{
|
|
2398
|
+
as: Fragment5,
|
|
2399
|
+
enter: "transform transition ease-in-out duration-100 sm:duration-300",
|
|
2400
|
+
enterFrom: "translate-x-full",
|
|
2401
|
+
enterTo: "translate-x-0",
|
|
2402
|
+
leave: "transform transition ease-in-out duration-100 sm:duration-300",
|
|
2403
|
+
leaveFrom: "translate-x-0",
|
|
2404
|
+
leaveTo: "translate-x-full",
|
|
2405
|
+
children: contentNode
|
|
2406
|
+
}
|
|
2407
|
+
)
|
|
2408
|
+
}
|
|
2409
|
+
) });
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2412
|
+
// src/common/ConfirmDialog.tsx
|
|
2413
|
+
import { Fragment as Fragment6, useRef as useRef6, useState as useState10 } from "react";
|
|
2414
|
+
import { Dialog as Dialog3, Transition as Transition3 } from "@headlessui/react";
|
|
2415
|
+
import {
|
|
2416
|
+
ExclamationCircleIcon as ExclamationIcon,
|
|
2417
|
+
QuestionMarkCircleIcon
|
|
2418
|
+
} from "@heroicons/react/24/outline";
|
|
2419
|
+
import { Fragment as Fragment7, jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2420
|
+
function ConfirmDialog({
|
|
2421
|
+
message,
|
|
2422
|
+
title,
|
|
2423
|
+
open,
|
|
2424
|
+
onClose,
|
|
2425
|
+
onConfirm,
|
|
2426
|
+
buttonLabel = "Delete",
|
|
2427
|
+
type,
|
|
2428
|
+
buttons,
|
|
2429
|
+
children,
|
|
2430
|
+
disabled
|
|
2431
|
+
}) {
|
|
2432
|
+
const cancelButtonRef = useRef6(null);
|
|
2433
|
+
const [processing, setProcessing] = useState10(false);
|
|
2434
|
+
async function confirm() {
|
|
2435
|
+
setProcessing(true);
|
|
2436
|
+
try {
|
|
2437
|
+
await onConfirm();
|
|
2438
|
+
} finally {
|
|
2439
|
+
setProcessing(false);
|
|
2440
|
+
onClose(false);
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
return /* @__PURE__ */ jsx20(Transition3.Root, { show: open, as: Fragment6, children: /* @__PURE__ */ jsxs17(
|
|
2444
|
+
Dialog3,
|
|
2445
|
+
{
|
|
2446
|
+
as: "div",
|
|
2447
|
+
className: "relative z-10",
|
|
2448
|
+
"aria-label": "confirm",
|
|
2449
|
+
initialFocus: cancelButtonRef,
|
|
2450
|
+
onClose,
|
|
2451
|
+
children: [
|
|
2452
|
+
/* @__PURE__ */ jsx20(
|
|
2453
|
+
Transition3.Child,
|
|
2454
|
+
{
|
|
2455
|
+
as: Fragment6,
|
|
2456
|
+
enter: "ease-out duration-300",
|
|
2457
|
+
enterFrom: "opacity-0",
|
|
2458
|
+
enterTo: "opacity-100",
|
|
2459
|
+
leave: "ease-in duration-200",
|
|
2460
|
+
leaveFrom: "opacity-100",
|
|
2461
|
+
leaveTo: "opacity-0",
|
|
2462
|
+
children: /* @__PURE__ */ jsx20("div", { className: "fixed inset-0 bg-gray-500/75 transition-opacity dark:bg-gray-200/50" })
|
|
2463
|
+
}
|
|
2464
|
+
),
|
|
2465
|
+
/* @__PURE__ */ jsx20("div", { className: "fixed inset-0 z-10 overflow-y-auto", children: /* @__PURE__ */ jsx20("div", { className: "flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0", children: /* @__PURE__ */ jsx20(
|
|
2466
|
+
Transition3.Child,
|
|
2467
|
+
{
|
|
2468
|
+
as: Fragment6,
|
|
2469
|
+
enter: "ease-out duration-300",
|
|
2470
|
+
enterFrom: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
2471
|
+
enterTo: "opacity-100 translate-y-0 sm:scale-100",
|
|
2472
|
+
leave: "ease-in duration-200",
|
|
2473
|
+
leaveFrom: "opacity-100 translate-y-0 sm:scale-100",
|
|
2474
|
+
leaveTo: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
2475
|
+
children: /* @__PURE__ */ jsxs17(Dialog3.Panel, { className: "dark:bg-sentio-gray-100 relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg", children: [
|
|
2476
|
+
/* @__PURE__ */ jsx20("div", { className: "dark:bg-sentio-gray-100 bg-white px-4 pb-4 pt-5 sm:p-6 sm:pb-4", children: /* @__PURE__ */ jsxs17("div", { className: "sm:flex sm:items-start", children: [
|
|
2477
|
+
type == "danger" && /* @__PURE__ */ jsx20("div", { className: "mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 dark:bg-red-300 sm:mx-0 sm:h-10 sm:w-10", children: /* @__PURE__ */ jsx20(
|
|
2478
|
+
ExclamationIcon,
|
|
2479
|
+
{
|
|
2480
|
+
className: "h-6 w-6 text-red-600 dark:text-red-800",
|
|
2481
|
+
"aria-hidden": "true"
|
|
2482
|
+
}
|
|
2483
|
+
) }),
|
|
2484
|
+
type == "question" && /* @__PURE__ */ jsx20("div", { className: "bg-primary-100 dark:bg-primary-500 mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full sm:mx-0 sm:h-10 sm:w-10", children: /* @__PURE__ */ jsx20(
|
|
2485
|
+
QuestionMarkCircleIcon,
|
|
2486
|
+
{
|
|
2487
|
+
className: "text-primary-600 dark:text-primary-800 h-6 w-6",
|
|
2488
|
+
"aria-hidden": "true"
|
|
2489
|
+
}
|
|
2490
|
+
) }),
|
|
2491
|
+
/* @__PURE__ */ jsxs17("div", { className: "mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left", children: [
|
|
2492
|
+
/* @__PURE__ */ jsx20(
|
|
2493
|
+
Dialog3.Title,
|
|
2494
|
+
{
|
|
2495
|
+
as: "h3",
|
|
2496
|
+
className: "text-text-foreground text-lg font-medium leading-6",
|
|
2497
|
+
children: title
|
|
2498
|
+
}
|
|
2499
|
+
),
|
|
2500
|
+
/* @__PURE__ */ jsxs17("div", { className: "mt-2", children: [
|
|
2501
|
+
message && /* @__PURE__ */ jsx20("p", { className: "text-sm text-gray-500", children: message }),
|
|
2502
|
+
children
|
|
2503
|
+
] })
|
|
2504
|
+
] })
|
|
2505
|
+
] }) }),
|
|
2506
|
+
/* @__PURE__ */ jsx20("div", { className: "flex gap-2 bg-gray-50 px-4 py-3 sm:flex-row-reverse sm:px-6", children: buttons ? buttons : /* @__PURE__ */ jsxs17(Fragment7, { children: [
|
|
2507
|
+
/* @__PURE__ */ jsx20(
|
|
2508
|
+
NewButton,
|
|
2509
|
+
{
|
|
2510
|
+
type: "button",
|
|
2511
|
+
processing,
|
|
2512
|
+
status: type == "danger" ? "danger" : void 0,
|
|
2513
|
+
role: "primary",
|
|
2514
|
+
onClick: () => confirm(),
|
|
2515
|
+
disabled,
|
|
2516
|
+
size: "lg",
|
|
2517
|
+
children: buttonLabel
|
|
2518
|
+
}
|
|
2519
|
+
),
|
|
2520
|
+
/* @__PURE__ */ jsx20(
|
|
2521
|
+
NewButton,
|
|
2522
|
+
{
|
|
2523
|
+
type: "button",
|
|
2524
|
+
role: "secondary",
|
|
2525
|
+
onClick: () => onClose(false),
|
|
2526
|
+
ref: cancelButtonRef,
|
|
2527
|
+
size: "lg",
|
|
2528
|
+
children: "Cancel"
|
|
2529
|
+
}
|
|
2530
|
+
)
|
|
2531
|
+
] }) })
|
|
2532
|
+
] })
|
|
2533
|
+
}
|
|
2534
|
+
) }) })
|
|
2535
|
+
]
|
|
2536
|
+
}
|
|
2537
|
+
) });
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
// src/common/StyledTabs.tsx
|
|
2541
|
+
import React5 from "react";
|
|
2542
|
+
import { Tab as HeadlessTab } from "@headlessui/react";
|
|
2543
|
+
import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2544
|
+
var getTabClassName = ({ selected }) => cx3(
|
|
2545
|
+
"font-ilabel py-1 text-sm leading-5 border-b-2 outline-0",
|
|
2546
|
+
selected ? "text-primary border-primary-500" : "text-gray hover:text-primary border-transparent hover:border-primary-500"
|
|
2547
|
+
);
|
|
2548
|
+
var Group = ({
|
|
2549
|
+
children,
|
|
2550
|
+
className,
|
|
2551
|
+
onChange,
|
|
2552
|
+
defaultIndex,
|
|
2553
|
+
selectedIndex
|
|
2554
|
+
}) => {
|
|
2555
|
+
return /* @__PURE__ */ jsx21(
|
|
2556
|
+
HeadlessTab.Group,
|
|
2557
|
+
{
|
|
2558
|
+
onChange,
|
|
2559
|
+
defaultIndex,
|
|
2560
|
+
selectedIndex,
|
|
2561
|
+
children: /* @__PURE__ */ jsx21("div", { className: cx3("flex flex-col", className), children })
|
|
2562
|
+
}
|
|
2563
|
+
);
|
|
2564
|
+
};
|
|
2565
|
+
var List = ({
|
|
2566
|
+
tabs,
|
|
2567
|
+
disabledTabs,
|
|
2568
|
+
className,
|
|
2569
|
+
noBorder,
|
|
2570
|
+
children
|
|
2571
|
+
}) => {
|
|
2572
|
+
return /* @__PURE__ */ jsxs18(
|
|
2573
|
+
HeadlessTab.List,
|
|
2574
|
+
{
|
|
2575
|
+
className: cx3(
|
|
2576
|
+
"flex-0 border-border-color flex justify-start space-x-6 overflow-x-auto px-4",
|
|
2577
|
+
noBorder ? "border-b-0" : "border-b"
|
|
2578
|
+
),
|
|
2579
|
+
children: [
|
|
2580
|
+
tabs.map((tab, index) => /* @__PURE__ */ jsx21(
|
|
2581
|
+
HeadlessTab,
|
|
2582
|
+
{
|
|
2583
|
+
className: ({ selected }) => cx3(
|
|
2584
|
+
"font-ilabel outline-primary/50 whitespace-nowrap border-b-2 py-1 text-sm leading-5 outline-offset-2",
|
|
2585
|
+
selected ? "border-primary text-primary" : "text-gray hover:text-primary border-transparent",
|
|
2586
|
+
className
|
|
2587
|
+
),
|
|
2588
|
+
disabled: disabledTabs?.includes(index),
|
|
2589
|
+
children: tab
|
|
2590
|
+
},
|
|
2591
|
+
index
|
|
2592
|
+
)),
|
|
2593
|
+
children
|
|
2594
|
+
]
|
|
2595
|
+
}
|
|
2596
|
+
);
|
|
2597
|
+
};
|
|
2598
|
+
var Panels = React5.forwardRef(function Panels2({ children, className, ...props }, ref) {
|
|
2599
|
+
return /* @__PURE__ */ jsx21(
|
|
2600
|
+
HeadlessTab.Panels,
|
|
2601
|
+
{
|
|
2602
|
+
className: cx3("flex-1", className || "w-full overflow-auto"),
|
|
2603
|
+
...props,
|
|
2604
|
+
ref,
|
|
2605
|
+
children
|
|
2606
|
+
}
|
|
2607
|
+
);
|
|
2608
|
+
});
|
|
2609
|
+
var Panel = (props) => {
|
|
2610
|
+
const { className, ...otherProps } = props;
|
|
2611
|
+
return /* @__PURE__ */ jsx21(
|
|
2612
|
+
HeadlessTab.Panel,
|
|
2613
|
+
{
|
|
2614
|
+
className: cx3("space-y-2 outline-0", className),
|
|
2615
|
+
...otherProps
|
|
2616
|
+
}
|
|
2617
|
+
);
|
|
2618
|
+
};
|
|
2619
|
+
|
|
2620
|
+
// src/common/SearchInput.tsx
|
|
2621
|
+
import { MagnifyingGlassIcon as SearchIcon } from "@heroicons/react/20/solid";
|
|
2622
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
2623
|
+
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2624
|
+
var SearchInput = forwardRef4((props, ref) => {
|
|
2625
|
+
const {
|
|
2626
|
+
onChange,
|
|
2627
|
+
value,
|
|
2628
|
+
onBlur,
|
|
2629
|
+
onKeydown,
|
|
2630
|
+
addonButton,
|
|
2631
|
+
placeholder = "Search",
|
|
2632
|
+
...args
|
|
2633
|
+
} = props;
|
|
2634
|
+
return /* @__PURE__ */ jsxs19("div", { className: "min-w-0 flex-1", children: [
|
|
2635
|
+
/* @__PURE__ */ jsx22("label", { htmlFor: "search", className: "sr-only", children: "Search" }),
|
|
2636
|
+
/* @__PURE__ */ jsxs19("div", { className: "focus-within:ring-primary-500 focus-within:border-primary-500 relative flex rounded-md border border-gray-300", children: [
|
|
2637
|
+
/* @__PURE__ */ jsx22("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-1 sm:pl-3", children: /* @__PURE__ */ jsx22(
|
|
2638
|
+
SearchIcon,
|
|
2639
|
+
{
|
|
2640
|
+
className: "sm:h-4.5 sm:w-4.5 h-4 w-4 text-gray-400",
|
|
2641
|
+
"aria-hidden": "true"
|
|
2642
|
+
}
|
|
2643
|
+
) }),
|
|
2644
|
+
/* @__PURE__ */ jsx22(
|
|
2645
|
+
"input",
|
|
2646
|
+
{
|
|
2647
|
+
onChange: (e) => onChange(e.target.value),
|
|
2648
|
+
onBlur,
|
|
2649
|
+
onKeyDown: onKeydown,
|
|
2650
|
+
type: "search",
|
|
2651
|
+
className: cx3(
|
|
2652
|
+
"md:text-ilabel block w-full rounded-md border-0 pl-6 text-xs focus:ring-0 sm:pl-10 sm:text-sm",
|
|
2653
|
+
"h-[30px] py-1"
|
|
2654
|
+
),
|
|
2655
|
+
placeholder,
|
|
2656
|
+
value,
|
|
2657
|
+
ref,
|
|
2658
|
+
...args
|
|
2659
|
+
}
|
|
2660
|
+
),
|
|
2661
|
+
addonButton
|
|
2662
|
+
] })
|
|
2663
|
+
] });
|
|
2664
|
+
});
|
|
2665
|
+
SearchInput.displayName = "SearchInput";
|
|
2666
|
+
|
|
2667
|
+
// src/common/Checkbox.tsx
|
|
2668
|
+
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2669
|
+
var Checkbox = ({
|
|
2670
|
+
checked,
|
|
2671
|
+
onChange,
|
|
2672
|
+
label,
|
|
2673
|
+
labelNode,
|
|
2674
|
+
id,
|
|
2675
|
+
name,
|
|
2676
|
+
inputProps,
|
|
2677
|
+
disabled,
|
|
2678
|
+
labelClassName,
|
|
2679
|
+
className
|
|
2680
|
+
}) => {
|
|
2681
|
+
return /* @__PURE__ */ jsxs20(
|
|
2682
|
+
"div",
|
|
2683
|
+
{
|
|
2684
|
+
className: cx3("inline-flex items-center gap-2", className),
|
|
2685
|
+
onClick: (e) => {
|
|
2686
|
+
e.stopPropagation();
|
|
2687
|
+
onChange?.(!checked);
|
|
2688
|
+
},
|
|
2689
|
+
children: [
|
|
2690
|
+
/* @__PURE__ */ jsx23(
|
|
2691
|
+
"input",
|
|
2692
|
+
{
|
|
2693
|
+
id,
|
|
2694
|
+
name,
|
|
2695
|
+
type: "checkbox",
|
|
2696
|
+
className: "text-primary-600 focus:ring-primary-500 h-4 w-4 rounded border-gray-300 ",
|
|
2697
|
+
disabled,
|
|
2698
|
+
checked,
|
|
2699
|
+
readOnly: true,
|
|
2700
|
+
...inputProps
|
|
2701
|
+
}
|
|
2702
|
+
),
|
|
2703
|
+
label && /* @__PURE__ */ jsx23(
|
|
2704
|
+
"span",
|
|
2705
|
+
{
|
|
2706
|
+
className: cx3(
|
|
2707
|
+
"text-ilabel text-gray font-medium",
|
|
2708
|
+
labelClassName
|
|
2709
|
+
),
|
|
2710
|
+
children: label
|
|
2711
|
+
}
|
|
2712
|
+
),
|
|
2713
|
+
labelNode
|
|
2714
|
+
]
|
|
2715
|
+
}
|
|
2716
|
+
);
|
|
2717
|
+
};
|
|
2718
|
+
|
|
2719
|
+
// src/common/ProgressBar.tsx
|
|
2720
|
+
import { useMemo as useMemo5 } from "react";
|
|
2721
|
+
import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2722
|
+
var defaultSegments = {
|
|
2723
|
+
0.25: "from-cyan-600 to-cyan-500",
|
|
2724
|
+
0.5: "from-cyan-500 to-orange-600",
|
|
2725
|
+
0.75: "from-orange-600 to-red-600",
|
|
2726
|
+
1: "from-red-600 to-red-700"
|
|
2727
|
+
};
|
|
2728
|
+
var ProgressBar = ({
|
|
2729
|
+
progress,
|
|
2730
|
+
segments = defaultSegments,
|
|
2731
|
+
gradient,
|
|
2732
|
+
upperTicks,
|
|
2733
|
+
lowerTicks,
|
|
2734
|
+
roundedFull
|
|
2735
|
+
}) => {
|
|
2736
|
+
const elements = useMemo5(() => {
|
|
2737
|
+
const result = [];
|
|
2738
|
+
const colors = Object.entries(segments).sort(
|
|
2739
|
+
(a, b) => parseFloat(a[0]) - parseFloat(b[0])
|
|
2740
|
+
);
|
|
2741
|
+
if (gradient) {
|
|
2742
|
+
let pos = 0;
|
|
2743
|
+
colors.forEach(([stop, color], idx) => {
|
|
2744
|
+
const width = (parseFloat(stop) - pos) * 100;
|
|
2745
|
+
result.push(
|
|
2746
|
+
/* @__PURE__ */ jsx24(
|
|
2747
|
+
"div",
|
|
2748
|
+
{
|
|
2749
|
+
className: cx3(
|
|
2750
|
+
`absolute top-0 h-4 bg-gradient-to-r ${color}`,
|
|
2751
|
+
idx === 0 && "rounded-l-full",
|
|
2752
|
+
idx === colors.length - 1 && "rounded-r-full"
|
|
2753
|
+
),
|
|
2754
|
+
style: { left: `${pos * 100}%`, width: `${width}%` }
|
|
2755
|
+
},
|
|
2756
|
+
stop
|
|
2757
|
+
)
|
|
2758
|
+
);
|
|
2759
|
+
pos = parseFloat(stop);
|
|
2760
|
+
});
|
|
2761
|
+
} else {
|
|
2762
|
+
let pos = 0;
|
|
2763
|
+
for (const [stop, color] of colors) {
|
|
2764
|
+
const width = (parseFloat(stop) - pos) * 100;
|
|
2765
|
+
result.push(
|
|
2766
|
+
/* @__PURE__ */ jsx24(
|
|
2767
|
+
"div",
|
|
2768
|
+
{
|
|
2769
|
+
className: `absolute h-4 bg-${color} top-0 left-[${pos}] w-[${width}]`
|
|
2770
|
+
}
|
|
2771
|
+
)
|
|
2772
|
+
);
|
|
2773
|
+
pos = parseFloat(stop) * 100;
|
|
2774
|
+
}
|
|
2775
|
+
}
|
|
2776
|
+
return result;
|
|
2777
|
+
}, [segments, gradient]);
|
|
2778
|
+
const upperTicksElements = useMemo5(() => {
|
|
2779
|
+
if (!upperTicks) return null;
|
|
2780
|
+
return Object.entries(upperTicks).map(([p, label]) => {
|
|
2781
|
+
const pos = parseFloat(p);
|
|
2782
|
+
return /* @__PURE__ */ jsxs21(
|
|
2783
|
+
"div",
|
|
2784
|
+
{
|
|
2785
|
+
className: "absolute top-0 border-l border-gray-500 text-xs text-gray-500 hover:z-[1]",
|
|
2786
|
+
style: { left: `${pos * 100}%` },
|
|
2787
|
+
children: [
|
|
2788
|
+
/* @__PURE__ */ jsx24(
|
|
2789
|
+
"div",
|
|
2790
|
+
{
|
|
2791
|
+
className: cx3(
|
|
2792
|
+
"absolute w-fit -translate-y-full whitespace-nowrap text-gray-500",
|
|
2793
|
+
pos < 0.05 ? "-translate-x-1/4" : pos > 0.95 ? "-translate-x-3/4" : "-translate-x-1/2"
|
|
2794
|
+
),
|
|
2795
|
+
children: label
|
|
2796
|
+
}
|
|
2797
|
+
),
|
|
2798
|
+
/* @__PURE__ */ jsx24("div", { className: "absolute h-3 w-2 translate-y-1 border-l border-gray-400 border-opacity-50" })
|
|
2799
|
+
]
|
|
2800
|
+
},
|
|
2801
|
+
pos
|
|
2802
|
+
);
|
|
2803
|
+
});
|
|
2804
|
+
}, [upperTicks]);
|
|
2805
|
+
const lowerTicksElements = useMemo5(() => {
|
|
2806
|
+
if (!lowerTicks) return null;
|
|
2807
|
+
return Object.entries(lowerTicks).map(([p, label]) => {
|
|
2808
|
+
const pos = parseFloat(p);
|
|
2809
|
+
return /* @__PURE__ */ jsxs21(
|
|
2810
|
+
"div",
|
|
2811
|
+
{
|
|
2812
|
+
className: "relative bottom-0 text-xs hover:z-[1]",
|
|
2813
|
+
style: { left: `${pos * 100}%` },
|
|
2814
|
+
children: [
|
|
2815
|
+
/* @__PURE__ */ jsx24("div", { className: "absolute top-0 h-3 w-2 border-l border-gray-400 border-opacity-50" }),
|
|
2816
|
+
/* @__PURE__ */ jsx24(
|
|
2817
|
+
"div",
|
|
2818
|
+
{
|
|
2819
|
+
className: cx3(
|
|
2820
|
+
"absolute translate-y-full text-gray-500",
|
|
2821
|
+
pos < 0.05 ? "-translate-x-1/4" : pos > 0.95 ? "-translate-x-3/4" : "-translate-x-1/2"
|
|
2822
|
+
),
|
|
2823
|
+
children: label
|
|
2824
|
+
}
|
|
2825
|
+
)
|
|
2826
|
+
]
|
|
2827
|
+
},
|
|
2828
|
+
pos
|
|
2829
|
+
);
|
|
2830
|
+
});
|
|
2831
|
+
}, [lowerTicks]);
|
|
2832
|
+
return /* @__PURE__ */ jsxs21("div", { className: "w-full", children: [
|
|
2833
|
+
/* @__PURE__ */ jsx24("div", { className: "relative h-4 w-full", children: upperTicksElements }),
|
|
2834
|
+
/* @__PURE__ */ jsxs21("div", { className: "relative h-4 w-full", children: [
|
|
2835
|
+
elements,
|
|
2836
|
+
/* @__PURE__ */ jsx24(
|
|
2837
|
+
"div",
|
|
2838
|
+
{
|
|
2839
|
+
className: cx3(
|
|
2840
|
+
progress === 0 ? "rounded-l-full" : "",
|
|
2841
|
+
`dark:bg-sentio-gray-400 absolute right-0 top-0 h-4 rounded-r-full bg-gray-300`
|
|
2842
|
+
),
|
|
2843
|
+
style: { left: `${progress * 100}%` }
|
|
2844
|
+
}
|
|
2845
|
+
)
|
|
2846
|
+
] }),
|
|
2847
|
+
/* @__PURE__ */ jsx24("div", { className: "relative h-4 w-full", children: lowerTicksElements })
|
|
2848
|
+
] });
|
|
2849
|
+
};
|
|
2850
|
+
|
|
2851
|
+
// src/common/Descriptions.tsx
|
|
2852
|
+
import React6 from "react";
|
|
2853
|
+
import {
|
|
2854
|
+
isObjectLike,
|
|
2855
|
+
map,
|
|
2856
|
+
isFunction as isFunction4,
|
|
2857
|
+
isEmpty,
|
|
2858
|
+
isString as isString3,
|
|
2859
|
+
isNumber as isNumber2
|
|
2860
|
+
} from "lodash";
|
|
2861
|
+
import { jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2862
|
+
function safeToString(value) {
|
|
2863
|
+
if (isString3(value) || isNumber2(value)) {
|
|
2864
|
+
return value;
|
|
2865
|
+
}
|
|
2866
|
+
try {
|
|
2867
|
+
return JSON.stringify(value);
|
|
2868
|
+
} catch {
|
|
2869
|
+
return "";
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
var Descriptions = (props) => {
|
|
2873
|
+
const {
|
|
2874
|
+
data,
|
|
2875
|
+
labelStyle,
|
|
2876
|
+
valueStyle,
|
|
2877
|
+
className,
|
|
2878
|
+
labelClassName,
|
|
2879
|
+
valueClassName,
|
|
2880
|
+
trClassName,
|
|
2881
|
+
colon,
|
|
2882
|
+
renderLabel,
|
|
2883
|
+
renderValue
|
|
2884
|
+
} = props;
|
|
2885
|
+
return /* @__PURE__ */ jsx25("table", { className: cx3("w-full border-collapse", className), children: /* @__PURE__ */ jsx25("tbody", { children: data.map((item, index) => {
|
|
2886
|
+
return /* @__PURE__ */ jsxs22("tr", { className: trClassName, children: [
|
|
2887
|
+
/* @__PURE__ */ jsx25(
|
|
2888
|
+
"td",
|
|
2889
|
+
{
|
|
2890
|
+
className: cx3(
|
|
2891
|
+
"text-gray text-ilabel font-ilabel w-px whitespace-nowrap pr-8 align-text-bottom",
|
|
2892
|
+
labelClassName
|
|
2893
|
+
),
|
|
2894
|
+
style: labelStyle,
|
|
2895
|
+
children: isFunction4(renderLabel) ? renderLabel?.(item) : item.label
|
|
2896
|
+
}
|
|
2897
|
+
),
|
|
2898
|
+
colon,
|
|
2899
|
+
/* @__PURE__ */ jsx25(
|
|
2900
|
+
"td",
|
|
2901
|
+
{
|
|
2902
|
+
className: cx3(
|
|
2903
|
+
"text-ilabel font-ilabel",
|
|
2904
|
+
valueClassName
|
|
2905
|
+
),
|
|
2906
|
+
style: valueStyle,
|
|
2907
|
+
children: React6.isValidElement(item.value) ? item.value : isObjectLike(item.value) ? isEmpty(item.value) ? /* @__PURE__ */ jsx25("div", { className: "text-gray-400", children: "{ }" }) : /* @__PURE__ */ jsxs22("div", { className: "space-y-2", children: [
|
|
2908
|
+
/* @__PURE__ */ jsx25("div", { className: "text-gray-400", children: "{" }),
|
|
2909
|
+
/* @__PURE__ */ jsx25(
|
|
2910
|
+
Descriptions,
|
|
2911
|
+
{
|
|
2912
|
+
...props,
|
|
2913
|
+
data: map(item.value, (value, label) => ({
|
|
2914
|
+
key: `${item.key}.${label}`,
|
|
2915
|
+
label,
|
|
2916
|
+
value
|
|
2917
|
+
}))
|
|
2918
|
+
}
|
|
2919
|
+
),
|
|
2920
|
+
/* @__PURE__ */ jsx25("div", { className: "text-gray-400", children: "}" })
|
|
2921
|
+
] }) : isFunction4(renderValue) ? renderValue?.(item) : safeToString(item.value)
|
|
2922
|
+
}
|
|
2923
|
+
)
|
|
2924
|
+
] }, item.key ?? index);
|
|
2925
|
+
}) }) });
|
|
2926
|
+
};
|
|
2927
|
+
|
|
2928
|
+
// src/common/Notification.tsx
|
|
2929
|
+
import { Fragment as Fragment8 } from "react";
|
|
2930
|
+
import { Transition as Transition4 } from "@headlessui/react";
|
|
2931
|
+
import { XMarkIcon as XIcon2 } from "@heroicons/react/20/solid";
|
|
2932
|
+
import {
|
|
2933
|
+
CheckCircleIcon,
|
|
2934
|
+
ExclamationCircleIcon as ExclamationCircleIcon2,
|
|
2935
|
+
InformationCircleIcon
|
|
2936
|
+
} from "@heroicons/react/24/outline";
|
|
2937
|
+
import { Fragment as Fragment9, jsx as jsx26, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2938
|
+
function Notification({
|
|
2939
|
+
show,
|
|
2940
|
+
setShow,
|
|
2941
|
+
title,
|
|
2942
|
+
message,
|
|
2943
|
+
buttons,
|
|
2944
|
+
type
|
|
2945
|
+
}) {
|
|
2946
|
+
let icon;
|
|
2947
|
+
switch (type) {
|
|
2948
|
+
case "success":
|
|
2949
|
+
icon = /* @__PURE__ */ jsx26(
|
|
2950
|
+
CheckCircleIcon,
|
|
2951
|
+
{
|
|
2952
|
+
className: "h-6 w-6 text-green-400",
|
|
2953
|
+
"aria-hidden": "true"
|
|
2954
|
+
}
|
|
2955
|
+
);
|
|
2956
|
+
break;
|
|
2957
|
+
case "error":
|
|
2958
|
+
icon = /* @__PURE__ */ jsx26(
|
|
2959
|
+
ExclamationCircleIcon2,
|
|
2960
|
+
{
|
|
2961
|
+
className: "h-6 w-6 text-red-400",
|
|
2962
|
+
"aria-hidden": "true"
|
|
2963
|
+
}
|
|
2964
|
+
);
|
|
2965
|
+
break;
|
|
2966
|
+
case "warning":
|
|
2967
|
+
icon = /* @__PURE__ */ jsx26(
|
|
2968
|
+
ExclamationCircleIcon2,
|
|
2969
|
+
{
|
|
2970
|
+
className: "h-6 w-6 text-yellow-400",
|
|
2971
|
+
"aria-hidden": "true"
|
|
2972
|
+
}
|
|
2973
|
+
);
|
|
2974
|
+
break;
|
|
2975
|
+
case "info":
|
|
2976
|
+
icon = /* @__PURE__ */ jsx26(
|
|
2977
|
+
InformationCircleIcon,
|
|
2978
|
+
{
|
|
2979
|
+
className: "h-6 w-6 text-blue-400",
|
|
2980
|
+
"aria-hidden": "true"
|
|
2981
|
+
}
|
|
2982
|
+
);
|
|
2983
|
+
break;
|
|
2984
|
+
}
|
|
2985
|
+
return /* @__PURE__ */ jsx26(Fragment9, { children: /* @__PURE__ */ jsx26(
|
|
2986
|
+
"div",
|
|
2987
|
+
{
|
|
2988
|
+
"aria-live": "assertive",
|
|
2989
|
+
className: "pointer-events-none fixed inset-0 z-40 flex items-end px-4 py-6 sm:items-start sm:p-6",
|
|
2990
|
+
onClick: (evt) => {
|
|
2991
|
+
evt.stopPropagation();
|
|
2992
|
+
},
|
|
2993
|
+
children: /* @__PURE__ */ jsx26("div", { className: "flex w-full flex-col items-center space-y-4 sm:items-end", children: /* @__PURE__ */ jsx26(
|
|
2994
|
+
Transition4,
|
|
2995
|
+
{
|
|
2996
|
+
show,
|
|
2997
|
+
as: Fragment8,
|
|
2998
|
+
enter: "transform ease-out duration-300 transition",
|
|
2999
|
+
enterFrom: "translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2",
|
|
3000
|
+
enterTo: "translate-y-0 opacity-100 sm:translate-x-0",
|
|
3001
|
+
leave: "transition ease-in duration-100",
|
|
3002
|
+
leaveFrom: "opacity-100",
|
|
3003
|
+
leaveTo: "opacity-0",
|
|
3004
|
+
children: /* @__PURE__ */ jsx26("div", { className: "dark:bg-sentio-gray-100 pointer-events-auto w-full max-w-sm rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5 dark:ring-gray-100", children: /* @__PURE__ */ jsx26("div", { className: "p-4", children: /* @__PURE__ */ jsxs23("div", { className: "flex items-start", children: [
|
|
3005
|
+
/* @__PURE__ */ jsx26("div", { className: "flex-shrink-0", children: icon }),
|
|
3006
|
+
/* @__PURE__ */ jsxs23("div", { className: "ml-3 w-0 flex-1", children: [
|
|
3007
|
+
/* @__PURE__ */ jsx26("p", { className: "text-text-foreground text-sm font-medium", children: title }),
|
|
3008
|
+
/* @__PURE__ */ jsx26("p", { className: "mt-1 text-sm text-gray-500", children: message }),
|
|
3009
|
+
buttons && /* @__PURE__ */ jsx26("div", { className: "mt-4 flex", children: buttons() })
|
|
3010
|
+
] }),
|
|
3011
|
+
/* @__PURE__ */ jsx26("div", { className: "ml-4 flex flex-shrink-0", children: /* @__PURE__ */ jsxs23(
|
|
3012
|
+
"button",
|
|
3013
|
+
{
|
|
3014
|
+
type: "button",
|
|
3015
|
+
className: "focus:ring-primary-500 dark:bg-sentio-gray-100 inline-flex rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
3016
|
+
onClick: () => {
|
|
3017
|
+
setShow(false);
|
|
3018
|
+
},
|
|
3019
|
+
children: [
|
|
3020
|
+
/* @__PURE__ */ jsx26("span", { className: "sr-only", children: "Close" }),
|
|
3021
|
+
/* @__PURE__ */ jsx26(XIcon2, { className: "h-5 w-5", "aria-hidden": "true" })
|
|
3022
|
+
]
|
|
3023
|
+
}
|
|
3024
|
+
) })
|
|
3025
|
+
] }) }) })
|
|
3026
|
+
}
|
|
3027
|
+
) })
|
|
3028
|
+
}
|
|
3029
|
+
) });
|
|
3030
|
+
}
|
|
3031
|
+
|
|
2206
3032
|
// src/common/table/ResizeTable.tsx
|
|
2207
3033
|
import {
|
|
2208
|
-
forwardRef as
|
|
3034
|
+
forwardRef as forwardRef5,
|
|
2209
3035
|
memo as memo5,
|
|
2210
|
-
useCallback as
|
|
2211
|
-
useEffect as
|
|
2212
|
-
useMemo as
|
|
2213
|
-
useRef as
|
|
2214
|
-
useState as
|
|
3036
|
+
useCallback as useCallback8,
|
|
3037
|
+
useEffect as useEffect10,
|
|
3038
|
+
useMemo as useMemo7,
|
|
3039
|
+
useRef as useRef8,
|
|
3040
|
+
useState as useState13
|
|
2215
3041
|
} from "react";
|
|
2216
3042
|
import {
|
|
2217
3043
|
useReactTable,
|
|
@@ -2229,14 +3055,14 @@ import { debounce, isEqual as isEqual2 } from "lodash";
|
|
|
2229
3055
|
|
|
2230
3056
|
// src/common/menu/PopupMenuButton.tsx
|
|
2231
3057
|
import {
|
|
2232
|
-
Fragment as
|
|
2233
|
-
useState as
|
|
3058
|
+
Fragment as Fragment10,
|
|
3059
|
+
useState as useState12,
|
|
2234
3060
|
useContext as useContext6,
|
|
2235
|
-
useMemo as
|
|
2236
|
-
useEffect as
|
|
2237
|
-
useRef as
|
|
3061
|
+
useMemo as useMemo6,
|
|
3062
|
+
useEffect as useEffect9,
|
|
3063
|
+
useRef as useRef7
|
|
2238
3064
|
} from "react";
|
|
2239
|
-
import { Menu as Menu2, Transition as
|
|
3065
|
+
import { Menu as Menu2, Transition as Transition5 } from "@headlessui/react";
|
|
2240
3066
|
import {
|
|
2241
3067
|
FloatingPortal as FloatingPortal2,
|
|
2242
3068
|
useFloating as useFloating3,
|
|
@@ -2247,7 +3073,7 @@ import {
|
|
|
2247
3073
|
} from "@floating-ui/react";
|
|
2248
3074
|
|
|
2249
3075
|
// src/common/menu/SubMenu.tsx
|
|
2250
|
-
import { useState as
|
|
3076
|
+
import { useState as useState11, createContext as createContext4, useContext as useContext5 } from "react";
|
|
2251
3077
|
import {
|
|
2252
3078
|
useFloating as useFloating2,
|
|
2253
3079
|
useHover as useHover2,
|
|
@@ -2260,7 +3086,7 @@ import {
|
|
|
2260
3086
|
import { Menu } from "@headlessui/react";
|
|
2261
3087
|
import { HiCheck } from "react-icons/hi";
|
|
2262
3088
|
import { ChevronRightIcon } from "@heroicons/react/20/solid";
|
|
2263
|
-
import { jsx as
|
|
3089
|
+
import { jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2264
3090
|
var COLOR_MAP = {
|
|
2265
3091
|
default: {
|
|
2266
3092
|
active: "bg-gray-100 text-text-foreground dark:bg-primary-600 dark:text-white",
|
|
@@ -2276,9 +3102,9 @@ var COLOR_MAP = {
|
|
|
2276
3102
|
var MenuContext = createContext4({});
|
|
2277
3103
|
var MenuItem = ({ item, onSelect, labelClassName }) => {
|
|
2278
3104
|
const { selectedKey } = useContext5(MenuContext);
|
|
2279
|
-
return /* @__PURE__ */
|
|
3105
|
+
return /* @__PURE__ */ jsx27(Menu.Item, { disabled: item.disabled, children: ({ active }) => {
|
|
2280
3106
|
if (item.items) {
|
|
2281
|
-
return /* @__PURE__ */
|
|
3107
|
+
return /* @__PURE__ */ jsx27(
|
|
2282
3108
|
SubMenuButton,
|
|
2283
3109
|
{
|
|
2284
3110
|
items: item.items,
|
|
@@ -2291,7 +3117,7 @@ var MenuItem = ({ item, onSelect, labelClassName }) => {
|
|
|
2291
3117
|
item.key
|
|
2292
3118
|
);
|
|
2293
3119
|
}
|
|
2294
|
-
const buttonNode = /* @__PURE__ */
|
|
3120
|
+
const buttonNode = /* @__PURE__ */ jsxs24(
|
|
2295
3121
|
"button",
|
|
2296
3122
|
{
|
|
2297
3123
|
onClick: (e) => onSelect?.(item.key, e, item),
|
|
@@ -2302,7 +3128,7 @@ var MenuItem = ({ item, onSelect, labelClassName }) => {
|
|
|
2302
3128
|
disabled: item.disabled,
|
|
2303
3129
|
children: [
|
|
2304
3130
|
item.icon,
|
|
2305
|
-
/* @__PURE__ */
|
|
3131
|
+
/* @__PURE__ */ jsx27(
|
|
2306
3132
|
"span",
|
|
2307
3133
|
{
|
|
2308
3134
|
className: cx3(
|
|
@@ -2312,15 +3138,15 @@ var MenuItem = ({ item, onSelect, labelClassName }) => {
|
|
|
2312
3138
|
children: item.label
|
|
2313
3139
|
}
|
|
2314
3140
|
),
|
|
2315
|
-
item.key === selectedKey ? /* @__PURE__ */
|
|
3141
|
+
item.key === selectedKey ? /* @__PURE__ */ jsx27(HiCheck, { className: "icon-lg ml-2" }) : null
|
|
2316
3142
|
]
|
|
2317
3143
|
}
|
|
2318
3144
|
);
|
|
2319
3145
|
if (item.disabled && item.disabledHint) {
|
|
2320
|
-
return /* @__PURE__ */
|
|
3146
|
+
return /* @__PURE__ */ jsx27(
|
|
2321
3147
|
PopoverTooltip,
|
|
2322
3148
|
{
|
|
2323
|
-
text: /* @__PURE__ */
|
|
3149
|
+
text: /* @__PURE__ */ jsx27("span", { className: "text-icontent font-icontent text-gray cursor-auto", children: item.disabledHint }),
|
|
2324
3150
|
strategy: "fixed",
|
|
2325
3151
|
children: buttonNode
|
|
2326
3152
|
}
|
|
@@ -2340,7 +3166,7 @@ var SubMenuButton = (props) => {
|
|
|
2340
3166
|
placement = "right-start",
|
|
2341
3167
|
buttonClass: buttonClass3
|
|
2342
3168
|
} = props;
|
|
2343
|
-
const [open, setOpen] =
|
|
3169
|
+
const [open, setOpen] = useState11(false);
|
|
2344
3170
|
const { refs, floatingStyles, context } = useFloating2({
|
|
2345
3171
|
open,
|
|
2346
3172
|
onOpenChange: setOpen,
|
|
@@ -2353,7 +3179,7 @@ var SubMenuButton = (props) => {
|
|
|
2353
3179
|
handleClose: safePolygon2()
|
|
2354
3180
|
})
|
|
2355
3181
|
]);
|
|
2356
|
-
return /* @__PURE__ */
|
|
3182
|
+
return /* @__PURE__ */ jsxs24(
|
|
2357
3183
|
Menu,
|
|
2358
3184
|
{
|
|
2359
3185
|
as: "div",
|
|
@@ -2363,7 +3189,7 @@ var SubMenuButton = (props) => {
|
|
|
2363
3189
|
disabled ? "pointer-events-none cursor-not-allowed text-gray-400" : "cursor-pointer"
|
|
2364
3190
|
),
|
|
2365
3191
|
children: [
|
|
2366
|
-
/* @__PURE__ */
|
|
3192
|
+
/* @__PURE__ */ jsxs24(
|
|
2367
3193
|
Menu.Button,
|
|
2368
3194
|
{
|
|
2369
3195
|
className: cx3(
|
|
@@ -2379,8 +3205,8 @@ var SubMenuButton = (props) => {
|
|
|
2379
3205
|
...getReferenceProps,
|
|
2380
3206
|
children: [
|
|
2381
3207
|
props.icon,
|
|
2382
|
-
/* @__PURE__ */
|
|
2383
|
-
/* @__PURE__ */
|
|
3208
|
+
/* @__PURE__ */ jsx27("span", { className: "flex-shrink flex-grow text-left", children: label }),
|
|
3209
|
+
/* @__PURE__ */ jsx27(
|
|
2384
3210
|
ChevronRightIcon,
|
|
2385
3211
|
{
|
|
2386
3212
|
className: cx3(
|
|
@@ -2394,7 +3220,7 @@ var SubMenuButton = (props) => {
|
|
|
2394
3220
|
]
|
|
2395
3221
|
}
|
|
2396
3222
|
),
|
|
2397
|
-
open && /* @__PURE__ */
|
|
3223
|
+
open && /* @__PURE__ */ jsx27(
|
|
2398
3224
|
Menu.Items,
|
|
2399
3225
|
{
|
|
2400
3226
|
static: true,
|
|
@@ -2403,12 +3229,12 @@ var SubMenuButton = (props) => {
|
|
|
2403
3229
|
className: "dark:bg-sentio-gray-100 dark:divide-sentio-gray-400/50 w-48 origin-top cursor-pointer divide-y divide-gray-200 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:ring-gray-100",
|
|
2404
3230
|
...getFloatingProps,
|
|
2405
3231
|
children: items.map(
|
|
2406
|
-
(items2, i) => items2 && items2.length > 0 ? /* @__PURE__ */
|
|
3232
|
+
(items2, i) => items2 && items2.length > 0 ? /* @__PURE__ */ jsx27(
|
|
2407
3233
|
"div",
|
|
2408
3234
|
{
|
|
2409
3235
|
className: "overflow-auto py-1",
|
|
2410
3236
|
style: { maxHeight: "60vh" },
|
|
2411
|
-
children: items2.map((item) => /* @__PURE__ */
|
|
3237
|
+
children: items2.map((item) => /* @__PURE__ */ jsx27(MenuItem, { item, onSelect }, item.key))
|
|
2412
3238
|
},
|
|
2413
3239
|
i
|
|
2414
3240
|
) : null
|
|
@@ -2432,7 +3258,7 @@ var NavSizeContext = createContext5({
|
|
|
2432
3258
|
});
|
|
2433
3259
|
|
|
2434
3260
|
// src/common/menu/PopupMenuButton.tsx
|
|
2435
|
-
import { Fragment as
|
|
3261
|
+
import { Fragment as Fragment11, jsx as jsx28, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2436
3262
|
function PopupMenuButton({
|
|
2437
3263
|
buttonIcon,
|
|
2438
3264
|
items,
|
|
@@ -2452,7 +3278,7 @@ function PopupMenuButton({
|
|
|
2452
3278
|
selectedKey,
|
|
2453
3279
|
onOpenCallback
|
|
2454
3280
|
}) {
|
|
2455
|
-
const [menuOpen, setMenuOpen] =
|
|
3281
|
+
const [menuOpen, setMenuOpen] = useState12(false);
|
|
2456
3282
|
const { small } = useContext6(NavSizeContext);
|
|
2457
3283
|
const { refs, floatingStyles, context } = useFloating3({
|
|
2458
3284
|
open: menuOpen,
|
|
@@ -2461,64 +3287,72 @@ function PopupMenuButton({
|
|
|
2461
3287
|
placement,
|
|
2462
3288
|
whileElementsMounted: autoUpdate3
|
|
2463
3289
|
});
|
|
2464
|
-
const itemStyle =
|
|
3290
|
+
const itemStyle = useMemo6(() => {
|
|
2465
3291
|
return {
|
|
2466
3292
|
width
|
|
2467
3293
|
};
|
|
2468
3294
|
}, [width]);
|
|
2469
|
-
const onOpenCallbackRef =
|
|
3295
|
+
const onOpenCallbackRef = useRef7(onOpenCallback);
|
|
2470
3296
|
onOpenCallbackRef.current = onOpenCallback;
|
|
2471
|
-
|
|
3297
|
+
useEffect9(() => {
|
|
2472
3298
|
if (menuOpen) {
|
|
2473
3299
|
onOpenCallbackRef.current?.();
|
|
2474
3300
|
}
|
|
2475
3301
|
}, [menuOpen]);
|
|
2476
3302
|
let menuItems = null;
|
|
2477
3303
|
if (menuOpen && items.length > 0) {
|
|
2478
|
-
menuItems = /* @__PURE__ */
|
|
2479
|
-
|
|
3304
|
+
menuItems = /* @__PURE__ */ jsx28(MenuContext.Provider, { value: { selectedKey }, children: /* @__PURE__ */ jsx28(
|
|
3305
|
+
"div",
|
|
2480
3306
|
{
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
leaveFrom: "transform opacity-100 scale-100",
|
|
2487
|
-
leaveTo: "transform opacity-0 scale-95",
|
|
2488
|
-
children: /* @__PURE__ */ jsxs17(
|
|
2489
|
-
Menu2.Items,
|
|
3307
|
+
ref: refs.setFloating,
|
|
3308
|
+
style: floatingStyles,
|
|
3309
|
+
className: small ? "z-10" : "z-[100]",
|
|
3310
|
+
children: /* @__PURE__ */ jsx28(
|
|
3311
|
+
Transition5,
|
|
2490
3312
|
{
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
3313
|
+
as: Fragment10,
|
|
3314
|
+
enter: "transition ease-out duration-100",
|
|
3315
|
+
enterFrom: "transform opacity-0 scale-95",
|
|
3316
|
+
enterTo: "transform opacity-100 scale-100",
|
|
3317
|
+
leave: "transition ease-in duration-75",
|
|
3318
|
+
leaveFrom: "transform opacity-100 scale-100",
|
|
3319
|
+
leaveTo: "transform opacity-0 scale-95",
|
|
3320
|
+
children: /* @__PURE__ */ jsxs25(
|
|
3321
|
+
Menu2.Items,
|
|
3322
|
+
{
|
|
3323
|
+
className: "dark:bg-sentio-gray-200 dark:divide-sentio-gray-400/50 z-10 mt-1 w-[80vw] origin-top cursor-pointer divide-y divide-gray-200 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:ring-gray-100 sm:w-64",
|
|
3324
|
+
style: itemStyle,
|
|
3325
|
+
children: [
|
|
3326
|
+
header,
|
|
3327
|
+
/* @__PURE__ */ jsx28("div", { className: `${itemsClassName} divide-y`, children: items.map((items2, i) => /* @__PURE__ */ jsxs25("div", { className: "py-1", children: [
|
|
3328
|
+
groupLabels?.[i] ? /* @__PURE__ */ jsx28("div", { className: "px-4 py-0.5 text-[10px] font-medium leading-[12px] text-gray-500", children: groupLabels[i] }) : null,
|
|
3329
|
+
items2.map(
|
|
3330
|
+
(item) => renderItem ? renderItem(item) : /* @__PURE__ */ jsx28(
|
|
3331
|
+
MenuItem,
|
|
3332
|
+
{
|
|
3333
|
+
item,
|
|
3334
|
+
onSelect,
|
|
3335
|
+
labelClassName: itemLabelClassName
|
|
3336
|
+
},
|
|
3337
|
+
item.key
|
|
3338
|
+
)
|
|
3339
|
+
)
|
|
3340
|
+
] }, i)) }),
|
|
3341
|
+
footer
|
|
3342
|
+
]
|
|
3343
|
+
}
|
|
3344
|
+
)
|
|
2511
3345
|
}
|
|
2512
3346
|
)
|
|
2513
3347
|
}
|
|
2514
|
-
) })
|
|
3348
|
+
) });
|
|
2515
3349
|
}
|
|
2516
|
-
return /* @__PURE__ */
|
|
3350
|
+
return /* @__PURE__ */ jsx28(Menu2, { children: ({ open }) => {
|
|
2517
3351
|
setTimeout(() => {
|
|
2518
3352
|
setMenuOpen(open);
|
|
2519
3353
|
}, 0);
|
|
2520
|
-
return /* @__PURE__ */
|
|
2521
|
-
/* @__PURE__ */
|
|
3354
|
+
return /* @__PURE__ */ jsxs25(Fragment11, { children: [
|
|
3355
|
+
/* @__PURE__ */ jsx28(
|
|
2522
3356
|
Menu2.Button,
|
|
2523
3357
|
{
|
|
2524
3358
|
className: cx3(
|
|
@@ -2531,14 +3365,14 @@ function PopupMenuButton({
|
|
|
2531
3365
|
children: typeof buttonIcon === "function" ? buttonIcon(menuOpen) : buttonIcon
|
|
2532
3366
|
}
|
|
2533
3367
|
),
|
|
2534
|
-
portal ? /* @__PURE__ */
|
|
3368
|
+
portal ? /* @__PURE__ */ jsx28(FloatingPortal2, { children: menuItems }) : menuItems
|
|
2535
3369
|
] });
|
|
2536
3370
|
} });
|
|
2537
3371
|
}
|
|
2538
3372
|
|
|
2539
3373
|
// src/common/table/Icons.tsx
|
|
2540
|
-
import { jsx as
|
|
2541
|
-
var MoveLeftIcon = (props) => /* @__PURE__ */
|
|
3374
|
+
import { jsx as jsx29, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3375
|
+
var MoveLeftIcon = (props) => /* @__PURE__ */ jsxs26(
|
|
2542
3376
|
"svg",
|
|
2543
3377
|
{
|
|
2544
3378
|
width: "16",
|
|
@@ -2548,8 +3382,8 @@ var MoveLeftIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2548
3382
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2549
3383
|
...props,
|
|
2550
3384
|
children: [
|
|
2551
|
-
/* @__PURE__ */
|
|
2552
|
-
/* @__PURE__ */
|
|
3385
|
+
/* @__PURE__ */ jsxs26("g", { clipPath: "url(#clip0_6869_7300)", children: [
|
|
3386
|
+
/* @__PURE__ */ jsx29(
|
|
2553
3387
|
"path",
|
|
2554
3388
|
{
|
|
2555
3389
|
d: "M2.66666 8H9.33332",
|
|
@@ -2559,7 +3393,7 @@ var MoveLeftIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2559
3393
|
strokeLinejoin: "round"
|
|
2560
3394
|
}
|
|
2561
3395
|
),
|
|
2562
|
-
/* @__PURE__ */
|
|
3396
|
+
/* @__PURE__ */ jsx29(
|
|
2563
3397
|
"path",
|
|
2564
3398
|
{
|
|
2565
3399
|
d: "M2.66666 8L5.33332 10.6667",
|
|
@@ -2569,7 +3403,7 @@ var MoveLeftIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2569
3403
|
strokeLinejoin: "round"
|
|
2570
3404
|
}
|
|
2571
3405
|
),
|
|
2572
|
-
/* @__PURE__ */
|
|
3406
|
+
/* @__PURE__ */ jsx29(
|
|
2573
3407
|
"path",
|
|
2574
3408
|
{
|
|
2575
3409
|
d: "M2.66669 7.9987L5.33335 5.33203",
|
|
@@ -2579,7 +3413,7 @@ var MoveLeftIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2579
3413
|
strokeLinejoin: "round"
|
|
2580
3414
|
}
|
|
2581
3415
|
),
|
|
2582
|
-
/* @__PURE__ */
|
|
3416
|
+
/* @__PURE__ */ jsx29(
|
|
2583
3417
|
"path",
|
|
2584
3418
|
{
|
|
2585
3419
|
d: "M13.3333 2.66797V13.3346",
|
|
@@ -2590,11 +3424,11 @@ var MoveLeftIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2590
3424
|
}
|
|
2591
3425
|
)
|
|
2592
3426
|
] }),
|
|
2593
|
-
/* @__PURE__ */
|
|
3427
|
+
/* @__PURE__ */ jsx29("defs", { children: /* @__PURE__ */ jsx29("clipPath", { id: "clip0_6869_7300", children: /* @__PURE__ */ jsx29("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
2594
3428
|
]
|
|
2595
3429
|
}
|
|
2596
3430
|
);
|
|
2597
|
-
var MoveRightIcon = (props) => /* @__PURE__ */
|
|
3431
|
+
var MoveRightIcon = (props) => /* @__PURE__ */ jsxs26(
|
|
2598
3432
|
"svg",
|
|
2599
3433
|
{
|
|
2600
3434
|
width: "16",
|
|
@@ -2604,8 +3438,8 @@ var MoveRightIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2604
3438
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2605
3439
|
...props,
|
|
2606
3440
|
children: [
|
|
2607
|
-
/* @__PURE__ */
|
|
2608
|
-
/* @__PURE__ */
|
|
3441
|
+
/* @__PURE__ */ jsxs26("g", { clipPath: "url(#clip0_6869_7309)", children: [
|
|
3442
|
+
/* @__PURE__ */ jsx29(
|
|
2609
3443
|
"path",
|
|
2610
3444
|
{
|
|
2611
3445
|
d: "M13.3333 8H6.66666",
|
|
@@ -2615,7 +3449,7 @@ var MoveRightIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2615
3449
|
strokeLinejoin: "round"
|
|
2616
3450
|
}
|
|
2617
3451
|
),
|
|
2618
|
-
/* @__PURE__ */
|
|
3452
|
+
/* @__PURE__ */ jsx29(
|
|
2619
3453
|
"path",
|
|
2620
3454
|
{
|
|
2621
3455
|
d: "M13.3333 8L10.6667 10.6667",
|
|
@@ -2625,7 +3459,7 @@ var MoveRightIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2625
3459
|
strokeLinejoin: "round"
|
|
2626
3460
|
}
|
|
2627
3461
|
),
|
|
2628
|
-
/* @__PURE__ */
|
|
3462
|
+
/* @__PURE__ */ jsx29(
|
|
2629
3463
|
"path",
|
|
2630
3464
|
{
|
|
2631
3465
|
d: "M13.3334 7.9987L10.6667 5.33203",
|
|
@@ -2635,7 +3469,7 @@ var MoveRightIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2635
3469
|
strokeLinejoin: "round"
|
|
2636
3470
|
}
|
|
2637
3471
|
),
|
|
2638
|
-
/* @__PURE__ */
|
|
3472
|
+
/* @__PURE__ */ jsx29(
|
|
2639
3473
|
"path",
|
|
2640
3474
|
{
|
|
2641
3475
|
d: "M2.66669 2.66797V13.3346",
|
|
@@ -2646,11 +3480,11 @@ var MoveRightIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2646
3480
|
}
|
|
2647
3481
|
)
|
|
2648
3482
|
] }),
|
|
2649
|
-
/* @__PURE__ */
|
|
3483
|
+
/* @__PURE__ */ jsx29("defs", { children: /* @__PURE__ */ jsx29("clipPath", { id: "clip0_6869_7309", children: /* @__PURE__ */ jsx29("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
2650
3484
|
]
|
|
2651
3485
|
}
|
|
2652
3486
|
);
|
|
2653
|
-
var RenameIcon = (props) => /* @__PURE__ */
|
|
3487
|
+
var RenameIcon = (props) => /* @__PURE__ */ jsxs26(
|
|
2654
3488
|
"svg",
|
|
2655
3489
|
{
|
|
2656
3490
|
width: "16",
|
|
@@ -2660,7 +3494,7 @@ var RenameIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2660
3494
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2661
3495
|
...props,
|
|
2662
3496
|
children: [
|
|
2663
|
-
/* @__PURE__ */
|
|
3497
|
+
/* @__PURE__ */ jsx29(
|
|
2664
3498
|
"path",
|
|
2665
3499
|
{
|
|
2666
3500
|
d: "M8 13.3281H14",
|
|
@@ -2670,7 +3504,7 @@ var RenameIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2670
3504
|
strokeLinejoin: "round"
|
|
2671
3505
|
}
|
|
2672
3506
|
),
|
|
2673
|
-
/* @__PURE__ */
|
|
3507
|
+
/* @__PURE__ */ jsx29(
|
|
2674
3508
|
"path",
|
|
2675
3509
|
{
|
|
2676
3510
|
d: "M11 2.33609C11.2652 2.07087 11.6249 1.92188 12 1.92188C12.1857 1.92188 12.3696 1.95845 12.5412 2.02953C12.7128 2.1006 12.8687 2.20477 13 2.33609C13.1313 2.46741 13.2355 2.62331 13.3066 2.79489C13.3776 2.96647 13.4142 3.15037 13.4142 3.33609C13.4142 3.52181 13.3776 3.7057 13.3066 3.87728C13.2355 4.04886 13.1313 4.20477 13 4.33609L4.66667 12.6694L2 13.3361L2.66667 10.6694L11 2.33609Z",
|
|
@@ -2683,7 +3517,7 @@ var RenameIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2683
3517
|
]
|
|
2684
3518
|
}
|
|
2685
3519
|
);
|
|
2686
|
-
var DeleteIcon = (props) => /* @__PURE__ */
|
|
3520
|
+
var DeleteIcon = (props) => /* @__PURE__ */ jsxs26(
|
|
2687
3521
|
"svg",
|
|
2688
3522
|
{
|
|
2689
3523
|
width: "16",
|
|
@@ -2693,8 +3527,8 @@ var DeleteIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2693
3527
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2694
3528
|
...props,
|
|
2695
3529
|
children: [
|
|
2696
|
-
/* @__PURE__ */
|
|
2697
|
-
/* @__PURE__ */
|
|
3530
|
+
/* @__PURE__ */ jsxs26("g", { clipPath: "url(#clip0_6869_7344)", children: [
|
|
3531
|
+
/* @__PURE__ */ jsx29(
|
|
2698
3532
|
"path",
|
|
2699
3533
|
{
|
|
2700
3534
|
d: "M2.66669 4.66797H13.3334",
|
|
@@ -2704,7 +3538,7 @@ var DeleteIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2704
3538
|
strokeLinejoin: "round"
|
|
2705
3539
|
}
|
|
2706
3540
|
),
|
|
2707
|
-
/* @__PURE__ */
|
|
3541
|
+
/* @__PURE__ */ jsx29(
|
|
2708
3542
|
"path",
|
|
2709
3543
|
{
|
|
2710
3544
|
d: "M6.66669 7.33203V11.332",
|
|
@@ -2714,7 +3548,7 @@ var DeleteIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2714
3548
|
strokeLinejoin: "round"
|
|
2715
3549
|
}
|
|
2716
3550
|
),
|
|
2717
|
-
/* @__PURE__ */
|
|
3551
|
+
/* @__PURE__ */ jsx29(
|
|
2718
3552
|
"path",
|
|
2719
3553
|
{
|
|
2720
3554
|
d: "M9.33331 7.33203V11.332",
|
|
@@ -2724,7 +3558,7 @@ var DeleteIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2724
3558
|
strokeLinejoin: "round"
|
|
2725
3559
|
}
|
|
2726
3560
|
),
|
|
2727
|
-
/* @__PURE__ */
|
|
3561
|
+
/* @__PURE__ */ jsx29(
|
|
2728
3562
|
"path",
|
|
2729
3563
|
{
|
|
2730
3564
|
d: "M3.33331 4.66797L3.99998 12.668C3.99998 13.0216 4.14046 13.3607 4.3905 13.6108C4.64055 13.8608 4.97969 14.0013 5.33331 14.0013H10.6666C11.0203 14.0013 11.3594 13.8608 11.6095 13.6108C11.8595 13.3607 12 13.0216 12 12.668L12.6666 4.66797",
|
|
@@ -2734,7 +3568,7 @@ var DeleteIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2734
3568
|
strokeLinejoin: "round"
|
|
2735
3569
|
}
|
|
2736
3570
|
),
|
|
2737
|
-
/* @__PURE__ */
|
|
3571
|
+
/* @__PURE__ */ jsx29(
|
|
2738
3572
|
"path",
|
|
2739
3573
|
{
|
|
2740
3574
|
d: "M6 4.66667V2.66667C6 2.48986 6.07024 2.32029 6.19526 2.19526C6.32029 2.07024 6.48986 2 6.66667 2H9.33333C9.51014 2 9.67971 2.07024 9.80474 2.19526C9.92976 2.32029 10 2.48986 10 2.66667V4.66667",
|
|
@@ -2745,14 +3579,14 @@ var DeleteIcon = (props) => /* @__PURE__ */ jsxs18(
|
|
|
2745
3579
|
}
|
|
2746
3580
|
)
|
|
2747
3581
|
] }),
|
|
2748
|
-
/* @__PURE__ */
|
|
3582
|
+
/* @__PURE__ */ jsx29("defs", { children: /* @__PURE__ */ jsx29("clipPath", { id: "clip0_6869_7344", children: /* @__PURE__ */ jsx29("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
2749
3583
|
]
|
|
2750
3584
|
}
|
|
2751
3585
|
);
|
|
2752
3586
|
|
|
2753
3587
|
// src/common/table/ResizeTable.tsx
|
|
2754
3588
|
import { IoReload } from "react-icons/io5";
|
|
2755
|
-
import { jsx as
|
|
3589
|
+
import { jsx as jsx30, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2756
3590
|
var reorder = (list, startIndex, endIndex) => {
|
|
2757
3591
|
const result = Array.from(list);
|
|
2758
3592
|
const [removed] = result.splice(startIndex, 1);
|
|
@@ -2762,7 +3596,7 @@ var reorder = (list, startIndex, endIndex) => {
|
|
|
2762
3596
|
function onPreventClick(e) {
|
|
2763
3597
|
e.stopPropagation();
|
|
2764
3598
|
}
|
|
2765
|
-
var _ResizeTable =
|
|
3599
|
+
var _ResizeTable = forwardRef5(function _ResizeTable2({
|
|
2766
3600
|
data,
|
|
2767
3601
|
columns,
|
|
2768
3602
|
columnResizeMode,
|
|
@@ -2786,7 +3620,7 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
2786
3620
|
estimatedRowHeight = 35,
|
|
2787
3621
|
overscan = 5
|
|
2788
3622
|
}, tableContainerRef) {
|
|
2789
|
-
const adjustedColumns =
|
|
3623
|
+
const adjustedColumns = useMemo7(() => {
|
|
2790
3624
|
let totalWidth = 0;
|
|
2791
3625
|
const newColumns = columns.map((c) => {
|
|
2792
3626
|
const item = Object.assign({ minSize }, c);
|
|
@@ -2805,7 +3639,7 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
2805
3639
|
}
|
|
2806
3640
|
return newColumns;
|
|
2807
3641
|
}, [columns, minSize, minWidth]);
|
|
2808
|
-
const [tableState, setTableState] =
|
|
3642
|
+
const [tableState, setTableState] = useState13(() => {
|
|
2809
3643
|
const initialState = {
|
|
2810
3644
|
pagination: {
|
|
2811
3645
|
pageIndex: 0,
|
|
@@ -2825,7 +3659,7 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
2825
3659
|
onStateChange: setTableState,
|
|
2826
3660
|
manualSorting
|
|
2827
3661
|
});
|
|
2828
|
-
|
|
3662
|
+
useEffect10(() => {
|
|
2829
3663
|
if (state && Object.keys(state).length > 0) {
|
|
2830
3664
|
setTableState((prev) => {
|
|
2831
3665
|
const newState = {
|
|
@@ -2837,14 +3671,14 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
2837
3671
|
});
|
|
2838
3672
|
}
|
|
2839
3673
|
}, [state]);
|
|
2840
|
-
const debounceStateChange =
|
|
3674
|
+
const debounceStateChange = useMemo7(() => {
|
|
2841
3675
|
if (!onStateChange) return void 0;
|
|
2842
3676
|
return debounce(onStateChange, 500, {});
|
|
2843
3677
|
}, [onStateChange]);
|
|
2844
|
-
|
|
3678
|
+
useEffect10(() => {
|
|
2845
3679
|
debounceStateChange?.(tableState);
|
|
2846
3680
|
}, [debounceStateChange, tableState]);
|
|
2847
|
-
const fetchMoreOnBottomReached =
|
|
3681
|
+
const fetchMoreOnBottomReached = useMemo7(() => {
|
|
2848
3682
|
return debounce((containerRefElement) => {
|
|
2849
3683
|
if (containerRefElement) {
|
|
2850
3684
|
const { scrollHeight, scrollTop, clientHeight } = containerRefElement;
|
|
@@ -2854,8 +3688,8 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
2854
3688
|
}
|
|
2855
3689
|
}, 500);
|
|
2856
3690
|
}, [onFetchMore, isFetching, hasMore]);
|
|
2857
|
-
const tableContainerElementRef =
|
|
2858
|
-
|
|
3691
|
+
const tableContainerElementRef = useRef8(null);
|
|
3692
|
+
useEffect10(() => {
|
|
2859
3693
|
if (tableContainerRef) {
|
|
2860
3694
|
if (typeof tableContainerRef === "function") {
|
|
2861
3695
|
tableContainerRef(tableContainerElementRef.current);
|
|
@@ -2867,21 +3701,21 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
2867
3701
|
const rowVirtualizer = useVirtualizer2({
|
|
2868
3702
|
count: enableVirtualization ? table.getRowModel().rows.length : 0,
|
|
2869
3703
|
getScrollElement: () => tableContainerElementRef.current,
|
|
2870
|
-
estimateSize:
|
|
3704
|
+
estimateSize: useCallback8(() => estimatedRowHeight, [estimatedRowHeight]),
|
|
2871
3705
|
overscan,
|
|
2872
3706
|
enabled: enableVirtualization
|
|
2873
3707
|
});
|
|
2874
3708
|
const virtualRows = enableVirtualization ? rowVirtualizer.getVirtualItems() : [];
|
|
2875
3709
|
const paddingTop = enableVirtualization && virtualRows.length > 0 ? virtualRows[0].start : 0;
|
|
2876
3710
|
const paddingBottom = enableVirtualization && virtualRows.length > 0 ? rowVirtualizer.getTotalSize() - (virtualRows[virtualRows.length - 1].start + virtualRows[virtualRows.length - 1].size) : 0;
|
|
2877
|
-
return /* @__PURE__ */
|
|
3711
|
+
return /* @__PURE__ */ jsx30(
|
|
2878
3712
|
"div",
|
|
2879
3713
|
{
|
|
2880
3714
|
className: "overflow-auto",
|
|
2881
3715
|
style: height ? { height } : void 0,
|
|
2882
3716
|
ref: tableContainerElementRef,
|
|
2883
3717
|
onScroll: (e) => fetchMoreOnBottomReached(e.target),
|
|
2884
|
-
children: /* @__PURE__ */
|
|
3718
|
+
children: /* @__PURE__ */ jsxs27(
|
|
2885
3719
|
"table",
|
|
2886
3720
|
{
|
|
2887
3721
|
className: "w-fit",
|
|
@@ -2891,11 +3725,11 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
2891
3725
|
}
|
|
2892
3726
|
},
|
|
2893
3727
|
children: [
|
|
2894
|
-
/* @__PURE__ */
|
|
3728
|
+
/* @__PURE__ */ jsx30("thead", { className: "dark:bg-sentio-gray-100 sticky top-0 z-[1] bg-white", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx30(
|
|
2895
3729
|
"tr",
|
|
2896
3730
|
{
|
|
2897
3731
|
className: "relative flex w-fit cursor-pointer items-center border-b",
|
|
2898
|
-
children: headerGroup.headers.map((header, i) => /* @__PURE__ */
|
|
3732
|
+
children: headerGroup.headers.map((header, i) => /* @__PURE__ */ jsxs27(
|
|
2899
3733
|
"th",
|
|
2900
3734
|
{
|
|
2901
3735
|
colSpan: header.colSpan,
|
|
@@ -2905,12 +3739,12 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
2905
3739
|
className: "text-ilabel group/th blinked dark:hover:!bg-sentio-gray-300 dark:bg-sentio-gray-100 text-text-foreground hover:!bg-primary-50 relative flex items-center whitespace-nowrap bg-white px-2 py-2 text-left font-semibold",
|
|
2906
3740
|
onClick: header.column.getToggleSortingHandler(),
|
|
2907
3741
|
children: [
|
|
2908
|
-
/* @__PURE__ */
|
|
2909
|
-
/* @__PURE__ */
|
|
3742
|
+
/* @__PURE__ */ jsxs27("span", { className: "flex w-full flex-1 overflow-hidden", children: [
|
|
3743
|
+
/* @__PURE__ */ jsx30("span", { className: "flex-1 truncate", children: header.isPlaceholder ? null : flexRender(
|
|
2910
3744
|
header.column.columnDef.header,
|
|
2911
3745
|
header.getContext()
|
|
2912
3746
|
) }),
|
|
2913
|
-
header.column.getCanSort() && allowSort ? /* @__PURE__ */
|
|
3747
|
+
header.column.getCanSort() && allowSort ? /* @__PURE__ */ jsx30(
|
|
2914
3748
|
"span",
|
|
2915
3749
|
{
|
|
2916
3750
|
className: cx3(
|
|
@@ -2919,16 +3753,16 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
2919
3753
|
"inline-block cursor-pointer",
|
|
2920
3754
|
"shrink-0"
|
|
2921
3755
|
),
|
|
2922
|
-
children: header.column.getIsSorted() ? header.column.getIsSorted() == "desc" ? /* @__PURE__ */
|
|
3756
|
+
children: header.column.getIsSorted() ? header.column.getIsSorted() == "desc" ? /* @__PURE__ */ jsx30(HiOutlineSortDescending, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx30(HiOutlineSortAscending, { className: "h-4 w-4" }) : ""
|
|
2923
3757
|
}
|
|
2924
3758
|
) : null
|
|
2925
3759
|
] }),
|
|
2926
|
-
allowEditColumn !== false && /* @__PURE__ */
|
|
3760
|
+
allowEditColumn !== false && /* @__PURE__ */ jsx30(
|
|
2927
3761
|
"span",
|
|
2928
3762
|
{
|
|
2929
3763
|
className: "invisible inline-block group-hover/th:visible",
|
|
2930
3764
|
onClick: onPreventClick,
|
|
2931
|
-
children: /* @__PURE__ */
|
|
3765
|
+
children: /* @__PURE__ */ jsx30(
|
|
2932
3766
|
PopupMenuButton,
|
|
2933
3767
|
{
|
|
2934
3768
|
buttonClassName: "align-text-bottom",
|
|
@@ -2954,19 +3788,19 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
2954
3788
|
console.log(commandKey, "is not applied");
|
|
2955
3789
|
}
|
|
2956
3790
|
},
|
|
2957
|
-
buttonIcon: /* @__PURE__ */
|
|
3791
|
+
buttonIcon: /* @__PURE__ */ jsx30(HiChevronDown, { className: "icon mr-2" }),
|
|
2958
3792
|
items: [
|
|
2959
3793
|
[
|
|
2960
3794
|
{
|
|
2961
3795
|
key: "reorder.left",
|
|
2962
3796
|
label: "Move column left",
|
|
2963
|
-
icon: /* @__PURE__ */
|
|
3797
|
+
icon: /* @__PURE__ */ jsx30(MoveLeftIcon, { className: "mr-2" }),
|
|
2964
3798
|
disabled: i === 0
|
|
2965
3799
|
},
|
|
2966
3800
|
{
|
|
2967
3801
|
key: "reorder.right",
|
|
2968
3802
|
label: "Move column right",
|
|
2969
|
-
icon: /* @__PURE__ */
|
|
3803
|
+
icon: /* @__PURE__ */ jsx30(MoveRightIcon, { className: "mr-2" }),
|
|
2970
3804
|
disabled: i === headerGroup.headers.length - 1
|
|
2971
3805
|
}
|
|
2972
3806
|
],
|
|
@@ -2975,7 +3809,7 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
2975
3809
|
{
|
|
2976
3810
|
key: "rename",
|
|
2977
3811
|
label: "Rename column",
|
|
2978
|
-
icon: /* @__PURE__ */
|
|
3812
|
+
icon: /* @__PURE__ */ jsx30(RenameIcon, { className: "mr-2" })
|
|
2979
3813
|
}
|
|
2980
3814
|
]
|
|
2981
3815
|
] : [],
|
|
@@ -2984,7 +3818,7 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
2984
3818
|
{
|
|
2985
3819
|
key: "delete",
|
|
2986
3820
|
label: "Remove column",
|
|
2987
|
-
icon: /* @__PURE__ */
|
|
3821
|
+
icon: /* @__PURE__ */ jsx30(DeleteIcon, { className: "mr-2" }),
|
|
2988
3822
|
status: "danger"
|
|
2989
3823
|
}
|
|
2990
3824
|
]
|
|
@@ -2994,7 +3828,7 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
2994
3828
|
)
|
|
2995
3829
|
}
|
|
2996
3830
|
),
|
|
2997
|
-
header.column.getCanResize() ? /* @__PURE__ */
|
|
3831
|
+
header.column.getCanResize() ? /* @__PURE__ */ jsx30(
|
|
2998
3832
|
"div",
|
|
2999
3833
|
{
|
|
3000
3834
|
onMouseDown: header.getResizeHandler(),
|
|
@@ -3017,11 +3851,11 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
3017
3851
|
},
|
|
3018
3852
|
headerGroup.id
|
|
3019
3853
|
)) }),
|
|
3020
|
-
/* @__PURE__ */
|
|
3021
|
-
enableVirtualization && paddingTop > 0 && /* @__PURE__ */
|
|
3854
|
+
/* @__PURE__ */ jsxs27("tbody", { children: [
|
|
3855
|
+
enableVirtualization && paddingTop > 0 && /* @__PURE__ */ jsx30("tr", { children: /* @__PURE__ */ jsx30("td", { style: { height: `${paddingTop}px` } }) }),
|
|
3022
3856
|
enableVirtualization ? virtualRows.map((virtualRow) => {
|
|
3023
3857
|
const row = table.getRowModel().rows[virtualRow.index];
|
|
3024
|
-
return /* @__PURE__ */
|
|
3858
|
+
return /* @__PURE__ */ jsx30(
|
|
3025
3859
|
"tr",
|
|
3026
3860
|
{
|
|
3027
3861
|
"data-index": virtualRow.index,
|
|
@@ -3030,7 +3864,7 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
3030
3864
|
onClick ? "cursor-pointer" : "",
|
|
3031
3865
|
rowClassNameFn ? rowClassNameFn(row) : ""
|
|
3032
3866
|
),
|
|
3033
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */
|
|
3867
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx30(
|
|
3034
3868
|
"td",
|
|
3035
3869
|
{
|
|
3036
3870
|
...{
|
|
@@ -3050,7 +3884,7 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
3050
3884
|
},
|
|
3051
3885
|
row.id
|
|
3052
3886
|
);
|
|
3053
|
-
}) : table.getRowModel().rows.map((row) => /* @__PURE__ */
|
|
3887
|
+
}) : table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx30(
|
|
3054
3888
|
"tr",
|
|
3055
3889
|
{
|
|
3056
3890
|
className: cx3(
|
|
@@ -3058,7 +3892,7 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
3058
3892
|
onClick ? "cursor-pointer" : "",
|
|
3059
3893
|
rowClassNameFn ? rowClassNameFn(row) : ""
|
|
3060
3894
|
),
|
|
3061
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */
|
|
3895
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx30(
|
|
3062
3896
|
"td",
|
|
3063
3897
|
{
|
|
3064
3898
|
...{
|
|
@@ -3078,8 +3912,8 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
3078
3912
|
},
|
|
3079
3913
|
row.id
|
|
3080
3914
|
)),
|
|
3081
|
-
enableVirtualization && paddingBottom > 0 && /* @__PURE__ */
|
|
3082
|
-
onFetchMore && /* @__PURE__ */
|
|
3915
|
+
enableVirtualization && paddingBottom > 0 && /* @__PURE__ */ jsx30("tr", { children: /* @__PURE__ */ jsx30("td", { style: { height: `${paddingBottom}px` } }) }),
|
|
3916
|
+
onFetchMore && /* @__PURE__ */ jsx30("tr", { children: /* @__PURE__ */ jsx30(
|
|
3083
3917
|
"td",
|
|
3084
3918
|
{
|
|
3085
3919
|
colSpan: table.getHeaderGroups()[0].headers.length,
|
|
@@ -3088,8 +3922,8 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
3088
3922
|
if (isFetching) return;
|
|
3089
3923
|
onFetchMore?.();
|
|
3090
3924
|
},
|
|
3091
|
-
children: isFetching || hasMore ? /* @__PURE__ */
|
|
3092
|
-
/* @__PURE__ */
|
|
3925
|
+
children: isFetching || hasMore ? /* @__PURE__ */ jsxs27("span", { className: "inline-flex items-center gap-2", children: [
|
|
3926
|
+
/* @__PURE__ */ jsx30(
|
|
3093
3927
|
IoReload,
|
|
3094
3928
|
{
|
|
3095
3929
|
className: cx3(
|
|
@@ -3098,7 +3932,7 @@ var _ResizeTable = forwardRef4(function _ResizeTable2({
|
|
|
3098
3932
|
)
|
|
3099
3933
|
}
|
|
3100
3934
|
),
|
|
3101
|
-
/* @__PURE__ */
|
|
3935
|
+
/* @__PURE__ */ jsx30("span", { children: "Loading..." })
|
|
3102
3936
|
] }) : "No more data"
|
|
3103
3937
|
}
|
|
3104
3938
|
) })
|
|
@@ -3136,10 +3970,10 @@ function getNumberWithDecimal(hex, decimal, asNumber) {
|
|
|
3136
3970
|
}
|
|
3137
3971
|
|
|
3138
3972
|
// src/utils/use-mobile.ts
|
|
3139
|
-
import { useState as
|
|
3973
|
+
import { useState as useState14, useEffect as useEffect11 } from "react";
|
|
3140
3974
|
function useMobile(breakpoint = 768, defaultValue = false) {
|
|
3141
|
-
const [isMobile, setIsMobile] =
|
|
3142
|
-
|
|
3975
|
+
const [isMobile, setIsMobile] = useState14(defaultValue);
|
|
3976
|
+
useEffect11(() => {
|
|
3143
3977
|
const checkUserAgent = () => {
|
|
3144
3978
|
if (typeof window === "undefined") return false;
|
|
3145
3979
|
const userAgent = window.navigator.userAgent.toLowerCase();
|
|
@@ -3190,13 +4024,15 @@ export {
|
|
|
3190
4024
|
BaseZIndexContext,
|
|
3191
4025
|
NewButton as Button,
|
|
3192
4026
|
COLOR_MAP,
|
|
4027
|
+
Checkbox,
|
|
3193
4028
|
LuSquareX as CloseSquareO,
|
|
3194
4029
|
Collapse,
|
|
4030
|
+
ConfirmDialog,
|
|
3195
4031
|
CopyButton,
|
|
3196
4032
|
CopyIcon,
|
|
3197
4033
|
CopySuccessIcon,
|
|
3198
|
-
DarkModeContext,
|
|
3199
4034
|
DeleteIcon,
|
|
4035
|
+
Descriptions,
|
|
3200
4036
|
DisclosurePanel,
|
|
3201
4037
|
Empty,
|
|
3202
4038
|
LuEye as EyeO,
|
|
@@ -3211,25 +4047,34 @@ export {
|
|
|
3211
4047
|
MoveLeftIcon,
|
|
3212
4048
|
MoveRightIcon,
|
|
3213
4049
|
NavSizeContext,
|
|
4050
|
+
Notification,
|
|
3214
4051
|
LuSquarePlus as PlusSquareO,
|
|
3215
4052
|
PopoverTooltip,
|
|
3216
4053
|
PopupMenuButton,
|
|
3217
4054
|
Proccessing,
|
|
4055
|
+
ProgressBar,
|
|
3218
4056
|
ROOT_KEY,
|
|
3219
4057
|
RadioSelect,
|
|
3220
4058
|
RenameIcon,
|
|
3221
4059
|
ResizeTable,
|
|
3222
4060
|
SUFFIX_NODE_KEY,
|
|
4061
|
+
SearchInput,
|
|
3223
4062
|
Select,
|
|
4063
|
+
SlideOver,
|
|
3224
4064
|
SpinLoading,
|
|
3225
4065
|
StatusBadge,
|
|
3226
4066
|
StatusRole,
|
|
3227
4067
|
SubMenuButton,
|
|
3228
4068
|
SvgFolderContext,
|
|
3229
4069
|
Switch,
|
|
4070
|
+
Group as TabGroup,
|
|
4071
|
+
List as TabList,
|
|
4072
|
+
Panel as TabPanel,
|
|
4073
|
+
Panels as TabPanels,
|
|
3230
4074
|
buttonClass,
|
|
3231
4075
|
cx3 as classNames,
|
|
3232
4076
|
getNumberWithDecimal,
|
|
4077
|
+
getTabClassName,
|
|
3233
4078
|
parseHex,
|
|
3234
4079
|
useBoolean,
|
|
3235
4080
|
useDarkMode,
|