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