blimpui 0.0.18 → 0.0.19

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,5 +1,5 @@
1
1
  import { TableProps } from "./types";
2
- export declare function DesktopTable<T>({ data, columns, handlePress, keyExtractor, className, headerRowClassName, rowClassName, bodyClassName, totalPages, currentPage, onPageChange, paginationProps, }: Pick<TableProps<T>, "data" | "columns" | "keyExtractor" | "className" | "headerRowClassName" | "rowClassName" | "bodyClassName" | "totalPages" | "currentPage" | "onPageChange" | "paginationProps"> & {
2
+ export declare function DesktopTable<T>({ data, columns, handlePress, keyExtractor, className, headerRowClassName, rowClassName, bodyClassName, totalPages, currentPage, onPageChange, paginationProps, isLoading, renderSkeleton, renderEmptyState, showEmptyState, emptyStateProps, }: Pick<TableProps<T>, "data" | "columns" | "keyExtractor" | "className" | "headerRowClassName" | "rowClassName" | "bodyClassName" | "totalPages" | "currentPage" | "onPageChange" | "paginationProps" | "isLoading" | "renderSkeleton" | "renderEmptyState" | "showEmptyState" | "emptyStateProps"> & {
3
3
  handlePress?: (row: T) => void;
4
4
  }): import("react/jsx-runtime").JSX.Element;
5
5
  //# sourceMappingURL=DesktopTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DesktopTable.d.ts","sourceRoot":"","sources":["../../../../../$/components/ui/table/DesktopTable.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC/B,IAAI,EACJ,OAAO,EACP,WAAW,EACX,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,EACX,YAAY,EACZ,eAAe,GACf,EAAE,IAAI,CACN,UAAU,CAAC,CAAC,CAAC,EACX,MAAM,GACN,SAAS,GACT,cAAc,GACd,WAAW,GACX,oBAAoB,GACpB,cAAc,GACd,eAAe,GACf,YAAY,GACZ,aAAa,GACb,cAAc,GACd,iBAAiB,CACnB,GAAG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;CAC/B,2CA8EA"}
1
+ {"version":3,"file":"DesktopTable.d.ts","sourceRoot":"","sources":["../../../../../$/components/ui/table/DesktopTable.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAKrC,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC/B,IAAI,EACJ,OAAO,EACP,WAAW,EACX,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,EACX,YAAY,EACZ,eAAe,EACf,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,cAAqB,EACrB,eAAe,GACf,EAAE,IAAI,CACN,UAAU,CAAC,CAAC,CAAC,EACX,MAAM,GACN,SAAS,GACT,cAAc,GACd,WAAW,GACX,oBAAoB,GACpB,cAAc,GACd,eAAe,GACf,YAAY,GACZ,aAAa,GACb,cAAc,GACd,iBAAiB,GACjB,WAAW,GACX,gBAAgB,GAChB,kBAAkB,GAClB,gBAAgB,GAChB,iBAAiB,CACnB,GAAG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;CAC/B,2CA8FA"}
@@ -15,19 +15,21 @@ import { cn } from "../../../lib/utils";
15
15
  import * as TablePrimitive from "../../primitives/table";
16
16
  import { Pagination } from "../pagination";
17
17
  import { TableCellRenderer } from "./TableCellRenderer";
18
+ import { DesktopSkeleton } from "./TableSkeleton";
19
+ import { DesktopEmptyState } from "./TableEmptyState";
18
20
  export function DesktopTable(_a) {
19
- var data = _a.data, columns = _a.columns, handlePress = _a.handlePress, keyExtractor = _a.keyExtractor, className = _a.className, headerRowClassName = _a.headerRowClassName, rowClassName = _a.rowClassName, bodyClassName = _a.bodyClassName, totalPages = _a.totalPages, currentPage = _a.currentPage, onPageChange = _a.onPageChange, paginationProps = _a.paginationProps;
21
+ var data = _a.data, columns = _a.columns, handlePress = _a.handlePress, keyExtractor = _a.keyExtractor, className = _a.className, headerRowClassName = _a.headerRowClassName, rowClassName = _a.rowClassName, bodyClassName = _a.bodyClassName, totalPages = _a.totalPages, currentPage = _a.currentPage, onPageChange = _a.onPageChange, paginationProps = _a.paginationProps, isLoading = _a.isLoading, renderSkeleton = _a.renderSkeleton, renderEmptyState = _a.renderEmptyState, _b = _a.showEmptyState, showEmptyState = _b === void 0 ? true : _b, emptyStateProps = _a.emptyStateProps;
20
22
  return (_jsxs(View, { className: cn("w-full overflow-hidden not-sm:rounded-md", className), children: [_jsxs(TablePrimitive.Root, { children: [_jsx(TablePrimitive.Header, { children: _jsx(TablePrimitive.Row, { className: cn("flex-row border-b-0 bg-muted/50 hover:bg-muted/50", headerRowClassName), children: columns.map(function (col, index) {
21
23
  var _a;
22
24
  return (_jsx(TablePrimitive.Head, { className: cn("flex-1 py-4 justify-center px-4", col.className, col.headerClassName), children: typeof col.header === "string" ? (_jsx(Text, { className: "text-muted-foreground text-sm font-medium", children: col.header })) : (col.header) }, col.id || ((_a = col.accessorKey) === null || _a === void 0 ? void 0 : _a.toString()) || index));
23
- }) }) }), _jsx(TablePrimitive.Body, { className: bodyClassName, children: data.map(function (row, rowIndex) { return (_jsx(TablePrimitive.Row, { className: cn("flex-row border-b border-border text-foreground transition-colors hover:bg-muted/50", handlePress && "cursor-pointer", typeof rowClassName === "function"
25
+ }) }) }), _jsx(TablePrimitive.Body, { className: bodyClassName, children: isLoading ? (renderSkeleton ? (renderSkeleton()) : (_jsx(DesktopSkeleton, { columns: columns }))) : data.length === 0 ? (showEmptyState ? (renderEmptyState ? (renderEmptyState()) : (_jsx(DesktopEmptyState, __assign({}, emptyStateProps)))) : null) : (data.map(function (row, rowIndex) { return (_jsx(TablePrimitive.Row, { className: cn("flex-row border-b border-border text-foreground transition-colors hover:bg-muted/50", handlePress && "cursor-pointer", typeof rowClassName === "function"
24
26
  ? rowClassName(row, rowIndex)
25
27
  : rowClassName), onPress: handlePress ? function () { return handlePress(row); } : undefined, children: columns.map(function (col, colIndex) {
26
28
  var _a;
27
29
  return (_jsx(TablePrimitive.Cell, { className: cn("flex-1 justify-center p-4", col.className, col.cellClassName), children: _jsx(TableCellRenderer, { row: row, column: col }) }, col.id || ((_a = col.accessorKey) === null || _a === void 0 ? void 0 : _a.toString()) || colIndex));
28
30
  }) }, keyExtractor
29
31
  ? keyExtractor(row, rowIndex)
30
- : rowIndex)); }) })] }), totalPages !== undefined &&
32
+ : rowIndex)); })) })] }), totalPages !== undefined &&
31
33
  currentPage !== undefined &&
32
34
  onPageChange !== undefined && (_jsx(View, { className: "border-t border-border p-4", children: _jsx(Pagination, __assign({ totalPages: totalPages, currentPage: currentPage, onPageChange: onPageChange }, paginationProps)) }))] }));
