@raystack/apsara 0.10.10 → 0.11.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 +22 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +15 -11
- package/dist/index.js +22 -16
- package/dist/index.js.map +1 -1
- package/dist/table/datatable.d.ts +2 -1
- package/dist/table/datatable.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -15346,7 +15346,7 @@ const TextField = ({ leading, className, src, size, state, style, ...props }) =>
|
|
|
15346
15346
|
};
|
|
15347
15347
|
TextField.displayName = "TextField";
|
|
15348
15348
|
|
|
15349
|
-
var styles$3 = {"wrapper":"datatable-module_wrapper__Sxg2d","datatable":"datatable-module_datatable__z-Th2","
|
|
15349
|
+
var styles$3 = {"wrapper":"datatable-module_wrapper__Sxg2d","datatable":"datatable-module_datatable__z-Th2","table":"datatable-module_table__x2IkY","head":"datatable-module_head__zCfCW","toolbar":"datatable-module_toolbar__lO-aI","chip":"datatable-module_chip__IiwTD"};
|
|
15350
15350
|
|
|
15351
15351
|
const FilteredChip = ({ column }) => {
|
|
15352
15352
|
const { table, removeFilterColumn } = useTable();
|
|
@@ -15454,7 +15454,7 @@ const useTableColumn = () => {
|
|
|
15454
15454
|
};
|
|
15455
15455
|
};
|
|
15456
15456
|
|
|
15457
|
-
var styles$2 = {"table":"table-module_table__mqnXB","caption":"table-module_caption__xw-5e","header":"table-module_header__YGJoz","head":"table-module_head__zosk-","
|
|
15457
|
+
var styles$2 = {"table":"table-module_table__mqnXB","caption":"table-module_caption__xw-5e","header":"table-module_header__YGJoz","head":"table-module_head__zosk-","cell":"table-module_cell__-FP3s"};
|
|
15458
15458
|
|
|
15459
15459
|
const table = cva(styles$2.table);
|
|
15460
15460
|
const TableRoot = React__namespace.forwardRef(({ className, ...props }, ref) => (jsxRuntimeExports.jsx("div", { style: { width: "100%", overflow: "auto" }, children: jsxRuntimeExports.jsx("table", { ref: ref, className: table({ className }), ...props }) })));
|
|
@@ -15490,11 +15490,12 @@ const Table = Object.assign(TableRoot, {
|
|
|
15490
15490
|
Caption: TableCaption,
|
|
15491
15491
|
});
|
|
15492
15492
|
|
|
15493
|
-
function DataTableRoot({ columns, data, emptyState, children, parentStyle, ...props }) {
|
|
15493
|
+
function DataTableRoot({ columns, data, emptyState, children, parentStyle, ShouldShowHeader = true, ...props }) {
|
|
15494
15494
|
const convertedChildren = React.Children.toArray(children);
|
|
15495
|
-
const header = convertedChildren.find((child) => child.type === DataTableToolbar) ||
|
|
15496
|
-
const footer = convertedChildren.find((child) => child.type === DataTableFooter) ||
|
|
15497
|
-
const detail = convertedChildren.find((child) => child.type === TableDetailContainer) ||
|
|
15495
|
+
const header = convertedChildren.find((child) => child.type === DataTableToolbar) || null;
|
|
15496
|
+
const footer = convertedChildren.find((child) => child.type === DataTableFooter) || null;
|
|
15497
|
+
const detail = convertedChildren.find((child) => child.type === TableDetailContainer) ||
|
|
15498
|
+
null;
|
|
15498
15499
|
const [sorting, setSorting] = React.useState([]);
|
|
15499
15500
|
const [columnFilters, setColumnFilters] = React.useState([]);
|
|
15500
15501
|
const [columnVisibility, setColumnVisibility] = React.useState({});
|
|
@@ -15506,6 +15507,7 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, ...pr
|
|
|
15506
15507
|
columns,
|
|
15507
15508
|
globalFilterFn: "auto",
|
|
15508
15509
|
enableRowSelection: true,
|
|
15510
|
+
manualPagination: true,
|
|
15509
15511
|
onGlobalFilterChange: setGlobalFilter,
|
|
15510
15512
|
onSortingChange: setSorting,
|
|
15511
15513
|
onColumnFiltersChange: setColumnFilters,
|
|
@@ -15525,6 +15527,7 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, ...pr
|
|
|
15525
15527
|
rowSelection,
|
|
15526
15528
|
},
|
|
15527
15529
|
});
|
|
15530
|
+
console.log(table.getRowModel().rows?.length);
|
|
15528
15531
|
return (jsxRuntimeExports.jsx(Flex, { direction: "column", justify: "between", className: styles$3.wrapper, children: jsxRuntimeExports.jsxs(TableContext.Provider, { value: {
|
|
15529
15532
|
table,
|
|
15530
15533
|
globalFilter,
|
|
@@ -15534,16 +15537,19 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, ...pr
|
|
|
15534
15537
|
resetColumns,
|
|
15535
15538
|
onGlobalFilterChange: setGlobalFilter,
|
|
15536
15539
|
onChange: () => ({}),
|
|
15537
|
-
}, children: [jsxRuntimeExports.jsxs(Flex, { direction: "column", className: styles$3.datatable, children: [header, jsxRuntimeExports.jsxs(Flex, { style: parentStyle, children: [jsxRuntimeExports.jsxs(Table, { ...props, children: [jsxRuntimeExports.jsx(Table.Header, { children:
|
|
15538
|
-
|
|
15539
|
-
|
|
15540
|
-
|
|
15541
|
-
|
|
15542
|
-
|
|
15543
|
-
|
|
15544
|
-
|
|
15545
|
-
|
|
15546
|
-
|
|
15540
|
+
}, children: [jsxRuntimeExports.jsxs(Flex, { direction: "column", className: styles$3.datatable, children: [header, jsxRuntimeExports.jsxs(Flex, { className: styles$3.tableContainer, style: parentStyle, children: [jsxRuntimeExports.jsxs(Table, { ...props, children: [jsxRuntimeExports.jsx(Table.Header, { children: ShouldShowHeader
|
|
15541
|
+
? table.getHeaderGroups().map((headerGroup) => (jsxRuntimeExports.jsx(Table.Row, { children: headerGroup.headers.map((header) => {
|
|
15542
|
+
return (jsxRuntimeExports.jsx(Table.Head, { style: {
|
|
15543
|
+
...(header.column.columnDef?.meta?.style ?? {}),
|
|
15544
|
+
}, children: jsxRuntimeExports.jsxs(Text, { className: styles$3.head, children: [header.isPlaceholder
|
|
15545
|
+
? null
|
|
15546
|
+
: flexRender(header.column.columnDef.header, header.getContext()), {
|
|
15547
|
+
asc: jsxRuntimeExports.jsx(ArrowUpIcon, {}),
|
|
15548
|
+
desc: jsxRuntimeExports.jsx(ArrowDownIcon, {}),
|
|
15549
|
+
}[header.column.getIsSorted()] ??
|
|
15550
|
+
null] }) }, header.id));
|
|
15551
|
+
}) }, headerGroup.id)))
|
|
15552
|
+
: null }), jsxRuntimeExports.jsx(Table.Body, { children: table.getRowModel().rows?.length ? (table.getRowModel().rows.map((row) => (jsxRuntimeExports.jsx(Table.Row, { "data-state": row.getIsSelected() && "selected", children: row.getVisibleCells().map((cell) => (jsxRuntimeExports.jsx(Table.Cell, { style: {
|
|
15547
15553
|
...(cell.column.columnDef?.meta?.style ?? {}),
|
|
15548
15554
|
}, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) : (jsxRuntimeExports.jsx(Table.Row, { children: jsxRuntimeExports.jsx(Table.Cell, { colSpan: columns.length, children: emptyState || "No results." }) })) })] }), detail] })] }), footer] }) }));
|
|
15549
15555
|
}
|