@flytedan/flytebot-design-system 0.53.0 → 0.54.0
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.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1185,7 +1185,10 @@ interface DataTableProps {
|
|
|
1185
1185
|
columns: DataTableColumn[];
|
|
1186
1186
|
rows: any[];
|
|
1187
1187
|
compact?: boolean;
|
|
1188
|
-
|
|
1188
|
+
/** Keys (row[rowKey]) of every selected row; each gets aria-selected and the selected styling. */
|
|
1189
|
+
selectedIds?: ReadonlyArray<string | number>;
|
|
1190
|
+
/** Per-row title (native tooltip), e.g. "Click to add to / remove from filter". */
|
|
1191
|
+
rowTitle?: (row: any) => string;
|
|
1189
1192
|
onRowClick?: (row: any) => void;
|
|
1190
1193
|
rowKey?: string;
|
|
1191
1194
|
/** First load: nothing on screen yet, so skeleton rows are drawn. */
|
|
@@ -1201,7 +1204,7 @@ interface DataTableProps {
|
|
|
1201
1204
|
onSort?: (key: string) => void;
|
|
1202
1205
|
className?: string;
|
|
1203
1206
|
}
|
|
1204
|
-
declare function DataTable({ columns, rows, compact,
|
|
1207
|
+
declare function DataTable({ columns, rows, compact, selectedIds, rowTitle, onRowClick, rowKey, loading, refreshing, skeletonRows, sort, onSort, className, ...rest }: DataTableProps): React.JSX.Element;
|
|
1205
1208
|
|
|
1206
1209
|
interface FilterFieldOption {
|
|
1207
1210
|
value: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1185,7 +1185,10 @@ interface DataTableProps {
|
|
|
1185
1185
|
columns: DataTableColumn[];
|
|
1186
1186
|
rows: any[];
|
|
1187
1187
|
compact?: boolean;
|
|
1188
|
-
|
|
1188
|
+
/** Keys (row[rowKey]) of every selected row; each gets aria-selected and the selected styling. */
|
|
1189
|
+
selectedIds?: ReadonlyArray<string | number>;
|
|
1190
|
+
/** Per-row title (native tooltip), e.g. "Click to add to / remove from filter". */
|
|
1191
|
+
rowTitle?: (row: any) => string;
|
|
1189
1192
|
onRowClick?: (row: any) => void;
|
|
1190
1193
|
rowKey?: string;
|
|
1191
1194
|
/** First load: nothing on screen yet, so skeleton rows are drawn. */
|
|
@@ -1201,7 +1204,7 @@ interface DataTableProps {
|
|
|
1201
1204
|
onSort?: (key: string) => void;
|
|
1202
1205
|
className?: string;
|
|
1203
1206
|
}
|
|
1204
|
-
declare function DataTable({ columns, rows, compact,
|
|
1207
|
+
declare function DataTable({ columns, rows, compact, selectedIds, rowTitle, onRowClick, rowKey, loading, refreshing, skeletonRows, sort, onSort, className, ...rest }: DataTableProps): React.JSX.Element;
|
|
1205
1208
|
|
|
1206
1209
|
interface FilterFieldOption {
|
|
1207
1210
|
value: string;
|
package/dist/index.js
CHANGED
|
@@ -2937,7 +2937,8 @@ function DataTable({
|
|
|
2937
2937
|
columns = [],
|
|
2938
2938
|
rows = [],
|
|
2939
2939
|
compact: compact3 = false,
|
|
2940
|
-
|
|
2940
|
+
selectedIds,
|
|
2941
|
+
rowTitle,
|
|
2941
2942
|
onRowClick,
|
|
2942
2943
|
rowKey = "id",
|
|
2943
2944
|
loading = false,
|
|
@@ -2974,7 +2975,8 @@ function DataTable({
|
|
|
2974
2975
|
/* @__PURE__ */ jsx43("tbody", { className: stale ? "fd-stale" : void 0, children: loading ? Array.from({ length: skeletonRows }).map((_, i) => /* @__PURE__ */ jsx43("tr", { children: columns.map((c) => /* @__PURE__ */ jsx43("td", { className: c.numeric ? "is-num" : "", children: /* @__PURE__ */ jsx43("span", { className: "fd-skel fd-skel-text", style: { display: "inline-block", height: 13, width: c.numeric ? 52 : i % 3 === 0 ? "72%" : "88%" } }) }, c.key)) }, i)) : rows.map((r) => /* @__PURE__ */ jsx43(
|
|
2975
2976
|
"tr",
|
|
2976
2977
|
{
|
|
2977
|
-
"aria-selected":
|
|
2978
|
+
"aria-selected": selectedIds?.includes(r[rowKey]) ? "true" : void 0,
|
|
2979
|
+
title: rowTitle ? rowTitle(r) : void 0,
|
|
2978
2980
|
onClick: onRowClick ? () => onRowClick(r) : void 0,
|
|
2979
2981
|
style: onRowClick ? { cursor: "pointer" } : void 0,
|
|
2980
2982
|
children: columns.map((c) => /* @__PURE__ */ jsx43("td", { className: c.numeric ? "is-num" : "", children: c.render ? c.render(r) : r[c.key] }, c.key))
|