lhcb-ntuple-wizard-test 1.0.5 → 1.0.7

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.
Files changed (41) hide show
  1. package/dist/components/App.js +1 -1
  2. package/dist/components/ConfigDict.js +39 -40
  3. package/dist/components/ConfigList.js +27 -31
  4. package/dist/components/ConfigNode.js +122 -121
  5. package/dist/components/ConfigValue.js +18 -21
  6. package/dist/components/Dataset.js +4 -8
  7. package/dist/components/Decay.js +2 -2
  8. package/dist/components/DecayItem.js +46 -50
  9. package/dist/components/DecayTag.js +4 -5
  10. package/dist/components/DecayTree.js +151 -151
  11. package/dist/components/DecaysList.js +35 -39
  12. package/dist/components/DeleteButton.js +1 -1
  13. package/dist/components/DescriptorsSearch.js +188 -192
  14. package/dist/components/EventTypeBadge.js +1 -1
  15. package/dist/components/ItemSearch.js +8 -12
  16. package/dist/components/LinesTable.js +463 -459
  17. package/dist/components/NtupleWizard.js +28 -32
  18. package/dist/components/ParticleTag.js +4 -5
  19. package/dist/components/PolarityBadge.js +1 -1
  20. package/dist/components/SearchItem.js +29 -33
  21. package/dist/components/SelectParticle.js +6 -10
  22. package/dist/components/SelectTag.js +5 -6
  23. package/dist/components/SelectTool.js +5 -6
  24. package/dist/components/SelectVariables.js +23 -24
  25. package/dist/components/StrippingBadge.js +4 -5
  26. package/dist/components/StrippingLine.js +2 -2
  27. package/dist/components/TupleTool.js +4 -5
  28. package/dist/components/VariablesSearch.js +8 -12
  29. package/dist/components/YearBadge.js +1 -1
  30. package/dist/components/loki/LokiDict.js +180 -0
  31. package/dist/components/loki/LokiEditor.js +200 -0
  32. package/dist/components/loki/LokiForm.js +112 -0
  33. package/dist/components/semantic.js +97 -0
  34. package/dist/components/semform.js +182 -0
  35. package/dist/components/worker.js +196 -0
  36. package/dist/config.json +4 -2
  37. package/dist/contexts/MetadataContext.js +2 -2
  38. package/dist/index.js +2 -2
  39. package/dist/lib/DTTConfig.js +13 -9
  40. package/dist/lib/utils.js +1 -1
  41. package/package.json +25 -2
@@ -15,10 +15,8 @@ var _DecaysList = _interopRequireDefault(require("./DecaysList"));
15
15
  var _SelectParticle = _interopRequireDefault(require("./SelectParticle"));
16
16
  var _SelectTag = _interopRequireDefault(require("./SelectTag"));
17
17
  var _jsxRuntime = require("react/jsx-runtime");
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
21
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*****************************************************************************\
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
+ /*****************************************************************************\
22
20
  * (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
23
21
  * *
24
22
  * This software is distributed under the terms of the GNU General Public *
@@ -28,199 +26,149 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
28
26
  * granted to it by virtue of its status as an Intergovernmental Organization *
29
27
  * or submit itself to any jurisdiction. *
30
28
  \*****************************************************************************/
