@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 @@
|
|
|
1
|
+
export declare const useClickOutside: (ref: React.RefObject<HTMLElement | null>, callback: () => void) => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useEffect as r } from "react";
|
|
2
|
+
const s = (t, n) => {
|
|
3
|
+
r(() => {
|
|
4
|
+
function e(o) {
|
|
5
|
+
t.current && !t.current.contains(o.target) && n();
|
|
6
|
+
}
|
|
7
|
+
return document.addEventListener("mousedown", e), document.addEventListener("touchstart", e), () => {
|
|
8
|
+
document.removeEventListener("mousedown", e), document.removeEventListener("touchstart", e);
|
|
9
|
+
};
|
|
10
|
+
}, [t, n]);
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
s as useClickOutside
|
|
14
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,133 +1,129 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import { Alert as p, AlertDescription as n, AlertTitle as
|
|
2
|
+
import { Alert as p, AlertDescription as n, AlertTitle as m } 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
|
|
6
|
-
import { Z2SideNavBar as D, Z2SidebarVariants as
|
|
5
|
+
import { Z2SideNavBarProvider as S } from "./components/collapsible-side-nav-bar/side-nav-bar-provider.js";
|
|
6
|
+
import { Z2SideNavBar as D, Z2SidebarVariants as b } from "./components/collapsible-side-nav-bar/side-nav-bar.js";
|
|
7
7
|
import { Z2SideNavBarHeader as g } 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";
|
|
9
9
|
import { Z2SideNavBarFooter as s } from "./components/collapsible-side-nav-bar/side-nav-bar-footer.js";
|
|
10
10
|
import { Z2SideNavBarGroup as v } from "./components/collapsible-side-nav-bar/side-nav-bar-group.js";
|
|
11
11
|
import { Z2SideNavBarItem as M } from "./components/collapsible-side-nav-bar/side-nav-bar-item.js";
|
|
12
|
-
import { Z2SideNavBarSeparator as
|
|
13
|
-
import { useZ2SideNavBar as
|
|
12
|
+
import { Z2SideNavBarSeparator as P } from "./components/collapsible-side-nav-bar/side-nav-bar-separator.js";
|
|
13
|
+
import { useZ2SideNavBar as N } from "./components/collapsible-side-nav-bar/context.js";
|
|
14
14
|
import { Z2Popover as F } from "./components/collapsible-side-nav-bar/popover/popover.js";
|
|
15
15
|
import { ChevronUpIcon as _ } from "./components/assets/icons/chevron-up-icon.js";
|
|
16
16
|
import { default as h } from "./components/assets/icons/sub-nav-indicator.js";
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
17
|
+
import { default as R } from "./components/assets/icons/circles-icon.js";
|
|
18
|
+
import { default as V } from "./components/assets/icons/database-copy.js";
|
|
19
19
|
import { default as k } from "./components/assets/icons/window-left-copy.js";
|
|
20
20
|
import { default as J } from "./components/assets/icons/sidebar-left-show-copy.js";
|
|
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
|
-
import { Z2Dialog as X, Z2DialogClose as $, Z2DialogContent as oo, Z2DialogDescription as
|
|
24
|
-
import { DropdownContext as fo, Z2Dropdown as xo, Z2DropdownContent as io, Z2DropdownInput as Zo, Z2DropdownItem as
|
|
25
|
-
import { Z2DropdownMenu as Co, Z2DropdownMenuCheckboxItem as wo, Z2DropdownMenuContent as co, Z2DropdownMenuGroup as so, Z2DropdownMenuItem as Io, Z2DropdownMenuLabel as vo, Z2DropdownMenuPortal as Bo, Z2DropdownMenuRadioGroup as Mo, Z2DropdownMenuRadioItem as Ao, Z2DropdownMenuSeparator as
|
|
23
|
+
import { Z2Dialog as X, Z2DialogClose as $, Z2DialogContent as oo, Z2DialogDescription as ro, Z2DialogFooter as eo, Z2DialogHeader as to, Z2DialogOverlay as ao, Z2DialogPortal as po, Z2DialogTitle as no, Z2DialogTrigger as mo } from "./components/dialog/dialog.js";
|
|
24
|
+
import { DropdownContext as fo, Z2Dropdown as xo, Z2DropdownContent as io, Z2DropdownInput as Zo, Z2DropdownItem as So, Z2DropdownSub as uo, Z2DropdownSubContent as Do, Z2DropdownSubItem as bo, Z2DropdownSubTrigger as To } from "./components/dropdown/z2-dropdown.js";
|
|
25
|
+
import { Z2DropdownMenu as Co, Z2DropdownMenuCheckboxItem as wo, Z2DropdownMenuContent as co, Z2DropdownMenuGroup as so, Z2DropdownMenuItem as Io, Z2DropdownMenuLabel as vo, Z2DropdownMenuPortal as Bo, Z2DropdownMenuRadioGroup as Mo, Z2DropdownMenuRadioItem as Ao, Z2DropdownMenuSeparator as Po, Z2DropdownMenuShortcut as Lo, Z2DropdownMenuSub as No, Z2DropdownMenuSubContent as Eo, 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
|
-
import { DEFAULT_ACCEPT as
|
|
28
|
-
import { Input as
|
|
27
|
+
import { DEFAULT_ACCEPT as Go } from "./components/file-upload-area/file-upload-area.const.js";
|
|
28
|
+
import { Input as Uo } from "./components/input/input.js";
|
|
29
29
|
import { NavHeader as Wo } from "./components/nav-header/nav-header.js";
|
|
30
30
|
import { NavItem as Oo } from "./components/nav-header/nav-item/nav-item.js";
|
|
31
|
-
import { Z2Select as Qo, Z2SelectContent as Yo, Z2SelectGroup as jo, Z2SelectItem as qo, Z2SelectLabel as zo, Z2SelectScrollDownButton as Ko, Z2SelectScrollUpButton as Xo, Z2SelectSeparator as $o, Z2SelectTrigger as
|
|
32
|
-
import { Z2Stepper as
|
|
33
|
-
import { Z2StepperItem as
|
|
34
|
-
import { Z2Tabs as
|
|
35
|
-
import { Table as
|
|
36
|
-
import { TableBody as
|
|
37
|
-
import { extractCellValue as
|
|
38
|
-
import { DEFAULT_EMPTY_MESSAGE as
|
|
39
|
-
import { TableContext as
|
|
40
|
-
import { TableCell as
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import { BooleanCell as Ee } from "./components/table/components/cell/boolean-cell.js";
|
|
44
|
-
import { TableHeader as He } from "./components/table/components/table-header/table-header.js";
|
|
31
|
+
import { Z2Select as Qo, Z2SelectContent as Yo, Z2SelectGroup as jo, Z2SelectItem as qo, Z2SelectLabel as zo, Z2SelectScrollDownButton as Ko, Z2SelectScrollUpButton as Xo, Z2SelectSeparator as $o, Z2SelectTrigger as or, Z2SelectValue as rr } from "./components/select/z2-select.js";
|
|
32
|
+
import { Z2Stepper as tr } from "./components/stepper/stepper.js";
|
|
33
|
+
import { Z2StepperItem as pr } from "./components/stepper-item/stepper-item.js";
|
|
34
|
+
import { Z2Tabs as mr, Z2TabsContent as lr, Z2TabsList as fr, Z2TabsTrigger as xr } from "./components/tab/tab.js";
|
|
35
|
+
import { Table as Zr, TableProvider as dr } from "./components/table/table-provider.js";
|
|
36
|
+
import { TableBody as ur } from "./components/table/table.js";
|
|
37
|
+
import { extractCellValue as br } from "./components/table/table.utils.js";
|
|
38
|
+
import { DEFAULT_EMPTY_MESSAGE as gr, TABLE_CSS_CLASSES as Cr } from "./components/table/table.const.js";
|
|
39
|
+
import { TableContext as cr, useTableContext as sr } from "./components/table/table.context.js";
|
|
40
|
+
import { TableCell as vr } from "./components/table/components/table-cell.js";
|
|
41
|
+
import { NumberCell as Mr } from "./components/table/components/cell/number-cell.js";
|
|
42
|
+
import { BooleanCell as Pr } from "./components/table/components/cell/boolean-cell.js";
|
|
45
43
|
import "react/jsx-runtime";
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
44
|
+
import { useTheme as Nr } from "./lib/theme.hook.js";
|
|
45
|
+
import { cn as Fr } from "./lib/utils.js";
|
|
46
|
+
import { Z2Tooltip as _r } from "./components/tooltip/tooltip.js";
|
|
47
|
+
import { default as hr } from "./components/table-card/table-card.js";
|
|
48
|
+
import { Badge as Rr, badgeVariants as Ur } from "./components/badge/badge.js";
|
|
49
|
+
import { Avatar as Wr, AvatarWithLabel as kr } from "./components/avatar/avatar.js";
|
|
50
|
+
import { InfoIcon as Jr } from "./components/assets/icons/info-icon.js";
|
|
51
|
+
import { MagnifierIcon as Yr } from "./components/assets/icons/magnifier-icon.js";
|
|
52
|
+
import { TableHeader as qr } from "./components/table/components/table-header/table-header.js";
|
|
53
|
+
import { TableRow as Kr } from "./components/table/components/table-row.js";
|
|
54
|
+
import { TableEmptyState as $r } from "./components/table/components/table-empty-state.js";
|
|
55
|
+
import { TableLoadingState as re } from "./components/table/components/table-loading-state.js";
|
|
56
|
+
import { Pagination as te } from "./components/table/components/pagination/pagination.js";
|
|
57
|
+
import { TableHeaderWrapper as pe } from "./components/table/components/table-header-wrapper.js";
|
|
58
|
+
import { TableHeaderContent as me } from "./components/table/components/table-header-content.js";
|
|
59
|
+
import { TableFooter as fe } from "./components/table/components/table-footer.js";
|
|
60
|
+
import { TableFooterContent as ie } from "./components/table/components/table-footer-content.js";
|
|
61
|
+
import { PaginationInfo as de } from "./components/table/components/pagination/components/pagination-info.js";
|
|
62
|
+
import { PaginationQuickJumper as ue } from "./components/table/components/pagination/components/pagination-quick-jumper.js";
|
|
58
63
|
import "react";
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import { Badge as xr, badgeVariants as ir } from "./components/badge/badge.js";
|
|
62
|
-
import { Avatar as dr, AvatarWithLabel as ur } from "./components/avatar/avatar.js";
|
|
63
|
-
import { InfoIcon as Dr } from "./components/assets/icons/info-icon.js";
|
|
64
|
-
import { useTheme as br } from "./lib/theme.hook.js";
|
|
65
|
-
import { cn as Cr } from "./lib/utils.js";
|
|
66
|
-
import { Z2PopoverTrigger as cr } from "./components/collapsible-side-nav-bar/popover/popover-trigger.js";
|
|
67
|
-
import { Z2PopoverContent as Ir } from "./components/collapsible-side-nav-bar/popover/popover-content.js";
|
|
64
|
+
import { Z2PopoverTrigger as be } from "./components/collapsible-side-nav-bar/popover/popover-trigger.js";
|
|
65
|
+
import { Z2PopoverContent as ge } from "./components/collapsible-side-nav-bar/popover/popover-content.js";
|
|
68
66
|
export {
|
|
69
67
|
p as Alert,
|
|
70
68
|
f as AlertCirclesIcon,
|
|
71
69
|
n as AlertDescription,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
m as AlertTitle,
|
|
71
|
+
Wr as Avatar,
|
|
72
|
+
kr as AvatarWithLabel,
|
|
73
|
+
Rr as Badge,
|
|
74
|
+
Pr as BooleanCell,
|
|
77
75
|
i as Button,
|
|
78
76
|
_ as ChevronUpIcon,
|
|
79
|
-
|
|
77
|
+
R as CirclesIcon,
|
|
80
78
|
z as CountryFlags,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
Go as DEFAULT_ACCEPT,
|
|
80
|
+
gr as DEFAULT_EMPTY_MESSAGE,
|
|
81
|
+
V as DatabaseCopy,
|
|
84
82
|
fo as DropdownContext,
|
|
85
83
|
yo as FileUploadArea,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
Jr as InfoIcon,
|
|
85
|
+
Uo as Input,
|
|
86
|
+
Yr as MagnifierIcon,
|
|
89
87
|
Wo as NavHeader,
|
|
90
88
|
Oo as NavItem,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
Mr as NumberCell,
|
|
90
|
+
de as PaginationInfo,
|
|
91
|
+
ue as PaginationQuickJumper,
|
|
94
92
|
Y as SIDEBAR_WIDTH,
|
|
95
93
|
j as SIDEBAR_WIDTH_COLLAPSED,
|
|
96
94
|
J as SidebarLeftShowCopy,
|
|
97
95
|
h as SubNavIndicator,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
ye as TableRow,
|
|
115
|
-
Ae as TextCell,
|
|
96
|
+
Cr as TABLE_CSS_CLASSES,
|
|
97
|
+
Zr as Table,
|
|
98
|
+
ur as TableBody,
|
|
99
|
+
hr as TableCard,
|
|
100
|
+
vr as TableCell,
|
|
101
|
+
cr as TableContext,
|
|
102
|
+
$r as TableEmptyState,
|
|
103
|
+
fe as TableFooter,
|
|
104
|
+
ie as TableFooterContent,
|
|
105
|
+
qr as TableHeader,
|
|
106
|
+
me as TableHeaderContent,
|
|
107
|
+
pe as TableHeaderWrapper,
|
|
108
|
+
re as TableLoadingState,
|
|
109
|
+
te as TablePagination,
|
|
110
|
+
dr as TableProvider,
|
|
111
|
+
Kr as TableRow,
|
|
116
112
|
k as WindowLeftCopy,
|
|
117
113
|
X as Z2Dialog,
|
|
118
114
|
$ as Z2DialogClose,
|
|
119
115
|
oo as Z2DialogContent,
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
ro as Z2DialogDescription,
|
|
117
|
+
eo as Z2DialogFooter,
|
|
122
118
|
to as Z2DialogHeader,
|
|
123
119
|
ao as Z2DialogOverlay,
|
|
124
120
|
po as Z2DialogPortal,
|
|
125
121
|
no as Z2DialogTitle,
|
|
126
|
-
|
|
122
|
+
mo as Z2DialogTrigger,
|
|
127
123
|
xo as Z2Dropdown,
|
|
128
124
|
io as Z2DropdownContent,
|
|
129
125
|
Zo as Z2DropdownInput,
|
|
130
|
-
|
|
126
|
+
So as Z2DropdownItem,
|
|
131
127
|
Co as Z2DropdownMenu,
|
|
132
128
|
wo as Z2DropdownMenuCheckboxItem,
|
|
133
129
|
co as Z2DropdownMenuContent,
|
|
@@ -137,19 +133,19 @@ export {
|
|
|
137
133
|
Bo as Z2DropdownMenuPortal,
|
|
138
134
|
Mo as Z2DropdownMenuRadioGroup,
|
|
139
135
|
Ao as Z2DropdownMenuRadioItem,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
136
|
+
Po as Z2DropdownMenuSeparator,
|
|
137
|
+
Lo as Z2DropdownMenuShortcut,
|
|
138
|
+
No as Z2DropdownMenuSub,
|
|
143
139
|
Eo as Z2DropdownMenuSubContent,
|
|
144
140
|
Fo as Z2DropdownMenuSubTrigger,
|
|
145
141
|
Ho as Z2DropdownMenuTrigger,
|
|
146
|
-
|
|
142
|
+
uo as Z2DropdownSub,
|
|
147
143
|
Do as Z2DropdownSubContent,
|
|
148
|
-
|
|
149
|
-
|
|
144
|
+
bo as Z2DropdownSubItem,
|
|
145
|
+
To as Z2DropdownSubTrigger,
|
|
150
146
|
F as Z2Popover,
|
|
151
|
-
|
|
152
|
-
|
|
147
|
+
ge as Z2PopoverContent,
|
|
148
|
+
be as Z2PopoverTrigger,
|
|
153
149
|
Qo as Z2Select,
|
|
154
150
|
Yo as Z2SelectContent,
|
|
155
151
|
jo as Z2SelectGroup,
|
|
@@ -158,30 +154,29 @@ export {
|
|
|
158
154
|
Ko as Z2SelectScrollDownButton,
|
|
159
155
|
Xo as Z2SelectScrollUpButton,
|
|
160
156
|
$o as Z2SelectSeparator,
|
|
161
|
-
|
|
162
|
-
|
|
157
|
+
or as Z2SelectTrigger,
|
|
158
|
+
rr as Z2SelectValue,
|
|
163
159
|
D as Z2SideNavBar,
|
|
164
160
|
w as Z2SideNavBarContent,
|
|
165
161
|
s as Z2SideNavBarFooter,
|
|
166
162
|
v as Z2SideNavBarGroup,
|
|
167
163
|
g as Z2SideNavBarHeader,
|
|
168
164
|
M as Z2SideNavBarItem,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
165
|
+
S as Z2SideNavBarProvider,
|
|
166
|
+
P as Z2SideNavBarSeparator,
|
|
167
|
+
b as Z2SidebarVariants,
|
|
168
|
+
tr as Z2Stepper,
|
|
169
|
+
pr as Z2StepperItem,
|
|
170
|
+
mr as Z2Tabs,
|
|
171
|
+
lr as Z2TabsContent,
|
|
172
|
+
fr as Z2TabsList,
|
|
173
|
+
xr as Z2TabsTrigger,
|
|
174
|
+
_r as Z2Tooltip,
|
|
175
|
+
Ur as badgeVariants,
|
|
180
176
|
Z as buttonVariants,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
L as useZ2SideNavBar
|
|
177
|
+
Fr as cn,
|
|
178
|
+
br as extractCellValue,
|
|
179
|
+
sr as useTableContext,
|
|
180
|
+
Nr as useTheme,
|
|
181
|
+
N as useZ2SideNavBar
|
|
187
182
|
};
|
|
@@ -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,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,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>;
|
|
@@ -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,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>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { CellValue } from '../../table.type';
|
|
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,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,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { CellValue, CellType, CellRenderer, TableProps } from '../table.type';
|
|
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 +1,4 @@
|
|
|
1
|
-
export { TableFilter } from './table-filter';
|
|
1
|
+
export { TableFilterProvider, TableFilter } from './table-filter-provider';
|
|
2
|
+
export { TableFilterButton } from './table-filter-button';
|
|
3
|
+
export { TableFilterColumnButton } from './table-filter-column-button';
|
|
4
|
+
export { useTableFilterContext } from './table-filter.context';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FilterRule, TableSchema } from '../../../table.type';
|
|
2
|
+
export interface SelectedFilterDisplayProps {
|
|
3
|
+
selectedFilters: FilterRule[];
|
|
4
|
+
schema: TableSchema;
|
|
5
|
+
}
|
|
6
|
+
export interface FilterDisplayItem {
|
|
7
|
+
field: string;
|
|
8
|
+
fieldTitle: string;
|
|
9
|
+
value: string | string[];
|
|
10
|
+
condition?: string;
|
|
11
|
+
count?: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FilterRule, TableSchema, FilterOption } from '../../../table.type';
|
|
2
|
+
import { FilterDisplayItem } from './selected-filters-display.type';
|
|
3
|
+
export declare const formatFilterValue: (value: string | string[]) => string;
|
|
4
|
+
export declare const getFilterCount: (filterRule: FilterRule, filterOptions?: FilterOption[]) => number | undefined;
|
|
5
|
+
export declare const createFilterDisplayItems: (selectedFilters: FilterRule[], schema: TableSchema) => FilterDisplayItem[];
|
|
6
|
+
export declare const calculateTotalCount: (filterDisplayItems: FilterDisplayItem[]) => number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TableFilterProps } from './table-filter.type';
|
|
3
|
+
import { TableFilterButton } from './table-filter-button';
|
|
4
|
+
import { TableFilterColumnButton } from './table-filter-column-button';
|
|
5
|
+
export interface TableFilterProviderProps extends TableFilterProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const TableFilterProvider: React.FC<TableFilterProviderProps>;
|
|
9
|
+
interface TableFilterCompoundComponent extends React.FC<TableFilterProviderProps> {
|
|
10
|
+
FilterButton: typeof TableFilterButton;
|
|
11
|
+
FilterColumnButton: typeof TableFilterColumnButton;
|
|
12
|
+
}
|
|
13
|
+
export declare const TableFilter: TableFilterCompoundComponent;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TableSchema, TableFilter as TableFilterType, FilterRule } from '../../table.type';
|
|
3
|
+
import { FilterComponentType } from './table-filter.type';
|
|
4
|
+
export interface TableFilterContextValue {
|
|
5
|
+
selectedColumn: string | null;
|
|
6
|
+
setSelectedColumn: (column: string | null) => void;
|
|
7
|
+
getFilterForColumn: (columnKey: string) => FilterRule | undefined;
|
|
8
|
+
hasFilterForColumn: (columnKey: string) => boolean;
|
|
9
|
+
hasAppliedFilterForColumn: (columnKey: string) => boolean;
|
|
10
|
+
updateColumnFilter: (columnKey: string, condition?: string, value?: string | string[]) => void;
|
|
11
|
+
clearAllFilters: () => void;
|
|
12
|
+
applyFilters: () => void;
|
|
13
|
+
hasActiveFilters: boolean;
|
|
14
|
+
filterableFields: TableSchema;
|
|
15
|
+
tempFilters: FilterRule[];
|
|
16
|
+
schema: TableSchema;
|
|
17
|
+
filter: TableFilterType;
|
|
18
|
+
filterComponents?: Record<string, FilterComponentType>;
|
|
19
|
+
}
|
|
20
|
+
export declare const TableFilterContext: React.Context<TableFilterContextValue | undefined>;
|
|
21
|
+
export declare const useTableFilterContext: () => TableFilterContextValue;
|
|
@@ -2,16 +2,15 @@ import React from 'react';
|
|
|
2
2
|
import { TableFilterProps } from './table-filter.type';
|
|
3
3
|
import { FilterRule } from '../../table.type';
|
|
4
4
|
declare const useTableFilter: ({ filter, schema }: TableFilterProps) => {
|
|
5
|
-
isOpen: boolean;
|
|
6
5
|
selectedColumn: string | null;
|
|
7
6
|
setSelectedColumn: React.Dispatch<React.SetStateAction<string | null>>;
|
|
8
7
|
getFilterForColumn: (columnKey: string) => FilterRule | undefined;
|
|
9
8
|
hasFilterForColumn: (columnKey: string) => boolean;
|
|
9
|
+
hasAppliedFilterForColumn: (columnKey: string) => boolean;
|
|
10
10
|
updateColumnFilter: (columnKey: string, condition?: string, value?: string | string[]) => void;
|
|
11
11
|
clearAllFilters: () => void;
|
|
12
12
|
applyFilters: () => void;
|
|
13
13
|
hasActiveFilters: boolean;
|
|
14
|
-
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
15
14
|
tempFilters: FilterRule[];
|
|
16
15
|
filterableFields: import("../../table.type").TableSchemaColumn[];
|
|
17
16
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react';
|
|
2
|
-
export declare const basicHeaderUsageCode = "import { Table, TableHeader } from '@/components/table';\n\nconst schema = [\n {\n key: 'id',\n title: 'ID',\n cellType: 'number',\n sortable: true,\n },\n {\n key: 'name',\n title: 'Name',\n cellType: '
|
|
2
|
+
export declare const basicHeaderUsageCode = "import { Table, TableHeader } from '@/components/table';\n\nconst schema = [\n {\n key: 'id',\n title: 'ID',\n cellType: 'number',\n sortable: true,\n },\n {\n key: 'name',\n title: 'Name',\n cellType: 'label',\n sortable: true,\n },\n];\n\nconst data = [\n { id: 1, name: 'John Doe' },\n { id: 2, name: 'Jane Smith' },\n];\n\nfunction MyTable() {\n return (\n <Table dataSource={data} schema={schema}>\n <table className=\"w-full\">\n <TableHeader \n schema={schema}\n cell={{ hasBorder: true }}\n />\n {/* Table body goes here */}\n </table>\n </Table>\n );\n}";
|
|
3
3
|
export declare const BasicHeader: StoryObj;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export { Table as default, Table, TableProvider } from './table-provider';
|
|
2
2
|
export { TableBody } from './table';
|
|
3
3
|
export type { TableProps, TableSchema, TableSchemaColumn, CellType, CellValue, CellRenderer, CellRendererProps, FilterRule, FilterCondition, FilterOption, TableFilter as TableFilterType, TablePaginationConfig, SortDirection, SortColumn, TableSort, } from './table.type';
|
|
4
|
-
export {
|
|
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';
|
|
7
|
-
export { TableCell, TableHeader, TableRow, TableEmptyState, TableLoadingState, TablePagination,
|
|
8
|
-
export { TableFilter } from './components/table-filter';
|
|
7
|
+
export { TableCell, TableHeader, TableRow, TableEmptyState, TableLoadingState, TablePagination, NumberCell, BooleanCell, TableHeaderWrapper, TableHeaderContent, TableFooter, TableFooterContent, } from './components';
|
|
9
8
|
export { PaginationInfo, PaginationQuickJumper } from './components/pagination/components';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { TableProps } from './table.type';
|
|
3
3
|
import { TableBody } from './table';
|
|
4
|
-
import { TableFilter } from './components/table-filter';
|
|
4
|
+
import { TableFilter } from './components/table-filter/table-filter-provider';
|
|
5
5
|
import { TableSearch } from './components/table-search';
|
|
6
6
|
import { Pagination } from './components/pagination';
|
|
7
7
|
import { TableHeaderWrapper, TableHeaderContent, TableFooter, TableFooterContent } from './components';
|