@konstructio/ui 0.1.2-alpha.7 → 0.1.2-alpha.8
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,38 +1,41 @@
|
|
|
1
1
|
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { TableProvider as
|
|
5
|
-
import { Filter as
|
|
6
|
-
import { Header as
|
|
7
|
-
import { Body as
|
|
8
|
-
import { Pagination as
|
|
9
|
-
import { TruncateText as
|
|
10
|
-
import { Actions as
|
|
11
|
-
const
|
|
12
|
-
id:
|
|
13
|
-
ariaLabel:
|
|
14
|
-
columns:
|
|
15
|
-
data:
|
|
16
|
-
totalItems:
|
|
17
|
-
|
|
18
|
-
classNameHeaderArrows: u,
|
|
2
|
+
import { useMemo as y } from "react";
|
|
3
|
+
import { cn as s } from "../../utils/index.js";
|
|
4
|
+
import { TableProvider as B } from "./contexts/table.provider.js";
|
|
5
|
+
import { Filter as H } from "./components/Filter/Filter.js";
|
|
6
|
+
import { Header as K } from "./components/Header/Header.js";
|
|
7
|
+
import { Body as M } from "./components/Body/Body.js";
|
|
8
|
+
import { Pagination as P } from "./components/Pagination/Pagination.js";
|
|
9
|
+
import { TruncateText as k } from "./components/TruncateText/TruncateText.js";
|
|
10
|
+
import { Actions as q } from "./components/Actions/Actions.js";
|
|
11
|
+
const C = ({
|
|
12
|
+
id: c,
|
|
13
|
+
ariaLabel: d,
|
|
14
|
+
columns: n,
|
|
15
|
+
data: f,
|
|
16
|
+
totalItems: p,
|
|
17
|
+
className: u,
|
|
19
18
|
classNameHeaderActiveArrows: b,
|
|
20
|
-
|
|
19
|
+
classNameHeaderArrows: T,
|
|
20
|
+
classNameHeaderTable: N,
|
|
21
|
+
classNameTable: h,
|
|
22
|
+
classNameWrapperTable: x,
|
|
23
|
+
fetchData: A,
|
|
21
24
|
// Pagination
|
|
22
|
-
showPagination:
|
|
25
|
+
showPagination: v,
|
|
23
26
|
showTotalItems: o,
|
|
24
27
|
showDropdownPagination: l,
|
|
25
28
|
showDotPagination: a,
|
|
26
29
|
showFormPagination: i,
|
|
27
|
-
pageSizes:
|
|
30
|
+
pageSizes: z,
|
|
28
31
|
// Filter
|
|
29
|
-
showFilter:
|
|
30
|
-
showFilterInput:
|
|
31
|
-
filterSearchPlaceholder:
|
|
32
|
-
multiSelectFilter:
|
|
32
|
+
showFilter: V = !1,
|
|
33
|
+
showFilterInput: g,
|
|
34
|
+
filterSearchPlaceholder: j = "",
|
|
35
|
+
multiSelectFilter: w
|
|
33
36
|
}) => {
|
|
34
|
-
const t =
|
|
35
|
-
() =>
|
|
37
|
+
const t = y(
|
|
38
|
+
() => v || [
|
|
36
39
|
o,
|
|
37
40
|
l,
|
|
38
41
|
a,
|
|
@@ -41,59 +44,70 @@ const P = ({
|
|
|
41
44
|
[]
|
|
42
45
|
);
|
|
43
46
|
return /* @__PURE__ */ r(
|
|
44
|
-
|
|
47
|
+
B,
|
|
45
48
|
{
|
|
46
|
-
id:
|
|
47
|
-
columns:
|
|
48
|
-
data:
|
|
49
|
-
fetchData:
|
|
50
|
-
totalItems:
|
|
51
|
-
children: /* @__PURE__ */ m("section", { children: [
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
id: c,
|
|
50
|
+
columns: n,
|
|
51
|
+
data: f,
|
|
52
|
+
fetchData: A,
|
|
53
|
+
totalItems: p,
|
|
54
|
+
children: /* @__PURE__ */ m("section", { className: u, children: [
|
|
55
|
+
V && /* @__PURE__ */ r(
|
|
56
|
+
H,
|
|
54
57
|
{
|
|
55
|
-
placeholder:
|
|
56
|
-
multiSelectFilter:
|
|
57
|
-
showFilterInput:
|
|
58
|
+
placeholder: j,
|
|
59
|
+
multiSelectFilter: w,
|
|
60
|
+
showFilterInput: g
|
|
58
61
|
}
|
|
59
62
|
),
|
|
60
63
|
/* @__PURE__ */ r(
|
|
61
64
|
"div",
|
|
62
65
|
{
|
|
63
|
-
className:
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
className: s(
|
|
67
|
+
"shadow rounded-t-lg",
|
|
68
|
+
{
|
|
69
|
+
"overflow-hidden rounded-lg": !t
|
|
70
|
+
},
|
|
71
|
+
x
|
|
72
|
+
),
|
|
73
|
+
children: /* @__PURE__ */ m(
|
|
74
|
+
"table",
|
|
75
|
+
{
|
|
76
|
+
className: s("w-full border-collapse", h),
|
|
77
|
+
"aria-label": d,
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ r(
|
|
80
|
+
K,
|
|
81
|
+
{
|
|
82
|
+
className: N,
|
|
83
|
+
classNameArrows: T,
|
|
84
|
+
classNameActiveArrows: b
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ r(M, {})
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
)
|
|
77
91
|
}
|
|
78
92
|
),
|
|
79
93
|
t && /* @__PURE__ */ r(
|
|
80
|
-
|
|
94
|
+
P,
|
|
81
95
|
{
|
|
82
96
|
showTotalItems: o,
|
|
83
97
|
showDropdownPagination: l,
|
|
84
98
|
showDotPagination: a,
|
|
85
99
|
showFormPagination: i,
|
|
86
|
-
pageSizes:
|
|
100
|
+
pageSizes: z
|
|
87
101
|
}
|
|
88
102
|
)
|
|
89
103
|
] })
|
|
90
104
|
}
|
|
91
105
|
);
|
|
92
|
-
}, e =
|
|
106
|
+
}, e = C;
|
|
93
107
|
e.displayName = "KonstructVirtualizedTable";
|
|
94
|
-
e.TruncateText =
|
|
95
|
-
e.Actions =
|
|
108
|
+
e.TruncateText = k;
|
|
109
|
+
e.Actions = q;
|
|
96
110
|
export {
|
|
97
|
-
|
|
111
|
+
k as TruncateText,
|
|
98
112
|
e as VirtualizedTable
|
|
99
113
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -571,14 +571,16 @@ declare type Props_4<TData extends RowData_2> = VariantProps<typeof virtualizeTa
|
|
|
571
571
|
ariaLabel?: string;
|
|
572
572
|
columns: ColumnDef<TData, string>[];
|
|
573
573
|
data: TData[];
|
|
574
|
-
|
|
574
|
+
className?: string;
|
|
575
|
+
classNameHeaderActiveArrows?: string;
|
|
576
|
+
classNameHeaderArrows?: string;
|
|
577
|
+
classNameHeaderTable?: string;
|
|
578
|
+
classNameTable?: string;
|
|
579
|
+
classNameWrapperTable?: string;
|
|
575
580
|
fetchData: (params: Record<string, string | number | string[] | number[] | undefined>) => Promise<{
|
|
576
581
|
data: TData[];
|
|
577
582
|
totalItemsCount: number;
|
|
578
583
|
}>;
|
|
579
|
-
classNameHeaderTable?: string;
|
|
580
|
-
classNameHeaderArrows?: string;
|
|
581
|
-
classNameHeaderActiveArrows?: string;
|
|
582
584
|
} & ({
|
|
583
585
|
showPagination: true;
|
|
584
586
|
showTotalItems?: boolean;
|
|
@@ -586,6 +588,7 @@ declare type Props_4<TData extends RowData_2> = VariantProps<typeof virtualizeTa
|
|
|
586
588
|
showDotPagination?: boolean;
|
|
587
589
|
showFormPagination?: boolean;
|
|
588
590
|
pageSizes?: number[] | string[];
|
|
591
|
+
totalItems: number;
|
|
589
592
|
} | {
|
|
590
593
|
showPagination?: false | undefined;
|
|
591
594
|
showTotalItems?: never;
|
|
@@ -593,6 +596,7 @@ declare type Props_4<TData extends RowData_2> = VariantProps<typeof virtualizeTa
|
|
|
593
596
|
showDotPagination?: never;
|
|
594
597
|
showFormPagination?: never;
|
|
595
598
|
pageSizes?: never;
|
|
599
|
+
totalItems: never;
|
|
596
600
|
}) & ({
|
|
597
601
|
filterSearchPlaceholder?: string;
|
|
598
602
|
multiSelectFilter?: MultiSelectFilter[];
|
package/dist/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@konstructio/ui",
|
|
3
3
|
"description": "A set of reusable and customizable React components built for konstruct.io",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.1.2-alpha.
|
|
5
|
+
"version": "0.1.2-alpha.7",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@konstructio/ui",
|
|
3
3
|
"description": "A set of reusable and customizable React components built for konstruct.io",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.1.2-alpha.
|
|
5
|
+
"version": "0.1.2-alpha.8",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|