@sqlrooms/room-shell 0.24.20 → 0.24.22
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCard.d.ts","sourceRoot":"","sources":["../../src/data-sources/TableCard.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAG3C,OAAO,KAAK,EAAE,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAEhC,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,CAAC;AACF,QAAA,MAAM,SAAS,EAAE,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,KAAK,KAAK,CAAC,SAAS,CAAC;CAClD,
|
|
1
|
+
{"version":3,"file":"TableCard.d.ts","sourceRoot":"","sources":["../../src/data-sources/TableCard.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAG3C,OAAO,KAAK,EAAE,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAEhC,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,CAAC;AACF,QAAA,MAAM,SAAS,EAAE,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,KAAK,KAAK,CAAC,SAAS,CAAC;CAClD,CA4EA,CAAC;AAEF,OAAO,EAAC,SAAS,EAAC,CAAC"}
|
|
@@ -6,7 +6,6 @@ const TableCard = ({ value, rowCount, onClick, className, menuRenderer }) => {
|
|
|
6
6
|
if (!value)
|
|
7
7
|
return null;
|
|
8
8
|
const numRows = value.rowCount ?? rowCount;
|
|
9
|
-
console.log(value, numRows);
|
|
10
9
|
return (_jsx(Card, { className: cn(`hover:border-foreground relative flex cursor-pointer flex-col items-center justify-center rounded-sm border px-2 py-2 transition-colors`, className), onClick: onClick, children: _jsx("div", { className: "mt-0 flex w-full flex-col gap-2 px-2", children: _jsxs("div", { className: "w-full overflow-auto", children: [_jsxs("div", { className: "relative mb-2 flex h-[30px] cursor-pointer flex-row items-center gap-1 overflow-hidden", children: [_jsx("div", { className: "text-foreground mb-1 flex-1 overflow-hidden text-ellipsis whitespace-nowrap py-1 font-mono text-sm font-bold", children: value.tableName }), menuRenderer ? (_jsx("div", { className: "flex-none", children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { size: "icon", variant: "ghost", className: "text-muted-foreground h-6 w-6", children: _jsx(EllipsisIcon, { className: "h-5 w-5" }) }) }), _jsx(DropdownMenuContent, { align: "end", children: menuRenderer(value) })] }) })) : null] }), _jsx("div", { className: "flex flex-col gap-1", children: value.columns?.map((row, i) => (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("div", { className: "hover:bg-foreground/10 flex items-center gap-3 rounded-sm font-mono", children: [_jsx(Badge, { variant: "secondary", className: "text-muted-foreground w-[70px] overflow-hidden whitespace-nowrap px-1 py-0 text-xs", children: row.type }), _jsx("div", { className: "max-w-[100px] text-xs", children: row.name })] }) }), _jsx(TooltipContent, { className: "max-w-[250px]", side: "right", align: "center", children: _jsxs("div", { className: "flex flex-col gap-1 font-mono", children: [_jsx("div", { className: "text-sm font-bold", children: row.name }), _jsx("div", { className: "text-muted-foreground text-xs", children: row.type })] }) })] }, i))) }), (typeof numRows === 'bigint' ||
|
|
11
10
|
(numRows !== undefined && Number.isFinite(numRows))) && (_jsx("div", { className: "mt-1 text-right text-xs", children: `${formatNumber(numRows)} rows` }))] }) }) }));
|
|
12
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCard.js","sourceRoot":"","sources":["../../src/data-sources/TableCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,EAAE,EACF,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAQ1C,MAAM,SAAS,GAQV,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAC,EAAE,EAAE;IAC3D,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC;IAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"TableCard.js","sourceRoot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AAE,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAC9B,MAAC,OAAO,eACN,KAAC,cAAc,IAAC,OAAO,kBACrB,eAAK,SAAS,EAAC,qEAAqE,aAClF,KAAC,KAAK,IACJ,OAAO,EAAC,WAAW,EACnB,SAAS,EAAC,oFAAoF,YAE7F,GAAG,CAAC,IAAI,GACH,EACR,cAAK,SAAS,EAAC,uBAAuB,YAAE,GAAG,CAAC,IAAI,GAAO,IACnD,GACS,EACjB,KAAC,cAAc,IACb,SAAS,EAAC,eAAe,EACzB,IAAI,EAAC,OAAO,EACZ,KAAK,EAAC,QAAQ,YAEd,eAAK,SAAS,EAAC,+BAA+B,aAC5C,cAAK,SAAS,EAAC,mBAAmB,YAAE,GAAG,CAAC,IAAI,GAAO,EACnD,cAAK,SAAS,EAAC,+BAA+B,YAC3C,GAAG,CAAC,IAAI,GACL,IACF,GACS,KAvBL,CAAC,CAwBL,CACX,CAAC,GACE,EACL,CAAC,OAAO,OAAO,KAAK,QAAQ;wBAC3B,CAAC,OAAO,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CACxD,cAAK,SAAS,EAAC,yBAAyB,YACrC,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,GAC5B,CACP,IACG,GACF,GACD,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAC,SAAS,EAAC,CAAC","sourcesContent":["import {\n Badge,\n Button,\n Card,\n cn,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuTrigger,\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from '@sqlrooms/ui';\nimport {DataTable} from '@sqlrooms/duckdb';\nimport {formatNumber} from '@sqlrooms/utils';\nimport {EllipsisIcon} from 'lucide-react';\nimport React, {FC} from 'react';\n\nexport type TableAction = {\n icon: React.FC<{className: string}>;\n label: string;\n onClick: (tableName: string) => void;\n};\nconst TableCard: FC<{\n isReadOnly?: boolean;\n value?: DataTable;\n rowCount?: number;\n onReset?: () => void;\n onClick?: () => void;\n className?: string;\n menuRenderer?: (v: DataTable) => React.ReactNode;\n}> = ({value, rowCount, onClick, className, menuRenderer}) => {\n if (!value) return null;\n\n const numRows = value.rowCount ?? rowCount;\n return (\n <Card\n className={cn(\n `hover:border-foreground relative flex cursor-pointer flex-col items-center justify-center rounded-sm border px-2 py-2 transition-colors`,\n className,\n )}\n onClick={onClick}\n >\n <div className=\"mt-0 flex w-full flex-col gap-2 px-2\">\n <div className=\"w-full overflow-auto\">\n <div className=\"relative mb-2 flex h-[30px] cursor-pointer flex-row items-center gap-1 overflow-hidden\">\n <div className=\"text-foreground mb-1 flex-1 overflow-hidden text-ellipsis whitespace-nowrap py-1 font-mono text-sm font-bold\">\n {value.tableName}\n </div>\n {menuRenderer ? (\n <div className=\"flex-none\">\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n size=\"icon\"\n variant=\"ghost\"\n className=\"text-muted-foreground h-6 w-6\"\n >\n <EllipsisIcon className=\"h-5 w-5\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n {menuRenderer(value)}\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n ) : null}\n </div>\n <div className=\"flex flex-col gap-1\">\n {value.columns?.map((row, i) => (\n <Tooltip key={i}>\n <TooltipTrigger asChild>\n <div className=\"hover:bg-foreground/10 flex items-center gap-3 rounded-sm font-mono\">\n <Badge\n variant=\"secondary\"\n className=\"text-muted-foreground w-[70px] overflow-hidden whitespace-nowrap px-1 py-0 text-xs\"\n >\n {row.type}\n </Badge>\n <div className=\"max-w-[100px] text-xs\">{row.name}</div>\n </div>\n </TooltipTrigger>\n <TooltipContent\n className=\"max-w-[250px]\"\n side=\"right\"\n align=\"center\"\n >\n <div className=\"flex flex-col gap-1 font-mono\">\n <div className=\"text-sm font-bold\">{row.name}</div>\n <div className=\"text-muted-foreground text-xs\">\n {row.type}\n </div>\n </div>\n </TooltipContent>\n </Tooltip>\n ))}\n </div>\n {(typeof numRows === 'bigint' ||\n (numRows !== undefined && Number.isFinite(numRows))) && (\n <div className=\"mt-1 text-right text-xs\">\n {`${formatNumber(numRows)} rows`}\n </div>\n )}\n </div>\n </div>\n </Card>\n );\n};\n\nexport {TableCard};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqlrooms/room-shell",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.22",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"typedoc": "typedoc"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@sqlrooms/data-table": "0.24.
|
|
29
|
-
"@sqlrooms/duckdb": "0.24.
|
|
30
|
-
"@sqlrooms/layout": "0.24.
|
|
31
|
-
"@sqlrooms/layout-config": "0.24.
|
|
32
|
-
"@sqlrooms/room-config": "0.24.
|
|
33
|
-
"@sqlrooms/room-store": "0.24.
|
|
34
|
-
"@sqlrooms/ui": "0.24.
|
|
35
|
-
"@sqlrooms/utils": "0.24.
|
|
28
|
+
"@sqlrooms/data-table": "0.24.22",
|
|
29
|
+
"@sqlrooms/duckdb": "0.24.22",
|
|
30
|
+
"@sqlrooms/layout": "0.24.22",
|
|
31
|
+
"@sqlrooms/layout-config": "0.24.22",
|
|
32
|
+
"@sqlrooms/room-config": "0.24.22",
|
|
33
|
+
"@sqlrooms/room-store": "0.24.22",
|
|
34
|
+
"@sqlrooms/ui": "0.24.22",
|
|
35
|
+
"@sqlrooms/utils": "0.24.22",
|
|
36
36
|
"apache-arrow": "17.0.0",
|
|
37
37
|
"immer": "^10.1.1",
|
|
38
38
|
"lucide-react": "^0.474.0",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"react": ">=18"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "bc633cde7574270b679cb6c3d9ce9b496a634133"
|
|
47
47
|
}
|