@equinor/fusion-react-filter 2.1.8 → 2.1.9
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterOptionHeader.d.ts","sourceRoot":"","sources":["../../../src/components/filter/FilterOptionHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,YAAY,EAAqC,MAAM,OAAO,CAAC;AAY7F,KAAK,iBAAiB,GAAG;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterOptionHeader.d.ts","sourceRoot":"","sources":["../../../src/components/filter/FilterOptionHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,YAAY,EAAqC,MAAM,OAAO,CAAC;AAY7F,KAAK,iBAAiB,GAAG;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;2CA6CiC,KAAK,EAAE,iBAAiB,GAAG,YAAY;;;;eA6D3D,kBAAkB"}
|
|
@@ -7,6 +7,7 @@ import { search, chevron_right } from '@equinor/eds-icons';
|
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { tokens } from '@equinor/eds-tokens';
|
|
9
9
|
Icon.add({ search, chevron_right });
|
|
10
|
+
const getSelectedCount = (selection) => selection?.size ?? 0;
|
|
10
11
|
const Styled = {
|
|
11
12
|
Root: styled.div `
|
|
12
13
|
display: flex;
|
|
@@ -53,7 +54,7 @@ export const FilterOptionHeader = (props) => {
|
|
|
53
54
|
const searchRef = useRef(null);
|
|
54
55
|
const { options$, selection$ } = useFilterOptionContext();
|
|
55
56
|
const optionCount = Object.keys(useObservableState(options$).value || {}).length;
|
|
56
|
-
const { value: selectedCount } = useObservableState(useObservableSelector(selection$,
|
|
57
|
+
const { value: selectedCount } = useObservableState(useObservableSelector(selection$, getSelectedCount), { initial: 0 });
|
|
57
58
|
const onIconClick = () => {
|
|
58
59
|
if (showSearch) {
|
|
59
60
|
setQuery('');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-react-filter",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.9",
|
|
4
4
|
"description": "component for Filtering data",
|
|
5
5
|
"author": "",
|
|
6
6
|
"homepage": "https://github.com/equinor/fusion-react-components/tree/master/packages/filter#readme",
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@equinor/eds-core-react": "^2.5.0",
|
|
54
54
|
"@equinor/eds-icons": "^1.5.1",
|
|
55
|
-
"@equinor/fusion-observable": "^9.
|
|
55
|
+
"@equinor/fusion-observable": "^9.1.1",
|
|
56
56
|
"@types/react": "^19.2.14",
|
|
57
57
|
"react": "^19.2.8"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@equinor/eds-core-react": "^2",
|
|
61
61
|
"@equinor/eds-icons": "^1",
|
|
62
|
-
"@equinor/fusion-observable": "^9.
|
|
62
|
+
"@equinor/fusion-observable": "^9.1.1",
|
|
63
63
|
"react": "^18 || ^19",
|
|
64
64
|
"react-dom": "^18 || ^19"
|
|
65
65
|
}
|