@ztwoint/z-ui 0.1.64 → 0.1.66
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/column-reorder/column-reorder.js +20 -10
- package/dist/components/column-reorder/column-reorder.type.d.ts +1 -0
- package/dist/components/column-reorder/components/column-item/column-item.js +42 -37
- package/dist/components/column-reorder/components/column-item/column-item.type.d.ts +1 -0
- package/dist/components/table/components/cell/avatar-cell.js +3 -2
- package/dist/components/table/index.d.ts +1 -1
- package/dist/components/table/table-provider.d.ts +0 -2
- package/dist/components/table/table-provider.js +20 -23
- package/dist/components/table/table.type.d.ts +0 -20
- package/dist/components/table-card/table-card.js +50 -49
- package/dist/components/table-card/table-card.type.d.ts +3 -1
- package/dist/components/{table/components/table-filter → table-filter}/close-filter-confirm/filter-confirmation-dialog.js +2 -2
- package/dist/{types/components/table/components → components}/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.d.ts +1 -1
- package/dist/components/{table/components/table-filter → table-filter}/filters/checkbox.js +2 -2
- package/dist/components/{table/components/table-filter → table-filter}/filters/number/filter-input-field.js +1 -1
- package/dist/components/{table/components/table-filter → table-filter}/filters/text.js +3 -3
- package/dist/components/table-filter/index.d.ts +9 -0
- package/dist/components/table-filter/index.js +11 -0
- package/dist/{types/components/table/components → components}/table-filter/selected-filters-display/selected-filters-display.type.d.ts +2 -2
- package/dist/components/{table/components/table-filter → table-filter}/selected-filters-display/selected-filters-display.utils.d.ts +2 -2
- package/dist/components/table-filter/selected-filters-display/selected-filters-display.utils.js +30 -0
- package/dist/components/{table/components/table-filter → table-filter}/table-filter-button.js +71 -67
- package/dist/components/table-filter/table-filter-column-button.js +110 -0
- package/dist/components/table-filter/table-filter-provider.d.ts +3 -0
- package/dist/components/table-filter/table-filter-provider.js +27 -0
- package/dist/components/{table/components/table-filter → table-filter}/table-filter.context.d.ts +2 -4
- package/dist/components/{table/components/table-filter → table-filter}/table-filter.hook.d.ts +2 -4
- package/dist/components/{table/components/table-filter → table-filter}/table-filter.hook.js +23 -24
- package/dist/components/table-filter/table-filter.type.d.ts +44 -0
- package/dist/routes/table.d.ts +3 -0
- package/dist/types/components/column-reorder/column-reorder.type.d.ts +1 -0
- package/dist/types/components/column-reorder/components/column-item/column-item.type.d.ts +1 -0
- package/dist/types/components/table/index.d.ts +1 -1
- package/dist/types/components/table/table-provider.d.ts +0 -2
- package/dist/types/components/table/table.type.d.ts +0 -20
- package/dist/types/components/table-card/table-card.type.d.ts +4 -1
- package/dist/{components/table → types}/components/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.d.ts +1 -1
- package/dist/types/components/table-filter/index.d.ts +9 -0
- package/dist/{components/table → types}/components/table-filter/selected-filters-display/selected-filters-display.type.d.ts +2 -2
- package/dist/types/components/{table/components/table-filter → table-filter}/selected-filters-display/selected-filters-display.utils.d.ts +2 -2
- package/dist/types/components/table-filter/table-filter-provider.d.ts +3 -0
- package/dist/types/components/{table/components/table-filter → table-filter}/table-filter.context.d.ts +3 -3
- package/dist/types/components/{table/components/table-filter → table-filter}/table-filter.hook.d.ts +2 -3
- package/dist/types/components/table-filter/table-filter.type.d.ts +44 -0
- package/dist/types/routes/table.d.ts +3 -0
- package/package.json +1 -1
- package/dist/components/table/components/table-filter/index.d.ts +0 -4
- package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.utils.js +0 -26
- package/dist/components/table/components/table-filter/table-filter-column-button.js +0 -108
- package/dist/components/table/components/table-filter/table-filter-provider.d.ts +0 -14
- package/dist/components/table/components/table-filter/table-filter-provider.js +0 -32
- package/dist/components/table/components/table-filter/table-filter.type.d.ts +0 -19
- package/dist/types/components/table/components/table-filter/index.d.ts +0 -4
- package/dist/types/components/table/components/table-filter/table-filter-provider.d.ts +0 -14
- package/dist/types/components/table/components/table-filter/table-filter.type.d.ts +0 -19
- /package/dist/components/{table/components/table-filter → table-filter}/close-filter-confirm/filter-confirmation-dialog.d.ts +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/close-filter-confirm/filter-confirmation-dialog.utils.js +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/filters/boolean.d.ts +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/filters/boolean.js +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/filters/checkbox.d.ts +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/filters/index.d.ts +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/filters/number/filter-input-field.d.ts +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/filters/number/index.d.ts +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/filters/number/number.d.ts +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/filters/number/number.hook.d.ts +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/filters/number/number.hook.js +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/filters/number/number.js +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/filters/text.d.ts +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/selected-filters-display/index.d.ts +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/selected-filters-display/selected-filters-display.d.ts +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/selected-filters-display/selected-filters-display.js +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/table-filter-button.d.ts +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/table-filter-column-button.d.ts +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/table-filter-column-button.type.d.ts +0 -0
- /package/dist/components/{table/components/table-filter → table-filter}/table-filter.context.js +0 -0
- /package/dist/types/components/{table/components/table-filter → table-filter}/close-filter-confirm/filter-confirmation-dialog.d.ts +0 -0
- /package/dist/types/components/{table/components/table-filter → table-filter}/filters/boolean.d.ts +0 -0
- /package/dist/types/components/{table/components/table-filter → table-filter}/filters/checkbox.d.ts +0 -0
- /package/dist/types/components/{table/components/table-filter → table-filter}/filters/index.d.ts +0 -0
- /package/dist/types/components/{table/components/table-filter → table-filter}/filters/number/filter-input-field.d.ts +0 -0
- /package/dist/types/components/{table/components/table-filter → table-filter}/filters/number/index.d.ts +0 -0
- /package/dist/types/components/{table/components/table-filter → table-filter}/filters/number/number.d.ts +0 -0
- /package/dist/types/components/{table/components/table-filter → table-filter}/filters/number/number.hook.d.ts +0 -0
- /package/dist/types/components/{table/components/table-filter → table-filter}/filters/text.d.ts +0 -0
- /package/dist/types/components/{table/components/table-filter → table-filter}/selected-filters-display/index.d.ts +0 -0
- /package/dist/types/components/{table/components/table-filter → table-filter}/selected-filters-display/selected-filters-display.d.ts +0 -0
- /package/dist/types/components/{table/components/table-filter → table-filter}/table-filter-button.d.ts +0 -0
- /package/dist/types/components/{table/components/table-filter → table-filter}/table-filter-column-button.d.ts +0 -0
- /package/dist/types/components/{table/components/table-filter → table-filter}/table-filter-column-button.type.d.ts +0 -0
|
@@ -1,26 +1,36 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { ColumnItem as
|
|
5
|
-
import { useColumnReorder as
|
|
6
|
-
const
|
|
3
|
+
import { cn as s } from "../../lib/utils.js";
|
|
4
|
+
import { ColumnItem as a } from "./components/column-item/column-item.js";
|
|
5
|
+
import { useColumnReorder as u } from "./column-reorder.hook.js";
|
|
6
|
+
const v = ({
|
|
7
7
|
columns: e,
|
|
8
8
|
onReorder: d,
|
|
9
9
|
onRemove: i,
|
|
10
|
-
|
|
10
|
+
renderAction: m,
|
|
11
|
+
className: t
|
|
11
12
|
}) => {
|
|
12
|
-
const { internalColumns:
|
|
13
|
+
const { internalColumns: l } = u({ columns: e, onReorder: d });
|
|
13
14
|
return /* @__PURE__ */ r(
|
|
14
15
|
"div",
|
|
15
16
|
{
|
|
16
|
-
className:
|
|
17
|
+
className: s(
|
|
17
18
|
"rounded-2xl border-[0.5px] border-stroke-solid-light bg-background-neutral-default overflow-hidden box-shadow-medium-10",
|
|
18
|
-
|
|
19
|
+
t
|
|
19
20
|
),
|
|
20
|
-
children: /* @__PURE__ */ r("div", { className: "divide-y divide-stroke-solid-light", children:
|
|
21
|
+
children: /* @__PURE__ */ r("div", { className: "divide-y divide-stroke-solid-light", children: l.map((o, n) => /* @__PURE__ */ r(
|
|
22
|
+
a,
|
|
23
|
+
{
|
|
24
|
+
column: o,
|
|
25
|
+
index: n,
|
|
26
|
+
onRemove: i,
|
|
27
|
+
renderAction: m
|
|
28
|
+
},
|
|
29
|
+
o.id
|
|
30
|
+
)) })
|
|
21
31
|
}
|
|
22
32
|
);
|
|
23
33
|
};
|
|
24
34
|
export {
|
|
25
|
-
|
|
35
|
+
v as ColumnReOrder
|
|
26
36
|
};
|
|
@@ -8,5 +8,6 @@ export interface ColumnReOrderProps {
|
|
|
8
8
|
columns: ColumnType[];
|
|
9
9
|
onReorder?: (reorderedColumns: ColumnType[]) => void;
|
|
10
10
|
onRemove?: (columnId: string) => void;
|
|
11
|
+
renderAction?: (column: ColumnType, onRemove: ((columnId: string) => void) | undefined) => React.ReactNode;
|
|
11
12
|
className?: string;
|
|
12
13
|
}
|
|
@@ -1,79 +1,84 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createPortal as
|
|
1
|
+
import { jsxs as i, Fragment as g, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { createPortal as p } from "react-dom";
|
|
3
3
|
import "react";
|
|
4
|
-
import { cn as
|
|
5
|
-
import { useColumnItemDragAndDrop as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Minus as
|
|
8
|
-
import { parseColumnLabel as
|
|
9
|
-
import
|
|
10
|
-
const
|
|
4
|
+
import { cn as l } from "../../../../lib/utils.js";
|
|
5
|
+
import { useColumnItemDragAndDrop as f } from "./column-item.hook.js";
|
|
6
|
+
import { Button as h } from "../../../button/button.js";
|
|
7
|
+
import { Minus as x } from "../../../assets/icons/minus.js";
|
|
8
|
+
import { parseColumnLabel as c } from "./column-item.util.js";
|
|
9
|
+
import d from "../../../assets/icons/drag-handle.js";
|
|
10
|
+
const b = {
|
|
11
11
|
"is-dragging": "opacity-40",
|
|
12
12
|
"is-dragging-over": "bg-background-neutral-medium"
|
|
13
|
-
},
|
|
13
|
+
}, N = ({
|
|
14
14
|
edge: t,
|
|
15
15
|
isFirstElement: r = !1
|
|
16
16
|
}) => /* @__PURE__ */ e(
|
|
17
17
|
"div",
|
|
18
18
|
{
|
|
19
|
-
className:
|
|
19
|
+
className: l(
|
|
20
20
|
"absolute left-0 right-0 h-0.5 bg-blue-500",
|
|
21
21
|
t === "top" ? r ? "top-0" : "top-[-3px]" : "bottom-0"
|
|
22
22
|
)
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
|
-
function
|
|
26
|
-
const { groupLabel: r, fieldLabel:
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */ e(
|
|
25
|
+
function v({ column: t }) {
|
|
26
|
+
const { groupLabel: r, fieldLabel: a } = c(t);
|
|
27
|
+
return /* @__PURE__ */ i("div", { className: "flex items-center gap-3 p-1 bg-background-neutral-default border border-stroke-solid-light rounded-xl ", children: [
|
|
28
|
+
/* @__PURE__ */ e(d, {}),
|
|
29
29
|
/* @__PURE__ */ e("div", { className: "shrink-0 flex items-center justify-center w-3.5 h-3.5 ", children: t.icon }),
|
|
30
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-0.5 min-w-0 leading-none-regular-sm", children: [
|
|
31
31
|
/* @__PURE__ */ e("span", { className: "text-text-neutral-secondary truncate", children: r }),
|
|
32
32
|
/* @__PURE__ */ e("span", { className: "text-text-neutral-muted", children: "/" }),
|
|
33
|
-
/* @__PURE__ */ e("span", { className: "text-text-neutral-primary truncate", children:
|
|
33
|
+
/* @__PURE__ */ e("span", { className: "text-text-neutral-primary truncate", children: a })
|
|
34
34
|
] })
|
|
35
35
|
] });
|
|
36
36
|
}
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
const F = ({
|
|
38
|
+
column: t,
|
|
39
|
+
index: r,
|
|
40
|
+
onRemove: a,
|
|
41
|
+
renderAction: n
|
|
42
|
+
}) => {
|
|
43
|
+
const { ref: o, state: s } = f(t, r), { groupLabel: m, fieldLabel: u } = c(t);
|
|
44
|
+
return /* @__PURE__ */ i(g, { children: [
|
|
45
|
+
/* @__PURE__ */ i("div", { className: "relative border-b-0.5", children: [
|
|
46
|
+
/* @__PURE__ */ i(
|
|
42
47
|
"div",
|
|
43
48
|
{
|
|
44
49
|
"data-column-id": t.id,
|
|
45
|
-
ref:
|
|
46
|
-
className:
|
|
50
|
+
ref: o,
|
|
51
|
+
className: l(
|
|
47
52
|
"flex items-center gap-2 p-1 pl-3 bg-background-neutral-default cursor-grab hover:bg-background-neutral-medium transition-colors",
|
|
48
|
-
|
|
53
|
+
b[s.type] ?? ""
|
|
49
54
|
),
|
|
50
55
|
children: [
|
|
51
|
-
/* @__PURE__ */ e(
|
|
56
|
+
/* @__PURE__ */ e(d, {}),
|
|
52
57
|
/* @__PURE__ */ e("div", { className: "shrink-0 flex items-center justify-center w-3.5 h-3.5", children: t.icon }),
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */ e("span", { className: "text-text-neutral-secondary truncate", children:
|
|
58
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-0.5 min-w-0 leading-none-regular-sm", children: [
|
|
59
|
+
/* @__PURE__ */ e("span", { className: "text-text-neutral-secondary truncate", children: m }),
|
|
55
60
|
/* @__PURE__ */ e("span", { className: "text-text-neutral-muted", children: "/" }),
|
|
56
|
-
/* @__PURE__ */ e("span", { className: "text-text-neutral-primary truncate", children:
|
|
61
|
+
/* @__PURE__ */ e("span", { className: "text-text-neutral-primary truncate", children: u })
|
|
57
62
|
] }),
|
|
58
|
-
/* @__PURE__ */ e("div", { className: "ml-auto flex items-center gap-3", children: /* @__PURE__ */ e(
|
|
59
|
-
|
|
63
|
+
/* @__PURE__ */ e("div", { className: "ml-auto flex items-center gap-3", children: n ? n(t, a) : /* @__PURE__ */ e(
|
|
64
|
+
h,
|
|
60
65
|
{
|
|
61
|
-
onClick: () =>
|
|
66
|
+
onClick: () => a == null ? void 0 : a(t.id),
|
|
62
67
|
variant: "ghost",
|
|
63
68
|
shade: "neutral",
|
|
64
69
|
size: "medium",
|
|
65
|
-
leftIcon: /* @__PURE__ */ e(
|
|
70
|
+
leftIcon: /* @__PURE__ */ e(x, { className: "w-4 h-4" })
|
|
66
71
|
}
|
|
67
72
|
) })
|
|
68
73
|
]
|
|
69
74
|
}
|
|
70
75
|
),
|
|
71
|
-
|
|
76
|
+
s.type === "is-dragging-over" && s.closestEdge && /* @__PURE__ */ e(N, { edge: s.closestEdge, isFirstElement: r === 0 })
|
|
72
77
|
] }),
|
|
73
|
-
|
|
78
|
+
s.type === "preview" && p(/* @__PURE__ */ e(v, { column: t }), s.container)
|
|
74
79
|
] });
|
|
75
80
|
};
|
|
76
81
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
82
|
+
F as ColumnItem,
|
|
83
|
+
F as default
|
|
79
84
|
};
|
|
@@ -32,12 +32,13 @@ import "../../table-provider.js";
|
|
|
32
32
|
import { Avatar as p } from "../../../avatar/avatar.js";
|
|
33
33
|
import "../../table.context.js";
|
|
34
34
|
import "../../../tooltip/tooltip.js";
|
|
35
|
+
import "../../../table-filter/index.js";
|
|
35
36
|
import "../../../badge/badge.js";
|
|
36
37
|
import "../../../text-preset/text-preset.js";
|
|
37
38
|
import "react-dom";
|
|
38
39
|
import "../../../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js";
|
|
39
40
|
import "../../../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dispatch-consumer-event.js";
|
|
40
|
-
const
|
|
41
|
+
const $ = ({
|
|
41
42
|
avatar: m,
|
|
42
43
|
value: a,
|
|
43
44
|
rightIcon: o,
|
|
@@ -75,5 +76,5 @@ const _ = ({
|
|
|
75
76
|
}
|
|
76
77
|
);
|
|
77
78
|
export {
|
|
78
|
-
|
|
79
|
+
$ as AvatarCell
|
|
79
80
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Table as default, Table, TableProvider } from './table-provider';
|
|
2
2
|
export { TableBody } from './table';
|
|
3
|
-
export type { TableProps, TableSchema, TableSchemaColumn, CellType, CellValue, CellRenderer, CellRendererProps,
|
|
3
|
+
export type { TableProps, TableSchema, TableSchemaColumn, CellType, CellValue, CellRenderer, CellRendererProps, TablePaginationConfig, SortDirection, SortColumn, TableSort, } from './table.type';
|
|
4
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';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TableProps } from './table.type';
|
|
2
2
|
import { TableBody } from './table';
|
|
3
|
-
import { TableFilter } from './components/table-filter/table-filter-provider';
|
|
4
3
|
import { TableSearch } from './components/table-search';
|
|
5
4
|
import { Pagination } from './components/pagination';
|
|
6
5
|
import { TableHeaderWrapper, TableHeaderContent, TableFooter, TableFooterContent } from './components';
|
|
@@ -12,7 +11,6 @@ export interface TableProviderProps extends TableProps {
|
|
|
12
11
|
declare const TableProvider: React.FC<TableProviderProps>;
|
|
13
12
|
interface TableCompoundComponent extends React.FC<TableProviderProps> {
|
|
14
13
|
Body: typeof TableBody;
|
|
15
|
-
Filter: typeof TableFilter;
|
|
16
14
|
Search: typeof TableSearch;
|
|
17
15
|
Pagination: typeof Pagination;
|
|
18
16
|
PaginationInfo: typeof PaginationInfo;
|
|
@@ -2,11 +2,10 @@ import { jsx as p } from "react/jsx-runtime";
|
|
|
2
2
|
import * as e from "react";
|
|
3
3
|
import { TableContext as a } from "./table.context.js";
|
|
4
4
|
import { TableBody as n } from "./table.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { PaginationQuickJumper as b } from "./components/pagination/components/pagination-quick-jumper.js";
|
|
5
|
+
import { TableSearch as f } from "./components/table-search/table-search.js";
|
|
6
|
+
import { Pagination as l } from "./components/pagination/pagination.js";
|
|
7
|
+
import { PaginationInfo as c } from "./components/pagination/components/pagination-info.js";
|
|
8
|
+
import { PaginationQuickJumper as d } from "./components/pagination/components/pagination-quick-jumper.js";
|
|
10
9
|
import "clsx";
|
|
11
10
|
import "tailwind-merge";
|
|
12
11
|
/* empty css */
|
|
@@ -37,22 +36,21 @@ import "../stepper/stepper.js";
|
|
|
37
36
|
import "../stepper-item/stepper-item.js";
|
|
38
37
|
import "@radix-ui/react-tabs";
|
|
39
38
|
import "../tooltip/tooltip.js";
|
|
39
|
+
import "../table-filter/index.js";
|
|
40
40
|
import "../badge/badge.js";
|
|
41
41
|
import "../avatar/avatar.js";
|
|
42
42
|
import "../text-preset/text-preset.js";
|
|
43
43
|
import "react-dom";
|
|
44
44
|
import "../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js";
|
|
45
45
|
import "../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dispatch-consumer-event.js";
|
|
46
|
-
import { TableHeaderWrapper as
|
|
47
|
-
import { TableHeaderContent as
|
|
48
|
-
import { TableFooter as
|
|
49
|
-
import { TableFooterContent as
|
|
46
|
+
import { TableHeaderWrapper as T } from "./components/table-header-wrapper.js";
|
|
47
|
+
import { TableHeaderContent as b } from "./components/table-header-content.js";
|
|
48
|
+
import { TableFooter as s } from "./components/table-footer.js";
|
|
49
|
+
import { TableFooterContent as u } from "./components/table-footer-content.js";
|
|
50
50
|
const t = ({
|
|
51
51
|
children: i,
|
|
52
|
-
pagination:
|
|
53
|
-
sort:
|
|
54
|
-
filter: v,
|
|
55
|
-
filterComponents: x,
|
|
52
|
+
pagination: P,
|
|
53
|
+
sort: C,
|
|
56
54
|
...r
|
|
57
55
|
}) => {
|
|
58
56
|
const m = e.useMemo(
|
|
@@ -62,18 +60,17 @@ const t = ({
|
|
|
62
60
|
[r]
|
|
63
61
|
);
|
|
64
62
|
return /* @__PURE__ */ p(a.Provider, { value: m, children: i });
|
|
65
|
-
},
|
|
63
|
+
}, g = t, o = g;
|
|
66
64
|
o.Body = n;
|
|
67
|
-
o.
|
|
68
|
-
o.
|
|
69
|
-
o.
|
|
70
|
-
o.
|
|
71
|
-
o.PaginationQuickJumper = b;
|
|
65
|
+
o.Search = f;
|
|
66
|
+
o.Pagination = l;
|
|
67
|
+
o.PaginationInfo = c;
|
|
68
|
+
o.PaginationQuickJumper = d;
|
|
72
69
|
o.Provider = t;
|
|
73
|
-
o.Header =
|
|
74
|
-
o.HeaderContent =
|
|
75
|
-
o.Footer =
|
|
76
|
-
o.FooterContent =
|
|
70
|
+
o.Header = T;
|
|
71
|
+
o.HeaderContent = b;
|
|
72
|
+
o.Footer = s;
|
|
73
|
+
o.FooterContent = u;
|
|
77
74
|
export {
|
|
78
75
|
o as Table,
|
|
79
76
|
t as TableProvider,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { FilterComponentType } from './components/table-filter/table-filter.type';
|
|
3
2
|
import { NumberCellProps } from './components/cell/number-cell';
|
|
4
3
|
import { BooleanCellProps } from './components/cell/boolean-cell';
|
|
5
4
|
import { LinkCellProps } from './components/cell/link-cell';
|
|
@@ -14,21 +13,6 @@ export type CellRendererProps = {
|
|
|
14
13
|
index: number;
|
|
15
14
|
};
|
|
16
15
|
export type CellRenderer = FC<CellRendererProps>;
|
|
17
|
-
export type FilterCondition = 'contains' | 'notEqual' | 'equal' | '>' | '<' | '=' | '!=';
|
|
18
|
-
export type FilterRule = {
|
|
19
|
-
field: string;
|
|
20
|
-
condition?: string;
|
|
21
|
-
value: string | string[];
|
|
22
|
-
};
|
|
23
|
-
export type FilterOption = {
|
|
24
|
-
label: string;
|
|
25
|
-
value: string;
|
|
26
|
-
total?: number;
|
|
27
|
-
};
|
|
28
|
-
export type TableFilter = {
|
|
29
|
-
value: FilterRule[];
|
|
30
|
-
onChange: (filters: FilterRule[]) => void;
|
|
31
|
-
};
|
|
32
16
|
export type TableSearch = {
|
|
33
17
|
value: string;
|
|
34
18
|
onChange: (searchValue: string) => void;
|
|
@@ -68,10 +52,8 @@ type ColumnBase<T extends CellType> = {
|
|
|
68
52
|
title: string;
|
|
69
53
|
cellType: T;
|
|
70
54
|
cellRenderer?: CellRenderer;
|
|
71
|
-
filterable?: boolean;
|
|
72
55
|
hideable?: boolean;
|
|
73
56
|
sortable?: boolean;
|
|
74
|
-
filterOptions?: FilterOption[];
|
|
75
57
|
};
|
|
76
58
|
export type TableSchemaColumn = (ColumnBase<'number'> & {
|
|
77
59
|
valueGetter?: (record: Record<string, unknown>) => CellValue | CellPropsByType['number'];
|
|
@@ -97,8 +79,6 @@ export type TableProps = {
|
|
|
97
79
|
schema: TableSchema;
|
|
98
80
|
loading?: boolean;
|
|
99
81
|
emptyMessage?: string;
|
|
100
|
-
filter?: TableFilter;
|
|
101
|
-
filterComponents?: Record<string, FilterComponentType>;
|
|
102
82
|
pagination?: TablePaginationConfig;
|
|
103
83
|
sort?: TableSort;
|
|
104
84
|
customCells?: Record<string, CellRenderer>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { Table as
|
|
1
|
+
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { Table as r } from "../table/table-provider.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { cn as i } from "../../lib/utils.js";
|
|
5
5
|
/* empty css */
|
|
@@ -30,7 +30,8 @@ import "../stepper/stepper.js";
|
|
|
30
30
|
import "../stepper-item/stepper-item.js";
|
|
31
31
|
import "@radix-ui/react-tabs";
|
|
32
32
|
import "../tooltip/tooltip.js";
|
|
33
|
-
import
|
|
33
|
+
import { Filter as P } from "../table-filter/index.js";
|
|
34
|
+
import S from "../assets/icons/octagon-warning-Copy.js";
|
|
34
35
|
import "../badge/badge.js";
|
|
35
36
|
import "../avatar/avatar.js";
|
|
36
37
|
import "../text-preset/text-preset.js";
|
|
@@ -38,18 +39,18 @@ import "react-dom";
|
|
|
38
39
|
import "../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js";
|
|
39
40
|
import "../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dispatch-consumer-event.js";
|
|
40
41
|
import "../table/table.context.js";
|
|
41
|
-
const
|
|
42
|
+
const vt = ({
|
|
42
43
|
dataSource: w,
|
|
43
|
-
schema:
|
|
44
|
-
loading:
|
|
45
|
-
emptyMessage:
|
|
46
|
-
className:
|
|
44
|
+
schema: H,
|
|
45
|
+
loading: k,
|
|
46
|
+
emptyMessage: T,
|
|
47
|
+
className: _,
|
|
47
48
|
rounded: d = !0,
|
|
48
49
|
bordered: n = !0,
|
|
49
|
-
showHeader:
|
|
50
|
-
headerClassName:
|
|
51
|
-
search:
|
|
52
|
-
filter:
|
|
50
|
+
showHeader: p = !0,
|
|
51
|
+
headerClassName: f,
|
|
52
|
+
search: a,
|
|
53
|
+
filter: e,
|
|
53
54
|
headerLeftContent: h,
|
|
54
55
|
headerActions: u,
|
|
55
56
|
body: l = {
|
|
@@ -57,79 +58,79 @@ const Ct = ({
|
|
|
57
58
|
className: "",
|
|
58
59
|
stickyHeader: !0
|
|
59
60
|
},
|
|
60
|
-
showFooter:
|
|
61
|
+
showFooter: g = !0,
|
|
61
62
|
footerClassName: j,
|
|
62
63
|
pagination: o,
|
|
63
64
|
paginationInfo: c,
|
|
64
65
|
paginationQuickJumper: s,
|
|
65
66
|
error: x = !1
|
|
66
67
|
}) => {
|
|
67
|
-
var
|
|
68
|
+
var F;
|
|
68
69
|
if (x)
|
|
69
|
-
return /* @__PURE__ */ t("div", { className: "flex flex-col items-center justify-center h-64 bg-background-error-subtle rounded-lg text-text-warning-secondary", children: /* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */ t(
|
|
71
|
-
/* @__PURE__ */
|
|
70
|
+
return /* @__PURE__ */ t("div", { className: "flex flex-col items-center justify-center h-64 bg-background-error-subtle rounded-lg text-text-warning-secondary", children: /* @__PURE__ */ m("div", { className: "flex gap-2", children: [
|
|
71
|
+
/* @__PURE__ */ t(S, { className: "mt-1.5" }),
|
|
72
|
+
/* @__PURE__ */ m("div", { className: "flex flex-col gap-2", children: [
|
|
72
73
|
/* @__PURE__ */ t("div", { className: "text-text-error-primary text-lg font-medium", children: "Error loading data" }),
|
|
73
74
|
/* @__PURE__ */ t("div", { className: "text-sm", children: "Please try again later" }),
|
|
74
75
|
typeof x == "string" && /* @__PURE__ */ t("div", { className: "text-text-warning-secondary text-sm", children: x })
|
|
75
76
|
] })
|
|
76
77
|
] }) });
|
|
77
|
-
const C = s && s.totalPage && s.totalPage >= 2, N = o && o.totalPage && o.totalPage >= 2 || !!c || C,
|
|
78
|
-
return /* @__PURE__ */ t("div", { className: i("flex flex-col overflow-hidden",
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
const C = s && s.totalPage && s.totalPage >= 2, N = o && o.totalPage && o.totalPage >= 2 || !!c || C, v = a || e || h || u, R = typeof (e == null ? void 0 : e.showFilterButton) > "u" ? !0 : e == null ? void 0 : e.showFilterButton;
|
|
79
|
+
return /* @__PURE__ */ t("div", { className: i("flex flex-col overflow-hidden", _), children: /* @__PURE__ */ m(r, { dataSource: w, schema: H, loading: k, emptyMessage: T, children: [
|
|
80
|
+
p && v && /* @__PURE__ */ m(
|
|
81
|
+
r.Header,
|
|
81
82
|
{
|
|
82
83
|
className: i(
|
|
83
84
|
"flex-shrink-0",
|
|
84
85
|
n && "border-stroke-solid-medium border-1 border-b-0",
|
|
85
86
|
d && "rounded-t-xl",
|
|
86
|
-
|
|
87
|
+
f
|
|
87
88
|
),
|
|
88
89
|
children: [
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ m(r.HeaderContent, { children: [
|
|
90
91
|
h && h,
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
a && /* @__PURE__ */ t(
|
|
93
|
+
r.Search,
|
|
93
94
|
{
|
|
94
95
|
search: {
|
|
95
|
-
value:
|
|
96
|
-
onChange:
|
|
96
|
+
value: a.value || "",
|
|
97
|
+
onChange: a.onChange || (() => {
|
|
97
98
|
}),
|
|
98
|
-
placeholder:
|
|
99
|
+
placeholder: a.placeholder
|
|
99
100
|
},
|
|
100
|
-
className:
|
|
101
|
+
className: a.className
|
|
101
102
|
}
|
|
102
103
|
),
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
e && /* @__PURE__ */ m(
|
|
105
|
+
P,
|
|
105
106
|
{
|
|
106
|
-
|
|
107
|
+
filterSchema: e.filterSchema,
|
|
107
108
|
filter: {
|
|
108
|
-
value:
|
|
109
|
-
onChange:
|
|
109
|
+
value: e.value || [],
|
|
110
|
+
onChange: e.onChange || (() => {
|
|
110
111
|
})
|
|
111
112
|
},
|
|
112
113
|
children: [
|
|
113
|
-
R && /* @__PURE__ */ t(
|
|
114
|
-
(
|
|
114
|
+
R && /* @__PURE__ */ t(P.FilterButton, {}),
|
|
115
|
+
(F = e == null ? void 0 : e.quickFilters) == null ? void 0 : F.map((B) => /* @__PURE__ */ t(P.FilterColumnButton, { filterName: B }, B))
|
|
115
116
|
]
|
|
116
117
|
}
|
|
117
118
|
)
|
|
118
119
|
] }),
|
|
119
|
-
u && /* @__PURE__ */ t(
|
|
120
|
+
u && /* @__PURE__ */ t(r.HeaderContent, { children: u })
|
|
120
121
|
]
|
|
121
122
|
}
|
|
122
123
|
),
|
|
123
124
|
/* @__PURE__ */ t(
|
|
124
|
-
|
|
125
|
+
r.Body,
|
|
125
126
|
{
|
|
126
127
|
cell: l == null ? void 0 : l.cell,
|
|
127
128
|
sort: l == null ? void 0 : l.sort,
|
|
128
129
|
className: i(
|
|
129
130
|
"flex-1 min-h-0",
|
|
130
131
|
n && "border-stroke-solid-light border-1",
|
|
131
|
-
d && !(
|
|
132
|
-
d && !(
|
|
132
|
+
d && !(p && v) && "rounded-t-xl",
|
|
133
|
+
d && !(g && N) && "rounded-b-xl",
|
|
133
134
|
n && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
|
|
134
135
|
n && "[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
|
|
135
136
|
l == null ? void 0 : l.className
|
|
@@ -137,8 +138,8 @@ const Ct = ({
|
|
|
137
138
|
stickyHeader: l == null ? void 0 : l.stickyHeader
|
|
138
139
|
}
|
|
139
140
|
),
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
g && N && /* @__PURE__ */ m(
|
|
142
|
+
r.Footer,
|
|
142
143
|
{
|
|
143
144
|
className: i(
|
|
144
145
|
"flex-shrink-0 border-stroke-solid-light border-t-[0.5px] mt-[-2px]",
|
|
@@ -147,18 +148,18 @@ const Ct = ({
|
|
|
147
148
|
j
|
|
148
149
|
),
|
|
149
150
|
children: [
|
|
150
|
-
c ? /* @__PURE__ */ t(
|
|
151
|
-
|
|
151
|
+
c ? /* @__PURE__ */ t(r.FooterContent, { children: /* @__PURE__ */ t(
|
|
152
|
+
r.PaginationInfo,
|
|
152
153
|
{
|
|
153
154
|
showTotal: c.showTotal,
|
|
154
155
|
totalItems: c.totalItems,
|
|
155
156
|
currentPage: c.currentPage,
|
|
156
157
|
itemsPerPage: c.itemsPerPage
|
|
157
158
|
}
|
|
158
|
-
) }) : s || o ? /* @__PURE__ */ t(
|
|
159
|
-
(s || o) && /* @__PURE__ */
|
|
159
|
+
) }) : s || o ? /* @__PURE__ */ t(r.FooterContent, { children: null }) : null,
|
|
160
|
+
(s || o) && /* @__PURE__ */ m(r.FooterContent, { children: [
|
|
160
161
|
C && /* @__PURE__ */ t(
|
|
161
|
-
|
|
162
|
+
r.PaginationQuickJumper,
|
|
162
163
|
{
|
|
163
164
|
currentPage: s.currentPage,
|
|
164
165
|
totalPage: s.totalPage,
|
|
@@ -168,7 +169,7 @@ const Ct = ({
|
|
|
168
169
|
}
|
|
169
170
|
),
|
|
170
171
|
o && /* @__PURE__ */ t(
|
|
171
|
-
|
|
172
|
+
r.Pagination,
|
|
172
173
|
{
|
|
173
174
|
currentPage: o.currentPage,
|
|
174
175
|
totalPage: o.totalPage,
|
|
@@ -184,5 +185,5 @@ const Ct = ({
|
|
|
184
185
|
] }) });
|
|
185
186
|
};
|
|
186
187
|
export {
|
|
187
|
-
|
|
188
|
+
vt as default
|
|
188
189
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { TableProps, TableSchema,
|
|
2
|
+
import { TableProps, TableSchema, TableSearch, TableSort } from '../table/table.type';
|
|
3
|
+
import { TableFilter, FilterSchema } from '../table-filter/table-filter.type';
|
|
3
4
|
import { PaginationProps, PaginationInfoProps, PaginationQuickJumperProps } from '../table/components/pagination/pagination.type';
|
|
4
5
|
export interface TableCardProps {
|
|
5
6
|
dataSource: Record<string, unknown>[];
|
|
@@ -15,6 +16,7 @@ export interface TableCardProps {
|
|
|
15
16
|
filter?: Partial<TableFilter> & {
|
|
16
17
|
quickFilters?: string[];
|
|
17
18
|
showFilterButton?: boolean;
|
|
19
|
+
filterSchema: FilterSchema;
|
|
18
20
|
};
|
|
19
21
|
headerLeftContent?: React.ReactNode;
|
|
20
22
|
headerActions?: React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { Button as l } from "
|
|
3
|
-
import { Z2Dialog as s, Z2DialogContent as d, Z2DialogHeader as h, Z2DialogTitle as c, Z2DialogDescription as g, Z2DialogFooter as m } from "
|
|
2
|
+
import { Button as l } from "../../button/button.js";
|
|
3
|
+
import { Z2Dialog as s, Z2DialogContent as d, Z2DialogHeader as h, Z2DialogTitle as c, Z2DialogDescription as g, Z2DialogFooter as m } from "../../dialog/dialog.js";
|
|
4
4
|
const v = ({
|
|
5
5
|
onClose: r,
|
|
6
6
|
onKeepChanges: i,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { useState as i, useEffect as h } from "react";
|
|
3
|
-
import { MagnifierIcon as y } from "
|
|
4
|
-
import C from "
|
|
3
|
+
import { MagnifierIcon as y } from "../../assets/icons/magnifier-icon.js";
|
|
4
|
+
import C from "../../assets/icons/x.js";
|
|
5
5
|
const k = ["includesAny", "includesAll", "excludes"], j = ({ value: r, onChange: d, filterOptions: c = [] }) => {
|
|
6
6
|
const [n, o] = i([]), [u, m] = i(""), [x, f] = i(c), p = (e) => {
|
|
7
7
|
m(e.target.value);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect as c } from "react";
|
|
3
|
-
import s from "
|
|
4
|
-
import { MagnifierIcon as u } from "
|
|
5
|
-
import { Input as d } from "
|
|
3
|
+
import s from "../../assets/icons/x.js";
|
|
4
|
+
import { MagnifierIcon as u } from "../../assets/icons/magnifier-icon.js";
|
|
5
|
+
import { Input as d } from "../../input/input.js";
|
|
6
6
|
const o = [
|
|
7
7
|
{ label: "Contains", value: "contains" },
|
|
8
8
|
{ label: "Does not equal", value: "notEqual" },
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TableFilterProviderProps } from './table-filter.type';
|
|
2
|
+
import { TableFilterButton } from './table-filter-button';
|
|
3
|
+
import { TableFilterColumnButton } from './table-filter-column-button';
|
|
4
|
+
export { useTableFilterContext } from './table-filter.context';
|
|
5
|
+
export interface FilterCompoundComponent extends React.FC<TableFilterProviderProps> {
|
|
6
|
+
FilterButton: typeof TableFilterButton;
|
|
7
|
+
FilterColumnButton: typeof TableFilterColumnButton;
|
|
8
|
+
}
|
|
9
|
+
export declare const Filter: FilterCompoundComponent;
|