@tracktor/design-system 4.8.0 → 4.8.2
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/CHANGELOG.md +4 -4
- package/dist/main.cjs +11 -11
- package/dist/main.js +1939 -1825
- package/dist/src/components/Inputs/ChipFilter/ChipFilter.d.ts +15 -12
- package/dist/src/main.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ChipProps } from '@mui/material';
|
|
2
|
-
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type OptionValue = string | number;
|
|
4
|
+
type Option<T = OptionValue> = {
|
|
3
5
|
id?: string | number;
|
|
4
6
|
label: string;
|
|
5
|
-
value:
|
|
7
|
+
value: T;
|
|
6
8
|
};
|
|
7
|
-
interface ChipFilterBaseProps {
|
|
9
|
+
interface ChipFilterBaseProps<T = OptionValue> {
|
|
8
10
|
/**
|
|
9
11
|
* The label of the chip filter.
|
|
10
12
|
*/
|
|
@@ -29,7 +31,7 @@ interface ChipFilterBaseProps {
|
|
|
29
31
|
* The options available for selection in the chip filter.
|
|
30
32
|
* If "options" is not an array, it is considered a single option (toggle behavior).
|
|
31
33
|
*/
|
|
32
|
-
options?: Option | Option[];
|
|
34
|
+
options?: Option<T> | Option<T>[];
|
|
33
35
|
/**
|
|
34
36
|
* Indicates if there should be a separator between the label menu and the options selected in the menu.
|
|
35
37
|
* Defaults to ":"
|
|
@@ -40,7 +42,7 @@ interface ChipFilterBaseProps {
|
|
|
40
42
|
*/
|
|
41
43
|
labelOnlyAfterSelection?: boolean;
|
|
42
44
|
}
|
|
43
|
-
export interface ChipFilterSingleProps extends ChipFilterBaseProps {
|
|
45
|
+
export interface ChipFilterSingleProps<T = OptionValue> extends ChipFilterBaseProps<T> {
|
|
44
46
|
/**
|
|
45
47
|
* Indicates if the chip filter allows multiple selections.
|
|
46
48
|
*/
|
|
@@ -48,14 +50,14 @@ export interface ChipFilterSingleProps extends ChipFilterBaseProps {
|
|
|
48
50
|
/**
|
|
49
51
|
* The value of the chip filter.
|
|
50
52
|
*/
|
|
51
|
-
value?:
|
|
53
|
+
value?: T;
|
|
52
54
|
/**
|
|
53
55
|
* Callback function triggered when the value of the chip filter changes.
|
|
54
56
|
* @param value
|
|
55
57
|
*/
|
|
56
|
-
onChange?: (value?:
|
|
58
|
+
onChange?: (value?: T) => void;
|
|
57
59
|
}
|
|
58
|
-
export interface ChipFilterMultipleProps extends ChipFilterBaseProps {
|
|
60
|
+
export interface ChipFilterMultipleProps<T = OptionValue> extends ChipFilterBaseProps<T> {
|
|
59
61
|
/**
|
|
60
62
|
* Indicates if the chip filter allows multiple selections.
|
|
61
63
|
*/
|
|
@@ -63,13 +65,14 @@ export interface ChipFilterMultipleProps extends ChipFilterBaseProps {
|
|
|
63
65
|
/**
|
|
64
66
|
* The value of the chip filter.
|
|
65
67
|
*/
|
|
66
|
-
value?:
|
|
68
|
+
value?: T[];
|
|
67
69
|
/**
|
|
68
70
|
* Callback function triggered when the value of the chip filter changes.
|
|
69
71
|
* @param value
|
|
70
72
|
*/
|
|
71
|
-
onChange?: (value:
|
|
73
|
+
onChange?: (value: T[]) => void;
|
|
72
74
|
}
|
|
73
|
-
export type ChipFilterProps = ChipFilterSingleProps | ChipFilterMultipleProps
|
|
74
|
-
declare
|
|
75
|
+
export type ChipFilterProps<T = OptionValue> = ChipFilterSingleProps<T> | ChipFilterMultipleProps<T>;
|
|
76
|
+
declare function ChipFilter<T = OptionValue>(props: ChipFilterSingleProps<T>): ReactNode;
|
|
77
|
+
declare function ChipFilter<T = OptionValue>(props: ChipFilterMultipleProps<T>): ReactNode;
|
|
75
78
|
export default ChipFilter;
|
package/dist/src/main.d.ts
CHANGED
|
@@ -63,6 +63,8 @@ export { default as DialogPopper } from './components/Feedback/Dialog/DialogPopp
|
|
|
63
63
|
export * from './components/Feedback/Dialog/DialogPopper';
|
|
64
64
|
export { default as DialogValidation } from './components/Feedback/Dialog/DialogValidation/DialogValidation';
|
|
65
65
|
export * from './components/Feedback/Dialog/DialogValidation/DialogValidation';
|
|
66
|
+
export { default as ChipFilter } from './components/Inputs/ChipFilter/ChipFilter';
|
|
67
|
+
export * from './components/Inputs/ChipFilter/ChipFilter';
|
|
66
68
|
export { default as ThemeProvider } from './context/Theme/ThemeProvider';
|
|
67
69
|
export type { ThemeProviderProps } from './context/Theme/ThemeProvider';
|
|
68
70
|
export { default as PermissionProvider } from './context/Permission/PermissionProvider';
|