@trackunit/react-filter-components 1.17.4 → 1.17.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/index.cjs.js
CHANGED
|
@@ -31,7 +31,7 @@ const cvaFilterCustomButton = cssClassVarianceUtilities.cvaMerge(["justify-norma
|
|
|
31
31
|
* @param {FilterProps} props - The props for the Filter component
|
|
32
32
|
* @returns {ReactElement} Filter component
|
|
33
33
|
*/
|
|
34
|
-
const Filter = ({ title, asIcon, children, popoverProps, isActive, activeLabel, activeOptionsCount, menuListProps, className, "data-testid": dataTestId, withStickyHeader = false, readOnly, visualStyle = "button", size = "small", }) => {
|
|
34
|
+
const Filter = ({ title, asIcon = undefined, children, popoverProps, isActive = false, activeLabel, activeOptionsCount, menuListProps, className, "data-testid": dataTestId, withStickyHeader = false, readOnly = false, visualStyle = "button", size = "small", }) => {
|
|
35
35
|
const handleClick = react.useCallback((event) => {
|
|
36
36
|
event.stopPropagation();
|
|
37
37
|
}, []);
|
|
@@ -133,12 +133,12 @@ const cvaFilterHeaderButton = cssClassVarianceUtilities.cvaMerge([], {
|
|
|
133
133
|
* @param {CheckBoxFilterItemProps} props - The props for the FilterItem component
|
|
134
134
|
* @returns {ReactElement} FilterItem component
|
|
135
135
|
*/
|
|
136
|
-
const CheckBoxFilterItem = ({ itemCount, className, suffix, "data-testid": dataTestId, label, ref, ...rest }) => {
|
|
137
|
-
return (jsxRuntime.jsx(reactFormComponents.Checkbox, { className: reactComponents.cvaInteractableItem({
|
|
136
|
+
const CheckBoxFilterItem = ({ itemCount, className, suffix, "data-testid": dataTestId, label, checked = false, ref, ...rest }) => {
|
|
137
|
+
return (jsxRuntime.jsx(reactFormComponents.Checkbox, { checked: checked, className: reactComponents.cvaInteractableItem({
|
|
138
138
|
selection: "auto",
|
|
139
139
|
focus: "auto",
|
|
140
140
|
className: tailwindMerge.twMerge(["py-1", "mx-1", "pl-2", "pr-3", "w-auto", "h-auto", "items-center", "gap-x-2", "select-none", "rounded"], className),
|
|
141
|
-
}), "data-testid": dataTestId ?? `${label}-checkbox-filter-item`, label: label, ref: ref, suffix: itemCount !== undefined || (suffix !== undefined && suffix !== null) ? (jsxRuntime.jsxs("span", { className: reactComponents.cvaMenuItemSuffix({ selected:
|
|
141
|
+
}), "data-testid": dataTestId ?? `${label}-checkbox-filter-item`, label: label, ref: ref, suffix: itemCount !== undefined || (suffix !== undefined && suffix !== null) ? (jsxRuntime.jsxs("span", { className: reactComponents.cvaMenuItemSuffix({ selected: checked }), children: [suffix, itemCount === undefined ? null : itemCount] })) : null, ...rest }));
|
|
142
142
|
};
|
|
143
143
|
|
|
144
144
|
/**
|
|
@@ -148,12 +148,12 @@ const CheckBoxFilterItem = ({ itemCount, className, suffix, "data-testid": dataT
|
|
|
148
148
|
* @param {RadioFilterItemProps} props - The props for the FilterItem component
|
|
149
149
|
* @returns {ReactElement} FilterItem component
|
|
150
150
|
*/
|
|
151
|
-
const RadioFilterItem = ({ value, label, itemCount, selected, "data-testid": dataTestId, suffix, className, ...rest }) => {
|
|
151
|
+
const RadioFilterItem = ({ value, label, itemCount, selected, checked = false, "data-testid": dataTestId, suffix, className, ...rest }) => {
|
|
152
152
|
return (jsxRuntime.jsx(reactFormComponents.RadioItem, { className: reactComponents.cvaInteractableItem({
|
|
153
153
|
selection: "auto",
|
|
154
154
|
focus: "auto",
|
|
155
155
|
className: tailwindMerge.twMerge(["py-1", "pl-2", "pr-3", "w-full", "h-auto", "items-center", "gap-x-2", "select-none", "rounded"], className),
|
|
156
|
-
}), "data-testid": dataTestId ?? `${label}-radio-filter-item`, label: label, suffix: itemCount !== undefined || (suffix !== undefined && suffix !== null) ? (jsxRuntime.jsxs("span", { className: reactComponents.cvaMenuItemSuffix({ selected:
|
|
156
|
+
}), "data-testid": dataTestId ?? `${label}-radio-filter-item`, label: label, suffix: itemCount !== undefined || (suffix !== undefined && suffix !== null) ? (jsxRuntime.jsxs("span", { className: reactComponents.cvaMenuItemSuffix({ selected: checked }), children: [suffix, itemCount === undefined ? null : itemCount] })) : null, value: value, ...rest }));
|
|
157
157
|
};
|
|
158
158
|
|
|
159
159
|
exports.CheckBoxFilterItem = CheckBoxFilterItem;
|
package/index.esm.js
CHANGED
|
@@ -29,7 +29,7 @@ const cvaFilterCustomButton = cvaMerge(["justify-normal"], {
|
|
|
29
29
|
* @param {FilterProps} props - The props for the Filter component
|
|
30
30
|
* @returns {ReactElement} Filter component
|
|
31
31
|
*/
|
|
32
|
-
const Filter = ({ title, asIcon, children, popoverProps, isActive, activeLabel, activeOptionsCount, menuListProps, className, "data-testid": dataTestId, withStickyHeader = false, readOnly, visualStyle = "button", size = "small", }) => {
|
|
32
|
+
const Filter = ({ title, asIcon = undefined, children, popoverProps, isActive = false, activeLabel, activeOptionsCount, menuListProps, className, "data-testid": dataTestId, withStickyHeader = false, readOnly = false, visualStyle = "button", size = "small", }) => {
|
|
33
33
|
const handleClick = useCallback((event) => {
|
|
34
34
|
event.stopPropagation();
|
|
35
35
|
}, []);
|
|
@@ -131,12 +131,12 @@ const cvaFilterHeaderButton = 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, ref, ...rest }) => {
|
|
135
|
-
return (jsx(Checkbox, { className: cvaInteractableItem({
|
|
134
|
+
const CheckBoxFilterItem = ({ itemCount, className, suffix, "data-testid": dataTestId, label, checked = false, ref, ...rest }) => {
|
|
135
|
+
return (jsx(Checkbox, { checked: checked, className: cvaInteractableItem({
|
|
136
136
|
selection: "auto",
|
|
137
137
|
focus: "auto",
|
|
138
138
|
className: 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, ref: ref, suffix: itemCount !== undefined || (suffix !== undefined && suffix !== null) ? (jsxs("span", { className: cvaMenuItemSuffix({ selected:
|
|
139
|
+
}), "data-testid": dataTestId ?? `${label}-checkbox-filter-item`, label: label, ref: ref, suffix: itemCount !== undefined || (suffix !== undefined && suffix !== null) ? (jsxs("span", { className: cvaMenuItemSuffix({ selected: checked }), children: [suffix, itemCount === undefined ? null : itemCount] })) : null, ...rest }));
|
|
140
140
|
};
|
|
141
141
|
|
|
142
142
|
/**
|
|
@@ -146,12 +146,12 @@ const CheckBoxFilterItem = ({ itemCount, className, suffix, "data-testid": dataT
|
|
|
146
146
|
* @param {RadioFilterItemProps} props - The props for the FilterItem component
|
|
147
147
|
* @returns {ReactElement} FilterItem component
|
|
148
148
|
*/
|
|
149
|
-
const RadioFilterItem = ({ value, label, itemCount, selected, "data-testid": dataTestId, suffix, className, ...rest }) => {
|
|
149
|
+
const RadioFilterItem = ({ value, label, itemCount, selected, checked = false, "data-testid": dataTestId, suffix, className, ...rest }) => {
|
|
150
150
|
return (jsx(RadioItem, { className: cvaInteractableItem({
|
|
151
151
|
selection: "auto",
|
|
152
152
|
focus: "auto",
|
|
153
153
|
className: twMerge(["py-1", "pl-2", "pr-3", "w-full", "h-auto", "items-center", "gap-x-2", "select-none", "rounded"], className),
|
|
154
|
-
}), "data-testid": dataTestId ?? `${label}-radio-filter-item`, label: label, suffix: itemCount !== undefined || (suffix !== undefined && suffix !== null) ? (jsxs("span", { className: cvaMenuItemSuffix({ selected:
|
|
154
|
+
}), "data-testid": dataTestId ?? `${label}-radio-filter-item`, label: label, suffix: itemCount !== undefined || (suffix !== undefined && suffix !== null) ? (jsxs("span", { className: cvaMenuItemSuffix({ selected: checked }), children: [suffix, itemCount === undefined ? null : itemCount] })) : null, value: value, ...rest }));
|
|
155
155
|
};
|
|
156
156
|
|
|
157
157
|
export { CheckBoxFilterItem, Filter, FilterBody, FilterFooter, FilterHeader, RadioFilterItem, cvaFilterFooter, cvaFilterHeaderButton };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-filter-components",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.5",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"tailwind-merge": "^2.0.0",
|
|
11
11
|
"@trackunit/ui-icons": "1.11.73",
|
|
12
12
|
"@trackunit/css-class-variance-utilities": "1.11.77",
|
|
13
|
-
"@trackunit/react-components": "1.20.
|
|
14
|
-
"@trackunit/react-form-components": "1.18.
|
|
13
|
+
"@trackunit/react-components": "1.20.4",
|
|
14
|
+
"@trackunit/react-form-components": "1.18.4"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"react": "^19.0.0"
|
|
@@ -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, ref, ...rest }: CheckBoxFilterItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const CheckBoxFilterItem: ({ itemCount, className, suffix, "data-testid": dataTestId, label, checked, ref, ...rest }: CheckBoxFilterItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
1
2
|
import { RadioFilterItemProps } from "../types";
|
|
2
3
|
/**
|
|
3
4
|
* The RadioFilterItem component is the base component used in the manager to FilterItem data.
|
|
@@ -6,4 +7,4 @@ import { RadioFilterItemProps } from "../types";
|
|
|
6
7
|
* @param {RadioFilterItemProps} props - The props for the FilterItem component
|
|
7
8
|
* @returns {ReactElement} FilterItem component
|
|
8
9
|
*/
|
|
9
|
-
export declare const RadioFilterItem: ({ value, label, itemCount, selected, "data-testid": dataTestId, suffix, className, ...rest }: RadioFilterItemProps) =>
|
|
10
|
+
export declare const RadioFilterItem: ({ value, label, itemCount, selected, checked, "data-testid": dataTestId, suffix, className, ...rest }: RadioFilterItemProps) => ReactElement;
|