@bento-core/query-bar 1.0.1-ccdiintegrated.1 → 1.0.1-ccdiintegrated.2

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.
@@ -17,18 +17,49 @@ var _default = _ref => {
17
17
  } = _ref;
18
18
  const {
19
19
  items,
20
- section
20
+ section,
21
+ unknownAges
21
22
  } = data;
23
+
24
+ // Determine the display logic based on unknownAges selection
25
+ const getDisplayContent = () => {
26
+ const baseLabel = data.label;
27
+ if (unknownAges === 'only') {
28
+ // Only: Show base label with unknown ages only, no range
29
+ return {
30
+ label: "".concat(baseLabel, " (Unknown Ages Only)"),
31
+ showRange: false,
32
+ rangeText: ''
33
+ };
34
+ }
35
+ if (unknownAges === 'exclude') {
36
+ // Exclude: Show base label with unknown ages excluded, with range only if items exist
37
+ const hasRange = items && items.length >= 2;
38
+ return {
39
+ label: "".concat(baseLabel, " (Unknown Ages Excluded)"),
40
+ showRange: hasRange,
41
+ rangeText: hasRange ? "".concat(items[0], " \u2013 ").concat(items[1]) : ''
42
+ };
43
+ }
44
+
45
+ // Include: Normal display (base label with range)
46
+ return {
47
+ label: baseLabel,
48
+ showRange: true,
49
+ rangeText: items && items.length >= 2 ? "".concat(items[0], " \u2013 ").concat(items[1]) : ''
50
+ };
51
+ };
52
+ const displayContent = getDisplayContent();
22
53
  return /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("span", null, ' ', index !== 0 ? /*#__PURE__*/_react.default.createElement("span", {
23
54
  className: classes.operators
24
55
  }, " AND ") : '', /*#__PURE__*/_react.default.createElement("span", {
25
56
  className: (0, _clsx.default)(classes.filterName, classes["facetSection".concat(section, "Background")]),
26
57
  onClick: () => onSectionClick(data)
27
- }, data.label), ' '), /*#__PURE__*/_react.default.createElement("span", null, ' ', /*#__PURE__*/_react.default.createElement("span", {
58
+ }, displayContent.label), ' '), displayContent.showRange && /*#__PURE__*/_react.default.createElement("span", null, ' ', /*#__PURE__*/_react.default.createElement("span", {
28
59
  className: classes.operators
29
60
  }, "IS BETWEEN", ' '), /*#__PURE__*/_react.default.createElement("span", {
30
61
  className: (0, _clsx.default)(classes.filterCheckboxes, classes["facetSection".concat(section)]),
31
62
  onClick: () => onItemClick(data, items[0])
32
- }, "".concat(items[0], " \u2013 ").concat(items[1]))));
63
+ }, displayContent.rangeText)));
33
64
  };
34
65
  exports.default = _default;
@@ -81,7 +81,7 @@ const QueryBarGenerator = function QueryBarGenerator() {
81
81
  return _objectSpread(_objectSpread({}, facet), {}, {
82
82
  items: itemKeys
83
83
  });
84
- }).filter(facet => facet.items.length > 0);
84
+ }).filter(facet => facet.items.length > 0 || facet.unknownAges && facet.unknownAges !== 'include');
85
85
  if (!hasImportFrom && (mappedInputs.length || autocomplete.length || upload.length) <= 0) {
86
86
  return null;
87
87
  }
