@konstructio/ui 0.1.2-alpha.22 → 0.1.2-alpha.23
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/VirtualizedTable/VirtualizedTable.js +20 -19
- package/dist/components/VirtualizedTable/components/Body/Body.js +33 -25
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +20 -19
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +46 -31
- package/dist/package.json +10 -10
- package/dist/styles.css +1 -1
- package/dist/utils/index.js +534 -501
- package/package.json +10 -10
|
@@ -4,12 +4,12 @@ import { cn as c } from "../../utils/index.js";
|
|
|
4
4
|
import { TableProvider as K } from "./contexts/table.provider.js";
|
|
5
5
|
import { Filter as M } from "./components/Filter/Filter.js";
|
|
6
6
|
import { WrapperBody as W } from "./components/WrapperBody/WrapperBody.js";
|
|
7
|
-
import { Header as
|
|
8
|
-
import { Body as
|
|
9
|
-
import { Pagination as
|
|
10
|
-
import { TruncateText as
|
|
11
|
-
import { Actions as
|
|
12
|
-
const
|
|
7
|
+
import { Header as k } from "./components/Header/Header.js";
|
|
8
|
+
import { Body as q } from "./components/Body/Body.js";
|
|
9
|
+
import { Pagination as C } from "./components/Pagination/Pagination.js";
|
|
10
|
+
import { TruncateText as F } from "./components/TruncateText/TruncateText.js";
|
|
11
|
+
import { Actions as G } from "./components/Actions/Actions.js";
|
|
12
|
+
const J = ({
|
|
13
13
|
id: n,
|
|
14
14
|
ariaLabel: f,
|
|
15
15
|
columns: p,
|
|
@@ -26,8 +26,8 @@ const G = ({
|
|
|
26
26
|
queryOptions: z,
|
|
27
27
|
// Pagination
|
|
28
28
|
showPagination: B,
|
|
29
|
-
showTotalItems:
|
|
30
|
-
showDropdownPagination:
|
|
29
|
+
showTotalItems: t,
|
|
30
|
+
showDropdownPagination: a,
|
|
31
31
|
showDotPagination: l,
|
|
32
32
|
showFormPagination: m,
|
|
33
33
|
pageSizes: V,
|
|
@@ -41,8 +41,8 @@ const G = ({
|
|
|
41
41
|
}) => {
|
|
42
42
|
const e = I(
|
|
43
43
|
() => B || [
|
|
44
|
-
a,
|
|
45
44
|
t,
|
|
45
|
+
a,
|
|
46
46
|
l,
|
|
47
47
|
m
|
|
48
48
|
].some(Boolean),
|
|
@@ -82,37 +82,38 @@ const G = ({
|
|
|
82
82
|
"aria-label": f,
|
|
83
83
|
children: [
|
|
84
84
|
/* @__PURE__ */ r(
|
|
85
|
-
|
|
85
|
+
k,
|
|
86
86
|
{
|
|
87
87
|
className: N,
|
|
88
88
|
classNameArrows: x,
|
|
89
89
|
classNameActiveArrows: T
|
|
90
90
|
}
|
|
91
91
|
),
|
|
92
|
-
/* @__PURE__ */ r(
|
|
92
|
+
/* @__PURE__ */ r(q, { isLoading: o, showPagination: e })
|
|
93
93
|
]
|
|
94
94
|
}
|
|
95
95
|
)
|
|
96
96
|
}
|
|
97
97
|
),
|
|
98
98
|
e && /* @__PURE__ */ r(
|
|
99
|
-
|
|
99
|
+
C,
|
|
100
100
|
{
|
|
101
|
-
showTotalItems:
|
|
102
|
-
showDropdownPagination:
|
|
101
|
+
showTotalItems: t,
|
|
102
|
+
showDropdownPagination: a,
|
|
103
103
|
showDotPagination: l,
|
|
104
104
|
showFormPagination: m,
|
|
105
|
-
pageSizes: V
|
|
105
|
+
pageSizes: V,
|
|
106
|
+
isLoading: o
|
|
106
107
|
}
|
|
107
108
|
)
|
|
108
109
|
] })
|
|
109
110
|
}
|
|
110
111
|
);
|
|
111
|
-
}, i =
|
|
112
|
+
}, i = J;
|
|
112
113
|
i.displayName = "KonstructVirtualizedTable";
|
|
113
|
-
i.TruncateText =
|
|
114
|
-
i.Actions =
|
|
114
|
+
i.TruncateText = F;
|
|
115
|
+
i.Actions = G;
|
|
115
116
|
export {
|
|
116
|
-
|
|
117
|
+
F as TruncateText,
|
|
117
118
|
i as VirtualizedTable
|
|
118
119
|
};
|
|
@@ -1,40 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { f } from "../../../../index-CSWGJT-v.js";
|
|
3
|
-
import { Skeleton as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { useTableContext as
|
|
6
|
-
const
|
|
7
|
-
isLoading:
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { f as x } from "../../../../index-CSWGJT-v.js";
|
|
3
|
+
import { Skeleton as y } from "../Skeleton/Skeleton.js";
|
|
4
|
+
import { cn as b } from "../../../../utils/index.js";
|
|
5
|
+
import { useTableContext as N } from "../../contexts/table.hook.js";
|
|
6
|
+
const j = ({
|
|
7
|
+
isLoading: d,
|
|
8
|
+
showPagination: a
|
|
8
9
|
}) => {
|
|
9
|
-
const { table:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const { table: o, pageSize: i, tableFetching: f } = N();
|
|
11
|
+
if (d || f)
|
|
12
|
+
return /* @__PURE__ */ t(y, { numberOfRows: i, table: o });
|
|
13
|
+
const e = o.getRowModel().rows ?? [];
|
|
14
|
+
return /* @__PURE__ */ t("tbody", { className: "text-slate-800 text-sm font-normal relative", children: e.map(({ id: s, original: p, getVisibleCells: u }, l) => {
|
|
15
|
+
const { meta: n = {} } = p, m = u();
|
|
16
|
+
return /* @__PURE__ */ t(
|
|
13
17
|
"tr",
|
|
14
18
|
{
|
|
15
|
-
className:
|
|
16
|
-
"border-b border-b-gray-200
|
|
17
|
-
|
|
19
|
+
className: b(
|
|
20
|
+
"border-b border-b-gray-200 last:border-b-transparent bg-transparent",
|
|
21
|
+
n.className
|
|
18
22
|
),
|
|
19
|
-
"data-row-id":
|
|
20
|
-
...
|
|
21
|
-
children:
|
|
23
|
+
"data-row-id": s,
|
|
24
|
+
...n.attributes ?? {},
|
|
25
|
+
children: m.map(({ id: g, column: r, getContext: h }, c) => /* @__PURE__ */ t(
|
|
22
26
|
"td",
|
|
23
27
|
{
|
|
24
|
-
className:
|
|
25
|
-
"px-4 py-1 text-sm",
|
|
26
|
-
|
|
28
|
+
className: b(
|
|
29
|
+
"px-4 py-1 text-sm bg-white",
|
|
30
|
+
r.columnDef.meta?.className,
|
|
31
|
+
{
|
|
32
|
+
"[tr:last-child_&:first-of-type]:rounded-bl-lg": l === e.length - 1 && c === 0 || !a,
|
|
33
|
+
"[tr:last-child_&:last-of-type]:rounded-br-lg": l === e.length - 1 && c === m.length - 1 || !a
|
|
34
|
+
}
|
|
27
35
|
),
|
|
28
|
-
...
|
|
29
|
-
children:
|
|
36
|
+
...r.columnDef.meta?.attributes ?? {},
|
|
37
|
+
children: x(r.columnDef.cell, h())
|
|
30
38
|
},
|
|
31
|
-
|
|
39
|
+
g
|
|
32
40
|
))
|
|
33
41
|
},
|
|
34
|
-
|
|
42
|
+
s
|
|
35
43
|
);
|
|
36
44
|
}) });
|
|
37
45
|
};
|
|
38
46
|
export {
|
|
39
|
-
|
|
47
|
+
j as Body
|
|
40
48
|
};
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { jsxs as t, Fragment as
|
|
2
|
-
import { DotPaginate as
|
|
3
|
-
import { DropdownPaginate as
|
|
4
|
-
import { FormPaginate as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { useTableContext as
|
|
7
|
-
import { DEFAULT_PAGE_SIZE as
|
|
8
|
-
const
|
|
1
|
+
import { jsxs as t, Fragment as p, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { DotPaginate as f } from "../DotPaginate/DotPaginate.js";
|
|
3
|
+
import { DropdownPaginate as x } from "../DropdownPaginate/DropdownPaginate.js";
|
|
4
|
+
import { FormPaginate as u } from "../FormPaginate/FormPaginate.js";
|
|
5
|
+
import { cn as g } from "../../../../utils/index.js";
|
|
6
|
+
import { useTableContext as h } from "../../contexts/table.hook.js";
|
|
7
|
+
import { DEFAULT_PAGE_SIZE as b } from "../../constants/pagination.js";
|
|
8
|
+
const D = ({
|
|
9
9
|
showTotalItems: a = !0,
|
|
10
10
|
showDropdownPagination: i = !0,
|
|
11
11
|
showDotPagination: n = !0,
|
|
12
12
|
showFormPagination: s = !0,
|
|
13
13
|
pageSizes: l,
|
|
14
|
-
classNamePagination: o
|
|
14
|
+
classNamePagination: o,
|
|
15
|
+
isLoading: m
|
|
15
16
|
}) => {
|
|
16
17
|
const {
|
|
17
18
|
totalItems: r = -1 / 0,
|
|
18
|
-
tableFetching:
|
|
19
|
-
isFirstLoad:
|
|
20
|
-
} =
|
|
21
|
-
return r <=
|
|
19
|
+
tableFetching: c,
|
|
20
|
+
isFirstLoad: d
|
|
21
|
+
} = h();
|
|
22
|
+
return r <= b || c || m ? null : /* @__PURE__ */ t(p, { children: [
|
|
22
23
|
/* @__PURE__ */ e(
|
|
23
24
|
"div",
|
|
24
25
|
{
|
|
25
|
-
className:
|
|
26
|
+
className: g(
|
|
26
27
|
"bg-slate-50 border border-y-transparent border-x-slate-100 text-slate-500 text-xs not-italic py-2 px-6 rounded-b-lg shadow",
|
|
27
28
|
o,
|
|
28
29
|
{
|
|
29
|
-
"animate-in fade-in-10": !
|
|
30
|
+
"animate-in fade-in-10": !d
|
|
30
31
|
}
|
|
31
32
|
),
|
|
32
33
|
children: /* @__PURE__ */ t("div", { className: "flex items-center justify-between", children: [
|
|
@@ -35,11 +36,11 @@ const j = ({
|
|
|
35
36
|
r,
|
|
36
37
|
" Results"
|
|
37
38
|
] }) : null,
|
|
38
|
-
i && /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(
|
|
39
|
+
i && /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(x, { pageSizes: l }) })
|
|
39
40
|
] }),
|
|
40
41
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-8", children: [
|
|
41
|
-
n && /* @__PURE__ */ e(
|
|
42
|
-
s && /* @__PURE__ */ e(
|
|
42
|
+
n && /* @__PURE__ */ e(f, {}),
|
|
43
|
+
s && /* @__PURE__ */ e(u, {})
|
|
43
44
|
] })
|
|
44
45
|
] })
|
|
45
46
|
}
|
|
@@ -48,5 +49,5 @@ const j = ({
|
|
|
48
49
|
] });
|
|
49
50
|
};
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
+
D as Pagination
|
|
52
53
|
};
|
|
@@ -1,52 +1,67 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Button as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { useTableContext as
|
|
5
|
-
import { E as
|
|
6
|
-
const
|
|
7
|
-
const { tableFetching:
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Button as c } from "../../../Button/Button.js";
|
|
3
|
+
import { cn as i } from "../../../../utils/index.js";
|
|
4
|
+
import { useTableContext as h } from "../../contexts/table.hook.js";
|
|
5
|
+
import { E as g } from "../../../../ellipsis-vertical-BVPtjl5f.js";
|
|
6
|
+
const _ = ({ numberOfRows: n, table: o }) => {
|
|
7
|
+
const { tableFetching: d, tableLoading: m } = h(), e = Array.from({ length: n });
|
|
8
|
+
return /* @__PURE__ */ t("tbody", { className: "text-slate-800 text-sm font-normal relative", children: e.map((p, a) => {
|
|
9
|
+
const s = o.getAllColumns();
|
|
10
|
+
return /* @__PURE__ */ t(
|
|
11
|
+
"tr",
|
|
12
|
+
{
|
|
13
|
+
className: "border-b border-b-gray-200 bg-transparent last:border-b-transparent",
|
|
14
|
+
children: s.map((r, l) => r.id !== "actions" ? /* @__PURE__ */ t(
|
|
14
15
|
"td",
|
|
15
16
|
{
|
|
16
|
-
className:
|
|
17
|
-
|
|
17
|
+
className: i(
|
|
18
|
+
"px-4 py-1 bg-white",
|
|
19
|
+
r.columnDef.meta?.className,
|
|
20
|
+
{
|
|
21
|
+
"[tr:last-child_&:first-of-type]:rounded-bl-lg": a === e.length - 1 && l === 0,
|
|
22
|
+
"[tr:last-child_&:last-of-type]:rounded-br-lg": a === e.length - 1 && l === s.length - 1
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
children: /* @__PURE__ */ t("div", { className: "animate-in fade-in-0", children: /* @__PURE__ */ t("div", { className: "bg-gray-200 animate-pulse rounded h-5 w-full" }) })
|
|
18
26
|
},
|
|
19
|
-
`skeleton-${
|
|
20
|
-
) : /* @__PURE__ */
|
|
27
|
+
`skeleton-${r.id}`
|
|
28
|
+
) : /* @__PURE__ */ t(
|
|
21
29
|
"td",
|
|
22
30
|
{
|
|
23
|
-
className:
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
className: i(
|
|
32
|
+
"px-4 py-1 bg-white",
|
|
33
|
+
r.columnDef.meta?.className,
|
|
34
|
+
{
|
|
35
|
+
"[tr:last-child_&:first-of-type]:rounded-bl-lg": a === e.length - 1 && l === 0,
|
|
36
|
+
"[tr:last-child_&:last-of-type]:rounded-br-lg": a === e.length - 1 && l === s.length - 1
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
children: /* @__PURE__ */ t(
|
|
40
|
+
c,
|
|
26
41
|
{
|
|
27
42
|
variant: "text",
|
|
28
43
|
shape: "circle",
|
|
29
44
|
size: "large",
|
|
30
45
|
disabled: !0,
|
|
31
46
|
"aria-hidden": "true",
|
|
32
|
-
children: /* @__PURE__ */
|
|
33
|
-
|
|
47
|
+
children: /* @__PURE__ */ t(
|
|
48
|
+
g,
|
|
34
49
|
{
|
|
35
|
-
className:
|
|
36
|
-
"text-gray-300 animate-pulse":
|
|
50
|
+
className: i("w-5 h-5 text-slate-400", {
|
|
51
|
+
"text-gray-300 animate-pulse": d || m
|
|
37
52
|
})
|
|
38
53
|
}
|
|
39
54
|
)
|
|
40
55
|
}
|
|
41
56
|
)
|
|
42
57
|
},
|
|
43
|
-
`skeleton-${
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
)
|
|
58
|
+
`skeleton-${r.id}`
|
|
59
|
+
))
|
|
60
|
+
},
|
|
61
|
+
`skeleton-row-${a}`
|
|
62
|
+
);
|
|
63
|
+
}) });
|
|
49
64
|
};
|
|
50
65
|
export {
|
|
51
|
-
|
|
66
|
+
_ as Skeleton
|
|
52
67
|
};
|
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.22",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -72,13 +72,13 @@
|
|
|
72
72
|
"cmdk": "^1.1.1",
|
|
73
73
|
"countries-and-timezones": "^3.8.0",
|
|
74
74
|
"js-cookie": "^3.0.5",
|
|
75
|
-
"lucide-react": "^0.
|
|
75
|
+
"lucide-react": "^0.553.0",
|
|
76
76
|
"react-chartjs-2": "^5.3.1",
|
|
77
77
|
"react-day-picker": "^9.11.1",
|
|
78
78
|
"react-feather": "^2.0.10",
|
|
79
79
|
"react-focus-lock": "^2.13.6",
|
|
80
80
|
"react-remove-scroll": "^2.7.1",
|
|
81
|
-
"tailwind-merge": "^3.
|
|
81
|
+
"tailwind-merge": "^3.4.0"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"@tanstack/react-query": "^5.90",
|
|
@@ -115,9 +115,9 @@
|
|
|
115
115
|
"devDependencies": {
|
|
116
116
|
"@faker-js/faker": "^10.1.0",
|
|
117
117
|
"@rollup/plugin-alias": "^6.0.0",
|
|
118
|
-
"@storybook/addon-docs": "^10.0.
|
|
119
|
-
"@storybook/addon-links": "^10.0.
|
|
120
|
-
"@storybook/react-vite": "^10.0.
|
|
118
|
+
"@storybook/addon-docs": "^10.0.6",
|
|
119
|
+
"@storybook/addon-links": "^10.0.6",
|
|
120
|
+
"@storybook/react-vite": "^10.0.6",
|
|
121
121
|
"@tailwindcss/vite": "^4.1.17",
|
|
122
122
|
"@tanstack/react-query": "^5.90.7",
|
|
123
123
|
"@testing-library/jest-dom": "^6.9.1",
|
|
@@ -128,8 +128,8 @@
|
|
|
128
128
|
"@types/lodash": "^4.17.20",
|
|
129
129
|
"@types/react": "^19.2.2",
|
|
130
130
|
"@types/react-dom": "^19.2.2",
|
|
131
|
-
"@typescript-eslint/eslint-plugin": "^8.46.
|
|
132
|
-
"@typescript-eslint/parser": "^8.46.
|
|
131
|
+
"@typescript-eslint/eslint-plugin": "^8.46.4",
|
|
132
|
+
"@typescript-eslint/parser": "^8.46.4",
|
|
133
133
|
"@vitejs/plugin-react": "^5.1.0",
|
|
134
134
|
"@vitest/coverage-v8": "^3.2.4",
|
|
135
135
|
"autoprefixer": "^10.4.21",
|
|
@@ -147,11 +147,11 @@
|
|
|
147
147
|
"postcss": "^8.5.6",
|
|
148
148
|
"prettier": "^3.6.2",
|
|
149
149
|
"rimraf": "^6.1.0",
|
|
150
|
-
"storybook": "^10.0.
|
|
150
|
+
"storybook": "^10.0.6",
|
|
151
151
|
"tailwindcss": "^4.1.17",
|
|
152
152
|
"ts-node": "^10.9.2",
|
|
153
153
|
"typescript": "^5.9.3",
|
|
154
|
-
"vite": "^7.2.
|
|
154
|
+
"vite": "^7.2.2",
|
|
155
155
|
"vite-plugin-dts": "^4.5.4",
|
|
156
156
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
157
157
|
"vite-plugin-svgr": "^4.5.0",
|