@bento-core/query-bar 1.0.1-ccdihub.0 → 1.0.1-icdc.0
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.
|
@@ -40,6 +40,10 @@ const QueryBarGenerator = function QueryBarGenerator() {
|
|
|
40
40
|
const resetFacetSection = functions && typeof functions.resetFacetSection === 'function' ? functions.resetFacetSection : _config.default.functions.resetFacetSection;
|
|
41
41
|
const resetFacetCheckbox = functions && typeof functions.resetFacetCheckbox === 'function' ? functions.resetFacetCheckbox : _config.default.functions.resetFacetCheckbox;
|
|
42
42
|
const resetFacetSlider = functions && typeof functions.resetFacetSlider === 'function' ? functions.resetFacetSlider : _config.default.functions.resetFacetSlider;
|
|
43
|
+
const clsName = function clsName() {
|
|
44
|
+
let text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'filter-section';
|
|
45
|
+
return text.replace(/\s+/g, '-').toLowerCase();
|
|
46
|
+
};
|
|
43
47
|
return {
|
|
44
48
|
QueryBar: (0, _core.withStyles)(_styles.default, {
|
|
45
49
|
withTheme: true
|
|
@@ -97,7 +101,7 @@ const QueryBarGenerator = function QueryBarGenerator() {
|
|
|
97
101
|
}, "INPUT CASE SET") : null, autocomplete.length ? /*#__PURE__*/_react.default.createElement("span", null, ' ', /*#__PURE__*/_react.default.createElement("span", {
|
|
98
102
|
className: (0, _clsx.default)(classes.filterName, classes.localFindBackground),
|
|
99
103
|
onClick: clearAutocomplete
|
|
100
|
-
}, "
|
|
104
|
+
}, "Case IDs"), ' ', ' ', /*#__PURE__*/_react.default.createElement("span", {
|
|
101
105
|
className: classes.operators
|
|
102
106
|
}, autocomplete.length === 1 && !upload.length ? 'IS ' : 'IN ')) : null, /*#__PURE__*/_react.default.createElement("span", null, (upload.length > 0 ? 1 : 0) + autocomplete.length > 1 ? /*#__PURE__*/_react.default.createElement("span", {
|
|
103
107
|
className: classes.bracketsOpen
|
|
@@ -112,7 +116,9 @@ const QueryBarGenerator = function QueryBarGenerator() {
|
|
|
112
116
|
className: classes.bracketsClose
|
|
113
117
|
}, ")") : null)) : null, (autocomplete.length || upload.length) && mappedInputs.length ? /*#__PURE__*/_react.default.createElement("span", {
|
|
114
118
|
className: classes.operators
|
|
115
|
-
}, " AND ") : null, mappedInputs.map((filter, index) => /*#__PURE__*/_react.default.createElement(
|
|
119
|
+
}, " AND ") : null, mappedInputs.map((filter, index) => /*#__PURE__*/_react.default.createElement("span", {
|
|
120
|
+
className: clsName(filter.section)
|
|
121
|
+
}, /*#__PURE__*/_react.default.createElement(_FilterMap.Filter, {
|
|
116
122
|
index: index,
|
|
117
123
|
type: filter.type,
|
|
118
124
|
data: filter,
|
|
@@ -120,7 +126,7 @@ const QueryBarGenerator = function QueryBarGenerator() {
|
|
|
120
126
|
classes: classes,
|
|
121
127
|
onSectionClick: filter.type === CHECKBOX ? resetFacetSection : resetFacetSlider,
|
|
122
128
|
onItemClick: filter.type === CHECKBOX ? resetFacetCheckbox : resetFacetSlider
|
|
123
|
-
}))));
|
|
129
|
+
})))));
|
|
124
130
|
})
|
|
125
131
|
};
|
|
126
132
|
};
|
|
@@ -73,12 +73,12 @@ var _default = () => ({
|
|
|
73
73
|
borderRadius: '15px',
|
|
74
74
|
fontFamily: 'Nunito',
|
|
75
75
|
boxSizing: 'border-box',
|
|
76
|
-
backgroundColor: '#
|
|
76
|
+
backgroundColor: '#969696',
|
|
77
77
|
textTransform: 'capitalize',
|
|
78
78
|
border: '1px solid #B4B4B4',
|
|
79
79
|
padding: '1px 5px 0px 6px',
|
|
80
80
|
'&:hover': {
|
|
81
|
-
backgroundColor: '#
|
|
81
|
+
backgroundColor: '#969696'
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
divider: {
|
|
@@ -87,16 +87,16 @@ var _default = () => ({
|
|
|
87
87
|
},
|
|
88
88
|
/* Custom Styling by Project */
|
|
89
89
|
localFind: {
|
|
90
|
-
color: '#
|
|
90
|
+
color: '#10A075'
|
|
91
91
|
},
|
|
92
92
|
localFindBackground: {
|
|
93
|
-
backgroundColor: '#
|
|
93
|
+
backgroundColor: '#C0E9D7'
|
|
94
94
|
},
|
|
95
95
|
facetSectionCases: {
|
|
96
|
-
color: '#
|
|
96
|
+
color: '#10A075'
|
|
97
97
|
},
|
|
98
98
|
facetSectionCasesBackground: {
|
|
99
|
-
backgroundColor: '#
|
|
99
|
+
backgroundColor: '#C0E9D7'
|
|
100
100
|
},
|
|
101
101
|
facetSectionFiles: {
|
|
102
102
|
color: '#E636E4'
|
|
@@ -104,41 +104,11 @@ var _default = () => ({
|
|
|
104
104
|
facetSectionFilesBackground: {
|
|
105
105
|
backgroundColor: '#F5C3F1'
|
|
106
106
|
},
|
|
107
|
-
facetSectionDemographics: {
|
|
108
|
-
color: '#7AA6B6'
|
|
109
|
-
},
|
|
110
|
-
facetSectionDemographicsBackground: {
|
|
111
|
-
backgroundColor: '#E4ECE9'
|
|
112
|
-
},
|
|
113
|
-
facetSectionDiagnosis: {
|
|
114
|
-
color: '#7AA6B6'
|
|
115
|
-
},
|
|
116
|
-
facetSectionDiagnosisBackground: {
|
|
117
|
-
backgroundColor: '#E4ECE9'
|
|
118
|
-
},
|
|
119
107
|
facetSectionSamples: {
|
|
120
|
-
color: '#
|
|
108
|
+
color: '#10BEFF'
|
|
121
109
|
},
|
|
122
110
|
facetSectionSamplesBackground: {
|
|
123
|
-
backgroundColor: '#
|
|
124
|
-
},
|
|
125
|
-
facetSectionAssay: {
|
|
126
|
-
color: '#7AA6B6'
|
|
127
|
-
},
|
|
128
|
-
facetSectionAssayBackground: {
|
|
129
|
-
backgroundColor: '#E4ECE9'
|
|
130
|
-
},
|
|
131
|
-
facetSectionStudy: {
|
|
132
|
-
color: '#7AA6B6'
|
|
133
|
-
},
|
|
134
|
-
facetSectionStudyBackground: {
|
|
135
|
-
backgroundColor: '#E4ECE9'
|
|
136
|
-
},
|
|
137
|
-
facetSectionLibrary: {
|
|
138
|
-
color: '#7AA6B6'
|
|
139
|
-
},
|
|
140
|
-
facetSectionLibraryBackground: {
|
|
141
|
-
backgroundColor: '#E4ECE9'
|
|
111
|
+
backgroundColor: '#C3EAF5'
|
|
142
112
|
}
|
|
143
113
|
});
|
|
144
114
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bento-core/query-bar",
|
|
3
|
-
"version": "1.0.1-
|
|
3
|
+
"version": "1.0.1-icdc.0",
|
|
4
4
|
"description": "This package provides the Query Bar component that displays the current Facet Search and Local Find filters on the Dashboard/Explore page. It also provides the direct ability to reset all or some of the filters with the click of a button. It is designed to be implemented directly with the:",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -48,6 +48,8 @@ export const QueryBarGenerator = (uiConfig = DEFAULT_CONFIG) => {
|
|
|
48
48
|
? functions.resetFacetSlider
|
|
49
49
|
: DEFAULT_CONFIG.functions.resetFacetSlider;
|
|
50
50
|
|
|
51
|
+
const clsName = (text = 'filter-section') => text.replace(/\s+/g, '-').toLowerCase();
|
|
52
|
+
|
|
51
53
|
return {
|
|
52
54
|
QueryBar: withStyles(DEFAULT_STYLES, { withTheme: true })((props) => {
|
|
53
55
|
const { statusReducer, localFind, classes } = props;
|
|
@@ -113,7 +115,7 @@ export const QueryBarGenerator = (uiConfig = DEFAULT_CONFIG) => {
|
|
|
113
115
|
className={clsx(classes.filterName, classes.localFindBackground)}
|
|
114
116
|
onClick={clearAutocomplete}
|
|
115
117
|
>
|
|
116
|
-
|
|
118
|
+
Case IDs
|
|
117
119
|
</span>
|
|
118
120
|
{' '}
|
|
119
121
|
{' '}
|
|
@@ -163,19 +165,21 @@ export const QueryBarGenerator = (uiConfig = DEFAULT_CONFIG) => {
|
|
|
163
165
|
? <span className={classes.operators}> AND </span>
|
|
164
166
|
: null}
|
|
165
167
|
{mappedInputs.map((filter, index) => (
|
|
166
|
-
<
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
168
|
+
<span className={clsName(filter.section)}>
|
|
169
|
+
<Filter
|
|
170
|
+
index={index}
|
|
171
|
+
type={filter.type}
|
|
172
|
+
data={filter}
|
|
173
|
+
maxItems={maxItems}
|
|
174
|
+
classes={classes}
|
|
175
|
+
onSectionClick={filter.type === CHECKBOX
|
|
176
|
+
? resetFacetSection
|
|
177
|
+
: resetFacetSlider}
|
|
178
|
+
onItemClick={filter.type === CHECKBOX
|
|
179
|
+
? resetFacetCheckbox
|
|
180
|
+
: resetFacetSlider}
|
|
181
|
+
/>
|
|
182
|
+
</span>
|
|
179
183
|
))}
|
|
180
184
|
</span>
|
|
181
185
|
</div>
|
package/src/generators/styles.js
CHANGED
|
@@ -67,12 +67,12 @@ export default () => ({
|
|
|
67
67
|
borderRadius: '15px',
|
|
68
68
|
fontFamily: 'Nunito',
|
|
69
69
|
boxSizing: 'border-box',
|
|
70
|
-
backgroundColor: '#
|
|
70
|
+
backgroundColor: '#969696',
|
|
71
71
|
textTransform: 'capitalize',
|
|
72
72
|
border: '1px solid #B4B4B4',
|
|
73
73
|
padding: '1px 5px 0px 6px',
|
|
74
74
|
'&:hover': {
|
|
75
|
-
backgroundColor: '#
|
|
75
|
+
backgroundColor: '#969696',
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
78
|
divider: {
|
|
@@ -81,16 +81,16 @@ export default () => ({
|
|
|
81
81
|
},
|
|
82
82
|
/* Custom Styling by Project */
|
|
83
83
|
localFind: {
|
|
84
|
-
color: '#
|
|
84
|
+
color: '#10A075',
|
|
85
85
|
},
|
|
86
86
|
localFindBackground: {
|
|
87
|
-
backgroundColor: '#
|
|
87
|
+
backgroundColor: '#C0E9D7',
|
|
88
88
|
},
|
|
89
89
|
facetSectionCases: {
|
|
90
|
-
color: '#
|
|
90
|
+
color: '#10A075',
|
|
91
91
|
},
|
|
92
92
|
facetSectionCasesBackground: {
|
|
93
|
-
backgroundColor: '#
|
|
93
|
+
backgroundColor: '#C0E9D7',
|
|
94
94
|
},
|
|
95
95
|
facetSectionFiles: {
|
|
96
96
|
color: '#E636E4',
|
|
@@ -98,40 +98,10 @@ export default () => ({
|
|
|
98
98
|
facetSectionFilesBackground: {
|
|
99
99
|
backgroundColor: '#F5C3F1',
|
|
100
100
|
},
|
|
101
|
-
facetSectionDemographics: {
|
|
102
|
-
color: '#7AA6B6',
|
|
103
|
-
},
|
|
104
|
-
facetSectionDemographicsBackground: {
|
|
105
|
-
backgroundColor: '#E4ECE9',
|
|
106
|
-
},
|
|
107
|
-
facetSectionDiagnosis: {
|
|
108
|
-
color: '#7AA6B6',
|
|
109
|
-
},
|
|
110
|
-
facetSectionDiagnosisBackground: {
|
|
111
|
-
backgroundColor: '#E4ECE9',
|
|
112
|
-
},
|
|
113
101
|
facetSectionSamples: {
|
|
114
|
-
color: '#
|
|
102
|
+
color: '#10BEFF',
|
|
115
103
|
},
|
|
116
104
|
facetSectionSamplesBackground: {
|
|
117
|
-
backgroundColor: '#
|
|
118
|
-
},
|
|
119
|
-
facetSectionAssay: {
|
|
120
|
-
color: '#7AA6B6',
|
|
121
|
-
},
|
|
122
|
-
facetSectionAssayBackground: {
|
|
123
|
-
backgroundColor: '#E4ECE9',
|
|
124
|
-
},
|
|
125
|
-
facetSectionStudy: {
|
|
126
|
-
color: '#7AA6B6',
|
|
127
|
-
},
|
|
128
|
-
facetSectionStudyBackground: {
|
|
129
|
-
backgroundColor: '#E4ECE9',
|
|
130
|
-
},
|
|
131
|
-
facetSectionLibrary: {
|
|
132
|
-
color: '#7AA6B6',
|
|
133
|
-
},
|
|
134
|
-
facetSectionLibraryBackground: {
|
|
135
|
-
backgroundColor: '#E4ECE9',
|
|
105
|
+
backgroundColor: '#C3EAF5',
|
|
136
106
|
},
|
|
137
107
|
});
|