@yuno-payments/dashboard-design-system 2.3.4 → 2.3.5
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/atoms/checkbox/checkbox.js +16 -16
- package/dist/components/atoms/filter/filter-date-range.d.ts +1 -31
- package/dist/components/atoms/filter/filter-date-range.js +144 -140
- package/dist/components/atoms/filter/filter-multi-input.d.ts +0 -11
- package/dist/components/atoms/filter/filter-multi-input.js +36 -42
- package/dist/components/atoms/filter/filter.d.ts +0 -30
- package/dist/components/atoms/filter/filter.js +171 -191
- package/dist/components/atoms/filter/index.d.ts +2 -2
- package/dist/components/atoms/filter-dropdown/filter-dropdown.d.ts +2 -17
- package/dist/components/atoms/filter-dropdown/filter-dropdown.js +151 -160
- package/dist/components/atoms/icon/icon.d.ts +0 -6
- package/dist/components/atoms/icon/icon.js +21 -27
- package/dist/components/atoms/icon/index.d.ts +0 -1
- package/dist/components/atoms/index.d.ts +1 -1
- package/dist/components/atoms/radio-group/radio-group-option.js +2 -2
- package/dist/components/atoms/select/select.js +2 -2
- package/dist/components/molecules/dialog-header/dialog-header.d.ts +1 -1
- package/dist/components/molecules/pagination/index.d.ts +0 -1
- package/dist/components/molecules/pagination/page-numbers.d.ts +1 -3
- package/dist/components/molecules/pagination/page-numbers.js +9 -10
- package/dist/components/molecules/pagination/pagination.d.ts +0 -9
- package/dist/components/molecules/pagination/pagination.js +38 -46
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.d.ts +1 -3
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.js +27 -28
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header.js +41 -44
- package/dist/components/organisms/data-table/components/data-table-header.js +12 -11
- package/dist/components/organisms/data-table/components/dialogs/data-table-manage-columns-dialog.d.ts +1 -3
- package/dist/components/organisms/data-table/components/dialogs/data-table-manage-columns-dialog.js +44 -45
- package/dist/components/organisms/data-table/data-table.d.ts +2 -27
- package/dist/components/organisms/data-table/data-table.js +134 -146
- package/dist/components/organisms/data-table/data-table.types.d.ts +0 -68
- package/dist/components/organisms/data-table/index.d.ts +1 -2
- package/dist/components/organisms/data-table/utils/data-table-utils.js +8 -11
- package/dist/dashboard-design-system.css +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.esm.min.js +8512 -9394
- package/dist/index.js +202 -208
- package/dist/index.umd.min.js +25 -25
- package/dist/lib/utils.d.ts +0 -13
- package/dist/lib/utils.js +10 -34
- package/dist/vendor/shadcn/pagination.d.ts +3 -19
- package/dist/vendor/shadcn/pagination.js +37 -41
- package/dist/vendor/shadcn/select.js +33 -33
- package/dist/vendor/shadcn/switch.js +1 -1
- package/package.json +2 -4
- package/registry/components-registry.json +12 -38
- package/dist/components/atoms/filter/filter-translations.d.ts +0 -75
- package/dist/components/atoms/filter/filter-translations.js +0 -450
- package/dist/components/atoms/icon/directional-icons.d.ts +0 -12
- package/dist/components/atoms/icon/directional-icons.js +0 -38
- package/dist/components/molecules/pagination/pagination-translations.d.ts +0 -33
- package/dist/components/molecules/pagination/pagination-translations.js +0 -82
- package/dist/components/organisms/data-table/data-table.types.js +0 -252
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { IconList as
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
|
|
8
|
-
const N = z("inline-flex items-center justify-center shrink-0", {
|
|
1
|
+
import { j as s } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { forwardRef as p } from "react";
|
|
3
|
+
import { cva as u } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
4
|
+
import { cn as x } from "../../../lib/utils.js";
|
|
5
|
+
import { IconList as z } from "./icon-list.js";
|
|
6
|
+
import { Tooltip as d } from "../tooltip/tooltip.js";
|
|
7
|
+
const j = u("inline-flex items-center justify-center shrink-0", {
|
|
9
8
|
variants: {
|
|
10
9
|
size: {
|
|
11
10
|
xs: "size-3",
|
|
@@ -18,39 +17,34 @@ const N = z("inline-flex items-center justify-center shrink-0", {
|
|
|
18
17
|
defaultVariants: {
|
|
19
18
|
size: "md"
|
|
20
19
|
}
|
|
21
|
-
}), g =
|
|
20
|
+
}), g = p(
|
|
22
21
|
({
|
|
23
22
|
name: r,
|
|
24
|
-
weight:
|
|
23
|
+
weight: t = "light",
|
|
25
24
|
size: e,
|
|
26
25
|
className: c,
|
|
27
26
|
color: l,
|
|
28
|
-
tooltip:
|
|
27
|
+
tooltip: i,
|
|
29
28
|
tooltipProps: m,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, u) => {
|
|
29
|
+
...a
|
|
30
|
+
}, f) => {
|
|
33
31
|
if (!r)
|
|
34
32
|
return null;
|
|
35
|
-
const
|
|
36
|
-
if (!
|
|
33
|
+
const o = z?.[r];
|
|
34
|
+
if (!o)
|
|
37
35
|
return console.error("Missing icon", r), null;
|
|
38
|
-
const
|
|
39
|
-
|
|
36
|
+
const n = /* @__PURE__ */ s.jsx(
|
|
37
|
+
o,
|
|
40
38
|
{
|
|
41
|
-
ref:
|
|
39
|
+
ref: f,
|
|
42
40
|
"aria-label": r,
|
|
43
|
-
className:
|
|
44
|
-
N({ size: e }),
|
|
45
|
-
x && "rtl:scale-x-[-1]",
|
|
46
|
-
c
|
|
47
|
-
),
|
|
41
|
+
className: x(j({ size: e }), c),
|
|
48
42
|
color: l || "currentColor",
|
|
49
|
-
weight:
|
|
50
|
-
...
|
|
43
|
+
weight: t,
|
|
44
|
+
...a
|
|
51
45
|
}
|
|
52
46
|
);
|
|
53
|
-
return
|
|
47
|
+
return i ? /* @__PURE__ */ s.jsx(d, { content: i, ...m, children: n }) : n;
|
|
54
48
|
}
|
|
55
49
|
);
|
|
56
50
|
g.displayName = "Icon";
|
|
@@ -10,7 +10,7 @@ export { CurrencyField, type CurrencyFieldProps } from './currency-field';
|
|
|
10
10
|
export { DatePicker, type DatePickerProps } from './date-picker';
|
|
11
11
|
export { DateRangePicker, type DateRangePickerProps, } from './date-range-picker';
|
|
12
12
|
export { TimePicker, type TimePickerProps } from './time-picker';
|
|
13
|
-
export { FilterButton, FilterTag, FilterSection, FilterCheckboxOption, FilterRadioOption, FilterContent, FilterDateRange, FilterDateRangeOption, FilterDateRangeValue, FilterMultiInput, type FilterButtonProps, type FilterTagProps, type FilterSectionProps, type FilterCheckboxOptionProps, type FilterRadioOptionProps, type FilterContentProps, type FilterDateRangeProps, type FilterDateRangeOptionProps, type
|
|
13
|
+
export { FilterButton, FilterTag, FilterSection, FilterCheckboxOption, FilterRadioOption, FilterContent, FilterDateRange, FilterDateRangeOption, FilterDateRangeValue, FilterMultiInput, type FilterButtonProps, type FilterTagProps, type FilterSectionProps, type FilterCheckboxOptionProps, type FilterRadioOptionProps, type FilterContentProps, type FilterDateRangeProps, type FilterDateRangeOptionProps, type FilterMultiInputProps, } from './filter';
|
|
14
14
|
export { FilterDropdown, FilterMenu, FilterMenuItem, type FilterDropdownProps, type FilterConfig, type FilterMenuProps, type FilterMenuItemProps, type FilterDeferredContext, } from './filter-dropdown';
|
|
15
15
|
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, type DropdownMenuProps, type DropdownMenuPortalProps, type DropdownMenuTriggerProps, type DropdownMenuContentProps, type DropdownMenuGroupProps, type DropdownMenuLabelProps, type DropdownMenuItemProps, type DropdownMenuCheckboxItemProps, type DropdownMenuRadioGroupProps, type DropdownMenuRadioItemProps, type DropdownMenuSeparatorProps, type DropdownMenuShortcutProps, type DropdownMenuSubProps, type DropdownMenuSubTriggerProps, type DropdownMenuSubContentProps, } from './dropdown-menu';
|
|
16
16
|
export { DotsMenu, type DotsMenuProps, type DotsMenuAction, type DotsMenuOptions, } from './dots-menu';
|
|
@@ -9,7 +9,7 @@ const o = ({
|
|
|
9
9
|
}) => /* @__PURE__ */ r.jsxs(
|
|
10
10
|
"div",
|
|
11
11
|
{
|
|
12
|
-
className: t ? "flex items-center gap-3
|
|
12
|
+
className: t ? "flex items-center gap-3" : "flex items-start gap-3",
|
|
13
13
|
children: [
|
|
14
14
|
/* @__PURE__ */ r.jsx(
|
|
15
15
|
d,
|
|
@@ -32,7 +32,7 @@ const o = ({
|
|
|
32
32
|
children: e.label
|
|
33
33
|
}
|
|
34
34
|
),
|
|
35
|
-
e.description && /* @__PURE__ */ r.jsx("p", { className: "text-sm text-muted-foreground
|
|
35
|
+
e.description && /* @__PURE__ */ r.jsx("p", { className: "text-sm text-muted-foreground ml-auto", children: e.description })
|
|
36
36
|
] }) : /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col gap-1.5 flex-1", children: [
|
|
37
37
|
/* @__PURE__ */ r.jsx(
|
|
38
38
|
a,
|
|
@@ -72,14 +72,14 @@ const $ = G.forwardRef(
|
|
|
72
72
|
j.map((l, C) => /* @__PURE__ */ e.jsxs(V, { children: [
|
|
73
73
|
l.label && /* @__PURE__ */ e.jsx(E, { children: l.label }),
|
|
74
74
|
l.options.map((s) => /* @__PURE__ */ e.jsxs(f, { value: s.value, children: [
|
|
75
|
-
s.icon && /* @__PURE__ */ e.jsx("span", { className: "
|
|
75
|
+
s.icon && /* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-flex items-center", children: s.icon }),
|
|
76
76
|
s.label
|
|
77
77
|
] }, s.value))
|
|
78
78
|
] }, C))
|
|
79
79
|
) : w ? (
|
|
80
80
|
// Render flat options
|
|
81
81
|
h.map((l) => /* @__PURE__ */ e.jsx(f, { value: l.value, children: /* @__PURE__ */ e.jsxs("span", { className: "flex items-center", children: [
|
|
82
|
-
l.icon && /* @__PURE__ */ e.jsx("span", { className: "
|
|
82
|
+
l.icon && /* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-flex items-center", children: l.icon }),
|
|
83
83
|
l.label
|
|
84
84
|
] }) }, l.value))
|
|
85
85
|
) : null })
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* Props for the DialogHeader component
|
|
4
4
|
*/
|
|
5
|
-
export interface DialogHeaderProps extends
|
|
5
|
+
export interface DialogHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
6
|
/**
|
|
7
7
|
* Dialog title (text or custom element)
|
|
8
8
|
*/
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export { Pagination, type PaginationProps } from './pagination';
|
|
2
|
-
export { getPaginationTranslations, type PaginationLanguage, type PaginationTranslations, } from './pagination-translations';
|
|
3
2
|
export { Pagination as PaginationRoot, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, } from '../../../vendor/shadcn/pagination';
|
|
@@ -3,8 +3,6 @@ interface PageNumbersProps {
|
|
|
3
3
|
totalPages?: number;
|
|
4
4
|
maxVisiblePages: number;
|
|
5
5
|
onPageClick?: (page: number) => void;
|
|
6
|
-
/** Screen reader label for ellipsis (default: "More pages") */
|
|
7
|
-
morePagesLabel?: string;
|
|
8
6
|
}
|
|
9
|
-
declare const PageNumbers: ({ currentPage, totalPages, maxVisiblePages, onPageClick,
|
|
7
|
+
declare const PageNumbers: ({ currentPage, totalPages, maxVisiblePages, onPageClick, }: PageNumbersProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
8
|
export { PageNumbers, type PageNumbersProps };
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import { j as i } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { PaginationItem as e, PaginationLink as t, PaginationEllipsis as h } from "../../../vendor/shadcn/pagination.js";
|
|
3
|
-
import { calculateVisiblePages as
|
|
4
|
-
const
|
|
3
|
+
import { calculateVisiblePages as a } from "./page-numbers.utils.js";
|
|
4
|
+
const u = ({
|
|
5
5
|
currentPage: n,
|
|
6
6
|
totalPages: l,
|
|
7
7
|
maxVisiblePages: o,
|
|
8
|
-
onPageClick: c
|
|
9
|
-
morePagesLabel: m
|
|
8
|
+
onPageClick: c
|
|
10
9
|
}) => {
|
|
11
10
|
if (!l)
|
|
12
11
|
return /* @__PURE__ */ i.jsx(e, { children: /* @__PURE__ */ i.jsx(t, { isActive: !0, children: n }) });
|
|
13
|
-
const
|
|
12
|
+
const m = (s, r) => {
|
|
14
13
|
s.preventDefault(), r !== n && c?.(r);
|
|
15
|
-
},
|
|
16
|
-
return /* @__PURE__ */ i.jsx(i.Fragment, { children:
|
|
17
|
-
(s, r) => s === "ellipsis" ? /* @__PURE__ */ i.jsx(e, { children: /* @__PURE__ */ i.jsx(h, {
|
|
14
|
+
}, x = a(n, l, o);
|
|
15
|
+
return /* @__PURE__ */ i.jsx(i.Fragment, { children: x.map(
|
|
16
|
+
(s, r) => s === "ellipsis" ? /* @__PURE__ */ i.jsx(e, { children: /* @__PURE__ */ i.jsx(h, {}) }, `ellipsis-${r}`) : /* @__PURE__ */ i.jsx(e, { children: /* @__PURE__ */ i.jsx(
|
|
18
17
|
t,
|
|
19
18
|
{
|
|
20
19
|
href: "#",
|
|
21
|
-
onClick: (
|
|
20
|
+
onClick: (j) => m(j, s),
|
|
22
21
|
isActive: s === n,
|
|
23
22
|
children: s
|
|
24
23
|
}
|
|
@@ -26,5 +25,5 @@ const b = ({
|
|
|
26
25
|
) });
|
|
27
26
|
};
|
|
28
27
|
export {
|
|
29
|
-
|
|
28
|
+
u as PageNumbers
|
|
30
29
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
|
-
import { PaginationLanguage, PaginationTranslations } from './pagination-translations';
|
|
3
2
|
/**
|
|
4
3
|
* Props for the Pagination component
|
|
5
4
|
*/
|
|
@@ -44,14 +43,6 @@ interface PaginationProps extends ComponentProps<"nav"> {
|
|
|
44
43
|
* @default 5
|
|
45
44
|
*/
|
|
46
45
|
maxVisiblePages?: number;
|
|
47
|
-
/**
|
|
48
|
-
* Language for translations. Falls back to localStorage "yuno-lang", then "en".
|
|
49
|
-
*/
|
|
50
|
-
lang?: PaginationLanguage;
|
|
51
|
-
/**
|
|
52
|
-
* Custom translations to override default language strings
|
|
53
|
-
*/
|
|
54
|
-
translations?: Partial<PaginationTranslations>;
|
|
55
46
|
}
|
|
56
47
|
/**
|
|
57
48
|
* Pagination component for navigating through multiple pages of content.
|
|
@@ -1,66 +1,58 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { PageNumbers as
|
|
4
|
-
import { Pagination as
|
|
5
|
-
|
|
6
|
-
const c = "pointer-events-none opacity-50", I = C(
|
|
1
|
+
import { j as i } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { forwardRef as D } from "react";
|
|
3
|
+
import { PageNumbers as N } from "./page-numbers.js";
|
|
4
|
+
import { Pagination as b, PaginationContent as g, PaginationItem as r, PaginationPrevious as v, PaginationNext as k } from "../../../vendor/shadcn/pagination.js";
|
|
5
|
+
const l = "pointer-events-none opacity-50", S = D(
|
|
7
6
|
({
|
|
8
7
|
currentPage: n,
|
|
9
|
-
totalPages:
|
|
10
|
-
onPageClick:
|
|
11
|
-
onClickNext:
|
|
12
|
-
onClickPrev:
|
|
13
|
-
disablePrevious:
|
|
14
|
-
disableNext:
|
|
15
|
-
showPreviousNext:
|
|
16
|
-
maxVisiblePages:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}, N = (i) => {
|
|
25
|
-
i.preventDefault(), !t && x?.();
|
|
8
|
+
totalPages: e,
|
|
9
|
+
onPageClick: c,
|
|
10
|
+
onClickNext: f,
|
|
11
|
+
onClickPrev: d,
|
|
12
|
+
disablePrevious: m = !1,
|
|
13
|
+
disableNext: x = !1,
|
|
14
|
+
showPreviousNext: o = !0,
|
|
15
|
+
maxVisiblePages: p = 5,
|
|
16
|
+
className: j,
|
|
17
|
+
...h
|
|
18
|
+
}, u) => {
|
|
19
|
+
const a = n === 1 || m, s = (e ? n >= e : !1) || x, P = (t) => {
|
|
20
|
+
t.preventDefault(), !a && d?.();
|
|
21
|
+
}, C = (t) => {
|
|
22
|
+
t.preventDefault(), !s && f?.();
|
|
26
23
|
};
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
return /* @__PURE__ */ i.jsx(b, { ref: u, className: j, ...h, children: /* @__PURE__ */ i.jsxs(g, { children: [
|
|
25
|
+
o && /* @__PURE__ */ i.jsx(r, { children: /* @__PURE__ */ i.jsx(
|
|
26
|
+
v,
|
|
30
27
|
{
|
|
31
28
|
href: "#",
|
|
32
|
-
onClick:
|
|
33
|
-
"aria-disabled":
|
|
34
|
-
className:
|
|
35
|
-
label: a.previous,
|
|
36
|
-
ariaLabel: a.goToPreviousPage
|
|
29
|
+
onClick: P,
|
|
30
|
+
"aria-disabled": a,
|
|
31
|
+
className: a ? l : ""
|
|
37
32
|
}
|
|
38
33
|
) }),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
34
|
+
/* @__PURE__ */ i.jsx(
|
|
35
|
+
N,
|
|
41
36
|
{
|
|
42
37
|
currentPage: n,
|
|
43
|
-
totalPages:
|
|
44
|
-
maxVisiblePages:
|
|
45
|
-
onPageClick:
|
|
46
|
-
morePagesLabel: a.morePages
|
|
38
|
+
totalPages: e,
|
|
39
|
+
maxVisiblePages: p,
|
|
40
|
+
onPageClick: c
|
|
47
41
|
}
|
|
48
42
|
),
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
o && /* @__PURE__ */ i.jsx(r, { children: /* @__PURE__ */ i.jsx(
|
|
44
|
+
k,
|
|
51
45
|
{
|
|
52
46
|
href: "#",
|
|
53
|
-
onClick:
|
|
54
|
-
"aria-disabled":
|
|
55
|
-
className:
|
|
56
|
-
label: a.next,
|
|
57
|
-
ariaLabel: a.goToNextPage
|
|
47
|
+
onClick: C,
|
|
48
|
+
"aria-disabled": s,
|
|
49
|
+
className: s ? l : ""
|
|
58
50
|
}
|
|
59
51
|
) })
|
|
60
52
|
] }) });
|
|
61
53
|
}
|
|
62
54
|
);
|
|
63
|
-
|
|
55
|
+
S.displayName = "Pagination";
|
|
64
56
|
export {
|
|
65
|
-
|
|
57
|
+
S as Pagination
|
|
66
58
|
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { Column } from '@tanstack/react-table';
|
|
2
|
-
import { DataTableTranslations } from '../../data-table.types';
|
|
3
2
|
interface DataTableColumnHeaderMenuProps<TData, TValue> {
|
|
4
3
|
column: Column<TData, TValue>;
|
|
5
4
|
isLastVisibleColumn: boolean;
|
|
6
5
|
onManageColumnsClick: () => void;
|
|
7
|
-
translations: Required<DataTableTranslations>;
|
|
8
6
|
}
|
|
9
|
-
export declare function DataTableColumnHeaderMenu<TData, TValue>({ column, isLastVisibleColumn, onManageColumnsClick,
|
|
7
|
+
export declare function DataTableColumnHeaderMenu<TData, TValue>({ column, isLastVisibleColumn, onManageColumnsClick, }: DataTableColumnHeaderMenuProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
10
8
|
export {};
|
|
@@ -1,76 +1,75 @@
|
|
|
1
1
|
import { j as e } from "../../../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { Icon as n } from "../../../../atoms/icon/icon.js";
|
|
3
|
-
import { DropdownMenuContent as
|
|
4
|
-
function
|
|
3
|
+
import { DropdownMenuContent as g, DropdownMenuItem as i, DropdownMenuSeparator as o } from "../../../../atoms/dropdown-menu/dropdown-menu.js";
|
|
4
|
+
function p({
|
|
5
5
|
column: s,
|
|
6
|
-
isLastVisibleColumn:
|
|
7
|
-
onManageColumnsClick:
|
|
8
|
-
translations: i
|
|
6
|
+
isLastVisibleColumn: r,
|
|
7
|
+
onManageColumnsClick: a
|
|
9
8
|
}) {
|
|
10
|
-
const l = s.getCanSort(),
|
|
11
|
-
return /* @__PURE__ */ e.jsxs(
|
|
9
|
+
const l = s.getCanSort(), d = s.getCanPin(), x = s.getCanHide(), t = s.getIsPinned(), c = s.getIsSorted();
|
|
10
|
+
return /* @__PURE__ */ e.jsxs(g, { align: "start", children: [
|
|
12
11
|
l && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
13
|
-
/* @__PURE__ */ e.jsxs(
|
|
12
|
+
/* @__PURE__ */ e.jsxs(i, { onClick: () => s.toggleSorting(!1), children: [
|
|
14
13
|
/* @__PURE__ */ e.jsx(n, { name: "ArrowUp", size: "sm" }),
|
|
15
|
-
|
|
14
|
+
"Ascending"
|
|
16
15
|
] }),
|
|
17
|
-
/* @__PURE__ */ e.jsxs(
|
|
16
|
+
/* @__PURE__ */ e.jsxs(i, { onClick: () => s.toggleSorting(!0), children: [
|
|
18
17
|
/* @__PURE__ */ e.jsx(n, { name: "ArrowDown", size: "sm" }),
|
|
19
|
-
|
|
18
|
+
"Descending"
|
|
20
19
|
] }),
|
|
21
|
-
|
|
20
|
+
c && /* @__PURE__ */ e.jsxs(i, { onClick: () => s.clearSorting(), children: [
|
|
22
21
|
/* @__PURE__ */ e.jsx(n, { name: "X", size: "sm" }),
|
|
23
|
-
|
|
22
|
+
"Clear sorting"
|
|
24
23
|
] }),
|
|
25
24
|
/* @__PURE__ */ e.jsx(o, {})
|
|
26
25
|
] }),
|
|
27
|
-
|
|
26
|
+
d && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
28
27
|
/* @__PURE__ */ e.jsxs(
|
|
29
|
-
|
|
28
|
+
i,
|
|
30
29
|
{
|
|
31
30
|
onClick: () => s.pin("left"),
|
|
32
31
|
disabled: t === "left",
|
|
33
32
|
children: [
|
|
34
33
|
/* @__PURE__ */ e.jsx(n, { name: "PushPinSimple", size: "sm" }),
|
|
35
|
-
|
|
34
|
+
"Pin to the left"
|
|
36
35
|
]
|
|
37
36
|
}
|
|
38
37
|
),
|
|
39
38
|
/* @__PURE__ */ e.jsxs(
|
|
40
|
-
|
|
39
|
+
i,
|
|
41
40
|
{
|
|
42
41
|
onClick: () => s.pin("right"),
|
|
43
42
|
disabled: t === "right",
|
|
44
43
|
children: [
|
|
45
44
|
/* @__PURE__ */ e.jsx(n, { name: "PushPinSimple", size: "sm" }),
|
|
46
|
-
|
|
45
|
+
"Pin to the right"
|
|
47
46
|
]
|
|
48
47
|
}
|
|
49
48
|
),
|
|
50
|
-
t && /* @__PURE__ */ e.jsxs(
|
|
49
|
+
t && /* @__PURE__ */ e.jsxs(i, { onClick: () => s.pin(!1), children: [
|
|
51
50
|
/* @__PURE__ */ e.jsx(n, { name: "PushPinSimpleSlash", size: "sm" }),
|
|
52
|
-
|
|
51
|
+
"Unpin"
|
|
53
52
|
] }),
|
|
54
53
|
/* @__PURE__ */ e.jsx(o, {})
|
|
55
54
|
] }),
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
x && /* @__PURE__ */ e.jsxs(
|
|
56
|
+
i,
|
|
58
57
|
{
|
|
59
58
|
onClick: () => s.toggleVisibility(!1),
|
|
60
|
-
disabled:
|
|
59
|
+
disabled: r,
|
|
61
60
|
children: [
|
|
62
61
|
/* @__PURE__ */ e.jsx(n, { name: "EyeSlash", size: "sm" }),
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
"Hide",
|
|
63
|
+
r && /* @__PURE__ */ e.jsx("span", { className: "ml-auto text-xs text-muted-foreground", children: "(Last column)" })
|
|
65
64
|
]
|
|
66
65
|
}
|
|
67
66
|
),
|
|
68
|
-
/* @__PURE__ */ e.jsxs(
|
|
67
|
+
/* @__PURE__ */ e.jsxs(i, { onClick: a, children: [
|
|
69
68
|
/* @__PURE__ */ e.jsx(n, { name: "Columns", size: "sm" }),
|
|
70
|
-
|
|
69
|
+
"Manage columns"
|
|
71
70
|
] })
|
|
72
71
|
] });
|
|
73
72
|
}
|
|
74
73
|
export {
|
|
75
|
-
|
|
74
|
+
p as DataTableColumnHeaderMenu
|
|
76
75
|
};
|
package/dist/components/organisms/data-table/components/column-header/data-table-column-header.js
CHANGED
|
@@ -1,38 +1,37 @@
|
|
|
1
1
|
import { j as e } from "../../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { Icon as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { useColumnHeader as
|
|
5
|
-
import { DataTableColumnHeaderMenu as
|
|
2
|
+
import { Icon as b } from "../../../../atoms/icon/icon.js";
|
|
3
|
+
import { cn as m } from "../../../../../lib/utils.js";
|
|
4
|
+
import { useColumnHeader as D } from "../../hooks/use-column-header.js";
|
|
5
|
+
import { DataTableColumnHeaderMenu as O } from "./data-table-column-header-menu.js";
|
|
6
6
|
import { DataTableManageColumnsDialog as v } from "../dialogs/data-table-manage-columns-dialog.js";
|
|
7
|
-
import { DataTableColumnHeaderContent as
|
|
8
|
-
import { DEFAULT_DATA_TABLE_TRANSLATIONS as H } from "../../data-table.types.js";
|
|
7
|
+
import { DataTableColumnHeaderContent as H } from "./data-table-column-header-content.js";
|
|
9
8
|
import { DropdownMenu as I } from "../../../../atoms/dropdown-menu/dropdown-menu.js";
|
|
10
|
-
function
|
|
9
|
+
function z({
|
|
11
10
|
column: o,
|
|
12
|
-
table:
|
|
13
|
-
title:
|
|
14
|
-
className:
|
|
11
|
+
table: l,
|
|
12
|
+
title: s,
|
|
13
|
+
className: a,
|
|
15
14
|
info: n
|
|
16
15
|
}) {
|
|
17
16
|
const {
|
|
18
|
-
isHovered:
|
|
19
|
-
setIsHovered:
|
|
20
|
-
isMenuOpen:
|
|
21
|
-
setIsMenuOpen:
|
|
22
|
-
isManageColumnsOpen:
|
|
17
|
+
isHovered: u,
|
|
18
|
+
setIsHovered: r,
|
|
19
|
+
isMenuOpen: t,
|
|
20
|
+
setIsMenuOpen: p,
|
|
21
|
+
isManageColumnsOpen: d,
|
|
23
22
|
setIsManageColumnsOpen: C,
|
|
24
|
-
isPinned:
|
|
25
|
-
canPin:
|
|
26
|
-
canSort:
|
|
23
|
+
isPinned: c,
|
|
24
|
+
canPin: x,
|
|
25
|
+
canSort: i,
|
|
27
26
|
isSorted: g,
|
|
28
|
-
toggleableColumns:
|
|
29
|
-
visibleColumnsCount:
|
|
30
|
-
isLastVisibleColumn:
|
|
31
|
-
handleManageColumnsClick:
|
|
32
|
-
} =
|
|
33
|
-
return !
|
|
27
|
+
toggleableColumns: f,
|
|
28
|
+
visibleColumnsCount: j,
|
|
29
|
+
isLastVisibleColumn: M,
|
|
30
|
+
handleManageColumnsClick: h
|
|
31
|
+
} = D(o, l);
|
|
32
|
+
return !i && !x ? /* @__PURE__ */ e.jsxs("div", { className: m("flex items-center gap-2", a), children: [
|
|
34
33
|
n && /* @__PURE__ */ e.jsx(
|
|
35
|
-
|
|
34
|
+
b,
|
|
36
35
|
{
|
|
37
36
|
name: "Info",
|
|
38
37
|
size: "sm",
|
|
@@ -40,45 +39,43 @@ function w({
|
|
|
40
39
|
tooltip: n
|
|
41
40
|
}
|
|
42
41
|
),
|
|
43
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
42
|
+
/* @__PURE__ */ e.jsx("span", { children: s })
|
|
44
43
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
45
|
-
/* @__PURE__ */ e.jsx("div", { className:
|
|
44
|
+
/* @__PURE__ */ e.jsx("div", { className: m("flex items-center gap-2", a), children: /* @__PURE__ */ e.jsxs(I, { open: t, onOpenChange: p, children: [
|
|
46
45
|
/* @__PURE__ */ e.jsx(
|
|
47
|
-
|
|
46
|
+
H,
|
|
48
47
|
{
|
|
49
|
-
title:
|
|
48
|
+
title: s,
|
|
50
49
|
info: n,
|
|
51
|
-
isPinned:
|
|
52
|
-
canSort:
|
|
50
|
+
isPinned: c,
|
|
51
|
+
canSort: i,
|
|
53
52
|
sortDirection: g,
|
|
54
|
-
isHovered:
|
|
55
|
-
isMenuOpen:
|
|
56
|
-
onMouseEnter: () =>
|
|
57
|
-
onMouseLeave: () =>
|
|
53
|
+
isHovered: u,
|
|
54
|
+
isMenuOpen: t,
|
|
55
|
+
onMouseEnter: () => r(!0),
|
|
56
|
+
onMouseLeave: () => r(!1)
|
|
58
57
|
}
|
|
59
58
|
),
|
|
60
59
|
/* @__PURE__ */ e.jsx(
|
|
61
|
-
|
|
60
|
+
O,
|
|
62
61
|
{
|
|
63
62
|
column: o,
|
|
64
|
-
isLastVisibleColumn:
|
|
65
|
-
onManageColumnsClick:
|
|
66
|
-
translations: l
|
|
63
|
+
isLastVisibleColumn: M,
|
|
64
|
+
onManageColumnsClick: h
|
|
67
65
|
}
|
|
68
66
|
)
|
|
69
67
|
] }) }),
|
|
70
68
|
/* @__PURE__ */ e.jsx(
|
|
71
69
|
v,
|
|
72
70
|
{
|
|
73
|
-
isOpen:
|
|
71
|
+
isOpen: d,
|
|
74
72
|
onOpenChange: C,
|
|
75
|
-
toggleableColumns:
|
|
76
|
-
visibleColumnsCount:
|
|
77
|
-
translations: l
|
|
73
|
+
toggleableColumns: f,
|
|
74
|
+
visibleColumnsCount: j
|
|
78
75
|
}
|
|
79
76
|
)
|
|
80
77
|
] });
|
|
81
78
|
}
|
|
82
79
|
export {
|
|
83
|
-
|
|
80
|
+
z as DataTableColumnHeader
|
|
84
81
|
};
|
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
import { j as a } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import "react";
|
|
2
3
|
import { TableHeader as r, TableRow as m } from "../../../../vendor/shadcn/table.js";
|
|
3
4
|
import { DataTableHeaderCell as o } from "./cells/data-table-header-cell.js";
|
|
4
5
|
import { DataTableDraggableHeaderCell as d } from "./cells/data-table-draggable-header-cell.js";
|
|
5
|
-
function
|
|
6
|
-
table:
|
|
7
|
-
enableColumnResizing:
|
|
8
|
-
enableColumnDragDrop:
|
|
6
|
+
function b({
|
|
7
|
+
table: l,
|
|
8
|
+
enableColumnResizing: i,
|
|
9
|
+
enableColumnDragDrop: t = !1
|
|
9
10
|
}) {
|
|
10
|
-
return
|
|
11
|
+
return t ? /* @__PURE__ */ a.jsx(r, { children: l.getHeaderGroups().map((s) => /* @__PURE__ */ a.jsx(m, { className: "bg-muted", children: s.headers.map((e, n) => e.column.id === "select" || e.column.id === "actions" || e.column.id === "_spacer" ? /* @__PURE__ */ a.jsx(
|
|
11
12
|
o,
|
|
12
13
|
{
|
|
13
14
|
header: e,
|
|
14
|
-
enableColumnResizing:
|
|
15
|
+
enableColumnResizing: i ?? !1
|
|
15
16
|
},
|
|
16
17
|
e.id
|
|
17
18
|
) : /* @__PURE__ */ a.jsx(
|
|
18
19
|
d,
|
|
19
20
|
{
|
|
20
21
|
header: e,
|
|
21
|
-
index:
|
|
22
|
-
enableColumnResizing:
|
|
22
|
+
index: n,
|
|
23
|
+
enableColumnResizing: i ?? !1
|
|
23
24
|
},
|
|
24
25
|
e.id
|
|
25
|
-
)) }, s.id)) }) : /* @__PURE__ */ a.jsx(r, { children:
|
|
26
|
+
)) }, s.id)) }) : /* @__PURE__ */ a.jsx(r, { children: l.getHeaderGroups().map((s) => /* @__PURE__ */ a.jsx(m, { className: "bg-muted", children: s.headers.map((e) => /* @__PURE__ */ a.jsx(
|
|
26
27
|
o,
|
|
27
28
|
{
|
|
28
29
|
header: e,
|
|
29
|
-
enableColumnResizing:
|
|
30
|
+
enableColumnResizing: i ?? !1
|
|
30
31
|
},
|
|
31
32
|
e.id
|
|
32
33
|
)) }, s.id)) });
|
|
33
34
|
}
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
+
b as DataTableHeader
|
|
36
37
|
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { Column } from '@tanstack/react-table';
|
|
2
|
-
import { DataTableTranslations } from '../../data-table.types';
|
|
3
2
|
interface DataTableManageColumnsDialogProps<TData> {
|
|
4
3
|
isOpen: boolean;
|
|
5
4
|
onOpenChange: (open: boolean) => void;
|
|
6
5
|
toggleableColumns: Column<TData, unknown>[];
|
|
7
6
|
visibleColumnsCount: number;
|
|
8
|
-
translations: Required<DataTableTranslations>;
|
|
9
7
|
}
|
|
10
|
-
export declare function DataTableManageColumnsDialog<TData>({ isOpen, onOpenChange, toggleableColumns, visibleColumnsCount,
|
|
8
|
+
export declare function DataTableManageColumnsDialog<TData>({ isOpen, onOpenChange, toggleableColumns, visibleColumnsCount, }: DataTableManageColumnsDialogProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
11
9
|
export {};
|