@ztwoint/z-ui 0.1.88 → 0.1.90
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/stepper/stepper.types.d.ts +1 -1
- package/dist/components/stepper-item/stepper-item.d.ts +1 -1
- package/dist/components/stepper-item/stepper-item.js +19 -18
- package/dist/components/table/table.js +18 -18
- package/dist/components/table-filter/selected-filters-display/index.d.ts +1 -0
- package/dist/components/table-filter/selected-filters-display/selected-filters-display.js +29 -24
- package/dist/components/table-filter/selected-filters-display/selected-filters-display.type.d.ts +3 -4
- package/dist/components/table-filter/selected-filters-display/selected-filters-display.utils.d.ts +5 -2
- package/dist/components/table-filter/selected-filters-display/selected-filters-display.utils.js +17 -9
- package/dist/components/table-filter/table-filter-button.js +93 -87
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/types/components/stepper/stepper.types.d.ts +1 -1
- package/dist/types/components/stepper-item/stepper-item.d.ts +1 -1
- package/dist/types/components/table-filter/selected-filters-display/index.d.ts +1 -0
- package/dist/types/components/table-filter/selected-filters-display/selected-filters-display.type.d.ts +3 -4
- package/dist/types/components/table-filter/selected-filters-display/selected-filters-display.utils.d.ts +5 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const z2StepperItemVariants: (props?: ({
|
|
4
|
-
state?: "disabled" | "active" | "completed" | null | undefined;
|
|
4
|
+
state?: "disabled" | "active" | "completed" | "completed-disabled" | null | undefined;
|
|
5
5
|
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
6
6
|
export interface Z2StepperItemProps extends React.HTMLAttributes<HTMLButtonElement>, VariantProps<typeof z2StepperItemVariants> {
|
|
7
7
|
label: string;
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { cn as
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as c, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as p from "react";
|
|
3
|
+
import { cva as u } from "class-variance-authority";
|
|
4
|
+
import { cn as a } from "../../lib/utils.js";
|
|
5
|
+
import d from "../assets/icons/circle-check-filled.js";
|
|
6
6
|
import o from "../assets/icons/media-record.js";
|
|
7
|
-
const
|
|
7
|
+
const f = u("w-fit flex items-center select-none gap-2", {
|
|
8
8
|
variants: {
|
|
9
9
|
state: {
|
|
10
10
|
active: "cursor-pointer",
|
|
11
11
|
completed: "opacity-100 cursor-pointer",
|
|
12
|
-
disabled: "cursor-not-allowed"
|
|
12
|
+
disabled: "cursor-not-allowed",
|
|
13
|
+
"completed-disabled": "cursor-not-allowed"
|
|
13
14
|
}
|
|
14
15
|
},
|
|
15
16
|
defaultVariants: {
|
|
16
17
|
state: "active"
|
|
17
18
|
}
|
|
18
|
-
}), h = "rounded-full transition-colors w-4 h-4 border-none", b =
|
|
19
|
-
({ label:
|
|
20
|
-
let
|
|
21
|
-
return e === "completed" ? (
|
|
19
|
+
}), h = "rounded-full transition-colors w-4 h-4 border-none", b = p.forwardRef(
|
|
20
|
+
({ label: t, state: e = "active", className: n, ...s }, m) => {
|
|
21
|
+
let l, r;
|
|
22
|
+
return e === "completed" ? (l = /* @__PURE__ */ i(d, { fill: "var(--blue-500)", width: 16, height: 16 }), r = "text-neutral-primary leading-none-medium-sm") : e === "completed-disabled" ? (l = /* @__PURE__ */ i(d, { fill: "var(--neutral-500)", width: 16, height: 16 }), r = "text-neutral-secondary leading-none-medium-sm") : e === "active" ? (l = /* @__PURE__ */ i(o, { fill: "var(--blue-500)", width: 16, height: 16 }), r = "text-neutral-primary leading-none-medium-sm") : (l = /* @__PURE__ */ i(o, { fill: "var(--neutral-500)", width: 16, height: 16 }), r = "text-neutral-secondary leading-none-medium-sm"), /* @__PURE__ */ c(
|
|
22
23
|
"button",
|
|
23
24
|
{
|
|
24
|
-
ref:
|
|
25
|
-
className:
|
|
26
|
-
"aria-disabled": e === "disabled",
|
|
25
|
+
ref: m,
|
|
26
|
+
className: a(f({ state: e }), n),
|
|
27
|
+
"aria-disabled": e === "disabled" || e === "completed-disabled",
|
|
27
28
|
title: e || "disabled",
|
|
28
|
-
disabled: e === "disabled",
|
|
29
|
-
"aria-label":
|
|
29
|
+
disabled: e === "disabled" || e === "completed-disabled",
|
|
30
|
+
"aria-label": t,
|
|
30
31
|
...s,
|
|
31
32
|
children: [
|
|
32
|
-
/* @__PURE__ */ i("span", { className: h, children:
|
|
33
|
-
/* @__PURE__ */ i("span", { className:
|
|
33
|
+
/* @__PURE__ */ i("span", { className: h, children: l }),
|
|
34
|
+
/* @__PURE__ */ i("span", { className: a(r), children: t })
|
|
34
35
|
]
|
|
35
36
|
}
|
|
36
37
|
);
|
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import * as S from "react";
|
|
3
|
-
import { DEFAULT_EMPTY_MESSAGE as T, TABLE_CSS_CLASSES as
|
|
4
|
-
import { TableHeader as
|
|
5
|
-
import { TableRow as
|
|
3
|
+
import { DEFAULT_EMPTY_MESSAGE as T, TABLE_CSS_CLASSES as l } from "./table.const.js";
|
|
4
|
+
import { TableHeader as w } from "./components/table-header/table-header.js";
|
|
5
|
+
import { TableRow as N } from "./components/table-row.js";
|
|
6
6
|
import { TableMessageState as i } from "./components/table-message-state.js";
|
|
7
|
-
import { TableContext as
|
|
7
|
+
import { TableContext as v } from "./table.context.js";
|
|
8
8
|
import { cn as d } from "../../lib/utils.js";
|
|
9
9
|
const j = ({
|
|
10
|
-
cell:
|
|
10
|
+
cell: o = { hasBorder: !0 },
|
|
11
11
|
sort: c,
|
|
12
12
|
className: f,
|
|
13
13
|
stickyHeader: p = !1,
|
|
14
|
-
dataSourceError:
|
|
15
|
-
...
|
|
14
|
+
dataSourceError: s,
|
|
15
|
+
...h
|
|
16
16
|
}) => {
|
|
17
|
-
const
|
|
17
|
+
const u = S.useContext(v), {
|
|
18
18
|
dataSource: t = [],
|
|
19
19
|
schema: a = [],
|
|
20
20
|
loading: r = !1,
|
|
21
21
|
emptyMessage: b = T,
|
|
22
22
|
customCells: g
|
|
23
|
-
} =
|
|
23
|
+
} = u || h, x = () => s ? /* @__PURE__ */ e(
|
|
24
24
|
i,
|
|
25
25
|
{
|
|
26
26
|
colSpan: a.length,
|
|
27
|
-
message: typeof
|
|
28
|
-
className:
|
|
27
|
+
message: typeof s == "string" ? s : "Error loading data",
|
|
28
|
+
className: l.dataErrorState
|
|
29
29
|
}
|
|
30
30
|
) : !t || t.length === 0 && !r ? /* @__PURE__ */ e(
|
|
31
31
|
i,
|
|
32
32
|
{
|
|
33
33
|
colSpan: a.length,
|
|
34
34
|
message: b,
|
|
35
|
-
className:
|
|
35
|
+
className: l.emptyState
|
|
36
36
|
}
|
|
37
37
|
) : /* @__PURE__ */ e("tbody", { children: t.map((y, m) => /* @__PURE__ */ e(
|
|
38
|
-
|
|
38
|
+
N,
|
|
39
39
|
{
|
|
40
40
|
record: y,
|
|
41
41
|
index: m,
|
|
42
42
|
schema: a,
|
|
43
43
|
customCells: g,
|
|
44
|
-
cell:
|
|
44
|
+
cell: o
|
|
45
45
|
},
|
|
46
46
|
m
|
|
47
47
|
)) });
|
|
@@ -49,14 +49,14 @@ const j = ({
|
|
|
49
49
|
"div",
|
|
50
50
|
{
|
|
51
51
|
className: d(
|
|
52
|
-
r ? "overflow-y-hidden relative" : "overflow-y-auto",
|
|
53
|
-
|
|
52
|
+
r ? "overflow-y-hidden relative" : "overflow-y-auto will-change-transform",
|
|
53
|
+
l.bordered[o.hasBorder && !r && t.length > 0 ? "true" : "false"],
|
|
54
54
|
f
|
|
55
55
|
),
|
|
56
56
|
children: [
|
|
57
|
-
/* @__PURE__ */ n("table", { className: d(
|
|
57
|
+
/* @__PURE__ */ n("table", { className: d(l.table, "w-full"), children: [
|
|
58
58
|
x(),
|
|
59
|
-
/* @__PURE__ */ e(
|
|
59
|
+
/* @__PURE__ */ e(w, { schema: a, sort: c, cell: o, stickyHeader: p })
|
|
60
60
|
] }),
|
|
61
61
|
r && /* @__PURE__ */ e("div", { className: "absolute top-0 inset-0 w-full h-full bg-white/80 flex items-center justify-center", children: /* @__PURE__ */ n("div", { className: "flex flex-col items-center gap-3", children: [
|
|
62
62
|
/* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-text-brand-secondary" }),
|
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import { jsxs as e, jsx as
|
|
2
|
-
import * as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
totalCount: l
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
] })
|
|
1
|
+
import { jsxs as e, jsx as a, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { getAppliedOptions as i } from "./selected-filters-display.utils.js";
|
|
4
|
+
const p = ({
|
|
5
|
+
totalCount: l,
|
|
6
|
+
tempFilters: r,
|
|
7
|
+
filterSchema: s
|
|
8
|
+
}) => {
|
|
9
|
+
const n = i(r, s);
|
|
10
|
+
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2.5 max-w-md", children: [
|
|
11
|
+
l > 0 && /* @__PURE__ */ e("span", { className: "text-text-neutral-primary leading-none-medium-sm", children: [
|
|
12
|
+
l.toLocaleString(),
|
|
13
|
+
" total"
|
|
14
|
+
] }),
|
|
15
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2.5 max-w-md", children: n.map((t, m) => /* @__PURE__ */ e(d.Fragment, { children: [
|
|
16
|
+
/* @__PURE__ */ a("div", { className: "inline-flex items-center text-text-neutral-secondary rounded-md leading-none-regular-sm", children: /* @__PURE__ */ e("span", { className: "text-text-neutral-muted", children: [
|
|
17
|
+
t.name,
|
|
18
|
+
" ",
|
|
19
|
+
t.total !== void 0 && /* @__PURE__ */ e(c, { children: [
|
|
20
|
+
"[",
|
|
21
|
+
/* @__PURE__ */ a("span", { className: "text-text-neutral-secondary", children: t.total.toLocaleString() }),
|
|
22
|
+
"]"
|
|
23
|
+
] })
|
|
24
|
+
] }) }),
|
|
25
|
+
m < n.length - 1 && /* @__PURE__ */ a("span", { className: "text-text-neutral-muted", children: "•" })
|
|
26
|
+
] }, t.name)) })
|
|
27
|
+
] });
|
|
28
|
+
};
|
|
24
29
|
export {
|
|
25
|
-
|
|
30
|
+
p as SelectedFiltersDisplay
|
|
26
31
|
};
|
package/dist/components/table-filter/selected-filters-display/selected-filters-display.type.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { FilterRule, FilterSchema } from '../table-filter.type';
|
|
1
2
|
export interface SelectedFilterDisplayProps {
|
|
2
|
-
selectedItems: {
|
|
3
|
-
name: string;
|
|
4
|
-
total: number;
|
|
5
|
-
}[];
|
|
6
3
|
totalCount: number;
|
|
4
|
+
tempFilters: FilterRule[];
|
|
5
|
+
filterSchema: FilterSchema;
|
|
7
6
|
}
|
|
8
7
|
export interface FilterDisplayItem {
|
|
9
8
|
field: string;
|
package/dist/components/table-filter/selected-filters-display/selected-filters-display.utils.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import { FilterRule, FilterOption } from '../table-filter.type';
|
|
2
|
-
export declare const
|
|
1
|
+
import { FilterRule, FilterSchema, FilterOption } from '../table-filter.type';
|
|
2
|
+
export declare const getAppliedOptions: (tempFilters: FilterRule[], filterSchema: FilterSchema) => {
|
|
3
|
+
name: string;
|
|
4
|
+
total: number;
|
|
5
|
+
}[];
|
|
3
6
|
export declare const getFilterCount: (filterRule: FilterRule, filterOptions?: FilterOption[]) => number | undefined;
|
package/dist/components/table-filter/selected-filters-display/selected-filters-display.utils.js
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const u = (e, n) => e.map(({ field: r, value: t }) => {
|
|
2
|
+
var o;
|
|
3
|
+
const a = (o = n.find(({ filterKey: s }) => s === r)) == null ? void 0 : o.options;
|
|
4
|
+
return !a || !Array.isArray(t) ? [] : t.map((s) => ({
|
|
5
|
+
name: s,
|
|
6
|
+
total: a[s]
|
|
7
|
+
}));
|
|
8
|
+
}).flat(), l = (e, n) => {
|
|
9
|
+
if (!n || n.length === 0) return e.value !== "" ? 1 : 0;
|
|
3
10
|
if (Array.isArray(e.value)) {
|
|
4
|
-
const
|
|
5
|
-
(
|
|
6
|
-
).reduce((
|
|
7
|
-
return
|
|
11
|
+
const t = n.filter(
|
|
12
|
+
(a) => e.value.includes(a.value)
|
|
13
|
+
).reduce((a, o) => a + (o.total || 0), 0);
|
|
14
|
+
return t > 0 ? t : void 0;
|
|
8
15
|
} else {
|
|
9
|
-
const
|
|
10
|
-
return
|
|
16
|
+
const r = n.find((t) => t.value === e.value);
|
|
17
|
+
return r == null ? void 0 : r.total;
|
|
11
18
|
}
|
|
12
19
|
};
|
|
13
20
|
export {
|
|
14
|
-
|
|
21
|
+
u as getAppliedOptions,
|
|
22
|
+
l as getFilterCount
|
|
15
23
|
};
|
|
@@ -1,98 +1,97 @@
|
|
|
1
1
|
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as b from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as p from "@radix-ui/react-popover";
|
|
4
4
|
import { Button as y } from "../button/button.js";
|
|
5
|
-
import { useTableFilterContext as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { SelectedFiltersDisplay as
|
|
12
|
-
import { FilterConfirmationDialog as
|
|
13
|
-
import { hasUnsavedFilterChanges as
|
|
14
|
-
const
|
|
15
|
-
var k, A
|
|
16
|
-
const [
|
|
17
|
-
selectedColumn:
|
|
18
|
-
setSelectedColumn:
|
|
19
|
-
getFilterForColumn:
|
|
20
|
-
hasFilterForColumn:
|
|
21
|
-
updateColumnFilter:
|
|
22
|
-
clearAllFilters:
|
|
23
|
-
resetToAppliedFilters:
|
|
24
|
-
applyFilters:
|
|
25
|
-
hasActiveFilters:
|
|
26
|
-
tempFilters:
|
|
27
|
-
filterSchema:
|
|
28
|
-
filter:
|
|
29
|
-
filterComponents:
|
|
30
|
-
} =
|
|
31
|
-
!e && C ?
|
|
32
|
-
},
|
|
33
|
-
|
|
5
|
+
import { useTableFilterContext as q } from "./table-filter.context.js";
|
|
6
|
+
import E from "./filters/text.js";
|
|
7
|
+
import G from "./filters/boolean.js";
|
|
8
|
+
import J from "./filters/number/number.js";
|
|
9
|
+
import M from "./filters/checkbox.js";
|
|
10
|
+
import Q from "../assets/icons/circle-check-filled.js";
|
|
11
|
+
import { SelectedFiltersDisplay as W } from "./selected-filters-display/selected-filters-display.js";
|
|
12
|
+
import { FilterConfirmationDialog as X } from "./close-filter-confirm/filter-confirmation-dialog.js";
|
|
13
|
+
import { hasUnsavedFilterChanges as S } from "./close-filter-confirm/filter-confirmation-dialog.utils.js";
|
|
14
|
+
const ie = () => {
|
|
15
|
+
var k, A;
|
|
16
|
+
const [K, i] = b.useState(!1), c = b.useRef(null), [C, d] = b.useState(!1), {
|
|
17
|
+
selectedColumn: o,
|
|
18
|
+
setSelectedColumn: O,
|
|
19
|
+
getFilterForColumn: P,
|
|
20
|
+
hasFilterForColumn: D,
|
|
21
|
+
updateColumnFilter: R,
|
|
22
|
+
clearAllFilters: T,
|
|
23
|
+
resetToAppliedFilters: $,
|
|
24
|
+
applyFilters: z,
|
|
25
|
+
hasActiveFilters: h,
|
|
26
|
+
tempFilters: u,
|
|
27
|
+
filterSchema: m,
|
|
28
|
+
filter: f,
|
|
29
|
+
filterComponents: g = {}
|
|
30
|
+
} = q(), B = (e) => {
|
|
31
|
+
!e && C ? S(u, f.value) ? i(!0) : d(!1) : d(e);
|
|
32
|
+
}, N = () => {
|
|
33
|
+
z(), i(!1), d(!1);
|
|
34
|
+
}, L = () => {
|
|
35
|
+
$(), i(!1), d(!1);
|
|
34
36
|
}, I = () => {
|
|
35
|
-
|
|
36
|
-
}, V = () => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}, S = (e == null ? void 0 : e.type) && (h == null ? void 0 : h[e.type]) || r[(e == null ? void 0 : e.type) ?? "string"];
|
|
46
|
-
if (!S)
|
|
37
|
+
i(!1);
|
|
38
|
+
}, F = S(u, f.value), l = P(o || ""), V = () => {
|
|
39
|
+
if (!o) return null;
|
|
40
|
+
const e = m.find((a) => a.filterKey === o), r = {
|
|
41
|
+
boolean: G,
|
|
42
|
+
string: E,
|
|
43
|
+
number: J,
|
|
44
|
+
checkbox: M
|
|
45
|
+
}, j = (e == null ? void 0 : e.type) && (g == null ? void 0 : g[e.type]) || r[(e == null ? void 0 : e.type) ?? "string"];
|
|
46
|
+
if (!j)
|
|
47
47
|
return console.warn(
|
|
48
48
|
`No filter component found for column "${e == null ? void 0 : e.filterKey}" with type "${e == null ? void 0 : e.type}". Provide a custom filter component or use supported types: "string", "number", "boolean", "checkbox".`
|
|
49
49
|
), null;
|
|
50
|
-
const
|
|
50
|
+
const U = {
|
|
51
51
|
condition: (l == null ? void 0 : l.condition) || "",
|
|
52
52
|
value: (l == null ? void 0 : l.value) || ""
|
|
53
53
|
};
|
|
54
54
|
return /* @__PURE__ */ t("div", { className: "flex-1 h-full", children: /* @__PURE__ */ t("div", { className: "mb-4 h-full", children: /* @__PURE__ */ t(
|
|
55
|
-
|
|
55
|
+
j,
|
|
56
56
|
{
|
|
57
|
-
value:
|
|
58
|
-
onChange: ({ condition:
|
|
59
|
-
filterOptions: e != null && e.options ? Object.entries(e.options).map(([
|
|
60
|
-
label:
|
|
61
|
-
value:
|
|
62
|
-
total:
|
|
57
|
+
value: U,
|
|
58
|
+
onChange: ({ condition: a, value: v }) => R(o, a, v),
|
|
59
|
+
filterOptions: e != null && e.options ? Object.entries(e.options).map(([a, v]) => ({
|
|
60
|
+
label: a,
|
|
61
|
+
value: a,
|
|
62
|
+
total: v
|
|
63
63
|
})) : void 0
|
|
64
64
|
},
|
|
65
|
-
|
|
65
|
+
o
|
|
66
66
|
) }) });
|
|
67
|
-
},
|
|
68
|
-
l && (Array.isArray(l.value) && l.value.length > 0 || (l == null ? void 0 : l.value) !== "") && (
|
|
69
|
-
const
|
|
67
|
+
}, H = f.loading || !1;
|
|
68
|
+
l && (Array.isArray(l.value) && l.value.length > 0 || (l == null ? void 0 : l.value) !== "") && (c.current = l);
|
|
69
|
+
const x = m.find(
|
|
70
70
|
(e) => {
|
|
71
71
|
var r;
|
|
72
|
-
return e.filterKey == ((r =
|
|
72
|
+
return e.filterKey == ((r = c.current) == null ? void 0 : r.field);
|
|
73
73
|
}
|
|
74
|
-
),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
/* @__PURE__ */ t(f.Trigger, { asChild: !0, children: /* @__PURE__ */ s(
|
|
74
|
+
), w = Array.isArray((k = c.current) == null ? void 0 : k.value) ? (A = c.current) == null ? void 0 : A.value.map(
|
|
75
|
+
(e) => {
|
|
76
|
+
var r;
|
|
77
|
+
return ((r = x == null ? void 0 : x.options) == null ? void 0 : r[e]) || 0;
|
|
78
|
+
}
|
|
79
|
+
) : [1], n = w.reduce((e, r) => e + r, 0);
|
|
80
|
+
return /* @__PURE__ */ s(p.Root, { open: C, onOpenChange: B, children: [
|
|
81
|
+
/* @__PURE__ */ t(p.Trigger, { asChild: !0, children: /* @__PURE__ */ s(
|
|
83
82
|
y,
|
|
84
83
|
{
|
|
85
|
-
variant:
|
|
86
|
-
shade:
|
|
84
|
+
variant: h ? "filled" : "stroke",
|
|
85
|
+
shade: h ? "brand" : "neutral",
|
|
87
86
|
size: "small",
|
|
88
87
|
children: [
|
|
89
88
|
"Filters ",
|
|
90
|
-
|
|
89
|
+
h && `(${f.value.length})`
|
|
91
90
|
]
|
|
92
91
|
}
|
|
93
92
|
) }),
|
|
94
|
-
/* @__PURE__ */ t(
|
|
95
|
-
|
|
93
|
+
/* @__PURE__ */ t(p.Portal, { children: /* @__PURE__ */ s(
|
|
94
|
+
p.Content,
|
|
96
95
|
{
|
|
97
96
|
className: "w-[512px] bg-surface-neutral-default border border-stroke-solid-light rounded-2xl overflow-hidden shadow-lg",
|
|
98
97
|
sideOffset: 8,
|
|
@@ -101,41 +100,48 @@ const ce = () => {
|
|
|
101
100
|
/* @__PURE__ */ s("div", { className: "flex h-[422px]", style: { maxHeight: "calc(100vh - 8rem)" }, children: [
|
|
102
101
|
/* @__PURE__ */ s("div", { className: "w-48 border-r border-stroke-solid-light p-2 flex flex-col gap-1.5 overflow-y-auto", children: [
|
|
103
102
|
/* @__PURE__ */ t("div", { className: "p-2 pb-1", children: /* @__PURE__ */ t("h3", { className: "leading-none-medium-sm text-text-neutral-secondary", children: "Filters" }) }),
|
|
104
|
-
|
|
103
|
+
m.map((e) => /* @__PURE__ */ s(
|
|
105
104
|
"button",
|
|
106
105
|
{
|
|
107
|
-
onClick: () =>
|
|
108
|
-
className: `w-full text-left p-2 text-sm flex items-center justify-between hover:bg-surface-neutral-
|
|
106
|
+
onClick: () => O(e.filterKey),
|
|
107
|
+
className: `w-full text-left p-2 text-sm flex items-center justify-between hover:bg-surface-neutral-hover transition-colors rounded-lg ${o === e.filterKey ? "bg-surface-neutral-focused text-text-brand-primary" : "text-text-neutral-primary"}`,
|
|
109
108
|
children: [
|
|
110
109
|
/* @__PURE__ */ t("span", { className: "truncate", children: e.title }),
|
|
111
|
-
|
|
110
|
+
D(e.filterKey) && /* @__PURE__ */ t(Q, { className: "w-4 h-4 text-text-brand-secondary flex-shrink-0 ml-2" })
|
|
112
111
|
]
|
|
113
112
|
},
|
|
114
113
|
e.filterKey
|
|
115
114
|
))
|
|
116
115
|
] }),
|
|
117
116
|
/* @__PURE__ */ s("div", { className: "flex-1 flex flex-col relative", children: [
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
o ? V() : /* @__PURE__ */ t("div", { className: "flex-1 flex items-center justify-center text-text-neutral-muted", children: "Select a column to configure its filter" }),
|
|
118
|
+
H && /* @__PURE__ */ t("div", { className: "flex items-center justify-center p-8 absolute top-0 left-0 right-0 bottom-0 bg-background-neutral-default/80", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-3", children: [
|
|
120
119
|
/* @__PURE__ */ t("div", { className: "w-8 h-8 border-2 border-stroke-solid-medium border-t-transparent rounded-full animate-spin" }),
|
|
121
120
|
/* @__PURE__ */ t("span", { className: "text-text-body-primary text-sm", children: "Loading options..." })
|
|
122
121
|
] }) })
|
|
123
122
|
] })
|
|
124
123
|
] }),
|
|
125
|
-
(!!
|
|
126
|
-
|
|
124
|
+
(!!n || F) && /* @__PURE__ */ s("div", { className: "flex justify-between items-end p-4 border-t border-stroke-solid-medium min-h-[73px]", children: [
|
|
125
|
+
w.length > 0 ? /* @__PURE__ */ t(
|
|
126
|
+
W,
|
|
127
|
+
{
|
|
128
|
+
tempFilters: u,
|
|
129
|
+
filterSchema: m,
|
|
130
|
+
totalCount: n
|
|
131
|
+
}
|
|
132
|
+
) : /* @__PURE__ */ t("div", { className: "w-full" }),
|
|
127
133
|
/* @__PURE__ */ s("div", { className: "flex justify-end gap-2", children: [
|
|
128
|
-
!!
|
|
134
|
+
!!n && /* @__PURE__ */ t(y, { onClick: T, variant: "stroke", shade: "neutral", size: "small", children: "Clear All" }),
|
|
129
135
|
/* @__PURE__ */ t(
|
|
130
136
|
y,
|
|
131
137
|
{
|
|
132
|
-
onClick:
|
|
138
|
+
onClick: N,
|
|
133
139
|
variant: "filled",
|
|
134
140
|
shade: "neutral",
|
|
135
141
|
size: "small",
|
|
136
142
|
className: "min-w-20",
|
|
137
|
-
disabled: !
|
|
138
|
-
children: `Apply ${
|
|
143
|
+
disabled: !F,
|
|
144
|
+
children: `Apply ${n ? n.toLocaleString() : ""}`
|
|
139
145
|
}
|
|
140
146
|
)
|
|
141
147
|
] })
|
|
@@ -143,16 +149,16 @@ const ce = () => {
|
|
|
143
149
|
]
|
|
144
150
|
}
|
|
145
151
|
) }),
|
|
146
|
-
|
|
147
|
-
|
|
152
|
+
K && /* @__PURE__ */ t(
|
|
153
|
+
X,
|
|
148
154
|
{
|
|
149
|
-
onClose:
|
|
150
|
-
onRevertChanges:
|
|
151
|
-
onApplyChanges:
|
|
155
|
+
onClose: I,
|
|
156
|
+
onRevertChanges: L,
|
|
157
|
+
onApplyChanges: N
|
|
152
158
|
}
|
|
153
159
|
)
|
|
154
160
|
] });
|
|
155
161
|
};
|
|
156
162
|
export {
|
|
157
|
-
|
|
163
|
+
ie as TableFilterButton
|
|
158
164
|
};
|