@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
|
@@ -3,22 +3,24 @@ export declare const TABLE_CSS_CLASSES: {
|
|
|
3
3
|
readonly table: "w-full";
|
|
4
4
|
readonly header: "bg-background-neutral-medium text-text-neutral-secondary";
|
|
5
5
|
readonly cell: {
|
|
6
|
-
readonly default: "
|
|
7
|
-
readonly cellHeight: {
|
|
8
|
-
readonly small: "p-3";
|
|
9
|
-
readonly large: "p-4";
|
|
10
|
-
};
|
|
6
|
+
readonly default: "p-0 align-middle relative h-4";
|
|
11
7
|
readonly hasBorder: {
|
|
12
|
-
readonly true: "border border-stroke-solid-light";
|
|
8
|
+
readonly true: "border-r border-b border-stroke-solid-light";
|
|
13
9
|
readonly false: "border-b border-stroke-solid-light";
|
|
14
10
|
};
|
|
15
11
|
};
|
|
16
|
-
readonly headerCell:
|
|
12
|
+
readonly headerCell: {
|
|
13
|
+
readonly default: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider";
|
|
14
|
+
readonly hasBorder: {
|
|
15
|
+
readonly true: "border-none [box-shadow:inset_-1px_0_0_0_var(--color-stroke-solid-light),_inset_0_-1px_0_0_var(--color-stroke-solid-light)]";
|
|
16
|
+
readonly false: "border-none [box-shadow:inset_0_-1px_0_0_var(--color-stroke-solid-light)]";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
17
19
|
readonly sortableHeaderCell: "p-3 text-left text-xs font-medium uppercase tracking-wider cursor-pointer transition-colors duration-200";
|
|
18
20
|
readonly headerCellContent: "flex items-center justify-between";
|
|
19
21
|
readonly sortIcon: "ml-2 w-4 h-4 text-gray-400";
|
|
20
22
|
readonly sortIconActive: "ml-2 w-4 h-4 text-gray-600";
|
|
21
|
-
readonly row: "
|
|
23
|
+
readonly row: " transition-colors duration-200 text-text-neutral-primary";
|
|
22
24
|
readonly emptyState: "px-4 py-8 text-center text-gray-500";
|
|
23
25
|
readonly loading: "px-4 py-8 text-center text-gray-500";
|
|
24
26
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { FilterComponentType } from './components/table-filter/table-filter.type';
|
|
3
|
-
export type CellType = '
|
|
3
|
+
export type CellType = 'number' | 'boolean' | 'checkbox' | 'link' | 'avatar' | 'label' | 'description' | 'text';
|
|
4
4
|
export type CellValue = string | number | boolean | null | undefined;
|
|
5
5
|
export type CellRendererProps = {
|
|
6
6
|
value: CellValue;
|
|
@@ -17,6 +17,7 @@ export type FilterRule = {
|
|
|
17
17
|
export type FilterOption = {
|
|
18
18
|
label: string;
|
|
19
19
|
value: string;
|
|
20
|
+
total?: number;
|
|
20
21
|
};
|
|
21
22
|
export type TableFilter = {
|
|
22
23
|
value: FilterRule[];
|
|
@@ -45,21 +46,52 @@ export type TableSort = {
|
|
|
45
46
|
sortedColumns: SortColumn[];
|
|
46
47
|
onSort: (field: string, direction: SortDirection) => void;
|
|
47
48
|
};
|
|
48
|
-
|
|
49
|
+
import type { NumberCellProps } from './components/cell/number-cell';
|
|
50
|
+
import type { BooleanCellProps } from './components/cell/boolean-cell';
|
|
51
|
+
import type { LinkCellProps } from './components/cell/link-cell';
|
|
52
|
+
import type { AvatarCellProps } from './components/cell/avatar-cell';
|
|
53
|
+
import type { LabelCellProps } from './components/cell/label-cell';
|
|
54
|
+
import type { DescriptionCellProps } from './components/cell/description-cell';
|
|
55
|
+
type CellPropsByType = {
|
|
56
|
+
number: Omit<NumberCellProps, 'value'>;
|
|
57
|
+
boolean: Omit<BooleanCellProps, 'value'>;
|
|
58
|
+
checkbox: Omit<BooleanCellProps, 'value'>;
|
|
59
|
+
link: Omit<LinkCellProps, 'value' | 'href'> & {
|
|
60
|
+
href: string;
|
|
61
|
+
};
|
|
62
|
+
avatar: Omit<AvatarCellProps, 'value'>;
|
|
63
|
+
label: Omit<LabelCellProps, 'value'>;
|
|
64
|
+
description: Omit<DescriptionCellProps, 'value'>;
|
|
65
|
+
};
|
|
66
|
+
type ColumnBase<T extends CellType> = {
|
|
49
67
|
key: string;
|
|
50
68
|
title: string;
|
|
51
|
-
cellType:
|
|
69
|
+
cellType: T;
|
|
52
70
|
cellRenderer?: CellRenderer;
|
|
53
71
|
filterable?: boolean;
|
|
54
72
|
hideable?: boolean;
|
|
55
73
|
sortable?: boolean;
|
|
56
74
|
filterOptions?: FilterOption[];
|
|
57
75
|
};
|
|
76
|
+
export type TableSchemaColumn = (ColumnBase<'number'> & {
|
|
77
|
+
valueGetter?: (record: Record<string, unknown>) => CellValue | CellPropsByType['number'];
|
|
78
|
+
}) | (ColumnBase<'boolean'> & {
|
|
79
|
+
valueGetter?: (record: Record<string, unknown>) => CellValue | CellPropsByType['boolean'];
|
|
80
|
+
}) | (ColumnBase<'checkbox'> & {
|
|
81
|
+
valueGetter?: (record: Record<string, unknown>) => CellValue | CellPropsByType['checkbox'];
|
|
82
|
+
}) | (ColumnBase<'link'> & {
|
|
83
|
+
valueGetter?: (record: Record<string, unknown>) => CellValue | CellPropsByType['link'];
|
|
84
|
+
}) | (ColumnBase<'avatar'> & {
|
|
85
|
+
valueGetter?: (record: Record<string, unknown>) => CellValue | CellPropsByType['avatar'];
|
|
86
|
+
}) | (ColumnBase<'label'> & {
|
|
87
|
+
valueGetter?: (record: Record<string, unknown>) => CellValue | CellPropsByType['label'];
|
|
88
|
+
}) | (ColumnBase<'description'> & {
|
|
89
|
+
valueGetter?: (record: Record<string, unknown>) => CellValue | CellPropsByType['description'];
|
|
90
|
+
});
|
|
58
91
|
export type TableSchema = TableSchemaColumn[];
|
|
59
92
|
export type TableProps = {
|
|
60
93
|
cell?: {
|
|
61
94
|
hasBorder?: boolean;
|
|
62
|
-
cellHeight?: 'small' | 'large';
|
|
63
95
|
};
|
|
64
96
|
dataSource: Record<string, unknown>[];
|
|
65
97
|
schema: TableSchema;
|
|
@@ -71,3 +103,4 @@ export type TableProps = {
|
|
|
71
103
|
sort?: TableSort;
|
|
72
104
|
customCells?: Record<string, CellRenderer>;
|
|
73
105
|
};
|
|
106
|
+
export {};
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { CellValue, TableSchemaColumn } from './table.type';
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const extractCellValue: (record: Record<string, unknown>, column: TableSchemaColumn) => CellValue;
|
|
2
|
+
export declare const extractCellValue: (record: Record<string, unknown>, column: TableSchemaColumn) => CellValue | Record<string, unknown>;
|
|
@@ -12,7 +12,10 @@ export interface TableCardProps {
|
|
|
12
12
|
search?: Partial<TableSearch> & {
|
|
13
13
|
className?: string;
|
|
14
14
|
};
|
|
15
|
-
filter?: Partial<TableFilter
|
|
15
|
+
filter?: Partial<TableFilter> & {
|
|
16
|
+
quickFilters?: string[];
|
|
17
|
+
showFilterButton?: boolean;
|
|
18
|
+
};
|
|
16
19
|
headerLeftContent?: React.ReactNode;
|
|
17
20
|
headerActions?: React.ReactNode;
|
|
18
21
|
body?: {
|
|
@@ -23,12 +26,9 @@ export interface TableCardProps {
|
|
|
23
26
|
};
|
|
24
27
|
showFooter?: boolean;
|
|
25
28
|
footerClassName?: string;
|
|
26
|
-
pagination?:
|
|
27
|
-
paginationInfo?:
|
|
28
|
-
|
|
29
|
-
totalItems: number;
|
|
30
|
-
};
|
|
31
|
-
paginationQuickJumper?: Partial<PaginationQuickJumperProps>;
|
|
29
|
+
pagination?: PaginationProps;
|
|
30
|
+
paginationInfo?: PaginationInfoProps;
|
|
31
|
+
paginationQuickJumper?: PaginationQuickJumperProps;
|
|
32
32
|
loading?: boolean;
|
|
33
33
|
emptyMessage?: string;
|
|
34
34
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useClickOutside: (ref: React.RefObject<HTMLElement | null>, callback: () => void) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ztwoint/z-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.47",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"lint": "eslint \"src/components/**/*.{js,jsx,ts,tsx}\" --ignore-pattern \"**/*.d.ts\" --ignore-pattern \"**/*.stories.tsx\"",
|
|
36
36
|
"lint:fix": "eslint \"src/components/**/*.{js,jsx,ts,tsx}\" --ignore-pattern \"**/*.d.ts\" --ignore-pattern \"**/*.stories.tsx\" --fix",
|
|
37
37
|
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
|
|
38
|
+
"type-check": "tsc --noEmit --pretty",
|
|
38
39
|
"prepare": "husky"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FilterComponentType } from './table-filter.type';
|
|
2
|
-
import { TableSchema, TableFilter as TableFilterType } from '../../table.type';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
export interface TableFilterProps {
|
|
5
|
-
filterComponents?: Record<string, FilterComponentType>;
|
|
6
|
-
schema: TableSchema;
|
|
7
|
-
filter?: TableFilterType;
|
|
8
|
-
}
|
|
9
|
-
export declare const TableFilter: React.FC<TableFilterProps>;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { Button as i } from "../../../button/button.js";
|
|
3
|
-
import T from "./table-filter.hook.js";
|
|
4
|
-
import C from "./filters/text.js";
|
|
5
|
-
import j from "./filters/boolean.js";
|
|
6
|
-
import z from "./filters/number/number.js";
|
|
7
|
-
import A from "./filters/checkbox.js";
|
|
8
|
-
import O from "../../../assets/icons/circle-check-filled.js";
|
|
9
|
-
const E = ({
|
|
10
|
-
filterComponents: n = {},
|
|
11
|
-
schema: d,
|
|
12
|
-
filter: o
|
|
13
|
-
}) => {
|
|
14
|
-
const {
|
|
15
|
-
selectedColumn: r,
|
|
16
|
-
setSelectedColumn: p,
|
|
17
|
-
getFilterForColumn: x,
|
|
18
|
-
hasFilterForColumn: b,
|
|
19
|
-
updateColumnFilter: f,
|
|
20
|
-
clearAllFilters: v,
|
|
21
|
-
applyFilters: k,
|
|
22
|
-
hasActiveFilters: s,
|
|
23
|
-
isOpen: m,
|
|
24
|
-
setIsOpen: u,
|
|
25
|
-
filterableFields: y
|
|
26
|
-
} = T({ schema: d, filter: o || { value: [], onChange: () => {
|
|
27
|
-
} } });
|
|
28
|
-
if (!o)
|
|
29
|
-
return null;
|
|
30
|
-
const N = () => {
|
|
31
|
-
if (!r) return null;
|
|
32
|
-
const e = d.find((c) => c.key === r), F = {
|
|
33
|
-
boolean: j,
|
|
34
|
-
text: C,
|
|
35
|
-
number: z,
|
|
36
|
-
checkbox: A
|
|
37
|
-
}, h = (n == null ? void 0 : n[(e == null ? void 0 : e.cellType) || ""]) || F[(e == null ? void 0 : e.cellType) || "text"];
|
|
38
|
-
if (!h)
|
|
39
|
-
return console.warn(
|
|
40
|
-
`No filter component found for column "${e == null ? void 0 : e.key}" with cellType "${e == null ? void 0 : e.cellType}". Provide a custom filter component or use supported types: "text", "number", "boolean", "checkbox".`
|
|
41
|
-
), null;
|
|
42
|
-
const a = x(r), g = {
|
|
43
|
-
condition: (a == null ? void 0 : a.condition) || "",
|
|
44
|
-
value: (a == null ? void 0 : a.value) || ""
|
|
45
|
-
};
|
|
46
|
-
return /* @__PURE__ */ t("div", { className: "flex-1", children: /* @__PURE__ */ t("div", { className: "mb-4", children: /* @__PURE__ */ t("div", { className: "", children: /* @__PURE__ */ t(
|
|
47
|
-
h,
|
|
48
|
-
{
|
|
49
|
-
value: g,
|
|
50
|
-
onChange: ({ condition: c, value: w }) => f(r, c, w),
|
|
51
|
-
filterOptions: e == null ? void 0 : e.filterOptions
|
|
52
|
-
},
|
|
53
|
-
e == null ? void 0 : e.key
|
|
54
|
-
) }) }) });
|
|
55
|
-
};
|
|
56
|
-
return /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
57
|
-
/* @__PURE__ */ l(
|
|
58
|
-
i,
|
|
59
|
-
{
|
|
60
|
-
onClick: () => u(!m),
|
|
61
|
-
variant: s ? "filled" : "stroke",
|
|
62
|
-
shade: s ? "brand" : "neutral",
|
|
63
|
-
size: "small",
|
|
64
|
-
children: [
|
|
65
|
-
"Filter ",
|
|
66
|
-
s && `(${o.value.length})`
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
),
|
|
70
|
-
m && /* @__PURE__ */ l("div", { className: "absolute top-full left-0 mt-2 min-w-[600px] bg-surface-neutral-default border border-stroke-solid-medium rounded-md shadow-default z-10", children: [
|
|
71
|
-
/* @__PURE__ */ l("div", { className: "flex min-h-[300px]", children: [
|
|
72
|
-
/* @__PURE__ */ l("div", { className: "w-48 border-r border-stroke-solid-medium", children: [
|
|
73
|
-
/* @__PURE__ */ t("div", { className: "p-3 border-b border-stroke-solid-medium", children: /* @__PURE__ */ t("h3", { className: "text-sm font-medium text-text-neutral-primary", children: "Columns" }) }),
|
|
74
|
-
/* @__PURE__ */ t("div", { className: "py-2", children: y.map((e) => /* @__PURE__ */ l(
|
|
75
|
-
"button",
|
|
76
|
-
{
|
|
77
|
-
onClick: () => p(e.key),
|
|
78
|
-
className: `w-full text-left px-3 py-2 text-sm flex items-center justify-between hover:bg-surface-neutral-hovered transition-colors ${r === e.key ? "bg-surface-brand-subtle text-text-brand-primary" : "text-text-neutral-primary"}`,
|
|
79
|
-
children: [
|
|
80
|
-
/* @__PURE__ */ t("span", { className: "truncate", children: e.title }),
|
|
81
|
-
b(e.key) && /* @__PURE__ */ t(O, { className: "w-4 h-4 text-icon-brand-primary flex-shrink-0 ml-2" })
|
|
82
|
-
]
|
|
83
|
-
},
|
|
84
|
-
e.key
|
|
85
|
-
)) })
|
|
86
|
-
] }),
|
|
87
|
-
/* @__PURE__ */ t("div", { className: "flex-1 flex flex-col", children: r ? N() : /* @__PURE__ */ t("div", { className: "flex-1 flex items-center justify-center text-text-neutral-muted", children: "Select a column to configure its filter" }) })
|
|
88
|
-
] }),
|
|
89
|
-
/* @__PURE__ */ l("div", { className: "flex justify-between items-center p-4 border-t border-stroke-solid-medium", children: [
|
|
90
|
-
/* @__PURE__ */ t(
|
|
91
|
-
i,
|
|
92
|
-
{
|
|
93
|
-
onClick: v,
|
|
94
|
-
variant: "ghost",
|
|
95
|
-
shade: "neutral",
|
|
96
|
-
size: "small",
|
|
97
|
-
disabled: !s,
|
|
98
|
-
children: "Clear All"
|
|
99
|
-
}
|
|
100
|
-
),
|
|
101
|
-
/* @__PURE__ */ l("div", { className: "flex gap-2", children: [
|
|
102
|
-
/* @__PURE__ */ t(
|
|
103
|
-
i,
|
|
104
|
-
{
|
|
105
|
-
onClick: () => u(!1),
|
|
106
|
-
variant: "stroke",
|
|
107
|
-
shade: "neutral",
|
|
108
|
-
size: "small",
|
|
109
|
-
children: "Cancel"
|
|
110
|
-
}
|
|
111
|
-
),
|
|
112
|
-
/* @__PURE__ */ t(i, { onClick: k, variant: "filled", shade: "neutral", size: "small", children: "Apply" })
|
|
113
|
-
] })
|
|
114
|
-
] })
|
|
115
|
-
] })
|
|
116
|
-
] });
|
|
117
|
-
};
|
|
118
|
-
export {
|
|
119
|
-
E as TableFilter
|
|
120
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as e from "react";
|
|
2
|
-
function n({
|
|
3
|
-
title: l,
|
|
4
|
-
titleId: a,
|
|
5
|
-
...r
|
|
6
|
-
}, t) {
|
|
7
|
-
return /* @__PURE__ */ e.createElement("svg", Object.assign({
|
|
8
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
-
viewBox: "0 0 24 24",
|
|
10
|
-
fill: "currentColor",
|
|
11
|
-
"aria-hidden": "true",
|
|
12
|
-
"data-slot": "icon",
|
|
13
|
-
ref: t,
|
|
14
|
-
"aria-labelledby": a
|
|
15
|
-
}, r), l ? /* @__PURE__ */ e.createElement("title", {
|
|
16
|
-
id: a
|
|
17
|
-
}, l) : null, /* @__PURE__ */ e.createElement("path", {
|
|
18
|
-
fillRule: "evenodd",
|
|
19
|
-
d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",
|
|
20
|
-
clipRule: "evenodd"
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
const o = /* @__PURE__ */ e.forwardRef(n);
|
|
24
|
-
export {
|
|
25
|
-
o as default
|
|
26
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as e from "react";
|
|
2
|
-
function n({
|
|
3
|
-
title: l,
|
|
4
|
-
titleId: a,
|
|
5
|
-
...r
|
|
6
|
-
}, t) {
|
|
7
|
-
return /* @__PURE__ */ e.createElement("svg", Object.assign({
|
|
8
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
-
viewBox: "0 0 24 24",
|
|
10
|
-
fill: "currentColor",
|
|
11
|
-
"aria-hidden": "true",
|
|
12
|
-
"data-slot": "icon",
|
|
13
|
-
ref: t,
|
|
14
|
-
"aria-labelledby": a
|
|
15
|
-
}, r), l ? /* @__PURE__ */ e.createElement("title", {
|
|
16
|
-
id: a
|
|
17
|
-
}, l) : null, /* @__PURE__ */ e.createElement("path", {
|
|
18
|
-
fillRule: "evenodd",
|
|
19
|
-
d: "M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",
|
|
20
|
-
clipRule: "evenodd"
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
const o = /* @__PURE__ */ e.forwardRef(n);
|
|
24
|
-
export {
|
|
25
|
-
o as default
|
|
26
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { FilterComponentType } from './table-filter.type';
|
|
3
|
-
import { TableSchema, TableFilter as TableFilterType } from '../../table.type';
|
|
4
|
-
export interface TableFilterProps {
|
|
5
|
-
filterComponents?: Record<string, FilterComponentType>;
|
|
6
|
-
schema: TableSchema;
|
|
7
|
-
filter?: TableFilterType;
|
|
8
|
-
}
|
|
9
|
-
export declare const TableFilter: React.FC<TableFilterProps>;
|