@konstructio/ui 0.1.2-alpha.71 → 0.1.2-alpha.72
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/{Modal-BGcucTHv.js → Modal-CXRo8f-h.js} +1 -1
- package/dist/assets/icons/components/CheckCircleFilled.d.ts +3 -0
- package/dist/assets/icons/components/CheckCircleFilled.js +31 -0
- package/dist/assets/icons/components/CheckCircleOutline.d.ts +3 -0
- package/dist/assets/icons/components/{CheckCircle.js → CheckCircleOutline.js} +8 -8
- package/dist/assets/icons/components/CheckboxMarkedCircleOutline.d.ts +3 -0
- package/dist/assets/icons/components/CheckboxMarkedCircleOutline.js +26 -0
- package/dist/assets/icons/components/InfoCircle.d.ts +3 -0
- package/dist/assets/icons/components/InfoCircle.js +31 -0
- package/dist/assets/icons/components/WarningTriangle.d.ts +3 -0
- package/dist/assets/icons/components/WarningTriangle.js +28 -0
- package/dist/assets/icons/components/index.d.ts +5 -1
- package/dist/assets/icons/components/index.js +124 -116
- package/dist/assets/icons/index.js +124 -116
- package/dist/components/Alert/Alert.d.ts +5 -16
- package/dist/components/Alert/Alert.js +46 -32
- package/dist/components/Alert/Alert.types.d.ts +8 -8
- package/dist/components/Alert/Alert.variants.d.ts +11 -2
- package/dist/components/Alert/Alert.variants.js +77 -32
- package/dist/components/Badge/Badge.variants.d.ts +2 -2
- package/dist/components/Button/Button.variants.d.ts +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/hooks/useDateTimeInputs.d.ts +1 -1
- package/dist/components/Filter/Filter.d.ts +2 -2
- package/dist/components/Filter/Filter.js +14 -11
- package/dist/components/Filter/Filter.types.d.ts +2 -1
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.d.ts +3 -0
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.d.ts +14 -0
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +74 -0
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +155 -0
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.types.d.ts +13 -0
- package/dist/components/Filter/components/index.d.ts +2 -0
- package/dist/components/Filter/components/index.js +10 -8
- package/dist/components/LineChart/LineChart.d.ts +17 -0
- package/dist/components/LineChart/LineChart.js +154 -0
- package/dist/components/LineChart/LineChart.types.d.ts +54 -0
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/PieChart/PieChart.js +51 -5095
- package/dist/components/ProgressBar/ProgressBar.variants.d.ts +1 -1
- package/dist/components/RadioCardGroup/RadioCardGroup.variants.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.variants.d.ts +1 -1
- package/dist/components/Tabs/Tabs.variants.d.ts +1 -1
- package/dist/components/Toast/Toast.variants.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +4 -9
- package/dist/components/Tooltip/Tooltip.js +35 -33
- package/dist/components/Tooltip/Tooltip.types.d.ts +22 -11
- package/dist/components/Typography/Typography.variants.d.ts +1 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.types.d.ts +28 -4
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +121 -91
- package/dist/components/VirtualizedTable/components/Filter/Filter.types.d.ts +5 -8
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.context.d.ts +2 -0
- package/dist/components/VirtualizedTable/contexts/table.context.js +3 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +179 -168
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +117 -113
- package/dist/icons.d.ts +1 -1
- package/dist/icons.js +124 -116
- package/dist/{index-DPcwqB8q.js → index-B7-5g1Sm.js} +169 -168
- package/dist/index-qDQP8rW4.js +7281 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +144 -139
- package/dist/package.json +8 -8
- package/dist/{proxy-CngVm5qA.js → proxy-0sbyKj-k.js} +732 -728
- package/dist/styles.css +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +16 -15
- package/package.json +8 -8
- package/dist/assets/icons/components/CheckCircle.d.ts +0 -3
- package/dist/components/Tooltip/Tooltip.variants.d.ts +0 -6
- package/dist/components/Tooltip/Tooltip.variants.js +0 -86
- package/dist/components/Tooltip/hooks/useTooltip.d.ts +0 -4
- package/dist/components/Tooltip/hooks/useTooltip.js +0 -24
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const progressBarTrackVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
2
2
|
export declare const progressBarFillVariants: (props?: ({
|
|
3
|
-
status?: "
|
|
3
|
+
status?: "success" | "warning" | "error" | "default" | null | undefined;
|
|
4
4
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -5,7 +5,7 @@ export declare const contentVariants: (props?: ({
|
|
|
5
5
|
variant?: "default" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export declare const listVariants: (props?: ({
|
|
8
|
-
variant?: "
|
|
8
|
+
variant?: "horizontal" | "vertical" | "default" | null | undefined;
|
|
9
9
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
10
|
export declare const triggerVariants: (props?: ({
|
|
11
11
|
variant?: "default" | "active" | "inactive" | null | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const toastVariants: (props?: ({
|
|
2
|
-
variant?: "
|
|
2
|
+
variant?: "success" | "warning" | "error" | null | undefined;
|
|
3
3
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
4
4
|
export declare const viewportToastVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
5
5
|
export declare const closeToastVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
@@ -2,26 +2,21 @@ import { FC } from 'react';
|
|
|
2
2
|
import { TooltipProps } from './Tooltip.types';
|
|
3
3
|
/**
|
|
4
4
|
* A tooltip component that shows on hover.
|
|
5
|
-
*
|
|
5
|
+
* Built on Radix UI for accessible, well-positioned tooltips.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx
|
|
9
|
-
* // Basic tooltip
|
|
10
9
|
* <Tooltip content="Click to save">
|
|
11
10
|
* <Button>Save</Button>
|
|
12
11
|
* </Tooltip>
|
|
13
12
|
*
|
|
14
|
-
*
|
|
15
|
-
* <Tooltip content="More information" position="bottom">
|
|
13
|
+
* <Tooltip content="More information" side="bottom">
|
|
16
14
|
* <InfoIcon />
|
|
17
15
|
* </Tooltip>
|
|
18
16
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* <span>Hover me</span>
|
|
17
|
+
* <Tooltip content="Danger!" bgClassName="bg-red-500">
|
|
18
|
+
* <Button variant="danger">Delete</Button>
|
|
22
19
|
* </Tooltip>
|
|
23
20
|
* ```
|
|
24
|
-
*
|
|
25
|
-
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-tooltip--docs Storybook}
|
|
26
21
|
*/
|
|
27
22
|
export declare const Tooltip: FC<TooltipProps>;
|
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { P as p, R as c, T as h, C as x, A as f } from "../../index-B7-5g1Sm.js";
|
|
3
|
+
import { cn as g } from "../../utils/index.js";
|
|
4
|
+
const j = ({
|
|
5
|
+
content: s,
|
|
6
|
+
children: t,
|
|
7
|
+
side: o = "top",
|
|
8
|
+
sideOffset: a = 4,
|
|
9
|
+
bgClassName: i = "bg-slate-700",
|
|
10
|
+
arrowClassName: n = "fill-slate-700",
|
|
11
|
+
textClassName: l = "text-white",
|
|
12
|
+
className: d,
|
|
13
|
+
delayDuration: m = 0
|
|
14
|
+
}) => /* @__PURE__ */ e(p, { delayDuration: m, children: /* @__PURE__ */ r(c, { children: [
|
|
15
|
+
/* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e("span", { children: t }) }),
|
|
16
|
+
/* @__PURE__ */ r(
|
|
17
|
+
x,
|
|
18
|
+
{
|
|
19
|
+
side: o,
|
|
20
|
+
sideOffset: a,
|
|
21
|
+
className: g(
|
|
22
|
+
"rounded px-2 py-1 text-xs shadow-md",
|
|
23
|
+
"animate-in fade-in-0",
|
|
24
|
+
i,
|
|
25
|
+
l,
|
|
26
|
+
d
|
|
27
|
+
),
|
|
28
|
+
children: [
|
|
29
|
+
s,
|
|
30
|
+
/* @__PURE__ */ e(f, { className: n })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
] }) });
|
|
33
35
|
export {
|
|
34
|
-
|
|
36
|
+
j as Tooltip
|
|
35
37
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PropsWithChildren, ReactNode } from 'react';
|
|
3
|
-
import { Theme } from '../../domain/theme';
|
|
4
|
-
import { tooltipVariants } from './Tooltip.variants';
|
|
1
|
+
import { ReactNode } from 'react';
|
|
5
2
|
/**
|
|
6
3
|
* Props for the Tooltip component.
|
|
7
4
|
*
|
|
@@ -11,18 +8,32 @@ import { tooltipVariants } from './Tooltip.variants';
|
|
|
11
8
|
* <Button>Edit</Button>
|
|
12
9
|
* </Tooltip>
|
|
13
10
|
*
|
|
14
|
-
* <Tooltip content="More info here"
|
|
11
|
+
* <Tooltip content="More info here" side="bottom">
|
|
15
12
|
* <InfoIcon />
|
|
16
13
|
* </Tooltip>
|
|
14
|
+
*
|
|
15
|
+
* <Tooltip content="Danger!" bgClassName="bg-red-500">
|
|
16
|
+
* <Button variant="danger">Delete</Button>
|
|
17
|
+
* </Tooltip>
|
|
17
18
|
* ```
|
|
18
19
|
*/
|
|
19
|
-
export interface TooltipProps
|
|
20
|
+
export interface TooltipProps {
|
|
20
21
|
/** Tooltip text or content */
|
|
21
22
|
content: ReactNode | string;
|
|
22
|
-
/**
|
|
23
|
+
/** The trigger element */
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
/** Tooltip position relative to trigger */
|
|
26
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
27
|
+
/** Distance from trigger in px */
|
|
28
|
+
sideOffset?: number;
|
|
29
|
+
/** Background color class for tooltip (e.g. 'bg-slate-700', 'bg-red-500') */
|
|
30
|
+
bgClassName?: string;
|
|
31
|
+
/** Arrow fill color class (e.g. 'fill-slate-700', 'fill-red-500'). Should match bgClassName */
|
|
32
|
+
arrowClassName?: string;
|
|
33
|
+
/** Text color class (e.g. 'text-white') */
|
|
34
|
+
textClassName?: string;
|
|
35
|
+
/** Additional className for tooltip content */
|
|
23
36
|
className?: string;
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
/** Theme override for this component */
|
|
27
|
-
theme?: Theme;
|
|
37
|
+
/** Delay before showing tooltip in ms */
|
|
38
|
+
delayDuration?: number;
|
|
28
39
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const typographyVariants: (props?: ({
|
|
2
|
-
variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "
|
|
2
|
+
variant?: "tooltip" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "subtitle3" | "labelLarge" | "labelMedium" | "labelSmall" | "buttonSmall" | "body1" | "body2" | "body3" | null | undefined;
|
|
3
3
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ColumnDef as ColumnDefPrimitive, ExpandedState, OnChangeFn, RowData as RowDataPrimitive } from '@tanstack/react-table';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
+
import { ButtonProps } from '../Button/Button.types';
|
|
4
5
|
import { DateRange, DateRangeWithTime } from '../DateRangePicker/DateRangePicker.types';
|
|
6
|
+
import { TimePreset } from '../Filter/components/TimeFilterDropdown/TimeFilterDropdown.types';
|
|
5
7
|
import { virtualizeTableVariants } from './VirtualizedTable.variants';
|
|
6
|
-
import {
|
|
8
|
+
import { Option } from './components/Filter/Filter.types';
|
|
7
9
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
8
10
|
/** Base row data type from TanStack Table */
|
|
9
11
|
export type RowData = RowDataPrimitive;
|
|
@@ -84,10 +86,30 @@ export type DateRangeFilterConfig = FilterConfigBase & {
|
|
|
84
86
|
/** Callback when the date range changes */
|
|
85
87
|
onRangeChange?: (range: DateRangeWithTime) => void;
|
|
86
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* Configuration for an action button rendered inline with filters.
|
|
91
|
+
*/
|
|
92
|
+
export type ActionFilterConfig = {
|
|
93
|
+
type: 'action';
|
|
94
|
+
/** Text displayed inside the button. Also used as the React key. */
|
|
95
|
+
label: string;
|
|
96
|
+
} & Omit<ButtonProps, 'children' | 'type'>;
|
|
97
|
+
/**
|
|
98
|
+
* Configuration for a time filter with optional presets and a TimePicker.
|
|
99
|
+
*/
|
|
100
|
+
export type TimeFilterConfig = FilterConfigBase & {
|
|
101
|
+
type: 'time';
|
|
102
|
+
/** Time format: '12' for AM/PM or '24' for military time (default: '12') */
|
|
103
|
+
format?: '12' | '24';
|
|
104
|
+
/** Preset time options for quick selection */
|
|
105
|
+
presets?: TimePreset[];
|
|
106
|
+
/** Whether to show the TimePicker for custom time selection (default: true) */
|
|
107
|
+
showTimePicker?: boolean;
|
|
108
|
+
};
|
|
87
109
|
/**
|
|
88
110
|
* Union of all supported filter configurations.
|
|
89
111
|
*/
|
|
90
|
-
export type FilterConfig = BadgeMultiSelectFilterConfig | TextMultiSelectFilterConfig | DateFilterConfig | DateRangeFilterConfig;
|
|
112
|
+
export type FilterConfig = BadgeMultiSelectFilterConfig | TextMultiSelectFilterConfig | DateFilterConfig | DateRangeFilterConfig | ActionFilterConfig | TimeFilterConfig;
|
|
91
113
|
/**
|
|
92
114
|
* @deprecated Use FilterConfig instead
|
|
93
115
|
*/
|
|
@@ -157,7 +179,8 @@ export type Props<TData extends RowDataPrimitive> = VariantProps<typeof virtuali
|
|
|
157
179
|
filters?: FilterConfig[];
|
|
158
180
|
showFilter: true;
|
|
159
181
|
showFilterInput?: boolean;
|
|
160
|
-
|
|
182
|
+
/** @deprecated Use `ActionFilterConfig` items in `filters` instead */
|
|
183
|
+
filterActions?: ActionFilterConfig[];
|
|
161
184
|
showResetButton?: boolean;
|
|
162
185
|
resetButtonClassName?: string;
|
|
163
186
|
} | {
|
|
@@ -167,7 +190,8 @@ export type Props<TData extends RowDataPrimitive> = VariantProps<typeof virtuali
|
|
|
167
190
|
filters?: never;
|
|
168
191
|
showFilter?: false | undefined;
|
|
169
192
|
showFilterInput?: never;
|
|
170
|
-
|
|
193
|
+
/** @deprecated Use `ActionFilterConfig` items in `filters` instead */
|
|
194
|
+
filterActions?: ActionFilterConfig[];
|
|
171
195
|
showResetButton?: never;
|
|
172
196
|
resetButtonClassName?: never;
|
|
173
197
|
}) & ({
|
|
@@ -1,80 +1,107 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { d as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Filter as
|
|
6
|
-
import { Input as
|
|
7
|
-
import { cn as
|
|
8
|
-
import { useTableContext as
|
|
9
|
-
const
|
|
10
|
-
actions:
|
|
1
|
+
import { jsxs as S, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { d as q } from "../../../../debounce-DJveWHr_.js";
|
|
3
|
+
import { useRef as z, useMemo as m, useCallback as w } from "react";
|
|
4
|
+
import { Button as E } from "../../../Button/Button.js";
|
|
5
|
+
import { Filter as n } from "../../../Filter/Filter.js";
|
|
6
|
+
import { Input as G } from "../../../Input/Input.js";
|
|
7
|
+
import { cn as H } from "../../../../utils/index.js";
|
|
8
|
+
import { useTableContext as J } from "../../contexts/table.hook.js";
|
|
9
|
+
const C = ({
|
|
10
|
+
actions: p,
|
|
11
11
|
filters: u,
|
|
12
|
-
multiSelectFilter:
|
|
13
|
-
placeholder:
|
|
14
|
-
showFilterInput:
|
|
15
|
-
showResetButton:
|
|
16
|
-
resetButtonClassName:
|
|
12
|
+
multiSelectFilter: d,
|
|
13
|
+
placeholder: T,
|
|
14
|
+
showFilterInput: v = !0,
|
|
15
|
+
showResetButton: x = !0,
|
|
16
|
+
resetButtonClassName: M
|
|
17
17
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
termOfSearch:
|
|
20
|
-
multiselectSelected:
|
|
21
|
-
dateFilters:
|
|
22
|
-
dateRangeFilters:
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
const l = z(null), {
|
|
19
|
+
termOfSearch: i,
|
|
20
|
+
multiselectSelected: h,
|
|
21
|
+
dateFilters: y,
|
|
22
|
+
dateRangeFilters: F,
|
|
23
|
+
timeFilters: b,
|
|
24
|
+
onChangeTermOfSearch: c,
|
|
25
|
+
onSelectMultiselect: D,
|
|
25
26
|
onSelectDateFilter: j,
|
|
26
|
-
onSelectDateRangeFilter: O
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
onSelectDateRangeFilter: O,
|
|
28
|
+
onSelectTimeFilter: A
|
|
29
|
+
} = J(), B = m(() => {
|
|
30
|
+
const e = u ?? d?.map((o) => ({
|
|
31
|
+
...o,
|
|
30
32
|
type: "badgeMultiSelect"
|
|
31
|
-
})) ?? [],
|
|
32
|
-
[
|
|
33
|
-
), R =
|
|
34
|
-
(e, t) =>
|
|
33
|
+
})) ?? [], t = p ?? [];
|
|
34
|
+
return [...e, ...t];
|
|
35
|
+
}, [u, d, p]), R = w(
|
|
36
|
+
(e, t) => D(
|
|
35
37
|
e,
|
|
36
|
-
t.map((
|
|
38
|
+
t.map((o) => o.id)
|
|
37
39
|
),
|
|
38
|
-
[
|
|
39
|
-
),
|
|
40
|
-
|
|
41
|
-
}, [
|
|
42
|
-
() =>
|
|
43
|
-
|
|
40
|
+
[D]
|
|
41
|
+
), k = w(() => {
|
|
42
|
+
c(""), l.current && (l.current.value = "");
|
|
43
|
+
}, [c]), P = m(
|
|
44
|
+
() => q((e) => {
|
|
45
|
+
c(e.target.value);
|
|
44
46
|
}, 500),
|
|
45
|
-
[
|
|
46
|
-
),
|
|
47
|
-
() => !!
|
|
48
|
-
[
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
[c]
|
|
48
|
+
), N = m(
|
|
49
|
+
() => !!i || Object.values(h ?? {}).flat().length > 0 || Object.values(y ?? {}).some(Boolean) || Object.values(F ?? {}).some(Boolean) || Object.values(b ?? {}).some(Boolean),
|
|
50
|
+
[
|
|
51
|
+
i,
|
|
52
|
+
h,
|
|
53
|
+
y,
|
|
54
|
+
F,
|
|
55
|
+
b
|
|
56
|
+
]
|
|
57
|
+
), I = (e) => {
|
|
58
|
+
if (e.type === "action") {
|
|
59
|
+
const {
|
|
54
60
|
label: a,
|
|
55
|
-
|
|
61
|
+
appearance: _ = "compact",
|
|
62
|
+
variant: $ = "secondary",
|
|
63
|
+
type: K,
|
|
64
|
+
...g
|
|
65
|
+
} = e;
|
|
66
|
+
return /* @__PURE__ */ s(
|
|
67
|
+
E,
|
|
68
|
+
{
|
|
69
|
+
appearance: _,
|
|
70
|
+
variant: $,
|
|
71
|
+
...g,
|
|
72
|
+
children: a
|
|
73
|
+
},
|
|
74
|
+
a
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
const { key: t, label: o, position: r = "right" } = e;
|
|
78
|
+
return e.type === "textMultiSelect" ? /* @__PURE__ */ s(
|
|
79
|
+
n.TextMultiSelect,
|
|
80
|
+
{
|
|
81
|
+
label: o,
|
|
82
|
+
position: r,
|
|
56
83
|
options: e.options,
|
|
57
|
-
onApply: (
|
|
58
|
-
R(t,
|
|
84
|
+
onApply: (a) => {
|
|
85
|
+
R(t, a);
|
|
59
86
|
}
|
|
60
87
|
},
|
|
61
88
|
t
|
|
62
|
-
) : e.type === "date" ? /* @__PURE__ */
|
|
63
|
-
|
|
89
|
+
) : e.type === "date" ? /* @__PURE__ */ s(
|
|
90
|
+
n.DateFilterDropdown,
|
|
64
91
|
{
|
|
65
|
-
label:
|
|
66
|
-
position:
|
|
92
|
+
label: o,
|
|
93
|
+
position: r,
|
|
67
94
|
countryCode: e.countryCode,
|
|
68
|
-
onApply: (
|
|
69
|
-
j(t,
|
|
95
|
+
onApply: (a) => {
|
|
96
|
+
j(t, a);
|
|
70
97
|
}
|
|
71
98
|
},
|
|
72
99
|
t
|
|
73
|
-
) : e.type === "dateRange" ? /* @__PURE__ */
|
|
74
|
-
|
|
100
|
+
) : e.type === "dateRange" ? /* @__PURE__ */ s(
|
|
101
|
+
n.DateRangeFilterDropdown,
|
|
75
102
|
{
|
|
76
|
-
label:
|
|
77
|
-
position:
|
|
103
|
+
label: o,
|
|
104
|
+
position: r,
|
|
78
105
|
showTime: e.showTime,
|
|
79
106
|
timeFormat: e.timeFormat,
|
|
80
107
|
showPresets: e.showPresets,
|
|
@@ -82,61 +109,64 @@ const U = ({
|
|
|
82
109
|
minDate: e.minDate,
|
|
83
110
|
maxDate: e.maxDate,
|
|
84
111
|
countryCode: e.countryCode,
|
|
85
|
-
onApply: (
|
|
86
|
-
O(t,
|
|
112
|
+
onApply: (a) => {
|
|
113
|
+
O(t, a);
|
|
87
114
|
},
|
|
88
115
|
onRangeChange: e.onRangeChange
|
|
89
116
|
},
|
|
90
117
|
t
|
|
91
|
-
) : /* @__PURE__ */
|
|
92
|
-
|
|
118
|
+
) : e.type === "time" ? /* @__PURE__ */ s(
|
|
119
|
+
n.TimeFilterDropdown,
|
|
93
120
|
{
|
|
94
|
-
label:
|
|
95
|
-
position:
|
|
121
|
+
label: o,
|
|
122
|
+
position: r,
|
|
123
|
+
format: e.format,
|
|
124
|
+
presets: e.presets,
|
|
125
|
+
showTimePicker: e.showTimePicker,
|
|
126
|
+
onApply: (a) => {
|
|
127
|
+
A(t, a);
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
t
|
|
131
|
+
) : /* @__PURE__ */ s(
|
|
132
|
+
n.BadgeMultiSelect,
|
|
133
|
+
{
|
|
134
|
+
label: o,
|
|
135
|
+
position: r,
|
|
96
136
|
options: e.options,
|
|
97
|
-
onApply: (
|
|
98
|
-
R(t,
|
|
137
|
+
onApply: (a) => {
|
|
138
|
+
R(t, a);
|
|
99
139
|
}
|
|
100
140
|
},
|
|
101
141
|
t
|
|
102
142
|
);
|
|
103
143
|
};
|
|
104
|
-
return /* @__PURE__ */
|
|
105
|
-
|
|
106
|
-
|
|
144
|
+
return /* @__PURE__ */ S("div", { className: "w-full flex items-center justify-end pb-6", children: [
|
|
145
|
+
v && /* @__PURE__ */ s(
|
|
146
|
+
G,
|
|
107
147
|
{
|
|
108
|
-
ref:
|
|
109
|
-
placeholder:
|
|
148
|
+
ref: l,
|
|
149
|
+
placeholder: T,
|
|
110
150
|
isSearch: !0,
|
|
111
151
|
autoComplete: "false",
|
|
112
152
|
className: "w-72",
|
|
113
153
|
inputMode: "search",
|
|
114
|
-
onChange:
|
|
154
|
+
onChange: P
|
|
115
155
|
}
|
|
116
156
|
),
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
{
|
|
122
|
-
variant: a,
|
|
123
|
-
appearance: "compact",
|
|
124
|
-
onClick: t,
|
|
125
|
-
children: e
|
|
126
|
-
},
|
|
127
|
-
e
|
|
128
|
-
)),
|
|
129
|
-
M && /* @__PURE__ */ n(
|
|
130
|
-
r.ResetButton,
|
|
157
|
+
/* @__PURE__ */ S(n, { children: [
|
|
158
|
+
B.map(I),
|
|
159
|
+
x && /* @__PURE__ */ s(
|
|
160
|
+
n.ResetButton,
|
|
131
161
|
{
|
|
132
|
-
className:
|
|
133
|
-
disabled: !
|
|
134
|
-
onClick:
|
|
162
|
+
className: H("select-none", M),
|
|
163
|
+
disabled: !N,
|
|
164
|
+
onClick: k
|
|
135
165
|
}
|
|
136
166
|
)
|
|
137
167
|
] })
|
|
138
168
|
] });
|
|
139
169
|
};
|
|
140
170
|
export {
|
|
141
|
-
|
|
171
|
+
C as Filter
|
|
142
172
|
};
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FilterConfig, MultiSelectFilter } from '../../VirtualizedTable.types';
|
|
1
|
+
import { ActionFilterConfig, FilterConfig, MultiSelectFilter } from '../../VirtualizedTable.types';
|
|
3
2
|
export type { Option } from '../../../Filter/Filter.types';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
onClick: () => void;
|
|
7
|
-
variant?: ButtonProps['variant'];
|
|
8
|
-
};
|
|
3
|
+
/** @deprecated Use `ActionFilterConfig` with `type: 'action'` in the `filters` array instead */
|
|
4
|
+
export type FilterAction = ActionFilterConfig;
|
|
9
5
|
export type Props = {
|
|
10
|
-
actions?: FilterAction[];
|
|
11
6
|
filters?: FilterConfig[];
|
|
12
7
|
/** @deprecated Use `filters` instead */
|
|
13
8
|
multiSelectFilter?: MultiSelectFilter[];
|
|
9
|
+
/** @deprecated Use `ActionFilterConfig` items in `filters` instead */
|
|
10
|
+
actions?: FilterAction[];
|
|
14
11
|
placeholder: string;
|
|
15
12
|
showFilterInput?: boolean;
|
|
16
13
|
showResetButton?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
2
|
-
import { P as u, R as b, T as m, C as p } from "../../../../index-
|
|
2
|
+
import { P as u, R as b, T as m, C as p } from "../../../../index-B7-5g1Sm.js";
|
|
3
3
|
import { d as h } from "../../../../debounce-DJveWHr_.js";
|
|
4
4
|
import { useRef as x, useState as w, useCallback as g, useEffect as s } from "react";
|
|
5
5
|
const v = ({ getValue: l, value: i }) => {
|
|
@@ -16,6 +16,7 @@ export type ContextType<TData extends RowData = RowData> = {
|
|
|
16
16
|
from?: string;
|
|
17
17
|
to?: string;
|
|
18
18
|
} | undefined>;
|
|
19
|
+
timeFilters?: Record<string, string | undefined>;
|
|
19
20
|
totalPages: number;
|
|
20
21
|
isFirstLoad: boolean;
|
|
21
22
|
enableExpandedRow?: boolean;
|
|
@@ -38,5 +39,6 @@ export type ContextType<TData extends RowData = RowData> = {
|
|
|
38
39
|
from?: Date;
|
|
39
40
|
to?: Date;
|
|
40
41
|
}) => void;
|
|
42
|
+
onSelectTimeFilter: (key: string, time?: Date) => void;
|
|
41
43
|
};
|
|
42
44
|
export declare const TableContext: import('react').Context<ContextType<unknown>>;
|
|
@@ -26,6 +26,9 @@ const r = e({
|
|
|
26
26
|
onSelectDateRangeFilter() {
|
|
27
27
|
throw new Error("onSelectDateRangeFilter function is not implemented");
|
|
28
28
|
},
|
|
29
|
+
onSelectTimeFilter() {
|
|
30
|
+
throw new Error("onSelectTimeFilter function is not implemented");
|
|
31
|
+
},
|
|
29
32
|
handlePage() {
|
|
30
33
|
throw new Error("handlePage function is not implemented");
|
|
31
34
|
},
|