29
+
31
30
  class DescriptorsSearch extends _react.default.Component {
32
- constructor() {
33
- super(...arguments);
34
- _defineProperty(this, "state", {
35
- selectedContains: [],
36
- selectedHead: null,
37
- selectedHeadTags: [],
38
- selectedDecays: this.props.rows.map(row => row.decay),
39
- selectedTags: null,
40
- selectedLine: null,
41
- chargeConjugateContains: true,
42
- chargeConjugateHeads: true,
43
- containsMatchType: "all",
44
- headMatchType: "exactly",
45
- tagMatchType: "none",
46
- headTagMatchType: "all",
47
- onlySelected: false
31
+ static contextType = (() => _MetadataContext.default)();
32
+ state = {
33
+ selectedContains: [],
34
+ selectedHead: null,
35
+ selectedHeadTags: [],
36
+ selectedDecays: this.props.rows.map(row => row.decay),
37
+ selectedTags: null,
38
+ selectedLine: null,
39
+ chargeConjugateContains: true,
40
+ chargeConjugateHeads: true,
41
+ containsMatchType: "all",
42
+ headMatchType: "exactly",
43
+ tagMatchType: "none",
44
+ headTagMatchType: "all",
45
+ onlySelected: false
46
+ };
47
+ updateState = key => contents => {
48
+ this.setState({
49
+ [key]: contents
48
50
  });
49
- _defineProperty(this, "updateState", key => contents => {
50
- this.setState({
51
- [key]: contents
52
- });
51
+ };
52
+ toggleState = key => () => {
53
+ this.setState({
54
+ [key]: !this.state[key]
53
55
  });
54
- _defineProperty(this, "toggleState", key => () => {
55
- this.setState({
56
- [key]: !this.state[key]
57
- });
56
+ };
57
+ callbackFunction = childData => {
58
+ this.setState({
59
+ selectedDecays: childData
58
60
  });
59
- _defineProperty(this, "callbackFunction", childData => {
60
- this.setState({
61
- selectedDecays: childData
62
- });
61
+ };
62
+ createRow = (decay, id) => {
63
+ return Object({
64
+ id: id,
65
+ decay: decay,
66
+ lines: [],
67
+ paths: [],
68
+ // Currently-selected paths
69
+ pathOptions: [],
70
+ // Keep a history of valid paths
71
+ dtt: false
63
72
  });
64
- _defineProperty(this, "createRow", (decay, id) => {
65
- return Object({
66
- id: id,
67
- decay: decay,
68
- lines: [],
69
- paths: [],
70
- // Currently-selected paths
71
- pathOptions: [],
72
- // Keep a history of valid paths
73
- dtt: false
74
- });
73
+ };
74
+ sendData = () => {
75
+ const selectedDecays = this.state.selectedDecays;
76
+ const selectedDecayDescriptors = selectedDecays.map(decay => decay.descriptors.plain);
77
+ // Loop through rows and remove any not-selected decays
78
+ let rows = [...this.props.rows].filter(row => selectedDecayDescriptors.includes(row.decay.descriptors.plain));
79
+ const existingDecayDescriptors = rows.map(row => row.decay.descriptors.plain);
80
+ // Loop through selected decays and add any new rows
81
+ const newDecays = selectedDecays.filter(decay => !existingDecayDescriptors.includes(decay.descriptors.plain));
82
+ newDecays.forEach(decay => {
83
+ const rowIDs = rows.map(row => row.id);
84
+ let newRowID = 0;
85
+ while (rowIDs.includes(newRowID)) {
86
+ newRowID += 1;
87
+ }
88
+ rows.push(this.createRow(decay, newRowID));
75
89
  });
76
- _defineProperty(this, "sendData", () => {
77
- const selectedDecays = this.state.selectedDecays;
78
- const selectedDecayDescriptors = selectedDecays.map(decay => decay.descriptors.plain);
79
- // Loop through rows and remove any not-selected decays
80
- let rows = [...this.props.rows].filter(row => selectedDecayDescriptors.includes(row.decay.descriptors.plain));
81
- const existingDecayDescriptors = rows.map(row => row.decay.descriptors.plain);
82
- // Loop through selected decays and add any new rows
83
- const newDecays = selectedDecays.filter(decay => !existingDecayDescriptors.includes(decay.descriptors.plain));
84
- newDecays.forEach(decay => {
85
- const rowIDs = rows.map(row => row.id);
86
- let newRowID = 0;
87
- while (rowIDs.includes(newRowID)) {
88
- newRowID += 1;
89
- }
90
- rows.push(this.createRow(decay, newRowID));
90
+ this.props.parentCallback(rows.map(row => ({
91
+ ...row,
92
+ dtt: {
93
+ config: row.dtt
94
+ }
95
+ }))); // callback expects row.dtt to be a DTTConfig
96
+ };
97
+ static variableMatch = (type, conditions) => {
98
+ if (type === "all") {
99
+ return conditions.every(x => x);
100
+ } else if (type === "any") {
101
+ return conditions.some(x => x);
102
+ } else if (type === "none") {
103
+ return !conditions.some(x => x);
104
+ } else {
105
+ console.error("Unrecognised match type: " + type);
106
+ return true;
107
+ }
108
+ };
109
+ allStrippingLines = (() => (0, _lodash.default)(() => {
110
+ const allLines = [].concat(...Object.values(this.context.metadata.stripping).map(stream => Object.keys(stream)));
111
+ const uniqueLines = new Set(allLines);
112
+ return [...uniqueLines];
113
+ }))();
114
+ filterDecays = selectedTags => {
115
+ // XXX: selectedTags is passed as an arg because it's the only one with a non-empty default value.
116
+ // the value depends on async-loaded metadata, and I don't know how to put it in the state.
117
+ // TODO: can probably do some refactoring in here (cf variableMatch)
118
+ let newDecays = Object.values(this.context.metadata.decays);
119
+ if (this.state.selectedContains) {
120
+ newDecays = newDecays.filter(decay => {
121
+ const conditions = this.state.selectedContains.map(element => {
122
+ const particle = element.value;
123
+ const antiparticle = this.context.metadata.particleProperties[particle]["antiparticle"];
124
+ return decay.descriptors.plain.includes(particle) || this.state.chargeConjugateContains && decay.descriptors.plain.includes(antiparticle);
125
+ });
126
+ return DescriptorsSearch.variableMatch(this.state.containsMatchType, conditions);
91
127
  });
92
- this.props.parentCallback(rows.map(row => ({
93
- ...row,
94
- dtt: {
95
- config: row.dtt
96
- }
97
- }))); // callback expects row.dtt to be a DTTConfig
98
- });
99
- _defineProperty(this, "allStrippingLines", (0, _lodash.default)(() => {
100
- const allLines = [].concat(...Object.values(this.context.metadata.stripping).map(stream => Object.keys(stream)));
101
- const uniqueLines = new Set(allLines);
102
- return [...uniqueLines];
103
- }));
104
- _defineProperty(this, "filterDecays", selectedTags => {
105
- // XXX: selectedTags is passed as an arg because it's the only one with a non-empty default value.
106
- // the value depends on async-loaded metadata, and I don't know how to put it in the state.
107
- // TODO: can probably do some refactoring in here (cf variableMatch)
108
- let newDecays = Object.values(this.context.metadata.decays);
109
- if (this.state.selectedContains) {
128
+ }
129
+ if (this.state.headMatchType === "exactly") {
130
+ if (this.state.selectedHead) {
131
+ const particle = this.state.selectedHead.value;
132
+ const antiparticle = this.context.metadata.particleProperties[particle]["antiparticle"];
110
133
  newDecays = newDecays.filter(decay => {
111
- const conditions = this.state.selectedContains.map(element => {
112
- const particle = element.value;
113
- const antiparticle = this.context.metadata.particleProperties[particle]["antiparticle"];
114
- return decay.descriptors.plain.includes(particle) || this.state.chargeConjugateContains && decay.descriptors.plain.includes(antiparticle);
115
- });
116
- return DescriptorsSearch.variableMatch(this.state.containsMatchType, conditions);
134
+ const head = decay.descriptors.list[0];
135
+ return head === particle || this.state.chargeConjugateHeads && head === antiparticle;
117
136
  });
118
137
  }
119
- if (this.state.headMatchType === "exactly") {
120
- if (this.state.selectedHead) {
121
- const particle = this.state.selectedHead.value;
122
- const antiparticle = this.context.metadata.particleProperties[particle]["antiparticle"];
123
- newDecays = newDecays.filter(decay => {
124
- const head = decay.descriptors.list[0];
125
- return head === particle || this.state.chargeConjugateHeads && head === antiparticle;
126
- });
127
- }
128
- } else if (this.state.headMatchType === "category") {
129
- if (this.state.selectedHeadTags) {
130
- newDecays = newDecays.filter(decay => {
131
- const conditions = this.state.selectedHeadTags.map(element => {
132
- const tag = element.value;
133
- const head = this.context.metadata.particleProperties[decay.descriptors.list[0]];
134
- return head.tags.includes(tag);
135
- });
136
- return DescriptorsSearch.variableMatch(this.state.headTagMatchType, conditions);
137
- });
138
- }
139
- }
140
- if (this.state.onlySelected) {
141
- newDecays = newDecays.filter(decay => this.state.selectedDecays.map(selectedDecay => selectedDecay.descriptors.plain).includes(decay.descriptors.plain));
142
- }
143
- if (selectedTags) {
138
+ } else if (this.state.headMatchType === "category") {
139
+ if (this.state.selectedHeadTags) {
144
140
  newDecays = newDecays.filter(decay => {
145
- const conditions = selectedTags.map(element => {
141
+ const conditions = this.state.selectedHeadTags.map(element => {
146
142
  const tag = element.value;
147
- return decay.tags.includes(tag);
143
+ const head = this.context.metadata.particleProperties[decay.descriptors.list[0]];
144
+ return head.tags.includes(tag);
148
145
  });
149
- return DescriptorsSearch.variableMatch(this.state.tagMatchType, conditions);
146
+ return DescriptorsSearch.variableMatch(this.state.headTagMatchType, conditions);
150
147
  });
151
148
  }
152
- if (this.state.selectedLine) {
153
- const line = this.state.selectedLine.value;
154
- newDecays = newDecays.filter(decay => {
155
- const decayStreamLines = Object.keys(decay.lines);
156
- const decayLines = new Set(decayStreamLines.map(streamLine => streamLine.split("/")[1]));
157
- return decayLines.has(line);
149
+ }
150
+ if (this.state.onlySelected) {
151
+ newDecays = newDecays.filter(decay => this.state.selectedDecays.map(selectedDecay => selectedDecay.descriptors.plain).includes(decay.descriptors.plain));
152
+ }
153
+ if (selectedTags) {
154
+ newDecays = newDecays.filter(decay => {
155
+ const conditions = selectedTags.map(element => {
156
+ const tag = element.value;
157
+ return decay.tags.includes(tag);
158
158
  });
159
- }
160
- return newDecays;
161
- });
162
- _defineProperty(this, "getDecayList", () => {
163
- const strippingSelectedTags = this.state.selectedTags !== null // If a value has been chosen by the user...
164
- ? this.state.selectedTags // ... then set according to the state.
165
- : this.context.loaded.userHints // Otherwise, if the metadata is loaded, set the default value...
166
- ? _SelectTag.default.createOptions(this.context.metadata.userHints.decayTags, tag => tag.hide) : []; // ... or empty if not loaded yet
167
- const filteredDecays = this.context.loaded.decays ? this.filterDecays(strippingSelectedTags) : [];
168
- const strippingDecayList = /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
169
- children: this.context.loaded.decays ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_DecaysList.default, {
170
- decays: filteredDecays,
171
- selectedDecays: this.state.selectedDecays,
172
- parentCallback: this.callbackFunction
173
- }, JSON.stringify(filteredDecays)) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Alert, {
174
- variant: "warning",
175
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Spinner, {
176
- size: "sm",
177
- animation: "border"
178
- }), " Loading decays..."]
179
- })
159
+ return DescriptorsSearch.variableMatch(this.state.tagMatchType, conditions);
180
160
  });
181
- return strippingDecayList;
182
- });
183
- _defineProperty(this, "getExtraInputs", () => {
184
- const strippingSelectedTags = this.state.selectedTags !== null // If a value has been chosen by the user...
185
- ? this.state.selectedTags // ... then set according to the state.
186
- : this.context.loaded.userHints // Otherwise, if the metadata is loaded, set the default value...
187
- ? _SelectTag.default.createOptions(this.context.metadata.userHints.decayTags, tag => tag.hide) : []; // ... or empty if not loaded yet
188
- const strippingExtraInput = /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
189
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.InputGroup, {
190
- size: "sm",
191
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.DropdownButton, {
192
- title: "Tags (" + this.state.tagMatchType + " of):",
193
- variant: "outline-secondary",
194
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DescriptorsSearch.DropdownMatchTypes, {
195
- parent: this,
196
- stateItem: "tagMatchType",
197
- options: ["any", "all", "none"]
198
- })
199
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectTag.default, {
200
- isMulti: true,
201
- type: "decayTags",
202
- placeholder: "Decay tags",
203
- value: strippingSelectedTags,
204
- onChange: this.updateState("selectedTags"),
205
- closeMenuOnSelect: false
206
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
207
- className: "react-select form-control p-0",
208
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.default, {
209
- placeholder: "Stripping line",
210
- isClearable: true,
211
- options: this.context.loaded.stripping ? this.allStrippingLines().map(line => Object({
212
- value: line,
213
- label: line
214
- })) : [],
215
- onChange: this.updateState("selectedLine"),
216
- isLoading: !this.context.loaded.stripping
217
- })
218
- })]
219
- })
161
+ }
162
+ if (this.state.selectedLine) {
163
+ const line = this.state.selectedLine.value;
164
+ newDecays = newDecays.filter(decay => {
165
+ const decayStreamLines = Object.keys(decay.lines);
166
+ const decayLines = new Set(decayStreamLines.map(streamLine => streamLine.split("/")[1]));
167
+ return decayLines.has(line);
220
168
  });
221
- return strippingExtraInput;
222
- });
223
- }
169
+ }
170
+ return newDecays;
171
+ };
224
172
  static DropdownMatchTypes(props) {
225
173
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
226
174
  children: props.options.map(option => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Dropdown.Item, {
@@ -249,6 +197,67 @@ class DescriptorsSearch extends _react.default.Component {
249
197
  })]
250
198
  });
251
199
  }
200
+ getDecayList = () => {
201
+ const strippingSelectedTags = this.state.selectedTags !== null // If a value has been chosen by the user...
202
+ ? this.state.selectedTags // ... then set according to the state.
203
+ : this.context.loaded.userHints // Otherwise, if the metadata is loaded, set the default value...
204
+ ? _SelectTag.default.createOptions(this.context.metadata.userHints.decayTags, tag => tag.hide) : []; // ... or empty if not loaded yet
205
+ const filteredDecays = this.context.loaded.decays ? this.filterDecays(strippingSelectedTags) : [];
206
+ const strippingDecayList = /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
207
+ children: this.context.loaded.decays ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_DecaysList.default, {
208
+ decays: filteredDecays,
209
+ selectedDecays: this.state.selectedDecays,
210
+ parentCallback: this.callbackFunction
211
+ }, JSON.stringify(filteredDecays)) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Alert, {
212
+ variant: "warning",
213
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Spinner, {
214
+ size: "sm",
215
+ animation: "border"
216
+ }), " Loading decays..."]
217
+ })
218
+ });
219
+ return strippingDecayList;
220
+ };
221
+ getExtraInputs = () => {
222
+ const strippingSelectedTags = this.state.selectedTags !== null // If a value has been chosen by the user...
223
+ ? this.state.selectedTags // ... then set according to the state.
224
+ : this.context.loaded.userHints // Otherwise, if the metadata is loaded, set the default value...
225
+ ? _SelectTag.default.createOptions(this.context.metadata.userHints.decayTags, tag => tag.hide) : []; // ... or empty if not loaded yet
226
+ const strippingExtraInput = /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
227
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.InputGroup, {
228
+ size: "sm",
229
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.DropdownButton, {
230
+ title: "Tags (" + this.state.tagMatchType + " of):",
231
+ variant: "outline-secondary",
232
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DescriptorsSearch.DropdownMatchTypes, {
233
+ parent: this,
234
+ stateItem: "tagMatchType",
235
+ options: ["any", "all", "none"]
236
+ })
237
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectTag.default, {
238
+ isMulti: true,
239
+ type: "decayTags",
240
+ placeholder: "Decay tags",
241
+ value: strippingSelectedTags,
242
+ onChange: this.updateState("selectedTags"),
243
+ closeMenuOnSelect: false
244
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
245
+ className: "react-select form-control p-0",
246
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.default, {
247
+ placeholder: "Stripping line",
248
+ isClearable: true,
249
+ options: this.context.loaded.stripping ? this.allStrippingLines().map(line => Object({
250
+ value: line,
251
+ label: line
252
+ })) : [],
253
+ onChange: this.updateState("selectedLine"),
254
+ isLoading: !this.context.loaded.stripping
255
+ })
256
+ })]
257
+ })
258
+ });
259
+ return strippingExtraInput;
260
+ };
252
261
  render() {
253
262
  const nSelected = this.state.selectedDecays.length;
254
263
  const {
@@ -330,19 +339,6 @@ class DescriptorsSearch extends _react.default.Component {
330
339
  });
331
340
  }
