@bento-core/facet-filter 1.0.1-c3dc.8 → 1.0.1-c3dc.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.
- package/dist/NewFacetFilterController.js +212 -0
- package/dist/NewFacetFilterView.js +49 -0
- package/dist/components/facet/FacetModal.js +1 -7
- package/dist/components/facet/NewFacetStyle.js +231 -0
- package/dist/components/facet/NewFacetView.js +194 -0
- package/dist/components/facet/NewSearchFacetView.js +212 -0
- package/dist/components/facet/ReduxNewFacetView.js +35 -0
- package/dist/components/facet/ReduxNewSearchFacetView.js +42 -0
- package/dist/components/facet/SearchFacetView.js +1 -7
- package/dist/components/inputs/FilterItems.js +12 -5
- package/dist/components/inputs/slider/ReduxSlider.js +9 -4
- package/dist/components/inputs/slider/SliderView.js +262 -30
- package/dist/index.js +25 -0
- package/dist/store/actions/ActionTypes.js +4 -1
- package/dist/store/actions/Actions.js +23 -2
- package/dist/store/reducers/SideBarReducer.js +43 -4
- package/dist/utils/filter.js +21 -7
- package/package.json +4 -2
- package/src/NewFacetFilterController.js +209 -0
- package/src/NewFacetFilterView.js +56 -0
- package/src/components/facet/FacetModal.js +0 -6
- package/src/components/facet/NewFacetStyle.js +229 -0
- package/src/components/facet/NewFacetView.js +265 -0
- package/src/components/facet/NewSearchFacetView.js +293 -0
- package/src/components/facet/ReduxNewFacetView.js +27 -0
- package/src/components/facet/ReduxNewSearchFacetView.js +36 -0
- package/src/components/facet/SearchFacetView.js +0 -6
- package/src/components/inputs/FilterItems.js +6 -1
- package/src/components/inputs/slider/ReduxSlider.js +5 -1
- package/src/components/inputs/slider/SliderView.js +297 -36
- package/src/index.js +4 -1
- package/src/store/actions/ActionTypes.js +3 -0
- package/src/store/actions/Actions.js +21 -0
- package/src/store/reducers/SideBarReducer.js +41 -0
- package/src/utils/filter.js +18 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _reactRedux = require("react-redux");
|
|
10
|
+
var _Types = require("./components/inputs/Types");
|
|
11
|
+
var _NewFacetFilterView = _interopRequireDefault(require("./NewFacetFilterView"));
|
|
12
|
+
const _excluded = ["section"];
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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
|
+
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
|
+
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
|
+
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
21
|
+
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); }
|
|
22
|
+
const NewFacetFilterController = props => {
|
|
23
|
+
/**
|
|
24
|
+
* update checkbox state
|
|
25
|
+
* 1. checkbox state
|
|
26
|
+
* 2. subject state
|
|
27
|
+
*/
|
|
28
|
+
const {
|
|
29
|
+
activeFilters,
|
|
30
|
+
data,
|
|
31
|
+
facetsConfig,
|
|
32
|
+
facetSectionConfig,
|
|
33
|
+
selectedSection,
|
|
34
|
+
unknownAgesState,
|
|
35
|
+
searchFacetClasses
|
|
36
|
+
} = props;
|
|
37
|
+
|
|
38
|
+
// console.log(activeFilters);
|
|
39
|
+
const filterState = Object.entries(activeFilters).reduce((acc, _ref) => {
|
|
40
|
+
let [key, value] = _ref;
|
|
41
|
+
if (key !== 'participant_ids') {
|
|
42
|
+
return _objectSpread(_objectSpread({}, acc), {}, {
|
|
43
|
+
[key]: value
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return acc;
|
|
47
|
+
}, {});
|
|
48
|
+
const updateFacetState = filterSections => {
|
|
49
|
+
if (!_lodash.default.isEmpty(filterState)) {
|
|
50
|
+
return filterSections.map(sideBar => {
|
|
51
|
+
const filterValue = filterState[sideBar.datafield];
|
|
52
|
+
if (!filterValue) {
|
|
53
|
+
return sideBar;
|
|
54
|
+
}
|
|
55
|
+
if (sideBar.type === _Types.InputTypes.CHECKBOX) {
|
|
56
|
+
return _objectSpread(_objectSpread({}, sideBar), {}, {
|
|
57
|
+
facetValues: sideBar.facetValues.map(item => _objectSpread(_objectSpread({}, item), {}, {
|
|
58
|
+
isChecked: filterValue.indexOf(item.name) > -1
|
|
59
|
+
}))
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (sideBar.type === _Types.InputTypes.SLIDER) {
|
|
63
|
+
return _objectSpread(_objectSpread({}, sideBar), {}, {
|
|
64
|
+
facetValues: filterValue
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return sideBar;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return filterSections.map(sideBar => {
|
|
71
|
+
if (sideBar.type === _Types.InputTypes.CHECKBOX) {
|
|
72
|
+
return _objectSpread(_objectSpread({}, sideBar), {}, {
|
|
73
|
+
facetValues: sideBar.facetValues.map(item => _objectSpread(_objectSpread({}, item), {}, {
|
|
74
|
+
isChecked: false
|
|
75
|
+
}))
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* set default value for slider - on clear all filter
|
|
80
|
+
*/
|
|
81
|
+
if (sideBar.type === _Types.InputTypes.SLIDER) {
|
|
82
|
+
const {
|
|
83
|
+
minLowerBound,
|
|
84
|
+
maxUpperBound
|
|
85
|
+
} = sideBar;
|
|
86
|
+
return _objectSpread(_objectSpread({}, sideBar), {}, {
|
|
87
|
+
facetValues: [minLowerBound, maxUpperBound]
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return sideBar;
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
const arrangeBySections = arr => {
|
|
94
|
+
const sideBar = {};
|
|
95
|
+
arr.forEach(_ref2 => {
|
|
96
|
+
let {
|
|
97
|
+
section
|
|
98
|
+
} = _ref2,
|
|
99
|
+
item = _objectWithoutProperties(_ref2, _excluded);
|
|
100
|
+
const {
|
|
101
|
+
isExpanded
|
|
102
|
+
} = facetSectionConfig[section];
|
|
103
|
+
if (!sideBar[section]) {
|
|
104
|
+
sideBar[section] = {
|
|
105
|
+
name: section,
|
|
106
|
+
sectionName: section,
|
|
107
|
+
expandSection: isExpanded !== undefined && typeof isExpanded === 'boolean' ? isExpanded : true,
|
|
108
|
+
items: []
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
sideBar[section] = _objectSpread(_objectSpread({}, sideBar[section]), {}, {
|
|
112
|
+
items: [...sideBar[section].items, _objectSpread({
|
|
113
|
+
section
|
|
114
|
+
}, item)]
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
return Object.values(sideBar);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Construct filter object
|
|
122
|
+
* 1. add facet values to facets
|
|
123
|
+
* 2. add 'name' key to each facet value
|
|
124
|
+
*/
|
|
125
|
+
const addFacetValues = facets => {
|
|
126
|
+
if (!facets) {
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
return facets.map(facet => {
|
|
130
|
+
const updateFacet = _objectSpread(_objectSpread({}, facet), {}, {
|
|
131
|
+
facetValues: []
|
|
132
|
+
});
|
|
133
|
+
const {
|
|
134
|
+
field,
|
|
135
|
+
ApiLowerBoundName,
|
|
136
|
+
ApiUpperBoundName,
|
|
137
|
+
apiForFiltering
|
|
138
|
+
} = updateFacet;
|
|
139
|
+
if (!data[apiForFiltering]) {
|
|
140
|
+
return updateFacet;
|
|
141
|
+
}
|
|
142
|
+
if (Array.isArray(data[apiForFiltering])) {
|
|
143
|
+
const validValues = [];
|
|
144
|
+
const updateField = data[apiForFiltering].map(item => {
|
|
145
|
+
const addField = _objectSpread(_objectSpread({}, item), {}, {
|
|
146
|
+
name: item[field]
|
|
147
|
+
});
|
|
148
|
+
validValues.push(addField.name);
|
|
149
|
+
return addField;
|
|
150
|
+
});
|
|
151
|
+
/**
|
|
152
|
+
* Check if there are orphan filter values and add them to the facet values
|
|
153
|
+
*/
|
|
154
|
+
let finalUpdateField = updateField;
|
|
155
|
+
if (filterState !== undefined) {
|
|
156
|
+
const facetFilter = filterState[facet.datafield];
|
|
157
|
+
if (facetFilter) {
|
|
158
|
+
const orphanValues = facetFilter.filter(item => validValues.indexOf(item) === -1).map(item => ({
|
|
159
|
+
group: item,
|
|
160
|
+
name: item,
|
|
161
|
+
subjects: 0
|
|
162
|
+
}));
|
|
163
|
+
finalUpdateField = [...updateField, ...orphanValues];
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return _objectSpread(_objectSpread({}, updateFacet), {}, {
|
|
167
|
+
facetValues: finalUpdateField
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* add object to facet values
|
|
173
|
+
*/
|
|
174
|
+
if (facet.type === _Types.InputTypes.SLIDER) {
|
|
175
|
+
const lowerBound = data[apiForFiltering][ApiLowerBoundName];
|
|
176
|
+
const upperBound = data[apiForFiltering][ApiUpperBoundName];
|
|
177
|
+
const unknownAges = (unknownAgesState === null || unknownAgesState === void 0 ? void 0 : unknownAgesState[facet.datafield]) || 'include';
|
|
178
|
+
return _objectSpread(_objectSpread({}, updateFacet), {}, {
|
|
179
|
+
minLowerBound: lowerBound,
|
|
180
|
+
maxUpperBound: upperBound,
|
|
181
|
+
unknownAges,
|
|
182
|
+
facetValues: [lowerBound, upperBound],
|
|
183
|
+
style: facet.style
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
return updateFacet;
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Generate facet sections state
|
|
192
|
+
*
|
|
193
|
+
*/
|
|
194
|
+
// const displayFacets = facetsConfig.filter((facet) => facet.show).slice(0, 16);
|
|
195
|
+
const displayFacets = facetsConfig.filter(facet => facet.show);
|
|
196
|
+
const facetStates = addFacetValues(displayFacets);
|
|
197
|
+
const updateState = updateFacetState(facetStates);
|
|
198
|
+
const facetSections = arrangeBySections(updateState);
|
|
199
|
+
const facetSection = facetSections[selectedSection];
|
|
200
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_NewFacetFilterView.default, _extends({}, props, {
|
|
201
|
+
facetSection: facetSection,
|
|
202
|
+
searchFacetClasses: searchFacetClasses
|
|
203
|
+
})));
|
|
204
|
+
};
|
|
205
|
+
const mapStateToProps = state => {
|
|
206
|
+
var _state$statusReducer;
|
|
207
|
+
return {
|
|
208
|
+
unknownAgesState: (state === null || state === void 0 ? void 0 : (_state$statusReducer = state.statusReducer) === null || _state$statusReducer === void 0 ? void 0 : _state$statusReducer.unknownAgesState) || {}
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
var _default = (0, _reactRedux.connect)(mapStateToProps, null)(NewFacetFilterController);
|
|
212
|
+
exports.default = _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _core = require("@material-ui/core");
|
|
9
|
+
var _FacetFilterStyle = _interopRequireDefault(require("./FacetFilterStyle"));
|
|
10
|
+
var _ReduxNewFacetView = _interopRequireDefault(require("./components/facet/ReduxNewFacetView"));
|
|
11
|
+
var _FilterItems = _interopRequireDefault(require("./components/inputs/FilterItems"));
|
|
12
|
+
var _ReduxNewSearchFacetView = _interopRequireDefault(require("./components/facet/ReduxNewSearchFacetView"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
/* eslint-disable arrow-body-style */
|
|
15
|
+
/* eslint-disable padded-blocks */
|
|
16
|
+
|
|
17
|
+
const BentoFacetFilter = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
facetSection,
|
|
20
|
+
CustomFacetSection,
|
|
21
|
+
CustomFacetView,
|
|
22
|
+
queryParams,
|
|
23
|
+
searchFacetClasses
|
|
24
|
+
} = _ref;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, CustomFacetSection && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(CustomFacetSection, {
|
|
26
|
+
section: facetSection,
|
|
27
|
+
expanded: true
|
|
28
|
+
})), facetSection.items.map(facet => {
|
|
29
|
+
if (facet.search) {
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_ReduxNewSearchFacetView.default, {
|
|
31
|
+
facet: facet,
|
|
32
|
+
queryParams: queryParams,
|
|
33
|
+
CustomView: CustomFacetView,
|
|
34
|
+
classes: searchFacetClasses
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_ReduxNewFacetView.default, {
|
|
38
|
+
facet: facet,
|
|
39
|
+
queryParams: queryParams,
|
|
40
|
+
CustomView: CustomFacetView
|
|
41
|
+
}, /*#__PURE__*/_react.default.createElement(_core.List, {
|
|
42
|
+
className: "List_".concat(facet.label)
|
|
43
|
+
}, /*#__PURE__*/_react.default.createElement(_FilterItems.default, {
|
|
44
|
+
facet: facet
|
|
45
|
+
})));
|
|
46
|
+
}));
|
|
47
|
+
};
|
|
48
|
+
var _default = (0, _core.withStyles)(_FacetFilterStyle.default)(BentoFacetFilter);
|
|
49
|
+
exports.default = _default;
|
|
@@ -46,13 +46,7 @@ const ModalView = _ref => {
|
|
|
46
46
|
}, "".concat(facet.label, " Facet Search")), /*#__PURE__*/_react.default.createElement(_core.IconButton, {
|
|
47
47
|
"aria-label": "close",
|
|
48
48
|
onClick: onClose,
|
|
49
|
-
className: classes.closeButton
|
|
50
|
-
sx: theme => ({
|
|
51
|
-
position: 'absolute',
|
|
52
|
-
right: 8,
|
|
53
|
-
top: 8,
|
|
54
|
-
color: theme.palette.grey[500]
|
|
55
|
-
})
|
|
49
|
+
className: classes.closeButton
|
|
56
50
|
}, /*#__PURE__*/_react.default.createElement(_Close.default, {
|
|
57
51
|
fontSize: "small"
|
|
58
52
|
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
11
|
+
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); }
|
|
12
|
+
var _default = () => ({
|
|
13
|
+
expansionPanelDetailsRoot: {
|
|
14
|
+
display: 'block'
|
|
15
|
+
},
|
|
16
|
+
expansionPanelsideBarItem: {
|
|
17
|
+
boxShadow: 'none',
|
|
18
|
+
marginTop: '8px',
|
|
19
|
+
margin: 'auto',
|
|
20
|
+
position: 'initial',
|
|
21
|
+
'&:before': {
|
|
22
|
+
position: 'initial'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
subSectionSummaryText: {
|
|
26
|
+
marginLeft: '10px',
|
|
27
|
+
color: '#323232',
|
|
28
|
+
fontFamily: 'Raleway',
|
|
29
|
+
fontSize: '13px',
|
|
30
|
+
fontWeight: 'bold',
|
|
31
|
+
letterSpacing: '0.25px'
|
|
32
|
+
},
|
|
33
|
+
sortGroup: {
|
|
34
|
+
paddingTop: '10px',
|
|
35
|
+
marginBottom: '5px',
|
|
36
|
+
textAlign: 'left',
|
|
37
|
+
marginLeft: '-5px',
|
|
38
|
+
borderTop: 'none',
|
|
39
|
+
display: 'flex',
|
|
40
|
+
alignItems: 'center'
|
|
41
|
+
},
|
|
42
|
+
sortGroupIcon: {
|
|
43
|
+
cursor: 'pointer',
|
|
44
|
+
fontFamily: 'Nunito',
|
|
45
|
+
fontSize: '10px',
|
|
46
|
+
marginRight: '12px',
|
|
47
|
+
marginLeft: '24px'
|
|
48
|
+
},
|
|
49
|
+
sortGroupItem: {
|
|
50
|
+
cursor: 'pointer',
|
|
51
|
+
fontFamily: 'Nunito',
|
|
52
|
+
fontSize: '10px',
|
|
53
|
+
marginRight: '32px'
|
|
54
|
+
},
|
|
55
|
+
NonSortGroup: {
|
|
56
|
+
marginBottom: '5px',
|
|
57
|
+
borderTop: '1px solid #B1B1B1',
|
|
58
|
+
textAlign: 'left',
|
|
59
|
+
paddingLeft: '10px'
|
|
60
|
+
},
|
|
61
|
+
NonSortGroupItem: {
|
|
62
|
+
fontFamily: 'Nunito',
|
|
63
|
+
fontSize: '10px',
|
|
64
|
+
marginRight: '32px'
|
|
65
|
+
},
|
|
66
|
+
sortGroupItemCounts: {
|
|
67
|
+
marginLeft: 'auto',
|
|
68
|
+
marginRight: '15px',
|
|
69
|
+
cursor: 'pointer',
|
|
70
|
+
fontFamily: 'Nunito',
|
|
71
|
+
fontSize: '10px'
|
|
72
|
+
},
|
|
73
|
+
highlight: {
|
|
74
|
+
color: '#b2c6d6'
|
|
75
|
+
},
|
|
76
|
+
showMore: {
|
|
77
|
+
textAlign: 'right',
|
|
78
|
+
paddingRight: '5px',
|
|
79
|
+
cursor: 'pointer',
|
|
80
|
+
fontSize: '10px',
|
|
81
|
+
width: '100%'
|
|
82
|
+
},
|
|
83
|
+
searchContainer: {
|
|
84
|
+
display: 'flex',
|
|
85
|
+
justifyContent: 'center',
|
|
86
|
+
position: 'relative'
|
|
87
|
+
},
|
|
88
|
+
searchBox: {
|
|
89
|
+
fontSize: '14px',
|
|
90
|
+
fontFamily: 'Nunito',
|
|
91
|
+
width: 'calc(100% - 26px)',
|
|
92
|
+
height: '30px',
|
|
93
|
+
marginTop: '12px',
|
|
94
|
+
borderRadius: '5px',
|
|
95
|
+
marginLeft: '6px',
|
|
96
|
+
border: '1px solid',
|
|
97
|
+
padding: '5px'
|
|
98
|
+
},
|
|
99
|
+
searchBoxWithText: {
|
|
100
|
+
fontSize: '14px',
|
|
101
|
+
fontFamily: 'Nunito',
|
|
102
|
+
width: 'calc(100% - 26px)',
|
|
103
|
+
height: '30px',
|
|
104
|
+
marginTop: '12px',
|
|
105
|
+
borderRadius: '5px',
|
|
106
|
+
marginLeft: '6px',
|
|
107
|
+
border: '1px solid',
|
|
108
|
+
padding: '5px'
|
|
109
|
+
},
|
|
110
|
+
expandedDisplayButton: {
|
|
111
|
+
display: 'flex',
|
|
112
|
+
alignItems: 'center',
|
|
113
|
+
justifyContent: 'space-between',
|
|
114
|
+
backgroundColor: '#4D889E !important',
|
|
115
|
+
color: 'white',
|
|
116
|
+
width: 'calc(100% - 26px)',
|
|
117
|
+
height: '30px',
|
|
118
|
+
marginBottom: '5px',
|
|
119
|
+
marginLeft: '6px',
|
|
120
|
+
padding: '6px 11px',
|
|
121
|
+
borderRadius: '5px',
|
|
122
|
+
fontFamily: 'Nunito',
|
|
123
|
+
fontSize: '11px',
|
|
124
|
+
fontWeight: '600',
|
|
125
|
+
top: '8px'
|
|
126
|
+
},
|
|
127
|
+
expandedDisplayCount: {
|
|
128
|
+
marginLeft: '4px',
|
|
129
|
+
fontFamily: 'Nunito',
|
|
130
|
+
fontSize: '11px',
|
|
131
|
+
fontWeight: '600',
|
|
132
|
+
lineHeight: '17px',
|
|
133
|
+
color: '#ffffff',
|
|
134
|
+
backgroundColor: '#5D98AE',
|
|
135
|
+
padding: '1px 2px'
|
|
136
|
+
},
|
|
137
|
+
clearTextButton: {
|
|
138
|
+
padding: '0px',
|
|
139
|
+
height: '20px',
|
|
140
|
+
position: 'absolute',
|
|
141
|
+
right: '14px',
|
|
142
|
+
top: '16px'
|
|
143
|
+
},
|
|
144
|
+
timeUnitToggle: {
|
|
145
|
+
marginLeft: '8px',
|
|
146
|
+
marginRight: '20px',
|
|
147
|
+
height: '32px',
|
|
148
|
+
'& .MuiToggleButtonGroup-grouped': {
|
|
149
|
+
borderRadius: '8px',
|
|
150
|
+
'&:not(:first-child)': {
|
|
151
|
+
marginLeft: '0px',
|
|
152
|
+
borderLeft: '1px solid #D3D3D3',
|
|
153
|
+
borderTopLeftRadius: '0px',
|
|
154
|
+
borderBottomLeftRadius: '0px'
|
|
155
|
+
},
|
|
156
|
+
'&:not(:last-child)': {
|
|
157
|
+
borderTopRightRadius: '0px',
|
|
158
|
+
borderBottomRightRadius: '0px'
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
toggleButton: props => {
|
|
163
|
+
const primaryColor = props.facet && props.facet.style && props.facet.style.colorPrimary ? props.facet.style.colorPrimary.color : '#3f51b5';
|
|
164
|
+
const defaultStyles = {
|
|
165
|
+
fontFamily: 'Poppins !important',
|
|
166
|
+
fontSize: '11px !important',
|
|
167
|
+
fontWeight: '400 !important',
|
|
168
|
+
fontStyle: 'normal !important',
|
|
169
|
+
lineHeight: '100% !important',
|
|
170
|
+
letterSpacing: '0.02em !important',
|
|
171
|
+
padding: '6px 24px',
|
|
172
|
+
textTransform: 'uppercase !important',
|
|
173
|
+
border: '1px solid #D3D3D3',
|
|
174
|
+
borderRadius: '8px',
|
|
175
|
+
backgroundColor: '#EDEDED',
|
|
176
|
+
color: '#000000',
|
|
177
|
+
'& .MuiToggleButton-label': {
|
|
178
|
+
fontFamily: 'Poppins !important',
|
|
179
|
+
fontSize: '11px !important',
|
|
180
|
+
fontWeight: '400 !important',
|
|
181
|
+
lineHeight: '100% !important',
|
|
182
|
+
letterSpacing: '0.02em !important',
|
|
183
|
+
textTransform: 'uppercase !important'
|
|
184
|
+
},
|
|
185
|
+
'&:hover': {
|
|
186
|
+
backgroundColor: '#E0E0E0'
|
|
187
|
+
},
|
|
188
|
+
'&.Mui-disabled': {
|
|
189
|
+
backgroundColor: '#F5F5F5',
|
|
190
|
+
color: '#BDBDBD',
|
|
191
|
+
border: '1px solid #E0E0E0',
|
|
192
|
+
cursor: 'not-allowed',
|
|
193
|
+
'& .MuiToggleButton-label': {
|
|
194
|
+
color: '#BDBDBD'
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
'&.Mui-selected': {
|
|
198
|
+
backgroundColor: primaryColor,
|
|
199
|
+
color: '#FFFFFF',
|
|
200
|
+
'& .MuiToggleButton-label': {
|
|
201
|
+
fontFamily: 'Poppins !important',
|
|
202
|
+
fontSize: '11px !important',
|
|
203
|
+
fontWeight: '400 !important',
|
|
204
|
+
lineHeight: '100% !important',
|
|
205
|
+
letterSpacing: '0.02em !important',
|
|
206
|
+
textTransform: 'uppercase !important'
|
|
207
|
+
},
|
|
208
|
+
'&:hover': {
|
|
209
|
+
backgroundColor: primaryColor
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
// Merge custom styles with defaults
|
|
215
|
+
return props.facet.style && props.facet.style.toggleButton ? _objectSpread(_objectSpread({}, defaultStyles), props.facet.style.toggleButton) : defaultStyles;
|
|
216
|
+
},
|
|
217
|
+
toggleButtonSelected: props => {
|
|
218
|
+
const primaryColor = props.facet && props.facet.style && props.facet.style.colorPrimary ? props.facet.style.colorPrimary.color : '#3f51b5';
|
|
219
|
+
const defaultStyles = {
|
|
220
|
+
backgroundColor: primaryColor,
|
|
221
|
+
color: '#FFFFFF !important',
|
|
222
|
+
'&:hover': {
|
|
223
|
+
backgroundColor: primaryColor
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
// Merge custom styles with defaults
|
|
228
|
+
return props.facet.style && props.facet.style.toggleButtonSelected ? _objectSpread(_objectSpread({}, defaultStyles), props.facet.style.toggleButtonSelected) : defaultStyles;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
exports.default = _default;
|