33
35
  }
@@ -1,5 +1,6 @@
1
+ import * as React from "react";
1
2
  import { TableProps } from "./types";
2
- export declare function MobileTable<T>({ data, columns, handlePress, keyExtractor, bodyClassName, rowClassName, mobileCardClassName, mobileHeaderClassName, mobileBodyClassName, onEndReached, onEndReachedThreshold, }: Pick<TableProps<T>, "data" | "columns" | "keyExtractor" | "bodyClassName" | "rowClassName" | "mobileCardClassName" | "mobileHeaderClassName" | "mobileBodyClassName" | "onEndReached" | "onEndReachedThreshold"> & {
3
+ export declare function MobileTable<T>({ data, columns, handlePress, keyExtractor, bodyClassName, rowClassName, mobileCardClassName, mobileHeaderClassName, mobileBodyClassName, onEndReached, onEndReachedThreshold, isLoading, renderSkeleton, renderEmptyState, showEmptyState, emptyStateProps, }: Pick<TableProps<T>, "data" | "columns" | "keyExtractor" | "bodyClassName" | "rowClassName" | "mobileCardClassName" | "mobileHeaderClassName" | "mobileBodyClassName" | "onEndReached" | "onEndReachedThreshold" | "isLoading" | "renderSkeleton" | "renderEmptyState" | "showEmptyState" | "emptyStateProps"> & {
3
4
  handlePress?: (row: T) => void;
4
- }): import("react/jsx-runtime").JSX.Element;
5
+ }): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>>;
5
6
  //# sourceMappingURL=MobileTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MobileTable.d.ts","sourceRoot":"","sources":["../../../../../$/components/ui/table/MobileTable.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,wBAAgB,WAAW,CAAC,CAAC,EAAE,EAC9B,IAAI,EACJ,OAAO,EACP,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,qBAAqB,GACrB,EAAE,IAAI,CACN,UAAU,CAAC,CAAC,CAAC,EACX,MAAM,GACN,SAAS,GACT,cAAc,GACd,eAAe,GACf,cAAc,GACd,qBAAqB,GACrB,uBAAuB,GACvB,qBAAqB,GACrB,cAAc,GACd,uBAAuB,CACzB,GAAG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;CAC/B,2CA6EA"}
