@ztwoint/z-ui 0.1.45 → 0.1.47
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/assets/icons/check.d.ts +8 -0
- package/dist/components/assets/icons/check.js +17 -0
- package/dist/components/assets/icons/x-mark.d.ts +8 -0
- package/dist/components/assets/icons/x-mark.js +17 -0
- package/dist/components/table/components/cell/avatar-cell.d.ts +15 -0
- package/dist/components/table/components/cell/avatar-cell.js +74 -0
- package/dist/components/table/components/cell/boolean-cell.d.ts +1 -2
- package/dist/components/table/components/cell/boolean-cell.js +5 -5
- package/dist/components/table/components/cell/description-cell.d.ts +7 -0
- package/dist/components/table/components/cell/description-cell.js +16 -0
- package/dist/components/table/components/cell/index.d.ts +10 -1
- package/dist/components/table/components/cell/label-cell.d.ts +10 -0
- package/dist/components/table/components/cell/label-cell.js +47 -0
- package/dist/components/table/components/cell/link-cell.d.ts +10 -0
- package/dist/components/table/components/cell/link-cell.js +35 -0
- package/dist/components/table/components/cell/number-cell.d.ts +5 -3
- package/dist/components/table/components/cell/number-cell.js +40 -3
- package/dist/components/table/components/index.d.ts +1 -1
- 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-cell.d.ts +1 -1
- package/dist/components/table/components/table-cell.js +41 -32
- package/dist/components/table/components/table-filter/filters/boolean.js +52 -44
- 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 +113 -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 +79 -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/components/table-header/stories/basic-header.d.ts +1 -1
- package/dist/components/table/components/table-header/table-header.js +10 -10
- package/dist/components/table/index.d.ts +2 -3
- package/dist/components/table/table-provider.d.ts +1 -1
- package/dist/components/table/table-provider.js +50 -21
- package/dist/components/table/table.const.d.ts +10 -8
- package/dist/components/table/table.const.js +10 -8
- package/dist/components/table/table.js +1 -7
- package/dist/components/table/table.type.d.ts +37 -4
- package/dist/components/table/table.utils.d.ts +1 -2
- package/dist/components/table/table.utils.js +7 -3
- package/dist/components/table-card/table-card.js +113 -81
- 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 +106 -111
- package/dist/types/components/assets/icons/check.d.ts +8 -0
- package/dist/types/components/assets/icons/x-mark.d.ts +8 -0
- package/dist/types/components/table/components/cell/avatar-cell.d.ts +15 -0
- package/dist/types/components/table/components/cell/boolean-cell.d.ts +1 -2
- package/dist/types/components/table/components/cell/description-cell.d.ts +7 -0
- package/dist/types/components/table/components/cell/index.d.ts +10 -1
- package/dist/types/components/table/components/cell/label-cell.d.ts +10 -0
- package/dist/types/components/table/components/cell/link-cell.d.ts +10 -0
- package/dist/types/components/table/components/cell/number-cell.d.ts +5 -3
- package/dist/types/components/table/components/index.d.ts +1 -1
- 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-cell.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/components/table-header/stories/basic-header.d.ts +1 -1
- package/dist/types/components/table/index.d.ts +2 -3
- package/dist/types/components/table/table-provider.d.ts +1 -1
- package/dist/types/components/table/table.const.d.ts +10 -8
- package/dist/types/components/table/table.type.d.ts +37 -4
- package/dist/types/components/table/table.utils.d.ts +1 -2
- 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/cell/text-cell.d.ts +0 -7
- package/dist/components/table/components/cell/text-cell.js +0 -5
- 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/node_modules/@heroicons/react/24/solid/esm/CheckCircleIcon.js +0 -26
- package/dist/node_modules/@heroicons/react/24/solid/esm/XCircleIcon.js +0 -26
- package/dist/types/components/table/components/cell/text-cell.d.ts +0 -7
- package/dist/types/components/table/components/table-filter/table-filter.d.ts +0 -9
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
type IconProps = SVGProps<SVGSVGElement> & {
|
|
3
|
+
secondaryfill?: string;
|
|
4
|
+
strokewidth?: number;
|
|
5
|
+
title?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function Check({ title, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default Check;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsxs as e, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
function s({ title: r = "badge 13", ...t }) {
|
|
3
|
+
return /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", ...t, children: [
|
|
4
|
+
/* @__PURE__ */ l("title", { children: r }),
|
|
5
|
+
/* @__PURE__ */ l("g", { fill: "currentColor", children: /* @__PURE__ */ l(
|
|
6
|
+
"path",
|
|
7
|
+
{
|
|
8
|
+
d: "M16,0C7.163,0,0,7.163,0,16s7.163,16,16,16,16-7.163,16-16C31.974,7.174,24.826,.026,16,0Zm7.707,11.707l-10,10c-.195,.195-.451,.293-.707,.293s-.512-.098-.707-.293l-4-4c-.391-.391-.391-1.023,0-1.414s1.023-.391,1.414,0l3.293,3.293,9.293-9.293c.391-.391,1.023-.391,1.414,0s.391,1.023,0,1.414Z",
|
|
9
|
+
fill: "currentColor"
|
|
10
|
+
}
|
|
11
|
+
) })
|
|
12
|
+
] });
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
s as Check,
|
|
16
|
+
s as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
type IconProps = SVGProps<SVGSVGElement> & {
|
|
3
|
+
secondaryfill?: string;
|
|
4
|
+
strokewidth?: number;
|
|
5
|
+
title?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function XMark({ title, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default XMark;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsxs as s, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
function i({ title: r = "badge 13", ...t }) {
|
|
3
|
+
return /* @__PURE__ */ s("svg", { height: "48", width: "48", viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg", ...t, children: [
|
|
4
|
+
/* @__PURE__ */ l("title", { children: r }),
|
|
5
|
+
/* @__PURE__ */ l("g", { fill: "currentColor", children: /* @__PURE__ */ l(
|
|
6
|
+
"path",
|
|
7
|
+
{
|
|
8
|
+
d: "M24,1C11.3,1,1,11.3,1,24s10.3,23,23,23s23-10.3,23-23S36.7,1,24,1z M32.7,31.3c0.4,0.4,0.4,1,0,1.4 C32.5,32.9,32.3,33,32,33s-0.5-0.1-0.7-0.3L24,25.4l-7.3,7.3C16.5,32.9,16.3,33,16,33s-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4 l7.3-7.3l-7.3-7.3c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l7.3,7.3l7.3-7.3c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4L25.4,24L32.7,31.3z",
|
|
9
|
+
fill: "currentColor"
|
|
10
|
+
}
|
|
11
|
+
) })
|
|
12
|
+
] });
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
i as XMark,
|
|
16
|
+
i as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { RootProps, LabelProps } from '../../../avatar/avatar';
|
|
3
|
+
import { CellValue } from '../../table.type';
|
|
4
|
+
export interface AvatarCellProps {
|
|
5
|
+
avatar: {
|
|
6
|
+
label: LabelProps['label'];
|
|
7
|
+
color: RootProps['color'];
|
|
8
|
+
};
|
|
9
|
+
value: CellValue;
|
|
10
|
+
rightIcon?: React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
helperText?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const AvatarCell: FC<AvatarCellProps>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import "react";
|
|
4
|
+
import { cn as r } from "../../../../lib/utils.js";
|
|
5
|
+
import "../../../alert/alert.const.js";
|
|
6
|
+
import "../../../button/button.js";
|
|
7
|
+
import "../../../collapsible-side-nav-bar/side-nav-bar-provider.js";
|
|
8
|
+
import "../../../collapsible-side-nav-bar/side-nav-bar.js";
|
|
9
|
+
import "../../../collapsible-side-nav-bar/side-nav-bar-header.js";
|
|
10
|
+
import "../../../collapsible-side-nav-bar/side-nav-bar-content.js";
|
|
11
|
+
import "../../../collapsible-side-nav-bar/side-nav-bar-footer.js";
|
|
12
|
+
import "../../../collapsible-side-nav-bar/side-nav-bar-group.js";
|
|
13
|
+
import "../../../collapsible-side-nav-bar/side-nav-bar-item.js";
|
|
14
|
+
import "../../../collapsible-side-nav-bar/side-nav-bar-separator.js";
|
|
15
|
+
import "../../../collapsible-side-nav-bar/context.js";
|
|
16
|
+
import "../../../collapsible-side-nav-bar/popover/popover.js";
|
|
17
|
+
import "react-country-flag";
|
|
18
|
+
import "classnames";
|
|
19
|
+
import "@radix-ui/react-dialog";
|
|
20
|
+
import "../../../dropdown/z2-dropdown.js";
|
|
21
|
+
import "@radix-ui/react-dropdown-menu";
|
|
22
|
+
import "lucide-react";
|
|
23
|
+
import "../../../input/input.js";
|
|
24
|
+
import "../../../nav-header/nav-header.js";
|
|
25
|
+
import "../../../nav-header/nav-item/nav-item.js";
|
|
26
|
+
import "@radix-ui/react-select";
|
|
27
|
+
import "../../../stepper/stepper.js";
|
|
28
|
+
import "../../../stepper-item/stepper-item.js";
|
|
29
|
+
import "@radix-ui/react-tabs";
|
|
30
|
+
import "../../table-provider.js";
|
|
31
|
+
import { Avatar as p } from "../../../avatar/avatar.js";
|
|
32
|
+
import "../../table.context.js";
|
|
33
|
+
import "../../../tooltip/tooltip.js";
|
|
34
|
+
import "../../../badge/badge.js";
|
|
35
|
+
const V = ({
|
|
36
|
+
avatar: m,
|
|
37
|
+
value: a,
|
|
38
|
+
rightIcon: e,
|
|
39
|
+
className: s,
|
|
40
|
+
helperText: o,
|
|
41
|
+
description: l
|
|
42
|
+
}) => /* @__PURE__ */ i(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: r(
|
|
46
|
+
"flex flex-col gap-2.5 items-center hover:bg-background-neutral-light h-full min-w-full leading-none-medium-sm p-3",
|
|
47
|
+
s
|
|
48
|
+
),
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ i(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: r(
|
|
54
|
+
"text-text-neutral-primary flex justify-between gap-2.5 min-w-full items-center"
|
|
55
|
+
),
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 h-full", children: [
|
|
58
|
+
/* @__PURE__ */ t(p.Root, { size: "xxs", color: m.color, children: /* @__PURE__ */ t(p.Label, { label: m.label }) }),
|
|
59
|
+
a
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2.5", children: [
|
|
62
|
+
o && /* @__PURE__ */ t("span", { className: "text-text-neutral-secondary", children: o }),
|
|
63
|
+
e && /* @__PURE__ */ t("span", { className: r("min-h-max min-w-max"), children: e })
|
|
64
|
+
] })
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
l && /* @__PURE__ */ t("div", { className: "text-text-neutral-secondary w-full", children: l })
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
export {
|
|
73
|
+
V as AvatarCell
|
|
74
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Check as t } from "../../../assets/icons/check.js";
|
|
3
|
+
import { XMark as l } from "../../../assets/icons/x-mark.js";
|
|
4
|
+
const s = ({ value: e }) => e == null ? null : /* @__PURE__ */ r("div", { className: "flex items-center p-3 h-full", children: e ? /* @__PURE__ */ r(t, { className: "text-green-500 w-3.5 h-3.5" }) : /* @__PURE__ */ r(l, { className: "text-red-500 w-3.5 h-3.5" }) });
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as BooleanCell
|
|
7
7
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { cn as l } from "../../../../lib/utils.js";
|
|
3
|
+
const i = ({ value: e, className: t }) => /* @__PURE__ */ r(
|
|
4
|
+
"div",
|
|
5
|
+
{
|
|
6
|
+
className: l(
|
|
7
|
+
"text-text-neutral-secondary p-3 w-full h-full items-center flex hover:bg-background-neutral-light",
|
|
8
|
+
"leading-[24px] text-[14px]",
|
|
9
|
+
t
|
|
10
|
+
),
|
|
11
|
+
children: e
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
export {
|
|
15
|
+
i as DescriptionCell
|
|
16
|
+
};
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
export { TextCell } from './text-cell';
|
|
2
1
|
export { NumberCell } from './number-cell';
|
|
3
2
|
export { BooleanCell } from './boolean-cell';
|
|
3
|
+
export { LinkCell } from './link-cell';
|
|
4
|
+
export { DescriptionCell } from './description-cell';
|
|
5
|
+
export { AvatarCell } from './avatar-cell';
|
|
6
|
+
export { LabelCell } from './label-cell';
|
|
7
|
+
export type { NumberCellProps } from './number-cell';
|
|
8
|
+
export type { BooleanCellProps } from './boolean-cell';
|
|
9
|
+
export type { LinkCellProps } from './link-cell';
|
|
10
|
+
export type { AvatarCellProps } from './avatar-cell';
|
|
11
|
+
export type { LabelCellProps } from './label-cell';
|
|
12
|
+
export type { DescriptionCellProps } from './description-cell';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CellValue } from '../../table.type';
|
|
2
|
+
export interface LabelCellProps {
|
|
3
|
+
value: CellValue;
|
|
4
|
+
rightIcon?: React.ReactNode;
|
|
5
|
+
leftIcon?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
helperText?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const LabelCell: React.FC<LabelCellProps>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsxs as e, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cn as a } from "../../../../lib/utils.js";
|
|
4
|
+
const u = ({
|
|
5
|
+
value: i,
|
|
6
|
+
leftIcon: n,
|
|
7
|
+
rightIcon: t,
|
|
8
|
+
className: c,
|
|
9
|
+
helperText: m,
|
|
10
|
+
description: s
|
|
11
|
+
}) => {
|
|
12
|
+
const r = "min-h-max min-w-max";
|
|
13
|
+
return /* @__PURE__ */ e(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
className: a(
|
|
17
|
+
"flex flex-row gap-2.5 items-center hover:bg-background-neutral-light h-full min-w-full leading-none-medium-sm p-3",
|
|
18
|
+
s && "flex-col",
|
|
19
|
+
c
|
|
20
|
+
),
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ e(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
className: a(
|
|
26
|
+
"text-text-neutral-primary flex justify-between gap-2.5 min-w-full items-center"
|
|
27
|
+
),
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2.5 h-full", children: [
|
|
30
|
+
n && /* @__PURE__ */ l("span", { className: a(r), children: n }),
|
|
31
|
+
i
|
|
32
|
+
] }),
|
|
33
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2.5", children: [
|
|
34
|
+
m && /* @__PURE__ */ l("span", { className: "text-text-neutral-secondary", children: m }),
|
|
35
|
+
t && /* @__PURE__ */ l("span", { className: a(r), children: t })
|
|
36
|
+
] })
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
s && /* @__PURE__ */ l("div", { className: "text-text-neutral-secondary w-full", children: s })
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
u as LabelCell
|
|
47
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CellValue } from '../../table.type';
|
|
2
|
+
export interface LinkCellProps {
|
|
3
|
+
value: CellValue;
|
|
4
|
+
href: string;
|
|
5
|
+
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
6
|
+
rightIcon?: React.ReactNode;
|
|
7
|
+
leftIcon?: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const LinkCell: React.FC<LinkCellProps>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsxs as s, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
4
|
+
const p = ({
|
|
5
|
+
value: i,
|
|
6
|
+
href: m,
|
|
7
|
+
target: t = "_self",
|
|
8
|
+
leftIcon: n,
|
|
9
|
+
rightIcon: r,
|
|
10
|
+
className: o
|
|
11
|
+
}) => {
|
|
12
|
+
const l = "min-h-max min-w-max";
|
|
13
|
+
return /* @__PURE__ */ s(
|
|
14
|
+
"a",
|
|
15
|
+
{
|
|
16
|
+
href: m,
|
|
17
|
+
target: t,
|
|
18
|
+
rel: "noopener noreferrer",
|
|
19
|
+
className: e(
|
|
20
|
+
"text-text-brand-secondary p-3 leading-none-medium-sm flex flex-row justify-between hover:bg-background-neutral-light gap-2.5 min-w-full min-h-full items-center",
|
|
21
|
+
o
|
|
22
|
+
),
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-2.5 h-full", children: [
|
|
25
|
+
n && /* @__PURE__ */ a("span", { className: e(l), children: n }),
|
|
26
|
+
i
|
|
27
|
+
] }),
|
|
28
|
+
r && /* @__PURE__ */ a("span", { className: e(l), children: r })
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
p as LinkCell
|
|
35
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { CellValue } from '../../table.type';
|
|
2
|
-
|
|
3
|
-
interface NumberCellProps {
|
|
2
|
+
export interface NumberCellProps {
|
|
4
3
|
value: CellValue;
|
|
4
|
+
rightIcon?: React.ReactNode;
|
|
5
|
+
leftIcon?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
helperText?: string;
|
|
5
8
|
}
|
|
6
9
|
export declare const NumberCell: React.FC<NumberCellProps>;
|
|
7
|
-
export {};
|
|
@@ -1,5 +1,42 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cn as l } from "../../../../lib/utils.js";
|
|
4
|
+
const u = ({
|
|
5
|
+
value: r,
|
|
6
|
+
leftIcon: s,
|
|
7
|
+
rightIcon: n,
|
|
8
|
+
className: t,
|
|
9
|
+
helperText: i
|
|
10
|
+
}) => {
|
|
11
|
+
const m = "min-h-max min-w-max";
|
|
12
|
+
return /* @__PURE__ */ e(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
className: l(
|
|
16
|
+
"flex gap-2.5 items-center hover:bg-background-neutral-light h-full min-w-full leading-none-medium-sm p-3",
|
|
17
|
+
t
|
|
18
|
+
),
|
|
19
|
+
children: /* @__PURE__ */ a(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: l(
|
|
23
|
+
"text-text-neutral-primary flex justify-between gap-2.5 min-w-full items-center"
|
|
24
|
+
),
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2.5 h-full", children: [
|
|
27
|
+
s && /* @__PURE__ */ e("span", { className: l(m), children: s }),
|
|
28
|
+
i && /* @__PURE__ */ e("span", { className: "text-text-neutral-secondary", children: i })
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2.5", children: [
|
|
31
|
+
r,
|
|
32
|
+
n && /* @__PURE__ */ e("span", { className: l(m), children: n })
|
|
33
|
+
] })
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
};
|
|
3
40
|
export {
|
|
4
|
-
|
|
41
|
+
u as NumberCell
|
|
5
42
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { TableCell } from './table-cell';
|
|
2
|
-
export {
|
|
2
|
+
export { NumberCell, BooleanCell, AvatarCell, DescriptionCell, LabelCell, LinkCell } from './cell';
|
|
3
3
|
export { TableHeader } from './table-header';
|
|
4
4
|
export { TableRow } from './table-row';
|
|
5
5
|
export { TableEmptyState } from './table-empty-state';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { Pagination, default } from './pagination';
|
|
2
|
+
export { PaginationInfo, PaginationQuickJumper } from './components';
|
|
2
3
|
export type { PaginationProps, PaginationInfoProps, PaginationQuickJumperProps, } from './pagination.type';
|
|
3
4
|
export { usePagination } from './pagination.hook';
|
|
4
5
|
export { usePaginationQuickJumper } from './components/pagination-quick-jumper.hook';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PaginationHookProps, PaginationHookReturn } from './pagination.type';
|
|
2
|
-
export declare const usePagination: (
|
|
2
|
+
export declare const usePagination: ({ currentPage, totalPage, maxVisiblePages, }: PaginationHookProps) => PaginationHookReturn & {
|
|
3
3
|
goToPage: (page: number) => boolean;
|
|
4
4
|
canGoToPage: (page: number) => boolean;
|
|
5
5
|
};
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
import { calculateVisiblePages as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { useMemo as u, useCallback as s } from "react";
|
|
2
|
+
import { calculateVisiblePages as a, isValidPageNumber as m } from "./pagination.utils.js";
|
|
3
|
+
const f = ({
|
|
4
|
+
currentPage: e,
|
|
5
|
+
totalPage: o,
|
|
6
|
+
maxVisiblePages: i
|
|
7
|
+
}) => {
|
|
8
|
+
const t = u(
|
|
9
|
+
() => a({ currentPage: e, totalPage: o, maxVisiblePages: i }),
|
|
10
|
+
[e, o, i]
|
|
11
|
+
), n = s(
|
|
12
|
+
(r) => m(r, o),
|
|
13
|
+
[o]
|
|
14
|
+
), c = s(
|
|
15
|
+
(r) => n(r),
|
|
16
|
+
[n]
|
|
13
17
|
);
|
|
14
18
|
return {
|
|
15
|
-
...
|
|
16
|
-
goToPage:
|
|
17
|
-
canGoToPage:
|
|
19
|
+
...t,
|
|
20
|
+
goToPage: c,
|
|
21
|
+
canGoToPage: n
|
|
18
22
|
};
|
|
19
23
|
};
|
|
20
24
|
export {
|
|
21
|
-
|
|
25
|
+
f as usePagination
|
|
22
26
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CellValue, CellType, CellRenderer, TableProps } from '../table.type';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
interface TableCellProps {
|
|
4
|
-
value: CellValue
|
|
4
|
+
value: CellValue | Record<string, unknown>;
|
|
5
5
|
cellType: CellType;
|
|
6
6
|
cellRenderer?: CellRenderer;
|
|
7
7
|
customCells?: Record<string, CellRenderer>;
|
|
@@ -1,46 +1,55 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { TABLE_CSS_CLASSES as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { TABLE_CSS_CLASSES as s } from "../table.const.js";
|
|
3
|
+
import { NumberCell as S } from "./cell/number-cell.js";
|
|
4
|
+
import { BooleanCell as C } from "./cell/boolean-cell.js";
|
|
5
|
+
import { LinkCell as d } from "./cell/link-cell.js";
|
|
6
|
+
import { DescriptionCell as h } from "./cell/description-cell.js";
|
|
7
|
+
import { AvatarCell as u } from "./cell/avatar-cell.js";
|
|
8
|
+
import { LabelCell as c } from "./cell/label-cell.js";
|
|
6
9
|
import "react";
|
|
7
|
-
import { cn as
|
|
8
|
-
const
|
|
9
|
-
value:
|
|
10
|
-
cellType:
|
|
11
|
-
cellRenderer:
|
|
10
|
+
import { cn as B } from "../../../lib/utils.js";
|
|
11
|
+
const T = ({
|
|
12
|
+
value: o,
|
|
13
|
+
cellType: m,
|
|
14
|
+
cellRenderer: n,
|
|
12
15
|
record: i,
|
|
13
|
-
index:
|
|
16
|
+
index: a,
|
|
14
17
|
customCells: e,
|
|
15
|
-
cell:
|
|
18
|
+
cell: b
|
|
16
19
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
text:
|
|
19
|
-
number:
|
|
20
|
-
boolean:
|
|
21
|
-
checkbox:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
const A = {
|
|
21
|
+
text: c,
|
|
22
|
+
number: S,
|
|
23
|
+
boolean: C,
|
|
24
|
+
checkbox: C,
|
|
25
|
+
link: d,
|
|
26
|
+
avatar: u,
|
|
27
|
+
label: c
|
|
28
|
+
}, f = e == null ? void 0 : e[m];
|
|
29
|
+
let r;
|
|
30
|
+
if (n)
|
|
31
|
+
r = n({ value: o, record: i, index: a });
|
|
32
|
+
else if (f)
|
|
33
|
+
r = /* @__PURE__ */ t(f, { value: o, record: i, index: a });
|
|
28
34
|
else {
|
|
29
|
-
const
|
|
30
|
-
o
|
|
35
|
+
const l = A[m] ?? h;
|
|
36
|
+
if (typeof o == "object" && o !== null && !Array.isArray(o)) {
|
|
37
|
+
const p = o, L = { value: p.value ?? "", ...p };
|
|
38
|
+
r = /* @__PURE__ */ t(l, { ...L });
|
|
39
|
+
} else
|
|
40
|
+
r = /* @__PURE__ */ t(l, { value: o ?? "" });
|
|
31
41
|
}
|
|
32
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ t(
|
|
33
43
|
"td",
|
|
34
44
|
{
|
|
35
|
-
className:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
r.cell.hasBorder[s.hasBorder ? "true" : "false"]
|
|
45
|
+
className: B(
|
|
46
|
+
s.cell.default,
|
|
47
|
+
s.cell.hasBorder[b.hasBorder ? "true" : "false"]
|
|
39
48
|
),
|
|
40
|
-
children:
|
|
49
|
+
children: r
|
|
41
50
|
}
|
|
42
51
|
);
|
|
43
52
|
};
|
|
44
53
|
export {
|
|
45
|
-
|
|
54
|
+
T as TableCell
|
|
46
55
|
};
|