datastake-daf 0.6.235 → 0.6.236
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/dist/components/index.js
CHANGED
|
@@ -10003,6 +10003,22 @@ const SelectFilters = _ref => {
|
|
|
10003
10003
|
} = _ref;
|
|
10004
10004
|
const [filters, setFilters] = React.useState(selectedFilters || {});
|
|
10005
10005
|
const [initFilters, setInitFilters] = React.useState(selectedFilters || {});
|
|
10006
|
+
|
|
10007
|
+
// Sync internal state with selectedFilters prop changes
|
|
10008
|
+
React.useEffect(() => {
|
|
10009
|
+
// Only sync if selectedFilters prop has actually changed and is different from current initFilters
|
|
10010
|
+
const selectedFiltersStr = JSON.stringify(selectedFilters || {});
|
|
10011
|
+
const initFiltersStr = JSON.stringify(initFilters);
|
|
10012
|
+
if (selectedFiltersStr !== initFiltersStr) {
|
|
10013
|
+
setFilters(selectedFilters || {});
|
|
10014
|
+
setInitFilters(selectedFilters || {});
|
|
10015
|
+
|
|
10016
|
+
// Auto-show filters in header if there are active filters and this is a header instance
|
|
10017
|
+
if (isHeader && selectedFilters && Object.keys(selectedFilters).length > 0 && !showFilters) {
|
|
10018
|
+
setShowFilters(true);
|
|
10019
|
+
}
|
|
10020
|
+
}
|
|
10021
|
+
}, [selectedFilters, initFilters, isHeader, showFilters, setShowFilters]);
|
|
10006
10022
|
const getClearLabel = () => {
|
|
10007
10023
|
switch (type) {
|
|
10008
10024
|
case 'small':
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import { Button, Input, Tooltip } from 'antd';
|
|
3
|
-
import React, { useMemo, useState } from 'react';
|
|
3
|
+
import React, { useMemo, useState, useEffect } from 'react';
|
|
4
4
|
import { CustomSelect } from './Select.jsx';
|
|
5
5
|
import { Timeframe } from './Timeframe.jsx';
|
|
6
6
|
import { AjaxSelect } from "./AjaxSelect.jsx";
|
|
@@ -26,6 +26,23 @@ const SelectFilters = ({
|
|
|
26
26
|
const [filters, setFilters] = useState(selectedFilters || {});
|
|
27
27
|
const [initFilters, setInitFilters] = useState(selectedFilters || {})
|
|
28
28
|
|
|
29
|
+
// Sync internal state with selectedFilters prop changes
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
// Only sync if selectedFilters prop has actually changed and is different from current initFilters
|
|
32
|
+
const selectedFiltersStr = JSON.stringify(selectedFilters || {});
|
|
33
|
+
const initFiltersStr = JSON.stringify(initFilters);
|
|
34
|
+
|
|
35
|
+
if (selectedFiltersStr !== initFiltersStr) {
|
|
36
|
+
setFilters(selectedFilters || {});
|
|
37
|
+
setInitFilters(selectedFilters || {});
|
|
38
|
+
|
|
39
|
+
// Auto-show filters in header if there are active filters and this is a header instance
|
|
40
|
+
if (isHeader && selectedFilters && Object.keys(selectedFilters).length > 0 && !showFilters) {
|
|
41
|
+
setShowFilters(true);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}, [selectedFilters, initFilters, isHeader, showFilters, setShowFilters]);
|
|
45
|
+
|
|
29
46
|
const getClearLabel = () => {
|
|
30
47
|
switch (type) {
|
|
31
48
|
case 'small':
|