@ztwoint/z-ui 0.1.45 → 0.1.46
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/components/table/components/pagination/index.d.ts +1 -0
- package/dist/components/table/components/pagination/pagination.hook.d.ts +1 -1
- package/dist/components/table/components/pagination/pagination.hook.js +20 -16
- package/dist/components/table/components/table-filter/filters/checkbox.js +35 -51
- package/dist/components/table/components/table-filter/filters/text.js +41 -39
- package/dist/components/table/components/table-filter/index.d.ts +4 -1
- package/dist/components/table/components/table-filter/selected-filters-display/index.d.ts +2 -0
- package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.d.ts +3 -0
- package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.js +30 -0
- package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.type.d.ts +12 -0
- package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.utils.d.ts +6 -0
- package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.utils.js +26 -0
- package/dist/components/table/components/table-filter/table-filter-button.d.ts +2 -0
- package/dist/components/table/components/table-filter/table-filter-button.js +103 -0
- package/dist/components/table/components/table-filter/table-filter-column-button.d.ts +3 -0
- package/dist/components/table/components/table-filter/table-filter-column-button.js +78 -0
- package/dist/components/table/components/table-filter/table-filter-column-button.type.d.ts +3 -0
- package/dist/components/table/components/table-filter/table-filter-provider.d.ts +14 -0
- package/dist/components/table/components/table-filter/table-filter-provider.js +32 -0
- package/dist/components/table/components/table-filter/table-filter.context.d.ts +21 -0
- package/dist/components/table/components/table-filter/table-filter.context.js +13 -0
- package/dist/components/table/components/table-filter/table-filter.hook.d.ts +1 -2
- package/dist/components/table/components/table-filter/table-filter.hook.js +39 -37
- package/dist/components/table/index.d.ts +1 -2
- package/dist/components/table/table-provider.d.ts +1 -1
- package/dist/components/table/table-provider.js +13 -13
- package/dist/components/table/table.type.d.ts +2 -0
- package/dist/components/table/table.utils.d.ts +0 -1
- package/dist/components/table/table.utils.js +5 -3
- package/dist/components/table-card/table-card.js +69 -64
- package/dist/components/table-card/table-card.type.d.ts +7 -7
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/hooks/useClickOutside.d.ts +1 -0
- package/dist/hooks/useClickOutside.js +14 -0
- package/dist/index.js +107 -110
- package/dist/types/components/table/components/pagination/index.d.ts +1 -0
- package/dist/types/components/table/components/pagination/pagination.hook.d.ts +1 -1
- package/dist/types/components/table/components/table-filter/index.d.ts +4 -1
- package/dist/types/components/table/components/table-filter/selected-filters-display/index.d.ts +2 -0
- package/dist/types/components/table/components/table-filter/selected-filters-display/selected-filters-display.d.ts +3 -0
- package/dist/types/components/table/components/table-filter/selected-filters-display/selected-filters-display.type.d.ts +12 -0
- package/dist/types/components/table/components/table-filter/selected-filters-display/selected-filters-display.utils.d.ts +6 -0
- package/dist/types/components/table/components/table-filter/table-filter-button.d.ts +2 -0
- package/dist/types/components/table/components/table-filter/table-filter-column-button.d.ts +3 -0
- package/dist/types/components/table/components/table-filter/table-filter-column-button.type.d.ts +3 -0
- package/dist/types/components/table/components/table-filter/table-filter-provider.d.ts +14 -0
- package/dist/types/components/table/components/table-filter/table-filter.context.d.ts +21 -0
- package/dist/types/components/table/components/table-filter/table-filter.hook.d.ts +1 -2
- package/dist/types/components/table/index.d.ts +1 -2
- package/dist/types/components/table/table-provider.d.ts +1 -1
- package/dist/types/components/table/table.type.d.ts +2 -0
- package/dist/types/components/table/table.utils.d.ts +0 -1
- package/dist/types/components/table-card/table-card.type.d.ts +7 -7
- package/dist/types/hooks/useClickOutside.d.ts +1 -0
- package/package.json +2 -1
- package/dist/components/table/components/table-filter/table-filter.d.ts +0 -9
- package/dist/components/table/components/table-filter/table-filter.js +0 -120
- package/dist/types/components/table/components/table-filter/table-filter.d.ts +0 -9
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const o = e.createContext(
|
|
3
|
+
void 0
|
|
4
|
+
), r = () => {
|
|
5
|
+
const t = e.useContext(o);
|
|
6
|
+
if (t === void 0)
|
|
7
|
+
throw new Error("useTableFilterContext must be used within a TableFilterProvider");
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
o as TableFilterContext,
|
|
12
|
+
r as useTableFilterContext
|
|
13
|
+
};
|
|
@@ -2,16 +2,15 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { TableFilterProps } from './table-filter.type';
|
|
3
3
|
import { FilterRule } from '../../table.type';
|
|
4
4
|
declare const useTableFilter: ({ filter, schema }: TableFilterProps) => {
|
|
5
|
-
isOpen: boolean;
|
|
6
5
|
selectedColumn: string | null;
|
|
7
6
|
setSelectedColumn: React.Dispatch<React.SetStateAction<string | null>>;
|
|
8
7
|
getFilterForColumn: (columnKey: string) => FilterRule | undefined;
|
|
9
8
|
hasFilterForColumn: (columnKey: string) => boolean;
|
|
9
|
+
hasAppliedFilterForColumn: (columnKey: string) => boolean;
|
|
10
10
|
updateColumnFilter: (columnKey: string, condition?: string, value?: string | string[]) => void;
|
|
11
11
|
clearAllFilters: () => void;
|
|
12
12
|
applyFilters: () => void;
|
|
13
13
|
hasActiveFilters: boolean;
|
|
14
|
-
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
15
14
|
tempFilters: FilterRule[];
|
|
16
15
|
filterableFields: import('../../table.type').TableSchemaColumn[];
|
|
17
16
|
};
|
|
@@ -1,54 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
const [
|
|
4
|
-
|
|
5
|
-
!i &&
|
|
6
|
-
}, [i,
|
|
7
|
-
const
|
|
8
|
-
const e =
|
|
1
|
+
import u from "react";
|
|
2
|
+
const S = ({ filter: l, schema: v }) => {
|
|
3
|
+
const [i, f] = u.useState(null), [r, n] = u.useState(l.value), a = v.filter((t) => t.filterable !== !1);
|
|
4
|
+
u.useEffect(() => {
|
|
5
|
+
!i && a.length > 0 && f(a[0].key);
|
|
6
|
+
}, [i, a]);
|
|
7
|
+
const c = (t) => r.find((e) => e.field === t), p = (t) => {
|
|
8
|
+
const e = c(t);
|
|
9
9
|
return e ? Array.isArray(e.value) ? e.value.length > 0 : e.value !== "" : !1;
|
|
10
|
-
},
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
}, m = (t) => l.value.find((e) => e.field === t), A = (t) => {
|
|
11
|
+
const e = m(t);
|
|
12
|
+
return e ? Array.isArray(e.value) ? e.value.length > 0 : e.value !== "" : !1;
|
|
13
|
+
}, g = (t, e, o) => {
|
|
14
|
+
const d = r.findIndex((s) => s.field === t);
|
|
15
|
+
if (d >= 0) {
|
|
16
|
+
const s = r.map(
|
|
17
|
+
(F, x) => x === d ? {
|
|
18
|
+
...F,
|
|
16
19
|
...e !== void 0 ? { condition: e } : {},
|
|
17
|
-
...
|
|
18
|
-
} :
|
|
20
|
+
...o !== void 0 ? { value: o } : {}
|
|
21
|
+
} : F
|
|
19
22
|
);
|
|
20
|
-
n(
|
|
23
|
+
n(s);
|
|
21
24
|
} else {
|
|
22
|
-
const
|
|
25
|
+
const s = {
|
|
23
26
|
field: t,
|
|
24
27
|
...e ? { condition: e } : {},
|
|
25
|
-
value:
|
|
28
|
+
value: o || ""
|
|
26
29
|
};
|
|
27
|
-
n([...
|
|
30
|
+
n([...r, s]);
|
|
28
31
|
}
|
|
29
|
-
},
|
|
32
|
+
}, h = () => {
|
|
30
33
|
n([]);
|
|
31
34
|
}, C = () => {
|
|
32
|
-
const t =
|
|
33
|
-
|
|
34
|
-
}, y =
|
|
35
|
-
return
|
|
36
|
-
n(
|
|
37
|
-
}, [
|
|
38
|
-
isOpen: m,
|
|
35
|
+
const t = r.filter((e) => Array.isArray(e.value) ? e.value.length > 0 : e.value !== "");
|
|
36
|
+
l.onChange(t);
|
|
37
|
+
}, y = l.value.length > 0;
|
|
38
|
+
return u.useEffect(() => {
|
|
39
|
+
n(l.value);
|
|
40
|
+
}, [l.value]), {
|
|
39
41
|
selectedColumn: i,
|
|
40
|
-
setSelectedColumn:
|
|
41
|
-
getFilterForColumn:
|
|
42
|
-
hasFilterForColumn:
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
setSelectedColumn: f,
|
|
43
|
+
getFilterForColumn: c,
|
|
44
|
+
hasFilterForColumn: p,
|
|
45
|
+
hasAppliedFilterForColumn: A,
|
|
46
|
+
updateColumnFilter: g,
|
|
47
|
+
clearAllFilters: h,
|
|
45
48
|
applyFilters: C,
|
|
46
49
|
hasActiveFilters: y,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
filterableFields: u
|
|
50
|
+
tempFilters: r,
|
|
51
|
+
filterableFields: a
|
|
50
52
|
};
|
|
51
53
|
};
|
|
52
54
|
export {
|
|
53
|
-
|
|
55
|
+
S as default
|
|
54
56
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export { Table as default, Table, TableProvider } from './table-provider';
|
|
2
2
|
export { TableBody } from './table';
|
|
3
3
|
export type { TableProps, TableSchema, TableSchemaColumn, CellType, CellValue, CellRenderer, CellRendererProps, FilterRule, FilterCondition, FilterOption, TableFilter as TableFilterType, TablePaginationConfig, SortDirection, SortColumn, TableSort, } from './table.type';
|
|
4
|
-
export {
|
|
4
|
+
export { extractCellValue } from './table.utils';
|
|
5
5
|
export { DEFAULT_EMPTY_MESSAGE, TABLE_CSS_CLASSES } from './table.const';
|
|
6
6
|
export { TableContext, useTableContext } from './table.context';
|
|
7
7
|
export { TableCell, TableHeader, TableRow, TableEmptyState, TableLoadingState, TablePagination, TextCell, NumberCell, BooleanCell, TableHeaderWrapper, TableHeaderContent, TableFooter, TableFooterContent, } from './components';
|
|
8
|
-
export { TableFilter } from './components/table-filter';
|
|
9
8
|
export { PaginationInfo, PaginationQuickJumper } from './components/pagination/components';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TableProps } from './table.type';
|
|
2
2
|
import { TableBody } from './table';
|
|
3
|
-
import { TableFilter } from './components/table-filter';
|
|
3
|
+
import { TableFilter } from './components/table-filter/table-filter-provider';
|
|
4
4
|
import { TableSearch } from './components/table-search';
|
|
5
5
|
import { Pagination } from './components/pagination';
|
|
6
6
|
import { TableHeaderWrapper, TableHeaderContent, TableFooter, TableFooterContent } from './components';
|
|
@@ -2,17 +2,17 @@ import { jsx as a } from "react/jsx-runtime";
|
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import { TableContext as m } from "./table.context.js";
|
|
4
4
|
import { TableBody as p } from "./table.js";
|
|
5
|
-
import { TableFilter as f } from "./components/table-filter/table-filter.js";
|
|
5
|
+
import { TableFilter as f } from "./components/table-filter/table-filter-provider.js";
|
|
6
6
|
import { TableSearch as l } from "./components/table-search/table-search.js";
|
|
7
7
|
import { Pagination as s } from "./components/pagination/pagination.js";
|
|
8
|
+
import { PaginationInfo as T } from "./components/pagination/components/pagination-info.js";
|
|
9
|
+
import { PaginationQuickJumper as b } from "./components/pagination/components/pagination-quick-jumper.js";
|
|
8
10
|
import "clsx";
|
|
9
11
|
import "tailwind-merge";
|
|
10
|
-
import { TableHeaderWrapper as
|
|
11
|
-
import { TableHeaderContent as
|
|
12
|
-
import { TableFooter as
|
|
13
|
-
import { TableFooterContent as
|
|
14
|
-
import { PaginationInfo as u } from "./components/pagination/components/pagination-info.js";
|
|
15
|
-
import { PaginationQuickJumper as g } from "./components/pagination/components/pagination-quick-jumper.js";
|
|
12
|
+
import { TableHeaderWrapper as c } from "./components/table-header-wrapper.js";
|
|
13
|
+
import { TableHeaderContent as d } from "./components/table-header-content.js";
|
|
14
|
+
import { TableFooter as u } from "./components/table-footer.js";
|
|
15
|
+
import { TableFooterContent as g } from "./components/table-footer-content.js";
|
|
16
16
|
const t = ({
|
|
17
17
|
children: e,
|
|
18
18
|
pagination: C,
|
|
@@ -33,13 +33,13 @@ o.Body = p;
|
|
|
33
33
|
o.Filter = f;
|
|
34
34
|
o.Search = l;
|
|
35
35
|
o.Pagination = s;
|
|
36
|
-
o.PaginationInfo =
|
|
37
|
-
o.PaginationQuickJumper =
|
|
36
|
+
o.PaginationInfo = T;
|
|
37
|
+
o.PaginationQuickJumper = b;
|
|
38
38
|
o.Provider = t;
|
|
39
|
-
o.Header =
|
|
40
|
-
o.HeaderContent =
|
|
41
|
-
o.Footer =
|
|
42
|
-
o.FooterContent =
|
|
39
|
+
o.Header = c;
|
|
40
|
+
o.HeaderContent = d;
|
|
41
|
+
o.Footer = u;
|
|
42
|
+
o.FooterContent = g;
|
|
43
43
|
export {
|
|
44
44
|
o as Table,
|
|
45
45
|
t as TableProvider,
|
|
@@ -17,6 +17,7 @@ export type FilterRule = {
|
|
|
17
17
|
export type FilterOption = {
|
|
18
18
|
label: string;
|
|
19
19
|
value: string;
|
|
20
|
+
total?: number;
|
|
20
21
|
};
|
|
21
22
|
export type TableFilter = {
|
|
22
23
|
value: FilterRule[];
|
|
@@ -47,6 +48,7 @@ export type TableSort = {
|
|
|
47
48
|
};
|
|
48
49
|
export type TableSchemaColumn = {
|
|
49
50
|
key: string;
|
|
51
|
+
valueGetter?: (record: Record<string, any>) => string | number | boolean | null | undefined;
|
|
50
52
|
title: string;
|
|
51
53
|
cellType: CellType;
|
|
52
54
|
cellRenderer?: CellRenderer;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { CellValue, TableSchemaColumn } from './table.type';
|
|
2
|
-
export declare const getNestedValue: (object: Record<string, unknown>, path: string) => CellValue;
|
|
3
2
|
export declare const extractCellValue: (record: Record<string, unknown>, column: TableSchemaColumn) => CellValue;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a = (t, e) => {
|
|
2
|
+
var r;
|
|
3
|
+
return e.valueGetter ? e.valueGetter(t) : (r = t[e.key]) == null ? void 0 : r.toString();
|
|
4
|
+
};
|
|
2
5
|
export {
|
|
3
|
-
|
|
4
|
-
s as getNestedValue
|
|
6
|
+
a as extractCellValue
|
|
5
7
|
};
|
|
@@ -1,132 +1,137 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import { Table as e } from "../table/table-provider.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { cn as
|
|
4
|
+
import { cn as P } from "../../lib/utils.js";
|
|
5
5
|
import "../table/table.context.js";
|
|
6
6
|
import "../button/button.js";
|
|
7
7
|
import "../input/input.js";
|
|
8
|
-
const
|
|
9
|
-
dataSource:
|
|
8
|
+
const M = ({
|
|
9
|
+
dataSource: w,
|
|
10
10
|
schema: C,
|
|
11
|
-
loading:
|
|
12
|
-
emptyMessage:
|
|
13
|
-
className:
|
|
14
|
-
rounded:
|
|
15
|
-
bordered:
|
|
16
|
-
showHeader:
|
|
11
|
+
loading: T,
|
|
12
|
+
emptyMessage: _,
|
|
13
|
+
className: k,
|
|
14
|
+
rounded: n = !0,
|
|
15
|
+
bordered: d = !0,
|
|
16
|
+
showHeader: x = !0,
|
|
17
17
|
headerClassName: R,
|
|
18
|
-
search:
|
|
19
|
-
filter:
|
|
20
|
-
headerLeftContent:
|
|
21
|
-
headerActions:
|
|
18
|
+
search: a,
|
|
19
|
+
filter: t,
|
|
20
|
+
headerLeftContent: m,
|
|
21
|
+
headerActions: u,
|
|
22
22
|
body: l = {
|
|
23
23
|
cell: { cellHeight: "small", hasBorder: !0 },
|
|
24
24
|
className: "",
|
|
25
25
|
stickyHeader: !0
|
|
26
26
|
},
|
|
27
|
-
showFooter:
|
|
27
|
+
showFooter: F = !0,
|
|
28
28
|
footerClassName: j,
|
|
29
|
-
pagination:
|
|
30
|
-
paginationInfo:
|
|
31
|
-
paginationQuickJumper:
|
|
29
|
+
pagination: s,
|
|
30
|
+
paginationInfo: c,
|
|
31
|
+
paginationQuickJumper: o
|
|
32
32
|
}) => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
var N;
|
|
34
|
+
const g = o && o.totalPage && o.totalPage >= 2, B = s && s.totalPage && s.totalPage >= 2 || !!c || g, H = a || t || m || u, q = typeof (t == null ? void 0 : t.showFilterButton) > "u" ? !0 : t == null ? void 0 : t.showFilterButton;
|
|
35
|
+
return /* @__PURE__ */ r("div", { className: P("flex flex-col overflow-hidden", k), children: /* @__PURE__ */ h(e, { dataSource: w, schema: C, loading: T, emptyMessage: _, children: [
|
|
36
|
+
x && H && /* @__PURE__ */ h(
|
|
36
37
|
e.Header,
|
|
37
38
|
{
|
|
38
|
-
className:
|
|
39
|
+
className: P(
|
|
39
40
|
"flex-shrink-0",
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
d && "border-stroke-solid-medium border-1 border-b-0",
|
|
42
|
+
n && "rounded-t-xl",
|
|
42
43
|
R
|
|
43
44
|
),
|
|
44
45
|
children: [
|
|
45
46
|
/* @__PURE__ */ h(e.HeaderContent, { children: [
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
m && m,
|
|
48
|
+
a && /* @__PURE__ */ r(
|
|
48
49
|
e.Search,
|
|
49
50
|
{
|
|
50
51
|
search: {
|
|
51
|
-
value:
|
|
52
|
-
onChange:
|
|
52
|
+
value: a.value || "",
|
|
53
|
+
onChange: a.onChange || (() => {
|
|
53
54
|
}),
|
|
54
|
-
placeholder:
|
|
55
|
+
placeholder: a.placeholder
|
|
55
56
|
},
|
|
56
|
-
className:
|
|
57
|
+
className: a.className
|
|
57
58
|
}
|
|
58
59
|
),
|
|
59
|
-
|
|
60
|
+
t && /* @__PURE__ */ h(
|
|
60
61
|
e.Filter,
|
|
61
62
|
{
|
|
62
63
|
schema: C,
|
|
63
64
|
filter: {
|
|
64
|
-
value:
|
|
65
|
-
onChange:
|
|
65
|
+
value: t.value || [],
|
|
66
|
+
onChange: t.onChange || (() => {
|
|
66
67
|
})
|
|
67
|
-
}
|
|
68
|
+
},
|
|
69
|
+
children: [
|
|
70
|
+
q && /* @__PURE__ */ r(e.Filter.FilterButton, {}),
|
|
71
|
+
(N = t == null ? void 0 : t.quickFilters) == null ? void 0 : N.map((v) => /* @__PURE__ */ r(e.Filter.FilterColumnButton, { filterName: v }, v))
|
|
72
|
+
]
|
|
68
73
|
}
|
|
69
74
|
)
|
|
70
75
|
] }),
|
|
71
|
-
|
|
76
|
+
u && /* @__PURE__ */ r(e.HeaderContent, { children: u })
|
|
72
77
|
]
|
|
73
78
|
}
|
|
74
79
|
),
|
|
75
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ r(
|
|
76
81
|
e.Body,
|
|
77
82
|
{
|
|
78
83
|
cell: l == null ? void 0 : l.cell,
|
|
79
84
|
sort: l == null ? void 0 : l.sort,
|
|
80
|
-
className:
|
|
85
|
+
className: P(
|
|
81
86
|
"flex-1 min-h-0",
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
d && "border-stroke-solid-light border-b-1 border-x-1 border-t-0",
|
|
88
|
+
n && !(x && H) && "rounded-t-xl",
|
|
89
|
+
n && !(F && B) && "rounded-b-xl",
|
|
90
|
+
d && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
|
|
91
|
+
d && "[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
|
|
87
92
|
l == null ? void 0 : l.className
|
|
88
93
|
),
|
|
89
94
|
stickyHeader: l == null ? void 0 : l.stickyHeader
|
|
90
95
|
}
|
|
91
96
|
),
|
|
92
|
-
|
|
97
|
+
F && B && /* @__PURE__ */ h(
|
|
93
98
|
e.Footer,
|
|
94
99
|
{
|
|
95
|
-
className:
|
|
100
|
+
className: P(
|
|
96
101
|
"flex-shrink-0",
|
|
97
|
-
|
|
98
|
-
|
|
102
|
+
d && "border-stroke-solid-light border border-t-[0.5px]",
|
|
103
|
+
n && "rounded-b-xl",
|
|
99
104
|
j
|
|
100
105
|
),
|
|
101
106
|
children: [
|
|
102
|
-
|
|
107
|
+
c ? /* @__PURE__ */ r(e.FooterContent, { children: /* @__PURE__ */ r(
|
|
103
108
|
e.PaginationInfo,
|
|
104
109
|
{
|
|
105
|
-
showTotal:
|
|
106
|
-
totalItems:
|
|
107
|
-
currentPage:
|
|
108
|
-
itemsPerPage:
|
|
110
|
+
showTotal: c.showTotal,
|
|
111
|
+
totalItems: c.totalItems,
|
|
112
|
+
currentPage: c.currentPage,
|
|
113
|
+
itemsPerPage: c.itemsPerPage
|
|
109
114
|
}
|
|
110
|
-
) }) :
|
|
111
|
-
(
|
|
112
|
-
|
|
115
|
+
) }) : o || s ? /* @__PURE__ */ r(e.FooterContent, { children: null }) : null,
|
|
116
|
+
(o || s) && /* @__PURE__ */ h(e.FooterContent, { children: [
|
|
117
|
+
g && /* @__PURE__ */ r(
|
|
113
118
|
e.PaginationQuickJumper,
|
|
114
119
|
{
|
|
115
|
-
currentPage:
|
|
116
|
-
totalPage:
|
|
117
|
-
onChange:
|
|
120
|
+
currentPage: o.currentPage,
|
|
121
|
+
totalPage: o.totalPage,
|
|
122
|
+
onChange: o.onChange || (() => {
|
|
118
123
|
}),
|
|
119
|
-
disabled:
|
|
124
|
+
disabled: o.disabled
|
|
120
125
|
}
|
|
121
126
|
),
|
|
122
|
-
|
|
127
|
+
s && /* @__PURE__ */ r(
|
|
123
128
|
e.Pagination,
|
|
124
129
|
{
|
|
125
|
-
currentPage:
|
|
126
|
-
totalPage:
|
|
127
|
-
onChange:
|
|
130
|
+
currentPage: s.currentPage,
|
|
131
|
+
totalPage: s.totalPage,
|
|
132
|
+
onChange: s.onChange || (() => {
|
|
128
133
|
}),
|
|
129
|
-
totalItems:
|
|
134
|
+
totalItems: s.totalItems
|
|
130
135
|
}
|
|
131
136
|
)
|
|
132
137
|
] })
|
|
@@ -136,5 +141,5 @@ const E = ({
|
|
|
136
141
|
] }) });
|
|
137
142
|
};
|
|
138
143
|
export {
|
|
139
|
-
|
|
144
|
+
M as default
|
|
140
145
|
};
|
|
@@ -12,7 +12,10 @@ export interface TableCardProps {
|
|
|
12
12
|
search?: Partial<TableSearch> & {
|
|
13
13
|
className?: string;
|
|
14
14
|
};
|
|
15
|
-
filter?: Partial<TableFilter
|
|
15
|
+
filter?: Partial<TableFilter> & {
|
|
16
|
+
quickFilters?: string[];
|
|
17
|
+
showFilterButton?: boolean;
|
|
18
|
+
};
|
|
16
19
|
headerLeftContent?: React.ReactNode;
|
|
17
20
|
headerActions?: React.ReactNode;
|
|
18
21
|
body?: {
|
|
@@ -23,12 +26,9 @@ export interface TableCardProps {
|
|
|
23
26
|
};
|
|
24
27
|
showFooter?: boolean;
|
|
25
28
|
footerClassName?: string;
|
|
26
|
-
pagination?:
|
|
27
|
-
paginationInfo?:
|
|
28
|
-
|
|
29
|
-
totalItems: number;
|
|
30
|
-
};
|
|
31
|
-
paginationQuickJumper?: Partial<PaginationQuickJumperProps>;
|
|
29
|
+
pagination?: PaginationProps;
|
|
30
|
+
paginationInfo?: PaginationInfoProps;
|
|
31
|
+
paginationQuickJumper?: PaginationQuickJumperProps;
|
|
32
32
|
loading?: boolean;
|
|
33
33
|
emptyMessage?: string;
|
|
34
34
|
}
|