@bento-core/query-bar 1.0.1-ccdihub.14 → 1.0.1-ccdihub.16
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.
|
@@ -35,6 +35,7 @@ const QueryBarGenerator = function QueryBarGenerator() {
|
|
|
35
35
|
} = _facetFilter.InputTypes;
|
|
36
36
|
const maxItems = config && typeof config.maxItems === 'number' ? config.maxItems : _config.default.config.maxItems;
|
|
37
37
|
const clearAll = functions && typeof functions.clearAll === 'function' ? functions.clearAll : _config.default.functions.clearAll;
|
|
38
|
+
const clearImportFrom = functions && typeof functions.clearImportFrom === 'function' ? functions.clearImportFrom : _config.default.functions.clearImportFrom;
|
|
38
39
|
const clearUpload = functions && typeof functions.clearUpload === 'function' ? functions.clearUpload : _config.default.functions.clearUpload;
|
|
39
40
|
const clearAutocomplete = functions && typeof functions.clearAutocomplete === 'function' ? functions.clearAutocomplete : _config.default.functions.clearAutocomplete;
|
|
40
41
|
const deleteAutocompleteItem = functions && typeof functions.deleteAutocompleteItem === 'function' ? functions.deleteAutocompleteItem : _config.default.functions.deleteAutocompleteItem;
|
|
@@ -48,6 +49,7 @@ const QueryBarGenerator = function QueryBarGenerator() {
|
|
|
48
49
|
withTheme: true
|
|
49
50
|
})(props => {
|
|
50
51
|
const {
|
|
52
|
+
hasImportFrom,
|
|
51
53
|
statusReducer,
|
|
52
54
|
localFind,
|
|
53
55
|
classes
|
|
@@ -80,7 +82,7 @@ const QueryBarGenerator = function QueryBarGenerator() {
|
|
|
80
82
|
items: itemKeys
|
|
81
83
|
});
|
|
82
84
|
}).filter(facet => facet.items.length > 0);
|
|
83
|
-
if ((mappedInputs.length || autocomplete.length || upload.length) <= 0) {
|
|
85
|
+
if (!hasImportFrom && (mappedInputs.length || autocomplete.length || upload.length) <= 0) {
|
|
84
86
|
return null;
|
|
85
87
|
}
|
|
86
88
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -94,7 +96,12 @@ const QueryBarGenerator = function QueryBarGenerator() {
|
|
|
94
96
|
className: classes.divider
|
|
95
97
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
96
98
|
className: classes.queryContainer
|
|
97
|
-
},
|
|
99
|
+
}, hasImportFrom && /*#__PURE__*/_react.default.createElement("span", {
|
|
100
|
+
className: (0, _clsx.default)(classes.filterCheckboxes, classes.localFindBackground),
|
|
101
|
+
onClick: clearImportFrom
|
|
102
|
+
}, "IMPORTED PARTICIPANT SET"), (autocomplete.length || upload.length) && mappedInputs.length ? /*#__PURE__*/_react.default.createElement("span", {
|
|
103
|
+
className: classes.operators
|
|
104
|
+
}, " AND ") : null, autocomplete.length || upload.length ? /*#__PURE__*/_react.default.createElement("span", null, upload.length && !autocomplete.length ? /*#__PURE__*/_react.default.createElement("span", {
|
|
98
105
|
className: (0, _clsx.default)(classes.filterCheckboxes, classes.localFindBackground),
|
|
99
106
|
onClick: clearUpload
|
|
100
107
|
}, "INPUT PARTICIPANT SET") : null, autocomplete.length ? /*#__PURE__*/_react.default.createElement("span", null, ' ', /*#__PURE__*/_react.default.createElement("span", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bento-core/query-bar",
|
|
3
|
-
"version": "1.0.1-ccdihub.
|
|
3
|
+
"version": "1.0.1-ccdihub.16",
|
|
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": {
|
|
@@ -25,6 +25,10 @@ export const QueryBarGenerator = (uiConfig = DEFAULT_CONFIG) => {
|
|
|
25
25
|
? functions.clearAll
|
|
26
26
|
: DEFAULT_CONFIG.functions.clearAll;
|
|
27
27
|
|
|
28
|
+
const clearImportFrom = functions && typeof functions.clearImportFrom === 'function'
|
|
29
|
+
? functions.clearImportFrom
|
|
30
|
+
: DEFAULT_CONFIG.functions.clearImportFrom;
|
|
31
|
+
|
|
28
32
|
const clearUpload = functions && typeof functions.clearUpload === 'function'
|
|
29
33
|
? functions.clearUpload
|
|
30
34
|
: DEFAULT_CONFIG.functions.clearUpload;
|
|
@@ -59,8 +63,9 @@ export const QueryBarGenerator = (uiConfig = DEFAULT_CONFIG) => {
|
|
|
59
63
|
|
|
60
64
|
return {
|
|
61
65
|
QueryBar: withStyles(DEFAULT_STYLES, { withTheme: true })((props) => {
|
|
62
|
-
const {
|
|
63
|
-
|
|
66
|
+
const {
|
|
67
|
+
hasImportFrom, statusReducer, localFind, classes,
|
|
68
|
+
} = props;
|
|
64
69
|
const { autocomplete, upload } = localFind;
|
|
65
70
|
|
|
66
71
|
// Remove any sections without checkboxes selected
|
|
@@ -84,7 +89,7 @@ export const QueryBarGenerator = (uiConfig = DEFAULT_CONFIG) => {
|
|
|
84
89
|
})
|
|
85
90
|
.filter((facet) => facet.items.length > 0);
|
|
86
91
|
|
|
87
|
-
if ((mappedInputs.length || autocomplete.length || upload.length) <= 0) {
|
|
92
|
+
if (!hasImportFrom && (mappedInputs.length || autocomplete.length || upload.length) <= 0) {
|
|
88
93
|
return null;
|
|
89
94
|
}
|
|
90
95
|
|
|
@@ -102,6 +107,20 @@ export const QueryBarGenerator = (uiConfig = DEFAULT_CONFIG) => {
|
|
|
102
107
|
<span className={classes.queryContainer}>
|
|
103
108
|
{/* Local Find Selections */}
|
|
104
109
|
{/* TODO: Refactor this into a separate component */}
|
|
110
|
+
{
|
|
111
|
+
hasImportFrom
|
|
112
|
+
&& (
|
|
113
|
+
<span
|
|
114
|
+
className={clsx(classes.filterCheckboxes, classes.localFindBackground)}
|
|
115
|
+
onClick={clearImportFrom}
|
|
116
|
+
>
|
|
117
|
+
IMPORTED PARTICIPANT SET
|
|
118
|
+
</span>
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
{((autocomplete.length || upload.length) && mappedInputs.length)
|
|
122
|
+
? <span className={classes.operators}> AND </span>
|
|
123
|
+
: null}
|
|
105
124
|
{(autocomplete.length || upload.length) ? (
|
|
106
125
|
<span>
|
|
107
126
|
{/* Standalone case set button */}
|
package/src/generators/config.js
CHANGED