332
341
  }
333
- _defineProperty(DescriptorsSearch, "contextType", _MetadataContext.default);
334
- _defineProperty(DescriptorsSearch, "variableMatch", (type, conditions) => {
335
- if (type === "all") {
336
- return conditions.every(x => x);
337
- } else if (type === "any") {
338
- return conditions.some(x => x);
339
- } else if (type === "none") {
340
- return !conditions.some(x => x);
341
- } else {
342
- console.error("Unrecognised match type: " + type);
343
- return true;
344
- }
345
- });
346
342
  DescriptorsSearch.propTypes = {
347
343
  rows: _propTypes.default.arrayOf(_propTypes.default.object),
348
344
  parentCallback: _propTypes.default.func,
@@ -8,7 +8,7 @@ var _react = _interopRequireDefault(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _reactBootstrap = require("react-bootstrap");
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  /*****************************************************************************\
13
13
  * (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
14
14
  * *
@@ -9,10 +9,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _Tooltip = _interopRequireDefault(require("react-bootstrap/Tooltip"));
10
10
  var _OverlayTrigger = _interopRequireDefault(require("react-bootstrap/OverlayTrigger"));
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- 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; }
14
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
15
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*****************************************************************************\
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ /*****************************************************************************\
16
14
  * (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
17
15
  * *
18
16
  * This software is distributed under the terms of the GNU General Public *
@@ -22,6 +20,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
22
20
  * granted to it by virtue of its status as an Intergovernmental Organization *
23
21
  * or submit itself to any jurisdiction. *
24
22
  \*****************************************************************************/
23
+
25
24
  const {
26
25
  search
27
26
  } = window.location;
@@ -32,14 +31,11 @@ function compare(a, b) {
32
31
  return Object.keys(a)[0] > Object.keys(b)[0] ? 1 : Object.keys(a)[0] < Object.keys(b)[0] ? -1 : 0;
33
32
  }
34
33
  class ItemSearch extends _react.default.Component {
35
- constructor() {
36
- super(...arguments);
37
- _defineProperty(this, "state", {
38
- items: this.props.data,
39
- label: this.props.label,
40
- searchQuery: query || ""
41
- });
42
- }
34
+ state = (() => ({
35
+ items: this.props.data,
36
+ label: this.props.label,
37
+ searchQuery: query || ""
38
+ }))();
43
39
  filterItems(variables, query) {
44
40
  /*
45
41
  const nInclOptions = variables.filter(