@esrf/daiquiri-lib 0.1.0 → 0.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/README.md +2 -2
- package/dist/index.d.ts +28 -1
- package/dist/index.esm.js +696 -578
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/index.ts +14 -0
- package/src/scss/_monitorpanel.scss +38 -0
- package/src/scss/main.scss +1 -0
package/dist/index.esm.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { map as C, each as
|
|
3
|
-
import { Badge as D, ButtonGroup as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
function
|
|
1
|
+
import { jsxs as l, jsx as r, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { map as C, each as ve } from "lodash";
|
|
3
|
+
import { Badge as D, ButtonGroup as oe, Button as y, OverlayTrigger as F, Popover as b, Container as $, Row as P, Col as E, Form as N, InputGroup as M, Alert as x, Tab as be, Tabs as te, Tooltip as Ne } from "react-bootstrap";
|
|
4
|
+
import { forwardRef as Ce, useRef as R, useState as k, useEffect as j, Component as se, Fragment as U, Children as Oe, isValidElement as Se, cloneElement as Ee, Suspense as ne, useMemo as xe, createElement as Me } from "react";
|
|
5
|
+
import T from "classnames";
|
|
6
|
+
import Ae from "debug";
|
|
7
|
+
function ke(e) {
|
|
8
8
|
const {
|
|
9
9
|
activeMessage: t = "Online",
|
|
10
|
-
inactiveMessage:
|
|
10
|
+
inactiveMessage: n = "Offline",
|
|
11
11
|
message: i = "This device is"
|
|
12
12
|
} = e;
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ r(
|
|
14
14
|
"div",
|
|
15
15
|
{
|
|
16
16
|
className: `dot-indicator small bg-${e.online ? "success" : "danger"}`,
|
|
17
|
-
title: `${i} ${e.online ? t :
|
|
17
|
+
title: `${i} ${e.online ? t : n}`
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
function I(e) {
|
|
22
|
-
const { name: t, icon:
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
22
|
+
const { name: t, icon: n } = e;
|
|
23
|
+
return /* @__PURE__ */ l("div", { className: "icon", title: t, children: [
|
|
24
|
+
/* @__PURE__ */ r("i", { className: `fa ${n}` }),
|
|
25
|
+
/* @__PURE__ */ r(ke, { ...e })
|
|
26
26
|
] });
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Ie(e) {
|
|
29
29
|
const t = {
|
|
30
30
|
24: "Y",
|
|
31
31
|
21: "Z",
|
|
@@ -43,39 +43,39 @@ function Oe(e) {
|
|
|
43
43
|
"-18": "a",
|
|
44
44
|
"-21": "z",
|
|
45
45
|
"-24": "y"
|
|
46
|
-
},
|
|
46
|
+
}, n = Math.log(e) / Math.log(1e3), i = !Number.isInteger(n), a = 3 * Math.ceil(n - (i ? 1 : 0)), o = a === 0 ? "" : t[a];
|
|
47
47
|
return {
|
|
48
48
|
scalar: e * 10 ** -a,
|
|
49
49
|
prefix: o,
|
|
50
50
|
multiplier: 10 ** -a
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function $e(e) {
|
|
54
54
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function le(e) {
|
|
57
57
|
if (e < 60)
|
|
58
58
|
return `${Math.round(e)} sec`;
|
|
59
|
-
const t = Math.round(e / 60),
|
|
60
|
-
return i ? `${i} hr ${
|
|
59
|
+
const t = Math.round(e / 60), n = t % 60, i = Math.floor(t / 60);
|
|
60
|
+
return i ? `${i} hr ${n} min` : `${n} min`;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function De(e) {
|
|
63
63
|
return e > 0 ? (662607004e-42 * 299792458 / (e * 1e-10) / 160218e-24 * 1e-3).toFixed(4) : 0;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function Fe(e, t) {
|
|
66
66
|
return Number.parseFloat(e.toFixed(t));
|
|
67
67
|
}
|
|
68
|
-
const
|
|
68
|
+
const Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
69
69
|
__proto__: null,
|
|
70
|
-
formatEng:
|
|
71
|
-
round:
|
|
72
|
-
toEnergy:
|
|
73
|
-
toHoursMins:
|
|
74
|
-
ucfirst:
|
|
70
|
+
formatEng: Ie,
|
|
71
|
+
round: Fe,
|
|
72
|
+
toEnergy: De,
|
|
73
|
+
toHoursMins: le,
|
|
74
|
+
ucfirst: $e
|
|
75
75
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
76
|
-
function
|
|
76
|
+
function Re(e) {
|
|
77
77
|
const { hardware: t } = e;
|
|
78
|
-
function
|
|
78
|
+
function n(d) {
|
|
79
79
|
t.requestChange({
|
|
80
80
|
function: "reset"
|
|
81
81
|
});
|
|
@@ -87,67 +87,67 @@ function Me(e) {
|
|
|
87
87
|
}, a = {
|
|
88
88
|
Current: `${t.properties.current.toFixed(1)} mA`,
|
|
89
89
|
Mode: t.properties.mode,
|
|
90
|
-
Refill:
|
|
91
|
-
Message: /* @__PURE__ */
|
|
90
|
+
Refill: le(t.properties.refill),
|
|
91
|
+
Message: /* @__PURE__ */ r("pre", { children: t.properties.message })
|
|
92
92
|
};
|
|
93
93
|
function o(d) {
|
|
94
94
|
if (!(d in t.properties))
|
|
95
95
|
return "UNKNOWN";
|
|
96
|
-
const
|
|
97
|
-
return !
|
|
96
|
+
const s = t.properties[d];
|
|
97
|
+
return !s || typeof s != "string" ? "UNKNOWN" : s;
|
|
98
98
|
}
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
|
|
99
|
+
return /* @__PURE__ */ r(
|
|
100
|
+
F,
|
|
101
101
|
{
|
|
102
102
|
trigger: "click",
|
|
103
103
|
rootClose: !0,
|
|
104
|
-
overlay: /* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */
|
|
104
|
+
overlay: /* @__PURE__ */ l(b, { id: "popid", children: [
|
|
105
|
+
/* @__PURE__ */ l(b.Header, { children: [
|
|
106
106
|
t.name,
|
|
107
107
|
" Details"
|
|
108
108
|
] }),
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
|
|
109
|
+
/* @__PURE__ */ l(b.Body, { children: [
|
|
110
|
+
/* @__PURE__ */ r("h6", { children: "Status" }),
|
|
111
|
+
/* @__PURE__ */ r("pre", { children: t.properties.status }),
|
|
112
|
+
/* @__PURE__ */ r("h6", { children: "Interlocks" }),
|
|
113
|
+
/* @__PURE__ */ r($, { children: C(i, (d, s) => /* @__PURE__ */ l(P, { children: [
|
|
114
|
+
/* @__PURE__ */ l(E, { children: [
|
|
115
|
+
s,
|
|
116
116
|
":"
|
|
117
117
|
] }),
|
|
118
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ r(E, { children: /* @__PURE__ */ r(
|
|
119
119
|
D,
|
|
120
120
|
{
|
|
121
121
|
bg: o(d) === "ON" ? "success" : "danger",
|
|
122
122
|
children: o(d)
|
|
123
123
|
}
|
|
124
124
|
) })
|
|
125
|
-
] },
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
|
|
125
|
+
] }, s)) }),
|
|
126
|
+
/* @__PURE__ */ r("h6", { children: "Ring Status" }),
|
|
127
|
+
/* @__PURE__ */ r($, { children: C(a, (d, s) => /* @__PURE__ */ l(P, { children: [
|
|
128
|
+
/* @__PURE__ */ l(E, { children: [
|
|
129
|
+
s,
|
|
130
130
|
":"
|
|
131
131
|
] }),
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
] },
|
|
134
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ r(E, { children: d })
|
|
133
|
+
] }, s)) }),
|
|
134
|
+
/* @__PURE__ */ r("div", { className: "d-grid gap-2", children: /* @__PURE__ */ r(y, { disabled: e.disabled, onClick: n, children: "Reset" }) })
|
|
135
135
|
] })
|
|
136
136
|
] }),
|
|
137
|
-
children: /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ r(y, { className: "flex-grow-0", title: "Shutter Details", children: /* @__PURE__ */ r("i", { className: "fa fa-ellipsis-h" }) })
|
|
138
138
|
}
|
|
139
139
|
);
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
const { hardware: t, options:
|
|
141
|
+
function _t(e) {
|
|
142
|
+
const { hardware: t, options: n = {} } = e;
|
|
143
143
|
function i(a) {
|
|
144
144
|
t.requestChange({
|
|
145
145
|
function: t.properties.frontend === "FE open" ? "close" : "open"
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
return /* @__PURE__ */
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */
|
|
148
|
+
return /* @__PURE__ */ l("div", { className: "hw-component", children: [
|
|
149
|
+
/* @__PURE__ */ l("div", { className: "hw-head", children: [
|
|
150
|
+
/* @__PURE__ */ r(
|
|
151
151
|
I,
|
|
152
152
|
{
|
|
153
153
|
name: "Frontend",
|
|
@@ -155,8 +155,8 @@ function Et(e) {
|
|
|
155
155
|
online: t.online
|
|
156
156
|
}
|
|
157
157
|
),
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ r("div", { className: "name", children: t.name }),
|
|
159
|
+
/* @__PURE__ */ r(
|
|
160
160
|
D,
|
|
161
161
|
{
|
|
162
162
|
bg: t.properties.state === "OPEN" || t.properties.state === "RUNNING" ? "success" : "danger",
|
|
@@ -164,8 +164,8 @@ function Et(e) {
|
|
|
164
164
|
}
|
|
165
165
|
)
|
|
166
166
|
] }),
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ r("div", { className: "hw-content", children: /* @__PURE__ */ l(oe, { className: "d-flex", children: [
|
|
168
|
+
/* @__PURE__ */ r(
|
|
169
169
|
y,
|
|
170
170
|
{
|
|
171
171
|
variant: t.properties.frontend === "FE open" ? "danger" : "success",
|
|
@@ -174,14 +174,14 @@ function Et(e) {
|
|
|
174
174
|
children: t.properties.frontend === "FE open" ? "Close" : "Open"
|
|
175
175
|
}
|
|
176
176
|
),
|
|
177
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ r(Re, { ...e })
|
|
178
178
|
] }) })
|
|
179
179
|
] });
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
const { hardware: t, options:
|
|
181
|
+
function Pt(e) {
|
|
182
|
+
const { hardware: t, options: n = {} } = e;
|
|
183
183
|
function i() {
|
|
184
|
-
const a =
|
|
184
|
+
const a = n.property;
|
|
185
185
|
if (a === void 0)
|
|
186
186
|
return "property is not set";
|
|
187
187
|
if (a === null)
|
|
@@ -192,78 +192,78 @@ function xt(e) {
|
|
|
192
192
|
return `property '${a}' not found`;
|
|
193
193
|
return `${o}`;
|
|
194
194
|
}
|
|
195
|
-
return /* @__PURE__ */
|
|
195
|
+
return /* @__PURE__ */ r(v, { children: i() });
|
|
196
196
|
}
|
|
197
197
|
function Y(e) {
|
|
198
|
-
const { headerMode: t, hardware:
|
|
198
|
+
const { headerMode: t, hardware: n } = e;
|
|
199
199
|
function i() {
|
|
200
|
-
return
|
|
200
|
+
return n.alias ? n.alias : n.name ? n.name : n.id;
|
|
201
201
|
}
|
|
202
202
|
const a = i();
|
|
203
203
|
switch (t) {
|
|
204
204
|
case "front":
|
|
205
|
-
return /* @__PURE__ */
|
|
205
|
+
return /* @__PURE__ */ r("div", { className: "hw-component", children: /* @__PURE__ */ l("div", { className: "hw-single", children: [
|
|
206
206
|
e.widgetIcon,
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ r("div", { className: "name", children: a }),
|
|
208
|
+
/* @__PURE__ */ r("div", { className: "d-inline-block", children: e.widgetContent })
|
|
209
209
|
] }) });
|
|
210
210
|
case "none":
|
|
211
|
-
return /* @__PURE__ */
|
|
211
|
+
return /* @__PURE__ */ r("div", { className: "hw-component", children: /* @__PURE__ */ r("div", { className: "hw-single", children: e.widgetContent }) });
|
|
212
212
|
case "state":
|
|
213
213
|
return e.widgetState;
|
|
214
214
|
default:
|
|
215
|
-
return /* @__PURE__ */
|
|
216
|
-
/* @__PURE__ */
|
|
215
|
+
return /* @__PURE__ */ l("div", { className: "hw-component", children: [
|
|
216
|
+
/* @__PURE__ */ l("div", { className: "hw-head", children: [
|
|
217
217
|
e.widgetIcon,
|
|
218
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ r("div", { className: "name", children: /* @__PURE__ */ r(N.Label, { htmlFor: n.id, children: a }) }),
|
|
219
219
|
e.widgetState,
|
|
220
|
-
e.hardware.errors && e.hardware.errors.length > 0 && /* @__PURE__ */
|
|
221
|
-
|
|
220
|
+
e.hardware.errors && e.hardware.errors.length > 0 && /* @__PURE__ */ r(
|
|
221
|
+
F,
|
|
222
222
|
{
|
|
223
223
|
trigger: "click",
|
|
224
224
|
placement: "bottom",
|
|
225
225
|
rootClose: !0,
|
|
226
|
-
overlay: /* @__PURE__ */
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
-
/* @__PURE__ */
|
|
226
|
+
overlay: /* @__PURE__ */ l(b, { id: e.hardware.id, style: { maxWidth: 500 }, children: [
|
|
227
|
+
/* @__PURE__ */ r(b.Header, { children: "Device Errors" }),
|
|
228
|
+
/* @__PURE__ */ l(b.Body, { children: [
|
|
229
229
|
"There were errors with properties on this device:",
|
|
230
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ r("ul", { children: e.hardware.errors.map((o) => /* @__PURE__ */ l("li", { children: [
|
|
231
231
|
o.property,
|
|
232
232
|
":",
|
|
233
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ l("span", { className: "stack-trace", children: [
|
|
234
234
|
o.traceback,
|
|
235
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ r("br", {}),
|
|
236
236
|
o.exception
|
|
237
237
|
] })
|
|
238
238
|
] })) })
|
|
239
239
|
] })
|
|
240
240
|
] }),
|
|
241
|
-
children: /* @__PURE__ */
|
|
241
|
+
children: /* @__PURE__ */ r(y, { variant: "danger", size: "sm", children: /* @__PURE__ */ r("i", { className: "fa fa-exclamation-triangle" }) })
|
|
242
242
|
}
|
|
243
243
|
)
|
|
244
244
|
] }),
|
|
245
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ r("div", { className: "hw-content", children: e.widgetContent })
|
|
246
246
|
] });
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
function
|
|
249
|
+
function J(e) {
|
|
250
250
|
const t = {
|
|
251
251
|
display: "inline-block",
|
|
252
252
|
minWidth: ""
|
|
253
253
|
};
|
|
254
|
-
return e.minWidth && (t.minWidth = `${e.minWidth}em`), /* @__PURE__ */
|
|
254
|
+
return e.minWidth && (t.minWidth = `${e.minWidth}em`), /* @__PURE__ */ r("div", { style: t, children: /* @__PURE__ */ r(D, { bg: e.variant, children: e.state }) });
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function ce(e) {
|
|
257
257
|
const { hardware: t } = e;
|
|
258
|
-
function
|
|
258
|
+
function n() {
|
|
259
259
|
if (!t.online)
|
|
260
260
|
return "OFFLINE";
|
|
261
261
|
let a = "UNKNOWN";
|
|
262
262
|
return e.hardware.properties.state && ([a] = e.hardware.properties.state), a;
|
|
263
263
|
}
|
|
264
|
-
const i =
|
|
265
|
-
return /* @__PURE__ */
|
|
266
|
-
|
|
264
|
+
const i = n();
|
|
265
|
+
return /* @__PURE__ */ r(
|
|
266
|
+
J,
|
|
267
267
|
{
|
|
268
268
|
state: i,
|
|
269
269
|
minWidth: 6,
|
|
@@ -271,15 +271,15 @@ function oe(e) {
|
|
|
271
271
|
}
|
|
272
272
|
);
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function de(e) {
|
|
275
275
|
const { hardware: t } = e;
|
|
276
|
-
function
|
|
276
|
+
function n() {
|
|
277
277
|
if (!t.online)
|
|
278
278
|
return "OFFLINE";
|
|
279
279
|
const o = t.properties.state;
|
|
280
280
|
return e.useReadyState && (o === "OPEN" || o === "CLOSED") ? "READY" : o;
|
|
281
281
|
}
|
|
282
|
-
const i =
|
|
282
|
+
const i = n();
|
|
283
283
|
function a() {
|
|
284
284
|
switch (i) {
|
|
285
285
|
case "READY":
|
|
@@ -300,120 +300,120 @@ function se(e) {
|
|
|
300
300
|
return "fatal";
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
return /* @__PURE__ */
|
|
303
|
+
return /* @__PURE__ */ r(J, { state: i, minWidth: 6, variant: a() });
|
|
304
304
|
}
|
|
305
|
-
const
|
|
305
|
+
const Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
306
306
|
__proto__: null,
|
|
307
|
-
HardwareState:
|
|
308
|
-
MotorState:
|
|
309
|
-
ShutterState:
|
|
310
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
311
|
-
const
|
|
312
|
-
const
|
|
313
|
-
if (
|
|
307
|
+
HardwareState: J,
|
|
308
|
+
MotorState: ce,
|
|
309
|
+
ShutterState: de
|
|
310
|
+
}, Symbol.toStringTag, { value: "Module" })), Te = Ce((e, t) => {
|
|
311
|
+
const n = R(null), [i, a] = k(e.step), o = (w) => {
|
|
312
|
+
const q = t;
|
|
313
|
+
if (n.current === null)
|
|
314
314
|
return;
|
|
315
|
-
let
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
target:
|
|
315
|
+
let X = Number.parseFloat(q.current.value);
|
|
316
|
+
const ee = Number.parseFloat(n.current.value);
|
|
317
|
+
X += w ? ee : -ee, q.current.value = `${X}`, e.onStep && e.onStep({
|
|
318
|
+
target: q.current
|
|
319
319
|
});
|
|
320
320
|
}, {
|
|
321
321
|
onStep: d,
|
|
322
|
-
step:
|
|
322
|
+
step: s,
|
|
323
323
|
overlay: h,
|
|
324
324
|
incIcon: u,
|
|
325
325
|
decIcon: c,
|
|
326
326
|
swapIncDec: f,
|
|
327
327
|
onKeyDown: m,
|
|
328
|
-
horizontalArrows:
|
|
329
|
-
largeArrows:
|
|
328
|
+
horizontalArrows: A,
|
|
329
|
+
largeArrows: z,
|
|
330
330
|
...S
|
|
331
|
-
} = e,
|
|
332
|
-
|
|
331
|
+
} = e, Q = (w) => {
|
|
332
|
+
w.key === "ArrowUp" ? (w.preventDefault(), o(!0)) : w.key === "ArrowDown" ? (w.preventDefault(), o(!1)) : m && m(w);
|
|
333
333
|
};
|
|
334
334
|
if (!e.step)
|
|
335
|
-
return /* @__PURE__ */
|
|
335
|
+
return /* @__PURE__ */ r(
|
|
336
336
|
N.Control,
|
|
337
337
|
{
|
|
338
338
|
ref: t,
|
|
339
339
|
type: "number",
|
|
340
340
|
step: "any",
|
|
341
|
-
onKeyDown:
|
|
341
|
+
onKeyDown: Q,
|
|
342
342
|
...S
|
|
343
343
|
}
|
|
344
344
|
);
|
|
345
|
-
const
|
|
346
|
-
return /* @__PURE__ */
|
|
345
|
+
const ye = C(e.steps || [e.step], (w) => /* @__PURE__ */ r("option", { value: w, children: w }, w));
|
|
346
|
+
return /* @__PURE__ */ r(
|
|
347
347
|
"div",
|
|
348
348
|
{
|
|
349
|
-
className:
|
|
350
|
-
"numeric-step-large":
|
|
351
|
-
"numeric-step-horizontal":
|
|
349
|
+
className: T("numeric-step", {
|
|
350
|
+
"numeric-step-large": z,
|
|
351
|
+
"numeric-step-horizontal": A
|
|
352
352
|
}),
|
|
353
|
-
children: /* @__PURE__ */
|
|
354
|
-
/* @__PURE__ */
|
|
353
|
+
children: /* @__PURE__ */ l(M, { children: [
|
|
354
|
+
/* @__PURE__ */ r(
|
|
355
355
|
N.Control,
|
|
356
356
|
{
|
|
357
|
-
onKeyDown:
|
|
357
|
+
onKeyDown: Q,
|
|
358
358
|
ref: t,
|
|
359
359
|
type: "number",
|
|
360
360
|
step: "any",
|
|
361
361
|
...S
|
|
362
362
|
}
|
|
363
363
|
),
|
|
364
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ l(v, { children: [
|
|
365
365
|
h,
|
|
366
|
-
!h && /* @__PURE__ */
|
|
367
|
-
/* @__PURE__ */
|
|
366
|
+
!h && /* @__PURE__ */ l(M.Text, { className: "d-flex flex-column", children: [
|
|
367
|
+
/* @__PURE__ */ r(
|
|
368
368
|
N.Control,
|
|
369
369
|
{
|
|
370
|
-
ref:
|
|
370
|
+
ref: n,
|
|
371
371
|
as: "select",
|
|
372
372
|
className: "step-size",
|
|
373
373
|
defaultValue: i,
|
|
374
|
-
onChange: (
|
|
375
|
-
children:
|
|
374
|
+
onChange: (w) => a(Number.parseFloat(w.target.value)),
|
|
375
|
+
children: ye
|
|
376
376
|
}
|
|
377
377
|
),
|
|
378
|
-
e.unit && /* @__PURE__ */
|
|
379
|
-
!u && !c && /* @__PURE__ */
|
|
380
|
-
/* @__PURE__ */
|
|
378
|
+
e.unit && /* @__PURE__ */ r("div", { children: e.unit }),
|
|
379
|
+
!u && !c && /* @__PURE__ */ l(v, { children: [
|
|
380
|
+
/* @__PURE__ */ r(
|
|
381
381
|
y,
|
|
382
382
|
{
|
|
383
383
|
className: "step step-up",
|
|
384
384
|
disabled: e.disabled,
|
|
385
|
-
onClick: (
|
|
385
|
+
onClick: (w) => o(!0)
|
|
386
386
|
}
|
|
387
387
|
),
|
|
388
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ r(
|
|
389
389
|
y,
|
|
390
390
|
{
|
|
391
391
|
className: "step step-down",
|
|
392
392
|
disabled: e.disabled,
|
|
393
|
-
onClick: (
|
|
393
|
+
onClick: (w) => o(!1)
|
|
394
394
|
}
|
|
395
395
|
)
|
|
396
396
|
] })
|
|
397
397
|
] }),
|
|
398
|
-
c && f && /* @__PURE__ */
|
|
399
|
-
u && /* @__PURE__ */
|
|
400
|
-
c && !f && /* @__PURE__ */
|
|
398
|
+
c && f && /* @__PURE__ */ r(y, { disabled: e.disabled, onClick: (w) => o(!1), children: /* @__PURE__ */ r("i", { className: `fa fa-fw fa-${c}` }) }),
|
|
399
|
+
u && /* @__PURE__ */ r(y, { disabled: e.disabled, onClick: (w) => o(!0), children: /* @__PURE__ */ r("i", { className: `fa fa-fw fa-${u}` }) }),
|
|
400
|
+
c && !f && /* @__PURE__ */ r(y, { disabled: e.disabled, onClick: (w) => o(!1), children: /* @__PURE__ */ r("i", { className: `fa fa-fw fa-${c}` }) })
|
|
401
401
|
] })
|
|
402
402
|
] })
|
|
403
403
|
}
|
|
404
404
|
);
|
|
405
|
-
}),
|
|
406
|
-
function
|
|
407
|
-
const t =
|
|
408
|
-
|
|
405
|
+
}), He = Te;
|
|
406
|
+
function _e(e) {
|
|
407
|
+
const t = R(null), [n, i] = k(!1), [a, o] = k(!1);
|
|
408
|
+
j(() => {
|
|
409
409
|
t.current && (e.hardwareValue === null ? t.current.value = "" : t.current.value = e.hardwareValue.toString(), i(!1));
|
|
410
410
|
}, [e.hardwareValue]);
|
|
411
411
|
function d(f) {
|
|
412
412
|
let m = f;
|
|
413
413
|
e.precision !== void 0 && (m = Number.parseFloat(m).toFixed(e.precision)), t != null && t.current && (t.current.value = m);
|
|
414
414
|
}
|
|
415
|
-
function
|
|
416
|
-
|
|
415
|
+
function s() {
|
|
416
|
+
n && setTimeout(() => {
|
|
417
417
|
d(e.hardwareValue), i(!1);
|
|
418
418
|
}, 3e3);
|
|
419
419
|
}
|
|
@@ -428,8 +428,8 @@ function ke(e) {
|
|
|
428
428
|
case "Enter":
|
|
429
429
|
{
|
|
430
430
|
i(!1);
|
|
431
|
-
const m = Number.parseFloat(f.target.value),
|
|
432
|
-
|
|
431
|
+
const m = Number.parseFloat(f.target.value), A = e.onMoveRequested(m);
|
|
432
|
+
A && A.catch(() => {
|
|
433
433
|
o(!0), setTimeout(() => {
|
|
434
434
|
d(e.hardwareValue), o(!1);
|
|
435
435
|
}, 2e3);
|
|
@@ -439,16 +439,16 @@ function ke(e) {
|
|
|
439
439
|
break;
|
|
440
440
|
case "Esc":
|
|
441
441
|
case "Escape":
|
|
442
|
-
|
|
442
|
+
n && (o(!1), i(!1), d(e.hardwareValue)), f.target.blur(), f.preventDefault(), f.stopPropagation();
|
|
443
443
|
break;
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
-
return /* @__PURE__ */
|
|
447
|
-
|
|
446
|
+
return /* @__PURE__ */ r(
|
|
447
|
+
He,
|
|
448
448
|
{
|
|
449
449
|
id: e.id,
|
|
450
|
-
className:
|
|
451
|
-
"form-control-edited":
|
|
450
|
+
className: T({
|
|
451
|
+
"form-control-edited": n,
|
|
452
452
|
"form-control-error": a,
|
|
453
453
|
"hw-moving": e.hardwareIsMoving
|
|
454
454
|
}),
|
|
@@ -456,7 +456,7 @@ function ke(e) {
|
|
|
456
456
|
ref: t,
|
|
457
457
|
precision: e.precision,
|
|
458
458
|
onChange: h,
|
|
459
|
-
onBlur:
|
|
459
|
+
onBlur: s,
|
|
460
460
|
onStep: u,
|
|
461
461
|
onKeyDown: c,
|
|
462
462
|
disabled: e.hardwareIsDisabled || e.readOnly || !e.hardwareIsReady,
|
|
@@ -467,20 +467,20 @@ function ke(e) {
|
|
|
467
467
|
swapIncDec: e.swapIncDec,
|
|
468
468
|
horizontalArrows: e.horizontalArrows,
|
|
469
469
|
largeArrows: e.largeArrows,
|
|
470
|
-
overlay: e.hardwareIsMoving && !e.hardwareIsDisabled ? /* @__PURE__ */
|
|
470
|
+
overlay: e.hardwareIsMoving && !e.hardwareIsDisabled ? /* @__PURE__ */ r(y, { variant: "danger", onClick: e.onAbortRequested, children: /* @__PURE__ */ r("i", { className: "fa fa-times" }) }) : null
|
|
471
471
|
}
|
|
472
472
|
);
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
const t =
|
|
474
|
+
function re(e) {
|
|
475
|
+
const t = R(null), [n, i] = k(!1), [a, o] = k(!1);
|
|
476
476
|
function d(c) {
|
|
477
477
|
return e.precision !== void 0 ? Number.parseFloat(c).toFixed(e.precision) : c;
|
|
478
478
|
}
|
|
479
|
-
|
|
479
|
+
j(() => {
|
|
480
480
|
var c;
|
|
481
481
|
t.current && (t.current.value = d((c = e.hardwareValue) == null ? void 0 : c.toString()), i(!1));
|
|
482
482
|
}, [e.hardwareValue, e.precision]);
|
|
483
|
-
function
|
|
483
|
+
function s(c) {
|
|
484
484
|
const f = d(c);
|
|
485
485
|
t != null && t.current && (t.current.value = f);
|
|
486
486
|
}
|
|
@@ -491,25 +491,25 @@ function te(e) {
|
|
|
491
491
|
const f = Number.parseFloat(c.target.value), m = e.onMoveRequested(f);
|
|
492
492
|
m && m.catch(() => {
|
|
493
493
|
o(!0), setTimeout(() => {
|
|
494
|
-
|
|
494
|
+
s(e.hardwareValue), o(!1);
|
|
495
495
|
}, 2e3);
|
|
496
496
|
}), c.preventDefault(), c.stopPropagation();
|
|
497
497
|
break;
|
|
498
498
|
}
|
|
499
499
|
case "Esc":
|
|
500
500
|
case "Escape":
|
|
501
|
-
|
|
501
|
+
n && (o(!1), i(!1), s(e.hardwareValue)), c.target.blur(), c.preventDefault(), c.stopPropagation();
|
|
502
502
|
break;
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
function u(c) {
|
|
506
506
|
i(!0), c.target, t != null && t.current && (t.current.value = c.target.value), c.target.value === e.hardwareValue.toString() && i(!1);
|
|
507
507
|
}
|
|
508
|
-
return /* @__PURE__ */
|
|
508
|
+
return /* @__PURE__ */ r(
|
|
509
509
|
N.Control,
|
|
510
510
|
{
|
|
511
|
-
className:
|
|
512
|
-
"form-control-edited":
|
|
511
|
+
className: T({
|
|
512
|
+
"form-control-edited": n,
|
|
513
513
|
"form-control-error": a,
|
|
514
514
|
"hw-moving": e.hardwareIsMoving
|
|
515
515
|
}),
|
|
@@ -522,35 +522,35 @@ function te(e) {
|
|
|
522
522
|
}
|
|
523
523
|
);
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function Pe(e) {
|
|
526
526
|
function t(a) {
|
|
527
527
|
return e.hardware.requestChange({
|
|
528
528
|
property: "velocity",
|
|
529
529
|
value: a
|
|
530
530
|
});
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function n(a) {
|
|
533
533
|
return e.hardware.requestChange({
|
|
534
534
|
property: "acceleration",
|
|
535
535
|
value: a
|
|
536
536
|
});
|
|
537
537
|
}
|
|
538
538
|
let i = "UNKNOWN";
|
|
539
|
-
return e.hardware.properties.state && ([i] = e.hardware.properties.state), /* @__PURE__ */
|
|
540
|
-
|
|
539
|
+
return e.hardware.properties.state && ([i] = e.hardware.properties.state), /* @__PURE__ */ r(
|
|
540
|
+
F,
|
|
541
541
|
{
|
|
542
542
|
trigger: "click",
|
|
543
543
|
rootClose: !0,
|
|
544
|
-
overlay: /* @__PURE__ */
|
|
545
|
-
/* @__PURE__ */
|
|
544
|
+
overlay: /* @__PURE__ */ l(b, { id: "popid", children: [
|
|
545
|
+
/* @__PURE__ */ l(b.Header, { children: [
|
|
546
546
|
e.hardware.name,
|
|
547
547
|
" details"
|
|
548
548
|
] }),
|
|
549
|
-
/* @__PURE__ */
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
/* @__PURE__ */
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
-
|
|
549
|
+
/* @__PURE__ */ l(b.Body, { children: [
|
|
550
|
+
/* @__PURE__ */ l(N.Group, { children: [
|
|
551
|
+
/* @__PURE__ */ r(N.Label, { children: "Velocity" }),
|
|
552
|
+
/* @__PURE__ */ r(
|
|
553
|
+
re,
|
|
554
554
|
{
|
|
555
555
|
hardwareValue: e.hardware.properties.velocity,
|
|
556
556
|
onMoveRequested: t,
|
|
@@ -561,13 +561,13 @@ function De(e) {
|
|
|
561
561
|
}
|
|
562
562
|
)
|
|
563
563
|
] }),
|
|
564
|
-
/* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */
|
|
567
|
-
|
|
564
|
+
/* @__PURE__ */ l(N.Group, { children: [
|
|
565
|
+
/* @__PURE__ */ r(N.Label, { children: "Acceleration" }),
|
|
566
|
+
/* @__PURE__ */ r(
|
|
567
|
+
re,
|
|
568
568
|
{
|
|
569
569
|
hardwareValue: e.hardware.properties.acceleration,
|
|
570
|
-
onMoveRequested:
|
|
570
|
+
onMoveRequested: n,
|
|
571
571
|
hardwareIsDisabled: e.disabled,
|
|
572
572
|
hardwareIsReady: i === "READY",
|
|
573
573
|
hardwareIsMoving: i === "MOVING",
|
|
@@ -577,12 +577,12 @@ function De(e) {
|
|
|
577
577
|
] })
|
|
578
578
|
] })
|
|
579
579
|
] }),
|
|
580
|
-
children: /* @__PURE__ */
|
|
580
|
+
children: /* @__PURE__ */ r(y, { children: /* @__PURE__ */ r("i", { className: "fa fa-ellipsis-h" }) })
|
|
581
581
|
}
|
|
582
582
|
);
|
|
583
583
|
}
|
|
584
|
-
function
|
|
585
|
-
const { hardware: t, options:
|
|
584
|
+
function Lt(e) {
|
|
585
|
+
const { hardware: t, options: n = {} } = e;
|
|
586
586
|
function i() {
|
|
587
587
|
t.requestChange({
|
|
588
588
|
function: "stop"
|
|
@@ -597,16 +597,16 @@ function At(e) {
|
|
|
597
597
|
}
|
|
598
598
|
let o = "UNKNOWN";
|
|
599
599
|
e.hardware.properties.state && ([o] = e.hardware.properties.state);
|
|
600
|
-
const d = /* @__PURE__ */
|
|
601
|
-
return /* @__PURE__ */
|
|
600
|
+
const d = /* @__PURE__ */ r(I, { name: "Motor", icon: "fam-hardware-motor", online: t.online }), s = /* @__PURE__ */ r(ce, { hardware: t }), h = e.options ? e.options.header : "top";
|
|
601
|
+
return /* @__PURE__ */ r(
|
|
602
602
|
Y,
|
|
603
603
|
{
|
|
604
604
|
hardware: t,
|
|
605
605
|
widgetIcon: d,
|
|
606
|
-
widgetState:
|
|
607
|
-
widgetContent: /* @__PURE__ */
|
|
608
|
-
/* @__PURE__ */
|
|
609
|
-
|
|
606
|
+
widgetState: s,
|
|
607
|
+
widgetContent: /* @__PURE__ */ l(M, { children: [
|
|
608
|
+
/* @__PURE__ */ r(
|
|
609
|
+
_e,
|
|
610
610
|
{
|
|
611
611
|
id: t.id,
|
|
612
612
|
hardwareValue: t.properties.position,
|
|
@@ -615,43 +615,43 @@ function At(e) {
|
|
|
615
615
|
hardwareIsMoving: o === "MOVING",
|
|
616
616
|
onMoveRequested: a,
|
|
617
617
|
onAbortRequested: i,
|
|
618
|
-
precision:
|
|
619
|
-
readOnly:
|
|
620
|
-
step:
|
|
621
|
-
steps:
|
|
622
|
-
incIcon:
|
|
623
|
-
decIcon:
|
|
624
|
-
swapIncDec:
|
|
625
|
-
horizontalArrows:
|
|
626
|
-
largeArrows:
|
|
618
|
+
precision: n.precision,
|
|
619
|
+
readOnly: n.readOnly,
|
|
620
|
+
step: n.step,
|
|
621
|
+
steps: n.steps,
|
|
622
|
+
incIcon: n.incicon,
|
|
623
|
+
decIcon: n.decicon,
|
|
624
|
+
swapIncDec: n.swapincdec,
|
|
625
|
+
horizontalArrows: n.horizontalarrows,
|
|
626
|
+
largeArrows: n.largearrows
|
|
627
627
|
}
|
|
628
628
|
),
|
|
629
|
-
t.properties.unit && /* @__PURE__ */
|
|
630
|
-
o !== "MOVING" &&
|
|
631
|
-
|
|
629
|
+
t.properties.unit && /* @__PURE__ */ r(M.Text, { children: t.properties.unit }),
|
|
630
|
+
o !== "MOVING" && n.extended && /* @__PURE__ */ r(
|
|
631
|
+
Pe,
|
|
632
632
|
{
|
|
633
633
|
hardware: t,
|
|
634
634
|
disabled: e.disabled,
|
|
635
|
-
readOnly:
|
|
635
|
+
readOnly: n.readOnly
|
|
636
636
|
}
|
|
637
637
|
),
|
|
638
|
-
o === "MOVING" && !e.disabled && !
|
|
638
|
+
o === "MOVING" && !e.disabled && !n.step && /* @__PURE__ */ r(y, { variant: "danger", onClick: i, children: /* @__PURE__ */ r("i", { className: "fa fa-times" }) })
|
|
639
639
|
] }),
|
|
640
640
|
headerMode: h
|
|
641
641
|
}
|
|
642
642
|
);
|
|
643
643
|
}
|
|
644
|
-
function
|
|
645
|
-
const { hardware: t, options:
|
|
646
|
-
|
|
644
|
+
function jt(e) {
|
|
645
|
+
const { hardware: t, options: n = {} } = e, i = R(null);
|
|
646
|
+
j(() => {
|
|
647
647
|
if (!i.current) {
|
|
648
648
|
console.error("selectionRef ref is unset");
|
|
649
649
|
return;
|
|
650
650
|
}
|
|
651
651
|
i.current.value = t.properties.position;
|
|
652
652
|
}, [t.properties.position]);
|
|
653
|
-
function a(
|
|
654
|
-
if (console.debug("change",
|
|
653
|
+
function a(s) {
|
|
654
|
+
if (console.debug("change", s), !i || !i.current) {
|
|
655
655
|
console.error("selection ref is unset");
|
|
656
656
|
return;
|
|
657
657
|
}
|
|
@@ -660,15 +660,15 @@ function It(e) {
|
|
|
660
660
|
function: "move"
|
|
661
661
|
});
|
|
662
662
|
}
|
|
663
|
-
function o(
|
|
663
|
+
function o(s) {
|
|
664
664
|
t.requestChange({
|
|
665
665
|
function: "stop"
|
|
666
666
|
});
|
|
667
667
|
}
|
|
668
|
-
const d = C(t.properties.positions, (
|
|
669
|
-
return /* @__PURE__ */
|
|
670
|
-
/* @__PURE__ */
|
|
671
|
-
/* @__PURE__ */
|
|
668
|
+
const d = C(t.properties.positions, (s) => /* @__PURE__ */ r("option", { title: s.description, children: s.position }, s.position));
|
|
669
|
+
return /* @__PURE__ */ l("div", { className: "hw-component", children: [
|
|
670
|
+
/* @__PURE__ */ l("div", { className: "hw-head", children: [
|
|
671
|
+
/* @__PURE__ */ r(
|
|
672
672
|
I,
|
|
673
673
|
{
|
|
674
674
|
name: "Multiposition",
|
|
@@ -676,8 +676,8 @@ function It(e) {
|
|
|
676
676
|
online: t.online
|
|
677
677
|
}
|
|
678
678
|
),
|
|
679
|
-
/* @__PURE__ */
|
|
680
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ r("div", { className: "name", children: t.name }),
|
|
680
|
+
/* @__PURE__ */ r(
|
|
681
681
|
D,
|
|
682
682
|
{
|
|
683
683
|
bg: t.properties.state === "READY" ? "success" : "warning",
|
|
@@ -685,8 +685,8 @@ function It(e) {
|
|
|
685
685
|
}
|
|
686
686
|
)
|
|
687
687
|
] }),
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */
|
|
688
|
+
/* @__PURE__ */ r("div", { className: "hw-content", children: /* @__PURE__ */ l(M, { children: [
|
|
689
|
+
/* @__PURE__ */ l(
|
|
690
690
|
N.Control,
|
|
691
691
|
{
|
|
692
692
|
className: "custom-select",
|
|
@@ -695,25 +695,25 @@ function It(e) {
|
|
|
695
695
|
disabled: e.disabled,
|
|
696
696
|
defaultValue: t.properties.position,
|
|
697
697
|
children: [
|
|
698
|
-
/* @__PURE__ */
|
|
698
|
+
/* @__PURE__ */ r("option", { disabled: !0, children: "unknown" }),
|
|
699
699
|
d
|
|
700
700
|
]
|
|
701
701
|
}
|
|
702
702
|
),
|
|
703
|
-
t.properties.state !== "MOVING" && /* @__PURE__ */
|
|
704
|
-
t.properties.state === "MOVING" && !e.disabled && /* @__PURE__ */
|
|
703
|
+
t.properties.state !== "MOVING" && /* @__PURE__ */ r(y, { onClick: a, disabled: e.disabled, children: "Move" }),
|
|
704
|
+
t.properties.state === "MOVING" && !e.disabled && /* @__PURE__ */ r(y, { variant: "danger", onClick: o, children: /* @__PURE__ */ r("i", { className: "fa fa-times" }) })
|
|
705
705
|
] }) })
|
|
706
706
|
] });
|
|
707
707
|
}
|
|
708
|
-
const
|
|
709
|
-
function
|
|
708
|
+
const Ve = Ae("daiquiri.components.hardware.NoObject");
|
|
709
|
+
function Yt(e) {
|
|
710
710
|
if (e.options.emptyifnone)
|
|
711
|
-
return
|
|
711
|
+
return Ve(
|
|
712
712
|
'Component id:"%s" name:"%s" not displayed cause setup with emptyifnone.',
|
|
713
713
|
e.id,
|
|
714
714
|
e.name
|
|
715
|
-
), /* @__PURE__ */
|
|
716
|
-
const t = /* @__PURE__ */
|
|
715
|
+
), /* @__PURE__ */ r(v, {});
|
|
716
|
+
const t = /* @__PURE__ */ r(I, { name: "NoObject", icon: "fam-hardware-any", online: !1 }), n = /* @__PURE__ */ r(v, {}), i = /* @__PURE__ */ r(v, { children: "Missing" }), a = e.options ? e.options.header : "top", o = {
|
|
717
717
|
id: e.id,
|
|
718
718
|
name: e.name ?? "",
|
|
719
719
|
alias: null,
|
|
@@ -721,25 +721,25 @@ function kt(e) {
|
|
|
721
721
|
properties: {},
|
|
722
722
|
type: ""
|
|
723
723
|
};
|
|
724
|
-
return /* @__PURE__ */
|
|
724
|
+
return /* @__PURE__ */ r(
|
|
725
725
|
Y,
|
|
726
726
|
{
|
|
727
727
|
hardware: o,
|
|
728
728
|
widgetIcon: t,
|
|
729
|
-
widgetState:
|
|
729
|
+
widgetState: n,
|
|
730
730
|
widgetContent: i,
|
|
731
731
|
headerMode: a
|
|
732
732
|
}
|
|
733
733
|
);
|
|
734
734
|
}
|
|
735
|
-
function
|
|
735
|
+
function Le(e) {
|
|
736
736
|
const t = e.online ? "READY" : "OFFLINE";
|
|
737
|
-
return /* @__PURE__ */
|
|
737
|
+
return /* @__PURE__ */ r(D, { bg: t === "READY" ? "success" : "warning", children: t });
|
|
738
738
|
}
|
|
739
|
-
function
|
|
740
|
-
const { hardware: t, options:
|
|
739
|
+
function Kt(e) {
|
|
740
|
+
const { hardware: t, options: n = {} } = e, i = /* @__PURE__ */ r(I, { name: "Optic", icon: "fa-cog", online: t.online }), a = /* @__PURE__ */ r(Le, { ...t });
|
|
741
741
|
function o() {
|
|
742
|
-
const c =
|
|
742
|
+
const c = n.property;
|
|
743
743
|
if (c === void 0)
|
|
744
744
|
return "property is not set";
|
|
745
745
|
if (c === null)
|
|
@@ -751,7 +751,7 @@ function Dt(e) {
|
|
|
751
751
|
return `${f}`;
|
|
752
752
|
}
|
|
753
753
|
function d() {
|
|
754
|
-
const c =
|
|
754
|
+
const c = n.unit;
|
|
755
755
|
if (!c)
|
|
756
756
|
return null;
|
|
757
757
|
if (!c.includes("properties"))
|
|
@@ -762,11 +762,11 @@ function Dt(e) {
|
|
|
762
762
|
return null;
|
|
763
763
|
return `${f}`;
|
|
764
764
|
}
|
|
765
|
-
const
|
|
766
|
-
/* @__PURE__ */
|
|
767
|
-
|
|
765
|
+
const s = d(), h = /* @__PURE__ */ l(M, { children: [
|
|
766
|
+
/* @__PURE__ */ r(N.Control, { value: o(), readOnly: !0 }),
|
|
767
|
+
s && /* @__PURE__ */ r(M.Text, { children: s })
|
|
768
768
|
] }), u = e.options.header || "top";
|
|
769
|
-
return /* @__PURE__ */
|
|
769
|
+
return /* @__PURE__ */ r(
|
|
770
770
|
Y,
|
|
771
771
|
{
|
|
772
772
|
hardware: t,
|
|
@@ -777,48 +777,48 @@ function Dt(e) {
|
|
|
777
777
|
}
|
|
778
778
|
);
|
|
779
779
|
}
|
|
780
|
-
function
|
|
781
|
-
const { hardware: t } = e,
|
|
780
|
+
function je(e) {
|
|
781
|
+
const { hardware: t } = e, n = () => {
|
|
782
782
|
t.requestChange({
|
|
783
783
|
function: "reset"
|
|
784
784
|
});
|
|
785
785
|
};
|
|
786
|
-
return /* @__PURE__ */
|
|
787
|
-
|
|
786
|
+
return /* @__PURE__ */ r(
|
|
787
|
+
F,
|
|
788
788
|
{
|
|
789
789
|
trigger: "click",
|
|
790
790
|
rootClose: !0,
|
|
791
|
-
overlay: /* @__PURE__ */
|
|
792
|
-
/* @__PURE__ */
|
|
791
|
+
overlay: /* @__PURE__ */ l(b, { id: "popid", children: [
|
|
792
|
+
/* @__PURE__ */ l(b.Header, { children: [
|
|
793
793
|
t.name,
|
|
794
794
|
" Details"
|
|
795
795
|
] }),
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
798
|
-
/* @__PURE__ */
|
|
799
|
-
/* @__PURE__ */
|
|
796
|
+
/* @__PURE__ */ l(b.Body, { children: [
|
|
797
|
+
/* @__PURE__ */ r("h6", { children: "Status" }),
|
|
798
|
+
/* @__PURE__ */ r("pre", { children: t.properties.status }),
|
|
799
|
+
/* @__PURE__ */ r("div", { className: "d-grid gap-2", children: /* @__PURE__ */ r(y, { onClick: n, disabled: e.disabled, children: "Reset" }) })
|
|
800
800
|
] })
|
|
801
801
|
] }),
|
|
802
|
-
children: /* @__PURE__ */
|
|
802
|
+
children: /* @__PURE__ */ r(y, { className: "flex-grow-0", title: "Shutter Details", children: /* @__PURE__ */ r("i", { className: "fa fa-ellipsis-h" }) })
|
|
803
803
|
}
|
|
804
804
|
);
|
|
805
805
|
}
|
|
806
|
-
function
|
|
807
|
-
const { hardware: t, options:
|
|
806
|
+
function zt(e) {
|
|
807
|
+
const { hardware: t, options: n = {} } = e, i = /* @__PURE__ */ r(
|
|
808
808
|
I,
|
|
809
809
|
{
|
|
810
810
|
name: "Shutter",
|
|
811
811
|
icon: "fam-hardware-shutter",
|
|
812
812
|
online: t.online
|
|
813
813
|
}
|
|
814
|
-
), a = /* @__PURE__ */
|
|
814
|
+
), a = /* @__PURE__ */ r(de, { hardware: t });
|
|
815
815
|
function o() {
|
|
816
816
|
return t.properties ? t.properties.state : "UNKNOWN";
|
|
817
817
|
}
|
|
818
818
|
function d(S) {
|
|
819
819
|
return S === "OPEN" ? ["Close", "close"] : S === "CLOSED" ? ["Open", "open"] : S === "DISABLED" || S === "STANDBY" || S === "FAULT" ? ["Closed", ""] : S === "MOVING" ? ["...", ""] : ["Unknown", ""];
|
|
820
820
|
}
|
|
821
|
-
const
|
|
821
|
+
const s = o(), [h, u] = d(s), f = {
|
|
822
822
|
OPEN: "danger",
|
|
823
823
|
CLOSED: "success",
|
|
824
824
|
MOVING: "warning",
|
|
@@ -826,14 +826,14 @@ function $t(e) {
|
|
|
826
826
|
STANDBY: "danger",
|
|
827
827
|
FAULT: "fatal",
|
|
828
828
|
UNKNOWN: "warning"
|
|
829
|
-
}[
|
|
829
|
+
}[s] || "danger";
|
|
830
830
|
function m() {
|
|
831
831
|
t.requestChange({
|
|
832
832
|
function: u
|
|
833
833
|
});
|
|
834
834
|
}
|
|
835
|
-
const
|
|
836
|
-
/* @__PURE__ */
|
|
835
|
+
const A = /* @__PURE__ */ l(oe, { className: "d-flex flex-nowrap", children: [
|
|
836
|
+
/* @__PURE__ */ r(
|
|
837
837
|
y,
|
|
838
838
|
{
|
|
839
839
|
variant: f,
|
|
@@ -842,45 +842,45 @@ function $t(e) {
|
|
|
842
842
|
children: h
|
|
843
843
|
}
|
|
844
844
|
),
|
|
845
|
-
|
|
846
|
-
] }),
|
|
847
|
-
return /* @__PURE__ */
|
|
845
|
+
n.extended && /* @__PURE__ */ r(je, { ...e })
|
|
846
|
+
] }), z = e.options.header || "top";
|
|
847
|
+
return /* @__PURE__ */ r(
|
|
848
848
|
Y,
|
|
849
849
|
{
|
|
850
850
|
hardware: t,
|
|
851
851
|
widgetIcon: i,
|
|
852
852
|
widgetState: a,
|
|
853
|
-
widgetContent:
|
|
854
|
-
headerMode:
|
|
853
|
+
widgetContent: A,
|
|
854
|
+
headerMode: z
|
|
855
855
|
}
|
|
856
856
|
);
|
|
857
857
|
}
|
|
858
|
-
class
|
|
858
|
+
class qt extends se {
|
|
859
859
|
constructor() {
|
|
860
860
|
super(...arguments), this.variants = {};
|
|
861
861
|
}
|
|
862
862
|
render() {
|
|
863
863
|
let t = this.variants.default;
|
|
864
|
-
return this.props.options.variant in this.variants && (t = this.variants[this.props.options.variant]), /* @__PURE__ */
|
|
864
|
+
return this.props.options.variant in this.variants && (t = this.variants[this.props.options.variant]), /* @__PURE__ */ r(t, { ...this.props });
|
|
865
865
|
}
|
|
866
866
|
}
|
|
867
|
-
function
|
|
868
|
-
const [t,
|
|
869
|
-
return
|
|
867
|
+
function Ye(e) {
|
|
868
|
+
const [t, n] = k({}), i = R(null);
|
|
869
|
+
return j(() => {
|
|
870
870
|
if (i.current) {
|
|
871
871
|
const a = i.current;
|
|
872
|
-
|
|
872
|
+
n({
|
|
873
873
|
width: a.clientWidth,
|
|
874
874
|
height: a.clientHeight
|
|
875
875
|
});
|
|
876
876
|
}
|
|
877
|
-
}, []), /* @__PURE__ */
|
|
877
|
+
}, []), /* @__PURE__ */ r(
|
|
878
878
|
"div",
|
|
879
879
|
{
|
|
880
880
|
ref: i,
|
|
881
881
|
style: { width: "100%", height: "100%" },
|
|
882
882
|
className: e.className,
|
|
883
|
-
children: t.width > 0 && /* @__PURE__ */
|
|
883
|
+
children: t.width > 0 && /* @__PURE__ */ r(
|
|
884
884
|
"div",
|
|
885
885
|
{
|
|
886
886
|
className: "full-sizer",
|
|
@@ -895,86 +895,86 @@ function _e(e) {
|
|
|
895
895
|
}
|
|
896
896
|
);
|
|
897
897
|
}
|
|
898
|
-
const
|
|
898
|
+
const Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
899
899
|
__proto__: null
|
|
900
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
900
|
+
}, Symbol.toStringTag, { value: "Module" })), Gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
901
901
|
__proto__: null
|
|
902
902
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
903
|
-
function
|
|
904
|
-
return /* @__PURE__ */
|
|
903
|
+
function Ke(e) {
|
|
904
|
+
return /* @__PURE__ */ r("div", { className: "panel-header", style: e.style, children: e.children });
|
|
905
905
|
}
|
|
906
|
-
function
|
|
907
|
-
return /* @__PURE__ */
|
|
906
|
+
function ze(e) {
|
|
907
|
+
return /* @__PURE__ */ r("div", { className: "panel-contents", style: e.style, children: e.children });
|
|
908
908
|
}
|
|
909
909
|
function p(e) {
|
|
910
|
-
const t = e.scroll ?
|
|
911
|
-
return /* @__PURE__ */
|
|
910
|
+
const t = e.scroll ? Ye : U;
|
|
911
|
+
return /* @__PURE__ */ r("div", { className: `panel ${e.className ?? ""}`, style: e.style, children: /* @__PURE__ */ r(t, { children: e.children }) });
|
|
912
912
|
}
|
|
913
|
-
p.Header =
|
|
914
|
-
p.Contents =
|
|
915
|
-
const
|
|
916
|
-
function
|
|
917
|
-
|
|
913
|
+
p.Header = Ke;
|
|
914
|
+
p.Contents = ze;
|
|
915
|
+
const _ = {};
|
|
916
|
+
function qe(e, t) {
|
|
917
|
+
_[e] = t;
|
|
918
918
|
}
|
|
919
|
-
function O(e, t,
|
|
919
|
+
function O(e, t, n = !0) {
|
|
920
920
|
if (!e)
|
|
921
|
-
return /* @__PURE__ */
|
|
922
|
-
const { type: i } = e, a = i && i in
|
|
923
|
-
return /* @__PURE__ */
|
|
921
|
+
return /* @__PURE__ */ r(v, {});
|
|
922
|
+
const { type: i } = e, a = i && i in _ ? _[i] : _.component;
|
|
923
|
+
return /* @__PURE__ */ r(a, { yamlNode: e, panel: n }, t);
|
|
924
924
|
}
|
|
925
|
-
function
|
|
925
|
+
function Ue({
|
|
926
926
|
children: e,
|
|
927
927
|
key: t,
|
|
928
|
-
panel:
|
|
928
|
+
panel: n,
|
|
929
929
|
options: i
|
|
930
930
|
}) {
|
|
931
|
-
return
|
|
931
|
+
return n ? /* @__PURE__ */ r(p, { style: i.style, scroll: i.scroll, children: /* @__PURE__ */ r(p.Contents, { children: e }) }, t) : /* @__PURE__ */ r(v, { children: Oe.map(
|
|
932
932
|
e,
|
|
933
|
-
(a) =>
|
|
933
|
+
(a) => Se(a) ? Ee(a, { key: t, ...a.props }) : void 0
|
|
934
934
|
) });
|
|
935
935
|
}
|
|
936
|
-
function
|
|
937
|
-
const { _parentNode:
|
|
936
|
+
function ue(e, t) {
|
|
937
|
+
const { _parentNode: n, _indexFromParent: i, ...a } = t;
|
|
938
938
|
if (e && Object.keys(a).length > 0)
|
|
939
|
-
throw new
|
|
939
|
+
throw new V(e, Object.keys(a));
|
|
940
940
|
}
|
|
941
|
-
class
|
|
942
|
-
constructor(t,
|
|
943
|
-
super(t), this.yamlNode =
|
|
941
|
+
class H extends Error {
|
|
942
|
+
constructor(t, n) {
|
|
943
|
+
super(t), this.yamlNode = n;
|
|
944
944
|
}
|
|
945
945
|
}
|
|
946
|
-
class
|
|
947
|
-
constructor(t,
|
|
948
|
-
super(`Unexpected keys: ${
|
|
946
|
+
class V extends H {
|
|
947
|
+
constructor(t, n) {
|
|
948
|
+
super(`Unexpected keys: ${n.join(", ")}`, t), this.keys = n;
|
|
949
949
|
}
|
|
950
950
|
}
|
|
951
|
-
class
|
|
952
|
-
constructor(t,
|
|
953
|
-
super(`Keys ${
|
|
951
|
+
class L extends H {
|
|
952
|
+
constructor(t, n) {
|
|
953
|
+
super(`Keys ${n.join(", ")} are missing`, t), this.keys = n;
|
|
954
954
|
}
|
|
955
955
|
}
|
|
956
|
-
class
|
|
957
|
-
constructor(t,
|
|
958
|
-
super(`Key ${
|
|
956
|
+
class g extends H {
|
|
957
|
+
constructor(t, n, i) {
|
|
958
|
+
super(`Key ${n} error: ${i}`, t), this.key = n, this.keyMessage = i;
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
|
-
function
|
|
961
|
+
function Ge(e) {
|
|
962
962
|
let t = e;
|
|
963
963
|
for (; t._parentNode; )
|
|
964
964
|
t = t._parentNode;
|
|
965
965
|
return t;
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function We(e) {
|
|
968
968
|
const t = [];
|
|
969
|
-
let
|
|
970
|
-
for (;
|
|
969
|
+
let n = e;
|
|
970
|
+
for (; n; )
|
|
971
971
|
t.push({
|
|
972
|
-
node:
|
|
973
|
-
indexFromParent:
|
|
974
|
-
}),
|
|
972
|
+
node: n,
|
|
973
|
+
indexFromParent: n._indexFromParent
|
|
974
|
+
}), n = n._parentNode;
|
|
975
975
|
return t.reverse(), t;
|
|
976
976
|
}
|
|
977
|
-
function
|
|
977
|
+
function he(e, t = null, n = null) {
|
|
978
978
|
if (e._parentNode)
|
|
979
979
|
throw new Error(
|
|
980
980
|
"Attribute _parentNode was already defined by the yml layout."
|
|
@@ -982,141 +982,141 @@ function ce(e, t = null, r = null) {
|
|
|
982
982
|
const i = {
|
|
983
983
|
...e,
|
|
984
984
|
_parentNode: t,
|
|
985
|
-
_indexFromParent:
|
|
985
|
+
_indexFromParent: n
|
|
986
986
|
};
|
|
987
987
|
if (e.children) {
|
|
988
988
|
const a = [...e.children];
|
|
989
|
-
Object.freeze(a), i.children = a.map((o, d) =>
|
|
989
|
+
Object.freeze(a), i.children = a.map((o, d) => he(o, i, d));
|
|
990
990
|
}
|
|
991
991
|
return Object.freeze(i), i;
|
|
992
992
|
}
|
|
993
|
-
function
|
|
994
|
-
return /* @__PURE__ */
|
|
993
|
+
function Be(e) {
|
|
994
|
+
return /* @__PURE__ */ r(x, { variant: "danger", children: e.message });
|
|
995
995
|
}
|
|
996
|
-
function
|
|
996
|
+
function Ze(e) {
|
|
997
997
|
const { error: t } = e;
|
|
998
|
-
if (!(t instanceof
|
|
999
|
-
return /* @__PURE__ */
|
|
1000
|
-
function
|
|
1001
|
-
const
|
|
998
|
+
if (!(t instanceof H))
|
|
999
|
+
return /* @__PURE__ */ r(v, {});
|
|
1000
|
+
function n(o, d = 3) {
|
|
1001
|
+
const s = We(o.yamlNode), h = [];
|
|
1002
1002
|
let u = "";
|
|
1003
|
-
for (let c = 1; c <
|
|
1004
|
-
const { node: f, indexFromParent: m } =
|
|
1003
|
+
for (let c = 1; c < s.length; c++) {
|
|
1004
|
+
const { node: f, indexFromParent: m } = s[c];
|
|
1005
1005
|
h.push(`${u}children:`), u += " ".repeat(d), m === 1 ? h.push(`${u}- type: ...`) : (m ?? 0 > 1) && h.push(
|
|
1006
1006
|
`${u}...`,
|
|
1007
1007
|
`${u}...`,
|
|
1008
1008
|
`${u}# children number ${m ?? 0 + 1}`
|
|
1009
1009
|
), h.push(`${u}- type: ${f.type}`), u += " ".repeat(2);
|
|
1010
1010
|
}
|
|
1011
|
-
return o instanceof
|
|
1011
|
+
return o instanceof V ? o.keys.forEach((c) => {
|
|
1012
1012
|
h.push(
|
|
1013
1013
|
`${u}${c}: ... ${" ".repeat(
|
|
1014
1014
|
50 - u.length - c.length
|
|
1015
1015
|
)}<-- unexpected key`
|
|
1016
1016
|
);
|
|
1017
|
-
}) : o instanceof
|
|
1017
|
+
}) : o instanceof L ? o.keys.forEach((c) => {
|
|
1018
1018
|
h.push(
|
|
1019
1019
|
`${u}???: ${" ".repeat(
|
|
1020
1020
|
50 - u.length - c.length
|
|
1021
1021
|
)}<-- key **${c}** is expected`
|
|
1022
1022
|
);
|
|
1023
|
-
}) : o instanceof
|
|
1023
|
+
}) : o instanceof g && h.push(
|
|
1024
1024
|
`${u}${o.key}: ${" ".repeat(
|
|
1025
1025
|
50 - u.length - o.key.length
|
|
1026
1026
|
)}<-- ${o.keyMessage}`
|
|
1027
1027
|
), h.join(`
|
|
1028
1028
|
`);
|
|
1029
1029
|
}
|
|
1030
|
-
const a =
|
|
1031
|
-
if (t instanceof
|
|
1030
|
+
const a = Ge(t.yamlNode).name;
|
|
1031
|
+
if (t instanceof V) {
|
|
1032
1032
|
const o = t.keys.length === 1 ? "key" : "keys";
|
|
1033
|
-
return /* @__PURE__ */
|
|
1033
|
+
return /* @__PURE__ */ l(x, { variant: "danger", children: [
|
|
1034
1034
|
"Unexpected ",
|
|
1035
1035
|
o,
|
|
1036
1036
|
" ",
|
|
1037
|
-
t.keys.map((d,
|
|
1038
|
-
|
|
1039
|
-
/* @__PURE__ */
|
|
1037
|
+
t.keys.map((d, s) => /* @__PURE__ */ l(v, { children: [
|
|
1038
|
+
s !== 0 && ", ",
|
|
1039
|
+
/* @__PURE__ */ r("b", { children: d })
|
|
1040
1040
|
] })),
|
|
1041
1041
|
" ",
|
|
1042
1042
|
"from the layout name ",
|
|
1043
|
-
/* @__PURE__ */
|
|
1043
|
+
/* @__PURE__ */ r("b", { children: a }),
|
|
1044
1044
|
".",
|
|
1045
|
-
/* @__PURE__ */
|
|
1046
|
-
/* @__PURE__ */
|
|
1047
|
-
/* @__PURE__ */
|
|
1045
|
+
/* @__PURE__ */ r("br", {}),
|
|
1046
|
+
/* @__PURE__ */ r("pre", { className: "mt-3", children: n(t) }),
|
|
1047
|
+
/* @__PURE__ */ r("br", {})
|
|
1048
1048
|
] });
|
|
1049
1049
|
}
|
|
1050
|
-
if (t instanceof
|
|
1050
|
+
if (t instanceof L) {
|
|
1051
1051
|
const o = t.keys.length === 1 ? "Key" : "Keys";
|
|
1052
|
-
return /* @__PURE__ */
|
|
1052
|
+
return /* @__PURE__ */ l(x, { variant: "danger", children: [
|
|
1053
1053
|
"Expected ",
|
|
1054
1054
|
o,
|
|
1055
1055
|
" ",
|
|
1056
|
-
t.keys.map((d,
|
|
1057
|
-
|
|
1058
|
-
/* @__PURE__ */
|
|
1056
|
+
t.keys.map((d, s) => /* @__PURE__ */ l(v, { children: [
|
|
1057
|
+
s !== 0 && ", ",
|
|
1058
|
+
/* @__PURE__ */ r("b", { children: d })
|
|
1059
1059
|
] })),
|
|
1060
1060
|
" ",
|
|
1061
1061
|
"from the layout name ",
|
|
1062
|
-
/* @__PURE__ */
|
|
1062
|
+
/* @__PURE__ */ r("b", { children: a }),
|
|
1063
1063
|
".",
|
|
1064
|
-
/* @__PURE__ */
|
|
1065
|
-
/* @__PURE__ */
|
|
1066
|
-
/* @__PURE__ */
|
|
1064
|
+
/* @__PURE__ */ r("br", {}),
|
|
1065
|
+
/* @__PURE__ */ r("pre", { className: "mt-3", children: n(t) }),
|
|
1066
|
+
/* @__PURE__ */ r("br", {})
|
|
1067
1067
|
] });
|
|
1068
1068
|
}
|
|
1069
|
-
return t instanceof
|
|
1069
|
+
return t instanceof g ? /* @__PURE__ */ l(x, { variant: "danger", children: [
|
|
1070
1070
|
"Error on key ",
|
|
1071
|
-
/* @__PURE__ */
|
|
1071
|
+
/* @__PURE__ */ r("b", { children: t.key }),
|
|
1072
1072
|
" from the layout name ",
|
|
1073
|
-
/* @__PURE__ */
|
|
1073
|
+
/* @__PURE__ */ r("b", { children: a }),
|
|
1074
1074
|
".",
|
|
1075
|
-
/* @__PURE__ */
|
|
1076
|
-
/* @__PURE__ */
|
|
1077
|
-
/* @__PURE__ */
|
|
1078
|
-
] }) : /* @__PURE__ */
|
|
1075
|
+
/* @__PURE__ */ r("br", {}),
|
|
1076
|
+
/* @__PURE__ */ r("pre", { className: "mt-3", children: n(t) }),
|
|
1077
|
+
/* @__PURE__ */ r("br", {})
|
|
1078
|
+
] }) : /* @__PURE__ */ r(Be, { ...e });
|
|
1079
1079
|
}
|
|
1080
|
-
const
|
|
1080
|
+
const ie = {
|
|
1081
1081
|
hasError: !1,
|
|
1082
1082
|
message: "",
|
|
1083
1083
|
error: void 0
|
|
1084
1084
|
};
|
|
1085
|
-
class
|
|
1085
|
+
class Je extends se {
|
|
1086
1086
|
constructor(t) {
|
|
1087
1087
|
super(t), this.reload = () => {
|
|
1088
1088
|
window.location.reload();
|
|
1089
|
-
}, this.state =
|
|
1089
|
+
}, this.state = ie;
|
|
1090
1090
|
}
|
|
1091
1091
|
static getDerivedStateFromError() {
|
|
1092
1092
|
return { hasError: !0 };
|
|
1093
1093
|
}
|
|
1094
1094
|
componentDidCatch(t) {
|
|
1095
|
-
t instanceof
|
|
1095
|
+
t instanceof H && this.setState({
|
|
1096
1096
|
hasError: !0,
|
|
1097
1097
|
message: t.message,
|
|
1098
1098
|
error: t
|
|
1099
1099
|
});
|
|
1100
1100
|
}
|
|
1101
1101
|
// https://github.com/bvaughn/react-error-boundary/blob/23a4d779744f3079dfe0960acaa4bdfd5dede87b/src/ErrorBoundary.ts#L53
|
|
1102
|
-
componentDidUpdate(t,
|
|
1103
|
-
this.state.hasError &&
|
|
1102
|
+
componentDidUpdate(t, n) {
|
|
1103
|
+
this.state.hasError && n.error !== void 0 && t.resetKey !== this.props.resetKey && this.setState(ie);
|
|
1104
1104
|
}
|
|
1105
1105
|
render() {
|
|
1106
|
-
return this.state.hasError ? /* @__PURE__ */
|
|
1107
|
-
/* @__PURE__ */
|
|
1108
|
-
/* @__PURE__ */
|
|
1109
|
-
|
|
1106
|
+
return this.state.hasError ? /* @__PURE__ */ l($, { className: "mt-2", children: [
|
|
1107
|
+
/* @__PURE__ */ r("h4", { children: "Something went wrong" }),
|
|
1108
|
+
/* @__PURE__ */ r(
|
|
1109
|
+
Ze,
|
|
1110
1110
|
{
|
|
1111
1111
|
message: this.state.message,
|
|
1112
1112
|
error: this.state.error
|
|
1113
1113
|
}
|
|
1114
1114
|
),
|
|
1115
|
-
/* @__PURE__ */
|
|
1115
|
+
/* @__PURE__ */ l("p", { children: [
|
|
1116
1116
|
"This error has been logged. Please",
|
|
1117
1117
|
" ",
|
|
1118
|
-
/* @__PURE__ */
|
|
1119
|
-
/* @__PURE__ */
|
|
1118
|
+
/* @__PURE__ */ l(y, { size: "sm", onClick: this.reload, children: [
|
|
1119
|
+
/* @__PURE__ */ r("i", { className: "fa fa-refresh" }),
|
|
1120
1120
|
" Reload"
|
|
1121
1121
|
] }),
|
|
1122
1122
|
" ",
|
|
@@ -1125,49 +1125,49 @@ class ze extends ie {
|
|
|
1125
1125
|
] }) : this.props.children;
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
|
-
function
|
|
1129
|
-
if (e &&
|
|
1130
|
-
throw new
|
|
1128
|
+
function Qe(e, t, n) {
|
|
1129
|
+
if (e && n === void 0)
|
|
1130
|
+
throw new L(e, [t]);
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1133
|
-
if (typeof
|
|
1134
|
-
throw new
|
|
1132
|
+
function Xe(e, t, n) {
|
|
1133
|
+
if (typeof n != "string")
|
|
1134
|
+
throw new g(e, t, "A string is expected");
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1137
|
-
if (typeof
|
|
1138
|
-
throw new
|
|
1136
|
+
function et(e, t, n) {
|
|
1137
|
+
if (typeof n != "boolean")
|
|
1138
|
+
throw new g(e, t, "A boolean is expected");
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1141
|
-
if (typeof
|
|
1142
|
-
throw new
|
|
1140
|
+
function tt(e, t, n) {
|
|
1141
|
+
if (typeof n != "number")
|
|
1142
|
+
throw new g(e, t, "A number is expected");
|
|
1143
1143
|
}
|
|
1144
|
-
function G(e, t,
|
|
1145
|
-
if (
|
|
1146
|
-
throw new
|
|
1144
|
+
function G(e, t, n) {
|
|
1145
|
+
if (n !== void 0 && typeof n != "boolean")
|
|
1146
|
+
throw new g(e, t, "An optional boolean is expected");
|
|
1147
1147
|
}
|
|
1148
|
-
function
|
|
1149
|
-
if (
|
|
1150
|
-
throw new
|
|
1148
|
+
function fe(e, t, n) {
|
|
1149
|
+
if (n !== void 0 && typeof n != "string")
|
|
1150
|
+
throw new g(e, t, "An optional string is expected");
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1153
|
-
if (!Array.isArray(
|
|
1154
|
-
throw new
|
|
1155
|
-
|
|
1152
|
+
function nt(e, t, n) {
|
|
1153
|
+
if (!Array.isArray(n))
|
|
1154
|
+
throw new g(e, t, "A list of string is expected");
|
|
1155
|
+
n.forEach((i) => {
|
|
1156
1156
|
if (typeof i != "string")
|
|
1157
|
-
throw new
|
|
1157
|
+
throw new g(e, t, "A list of string is expected");
|
|
1158
1158
|
});
|
|
1159
1159
|
}
|
|
1160
|
-
function
|
|
1161
|
-
if (
|
|
1162
|
-
if (!Array.isArray(
|
|
1163
|
-
throw new
|
|
1160
|
+
function rt(e, t, n) {
|
|
1161
|
+
if (n !== void 0 && typeof n != "string") {
|
|
1162
|
+
if (!Array.isArray(n))
|
|
1163
|
+
throw new g(
|
|
1164
1164
|
e,
|
|
1165
1165
|
t,
|
|
1166
1166
|
"An optional string or list of string is expected"
|
|
1167
1167
|
);
|
|
1168
|
-
|
|
1168
|
+
n.forEach((i) => {
|
|
1169
1169
|
if (typeof i != "string")
|
|
1170
|
-
throw new
|
|
1170
|
+
throw new g(
|
|
1171
1171
|
e,
|
|
1172
1172
|
t,
|
|
1173
1173
|
"An optional string or list of string is expected"
|
|
@@ -1175,13 +1175,13 @@ function Ze(e, t, r) {
|
|
|
1175
1175
|
});
|
|
1176
1176
|
}
|
|
1177
1177
|
}
|
|
1178
|
-
function
|
|
1179
|
-
if (
|
|
1180
|
-
if (!Array.isArray(
|
|
1181
|
-
throw new
|
|
1182
|
-
|
|
1178
|
+
function it(e, t, n) {
|
|
1179
|
+
if (n !== void 0) {
|
|
1180
|
+
if (!Array.isArray(n))
|
|
1181
|
+
throw new g(e, t, "An optional list of string is expected");
|
|
1182
|
+
n.forEach((i) => {
|
|
1183
1183
|
if (typeof i != "string")
|
|
1184
|
-
throw new
|
|
1184
|
+
throw new g(
|
|
1185
1185
|
e,
|
|
1186
1186
|
t,
|
|
1187
1187
|
"A optional list of string is expected"
|
|
@@ -1189,21 +1189,21 @@ function Je(e, t, r) {
|
|
|
1189
1189
|
});
|
|
1190
1190
|
}
|
|
1191
1191
|
}
|
|
1192
|
-
function
|
|
1193
|
-
if (
|
|
1194
|
-
throw new
|
|
1192
|
+
function me(e, t, n) {
|
|
1193
|
+
if (n !== void 0 && typeof n != "number")
|
|
1194
|
+
throw new g(e, t, "An optional number is expected");
|
|
1195
1195
|
}
|
|
1196
|
-
function
|
|
1197
|
-
if (
|
|
1198
|
-
if (!Array.isArray(
|
|
1199
|
-
throw new
|
|
1196
|
+
function at(e, t, n) {
|
|
1197
|
+
if (n !== void 0) {
|
|
1198
|
+
if (!Array.isArray(n))
|
|
1199
|
+
throw new g(
|
|
1200
1200
|
e,
|
|
1201
1201
|
t,
|
|
1202
1202
|
"An optional list of numbers is expected"
|
|
1203
1203
|
);
|
|
1204
|
-
|
|
1204
|
+
n.forEach((i) => {
|
|
1205
1205
|
if (typeof i != "number")
|
|
1206
|
-
throw new
|
|
1206
|
+
throw new g(
|
|
1207
1207
|
e,
|
|
1208
1208
|
t,
|
|
1209
1209
|
"An optional list of numbers is expected"
|
|
@@ -1211,71 +1211,71 @@ function Qe(e, t, r) {
|
|
|
1211
1211
|
});
|
|
1212
1212
|
}
|
|
1213
1213
|
}
|
|
1214
|
-
function
|
|
1215
|
-
const { _parentNode:
|
|
1214
|
+
function K(e, t) {
|
|
1215
|
+
const { _parentNode: n, _indexFromParent: i, ...a } = t;
|
|
1216
1216
|
if (e && Object.keys(a).length > 0)
|
|
1217
|
-
throw new
|
|
1217
|
+
throw new V(e, Object.keys(a));
|
|
1218
1218
|
}
|
|
1219
|
-
function
|
|
1220
|
-
if (
|
|
1221
|
-
throw new
|
|
1219
|
+
function ot(e, t, n) {
|
|
1220
|
+
if (n !== "last" && typeof n != "number")
|
|
1221
|
+
throw new g(e, t, '"last" or a number is expected');
|
|
1222
1222
|
}
|
|
1223
|
-
function
|
|
1224
|
-
if (
|
|
1225
|
-
throw new
|
|
1223
|
+
function st(e, t, n) {
|
|
1224
|
+
if (n !== void 0 && n !== "h5web" && n !== "plotly")
|
|
1225
|
+
throw new g(e, t, '"h5web" or "plotly" string is expected');
|
|
1226
1226
|
}
|
|
1227
|
-
const
|
|
1227
|
+
const Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1228
1228
|
__proto__: null,
|
|
1229
|
-
assertBoolean:
|
|
1230
|
-
assertDataCollectionId:
|
|
1231
|
-
assertKeyExpected:
|
|
1232
|
-
assertNoUnknownKeys:
|
|
1233
|
-
assertNumber:
|
|
1234
|
-
assertOptionalBackend:
|
|
1229
|
+
assertBoolean: et,
|
|
1230
|
+
assertDataCollectionId: ot,
|
|
1231
|
+
assertKeyExpected: Qe,
|
|
1232
|
+
assertNoUnknownKeys: K,
|
|
1233
|
+
assertNumber: tt,
|
|
1234
|
+
assertOptionalBackend: st,
|
|
1235
1235
|
assertOptionalBoolean: G,
|
|
1236
|
-
assertOptionalNumber:
|
|
1237
|
-
assertOptionalNumberList:
|
|
1238
|
-
assertOptionalString:
|
|
1239
|
-
assertOptionalStringList:
|
|
1240
|
-
assertOptionalStringOrStringList:
|
|
1241
|
-
assertString:
|
|
1242
|
-
assertStringList:
|
|
1236
|
+
assertOptionalNumber: me,
|
|
1237
|
+
assertOptionalNumberList: at,
|
|
1238
|
+
assertOptionalString: fe,
|
|
1239
|
+
assertOptionalStringList: it,
|
|
1240
|
+
assertOptionalStringOrStringList: rt,
|
|
1241
|
+
assertString: Xe,
|
|
1242
|
+
assertStringList: nt
|
|
1243
1243
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1244
|
-
function
|
|
1245
|
-
const { type:
|
|
1246
|
-
return
|
|
1247
|
-
}
|
|
1248
|
-
function
|
|
1249
|
-
const { type:
|
|
1250
|
-
return
|
|
1251
|
-
|
|
1244
|
+
function lt({ yamlNode: e, panel: t }) {
|
|
1245
|
+
const { type: n, style: i, children: a, ...o } = e;
|
|
1246
|
+
return K(e, o), /* @__PURE__ */ r(P, { className: "ymllayout-row gx-0", style: i, children: C(a, (d, s) => O(d, s, t)) });
|
|
1247
|
+
}
|
|
1248
|
+
function ct({ yamlNode: e, panel: t }) {
|
|
1249
|
+
const { type: n, style: i, xs: a, children: o, ...d } = e;
|
|
1250
|
+
return K(e, d), me(e, "xs", a), /* @__PURE__ */ r(
|
|
1251
|
+
E,
|
|
1252
1252
|
{
|
|
1253
|
-
className:
|
|
1253
|
+
className: T("yamymllayout-col", { col: !!a }),
|
|
1254
1254
|
style: i,
|
|
1255
1255
|
xs: a,
|
|
1256
|
-
children: C(e.children, (
|
|
1256
|
+
children: C(e.children, (s, h) => O(s, h, t))
|
|
1257
1257
|
}
|
|
1258
1258
|
);
|
|
1259
1259
|
}
|
|
1260
|
-
const
|
|
1261
|
-
function
|
|
1262
|
-
|
|
1260
|
+
const W = {};
|
|
1261
|
+
function Bt(e, t) {
|
|
1262
|
+
W[e] = t;
|
|
1263
1263
|
}
|
|
1264
|
-
function
|
|
1264
|
+
function dt(e, t) {
|
|
1265
1265
|
if (t === void 0)
|
|
1266
|
-
throw new
|
|
1266
|
+
throw new L(e, ["id"]);
|
|
1267
1267
|
if (typeof t.id != "string")
|
|
1268
|
-
throw new
|
|
1268
|
+
throw new g(e, "id", "A string is expected");
|
|
1269
1269
|
}
|
|
1270
|
-
function
|
|
1271
|
-
if (
|
|
1272
|
-
if (!Array.isArray(
|
|
1273
|
-
throw new
|
|
1274
|
-
|
|
1270
|
+
function ut(e, t, n) {
|
|
1271
|
+
if (n !== void 0) {
|
|
1272
|
+
if (!Array.isArray(n))
|
|
1273
|
+
throw new g(e, "ids", "A option list is expected");
|
|
1274
|
+
n.forEach((i, a) => {
|
|
1275
1275
|
try {
|
|
1276
|
-
|
|
1276
|
+
dt(e, i);
|
|
1277
1277
|
} catch {
|
|
1278
|
-
throw new
|
|
1278
|
+
throw new g(
|
|
1279
1279
|
e,
|
|
1280
1280
|
"ids",
|
|
1281
1281
|
`The hardware description ${a} is wrong`
|
|
@@ -1284,20 +1284,20 @@ function it(e, t, r) {
|
|
|
1284
1284
|
});
|
|
1285
1285
|
}
|
|
1286
1286
|
}
|
|
1287
|
-
function
|
|
1287
|
+
function ht(e) {
|
|
1288
1288
|
const {
|
|
1289
1289
|
providers: t = {},
|
|
1290
|
-
yamlNode:
|
|
1290
|
+
yamlNode: n,
|
|
1291
1291
|
ids: i,
|
|
1292
1292
|
groupid: a,
|
|
1293
1293
|
even: o,
|
|
1294
1294
|
nowrap: d,
|
|
1295
|
-
...
|
|
1295
|
+
...s
|
|
1296
1296
|
} = e;
|
|
1297
|
-
if (
|
|
1298
|
-
return /* @__PURE__ */
|
|
1299
|
-
const h =
|
|
1300
|
-
return /* @__PURE__ */
|
|
1297
|
+
if (ut(n, "ids", i), fe(n, "groupid", a), G(n, "even", o), G(n, "nowrap", d), K(n, s), !W.HardwareGroup)
|
|
1298
|
+
return /* @__PURE__ */ r(x, { variant: "warning", children: "No `HardwareGroup` component registered" });
|
|
1299
|
+
const h = W.HardwareGroup;
|
|
1300
|
+
return /* @__PURE__ */ r(
|
|
1301
1301
|
h,
|
|
1302
1302
|
{
|
|
1303
1303
|
providers: t,
|
|
@@ -1309,57 +1309,57 @@ function at(e) {
|
|
|
1309
1309
|
);
|
|
1310
1310
|
}
|
|
1311
1311
|
const B = {
|
|
1312
|
-
hardwaregroup:
|
|
1312
|
+
hardwaregroup: ht
|
|
1313
1313
|
};
|
|
1314
|
-
function
|
|
1314
|
+
function Zt(e, t) {
|
|
1315
1315
|
B[e] = t;
|
|
1316
1316
|
}
|
|
1317
|
-
function
|
|
1318
|
-
const { yamlNode: t, panel:
|
|
1317
|
+
function ft(e) {
|
|
1318
|
+
const { yamlNode: t, panel: n } = e, { type: i, style: a, scroll: o, title: d, ...s } = t;
|
|
1319
1319
|
if (!(i in B))
|
|
1320
|
-
return /* @__PURE__ */
|
|
1320
|
+
return /* @__PURE__ */ r(p, { children: /* @__PURE__ */ r(p.Contents, { children: /* @__PURE__ */ l(x, { variant: "warning", children: [
|
|
1321
1321
|
'Unknown component "',
|
|
1322
1322
|
i,
|
|
1323
1323
|
'"'
|
|
1324
1324
|
] }) }) });
|
|
1325
1325
|
const h = B[t.type];
|
|
1326
|
-
return
|
|
1327
|
-
d && /* @__PURE__ */
|
|
1328
|
-
/* @__PURE__ */
|
|
1329
|
-
] }) }) : /* @__PURE__ */
|
|
1330
|
-
}
|
|
1331
|
-
function
|
|
1332
|
-
const
|
|
1333
|
-
return /* @__PURE__ */
|
|
1334
|
-
}
|
|
1335
|
-
function
|
|
1336
|
-
const { yamlNode: t } = e,
|
|
1337
|
-
return
|
|
1338
|
-
t.title && /* @__PURE__ */
|
|
1339
|
-
/* @__PURE__ */
|
|
1326
|
+
return n ? /* @__PURE__ */ r(p, { style: a, scroll: o, children: /* @__PURE__ */ l(ne, { fallback: /* @__PURE__ */ r("p", { children: "Loading..." }), children: [
|
|
1327
|
+
d && /* @__PURE__ */ r(p.Header, { children: d }),
|
|
1328
|
+
/* @__PURE__ */ r(p.Contents, { children: /* @__PURE__ */ r(h, { ...s, yamlNode: t }) })
|
|
1329
|
+
] }) }) : /* @__PURE__ */ r(ne, { fallback: /* @__PURE__ */ r("p", { children: "Loading..." }), children: /* @__PURE__ */ r(h, { ...s, yamlNode: t }) });
|
|
1330
|
+
}
|
|
1331
|
+
function mt({ yamlNode: e, panel: t }) {
|
|
1332
|
+
const n = e.options || {};
|
|
1333
|
+
return /* @__PURE__ */ r($, { className: "ymllayout-container", ...n, children: C(e.children, (i, a) => O(i, a, t)) });
|
|
1334
|
+
}
|
|
1335
|
+
function pt(e) {
|
|
1336
|
+
const { yamlNode: t } = e, n = t.options || {}, i = {};
|
|
1337
|
+
return n.centerContent && (i.margin = "auto"), /* @__PURE__ */ l(p, { className: "ymllayout-panel", ...n, children: [
|
|
1338
|
+
t.title && /* @__PURE__ */ r(p.Header, { children: t.title }),
|
|
1339
|
+
/* @__PURE__ */ r(p.Contents, { style: i, children: C(
|
|
1340
1340
|
t.children,
|
|
1341
1341
|
(a, o) => O(a, o, !1)
|
|
1342
1342
|
) })
|
|
1343
1343
|
] });
|
|
1344
1344
|
}
|
|
1345
|
-
const
|
|
1346
|
-
function
|
|
1347
|
-
const
|
|
1348
|
-
return
|
|
1349
|
-
|
|
1350
|
-
/* @__PURE__ */
|
|
1345
|
+
const gt = () => Math.random().toString(36).slice(2, 15) + Math.random().toString(36).slice(2, 15);
|
|
1346
|
+
function wt({ yamlNode: e, panel: t }) {
|
|
1347
|
+
const n = [];
|
|
1348
|
+
return ve(e.children, (i, a) => {
|
|
1349
|
+
n.push(
|
|
1350
|
+
/* @__PURE__ */ r(be, { eventKey: gt(), title: i.title, children: O(i, 0, !1) }, a)
|
|
1351
1351
|
);
|
|
1352
|
-
}), t ? /* @__PURE__ */
|
|
1353
|
-
e.title && /* @__PURE__ */
|
|
1354
|
-
/* @__PURE__ */
|
|
1355
|
-
] }) : /* @__PURE__ */
|
|
1352
|
+
}), t ? /* @__PURE__ */ l(p, { className: "ymllayout-tabs", children: [
|
|
1353
|
+
e.title && /* @__PURE__ */ r(p.Header, { children: e.title }),
|
|
1354
|
+
/* @__PURE__ */ r(p.Contents, { children: /* @__PURE__ */ r(te, { mountOnEnter: !0, children: n }) })
|
|
1355
|
+
] }) : /* @__PURE__ */ r(te, { children: n });
|
|
1356
1356
|
}
|
|
1357
|
-
function
|
|
1358
|
-
const { node: t } = e, { type:
|
|
1359
|
-
return
|
|
1357
|
+
function yt(e) {
|
|
1358
|
+
const { node: t } = e, { type: n, title: i, ...a } = t;
|
|
1359
|
+
return ue(t, a), /* @__PURE__ */ r("div", { style: { gridColumn: "1 / 3" }, children: /* @__PURE__ */ r("h3", { children: i }) });
|
|
1360
1360
|
}
|
|
1361
|
-
function
|
|
1362
|
-
const { node: t, state:
|
|
1361
|
+
function vt(e) {
|
|
1362
|
+
const { node: t, state: n, row: i } = e, { title: a } = t;
|
|
1363
1363
|
function o() {
|
|
1364
1364
|
if (t.id)
|
|
1365
1365
|
return t.id;
|
|
@@ -1380,48 +1380,48 @@ function ht(e) {
|
|
|
1380
1380
|
}
|
|
1381
1381
|
return "";
|
|
1382
1382
|
}
|
|
1383
|
-
const
|
|
1384
|
-
return /* @__PURE__ */
|
|
1383
|
+
const s = d();
|
|
1384
|
+
return /* @__PURE__ */ l(
|
|
1385
1385
|
"div",
|
|
1386
1386
|
{
|
|
1387
1387
|
style: {
|
|
1388
1388
|
textAlign: "center"
|
|
1389
1389
|
},
|
|
1390
1390
|
children: [
|
|
1391
|
-
/* @__PURE__ */
|
|
1391
|
+
/* @__PURE__ */ r(
|
|
1392
1392
|
"h5",
|
|
1393
1393
|
{
|
|
1394
1394
|
style: {
|
|
1395
1395
|
margin: "0px",
|
|
1396
1396
|
whiteSpace: "nowrap"
|
|
1397
1397
|
},
|
|
1398
|
-
children:
|
|
1398
|
+
children: s
|
|
1399
1399
|
}
|
|
1400
1400
|
),
|
|
1401
|
-
|
|
1401
|
+
n && /* @__PURE__ */ r("div", { style: { position: "relative", top: -5 }, children: n })
|
|
1402
1402
|
]
|
|
1403
1403
|
}
|
|
1404
1404
|
);
|
|
1405
1405
|
}
|
|
1406
|
-
function
|
|
1407
|
-
const { node: t, row:
|
|
1406
|
+
function bt(e) {
|
|
1407
|
+
const { node: t, row: n } = e, {
|
|
1408
1408
|
titlealign: i,
|
|
1409
1409
|
title: a,
|
|
1410
1410
|
stateinheader: o = !1,
|
|
1411
1411
|
variant: d,
|
|
1412
|
-
id:
|
|
1412
|
+
id: s,
|
|
1413
1413
|
...h
|
|
1414
1414
|
} = t;
|
|
1415
1415
|
let u, c;
|
|
1416
1416
|
if (h.type === "hardware")
|
|
1417
1417
|
if (u = {
|
|
1418
1418
|
...h,
|
|
1419
|
-
id:
|
|
1419
|
+
id: s,
|
|
1420
1420
|
variant: d
|
|
1421
1421
|
}, o) {
|
|
1422
1422
|
const f = {
|
|
1423
1423
|
...h,
|
|
1424
|
-
id:
|
|
1424
|
+
id: s,
|
|
1425
1425
|
variant: "state",
|
|
1426
1426
|
emptyifnone: !0
|
|
1427
1427
|
};
|
|
@@ -1430,46 +1430,46 @@ function ft(e) {
|
|
|
1430
1430
|
c = null;
|
|
1431
1431
|
else
|
|
1432
1432
|
u = h, c = null;
|
|
1433
|
-
return /* @__PURE__ */
|
|
1434
|
-
/* @__PURE__ */
|
|
1433
|
+
return /* @__PURE__ */ l(v, { children: [
|
|
1434
|
+
/* @__PURE__ */ r(
|
|
1435
1435
|
"div",
|
|
1436
1436
|
{
|
|
1437
1437
|
style: {
|
|
1438
1438
|
gridColumn: 1,
|
|
1439
1439
|
alignSelf: i ?? "center"
|
|
1440
1440
|
},
|
|
1441
|
-
children: /* @__PURE__ */
|
|
1441
|
+
children: /* @__PURE__ */ r(vt, { node: t, state: c, row: n })
|
|
1442
1442
|
}
|
|
1443
1443
|
),
|
|
1444
|
-
/* @__PURE__ */
|
|
1444
|
+
/* @__PURE__ */ r("div", { style: { gridColumn: 2 }, children: O(u, "k", !1) })
|
|
1445
1445
|
] });
|
|
1446
1446
|
}
|
|
1447
|
-
function
|
|
1448
|
-
const { yamlNode: t, panel:
|
|
1449
|
-
return
|
|
1450
|
-
t.title && /* @__PURE__ */
|
|
1451
|
-
/* @__PURE__ */
|
|
1447
|
+
function Nt(e) {
|
|
1448
|
+
const { yamlNode: t, panel: n } = e, { type: i, children: a, options: o = {}, title: d, ...s } = t;
|
|
1449
|
+
return ue(t, s), /* @__PURE__ */ l(p, { className: "ymllayout-form", ...o, children: [
|
|
1450
|
+
t.title && /* @__PURE__ */ r(p.Header, { children: t.title }),
|
|
1451
|
+
/* @__PURE__ */ r(p.Contents, { children: /* @__PURE__ */ r(
|
|
1452
1452
|
"div",
|
|
1453
1453
|
{
|
|
1454
1454
|
style: {
|
|
1455
1455
|
display: "grid",
|
|
1456
1456
|
gridTemplateColumns: "min-content auto"
|
|
1457
1457
|
},
|
|
1458
|
-
children: C(a, (h, u) => h.type === "formheader" ? /* @__PURE__ */
|
|
1459
|
-
|
|
1458
|
+
children: C(a, (h, u) => h.type === "formheader" ? /* @__PURE__ */ r(
|
|
1459
|
+
yt,
|
|
1460
1460
|
{
|
|
1461
1461
|
node: h,
|
|
1462
1462
|
row: u
|
|
1463
1463
|
},
|
|
1464
1464
|
u
|
|
1465
|
-
) : /* @__PURE__ */
|
|
1465
|
+
) : /* @__PURE__ */ r(bt, { node: h, row: u }, u))
|
|
1466
1466
|
}
|
|
1467
1467
|
) })
|
|
1468
1468
|
] });
|
|
1469
1469
|
}
|
|
1470
|
-
function
|
|
1471
|
-
const { yamlNode: t, panel:
|
|
1472
|
-
return /* @__PURE__ */
|
|
1470
|
+
function Ct(e) {
|
|
1471
|
+
const { yamlNode: t, panel: n } = e;
|
|
1472
|
+
return /* @__PURE__ */ l(
|
|
1473
1473
|
"div",
|
|
1474
1474
|
{
|
|
1475
1475
|
className: "ymllayout-grid",
|
|
@@ -1479,8 +1479,8 @@ function pt(e) {
|
|
|
1479
1479
|
},
|
|
1480
1480
|
children: [
|
|
1481
1481
|
C(t.children, (i, a) => {
|
|
1482
|
-
const { columnSpan: o = 1, rowSpan: d = 1, ...
|
|
1483
|
-
return /* @__PURE__ */
|
|
1482
|
+
const { columnSpan: o = 1, rowSpan: d = 1, ...s } = i, h = o > 1 ? `span ${o}` : void 0, u = d > 1 ? `span ${d}` : void 0;
|
|
1483
|
+
return /* @__PURE__ */ r(
|
|
1484
1484
|
"div",
|
|
1485
1485
|
{
|
|
1486
1486
|
className: "ymllayout-grid-cell",
|
|
@@ -1488,7 +1488,7 @@ function pt(e) {
|
|
|
1488
1488
|
gridColumn: h,
|
|
1489
1489
|
gridRow: u
|
|
1490
1490
|
},
|
|
1491
|
-
children: O(
|
|
1491
|
+
children: O(s, a, n)
|
|
1492
1492
|
},
|
|
1493
1493
|
a
|
|
1494
1494
|
);
|
|
@@ -1498,70 +1498,188 @@ function pt(e) {
|
|
|
1498
1498
|
}
|
|
1499
1499
|
);
|
|
1500
1500
|
}
|
|
1501
|
-
function
|
|
1502
|
-
const
|
|
1503
|
-
return /* @__PURE__ */
|
|
1504
|
-
}
|
|
1505
|
-
const
|
|
1506
|
-
row:
|
|
1507
|
-
col:
|
|
1508
|
-
container:
|
|
1509
|
-
component:
|
|
1510
|
-
panel:
|
|
1511
|
-
tabs:
|
|
1512
|
-
form:
|
|
1513
|
-
grid:
|
|
1514
|
-
label:
|
|
1501
|
+
function Ot({ yamlNode: e, panel: t }) {
|
|
1502
|
+
const n = e.options || {};
|
|
1503
|
+
return /* @__PURE__ */ r(Ue, { panel: t, options: n, children: /* @__PURE__ */ r("div", { children: e.label }) });
|
|
1504
|
+
}
|
|
1505
|
+
const St = {
|
|
1506
|
+
row: lt,
|
|
1507
|
+
col: ct,
|
|
1508
|
+
container: mt,
|
|
1509
|
+
component: ft,
|
|
1510
|
+
panel: pt,
|
|
1511
|
+
tabs: wt,
|
|
1512
|
+
form: Nt,
|
|
1513
|
+
grid: Ct,
|
|
1514
|
+
label: Ot
|
|
1515
1515
|
};
|
|
1516
|
-
Object.entries(
|
|
1517
|
-
|
|
1516
|
+
Object.entries(St).forEach(([e, t]) => {
|
|
1517
|
+
qe(e, t);
|
|
1518
1518
|
});
|
|
1519
|
-
function
|
|
1520
|
-
var
|
|
1521
|
-
const t =
|
|
1522
|
-
return t.error ? /* @__PURE__ */
|
|
1523
|
-
/* @__PURE__ */
|
|
1524
|
-
/* @__PURE__ */
|
|
1525
|
-
/* @__PURE__ */
|
|
1519
|
+
function Jt(e) {
|
|
1520
|
+
var n;
|
|
1521
|
+
const t = xe(() => he(e.layout), [e.layout]);
|
|
1522
|
+
return t.error ? /* @__PURE__ */ r("div", { className: `${e.className ?? ""} ymllayout-main`, id: e.id, children: /* @__PURE__ */ l(p, { children: [
|
|
1523
|
+
/* @__PURE__ */ r(p.Header, { children: "Layout Error" }),
|
|
1524
|
+
/* @__PURE__ */ l(p.Contents, { children: [
|
|
1525
|
+
/* @__PURE__ */ l("p", { children: [
|
|
1526
1526
|
"File: ",
|
|
1527
1527
|
t.name
|
|
1528
1528
|
] }),
|
|
1529
|
-
/* @__PURE__ */
|
|
1529
|
+
/* @__PURE__ */ r(x, { variant: "warning", children: /* @__PURE__ */ r("pre", { className: "mb-0", children: t.error }) })
|
|
1530
1530
|
] })
|
|
1531
|
-
] }) }) : /* @__PURE__ */
|
|
1531
|
+
] }) }) : /* @__PURE__ */ r("div", { className: `${e.className ?? ""} ymllayout-main`, id: e.id, children: /* @__PURE__ */ r(Je, { resetKey: t, children: (n = t.children) == null ? void 0 : n.map((i, a) => O(i, a)) }) });
|
|
1532
1532
|
}
|
|
1533
|
-
const
|
|
1533
|
+
const Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1534
1534
|
__proto__: null
|
|
1535
|
-
}, Symbol.toStringTag, { value: "Module" }))
|
|
1535
|
+
}, Symbol.toStringTag, { value: "Module" })), pe = {
|
|
1536
|
+
hardware: kt
|
|
1537
|
+
};
|
|
1538
|
+
function Xt(e, t) {
|
|
1539
|
+
pe[e] = t;
|
|
1540
|
+
}
|
|
1541
|
+
function Et(e) {
|
|
1542
|
+
return /* @__PURE__ */ l(
|
|
1543
|
+
E,
|
|
1544
|
+
{
|
|
1545
|
+
className: "monitor-panel-item bg-fatal",
|
|
1546
|
+
title: `Error from yaml configuration: ${e.message}`,
|
|
1547
|
+
children: [
|
|
1548
|
+
/* @__PURE__ */ r("h1", { children: e.monitor.name }),
|
|
1549
|
+
/* @__PURE__ */ r("div", { children: "Parsing error" })
|
|
1550
|
+
]
|
|
1551
|
+
}
|
|
1552
|
+
);
|
|
1553
|
+
}
|
|
1554
|
+
function en(e) {
|
|
1555
|
+
const t = C(e.monitors, (n, i) => {
|
|
1556
|
+
const a = n.type ?? "hardware", o = pe[a];
|
|
1557
|
+
return o === void 0 ? /* @__PURE__ */ r(
|
|
1558
|
+
Et,
|
|
1559
|
+
{
|
|
1560
|
+
monitor: n,
|
|
1561
|
+
message: `Type ${a} unsupported`
|
|
1562
|
+
},
|
|
1563
|
+
`m${i}`
|
|
1564
|
+
) : /* @__PURE__ */ r(o, { monitor: n }, `m${i}`);
|
|
1565
|
+
});
|
|
1566
|
+
return /* @__PURE__ */ r(
|
|
1567
|
+
"div",
|
|
1568
|
+
{
|
|
1569
|
+
className: T(
|
|
1570
|
+
{ "ms-auto": e.margin === "start" },
|
|
1571
|
+
"me-auto",
|
|
1572
|
+
"monitor-panel",
|
|
1573
|
+
{ "monitor-panel-light": e.bg === "light" }
|
|
1574
|
+
),
|
|
1575
|
+
children: /* @__PURE__ */ r($, { fluid: !0, children: /* @__PURE__ */ r(P, { className: "flex-nowrap", children: t }) })
|
|
1576
|
+
}
|
|
1577
|
+
);
|
|
1578
|
+
}
|
|
1579
|
+
function xt(e) {
|
|
1580
|
+
return /* @__PURE__ */ r(E, { className: "monitor-panel-item", children: e.children });
|
|
1581
|
+
}
|
|
1582
|
+
const Z = {};
|
|
1583
|
+
function tn(e, t) {
|
|
1584
|
+
Z[e] = t;
|
|
1585
|
+
}
|
|
1586
|
+
function ge(e) {
|
|
1587
|
+
if (!Z.useHardware)
|
|
1588
|
+
throw new Error("No `useHardware` hook registered");
|
|
1589
|
+
return Z.useHardware(e);
|
|
1590
|
+
}
|
|
1591
|
+
const Mt = (e, t, n) => {
|
|
1592
|
+
const i = {
|
|
1593
|
+
">": (a, o) => a > o,
|
|
1594
|
+
"<": (a, o) => a < o,
|
|
1595
|
+
">=": (a, o) => a >= o,
|
|
1596
|
+
"<=": (a, o) => a <= o,
|
|
1597
|
+
"==": (a, o) => a === o,
|
|
1598
|
+
"!=": (a, o) => a !== o,
|
|
1599
|
+
in: (a, o) => o.indexOf(a) > -1
|
|
1600
|
+
};
|
|
1601
|
+
if (e in i)
|
|
1602
|
+
return i[e](t, n);
|
|
1603
|
+
};
|
|
1604
|
+
function we(e, t, n) {
|
|
1605
|
+
const i = e.split(t);
|
|
1606
|
+
return n ? [i.slice(0, -n).join(t)].concat(i.slice(-n)) : i;
|
|
1607
|
+
}
|
|
1608
|
+
function ae(e) {
|
|
1609
|
+
const t = e !== void 0 ? we(e, ".", 1) : [null, ""], n = ge(t[0]);
|
|
1610
|
+
if (n && n.properties && t[1] !== null)
|
|
1611
|
+
return Array.isArray(n.properties[t[1]]) ? n.properties[t[1]][0] : n.properties[t[1]];
|
|
1612
|
+
}
|
|
1613
|
+
function At(e) {
|
|
1614
|
+
const t = e !== void 0 && !e.includes("."), n = e !== void 0 ? we(e, ".", 1) : [null, ""], i = ge(n[0]);
|
|
1615
|
+
if (t)
|
|
1616
|
+
return e;
|
|
1617
|
+
if (i && i.properties && n[1] !== null)
|
|
1618
|
+
return `${i.properties[n[1]]}`;
|
|
1619
|
+
}
|
|
1620
|
+
function kt(e) {
|
|
1621
|
+
const { monitor: t } = e;
|
|
1622
|
+
let n = ae(t.value) ?? "-";
|
|
1623
|
+
const i = At(t.unit), a = ae(t.overlay), o = Number.parseFloat(`${n}`);
|
|
1624
|
+
Number.isNaN(o) || String(o).length > 5 && (n = o.toPrecision(5));
|
|
1625
|
+
let d;
|
|
1626
|
+
t.comparator && t.comparison && (d = Mt(t.comparator, n, t.comparison) ? "valid" : "invalid"), Number.isNaN(o) || i !== void 0 && (n = `${n} ${i}`);
|
|
1627
|
+
let s = U;
|
|
1628
|
+
const h = {};
|
|
1629
|
+
if (a) {
|
|
1630
|
+
const u = `${a}`;
|
|
1631
|
+
let c = U;
|
|
1632
|
+
u.includes(`
|
|
1633
|
+
`) && (c = "pre"), s = F, h.placement = "bottom", h.overlay = /* @__PURE__ */ r(Ne, {
|
|
1634
|
+
id: "tooltipid",
|
|
1635
|
+
className: "monitor-panel-tooltip",
|
|
1636
|
+
// @ts-expect-error
|
|
1637
|
+
children: /* @__PURE__ */ r(c, { children: u })
|
|
1638
|
+
});
|
|
1639
|
+
}
|
|
1640
|
+
return (
|
|
1641
|
+
// @ts-expect-error
|
|
1642
|
+
/* @__PURE__ */ Me(s, { ...h, key: t.name }, /* @__PURE__ */ l(xt, { children: [
|
|
1643
|
+
/* @__PURE__ */ r("h1", { children: t.name }),
|
|
1644
|
+
/* @__PURE__ */ r("div", { className: d, children: `${n}` })
|
|
1645
|
+
] }))
|
|
1646
|
+
);
|
|
1647
|
+
}
|
|
1536
1648
|
export {
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1649
|
+
Ht as Formatting,
|
|
1650
|
+
_t as Frontend,
|
|
1651
|
+
Ye as FullSizer,
|
|
1652
|
+
Qt as HWObject,
|
|
1653
|
+
re as HardwareInputNumber,
|
|
1654
|
+
_e as HardwareNumericStep,
|
|
1655
|
+
Gt as HardwareSchema,
|
|
1656
|
+
Vt as HardwareState,
|
|
1545
1657
|
Y as HardwareTemplate,
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1658
|
+
Ut as HardwareTypes,
|
|
1659
|
+
qt as HardwareVariant,
|
|
1660
|
+
Pt as Info,
|
|
1661
|
+
g as KeyError,
|
|
1662
|
+
L as MissingKeysError,
|
|
1663
|
+
kt as MonitorHardware,
|
|
1664
|
+
en as MonitorPanel,
|
|
1665
|
+
xt as MonitorPanelItem,
|
|
1666
|
+
Lt as MotorDefault,
|
|
1667
|
+
jt as Multiposition,
|
|
1668
|
+
Yt as NoObject,
|
|
1669
|
+
He as NumericStep,
|
|
1670
|
+
Kt as Property,
|
|
1671
|
+
zt as ShutterDefault,
|
|
1557
1672
|
I as TypeIcon,
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1673
|
+
Je as YAMLErrorBoundary,
|
|
1674
|
+
Jt as YAMLLayout,
|
|
1675
|
+
Wt as YamlAsserts,
|
|
1676
|
+
Mt as dynamicOp,
|
|
1677
|
+
Bt as registerHardwareComponent,
|
|
1678
|
+
Xt as registerMonitorComponent,
|
|
1679
|
+
tn as registerRuntimeHook,
|
|
1680
|
+
Zt as registerYamlComponent,
|
|
1681
|
+
qe as registerYamlType,
|
|
1564
1682
|
O as renderYamlNode,
|
|
1565
|
-
|
|
1683
|
+
St as yamlMap
|
|
1566
1684
|
};
|
|
1567
1685
|
//# sourceMappingURL=index.esm.js.map
|