@konstructio/ui 0.1.2-alpha.71 → 0.1.2-alpha.73
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/Button/Button.variants.js +8 -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 +32 -4
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +124 -88
- 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,34 @@ 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
|
+
/** Icon rendered before the label */
|
|
97
|
+
leftIcon?: ReactNode;
|
|
98
|
+
/** Icon rendered after the label */
|
|
99
|
+
rightIcon?: ReactNode;
|
|
100
|
+
} & Omit<ButtonProps, 'children' | 'type'>;
|
|
101
|
+
/**
|
|
102
|
+
* Configuration for a time filter with optional presets and a TimePicker.
|
|
103
|
+
*/
|
|
104
|
+
export type TimeFilterConfig = FilterConfigBase & {
|
|
105
|
+
type: 'time';
|
|
106
|
+
/** Time format: '12' for AM/PM or '24' for military time (default: '12') */
|
|
107
|
+
format?: '12' | '24';
|
|
108
|
+
/** Preset time options for quick selection */
|
|
109
|
+
presets?: TimePreset[];
|
|
110
|
+
/** Whether to show the TimePicker for custom time selection (default: true) */
|
|
111
|
+
showTimePicker?: boolean;
|
|
112
|
+
};
|
|
87
113
|
/**
|
|
88
114
|
* Union of all supported filter configurations.
|
|
89
115
|
*/
|
|
90
|
-
export type FilterConfig = BadgeMultiSelectFilterConfig | TextMultiSelectFilterConfig | DateFilterConfig | DateRangeFilterConfig;
|
|
116
|
+
export type FilterConfig = BadgeMultiSelectFilterConfig | TextMultiSelectFilterConfig | DateFilterConfig | DateRangeFilterConfig | ActionFilterConfig | TimeFilterConfig;
|
|
91
117
|
/**
|
|
92
118
|
* @deprecated Use FilterConfig instead
|
|
93
119
|
*/
|
|
@@ -157,7 +183,8 @@ export type Props<TData extends RowDataPrimitive> = VariantProps<typeof virtuali
|
|
|
157
183
|
filters?: FilterConfig[];
|
|
158
184
|
showFilter: true;
|
|
159
185
|
showFilterInput?: boolean;
|
|
160
|
-
|
|
186
|
+
/** @deprecated Use `ActionFilterConfig` items in `filters` instead */
|
|
187
|
+
filterActions?: ActionFilterConfig[];
|
|
161
188
|
showResetButton?: boolean;
|
|
162
189
|
resetButtonClassName?: string;
|
|
163
190
|
} | {
|
|
@@ -167,7 +194,8 @@ export type Props<TData extends RowDataPrimitive> = VariantProps<typeof virtuali
|
|
|
167
194
|
filters?: never;
|
|
168
195
|
showFilter?: false | undefined;
|
|
169
196
|
showFilterInput?: never;
|
|
170
|
-
|
|
197
|
+
/** @deprecated Use `ActionFilterConfig` items in `filters` instead */
|
|
198
|
+
filterActions?: ActionFilterConfig[];
|
|
171
199
|
showResetButton?: never;
|
|
172
200
|
resetButtonClassName?: never;
|
|
173
201
|
}) & ({
|
|
@@ -1,80 +1,113 @@
|
|
|
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:
|
|
11
|
-
filters:
|
|
12
|
-
multiSelectFilter:
|
|
13
|
-
placeholder:
|
|
14
|
-
showFilterInput:
|
|
15
|
-
showResetButton:
|
|
16
|
-
resetButtonClassName:
|
|
1
|
+
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { d as E } from "../../../../debounce-DJveWHr_.js";
|
|
3
|
+
import { useRef as G, useMemo as p, useCallback as w } from "react";
|
|
4
|
+
import { Button as H } from "../../../Button/Button.js";
|
|
5
|
+
import { Filter as s } from "../../../Filter/Filter.js";
|
|
6
|
+
import { Input as J } from "../../../Input/Input.js";
|
|
7
|
+
import { cn as K } from "../../../../utils/index.js";
|
|
8
|
+
import { useTableContext as L } from "../../contexts/table.hook.js";
|
|
9
|
+
const ee = ({
|
|
10
|
+
actions: u,
|
|
11
|
+
filters: d,
|
|
12
|
+
multiSelectFilter: i,
|
|
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 = G(null), {
|
|
19
|
+
termOfSearch: h,
|
|
20
|
+
multiselectSelected: y,
|
|
21
|
+
dateFilters: F,
|
|
22
|
+
dateRangeFilters: b,
|
|
23
|
+
timeFilters: D,
|
|
24
|
+
onChangeTermOfSearch: c,
|
|
25
|
+
onSelectMultiselect: R,
|
|
25
26
|
onSelectDateFilter: j,
|
|
26
|
-
onSelectDateRangeFilter: O
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
onSelectDateRangeFilter: O,
|
|
28
|
+
onSelectTimeFilter: A
|
|
29
|
+
} = L(), B = p(() => {
|
|
30
|
+
const e = d ?? i?.map((o) => ({
|
|
31
|
+
...o,
|
|
30
32
|
type: "badgeMultiSelect"
|
|
31
|
-
})) ?? [],
|
|
32
|
-
[
|
|
33
|
-
),
|
|
34
|
-
(e, t) =>
|
|
33
|
+
})) ?? [], t = u ?? [];
|
|
34
|
+
return [...e, ...t];
|
|
35
|
+
}, [d, i, u]), S = w(
|
|
36
|
+
(e, t) => R(
|
|
35
37
|
e,
|
|
36
|
-
t.map((
|
|
38
|
+
t.map((o) => o.id)
|
|
37
39
|
),
|
|
38
|
-
[
|
|
39
|
-
),
|
|
40
|
-
|
|
41
|
-
}, [
|
|
42
|
-
() =>
|
|
43
|
-
|
|
40
|
+
[R]
|
|
41
|
+
), k = w(() => {
|
|
42
|
+
c(""), l.current && (l.current.value = "");
|
|
43
|
+
}, [c]), P = p(
|
|
44
|
+
() => E((e) => {
|
|
45
|
+
c(e.target.value);
|
|
44
46
|
}, 500),
|
|
45
|
-
[
|
|
46
|
-
),
|
|
47
|
-
() => !!
|
|
48
|
-
[
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
[c]
|
|
48
|
+
), I = p(
|
|
49
|
+
() => !!h || Object.values(y ?? {}).flat().length > 0 || Object.values(F ?? {}).some(Boolean) || Object.values(b ?? {}).some(Boolean) || Object.values(D ?? {}).some(Boolean),
|
|
50
|
+
[
|
|
51
|
+
h,
|
|
52
|
+
y,
|
|
53
|
+
F,
|
|
54
|
+
b,
|
|
55
|
+
D
|
|
56
|
+
]
|
|
57
|
+
), N = (e) => {
|
|
58
|
+
if (e.type === "action") {
|
|
59
|
+
const {
|
|
60
|
+
label: a,
|
|
61
|
+
appearance: g = "compact",
|
|
62
|
+
variant: _ = "secondary",
|
|
63
|
+
leftIcon: $,
|
|
64
|
+
rightIcon: q,
|
|
65
|
+
type: Q,
|
|
66
|
+
...z
|
|
67
|
+
} = e;
|
|
68
|
+
return /* @__PURE__ */ m(
|
|
69
|
+
H,
|
|
70
|
+
{
|
|
71
|
+
appearance: g,
|
|
72
|
+
variant: _,
|
|
73
|
+
...z,
|
|
74
|
+
children: [
|
|
75
|
+
$,
|
|
76
|
+
a,
|
|
77
|
+
q
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
a
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
const { key: t, label: o, position: r = "right" } = e;
|
|
51
84
|
return e.type === "textMultiSelect" ? /* @__PURE__ */ n(
|
|
52
|
-
|
|
85
|
+
s.TextMultiSelect,
|
|
53
86
|
{
|
|
54
|
-
label:
|
|
55
|
-
position:
|
|
87
|
+
label: o,
|
|
88
|
+
position: r,
|
|
56
89
|
options: e.options,
|
|
57
|
-
onApply: (
|
|
58
|
-
|
|
90
|
+
onApply: (a) => {
|
|
91
|
+
S(t, a);
|
|
59
92
|
}
|
|
60
93
|
},
|
|
61
94
|
t
|
|
62
95
|
) : e.type === "date" ? /* @__PURE__ */ n(
|
|
63
|
-
|
|
96
|
+
s.DateFilterDropdown,
|
|
64
97
|
{
|
|
65
|
-
label:
|
|
66
|
-
position:
|
|
98
|
+
label: o,
|
|
99
|
+
position: r,
|
|
67
100
|
countryCode: e.countryCode,
|
|
68
|
-
onApply: (
|
|
69
|
-
j(t,
|
|
101
|
+
onApply: (a) => {
|
|
102
|
+
j(t, a);
|
|
70
103
|
}
|
|
71
104
|
},
|
|
72
105
|
t
|
|
73
106
|
) : e.type === "dateRange" ? /* @__PURE__ */ n(
|
|
74
|
-
|
|
107
|
+
s.DateRangeFilterDropdown,
|
|
75
108
|
{
|
|
76
|
-
label:
|
|
77
|
-
position:
|
|
109
|
+
label: o,
|
|
110
|
+
position: r,
|
|
78
111
|
showTime: e.showTime,
|
|
79
112
|
timeFormat: e.timeFormat,
|
|
80
113
|
showPresets: e.showPresets,
|
|
@@ -82,61 +115,64 @@ const U = ({
|
|
|
82
115
|
minDate: e.minDate,
|
|
83
116
|
maxDate: e.maxDate,
|
|
84
117
|
countryCode: e.countryCode,
|
|
85
|
-
onApply: (
|
|
86
|
-
O(t,
|
|
118
|
+
onApply: (a) => {
|
|
119
|
+
O(t, a);
|
|
87
120
|
},
|
|
88
121
|
onRangeChange: e.onRangeChange
|
|
89
122
|
},
|
|
90
123
|
t
|
|
124
|
+
) : e.type === "time" ? /* @__PURE__ */ n(
|
|
125
|
+
s.TimeFilterDropdown,
|
|
126
|
+
{
|
|
127
|
+
label: o,
|
|
128
|
+
position: r,
|
|
129
|
+
format: e.format,
|
|
130
|
+
presets: e.presets,
|
|
131
|
+
showTimePicker: e.showTimePicker,
|
|
132
|
+
onApply: (a) => {
|
|
133
|
+
A(t, a);
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
t
|
|
91
137
|
) : /* @__PURE__ */ n(
|
|
92
|
-
|
|
138
|
+
s.BadgeMultiSelect,
|
|
93
139
|
{
|
|
94
|
-
label:
|
|
95
|
-
position:
|
|
140
|
+
label: o,
|
|
141
|
+
position: r,
|
|
96
142
|
options: e.options,
|
|
97
|
-
onApply: (
|
|
98
|
-
|
|
143
|
+
onApply: (a) => {
|
|
144
|
+
S(t, a);
|
|
99
145
|
}
|
|
100
146
|
},
|
|
101
147
|
t
|
|
102
148
|
);
|
|
103
149
|
};
|
|
104
|
-
return /* @__PURE__ */
|
|
105
|
-
|
|
106
|
-
|
|
150
|
+
return /* @__PURE__ */ m("div", { className: "w-full flex items-center justify-end pb-6", children: [
|
|
151
|
+
v && /* @__PURE__ */ n(
|
|
152
|
+
J,
|
|
107
153
|
{
|
|
108
|
-
ref:
|
|
109
|
-
placeholder:
|
|
154
|
+
ref: l,
|
|
155
|
+
placeholder: T,
|
|
110
156
|
isSearch: !0,
|
|
111
157
|
autoComplete: "false",
|
|
112
158
|
className: "w-72",
|
|
113
159
|
inputMode: "search",
|
|
114
|
-
onChange:
|
|
160
|
+
onChange: P
|
|
115
161
|
}
|
|
116
162
|
),
|
|
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,
|
|
163
|
+
/* @__PURE__ */ m(s, { children: [
|
|
164
|
+
B.map(N),
|
|
165
|
+
x && /* @__PURE__ */ n(
|
|
166
|
+
s.ResetButton,
|
|
131
167
|
{
|
|
132
|
-
className:
|
|
133
|
-
disabled: !
|
|
134
|
-
onClick:
|
|
168
|
+
className: K("select-none", M),
|
|
169
|
+
disabled: !I,
|
|
170
|
+
onClick: k
|
|
135
171
|
}
|
|
136
172
|
)
|
|
137
173
|
] })
|
|
138
174
|
] });
|
|
139
175
|
};
|
|
140
176
|
export {
|
|
141
|
-
|
|
177
|
+
ee as Filter
|
|
142
178
|
};
|
|
@@ -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
|
},
|