1
+ {"version":3,"file":"MobileTable.d.ts","sourceRoot":"","sources":["../../../../../$/components/ui/table/MobileTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,wBAAgB,WAAW,CAAC,CAAC,EAAE,EAC9B,IAAI,EACJ,OAAO,EACP,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,qBAAqB,EACrB,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,cAAqB,EACrB,eAAe,GACf,EAAE,IAAI,CACN,UAAU,CAAC,CAAC,CAAC,EACX,MAAM,GACN,SAAS,GACT,cAAc,GACd,eAAe,GACf,cAAc,GACd,qBAAqB,GACrB,uBAAuB,GACvB,qBAAqB,GACrB,cAAc,GACd,uBAAuB,GACvB,WAAW,GACX,gBAAgB,GAChB,kBAAkB,GAClB,gBAAgB,GAChB,iBAAiB,CACnB,GAAG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;CAC/B,mRA0FA"}
@@ -1,10 +1,31 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
13
  import { LegendList } from "@legendapp/list";
3
14
  import { Pressable, Text, View } from "react-native";
4
15
  import { cn } from "../../../lib/utils";
5
16
  import { TableCellRenderer } from "./TableCellRenderer";
17
+ import { MobileEmptyState } from "./TableEmptyState";
18
+ import { MobileSkeleton } from "./TableSkeleton";
6
19
  export function MobileTable(_a) {
7
- var data = _a.data, columns = _a.columns, handlePress = _a.handlePress, keyExtractor = _a.keyExtractor, bodyClassName = _a.bodyClassName, rowClassName = _a.rowClassName, mobileCardClassName = _a.mobileCardClassName, mobileHeaderClassName = _a.mobileHeaderClassName, mobileBodyClassName = _a.mobileBodyClassName, onEndReached = _a.onEndReached, onEndReachedThreshold = _a.onEndReachedThreshold;
20
+ var data = _a.data, columns = _a.columns, handlePress = _a.handlePress, keyExtractor = _a.keyExtractor, bodyClassName = _a.bodyClassName, rowClassName = _a.rowClassName, mobileCardClassName = _a.mobileCardClassName, mobileHeaderClassName = _a.mobileHeaderClassName, mobileBodyClassName = _a.mobileBodyClassName, onEndReached = _a.onEndReached, onEndReachedThreshold = _a.onEndReachedThreshold, isLoading = _a.isLoading, renderSkeleton = _a.renderSkeleton, renderEmptyState = _a.renderEmptyState, _b = _a.showEmptyState, showEmptyState = _b === void 0 ? true : _b, emptyStateProps = _a.emptyStateProps;
21
+ if (isLoading) {
22
+ return renderSkeleton ? renderSkeleton() : _jsx(MobileSkeleton, {});
23
+ }
24
+ if (!isLoading && data.length === 0) {
25
+ if (showEmptyState === false)
26
+ return null;
27
+ return renderEmptyState ? (renderEmptyState()) : (_jsx(MobileEmptyState, __assign({}, emptyStateProps)));
28
+ }
8
29
  return (_jsx(LegendList, { data: data, estimatedItemSize: 200, keyExtractor: keyExtractor, className: bodyClassName, onEndReached: onEndReached, onEndReachedThreshold: onEndReachedThreshold, renderItem: function (_a) {
9
30
  var item = _a.item, index = _a.index;
10
31
  var headerColumns = columns.filter(function (col) { var _a; return (_a = col.meta) === null || _a === void 0 ? void 0 : _a.isMobileHeader; });
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ interface EmptyStateProps {
3
+ title?: string;
4
+ description?: string;
5
+ className?: string;
6
+ icon?: React.ElementType;
7
+ }
8
+ export declare function DesktopEmptyState(props: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function MobileEmptyState(props: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=TableEmptyState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableEmptyState.d.ts","sourceRoot":"","sources":["../../../../../$/components/ui/table/TableEmptyState.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,UAAU,eAAe;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;CACzB;AA8BD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,2CAQvD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,2CAEtD"}
@@ -0,0 +1,26 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { Inbox } from "lucide-react-native";
14
+ import { Text, View } from "react-native";
15
+ import { cn } from "../../../lib/utils";
16
+ import * as TablePrimitive from "../../primitives/table";
17
+ function EmptyStateContent(_a) {
18
+ var _b = _a.title, title = _b === void 0 ? "No data available" : _b, description = _a.description, className = _a.className, _c = _a.icon, Icon = _c === void 0 ? Inbox : _c;
19
+ return (_jsxs(View, { className: cn("flex-col items-center justify-center p-8 gap-1", className), children: [_jsx(View, { className: "flex h-20 w-20 items-center justify-center rounded-full bg-muted/50 mb-4", children: _jsx(Icon, { className: "h-10 w-10 text-muted-foreground", size: 40 }) }), _jsx(Text, { className: "text-muted-foreground text-center font-semibold text-lg", children: title }), description && (_jsx(Text, { className: "text-muted-foreground text-center text-sm max-w-xs", children: description }))] }));
20
+ }
21
+ export function DesktopEmptyState(props) {
22
+ return (_jsx(TablePrimitive.Row, { className: "flex-row border-b border-border hover:bg-transparent", children: _jsx(TablePrimitive.Cell, { className: "flex-1 justify-center p-0", children: _jsx(EmptyStateContent, __assign({}, props)) }) }));
23
+ }
24
+ export function MobileEmptyState(props) {
25
+ return _jsx(EmptyStateContent, __assign({}, props));
26
+ }
@@ -0,0 +1,5 @@
1
+ export declare function DesktopSkeleton({ columns }: {
2
+ columns: any[];
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ export declare function MobileSkeleton(): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=TableSkeleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableSkeleton.d.ts","sourceRoot":"","sources":["../../../../../$/components/ui/table/TableSkeleton.tsx"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,GAAG,EAAE,CAAA;CAAE,2CAwB9D;AAED,wBAAgB,cAAc,4CA2B7B"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { View } from "react-native";
3
+ import { cn } from "../../../lib/utils";
4
+ import * as TablePrimitive from "../../primitives/table";
5
+ import { Skeleton } from "../skeleton";
6
+ export function DesktopSkeleton(_a) {
7
+ var columns = _a.columns;
8
+ return (_jsx(_Fragment, { children: Array.from({ length: 5 }).map(function (_, i) { return (_jsx(TablePrimitive.Row, { className: "flex-row border-b border-border hover:bg-transparent", children: columns.map(function (col, j) { return (_jsx(TablePrimitive.Cell, { className: cn("flex-1 px-4 py-4", col.className, col.cellClassName), children: _jsx(Skeleton, { className: "h-4 w-full" }) }, "skeleton-cell-".concat(i, "-").concat(j))); }) }, "skeleton-row-".concat(i))); }) }));
9
+ }
10
+ export function MobileSkeleton() {
11
+ return (_jsx(View, { className: "gap-4", children: Array.from({ length: 3 }).map(function (_, i) { return (_jsxs(View, { className: "mb-4 rounded-xl border border-border bg-card p-4", children: [_jsxs(View, { className: "mb-4 flex-row items-center justify-between border-b border-border pb-4", children: [_jsx(Skeleton, { className: "h-4 w-1/3" }), _jsx(Skeleton, { className: "h-4 w-1/4" })] }), _jsx(View, { className: "gap-4", children: Array.from({ length: 3 }).map(function (__, j) { return (_jsxs(View, { className: "flex-row items-center justify-between", children: [_jsx(Skeleton, { className: "h-3 w-1/4" }), _jsx(Skeleton, { className: "h-3 w-1/2" })] }, "mobile-skeleton-row-".concat(i, "-").concat(j))); }) })] }, "mobile-skeleton-".concat(i))); }) }));
12
+ }
@@ -1,4 +1,4 @@
1
1
  import { TableProps } from "./types";
2
- export declare function Table<T>({ data, columns, mobileBreakpoint, onRowPress, onItemPress, totalPages, currentPage, onPageChange, paginationProps, onEndReached, onEndReachedThreshold, ...props }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
2
+ export declare function Table<T>({ data, columns, mobileBreakpoint, onRowPress, onItemPress, totalPages, currentPage, onPageChange, paginationProps, onEndReached, onEndReachedThreshold, isLoading, renderSkeleton, renderEmptyState, showEmptyState, emptyStateProps, ...props }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
3
3
  export * from "./types";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../$/components/ui/table/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,wBAAgB,KAAK,CAAC,CAAC,EAAE,EACxB,IAAI,EACJ,OAAO,EACP,gBAAsB,EACtB,UAAU,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,GAAG,KAAK,EACR,EAAE,UAAU,CAAC,CAAC,CAAC,2CA8Bf;AAED,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../$/components/ui/table/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,wBAAgB,KAAK,CAAC,CAAC,EAAE,EACxB,IAAI,EACJ,OAAO,EACP,gBAAsB,EACtB,UAAU,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,GAAG,KAAK,EACR,EAAE,UAAU,CAAC,CAAC,CAAC,2CAwCf;AAED,cAAc,SAAS,CAAC"}
@@ -25,13 +25,13 @@ import { useWindowDimensions } from "react-native";
25
25
  import { DesktopTable } from "./DesktopTable";
26
26
  import { MobileTable } from "./MobileTable";
27
27
  export function Table(_a) {
28
- var data = _a.data, columns = _a.columns, _b = _a.mobileBreakpoint, mobileBreakpoint = _b === void 0 ? 768 : _b, onRowPress = _a.onRowPress, onItemPress = _a.onItemPress, totalPages = _a.totalPages, currentPage = _a.currentPage, onPageChange = _a.onPageChange, paginationProps = _a.paginationProps, onEndReached = _a.onEndReached, onEndReachedThreshold = _a.onEndReachedThreshold, props = __rest(_a, ["data", "columns", "mobileBreakpoint", "onRowPress", "onItemPress", "totalPages", "currentPage", "onPageChange", "paginationProps", "onEndReached", "onEndReachedThreshold"]);
28
+ var data = _a.data, columns = _a.columns, _b = _a.mobileBreakpoint, mobileBreakpoint = _b === void 0 ? 768 : _b, onRowPress = _a.onRowPress, onItemPress = _a.onItemPress, totalPages = _a.totalPages, currentPage = _a.currentPage, onPageChange = _a.onPageChange, paginationProps = _a.paginationProps, onEndReached = _a.onEndReached, onEndReachedThreshold = _a.onEndReachedThreshold, isLoading = _a.isLoading, renderSkeleton = _a.renderSkeleton, renderEmptyState = _a.renderEmptyState, showEmptyState = _a.showEmptyState, emptyStateProps = _a.emptyStateProps, props = __rest(_a, ["data", "columns", "mobileBreakpoint", "onRowPress", "onItemPress", "totalPages", "currentPage", "onPageChange", "paginationProps", "onEndReached", "onEndReachedThreshold", "isLoading", "renderSkeleton", "renderEmptyState", "showEmptyState", "emptyStateProps"]);
29
29
  var width = useWindowDimensions().width;
30
30
  var isMobile = width < mobileBreakpoint;
31
31
  var handlePress = onItemPress || onRowPress;
32
32
  if (isMobile) {
33
- return (_jsx(MobileTable, __assign({ data: data, columns: columns, handlePress: handlePress, onEndReached: onEndReached, onEndReachedThreshold: onEndReachedThreshold }, props)));
33
+ return (_jsx(MobileTable, __assign({ data: data, columns: columns, handlePress: handlePress, onEndReached: onEndReached, onEndReachedThreshold: onEndReachedThreshold, isLoading: isLoading, renderSkeleton: renderSkeleton, renderEmptyState: renderEmptyState, showEmptyState: showEmptyState, emptyStateProps: emptyStateProps }, props)));
34
34
  }
35
- return (_jsx(DesktopTable, __assign({ data: data, columns: columns, handlePress: handlePress, totalPages: totalPages, currentPage: currentPage, onPageChange: onPageChange, paginationProps: paginationProps }, props)));
35
+ return (_jsx(DesktopTable, __assign({ data: data, columns: columns, handlePress: handlePress, totalPages: totalPages, currentPage: currentPage, onPageChange: onPageChange, paginationProps: paginationProps, isLoading: isLoading, renderSkeleton: renderSkeleton, renderEmptyState: renderEmptyState, showEmptyState: showEmptyState, emptyStateProps: emptyStateProps }, props)));
36
36
  }
37
37
  export * from "./types";
@@ -37,5 +37,15 @@ export interface TableProps<T> {
37
37
  paginationProps?: Partial<PaginationProps>;
38
38
  onEndReached?: () => void;
39
39
  onEndReachedThreshold?: number;
40
+ isLoading?: boolean;
41
+ renderSkeleton?: () => React.ReactNode;
42
+ renderEmptyState?: () => React.ReactNode;
43
+ showEmptyState?: boolean;
44
+ emptyStateProps?: {
45
+ title?: string;
46
+ description?: string;
47
+ icon?: React.ElementType;
48
+ className?: string;
49
+ };
40
50
  }
41
51
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../$/components/ui/table/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,WAAW,WAAW,CAAC,CAAC;IAC7B,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC;IACzD,EAAE,CAAC,EAAE,MAAM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AAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IAC5D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAG7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAG3C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAG/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACvC,gBAAgB,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACzC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;QACzB,SAAS,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blimpui",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",