@bento-core/facet-filter 1.0.1-ccdihub.1 → 1.0.1-ccdihub.3
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 +1 -0
- package/dist/components/facet/FacetView.js +1 -1
- package/dist/components/inputs/slider/SliderView.js +118 -2
- package/package.json +1 -1
- package/src/FacetFilterController.js +1 -0
- package/src/components/facet/FacetView.js +1 -1
- package/src/components/inputs/slider/SliderView.js +122 -4
|
@@ -128,6 +128,7 @@ const FacetFilterController = props => {
|
|
|
128
128
|
updateFacet.minLowerBound = lowerBound;
|
|
129
129
|
updateFacet.maxUpperBound = upperBound;
|
|
130
130
|
updateFacet.facetValues = [lowerBound, upperBound];
|
|
131
|
+
updateFacet.style = facet.style;
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
134
|
updateFacets.push(updateFacet);
|
|
@@ -82,7 +82,7 @@ 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
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _core = require("@material-ui/core");
|
|
9
|
-
var _SliderStyle = _interopRequireDefault(require("./SliderStyle"));
|
|
10
9
|
var _Types = require("../Types");
|
|
11
10
|
var _InputMinMaxView = _interopRequireDefault(require("./InputMinMaxView"));
|
|
12
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -112,5 +111,122 @@ const SliderView = _ref => {
|
|
|
112
111
|
className: isValid() ? classes.sliderText : classes.invalidSliderText
|
|
113
112
|
}, sliderValue[0], ' - ', sliderValue[1], "\xA0", quantifier));
|
|
114
113
|
};
|
|
115
|
-
|
|
114
|
+
const styles = () => ({
|
|
115
|
+
sliderRoot: props => props.facet.style && props.facet.style.sliderRoot ? props.facet.style.sliderRoot : {
|
|
116
|
+
marginTop: '10px',
|
|
117
|
+
marginLeft: '20px',
|
|
118
|
+
marginRight: 'Auto',
|
|
119
|
+
paddingRight: '20px'
|
|
120
|
+
},
|
|
121
|
+
minValue: props => ({
|
|
122
|
+
fontFamily: 'Nunito',
|
|
123
|
+
fontSize: '15px',
|
|
124
|
+
color: '#000000',
|
|
125
|
+
marginBottom: '0px',
|
|
126
|
+
float: 'left',
|
|
127
|
+
width: '75px',
|
|
128
|
+
display: 'flex'
|
|
129
|
+
}),
|
|
130
|
+
maxValue: props => ({
|
|
131
|
+
fontFamily: 'Nunito',
|
|
132
|
+
fontSize: '15px',
|
|
133
|
+
color: '#000000',
|
|
134
|
+
float: 'right',
|
|
135
|
+
marginBottom: '0px',
|
|
136
|
+
display: 'flex'
|
|
137
|
+
}),
|
|
138
|
+
rail: props => ({
|
|
139
|
+
borderRadius: 4,
|
|
140
|
+
height: 6,
|
|
141
|
+
background: '#142D64'
|
|
142
|
+
}),
|
|
143
|
+
minInputLabel: props => ({
|
|
144
|
+
float: 'left',
|
|
145
|
+
lineHeight: '34px',
|
|
146
|
+
marginRight: '5px'
|
|
147
|
+
}),
|
|
148
|
+
maxInputLabel: props => ({
|
|
149
|
+
float: 'left',
|
|
150
|
+
lineHeight: '34px',
|
|
151
|
+
marginRight: '5px'
|
|
152
|
+
}),
|
|
153
|
+
thumb: props => ({
|
|
154
|
+
height: 16,
|
|
155
|
+
width: 16,
|
|
156
|
+
background: '#10A075'
|
|
157
|
+
}),
|
|
158
|
+
invalidThumb: props => ({
|
|
159
|
+
height: 16,
|
|
160
|
+
width: 16,
|
|
161
|
+
background: '#F44336'
|
|
162
|
+
}),
|
|
163
|
+
track: props => ({
|
|
164
|
+
borderRadius: 4,
|
|
165
|
+
height: 6,
|
|
166
|
+
background: '#10A075',
|
|
167
|
+
'&~&': {
|
|
168
|
+
background: '#142D64'
|
|
169
|
+
}
|
|
170
|
+
}),
|
|
171
|
+
invalidTrack: props => ({
|
|
172
|
+
borderRadius: 4,
|
|
173
|
+
height: 6,
|
|
174
|
+
background: '#F44336',
|
|
175
|
+
'&~&': {
|
|
176
|
+
background: '#142D64'
|
|
177
|
+
}
|
|
178
|
+
}),
|
|
179
|
+
upperBound: props => ({
|
|
180
|
+
fontFamily: 'Nunito',
|
|
181
|
+
fontSize: '10px',
|
|
182
|
+
color: '#000000',
|
|
183
|
+
float: 'right',
|
|
184
|
+
marginLeft: 'Auto',
|
|
185
|
+
marginRight: 'Auto',
|
|
186
|
+
marginBottom: '15px'
|
|
187
|
+
}),
|
|
188
|
+
lowerBound: props => ({
|
|
189
|
+
fontFamily: 'Nunito',
|
|
190
|
+
fontSize: '10px',
|
|
191
|
+
color: '#000000',
|
|
192
|
+
float: 'left',
|
|
193
|
+
marginLeft: 'Auto',
|
|
194
|
+
marginRight: 'Auto',
|
|
195
|
+
marginBottom: '15px'
|
|
196
|
+
}),
|
|
197
|
+
sliderText: props => ({
|
|
198
|
+
color: '#10a075',
|
|
199
|
+
lineHeight: '120%',
|
|
200
|
+
fontFamily: 'Nunito',
|
|
201
|
+
fontSize: '14px',
|
|
202
|
+
padding: '5px 15px 5px 0px',
|
|
203
|
+
width: '100%',
|
|
204
|
+
textAlign: 'right',
|
|
205
|
+
background: '#f5fdee',
|
|
206
|
+
marginTop: '10px'
|
|
207
|
+
}),
|
|
208
|
+
invalidSliderText: props => ({
|
|
209
|
+
color: '#D32F2F',
|
|
210
|
+
lineHeight: '120%',
|
|
211
|
+
fontFamily: 'Nunito',
|
|
212
|
+
fontSize: '14px',
|
|
213
|
+
padding: '5px 15px 5px 0px',
|
|
214
|
+
width: '100%',
|
|
215
|
+
textAlign: 'right',
|
|
216
|
+
background: '#E57373',
|
|
217
|
+
marginTop: '10px'
|
|
218
|
+
}),
|
|
219
|
+
sliderListItem: props => ({
|
|
220
|
+
height: '15px'
|
|
221
|
+
}),
|
|
222
|
+
listItemGutters: props => ({
|
|
223
|
+
display: 'flex',
|
|
224
|
+
justifyContent: 'space-between',
|
|
225
|
+
padding: '2px 5px 2px 8px'
|
|
226
|
+
}),
|
|
227
|
+
lowerUpperBound: props => ({
|
|
228
|
+
height: '15px'
|
|
229
|
+
})
|
|
230
|
+
});
|
|
231
|
+
var _default = (0, _core.withStyles)(styles)(SliderView);
|
|
116
232
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -113,6 +113,7 @@ const FacetFilterController = (props) => {
|
|
|
113
113
|
updateFacet.minLowerBound = lowerBound;
|
|
114
114
|
updateFacet.maxUpperBound = upperBound;
|
|
115
115
|
updateFacet.facetValues = [lowerBound, upperBound];
|
|
116
|
+
updateFacet.style = facet.style;
|
|
116
117
|
}
|
|
117
118
|
}
|
|
118
119
|
updateFacets.push(updateFacet);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/* eslint-disable object-curly-newline */
|
|
5
5
|
import React, { useEffect, useState } from 'react';
|
|
6
6
|
import { withStyles, Slider, Typography, Box } from '@material-ui/core';
|
|
7
|
-
import styles from './SliderStyle';
|
|
7
|
+
// import styles from './SliderStyle';
|
|
8
8
|
import { silderTypes } from '../Types';
|
|
9
9
|
import InputMinMaxView from './InputMinMaxView';
|
|
10
10
|
|
|
@@ -113,9 +113,7 @@ const SliderView = ({
|
|
|
113
113
|
(sliderValue[0] > minLowerBound || sliderValue[1] < maxUpperBound)
|
|
114
114
|
&& (
|
|
115
115
|
<Typography
|
|
116
|
-
className={isValid()
|
|
117
|
-
? classes.sliderText
|
|
118
|
-
: classes.invalidSliderText}
|
|
116
|
+
className={isValid() ? classes.sliderText : classes.invalidSliderText}
|
|
119
117
|
>
|
|
120
118
|
{sliderValue[0]}
|
|
121
119
|
{' - '}
|
|
@@ -129,4 +127,124 @@ const SliderView = ({
|
|
|
129
127
|
);
|
|
130
128
|
};
|
|
131
129
|
|
|
130
|
+
const styles = () => ({
|
|
131
|
+
sliderRoot: (props) => (props.facet.style && props.facet.style.sliderRoot
|
|
132
|
+
? props.facet.style.sliderRoot
|
|
133
|
+
: {
|
|
134
|
+
marginTop: '10px',
|
|
135
|
+
marginLeft: '20px',
|
|
136
|
+
marginRight: 'Auto',
|
|
137
|
+
paddingRight: '20px',
|
|
138
|
+
}),
|
|
139
|
+
minValue: (props) => ({
|
|
140
|
+
fontFamily: 'Nunito',
|
|
141
|
+
fontSize: '15px',
|
|
142
|
+
color: '#000000',
|
|
143
|
+
marginBottom: '0px',
|
|
144
|
+
float: 'left',
|
|
145
|
+
width: '75px',
|
|
146
|
+
display: 'flex',
|
|
147
|
+
}),
|
|
148
|
+
maxValue: (props) => ({
|
|
149
|
+
fontFamily: 'Nunito',
|
|
150
|
+
fontSize: '15px',
|
|
151
|
+
color: '#000000',
|
|
152
|
+
float: 'right',
|
|
153
|
+
marginBottom: '0px',
|
|
154
|
+
display: 'flex',
|
|
155
|
+
}),
|
|
156
|
+
rail: (props) => ({
|
|
157
|
+
borderRadius: 4,
|
|
158
|
+
height: 6,
|
|
159
|
+
background: '#142D64',
|
|
160
|
+
}),
|
|
161
|
+
minInputLabel: (props) => ({
|
|
162
|
+
float: 'left',
|
|
163
|
+
lineHeight: '34px',
|
|
164
|
+
marginRight: '5px',
|
|
165
|
+
}),
|
|
166
|
+
maxInputLabel: (props) => ({
|
|
167
|
+
float: 'left',
|
|
168
|
+
lineHeight: '34px',
|
|
169
|
+
marginRight: '5px',
|
|
170
|
+
}),
|
|
171
|
+
thumb: (props) => ({
|
|
172
|
+
height: 16,
|
|
173
|
+
width: 16,
|
|
174
|
+
background: '#10A075',
|
|
175
|
+
}),
|
|
176
|
+
invalidThumb: (props) => ({
|
|
177
|
+
height: 16,
|
|
178
|
+
width: 16,
|
|
179
|
+
background: '#F44336',
|
|
180
|
+
}),
|
|
181
|
+
track: (props) => ({
|
|
182
|
+
borderRadius: 4,
|
|
183
|
+
height: 6,
|
|
184
|
+
background: '#10A075',
|
|
185
|
+
'&~&': {
|
|
186
|
+
background: '#142D64',
|
|
187
|
+
},
|
|
188
|
+
}),
|
|
189
|
+
invalidTrack: (props) => ({
|
|
190
|
+
borderRadius: 4,
|
|
191
|
+
height: 6,
|
|
192
|
+
background: '#F44336',
|
|
193
|
+
'&~&': {
|
|
194
|
+
background: '#142D64',
|
|
195
|
+
},
|
|
196
|
+
}),
|
|
197
|
+
upperBound: (props) => ({
|
|
198
|
+
fontFamily: 'Nunito',
|
|
199
|
+
fontSize: '10px',
|
|
200
|
+
color: '#000000',
|
|
201
|
+
float: 'right',
|
|
202
|
+
marginLeft: 'Auto',
|
|
203
|
+
marginRight: 'Auto',
|
|
204
|
+
marginBottom: '15px',
|
|
205
|
+
}),
|
|
206
|
+
lowerBound: (props) => ({
|
|
207
|
+
fontFamily: 'Nunito',
|
|
208
|
+
fontSize: '10px',
|
|
209
|
+
color: '#000000',
|
|
210
|
+
float: 'left',
|
|
211
|
+
marginLeft: 'Auto',
|
|
212
|
+
marginRight: 'Auto',
|
|
213
|
+
marginBottom: '15px',
|
|
214
|
+
}),
|
|
215
|
+
sliderText: (props) => ({
|
|
216
|
+
color: '#10a075',
|
|
217
|
+
lineHeight: '120%',
|
|
218
|
+
fontFamily: 'Nunito',
|
|
219
|
+
fontSize: '14px',
|
|
220
|
+
padding: '5px 15px 5px 0px',
|
|
221
|
+
width: '100%',
|
|
222
|
+
textAlign: 'right',
|
|
223
|
+
background: '#f5fdee',
|
|
224
|
+
marginTop: '10px',
|
|
225
|
+
}),
|
|
226
|
+
invalidSliderText: (props) => ({
|
|
227
|
+
color: '#D32F2F',
|
|
228
|
+
lineHeight: '120%',
|
|
229
|
+
fontFamily: 'Nunito',
|
|
230
|
+
fontSize: '14px',
|
|
231
|
+
padding: '5px 15px 5px 0px',
|
|
232
|
+
width: '100%',
|
|
233
|
+
textAlign: 'right',
|
|
234
|
+
background: '#E57373',
|
|
235
|
+
marginTop: '10px',
|
|
236
|
+
}),
|
|
237
|
+
sliderListItem: (props) => ({
|
|
238
|
+
height: '15px',
|
|
239
|
+
}),
|
|
240
|
+
listItemGutters: (props) => ({
|
|
241
|
+
display: 'flex',
|
|
242
|
+
justifyContent: 'space-between',
|
|
243
|
+
padding: '2px 5px 2px 8px',
|
|
244
|
+
}),
|
|
245
|
+
lowerUpperBound: (props) => ({
|
|
246
|
+
height: '15px',
|
|
247
|
+
}),
|
|
248
|
+
});
|
|
249
|
+
|
|
132
250
|
export default withStyles(styles)(SliderView);
|