dynamic-html-helpers 1.5.7 → 1.5.9
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/Bundle/htmlhelpers.min.js +15 -15
- package/Bundle/htmlhelpers.min.js.map +3 -3
- package/Bundle/htmlhelpers.script.js +249 -256
- package/Bundle/htmlhelpers.script.js.map +3 -3
- package/Resource/Externals/splat.min.js +1 -1
- package/index.js +13 -11
- package/package.json +1 -1
|
@@ -30,14 +30,14 @@ var HTMLHelpers = (() => {
|
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
// ../Resource/Externals/jqx.min.js
|
|
33
|
-
var F = Symbol.for("toa.symbols");
|
|
33
|
+
var F = /* @__PURE__ */ Symbol.for("toa.symbols");
|
|
34
34
|
Object[F] = Object.create(null, {});
|
|
35
35
|
var { IS: c, isOnly: Fr, maybe: R, $Wrap: Tr, isNothing: ft, addSymbolicExtensions: He, proxyWrapper: G } = dt({ useSymbolicExtensions: false });
|
|
36
36
|
function dt(t = {}) {
|
|
37
|
-
let { useSymbolicExtensions: e } = t, r = pt(), { shouldbeIsSingleObject: n, ISOneOf: o, isExcept: i, verifyNothingness: a, determineType: h2, addSymbolicExtensions:
|
|
38
|
-
e &&
|
|
37
|
+
let { useSymbolicExtensions: e } = t, r = pt(), { shouldbeIsSingleObject: n, ISOneOf: o, isExcept: i, verifyNothingness: a, determineType: h2, addSymbolicExtensions: p2, maybe: E2, $Wrap: f3, detectableProxy: y } = mt(m, e), g2 = y;
|
|
38
|
+
e && p2();
|
|
39
39
|
let S2 = Object[F];
|
|
40
|
-
return { IS: m, isOnly:
|
|
40
|
+
return { IS: m, isOnly: u, maybe: E2, $Wrap: f3, isNothing: a, addSymbolicExtensions: p2, proxyWrapper: g2 };
|
|
41
41
|
function m(l, ...s) {
|
|
42
42
|
let d = Object.getOwnPropertySymbols(l || {})?.some((w) => w === S2.justME) && s.length > 0, b = l?.[S2.justME], x2 = d ? b : typeof l == "symbol" ? S2.isSymbol : l;
|
|
43
43
|
switch (true) {
|
|
@@ -49,13 +49,13 @@ var HTMLHelpers = (() => {
|
|
|
49
49
|
return s.length > 1 ? o(x2, ...s) : h2(l, ...s);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function u(l, ...s) {
|
|
53
53
|
return m({ [S2.justME]: l }, ...s);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
function mt(t, e) {
|
|
57
|
-
let { SymbolAndCustomProxyFactory: r, maybeFactory: n, WrapAnyFactory: o, verifyNothingness: i, determineType: a, detectableProxy: h2 } = gt(t, y), { addSymbolicExtensions:
|
|
58
|
-
return Object.freeze({ shouldbeIsSingleObject: g2, ISOneOf: S2, isExcept:
|
|
57
|
+
let { SymbolAndCustomProxyFactory: r, maybeFactory: n, WrapAnyFactory: o, verifyNothingness: i, determineType: a, detectableProxy: h2 } = gt(t, y), { addSymbolicExtensions: p2 } = r(t, y, e), [E2, f3] = [n(), o(t, y)];
|
|
58
|
+
return Object.freeze({ shouldbeIsSingleObject: g2, ISOneOf: S2, isExcept: u, verifyNothingness: i, determineType: a, detectableProxy: h2, addSymbolicExtensions: p2, maybe: E2, $Wrap: f3 });
|
|
59
59
|
function y(l) {
|
|
60
60
|
return l?.[Object[F].proxy] || t(l);
|
|
61
61
|
}
|
|
@@ -64,7 +64,7 @@ var HTMLHelpers = (() => {
|
|
|
64
64
|
case "defaultValue" in s:
|
|
65
65
|
return m(l, s);
|
|
66
66
|
case "notTypes" in s:
|
|
67
|
-
return
|
|
67
|
+
return u(l, s);
|
|
68
68
|
default:
|
|
69
69
|
return t(l, ...[s.isTypes].flat());
|
|
70
70
|
}
|
|
@@ -73,15 +73,15 @@ var HTMLHelpers = (() => {
|
|
|
73
73
|
return s.some((d) => t(l, d));
|
|
74
74
|
}
|
|
75
75
|
function m(l, { defaultValue: s, isTypes: d = [void 0], notTypes: b } = {}) {
|
|
76
|
-
return d = d?.constructor !== Array ? [d] : d, b = b && b?.constructor !== Array ? [b] : [], b.length < 1 ? t(l, ...d) ? l : s :
|
|
76
|
+
return d = d?.constructor !== Array ? [d] : d, b = b && b?.constructor !== Array ? [b] : [], b.length < 1 ? t(l, ...d) ? l : s : u(l, { isTypes: d, notTypes: b }) ? l : s;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function u(l, { isTypes: s = [void 0], notTypes: d = [void 0] } = {}) {
|
|
79
79
|
return s = s?.constructor !== Array ? [s] : s, d = d?.constructor !== Array ? [d] : d, t(l, ...s) && !t(l, ...d);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
function gt() {
|
|
83
83
|
let t = Object[F], e = { IS: "toa.is", TYPE: "toa.type", IS_SYMBOL: "toa.isASymbol", PROXY: "toa.proxyFor", TARGET: "toa.target", JUSTME: "toa.justME" }, r = { NAN: "NaN", INFINITY: "Infinity", BOOLEAN: "Boolean", OBJECT: "Object", PROXY_PREFIX: "Proxy for" }, n = o();
|
|
84
|
-
return Object.freeze({ SymbolAndCustomProxyFactory: a, maybeFactory:
|
|
84
|
+
return Object.freeze({ SymbolAndCustomProxyFactory: a, maybeFactory: u, WrapAnyFactory: m, verifyNothingness: l, determineType: E2, detectableProxy: n });
|
|
85
85
|
function o() {
|
|
86
86
|
let s = (x2) => ({ get(w, O3) {
|
|
87
87
|
return O3 === Object[F].proxy ? `Proxy for ${x2}` : O3 === Object[F].target ? w : Reflect.get(w, O3);
|
|
@@ -114,12 +114,12 @@ var HTMLHelpers = (() => {
|
|
|
114
114
|
function h2(s) {
|
|
115
115
|
return (ft(s, true) ? { name: "unknown" } : Object.getPrototypeOf(s)?.constructor).name;
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function p2(s, ...d) {
|
|
118
118
|
let b = d.length < 1, x2 = s == null;
|
|
119
119
|
return { noInput: x2, noShouldbe: b, compareTo: !b && d[0], inputCTOR: !x2 && (s?.constructor || Object.getPrototypeOf(s)?.constructor), isNaN: Number.isNaN(s) || R({ trial: (w) => String(s) === r.NAN }), isInfinity: R({ trial: (w) => String(s) }) === r.INFINITY, shouldBeFirstElementIsNothing: !b && l(d[0]) };
|
|
120
120
|
}
|
|
121
121
|
function E2(s, ...d) {
|
|
122
|
-
let { noInput: b, noShouldbe: x2, compareTo: w, inputCTOR: O3, isNaN: ct, isInfinity: lt, shouldBeFirstElementIsNothing: ut } =
|
|
122
|
+
let { noInput: b, noShouldbe: x2, compareTo: w, inputCTOR: O3, isNaN: ct, isInfinity: lt, shouldBeFirstElementIsNothing: ut } = p2(s, ...d);
|
|
123
123
|
switch (d = d.length && d[0], true) {
|
|
124
124
|
case ut:
|
|
125
125
|
return String(s) === String(w);
|
|
@@ -136,10 +136,10 @@ var HTMLHelpers = (() => {
|
|
|
136
136
|
case O3 === Boolean:
|
|
137
137
|
return x2 ? r.BOOLEAN : O3 === d;
|
|
138
138
|
default:
|
|
139
|
-
return y(s, d, x2,
|
|
139
|
+
return y(s, d, x2, f3(s, O3));
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function f3(s, d) {
|
|
143
143
|
switch (true) {
|
|
144
144
|
case s === 0:
|
|
145
145
|
return Number;
|
|
@@ -185,7 +185,7 @@ var HTMLHelpers = (() => {
|
|
|
185
185
|
} } }), Object.freeze(x2);
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function u() {
|
|
189
189
|
let s = (d) => {
|
|
190
190
|
};
|
|
191
191
|
return function({ trial: d, whenError: b = s } = {}) {
|
|
@@ -379,40 +379,40 @@ var HTMLHelpers = (() => {
|
|
|
379
379
|
}
|
|
380
380
|
var W = It;
|
|
381
381
|
function It({ styleSheet: t, createWithId: e } = {}) {
|
|
382
|
-
let { tryParseAtOrNestedRules: r, ruleExists: n, checkParams: o, sheet: i, removeRules: a, consider: h2, currentSheetID:
|
|
383
|
-
function E2(m,
|
|
384
|
-
if (m &&
|
|
385
|
-
Object.keys(
|
|
382
|
+
let { tryParseAtOrNestedRules: r, ruleExists: n, checkParams: o, sheet: i, removeRules: a, consider: h2, currentSheetID: p2 } = jt({ styleSheet: t, createWithId: e });
|
|
383
|
+
function E2(m, u) {
|
|
384
|
+
if (m && u.removeProperties) {
|
|
385
|
+
Object.keys(u.removeProperties).forEach((l) => m.style.removeProperty(ke(l)));
|
|
386
386
|
return;
|
|
387
387
|
}
|
|
388
|
-
Object.entries(
|
|
388
|
+
Object.entries(u).forEach(([l, s]) => {
|
|
389
389
|
l = ke(l.trim()), s = s.trim();
|
|
390
390
|
let d;
|
|
391
|
-
if (/!important/.test(s) && (s = s.slice(0, s.indexOf("!important")).trim(), d = "important"), !CSS.supports(l, s)) return console.error(`StylingFactory ${
|
|
392
|
-
ze(() => m.style.setProperty(l, s, d), `StylingFactory ${
|
|
391
|
+
if (/!important/.test(s) && (s = s.slice(0, s.indexOf("!important")).trim(), d = "important"), !CSS.supports(l, s)) return console.error(`StylingFactory ${p2} error: '${l}' with value '${s}' not supported (yet)`);
|
|
392
|
+
ze(() => m.style.setProperty(l, s, d), `StylingFactory ${p2} (setRule4Selector) failed`);
|
|
393
393
|
});
|
|
394
394
|
}
|
|
395
|
-
function
|
|
396
|
-
if (m = m?.trim?.(), !c(m, String) || !m.length || /[;,]$/g.test(m)) return console.error(`StylingFactory ${
|
|
397
|
-
if (
|
|
395
|
+
function f3(m, u, l = i) {
|
|
396
|
+
if (m = m?.trim?.(), !c(m, String) || !m.length || /[;,]$/g.test(m)) return console.error(`StylingFactory ${p2} (setRules): [${m || "[no selector given]"}] is not a valid selector`);
|
|
397
|
+
if (u.removeRule) return a(m);
|
|
398
398
|
let s = n(m, true), d = s || l.cssRules[l.insertRule(`${m} {}`, l.cssRules.length || 0)];
|
|
399
|
-
return h2(() => E2(d,
|
|
399
|
+
return h2(() => E2(d, u), m, s);
|
|
400
400
|
}
|
|
401
401
|
function y(m) {
|
|
402
|
-
let
|
|
403
|
-
if (!c(l, String) || !l?.trim()?.length) return console.error(`StylingFactory ${
|
|
404
|
-
let s = Ut(
|
|
405
|
-
return ze(() =>
|
|
402
|
+
let u = m.trim().split(/{/, 2), l = u.shift().trim();
|
|
403
|
+
if (!c(l, String) || !l?.trim()?.length) return console.error(`StylingFactory ${p2} (doParse): no (valid) selector could be extracted from rule ${be(m)}`);
|
|
404
|
+
let s = Ut(u.shift());
|
|
405
|
+
return ze(() => f3(l, s), `StylingFactory ${p2} (setRules) failed`);
|
|
406
406
|
}
|
|
407
407
|
function g2(m) {
|
|
408
|
-
let
|
|
409
|
-
return
|
|
408
|
+
let u = r(m);
|
|
409
|
+
return u.done ? u.existing : y(m);
|
|
410
410
|
}
|
|
411
|
-
function S2(m,
|
|
412
|
-
return m.trim().startsWith("@media") ? g2(Jt(m,
|
|
411
|
+
function S2(m, u) {
|
|
412
|
+
return m.trim().startsWith("@media") ? g2(Jt(m, u)) : f3(m, u);
|
|
413
413
|
}
|
|
414
|
-
return function(m,
|
|
415
|
-
return o(m,
|
|
414
|
+
return function(m, u = {}) {
|
|
415
|
+
return o(m, u) && (Object.keys(u).length ? S2(m, u) : g2(m));
|
|
416
416
|
};
|
|
417
417
|
}
|
|
418
418
|
function jt({ styleSheet: t, createWithId: e }) {
|
|
@@ -432,23 +432,23 @@ var HTMLHelpers = (() => {
|
|
|
432
432
|
return [...t.rules].find((m) => S2 ? We(m.selectorText || "", g2) : zt`${kt(g2)}${[..."gim"]}`.test(m.cssText));
|
|
433
433
|
}
|
|
434
434
|
function h2(g2) {
|
|
435
|
-
return /^@charset|@import|namespace/i.test(g2.trim()) ? i(g2) : g2.match(/}/g)?.length > 1 ? { existing:
|
|
435
|
+
return /^@charset|@import|namespace/i.test(g2.trim()) ? i(g2) : g2.match(/}/g)?.length > 1 ? { existing: f3(g2, 1), done: true } : { done: false };
|
|
436
436
|
}
|
|
437
|
-
function
|
|
438
|
-
let S2 = [...t.cssRules].reduce((
|
|
439
|
-
return S2.forEach((
|
|
437
|
+
function p2(g2) {
|
|
438
|
+
let S2 = [...t.cssRules].reduce((u, l, s) => We(l.selectorText || "", g2) && u.concat(s) || u, []), m = S2.length;
|
|
439
|
+
return S2.forEach((u) => t.deleteRule(u)), m > 0 ? console.info(`\u2714 Removed ${m} instance${m > 1 ? "s" : ""} of selector ${g2} from ${n.slice(4)}`) : console.info(`\u2714 Remove rule: selector ${g2} does not exist in ${n.slice(4)}`);
|
|
440
440
|
}
|
|
441
441
|
function E2(g2, S2) {
|
|
442
442
|
return g2 && c(g2, String) && g2.trim().length > 0 && c(S2, Object) || (console.error(`StylingFactory ${n} called with invalid parameters`), false);
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function f3(g2) {
|
|
445
445
|
g2 = g2.trim();
|
|
446
446
|
let S2 = g2.slice(0, g2.indexOf("{")).trim(), m = !!a(S2);
|
|
447
447
|
try {
|
|
448
448
|
return t.insertRule(`${g2}`, t.cssRules.length), m;
|
|
449
|
-
} catch (
|
|
450
|
-
return console.error(`StylingFactory ${n} (tryParse) ${
|
|
451
|
-
${
|
|
449
|
+
} catch (u) {
|
|
450
|
+
return console.error(`StylingFactory ${n} (tryParse) ${u.name} Error:
|
|
451
|
+
${u.message}
|
|
452
452
|
Rule: ${be(g2)}
|
|
453
453
|
${r}`), m;
|
|
454
454
|
}
|
|
@@ -456,14 +456,14 @@ ${r}`), m;
|
|
|
456
456
|
function y(g2, S2, m) {
|
|
457
457
|
try {
|
|
458
458
|
return g2(), m;
|
|
459
|
-
} catch (
|
|
460
|
-
return console.error(`StylingFactory ${n} (tryAddOrModify) ${
|
|
461
|
-
${
|
|
459
|
+
} catch (u) {
|
|
460
|
+
return console.error(`StylingFactory ${n} (tryAddOrModify) ${u.name} Error:
|
|
461
|
+
${u.message}
|
|
462
462
|
Rule: ${be(S2)}
|
|
463
463
|
${r}`), m;
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
return { sheet: t, removeRules:
|
|
466
|
+
return { sheet: t, removeRules: p2, tryParseAtOrNestedRules: h2, ruleExists: a, checkParams: E2, tryParse: f3, consider: y, currentSheetID: n };
|
|
467
467
|
}
|
|
468
468
|
function Jt(t, e) {
|
|
469
469
|
return `${t.trim()} ${Object.entries(e).map(([r, n]) => `${r}: { ${Qt(n)}`)}`;
|
|
@@ -536,10 +536,10 @@ ${r}`), m;
|
|
|
536
536
|
if (r?.children?.length && D(r), r?.attributes) {
|
|
537
537
|
let o = c(r, SVGElement) ? J.svg : J.html;
|
|
538
538
|
[...(r ?? { attributes: [] }).attributes].forEach((i) => {
|
|
539
|
-
let a = i.name.trim().toLowerCase(), h2 = i.value.trim().toLowerCase().replace(q.whiteSpace, ""),
|
|
540
|
-
if (
|
|
541
|
-
let
|
|
542
|
-
|
|
539
|
+
let a = i.name.trim().toLowerCase(), h2 = i.value.trim().toLowerCase().replace(q.whiteSpace, ""), p2 = a === "href" ? !q.validURL.test(h2) : q.notAllowedValues.test(h2), E2 = a.startsWith("data") ? !q.data.test(a) : !!o[a];
|
|
540
|
+
if (p2 || E2) {
|
|
541
|
+
let f3 = ee(i.value || "none", 60);
|
|
542
|
+
f3 += f3.length === 60 ? "..." : "", e.removed[`${i.name}`] = `attribute/property/value not allowed, removed. Value: ${f3}`, r.removeAttribute(i.name);
|
|
543
543
|
}
|
|
544
544
|
});
|
|
545
545
|
}
|
|
@@ -585,53 +585,53 @@ ${r}`), m;
|
|
|
585
585
|
t.logger.log("JQx: [JQx].Popup first call. Dialog element created."), t.dialog({ id: "jqxPopup" }, t.div({ id: "jqxPopupContent" })).render, t.editCssRules(...Me);
|
|
586
586
|
let e = [], [r, n] = [t("#jqxPopupContent"), t.node("#jqxPopup")], o = {};
|
|
587
587
|
return t.handle({ type: "click, cancel", handlers: g2, name: "genericPopupCloseHandler", capture: true, about: "A generic handler for JQx popups" }), Object.freeze({ show: i, remove: a, removeModal: y });
|
|
588
|
-
function i(
|
|
588
|
+
function i(u) {
|
|
589
589
|
if (n.open) switch (true) {
|
|
590
|
-
case h2(
|
|
590
|
+
case h2(u):
|
|
591
591
|
return;
|
|
592
592
|
default:
|
|
593
|
-
return a(), setTimeout(() => i(
|
|
593
|
+
return a(), setTimeout(() => i(u), 200);
|
|
594
594
|
}
|
|
595
|
-
o = { ...
|
|
595
|
+
o = { ...u };
|
|
596
596
|
let { content: l } = o;
|
|
597
|
-
return t.IS(l, String, HTMLElement) || l?.isJQx ?
|
|
597
|
+
return t.IS(l, String, HTMLElement) || l?.isJQx ? p2() : true;
|
|
598
598
|
}
|
|
599
599
|
function a() {
|
|
600
600
|
return o.modal ? m(o.warnMessage) : E2();
|
|
601
601
|
}
|
|
602
|
-
function h2(
|
|
603
|
-
for (let [l, s] of Object.entries(o)) if (s !==
|
|
602
|
+
function h2(u) {
|
|
603
|
+
for (let [l, s] of Object.entries(o)) if (s !== u[l]) return false;
|
|
604
604
|
return true;
|
|
605
605
|
}
|
|
606
|
-
function
|
|
606
|
+
function p2() {
|
|
607
607
|
r.clear();
|
|
608
|
-
let { content:
|
|
608
|
+
let { content: u, modal: l, closeAfter: s } = o;
|
|
609
609
|
l = t.IS(l, Boolean) ? l : false;
|
|
610
610
|
let d = l ? "" : t.div({ id: "closeHandleIcon" });
|
|
611
|
-
r.append(d, t.IS(
|
|
611
|
+
r.append(d, t.IS(u, String) ? t.div(u) : u), n.showModal(), !l && t.IS(s, Number) && S2(a, s);
|
|
612
612
|
}
|
|
613
613
|
function E2() {
|
|
614
|
-
if (n.close(o.returnValue),
|
|
614
|
+
if (n.close(o.returnValue), f3(), t.IS(o.callback, Function)) return e.push(setTimeout(() => o.callback(o.returnValue), 200));
|
|
615
615
|
o = {};
|
|
616
616
|
}
|
|
617
|
-
function
|
|
618
|
-
e.forEach((
|
|
617
|
+
function f3() {
|
|
618
|
+
e.forEach((u) => clearTimeout(u)), e = [];
|
|
619
619
|
}
|
|
620
|
-
function y({ callback:
|
|
621
|
-
o.returnValue = l, o.modal = false, o.callback =
|
|
620
|
+
function y({ callback: u, value: l } = {}) {
|
|
621
|
+
o.returnValue = l, o.modal = false, o.callback = u || o.callback, a();
|
|
622
622
|
}
|
|
623
|
-
function g2({ evt:
|
|
624
|
-
if (!(Object.keys(o).length < 1 || !n.open) && (
|
|
623
|
+
function g2({ evt: u }) {
|
|
624
|
+
if (!(Object.keys(o).length < 1 || !n.open) && (u.type === "cancel" && o.modal && u.preventDefault(), u.target.closest("#closeHandleIcon") || !u.target.closest("#jqxPopupContent"))) return o.activeTimer && clearTimeout(o.activeTimer), a();
|
|
625
625
|
}
|
|
626
|
-
function S2(
|
|
627
|
-
t.IS(
|
|
626
|
+
function S2(u, l) {
|
|
627
|
+
t.IS(u, Function) && t.IS(l, Number) && l > 0 && (f3(), e.push(setTimeout(u, l * 1e3)));
|
|
628
628
|
}
|
|
629
|
-
function m(
|
|
630
|
-
if (!t.IS(
|
|
629
|
+
function m(u) {
|
|
630
|
+
if (!t.IS(u, String, HTMLElement) && !u.isJQx) return;
|
|
631
631
|
let l = r.find$(".warn");
|
|
632
632
|
switch (true) {
|
|
633
633
|
case l.is.empty:
|
|
634
|
-
l = t.div({ class: "warn" },
|
|
634
|
+
l = t.div({ class: "warn" }, u);
|
|
635
635
|
default:
|
|
636
636
|
r.append(l.addClass("active")), S2(() => r.find$(".warn").removeClass("active"), 2);
|
|
637
637
|
}
|
|
@@ -639,41 +639,41 @@ ${r}`), m;
|
|
|
639
639
|
}
|
|
640
640
|
function ne(t) {
|
|
641
641
|
let e = {}, r = "anonymous_";
|
|
642
|
-
function n(
|
|
643
|
-
if (
|
|
644
|
-
let { handler: y, capture: g2, type: S2 } =
|
|
642
|
+
function n(f3) {
|
|
643
|
+
if (f3) {
|
|
644
|
+
let { handler: y, capture: g2, type: S2 } = f3;
|
|
645
645
|
document.addEventListener(S2, y, { capture: g2 });
|
|
646
646
|
}
|
|
647
647
|
}
|
|
648
|
-
function o(
|
|
649
|
-
if (
|
|
650
|
-
let { type: y, handler: g2, capture: S2 } =
|
|
648
|
+
function o(f3) {
|
|
649
|
+
if (f3) {
|
|
650
|
+
let { type: y, handler: g2, capture: S2 } = f3;
|
|
651
651
|
document.removeEventListener(y, g2, { capture: S2 });
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
|
-
function i(
|
|
654
|
+
function i(f3, y, g2, S2) {
|
|
655
655
|
return function(m) {
|
|
656
|
-
if (!A(y)) return
|
|
657
|
-
let
|
|
658
|
-
if (
|
|
659
|
-
let l = t(
|
|
660
|
-
|
|
656
|
+
if (!A(y)) return f3({ evt: m });
|
|
657
|
+
let u = m.target.closest(y);
|
|
658
|
+
if (u) {
|
|
659
|
+
let l = t(u);
|
|
660
|
+
f3({ self: l, me: l, evt: m }), g2 && p2(m.type, S2);
|
|
661
661
|
}
|
|
662
662
|
return true;
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
|
-
function a(
|
|
666
|
-
return e[
|
|
665
|
+
function a(f3) {
|
|
666
|
+
return e[f3] = e[f3] || {}, e[f3];
|
|
667
667
|
}
|
|
668
|
-
function h2(
|
|
669
|
-
return Object.entries(a(
|
|
668
|
+
function h2(f3, y) {
|
|
669
|
+
return Object.entries(a(f3)).find(([g2]) => g2 === y);
|
|
670
670
|
}
|
|
671
|
-
function
|
|
672
|
-
let g2 = h2(
|
|
673
|
-
g2 && (o(g2[1]), delete e[
|
|
671
|
+
function p2(f3, y) {
|
|
672
|
+
let g2 = h2(f3, y);
|
|
673
|
+
g2 && (o(g2[1]), delete e[f3][y], delete oe[y], L.warn(`Removed listener [${y}] for event type [${f3}].`));
|
|
674
674
|
}
|
|
675
|
-
function E2(
|
|
676
|
-
let { type: y, handler: g2, name: S2, capture: m, once:
|
|
675
|
+
function E2(f3) {
|
|
676
|
+
let { type: y, handler: g2, name: S2, capture: m, once: u, selector: l, node: s, about: d } = f3;
|
|
677
677
|
e[y] = e[y] || {};
|
|
678
678
|
let b = Se(S2 || g2.name), x2 = g2;
|
|
679
679
|
if (s instanceof HTMLElement) {
|
|
@@ -682,21 +682,21 @@ ${r}`), m;
|
|
|
682
682
|
}
|
|
683
683
|
switch (true) {
|
|
684
684
|
case !e[y][b]:
|
|
685
|
-
return L.log(`JQx: created listener for event type ${y}, with handler name ${b}`), e[y][b] = { name: b, handler: i(g2, l,
|
|
686
|
-
|
|
685
|
+
return L.log(`JQx: created listener for event type ${y}, with handler name ${b}`), e[y][b] = { name: b, handler: i(g2, l, u, b), capture: Be(y, m), once: !!u, type: y, initialHandler: x2, selector: !!l && l || false, about: !!d && d || false, unListen() {
|
|
686
|
+
p2(y, b);
|
|
687
687
|
} }, e[y][b];
|
|
688
688
|
default:
|
|
689
689
|
return console.warn(`The listener [${b}] for [${y}] exists, it is not re-assigned.`);
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
|
-
return { remove(...
|
|
693
|
-
return
|
|
694
|
-
}, listen: function(
|
|
695
|
-
let { type: y, handler: g2 } =
|
|
692
|
+
return { remove(...f3) {
|
|
693
|
+
return p2(...f3);
|
|
694
|
+
}, listen: function(f3) {
|
|
695
|
+
let { type: y, handler: g2 } = f3;
|
|
696
696
|
if (!A(y) || !c(g2, Function)) return;
|
|
697
|
-
let S2 = E2(
|
|
697
|
+
let S2 = E2(f3);
|
|
698
698
|
if (S2) return n(S2), { type: y, name: S2.name, unListen() {
|
|
699
|
-
|
|
699
|
+
p2(y, S2.name);
|
|
700
700
|
} };
|
|
701
701
|
}, get ListenerStore() {
|
|
702
702
|
return Object.freeze({ ...e });
|
|
@@ -787,24 +787,24 @@ ${r}`), m;
|
|
|
787
787
|
e = false;
|
|
788
788
|
}
|
|
789
789
|
function a(...E2) {
|
|
790
|
-
return r.unshift(...E2.map((
|
|
790
|
+
return r.unshift(...E2.map((f3) => `${se()} \u2A3B ${xe(f3)}`)), console.error(r.slice(0, E2.length).join(`
|
|
791
791
|
`)), n;
|
|
792
792
|
}
|
|
793
793
|
function h2(...E2) {
|
|
794
|
-
return r.unshift(...E2.map((
|
|
794
|
+
return r.unshift(...E2.map((f3) => `${se()} \u26A0 ${xe(f3)}`)), console.warn(r.slice(0, E2.length).join(`
|
|
795
795
|
`)), n;
|
|
796
796
|
}
|
|
797
|
-
function
|
|
798
|
-
let
|
|
799
|
-
switch (!e && r.unshift(...
|
|
797
|
+
function p2(...E2) {
|
|
798
|
+
let f3 = E2.map((y) => `${se()} \u2714 ${xe(y)}`);
|
|
799
|
+
switch (!e && r.unshift(...f3), t) {
|
|
800
800
|
case true:
|
|
801
|
-
console.log(
|
|
801
|
+
console.log(f3.join(`
|
|
802
802
|
`));
|
|
803
803
|
default:
|
|
804
804
|
return n;
|
|
805
805
|
}
|
|
806
806
|
}
|
|
807
|
-
return Object.defineProperties(n, { log: { value:
|
|
807
|
+
return Object.defineProperties(n, { log: { value: p2, enumerable: false }, error: { value: a, enumerable: false }, warn: { value: h2, enumerable: false } }), Object.freeze(n);
|
|
808
808
|
}
|
|
809
809
|
function se() {
|
|
810
810
|
return ((t) => `[${ie(t.getHours())}:${ie(t.getMinutes())}:${ie(t.getSeconds())}.${ie(t.getMilliseconds(), 3)}]`)(/* @__PURE__ */ new Date());
|
|
@@ -844,8 +844,8 @@ ${r}`), m;
|
|
|
844
844
|
}
|
|
845
845
|
function Ve(t) {
|
|
846
846
|
if (!c(t, HTMLElement)) return;
|
|
847
|
-
let e = t.style, r = getComputedStyle(t), n = !![e.visibility, r.visibility].includes("hidden"), o = !![e.display, r.display].includes("none"), i = !!t.hidden, a = parseInt(r.height) < 1 || parseInt(r.width) < 1, h2 = t.offsetTop < 0 || t.offsetLeft + t.offsetWidth < 0 || t.offsetLeft > document.body.offsetWidth,
|
|
848
|
-
return !(i || h2 ||
|
|
847
|
+
let e = t.style, r = getComputedStyle(t), n = !![e.visibility, r.visibility].includes("hidden"), o = !![e.display, r.display].includes("none"), i = !!t.hidden, a = parseInt(r.height) < 1 || parseInt(r.width) < 1, h2 = t.offsetTop < 0 || t.offsetLeft + t.offsetWidth < 0 || t.offsetLeft > document.body.offsetWidth, p2 = +r.opacity == 0 || +(e.opacity || 1) == 0;
|
|
848
|
+
return !(i || h2 || p2 || o || n || a);
|
|
849
849
|
}
|
|
850
850
|
function _e(t) {
|
|
851
851
|
return t?.isConnected ? !![...document.querySelectorAll(":is(:read-write)")].find((e) => e === t) : false;
|
|
@@ -1050,7 +1050,7 @@ ${r}`), m;
|
|
|
1050
1050
|
for (let o of r) {
|
|
1051
1051
|
if (!o.isJQx && A(o)) {
|
|
1052
1052
|
let i = o.trim(), h2 = !/^<(.+)[^>]+>$/m.test(i) ? t.text(o) : C(o);
|
|
1053
|
-
v(e, (
|
|
1053
|
+
v(e, (p2) => p2.append(n ? h2 : P(h2)));
|
|
1054
1054
|
}
|
|
1055
1055
|
H(o) && v(e, (i) => i.append(n ? o : P(o))), o.isJQx && !o.is.empty && v(e, (i) => o.collection.forEach((a) => i.append(n ? a : P(a))));
|
|
1056
1056
|
}
|
|
@@ -1176,9 +1176,9 @@ ${r}`), m;
|
|
|
1176
1176
|
for (let [i, a] of Object.entries(o)) {
|
|
1177
1177
|
if (i = i.trim(), a && !ae(i) || !a) return false;
|
|
1178
1178
|
if (i.toLowerCase() === "id") return e[0].id = a;
|
|
1179
|
-
v(e, (
|
|
1180
|
-
if (i.startsWith("data")) return
|
|
1181
|
-
|
|
1179
|
+
v(e, (p2) => {
|
|
1180
|
+
if (i.startsWith("data")) return p2.dataset[i.slice(i.indexOf("-") + 1)] = a;
|
|
1181
|
+
p2[i] = a;
|
|
1182
1182
|
});
|
|
1183
1183
|
}
|
|
1184
1184
|
return e;
|
|
@@ -1378,17 +1378,17 @@ ${r}`), m;
|
|
|
1378
1378
|
}
|
|
1379
1379
|
function xr(t) {
|
|
1380
1380
|
return function(e) {
|
|
1381
|
-
let { type: r, types: n, origin: o, selector: i, handler: a, handlers: h2, node:
|
|
1381
|
+
let { type: r, types: n, origin: o, selector: i, handler: a, handlers: h2, node: p2, name: E2, capture: f3, once: y, about: g2 } = e;
|
|
1382
1382
|
a = h2 || a, r = n || r, i = o || i;
|
|
1383
1383
|
let S2 = Ae(r), m = E2;
|
|
1384
1384
|
a = c(a, Function) ? [a] : a;
|
|
1385
|
-
let
|
|
1385
|
+
let u = { type: S2, selector: i || o, capture: f3, name: m, once: y, node: p2, about: g2 };
|
|
1386
1386
|
switch (true) {
|
|
1387
1387
|
case (c(S2, Array) && S2.length > 0):
|
|
1388
|
-
for (let l of S2)
|
|
1388
|
+
for (let l of S2) u.type = l, it(a, u, t);
|
|
1389
1389
|
break;
|
|
1390
1390
|
default:
|
|
1391
|
-
return it(a,
|
|
1391
|
+
return it(a, u, t);
|
|
1392
1392
|
}
|
|
1393
1393
|
};
|
|
1394
1394
|
}
|
|
@@ -1404,26 +1404,26 @@ ${r}`), m;
|
|
|
1404
1404
|
return t.activePopup || Object.defineProperty(t, "activePopup", { value: re(t), enumerable: false }), t.activePopup;
|
|
1405
1405
|
}
|
|
1406
1406
|
function vr(t) {
|
|
1407
|
-
let e = (
|
|
1408
|
-
return W({ createWithId:
|
|
1409
|
-
}, n = function(...
|
|
1410
|
-
for (let y of
|
|
1407
|
+
let e = (f3, y) => Ce(f3, y), r = function(f3) {
|
|
1408
|
+
return W({ createWithId: f3 || `jqx${fe()}` });
|
|
1409
|
+
}, n = function(...f3) {
|
|
1410
|
+
for (let y of f3) Ce(y);
|
|
1411
1411
|
}, o = mr(t), i = ne(t), a = xr(i);
|
|
1412
|
-
return { editCssRule: e, createStyle: r, editCssRules: n, allowProhibit: o, handle: a, capturedHandling: a, log: (...
|
|
1412
|
+
return { editCssRule: e, createStyle: r, editCssRules: n, allowProhibit: o, handle: a, capturedHandling: a, log: (...f3) => L.on.log(...f3).off, warn: (...f3) => L.on.warn(...f3).off, error: (...f3) => L.on.error(...f3).off, handlerWrapper: i };
|
|
1413
1413
|
}
|
|
1414
1414
|
function Lr(t) {
|
|
1415
1415
|
let { factoryExtensions: e, instanceExtensions: r } = rt(t);
|
|
1416
1416
|
Oe = e, ge = r;
|
|
1417
|
-
let { editCssRule: n, createStyle: o, editCssRules: i, allowProhibit: a, handle: h2, capturedHandling:
|
|
1418
|
-
return z.setError = (
|
|
1419
|
-
return l ? t.comment(
|
|
1420
|
-
}, node(
|
|
1421
|
-
return l.querySelector(
|
|
1422
|
-
}, nodes(
|
|
1423
|
-
return [...l.querySelectorAll(
|
|
1417
|
+
let { editCssRule: n, createStyle: o, editCssRules: i, allowProhibit: a, handle: h2, capturedHandling: p2, log: E2, warn: f3, error: y, handlerWrapper: g2 } = vr(t), S2 = Er(t), m = ur(t);
|
|
1418
|
+
return z.setError = (u) => (y(`JQx direct element creation error: [${u}] is not a valid tag`), t.br()), { log: E2, warn: f3, error: y, editCssRules: i, createStyle: o, editStylesheet: o, editCssRule: n, escHtml: M, logger: L, proxyWrapper: G, text(u, l = false) {
|
|
1419
|
+
return l ? t.comment(u) : document.createTextNode(u);
|
|
1420
|
+
}, node(u, l = document) {
|
|
1421
|
+
return l.querySelector(u, l);
|
|
1422
|
+
}, nodes(u, l = document) {
|
|
1423
|
+
return [...l.querySelectorAll(u, l)];
|
|
1424
1424
|
}, clearAllTimers: we, get staticFn() {
|
|
1425
|
-
return function(
|
|
1426
|
-
return m(
|
|
1425
|
+
return function(u, l, s) {
|
|
1426
|
+
return m(u, l, s);
|
|
1427
1427
|
};
|
|
1428
1428
|
}, get toBool() {
|
|
1429
1429
|
return Fe;
|
|
@@ -1440,11 +1440,11 @@ ${r}`), m;
|
|
|
1440
1440
|
}, get removeCssRules() {
|
|
1441
1441
|
return ot;
|
|
1442
1442
|
}, get delegate() {
|
|
1443
|
-
return Sr(
|
|
1443
|
+
return Sr(p2);
|
|
1444
1444
|
}, get delegateCaptured() {
|
|
1445
|
-
return
|
|
1445
|
+
return p2;
|
|
1446
1446
|
}, get handle() {
|
|
1447
|
-
return
|
|
1447
|
+
return p2;
|
|
1448
1448
|
}, get listen() {
|
|
1449
1449
|
return g2.listen;
|
|
1450
1450
|
}, get at() {
|
|
@@ -1468,27 +1468,27 @@ ${r}`), m;
|
|
|
1468
1468
|
return st(function(e, r, n = T.BeforeEnd) {
|
|
1469
1469
|
if (e?.isJQx) return e;
|
|
1470
1470
|
let o = c(r, HTMLBRElement);
|
|
1471
|
-
r = (!o && r && r.isJQx ? r[0] : r) || document.body, n = n && Object.values(T).find((
|
|
1472
|
-
let i = _(e), h2 = !i && me(e) || i,
|
|
1471
|
+
r = (!o && r && r.isJQx ? r[0] : r) || document.body, n = n && Object.values(T).find((f3) => n === f3) ? n : void 0;
|
|
1472
|
+
let i = _(e), h2 = !i && me(e) || i, p2 = { collection: ue(e) ?? [], isVirtual: o, isJQx: true }, E2 = Y(p2.collection);
|
|
1473
1473
|
switch (true) {
|
|
1474
|
-
case (
|
|
1475
|
-
for (let
|
|
1474
|
+
case (p2.collection.length && E2 && !o):
|
|
1475
|
+
for (let f3 of p2.collection) r.contains(f3) || I([f3], r, n);
|
|
1476
1476
|
break;
|
|
1477
1477
|
case h2:
|
|
1478
|
-
for (let
|
|
1479
|
-
if (
|
|
1480
|
-
let
|
|
1481
|
-
|
|
1482
|
-
let g2 =
|
|
1483
|
-
|
|
1484
|
-
let S2 =
|
|
1485
|
-
L.log(`JQx: created ${
|
|
1478
|
+
for (let f3 of [e].flat()) p2.collection.push(C(f3));
|
|
1479
|
+
if (p2.collection.length > 0) {
|
|
1480
|
+
let f3 = p2.collection.filter((m) => m?.dataset?.jqxcreationerror);
|
|
1481
|
+
p2.collection = p2.collection.filter((m) => !m?.dataset?.jqxcreationerror);
|
|
1482
|
+
let g2 = p2.collection.map((m) => `${String(m.constructor).split(/function|\(/)[1].trim()}`).length > 1;
|
|
1483
|
+
p2 = pe(p2);
|
|
1484
|
+
let S2 = p2.collection.length > 0 ? Ke(p2) : "sanitized: no elements remaining";
|
|
1485
|
+
L.log(`JQx: created ${p2.isVirtual ? "(virtual)" : ""} instance from ${g2 ? "array of " : ""}HTML string${g2 ? "s" : ""} ${S2}`), p2.isVirtual || I(p2.collection, r, n);
|
|
1486
1486
|
}
|
|
1487
1487
|
break;
|
|
1488
1488
|
default:
|
|
1489
|
-
$e(e, r,
|
|
1489
|
+
$e(e, r, p2);
|
|
1490
1490
|
}
|
|
1491
|
-
return pe(
|
|
1491
|
+
return pe(p2);
|
|
1492
1492
|
});
|
|
1493
1493
|
}
|
|
1494
1494
|
var En = at;
|
|
@@ -1516,11 +1516,11 @@ ${r}`), m;
|
|
|
1516
1516
|
}, finalize(d = "", Z2 = "", b = "", $2 = "") {
|
|
1517
1517
|
return h2.replace(/~([\d+]?)/g, "$1").replace(/dtf/, d).replace(/era/, b).replace(/dp\b|~dp\b/, Z2).replace(/yn\b/, $2).replace(/\[(\d+?)]/g, (w, Fe2) => D2[Fe2].trim()).trim();
|
|
1518
1518
|
} };
|
|
1519
|
-
},
|
|
1520
|
-
let D2 = c2(...
|
|
1519
|
+
}, u = (l) => l.replace(/\s+/g, ""), c2 = (...l) => l?.reduce((y, h2) => ({ ...y, ...o.retrieveDyn(h2) || o.fixed[h2] }), o.fixed.dl), i = (l, y, h2) => {
|
|
1520
|
+
let D2 = c2(...u(h2).split(",")), d = Intl.DateTimeFormat(D2.locale, D2).format(l);
|
|
1521
1521
|
return y.finalize(d);
|
|
1522
1522
|
}, m = (l, y, h2, D2) => l.toLocaleString(y, { timeZone: h2, month: D2 ? t : n }), T2 = (l, y, h2) => {
|
|
1523
|
-
let D2 = c2(...y.units.concat(
|
|
1523
|
+
let D2 = c2(...y.units.concat(u(h2).split(",")).flat()), d = { ...o.fixed }, Z2 = ($2, w) => D2[$2] === "numeric" && w.startsWith("0") ? w.slice(1) : w, b = Intl.DateTimeFormat(D2.locale, D2).formatToParts(l).reduce(($2, w) => w.type === "literal" && /[ ,/-]/.test(w.value) ? $2 : { ...$2, [w.type]: Z2(w.type, w.value) }, {});
|
|
1524
1524
|
return d.ms = D2.fractionalSecondDigits ? d.msp : d.ms, d.yyyy = b.relatedYear ? d.ry : d.yyyy, y.formatStr = y.formatStr.replace(o.re, ($2) => /^(M|MM)$/.test($2) ? m(l, D2.locale, D2.timeZone, /^M$/.test($2)) : b[Object.keys(d[$2]).shift()] || $2), y.finalize(void 0, b.dayPeriod, b.era, b.yearName);
|
|
1525
1525
|
};
|
|
1526
1526
|
return (l, y, h2 = "l:default") => /ds:|ts:/.test(h2) ? i(l, s(void 0), h2) : T2(l, s(y || void 0), h2);
|
|
@@ -1530,26 +1530,26 @@ ${r}`), m;
|
|
|
1530
1530
|
let e = (t, a) => {
|
|
1531
1531
|
let o = isNaN(new Date(t)), s = isNaN(new Date(a));
|
|
1532
1532
|
if (s) {
|
|
1533
|
-
let [
|
|
1534
|
-
return { error: true, message:
|
|
1533
|
+
let [u, c2, i] = Array(3).fill("end date not valid");
|
|
1534
|
+
return { error: true, message: u, full: c2, clean: i };
|
|
1535
1535
|
}
|
|
1536
1536
|
if (o) {
|
|
1537
|
-
let [
|
|
1538
|
-
return { error: true, message:
|
|
1537
|
+
let [u, c2, i] = Array(3).fill("start date not valid");
|
|
1538
|
+
return { error: true, message: u, full: c2, clean: i };
|
|
1539
1539
|
}
|
|
1540
1540
|
if (o && !s) {
|
|
1541
|
-
let [
|
|
1542
|
-
return { error: true, message:
|
|
1541
|
+
let [u, c2, i] = Array(3).fill("start- and/or end date are not valid");
|
|
1542
|
+
return { error: true, message: u, full: c2, clean: i };
|
|
1543
1543
|
}
|
|
1544
1544
|
return { error: false };
|
|
1545
1545
|
}, r = n();
|
|
1546
1546
|
return function({ start: t, end: a, diffs: o = {} } = {}) {
|
|
1547
|
-
let s = e(t, a),
|
|
1547
|
+
let s = e(t, a), u = a > t ? "+" : "-";
|
|
1548
1548
|
if (s.error) return s;
|
|
1549
1549
|
let c2 = Math.abs(t - a), i = new Date(c2), m = i.getUTCFullYear() - 1970, T2 = i.getUTCMonth(), l = i.getUTCDate() - 1, y = l % 7, h2 = Math.floor(l / 7), D2 = i.getUTCHours(), d = i.getUTCMinutes(), Z2 = i.getUTCSeconds(), b = i.getUTCMilliseconds(), $2 = Math.floor(c2 / 864e5);
|
|
1550
1550
|
o = { ...o, fromUTC: t, toUTC: a, sign: "", years: m, months: T2, days: l, hours: D2, minutes: d, seconds: Z2, milliseconds: b, diffInDays: $2 }, o.full = r({ values: o, full: true }), o.clean = r({ values: o }), o.equalDates = o.clean === "Dates are equal";
|
|
1551
1551
|
let w = D2 + d + Z2 > 0 ? "T" : "";
|
|
1552
|
-
return o.clean !== "Dates are equal" && (o.sign =
|
|
1552
|
+
return o.clean !== "Dates are equal" && (o.sign = u, o.jsPeriod = `${u}P${m > 0 ? `${m}Y` : ""}${T2 > 0 ? `${T2}M` : ""}${h2 > 0 ? `${h2}W` : ""}${y > 0 ? `${y}D` : ""}${w}${D2 > 0 ? `${D2}H` : ""}${d > 0 ? `${d}M` : ""}${Z2 > 0 ? `${Z2}S` : ""}`, o.ISOPeriod = `P${m > 0 ? `${m}Y` : ""}${T2 > 0 ? `${T2}M` : ""}${l > 0 ? `${l}D` : ""}${w}${D2 > 0 ? `${D2}H` : ""}${d > 0 ? `${d}M` : ""}${Z2 > 0 ? `${Z2}S` : ""}`), o;
|
|
1553
1553
|
};
|
|
1554
1554
|
function n() {
|
|
1555
1555
|
let t = (...i) => (m) => i.reduce((T2, l) => l(T2), m), a = (i, m) => i === 1 ? m.slice(0, -1) : m;
|
|
@@ -1563,18 +1563,18 @@ ${r}`), m;
|
|
|
1563
1563
|
return r = t[0].trim().startsWith("subtract,"), r && (t = a ? t[0].trim().replace(/^subtract,/i, "").split(",").map((o) => o.trim()) : t.filter((o) => !o.startsWith("subtract"))), a && !r && (t = t[0].split(",").map((o) => o.trim())), t.map(function(o) {
|
|
1564
1564
|
if (!o) return false;
|
|
1565
1565
|
let s = o.toLowerCase().split(/ {1,}/);
|
|
1566
|
-
return s.length < 2 ? false : s.map((
|
|
1567
|
-
|
|
1568
|
-
let c2 = parseInt(
|
|
1569
|
-
return Number.isNaN(c2) ?
|
|
1566
|
+
return s.length < 2 ? false : s.map((u) => {
|
|
1567
|
+
u = `${u}`.trim().replace(/[^a-z0-9-+]/g, "");
|
|
1568
|
+
let c2 = parseInt(u, 10);
|
|
1569
|
+
return Number.isNaN(c2) ? u : r ? -c2 : +c2;
|
|
1570
1570
|
});
|
|
1571
1571
|
}).filter((o) => o);
|
|
1572
1572
|
};
|
|
1573
1573
|
return function(t, ...a) {
|
|
1574
1574
|
if (a.length < 1) return t;
|
|
1575
1575
|
let o = n(...a);
|
|
1576
|
-
return o.length && o.forEach(([s,
|
|
1577
|
-
|
|
1576
|
+
return o.length && o.forEach(([s, u]) => {
|
|
1577
|
+
u = u, u = e[u], s && u && t[`set${u}`](t[`get${u}`]() + s);
|
|
1578
1578
|
}), t;
|
|
1579
1579
|
};
|
|
1580
1580
|
}
|
|
@@ -1616,8 +1616,8 @@ ${r}`), m;
|
|
|
1616
1616
|
return { locale: n, timeZone: t, monthName: o[0], dayName: o[1], dayNames: ae2(n), monthNames: Y2(n) };
|
|
1617
1617
|
}
|
|
1618
1618
|
function B2(e, r = false) {
|
|
1619
|
-
let [n, t, a, o] = U2(e, r),
|
|
1620
|
-
return Object.freeze(
|
|
1619
|
+
let [n, t, a, o] = U2(e, r), u = { values4Timezone: r ? g.timeZone : e.timeZone, hours: n, minutes: t, seconds: a, milliseconds: o };
|
|
1620
|
+
return Object.freeze(u);
|
|
1621
1621
|
}
|
|
1622
1622
|
function U2(e, r = false) {
|
|
1623
1623
|
let t = `l:en-CA,${r ? `tz:${g.timeZone}` : `tz:${e.timeZone}`},hrc:23,ts:medium`;
|
|
@@ -1648,8 +1648,8 @@ ${r}`), m;
|
|
|
1648
1648
|
}
|
|
1649
1649
|
function R2({ start: e, end: r } = {}) {
|
|
1650
1650
|
r || (r = e.clone), r?.clone || (r = f(r, { timeZone: e.timeZone })), e = f(fe2(e, e.timeZone), { timeZone: e.timeZone }), r = f(fe2(r, r.timeZone), { timeZone: r.timeZone });
|
|
1651
|
-
let n = ge2({ start: e, end: r, diffs: { timeZoneStart: e.timeZone, timeZoneEnd: r.timeZone } }), t = xe2(r, e), a = n.sign.startsWith("-") ? "ahead of" : "behind", [o, s] = t.map((i) => Math.abs(i)), [
|
|
1652
|
-
return n.timeZonesOffsetDifference = n.sign.length < 1 || o + s === 0 ? `Offsets of ${e.timeZone} and ${r.timeZone} are equal` : `${e.timeZone} is ${
|
|
1651
|
+
let n = ge2({ start: e, end: r, diffs: { timeZoneStart: e.timeZone, timeZoneEnd: r.timeZone } }), t = xe2(r, e), a = n.sign.startsWith("-") ? "ahead of" : "behind", [o, s] = t.map((i) => Math.abs(i)), [u, c2] = [`${o} ${C2(o, "hour")}`, `${s} ${C2(s, "minute")}`];
|
|
1652
|
+
return n.timeZonesOffsetDifference = n.sign.length < 1 || o + s === 0 ? `Offsets of ${e.timeZone} and ${r.timeZone} are equal` : `${e.timeZone} is ${u}${s > 0 ? ` and ${c2}` : ""} ${a} ${r.timeZone}`, n;
|
|
1653
1653
|
}
|
|
1654
1654
|
function X2(e, r) {
|
|
1655
1655
|
r = String(r).toLowerCase() === "utc" || r.timeZone === "UTC" ? e.clone.relocate({ timeZone: "UTC" }) : f(e.value, { timeZone: r.timeZone || g.timeZone });
|
|
@@ -1672,16 +1672,16 @@ ${r}`), m;
|
|
|
1672
1672
|
}
|
|
1673
1673
|
function pe2(e, { withFormat: r, withFormatOptions: n, local: t = false } = {}) {
|
|
1674
1674
|
if (r) return t ? me2(e, r, $D.localeInformation.formatOptions) : me2(e, r, n);
|
|
1675
|
-
let a = e.clone.relocate({ locale: "en" }), o = t ? g.formatOptions : a.localeInfo.formatOptions,
|
|
1676
|
-
return a.format(
|
|
1675
|
+
let a = e.clone.relocate({ locale: "en" }), o = t ? g.formatOptions : a.localeInfo.formatOptions, u = `wd M dd yyyy hh:mmi:ss ${a.format("tz", o + ",tzn:longOffset").replace(":", "")} (tz)`;
|
|
1676
|
+
return a.format(u, o + ",tzn:long, hrc:23");
|
|
1677
1677
|
}
|
|
1678
1678
|
function ee2(e, r = false) {
|
|
1679
1679
|
let n = Intl.DateTimeFormat("en", { timeZone: r ? e.timeZone : g.timeZone, weekday: "short" });
|
|
1680
1680
|
return ye2(n.format(e));
|
|
1681
1681
|
}
|
|
1682
1682
|
function $e2(e) {
|
|
1683
|
-
let r = g, n = e.localeInfo, t = e.clone.relocate({ locale: r.locale, timeZone: r.timeZone }), a = e.offsetFrom(t), o = t.offsetFrom(e), s = r,
|
|
1684
|
-
return n.timeZone !== r.timeZone && (m.locales.remote = { locale:
|
|
1683
|
+
let r = g, n = e.localeInfo, t = e.clone.relocate({ locale: r.locale, timeZone: r.timeZone }), a = e.offsetFrom(t), o = t.offsetFrom(e), s = r, u = n, c2 = e.format("hh:mmi:ss dp", `hrc:12,tz:${e.timeZone}`), i = t.format("hh:mmi:ss dp", `hrc:12,tz:${t.timeZone}`), m = { note: "'user' are values for your locale/timeZone, 'remote' (if applicable) idem for the instance", locales: { user: { locale: s.locale, timeZone: s.timeZone } }, dateTime: { user: { ...e.dateTime, monthName: t.monthName, weekdayNr: t.day, weekdayName: t.dayName, dayPeriodTime: i, hasDST: t.hasDST, DSTActive: t.DSTActive, offsetFromRemote: a.offset, string: t.toString() } }, offset: { fromUTC: e.UTC.offsetFrom(e).offsetText } };
|
|
1684
|
+
return n.timeZone !== r.timeZone && (m.locales.remote = { locale: u.locale, timeZone: u.timeZone }, m.dateTime.remote = { ...e.zoneDateTime, monthName: e.zoneNames.monthName, weekdayNr: ee2(e, true), weekdayName: e.zoneNames.dayName, dayPeriodTime: c2, hasDST: e.hasDST, DSTActive: e.DSTActive, offsetFromUser: o.offset, string: e.toString() }, m.offset.fromUserTime = o.offsetText), m;
|
|
1685
1685
|
}
|
|
1686
1686
|
function O(e, r = true) {
|
|
1687
1687
|
if (r) return [e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()];
|
|
@@ -1794,8 +1794,8 @@ ${r}`), m;
|
|
|
1794
1794
|
function Ee2({ localeInfo: e, customMethods: r, dateValue: n } = {}) {
|
|
1795
1795
|
let t, a = { add(...o) {
|
|
1796
1796
|
return H2(t, ...o);
|
|
1797
|
-
}, between({ start: o, end: s, include:
|
|
1798
|
-
return W2(t, { start: o, end: s, include:
|
|
1797
|
+
}, between({ start: o, end: s, include: u } = {}) {
|
|
1798
|
+
return W2(t, { start: o, end: s, include: u });
|
|
1799
1799
|
}, cloneWith(o) {
|
|
1800
1800
|
return re2(t, o);
|
|
1801
1801
|
}, daysUntil(o) {
|
|
@@ -1822,32 +1822,32 @@ ${r}`), m;
|
|
|
1822
1822
|
return X2(t, o);
|
|
1823
1823
|
}, previous(o, s) {
|
|
1824
1824
|
return x(t, { day: o, next: false, preserveTodayWhenEqual: !!s });
|
|
1825
|
-
}, relocate({ locale: o, timeZone: s, l:
|
|
1826
|
-
return Ze2(t, { locale: o, timeZone: s, l:
|
|
1825
|
+
}, relocate({ locale: o, timeZone: s, l: u, tz: c2 } = {}) {
|
|
1826
|
+
return Ze2(t, { locale: o, timeZone: s, l: u, tz: c2 });
|
|
1827
1827
|
}, revalue(o) {
|
|
1828
1828
|
return t = be2(t, o), t;
|
|
1829
|
-
}, setDateValues({ year: o, month: s, date:
|
|
1830
|
-
return v2(t, { year: o, month: s, date:
|
|
1831
|
-
}, setTimeValues({ hours: o, minutes: s, seconds:
|
|
1832
|
-
return I2(t, { hours: o, minutes: s, seconds:
|
|
1829
|
+
}, setDateValues({ year: o, month: s, date: u } = {}) {
|
|
1830
|
+
return v2(t, { year: o, month: s, date: u });
|
|
1831
|
+
}, setTimeValues({ hours: o, minutes: s, seconds: u, milliseconds: c2 } = {}) {
|
|
1832
|
+
return I2(t, { hours: o, minutes: s, seconds: u, milliseconds: c2 });
|
|
1833
1833
|
}, subtract(...o) {
|
|
1834
1834
|
return H2(t, "subtract," + o.join(","));
|
|
1835
1835
|
}, toArray(o = false) {
|
|
1836
1836
|
return O(t, o);
|
|
1837
|
-
}, toString({ template: o, formatOptions: s, local:
|
|
1838
|
-
return pe2(t, { withFormat: o, withFormatOptions: s, local:
|
|
1837
|
+
}, toString({ template: o, formatOptions: s, local: u } = {}) {
|
|
1838
|
+
return pe2(t, { withFormat: o, withFormatOptions: s, local: u });
|
|
1839
1839
|
}, values(o = false) {
|
|
1840
1840
|
return o ? t.dateTime : t.zoneDateTime;
|
|
1841
1841
|
}, zoneFormat(o, s) {
|
|
1842
1842
|
return _2(t, { zoneTime: true, formatStr: o, moreOptions: s });
|
|
1843
|
-
}, set date({ year: o, month: s, date:
|
|
1844
|
-
v2(t, { year: o, month: s, date:
|
|
1843
|
+
}, set date({ year: o, month: s, date: u }) {
|
|
1844
|
+
v2(t, { year: o, month: s, date: u });
|
|
1845
1845
|
}, set dateNr(o) {
|
|
1846
1846
|
v2(t, { date: o });
|
|
1847
1847
|
}, set hours(o) {
|
|
1848
1848
|
I2(t, { hours: o });
|
|
1849
|
-
}, set localeInfo({ locale: o, timeZone: s, l:
|
|
1850
|
-
e = z2({ locale: o, timeZone: s, l:
|
|
1849
|
+
}, set localeInfo({ locale: o, timeZone: s, l: u, tz: c2 }) {
|
|
1850
|
+
e = z2({ locale: o, timeZone: s, l: u, tz: c2 });
|
|
1851
1851
|
}, set milliseconds(o) {
|
|
1852
1852
|
I2(t, { milliseconds: `${o}` });
|
|
1853
1853
|
}, set minutes(o) {
|
|
@@ -1856,8 +1856,8 @@ ${r}`), m;
|
|
|
1856
1856
|
v2(t, { month: o });
|
|
1857
1857
|
}, set seconds(o) {
|
|
1858
1858
|
I2(t, { seconds: o });
|
|
1859
|
-
}, set time({ hours: o, minutes: s, seconds:
|
|
1860
|
-
I2(t, { hours: o, minutes: s, seconds:
|
|
1859
|
+
}, set time({ hours: o, minutes: s, seconds: u, milliseconds: c2 }) {
|
|
1860
|
+
I2(t, { hours: o, minutes: s, seconds: u, milliseconds: c2 });
|
|
1861
1861
|
}, set year(o) {
|
|
1862
1862
|
v2(t, { year: o });
|
|
1863
1863
|
}, get age() {
|
|
@@ -2060,7 +2060,7 @@ ${r}`), m;
|
|
|
2060
2060
|
}
|
|
2061
2061
|
}
|
|
2062
2062
|
function Ge2({ timeZoneDate: e, timeZoneID: r, userTimeZoneID: n } = {}) {
|
|
2063
|
-
let t = { timeZone: p({ timeZone: r }).timeZone }, a = { timeZone: p({ timeZone: n || "" }).timeZone }, o = f(e, t), s = f(e, a),
|
|
2063
|
+
let t = { timeZone: p({ timeZone: r }).timeZone }, a = { timeZone: p({ timeZone: n || "" }).timeZone }, o = f(e, t), s = f(e, a), u = s.differenceTo(o), c2 = o.offsetFrom(s).offset, [i, m] = A2(c2, true), T2 = s.clone.add(`${i} hours, ${m} minutes`), y = u.equalDates ? "No difference" : `Time offset ${c2}: ${a.timeZone} is ${u.clean} ${i < 0 ? "behind" : "ahead of"} ${t.timeZone}`;
|
|
2064
2064
|
return { remoteTimezone: t.timeZone, userTimezone: a.timeZone, timeDifference: y, result: { [t.timeZone.replace(/\//, "_")]: f(e).toString({ template: "yyyy/mm/dd hh:mmi:ss", formatOptions: "hrc:23" }), [a.timeZone.replace(/\//, "_")]: T2.toString({ template: "yyyy/mm/dd hh:mmi:ss", formatOptions: "hrc:23" }) } };
|
|
2065
2065
|
}
|
|
2066
2066
|
function S(e) {
|
|
@@ -2105,8 +2105,8 @@ ${r}`), m;
|
|
|
2105
2105
|
for (let [t, a] of Object.entries(r || {})) {
|
|
2106
2106
|
let o = a.enumerable, s = a.isGetter ? { get() {
|
|
2107
2107
|
return a.method(e);
|
|
2108
|
-
}, enumerable: o } : { value(...
|
|
2109
|
-
return a.method(e, ...
|
|
2108
|
+
}, enumerable: o } : { value(...u) {
|
|
2109
|
+
return a.method(e, ...u);
|
|
2110
2110
|
}, enumerable: o };
|
|
2111
2111
|
Object.defineProperty(n, t, s);
|
|
2112
2112
|
}
|
|
@@ -2139,8 +2139,8 @@ ${r}`), m;
|
|
|
2139
2139
|
return a[1] -= 1, a;
|
|
2140
2140
|
} }, format: { value({ date: n, template: t, timeZone: a, locale: o, opts: s } = {}) {
|
|
2141
2141
|
n = n || n?.value || /* @__PURE__ */ new Date(), t = t?.constructor === String ? t : "yyyy/mm/dd hh:mmi:ss dp";
|
|
2142
|
-
let
|
|
2143
|
-
return
|
|
2142
|
+
let u = p({ timeZone: a, locale: o }).formatOptions;
|
|
2143
|
+
return u += s ? `,${s}` : "", M2(n, t, u);
|
|
2144
2144
|
} }, addCustom: { value({ name: n, method: t, enumerable: a = false, isGetter: o = false } = {}) {
|
|
2145
2145
|
n?.constructor === String && t?.constructor === Function && t.length > 0 && (r[n] = { method: t, enumerable: a, isGetter: o });
|
|
2146
2146
|
} }, validateLocaleInformation: { value: p }, timeAcrossZones: { value: Ge2 }, weeksInYear: { value(n) {
|
|
@@ -2256,74 +2256,64 @@ ${r}`), m;
|
|
|
2256
2256
|
}
|
|
2257
2257
|
|
|
2258
2258
|
// ../Resource/Externals/splat.min.js
|
|
2259
|
-
var
|
|
2260
|
-
var
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
return r = u(r, String, Number) ? String(r) : void 0, a && O2(), function(n, ...t) {
|
|
2266
|
-
return d(n, y(t));
|
|
2259
|
+
var O2 = f2();
|
|
2260
|
+
var h = f2({ defaultReplacer: "" });
|
|
2261
|
+
function f2(i = {}) {
|
|
2262
|
+
let { defaultReplacer: n, useSymbolicExtensions: a } = i;
|
|
2263
|
+
return n = l(n) ? String(n) : void 0, typeof a == "boolean" && a && v3(), function(e, ...t) {
|
|
2264
|
+
return j3(e, m(t));
|
|
2267
2265
|
};
|
|
2268
|
-
function
|
|
2269
|
-
return t &&
|
|
2266
|
+
function p2(e, t) {
|
|
2267
|
+
return t && typeof n == "string" ? String(n) : `{${e}}`;
|
|
2270
2268
|
}
|
|
2271
|
-
function e
|
|
2272
|
-
let
|
|
2273
|
-
return
|
|
2269
|
+
function s(e, t) {
|
|
2270
|
+
let r = Object.hasOwn(t, e);
|
|
2271
|
+
return r && l(t[e]) ? String(t[e]) : p2(e, r);
|
|
2274
2272
|
}
|
|
2275
|
-
function
|
|
2273
|
+
function y(e) {
|
|
2276
2274
|
return (...t) => {
|
|
2277
|
-
let
|
|
2278
|
-
return
|
|
2275
|
+
let r = t.find((o) => o.key);
|
|
2276
|
+
return s(r ? r.key : "_", e);
|
|
2279
2277
|
};
|
|
2280
2278
|
}
|
|
2281
|
-
function
|
|
2282
|
-
return
|
|
2279
|
+
function b(e, t) {
|
|
2280
|
+
return e.replace(/\{(?<key>[a-z_\d]+)}/gim, y(t));
|
|
2283
2281
|
}
|
|
2284
|
-
function
|
|
2282
|
+
function d(e) {
|
|
2285
2283
|
let t = [];
|
|
2286
|
-
return Object.entries(
|
|
2287
|
-
|
|
2284
|
+
return Object.entries(e).forEach(([r, o]) => {
|
|
2285
|
+
o.forEach((c2, u) => (t[u] ??= {}, t[u][r] = c2));
|
|
2288
2286
|
}), t;
|
|
2289
2287
|
}
|
|
2290
|
-
function g2(
|
|
2291
|
-
return
|
|
2288
|
+
function g2(e) {
|
|
2289
|
+
return e.length === 1 && Object.values(e[0]).every(Array.isArray);
|
|
2292
2290
|
}
|
|
2293
|
-
function
|
|
2294
|
-
return g2(
|
|
2291
|
+
function m(e) {
|
|
2292
|
+
return g2(e) ? d(e[0]) : e;
|
|
2295
2293
|
}
|
|
2296
|
-
function
|
|
2297
|
-
|
|
2298
|
-
return u(r, void 0) ? i : i.replace(/\{[a-z_\d].+\}/gim, String(r));
|
|
2294
|
+
function l(e) {
|
|
2295
|
+
return typeof e == "string" || typeof e == "number";
|
|
2299
2296
|
}
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
return String.prototype[Symbol.for("interpolate")] || Object.defineProperties(String.prototype, { [Symbol.for("interpolate")]: { value(...r) {
|
|
2303
|
-
return v3(this, ...r);
|
|
2304
|
-
} }, [Symbol.for("interpolate$")]: { value(...r) {
|
|
2305
|
-
return N3(this, ...r);
|
|
2306
|
-
} } }), [Symbol.for("interpolate"), Symbol.for("interpolate$")];
|
|
2307
|
-
}
|
|
2308
|
-
function h() {
|
|
2309
|
-
let r = new Intl.Collator("en", { sensitivity: "base" }), f2 = (e) => typeof e == "function" ? e?.name || e?.constructor?.name : "noCTOR";
|
|
2310
|
-
function a(e, o) {
|
|
2311
|
-
return o === Number && (Number.isNaN(e) || !Number.isFinite(e)) ? false : r.compare(Object.prototype.toString.call(e), `[object ${f2(o)}]`) === 0 || e?.name === o?.name;
|
|
2297
|
+
function S2(e) {
|
|
2298
|
+
return Object.prototype.toString.call(e) === "[object Object]";
|
|
2312
2299
|
}
|
|
2313
|
-
function
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
return false;
|
|
2317
|
-
}
|
|
2318
|
-
return a(e, o?.shift());
|
|
2300
|
+
function j3(e, t) {
|
|
2301
|
+
let r = t?.length ? t.filter((o) => S2(o)).map((o, c2) => b(e, { ...o, index: c2 + 1 })).join("") : e;
|
|
2302
|
+
return typeof n != "string" ? r : r.replace(/\{.+}/gmi, n ?? "");
|
|
2319
2303
|
}
|
|
2320
|
-
|
|
2304
|
+
}
|
|
2305
|
+
function v3() {
|
|
2306
|
+
return String.prototype[/* @__PURE__ */ Symbol.for("interpolate")] || Object.defineProperties(String.prototype, { [/* @__PURE__ */ Symbol.for("interpolate")]: { value(...i) {
|
|
2307
|
+
return O2(this, ...i);
|
|
2308
|
+
} }, [/* @__PURE__ */ Symbol.for("interpolate$")]: { value(...i) {
|
|
2309
|
+
return h(this, ...i);
|
|
2310
|
+
} } }), [/* @__PURE__ */ Symbol.for("interpolate"), /* @__PURE__ */ Symbol.for("interpolate$")];
|
|
2321
2311
|
}
|
|
2322
2312
|
|
|
2323
2313
|
// ../index.js
|
|
2324
2314
|
setDefaultStyling();
|
|
2325
2315
|
fixSBLinks2TopProblem();
|
|
2326
|
-
var splatModule = { interpolate:
|
|
2316
|
+
var splatModule = { interpolate: O2, interpolateClear: h, addSymbolicStringExtensions: v3 };
|
|
2327
2317
|
function fixSBLinks2TopProblem() {
|
|
2328
2318
|
/stackblitz/i.test(location.href) && console.info(`\u2714 Stackblitz rewrites links to _top. The 'stackblitzhelpers' module fixed it.`);
|
|
2329
2319
|
document.addEventListener(`click`, (evt) => {
|
|
@@ -2338,26 +2328,29 @@ ${r}`), m;
|
|
|
2338
2328
|
}
|
|
2339
2329
|
function logFactory(formatJSON = true) {
|
|
2340
2330
|
const logContainer = En(`<ul id="log2screen">`).first();
|
|
2331
|
+
const [logLamda, logTopLambda] = [logItem(), logItem(true)];
|
|
2332
|
+
return {
|
|
2333
|
+
log: (...txt) => txt.forEach(logLamda),
|
|
2334
|
+
logTop: (...txt) => txt.forEach(logTopLambda)
|
|
2335
|
+
};
|
|
2341
2336
|
function logItem(top2 = false) {
|
|
2342
2337
|
const where2PutIt = top2 ? En.at.start : En.at.end;
|
|
2343
2338
|
return (content) => {
|
|
2344
2339
|
if (content?.isJQx) {
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2340
|
+
const item2 = En.li().append(content);
|
|
2341
|
+
if (content.data.get(`header`)) {
|
|
2342
|
+
item2.addClass(`head`);
|
|
2343
|
+
}
|
|
2344
|
+
return item2.renderTo(logContainer, where2PutIt);
|
|
2349
2345
|
}
|
|
2350
2346
|
content = !En.IS(content, String, Number, Symbol) ? tryJSON(content, formatJSON) : String(content);
|
|
2351
2347
|
const isHead = content.startsWith(`!!`);
|
|
2352
2348
|
content = isHead ? content.slice(2) : content;
|
|
2353
|
-
En.li(
|
|
2349
|
+
const item = En.li(content);
|
|
2350
|
+
isHead && item.addClass(`head`);
|
|
2351
|
+
item.renderTo(logContainer, where2PutIt);
|
|
2354
2352
|
};
|
|
2355
2353
|
}
|
|
2356
|
-
const [logLamda, logTopLambda] = [logItem(), logItem(true)];
|
|
2357
|
-
return {
|
|
2358
|
-
log: (...txt) => txt.forEach(logLamda),
|
|
2359
|
-
logTop: (...txt) => txt.forEach(logTopLambda)
|
|
2360
|
-
};
|
|
2361
2354
|
}
|
|
2362
2355
|
function tryJSON(content, formatted) {
|
|
2363
2356
|
try {
|