@scripso-homepad/ui 0.4.24 → 0.4.26
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/{chunk-JNVYKEYT.js → chunk-N73KHOZ4.js} +4 -4
- package/dist/{chunk-JNVYKEYT.js.map → chunk-N73KHOZ4.js.map} +1 -1
- package/dist/index.cjs +12 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/web/index.cjs +165 -131
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.css +8 -29
- package/dist/web/index.css.map +1 -1
- package/dist/web/index.d.cts +1 -3
- package/dist/web/index.d.ts +1 -3
- package/dist/web/index.js +165 -131
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Input.tsx +2 -2
- package/src/components/Select.tsx +9 -1
- package/src/web/components/Modal.tsx +2 -1
- package/src/web/components/Table.stories.tsx +2 -2
- package/src/web/components/drawer-scroll.css +11 -2
- package/src/web/components/table/TablePrimitives.tsx +3 -15
- package/src/web/components/table/TableScrollArea.tsx +1 -12
- package/src/web/components/table/constants.ts +0 -8
- package/src/web/components/table/index.ts +0 -3
- package/src/web/components/table-scroll.css +0 -27
- package/src/web/layout/BuildingSelect.tsx +46 -6
- package/src/web/layout/Sidebar.tsx +20 -21
- package/src/web/layout/SidebarNavItem.tsx +2 -2
- package/src/web/layout/SidebarUserCard.tsx +99 -20
- package/src/web/components/table/use-horizontal-scroll-state.ts +0 -72
package/dist/web/index.cjs
CHANGED
|
@@ -7408,7 +7408,7 @@ var require_react_dom_development = __commonJS({
|
|
|
7408
7408
|
var HostPortal = 4;
|
|
7409
7409
|
var HostComponent = 5;
|
|
7410
7410
|
var HostText = 6;
|
|
7411
|
-
var
|
|
7411
|
+
var Fragment3 = 7;
|
|
7412
7412
|
var Mode = 8;
|
|
7413
7413
|
var ContextConsumer = 9;
|
|
7414
7414
|
var ContextProvider = 10;
|
|
@@ -8563,7 +8563,7 @@ var require_react_dom_development = __commonJS({
|
|
|
8563
8563
|
return "DehydratedFragment";
|
|
8564
8564
|
case ForwardRef:
|
|
8565
8565
|
return getWrappedName$1(type, type.render, "ForwardRef");
|
|
8566
|
-
case
|
|
8566
|
+
case Fragment3:
|
|
8567
8567
|
return "Fragment";
|
|
8568
8568
|
case HostComponent:
|
|
8569
8569
|
return type;
|
|
@@ -16988,7 +16988,7 @@ var require_react_dom_development = __commonJS({
|
|
|
16988
16988
|
}
|
|
16989
16989
|
}
|
|
16990
16990
|
function updateFragment2(returnFiber, current2, fragment, lanes, key) {
|
|
16991
|
-
if (current2 === null || current2.tag !==
|
|
16991
|
+
if (current2 === null || current2.tag !== Fragment3) {
|
|
16992
16992
|
var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
|
|
16993
16993
|
created.return = returnFiber;
|
|
16994
16994
|
return created;
|
|
@@ -17391,7 +17391,7 @@ var require_react_dom_development = __commonJS({
|
|
|
17391
17391
|
if (child.key === key) {
|
|
17392
17392
|
var elementType = element.type;
|
|
17393
17393
|
if (elementType === REACT_FRAGMENT_TYPE) {
|
|
17394
|
-
if (child.tag ===
|
|
17394
|
+
if (child.tag === Fragment3) {
|
|
17395
17395
|
deleteRemainingChildren(returnFiber, child.sibling);
|
|
17396
17396
|
var existing = useFiber(child, element.props.children);
|
|
17397
17397
|
existing.return = returnFiber;
|
|
@@ -22865,7 +22865,7 @@ var require_react_dom_development = __commonJS({
|
|
|
22865
22865
|
var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
|
|
22866
22866
|
return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
|
|
22867
22867
|
}
|
|
22868
|
-
case
|
|
22868
|
+
case Fragment3:
|
|
22869
22869
|
return updateFragment(current2, workInProgress2, renderLanes2);
|
|
22870
22870
|
case Mode:
|
|
22871
22871
|
return updateMode(current2, workInProgress2, renderLanes2);
|
|
@@ -23137,7 +23137,7 @@ var require_react_dom_development = __commonJS({
|
|
|
23137
23137
|
case SimpleMemoComponent:
|
|
23138
23138
|
case FunctionComponent:
|
|
23139
23139
|
case ForwardRef:
|
|
23140
|
-
case
|
|
23140
|
+
case Fragment3:
|
|
23141
23141
|
case Mode:
|
|
23142
23142
|
case Profiler:
|
|
23143
23143
|
case ContextConsumer:
|
|
@@ -27389,7 +27389,7 @@ var require_react_dom_development = __commonJS({
|
|
|
27389
27389
|
return fiber;
|
|
27390
27390
|
}
|
|
27391
27391
|
function createFiberFromFragment(elements, mode, lanes, key) {
|
|
27392
|
-
var fiber = createFiber(
|
|
27392
|
+
var fiber = createFiber(Fragment3, elements, key, mode);
|
|
27393
27393
|
fiber.lanes = lanes;
|
|
27394
27394
|
return fiber;
|
|
27395
27395
|
}
|
|
@@ -29069,8 +29069,8 @@ var styles2 = reactNative.StyleSheet.create({
|
|
|
29069
29069
|
gap: spacing.sm
|
|
29070
29070
|
},
|
|
29071
29071
|
iconSlot: {
|
|
29072
|
-
|
|
29073
|
-
|
|
29072
|
+
minWidth: INPUT_ICON_SIZE,
|
|
29073
|
+
minHeight: INPUT_ICON_SIZE,
|
|
29074
29074
|
alignItems: "center",
|
|
29075
29075
|
justifyContent: "center",
|
|
29076
29076
|
flexShrink: 0
|
|
@@ -29212,6 +29212,24 @@ function useOnClickOutside(ref, handler, enabled = true) {
|
|
|
29212
29212
|
};
|
|
29213
29213
|
}, [enabled]);
|
|
29214
29214
|
}
|
|
29215
|
+
function useTruncatedTitle(text) {
|
|
29216
|
+
const ref = react.useRef(null);
|
|
29217
|
+
const [isTruncated, setIsTruncated] = react.useState(false);
|
|
29218
|
+
react.useLayoutEffect(() => {
|
|
29219
|
+
const element = ref.current;
|
|
29220
|
+
if (!element) {
|
|
29221
|
+
return;
|
|
29222
|
+
}
|
|
29223
|
+
const update = () => {
|
|
29224
|
+
setIsTruncated(element.scrollWidth > element.clientWidth + 1);
|
|
29225
|
+
};
|
|
29226
|
+
update();
|
|
29227
|
+
const observer = new ResizeObserver(update);
|
|
29228
|
+
observer.observe(element);
|
|
29229
|
+
return () => observer.disconnect();
|
|
29230
|
+
}, [text]);
|
|
29231
|
+
return { ref, title: isTruncated ? text : void 0 };
|
|
29232
|
+
}
|
|
29215
29233
|
function BuildingSelect({
|
|
29216
29234
|
options,
|
|
29217
29235
|
value,
|
|
@@ -29230,6 +29248,7 @@ function BuildingSelect({
|
|
|
29230
29248
|
const selectedOption = options.find((option) => option.value === value);
|
|
29231
29249
|
const displayLabel = selectedOption?.label ?? labels.selectBuilding;
|
|
29232
29250
|
const selectableOptions = options.filter((option) => !option.disabled);
|
|
29251
|
+
const { ref: labelRef, title: truncatedTitle } = useTruncatedTitle(displayLabel);
|
|
29233
29252
|
const closeMenu = react.useCallback(() => {
|
|
29234
29253
|
setOpen(false);
|
|
29235
29254
|
setHighlightedIndex(-1);
|
|
@@ -29300,7 +29319,7 @@ function BuildingSelect({
|
|
|
29300
29319
|
break;
|
|
29301
29320
|
}
|
|
29302
29321
|
};
|
|
29303
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: rootRef, className: cn("relative w-
|
|
29322
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: rootRef, className: cn("relative w-72", className), children: [
|
|
29304
29323
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
29305
29324
|
"button",
|
|
29306
29325
|
{
|
|
@@ -29310,17 +29329,25 @@ function BuildingSelect({
|
|
|
29310
29329
|
"aria-expanded": open,
|
|
29311
29330
|
"aria-controls": listboxId,
|
|
29312
29331
|
"aria-label": labels.selectBuilding,
|
|
29332
|
+
title: truncatedTitle,
|
|
29313
29333
|
onClick: () => open ? closeMenu() : openMenu(),
|
|
29314
29334
|
onKeyDown: handleTriggerKeyDown,
|
|
29315
29335
|
className: cn(
|
|
29316
|
-
"flex h-11 w-full items-center gap-3 rounded-xl border border-storm-gray-50 bg-white
|
|
29336
|
+
"flex h-11 w-full items-center gap-3 rounded-xl border border-storm-gray-50 bg-white px-3.5 py-3 text-left transition-colors",
|
|
29317
29337
|
!disabled && "cursor-pointer hover:bg-storm-gray-50/60",
|
|
29318
29338
|
open && "bg-storm-gray-50/60",
|
|
29319
29339
|
disabled && "cursor-not-allowed opacity-60"
|
|
29320
29340
|
),
|
|
29321
29341
|
children: [
|
|
29322
|
-
buildingIcon ?? /* @__PURE__ */ jsxRuntime.jsx(BuildingIcon, { className: "shrink-0 text-navy" }),
|
|
29323
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29342
|
+
buildingIcon ?? /* @__PURE__ */ jsxRuntime.jsx(BuildingIcon, { className: "size-5 shrink-0 text-navy" }),
|
|
29343
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29344
|
+
"span",
|
|
29345
|
+
{
|
|
29346
|
+
ref: labelRef,
|
|
29347
|
+
className: "min-w-0 flex-1 truncate typography-14 font-medium text-slate-blue",
|
|
29348
|
+
children: displayLabel
|
|
29349
|
+
}
|
|
29350
|
+
),
|
|
29324
29351
|
chevronIcon ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
29325
29352
|
lucideReact.ChevronsUpDown,
|
|
29326
29353
|
{
|
|
@@ -29373,7 +29400,7 @@ function BuildingSelect({
|
|
|
29373
29400
|
(isSelected || isHighlighted) && !option.disabled && "bg-storm-gray-50",
|
|
29374
29401
|
option.disabled && "cursor-not-allowed opacity-50"
|
|
29375
29402
|
),
|
|
29376
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: option.label })
|
|
29403
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", title: option.label, children: option.label })
|
|
29377
29404
|
}
|
|
29378
29405
|
) }, option.value);
|
|
29379
29406
|
})
|
|
@@ -29518,9 +29545,9 @@ function SidebarNavItem({ item, isOpen, isActive, onNavigate }) {
|
|
|
29518
29545
|
tabIndex: item.disabled ? -1 : void 0,
|
|
29519
29546
|
className: cn(
|
|
29520
29547
|
"relative flex items-center rounded-xl px-4 py-3 transition-[background-color,color,gap,padding] duration-300 ease-in-out",
|
|
29521
|
-
isOpen ? "w-full gap-4" : "justify-center gap-0 px-3",
|
|
29548
|
+
isOpen ? "w-full gap-4" : "w-full justify-center gap-0 px-3",
|
|
29522
29549
|
item.disabled && "pointer-events-none opacity-50",
|
|
29523
|
-
isActive ? "bg-black/12 text-white" : "text-navy-100 hover:bg-white/5"
|
|
29550
|
+
isActive ? "bg-black/12 text-white shadow-none" : "text-navy-100 shadow-none hover:bg-white/5"
|
|
29524
29551
|
),
|
|
29525
29552
|
children: [
|
|
29526
29553
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -29555,6 +29582,7 @@ function getInitials(fullName, email) {
|
|
|
29555
29582
|
}
|
|
29556
29583
|
return email.slice(0, 2).toUpperCase();
|
|
29557
29584
|
}
|
|
29585
|
+
var avatarCircleClassName = "flex size-11 shrink-0 items-center justify-center rounded-full bg-white/5";
|
|
29558
29586
|
function SidebarUserCard({
|
|
29559
29587
|
user,
|
|
29560
29588
|
isOpen,
|
|
@@ -29563,39 +29591,110 @@ function SidebarUserCard({
|
|
|
29563
29591
|
className
|
|
29564
29592
|
}) {
|
|
29565
29593
|
const initials = user.initials ?? getInitials(user.fullName, user.email);
|
|
29594
|
+
const [logoutOpen, setLogoutOpen] = react.useState(false);
|
|
29595
|
+
const rootRef = react.useRef(null);
|
|
29596
|
+
const logoutMenuId = react.useId();
|
|
29597
|
+
react.useEffect(() => {
|
|
29598
|
+
if (isOpen) {
|
|
29599
|
+
setLogoutOpen(false);
|
|
29600
|
+
}
|
|
29601
|
+
}, [isOpen]);
|
|
29602
|
+
react.useEffect(() => {
|
|
29603
|
+
if (isOpen || !logoutOpen) {
|
|
29604
|
+
return;
|
|
29605
|
+
}
|
|
29606
|
+
function handlePointerDown(event) {
|
|
29607
|
+
if (rootRef.current && !rootRef.current.contains(event.target)) {
|
|
29608
|
+
setLogoutOpen(false);
|
|
29609
|
+
}
|
|
29610
|
+
}
|
|
29611
|
+
function handleKeyDown(event) {
|
|
29612
|
+
if (event.key === "Escape") {
|
|
29613
|
+
setLogoutOpen(false);
|
|
29614
|
+
}
|
|
29615
|
+
}
|
|
29616
|
+
document.addEventListener("mousedown", handlePointerDown);
|
|
29617
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
29618
|
+
return () => {
|
|
29619
|
+
document.removeEventListener("mousedown", handlePointerDown);
|
|
29620
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
29621
|
+
};
|
|
29622
|
+
}, [isOpen, logoutOpen]);
|
|
29623
|
+
const avatar = /* @__PURE__ */ jsxRuntime.jsx(
|
|
29624
|
+
"div",
|
|
29625
|
+
{
|
|
29626
|
+
className: cn(avatarCircleClassName, "typography-14 font-bold text-white"),
|
|
29627
|
+
"aria-hidden": true,
|
|
29628
|
+
children: initials
|
|
29629
|
+
}
|
|
29630
|
+
);
|
|
29631
|
+
if (!isOpen) {
|
|
29632
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29633
|
+
"div",
|
|
29634
|
+
{
|
|
29635
|
+
ref: rootRef,
|
|
29636
|
+
className: cn("flex w-full flex-col items-center gap-2", className),
|
|
29637
|
+
children: [
|
|
29638
|
+
logoutOpen ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
29639
|
+
"button",
|
|
29640
|
+
{
|
|
29641
|
+
type: "button",
|
|
29642
|
+
id: logoutMenuId,
|
|
29643
|
+
onClick: () => {
|
|
29644
|
+
setLogoutOpen(false);
|
|
29645
|
+
onLogout?.();
|
|
29646
|
+
},
|
|
29647
|
+
className: cn(
|
|
29648
|
+
avatarCircleClassName,
|
|
29649
|
+
"cursor-pointer bg-black/20 text-white",
|
|
29650
|
+
"transition-[background-color,transform] duration-300 ease-in-out",
|
|
29651
|
+
"hover:bg-white/10 active:scale-95"
|
|
29652
|
+
),
|
|
29653
|
+
"aria-label": logoutLabel,
|
|
29654
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, { size: 20, strokeWidth: 1.75 })
|
|
29655
|
+
}
|
|
29656
|
+
) : null,
|
|
29657
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29658
|
+
"button",
|
|
29659
|
+
{
|
|
29660
|
+
type: "button",
|
|
29661
|
+
onClick: () => setLogoutOpen((open) => !open),
|
|
29662
|
+
className: "flex cursor-pointer items-center justify-center transition-transform duration-300 ease-in-out active:scale-95",
|
|
29663
|
+
"aria-expanded": logoutOpen,
|
|
29664
|
+
"aria-haspopup": "true",
|
|
29665
|
+
"aria-controls": logoutOpen ? logoutMenuId : void 0,
|
|
29666
|
+
"aria-label": user.fullName,
|
|
29667
|
+
children: avatar
|
|
29668
|
+
}
|
|
29669
|
+
)
|
|
29670
|
+
]
|
|
29671
|
+
}
|
|
29672
|
+
);
|
|
29673
|
+
}
|
|
29566
29674
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29567
29675
|
"div",
|
|
29568
29676
|
{
|
|
29569
29677
|
className: cn(
|
|
29570
|
-
"flex w-full items-center
|
|
29571
|
-
|
|
29678
|
+
"flex w-full items-center justify-between gap-3 rounded-xl bg-black/12 p-3",
|
|
29679
|
+
"transition-[background-color,justify-content,gap,padding] duration-300 ease-in-out",
|
|
29572
29680
|
className
|
|
29573
29681
|
),
|
|
29574
29682
|
children: [
|
|
29683
|
+
avatar,
|
|
29684
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col overflow-hidden", children: [
|
|
29685
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate typography-14 font-bold text-white", children: user.fullName }),
|
|
29686
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate typography-12 text-storm-gray-100", children: user.email })
|
|
29687
|
+
] }),
|
|
29575
29688
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29576
|
-
"
|
|
29689
|
+
"button",
|
|
29577
29690
|
{
|
|
29578
|
-
|
|
29579
|
-
|
|
29580
|
-
|
|
29691
|
+
type: "button",
|
|
29692
|
+
onClick: () => onLogout?.(),
|
|
29693
|
+
className: "shrink-0 cursor-pointer text-navy-150 transition-[opacity,transform] duration-300 ease-in-out hover:opacity-80 active:scale-95",
|
|
29694
|
+
"aria-label": logoutLabel,
|
|
29695
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, { size: 20, strokeWidth: 1.75 })
|
|
29581
29696
|
}
|
|
29582
|
-
)
|
|
29583
|
-
isOpen ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
29584
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col overflow-hidden", children: [
|
|
29585
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate typography-14 font-bold text-white", children: user.fullName }),
|
|
29586
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate typography-12 text-storm-gray-100", children: user.email })
|
|
29587
|
-
] }),
|
|
29588
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29589
|
-
"button",
|
|
29590
|
-
{
|
|
29591
|
-
type: "button",
|
|
29592
|
-
onClick: () => onLogout?.(),
|
|
29593
|
-
className: "shrink-0 cursor-pointer text-navy-150 transition-[opacity,transform] duration-300 ease-in-out hover:opacity-80 active:scale-95",
|
|
29594
|
-
"aria-label": logoutLabel,
|
|
29595
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, { size: 20, strokeWidth: 1.75 })
|
|
29596
|
-
}
|
|
29597
|
-
)
|
|
29598
|
-
] }) : null
|
|
29697
|
+
)
|
|
29599
29698
|
]
|
|
29600
29699
|
}
|
|
29601
29700
|
);
|
|
@@ -29753,18 +29852,8 @@ function Sidebar({
|
|
|
29753
29852
|
]
|
|
29754
29853
|
}
|
|
29755
29854
|
),
|
|
29756
|
-
/* @__PURE__ */ jsxRuntime.
|
|
29757
|
-
|
|
29758
|
-
{
|
|
29759
|
-
item,
|
|
29760
|
-
isOpen: isExpanded,
|
|
29761
|
-
isActive: isNavItemActive(pathname, item),
|
|
29762
|
-
onNavigate: handleNavItemNavigate
|
|
29763
|
-
},
|
|
29764
|
-
item.to
|
|
29765
|
-
)) }),
|
|
29766
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full flex-col gap-4", children: [
|
|
29767
|
-
visibleFooterNavItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
29855
|
+
/* @__PURE__ */ jsxRuntime.jsxs("nav", { className: "flex w-full min-h-0 flex-1 flex-col gap-2 overflow-x-hidden overflow-y-auto", children: [
|
|
29856
|
+
visibleNavItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
29768
29857
|
SidebarNavItem,
|
|
29769
29858
|
{
|
|
29770
29859
|
item,
|
|
@@ -29774,15 +29863,27 @@ function Sidebar({
|
|
|
29774
29863
|
},
|
|
29775
29864
|
item.to
|
|
29776
29865
|
)),
|
|
29777
|
-
|
|
29778
|
-
|
|
29779
|
-
|
|
29780
|
-
|
|
29781
|
-
|
|
29782
|
-
|
|
29783
|
-
|
|
29784
|
-
|
|
29785
|
-
|
|
29866
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-auto flex w-full flex-col gap-2", children: [
|
|
29867
|
+
visibleFooterNavItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
29868
|
+
SidebarNavItem,
|
|
29869
|
+
{
|
|
29870
|
+
item,
|
|
29871
|
+
isOpen: isExpanded,
|
|
29872
|
+
isActive: isNavItemActive(pathname, item),
|
|
29873
|
+
onNavigate: handleNavItemNavigate
|
|
29874
|
+
},
|
|
29875
|
+
item.to
|
|
29876
|
+
)),
|
|
29877
|
+
user ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
29878
|
+
SidebarUserCard,
|
|
29879
|
+
{
|
|
29880
|
+
user,
|
|
29881
|
+
isOpen: isExpanded,
|
|
29882
|
+
logoutLabel: labels.logout,
|
|
29883
|
+
onLogout
|
|
29884
|
+
}
|
|
29885
|
+
) : null
|
|
29886
|
+
] })
|
|
29786
29887
|
] })
|
|
29787
29888
|
]
|
|
29788
29889
|
}
|
|
@@ -30265,10 +30366,6 @@ function Pagination({
|
|
|
30265
30366
|
|
|
30266
30367
|
// src/web/components/table/constants.ts
|
|
30267
30368
|
var tableBorderClassName = "border-storm-gray-50";
|
|
30268
|
-
var tableStickyRightShadowClassName = "table-sticky-right-shadow";
|
|
30269
|
-
var tableStickyRightHeadClassName = "table-sticky-right-head";
|
|
30270
|
-
var tableScrollAtEndClassName = "table-scroll-at-end";
|
|
30271
|
-
var tableScrollHasOverflowClassName = "table-scroll-has-overflow";
|
|
30272
30369
|
var tableRowDisabledCellClassName = "bg-[#ECEEF0]/30 [&>*]:opacity-70";
|
|
30273
30370
|
var DEFAULT_TABLE_BODY_MIN_HEIGHT = 320;
|
|
30274
30371
|
var tableCellPaddingClassName = "px-3 py-3";
|
|
@@ -30367,7 +30464,6 @@ function resolveAriaSort(sortDirection, isSortable) {
|
|
|
30367
30464
|
function TableHead({
|
|
30368
30465
|
className,
|
|
30369
30466
|
align = "left",
|
|
30370
|
-
stickyRight = false,
|
|
30371
30467
|
sortable = false,
|
|
30372
30468
|
sortDirection = null,
|
|
30373
30469
|
onSort,
|
|
@@ -30397,11 +30493,6 @@ function TableHead({
|
|
|
30397
30493
|
"sticky top-0 z-10",
|
|
30398
30494
|
tableHeadPaddingClassName,
|
|
30399
30495
|
tableHeaderClassName,
|
|
30400
|
-
stickyRight && [
|
|
30401
|
-
"sticky right-0 z-20",
|
|
30402
|
-
tableStickyRightHeadClassName,
|
|
30403
|
-
tableStickyRightShadowClassName
|
|
30404
|
-
],
|
|
30405
30496
|
!isSortable && tableAlignClasses[align],
|
|
30406
30497
|
className
|
|
30407
30498
|
),
|
|
@@ -30442,16 +30533,14 @@ function TableActionsCell({ className, children, ...props }) {
|
|
|
30442
30533
|
"td",
|
|
30443
30534
|
{
|
|
30444
30535
|
className: cn(
|
|
30445
|
-
"
|
|
30536
|
+
"whitespace-nowrap",
|
|
30446
30537
|
tableCellPaddingClassName,
|
|
30447
30538
|
tableBodyClassName,
|
|
30448
|
-
|
|
30449
|
-
// Keep an opaque sticky background so scrolled cells never bleed through.
|
|
30450
|
-
disabled && "bg-white [&>*]:opacity-70",
|
|
30539
|
+
disabled && tableRowDisabledCellClassName,
|
|
30451
30540
|
className
|
|
30452
30541
|
),
|
|
30453
30542
|
...props,
|
|
30454
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "
|
|
30543
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end gap-2", children })
|
|
30455
30544
|
}
|
|
30456
30545
|
);
|
|
30457
30546
|
}
|
|
@@ -30688,57 +30777,6 @@ function TableStatusActionsCell({
|
|
|
30688
30777
|
}
|
|
30689
30778
|
);
|
|
30690
30779
|
}
|
|
30691
|
-
var useIsomorphicLayoutEffect2 = typeof window === "undefined" ? react.useEffect : react.useLayoutEffect;
|
|
30692
|
-
function getHorizontalScrollState(element) {
|
|
30693
|
-
const inner = element.firstElementChild;
|
|
30694
|
-
const table = inner?.querySelector("table");
|
|
30695
|
-
const contentWidth = table?.scrollWidth ?? inner?.scrollWidth ?? element.scrollWidth;
|
|
30696
|
-
const viewportWidth = element.clientWidth;
|
|
30697
|
-
const maxScrollLeft = element.scrollWidth - element.clientWidth;
|
|
30698
|
-
const hasOverflow = contentWidth > viewportWidth + 1;
|
|
30699
|
-
const atEnd = !hasOverflow || element.scrollLeft >= maxScrollLeft - 1;
|
|
30700
|
-
return { hasOverflow, atEnd };
|
|
30701
|
-
}
|
|
30702
|
-
function useHorizontalScrollState() {
|
|
30703
|
-
const scrollRef = react.useRef(null);
|
|
30704
|
-
const [scrollState, setScrollState] = react.useState({
|
|
30705
|
-
hasOverflow: false,
|
|
30706
|
-
atEnd: true
|
|
30707
|
-
});
|
|
30708
|
-
const updateScrollState = react.useCallback(() => {
|
|
30709
|
-
const element = scrollRef.current;
|
|
30710
|
-
if (!element) {
|
|
30711
|
-
return;
|
|
30712
|
-
}
|
|
30713
|
-
setScrollState(getHorizontalScrollState(element));
|
|
30714
|
-
}, []);
|
|
30715
|
-
useIsomorphicLayoutEffect2(() => {
|
|
30716
|
-
const element = scrollRef.current;
|
|
30717
|
-
if (!element) {
|
|
30718
|
-
return;
|
|
30719
|
-
}
|
|
30720
|
-
updateScrollState();
|
|
30721
|
-
element.addEventListener("scroll", updateScrollState, { passive: true });
|
|
30722
|
-
if (typeof ResizeObserver === "undefined") {
|
|
30723
|
-
window.addEventListener("resize", updateScrollState);
|
|
30724
|
-
return () => {
|
|
30725
|
-
element.removeEventListener("scroll", updateScrollState);
|
|
30726
|
-
window.removeEventListener("resize", updateScrollState);
|
|
30727
|
-
};
|
|
30728
|
-
}
|
|
30729
|
-
const resizeObserver = new ResizeObserver(updateScrollState);
|
|
30730
|
-
resizeObserver.observe(element);
|
|
30731
|
-
const inner = element.firstElementChild;
|
|
30732
|
-
if (inner) {
|
|
30733
|
-
resizeObserver.observe(inner);
|
|
30734
|
-
}
|
|
30735
|
-
return () => {
|
|
30736
|
-
element.removeEventListener("scroll", updateScrollState);
|
|
30737
|
-
resizeObserver.disconnect();
|
|
30738
|
-
};
|
|
30739
|
-
}, [updateScrollState]);
|
|
30740
|
-
return { scrollRef, scrollState };
|
|
30741
|
-
}
|
|
30742
30780
|
function TableScrollArea({
|
|
30743
30781
|
children,
|
|
30744
30782
|
minWidth = 980,
|
|
@@ -30747,15 +30785,11 @@ function TableScrollArea({
|
|
|
30747
30785
|
height,
|
|
30748
30786
|
fillHeight = false
|
|
30749
30787
|
}) {
|
|
30750
|
-
const { scrollRef, scrollState } = useHorizontalScrollState();
|
|
30751
30788
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30752
30789
|
"div",
|
|
30753
30790
|
{
|
|
30754
|
-
ref: scrollRef,
|
|
30755
30791
|
className: cn(
|
|
30756
30792
|
"table-scroll-area w-full overflow-auto",
|
|
30757
|
-
scrollState.hasOverflow && tableScrollHasOverflowClassName,
|
|
30758
|
-
scrollState.atEnd && tableScrollAtEndClassName,
|
|
30759
30793
|
fillHeight && "min-h-0 flex-1",
|
|
30760
30794
|
className
|
|
30761
30795
|
),
|
|
@@ -31190,7 +31224,7 @@ function Modal({
|
|
|
31190
31224
|
) : null
|
|
31191
31225
|
] })
|
|
31192
31226
|
] }),
|
|
31193
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("min-h-0 min-w-0 flex-1 overflow-y-auto", contentClassName), children }),
|
|
31227
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("drawer-scroll-area min-h-0 min-w-0 flex-1 overflow-y-auto", contentClassName), children }),
|
|
31194
31228
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
31195
31229
|
"footer",
|
|
31196
31230
|
{
|