@trackunit/filters-filter-bar 1.3.30 → 1.3.32
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 +3 -2
- package/index.esm.js +3 -2
- package/package.json +10 -10
package/index.cjs.js
CHANGED
|
@@ -1117,7 +1117,8 @@ const validateFilter = (filter, filterDefinitions) => {
|
|
|
1117
1117
|
* @returns {object} An object containing filter bar configuration and actions.
|
|
1118
1118
|
*/
|
|
1119
1119
|
const useFilterBar = ({ name, onValuesChange, filterBarDefinition, loadAsync, initialState, }) => {
|
|
1120
|
-
const [
|
|
1120
|
+
const [asyncLoadedFilterBarDefinitions, setAsyncLoadedFilterBarDefinitions] = react.useState();
|
|
1121
|
+
const internalFilterBarDefinitions = react.useMemo(() => asyncLoadedFilterBarDefinitions ?? filterBarDefinition, [filterBarDefinition, asyncLoadedFilterBarDefinitions]);
|
|
1121
1122
|
const { clientSideUserId } = reactCoreHooks.useCurrentUser();
|
|
1122
1123
|
const setValue = react.useCallback((key, callback) => {
|
|
1123
1124
|
setFilterBarConfig(prevState => {
|
|
@@ -1168,7 +1169,7 @@ const useFilterBar = ({ name, onValuesChange, filterBarDefinition, loadAsync, in
|
|
|
1168
1169
|
if (!loadAsync) {
|
|
1169
1170
|
throw new Error("You must pass in loadAsync to useFilterBar when loading filter data asynchronously");
|
|
1170
1171
|
}
|
|
1171
|
-
|
|
1172
|
+
setAsyncLoadedFilterBarDefinitions(loadedFilterDefinitionsValues);
|
|
1172
1173
|
setFilterBarConfig(prev => loadData(sharedUtils.objectValues(loadedFilterDefinitionsValues)));
|
|
1173
1174
|
}, [loadAsync, loadData]);
|
|
1174
1175
|
const [filterBarConfig, setFilterBarConfig] = react.useState(() => {
|
package/index.esm.js
CHANGED
|
@@ -1115,7 +1115,8 @@ const validateFilter = (filter, filterDefinitions) => {
|
|
|
1115
1115
|
* @returns {object} An object containing filter bar configuration and actions.
|
|
1116
1116
|
*/
|
|
1117
1117
|
const useFilterBar = ({ name, onValuesChange, filterBarDefinition, loadAsync, initialState, }) => {
|
|
1118
|
-
const [
|
|
1118
|
+
const [asyncLoadedFilterBarDefinitions, setAsyncLoadedFilterBarDefinitions] = useState();
|
|
1119
|
+
const internalFilterBarDefinitions = useMemo(() => asyncLoadedFilterBarDefinitions ?? filterBarDefinition, [filterBarDefinition, asyncLoadedFilterBarDefinitions]);
|
|
1119
1120
|
const { clientSideUserId } = useCurrentUser();
|
|
1120
1121
|
const setValue = useCallback((key, callback) => {
|
|
1121
1122
|
setFilterBarConfig(prevState => {
|
|
@@ -1166,7 +1167,7 @@ const useFilterBar = ({ name, onValuesChange, filterBarDefinition, loadAsync, in
|
|
|
1166
1167
|
if (!loadAsync) {
|
|
1167
1168
|
throw new Error("You must pass in loadAsync to useFilterBar when loading filter data asynchronously");
|
|
1168
1169
|
}
|
|
1169
|
-
|
|
1170
|
+
setAsyncLoadedFilterBarDefinitions(loadedFilterDefinitionsValues);
|
|
1170
1171
|
setFilterBarConfig(prev => loadData(objectValues(loadedFilterDefinitionsValues)));
|
|
1171
1172
|
}, [loadAsync, loadData]);
|
|
1172
1173
|
const [filterBarConfig, setFilterBarConfig] = useState(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/filters-filter-bar",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.32",
|
|
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": "1.4.
|
|
18
|
-
"@trackunit/react-core-hooks": "1.3.
|
|
19
|
-
"@trackunit/react-filter-components": "1.3.
|
|
20
|
-
"@trackunit/react-date-and-time-components": "1.3.
|
|
21
|
-
"@trackunit/shared-utils": "1.5.
|
|
22
|
-
"@trackunit/react-form-components": "1.3.
|
|
23
|
-
"@trackunit/react-core-contexts-api": "1.4.
|
|
24
|
-
"@trackunit/geo-json-utils": "1.3.
|
|
25
|
-
"@trackunit/i18n-library-translation": "1.3.
|
|
17
|
+
"@trackunit/react-components": "1.4.21",
|
|
18
|
+
"@trackunit/react-core-hooks": "1.3.22",
|
|
19
|
+
"@trackunit/react-filter-components": "1.3.25",
|
|
20
|
+
"@trackunit/react-date-and-time-components": "1.3.23",
|
|
21
|
+
"@trackunit/shared-utils": "1.5.21",
|
|
22
|
+
"@trackunit/react-form-components": "1.3.25",
|
|
23
|
+
"@trackunit/react-core-contexts-api": "1.4.22",
|
|
24
|
+
"@trackunit/geo-json-utils": "1.3.22",
|
|
25
|
+
"@trackunit/i18n-library-translation": "1.3.22"
|
|
26
26
|
},
|
|
27
27
|
"module": "./index.esm.js",
|
|
28
28
|
"main": "./index.cjs.js",
|