@trackunit/filters-filter-bar 1.0.22 → 1.0.27
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/package.json +10 -10
- package/src/lib/types/FilterTypes.d.ts +10 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/filters-filter-bar",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"tailwind-merge": "^2.0.0",
|
|
15
15
|
"string-ts": "^2.0.0",
|
|
16
16
|
"zod": "3.22.4",
|
|
17
|
-
"@trackunit/react-components": "
|
|
18
|
-
"@trackunit/react-core-hooks": "
|
|
19
|
-
"@trackunit/react-filter-components": "
|
|
20
|
-
"@trackunit/react-date-and-time-components": "
|
|
21
|
-
"@trackunit/shared-utils": "
|
|
22
|
-
"@trackunit/react-form-components": "
|
|
23
|
-
"@trackunit/react-core-contexts-api": "
|
|
24
|
-
"@trackunit/geo-json-utils": "
|
|
25
|
-
"@trackunit/i18n-library-translation": "
|
|
17
|
+
"@trackunit/react-components": "1.1.7",
|
|
18
|
+
"@trackunit/react-core-hooks": "1.0.9",
|
|
19
|
+
"@trackunit/react-filter-components": "1.0.27",
|
|
20
|
+
"@trackunit/react-date-and-time-components": "1.0.26",
|
|
21
|
+
"@trackunit/shared-utils": "1.2.1",
|
|
22
|
+
"@trackunit/react-form-components": "1.0.25",
|
|
23
|
+
"@trackunit/react-core-contexts-api": "1.0.9",
|
|
24
|
+
"@trackunit/geo-json-utils": "1.0.5",
|
|
25
|
+
"@trackunit/i18n-library-translation": "1.0.13"
|
|
26
26
|
},
|
|
27
27
|
"module": "./index.esm.js",
|
|
28
28
|
"main": "./index.cjs.js",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export type ValueName = {
|
|
4
4
|
value: string;
|
|
@@ -112,43 +112,43 @@ export interface BooleanFilterDefinition extends AbstractFilterDefinition {
|
|
|
112
112
|
type: "boolean";
|
|
113
113
|
defaultValue?: BooleanValue;
|
|
114
114
|
valueAsText?: (value: BooleanValue) => string;
|
|
115
|
-
component: (filterComponentProps: FilterViewProps<BooleanValue>) =>
|
|
115
|
+
component: (filterComponentProps: FilterViewProps<BooleanValue>) => ReactNode;
|
|
116
116
|
}
|
|
117
117
|
export interface StringFilterDefinition extends AbstractFilterDefinition {
|
|
118
118
|
type: "string";
|
|
119
119
|
defaultValue?: string;
|
|
120
120
|
valueAsText?: (value: string) => string;
|
|
121
|
-
component: (filterComponentProps: FilterViewProps<string>) =>
|
|
121
|
+
component: (filterComponentProps: FilterViewProps<string>) => ReactNode;
|
|
122
122
|
}
|
|
123
123
|
export interface NumberFilterDefinition extends AbstractFilterDefinition {
|
|
124
124
|
type: "number";
|
|
125
125
|
defaultValue?: number;
|
|
126
126
|
valueAsText?: (value: number) => string;
|
|
127
|
-
component: (filterComponentProps: FilterViewProps<number>) =>
|
|
127
|
+
component: (filterComponentProps: FilterViewProps<number>) => ReactNode;
|
|
128
128
|
}
|
|
129
129
|
export interface AreaFilterDefinition extends AbstractFilterDefinition {
|
|
130
130
|
type: "area";
|
|
131
131
|
defaultValue?: AreaFilterGeoJsonGeometry;
|
|
132
132
|
valueAsText?: (value: AreaFilterGeoJsonGeometry) => string;
|
|
133
|
-
component: (filterComponentProps: FilterViewProps<AreaFilterGeoJsonGeometry>) =>
|
|
133
|
+
component: (filterComponentProps: FilterViewProps<AreaFilterGeoJsonGeometry>) => ReactNode;
|
|
134
134
|
}
|
|
135
135
|
export interface ValueNameArrayFilterDefinition extends AbstractFilterDefinition {
|
|
136
136
|
type: "valueNameArray";
|
|
137
137
|
defaultValue?: ValueName[];
|
|
138
138
|
valueAsText?: (value: ValueName[]) => string[];
|
|
139
|
-
component: (filterComponentProps: FilterViewProps<ValueName[]>) =>
|
|
139
|
+
component: (filterComponentProps: FilterViewProps<ValueName[]>) => ReactNode;
|
|
140
140
|
}
|
|
141
141
|
export interface ValueNameFilterDefinition extends AbstractFilterDefinition {
|
|
142
142
|
type: "valueName";
|
|
143
143
|
defaultValue?: ValueName;
|
|
144
144
|
valueAsText?: (value: ValueName) => string;
|
|
145
|
-
component: (filterComponentProps: FilterViewProps<ValueName>) =>
|
|
145
|
+
component: (filterComponentProps: FilterViewProps<ValueName>) => ReactNode;
|
|
146
146
|
}
|
|
147
147
|
export interface StringArrayFilterDefinition extends AbstractFilterDefinition {
|
|
148
148
|
type: "stringArray";
|
|
149
149
|
defaultValue?: string[];
|
|
150
150
|
valueAsText?: (value: string[]) => string[];
|
|
151
|
-
component: (filterComponentProps: FilterViewProps<string[]>) =>
|
|
151
|
+
component: (filterComponentProps: FilterViewProps<string[]>) => ReactNode;
|
|
152
152
|
}
|
|
153
153
|
export interface MinMaxFilterDefinition extends AbstractFilterDefinition {
|
|
154
154
|
type: "minMax";
|
|
@@ -162,7 +162,7 @@ export interface MinMaxFilterDefinition extends AbstractFilterDefinition {
|
|
|
162
162
|
*/
|
|
163
163
|
maximumNumber?: number | undefined;
|
|
164
164
|
valueAsText?: (value: MinMaxFilterValue) => string;
|
|
165
|
-
component: (filterComponentProps: FilterViewProps<MinMaxFilterValue>) =>
|
|
165
|
+
component: (filterComponentProps: FilterViewProps<MinMaxFilterValue>) => ReactNode;
|
|
166
166
|
}
|
|
167
167
|
export type DateRangeValue = {
|
|
168
168
|
from: string | undefined;
|
|
@@ -180,7 +180,7 @@ export interface DateRangeFilterDefinition extends AbstractFilterDefinition {
|
|
|
180
180
|
*/
|
|
181
181
|
to?: string | undefined;
|
|
182
182
|
valueAsText?: (value: DateRangeValue) => string;
|
|
183
|
-
component: (filterComponentProps: FilterViewProps<DateRangeValue>) =>
|
|
183
|
+
component: (filterComponentProps: FilterViewProps<DateRangeValue>) => ReactNode;
|
|
184
184
|
}
|
|
185
185
|
export type FilterDefinition = BooleanFilterDefinition | MinMaxFilterDefinition | StringFilterDefinition | NumberFilterDefinition | DateRangeFilterDefinition | AreaFilterDefinition | ValueNameFilterDefinition | ValueNameArrayFilterDefinition | StringArrayFilterDefinition;
|
|
186
186
|
export type FilterDefinitionValue = NonNullable<FilterDefinition["defaultValue"]>;
|