@@ -18,6 +18,7 @@ import {
|
|||||||
DataTable,
|
DataTable,
|
||||||
CellHead,
|
CellHead,
|
||||||
Cell,
|
Cell,
|
||||||
|
Row,
|
||||||
} from "@probo/ui";
|
} from "@probo/ui";
|
||||||
import { useTranslate } from "@probo/i18n";
|
import { useTranslate } from "@probo/i18n";
|
||||||
import { usePageTitle } from "@probo/hooks";
|
import { usePageTitle } from "@probo/hooks";
|
||||||
@@ -145,13 +146,15 @@ export default function AssetsPage(props: Props) {
|
|||||||
</Authorized>
|
</Authorized>
|
||||||
)}
|
)}
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
<DataTable columns={6}>
|
<DataTable columns={["1fr", "1fr", "1fr", "1fr", "1fr", "56px"]}>
|
||||||
<CellHead>{__("Name")}</CellHead>
|
<Row>
|
||||||
<CellHead>{__("Type")}</CellHead>
|
<CellHead>{__("Name")}</CellHead>
|
||||||
<CellHead>{__("Amount")}</CellHead>
|
<CellHead>{__("Type")}</CellHead>
|
||||||
<CellHead>{__("Owner")}</CellHead>
|
<CellHead>{__("Amount")}</CellHead>
|
||||||
<CellHead>{__("Vendors")}</CellHead>
|
<CellHead>{__("Owner")}</CellHead>
|
||||||
<CellHead></CellHead>
|
<CellHead>{__("Vendors")}</CellHead>
|
||||||
|
<CellHead></CellHead>
|
||||||
|
</Row>
|
||||||
{assets.map((entry) => (
|
{assets.map((entry) => (
|
||||||
<AssetRow key={entry.id} entry={entry} connectionId={connectionId} />
|
<AssetRow key={entry.id} entry={entry} connectionId={connectionId} />
|
||||||
))}
|
))}
|
||||||
@@ -196,7 +199,7 @@ function AssetRow({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<Row>
|
||||||
<EditableCell
|
<EditableCell
|
||||||
type="text"
|
type="text"
|
||||||
defaultValue={entry.name}
|
defaultValue={entry.name}
|
||||||
@@ -278,6 +281,6 @@ function AssetRow({
|
|||||||
</ActionDropdown>
|
</ActionDropdown>
|
||||||
)}
|
)}
|
||||||
</Cell>
|
</Cell>
|
||||||
</>
|
</Row>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ export function CellHead({
|
|||||||
<div
|
<div
|
||||||
{...props}
|
{...props}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"text-xs text-txt-tertiary font-semibold border-border-low border-b",
|
"text-xs text-txt-tertiary font-semibold ",
|
||||||
"px-6 whitespace-nowrap py-3",
|
"first:pl-6 p-3 whitespace-nowrap",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
@@ -52,6 +52,10 @@ export function CellHead({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function Row(props: ComponentPropsWithRef<"div">) {
|
||||||
|
return <div {...props} className={clsx("contents", props.className)} />;
|
||||||
|
}
|
||||||
|
|
||||||
export function Cell({
|
export function Cell({
|
||||||
asChild,
|
asChild,
|
||||||
...props
|
...props
|
||||||
@@ -62,7 +66,7 @@ export function Cell({
|
|||||||
data-cell
|
data-cell
|
||||||
{...props}
|
{...props}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"py-3 px-6 text-sm text-txt-primary bg-tertiary border-t border-border-low flex flex-col justify-center",
|
"first:pl-6 p-3 text-sm text-txt-primary bg-tertiary border-t border-border-low flex flex-col justify-center",
|
||||||
props.className,
|
props.className,
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import { tv } from "tailwind-variants";
|
|||||||
import {
|
import {
|
||||||
Children,
|
Children,
|
||||||
type ComponentProps,
|
type ComponentProps,
|
||||||
|
type CSSProperties,
|
||||||
type PropsWithChildren,
|
type PropsWithChildren,
|
||||||
type ReactNode,
|
type ReactNode,
|
||||||
} from "react";
|
} from "react";
|
||||||
@@ -36,6 +37,8 @@ type Props<T> = PropsWithChildren<
|
|||||||
onSearch?: (s: string) => void;
|
onSearch?: (s: string) => void;
|
||||||
searchPlaceholder?: string;
|
searchPlaceholder?: string;
|
||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
|
style?: CSSProperties;
|
||||||
|
dropdownProps?: ComponentProps<typeof Content>;
|
||||||
} & Omit<ComponentProps<typeof Root>, "onChange" | "value">
|
} & Omit<ComponentProps<typeof Root>, "onChange" | "value">
|
||||||
>;
|
>;
|
||||||
|
|
||||||
@@ -108,6 +111,7 @@ export function Select<T>({
|
|||||||
open,
|
open,
|
||||||
defaultOpen = false,
|
defaultOpen = false,
|
||||||
onOpenChange,
|
onOpenChange,
|
||||||
|
dropdownProps,
|
||||||
...props
|
...props
|
||||||
}: Props<T>) {
|
}: Props<T>) {
|
||||||
const { trigger, content, icon } = select({
|
const { trigger, content, icon } = select({
|
||||||
@@ -140,7 +144,6 @@ export function Select<T>({
|
|||||||
</Trigger>
|
</Trigger>
|
||||||
<Portal>
|
<Portal>
|
||||||
<Content
|
<Content
|
||||||
className={content()}
|
|
||||||
position="popper"
|
position="popper"
|
||||||
sideOffset={5}
|
sideOffset={5}
|
||||||
style={{
|
style={{
|
||||||
@@ -148,6 +151,8 @@ export function Select<T>({
|
|||||||
maxHeight:
|
maxHeight:
|
||||||
"var(--radix-select-content-available-height)",
|
"var(--radix-select-content-available-height)",
|
||||||
}}
|
}}
|
||||||
|
{...dropdownProps}
|
||||||
|
className={content({ className: dropdownProps?.className })}
|
||||||
>
|
>
|
||||||
{onSearch && (
|
{onSearch && (
|
||||||
<Input
|
<Input
|
||||||
|
|||||||
@@ -69,18 +69,28 @@ export function EditableCell({
|
|||||||
side="bottom"
|
side="bottom"
|
||||||
align="start"
|
align="start"
|
||||||
sideOffset={height * -1}
|
sideOffset={height * -1}
|
||||||
style={{ height, paddingLeft: padding }}
|
style={{
|
||||||
|
height,
|
||||||
|
paddingLeft: type === "select" ? 0 : padding,
|
||||||
|
}}
|
||||||
className="border border-border-low bg-level-2 min-w-[200px] min-h-[57px] flex flex-col justify-center rounded-sm"
|
className="border border-border-low bg-level-2 min-w-[200px] min-h-[57px] flex flex-col justify-center rounded-sm"
|
||||||
>
|
>
|
||||||
{type === "select" && (
|
{type === "select" && (
|
||||||
<>
|
<>
|
||||||
<Select
|
<Select
|
||||||
className="-mx-3"
|
|
||||||
onValueChange={onValueChange}
|
onValueChange={onValueChange}
|
||||||
onOpenChange={setOpen}
|
onOpenChange={setOpen}
|
||||||
defaultOpen
|
defaultOpen
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
|
style={{
|
||||||
|
height: height,
|
||||||
|
}}
|
||||||
placeholder={children}
|
placeholder={children}
|
||||||
|
dropdownProps={{
|
||||||
|
sideOffset: 0,
|
||||||
|
className:
|
||||||
|
"rounded-t-none border border-border-low",
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{options}
|
{options}
|
||||||
</Select>
|
</Select>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export { InfiniteScrollTrigger } from "./Atoms/InfiniteScrollTrigger/InfiniteScr
|
|||||||
export { PriorityLevel } from "./Atoms/PriorityLevel/PriorityLevel.tsx";
|
export { PriorityLevel } from "./Atoms/PriorityLevel/PriorityLevel.tsx";
|
||||||
export { TaskStateIcon } from "./Atoms/Icons/TaskStateIcon";
|
export { TaskStateIcon } from "./Atoms/Icons/TaskStateIcon";
|
||||||
export { Checkbox } from "./Atoms/Checkbox/Checkbox";
|
export { Checkbox } from "./Atoms/Checkbox/Checkbox";
|
||||||
export { DataTable, Cell, CellHead } from "./Atoms/DataTable/DataTable";
|
export { DataTable, Cell, CellHead, Row } from "./Atoms/DataTable/DataTable";
|
||||||
|
|
||||||
// Molecules
|
// Molecules
|
||||||
export {
|
export {
|
||||||
|
|||||||
Reference in New Issue
Block a user