@bento-core/facet-filter 1.0.1-c3dc.4 → 1.0.1-c3dc.5
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/FacetFilterController.js +27 -26
- package/dist/FacetFilterStyle.js +1 -1
- package/dist/FacetFilterView.js +6 -1
- package/dist/components/facet/FacetModal.js +2 -3
- package/dist/components/facet/FacetStyle.js +28 -14
- package/dist/components/facet/FacetView.js +13 -13
- package/dist/components/facet/ModalStyle.js +10 -4
- package/dist/components/facet/ReduxFacetView.js +7 -9
- package/dist/components/facet/SearchFacetView.js +10 -7
- package/dist/components/inputs/FilterItemStyle.js +16 -9
- package/dist/components/inputs/ModalFilterItems.js +1 -1
- package/dist/components/inputs/ModalFilterStyle.js +10 -7
- package/dist/components/inputs/checkbox/CheckboxStyle.js +5 -8
- package/dist/components/inputs/checkbox/CheckboxView.js +42 -66
- package/dist/components/inputs/checkbox/ModalCheckboxStyle.js +5 -8
- package/dist/components/inputs/checkbox/ModalCheckboxView.js +42 -66
- package/dist/components/inputs/checkbox/ReduxCheckbox.js +1 -4
- package/dist/components/inputs/checkbox/ReduxModalCheckbox.js +1 -4
- package/dist/components/inputs/checkbox/ReduxSearchCheckbox.js +1 -4
- package/dist/components/inputs/checkbox/SearchCheckboxView.js +42 -66
- package/dist/components/inputs/checkbox/assets/checkedbox.svg +4 -0
- package/dist/components/inputs/checkbox/assets/emptycheckbox.svg +5 -0
- package/dist/components/inputs/slider/InputMinMaxStyle.js +20 -1
- package/dist/components/inputs/slider/InputMinMaxView.js +1 -1
- package/dist/components/inputs/slider/SliderStyle.js +3 -3
- package/dist/components/inputs/slider/SliderView.js +144 -10
- package/dist/utils/Sort.js +8 -11
- package/package.json +1 -1
- package/src/components/facet/SearchFacetView.js +1 -1
|
@@ -12,13 +12,13 @@ var _FacetFilterView = _interopRequireDefault(require("./FacetFilterView"));
|
|
|
12
12
|
const _excluded = ["section"];
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
16
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
15
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
16
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
17
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
18
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
21
19
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
20
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
21
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
22
22
|
const FacetFilterController = props => {
|
|
23
23
|
/**
|
|
24
24
|
* update checkbox state
|
|
@@ -29,8 +29,7 @@ const FacetFilterController = props => {
|
|
|
29
29
|
filterState,
|
|
30
30
|
data,
|
|
31
31
|
facetsConfig,
|
|
32
|
-
facetSectionConfig
|
|
33
|
-
tooltipText = {}
|
|
32
|
+
facetSectionConfig
|
|
34
33
|
} = props;
|
|
35
34
|
const updateFacetState = filterSections => {
|
|
36
35
|
const updateSections = [...filterSections];
|
|
@@ -38,16 +37,9 @@ const FacetFilterController = props => {
|
|
|
38
37
|
for (const [key, value] of Object.entries(filterState)) {
|
|
39
38
|
updateSections.forEach(sideBar => {
|
|
40
39
|
if (sideBar.type === _Types.InputTypes.CHECKBOX && sideBar.datafield === key) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} = sideBar;
|
|
44
|
-
const updateFacetVals = facetValues.map(item => {
|
|
45
|
-
const facetVal = item[sideBar.field];
|
|
46
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
47
|
-
isChecked: value[facetVal] ? value[facetVal] : false
|
|
48
|
-
});
|
|
40
|
+
sideBar.facetValues.forEach(item => {
|
|
41
|
+
item.isChecked = value[item.name] ? value[item.name] : false;
|
|
49
42
|
});
|
|
50
|
-
sideBar.facetValues = updateFacetVals;
|
|
51
43
|
}
|
|
52
44
|
if (sideBar.type === _Types.InputTypes.SLIDER && sideBar.datafield === key) {
|
|
53
45
|
sideBar.facetValues = value;
|
|
@@ -57,13 +49,9 @@ const FacetFilterController = props => {
|
|
|
57
49
|
} else {
|
|
58
50
|
updateSections.forEach(sideBar => {
|
|
59
51
|
if (sideBar.type === _Types.InputTypes.CHECKBOX) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
const updateFacetVals = facetValues.map(item => _objectSpread(_objectSpread({}, item), {}, {
|
|
64
|
-
isChecked: false
|
|
65
|
-
}));
|
|
66
|
-
sideBar.facetValues = updateFacetVals;
|
|
52
|
+
sideBar.facetValues.forEach(item => {
|
|
53
|
+
item.isChecked = false;
|
|
54
|
+
});
|
|
67
55
|
}
|
|
68
56
|
/**
|
|
69
57
|
* set default value for slider - on clear all filter
|
|
@@ -108,7 +96,6 @@ const FacetFilterController = props => {
|
|
|
108
96
|
* Construct filter object
|
|
109
97
|
* 1. add facet values to facets
|
|
110
98
|
* 2. add 'name' key to each facet value
|
|
111
|
-
* 3. add '
|
|
112
99
|
*/
|
|
113
100
|
const addFacetValues = facets => {
|
|
114
101
|
const updateFacets = [];
|
|
@@ -118,13 +105,19 @@ const FacetFilterController = props => {
|
|
|
118
105
|
facetValues: []
|
|
119
106
|
});
|
|
120
107
|
const {
|
|
108
|
+
field,
|
|
121
109
|
ApiLowerBoundName,
|
|
122
110
|
ApiUpperBoundName,
|
|
123
111
|
apiForFiltering
|
|
124
112
|
} = updateFacet;
|
|
125
113
|
if (data[apiForFiltering]) {
|
|
126
114
|
if (Array.isArray(data[apiForFiltering])) {
|
|
127
|
-
|
|
115
|
+
const updateField = data[apiForFiltering].map(item => {
|
|
116
|
+
const addField = _objectSpread({}, item);
|
|
117
|
+
addField.name = item[field];
|
|
118
|
+
return addField;
|
|
119
|
+
});
|
|
120
|
+
updateFacet.facetValues = updateField;
|
|
128
121
|
}
|
|
129
122
|
/**
|
|
130
123
|
* add object to facet values
|
|
@@ -132,12 +125,19 @@ const FacetFilterController = props => {
|
|
|
132
125
|
if (facet.type === _Types.InputTypes.SLIDER) {
|
|
133
126
|
const lowerBound = data[apiForFiltering][ApiLowerBoundName];
|
|
134
127
|
const upperBound = data[apiForFiltering][ApiUpperBoundName];
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
128
|
+
if (lowerBound === 0 && upperBound === 0) {
|
|
129
|
+
updateFacet.filterOut = true;
|
|
130
|
+
} else {
|
|
131
|
+
updateFacet.minLowerBound = lowerBound;
|
|
132
|
+
updateFacet.maxUpperBound = upperBound;
|
|
133
|
+
updateFacet.facetValues = [lowerBound, upperBound];
|
|
134
|
+
updateFacet.style = facet.style;
|
|
135
|
+
}
|
|
138
136
|
}
|
|
139
137
|
}
|
|
140
|
-
|
|
138
|
+
if (!updateFacet.filterOut) {
|
|
139
|
+
updateFacets.push(updateFacet);
|
|
140
|
+
}
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
return updateFacets;
|
|
@@ -147,6 +147,7 @@ const FacetFilterController = props => {
|
|
|
147
147
|
* Generate facet sections state
|
|
148
148
|
*
|
|
149
149
|
*/
|
|
150
|
+
// const displayFacets = facetsConfig.filter((facet) => facet.show).slice(0, 16);
|
|
150
151
|
const displayFacets = facetsConfig.filter(facet => facet.show);
|
|
151
152
|
const facetStates = addFacetValues(displayFacets);
|
|
152
153
|
const updateState = updateFacetState(facetStates);
|
package/dist/FacetFilterStyle.js
CHANGED
package/dist/FacetFilterView.js
CHANGED
|
@@ -9,6 +9,7 @@ var _core = require("@material-ui/core");
|
|
|
9
9
|
var _FacetFilterStyle = _interopRequireDefault(require("./FacetFilterStyle"));
|
|
10
10
|
var _FacetSectionView = _interopRequireDefault(require("./components/section/FacetSectionView"));
|
|
11
11
|
var _ReduxFacetView = _interopRequireDefault(require("./components/facet/ReduxFacetView"));
|
|
12
|
+
var _FilterItems = _interopRequireDefault(require("./components/inputs/FilterItems"));
|
|
12
13
|
var _ReduxSearchFacetView = _interopRequireDefault(require("./components/facet/ReduxSearchFacetView"));
|
|
13
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
15
|
/* eslint-disable arrow-body-style */
|
|
@@ -36,7 +37,11 @@ const BentoFacetFilter = _ref => {
|
|
|
36
37
|
return /*#__PURE__*/_react.default.createElement(_ReduxFacetView.default, {
|
|
37
38
|
facet: facet,
|
|
38
39
|
CustomView: CustomFacetView
|
|
39
|
-
}
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement(_core.List, {
|
|
41
|
+
className: "List_".concat(facet.label)
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement(_FilterItems.default, {
|
|
43
|
+
facet: facet
|
|
44
|
+
})));
|
|
40
45
|
})))));
|
|
41
46
|
};
|
|
42
47
|
var _default = (0, _core.withStyles)(_FacetFilterStyle.default)(BentoFacetFilter);
|
|
@@ -35,7 +35,7 @@ const ModalView = _ref => {
|
|
|
35
35
|
return /*#__PURE__*/_react.default.createElement(_core.Modal, {
|
|
36
36
|
open: open,
|
|
37
37
|
onClose: onClose,
|
|
38
|
-
"aria-
|
|
38
|
+
"aria-labelledby": "".concat(facet.datafield, "-search-modal")
|
|
39
39
|
}, /*#__PURE__*/_react.default.createElement(_core.Box, {
|
|
40
40
|
className: classes.modalBody
|
|
41
41
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -64,8 +64,7 @@ const ModalView = _ref => {
|
|
|
64
64
|
value: searchText,
|
|
65
65
|
type: "text",
|
|
66
66
|
placeholder: facet.searchPlaceholder ? facet.searchPlaceholder : 'e.g. Sarcoma, Neoplasm',
|
|
67
|
-
onChange: e => onSearchTextChange(facet.datafield, e.target.value)
|
|
68
|
-
"aria-label": "Search within ".concat(facet.section, " facet")
|
|
67
|
+
onChange: e => onSearchTextChange(facet.datafield, e.target.value)
|
|
69
68
|
}), /*#__PURE__*/_react.default.createElement(_core.Button, {
|
|
70
69
|
variant: "outlined",
|
|
71
70
|
onClick: () => onSearchTextChange(facet.datafield, ''),
|
|
@@ -35,22 +35,35 @@ var _default = () => ({
|
|
|
35
35
|
paddingTop: '10px',
|
|
36
36
|
marginBottom: '5px',
|
|
37
37
|
textAlign: 'left',
|
|
38
|
-
marginLeft: '-
|
|
39
|
-
|
|
38
|
+
marginLeft: '-4px',
|
|
39
|
+
display: 'flex',
|
|
40
|
+
alignItems: 'stretch',
|
|
41
|
+
justifyContent: 'flex-start',
|
|
42
|
+
gap: '8px'
|
|
43
|
+
},
|
|
44
|
+
sortGroupSlider: {
|
|
45
|
+
marginBottom: '5px',
|
|
46
|
+
textAlign: 'left',
|
|
47
|
+
marginLeft: '-4px',
|
|
48
|
+
display: 'flex',
|
|
49
|
+
alignItems: 'stretch',
|
|
50
|
+
justifyContent: 'flex-start',
|
|
51
|
+
gap: '8px'
|
|
40
52
|
},
|
|
41
53
|
sortGroupIcon: {
|
|
42
54
|
cursor: 'pointer',
|
|
43
55
|
fontFamily: 'Nunito',
|
|
44
|
-
fontSize: '
|
|
56
|
+
fontSize: '11px',
|
|
45
57
|
marginRight: '12px',
|
|
46
|
-
marginLeft: '
|
|
58
|
+
marginLeft: '24px'
|
|
47
59
|
},
|
|
48
60
|
sortGroupItem: {
|
|
49
61
|
cursor: 'pointer',
|
|
50
62
|
fontFamily: 'Nunito',
|
|
51
|
-
fontSize: '11px'
|
|
52
|
-
marginRight: '
|
|
63
|
+
fontSize: '11px'
|
|
64
|
+
// marginRight: '32px',
|
|
53
65
|
},
|
|
66
|
+
|
|
54
67
|
NonSortGroup: {
|
|
55
68
|
marginBottom: '5px',
|
|
56
69
|
borderTop: '1px solid #B1B1B1',
|
|
@@ -60,24 +73,26 @@ var _default = () => ({
|
|
|
60
73
|
NonSortGroupItem: {
|
|
61
74
|
fontFamily: 'Nunito',
|
|
62
75
|
fontSize: '11px',
|
|
63
|
-
marginRight: '
|
|
76
|
+
marginRight: '32px'
|
|
64
77
|
},
|
|
65
78
|
sortGroupItemCounts: {
|
|
66
79
|
cursor: 'pointer',
|
|
67
80
|
fontFamily: 'Nunito',
|
|
68
81
|
fontSize: '11px',
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
marginTop: '5px'
|
|
82
|
+
marginRight: '19px',
|
|
83
|
+
marginLeft: 'auto'
|
|
84
|
+
// marginTop: '5px',
|
|
85
|
+
// float: 'right',
|
|
72
86
|
},
|
|
87
|
+
|
|
73
88
|
highlight: {
|
|
74
|
-
color: '#
|
|
89
|
+
color: '#b2c6d6'
|
|
75
90
|
},
|
|
76
91
|
showMore: {
|
|
77
92
|
textAlign: 'right',
|
|
78
93
|
paddingRight: '5px',
|
|
79
94
|
cursor: 'pointer',
|
|
80
|
-
fontSize: '
|
|
95
|
+
fontSize: '11px',
|
|
81
96
|
width: '100%'
|
|
82
97
|
},
|
|
83
98
|
searchContainer: {
|
|
@@ -109,11 +124,10 @@ var _default = () => ({
|
|
|
109
124
|
padding: '5px'
|
|
110
125
|
},
|
|
111
126
|
expandedDisplayButton: {
|
|
112
|
-
backgroundColor: '#
|
|
127
|
+
backgroundColor: '#4D889E !important',
|
|
113
128
|
color: 'white',
|
|
114
129
|
width: 'calc(100% - 26px)',
|
|
115
130
|
height: '30px',
|
|
116
|
-
marginTop: '5px',
|
|
117
131
|
marginBottom: '5px',
|
|
118
132
|
marginLeft: '6px',
|
|
119
133
|
borderRadius: '5px',
|
|
@@ -27,9 +27,7 @@ const FacetView = _ref => {
|
|
|
27
27
|
facet,
|
|
28
28
|
onClearFacetSection,
|
|
29
29
|
onClearSliderSection,
|
|
30
|
-
CustomView
|
|
31
|
-
autoComplete,
|
|
32
|
-
upload
|
|
30
|
+
CustomView
|
|
33
31
|
} = _ref;
|
|
34
32
|
const [expand, setExpand] = (0, _react.useState)(facet.expanded !== undefined && typeof facet.expanded === 'boolean' ? facet.expanded : false);
|
|
35
33
|
const onExpandFacet = () => setExpand(!expand);
|
|
@@ -37,11 +35,13 @@ const FacetView = _ref => {
|
|
|
37
35
|
/**
|
|
38
36
|
* expand section incase of active local search
|
|
39
37
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
38
|
+
// useEffect(() => {
|
|
39
|
+
// if ((autoComplete && autoComplete.length > 0)
|
|
40
|
+
// || (upload && upload.length > 0)) {
|
|
41
|
+
// setExpand(true);
|
|
42
|
+
// }
|
|
43
|
+
// }, [autoComplete, upload]);
|
|
44
|
+
|
|
45
45
|
const [sortBy, setSortBy] = (0, _react.useState)(null);
|
|
46
46
|
const onSortFacet = type => {
|
|
47
47
|
setSortBy(type);
|
|
@@ -61,7 +61,7 @@ const FacetView = _ref => {
|
|
|
61
61
|
type,
|
|
62
62
|
facetValues
|
|
63
63
|
} = facet;
|
|
64
|
-
const selectedItems = facetValues && facetValues.filter(item => item
|
|
64
|
+
const selectedItems = facetValues && facetValues.filter(item => item.isChecked);
|
|
65
65
|
const displayFacet = _objectSpread({}, facet);
|
|
66
66
|
displayFacet.facetValues = selectedItems;
|
|
67
67
|
const isActiveFacet = [...selectedItems].length > 0;
|
|
@@ -82,12 +82,12 @@ const FacetView = _ref => {
|
|
|
82
82
|
className: (0, _clsx.default)(classes.subSectionSummaryText, {
|
|
83
83
|
["activeFacet".concat(facet.section)]: isActiveFacet
|
|
84
84
|
})
|
|
85
|
-
}, facet.label)),
|
|
85
|
+
}, facet.label)), facetValues.length === 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
86
86
|
className: classes.NonSortGroup
|
|
87
87
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
88
88
|
className: classes.NonSortGroupItem
|
|
89
89
|
}, "No data for this field")), (facet.type === _Types.InputTypes.SLIDER || facetValues.length > 0) && /*#__PURE__*/_react.default.createElement("div", {
|
|
90
|
-
className: classes.sortGroup
|
|
90
|
+
className: facet.type === _Types.InputTypes.SLIDER ? classes.sortGroupSlider : classes.sortGroup
|
|
91
91
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
92
92
|
className: classes.sortGroupIcon
|
|
93
93
|
}, /*#__PURE__*/_react.default.createElement(_core.Icon, {
|
|
@@ -114,10 +114,10 @@ const FacetView = _ref => {
|
|
|
114
114
|
onClick: () => {
|
|
115
115
|
onSortFacet(_Sort.sortType.NUMERIC);
|
|
116
116
|
}
|
|
117
|
-
}, "Sort by count"))),
|
|
117
|
+
}, "Sort by count"))), /*#__PURE__*/_react.default.createElement(_FilterItems.default, {
|
|
118
118
|
facet: facet,
|
|
119
119
|
sortBy: sortBy
|
|
120
|
-
})), !expand && type === _Types.InputTypes.CHECKBOX &&
|
|
120
|
+
})), !expand && type === _Types.InputTypes.CHECKBOX && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_core.List, {
|
|
121
121
|
id: "filter_Items"
|
|
122
122
|
}, /*#__PURE__*/_react.default.createElement(_FilterItems.default, {
|
|
123
123
|
facet: displayFacet
|
|
@@ -82,7 +82,11 @@ var _default = () => ({
|
|
|
82
82
|
marginBottom: '5px',
|
|
83
83
|
borderTop: '1px solid #B1B1B1',
|
|
84
84
|
textAlign: 'left',
|
|
85
|
-
marginLeft: '-
|
|
85
|
+
marginLeft: '-4px',
|
|
86
|
+
display: 'flex',
|
|
87
|
+
alignItems: 'stretch',
|
|
88
|
+
justifyContent: 'flex-start',
|
|
89
|
+
gap: '8px'
|
|
86
90
|
},
|
|
87
91
|
sortGroupIcon: {
|
|
88
92
|
cursor: 'pointer',
|
|
@@ -112,10 +116,12 @@ var _default = () => ({
|
|
|
112
116
|
cursor: 'pointer',
|
|
113
117
|
fontFamily: 'Nunito',
|
|
114
118
|
fontSize: '10px',
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
marginTop: '5px'
|
|
119
|
+
marginRight: '19px',
|
|
120
|
+
marginLeft: 'auto'
|
|
121
|
+
// marginTop: '5px',
|
|
122
|
+
// float: 'right',
|
|
118
123
|
},
|
|
124
|
+
|
|
119
125
|
itemContainer: {}
|
|
120
126
|
});
|
|
121
127
|
exports.default = _default;
|
|
@@ -10,14 +10,12 @@ var _Actions = require("../../store/actions/Actions");
|
|
|
10
10
|
var _FacetView = _interopRequireDefault(require("./FacetView"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
const ReduxFacetView = props => /*#__PURE__*/_react.default.createElement(_FacetView.default, props);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
};
|
|
13
|
+
|
|
14
|
+
// const mapStateToProps = (state) => ({
|
|
15
|
+
// autoComplete: state?.localFind?.autocomplete || [],
|
|
16
|
+
// upload: state?.localFind?.upload || [],
|
|
17
|
+
// });
|
|
18
|
+
|
|
21
19
|
const mapDispatchToProps = dispatch => ({
|
|
22
20
|
onClearFacetSection: facet => {
|
|
23
21
|
dispatch((0, _Actions.clearFacetSection)(facet));
|
|
@@ -26,5 +24,5 @@ const mapDispatchToProps = dispatch => ({
|
|
|
26
24
|
dispatch((0, _Actions.clearSliderSection)(facet));
|
|
27
25
|
}
|
|
28
26
|
});
|
|
29
|
-
var _default = (0, _reactRedux.connect)(
|
|
27
|
+
var _default = (0, _reactRedux.connect)(null, mapDispatchToProps)(ReduxFacetView);
|
|
30
28
|
exports.default = _default;
|
|
@@ -35,7 +35,7 @@ const searchItems = (items, searchText) => {
|
|
|
35
35
|
const item = items[i];
|
|
36
36
|
for (let j = 0; j < keyList.length; j += 1) {
|
|
37
37
|
const key = keyList[j].trim();
|
|
38
|
-
if (key === '' || item.
|
|
38
|
+
if (key === '' || item.group.toUpperCase().includes(key)) {
|
|
39
39
|
matchedItems.push(item);
|
|
40
40
|
break;
|
|
41
41
|
}
|
|
@@ -72,7 +72,7 @@ const SearchFacetView = _ref => {
|
|
|
72
72
|
datafield,
|
|
73
73
|
section
|
|
74
74
|
} = facet;
|
|
75
|
-
const selectedItems = facetValues && facetValues.filter(item => item
|
|
75
|
+
const selectedItems = facetValues && facetValues.filter(item => item.isChecked);
|
|
76
76
|
const displayFacet = _objectSpread({}, facet);
|
|
77
77
|
displayFacet.facetValues = selectedItems;
|
|
78
78
|
const isActiveFacet = [...selectedItems].length > 0;
|
|
@@ -87,10 +87,14 @@ const SearchFacetView = _ref => {
|
|
|
87
87
|
}),
|
|
88
88
|
datafield: datafield,
|
|
89
89
|
facet: facet
|
|
90
|
+
// queryParams={queryParams}
|
|
90
91
|
}));
|
|
92
|
+
|
|
91
93
|
const newUncheckedFullList = searchItems(sortFilters.filter(item => !item.isChecked), searchText);
|
|
92
94
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ReduxFacetModal.default, {
|
|
93
|
-
facet: facet
|
|
95
|
+
facet: facet
|
|
96
|
+
// queryParams={queryParams}
|
|
97
|
+
,
|
|
94
98
|
open: open,
|
|
95
99
|
onClose: () => setOpen(false)
|
|
96
100
|
}), /*#__PURE__*/_react.default.createElement(_core.Accordion, {
|
|
@@ -109,7 +113,7 @@ const SearchFacetView = _ref => {
|
|
|
109
113
|
className: (0, _clsx.default)(classes.subSectionSummaryText, {
|
|
110
114
|
["activeFacet".concat(facet.section)]: isActiveFacet
|
|
111
115
|
})
|
|
112
|
-
}, facet.label)),
|
|
116
|
+
}, facet.label)), facetValues.length === 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
113
117
|
className: classes.NonSortGroup
|
|
114
118
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
115
119
|
className: classes.NonSortGroupItem
|
|
@@ -168,14 +172,13 @@ const SearchFacetView = _ref => {
|
|
|
168
172
|
onClick: () => {
|
|
169
173
|
onSortChange(facet.datafield, _Sort.sortType.NUMERIC);
|
|
170
174
|
}
|
|
171
|
-
}, "Sort by count")),
|
|
175
|
+
}, "Sort by count")), /*#__PURE__*/_react.default.createElement(_SearchFilterItems.default, {
|
|
172
176
|
searchText: searchText,
|
|
173
177
|
facet: facet,
|
|
174
178
|
sortBy: sortBy
|
|
175
|
-
})))
|
|
179
|
+
}))), !expand && type === _Types.InputTypes.CHECKBOX && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_core.List, {
|
|
176
180
|
id: "filter_Items"
|
|
177
181
|
}, /*#__PURE__*/_react.default.createElement(_FilterItems.default, {
|
|
178
|
-
searchText: searchText,
|
|
179
182
|
facet: displayFacet
|
|
180
183
|
}))), !expand && selectedItems.length > limitCheckBoxCount && /*#__PURE__*/_react.default.createElement("div", {
|
|
181
184
|
className: classes.showMore,
|
|
@@ -10,29 +10,36 @@ var _default = () => ({
|
|
|
10
10
|
marginBottom: '5px',
|
|
11
11
|
borderTop: '1px solid #B1B1B1',
|
|
12
12
|
textAlign: 'left',
|
|
13
|
-
marginLeft: '-
|
|
13
|
+
marginLeft: '-4px',
|
|
14
|
+
display: 'flex',
|
|
15
|
+
alignItems: 'stretch',
|
|
16
|
+
justifyContent: 'flex-start',
|
|
17
|
+
gap: '8px'
|
|
14
18
|
},
|
|
15
19
|
sortGroupIcon: {
|
|
16
20
|
cursor: 'pointer',
|
|
17
21
|
fontFamily: 'Nunito',
|
|
18
|
-
fontSize: '
|
|
22
|
+
fontSize: '11px',
|
|
19
23
|
marginRight: '12px',
|
|
20
|
-
marginLeft: '
|
|
24
|
+
marginLeft: '24px'
|
|
21
25
|
},
|
|
22
26
|
sortGroupItem: {
|
|
23
27
|
cursor: 'pointer',
|
|
24
28
|
fontFamily: 'Nunito',
|
|
25
|
-
fontSize: '
|
|
26
|
-
marginRight: '32px'
|
|
29
|
+
fontSize: '11px'
|
|
30
|
+
// marginRight: '32px',
|
|
27
31
|
},
|
|
32
|
+
|
|
28
33
|
sortGroupItemCounts: {
|
|
29
34
|
cursor: 'pointer',
|
|
30
35
|
fontFamily: 'Nunito',
|
|
31
|
-
fontSize: '
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
marginTop: '5px'
|
|
36
|
+
fontSize: '11px',
|
|
37
|
+
marginRight: '19px',
|
|
38
|
+
marginLeft: 'auto'
|
|
39
|
+
// marginTop: '5px',
|
|
40
|
+
// float: 'right',
|
|
35
41
|
},
|
|
42
|
+
|
|
36
43
|
itemsContainer: {
|
|
37
44
|
maxHeight: '400px',
|
|
38
45
|
overflowY: 'auto',
|
|
@@ -10,7 +10,11 @@ var _default = () => ({
|
|
|
10
10
|
marginBottom: '5px',
|
|
11
11
|
borderTop: '1px solid #B1B1B1',
|
|
12
12
|
textAlign: 'left',
|
|
13
|
-
marginLeft: '-
|
|
13
|
+
marginLeft: '-4px',
|
|
14
|
+
display: 'flex',
|
|
15
|
+
alignItems: 'stretch',
|
|
16
|
+
justifyContent: 'flex-start',
|
|
17
|
+
gap: '8px'
|
|
14
18
|
},
|
|
15
19
|
highlight: {
|
|
16
20
|
color: '#b2c6d6'
|
|
@@ -18,24 +22,23 @@ var _default = () => ({
|
|
|
18
22
|
sortGroupIcon: {
|
|
19
23
|
cursor: 'pointer',
|
|
20
24
|
fontFamily: 'Nunito',
|
|
21
|
-
fontSize: '
|
|
25
|
+
fontSize: '11px',
|
|
22
26
|
marginRight: '12px',
|
|
23
27
|
marginLeft: 'auto'
|
|
24
28
|
},
|
|
25
29
|
sortGroupItem: {
|
|
26
30
|
cursor: 'pointer',
|
|
27
31
|
fontFamily: 'Nunito',
|
|
28
|
-
|
|
29
|
-
fontWeight: '400'
|
|
30
|
-
marginRight: '32px'
|
|
32
|
+
fontSize: '11px',
|
|
33
|
+
fontWeight: '400'
|
|
31
34
|
},
|
|
32
35
|
sortGroupItemCounts: {
|
|
33
36
|
cursor: 'pointer',
|
|
34
37
|
fontFamily: 'Nunito',
|
|
35
38
|
fontSize: '11px',
|
|
36
39
|
fontWeight: '400',
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
marginRight: '18px',
|
|
41
|
+
marginLeft: 'auto'
|
|
39
42
|
},
|
|
40
43
|
checkboxContainer: {
|
|
41
44
|
height: '528px'
|
|
@@ -6,13 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _default = () => ({
|
|
8
8
|
listItemGutters: {
|
|
9
|
-
padding: '10px
|
|
10
|
-
},
|
|
11
|
-
listItemRoot: {
|
|
12
|
-
cursor: 'pointer'
|
|
9
|
+
padding: '10px 10px 10px 0px'
|
|
13
10
|
},
|
|
14
11
|
checkboxRoot: {
|
|
15
|
-
marginLeft: '
|
|
12
|
+
marginLeft: '8px',
|
|
16
13
|
height: 12
|
|
17
14
|
},
|
|
18
15
|
panelDetailText: {
|
|
@@ -33,11 +30,11 @@ var _default = () => ({
|
|
|
33
30
|
checkboxName: {
|
|
34
31
|
margin: '0',
|
|
35
32
|
color: '#000000',
|
|
36
|
-
fontSize: '
|
|
33
|
+
fontSize: '16px',
|
|
34
|
+
fontWeight: 300,
|
|
37
35
|
marginTop: '1.5px',
|
|
38
36
|
fontFamily: 'Nunito',
|
|
39
|
-
lineHeight: '120%'
|
|
40
|
-
wordBreak: 'break-word'
|
|
37
|
+
lineHeight: '120%'
|
|
41
38
|
}
|
|
42
39
|
});
|
|
43
40
|
exports.default = _default;
|