Merge commit '219229293311fa7caf87c32b5266434d00507318' into iipbs/common/main

This commit is contained in:
truthwing
2025-05-19 10:05:09 +09:00
269 changed files with 5734 additions and 661 deletions
@@ -2,13 +2,13 @@
@layer components {
button[role="checkbox"] {
@apply size-[1.5rem] shrink-0 overflow-hidden rounded-[0.5rem] border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground;
@apply size-[1.5rem] shrink-0 overflow-hidden rounded-[0.5rem] border border-primary bg-background ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground;
}
button[role="checkbox"] > span {
@apply flex size-full items-center justify-center text-current;
}
button[role="checkbox"] + label {
@apply text-label text-[1.3rem] font-medium;
@apply text-[1.3rem] font-medium text-label;
}
button[role="checkbox"]:disabled + label {
@apply cursor-not-allowed opacity-70;
@@ -13,11 +13,11 @@ import { cn } from "../../lib";
import { Button } from "../button";
import { Table, TableCell, TableHead, TableHeader, TableRow } from "../table";
import type { HTMLAttributes } from "react";
declare module "@tanstack/react-table" {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface ColumnMeta<TData extends RowData, TValue> {
align: "left" | "center" | "right";
align?: "left" | "center" | "right";
rowSpan?: number;
}
}
@@ -70,15 +70,35 @@ function THead<T>({ table }: { table: TableInstance<T> }) {
{table.getHeaderGroups().map((headerGroup) => (
<TableRow key={headerGroup.id}>
{headerGroup.headers.map((header) => {
const columnRelativeDepth = header.depth - header.column.depth;
if (
!header.isPlaceholder &&
columnRelativeDepth > 1 &&
header.id === header.column.id
) {
return null;
}
let rowSpan = 1;
if (header.isPlaceholder) {
const leafs = header.getLeafHeaders();
rowSpan = (leafs?.[leafs.length - 1]?.depth ?? 0) - header.depth;
}
const { meta } = header.column.columnDef;
return (
<TableHead key={header.id} className="sticky top-0" {...meta}>
{header.isPlaceholder
? null
: flexRender(
header.column.columnDef.header,
header.getContext(),
)}
<TableHead
key={header.id}
className="sticky top-0"
colSpan={header.colSpan}
rowSpan={rowSpan}
{...meta}
>
{flexRender(
header.column.columnDef.header,
header.getContext(),
)}
</TableHead>
);
})}
@@ -1,8 +1,9 @@
import { useQuery } from "@tanstack/react-query";
import { images } from "@common/assets";
import { getConfig } from "@common/config";
import { ENDPOINT } from "../../config";
import { getCookie, setCookie } from "../../lib";
import { getSiteInfo, getUserInfo } from "../../api";
import { AUTH_USER_ID, ENDPOINT, SITE_ID } from "../../config";
import {
DropdownMenu,
DropdownMenuTrigger,
@@ -11,8 +12,10 @@ import {
} from "../dropdown-menu";
import { Button } from "../button";
const { AUTH_USER_ID, SITE_ID } = getConfig();
export function Header({ viewOnly }: { viewOnly?: boolean }) {
const userUniqId = getCookie(AUTH_USER_ID) ?? "";
const userUniqId = getCookie(AUTH_USER_ID ?? "") ?? "";
const { data: userInfo } = useQuery({
queryKey: [ENDPOINT.USER_SERVICE.USERS],
@@ -22,7 +25,7 @@ export function Header({ viewOnly }: { viewOnly?: boolean }) {
const { data: siteInfo } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.SITES, SITE_ID],
queryFn: () => getSiteInfo(SITE_ID),
queryFn: () => getSiteInfo(SITE_ID ?? ""),
select: (data) => {
if (data.siteSkn) {
const siteSkin = data.siteSkn.toLowerCase();
@@ -1,8 +1,9 @@
import { useState } from "react";
import { useQuery } from "@tanstack/react-query";
import { ChevronRight } from "lucide-react";
import { getConfig } from "@common/config";
import { ENDPOINT } from "../../config";
import { cn, setCookie } from "../../lib";
import { ENDPOINT, SITE_ID } from "../../config";
import { getMenuList, type MenuItem } from "../../api";
import {
Sidebar,
@@ -19,6 +20,8 @@ import {
} from "../collapsible";
import { getParentIds } from "./lib";
const { SITE_ID } = getConfig();
export function LNB({
viewOnly,
currentPath,
@@ -30,7 +33,7 @@ export function LNB({
}) {
const { data: menuList } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.MENU_ROLES],
queryFn: () => getMenuList(SITE_ID),
queryFn: () => getMenuList(SITE_ID ?? ""),
enabled: !viewOnly,
});