tweak-ui 0.8.0 → 0.8.2
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/.assetsignore +2 -0
- package/dist/lib/builder.d.ts +7 -5
- package/dist/lib/builder.d.ts.map +1 -1
- package/dist/lib/components/controls/angle.d.ts +3 -3
- package/dist/lib/components/controls/angle.d.ts.map +1 -1
- package/dist/lib/components/controls/bitmask.d.ts +3 -3
- package/dist/lib/components/controls/bitmask.d.ts.map +1 -1
- package/dist/lib/components/controls/bool.d.ts +3 -3
- package/dist/lib/components/controls/bool.d.ts.map +1 -1
- package/dist/lib/components/controls/color-picker.d.ts +3 -3
- package/dist/lib/components/controls/color-picker.d.ts.map +1 -1
- package/dist/lib/components/controls/color.d.ts +3 -3
- package/dist/lib/components/controls/color.d.ts.map +1 -1
- package/dist/lib/components/controls/input.d.ts +3 -3
- package/dist/lib/components/controls/input.d.ts.map +1 -1
- package/dist/lib/components/controls/matrix.d.ts +3 -3
- package/dist/lib/components/controls/matrix.d.ts.map +1 -1
- package/dist/lib/components/controls/point.d.ts +12 -7
- package/dist/lib/components/controls/point.d.ts.map +1 -1
- package/dist/lib/components/controls/poll.d.ts +3 -3
- package/dist/lib/components/controls/poll.d.ts.map +1 -1
- package/dist/lib/components/controls/scalar.d.ts +3 -3
- package/dist/lib/components/controls/scalar.d.ts.map +1 -1
- package/dist/lib/components/controls/select.d.ts +2 -2
- package/dist/lib/components/controls/select.d.ts.map +1 -1
- package/dist/lib/components/controls/spherical.d.ts +10 -5
- package/dist/lib/components/controls/spherical.d.ts.map +1 -1
- package/dist/lib/components/controls/string.d.ts +3 -3
- package/dist/lib/components/controls/string.d.ts.map +1 -1
- package/dist/lib/components/controls/vector.d.ts +3 -3
- package/dist/lib/components/controls/vector.d.ts.map +1 -1
- package/dist/lib/components/elements/widget.d.ts +4 -0
- package/dist/lib/components/elements/widget.d.ts.map +1 -1
- package/dist/lib/core/utils.d.ts +1 -0
- package/dist/lib/core/utils.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tweak-ui.module.js +514 -501
- package/dist/tweak-ui.module.js.map +1 -1
- package/dist/tweak-ui.umd.js +3 -3
- package/dist/tweak-ui.umd.js.map +1 -1
- package/dist/wrangler.json +1 -0
- package/package.json +13 -5
package/dist/tweak-ui.module.js
CHANGED
|
@@ -150,7 +150,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
150
150
|
}
|
|
151
151
|
function p(e, t, n, r, i) {
|
|
152
152
|
var a = t.tag;
|
|
153
|
-
if (typeof a == "string") switch (t.state = {}, t.attrs != null &&
|
|
153
|
+
if (typeof a == "string") switch (t.state = {}, t.attrs != null && U(t.attrs, t, n), a) {
|
|
154
154
|
case "#":
|
|
155
155
|
m(e, t, i);
|
|
156
156
|
break;
|
|
@@ -196,9 +196,9 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
196
196
|
var a = t.tag, o = t.attrs, l = t.is;
|
|
197
197
|
r = c(t) || r;
|
|
198
198
|
var u = r ? l ? s(e).createElementNS(r, a, { is: l }) : s(e).createElementNS(r, a) : l ? s(e).createElement(a, { is: l }) : s(e).createElement(a);
|
|
199
|
-
if (t.dom = u, o != null &&
|
|
199
|
+
if (t.dom = u, o != null && re(t, o, r), N(e, u, i), !P(t) && t.children != null) {
|
|
200
200
|
var d = t.children;
|
|
201
|
-
f(u, d, 0, d.length, n, null, r), t.tag === "select" && o != null &&
|
|
201
|
+
f(u, d, 0, d.length, n, null, r), t.tag === "select" && o != null && ae(t, o);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
function y(e, t) {
|
|
@@ -210,7 +210,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
210
210
|
if (e.state = void 0, r = e.tag, r.$$reentrantLock$$ != null) return;
|
|
211
211
|
r.$$reentrantLock$$ = !0, e.state = e.tag.prototype != null && typeof e.tag.prototype.view == "function" ? new e.tag(e) : e.tag(e);
|
|
212
212
|
}
|
|
213
|
-
if (
|
|
213
|
+
if (U(e.state, e, t), e.attrs != null && U(e.attrs, e, t), e.instance = n.normalize(u.call(e.state.view, e)), e.instance === e) throw Error("A view cannot return the vnode it received as argument");
|
|
214
214
|
r.$$reentrantLock$$ = null;
|
|
215
215
|
}
|
|
216
216
|
function b(e, t, n, r, i) {
|
|
@@ -245,7 +245,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
245
245
|
}
|
|
246
246
|
} else {
|
|
247
247
|
var P = t.length < n.length ? t.length : n.length;
|
|
248
|
-
for (c = c < l ? c : l; c < P; c++) h = t[c], g = n[c], !(h === g || h == null && g == null) && (h == null ? p(e, g, r, a, j(t, c + 1, i)) : g == null ?
|
|
248
|
+
for (c = c < l ? c : l; c < P; c++) h = t[c], g = n[c], !(h === g || h == null && g == null) && (h == null ? p(e, g, r, a, j(t, c + 1, i)) : g == null ? I(e, h) : S(e, h, g, r, j(t, c + 1, i), a));
|
|
249
249
|
t.length > P && F(e, t, c, t.length), n.length > P && f(e, n, c, n.length, r, i, a);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
@@ -253,8 +253,8 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
253
253
|
function S(e, t, n, r, i, a) {
|
|
254
254
|
var o = t.tag;
|
|
255
255
|
if (o === n.tag && t.is === n.is) {
|
|
256
|
-
if (n.state = t.state, n.events = t.events,
|
|
257
|
-
if (typeof o == "string") switch (n.attrs != null &&
|
|
256
|
+
if (n.state = t.state, n.events = t.events, le(n, t)) return;
|
|
257
|
+
if (typeof o == "string") switch (n.attrs != null && W(n.attrs, n, r), o) {
|
|
258
258
|
case "#":
|
|
259
259
|
C(t, n);
|
|
260
260
|
break;
|
|
@@ -267,13 +267,13 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
267
267
|
default: E(t, n, r, a);
|
|
268
268
|
}
|
|
269
269
|
else D(e, t, n, r, i, a);
|
|
270
|
-
} else
|
|
270
|
+
} else I(e, t), p(e, n, r, a, i);
|
|
271
271
|
}
|
|
272
272
|
function C(e, t) {
|
|
273
273
|
e.children.toString() !== t.children.toString() && (e.dom.nodeValue = t.children), t.dom = e.dom;
|
|
274
274
|
}
|
|
275
275
|
function w(e, t, n, r, i) {
|
|
276
|
-
t.children === n.children ? (n.dom = t.dom, n.domSize = t.domSize) : (
|
|
276
|
+
t.children === n.children ? (n.dom = t.dom, n.domSize = t.domSize) : (ne(e, t), g(e, n, r, i));
|
|
277
277
|
}
|
|
278
278
|
function T(e, t, n, r, i, a) {
|
|
279
279
|
x(e, t.children, n.children, r, i, a);
|
|
@@ -286,11 +286,11 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
286
286
|
}
|
|
287
287
|
function E(e, t, n, r) {
|
|
288
288
|
var i = t.dom = e.dom;
|
|
289
|
-
r = c(t) || r, (e.attrs != t.attrs || t.attrs != null && !a.get(t.attrs)) &&
|
|
289
|
+
r = c(t) || r, (e.attrs != t.attrs || t.attrs != null && !a.get(t.attrs)) && oe(t, e.attrs, t.attrs, r), P(t) || x(i, e.children, t.children, n, null, r);
|
|
290
290
|
}
|
|
291
291
|
function D(e, t, r, i, a, o) {
|
|
292
292
|
if (r.instance = n.normalize(u.call(r.state.view, r)), r.instance === r) throw Error("A view cannot return the vnode it received as argument");
|
|
293
|
-
|
|
293
|
+
W(r.state, r, i), r.attrs != null && W(r.attrs, r, i), r.instance == null ? (t.instance != null && I(e, t.instance), r.domSize = 0) : (t.instance == null ? p(e, r.instance, i, o, a) : S(e, t.instance, r.instance, i, a, o), r.dom = r.instance.dom, r.domSize = r.instance.domSize);
|
|
294
294
|
}
|
|
295
295
|
function O(e, t, n) {
|
|
296
296
|
for (var r = Object.create(null); t < n; t++) {
|
|
@@ -350,7 +350,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
350
350
|
function F(e, t, n, r) {
|
|
351
351
|
for (var i = n; i < r; i++) {
|
|
352
352
|
var a = t[i];
|
|
353
|
-
a != null &&
|
|
353
|
+
a != null && I(e, a);
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
function ee(e, t, n, a) {
|
|
@@ -364,36 +364,36 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
function te(e, t, n) {
|
|
367
|
-
--n.v === 0 && (
|
|
367
|
+
--n.v === 0 && (L(t), ne(e, t));
|
|
368
368
|
}
|
|
369
|
-
function
|
|
369
|
+
function I(e, t) {
|
|
370
370
|
var n = { v: 1 };
|
|
371
371
|
typeof t.tag != "string" && typeof t.state.onbeforeremove == "function" && ee(e, t, t.state, n), t.attrs && typeof t.attrs.onbeforeremove == "function" && ee(e, t, t.attrs, n), te(e, t, n);
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function ne(e, t) {
|
|
374
374
|
if (t.dom != null) if (t.domSize == null || t.domSize === 1) e.removeChild(t.dom);
|
|
375
375
|
else for (var n of i(t)) e.removeChild(n);
|
|
376
376
|
}
|
|
377
|
-
function
|
|
378
|
-
if (typeof e.tag != "string" && typeof e.state.onremove == "function" && u.call(e.state.onremove, e), e.attrs && typeof e.attrs.onremove == "function" && u.call(e.attrs.onremove, e), typeof e.tag != "string") e.instance != null &&
|
|
377
|
+
function L(e) {
|
|
378
|
+
if (typeof e.tag != "string" && typeof e.state.onremove == "function" && u.call(e.state.onremove, e), e.attrs && typeof e.attrs.onremove == "function" && u.call(e.attrs.onremove, e), typeof e.tag != "string") e.instance != null && L(e.instance);
|
|
379
379
|
else {
|
|
380
380
|
e.events != null && (e.events._ = null);
|
|
381
381
|
var t = e.children;
|
|
382
382
|
if (Array.isArray(t)) for (var n = 0; n < t.length; n++) {
|
|
383
383
|
var r = t[n];
|
|
384
|
-
r != null &&
|
|
384
|
+
r != null && L(r);
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
for (var r in t)
|
|
388
|
+
function re(e, t, n) {
|
|
389
|
+
for (var r in t) R(e, r, null, t[r], n);
|
|
390
390
|
}
|
|
391
|
-
function
|
|
392
|
-
if (!(t === "key" || r == null ||
|
|
393
|
-
if (t[0] === "o" && t[1] === "n") return
|
|
391
|
+
function R(e, t, n, r, i) {
|
|
392
|
+
if (!(t === "key" || r == null || B(t) || n === r && !z(e, t) && typeof r != "object")) {
|
|
393
|
+
if (t[0] === "o" && t[1] === "n") return H(e, t, r);
|
|
394
394
|
if (t.slice(0, 6) === "xlink:") e.dom.setAttributeNS("http://www.w3.org/1999/xlink", t.slice(6), r);
|
|
395
|
-
else if (t === "style")
|
|
396
|
-
else if (
|
|
395
|
+
else if (t === "style") ce(e.dom, n, r);
|
|
396
|
+
else if (se(e, t, i)) {
|
|
397
397
|
if (t === "value") {
|
|
398
398
|
if ((e.tag === "input" || e.tag === "textarea") && e.dom.value === "" + r || e.tag === "select" && n !== null && e.dom.value === "" + r || e.tag === "option" && n !== null && e.dom.value === "" + r) return;
|
|
399
399
|
if (e.tag === "input" && e.attrs.type === "file" && "" + r != "") {
|
|
@@ -405,38 +405,38 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
405
405
|
} else typeof r == "boolean" ? r ? e.dom.setAttribute(t, "") : e.dom.removeAttribute(t) : e.dom.setAttribute(t === "className" ? "class" : t, r);
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
if (!(t === "key" || n == null ||
|
|
410
|
-
else if (t === "style")
|
|
411
|
-
else if (
|
|
408
|
+
function ie(e, t, n, r) {
|
|
409
|
+
if (!(t === "key" || n == null || B(t))) if (t[0] === "o" && t[1] === "n") H(e, t, void 0);
|
|
410
|
+
else if (t === "style") ce(e.dom, n, null);
|
|
411
|
+
else if (se(e, t, r) && t !== "className" && t !== "title" && !(t === "value" && (e.tag === "option" || e.tag === "select" && e.dom.selectedIndex === -1 && e.dom === d(e.dom))) && !(e.tag === "input" && t === "type")) e.dom[t] = null;
|
|
412
412
|
else {
|
|
413
413
|
var i = t.indexOf(":");
|
|
414
414
|
i !== -1 && (t = t.slice(i + 1)), n !== !1 && e.dom.removeAttribute(t === "className" ? "class" : t);
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function ae(e, t) {
|
|
418
418
|
if ("value" in t) if (t.value === null) e.dom.selectedIndex !== -1 && (e.dom.value = null);
|
|
419
419
|
else {
|
|
420
420
|
var n = "" + t.value;
|
|
421
421
|
(e.dom.value !== n || e.dom.selectedIndex === -1) && (e.dom.value = n);
|
|
422
422
|
}
|
|
423
|
-
"selectedIndex" in t &&
|
|
423
|
+
"selectedIndex" in t && R(e, "selectedIndex", null, t.selectedIndex, void 0);
|
|
424
424
|
}
|
|
425
|
-
function
|
|
425
|
+
function oe(e, t, n, r) {
|
|
426
426
|
var i;
|
|
427
|
-
if (t != null) for (var o in t === n && !a.has(n) && console.warn("Don't reuse attrs object, use new object for every redraw, this will throw in next major"), t) (i = t[o]) != null && (n == null || n[o] == null) &&
|
|
428
|
-
if (n != null) for (var o in n)
|
|
427
|
+
if (t != null) for (var o in t === n && !a.has(n) && console.warn("Don't reuse attrs object, use new object for every redraw, this will throw in next major"), t) (i = t[o]) != null && (n == null || n[o] == null) && ie(e, o, i, r);
|
|
428
|
+
if (n != null) for (var o in n) R(e, o, t && t[o], n[o], r);
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function z(e, t) {
|
|
431
431
|
return t === "value" || t === "checked" || t === "selectedIndex" || t === "selected" && (e.dom === d(e.dom) || e.tag === "option" && e.dom.parentNode === d(e.dom));
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function B(e) {
|
|
434
434
|
return e === "oninit" || e === "oncreate" || e === "onupdate" || e === "onremove" || e === "onbeforeremove" || e === "onbeforeupdate";
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function se(e, t, n) {
|
|
437
437
|
return n === void 0 && (e.tag.indexOf("-") > -1 || e.is || t !== "href" && t !== "list" && t !== "form" && t !== "width" && t !== "height") && t in e.dom;
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function ce(e, t, n) {
|
|
440
440
|
if (t !== n) if (n == null) e.style = "";
|
|
441
441
|
else if (typeof n != "object") e.style = n;
|
|
442
442
|
else if (typeof t != "object" || !t) for (var r in e.style = "", n) {
|
|
@@ -451,10 +451,10 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function V() {
|
|
455
455
|
this._ = t;
|
|
456
456
|
}
|
|
457
|
-
|
|
457
|
+
V.prototype = Object.create(null), V.prototype.handleEvent = function(e) {
|
|
458
458
|
var t = this["on" + e.type], n;
|
|
459
459
|
typeof t == "function" ? n = t.call(e.currentTarget, e) : typeof t.handleEvent == "function" && t.handleEvent(e);
|
|
460
460
|
var r = this;
|
|
@@ -462,19 +462,19 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
462
462
|
r._ != null && e.redraw !== !1 && (0, r._)();
|
|
463
463
|
})), n === !1 && (e.preventDefault(), e.stopPropagation());
|
|
464
464
|
};
|
|
465
|
-
function
|
|
465
|
+
function H(e, n, r) {
|
|
466
466
|
if (e.events != null) {
|
|
467
467
|
if (e.events._ = t, e.events[n] === r) return;
|
|
468
468
|
r != null && (typeof r == "function" || typeof r == "object") ? (e.events[n] ?? e.dom.addEventListener(n.slice(2), e.events, !1), e.events[n] = r) : (e.events[n] != null && e.dom.removeEventListener(n.slice(2), e.events, !1), e.events[n] = void 0);
|
|
469
|
-
} else r != null && (typeof r == "function" || typeof r == "object") && (e.events = new
|
|
469
|
+
} else r != null && (typeof r == "function" || typeof r == "object") && (e.events = new V(), e.dom.addEventListener(n.slice(2), e.events, !1), e.events[n] = r);
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function U(e, t, n) {
|
|
472
472
|
typeof e.oninit == "function" && u.call(e.oninit, t), typeof e.oncreate == "function" && n.push(u.bind(e.oncreate, t));
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function W(e, t, n) {
|
|
475
475
|
typeof e.onupdate == "function" && n.push(u.bind(e.onupdate, t));
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function le(e, t) {
|
|
478
478
|
do {
|
|
479
479
|
if (e.attrs != null && typeof e.attrs.onbeforeupdate == "function") {
|
|
480
480
|
var n = u.call(e.attrs.onbeforeupdate, e, t);
|
|
@@ -488,17 +488,17 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
488
488
|
} while (!1);
|
|
489
489
|
return e.dom = t.dom, e.domSize = t.domSize, e.instance = t.instance, e.attrs = t.attrs, e.children = t.children, e.text = t.text, !0;
|
|
490
490
|
}
|
|
491
|
-
var
|
|
491
|
+
var G;
|
|
492
492
|
return function(e, r, i) {
|
|
493
493
|
if (!e) throw TypeError("DOM element being rendered to does not exist.");
|
|
494
|
-
if (
|
|
495
|
-
var a = t, s =
|
|
496
|
-
|
|
494
|
+
if (G != null && e.contains(G)) throw TypeError("Node is currently being rendered to and thus is locked.");
|
|
495
|
+
var a = t, s = G, c = [], l = d(e), u = e.namespaceURI;
|
|
496
|
+
G = e, t = typeof i == "function" ? i : void 0, o = {};
|
|
497
497
|
try {
|
|
498
498
|
e.vnodes ?? (e.textContent = ""), r = n.normalizeChildren(Array.isArray(r) ? r : [r]), x(e, e.vnodes, r, c, null, u === "http://www.w3.org/1999/xhtml" ? void 0 : u), e.vnodes = r, l != null && d(e) !== l && typeof l.focus == "function" && l.focus();
|
|
499
499
|
for (var f = 0; f < c.length; f++) c[f]();
|
|
500
500
|
} finally {
|
|
501
|
-
t = a,
|
|
501
|
+
t = a, G = s;
|
|
502
502
|
}
|
|
503
503
|
};
|
|
504
504
|
};
|
|
@@ -801,28 +801,28 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
801
801
|
o.m = n, o.trust = n.trust, o.fragment = n.fragment, o.Fragment = "[", o.mount = r.mount, o.route = a, o.render = x(), o.redraw = r.redraw, o.request = i.request, o.parseQueryString = k(), o.buildQueryString = w(), o.parsePathname = A(), o.buildPathname = T(), o.vnode = l(), o.censor = M(), o.domFor = y(), t.exports = o;
|
|
802
802
|
})))(), 1);
|
|
803
803
|
function ee(e, t) {
|
|
804
|
-
return (0, F.default)(
|
|
804
|
+
return (0, F.default)(L, e, t);
|
|
805
805
|
}
|
|
806
806
|
function te(e, t) {
|
|
807
|
-
return (0, F.default)(
|
|
807
|
+
return (0, F.default)(re, e, t);
|
|
808
808
|
}
|
|
809
|
-
function
|
|
810
|
-
return (0, F.default)(
|
|
809
|
+
function I(e, t) {
|
|
810
|
+
return (0, F.default)(R, e, t);
|
|
811
811
|
}
|
|
812
|
-
function
|
|
813
|
-
return (0, F.default)(
|
|
812
|
+
function ne(e, t) {
|
|
813
|
+
return (0, F.default)(ie, e, t);
|
|
814
814
|
}
|
|
815
|
-
var
|
|
816
|
-
e ? (0, F.default)(
|
|
815
|
+
var L = () => ({ view: ({ attrs: { start: e, end: t, ...n }, children: r }) => (0, F.default)("div.twk-bar", n, [
|
|
816
|
+
e ? (0, F.default)(re, e) : null,
|
|
817
817
|
r,
|
|
818
|
-
t ? (0, F.default)(
|
|
819
|
-
]) }),
|
|
818
|
+
t ? (0, F.default)(R, t) : null
|
|
819
|
+
]) }), re = () => ({ view: ({ attrs: e, children: t }) => (0, F.default)("div.twk-bar-start", e, t) }), R = () => ({ view: ({ attrs: e, children: t }) => (0, F.default)("div.twk-bar-end", e, t) }), ie = () => ({ view: ({ attrs: e, children: t }) => (0, F.default)("div.twk-bar-content", e, t) });
|
|
820
820
|
//#endregion
|
|
821
821
|
//#region src/lib/components/container/grid.ts
|
|
822
|
-
function
|
|
823
|
-
return (0, F.default)(
|
|
822
|
+
function ae(e, t) {
|
|
823
|
+
return (0, F.default)(oe, e, t);
|
|
824
824
|
}
|
|
825
|
-
var
|
|
825
|
+
var oe = () => ({ view: (e) => {
|
|
826
826
|
let t = e.attrs;
|
|
827
827
|
return (0, F.default)("div.twk-grid", { style: {
|
|
828
828
|
gridTemplateColumns: typeof t.columns == "number" ? `repeat(${t.columns}, 1fr)` : t.columns || "none",
|
|
@@ -832,33 +832,33 @@ var se = () => ({ view: (e) => {
|
|
|
832
832
|
} });
|
|
833
833
|
//#endregion
|
|
834
834
|
//#region src/lib/core/utils.ts
|
|
835
|
-
function
|
|
835
|
+
function z(e) {
|
|
836
836
|
return typeof e == "string";
|
|
837
837
|
}
|
|
838
|
-
function
|
|
838
|
+
function B(e) {
|
|
839
839
|
return typeof e == "number";
|
|
840
840
|
}
|
|
841
|
-
function
|
|
841
|
+
function se(e) {
|
|
842
842
|
return typeof e == "function";
|
|
843
843
|
}
|
|
844
|
-
function
|
|
844
|
+
function ce(e) {
|
|
845
845
|
return Array.isArray(e);
|
|
846
846
|
}
|
|
847
|
-
function
|
|
848
|
-
return typeof e == "object" && !!e && !
|
|
847
|
+
function V(e) {
|
|
848
|
+
return typeof e == "object" && !!e && !ce(e);
|
|
849
849
|
}
|
|
850
|
-
function
|
|
851
|
-
return
|
|
850
|
+
function H(e, ...t) {
|
|
851
|
+
return se(e) ? e(...t) : null;
|
|
852
852
|
}
|
|
853
|
-
function
|
|
853
|
+
function U(e, t, n) {
|
|
854
854
|
if (e != null) {
|
|
855
855
|
if (t != null && e < t) return t;
|
|
856
856
|
if (n != null && e > n) return n;
|
|
857
857
|
}
|
|
858
858
|
return e;
|
|
859
859
|
}
|
|
860
|
-
function
|
|
861
|
-
if (arguments.length === 1 &&
|
|
860
|
+
function W() {
|
|
861
|
+
if (arguments.length === 1 && z(arguments[0])) return arguments[0];
|
|
862
862
|
if (arguments.length === 0) return "";
|
|
863
863
|
let e = [], t = (n) => {
|
|
864
864
|
if (n) {
|
|
@@ -883,17 +883,17 @@ function U() {
|
|
|
883
883
|
for (let e of arguments) t(e);
|
|
884
884
|
return e.join(" ");
|
|
885
885
|
}
|
|
886
|
-
function
|
|
886
|
+
function le(e, t, n) {
|
|
887
887
|
for (; e.length < t;) e = `${n}${e}`;
|
|
888
888
|
return e;
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function G(e) {
|
|
891
891
|
let t = 0, n = 0;
|
|
892
892
|
return "touches" in e ? (t = e.touches.item(0).pageX, n = e.touches.item(0).pageY) : (t = e.pageX, n = e.pageY), [t, n];
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function ue(e, t, n) {
|
|
895
895
|
t ||= e.target;
|
|
896
|
-
let r = t.getBoundingClientRect(), i = window.pageXOffset || document.documentElement.scrollLeft, a = window.pageYOffset || document.documentElement.scrollTop, o = t.clientWidth, s = t.clientHeight, [c, l] =
|
|
896
|
+
let r = t.getBoundingClientRect(), i = window.pageXOffset || document.documentElement.scrollLeft, a = window.pageYOffset || document.documentElement.scrollTop, o = t.clientWidth, s = t.clientHeight, [c, l] = G(e);
|
|
897
897
|
n && (c += n[0], l += n[1]);
|
|
898
898
|
let u = c - i - r.left, d = l - a - r.top;
|
|
899
899
|
return {
|
|
@@ -905,7 +905,7 @@ function de(e, t, n) {
|
|
|
905
905
|
normalizedY: d / s
|
|
906
906
|
};
|
|
907
907
|
}
|
|
908
|
-
function
|
|
908
|
+
function de({ onStart: e, onMove: t, onEnd: n }) {
|
|
909
909
|
let r = {
|
|
910
910
|
target: null,
|
|
911
911
|
activate: (i) => {
|
|
@@ -920,7 +920,7 @@ function fe({ onStart: e, onMove: t, onEnd: n }) {
|
|
|
920
920
|
};
|
|
921
921
|
return r;
|
|
922
922
|
}
|
|
923
|
-
function
|
|
923
|
+
function fe(e, t, n) {
|
|
924
924
|
return new Promise((r) => {
|
|
925
925
|
let i = !1, a = (n) => {
|
|
926
926
|
i = !0, e.removeEventListener(t, a), r(!0);
|
|
@@ -932,10 +932,10 @@ function pe(e, t, n) {
|
|
|
932
932
|
}
|
|
933
933
|
//#endregion
|
|
934
934
|
//#region src/lib/components/container/group.ts
|
|
935
|
-
function
|
|
936
|
-
return (0, F.default)(
|
|
935
|
+
function pe(e, t) {
|
|
936
|
+
return (0, F.default)(me, e, t);
|
|
937
937
|
}
|
|
938
|
-
var
|
|
938
|
+
var me = () => {
|
|
939
939
|
let e, t, n, r, i = !1;
|
|
940
940
|
function a(t) {
|
|
941
941
|
let i = t.attrs;
|
|
@@ -951,28 +951,28 @@ var he = () => {
|
|
|
951
951
|
oninit: a,
|
|
952
952
|
onupdate: a,
|
|
953
953
|
view: ({ attrs: a, children: o }) => (e = a.title || "", t = a.icon || "", n = !!a.collapsible, r ??= !!a.collapsed, (0, F.default)("div.twk-group", {
|
|
954
|
-
class:
|
|
954
|
+
class: W({
|
|
955
955
|
"twk-group-collapsible": !!n,
|
|
956
956
|
"twk-group-collapsed": !!r
|
|
957
957
|
}),
|
|
958
958
|
style: a.style
|
|
959
|
-
}, F.default.fragment({}, [s()]), r ? null : (0, F.default)(
|
|
959
|
+
}, F.default.fragment({}, [s()]), r ? null : (0, F.default)(he, { animate: i }, o)))
|
|
960
960
|
};
|
|
961
|
-
},
|
|
961
|
+
}, he = () => ({
|
|
962
962
|
onbeforeremove: async ({ dom: e }) => {
|
|
963
|
-
e.classList.remove("enter"), e.classList.add("leave"), await
|
|
963
|
+
e.classList.remove("enter"), e.classList.add("leave"), await fe(e, "animationstart", 50) && await fe(e, "animationend", 2e3);
|
|
964
964
|
},
|
|
965
|
-
view: ({ children: e, attrs: t }) => (0, F.default)("div.twk-group-content", { class:
|
|
965
|
+
view: ({ children: e, attrs: t }) => (0, F.default)("div.twk-group-content", { class: W({
|
|
966
966
|
animate: t.animate,
|
|
967
967
|
enter: !0
|
|
968
968
|
}) }, e)
|
|
969
969
|
});
|
|
970
970
|
//#endregion
|
|
971
971
|
//#region src/lib/components/container/list.ts
|
|
972
|
-
function
|
|
973
|
-
return (0, F.default)(
|
|
972
|
+
function ge(e, t) {
|
|
973
|
+
return (0, F.default)(_e, e, t);
|
|
974
974
|
}
|
|
975
|
-
var
|
|
975
|
+
var _e = () => ({ view: ({ attrs: { flex: e, flow: t, style: n, ...r }, children: i }) => (0, F.default)("div.twk-flex", {
|
|
976
976
|
style: {
|
|
977
977
|
flex: e ?? "auto",
|
|
978
978
|
flexFlow: t || "column nowrap",
|
|
@@ -982,6 +982,9 @@ var ve = () => ({ view: ({ attrs: { flex: e, flow: t, style: n, ...r }, children
|
|
|
982
982
|
}, i) });
|
|
983
983
|
//#endregion
|
|
984
984
|
//#region src/lib/components/container/section.ts
|
|
985
|
+
function ve(e, t) {
|
|
986
|
+
return (0, F.default)(Se, e, t);
|
|
987
|
+
}
|
|
985
988
|
function ye(e, t) {
|
|
986
989
|
return (0, F.default)(Ce, e, t);
|
|
987
990
|
}
|
|
@@ -991,34 +994,31 @@ function be(e, t) {
|
|
|
991
994
|
function xe(e, t) {
|
|
992
995
|
return (0, F.default)(Te, e, t);
|
|
993
996
|
}
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
}
|
|
997
|
-
var Ce = () => ({ view: ({ attrs: { header: e, footer: t, ...n }, children: r }) => (0, F.default)("div.twk-section", n, [
|
|
998
|
-
e ? (0, F.default)(we, e) : null,
|
|
997
|
+
var Se = () => ({ view: ({ attrs: { header: e, footer: t, ...n }, children: r }) => (0, F.default)("div.twk-section", n, [
|
|
998
|
+
e ? (0, F.default)(Ce, e) : null,
|
|
999
999
|
r,
|
|
1000
|
-
t ? (0, F.default)(
|
|
1001
|
-
]) }),
|
|
1000
|
+
t ? (0, F.default)(we, t) : null
|
|
1001
|
+
]) }), Ce = () => ({ view: ({ attrs: e, children: t }) => (0, F.default)("header.twk-section-header", e, t) }), we = () => ({ view: ({ attrs: e, children: t }) => (0, F.default)("footer.twk-section-footer", e, t) }), Te = () => ({ view: ({ attrs: e, children: t }) => (0, F.default)("main.twk-section-content", e, t) });
|
|
1002
1002
|
//#endregion
|
|
1003
1003
|
//#region src/lib/core/control.ts
|
|
1004
|
-
function
|
|
1005
|
-
return
|
|
1004
|
+
function K(e) {
|
|
1005
|
+
return Ae(e, Ee(e));
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1008
|
-
let n =
|
|
1009
|
-
return
|
|
1007
|
+
function q(e, t) {
|
|
1008
|
+
let n = ke(e, t);
|
|
1009
|
+
return De(e, n), n;
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1011
|
+
function Ee(e) {
|
|
1012
1012
|
return e.binding ? e.binding.get(e.value, e.field) : e.value == null ? null : e.field == null ? e.value : e.value[e.field];
|
|
1013
1013
|
}
|
|
1014
|
-
function
|
|
1014
|
+
function De(e, t) {
|
|
1015
1015
|
if (e.binding) {
|
|
1016
1016
|
e.binding.set?.(t, e.value, e.field);
|
|
1017
1017
|
return;
|
|
1018
1018
|
}
|
|
1019
1019
|
if (e.value != null) {
|
|
1020
1020
|
if (e.field) {
|
|
1021
|
-
if (!
|
|
1021
|
+
if (!Oe(e.value, e.field)) {
|
|
1022
1022
|
console.warn(`Cannot write value to control model. Property "${String(e.field)}" is not writeable.`);
|
|
1023
1023
|
return;
|
|
1024
1024
|
}
|
|
@@ -1028,37 +1028,37 @@ function Oe(e, t) {
|
|
|
1028
1028
|
e.value = t;
|
|
1029
1029
|
}
|
|
1030
1030
|
}
|
|
1031
|
-
function
|
|
1031
|
+
function Oe(e, t) {
|
|
1032
1032
|
let n = Object.getOwnPropertyDescriptor(e, t);
|
|
1033
1033
|
return !n || !!n.writable || !!n.set;
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1035
|
+
function ke(e, t) {
|
|
1036
1036
|
return e.adapter ? e.adapter.fromControl(t) : t;
|
|
1037
1037
|
}
|
|
1038
|
-
function
|
|
1038
|
+
function Ae(e, t) {
|
|
1039
1039
|
return e.adapter ? e.adapter.toControl(t) : t;
|
|
1040
1040
|
}
|
|
1041
1041
|
//#endregion
|
|
1042
1042
|
//#region src/lib/core/render.ts
|
|
1043
|
-
function
|
|
1043
|
+
function je(e) {
|
|
1044
1044
|
return typeof e == "object" && !!e && "tag" in e;
|
|
1045
1045
|
}
|
|
1046
|
-
function
|
|
1047
|
-
return Array.isArray(e) ? e.map((e, n, r) =>
|
|
1046
|
+
function Me(e, t) {
|
|
1047
|
+
return Array.isArray(e) ? e.map((e, n, r) => je(e) ? t(e, n, r) : e) : je(e) ? t(e, 0, [e]) : e;
|
|
1048
1048
|
}
|
|
1049
|
-
function
|
|
1049
|
+
function Ne(e) {
|
|
1050
1050
|
return e == null ? null : typeof e == "function" ? e() : Array.isArray(e) ? e.map((e) => {
|
|
1051
|
-
if (
|
|
1051
|
+
if (Pe(e)) {
|
|
1052
1052
|
let { component: t, attributes: n, children: r } = e;
|
|
1053
|
-
return (0, F.default)(t, n,
|
|
1053
|
+
return (0, F.default)(t, n, Ne(r || []));
|
|
1054
1054
|
}
|
|
1055
1055
|
return e;
|
|
1056
1056
|
}) : e;
|
|
1057
1057
|
}
|
|
1058
|
-
function
|
|
1058
|
+
function Pe(e) {
|
|
1059
1059
|
return typeof e == "object" && !!e && "component" in e && "attributes" in e;
|
|
1060
1060
|
}
|
|
1061
|
-
function
|
|
1061
|
+
function Fe(e) {
|
|
1062
1062
|
return () => {
|
|
1063
1063
|
let t;
|
|
1064
1064
|
return arguments.length === 1 ? t = arguments[0] || {} : arguments.length > 1 ? (t = arguments[1] || {}, t.label = arguments[0]) : t = {}, (0, F.default)(e, t);
|
|
@@ -1066,7 +1066,7 @@ function Ie(e) {
|
|
|
1066
1066
|
}
|
|
1067
1067
|
//#endregion
|
|
1068
1068
|
//#region src/lib/core/types.ts
|
|
1069
|
-
function
|
|
1069
|
+
function Ie(e, t) {
|
|
1070
1070
|
return {
|
|
1071
1071
|
get: () => e[t],
|
|
1072
1072
|
set: (n) => e[t] = n
|
|
@@ -1074,35 +1074,35 @@ function Le(e, t) {
|
|
|
1074
1074
|
}
|
|
1075
1075
|
//#endregion
|
|
1076
1076
|
//#region src/lib/mount.ts
|
|
1077
|
-
var
|
|
1078
|
-
function
|
|
1077
|
+
var Le = F.default;
|
|
1078
|
+
function Re(e, t) {
|
|
1079
1079
|
let n = typeof e == "string" ? document.querySelector(e) : e;
|
|
1080
1080
|
if (n.classList.add("tweak-ui"), !t) F.default.mount(n, null);
|
|
1081
1081
|
else if (Array.isArray(t)) F.default.mount(n, { view: () => t });
|
|
1082
1082
|
else if (typeof t == "function") {
|
|
1083
|
-
let e =
|
|
1084
|
-
F.default.mount(n, { view: () =>
|
|
1083
|
+
let e = Yn.build(t);
|
|
1084
|
+
F.default.mount(n, { view: () => Ne(e) });
|
|
1085
1085
|
} else F.default.mount(n, t);
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1087
|
+
function ze(e) {
|
|
1088
1088
|
let t = typeof e == "string" ? document.querySelector(e) : e;
|
|
1089
1089
|
F.default.mount(t, null);
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1091
|
+
function Be() {
|
|
1092
1092
|
F.default.redraw();
|
|
1093
1093
|
}
|
|
1094
1094
|
//#endregion
|
|
1095
1095
|
//#region src/lib/components/container/split.ts
|
|
1096
|
-
function
|
|
1097
|
-
return (0, F.default)(Ge, e, t);
|
|
1098
|
-
}
|
|
1099
|
-
function Ue(e, t) {
|
|
1096
|
+
function Ve(e, t) {
|
|
1100
1097
|
return (0, F.default)(We, e, t);
|
|
1101
1098
|
}
|
|
1102
|
-
|
|
1099
|
+
function He(e, t) {
|
|
1100
|
+
return (0, F.default)(Ue, e, t);
|
|
1101
|
+
}
|
|
1102
|
+
var Ue = (e) => ({ view: ({ attrs: e, children: t }) => Le("div", {
|
|
1103
1103
|
...e,
|
|
1104
|
-
class:
|
|
1105
|
-
}, t) }),
|
|
1104
|
+
class: W({ fluid: !!e.fluid }, e.class)
|
|
1105
|
+
}, t) }), We = () => {
|
|
1106
1106
|
let e = !1, t = 0, n, r, i, a, o, s = null, c = null;
|
|
1107
1107
|
function l(e, t, s, c) {
|
|
1108
1108
|
f(), e.stopPropagation(), n = e, r = s.dom?.getBoundingClientRect(), i = c.dom?.getBoundingClientRect(), a = s.dom, o = c.dom, window.addEventListener("mousemove", u), window.addEventListener("mouseup", f);
|
|
@@ -1134,7 +1134,7 @@ var We = (e) => ({ view: ({ attrs: e, children: t }) => Re("div", {
|
|
|
1134
1134
|
},
|
|
1135
1135
|
view: ({ attrs: { style: n, flow: r, minSize: i, ...a }, children: o }) => (e = r === "row", t = i = Math.max(i || 16, 0), queueMicrotask(d), (0, F.default)("div.twk-split-pane", {
|
|
1136
1136
|
...a,
|
|
1137
|
-
class:
|
|
1137
|
+
class: W({
|
|
1138
1138
|
"twk-split-pane-h": e,
|
|
1139
1139
|
"twk-split-pane-v": !e
|
|
1140
1140
|
}),
|
|
@@ -1143,19 +1143,19 @@ var We = (e) => ({ view: ({ attrs: e, children: t }) => Re("div", {
|
|
|
1143
1143
|
display: "flex",
|
|
1144
1144
|
flexDirection: e ? "row" : "column"
|
|
1145
1145
|
}
|
|
1146
|
-
},
|
|
1147
|
-
class:
|
|
1146
|
+
}, Me(o, (t, n, r) => t ? [t, r[n + 1] ? (0, F.default)("div.twk-split-gutter", {
|
|
1147
|
+
class: W({
|
|
1148
1148
|
"twk-split-gutter-h": e,
|
|
1149
1149
|
"twk-split-gutter-v": !e
|
|
1150
1150
|
}),
|
|
1151
1151
|
onmousedown: (e) => l(e, n, t, r[n + 1])
|
|
1152
1152
|
}) : null] : null)))
|
|
1153
1153
|
};
|
|
1154
|
-
},
|
|
1154
|
+
}, Ge = Symbol("tabsHost"), Ke = () => {
|
|
1155
1155
|
let e, t;
|
|
1156
1156
|
return {
|
|
1157
1157
|
oninit: (n) => {
|
|
1158
|
-
if (e = n.attrs[
|
|
1158
|
+
if (e = n.attrs[Ge], t = n, !e) throw Error("TabPane must be used inside a Tabs component");
|
|
1159
1159
|
e.attach(n);
|
|
1160
1160
|
},
|
|
1161
1161
|
onremove: () => {
|
|
@@ -1164,16 +1164,16 @@ var We = (e) => ({ view: ({ attrs: e, children: t }) => Re("div", {
|
|
|
1164
1164
|
view: ({ attrs: n, children: r }) => {
|
|
1165
1165
|
let i = n.title, a = e.isActive(t);
|
|
1166
1166
|
return [(0, F.default)("button.twk-btn.twk-tab", {
|
|
1167
|
-
class:
|
|
1167
|
+
class: W({ active: a }),
|
|
1168
1168
|
onclick: () => e.activate(t)
|
|
1169
1169
|
}, i), a ? (0, F.default)("div.twk-tab-content", {}, r) : null];
|
|
1170
1170
|
}
|
|
1171
1171
|
};
|
|
1172
1172
|
};
|
|
1173
|
-
function
|
|
1174
|
-
return (0, F.default)(
|
|
1173
|
+
function qe(e, t) {
|
|
1174
|
+
return (0, F.default)(Je, e, t);
|
|
1175
1175
|
}
|
|
1176
|
-
var
|
|
1176
|
+
var Je = () => {
|
|
1177
1177
|
let e = [], t = null, n = {
|
|
1178
1178
|
attach(n) {
|
|
1179
1179
|
e.push(n), t ||= n, n.attrs.active && (t = n);
|
|
@@ -1190,41 +1190,41 @@ var Ye = () => {
|
|
|
1190
1190
|
}
|
|
1191
1191
|
};
|
|
1192
1192
|
function r(e) {
|
|
1193
|
-
return
|
|
1193
|
+
return Me(e.children, (e) => {
|
|
1194
1194
|
if (!e) return e;
|
|
1195
|
-
if (e.tag ===
|
|
1195
|
+
if (e.tag === Ke) return (0, F.default)(e.tag, {
|
|
1196
1196
|
...e.attrs,
|
|
1197
|
-
[
|
|
1197
|
+
[Ge]: n
|
|
1198
1198
|
}, e.children);
|
|
1199
1199
|
let t = e.attrs;
|
|
1200
|
-
return (0, F.default)(
|
|
1200
|
+
return (0, F.default)(Ke, {
|
|
1201
1201
|
title: t.title || "",
|
|
1202
|
-
[
|
|
1202
|
+
[Ge]: n
|
|
1203
1203
|
}, (0, F.default)(e.tag, {
|
|
1204
1204
|
...t,
|
|
1205
1205
|
title: void 0
|
|
1206
1206
|
}, e.children));
|
|
1207
1207
|
});
|
|
1208
1208
|
}
|
|
1209
|
-
return { view: (e) => (0, F.default)("div.twk-tabs", { class:
|
|
1209
|
+
return { view: (e) => (0, F.default)("div.twk-tabs", { class: W({ "twk-tabs-vertical": !!e.attrs.vertical }) }, F.default.fragment({}, [r(e)])) };
|
|
1210
1210
|
};
|
|
1211
1211
|
//#endregion
|
|
1212
1212
|
//#region src/lib/components/container/tree.ts
|
|
1213
|
-
function
|
|
1214
|
-
return (0, F.default)(
|
|
1213
|
+
function Ye(e) {
|
|
1214
|
+
return (0, F.default)(Qe, e);
|
|
1215
1215
|
}
|
|
1216
|
-
function
|
|
1216
|
+
function Xe(e, t, n = 0, r = []) {
|
|
1217
1217
|
for (let i of e) {
|
|
1218
1218
|
let e = t.isExpanded(i) ?? !1, a = t.nodeChildren(i);
|
|
1219
1219
|
r.push({
|
|
1220
1220
|
node: i,
|
|
1221
1221
|
depth: n,
|
|
1222
1222
|
expanded: e
|
|
1223
|
-
}), a && e &&
|
|
1223
|
+
}), a && e && Xe(a, t, n + 1, r);
|
|
1224
1224
|
}
|
|
1225
1225
|
return r;
|
|
1226
1226
|
}
|
|
1227
|
-
var
|
|
1227
|
+
var Ze = 22, Qe = () => {
|
|
1228
1228
|
let e = 0, t = null, n = 0, r = [], i = null, a, o, s, c = [], l = null;
|
|
1229
1229
|
return {
|
|
1230
1230
|
onremove() {
|
|
@@ -1240,13 +1240,13 @@ var Qe = 22, $e = () => {
|
|
|
1240
1240
|
e.connect?.({ scrollTo(e) {
|
|
1241
1241
|
let t = r.findIndex((t) => t.node === e);
|
|
1242
1242
|
t >= 0 && (l?.scrollTo({
|
|
1243
|
-
top: t * (o ??
|
|
1243
|
+
top: t * (o ?? Ze),
|
|
1244
1244
|
behavior: "instant"
|
|
1245
1245
|
}), F.default.redraw());
|
|
1246
1246
|
} });
|
|
1247
1247
|
},
|
|
1248
1248
|
view({ attrs: t }) {
|
|
1249
|
-
c = t.data, i = t.adapter, a = t.selectedId, o = t.rowHeight ??
|
|
1249
|
+
c = t.data, i = t.adapter, a = t.selectedId, o = t.rowHeight ?? Ze, s = t.onSelect, r = Xe(c, i);
|
|
1250
1250
|
let u = r.length, d = Math.ceil(n / o), f = Math.floor(e / o), p = Math.min(f + d, u), m = f * o, h = r.slice(f, p);
|
|
1251
1251
|
return (0, F.default)("div.twk-tree", {
|
|
1252
1252
|
style: t.style ?? {},
|
|
@@ -1263,7 +1263,7 @@ var Qe = 22, $e = () => {
|
|
|
1263
1263
|
let r = i.nodeId(e), c = r === a, l = i.nodeIcon(e, i.isExpanded(e)), u = !!i.nodeChildren(e);
|
|
1264
1264
|
return (0, F.default)("div.twk-tree-row", {
|
|
1265
1265
|
key: r,
|
|
1266
|
-
class:
|
|
1266
|
+
class: W({
|
|
1267
1267
|
selected: c,
|
|
1268
1268
|
expandable: u
|
|
1269
1269
|
}),
|
|
@@ -1274,7 +1274,7 @@ var Qe = 22, $e = () => {
|
|
|
1274
1274
|
onclick: () => s?.(e)
|
|
1275
1275
|
}, [
|
|
1276
1276
|
(0, F.default)("span.twk-tree-toggle", {
|
|
1277
|
-
class:
|
|
1277
|
+
class: W({
|
|
1278
1278
|
expanded: n,
|
|
1279
1279
|
expandable: u
|
|
1280
1280
|
}),
|
|
@@ -1291,31 +1291,31 @@ var Qe = 22, $e = () => {
|
|
|
1291
1291
|
};
|
|
1292
1292
|
//#endregion
|
|
1293
1293
|
//#region src/lib/components/container/dialog.ts
|
|
1294
|
-
function
|
|
1295
|
-
return (0, F.default)(
|
|
1294
|
+
function $e(e, t) {
|
|
1295
|
+
return (0, F.default)(et, e, t);
|
|
1296
1296
|
}
|
|
1297
|
-
var
|
|
1297
|
+
var et = () => {
|
|
1298
1298
|
let e = null;
|
|
1299
1299
|
return {
|
|
1300
1300
|
oncreate: ({ dom: t }) => {
|
|
1301
|
-
e = t, e.addEventListener("close",
|
|
1301
|
+
e = t, e.addEventListener("close", Be);
|
|
1302
1302
|
},
|
|
1303
1303
|
onremove: () => {
|
|
1304
|
-
e?.removeEventListener("close",
|
|
1304
|
+
e?.removeEventListener("close", Be), e = null;
|
|
1305
1305
|
},
|
|
1306
1306
|
view: ({ attrs: t, children: n }) => (0, F.default)("dialog.twk-dialog", t, [e?.open ? n : null])
|
|
1307
1307
|
};
|
|
1308
1308
|
};
|
|
1309
1309
|
//#endregion
|
|
1310
1310
|
//#region src/lib/components/elements/button.ts
|
|
1311
|
-
function
|
|
1312
|
-
return (0, F.default)(
|
|
1311
|
+
function tt(e, t) {
|
|
1312
|
+
return (0, F.default)(nt, e, t);
|
|
1313
1313
|
}
|
|
1314
|
-
var
|
|
1314
|
+
var nt = () => ({ view: ({ attrs: e, children: t }) => {
|
|
1315
1315
|
let { square: n, block: r, class: i, style: a, ...o } = e;
|
|
1316
1316
|
return (0, F.default)("button.twk-btn", {
|
|
1317
1317
|
type: "button",
|
|
1318
|
-
class:
|
|
1318
|
+
class: W({
|
|
1319
1319
|
"twk-btn-sq": !!n,
|
|
1320
1320
|
"twk-btn-bl": !!r,
|
|
1321
1321
|
"twk-btn-lg": !!e.large,
|
|
@@ -1330,19 +1330,19 @@ var rt = () => ({ view: ({ attrs: e, children: t }) => {
|
|
|
1330
1330
|
} });
|
|
1331
1331
|
//#endregion
|
|
1332
1332
|
//#region src/lib/components/elements/divider.ts
|
|
1333
|
-
function
|
|
1334
|
-
return (0, F.default)(
|
|
1333
|
+
function rt(e) {
|
|
1334
|
+
return (0, F.default)(it, e);
|
|
1335
1335
|
}
|
|
1336
|
-
var
|
|
1336
|
+
var it = () => ({ view: (e) => (0, F.default)("div.twk-divider", e.attrs, e.children) });
|
|
1337
1337
|
//#endregion
|
|
1338
1338
|
//#region src/lib/stats/sampler.ts
|
|
1339
|
-
function
|
|
1339
|
+
function at(e, t) {
|
|
1340
1340
|
let n = {
|
|
1341
1341
|
color: e.color,
|
|
1342
1342
|
noGraph: e.noGraph,
|
|
1343
1343
|
fractionDigits: e.fractionDigits,
|
|
1344
1344
|
smoothing: e.smoothing ?? 0,
|
|
1345
|
-
transform:
|
|
1345
|
+
transform: ct,
|
|
1346
1346
|
min: e.min ?? 0,
|
|
1347
1347
|
max: e.max ?? 1,
|
|
1348
1348
|
value: null,
|
|
@@ -1363,31 +1363,31 @@ function ot(e, t) {
|
|
|
1363
1363
|
maxTail: 0,
|
|
1364
1364
|
minSeen: Infinity,
|
|
1365
1365
|
maxSeen: -Infinity,
|
|
1366
|
-
sample: () =>
|
|
1366
|
+
sample: () => lt(e.sample(), n)
|
|
1367
1367
|
};
|
|
1368
1368
|
switch (e.transform) {
|
|
1369
1369
|
case "log":
|
|
1370
|
-
n.transform =
|
|
1370
|
+
n.transform = ot;
|
|
1371
1371
|
break;
|
|
1372
1372
|
case "exp":
|
|
1373
|
-
n.transform =
|
|
1373
|
+
n.transform = st;
|
|
1374
1374
|
break;
|
|
1375
1375
|
default:
|
|
1376
|
-
n.transform =
|
|
1376
|
+
n.transform = ct;
|
|
1377
1377
|
break;
|
|
1378
1378
|
}
|
|
1379
1379
|
return n;
|
|
1380
1380
|
}
|
|
1381
|
-
function
|
|
1381
|
+
function ot(e) {
|
|
1382
1382
|
return Math.log10(1 + Math.max(0, e));
|
|
1383
1383
|
}
|
|
1384
|
-
function
|
|
1384
|
+
function st(e) {
|
|
1385
1385
|
return Math.exp(e) - 1;
|
|
1386
1386
|
}
|
|
1387
|
-
function
|
|
1387
|
+
function ct(e) {
|
|
1388
1388
|
return e;
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function lt(e, t) {
|
|
1391
1391
|
if (t.value == null) t.value = e;
|
|
1392
1392
|
else {
|
|
1393
1393
|
let n = t.smoothing;
|
|
@@ -1417,16 +1417,16 @@ function ut(e, t) {
|
|
|
1417
1417
|
}
|
|
1418
1418
|
//#endregion
|
|
1419
1419
|
//#region src/lib/stats/stats-renderer.ts
|
|
1420
|
-
function
|
|
1420
|
+
function ut(e) {
|
|
1421
1421
|
let t = e.getContext("webgl2");
|
|
1422
1422
|
if (!t) throw Error("WebGL2 is not supported in this browser");
|
|
1423
|
-
let n =
|
|
1423
|
+
let n = mt(t), r = t.createBuffer();
|
|
1424
1424
|
t.bindBuffer(t.ARRAY_BUFFER, r), t.enableVertexAttribArray(0), t.enableVertexAttribArray(1), t.enableVertexAttribArray(2), t.vertexAttribPointer(0, 1, t.FLOAT, !1, 12, 0), t.vertexAttribPointer(1, 1, t.FLOAT, !1, 12, 4), t.vertexAttribPointer(2, 1, t.FLOAT, !1, 12, 8);
|
|
1425
1425
|
let i = t.getUniformLocation(n, "u_history"), a = t.getUniformLocation(n, "u_width"), o = t.getUniformLocation(n, "u_height"), s = t.getUniformLocation(n, "u_rowH"), c = t.getUniformLocation(n, "u_padding"), l = t.getUniformLocation(n, "u_color"), u = !1, d = 100, f = 0, p, m, h, g = [], _ = [];
|
|
1426
1426
|
function v(e) {
|
|
1427
1427
|
u = !!e.collapsed, f = e.rows.length, d = Math.max(e.historySize || 100, 100), m = new Float32Array(f * d), h = new Uint32Array(f), p = new Float32Array(f * d * 3), _.length = f, g.length = f;
|
|
1428
1428
|
for (let t = 0; t < f; t++) {
|
|
1429
|
-
_[t] =
|
|
1429
|
+
_[t] = at(e.rows[t], d);
|
|
1430
1430
|
let n = e.rows[t].color;
|
|
1431
1431
|
g[t] = [
|
|
1432
1432
|
parseInt(n.slice(1, 3), 16) / 255,
|
|
@@ -1458,22 +1458,22 @@ function dt(e) {
|
|
|
1458
1458
|
samplerCount: _.length
|
|
1459
1459
|
};
|
|
1460
1460
|
}
|
|
1461
|
-
var
|
|
1462
|
-
function
|
|
1461
|
+
var dt = "#version 300 es\nprecision highp float;\n\nlayout(location=0) in float a_x;\nlayout(location=1) in float a_row;\nlayout(location=2) in float a_value;\n\nuniform float u_history;\nuniform float u_width;\nuniform float u_height;\nuniform float u_padding;\nuniform float u_rowH;\n\nvoid main() {\n float x = u_padding + (a_x / (u_history - 1.0)) * (u_width - 2.0 * u_padding);\n float yBase = u_padding + a_row * (u_rowH + u_padding);\n float y = yBase + u_rowH - 2.0 - a_value * (u_rowH - 4.0);\n\n float ndcX = (x / u_width) * 2.0 - 1.0;\n float ndcY = 1.0 - (y / u_height) * 2.0;\n\n gl_Position = vec4(ndcX, ndcY, 0.0, 1.0);\n}\n", ft = "#version 300 es\nprecision highp float;\nuniform vec3 u_color;\nout vec4 outColor;\nvoid main(){\n outColor = vec4(u_color,1.0);\n}\n";
|
|
1462
|
+
function pt(e, t, n) {
|
|
1463
1463
|
let r = e.createShader(t);
|
|
1464
1464
|
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) throw e.getShaderInfoLog(r);
|
|
1465
1465
|
return r;
|
|
1466
1466
|
}
|
|
1467
|
-
function
|
|
1467
|
+
function mt(e) {
|
|
1468
1468
|
let t = e.createProgram();
|
|
1469
|
-
return e.attachShader(t,
|
|
1469
|
+
return e.attachShader(t, pt(e, e.VERTEX_SHADER, dt)), e.attachShader(t, pt(e, e.FRAGMENT_SHADER, ft)), e.linkProgram(t), e.useProgram(t), t;
|
|
1470
1470
|
}
|
|
1471
1471
|
//#endregion
|
|
1472
1472
|
//#region src/lib/components/elements/graph.ts
|
|
1473
|
-
function
|
|
1474
|
-
return (0, F.default)(
|
|
1473
|
+
function ht(e, t) {
|
|
1474
|
+
return (0, F.default)(gt, e, t);
|
|
1475
1475
|
}
|
|
1476
|
-
var
|
|
1476
|
+
var gt = () => {
|
|
1477
1477
|
let e = null, t = null, n = null, r, i = { rows: [] }, a = [], o = null;
|
|
1478
1478
|
function s(t) {
|
|
1479
1479
|
n = t, e?.observe(n), l(), o = setInterval(u, 250);
|
|
@@ -1485,7 +1485,7 @@ var _t = () => {
|
|
|
1485
1485
|
n?.isConnected ? (r.update(), r.render(), t = requestAnimationFrame(l)) : c();
|
|
1486
1486
|
}
|
|
1487
1487
|
function u() {
|
|
1488
|
-
|
|
1488
|
+
vt(r, a);
|
|
1489
1489
|
}
|
|
1490
1490
|
function d({ dom: t }) {
|
|
1491
1491
|
c();
|
|
@@ -1495,10 +1495,10 @@ var _t = () => {
|
|
|
1495
1495
|
return;
|
|
1496
1496
|
}
|
|
1497
1497
|
e = new ResizeObserver((e) => {
|
|
1498
|
-
let t =
|
|
1498
|
+
let t = _t(e);
|
|
1499
1499
|
t && r && r.resize(t.width, t.height);
|
|
1500
|
-
}), r =
|
|
1501
|
-
for (let e = 0; e < i.rows.length; e++) i.rows[e].color ||=
|
|
1500
|
+
}), r = ut(n);
|
|
1501
|
+
for (let e = 0; e < i.rows.length; e++) i.rows[e].color ||= xt(e);
|
|
1502
1502
|
r.configure(i), s(n);
|
|
1503
1503
|
}
|
|
1504
1504
|
function f() {
|
|
@@ -1510,7 +1510,7 @@ var _t = () => {
|
|
|
1510
1510
|
rows: (e.attrs.rows || []).map((e, t) => ({
|
|
1511
1511
|
...e,
|
|
1512
1512
|
name: e.name || `Row ${t + 1}`,
|
|
1513
|
-
color: e.color ||
|
|
1513
|
+
color: e.color || xt(t)
|
|
1514
1514
|
}))
|
|
1515
1515
|
};
|
|
1516
1516
|
}
|
|
@@ -1534,7 +1534,7 @@ var _t = () => {
|
|
|
1534
1534
|
])))])]
|
|
1535
1535
|
};
|
|
1536
1536
|
};
|
|
1537
|
-
function
|
|
1537
|
+
function _t(e) {
|
|
1538
1538
|
let t = e[0];
|
|
1539
1539
|
return t.devicePixelContentBoxSize ? {
|
|
1540
1540
|
width: t.devicePixelContentBoxSize[0].inlineSize,
|
|
@@ -1544,25 +1544,25 @@ function vt(e) {
|
|
|
1544
1544
|
height: Math.round(t.contentBoxSize[0].blockSize * devicePixelRatio)
|
|
1545
1545
|
} : null;
|
|
1546
1546
|
}
|
|
1547
|
-
function
|
|
1547
|
+
function vt(e, t) {
|
|
1548
1548
|
if (e) for (let n = 0; n < t.length; n++) {
|
|
1549
1549
|
let r = t[n], i = e.sampler(n);
|
|
1550
1550
|
if (!i || !r) continue;
|
|
1551
1551
|
let a = r.querySelector(".twk-current"), o = r.querySelector(".twk-stats");
|
|
1552
|
-
if (a && (a.textContent =
|
|
1552
|
+
if (a && (a.textContent = yt(i.value, i.fractionDigits)), o) if (i.noGraph) o.textContent = "";
|
|
1553
1553
|
else {
|
|
1554
1554
|
let e = i.fractionDigits;
|
|
1555
|
-
o.textContent = `${
|
|
1555
|
+
o.textContent = `${yt(i.minSeen, e)}/${yt(i.maxSeen, e)}/${yt(i.avg, e)}`;
|
|
1556
1556
|
}
|
|
1557
1557
|
}
|
|
1558
1558
|
}
|
|
1559
|
-
function
|
|
1559
|
+
function yt(e, t) {
|
|
1560
1560
|
if (e == null) return "n/a";
|
|
1561
1561
|
if (t != null) return e.toFixed(t);
|
|
1562
1562
|
let n = Math.abs(e);
|
|
1563
1563
|
return n < 2 ** -52 ? "0" : n < 1 ? e.toFixed(3) : n < 10 ? e.toFixed(2) : n < 100 ? e.toFixed(1) : e.toFixed(0);
|
|
1564
1564
|
}
|
|
1565
|
-
var
|
|
1565
|
+
var bt = [
|
|
1566
1566
|
"#1F77B4",
|
|
1567
1567
|
"#FF7F0E",
|
|
1568
1568
|
"#2CA02C",
|
|
@@ -1584,21 +1584,21 @@ var xt = [
|
|
|
1584
1584
|
"#FFBB78",
|
|
1585
1585
|
"#98DF8A"
|
|
1586
1586
|
];
|
|
1587
|
-
function
|
|
1588
|
-
return
|
|
1587
|
+
function xt(e) {
|
|
1588
|
+
return bt[e % bt.length];
|
|
1589
1589
|
}
|
|
1590
1590
|
//#endregion
|
|
1591
1591
|
//#region src/lib/components/elements/image.ts
|
|
1592
|
-
function
|
|
1593
|
-
return (0, F.default)(
|
|
1592
|
+
function St(e, t) {
|
|
1593
|
+
return (0, F.default)(Ct, e, t);
|
|
1594
1594
|
}
|
|
1595
|
-
var
|
|
1595
|
+
var Ct = () => {
|
|
1596
1596
|
let e, t, n, r, i, a, o, s = 0, c, l;
|
|
1597
1597
|
function u() {
|
|
1598
1598
|
return t !== c || e !== l;
|
|
1599
1599
|
}
|
|
1600
1600
|
function d(e) {
|
|
1601
|
-
return
|
|
1601
|
+
return B(e) ? `${e}px` : e;
|
|
1602
1602
|
}
|
|
1603
1603
|
function f(e) {
|
|
1604
1604
|
return String(e || "");
|
|
@@ -1661,36 +1661,36 @@ var wt = () => {
|
|
|
1661
1661
|
...g(t)
|
|
1662
1662
|
})
|
|
1663
1663
|
};
|
|
1664
|
-
},
|
|
1664
|
+
}, wt = () => ({ view: (e) => {
|
|
1665
1665
|
let { label: t, tip: n, tagName: r, ...i } = e.attrs;
|
|
1666
1666
|
return [(0, F.default)(`${r || "div"}.twk-widget`, { ...i }, t === !1 ? null : (0, F.default)("div.twk-widget-label", {}, t), e.children)];
|
|
1667
1667
|
} });
|
|
1668
|
-
function
|
|
1669
|
-
return (0, F.default)(
|
|
1668
|
+
function J(e, t) {
|
|
1669
|
+
return (0, F.default)(wt, e, t);
|
|
1670
1670
|
}
|
|
1671
1671
|
//#endregion
|
|
1672
1672
|
//#region src/lib/components/controls/scalar.ts
|
|
1673
|
+
function Tt(e, t) {
|
|
1674
|
+
return (0, F.default)(Dt, e, t);
|
|
1675
|
+
}
|
|
1673
1676
|
function Et(e, t) {
|
|
1674
1677
|
return (0, F.default)(Ot, e, t);
|
|
1675
1678
|
}
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
label: e ?? n.field,
|
|
1682
|
-
class: t
|
|
1683
|
-
}, [(0, F.default)(kt, n)]) }), kt = () => {
|
|
1679
|
+
var Dt = () => ({ view: ({ attrs: { tagName: e, label: t, class: n, ...r } }) => J({
|
|
1680
|
+
tagName: `${e || "div"}.twk-scalar-widget`,
|
|
1681
|
+
label: t ?? r.field,
|
|
1682
|
+
class: n
|
|
1683
|
+
}, [(0, F.default)(Ot, r)]) }), Ot = () => {
|
|
1684
1684
|
let e, t, n, r, i, a, o, s = !1, c = !1, l = !1, u = !1, d;
|
|
1685
1685
|
function f(o) {
|
|
1686
1686
|
(!d || o.attrs.decimals !== a.decimals) && (d = new Intl.NumberFormat("en-US", {
|
|
1687
1687
|
minimumFractionDigits: o.attrs.decimals ?? 1,
|
|
1688
1688
|
maximumFractionDigits: o.attrs.decimals ?? 1,
|
|
1689
1689
|
useGrouping: !1
|
|
1690
|
-
})), a = o.attrs, e = a.min, t = a.max, n = a.step, u = !!a.range, i =
|
|
1690
|
+
})), a = o.attrs, e = a.min, t = a.max, n = a.step, u = !!a.range, i = K(a), r = !!a.readonly, s = e != null && t != null, c = n != null, l = s || c;
|
|
1691
1691
|
}
|
|
1692
1692
|
function p(n, r) {
|
|
1693
|
-
i = isNaN(r) ? null :
|
|
1693
|
+
i = isNaN(r) ? null : U(r, e, t), q(a, i), (n === "input" ? a.oninput : a.onchange)?.(a.value, i), F.default.redraw();
|
|
1694
1694
|
}
|
|
1695
1695
|
function m() {
|
|
1696
1696
|
o = !0;
|
|
@@ -1707,33 +1707,35 @@ var Ot = () => ({ view: ({ attrs: { label: e, class: t, ...n } }) => q({
|
|
|
1707
1707
|
p("change", parseFloat(t.value));
|
|
1708
1708
|
}
|
|
1709
1709
|
function v(r) {
|
|
1710
|
-
return r =
|
|
1710
|
+
return r = U(r, e, t), n != null && (r = Math.round(r / n) * n), parseFloat(r.toFixed(5));
|
|
1711
1711
|
}
|
|
1712
1712
|
function y(e) {
|
|
1713
|
-
!l || r ||
|
|
1713
|
+
!l || r || document.activeElement !== e.target && C.activate(e);
|
|
1714
1714
|
}
|
|
1715
|
-
let b, x, S =
|
|
1715
|
+
let b, x, S = !1, C = de({
|
|
1716
1716
|
onStart: (e) => {
|
|
1717
|
-
b = i, x =
|
|
1717
|
+
e.preventDefault(), document.activeElement?.blur(), S = !1, b = i, x = ue(e, C.target);
|
|
1718
1718
|
},
|
|
1719
1719
|
onMove: (r) => {
|
|
1720
|
-
r.preventDefault(), S.target?.blur();
|
|
1721
|
-
let i =
|
|
1722
|
-
s ?
|
|
1720
|
+
r.preventDefault(), document.body.classList.add("twk-dragging"), S = !0, C.target?.blur();
|
|
1721
|
+
let i = ue(r, C.target), a = (x.x - i.x) / Math.max(i.width, 200), o = b;
|
|
1722
|
+
s ? o -= a * (t - e) : c && (o -= Math.round(a * 100) * n), p("input", v(o));
|
|
1723
1723
|
},
|
|
1724
|
-
onEnd: () => {
|
|
1725
|
-
|
|
1724
|
+
onEnd: (e) => {
|
|
1725
|
+
document.body.classList.remove("twk-dragging");
|
|
1726
|
+
let t = C.target;
|
|
1727
|
+
S ? p("change", i) : t.focus(), C.deactivate();
|
|
1726
1728
|
}
|
|
1727
1729
|
});
|
|
1728
|
-
function
|
|
1730
|
+
function w(e) {
|
|
1729
1731
|
if (!o) return;
|
|
1730
1732
|
e.preventDefault();
|
|
1731
|
-
let t = (e.ctrlKey ? .5 : 1) *
|
|
1733
|
+
let t = (e.ctrlKey ? .5 : 1) * U(e.deltaY, -1, 1), r = (n || .2) * t;
|
|
1732
1734
|
r && p("change", v((i || 0) - r));
|
|
1733
1735
|
}
|
|
1734
1736
|
return {
|
|
1735
1737
|
onremove: () => {
|
|
1736
|
-
|
|
1738
|
+
C.deactivate();
|
|
1737
1739
|
},
|
|
1738
1740
|
oninit: f,
|
|
1739
1741
|
onbeforeupdate: f,
|
|
@@ -1742,10 +1744,11 @@ var Ot = () => ({ view: ({ attrs: { label: e, class: t, ...n } }) => q({
|
|
|
1742
1744
|
let l = s ? (i - e) / (t - e) : NaN;
|
|
1743
1745
|
return (0, F.default)("div.twk-input.twk-scalar-input", {
|
|
1744
1746
|
style: s ? `--twk-scalar-value: ${l}` : "",
|
|
1745
|
-
class:
|
|
1747
|
+
class: W({
|
|
1746
1748
|
"twk-input-readonly": r,
|
|
1747
1749
|
"twk-scalar-dragable": !r && (s || c),
|
|
1748
|
-
"twk-scalar-range": u
|
|
1750
|
+
"twk-scalar-range": u,
|
|
1751
|
+
"twk-scalar-dragging": !!C.target
|
|
1749
1752
|
}, a.attrs.class)
|
|
1750
1753
|
}, [
|
|
1751
1754
|
a.attrs.slotBefore ? (0, F.default)("span", {}, a.attrs.slotBefore) : null,
|
|
@@ -1759,7 +1762,7 @@ var Ot = () => ({ view: ({ attrs: { label: e, class: t, ...n } }) => q({
|
|
|
1759
1762
|
onblur: h,
|
|
1760
1763
|
oninput: g,
|
|
1761
1764
|
onchange: _,
|
|
1762
|
-
onwheel:
|
|
1765
|
+
onwheel: w,
|
|
1763
1766
|
onmousedown: y,
|
|
1764
1767
|
ontouchstart: y,
|
|
1765
1768
|
placeholder: void 0,
|
|
@@ -1773,22 +1776,22 @@ var Ot = () => ({ view: ({ attrs: { label: e, class: t, ...n } }) => q({
|
|
|
1773
1776
|
};
|
|
1774
1777
|
//#endregion
|
|
1775
1778
|
//#region src/lib/components/controls/angle.ts
|
|
1776
|
-
function
|
|
1777
|
-
return (0, F.default)(
|
|
1779
|
+
function kt(e, t) {
|
|
1780
|
+
return (0, F.default)(jt, e, t);
|
|
1778
1781
|
}
|
|
1779
|
-
function
|
|
1782
|
+
function At(e, t) {
|
|
1780
1783
|
return (0, F.default)(Ft, e, t);
|
|
1781
1784
|
}
|
|
1782
|
-
var
|
|
1783
|
-
tagName: "
|
|
1784
|
-
label:
|
|
1785
|
-
class:
|
|
1786
|
-
}, [(0, F.default)(Ft,
|
|
1787
|
-
toControl: (e) => e *
|
|
1785
|
+
var jt = () => ({ view: ({ attrs: { tagName: e, label: t, class: n, ...r } }) => J({
|
|
1786
|
+
tagName: `${e || "div"}.twk-angle-widget`,
|
|
1787
|
+
label: t ?? r.field,
|
|
1788
|
+
class: n
|
|
1789
|
+
}, [(0, F.default)(Ft, r)]) }), Mt = 180 / Math.PI, Y = Math.PI / 180, Nt = {
|
|
1790
|
+
toControl: (e) => e * Mt,
|
|
1788
1791
|
fromControl: (e) => e * Y
|
|
1789
1792
|
}, Pt = {
|
|
1790
1793
|
toControl: (e) => e * Y,
|
|
1791
|
-
fromControl: (e) => e *
|
|
1794
|
+
fromControl: (e) => e * Mt
|
|
1792
1795
|
}, Ft = () => {
|
|
1793
1796
|
let e = 0, t = !1, n = [0, 0], r, i, a, o, s;
|
|
1794
1797
|
function c(e) {
|
|
@@ -1798,24 +1801,24 @@ var Mt = () => ({ view: ({ attrs: { label: e, class: t, ...n } }) => q({
|
|
|
1798
1801
|
return e %= 360, e < 0 && (e += 360), e;
|
|
1799
1802
|
}
|
|
1800
1803
|
function u(t) {
|
|
1801
|
-
s = t.attrs, i = s.min, a = s.max, o = s.step, i = i == null ? null : l(i) * Y, a = a == null ? null : l(a) * Y, o = o == null ? null : l(o) * Y, e =
|
|
1804
|
+
s = t.attrs, i = s.min, a = s.max, o = s.step, i = i == null ? null : l(i) * Y, a = a == null ? null : l(a) * Y, o = o == null ? null : l(o) * Y, e = K(s) ?? e, s.degree && (e *= Y), f();
|
|
1802
1805
|
}
|
|
1803
1806
|
function d(t) {
|
|
1804
1807
|
f();
|
|
1805
|
-
let n = s.degree ? e *
|
|
1806
|
-
|
|
1808
|
+
let n = s.degree ? e * Mt : e;
|
|
1809
|
+
q(s, n), H(t === "input" ? s.oninput : s.onchange, s.value, n);
|
|
1807
1810
|
}
|
|
1808
1811
|
function f() {
|
|
1809
1812
|
n[0] = Math.cos(e), n[1] = Math.sin(e);
|
|
1810
1813
|
}
|
|
1811
|
-
let p, m =
|
|
1814
|
+
let p, m = de({
|
|
1812
1815
|
onStart: (e) => {
|
|
1813
|
-
let t =
|
|
1816
|
+
let t = ue(e);
|
|
1814
1817
|
p = [-(t.x - t.width / 2), -(t.y - t.height / 2)];
|
|
1815
1818
|
},
|
|
1816
1819
|
onMove: (n) => {
|
|
1817
1820
|
n.preventDefault();
|
|
1818
|
-
let i =
|
|
1821
|
+
let i = ue(n, r, p), a = i.normalizedX - .5, o = i.normalizedY - .5;
|
|
1819
1822
|
t && (e = Math.atan2(a, -o), e < 0 && (e += 2 * Math.PI)), e = c(e), d("input"), F.default.redraw();
|
|
1820
1823
|
},
|
|
1821
1824
|
onEnd: () => {
|
|
@@ -1835,18 +1838,18 @@ var Mt = () => ({ view: ({ attrs: { label: e, class: t, ...n } }) => q({
|
|
|
1835
1838
|
onupdate: (e) => {
|
|
1836
1839
|
u(e);
|
|
1837
1840
|
},
|
|
1838
|
-
view: ({ attrs: { ...n } }) => (0, F.default)("div.twk-angle-input", { style: { "--angle-value": `${h(e *
|
|
1841
|
+
view: ({ attrs: { ...n } }) => (0, F.default)("div.twk-angle-input", { style: { "--angle-value": `${h(e * Mt)}` } }, [Et({
|
|
1839
1842
|
unit: s.degree ? "°" : "rad",
|
|
1840
1843
|
range: !0,
|
|
1841
1844
|
...n,
|
|
1842
1845
|
slotAfter: (0, F.default)("span.twk-flex-row", [
|
|
1843
1846
|
(0, F.default)("span.twk-color-dim", "/"),
|
|
1844
|
-
(s.degree ? e : e *
|
|
1847
|
+
(s.degree ? e : e * Mt).toFixed(1),
|
|
1845
1848
|
(0, F.default)("span.twk-color-dim", s.degree ? "rad" : "°")
|
|
1846
1849
|
])
|
|
1847
1850
|
}), (0, F.default)("div.twk-angle-pane", {
|
|
1848
1851
|
oncreate: (e) => r = e.dom,
|
|
1849
|
-
class:
|
|
1852
|
+
class: W({ "is-dragging": t }),
|
|
1850
1853
|
style: {
|
|
1851
1854
|
aspectRatio: "1",
|
|
1852
1855
|
display: "flex",
|
|
@@ -1865,20 +1868,20 @@ function It(e, t) {
|
|
|
1865
1868
|
function Lt(e, t) {
|
|
1866
1869
|
return (0, F.default)(zt, e, t);
|
|
1867
1870
|
}
|
|
1868
|
-
var Rt = () => ({ view: ({ attrs: {
|
|
1869
|
-
tagName:
|
|
1870
|
-
label:
|
|
1871
|
-
class:
|
|
1872
|
-
}, [(0, F.default)(zt,
|
|
1871
|
+
var Rt = () => ({ view: ({ attrs: { tagName: e, label: t, class: n, ...r } }) => J({
|
|
1872
|
+
tagName: `${e}.twk-bool-widget`,
|
|
1873
|
+
label: t ?? r.field,
|
|
1874
|
+
class: n
|
|
1875
|
+
}, [(0, F.default)(zt, r)]) }), zt = () => {
|
|
1873
1876
|
let e;
|
|
1874
1877
|
function t(t) {
|
|
1875
1878
|
let n = t.target.checked;
|
|
1876
|
-
|
|
1879
|
+
q(e, n), e.oninput?.(e.value, n), e.onchange?.(e.value, n);
|
|
1877
1880
|
}
|
|
1878
1881
|
return { view: (n) => {
|
|
1879
1882
|
e = n.attrs;
|
|
1880
|
-
let r =
|
|
1881
|
-
return (0, F.default)("div.twk-bool-input", { class:
|
|
1883
|
+
let r = K(e) === !0, i = e.align === "end";
|
|
1884
|
+
return (0, F.default)("div.twk-bool-input", { class: W({
|
|
1882
1885
|
"twk-align-start": !i,
|
|
1883
1886
|
"twk-align-end": !!i,
|
|
1884
1887
|
"twk-bool-true": r,
|
|
@@ -1886,7 +1889,7 @@ var Rt = () => ({ view: ({ attrs: { label: e, class: t, ...n } }) => q({
|
|
|
1886
1889
|
}) }, [
|
|
1887
1890
|
e.slotBefore,
|
|
1888
1891
|
e.readonly ? r ? e.slotTrue || (0, F.default)("span", "true") : e.slotFalse || (0, F.default)("span", "false") : (0, F.default)("input", {
|
|
1889
|
-
class:
|
|
1892
|
+
class: W({
|
|
1890
1893
|
"twk-toggle": !!e.toggle,
|
|
1891
1894
|
"twk-check": !e.toggle
|
|
1892
1895
|
}),
|
|
@@ -1902,7 +1905,7 @@ var Rt = () => ({ view: ({ attrs: { label: e, class: t, ...n } }) => q({
|
|
|
1902
1905
|
//#endregion
|
|
1903
1906
|
//#region src/lib/color/converter.ts
|
|
1904
1907
|
function Bt(e) {
|
|
1905
|
-
let t = e.h % 360, n =
|
|
1908
|
+
let t = e.h % 360, n = U(e.s, 0, 1), r = U(e.v, 0, 1), i = r * n, a = i * (1 - Math.abs(t / 60 % 2 - 1)), o = r - i, s = {
|
|
1906
1909
|
r: 0,
|
|
1907
1910
|
g: 0,
|
|
1908
1911
|
b: 0
|
|
@@ -1980,7 +1983,7 @@ var Ht = class {
|
|
|
1980
1983
|
}), t);
|
|
1981
1984
|
}
|
|
1982
1985
|
fromControl(e) {
|
|
1983
|
-
return this.prefix + this.components.map((t) =>
|
|
1986
|
+
return this.prefix + this.components.map((t) => le(Math.round(e[t] * 255).toString(16), 2, "0")).join("");
|
|
1984
1987
|
}
|
|
1985
1988
|
}, Gt = class {
|
|
1986
1989
|
componentsRev;
|
|
@@ -2000,7 +2003,7 @@ var Ht = class {
|
|
|
2000
2003
|
}), t;
|
|
2001
2004
|
}
|
|
2002
2005
|
fromControl(e) {
|
|
2003
|
-
let t = this.componentsRev.map((t) =>
|
|
2006
|
+
let t = this.componentsRev.map((t) => le(Math.round(e[t] * 255 || 0).toString(16), 2, "0")).join("");
|
|
2004
2007
|
return parseInt("0x" + t, 16);
|
|
2005
2008
|
}
|
|
2006
2009
|
}, Kt = [
|
|
@@ -2069,11 +2072,11 @@ function Jt(e, t) {
|
|
|
2069
2072
|
function Yt(e, t) {
|
|
2070
2073
|
return (0, F.default)(Zt, e, t);
|
|
2071
2074
|
}
|
|
2072
|
-
var Xt = () => ({ view: ({ attrs: {
|
|
2073
|
-
tagName: "div.twk-picker-color-widget
|
|
2074
|
-
label:
|
|
2075
|
-
class:
|
|
2076
|
-
}, [(0, F.default)(Zt,
|
|
2075
|
+
var Xt = () => ({ view: ({ attrs: { tagName: e, label: t, class: n, ...r } }) => J({
|
|
2076
|
+
tagName: `${e || "div"}.twk-picker-color-widget`,
|
|
2077
|
+
label: t ?? r.field,
|
|
2078
|
+
class: n
|
|
2079
|
+
}, [(0, F.default)(Zt, r)]) }), Zt = () => {
|
|
2077
2080
|
let e = 0, t = 0, n = 0, r = 0, i;
|
|
2078
2081
|
function a(i = t, a = n) {
|
|
2079
2082
|
return {
|
|
@@ -2118,12 +2121,12 @@ var Xt = () => ({ view: ({ attrs: { label: e, class: t, ...n } }) => q({
|
|
|
2118
2121
|
return Z(e).fromControl(s());
|
|
2119
2122
|
}
|
|
2120
2123
|
function h() {
|
|
2121
|
-
let e = m(i.format), t =
|
|
2122
|
-
|
|
2124
|
+
let e = m(i.format), t = q(i, e);
|
|
2125
|
+
H(i.oninput, i.value, t);
|
|
2123
2126
|
}
|
|
2124
2127
|
function g() {
|
|
2125
|
-
let e = m(i.format), t =
|
|
2126
|
-
|
|
2128
|
+
let e = m(i.format), t = q(i, e);
|
|
2129
|
+
H(i.onchange, i.value, t);
|
|
2127
2130
|
}
|
|
2128
2131
|
function _() {
|
|
2129
2132
|
return i.format?.match(/a/i);
|
|
@@ -2165,8 +2168,8 @@ var Xt = () => ({ view: ({ attrs: { label: e, class: t, ...n } }) => q({
|
|
|
2165
2168
|
function A(i) {
|
|
2166
2169
|
if (!C) return;
|
|
2167
2170
|
i.preventDefault();
|
|
2168
|
-
let a = C.getBoundingClientRect(), o = window.pageXOffset || document.documentElement.scrollLeft, s = window.pageYOffset || document.documentElement.scrollTop, c = C.clientWidth, l = C.clientHeight, [u, d] =
|
|
2169
|
-
u =
|
|
2171
|
+
let a = C.getBoundingClientRect(), o = window.pageXOffset || document.documentElement.scrollLeft, s = window.pageYOffset || document.documentElement.scrollTop, c = C.clientWidth, l = C.clientHeight, [u, d] = G(i);
|
|
2172
|
+
u = U((u - o - a.left) / c, 0, 1), d = U((d - s - a.top) / l, 0, 1), w === "sv" && (t = u, n = 1 - d), w === "h" && (e = 1 - u), w === "a" && (r = u), h(), F.default.redraw();
|
|
2170
2173
|
}
|
|
2171
2174
|
function j() {
|
|
2172
2175
|
C != null && (C = null, k(), g());
|
|
@@ -2176,13 +2179,13 @@ var Xt = () => ({ view: ({ attrs: { label: e, class: t, ...n } }) => q({
|
|
|
2176
2179
|
k();
|
|
2177
2180
|
},
|
|
2178
2181
|
oninit: (e) => {
|
|
2179
|
-
i = e.attrs, p(
|
|
2182
|
+
i = e.attrs, p(K(i), i.format);
|
|
2180
2183
|
},
|
|
2181
2184
|
onupdate: (e) => {
|
|
2182
|
-
i = e.attrs, p(
|
|
2185
|
+
i = e.attrs, p(K(i), i.format);
|
|
2183
2186
|
},
|
|
2184
2187
|
view: (a) => {
|
|
2185
|
-
i = a.attrs, p(
|
|
2188
|
+
i = a.attrs, p(K(i), i.format);
|
|
2186
2189
|
let o = s();
|
|
2187
2190
|
return (0, F.default)("div.twk-color-picker", {}, [(0, F.default)(".color-picker-inputs", (0, F.default)("input.twk-input.input-hex[type='text']", {
|
|
2188
2191
|
value: _() ? d() : u(),
|
|
@@ -2263,26 +2266,26 @@ function Qt(e, t) {
|
|
|
2263
2266
|
function $t(e, t) {
|
|
2264
2267
|
return (0, F.default)(tn, e, t);
|
|
2265
2268
|
}
|
|
2266
|
-
var en = () => ({ view: ({ attrs: {
|
|
2267
|
-
tagName: "
|
|
2268
|
-
label:
|
|
2269
|
-
class:
|
|
2270
|
-
}, [(0, F.default)(tn,
|
|
2269
|
+
var en = () => ({ view: ({ attrs: { tagName: e, label: t, class: n, ...r } }) => J({
|
|
2270
|
+
tagName: `${e || ""}.twk-color-widget`,
|
|
2271
|
+
label: t ?? r.field,
|
|
2272
|
+
class: n
|
|
2273
|
+
}, [(0, F.default)(tn, r)]) }), tn = () => {
|
|
2271
2274
|
let e, t = !1, n, r, i = Z("rgba()");
|
|
2272
2275
|
function a(t) {
|
|
2273
|
-
e = t.attrs, r =
|
|
2276
|
+
e = t.attrs, r = K(e), n = i.fromControl(Z(e.format).toControl(r));
|
|
2274
2277
|
}
|
|
2275
2278
|
function o() {
|
|
2276
2279
|
t = !t;
|
|
2277
2280
|
}
|
|
2278
2281
|
function s(t, n) {
|
|
2279
|
-
|
|
2282
|
+
q(e, n), e.oninput?.(e.value, n);
|
|
2280
2283
|
}
|
|
2281
2284
|
function c(t, n) {
|
|
2282
|
-
|
|
2285
|
+
q(e, n), e.onchange?.(e.value, n);
|
|
2283
2286
|
}
|
|
2284
2287
|
function l() {
|
|
2285
|
-
return
|
|
2288
|
+
return z(r) ? r : B(r) ? "0x" + le(r.toString(16), 8, "0") : ce(r) ? r.map((e) => e < 1 && e > 0 ? e.toFixed(2) : e).join(" , ") : V(r) ? Object.keys(r).map((e) => {
|
|
2286
2289
|
let t = r[e];
|
|
2287
2290
|
return `${e}: ${t < 1 && t > 0 ? t.toFixed(2) : t}`;
|
|
2288
2291
|
}).join(" ") : r == null ? "null" : "?";
|
|
@@ -2306,23 +2309,23 @@ function nn(e, t) {
|
|
|
2306
2309
|
return (0, F.default)(an, e, t);
|
|
2307
2310
|
}
|
|
2308
2311
|
function rn(e, t) {
|
|
2309
|
-
return (0, F.default)(
|
|
2312
|
+
return (0, F.default)(on, e, t);
|
|
2310
2313
|
}
|
|
2311
|
-
var an = () => ({ view: ({ attrs: {
|
|
2312
|
-
tagName: "
|
|
2313
|
-
label:
|
|
2314
|
-
class:
|
|
2315
|
-
}, (0, F.default)(on,
|
|
2314
|
+
var an = () => ({ view: ({ attrs: { tagName: e, label: t, class: n, ...r } }) => J({
|
|
2315
|
+
tagName: `${e || "div"}.twk-input-widget`,
|
|
2316
|
+
label: t ?? r.field,
|
|
2317
|
+
class: n
|
|
2318
|
+
}, (0, F.default)(on, r)) }), on = () => {
|
|
2316
2319
|
let e;
|
|
2317
2320
|
function t(t) {
|
|
2318
2321
|
let n = t.target.value;
|
|
2319
|
-
|
|
2322
|
+
q(e, n), (t.type === "input" ? e.oninput : e.onchange)?.(e.value, n);
|
|
2320
2323
|
}
|
|
2321
2324
|
return { view: (n) => (e = n.attrs, (0, F.default)("div.twk-input", {}, [
|
|
2322
2325
|
n.attrs.slotBefore ? (0, F.default)("span", {}, n.attrs.slotBefore) : null,
|
|
2323
2326
|
(0, F.default)("input", {
|
|
2324
2327
|
type: e.type || "text",
|
|
2325
|
-
value:
|
|
2328
|
+
value: K(e),
|
|
2326
2329
|
oninput: t,
|
|
2327
2330
|
onchange: t,
|
|
2328
2331
|
placeholder: e.placeholder,
|
|
@@ -2336,19 +2339,19 @@ var an = () => ({ view: ({ attrs: { label: e, class: t, ...n } }) => q({
|
|
|
2336
2339
|
function sn(e, t) {
|
|
2337
2340
|
return (0, F.default)(cn, e, t);
|
|
2338
2341
|
}
|
|
2339
|
-
var cn = () => ({ view: ({ attrs: {
|
|
2340
|
-
tagName: "
|
|
2341
|
-
label:
|
|
2342
|
-
class:
|
|
2343
|
-
}, [(0, F.default)(un,
|
|
2342
|
+
var cn = () => ({ view: ({ attrs: { tagName: e, label: t, class: n, ...r } }) => J({
|
|
2343
|
+
tagName: `${e || ""}.twk-matrix-widget`,
|
|
2344
|
+
label: t ?? r.field,
|
|
2345
|
+
class: n
|
|
2346
|
+
}, [(0, F.default)(un, r)]) });
|
|
2344
2347
|
function ln(e, t) {
|
|
2345
2348
|
return (0, F.default)(un, e, t);
|
|
2346
2349
|
}
|
|
2347
2350
|
var un = () => {
|
|
2348
2351
|
let e;
|
|
2349
2352
|
function t(t, n, r) {
|
|
2350
|
-
let i =
|
|
2351
|
-
i[n] = r,
|
|
2353
|
+
let i = K(e) || {};
|
|
2354
|
+
i[n] = r, q(e, i), (t === "input" ? e.oninput : e.onchange)?.(e.value, i);
|
|
2352
2355
|
}
|
|
2353
2356
|
function n(t, n) {
|
|
2354
2357
|
let r = [];
|
|
@@ -2358,11 +2361,11 @@ var un = () => {
|
|
|
2358
2361
|
}
|
|
2359
2362
|
return { view: (r) => {
|
|
2360
2363
|
e = r.attrs;
|
|
2361
|
-
let i = e.cols ?? 1, a = e.rows ?? 1, o =
|
|
2364
|
+
let i = e.cols ?? 1, a = e.rows ?? 1, o = K(e);
|
|
2362
2365
|
return (0, F.default)("div.twk-matrix-input", { style: {
|
|
2363
2366
|
display: "grid",
|
|
2364
2367
|
gridTemplateColumns: `repeat(${i}, auto)`
|
|
2365
|
-
} }, n(a, i).map((n) =>
|
|
2368
|
+
} }, n(a, i).map((n) => Et({
|
|
2366
2369
|
min: e.min,
|
|
2367
2370
|
max: e.max,
|
|
2368
2371
|
step: e.step,
|
|
@@ -2375,15 +2378,25 @@ var un = () => {
|
|
|
2375
2378
|
} };
|
|
2376
2379
|
}, dn = [0, 1], fn = ["x", "y"];
|
|
2377
2380
|
function pn(e, t) {
|
|
2378
|
-
return (0, F.default)(
|
|
2381
|
+
return (0, F.default)(gn, e, t);
|
|
2379
2382
|
}
|
|
2380
|
-
|
|
2383
|
+
function mn(e, t) {
|
|
2384
|
+
return (0, F.default)(gn, e, t);
|
|
2385
|
+
}
|
|
2386
|
+
function hn(e, t) {
|
|
2387
|
+
return (0, F.default)(_n, e, t);
|
|
2388
|
+
}
|
|
2389
|
+
var gn = () => ({ view: ({ attrs: { tagName: e, label: t, class: n, ...r } }) => J({
|
|
2390
|
+
tagName: `${e || "div"}.twk-point-widget`,
|
|
2391
|
+
label: t ?? r.field,
|
|
2392
|
+
class: W("twk-point", n)
|
|
2393
|
+
}, [(0, F.default)(_n, r)]) }), _n = () => {
|
|
2381
2394
|
let e, t, n = dn, r = dn, i = 0, a = 0, o = 0, s = 0, c, l, u, d;
|
|
2382
2395
|
function f(f) {
|
|
2383
2396
|
d = f.attrs;
|
|
2384
2397
|
let p = d.keys || fn;
|
|
2385
2398
|
e = p[0], t = p[1];
|
|
2386
|
-
let m =
|
|
2399
|
+
let m = K(d) ?? {
|
|
2387
2400
|
[e]: i,
|
|
2388
2401
|
[t]: a
|
|
2389
2402
|
};
|
|
@@ -2396,20 +2409,20 @@ var mn = () => {
|
|
|
2396
2409
|
}
|
|
2397
2410
|
function m(n) {
|
|
2398
2411
|
p();
|
|
2399
|
-
let r =
|
|
2412
|
+
let r = K(d) ?? {
|
|
2400
2413
|
[e]: i,
|
|
2401
2414
|
[t]: a
|
|
2402
2415
|
};
|
|
2403
|
-
r[e] = i, r[t] = a,
|
|
2416
|
+
r[e] = i, r[t] = a, H(n === "input" ? d.oninput : d.onchange, d, r);
|
|
2404
2417
|
}
|
|
2405
2418
|
function h(e) {
|
|
2406
2419
|
g.activate(e);
|
|
2407
2420
|
}
|
|
2408
|
-
let g =
|
|
2421
|
+
let g = de({
|
|
2409
2422
|
onMove: (e) => {
|
|
2410
2423
|
e.preventDefault();
|
|
2411
|
-
let t = g.target, n = t.getBoundingClientRect(), r = window.pageXOffset || document.documentElement.scrollLeft, i = window.pageYOffset || document.documentElement.scrollTop, a = t.clientWidth, c = t.clientHeight, [l, u] =
|
|
2412
|
-
o =
|
|
2424
|
+
let t = g.target, n = t.getBoundingClientRect(), r = window.pageXOffset || document.documentElement.scrollLeft, i = window.pageYOffset || document.documentElement.scrollTop, a = t.clientWidth, c = t.clientHeight, [l, u] = G(e);
|
|
2425
|
+
o = U((l - r - n.left) / a, 0, 1), s = U((u - i - n.top) / c, 0, 1), m("input"), F.default.redraw();
|
|
2413
2426
|
},
|
|
2414
2427
|
onEnd: () => {
|
|
2415
2428
|
g.deactivate(), c != null && l != null && (o = c, s = l, m("input")), m("change"), F.default.redraw();
|
|
@@ -2419,10 +2432,7 @@ var mn = () => {
|
|
|
2419
2432
|
onremove: g.deactivate,
|
|
2420
2433
|
oninit: f,
|
|
2421
2434
|
onupdate: f,
|
|
2422
|
-
view: (e) => (f(e),
|
|
2423
|
-
label: d.label,
|
|
2424
|
-
class: U("twk-point", d.class)
|
|
2425
|
-
}, (0, F.default)(".point-area", {
|
|
2435
|
+
view: (e) => (f(e), (0, F.default)(".point-area", {
|
|
2426
2436
|
tabindex: 0,
|
|
2427
2437
|
onmousedown: h,
|
|
2428
2438
|
ontouchstart: h
|
|
@@ -2452,15 +2462,15 @@ var mn = () => {
|
|
|
2452
2462
|
border: "1px solid white",
|
|
2453
2463
|
"border-radius": "5px",
|
|
2454
2464
|
"box-shadow": "0px 0px 2px 1px rgba(0, 0, 0, 0.75)"
|
|
2455
|
-
} })))
|
|
2465
|
+
} })))
|
|
2456
2466
|
};
|
|
2457
2467
|
};
|
|
2458
2468
|
//#endregion
|
|
2459
2469
|
//#region src/lib/components/controls/select.ts
|
|
2460
|
-
function
|
|
2470
|
+
function vn(e) {
|
|
2461
2471
|
let t = [];
|
|
2462
2472
|
for (let n of e) {
|
|
2463
|
-
if (
|
|
2473
|
+
if (z(n) || B(n)) {
|
|
2464
2474
|
t.push({
|
|
2465
2475
|
value: n,
|
|
2466
2476
|
label: String(n)
|
|
@@ -2474,35 +2484,35 @@ function hn(e) {
|
|
|
2474
2484
|
}
|
|
2475
2485
|
return t;
|
|
2476
2486
|
}
|
|
2477
|
-
function
|
|
2487
|
+
function yn(e) {
|
|
2478
2488
|
let t = [];
|
|
2479
|
-
for (let n of e)
|
|
2489
|
+
for (let n of e) z(n) || B(n) || n == null ? t.push({
|
|
2480
2490
|
value: n,
|
|
2481
2491
|
label: String(n)
|
|
2482
2492
|
}) : "value" in n ? t.push(n) : "options" in n && t.push({
|
|
2483
2493
|
label: n.label,
|
|
2484
2494
|
disabled: n.disabled,
|
|
2485
|
-
options: Array.isArray(n.options) ?
|
|
2495
|
+
options: Array.isArray(n.options) ? vn(n.options) : bn(n.options)
|
|
2486
2496
|
});
|
|
2487
2497
|
return t;
|
|
2488
2498
|
}
|
|
2489
|
-
function
|
|
2499
|
+
function bn(e) {
|
|
2490
2500
|
return Object.keys(e).sort().map((t) => ({
|
|
2491
2501
|
value: e[t],
|
|
2492
2502
|
label: t
|
|
2493
2503
|
}));
|
|
2494
2504
|
}
|
|
2495
|
-
function
|
|
2505
|
+
function xn(e) {
|
|
2496
2506
|
let t = e.attrs.options;
|
|
2497
|
-
return t ? Array.isArray(t) ?
|
|
2507
|
+
return t ? Array.isArray(t) ? yn(t) : bn(t) : [];
|
|
2498
2508
|
}
|
|
2499
|
-
function
|
|
2500
|
-
return (0, F.default)(
|
|
2509
|
+
function Sn(e, t) {
|
|
2510
|
+
return (0, F.default)(Cn, e, t);
|
|
2501
2511
|
}
|
|
2502
|
-
var
|
|
2512
|
+
var Cn = () => {
|
|
2503
2513
|
let e, t;
|
|
2504
2514
|
function n() {
|
|
2505
|
-
let n =
|
|
2515
|
+
let n = K(e), r = 0;
|
|
2506
2516
|
for (let e of t) if ("options" in e) for (let t of e.options) {
|
|
2507
2517
|
if (t.value === n) return r;
|
|
2508
2518
|
r++;
|
|
@@ -2525,11 +2535,11 @@ var bn = () => {
|
|
|
2525
2535
|
return null;
|
|
2526
2536
|
}
|
|
2527
2537
|
function i(t) {
|
|
2528
|
-
let n = t.target, i = r(n.selectedIndex), a =
|
|
2529
|
-
e.onchange?.(e, a);
|
|
2538
|
+
let n = t.target, i = r(n.selectedIndex), a = q(e, i);
|
|
2539
|
+
e.onchange?.(e.value, a);
|
|
2530
2540
|
}
|
|
2531
|
-
return { view: (r) => (e = r.attrs, t =
|
|
2532
|
-
tagName: "
|
|
2541
|
+
return { view: (r) => (e = r.attrs, t = xn(r), J({
|
|
2542
|
+
tagName: `${e.tagName || "div"}.twk-select`,
|
|
2533
2543
|
label: e.label ?? e.field,
|
|
2534
2544
|
class: e.class
|
|
2535
2545
|
}, (0, F.default)("select.twk-select-input", {
|
|
@@ -2539,9 +2549,9 @@ var bn = () => {
|
|
|
2539
2549
|
}, t.map((e) => "options" in e ? (0, F.default)("optgroup", {
|
|
2540
2550
|
disabled: !!e.disabled,
|
|
2541
2551
|
label: e.label || ""
|
|
2542
|
-
}, e.options.map(
|
|
2552
|
+
}, e.options.map(wn)) : wn(e))))) };
|
|
2543
2553
|
};
|
|
2544
|
-
function
|
|
2554
|
+
function wn(e) {
|
|
2545
2555
|
return (0, F.default)("option", {
|
|
2546
2556
|
value: e.value,
|
|
2547
2557
|
label: e.label,
|
|
@@ -2550,95 +2560,96 @@ function xn(e) {
|
|
|
2550
2560
|
}
|
|
2551
2561
|
//#endregion
|
|
2552
2562
|
//#region src/lib/components/controls/spherical.ts
|
|
2553
|
-
function
|
|
2554
|
-
return (0, F.default)(
|
|
2563
|
+
function Tn(e, t) {
|
|
2564
|
+
return (0, F.default)(On, e, t);
|
|
2555
2565
|
}
|
|
2556
|
-
|
|
2557
|
-
|
|
2566
|
+
function En(e, t) {
|
|
2567
|
+
return (0, F.default)(On, e, t);
|
|
2568
|
+
}
|
|
2569
|
+
function Dn(e, t) {
|
|
2570
|
+
return (0, F.default)(kn, e, t);
|
|
2571
|
+
}
|
|
2572
|
+
var On = () => ({ view: ({ attrs: { tagName: e, label: t, class: n, ...r } }) => J({
|
|
2573
|
+
tagName: `${e || "div"}.twk-spherical-widget`,
|
|
2574
|
+
label: t ?? r.field,
|
|
2575
|
+
class: n
|
|
2576
|
+
}, [(0, F.default)(kn, r)]) }), kn = () => {
|
|
2577
|
+
let e = 1, t = 0, n = 0, r, i = !1, a, o;
|
|
2578
|
+
function s() {
|
|
2579
|
+
return An(K(a) || jn(e, t, n));
|
|
2580
|
+
}
|
|
2558
2581
|
function c() {
|
|
2559
|
-
return
|
|
2582
|
+
return n > Math.PI / 2;
|
|
2560
2583
|
}
|
|
2561
|
-
function l(
|
|
2562
|
-
|
|
2563
|
-
let
|
|
2564
|
-
e =
|
|
2584
|
+
function l(r) {
|
|
2585
|
+
a = r.attrs;
|
|
2586
|
+
let i = s();
|
|
2587
|
+
e = i.radius ?? 1, t = i.azimuth ?? 0, n = i.polar ?? 0;
|
|
2565
2588
|
}
|
|
2566
2589
|
function u(r) {
|
|
2567
|
-
let i =
|
|
2568
|
-
|
|
2590
|
+
let i = jn(e, t, n);
|
|
2591
|
+
q(a, i), H(r === "input" ? a.oninput : a.onchange, a.value, i);
|
|
2569
2592
|
}
|
|
2570
|
-
function d(e) {
|
|
2571
|
-
return
|
|
2593
|
+
function d(e, t) {
|
|
2594
|
+
return t ? (Math.PI - e) / (Math.PI / 2) : e / (Math.PI / 2);
|
|
2572
2595
|
}
|
|
2573
2596
|
function f(e) {
|
|
2574
|
-
|
|
2597
|
+
i = !0, r?.focus(), h.activate(e);
|
|
2598
|
+
}
|
|
2599
|
+
function p() {
|
|
2600
|
+
n = Math.PI - n, u("change");
|
|
2575
2601
|
}
|
|
2576
|
-
let
|
|
2577
|
-
onStart: (
|
|
2602
|
+
let m = !1, h = de({
|
|
2603
|
+
onStart: () => {
|
|
2604
|
+
m = c();
|
|
2605
|
+
},
|
|
2578
2606
|
onMove: (e) => {
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
let e = [Math.cos(t), Math.sin(t)], i = [s, c], a = (e[0] * i[0] + e[1] * i[1]) / Math.sqrt(e[0] * e[0] + e[1] * e[1]);
|
|
2583
|
-
n = Math.PI * H(a, 0, .5), r && (n = Math.PI - n);
|
|
2584
|
-
}
|
|
2585
|
-
u("input"), F.default.redraw();
|
|
2607
|
+
e.preventDefault();
|
|
2608
|
+
let i = ue(e, r), a = (i.normalizedX - .5) * 2, o = (i.normalizedY - .5) * 2, s = U(Math.sqrt(a * a + o * o), 0, 1);
|
|
2609
|
+
t = Math.atan2(o, a), n = m ? Math.PI - Math.PI / 2 * s : Math.PI / 2 * s, u("input"), F.default.redraw();
|
|
2586
2610
|
},
|
|
2587
|
-
onEnd: (
|
|
2588
|
-
|
|
2611
|
+
onEnd: () => {
|
|
2612
|
+
h.deactivate(), i = !1, u("change"), F.default.redraw();
|
|
2589
2613
|
}
|
|
2590
2614
|
});
|
|
2591
2615
|
return {
|
|
2592
2616
|
onremove: () => {
|
|
2593
|
-
|
|
2617
|
+
h.deactivate();
|
|
2594
2618
|
},
|
|
2595
2619
|
oninit: l,
|
|
2596
2620
|
onupdate: l,
|
|
2597
|
-
view: () =>
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
"
|
|
2603
|
-
"
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
}
|
|
2627
|
-
}, (0, F.default)("div.twk-spherical-knob", {
|
|
2628
|
-
onmousedown: f,
|
|
2629
|
-
ontouchstart: f,
|
|
2630
|
-
tabIndex: 0,
|
|
2631
|
-
style: {
|
|
2632
|
-
aspectRatio: "1",
|
|
2633
|
-
transform: "translateX(100%)"
|
|
2634
|
-
}
|
|
2635
|
-
})))]))
|
|
2621
|
+
view: () => {
|
|
2622
|
+
o = jn(e, t, n, o);
|
|
2623
|
+
let a = c(), s = d(n, a), l = Math.cos(t) * s, u = Math.sin(t) * s;
|
|
2624
|
+
return (0, F.default)("div.twk-spherical-input", {}, [(0, F.default)("div.twk-spherical-info", {}, [
|
|
2625
|
+
(0, F.default)("div.twk-spherical-label", {}, `x: ${o.x.toFixed(2)}`),
|
|
2626
|
+
(0, F.default)("div.twk-spherical-label", {}, `y: ${o.y.toFixed(2)}`),
|
|
2627
|
+
(0, F.default)("div.twk-spherical-label", {}, `z: ${o.z.toFixed(2)}`),
|
|
2628
|
+
(0, F.default)("input.twk-toggle[type='checkbox']", {
|
|
2629
|
+
checked: a,
|
|
2630
|
+
onchange: p,
|
|
2631
|
+
title: "Edit the back side of the sphere"
|
|
2632
|
+
})
|
|
2633
|
+
]), (0, F.default)("div.twk-spherical-pane", {
|
|
2634
|
+
oncreate: (e) => r = e.dom,
|
|
2635
|
+
onmousedown: f,
|
|
2636
|
+
ontouchstart: f,
|
|
2637
|
+
tabIndex: 0,
|
|
2638
|
+
class: W({ "is-dragging": i })
|
|
2639
|
+
}, [(0, F.default)("div.twk-spherical-arm", { style: {
|
|
2640
|
+
width: `${s * 50}%`,
|
|
2641
|
+
transform: `rotate(${t}rad)`
|
|
2642
|
+
} }), (0, F.default)("div.twk-spherical-knob", {
|
|
2643
|
+
class: W({ "is-back": a }),
|
|
2644
|
+
style: {
|
|
2645
|
+
left: `${50 + l * 50}%`,
|
|
2646
|
+
top: `${50 + u * 50}%`
|
|
2647
|
+
}
|
|
2648
|
+
})])]);
|
|
2649
|
+
}
|
|
2636
2650
|
};
|
|
2637
2651
|
};
|
|
2638
|
-
function
|
|
2639
|
-
return 180 / Math.PI * e;
|
|
2640
|
-
}
|
|
2641
|
-
function Tn(e) {
|
|
2652
|
+
function An(e) {
|
|
2642
2653
|
let t = e?.x ?? 0, n = e?.y ?? 0, r = e?.z ?? 0, i = Math.sqrt(t * t + n * n + r * r) || 1;
|
|
2643
2654
|
return {
|
|
2644
2655
|
radius: i,
|
|
@@ -2646,32 +2657,32 @@ function Tn(e) {
|
|
|
2646
2657
|
polar: Math.acos(n / i) || 0
|
|
2647
2658
|
};
|
|
2648
2659
|
}
|
|
2649
|
-
function
|
|
2660
|
+
function jn(e, t, n, r) {
|
|
2650
2661
|
let i = Math.sin(n);
|
|
2651
2662
|
return r ||= {}, r.x = e * Math.cos(t) * i, r.y = e * Math.cos(n), r.z = e * Math.sin(t) * i, r;
|
|
2652
2663
|
}
|
|
2653
2664
|
//#endregion
|
|
2654
2665
|
//#region src/lib/components/controls/string.ts
|
|
2655
|
-
function
|
|
2656
|
-
return (0, F.default)(
|
|
2666
|
+
function Mn(e, t) {
|
|
2667
|
+
return (0, F.default)(Pn, e, t);
|
|
2657
2668
|
}
|
|
2658
|
-
function
|
|
2659
|
-
return (0, F.default)(
|
|
2669
|
+
function Nn(e, t) {
|
|
2670
|
+
return (0, F.default)(Fn, e, t);
|
|
2660
2671
|
}
|
|
2661
|
-
var
|
|
2662
|
-
tagName: "
|
|
2663
|
-
label:
|
|
2664
|
-
class:
|
|
2665
|
-
}, [(0, F.default)(
|
|
2672
|
+
var Pn = () => ({ view: ({ attrs: { tagName: e, label: t, class: n, ...r } }) => J({
|
|
2673
|
+
tagName: `${e || "div"}.twk-string-widget`,
|
|
2674
|
+
label: t ?? r.field,
|
|
2675
|
+
class: n
|
|
2676
|
+
}, [(0, F.default)(Fn, r)]) }), Fn = () => {
|
|
2666
2677
|
let e;
|
|
2667
2678
|
function t(t) {
|
|
2668
2679
|
let n = t.target.value;
|
|
2669
|
-
|
|
2680
|
+
q(e, n), (t.type === "input" ? e.oninput : e.onchange)?.(e.value, n);
|
|
2670
2681
|
}
|
|
2671
2682
|
return { view: (n) => {
|
|
2672
2683
|
e = n.attrs;
|
|
2673
|
-
let r = !e.readonly, i =
|
|
2674
|
-
return (0, F.default)("div.twk-input.twk-string-input", { class:
|
|
2684
|
+
let r = !e.readonly, i = K(e);
|
|
2685
|
+
return (0, F.default)("div.twk-input.twk-string-input", { class: W({ "twk-input-readonly": !!e.readonly }) }, [
|
|
2675
2686
|
e.slotStart ?? null,
|
|
2676
2687
|
r ? null : (0, F.default)("div.twk-input-value", i),
|
|
2677
2688
|
r ? (0, F.default)(e.rows ? "textarea" : "input[type='text']", {
|
|
@@ -2688,31 +2699,31 @@ var kn = () => ({ view: ({ attrs: { label: e, class: t, ...n } }) => q({
|
|
|
2688
2699
|
};
|
|
2689
2700
|
//#endregion
|
|
2690
2701
|
//#region src/lib/components/controls/vector.ts
|
|
2691
|
-
function
|
|
2692
|
-
return (0, F.default)(
|
|
2702
|
+
function In(e, t) {
|
|
2703
|
+
return (0, F.default)(Rn, e, t);
|
|
2693
2704
|
}
|
|
2694
|
-
function
|
|
2695
|
-
return (0, F.default)(
|
|
2705
|
+
function Ln(e, t) {
|
|
2706
|
+
return (0, F.default)(Bn, e, t);
|
|
2696
2707
|
}
|
|
2697
|
-
var
|
|
2698
|
-
tagName: "
|
|
2699
|
-
label:
|
|
2700
|
-
class:
|
|
2701
|
-
}, [(0, F.default)(
|
|
2708
|
+
var Rn = () => ({ view: ({ attrs: { tagName: e, label: t, class: n, ...r } }) => J({
|
|
2709
|
+
tagName: `${e || "div"}.twk-vector-widget`,
|
|
2710
|
+
label: t ?? r.field,
|
|
2711
|
+
class: n
|
|
2712
|
+
}, [(0, F.default)(Bn, r)]) }), zn = [
|
|
2702
2713
|
"x",
|
|
2703
2714
|
"y",
|
|
2704
2715
|
"z"
|
|
2705
|
-
],
|
|
2716
|
+
], Bn = () => {
|
|
2706
2717
|
function e(e, t, n, r) {
|
|
2707
|
-
let i =
|
|
2708
|
-
i[t] = isNaN(n) ? null : n,
|
|
2718
|
+
let i = K(r) || {};
|
|
2719
|
+
i[t] = isNaN(n) ? null : n, q(r, i), (e === "input" ? r.oninput : r.onchange)?.(r.value, i, t);
|
|
2709
2720
|
}
|
|
2710
2721
|
return { view: ({ attrs: t }) => {
|
|
2711
|
-
let n = t.keys ||
|
|
2722
|
+
let n = t.keys || zn, r = t.cols || n.length, i = K(t);
|
|
2712
2723
|
return (0, F.default)("div.twk-vector-input", { style: {
|
|
2713
2724
|
display: "grid",
|
|
2714
2725
|
gridTemplateColumns: `repeat(${r}, 1fr)`
|
|
2715
|
-
} }, n.map((n) =>
|
|
2726
|
+
} }, n.map((n) => Et({
|
|
2716
2727
|
min: t.min,
|
|
2717
2728
|
max: t.max,
|
|
2718
2729
|
step: t.step,
|
|
@@ -2728,28 +2739,28 @@ var Nn = () => ({ view: ({ attrs: { label: e, class: t, ...n } }) => q({
|
|
|
2728
2739
|
};
|
|
2729
2740
|
//#endregion
|
|
2730
2741
|
//#region src/lib/components/controls/bitmask.ts
|
|
2731
|
-
function
|
|
2732
|
-
return (0, F.default)(
|
|
2742
|
+
function Vn(e, t) {
|
|
2743
|
+
return (0, F.default)(Hn, e, t);
|
|
2733
2744
|
}
|
|
2734
|
-
var
|
|
2735
|
-
tagName: "div.twk-Bitmask-widget
|
|
2736
|
-
label:
|
|
2737
|
-
class:
|
|
2738
|
-
}, [(0, F.default)(
|
|
2739
|
-
function
|
|
2740
|
-
return (0, F.default)(
|
|
2745
|
+
var Hn = () => ({ view: ({ attrs: { tagName: e, label: t, class: n, ...r } }) => J({
|
|
2746
|
+
tagName: `${e || "div"}.twk-Bitmask-widget`,
|
|
2747
|
+
label: t ?? r.field,
|
|
2748
|
+
class: n
|
|
2749
|
+
}, [(0, F.default)(Wn, r)]) });
|
|
2750
|
+
function Un(e, t) {
|
|
2751
|
+
return (0, F.default)(Wn, e, t);
|
|
2741
2752
|
}
|
|
2742
|
-
var
|
|
2753
|
+
var Wn = () => {
|
|
2743
2754
|
let e;
|
|
2744
2755
|
function t() {
|
|
2745
2756
|
return e.bitCount || 32;
|
|
2746
2757
|
}
|
|
2747
2758
|
function n(t) {
|
|
2748
|
-
let n =
|
|
2759
|
+
let n = K(e);
|
|
2749
2760
|
n ^= 1 << t, r(n);
|
|
2750
2761
|
}
|
|
2751
2762
|
function r(t) {
|
|
2752
|
-
|
|
2763
|
+
q(e, t), e.oninput?.(e.value, t), e.onchange?.(e.value, t);
|
|
2753
2764
|
}
|
|
2754
2765
|
function i(e, t) {
|
|
2755
2766
|
return (e & 1 << t) != 0;
|
|
@@ -2762,10 +2773,10 @@ var zn = () => {
|
|
|
2762
2773
|
}
|
|
2763
2774
|
return { view: (r) => {
|
|
2764
2775
|
e = r.attrs;
|
|
2765
|
-
let o = t(), s =
|
|
2776
|
+
let o = t(), s = K(e);
|
|
2766
2777
|
return (0, F.default)("div.twk-bitmask-input", {}, Array.from({ length: o }, (e, t) => (0, F.default)("label.twk-bitmask-row", {
|
|
2767
2778
|
tabindex: 0,
|
|
2768
|
-
class:
|
|
2779
|
+
class: W({ "twk-bitmask-active": i(s, t) }),
|
|
2769
2780
|
onclick: () => n(t)
|
|
2770
2781
|
}, [
|
|
2771
2782
|
(0, F.default)("div.twk-bitmask-indicator", {}),
|
|
@@ -2777,22 +2788,22 @@ var zn = () => {
|
|
|
2777
2788
|
};
|
|
2778
2789
|
//#endregion
|
|
2779
2790
|
//#region src/lib/components/controls/poll.ts
|
|
2780
|
-
function
|
|
2781
|
-
return (0, F.default)(
|
|
2791
|
+
function Gn(e, t) {
|
|
2792
|
+
return (0, F.default)(qn, e, t);
|
|
2782
2793
|
}
|
|
2783
|
-
function
|
|
2784
|
-
return (0, F.default)(
|
|
2794
|
+
function Kn(e, t) {
|
|
2795
|
+
return (0, F.default)(Jn, e, t);
|
|
2785
2796
|
}
|
|
2786
|
-
var
|
|
2787
|
-
tagName: "
|
|
2788
|
-
label:
|
|
2789
|
-
class:
|
|
2790
|
-
}, (0, F.default)(
|
|
2797
|
+
var qn = () => ({ view: ({ attrs: { tagName: e, label: t, field: n, class: r, ...i } }) => J({
|
|
2798
|
+
tagName: `${e || "div"}.twk-input.twk-input-readonly`,
|
|
2799
|
+
label: t ?? n,
|
|
2800
|
+
class: r
|
|
2801
|
+
}, (0, F.default)(Jn, i)) }), Jn = () => {
|
|
2791
2802
|
let e, t, n;
|
|
2792
2803
|
return {
|
|
2793
2804
|
oncreate({ dom: r }) {
|
|
2794
2805
|
e = r, t = setInterval(() => {
|
|
2795
|
-
let t =
|
|
2806
|
+
let t = K(n) ?? "";
|
|
2796
2807
|
e.textContent = String(t);
|
|
2797
2808
|
}, n.interval ?? 500);
|
|
2798
2809
|
},
|
|
@@ -2801,7 +2812,7 @@ var Hn = () => ({ view: ({ attrs: e }) => q({
|
|
|
2801
2812
|
},
|
|
2802
2813
|
view: (e) => (n = e.attrs, (0, F.default)("div.twk-poll", {}))
|
|
2803
2814
|
};
|
|
2804
|
-
},
|
|
2815
|
+
}, Yn = class e {
|
|
2805
2816
|
static build(t) {
|
|
2806
2817
|
let n = new e();
|
|
2807
2818
|
return t(n), n.close();
|
|
@@ -2811,63 +2822,65 @@ var Hn = () => ({ view: ({ attrs: e }) => q({
|
|
|
2811
2822
|
let e = this.schema;
|
|
2812
2823
|
return this.schema = [], e;
|
|
2813
2824
|
}
|
|
2814
|
-
group =
|
|
2815
|
-
flex = $(this,
|
|
2816
|
-
grid = $(this,
|
|
2817
|
-
tabs = $(this,
|
|
2818
|
-
split = $(this,
|
|
2819
|
-
splitContent = $(this,
|
|
2820
|
-
section = $(this,
|
|
2821
|
-
sectionHeader = $(this,
|
|
2822
|
-
sectionFooter = $(this,
|
|
2823
|
-
bar = $(this,
|
|
2824
|
-
barStart = $(this,
|
|
2825
|
-
barEnd = $(this,
|
|
2826
|
-
barContent = $(this,
|
|
2825
|
+
group = Xn(this, me);
|
|
2826
|
+
flex = $(this, _e);
|
|
2827
|
+
grid = $(this, oe);
|
|
2828
|
+
tabs = $(this, Je);
|
|
2829
|
+
split = $(this, We);
|
|
2830
|
+
splitContent = $(this, Ue);
|
|
2831
|
+
section = $(this, Se);
|
|
2832
|
+
sectionHeader = $(this, Ce);
|
|
2833
|
+
sectionFooter = $(this, we);
|
|
2834
|
+
bar = $(this, L);
|
|
2835
|
+
barStart = $(this, re);
|
|
2836
|
+
barEnd = $(this, R);
|
|
2837
|
+
barContent = $(this, ie);
|
|
2827
2838
|
bool = Q(this, Rt);
|
|
2828
|
-
string = Q(this,
|
|
2829
|
-
scalar = Q(this,
|
|
2830
|
-
vector = Q(this,
|
|
2839
|
+
string = Q(this, Pn);
|
|
2840
|
+
scalar = Q(this, Dt);
|
|
2841
|
+
vector = Q(this, Rn);
|
|
2831
2842
|
matrix = Q(this, cn);
|
|
2832
|
-
select = Q(this,
|
|
2833
|
-
angle = Q(this,
|
|
2834
|
-
bitmask = Q(this,
|
|
2835
|
-
poll = Q(this,
|
|
2843
|
+
select = Q(this, Cn);
|
|
2844
|
+
angle = Q(this, jt);
|
|
2845
|
+
bitmask = Q(this, Hn);
|
|
2846
|
+
poll = Q(this, qn);
|
|
2836
2847
|
color = Q(this, en);
|
|
2837
2848
|
colorPicker = Q(this, Xt);
|
|
2849
|
+
point = Q(this, gn);
|
|
2850
|
+
spherical = Q(this, On);
|
|
2838
2851
|
boolInput = Q(this, zt);
|
|
2839
|
-
stringInput = Q(this,
|
|
2840
|
-
scalarInput = Q(this,
|
|
2841
|
-
vectorInput = Q(this,
|
|
2852
|
+
stringInput = Q(this, Fn);
|
|
2853
|
+
scalarInput = Q(this, Ot);
|
|
2854
|
+
vectorInput = Q(this, Bn);
|
|
2842
2855
|
matrixInput = Q(this, un);
|
|
2843
|
-
selectInput = Q(this,
|
|
2856
|
+
selectInput = Q(this, Cn);
|
|
2844
2857
|
angleInput = Q(this, Ft);
|
|
2845
|
-
bitmaskInput = Q(this,
|
|
2846
|
-
pollInput = Q(this,
|
|
2858
|
+
bitmaskInput = Q(this, Wn);
|
|
2859
|
+
pollInput = Q(this, Jn);
|
|
2847
2860
|
colorInput = Q(this, tn);
|
|
2848
2861
|
colorPickerInput = Q(this, Zt);
|
|
2849
|
-
|
|
2850
|
-
|
|
2862
|
+
pointInput = Q(this, _n);
|
|
2863
|
+
sphericalInput = Q(this, kn);
|
|
2851
2864
|
button(e, t = {}) {
|
|
2852
|
-
this.add(
|
|
2865
|
+
this.add(nt, t, e);
|
|
2853
2866
|
}
|
|
2854
2867
|
image(e) {
|
|
2855
|
-
this.add(
|
|
2868
|
+
this.add(Ct, e);
|
|
2856
2869
|
}
|
|
2857
2870
|
divider(e) {
|
|
2858
|
-
this.add(
|
|
2871
|
+
this.add(it, {}, e);
|
|
2859
2872
|
}
|
|
2860
2873
|
tree(e) {
|
|
2861
|
-
this.add(
|
|
2874
|
+
this.add(Qe, e);
|
|
2862
2875
|
}
|
|
2863
2876
|
graph(e) {
|
|
2864
|
-
this.add(
|
|
2877
|
+
this.add(gt, e);
|
|
2865
2878
|
}
|
|
2866
2879
|
widget(e, t) {
|
|
2867
|
-
this.add(
|
|
2880
|
+
this.add(wt, { label: e }, t);
|
|
2868
2881
|
}
|
|
2869
2882
|
pre(e, t) {
|
|
2870
|
-
this.add(
|
|
2883
|
+
this.add(wt, {
|
|
2871
2884
|
label: e,
|
|
2872
2885
|
style: { whiteSpace: "pre" }
|
|
2873
2886
|
}, t);
|
|
@@ -2876,7 +2889,7 @@ var Hn = () => ({ view: ({ attrs: e }) => q({
|
|
|
2876
2889
|
this.add({ view: e });
|
|
2877
2890
|
}
|
|
2878
2891
|
control(e, t) {
|
|
2879
|
-
this.add(
|
|
2892
|
+
this.add(wt, e, t);
|
|
2880
2893
|
}
|
|
2881
2894
|
add(e, t, n) {
|
|
2882
2895
|
if (this.schema) this.schema.push({
|
|
@@ -2887,28 +2900,28 @@ var Hn = () => ({ view: ({ attrs: e }) => q({
|
|
|
2887
2900
|
else throw Error("Cannot use control builder after it was closed");
|
|
2888
2901
|
}
|
|
2889
2902
|
};
|
|
2890
|
-
function
|
|
2903
|
+
function Xn(e, t) {
|
|
2891
2904
|
return function() {
|
|
2892
|
-
let { options: n, children: r } =
|
|
2905
|
+
let { options: n, children: r } = Zn(e, arguments);
|
|
2893
2906
|
e.add(t, n, r);
|
|
2894
2907
|
};
|
|
2895
2908
|
}
|
|
2896
2909
|
function Q(e, t) {
|
|
2897
2910
|
return function() {
|
|
2898
|
-
e.add(t,
|
|
2911
|
+
e.add(t, Qn(arguments));
|
|
2899
2912
|
};
|
|
2900
2913
|
}
|
|
2901
2914
|
function $(e, t) {
|
|
2902
2915
|
return function() {
|
|
2903
|
-
let { options: n, children: r } =
|
|
2916
|
+
let { options: n, children: r } = $n(e, arguments);
|
|
2904
2917
|
e.add(t, n, r);
|
|
2905
2918
|
};
|
|
2906
2919
|
}
|
|
2907
|
-
function
|
|
2920
|
+
function Zn(e, t) {
|
|
2908
2921
|
let n = null, r = {}, i = null;
|
|
2909
2922
|
for (let e = 0; e < t.length; e++) {
|
|
2910
2923
|
let a = t[e];
|
|
2911
|
-
|
|
2924
|
+
z(a) ? n = a : V(a) ? r = a : se(a) && (i = a);
|
|
2912
2925
|
}
|
|
2913
2926
|
n && (r.title = n);
|
|
2914
2927
|
let a = [];
|
|
@@ -2921,11 +2934,11 @@ function Kn(e, t) {
|
|
|
2921
2934
|
children: a
|
|
2922
2935
|
};
|
|
2923
2936
|
}
|
|
2924
|
-
function
|
|
2937
|
+
function Qn(e) {
|
|
2925
2938
|
let t;
|
|
2926
2939
|
return e.length === 1 ? e[0] || {} : (e.length > 1 ? (t = e[2] || {}, t.value = e[0], t.field = e[1], t.label === void 0 && (t.label = String(t.field || ""))) : t = {}, t);
|
|
2927
2940
|
}
|
|
2928
|
-
function
|
|
2941
|
+
function $n(e, t) {
|
|
2929
2942
|
let n = null, r = null;
|
|
2930
2943
|
if (!t.length) return {
|
|
2931
2944
|
options: {},
|
|
@@ -2933,7 +2946,7 @@ function Jn(e, t) {
|
|
|
2933
2946
|
};
|
|
2934
2947
|
for (let e = 0; e < t.length; e++) {
|
|
2935
2948
|
let i = t[e];
|
|
2936
|
-
|
|
2949
|
+
V(i) ? n = i : se(i) && (r = i);
|
|
2937
2950
|
}
|
|
2938
2951
|
let i = [];
|
|
2939
2952
|
if (r) {
|
|
@@ -2946,6 +2959,6 @@ function Jn(e, t) {
|
|
|
2946
2959
|
};
|
|
2947
2960
|
}
|
|
2948
2961
|
//#endregion
|
|
2949
|
-
export { Ft as AngleInputComponent,
|
|
2962
|
+
export { Ft as AngleInputComponent, jt as AngleWidgetComponent, L as BarComponent, ie as BarContentComponent, R as BarEndComponent, re as BarStartComponent, Wn as BitmaskInputComponent, Hn as BitmaskWidgetComponent, zt as BoolInputComponent, Rt as BoolWidgetComponent, Yn as Builder, nt as ButtonComponent, tn as ColorComponent, Zt as ColorPicker, Xt as ColorPickerWidgetComponent, en as ColorWidgetComponent, et as DialogComponent, it as Divider, _e as FlexComponent, gt as GraphComponent, oe as GridComponent, me as GroupComponent, Ct as ImageComponent, on as InputComponent, an as InputWidgetComponent, un as MatrixInputComponent, cn as MatrixWidgetComponent, _n as PointInputComponent, gn as PointWidgetComponent, Jn as PollComponent, qn as PollWidgetComponent, Ot as ScalarInputComponent, Dt as ScalarWidgetComponent, Se as SectionComponent, Te as SectionContentComponent, we as SectionFooterComponent, Ce as SectionHeaderComponent, Cn as SelectComponent, kn as SphericalInputComponent, On as SphericalWidgetComponent, We as SplitComponent, Ue as SplitContentComponent, Fn as StringInputComponent, Pn as StringWidgetComponent, Ke as TabComponent, Je as TabsComponent, Qe as TreeComponent, Bn as VectorInputComponent, Rn as VectorWidgetComponent, wt as WidgetComponent, Ie as binding, Pt as degToRadAdapter, Z as getColorAdapter, K as getControlValue, Ee as getRawValue, Le as h, Bt as hsv2rgb, je as isVnode, Fe as labeledFn, Me as mapChildren, Re as mountUi, Nt as radToDegAdapter, Be as redrawUi, Ne as renderChildren, Vt as rgb2hsv, q as setControlValue, De as setRawValue, At as uiAngleInput, kt as uiAngleWidget, ee as uiBar, ne as uiBarContent, I as uiBarEnd, te as uiBarStart, Un as uiBitmaskInput, Vn as uiBitmaskWidget, Lt as uiBoolInput, It as uiBoolWidget, tt as uiButton, $t as uiColor, Yt as uiColorPicker, Jt as uiColorPickerWidget, Qt as uiColorWidget, $e as uiDialog, rt as uiDivider, ge as uiFlex, ht as uiGraph, ae as uiGrid, pe as uiGroup, St as uiImage, rn as uiInput, nn as uiInputWidget, ln as uiMatrixInput, sn as uiMatrixWidget, mn as uiPoint, hn as uiPointInput, pn as uiPointWidget, Kn as uiPoll, Gn as uiPollWidget, Et as uiScalarInput, Tt as uiScalarWidget, ve as uiSection, xe as uiSectionContent, be as uiSectionFooter, ye as uiSectionHeader, Sn as uiSelect, En as uiSpherical, Dn as uiSphericalInput, Tn as uiSphericalWidget, Ve as uiSplit, He as uiSplitContent, Nn as uiString, Mn as uiStringWidget, qe as uiTabs, Ye as uiTree, Ln as uiVectorInput, In as uiVectorWidget, J as uiWidget, ze as unmountUi };
|
|
2950
2963
|
|
|
2951
2964
|
//# sourceMappingURL=tweak-ui.module.js.map
|