lhcb-ntuple-wizard-test 1.0.6 → 1.0.8
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/App.js +1 -1
- package/dist/components/ConfigDict.js +39 -40
- package/dist/components/ConfigList.js +27 -31
- package/dist/components/ConfigNode.js +117 -120
- package/dist/components/ConfigValue.js +18 -21
- package/dist/components/Dataset.js +4 -8
- package/dist/components/Decay.js +2 -2
- package/dist/components/DecayItem.js +46 -50
- package/dist/components/DecayTag.js +4 -5
- package/dist/components/DecayTree.js +147 -151
- package/dist/components/DecaysList.js +35 -39
- package/dist/components/DeleteButton.js +1 -1
- package/dist/components/DescriptorsSearch.js +188 -192
- package/dist/components/EventTypeBadge.js +1 -1
- package/dist/components/ItemSearch.js +8 -12
- package/dist/components/LinesTable.js +463 -459
- package/dist/components/NtupleWizard.js +28 -32
- package/dist/components/ParticleTag.js +4 -5
- package/dist/components/PolarityBadge.js +1 -1
- package/dist/components/SearchItem.js +29 -33
- package/dist/components/SelectParticle.js +6 -10
- package/dist/components/SelectTag.js +5 -6
- package/dist/components/SelectTool.js +5 -6
- package/dist/components/SelectVariables.js +23 -24
- package/dist/components/StrippingBadge.js +4 -5
- package/dist/components/StrippingLine.js +2 -2
- package/dist/components/TupleTool.js +4 -5
- package/dist/components/VariablesSearch.js +8 -12
- package/dist/components/YearBadge.js +1 -1
- package/dist/components/loki/LokiDict.js +180 -0
- package/dist/components/loki/LokiEditor.js +200 -0
- package/dist/components/loki/LokiForm.js +112 -0
- package/dist/components/semantic.js +97 -0
- package/dist/components/semform.js +182 -0
- package/dist/components/worker.js +196 -0
- package/dist/config.json +4 -2
- package/dist/contexts/MetadataContext.js +2 -2
- package/dist/index.js +2 -2
- package/dist/lib/DTTConfig.js +9 -9
- package/dist/lib/utils.js +1 -1
- package/package.json +1 -1
package/dist/components/App.js
CHANGED
|
@@ -11,7 +11,7 @@ var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
|
11
11
|
var _config = _interopRequireDefault(require("../config"));
|
|
12
12
|
var _NtupleWizard = _interopRequireDefault(require("./NtupleWizard"));
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _interopRequireDefault(
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
/*****************************************************************************\
|
|
16
16
|
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
17
17
|
* *
|
|
@@ -8,10 +8,8 @@ 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(
|
|
12
|
-
|
|
13
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
14
|
-
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); } /*****************************************************************************\
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
/*****************************************************************************\
|
|
15
13
|
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
16
14
|
* *
|
|
17
15
|
* This software is distributed under the terms of the GNU General Public *
|
|
@@ -20,53 +18,54 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
20
18
|
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
21
19
|
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
22
20
|
* or submit itself to any jurisdiction. *
|
|
23
|
-
\*****************************************************************************/
|
|
21
|
+
\*****************************************************************************/
|
|
22
|
+
|
|
23
|
+
//import ConfigValue from "./ConfigValue";
|
|
24
|
+
|
|
24
25
|
/*
|
|
25
26
|
* {str:str} -> <ConfigDict /> multiple rows of <input type="text" /> <input type="text" />
|
|
26
27
|
* {str:text} -> <ConfigDict /> multiple rows of <input type="text" /> <textarea />
|
|
27
|
-
*/
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/*
|
|
28
31
|
* Keys have to be unique and not empty...
|
|
29
32
|
* this may cause problems if the callback is executed on every keystroke
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
*/class ConfigDict extends _react.default.Component {
|
|
34
|
+
state = (() => ({
|
|
35
|
+
value: JSON.stringify(this.props.value, null, 2),
|
|
36
|
+
// Object.keys(this.props.value).map((key) => [key, this.props.value[key].valueOf()]),
|
|
37
|
+
edit: false,
|
|
38
|
+
error: ""
|
|
39
|
+
}))();
|
|
40
|
+
toggleEdit = () => {
|
|
41
|
+
this.setState({
|
|
42
|
+
edit: !this.state.edit
|
|
39
43
|
});
|
|
40
|
-
|
|
44
|
+
};
|
|
45
|
+
handleSave = () => {
|
|
46
|
+
try {
|
|
47
|
+
const value = JSON.parse(this.state.value);
|
|
48
|
+
this.props.callback(value);
|
|
41
49
|
this.setState({
|
|
42
|
-
|
|
50
|
+
error: ""
|
|
43
51
|
});
|
|
44
|
-
});
|
|
45
|
-
_defineProperty(this, "handleSave", () => {
|
|
46
|
-
try {
|
|
47
|
-
const value = JSON.parse(this.state.value);
|
|
48
|
-
this.props.callback(value);
|
|
49
|
-
this.setState({
|
|
50
|
-
error: ""
|
|
51
|
-
});
|
|
52
|
-
this.setState({
|
|
53
|
-
edit: false
|
|
54
|
-
});
|
|
55
|
-
} catch (e) {
|
|
56
|
-
this.setState({
|
|
57
|
-
error: "".concat(e)
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
_defineProperty(this, "handleUpdate", event => {
|
|
62
|
-
const {
|
|
63
|
-
value
|
|
64
|
-
} = event.target;
|
|
65
52
|
this.setState({
|
|
66
|
-
|
|
53
|
+
edit: false
|
|
67
54
|
});
|
|
55
|
+
} catch (e) {
|
|
56
|
+
this.setState({
|
|
57
|
+
error: `${e}`
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
handleUpdate = event => {
|
|
62
|
+
const {
|
|
63
|
+
value
|
|
64
|
+
} = event.target;
|
|
65
|
+
this.setState({
|
|
66
|
+
value: value
|
|
68
67
|
});
|
|
69
|
-
}
|
|
68
|
+
};
|
|
70
69
|
render() {
|
|
71
70
|
const errorMessage = this.state.error ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Alert, {
|
|
72
71
|
variant: "danger",
|
|
@@ -10,10 +10,8 @@ var _ConfigValue = _interopRequireDefault(require("./ConfigValue"));
|
|
|
10
10
|
var _reactBootstrap = require("react-bootstrap");
|
|
11
11
|
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(
|
|
14
|
-
|
|
15
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(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
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
/*****************************************************************************\
|
|
17
15
|
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
18
16
|
* *
|
|
19
17
|
* This software is distributed under the terms of the GNU General Public *
|
|
@@ -22,36 +20,34 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
22
20
|
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
23
21
|
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
24
22
|
* or submit itself to any jurisdiction. *
|
|
25
|
-
\*****************************************************************************/
|
|
23
|
+
\*****************************************************************************/
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
26
|
* [int] -> <ConfigList /> multiple rows of <input type="number" step=1 />
|
|
27
27
|
* [uint] -> <ConfigList /> multiple rows of <input type="number" step=1 min=0 />
|
|
28
28
|
* [float] -> <ConfigList /> multiple rows of <input type="number" />
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
listValue.splice(index, 1);
|
|
52
|
-
this.props.callback(listValue);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
29
|
+
*/class ConfigList extends _react.default.Component {
|
|
30
|
+
handleUpdate = index => value => {
|
|
31
|
+
let listValue = this.props.value;
|
|
32
|
+
listValue[index] = value;
|
|
33
|
+
this.props.callback(listValue);
|
|
34
|
+
};
|
|
35
|
+
handleAdd = () => {
|
|
36
|
+
let listValue = this.props.value;
|
|
37
|
+
const index = listValue.length;
|
|
38
|
+
if (index < this.props.defaultValue.length) {
|
|
39
|
+
const defaultValue = this.props.defaultValue[index].valueOf(); // Shallow copy
|
|
40
|
+
listValue.push(defaultValue);
|
|
41
|
+
} else {
|
|
42
|
+
listValue.push(0);
|
|
43
|
+
}
|
|
44
|
+
this.props.callback(listValue);
|
|
45
|
+
};
|
|
46
|
+
handleRemove = index => () => {
|
|
47
|
+
let listValue = this.props.value;
|
|
48
|
+
listValue.splice(index, 1);
|
|
49
|
+
this.props.callback(listValue);
|
|
50
|
+
};
|
|
55
51
|
render() {
|
|
56
52
|
const configurables = this.props.value.map((value, index) => {
|
|
57
53
|
const configProps = {
|
|
@@ -16,10 +16,8 @@ var _reactBootstrap = require("react-bootstrap");
|
|
|
16
16
|
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
17
17
|
var _MetadataContext = _interopRequireDefault(require("../contexts/MetadataContext"));
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
function _interopRequireDefault(
|
|
20
|
-
|
|
21
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
22
|
-
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); } /*****************************************************************************\
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
|
+
/*****************************************************************************\
|
|
23
21
|
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
24
22
|
* *
|
|
25
23
|
* This software is distributed under the terms of the GNU General Public *
|
|
@@ -29,135 +27,134 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
29
27
|
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
30
28
|
* or submit itself to any jurisdiction. *
|
|
31
29
|
\*****************************************************************************/
|
|
30
|
+
|
|
32
31
|
class ParticleConfig extends _react.default.Component {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
static contextType = (() => _MetadataContext.default)();
|
|
33
|
+
state = {
|
|
34
|
+
dtt: this.props.dtt,
|
|
35
|
+
openAddTool: false,
|
|
36
|
+
openConfigTool: false,
|
|
37
|
+
expandedTool: {
|
|
38
|
+
tool: "",
|
|
39
|
+
open: false
|
|
40
|
+
},
|
|
41
|
+
selectedToolClass: "",
|
|
42
|
+
selectedToolName: ""
|
|
43
|
+
};
|
|
44
|
+
handleOpen = type => () => {
|
|
45
|
+
this.setState({
|
|
46
|
+
[`open${type}Tool`]: true
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
handleClose = type => () => {
|
|
50
|
+
this.setState({
|
|
51
|
+
[`open${type}Tool`]: false
|
|
52
|
+
});
|
|
53
|
+
this.clearSelectedTool();
|
|
54
|
+
this.props.parentCallbackClose();
|
|
55
|
+
this.props.parentCallbackUpdated();
|
|
56
|
+
};
|
|
57
|
+
clearSelectedTool = () => {
|
|
58
|
+
this.setState({
|
|
43
59
|
selectedToolClass: "",
|
|
44
60
|
selectedToolName: ""
|
|
45
61
|
});
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
62
|
+
};
|
|
63
|
+
handleRemoveTool = tool => () => {
|
|
64
|
+
this.state.dtt.removeTool(this.props.particleID, tool);
|
|
65
|
+
this.setState({
|
|
66
|
+
dtt: this.state.dtt
|
|
50
67
|
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
68
|
+
this.props.parentCallbackUpdated();
|
|
69
|
+
};
|
|
70
|
+
handleConfigTool = tool => () => {
|
|
71
|
+
const splitArr = tool.split("/");
|
|
72
|
+
const toolClass = splitArr[0];
|
|
73
|
+
const toolName = splitArr.length > 1 ? splitArr[1] : "";
|
|
74
|
+
this.setState({
|
|
75
|
+
openConfigTool: true,
|
|
76
|
+
selectedToolClass: toolClass,
|
|
77
|
+
selectedToolName: toolName
|
|
58
78
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
79
|
+
};
|
|
80
|
+
handleUpdateTool = (tool, parameter) => value => {
|
|
81
|
+
let parameters = this.state.dtt.getToolConfig(this.props.particleID, tool);
|
|
82
|
+
const signalUpdated = parameters[parameter] !== value;
|
|
83
|
+
parameters[parameter] = value;
|
|
84
|
+
this.state.dtt.configureTool(this.props.particleID, tool, parameters);
|
|
85
|
+
this.setState({
|
|
86
|
+
dtt: this.state.dtt
|
|
64
87
|
});
|
|
65
|
-
|
|
66
|
-
this.state.dtt.removeTool(this.props.particleID, tool);
|
|
67
|
-
this.setState({
|
|
68
|
-
dtt: this.state.dtt
|
|
69
|
-
});
|
|
88
|
+
if (signalUpdated) {
|
|
70
89
|
this.props.parentCallbackUpdated();
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
setToolClass = option => {
|
|
93
|
+
this.setState({
|
|
94
|
+
selectedToolClass: option.value
|
|
71
95
|
});
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
selectedToolName: toolName
|
|
80
|
-
});
|
|
96
|
+
};
|
|
97
|
+
setToolName = _ref => {
|
|
98
|
+
let {
|
|
99
|
+
target
|
|
100
|
+
} = _ref;
|
|
101
|
+
this.setState({
|
|
102
|
+
selectedToolName: target.value.replaceAll(/[^\w]/g, "")
|
|
81
103
|
});
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
104
|
+
};
|
|
105
|
+
handleAddTool = () => {
|
|
106
|
+
const {
|
|
107
|
+
selectedToolClass,
|
|
108
|
+
selectedToolName
|
|
109
|
+
} = this.state;
|
|
110
|
+
if (selectedToolClass) {
|
|
111
|
+
this.state.dtt.addTool(this.props.particleID, selectedToolClass, selectedToolName);
|
|
87
112
|
this.setState({
|
|
88
|
-
dtt: this.state.dtt
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
this.props.parentCallbackUpdated();
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
_defineProperty(this, "setToolClass", option => {
|
|
95
|
-
this.setState({
|
|
96
|
-
selectedToolClass: option.value
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
_defineProperty(this, "setToolName", _ref => {
|
|
100
|
-
let {
|
|
101
|
-
target
|
|
102
|
-
} = _ref;
|
|
103
|
-
this.setState({
|
|
104
|
-
selectedToolName: target.value
|
|
113
|
+
dtt: this.state.dtt,
|
|
114
|
+
selectedToolClass: "",
|
|
115
|
+
selectedToolName: ""
|
|
105
116
|
});
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
});
|
|
137
|
-
_defineProperty(this, "getParam", (tool, param) => {
|
|
138
|
-
const toolClass = tool.split("/")[0];
|
|
139
|
-
const toolInterface = this.context.metadata.tupleTools.tupleTools[toolClass].interface;
|
|
140
|
-
const paramInfo = toolInterface.filter(i => i.name === param);
|
|
141
|
-
if (paramInfo.length === 1) {
|
|
142
|
-
return paramInfo[0];
|
|
143
|
-
} else {
|
|
144
|
-
console.warn("Cannot find " + param + " in:");
|
|
145
|
-
console.warn(toolInterface);
|
|
146
|
-
return {
|
|
147
|
-
type: "str",
|
|
148
|
-
description: "Error loading description"
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
_defineProperty(this, "displayDoxygen", () => {
|
|
153
|
-
const html = {
|
|
154
|
-
__html: this.context.metadata.tupleTools.tupleTools[this.state.selectedToolClass].documentation
|
|
117
|
+
this.props.parentCallbackUpdated();
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
getSelectedTool = () => {
|
|
121
|
+
const {
|
|
122
|
+
selectedToolClass,
|
|
123
|
+
selectedToolName
|
|
124
|
+
} = this.state;
|
|
125
|
+
let selectedTool = selectedToolClass;
|
|
126
|
+
if (selectedToolName) {
|
|
127
|
+
selectedTool = `${selectedToolClass}/${selectedToolName}`;
|
|
128
|
+
}
|
|
129
|
+
return selectedTool;
|
|
130
|
+
};
|
|
131
|
+
toolExists = () => {
|
|
132
|
+
const selectedTool = this.getSelectedTool();
|
|
133
|
+
return this.state.dtt.listTools(this.props.particleID).includes(selectedTool);
|
|
134
|
+
};
|
|
135
|
+
getParam = (tool, param) => {
|
|
136
|
+
const toolClass = tool.split("/")[0];
|
|
137
|
+
const toolInterface = this.context.metadata.tupleTools.tupleTools[toolClass].interface;
|
|
138
|
+
const paramInfo = toolInterface.filter(i => i.name === param);
|
|
139
|
+
if (paramInfo.length === 1) {
|
|
140
|
+
return paramInfo[0];
|
|
141
|
+
} else {
|
|
142
|
+
console.warn("Cannot find " + param + " in:");
|
|
143
|
+
console.warn(toolInterface);
|
|
144
|
+
return {
|
|
145
|
+
type: "str",
|
|
146
|
+
description: "Error loading description"
|
|
155
147
|
};
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
displayDoxygen = () => {
|
|
151
|
+
const html = {
|
|
152
|
+
__html: this.context.metadata.tupleTools.tupleTools[this.state.selectedToolClass].documentation
|
|
153
|
+
};
|
|
154
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
155
|
+
dangerouslySetInnerHTML: html
|
|
159
156
|
});
|
|
160
|
-
}
|
|
157
|
+
};
|
|
161
158
|
render() {
|
|
162
159
|
const toolList = this.state.dtt.listTools(this.props.particleID);
|
|
163
160
|
const nTools = toolList.length;
|
|
@@ -278,6 +275,7 @@ class ParticleConfig extends _react.default.Component {
|
|
|
278
275
|
...configProps
|
|
279
276
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConfigValue.default, {
|
|
280
277
|
type: type,
|
|
278
|
+
param: param,
|
|
281
279
|
...configProps
|
|
282
280
|
});
|
|
283
281
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Form.Group, {
|
|
@@ -312,7 +310,6 @@ class ParticleConfig extends _react.default.Component {
|
|
|
312
310
|
});
|
|
313
311
|
}
|
|
314
312
|
}
|
|
315
|
-
_defineProperty(ParticleConfig, "contextType", _MetadataContext.default);
|
|
316
313
|
ParticleConfig.propTypes = {
|
|
317
314
|
dtt: _propTypes.default.object,
|
|
318
315
|
parentCallbackClose: _propTypes.default.func,
|
|
@@ -8,10 +8,8 @@ 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(
|
|
12
|
-
|
|
13
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
14
|
-
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); } /*****************************************************************************\
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
/*****************************************************************************\
|
|
15
13
|
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
16
14
|
* *
|
|
17
15
|
* This software is distributed under the terms of the GNU General Public *
|
|
@@ -20,28 +18,26 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
20
18
|
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
21
19
|
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
22
20
|
* or submit itself to any jurisdiction. *
|
|
23
|
-
\*****************************************************************************/
|
|
21
|
+
\*****************************************************************************/
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
24
|
* bool -> <input type="checkbox" />
|
|
25
25
|
* int -> <input type="number" step=1 />
|
|
26
26
|
* uint -> <input type="number" step=1 min=0 />
|
|
27
27
|
* float -> <input type="number" />
|
|
28
28
|
* str -> <input type="text" />
|
|
29
29
|
* text -> <textarea />
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
_defineProperty(this, "handleCheck", () => {
|
|
42
|
-
this.props.callback(!this.props.value);
|
|
43
|
-
});
|
|
44
|
-
}
|
|
30
|
+
*/class ConfigValue extends _react.default.Component {
|
|
31
|
+
handleUpdate = event => {
|
|
32
|
+
const {
|
|
33
|
+
value
|
|
34
|
+
} = event.target;
|
|
35
|
+
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;
|
|
36
|
+
this.props.callback(sanitisedValue);
|
|
37
|
+
};
|
|
38
|
+
handleCheck = () => {
|
|
39
|
+
this.props.callback(!this.props.value);
|
|
40
|
+
};
|
|
45
41
|
render() {
|
|
46
42
|
const inputType = {
|
|
47
43
|
bool: "switch",
|
|
@@ -80,6 +76,7 @@ ConfigValue.propTypes = {
|
|
|
80
76
|
type: _propTypes.default.string,
|
|
81
77
|
callback: _propTypes.default.func,
|
|
82
78
|
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)])
|
|
79
|
+
defaultValue: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool, _propTypes.default.number, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
80
|
+
param: _propTypes.default.string
|
|
84
81
|
};
|
|
85
82
|
var _default = exports.default = ConfigValue;
|
|
@@ -13,10 +13,8 @@ var _StrippingBadge = _interopRequireDefault(require("./StrippingBadge"));
|
|
|
13
13
|
var _EventTypeBadge = _interopRequireDefault(require("./EventTypeBadge"));
|
|
14
14
|
var _BKPath = _interopRequireDefault(require("../lib/BKPath"));
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
function _interopRequireDefault(
|
|
17
|
-
|
|
18
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(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); } /*****************************************************************************\
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
/*****************************************************************************\
|
|
20
18
|
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
21
19
|
* *
|
|
22
20
|
* This software is distributed under the terms of the GNU General Public *
|
|
@@ -26,11 +24,9 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
26
24
|
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
27
25
|
* or submit itself to any jurisdiction. *
|
|
28
26
|
\*****************************************************************************/
|
|
27
|
+
|
|
29
28
|
class Dataset extends _react.default.Component {
|
|
30
|
-
|
|
31
|
-
super(...arguments);
|
|
32
|
-
_defineProperty(this, "path", new _BKPath.default(this.props.path));
|
|
33
|
-
}
|
|
29
|
+
path = (() => new _BKPath.default(this.props.path))();
|
|
34
30
|
render() {
|
|
35
31
|
const version = this.path.getStrippingVersion();
|
|
36
32
|
const eventType = this.path.getEventType();
|
package/dist/components/Decay.js
CHANGED
|
@@ -9,9 +9,9 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
9
9
|
var _mathjaxReact = require("mathjax-react");
|
|
10
10
|
var _reactBootstrap = require("react-bootstrap");
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
15
|
/*****************************************************************************\
|
|
16
16
|
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
17
17
|
* *
|