@trackunit/react-filter-components 1.13.22 → 1.13.26
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/index.cjs.js
CHANGED
|
@@ -96,8 +96,8 @@ const cvaFilterBody = cssClassVarianceUtilities.cvaMerge(["grid", "gap-1", "w-fu
|
|
|
96
96
|
* @param {FilterFooterProps} props - The props for the FilterFooter component
|
|
97
97
|
* @returns {ReactElement} FilterFooter component
|
|
98
98
|
*/
|
|
99
|
-
const FilterFooter = ({ className, "data-testid": dataTestId, children, ...rest }) => {
|
|
100
|
-
return (jsxRuntime.jsx("div", { className: cvaFilterFooter({ className }), "data-testid": dataTestId, ...rest, children: children }));
|
|
99
|
+
const FilterFooter = ({ className, "data-testid": dataTestId, children, ref, ...rest }) => {
|
|
100
|
+
return (jsxRuntime.jsx("div", { className: cvaFilterFooter({ className }), "data-testid": dataTestId, ref: ref, ...rest, children: children }));
|
|
101
101
|
};
|
|
102
102
|
const cvaFilterFooter = cssClassVarianceUtilities.cvaMerge(["flex", "justify-end", "border-t", "border-neutral-200", "p-1"]);
|
|
103
103
|
|
|
@@ -109,8 +109,8 @@ const cvaFilterFooter = cssClassVarianceUtilities.cvaMerge(["flex", "justify-end
|
|
|
109
109
|
* @param {FilterHeaderProps} props - The props for the FilterHeader component
|
|
110
110
|
* @returns {ReactElement} FilterHeader component
|
|
111
111
|
*/
|
|
112
|
-
const FilterHeader = ({ "data-testid": dataTestId, title, resetLabel, showReset, onReset, loading = false, children, searchComponent, className, ...rest }) => {
|
|
113
|
-
return (jsxRuntime.jsx("div", { className: tailwindMerge.twMerge(className, "min-w-[280px]"), ...rest, "data-testid": dataTestId, children: title ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "p-1", children: jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-between gap-1 text-sm font-medium uppercase text-neutral-600", children: [searchComponent, jsxRuntime.jsxs("div", { className: "flex w-full justify-between gap-1", children: [children, jsxRuntime.jsx("div", { className: "ml-auto", children: loading ? (jsxRuntime.jsx(reactComponents.Spinner, { size: "small" })) : (jsxRuntime.jsx(reactComponents.Button, { "data-testid": `${dataTestId}-reset-button`, disabled: !showReset, onClick: onReset, size: "small", variant: "ghost", children: resetLabel })) })] })] }) }), jsxRuntime.jsx("hr", { className: "w-full border-neutral-200" })] })) : null }));
|
|
112
|
+
const FilterHeader = ({ "data-testid": dataTestId, title, resetLabel, showReset, onReset, loading = false, children, searchComponent, className, ref, ...rest }) => {
|
|
113
|
+
return (jsxRuntime.jsx("div", { className: tailwindMerge.twMerge(className, "min-w-[280px]"), ...rest, "data-testid": dataTestId, ref: ref, children: title ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "p-1", children: jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-between gap-1 text-sm font-medium uppercase text-neutral-600", children: [searchComponent, jsxRuntime.jsxs("div", { className: "flex w-full justify-between gap-1", children: [children, jsxRuntime.jsx("div", { className: "ml-auto", children: loading ? (jsxRuntime.jsx(reactComponents.Spinner, { size: "small" })) : (jsxRuntime.jsx(reactComponents.Button, { "data-testid": `${dataTestId}-reset-button`, disabled: !showReset, onClick: onReset, size: "small", variant: "ghost", children: resetLabel })) })] })] }) }), jsxRuntime.jsx("hr", { className: "w-full border-neutral-200" })] })) : null }));
|
|
114
114
|
};
|
|
115
115
|
const cvaFilterHeaderButton = cssClassVarianceUtilities.cvaMerge([], {
|
|
116
116
|
variants: {
|
|
@@ -131,12 +131,12 @@ const cvaFilterHeaderButton = cssClassVarianceUtilities.cvaMerge([], {
|
|
|
131
131
|
* @param {CheckBoxFilterItemProps} props - The props for the FilterItem component
|
|
132
132
|
* @returns {ReactElement} FilterItem component
|
|
133
133
|
*/
|
|
134
|
-
const CheckBoxFilterItem = ({ itemCount, className, suffix, "data-testid": dataTestId, label, ...rest }) => {
|
|
134
|
+
const CheckBoxFilterItem = ({ itemCount, className, suffix, "data-testid": dataTestId, label, ref, ...rest }) => {
|
|
135
135
|
return (jsxRuntime.jsx(reactFormComponents.Checkbox, { className: reactComponents.cvaInteractableItem({
|
|
136
136
|
selection: "auto",
|
|
137
137
|
focus: "auto",
|
|
138
138
|
className: tailwindMerge.twMerge(["py-1", "mx-1", "pl-2", "pr-3", "w-auto", "h-auto", "items-center", "gap-x-2", "select-none", "rounded"], className),
|
|
139
|
-
}), "data-testid": dataTestId ?? `${label}-checkbox-filter-item`, label: label, suffix: itemCount !== undefined || suffix ? (jsxRuntime.jsxs("span", { className: reactComponents.cvaMenuItemSuffix({ selected: rest.checked }), children: [suffix, itemCount === undefined ? null : itemCount] })) : null, ...rest }));
|
|
139
|
+
}), "data-testid": dataTestId ?? `${label}-checkbox-filter-item`, label: label, ref: ref, suffix: itemCount !== undefined || suffix ? (jsxRuntime.jsxs("span", { className: reactComponents.cvaMenuItemSuffix({ selected: rest.checked }), children: [suffix, itemCount === undefined ? null : itemCount] })) : null, ...rest }));
|
|
140
140
|
};
|
|
141
141
|
|
|
142
142
|
/**
|
package/index.esm.js
CHANGED
|
@@ -94,8 +94,8 @@ const cvaFilterBody = cvaMerge(["grid", "gap-1", "w-full"], {
|
|
|
94
94
|
* @param {FilterFooterProps} props - The props for the FilterFooter component
|
|
95
95
|
* @returns {ReactElement} FilterFooter component
|
|
96
96
|
*/
|
|
97
|
-
const FilterFooter = ({ className, "data-testid": dataTestId, children, ...rest }) => {
|
|
98
|
-
return (jsx("div", { className: cvaFilterFooter({ className }), "data-testid": dataTestId, ...rest, children: children }));
|
|
97
|
+
const FilterFooter = ({ className, "data-testid": dataTestId, children, ref, ...rest }) => {
|
|
98
|
+
return (jsx("div", { className: cvaFilterFooter({ className }), "data-testid": dataTestId, ref: ref, ...rest, children: children }));
|
|
99
99
|
};
|
|
100
100
|
const cvaFilterFooter = cvaMerge(["flex", "justify-end", "border-t", "border-neutral-200", "p-1"]);
|
|
101
101
|
|
|
@@ -107,8 +107,8 @@ const cvaFilterFooter = cvaMerge(["flex", "justify-end", "border-t", "border-neu
|
|
|
107
107
|
* @param {FilterHeaderProps} props - The props for the FilterHeader component
|
|
108
108
|
* @returns {ReactElement} FilterHeader component
|
|
109
109
|
*/
|
|
110
|
-
const FilterHeader = ({ "data-testid": dataTestId, title, resetLabel, showReset, onReset, loading = false, children, searchComponent, className, ...rest }) => {
|
|
111
|
-
return (jsx("div", { className: twMerge(className, "min-w-[280px]"), ...rest, "data-testid": dataTestId, children: title ? (jsxs(Fragment, { children: [jsx("div", { className: "p-1", children: jsxs("div", { className: "flex flex-col items-center justify-between gap-1 text-sm font-medium uppercase text-neutral-600", children: [searchComponent, jsxs("div", { className: "flex w-full justify-between gap-1", children: [children, jsx("div", { className: "ml-auto", children: loading ? (jsx(Spinner, { size: "small" })) : (jsx(Button, { "data-testid": `${dataTestId}-reset-button`, disabled: !showReset, onClick: onReset, size: "small", variant: "ghost", children: resetLabel })) })] })] }) }), jsx("hr", { className: "w-full border-neutral-200" })] })) : null }));
|
|
110
|
+
const FilterHeader = ({ "data-testid": dataTestId, title, resetLabel, showReset, onReset, loading = false, children, searchComponent, className, ref, ...rest }) => {
|
|
111
|
+
return (jsx("div", { className: twMerge(className, "min-w-[280px]"), ...rest, "data-testid": dataTestId, ref: ref, children: title ? (jsxs(Fragment, { children: [jsx("div", { className: "p-1", children: jsxs("div", { className: "flex flex-col items-center justify-between gap-1 text-sm font-medium uppercase text-neutral-600", children: [searchComponent, jsxs("div", { className: "flex w-full justify-between gap-1", children: [children, jsx("div", { className: "ml-auto", children: loading ? (jsx(Spinner, { size: "small" })) : (jsx(Button, { "data-testid": `${dataTestId}-reset-button`, disabled: !showReset, onClick: onReset, size: "small", variant: "ghost", children: resetLabel })) })] })] }) }), jsx("hr", { className: "w-full border-neutral-200" })] })) : null }));
|
|
112
112
|
};
|
|
113
113
|
const cvaFilterHeaderButton = cvaMerge([], {
|
|
114
114
|
variants: {
|
|
@@ -129,12 +129,12 @@ const cvaFilterHeaderButton = cvaMerge([], {
|
|
|
129
129
|
* @param {CheckBoxFilterItemProps} props - The props for the FilterItem component
|
|
130
130
|
* @returns {ReactElement} FilterItem component
|
|
131
131
|
*/
|
|
132
|
-
const CheckBoxFilterItem = ({ itemCount, className, suffix, "data-testid": dataTestId, label, ...rest }) => {
|
|
132
|
+
const CheckBoxFilterItem = ({ itemCount, className, suffix, "data-testid": dataTestId, label, ref, ...rest }) => {
|
|
133
133
|
return (jsx(Checkbox, { className: cvaInteractableItem({
|
|
134
134
|
selection: "auto",
|
|
135
135
|
focus: "auto",
|
|
136
136
|
className: twMerge(["py-1", "mx-1", "pl-2", "pr-3", "w-auto", "h-auto", "items-center", "gap-x-2", "select-none", "rounded"], className),
|
|
137
|
-
}), "data-testid": dataTestId ?? `${label}-checkbox-filter-item`, label: label, suffix: itemCount !== undefined || suffix ? (jsxs("span", { className: cvaMenuItemSuffix({ selected: rest.checked }), children: [suffix, itemCount === undefined ? null : itemCount] })) : null, ...rest }));
|
|
137
|
+
}), "data-testid": dataTestId ?? `${label}-checkbox-filter-item`, label: label, ref: ref, suffix: itemCount !== undefined || suffix ? (jsxs("span", { className: cvaMenuItemSuffix({ selected: rest.checked }), children: [suffix, itemCount === undefined ? null : itemCount] })) : null, ...rest }));
|
|
138
138
|
};
|
|
139
139
|
|
|
140
140
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-filter-components",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.26",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react": "19.0.0",
|
|
11
11
|
"tailwind-merge": "^2.0.0",
|
|
12
|
-
"@trackunit/ui-icons": "1.11.
|
|
13
|
-
"@trackunit/css-class-variance-utilities": "1.11.
|
|
14
|
-
"@trackunit/react-components": "1.17.
|
|
15
|
-
"@trackunit/react-form-components": "1.14.
|
|
12
|
+
"@trackunit/ui-icons": "1.11.42",
|
|
13
|
+
"@trackunit/css-class-variance-utilities": "1.11.43",
|
|
14
|
+
"@trackunit/react-components": "1.17.21",
|
|
15
|
+
"@trackunit/react-form-components": "1.14.23"
|
|
16
16
|
},
|
|
17
17
|
"module": "./index.esm.js",
|
|
18
18
|
"main": "./index.cjs.js",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
export interface FilterFooterProps extends CommonProps {
|
|
3
|
+
export interface FilterFooterProps extends CommonProps, Refable<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* Items to render in the filter footer
|
|
6
6
|
*/
|
|
@@ -13,5 +13,5 @@ export interface FilterFooterProps extends CommonProps {
|
|
|
13
13
|
* @param {FilterFooterProps} props - The props for the FilterFooter component
|
|
14
14
|
* @returns {ReactElement} FilterFooter component
|
|
15
15
|
*/
|
|
16
|
-
export declare const FilterFooter: ({ className, "data-testid": dataTestId, children, ...rest }: FilterFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const FilterFooter: ({ className, "data-testid": dataTestId, children, ref, ...rest }: FilterFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
export declare const cvaFilterFooter: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { ReactElement, ReactNode } from "react";
|
|
3
|
-
export interface FilterHeaderProps extends CommonProps {
|
|
3
|
+
export interface FilterHeaderProps extends CommonProps, Refable<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* The title of the filter will be displayed in the header.
|
|
6
6
|
*/
|
|
@@ -36,7 +36,7 @@ export interface FilterHeaderProps extends CommonProps {
|
|
|
36
36
|
* @param {FilterHeaderProps} props - The props for the FilterHeader component
|
|
37
37
|
* @returns {ReactElement} FilterHeader component
|
|
38
38
|
*/
|
|
39
|
-
export declare const FilterHeader: ({ "data-testid": dataTestId, title, resetLabel, showReset, onReset, loading, children, searchComponent, className, ...rest }: FilterHeaderProps) => ReactElement;
|
|
39
|
+
export declare const FilterHeader: ({ "data-testid": dataTestId, title, resetLabel, showReset, onReset, loading, children, searchComponent, className, ref, ...rest }: FilterHeaderProps) => ReactElement;
|
|
40
40
|
export declare const cvaFilterHeaderButton: (props?: ({
|
|
41
41
|
isVisible?: boolean | null | undefined;
|
|
42
42
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
@@ -6,4 +6,4 @@ import { CheckBoxFilterItemProps } from "../types";
|
|
|
6
6
|
* @param {CheckBoxFilterItemProps} props - The props for the FilterItem component
|
|
7
7
|
* @returns {ReactElement} FilterItem component
|
|
8
8
|
*/
|
|
9
|
-
export declare const CheckBoxFilterItem: ({ itemCount, className, suffix, "data-testid": dataTestId, label, ...rest }: CheckBoxFilterItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const CheckBoxFilterItem: ({ itemCount, className, suffix, "data-testid": dataTestId, label, ref, ...rest }: CheckBoxFilterItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Refable } from "@trackunit/react-components";
|
|
1
2
|
import { CheckboxProps, RadioItemProps } from "@trackunit/react-form-components";
|
|
2
|
-
export type CheckBoxFilterItemProps = CheckboxProps & BaseFilterItemProps
|
|
3
|
+
export type CheckBoxFilterItemProps = CheckboxProps & BaseFilterItemProps & Refable<HTMLInputElement>;
|
|
3
4
|
export interface RadioFilterItemProps<TProps extends string | number = string> extends RadioItemProps<TProps>, BaseFilterItemProps {
|
|
4
5
|
/**
|
|
5
6
|
* An boolean flag to set checkbox to checked state
|