@ztwoint/z-ui 0.1.31 → 0.1.34
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/table/components/table-cell.js +25 -24
- package/dist/components/table/components/table-filter/filters/boolean.js +60 -28
- package/dist/components/table/components/table-filter/filters/checkbox.d.ts +3 -0
- package/dist/components/table/components/table-filter/filters/checkbox.js +76 -0
- package/dist/components/table/components/table-filter/filters/index.d.ts +1 -0
- package/dist/components/table/components/table-filter/filters/number/filter-input-field.d.ts +11 -0
- package/dist/components/table/components/table-filter/filters/number/filter-input-field.js +38 -0
- package/dist/components/table/components/table-filter/filters/number/index.d.ts +1 -0
- package/dist/components/table/components/table-filter/filters/{number.d.ts → number/number.d.ts} +1 -1
- package/dist/components/table/components/table-filter/filters/number/number.hook.d.ts +23 -0
- package/dist/components/table/components/table-filter/filters/number/number.hook.js +33 -0
- package/dist/components/table/components/table-filter/filters/number/number.js +55 -0
- package/dist/components/table/components/table-filter/filters/text.js +49 -26
- package/dist/components/table/components/table-filter/table-filter.hook.d.ts +6 -3
- package/dist/components/table/components/table-filter/table-filter.hook.js +49 -29
- package/dist/components/table/components/table-filter/table-filter.js +93 -79
- package/dist/components/table/components/table-filter/table-filter.type.d.ts +4 -3
- package/dist/components/table/index.d.ts +1 -1
- package/dist/components/table/table.type.d.ts +6 -1
- package/dist/components/table-card/table-card.js +105 -0
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +19 -17
- package/dist/types/components/table/components/table-filter/filters/checkbox.d.ts +3 -0
- package/dist/types/components/table/components/table-filter/filters/index.d.ts +1 -0
- package/dist/types/components/table/components/table-filter/filters/number/filter-input-field.d.ts +11 -0
- package/dist/types/components/table/components/table-filter/filters/number/index.d.ts +1 -0
- package/dist/types/components/table/components/table-filter/filters/{number.d.ts → number/number.d.ts} +1 -1
- package/dist/types/components/table/components/table-filter/filters/number/number.hook.d.ts +23 -0
- package/dist/types/components/table/components/table-filter/table-filter.hook.d.ts +6 -3
- package/dist/types/components/table/components/table-filter/table-filter.type.d.ts +4 -3
- package/dist/types/components/table/index.d.ts +1 -1
- package/dist/types/components/table/table.type.d.ts +6 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/components/table/components/table-filter/filters/number.js +0 -28
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './components/stepper-item/stepper-item';
|
|
|
14
14
|
export * from './components/tab/tab';
|
|
15
15
|
export * from './components/table';
|
|
16
16
|
export * from './components/tooltip/tooltip';
|
|
17
|
+
export * from './components/table-card';
|
|
17
18
|
export * from './components/assets/icons/apartment-building';
|
|
18
19
|
export * from './components/assets/icons/chevron-down';
|
|
19
20
|
export * from './components/assets/icons/chevron-left';
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Alert as a, AlertDescription as n, AlertTitle as l } from "./components/alert/alert.js";
|
|
3
3
|
import { AlertCirclesIcon as f } from "./components/alert/icons/circles-icon.js";
|
|
4
4
|
import { Button as i, buttonVariants as Z } from "./components/button/button.js";
|
|
5
|
-
import { Z2SideNavBarProvider as
|
|
5
|
+
import { Z2SideNavBarProvider as u } from "./components/collapsible-side-nav-bar/side-nav-bar-provider.js";
|
|
6
6
|
import { Z2SideNavBar as D, Z2SidebarVariants as T } from "./components/collapsible-side-nav-bar/side-nav-bar.js";
|
|
7
7
|
import { Z2SideNavBarHeader as C } from "./components/collapsible-side-nav-bar/side-nav-bar-header.js";
|
|
8
8
|
import { Z2SideNavBarContent as w } from "./components/collapsible-side-nav-bar/side-nav-bar-content.js";
|
|
@@ -21,7 +21,7 @@ import { default as J } from "./components/assets/icons/sidebar-left-show-copy.j
|
|
|
21
21
|
import { SIDEBAR_WIDTH as Y, SIDEBAR_WIDTH_COLLAPSED as j } from "./components/collapsible-side-nav-bar/constants.js";
|
|
22
22
|
import { CountryFlags as z } from "./components/country-flags/country-flags.js";
|
|
23
23
|
import { Z2Dialog as X, Z2DialogClose as $, Z2DialogContent as oo, Z2DialogDescription as eo, Z2DialogFooter as ro, Z2DialogHeader as to, Z2DialogOverlay as po, Z2DialogPortal as ao, Z2DialogTitle as no, Z2DialogTrigger as lo } from "./components/dialog/dialog.js";
|
|
24
|
-
import { DropdownContext as fo, Z2Dropdown as xo, Z2DropdownContent as io, Z2DropdownInput as Zo, Z2DropdownItem as
|
|
24
|
+
import { DropdownContext as fo, Z2Dropdown as xo, Z2DropdownContent as io, Z2DropdownInput as Zo, Z2DropdownItem as uo, Z2DropdownSub as So, Z2DropdownSubContent as Do, Z2DropdownSubItem as To, Z2DropdownSubTrigger as bo } from "./components/dropdown/z2-dropdown.js";
|
|
25
25
|
import { Z2DropdownMenu as go, Z2DropdownMenuCheckboxItem as wo, Z2DropdownMenuContent as co, Z2DropdownMenuGroup as so, Z2DropdownMenuItem as Io, Z2DropdownMenuLabel as vo, Z2DropdownMenuPortal as Mo, Z2DropdownMenuRadioGroup as Bo, Z2DropdownMenuRadioItem as Ao, Z2DropdownMenuSeparator as No, Z2DropdownMenuShortcut as Po, Z2DropdownMenuSub as Eo, Z2DropdownMenuSubContent as Lo, Z2DropdownMenuSubTrigger as Fo, Z2DropdownMenuTrigger as Ho } from "./components/dropdown-menu/z2-dropdown-menu.js";
|
|
26
26
|
import { FileUploadArea as yo } from "./components/file-upload-area/file-upload-area.js";
|
|
27
27
|
import { DEFAULT_ACCEPT as Go } from "./components/file-upload-area/file-upload-area.const.js";
|
|
@@ -33,7 +33,7 @@ import { Z2Stepper as te } from "./components/stepper/stepper.js";
|
|
|
33
33
|
import { Z2StepperItem as ae } from "./components/stepper-item/stepper-item.js";
|
|
34
34
|
import { Z2Tabs as le, Z2TabsContent as me, Z2TabsList as fe, Z2TabsTrigger as xe } from "./components/tab/tab.js";
|
|
35
35
|
import { Table as Ze, TableProvider as de } from "./components/table/table-provider.js";
|
|
36
|
-
import { TableBody as
|
|
36
|
+
import { TableBody as Se } from "./components/table/table.js";
|
|
37
37
|
import { extractCellValue as Te, getNestedValue as be } from "./components/table/table.utils.js";
|
|
38
38
|
import { DEFAULT_EMPTY_MESSAGE as ge, TABLE_CSS_CLASSES as we } from "./components/table/table.const.js";
|
|
39
39
|
import { TableContext as se, useTableContext as Ie } from "./components/table/table.context.js";
|
|
@@ -57,11 +57,12 @@ import { PaginationInfo as rr } from "./components/table/components/pagination/c
|
|
|
57
57
|
import { PaginationQuickJumper as pr } from "./components/table/components/pagination/components/pagination-quick-jumper.js";
|
|
58
58
|
import "react";
|
|
59
59
|
import { Z2Tooltip as nr } from "./components/tooltip/tooltip.js";
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
60
|
+
import { default as mr } from "./components/table-card/table-card.js";
|
|
61
|
+
import { InfoIcon as xr } from "./components/assets/icons/info-icon.js";
|
|
62
|
+
import { useTheme as Zr } from "./lib/theme.hook.js";
|
|
63
|
+
import { cn as ur } from "./lib/utils.js";
|
|
64
|
+
import { Z2PopoverTrigger as Dr } from "./components/collapsible-side-nav-bar/popover/popover-trigger.js";
|
|
65
|
+
import { Z2PopoverContent as br } from "./components/collapsible-side-nav-bar/popover/popover-content.js";
|
|
65
66
|
export {
|
|
66
67
|
a as Alert,
|
|
67
68
|
f as AlertCirclesIcon,
|
|
@@ -77,7 +78,7 @@ export {
|
|
|
77
78
|
V as DatabaseCopy,
|
|
78
79
|
fo as DropdownContext,
|
|
79
80
|
yo as FileUploadArea,
|
|
80
|
-
|
|
81
|
+
xr as InfoIcon,
|
|
81
82
|
Uo as Input,
|
|
82
83
|
Xe as MagnifierIcon,
|
|
83
84
|
Wo as NavHeader,
|
|
@@ -91,7 +92,8 @@ export {
|
|
|
91
92
|
h as SubNavIndicator,
|
|
92
93
|
we as TABLE_CSS_CLASSES,
|
|
93
94
|
Ze as Table,
|
|
94
|
-
|
|
95
|
+
Se as TableBody,
|
|
96
|
+
mr as TableCard,
|
|
95
97
|
Me as TableCell,
|
|
96
98
|
se as TableContext,
|
|
97
99
|
Ge as TableEmptyState,
|
|
@@ -120,7 +122,7 @@ export {
|
|
|
120
122
|
xo as Z2Dropdown,
|
|
121
123
|
io as Z2DropdownContent,
|
|
122
124
|
Zo as Z2DropdownInput,
|
|
123
|
-
|
|
125
|
+
uo as Z2DropdownItem,
|
|
124
126
|
go as Z2DropdownMenu,
|
|
125
127
|
wo as Z2DropdownMenuCheckboxItem,
|
|
126
128
|
co as Z2DropdownMenuContent,
|
|
@@ -136,13 +138,13 @@ export {
|
|
|
136
138
|
Lo as Z2DropdownMenuSubContent,
|
|
137
139
|
Fo as Z2DropdownMenuSubTrigger,
|
|
138
140
|
Ho as Z2DropdownMenuTrigger,
|
|
139
|
-
|
|
141
|
+
So as Z2DropdownSub,
|
|
140
142
|
Do as Z2DropdownSubContent,
|
|
141
143
|
To as Z2DropdownSubItem,
|
|
142
144
|
bo as Z2DropdownSubTrigger,
|
|
143
145
|
F as Z2Popover,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
+
br as Z2PopoverContent,
|
|
147
|
+
Dr as Z2PopoverTrigger,
|
|
146
148
|
Qo as Z2Select,
|
|
147
149
|
Yo as Z2SelectContent,
|
|
148
150
|
jo as Z2SelectGroup,
|
|
@@ -159,7 +161,7 @@ export {
|
|
|
159
161
|
v as Z2SideNavBarGroup,
|
|
160
162
|
C as Z2SideNavBarHeader,
|
|
161
163
|
B as Z2SideNavBarItem,
|
|
162
|
-
|
|
164
|
+
u as Z2SideNavBarProvider,
|
|
163
165
|
N as Z2SideNavBarSeparator,
|
|
164
166
|
T as Z2SidebarVariants,
|
|
165
167
|
te as Z2Stepper,
|
|
@@ -170,10 +172,10 @@ export {
|
|
|
170
172
|
xe as Z2TabsTrigger,
|
|
171
173
|
nr as Z2Tooltip,
|
|
172
174
|
Z as buttonVariants,
|
|
173
|
-
|
|
175
|
+
ur as cn,
|
|
174
176
|
Te as extractCellValue,
|
|
175
177
|
be as getNestedValue,
|
|
176
178
|
Ie as useTableContext,
|
|
177
|
-
|
|
179
|
+
Zr as useTheme,
|
|
178
180
|
E as useZ2SideNavBar
|
|
179
181
|
};
|
package/dist/types/components/table/components/table-filter/filters/number/filter-input-field.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface FilterInputFieldProps {
|
|
2
|
+
label: string;
|
|
3
|
+
operator: string;
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
onReset: () => void;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const FilterInputField: React.FC<FilterInputFieldProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './number';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface UseNumberFilterProps {
|
|
2
|
+
value: {
|
|
3
|
+
condition: string;
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
onChange: (update: {
|
|
7
|
+
condition?: string;
|
|
8
|
+
value?: string;
|
|
9
|
+
}) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const useNumberFilter: ({ value, onChange }: UseNumberFilterProps) => {
|
|
12
|
+
specificAmount: string;
|
|
13
|
+
atLeast: string;
|
|
14
|
+
noMoreThan: string;
|
|
15
|
+
activeField: string | null;
|
|
16
|
+
handleSpecificAmountChange: (newValue: string) => void;
|
|
17
|
+
handleAtLeastChange: (newValue: string) => void;
|
|
18
|
+
handleNoMoreThanChange: (newValue: string) => void;
|
|
19
|
+
resetSpecificAmount: () => void;
|
|
20
|
+
resetAtLeast: () => void;
|
|
21
|
+
resetNoMoreThan: () => void;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -3,9 +3,12 @@ import { TableFilterProps } from './table-filter.type';
|
|
|
3
3
|
import { FilterRule } from '../../table.type';
|
|
4
4
|
declare const useTableFilter: ({ filter, schema }: TableFilterProps) => {
|
|
5
5
|
isOpen: boolean;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
selectedColumn: string | null;
|
|
7
|
+
setSelectedColumn: React.Dispatch<React.SetStateAction<string | null>>;
|
|
8
|
+
getFilterForColumn: (columnKey: string) => FilterRule | undefined;
|
|
9
|
+
hasFilterForColumn: (columnKey: string) => boolean;
|
|
10
|
+
updateColumnFilter: (columnKey: string, condition?: string, value?: string | string[]) => void;
|
|
11
|
+
clearAllFilters: () => void;
|
|
9
12
|
applyFilters: () => void;
|
|
10
13
|
hasActiveFilters: boolean;
|
|
11
14
|
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { TableFilter, TableSchema } from '../../table.type';
|
|
2
|
+
import { TableFilter, TableSchema, FilterOption } from '../../table.type';
|
|
3
3
|
export interface TableFilterProps {
|
|
4
4
|
schema: TableSchema;
|
|
5
5
|
filter: TableFilter;
|
|
@@ -8,11 +8,12 @@ export interface TableFilterProps {
|
|
|
8
8
|
export type FilterComponentProps = {
|
|
9
9
|
onChange: (input: {
|
|
10
10
|
condition?: string;
|
|
11
|
-
value?: string;
|
|
11
|
+
value?: string | string[];
|
|
12
12
|
}) => void;
|
|
13
13
|
value: {
|
|
14
14
|
condition?: string;
|
|
15
|
-
value: string;
|
|
15
|
+
value: string | string[];
|
|
16
16
|
};
|
|
17
|
+
filterOptions?: FilterOption[];
|
|
17
18
|
};
|
|
18
19
|
export type FilterComponentType = FC<FilterComponentProps>;
|
|
@@ -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, FilterRule, FilterCondition, TableFilter as TableFilterType, TablePaginationConfig, SortDirection, SortColumn, TableSort, } from './table.type';
|
|
3
|
+
export type { TableProps, TableSchema, TableSchemaColumn, CellType, CellValue, CellRenderer, CellRendererProps, FilterRule, FilterCondition, FilterOption, TableFilter as TableFilterType, TablePaginationConfig, SortDirection, SortColumn, TableSort, } from './table.type';
|
|
4
4
|
export { getNestedValue, 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,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { FilterComponentType } from './components/table-filter/table-filter.type';
|
|
3
|
-
export type CellType = 'text' | 'number' | 'boolean';
|
|
3
|
+
export type CellType = 'text' | 'number' | 'boolean' | 'checkbox';
|
|
4
4
|
export type CellValue = string | number | boolean | null | undefined;
|
|
5
5
|
export type CellRendererProps = {
|
|
6
6
|
value: CellValue;
|
|
@@ -12,6 +12,10 @@ export type FilterCondition = 'contains' | 'notEqual' | 'equal' | '>' | '<' | '=
|
|
|
12
12
|
export type FilterRule = {
|
|
13
13
|
field: string;
|
|
14
14
|
condition?: string;
|
|
15
|
+
value: string | string[];
|
|
16
|
+
};
|
|
17
|
+
export type FilterOption = {
|
|
18
|
+
label: string;
|
|
15
19
|
value: string;
|
|
16
20
|
};
|
|
17
21
|
export type TableFilter = {
|
|
@@ -49,6 +53,7 @@ export type TableSchemaColumn = {
|
|
|
49
53
|
filterable?: boolean;
|
|
50
54
|
hideable?: boolean;
|
|
51
55
|
sortable?: boolean;
|
|
56
|
+
filterOptions?: FilterOption[];
|
|
52
57
|
};
|
|
53
58
|
export type TableSchema = TableSchemaColumn[];
|
|
54
59
|
export type TableProps = {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './components/stepper-item/stepper-item';
|
|
|
15
15
|
export * from './components/tab/tab';
|
|
16
16
|
export * from './components/table';
|
|
17
17
|
export * from './components/tooltip/tooltip';
|
|
18
|
+
export * from './components/table-card';
|
|
18
19
|
export * from './components/assets/icons/apartment-building';
|
|
19
20
|
export * from './components/assets/icons/chevron-down';
|
|
20
21
|
export * from './components/assets/icons/chevron-left';
|
package/package.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsxs as o, Fragment as u, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect as d } from "react";
|
|
3
|
-
const l = [">", "<", "=", "!="], s = ({ value: t, onChange: r }) => (d(() => {
|
|
4
|
-
t.condition || r({ condition: l[0] });
|
|
5
|
-
}, []), /* @__PURE__ */ o(u, { children: [
|
|
6
|
-
/* @__PURE__ */ a(
|
|
7
|
-
"select",
|
|
8
|
-
{
|
|
9
|
-
value: t.condition,
|
|
10
|
-
onChange: (e) => r({ condition: e.target.value }),
|
|
11
|
-
className: "border border-stroke-solid-medium bg-surface-neutral-default text-text-neutral-primary rounded px-2 py-1 text-sm",
|
|
12
|
-
children: l.map((e) => /* @__PURE__ */ a("option", { value: e, children: e }, e))
|
|
13
|
-
}
|
|
14
|
-
),
|
|
15
|
-
/* @__PURE__ */ a(
|
|
16
|
-
"input",
|
|
17
|
-
{
|
|
18
|
-
type: "number",
|
|
19
|
-
value: t.value,
|
|
20
|
-
onChange: (e) => r({ value: e.target.value }),
|
|
21
|
-
placeholder: "Value",
|
|
22
|
-
className: "border border-stroke-solid-medium bg-surface-neutral-default text-text-neutral-primary placeholder:text-text-neutral-muted rounded px-2 py-1 text-sm flex-1"
|
|
23
|
-
}
|
|
24
|
-
)
|
|
25
|
-
] }));
|
|
26
|
-
export {
|
|
27
|
-
s as default
|
|
28
|
-
};
|