@konstructio/ui 0.1.2-alpha.25 → 0.1.2-alpha.26
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,40 +1,72 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Button as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { E as
|
|
5
|
-
const
|
|
6
|
-
actions:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Button as t } from "../../../Button/Button.js";
|
|
3
|
+
import { cn as r } from "../../../../utils/index.js";
|
|
4
|
+
import { E as u } from "../../../../ellipsis-vertical-BVPtjl5f.js";
|
|
5
|
+
const w = ({
|
|
6
|
+
actions: a,
|
|
7
|
+
wrapperClassName: l,
|
|
8
|
+
triggerButtonClassName: s,
|
|
9
|
+
iconTriggerButtonClassName: n,
|
|
10
|
+
wrapperActionsClassName: c,
|
|
11
|
+
wrapperContentActionsClassName: d,
|
|
12
|
+
...h
|
|
13
|
+
}) => a ? /* @__PURE__ */ i("div", { className: r("relative group", l), children: [
|
|
14
|
+
/* @__PURE__ */ i(
|
|
15
|
+
t,
|
|
11
16
|
{
|
|
12
17
|
variant: "text",
|
|
13
18
|
shape: "circle",
|
|
14
19
|
size: "large",
|
|
15
|
-
className:
|
|
20
|
+
className: r(
|
|
21
|
+
"text-slate-400 group-hover:text-slate-800 group-hover:bg-aurora-50",
|
|
22
|
+
s
|
|
23
|
+
),
|
|
16
24
|
role: "presentation",
|
|
17
25
|
children: [
|
|
18
|
-
/* @__PURE__ */ e(
|
|
26
|
+
/* @__PURE__ */ e(
|
|
27
|
+
u,
|
|
28
|
+
{
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
className: r("w-7 h-7", n)
|
|
31
|
+
}
|
|
32
|
+
),
|
|
19
33
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Show Actions" })
|
|
20
34
|
]
|
|
21
35
|
}
|
|
22
36
|
),
|
|
23
|
-
/* @__PURE__ */ e(
|
|
24
|
-
|
|
37
|
+
/* @__PURE__ */ e(
|
|
38
|
+
"div",
|
|
25
39
|
{
|
|
26
|
-
className:
|
|
27
|
-
"
|
|
28
|
-
|
|
40
|
+
className: r(
|
|
41
|
+
"absolute top-full right-0 w-[215px] hidden group-hover:block z-10",
|
|
42
|
+
c
|
|
29
43
|
),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
children: /* @__PURE__ */ e(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
className: r(
|
|
48
|
+
"bg-white mt-0.5 py-2 rounded-lg shadow-lg border border-zinc-100 animate-in fade-in-0",
|
|
49
|
+
d
|
|
50
|
+
),
|
|
51
|
+
children: a.map(({ label: o, className: p, onClick: m }) => /* @__PURE__ */ e(
|
|
52
|
+
t,
|
|
53
|
+
{
|
|
54
|
+
className: r(
|
|
55
|
+
"w-full text-slate-800 cursor-pointer p-0 h-9 flex gap-2 text-sm font-normal justify-start hover:bg-gray-50 hover:text-slate-800 rounded-none px-6",
|
|
56
|
+
p
|
|
57
|
+
),
|
|
58
|
+
variant: "text",
|
|
59
|
+
asChild: !0,
|
|
60
|
+
role: "presentation",
|
|
61
|
+
children: /* @__PURE__ */ e(t, { onClick: () => m(h.row.original), children: o })
|
|
62
|
+
},
|
|
63
|
+
o
|
|
64
|
+
))
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
)
|
|
37
69
|
] }) : null;
|
|
38
70
|
export {
|
|
39
|
-
|
|
71
|
+
w as Actions
|
|
40
72
|
};
|
|
@@ -1,48 +1,51 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { f as
|
|
3
|
-
import { Skeleton as
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { f as y } from "../../../../index-CSWGJT-v.js";
|
|
3
|
+
import { Skeleton as x } from "../Skeleton/Skeleton.js";
|
|
4
4
|
import { cn as b } from "../../../../utils/index.js";
|
|
5
|
-
import { useTableContext as
|
|
6
|
-
const
|
|
5
|
+
import { useTableContext as D } from "../../contexts/table.hook.js";
|
|
6
|
+
const _ = ({
|
|
7
7
|
isLoading: d,
|
|
8
8
|
showPagination: a
|
|
9
9
|
}) => {
|
|
10
|
-
const { table:
|
|
11
|
-
if (d ||
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
const
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
const { meta: n = {} } =
|
|
16
|
-
return /* @__PURE__ */
|
|
10
|
+
const { table: s, pageSize: i, tableFetching: p } = D();
|
|
11
|
+
if (d || p)
|
|
12
|
+
return /* @__PURE__ */ e(x, { numberOfRows: i, table: s });
|
|
13
|
+
const r = s.getRowModel().rows ?? [];
|
|
14
|
+
return /* @__PURE__ */ e("tbody", { className: "text-slate-800 text-sm font-normal relative", children: r.map(({ id: o, original: l, getVisibleCells: u }, m) => {
|
|
15
|
+
const { meta: n = {} } = l, c = u();
|
|
16
|
+
return /* @__PURE__ */ e(
|
|
17
17
|
"tr",
|
|
18
18
|
{
|
|
19
19
|
className: b(
|
|
20
20
|
"border-b border-b-gray-200 last:border-b-transparent bg-transparent",
|
|
21
21
|
n.className
|
|
22
22
|
),
|
|
23
|
-
"data-row-id":
|
|
23
|
+
"data-row-id": o,
|
|
24
24
|
...n.attributes ?? {},
|
|
25
|
-
children:
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
children: c.map(({ id: g, column: t, getContext: h }, f) => {
|
|
26
|
+
const N = typeof t.columnDef.meta?.className == "function" ? t.columnDef.meta?.className(l) : t.columnDef.meta?.className;
|
|
27
|
+
return /* @__PURE__ */ e(
|
|
28
|
+
"td",
|
|
29
|
+
{
|
|
30
|
+
className: b(
|
|
31
|
+
"px-4 py-1 text-sm bg-white",
|
|
32
|
+
N,
|
|
33
|
+
{
|
|
34
|
+
"[tr:last-child_&:first-of-type]:rounded-bl-lg": m === r.length - 1 && f === 0 || !a,
|
|
35
|
+
"[tr:last-child_&:last-of-type]:rounded-br-lg": m === r.length - 1 && f === c.length - 1 || !a
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
...t.columnDef.meta?.attributes ?? {},
|
|
39
|
+
children: y(t.columnDef.cell, h())
|
|
40
|
+
},
|
|
41
|
+
g
|
|
42
|
+
);
|
|
43
|
+
})
|
|
41
44
|
},
|
|
42
|
-
|
|
45
|
+
o
|
|
43
46
|
);
|
|
44
47
|
}) });
|
|
45
48
|
};
|
|
46
49
|
export {
|
|
47
|
-
|
|
50
|
+
_ as Body
|
|
48
51
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -645,6 +645,11 @@ declare type Props_4<TData extends RowData_2> = VariantProps<typeof virtualizeTa
|
|
|
645
645
|
|
|
646
646
|
declare type Props_5<TData extends RowData> = CellContext<TData, unknown> & {
|
|
647
647
|
actions: Action<TData>[];
|
|
648
|
+
iconTriggerButtonClassName?: string;
|
|
649
|
+
triggerButtonClassName?: string;
|
|
650
|
+
wrapperActionsClassName?: string;
|
|
651
|
+
wrapperClassName?: string;
|
|
652
|
+
wrapperContentActionsClassName?: string;
|
|
648
653
|
};
|
|
649
654
|
|
|
650
655
|
export declare const Radio: FC<RadioProps>;
|
|
@@ -980,7 +985,7 @@ export { }
|
|
|
980
985
|
|
|
981
986
|
declare module '@tanstack/react-table' {
|
|
982
987
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
983
|
-
className?: string;
|
|
988
|
+
className?: string | ((row: TData) => string);
|
|
984
989
|
attributes?: Record<string, string | number | boolean>;
|
|
985
990
|
headerClassName?: string;
|
|
986
991
|
}
|
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.25",
|
|
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.26",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|