@@ -99,7 +99,7 @@ const QueryBarGenerator = function QueryBarGenerator() {
99
99
  }, hasImportFrom && /*#__PURE__*/_react.default.createElement("span", {
100
100
  className: (0, _clsx.default)(classes.filterCheckboxes, classes.localFindBackground),
101
101
  onClick: clearImportFrom
102
- }, "IMPORTED PARTICIPANT SET"), (autocomplete.length || upload.length) && mappedInputs.length ? /*#__PURE__*/_react.default.createElement("span", {
102
+ }, "IMPORTED PARTICIPANT SET"), hasImportFrom && (mappedInputs.length || autocomplete.length || upload.length) ? /*#__PURE__*/_react.default.createElement("span", {
103
103
  className: classes.operators
104
104
  }, " AND ") : null, autocomplete.length || upload.length ? /*#__PURE__*/_react.default.createElement("span", null, upload.length && !autocomplete.length ? /*#__PURE__*/_react.default.createElement("span", {
105
105
  className: (0, _clsx.default)(classes.filterCheckboxes, classes.localFindBackground),
@@ -9,9 +9,8 @@ exports.default = void 0;
9
9
  */
10
10
  var _default = () => ({
11
11
  queryWrapper: {
12
- height: '120px',
13
12
  backgroundColor: '#f1f1f1',
14
- padding: '14px 14px 0px 35px',
13
+ padding: '5px 15px 15px 15px',
15
14
  overflowY: 'auto'
16
15
  },
17
16
  queryContainer: {
@@ -125,41 +124,48 @@ var _default = () => ({
125
124
  backgroundColor: '#E1C9E140',
126
125
  border: '1px solid #646464'
127
126
  },
128
- facetSectionTreatment: {
127
+ facetSectionGeneticanalysis: {
129
128
  color: '#4555AB'
130
129
  },
131
- facetSectionTreatmentBackground: {
130
+ facetSectionGeneticanalysisBackground: {
132
131
  backgroundColor: '#4555AB30',
133
132
  border: '1px solid #646464'
134
133
  },
135
- facetSectionTreatmentresponse: {
134
+ facetSectionTreatment: {
136
135
  color: '#907642'
137
136
  },
138
- facetSectionTreatmentresponseBackground: {
137
+ facetSectionTreatmentBackground: {
139
138
  backgroundColor: '#F0DFBD40',
140
139
  border: '1px solid #646464'
141
140
  },
142
- facetSectionSurvival: {
141
+ facetSectionTreatmentresponse: {
143
142
  color: '#A85348'
144
143
  },
145
- facetSectionSurvivalBackground: {
144
+ facetSectionTreatmentresponseBackground: {
146
145
  backgroundColor: '#F8D7D240',
147
146
  border: '1px solid #646464'
148
147
  },
149
- facetSectionSamples: {
148
+ facetSectionSurvival: {
150
149
  color: '#1F6BBF'
151
150
  },
152
- facetSectionSamplesBackground: {
151
+ facetSectionSurvivalBackground: {
153
152
  backgroundColor: '#CEDEF040',
154
153
  border: '1px solid #646464'
155
154
  },
156
- facetSectionDatacategory: {
155
+ facetSectionSamples: {
157
156
  color: '#14A773'
158
157
  },
159
- facetSectionDatacategoryBackground: {
158
+ facetSectionSamplesBackground: {
160
159
  backgroundColor: '#DDEAE540',
161
160
  border: '1px solid #646464'
162
161
  },
162
+ facetSectionDatacategory: {
163
+ color: '#357288'
164
+ },
165
+ facetSectionDatacategoryBackground: {
166
+ backgroundColor: '#E4ECE9',
167
+ border: '1px solid #646464'
168
+ },
163
169
  facetSectionStudy: {
164
170
  color: '#357288'
165
171
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/query-bar",
3
- "version": "1.0.1-ccdiintegrated.1",
3
+ "version": "1.0.1-ccdiintegrated.2",
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
  "homepage": "https://github.com/CBIIT/bento-frontend#readme",
6
6
  "bugs": {
@@ -118,41 +118,48 @@ export default () => ({
118
118
  backgroundColor: '#E1C9E140',
119
119
  border: '1px solid #646464',
120
120
  },
121
- facetSectionTreatment: {
121
+ facetSectionGeneticanalysis: {
122
122
  color: '#4555AB',
123
123
  },
124
- facetSectionTreatmentBackground: {
124
+ facetSectionGeneticanalysisBackground: {
125
125
  backgroundColor: '#4555AB30',
126
126
  border: '1px solid #646464',
127
127
  },
128
- facetSectionTreatmentresponse: {
128
+ facetSectionTreatment: {
129
129
  color: '#907642',
130
130
  },
131
- facetSectionTreatmentresponseBackground: {
131
+ facetSectionTreatmentBackground: {
132
132
  backgroundColor: '#F0DFBD40',
133
133
  border: '1px solid #646464',
134
134
  },
135
- facetSectionSurvival: {
135
+ facetSectionTreatmentresponse: {
136
136
  color: '#A85348',
137
137
  },
138
- facetSectionSurvivalBackground: {
138
+ facetSectionTreatmentresponseBackground: {
139
139
  backgroundColor: '#F8D7D240',
140
140
  border: '1px solid #646464',
141
141
  },
142
- facetSectionSamples: {
142
+ facetSectionSurvival: {
143
143
  color: '#1F6BBF',
144
144
  },
145
- facetSectionSamplesBackground: {
145
+ facetSectionSurvivalBackground: {
146
146
  backgroundColor: '#CEDEF040',
147
147
  border: '1px solid #646464',
148
148
  },
149
- facetSectionDatacategory: {
149
+ facetSectionSamples: {
150
150
  color: '#14A773',
151
151
  },
152
- facetSectionDatacategoryBackground: {
152
+ facetSectionSamplesBackground: {
153
153
  backgroundColor: '#DDEAE540',
154
154
  border: '1px solid #646464',
155
155
  },
156
+ facetSectionDatacategory: {
157
+ color: '#357288',
158
+ },
159
+ facetSectionDatacategoryBackground: {
160
+ backgroundColor: '#E4ECE9',
161
+ border: '1px solid #646464',
162
+ },
156
163
  facetSectionStudy: {
157
164
  color: '#357288',
158
165
  },