lhcb-ntuple-wizard-test 1.3.3 → 2.0.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/README.md +1 -2
- package/package.json +42 -21
- package/dist/components/App.js +0 -99
- package/dist/components/ConfigDict.js +0 -103
- package/dist/components/ConfigList.js +0 -94
- package/dist/components/ConfigNode.js +0 -320
- package/dist/components/ConfigValue.js +0 -86
- package/dist/components/Dataset.js +0 -67
- package/dist/components/Decay.js +0 -50
- package/dist/components/DecayItem.js +0 -101
- package/dist/components/DecayTag.js +0 -52
- package/dist/components/DecayTree.js +0 -451
- package/dist/components/DecaysList.js +0 -107
- package/dist/components/DeleteButton.js +0 -56
- package/dist/components/DescriptorsSearch.js +0 -352
- package/dist/components/EventTypeBadge.js +0 -45
- package/dist/components/ItemSearch.js +0 -120
- package/dist/components/LinesTable.js +0 -1105
- package/dist/components/NtupleWizard.js +0 -142
- package/dist/components/ParticleTag.js +0 -54
- package/dist/components/PolarityBadge.js +0 -35
- package/dist/components/SearchItem.js +0 -99
- package/dist/components/SelectParticle.js +0 -61
- package/dist/components/SelectTag.js +0 -66
- package/dist/components/SelectTool.js +0 -59
- package/dist/components/SelectVariables.js +0 -106
- package/dist/components/StrippingBadge.js +0 -64
- package/dist/components/StrippingLine.js +0 -50
- package/dist/components/TupleTool.js +0 -46
- package/dist/components/VariablesSearch.js +0 -128
- package/dist/components/YearBadge.js +0 -35
- package/dist/config.json +0 -72
- package/dist/contexts/MetadataContext.js +0 -135
- package/dist/index.js +0 -20
- package/dist/lib/BKPath.js +0 -58
- package/dist/lib/DTTConfig.js +0 -178
- package/dist/lib/mathjax.js +0 -35
- package/dist/lib/utils.js +0 -191
- package/dist/style/DecaysList.css +0 -15
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _TupleTool = _interopRequireDefault(require("./TupleTool"));
|
|
10
|
-
var _SelectTool = _interopRequireDefault(require("./SelectTool"));
|
|
11
|
-
var _ConfigValue = _interopRequireDefault(require("./ConfigValue"));
|
|
12
|
-
var _ConfigList = _interopRequireDefault(require("./ConfigList"));
|
|
13
|
-
var _ConfigDict = _interopRequireDefault(require("./ConfigDict"));
|
|
14
|
-
var _DeleteButton = _interopRequireDefault(require("./DeleteButton"));
|
|
15
|
-
var _reactBootstrap = require("react-bootstrap");
|
|
16
|
-
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
17
|
-
var _MetadataContext = _interopRequireDefault(require("../contexts/MetadataContext"));
|
|
18
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
|
-
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; }
|
|
21
|
-
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; }
|
|
22
|
-
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; }
|
|
23
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
24
|
-
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); } /*****************************************************************************\
|
|
25
|
-
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
26
|
-
* *
|
|
27
|
-
* This software is distributed under the terms of the GNU General Public *
|
|
28
|
-
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
29
|
-
* *
|
|
30
|
-
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
31
|
-
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
32
|
-
* or submit itself to any jurisdiction. *
|
|
33
|
-
\*****************************************************************************/
|
|
34
|
-
class ParticleConfig extends _react.default.Component {
|
|
35
|
-
constructor() {
|
|
36
|
-
super(...arguments);
|
|
37
|
-
_defineProperty(this, "state", {
|
|
38
|
-
dtt: this.props.dtt,
|
|
39
|
-
openAddTool: false,
|
|
40
|
-
openConfigTool: false,
|
|
41
|
-
expandedTool: {
|
|
42
|
-
tool: "",
|
|
43
|
-
open: false
|
|
44
|
-
},
|
|
45
|
-
selectedToolClass: "",
|
|
46
|
-
selectedToolName: ""
|
|
47
|
-
});
|
|
48
|
-
_defineProperty(this, "handleOpen", type => () => {
|
|
49
|
-
this.setState({
|
|
50
|
-
["open".concat(type, "Tool")]: true
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
_defineProperty(this, "handleClose", type => () => {
|
|
54
|
-
this.setState({
|
|
55
|
-
["open".concat(type, "Tool")]: false
|
|
56
|
-
});
|
|
57
|
-
this.clearSelectedTool();
|
|
58
|
-
this.props.parentCallbackClose();
|
|
59
|
-
this.props.parentCallbackUpdated();
|
|
60
|
-
});
|
|
61
|
-
_defineProperty(this, "clearSelectedTool", () => {
|
|
62
|
-
this.setState({
|
|
63
|
-
selectedToolClass: "",
|
|
64
|
-
selectedToolName: ""
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
_defineProperty(this, "handleRemoveTool", tool => () => {
|
|
68
|
-
this.state.dtt.removeTool(this.props.particleID, tool);
|
|
69
|
-
this.setState({
|
|
70
|
-
dtt: this.state.dtt
|
|
71
|
-
});
|
|
72
|
-
this.props.parentCallbackUpdated();
|
|
73
|
-
});
|
|
74
|
-
_defineProperty(this, "handleConfigTool", tool => () => {
|
|
75
|
-
const splitArr = tool.split("/");
|
|
76
|
-
const toolClass = splitArr[0];
|
|
77
|
-
const toolName = splitArr.length > 1 ? splitArr[1] : "";
|
|
78
|
-
this.setState({
|
|
79
|
-
openConfigTool: true,
|
|
80
|
-
selectedToolClass: toolClass,
|
|
81
|
-
selectedToolName: toolName
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
_defineProperty(this, "handleUpdateTool", (tool, parameter) => value => {
|
|
85
|
-
let parameters = this.state.dtt.getToolConfig(this.props.particleID, tool);
|
|
86
|
-
const signalUpdated = parameters[parameter] !== value;
|
|
87
|
-
parameters[parameter] = value;
|
|
88
|
-
this.state.dtt.configureTool(this.props.particleID, tool, parameters);
|
|
89
|
-
this.setState({
|
|
90
|
-
dtt: this.state.dtt
|
|
91
|
-
});
|
|
92
|
-
if (signalUpdated) {
|
|
93
|
-
this.props.parentCallbackUpdated();
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
_defineProperty(this, "setToolClass", option => {
|
|
97
|
-
this.setState({
|
|
98
|
-
selectedToolClass: option.value
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
_defineProperty(this, "setToolName", _ref => {
|
|
102
|
-
let {
|
|
103
|
-
target
|
|
104
|
-
} = _ref;
|
|
105
|
-
this.setState({
|
|
106
|
-
selectedToolName: target.value.replaceAll(/[^\w]/g, "")
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
_defineProperty(this, "handleAddTool", () => {
|
|
110
|
-
const {
|
|
111
|
-
selectedToolClass,
|
|
112
|
-
selectedToolName
|
|
113
|
-
} = this.state;
|
|
114
|
-
if (selectedToolClass) {
|
|
115
|
-
this.state.dtt.addTool(this.props.particleID, selectedToolClass, selectedToolName);
|
|
116
|
-
this.setState({
|
|
117
|
-
dtt: this.state.dtt,
|
|
118
|
-
selectedToolClass: "",
|
|
119
|
-
selectedToolName: ""
|
|
120
|
-
});
|
|
121
|
-
this.props.parentCallbackUpdated();
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
_defineProperty(this, "getSelectedTool", () => {
|
|
125
|
-
const {
|
|
126
|
-
selectedToolClass,
|
|
127
|
-
selectedToolName
|
|
128
|
-
} = this.state;
|
|
129
|
-
let selectedTool = selectedToolClass;
|
|
130
|
-
if (selectedToolName) {
|
|
131
|
-
selectedTool = "".concat(selectedToolClass, "/").concat(selectedToolName);
|
|
132
|
-
}
|
|
133
|
-
return selectedTool;
|
|
134
|
-
});
|
|
135
|
-
_defineProperty(this, "toolExists", () => {
|
|
136
|
-
const selectedTool = this.getSelectedTool();
|
|
137
|
-
return this.state.dtt.listTools(this.props.particleID).includes(selectedTool);
|
|
138
|
-
});
|
|
139
|
-
_defineProperty(this, "getParam", (tool, param) => {
|
|
140
|
-
const toolClass = tool.split("/")[0];
|
|
141
|
-
const toolInterface = this.context.metadata.tupleTools.tupleTools[toolClass].interface;
|
|
142
|
-
const paramInfo = toolInterface.filter(i => i.name === param);
|
|
143
|
-
if (paramInfo.length === 1) {
|
|
144
|
-
return paramInfo[0];
|
|
145
|
-
} else {
|
|
146
|
-
console.warn("Cannot find " + param + " in:");
|
|
147
|
-
console.warn(toolInterface);
|
|
148
|
-
return {
|
|
149
|
-
type: "str",
|
|
150
|
-
description: "Error loading description"
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
_defineProperty(this, "displayDoxygen", () => {
|
|
155
|
-
const html = {
|
|
156
|
-
__html: this.context.metadata.tupleTools.tupleTools[this.state.selectedToolClass].documentation
|
|
157
|
-
};
|
|
158
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
159
|
-
dangerouslySetInnerHTML: html
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
render() {
|
|
164
|
-
const toolList = this.state.dtt.listTools(this.props.particleID);
|
|
165
|
-
const nTools = toolList.length;
|
|
166
|
-
const selectedTool = this.getSelectedTool();
|
|
167
|
-
const toolDocs = selectedTool ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Accordion, {
|
|
168
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Accordion.Item, {
|
|
169
|
-
eventKey: "0",
|
|
170
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Accordion.Header, {
|
|
171
|
-
children: ["Documentation for ", this.state.selectedToolClass]
|
|
172
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Accordion.Body, {
|
|
173
|
-
children: this.context.loaded.tupleTools ? this.displayDoxygen() : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Spinner, {
|
|
174
|
-
animation: "outline"
|
|
175
|
-
})
|
|
176
|
-
})]
|
|
177
|
-
})
|
|
178
|
-
}) : "";
|
|
179
|
-
const selectToolProps = this.state.selectedToolClass === "" ? {
|
|
180
|
-
value: null
|
|
181
|
-
} : {};
|
|
182
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
183
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Card, {
|
|
184
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Card.Header, {
|
|
185
|
-
className: "d-flex justify-content-between align-items-start",
|
|
186
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
187
|
-
children: [nTools, " TupleTool", nTools === 1 ? "" : "s"]
|
|
188
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Button, {
|
|
189
|
-
variant: "success",
|
|
190
|
-
size: "sm",
|
|
191
|
-
onClick: this.handleOpen("Add"),
|
|
192
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrapIcons.PlusLg, {})
|
|
193
|
-
})]
|
|
194
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.ListGroup, {
|
|
195
|
-
variant: "flush",
|
|
196
|
-
children: toolList.map(toolName => {
|
|
197
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.ListGroup.Item, {
|
|
198
|
-
className: "d-flex justify-content-between align-items-start",
|
|
199
|
-
variant: toolName === selectedTool ? "secondary" : "",
|
|
200
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TupleTool.default, {
|
|
201
|
-
tool: toolName
|
|
202
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.ButtonGroup, {
|
|
203
|
-
size: "sm",
|
|
204
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Button, {
|
|
205
|
-
variant: "outline-secondary",
|
|
206
|
-
onClick: this.handleConfigTool(toolName),
|
|
207
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrapIcons.PencilSquare, {})
|
|
208
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DeleteButton.default, {
|
|
209
|
-
outline: true,
|
|
210
|
-
action: this.handleRemoveTool(toolName)
|
|
211
|
-
})]
|
|
212
|
-
})]
|
|
213
|
-
}, toolName);
|
|
214
|
-
})
|
|
215
|
-
})]
|
|
216
|
-
}), this.state.openAddTool ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Modal, {
|
|
217
|
-
show: true,
|
|
218
|
-
onHide: this.handleClose("Add"),
|
|
219
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Modal.Header, {
|
|
220
|
-
closeButton: true,
|
|
221
|
-
children: "Add TupleTool"
|
|
222
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Modal.Body, {
|
|
223
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.InputGroup, {
|
|
224
|
-
hasValidation: true,
|
|
225
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectTool.default, _objectSpread({
|
|
226
|
-
filterToolTags: this.props.filterToolTags,
|
|
227
|
-
placeholder: "TupleTool class",
|
|
228
|
-
onChange: this.setToolClass
|
|
229
|
-
}, selectToolProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.FormControl, {
|
|
230
|
-
placeholder: "TupleTool name",
|
|
231
|
-
onChange: this.setToolName,
|
|
232
|
-
disabled: this.state.selectedToolClass === "",
|
|
233
|
-
value: this.state.selectedToolName,
|
|
234
|
-
isInvalid: this.toolExists()
|
|
235
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.FormControl.Feedback, {
|
|
236
|
-
type: "invalid",
|
|
237
|
-
children: ["A ", this.state.selectedToolClass, " with the name \"", this.state.selectedToolName, "\" already exists"]
|
|
238
|
-
})]
|
|
239
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Button, {
|
|
240
|
-
variant: "success",
|
|
241
|
-
disabled: !this.state.selectedToolClass || this.toolExists(),
|
|
242
|
-
onClick: this.handleAddTool,
|
|
243
|
-
children: "Add tool"
|
|
244
|
-
}), toolDocs]
|
|
245
|
-
})]
|
|
246
|
-
}) : "", this.state.openConfigTool ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Modal, {
|
|
247
|
-
show: true,
|
|
248
|
-
size: "xl",
|
|
249
|
-
fullscreen: "lg-down",
|
|
250
|
-
onHide: this.handleClose("Config"),
|
|
251
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Modal.Header, {
|
|
252
|
-
closeButton: true,
|
|
253
|
-
children: ["Configure ", selectedTool]
|
|
254
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Modal.Body, {
|
|
255
|
-
children: [selectedTool ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Form, {
|
|
256
|
-
children: Object.entries(this.state.dtt.getToolConfig(this.props.particleID, selectedTool)).map(_ref2 => {
|
|
257
|
-
let [param, value] = _ref2;
|
|
258
|
-
const paramObj = _objectSpread({}, this.getParam(selectedTool, param));
|
|
259
|
-
const {
|
|
260
|
-
description,
|
|
261
|
-
type
|
|
262
|
-
} = paramObj;
|
|
263
|
-
const defaultValue = paramObj["default"]; // TODO: get rid of JS keywords from metadata
|
|
264
|
-
const list_re = /\[(\w+)\]/;
|
|
265
|
-
const dict_re = /\{(\w+):(\w+)\}/;
|
|
266
|
-
const configProps = {
|
|
267
|
-
value: value,
|
|
268
|
-
defaultValue: defaultValue,
|
|
269
|
-
callback: this.handleUpdateTool(selectedTool, param)
|
|
270
|
-
};
|
|
271
|
-
const inputBox = type.match(list_re) !== null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConfigList.default, _objectSpread({
|
|
272
|
-
type: type.match(list_re)[1]
|
|
273
|
-
}, configProps)) : type.match(dict_re) !== null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConfigDict.default, _objectSpread({
|
|
274
|
-
keyType: type.match(dict_re)[1],
|
|
275
|
-
valType: type.match(dict_re)[2]
|
|
276
|
-
}, configProps)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConfigValue.default, _objectSpread({
|
|
277
|
-
type: type,
|
|
278
|
-
param: param
|
|
279
|
-
}, configProps));
|
|
280
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Form.Group, {
|
|
281
|
-
as: _reactBootstrap.Row,
|
|
282
|
-
className: "mb-2",
|
|
283
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Form.Label, {
|
|
284
|
-
column: true,
|
|
285
|
-
sm: 3,
|
|
286
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.OverlayTrigger, {
|
|
287
|
-
overlay: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Tooltip, {
|
|
288
|
-
children: description
|
|
289
|
-
}),
|
|
290
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrapIcons.QuestionCircle, {})
|
|
291
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("code", {
|
|
292
|
-
children: [" ", param, " "]
|
|
293
|
-
})]
|
|
294
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Form.Label, {
|
|
295
|
-
column: true,
|
|
296
|
-
sm: 2,
|
|
297
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("code", {
|
|
298
|
-
children: [" ", type, " "]
|
|
299
|
-
})
|
|
300
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Col, {
|
|
301
|
-
sm: 7,
|
|
302
|
-
children: inputBox
|
|
303
|
-
})]
|
|
304
|
-
}, param);
|
|
305
|
-
})
|
|
306
|
-
}) : "No tool selected", toolDocs]
|
|
307
|
-
})]
|
|
308
|
-
}) : ""]
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
_defineProperty(ParticleConfig, "contextType", _MetadataContext.default);
|
|
313
|
-
ParticleConfig.propTypes = {
|
|
314
|
-
dtt: _propTypes.default.object,
|
|
315
|
-
parentCallbackClose: _propTypes.default.func,
|
|
316
|
-
parentCallbackUpdated: _propTypes.default.func,
|
|
317
|
-
particleID: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
318
|
-
filterToolTags: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
319
|
-
};
|
|
320
|
-
var _default = exports.default = ParticleConfig;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _reactBootstrap = require("react-bootstrap");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
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); } /*****************************************************************************\
|
|
17
|
-
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
18
|
-
* *
|
|
19
|
-
* This software is distributed under the terms of the GNU General Public *
|
|
20
|
-
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
21
|
-
* *
|
|
22
|
-
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
23
|
-
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
24
|
-
* or submit itself to any jurisdiction. *
|
|
25
|
-
\*****************************************************************************/ /*
|
|
26
|
-
* bool -> <input type="checkbox" />
|
|
27
|
-
* int -> <input type="number" step=1 />
|
|
28
|
-
* uint -> <input type="number" step=1 min=0 />
|
|
29
|
-
* float -> <input type="number" />
|
|
30
|
-
* str -> <input type="text" />
|
|
31
|
-
* text -> <textarea />
|
|
32
|
-
*/
|
|
33
|
-
class ConfigValue extends _react.default.Component {
|
|
34
|
-
constructor() {
|
|
35
|
-
super(...arguments);
|
|
36
|
-
_defineProperty(this, "handleUpdate", event => {
|
|
37
|
-
const {
|
|
38
|
-
value
|
|
39
|
-
} = event.target;
|
|
40
|
-
const sanitisedValue = this.props.type === "int" ? Math.trunc(value) : this.props.type === "uint" ? Math.trunc(Math.abs(value)) : this.props.type === "text" ? value.split(/\r?\n/) : this.props.param === "ExtraName" ? value.replaceAll(/[^\w]/g, "") : value;
|
|
41
|
-
this.props.callback(sanitisedValue);
|
|
42
|
-
});
|
|
43
|
-
_defineProperty(this, "handleCheck", () => {
|
|
44
|
-
this.props.callback(!this.props.value);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
render() {
|
|
48
|
-
const inputType = {
|
|
49
|
-
bool: "switch",
|
|
50
|
-
float: "number",
|
|
51
|
-
int: "number",
|
|
52
|
-
uint: "number",
|
|
53
|
-
str: "text",
|
|
54
|
-
text: "textarea"
|
|
55
|
-
}[this.props.type];
|
|
56
|
-
if (this.props.type === "bool") {
|
|
57
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Form.Check, {
|
|
58
|
-
onChange: this.handleCheck,
|
|
59
|
-
type: inputType,
|
|
60
|
-
checked: this.props.value
|
|
61
|
-
});
|
|
62
|
-
} else {
|
|
63
|
-
let inputBoxProps = {
|
|
64
|
-
onChange: this.handleUpdate,
|
|
65
|
-
placeholder: inputType === "textarea" ? this.props.defaultValue.join("\n") : this.props.defaultValue,
|
|
66
|
-
value: inputType === "textarea" ? this.props.value.join("\n") : this.props.value
|
|
67
|
-
};
|
|
68
|
-
inputBoxProps[inputType === "textarea" ? "as" : "type"] = inputType;
|
|
69
|
-
if (this.props.type.includes("int")) {
|
|
70
|
-
inputBoxProps.step = 1;
|
|
71
|
-
if (this.props.type === "uint") {
|
|
72
|
-
inputBoxProps.min = 0;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Form.Control, _objectSpread({}, inputBoxProps));
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
ConfigValue.propTypes = {
|
|
80
|
-
type: _propTypes.default.string,
|
|
81
|
-
callback: _propTypes.default.func,
|
|
82
|
-
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool, _propTypes.default.number, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
83
|
-
defaultValue: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool, _propTypes.default.number, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
84
|
-
param: _propTypes.default.string
|
|
85
|
-
};
|
|
86
|
-
var _default = exports.default = ConfigValue;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _reactBootstrap = require("react-bootstrap");
|
|
10
|
-
var _YearBadge = _interopRequireDefault(require("./YearBadge"));
|
|
11
|
-
var _PolarityBadge = _interopRequireDefault(require("./PolarityBadge"));
|
|
12
|
-
var _StrippingBadge = _interopRequireDefault(require("./StrippingBadge"));
|
|
13
|
-
var _EventTypeBadge = _interopRequireDefault(require("./EventTypeBadge"));
|
|
14
|
-
var _BKPath = _interopRequireDefault(require("../lib/BKPath"));
|
|
15
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
-
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; }
|
|
18
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
19
|
-
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
|
-
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
21
|
-
* *
|
|
22
|
-
* This software is distributed under the terms of the GNU General Public *
|
|
23
|
-
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
24
|
-
* *
|
|
25
|
-
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
26
|
-
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
27
|
-
* or submit itself to any jurisdiction. *
|
|
28
|
-
\*****************************************************************************/
|
|
29
|
-
class Dataset extends _react.default.Component {
|
|
30
|
-
constructor() {
|
|
31
|
-
super(...arguments);
|
|
32
|
-
_defineProperty(this, "path", new _BKPath.default(this.props.path));
|
|
33
|
-
}
|
|
34
|
-
render() {
|
|
35
|
-
const version = this.path.getStrippingVersion();
|
|
36
|
-
const eventType = this.path.getEventType();
|
|
37
|
-
const year = this.path.getYear();
|
|
38
|
-
const polarity = this.path.getPolarity();
|
|
39
|
-
const filename = this.path.getFilename();
|
|
40
|
-
const strippingInfo = /*#__PURE__*/(0, _jsxRuntime.jsx)(_StrippingBadge.default, {
|
|
41
|
-
version: version
|
|
42
|
-
});
|
|
43
|
-
const eventTypeInfo = /*#__PURE__*/(0, _jsxRuntime.jsx)(_EventTypeBadge.default, {
|
|
44
|
-
eventType: eventType
|
|
45
|
-
});
|
|
46
|
-
const yearInfo = /*#__PURE__*/(0, _jsxRuntime.jsx)(_YearBadge.default, {
|
|
47
|
-
year: year
|
|
48
|
-
});
|
|
49
|
-
const polarityInfo = /*#__PURE__*/(0, _jsxRuntime.jsx)(_PolarityBadge.default, {
|
|
50
|
-
polarity: polarity
|
|
51
|
-
});
|
|
52
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
53
|
-
children: [filename, /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Stack, {
|
|
54
|
-
direction: "horizontal",
|
|
55
|
-
style: {
|
|
56
|
-
flexWrap: "wrap"
|
|
57
|
-
},
|
|
58
|
-
gap: 1,
|
|
59
|
-
children: [eventTypeInfo, " ", yearInfo, " ", polarityInfo, " ", strippingInfo]
|
|
60
|
-
})]
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
Dataset.propTypes = {
|
|
65
|
-
path: _propTypes.default.string
|
|
66
|
-
};
|
|
67
|
-
var _default = exports.default = Dataset;
|
package/dist/components/Decay.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _mathjaxReact = require("mathjax-react");
|
|
10
|
-
var _reactBootstrap = require("react-bootstrap");
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
-
/*****************************************************************************\
|
|
15
|
-
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
16
|
-
* *
|
|
17
|
-
* This software is distributed under the terms of the GNU General Public *
|
|
18
|
-
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
19
|
-
* *
|
|
20
|
-
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
21
|
-
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
22
|
-
* or submit itself to any jurisdiction. *
|
|
23
|
-
\*****************************************************************************/
|
|
24
|
-
|
|
25
|
-
class Decay extends React.Component {
|
|
26
|
-
render() {
|
|
27
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.OverlayTrigger, {
|
|
28
|
-
overlay: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Popover, {
|
|
29
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Popover.Header, {
|
|
30
|
-
children: "LoKi descriptor"
|
|
31
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Popover.Body, {
|
|
32
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("code", {
|
|
33
|
-
children: this.props.decay.descriptors.plain
|
|
34
|
-
})
|
|
35
|
-
})]
|
|
36
|
-
}),
|
|
37
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
38
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mathjaxReact.MathComponent, {
|
|
39
|
-
tex: this.props.decay.descriptors.latex,
|
|
40
|
-
display: this.props.display
|
|
41
|
-
})
|
|
42
|
-
})
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
Decay.propTypes = {
|
|
47
|
-
decay: _propTypes.default.object,
|
|
48
|
-
display: _propTypes.default.bool
|
|
49
|
-
};
|
|
50
|
-
var _default = exports.default = Decay;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _reactBootstrap = require("react-bootstrap");
|
|
10
|
-
var _StrippingLine = _interopRequireDefault(require("./StrippingLine"));
|
|
11
|
-
var _Decay = _interopRequireDefault(require("./Decay"));
|
|
12
|
-
var _DecayTag = _interopRequireDefault(require("./DecayTag"));
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: 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); } /*****************************************************************************\
|
|
18
|
-
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
19
|
-
* *
|
|
20
|
-
* This software is distributed under the terms of the GNU General Public *
|
|
21
|
-
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
22
|
-
* *
|
|
23
|
-
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
24
|
-
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
25
|
-
* or submit itself to any jurisdiction. *
|
|
26
|
-
\*****************************************************************************/
|
|
27
|
-
class DecayItem extends _react.default.Component {
|
|
28
|
-
constructor() {
|
|
29
|
-
super(...arguments);
|
|
30
|
-
_defineProperty(this, "state", {
|
|
31
|
-
selected: this.props.selected,
|
|
32
|
-
decay: this.props.decay
|
|
33
|
-
});
|
|
34
|
-
_defineProperty(this, "sendData", () => {
|
|
35
|
-
this.props.parentCallback(this.state);
|
|
36
|
-
});
|
|
37
|
-
_defineProperty(this, "select", () => {
|
|
38
|
-
this.setState({
|
|
39
|
-
selected: this.state.selected ? false : true
|
|
40
|
-
});
|
|
41
|
-
this.sendData();
|
|
42
|
-
});
|
|
43
|
-
_defineProperty(this, "getExtraInfo", () => {
|
|
44
|
-
const nLines = Object.keys(this.props.decay.lines).length;
|
|
45
|
-
const nTags = this.props.decay.tags.length;
|
|
46
|
-
const tagInfo = this.props.decay.tags.map(tag => /*#__PURE__*/(0, _jsxRuntime.jsx)(_DecayTag.default, {
|
|
47
|
-
tag: tag
|
|
48
|
-
}, tag));
|
|
49
|
-
const strippingInfo = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
50
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.OverlayTrigger, {
|
|
51
|
-
placement: "right",
|
|
52
|
-
overlay: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Popover, {
|
|
53
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Popover.Header, {
|
|
54
|
-
children: "Stripping lines"
|
|
55
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Popover.Body, {
|
|
56
|
-
children: Object.keys(this.props.decay.lines).map(line => {
|
|
57
|
-
const [stream, name] = line.split("/");
|
|
58
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_StrippingLine.default, {
|
|
59
|
-
line: name,
|
|
60
|
-
stream: stream,
|
|
61
|
-
versions: this.props.decay.lines[line]
|
|
62
|
-
}, line);
|
|
63
|
-
})
|
|
64
|
-
})]
|
|
65
|
-
}),
|
|
66
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Badge, {
|
|
67
|
-
pill: true,
|
|
68
|
-
bg: this.state.selected ? "primary" : "secondary",
|
|
69
|
-
children: [nLines, " Stripping line", nLines === 1 ? "" : "s"]
|
|
70
|
-
})
|
|
71
|
-
}), nTags > 0 ? tagInfo : ""]
|
|
72
|
-
});
|
|
73
|
-
return strippingInfo;
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
render() {
|
|
77
|
-
const extraInfo = this.getExtraInfo();
|
|
78
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.ListGroup.Item, {
|
|
79
|
-
as: "li",
|
|
80
|
-
onClick: this.select,
|
|
81
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.InputGroup, {
|
|
82
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.InputGroup.Checkbox, {
|
|
83
|
-
checked: this.state.selected,
|
|
84
|
-
readOnly: true
|
|
85
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
86
|
-
className: "react-select form-control p-2 " + (this.state.selected ? "list-group-item-primary" : "list-group-item-light"),
|
|
87
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Decay.default, {
|
|
88
|
-
decay: this.props.decay,
|
|
89
|
-
display: false
|
|
90
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), extraInfo]
|
|
91
|
-
})]
|
|
92
|
-
})
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
DecayItem.propTypes = {
|
|
97
|
-
selected: _propTypes.default.bool,
|
|
98
|
-
decay: _propTypes.default.object,
|
|
99
|
-
parentCallback: _propTypes.default.func
|
|
100
|
-
};
|
|
101
|
-
var _default = exports.default = DecayItem;
|