@sentio/ui-core 0.1.4 → 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 +489 -0
- 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 +1003 -171
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +987 -148
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -36,13 +36,15 @@ __export(index_exports, {
|
|
|
36
36
|
BaseZIndexContext: () => BaseZIndexContext,
|
|
37
37
|
Button: () => NewButton,
|
|
38
38
|
COLOR_MAP: () => COLOR_MAP,
|
|
39
|
+
Checkbox: () => Checkbox,
|
|
39
40
|
CloseSquareO: () => import_lu2.LuSquareX,
|
|
40
41
|
Collapse: () => Collapse,
|
|
42
|
+
ConfirmDialog: () => ConfirmDialog,
|
|
41
43
|
CopyButton: () => CopyButton,
|
|
42
44
|
CopyIcon: () => CopyIcon,
|
|
43
45
|
CopySuccessIcon: () => CopySuccessIcon,
|
|
44
|
-
DarkModeContext: () => DarkModeContext,
|
|
45
46
|
DeleteIcon: () => DeleteIcon,
|
|
47
|
+
Descriptions: () => Descriptions,
|
|
46
48
|
DisclosurePanel: () => DisclosurePanel,
|
|
47
49
|
Empty: () => Empty,
|
|
48
50
|
EyeO: () => import_lu2.LuEye,
|
|
@@ -57,25 +59,34 @@ __export(index_exports, {
|
|
|
57
59
|
MoveLeftIcon: () => MoveLeftIcon,
|
|
58
60
|
MoveRightIcon: () => MoveRightIcon,
|
|
59
61
|
NavSizeContext: () => NavSizeContext,
|
|
62
|
+
Notification: () => Notification,
|
|
60
63
|
PlusSquareO: () => import_lu2.LuSquarePlus,
|
|
61
64
|
PopoverTooltip: () => PopoverTooltip,
|
|
62
65
|
PopupMenuButton: () => PopupMenuButton,
|
|
63
66
|
Proccessing: () => Proccessing,
|
|
67
|
+
ProgressBar: () => ProgressBar,
|
|
64
68
|
ROOT_KEY: () => ROOT_KEY,
|
|
65
69
|
RadioSelect: () => RadioSelect,
|
|
66
70
|
RenameIcon: () => RenameIcon,
|
|
67
71
|
ResizeTable: () => ResizeTable,
|
|
68
72
|
SUFFIX_NODE_KEY: () => SUFFIX_NODE_KEY,
|
|
73
|
+
SearchInput: () => SearchInput,
|
|
69
74
|
Select: () => Select,
|
|
75
|
+
SlideOver: () => SlideOver,
|
|
70
76
|
SpinLoading: () => SpinLoading,
|
|
71
77
|
StatusBadge: () => StatusBadge,
|
|
72
78
|
StatusRole: () => StatusRole,
|
|
73
79
|
SubMenuButton: () => SubMenuButton,
|
|
74
80
|
SvgFolderContext: () => SvgFolderContext,
|
|
75
81
|
Switch: () => Switch,
|
|
82
|
+
TabGroup: () => Group,
|
|
83
|
+
TabList: () => List,
|
|
84
|
+
TabPanel: () => Panel,
|
|
85
|
+
TabPanels: () => Panels,
|
|
76
86
|
buttonClass: () => buttonClass,
|
|
77
87
|
classNames: () => import_class_variance_authority10.cx,
|
|
78
88
|
getNumberWithDecimal: () => getNumberWithDecimal,
|
|
89
|
+
getTabClassName: () => getTabClassName,
|
|
79
90
|
parseHex: () => parseHex,
|
|
80
91
|
useBoolean: () => useBoolean,
|
|
81
92
|
useDarkMode: () => useDarkMode,
|
|
@@ -611,7 +622,10 @@ var buttonClass = (0, import_class_variance_authority5.cva)(["inline-flex", "ite
|
|
|
611
622
|
disabled: false
|
|
612
623
|
}
|
|
613
624
|
});
|
|
614
|
-
function Proccessing({
|
|
625
|
+
function Proccessing({
|
|
626
|
+
className,
|
|
627
|
+
light
|
|
628
|
+
}) {
|
|
615
629
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { className: `h-5 w-5 animate-spin ${className}`, viewBox: "0 0 24 24", children: [
|
|
616
630
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
617
631
|
"circle",
|
|
@@ -694,12 +708,17 @@ function Button({
|
|
|
694
708
|
iconEl2 = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
695
709
|
Proccessing,
|
|
696
710
|
{
|
|
697
|
-
className: (0, import_class_variance_authority5.cx)(
|
|
711
|
+
className: (0, import_class_variance_authority5.cx)(
|
|
712
|
+
pIconClass({ size }),
|
|
713
|
+
role == "primary" ? "text-white" : ""
|
|
714
|
+
),
|
|
698
715
|
light: role !== "primary"
|
|
699
716
|
}
|
|
700
717
|
);
|
|
701
718
|
} else if (icon) {
|
|
702
|
-
iconEl2 = (0, import_react6.cloneElement)(icon, {
|
|
719
|
+
iconEl2 = (0, import_react6.cloneElement)(icon, {
|
|
720
|
+
className: (0, import_class_variance_authority5.cx)(icon.props.className, iconClasses)
|
|
721
|
+
});
|
|
703
722
|
}
|
|
704
723
|
return iconEl2;
|
|
705
724
|
}, [icon, iconClasses, processing, role]);
|
|
@@ -2085,7 +2104,7 @@ var FlatTree = (props) => {
|
|
|
2085
2104
|
var FlatTree_default = (0, import_react20.memo)(FlatTree);
|
|
2086
2105
|
|
|
2087
2106
|
// src/common/text/LinkifyText.tsx
|
|
2088
|
-
var
|
|
2107
|
+
var import_linkify_html = __toESM(require("linkify-html"));
|
|
2089
2108
|
var import_dompurify = __toESM(require("dompurify"));
|
|
2090
2109
|
var import_react21 = require("react");
|
|
2091
2110
|
var import_lodash5 = require("lodash");
|
|
@@ -2125,7 +2144,7 @@ var LinkifyText = (0, import_react21.memo)(function LinkifyText2({
|
|
|
2125
2144
|
}
|
|
2126
2145
|
return null;
|
|
2127
2146
|
}
|
|
2128
|
-
const linkStr = (0,
|
|
2147
|
+
const linkStr = (0, import_linkify_html.default)(
|
|
2129
2148
|
isHighlightNumbers ? renderTextWithColoredNumbers(text) : text,
|
|
2130
2149
|
{
|
|
2131
2150
|
attributes: {
|
|
@@ -2145,24 +2164,105 @@ var LinkifyText = (0, import_react21.memo)(function LinkifyText2({
|
|
|
2145
2164
|
});
|
|
2146
2165
|
|
|
2147
2166
|
// src/common/Empty.tsx
|
|
2148
|
-
var
|
|
2167
|
+
var import_react24 = require("react");
|
|
2149
2168
|
|
|
2150
2169
|
// src/utils/extension-context.ts
|
|
2170
|
+
var import_react23 = require("react");
|
|
2171
|
+
|
|
2172
|
+
// src/utils/use-dark-mode.ts
|
|
2151
2173
|
var import_react22 = require("react");
|
|
2152
|
-
var
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2174
|
+
var DarkModeListener = class _DarkModeListener {
|
|
2175
|
+
constructor() {
|
|
2176
|
+
this.isDarkMode = false;
|
|
2177
|
+
this.listeners = [];
|
|
2178
|
+
this.init();
|
|
2179
|
+
}
|
|
2180
|
+
static get instance() {
|
|
2181
|
+
if (!this._instance) {
|
|
2182
|
+
this._instance = new _DarkModeListener();
|
|
2183
|
+
}
|
|
2184
|
+
return this._instance;
|
|
2185
|
+
}
|
|
2186
|
+
addListener(listener) {
|
|
2187
|
+
this.listeners.push(listener);
|
|
2188
|
+
}
|
|
2189
|
+
removeListener(listener) {
|
|
2190
|
+
this.listeners = this.listeners.filter((l) => l !== listener);
|
|
2191
|
+
}
|
|
2192
|
+
get darkMode() {
|
|
2193
|
+
return this.isDarkMode;
|
|
2194
|
+
}
|
|
2195
|
+
_sync(theme = "system") {
|
|
2196
|
+
let isDarkMode = false;
|
|
2197
|
+
if (theme === "system") {
|
|
2198
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2199
|
+
isDarkMode = mediaQuery.matches;
|
|
2200
|
+
localStorage.setItem("theme", "system");
|
|
2201
|
+
} else if (theme === "light") {
|
|
2202
|
+
isDarkMode = false;
|
|
2203
|
+
localStorage.removeItem("theme");
|
|
2204
|
+
} else {
|
|
2205
|
+
isDarkMode = theme === "dark";
|
|
2206
|
+
localStorage.setItem("theme", "dark");
|
|
2207
|
+
}
|
|
2208
|
+
this.isDarkMode = isDarkMode;
|
|
2209
|
+
document.body.classList.remove("light", "dark");
|
|
2210
|
+
document.body.classList.add(isDarkMode ? "dark" : "light");
|
|
2211
|
+
this.listeners.forEach((listener) => listener(isDarkMode));
|
|
2212
|
+
}
|
|
2213
|
+
toggleDarkMode() {
|
|
2214
|
+
this.isDarkMode = document.body.classList.contains("dark");
|
|
2215
|
+
this._sync(this.isDarkMode ? "light" : "dark");
|
|
2216
|
+
}
|
|
2217
|
+
setDarkMode(value) {
|
|
2218
|
+
this._sync(value);
|
|
2219
|
+
}
|
|
2220
|
+
init() {
|
|
2221
|
+
this.isDarkMode = document.body.classList.contains("dark");
|
|
2222
|
+
const observer = new MutationObserver((mutationsList) => {
|
|
2223
|
+
for (const mutation of mutationsList) {
|
|
2224
|
+
if (mutation.type === "attributes" && mutation.attributeName === "class") {
|
|
2225
|
+
const isDarkMode = document.body.classList.contains("dark");
|
|
2226
|
+
if (this.isDarkMode !== isDarkMode) {
|
|
2227
|
+
this.isDarkMode = isDarkMode;
|
|
2228
|
+
this.listeners.forEach((listener) => listener(isDarkMode));
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
});
|
|
2233
|
+
const config = {
|
|
2234
|
+
attributes: true,
|
|
2235
|
+
// Observe attribute changes
|
|
2236
|
+
attributeFilter: ["class"]
|
|
2237
|
+
// Only observe changes to the 'class' attribute
|
|
2238
|
+
};
|
|
2239
|
+
observer.observe(document.body, config);
|
|
2240
|
+
}
|
|
2156
2241
|
};
|
|
2157
|
-
var DarkModeContext = (0, import_react22.createContext)(false);
|
|
2158
2242
|
var useDarkMode = () => {
|
|
2159
|
-
|
|
2243
|
+
const [isDarkMode, setIsDarkMode] = (0, import_react22.useState)(false);
|
|
2244
|
+
(0, import_react22.useEffect)(() => {
|
|
2245
|
+
const instance = DarkModeListener.instance;
|
|
2246
|
+
setIsDarkMode(instance.darkMode);
|
|
2247
|
+
instance.addListener(setIsDarkMode);
|
|
2248
|
+
return () => {
|
|
2249
|
+
instance.removeListener(setIsDarkMode);
|
|
2250
|
+
};
|
|
2251
|
+
}, []);
|
|
2252
|
+
return isDarkMode;
|
|
2253
|
+
};
|
|
2254
|
+
|
|
2255
|
+
// src/utils/extension-context.ts
|
|
2256
|
+
var SvgFolderContext = (0, import_react23.createContext)("");
|
|
2257
|
+
var useDetectExtenstion = () => {
|
|
2258
|
+
const folderPath = (0, import_react23.useContext)(SvgFolderContext);
|
|
2259
|
+
return Boolean(folderPath);
|
|
2160
2260
|
};
|
|
2161
2261
|
|
|
2162
2262
|
// src/common/Empty.tsx
|
|
2163
2263
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2164
2264
|
var Empty = (props) => {
|
|
2165
|
-
const parentFolder = (0,
|
|
2265
|
+
const parentFolder = (0, import_react24.useContext)(SvgFolderContext);
|
|
2166
2266
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "mx-auto w-fit", children: [
|
|
2167
2267
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2168
2268
|
"img",
|
|
@@ -2258,25 +2358,738 @@ var HeaderToolsContent = ({
|
|
|
2258
2358
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: (0, import_class_variance_authority16.cx)("w-full overflow-hidden", className), children });
|
|
2259
2359
|
};
|
|
2260
2360
|
|
|
2261
|
-
// src/common/
|
|
2361
|
+
// src/common/SlideOver.tsx
|
|
2362
|
+
var import_react25 = require("react");
|
|
2363
|
+
var import_react26 = require("@headlessui/react");
|
|
2364
|
+
var import_outline = require("@heroicons/react/24/outline");
|
|
2365
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2366
|
+
function SlideOver({
|
|
2367
|
+
title,
|
|
2368
|
+
open,
|
|
2369
|
+
onClose,
|
|
2370
|
+
children,
|
|
2371
|
+
size,
|
|
2372
|
+
headAddon,
|
|
2373
|
+
triggerClose = "all",
|
|
2374
|
+
noAnimation
|
|
2375
|
+
}) {
|
|
2376
|
+
const onDialogClose = (0, import_react25.useCallback)(() => {
|
|
2377
|
+
if (triggerClose === "all") {
|
|
2378
|
+
onClose();
|
|
2379
|
+
}
|
|
2380
|
+
}, [triggerClose, onClose]);
|
|
2381
|
+
const openRef = (0, import_react25.useRef)(open);
|
|
2382
|
+
openRef.current = open;
|
|
2383
|
+
(0, import_react25.useEffect)(() => {
|
|
2384
|
+
function handleKeyDown(event) {
|
|
2385
|
+
if (event.key === "Escape") {
|
|
2386
|
+
event.preventDefault();
|
|
2387
|
+
event.stopPropagation();
|
|
2388
|
+
if (openRef.current) {
|
|
2389
|
+
onClose();
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
if (triggerClose === "button") {
|
|
2394
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
2395
|
+
return () => {
|
|
2396
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
2397
|
+
};
|
|
2398
|
+
}
|
|
2399
|
+
}, [triggerClose, onClose]);
|
|
2400
|
+
const contentNode = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "fixed inset-0 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "absolute inset-y-0 right-0 flex max-w-full pl-10 sm:pl-16", children: [
|
|
2401
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "max-w-2xl max-w-3xl max-w-4xl max-w-5xl max-w-6xl max-w-7xl" }),
|
|
2402
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2403
|
+
import_react26.Dialog.Panel,
|
|
2404
|
+
{
|
|
2405
|
+
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"}`,
|
|
2406
|
+
children: [
|
|
2407
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dark:bg-sentio-gray-100 relative border-b bg-white px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex h-auto items-start justify-between space-x-3 sm:h-5", children: [
|
|
2408
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex-1 space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react26.Dialog.Title, { className: "text-text-foreground text-[15px] font-semibold", children: title }) }),
|
|
2409
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex-0 flex h-auto items-center sm:h-5", children: [
|
|
2410
|
+
headAddon,
|
|
2411
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2412
|
+
"button",
|
|
2413
|
+
{
|
|
2414
|
+
type: "button",
|
|
2415
|
+
className: "hover:text-text-foreground ml-2 text-gray-800 dark:text-gray-500",
|
|
2416
|
+
onClick: () => onClose(),
|
|
2417
|
+
children: [
|
|
2418
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "sr-only", children: "Close panel" }),
|
|
2419
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_outline.XMarkIcon, { className: "h-5 w-5", "aria-hidden": "true" })
|
|
2420
|
+
]
|
|
2421
|
+
}
|
|
2422
|
+
)
|
|
2423
|
+
] })
|
|
2424
|
+
] }) }),
|
|
2425
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex flex-1 overflow-y-auto overflow-x-hidden", children })
|
|
2426
|
+
]
|
|
2427
|
+
}
|
|
2428
|
+
)
|
|
2429
|
+
] }) });
|
|
2430
|
+
if (noAnimation) {
|
|
2431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2432
|
+
import_react26.Dialog,
|
|
2433
|
+
{
|
|
2434
|
+
open,
|
|
2435
|
+
as: "div",
|
|
2436
|
+
className: "relative z-10",
|
|
2437
|
+
id: "test",
|
|
2438
|
+
onClose: onDialogClose,
|
|
2439
|
+
children: contentNode
|
|
2440
|
+
}
|
|
2441
|
+
);
|
|
2442
|
+
}
|
|
2443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react26.Transition.Root, { show: open, as: "div", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2444
|
+
import_react26.Dialog,
|
|
2445
|
+
{
|
|
2446
|
+
static: true,
|
|
2447
|
+
as: "div",
|
|
2448
|
+
className: "relative z-10",
|
|
2449
|
+
id: "test",
|
|
2450
|
+
onClose: onDialogClose,
|
|
2451
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2452
|
+
import_react26.Transition.Child,
|
|
2453
|
+
{
|
|
2454
|
+
as: import_react25.Fragment,
|
|
2455
|
+
enter: "transform transition ease-in-out duration-100 sm:duration-300",
|
|
2456
|
+
enterFrom: "translate-x-full",
|
|
2457
|
+
enterTo: "translate-x-0",
|
|
2458
|
+
leave: "transform transition ease-in-out duration-100 sm:duration-300",
|
|
2459
|
+
leaveFrom: "translate-x-0",
|
|
2460
|
+
leaveTo: "translate-x-full",
|
|
2461
|
+
children: contentNode
|
|
2462
|
+
}
|
|
2463
|
+
)
|
|
2464
|
+
}
|
|
2465
|
+
) });
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
// src/common/ConfirmDialog.tsx
|
|
2469
|
+
var import_react27 = require("react");
|
|
2470
|
+
var import_react28 = require("@headlessui/react");
|
|
2471
|
+
var import_outline2 = require("@heroicons/react/24/outline");
|
|
2472
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2473
|
+
function ConfirmDialog({
|
|
2474
|
+
message,
|
|
2475
|
+
title,
|
|
2476
|
+
open,
|
|
2477
|
+
onClose,
|
|
2478
|
+
onConfirm,
|
|
2479
|
+
buttonLabel = "Delete",
|
|
2480
|
+
type,
|
|
2481
|
+
buttons,
|
|
2482
|
+
children,
|
|
2483
|
+
disabled
|
|
2484
|
+
}) {
|
|
2485
|
+
const cancelButtonRef = (0, import_react27.useRef)(null);
|
|
2486
|
+
const [processing, setProcessing] = (0, import_react27.useState)(false);
|
|
2487
|
+
async function confirm() {
|
|
2488
|
+
setProcessing(true);
|
|
2489
|
+
try {
|
|
2490
|
+
await onConfirm();
|
|
2491
|
+
} finally {
|
|
2492
|
+
setProcessing(false);
|
|
2493
|
+
onClose(false);
|
|
2494
|
+
}
|
|
2495
|
+
}
|
|
2496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react28.Transition.Root, { show: open, as: import_react27.Fragment, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2497
|
+
import_react28.Dialog,
|
|
2498
|
+
{
|
|
2499
|
+
as: "div",
|
|
2500
|
+
className: "relative z-10",
|
|
2501
|
+
"aria-label": "confirm",
|
|
2502
|
+
initialFocus: cancelButtonRef,
|
|
2503
|
+
onClose,
|
|
2504
|
+
children: [
|
|
2505
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2506
|
+
import_react28.Transition.Child,
|
|
2507
|
+
{
|
|
2508
|
+
as: import_react27.Fragment,
|
|
2509
|
+
enter: "ease-out duration-300",
|
|
2510
|
+
enterFrom: "opacity-0",
|
|
2511
|
+
enterTo: "opacity-100",
|
|
2512
|
+
leave: "ease-in duration-200",
|
|
2513
|
+
leaveFrom: "opacity-100",
|
|
2514
|
+
leaveTo: "opacity-0",
|
|
2515
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "fixed inset-0 bg-gray-500/75 transition-opacity dark:bg-gray-200/50" })
|
|
2516
|
+
}
|
|
2517
|
+
),
|
|
2518
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "fixed inset-0 z-10 overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2519
|
+
import_react28.Transition.Child,
|
|
2520
|
+
{
|
|
2521
|
+
as: import_react27.Fragment,
|
|
2522
|
+
enter: "ease-out duration-300",
|
|
2523
|
+
enterFrom: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
2524
|
+
enterTo: "opacity-100 translate-y-0 sm:scale-100",
|
|
2525
|
+
leave: "ease-in duration-200",
|
|
2526
|
+
leaveFrom: "opacity-100 translate-y-0 sm:scale-100",
|
|
2527
|
+
leaveTo: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
2528
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react28.Dialog.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: [
|
|
2529
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dark:bg-sentio-gray-100 bg-white px-4 pb-4 pt-5 sm:p-6 sm:pb-4", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "sm:flex sm:items-start", children: [
|
|
2530
|
+
type == "danger" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("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__ */ (0, import_jsx_runtime20.jsx)(
|
|
2531
|
+
import_outline2.ExclamationCircleIcon,
|
|
2532
|
+
{
|
|
2533
|
+
className: "h-6 w-6 text-red-600 dark:text-red-800",
|
|
2534
|
+
"aria-hidden": "true"
|
|
2535
|
+
}
|
|
2536
|
+
) }),
|
|
2537
|
+
type == "question" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("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__ */ (0, import_jsx_runtime20.jsx)(
|
|
2538
|
+
import_outline2.QuestionMarkCircleIcon,
|
|
2539
|
+
{
|
|
2540
|
+
className: "text-primary-600 dark:text-primary-800 h-6 w-6",
|
|
2541
|
+
"aria-hidden": "true"
|
|
2542
|
+
}
|
|
2543
|
+
) }),
|
|
2544
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left", children: [
|
|
2545
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2546
|
+
import_react28.Dialog.Title,
|
|
2547
|
+
{
|
|
2548
|
+
as: "h3",
|
|
2549
|
+
className: "text-text-foreground text-lg font-medium leading-6",
|
|
2550
|
+
children: title
|
|
2551
|
+
}
|
|
2552
|
+
),
|
|
2553
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "mt-2", children: [
|
|
2554
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm text-gray-500", children: message }),
|
|
2555
|
+
children
|
|
2556
|
+
] })
|
|
2557
|
+
] })
|
|
2558
|
+
] }) }),
|
|
2559
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex gap-2 bg-gray-50 px-4 py-3 sm:flex-row-reverse sm:px-6", children: buttons ? buttons : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2560
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2561
|
+
NewButton,
|
|
2562
|
+
{
|
|
2563
|
+
type: "button",
|
|
2564
|
+
processing,
|
|
2565
|
+
status: type == "danger" ? "danger" : void 0,
|
|
2566
|
+
role: "primary",
|
|
2567
|
+
onClick: () => confirm(),
|
|
2568
|
+
disabled,
|
|
2569
|
+
size: "lg",
|
|
2570
|
+
children: buttonLabel
|
|
2571
|
+
}
|
|
2572
|
+
),
|
|
2573
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2574
|
+
NewButton,
|
|
2575
|
+
{
|
|
2576
|
+
type: "button",
|
|
2577
|
+
role: "secondary",
|
|
2578
|
+
onClick: () => onClose(false),
|
|
2579
|
+
ref: cancelButtonRef,
|
|
2580
|
+
size: "lg",
|
|
2581
|
+
children: "Cancel"
|
|
2582
|
+
}
|
|
2583
|
+
)
|
|
2584
|
+
] }) })
|
|
2585
|
+
] })
|
|
2586
|
+
}
|
|
2587
|
+
) }) })
|
|
2588
|
+
]
|
|
2589
|
+
}
|
|
2590
|
+
) });
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2593
|
+
// src/common/StyledTabs.tsx
|
|
2594
|
+
var import_react29 = __toESM(require("react"));
|
|
2595
|
+
var import_react30 = require("@headlessui/react");
|
|
2596
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2597
|
+
var getTabClassName = ({ selected }) => (0, import_class_variance_authority10.cx)(
|
|
2598
|
+
"font-ilabel py-1 text-sm leading-5 border-b-2 outline-0",
|
|
2599
|
+
selected ? "text-primary border-primary-500" : "text-gray hover:text-primary border-transparent hover:border-primary-500"
|
|
2600
|
+
);
|
|
2601
|
+
var Group = ({
|
|
2602
|
+
children,
|
|
2603
|
+
className,
|
|
2604
|
+
onChange,
|
|
2605
|
+
defaultIndex,
|
|
2606
|
+
selectedIndex
|
|
2607
|
+
}) => {
|
|
2608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2609
|
+
import_react30.Tab.Group,
|
|
2610
|
+
{
|
|
2611
|
+
onChange,
|
|
2612
|
+
defaultIndex,
|
|
2613
|
+
selectedIndex,
|
|
2614
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: (0, import_class_variance_authority10.cx)("flex flex-col", className), children })
|
|
2615
|
+
}
|
|
2616
|
+
);
|
|
2617
|
+
};
|
|
2618
|
+
var List = ({
|
|
2619
|
+
tabs,
|
|
2620
|
+
disabledTabs,
|
|
2621
|
+
className,
|
|
2622
|
+
noBorder,
|
|
2623
|
+
children
|
|
2624
|
+
}) => {
|
|
2625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2626
|
+
import_react30.Tab.List,
|
|
2627
|
+
{
|
|
2628
|
+
className: (0, import_class_variance_authority10.cx)(
|
|
2629
|
+
"flex-0 border-border-color flex justify-start space-x-6 overflow-x-auto px-4",
|
|
2630
|
+
noBorder ? "border-b-0" : "border-b"
|
|
2631
|
+
),
|
|
2632
|
+
children: [
|
|
2633
|
+
tabs.map((tab, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2634
|
+
import_react30.Tab,
|
|
2635
|
+
{
|
|
2636
|
+
className: ({ selected }) => (0, import_class_variance_authority10.cx)(
|
|
2637
|
+
"font-ilabel outline-primary/50 whitespace-nowrap border-b-2 py-1 text-sm leading-5 outline-offset-2",
|
|
2638
|
+
selected ? "border-primary text-primary" : "text-gray hover:text-primary border-transparent",
|
|
2639
|
+
className
|
|
2640
|
+
),
|
|
2641
|
+
disabled: disabledTabs?.includes(index),
|
|
2642
|
+
children: tab
|
|
2643
|
+
},
|
|
2644
|
+
index
|
|
2645
|
+
)),
|
|
2646
|
+
children
|
|
2647
|
+
]
|
|
2648
|
+
}
|
|
2649
|
+
);
|
|
2650
|
+
};
|
|
2651
|
+
var Panels = import_react29.default.forwardRef(function Panels2({ children, className, ...props }, ref) {
|
|
2652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2653
|
+
import_react30.Tab.Panels,
|
|
2654
|
+
{
|
|
2655
|
+
className: (0, import_class_variance_authority10.cx)("flex-1", className || "w-full overflow-auto"),
|
|
2656
|
+
...props,
|
|
2657
|
+
ref,
|
|
2658
|
+
children
|
|
2659
|
+
}
|
|
2660
|
+
);
|
|
2661
|
+
});
|
|
2662
|
+
var Panel = (props) => {
|
|
2663
|
+
const { className, ...otherProps } = props;
|
|
2664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2665
|
+
import_react30.Tab.Panel,
|
|
2666
|
+
{
|
|
2667
|
+
className: (0, import_class_variance_authority10.cx)("space-y-2 outline-0", className),
|
|
2668
|
+
...otherProps
|
|
2669
|
+
}
|
|
2670
|
+
);
|
|
2671
|
+
};
|
|
2672
|
+
|
|
2673
|
+
// src/common/SearchInput.tsx
|
|
2674
|
+
var import_solid4 = require("@heroicons/react/20/solid");
|
|
2262
2675
|
var import_react31 = require("react");
|
|
2676
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2677
|
+
var SearchInput = (0, import_react31.forwardRef)((props, ref) => {
|
|
2678
|
+
const {
|
|
2679
|
+
onChange,
|
|
2680
|
+
value,
|
|
2681
|
+
onBlur,
|
|
2682
|
+
onKeydown,
|
|
2683
|
+
addonButton,
|
|
2684
|
+
placeholder = "Search",
|
|
2685
|
+
...args
|
|
2686
|
+
} = props;
|
|
2687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2688
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("label", { htmlFor: "search", className: "sr-only", children: "Search" }),
|
|
2689
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "focus-within:ring-primary-500 focus-within:border-primary-500 relative flex rounded-md border border-gray-300", children: [
|
|
2690
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-1 sm:pl-3", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2691
|
+
import_solid4.MagnifyingGlassIcon,
|
|
2692
|
+
{
|
|
2693
|
+
className: "sm:h-4.5 sm:w-4.5 h-4 w-4 text-gray-400",
|
|
2694
|
+
"aria-hidden": "true"
|
|
2695
|
+
}
|
|
2696
|
+
) }),
|
|
2697
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2698
|
+
"input",
|
|
2699
|
+
{
|
|
2700
|
+
onChange: (e) => onChange(e.target.value),
|
|
2701
|
+
onBlur,
|
|
2702
|
+
onKeyDown: onKeydown,
|
|
2703
|
+
type: "search",
|
|
2704
|
+
className: (0, import_class_variance_authority10.cx)(
|
|
2705
|
+
"md:text-ilabel block w-full rounded-md border-0 pl-6 text-xs focus:ring-0 sm:pl-10 sm:text-sm",
|
|
2706
|
+
"h-[30px] py-1"
|
|
2707
|
+
),
|
|
2708
|
+
placeholder,
|
|
2709
|
+
value,
|
|
2710
|
+
ref,
|
|
2711
|
+
...args
|
|
2712
|
+
}
|
|
2713
|
+
),
|
|
2714
|
+
addonButton
|
|
2715
|
+
] })
|
|
2716
|
+
] });
|
|
2717
|
+
});
|
|
2718
|
+
SearchInput.displayName = "SearchInput";
|
|
2719
|
+
|
|
2720
|
+
// src/common/Checkbox.tsx
|
|
2721
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2722
|
+
var Checkbox = ({
|
|
2723
|
+
checked,
|
|
2724
|
+
onChange,
|
|
2725
|
+
label,
|
|
2726
|
+
labelNode,
|
|
2727
|
+
id,
|
|
2728
|
+
name,
|
|
2729
|
+
inputProps,
|
|
2730
|
+
disabled,
|
|
2731
|
+
labelClassName,
|
|
2732
|
+
className
|
|
2733
|
+
}) => {
|
|
2734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2735
|
+
"div",
|
|
2736
|
+
{
|
|
2737
|
+
className: (0, import_class_variance_authority10.cx)("inline-flex items-center gap-2", className),
|
|
2738
|
+
onClick: (e) => {
|
|
2739
|
+
e.stopPropagation();
|
|
2740
|
+
onChange?.(!checked);
|
|
2741
|
+
},
|
|
2742
|
+
children: [
|
|
2743
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2744
|
+
"input",
|
|
2745
|
+
{
|
|
2746
|
+
id,
|
|
2747
|
+
name,
|
|
2748
|
+
type: "checkbox",
|
|
2749
|
+
className: "text-primary-600 focus:ring-primary-500 h-4 w-4 rounded border-gray-300 ",
|
|
2750
|
+
disabled,
|
|
2751
|
+
checked,
|
|
2752
|
+
readOnly: true,
|
|
2753
|
+
...inputProps
|
|
2754
|
+
}
|
|
2755
|
+
),
|
|
2756
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2757
|
+
"span",
|
|
2758
|
+
{
|
|
2759
|
+
className: (0, import_class_variance_authority10.cx)(
|
|
2760
|
+
"text-ilabel text-gray font-medium",
|
|
2761
|
+
labelClassName
|
|
2762
|
+
),
|
|
2763
|
+
children: label
|
|
2764
|
+
}
|
|
2765
|
+
),
|
|
2766
|
+
labelNode
|
|
2767
|
+
]
|
|
2768
|
+
}
|
|
2769
|
+
);
|
|
2770
|
+
};
|
|
2771
|
+
|
|
2772
|
+
// src/common/ProgressBar.tsx
|
|
2773
|
+
var import_react32 = require("react");
|
|
2774
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2775
|
+
var defaultSegments = {
|
|
2776
|
+
0.25: "from-cyan-600 to-cyan-500",
|
|
2777
|
+
0.5: "from-cyan-500 to-orange-600",
|
|
2778
|
+
0.75: "from-orange-600 to-red-600",
|
|
2779
|
+
1: "from-red-600 to-red-700"
|
|
2780
|
+
};
|
|
2781
|
+
var ProgressBar = ({
|
|
2782
|
+
progress,
|
|
2783
|
+
segments = defaultSegments,
|
|
2784
|
+
gradient,
|
|
2785
|
+
upperTicks,
|
|
2786
|
+
lowerTicks,
|
|
2787
|
+
roundedFull
|
|
2788
|
+
}) => {
|
|
2789
|
+
const elements = (0, import_react32.useMemo)(() => {
|
|
2790
|
+
const result = [];
|
|
2791
|
+
const colors = Object.entries(segments).sort(
|
|
2792
|
+
(a, b) => parseFloat(a[0]) - parseFloat(b[0])
|
|
2793
|
+
);
|
|
2794
|
+
if (gradient) {
|
|
2795
|
+
let pos = 0;
|
|
2796
|
+
colors.forEach(([stop, color], idx) => {
|
|
2797
|
+
const width = (parseFloat(stop) - pos) * 100;
|
|
2798
|
+
result.push(
|
|
2799
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2800
|
+
"div",
|
|
2801
|
+
{
|
|
2802
|
+
className: (0, import_class_variance_authority10.cx)(
|
|
2803
|
+
`absolute top-0 h-4 bg-gradient-to-r ${color}`,
|
|
2804
|
+
idx === 0 && "rounded-l-full",
|
|
2805
|
+
idx === colors.length - 1 && "rounded-r-full"
|
|
2806
|
+
),
|
|
2807
|
+
style: { left: `${pos * 100}%`, width: `${width}%` }
|
|
2808
|
+
},
|
|
2809
|
+
stop
|
|
2810
|
+
)
|
|
2811
|
+
);
|
|
2812
|
+
pos = parseFloat(stop);
|
|
2813
|
+
});
|
|
2814
|
+
} else {
|
|
2815
|
+
let pos = 0;
|
|
2816
|
+
for (const [stop, color] of colors) {
|
|
2817
|
+
const width = (parseFloat(stop) - pos) * 100;
|
|
2818
|
+
result.push(
|
|
2819
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2820
|
+
"div",
|
|
2821
|
+
{
|
|
2822
|
+
className: `absolute h-4 bg-${color} top-0 left-[${pos}] w-[${width}]`
|
|
2823
|
+
}
|
|
2824
|
+
)
|
|
2825
|
+
);
|
|
2826
|
+
pos = parseFloat(stop) * 100;
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
return result;
|
|
2830
|
+
}, [segments, gradient]);
|
|
2831
|
+
const upperTicksElements = (0, import_react32.useMemo)(() => {
|
|
2832
|
+
if (!upperTicks) return null;
|
|
2833
|
+
return Object.entries(upperTicks).map(([p, label]) => {
|
|
2834
|
+
const pos = parseFloat(p);
|
|
2835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2836
|
+
"div",
|
|
2837
|
+
{
|
|
2838
|
+
className: "absolute top-0 border-l border-gray-500 text-xs text-gray-500 hover:z-[1]",
|
|
2839
|
+
style: { left: `${pos * 100}%` },
|
|
2840
|
+
children: [
|
|
2841
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2842
|
+
"div",
|
|
2843
|
+
{
|
|
2844
|
+
className: (0, import_class_variance_authority10.cx)(
|
|
2845
|
+
"absolute w-fit -translate-y-full whitespace-nowrap text-gray-500",
|
|
2846
|
+
pos < 0.05 ? "-translate-x-1/4" : pos > 0.95 ? "-translate-x-3/4" : "-translate-x-1/2"
|
|
2847
|
+
),
|
|
2848
|
+
children: label
|
|
2849
|
+
}
|
|
2850
|
+
),
|
|
2851
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "absolute h-3 w-2 translate-y-1 border-l border-gray-400 border-opacity-50" })
|
|
2852
|
+
]
|
|
2853
|
+
},
|
|
2854
|
+
pos
|
|
2855
|
+
);
|
|
2856
|
+
});
|
|
2857
|
+
}, [upperTicks]);
|
|
2858
|
+
const lowerTicksElements = (0, import_react32.useMemo)(() => {
|
|
2859
|
+
if (!lowerTicks) return null;
|
|
2860
|
+
return Object.entries(lowerTicks).map(([p, label]) => {
|
|
2861
|
+
const pos = parseFloat(p);
|
|
2862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2863
|
+
"div",
|
|
2864
|
+
{
|
|
2865
|
+
className: "relative bottom-0 text-xs hover:z-[1]",
|
|
2866
|
+
style: { left: `${pos * 100}%` },
|
|
2867
|
+
children: [
|
|
2868
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "absolute top-0 h-3 w-2 border-l border-gray-400 border-opacity-50" }),
|
|
2869
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2870
|
+
"div",
|
|
2871
|
+
{
|
|
2872
|
+
className: (0, import_class_variance_authority10.cx)(
|
|
2873
|
+
"absolute translate-y-full text-gray-500",
|
|
2874
|
+
pos < 0.05 ? "-translate-x-1/4" : pos > 0.95 ? "-translate-x-3/4" : "-translate-x-1/2"
|
|
2875
|
+
),
|
|
2876
|
+
children: label
|
|
2877
|
+
}
|
|
2878
|
+
)
|
|
2879
|
+
]
|
|
2880
|
+
},
|
|
2881
|
+
pos
|
|
2882
|
+
);
|
|
2883
|
+
});
|
|
2884
|
+
}, [lowerTicks]);
|
|
2885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "w-full", children: [
|
|
2886
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "relative h-4 w-full", children: upperTicksElements }),
|
|
2887
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "relative h-4 w-full", children: [
|
|
2888
|
+
elements,
|
|
2889
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2890
|
+
"div",
|
|
2891
|
+
{
|
|
2892
|
+
className: (0, import_class_variance_authority10.cx)(
|
|
2893
|
+
progress === 0 ? "rounded-l-full" : "",
|
|
2894
|
+
`dark:bg-sentio-gray-400 absolute right-0 top-0 h-4 rounded-r-full bg-gray-300`
|
|
2895
|
+
),
|
|
2896
|
+
style: { left: `${progress * 100}%` }
|
|
2897
|
+
}
|
|
2898
|
+
)
|
|
2899
|
+
] }),
|
|
2900
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "relative h-4 w-full", children: lowerTicksElements })
|
|
2901
|
+
] });
|
|
2902
|
+
};
|
|
2903
|
+
|
|
2904
|
+
// src/common/Descriptions.tsx
|
|
2905
|
+
var import_react33 = __toESM(require("react"));
|
|
2906
|
+
var import_lodash6 = require("lodash");
|
|
2907
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2908
|
+
function safeToString(value) {
|
|
2909
|
+
if ((0, import_lodash6.isString)(value) || (0, import_lodash6.isNumber)(value)) {
|
|
2910
|
+
return value;
|
|
2911
|
+
}
|
|
2912
|
+
try {
|
|
2913
|
+
return JSON.stringify(value);
|
|
2914
|
+
} catch {
|
|
2915
|
+
return "";
|
|
2916
|
+
}
|
|
2917
|
+
}
|
|
2918
|
+
var Descriptions = (props) => {
|
|
2919
|
+
const {
|
|
2920
|
+
data,
|
|
2921
|
+
labelStyle,
|
|
2922
|
+
valueStyle,
|
|
2923
|
+
className,
|
|
2924
|
+
labelClassName,
|
|
2925
|
+
valueClassName,
|
|
2926
|
+
trClassName,
|
|
2927
|
+
colon,
|
|
2928
|
+
renderLabel,
|
|
2929
|
+
renderValue
|
|
2930
|
+
} = props;
|
|
2931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("table", { className: (0, import_class_variance_authority10.cx)("w-full border-collapse", className), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("tbody", { children: data.map((item, index) => {
|
|
2932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("tr", { className: trClassName, children: [
|
|
2933
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2934
|
+
"td",
|
|
2935
|
+
{
|
|
2936
|
+
className: (0, import_class_variance_authority10.cx)(
|
|
2937
|
+
"text-gray text-ilabel font-ilabel w-px whitespace-nowrap pr-8 align-text-bottom",
|
|
2938
|
+
labelClassName
|
|
2939
|
+
),
|
|
2940
|
+
style: labelStyle,
|
|
2941
|
+
children: (0, import_lodash6.isFunction)(renderLabel) ? renderLabel?.(item) : item.label
|
|
2942
|
+
}
|
|
2943
|
+
),
|
|
2944
|
+
colon,
|
|
2945
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2946
|
+
"td",
|
|
2947
|
+
{
|
|
2948
|
+
className: (0, import_class_variance_authority10.cx)(
|
|
2949
|
+
"text-ilabel font-ilabel",
|
|
2950
|
+
valueClassName
|
|
2951
|
+
),
|
|
2952
|
+
style: valueStyle,
|
|
2953
|
+
children: import_react33.default.isValidElement(item.value) ? item.value : (0, import_lodash6.isObjectLike)(item.value) ? (0, import_lodash6.isEmpty)(item.value) ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "text-gray-400", children: "{ }" }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-2", children: [
|
|
2954
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "text-gray-400", children: "{" }),
|
|
2955
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2956
|
+
Descriptions,
|
|
2957
|
+
{
|
|
2958
|
+
...props,
|
|
2959
|
+
data: (0, import_lodash6.map)(item.value, (value, label) => ({
|
|
2960
|
+
key: `${item.key}.${label}`,
|
|
2961
|
+
label,
|
|
2962
|
+
value
|
|
2963
|
+
}))
|
|
2964
|
+
}
|
|
2965
|
+
),
|
|
2966
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "text-gray-400", children: "}" })
|
|
2967
|
+
] }) : (0, import_lodash6.isFunction)(renderValue) ? renderValue?.(item) : safeToString(item.value)
|
|
2968
|
+
}
|
|
2969
|
+
)
|
|
2970
|
+
] }, item.key ?? index);
|
|
2971
|
+
}) }) });
|
|
2972
|
+
};
|
|
2973
|
+
|
|
2974
|
+
// src/common/Notification.tsx
|
|
2975
|
+
var import_react34 = require("react");
|
|
2976
|
+
var import_react35 = require("@headlessui/react");
|
|
2977
|
+
var import_solid5 = require("@heroicons/react/20/solid");
|
|
2978
|
+
var import_outline3 = require("@heroicons/react/24/outline");
|
|
2979
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2980
|
+
function Notification({
|
|
2981
|
+
show,
|
|
2982
|
+
setShow,
|
|
2983
|
+
title,
|
|
2984
|
+
message,
|
|
2985
|
+
buttons,
|
|
2986
|
+
type
|
|
2987
|
+
}) {
|
|
2988
|
+
let icon;
|
|
2989
|
+
switch (type) {
|
|
2990
|
+
case "success":
|
|
2991
|
+
icon = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2992
|
+
import_outline3.CheckCircleIcon,
|
|
2993
|
+
{
|
|
2994
|
+
className: "h-6 w-6 text-green-400",
|
|
2995
|
+
"aria-hidden": "true"
|
|
2996
|
+
}
|
|
2997
|
+
);
|
|
2998
|
+
break;
|
|
2999
|
+
case "error":
|
|
3000
|
+
icon = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3001
|
+
import_outline3.ExclamationCircleIcon,
|
|
3002
|
+
{
|
|
3003
|
+
className: "h-6 w-6 text-red-400",
|
|
3004
|
+
"aria-hidden": "true"
|
|
3005
|
+
}
|
|
3006
|
+
);
|
|
3007
|
+
break;
|
|
3008
|
+
case "warning":
|
|
3009
|
+
icon = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3010
|
+
import_outline3.ExclamationCircleIcon,
|
|
3011
|
+
{
|
|
3012
|
+
className: "h-6 w-6 text-yellow-400",
|
|
3013
|
+
"aria-hidden": "true"
|
|
3014
|
+
}
|
|
3015
|
+
);
|
|
3016
|
+
break;
|
|
3017
|
+
case "info":
|
|
3018
|
+
icon = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3019
|
+
import_outline3.InformationCircleIcon,
|
|
3020
|
+
{
|
|
3021
|
+
className: "h-6 w-6 text-blue-400",
|
|
3022
|
+
"aria-hidden": "true"
|
|
3023
|
+
}
|
|
3024
|
+
);
|
|
3025
|
+
break;
|
|
3026
|
+
}
|
|
3027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3028
|
+
"div",
|
|
3029
|
+
{
|
|
3030
|
+
"aria-live": "assertive",
|
|
3031
|
+
className: "pointer-events-none fixed inset-0 z-40 flex items-end px-4 py-6 sm:items-start sm:p-6",
|
|
3032
|
+
onClick: (evt) => {
|
|
3033
|
+
evt.stopPropagation();
|
|
3034
|
+
},
|
|
3035
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex w-full flex-col items-center space-y-4 sm:items-end", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3036
|
+
import_react35.Transition,
|
|
3037
|
+
{
|
|
3038
|
+
show,
|
|
3039
|
+
as: import_react34.Fragment,
|
|
3040
|
+
enter: "transform ease-out duration-300 transition",
|
|
3041
|
+
enterFrom: "translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2",
|
|
3042
|
+
enterTo: "translate-y-0 opacity-100 sm:translate-x-0",
|
|
3043
|
+
leave: "transition ease-in duration-100",
|
|
3044
|
+
leaveFrom: "opacity-100",
|
|
3045
|
+
leaveTo: "opacity-0",
|
|
3046
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("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__ */ (0, import_jsx_runtime26.jsx)("div", { className: "p-4", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-start", children: [
|
|
3047
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex-shrink-0", children: icon }),
|
|
3048
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "ml-3 w-0 flex-1", children: [
|
|
3049
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-text-foreground text-sm font-medium", children: title }),
|
|
3050
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "mt-1 text-sm text-gray-500", children: message }),
|
|
3051
|
+
buttons && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "mt-4 flex", children: buttons() })
|
|
3052
|
+
] }),
|
|
3053
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "ml-4 flex flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
3054
|
+
"button",
|
|
3055
|
+
{
|
|
3056
|
+
type: "button",
|
|
3057
|
+
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",
|
|
3058
|
+
onClick: () => {
|
|
3059
|
+
setShow(false);
|
|
3060
|
+
},
|
|
3061
|
+
children: [
|
|
3062
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "sr-only", children: "Close" }),
|
|
3063
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_solid5.XMarkIcon, { className: "h-5 w-5", "aria-hidden": "true" })
|
|
3064
|
+
]
|
|
3065
|
+
}
|
|
3066
|
+
) })
|
|
3067
|
+
] }) }) })
|
|
3068
|
+
}
|
|
3069
|
+
) })
|
|
3070
|
+
}
|
|
3071
|
+
) });
|
|
3072
|
+
}
|
|
3073
|
+
|
|
3074
|
+
// src/common/table/ResizeTable.tsx
|
|
3075
|
+
var import_react43 = require("react");
|
|
2263
3076
|
var import_react_table = require("@tanstack/react-table");
|
|
2264
3077
|
var import_react_virtual2 = require("@tanstack/react-virtual");
|
|
2265
3078
|
var import_hi2 = require("react-icons/hi");
|
|
2266
|
-
var
|
|
3079
|
+
var import_lodash7 = require("lodash");
|
|
2267
3080
|
|
|
2268
3081
|
// src/common/menu/PopupMenuButton.tsx
|
|
2269
|
-
var
|
|
2270
|
-
var
|
|
2271
|
-
var
|
|
3082
|
+
var import_react40 = require("react");
|
|
3083
|
+
var import_react41 = require("@headlessui/react");
|
|
3084
|
+
var import_react42 = require("@floating-ui/react");
|
|
2272
3085
|
|
|
2273
3086
|
// src/common/menu/SubMenu.tsx
|
|
2274
|
-
var
|
|
2275
|
-
var
|
|
2276
|
-
var
|
|
3087
|
+
var import_react36 = require("react");
|
|
3088
|
+
var import_react37 = require("@floating-ui/react");
|
|
3089
|
+
var import_react38 = require("@headlessui/react");
|
|
2277
3090
|
var import_hi = require("react-icons/hi");
|
|
2278
|
-
var
|
|
2279
|
-
var
|
|
3091
|
+
var import_solid6 = require("@heroicons/react/20/solid");
|
|
3092
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2280
3093
|
var COLOR_MAP = {
|
|
2281
3094
|
default: {
|
|
2282
3095
|
active: "bg-gray-100 text-text-foreground dark:bg-primary-600 dark:text-white",
|
|
@@ -2289,12 +3102,12 @@ var COLOR_MAP = {
|
|
|
2289
3102
|
disabled: "text-red-200 dark:text-red-600/40 cursor-not-allowed"
|
|
2290
3103
|
}
|
|
2291
3104
|
};
|
|
2292
|
-
var MenuContext = (0,
|
|
3105
|
+
var MenuContext = (0, import_react36.createContext)({});
|
|
2293
3106
|
var MenuItem = ({ item, onSelect, labelClassName }) => {
|
|
2294
|
-
const { selectedKey } = (0,
|
|
2295
|
-
return /* @__PURE__ */ (0,
|
|
3107
|
+
const { selectedKey } = (0, import_react36.useContext)(MenuContext);
|
|
3108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react38.Menu.Item, { disabled: item.disabled, children: ({ active }) => {
|
|
2296
3109
|
if (item.items) {
|
|
2297
|
-
return /* @__PURE__ */ (0,
|
|
3110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2298
3111
|
SubMenuButton,
|
|
2299
3112
|
{
|
|
2300
3113
|
items: item.items,
|
|
@@ -2307,7 +3120,7 @@ var MenuItem = ({ item, onSelect, labelClassName }) => {
|
|
|
2307
3120
|
item.key
|
|
2308
3121
|
);
|
|
2309
3122
|
}
|
|
2310
|
-
const buttonNode = /* @__PURE__ */ (0,
|
|
3123
|
+
const buttonNode = /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2311
3124
|
"button",
|
|
2312
3125
|
{
|
|
2313
3126
|
onClick: (e) => onSelect?.(item.key, e, item),
|
|
@@ -2318,7 +3131,7 @@ var MenuItem = ({ item, onSelect, labelClassName }) => {
|
|
|
2318
3131
|
disabled: item.disabled,
|
|
2319
3132
|
children: [
|
|
2320
3133
|
item.icon,
|
|
2321
|
-
/* @__PURE__ */ (0,
|
|
3134
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2322
3135
|
"span",
|
|
2323
3136
|
{
|
|
2324
3137
|
className: (0, import_class_variance_authority10.cx)(
|
|
@@ -2328,15 +3141,15 @@ var MenuItem = ({ item, onSelect, labelClassName }) => {
|
|
|
2328
3141
|
children: item.label
|
|
2329
3142
|
}
|
|
2330
3143
|
),
|
|
2331
|
-
item.key === selectedKey ? /* @__PURE__ */ (0,
|
|
3144
|
+
item.key === selectedKey ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_hi.HiCheck, { className: "icon-lg ml-2" }) : null
|
|
2332
3145
|
]
|
|
2333
3146
|
}
|
|
2334
3147
|
);
|
|
2335
3148
|
if (item.disabled && item.disabledHint) {
|
|
2336
|
-
return /* @__PURE__ */ (0,
|
|
3149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2337
3150
|
PopoverTooltip,
|
|
2338
3151
|
{
|
|
2339
|
-
text: /* @__PURE__ */ (0,
|
|
3152
|
+
text: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-icontent font-icontent text-gray cursor-auto", children: item.disabledHint }),
|
|
2340
3153
|
strategy: "fixed",
|
|
2341
3154
|
children: buttonNode
|
|
2342
3155
|
}
|
|
@@ -2356,21 +3169,21 @@ var SubMenuButton = (props) => {
|
|
|
2356
3169
|
placement = "right-start",
|
|
2357
3170
|
buttonClass: buttonClass3
|
|
2358
3171
|
} = props;
|
|
2359
|
-
const [open, setOpen] = (0,
|
|
2360
|
-
const { refs, floatingStyles, context } = (0,
|
|
3172
|
+
const [open, setOpen] = (0, import_react36.useState)(false);
|
|
3173
|
+
const { refs, floatingStyles, context } = (0, import_react37.useFloating)({
|
|
2361
3174
|
open,
|
|
2362
3175
|
onOpenChange: setOpen,
|
|
2363
3176
|
placement,
|
|
2364
|
-
whileElementsMounted:
|
|
2365
|
-
middleware: [(0,
|
|
3177
|
+
whileElementsMounted: import_react37.autoUpdate,
|
|
3178
|
+
middleware: [(0, import_react37.flip)(), (0, import_react37.shift)()]
|
|
2366
3179
|
});
|
|
2367
|
-
const { getReferenceProps, getFloatingProps } = (0,
|
|
2368
|
-
(0,
|
|
2369
|
-
handleClose: (0,
|
|
3180
|
+
const { getReferenceProps, getFloatingProps } = (0, import_react37.useInteractions)([
|
|
3181
|
+
(0, import_react37.useHover)(context, {
|
|
3182
|
+
handleClose: (0, import_react37.safePolygon)()
|
|
2370
3183
|
})
|
|
2371
3184
|
]);
|
|
2372
|
-
return /* @__PURE__ */ (0,
|
|
2373
|
-
|
|
3185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
3186
|
+
import_react38.Menu,
|
|
2374
3187
|
{
|
|
2375
3188
|
as: "div",
|
|
2376
3189
|
className: (0, import_class_variance_authority10.cx)(
|
|
@@ -2379,8 +3192,8 @@ var SubMenuButton = (props) => {
|
|
|
2379
3192
|
disabled ? "pointer-events-none cursor-not-allowed text-gray-400" : "cursor-pointer"
|
|
2380
3193
|
),
|
|
2381
3194
|
children: [
|
|
2382
|
-
/* @__PURE__ */ (0,
|
|
2383
|
-
|
|
3195
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
3196
|
+
import_react38.Menu.Button,
|
|
2384
3197
|
{
|
|
2385
3198
|
className: (0, import_class_variance_authority10.cx)(
|
|
2386
3199
|
active || open ? COLOR_MAP[status || "default"].active : COLOR_MAP[status || "default"].default,
|
|
@@ -2395,9 +3208,9 @@ var SubMenuButton = (props) => {
|
|
|
2395
3208
|
...getReferenceProps,
|
|
2396
3209
|
children: [
|
|
2397
3210
|
props.icon,
|
|
2398
|
-
/* @__PURE__ */ (0,
|
|
2399
|
-
/* @__PURE__ */ (0,
|
|
2400
|
-
|
|
3211
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "flex-shrink flex-grow text-left", children: label }),
|
|
3212
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3213
|
+
import_solid6.ChevronRightIcon,
|
|
2401
3214
|
{
|
|
2402
3215
|
className: (0, import_class_variance_authority10.cx)(
|
|
2403
3216
|
open ? "text-gray-500" : "text-gray-400",
|
|
@@ -2410,8 +3223,8 @@ var SubMenuButton = (props) => {
|
|
|
2410
3223
|
]
|
|
2411
3224
|
}
|
|
2412
3225
|
),
|
|
2413
|
-
open && /* @__PURE__ */ (0,
|
|
2414
|
-
|
|
3226
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3227
|
+
import_react38.Menu.Items,
|
|
2415
3228
|
{
|
|
2416
3229
|
static: true,
|
|
2417
3230
|
ref: refs.setFloating,
|
|
@@ -2419,12 +3232,12 @@ var SubMenuButton = (props) => {
|
|
|
2419
3232
|
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",
|
|
2420
3233
|
...getFloatingProps,
|
|
2421
3234
|
children: items.map(
|
|
2422
|
-
(items2, i) => items2 && items2.length > 0 ? /* @__PURE__ */ (0,
|
|
3235
|
+
(items2, i) => items2 && items2.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2423
3236
|
"div",
|
|
2424
3237
|
{
|
|
2425
3238
|
className: "overflow-auto py-1",
|
|
2426
3239
|
style: { maxHeight: "60vh" },
|
|
2427
|
-
children: items2.map((item) => /* @__PURE__ */ (0,
|
|
3240
|
+
children: items2.map((item) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MenuItem, { item, onSelect }, item.key))
|
|
2428
3241
|
},
|
|
2429
3242
|
i
|
|
2430
3243
|
) : null
|
|
@@ -2437,8 +3250,8 @@ var SubMenuButton = (props) => {
|
|
|
2437
3250
|
};
|
|
2438
3251
|
|
|
2439
3252
|
// src/utils/nav-size-context.ts
|
|
2440
|
-
var
|
|
2441
|
-
var NavSizeContext = (0,
|
|
3253
|
+
var import_react39 = require("react");
|
|
3254
|
+
var NavSizeContext = (0, import_react39.createContext)({
|
|
2442
3255
|
small: true,
|
|
2443
3256
|
showLabel: true,
|
|
2444
3257
|
setSmall: (small) => {
|
|
@@ -2448,7 +3261,7 @@ var NavSizeContext = (0, import_react27.createContext)({
|
|
|
2448
3261
|
});
|
|
2449
3262
|
|
|
2450
3263
|
// src/common/menu/PopupMenuButton.tsx
|
|
2451
|
-
var
|
|
3264
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2452
3265
|
function PopupMenuButton({
|
|
2453
3266
|
buttonIcon,
|
|
2454
3267
|
items,
|
|
@@ -2468,74 +3281,82 @@ function PopupMenuButton({
|
|
|
2468
3281
|
selectedKey,
|
|
2469
3282
|
onOpenCallback
|
|
2470
3283
|
}) {
|
|
2471
|
-
const [menuOpen, setMenuOpen] = (0,
|
|
2472
|
-
const { small } = (0,
|
|
2473
|
-
const { refs, floatingStyles, context } = (0,
|
|
3284
|
+
const [menuOpen, setMenuOpen] = (0, import_react40.useState)(false);
|
|
3285
|
+
const { small } = (0, import_react40.useContext)(NavSizeContext);
|
|
3286
|
+
const { refs, floatingStyles, context } = (0, import_react42.useFloating)({
|
|
2474
3287
|
open: menuOpen,
|
|
2475
3288
|
onOpenChange: setMenuOpen,
|
|
2476
|
-
middleware: [(0,
|
|
3289
|
+
middleware: [(0, import_react42.offset)(offset2), (0, import_react42.flip)(), (0, import_react42.shift)()],
|
|
2477
3290
|
placement,
|
|
2478
|
-
whileElementsMounted:
|
|
3291
|
+
whileElementsMounted: import_react42.autoUpdate
|
|
2479
3292
|
});
|
|
2480
|
-
const itemStyle = (0,
|
|
3293
|
+
const itemStyle = (0, import_react40.useMemo)(() => {
|
|
2481
3294
|
return {
|
|
2482
3295
|
width
|
|
2483
3296
|
};
|
|
2484
3297
|
}, [width]);
|
|
2485
|
-
const onOpenCallbackRef = (0,
|
|
3298
|
+
const onOpenCallbackRef = (0, import_react40.useRef)(onOpenCallback);
|
|
2486
3299
|
onOpenCallbackRef.current = onOpenCallback;
|
|
2487
|
-
(0,
|
|
3300
|
+
(0, import_react40.useEffect)(() => {
|
|
2488
3301
|
if (menuOpen) {
|
|
2489
3302
|
onOpenCallbackRef.current?.();
|
|
2490
3303
|
}
|
|
2491
3304
|
}, [menuOpen]);
|
|
2492
3305
|
let menuItems = null;
|
|
2493
3306
|
if (menuOpen && items.length > 0) {
|
|
2494
|
-
menuItems = /* @__PURE__ */ (0,
|
|
2495
|
-
|
|
3307
|
+
menuItems = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(MenuContext.Provider, { value: { selectedKey }, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3308
|
+
"div",
|
|
2496
3309
|
{
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
leaveFrom: "transform opacity-100 scale-100",
|
|
2503
|
-
leaveTo: "transform opacity-0 scale-95",
|
|
2504
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2505
|
-
import_react29.Menu.Items,
|
|
3310
|
+
ref: refs.setFloating,
|
|
3311
|
+
style: floatingStyles,
|
|
3312
|
+
className: small ? "z-10" : "z-[100]",
|
|
3313
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3314
|
+
import_react41.Transition,
|
|
2506
3315
|
{
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
3316
|
+
as: import_react40.Fragment,
|
|
3317
|
+
enter: "transition ease-out duration-100",
|
|
3318
|
+
enterFrom: "transform opacity-0 scale-95",
|
|
3319
|
+
enterTo: "transform opacity-100 scale-100",
|
|
3320
|
+
leave: "transition ease-in duration-75",
|
|
3321
|
+
leaveFrom: "transform opacity-100 scale-100",
|
|
3322
|
+
leaveTo: "transform opacity-0 scale-95",
|
|
3323
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
3324
|
+
import_react41.Menu.Items,
|
|
3325
|
+
{
|
|
3326
|
+
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",
|
|
3327
|
+
style: itemStyle,
|
|
3328
|
+
children: [
|
|
3329
|
+
header,
|
|
3330
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: `${itemsClassName} divide-y`, children: items.map((items2, i) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "py-1", children: [
|
|
3331
|
+
groupLabels?.[i] ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "px-4 py-0.5 text-[10px] font-medium leading-[12px] text-gray-500", children: groupLabels[i] }) : null,
|
|
3332
|
+
items2.map(
|
|
3333
|
+
(item) => renderItem ? renderItem(item) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3334
|
+
MenuItem,
|
|
3335
|
+
{
|
|
3336
|
+
item,
|
|
3337
|
+
onSelect,
|
|
3338
|
+
labelClassName: itemLabelClassName
|
|
3339
|
+
},
|
|
3340
|
+
item.key
|
|
3341
|
+
)
|
|
3342
|
+
)
|
|
3343
|
+
] }, i)) }),
|
|
3344
|
+
footer
|
|
3345
|
+
]
|
|
3346
|
+
}
|
|
3347
|
+
)
|
|
2527
3348
|
}
|
|
2528
3349
|
)
|
|
2529
3350
|
}
|
|
2530
|
-
) })
|
|
3351
|
+
) });
|
|
2531
3352
|
}
|
|
2532
|
-
return /* @__PURE__ */ (0,
|
|
3353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react41.Menu, { children: ({ open }) => {
|
|
2533
3354
|
setTimeout(() => {
|
|
2534
3355
|
setMenuOpen(open);
|
|
2535
3356
|
}, 0);
|
|
2536
|
-
return /* @__PURE__ */ (0,
|
|
2537
|
-
/* @__PURE__ */ (0,
|
|
2538
|
-
|
|
3357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
3358
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3359
|
+
import_react41.Menu.Button,
|
|
2539
3360
|
{
|
|
2540
3361
|
className: (0, import_class_variance_authority10.cx)(
|
|
2541
3362
|
"text-gray w-fit px-1 hover:text-gray-500 active:text-gray-700",
|
|
@@ -2547,14 +3368,14 @@ function PopupMenuButton({
|
|
|
2547
3368
|
children: typeof buttonIcon === "function" ? buttonIcon(menuOpen) : buttonIcon
|
|
2548
3369
|
}
|
|
2549
3370
|
),
|
|
2550
|
-
portal ? /* @__PURE__ */ (0,
|
|
3371
|
+
portal ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react42.FloatingPortal, { children: menuItems }) : menuItems
|
|
2551
3372
|
] });
|
|
2552
3373
|
} });
|
|
2553
3374
|
}
|
|
2554
3375
|
|
|
2555
3376
|
// src/common/table/Icons.tsx
|
|
2556
|
-
var
|
|
2557
|
-
var MoveLeftIcon = (props) => /* @__PURE__ */ (0,
|
|
3377
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3378
|
+
var MoveLeftIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2558
3379
|
"svg",
|
|
2559
3380
|
{
|
|
2560
3381
|
width: "16",
|
|
@@ -2564,8 +3385,8 @@ var MoveLeftIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2564
3385
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2565
3386
|
...props,
|
|
2566
3387
|
children: [
|
|
2567
|
-
/* @__PURE__ */ (0,
|
|
2568
|
-
/* @__PURE__ */ (0,
|
|
3388
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("g", { clipPath: "url(#clip0_6869_7300)", children: [
|
|
3389
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2569
3390
|
"path",
|
|
2570
3391
|
{
|
|
2571
3392
|
d: "M2.66666 8H9.33332",
|
|
@@ -2575,7 +3396,7 @@ var MoveLeftIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2575
3396
|
strokeLinejoin: "round"
|
|
2576
3397
|
}
|
|
2577
3398
|
),
|
|
2578
|
-
/* @__PURE__ */ (0,
|
|
3399
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2579
3400
|
"path",
|
|
2580
3401
|
{
|
|
2581
3402
|
d: "M2.66666 8L5.33332 10.6667",
|
|
@@ -2585,7 +3406,7 @@ var MoveLeftIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2585
3406
|
strokeLinejoin: "round"
|
|
2586
3407
|
}
|
|
2587
3408
|
),
|
|
2588
|
-
/* @__PURE__ */ (0,
|
|
3409
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2589
3410
|
"path",
|
|
2590
3411
|
{
|
|
2591
3412
|
d: "M2.66669 7.9987L5.33335 5.33203",
|
|
@@ -2595,7 +3416,7 @@ var MoveLeftIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2595
3416
|
strokeLinejoin: "round"
|
|
2596
3417
|
}
|
|
2597
3418
|
),
|
|
2598
|
-
/* @__PURE__ */ (0,
|
|
3419
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2599
3420
|
"path",
|
|
2600
3421
|
{
|
|
2601
3422
|
d: "M13.3333 2.66797V13.3346",
|
|
@@ -2606,11 +3427,11 @@ var MoveLeftIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2606
3427
|
}
|
|
2607
3428
|
)
|
|
2608
3429
|
] }),
|
|
2609
|
-
/* @__PURE__ */ (0,
|
|
3430
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("clipPath", { id: "clip0_6869_7300", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
2610
3431
|
]
|
|
2611
3432
|
}
|
|
2612
3433
|
);
|
|
2613
|
-
var MoveRightIcon = (props) => /* @__PURE__ */ (0,
|
|
3434
|
+
var MoveRightIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2614
3435
|
"svg",
|
|
2615
3436
|
{
|
|
2616
3437
|
width: "16",
|
|
@@ -2620,8 +3441,8 @@ var MoveRightIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2620
3441
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2621
3442
|
...props,
|
|
2622
3443
|
children: [
|
|
2623
|
-
/* @__PURE__ */ (0,
|
|
2624
|
-
/* @__PURE__ */ (0,
|
|
3444
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("g", { clipPath: "url(#clip0_6869_7309)", children: [
|
|
3445
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2625
3446
|
"path",
|
|
2626
3447
|
{
|
|
2627
3448
|
d: "M13.3333 8H6.66666",
|
|
@@ -2631,7 +3452,7 @@ var MoveRightIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2631
3452
|
strokeLinejoin: "round"
|
|
2632
3453
|
}
|
|
2633
3454
|
),
|
|
2634
|
-
/* @__PURE__ */ (0,
|
|
3455
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2635
3456
|
"path",
|
|
2636
3457
|
{
|
|
2637
3458
|
d: "M13.3333 8L10.6667 10.6667",
|
|
@@ -2641,7 +3462,7 @@ var MoveRightIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2641
3462
|
strokeLinejoin: "round"
|
|
2642
3463
|
}
|
|
2643
3464
|
),
|
|
2644
|
-
/* @__PURE__ */ (0,
|
|
3465
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2645
3466
|
"path",
|
|
2646
3467
|
{
|
|
2647
3468
|
d: "M13.3334 7.9987L10.6667 5.33203",
|
|
@@ -2651,7 +3472,7 @@ var MoveRightIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2651
3472
|
strokeLinejoin: "round"
|
|
2652
3473
|
}
|
|
2653
3474
|
),
|
|
2654
|
-
/* @__PURE__ */ (0,
|
|
3475
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2655
3476
|
"path",
|
|
2656
3477
|
{
|
|
2657
3478
|
d: "M2.66669 2.66797V13.3346",
|
|
@@ -2662,11 +3483,11 @@ var MoveRightIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2662
3483
|
}
|
|
2663
3484
|
)
|
|
2664
3485
|
] }),
|
|
2665
|
-
/* @__PURE__ */ (0,
|
|
3486
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("clipPath", { id: "clip0_6869_7309", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
2666
3487
|
]
|
|
2667
3488
|
}
|
|
2668
3489
|
);
|
|
2669
|
-
var RenameIcon = (props) => /* @__PURE__ */ (0,
|
|
3490
|
+
var RenameIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2670
3491
|
"svg",
|
|
2671
3492
|
{
|
|
2672
3493
|
width: "16",
|
|
@@ -2676,7 +3497,7 @@ var RenameIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2676
3497
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2677
3498
|
...props,
|
|
2678
3499
|
children: [
|
|
2679
|
-
/* @__PURE__ */ (0,
|
|
3500
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2680
3501
|
"path",
|
|
2681
3502
|
{
|
|
2682
3503
|
d: "M8 13.3281H14",
|
|
@@ -2686,7 +3507,7 @@ var RenameIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2686
3507
|
strokeLinejoin: "round"
|
|
2687
3508
|
}
|
|
2688
3509
|
),
|
|
2689
|
-
/* @__PURE__ */ (0,
|
|
3510
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2690
3511
|
"path",
|
|
2691
3512
|
{
|
|
2692
3513
|
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",
|
|
@@ -2699,7 +3520,7 @@ var RenameIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2699
3520
|
]
|
|
2700
3521
|
}
|
|
2701
3522
|
);
|
|
2702
|
-
var DeleteIcon = (props) => /* @__PURE__ */ (0,
|
|
3523
|
+
var DeleteIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2703
3524
|
"svg",
|
|
2704
3525
|
{
|
|
2705
3526
|
width: "16",
|
|
@@ -2709,8 +3530,8 @@ var DeleteIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2709
3530
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2710
3531
|
...props,
|
|
2711
3532
|
children: [
|
|
2712
|
-
/* @__PURE__ */ (0,
|
|
2713
|
-
/* @__PURE__ */ (0,
|
|
3533
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("g", { clipPath: "url(#clip0_6869_7344)", children: [
|
|
3534
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2714
3535
|
"path",
|
|
2715
3536
|
{
|
|
2716
3537
|
d: "M2.66669 4.66797H13.3334",
|
|
@@ -2720,7 +3541,7 @@ var DeleteIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2720
3541
|
strokeLinejoin: "round"
|
|
2721
3542
|
}
|
|
2722
3543
|
),
|
|
2723
|
-
/* @__PURE__ */ (0,
|
|
3544
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2724
3545
|
"path",
|
|
2725
3546
|
{
|
|
2726
3547
|
d: "M6.66669 7.33203V11.332",
|
|
@@ -2730,7 +3551,7 @@ var DeleteIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2730
3551
|
strokeLinejoin: "round"
|
|
2731
3552
|
}
|
|
2732
3553
|
),
|
|
2733
|
-
/* @__PURE__ */ (0,
|
|
3554
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2734
3555
|
"path",
|
|
2735
3556
|
{
|
|
2736
3557
|
d: "M9.33331 7.33203V11.332",
|
|
@@ -2740,7 +3561,7 @@ var DeleteIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2740
3561
|
strokeLinejoin: "round"
|
|
2741
3562
|
}
|
|
2742
3563
|
),
|
|
2743
|
-
/* @__PURE__ */ (0,
|
|
3564
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2744
3565
|
"path",
|
|
2745
3566
|
{
|
|
2746
3567
|
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",
|
|
@@ -2750,7 +3571,7 @@ var DeleteIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2750
3571
|
strokeLinejoin: "round"
|
|
2751
3572
|
}
|
|
2752
3573
|
),
|
|
2753
|
-
/* @__PURE__ */ (0,
|
|
3574
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2754
3575
|
"path",
|
|
2755
3576
|
{
|
|
2756
3577
|
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",
|
|
@@ -2761,14 +3582,14 @@ var DeleteIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
2761
3582
|
}
|
|
2762
3583
|
)
|
|
2763
3584
|
] }),
|
|
2764
|
-
/* @__PURE__ */ (0,
|
|
3585
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("clipPath", { id: "clip0_6869_7344", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
2765
3586
|
]
|
|
2766
3587
|
}
|
|
2767
3588
|
);
|
|
2768
3589
|
|
|
2769
3590
|
// src/common/table/ResizeTable.tsx
|
|
2770
3591
|
var import_io5 = require("react-icons/io5");
|
|
2771
|
-
var
|
|
3592
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2772
3593
|
var reorder = (list, startIndex, endIndex) => {
|
|
2773
3594
|
const result = Array.from(list);
|
|
2774
3595
|
const [removed] = result.splice(startIndex, 1);
|
|
@@ -2778,7 +3599,7 @@ var reorder = (list, startIndex, endIndex) => {
|
|
|
2778
3599
|
function onPreventClick(e) {
|
|
2779
3600
|
e.stopPropagation();
|
|
2780
3601
|
}
|
|
2781
|
-
var _ResizeTable = (0,
|
|
3602
|
+
var _ResizeTable = (0, import_react43.forwardRef)(function _ResizeTable2({
|
|
2782
3603
|
data,
|
|
2783
3604
|
columns,
|
|
2784
3605
|
columnResizeMode,
|
|
@@ -2802,7 +3623,7 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
2802
3623
|
estimatedRowHeight = 35,
|
|
2803
3624
|
overscan = 5
|
|
2804
3625
|
}, tableContainerRef) {
|
|
2805
|
-
const adjustedColumns = (0,
|
|
3626
|
+
const adjustedColumns = (0, import_react43.useMemo)(() => {
|
|
2806
3627
|
let totalWidth = 0;
|
|
2807
3628
|
const newColumns = columns.map((c) => {
|
|
2808
3629
|
const item = Object.assign({ minSize }, c);
|
|
@@ -2821,7 +3642,7 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
2821
3642
|
}
|
|
2822
3643
|
return newColumns;
|
|
2823
3644
|
}, [columns, minSize, minWidth]);
|
|
2824
|
-
const [tableState, setTableState] = (0,
|
|
3645
|
+
const [tableState, setTableState] = (0, import_react43.useState)(() => {
|
|
2825
3646
|
const initialState = {
|
|
2826
3647
|
pagination: {
|
|
2827
3648
|
pageIndex: 0,
|
|
@@ -2841,7 +3662,7 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
2841
3662
|
onStateChange: setTableState,
|
|
2842
3663
|
manualSorting
|
|
2843
3664
|
});
|
|
2844
|
-
(0,
|
|
3665
|
+
(0, import_react43.useEffect)(() => {
|
|
2845
3666
|
if (state && Object.keys(state).length > 0) {
|
|
2846
3667
|
setTableState((prev) => {
|
|
2847
3668
|
const newState = {
|
|
@@ -2849,19 +3670,19 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
2849
3670
|
...state,
|
|
2850
3671
|
pagination: prev.pagination || state.pagination || { pageIndex: 0, pageSize: 10 }
|
|
2851
3672
|
};
|
|
2852
|
-
return (0,
|
|
3673
|
+
return (0, import_lodash7.isEqual)(prev, newState) ? prev : newState;
|
|
2853
3674
|
});
|
|
2854
3675
|
}
|
|
2855
3676
|
}, [state]);
|
|
2856
|
-
const debounceStateChange = (0,
|
|
3677
|
+
const debounceStateChange = (0, import_react43.useMemo)(() => {
|
|
2857
3678
|
if (!onStateChange) return void 0;
|
|
2858
|
-
return (0,
|
|
3679
|
+
return (0, import_lodash7.debounce)(onStateChange, 500, {});
|
|
2859
3680
|
}, [onStateChange]);
|
|
2860
|
-
(0,
|
|
3681
|
+
(0, import_react43.useEffect)(() => {
|
|
2861
3682
|
debounceStateChange?.(tableState);
|
|
2862
3683
|
}, [debounceStateChange, tableState]);
|
|
2863
|
-
const fetchMoreOnBottomReached = (0,
|
|
2864
|
-
return (0,
|
|
3684
|
+
const fetchMoreOnBottomReached = (0, import_react43.useMemo)(() => {
|
|
3685
|
+
return (0, import_lodash7.debounce)((containerRefElement) => {
|
|
2865
3686
|
if (containerRefElement) {
|
|
2866
3687
|
const { scrollHeight, scrollTop, clientHeight } = containerRefElement;
|
|
2867
3688
|
if (scrollHeight - scrollTop - clientHeight < 300 && !isFetching && hasMore) {
|
|
@@ -2870,8 +3691,8 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
2870
3691
|
}
|
|
2871
3692
|
}, 500);
|
|
2872
3693
|
}, [onFetchMore, isFetching, hasMore]);
|
|
2873
|
-
const tableContainerElementRef = (0,
|
|
2874
|
-
(0,
|
|
3694
|
+
const tableContainerElementRef = (0, import_react43.useRef)(null);
|
|
3695
|
+
(0, import_react43.useEffect)(() => {
|
|
2875
3696
|
if (tableContainerRef) {
|
|
2876
3697
|
if (typeof tableContainerRef === "function") {
|
|
2877
3698
|
tableContainerRef(tableContainerElementRef.current);
|
|
@@ -2883,21 +3704,21 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
2883
3704
|
const rowVirtualizer = (0, import_react_virtual2.useVirtualizer)({
|
|
2884
3705
|
count: enableVirtualization ? table.getRowModel().rows.length : 0,
|
|
2885
3706
|
getScrollElement: () => tableContainerElementRef.current,
|
|
2886
|
-
estimateSize: (0,
|
|
3707
|
+
estimateSize: (0, import_react43.useCallback)(() => estimatedRowHeight, [estimatedRowHeight]),
|
|
2887
3708
|
overscan,
|
|
2888
3709
|
enabled: enableVirtualization
|
|
2889
3710
|
});
|
|
2890
3711
|
const virtualRows = enableVirtualization ? rowVirtualizer.getVirtualItems() : [];
|
|
2891
3712
|
const paddingTop = enableVirtualization && virtualRows.length > 0 ? virtualRows[0].start : 0;
|
|
2892
3713
|
const paddingBottom = enableVirtualization && virtualRows.length > 0 ? rowVirtualizer.getTotalSize() - (virtualRows[virtualRows.length - 1].start + virtualRows[virtualRows.length - 1].size) : 0;
|
|
2893
|
-
return /* @__PURE__ */ (0,
|
|
3714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2894
3715
|
"div",
|
|
2895
3716
|
{
|
|
2896
3717
|
className: "overflow-auto",
|
|
2897
3718
|
style: height ? { height } : void 0,
|
|
2898
3719
|
ref: tableContainerElementRef,
|
|
2899
3720
|
onScroll: (e) => fetchMoreOnBottomReached(e.target),
|
|
2900
|
-
children: /* @__PURE__ */ (0,
|
|
3721
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
2901
3722
|
"table",
|
|
2902
3723
|
{
|
|
2903
3724
|
className: "w-fit",
|
|
@@ -2907,11 +3728,11 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
2907
3728
|
}
|
|
2908
3729
|
},
|
|
2909
3730
|
children: [
|
|
2910
|
-
/* @__PURE__ */ (0,
|
|
3731
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("thead", { className: "dark:bg-sentio-gray-100 sticky top-0 z-[1] bg-white", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2911
3732
|
"tr",
|
|
2912
3733
|
{
|
|
2913
3734
|
className: "relative flex w-fit cursor-pointer items-center border-b",
|
|
2914
|
-
children: headerGroup.headers.map((header, i) => /* @__PURE__ */ (0,
|
|
3735
|
+
children: headerGroup.headers.map((header, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
2915
3736
|
"th",
|
|
2916
3737
|
{
|
|
2917
3738
|
colSpan: header.colSpan,
|
|
@@ -2921,12 +3742,12 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
2921
3742
|
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",
|
|
2922
3743
|
onClick: header.column.getToggleSortingHandler(),
|
|
2923
3744
|
children: [
|
|
2924
|
-
/* @__PURE__ */ (0,
|
|
2925
|
-
/* @__PURE__ */ (0,
|
|
3745
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "flex w-full flex-1 overflow-hidden", children: [
|
|
3746
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "flex-1 truncate", children: header.isPlaceholder ? null : (0, import_react_table.flexRender)(
|
|
2926
3747
|
header.column.columnDef.header,
|
|
2927
3748
|
header.getContext()
|
|
2928
3749
|
) }),
|
|
2929
|
-
header.column.getCanSort() && allowSort ? /* @__PURE__ */ (0,
|
|
3750
|
+
header.column.getCanSort() && allowSort ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2930
3751
|
"span",
|
|
2931
3752
|
{
|
|
2932
3753
|
className: (0, import_class_variance_authority10.cx)(
|
|
@@ -2935,16 +3756,16 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
2935
3756
|
"inline-block cursor-pointer",
|
|
2936
3757
|
"shrink-0"
|
|
2937
3758
|
),
|
|
2938
|
-
children: header.column.getIsSorted() ? header.column.getIsSorted() == "desc" ? /* @__PURE__ */ (0,
|
|
3759
|
+
children: header.column.getIsSorted() ? header.column.getIsSorted() == "desc" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_hi2.HiOutlineSortDescending, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_hi2.HiOutlineSortAscending, { className: "h-4 w-4" }) : ""
|
|
2939
3760
|
}
|
|
2940
3761
|
) : null
|
|
2941
3762
|
] }),
|
|
2942
|
-
allowEditColumn !== false && /* @__PURE__ */ (0,
|
|
3763
|
+
allowEditColumn !== false && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2943
3764
|
"span",
|
|
2944
3765
|
{
|
|
2945
3766
|
className: "invisible inline-block group-hover/th:visible",
|
|
2946
3767
|
onClick: onPreventClick,
|
|
2947
|
-
children: /* @__PURE__ */ (0,
|
|
3768
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2948
3769
|
PopupMenuButton,
|
|
2949
3770
|
{
|
|
2950
3771
|
buttonClassName: "align-text-bottom",
|
|
@@ -2970,19 +3791,19 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
2970
3791
|
console.log(commandKey, "is not applied");
|
|
2971
3792
|
}
|
|
2972
3793
|
},
|
|
2973
|
-
buttonIcon: /* @__PURE__ */ (0,
|
|
3794
|
+
buttonIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_hi2.HiChevronDown, { className: "icon mr-2" }),
|
|
2974
3795
|
items: [
|
|
2975
3796
|
[
|
|
2976
3797
|
{
|
|
2977
3798
|
key: "reorder.left",
|
|
2978
3799
|
label: "Move column left",
|
|
2979
|
-
icon: /* @__PURE__ */ (0,
|
|
3800
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(MoveLeftIcon, { className: "mr-2" }),
|
|
2980
3801
|
disabled: i === 0
|
|
2981
3802
|
},
|
|
2982
3803
|
{
|
|
2983
3804
|
key: "reorder.right",
|
|
2984
3805
|
label: "Move column right",
|
|
2985
|
-
icon: /* @__PURE__ */ (0,
|
|
3806
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(MoveRightIcon, { className: "mr-2" }),
|
|
2986
3807
|
disabled: i === headerGroup.headers.length - 1
|
|
2987
3808
|
}
|
|
2988
3809
|
],
|
|
@@ -2991,7 +3812,7 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
2991
3812
|
{
|
|
2992
3813
|
key: "rename",
|
|
2993
3814
|
label: "Rename column",
|
|
2994
|
-
icon: /* @__PURE__ */ (0,
|
|
3815
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(RenameIcon, { className: "mr-2" })
|
|
2995
3816
|
}
|
|
2996
3817
|
]
|
|
2997
3818
|
] : [],
|
|
@@ -3000,7 +3821,7 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
3000
3821
|
{
|
|
3001
3822
|
key: "delete",
|
|
3002
3823
|
label: "Remove column",
|
|
3003
|
-
icon: /* @__PURE__ */ (0,
|
|
3824
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DeleteIcon, { className: "mr-2" }),
|
|
3004
3825
|
status: "danger"
|
|
3005
3826
|
}
|
|
3006
3827
|
]
|
|
@@ -3010,7 +3831,7 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
3010
3831
|
)
|
|
3011
3832
|
}
|
|
3012
3833
|
),
|
|
3013
|
-
header.column.getCanResize() ? /* @__PURE__ */ (0,
|
|
3834
|
+
header.column.getCanResize() ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3014
3835
|
"div",
|
|
3015
3836
|
{
|
|
3016
3837
|
onMouseDown: header.getResizeHandler(),
|
|
@@ -3033,11 +3854,11 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
3033
3854
|
},
|
|
3034
3855
|
headerGroup.id
|
|
3035
3856
|
)) }),
|
|
3036
|
-
/* @__PURE__ */ (0,
|
|
3037
|
-
enableVirtualization && paddingTop > 0 && /* @__PURE__ */ (0,
|
|
3857
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("tbody", { children: [
|
|
3858
|
+
enableVirtualization && paddingTop > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("td", { style: { height: `${paddingTop}px` } }) }),
|
|
3038
3859
|
enableVirtualization ? virtualRows.map((virtualRow) => {
|
|
3039
3860
|
const row = table.getRowModel().rows[virtualRow.index];
|
|
3040
|
-
return /* @__PURE__ */ (0,
|
|
3861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3041
3862
|
"tr",
|
|
3042
3863
|
{
|
|
3043
3864
|
"data-index": virtualRow.index,
|
|
@@ -3046,7 +3867,7 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
3046
3867
|
onClick ? "cursor-pointer" : "",
|
|
3047
3868
|
rowClassNameFn ? rowClassNameFn(row) : ""
|
|
3048
3869
|
),
|
|
3049
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0,
|
|
3870
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3050
3871
|
"td",
|
|
3051
3872
|
{
|
|
3052
3873
|
...{
|
|
@@ -3066,7 +3887,7 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
3066
3887
|
},
|
|
3067
3888
|
row.id
|
|
3068
3889
|
);
|
|
3069
|
-
}) : table.getRowModel().rows.map((row) => /* @__PURE__ */ (0,
|
|
3890
|
+
}) : table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3070
3891
|
"tr",
|
|
3071
3892
|
{
|
|
3072
3893
|
className: (0, import_class_variance_authority10.cx)(
|
|
@@ -3074,7 +3895,7 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
3074
3895
|
onClick ? "cursor-pointer" : "",
|
|
3075
3896
|
rowClassNameFn ? rowClassNameFn(row) : ""
|
|
3076
3897
|
),
|
|
3077
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0,
|
|
3898
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3078
3899
|
"td",
|
|
3079
3900
|
{
|
|
3080
3901
|
...{
|
|
@@ -3094,8 +3915,8 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
3094
3915
|
},
|
|
3095
3916
|
row.id
|
|
3096
3917
|
)),
|
|
3097
|
-
enableVirtualization && paddingBottom > 0 && /* @__PURE__ */ (0,
|
|
3098
|
-
onFetchMore && /* @__PURE__ */ (0,
|
|
3918
|
+
enableVirtualization && paddingBottom > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("td", { style: { height: `${paddingBottom}px` } }) }),
|
|
3919
|
+
onFetchMore && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3099
3920
|
"td",
|
|
3100
3921
|
{
|
|
3101
3922
|
colSpan: table.getHeaderGroups()[0].headers.length,
|
|
@@ -3104,8 +3925,8 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
3104
3925
|
if (isFetching) return;
|
|
3105
3926
|
onFetchMore?.();
|
|
3106
3927
|
},
|
|
3107
|
-
children: isFetching || hasMore ? /* @__PURE__ */ (0,
|
|
3108
|
-
/* @__PURE__ */ (0,
|
|
3928
|
+
children: isFetching || hasMore ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "inline-flex items-center gap-2", children: [
|
|
3929
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3109
3930
|
import_io5.IoReload,
|
|
3110
3931
|
{
|
|
3111
3932
|
className: (0, import_class_variance_authority10.cx)(
|
|
@@ -3114,7 +3935,7 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
3114
3935
|
)
|
|
3115
3936
|
}
|
|
3116
3937
|
),
|
|
3117
|
-
/* @__PURE__ */ (0,
|
|
3938
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "Loading..." })
|
|
3118
3939
|
] }) : "No more data"
|
|
3119
3940
|
}
|
|
3120
3941
|
) })
|
|
@@ -3125,7 +3946,7 @@ var _ResizeTable = (0, import_react31.forwardRef)(function _ResizeTable2({
|
|
|
3125
3946
|
}
|
|
3126
3947
|
);
|
|
3127
3948
|
});
|
|
3128
|
-
var ResizeTable = (0,
|
|
3949
|
+
var ResizeTable = (0, import_react43.memo)(_ResizeTable);
|
|
3129
3950
|
|
|
3130
3951
|
// src/utils/number-format.ts
|
|
3131
3952
|
var import_bigdecimal = __toESM(require("@sentio/bigdecimal"));
|
|
@@ -3152,10 +3973,10 @@ function getNumberWithDecimal(hex, decimal, asNumber) {
|
|
|
3152
3973
|
}
|
|
3153
3974
|
|
|
3154
3975
|
// src/utils/use-mobile.ts
|
|
3155
|
-
var
|
|
3976
|
+
var import_react44 = require("react");
|
|
3156
3977
|
function useMobile(breakpoint = 768, defaultValue = false) {
|
|
3157
|
-
const [isMobile, setIsMobile] = (0,
|
|
3158
|
-
(0,
|
|
3978
|
+
const [isMobile, setIsMobile] = (0, import_react44.useState)(defaultValue);
|
|
3979
|
+
(0, import_react44.useEffect)(() => {
|
|
3159
3980
|
const checkUserAgent = () => {
|
|
3160
3981
|
if (typeof window === "undefined") return false;
|
|
3161
3982
|
const userAgent = window.navigator.userAgent.toLowerCase();
|
|
@@ -3207,13 +4028,15 @@ function useMobile(breakpoint = 768, defaultValue = false) {
|
|
|
3207
4028
|
BaseZIndexContext,
|
|
3208
4029
|
Button,
|
|
3209
4030
|
COLOR_MAP,
|
|
4031
|
+
Checkbox,
|
|
3210
4032
|
CloseSquareO,
|
|
3211
4033
|
Collapse,
|
|
4034
|
+
ConfirmDialog,
|
|
3212
4035
|
CopyButton,
|
|
3213
4036
|
CopyIcon,
|
|
3214
4037
|
CopySuccessIcon,
|
|
3215
|
-
DarkModeContext,
|
|
3216
4038
|
DeleteIcon,
|
|
4039
|
+
Descriptions,
|
|
3217
4040
|
DisclosurePanel,
|
|
3218
4041
|
Empty,
|
|
3219
4042
|
EyeO,
|
|
@@ -3228,25 +4051,34 @@ function useMobile(breakpoint = 768, defaultValue = false) {
|
|
|
3228
4051
|
MoveLeftIcon,
|
|
3229
4052
|
MoveRightIcon,
|
|
3230
4053
|
NavSizeContext,
|
|
4054
|
+
Notification,
|
|
3231
4055
|
PlusSquareO,
|
|
3232
4056
|
PopoverTooltip,
|
|
3233
4057
|
PopupMenuButton,
|
|
3234
4058
|
Proccessing,
|
|
4059
|
+
ProgressBar,
|
|
3235
4060
|
ROOT_KEY,
|
|
3236
4061
|
RadioSelect,
|
|
3237
4062
|
RenameIcon,
|
|
3238
4063
|
ResizeTable,
|
|
3239
4064
|
SUFFIX_NODE_KEY,
|
|
4065
|
+
SearchInput,
|
|
3240
4066
|
Select,
|
|
4067
|
+
SlideOver,
|
|
3241
4068
|
SpinLoading,
|
|
3242
4069
|
StatusBadge,
|
|
3243
4070
|
StatusRole,
|
|
3244
4071
|
SubMenuButton,
|
|
3245
4072
|
SvgFolderContext,
|
|
3246
4073
|
Switch,
|
|
4074
|
+
TabGroup,
|
|
4075
|
+
TabList,
|
|
4076
|
+
TabPanel,
|
|
4077
|
+
TabPanels,
|
|
3247
4078
|
buttonClass,
|
|
3248
4079
|
classNames,
|
|
3249
4080
|
getNumberWithDecimal,
|
|
4081
|
+
getTabClassName,
|
|
3250
4082
|
parseHex,
|
|
3251
4083
|
useBoolean,
|
|
3252
4084
|
useDarkMode,
|