@record-evolution/widget-scada 1.0.2 → 1.0.3
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/widget-scada.js +116 -111
- package/dist/widget-scada.js.map +1 -1
- package/package.json +1 -1
- package/src/widget-scada.ts +10 -1
package/dist/widget-scada.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const
|
|
1
|
+
const L = globalThis, Y = L.ShadowRoot && (L.ShadyCSS === void 0 || L.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, X = /* @__PURE__ */ Symbol(), et = /* @__PURE__ */ new WeakMap();
|
|
2
2
|
let pt = class {
|
|
3
3
|
constructor(t, e, s) {
|
|
4
|
-
if (this._$cssResult$ = !0, s !==
|
|
4
|
+
if (this._$cssResult$ = !0, s !== X) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = t, this.t = e;
|
|
6
6
|
}
|
|
7
7
|
get styleSheet() {
|
|
8
8
|
let t = this.o;
|
|
9
9
|
const e = this.t;
|
|
10
|
-
if (
|
|
10
|
+
if (Y && t === void 0) {
|
|
11
11
|
const s = e !== void 0 && e.length === 1;
|
|
12
12
|
s && (t = et.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && et.set(e, t));
|
|
13
13
|
}
|
|
@@ -17,23 +17,23 @@ let pt = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
20
|
+
const At = (n) => new pt(typeof n == "string" ? n : n + "", void 0, X), _t = (n, ...t) => {
|
|
21
21
|
const e = n.length === 1 ? n[0] : t.reduce((s, i, r) => s + ((o) => {
|
|
22
22
|
if (o._$cssResult$ === !0) return o.cssText;
|
|
23
23
|
if (typeof o == "number") return o;
|
|
24
24
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
25
|
})(i) + n[r + 1], n[0]);
|
|
26
|
-
return new pt(e, n,
|
|
26
|
+
return new pt(e, n, X);
|
|
27
27
|
}, St = (n, t) => {
|
|
28
|
-
if (
|
|
28
|
+
if (Y) n.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
29
29
|
else for (const e of t) {
|
|
30
|
-
const s = document.createElement("style"), i =
|
|
30
|
+
const s = document.createElement("style"), i = L.litNonce;
|
|
31
31
|
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, n.appendChild(s);
|
|
32
32
|
}
|
|
33
|
-
}, st =
|
|
33
|
+
}, st = Y ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
|
|
34
34
|
let e = "";
|
|
35
35
|
for (const s of t.cssRules) e += s.cssText;
|
|
36
|
-
return
|
|
36
|
+
return At(e);
|
|
37
37
|
})(n) : n;
|
|
38
38
|
const { is: wt, defineProperty: Et, getOwnPropertyDescriptor: Ct, getOwnPropertyNames: xt, getOwnPropertySymbols: Tt, getPrototypeOf: Pt } = Object, j = globalThis, it = j.trustedTypes, kt = it ? it.emptyScript : "", Ot = j.reactiveElementPolyfillSupport, P = (n, t) => n, H = { toAttribute(n, t) {
|
|
39
39
|
switch (t) {
|
|
@@ -63,7 +63,7 @@ const { is: wt, defineProperty: Et, getOwnPropertyDescriptor: Ct, getOwnProperty
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return e;
|
|
66
|
-
} },
|
|
66
|
+
} }, J = (n, t) => !wt(n, t), rt = { attribute: !0, type: String, converter: H, reflect: !1, useDefault: !1, hasChanged: J };
|
|
67
67
|
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), j.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
68
|
let C = class extends HTMLElement {
|
|
69
69
|
static addInitializer(t) {
|
|
@@ -178,7 +178,7 @@ let C = class extends HTMLElement {
|
|
|
178
178
|
requestUpdate(t, e, s, i = !1, r) {
|
|
179
179
|
if (t !== void 0) {
|
|
180
180
|
const o = this.constructor;
|
|
181
|
-
if (i === !1 && (r = this[t]), s ??= o.getPropertyOptions(t), !((s.hasChanged ??
|
|
181
|
+
if (i === !1 && (r = this[t]), s ??= o.getPropertyOptions(t), !((s.hasChanged ?? J)(r, e) || s.useDefault && s.reflect && r === this._$Ej?.get(t) && !this.hasAttribute(o._$Eu(t, s)))) return;
|
|
182
182
|
this.C(t, e, s);
|
|
183
183
|
}
|
|
184
184
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
@@ -247,14 +247,14 @@ let C = class extends HTMLElement {
|
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
C.elementStyles = [], C.shadowRootOptions = { mode: "open" }, C[P("elementProperties")] = /* @__PURE__ */ new Map(), C[P("finalized")] = /* @__PURE__ */ new Map(), Ot?.({ ReactiveElement: C }), (j.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
-
const
|
|
251
|
-
\f\r]`, T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, at = /-->/g, ht = />/g, A = RegExp(`>|${
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), lt = /'/g, ct = /"/g, yt = /^(?:script|style|textarea|title)$/i,
|
|
250
|
+
const Z = globalThis, nt = (n) => n, D = Z.trustedTypes, ot = D ? D.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, mt = "$lit$", b = `lit$${Math.random().toFixed(9).slice(2)}$`, gt = "?" + b, Nt = `<${gt}>`, w = document, O = () => w.createComment(""), N = (n) => n === null || typeof n != "object" && typeof n != "function", K = Array.isArray, Mt = (n) => K(n) || typeof n?.[Symbol.iterator] == "function", z = `[
|
|
251
|
+
\f\r]`, T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, at = /-->/g, ht = />/g, A = RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), lt = /'/g, ct = /"/g, yt = /^(?:script|style|textarea|title)$/i, Ut = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }), W = Ut(1), E = /* @__PURE__ */ Symbol.for("lit-noChange"), d = /* @__PURE__ */ Symbol.for("lit-nothing"), ut = /* @__PURE__ */ new WeakMap(), S = w.createTreeWalker(w, 129);
|
|
253
253
|
function $t(n, t) {
|
|
254
|
-
if (!
|
|
254
|
+
if (!K(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
255
|
return ot !== void 0 ? ot.createHTML(t) : t;
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const Lt = (n, t) => {
|
|
258
258
|
const e = n.length - 1, s = [];
|
|
259
259
|
let i, r = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = T;
|
|
260
260
|
for (let h = 0; h < e; h++) {
|
|
@@ -271,22 +271,22 @@ class M {
|
|
|
271
271
|
let i;
|
|
272
272
|
this.parts = [];
|
|
273
273
|
let r = 0, o = 0;
|
|
274
|
-
const h = t.length - 1, a = this.parts, [u, c] =
|
|
275
|
-
if (this.el = M.createElement(u, s),
|
|
274
|
+
const h = t.length - 1, a = this.parts, [u, c] = Lt(t, e);
|
|
275
|
+
if (this.el = M.createElement(u, s), S.currentNode = this.el.content, e === 2 || e === 3) {
|
|
276
276
|
const l = this.el.content.firstChild;
|
|
277
277
|
l.replaceWith(...l.childNodes);
|
|
278
278
|
}
|
|
279
|
-
for (; (i =
|
|
279
|
+
for (; (i = S.nextNode()) !== null && a.length < h; ) {
|
|
280
280
|
if (i.nodeType === 1) {
|
|
281
281
|
if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(mt)) {
|
|
282
|
-
const p = c[o++], m = i.getAttribute(l).split(b),
|
|
283
|
-
a.push({ type: 1, index: r, name:
|
|
282
|
+
const p = c[o++], m = i.getAttribute(l).split(b), $ = /([.?@])?(.*)/.exec(p);
|
|
283
|
+
a.push({ type: 1, index: r, name: $[2], strings: m, ctor: $[1] === "." ? Ht : $[1] === "?" ? Dt : $[1] === "@" ? It : F }), i.removeAttribute(l);
|
|
284
284
|
} else l.startsWith(b) && (a.push({ type: 6, index: r }), i.removeAttribute(l));
|
|
285
285
|
if (yt.test(i.tagName)) {
|
|
286
286
|
const l = i.textContent.split(b), p = l.length - 1;
|
|
287
287
|
if (p > 0) {
|
|
288
|
-
i.textContent =
|
|
289
|
-
for (let m = 0; m < p; m++) i.append(l[m], O()),
|
|
288
|
+
i.textContent = D ? D.emptyScript : "";
|
|
289
|
+
for (let m = 0; m < p; m++) i.append(l[m], O()), S.nextNode(), a.push({ type: 2, index: ++r });
|
|
290
290
|
i.append(l[p], O());
|
|
291
291
|
}
|
|
292
292
|
}
|
|
@@ -299,17 +299,17 @@ class M {
|
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
static createElement(t, e) {
|
|
302
|
-
const s =
|
|
302
|
+
const s = w.createElement("template");
|
|
303
303
|
return s.innerHTML = t, s;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
function x(n, t, e = n, s) {
|
|
307
|
-
if (t ===
|
|
307
|
+
if (t === E) return t;
|
|
308
308
|
let i = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
309
309
|
const r = N(t) ? void 0 : t._$litDirective$;
|
|
310
310
|
return i?.constructor !== r && (i?._$AO?.(!1), r === void 0 ? i = void 0 : (i = new r(n), i._$AT(n, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = i : e._$Cl = i), i !== void 0 && (t = x(n, i._$AS(n, t.values), i, s)), t;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class Rt {
|
|
313
313
|
constructor(t, e) {
|
|
314
314
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
315
315
|
}
|
|
@@ -320,24 +320,24 @@ class Ut {
|
|
|
320
320
|
return this._$AM._$AU;
|
|
321
321
|
}
|
|
322
322
|
u(t) {
|
|
323
|
-
const { el: { content: e }, parts: s } = this._$AD, i = (t?.creationScope ??
|
|
324
|
-
|
|
325
|
-
let r =
|
|
323
|
+
const { el: { content: e }, parts: s } = this._$AD, i = (t?.creationScope ?? w).importNode(e, !0);
|
|
324
|
+
S.currentNode = i;
|
|
325
|
+
let r = S.nextNode(), o = 0, h = 0, a = s[0];
|
|
326
326
|
for (; a !== void 0; ) {
|
|
327
327
|
if (o === a.index) {
|
|
328
328
|
let u;
|
|
329
|
-
a.type === 2 ? u = new
|
|
329
|
+
a.type === 2 ? u = new U(r, r.nextSibling, this, t) : a.type === 1 ? u = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (u = new jt(r, this, t)), this._$AV.push(u), a = s[++h];
|
|
330
330
|
}
|
|
331
|
-
o !== a?.index && (r =
|
|
331
|
+
o !== a?.index && (r = S.nextNode(), o++);
|
|
332
332
|
}
|
|
333
|
-
return
|
|
333
|
+
return S.currentNode = w, i;
|
|
334
334
|
}
|
|
335
335
|
p(t) {
|
|
336
336
|
let e = 0;
|
|
337
337
|
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
class
|
|
340
|
+
class U {
|
|
341
341
|
get _$AU() {
|
|
342
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
343
343
|
}
|
|
@@ -356,7 +356,7 @@ class L {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(t, e = this) {
|
|
359
|
-
t = x(this, t, e), N(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !==
|
|
359
|
+
t = x(this, t, e), N(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== E && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Mt(t) ? this.k(t) : this._(t);
|
|
360
360
|
}
|
|
361
361
|
O(t) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -365,13 +365,13 @@ class L {
|
|
|
365
365
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
366
366
|
}
|
|
367
367
|
_(t) {
|
|
368
|
-
this._$AH !== d && N(this._$AH) ? this._$AA.nextSibling.data = t : this.T(
|
|
368
|
+
this._$AH !== d && N(this._$AH) ? this._$AA.nextSibling.data = t : this.T(w.createTextNode(t)), this._$AH = t;
|
|
369
369
|
}
|
|
370
370
|
$(t) {
|
|
371
371
|
const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = M.createElement($t(s.h, s.h[0]), this.options)), s);
|
|
372
372
|
if (this._$AH?._$AD === i) this._$AH.p(e);
|
|
373
373
|
else {
|
|
374
|
-
const r = new
|
|
374
|
+
const r = new Rt(i, this), o = r.u(this.options);
|
|
375
375
|
r.p(e), this.T(o), this._$AH = r;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
@@ -380,10 +380,10 @@ class L {
|
|
|
380
380
|
return e === void 0 && ut.set(t.strings, e = new M(t)), e;
|
|
381
381
|
}
|
|
382
382
|
k(t) {
|
|
383
|
-
|
|
383
|
+
K(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
384
|
const e = this._$AH;
|
|
385
385
|
let s, i = 0;
|
|
386
|
-
for (const r of t) i === e.length ? e.push(s = new
|
|
386
|
+
for (const r of t) i === e.length ? e.push(s = new U(this.O(O()), this.O(O()), this, this.options)) : s = e[i], s._$AI(r), i++;
|
|
387
387
|
i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
|
|
388
388
|
}
|
|
389
389
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
@@ -409,11 +409,11 @@ class F {
|
|
|
409
409
|
_$AI(t, e = this, s, i) {
|
|
410
410
|
const r = this.strings;
|
|
411
411
|
let o = !1;
|
|
412
|
-
if (r === void 0) t = x(this, t, e, 0), o = !N(t) || t !== this._$AH && t !==
|
|
412
|
+
if (r === void 0) t = x(this, t, e, 0), o = !N(t) || t !== this._$AH && t !== E, o && (this._$AH = t);
|
|
413
413
|
else {
|
|
414
414
|
const h = t;
|
|
415
415
|
let a, u;
|
|
416
|
-
for (t = r[0], a = 0; a < r.length - 1; a++) u = x(this, h[s + a], e, a), u ===
|
|
416
|
+
for (t = r[0], a = 0; a < r.length - 1; a++) u = x(this, h[s + a], e, a), u === E && (u = this._$AH[a]), o ||= !N(u) || u !== this._$AH[a], u === d ? t = d : t !== d && (t += (u ?? "") + r[a + 1]), this._$AH[a] = u;
|
|
417
417
|
}
|
|
418
418
|
o && !i && this.j(t);
|
|
419
419
|
}
|
|
@@ -429,7 +429,7 @@ class Ht extends F {
|
|
|
429
429
|
this.element[this.name] = t === d ? void 0 : t;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class Dt extends F {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 4;
|
|
435
435
|
}
|
|
@@ -437,12 +437,12 @@ class It extends F {
|
|
|
437
437
|
this.element.toggleAttribute(this.name, !!t && t !== d);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
440
|
+
class It extends F {
|
|
441
441
|
constructor(t, e, s, i, r) {
|
|
442
442
|
super(t, e, s, i, r), this.type = 5;
|
|
443
443
|
}
|
|
444
444
|
_$AI(t, e = this) {
|
|
445
|
-
if ((t = x(this, t, e, 0) ?? d) ===
|
|
445
|
+
if ((t = x(this, t, e, 0) ?? d) === E) return;
|
|
446
446
|
const s = this._$AH, i = t === d && s !== d || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, r = t !== d && (s === d || i);
|
|
447
447
|
i && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
448
448
|
}
|
|
@@ -461,18 +461,18 @@ class jt {
|
|
|
461
461
|
x(this, t);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const Ft =
|
|
465
|
-
Ft?.(M,
|
|
464
|
+
const Ft = Z.litHtmlPolyfillSupport;
|
|
465
|
+
Ft?.(M, U), (Z.litHtmlVersions ??= []).push("3.3.2");
|
|
466
466
|
const Bt = (n, t, e) => {
|
|
467
467
|
const s = e?.renderBefore ?? t;
|
|
468
468
|
let i = s._$litPart$;
|
|
469
469
|
if (i === void 0) {
|
|
470
470
|
const r = e?.renderBefore ?? null;
|
|
471
|
-
s._$litPart$ = i = new
|
|
471
|
+
s._$litPart$ = i = new U(t.insertBefore(O(), r), r, void 0, e ?? {});
|
|
472
472
|
}
|
|
473
473
|
return i._$AI(n), i;
|
|
474
474
|
};
|
|
475
|
-
const
|
|
475
|
+
const Q = globalThis;
|
|
476
476
|
let k = class extends C {
|
|
477
477
|
constructor() {
|
|
478
478
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
@@ -492,19 +492,19 @@ let k = class extends C {
|
|
|
492
492
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
493
493
|
}
|
|
494
494
|
render() {
|
|
495
|
-
return
|
|
495
|
+
return E;
|
|
496
496
|
}
|
|
497
497
|
};
|
|
498
|
-
k._$litElement$ = !0, k.finalized = !0,
|
|
499
|
-
const zt =
|
|
498
|
+
k._$litElement$ = !0, k.finalized = !0, Q.litElementHydrateSupport?.({ LitElement: k });
|
|
499
|
+
const zt = Q.litElementPolyfillSupport;
|
|
500
500
|
zt?.({ LitElement: k });
|
|
501
|
-
(
|
|
501
|
+
(Q.litElementVersions ??= []).push("4.2.2");
|
|
502
502
|
const Wt = (n) => (t, e) => {
|
|
503
503
|
e !== void 0 ? e.addInitializer(() => {
|
|
504
504
|
customElements.define(n, t);
|
|
505
505
|
}) : customElements.define(n, t);
|
|
506
506
|
};
|
|
507
|
-
const qt = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged:
|
|
507
|
+
const qt = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: J }, Vt = (n = qt, t, e) => {
|
|
508
508
|
const { kind: s, metadata: i } = e;
|
|
509
509
|
let r = globalThis.litPropertyMetadata.get(i);
|
|
510
510
|
if (r === void 0 && globalThis.litPropertyMetadata.set(i, r = /* @__PURE__ */ new Map()), s === "setter" && ((n = Object.create(n)).wrapped = !0), r.set(e.name, n), s === "accessor") {
|
|
@@ -525,14 +525,14 @@ const qt = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged:
|
|
|
525
525
|
}
|
|
526
526
|
throw Error("Unsupported decorator location: " + s);
|
|
527
527
|
};
|
|
528
|
-
function
|
|
528
|
+
function B(n) {
|
|
529
529
|
return (t, e) => typeof e == "object" ? Vt(n, t, e) : ((s, i, r) => {
|
|
530
530
|
const o = i.hasOwnProperty(r);
|
|
531
531
|
return i.constructor.createProperty(r, s), o ? Object.getOwnPropertyDescriptor(i, r) : void 0;
|
|
532
532
|
})(n, t, e);
|
|
533
533
|
}
|
|
534
534
|
function tt(n) {
|
|
535
|
-
return
|
|
535
|
+
return B({ ...n, state: !0, attribute: !1 });
|
|
536
536
|
}
|
|
537
537
|
const Gt = (n, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(n, t, e), e);
|
|
538
538
|
function Yt(n, t) {
|
|
@@ -560,13 +560,13 @@ class Zt {
|
|
|
560
560
|
return this.render(...e);
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
|
-
class
|
|
563
|
+
class V extends Zt {
|
|
564
564
|
constructor(t) {
|
|
565
565
|
if (super(t), this.it = d, t.type !== Xt.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
566
566
|
}
|
|
567
567
|
render(t) {
|
|
568
568
|
if (t === d || t == null) return this._t = void 0, this.it = t;
|
|
569
|
-
if (t ===
|
|
569
|
+
if (t === E) return t;
|
|
570
570
|
if (typeof t != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
571
571
|
if (t === this.it) return this._t;
|
|
572
572
|
this.it = t;
|
|
@@ -574,16 +574,16 @@ class q extends Zt {
|
|
|
574
574
|
return e.raw = e, this._t = { _$litType$: this.constructor.resultType, strings: e, values: [] };
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
|
-
|
|
578
|
-
class
|
|
577
|
+
V.directiveName = "unsafeHTML", V.resultType = 1;
|
|
578
|
+
class G extends V {
|
|
579
579
|
}
|
|
580
|
-
|
|
581
|
-
const Kt = Jt(
|
|
580
|
+
G.directiveName = "unsafeSVG", G.resultType = 2;
|
|
581
|
+
const Kt = Jt(G), ft = /* @__PURE__ */ new WeakMap();
|
|
582
582
|
function bt(n) {
|
|
583
583
|
let t = ft.get(n);
|
|
584
584
|
return t || (t = /* @__PURE__ */ new Map(), ft.set(n, t)), t;
|
|
585
585
|
}
|
|
586
|
-
const
|
|
586
|
+
const _ = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap();
|
|
587
587
|
class Qt {
|
|
588
588
|
constructor(t, e, s) {
|
|
589
589
|
this.pathEl = null, this.lineWidth = 2, this.lineColor = "#fff", this.dashCap = "round", this.dashWidth = 10, this.dashGap = 10, this.dur = 1, this.dir = "forward", this.rafId = 0, this.rafActive = !1, this.rafLastTime = 0, this.offset = 0, this.tick = (i) => {
|
|
@@ -608,7 +608,7 @@ class Qt {
|
|
|
608
608
|
return this.ensurePath(), this.rafActive || (this.rafActive = !0, this.rafLastTime = 0, this.rafId = requestAnimationFrame(this.tick)), this;
|
|
609
609
|
}
|
|
610
610
|
finish() {
|
|
611
|
-
this.cancelRaf(), this.pathEl && this.pathEl.parentNode && this.pathEl.parentNode.removeChild(this.pathEl), this.pathEl = null,
|
|
611
|
+
this.cancelRaf(), this.pathEl && this.pathEl.parentNode && this.pathEl.parentNode.removeChild(this.pathEl), this.pathEl = null, R.delete(this.container);
|
|
612
612
|
}
|
|
613
613
|
ensurePath() {
|
|
614
614
|
if (this.pathEl) return;
|
|
@@ -832,7 +832,7 @@ class f {
|
|
|
832
832
|
return this.el;
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
|
-
class
|
|
835
|
+
class I {
|
|
836
836
|
constructor(t) {
|
|
837
837
|
typeof t == "string" ? (this.settings = { type: "constant", color: t }, this.color = t) : (this.settings = t, this.color = t.color ?? "#000000");
|
|
838
838
|
}
|
|
@@ -864,8 +864,8 @@ class D {
|
|
|
864
864
|
}
|
|
865
865
|
function se(n, t, e) {
|
|
866
866
|
const s = (m) => {
|
|
867
|
-
const
|
|
868
|
-
if (
|
|
867
|
+
const $ = m.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
|
|
868
|
+
if ($) return [+$[1], +$[2], +$[3]];
|
|
869
869
|
const g = m.replace("#", "");
|
|
870
870
|
return g.length === 3 ? [
|
|
871
871
|
parseInt(g[0] + g[0], 16),
|
|
@@ -951,7 +951,7 @@ const re = {
|
|
|
951
951
|
ohms: "Ω",
|
|
952
952
|
kilohms: "kΩ"
|
|
953
953
|
};
|
|
954
|
-
function
|
|
954
|
+
function vt(n) {
|
|
955
955
|
return re[n] ?? n ?? "";
|
|
956
956
|
}
|
|
957
957
|
function ne(n, t, e, s) {
|
|
@@ -961,7 +961,7 @@ function ne(n, t, e, s) {
|
|
|
961
961
|
let r = 0, o = "", h = !1;
|
|
962
962
|
typeof t == "object" && t !== null ? (r = t.decimals ?? 0, o = t.units ?? "", h = t.ignoreUnitSymbol ?? !1) : (r = t ?? 0, o = e ?? "", h = s === !0);
|
|
963
963
|
let a = i.toFixed(r);
|
|
964
|
-
return !h && o && (a += " " +
|
|
964
|
+
return !h && o && (a += " " + vt(o)), a;
|
|
965
965
|
}
|
|
966
966
|
function oe(n, t) {
|
|
967
967
|
return n;
|
|
@@ -969,22 +969,22 @@ function oe(n, t) {
|
|
|
969
969
|
function ae(n) {
|
|
970
970
|
return {
|
|
971
971
|
cssAnimate(t, e) {
|
|
972
|
-
const s = t instanceof f ? t.native : t, i =
|
|
972
|
+
const s = t instanceof f ? t.native : t, i = _.get(s);
|
|
973
973
|
i && i.cancel();
|
|
974
974
|
const r = new ee(s, e);
|
|
975
|
-
return
|
|
975
|
+
return _.set(s, r), r;
|
|
976
976
|
},
|
|
977
977
|
cssAnimation(t) {
|
|
978
978
|
const e = t instanceof f ? t.native : t;
|
|
979
|
-
return
|
|
979
|
+
return _.get(e) ?? null;
|
|
980
980
|
},
|
|
981
981
|
resetCssAnimation(t) {
|
|
982
|
-
const e = t instanceof f ? t.native : t, s =
|
|
983
|
-
s && (s.cancel(),
|
|
982
|
+
const e = t instanceof f ? t.native : t, s = _.get(e);
|
|
983
|
+
s && (s.cancel(), _.delete(e));
|
|
984
984
|
},
|
|
985
985
|
finishCssAnimation(t) {
|
|
986
|
-
const e = t instanceof f ? t.native : t, s =
|
|
987
|
-
s && (s.finish(),
|
|
986
|
+
const e = t instanceof f ? t.native : t, s = _.get(e);
|
|
987
|
+
s && (s.finish(), _.delete(e));
|
|
988
988
|
},
|
|
989
989
|
font(t, e, s) {
|
|
990
990
|
if (Array.isArray(t)) {
|
|
@@ -997,7 +997,7 @@ function ae(n) {
|
|
|
997
997
|
i.style.fontSize = e.size + (e.sizeUnit || "px"), i.style.fontFamily = o ? r : r + ", sans-serif", i.style.fontWeight = e.weight || "400", i.style.fontStyle = e.style || "normal";
|
|
998
998
|
}
|
|
999
999
|
if (s) {
|
|
1000
|
-
const r = s instanceof
|
|
1000
|
+
const r = s instanceof I ? s.color : String(s);
|
|
1001
1001
|
i.setAttribute("fill", r);
|
|
1002
1002
|
}
|
|
1003
1003
|
},
|
|
@@ -1006,7 +1006,7 @@ function ae(n) {
|
|
|
1006
1006
|
i ? i.textContent = e : s.textContent = e;
|
|
1007
1007
|
},
|
|
1008
1008
|
formatValue: ne,
|
|
1009
|
-
unitSymbol:
|
|
1009
|
+
unitSymbol: vt,
|
|
1010
1010
|
convertUnitValue: oe,
|
|
1011
1011
|
callAction(t, e, s, i) {
|
|
1012
1012
|
if (i?.next)
|
|
@@ -1036,7 +1036,7 @@ function ae(n) {
|
|
|
1036
1036
|
icon(t, e, s, i, r) {
|
|
1037
1037
|
const o = t instanceof f ? t.native : t;
|
|
1038
1038
|
te();
|
|
1039
|
-
const h = s ?? 14, a = i instanceof
|
|
1039
|
+
const h = s ?? 14, a = i instanceof I ? i.color : typeof i == "string" ? i : "#000000";
|
|
1040
1040
|
let u = o.querySelector("text.__scada-icon");
|
|
1041
1041
|
u || (o.textContent = "", u = document.createElementNS("http://www.w3.org/2000/svg", "text"), u.classList.add("__scada-icon"), u.setAttribute("dominant-baseline", "central"), u.setAttribute("text-anchor", "middle"), o.appendChild(u)), u.setAttribute("font-family", "Material Symbols Outlined"), u.setAttribute("font-size", String(h)), u.setAttribute("fill", a), u.textContent = e;
|
|
1042
1042
|
},
|
|
@@ -1044,25 +1044,25 @@ function ae(n) {
|
|
|
1044
1044
|
t instanceof f ? t.transform(e) : new f(t).transform(e);
|
|
1045
1045
|
},
|
|
1046
1046
|
connectorAnimate(t, e, s) {
|
|
1047
|
-
const i = t instanceof f ? t.native : t, r =
|
|
1047
|
+
const i = t instanceof f ? t.native : t, r = R.get(i);
|
|
1048
1048
|
r && r.finish();
|
|
1049
1049
|
const o = new Qt(i, e, s);
|
|
1050
|
-
return
|
|
1050
|
+
return R.set(i, o), o;
|
|
1051
1051
|
},
|
|
1052
1052
|
connectorAnimation(t) {
|
|
1053
1053
|
const e = t instanceof f ? t.native : t;
|
|
1054
|
-
return
|
|
1054
|
+
return R.get(e) ?? null;
|
|
1055
1055
|
}
|
|
1056
1056
|
};
|
|
1057
1057
|
}
|
|
1058
1058
|
function he(n, t, e, s, i) {
|
|
1059
1059
|
const r = {};
|
|
1060
1060
|
for (const [c, l] of Object.entries(s))
|
|
1061
|
-
l && typeof l == "object" && l.type && (l.type === "constant" || l.type === "gradient" || l.type === "range" || l.type === "function") && "color" in l ? r[c] = new
|
|
1061
|
+
l && typeof l == "object" && l.type && (l.type === "constant" || l.type === "gradient" || l.type === "range" || l.type === "function") && "color" in l ? r[c] = new I(l) : r[c] = l;
|
|
1062
1062
|
for (const c of t.properties)
|
|
1063
1063
|
if (r[c.id] === void 0 && c.default !== void 0) {
|
|
1064
1064
|
const l = c.default;
|
|
1065
|
-
c.type === "color_settings" && l && typeof l == "object" ? r[c.id] = new
|
|
1065
|
+
c.type === "color_settings" && l && typeof l == "object" ? r[c.id] = new I(l) : r[c.id] = l;
|
|
1066
1066
|
}
|
|
1067
1067
|
for (const c of t.behavior)
|
|
1068
1068
|
c.type === "value" && e[c.id] === void 0 && (c.valueType === "BOOLEAN" ? e[c.id] = !1 : (c.valueType === "DOUBLE" || c.valueType === "INTEGER") && (e[c.id] = 0));
|
|
@@ -1135,7 +1135,7 @@ function fe(n, t, e) {
|
|
|
1135
1135
|
}
|
|
1136
1136
|
return s;
|
|
1137
1137
|
}
|
|
1138
|
-
function
|
|
1138
|
+
function q(n) {
|
|
1139
1139
|
const t = {}, e = {}, s = {}, i = /* @__PURE__ */ new Set(["color", "color_settings", "font"]);
|
|
1140
1140
|
for (const r of n.properties)
|
|
1141
1141
|
r.default !== void 0 && (i.has(r.type) ? e[r.id] = r.default : t[r.id] = r.default);
|
|
@@ -1143,14 +1143,14 @@ function W(n) {
|
|
|
1143
1143
|
r.type === "value" && (r.valueType === "BOOLEAN" ? s[r.id] = !1 : r.valueType === "DOUBLE" || r.valueType === "INTEGER" ? s[r.id] = 0 : s[r.id] = "");
|
|
1144
1144
|
return Object.keys(e).length > 0 && (t.styling = e), Object.keys(s).length > 0 && (t.bindings = s), t;
|
|
1145
1145
|
}
|
|
1146
|
-
var de = Object.defineProperty, pe = Object.getOwnPropertyDescriptor,
|
|
1146
|
+
var de = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, v = (n, t, e, s) => {
|
|
1147
1147
|
for (var i = s > 1 ? void 0 : s ? pe(t, e) : t, r = n.length - 1, o; r >= 0; r--)
|
|
1148
1148
|
(o = n[r]) && (i = (s ? o(t, e, i) : o(i)) || i);
|
|
1149
1149
|
return s && i && de(t, e, i), i;
|
|
1150
1150
|
};
|
|
1151
|
-
let
|
|
1151
|
+
let y = class extends k {
|
|
1152
1152
|
constructor() {
|
|
1153
|
-
super(), this.svgContent = "", this.version = "1.0.
|
|
1153
|
+
super(), this.svgContent = "", this.version = "1.0.3", this.svgModules = /* @__PURE__ */ new Map(), this.actionCleanups = [], this.resizeObserver = new ResizeObserver(() => this.requestUpdate()), this.resizeObserver.observe(this);
|
|
1154
1154
|
}
|
|
1155
1155
|
disconnectedCallback() {
|
|
1156
1156
|
super.disconnectedCallback(), this.resizeObserver?.disconnect(), this.cleanupActions();
|
|
@@ -1164,12 +1164,12 @@ let $ = class extends k {
|
|
|
1164
1164
|
*/
|
|
1165
1165
|
getDefaults() {
|
|
1166
1166
|
if (this.metadata)
|
|
1167
|
-
return
|
|
1167
|
+
return q(this.metadata);
|
|
1168
1168
|
}
|
|
1169
1169
|
dispatchDefaults() {
|
|
1170
1170
|
this.metadata && this.dispatchEvent(
|
|
1171
1171
|
new CustomEvent("widget-defaults", {
|
|
1172
|
-
detail:
|
|
1172
|
+
detail: q(this.metadata),
|
|
1173
1173
|
bubbles: !0,
|
|
1174
1174
|
composed: !0
|
|
1175
1175
|
})
|
|
@@ -1187,8 +1187,10 @@ let $ = class extends k {
|
|
|
1187
1187
|
this.themeBgColor = n || this.theme?.theme_object?.backgroundColor;
|
|
1188
1188
|
}
|
|
1189
1189
|
getSymbolUrl(n) {
|
|
1190
|
+
if (this.baseUrl)
|
|
1191
|
+
return (this.baseUrl.endsWith("/") ? this.baseUrl.slice(0, -1) : this.baseUrl) + "/scada_symbols/" + n + ".svg";
|
|
1190
1192
|
const e = import.meta.url.split("/");
|
|
1191
|
-
return e.pop(), e.pop(), e.join("/") + "/scada_symbols/" + n + ".svg";
|
|
1193
|
+
return e.pop(), e[e.length - 1] === "src" && e.pop(), e.join("/") + "/scada_symbols/" + n + ".svg";
|
|
1192
1194
|
}
|
|
1193
1195
|
async loadSymbol(n) {
|
|
1194
1196
|
const t = this.svgModules.get(n);
|
|
@@ -1223,7 +1225,7 @@ let $ = class extends k {
|
|
|
1223
1225
|
const t = {}, e = this.inputData?.bindings ?? {};
|
|
1224
1226
|
for (const [c, l] of Object.entries(e))
|
|
1225
1227
|
t[c] = l;
|
|
1226
|
-
const s = this.inputData, i =
|
|
1228
|
+
const s = this.inputData, i = q(this.metadata), { styling: r, bindings: o, ...h } = i, a = { ...h, ...s };
|
|
1227
1229
|
delete a.symbol, delete a.bindings, delete a.actions, delete a.styling, Object.assign(a, r ?? {}, s?.styling ?? {});
|
|
1228
1230
|
const u = {
|
|
1229
1231
|
onAction: (c, l, p, m) => {
|
|
@@ -1249,16 +1251,16 @@ let $ = class extends k {
|
|
|
1249
1251
|
});
|
|
1250
1252
|
}
|
|
1251
1253
|
render() {
|
|
1252
|
-
return
|
|
1254
|
+
return W`
|
|
1253
1255
|
<div class="wrapper" style="background-color: ${this.themeBgColor ?? ""}">
|
|
1254
|
-
${this.svgContent ?
|
|
1256
|
+
${this.svgContent ? W`<div class="svg-container">${Kt(this.svgContent)}</div>` : W`<div class="no-symbol">
|
|
1255
1257
|
${this.inputData?.symbol ? "Loading..." : "Select a SCADA symbol"}
|
|
1256
1258
|
</div>`}
|
|
1257
1259
|
</div>
|
|
1258
1260
|
`;
|
|
1259
1261
|
}
|
|
1260
1262
|
};
|
|
1261
|
-
|
|
1263
|
+
y.styles = _t`
|
|
1262
1264
|
:host {
|
|
1263
1265
|
display: block;
|
|
1264
1266
|
box-sizing: border-box;
|
|
@@ -1304,28 +1306,31 @@ $.styles = _t`
|
|
|
1304
1306
|
font-family: sans-serif;
|
|
1305
1307
|
}
|
|
1306
1308
|
`;
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
],
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
],
|
|
1313
|
-
|
|
1309
|
+
v([
|
|
1310
|
+
B({ type: Object })
|
|
1311
|
+
], y.prototype, "inputData", 2);
|
|
1312
|
+
v([
|
|
1313
|
+
B({ type: Object })
|
|
1314
|
+
], y.prototype, "theme", 2);
|
|
1315
|
+
v([
|
|
1316
|
+
B({ type: String })
|
|
1317
|
+
], y.prototype, "baseUrl", 2);
|
|
1318
|
+
v([
|
|
1314
1319
|
tt()
|
|
1315
|
-
],
|
|
1316
|
-
|
|
1320
|
+
], y.prototype, "svgContent", 2);
|
|
1321
|
+
v([
|
|
1317
1322
|
tt()
|
|
1318
|
-
],
|
|
1319
|
-
|
|
1323
|
+
], y.prototype, "metadata", 2);
|
|
1324
|
+
v([
|
|
1320
1325
|
tt()
|
|
1321
|
-
],
|
|
1322
|
-
|
|
1326
|
+
], y.prototype, "themeBgColor", 2);
|
|
1327
|
+
v([
|
|
1323
1328
|
Yt(".svg-container")
|
|
1324
|
-
],
|
|
1325
|
-
|
|
1326
|
-
Wt("widget-scada-1.0.
|
|
1327
|
-
],
|
|
1329
|
+
], y.prototype, "svgContainer", 2);
|
|
1330
|
+
y = v([
|
|
1331
|
+
Wt("widget-scada-1.0.3")
|
|
1332
|
+
], y);
|
|
1328
1333
|
export {
|
|
1329
|
-
|
|
1334
|
+
y as WidgetScada
|
|
1330
1335
|
};
|
|
1331
1336
|
//# sourceMappingURL=widget-scada.js.map
|